dsh-mcp-connector 0.2.101 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
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
+
3
10
  ## 0.2.101
4
11
 
5
12
  - 企查查旧授权迁移后看到红色“连接异常”时,点击市场卡片上的状态,或在 MCP连接器“已安装”中点“查看处理步骤”。已完成迁移的连接也能重新打开指引。
package/README.en.md CHANGED
@@ -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.101 (2026-11-11), 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.101`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.101](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.101).<!-- /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
@@ -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.101(2026-11-11)无凭据 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.101`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.101](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.101)。<!-- /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)。
@@ -17,7 +17,7 @@ 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
22
  9. 企查查迁移应同时覆盖工商与法律。先复制授权并关闭弹框,再从市场的“连接异常”、已安装行和再次扫描进入指引。按命中的插件或残留条目处理,完整重启后确认工具在宿主中注册。[客户操作说明](USER-GUIDE.md#企查查旧插件迁移后显示连接异常)随包提供。真实旧包和隔离 profile 的详细验收记录在源码仓库的 `docs/acceptance/PLUGIN-CONFLICT-MIGRATION-2026-11-11.md`。
23
23
 
@@ -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
 
Binary file
@@ -1,6 +1,6 @@
1
1
  # 产品截图与演示的来源及更新
2
2
 
3
- <!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.101 于 2026-11-11 重新采集,未修改截图中的版本文字。<!-- /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-11",
6
- "sourceVersion": "0.2.101",
7
- "sourceFingerprint": "d8cee78aaccc0f493892a840b2f8cd6a1df66f137330096bdda907668a68c9f9",
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": "ea937659c000a502b132e3ecc77633578fd57c377bd7d7cc63bc35614051f941",
20
+ "sha256": "83f7080c01db5d12c3cd726f9de4ea5921fc87d960f640bd29e0ca513d4e53aa",
21
21
  "width": 1280,
22
22
  "height": 720,
23
- "capturedOn": "2026-11-11",
24
- "sourceVersion": "0.2.101"
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": "0caadb709188e76a32e122bd6c557e1d777a31aa387adf2cf8e5e0e4384c9218",
28
+ "sha256": "7249ba4d7fe6fc3536b651be17176606994f63f6241946a6adf13a05d88c6baf",
29
29
  "width": 1280,
30
30
  "height": 720,
31
- "capturedOn": "2026-11-11",
32
- "sourceVersion": "0.2.101"
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": "b59313086cb153d88fc013fab15877acd90ec89a4c9e64a84f6a96ec3f4387db",
36
+ "sha256": "cb750e9d98976cb69fdf453a63bfcc7895ca2739a202e4a9e56d90976ea580f8",
37
37
  "width": 1280,
38
38
  "height": 720,
39
- "capturedOn": "2026-11-11",
40
- "sourceVersion": "0.2.101"
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": "df06b106dfc2475cefe1ed28608da174f65b9a833de0a7f25260246ac6fd7400",
44
+ "sha256": "679d12d86c767609b1d97a67fa619fc34c4e02146a58c79d252a0101f01d7e14",
45
45
  "width": 1280,
46
46
  "height": 720,
47
- "capturedOn": "2026-11-11",
48
- "sourceVersion": "0.2.101"
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": "c3b52bddd7c70803309fc5d934f9f7631e436976c7d1879f241da088120911b7",
52
+ "sha256": "4f1a8e49779f72bc242add9a0f5e25cf0e46ee2511657591102fdb190213d4b0",
53
53
  "width": 1280,
54
54
  "height": 720,
55
- "capturedOn": "2026-11-11",
56
- "sourceVersion": "0.2.101"
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": "8133e9808e4b5631ffa0114a403df81a505630e88da54f51e6173e62509fabc0",
60
+ "sha256": "b52ff9a6ff5d3f10ad46a80e4809b8f2a89c44506a7a6c21aef38ac71535757c",
61
61
  "width": 1280,
62
62
  "height": 720,
63
- "capturedOn": "2026-11-11",
64
- "sourceVersion": "0.2.101"
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": "699d46c8be937627b6c6fc1890f1ee36b1a4186486e462721cc1d5094bcb1bc7",
68
+ "sha256": "f2c6679160d70cced806ba0e8f082d762ed59fb3a0412ba7666316f6cfe5fa4d",
69
69
  "width": 1280,
70
70
  "height": 720,
71
- "capturedOn": "2026-11-11",
72
- "sourceVersion": "0.2.101"
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": "cf2b60d4084bf028c47ed07f70f910ef9935844e60a109a28a04d35a0129eb50",
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-11",
85
- "sourceVersion": "0.2.101"
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": "762facb18a45773cfeb34fb93eebb071804eb7ba62c7d17114ea522e845f645b",
90
+ "sha256": "eb0f358b6406a86a76ea8d676d6761169292654a697f79ecf11793ca22214f68",
91
91
  "width": 960,
92
92
  "height": 540,
93
- "capturedOn": "2026-11-11",
94
- "sourceVersion": "0.2.101",
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-11",
6
- "sourceVersion": "0.2.101",
7
- "sourceFingerprint": "d8cee78aaccc0f493892a840b2f8cd6a1df66f137330096bdda907668a68c9f9",
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": "39cda6fd891098fd1f0e6b9f98a30a17df01119726da4c07d2ae12b854cf7135",
20
+ "sha256": "6b631b4af24757907d7569fbe0a3649ff7d5ee18b52e631da9af98bcae356a93",
21
21
  "width": 1280,
22
22
  "height": 720,
23
- "capturedOn": "2026-11-11",
24
- "sourceVersion": "0.2.101"
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": "501ce3bdb5cf275b169f89d2d1cffd6977e469e07b4c269f48daae2d088cbf73",
28
+ "sha256": "df31c777933c1a081d64f01ef8fc0475724e0122227d1f393dd6c0a1560b4bfc",
29
29
  "width": 1280,
30
30
  "height": 720,
31
- "capturedOn": "2026-11-11",
32
- "sourceVersion": "0.2.101"
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": "ebaca4131388f24b7faba268511d4977a401ff31b47cf970d51363f2ce29f9ce",
36
+ "sha256": "512ae305cc0c0124bbd9c5dc3c3bc870c8e13c6b74f0f9026d48aefda6629481",
37
37
  "width": 1280,
38
38
  "height": 720,
39
- "capturedOn": "2026-11-11",
40
- "sourceVersion": "0.2.101"
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": "103bb913f5f10d2f5d5606147912010ebcb70f065ca15cc84330709cc34fba6c",
44
+ "sha256": "9b94b3c3649ff732fbf9a5bf30467ad2dca0f685d3d6446975396b7dc5017625",
45
45
  "width": 1280,
46
46
  "height": 720,
47
- "capturedOn": "2026-11-11",
48
- "sourceVersion": "0.2.101"
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": "76c43064c639a644b8b98e0c63dab26478234fecead75bb5d725da8e4ba587cc",
52
+ "sha256": "bb3a67db0f475e5328b0c483126b8aa44f939a653ceb2e318b8c120adf2df1c8",
53
53
  "width": 1280,
54
54
  "height": 720,
55
- "capturedOn": "2026-11-11",
56
- "sourceVersion": "0.2.101"
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": "3c5ec0e2cc9d4ebb1c06375cd6b6d35d70576f8f9ac40e01734e5d060a55b17c",
60
+ "sha256": "01444b2d814677b99fd70efee39126adfabb4859b5097b6f8e7be2b3fe50e467",
61
61
  "width": 1280,
62
62
  "height": 720,
63
- "capturedOn": "2026-11-11",
64
- "sourceVersion": "0.2.101"
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": "3e02a0727dba8747631eaed6f1ef0f37a818ab3883e6670c38f8d135b8256771",
68
+ "sha256": "69d63e082a2208e9bb79f86fedf010b82034876ac0eb9a7f8c083efb84a3e4c0",
69
69
  "width": 1280,
70
70
  "height": 720,
71
- "capturedOn": "2026-11-11",
72
- "sourceVersion": "0.2.101"
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": "f380e306604bc60ad9cff6dae098f5c4e1cb2ff5c2a6ca68c184bfb4b100e667",
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-11",
85
- "sourceVersion": "0.2.101"
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": "5307c26f505110c03c0c3eb93f04fda02f39ec07998906dc55161cd920c69727",
90
+ "sha256": "f37d4eb0c2b5f665ad5a5b0efa79077383bcaa209549481fb3f47111c8616de3",
91
91
  "width": 960,
92
92
  "height": 540,
93
- "capturedOn": "2026-11-11",
94
- "sourceVersion": "0.2.101",
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.101`<!-- /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) => {
@@ -53,6 +53,9 @@ export default {
53
53
  "请先选择一个工作空间,再使用示例 Prompt": "Select a workspace before using a sample prompt",
54
54
  "当前 DSH 版本没有可用的工作区会话创建能力,请升级 DSH 后重试": "This DSH version cannot create workspace sessions. Upgrade DSH and try again.",
55
55
  "DSH 对话服务尚未就绪,请稍后重试": "The DSH conversation service is not ready yet. Try again shortly.",
56
+ "当前 DSH 版本没有可用的草稿或会话导航能力,请升级 DSH 后重试": "This DSH version cannot prepare drafts or navigate sessions. Upgrade DSH and try again.",
57
+ "会话跳转已取消,请重试": "Session navigation was cancelled. Try again.",
58
+ "草稿暂时无法写入,请稍后重试": "The draft cannot be prepared right now. Try again shortly.",
56
59
  "无效的 Prompt 请求": "Invalid prompt request",
57
60
  "已带入新会话": "Added to a new session",
58
61
  "正在启动更新…": "Starting the update…",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp-connector",
3
- "version": "0.2.101",
3
+ "version": "0.2.102",
4
4
  "description": "MCP Connector for DeepSeek Harness: a data marketplace connecting enterprise, financial, legal, patent and research data. Manage authorization, search tools and troubleshoot MCP connections. Supports OAuth, API keys and HTTP/stdio.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -149,14 +149,30 @@ function captureShell() {
149
149
  .capture-version, .capture-state { padding: 2px 8px; border-radius: 999px; background: #f3f4f6; color: #6b7280; font-size: 12px; font-weight: 600; }
150
150
  .capture-state { margin-left: auto; color: #047857; background: #ecfdf5; }
151
151
  iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: transparent; }
152
+ [hidden] { display: none !important; }
153
+ .mock-session { flex: 1; padding: 24px; overflow: auto; }
154
+ .mock-session textarea { width: 100%; min-height: 180px; padding: 12px; font: inherit; }
152
155
  </style>
153
156
  </head>
154
157
  <body>
155
158
  <section class="capture-panel" aria-label="MCP连接器产品面板">
156
159
  <header class="capture-header"><svg aria-hidden="true" width="18" height="18" viewBox="0 0 16 16" fill="none"><path d="M6 2V4.5" stroke="currentColor" stroke-linecap="round"/><path d="M10 2V4.5" stroke="currentColor" stroke-linecap="round"/><path d="M3.5 4.5H12.5V8.25C12.5 10.7353 10.4853 12.75 8 12.75C5.51472 12.75 3.5 10.7353 3.5 8.25V4.5Z" stroke="currentColor" stroke-linejoin="round"/><path d="M8 12.75V14.5" stroke="currentColor" stroke-linecap="round"/></svg><span class="capture-title">MCP连接器</span><span class="capture-version">v${packageJson.version}</span><span class="capture-state">无凭据 Mock</span></header>
157
160
  <iframe src="/mcp-connector/ui/" title="MCP连接器"></iframe>
161
+ <section id="mock-session" class="mock-session" aria-label="${english ? 'Mock conversation draft' : '模拟会话草稿'}" hidden>
162
+ <h2>${english ? 'Draft prepared' : '已带入会话草稿'}</h2>
163
+ <p>${english ? 'Credential-free UI simulation. No message was submitted or tool called.' : '无凭据 UI 模拟:尚未提交消息或调用工具。'}</p>
164
+ <p id="mock-session-target"></p>
165
+ <label for="mock-draft">${english ? 'Review draft' : '核对草稿'}</label>
166
+ <textarea id="mock-draft" readonly></textarea>
167
+ <button id="mock-return" type="button">${english ? 'Back to MCP Connector' : '返回 MCP连接器'}</button>
168
+ </section>
158
169
  </section>
159
170
  <script>
171
+ let mockSessionSequence = 0;
172
+ document.querySelector('#mock-return').addEventListener('click', () => {
173
+ document.querySelector('#mock-session').hidden = true;
174
+ document.querySelector('iframe').hidden = false;
175
+ });
160
176
  window.addEventListener('message', (event) => {
161
177
  const frame = document.querySelector('iframe');
162
178
  if (event.origin !== window.location.origin || event.source !== frame.contentWindow) return;
@@ -167,6 +183,22 @@ function captureShell() {
167
183
  workspaces: ${JSON.stringify(mockWorkspaces)}
168
184
  }, window.location.origin);
169
185
  }
186
+ if (event.data?.type === 'mcp-connector:start-session') {
187
+ const { requestId, prompt } = event.data;
188
+ const ok = typeof requestId === 'string' && requestId !== '' && typeof prompt === 'string' && prompt.trim() !== '';
189
+ if (ok) {
190
+ document.querySelector('#mock-draft').value = prompt;
191
+ document.querySelector('#mock-session-target').textContent = ${JSON.stringify(mockWorkspace.title)} + ' · mock-session-' + (++mockSessionSequence);
192
+ }
193
+ frame.contentWindow.postMessage({
194
+ type: 'mcp-connector:start-session-result', requestId, ok,
195
+ message: ok ? ${JSON.stringify(english ? 'Added to a new session' : '已带入新会话')} : ${JSON.stringify(english ? 'Invalid prompt request' : '无效的 Prompt 请求')}
196
+ }, window.location.origin);
197
+ if (ok) requestAnimationFrame(() => {
198
+ frame.hidden = true;
199
+ document.querySelector('#mock-session').hidden = false;
200
+ });
201
+ }
170
202
  });
171
203
  </script>
172
204
  </body>