dsh-taskbridge 1.7.1 → 1.8.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -21
  3. package/README.md +733 -877
  4. package/THIRD_PARTY_NOTICES.txt +23 -23
  5. package/antigravity/agents/dsh-taskbridge.md +32 -0
  6. package/antigravity/skills/dsh-taskbridge/SKILL.md +51 -0
  7. package/codex/dsh-taskbridge.toml +181 -631
  8. package/cordis.patch.yml +6 -6
  9. package/docs/INTRODUCTION.md +122 -295
  10. package/docs/INTRODUCTION.zh.md +134 -279
  11. package/docs/antigravity-integration.md +42 -0
  12. package/docs/auth-contract.md +138 -138
  13. package/docs/claude-code.md +6 -11
  14. package/docs/codex-integration.md +2 -2
  15. package/docs/contracts-stage-b.md +443 -443
  16. package/docs/conversation-placement.md +7 -6
  17. package/docs/plugin-market.md +30 -30
  18. package/docs/redaction-contract.md +170 -170
  19. package/docs/releases/1.7.0.zh.md +11 -11
  20. package/docs/releases/1.8.0.zh.md +16 -0
  21. package/docs/releases/1.8.1.zh.md +24 -0
  22. package/docs/runtime-compatibility.md +1 -1
  23. package/docs/taskbridge-upgrade.md +28 -28
  24. package/docs/taskdispatch-upgrade.md +25 -25
  25. package/docs/workspace-contract.md +538 -538
  26. package/docs/workspace-grouping.md +126 -126
  27. package/icon.svg +1 -1
  28. package/lib/client.d.ts +804 -699
  29. package/lib/client.js +7 -7
  30. package/locale/en.json +1 -1
  31. package/locale/zh.json +1 -1
  32. package/package.json +150 -144
  33. package/src/antigravity/installer.js +1068 -0
  34. package/src/antigravity/seam.js +142 -0
  35. package/src/auth/fence.js +361 -361
  36. package/src/auth/grants.js +789 -789
  37. package/src/client/api.js +266 -3
  38. package/src/client/index.jsx +224 -11
  39. package/src/client/sidebar.jsx +862 -862
  40. package/src/client/styles.js +624 -624
  41. package/src/client/task-cleanup.js +429 -304
  42. package/src/client/task-records-table.jsx +217 -217
  43. package/src/client/task-view.js +307 -307
  44. package/src/client/workspace-groups.js +482 -482
  45. package/src/client/workspaces-browser.jsx +770 -770
  46. package/src/codex/agent-ownership.js +270 -270
  47. package/src/codex/installer.js +6 -0
  48. package/src/codex/toml.js +784 -784
  49. package/src/config/defaults.js +11 -15
  50. package/src/config/redact.js +245 -245
  51. package/src/config/store.js +186 -186
  52. package/src/credentials/seam.js +202 -202
  53. package/src/http/respond.js +6 -5
  54. package/src/http/user-plane.js +83 -1
  55. package/src/index.js +25 -0
  56. package/src/jobs/diagnostics.js +15 -15
  57. package/src/jobs/engine.js +1 -0
  58. package/src/jobs/history.js +1 -1
  59. package/src/jobs/plan-store.js +1103 -1020
  60. package/src/jobs/record-cleanup.js +452 -7
  61. package/src/jobs/review-note.js +63 -63
  62. package/src/jobs/task-descriptions.js +82 -82
  63. package/src/jobs/task-display.js +73 -73
  64. package/src/jobs/task-tree.js +786 -786
  65. package/src/jobs/title.js +134 -134
  66. package/src/mcp/continuation.js +317 -317
  67. package/src/mcp/server.js +34 -27
  68. package/src/mcp/wait.js +34 -15
  69. package/src/model/connectivity.js +371 -371
  70. package/src/model/discovery.js +582 -582
  71. package/src/model/native-catalog.js +68 -68
  72. package/src/model/openai-adapter.js +671 -671
  73. package/src/model/probe.js +264 -264
  74. package/src/model/providers.js +756 -756
  75. package/src/model/routing.js +321 -321
  76. package/src/runtime/agent-runner.js +1 -0
  77. package/src/runtime/permissions.js +1619 -1619
  78. package/src/runtime/question-call.js +162 -162
  79. package/src/runtime/questions.js +909 -909
  80. package/src/runtime/session-placement.js +36 -1
  81. package/src/runtime/worker-prompt.js +61 -55
  82. package/src/workspace/audit.js +775 -775
  83. package/src/workspace/preflight.js +424 -424
  84. package/src/workspace/worktrees.js +833 -679
