dsh-mcp-connector 0.2.100 → 0.2.102

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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.en.md +4 -4
  3. package/README.md +5 -5
  4. package/docs/DESKTOP-E2E.md +2 -2
  5. package/docs/USER-GUIDE.md +9 -2
  6. package/docs/screenshots/01-market-overview.jpg +0 -0
  7. package/docs/screenshots/02-connector-detail.jpg +0 -0
  8. package/docs/screenshots/03-tool-discovery.jpg +0 -0
  9. package/docs/screenshots/04-json-import.jpg +0 -0
  10. package/docs/screenshots/05-unified-tool-search.png +0 -0
  11. package/docs/screenshots/06-tool-parameters.png +0 -0
  12. package/docs/screenshots/07-connection-diagnostics.png +0 -0
  13. package/docs/screenshots/08-ten-recommendations.jpg +0 -0
  14. package/docs/screenshots/README.md +1 -1
  15. package/docs/screenshots/assets.json +30 -30
  16. package/docs/screenshots/en/01-market-overview.jpg +0 -0
  17. package/docs/screenshots/en/02-connector-detail.jpg +0 -0
  18. package/docs/screenshots/en/03-tool-discovery.jpg +0 -0
  19. package/docs/screenshots/en/04-json-import.jpg +0 -0
  20. package/docs/screenshots/en/05-unified-tool-search.png +0 -0
  21. package/docs/screenshots/en/06-tool-parameters.png +0 -0
  22. package/docs/screenshots/en/07-connection-diagnostics.png +0 -0
  23. package/docs/screenshots/en/08-ten-recommendations.jpg +0 -0
  24. package/docs/screenshots/en/assets.json +30 -30
  25. package/docs/screenshots/en/demo.gif +0 -0
  26. package/docs/tutorials/FIRST-SUCCESS-SCENARIOS.md +1 -1
  27. package/lib/client.js +76 -31
  28. package/lib/diagnostics.js +5 -3
  29. package/lib/i18n/locales/en/client.js +3 -0
  30. package/lib/i18n/locales/en/diagnostics.js +1 -1
  31. package/lib/i18n/locales/en/host.js +8 -2
  32. package/lib/index.js +301 -132
  33. package/lib/legacy-plugin-conflict.js +99 -0
  34. package/lib/migration.js +11 -6
  35. package/lib/schema.js +5 -0
  36. package/package.json +1 -1
  37. package/scripts/ui-harness.mjs +32 -0
  38. package/ui/index.html +119 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.102
