subharness 0.0.7 → 0.0.9

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 (273) hide show
  1. package/README.md +18 -6
  2. package/dist/adapters/claude-events.d.ts +71 -0
  3. package/dist/adapters/claude-events.js +860 -0
  4. package/dist/adapters/claude-events.js.map +1 -0
  5. package/dist/adapters/claude-worker-client.d.ts +11 -0
  6. package/dist/adapters/claude-worker-client.js +219 -5
  7. package/dist/adapters/claude-worker-client.js.map +1 -1
  8. package/dist/adapters/claude-worker-protocol.d.ts +58 -0
  9. package/dist/adapters/claude-worker-protocol.js.map +1 -1
  10. package/dist/adapters/claude-worker.js +48 -3
  11. package/dist/adapters/claude-worker.js.map +1 -1
  12. package/dist/adapters/claude.d.ts +5 -1
  13. package/dist/adapters/claude.js +14 -2
  14. package/dist/adapters/claude.js.map +1 -1
  15. package/dist/adapters/codex-events.d.ts +52 -0
  16. package/dist/adapters/codex-events.js +672 -0
  17. package/dist/adapters/codex-events.js.map +1 -0
  18. package/dist/adapters/codex-turn-failure.d.ts +2 -0
  19. package/dist/adapters/codex-turn-failure.js +116 -0
  20. package/dist/adapters/codex-turn-failure.js.map +1 -0
  21. package/dist/adapters/codex.js +44 -7
  22. package/dist/adapters/codex.js.map +1 -1
  23. package/dist/adapters/copilot-events.d.ts +68 -0
  24. package/dist/adapters/copilot-events.js +650 -0
  25. package/dist/adapters/copilot-events.js.map +1 -0
  26. package/dist/adapters/copilot.js +24 -4
  27. package/dist/adapters/copilot.js.map +1 -1
  28. package/dist/adapters/cursor-acp-events.d.ts +36 -0
  29. package/dist/adapters/cursor-acp-events.js +251 -0
  30. package/dist/adapters/cursor-acp-events.js.map +1 -0
  31. package/dist/adapters/cursor-cli-session.d.ts +1 -0
  32. package/dist/adapters/cursor-cli-session.js +26 -5
  33. package/dist/adapters/cursor-cli-session.js.map +1 -1
  34. package/dist/adapters/cursor-cli.js +5 -0
  35. package/dist/adapters/cursor-cli.js.map +1 -1
  36. package/dist/adapters/cursor-sdk-events.d.ts +30 -0
  37. package/dist/adapters/cursor-sdk-events.js +233 -0
  38. package/dist/adapters/cursor-sdk-events.js.map +1 -0
  39. package/dist/adapters/cursor-session.js +56 -7
  40. package/dist/adapters/cursor-session.js.map +1 -1
  41. package/dist/adapters/cursor-startup.js +8 -2
  42. package/dist/adapters/cursor-startup.js.map +1 -1
  43. package/dist/adapters/event-normalizer.d.ts +57 -0
  44. package/dist/adapters/event-normalizer.js +143 -0
  45. package/dist/adapters/event-normalizer.js.map +1 -0
  46. package/dist/adapters/event-secrets.d.ts +17 -0
  47. package/dist/adapters/event-secrets.js +28 -0
  48. package/dist/adapters/event-secrets.js.map +1 -0
  49. package/dist/adapters/event-types.d.ts +58 -0
  50. package/dist/adapters/event-types.js +2 -0
  51. package/dist/adapters/event-types.js.map +1 -0
  52. package/dist/adapters/fx-events.d.ts +37 -0
  53. package/dist/adapters/fx-events.js +393 -0
  54. package/dist/adapters/fx-events.js.map +1 -0
  55. package/dist/adapters/fx-rpc.d.ts +2 -0
  56. package/dist/adapters/fx-rpc.js +11 -5
  57. package/dist/adapters/fx-rpc.js.map +1 -1
  58. package/dist/adapters/fx.js +73 -8
  59. package/dist/adapters/fx.js.map +1 -1
  60. package/dist/adapters/opencode-events.d.ts +58 -0
  61. package/dist/adapters/opencode-events.js +653 -0
  62. package/dist/adapters/opencode-events.js.map +1 -0
  63. package/dist/adapters/opencode-http.d.ts +1 -0
  64. package/dist/adapters/opencode-http.js +8 -7
  65. package/dist/adapters/opencode-http.js.map +1 -1
  66. package/dist/adapters/opencode.js +50 -9
  67. package/dist/adapters/opencode.js.map +1 -1
  68. package/dist/adapters/rpc.d.ts +2 -0
  69. package/dist/adapters/rpc.js +11 -5
  70. package/dist/adapters/rpc.js.map +1 -1
  71. package/dist/adapters/types.d.ts +2 -0
  72. package/dist/adapters/types.js.map +1 -1
  73. package/dist/cli/args.d.ts +3 -1
  74. package/dist/cli/args.js +25 -1
  75. package/dist/cli/args.js.map +1 -1
  76. package/dist/cli/dashboard-client.d.ts +1 -0
  77. package/dist/cli/dashboard-client.js +13 -1
  78. package/dist/cli/dashboard-client.js.map +1 -1
  79. package/dist/cli/dashboard-controller.js +6 -7
  80. package/dist/cli/dashboard-controller.js.map +1 -1
  81. package/dist/cli/dashboard-detail-view.d.ts +14 -8
  82. package/dist/cli/dashboard-detail-view.js +15 -44
  83. package/dist/cli/dashboard-detail-view.js.map +1 -1
  84. package/dist/cli/dashboard-history-view.d.ts +3 -12
  85. package/dist/cli/dashboard-history-view.js +18 -82
  86. package/dist/cli/dashboard-history-view.js.map +1 -1
  87. package/dist/cli/dashboard-live.d.ts +32 -0
  88. package/dist/cli/dashboard-live.js +177 -0
  89. package/dist/cli/dashboard-live.js.map +1 -0
  90. package/dist/cli/dashboard-renderer.d.ts +21 -1
  91. package/dist/cli/dashboard-renderer.js +85 -21
  92. package/dist/cli/dashboard-renderer.js.map +1 -1
  93. package/dist/cli/dashboard-steps.d.ts +53 -0
  94. package/dist/cli/dashboard-steps.js +157 -0
  95. package/dist/cli/dashboard-steps.js.map +1 -0
  96. package/dist/cli/dashboard-task-format.d.ts +15 -0
  97. package/dist/cli/dashboard-task-format.js +119 -0
  98. package/dist/cli/dashboard-task-format.js.map +1 -0
  99. package/dist/cli/dashboard-task-view.d.ts +66 -0
  100. package/dist/cli/dashboard-task-view.js +325 -0
  101. package/dist/cli/dashboard-task-view.js.map +1 -0
  102. package/dist/cli/dashboard.d.ts +2 -0
  103. package/dist/cli/dashboard.js +71 -6
  104. package/dist/cli/dashboard.js.map +1 -1
  105. package/dist/cli/extensions-client.d.ts +23 -0
  106. package/dist/cli/extensions-client.js +147 -0
  107. package/dist/cli/extensions-client.js.map +1 -0
  108. package/dist/cli/extensions.d.ts +14 -0
  109. package/dist/cli/extensions.js +181 -0
  110. package/dist/cli/extensions.js.map +1 -0
  111. package/dist/cli/help.d.ts +1 -0
  112. package/dist/cli/help.js +21 -0
  113. package/dist/cli/help.js.map +1 -1
  114. package/dist/cli/main.js +54 -2
  115. package/dist/cli/main.js.map +1 -1
  116. package/dist/cli/output.js +1 -0
  117. package/dist/cli/output.js.map +1 -1
  118. package/dist/events/content.d.ts +43 -0
  119. package/dist/events/content.js +249 -0
  120. package/dist/events/content.js.map +1 -0
  121. package/dist/events/queue.d.ts +59 -0
  122. package/dist/events/queue.js +144 -0
  123. package/dist/events/queue.js.map +1 -0
  124. package/dist/events/validate.d.ts +22 -0
  125. package/dist/events/validate.js +542 -0
  126. package/dist/events/validate.js.map +1 -0
  127. package/dist/extensions/catalog.d.ts +33 -0
  128. package/dist/extensions/catalog.js +101 -0
  129. package/dist/extensions/catalog.js.map +1 -0
  130. package/dist/extensions/child-protocol.d.ts +38 -0
  131. package/dist/extensions/child-protocol.js +2 -0
  132. package/dist/extensions/child-protocol.js.map +1 -0
  133. package/dist/extensions/child.d.ts +1 -0
  134. package/dist/extensions/child.js +125 -0
  135. package/dist/extensions/child.js.map +1 -0
  136. package/dist/extensions/consent.d.ts +13 -0
  137. package/dist/extensions/consent.js +204 -0
  138. package/dist/extensions/consent.js.map +1 -0
  139. package/dist/extensions/environment.d.ts +1 -0
  140. package/dist/extensions/environment.js +12 -0
  141. package/dist/extensions/environment.js.map +1 -0
  142. package/dist/extensions/identity.d.ts +9 -0
  143. package/dist/extensions/identity.js +28 -0
  144. package/dist/extensions/identity.js.map +1 -0
  145. package/dist/extensions/log.d.ts +5 -0
  146. package/dist/extensions/log.js +80 -0
  147. package/dist/extensions/log.js.map +1 -0
  148. package/dist/extensions/manifest.d.ts +7 -0
  149. package/dist/extensions/manifest.js +213 -0
  150. package/dist/extensions/manifest.js.map +1 -0
  151. package/dist/extensions/types.d.ts +24 -0
  152. package/dist/extensions/types.js +2 -0
  153. package/dist/extensions/types.js.map +1 -0
  154. package/dist/extensions.d.ts +5 -0
  155. package/dist/extensions.js +2 -0
  156. package/dist/extensions.js.map +1 -0
  157. package/dist/index.d.ts +1 -0
  158. package/dist/index.js.map +1 -1
  159. package/dist/runtime/approval-registry.d.ts +6 -2
  160. package/dist/runtime/approval-registry.js +31 -3
  161. package/dist/runtime/approval-registry.js.map +1 -1
  162. package/dist/runtime/capture.js +45 -13
  163. package/dist/runtime/capture.js.map +1 -1
  164. package/dist/runtime/coordinator.d.ts +8 -4
  165. package/dist/runtime/coordinator.js +128 -26
  166. package/dist/runtime/coordinator.js.map +1 -1
  167. package/dist/runtime/daemon.js +9 -1
  168. package/dist/runtime/daemon.js.map +1 -1
  169. package/dist/runtime/dashboard.d.ts +4 -0
  170. package/dist/runtime/dashboard.js +8 -0
  171. package/dist/runtime/dashboard.js.map +1 -1
  172. package/dist/runtime/event-operation.d.ts +41 -0
  173. package/dist/runtime/event-operation.js +290 -0
  174. package/dist/runtime/event-operation.js.map +1 -0
  175. package/dist/runtime/event-owner.d.ts +94 -0
  176. package/dist/runtime/event-owner.js +429 -0
  177. package/dist/runtime/event-owner.js.map +1 -0
  178. package/dist/runtime/event-source.d.ts +39 -0
  179. package/dist/runtime/event-source.js +344 -0
  180. package/dist/runtime/event-source.js.map +1 -0
  181. package/dist/runtime/extension-instance.d.ts +61 -0
  182. package/dist/runtime/extension-instance.js +356 -0
  183. package/dist/runtime/extension-instance.js.map +1 -0
  184. package/dist/runtime/extension-protocol.d.ts +47 -0
  185. package/dist/runtime/extension-protocol.js +33 -0
  186. package/dist/runtime/extension-protocol.js.map +1 -0
  187. package/dist/runtime/extension-service.d.ts +10 -0
  188. package/dist/runtime/extension-service.js +35 -0
  189. package/dist/runtime/extension-service.js.map +1 -0
  190. package/dist/runtime/extension-supervisor.d.ts +33 -0
  191. package/dist/runtime/extension-supervisor.js +251 -0
  192. package/dist/runtime/extension-supervisor.js.map +1 -0
  193. package/dist/runtime/select-native.d.ts +2 -1
  194. package/dist/runtime/select-native.js +26 -2
  195. package/dist/runtime/select-native.js.map +1 -1
  196. package/dist/runtime/service.d.ts +5 -0
  197. package/dist/runtime/service.js +83 -9
  198. package/dist/runtime/service.js.map +1 -1
  199. package/dist/runtime/session-event-wire.d.ts +29 -0
  200. package/dist/runtime/session-event-wire.js +2 -0
  201. package/dist/runtime/session-event-wire.js.map +1 -0
  202. package/dist/runtime/session-events-service.d.ts +8 -0
  203. package/dist/runtime/session-events-service.js +124 -0
  204. package/dist/runtime/session-events-service.js.map +1 -0
  205. package/dist/runtime/session-events-transport.d.ts +8 -0
  206. package/dist/runtime/session-events-transport.js +142 -0
  207. package/dist/runtime/session-events-transport.js.map +1 -0
  208. package/dist/runtime/startup-lock.d.ts +2 -0
  209. package/dist/runtime/startup-lock.js +49 -5
  210. package/dist/runtime/startup-lock.js.map +1 -1
  211. package/dist/runtime/state.d.ts +2 -1
  212. package/dist/runtime/state.js +4 -0
  213. package/dist/runtime/state.js.map +1 -1
  214. package/dist/runtime/transport.d.ts +1 -0
  215. package/dist/runtime/transport.js +2 -0
  216. package/dist/runtime/transport.js.map +1 -1
  217. package/dist/runtime/types.d.ts +22 -0
  218. package/dist/runtime/types.js.map +1 -1
  219. package/dist/runtime/worker-client.js +42 -13
  220. package/dist/runtime/worker-client.js.map +1 -1
  221. package/dist/runtime/worker-event-channel.d.ts +30 -0
  222. package/dist/runtime/worker-event-channel.js +141 -0
  223. package/dist/runtime/worker-event-channel.js.map +1 -0
  224. package/dist/runtime/worker-event-protocol.d.ts +88 -0
  225. package/dist/runtime/worker-event-protocol.js +114 -0
  226. package/dist/runtime/worker-event-protocol.js.map +1 -0
  227. package/dist/runtime/worker-events.d.ts +73 -0
  228. package/dist/runtime/worker-events.js +704 -0
  229. package/dist/runtime/worker-events.js.map +1 -0
  230. package/dist/runtime/worker-server.d.ts +3 -1
  231. package/dist/runtime/worker-server.js +63 -8
  232. package/dist/runtime/worker-server.js.map +1 -1
  233. package/dist/sdk/connected-events.d.ts +3 -0
  234. package/dist/sdk/connected-events.js +259 -0
  235. package/dist/sdk/connected-events.js.map +1 -0
  236. package/dist/sdk/connected-types.d.ts +2 -0
  237. package/dist/sdk/connected-types.js.map +1 -1
  238. package/dist/sdk/connected.js +3 -0
  239. package/dist/sdk/connected.js.map +1 -1
  240. package/dist/sdk/event-types.d.ts +182 -0
  241. package/dist/sdk/event-types.js +2 -0
  242. package/dist/sdk/event-types.js.map +1 -0
  243. package/dist/sdk/execution-driver.js +1 -1
  244. package/dist/sdk/execution-driver.js.map +1 -1
  245. package/dist/sdk/execution-types.d.ts +2 -0
  246. package/dist/sdk/execution-types.js.map +1 -1
  247. package/dist/sdk/runner.js +2 -0
  248. package/dist/sdk/runner.js.map +1 -1
  249. package/package.json +5 -1
  250. package/sdk/adapter-contract.md +25 -3
  251. package/sdk/agent-skill.md +3 -2
  252. package/sdk/cli/dashboard-design.md +37 -9
  253. package/sdk/cli/dashboard-inspection.md +14 -6
  254. package/sdk/cli/extensions.md +44 -0
  255. package/sdk/cli/index.md +27 -4
  256. package/sdk/cli/output.md +13 -1
  257. package/sdk/completion-notifications.md +2 -2
  258. package/sdk/config.md +31 -2
  259. package/sdk/copilot.md +1 -1
  260. package/sdk/cursor.md +2 -2
  261. package/sdk/diagnostics.md +68 -0
  262. package/sdk/distribution.md +13 -3
  263. package/sdk/events.md +339 -0
  264. package/sdk/execution.md +26 -7
  265. package/sdk/extensions.md +181 -0
  266. package/sdk/fx.md +4 -2
  267. package/sdk/harnesses.md +1 -1
  268. package/sdk/index.md +3 -0
  269. package/sdk/message-delivery.md +2 -0
  270. package/sdk/opencode.md +1 -1
  271. package/sdk/project-team.md +10 -4
  272. package/sdk/sessions.md +4 -0
  273. package/sdk/v1-runtime.md +14 -4