@@ -1,138 +1,138 @@
1
- # Local delegation switch and legacy grant internals
2
-
3
- The current DSH plugin uses one persisted `delegationEnabled` switch. A new
4
- installation starts OFF. When it is OFF, the execution plane refuses new task
5
- submissions with `DELEGATION_DISABLED` and the engine requests cancellation of
6
- live tasks. Status, result reads and cancellation remain available. The DSH UI
7
- updates this switch through the authenticated user plane; MCP has no switch,
8
- grant, credential or settings write tool and needs no issued token.
9
-
10
- In switch mode, the user plane does not register the old connection, grant or
11
- revoke-all routes. The execution plane is registered only on loopback. While the
12
- switch is ON, any local process that can reach that port may submit a task, so
13
- this setting is not per-process authentication or a same-user security boundary.
14
-
15
- ## The one exception: `POST /tasks/permission`
16
-
17
- `delegate_permission_decide` reaches `POST /dsh-delegate/x/tasks/permission`. It is
18
- the single external verb that answers rather than requests, and it is bounded to
19
- what is already pending:
20
-
21
- - it is gated by the switch exactly like a submission (a decision is an
22
- authorization exercise), and it is refused with `DELEGATION_DISABLED` while the
23
- switch is OFF;
24
- - its identity is the authenticated connection (`local-mcp` on the switch path, a
25
- verified connection on the grant path), never a `connectionId` in the body;
26
- - it can only settle the caller's OWN task's outstanding request. A task of
27
- another connection — and an unknown task id — is answered with the same
28
- `JOB_TASK_NOT_FOUND` and the same details, so the route cannot be used to learn
29
- which task ids or pending requests exist elsewhere;
30
- - the engine re-checks `posture()` and the task's own live authorization at the
31
- decision, so a switch turned off or a revoked grant between the ask and the
32
- answer refuses the decision instead of applying it;
33
- - the outcome is `allow-once` (that one native tool call resumes) or `reject`.
34
- It creates no grant, widens no grant, changes no setting, and is not reusable.
35
-
36
- What it does NOT add: a token, a signature, a new identity, or a per-process
37
- boundary. This route is exactly as protected as the rest of the switch-mode plane
38
- (loopback fence plus the shared local identity), and that is stated honestly rather
39
- than dressed up as process authentication.
40
-
41
- The remaining notes document the grant registry retained for compatibility and
42
- its isolated grant-mode tests. They are not the current product authorization
43
- contract.
44
-
45
- ## Legacy grant-mode contract
46
-
47
- The short version of how a delegation authorization is created, kept alive, and
48
- ended. `src/auth/grants.js` is the only component that decides any of it.
49
-
50
- ## 1. The engine uses two things, not one
51
-
52
- `JobEngine` (`src/jobs/engine.js`) depends on the registry in exactly two ways.
53
-
54
- **Subscribe for invalidation.** `AuthorizationRegistry#subscribe` delivers one
55
- event per authorization that stops being usable for a reason other than "this
56
- request failed":
57
-
58
- | event | when |
59
- | --- | --- |
60
- | `{kind:'grant', grantId, connectionId, reason:'revoked'}` | operator revoked one grant |
61
- | `{kind:'grant', grantId, connectionId, reason:'expired'}` | the grant passed `expiresAt`, including a grant a running task already consumed |
62
- | `{kind:'connection', connectionId, reason:'revoked'}` | operator revoked a connection; its grants are revoked in the same step |
63
- | `{kind:'connection', connectionId, reason:'lease-expired'}` | the connection's idle lease lapsed |
64
- | `{kind:'all', reason:'revoked-all'}` | `revokeAll()` — the dispose path |
65
-
66
- The engine cancels the tasks named by those ids. That is the whole reason
67
- revocation is a cancellation rather than a promise.
68
-
69
- **Call `assertTaskAuthorized` while a task runs.** Each progress check re-proves
70
- four facts: the connection is live, the grant belongs to that connection and
71
- covers that workspace, and — for a `task` grant — the grant is consumed by
72
- *this* task id. Only `revokedAt` and `expiresAt` disqualify the grant itself;
73
- being consumed is the binding being checked, not a refusal. An unconsumed task
74
- grant yields `GRANT_NOT_CONSUMED`, a grant consumed by someone else yields
75
- `GRANT_CONSUMED`.
76
-
77
- Events are emitted once. A grant already announced as revoked is not announced
78
- again as expired, and a connection already revoked is not re-announced.
79
-
80
- ## 2. The host runs the sweep timer
81
-
82
- `AUTH_SWEEP_INTERVAL_MS` is 30 seconds. The host calls
83
- `AuthorizationRegistry#sweep()` on that interval; the registry itself owns no
84
- timer, so a disposed plugin cannot be woken by one. Each sweep is idempotent and
85
- does three things:
86
-
87
- 1. revokes connections past their idle lease, with their grants, emitting one
88
- `connection` event each;
89
- 2. emits one `grant` expiry event for every unrevoked grant past `expiresAt`
90
- (consumed or not);
91
- 3. deletes grants and connections settled longer than `AUTH_RETENTION_MS`
92
- (10 minutes) ago.
93
-
94
- Deletion is measured from the moment of settlement, never from the deadline, so
95
- an entry that dies during a sweep is still visible for one full retention window.
96
- A sweep that settles and deletes in the same step would hide the change from the
97
- operator surface.
98
-
99
- ## 3. MCP heartbeats every 30 seconds
100
-
101
- The MCP adapter authenticates to the execution plane with
102
- `Authorization: Bearer <connection token>` on every request. That authentication
103
- *is* the heartbeat: `authenticate()` is the only path that pushes `lastSeenAt`
104
- forward.
105
-
106
- - Default lease: **120 seconds** (`DEFAULT_CONNECTION_LEASE_MS`), overridable per
107
- registry. With a 30-second heartbeat that tolerates three missed beats.
108
- - A lapsed token is refused *without* renewal, so a stale token cannot revive
109
- its own connection.
110
- - Heartbeat interval = sweep interval = 30 seconds, so a silent connection is
111
- revoked before the next sweep would need to notice it.
112
-
113
- ## 4. Ordinary reads do not renew the lease
114
-
115
- `listGrants`, `listConnections`, `isDelegationAuthorized`, `requireSessionGrant`,
116
- `consumeTaskGrant` and `assertTaskAuthorized` never touch `lastSeenAt`. An
117
- idle MCP client polling status cannot keep its delegation authorization alive;
118
- only an authenticated request can. The tests pin this.
119
-
120
- ## 5. Transport fence
121
-
122
- Before the Bearer token is examined, `src/auth/fence.js` requires a loopback
123
- peer, a Host header that parses as exactly one authority naming this machine, a
124
- `Sec-Fetch-Site` of `same-origin`/`none` (or absent), and — when `Origin` is
125
- present — a same-origin local Origin.
126
-
127
- `parseRequestAuthority` rejects a Host header outright rather than normalising
128
- it: no leading/trailing whitespace, no userinfo, path, query, fragment,
129
- backslash, comma or control character, and no numeric host that the URL parser
130
- would expand. `127.1`, `2130706433`, `0x7f.0.0.1`, `0177.0.0.1` and
131
- `127.0.0.256` are all refusals, not `127.0.0.1`.
132
-
133
- The user plane (`fenceUserPlane`) is deliberately asymmetric: an authenticated
134
- read (`GET`/`HEAD`) may omit `Origin`, while any write must carry a same-origin
135
- `Origin` and a JSON content type. This helper is a rule under test; the live
136
- user plane runs on the native `connection.fetch` carrier, which applies the
137
- harness's own fence and browser-session authentication, so it does not call this
138
- function and does not parse HTTP headers itself.
1
+ # Local delegation switch and legacy grant internals
2
+
3
+ The current DSH plugin uses one persisted `delegationEnabled` switch. A new
4
+ installation starts OFF. When it is OFF, the execution plane refuses new task
5
+ submissions with `DELEGATION_DISABLED` and the engine requests cancellation of
6
+ live tasks. Status, result reads and cancellation remain available. The DSH UI
7
+ updates this switch through the authenticated user plane; MCP has no switch,
8
+ grant, credential or settings write tool and needs no issued token.
9
+
10
+ In switch mode, the user plane does not register the old connection, grant or
11
+ revoke-all routes. The execution plane is registered only on loopback. While the
12
+ switch is ON, any local process that can reach that port may submit a task, so
13
+ this setting is not per-process authentication or a same-user security boundary.
14
+
15
+ ## The one exception: `POST /tasks/permission`
16
+
17
+ `delegate_permission_decide` reaches `POST /dsh-delegate/x/tasks/permission`. It is
18
+ the single external verb that answers rather than requests, and it is bounded to
19
+ what is already pending:
20
+
21
+ - it is gated by the switch exactly like a submission (a decision is an
22
+ authorization exercise), and it is refused with `DELEGATION_DISABLED` while the
23
+ switch is OFF;
24
+ - its identity is the authenticated connection (`local-mcp` on the switch path, a
25
+ verified connection on the grant path), never a `connectionId` in the body;
26
+ - it can only settle the caller's OWN task's outstanding request. A task of
27
+ another connection — and an unknown task id — is answered with the same
28
+ `JOB_TASK_NOT_FOUND` and the same details, so the route cannot be used to learn
29
+ which task ids or pending requests exist elsewhere;
30
+ - the engine re-checks `posture()` and the task's own live authorization at the
31
+ decision, so a switch turned off or a revoked grant between the ask and the
32
+ answer refuses the decision instead of applying it;
33
+ - the outcome is `allow-once` (that one native tool call resumes) or `reject`.
34
+ It creates no grant, widens no grant, changes no setting, and is not reusable.
35
+
36
+ What it does NOT add: a token, a signature, a new identity, or a per-process
37
+ boundary. This route is exactly as protected as the rest of the switch-mode plane
38
+ (loopback fence plus the shared local identity), and that is stated honestly rather
39
+ than dressed up as process authentication.
40
+
41
+ The remaining notes document the grant registry retained for compatibility and
42
+ its isolated grant-mode tests. They are not the current product authorization
43
+ contract.
44
+
45
+ ## Legacy grant-mode contract
46
+
47
+ The short version of how a delegation authorization is created, kept alive, and
48
+ ended. `src/auth/grants.js` is the only component that decides any of it.
49
+
50
+ ## 1. The engine uses two things, not one
51
+
52
+ `JobEngine` (`src/jobs/engine.js`) depends on the registry in exactly two ways.
53
+
54
+ **Subscribe for invalidation.** `AuthorizationRegistry#subscribe` delivers one
55
+ event per authorization that stops being usable for a reason other than "this
56
+ request failed":
57
+
58
+ | event | when |
59
+ | --- | --- |
60
+ | `{kind:'grant', grantId, connectionId, reason:'revoked'}` | operator revoked one grant |
61
+ | `{kind:'grant', grantId, connectionId, reason:'expired'}` | the grant passed `expiresAt`, including a grant a running task already consumed |
62
+ | `{kind:'connection', connectionId, reason:'revoked'}` | operator revoked a connection; its grants are revoked in the same step |
63
+ | `{kind:'connection', connectionId, reason:'lease-expired'}` | the connection's idle lease lapsed |
64
+ | `{kind:'all', reason:'revoked-all'}` | `revokeAll()` — the dispose path |
65
+
66
+ The engine cancels the tasks named by those ids. That is the whole reason
67
+ revocation is a cancellation rather than a promise.
68
+
69
+ **Call `assertTaskAuthorized` while a task runs.** Each progress check re-proves
70
+ four facts: the connection is live, the grant belongs to that connection and
71
+ covers that workspace, and — for a `task` grant — the grant is consumed by
72
+ *this* task id. Only `revokedAt` and `expiresAt` disqualify the grant itself;
73
+ being consumed is the binding being checked, not a refusal. An unconsumed task
74
+ grant yields `GRANT_NOT_CONSUMED`, a grant consumed by someone else yields
75
+ `GRANT_CONSUMED`.
76
+
77
+ Events are emitted once. A grant already announced as revoked is not announced
78
+ again as expired, and a connection already revoked is not re-announced.
79
+
80
+ ## 2. The host runs the sweep timer
81
+
82
+ `AUTH_SWEEP_INTERVAL_MS` is 30 seconds. The host calls
83
+ `AuthorizationRegistry#sweep()` on that interval; the registry itself owns no
84
+ timer, so a disposed plugin cannot be woken by one. Each sweep is idempotent and
85
+ does three things:
86
+
87
+ 1. revokes connections past their idle lease, with their grants, emitting one
88
+ `connection` event each;
89
+ 2. emits one `grant` expiry event for every unrevoked grant past `expiresAt`
90
+ (consumed or not);
91
+ 3. deletes grants and connections settled longer than `AUTH_RETENTION_MS`
92
+ (10 minutes) ago.
93
+
94
+ Deletion is measured from the moment of settlement, never from the deadline, so
95
+ an entry that dies during a sweep is still visible for one full retention window.
96
+ A sweep that settles and deletes in the same step would hide the change from the
97
+ operator surface.
98
+
99
+ ## 3. MCP heartbeats every 30 seconds
100
+
101
+ The MCP adapter authenticates to the execution plane with
102
+ `Authorization: Bearer <connection token>` on every request. That authentication
103
+ *is* the heartbeat: `authenticate()` is the only path that pushes `lastSeenAt`
104
+ forward.
105
+
106
+ - Default lease: **120 seconds** (`DEFAULT_CONNECTION_LEASE_MS`), overridable per
107
+ registry. With a 30-second heartbeat that tolerates three missed beats.
108
+ - A lapsed token is refused *without* renewal, so a stale token cannot revive
109
+ its own connection.
110
+ - Heartbeat interval = sweep interval = 30 seconds, so a silent connection is
111
+ revoked before the next sweep would need to notice it.
112
+
113
+ ## 4. Ordinary reads do not renew the lease
114
+
115
+ `listGrants`, `listConnections`, `isDelegationAuthorized`, `requireSessionGrant`,
116
+ `consumeTaskGrant` and `assertTaskAuthorized` never touch `lastSeenAt`. An
117
+ idle MCP client polling status cannot keep its delegation authorization alive;
118
+ only an authenticated request can. The tests pin this.
119
+
120
+ ## 5. Transport fence
121
+
122
+ Before the Bearer token is examined, `src/auth/fence.js` requires a loopback
123
+ peer, a Host header that parses as exactly one authority naming this machine, a
124
+ `Sec-Fetch-Site` of `same-origin`/`none` (or absent), and — when `Origin` is
125
+ present — a same-origin local Origin.
126
+
127
+ `parseRequestAuthority` rejects a Host header outright rather than normalising
128
+ it: no leading/trailing whitespace, no userinfo, path, query, fragment,
129
+ backslash, comma or control character, and no numeric host that the URL parser
130
+ would expand. `127.1`, `2130706433`, `0x7f.0.0.1`, `0177.0.0.1` and
131
+ `127.0.0.256` are all refusals, not `127.0.0.1`.
132
+
133
+ The user plane (`fenceUserPlane`) is deliberately asymmetric: an authenticated
134
+ read (`GET`/`HEAD`) may omit `Origin`, while any write must carry a same-origin
135
+ `Origin` and a JSON content type. This helper is a rule under test; the live
136
+ user plane runs on the native `connection.fetch` carrier, which applies the
137
+ harness's own fence and browser-session authentication, so it does not call this
138
+ function and does not parse HTTP headers itself.
@@ -1,23 +1,18 @@
1
1
  # Claude Code / Claude Desktop 接入计划
