This commit is contained in:
锦恢 2025-06-04 17:07:29 +08:00
parent db7b8273db
commit 9d94a5b865
14 changed files with 419 additions and 372 deletions

611
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "openmcp", "name": "openmcp",
"version": "0.1.3", "version": "0.1.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "openmcp", "name": "openmcp",
"version": "0.1.3", "version": "0.1.4",
"workspaces": [ "workspaces": [
"service", "service",
"renderer", "renderer",
@ -24,16 +24,21 @@
"ws": "^8.18.1" "ws": "^8.18.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "16.x", "@types/node": "^22.15.29",
"@types/pako": "^2.0.3", "@types/pako": "^2.0.3",
"@types/showdown": "^2.0.0", "@types/showdown": "^2.0.0",
"@types/vscode": "^1.72.0", "@types/vscode": "^1.72.0",
"@vitejs/plugin-vue": "^5.2.4",
"copy-webpack-plugin": "^13.0.0", "copy-webpack-plugin": "^13.0.0",
"fork-ts-checker-webpack-plugin": "^9.1.0", "fork-ts-checker-webpack-plugin": "^9.1.0",
"null-loader": "^4.0.1", "null-loader": "^4.0.1",
"ts-loader": "^9.5.1", "ts-loader": "^9.5.1",
"turbo": "^2.5.3", "turbo": "^2.5.3",
"typescript": "^5.4.2", "typescript": "^5.4.2",
"vite": "^6.3.5",
"vite-plugin-static-copy": "^3.0.0",
"vite-plugin-vue-devtools": "^7.7.6",
"vue-tsc": "^2.2.10",
"webpack": "^5.99.5", "webpack": "^5.99.5",
"webpack-cli": "^5.1.4" "webpack-cli": "^5.1.4"
}, },
@ -2432,10 +2437,13 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "16.18.126", "version": "22.15.29",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.126.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz",
"integrity": "sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==", "integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==",
"license": "MIT" "license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
}, },
"node_modules/@types/node-fetch": { "node_modules/@types/node-fetch": {
"version": "2.6.12", "version": "2.6.12",
@ -2583,6 +2591,20 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@vitejs/plugin-vue": {
"version": "5.2.4",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz",
"integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": "^5.0.0 || ^6.0.0",
"vue": "^3.2.25"
}
},
"node_modules/@volar/language-core": { "node_modules/@volar/language-core": {
"version": "2.4.14", "version": "2.4.14",
"resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.14.tgz", "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.14.tgz",
@ -2750,94 +2772,6 @@
"vue": "^3.0.0" "vue": "^3.0.0"
} }
}, },
"node_modules/@vue/devtools-core/node_modules/@types/node": {
"version": "22.15.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.19.tgz",
"integrity": "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"undici-types": "~6.21.0"
}
},
"node_modules/@vue/devtools-core/node_modules/vite": {
"version": "6.3.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.4.4",
"picomatch": "^4.0.2",
"postcss": "^8.5.3",
"rollup": "^4.34.9",
"tinyglobby": "^0.2.13"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
},
"funding": {
"url": "https://github.com/vitejs/vite?sponsor=1"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"peerDependencies": {
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"jiti": ">=1.21.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"sass-embedded": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.16.0",
"tsx": "^4.8.1",
"yaml": "^2.4.2"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"jiti": {
"optional": true
},
"less": {
"optional": true
},
"lightningcss": {
"optional": true
},
"sass": {
"optional": true
},
"sass-embedded": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
},
"tsx": {
"optional": true
},
"yaml": {
"optional": true
}
}
},
"node_modules/@vue/devtools-core/node_modules/vite-hot-client": { "node_modules/@vue/devtools-core/node_modules/vite-hot-client": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/vite-hot-client/-/vite-hot-client-2.0.4.tgz", "resolved": "https://registry.npmjs.org/vite-hot-client/-/vite-hot-client-2.0.4.tgz",
@ -5172,16 +5106,6 @@
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
"node_modules/electron/node_modules/@types/node": {
"version": "22.15.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.19.tgz",
"integrity": "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
},
"node_modules/element-plus": { "node_modules/element-plus": {
"version": "2.9.10", "version": "2.9.10",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.9.10.tgz", "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.9.10.tgz",
@ -8646,6 +8570,19 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/p-map": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz",
"integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-try": { "node_modules/p-try": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
@ -10826,7 +10763,6 @@
"version": "6.21.0", "version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/unicorn-magic": { "node_modules/unicorn-magic": {
@ -10974,6 +10910,270 @@
"node": ">=0.6.0" "node": ">=0.6.0"
} }
}, },
"node_modules/vite": {
"version": "6.3.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.4.4",
"picomatch": "^4.0.2",
"postcss": "^8.5.3",
"rollup": "^4.34.9",
"tinyglobby": "^0.2.13"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
},
"funding": {
"url": "https://github.com/vitejs/vite?sponsor=1"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"peerDependencies": {
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"jiti": ">=1.21.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"sass-embedded": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.16.0",
"tsx": "^4.8.1",
"yaml": "^2.4.2"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"jiti": {
"optional": true
},
"less": {
"optional": true
},
"lightningcss": {
"optional": true
},
"sass": {
"optional": true
},
"sass-embedded": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
},
"tsx": {
"optional": true
},
"yaml": {
"optional": true
}
}
},
"node_modules/vite-plugin-inspect": {
"version": "0.8.9",
"resolved": "https://registry.npmjs.org/vite-plugin-inspect/-/vite-plugin-inspect-0.8.9.tgz",
"integrity": "sha512-22/8qn+LYonzibb1VeFZmISdVao5kC22jmEKm24vfFE8siEn47EpVcCLYMv6iKOYMJfjSvSJfueOwcFCkUnV3A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antfu/utils": "^0.7.10",
"@rollup/pluginutils": "^5.1.3",
"debug": "^4.3.7",
"error-stack-parser-es": "^0.1.5",
"fs-extra": "^11.2.0",
"open": "^10.1.0",
"perfect-debounce": "^1.0.0",
"picocolors": "^1.1.1",
"sirv": "^3.0.0"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1"
},
"peerDependenciesMeta": {
"@nuxt/kit": {
"optional": true
}
}
},
"node_modules/vite-plugin-inspect/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/vite-plugin-static-copy": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-3.0.0.tgz",
"integrity": "sha512-Uki9pPUQ4ZnoMEdIFabvoh9h6Bh9Q1m3iF7BrZvoiF30reREpJh2gZb4jOnW1/uYFzyRiLCmFSkM+8hwiq1vWQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"chokidar": "^3.5.3",
"fs-extra": "^11.3.0",
"p-map": "^7.0.3",
"picocolors": "^1.1.1",
"tinyglobby": "^0.2.13"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": "^5.0.0 || ^6.0.0"
}
},
"node_modules/vite-plugin-static-copy/node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dev": true,
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/vite-plugin-static-copy/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/vite-plugin-static-copy/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/vite-plugin-static-copy/node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/vite-plugin-static-copy/node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/vite-plugin-vue-devtools": {
"version": "7.7.6",
"resolved": "https://registry.npmjs.org/vite-plugin-vue-devtools/-/vite-plugin-vue-devtools-7.7.6.tgz",
"integrity": "sha512-L7nPVM5a7lgit/Z+36iwoqHOaP3wxqVi1UvaDJwGCfblS9Y6vNqf32ILlzJVH9c47aHu90BhDXeZc+rgzHRHcw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vue/devtools-core": "^7.7.6",
"@vue/devtools-kit": "^7.7.6",
"@vue/devtools-shared": "^7.7.6",
"execa": "^9.5.2",
"sirv": "^3.0.1",
"vite-plugin-inspect": "0.8.9",
"vite-plugin-vue-inspector": "^5.3.1"
},
"engines": {
"node": ">=v14.21.3"
},
"peerDependencies": {
"vite": "^3.1.0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0"
}
},
"node_modules/vite-plugin-vue-inspector": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/vite-plugin-vue-inspector/-/vite-plugin-vue-inspector-5.3.1.tgz",
"integrity": "sha512-cBk172kZKTdvGpJuzCCLg8lJ909wopwsu3Ve9FsL1XsnLBiRT9U3MePcqrgGHgCX2ZgkqZmAGR8taxw+TV6s7A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/core": "^7.23.0",
"@babel/plugin-proposal-decorators": "^7.23.0",
"@babel/plugin-syntax-import-attributes": "^7.22.5",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.22.15",
"@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-dom": "^3.3.4",
"kolorist": "^1.8.0",
"magic-string": "^0.30.4"
},
"peerDependencies": {
"vite": "^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0"
}
},
"node_modules/vscode-uri": { "node_modules/vscode-uri": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz",
@ -11589,45 +11789,6 @@
"vue-tsc": "^2.2.8" "vue-tsc": "^2.2.8"
} }
}, },
"renderer/node_modules/@types/node": {
"version": "22.15.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.19.tgz",
"integrity": "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
},
"renderer/node_modules/@vitejs/plugin-vue": {
"version": "5.2.4",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz",
"integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": "^5.0.0 || ^6.0.0",
"vue": "^3.2.25"
}
},
"renderer/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"
}
},
"renderer/node_modules/openai": { "renderer/node_modules/openai": {
"version": "4.104.0", "version": "4.104.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz",
@ -11673,156 +11834,6 @@
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"license": "MIT" "license": "MIT"
}, },
"renderer/node_modules/vite": {
"version": "6.3.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.4.4",
"picomatch": "^4.0.2",
"postcss": "^8.5.3",
"rollup": "^4.34.9",
"tinyglobby": "^0.2.13"
},
"bin": {
"vite": "bin/vite.js"
},
"engines": {
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
},
"funding": {
"url": "https://github.com/vitejs/vite?sponsor=1"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"peerDependencies": {
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"jiti": ">=1.21.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"sass-embedded": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.16.0",
"tsx": "^4.8.1",
"yaml": "^2.4.2"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"jiti": {
"optional": true
},
"less": {
"optional": true
},
"lightningcss": {
"optional": true
},
"sass": {
"optional": true
},
"sass-embedded": {
"optional": true
},
"stylus": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
},
"tsx": {
"optional": true
},
"yaml": {
"optional": true
}
}
},
"renderer/node_modules/vite-plugin-inspect": {
"version": "0.8.9",
"resolved": "https://registry.npmjs.org/vite-plugin-inspect/-/vite-plugin-inspect-0.8.9.tgz",
"integrity": "sha512-22/8qn+LYonzibb1VeFZmISdVao5kC22jmEKm24vfFE8siEn47EpVcCLYMv6iKOYMJfjSvSJfueOwcFCkUnV3A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antfu/utils": "^0.7.10",
"@rollup/pluginutils": "^5.1.3",
"debug": "^4.3.7",
"error-stack-parser-es": "^0.1.5",
"fs-extra": "^11.2.0",
"open": "^10.1.0",
"perfect-debounce": "^1.0.0",
"picocolors": "^1.1.1",
"sirv": "^3.0.0"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1"
},
"peerDependenciesMeta": {
"@nuxt/kit": {
"optional": true
}
}
},
"renderer/node_modules/vite-plugin-vue-devtools": {
"version": "7.7.6",
"resolved": "https://registry.npmjs.org/vite-plugin-vue-devtools/-/vite-plugin-vue-devtools-7.7.6.tgz",
"integrity": "sha512-L7nPVM5a7lgit/Z+36iwoqHOaP3wxqVi1UvaDJwGCfblS9Y6vNqf32ILlzJVH9c47aHu90BhDXeZc+rgzHRHcw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vue/devtools-core": "^7.7.6",
"@vue/devtools-kit": "^7.7.6",
"@vue/devtools-shared": "^7.7.6",
"execa": "^9.5.2",
"sirv": "^3.0.1",
"vite-plugin-inspect": "0.8.9",
"vite-plugin-vue-inspector": "^5.3.1"
},
"engines": {
"node": ">=v14.21.3"
},
"peerDependencies": {
"vite": "^3.1.0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0"
}
},
"renderer/node_modules/vite-plugin-vue-inspector": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/vite-plugin-vue-inspector/-/vite-plugin-vue-inspector-5.3.1.tgz",
"integrity": "sha512-cBk172kZKTdvGpJuzCCLg8lJ909wopwsu3Ve9FsL1XsnLBiRT9U3MePcqrgGHgCX2ZgkqZmAGR8taxw+TV6s7A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/core": "^7.23.0",
"@babel/plugin-proposal-decorators": "^7.23.0",
"@babel/plugin-syntax-import-attributes": "^7.22.5",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.22.15",
"@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-dom": "^3.3.4",
"kolorist": "^1.8.0",
"magic-string": "^0.30.4"
},
"peerDependencies": {
"vite": "^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0"
}
},
"service": { "service": {
"name": "@openmcp/service", "name": "@openmcp/service",
"version": "0.0.1", "version": "0.0.1",
@ -11865,16 +11876,6 @@
"node": ">=14.17.0" "node": ">=14.17.0"
} }
}, },
"service/node_modules/@types/node": {
"version": "22.15.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.19.tgz",
"integrity": "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
},
"service/node_modules/@webpack-cli/configtest": { "service/node_modules/@webpack-cli/configtest": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-3.0.1.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-3.0.1.tgz",

View File

@ -244,16 +244,20 @@
"ws": "^8.18.1" "ws": "^8.18.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "16.x", "@types/node": "^22.15.29",
"@types/pako": "^2.0.3", "@types/pako": "^2.0.3",
"@types/showdown": "^2.0.0", "@types/showdown": "^2.0.0",
"@types/vscode": "^1.72.0", "@types/vscode": "^1.72.0",
"@vitejs/plugin-vue": "^5.2.4",
"copy-webpack-plugin": "^13.0.0", "copy-webpack-plugin": "^13.0.0",
"fork-ts-checker-webpack-plugin": "^9.1.0", "fork-ts-checker-webpack-plugin": "^9.1.0",
"null-loader": "^4.0.1", "null-loader": "^4.0.1",
"ts-loader": "^9.5.1", "ts-loader": "^9.5.1",
"turbo": "^2.5.3", "turbo": "^2.5.3",
"typescript": "^5.4.2", "typescript": "^5.4.2",
"vite": "^6.3.5",
"vite-plugin-vue-devtools": "^7.7.6",
"vue-tsc": "^2.2.10",
"webpack": "^5.99.5", "webpack": "^5.99.5",
"webpack-cli": "^5.1.4" "webpack-cli": "^5.1.4"
}, },