package/README.md CHANGED
@@ -10,7 +10,7 @@ Stay with your favorite coding agent. Ask it to delegate tasks across Codex, Cla
10
10
 
11
11
  TypeScript definitions are optional. Add them when your coding agent needs reusable specialists with shared instructions, tools, or harness alternatives. Codex and Claude Code use eligible native subscription logins or explicitly configured API access. fx, OpenCode, and GitHub Copilot accept explicitly configured native logins, direct API keys, or Vercel AI Gateway access. Cursor uses an explicitly configured native CLI login or Cursor API key.
12
12
 
13
- Use the Node.js execution SDK to build an agent-running UI or expose a specialist as a tool in an existing chat. The application owns its runner and can observe task states, approval requests, and complete responses without invoking the Subharness CLI.
13
+ Use the Node.js execution SDK to build an agent-running UI or expose a specialist as a tool in an existing chat. The application owns its runner and can observe task states, approval requests, complete responses, and normalized live session events without invoking the Subharness CLI. Applications decide whether and where to persist those events; Subharness does not ship a chat database.
14
14
 
15
15
  The library coordinates sessions, queues, and subagents. Harnesses own model execution, native tools, and context. You supply the working directory and any sandbox or worktree isolation.
16
16
 
@@ -73,7 +73,7 @@ subharness run claude --prompt-file ./review-task.txt
73
73
  subharness run codex --prompt-file - < ./task.txt
