dsh-mcp-connector 0.2.82 → 0.2.84
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 +32 -1
- 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/README.md +21 -20
- package/docs/screenshots/assets.json +29 -29
- package/docs/tutorials/FIRST-SUCCESS-SCENARIOS.md +1 -1
- package/docs/tutorials/SHARING-AUTHOR-ASSETS.md +2 -4
- package/docs/tutorials/SHARING-KIT.md +1 -1
- package/lib/connection-statistics.js +111 -0
- package/lib/index.js +19 -0
- package/lib/stores.js +2 -0
- package/lib/web.js +1 -0
- package/package.json +6 -3
- package/ui/index.html +48 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);首个公开版本从 `0.1.0` 开始。
|
|
4
4
|
|
|
5
|
+
## [0.2.84] - 2026-10-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- PR #195:已安装页增加本机连接统计,以当前 profile 成功连接过的目录卡片为单位,明确区分历史基线与近 30 天首次连接的新卡片。
|
|
10
|
+
- 统计不包含社区总量、独立用户数或业务调用成功数,不上传数据。
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- 统计写入改为后台串行队列,增加超时、队列上限和释放保护;存储异常不阻塞连接返回或启动基线初始化。
|
|
15
|
+
- 撤回社区上报、汇总、参与开关与热门排序实验;本版本不部署统计后端。
|
|
16
|
+
|
|
17
|
+
### Verification
|
|
18
|
+
|
|
19
|
+
- 自动化覆盖去重、持久化恢复、基线、统计失败/挂起/晚到、队列上限、API 范围与 UI 文案。
|
|
20
|
+
- 发行素材使用无凭据 Mock 重新采集;CI、Mock 与 macOS 测试不代替 Windows Desktop 实机验收。
|
|
21
|
+
|
|
22
|
+
## [0.2.83] - 2026-10-26
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- #190 / PR #191:连接范围变更和回退的确认框限制最大高度,正文独立滚动,标题与确认、取消按钮保持可见;工具列表只展示前 12 项并注明总数。
|
|
27
|
+
- 不修改连接范围应用、回退、乐观锁或凭据处理语义。
|
|
28
|
+
|
|
29
|
+
### Documentation and verification
|
|
30
|
+
|
|
31
|
+
- 同步当前版本文档,并重新采集本版本无凭据 Mock 截图及 GIF;素材不代表真实授权或业务调用成功。
|
|
32
|
+
- macOS 浏览器组件验收覆盖 360×400、640×300、1000×720 视口、8 个 Server 各 125 个长工具名、正文滚动、键盘确认/取消及焦点恢复;不等同于 Windows Desktop 实机验收。
|
|
33
|
+
- #178、#181 保持开放,继续等待原报告者 Windows 复测。
|
|
34
|
+
|
|
5
35
|
## [0.2.82] - 2026-10-26
|
|
6
36
|
|
|
7
37
|
### Added
|
|
@@ -1097,7 +1127,8 @@
|
|
|
1097
1127
|
- 外部 URL 与导入 Header 执行安全校验。
|
|
1098
1128
|
- iframe 消息校验同源和消息来源。
|
|
1099
1129
|
|
|
1100
|
-
[Unreleased]: https://github.com/duhu2000/dsh-mcp-connector/compare/v0.2.
|
|
1130
|
+
[Unreleased]: https://github.com/duhu2000/dsh-mcp-connector/compare/v0.2.83...HEAD
|
|
1131
|
+
[0.2.83]: https://github.com/duhu2000/dsh-mcp-connector/compare/v0.2.82...v0.2.83
|
|
1101
1132
|
[0.2.82]: https://github.com/duhu2000/dsh-mcp-connector/compare/v0.2.81...v0.2.82
|
|
1102
1133
|
[0.2.48]: https://github.com/duhu2000/dsh-mcp-connector/compare/v0.2.47...v0.2.48
|
|
1103
1134
|
[0.2.47]: https://github.com/duhu2000/dsh-mcp-connector/compare/v0.2.46...v0.2.47
|
package/README.en.md
CHANGED
|
@@ -106,7 +106,7 @@ As of 2026-10-24, the public Registry publishes 112 connector descriptors. After
|
|
|
106
106
|
| Connection diagnostics and last-success cache | |
|
|
107
107
|
|  | |
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
<!-- generated:media -->Screenshots and GIF were captured from v0.2.84 (2026-10-29), using the credential-free Mock harness. They demonstrate UI, not real business acceptance; counts are fixtures. See [asset provenance](docs/screenshots/README.md).<!-- /generated:media -->
|
|
110
110
|
|
|
111
111
|
## Installation
|
|
112
112
|
|
|
@@ -231,7 +231,7 @@ npm run dev:ui
|
|
|
231
231
|
|
|
232
232
|
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.
|
|
233
233
|
|
|
234
|
-
The current public version is [`dsh-mcp-connector@0.2.
|
|
234
|
+
<!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.84`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.84](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.84).<!-- /generated:version -->
|
|
235
235
|
|
|
236
236
|
See [CHANGELOG.md](CHANGELOG.md) for version history and [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md) for the Desktop release checklist.
|
|
237
237
|
|
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ Desktop 需要完全退出并重新启动应用;Web 需要停止原 `dsh web`
|
|
|
108
108
|
| 连接诊断与最后成功缓存 | |
|
|
109
109
|
|  | |
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
<!-- generated:media -->截图与 GIF 采集自 v0.2.84(2026-10-29)无凭据 Mock 页面,展示界面而非真实业务验收;市场数量是测试夹具。来源与更新方法见 [素材说明](docs/screenshots/README.md)。<!-- /generated:media -->
|
|
112
112
|
|
|
113
113
|
## 安装
|
|
114
114
|
|
|
@@ -226,7 +226,7 @@ npm run dev:ui
|
|
|
226
226
|
|
|
227
227
|
公共 Registry 每次合并后会生成 `catalog-stats.json`;本仓库的定时工作流每小时同步中英文介绍和统计快照。npm 页面中的静态正文随版本发布更新,上方动态统计徽标则直接读取 Registry,可在不发布新 npm 版本时保持实时数量一致。
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.84`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.84](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.84)。<!-- /generated:version -->
|
|
230
230
|
|
|
231
231
|
版本能力与变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
232
232
|
Desktop 发版回归见 [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md)。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 产品截图与演示的来源及更新
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- generated:media -->本组 7 张截图和 GIF 均从 v0.2.84 于 2026-10-29 重新采集,未修改截图中的版本文字。<!-- /generated:media -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
全部素材由真实产品 UI 的无凭据 Mock harness 渲染:1280×720 浏览器视口、800px 产品面板、桌面两列卡片。顶部保留“无凭据 Mock”标识;目录数、连接数与工具数是演示夹具,不代表生产统计或真实授权、业务验收。不会读取用户 profile、调用服务商或上传业务数据。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- `03` 是 2026-09-06 从 `v0.2.37` 采集的历史工具发现快照。
|
|
9
|
-
- `05`、`06` 和 `../demo.gif` 是 2026-09-14 从 `v0.2.46` UI harness 采集的历史工具搜索、参数和演示素材。harness 中的目录数量、连接数量和工具数量属于测试夹具,不代表生产市场统计。
|
|
7
|
+
根目录 [screenshots.json](../../screenshots.json) 保持外部市场兼容的 7 张图片路径与顺序;[assets.json](assets.json) 是采集版本、日期、源码指纹、SHA-256、尺寸和 GIF 时长的唯一记录。
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
| 文件 | 内容 |
|
|
10
|
+
|---|---|
|
|
11
|
+
| 01-market-overview.jpg | 初始市场与未连接卡片 |
|
|
12
|
+
| 02-connector-detail.jpg | 连接器详情、权限与示例 |
|
|
13
|
+
| 03-tool-discovery.jpg | Mock 连接后的工具发现 |
|
|
14
|
+
| 04-json-import.jpg | JSON 导入与作用域 |
|
|
15
|
+
| 05-unified-tool-search.png | 跨连接工具查询 |
|
|
16
|
+
| 06-tool-parameters.png | 参数结构详情 |
|
|
17
|
+
| 07-connection-diagnostics.png | 模拟发现失败与诊断 |
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
`docs/demo.gif` 由当前截图状态顺序编码,仅缩放和调色,不修改版本号或连接状态。旧素材可通过 Git 历史查看,不继续用作当前产品首屏。
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|---|---|
|
|
17
|
-
| `01-market-overview.jpg` | `v0.2.73` 当前 Mock 市场:800px 面板、桌面两列、推荐章节和 9 分类;未连接企查查卡片显示“连接” |
|
|
18
|
-
| `02-connector-detail.jpg` | `v0.2.73` 当前 Mock OAuth 连接器详情:权限边界、试用 Prompt 和未连接工具状态 |
|
|
19
|
-
| `03-tool-discovery.jpg` | `v0.2.37` Context7 无凭据 Mock 健康状态、Mock 工具数量/描述、搜索和独立滚动区 |
|
|
20
|
-
| `04-json-import.jpg` | `v0.2.73` 当前 Mock Streamable HTTP / stdio JSON 导入、格式化、作用域和本机凭据提示 |
|
|
21
|
-
| `05-unified-tool-search.png` | `v0.2.46` 统一工具搜索:跨连接结果、来源、发现失败和最后成功缓存 |
|
|
22
|
-
| `06-tool-parameters.png` | `v0.2.46` 参数详情:必填、类型、枚举、嵌套结构和原始安全 Schema |
|
|
23
|
-
| `07-connection-diagnostics.png` | `v0.2.73` 当前 Mock 连接诊断:成功缓存、模拟网络与传输失败、建议、“检查连接”和“重新发现工具” |
|
|
21
|
+
## 更新与发布
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
GitHub Markdown 不执行变量。`package.json.version` 是版本唯一源,运行 `npm run docs:sync` 生成有标记的当前版本文案;历史 Changelog、验收日期、最低支持版本和已发布文章记录不作全局替换。
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
1. 修改版本或产品 UI 后,安装开发采集依赖:`npm install --no-save --legacy-peer-deps playwright@1.62.1`,并运行 `npx playwright install chromium`;另需 ffmpeg 和中文字体。
|
|
26
|
+
2. 执行 `npm run storefront:capture`。脚本只启动随机回环端口,隔离浏览器不加载外部资源;支持 `CHROMIUM_EXECUTABLE` 指定本机 Chromium,`PLAYWRIGHT_MODULE` 指定开发依赖路径。
|
|
27
|
+
3. 执行 `npm run docs:sync && npm run storefront:freshness && npm run check`,人工查看全部截图及 GIF,再随 PR 提交。不要仅修改 assets.json 的版本或日期。
|
|
28
|
+
4. Release 工作流在发布前验证采集版本、源码指纹和 14 天有效期;旧图不会静默进入新的正式版本。先准备素材再打 Tag,不在不可变 Tag 上改图。
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
产品素材工作流在 UI 主线更新、正式 Release 后、每周及手动触发时检查;需要更新时生成截图与文案,并更新同一个维护 PR。自动化只提出 PR,不自动合并,不向社交平台发布。GitHub/npm/CDN 缓存可能延迟,外部市场同步仍需复核。
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"capture": {
|
|
4
|
-
"capturedOn": "2026-10-
|
|
5
|
-
"sourceVersion": "0.2.
|
|
4
|
+
"capturedOn": "2026-10-29",
|
|
5
|
+
"sourceVersion": "0.2.84",
|
|
6
|
+
"sourceFingerprint": "4182e235bc910727b4741fdbf148e8052f6a2c8344353cb021c68877208a7403",
|
|
6
7
|
"browserViewport": {
|
|
7
8
|
"width": 1280,
|
|
8
9
|
"height": 720
|
|
@@ -10,74 +11,73 @@
|
|
|
10
11
|
"productPanelWidth": 800,
|
|
11
12
|
"desktopCardColumns": 2,
|
|
12
13
|
"state": "credential-free-mock",
|
|
13
|
-
"
|
|
14
|
-
"notes": "01, 02, 04 and 07 were captured from the v0.2.73 credential-free UI harness on 2026-10-16; 03 preserves the 2026-09-06 v0.2.37 snapshot; 05, 06 and demo.gif preserve the 2026-09-14 v0.2.46 harness capture."
|
|
14
|
+
"notes": "All assets re-rendered from the current credential-free harness; no production profile, credentials or provider calls."
|
|
15
15
|
},
|
|
16
16
|
"screenshots": [
|
|
17
17
|
{
|
|
18
18
|
"path": "docs/screenshots/01-market-overview.jpg",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "8a5f91ca890db8d1687579e3740fa2e9097f50ae75a6804661da10c8e2cc1d2b",
|
|
20
20
|
"width": 1280,
|
|
21
21
|
"height": 720,
|
|
22
|
-
"capturedOn": "2026-10-
|
|
23
|
-
"sourceVersion": "0.2.
|
|
22
|
+
"capturedOn": "2026-10-29",
|
|
23
|
+
"sourceVersion": "0.2.84"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "docs/screenshots/02-connector-detail.jpg",
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "1df1ca2e1e38234257ee9d76253b3229e7892fcfe1349baa8785266a46eb111d",
|
|
28
28
|
"width": 1280,
|
|
29
29
|
"height": 720,
|
|
30
|
-
"capturedOn": "2026-10-
|
|
31
|
-
"sourceVersion": "0.2.
|
|
30
|
+
"capturedOn": "2026-10-29",
|
|
31
|
+
"sourceVersion": "0.2.84"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"path": "docs/screenshots/03-tool-discovery.jpg",
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "20c6feb645fb81cbf78329ef82fa3c4a48dbeb664c80aa41fe5b1a9dbe2d6ea6",
|
|
36
36
|
"width": 1280,
|
|
37
37
|
"height": 720,
|
|
38
|
-
"capturedOn": "2026-
|
|
39
|
-
"sourceVersion": "0.2.
|
|
38
|
+
"capturedOn": "2026-10-29",
|
|
39
|
+
"sourceVersion": "0.2.84"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "docs/screenshots/04-json-import.jpg",
|
|
43
|
-
"sha256": "
|
|
43
|
+
"sha256": "6f29ec8029c57e5475798dd07d69cdc13820ae92a019bc16bfa67ca207f68e18",
|
|
44
44
|
"width": 1280,
|
|
45
45
|
"height": 720,
|
|
46
|
-
"capturedOn": "2026-10-
|
|
47
|
-
"sourceVersion": "0.2.
|
|
46
|
+
"capturedOn": "2026-10-29",
|
|
47
|
+
"sourceVersion": "0.2.84"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"path": "docs/screenshots/05-unified-tool-search.png",
|
|
51
|
-
"sha256": "
|
|
51
|
+
"sha256": "c2d5b02508dc9b3eae15b77ba76fbb2b45cacf3e244c78b0430b0020109cf3ce",
|
|
52
52
|
"width": 1280,
|
|
53
53
|
"height": 720,
|
|
54
|
-
"capturedOn": "2026-
|
|
55
|
-
"sourceVersion": "0.2.
|
|
54
|
+
"capturedOn": "2026-10-29",
|
|
55
|
+
"sourceVersion": "0.2.84"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"path": "docs/screenshots/06-tool-parameters.png",
|
|
59
|
-
"sha256": "
|
|
59
|
+
"sha256": "ecf4780ecb0f2da908419e4137e3945f159ff4b1adad8e55ee587048aef5c1a7",
|
|
60
60
|
"width": 1280,
|
|
61
61
|
"height": 720,
|
|
62
|
-
"capturedOn": "2026-
|
|
63
|
-
"sourceVersion": "0.2.
|
|
62
|
+
"capturedOn": "2026-10-29",
|
|
63
|
+
"sourceVersion": "0.2.84"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"path": "docs/screenshots/07-connection-diagnostics.png",
|
|
67
|
-
"sha256": "
|
|
67
|
+
"sha256": "f69df9eba4d3dc9b7f5100dc5479ec9c1fbf30ddf469a2e0e7942cde23132361",
|
|
68
68
|
"width": 1280,
|
|
69
69
|
"height": 720,
|
|
70
|
-
"capturedOn": "2026-10-
|
|
71
|
-
"sourceVersion": "0.2.
|
|
70
|
+
"capturedOn": "2026-10-29",
|
|
71
|
+
"sourceVersion": "0.2.84"
|
|
72
72
|
}
|
|
73
73
|
],
|
|
74
74
|
"demo": {
|
|
75
75
|
"path": "docs/demo.gif",
|
|
76
|
-
"sha256": "
|
|
76
|
+
"sha256": "5f92ba8ea94ae1c42999c198cfdb8f9737ff6845b936a78804385d05fc88d223",
|
|
77
77
|
"width": 960,
|
|
78
78
|
"height": 540,
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
79
|
+
"capturedOn": "2026-10-29",
|
|
80
|
+
"sourceVersion": "0.2.84",
|
|
81
|
+
"durationSeconds": 36
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| 项目 | 验收要求 |
|
|
10
10
|
|---|---|
|
|
11
|
-
| 前提 |
|
|
11
|
+
| 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.84`<!-- /generated:version -->;当前 Workspace;企查查 OAuth 可用;测试账号具有目标企业数据权限 |
|
|
12
12
|
| 权限/管理员 | 账号权限、组织授权和可见字段由服务商控制;企业组织可能需要管理员开通,当前文档不能替代审批 |
|
|
13
13
|
| 费用 | 可能受套餐、次数或字段权限影响;MCP连接器无法确认本次费用,调用前在服务商侧核对 |
|
|
14
14
|
| 运行/数据去向 | 远程 MCP Server;企业名称、查询参数和调用结果经 DSH Host 发送到/返回自 `agent.qcc.com` |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
| 素材 | 证据类别 | 已证明 | 未证明 | 公开使用边界 |
|
|
8
8
|
|---|---|---|---|---|
|
|
9
|
-
| [企业简介首次成功案例](ONE-SUCCESS-CASE.md) | 历史真实只读调用的脱敏摘要 | 2026-10-16 已有 `qcc-company` 连接完成一次 `get_company_profile` 只读调用,返回主体名称一致 |
|
|
9
|
+
| [企业简介首次成功案例](ONE-SUCCESS-CASE.md) | 历史真实只读调用的脱敏摘要 | 2026-10-16 已有 `qcc-company` 连接完成一次 `get_company_profile` 只读调用,返回主体名称一致 | 当前版本流程、首次安装、首次 OAuth、JSON 迁移、连接恢复 | 可引用文档中的脱敏结论;不得复制原始业务正文、账号或凭据 |
|
|
10
10
|
| [JSON 迁移教程](JSON-MIGRATION.md) | 流程文档 + localhost/合成测试 | 导入标准化、连接记录、Host 透传等代码路径有自动化覆盖 | 获授权真实 Server 的导入、发现和业务调用端到端成功 | 必须写“自动测试通过;真实 E2E 未测试/待验收” |
|
|
11
11
|
| [工具查找与恢复教程](TOOL-SEARCH-RECOVERY.md) | 流程文档 + localhost/合成测试 | 失败保留最后成功缓存、重新发现恢复、筛选/分页/限流等代码路径有自动化覆盖 | 真实连接从故障到恢复,以及恢复后的真实业务调用 | 缓存、健康检查和重新发现都不能写成业务调用成功 |
|
|
12
12
|
| [社区分享素材包](SHARING-KIT.md) | 作者指引 | 提供可复现提纲、披露和人工记录方法 | 尚未发生的发帖、转化或业务成功 | 不要求好评、Star 或转发;当前没有自动公开发布 |
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
| 资产 | 来源版本 | 可以说明 | 不能说明 | 建议图注 |
|
|
19
19
|
|---|---|---|---|---|
|
|
20
|
-
| `01`、`
|
|
21
|
-
| `03` | v0.2.37 | 历史工具发现界面 | 当前版本行为或业务可用性 | “历史界面演示,v0.2.37 无凭据 Mock。” |
|
|
22
|
-
| `05`、`06`、`demo.gif` | v0.2.46 | 历史统一搜索、参数和演示流程 | 当前版本行为、真实恢复或业务成功 | “历史界面演示,v0.2.46 无凭据 Mock。” |
|
|
20
|
+
| `01`–`07`、`demo.gif` | 见 [assets.json](../screenshots/assets.json) | 无凭据 Mock 界面与操作流程 | 真实授权、真实恢复或业务成功 | 引用素材清单中的采集版本与日期,标注“无凭据 Mock”。 |
|
|
23
21
|
|
|
24
22
|
`workspace/p0-evidence-2026-10-16/` 中的图片是本机真实 DSH Market 搜索页面,但仅用于搜索排名复核,未上传公共仓库且仍需隐私审查;它们不能证明连接、恢复或业务调用成功。
|
|
25
23
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
## 图片与视频素材
|
|
20
20
|
|
|
21
|
-
使用[截图目录及来源说明](../screenshots/README.md),不要重制或抹掉 Mock
|
|
21
|
+
使用[截图目录及来源说明](../screenshots/README.md),不要重制或抹掉 Mock 标记。采集版本与日期统一以[素材清单](../screenshots/assets.json)为准;不能把界面演示当作真实调用截图。
|
|
22
22
|
|
|
23
23
|
可用图注:“MCP连接器界面演示,Mock 数据;素材版本见来源说明,实际界面以安装版本为准。”
|
|
24
24
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Local, profile-scoped facts. No network, account IDs, credentials or business data. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const connectionStatisticSchema = z.object({
|
|
4
|
+
connectorId: z.string().min(1).max(256),
|
|
5
|
+
firstObservedAt: z.number().int().nonnegative(),
|
|
6
|
+
baseline: z.boolean(),
|
|
7
|
+
firstSuccessAt: z.number().int().nonnegative().nullable(),
|
|
8
|
+
});
|
|
9
|
+
export class ConnectionStatistics {
|
|
10
|
+
constructor(table, { now = Date.now, timeoutMs = 1000, maxPending = 128 } = {}) {
|
|
11
|
+
this.table = table;
|
|
12
|
+
this.now = now;
|
|
13
|
+
this.records = new Map();
|
|
14
|
+
this.queue = Promise.resolve();
|
|
15
|
+
this.available = true;
|
|
16
|
+
this.timeoutMs = timeoutMs;
|
|
17
|
+
this.maxPending = maxPending;
|
|
18
|
+
this.pending = 0;
|
|
19
|
+
}
|
|
20
|
+
async load() {
|
|
21
|
+
for (const [key, raw] of this.table.entries()) {
|
|
22
|
+
const result = connectionStatisticSchema.safeParse(raw);
|
|
23
|
+
if (!result.success || key !== result.data.connectorId) throw Error('Invalid connection statistics');
|
|
24
|
+
this.records.set(key, result.data);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
write(action) {
|
|
28
|
+
if (!this.available) return Promise.resolve();
|
|
29
|
+
if (this.pending >= this.maxPending) {
|
|
30
|
+
this.available = false;
|
|
31
|
+
return Promise.reject(Error('Statistics queue full'));
|
|
32
|
+
}
|
|
33
|
+
this.pending++;
|
|
34
|
+
const pending = this.queue.catch(() => {}).then(async () => {
|
|
35
|
+
if (!this.available) return;
|
|
36
|
+
let timer;
|
|
37
|
+
try {
|
|
38
|
+
await Promise.race([
|
|
39
|
+
Promise.resolve().then(action),
|
|
40
|
+
new Promise((_, reject) => {
|
|
41
|
+
timer = setTimeout(() => reject(Error('Statistics timeout')), this.timeoutMs);
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
this.available = false;
|
|
46
|
+
throw error;
|
|
47
|
+
} finally {
|
|
48
|
+
clearTimeout(timer);
|
|
49
|
+
}
|
|
50
|
+
}).finally(() => { this.pending--; });
|
|
51
|
+
this.queue = pending;
|
|
52
|
+
return pending;
|
|
53
|
+
}
|
|
54
|
+
dispose() { this.available = false; }
|
|
55
|
+
async put(record) {
|
|
56
|
+
// Publish memory only after durable storage succeeds.
|
|
57
|
+
const safe = connectionStatisticSchema.parse(record);
|
|
58
|
+
await this.table.put(safe.connectorId, safe);
|
|
59
|
+
if (this.available) this.records.set(safe.connectorId, safe);
|
|
60
|
+
}
|
|
61
|
+
baseline(ids) {
|
|
62
|
+
return this.write(async () => {
|
|
63
|
+
for (const id of new Set(ids)) {
|
|
64
|
+
if (!this.available) return;
|
|
65
|
+
if (!this.records.has(id)) await this.put({ connectorId: id, firstObservedAt: this.now(), baseline: true, firstSuccessAt: null });
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
success(id) {
|
|
70
|
+
return this.write(async () => {
|
|
71
|
+
const existing = this.records.get(id);
|
|
72
|
+
if (existing?.firstSuccessAt != null) return;
|
|
73
|
+
await this.put({ connectorId: id, firstObservedAt: existing?.firstObservedAt ?? this.now(), baseline: existing?.baseline ?? false, firstSuccessAt: this.now() });
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
snapshot() {
|
|
77
|
+
const cutoff = this.now() - 30 * 86400000;
|
|
78
|
+
const items = [...this.records.values()].map(r => ({
|
|
79
|
+
connectorId: r.connectorId,
|
|
80
|
+
cumulativeSuccessfulConnections: r.firstSuccessAt == null ? 0 : 1,
|
|
81
|
+
newSuccessfulConnections30d: !r.baseline && r.firstSuccessAt != null && r.firstSuccessAt >= cutoff ? 1 : 0,
|
|
82
|
+
historicalBaseline: r.baseline,
|
|
83
|
+
}));
|
|
84
|
+
return { scope: 'local-profile', reportingEnabled: false, available: this.available,
|
|
85
|
+
cumulativeSuccessfulConnections: items.reduce((n, r) => n + r.cumulativeSuccessfulConnections, 0),
|
|
86
|
+
newSuccessfulConnections30d: items.reduce((n, r) => n + r.newSuccessfulConnections30d, 0),
|
|
87
|
+
historicalBaseline: items.filter(r => r.historicalBaseline).length, items };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Wrap final outcomes, not saves: rollback, cancelled OAuth and validation errors never count. */
|
|
92
|
+
export function observeConnectionSuccess(api, statistics, { known, onError = () => {} }) {
|
|
93
|
+
let warned = false;
|
|
94
|
+
const report = () => {
|
|
95
|
+
if (warned) return;
|
|
96
|
+
warned = true;
|
|
97
|
+
try { onError(); } catch { /* Diagnostics must never break connections. */ }
|
|
98
|
+
};
|
|
99
|
+
for (const method of ['connect', 'configure']) {
|
|
100
|
+
const action = api[method];
|
|
101
|
+
api[method] = async function (...args) {
|
|
102
|
+
const id = method === 'connect' ? args[0] : args[0]?.connectorId;
|
|
103
|
+
const result = await action.apply(this, args);
|
|
104
|
+
if (statistics.available && result?.ok === true && typeof id === 'string' && known(id)) {
|
|
105
|
+
// Optional bookkeeping must not delay the successful connection response.
|
|
106
|
+
void statistics.success(id).catch(report);
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* export_config / snapshots / install_from_url / status / rename / set_enabled /
|
|
12
12
|
* disconnect / refresh_catalog / publish / tools_list / tool_search / tool_detail
|
|
13
13
|
*/
|
|
14
|
+
import { ConnectionStatistics, observeConnectionSuccess } from './connection-statistics.js';
|
|
14
15
|
import { randomUUID } from 'node:crypto';
|
|
15
16
|
import z from '@deepseek-ai/schemastery';
|
|
16
17
|
import {
|
|
@@ -155,6 +156,13 @@ export async function apply(ctx, config) {
|
|
|
155
156
|
});
|
|
156
157
|
|
|
157
158
|
const connectionStore = new ConnectionStore(domain);
|
|
159
|
+
const statisticTable = config.persistSecrets ? domain.tables.get('connection_statistics') : new Map();
|
|
160
|
+
const connectionStatistics = new ConnectionStatistics(config.persistSecrets ? statisticTable : {
|
|
161
|
+
entries: () => statisticTable.entries(), put: async (key, value) => statisticTable.set(key, value),
|
|
162
|
+
});
|
|
163
|
+
const statisticsError = () => logger.warn('Local connection statistics unavailable; connection behavior is unchanged');
|
|
164
|
+
try { await connectionStatistics.load(); }
|
|
165
|
+
catch { connectionStatistics.available = false; statisticsError(); }
|
|
158
166
|
const grantStore = new GrantStore(domain, {
|
|
159
167
|
// 只有真实持久化模式才启用跨进程 Grant journal。测试可通过内部字段
|
|
160
168
|
// 传入临时目录,不让 fake storage 触碰用户真实 $DSH_HOME。
|
|
@@ -1689,6 +1697,9 @@ export async function apply(ctx, config) {
|
|
|
1689
1697
|
/* ───────────────────────── api 门面 ───────────────────────── */
|
|
1690
1698
|
|
|
1691
1699
|
const api = {
|
|
1700
|
+
async connectionStatistics() {
|
|
1701
|
+
return { ok: true, detail: { ...connectionStatistics.snapshot(), persistent: config.persistSecrets === true }, message: '本 profile 成功连接过的卡片数;不是连接次数或社区总量,不上传数据' };
|
|
1702
|
+
},
|
|
1692
1703
|
async versionStatus(force = false) {
|
|
1693
1704
|
const detail = versionStatusService.status({ force });
|
|
1694
1705
|
let message = `当前版本 v${detail.installedVersion}`;
|
|
@@ -3375,6 +3386,9 @@ export async function apply(ctx, config) {
|
|
|
3375
3386
|
logger.warn(`skip invalid stored connection "${key}": ${error.message}`);
|
|
3376
3387
|
}
|
|
3377
3388
|
}
|
|
3389
|
+
if (connectionStatistics.available) void connectionStatistics.baseline([...state.connections.values()]
|
|
3390
|
+
.map(record => record.connectorId).filter(id => state.merged.some(d => d.id === id)))
|
|
3391
|
+
.catch(() => { statisticsError(); });
|
|
3378
3392
|
if (config.persistSecrets) {
|
|
3379
3393
|
for (const [key, cached] of await toolCatalogStore.entries().catch(() => [])) {
|
|
3380
3394
|
const record = state.connections.get(key);
|
|
@@ -3528,6 +3542,10 @@ export async function apply(ctx, config) {
|
|
|
3528
3542
|
return result;
|
|
3529
3543
|
};
|
|
3530
3544
|
} });
|
|
3545
|
+
observeConnectionSuccess(api, connectionStatistics, {
|
|
3546
|
+
known: id => state.merged.some(d => d.id === id) && !state.dynamic.has(id),
|
|
3547
|
+
onError: statisticsError,
|
|
3548
|
+
});
|
|
3531
3549
|
const observableApi = observeStatusEvents(discoveryApi, statusEvents);
|
|
3532
3550
|
scheduleDiscovery();
|
|
3533
3551
|
const discoveryInterval = setInterval(() => {
|
|
@@ -3551,6 +3569,7 @@ export async function apply(ctx, config) {
|
|
|
3551
3569
|
}
|
|
3552
3570
|
|
|
3553
3571
|
ctx.effect(() => () => {
|
|
3572
|
+
connectionStatistics.dispose();
|
|
3554
3573
|
discoveryDisposed = true;
|
|
3555
3574
|
clearTimeout(discoveryTimer);
|
|
3556
3575
|
clearInterval(discoveryInterval);
|
package/lib/stores.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* OAuth grant 同步写入本机受限权限 journal,防止多 Host 的整文件
|
|
5
5
|
* last-write-wins 覆盖新轮换 Token;凭证不进入 loader 配置树或日志。
|
|
6
6
|
*/
|
|
7
|
+
import { connectionStatisticSchema } from './connection-statistics.js';
|
|
7
8
|
import { defineDomain, domainTable } from '@deepseek-ai/dsh-storage-domain';
|
|
8
9
|
import { connectionRecordSchema, connectionScopeDocumentSchema, connectionSnapshotSchema, governancePolicySchema, grantRecordSchema, catalogRecordSchema, toolCatalogRecordSchema } from './schema.js';
|
|
9
10
|
import { DEFAULT_ACCOUNT } from './constants.js';
|
|
@@ -23,6 +24,7 @@ export function defineConnectorDomain() {
|
|
|
23
24
|
governance: domainTable(governancePolicySchema),
|
|
24
25
|
connection_scopes: domainTable(connectionScopeDocumentSchema),
|
|
25
26
|
tool_catalog: domainTable(toolCatalogRecordSchema),
|
|
27
|
+
connection_statistics: domainTable(connectionStatisticSchema),
|
|
26
28
|
},
|
|
27
29
|
});
|
|
28
30
|
}
|
package/lib/web.js
CHANGED
|
@@ -35,6 +35,7 @@ const API_WHITELIST = new Map([
|
|
|
35
35
|
['applyConnectionScope', (api, p) => api.applyConnectionScope(p ?? {})],
|
|
36
36
|
['previewConnectionScopeRollback', (api, p) => api.previewConnectionScopeRollback(p?.rollbackRevision)],
|
|
37
37
|
['rollbackConnectionScope', (api, p) => api.rollbackConnectionScope(p?.rollbackRevision, p?.expectedRevision)],
|
|
38
|
+
['connectionStatistics', (api) => api.connectionStatistics()],
|
|
38
39
|
['catalog', (api, p) => api.catalog(p ?? {})],
|
|
39
40
|
['templateCatalogReferences', (api) => api.templateCatalogReferences()],
|
|
40
41
|
['status', (api, p) => api.status(p ?? {})],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mcp-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.84",
|
|
4
4
|
"description": "DeepSeek Harness MCP Connector: connect servers, search tools across active connections, and troubleshoot discovery. Includes a continuously updated catalog; supports OAuth 2.0 PKCE, API keys, Streamable HTTP/stdio, and mcpServers JSON import.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"market:check": "node scripts/check-market-registration.mjs",
|
|
56
56
|
"distribution:check:live": "node scripts/check-distribution-sync.mjs --strict-sync",
|
|
57
57
|
"registry:stats:sync": "node scripts/sync-registry-stats.mjs",
|
|
58
|
-
"docs:check": "node scripts/check-readme-version.mjs",
|
|
58
|
+
"docs:check": "node scripts/check-readme-version.mjs && node scripts/sync-product-docs.mjs --check",
|
|
59
59
|
"docs:first-use:check": "node scripts/check-first-use-docs.mjs",
|
|
60
60
|
"marketing:check": "node scripts/check-marketing-metadata.mjs",
|
|
61
61
|
"marketing:check:github": "node scripts/check-marketing-metadata.mjs --live-github",
|
|
@@ -65,7 +65,10 @@
|
|
|
65
65
|
"verify-pack": "node scripts/verify-pack.mjs",
|
|
66
66
|
"docs:tutorial-links:check": "node scripts/check-tutorial-links.mjs",
|
|
67
67
|
"check": "npm run lint && npm run docs:check && npm run docs:first-use:check && npm run marketing:check && npm run storefront:check && npm test && npm run verify-pack && npm run docs:tutorial-links:check",
|
|
68
|
-
"prepublishOnly": "npm run check"
|
|
68
|
+
"prepublishOnly": "npm run check",
|
|
69
|
+
"docs:sync": "node scripts/sync-product-docs.mjs",
|
|
70
|
+
"storefront:capture": "node scripts/capture-storefront.mjs",
|
|
71
|
+
"storefront:freshness": "node scripts/check-media-freshness.mjs"
|
|
69
72
|
},
|
|
70
73
|
"keywords": [
|
|
71
74
|
"deepseek-harness",
|
package/ui/index.html
CHANGED
|
@@ -389,12 +389,22 @@
|
|
|
389
389
|
/* 页面内确认框(替代原生 confirm)。原生 confirm 在桌面壳里走 Win32 TaskDialog,
|
|
390
390
|
关闭后不会把键盘焦点还给页面,用户必须切一次窗口才能继续输入;因此所有确认
|
|
391
391
|
都改走这里。z-index 高于 .modal(200),因为多处确认是在模态内部触发的。 */
|
|
392
|
-
|
|
392
|
+
/* 遮罩本身可滚动兜底:内容再高也能滚到按钮,不会把确认框顶出视口。 */
|
|
393
|
+
.confirm-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.52); display: none; align-items: center; justify-content: center; z-index: 300; overflow-y: auto; padding: 24px 0; }
|
|
393
394
|
.confirm-mask.show { display: flex; }
|
|
394
|
-
|
|
395
|
-
.confirm-box
|
|
396
|
-
|
|
397
|
-
|
|
395
|
+
/* 弹窗自身限高并内部滚动,操作按钮始终可见(工具清单可能有上百条)。 */
|
|
396
|
+
.confirm-box {
|
|
397
|
+
background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
|
|
398
|
+
padding: 22px 24px; width: 460px; max-width: 92vw; box-shadow: var(--shadow-lg);
|
|
399
|
+
max-height: calc(100vh - 48px); display: flex; flex-direction: column;
|
|
400
|
+
}
|
|
401
|
+
.confirm-box h3 { margin: 0 0 12px; font-size: 15px; flex: 0 0 auto; }
|
|
402
|
+
.confirm-message {
|
|
403
|
+
margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--text-2); font-size: 13px; line-height: 1.6;
|
|
404
|
+
flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
|
|
405
|
+
padding-right: 4px;
|
|
406
|
+
}
|
|
407
|
+
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex: 0 0 auto; }
|
|
398
408
|
|
|
399
409
|
.modal .m-actions {
|
|
400
410
|
position: sticky; bottom: 0; z-index: 2;
|
|
@@ -1372,6 +1382,21 @@
|
|
|
1372
1382
|
pending.resolve(result);
|
|
1373
1383
|
}
|
|
1374
1384
|
|
|
1385
|
+
// 工具清单可能上百条:只列前若干项再补计数,避免确认框里堆一屏工具名。
|
|
1386
|
+
const SCOPE_TOOLS_INLINE_LIMIT = 12;
|
|
1387
|
+
|
|
1388
|
+
function scopeAffectedText(servers) {
|
|
1389
|
+
return (servers || []).map((server) => {
|
|
1390
|
+
const tools = server.tools || [];
|
|
1391
|
+
if (!tools.length) return `${server.serverName}:工具清单尚未观察`;
|
|
1392
|
+
const shown = tools.slice(0, SCOPE_TOOLS_INLINE_LIMIT).join('、');
|
|
1393
|
+
const rest = tools.length > SCOPE_TOOLS_INLINE_LIMIT
|
|
1394
|
+
? `、…等共 ${tools.length} 个`
|
|
1395
|
+
: '';
|
|
1396
|
+
return `${server.serverName}:${shown}${rest}`;
|
|
1397
|
+
}).join('\n');
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1375
1400
|
function confirmDialog(options = {}) {
|
|
1376
1401
|
// 后到的确认先让前一个以"取消"收尾,避免它的 await 永远挂起。
|
|
1377
1402
|
if (activeConfirm) closeConfirm(false);
|
|
@@ -1695,14 +1720,14 @@
|
|
|
1695
1720
|
const pendingMigration = migration.ok ? migration.detail?.pendingCount || 0 : 0;
|
|
1696
1721
|
const migrationHtml = pendingMigration > 0 ? `<div class="migration-banner"><div class="copy"><strong>发现旧企查查 MCP 授权</strong>可安全复制 ${pendingMigration} 组授权到 MCP连接器;不会删除旧插件或原凭据。</div><button class="btn" type="button" onclick="window.__mcp.migrateLegacy()">迁移</button></div>` : '';
|
|
1697
1722
|
if (!items.length) {
|
|
1698
|
-
main.innerHTML = `${migrationHtml}<div class="stats"><span class="count">可从旧企查查 OAuth 插件复制已有授权</span><button class="btn ghost" id="config-backup" type="button" onclick="window.__mcp.openConfigBackup()">配置备份</button><button class="btn ghost" type="button" title="扫描企查查旧 OAuth 插件;不会删除旧插件或原凭据" onclick="window.__mcp.scanLegacy()">检测企查查旧授权</button></div><div class="empty">还没有连接任何 MCP · 到「市场」里连接一个吧</div>`;
|
|
1723
|
+
main.innerHTML = `${migrationHtml}<div class="stats"><span class="count">可从旧企查查 OAuth 插件复制已有授权</span><button class="btn ghost" type="button" onclick="window.__mcp.openConnectionStatistics()">本机连接统计</button><button class="btn ghost" id="config-backup" type="button" onclick="window.__mcp.openConfigBackup()">配置备份</button><button class="btn ghost" type="button" title="扫描企查查旧 OAuth 插件;不会删除旧插件或原凭据" onclick="window.__mcp.scanLegacy()">检测企查查旧授权</button></div><div class="empty">还没有连接任何 MCP · 到「市场」里连接一个吧</div>`;
|
|
1699
1724
|
if (preserveScroll) main.scrollTop = previousScrollTop;
|
|
1700
1725
|
return;
|
|
1701
1726
|
}
|
|
1702
1727
|
markCommunityCtaEligible();
|
|
1703
1728
|
const filtered = items.filter(matchesSearch);
|
|
1704
1729
|
const rollbackDisabled = scopeRollbackRevision === null ? 'disabled' : '';
|
|
1705
|
-
main.innerHTML = `${migrationHtml}<div class="stats"><span class="count">共 <strong>${filtered.length}</strong> 条连接${searchQuery ? ` · 搜索「${esc(searchQuery)}」` : ''} · 作用域 revision=${scopeRevision}</span><button class="btn ghost" id="scope-rollback" type="button" ${rollbackDisabled} onclick="window.__mcp.rollbackScope()">回滚上次范围变更</button><button class="btn ghost" id="config-backup" type="button" onclick="window.__mcp.openConfigBackup()">配置备份</button><button class="btn ghost" type="button" title="扫描企查查旧 OAuth 插件;不会删除旧插件或原凭据" onclick="window.__mcp.scanLegacy()">检测企查查旧授权</button></div><div class="rows">${filtered.map(rowHtml).join('')}</div>${communityCtaHtml()}`;
|
|
1730
|
+
main.innerHTML = `${migrationHtml}<div class="stats"><span class="count">共 <strong>${filtered.length}</strong> 条连接${searchQuery ? ` · 搜索「${esc(searchQuery)}」` : ''} · 作用域 revision=${scopeRevision}</span><button class="btn ghost" id="scope-rollback" type="button" ${rollbackDisabled} onclick="window.__mcp.rollbackScope()">回滚上次范围变更</button><button class="btn ghost" type="button" onclick="window.__mcp.openConnectionStatistics()">本机连接统计</button><button class="btn ghost" id="config-backup" type="button" onclick="window.__mcp.openConfigBackup()">配置备份</button><button class="btn ghost" type="button" title="扫描企查查旧 OAuth 插件;不会删除旧插件或原凭据" onclick="window.__mcp.scanLegacy()">检测企查查旧授权</button></div><div class="rows">${filtered.map(rowHtml).join('')}</div>${communityCtaHtml()}`;
|
|
1706
1731
|
if (preserveScroll) main.scrollTop = previousScrollTop;
|
|
1707
1732
|
} finally { finishViewRender(render); }
|
|
1708
1733
|
}
|
|
@@ -2103,10 +2128,7 @@
|
|
|
2103
2128
|
});
|
|
2104
2129
|
setModalBusy(false);
|
|
2105
2130
|
if (!preview.ok || !preview.detail?.canApply) { showModalError(preview.message); return; }
|
|
2106
|
-
const affected = (preview.detail.impact?.servers
|
|
2107
|
-
const toolText = server.tools?.length ? server.tools.join('、') : '工具清单尚未观察';
|
|
2108
|
-
return `${server.serverName}:${toolText}`;
|
|
2109
|
-
}).join('\n');
|
|
2131
|
+
const affected = scopeAffectedText(preview.detail.impact?.servers);
|
|
2110
2132
|
if (!await confirmDialog({
|
|
2111
2133
|
title: '变更连接范围',
|
|
2112
2134
|
message: `${preview.message}\n${affected}\n\n确认${mode === 'copy' ? '复制到' : '移动到'}所选范围?`,
|
|
@@ -2132,10 +2154,7 @@
|
|
|
2132
2154
|
if (scopeRollbackRevision === null) return;
|
|
2133
2155
|
const preview = await call('previewConnectionScopeRollback', { rollbackRevision: scopeRollbackRevision });
|
|
2134
2156
|
if (!preview.ok) { showToast(preview.message, false); return; }
|
|
2135
|
-
const affected = (preview.detail?.impact?.servers
|
|
2136
|
-
const toolText = server.tools?.length ? server.tools.join('、') : '工具清单尚未观察';
|
|
2137
|
-
return `${server.serverName}:${toolText}`;
|
|
2138
|
-
}).join('\n');
|
|
2157
|
+
const affected = scopeAffectedText(preview.detail?.impact?.servers);
|
|
2139
2158
|
if (!await confirmDialog({
|
|
2140
2159
|
title: '回滚连接范围',
|
|
2141
2160
|
message: `${preview.message}\n${affected}\n\n确认将全部连接范围恢复到 revision=${scopeRollbackRevision}?`,
|
|
@@ -2187,6 +2206,20 @@
|
|
|
2187
2206
|
},
|
|
2188
2207
|
openAdd(mode) { openAddConnection(mode); },
|
|
2189
2208
|
openConfig(connectorId) { openAddConnection('manual', marketItems[connectorId] || {}); },
|
|
2209
|
+
async openConnectionStatistics() {
|
|
2210
|
+
openModal('本机连接统计', '<p>正在读取本机记录…</p>');
|
|
2211
|
+
const r = await call('connectionStatistics', {});
|
|
2212
|
+
const d = r.detail;
|
|
2213
|
+
if (!r.ok || !d?.available) {
|
|
2214
|
+
openModal('本机连接统计', '<p>统计暂不可用,不影响连接。请检查 Host 日志。</p>');
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
openModal('本机连接统计', `<div class="form-note">仅统计当前 profile,不是社区总量或独立用户数。数据保存在本机,不向外上传。${d.persistent ? '' : '当前未启用持久化,重启后计数清空。'}</div>
|
|
2218
|
+
<p>成功连接过的卡片数 <strong>${esc(d.cumulativeSuccessfulConnections)}</strong> · 近 30 天首次连接的新卡片 <strong>${esc(d.newSuccessfulConnections30d)}</strong></p>
|
|
2219
|
+
<p>历史已有连接基线:${esc(d.historicalBaseline)} 张卡片,未验证前不计成功,验证后也不计新增。</p>
|
|
2220
|
+
<p>同一卡片只计一次;重启、升级、重新授权和重连不重复增加,断开不扣减。此处成功指连接流程完成,不代表业务调用成功。</p>
|
|
2221
|
+
<div>${(d.items || []).map(x => `<p><strong>${esc(x.connectorId)}</strong>:${x.cumulativeSuccessfulConnections ? '已记录成功' : '历史配置,待验证'}${x.historicalBaseline ? ' · 历史基线' : ''}</p>`).join('') || '尚无统计记录。'}</div>`);
|
|
2222
|
+
},
|
|
2190
2223
|
async openConfigBackup() { await openConfigBackup(); },
|
|
2191
2224
|
async copyBackup() {
|
|
2192
2225
|
const text = $('#backup-json')?.value || '';
|