@agentclientprotocol/claude-agent-acp 0.102.1-preview.1 → 0.102.1-preview.3

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 (229) hide show
  1. package/README.md +5 -1
  2. package/dist/acp-agent.d.ts +93 -622
  3. package/dist/acp-agent.d.ts.map +1 -1
  4. package/dist/acp-agent.js +369 -3474
  5. package/dist/acp-client.d.ts +28 -0
  6. package/dist/acp-client.d.ts.map +1 -0
  7. package/dist/acp-client.js +1 -0
  8. package/dist/acp-subagents.d.ts +1 -2
  9. package/dist/acp-subagents.d.ts.map +1 -1
  10. package/dist/auth-methods.d.ts +21 -0
  11. package/dist/auth-methods.d.ts.map +1 -0
  12. package/dist/auth-methods.js +68 -0
  13. package/dist/auth-status-reporter.d.ts +112 -0
  14. package/dist/auth-status-reporter.d.ts.map +1 -0
  15. package/dist/auth-status-reporter.js +253 -0
  16. package/dist/background-work.d.ts +12 -265
  17. package/dist/background-work.d.ts.map +1 -1
  18. package/dist/background-work.js +8 -558
  19. package/dist/client-system-prompt.d.ts +7 -0
  20. package/dist/client-system-prompt.d.ts.map +1 -1
  21. package/dist/client-system-prompt.js +24 -0
  22. package/dist/context-compaction.d.ts +20 -0
  23. package/dist/context-compaction.d.ts.map +1 -1
  24. package/dist/context-compaction.js +26 -0
  25. package/dist/context-window.d.ts +70 -0
  26. package/dist/context-window.d.ts.map +1 -0
  27. package/dist/context-window.js +132 -0
  28. package/dist/diff.d.ts +1 -1
  29. package/dist/diff.js +1 -1
  30. package/dist/elicitation.d.ts +66 -1
  31. package/dist/elicitation.d.ts.map +1 -1
  32. package/dist/elicitation.js +109 -0
  33. package/dist/file-change-audit.d.ts +4 -3
  34. package/dist/file-change-audit.d.ts.map +1 -1
  35. package/dist/file-change-audit.js +3 -2
  36. package/dist/lib.d.ts +5 -1
  37. package/dist/lib.d.ts.map +1 -1
  38. package/dist/lib.js +3 -1
  39. package/dist/logger.d.ts +10 -0
  40. package/dist/logger.d.ts.map +1 -0
  41. package/dist/logger.js +1 -0
  42. package/dist/mcp-oauth.d.ts +44 -0
  43. package/dist/mcp-oauth.d.ts.map +1 -0
  44. package/dist/mcp-oauth.js +142 -0
  45. package/dist/mcp-servers.d.ts +10 -0
  46. package/dist/mcp-servers.d.ts.map +1 -0
  47. package/dist/mcp-servers.js +29 -0
  48. package/dist/message-filters.d.ts +43 -0
  49. package/dist/message-filters.d.ts.map +1 -0
  50. package/dist/message-filters.js +197 -0
  51. package/dist/native-subagents.d.ts +18 -8
  52. package/dist/native-subagents.d.ts.map +1 -1
  53. package/dist/native-subagents.js +7 -35
  54. package/dist/new-session-meta.d.ts +40 -0
  55. package/dist/new-session-meta.d.ts.map +1 -0
  56. package/dist/new-session-meta.js +1 -0
  57. package/dist/permissions/presentation.d.ts +29 -0
  58. package/dist/permissions/presentation.d.ts.map +1 -1
  59. package/dist/permissions/presentation.js +38 -11
  60. package/dist/prompt-suggestions.d.ts +29 -0
  61. package/dist/prompt-suggestions.d.ts.map +1 -1
  62. package/dist/prompt-suggestions.js +45 -0
  63. package/dist/prompt-to-claude.d.ts +10 -0
  64. package/dist/prompt-to-claude.d.ts.map +1 -0
  65. package/dist/prompt-to-claude.js +120 -0
  66. package/dist/providers.d.ts +139 -0
  67. package/dist/providers.d.ts.map +1 -0
  68. package/dist/providers.js +286 -0
  69. package/dist/remote-control.d.ts +62 -0
  70. package/dist/remote-control.d.ts.map +1 -0
  71. package/dist/remote-control.js +78 -0
  72. package/dist/result-end.d.ts +68 -0
  73. package/dist/result-end.d.ts.map +1 -0
  74. package/dist/result-end.js +84 -0
  75. package/dist/sdk-to-acp.d.ts +93 -0
  76. package/dist/sdk-to-acp.d.ts.map +1 -0
  77. package/dist/sdk-to-acp.js +635 -0
  78. package/dist/serve.d.ts +9 -3
  79. package/dist/serve.d.ts.map +1 -1
  80. package/dist/serve.js +10 -5
  81. package/dist/session-config-ids.d.ts +1 -0
  82. package/dist/session-config-ids.d.ts.map +1 -1
  83. package/dist/session-config-ids.js +1 -0
  84. package/dist/session-config-options.d.ts +64 -0
  85. package/dist/session-config-options.d.ts.map +1 -0
  86. package/dist/session-config-options.js +162 -0
  87. package/dist/session-effort.d.ts +67 -0
  88. package/dist/session-effort.d.ts.map +1 -1
  89. package/dist/session-effort.js +98 -0
  90. package/dist/session-env.d.ts +22 -0
  91. package/dist/session-env.d.ts.map +1 -0
  92. package/dist/session-env.js +66 -0
  93. package/dist/session-fast-mode.d.ts +83 -0
  94. package/dist/session-fast-mode.d.ts.map +1 -0
  95. package/dist/session-fast-mode.js +142 -0
  96. package/dist/session-index/connection.d.ts +5 -6
  97. package/dist/session-index/connection.d.ts.map +1 -1
  98. package/dist/session-index/connection.js +3 -5
  99. package/dist/session-mode.d.ts +1 -0
  100. package/dist/session-mode.d.ts.map +1 -1
  101. package/dist/session-mode.js +1 -1
  102. package/dist/session-model.d.ts +41 -0
  103. package/dist/session-model.d.ts.map +1 -1
  104. package/dist/session-model.js +110 -45
  105. package/dist/session-notices.d.ts +44 -0
  106. package/dist/session-notices.d.ts.map +1 -1
  107. package/dist/session-notices.js +68 -0
  108. package/dist/session-titles.d.ts +34 -12
  109. package/dist/session-titles.d.ts.map +1 -1
  110. package/dist/session-titles.js +7 -6
  111. package/dist/session-usage.d.ts +125 -0
  112. package/dist/session-usage.d.ts.map +1 -0
  113. package/dist/session-usage.js +196 -0
  114. package/dist/slash-commands.d.ts +10 -0
  115. package/dist/slash-commands.d.ts.map +1 -0
  116. package/dist/slash-commands.js +99 -0
  117. package/dist/streamed-text.d.ts +33 -0
  118. package/dist/streamed-text.d.ts.map +1 -0
  119. package/dist/streamed-text.js +71 -0
  120. package/dist/subagent-configuration.d.ts +32 -0
  121. package/dist/subagent-configuration.d.ts.map +1 -0
  122. package/dist/subagent-configuration.js +70 -0
  123. package/dist/subagent-replay.d.ts +18 -0
  124. package/dist/subagent-replay.d.ts.map +1 -1
  125. package/dist/subagent-replay.js +25 -15
  126. package/dist/tool-calls/client-capabilities.d.ts +8 -8
  127. package/dist/tool-calls/client-capabilities.js +4 -4
  128. package/dist/tool-calls/renderer.d.ts +4 -5
  129. package/dist/tool-calls/renderer.d.ts.map +1 -1
  130. package/dist/tool-calls/renderer.js +4 -5
  131. package/dist/turn-events.d.ts +6 -46
  132. package/dist/turn-events.d.ts.map +1 -1
  133. package/dist/utils.d.ts +1 -1
  134. package/dist/utils.d.ts.map +1 -1
  135. package/dist/v2/agent.d.ts +7 -11
  136. package/dist/v2/agent.d.ts.map +1 -1
  137. package/dist/v2/agent.js +751 -331
  138. package/dist/v2/air.d.ts +33 -0
  139. package/dist/v2/air.d.ts.map +1 -0
  140. package/dist/v2/air.js +29 -0
  141. package/dist/v2/auth.d.ts +97 -0
  142. package/dist/v2/auth.d.ts.map +1 -0
  143. package/dist/v2/auth.js +216 -0
  144. package/dist/v2/background.d.ts +27 -16
  145. package/dist/v2/background.d.ts.map +1 -1
  146. package/dist/v2/background.js +4 -32
  147. package/dist/v2/child-config.d.ts +55 -0
  148. package/dist/v2/child-config.d.ts.map +1 -0
  149. package/dist/v2/child-config.js +92 -0
  150. package/dist/v2/clear-context.d.ts +94 -0
  151. package/dist/v2/clear-context.d.ts.map +1 -0
  152. package/dist/v2/clear-context.js +176 -0
  153. package/dist/v2/commands.d.ts +46 -0
  154. package/dist/v2/commands.d.ts.map +1 -0
  155. package/dist/v2/commands.js +54 -0
  156. package/dist/v2/config.d.ts +187 -0
  157. package/dist/v2/config.d.ts.map +1 -0
  158. package/dist/v2/config.js +494 -0
  159. package/dist/v2/elicitation.d.ts +93 -0
  160. package/dist/v2/elicitation.d.ts.map +1 -0
  161. package/dist/v2/elicitation.js +160 -0
  162. package/dist/v2/file-changes.d.ts +61 -0
  163. package/dist/v2/file-changes.d.ts.map +1 -0
  164. package/dist/v2/file-changes.js +108 -0
  165. package/dist/v2/file-preview.d.ts +18 -0
  166. package/dist/v2/file-preview.d.ts.map +1 -0
  167. package/dist/v2/file-preview.js +29 -0
  168. package/dist/v2/initialize.d.ts +10 -24
  169. package/dist/v2/initialize.d.ts.map +1 -1
  170. package/dist/v2/initialize.js +4 -111
  171. package/dist/v2/outcome.d.ts +81 -0
  172. package/dist/v2/outcome.d.ts.map +1 -0
  173. package/dist/v2/outcome.js +166 -0
  174. package/dist/v2/permissions.d.ts +92 -0
  175. package/dist/v2/permissions.d.ts.map +1 -0
  176. package/dist/v2/permissions.js +162 -0
  177. package/dist/v2/prompt.d.ts +2 -42
  178. package/dist/v2/prompt.d.ts.map +1 -1
  179. package/dist/v2/prompt.js +2 -119
  180. package/dist/v2/remote-control.d.ts +41 -0
  181. package/dist/v2/remote-control.d.ts.map +1 -0
  182. package/dist/v2/remote-control.js +63 -0
  183. package/dist/v2/reports.d.ts +198 -0
  184. package/dist/v2/reports.d.ts.map +1 -0
  185. package/dist/v2/reports.js +487 -0
  186. package/dist/v2/restarts.d.ts +128 -0
  187. package/dist/v2/restarts.d.ts.map +1 -0
  188. package/dist/v2/restarts.js +348 -0
  189. package/dist/v2/session-requests.d.ts +20 -0
  190. package/dist/v2/session-requests.d.ts.map +1 -0
  191. package/dist/v2/session-requests.js +108 -0
  192. package/dist/v2/session-update.d.ts +2 -13
  193. package/dist/v2/session-update.d.ts.map +1 -1
  194. package/dist/v2/session-update.js +2 -22
  195. package/dist/v2/session.d.ts +340 -41
  196. package/dist/v2/session.d.ts.map +1 -1
  197. package/dist/v2/session.js +1224 -141
  198. package/dist/v2/setup.d.ts +49 -0
  199. package/dist/v2/setup.d.ts.map +1 -0
  200. package/dist/v2/setup.js +62 -0
  201. package/dist/v2/stopped-work.d.ts +123 -0
  202. package/dist/v2/stopped-work.d.ts.map +1 -0
  203. package/dist/v2/stopped-work.js +210 -0
  204. package/dist/v2/stream.d.ts +229 -0
  205. package/dist/v2/stream.d.ts.map +1 -0
  206. package/dist/v2/stream.js +507 -0
  207. package/dist/v2/subagent-replay.d.ts +115 -0
  208. package/dist/v2/subagent-replay.d.ts.map +1 -0
  209. package/dist/v2/subagent-replay.js +479 -0
  210. package/dist/v2/subscription-guard.d.ts +60 -0
  211. package/dist/v2/subscription-guard.d.ts.map +1 -0
  212. package/dist/v2/subscription-guard.js +84 -0
  213. package/dist/v2/tasks.d.ts +492 -0
  214. package/dist/v2/tasks.d.ts.map +1 -0
  215. package/dist/v2/tasks.js +1728 -0
  216. package/dist/v2/terminal.d.ts.map +1 -1
  217. package/dist/v2/terminal.js +6 -1
  218. package/dist/v2/tool-call.d.ts +3 -2
  219. package/dist/v2/tool-call.d.ts.map +1 -1
  220. package/dist/v2/update-translator.d.ts +36 -0
  221. package/dist/v2/update-translator.d.ts.map +1 -0
  222. package/dist/v2/update-translator.js +80 -0
  223. package/dist/workflow-progress.d.ts +23 -0
  224. package/dist/workflow-progress.d.ts.map +1 -1
  225. package/dist/workflow-progress.js +31 -8
  226. package/package.json +1 -1
  227. package/dist/v2/permission.d.ts +0 -28
  228. package/dist/v2/permission.d.ts.map +0 -1
  229. package/dist/v2/permission.js +0 -41
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The text and thinking of an assistant message that streamed live as
3
+ * deltas, and what its consolidated message adds to them. Shared by the v1
4
+ * core and the v2 core.
5
+ */
6
+ import type { SDKPartialAssistantMessage } from "@anthropic-ai/claude-agent-sdk";
7
+ /** Text or thinking that streamed live as deltas, accumulated per block. */
8
+ export type StreamedBlock = {
9
+ index: number;
10
+ type: "text" | "thinking";
11
+ text: string;
12
+ };
13
+ /**
14
+ * Records the text or thinking that `event` streamed in `streamedBlocks`.
15
+ * Contiguous deltas of the same block (same index and type) extend the
16
+ * current entry; anything else opens a new one. Other events change nothing.
17
+ */
18
+ export declare function recordStreamedDelta(streamedBlocks: StreamedBlock[], event: SDKPartialAssistantMessage["event"]): void;
19
+ /**
20
+ * The blocks of a consolidated assistant message without the text that
21
+ * already streamed as deltas.
22
+ *
23
+ * Each assembled text/thinking block is diffed against the streamed blocks in
24
+ * document order: nothing is left if it streamed in full (the common case),
25
+ * the whole block if it never streamed (a non-streaming gateway), and just the
26
+ * tail if the stream was cut short mid-block. Matching on content rather than
27
+ * the message id keeps the dedupe robust for gateways without a stable id.
28
+ * Tool-use and other blocks pass through untouched.
29
+ */
30
+ export declare function unstreamedRemainder<Block extends {
31
+ type: string;
32
+ }>(blocks: Block[], streamedBlocks: StreamedBlock[]): Block[];
33
+ //# sourceMappingURL=streamed-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamed-text.d.ts","sourceRoot":"","sources":["../src/streamed-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,aAAa,EAAE,EAC/B,KAAK,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACzC,IAAI,CAoBN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChE,MAAM,EAAE,KAAK,EAAE,EACf,cAAc,EAAE,aAAa,EAAE,GAC9B,KAAK,EAAE,CA+BT"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Records the text or thinking that `event` streamed in `streamedBlocks`.
3
+ * Contiguous deltas of the same block (same index and type) extend the
4
+ * current entry; anything else opens a new one. Other events change nothing.
5
+ */
6
+ export function recordStreamedDelta(streamedBlocks, event) {
7
+ if (event.type !== "content_block_delta")
8
+ return;
9
+ const delta = event.delta;
10
+ const chunk = delta.type === "text_delta"
11
+ ? { type: "text", text: delta.text }
12
+ : delta.type === "thinking_delta"
13
+ ? { type: "thinking", text: delta.thinking }
14
+ : undefined;
15
+ // Skip empty deltas (some gateways emit empty thinking chunks — #793):
16
+ // appending "" is a no-op, but pushing a "" entry would create a block the
17
+ // `text.length > 0` guard of `unstreamedRemainder` can never consume,
18
+ // stalling the diff cursor and re-emitting the next block as a duplicate.
19
+ if (!chunk?.text)
20
+ return;
21
+ const last = streamedBlocks[streamedBlocks.length - 1];
22
+ if (last && last.index === event.index && last.type === chunk.type) {
23
+ last.text += chunk.text;
24
+ }
25
+ else {
26
+ streamedBlocks.push({ index: event.index, type: chunk.type, text: chunk.text });
27
+ }
28
+ }
29
+ /**
30
+ * The blocks of a consolidated assistant message without the text that
31
+ * already streamed as deltas.
32
+ *
33
+ * Each assembled text/thinking block is diffed against the streamed blocks in
34
+ * document order: nothing is left if it streamed in full (the common case),
35
+ * the whole block if it never streamed (a non-streaming gateway), and just the
36
+ * tail if the stream was cut short mid-block. Matching on content rather than
37
+ * the message id keeps the dedupe robust for gateways without a stable id.
38
+ * Tool-use and other blocks pass through untouched.
39
+ */
40
+ export function unstreamedRemainder(blocks, streamedBlocks) {
41
+ const kept = [];
42
+ let streamPos = 0;
43
+ for (const item of blocks) {
44
+ if (item.type !== "text" && item.type !== "thinking") {
45
+ kept.push(item);
46
+ continue;
47
+ }
48
+ const block = item;
49
+ const full = (item.type === "text" ? block.text : block.thinking) ?? "";
50
+ // Empty assembled blocks carry nothing: drop them.
51
+ if (full.length === 0)
52
+ continue;
53
+ // A streamed block of the same type whose text is a prefix of this one
54
+ // was already delivered, at least partly. A non-empty streamed text is
55
+ // required so an empty or aborted streamed block does not swallow it.
56
+ const streamed = streamedBlocks[streamPos];
57
+ if (streamed &&
58
+ streamed.type === item.type &&
59
+ streamed.text.length > 0 &&
60
+ full.startsWith(streamed.text)) {
61
+ streamPos++;
62
+ const remainder = full.slice(streamed.text.length);
63
+ if (remainder.length === 0)
64
+ continue;
65
+ kept.push({ ...item, [item.type === "text" ? "text" : "thinking"]: remainder });
66
+ continue;
67
+ }
68
+ kept.push(item);
69
+ }
70
+ return kept;
71
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The configuration of a subagent's session, as its hooks report it. Both
3
+ * the v1 core (`ClaudeAcpAgent.subagentConfigurationHook`, for both forms of
4
+ * subagent sessions) and the v2 core (`v2/child-config.ts`)
5
+ * build a child's config options with these.
6
+ */
7
+ import type { SessionConfigOption, SessionModeState } from "@agentclientprotocol/sdk/unstable";
8
+ import type { AgentInfo, HookInput } from "@anthropic-ai/claude-agent-sdk";
9
+ import { type SubagentModels } from "./native-subagents.js";
10
+ /** What the root session knows that a child's options name. */
11
+ export type SubagentConfigurationContext = {
12
+ /** The root session's modes, for the name of the child's mode. */
13
+ availableModes: SessionModeState["availableModes"];
14
+ /** The root session's `model` entries, for the child's model. */
15
+ models: SubagentModels | undefined;
16
+ /** The custom agents of the session, for the description of the child's agent type. */
17
+ agents: readonly AgentInfo[];
18
+ };
19
+ /**
20
+ * The config options that a hook of a subagent (`agent_id`) reports of it:
21
+ * its permission mode, its model after a `PostModelSwitch`, its effort, and
22
+ * its agent type. Each option lists only the child's current value. Empty
23
+ * for a hook of the root session, and for one that reports none of these.
24
+ */
25
+ export declare function subagentHookOptions(input: HookInput, context: SubagentConfigurationContext): SessionConfigOption[];
26
+ /**
27
+ * A child's configuration, as it goes to the client: every option it holds,
28
+ * the mode first, then the model, the effort and the model config, then the
29
+ * rest in the order they came.
30
+ */
31
+ export declare function orderedSubagentConfiguration(options: Iterable<SessionConfigOption>): SessionConfigOption[];
32
+ //# sourceMappingURL=subagent-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagent-configuration.d.ts","sourceRoot":"","sources":["../src/subagent-configuration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKlG,+DAA+D;AAC/D,MAAM,MAAM,4BAA4B,GAAG;IACzC,kEAAkE;IAClE,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,iEAAiE;IACjE,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,uFAAuF;IACvF,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,4BAA4B,GACpC,mBAAmB,EAAE,CA+CvB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACrC,mBAAmB,EAAE,CAOvB"}
@@ -0,0 +1,70 @@
1
+ import { childModelOption, responseModelEntry } from "./native-subagents.js";
2
+ import { AGENT_CONFIG_ID, EFFORT_CONFIG_ID } from "./session-config-ids.js";
3
+ import { effortLevelName } from "./session-effort.js";
4
+ import { SessionModeManager } from "./session-mode.js";
5
+ /**
6
+ * The config options that a hook of a subagent (`agent_id`) reports of it:
7
+ * its permission mode, its model after a `PostModelSwitch`, its effort, and
8
+ * its agent type. Each option lists only the child's current value. Empty
9
+ * for a hook of the root session, and for one that reports none of these.
10
+ */
11
+ export function subagentHookOptions(input, context) {
12
+ if (!input.agent_id)
13
+ return [];
14
+ const options = [];
15
+ if (input.permission_mode) {
16
+ const mode = context.availableModes.find((mode) => mode.id === input.permission_mode);
17
+ options.push(SessionModeManager.configOption({
18
+ currentModeId: input.permission_mode,
19
+ availableModes: [mode ?? { id: input.permission_mode, name: input.permission_mode }],
20
+ }));
21
+ }
22
+ const switchedModel = input.hook_event_name === "PostModelSwitch"
23
+ ? responseModelEntry(input.to_model, context.models)
24
+ : undefined;
25
+ // The entry of the root session's `model` option, as for a child response.
26
+ if (switchedModel)
27
+ options.push(childModelOption(switchedModel));
28
+ if (input.effort?.level) {
29
+ options.push({
30
+ id: EFFORT_CONFIG_ID,
31
+ name: "Effort",
32
+ description: "Current reasoning effort",
33
+ category: "thought_level",
34
+ type: "select",
35
+ currentValue: input.effort.level,
36
+ options: [{ value: input.effort.level, name: effortLevelName(input.effort.level) }],
37
+ });
38
+ }
39
+ if (input.agent_type) {
40
+ const agent = context.agents.find((agent) => agent.name === input.agent_type);
41
+ options.push({
42
+ id: AGENT_CONFIG_ID,
43
+ name: "Agent",
44
+ description: "Subagent type",
45
+ type: "select",
46
+ currentValue: input.agent_type,
47
+ options: [
48
+ {
49
+ value: input.agent_type,
50
+ name: input.agent_type,
51
+ ...(agent?.description ? { description: agent.description } : {}),
52
+ },
53
+ ],
54
+ });
55
+ }
56
+ return options;
57
+ }
58
+ /**
59
+ * A child's configuration, as it goes to the client: every option it holds,
60
+ * the mode first, then the model, the effort and the model config, then the
61
+ * rest in the order they came.
62
+ */
63
+ export function orderedSubagentConfiguration(options) {
64
+ const priority = ["mode", "model", "thought_level", "model_config"];
65
+ const rank = (option) => {
66
+ const index = priority.indexOf(option.category ?? "");
67
+ return index < 0 ? priority.length : index;
68
+ };
69
+ return [...options].sort((left, right) => rank(left) - rank(right));
70
+ }
@@ -198,5 +198,23 @@ export declare function firstResponseModel(messages: readonly SessionMessage[]):
198
198
  * names a stop is a cancellation, any other error a failure.
199
199
  */
200
200
  export declare function replaySubagentTerminalState(block: Record<string, unknown>): "completed" | "failed" | "cancelled";
201
+ /** A message that a SendMessage call delivered to the child. */
202
+ export declare function isDelivery(message: SessionMessage): boolean;
203
+ /**
204
+ * The SendMessage call of `calls` that a delivered message `text` came from,
205
+ * for the child that `names` names (its agent id, its name). Claude Code
206
+ * frames the message for the child's model ("The coordinator sent a message
207
+ * while you were working:", then the message, then an instruction), so it is
208
+ * the first undelivered call to the child whose message the text contains.
209
+ */
210
+ export declare function deliveredCall<T extends {
211
+ to: string;
212
+ message: string;
213
+ recipientSessionId?: string;
214
+ }>(calls: readonly T[], names: readonly unknown[], text: string): T | undefined;
215
+ /** The notice that the history of `missing` subagents of a replayed session is not available. */
216
+ export declare function missingHistoryNotice(missing: number): Extract<AcpSessionNotification["update"], {
217
+ sessionUpdate: "notice";
218
+ }>;
201
219
  export {};
202
220
  //# sourceMappingURL=subagent-replay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-replay.d.ts","sourceRoot":"","sources":["../src/subagent-replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAOL,KAAK,UAAU,EAMf,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE7E,KAAK,OAAO,GAAG,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvE,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG;IACxB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,wCAAwC;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,mEAAmE;IACnE,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,2FAA2F;IAC3F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,O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,GAAG,WAAW,CAMtC;AA4DD,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,EACtE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAO7E;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE;IAAE,aAAa,EAAE,QAAQ,CAAA;CAAE,CAAC,CASxE"}
@@ -264,16 +264,7 @@ export class RfdSubagentReplay {
264
264
  }
265
265
  const missing = this.omitted.size + this.withoutHistory;
266
266
  if (missing > 0 && supportsNotices) {
267
- await this.publish({
268
- sessionId: rootSessionId,
269
- update: noticeUpdate({
270
- severity: "info",
271
- title: "Some subagent history is not available",
272
- description: missing === 1
273
- ? "The history of 1 subagent of this session could not be restored."
274
- : `The history of ${missing} subagents of this session could not be restored.`,
275
- }),
276
- });
267
+ await this.publish({ sessionId: rootSessionId, update: missingHistoryNotice(missing) });
277
268
  }
278
269
  }
