From c9bc58ca9c111633d178984397262da33da4a74f Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Mon, 19 May 2025 20:46:04 +0800 Subject: [PATCH] finish 0.0.9; prepare test TIP CI system --- package.json | 4 +- renderer/src/views/about/index.vue | 2 +- renderer/vite.config.ts | 11 ++- service/package.json | 1 - service/tabs.my-browser.json | 116 ++--------------------------- src/webview/webview.service.ts | 8 +- turbo.json | 11 ++- 7 files changed, 32 insertions(+), 121 deletions(-) diff --git a/package.json b/package.json index 8aeba95..9915952 100644 --- a/package.json +++ b/package.json @@ -219,9 +219,7 @@ ], "scripts": { "setup": "npm i && npm run prepare:ocr", - "dev": "turbo dev --filter=!@openmcp/electron", - "dev:electron": "turbo dev --filter=@openmcp/electron", - "dev:all": "turbo dev", + "serve": "turbo serve", "build": "turbo build --filter=!@openmcp/electron", "build:electron": "turbo build --filter=@openmcp/electron", "build:all": "turbo build", diff --git a/renderer/src/views/about/index.vue b/renderer/src/views/about/index.vue index 43e6068..3a26f06 100644 --- a/renderer/src/views/about/index.vue +++ b/renderer/src/views/about/index.vue @@ -6,7 +6,7 @@

- OpenMCP Client 0.0.8 由 OpenMCP@锦恢 开发 + OpenMCP Client 0.0.9 由 OpenMCP@锦恢 开发

diff --git a/renderer/vite.config.ts b/renderer/vite.config.ts index 28ef311..cfd7402 100644 --- a/renderer/vite.config.ts +++ b/renderer/vite.config.ts @@ -15,5 +15,14 @@ export default defineConfig(({ mode }) => ({ '@': fileURLToPath(new URL('./src', import.meta.url)) }, }, - base: mode === 'website' ? '/mcp/' : '/' + base: mode === 'website' ? '/mcp/' : '/', + build: { + cssCodeSplit: false, // 禁用 CSS 代码分割 + rollupOptions: { + output: { + inlineDynamicImports: true, // 将动态导入的内容内联 + manualChunks: undefined, // 禁用手动分块 + }, + }, + }, })) diff --git a/service/package.json b/service/package.json index 8f4c335..a18307f 100644 --- a/service/package.json +++ b/service/package.json @@ -6,7 +6,6 @@ "types": "dist/index.d.ts", "type": "commonjs", "scripts": { - "postinstall": "npm run build", "dev": "ts-node-dev --respawn --transpile-only src/main.ts", "serve": "ts-node-dev --respawn --transpile-only src/main.ts", "build": "tsc", diff --git a/service/tabs.my-browser.json b/service/tabs.my-browser.json index e47abc4..814a16e 100644 --- a/service/tabs.my-browser.json +++ b/service/tabs.my-browser.json @@ -10,122 +10,20 @@ "messages": [ { "role": "user", - "content": "https://challenge.isic-archive.com/data/#2020", + "content": "hello", "extraInfo": { - "created": 1747382016210, + "created": 1747658023940, "state": "success", - "serverName": "deepseek" + "serverName": "Huoshan DeepSeek" } }, { "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "call_0_9dedd2c3-32ba-4f8c-993f-bb381b9845b0", - "index": 0, - "type": "function", - "function": { - "name": "k_navigate", - "arguments": "{\"url\":\"https://challenge.isic-archive.com/data/#2020\"}" - } - } - ], + "content": "Hello! How can I assist you today?", "extraInfo": { - "created": 1747382021478, + "created": 1747658024544, "state": "success", - "serverName": "deepseek" - } - }, - { - "role": "tool", - "index": 0, - "tool_call_id": "call_0_9dedd2c3-32ba-4f8c-993f-bb381b9845b0", - "content": [ - { - "type": "text", - "text": "Navigated to https://challenge.isic-archive.com/data/#2020" - } - ], - "extraInfo": { - "created": 1747382026814, - "state": "success", - "serverName": "deepseek", - "usage": { - "prompt_tokens": 1422, - "completion_tokens": 31, - "total_tokens": 1453, - "prompt_tokens_details": { - "cached_tokens": 0 - }, - "prompt_cache_hit_tokens": 0, - "prompt_cache_miss_tokens": 1422 - } - } - }, - { - "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "call_0_b4cd47c1-ad08-46a1-9a0e-d202dd2aef0a", - "index": 0, - "type": "function", - "function": { - "name": "k_get_full_page_text", - "arguments": "{}" - } - } - ], - "extraInfo": { - "created": 1747382031777, - "state": "success", - "serverName": "deepseek" - } - }, - { - "role": "tool", - "index": 0, - "tool_call_id": "call_0_b4cd47c1-ad08-46a1-9a0e-d202dd2aef0a", - "content": [ - { - "type": "text", - "text": "Execution result:\n\"mail_outline\\nSUBSCRIBE\\nLOGIN\\nSIGN UP\\nISIC Challenge Datasets\\n2016\\n2017\\n2018\\n2019\\n2020\\nTraining Data\\tTraining Ground Truth\\tTest Data\\tTest Ground Truth\\tLicense\\n\\n\\nDownload DICOM (48.9GB)\\n33,126 DICOM images with embedded metadata.\\n\\nDownload DICOM Corrected* (23.0GB)\\n33,126 DICOM images with embedded metadata.\\n\\nDownload JPEG (23GB)\\n33,126 JPEG images.\\n\\nDownload metadata (2MB)\\n33,126 metadata entries of patient ID, sex, age, and general anatomic site.\\n\\nDownload metadata v2 (2MB)\\n33,126 metadata entries of patient ID, lesion ID, sex, age, and general anatomic site.\\n\\nDownload duplicate image list (2MB)\\nList of 425 duplicate images.\\n\\n\\tDownload (2MB)\\n33,126 entries of gold standard lesion diagnoses.\\t\\n\\nDownload DICOM (15.3GB)\\n10,982 DICOM images with embedded metadata.\\n\\nDownload DICOM Corrected* (6.7GB)\\n10,982 DICOM images with embedded metadata.\\n\\nDownload JPEG (6.7GB)\\n10,982 JPEG images.\\n\\nDownload metadata (458KB)\\n10,982 metadata entries of patient ID, sex, age, and general anatomic site.\\n\\n\\t\\nNot Available\\nhelp_outline\\n\\tCC-BY-NC\\n\\n*The newer version of the DICOM files are provided to avoid potential errors stemming from readers implementing a strict DICOM verification, as implemented in http://dclunie.com/dicom3tools/dciodvfy.html.\\n\\nCiting 2020 datasets:\\nTo comply with the attribution requirements of the CC-BY-NC license , the aggregate \\\"ISIC 2020\\\" data must be cited as:\\n\\nInternational Skin Imaging Collaboration. SIIM-ISIC 2020 Challenge Dataset. International Skin Imaging Collaboration https://doi.org/10.34970/2020-ds01 (2020).\\n\\nCreative Commons Attribution-Non Commercial 4.0 International License.\\n\\nThe dataset was generated by the International Skin Imaging Collaboration (ISIC) and images are from the following sources: Hospital Clínic de Barcelona, Medical University of Vienna, Memorial Sloan Kettering Cancer Center, Melanoma Institute Australia, The University of Queensland, and the University of Athens Medical School.\\n\\nYou should have received a copy of the license along with this work.\\n\\nIf not, see https://creativecommons.org/licenses/by-nc/4.0/legalcode.txt .\\n\\nWhen referencing this dataset in your own manuscripts and publications, please use the following full citation. Please note this is a preprint and has not undergone peer review. It is being prepared for submission and if accepted to a peer reviewed journal the below will be updated accordingly:\\n\\n[1] Rotemberg, V., Kurtansky, N., Betz-Stablein, B., Caffery, L., Chousakos, E., Codella, N., Combalia, M., Dusza, S., Guitera, P., Gutman, D., Halpern, A., Helba, B., Kittler, H., Kose, K., Langer, S., Lioprys, K., Malvehy, J., Musthaq, S., Nanda, J., Reiter, O., Shih, G., Stratigos, A., Tschandl, P., Weber, J. & Soyer, P. A patient-centric dataset of images and metadata for identifying melanomas using clinical context. Sci Data 8, 34 (2021). https://doi.org/10.1038/s41597-021-00815-z\\n\\nTerms of Use|Contact\\nREPORT AN ISSUE\"\n\nConsole output:\n" - } - ], - "extraInfo": { - "created": 1747382031793, - "state": "success", - "serverName": "deepseek", - "usage": { - "prompt_tokens": 1484, - "completion_tokens": 17, - "total_tokens": 1501, - "prompt_tokens_details": { - "cached_tokens": 1408 - }, - "prompt_cache_hit_tokens": 1408, - "prompt_cache_miss_tokens": 76 - } - } - }, - { - "role": "assistant", - "content": "### ISIC 2020 皮肤影像数据集 \n该数据集由国际皮肤影像协作组(ISIC)提供,用于训练和测试AI模型以识别皮肤病变,尤其是黑色素瘤。数据集包含大量皮肤镜图像及其相关元数据,适用于医学影像分析和皮肤病学研究。\n\n**主要类型**:医学影像(皮肤镜图像) \n**涉及器官**:皮肤 \n\n🔗 **开源链接**: \n- [DICOM格式下载](https://challenge.isic-archive.com/data/#2020) \n- [JPEG格式下载](https://challenge.isic-archive.com/data/#2020) \n- [元数据下载](https://challenge.isic-archive.com/data/#2020) \n\n**数据集特点**: \n- 包含33,126张训练图像和10,982张测试图像。 \n- 提供患者ID、性别、年龄和病变部位等元数据。 \n- 遵循CC-BY-NC 4.0国际许可协议。 \n\n**引用方式**: \n如需引用此数据集,请参考以下文献: \nRotemberg, V., et al. (2021). *A patient-centric dataset of images and metadata for identifying melanomas using clinical context*. Sci Data 8, 34. [DOI链接](https://doi.org/10.1038/s41597-021-00815-z) \n\n**注意事项**: \n- 数据集仅限非商业用途。 \n- 使用前需确认已阅读并遵守许可协议。 ", - "extraInfo": { - "created": 1747382050707, - "state": "success", - "serverName": "deepseek", - "usage": { - "prompt_tokens": 2425, - "completion_tokens": 317, - "total_tokens": 2742, - "prompt_tokens_details": { - "cached_tokens": 1472 - }, - "prompt_cache_hit_tokens": 1472, - "prompt_cache_miss_tokens": 953 - } + "serverName": "Huoshan DeepSeek" } } ], @@ -176,7 +74,7 @@ "enableWebSearch": false, "temperature": 0.7, "contextLength": 20, - "systemPrompt": "medical data" + "systemPrompt": "" } } } diff --git a/src/webview/webview.service.ts b/src/webview/webview.service.ts index 76afa9b..de1118b 100644 --- a/src/webview/webview.service.ts +++ b/src/webview/webview.service.ts @@ -9,10 +9,12 @@ export function getWebviewContent(context: vscode.ExtensionContext, panel: vscod const htmlIndexPath = fspath.join(viewRoot, 'index.html'); const html = fs.readFileSync(htmlIndexPath, { encoding: 'utf-8' })?.replace(/( { - const absLocalPath = fspath.resolve(viewRoot, $2); + const importFile = $2 as string; + const rel = importFile.startsWith('/') ? importFile.substring(1) : importFile; + const absLocalPath = fspath.resolve(viewRoot, rel); + const webviewUri = panel.webview.asWebviewUri(vscode.Uri.file(absLocalPath)); - - const replaceHref = $1 + webviewUri?.toString() + '"'; + const replaceHref = $1 + webviewUri?.toString() + '"'; return replaceHref; }); diff --git a/turbo.json b/turbo.json index eb245bc..58e0584 100644 --- a/turbo.json +++ b/turbo.json @@ -1,9 +1,12 @@ { "$schema": "https://turborepo.com/schema.json", "tasks": { + "serve": { + "dependsOn": ["^build"], + "cache": false + }, "dev": { - "dependsOn": ["@openmcp/renderer#serve", "@openmcp/service#serve"], - "persistent": true, + "with": ["@openmcp/renderer#serve", "@openmcp/service#serve"], "cache": false }, "build": { @@ -14,12 +17,14 @@ "cache": false }, "@openmcp/renderer#serve": { - "cache": false + "cache": false, + "persistent": true }, "@openmcp/renderer#build": { "cache": false }, "@openmcp/service#serve": { + "persistent": true, "cache": false }, "@openmcp/service#build": {