claws-code 0.8.0

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 (180) hide show
  1. package/.claude/commands/claws-auto.md +90 -0
  2. package/.claude/commands/claws-bin.md +28 -0
  3. package/.claude/commands/claws-cleanup.md +28 -0
  4. package/.claude/commands/claws-do.md +82 -0
  5. package/.claude/commands/claws-fix.md +40 -0
  6. package/.claude/commands/claws-goal.md +111 -0
  7. package/.claude/commands/claws-help.md +54 -0
  8. package/.claude/commands/claws-plan.md +103 -0
  9. package/.claude/commands/claws-report.md +29 -0
  10. package/.claude/commands/claws-status.md +37 -0
  11. package/.claude/commands/claws-update.md +32 -0
  12. package/.claude/commands/claws.md +64 -0
  13. package/.claude/rules/claws-default-behavior.md +76 -0
  14. package/.claude/settings.json +112 -0
  15. package/.claude/settings.local.json +19 -0
  16. package/.claude/skills/claws-auto-engine/SKILL.md +97 -0
  17. package/.claude/skills/claws-goal-tracker/SKILL.md +106 -0
  18. package/.claude/skills/claws-prompt-templates/SKILL.md +203 -0
  19. package/.claude/skills/claws-wave-lead/SKILL.md +126 -0
  20. package/.claude/skills/claws-wave-subworker/SKILL.md +60 -0
  21. package/CHANGELOG.md +1949 -0
  22. package/LICENSE +21 -0
  23. package/README.md +420 -0
  24. package/bin/cli.js +84 -0
  25. package/cli.js +223 -0
  26. package/docs/ARCHITECTURE.md +511 -0
  27. package/docs/event-protocol.md +588 -0
  28. package/docs/features.md +562 -0
  29. package/docs/guide.md +891 -0
  30. package/docs/index.html +716 -0
  31. package/docs/protocol.md +323 -0
  32. package/extension/.vscodeignore +15 -0
  33. package/extension/CHANGELOG.md +1906 -0
  34. package/extension/LICENSE +21 -0
  35. package/extension/README.md +137 -0
  36. package/extension/docs/features.md +424 -0
  37. package/extension/docs/protocol.md +197 -0
  38. package/extension/esbuild.mjs +25 -0
  39. package/extension/icon.png +0 -0
  40. package/extension/native/.metadata.json +10 -0
  41. package/extension/native/node-pty/LICENSE +69 -0
  42. package/extension/native/node-pty/README.md +165 -0
  43. package/extension/native/node-pty/lib/conpty_console_list_agent.js +16 -0
  44. package/extension/native/node-pty/lib/conpty_console_list_agent.js.map +1 -0
  45. package/extension/native/node-pty/lib/eventEmitter2.js +47 -0
  46. package/extension/native/node-pty/lib/eventEmitter2.js.map +1 -0
  47. package/extension/native/node-pty/lib/index.js +52 -0
  48. package/extension/native/node-pty/lib/index.js.map +1 -0
  49. package/extension/native/node-pty/lib/interfaces.js +7 -0
  50. package/extension/native/node-pty/lib/interfaces.js.map +1 -0
  51. package/extension/native/node-pty/lib/shared/conout.js +11 -0
  52. package/extension/native/node-pty/lib/shared/conout.js.map +1 -0
  53. package/extension/native/node-pty/lib/terminal.js +190 -0
  54. package/extension/native/node-pty/lib/terminal.js.map +1 -0
  55. package/extension/native/node-pty/lib/types.js +7 -0
  56. package/extension/native/node-pty/lib/types.js.map +1 -0
  57. package/extension/native/node-pty/lib/unixTerminal.js +346 -0
  58. package/extension/native/node-pty/lib/unixTerminal.js.map +1 -0
  59. package/extension/native/node-pty/lib/utils.js +39 -0
  60. package/extension/native/node-pty/lib/utils.js.map +1 -0
  61. package/extension/native/node-pty/lib/windowsConoutConnection.js +125 -0
  62. package/extension/native/node-pty/lib/windowsConoutConnection.js.map +1 -0
  63. package/extension/native/node-pty/lib/windowsPtyAgent.js +320 -0
  64. package/extension/native/node-pty/lib/windowsPtyAgent.js.map +1 -0
  65. package/extension/native/node-pty/lib/windowsTerminal.js +199 -0
  66. package/extension/native/node-pty/lib/windowsTerminal.js.map +1 -0
  67. package/extension/native/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  68. package/extension/native/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
  69. package/extension/native/node-pty/package.json +64 -0
  70. package/extension/native/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  71. package/extension/native/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  72. package/extension/native/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  73. package/extension/native/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  74. package/extension/native/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  75. package/extension/native/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  76. package/extension/native/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  77. package/extension/native/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  78. package/extension/native/node-pty/prebuilds/win32-arm64/pty.node +0 -0
  79. package/extension/native/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
  80. package/extension/native/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
  81. package/extension/native/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  82. package/extension/native/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  83. package/extension/native/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  84. package/extension/native/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  85. package/extension/native/node-pty/prebuilds/win32-x64/pty.node +0 -0
  86. package/extension/native/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  87. package/extension/native/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  88. package/extension/package-lock.json +605 -0
  89. package/extension/package.json +343 -0
  90. package/extension/scripts/bundle-native.mjs +104 -0
  91. package/extension/scripts/deploy-dev.mjs +60 -0
  92. package/extension/src/ansi-strip.ts +52 -0
  93. package/extension/src/backends/vscode/claws-pty.ts +483 -0
  94. package/extension/src/backends/vscode/status-bar.ts +99 -0
  95. package/extension/src/backends/vscode/vscode-backend.ts +282 -0
  96. package/extension/src/capture-store.ts +125 -0
  97. package/extension/src/event-log.ts +629 -0
  98. package/extension/src/event-schemas.ts +478 -0
  99. package/extension/src/extension.js +492 -0
  100. package/extension/src/extension.ts +873 -0
  101. package/extension/src/lifecycle-engine.ts +60 -0
  102. package/extension/src/lifecycle-rules.ts +171 -0
  103. package/extension/src/lifecycle-store.ts +506 -0
  104. package/extension/src/peer-registry.ts +176 -0
  105. package/extension/src/pipeline-registry.ts +82 -0
  106. package/extension/src/platform.ts +64 -0
  107. package/extension/src/protocol.ts +532 -0
  108. package/extension/src/server-config.ts +98 -0
  109. package/extension/src/server.ts +2210 -0
  110. package/extension/src/task-registry.ts +51 -0
  111. package/extension/src/terminal-backend.ts +211 -0
  112. package/extension/src/terminal-manager.ts +395 -0
  113. package/extension/src/topic-registry.ts +70 -0
  114. package/extension/src/topic-utils.ts +46 -0
  115. package/extension/src/transport.ts +45 -0
  116. package/extension/src/uninstall-cleanup.ts +232 -0
  117. package/extension/src/wave-registry.ts +314 -0
  118. package/extension/src/websocket-transport.ts +153 -0
  119. package/extension/tsconfig.json +23 -0
  120. package/lib/capabilities.js +145 -0
  121. package/lib/dry-run.js +43 -0
  122. package/lib/install.js +1018 -0
  123. package/lib/mcp-setup.js +92 -0
  124. package/lib/platform.js +240 -0
  125. package/lib/preflight.js +152 -0
  126. package/lib/shell-hook.js +343 -0
  127. package/lib/uninstall.js +162 -0
  128. package/lib/verify.js +166 -0
  129. package/mcp_server.js +3529 -0
  130. package/package.json +48 -0
  131. package/rules/claws-default-behavior.md +72 -0
  132. package/scripts/_helpers/atomic-file.mjs +137 -0
  133. package/scripts/_helpers/fix-repair.js +64 -0
  134. package/scripts/_helpers/json-safe.mjs +218 -0
  135. package/scripts/bump-version.sh +84 -0
  136. package/scripts/codegen/gen-docs.mjs +61 -0
  137. package/scripts/codegen/gen-json-schema.mjs +62 -0
  138. package/scripts/codegen/gen-mcp-tools.mjs +358 -0
  139. package/scripts/codegen/gen-types.mjs +172 -0
  140. package/scripts/codegen/index.mjs +42 -0
  141. package/scripts/dev-hooks/check-extension-dirs.js +77 -0
  142. package/scripts/dev-hooks/check-open-claws-terminals.js +70 -0
  143. package/scripts/dev-hooks/check-stale-main.js +55 -0
  144. package/scripts/dev-hooks/check-tag-pushed.js +51 -0
  145. package/scripts/dev-hooks/check-tag-vs-main.js +56 -0
  146. package/scripts/dev-vsix-install.sh +60 -0
  147. package/scripts/fix.sh +702 -0
  148. package/scripts/gen-client-types.mjs +81 -0
  149. package/scripts/git-hooks/pre-commit +31 -0
  150. package/scripts/hooks/lifecycle-state.js +61 -0
  151. package/scripts/hooks/package.json +4 -0
  152. package/scripts/hooks/post-tool-use-claws.js +292 -0
  153. package/scripts/hooks/pre-bash-no-verify-block.js +72 -0
  154. package/scripts/hooks/pre-tool-use-claws.js +206 -0
  155. package/scripts/hooks/session-start-claws.js +97 -0
  156. package/scripts/hooks/stop-claws.js +88 -0
  157. package/scripts/inject-claude-md.js +205 -0
  158. package/scripts/inject-dev-hooks.js +96 -0
  159. package/scripts/inject-global-claude-md.js +140 -0
  160. package/scripts/inject-settings-hooks.js +370 -0
  161. package/scripts/install.ps1 +146 -0
  162. package/scripts/install.sh +1729 -0
  163. package/scripts/monitor-arm-watch.js +155 -0
  164. package/scripts/rebuild-node-pty.sh +245 -0
  165. package/scripts/report.sh +232 -0
  166. package/scripts/shell-hook.fish +164 -0
  167. package/scripts/shell-hook.ps1 +33 -0
  168. package/scripts/shell-hook.sh +232 -0
  169. package/scripts/stream-events.js +399 -0
  170. package/scripts/terminal-wrapper.sh +36 -0
  171. package/scripts/test-enforcement.sh +132 -0
  172. package/scripts/test-install.sh +174 -0
  173. package/scripts/test-installer-parity.sh +135 -0
  174. package/scripts/test-template-enforcement.sh +76 -0
  175. package/scripts/uninstall.sh +143 -0
  176. package/scripts/update.sh +337 -0
  177. package/scripts/verify-release.sh +323 -0
  178. package/scripts/verify-wrapped.sh +194 -0
  179. package/templates/CLAUDE.global.md +135 -0
  180. package/templates/CLAUDE.project.md +37 -0
