dsh-mcp-connector 0.2.96 → 0.2.98
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 +2 -2
- package/README.md +2 -2
- 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 +30 -30
- package/docs/screenshots/en/01-market-overview.jpg +0 -0
- package/docs/screenshots/en/02-connector-detail.jpg +0 -0
- package/docs/screenshots/en/03-tool-discovery.jpg +0 -0
- package/docs/screenshots/en/04-json-import.jpg +0 -0
- package/docs/screenshots/en/05-unified-tool-search.png +0 -0
- package/docs/screenshots/en/06-tool-parameters.png +0 -0
- package/docs/screenshots/en/07-connection-diagnostics.png +0 -0
- package/docs/screenshots/en/08-ten-recommendations.jpg +0 -0
- package/docs/screenshots/en/assets.json +30 -30
- package/docs/screenshots/en/demo.gif +0 -0
- package/docs/tutorials/FIRST-SUCCESS-SCENARIOS.md +1 -1
- package/lib/index.js +3 -2
- package/lib/schema.js +1 -0
- package/lib/stores.js +2 -2
- package/package.json +1 -1
- package/ui/index.html +151 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.98
|
|
4
|
+
|
|
5
|
+
- Replace the hidden first-use question mark with a bilingual Quick start action and a zero-connection guidance card that leads directly to recommended connectors or the existing read-only getting-started flow.
|
|
6
|
+
- Add a first successful connection handoff to discovered tools and example prompts without claiming authorization, tool execution, or business-call success.
|
|
7
|
+
- Add bounded, local-browser guidance counters for Quick start, recommendations, first connector setup and tool discovery. No data is uploaded and the UI explicitly avoids calculating a conversion rate across mixed denominators.
|
|
8
|
+
- Refresh the bilingual credential-free Mock screenshots and GIFs so the storefront matches the current two-column UI and does not display a reauthorization state.
|
|
9
|
+
|
|
10
|
+
## 0.2.97
|
|
11
|
+
|
|
12
|
+
- Bind remote catalog caches and ETags to catalogUrl. Changing the source fetches the new catalog immediately, including while the old cache TTL is fresh; failed requests do not expose entries from another source (#219).
|
|
13
|
+
- Refresh legacy caches without a source URL once before reuse. Preserve same-source TTL hits, background refresh, HTTP 304 revalidation, and manual refresh behavior.
|
|
14
|
+
- Add 13 regression cases covering source changes, failure isolation, storage validation, restart reuse, and manual refresh. Real Windows Desktop verification for #218 and #219 remains pending.
|
|
15
|
+
|
|
3
16
|
## 0.2.96
|
|
4
17
|
|
|
5
18
|
- Honor catalog TTL on startup; use audited stale cache immediately and refresh in the background, renew freshness on HTTP 304, and cancel superseded/disposed refreshes (#219). First installation without a valid cache still uses the existing foreground fetch path.
|
package/README.en.md
CHANGED
|
@@ -114,7 +114,7 @@ As of 2026-10-24, the public Registry publishes 112 connector descriptors. After
|
|
|
114
114
|
| Connection diagnostics and last-success cache | |
|
|
115
115
|
|  | |
|
|
116
116
|
|
|
117
|
-
<!-- generated:media -->English UI screenshots and GIF were captured from v0.2.
|
|
117
|
+
<!-- generated:media -->English UI screenshots and GIF were captured from v0.2.98 (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 -->
|
|
118
118
|
|
|
119
119
|
## Installation
|
|
120
120
|
|
|
@@ -245,7 +245,7 @@ npm run dev:ui
|
|
|
245
245
|
|
|
246
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.
|
|
247
247
|
|
|
248
|
-
<!-- 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.98`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.98](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.98).<!-- /generated:version -->
|
|
249
249
|
|
|
250
250
|
See [CHANGELOG.md](CHANGELOG.md) for version history and [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md) for the Desktop release checklist.
|
|
251
251
|
|
package/README.md
CHANGED
|
@@ -128,7 +128,7 @@ Desktop 需要完全退出并重新启动应用;Web 需要停止原 `dsh web`
|
|
|
128
128
|
| 连接诊断与最后成功缓存 | |
|
|
129
129
|
|  | |
|
|
130
130
|
|
|
131
|
-
<!-- generated:media -->截图与 GIF 采集自 v0.2.
|
|
131
|
+
<!-- generated:media -->截图与 GIF 采集自 v0.2.98(2026-11-10)无凭据 Mock 页面,展示界面而非真实业务验收;市场数量是测试夹具。来源与更新方法见 [素材说明](docs/screenshots/README.md)。<!-- /generated:media -->
|
|
132
132
|
|
|
133
133
|
## 安装
|
|
134
134
|
|
|
@@ -252,7 +252,7 @@ npm run dev:ui
|
|
|
252
252
|
|
|
253
253
|
公共 Registry 每次合并后会生成 `catalog-stats.json`;本仓库的定时工作流每小时同步中英文介绍和统计快照。npm 页面中的静态正文随版本发布更新,上方动态统计徽标则直接读取 Registry,可在不发布新 npm 版本时保持实时数量一致。
|
|
254
254
|
|
|
255
|
-
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.
|
|
255
|
+
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.98`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.98](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.98)。<!-- /generated:version -->
|
|
256
256
|
|
|
257
257
|
版本能力与变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
258
258
|
Desktop 发版回归见 [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md)。
|
|
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.98 于 2026-11-10 重新采集,未修改截图中的版本文字。<!-- /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-
|
|
6
|
-
"sourceVersion": "0.2.
|
|
7
|
-
"sourceFingerprint": "
|
|
5
|
+
"capturedOn": "2026-11-10",
|
|
6
|
+
"sourceVersion": "0.2.98",
|
|
7
|
+
"sourceFingerprint": "82d95b2a17d76f195db9afc1cfc1881ce25ff26c389797b396b28b6af34f68cd",
|
|
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": "
|
|
20
|
+
"sha256": "9832c299de24c484f2e32bfe2d83925e7b3fbe897c0b914f03d78332f6c5daec",
|
|
21
21
|
"width": 1280,
|
|
22
22
|
"height": 720,
|
|
23
|
-
"capturedOn": "2026-11-
|
|
24
|
-
"sourceVersion": "0.2.
|
|
23
|
+
"capturedOn": "2026-11-10",
|
|
24
|
+
"sourceVersion": "0.2.98"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "docs/screenshots/02-connector-detail.jpg",
|
|
28
|
-
"sha256": "
|
|
28
|
+
"sha256": "4f42dfb09df6228e6ec7514fc96a5861504a71d3d7daebd02d54219b31f65af7",
|
|
29
29
|
"width": 1280,
|
|
30
30
|
"height": 720,
|
|
31
|
-
"capturedOn": "2026-11-
|
|
32
|
-
"sourceVersion": "0.2.
|
|
31
|
+
"capturedOn": "2026-11-10",
|
|
32
|
+
"sourceVersion": "0.2.98"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "docs/screenshots/03-tool-discovery.jpg",
|
|
36
|
-
"sha256": "
|
|
36
|
+
"sha256": "c2d267375103c5b739e2f830c40fa0824e55f619450b4748b9c1192300cf2d2a",
|
|
37
37
|
"width": 1280,
|
|
38
38
|
"height": 720,
|
|
39
|
-
"capturedOn": "2026-11-
|
|
40
|
-
"sourceVersion": "0.2.
|
|
39
|
+
"capturedOn": "2026-11-10",
|
|
40
|
+
"sourceVersion": "0.2.98"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "docs/screenshots/04-json-import.jpg",
|
|
44
|
-
"sha256": "
|
|
44
|
+
"sha256": "0eb7221f036871bba1e284836cb400bec84e27f9ee52df5fcce539e86ee16f0f",
|
|
45
45
|
"width": 1280,
|
|
46
46
|
"height": 720,
|
|
47
|
-
"capturedOn": "2026-11-
|
|
48
|
-
"sourceVersion": "0.2.
|
|
47
|
+
"capturedOn": "2026-11-10",
|
|
48
|
+
"sourceVersion": "0.2.98"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"path": "docs/screenshots/05-unified-tool-search.png",
|
|
52
|
-
"sha256": "
|
|
52
|
+
"sha256": "6b8dab1027dd074e3cc4edffd11ccfff9fb01dc94ab709a2c671b735cafb537d",
|
|
53
53
|
"width": 1280,
|
|
54
54
|
"height": 720,
|
|
55
|
-
"capturedOn": "2026-11-
|
|
56
|
-
"sourceVersion": "0.2.
|
|
55
|
+
"capturedOn": "2026-11-10",
|
|
56
|
+
"sourceVersion": "0.2.98"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"path": "docs/screenshots/06-tool-parameters.png",
|
|
60
|
-
"sha256": "
|
|
60
|
+
"sha256": "9b1506c8eba96e304c279c6f70770637ceae608dc3c62c9c69e4b3b849d875fe",
|
|
61
61
|
"width": 1280,
|
|
62
62
|
"height": 720,
|
|
63
|
-
"capturedOn": "2026-11-
|
|
64
|
-
"sourceVersion": "0.2.
|
|
63
|
+
"capturedOn": "2026-11-10",
|
|
64
|
+
"sourceVersion": "0.2.98"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "docs/screenshots/07-connection-diagnostics.png",
|
|
68
|
-
"sha256": "
|
|
68
|
+
"sha256": "40f0daaff46204c31b61ca96d6fc30322830dba72d53fa22c469da0d4c0283d7",
|
|
69
69
|
"width": 1280,
|
|
70
70
|
"height": 720,
|
|
71
|
-
"capturedOn": "2026-11-
|
|
72
|
-
"sourceVersion": "0.2.
|
|
71
|
+
"capturedOn": "2026-11-10",
|
|
72
|
+
"sourceVersion": "0.2.98"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"path": "docs/screenshots/08-ten-recommendations.jpg",
|
|
76
|
-
"sha256": "
|
|
76
|
+
"sha256": "d7cbc112bb97972a2831be8f91e9bd61d32fa9d5a5ebffcd44431b30ca489846",
|
|
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-
|
|
85
|
-
"sourceVersion": "0.2.
|
|
84
|
+
"capturedOn": "2026-11-10",
|
|
85
|
+
"sourceVersion": "0.2.98"
|
|
86
86
|
}
|
|
87
87
|
],
|
|
88
88
|
"demo": {
|
|
89
89
|
"path": "docs/demo.gif",
|
|
90
|
-
"sha256": "
|
|
90
|
+
"sha256": "b69146e9b9286d417d9f88d3cda5bbd126adc061b314f4e66a1cd953c94f7a22",
|
|
91
91
|
"width": 960,
|
|
92
92
|
"height": 540,
|
|
93
|
-
"capturedOn": "2026-11-
|
|
94
|
-
"sourceVersion": "0.2.
|
|
93
|
+
"capturedOn": "2026-11-10",
|
|
94
|
+
"sourceVersion": "0.2.98",
|
|
95
95
|
"durationSeconds": 36
|
|
96
96
|
}
|
|
97
97
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"capture": {
|
|
4
4
|
"locale": "en",
|
|
5
|
-
"capturedOn": "2026-11-
|
|
6
|
-
"sourceVersion": "0.2.
|
|
7
|
-
"sourceFingerprint": "
|
|
5
|
+
"capturedOn": "2026-11-10",
|
|
6
|
+
"sourceVersion": "0.2.98",
|
|
7
|
+
"sourceFingerprint": "82d95b2a17d76f195db9afc1cfc1881ce25ff26c389797b396b28b6af34f68cd",
|
|
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": "
|
|
20
|
+
"sha256": "084a8002c8c0c93de4504804acb58e9c9ac2aede8865292f0913e66435e0cc56",
|
|
21
21
|
"width": 1280,
|
|
22
22
|
"height": 720,
|
|
23
|
-
"capturedOn": "2026-11-
|
|
24
|
-
"sourceVersion": "0.2.
|
|
23
|
+
"capturedOn": "2026-11-10",
|
|
24
|
+
"sourceVersion": "0.2.98"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "docs/screenshots/en/02-connector-detail.jpg",
|
|
28
|
-
"sha256": "
|
|
28
|
+
"sha256": "ac9c12d8ae9b662a095a5834a433a6c54000d0f00cbc9a9fda919efb73712353",
|
|
29
29
|
"width": 1280,
|
|
30
30
|
"height": 720,
|
|
31
|
-
"capturedOn": "2026-11-
|
|
32
|
-
"sourceVersion": "0.2.
|
|
31
|
+
"capturedOn": "2026-11-10",
|
|
32
|
+
"sourceVersion": "0.2.98"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "docs/screenshots/en/03-tool-discovery.jpg",
|
|
36
|
-
"sha256": "
|
|
36
|
+
"sha256": "679d59e40ad9ae53c4d09ad2295c4e87971b35d3e4f211fec412b70e5a20be9a",
|
|
37
37
|
"width": 1280,
|
|
38
38
|
"height": 720,
|
|
39
|
-
"capturedOn": "2026-11-
|
|
40
|
-
"sourceVersion": "0.2.
|
|
39
|
+
"capturedOn": "2026-11-10",
|
|
40
|
+
"sourceVersion": "0.2.98"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "docs/screenshots/en/04-json-import.jpg",
|
|
44
|
-
"sha256": "
|
|
44
|
+
"sha256": "025750e844ec1c6fdf68391a099fc81894f3c21f980c1971556bf061f4ac7cd2",
|
|
45
45
|
"width": 1280,
|
|
46
46
|
"height": 720,
|
|
47
|
-
"capturedOn": "2026-11-
|
|
48
|
-
"sourceVersion": "0.2.
|
|
47
|
+
"capturedOn": "2026-11-10",
|
|
48
|
+
"sourceVersion": "0.2.98"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"path": "docs/screenshots/en/05-unified-tool-search.png",
|
|
52
|
-
"sha256": "
|
|
52
|
+
"sha256": "5f7777eba34c4c9328b9451e10bcfef133da3f47c0bb9bd74150c36e59d8047a",
|
|
53
53
|
"width": 1280,
|
|
54
54
|
"height": 720,
|
|
55
|
-
"capturedOn": "2026-11-
|
|
56
|
-
"sourceVersion": "0.2.
|
|
55
|
+
"capturedOn": "2026-11-10",
|
|
56
|
+
"sourceVersion": "0.2.98"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"path": "docs/screenshots/en/06-tool-parameters.png",
|
|
60
|
-
"sha256": "
|
|
60
|
+
"sha256": "567f6286633c98fccbbd390e6188375e67ceee6f865ad129842116dc38a9ddfd",
|
|
61
61
|
"width": 1280,
|
|
62
62
|
"height": 720,
|
|
63
|
-
"capturedOn": "2026-11-
|
|
64
|
-
"sourceVersion": "0.2.
|
|
63
|
+
"capturedOn": "2026-11-10",
|
|
64
|
+
"sourceVersion": "0.2.98"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "docs/screenshots/en/07-connection-diagnostics.png",
|
|
68
|
-
"sha256": "
|
|
68
|
+
"sha256": "f0435d733038163da255109b272ec153083ad99ce00f704018419212c2769bcd",
|
|
69
69
|
"width": 1280,
|
|
70
70
|
"height": 720,
|
|
71
|
-
"capturedOn": "2026-11-
|
|
72
|
-
"sourceVersion": "0.2.
|
|
71
|
+
"capturedOn": "2026-11-10",
|
|
72
|
+
"sourceVersion": "0.2.98"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"path": "docs/screenshots/en/08-ten-recommendations.jpg",
|
|
76
|
-
"sha256": "
|
|
76
|
+
"sha256": "3b36eaa0533f667ed47ae44f89cf5514c396f7b7d29ca40635ebd0411310037e",
|
|
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-
|
|
85
|
-
"sourceVersion": "0.2.
|
|
84
|
+
"capturedOn": "2026-11-10",
|
|
85
|
+
"sourceVersion": "0.2.98"
|
|
86
86
|
}
|
|
87
87
|
],
|
|
88
88
|
"demo": {
|
|
89
89
|
"path": "docs/screenshots/en/demo.gif",
|
|
90
|
-
"sha256": "
|
|
90
|
+
"sha256": "77d04fbdcb3dc6352f172920827f02a345ad4af2b0eded70af2d706873019a41",
|
|
91
91
|
"width": 960,
|
|
92
92
|
"height": 540,
|
|
93
|
-
"capturedOn": "2026-11-
|
|
94
|
-
"sourceVersion": "0.2.
|
|
93
|
+
"capturedOn": "2026-11-10",
|
|
94
|
+
"sourceVersion": "0.2.98",
|
|
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.
|
|
11
|
+
| 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.98`<!-- /generated:version -->;当前 Workspace;企查查 OAuth 可用;测试账号具有目标企业数据权限 |
|
|
12
12
|
| 权限/管理员 | 账号权限、组织授权和可见字段由服务商控制;企业组织可能需要管理员开通,当前文档不能替代审批 |
|
|
13
13
|
| 费用 | 可能受套餐、次数或字段权限影响;MCP连接器无法确认本次费用,调用前在服务商侧核对 |
|
|
14
14
|
| 运行/数据去向 | 远程 MCP Server;企业名称、查询参数和调用结果经 DSH Host 发送到/返回自 `agent.qcc.com` |
|
package/lib/index.js
CHANGED
|
@@ -349,7 +349,7 @@ export async function apply(ctx, config) {
|
|
|
349
349
|
// A 304 also renews the cache freshness timestamp.
|
|
350
350
|
catalogWrite = catalogWrite.then(async () => {
|
|
351
351
|
if (catalogDisposed || controller.signal.aborted) return;
|
|
352
|
-
await catalogStore.putRemote({ etag: fetched.notModified ? cached.etag : fetched.etag, connectors });
|
|
352
|
+
await catalogStore.putRemote({ catalogUrl: config.catalogUrl, etag: fetched.notModified ? cached.etag : fetched.etag, connectors });
|
|
353
353
|
}).catch(() => {});
|
|
354
354
|
await catalogWrite;
|
|
355
355
|
}
|
|
@@ -397,7 +397,8 @@ export async function apply(ctx, config) {
|
|
|
397
397
|
const cached = await catalogStore.getRemote().catch(() => null);
|
|
398
398
|
let validCache;
|
|
399
399
|
try {
|
|
400
|
-
|
|
400
|
+
// Unlabelled legacy caches cannot be safely attributed to any source.
|
|
401
|
+
if (cached?.catalogUrl === config.catalogUrl && Array.isArray(cached.connectors)) {
|
|
401
402
|
const connectors = cached.connectors.map(raw => auditDescriptor(normalizeConnectorDescriptor(auditRawDescriptor(raw))));
|
|
402
403
|
validCache = { ...cached, connectors };
|
|
403
404
|
state.remoteConnectors = connectors;
|
package/lib/schema.js
CHANGED
|
@@ -255,6 +255,7 @@ export const grantRecordSchema = z.object({
|
|
|
255
255
|
export const catalogRecordSchema = z.object({
|
|
256
256
|
key: z.string(), // 'remote' | 'overrides'
|
|
257
257
|
updatedAt: z.number(),
|
|
258
|
+
catalogUrl: z.string().optional(),
|
|
258
259
|
etag: z.string().optional(),
|
|
259
260
|
connectors: z.array(z.unknown()),
|
|
260
261
|
});
|
package/lib/stores.js
CHANGED
|
@@ -146,8 +146,8 @@ export class CatalogStore {
|
|
|
146
146
|
return this.table.get('remote');
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
async putRemote({ etag, connectors }) {
|
|
150
|
-
const record = { key: 'remote', updatedAt: Date.now(), etag: etag ?? undefined, connectors };
|
|
149
|
+
async putRemote({ catalogUrl, etag, connectors }) {
|
|
150
|
+
const record = { key: 'remote', updatedAt: Date.now(), catalogUrl, etag: etag ?? undefined, connectors };
|
|
151
151
|
await this.table.put('remote', record);
|
|
152
152
|
return record;
|
|
153
153
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mcp-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.98",
|
|
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",
|
package/ui/index.html
CHANGED
|
@@ -90,6 +90,11 @@
|
|
|
90
90
|
.toolbar .search-box { flex: 1; width: auto; min-width: 80px; }
|
|
91
91
|
.toolbar .icon-btn { white-space: nowrap; padding-inline: 10px; min-height: 34px; }
|
|
92
92
|
.toolbar .compact-action { width: 34px; flex-shrink: 0; padding: 4px; font-size: 18px; }
|
|
93
|
+
.toolbar .first-use-action {
|
|
94
|
+
flex-shrink: 0; border-color: var(--accent);
|
|
95
|
+
background: var(--accent-light); color: var(--accent); font-weight: 650;
|
|
96
|
+
}
|
|
97
|
+
.toolbar .first-use-action:hover { border-color: var(--accent); color: var(--accent); }
|
|
93
98
|
.language-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
|
|
94
99
|
.language-switch { flex-shrink: 0; }
|
|
95
100
|
.language-switch button { min-height: 28px; padding: 3px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
|
|
@@ -222,6 +227,13 @@
|
|
|
222
227
|
|
|
223
228
|
/* Empty */
|
|
224
229
|
.empty { text-align: center; color: var(--muted); padding: 80px 0; font-size: 15px; }
|
|
230
|
+
.empty-action-card {
|
|
231
|
+
max-width: 640px; margin: 28px auto; padding: 24px; text-align: center;
|
|
232
|
+
border: 1px solid var(--line); background: var(--card); border-radius: 14px;
|
|
233
|
+
}
|
|
234
|
+
.empty-action-card strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 16px; }
|
|
235
|
+
.empty-action-card p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
|
|
236
|
+
.empty-action-card .actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
|
|
225
237
|
.migration-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #fbbf24; background: var(--warn-bg); border-radius: 10px; color: var(--text-2); }
|
|
226
238
|
.migration-banner .copy { flex: 1; min-width: 0; font-size: 12px; }
|
|
227
239
|
.migration-banner strong { display: block; color: var(--text); font-size: 13px; }
|
|
@@ -232,6 +244,14 @@
|
|
|
232
244
|
.community-cta-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; line-height: 1; padding: 2px 4px; }
|
|
233
245
|
.community-cta-close:hover { color: var(--text); }
|
|
234
246
|
.community-cta-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
|
|
247
|
+
.first-use-banner {
|
|
248
|
+
display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
|
|
249
|
+
margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--accent);
|
|
250
|
+
background: var(--accent-light); border-radius: 12px; color: var(--text-2);
|
|
251
|
+
}
|
|
252
|
+
.first-use-banner .copy { flex: 1 1 360px; min-width: 0; font-size: 12px; line-height: 1.55; }
|
|
253
|
+
.first-use-banner strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 14px; }
|
|
254
|
+
.first-use-banner .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
235
255
|
|
|
236
256
|
/* Detail Overlay */
|
|
237
257
|
.detail-overlay {
|
|
@@ -515,7 +535,7 @@
|
|
|
515
535
|
</div>
|
|
516
536
|
<button class="icon-btn primary" id="add-connection" type="button">+ 添加连接</button>
|
|
517
537
|
<button class="icon-btn compact-action" id="refresh" type="button" title="刷新连接器目录" aria-label="刷新连接器目录">↻</button>
|
|
518
|
-
<button class="icon-btn
|
|
538
|
+
<button class="icon-btn first-use-action" id="first-use" type="button" title="快速开始" aria-label="快速开始">▶ 快速开始</button>
|
|
519
539
|
</div>
|
|
520
540
|
<div class="market-nav" id="market-nav" aria-label="市场分类导航"></div>
|
|
521
541
|
</header>
|
|
@@ -643,6 +663,23 @@
|
|
|
643
663
|
"打开新会话失败,请检查工作区后重试": "Failed to open a new session. Check the workspace and retry.",
|
|
644
664
|
"本机连接统计": "Local connection statistics",
|
|
645
665
|
"首次使用": "Getting started",
|
|
666
|
+
"快速开始": "Quick start",
|
|
667
|
+
"▶ 快速开始": "▶ Quick start",
|
|
668
|
+
"第一次使用 MCP连接器?": "New to MCP Connector?",
|
|
669
|
+
"先从推荐连接器开始,查看详情并按服务商要求完成授权;连接成功后即可发现工具并在会话中使用。": "Start with a recommended connector, review its details, and complete provider authorization. Once connected, its tools become available in your sessions.",
|
|
670
|
+
"查看推荐连接器": "View recommended connectors",
|
|
671
|
+
"浏览推荐连接器": "Browse recommended connectors",
|
|
672
|
+
"查看首次使用步骤": "View getting-started steps",
|
|
673
|
+
"还没有连接任何 MCP": "No MCP connections yet",
|
|
674
|
+
"先选择一个推荐连接器,完成授权后即可在会话中发现并使用工具。": "Choose a recommended connector first. After authorization, its tools can be discovered and used in your sessions.",
|
|
675
|
+
"连接流程已完成": "Connection setup completed",
|
|
676
|
+
"下一步确认工具发现结果,再选择一个示例 Prompt。实际业务成功以工具真实返回为准。": "Next, confirm tool discovery and choose an example prompt. Actual business success requires a real tool result.",
|
|
677
|
+
"检查已发现工具": "Check discovered tools",
|
|
678
|
+
"查看示例 Prompt": "View example prompts",
|
|
679
|
+
"本机引导路径(不计算转化率)": "Local guidance path (no conversion rate)",
|
|
680
|
+
"快速开始打开 {count} 次 · 推荐入口打开 {recommended} 次": "Quick start opened {count} times · recommendations opened {recommended} times",
|
|
681
|
+
"本浏览器首次连接 {connected} 张卡片 · 已发现工具 {discovered} 张卡片": "First connection in this browser: {connected} cards · tools discovered: {discovered} cards",
|
|
682
|
+
"入口次数与卡片去重数口径不同,只用于本机排查,不上传且不计算转化率。": "Entry counts and deduplicated card counts use different denominators. They are for local troubleshooting only, are not uploaded, and are not used to calculate a conversion rate.",
|
|
646
683
|
"Host 未确认草稿写入": "The Host did not confirm the draft",
|
|
647
684
|
"读取状态失败,请稍后重试;不能据此判断授权或业务调用成功。": "Failed to read status. Retry later; this does not confirm authorization or a successful business call.",
|
|
648
685
|
"当前范围没有连接。请先到市场选择服务,或添加你自己的连接,并按服务商要求完成授权。": "No connections in this scope. Select a service in the market or add your own connection and complete provider authorization.",
|
|
@@ -1217,6 +1254,50 @@
|
|
|
1217
1254
|
},
|
|
1218
1255
|
}, null, 2);
|
|
1219
1256
|
|
|
1257
|
+
const LOCAL_CONVERSION_STORAGE_KEY = 'mcp-connector.local-conversion-v1';
|
|
1258
|
+
const emptyLocalConversion = () => ({ quickStartOpened: 0, recommendedOpened: 0, connectedConnectorIds: [], discoveredConnectorIds: [] });
|
|
1259
|
+
function readLocalConversion() {
|
|
1260
|
+
try {
|
|
1261
|
+
const raw = JSON.parse(window.localStorage.getItem(LOCAL_CONVERSION_STORAGE_KEY) || '{}');
|
|
1262
|
+
const count = (value) => Number.isSafeInteger(value) && value >= 0 ? Math.min(value, 1_000_000) : 0;
|
|
1263
|
+
const ids = (value) => [...new Set((Array.isArray(value) ? value : [])
|
|
1264
|
+
.filter((id) => typeof id === 'string' && id.length > 0 && id.length <= 256))].slice(0, 256);
|
|
1265
|
+
return {
|
|
1266
|
+
quickStartOpened: count(raw.quickStartOpened),
|
|
1267
|
+
recommendedOpened: count(raw.recommendedOpened),
|
|
1268
|
+
connectedConnectorIds: ids(raw.connectedConnectorIds),
|
|
1269
|
+
discoveredConnectorIds: ids(raw.discoveredConnectorIds),
|
|
1270
|
+
};
|
|
1271
|
+
} catch { return emptyLocalConversion(); }
|
|
1272
|
+
}
|
|
1273
|
+
function writeLocalConversion(value) {
|
|
1274
|
+
try { window.localStorage.setItem(LOCAL_CONVERSION_STORAGE_KEY, JSON.stringify(value)); return true; }
|
|
1275
|
+
catch { return false; }
|
|
1276
|
+
}
|
|
1277
|
+
function recordLocalConversion(stage, connectorId = '') {
|
|
1278
|
+
const value = readLocalConversion();
|
|
1279
|
+
if (stage === 'quickStartOpened') value.quickStartOpened = Math.min(1_000_000, value.quickStartOpened + 1);
|
|
1280
|
+
else if (stage === 'recommendedOpened') value.recommendedOpened = Math.min(1_000_000, value.recommendedOpened + 1);
|
|
1281
|
+
else if (['connectionSucceeded', 'toolDiscoverySucceeded'].includes(stage)) {
|
|
1282
|
+
const id = String(connectorId || '').trim();
|
|
1283
|
+
if (!id || id.length > 256) return false;
|
|
1284
|
+
const field = stage === 'connectionSucceeded' ? 'connectedConnectorIds' : 'discoveredConnectorIds';
|
|
1285
|
+
if (value[field].includes(id)) return false;
|
|
1286
|
+
if (value[field].length >= 256) return false;
|
|
1287
|
+
value[field].push(id);
|
|
1288
|
+
} else return false;
|
|
1289
|
+
return writeLocalConversion(value);
|
|
1290
|
+
}
|
|
1291
|
+
function localConversionSnapshot() {
|
|
1292
|
+
const value = readLocalConversion();
|
|
1293
|
+
return {
|
|
1294
|
+
quickStartOpened: value.quickStartOpened,
|
|
1295
|
+
recommendedOpened: value.recommendedOpened,
|
|
1296
|
+
connectedConnectors: value.connectedConnectorIds.length,
|
|
1297
|
+
discoveredConnectors: value.discoveredConnectorIds.length,
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1220
1301
|
let view = 'market';
|
|
1221
1302
|
let marketItems = {};
|
|
1222
1303
|
let searchQuery = '';
|
|
@@ -1644,6 +1725,17 @@
|
|
|
1644
1725
|
await window.__mcp.showDetail(connectorId);
|
|
1645
1726
|
}
|
|
1646
1727
|
|
|
1728
|
+
function openPostConnectionSuccess(connectorId) {
|
|
1729
|
+
openModal(t('连接流程已完成'), `<p>${t('下一步确认工具发现结果,再选择一个示例 Prompt。实际业务成功以工具真实返回为准。')}</p><div class="m-actions"><button class="btn ghost" type="button" onclick="window.__mcp.openConnectedTools(${jsString(connectorId)})">${t('检查已发现工具')}</button><button class="btn" type="button" onclick="window.__mcp.openConnectedPrompts(${jsString(connectorId)})">${t('查看示例 Prompt')}</button></div>`);
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
async function completeCatalogConnection(connectorId, { healthCheck = false } = {}) {
|
|
1733
|
+
const firstLocalSuccess = recordLocalConversion('connectionSucceeded', connectorId);
|
|
1734
|
+
if (healthCheck) await call('healthCheck', { connectorId });
|
|
1735
|
+
await refreshConnectionUi(connectorId);
|
|
1736
|
+
if (firstLocalSuccess) openPostConnectionSuccess(connectorId);
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1647
1739
|
// 详情主按钮:状态未知且已有连接记录时优先提供「重新连接」(Host 侧可能已放弃重连)
|
|
1648
1740
|
function detailTryLabel(fallback) {
|
|
1649
1741
|
return detailReconnectKey ? t('🔄 重新连接') : fallback;
|
|
@@ -2163,6 +2255,14 @@
|
|
|
2163
2255
|
document.querySelector('.community-cta')?.remove();
|
|
2164
2256
|
}
|
|
2165
2257
|
|
|
2258
|
+
function firstUseBannerHtml() {
|
|
2259
|
+
return `<aside class="first-use-banner" aria-label="${t('快速开始')}"><div class="copy"><strong>${t('第一次使用 MCP连接器?')}</strong>${t('先从推荐连接器开始,查看详情并按服务商要求完成授权;连接成功后即可发现工具并在会话中使用。')}</div><div class="actions"><button class="btn" type="button" data-first-use-action="recommended">${t('查看推荐连接器')}</button><button class="btn ghost" type="button" data-first-use-action="guide">${t('查看首次使用步骤')}</button></div></aside>`;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
function installedEmptyHtml() {
|
|
2263
|
+
return `<section class="empty-action-card"><strong>${t('还没有连接任何 MCP')}</strong><p>${t('先选择一个推荐连接器,完成授权后即可在会话中发现并使用工具。')}</p><div class="actions"><button class="btn" type="button" data-first-use-action="recommended">${t('浏览推荐连接器')}</button><button class="btn ghost" type="button" data-first-use-action="guide">${t('查看首次使用步骤')}</button></div></section>`;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2166
2266
|
function marketSectionHtml(value, label, items) {
|
|
2167
2267
|
if (!items.length) return '';
|
|
2168
2268
|
const expanded = value === 'recommended' || expandedMarketSections.has(value);
|
|
@@ -2212,7 +2312,8 @@
|
|
|
2212
2312
|
: filtered.length > 0
|
|
2213
2313
|
? `<div class="grid">${filtered.map(cardHtml).join('')}</div>`
|
|
2214
2314
|
: `<div class="empty">${t('没有匹配当前筛选条件的连接器')}</div>`;
|
|
2215
|
-
|
|
2315
|
+
const firstUseBanner = status.ok && (status.detail?.items ?? []).length === 0 && !marketCategory && !searchQuery ? firstUseBannerHtml() : '';
|
|
2316
|
+
main.innerHTML = `${firstUseBanner}${resultHtml}`;
|
|
2216
2317
|
if (preserveScroll) main.scrollTop = previousScrollTop;
|
|
2217
2318
|
if (checkHealth && !initialHealthCheckStarted && items.some((item) => item.connected?.length > 0)) {
|
|
2218
2319
|
initialHealthCheckStarted = true;
|
|
@@ -2375,7 +2476,7 @@
|
|
|
2375
2476
|
const pendingMigration = migration.ok ? migration.detail?.pendingCount || 0 : 0;
|
|
2376
2477
|
const migrationHtml = pendingMigration > 0 ? `<div class="migration-banner"><div class="copy"><strong>${t('发现旧企查查 MCP 授权')}</strong>${t('可安全复制 {count} 组授权到 MCP连接器;不会删除旧插件或原凭据。', { count: pendingMigration })}</div><button class="btn" type="button" onclick="window.__mcp.migrateLegacy()">${t('迁移')}</button></div>` : '';
|
|
2377
2478
|
if (!items.length) {
|
|
2378
|
-
main.innerHTML = `${migrationHtml}<div class="stats"><span class="count">${t('可从旧企查查 OAuth 插件复制已有授权')}</span><button class="btn ghost" type="button" onclick="window.__mcp.openConnectionStatistics()">${t('本机连接统计')}</button><button class="btn ghost" id="config-backup" type="button" onclick="window.__mcp.openConfigBackup()">${t('配置备份')}</button><button class="btn ghost" type="button" title="${t('扫描企查查旧 OAuth 插件;不会删除旧插件或原凭据')}" onclick="window.__mcp.scanLegacy()">${t('检测企查查旧授权')}</button></div
|
|
2479
|
+
main.innerHTML = `${migrationHtml}<div class="stats"><span class="count">${t('可从旧企查查 OAuth 插件复制已有授权')}</span><button class="btn ghost" type="button" onclick="window.__mcp.openConnectionStatistics()">${t('本机连接统计')}</button><button class="btn ghost" id="config-backup" type="button" onclick="window.__mcp.openConfigBackup()">${t('配置备份')}</button><button class="btn ghost" type="button" title="${t('扫描企查查旧 OAuth 插件;不会删除旧插件或原凭据')}" onclick="window.__mcp.scanLegacy()">${t('检测企查查旧授权')}</button></div>${installedEmptyHtml()}`;
|
|
2379
2480
|
if (preserveScroll) main.scrollTop = previousScrollTop;
|
|
2380
2481
|
return;
|
|
2381
2482
|
}
|
|
@@ -2709,8 +2810,7 @@
|
|
|
2709
2810
|
if (r.ok) {
|
|
2710
2811
|
markCommunityCtaEligible();
|
|
2711
2812
|
closeModal();
|
|
2712
|
-
await
|
|
2713
|
-
await refreshConnectionUi(connectorId);
|
|
2813
|
+
await completeCatalogConnection(connectorId, { healthCheck: true });
|
|
2714
2814
|
}
|
|
2715
2815
|
},
|
|
2716
2816
|
confirmConnect() {
|
|
@@ -2881,12 +2981,30 @@
|
|
|
2881
2981
|
openModal(t('本机连接统计'), `<p>${t("统计暂不可用,不影响连接。请检查 Host 日志。")}</p>`);
|
|
2882
2982
|
return;
|
|
2883
2983
|
}
|
|
2984
|
+
const local = localConversionSnapshot();
|
|
2884
2985
|
openModal(t('本机连接统计'), `<div class="form-note">${t('仅统计当前 profile,不是社区总量或独立用户数。数据保存在本机,不向外上传。')}${d.persistent ? '' : t('当前未启用持久化,重启后计数清空。')}</div>
|
|
2885
2986
|
<p>${t('成功连接过的卡片数')} <strong>${esc(d.cumulativeSuccessfulConnections)}</strong> · ${t('近 30 天首次连接的新卡片')} <strong>${esc(d.newSuccessfulConnections30d)}</strong></p>
|
|
2886
2987
|
<p>${t('历史已有连接基线:{count} 张卡片,未验证前不计成功,验证后也不计新增。', { count: esc(d.historicalBaseline) })}</p>
|
|
2887
2988
|
<p>${t("同一卡片只计一次;重启、升级、重新授权和重连不重复增加,断开不扣减。此处成功指连接流程完成,不代表业务调用成功。")}</p>
|
|
2989
|
+
<hr><p><strong>${t('本机引导路径(不计算转化率)')}</strong></p>
|
|
2990
|
+
<p>${t('快速开始打开 {count} 次 · 推荐入口打开 {recommended} 次', { count: esc(local.quickStartOpened), recommended: esc(local.recommendedOpened) })}</p>
|
|
2991
|
+
<p>${t('本浏览器首次连接 {connected} 张卡片 · 已发现工具 {discovered} 张卡片', { connected: esc(local.connectedConnectors), discovered: esc(local.discoveredConnectors) })}</p>
|
|
2992
|
+
<p class="field-help">${t('入口次数与卡片去重数口径不同,只用于本机排查,不上传且不计算转化率。')}</p>
|
|
2888
2993
|
<div>${(d.items || []).map(x => `<p><strong>${esc(x.connectorId)}</strong>:${x.cumulativeSuccessfulConnections ? t('已记录成功') : t('历史配置,待验证')}${x.historicalBaseline ? t(' · 历史基线') : ''}</p>`).join('') || t('尚无统计记录。')}</div>`);
|
|
2889
2994
|
},
|
|
2995
|
+
async openConnectedTools(connectorId) {
|
|
2996
|
+
closeModal();
|
|
2997
|
+
await window.__mcp.showDetail(connectorId);
|
|
2998
|
+
const disclosure = $('#tools-disclosure');
|
|
2999
|
+
if (disclosure) { disclosure.open = true; disclosure.scrollIntoView({ block: 'start' }); }
|
|
3000
|
+
$('#tools-search')?.focus();
|
|
3001
|
+
},
|
|
3002
|
+
async openConnectedPrompts(connectorId) {
|
|
3003
|
+
closeModal();
|
|
3004
|
+
await window.__mcp.showDetail(connectorId);
|
|
3005
|
+
$('#detail-prompts')?.scrollIntoView({ block: 'center' });
|
|
3006
|
+
$('#detail-prompts button')?.focus();
|
|
3007
|
+
},
|
|
2890
3008
|
async openConfigBackup() { await openConfigBackup(); },
|
|
2891
3009
|
async copyBackup() {
|
|
2892
3010
|
const text = $('#backup-json')?.value || '';
|
|
@@ -2968,7 +3086,7 @@
|
|
|
2968
3086
|
if (!r.ok) { showModalError(r.message); return; }
|
|
2969
3087
|
closeModal();
|
|
2970
3088
|
markCommunityCtaEligible();
|
|
2971
|
-
showToast(r.message, true); await
|
|
3089
|
+
showToast(r.message, true); await completeCatalogConnection(connectorId);
|
|
2972
3090
|
return;
|
|
2973
3091
|
}
|
|
2974
3092
|
const name = $('#cfg-name').value.trim();
|
|
@@ -3163,6 +3281,7 @@
|
|
|
3163
3281
|
$('#detail-try-btn').textContent = detailTryLabel(incomplete ? (d.authMode === 'oauth2-pkce' ? t('upgradeOauth') : t('completeSetup')) : t('try'));
|
|
3164
3282
|
renderPromptPage();
|
|
3165
3283
|
detailToolServers = toolsResult.detail?.servers || [];
|
|
3284
|
+
if (detailToolServers.some((server) => (server.tools || []).length > 0)) recordLocalConversion('toolDiscoverySucceeded', connectorId);
|
|
3166
3285
|
updateToolsSummary();
|
|
3167
3286
|
renderTools();
|
|
3168
3287
|
},
|
|
@@ -3278,8 +3397,7 @@
|
|
|
3278
3397
|
showToast(r.message, r.ok);
|
|
3279
3398
|
if (r.ok) {
|
|
3280
3399
|
markCommunityCtaEligible();
|
|
3281
|
-
await
|
|
3282
|
-
await refreshConnectionUi(id);
|
|
3400
|
+
await completeCatalogConnection(id, { healthCheck: true });
|
|
3283
3401
|
}
|
|
3284
3402
|
return;
|
|
3285
3403
|
}
|
|
@@ -3289,8 +3407,7 @@
|
|
|
3289
3407
|
showToast(r.message, r.ok);
|
|
3290
3408
|
if (r.ok) {
|
|
3291
3409
|
markCommunityCtaEligible();
|
|
3292
|
-
await
|
|
3293
|
-
await refreshConnectionUi(id);
|
|
3410
|
+
await completeCatalogConnection(id, { healthCheck: true });
|
|
3294
3411
|
}
|
|
3295
3412
|
return;
|
|
3296
3413
|
}
|
|
@@ -3440,7 +3557,27 @@
|
|
|
3440
3557
|
}
|
|
3441
3558
|
});
|
|
3442
3559
|
new ResizeObserver(updateCategoryArrows).observe($('#market-nav'));
|
|
3560
|
+
function showRecommendedMarket() {
|
|
3561
|
+
recordLocalConversion('recommendedOpened');
|
|
3562
|
+
view = 'market'; marketCategory = 'recommended';
|
|
3563
|
+
searchQuery = ''; searchInput.value = '';
|
|
3564
|
+
pendingViewScroll = null; main.scrollTop = 0;
|
|
3565
|
+
explorerSequence++; explorerDetailSequence++;
|
|
3566
|
+
syncTabs();
|
|
3567
|
+
loadMarket({ checkHealth: false });
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3443
3570
|
main.addEventListener('click', (event) => {
|
|
3571
|
+
const firstUseAction = event.target.closest('[data-first-use-action]');
|
|
3572
|
+
if (firstUseAction?.dataset.firstUseAction === 'recommended') {
|
|
3573
|
+
showRecommendedMarket();
|
|
3574
|
+
return;
|
|
3575
|
+
}
|
|
3576
|
+
if (firstUseAction?.dataset.firstUseAction === 'guide') {
|
|
3577
|
+
recordLocalConversion('quickStartOpened');
|
|
3578
|
+
openFirstUse();
|
|
3579
|
+
return;
|
|
3580
|
+
}
|
|
3444
3581
|
const sectionToggle = event.target.closest('[data-section-toggle]');
|
|
3445
3582
|
if (sectionToggle) {
|
|
3446
3583
|
const section = sectionToggle.dataset.sectionToggle;
|
|
@@ -3489,8 +3626,9 @@
|
|
|
3489
3626
|
setText('#tab-installed', '已安装');
|
|
3490
3627
|
setText('#tab-tools', '工具');
|
|
3491
3628
|
setText('#add-connection', '+ 添加连接');
|
|
3492
|
-
|
|
3493
|
-
$('#first-use').
|
|
3629
|
+
setText('#first-use', '▶ 快速开始');
|
|
3630
|
+
$('#first-use').title = t('快速开始');
|
|
3631
|
+
$('#first-use').setAttribute('aria-label', t('快速开始'));
|
|
3494
3632
|
setText('#prompt-title', '试试这样用');
|
|
3495
3633
|
setText('#prompt-next', '换一批');
|
|
3496
3634
|
setText('#tools-title', '工具详情');
|
|
@@ -3530,7 +3668,7 @@
|
|
|
3530
3668
|
window.location.assign(url.href);
|
|
3531
3669
|
});
|
|
3532
3670
|
syncTabs();
|
|
3533
|
-
$('#first-use').addEventListener('click', openFirstUse);
|
|
3671
|
+
$('#first-use').addEventListener('click', () => { recordLocalConversion('quickStartOpened'); openFirstUse(); });
|
|
3534
3672
|
if (viewStateReady) restoreViewState();
|
|
3535
3673
|
requestWorkspaceContext();
|
|
3536
3674
|
connectStatusEvents();
|