更新桌面端编译配置
This commit is contained in:
parent
63ed5d7256
commit
11ff54e2f1
@ -8,4 +8,9 @@ mkdir -p ./resources
|
|||||||
(cd ./service && npm run build && mv ./dist ../resources/service) &
|
(cd ./service && npm run build && mv ./dist ../resources/service) &
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|
||||||
|
mkdir -p ./software/resources
|
||||||
|
rm -rf ./software/resources
|
||||||
|
cp -r ./resources ./software/
|
||||||
|
|
||||||
echo "finish building services in ./resources"
|
echo "finish building services in ./resources"
|
||||||
|
23
package-lock.json
generated
23
package-lock.json
generated
@ -11,6 +11,7 @@
|
|||||||
"@modelcontextprotocol/sdk": "^1.10.2",
|
"@modelcontextprotocol/sdk": "^1.10.2",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.7",
|
||||||
"bson": "^6.8.0",
|
"bson": "^6.8.0",
|
||||||
|
"node-abi": "^4.4.0",
|
||||||
"openai": "^4.93.0",
|
"openai": "^4.93.0",
|
||||||
"pako": "^2.1.0",
|
"pako": "^2.1.0",
|
||||||
"sqlite": "^5.1.1",
|
"sqlite": "^5.1.1",
|
||||||
@ -2529,15 +2530,15 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-abi": {
|
"node_modules/node-abi": {
|
||||||
"version": "3.74.0",
|
"version": "4.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.4.0.tgz",
|
||||||
"integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==",
|
"integrity": "sha512-+sBEWs/HZ3ZDBtPSPKfYndkTF9ebr1BJm/z2TBDJj/upiOx9J6BeGXRtFyOXz1r6vUqzsCRM5pUr+K83i64agg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": "^7.3.5"
|
"semver": "^7.6.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=22.12.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-addon-api": {
|
"node_modules/node-addon-api": {
|
||||||
@ -2914,6 +2915,18 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prebuild-install/node_modules/node-abi": {
|
||||||
|
"version": "3.74.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz",
|
||||||
|
"integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"semver": "^7.3.5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/promise-inflight": {
|
"node_modules/promise-inflight": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
|
||||||
|
@ -106,10 +106,8 @@
|
|||||||
"bson": "^6.8.0",
|
"bson": "^6.8.0",
|
||||||
"openai": "^4.93.0",
|
"openai": "^4.93.0",
|
||||||
"pako": "^2.1.0",
|
"pako": "^2.1.0",
|
||||||
"sqlite": "^5.1.1",
|
"tesseract.js": "^6.0.1",
|
||||||
"sqlite3": "^5.1.7",
|
"uuid": "^11.1.0",
|
||||||
"tesseract.js": "^6.0.1",
|
|
||||||
"uuid": "^11.1.0",
|
|
||||||
"ws": "^8.18.1"
|
"ws": "^8.18.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
2680
service/package-lock.json
generated
2680
service/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
|||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "ts-node-dev --respawn --transpile-only src/main.ts",
|
"serve": "ts-node-dev --respawn --transpile-only src/main.ts",
|
||||||
"build": "tsc",
|
"build": "tsc && webpack --config webpack.config.js",
|
||||||
"build:watch": "tsc --watch",
|
"build:watch": "tsc --watch",
|
||||||
"start": "node dist/main.js",
|
"start": "node dist/main.js",
|
||||||
"start:prod": "NODE_ENV=production node dist/main.js",
|
"start:prod": "NODE_ENV=production node dist/main.js",
|
||||||
@ -29,22 +29,16 @@
|
|||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"typescript": "^5.6.3",
|
"typescript": "^5.6.3",
|
||||||
|
"webpack-cli": "^6.0.1",
|
||||||
"webpack-node-externals": "^3.0.0"
|
"webpack-node-externals": "^3.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.10.2",
|
"@modelcontextprotocol/sdk": "^1.10.2",
|
||||||
"body-parser": "^1.20.3",
|
"@seald-io/nedb": "^4.1.1",
|
||||||
"chalk": "^5.4.1",
|
|
||||||
"cors": "^2.8.5",
|
|
||||||
"debug": "^4.4.0",
|
|
||||||
"express": "^4.21.1",
|
|
||||||
"morgan": "^1.10.0",
|
|
||||||
"openai": "^4.96.0",
|
"openai": "^4.96.0",
|
||||||
"pako": "^2.1.0",
|
"pako": "^2.1.0",
|
||||||
"pino": "^9.6.0",
|
"pino": "^9.6.0",
|
||||||
"pino-pretty": "^13.0.0",
|
"pino-pretty": "^13.0.0",
|
||||||
"sqlite": "^5.1.1",
|
|
||||||
"sqlite3": "^5.1.7",
|
|
||||||
"tesseract.js": "^6.0.1",
|
"tesseract.js": "^6.0.1",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"ws": "^8.18.1"
|
"ws": "^8.18.1"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import sqlite3 from 'sqlite3';
|
import Datastore from '@seald-io/nedb';
|
||||||
import { open } from 'sqlite';
|
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
@ -20,61 +19,47 @@ export class LocalDB<T extends Entity> {
|
|||||||
|
|
||||||
private async init() {
|
private async init() {
|
||||||
const homedir = os.homedir();
|
const homedir = os.homedir();
|
||||||
const filename = path.join(homedir, '.openmcp', 'index.db');
|
const dbPath = path.join(homedir, '.openmcp', 'nedb');
|
||||||
|
|
||||||
|
if (!fs.existsSync(dbPath)) {
|
||||||
|
fs.mkdirSync(dbPath, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
const filename = path.join(dbPath, `${this.tableName}.db`);
|
||||||
|
|
||||||
if (!dbConnections[filename]) {
|
if (!dbConnections[filename]) {
|
||||||
dbConnections[filename] = await open({
|
dbConnections[filename] = new Datastore({
|
||||||
filename,
|
filename,
|
||||||
driver: sqlite3.Database
|
autoload: true,
|
||||||
|
timestampData: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.db = dbConnections[filename];
|
this.db = dbConnections[filename];
|
||||||
|
await this.db.ensureIndex({ fieldName: 'id', unique: true });
|
||||||
await this.db.exec(`
|
|
||||||
CREATE TABLE IF NOT EXISTS ${this.tableName} (
|
|
||||||
id TEXT PRIMARY KEY,
|
|
||||||
data TEXT NOT NULL
|
|
||||||
)
|
|
||||||
`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async insert(entity: T): Promise<void> {
|
async insert(entity: T): Promise<void> {
|
||||||
await this.db.run(
|
await this.db.update({ id: entity.id }, entity, { upsert: true });
|
||||||
`INSERT OR REPLACE INTO ${this.tableName} (id, data) VALUES (?, ?)`,
|
|
||||||
entity.id,
|
|
||||||
JSON.stringify(entity)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async findById(id: string | number): Promise<T | undefined> {
|
async findById(id: string | number): Promise<T | undefined> {
|
||||||
const row = await this.db.get(
|
return await this.db.findOne({ id });
|
||||||
`SELECT data FROM ${this.tableName} WHERE id = ?`,
|
|
||||||
id
|
|
||||||
);
|
|
||||||
return row ? JSON.parse(row.data) : undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async findAll(): Promise<T[]> {
|
async findAll(): Promise<T[]> {
|
||||||
const rows = await this.db.all(
|
return await this.db.find({});
|
||||||
`SELECT data FROM ${this.tableName}`
|
|
||||||
);
|
|
||||||
return rows.map((row: any) => JSON.parse(row.data));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(id: string | number): Promise<void> {
|
async delete(id: string | number): Promise<void> {
|
||||||
await this.db.run(
|
await this.db.remove({ id });
|
||||||
`DELETE FROM ${this.tableName} WHERE id = ?`,
|
|
||||||
id
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async close(): Promise<void> {
|
async close(): Promise<void> {
|
||||||
await this.db.close();
|
// NeDB 不需要显式关闭
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DiskStorage {
|
class DiskStorage {
|
||||||
#storageHome: string;
|
#storageHome: string;
|
||||||
|
|
||||||
|
31
service/webpack.config.js
Normal file
31
service/webpack.config.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/index.ts',
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
filename: 'bundle.js',
|
||||||
|
libraryTarget: 'commonjs2' // 使用 commonjs2 模块系统
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.ts', '.js'],
|
||||||
|
fallback: {
|
||||||
|
bufferutil: false,
|
||||||
|
'utf-8-validate': false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.ts$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: 'ts-loader'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
target: 'node', // 指定目标环境为 Node.js
|
||||||
|
mode: 'production',
|
||||||
|
optimization: {
|
||||||
|
minimize: true
|
||||||
|
}
|
||||||
|
};
|
@ -1,4 +0,0 @@
|
|||||||
rm -rf dist
|
|
||||||
tsc
|
|
||||||
electron-builder
|
|
||||||
du -h dist/OpenMCP-0.0.1-arm64.dmg
|
|
1291
software/package-lock.json
generated
1291
software/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,9 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "tsc && electron .",
|
"dev": "tsc && electron .",
|
||||||
"build": "webpack --config webpack.config.js",
|
|
||||||
"watch": "webpack --watch --config webpack.config.js",
|
"watch": "webpack --watch --config webpack.config.js",
|
||||||
"dist": "tsc; electron-builder"
|
"build": "tsc && electron-builder"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LSTM-Kirigaya",
|
"name": "LSTM-Kirigaya",
|
||||||
@ -19,15 +18,13 @@
|
|||||||
"bson": "^6.8.0",
|
"bson": "^6.8.0",
|
||||||
"openai": "^4.93.0",
|
"openai": "^4.93.0",
|
||||||
"pako": "^2.1.0",
|
"pako": "^2.1.0",
|
||||||
"sqlite": "^5.1.1",
|
|
||||||
"sqlite3": "^5.1.7",
|
|
||||||
"tesseract.js": "^6.0.1",
|
"tesseract.js": "^6.0.1",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"ws": "^8.18.1"
|
"ws": "^8.18.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ws": "^8.18.1",
|
"@types/ws": "^8.18.1",
|
||||||
"electron": "36.0.0",
|
"electron": "35.0.0",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.6.3"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
@ -42,8 +39,31 @@
|
|||||||
"dist/**/*",
|
"dist/**/*",
|
||||||
"resources/**/*"
|
"resources/**/*"
|
||||||
],
|
],
|
||||||
|
"dmg": {
|
||||||
|
"contents": [
|
||||||
|
{
|
||||||
|
"x": 130,
|
||||||
|
"y": 220
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x": 410,
|
||||||
|
"y": 220,
|
||||||
|
"type": "link",
|
||||||
|
"path": "/Applications"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"mac": {
|
"mac": {
|
||||||
"target": "dmg",
|
"notarize": false,
|
||||||
|
"target": {
|
||||||
|
"target": "default",
|
||||||
|
"arch": [
|
||||||
|
"arm64",
|
||||||
|
"x64"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": "distribution",
|
||||||
|
"hardenedRuntime": true,
|
||||||
"icon": "resources/icons/icon.icns"
|
"icon": "resources/icons/icon.icns"
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
|
@ -36,7 +36,7 @@ wss.on('connection', (ws: any) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 注册消息接受的管线
|
// 注册消息接受的管线
|
||||||
webview.onDidReceiveMessage(message => {
|
webview.onDidReceiveMessage((message: any) => {
|
||||||
console.info(`command: [${message.command || 'No Command'}]`);
|
console.info(`command: [${message.command || 'No Command'}]`);
|
||||||
|
|
||||||
const { command, data } = message;
|
const { command, data } = message;
|
||||||
|
@ -7,9 +7,353 @@
|
|||||||
"type": "blank",
|
"type": "blank",
|
||||||
"componentIndex": 3,
|
"componentIndex": 3,
|
||||||
"storage": {
|
"storage": {
|
||||||
"messages": [],
|
"messages": [
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": "帮我总结一下 https://zenodo.org/records/2597575 这里面的信息",
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912341318,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_a7cf61c5-a34c-43f7-b106-cf94c1f6c108",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_navigate",
|
||||||
|
"arguments": "{\"url\":\"https://zenodo.org/records/2597575\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912347456,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_a7cf61c5-a34c-43f7-b106-cf94c1f6c108",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Navigated to https://zenodo.org/records/2597575"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912354744,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 965,
|
||||||
|
"completion_tokens": 32,
|
||||||
|
"total_tokens": 997,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 896
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 896,
|
||||||
|
"prompt_cache_miss_tokens": 69
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_b898c42a-a96b-41d1-a3aa-8537d67409a0",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_evaluate",
|
||||||
|
"arguments": "{\"script\":\"document.title\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912360016,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_b898c42a-a96b-41d1-a3aa-8537d67409a0",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Execution result:\n\"SLIVER07\"\n\nConsole output:\n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912360042,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 1026,
|
||||||
|
"completion_tokens": 23,
|
||||||
|
"total_tokens": 1049,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 960
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 960,
|
||||||
|
"prompt_cache_miss_tokens": 66
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_73c146d6-cc67-44db-9fb1-e29b4aa905ff",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_evaluate",
|
||||||
|
"arguments": "{\"script\":\"document.querySelector('.ui.segment').innerText\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912364986,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_73c146d6-cc67-44db-9fb1-e29b4aa905ff",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Execution result:\n\"6K\\n VIEWS\\n5K\\n DOWNLOADS\\n Show more details\"\n\nConsole output:\n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912364999,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 1080,
|
||||||
|
"completion_tokens": 30,
|
||||||
|
"total_tokens": 1110,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 1024
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 1024,
|
||||||
|
"prompt_cache_miss_tokens": 56
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_79e67845-a56b-4c4f-9b0f-18ffc4256dc0",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_evaluate",
|
||||||
|
"arguments": "{\"script\":\"document.querySelector('.ui.container').innerText\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912372020,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_79e67845-a56b-4c4f-9b0f-18ffc4256dc0",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Execution result:\n\"\"\n\nConsole output:\n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912372040,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 1158,
|
||||||
|
"completion_tokens": 29,
|
||||||
|
"total_tokens": 1187,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 1088
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 1088,
|
||||||
|
"prompt_cache_miss_tokens": 70
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_bb973651-6752-4464-844c-99f1ca3103c3",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_evaluate",
|
||||||
|
"arguments": "{\"script\":\"document.querySelector('.record-metadata').innerText\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912378594,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_bb973651-6752-4464-844c-99f1ca3103c3",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Script execution failed: Cannot read properties of null (reading 'innerText')"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912378612,
|
||||||
|
"state": "tool call failed",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 1215,
|
||||||
|
"completion_tokens": 30,
|
||||||
|
"total_tokens": 1245,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 1152
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 1152,
|
||||||
|
"prompt_cache_miss_tokens": 63
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_b05ff577-603f-4333-ac8b-26060d059a74",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_evaluate",
|
||||||
|
"arguments": "{\"script\":\"document.querySelector('.record-page').innerText\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912384066,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_b05ff577-603f-4333-ac8b-26060d059a74",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Script execution failed: Cannot read properties of null (reading 'innerText')"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912384085,
|
||||||
|
"state": "tool call failed",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 1255,
|
||||||
|
"completion_tokens": 29,
|
||||||
|
"total_tokens": 1284,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 1024
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 1024,
|
||||||
|
"prompt_cache_miss_tokens": 231
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "",
|
||||||
|
"tool_calls": [
|
||||||
|
{
|
||||||
|
"id": "call_0_dc9d103a-f71d-44ca-ab6c-d9179feac397",
|
||||||
|
"index": 0,
|
||||||
|
"type": "function",
|
||||||
|
"function": {
|
||||||
|
"name": "puppeteer_evaluate",
|
||||||
|
"arguments": "{\"script\":\"document.querySelector('.ui.segment').innerHTML\"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912388903,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "tool",
|
||||||
|
"tool_call_id": "call_0_dc9d103a-f71d-44ca-ab6c-d9179feac397",
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Execution result:\n\"\\n\\n\\n<div class=\\\"ui tiny two statistics rel-mt-1\\\">\\n \\n \\n\\n <div class=\\\"ui statistic\\\">\\n <div class=\\\"value\\\">6K</div>\\n <div class=\\\"label\\\">\\n <i aria-hidden=\\\"true\\\" class=\\\"eye icon\\\"></i>\\n Views\\n </div>\\n </div>\\n\\n <div class=\\\"ui statistic\\\">\\n <div class=\\\"value\\\">5K</div>\\n <div class=\\\"label\\\">\\n <i aria-hidden=\\\"true\\\" class=\\\"download icon\\\"></i>\\n Downloads\\n </div>\\n </div>\\n</div>\\n\\n<div class=\\\"ui accordion rel-mt-1 centered\\\">\\n <div class=\\\"title\\\">\\n <i class=\\\"caret right icon\\\" aria-hidden=\\\"true\\\"></i>\\n <span tabindex=\\\"0\\\" class=\\\"trigger\\\" data-open-text=\\\"Show more details\\\" data-close-text=\\\"Show less details\\\">\\n Show more details\\n </span>\\n </div>\\n\\n <div class=\\\"content\\\">\\n <table id=\\\"record-statistics\\\" class=\\\"ui definition table fluid\\\">\\n <thead>\\n <tr>\\n <th></th>\\n <th class=\\\"right aligned\\\">All versions</th>\\n <th class=\\\"right aligned\\\">This version</th>\\n </tr>\\n </thead>\\n <tbody>\\n <tr>\\n <td>\\n Views\\n <i tabindex=\\\"0\\\" role=\\\"button\\\" style=\\\"position:relative\\\" class=\\\"popup-trigger question circle small icon\\\" aria-expanded=\\\"false\\\" aria-label=\\\"More info\\\" data-variation=\\\"mini inverted\\\">\\n </i>\\n <p role=\\\"tooltip\\\" class=\\\"popup-content ui flowing popup transition hidden\\\">\\n Total views\\n </p>\\n </td>\\n <td data-label=\\\"All versions\\\" class=\\\"right aligned\\\">\\n \\n 6,260\\n \\n</td>\\n <td data-label=\\\"This version\\\" class=\\\"right aligned\\\">\\n \\n 1,533\\n \\n</td>\\n </tr>\\n <tr>\\n <td>\\n Downloads\\n <i tabindex=\\\"0\\\" role=\\\"button\\\" style=\\\"position:relative\\\" class=\\\"popup-trigger question circle small icon\\\" aria-expanded=\\\"false\\\" aria-label=\\\"More info\\\" data-variation=\\\"mini inverted\\\">\\n </i>\\n <p role=\\\"tooltip\\\" class=\\\"popup-content ui flowing popup transition hidden\\\">\\n Total downloads\\n </p>\\n </td>\\n <td data-label=\\\"All versions\\\" class=\\\"right aligned\\\">\\n \\n 5,116\\n \\n</td>\\n <td data-label=\\\"This version\\\" class=\\\"right aligned\\\">\\n \\n 679\\n \\n</td>\\n </tr>\\n <tr>\\n <td>\\n Data volume\\n <i tabindex=\\\"0\\\" role=\\\"button\\\" style=\\\"position:relative\\\" class=\\\"popup-trigger question circle small icon\\\" aria-expanded=\\\"false\\\" aria-label=\\\"More info\\\" data-variation=\\\"mini inverted\\\">\\n </i>\\n <p role=\\\"tooltip\\\" class=\\\"popup-content ui flowing popup transition hidden\\\">\\n Total data volume\\n </p>\\n </td>\\n\\n <td data-label=\\\"All versions\\\" class=\\\"right aligned\\\">11.9 TB</td>\\n <td data-label=\\\"This version\\\" class=\\\"right aligned\\\">1.3 TB</td>\\n </tr>\\n </tbody>\\n </table>\\n <p class=\\\"text-align-center rel-mt-1\\\">\\n <small>\\n <a href=\\\"/help/statistics\\\">More info on how stats are collected....</a>\\n </small>\\n </p>\\n </div>\\n\\n</div>\\n\\n\"\n\nConsole output:\n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912388915,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 1253,
|
||||||
|
"completion_tokens": 30,
|
||||||
|
"total_tokens": 1283,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 896
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 896,
|
||||||
|
"prompt_cache_miss_tokens": 357
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "assistant",
|
||||||
|
"content": "The content of the `.ui.segment` element includes detailed statistics about views, downloads, and data volume for a record. Here's a summary of the data:\n\n### Summary:\n- **Views**: \n - All versions: 6,260\n - This version: 1,533\n- **Downloads**: \n - All versions: 5,116\n - This version: 679\n- **Data Volume**: \n - All versions: 11.9 TB\n - This version: 1.3 TB\n\n### Additional Information:\n- The data is presented in a table format with tooltips for more details.\n- There's a link to learn more about how statistics are collected.\n\nLet me know if you'd like to extract or analyze any specific part of this data further!",
|
||||||
|
"extraInfo": {
|
||||||
|
"created": 1745912401265,
|
||||||
|
"state": "success",
|
||||||
|
"serverName": "deepseek",
|
||||||
|
"usage": {
|
||||||
|
"prompt_tokens": 2463,
|
||||||
|
"completion_tokens": 165,
|
||||||
|
"total_tokens": 2628,
|
||||||
|
"prompt_tokens_details": {
|
||||||
|
"cached_tokens": 960
|
||||||
|
},
|
||||||
|
"prompt_cache_hit_tokens": 960,
|
||||||
|
"prompt_cache_miss_tokens": 1503
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"modelIndex": 0,
|
"modelIndex": 7,
|
||||||
"enableTools": [
|
"enableTools": [
|
||||||
{
|
{
|
||||||
"name": "puppeteer_navigate",
|
"name": "puppeteer_navigate",
|
||||||
@ -50,16 +394,9 @@
|
|||||||
"enableWebSearch": false,
|
"enableWebSearch": false,
|
||||||
"temperature": 0.7,
|
"temperature": 0.7,
|
||||||
"contextLength": 10,
|
"contextLength": 10,
|
||||||
"systemPrompt": ""
|
"systemPrompt": "bing search"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "空白测试 2",
|
|
||||||
"icon": "icon-blank",
|
|
||||||
"type": "blank",
|
|
||||||
"componentIndex": -1,
|
|
||||||
"storage": {}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -9,40 +9,43 @@ const path = require('path');
|
|||||||
|
|
||||||
/** @type WebpackConfig */
|
/** @type WebpackConfig */
|
||||||
const extensionConfig = {
|
const extensionConfig = {
|
||||||
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
|
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
|
||||||
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
|
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
|
||||||
|
|
||||||
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
|
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
|
||||||
output: {
|
output: {
|
||||||
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
|
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'extension.js',
|
filename: 'extension.js',
|
||||||
libraryTarget: 'commonjs2'
|
libraryTarget: 'commonjs2'
|
||||||
},
|
},
|
||||||
externals: {
|
externals: {
|
||||||
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
|
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
|
||||||
// modules added here also need to be added in the .vscodeignore file
|
// modules added here also need to be added in the .vscodeignore file
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
|
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
|
||||||
extensions: ['.ts', '.js']
|
extensions: ['.ts', '.js'],
|
||||||
},
|
fallback: {
|
||||||
module: {
|
bufferutil: false,
|
||||||
rules: [
|
'utf-8-validate': false
|
||||||
{
|
}
|
||||||
test: /\.ts$/,
|
},
|
||||||
exclude: /node_modules/,
|
module: {
|
||||||
use: [
|
rules: [
|
||||||
{
|
{
|
||||||
loader: 'ts-loader'
|
test: /\.ts$/,
|
||||||
}
|
exclude: /node_modules/,
|
||||||
]
|
use: [
|
||||||
}
|
{
|
||||||
]
|
loader: 'ts-loader'
|
||||||
},
|
}
|
||||||
devtool: 'nosources-source-map',
|
]
|
||||||
infrastructureLogging: {
|
}
|
||||||
level: "log", // enables logging required for problem matchers
|
]
|
||||||
},
|
},
|
||||||
};
|
devtool: 'nosources-source-map',
|
||||||
module.exports = [ extensionConfig ];
|
infrastructureLogging: {
|
||||||
|
level: "log", // enables logging required for problem matchers
|
||||||
|
},
|
||||||
|
}; module.exports = [extensionConfig];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user