74
74
  ```
75
75
 
76
- Use `subharness dashboard` in a terminal to watch agents managed by the local coordinator. The live view groups agents by repository/worktree, pins the checkout containing the launch directory first, and orders other groups by their latest agent update. Each group shows current agents followed by finished runs, with harness, task title, elapsed time, and status. Finished history is retained for the coordinator’s lifetime. Use Up/Down to select a run and Enter to open its agent session’s request history. Queued requests appear first, followed by remaining requests newest first. Enter expands a request’s prompt and response; Escape returns to the overview. Completed statuses are green, and a compact Sub-agents footer summarizes direct child agents. The overview has no application banner or footer. Ctrl+C closes the view without stopping agents.
76
+ Use `subharness dashboard` in a terminal to watch agents managed by the local coordinator. The live view groups agents by repository/worktree, pins the checkout containing the launch directory first, and orders other groups by their latest agent update. Each group shows current agents followed by finished runs, with harness, task title, elapsed time, and status. Finished history is retained for the coordinator’s lifetime. Use Up/Down to select a run and Enter to open its agent session’s request history. Queued requests appear first, followed by remaining requests newest first. Enter on a request opens a dedicated task screen with the agent/task summary, original request, error and latest response. The screen subscribes to live events and renders arriving text, reasoning, tool and approval steps, with inline error notices; Enter expands a step’s bounded details. Past events are not loaded. Earlier content appears only if the native route later supplies it in a snapshot; chunk-only mid-item views remain incomplete. The screen keeps at most 500 steps, dropping the oldest with a visible omission notice. Leaving closes the subscription. The dashboard does not load user extensions. Escape returns to the request list, then to the overview. Completed statuses are green, and a compact Sub-agents footer summarizes direct child agents. The overview has no application banner or footer. Ctrl+C closes the view without stopping agents.
77
77
 
78
78
  ## Run agents from application code
79
79
 
@@ -127,7 +127,18 @@ try {
127
127
 
128
128
  Use `connect({ start: false })` for strict attachment. Approval requests advertise actions; submit a chosen action with `client.approvals.respond(request.id, { actionId: action.id })`, adding explicitly selected grants when required. Applications can render the supplied labels without provider-specific branches.
129
129
 
130
- The SDK exposes complete responses, task states, and approvals, without token deltas or native tool-progress events. History lasts for the owning coordinator's lifetime; restart recovery is not provided. See the [execution API](sdk/execution.md) and [chat-tool example](sdk/examples/chat-tool.ts) for lifecycle and integration details. Embedded access is explicit through `createRunner({ access, env })`; connected sessions use the CLI's existing project access settings.
130
+ The SDK exposes complete responses, task states, approvals and [normalized live session events](sdk/events.md), including bounded assistant text, provider-exposed reasoning and tool previews where the native route supports them. Await `events.open({ scope })` before submitting work to observe its initial events. Only events accepted after registration are delivered; applications own any event persistence. Complete-response history keeps its existing execution-owner lifetime. See the [execution API](sdk/execution.md) and [chat-tool example](sdk/examples/chat-tool.ts) for lifecycle details. Embedded access is explicit through `createRunner({ access, env })`; connected sessions use the CLI's project access settings.
131
+
132
+ ## Add custom event handlers
133
+
134
+ [User extensions](sdk/extensions.md) are self-contained compiled ESM modules installed under `~/.subharness/extensions/<id>/` or a checkout's `.subharness/extensions/<id>/`. Explicit per-user consent in the owner-only `~/.subharness/extensions.json` file selects which newly admitted coordinator sessions they observe:
135
+
136
+ ```sh
137
+ subharness extensions list
138
+ subharness extensions enable global:tool-result-logger
139
+ ```
140
+
141
+ The coordinator starts each enabled extension in a separate supervised process when its first matching session is admitted. Discovery reads static manifests only. Global extensions receive new coordinator sessions across workspaces; repository extensions receive new sessions in their enabled checkout. This applies to both CLI and connected SDK creation. Embedded runners do not load extensions; application code consumes `events.open` directly. See the [complete logger example](sdk/extensions.md#complete-tool-result-logger) and [extension commands](sdk/cli/extensions.md).
131
142
 
132
143
  ## Define a reusable specialist
133
144
 
@@ -165,9 +176,10 @@ subharness send <session-id> --delivery steer --prompt "Keep the existing API co
165
176
  subharness wait <task-id> [--after <response-id>]
166
177
  subharness status <task-id> --full
167
178
  subharness cancel <task-id>
179
+ subharness close <session-id>
168
180
  ```
