dsh-taskbridge 1.8.1 → 1.9.1
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 +27 -0
- package/README.md +139 -121
- package/antigravity/agents/dsh-taskbridge.md +14 -12
- package/antigravity/skills/dsh-taskbridge/SKILL.md +32 -19
- package/bin/dsh-delegate-codex-agent.js +9 -4
- package/codex/skills/dsh-taskbridge/SKILL.md +131 -0
- package/codex/skills/dsh-taskbridge/rules-reference-96027c387cb9b7587efa4aa3836235d86db1108068e007dc08196e807ca25e5d.md +114 -0
- package/docs/INTRODUCTION.md +94 -68
- package/docs/INTRODUCTION.zh.md +94 -77
- package/docs/antigravity-integration.md +6 -1
- package/docs/assets/taskbridge-workflow.en.svg +72 -0
- package/docs/assets/taskbridge-workflow.zh.png +0 -0
- package/docs/claude-code.md +5 -5
- package/docs/codex-integration.md +1102 -1076
- package/docs/releases/1.9.0.zh.md +31 -0
- package/docs/releases/1.9.1.zh.md +14 -0
- package/docs/runtime-compatibility.md +7 -9
- package/docs/silent-wait.md +17 -26
- package/docs/taskbridge-upgrade.md +4 -4
- package/lib/client.d.ts +2 -2
- package/lib/client.js +7 -7
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +157 -150
- package/src/antigravity/installer.js +33 -2
- package/src/client/api.js +139 -17
- package/src/client/index.jsx +20 -19
- package/src/codex/agent-ownership.js +72 -12
- package/src/codex/installer.js +4613 -4190
- package/src/http/execution-plane.js +17 -0
- package/src/http/user-plane.js +6 -0
- package/src/index.d.ts +9 -1
- package/src/index.js +86 -64
- package/src/jobs/engine.js +278 -5
- package/src/jobs/history.js +17 -1
- package/src/jobs/record-cleanup.js +76 -2
- package/src/mcp/server.js +241 -12
- package/src/runtime/permissions.js +18 -0
- package/src/runtime/worker-prompt.js +13 -9
- package/codex/dsh-taskbridge.toml +0 -181
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "DSH TaskBridge",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Cross-host task delegation bridge for DeepSeek Harness (DSH): let your upper host focus on architecture planning and delivery review while offloading heavy coding and test loops to DSH to save flagship model quota. Centralizes API, model, and reasoning-effort routing with Git worktree isolation, cross-subtask reuse, one-click host setup, silent waiting, scoped approvals, and linked cleanup (supports Codex and Antigravity; Claude Code / Claude Desktop planned for 2.0).",
|
|
5
5
|
"detail": "docs/INTRODUCTION.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "DSH TaskBridge",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "面向 DeepSeek Harness(DSH)的跨宿主派工桥接插件:让上层宿主端专注架构规划与交付验收,将繁重的编码实现与测试调测交给 DSH 黑盒执行以节省主力模型配额;统一封装 API、执行模型、思考强度与 Git 工作树隔离,支持一键宿主集成、低耗静默长等、按需权限审批、跨包工作树复用与整链清理(已支持 Codex、Antigravity 一键接入,Claude Code / Claude Desktop 计划于 2.0 上线)。",
|
|
5
5
|
"detail": "docs/INTRODUCTION.zh.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,150 +1,157 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-taskbridge",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/ranranyya/dsh-taskbridge.git"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://github.com/ranranyya/dsh-taskbridge#readme",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/ranranyya/dsh-taskbridge/issues"
|
|
13
|
-
},
|
|
14
|
-
"type": "module",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=24"
|
|
17
|
-
},
|
|
18
|
-
"main": "src/index.js",
|
|
19
|
-
"types": "src/index.d.ts",
|
|
20
|
-
"exports": {
|
|
21
|
-
".": {
|
|
22
|
-
"types": "./src/index.d.ts",
|
|
23
|
-
"default": "./src/index.js"
|
|
24
|
-
},
|
|
25
|
-
"./client": {
|
|
26
|
-
"types": "./lib/client.d.ts",
|
|
27
|
-
"default": "./lib/client.js"
|
|
28
|
-
},
|
|
29
|
-
"./mcp": {
|
|
30
|
-
"types": "./bin/dsh-delegate-mcp.d.ts",
|
|
31
|
-
"default": "./bin/dsh-delegate-mcp.js"
|
|
32
|
-
},
|
|
33
|
-
"./package.json": "./package.json"
|
|
34
|
-
},
|
|
35
|
-
"bin": {
|
|
36
|
-
"dsh-delegate-mcp": "bin/dsh-delegate-mcp.js",
|
|
37
|
-
"dsh-delegate-codex-agent": "bin/dsh-delegate-codex-agent.js",
|
|
38
|
-
"dsh-delegate-control": "bin/dsh-delegate-control.js",
|
|
39
|
-
"dsh-taskbridge-mcp": "bin/dsh-delegate-mcp.js",
|
|
40
|
-
"dsh-taskbridge-codex-agent": "bin/dsh-delegate-codex-agent.js",
|
|
41
|
-
"dsh-taskbridge-control": "bin/dsh-delegate-control.js"
|
|
42
|
-
},
|
|
43
|
-
"files": [
|
|
44
|
-
"src/**/*.js",
|
|
45
|
-
"src/**/*.jsx",
|
|
46
|
-
"src/**/*.d.ts",
|
|
47
|
-
"lib/client.js",
|
|
48
|
-
"lib/client.d.ts",
|
|
49
|
-
"bin/dsh-delegate-mcp.js",
|
|
50
|
-
"bin/dsh-delegate-mcp.d.ts",
|
|
51
|
-
"bin/dsh-delegate-codex-agent.js",
|
|
52
|
-
"bin/dsh-delegate-control.js",
|
|
53
|
-
"bin/dsh-delegate-control.d.ts",
|
|
54
|
-
"codex/dsh-taskbridge.
|
|
55
|
-
"
|
|
56
|
-
"antigravity/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"docs/
|
|
64
|
-
"docs/
|
|
65
|
-
"docs/
|
|
66
|
-
"docs/
|
|
67
|
-
"docs/
|
|
68
|
-
"docs/
|
|
69
|
-
"docs/
|
|
70
|
-
"docs/
|
|
71
|
-
"docs/
|
|
72
|
-
"docs/workspace-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"docs/INTRODUCTION.md",
|
|
77
|
-
"docs/
|
|
78
|
-
"docs/
|
|
79
|
-
"docs/
|
|
80
|
-
"docs/
|
|
81
|
-
"docs/
|
|
82
|
-
"docs/
|
|
83
|
-
"docs/
|
|
84
|
-
"docs/releases/1.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"@deepseek-ai/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"@deepseek-ai/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"@deepseek-ai/
|
|
115
|
-
"@deepseek-ai/dsh-
|
|
116
|
-
"@deepseek-ai/dsh-
|
|
117
|
-
"@deepseek-ai/
|
|
118
|
-
"@
|
|
119
|
-
"@
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"dsh",
|
|
139
|
-
"dsh-
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-taskbridge",
|
|
3
|
+
"version": "1.9.1",
|
|
4
|
+
"description": "面向 DeepSeek Harness(DSH)的跨宿主派工桥接插件:让上层宿主端专注架构规划与交付验收,将繁重的编码实现与测试调测交给 DSH 黑盒执行以节省主力模型配额;统一封装 API、执行模型、思考强度与 Git 工作树隔离,支持一键宿主集成、静默长等、按需权限审批、跨包工作树复用与联动清理(已支持 Codex、Antigravity 一键接入,Claude Code 计划于 2.0 上线)。",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/ranranyya/dsh-taskbridge.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/ranranyya/dsh-taskbridge#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ranranyya/dsh-taskbridge/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=24"
|
|
17
|
+
},
|
|
18
|
+
"main": "src/index.js",
|
|
19
|
+
"types": "src/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./src/index.d.ts",
|
|
23
|
+
"default": "./src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./client": {
|
|
26
|
+
"types": "./lib/client.d.ts",
|
|
27
|
+
"default": "./lib/client.js"
|
|
28
|
+
},
|
|
29
|
+
"./mcp": {
|
|
30
|
+
"types": "./bin/dsh-delegate-mcp.d.ts",
|
|
31
|
+
"default": "./bin/dsh-delegate-mcp.js"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"dsh-delegate-mcp": "bin/dsh-delegate-mcp.js",
|
|
37
|
+
"dsh-delegate-codex-agent": "bin/dsh-delegate-codex-agent.js",
|
|
38
|
+
"dsh-delegate-control": "bin/dsh-delegate-control.js",
|
|
39
|
+
"dsh-taskbridge-mcp": "bin/dsh-delegate-mcp.js",
|
|
40
|
+
"dsh-taskbridge-codex-agent": "bin/dsh-delegate-codex-agent.js",
|
|
41
|
+
"dsh-taskbridge-control": "bin/dsh-delegate-control.js"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"src/**/*.js",
|
|
45
|
+
"src/**/*.jsx",
|
|
46
|
+
"src/**/*.d.ts",
|
|
47
|
+
"lib/client.js",
|
|
48
|
+
"lib/client.d.ts",
|
|
49
|
+
"bin/dsh-delegate-mcp.js",
|
|
50
|
+
"bin/dsh-delegate-mcp.d.ts",
|
|
51
|
+
"bin/dsh-delegate-codex-agent.js",
|
|
52
|
+
"bin/dsh-delegate-control.js",
|
|
53
|
+
"bin/dsh-delegate-control.d.ts",
|
|
54
|
+
"codex/skills/dsh-taskbridge/SKILL.md",
|
|
55
|
+
"codex/skills/dsh-taskbridge/rules-reference-*.md",
|
|
56
|
+
"antigravity/skills/dsh-taskbridge/SKILL.md",
|
|
57
|
+
"antigravity/agents/dsh-taskbridge.md",
|
|
58
|
+
"cordis.patch.yml",
|
|
59
|
+
"README.md",
|
|
60
|
+
"LICENSE",
|
|
61
|
+
"THIRD_PARTY_NOTICES.txt",
|
|
62
|
+
"CHANGELOG.md",
|
|
63
|
+
"docs/auth-contract.md",
|
|
64
|
+
"docs/codex-integration.md",
|
|
65
|
+
"docs/antigravity-integration.md",
|
|
66
|
+
"docs/conversation-placement.md",
|
|
67
|
+
"docs/contracts-stage-b.md",
|
|
68
|
+
"docs/redaction-contract.md",
|
|
69
|
+
"docs/runtime-compatibility.md",
|
|
70
|
+
"docs/silent-wait.md",
|
|
71
|
+
"docs/worker-permissions.md",
|
|
72
|
+
"docs/workspace-contract.md",
|
|
73
|
+
"docs/workspace-grouping.md",
|
|
74
|
+
"icon.svg",
|
|
75
|
+
"locale/*.json",
|
|
76
|
+
"docs/INTRODUCTION.zh.md",
|
|
77
|
+
"docs/INTRODUCTION.md",
|
|
78
|
+
"docs/assets/taskbridge-workflow.zh.png",
|
|
79
|
+
"docs/assets/taskbridge-workflow.en.svg",
|
|
80
|
+
"docs/taskdispatch-upgrade.md",
|
|
81
|
+
"docs/claude-code.md",
|
|
82
|
+
"docs/plugin-market.md",
|
|
83
|
+
"docs/taskbridge-upgrade.md",
|
|
84
|
+
"docs/releases/1.6.0.zh.md",
|
|
85
|
+
"docs/releases/1.7.0.zh.md",
|
|
86
|
+
"docs/releases/1.8.0.zh.md",
|
|
87
|
+
"docs/releases/1.8.1.zh.md",
|
|
88
|
+
"docs/releases/1.9.0.zh.md",
|
|
89
|
+
"docs/releases/1.9.1.zh.md"
|
|
90
|
+
],
|
|
91
|
+
"dsh": {
|
|
92
|
+
"manifestVersion": 1,
|
|
93
|
+
"bundle": {
|
|
94
|
+
"patch": "./cordis.patch.yml"
|
|
95
|
+
},
|
|
96
|
+
"client": {
|
|
97
|
+
"inject": [
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager"
|
|
100
|
+
],
|
|
101
|
+
"platform": "web"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"peerDependencies": {
|
|
105
|
+
"@deepseek-ai/dsh-agent": "*",
|
|
106
|
+
"@deepseek-ai/dsh-llm": "*",
|
|
107
|
+
"@deepseek-ai/dsh-llm-pi-ai": "*",
|
|
108
|
+
"@earendil-works/pi-ai": "^0.87.1 || ^1.1.0"
|
|
109
|
+
},
|
|
110
|
+
"dependencies": {
|
|
111
|
+
"@deepseek-ai/schemastery": "~3.18.4"
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
115
|
+
"@deepseek-ai/dsh-agent": "0.2.0-rc.2",
|
|
116
|
+
"@deepseek-ai/dsh-llm": "0.2.0-rc.2",
|
|
117
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
|
|
118
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.0-rc.2",
|
|
119
|
+
"@deepseek-ai/dsh-session": "0.2.0-rc.2",
|
|
120
|
+
"@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
|
|
121
|
+
"@deepseek-ai/dsh-user-approval": "0.2.0-rc.2",
|
|
122
|
+
"@deepseek-ai/schemastery": "~3.18.4",
|
|
123
|
+
"@earendil-works/pi-ai": "^0.87.1",
|
|
124
|
+
"@tanstack/react-table": "8.21.3",
|
|
125
|
+
"esbuild": "0.25.11",
|
|
126
|
+
"jsdom": "25.0.1",
|
|
127
|
+
"react": "18.3.1",
|
|
128
|
+
"react-dom": "18.3.1"
|
|
129
|
+
},
|
|
130
|
+
"scripts": {
|
|
131
|
+
"test": "node --test --test-concurrency=1 tests/*.test.js",
|
|
132
|
+
"test:isolated": "node --test tests/*.test.js",
|
|
133
|
+
"build:client": "node scripts/build-client.mjs",
|
|
134
|
+
"check:client": "node scripts/build-client.mjs --check",
|
|
135
|
+
"build:integrations": "node scripts/build-integrations.mjs",
|
|
136
|
+
"check:integrations": "node scripts/build-integrations.mjs --check",
|
|
137
|
+
"mcp": "node bin/dsh-delegate-mcp.js",
|
|
138
|
+
"codex-agent": "node bin/dsh-delegate-codex-agent.js",
|
|
139
|
+
"control": "node bin/dsh-delegate-control.js",
|
|
140
|
+
"pack:dry": "npm pack --dry-run",
|
|
141
|
+
"build:market": "node scripts/build-plugin-market.mjs",
|
|
142
|
+
"verify:silent-wait": "node scripts/verify-silent-wait.mjs --duration-seconds 1200"
|
|
143
|
+
},
|
|
144
|
+
"keywords": [
|
|
145
|
+
"dsh",
|
|
146
|
+
"dsh-plugin",
|
|
147
|
+
"deepseek-harness",
|
|
148
|
+
"taskbridge",
|
|
149
|
+
"codex",
|
|
150
|
+
"antigravity",
|
|
151
|
+
"claude-code",
|
|
152
|
+
"mcp",
|
|
153
|
+
"delegation"
|
|
154
|
+
],
|
|
155
|
+
"author": "ranranyya",
|
|
156
|
+
"icon": "./icon.svg"
|
|
157
|
+
}
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
DISCOVERY_ENV_VAR,
|
|
38
38
|
MCP_ENTRY_RELATIVE,
|
|
39
39
|
digest,
|
|
40
|
+
inspectDirectories,
|
|
40
41
|
inspectDirectory,
|
|
41
42
|
isNodeExecutableName,
|
|
42
43
|
isOwnedEntryScript,
|
|
@@ -320,12 +321,18 @@ async function inspectFileSafe(path) {
|
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
async function inspectBoundaries(realHome, paths) {
|
|
323
|
-
|
|
324
|
+
let inspected;
|
|
325
|
+
try {
|
|
326
|
+
inspected = await inspectDirectories([realHome, ...paths.dirs]);
|
|
327
|
+
} catch {
|
|
328
|
+
inspected = new Map();
|
|
329
|
+
}
|
|
330
|
+
const rootInfo = inspected.get(realHome) ?? { kind: 'unknown' };
|
|
324
331
|
if (rootInfo.kind !== 'missing' && rootInfo.kind !== 'directory') {
|
|
325
332
|
return { ok: false, reason: rootInfo.kind === 'unknown' ? 'boundary-unverified' : 'antigravity-home-invalid', path: realHome };
|
|
326
333
|
}
|
|
327
334
|
for (const dir of paths.dirs) {
|
|
328
|
-
const info =
|
|
335
|
+
const info = inspected.get(dir) ?? { kind: 'unknown' };
|
|
329
336
|
if (info.kind === 'missing' || info.kind === 'directory') continue;
|
|
330
337
|
return {
|
|
331
338
|
ok: false,
|
|
@@ -598,10 +605,34 @@ const KNOWN_PRIOR_ANTIGRAVITY_FILES = Object.freeze({
|
|
|
598
605
|
'skills/dsh-taskbridge/SKILL.md': Object.freeze([
|
|
599
606
|
// Published 1.8.0 SKILL.md (LF)
|
|
600
607
|
'9e83135ece937dbc0b73f5098509daac2fe4b973fe4dcd2ed75186745cf3cfee',
|
|
608
|
+
// Published 1.8.1 / 1.9.0-test1 SKILL.md (LF)
|
|
609
|
+
'cb4b0645dbe0de74dce89c286ab61d91e258f24b85edfe6e6ade9362c9f31c14',
|
|
610
|
+
// Pre-layered 1.9.0 balanced SKILL.md (LF)
|
|
611
|
+
'72cf86f41fee5482bb78379949709ec61069997a738060c0bedfb806175e168a',
|
|
612
|
+
// Layered 1.9.0-test2 .. test4 SKILL.md (LF)
|
|
613
|
+
'0346fd973a7a81ed90e8406b11c39953da4165192ce1dddbb70b714ffa771e9c',
|
|
614
|
+
// Layered 1.9.0-test5 SKILL.md (LF)
|
|
615
|
+
'2d3351c1eccce74715929d9fee47d930d3729876db9807ed32be45caed805b1c',
|
|
616
|
+
// Layered 1.9.0-test6 SKILL.md (LF)
|
|
617
|
+
'731c17aa516059a7fc6180b848d2c830b66a1d7117cae8415eb85318ed067093',
|
|
618
|
+
// Layered 1.9.0-preview SKILL.md (LF)
|
|
619
|
+
'ce3a02c9b9ba4e45be30f3ba83ec93ee5254da64f643f12bfcc841dd9dbd2e3f',
|
|
620
|
+
// Layered 1.9.0-preview2 / preview3 SKILL.md (LF)
|
|
621
|
+
'b27118375a6f87fc35ea623c131912ef1545adc84f7c0c5a94790d12b73d4d4d',
|
|
601
622
|
]),
|
|
602
623
|
'agents/dsh-taskbridge.md': Object.freeze([
|
|
603
624
|
// Published 1.8.0 agents/dsh-taskbridge.md (LF)
|
|
604
625
|
'df1418abe2c58c535734ecf6619bd027ca251d2dd6043cec9f41561d8e0a432b',
|
|
626
|
+
// Published 1.8.1 / 1.9.0-test1 agents/dsh-taskbridge.md (LF)
|
|
627
|
+
'cadb5f5f4de640c89b924a75f53a09d38ee68df22086b5aa4aa516192970055b',
|
|
628
|
+
// Pre-layered 1.9.0 slim agents/dsh-taskbridge.md (LF)
|
|
629
|
+
'c26f3272c4a164ec4fe5977aeb8033b296329120445f197121d8087052b5e175',
|
|
630
|
+
// Layered 1.9.0-test2 .. test5 agents/dsh-taskbridge.md (LF)
|
|
631
|
+
'de2c85d753f0eed941c5942d1eba4e2aace921f138cab1b81fe4391f01a02a09',
|
|
632
|
+
// Layered 1.9.0-test6 agents/dsh-taskbridge.md (LF)
|
|
633
|
+
'fa31106b0c0433941d3d1a92bab5a100b9d25c8af3a87687c2b04032ff5cea3d',
|
|
634
|
+
// Layered 1.9.0-preview .. preview3 agents/dsh-taskbridge.md (LF)
|
|
635
|
+
'52648163cbb532a6d3dbe37b82e0efb27c9a26c207462d6740ec0abfa119ee8a',
|
|
605
636
|
]),
|
|
606
637
|
});
|
|
607
638
|
|
package/src/client/api.js
CHANGED
|
@@ -647,7 +647,7 @@ export const GRANT_KIND_LABELS = Object.freeze({
|
|
|
647
647
|
* standing permission, and the panel must not read like an approval workflow.
|
|
648
648
|
*/
|
|
649
649
|
export const PERMISSION_STATE_LABELS = Object.freeze({
|
|
650
|
-
pending: '
|
|
650
|
+
pending: '等待宿主端决定(仅这一次调用)',
|
|
651
651
|
decided: '已决定',
|
|
652
652
|
expired: '已超时(未决定即为拒绝)',
|
|
653
653
|
cancelled: '已撤回',
|
|
@@ -884,7 +884,7 @@ export const CODEX_ACTIONS = Object.freeze(['install', 'repair', 'remove']);
|
|
|
884
884
|
* configured, and both can be ready while the local-call switch is still off.
|
|
885
885
|
*/
|
|
886
886
|
export const CODEX_TARGETS = Object.freeze([
|
|
887
|
-
{ key: 'agent', label: 'Codex
|
|
887
|
+
{ key: 'agent', label: 'Codex 原生技能(skills/dsh-taskbridge/SKILL.md)' },
|
|
888
888
|
{ key: 'mcp', label: 'Codex MCP 条目' },
|
|
889
889
|
{ key: 'switch', label: 'DSH 本机调用开关' },
|
|
890
890
|
]);
|
|
@@ -925,7 +925,7 @@ export function codexTargetView(codex, switchState, target) {
|
|
|
925
925
|
: '已关闭:Codex 可以查询状态,但新任务会被拒绝;本页不会替你打开它。',
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
|
-
const block = target === 'agent' ? codex?.agent : codex?.mcp;
|
|
928
|
+
const block = target === 'agent' ? (codex?.skill ?? codex?.agent) : codex?.mcp;
|
|
929
929
|
if (block === null || block === undefined || typeof block !== 'object') {
|
|
930
930
|
return { key: target, label, state: 'unknown', tone: 'off', detail: '宿主尚未回报该状态。' };
|
|
931
931
|
}
|
|
@@ -961,11 +961,18 @@ export function codexTargetView(codex, switchState, target) {
|
|
|
961
961
|
*/
|
|
962
962
|
export function describeCodexOutcome(outcome) {
|
|
963
963
|
if (outcome === null || outcome === undefined) return '';
|
|
964
|
-
const names = { agent: '
|
|
965
|
-
const
|
|
964
|
+
const names = { agent: '技能文件(SKILL.md)', legacyAgent: '旧版子智能体文件', mcp: 'MCP 条目' };
|
|
965
|
+
const rawChanged = Array.isArray(outcome.changed) ? outcome.changed : [];
|
|
966
966
|
const refused = Array.isArray(outcome.refused) ? outcome.refused : [];
|
|
967
967
|
const parts = [];
|
|
968
|
-
if (
|
|
968
|
+
if (outcome.action === 'remove') {
|
|
969
|
+
if (rawChanged.length > 0) parts.push(`已移除:${rawChanged.map((key) => names[key] ?? key).join('、')}`);
|
|
970
|
+
} else {
|
|
971
|
+
const written = rawChanged.filter((key) => key !== 'legacyAgent').map((key) => names[key] ?? key);
|
|
972
|
+
const cleaned = rawChanged.filter((key) => key === 'legacyAgent').map((key) => names[key] ?? key);
|
|
973
|
+
if (written.length > 0) parts.push(`已写入:${written.join('、')}`);
|
|
974
|
+
if (cleaned.length > 0) parts.push(`已清理:${cleaned.join('、')}`);
|
|
975
|
+
}
|
|
969
976
|
if (refused.length > 0) parts.push(`未改动:${refused.map((entry) => names[entry?.target] ?? entry?.target ?? '未知').join('、')}`);
|
|
970
977
|
if (parts.length === 0) {
|
|
971
978
|
return outcome.action === 'remove' ? '没有需要移除的插件托管文件。' : '已是最新,没有需要写入的内容。';
|
|
@@ -1427,8 +1434,8 @@ export function permissionSummary(task) {
|
|
|
1427
1434
|
waiting: true,
|
|
1428
1435
|
label: '等待本次调用授权决定',
|
|
1429
1436
|
note: access === null || access === undefined
|
|
1430
|
-
? `工作进程暂停在 ${tool}
|
|
1431
|
-
: `工作进程暂停在 ${tool} 这一次调用上,请求把该次调用的沙箱权限提升到 ${access}
|
|
1437
|
+
? `工作进程暂停在 ${tool} 这一次调用上,等待宿主端决定。任务仍在运行,未失败,也未完成。`
|
|
1438
|
+
: `工作进程暂停在 ${tool} 这一次调用上,请求把该次调用的沙箱权限提升到 ${access},等待宿主端决定。`
|
|
1432
1439
|
+ '无论是否允许,会话的常规权限(workspace-write)保持不变。',
|
|
1433
1440
|
detail: `请求编号 ${pending?.requestId ?? '—'} · 调用 ${pending?.callId ?? '—'}`,
|
|
1434
1441
|
};
|
|
@@ -1799,7 +1806,7 @@ export function taskOutcome(task) {
|
|
|
1799
1806
|
} else if (state === 'awaiting-host-review') {
|
|
1800
1807
|
label = '等待宿主审查';
|
|
1801
1808
|
tone = 'warn';
|
|
1802
|
-
note = '
|
|
1809
|
+
note = '执行已完成,等待宿主端审查;插件不会自行验收。';
|
|
1803
1810
|
// Stated once, as the headline above; a second identical phase badge is noise.
|
|
1804
1811
|
phaseLabel = null;
|
|
1805
1812
|
} else if (state === 'failed') {
|
|
@@ -2570,6 +2577,16 @@ export function planCreateRequest(draft) {
|
|
|
2570
2577
|
* @param {object} options - `api` transport, `now` clock.
|
|
2571
2578
|
* @returns {object} store with `subscribe`, `getSnapshot` and action methods.
|
|
2572
2579
|
*/
|
|
2580
|
+
/** Backoff schedule (ms) when `init()` hits a startup 404 right after "Enable immediately". */
|
|
2581
|
+
const DEFAULT_INIT_RETRY_DELAYS_MS = Object.freeze([250, 500, 1000, 1500, 2000, 2500, 3000]);
|
|
2582
|
+
|
|
2583
|
+
/** Whether an error indicates the plugin backend HTTP routes have not mounted yet. */
|
|
2584
|
+
function isStartupRoutePendingError(error) {
|
|
2585
|
+
return error?.code === 'HTTP_404'
|
|
2586
|
+
|| error?.code === 'USER_PLANE_UNKNOWN_ROUTE'
|
|
2587
|
+
|| error?.code === 'USER_PLANE_UNREACHABLE';
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2573
2590
|
export function createStore(options = {}) {
|
|
2574
2591
|
const api = options.api ?? createApi();
|
|
2575
2592
|
// The task-record cleanup projection. It is injected rather than imported so this
|
|
@@ -2583,6 +2600,9 @@ export function createStore(options = {}) {
|
|
|
2583
2600
|
const saveDebounceMs = Number.isFinite(options.saveDebounceMs) && options.saveDebounceMs >= 0
|
|
2584
2601
|
? Math.trunc(options.saveDebounceMs)
|
|
2585
2602
|
: 700;
|
|
2603
|
+
const initRetryDelaysMs = Array.isArray(options.initRetryDelaysMs)
|
|
2604
|
+
? options.initRetryDelaysMs.filter((ms) => Number.isFinite(ms) && ms >= 0).map((ms) => Math.trunc(ms))
|
|
2605
|
+
: DEFAULT_INIT_RETRY_DELAYS_MS;
|
|
2586
2606
|
const scheduleImpl = typeof options.schedule === 'function'
|
|
2587
2607
|
? options.schedule
|
|
2588
2608
|
: (fn, ms) => setTimeout(fn, ms);
|
|
@@ -2604,6 +2624,13 @@ export function createStore(options = {}) {
|
|
|
2604
2624
|
let saveTimer = null;
|
|
2605
2625
|
/** Explicit discard marker: the next debounce tick must not resurrect edits. */
|
|
2606
2626
|
let saveSuppressed = false;
|
|
2627
|
+
/** Coalesced in-flight `init()` promise so remounting while bootstrapping never overlaps. */
|
|
2628
|
+
let initInFlight = null;
|
|
2629
|
+
/** Pending startup retry timer handle and canceller for `dispose()`. */
|
|
2630
|
+
let initRetryTimer = null;
|
|
2631
|
+
let cancelInitRetryWait = null;
|
|
2632
|
+
/** Last startup-failure notice emitted by `init()`, cleared automatically on recovery. */
|
|
2633
|
+
let initErrorNoticeId = null;
|
|
2607
2634
|
/**
|
|
2608
2635
|
* Sequence of `openTask` calls. A detail read may only publish its answer if no
|
|
2609
2636
|
* NEWER read started meanwhile, so a slow response for an old row cannot replace the
|
|
@@ -2710,12 +2737,15 @@ export function createStore(options = {}) {
|
|
|
2710
2737
|
}
|
|
2711
2738
|
|
|
2712
2739
|
/**
|
|
2713
|
-
* Append one operator-facing message
|
|
2740
|
+
* Append one operator-facing message, deduplicating identical live notices so
|
|
2741
|
+
* parallel transient failures never stack repeated identical banners.
|
|
2714
2742
|
* @param {'info'|'error'|'success'} level - severity.
|
|
2715
2743
|
* @param {string} text - Chinese text.
|
|
2716
2744
|
* @returns {number} notice id.
|
|
2717
2745
|
*/
|
|
2718
2746
|
function notify(level, text) {
|
|
2747
|
+
const existing = state.notices.find((notice) => notice.level === level && notice.text === text);
|
|
2748
|
+
if (existing !== undefined) return existing.id;
|
|
2719
2749
|
const id = state.revision + 1 + Math.random();
|
|
2720
2750
|
patch({ notices: [...state.notices, { id, level, text }].slice(-6) });
|
|
2721
2751
|
return id;
|
|
@@ -2725,6 +2755,31 @@ export function createStore(options = {}) {
|
|
|
2725
2755
|
patch({ notices: state.notices.filter((notice) => notice.id !== id) });
|
|
2726
2756
|
}
|
|
2727
2757
|
|
|
2758
|
+
/** Wait `ms` before retrying startup readiness; resolves `false` if disposed meanwhile. */
|
|
2759
|
+
function waitForInitRetry(ms) {
|
|
2760
|
+
return new Promise((resolve) => {
|
|
2761
|
+
if (disposed) {
|
|
2762
|
+
resolve(false);
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
let settled = false;
|
|
2766
|
+
const finish = (keepGoing) => {
|
|
2767
|
+
if (settled) return;
|
|
2768
|
+
settled = true;
|
|
2769
|
+
initRetryTimer = null;
|
|
2770
|
+
cancelInitRetryWait = null;
|
|
2771
|
+
resolve(keepGoing);
|
|
2772
|
+
};
|
|
2773
|
+
cancelInitRetryWait = () => {
|
|
2774
|
+
if (initRetryTimer !== null) {
|
|
2775
|
+
try { cancelScheduleImpl(initRetryTimer); } catch { /* ignore */ }
|
|
2776
|
+
}
|
|
2777
|
+
finish(false);
|
|
2778
|
+
};
|
|
2779
|
+
initRetryTimer = scheduleImpl(() => finish(!disposed), Math.max(0, ms));
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2728
2783
|
async function track(key, work) {
|
|
2729
2784
|
patch({ loading: { ...state.loading, [key]: true } });
|
|
2730
2785
|
try {
|
|
@@ -3868,20 +3923,87 @@ export function createStore(options = {}) {
|
|
|
3868
3923
|
});
|
|
3869
3924
|
},
|
|
3870
3925
|
|
|
3871
|
-
/**
|
|
3926
|
+
/**
|
|
3927
|
+
* Load everything the page needs; tolerates the short cold-start window right after
|
|
3928
|
+
* "Enable immediately" when the frontend mounts before backend HTTP routes finish
|
|
3929
|
+
* registering, retrying `/status` silently instead of stacking 404 banners.
|
|
3930
|
+
*/
|
|
3872
3931
|
async init() {
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3932
|
+
if (disposed) return;
|
|
3933
|
+
if (initInFlight !== null) return await initInFlight;
|
|
3934
|
+
const run = (async () => {
|
|
3935
|
+
let startupNoticeId = null;
|
|
3936
|
+
let statusOutcome = null;
|
|
3937
|
+
let statusReady = false;
|
|
3938
|
+
let lastStartupError = null;
|
|
3939
|
+
|
|
3940
|
+
for (let attempt = 0; attempt <= initRetryDelaysMs.length; attempt += 1) {
|
|
3941
|
+
if (disposed) return;
|
|
3942
|
+
statusOutcome = await track('status', async () => {
|
|
3943
|
+
try {
|
|
3944
|
+
const body = await api.getStatus();
|
|
3945
|
+
patch({ status: body });
|
|
3946
|
+
return { ok: true, body };
|
|
3947
|
+
} catch (error) {
|
|
3948
|
+
return { ok: false, error };
|
|
3949
|
+
}
|
|
3950
|
+
});
|
|
3951
|
+
if (statusOutcome.ok) {
|
|
3952
|
+
statusReady = true;
|
|
3953
|
+
break;
|
|
3954
|
+
}
|
|
3955
|
+
if (!isStartupRoutePendingError(statusOutcome.error) || attempt === initRetryDelaysMs.length) {
|
|
3956
|
+
lastStartupError = statusOutcome.error;
|
|
3957
|
+
break;
|
|
3958
|
+
}
|
|
3959
|
+
if (startupNoticeId === null) {
|
|
3960
|
+
startupNoticeId = notify('info', '插件服务正在启动,正在自动重试连接…');
|
|
3961
|
+
}
|
|
3962
|
+
const keepGoing = await waitForInitRetry(initRetryDelaysMs[attempt]);
|
|
3963
|
+
if (!keepGoing || disposed) return;
|
|
3964
|
+
}
|
|
3965
|
+
|
|
3966
|
+
if (startupNoticeId !== null) {
|
|
3967
|
+
dismissNotice(startupNoticeId);
|
|
3968
|
+
startupNoticeId = null;
|
|
3969
|
+
}
|
|
3970
|
+
if (disposed) return;
|
|
3971
|
+
|
|
3972
|
+
if (statusReady && initErrorNoticeId !== null) {
|
|
3973
|
+
dismissNotice(initErrorNoticeId);
|
|
3974
|
+
initErrorNoticeId = null;
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
if (!statusReady) {
|
|
3978
|
+
const err = lastStartupError ?? statusOutcome?.error;
|
|
3979
|
+
if (err !== undefined && err !== null) {
|
|
3980
|
+
initErrorNoticeId = notify('error', describeError(err));
|
|
3981
|
+
if (isStartupRoutePendingError(err)) {
|
|
3982
|
+
patch({ nativeProvidersError: describeError(err), tasksError: err });
|
|
3983
|
+
return;
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3988
|
+
await Promise.all([store.loadSettings(), store.loadNativeProviders(), store.loadTasks()]);
|
|
3989
|
+
if (disposed) return;
|
|
3990
|
+
// Diagnostic read only. `init` must never perform a Codex write: installing
|
|
3991
|
+
// files is an explicit operator action, not a side effect of opening a page.
|
|
3992
|
+
void store.refreshCodexStatus();
|
|
3993
|
+
void store.refreshAntigravityStatus();
|
|
3994
|
+
void store.loadCatalog();
|
|
3995
|
+
})().finally(() => {
|
|
3996
|
+
if (initInFlight === run) initInFlight = null;
|
|
3997
|
+
});
|
|
3998
|
+
initInFlight = run;
|
|
3999
|
+
return await run;
|
|
3879
4000
|
},
|
|
3880
4001
|
|
|
3881
4002
|
/** Release subscriptions and drop the one-time token. */
|
|
3882
4003
|
dispose() {
|
|
3883
4004
|
cancelPendingSave();
|
|
3884
4005
|
disposed = true;
|
|
4006
|
+
if (typeof cancelInitRetryWait === 'function') cancelInitRetryWait();
|
|
3885
4007
|
state = { ...state, token: null, tokenConnectionId: null };
|
|
3886
4008
|
listeners.clear();
|
|
3887
4009
|
},
|