dsh-mcp-connector 0.2.87 → 0.2.88
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.
- package/CHANGELOG.md +13 -0
- package/README.en.md +10 -2
- package/README.md +10 -2
- package/docs/I18N.md +129 -0
- package/docs/screenshots/01-market-overview.jpg +0 -0
- package/docs/screenshots/02-connector-detail.jpg +0 -0
- package/docs/screenshots/03-tool-discovery.jpg +0 -0
- package/docs/screenshots/04-json-import.jpg +0 -0
- package/docs/screenshots/05-unified-tool-search.png +0 -0
- package/docs/screenshots/06-tool-parameters.png +0 -0
- package/docs/screenshots/07-connection-diagnostics.png +0 -0
- package/docs/screenshots/08-ten-recommendations.jpg +0 -0
- package/docs/screenshots/README.md +1 -1
- package/docs/screenshots/assets.json +20 -20
- package/docs/tutorials/FIRST-SUCCESS-SCENARIOS.md +1 -1
- package/lib/callback-server.js +29 -7
- package/lib/catalog.js +36 -30
- package/lib/cli-providers.js +96 -49
- package/lib/client.js +349 -115
- package/lib/connection-backup.js +6 -2
- package/lib/connection-editor.js +36 -32
- package/lib/connection-scopes.js +57 -44
- package/lib/connectors/json-connector.js +28 -24
- package/lib/connectors/manual-connector.js +20 -16
- package/lib/connectors/oauth-connector.js +18 -7
- package/lib/diagnostics.js +90 -23
- package/lib/governance.js +74 -49
- package/lib/host-tool-names.js +8 -5
- package/lib/i18n/index.js +129 -0
- package/lib/i18n/locales/en/client.js +101 -0
- package/lib/i18n/locales/en/diagnostics.js +84 -0
- package/lib/i18n/locales/en/host.js +230 -0
- package/lib/i18n/locales/en/shared.js +93 -0
- package/lib/i18n/locales/en/tools.js +138 -0
- package/lib/i18n/locales/en/upgrade.js +62 -0
- package/lib/i18n/locales/en/validation.js +140 -0
- package/lib/i18n/locales/en/web.js +13 -0
- package/lib/i18n/locales/en.js +54 -0
- package/lib/index.js +348 -222
- package/lib/local-overrides.js +16 -12
- package/lib/mcp-http.js +31 -26
- package/lib/mcp-validation.js +61 -33
- package/lib/migration.js +11 -3
- package/lib/probe.js +13 -9
- package/lib/prompts.js +7 -2
- package/lib/schema.js +27 -12
- package/lib/session-injection.js +38 -32
- package/lib/shareable-connection-template.js +78 -45
- package/lib/tool-catalog-cache.js +8 -4
- package/lib/tools.js +173 -194
- package/lib/util.js +13 -5
- package/lib/version-status.js +8 -2
- package/lib/web.js +49 -6
- package/package.json +2 -1
- package/scripts/ui-harness.mjs +10 -1
- package/ui/connection-template-sharing.js +31 -30
- package/ui/index.html +947 -325
- package/ui/locale.js +92 -0
- package/ui/sharing-experience.js +55 -54
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);首个公开版本从 `0.1.0` 开始。
|
|
4
4
|
|
|
5
|
+
## [0.2.88] - 2026-10-31
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- 整合 #167 / #174 的中英文 UI、诊断和管理工具翻译,并保留至 0.2.87 的运行时、安全、多工作区和分享功能。感谢 Marek Vrbka 的国际化贡献。
|
|
10
|
+
- 面板新增简体中文 / English 切换;切换时若有未保存编辑需先确认。Host `locale: auto` 跟随 DSH 显式偏好,缺失时回退中文,不再根据英文 shell 环境自动切换。显式 `zh-CN` / `en` 控制 Host 文案。
|
|
11
|
+
- 补译近期新增的首次使用、范围管理、统计与分享编辑器提示,修复 Windows 翻译完整性检查的文件路径处理。
|
|
12
|
+
- 连接器品牌和描述、用户输入、工具 ID、URL、错误码及分享模板 v1 固定安全标记不翻译;不改变凭据、权限或数据格式。
|
|
13
|
+
|
|
14
|
+
### Verification scope
|
|
15
|
+
|
|
16
|
+
- 本地完整检查及隔离真实 Chromium 中英 UI 检查分别执行;后者只使用 Mock API,不是业务调用或 Windows Desktop 实机验收。Windows Desktop 反馈继续在 #167 跟踪。
|
|
17
|
+
|
|
5
18
|
## [0.2.87] - 2026-10-31
|
|
6
19
|
|
|
7
20
|
### Added
|
package/README.en.md
CHANGED
|
@@ -10,6 +10,8 @@ OAuth availability depends on each provider's client-registration policy and acc
|
|
|
10
10
|
|
|
11
11
|
[简体中文](README.md)
|
|
12
12
|
|
|
13
|
+
**Bilingual interface:** Choose **简体中文 / English** at the top of the panel. Host messages follow the explicit DSH language preference, defaulting to Chinese when unavailable; configure `locale: en` or `locale: zh-CN` to override. The panel selector reloads only the panel and confirms before discarding edits. Provider descriptions and user content retain their original language. See [language configuration](docs/I18N.md).
|
|
14
|
+
|
|
13
15
|
### Homepage recommendations
|
|
14
16
|
|
|
15
17
|
The homepage shows ten recommendations in a fixed order: Qichacha company data, Tencent Docs, Feishu, Notion, GitHub, Playwright, Wind stock data, Qichacha legal data, Amap, and Context7. All available recommended cards are expanded by default. This is a curated selection, not a usage ranking; provider authorization and configuration requirements still apply.
|
|
@@ -112,7 +114,7 @@ As of 2026-10-24, the public Registry publishes 112 connector descriptors. After
|
|
|
112
114
|
| Connection diagnostics and last-success cache | |
|
|
113
115
|
|  | |
|
|
114
116
|
|
|
115
|
-
<!-- generated:media -->Screenshots and GIF were captured from v0.2.
|
|
117
|
+
<!-- generated:media -->Screenshots and GIF were captured from v0.2.88 (2026-10-31), using the credential-free Mock harness. They demonstrate UI, not real business acceptance; counts are fixtures. See [asset provenance](docs/screenshots/README.md).<!-- /generated:media -->
|
|
116
118
|
|
|
117
119
|
## Installation
|
|
118
120
|
|
|
@@ -152,6 +154,7 @@ The detailed [Chinese user guide](docs/USER-GUIDE.md) covers category browsing,
|
|
|
152
154
|
- [Per-session tool activation, TTL, and Host safety boundary](docs/SESSION-TOOL-INJECTION.md)
|
|
153
155
|
- [Tool trial: official API evidence and safety design](docs/TOOL-TRIAL-DESIGN.md)
|
|
154
156
|
- [Plugin updates: version discovery, providers, and rollback](docs/PLUGIN-UPDATE.md)
|
|
157
|
+
- [Localization: `locale`, dictionary conventions, and the translation completeness gate](docs/I18N.md)
|
|
155
158
|
- [Marketplace registration: local cards, the public Registry, and OAuth requirements](docs/MARKET-REGISTRATION.md)
|
|
156
159
|
- [Third-party connector onboarding](https://github.com/duhu2000/dsh-mcp-connector-registry/blob/main/docs/ONBOARDING.md)
|
|
157
160
|
- [First contribution: from a good first issue to your first PR](docs/FIRST-CONTRIBUTION.md)
|
|
@@ -180,6 +183,7 @@ The default bundle configuration is in `cordis.patch.yml`:
|
|
|
180
183
|
openBrowser: true
|
|
181
184
|
showSidebarEntry: true
|
|
182
185
|
compactManagementTools: false
|
|
186
|
+
locale: 'auto'
|
|
183
187
|
frameAncestors: ['self']
|
|
184
188
|
```
|
|
185
189
|
|
|
@@ -200,6 +204,10 @@ Use the connector UI for connection setup, authorization, import, editing, snaps
|
|
|
200
204
|
|
|
201
205
|
This setting does not hide downstream business tools, disable connections, migrate credentials, change workspace/governance rules or bypass Host approval. Use the existing session injection mode for downstream tool visibility. Reduced tool count/schema size is not a measured token or cost saving.
|
|
202
206
|
|
|
207
|
+
`locale` selects the language of the panel and of the text returned by the conversation tools. It defaults to `'auto'`, which follows the language you picked in DSH under Settings → Language (the `preference` of `@deepseek-ai/dsh-client-locale`), then `LC_ALL` / `LC_MESSAGES` / `LANG`, and falls back to Chinese when nothing matches. The interface language is the user's own preference, so the plugin does not override it: a Chinese user who changes nothing still gets Chinese (the DSH default), and a user who selected English in DSH gets English. Set it to `'zh-CN'` or `'en'` to force one language. Reload the plugin after changing it.
|
|
208
|
+
|
|
209
|
+
Connector names, vendors, categories, URLs and error codes are never translated, so the same catalog renders in both languages. See [docs/I18N.md](docs/I18N.md).
|
|
210
|
+
|
|
203
211
|
`frameAncestors` defaults to `['self']`: the CSP of the panel page (`/mcp-connector/ui/`) only allows same-origin embedding, which is the existing behaviour and is not relaxed by default. When a desktop shell (Tauri/Electron) embeds the panel, the ancestor origin differs from the panel origin, so the browser blocks it with `Framing '...' violates the following Content Security Policy directive: "frame-ancestors 'self'"` and the panel renders blank. Deployers must opt in explicitly:
|
|
204
212
|
|
|
205
213
|
```yaml
|
|
@@ -237,7 +245,7 @@ npm run dev:ui
|
|
|
237
245
|
|
|
238
246
|
Every Registry merge regenerates `catalog-stats.json`; an hourly workflow in this repository synchronizes the Chinese and English product copy plus a local stats snapshot. The static npm README updates with package releases, while the live badges above read the Registry directly and therefore stay current without another npm release.
|
|
239
247
|
|
|
240
|
-
<!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.
|
|
248
|
+
<!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.88`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.88](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.88).<!-- /generated:version -->
|
|
241
249
|
|
|
242
250
|
See [CHANGELOG.md](CHANGELOG.md) for version history and [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md) for the Desktop release checklist.
|
|
243
251
|
|
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ OAuth 是否可用取决于服务商的客户端注册、账号权限与授权
|
|
|
10
10
|
|
|
11
11
|
[English](README.en.md)
|
|
12
12
|
|
|
13
|
+
**中英文界面:** 面板右上角可选择「简体中文 / English」。插件 Host 默认跟随 DSH 显式语言偏好,缺失时保持中文;可配置 `locale: zh-CN` 或 `locale: en`。面板切换不重启 DSH,未保存编辑需先确认;详情见 [语言设置](docs/I18N.md)。
|
|
14
|
+
|
|
13
15
|
### 首页推荐
|
|
14
16
|
|
|
15
17
|
首页“推荐”默认展开十张卡片:企查查·企业工商、腾讯文档、飞书开放平台、Notion、GitHub、Playwright、Wind·股票数据、企查查·法律数据、高德地图、Context7。按固定顺序展示,不因连接状态重排;这是场景推荐,不是使用量排行。接入时仍需满足各服务的授权和配置条件。
|
|
@@ -114,7 +116,7 @@ Desktop 需要完全退出并重新启动应用;Web 需要停止原 `dsh web`
|
|
|
114
116
|
| 连接诊断与最后成功缓存 | |
|
|
115
117
|
|  | |
|
|
116
118
|
|
|
117
|
-
<!-- generated:media -->截图与 GIF 采集自 v0.2.
|
|
119
|
+
<!-- generated:media -->截图与 GIF 采集自 v0.2.88(2026-10-31)无凭据 Mock 页面,展示界面而非真实业务验收;市场数量是测试夹具。来源与更新方法见 [素材说明](docs/screenshots/README.md)。<!-- /generated:media -->
|
|
118
120
|
|
|
119
121
|
## 安装
|
|
120
122
|
|
|
@@ -155,6 +157,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/duhu2000/dsh-mcp-connector/m
|
|
|
155
157
|
- [按会话启用工具:显式激活、TTL 与 Host 安全边界](docs/SESSION-TOOL-INJECTION.md)
|
|
156
158
|
- [工具试运行:官方 API 证据与安全设计](docs/TOOL-TRIAL-DESIGN.md)
|
|
157
159
|
- [插件更新:版本检测、Provider 与回滚](docs/PLUGIN-UPDATE.md)
|
|
160
|
+
- [国际化:`locale` 配置、词典约定与翻译完备性门禁](docs/I18N.md)
|
|
158
161
|
- [市场注册:本地卡片、公共 Registry 与 OAuth 要求](docs/MARKET-REGISTRATION.md)
|
|
159
162
|
- [第三方连接器上架指南](https://github.com/duhu2000/dsh-mcp-connector-registry/blob/main/docs/ONBOARDING.md)
|
|
160
163
|
- [首次贡献:从 good first issue 到第一个 PR](docs/FIRST-CONTRIBUTION.md)
|
|
@@ -176,6 +179,7 @@ Bundle 默认配置位于 `cordis.patch.yml`:
|
|
|
176
179
|
openBrowser: true
|
|
177
180
|
showSidebarEntry: true
|
|
178
181
|
compactManagementTools: false
|
|
182
|
+
locale: 'auto'
|
|
179
183
|
frameAncestors: ['self']
|
|
180
184
|
```
|
|
181
185
|
|
|
@@ -195,6 +199,10 @@ Bundle 默认配置位于 `cordis.patch.yml`:
|
|
|
195
199
|
- 例如发现入口可用 `{"action":"search","query":"天气","limit":5}`;查询连接状态可用 `{"action":"status"}`。详情使用 `action=detail` 和必填 `toolName`,市场搜索使用 `action=catalog` 与可选 `keyword`。
|
|
196
200
|
- 设回 `false` 并重载插件可恢复旧管理工具名;不要同时运行两份插件。工具数量和 schema 大小的减少不等于实测 token 或费用节省。
|
|
197
201
|
|
|
202
|
+
`locale` 选择面板与对话工具返回文案的语言,默认为 `'auto'`:跟随用户在 DSH「设置 → Language」里的选择(即 `@deepseek-ai/dsh-client-locale` 的 `preference`),读不到时再按 `LC_ALL` / `LC_MESSAGES` / `LANG`,仍无法识别时回退中文。界面语言属于用户偏好,插件不覆盖它:中文用户不做任何设置仍是中文(中文是 DSH 默认语言),在 DSH 里选了 English 的用户会直接得到英文。也可写成 `'zh-CN'` / `'en'` 强制指定。修改后需重载插件。
|
|
203
|
+
|
|
204
|
+
连接器名称、厂商、分类、URL 与错误码不参与翻译,两种语言使用同一份目录。详见 [docs/I18N.md](docs/I18N.md)。
|
|
205
|
+
|
|
198
206
|
`frameAncestors` 默认为 `['self']`,即面板页面(`/mcp-connector/ui/`)的 CSP 只允许同源页面内嵌,是既有行为,不做任何放宽。在桌面壳(Tauri/Electron)里把面板嵌进壳窗口时,祖先源与面板自身不同源,浏览器会以 `Framing '...' violates the following Content Security Policy directive: "frame-ancestors 'self'"` 拦截并导致面板白屏;此时需要由部署方/用户显式追加外壳源:
|
|
199
207
|
|
|
200
208
|
```yaml
|
|
@@ -232,7 +240,7 @@ npm run dev:ui
|
|
|
232
240
|
|
|
233
241
|
公共 Registry 每次合并后会生成 `catalog-stats.json`;本仓库的定时工作流每小时同步中英文介绍和统计快照。npm 页面中的静态正文随版本发布更新,上方动态统计徽标则直接读取 Registry,可在不发布新 npm 版本时保持实时数量一致。
|
|
234
242
|
|
|
235
|
-
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.
|
|
243
|
+
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.88`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.88](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.88)。<!-- /generated:version -->
|
|
236
244
|
|
|
237
245
|
版本能力与变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
238
246
|
Desktop 发版回归见 [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md)。
|
package/docs/I18N.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# 中英文界面与 i18n 约定
|
|
2
|
+
|
|
3
|
+
本文件是本次 i18n 改造的**唯一契约**。多个模块并行改造时,一律遵循此处约定,
|
|
4
|
+
避免同一个仓库出现两套翻译机制。
|
|
5
|
+
|
|
6
|
+
## 1. 目标
|
|
7
|
+
|
|
8
|
+
- 界面语言**跟随用户在 DSH 里的选择**(设置 → Language),插件不覆盖用户偏好。
|
|
9
|
+
- 保持中文界面**零回归**:中文仍是 DSH 默认语言,既有中文文案逐字不变。
|
|
10
|
+
- 用户在 DSH 选英文、或配置 `locale: 'en'` 时,Host 启动后使用英文提示与管理工具描述。
|
|
11
|
+
- 面板右上角提供「简体中文 / English」切换,仅重载当前面板,不修改 Host 配置或重启 DSH;有未保存编辑时先确认。重新打开入口时仍按宿主偏好加载。面板语言与 Host 文案可独立;需要统一时同时设置 DSH/插件语言并手工重启 Host。
|
|
12
|
+
- 服务商目录说明、品牌名称、用户内容、示例任务中的企业名及 v1 模板协议常量保留原文,不宣称第三方内容全部英文化。
|
|
13
|
+
- 缺译文**绝不**显示空白或 key:回退中文原文。
|
|
14
|
+
|
|
15
|
+
## 1.1 语言偏好从哪里读(**易错**)
|
|
16
|
+
|
|
17
|
+
语言偏好的真值在 **Host 的 profile 补丁**里:`@deepseek-ai/dsh-client-locale`
|
|
18
|
+
把用户的显式选择写成该条目的 `config.preference`(例如 `preference: en`)。
|
|
19
|
+
|
|
20
|
+
- `locale` 是**仅浏览器端**的服务,Host 侧没有(Host 的 98 个服务里不含 `locale`)。
|
|
21
|
+
因此**不能**用 `ctx.inject(['locale'])` 在 Host 等待它——永远等不到,会静默退回中文。
|
|
22
|
+
- 也**不能**写 `ctx.locale?.getLocale?.()`:Cordis 的上下文代理在访问未注入的属性时
|
|
23
|
+
直接抛 `cannot get property "locale" without inject`,可选链拦不住,插件装载失败。
|
|
24
|
+
- 正确做法:`readHostLocalePreference(ctx)` 从 `ctx.loader.entries()` 找到
|
|
25
|
+
`@deepseek-ai/dsh-client-locale` 条目并读 `options.config.preference`;
|
|
26
|
+
读不到时返回 `undefined`。插件启动传入空的环境变量映射,回退中文,不因英文 shell 环境改变现有用户体验。
|
|
27
|
+
|
|
28
|
+
`locale` 默认值为 `'auto'`,即走上述链路;`'zh-CN'` / `'en'` 为强制指定。
|
|
29
|
+
|
|
30
|
+
面板优先级:用户当前页 `uiLocale` 选择 → Host 注入语言 → 客户端 `locale` 参数 → HTML 默认中文。新增懒加载分享界面的词典位于 `ui/locale.js`,只翻译显示与提示,不改写用户输入或序列化模板常量。
|
|
31
|
+
|
|
32
|
+
验收:`npm run check` 为代码门禁;`node scripts/check-i18n-ui.mjs` 为独立 Chromium + Mock API UI 验收,需配置 Playwright。Windows CI 和真实 Windows Desktop 仍是不同证据,不可互相替代。
|
|
33
|
+
|
|
34
|
+
## 2. 核心模块
|
|
35
|
+
|
|
36
|
+
`lib/i18n/index.js` 提供纯函数:
|
|
37
|
+
|
|
38
|
+
| 导出 | 用途 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `DEFAULT_LOCALE` | `'zh-CN'` |
|
|
41
|
+
| `SUPPORTED_LOCALES` | `['zh-CN', 'en']` |
|
|
42
|
+
| `normalizeLocale(value)` | `zh`/`zh_CN`/`en-US` → `'zh-CN'`/`'en'`;其它返回 `undefined` |
|
|
43
|
+
| `resolveLocale(value, { hostLocale, env })` | 解析配置值:`'auto'` 时看 Host/环境变量,否则明确选择 |
|
|
44
|
+
| `interpolate(template, params)` | `{name}` 占位符插值 |
|
|
45
|
+
| `createTranslator(locale, dictionaries)` | 返回 `t(msgid, params)`,附带 `.locale` / `.missing()` |
|
|
46
|
+
|
|
47
|
+
`lib/i18n/locales/en.js` 合并 `lib/i18n/locales/en/*.js` 分片;同一 msgid 译文冲突会抛错。
|
|
48
|
+
|
|
49
|
+
## 3. 文案书写规则(**必须**)
|
|
50
|
+
|
|
51
|
+
1. **msgid 就是中文原文**,逐字复制既有中文,不要改写、不要精简、不要改标点。
|
|
52
|
+
```js
|
|
53
|
+
// 改造前
|
|
54
|
+
return { ok: false, message: '连接不存在,请刷新后重试' };
|
|
55
|
+
// 改造后
|
|
56
|
+
return { ok: false, message: t('连接不存在,请刷新后重试') };
|
|
57
|
+
```
|
|
58
|
+
2. **带变量的句子整体作为一个 msgid**,变量在模板里保留,值通过参数传:
|
|
59
|
+
```js
|
|
60
|
+
t('已启用 "{name}"', { name: committed.name })
|
|
61
|
+
// ❌ 不要拼接:t('已启用') + ' "' + name + '"'
|
|
62
|
+
```
|
|
63
|
+
3. **不要翻译**:连接器名称/厂商/分类/标签(来自 catalog 与远程 registry)、
|
|
64
|
+
工具原始名、`serverName`、URL、错误码、字段名、JSON 示例、命令行。
|
|
65
|
+
4. **不要动**代码注释、日志文案(`logger.*`)、内部断言。日志是给维护者看的,保持中文。
|
|
66
|
+
5. **不要动** `throw new Error()` 里的**内部**错误;但**面向用户**的 `message` 字段必须翻译。
|
|
67
|
+
判断标准:该字符串会出现在 `{ ok, message }` 返回、界面、或工具描述/参数描述里 → 要翻译;
|
|
68
|
+
只在插件内部被 catch 且不会展示 → 不翻译。
|
|
69
|
+
6. 变量插值后仍是中文语序的句子,英文译文自行调整语序:
|
|
70
|
+
`t('共 {count} 条', { count })` → `"{count} total"`。
|
|
71
|
+
|
|
72
|
+
## 4. 函数签名改造
|
|
73
|
+
|
|
74
|
+
需要翻译的模块,把 `t` 作为参数传入,**不要**读全局变量,也不要自己读环境变量:
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
// 改造前
|
|
78
|
+
export function registerTools(ctx, api, { compact = false } = {}) { ... }
|
|
79
|
+
// 改造后
|
|
80
|
+
export function registerTools(ctx, api, { compact = false, t = createTranslator(DEFAULT_LOCALE) } = {}) { ... }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
默认值是中文 translator,因此**既有调用点与既有测试不改也能继续工作**。
|
|
84
|
+
|
|
85
|
+
## 5. 词典分片(各自只改自己那一个文件)
|
|
86
|
+
|
|
87
|
+
| 分片文件 | 负责的源文件 |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `lib/i18n/locales/en/host.js` | `lib/index.js` |
|
|
90
|
+
| `lib/i18n/locales/en/tools.js` | `lib/tools.js` |
|
|
91
|
+
| `lib/i18n/locales/en/diagnostics.js` | `lib/diagnostics.js`、`lib/connection-scopes.js`、`lib/governance.js` |
|
|
92
|
+
| `lib/i18n/locales/en/validation.js` | `lib/mcp-validation.js`、`lib/schema.js`、`lib/catalog.js`、`lib/connection-editor.js`、`lib/oauth.js`、`lib/connectors/*.js`、`lib/prompts.js` |
|
|
93
|
+
| `lib/i18n/locales/en/web.js` | `lib/web.js` |
|
|
94
|
+
| `lib/i18n/locales/en/client.js` | `lib/client.js` |
|
|
95
|
+
|
|
96
|
+
分片格式:
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
export default {
|
|
100
|
+
'中文原文': 'English text',
|
|
101
|
+
'已启用 "{name}"': 'Enabled "{name}"',
|
|
102
|
+
};
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 6. 英文质量要求
|
|
106
|
+
|
|
107
|
+
- 面向最终用户,用**简洁、专业**的英文;技术名词保留标准写法(OAuth、PKCE、Server、
|
|
108
|
+
Workspace、Token、API Key、MCP)。
|
|
109
|
+
- 同一概念用词统一:`连接`→ connection,`连接器`→ connector,`凭据`→ credential,
|
|
110
|
+
`授权`→ authorization,`重新授权`→ reauthorize,`作用域`→ scope,`快照`→ snapshot,
|
|
111
|
+
`工具`→ tool,`目录`→ catalog,`已安装`→ Installed,`托管`→ managed by the Host。
|
|
112
|
+
- 句首大写,句末按英文习惯加句点(短按钮文案不加)。
|
|
113
|
+
- **不要**逐字硬译;中文的四字并列结构在英文里改成自然表达。
|
|
114
|
+
- 占位符 `{name}` 必须原样保留,不得改名或丢字。
|
|
115
|
+
|
|
116
|
+
## 7. 测试
|
|
117
|
+
|
|
118
|
+
- 中文测试**断言既有中文**,不要为了英文改断言。
|
|
119
|
+
- 新增英文覆盖,断言 `t.locale === 'en'` 且关键文案是英文。
|
|
120
|
+
- 改 `ui/index.html` 的测试用 `new Function` 截取代码片段运行,改造后片段里可能出现
|
|
121
|
+
`t(...)`,测试需要向 `new Function` 传入 `t`(可传 `(s) => s` 或词典 translator)。
|
|
122
|
+
|
|
123
|
+
## 8. 禁止事项
|
|
124
|
+
|
|
125
|
+
- 禁止引入第三方 i18n 依赖(仓库无运行时依赖扩张)。
|
|
126
|
+
- 禁止改 `package.json` 版本号。
|
|
127
|
+
- 禁止改 `catalog/catalog.json` 里的连接器数据。
|
|
128
|
+
- 禁止修改 `test/catalog-proxy.test.mjs`(该文件在本机 Node 26 上因 undici
|
|
129
|
+
global-dispatcher 行为失败,与本次改动无关,属既有环境问题)。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 产品截图与演示的来源及更新
|
|
2
2
|
|
|
3
|
-
<!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.
|
|
3
|
+
<!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.88 于 2026-10-31 重新采集,未修改截图中的版本文字。<!-- /generated:media -->
|
|
4
4
|
|
|
5
5
|
前七张素材由真实产品 UI 的无凭据 Mock harness 渲染:1280×720 浏览器视口、800px 产品面板、桌面两列卡片。顶部保留“无凭据 Mock”标识;目录数、连接数与工具数是演示夹具,不代表生产统计或真实授权、业务验收。不会读取用户 profile、调用服务商或上传业务数据。
|
|
6
6
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"capture": {
|
|
4
4
|
"capturedOn": "2026-10-31",
|
|
5
|
-
"sourceVersion": "0.2.
|
|
6
|
-
"sourceFingerprint": "
|
|
5
|
+
"sourceVersion": "0.2.88",
|
|
6
|
+
"sourceFingerprint": "d9c17612fd5c0e798980d5be9a5710da47ee165174140351a1a3bd5039b19ce5",
|
|
7
7
|
"browserViewport": {
|
|
8
8
|
"width": 1280,
|
|
9
9
|
"height": 720
|
|
@@ -16,63 +16,63 @@
|
|
|
16
16
|
"screenshots": [
|
|
17
17
|
{
|
|
18
18
|
"path": "docs/screenshots/01-market-overview.jpg",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "1cd0ac714db7c10bedb810e60008eef96ab3756acf771e4676022ad656190f11",
|
|
20
20
|
"width": 1280,
|
|
21
21
|
"height": 720,
|
|
22
22
|
"capturedOn": "2026-10-31",
|
|
23
|
-
"sourceVersion": "0.2.
|
|
23
|
+
"sourceVersion": "0.2.88"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "docs/screenshots/02-connector-detail.jpg",
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "a29d8750d735868f64d17d71e382c33fe17763489809d9059530901291311a78",
|
|
28
28
|
"width": 1280,
|
|
29
29
|
"height": 720,
|
|
30
30
|
"capturedOn": "2026-10-31",
|
|
31
|
-
"sourceVersion": "0.2.
|
|
31
|
+
"sourceVersion": "0.2.88"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"path": "docs/screenshots/03-tool-discovery.jpg",
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "b8734f54f63385cf7c5f676e37ae01d7244a6587a299c0f7507a2b1eadabe018",
|
|
36
36
|
"width": 1280,
|
|
37
37
|
"height": 720,
|
|
38
38
|
"capturedOn": "2026-10-31",
|
|
39
|
-
"sourceVersion": "0.2.
|
|
39
|
+
"sourceVersion": "0.2.88"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "docs/screenshots/04-json-import.jpg",
|
|
43
|
-
"sha256": "
|
|
43
|
+
"sha256": "2a6e0fcc7bd6287e0f35cf0af7e7c23a7aa2efff70e37df3d6a597af97c6cdc9",
|
|
44
44
|
"width": 1280,
|
|
45
45
|
"height": 720,
|
|
46
46
|
"capturedOn": "2026-10-31",
|
|
47
|
-
"sourceVersion": "0.2.
|
|
47
|
+
"sourceVersion": "0.2.88"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"path": "docs/screenshots/05-unified-tool-search.png",
|
|
51
|
-
"sha256": "
|
|
51
|
+
"sha256": "98653faf42377bd20d2523e2b817ebad3eb87a8d9de1986b60e5df55971321ab",
|
|
52
52
|
"width": 1280,
|
|
53
53
|
"height": 720,
|
|
54
54
|
"capturedOn": "2026-10-31",
|
|
55
|
-
"sourceVersion": "0.2.
|
|
55
|
+
"sourceVersion": "0.2.88"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"path": "docs/screenshots/06-tool-parameters.png",
|
|
59
|
-
"sha256": "
|
|
59
|
+
"sha256": "11bb886c9ea9b66fb271f706cd726c096f0dc4ac8e87109b95c7b63f32dc2399",
|
|
60
60
|
"width": 1280,
|
|
61
61
|
"height": 720,
|
|
62
62
|
"capturedOn": "2026-10-31",
|
|
63
|
-
"sourceVersion": "0.2.
|
|
63
|
+
"sourceVersion": "0.2.88"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"path": "docs/screenshots/07-connection-diagnostics.png",
|
|
67
|
-
"sha256": "
|
|
67
|
+
"sha256": "94c4c207c27be599d4f403e9197b05b557540933224d2a0a005a1c317bf0366f",
|
|
68
68
|
"width": 1280,
|
|
69
69
|
"height": 720,
|
|
70
70
|
"capturedOn": "2026-10-31",
|
|
71
|
-
"sourceVersion": "0.2.
|
|
71
|
+
"sourceVersion": "0.2.88"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"path": "docs/screenshots/08-ten-recommendations.jpg",
|
|
75
|
-
"sha256": "
|
|
75
|
+
"sha256": "fc44952084773e53ac198f01f3d4d817f23e4debd541720031bfb9826620f01a",
|
|
76
76
|
"width": 1280,
|
|
77
77
|
"height": 1400,
|
|
78
78
|
"browserViewport": {
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
},
|
|
82
82
|
"panelHeight": 1280,
|
|
83
83
|
"capturedOn": "2026-10-31",
|
|
84
|
-
"sourceVersion": "0.2.
|
|
84
|
+
"sourceVersion": "0.2.88"
|
|
85
85
|
}
|
|
86
86
|
],
|
|
87
87
|
"demo": {
|
|
88
88
|
"path": "docs/demo.gif",
|
|
89
|
-
"sha256": "
|
|
89
|
+
"sha256": "6bed2ab6ae7ddce66a003b43116dac2dc7ed183a82bbe8ae03051710f23ed3a5",
|
|
90
90
|
"width": 960,
|
|
91
91
|
"height": 540,
|
|
92
92
|
"capturedOn": "2026-10-31",
|
|
93
|
-
"sourceVersion": "0.2.
|
|
93
|
+
"sourceVersion": "0.2.88",
|
|
94
94
|
"durationSeconds": 36
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| 项目 | 验收要求 |
|
|
10
10
|
|---|---|
|
|
11
|
-
| 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.
|
|
11
|
+
| 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.88`<!-- /generated:version -->;当前 Workspace;企查查 OAuth 可用;测试账号具有目标企业数据权限 |
|
|
12
12
|
| 权限/管理员 | 账号权限、组织授权和可见字段由服务商控制;企业组织可能需要管理员开通,当前文档不能替代审批 |
|
|
13
13
|
| 费用 | 可能受套餐、次数或字段权限影响;MCP连接器无法确认本次费用,调用前在服务商侧核对 |
|
|
14
14
|
| 运行/数据去向 | 远程 MCP Server;企业名称、查询参数和调用结果经 DSH Host 发送到/返回自 `agent.qcc.com` |
|
package/lib/callback-server.js
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* 约束:先启动监听再打开授权页;收到回调后先校验 state;code 只使用一次。
|
|
5
5
|
*/
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
|
+
import { DEFAULT_LOCALE, createTranslator } from './i18n/index.js';
|
|
8
|
+
|
|
9
|
+
/** 缺省译文:中文(既有调用点与测试无需改动)。 */
|
|
10
|
+
const tZh = createTranslator(DEFAULT_LOCALE);
|
|
7
11
|
|
|
8
12
|
export class CallbackTimeoutError extends Error {
|
|
9
13
|
constructor(message) {
|
|
@@ -12,11 +16,22 @@ export class CallbackTimeoutError extends Error {
|
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
|
|
19
|
+
/** 转义插值到 HTML 的文案,避免译文里的 `<`/`&` 破坏页面结构。 */
|
|
20
|
+
function escapeHtml(text) {
|
|
21
|
+
// 用 replaceAll + 字符串而不是含引号的正则字面量:等价,且避免词法扫描器
|
|
22
|
+
// 把 `/"/` 里的引号当成字符串起点(见 scripts/i18n-scan.mjs 的已知限制)。
|
|
23
|
+
return String(text)
|
|
24
|
+
.replaceAll('&', '&')
|
|
25
|
+
.replaceAll('<', '<')
|
|
26
|
+
.replaceAll('>', '>')
|
|
27
|
+
.replaceAll('"', '"');
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
/**
|
|
16
31
|
* 启动 loopback 回调监听。
|
|
17
32
|
* @returns {Promise<{port:number, url:string, waitForCallback:()=>Promise<{code:string,state:string}>, close:()=>Promise<void>}>}
|
|
18
33
|
*/
|
|
19
|
-
export async function startCallbackServer({ path = '/callback', port = 0, host = '127.0.0.1', timeoutMs = 300_000, signal } = {}) {
|
|
34
|
+
export async function startCallbackServer({ path = '/callback', port = 0, host = '127.0.0.1', timeoutMs = 300_000, signal, t = tZh } = {}) {
|
|
20
35
|
if (!path.startsWith('/')) path = `/${path}`;
|
|
21
36
|
|
|
22
37
|
let resolveCallback;
|
|
@@ -43,12 +58,19 @@ export async function startCallbackServer({ path = '/callback', port = 0, host =
|
|
|
43
58
|
const code = requestUrl.searchParams.get('code');
|
|
44
59
|
const state = requestUrl.searchParams.get('state');
|
|
45
60
|
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
|
|
61
|
+
// 页面文案随界面语言;HTML 结构、doctype 与 charset 保持不变。
|
|
62
|
+
// 文案先取出再插值,避免把中文留在拼接的 HTML 字面量里。
|
|
63
|
+
const successHtml = [
|
|
64
|
+
'<!doctype html><html><head><meta charset="utf-8"><title>',
|
|
65
|
+
escapeHtml(t('MCP 连接器授权')),
|
|
66
|
+
'</title></head><body style="font-family:system-ui;text-align:center;padding-top:80px">',
|
|
67
|
+
'<h2>\u2705 ',
|
|
68
|
+
escapeHtml(t('授权成功')),
|
|
69
|
+
'</h2><p>',
|
|
70
|
+
escapeHtml(t('外部 MCP 已连接,可以关闭此页面并返回 DeepSeek Harness。')),
|
|
71
|
+
'</p></body></html>',
|
|
72
|
+
].join('');
|
|
73
|
+
res.end(successHtml);
|
|
52
74
|
if (code !== null && state !== null) {
|
|
53
75
|
resolveCallback({ code, state });
|
|
54
76
|
} else {
|