2
2
 
3
- **当前版本仅支持 Codex 端。Claude Code 和 Claude Desktop 接入预计在 2.0 版本上线。**
3
+ **当前版本已支持 Codex 与 Antigravity 端;Claude Code 与 Claude Desktop 接入计划于 2.0 版本上线。**
4
4
 
5
- TaskBridge 目前提供 Codex 智能体与 MCP 的安装、更新和修复入口。Claude Code、Claude Desktop 尚未作为当前版本的正式接入端提供;请先通过 Codex 使用现有的派工、等待、审批和审查流程。
5
+ TaskBridge 目前在插件设置页中提供 **Codex 集成** 与 **Antigravity 集成** 的一键安装、更新、仅修复 MCP 与卸载入口。Claude Code 与 Claude Desktop 尚未作为当前版本的正式接入端提供;请先通过 Codex 或 Antigravity 使用现有的派工、等待、审批和审查流程。
6
6
 
7
- ## 2.0 计划
7
+ ## 客户端支持路线
8
8
 
9
9
  | 客户端 | 当前状态 | 预计版本 |
10
10
  | --- | --- | --- |
11
11
  | Codex | 已支持 | 当前版本可用 |
12
+ | Antigravity | 已支持 | 当前版本可用 |
12
13
  | Claude Code | 接入尚未上线 | 2.0 |
