dsh-mcp-ops 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +115 -2
  3. package/cordis.patch.yml +14 -0
  4. package/icon.svg +69 -0
  5. package/icons/README.md +67 -0
  6. package/icons/app-icon.svg +14 -0
  7. package/icons/favicon.ico +0 -0
  8. package/icons/mcp-mark-16.svg +8 -0
  9. package/icons/mcp-mark-mono.svg +6 -0
  10. package/icons/png/app-icon-1024.png +0 -0
  11. package/icons/png/app-icon-128.png +0 -0
  12. package/icons/png/app-icon-256.png +0 -0
  13. package/icons/png/app-icon-512.png +0 -0
  14. package/icons/png/mcp-128.png +0 -0
  15. package/icons/png/mcp-16.png +0 -0
  16. package/icons/png/mcp-20.png +0 -0
  17. package/icons/png/mcp-24.png +0 -0
  18. package/icons/png/mcp-256.png +0 -0
  19. package/icons/png/mcp-32.png +0 -0
  20. package/icons/png/mcp-48.png +0 -0
  21. package/icons/png/mcp-512.png +0 -0
  22. package/icons/png/mcp-64.png +0 -0
  23. package/icons/preview.html +271 -0
  24. package/lib/client.js +21696 -0
  25. package/lib/configs.js +145 -0
  26. package/lib/credentials-doc.js +73 -0
  27. package/lib/env.js +64 -0
  28. package/lib/files/json-document.js +366 -0
  29. package/lib/files/locations.js +54 -0
  30. package/lib/files/mcp-json.js +280 -0
  31. package/lib/files/patch-writer.js +119 -0
  32. package/lib/files/writer.js +225 -0
  33. package/lib/host-locales.js +55 -0
  34. package/lib/index.js +27 -0
  35. package/lib/models.js +127 -0
  36. package/lib/mount.js +536 -0
  37. package/lib/oauth-web.js +119 -0
  38. package/lib/oauth.js +228 -0
  39. package/lib/probe.js +58 -0
  40. package/lib/refs.js +164 -0
  41. package/lib/service.js +1882 -0
  42. package/lib/sources/cordis-source.js +245 -0
  43. package/lib/sources/file-source.js +82 -0
  44. package/lib/sources/registry.js +81 -0
  45. package/lib/tool-control.js +434 -0
  46. package/locale/en.json +6 -0
  47. package/locale/zh.json +6 -0
  48. package/package.json +94 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rengy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,116 @@