View File

@ -62,7 +62,7 @@ onMounted(async () => {
return; return;
} }
document.addEventListener('click', () => { document?.addEventListener('click', () => {
Connection.showPanel = false; Connection.showPanel = false;
}); });

View File

@ -70,7 +70,7 @@ async function whenGetPromptResponse(msg: PromptsGetResponse) {
return; return;
} }
const container = document.createElement('div'); const container = document?.createElement('div');
const promptChatItem = createApp(PromptChatItem, { const promptChatItem = createApp(PromptChatItem, {
messages: msg.messages messages: msg.messages
}); });
@ -88,7 +88,7 @@ async function whenGetPromptResponse(msg: PromptsGetResponse) {
} }
// //
const newRange = document.createRange(); const newRange = document?.createRange();
newRange.setStartAfter(firstElement); newRange.setStartAfter(firstElement);
newRange.collapse(true); newRange.collapse(true);
const selection = window.getSelection(); const selection = window.getSelection();

View File

@ -82,7 +82,7 @@ async function whenGetResourceResponse(msg: ResourcesReadResponse) {
return; return;
} }
const container = document.createElement('div'); const container = document?.createElement('div');
const resourceChatItem = createApp(ResourceChatItem, { const resourceChatItem = createApp(ResourceChatItem, {
contents: msg.contents contents: msg.contents
}); });
@ -101,7 +101,7 @@ async function whenGetResourceResponse(msg: ResourcesReadResponse) {
editor.appendChild(firstElement); editor.appendChild(firstElement);
} }
const newRange = document.createRange(); const newRange = document?.createRange();
newRange.setStartAfter(firstElement); newRange.setStartAfter(firstElement);
newRange.collapse(true); newRange.collapse(true);
const selection = window.getSelection(); const selection = window.getSelection();