13
14
  | Claude Desktop | 接入尚未上线 | 2.0 |
14
15
 
15
- 计划的目标是让 Claude Code 和 Claude Desktop 也能作为指挥端,使用 DSH 插件中配置的执行 API、模型和思考强度,并接入任务委派、静默等待、必要判断和交付审查流程。
16
+ 2.0 的目标是让 Claude Code 和 Claude Desktop 也复用同一套标准 MCP 服务接口,作为顶层指挥端调用 DSH 插件中配置的执行 API、模型与思考强度。
16
17
 
17
- 具体配置入口、客户端操作方法与验收范围将在 2.0 发布时提供。预计版本是产品计划,实际功能以对应发布说明为准。
18
-
19
- ## 关于旧的手动 MCP 文档
20
-
21
- 本页此前记录过标准 stdio MCP 的手动连接方案。该方案不代表 Claude 客户端已经正式上线或完成实际验收;为避免误导,本页已改为接入规划。
22
-
23
- 当前安装步骤请查看 [TaskBridge 中文介绍](INTRODUCTION.zh.md) 和 [Codex 集成说明](codex-integration.md)。
18
+ 当前安装步骤请查看 [TaskBridge 中文介绍](INTRODUCTION.zh.md)、[Codex 集成说明](codex-integration.md) 与 [Antigravity 集成说明](antigravity-integration.md)。
@@ -1,6 +1,6 @@
1
1
  # Codex integration contract
2
2
 
3
- Status: implemented in 1.7.1 (planning nodes, multi-level parent-child hierarchy, persisted task descriptions, commander planning, placement checks, and managed template upgrades). This automatic installer covers Codex, the currently supported client. Claude Code and Claude Desktop integration is planned for 2.0; see the separate roadmap.
3
+ Status: implemented in 1.8.1 (Codex and Antigravity integrations both supported, with full 1.8.0 and earlier upgrade recognition). This automatic installer covers Codex; Antigravity integration is documented in `docs/antigravity-integration.md`, and Claude Code / Claude Desktop integration is planned for 2.0.
4
4
 
5
5
  The 1.7.0 release also makes future managed upgrades self-recognising: the two exact
6
6
  companions this machine really held (`1.6.1` in both terminator spellings and the local
@@ -562,7 +562,7 @@ successful diagnosis.
562
562
  ```jsonc
563
563
  {
564
564
  "codexHome": "…",
565
- "packageVersion": "1.7.1",
565
+ "packageVersion": "1.8.1",
566
566
  "boundary": { "blocked": false, "link": null, "unknown": false, "home": "directory", "agents": "directory" },
567
567
  "agent": {
568
568
  "path": "…", "state": "installed", "installed": true, "managed": true,