169
181
 
170
- Commands print task/session identifiers and return one complete response with its response identifier and task state. `wait` returns or awaits the first retained response when `--after` is omitted, and the next response after that cursor when it is supplied. Pending descendant work can continue after that command exits. Run or wait commands can use your assistant's background-task facilities. Native steering is used when supported; otherwise `steer` behaves as `interrupt`, cancels affected descendants, preserves independently queued tasks, and reports the effective mode.
182
+ Commands print task/session identifiers and return one complete response with its response identifier and task state. `wait` returns or awaits the first retained response when `--after` is omitted, and the next response after that cursor when it is supplied. Pending descendant work can continue after that command exits. Run or wait commands can use your assistant's background-task facilities. Native steering is used when supported; otherwise `steer` behaves as `interrupt`, cancels affected descendants, preserves independently queued tasks, and reports the effective mode. Cancel and interrupt stop the active native turn; close a session when it is no longer needed so the native harness can clean up background tool processes it tracks across turns.
171
183
 
172
184
  Long prompts can use `--prompt-file`. Output is compact text by default; `--format jsonl` selects typed integration records without forwarding native token or tool streams.
173
185
 
@@ -237,7 +249,7 @@ subharness run subagent:reviewer --cwd /path/to/worktree --prompt "Review the im
237
249
 