@@ -0,0 +1,323 @@
1
+ # Claws Protocol Specification v1
2
+
3
+ ## Transport
4
+
5
+ - **Unix socket** (default): workspace-relative path, default `.claws/claws.sock`. Multi-root workspaces get one socket per folder.
6
+ - **WebSocket** (planned, v0.6): `ws://host:port` with token auth.
7
+
8
+ ## Framing
9
+
10
+ Newline-delimited JSON. Each message is one JSON object terminated by `\n`. Client sends requests; server sends responses.
11
+
12
+ ## Requests
13
+
14
+ ```json
15
+ { "id": 1, "cmd": "list" }
16
+ ```
17
+
18
+ | Field | Type | Required | Description |
19
+ |---|---|---|---|
20
+ | `id` | number \| string | yes | Echoed back by the server. Clients use it to correlate responses. |
21
+ | `cmd` | string | yes | Command name (see below). |
22
+ | `protocol` | string | no | Must be `"claws/1"` if present. Absent = treated as `claws/1`. Any other value → rejected with `ok:false, error:"incompatible protocol version"`. |
23
+ | `clientName` | string | no | Optional client label (e.g. `"claws-mcp"`) for server-side logging. |
24
+ | `clientVersion` | string | no | SemVer string. If present, the server compares against its own extension version and logs a one-shot drift warning at ≥ 1 minor release behind. |
25
+
26
+ ## Responses
27
+
28
+ Every response includes the following envelope fields:
29
+
30
+ | Field | Type | Always present | Description |
31
+ |---|---|---|---|
32
+ | `ok` | boolean | yes | `true` on success, `false` on error. |
33
+ | `id` | number \| string | yes | The request's `id`, echoed for legacy clients. |
34
+ | `rid` | number \| string | yes | The request's `id`, guaranteed un-shadowed by body fields. **New clients should read `rid`, not `id`** — some command responses put their own `id` field in the body (e.g. `create` returns a new terminal id). |
35
+ | `protocol` | string | yes | Always `"claws/1"`. |
36
+ | `error` | string | on error only | Human-readable description. |
37
+
38
+ On error:
39
+
40
+ ```json
41
+ { "id": 1, "rid": 1, "ok": false, "protocol": "claws/1", "error": "unknown cmd: xyz" }
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Commands
47
+
48
+ ### `list`
49
+
50
+ Enumerate all open VS Code terminals.
51
+
52
+ **Request:** `{ "id": N, "cmd": "list" }`
53
+
54
+ **Response:**
55
+ ```json
56
+ {
57
+ "id": N, "rid": N, "protocol": "claws/1", "ok": true,
58
+ "terminals": [
59
+ {
60
+ "id": "1",
61
+ "name": "Terminal Name",
62
+ "pid": 12345,
63
+ "hasShellIntegration": true,
64
+ "active": false,
65
+ "logPath": "/absolute/path/to/pty.log"
66
+ }
67
+ ]
68
+ }
69
+ ```
70
+
71
+ ### `create`
72
+
73
+ Open a new terminal.
74
+
75
+ **Request:**
76
+ ```json
77
+ {
78
+ "id": N,
79
+ "cmd": "create",
80
+ "name": "my-terminal", // optional, default "claws"
81
+ "cwd": "/path/to/dir", // optional, default workspace root
82
+ "wrapped": true, // optional, default false — Pseudoterminal with in-memory capture
83
+ "show": true // optional, default true
84
+ }
85
+ ```
86
+
87
+ **Response:**
88
+ ```json
89
+ {
90
+ "id": N, "rid": N, "protocol": "claws/1", "ok": true,
91
+ "id": "5", // NEW terminal id — prefer reading `rid` for the request correlation
92
+ "wrapped": true,
93
+ "logPath": null // always null for Pseudoterminal-backed wrapped terminals (buffer is in-memory)
94
+ }
95
+ ```
96
+
97
+ ### `show`
98
+
99
+ Focus a terminal in the panel.
100
+
101
+ **Request:** `{ "id": N, "cmd": "show", "id": "5", "preserveFocus": true }`
102
+
103
+ **Response:** `{ "id": N, "rid": N, "protocol": "claws/1", "ok": true }`
104
+
105
+ ### `send`
106
+
107
+ Send text into a terminal. Automatically wraps multi-line text in bracketed paste.
108
+
109
+ **Request:**
110
+ ```json
111
+ {
112
+ "id": N,
113
+ "cmd": "send",
114
+ "id": "5",
115
+ "text": "echo hello",
116
+ "newline": true, // optional, default true — append Enter after text
117
+ "paste": false // optional — force bracketed paste off
118
+ }
119
+ ```
120
+
121
+ **Response:**
122
+ ```json
123
+ { "id": N, "rid": N, "protocol": "claws/1", "ok": true, "mode": "wrapped" }
124
+ ```
125
+
126
+ `mode` is `"wrapped"` if the send went through the Pseudoterminal write path (byte-accurate) or `"unwrapped"` if it went through VS Code's `terminal.sendText` API (user-visible text substitution possible).
127
+
128
+ ### `exec`
129
+
130
+ Run a shell command and wait for completion. Uses VS Code shell integration when available; falls back to a "degraded" mode when not.
131
+
132
+ **Request:**
133
+ ```json
134
+ {
135
+ "id": N,
136
+ "cmd": "exec",
137
+ "id": "5",
138
+ "command": "npm test",
139
+ "timeoutMs": 120000 // optional — falls back to claws.execTimeoutMs (default 180000)
140
+ }
141
+ ```
142
+
143
+ **Response (integration available):**
144
+ ```json
145
+ {
146
+ "id": N, "rid": N, "protocol": "claws/1", "ok": true,
147
+ "event": {
148
+ "seq": 42, "terminalId": "5", "terminalName": "worker",
149
+ "commandLine": "npm test", "output": "PASS ...", "exitCode": 0,
150
+ "startedAt": 1713168000000, "endedAt": 1713168001000
151
+ }
152
+ }
153
+ ```
154
+
155
+ **Response (no shell integration):**
156
+ ```json
157
+ {
158
+ "id": N, "rid": N, "protocol": "claws/1", "ok": true,
159
+ "degraded": true,
160
+ "note": "no shell integration active; output not captured via exec — use readLog on wrapped terminals"
161
+ }
162
+ ```
163
+
164
+ ### `readLog`
165
+
166
+ Read a wrapped terminal's capture buffer with optional ANSI stripping.
167
+
168
+ **Request:**
169
+ ```json
170
+ {
171
+ "id": N,
172
+ "cmd": "readLog",
173
+ "id": "5",
174
+ "offset": 0,
175
+ "limit": 524288,
176
+ "strip": true
177
+ }
178
+ ```
179
+
180
+ **Response:**
181
+ ```json
182
+ {
183
+ "id": N, "rid": N, "protocol": "claws/1", "ok": true,
184
+ "bytes": "cleaned text content...",
185
+ "offset": 0,
186
+ "nextOffset": 1234,
187
+ "totalSize": 5678,
188
+ "truncated": false,
189
+ "logPath": null
190
+ }
191
+ ```
192
+
193
+ ### `poll`
194
+
195
+ Drain shell-integration command-completion events since a cursor.
196
+
197
+ **Request:** `{ "id": N, "cmd": "poll", "since": 0, "limit": 50 }`
198
+
199
+ **Response:**
200
+ ```json
201
+ {
202
+ "id": N, "rid": N, "protocol": "claws/1", "ok": true,
203
+ "events": [ /* HistoryEvent[] */ ],
204
+ "cursor": 42,
205
+ "limit": 50,
206
+ "truncated": false
207
+ }
208
+ ```
209
+
210
+ - `limit` — effective cap applied to this response. Client-requested `limit` is an upper bound; the server additionally clamps to `claws.pollLimit` (default 100).
211
+ - `truncated` — `true` when more events matched `since` than the limit allowed; you're reading the tail slice.
212
+
213
+ Note: `poll` relies on VS Code shell integration (`onDidEndTerminalShellExecution`), which is unreliable in wrapped terminals and TUI sessions. For reliable output capture, use `readLog` on wrapped terminals.
214
+
215
+ ### `close`
216
+
217
+ Dispose a terminal. Idempotent — closing an already-closed or never-known id is not an error.
218
+
219
+ **Request:** `{ "id": N, "cmd": "close", "id": "5" }`
220
+
221
+ **Response:** `{ "id": N, "rid": N, "protocol": "claws/1", "ok": true, "alreadyClosed": false }`
222
+
223
+ When the id was unknown (already closed, never created, or race with auto-cleanup):
224
+
225
+ ```json
226
+ { "id": N, "rid": N, "protocol": "claws/1", "ok": true, "alreadyClosed": true }
227
+ ```
228
+
229
+ Clients don't need local bookkeeping to avoid racing their cleanup with the extension's.
230
+
231
+ ### `introspect`
232
+
233
+ Return a structured snapshot of extension + host state. Powers both the `/claws-introspect` slash command and the in-UI `Claws: Health Check` command — both paths render identical data.
234
+
235
+ **Request:** `{ "id": N, "cmd": "introspect" }`
236
+
237
+ **Response:**
238
+ ```json
239
+ {
240
+ "id": N, "rid": N, "ok": true, "protocol": "claws/1",
241
+ "extensionVersion": "0.5.0",
242
+ "nodeVersion": "v20.11.1",
243
+ "electronAbi": 125,
244
+ "platform": "darwin-arm64",
245
+ "nodePty": {
246
+ "loaded": true,
247
+ "loadedFrom": "/path/to/extension/native/node-pty",
248
+ "error": null
249
+ },
250
+ "servers": [
251
+ { "workspace": "/absolute/workspace/path", "socket": "/absolute/workspace/path/.claws/claws.sock" }
252
+ ],
253
+ "terminals": 3,
254
+ "uptime_ms": 1234567
255
+ }
256
+ ```
257
+
258
+ - `nodePty.loaded = false` indicates pipe-mode fallback is active — the status bar goes warning-yellow.
259
+ - `servers` is an array because multi-root workspaces run one server per folder.
260
+
261
+ ---
262
+
263
+ ## Error Codes
264
+
265
+ All errors return `{ "ok": false, "error": "message" }`. Common errors:
266
+
267
+ | Error | Meaning |
268
+ |---|---|
269
+ | `unknown terminal id X` | Terminal ID not found (closed or never existed). Most commands return this on unknown id; `close` returns `ok:true, alreadyClosed:true` instead. |
270
+ | `terminal X is not wrapped (no log available)` | `readLog` called on an unwrapped terminal |
271
+ | `bad json` | Request could not be parsed as JSON |
272
+ | `unknown cmd: X` | Unrecognized command name |
273
+ | `incompatible protocol version (server: claws/1, client: …)` | Request's `protocol` field is not `"claws/1"` |
274
+ | `request too large` | A single request exceeded 1 MB — the connection is dropped |
275
+
276
+ ---
277
+
278
+ ## Versioning
279
+
280
+ Protocol version is exchanged in-band via the optional `protocol` field on every request (absent = `claws/1`). Every response carries the server's `protocol` string so clients can detect server-side upgrades.
281
+
282
+ For richer server metadata (extension version, node-pty state, socket list, uptime), call `introspect` after connecting.
283
+
284
+ ---
285
+
286
+ ## Bus Topic Catalog (claws/2)
287
+
288
+ The claws/2 message bus carries server-push frames to subscribed peers. Subscribe with `claws_subscribe(topic)` (or the `subscribe` socket command); push frames arrive as:
289
+
290
+ ```json
291
+ { "push": "message", "protocol": "claws/2", "topic": "...", "from": "peerId", "payload": { ... }, "sentAt": 1234567890000 }
292
+ ```
293
+
294
+ Topic patterns: `*` matches one segment; `**` matches any depth. All topics are lowercase, dot-separated.
295
+
296
+ ### Worker lifecycle
297
+
298
+ | Topic | Payload schema | Emitter | Consumer |
299
+ |---|---|---|---|
300
+ | `system.worker.completed` | `{ terminal_id, correlation_id, marker, completion_signal }` | `mcp_server.js` on `__CLAWS_DONE__` or `terminated` upgrade | Orchestrator, `claws_workers_wait` |
301
+ | `system.worker.terminated` | `{ terminal_id, correlation_id }` | Extension `onDidCloseTerminal` | `mcp_server.js` (upgrades to `completed`) |
302
+ | `system.worker.process_exited` | `{ terminal_id, correlation_id, exit_code, exited_at }` | Extension `ClawsPty.handleExit` (wrapped terminals) | `mcp_server.js` detach watcher |
303
+ | `system.worker.boot_failed` | `{ correlation_id, cause, pty_tail, timeout_ms }` | `mcp_server.js _gatePasteOnClaudeClaim` | Orchestrator |
304
+
305
+ ### Terminal
306
+
307
+ | Topic | Payload schema | Emitter | Consumer |
308
+ |---|---|---|---|
309
+ | `system.terminal.paste_complete` | `{ terminalId, totalSize, ts }` | Extension send handler growth watcher (AF-3 Layer 2) | `mcp_server.js _waitForSubmitEvent` |
310
+ | `vehicle.<termId>.content` | `{ termId, size, ts }` | `mcp_server.js _pconnHandleData` on pty size change | `_submitWaiters`, `_workerReadyWaiters` |
311
+
312
+ ### Peer lifecycle
313
+
314
+ | Topic | Payload schema | Emitter | Consumer |
315
+ |---|---|---|---|
316
+ | `system.peer.connected` | `{ peerId, role, peerName, correlationId }` | Extension on peer hello | `mcp_server.js` gate release for mission paste |
317
+ | `system.peer.disconnected` | `{ peerId }` | Extension on socket close | Peer registry cleanup |
318
+
319
+ ### Tool invocation
320
+
321
+ | Topic | Payload schema | Emitter | Consumer |
322
+ |---|---|---|---|
323
+ | `tool.<toolName>.invoked` | `{ peerId, toolName, correlation_id }` | `mcp_server.js` on every MCP tool call | `_submitWaiters` (confirms claude is active) |
@@ -0,0 +1,15 @@
1
+ .vscode/**
2
+ .vscode-test/**
3
+ src/**
4
+ test/**
5
+ scripts/**
6
+ out/**
7
+ node_modules/**
8
+ tsconfig.json
9
+ esbuild.mjs
10
+ .eslintrc*
11
+ *.vsix
12
+ .DS_Store
13
+ docs/**
14
+ !native/**
15
+ dist/*-test.js