Compare commits
3 Commits
0c50ebcc2c
...
fb092c8ad6
Author | SHA1 | Date | |
---|---|---|---|
fb092c8ad6 | |||
35a0824423 | |||
![]() |
d973d8437f |
@ -3,6 +3,10 @@
|
||||
## [main] 0.1.5
|
||||
- 修复 gemini 获取模型列表时存在 models 前缀的问题
|
||||
- 增加 web api 功能
|
||||
- 修复无法在对话框中使用 mcp resource 的 bug
|
||||
- 调试结果的工作区从 .vscode 迁移到 .openmcp,连接配置文件从 .vscode/openmcp_connection.json 迁移到 .openmcp/connection.json
|
||||
- 技术栈更新:openmcp 全链路组件切换为 esm
|
||||
- 优化引导界面文字布局。
|
||||
|
||||
## [main] 0.1.4
|
||||
- 重新实现 openai 协议的底层网络实现,从而支持 Google Gemini 全系列模型。
|
||||
|
614
package-lock.json
generated
614
package-lock.json
generated
@ -24,9 +24,7 @@
|
||||
"ws": "^8.18.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@esbuild/win32-x64": "^0.25.5",
|
||||
"@rollup/plugin-inject": "^5.0.5",
|
||||
"@rollup/rollup-win32-x64-msvc": "^4.41.1",
|
||||
"@types/node": "^22.15.29",
|
||||
"@types/pako": "^2.0.3",
|
||||
"@types/showdown": "^2.0.0",
|
||||
@ -39,6 +37,7 @@
|
||||
"turbo": "^2.5.3",
|
||||
"typescript": "^5.4.2",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-dts": "^4.5.4",
|
||||
"vite-plugin-static-copy": "^3.0.0",
|
||||
"vite-plugin-vue-devtools": "^7.7.6",
|
||||
"vue-tsc": "^2.2.10",
|
||||
@ -956,21 +955,6 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.5",
|
||||
"resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.25.5.tgz",
|
||||
"integrity": "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@floating-ui/core": {
|
||||
"version": "1.7.0",
|
||||
"license": "MIT",
|
||||
@ -1110,6 +1094,153 @@
|
||||
"version": "1.0.2",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor": {
|
||||
"version": "7.52.8",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.52.8.tgz",
|
||||
"integrity": "sha512-cszYIcjiNscDoMB1CIKZ3My61+JOhpERGlGr54i6bocvGLrcL/wo9o+RNXMBrb7XgLtKaizZWUpqRduQuHQLdg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@microsoft/api-extractor-model": "7.30.6",
|
||||
"@microsoft/tsdoc": "~0.15.1",
|
||||
"@microsoft/tsdoc-config": "~0.17.1",
|
||||
"@rushstack/node-core-library": "5.13.1",
|
||||
"@rushstack/rig-package": "0.5.3",
|
||||
"@rushstack/terminal": "0.15.3",
|
||||
"@rushstack/ts-command-line": "5.0.1",
|
||||
"lodash": "~4.17.15",
|
||||
"minimatch": "~3.0.3",
|
||||
"resolve": "~1.22.1",
|
||||
"semver": "~7.5.4",
|
||||
"source-map": "~0.6.1",
|
||||
"typescript": "5.8.2"
|
||||
},
|
||||
"bin": {
|
||||
"api-extractor": "bin/api-extractor"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor-model": {
|
||||
"version": "7.30.6",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.30.6.tgz",
|
||||
"integrity": "sha512-znmFn69wf/AIrwHya3fxX6uB5etSIn6vg4Q4RB/tb5VDDs1rqREc+AvMC/p19MUN13CZ7+V/8pkYPTj7q8tftg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@microsoft/tsdoc": "~0.15.1",
|
||||
"@microsoft/tsdoc-config": "~0.17.1",
|
||||
"@rushstack/node-core-library": "5.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor/node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor/node_modules/minimatch": {
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
|
||||
"integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor/node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor/node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor/node_modules/typescript": {
|
||||
"version": "5.8.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
|
||||
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/api-extractor/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@microsoft/tsdoc": {
|
||||
"version": "0.15.1",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.1.tgz",
|
||||
"integrity": "sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@microsoft/tsdoc-config": {
|
||||
"version": "0.17.1",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.1.tgz",
|
||||
"integrity": "sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@microsoft/tsdoc": "0.15.1",
|
||||
"ajv": "~8.12.0",
|
||||
"jju": "~1.4.0",
|
||||
"resolve": "~1.22.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/tsdoc-config/node_modules/ajv": {
|
||||
"version": "8.12.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz",
|
||||
"integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"require-from-string": "^2.0.2",
|
||||
"uri-js": "^4.2.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/@modelcontextprotocol/sdk": {
|
||||
"version": "1.12.1",
|
||||
"license": "MIT",
|
||||
@ -1519,17 +1650,185 @@
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||
"version": "4.41.1",
|
||||
"resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz",
|
||||
"integrity": "sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"node_modules/@rushstack/node-core-library": {
|
||||
"version": "5.13.1",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.13.1.tgz",
|
||||
"integrity": "sha512-5yXhzPFGEkVc9Fu92wsNJ9jlvdwz4RNb2bMso+/+TH0nMm1jDDDsOIf4l8GAkPxGuwPw5DH24RliWVfSPhlW/Q==",
|
||||
"dev": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "~8.13.0",
|
||||
"ajv-draft-04": "~1.0.0",
|
||||
"ajv-formats": "~3.0.1",
|
||||
"fs-extra": "~11.3.0",
|
||||
"import-lazy": "~4.0.0",
|
||||
"jju": "~1.4.0",
|
||||
"resolve": "~1.22.1",
|
||||
"semver": "~7.5.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/node-core-library/node_modules/ajv": {
|
||||
"version": "8.13.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz",
|
||||
"integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"require-from-string": "^2.0.2",
|
||||
"uri-js": "^4.4.1"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/node-core-library/node_modules/ajv-formats": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
|
||||
"integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ajv": "^8.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"ajv": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/node-core-library/node_modules/fs-extra": {
|
||||
"version": "11.3.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz",
|
||||
"integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/node-core-library/node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/node-core-library/node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/node-core-library/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@rushstack/rig-package": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.3.tgz",
|
||||
"integrity": "sha512-olzSSjYrvCNxUFZowevC3uz8gvKr3WTpHQ7BkpjtRpA3wK+T0ybep/SRUMfr195gBzJm5gaXw0ZMgjIyHqJUow==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"resolve": "~1.22.1",
|
||||
"strip-json-comments": "~3.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/terminal": {
|
||||
"version": "0.15.3",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.15.3.tgz",
|
||||
"integrity": "sha512-DGJ0B2Vm69468kZCJkPj3AH5nN+nR9SPmC0rFHtzsS4lBQ7/dgOwtwVxYP7W9JPDMuRBkJ4KHmWKr036eJsj9g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rushstack/node-core-library": "5.13.1",
|
||||
"supports-color": "~8.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/terminal/node_modules/supports-color": {
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/ts-command-line": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.0.1.tgz",
|
||||
"integrity": "sha512-bsbUucn41UXrQK7wgM8CNM/jagBytEyJqXw/umtI8d68vFm1Jwxh1OtLrlW7uGZgjCWiiPH6ooUNa1aVsuVr3Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rushstack/terminal": "0.15.3",
|
||||
"@types/argparse": "1.0.38",
|
||||
"argparse": "~1.0.9",
|
||||
"string-argv": "~0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/ts-command-line/node_modules/argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@seald-io/binary-search-tree": {
|
||||
"version": "1.0.3"
|
||||
@ -1564,6 +1863,13 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/argparse": {
|
||||
"version": "1.0.38",
|
||||
"resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz",
|
||||
"integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/body-parser": {
|
||||
"version": "1.19.5",
|
||||
"dev": true,
|
||||
@ -2380,6 +2686,21 @@
|
||||
"url": "https://github.com/sponsors/epoberezkin"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-draft-04": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz",
|
||||
"integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"ajv": "^8.5.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"ajv": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ajv-formats": {
|
||||
"version": "2.1.1",
|
||||
"dev": true,
|
||||
@ -2834,11 +3155,25 @@
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/compare-versions": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz",
|
||||
"integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/confbox": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz",
|
||||
"integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
@ -3788,6 +4123,13 @@
|
||||
"express": "^4.11 || 5 || ^5.0.0-beta.1"
|
||||
}
|
||||
},
|
||||
"node_modules/exsolve": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.5.tgz",
|
||||
"integrity": "sha512-pz5dvkYYKQ1AHVrgOzBKWeP4u4FRb3a6DNK2ucr0OoNwYIU4QWsJ+NM36LLzORT+z845MzKHHhpXiUF5nvQoJg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-copy": {
|
||||
"version": "3.0.2",
|
||||
"license": "MIT"
|
||||
@ -4393,6 +4735,16 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/import-lazy": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz",
|
||||
"integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/import-local": {
|
||||
"version": "3.2.0",
|
||||
"dev": true,
|
||||
@ -4709,6 +5061,13 @@
|
||||
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/jju": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz",
|
||||
"integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/joycon": {
|
||||
"version": "3.1.1",
|
||||
"license": "MIT",
|
||||
@ -4842,6 +5201,24 @@
|
||||
"node": ">=8.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/local-pkg": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.1.1.tgz",
|
||||
"integrity": "sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mlly": "^1.7.4",
|
||||
"pkg-types": "^2.0.1",
|
||||
"quansync": "^0.2.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
}
|
||||
},
|
||||
"node_modules/localforage": {
|
||||
"version": "1.10.0",
|
||||
"license": "Apache-2.0",
|
||||
@ -5045,6 +5422,38 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mlly": {
|
||||
"version": "1.7.4",
|
||||
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz",
|
||||
"integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"acorn": "^8.14.0",
|
||||
"pathe": "^2.0.1",
|
||||
"pkg-types": "^1.3.0",
|
||||
"ufo": "^1.5.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mlly/node_modules/confbox": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz",
|
||||
"integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mlly/node_modules/pkg-types": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz",
|
||||
"integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"confbox": "^0.1.8",
|
||||
"mlly": "^1.7.4",
|
||||
"pathe": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/mrmime": {
|
||||
"version": "2.0.1",
|
||||
"dev": true,
|
||||
@ -5781,6 +6190,18 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-types": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.1.0.tgz",
|
||||
"integrity": "sha512-wmJwA+8ihJixSoHKxZJRBQG1oY8Yr9pGLzRmSsNms0iNWyHHAlZCa7mmKiFR10YPZuz/2k169JiS/inOjBCZ2A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"confbox": "^0.2.1",
|
||||
"exsolve": "^1.0.1",
|
||||
"pathe": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/possible-typed-array-names": {
|
||||
"version": "1.1.0",
|
||||
"license": "MIT",
|
||||
@ -5929,6 +6350,23 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/quansync": {
|
||||
"version": "0.2.10",
|
||||
"resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.10.tgz",
|
||||
"integrity": "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
},
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/sxzz"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/quick-format-unescaped": {
|
||||
"version": "4.0.4",
|
||||
"license": "MIT"
|
||||
@ -6594,6 +7032,13 @@
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"license": "MIT",
|
||||
@ -6601,6 +7046,16 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/string-argv": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
|
||||
"integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6.19"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
@ -6959,6 +7414,13 @@
|
||||
"version": "2.1.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ufo": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz",
|
||||
"integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/undefsafe": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz",
|
||||
@ -7134,6 +7596,91 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-dts": {
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-4.5.4.tgz",
|
||||
"integrity": "sha512-d4sOM8M/8z7vRXHHq/ebbblfaxENjogAAekcfcDCCwAyvGqnPrc7f4NZbvItS+g4WTgerW0xDwSz5qz11JT3vg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@microsoft/api-extractor": "^7.50.1",
|
||||
"@rollup/pluginutils": "^5.1.4",
|
||||
"@volar/typescript": "^2.4.11",
|
||||
"@vue/language-core": "2.2.0",
|
||||
"compare-versions": "^6.1.1",
|
||||
"debug": "^4.4.0",
|
||||
"kolorist": "^1.8.0",
|
||||
"local-pkg": "^1.0.0",
|
||||
"magic-string": "^0.30.17"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*",
|
||||
"vite": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"vite": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-dts/node_modules/@vue/language-core": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.2.0.tgz",
|
||||
"integrity": "sha512-O1ZZFaaBGkKbsRfnVH1ifOK1/1BUkyK+3SQsfnh6PmMmD4qJcTU8godCeA96jjDRTL6zgnK7YzCHfaUlH2r0Mw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@volar/language-core": "~2.4.11",
|
||||
"@vue/compiler-dom": "^3.5.0",
|
||||
"@vue/compiler-vue2": "^2.7.16",
|
||||
"@vue/shared": "^3.5.0",
|
||||
"alien-signals": "^0.4.9",
|
||||
"minimatch": "^9.0.3",
|
||||
"muggle-string": "^0.4.1",
|
||||
"path-browserify": "^1.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-dts/node_modules/alien-signals": {
|
||||
"version": "0.4.14",
|
||||
"resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-0.4.14.tgz",
|
||||
"integrity": "sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vite-plugin-dts/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-dts/node_modules/minimatch": {
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-inspect": {
|
||||
"version": "0.8.9",
|
||||
"dev": true,
|
||||
@ -7731,6 +8278,7 @@
|
||||
"@codemirror/autocomplete": "^6.18.6",
|
||||
"@codemirror/lang-json": "^6.0.1",
|
||||
"@codemirror/theme-one-dark": "^6.1.2",
|
||||
"chalk": "^5.4.1",
|
||||
"codemirror": "^6.0.1",
|
||||
"core-js": "^3.8.3",
|
||||
"element-plus": "^2.9.9",
|
||||
@ -7773,6 +8321,18 @@
|
||||
"vue-tsc": "^2.2.8"
|
||||
}
|
||||
},
|
||||
"renderer/node_modules/chalk": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz",
|
||||
"integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"renderer/node_modules/openai": {
|
||||
"version": "4.104.0",
|
||||
"license": "Apache-2.0",
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "openmcp",
|
||||
"displayName": "OpenMCP",
|
||||
"description": "An all in one MCP Client/TestTool",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"publisher": "kirigaya",
|
||||
"author": {
|
||||
"name": "kirigaya",
|
||||
@ -244,9 +244,7 @@
|
||||
"ws": "^8.18.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@esbuild/win32-x64": "^0.25.5",
|
||||
"@rollup/plugin-inject": "^5.0.5",
|
||||
"@rollup/rollup-win32-x64-msvc": "^4.41.1",
|
||||
"@types/node": "^22.15.29",
|
||||
"@types/pako": "^2.0.3",
|
||||
"@types/showdown": "^2.0.0",
|
||||
@ -259,6 +257,7 @@
|
||||
"turbo": "^2.5.3",
|
||||
"typescript": "^5.4.2",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-dts": "^4.5.4",
|
||||
"vite-plugin-static-copy": "^3.0.0",
|
||||
"vite-plugin-vue-devtools": "^7.7.6",
|
||||
"vue-tsc": "^2.2.10",
|
||||
|
@ -19,6 +19,7 @@
|
||||
"@codemirror/autocomplete": "^6.18.6",
|
||||
"@codemirror/lang-json": "^6.0.1",
|
||||
"@codemirror/theme-one-dark": "^6.1.2",
|
||||
"chalk": "^5.4.1",
|
||||
"codemirror": "^6.0.1",
|
||||
"core-js": "^3.8.3",
|
||||
"element-plus": "^2.9.9",
|
||||
|
@ -9,6 +9,8 @@ if (fs.existsSync(targetFile)) {
|
||||
content = content.replace(/'element-plus'/g, "'./tools.js'");
|
||||
content = content.replace(/"element-plus"/g, "\"./tools.js\"");
|
||||
|
||||
content = content.replace(/const chalk = require\("chalk"\);/g, 'const chalk = require("chalk").default;');
|
||||
|
||||
// Replace define_window_default$number.performance with performance
|
||||
content = content.replace(/define_window_default\$\d+\.performance/g, 'performance');
|
||||
|
||||
|
@ -132,11 +132,35 @@
|
||||
</template>
|
||||
<div class="tour-common-text">
|
||||
我们目前提供了四种主要调试选项,「资源」、「提词」、「工具」分别和 MCP 协议中的 resources、prompts、tools 对应。
|
||||
</div>
|
||||
</el-tour-step>
|
||||
|
||||
<el-tour-step
|
||||
:target="welcomeRef"
|
||||
:prev-button-props="{ children: '上一步' }"
|
||||
:next-button-props="{ children: '下一步' }"
|
||||
:show-close="false"
|
||||
placement="right"
|
||||
>
|
||||
<template #header>
|
||||
<TourTitle>调试</TourTitle>
|
||||
</template>
|
||||
<div class="tour-common-text">
|
||||
而「交互测试」则允许你直接将写好的 mcp 服务器放入大模型中直接做全链路测试,从而更加获取更加真实的反馈和数据,进而改进的你的 mcp 服务器。
|
||||
</div>
|
||||
</el-tour-step>
|
||||
|
||||
<br><br>
|
||||
|
||||
<el-tour-step
|
||||
:target="welcomeRef"
|
||||
:prev-button-props="{ children: '上一步' }"
|
||||
:next-button-props="{ children: '下一步' }"
|
||||
:show-close="false"
|
||||
placement="right"
|
||||
>
|
||||
<template #header>
|
||||
<TourTitle>调试</TourTitle>
|
||||
</template>
|
||||
<div class="tour-common-text">
|
||||
基于我们在 agent 和 rl 方向的最佳实践,我们后续还会推出更多的调试和数据集聚合制作选项,请期待吧!
|
||||
</div>
|
||||
</el-tour-step>
|
||||
@ -224,10 +248,15 @@
|
||||
:show-close="false"
|
||||
>
|
||||
<template #header>
|
||||
<TourTitle>🎉恭喜</TourTitle>
|
||||
<TourTitle>🎉 恭喜</TourTitle>
|
||||
</template>
|
||||
<div class="tour-common-text">
|
||||
🎉恭喜,我的朋友,现在的你已经是半个 mcp 专家了,请充好一杯咖啡,慢慢享用快乐的开发时间吧!
|
||||
🎉 恭喜,我的朋友,现在的你已经是半个 mcp 专家了,请充好一杯咖啡,慢慢享用快乐的开发时间吧!
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<a href="https://kirigaya.cn/openmcp/" target="_blank">OpenMCP 官方文档</a> 是我们的文档站点,您在其中能找到非常完整的使用说明和案例教程。
|
||||
|
||||
<br><br>
|
||||
|
||||
|
@ -32,7 +32,7 @@ import ResourceReader from '@/components/main-panel/resource/resouce-reader.vue'
|
||||
import { ElMessage, ElTooltip, ElProgress, ElPopover } from 'element-plus';
|
||||
|
||||
import ResourceChatItem from '../resource-chat-item.vue';
|
||||
import { useMessageBridge } from '@/api/message-bridge';
|
||||
import { mcpClientAdapter } from '@/views/connect/core';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@ -60,8 +60,8 @@ function saveCursorPosition() {
|
||||
|
||||
async function handleResourceSelected(resource: Resources) {
|
||||
selectResource.value = undefined;
|
||||
const bridge = useMessageBridge();
|
||||
const { code, msg } = await bridge.commandRequest('resources/read', { resourceUri: resource.uri });
|
||||
const msg = await mcpClientAdapter.readResource(resource.uri);
|
||||
|
||||
if (msg) {
|
||||
await whenGetResourceResponse(msg as ResourcesReadResponse);
|
||||
}
|
||||
@ -123,4 +123,13 @@ async function whenGetResourceResponse(msg: ResourcesReadResponse) {
|
||||
.icon-length {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.el-dialog .el-collapse-item__header {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.el-dialog .el-collapse-item__wrap {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
</style>
|
@ -62,8 +62,6 @@ function deserializeToolCallResponse(toolArgs: string) {
|
||||
|
||||
function handleToolResponse(toolResponse: ToolCallResponse) {
|
||||
if (typeof toolResponse === 'string') {
|
||||
// 如果是 string,说明是错误信息
|
||||
redLog('error happen' + JSON.stringify(toolResponse));
|
||||
|
||||
return {
|
||||
content: [{
|
||||
|
@ -4,7 +4,7 @@ import { type ToolCall, type ChatStorage, getToolSchema, MessageState } from "..
|
||||
import { useMessageBridge, MessageBridge, createMessageBridge } from "@/api/message-bridge";
|
||||
import type { OpenAI } from 'openai';
|
||||
import { llmManager, llms, type BasicLlmDescription } from "@/views/setting/llm";
|
||||
import { pinkLog, redLog } from "@/views/setting/util";
|
||||
import { redLog } from "@/views/setting/util";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { getToolCallIndexAdapter, handleToolCalls, type IToolCallIndex, type ToolCallResult } from "./handle-tool-calls";
|
||||
import { getPlatform } from "@/api/platform";
|
||||
@ -12,6 +12,7 @@ import { getSystemPrompt } from "../chat-box/options/system-prompt";
|
||||
import { mcpSetting } from "@/hook/mcp";
|
||||
import { mcpClientAdapter } from "@/views/connect/core";
|
||||
import type { ToolItem } from "@/hook/type";
|
||||
import chalk from 'chalk';
|
||||
|
||||
export type ChatCompletionChunk = OpenAI.Chat.Completions.ChatCompletionChunk;
|
||||
export type ChatCompletionCreateParamsBase = OpenAI.Chat.Completions.ChatCompletionCreateParams & { id?: string, proxyServer?: string };
|
||||
@ -19,6 +20,7 @@ export interface TaskLoopOptions {
|
||||
maxEpochs?: number;
|
||||
maxJsonParseRetry?: number;
|
||||
adapter?: any;
|
||||
verbose?: 0 | 1 | 2 | 3;
|
||||
}
|
||||
|
||||
export interface IErrorMssage {
|
||||
@ -40,12 +42,12 @@ export class TaskLoop {
|
||||
private streamingToolCalls: Ref<ToolCall[]>;
|
||||
|
||||
private currentChatId = '';
|
||||
private onError: (error: IErrorMssage) => void = (msg) => {};
|
||||
private onChunk: (chunk: ChatCompletionChunk) => void = (chunk) => {};
|
||||
private onDone: () => void = () => {};
|
||||
private onError: (error: IErrorMssage) => void = (msg) => { };
|
||||
private onChunk: (chunk: ChatCompletionChunk) => void = (chunk) => { };
|
||||
private onDone: () => void = () => { };
|
||||
private onToolCall: (toolCall: ToolCall) => ToolCall = toolCall => toolCall;
|
||||
private onToolCalled: (toolCallResult: ToolCallResult) => ToolCallResult = toolCallResult => toolCallResult;
|
||||
private onEpoch: () => void = () => {};
|
||||
private onEpoch: () => void = () => { };
|
||||
private completionUsage: ChatCompletionChunk['usage'] | undefined;
|
||||
private llmConfig?: BasicLlmDescription;
|
||||
|
||||
@ -55,7 +57,12 @@ export class TaskLoop {
|
||||
};
|
||||
|
||||
constructor(
|
||||
private readonly taskOptions: TaskLoopOptions = { maxEpochs: 20, maxJsonParseRetry: 3, adapter: undefined },
|
||||
private readonly taskOptions: TaskLoopOptions = {
|
||||
maxEpochs: 20,
|
||||
maxJsonParseRetry: 3,
|
||||
adapter: undefined,
|
||||
verbose: 0
|
||||
},
|
||||
) {
|
||||
this.streamingContent = ref('');
|
||||
this.streamingToolCalls = ref([]);
|
||||
@ -145,11 +152,12 @@ export class TaskLoop {
|
||||
this.handleChunkDeltaToolCalls(chunk, toolcallIndexAdapter);
|
||||
this.handleChunkUsage(chunk);
|
||||
|
||||
this.onChunk(chunk);
|
||||
this.consumeChunks(chunk);
|
||||
}, { once: false });
|
||||
|
||||
const doneHandler = this.bridge.addCommandListener('llm/chat/completions/done', data => {
|
||||
this.onDone();
|
||||
this.consumeDones();
|
||||
|
||||
chunkHandler();
|
||||
errorHandler();
|
||||
|
||||
@ -159,7 +167,7 @@ export class TaskLoop {
|
||||
}, { once: true });
|
||||
|
||||
const errorHandler = this.bridge.addCommandListener('llm/chat/completions/error', data => {
|
||||
this.onError({
|
||||
this.consumeErrors({
|
||||
state: MessageState.ReceiveChunkError,
|
||||
msg: data.msg || '请求模型服务时发生错误'
|
||||
});
|
||||
@ -293,6 +301,100 @@ export class TaskLoop {
|
||||
this.onToolCalled = handler;
|
||||
}
|
||||
|
||||
private consumeErrors(error: IErrorMssage) {
|
||||
const { verbose = 0 } = this.taskOptions;
|
||||
if (verbose > 0) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.red('error happen in task loop '),
|
||||
chalk.red(error.msg)
|
||||
);
|
||||
}
|
||||
return this.onError(error);
|
||||
}
|
||||
|
||||
private consumeChunks(chunk: ChatCompletionChunk) {
|
||||
const { verbose = 0 } = this.taskOptions;
|
||||
if (verbose > 1) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.blue('receive chunk')
|
||||
);
|
||||
} else if (verbose > 2) {
|
||||
const delta = chunk.choices[0]?.delta;
|
||||
if (delta) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.blue('receive chunk'),
|
||||
chalk.bold(JSON.stringify(delta, null, 2))
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.blue('receive chunk'),
|
||||
chalk.blue('delta is empty')
|
||||
);
|
||||
}
|
||||
}
|
||||
return this.onChunk(chunk);
|
||||
}
|
||||
|
||||
private consumeToolCalls(toolCall: ToolCall) {
|
||||
const { verbose = 0 } = this.taskOptions;
|
||||
|
||||
if (verbose > 0) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.blueBright('🔧 calling tool'),
|
||||
chalk.blueBright(toolCall.function!.name)
|
||||
);
|
||||
}
|
||||
|
||||
return this.onToolCall(toolCall);
|
||||
}
|
||||
|
||||
private consumeToolCalleds(result: ToolCallResult) {
|
||||
const { verbose = 0 } = this.taskOptions;
|
||||
if (verbose > 0) {
|
||||
if (result.state === 'success') {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.green('✓ call tools okey dockey'),
|
||||
chalk.green(result.state)
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.red('× fail to call tools'),
|
||||
chalk.red(result.content.map(item => item.text).join(', '))
|
||||
);
|
||||
}
|
||||
}
|
||||
return this.onToolCalled(result);
|
||||
}
|
||||
|
||||
private consumeEpochs() {
|
||||
const { verbose = 0 } = this.taskOptions;
|
||||
if (verbose > 0) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.blue('task loop enters a new epoch')
|
||||
);
|
||||
}
|
||||
return this.onEpoch();
|
||||
}
|
||||
|
||||
private consumeDones() {
|
||||
const { verbose = 0 } = this.taskOptions;
|
||||
if (verbose > 0) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.green('task loop finish a epoch')
|
||||
);
|
||||
}
|
||||
return this.onDone();
|
||||
}
|
||||
|
||||
public setMaxEpochs(maxEpochs: number) {
|
||||
this.taskOptions.maxEpochs = maxEpochs;
|
||||
}
|
||||
@ -372,11 +474,14 @@ export class TaskLoop {
|
||||
});
|
||||
|
||||
let jsonParseErrorRetryCount = 0;
|
||||
const maxEpochs = this.taskOptions.maxEpochs || 20;
|
||||
const {
|
||||
maxEpochs = 20,
|
||||
verbose = 0
|
||||
} = this.taskOptions || {};
|
||||
|
||||
for (let i = 0; i < maxEpochs; ++ i) {
|
||||
for (let i = 0; i < maxEpochs; ++i) {
|
||||
|
||||
this.onEpoch();
|
||||
this.consumeEpochs();
|
||||
|
||||
// 初始累计清空
|
||||
this.streamingContent.value = '';
|
||||
@ -387,7 +492,7 @@ export class TaskLoop {
|
||||
const chatData = this.makeChatData(tabStorage);
|
||||
|
||||
if (!chatData) {
|
||||
this.onDone();
|
||||
this.consumeDones();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -412,18 +517,27 @@ export class TaskLoop {
|
||||
}
|
||||
});
|
||||
|
||||
pinkLog('调用工具数量:' + this.streamingToolCalls.value.length);
|
||||
if (verbose > 0) {
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.yellow('🤖 llm wants to call these tools'),
|
||||
chalk.yellow(this.streamingToolCalls.value.map(tool => tool.function!.name || '').join(', '))
|
||||
);
|
||||
}
|
||||
|
||||
for (let toolCall of this.streamingToolCalls.value || []) {
|
||||
|
||||
toolCall = this.onToolCall(toolCall);
|
||||
// ready to call tools
|
||||
toolCall = this.consumeToolCalls(toolCall);
|
||||
let toolCallResult = await handleToolCalls(toolCall);
|
||||
toolCallResult = this.onToolCalled(toolCallResult);
|
||||
|
||||
// hook : finish call tools
|
||||
toolCallResult = this.consumeToolCalleds(toolCallResult);
|
||||
|
||||
if (toolCallResult.state === MessageState.ParseJsonError) {
|
||||
// 如果是因为解析 JSON 错误,则重新开始
|
||||
tabStorage.messages.pop();
|
||||
jsonParseErrorRetryCount ++;
|
||||
jsonParseErrorRetryCount++;
|
||||
|
||||
redLog('解析 JSON 错误 ' + toolCall?.function?.arguments);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
</span>
|
||||
|
||||
<p>
|
||||
OpenMCP Client 0.1.4 由 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
|
||||
OpenMCP Client 0.1.5 由 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -6,6 +6,7 @@ import { loadPanels } from "@/hook/panel";
|
||||
import { getPlatform } from "@/api/platform";
|
||||
import type { PromptsGetResponse, PromptsListResponse, PromptTemplate, Resources, ResourcesListResponse, ResourcesReadResponse, ResourceTemplate, ResourceTemplatesListResponse, ToolCallResponse, ToolItem, ToolsListResponse } from "@/hook/type";
|
||||
import { mcpSetting } from "@/hook/mcp";
|
||||
import chalk from "chalk";
|
||||
|
||||
export const connectionSelectDataViewOption: ConnectionTypeOptionItem[] = [
|
||||
{
|
||||
@ -549,9 +550,16 @@ class McpClientAdapter {
|
||||
const ok = await client.connect();
|
||||
|
||||
if (ok) {
|
||||
console.log(`${client.name} connected successfully ✅`);
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.green(`🚀 [${client.name}] ${client.version} connected`)
|
||||
);
|
||||
} else {
|
||||
console.log(`${client.name} connected failed ❌`);
|
||||
console.log(
|
||||
chalk.gray(`[${new Date().toLocaleString()}]`),
|
||||
chalk.red(`× fail to connect `),
|
||||
chalk.red(JSON.stringify(client.connectionResult.logString, null, 2))
|
||||
);
|
||||
}
|
||||
|
||||
allOk &&= ok;
|
||||
|
@ -1,41 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "nodenext",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"useDefineForClassFields": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"moduleResolution": "nodenext",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"useDefineForClassFields": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
},
|
||||
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.vue",
|
||||
"tests/**/*.ts",
|
||||
"tests/**/*.tsx"
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.vue",
|
||||
"tests/**/*.ts",
|
||||
"tests/**/*.tsx"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
@ -33,20 +33,14 @@ async function main() {
|
||||
const adapter = new TaskLoopAdapter();
|
||||
|
||||
// 添加 mcp 服务器
|
||||
adapter.addMcp({
|
||||
connectionType: 'STDIO',
|
||||
commandString: 'uv run mcp run main.py',
|
||||
cwd: '~/projects/openmcp-tutorial/crawl4ai-mcp'
|
||||
});
|
||||
|
||||
adapter.addMcp({
|
||||
connectionType: 'STDIO',
|
||||
commandString: 'node index.js',
|
||||
cwd: '~/projects/openmcp-tutorial/my-browser/dist'
|
||||
});
|
||||
|
||||
// 创建事件循环驱动器
|
||||
const taskLoop = new TaskLoop({ adapter });
|
||||
// 创建事件循环驱动器, verbose 数值越高,输出的日志越详细
|
||||
const taskLoop = new TaskLoop({ adapter, verbose: 1 });
|
||||
|
||||
// 获取所有工具
|
||||
const tools = await taskLoop.getTools();
|
||||
@ -76,31 +70,6 @@ async function main() {
|
||||
// 本次发出的问题
|
||||
const message = 'hello world';
|
||||
|
||||
// 事件循环结束的句柄
|
||||
taskLoop.registerOnDone(() => {
|
||||
console.log('taskLoop done');
|
||||
});
|
||||
|
||||
// 事件循环每一次 epoch 开始的句柄
|
||||
taskLoop.registerOnError((error) => {
|
||||
console.log('taskLoop error', error);
|
||||
});
|
||||
|
||||
// 事件循环出现 error 时的句柄(出现 error 不一定会停止事件循环)
|
||||
taskLoop.registerOnEpoch(() => {
|
||||
console.log('taskLoop epoch');
|
||||
});
|
||||
|
||||
// 每一次工具调用前
|
||||
taskLoop.registerOnToolCall((toolCall) => {
|
||||
return toolCall;
|
||||
});
|
||||
|
||||
// 每一次工具调用完后的结果
|
||||
taskLoop.registerOnToolCalled((result) => {
|
||||
return result;
|
||||
});
|
||||
|
||||
// 开启事件循环
|
||||
await taskLoop.start(storage, message);
|
||||
|
||||
@ -112,6 +81,44 @@ async function main() {
|
||||
main();
|
||||
```
|
||||
|
||||
下面是可能的输出:
|
||||
|
||||
```
|
||||
[6/5/2025, 8:16:15 PM] 🚀 [my-browser] 0.1.0 connected
|
||||
[6/5/2025, 8:16:15 PM] task loop enters a new epoch
|
||||
[6/5/2025, 8:16:23 PM] task loop finish a epoch
|
||||
[6/5/2025, 8:16:23 PM] 🤖 llm wants to call these tools k_navigate
|
||||
[6/5/2025, 8:16:23 PM] 🔧 calling tool k_navigate
|
||||
[6/5/2025, 8:16:34 PM] × fail to call tools McpError: MCP error -32603: net::ERR_CONNECTION_RESET at https://towardsdatascience.com/tag/editors-pick/
|
||||
[6/5/2025, 8:16:34 PM] task loop enters a new epoch
|
||||
[6/5/2025, 8:16:40 PM] task loop finish a epoch
|
||||
[6/5/2025, 8:16:40 PM] 🤖 llm wants to call these tools k_navigate
|
||||
[6/5/2025, 8:16:40 PM] 🔧 calling tool k_navigate
|
||||
[6/5/2025, 8:16:44 PM] ✓ call tools okey dockey success
|
||||
[6/5/2025, 8:16:44 PM] task loop enters a new epoch
|
||||
[6/5/2025, 8:16:57 PM] task loop finish a epoch
|
||||
[6/5/2025, 8:16:57 PM] 🤖 llm wants to call these tools k_evaluate
|
||||
[6/5/2025, 8:16:57 PM] 🔧 calling tool k_evaluate
|
||||
[6/5/2025, 8:16:57 PM] ✓ call tools okey dockey success
|
||||
[6/5/2025, 8:16:57 PM] task loop enters a new epoch
|
||||
[6/5/2025, 8:17:06 PM] task loop finish a epoch
|
||||
[6/5/2025, 8:17:06 PM] 🤖 llm wants to call these tools k_navigate, k_navigate
|
||||
[6/5/2025, 8:17:06 PM] 🔧 calling tool k_navigate
|
||||
[6/5/2025, 8:17:09 PM] ✓ call tools okey dockey success
|
||||
[6/5/2025, 8:17:09 PM] 🔧 calling tool k_navigate
|
||||
[6/5/2025, 8:17:12 PM] ✓ call tools okey dockey success
|
||||
[6/5/2025, 8:17:12 PM] task loop enters a new epoch
|
||||
[6/5/2025, 8:17:19 PM] task loop finish a epoch
|
||||
[6/5/2025, 8:17:19 PM] 🤖 llm wants to call these tools k_evaluate, k_evaluate
|
||||
[6/5/2025, 8:17:19 PM] 🔧 calling tool k_evaluate
|
||||
[6/5/2025, 8:17:19 PM] ✓ call tools okey dockey success
|
||||
[6/5/2025, 8:17:19 PM] 🔧 calling tool k_evaluate
|
||||
[6/5/2025, 8:17:19 PM] ✓ call tools okey dockey success
|
||||
[6/5/2025, 8:17:19 PM] task loop enters a new epoch
|
||||
[6/5/2025, 8:17:45 PM] task loop finish a epoch
|
||||
"以下是整理好的热门文章信息,并已翻译为简体中文:\n\n---\n\n### K1 标题 \n**《数据漂移并非真正问题:你的监控策略才是》** \n\n**简介** \n在机器学习领域,数据漂移常被视为模型性能下降的罪魁祸首,但本文作者提出了一种颠覆性的观点:数据漂移只是一个信号,真正的核心问题在于监控策略的不足。文章通过实际案例(如电商推荐系统和金融风控模型)揭示了传统统计监控的局限性,并提出了一个三层监控框架: \n1. **统计监控**:快速检测数据分布变化,但仅作为初步信号。 \n2. **上下文监控**:结合业务逻辑,判断漂移是否对关键指标产生影响。 \n3. **行为监控**:追踪模型预测的实际效果,避免“无声漂移”。 \n\n亮点在于作者强调了监控系统需要与业务目标紧密结合,而非单纯依赖技术指标。 \n\n**原文链接** \n[点击阅读原文](https://towardsdatascience.com/data-drift-is-not-the-actual-problem-your-monitoring-strategy-is/) \n\n---\n\n### K2 标题 \n**《从 Jupyter 到程序员的快速入门指南》** \n\n**简介** \n本文为数据科学家和初学者提供了一条从 Jupyter Notebook 过渡到专业编程的清晰路径。作者通过实际代码示例和工具推荐(如 VS Code、Git 和 Docker),帮助读者摆脱 Notebook 的局限性,提升代码的可维护性和可扩展性。 \n\n亮点包括: \n- 如何将 Notebook 代码模块化为可复用的 Python 脚本。 \n- 使用版本控制和容器化技术优化开发流程。 \n- 实战案例展示如何将实验性代码转化为生产级应用。 \n\n**原文链接** \n[点击阅读原文](https://towardsdatascience.com/the-journey-from-jupyter-to-programmer-a-quick-start-guide/) \n\n---\n\n如果需要进一步优化或补充其他内容,请随时告诉我!"
|
||||
```
|
||||
|
||||
更多使用请看官方文档:https://kirigaya.cn/openmcp/sdk-tutorial/
|
||||
|
||||
star 我们的项目:https://github.com/LSTM-Kirigaya/openmcp-client
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openmcp-sdk",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.7",
|
||||
"description": "openmcp-sdk",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
@ -24,12 +24,13 @@
|
||||
},
|
||||
"homepage": "https://document.kirigaya.cn/blogs/openmcp/main.html",
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.10.2",
|
||||
"@modelcontextprotocol/sdk": "^1.12.1",
|
||||
"@seald-io/nedb": "^4.1.1",
|
||||
"@vue/server-renderer": "^3.5.13",
|
||||
"axios": "^1.7.7",
|
||||
"chalk": "^5.4.1",
|
||||
"bson": "^6.8.0",
|
||||
"openai": "^4.93.0",
|
||||
"openai": "^5.0.1",
|
||||
"pako": "^2.1.0",
|
||||
"tesseract.js": "^6.0.1",
|
||||
"uuid": "^11.1.0",
|
||||
|
2
resources/openmcp-sdk-release/task-loop.d.ts
vendored
2
resources/openmcp-sdk-release/task-loop.d.ts
vendored
@ -8,9 +8,9 @@ export interface TaskLoopOptions {
|
||||
maxEpochs?: number;
|
||||
maxJsonParseRetry?: number;
|
||||
adapter?: any;
|
||||
verbose?: 0 | 1 | 2 | 3;
|
||||
}
|
||||
|
||||
|
||||
export interface SchemaProperty {
|
||||
title: string;
|
||||
type: string;
|
||||
|
10
resources/openmcp-sdk-release/tools.mjs
Normal file
10
resources/openmcp-sdk-release/tools.mjs
Normal file
@ -0,0 +1,10 @@
|
||||
const ElMessage = {
|
||||
error: console.error,
|
||||
warning: console.warn,
|
||||
info: console.info,
|
||||
success: console.log
|
||||
}
|
||||
|
||||
export {
|
||||
ElMessage
|
||||
};
|
@ -5,7 +5,6 @@ import { RestfulResponse } from "../common/index.dto.js";
|
||||
import { ocrDB } from "../hook/db.js";
|
||||
import type { ToolCallContent } from "../mcp/client.dto.js";
|
||||
import { ocrWorkerStorage } from "../mcp/ocr.service.js";
|
||||
import { axiosFetch } from "../hook/axios-fetch.js";
|
||||
import Table from 'cli-table3';
|
||||
|
||||
export let currentStream: AsyncIterable<any> | null = null;
|
||||
@ -39,18 +38,6 @@ export async function streamingChatCompletion(
|
||||
const client = new OpenAI({
|
||||
baseURL,
|
||||
apiKey,
|
||||
fetch: async (input: string | URL | Request, init?: RequestInit) => {
|
||||
|
||||
if (model.startsWith('gemini') && init) {
|
||||
// 该死的 google
|
||||
init.headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${apiKey}`
|
||||
}
|
||||
}
|
||||
|
||||
return await axiosFetch(input, init, { proxyServer });
|
||||
}
|
||||
});
|
||||
|
||||
const seriableTools = (tools.length === 0) ? undefined: tools;
|
||||
|
@ -265,8 +265,6 @@ export async function connectService(
|
||||
|
||||
console.log(table.toString());
|
||||
|
||||
|
||||
|
||||
// 预处理字符串
|
||||
await preprocessCommand(option, webview);
|
||||
|
||||
|
@ -18,10 +18,10 @@ function getTabSavePath(serverInfo: IServerVersion) {
|
||||
|
||||
const tabSaveName = `tabs.${escapeName}.json`;
|
||||
|
||||
// 如果是 vscode 插件下,则修改为 ~/.vscode/openmcp.json
|
||||
// 如果是 vscode 插件下,则修改为 ~/.openmcp/openmcp.json
|
||||
if (VSCODE_WORKSPACE) {
|
||||
// 在 VSCode 插件环境下
|
||||
const configDir = path.join(VSCODE_WORKSPACE, '.vscode');
|
||||
const configDir = path.join(VSCODE_WORKSPACE, '.openmcp');
|
||||
if (!fs.existsSync(configDir)) {
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -43,7 +43,7 @@ export interface McpOptions {
|
||||
}
|
||||
|
||||
|
||||
export const CONNECTION_CONFIG_NAME = 'openmcp_connection.json';
|
||||
export const CONNECTION_CONFIG_NAME = 'connection.json';
|
||||
|
||||
let _connectionConfig: IConnectionConfig | undefined;
|
||||
let _workspaceConnectionConfig: IConnectionConfig | undefined;
|
||||
@ -90,12 +90,12 @@ export function getConnectionConfig() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取工作区的连接信息,默认是 {workspace}/.vscode/openmcp_connection.json
|
||||
* @description 获取工作区的连接信息,默认是 {workspace}/.openmcp/connection.json
|
||||
* @returns
|
||||
*/
|
||||
export function getWorkspaceConnectionConfigPath() {
|
||||
const workspace = getWorkspacePath();
|
||||
const configDir = fspath.join(workspace, '.vscode');
|
||||
const configDir = fspath.join(workspace, '.openmcp');
|
||||
const connectionConfig = fspath.join(configDir, CONNECTION_CONFIG_NAME);
|
||||
return connectionConfig;
|
||||
}
|
||||
@ -110,7 +110,7 @@ export function getWorkspaceConnectionConfig() {
|
||||
}
|
||||
|
||||
const workspace = getWorkspacePath();
|
||||
const configDir = fspath.join(workspace, '.vscode');
|
||||
const configDir = fspath.join(workspace, '.openmcp');
|
||||
const connectionConfig = fspath.join(configDir, CONNECTION_CONFIG_NAME);
|
||||
|
||||
if (!fs.existsSync(connectionConfig)) {
|
||||
@ -190,7 +190,7 @@ export function saveWorkspaceConnectionConfig(workspace: string) {
|
||||
|
||||
const connectionConfig = JSON.parse(JSON.stringify(_workspaceConnectionConfig)) as IConnectionConfig;
|
||||
|
||||
const configDir = fspath.join(workspace, '.vscode');
|
||||
const configDir = fspath.join(workspace, '.openmcp');
|
||||
const connectionConfigPath = fspath.join(configDir, CONNECTION_CONFIG_NAME);
|
||||
|
||||
const workspacePath = getWorkspacePath();
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { defineConfig, normalizePath } from 'vite';
|
||||
import { resolve } from 'path';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
// import { visualizer } from 'rollup-plugin-visualizer';
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
@ -26,11 +25,7 @@ export default defineConfig({
|
||||
dest: normalizePath(resolve(__dirname, '../openmcp-sdk'))
|
||||
}
|
||||
]
|
||||
}),
|
||||
// visualizer({
|
||||
// open: true,
|
||||
// filename: 'stats.html'
|
||||
// })
|
||||
})
|
||||
],
|
||||
build: {
|
||||
target: 'node18',
|
||||
@ -45,18 +40,20 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
external: [
|
||||
'vue',
|
||||
'chalk',
|
||||
'element-plus',
|
||||
],
|
||||
output: {
|
||||
globals: {
|
||||
vue: 'Vue',
|
||||
vue: 'vue',
|
||||
chalk: 'chalk',
|
||||
'element-plus': './tools.js'
|
||||
}
|
||||
},
|
||||
esModule: true
|
||||
}
|
||||
},
|
||||
minify: false,
|
||||
sourcemap: false, // 禁用sourcemap生成
|
||||
cssCodeSplit: false // 禁用CSS文件生成
|
||||
sourcemap: false
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user