238
250
  The library supplies the parent context. Declaring `subagents` authorizes their invocation. Claude Code receives permissions scoped to its session launcher, declared children, and coordination commands; native approval rules and sandbox restrictions still apply. Children receive explicit task context rather than a copy of the parent's transcript. Cancellation propagates through delegated descendants; a parent task completes after child results and its own continuation are handled.
239
251
 
240
- This checkout includes nine [repository roles](sdk/project-team.md): the Astra `architect` and `planner`; Sol `developer` and `integrator`; Luna `api-researcher` and `systems-researcher`; Opus `reviewer`; Gemini `researcher`; and Fable 5.1 `visual-engineer` through fx. Reusable techniques live in `.agents/skills/` and are read only when the task needs them; a new technique does not require another agent definition. Discover the roles with `subharness list` and invoke them through `repo:<name>`. Skill loading, native capability limits, and the image-task execution path are documented with the team.
252
+ This checkout includes ten [repository roles](sdk/project-team.md): the Astra `architect` and `planner`; Sol `developer` and `integrator`; Luna `api-researcher` and `systems-researcher`; Opus `reviewer`; and, through fx, Sonnet 5.5 `get-context`, Gemini `researcher`, and Fable 5.1 `visual-engineer`. Reusable techniques live in `.agents/skills/` and are read only when the task needs them; a new technique does not require another agent definition. Discover the roles with `subharness list` and invoke them through `repo:<name>`. Skill loading, native capability limits, and the image-task execution path are documented with the team.
241
253
 