279
270
  /**
@@ -364,10 +355,7 @@ export class RfdSubagentReplay {
364
355
  * call (see {@link toolCallUpdate}).
365
356
  */
366
357
  async sendDelivery(child, message, text) {
367
- const names = [child.sessionId, child.record.name, child.input.name];
368
- const call = this.sendMessages.find((candidate) => candidate.recipientSessionId === undefined &&
369
- names.includes(candidate.to) &&
370
- text.includes(candidate.message.trim()));
358
+ const call = deliveredCall(this.sendMessages, [child.sessionId, child.record.name, child.input.name], text);
371
359
  if (call) {
372
360
  call.recipientSessionId = child.sessionId;
373
361
  await this.sendMessage(child, call.toolUseId, call.message, call.senderSessionId, {
@@ -470,6 +458,28 @@ function isDirectory(dir) {
470
458
  }
471
459
  }
472
460
  /** A message that a SendMessage call delivered to the child. */
473
- function isDelivery(message) {
461
+ export function isDelivery(message) {
474
462
  return message.origin?.kind === "coordinator";
475
463
  }
464
+ /**
465
+ * The SendMessage call of `calls` that a delivered message `text` came from,
466
+ * for the child that `names` names (its agent id, its name). Claude Code
467
+ * frames the message for the child's model ("The coordinator sent a message
468
+ * while you were working:", then the message, then an instruction), so it is
469
+ * the first undelivered call to the child whose message the text contains.
470
+ */
471
+ export function deliveredCall(calls, names, text) {
472
+ return calls.find((call) => call.recipientSessionId === undefined &&
473
+ names.includes(call.to) &&
474
+ text.includes(call.message.trim()));
475
+ }
476
+ /** The notice that the history of `missing` subagents of a replayed session is not available. */
477
+ export function missingHistoryNotice(missing) {
478
+ return noticeUpdate({
479
+ severity: "info",
480
+ title: "Some subagent history is not available",
481
+ description: missing === 1
482
+ ? "The history of 1 subagent of this session could not be restored."
483
+ : `The history of ${missing} subagents of this session could not be restored.`,
484
+ });
485
+ }
@@ -18,10 +18,10 @@ export declare class ClientCapabilities {
18
18
  readonly air: AirCapabilities;
19
19
  /**
20
20
  * The client speaks ACP v2. Its diffs carry structured `changes` and an
21
- * optional git patch, which a v1 diff cannot express. Only the v2 surface
22
- * sets this, never the capabilities that a client sends. A v2 client also
23
- * takes the terminal extension (`terminalOutput`), which the v2 surface
24
- * sends as display terminals.
21
+ * optional git patch, which a v1 diff cannot express. Only the v2 core
22
+ * (`src/v2/`) sets this, never the capabilities that a client
23
+ * sends. A v2 client also takes the terminal extension (`terminalOutput`),
24
+ * which the v2 core sends as display terminals.
25
25
  */
26
26
  readonly v2: boolean;
27
27
  constructor(
@@ -35,10 +35,10 @@ export declare class ClientCapabilities {
35
35
  air?: AirCapabilities,
36
36
  /**
37
37
  * The client speaks ACP v2. Its diffs carry structured `changes` and an
38
- * optional git patch, which a v1 diff cannot express. Only the v2 surface
39
- * sets this, never the capabilities that a client sends. A v2 client also
40
- * takes the terminal extension (`terminalOutput`), which the v2 surface
41
- * sends as display terminals.
38
+ * optional git patch, which a v1 diff cannot express. Only the v2 core
39
+ * (`src/v2/`) sets this, never the capabilities that a client
40
+ * sends. A v2 client also takes the terminal extension (`terminalOutput`),
41
+ * which the v2 core sends as display terminals.
42
42
  */
43
43
  v2?: boolean);
44
44
  static from(capabilities: AcpClientCapabilities | null | undefined, { v2 }?: {
@@ -24,10 +24,10 @@ export class ClientCapabilities {
24
24
  air = NO_AIR,
25
25
  /**
26
26
  * The client speaks ACP v2. Its diffs carry structured `changes` and an
27
- * optional git patch, which a v1 diff cannot express. Only the v2 surface
28
- * sets this, never the capabilities that a client sends. A v2 client also
29
- * takes the terminal extension (`terminalOutput`), which the v2 surface
30
- * sends as display terminals.
27
+ * optional git patch, which a v1 diff cannot express. Only the v2 core
28
+ * (`src/v2/`) sets this, never the capabilities that a client
29
+ * sends. A v2 client also takes the terminal extension (`terminalOutput`),
30
+ * which the v2 core sends as display terminals.
31
31
  */
32
32
  v2 = false) {
33
33
  this.terminalOutput = terminalOutput;
@@ -4,13 +4,12 @@ import { ClientCapabilities } from "./client-capabilities.js";
4
4
  import type { ToolResultContext, ToolResultFacts, ToolUse, ToolUseFacts } from "./facts.js";
5
5
  export type ToolCallUpdate = SessionNotification["update"];
6
6
  /**
7
- * ACP v2's `cancelled` and `paused` tool call statuses. v1's statuses have no
8
- * such values, and the agent builds its reports in v1 types, so they travel as
9
- * v1 statuses. Only a v2 client gets them, and the v2 surface sends them as
10
- * they are (`src/v2/tool-call.ts`).
7
+ * ACP v2's `cancelled` tool call status. v1's statuses have no such value, and
8
+ * the shared mapping builds its reports in v1 types, so it travels as a v1
9
+ * status. Only a v2 client gets it, and the v2 core sends it as it is
10
+ * (`src/v2/tool-call.ts`).
11
11
  */
12
12
  export declare const V2_CANCELLED: ToolCallStatus;
13
- export declare const V2_PAUSED: ToolCallStatus;
14
13
  /** Whether `status` ends a tool call: `completed`, `failed`, or, on v2, `cancelled`. */
15
14
  export declare function isFinalToolCallStatus(status: ToolCallStatus | null | undefined): boolean;
16
15
  /** The `_meta` of a tool call report. */
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/tool-calls/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,IAAI,qBAAqB,EAC3C,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,mCAAmC,CAAC;AAS3C,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM5F,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAK3D;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAA6B,cAAc,CAAC;AACrE,eAAO,MAAM,SAAS,EAA0B,cAAc,CAAC;AAE/D,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAExF;AAED,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE;QAKX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAKlB,YAAY,CAAC,EAAE,OAAO,CAAC;QAIvB,eAAe,CAAC,EAAE,MAAM,CAAC;QAMzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAG1B,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C,CAAC;IAEF,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE;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AI,CAAC,cAAc,EAAE,eAAe,CAAC,GAAG,SAAS;IAWjF;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,GAAG,cAAc;IAsBlB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO;IAgBzD;;;;OAIG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,eAAe,EAAE;IAS1E;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,cAAc;CA2BtF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAStF"}
@@ -10,13 +10,12 @@ import { grepPath } from "./reporters/search.js";
10
10
  /** The id suffix of the call that clears the plan file of an approved plan for AIR. */
11
11
  const PLAN_FILE_CLEAR_SUFFIX = ":plan-file-clear";
12
12
  /**
13
- * ACP v2's `cancelled` and `paused` tool call statuses. v1's statuses have no
14
- * such values, and the agent builds its reports in v1 types, so they travel as
15
- * v1 statuses. Only a v2 client gets them, and the v2 surface sends them as
16
- * they are (`src/v2/tool-call.ts`).
13
+ * ACP v2's `cancelled` tool call status. v1's statuses have no such value, and
14
+ * the shared mapping builds its reports in v1 types, so it travels as a v1
15
+ * status. Only a v2 client gets it, and the v2 core sends it as it is
16
+ * (`src/v2/tool-call.ts`).
17
17
  */
18
18
  export const V2_CANCELLED = "cancelled";
19
- export const V2_PAUSED = "paused";
20
19
  /** Whether `status` ends a tool call: `completed`, `failed`, or, on v2, `cancelled`. */
21
20
  export function isFinalToolCallStatus(status) {
22
21
  return status === "completed" || status === "failed" || status === V2_CANCELLED;
@@ -1,11 +1,7 @@
1
1
  /**
2
- * A prompt turn and the foreground work of a session, as the adapter
3
- * understands them, independent of the ACP version.
4
- *
5
- * The agent reports how each prompt is answered through {@link TurnEvents}:
6
- * ACP v1 answers `session/prompt` when the turn ends or fails, and ACP v2 when
7
- * the prompt is inserted. ACP v2 also reports the session's work as state,
8
- * which the agent reports through {@link ForegroundEvents}.
2
+ * A prompt turn of `ClaudeAcpAgent`. The agent reports how each prompt is
3
+ * answered through {@link TurnEvents}: its `session/prompt` answers when the
4
+ * turn ends or fails.
9
5
  *
10
6
  * The agent calls these synchronously while it updates its own state, so a
11
7
  * handler must not throw, nor call back into the agent before it returns.
@@ -13,8 +9,9 @@
13
9
  export interface TurnEvents {
14
10
  /**
15
11
  * Claude Code took the prompt in as the user message `messageId` of the
16
- * conversation. Reported at most once per turn, and never after
17
- * {@link ended} or {@link failed}.
12
+ * conversation, and the turn is the session's foreground work from then on.
13
+ * Reported at most once per turn, and never after {@link ended} or
14
+ * {@link failed}.
18
15
  *
19
16
  * When Claude Code reports command lifecycles (`msg_lifecycle_v1`), that is
20
17
  * when the prompt starts a turn, before the turn's output. Otherwise, and
@@ -36,43 +33,6 @@ export interface TurnEvents {
36
33
  */
37
34
  failed(error: unknown): void;
38
35
  }
39
- /**
40
- * The foreground work of a session: what a client would wait for before it
41
- * sends the next prompt. One piece of work runs at a time, and the next starts
42
- * with {@link running}. The work is either:
43
- *
44
- * - A prompt's turn, from {@link TurnEvents.inserted} until its result, or
45
- * until it fails or is cancelled. A turn that v1 holds open for the
46
- * background subagents it spawned (`Turn.deferredSettle`) ends its work at
47
- * its result all the same: the hold only delays v1's answer.
48
- * - A model cycle that Claude Code starts on its own while no work runs: for
49
- * example, its follow-up after a background command or subagent finished,
50
- * or its answer to a message from another session. It runs until its result.
51
- *
52
- * A prompt that Claude Code takes in while a cycle runs takes the cycle over:
53
- * the cycle reports nothing more, and the turn reports from there.
54
- */
55
- export interface ForegroundEvents {
56
- /**
57
- * The work started, or works again after it waited for the user. Not after
58
- * a wait that a cancel ended: Claude Code's interrupt withdrew the last
59
- * request, so the work is being stopped, and {@link ended} follows at once.
60
- */
61
- running(): void;
62
- /**
63
- * The work waits for the user: a permission request or a question is open in
64
- * the session. Requests do not say which work they are for, so this includes
65
- * one opened before the work started.
66
- */
67
- awaitingUser(): void;
68
- /** The work ended. */
69
- ended(outcome: TurnOutcome): void;
70
- /**
71
- * The work failed with `error`, the JSON-RPC error that v1 answers the
72
- * prompt with.
73
- */
74
- failed(error: unknown): void;
75
- }
76
36
  /** Why a turn ended. Every ACP version has these reasons. */
77
37
  export type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
78
38
  /** How a turn ended. */
@@ -1 +1 @@
1
- {"version":3,"file":"turn-events.d.ts","sourceRoot":"","sources":["../src/turn-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAC;IAChB;;;;OAIG;IACH,YAAY,IAAI,IAAI,CAAC;IACrB,sBAAsB;IACtB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH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AC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Readable, Writable } from "node:stream";
2
2
  import { WritableStream, ReadableStream } from "node:stream/web";
3
- import { Logger } from "./acp-agent.js";
3
+ import { Logger } from "./logger.js";
4
4
  export declare class Pushable<T> implements AsyncIterable<T> {
5
5
  private queue;
6
6
  private resolvers;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,qBAAa,QAAQ,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAClD,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,IAAI,CAAS;IAErB,IAAI,CAAC,IAAI,EAAE,CAAC;IASZ,GAAG;IAQH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;CAgB3C;AAKD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,CAoBlF;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,QAAQ,GAAG,cAAc,CAAC,UAAU,CAA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AC,EACzC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAoBzB"}
@@ -1,13 +1,9 @@
1
1
  import * as v2 from "@agentclientprotocol/sdk/experimental/v2/unstable";
2
- import { ClaudeAcpAgent, type Logger } from "../acp-agent.js";
3
- /**
4
- * The ACP v2 surface, for one connection.
5
- *
6
- * As in `v1AgentApp`, the agent of the connection is created when the
7
- * connection opens, before the connection processes any inbound message.
8
- * `onAgent` receives it for the owner of the process (shutdown).
9
- *
10
- * The provider methods pass through: their types are the same in v1 and v2.
11
- */
12
- export declare function v2AgentApp(logger: Logger | undefined, onAgent: (agent: ClaudeAcpAgent) => void): v2.AgentApp;
2
+ import type { Logger } from "../logger.js";
3
+ /** What the owner of the process holds of the agent: its shutdown. */
4
+ export interface AgentHandle {
5
+ dispose(): Promise<void>;
6
+ }
7
+ /** The ACP v2 surface, for one connection. */
8
+ export declare function v2AgentApp(logger: Logger | undefined, onAgent: (agent: AgentHandle) => void): v2.AgentApp;
13
9
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,mDAAmD,CAAC;AACxE,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAsB9E;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,EAAE,CAAC,QAAQ,CAyIb"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,MAAM,mDAAmD,CAAC;AAYxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AA4C3C,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,8CAA8C;AAC9C,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GACpC,EAAE,CAAC,QAAQ,CAuCb"}