1
- # Temporary Holding Version
1
+ # dsh-mcp-ops
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ DeepSeek Harness(dsh)插件:在设置页管理 MCP 服务。
4
+
5
+ ## 功能介绍
6
+
7
+ 设置页「MCP 服务」分区,三个 tab:**MCP 服务** / **进程环境变量** / **注入模式**。
8
+
9
+ - **MCP 服务管理**:卡片列表,一行一个服务 —— 新增、编辑、删除、启用 / 禁用、连接测试、逐工具开关、
10
+ 工具枚举。同名冲突交给组合层(补丁层)声明的服务可以**接管 / 释放**。
11
+ - **环境变量**:逐服务配置环境变量,勾选「密钥」的变量在配置文件里**不落明文**,真值只进 DSH 凭据库;
12
+ 另有**进程级环境变量**,统一注入 stdio 子进程(含密钥)。
13
+ - **工具注入**:两种模式 —— **按需检索**(模型调用 `mcp_tool_search` 时才注入当前对话)与
14
+ **全量注入**(每轮注入所有已启用工具);支持逐工具勾选。
15
+ - **OAuth 授权**:远程 MCP(HTTP / SSE)服务的 OAuth 授权,浏览器回调与回环两种回调路径都可用。
16
+ - **配置真源**:`$DSH_HOME/.mcp.json`(缺省 `~/.dsh/.mcp.json`)—— 服务定义在 `mcpServers`,
17
+ 本插件的状态(注入模式、覆盖项、逐工具开关、进程级变量)在同一个文件的 `configs` 段,
18
+ **就地写回**(只改必须改的字节,文件里的注释与未知键原样保留)。
19
+ - **加载时机**:切到本分区时读一次,之后只在动作后更新,界面不会自己轮询。
20
+
21
+ 设计文档:[`docs/01-详细设计.md`](./docs/01-详细设计.md);
22
+ 官方依赖落点(升级兼容性检查用):[`docs/02-官方依赖落点.md`](./docs/02-官方依赖落点.md)。
23
+
24
+ ## 安装说明
25
+
26
+ ```sh
27
+ # 已发布到 npm 仓库
28
+ dsh plugin --profile web add dsh-mcp-ops
29
+
30
+ # 或本地 tarball(pnpm pack 的产物)
31
+ dsh plugin --profile web add /path/to/dsh-mcp-ops-0.1.0.tgz
32
+
33
+ # 卸载
34
+ dsh plugin --profile web remove dsh-mcp-ops
35
+ ```
36
+
37
+ 本包声明了 `dsh.bundle`,官方流程会自动把依赖写进 profile 的 `package.json` 并登记进
38
+ `dsh.profile.bundles`,包内的 `cordis.patch.yml` 作为 bundle 层自动应用 —— 不需要手工编辑任何
39
+ profile 文件。
40
+
41
+ **装了但设置页没有入口**:多半是 peer 版本不匹配 —— 启动日志里搜 `skipping profile bundle`,
42
+ 本插件的 `peerDependencies` 用 caret 范围(`^0.2.1-alpha.1`),运行 0.3.x 及以上时需要匹配的插件版本。
43
+
44
+ ## 开发说明
45
+
46
+ ```sh
47
+ pnpm run --config.verify-deps-before-run=false build # host + client 构建 + 产物守卫
48
+ node scripts/test.mjs # 测试矩阵:单元(零依赖)+ 集成(缺 DSH 闭包则跳过并打印原因)
49
+ pnpm pack --pack-destination docker # 打 tarball 供镜像构建(prepack 会先自动构建)
50
+ ```
51
+
52
+ ```
53
+ src/host/ host 半部(构建出 lib/,esbuild bundle:false,保留 @deepseek-ai/* 导入)
54
+ src/client/ 浏览器半部(构建出 lib/client.js,ModuleLoader wire format + CSS Modules)
55
+ scripts/ build-host / build-client / check-client-bundle / test / dsh-toolchain
56
+ tests/unit/ 零依赖逻辑用例 tests/integration/ 需要 DSH 闭包与 lib/ 产物
57
+ docker/ Dockerfile(官方 dsh plugin 命令装配)/ verify*.mjs / docker-compose.yaml
58
+ docs/ 详细设计与官方依赖落点
59
+ ```
60
+
61
+ - `@deepseek-ai/*` 只写 `peerDependencies`:写进 `dependencies` 会出现两份 `Context` / `Service` 类,
62
+ 服务注入静默失效。
63
+ - 本机 `node_modules` 里的 `@deepseek-ai` / `zod` / `js-yaml` 软链只服务仓库开发检出(跑单测 / 集成),
64
+ 与部署无关,**别删** —— 删了本机测试会大面积跳过。
65
+ - 版本号唯一来源是 `package.json` 的 `version`,改版本时同步 `docker/docker-compose.yaml` 的镜像标签;
66
+ `docker/Dockerfile` 里的 tgz 名用通配符,不写死版本。
67
+
68
+ 真机验证一律在本项目自己的容器里做(**不要**装进宿主 `~/.dsh`):
69
+
70
+ ```sh
71
+ pnpm run --config.verify-deps-before-run=false build && pnpm pack --pack-destination docker &&
72
+ docker build --progress=plain -t founder/dsh-mcp-ops:0.1.0 -f docker/Dockerfile docker/ &&
73
+ HOME=/home/ubuntu docker compose -f docker/docker-compose.yaml --project-directory docker up -d --force-recreate
74
+
75
+ node docker/verify.mjs # 容器端到端(装配终态 / 启动日志 / 服务侧 sync / locale 元数据 / 客户端产物)
76
+ TOKEN=$(docker logs dsh-mcp-ops 2>&1 | grep -o 'token=[A-Za-z0-9_-]*' | tail -1 | cut -d= -f2)
77
+ docker exec -e DSH_GUI_URL="http://127.0.0.1:3080/?token=$TOKEN" dsh-mcp-ops \
78
+ node "$PWD/docker/verify-gui.mjs" # 真实浏览器验收(含截图)
79
+ ```
80
+
81
+ 改客户端代码**必须重建镜像**:DSH 会缓存插件的客户端产物,换 `lib/client.js` 对浏览器无效。
82
+
83
+ ## 发布说明
84
+
85
+ 发布前把工作区提交干净(`pnpm publish` 会做 git 检查),并确认 `package.json` 的 `version` 与
86
+ `docker/docker-compose.yaml` 的镜像标签、本 README 的示例命令三处一致。
87
+
88
+ ```sh
89
+ # 1) 手工门禁(测试入口自己会先构建 host;这里再完整跑一遍 host+client 构建与产物守卫)
90
+ pnpm run --config.verify-deps-before-run=false build && node scripts/test.mjs
91
+
92
+ # 2) 认证:registry 必须显式指向公网(本机 npm_config_registry 常指向只读镜像源)
93
+ npm login --registry=https://registry.npmjs.org/
94
+ # CI 场景:echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
95
+
96
+ # 3) 干跑 → 正式发布(prepublishOnly 跑测试 → prepack 构建 → 打包上传)
97
+ npm publish --dry-run --registry=https://registry.npmjs.org/
98
+ npm publish --registry=https://registry.npmjs.org/ --access public
99
+
100
+ # 4) 发布后核对并打 tag
101
+ npm view dsh-mcp-ops@0.1.0 --registry=https://registry.npmjs.org/
102
+ git tag -a v0.1.0 -m "dsh-mcp-ops 0.1.0" && git push origin v0.1.0
103
+ ```
104
+
105
+ 72 小时内可 `npm unpublish dsh-mcp-ops@<版本>` 撤回;超时只能 `npm deprecate`。
106
+ 发布后的真机安装只在容器里做(不要装进宿主 `~/.dsh`):
107
+
108
+ ```sh
109
+ docker exec dsh-mcp-ops dsh plugin --profile web \
110
+ --config.store-dir=/home/node/.local/share/pnpm/store/v11 add dsh-mcp-ops
111
+ node docker/verify.mjs
112
+ ```
113
+
114
+ ## 许可说明
115
+
116
+ MIT,见 [`LICENSE`](./LICENSE)。
@@ -0,0 +1,14 @@
1
+ # 本插件的 bundle 补丁层。声明 dsh.bundle 后,`dsh plugin --profile web add <本包>`
2
+ # 会把本包写进 $DSH_HOME/profiles/web/package.json 的 dsh.profile.bundles,本文件
3
+ # 即作为 bundle 层自动应用 —— 不需要再手工编辑 profile 的 cordis.patch.yml。
4
+ #
5
+ # 安装:dsh plugin --profile web add dsh-mcp-ops
6
+ # (开发检出装目录时换成 link:<本仓库绝对路径>)
7
+ #
8
+ # 行 id = 包名(S1)。
9
+ # 已知取舍:Loader 对重复 id 的处理是"最后一条胜出并静默丢弃前面那条",
10
+ # 因此启动期做「重复行 id 检测」,把静默吞行转成可见诊断。
11
+ - insert:
12
+ - id: dsh-mcp-ops
13
+ name: dsh-mcp-ops
14
+ config: {}
package/icon.svg ADDED
@@ -0,0 +1,69 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" role="img" aria-label="Model Context Protocol">
2
+ <title>Model Context Protocol</title>
3
+ <!--
4
+ MCP(Model Context Protocol)钩链标记 —— 插件的包图标(`package.json.icon`)。
5
+
6
+ 为什么把颜色写死在文件里:DSH 的 readPluginMeta() 会把本文件读成
7
+ data:image/svg+xml;base64 并交给 <img src> 渲染。该上下文里 `currentColor` 会退化成
8
+ 黑色、CSS 变量不生效,只有文件内自带的 fill 才作数。
9
+
10
+ 为什么要 media query:`<img>` 里的 SVG 仍然按**系统**配色偏好匹配
11
+ prefers-color-scheme。浅色主题用品牌蓝 #247bbf,深色主题自动提亮到 #5aa9e6,
12
+ 两者对各自背景的对比度都 ≥ 3:1(图形类元素的可读性下限)。
13
+
14
+ 变体(单色 / 16px 光学加粗 / 圆角方形 App 图标 / 位图)见 icons/ 目录。
15
+ 几何取自 MCP 官方标记(MIT 许可;由简单几何构成,不受版权保护)。
16
+ -->
17
+ <style>
18
+ .mcp-mark { fill: #247bbf; }
19
+ @media (prefers-color-scheme: dark) {
20
+ .mcp-mark { fill: #5aa9e6; }
21
+ }
22
+ </style>
23
+ <!-- fill 属性是 <style> 不被支持时的回退(呈现属性优先级低于 CSS 规则)。 -->
24
+ <path class="mcp-mark" fill="#247bbf" d="M13.85 0
25
+ a4.16 4.16 0 0 0 -2.95 1.217
26
+ L1.456 10.66
27
+ a0.835 0.835 0 0 0 0 1.18
28
+ a0.835 0.835 0 0 0 1.18 0
29
+ l9.442 -9.442
30
+ a2.49 2.49 0 0 1 3.541 0
31
+ a2.49 2.49 0 0 1 0 3.541
32
+ L8.59 12.97
33
+ l-0.1 0.1
34
+ a0.835 0.835 0 0 0 0 1.18
35
+ a0.835 0.835 0 0 0 1.18 0
36
+ l0.1 -0.098
37
+ l7.03 -7.034
38
+ a2.49 2.49 0 0 1 3.542 0
39
+ l0.049 0.05
40
+ a2.49 2.49 0 0 1 0 3.54
41
+ l-8.54 8.54
42
+ a1.96 1.96 0 0 0 0 2.755
43
+ l1.753 1.753
44
+ a0.835 0.835 0 0 0 1.18 0
45
+ a0.835 0.835 0 0 0 0 -1.18
46
+ l-1.753 -1.753
47
+ a0.266 0.266 0 0 1 0 -0.394
48
+ l8.54 -8.54
49
+ a4.185 4.185 0 0 0 0 -5.9
50
+ l-0.05 -0.05
51
+ a4.16 4.16 0 0 0 -2.95 -1.218
52
+ c-0.2 0 -0.401 0.02 -0.6 0.048
53
+ a4.17 4.17 0 0 0 -1.17 -3.552
54
+ A4.16 4.16 0 0 0 13.85 0
55
+ m0 3.333
56
+ a0.84 0.84 0 0 0 -0.59 0.245
57
+ L6.275 10.56
58
+ a4.186 4.186 0 0 0 0 5.902
59
+ a4.186 4.186 0 0 0 5.902 0
60
+ L19.16 9.48
61
+ a0.835 0.835 0 0 0 0 -1.18
62
+ a0.835 0.835 0 0 0 -1.18 0
63
+ l-6.985 6.984
64
+ a2.49 2.49 0 0 1 -3.54 0
65
+ a2.49 2.49 0 0 1 0 -3.54
66
+ l6.983 -6.985
67
+ a0.835 0.835 0 0 0 0 -1.18
68
+ a0.84 0.84 0 0 0 -0.59 -0.245"/>
69
+ </svg>
@@ -0,0 +1,67 @@
1
+ # 图标资源
2
+
3
+ dsh-mcp-ops 的图标套件 —— **MCP(Model Context Protocol)钩链标记**,24×24 基准网格。
4
+
5
+ 形状只有一个真源:仓库根目录的 [`../icon.svg`](../icon.svg)。本目录下的 SVG 变体与位图
6
+ 都由 `node scripts/build-icons.mjs` 从它派生(文件头带"请勿手改"标记)。
7
+
8
+ 人工核对页面:[`preview.html`](./preview.html) —— 直接双击打开即可(纯静态、零依赖),
9
+ 里面把每个变体放进它真实会被用到的上下文(插件列表行、内联插图、尺寸阶梯),并可切换浅/深主题。
10
+
11
+ ## 文件
12
+
13
+ | 路径 | 用途 | 说明 |
14
+ | --- | --- | --- |
15
+ | `../icon.svg` | `package.json.icon` / `exports["./icon"]` | 24×24 完整标记;品牌蓝 `#247bbf`,深色主题自动提亮到 `#5aa9e6` |
16
+ | `mcp-mark-mono.svg` | 设置页内联插图、侧边栏 | `fill="currentColor"`,跟随宿主文字色 |
17
+ | `mcp-mark-16.svg` | 16px 场景 | 与真源同形的完整标记 + 0.15 单位光学描边 |
18
+ | `app-icon.svg` | 方形 App 图标 | 512×512、22.5% 圆角、品牌蓝渐变底 + 反白标记 |
19
+ | `favicon.ico` | 网页图标 / 书签 | 16/32/48 三尺寸内嵌 PNG(容器手写,零依赖) |
20
+ | `png/mcp-{16,20,24,32,48,64,128,256,512}.png` | README、市场页 | 透明底位图;16px 档带 0.15 单位光学描边 |
21
+ | `png/app-icon-{128,256,512,1024}.png` | 应用列表、商店页 | 圆角方形位图 |
22
+
23
+ ## 三个接入点
24
+
25
+ **① 插件列表 / 设置页的插件条目 —— 已经在用。**
26
+ `package.json` 的 `icon` 字段指向 `../icon.svg`,`exports` 里的 `"./icon"` 让自引用解析也走得通。
27
+ DSH 的 `readPluginMeta()` 会把它读成 `data:image/svg+xml;base64,…` 交给 `<img>` 渲染
28
+ (见 [`docs/01-详细设计.md`](../docs/01-详细设计.md) 的「运行环境与装载契约」)。
29
+
30
+ > 这个上下文决定了配色策略:`<img>` 里的 SVG **不吃** `currentColor`(会退化成黑色)、
31
+ > 也**不吃** CSS 变量,所以颜色必须写死在文件内;文件内的 `prefers-color-scheme`
32
+ > 跟随的是**系统**主题(不是 DSH 的应用内主题)。
33
+
34
+ **② 设置页内联插图 —— 用单色版。**
35
+ `settings.section` 的注册项只有 `id` / `order` / `label`,**没有 icon 字段**,所以设置分区
36
+ 导航里不显示图标。要在分区内容里放图标(标题前、空状态、行首),把 `mcp-mark-mono.svg`
37
+ 的内容内联进 JSX —— 只有内联进 DOM,`currentColor` 才会解析成宿主的文字色:
38
+
39
+ ```tsx
40
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true">
41
+ <path d="…" />
42
+ </svg>
43
+ ```
44
+
45
+ **③ 16px 场景 —— 用同形的加粗版。**
46
+ 完整标记笔画中心距 2.51 单位、带宽 1.67,剩下的 0.84 单位间隙映射到 16px 只有 0.56 像素,
47
+ 抗锯齿一定会吃掉它 —— 这是物理下限。**但不要为此删掉内层钩**:只留外层钩的简化几何(间隙翻倍、
48
+ 小尺寸确实更清晰)会让 16px 与其它档位成为**两个不同图形**(丢了内层钩的 U)、跨尺寸观感割裂。
49
+ 所以 16px 档与真源**同形**,只加 0.15 单位描边略增视觉重量
50
+ (实测加粗 0.25 / 0.35 会明显加剧粘连),`viewBox` 同步外扩 0.075 免得圆帽与尾钩被裁。
51
+ 实践上把 16px 当作可用下限:能选 ≥20px 就别用 16px。
52
+
53
+ ## 再生成
54
+
55
+ ```sh
56
+ node scripts/build-icons.mjs # 幂等;3 个 SVG 变体 + 13 张 PNG + 1 个 ICO
57
+ node scripts/test.mjs # tests/unit/icons.test.mjs 钉住几何同步与位图尺寸
58
+ ```
59
+
60
+ 脚本需要 sharp(内含 librsvg)把 SVG 光栅化,按固定顺序探测来源,都找不到时会打印
61
+ 可操作的补救办法(`$DSH_SHARP` / 包内安装 / DSH 检出)。**图标 SVG 与预览页不依赖 sharp**,
62
+ 缺它时只有位图环节不可用。
63
+
64
+ ## 许可
65
+
66
+ 标记几何取自 Model Context Protocol 官方标识(MIT 许可;由简单几何构成,不受版权保护)。
67
+ MCP 的名称与商标归其所有者;本套件仅用于标识 dsh-mcp-ops 这个 MCP 生态插件。
@@ -0,0 +1,14 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512" role="img" aria-label="Model Context Protocol">
2
+ <title>Model Context Protocol</title>
3
+ <!-- 本文件由 scripts/build-icons.mjs 生成,请勿手改;形状真源是根目录的 icon.svg。 -->
4
+ <defs>
5
+ <linearGradient id="app-bg" x1="0" y1="0" x2="1" y2="1">
6
+ <stop offset="0" stop-color="#247bbf"/>
7
+ <stop offset="1" stop-color="#1b5f96"/>
8
+ </linearGradient>
9
+ </defs>
10
+ <rect width="512" height="512" rx="115" ry="115" fill="url(#app-bg)"/>
11
+ <g transform="translate(106.01 106) scale(12.5)" fill="#ffffff">
12
+ <path d="M13.85 0 a4.16 4.16 0 0 0 -2.95 1.217 L1.456 10.66 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l9.442 -9.442 a2.49 2.49 0 0 1 3.541 0 a2.49 2.49 0 0 1 0 3.541 L8.59 12.97 l-0.1 0.1 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l0.1 -0.098 l7.03 -7.034 a2.49 2.49 0 0 1 3.542 0 l0.049 0.05 a2.49 2.49 0 0 1 0 3.54 l-8.54 8.54 a1.96 1.96 0 0 0 0 2.755 l1.753 1.753 a0.835 0.835 0 0 0 1.18 0 a0.835 0.835 0 0 0 0 -1.18 l-1.753 -1.753 a0.266 0.266 0 0 1 0 -0.394 l8.54 -8.54 a4.185 4.185 0 0 0 0 -5.9 l-0.05 -0.05 a4.16 4.16 0 0 0 -2.95 -1.218 c-0.2 0 -0.401 0.02 -0.6 0.048 a4.17 4.17 0 0 0 -1.17 -3.552 A4.16 4.16 0 0 0 13.85 0 m0 3.333 a0.84 0.84 0 0 0 -0.59 0.245 L6.275 10.56 a4.186 4.186 0 0 0 0 5.902 a4.186 4.186 0 0 0 5.902 0 L19.16 9.48 a0.835 0.835 0 0 0 0 -1.18 a0.835 0.835 0 0 0 -1.18 0 l-6.985 6.984 a2.49 2.49 0 0 1 -3.54 0 a2.49 2.49 0 0 1 0 -3.54 l6.983 -6.985 a0.835 0.835 0 0 0 0 -1.18 a0.84 0.84 0 0 0 -0.59 -0.245"/>
13
+ </g>
14
+ </svg>
Binary file
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.075 -0.075 24.15 24.15" width="16" height="16" fill="currentColor" role="img" aria-label="Model Context Protocol">
2
+ <title>Model Context Protocol</title>
3
+ <!-- 本文件由 scripts/build-icons.mjs 生成,请勿手改;形状真源是根目录的 icon.svg。 -->
4
+ <!-- 16px 档:完整几何(与 icon.svg 同形)+ 0.15 单位光学加粗。
5
+ 完整标记 0.84 单位的笔画间隙在 16px 下只剩 0.56 像素,加粗再多只会加剧粘连;
6
+ 描边外扩 0.075,viewBox 同步外扩等量,免得圆帽与尾钩被裁。 -->
7
+ <path d="M13.85 0 a4.16 4.16 0 0 0 -2.95 1.217 L1.456 10.66 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l9.442 -9.442 a2.49 2.49 0 0 1 3.541 0 a2.49 2.49 0 0 1 0 3.541 L8.59 12.97 l-0.1 0.1 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l0.1 -0.098 l7.03 -7.034 a2.49 2.49 0 0 1 3.542 0 l0.049 0.05 a2.49 2.49 0 0 1 0 3.54 l-8.54 8.54 a1.96 1.96 0 0 0 0 2.755 l1.753 1.753 a0.835 0.835 0 0 0 1.18 0 a0.835 0.835 0 0 0 0 -1.18 l-1.753 -1.753 a0.266 0.266 0 0 1 0 -0.394 l8.54 -8.54 a4.185 4.185 0 0 0 0 -5.9 l-0.05 -0.05 a4.16 4.16 0 0 0 -2.95 -1.218 c-0.2 0 -0.401 0.02 -0.6 0.048 a4.17 4.17 0 0 0 -1.17 -3.552 A4.16 4.16 0 0 0 13.85 0 m0 3.333 a0.84 0.84 0 0 0 -0.59 0.245 L6.275 10.56 a4.186 4.186 0 0 0 0 5.902 a4.186 4.186 0 0 0 5.902 0 L19.16 9.48 a0.835 0.835 0 0 0 0 -1.18 a0.835 0.835 0 0 0 -1.18 0 l-6.985 6.984 a2.49 2.49 0 0 1 -3.54 0 a2.49 2.49 0 0 1 0 -3.54 l6.983 -6.985 a0.835 0.835 0 0 0 0 -1.18 a0.84 0.84 0 0 0 -0.59 -0.245" stroke="currentColor" stroke-width="0.15" stroke-linejoin="round"/>
8
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="currentColor" role="img" aria-label="Model Context Protocol">
2
+ <title>Model Context Protocol</title>
3
+ <!-- 本文件由 scripts/build-icons.mjs 生成,请勿手改;形状真源是根目录的 icon.svg。 -->
4
+ <!-- fill 写在根元素上,内联后跟随宿主的 color(DSH 设置页的主题前景色)。 -->
5
+ <path d="M13.85 0 a4.16 4.16 0 0 0 -2.95 1.217 L1.456 10.66 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l9.442 -9.442 a2.49 2.49 0 0 1 3.541 0 a2.49 2.49 0 0 1 0 3.541 L8.59 12.97 l-0.1 0.1 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l0.1 -0.098 l7.03 -7.034 a2.49 2.49 0 0 1 3.542 0 l0.049 0.05 a2.49 2.49 0 0 1 0 3.54 l-8.54 8.54 a1.96 1.96 0 0 0 0 2.755 l1.753 1.753 a0.835 0.835 0 0 0 1.18 0 a0.835 0.835 0 0 0 0 -1.18 l-1.753 -1.753 a0.266 0.266 0 0 1 0 -0.394 l8.54 -8.54 a4.185 4.185 0 0 0 0 -5.9 l-0.05 -0.05 a4.16 4.16 0 0 0 -2.95 -1.218 c-0.2 0 -0.401 0.02 -0.6 0.048 a4.17 4.17 0 0 0 -1.17 -3.552 A4.16 4.16 0 0 0 13.85 0 m0 3.333 a0.84 0.84 0 0 0 -0.59 0.245 L6.275 10.56 a4.186 4.186 0 0 0 0 5.902 a4.186 4.186 0 0 0 5.902 0 L19.16 9.48 a0.835 0.835 0 0 0 0 -1.18 a0.835 0.835 0 0 0 -1.18 0 l-6.985 6.984 a2.49 2.49 0 0 1 -3.54 0 a2.49 2.49 0 0 1 0 -3.54 l6.983 -6.985 a0.835 0.835 0 0 0 0 -1.18 a0.84 0.84 0 0 0 -0.59 -0.245"/>
6
+ </svg>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,271 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>dsh-mcp-ops 图标套件预览</title>
7
+ <!--
8
+ 图标套件的人工核对页:把每个变体放到它**真实会被用到**的上下文里看。
9
+
10
+ 本页内联的 <path> 副本只用于演示(单色版必须内联才能吃到 currentColor),
11
+ 形状真源始终是 ../icon.svg;tests/unit/icons.test.mjs 会在归一化空白后
12
+ 逐字比对两者,副本过时会让测试失败。
13
+ -->
14
+ <style>
15
+ :root {
16
+ color-scheme: light dark;
17
+ --bg: #ffffff;
18
+ --panel: #f6f8fa;
19
+ --panel-2: #eef1f5;
20
+ --text: #1f2328;
21
+ --muted: #59636e;
22
+ --border: #d0d7de;
23
+ --brand: #247bbf;
24
+ --brand-soft: #5aa9e6;
25
+ --radius: 10px;
26
+ }
27
+ html[data-theme="dark"] {
28
+ --bg: #16181d;
29
+ --panel: #1f2228;
30
+ --panel-2: #262a31;
31
+ --text: #e6edf3;
32
+ --muted: #9aa4b2;
33
+ --border: #30363d;
34
+ --brand: #5aa9e6;
35
+ --brand-soft: #247bbf;
36
+ }
37
+ @media (prefers-color-scheme: dark) {
38
+ html[data-theme="auto"] {
39
+ --bg: #16181d;
40
+ --panel: #1f2228;
41
+ --panel-2: #262a31;
42
+ --text: #e6edf3;
43
+ --muted: #9aa4b2;
44
+ --border: #30363d;
45
+ --brand: #5aa9e6;
46
+ --brand-soft: #247bbf;
47
+ }
48
+ }
49
+ * { box-sizing: border-box; }
50
+ body {
51
+ margin: 0 auto;
52
+ padding: 32px 24px 64px;
53
+ max-width: 960px;
54
+ background: var(--bg);
55
+ color: var(--text);
56
+ font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
57
+ }
58
+ h1 { font-size: 22px; margin: 0 0 6px; }
59
+ h2 { font-size: 16px; margin: 0 0 4px; }
60
+ h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
61
+ p { margin: 0 0 10px; color: var(--muted); }
62
+ code {
63
+ padding: 1px 5px;
64
+ border-radius: 4px;
65
+ background: var(--panel-2);
66
+ font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
67
+ }
68
+ header { margin-bottom: 28px; }
69
+ header .bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
70
+ button {
71
+ flex: none;
72
+ padding: 6px 12px;
73
+ border: 1px solid var(--border);
74
+ border-radius: 8px;
75
+ background: var(--panel);
76
+ color: var(--text);
77
+ font: inherit;
78
+ font-size: 12px;
79
+ cursor: pointer;
80
+ }
81
+ button:hover { background: var(--panel-2); }
82
+ section {
83
+ margin-bottom: 26px;
84
+ padding: 18px;
85
+ border: 1px solid var(--border);
86
+ border-radius: var(--radius);
87
+ background: var(--panel);
88
+ }
89
+ .stage { padding: 16px; border-radius: 8px; border: 1px dashed var(--border); background: var(--bg); }
90
+ .row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; }
91
+ figure { margin: 0; text-align: center; }
92
+ figcaption { margin-top: 6px; font-size: 11px; color: var(--muted); }
93
+ /* 模拟 DSH 插件列表里的一行:图标 + 标题 + 描述 */
94
+ .plugin-row {
95
+ display: flex;
96
+ gap: 12px;
97
+ align-items: center;
98
+ max-width: 420px;
99
+ margin-top: 16px;
100
+ padding: 10px 12px;
101
+ border: 1px solid var(--border);
102
+ border-radius: 8px;
103
+ background: var(--panel-2);
104
+ }
105
+ .plugin-row img { flex: none; }
106
+ .plugin-row .t { font-weight: 600; }
107
+ .plugin-row .d { font-size: 12px; color: var(--muted); }
108
+ .mono-set { display: flex; gap: 26px; align-items: flex-end; }
109
+ .mono-set .item { text-align: center; }
110
+ .mono-set .item span { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
111
+ table { width: 100%; border-collapse: collapse; font-size: 13px; }
112
+ th, td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
113
+ th { font-size: 12px; color: var(--muted); font-weight: 600; }
114
+ td code { background: transparent; padding: 0; }
115
+ .zoom { image-rendering: pixelated; }
116
+ ul { margin: 0; padding-left: 20px; color: var(--muted); }
117
+ li { margin-bottom: 4px; }
118
+ </style>
119
+ </head>
120
+ <body>
121
+ <header>
122
+ <div class="bar">
123
+ <div>
124
+ <h1>dsh-mcp-ops 图标套件</h1>
125
+ <p>MCP 钩链标记(Model Context Protocol,MIT)—— 24×24 基准,派生单色版、16px 档、圆角方形 App 图标与多尺寸位图。</p>
126
+ </div>
127
+ <button id="theme-toggle" type="button">主题:跟随系统</button>
128
+ </div>
129
+ </header>
130
+
131
+ <section>
132
+ <h2>1. 包图标 · <code>package.json.icon</code></h2>
133
+ <p>这是 DSH 里真正会走的那条路:<code>readPluginMeta()</code> 把 <code>../icon.svg</code> 读成
134
+ <code>data:image/svg+xml;base64,…</code> 交给 <code>&lt;img&gt;</code>。该上下文里
135
+ <code>currentColor</code> 会退化成黑色、CSS 变量不生效,所以颜色写死在文件内;
136
+ 文件里的 <code>prefers-color-scheme</code> 跟随的是**系统**主题 ——
137
+ 换句话说,右上角切本页主题<strong>不会</strong>改变下面这几张图的颜色,切系统主题才会。</p>
138
+ <div class="stage">
139
+ <div class="row">
140
+ <figure><img src="../icon.svg" width="16" height="16" alt="MCP 标记 16px"><figcaption>16px</figcaption></figure>
141
+ <figure><img src="../icon.svg" width="24" height="24" alt="MCP 标记 24px"><figcaption>24px</figcaption></figure>
142
+ <figure><img src="../icon.svg" width="32" height="32" alt="MCP 标记 32px"><figcaption>32px</figcaption></figure>
143
+ <figure><img src="../icon.svg" width="48" height="48" alt="MCP 标记 48px"><figcaption>48px</figcaption></figure>
144
+ <figure><img src="../icon.svg" width="64" height="64" alt="MCP 标记 64px"><figcaption>64px</figcaption></figure>
145
+ </div>
146
+ <div class="plugin-row">
147
+ <img src="../icon.svg" width="28" height="28" alt="">
148
+ <div>
149
+ <div class="t">MCP 服务器</div>
150
+ <div class="d">以 .mcp.json 文件为唯一真源管理 MCP 服务器:增删改查、启用/禁用、连接测试……</div>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </section>
155
+
156
+ <section>
157
+ <h2>2. 单色版 · <code>mcp-mark-mono.svg</code></h2>
158
+ <p>给设置页内联插图用:<code>fill="currentColor"</code>,直接吃宿主的文字色,深浅主题零维护。
159
+ 注意它**只在内联进 DOM 时**有意义 —— 走 <code>&lt;img&gt;</code> 会变成黑色。</p>
160
+ <div class="stage">
161
+ <div class="mono-set">
162
+ <div class="item" style="color: var(--text)">
163
+ <svg viewBox="0 0 24 24" width="32" height="32" fill="currentColor" aria-label="MCP 标记"><path d="M13.85 0 a4.16 4.16 0 0 0 -2.95 1.217 L1.456 10.66 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l9.442 -9.442 a2.49 2.49 0 0 1 3.541 0 a2.49 2.49 0 0 1 0 3.541 L8.59 12.97 l-0.1 0.1 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l0.1 -0.098 l7.03 -7.034 a2.49 2.49 0 0 1 3.542 0 l0.049 0.05 a2.49 2.49 0 0 1 0 3.54 l-8.54 8.54 a1.96 1.96 0 0 0 0 2.755 l1.753 1.753 a0.835 0.835 0 0 0 1.18 0 a0.835 0.835 0 0 0 0 -1.18 l-1.753 -1.753 a0.266 0.266 0 0 1 0 -0.394 l8.54 -8.54 a4.185 4.185 0 0 0 0 -5.9 l-0.05 -0.05 a4.16 4.16 0 0 0 -2.95 -1.218 c-0.2 0 -0.401 0.02 -0.6 0.048 a4.17 4.17 0 0 0 -1.17 -3.552 A4.16 4.16 0 0 0 13.85 0 m0 3.333 a0.84 0.84 0 0 0 -0.59 0.245 L6.275 10.56 a4.186 4.186 0 0 0 0 5.902 a4.186 4.186 0 0 0 5.902 0 L19.16 9.48 a0.835 0.835 0 0 0 0 -1.18 a0.835 0.835 0 0 0 -1.18 0 l-6.985 6.984 a2.49 2.49 0 0 1 -3.54 0 a2.49 2.49 0 0 1 0 -3.54 l6.983 -6.985 a0.835 0.835 0 0 0 0 -1.18 a0.84 0.84 0 0 0 -0.59 -0.245"/></svg>
164
+ <span>正文色</span>
165
+ </div>
166
+ <div class="item" style="color: var(--muted)">
167
+ <svg viewBox="0 0 24 24" width="32" height="32" fill="currentColor" aria-label="MCP 标记"><path d="M13.85 0 a4.16 4.16 0 0 0 -2.95 1.217 L1.456 10.66 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l9.442 -9.442 a2.49 2.49 0 0 1 3.541 0 a2.49 2.49 0 0 1 0 3.541 L8.59 12.97 l-0.1 0.1 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l0.1 -0.098 l7.03 -7.034 a2.49 2.49 0 0 1 3.542 0 l0.049 0.05 a2.49 2.49 0 0 1 0 3.54 l-8.54 8.54 a1.96 1.96 0 0 0 0 2.755 l1.753 1.753 a0.835 0.835 0 0 0 1.18 0 a0.835 0.835 0 0 0 0 -1.18 l-1.753 -1.753 a0.266 0.266 0 0 1 0 -0.394 l8.54 -8.54 a4.185 4.185 0 0 0 0 -5.9 l-0.05 -0.05 a4.16 4.16 0 0 0 -2.95 -1.218 c-0.2 0 -0.401 0.02 -0.6 0.048 a4.17 4.17 0 0 0 -1.17 -3.552 A4.16 4.16 0 0 0 13.85 0 m0 3.333 a0.84 0.84 0 0 0 -0.59 0.245 L6.275 10.56 a4.186 4.186 0 0 0 0 5.902 a4.186 4.186 0 0 0 5.902 0 L19.16 9.48 a0.835 0.835 0 0 0 0 -1.18 a0.835 0.835 0 0 0 -1.18 0 l-6.985 6.984 a2.49 2.49 0 0 1 -3.54 0 a2.49 2.49 0 0 1 0 -3.54 l6.983 -6.985 a0.835 0.835 0 0 0 0 -1.18 a0.84 0.84 0 0 0 -0.59 -0.245"/></svg>
168
+ <span>次要文字色</span>
169
+ </div>
170
+ <div class="item" style="color: var(--brand)">
171
+ <svg viewBox="0 0 24 24" width="32" height="32" fill="currentColor" aria-label="MCP 标记"><path d="M13.85 0 a4.16 4.16 0 0 0 -2.95 1.217 L1.456 10.66 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l9.442 -9.442 a2.49 2.49 0 0 1 3.541 0 a2.49 2.49 0 0 1 0 3.541 L8.59 12.97 l-0.1 0.1 a0.835 0.835 0 0 0 0 1.18 a0.835 0.835 0 0 0 1.18 0 l0.1 -0.098 l7.03 -7.034 a2.49 2.49 0 0 1 3.542 0 l0.049 0.05 a2.49 2.49 0 0 1 0 3.54 l-8.54 8.54 a1.96 1.96 0 0 0 0 2.755 l1.753 1.753 a0.835 0.835 0 0 0 1.18 0 a0.835 0.835 0 0 0 0 -1.18 l-1.753 -1.753 a0.266 0.266 0 0 1 0 -0.394 l8.54 -8.54 a4.185 4.185 0 0 0 0 -5.9 l-0.05 -0.05 a4.16 4.16 0 0 0 -2.95 -1.218 c-0.2 0 -0.401 0.02 -0.6 0.048 a4.17 4.17 0 0 0 -1.17 -3.552 A4.16 4.16 0 0 0 13.85 0 m0 3.333 a0.84 0.84 0 0 0 -0.59 0.245 L6.275 10.56 a4.186 4.186 0 0 0 0 5.902 a4.186 4.186 0 0 0 5.902 0 L19.16 9.48 a0.835 0.835 0 0 0 0 -1.18 a0.835 0.835 0 0 0 -1.18 0 l-6.985 6.984 a2.49 2.49 0 0 1 -3.54 0 a2.49 2.49 0 0 1 0 -3.54 l6.983 -6.985 a0.835 0.835 0 0 0 0 -1.18 a0.84 0.84 0 0 0 -0.59 -0.245"/></svg>
172
+ <span>品牌色</span>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </section>
177
+
178
+ <section>
179
+ <h2>3. 16px 档 · <code>mcp-mark-16.svg</code></h2>
180
+ <p>与其它档位<strong>同形</strong>:完整标记 + 0.15 单位光学描边。完整标记的笔画间隙只有 0.84 单位,
181
+ 映射到 16px 只剩 <strong>0.56 像素</strong> —— 偏糊是物理下限,不是参数没调好。用"只留外层钩"的
182
+ 简化几何换清晰度会让 16px 与 24px 成为<strong>两个不同图形</strong>(丢了内层钩的 U),所以不采用;
183
+ 加粗也只在 0.15 以内有意义(0.25 / 0.35 实测明显加剧粘连)。能选 ≥20px 就别用 16px。</p>
184
+ <div class="stage">
185
+ <div class="row">
186
+ <figure>
187
+ <img class="zoom" src="png/mcp-16.png" width="16" height="16" alt="16px 档"><br>
188
+ <img class="zoom" src="png/mcp-16.png" width="128" height="128" alt="" style="margin-top:8px">
189
+ <figcaption>mcp-16.png(下为 8× 放大)</figcaption>
190
+ </figure>
191
+ <figure>
192
+ <img class="zoom" src="png/mcp-24.png" width="24" height="24" alt="24px 完整版"><br>
193
+ <img class="zoom" src="png/mcp-24.png" width="128" height="128" alt="" style="margin-top:8px">
194
+ <figcaption>mcp-24.png(完整标记对照)</figcaption>
195
+ </figure>
196
+ </div>
197
+ </div>
198
+ </section>
199
+
200
+ <section>
201
+ <h2>4. 多尺寸位图 · <code>icons/png/</code></h2>
202
+ <p>1:1 尺寸阶梯(用于 README、市场页等非 SVG 场景)。全部为品牌蓝 <code>#247bbf</code> 的透明底 PNG。
203
+ <code>favicon.ico</code> 把 16/32/48 三档装进一个 ICO 容器(每档内嵌一份 PNG 字节),
204
+ Vista 之后的 Windows 与所有现代浏览器都直接认。</p>
205
+ <div class="stage">
206
+ <div class="row">
207
+ <figure><img src="png/mcp-16.png" width="16" height="16" alt=""><figcaption>16</figcaption></figure>
208
+ <figure><img src="png/mcp-20.png" width="20" height="20" alt=""><figcaption>20</figcaption></figure>
209
+ <figure><img src="png/mcp-24.png" width="24" height="24" alt=""><figcaption>24</figcaption></figure>
210
+ <figure><img src="png/mcp-32.png" width="32" height="32" alt=""><figcaption>32</figcaption></figure>
211
+ <figure><img src="png/mcp-48.png" width="48" height="48" alt=""><figcaption>48</figcaption></figure>
212
+ <figure><img src="png/mcp-64.png" width="64" height="64" alt=""><figcaption>64</figcaption></figure>
213
+ <figure><img src="png/mcp-128.png" width="128" height="128" alt=""><figcaption>128</figcaption></figure>
214
+ <figure><img src="png/mcp-256.png" width="128" height="128" alt=""><figcaption>256(按 128 显示)</figcaption></figure>
215
+ <figure><img src="png/mcp-512.png" width="128" height="128" alt=""><figcaption>512(按 128 显示)</figcaption></figure>
216
+ <figure><img src="favicon.ico" width="48" height="48" alt=""><figcaption>favicon.ico</figcaption></figure>
217
+ </div>
218
+ </div>
219
+ </section>
220
+
221
+ <section>
222
+ <h2>5. 圆角方形 App 图标 · <code>app-icon.svg</code></h2>
223
+ <p>512×512 画布、22.5% 圆角、品牌蓝渐变底、反白标记(标记高度占 58.6%,其余留作安全边距)。
224
+ 用于应用列表、商店页等需要"方形 App 图标"的位置。</p>
225
+ <div class="stage">
226
+ <div class="row">
227
+ <figure><img src="png/app-icon-128.png" width="64" height="64" alt=""><figcaption>128</figcaption></figure>
228
+ <figure><img src="png/app-icon-256.png" width="96" height="96" alt=""><figcaption>256</figcaption></figure>
229
+ <figure><img src="png/app-icon-512.png" width="128" height="128" alt=""><figcaption>512</figcaption></figure>
230
+ <figure><img src="png/app-icon-1024.png" width="160" height="160" alt=""><figcaption>1024</figcaption></figure>
231
+ </div>
232
+ </div>
233
+ </section>
234
+
235
+ <section>
236
+ <h2>6. 文件与用途</h2>
237
+ <table>
238
+ <thead><tr><th>路径</th><th>用途</th><th>说明</th></tr></thead>
239
+ <tbody>
240
+ <tr><td><code>../icon.svg</code></td><td><code>package.json.icon</code>、<code>exports["./icon"]</code></td><td>24×24 完整标记;品牌蓝 + 深色主题自动提亮</td></tr>
241
+ <tr><td><code>mcp-mark-mono.svg</code></td><td>设置页内联插图、侧边栏</td><td><code>currentColor</code>,跟随宿主文字色</td></tr>
242
+ <tr><td><code>mcp-mark-16.svg</code></td><td>16px 场景</td><td>与真源同形(完整标记)+ 0.15 单位光学描边</td></tr>
243
+ <tr><td><code>app-icon.svg</code></td><td>App 图标</td><td>512×512 圆角方形,渐变底 + 反白标记</td></tr>
244
+ <tr><td><code>favicon.ico</code></td><td>网页图标 / 书签</td><td>16/32/48 三尺寸内嵌 PNG,容器手写</td></tr>
245
+ <tr><td><code>png/mcp-{16…512}.png</code></td><td>README / 市场页</td><td>9 档位图,16px 档带光学描边</td></tr>
246
+ <tr><td><code>png/app-icon-{128…1024}.png</code></td><td>应用列表 / 商店</td><td>4 档位图</td></tr>
247
+ </tbody>
248
+ </table>
249
+ <h3 style="margin-top:16px">再生成</h3>
250
+ <p>形状真源是 <code>../icon.svg</code>;改完形状后跑
251
+ <code>node scripts/build-icons.mjs</code>(需要 sharp,脚本按固定顺序探测,缺失时会打印补救办法)。</p>
252
+ <h3>许可</h3>
253
+ <ul>
254
+ <li>标记几何取自 Model Context Protocol 官方标识(MIT;由简单几何构成,不受版权保护)。</li>
255
+ <li>品牌名称与商标归其所有者;本套件仅用于标识 dsh-mcp-ops 这个 MCP 生态插件。</li>
256
+ </ul>
257
+ </section>
258
+
259
+ <script>
260
+ const root = document.documentElement
261
+ const button = document.getElementById('theme-toggle')
262
+ const modes = ['auto', 'light', 'dark']
263
+ const labels = { auto: '主题:跟随系统', light: '主题:浅色', dark: '主题:深色' }
264
+ button.addEventListener('click', () => {
265
+ const next = modes[(modes.indexOf(root.dataset.theme) + 1) % modes.length]
266
+ root.dataset.theme = next
267
+ button.textContent = labels[next]
268
+ })
269
+ </script>
270
+ </body>
271
+ </html>