242
254
  ## Boundaries
243
255
 
@@ -272,6 +284,6 @@ pnpm run check:package
272
284
 
273
285
  `pnpm run check` builds the current SDK first, then runs TypeScript checking and behavioral tests. Building first lets repository agent definitions import the package's current exports on a clean checkout and prevents tests from exercising stale build output. Tests cover native protocol boundaries, credential selection, worktrees, task queues, cancellation races, nested CLI execution, and process lifetime. The default suite runs two test files at a time to keep subprocess-heavy protocol fixtures within their timing budgets.
274
286
 
275
- `pnpm run check:package` packs the SDK and verifies installation, public types, embedded execution, shared CLI/SDK sessions, the chat-tool example, and CLI agent discovery in a temporary consumer project. It downloads dependencies from the public npm registry with install lifecycle scripts disabled and uses a fake native harness without calling a coding model.
287
+ `pnpm run check:package` packs the current SDK and verifies the packaged file boundary, installation, execution SDK imports, `./extensions` subpath resolution, definition and `SessionEvent` type imports from `subharness/extensions`, extension compilation without a Subharness runtime import, inline execution against a controlled native protocol fixture, and installed CLI agent discovery in a clean temporary consumer without source-checkout access. It downloads dependencies from the public npm registry with install lifecycle scripts disabled and uses a fake native harness without calling a coding model.
276
288
 