4
+
5
+ - 修复新版 DSH 中「试试这样用」发送失败的问题,按当前工作区准备会话草稿并跳转(#231,#232)。
6
+ - 复用可用的空白会话;已有文字或附件时另建会话,保留原草稿内容。用户核对后自行提交查询。
7
+ - 发送失败或取消时保留详情页并恢复操作,保留旧版 DSH 兼容路径。
8
+ - Fix sample prompt draft handoff on modern DSH, preserve existing text and attachments, and retain legacy host compatibility (#231, #232).
9
+
10
+ ## 0.2.101
11
+
12
+ - 企查查旧授权迁移后看到红色“连接异常”时,点击市场卡片上的状态,或在 MCP连接器“已安装”中点“查看处理步骤”。已完成迁移的连接也能重新打开指引。
13
+ - 在 **DSH → 插件 → 已安装** 中,按指引停用仍启用的旧插件。工商安装包为 `qcc-dsh-mcp-oauth`(条目 ID `qcc-mcp-oauth`),法律安装包为 `qcc-dsh-mcp-legal-oauth`(条目 ID `qcc-legal-mcp-oauth`)。请使用插件开关。旧插件的“断开授权”会尝试撤销凭据。
14
+ - 若指引列出仍在运行的旧服务,按完整条目 ID 和服务名核对、停用,再完整退出并重启 DSH。回到 **MCP连接器 → 已安装** 检查结果。显示“需重新授权”时,打开对应卡片授权。使用仅内存模式时,重启后再次扫描并复制旧授权。
15
+ - Qichacha migration now identifies active legacy plugins and leftover service entries. Open the red status on the marketplace card or **View recovery steps** under **Installed**, including for connections migrated before this update. Use the DSH plugin switch to disable the named plugin and preserve its OAuth grant. If the guide lists leftover entries, match their full IDs and service names before disabling them. Fully quit and restart DSH, then check **MCP Connector → Installed**. [Customer migration guide](docs/USER-GUIDE.md#企查查旧插件迁移后显示连接异常)
16
+
3
17
  ## 0.2.100
4
18
 
5
19
  - Publish the npm download trend chart in the package README, sharing the maintained chart with GitHub and the connector registry.
package/README.en.md CHANGED
@@ -101,7 +101,7 @@ If the plugin helps you connect an MCP server faster, consider [starring the rep
101
101
  - Built-in, remote, and local catalogs with `published` and `featured` controls.
102
102
  - A standalone remote Registry, allowing new marketplace cards to appear after refresh without publishing a new npm version.
103
103
  - Plugin version and one-click updates: version discovery is independent of the installation source, while an Update Provider adapter layer negotiates safe mutation capabilities. DSH Market API v1 is the first adapter and supports progress, normalized failures, rollback, and capability-gated restart/refresh actions. Without a compatible provider the UI offers update instructions; if Desktop has no plugin-market section, it opens the npm package page instead of leaving the user on generic Settings.
104
- - Explicit, non-destructive migration from the two earlier Qichacha OAuth plugins, plus active-plugin conflict detection that blocks duplicate server management and credential overwrites.
104
+ - The two legacy Qichacha OAuth plugins support explicit authorization migration. For an affected connection, select **Connection error** in the marketplace or **View recovery steps** under Installed to see which DSH plugin or remaining service entry to disable. After a full DSH restart, MCP Connector takes over the authorization, or prompts for authorization again if it has expired.
105
105
 
106
106
  <!-- catalog-stats:start -->
107
107
  As of 2026-10-24, the public Registry publishes 112 connector descriptors. After merging and deduplicating them with the 4 bundled Qichacha cards, the Marketplace exposes 116 cards across 9 business categories. Recommendations remain limited to the four Qichacha cards, PKULaw, and Wind, for 6 featured cards in total. The Registry evolves independently; the badge shown after a client refresh and the live badges above are the authoritative current counts.
@@ -119,7 +119,7 @@ As of 2026-10-24, the public Registry publishes 112 connector descriptors. After
119
119
  | Connection diagnostics and last-success cache | |
120
120
  | ![Connection diagnostics](https://raw.githubusercontent.com/duhu2000/dsh-mcp-connector/main/docs/screenshots/en/07-connection-diagnostics.png) | |
121
121
 
122
- <!-- generated:media -->English UI screenshots and GIF were captured from v0.2.100 (2026-11-10), using the credential-free Mock harness. Provider content retains its original language. They demonstrate UI, not real business acceptance; counts are fixtures. See [asset provenance](docs/screenshots/README.md).<!-- /generated:media -->
122
+ <!-- generated:media -->English UI screenshots and GIF were captured from v0.2.102 (2026-11-12), using the credential-free Mock harness. Provider content retains its original language. They demonstrate UI, not real business acceptance; counts are fixtures. See [asset provenance](docs/screenshots/README.md).<!-- /generated:media -->
123
123
 
124
124
  ## Installation
125
125
 
@@ -141,7 +141,7 @@ Run the same command again to upgrade. Fully quit and restart DeepSeek Harness D
141
141
 
142
142
  1. Select **MCP Connector** in the primary sidebar, or choose **Open MCP Connector** from **Settings → Plugins → Plugin Configuration → MCP Connector**.
143
143
  2. Choose a connector, confirm **Current project** or **All projects (global)**, and complete authorization or configuration.
144
- 3. Open its details to inspect tools or send an example prompt to a new conversation draft.
144
+ 3. Open its details to inspect tools or send an example prompt to a conversation draft in the current workspace. Only an empty draft is reused; existing text or attachments are preserved and the example goes into a separate conversation. Review the draft before submitting it yourself.
145
145
  4. Use Installed or the conversation tools to enable, disable, inspect, or disconnect a connection.
146
146
  5. After connecting, open **Tools** to search by tool name or description and filter by connection or service. Provider authorization, fees, and actual execution remain under the provider and DSH Host.
147
147
 
@@ -250,7 +250,7 @@ npm run dev:ui
250
250
 
251
251
  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.
252
252
 
253
- <!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.100`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.100](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.100).<!-- /generated:version -->
253
+ <!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.102`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.102](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.102).<!-- /generated:version -->
254
254
 
255
255
  See [CHANGELOG.md](CHANGELOG.md) for version history and [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md) for the Desktop release checklist.
256
256
 
package/README.md CHANGED
@@ -114,7 +114,7 @@ Desktop 需要完全退出并重新启动应用;Web 需要停止原 `dsh web`
114
114
  - 独立远程 Registry:新市场卡片合并后客户端刷新即可见,无需重新发布 npm;远程不可用时自动回退内置目录。
115
115
  - 插件版本与一键更新:版本发现独立于安装来源;页面通过 Update Provider 适配层探测安全更新能力。DSH Market API v1 是首个适配器,支持进度、稳定失败码、回滚及按宿主能力提供的重启/刷新操作;无可用 Provider 时回退到当前插件市场或 npm。
116
116
  - Registry 工具链:Schema/唯一性/密钥审计、MCP/OAuth 无凭据探针、每周健康巡检。
117
- - 平滑迁移:显式扫描并复制两个旧企查查 OAuth 插件授权;检测到旧插件仍启用并管理同名 Server 时阻断重复连接,避免凭据相互覆盖。
117
+ - 旧企查查 OAuth 插件迁移:扫描并复制工商、法律授权。已迁移的客户可以从市场的“连接异常”或已安装行查看冲突插件、残留条目和恢复步骤。
118
118
  - 对话工具:`mcp_connector_catalog`、`connect`、`configure`、`import_json`、`export_config`、`snapshot`、`install_from_url`、`status`、`scope`、`health_check`、`policy`、`set_enabled`、`session_tools`、`disconnect`、`refresh_catalog`、`publish`、`tools_list`、`tool_search`、`tool_detail`。搜索/详情只做渐进式能力发现,不执行目标 MCP 工具。
119
119
 
120
120
  <!-- catalog-stats:start -->
@@ -133,7 +133,7 @@ Desktop 需要完全退出并重新启动应用;Web 需要停止原 `dsh web`
133
133
  | 连接诊断与最后成功缓存 | |
134
134
  | ![连接诊断](https://raw.githubusercontent.com/duhu2000/dsh-mcp-connector/main/docs/screenshots/07-connection-diagnostics.png) | |
135
135
 
136
- <!-- generated:media -->截图与 GIF 采集自 v0.2.100(2026-11-10)无凭据 Mock 页面,展示界面而非真实业务验收;市场数量是测试夹具。来源与更新方法见 [素材说明](docs/screenshots/README.md)。<!-- /generated:media -->
136
+ <!-- generated:media -->截图与 GIF 采集自 v0.2.102(2026-11-12)无凭据 Mock 页面,展示界面而非真实业务验收;市场数量是测试夹具。来源与更新方法见 [素材说明](docs/screenshots/README.md)。<!-- /generated:media -->
137
137
 
138
138
  ## 安装
139
139
 
@@ -155,7 +155,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/duhu2000/dsh-mcp-connector/m
155
155
 
156
156
  1. 点击左侧“MCP连接器”,或从“设置 → 插件 → 插件配置 → MCP连接器”点击“打开 MCP连接器”。
157
157
  2. 在市场中选择连接器,确认“当前项目”或“所有项目(全局)”,再完成授权或配置。
158
- 3. 打开卡片详情,可点击示例 Prompt 的发送按钮,在当前工作区创建/复用空白会话并写入草稿。
158
+ 3. 打开卡片详情,可点击示例 Prompt 的发送按钮,在当前工作区创建/复用空白会话并写入草稿。已有文字或附件时会保留原草稿并另建会话;核对后再自行发送。
159
159
  4. 在“已安装”或对话工具中查看、停用、恢复或断开连接。
160
160
  5. 连接后打开“工具”页,按工具名或描述查找能力,使用连接/服务筛选定位来源;授权、费用及正式调用仍由相应服务与 DSH Host 管理。
161
161
 
@@ -257,7 +257,7 @@ npm run dev:ui
257
257
 
258
258
  公共 Registry 每次合并后会生成 `catalog-stats.json`;本仓库的定时工作流每小时同步中英文介绍和统计快照。npm 页面中的静态正文随版本发布更新,上方动态统计徽标则直接读取 Registry,可在不发布新 npm 版本时保持实时数量一致。
259
259
 
260
- <!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.100`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.100](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.100)。<!-- /generated:version -->
260
+ <!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.102`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.102](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.102)。<!-- /generated:version -->
261
261
 
262
262
  版本能力与变更记录见 [CHANGELOG.md](CHANGELOG.md)。
263
263
  Desktop 发版回归见 [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md)。
@@ -280,7 +280,7 @@ stdio 传输的架构、透传边界与安全约束见 [docs/STDIO-SUPPORT.md](d
280
280
  - OAuth 连接失败会标明资源发现、服务发现、客户端注册、授权回调或 Token 换取阶段;DCR HTTP 403 表示服务商拒绝未准入客户端,不是用户未点击授权。
281
281
  - 脱敏导出把 Token/API Key、静态 Header/env 值、stdio 参数、本地目录及带查询参数的 URL 替换为占位符;OAuth 只保留重新授权引用。快照中的完整配置仍只在当前 profile 的 storage domain 内。
282
282
  - 顶部入口通过 DSH 稳定 `data-slot` 定位并使用 React Portal;DSH 若移除该标记,入口会回退到底部,不影响连接器功能。
283
- - 旧授权迁移必须显式确认,只复制不删除;确认新连接可用后再手动停用旧插件。
283
+ - 企查查旧授权经确认后复制。遇到迁移冲突,按指引停用相应旧插件或残留服务条目并完整重启 DSH。授权失效时需要重新授权。[客户处理步骤](docs/USER-GUIDE.md#企查查旧插件迁移后显示连接异常)
284
284
  - project/global 作用域仅在当前 DSH profile 内生效;不会跨 profile 同步。删除 Workspace 后,原 project-only 绑定保持 fail closed,需手动移动到其他项目或全局。
285
285
  - 当前没有工具试运行;治理与作用域都由 DSH Host 正式工具执行链强制应用。试运行已完成官方 API 复核,但在 out-of-turn 审批编排和 MCP 副作用元数据缺口补齐前保持 design blocked。快照不能恢复服务端已撤销的 OAuth Grant。
286
286
 
@@ -17,9 +17,9 @@ npm run dev:ui
17
17
  4. 点击未连接卡片可查看详情;点击已连接卡片可读实时工具、搜索并每次再加载 50 条。
18
18
  5. “添加连接”依次验证手动、JSON、市场卡片;JSON 示例/粘贴可缩进格式化,错误 URL/JSON/凭据得到可行动提示。
19
19
  6. Bearer/API Key 型市场卡片先填错误凭据:弹框内应显示鉴权/网络分类错误,不得进入「已安装」;再填正确凭据,只有卡片下所有 Server 均通过 initialize 校验后才批量安装。
20
- 7. 参数化 Prompt 填写企业/人员/主题后,发送到当前工作区新会话草稿;重复点击和超时有提示。
20
+ 7. 参数化 Prompt 填写企业/人员/主题后,发送到当前工作区会话草稿;空白草稿可复用,已有文字或仅有附件时另建会话且原内容完整保留。切换工作区后应使用新选择;导航取消或失败不误报成功,重复点击被拦截、超时后可重试。带入草稿不自动提交消息或调用工具。
21
21
  8. OAuth:授权回调、重启恢复、停用/启用、断开撤销;二级弹框蒙层与关闭按钮清晰。
22
- 9. 旧插件迁移先预览,明确确认后复制;旧凭据仍保留,新连接验证后再手工停用旧插件。
22
+ 9. 企查查迁移应同时覆盖工商与法律。先复制授权并关闭弹框,再从市场的“连接异常”、已安装行和再次扫描进入指引。按命中的插件或残留条目处理,完整重启后确认工具在宿主中注册。[客户操作说明](USER-GUIDE.md#企查查旧插件迁移后显示连接异常)随包提供。真实旧包和隔离 profile 的详细验收记录在源码仓库的 `docs/acceptance/PLUGIN-CONFLICT-MIGRATION-2026-11-11.md`。
23
23
 
24
24
  ## 专项验收与人工确认边界
25
25
 
@@ -111,7 +111,7 @@ OAuth 一键连接要求服务商支持标准 OAuth 2.1/PKCE 和公开元数据
111
111
  1. 阅读服务说明、鉴权方式、数据范围与可能产生的费用或副作用。
112
112
  2. 在“试试这样用”中选择示例 Prompt;带变量的模板会先要求补齐查询主体等信息。
113
113
  3. 展开“工具详情”查看 Server 数量、工具名称与描述,并可搜索工具;点击“参数详情”可按需查看输入 schema;连接后还可按 Connection、Server、Tool 设置治理规则。
114
- 4. 点击“去试试”或 Prompt 的发送按钮,在当前工作区创建或复用空白会话并写入草稿。
114
+ 4. 点击“去试试”或 Prompt 的发送按钮,在当前工作区创建或复用空白会话并写入草稿。如果已有未发送文字或附件,会保留原草稿并另建会话。插件只带入草稿,核对后再自行发送。
115
115
 
116
116
  连接成功后,工具按 `mcp__<serverName>__*` 前缀提供给模型。工具清单来自服务端,实际数量会随服务商权限和版本变化。成功发现后,插件会在当前 profile 保存一份安全裁剪的工具元数据;实时发现失败时仍显示这份“最后成功缓存”,但保持连接失败/未知状态并标注缓存时间,超过 24 小时还会显示陈旧提示。详情与“已安装”列表会展示最近一次诊断的阶段、稳定错误码、说明、建议动作和最近成功时间。
117
117
 
@@ -200,7 +200,7 @@ stdio 进程由 `@deepseek-ai/dsh-mcp-client` 管理,插件透传 `command`、
200
200
  - 重新授权 OAuth,或重新录入 Token/API Key;
201
201
  - 执行健康检查;
202
202
  - 重新连接:重建 Host 侧条目并复检,用于“状态未知”或 Host 已放弃重连的连接;它不修改配置、凭据、范围或启停状态;
203
- - 检测企查查旧授权:扫描两个已退役的企查查 OAuth 插件(`qcc-dsh-mcp-oauth`、`qcc-dsh-mcp-legal-oauth`)遗留的本机授权,确认后可复制到 MCP连接器;不会删除旧插件或原凭据;
203
+ - **检测企查查旧授权**可扫描并复制旧工商、法律插件的本机授权。已经迁移后遇到红色**连接异常**,直接点击市场卡片,或在“已安装”的对应连接点**查看处理步骤**。
204
204
  - 断开连接并删除该连接的本机配置。
205
205
 
206
206
  OAuth 断开时,插件会尽力调用服务商的撤销端点;无撤销端点时仍会删除 DSH 本机授权记录。连接状态发生变化后,可点击“刷新连接器目录”重新检查。
@@ -211,6 +211,13 @@ OAuth 断开时,插件会尽力调用服务商的撤销端点;无撤销端
211
211
 
212
212
  启用中的连接点击“保存并重连”后会先验证新配置、创建快照,再原子更新 Host 与本机记录;任何校验、启动或持久化失败都会保留原连接。停用连接可以保存配置但仍保持停用。连接范围和启停状态均不会被 JSON 静默改变。市场/OAuth 连接继续使用卡片的“配置”或“重新授权”流程。
213
213
 
214
+ ### 企查查旧插件迁移后显示连接异常
215
+
216
+ 1. 点击异常卡片,查看这条连接实际命中的插件或旧服务条目。工商插件的安装包名为 `qcc-dsh-mcp-oauth`,条目 ID 为 `qcc-mcp-oauth`。法律插件的安装包名为 `qcc-dsh-mcp-legal-oauth`,条目 ID 为 `qcc-legal-mcp-oauth`。
217
+ 2. 如果提示插件仍启用,进入 **DSH 主界面 → 插件 → 已安装**,按安装包名找到提示的插件,关闭插件开关。旧版 DSH 可从**设置 → 插件市场**进入。请保留旧授权,旧插件的“断开授权”会尝试撤销凭据。
218
+ 3. 如果提示旧插件已经停用、仍有旧服务条目启用,请在宿主插件配置中按弹框列出的完整条目 ID 核对并停用对应旧条目。如果界面没有条目开关,请把列出的 ID 交给管理员处理。法律连接的新旧条目可能使用相同的短 ID,请一并核对服务名称。
219
+ 4. 完全退出 DSH 并重新启动;回到 **MCP连接器 → 已安装** 确认状态。若提示**需重新授权**,从对应卡片重新授权。若使用仅内存模式,重启后需在“检测企查查旧授权”中重新复制,或重新授权。
220
+
214
221
  ### 7.1 配置备份与恢复
215
222
 
216
223
  “已安装”页的“配置备份”提供两种互补能力:
Binary file
@@ -1,6 +1,6 @@
1
1
  # 产品截图与演示的来源及更新
2
2
 
3
- <!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.100 于 2026-11-10 重新采集,未修改截图中的版本文字。<!-- /generated:media -->
3
+ <!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.102 于 2026-11-12 重新采集,未修改截图中的版本文字。<!-- /generated:media -->
4
4
 
5
5
  前七张素材由真实产品 UI 的无凭据 Mock harness 渲染:1280×720 浏览器视口、800px 产品面板、桌面两列卡片。顶部保留“无凭据 Mock”标识;目录数、连接数与工具数是演示夹具,不代表生产统计或真实授权、业务验收。不会读取用户 profile、调用服务商或上传业务数据。
6
6
 
@@ -2,9 +2,9 @@
2
2
  "schemaVersion": 1,
3
3
  "capture": {
4
4
  "locale": "zh-CN",
5
- "capturedOn": "2026-11-10",
6
- "sourceVersion": "0.2.100",
7
- "sourceFingerprint": "b36089cc721fa8b15a923c1e5bcf0003fc74da608710c046a5444301b6d324ae",
5
+ "capturedOn": "2026-11-12",
6
+ "sourceVersion": "0.2.102",
7
+ "sourceFingerprint": "4d8135cd206dcb890002f8dee5b64bd1664806d68b1b9e5393743d47b1a5aa8b",
8
8
  "browserViewport": {
9
9
  "width": 1280,
10
10
  "height": 720
@@ -17,63 +17,63 @@
17
17
  "screenshots": [
18
18
  {
19
19
  "path": "docs/screenshots/01-market-overview.jpg",
20
- "sha256": "9c35d2fea6cc1e3999b3da8bcab051f681e00ca49996d513ca9e0adfb1baa0a3",
20
+ "sha256": "83f7080c01db5d12c3cd726f9de4ea5921fc87d960f640bd29e0ca513d4e53aa",
21
21
  "width": 1280,
22
22
  "height": 720,
23
- "capturedOn": "2026-11-10",
24
- "sourceVersion": "0.2.100"
23
+ "capturedOn": "2026-11-12",
24
+ "sourceVersion": "0.2.102"
25
25
  },
26
26
  {
27
27
  "path": "docs/screenshots/02-connector-detail.jpg",
28
- "sha256": "349ec1eae9297dab97ac18bc3c7c15324ecbd28db40d35f5cb6625e08441a7ca",
28
+ "sha256": "7249ba4d7fe6fc3536b651be17176606994f63f6241946a6adf13a05d88c6baf",
29
29
  "width": 1280,
30
30
  "height": 720,
31
- "capturedOn": "2026-11-10",
32
- "sourceVersion": "0.2.100"
31
+ "capturedOn": "2026-11-12",
32
+ "sourceVersion": "0.2.102"
33
33
  },
34
34
  {
35
35
  "path": "docs/screenshots/03-tool-discovery.jpg",
36
- "sha256": "534163ec02993382909a97f4b6d741e364319c232ceb6411601aa0c08ff335ef",
36
+ "sha256": "cb750e9d98976cb69fdf453a63bfcc7895ca2739a202e4a9e56d90976ea580f8",
37
37
  "width": 1280,
38
38
  "height": 720,
39
- "capturedOn": "2026-11-10",
40
- "sourceVersion": "0.2.100"
39
+ "capturedOn": "2026-11-12",
40
+ "sourceVersion": "0.2.102"
41
41
  },
42
42
  {
43
43
  "path": "docs/screenshots/04-json-import.jpg",
44
- "sha256": "38fe82951e2106b97fc1ad8fe668e77de4d6f2f7a05ae9f5817b01407e7cfd39",
44
+ "sha256": "679d12d86c767609b1d97a67fa619fc34c4e02146a58c79d252a0101f01d7e14",
45
45
  "width": 1280,
46
46
  "height": 720,
47
- "capturedOn": "2026-11-10",
48
- "sourceVersion": "0.2.100"
47
+ "capturedOn": "2026-11-12",
48
+ "sourceVersion": "0.2.102"
49
49
  },
50
50
  {
51
51
  "path": "docs/screenshots/05-unified-tool-search.png",
52
- "sha256": "61291fe467b4833261ea308471e6408909fae326b1f882e253ea4ca04d4ae3c7",
52
+ "sha256": "4f1a8e49779f72bc242add9a0f5e25cf0e46ee2511657591102fdb190213d4b0",
53
53
  "width": 1280,
54
54
  "height": 720,
55
- "capturedOn": "2026-11-10",
56
- "sourceVersion": "0.2.100"
55
+ "capturedOn": "2026-11-12",
56
+ "sourceVersion": "0.2.102"
57
57
  },
58
58
  {
59
59
  "path": "docs/screenshots/06-tool-parameters.png",
60
- "sha256": "3ab71d64760fe511f3784356ab3bbc073ddf4ab6d9f8d83f0138388423c5668f",
60
+ "sha256": "b52ff9a6ff5d3f10ad46a80e4809b8f2a89c44506a7a6c21aef38ac71535757c",
61
61
  "width": 1280,
62
62
  "height": 720,
63
- "capturedOn": "2026-11-10",
64
- "sourceVersion": "0.2.100"
63
+ "capturedOn": "2026-11-12",
64
+ "sourceVersion": "0.2.102"
65
65
  },
66
66
  {
67
67
  "path": "docs/screenshots/07-connection-diagnostics.png",
68
- "sha256": "904ba7c4521e8c711e6ad00c2b743cbc075778996c003f57bfcebe0cbeeeea65",
68
+ "sha256": "f2c6679160d70cced806ba0e8f082d762ed59fb3a0412ba7666316f6cfe5fa4d",
69
69
  "width": 1280,
70
70
  "height": 720,
71
- "capturedOn": "2026-11-10",
72
- "sourceVersion": "0.2.100"
71
+ "capturedOn": "2026-11-12",
72
+ "sourceVersion": "0.2.102"
73
73
  },
74
74
  {
75
75
  "path": "docs/screenshots/08-ten-recommendations.jpg",
76
- "sha256": "6720b6fccd233acdc3a49da9ba6cb657514b9d0c13303cfc04c95bccc586f7c3",
76
+ "sha256": "18383cb754dc415542da062fce423892a84f8cdcc0f5fae06b8ed91baafd78bb",
77
77
  "width": 1280,
78
78
  "height": 1400,
79
79
  "browserViewport": {
@@ -81,17 +81,17 @@
81
81
  "height": 1400
82
82
  },
83
83
  "panelHeight": 1280,
84
- "capturedOn": "2026-11-10",
85
- "sourceVersion": "0.2.100"
84
+ "capturedOn": "2026-11-12",
85
+ "sourceVersion": "0.2.102"
86
86
  }
87
87
  ],
88
88
  "demo": {
89
89
  "path": "docs/demo.gif",
90
- "sha256": "23cbfb71e70fca23d2d4d02eaefb9d2c4cec0129d686de46e12ca70423c80e41",
90
+ "sha256": "eb0f358b6406a86a76ea8d676d6761169292654a697f79ecf11793ca22214f68",
91
91
  "width": 960,
92
92
  "height": 540,
93
- "capturedOn": "2026-11-10",
94
- "sourceVersion": "0.2.100",
93
+ "capturedOn": "2026-11-12",
94
+ "sourceVersion": "0.2.102",
95
95
  "durationSeconds": 36
96
96
  }
97
97
  }
@@ -2,9 +2,9 @@
2
2
  "schemaVersion": 1,
3
3
  "capture": {
4
4
  "locale": "en",
5
- "capturedOn": "2026-11-10",
6
- "sourceVersion": "0.2.100",
7
- "sourceFingerprint": "b36089cc721fa8b15a923c1e5bcf0003fc74da608710c046a5444301b6d324ae",
5
+ "capturedOn": "2026-11-12",
6
+ "sourceVersion": "0.2.102",
7
+ "sourceFingerprint": "4d8135cd206dcb890002f8dee5b64bd1664806d68b1b9e5393743d47b1a5aa8b",
8
8
  "browserViewport": {
9
9
  "width": 1280,
10
10
  "height": 720
@@ -17,63 +17,63 @@
17
17
  "screenshots": [
18
18
  {
19
19
  "path": "docs/screenshots/en/01-market-overview.jpg",
20
- "sha256": "d787ce6f86ef01f01a4d40b28fb4e1343fbe1deb483812950ea80a2fc3b71104",
20
+ "sha256": "6b631b4af24757907d7569fbe0a3649ff7d5ee18b52e631da9af98bcae356a93",
21
21
  "width": 1280,
22
22
  "height": 720,
23
- "capturedOn": "2026-11-10",
24
- "sourceVersion": "0.2.100"
23
+ "capturedOn": "2026-11-12",
24
+ "sourceVersion": "0.2.102"
25
25
  },
26
26
  {
27
27
  "path": "docs/screenshots/en/02-connector-detail.jpg",
28
- "sha256": "ab9d7a78e4560c992abbdc19ddcf044575aeaf44ca3c92ad1219040f1cbb2a89",
28
+ "sha256": "df31c777933c1a081d64f01ef8fc0475724e0122227d1f393dd6c0a1560b4bfc",
29
29
  "width": 1280,
30
30
  "height": 720,
31
- "capturedOn": "2026-11-10",
32
- "sourceVersion": "0.2.100"
31
+ "capturedOn": "2026-11-12",
32
+ "sourceVersion": "0.2.102"
33
33
  },
34
34
  {
35
35
  "path": "docs/screenshots/en/03-tool-discovery.jpg",
36
- "sha256": "39d17e23623f0ef3a9a7a5d67ddfc8abd44b8a6ed9dcdb0b62c25f822aa70e72",
36
+ "sha256": "512ae305cc0c0124bbd9c5dc3c3bc870c8e13c6b74f0f9026d48aefda6629481",
37
37
  "width": 1280,
38
38
  "height": 720,
39
- "capturedOn": "2026-11-10",
40
- "sourceVersion": "0.2.100"
39
+ "capturedOn": "2026-11-12",
40
+ "sourceVersion": "0.2.102"
41
41
  },
42
42
  {
43
43
  "path": "docs/screenshots/en/04-json-import.jpg",
44
- "sha256": "2c8fb3ebb3660fffedfa98889ac7ca3285d8262eb15b4436f443b2dcaadbd237",
44
+ "sha256": "9b94b3c3649ff732fbf9a5bf30467ad2dca0f685d3d6446975396b7dc5017625",
45
45
  "width": 1280,
46
46
  "height": 720,
47
- "capturedOn": "2026-11-10",
48
- "sourceVersion": "0.2.100"
47
+ "capturedOn": "2026-11-12",
48
+ "sourceVersion": "0.2.102"
49
49
  },
50
50
  {
51
51
  "path": "docs/screenshots/en/05-unified-tool-search.png",
52
- "sha256": "17dc26926d694e30c548781c5a5f2554e13de71016942bd3f9e6593a5aa5d3e8",
52
+ "sha256": "bb3a67db0f475e5328b0c483126b8aa44f939a653ceb2e318b8c120adf2df1c8",
53
53
  "width": 1280,
54
54
  "height": 720,
55
- "capturedOn": "2026-11-10",
56
- "sourceVersion": "0.2.100"
55
+ "capturedOn": "2026-11-12",
56
+ "sourceVersion": "0.2.102"
57
57
  },
58
58
  {
59
59
  "path": "docs/screenshots/en/06-tool-parameters.png",
60
- "sha256": "4d273950025b97220494b1d36d776aacf50b49d5ccbcbf3d9bbb231391d398d8",
60
+ "sha256": "01444b2d814677b99fd70efee39126adfabb4859b5097b6f8e7be2b3fe50e467",
61
61
  "width": 1280,
62
62
  "height": 720,
63
- "capturedOn": "2026-11-10",
64
- "sourceVersion": "0.2.100"
63
+ "capturedOn": "2026-11-12",
64
+ "sourceVersion": "0.2.102"
65
65
  },
66
66
  {
67
67
  "path": "docs/screenshots/en/07-connection-diagnostics.png",
68
- "sha256": "71005865e7efd85a6e25bf91027c1c892cab2520c10b4084f54a832e16c331c3",
68
+ "sha256": "69d63e082a2208e9bb79f86fedf010b82034876ac0eb9a7f8c083efb84a3e4c0",
69
69
  "width": 1280,
70
70
  "height": 720,
71
- "capturedOn": "2026-11-10",
72
- "sourceVersion": "0.2.100"
71
+ "capturedOn": "2026-11-12",
72
+ "sourceVersion": "0.2.102"
73
73
  },
74
74
  {
75
75
  "path": "docs/screenshots/en/08-ten-recommendations.jpg",
76
- "sha256": "64febfcd61be46cb6f12513516b3826bd2cc1a73afe17e8b2fcd0c3b336c584b",
76
+ "sha256": "bdcaf8a7c2d705735595ebc350345ebb6b965a5b6ab3b2d478b0e8427641e7c6",
77
77
  "width": 1280,
78
78
  "height": 1400,
79
79
  "browserViewport": {
@@ -81,17 +81,17 @@
81
81
  "height": 1400
82
82
  },
83
83
  "panelHeight": 1280,
84
- "capturedOn": "2026-11-10",
85
- "sourceVersion": "0.2.100"
84
+ "capturedOn": "2026-11-12",
85
+ "sourceVersion": "0.2.102"
86
86
  }
87
87
  ],
88
88
  "demo": {
89
89
  "path": "docs/screenshots/en/demo.gif",
90
- "sha256": "488f44d7014f209128beed418d388ced396348d1404bcf9328d89dca0de07a4f",
90
+ "sha256": "f37d4eb0c2b5f665ad5a5b0efa79077383bcaa209549481fb3f47111c8616de3",
91
91
  "width": 960,
92
92
  "height": 540,
93
- "capturedOn": "2026-11-10",
94
- "sourceVersion": "0.2.100",
93
+ "capturedOn": "2026-11-12",
94
+ "sourceVersion": "0.2.102",
95
95
  "durationSeconds": 36
96
96
  }
97
97
  }
Binary file
@@ -8,7 +8,7 @@
8
8
 
9
9
  | 项目 | 验收要求 |
10
10
  |---|---|
11
- | 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.100`<!-- /generated:version -->;当前 Workspace;企查查 OAuth 可用;测试账号具有目标企业数据权限 |
11
+ | 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.102`<!-- /generated:version -->;当前 Workspace;企查查 OAuth 可用;测试账号具有目标企业数据权限 |
12
12
  | 权限/管理员 | 账号权限、组织授权和可见字段由服务商控制;企业组织可能需要管理员开通,当前文档不能替代审批 |
13
13
  | 费用 | 可能受套餐、次数或字段权限影响;MCP连接器无法确认本次费用,调用前在服务商侧核对 |
14
14
  | 运行/数据去向 | 远程 MCP Server;企业名称、查询参数和调用结果经 DSH Host 发送到/返回自 `agent.qcc.com` |
package/lib/client.js CHANGED
@@ -73,6 +73,9 @@ window.__ModuleLoader__.load({
73
73
  "请先选择一个工作空间,再使用示例 Prompt": "Select a workspace before using a sample prompt",
74
74
  "当前 DSH 版本没有可用的工作区会话创建能力,请升级 DSH 后重试": "This DSH version cannot create workspace sessions. Upgrade DSH and try again.",
75
75
  "DSH 对话服务尚未就绪,请稍后重试": "The DSH conversation service is not ready yet. Try again shortly.",
76
+ "当前 DSH 版本没有可用的草稿或会话导航能力,请升级 DSH 后重试": "This DSH version cannot prepare drafts or navigate sessions. Upgrade DSH and try again.",
77
+ "会话跳转已取消,请重试": "Session navigation was cancelled. Try again.",
78
+ "草稿暂时无法写入,请稍后重试": "The draft cannot be prepared right now. Try again shortly.",
76
79
  "无效的 Prompt 请求": "Invalid prompt request",
77
80
  "已带入新会话": "Added to a new session",
78
81
  "正在启动更新…": "Starting the update…",
@@ -1251,22 +1254,20 @@ window.__ModuleLoader__.load({
1251
1254
  });
1252
1255
  }
1253
1256
 
1254
- /**
1255
- * 用 DSH 自身的工作区/会话/输入机把示例 Prompt 带入新会话。
1256
- * connectWorkspace 与 DSH 的「新会话」按钮同源:优先复用当前工作区的
1257
- * 空白会话,没有时创建一个;返回时 binding 已就绪,可在导航前写入草稿。
1258
- */
1257
+ /** 从主视图持有的会话解析工作区,兼容仍提供旧选择字段的 Host。 */
1259
1258
  function currentWorkspaceContext(ctx) {
1260
1259
  const workspace = ctx.workspaces.list.getSnapshot();
1261
- const current = ctx.sessions.list.getSnapshot().current;
1260
+ const sessions = ctx.sessions.list.getSnapshot();
1261
+ if (!Array.isArray(workspace?.items) || !sessions || workspace.phase === "pending" || sessions.phase === "pending") return null;
1262
+ const main = Object.values(sessions.byId ?? {}).find((item) => (item?.retainedBy?.mainView ?? 0) > 0);
1263
+ const current = main?.id ?? sessions.current;
1262
1264
  const selected = current === void 0
1263
1265
  ? void 0
1264
- : workspace.items.find((item) => item.sessionIds.includes(current));
1265
- const targetWorkspaceId = selected?.workspaceId ?? workspace.recentWorkspaceId;
1266
- const target = workspace.items.find((item) => item.workspaceId === targetWorkspaceId);
1267
- return targetWorkspaceId === void 0 ? null : {
1268
- workspaceId: targetWorkspaceId,
1269
- title: target?.title ?? String(targetWorkspaceId)
1266
+ : workspace.items.find((item) => item.sessionIds?.includes(current));
1267
+ const target = selected ?? workspace.items.find((item) => item.workspaceId === workspace.recentWorkspaceId);
1268
+ return typeof target?.workspaceId !== "string" || target.workspaceId === "" ? null : {
1269
+ workspaceId: target.workspaceId,
1270
+ title: target.title ?? target.workspaceId
1270
1271
  };
1271
1272
  }
1272
1273
 
@@ -1292,30 +1293,74 @@ window.__ModuleLoader__.load({
1292
1293
  if (targetWorkspaceId === void 0) {
1293
1294
  throw new Error(t("请先选择一个工作空间,再使用示例 Prompt"));
1294
1295
  }
1295
- // DSH 0.1.2 将跨 Controller 的导航能力从 workspaces 移到
1296
- // uiWorkspace;0.1.1 Desktop 仍暴露旧方法。优先使用当前公开能力,
1297
- // 再兼容旧版,最后以 sessions.create 保证未来移除桥接方法时仍能
1298
- // 在目标 Workspace 创建原生会话。
1299
1296
  const uiWorkspace = typeof ctx.get === "function"
1300
1297
  ? ctx.get("uiWorkspace")
1301
1298
  : ctx.uiWorkspace;
1302
- let sessionId;
1303
- if (typeof uiWorkspace?.connectWorkspace === "function") {
1304
- sessionId = await uiWorkspace.connectWorkspace(targetWorkspaceId);
1305
- } else if (typeof ctx.workspaces?.connectWorkspace === "function") {
1306
- sessionId = await ctx.workspaces.connectWorkspace(targetWorkspaceId);
1307
- } else if (typeof ctx.sessions?.create === "function") {
1308
- sessionId = await ctx.sessions.create({ workspaceId: targetWorkspaceId });
1309
- } else {
1299
+ const conversation = typeof ctx.get === "function" ? ctx.get("conversation") : ctx.conversation;
1300
+ if (!conversation?.input) {
1301
+ throw new Error(t("DSH 对话服务尚未就绪,请稍后重试"));
1302
+ }
1303
+ if (typeof ctx.sessions.create !== "function") {
1310
1304
  throw new Error(t("当前 DSH 版本没有可用的工作区会话创建能力,请升级 DSH 后重试"));
1311
1305
  }
1312
- const conversation = ctx.get("conversation");
1313
- if (conversation === void 0) {
1314
- throw new Error(t("DSH 对话服务尚未就绪,请稍后重试"));
1306
+ const modern = typeof conversation.input.requestDraftInitialization === "function";
1307
+ if (modern
1308
+ ? typeof ctx.sessions.retain !== "function" || typeof uiWorkspace?.openSession !== "function"
1309
+ : typeof conversation.input.shell !== "function" || typeof ctx.sessions.open !== "function") {
1310
+ throw new Error(t("当前 DSH 版本没有可用的草稿或会话导航能力,请升级 DSH 后重试"));
1311
+ }
1312
+ const layout = typeof ctx.get === "function" ? ctx.get("layout") : ctx.layout;
1313
+ const signal = layout?.beginNavigation?.();
1314
+ const checkNavigation = () => {
1315
+ if (signal?.aborted) throw new Error(t("会话跳转已取消,请重试"));
1316
+ };
1317
+ checkNavigation();
1318
+ if (!modern) {
1319
+ // 旧输入机无法可靠检查已有文字和附件,只写入全新身份的会话。
1320
+ const sessionId = await ctx.sessions.create({ workspaceId: targetWorkspaceId });
1321
+ checkNavigation();
1322
+ const input = conversation.input.shell(sessionId);
1323
+ if (typeof input?.setDraft !== "function") {
1324
+ throw new Error(t("DSH 对话服务尚未就绪,请稍后重试"));
1325
+ }
1326
+ input.setDraft(promptText);
1327
+ checkNavigation();
1328
+ ctx.sessions.open(sessionId);
1329
+ return sessionId;
1315
1330
  }
1316
- conversation.input.shell(sessionId).setDraft(promptText);
1317
- ctx.sessions.open(sessionId);
1318
- return sessionId;
1331
+ const prepare = async (sessionId) => {
1332
+ checkNavigation();
1333
+ const reference = ctx.sessions.retain(sessionId, { source: "controllerOperation", ...(signal ? { signal } : {}) });
1334
+ try {
1335
+ try {
1336
+ await reference.ready;
1337
+ } catch (error) {
1338
+ checkNavigation();
1339
+ throw error;
1340
+ }
1341
+ checkNavigation();
1342
+ const result = conversation.input.requestDraftInitialization(reference.binding, {
1343
+ prompt: promptText,
1344
+ whenDraftExists: "keep"
1345
+ });
1346
+ if (result === "preserved") return false;
1347
+ if (result !== "applied") throw new Error(t("草稿暂时无法写入,请稍后重试"));
1348
+ checkNavigation();
1349
+ // openSession 同步持有 mainView 引用后,才可释放临时引用。
1350
+ uiWorkspace.openSession(sessionId);
1351
+ return true;
1352
+ } finally {
1353
+ reference.release();
1354
+ }
1355
+ };
1356
+ const sessionId = typeof uiWorkspace.connectWorkspace === "function"
1357
+ ? await uiWorkspace.connectWorkspace(targetWorkspaceId)
1358
+ : await ctx.sessions.create({ workspaceId: targetWorkspaceId });
1359
+ if (await prepare(sessionId)) return sessionId;
1360
+ checkNavigation();
1361
+ const freshId = await ctx.sessions.create({ workspaceId: targetWorkspaceId });
1362
+ if (await prepare(freshId)) return freshId;
1363
+ throw new Error(t("草稿暂时无法写入,请稍后重试"));
1319
1364
  }
1320
1365
 
1321
1366
  /** 市场主体:原生 main 面板与设置页快捷弹框共用。 */
@@ -1390,7 +1435,7 @@ window.__ModuleLoader__.load({
1390
1435
  reply(false, t("无效的 Prompt 请求"));
1391
1436
  return;
1392
1437
  }
1393
- Promise.resolve(launchPromptSession(prompt)).then(() => {
1438
+ Promise.resolve().then(() => launchPromptSession(prompt)).then(() => {
1394
1439
  reply(true, t("已带入新会话"));
1395
1440
  window.requestAnimationFrame(closeView);
1396
1441
  }, (error) => {