dsh-mcp-connector 0.2.48 → 0.2.49
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 +12 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/docs/CLI-PROVIDERS.md +3 -1
- package/lib/cli-providers.js +24 -1
- package/lib/mcp-provision.js +3 -1
- package/package.json +1 -1
- package/ui/index.html +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.2.49] - 2026-09-15
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- 修复钉钉 CLI 状态查询返回 `success: true, authenticated: false` 时误显示已连接:枚举工具前严格检查授权布尔值,异常响应安全拒绝,并提示官方 OAuth 登录命令。
|
|
12
|
+
- 重建运行配置时精确升级旧市场钉钉桥接版本,保留用户自定义命令与凭据。
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- 卡片、详情和连接入口显示提供方、授权方式、运行位置和权限提示;连接失败在弹窗内保留原因。
|
|
17
|
+
- 增加 0.2.50 授权设计及 WPS / 腾讯会议接入验证清单,尚不代表完成真实租户验收。
|
|
18
|
+
|
|
7
19
|
## [0.2.48] - 2026-09-15
|
|
8
20
|
|
|
9
21
|
### Added
|
package/README.en.md
CHANGED
|
@@ -190,7 +190,7 @@ npm run dev:ui
|
|
|
190
190
|
|
|
191
191
|
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.
|
|
192
192
|
|
|
193
|
-
The current public version is [`dsh-mcp-connector@0.2.
|
|
193
|
+
The current public version is [`dsh-mcp-connector@0.2.49`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.49](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.49).
|
|
194
194
|
|
|
195
195
|
See [CHANGELOG.md](CHANGELOG.md) for version history and [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md) for the Desktop release checklist.
|
|
196
196
|
|
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ npm run dev:ui
|
|
|
185
185
|
|
|
186
186
|
公共 Registry 每次合并后会生成 `catalog-stats.json`;本仓库的定时工作流每小时同步中英文介绍和统计快照。npm 页面中的静态正文随版本发布更新,上方动态统计徽标则直接读取 Registry,可在不发布新 npm 版本时保持实时数量一致。
|
|
187
187
|
|
|
188
|
-
当前公开版本为 [`dsh-mcp-connector@0.2.
|
|
188
|
+
当前公开版本为 [`dsh-mcp-connector@0.2.49`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.49](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.49)。
|
|
189
189
|
|
|
190
190
|
版本能力与变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
191
191
|
Desktop 发版回归见 [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md)。
|
package/docs/CLI-PROVIDERS.md
CHANGED
|
@@ -9,7 +9,9 @@ MCP 连接器原生支持 Streamable HTTP 和 stdio MCP。对于钉钉 `dws` 这
|
|
|
9
9
|
- 首个 `dingtalk-dws` Provider 仅登记只读命令;创建、发送、审批、拒绝、删除、更新和上传均不暴露。
|
|
10
10
|
- 每个工具只接受 JSON Schema 声明过的字段,参数作为独立 argv 传递。
|
|
11
11
|
- stdout/stderr 均受大小限制,执行有超时;错误中的 Token 和 Secret 在返回 Host 前脱敏。
|
|
12
|
-
- MCP 客户端枚举工具前执行官方 `dws auth status`
|
|
12
|
+
- MCP 客户端枚举工具前执行官方 `dws auth status` 预检;只有 JSON 明确返回 `success: true` 且 `authenticated: true` 才列出工具。退出码为 0 不代表已登录;未授权或响应异常时拒绝连接并提供登录提示。预检不代表全部业务权限已获批,具体工具仍由官方 CLI 校验权限。
|
|
13
|
+
- 首次登录请在运行 DSH 的同一电脑、同一系统用户下执行 `npx -y dingtalk-workspace-cli@1.0.61 auth login`(无浏览器环境加 `--device`),完成后重新连接。不会自动替用户登录或读取聊天记录。
|
|
14
|
+
- Authentication readiness requires both `success === true` and `authenticated === true`; a successful status query alone is insufficient. Invalid responses fail closed without exposing identity or tokens. Run the login command above as the same OS user running DSH, then reconnect. Per-tool permissions are still enforced by the official CLI.
|
|
13
15
|
- 登录、Token 刷新、企业管理员授权、租户隔离和 API 审计由官方 CLI 与开放平台负责。
|
|
14
16
|
|
|
15
17
|
## 钉钉前置条件
|
package/lib/cli-providers.js
CHANGED
|
@@ -378,7 +378,30 @@ export async function ensureCliProviderReady(providerId, options = {}) {
|
|
|
378
378
|
const invocation = buildCliPreflightInvocation(providerId, options);
|
|
379
379
|
if (!invocation) return;
|
|
380
380
|
const runner = options.runner ?? runCliProcess;
|
|
381
|
-
await runner(invocation.command, invocation.args, options);
|
|
381
|
+
const output = await runner(invocation.command, invocation.args, options);
|
|
382
|
+
// Exit code 0 / success:true means the status query succeeded, not that
|
|
383
|
+
// the user is authenticated. Never expose the raw status (identity/tokens).
|
|
384
|
+
let status;
|
|
385
|
+
try {
|
|
386
|
+
status = JSON.parse(output);
|
|
387
|
+
} catch {
|
|
388
|
+
throw new Error('无法验证钉钉 OAuth 状态:官方 CLI 未返回有效 JSON;请检查 CLI 版本后重试');
|
|
389
|
+
}
|
|
390
|
+
if (!status || typeof status !== 'object' || Array.isArray(status)
|
|
391
|
+
|| status.success !== true || status.authenticated !== true) {
|
|
392
|
+
throw new Error('钉钉 OAuth 未就绪:请先在运行 DSH 的同一电脑、同一系统用户下执行 npx -y dingtalk-workspace-cli@1.0.61 auth login(无浏览器环境加 --device),完成授权后重新连接;如仍失败,请确认企业管理员已开启 CLI 访问');
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Upgrade only the exact managed legacy invocation; preserve custom commands,
|
|
397
|
+
// environment, cwd and credentials. Applied on every provision, including restore.
|
|
398
|
+
export function cliBridgeArgs(record) {
|
|
399
|
+
const legacy = ['--yes', '--legacy-peer-deps', '--package', 'dsh-mcp-connector@0.2.48',
|
|
400
|
+
'--package', 'dingtalk-workspace-cli@1.0.61', 'dsh-mcp-cli-bridge', '--provider', 'dingtalk-dws'];
|
|
401
|
+
const args = record.args ?? [];
|
|
402
|
+
if (record.connectorId !== 'dingtalk' || record.command !== 'npx'
|
|
403
|
+
|| JSON.stringify(args) !== JSON.stringify(legacy)) return args;
|
|
404
|
+
return args.map((arg) => arg === 'dsh-mcp-connector@0.2.48' ? 'dsh-mcp-connector@0.2.49' : arg);
|
|
382
405
|
}
|
|
383
406
|
|
|
384
407
|
export async function handleCliBridgeRequest(message, options = {}) {
|
package/lib/mcp-provision.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* entryId = {entryPrefix}-{record.key};serverName 决定工具名前缀,生命周期内不变 → 幂等。
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { cliBridgeArgs } from './cli-providers.js';
|
|
7
|
+
|
|
6
8
|
export function entryIdFor(config, record) {
|
|
7
9
|
return `${config.entryPrefix}-${record.key}`;
|
|
8
10
|
}
|
|
@@ -35,7 +37,7 @@ export function buildEntryConfig(record, grants, { failOnStartupError = false }
|
|
|
35
37
|
transport: 'stdio',
|
|
36
38
|
serverName: record.serverName,
|
|
37
39
|
command: record.command,
|
|
38
|
-
args: record
|
|
40
|
+
args: cliBridgeArgs(record),
|
|
39
41
|
env,
|
|
40
42
|
cwd: record.cwd || process.cwd(),
|
|
41
43
|
failOnStartupError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mcp-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.49",
|
|
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",
|
package/ui/index.html
CHANGED
|
@@ -1155,6 +1155,15 @@
|
|
|
1155
1155
|
}
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
|
+
function connectionLabels(d) {
|
|
1159
|
+
const local = (d.servers || []).some((s) => s.transport === 'stdio');
|
|
1160
|
+
const auth = d.id === 'dingtalk' ? '官方 CLI OAuth'
|
|
1161
|
+
: ({ 'oauth2-pkce': 'OAuth 授权', bearer: 'Bearer 凭据', 'api-key': 'API Key' }[d.authMode] || '按服务要求授权');
|
|
1162
|
+
return [d.vendor ? `提供方:${d.vendor}` : '提供方:待核实', auth,
|
|
1163
|
+
local ? '运行于 DSH 主机' : '远程服务',
|
|
1164
|
+
d.id === 'dingtalk' ? '当前桥接仅提供只读工具' : '权限以授权页和工具策略为准'];
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1158
1167
|
function cardHtml(d) {
|
|
1159
1168
|
const icon = isImageIcon(d.icon)
|
|
1160
1169
|
? `<img src="${esc(d.icon)}" alt="" onerror="this.parentElement.innerHTML='🔌';" />`
|
|
@@ -1166,6 +1175,7 @@
|
|
|
1166
1175
|
<div class="content">
|
|
1167
1176
|
<div class="name">${esc(d.name)} ${probe}</div>
|
|
1168
1177
|
<div class="summary">${esc(d.summary || '')}</div>
|
|
1178
|
+
<div class="hint">${connectionLabels(d).map(esc).join(' · ')}</div>
|
|
1169
1179
|
</div>
|
|
1170
1180
|
<div class="actions">${actions}</div>
|
|
1171
1181
|
</div>`;
|
|
@@ -1408,6 +1418,7 @@
|
|
|
1408
1418
|
if (!connector) return;
|
|
1409
1419
|
openModal(`连接 ${connector.name}`, `
|
|
1410
1420
|
<input id="scope-connector-id" type="hidden" value="${esc(connectorId)}" />
|
|
1421
|
+
<div class="form-note">${connectionLabels(connector).map(esc).join(' · ')}${connector.credentialDescription ? `<p>${esc(connector.credentialDescription)}</p>` : ''}${connectorId === 'dingtalk' ? '<p>尚未登录?请在运行 DSH 的同一系统用户终端执行 <code>npx -y dingtalk-workspace-cli@1.0.61 auth login</code>,完成后点击确认连接。本版本不会自动发起登录;工具注册不代表已获得全部业务权限。</p>' : ''}</div>
|
|
1411
1422
|
<div class="form-note"><strong>选择连接影响范围</strong>连接配置与凭据仍只保存一份;项目范围会由 Host 在工具可见性和执行层强制隔离。</div>
|
|
1412
1423
|
${scopeFieldHtml()}
|
|
1413
1424
|
<div class="inline-error" id="modal-error" tabindex="-1"></div>
|
|
@@ -1571,6 +1582,7 @@
|
|
|
1571
1582
|
const r = await call('connect', { connectorId, ...scopeParams }, { timeoutMs });
|
|
1572
1583
|
setModalBusy(false);
|
|
1573
1584
|
showToast(r.message, r.ok);
|
|
1585
|
+
if (!r.ok) showModalError(r.message);
|
|
1574
1586
|
if (r.ok) {
|
|
1575
1587
|
markCommunityCtaEligible();
|
|
1576
1588
|
closeModal();
|
|
@@ -1881,6 +1893,7 @@
|
|
|
1881
1893
|
: (d.connectionLabel || (d.connected?.length ? '已配置' : '未连接'));
|
|
1882
1894
|
$('#detail-vendor').textContent = d.vendor ? `${d.vendor} · ${initialStateLabel} ${d.connected?.length || 0} 个服务` : `${initialStateLabel} ${d.connected?.length || 0} 个服务`;
|
|
1883
1895
|
$('#detail-desc').textContent = d.description || d.summary || '';
|
|
1896
|
+
$('#detail-desc').textContent += '\n' + connectionLabels(d).join(' · ');
|
|
1884
1897
|
detailPrompts = (d.prompts || []).filter((prompt) => prompt?.text || prompt?.title);
|
|
1885
1898
|
promptPage = 0;
|
|
1886
1899
|
renderPromptPage();
|