View File

@ -187,7 +187,7 @@ function handlePaste(event: ClipboardEvent) {
if (selection && selection.rangeCount > 0) { if (selection && selection.rangeCount > 0) {
const range = selection.getRangeAt(0); const range = selection.getRangeAt(0);
range.deleteContents(); range.deleteContents();
const textNode = document.createTextNode(pastedText); const textNode = document?.createTextNode(pastedText);
range.insertNode(textNode); range.insertNode(textNode);
range.setStartAfter(textNode); range.setStartAfter(textNode);
range.collapse(true); range.collapse(true);

View File

@ -110,7 +110,7 @@ const showFullImage = () => {
const img = new Image(); const img = new Image();
img.src = thumbnail.value; img.src = thumbnail.value;
img.onload = () => { img.onload = () => {
const overlay = document.createElement('div'); const overlay = document?.createElement('div');
overlay.style.position = 'fixed'; overlay.style.position = 'fixed';
overlay.style.top = '0'; overlay.style.top = '0';
overlay.style.left = '0'; overlay.style.left = '0';
@ -121,9 +121,9 @@ const showFullImage = () => {
overlay.style.display = 'flex'; overlay.style.display = 'flex';
overlay.style.justifyContent = 'center'; overlay.style.justifyContent = 'center';
overlay.style.alignItems = 'center'; overlay.style.alignItems = 'center';
overlay.onclick = () => document.body.removeChild(overlay); overlay.onclick = () => document?.body.removeChild(overlay);
const imgContainer = document.createElement('div'); const imgContainer = document?.createElement('div');
imgContainer.style.maxWidth = '90vw'; imgContainer.style.maxWidth = '90vw';
imgContainer.style.maxHeight = '90vh'; imgContainer.style.maxHeight = '90vh';
imgContainer.style.overflow = 'auto'; imgContainer.style.overflow = 'auto';
@ -137,7 +137,7 @@ const showFullImage = () => {
imgContainer.appendChild(fullImg); imgContainer.appendChild(fullImg);
overlay.appendChild(imgContainer); overlay.appendChild(imgContainer);
document.body.appendChild(overlay); document?.body.appendChild(overlay);
}; };
}; };

View File

@ -151,12 +151,12 @@ export class MacroColor {
private theme: 'light' | 'dark' = 'dark'; private theme: 'light' | 'dark' = 'dark';
public foregroundColor: RgbColor | undefined; public foregroundColor: RgbColor | undefined;
public backgroundColor: RgbColor | undefined; public backgroundColor: RgbColor | undefined;
public foregroundColorString: string; public foregroundColorString: string = '';
public backgroundColorString: string; public backgroundColorString: string = '';
constructor(option: ComputedColorOption = {}) { constructor(option: ComputedColorOption = {}) {
this.option = option; this.option = option;
this.rootStyles = getComputedStyle(document.documentElement); this.rootStyles = getComputedStyle(document?.documentElement);
const foregroundColorString = this.rootStyles.getPropertyValue(option.BaseForegroundColorMacroName || '--foreground'); const foregroundColorString = this.rootStyles.getPropertyValue(option.BaseForegroundColorMacroName || '--foreground');
const backgroundColorString = this.rootStyles.getPropertyValue(option.BaseBackgroundColorMacroName || '--background'); const backgroundColorString = this.rootStyles.getPropertyValue(option.BaseBackgroundColorMacroName || '--background');
@ -178,8 +178,7 @@ export class MacroColor {
if (sidebarColorString === backgroundColorString) { if (sidebarColorString === backgroundColorString) {
// trae 默认主题的特点sidebarColorString 和 backgroundColorString 一样 // trae 默认主题的特点sidebarColorString 和 backgroundColorString 一样
// 把 默认主题的特点sidebarColorString 的颜色加深一些 // 把 默认主题的特点sidebarColorString 的颜色加深一些
const newSidebarColor = this.theme === 'dark' ? '#252a38' : '#edeff2'; document?.documentElement.style.setProperty('--sidebar', 'var(--vscode-icube-colorBg2)');
document.documentElement.style.setProperty('--sidebar', 'var(--vscode-icube-colorBg2)');
} }
} }

View File

@ -2,40 +2,40 @@ import { isLightColorTheme, parseColor } from "./color";
export function setDefaultCss() { export function setDefaultCss() {
// 改变默认颜色 // 改变默认颜色
document.body.style.setProperty('--el-color-primary', 'var(--main-color)'); document?.body.style.setProperty('--el-color-primary', 'var(--main-color)');
document.body.style.setProperty('--el-color-primary-light-9', 'var(--main-color)'); document?.body.style.setProperty('--el-color-primary-light-9', 'var(--main-color)');
document.body.style.setProperty('--el-color-primary-light-3', 'var(--main-color)'); document?.body.style.setProperty('--el-color-primary-light-3', 'var(--main-color)');
document.body.style.setProperty('--el-text-color-secondary', 'var(--foreground)'); document?.body.style.setProperty('--el-text-color-secondary', 'var(--foreground)');
document.body.style.setProperty('--el-text-color-regular', 'var(--foreground)'); document?.body.style.setProperty('--el-text-color-regular', 'var(--foreground)');
document.body.style.setProperty('--el-border-color', 'var(--vscode-input-border)'); document?.body.style.setProperty('--el-border-color', 'var(--vscode-input-border)');
document.body.style.setProperty('--el-fill-color-blank', 'var(--sidebar)'); document?.body.style.setProperty('--el-fill-color-blank', 'var(--sidebar)');
document.body.style.setProperty('--el-fill-color-light', 'var(--vscode-button-hoverBackground)'); document?.body.style.setProperty('--el-fill-color-light', 'var(--vscode-button-hoverBackground)');
document.body.style.setProperty('--el-switch-on-color', 'var(--main-color)'); document?.body.style.setProperty('--el-switch-on-color', 'var(--main-color)');
document.body.style.setProperty('--el-border', 'var(--sidebar)'); document?.body.style.setProperty('--el-border', 'var(--sidebar)');
document.body.style.setProperty('--el-border-color-light', 'var(--sidebar)'); document?.body.style.setProperty('--el-border-color-light', 'var(--sidebar)');
document.body.style.setProperty('--el-border-color-lighter', 'var(--sidebar)'); document?.body.style.setProperty('--el-border-color-lighter', 'var(--sidebar)');
document.body.style.setProperty('--el-bg-color-overlay', 'var(--sidebar)'); document?.body.style.setProperty('--el-bg-color-overlay', 'var(--sidebar)');
document.body.style.setProperty('--el-color-info', 'var(--foreground)'); document?.body.style.setProperty('--el-color-info', 'var(--foreground)');
document.body.style.setProperty('--el-color-info-light-8', 'var(--main-color)'); document?.body.style.setProperty('--el-color-info-light-8', 'var(--main-color)');
document.body.style.setProperty('--el-fill-color-light', 'var(--sidebar-item-selected)'); document?.body.style.setProperty('--el-fill-color-light', 'var(--sidebar-item-selected)');
document.body.style.setProperty('--el-color-primary-dark-2', 'var(--main-light-color)'); document?.body.style.setProperty('--el-color-primary-dark-2', 'var(--main-light-color)');
document.body.style.setProperty('--el-fill-color-dark', 'var(--main-light-color)'); document?.body.style.setProperty('--el-fill-color-dark', 'var(--main-light-color)');
document.body.style.setProperty('--el-fill-color-darker', 'var(--main-light-color)'); document?.body.style.setProperty('--el-fill-color-darker', 'var(--main-light-color)');
document.body.style.setProperty('--el-color-primary-light-5', 'var(--button-disabled)'); document?.body.style.setProperty('--el-color-primary-light-5', 'var(--button-disabled)');
document.body.style.setProperty('--el-bg-color', 'var(--background)'); document?.body.style.setProperty('--el-bg-color', 'var(--background)');
document.body.style.setProperty('--el-text-color-primary', 'var(--foreground)'); document?.body.style.setProperty('--el-text-color-primary', 'var(--foreground)');
document.body.style.setProperty('--el-button-hover-text-color', 'var(--background)'); document?.body.style.setProperty('--el-button-hover-text-color', 'var(--background)');
// document.body.style.setProperty('--el-color-white', 'var(--background)'); // document?.body.style.setProperty('--el-color-white', 'var(--background)');
// 设置全局宏 // 设置全局宏
document.body.style.setProperty('--time-scale-height', '30px'); document?.body.style.setProperty('--time-scale-height', '30px');
document.body.style.setProperty('--vcd-render-padding', '30px'); document?.body.style.setProperty('--vcd-render-padding', '30px');
document.body.style.setProperty('--sidebar-width', '330px'); document?.body.style.setProperty('--sidebar-width', '330px');
document.body.style.setProperty('--toolbar-height', '60px'); document?.body.style.setProperty('--toolbar-height', '60px');
// 下面是 get style // 下面是 get style
const style = getComputedStyle(document.documentElement); const style = getComputedStyle(document?.documentElement);
// 根据颜色亮度来设置额外的宏 // 根据颜色亮度来设置额外的宏
const bgColorString = style.getPropertyValue('--background'); const bgColorString = style.getPropertyValue('--background');
@ -56,7 +56,7 @@ export function setDefaultCss() {
if (mode === 'debug') { if (mode === 'debug') {
// 判断颜色深浅,模拟 .vscode-dark 的加入 // 判断颜色深浅,模拟 .vscode-dark 的加入
const theme = getThemeColor(); const theme = getThemeColor();
const app = document.getElementById('app'); const app = document?.getElementById('app');
app?.classList.add('vscode-' + theme); app?.classList.add('vscode-' + theme);
} }
@ -68,7 +68,7 @@ export function getThemeColor(): 'light' | 'dark' {
if (themeColor) { if (themeColor) {
return themeColor; return themeColor;
} }
const rootStyles = getComputedStyle(document.documentElement); const rootStyles = getComputedStyle(document?.documentElement);
const backgroundColorString = rootStyles.getPropertyValue('--background'); const backgroundColorString = rootStyles.getPropertyValue('--background');
const backgroundColor = parseColor(backgroundColorString); const backgroundColor = parseColor(backgroundColorString);
if (backgroundColor) { if (backgroundColor) {
@ -81,9 +81,9 @@ export function getThemeColor(): 'light' | 'dark' {
} }
function setExtraLightColorCss() { function setExtraLightColorCss() {
document.body.style.setProperty('--vline-stroke-color', '#ddd'); document?.body.style.setProperty('--vline-stroke-color', '#ddd');
} }
function setExtraDarkColorCss() { function setExtraDarkColorCss() {
document.body.style.setProperty('--vline-stroke-color', '#333'); document?.body.style.setProperty('--vline-stroke-color', '#333');
} }

View File

@ -19,12 +19,7 @@ export function getThemeColor(): 'light' | 'dark' {
return themeColor; return themeColor;
} }
const myDocument = document as any; const rootStyles = getComputedStyle(document?.documentElement);
if (!myDocument) {
return 'dark';
}
const rootStyles = getComputedStyle(document.documentElement);
const backgroundColorString = rootStyles.getPropertyValue('--background'); const backgroundColorString = rootStyles.getPropertyValue('--background');
const backgroundColor = Color.parseColor(backgroundColorString); const backgroundColor = Color.parseColor(backgroundColorString);
if (backgroundColor) { if (backgroundColor) {

View File

@ -41,9 +41,7 @@ const router = createRouter({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
const myDocument = document as any; if (to.meta.title && document) {
if (to.meta.title && myDocument) {
document.title = `OpenMCP | ${to.meta.title}`; document.title = `OpenMCP | ${to.meta.title}`;
} }
next(); next();

View File

@ -11,7 +11,7 @@ export const colorManager = reactive({
mainColor: 'white', mainColor: 'white',
initColor() { initColor() {
const rootStyles = getComputedStyle(document.documentElement); const rootStyles = getComputedStyle(document?.documentElement);
this.mainColor = rootStyles.getPropertyValue('--main-color'); this.mainColor = rootStyles.getPropertyValue('--main-color');
} }
}); });
@ -27,15 +27,10 @@ export function onGeneralColorChange(colorString: string) {
} }
const { r, g, b } = color; const { r, g, b } = color;
const myDocument = document as any; document?.documentElement.style.setProperty(
if (!myDocument) {
return;
}
document.documentElement.style.setProperty(
'--main-color', `rgb(${r}, ${g}, ${b})`); '--main-color', `rgb(${r}, ${g}, ${b})`);
document.documentElement.style.setProperty( document?.documentElement.style.setProperty(
'--main-light-color', `rgba(${r}, ${g}, ${b}, 0.7)`); '--main-light-color', `rgba(${r}, ${g}, ${b}, 0.7)`);
} }

View File

@ -33,6 +33,7 @@
"pako": "^2.1.0", "pako": "^2.1.0",
"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",
"https-proxy-agent": "^7.0.6"
} }
} }

View File

@ -0,0 +1,54 @@
import { defineConfig } from 'vite';
import { resolve } from 'path';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
define: {
'window': {
'nodejs': true,
'navigator': {
'userAgent': 2
},
},
'document': {
body: {}
}
},
plugins: [
vue(),
viteStaticCopy({
targets: [
{
src: resolve(__dirname, '../resources/openmcp-sdk-release/*'),
dest: resolve(__dirname, '../openmcp-sdk')
}
]
})
],
build: {
target: 'node18',
lib: {
entry: resolve(__dirname, '..', 'renderer/src/components/main-panel/chat/core/task-loop.ts'),
name: 'TaskLoop',
fileName: 'task-loop',
formats: ['cjs']
},
outDir: resolve(__dirname, '..', 'openmcp-sdk'),
emptyOutDir: false,
rollupOptions: {
external: {
vue: 'vue',
'element-plus': './tools.js'
}
},
minify: true,
sourcemap: false, // 禁用sourcemap生成
cssCodeSplit: false // 禁用CSS文件生成
},
resolve: {
alias: {
'@': resolve(__dirname, '..', 'renderer/src')
}
}
});