277
289
  The [SDK documentation](sdk/index.md) describes the final contracts. [AGENTS.md](AGENTS.md) defines the project's documentation, TDD, and review workflow. Comparative research and review evidence are kept in the ignored `.context` directory.
@@ -0,0 +1,71 @@
1
+ import type { MessagePort } from "node:worker_threads";
2
+ import type { AdapterDraft, AudienceToken } from "./event-types.js";
3
+ import type { SessionEventCapabilities } from "../sdk/event-types.js";
4
+ import type { ClaudeObservationParentMessage } from "./claude-worker-protocol.js";
5
+ export declare const CLAUDE_EVENT_CAPABILITIES: SessionEventCapabilities;
6
+ type DraftSink = (audience: AudienceToken, draft: AdapterDraft) => void;
7
+ export declare class ClaudeEventNormalizer {
8
+ private readonly secrets;
9
+ private readonly sink;
10
+ private operationId?;
11
+ private readonly audiences;
12
+ private readonly delivered;
13
+ private readonly text;
14
+ private readonly openItems;
15
+ private readonly identities;
16
+ private readonly blocks;
17
+ private readonly tools;
18
+ private streamMessageId?;
19
+ private syntheticOrdinal;
20
+ private identityOverflowed;
21
+ private finalCandidate?;
22
+ constructor(secrets: readonly string[], sink: DraftSink);
23
+ setDemand(operationId: string, audiences: readonly AudienceToken[]): void;
24
+ handle(value: unknown): void;
25
+ clear(): void;
26
+ private trackStreamMetadata;
27
+ private trackAssistantMetadata;
28
+ private streamBlock;
29
+ private syntheticItemKey;
30
+ private handleStream;
31
+ private handleAssistant;
32
+ complete(value: unknown): string | undefined;
33
+ private completeUnsafe;
34
+ private finishStreamBlock;
35
+ private handleUser;
36
+ private pushDelta;
37
+ private captureError;
38
+ private admitItem;
39
+ private captureIdentityOverflow;
40
+ private emitIdentityOverflow;
41
+ private captureOpenItemOverflow;
42
+ private emit;
43
+ }
44
+ export declare class ClaudeObservationChannel {
45
+ private readonly port;
46
+ private operationId?;
47
+ private generation;
48
+ private readonly audiences;
49
+ private readonly normalizer;
50
+ private readonly drainWaiters;
51
+ private completeAck?;
52
+ constructor(port: MessagePort, secrets: readonly string[]);
53
+ control(message: ClaudeObservationParentMessage): void;
54
+ observe(message: unknown): boolean;
55
+ complete(message: unknown): Promise<void>;
56
+ close(): void;
57
+ private demand;
58
+ private reportInvalidDemand;
59
+ private offer;
60
+ private pump;
61
+ private acknowledge;
62
+ private failAudience;
63
+ private acknowledgeComplete;
64
+ private drained;
65
+ private checkDrained;
66
+ private isDrained;
67
+ private retireAudiences;
68
+ private reset;
69
+ private post;
70
+ }
71
+ export {};