@agentclientprotocol/claude-agent-acp 0.102.0 → 0.102.1-preview.2

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 (206) hide show
  1. package/README.md +5 -1
  2. package/dist/acp-agent.d.ts +119 -439
  3. package/dist/acp-agent.d.ts.map +1 -1
  4. package/dist/acp-agent.js +380 -2412
  5. package/dist/acp-subagents.d.ts +1 -2
  6. package/dist/acp-subagents.d.ts.map +1 -1
  7. package/dist/auth-methods.d.ts +21 -0
  8. package/dist/auth-methods.d.ts.map +1 -0
  9. package/dist/auth-methods.js +68 -0
  10. package/dist/auth-status-reporter.d.ts +112 -0
  11. package/dist/auth-status-reporter.d.ts.map +1 -0
  12. package/dist/auth-status-reporter.js +253 -0
  13. package/dist/background-work.d.ts +12 -265
  14. package/dist/background-work.d.ts.map +1 -1
  15. package/dist/background-work.js +8 -558
  16. package/dist/client-system-prompt.d.ts +7 -0
  17. package/dist/client-system-prompt.d.ts.map +1 -1
  18. package/dist/client-system-prompt.js +24 -0
  19. package/dist/context-compaction.d.ts +20 -0
  20. package/dist/context-compaction.d.ts.map +1 -1
  21. package/dist/context-compaction.js +26 -0
  22. package/dist/context-window.d.ts +70 -0
  23. package/dist/context-window.d.ts.map +1 -0
  24. package/dist/context-window.js +132 -0
  25. package/dist/diff.d.ts +1 -1
  26. package/dist/diff.js +1 -1
  27. package/dist/elicitation.d.ts +66 -1
  28. package/dist/elicitation.d.ts.map +1 -1
  29. package/dist/elicitation.js +109 -0
  30. package/dist/file-change-audit.d.ts +4 -3
  31. package/dist/file-change-audit.d.ts.map +1 -1
  32. package/dist/file-change-audit.js +3 -2
  33. package/dist/mcp-oauth.d.ts +44 -0
  34. package/dist/mcp-oauth.d.ts.map +1 -0
  35. package/dist/mcp-oauth.js +142 -0
  36. package/dist/mcp-servers.d.ts +10 -0
  37. package/dist/mcp-servers.d.ts.map +1 -0
  38. package/dist/mcp-servers.js +29 -0
  39. package/dist/native-subagents.d.ts +18 -8
  40. package/dist/native-subagents.d.ts.map +1 -1
  41. package/dist/native-subagents.js +7 -35
  42. package/dist/permissions/presentation.d.ts +29 -0
  43. package/dist/permissions/presentation.d.ts.map +1 -1
  44. package/dist/permissions/presentation.js +38 -11
  45. package/dist/plans.d.ts +36 -6
  46. package/dist/plans.d.ts.map +1 -1
  47. package/dist/plans.js +49 -11
  48. package/dist/prompt-suggestions.d.ts +29 -0
  49. package/dist/prompt-suggestions.d.ts.map +1 -1
  50. package/dist/prompt-suggestions.js +45 -0
  51. package/dist/providers.d.ts +139 -0
  52. package/dist/providers.d.ts.map +1 -0
  53. package/dist/providers.js +286 -0
  54. package/dist/remote-control.d.ts +62 -0
  55. package/dist/remote-control.d.ts.map +1 -0
  56. package/dist/remote-control.js +78 -0
  57. package/dist/result-end.d.ts +39 -0
  58. package/dist/result-end.d.ts.map +1 -0
  59. package/dist/result-end.js +50 -0
  60. package/dist/serve.d.ts +7 -2
  61. package/dist/serve.d.ts.map +1 -1
  62. package/dist/serve.js +10 -5
  63. package/dist/session-config-ids.d.ts +1 -0
  64. package/dist/session-config-ids.d.ts.map +1 -1
  65. package/dist/session-config-ids.js +1 -0
  66. package/dist/session-config-options.d.ts +64 -0
  67. package/dist/session-config-options.d.ts.map +1 -0
  68. package/dist/session-config-options.js +162 -0
  69. package/dist/session-effort.d.ts +67 -0
  70. package/dist/session-effort.d.ts.map +1 -1
  71. package/dist/session-effort.js +98 -0
  72. package/dist/session-env.d.ts +22 -0
  73. package/dist/session-env.d.ts.map +1 -0
  74. package/dist/session-env.js +66 -0
  75. package/dist/session-fast-mode.d.ts +83 -0
  76. package/dist/session-fast-mode.d.ts.map +1 -0
  77. package/dist/session-fast-mode.js +142 -0
  78. package/dist/session-index/connection.d.ts +2 -5
  79. package/dist/session-index/connection.d.ts.map +1 -1
  80. package/dist/session-index/connection.js +3 -5
  81. package/dist/session-mode.d.ts +1 -0
  82. package/dist/session-mode.d.ts.map +1 -1
  83. package/dist/session-mode.js +1 -1
  84. package/dist/session-model.d.ts +41 -0
  85. package/dist/session-model.d.ts.map +1 -1
  86. package/dist/session-model.js +110 -45
  87. package/dist/session-notices.d.ts +44 -0
  88. package/dist/session-notices.d.ts.map +1 -1
  89. package/dist/session-notices.js +68 -0
  90. package/dist/session-titles.d.ts +34 -12
  91. package/dist/session-titles.d.ts.map +1 -1
  92. package/dist/session-titles.js +7 -6
  93. package/dist/session-usage.d.ts +125 -0
  94. package/dist/session-usage.d.ts.map +1 -0
  95. package/dist/session-usage.js +196 -0
  96. package/dist/streamed-text.d.ts +33 -0
  97. package/dist/streamed-text.d.ts.map +1 -0
  98. package/dist/streamed-text.js +71 -0
  99. package/dist/subagent-configuration.d.ts +32 -0
  100. package/dist/subagent-configuration.d.ts.map +1 -0
  101. package/dist/subagent-configuration.js +70 -0
  102. package/dist/subagent-replay.d.ts +18 -0
  103. package/dist/subagent-replay.d.ts.map +1 -1
  104. package/dist/subagent-replay.js +25 -15
  105. package/dist/tool-calls/client-capabilities.d.ts +8 -8
  106. package/dist/tool-calls/client-capabilities.js +4 -4
  107. package/dist/tool-calls/renderer.d.ts +4 -5
  108. package/dist/tool-calls/renderer.d.ts.map +1 -1
  109. package/dist/tool-calls/renderer.js +4 -5
  110. package/dist/turn-events.d.ts +6 -46
  111. package/dist/turn-events.d.ts.map +1 -1
  112. package/dist/v2/agent.d.ts +7 -11
  113. package/dist/v2/agent.d.ts.map +1 -1
  114. package/dist/v2/agent.js +751 -331
  115. package/dist/v2/air.d.ts +33 -0
  116. package/dist/v2/air.d.ts.map +1 -0
  117. package/dist/v2/air.js +29 -0
  118. package/dist/v2/auth.d.ts +97 -0
  119. package/dist/v2/auth.d.ts.map +1 -0
  120. package/dist/v2/auth.js +216 -0
  121. package/dist/v2/background.d.ts +27 -16
  122. package/dist/v2/background.d.ts.map +1 -1
  123. package/dist/v2/background.js +4 -32
  124. package/dist/v2/child-config.d.ts +55 -0
  125. package/dist/v2/child-config.d.ts.map +1 -0
  126. package/dist/v2/child-config.js +92 -0
  127. package/dist/v2/clear-context.d.ts +94 -0
  128. package/dist/v2/clear-context.d.ts.map +1 -0
  129. package/dist/v2/clear-context.js +176 -0
  130. package/dist/v2/commands.d.ts +46 -0
  131. package/dist/v2/commands.d.ts.map +1 -0
  132. package/dist/v2/commands.js +54 -0
  133. package/dist/v2/config.d.ts +187 -0
  134. package/dist/v2/config.d.ts.map +1 -0
  135. package/dist/v2/config.js +494 -0
  136. package/dist/v2/elicitation.d.ts +93 -0
  137. package/dist/v2/elicitation.d.ts.map +1 -0
  138. package/dist/v2/elicitation.js +160 -0
  139. package/dist/v2/file-changes.d.ts +61 -0
  140. package/dist/v2/file-changes.d.ts.map +1 -0
  141. package/dist/v2/file-changes.js +108 -0
  142. package/dist/v2/file-preview.d.ts +18 -0
  143. package/dist/v2/file-preview.d.ts.map +1 -0
  144. package/dist/v2/file-preview.js +29 -0
  145. package/dist/v2/initialize.d.ts +10 -24
  146. package/dist/v2/initialize.d.ts.map +1 -1
  147. package/dist/v2/initialize.js +4 -111
  148. package/dist/v2/outcome.d.ts +81 -0
  149. package/dist/v2/outcome.d.ts.map +1 -0
  150. package/dist/v2/outcome.js +165 -0
  151. package/dist/v2/permissions.d.ts +92 -0
  152. package/dist/v2/permissions.d.ts.map +1 -0
  153. package/dist/v2/permissions.js +162 -0
  154. package/dist/v2/prompt.d.ts +2 -42
  155. package/dist/v2/prompt.d.ts.map +1 -1
  156. package/dist/v2/prompt.js +2 -119
  157. package/dist/v2/remote-control.d.ts +41 -0
  158. package/dist/v2/remote-control.d.ts.map +1 -0
  159. package/dist/v2/remote-control.js +63 -0
  160. package/dist/v2/reports.d.ts +198 -0
  161. package/dist/v2/reports.d.ts.map +1 -0
  162. package/dist/v2/reports.js +487 -0
  163. package/dist/v2/restarts.d.ts +128 -0
  164. package/dist/v2/restarts.d.ts.map +1 -0
  165. package/dist/v2/restarts.js +348 -0
  166. package/dist/v2/session-requests.d.ts +20 -0
  167. package/dist/v2/session-requests.d.ts.map +1 -0
  168. package/dist/v2/session-requests.js +108 -0
  169. package/dist/v2/session-update.d.ts +2 -13
  170. package/dist/v2/session-update.d.ts.map +1 -1
  171. package/dist/v2/session-update.js +2 -22
  172. package/dist/v2/session.d.ts +340 -41
  173. package/dist/v2/session.d.ts.map +1 -1
  174. package/dist/v2/session.js +1223 -141
  175. package/dist/v2/setup.d.ts +49 -0
  176. package/dist/v2/setup.d.ts.map +1 -0
  177. package/dist/v2/setup.js +62 -0
  178. package/dist/v2/stopped-work.d.ts +123 -0
  179. package/dist/v2/stopped-work.d.ts.map +1 -0
  180. package/dist/v2/stopped-work.js +210 -0
  181. package/dist/v2/stream.d.ts +228 -0
  182. package/dist/v2/stream.d.ts.map +1 -0
  183. package/dist/v2/stream.js +506 -0
  184. package/dist/v2/subagent-replay.d.ts +115 -0
  185. package/dist/v2/subagent-replay.d.ts.map +1 -0
  186. package/dist/v2/subagent-replay.js +479 -0
  187. package/dist/v2/subscription-guard.d.ts +60 -0
  188. package/dist/v2/subscription-guard.d.ts.map +1 -0
  189. package/dist/v2/subscription-guard.js +84 -0
  190. package/dist/v2/tasks.d.ts +492 -0
  191. package/dist/v2/tasks.d.ts.map +1 -0
  192. package/dist/v2/tasks.js +1728 -0
  193. package/dist/v2/terminal.d.ts.map +1 -1
  194. package/dist/v2/terminal.js +6 -1
  195. package/dist/v2/tool-call.d.ts +3 -2
  196. package/dist/v2/tool-call.d.ts.map +1 -1
  197. package/dist/v2/update-translator.d.ts +36 -0
  198. package/dist/v2/update-translator.d.ts.map +1 -0
  199. package/dist/v2/update-translator.js +80 -0
  200. package/dist/workflow-progress.d.ts +23 -0
  201. package/dist/workflow-progress.d.ts.map +1 -1
  202. package/dist/workflow-progress.js +31 -8
  203. package/package.json +1 -1
  204. package/dist/v2/permission.d.ts +0 -28
  205. package/dist/v2/permission.d.ts.map +0 -1
  206. package/dist/v2/permission.js +0 -41
@@ -0,0 +1,142 @@
1
+ /**
2
+ * OAuth for the MCP servers that Claude Code reports as `needs-auth`, as an
3
+ * ACP URL elicitation. Protocol-neutral: the v1 core and the v2 core
4
+ * both start it once a session's setup response is sent.
5
+ */
6
+ import { randomUUID } from "node:crypto";
7
+ /** Claude Code keeps the OAuth callback listener open in the background after
8
+ * `mcpAuthenticate` returns the authorization URL. The SDK does not expose
9
+ * that listener's completion promise, so watch the server status while the
10
+ * ACP client has the URL elicitation open. */
11
+ const MCP_OAUTH_STATUS_POLL_MS = 1_000;
12
+ const MCP_OAUTH_TIMEOUT_MS = 10 * 60_000;
13
+ export function supportsMcpOAuth(query) {
14
+ return typeof query.mcpAuthenticate === "function";
15
+ }
16
+ const mcpAuthentications = new WeakMap();
17
+ /** Start OAuth in the background for the servers in `requestedServers` that
18
+ * Claude reports as needing authentication. It does nothing while another
19
+ * OAuth run of the session is in progress. */
20
+ export function startMcpServerAuthentication(client, session, requestedServers) {
21
+ if (!client.urlElicitation || requestedServers.size === 0)
22
+ return;
23
+ const query = session.currentQuery();
24
+ if (!query || mcpAuthentications.has(session.key))
25
+ return;
26
+ const authentication = authenticateMcpServers(client, session, query, requestedServers)
27
+ .catch((error) => {
28
+ if (!session.closed.aborted) {
29
+ client.logger.error(`Failed to inspect MCP servers for OAuth: ${error}`);
30
+ }
31
+ })
32
+ .finally(() => {
33
+ if (mcpAuthentications.get(session.key) === authentication) {
34
+ mcpAuthentications.delete(session.key);
35
+ }
36
+ });
37
+ mcpAuthentications.set(session.key, authentication);
38
+ }
39
+ async function authenticateMcpServers(client, session, query, requestedServers) {
40
+ if (!supportsMcpOAuth(query)) {
41
+ client.logger.error("The Claude Agent SDK does not expose MCP OAuth authentication.");
42
+ return;
43
+ }
44
+ const statuses = await query.mcpServerStatus();
45
+ for (const status of statuses) {
46
+ if (status.status !== "needs-auth" || !requestedServers.has(status.name))
47
+ continue;
48
+ try {
49
+ await authenticateMcpServer(client, session, query, status.name);
50
+ }
51
+ catch (error) {
52
+ if (session.currentQuery() && !session.closed.aborted) {
53
+ client.logger.error(`Failed to authenticate MCP server ${status.name}: ${error}`);
54
+ }
55
+ }
56
+ }
57
+ }
58
+ /** Bridge Claude Code's startup MCP OAuth control to ACP URL elicitation.
59
+ * Claude opens and owns the localhost callback listener; the ACP client only
60
+ * needs to present the returned authorization URL. */
61
+ async function authenticateMcpServer(client, session, query, serverName) {
62
+ if (!session.currentQuery())
63
+ return;
64
+ const login = await query.mcpAuthenticate(serverName);
65
+ if (!login.requiresUserAction)
66
+ return;
67
+ if (!login.authUrl) {
68
+ throw new Error("Claude Code requested user action without returning an authorization URL");
69
+ }
70
+ const elicitationId = `mcp-oauth-${randomUUID()}`;
71
+ const flowAbort = new AbortController();
72
+ const abortFlow = () => flowAbort.abort(session.closed.reason);
73
+ session.closed.addEventListener("abort", abortFlow, { once: true });
74
+ if (session.closed.aborted)
75
+ abortFlow();
76
+ try {
77
+ const completed = waitForMcpAuthentication(session, query, serverName, flowAbort.signal);
78
+ const elicitation = client.createElicitation({
79
+ mode: "url",
80
+ sessionId: session.sessionId,
81
+ message: `Authenticate with MCP server ${serverName}`,
82
+ url: login.authUrl,
83
+ elicitationId,
84
+ }, flowAbort.signal);
85
+ const first = await Promise.race([
86
+ completed.then((authenticated) => ({ type: "completed", authenticated })),
87
+ elicitation.then((response) => ({ type: "elicitation", response })),
88
+ ]);
89
+ // A url-mode accept carries no content to check. The guard
90
+ // `CreateElicitationResponse.isAccept` would also reject an accept whose
91
+ // `content` holds a v2-only value, such as an object.
92
+ if (first.type === "elicitation" && first.response.action !== "accept") {
93
+ return;
94
+ }
95
+ if (first.type === "elicitation") {
96
+ await completed;
97
+ }
98
+ try {
99
+ await client.completeElicitation({ elicitationId });
100
+ }
101
+ catch (error) {
102
+ if (!flowAbort.signal.aborted) {
103
+ client.logger.error(`Failed to complete MCP OAuth elicitation: ${error}`);
104
+ }
105
+ }
106
+ }
107
+ finally {
108
+ flowAbort.abort();
109
+ session.closed.removeEventListener("abort", abortFlow);
110
+ }
111
+ }
112
+ async function waitForMcpAuthentication(session, query, serverName, signal) {
113
+ const deadline = Date.now() + MCP_OAUTH_TIMEOUT_MS;
114
+ while (!signal.aborted && Date.now() < deadline) {
115
+ if (session.currentQuery() !== query)
116
+ return false;
117
+ const status = (await query.mcpServerStatus()).find((server) => server.name === serverName);
118
+ if (!status || status.status === "failed" || status.status === "disabled")
119
+ return false;
120
+ if (status.status === "connected")
121
+ return true;
122
+ if (!(await waitUnlessAborted(MCP_OAUTH_STATUS_POLL_MS, signal)))
123
+ return false;
124
+ }
125
+ return false;
126
+ }
127
+ /** Wait for a polling interval, resolving false when the session is aborted. */
128
+ export function waitUnlessAborted(milliseconds, signal) {
129
+ if (signal.aborted)
130
+ return Promise.resolve(false);
131
+ return new Promise((resolve) => {
132
+ const timer = setTimeout(() => {
133
+ signal.removeEventListener("abort", onAbort);
134
+ resolve(true);
135
+ }, milliseconds);
136
+ const onAbort = () => {
137
+ clearTimeout(timer);
138
+ resolve(false);
139
+ };
140
+ signal.addEventListener("abort", onAbort, { once: true });
141
+ });
142
+ }
@@ -0,0 +1,10 @@
1
+ import type { McpServer } from "@agentclientprotocol/sdk/unstable";
2
+ import type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
3
+ /**
4
+ * The SDK configs of a session's ACP MCP servers, by name. HTTP and SSE
5
+ * servers keep their URL and headers; a server without `type` is stdio. A
6
+ * server of any other transport is left out: the session's `initialize`
7
+ * advertises none.
8
+ */
9
+ export declare function sdkMcpServers(servers: readonly McpServer[] | null | undefined): Record<string, McpServerConfig>;
10
+ //# sourceMappingURL=mcp-servers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-servers.d.ts","sourceRoot":"","sources":["../src/mcp-servers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,GAC/C,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAqBjC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The SDK configs of a session's ACP MCP servers, by name. HTTP and SSE
3
+ * servers keep their URL and headers; a server without `type` is stdio. A
4
+ * server of any other transport is left out: the session's `initialize`
5
+ * advertises none.
6
+ */
7
+ export function sdkMcpServers(servers) {
8
+ const configs = {};
9
+ for (const server of servers ?? []) {
10
+ if ("type" in server && (server.type === "http" || server.type === "sse")) {
11
+ configs[server.name] = {
12
+ type: server.type,
13
+ url: server.url,
14
+ headers: server.headers
15
+ ? Object.fromEntries(server.headers.map((e) => [e.name, e.value]))
16
+ : undefined,
17
+ };
18
+ }
19
+ else if (!("type" in server)) {
20
+ configs[server.name] = {
21
+ type: "stdio",
22
+ command: server.command,
23
+ args: server.args,
24
+ env: server.env ? Object.fromEntries(server.env.map((e) => [e.name, e.value])) : undefined,
25
+ };
26
+ }
27
+ }
28
+ return configs;
29
+ }
@@ -109,6 +109,12 @@ type TaskStarted = {
109
109
  description?: unknown;
110
110
  prompt?: unknown;
111
111
  };
112
+ export type SubagentIdentity = {
113
+ name?: string;
114
+ description?: string;
115
+ prompt?: string;
116
+ subagentType?: string;
117
+ };
112
118
  /** An agent of the session's subagent history, as the runtime restores it. */
113
119
  export type HistoricalSubagent = {
114
120
  agentId: string;
@@ -218,13 +224,6 @@ export declare class NativeSubagentRuntime {
218
224
  * `sessionId` of this live session, or undefined when no such child runs here.
219
225
  */
220
226
  liveWorkState(sessionId: string): WorkState["state"] | undefined;
221
- /**
222
- * The RFD form: the `subagent_update` that tells a client that holds nothing
223
- * of the announced child `sessionId` of this live session what it is now:
224
- * its labels, its directory, its `cancel` capability, and its work state.
225
- * Undefined when no such child runs here.
226
- */
227
- currentUpdate(sessionId: string): AcpSessionNotification | undefined;
228
227
  /**
229
228
  * Reports the model of a child response, an exact model id, as the entry of
230
229
  * the root session's `model` option that matches it, else as the id (see
@@ -582,7 +581,7 @@ export declare function launchReply(launchId: string, childSessionId: string, pa
582
581
  * A failure is idle with the `error` stop reason and, when the SDK gives its
583
582
  * text, the JSON-RPC `error`, as the RFD asks: a v1 child has no prompt
584
583
  * response, so this is how a client learns that its work failed. The error is
585
- * an internal error, as for a failed turn on the v2 surface.
584
+ * an internal error, as for a failed turn on v2.
586
585
  *
587
586
  * A task that a worker restart orphaned, or that was still running when the
588
587
  * stream ended, is idle with no stop reason: its work ended, but the adapter
@@ -631,6 +630,17 @@ export declare function isNativeSubagentControlUpdate(update: AcpSessionNotifica
631
630
  sessionUpdate: "tool_call" | "tool_call_update";
632
631
  }>;
633
632
  export declare function isNativeSubagentControlTool(toolName: unknown): boolean;
633
+ /**
634
+ * A tool call that the client was not shown, as one `tool_call` with its
635
+ * final status, shown after all: an Agent/Task call whose child was never
636
+ * exposed (AIR's draft shows only a failed one, the RFD form also a completed
637
+ * one), a SendMessage call whose message reached no announced child, or a
638
+ * failed SubagentHandback call.
639
+ */
640
+ export declare function unexposedControlFallback(initial: AcpSessionNotification | undefined, terminal: AcpSessionNotification, sessionId: string): AcpSessionNotification;
641
+ /** The labels and prompt of a child, from the input of the Agent or Task call that launched it. */
642
+ export declare function subagentIdentity(input: unknown): SubagentIdentity | undefined;
643
+ export declare function mergeSubagentIdentity(previous: SubagentIdentity | undefined, next: SubagentIdentity): SubagentIdentity;
634
644
  /**
635
645
  * Whether `left` and `right` are the same directory, also when one is
636
646
  * spelled through a symlink, e.g. `/tmp/project` and `/private/tmp/project`
@@ -1 +1 @@
1
- {"version":3,"file":"native-subagents.d.ts","sourceRoot":"","sources":["../src/native-subagents.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK9F,kFAAkF;AA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H,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKjF"}
@@ -3,6 +3,7 @@ import { realpath } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { AIR_SUBAGENT_KEY, airExtensionMeta } from "./air-extension.js";
5
5
  import { MODEL_CONFIG_ID } from "./session-model.js";
6
+ import { orderedSubagentConfiguration } from "./subagent-configuration.js";
6
7
  import { isFinalToolCallStatus } from "./tool-calls/renderer.js";
7
8
  const MAX_PENDING_PARENTS = 64;
8
9
  const MAX_PENDING_UPDATES = 256;
@@ -123,31 +124,6 @@ export class NativeSubagentRuntime {
123
124
  const child = this.children.get(sessionId);
124
125
  return child?.announced ? child.workState : undefined;
125
126
  }
126
- /**
127
- * The RFD form: the `subagent_update` that tells a client that holds nothing
128
- * of the announced child `sessionId` of this live session what it is now:
129
- * its labels, its directory, its `cancel` capability, and its work state.
130
- * Undefined when no such child runs here.
131
- */
132
- currentUpdate(sessionId) {
133
- if (this.form !== "rfd")
134
- return undefined;
135
- const child = this.childOfSession(sessionId);
136
- if (!child?.announced || !child.workState)
137
- return undefined;
138
- return {
139
- sessionId: child.parentSessionId,
140
- update: {
141
- sessionUpdate: "subagent_update",
142
- sessionId: child.sessionId,
143
- ...(child.title ? { title: child.title } : {}),
144
- ...(child.description ? { description: child.description } : {}),
145
- ...(child.reportedCwd ? { cwd: child.reportedCwd } : {}),
146
- capabilities: { cancel: {} },
147
- state: { state: child.workState },
148
- },
149
- };
150
- }
151
127
  /**
152
128
  * Reports the model of a child response, an exact model id, as the entry of
153
129
  * the root session's `model` option that matches it, else as the id (see
@@ -228,12 +204,7 @@ export class NativeSubagentRuntime {
228
204
  const publishing = config.publishing.then(async () => {
229
205
  if (this.configBySession.get(child.sessionId) !== config || ended())
230
206
  return;
231
- const priority = ["mode", "model", "thought_level", "model_config"];
232
- const rank = (option) => {
233
- const index = priority.indexOf(option.category ?? "");
234
- return index < 0 ? priority.length : index;
235
- };
236
- const configOptions = [...config.options.values()].sort((left, right) => rank(left) - rank(right));
207
+ const configOptions = orderedSubagentConfiguration(config.options.values());
237
208
  const snapshot = JSON.stringify(configOptions);
238
209
  if (config.published === snapshot)
239
210
  return;
@@ -1600,7 +1571,7 @@ function isWorking(child) {
1600
1571
  * A failure is idle with the `error` stop reason and, when the SDK gives its
1601
1572
  * text, the JSON-RPC `error`, as the RFD asks: a v1 child has no prompt
1602
1573
  * response, so this is how a client learns that its work failed. The error is
1603
- * an internal error, as for a failed turn on the v2 surface.
1574
+ * an internal error, as for a failed turn on v2.
1604
1575
  *
1605
1576
  * A task that a worker restart orphaned, or that was still running when the
1606
1577
  * stream ended, is idle with no stop reason: its work ended, but the adapter
@@ -1733,7 +1704,7 @@ function isFailedToolCallUpdate(update) {
1733
1704
  * one), a SendMessage call whose message reached no announced child, or a
1734
1705
  * failed SubagentHandback call.
1735
1706
  */
1736
- function unexposedControlFallback(initial, terminal, sessionId) {
1707
+ export function unexposedControlFallback(initial, terminal, sessionId) {
1737
1708
  if (terminal.update.sessionUpdate !== "tool_call" &&
1738
1709
  terminal.update.sessionUpdate !== "tool_call_update") {
1739
1710
  return { ...terminal, sessionId };
@@ -1805,7 +1776,8 @@ function subagentDescription(prompt, description) {
1805
1776
  }
1806
1777
  return "Delegated task";
1807
1778
  }
1808
- function subagentIdentity(input) {
1779
+ /** The labels and prompt of a child, from the input of the Agent or Task call that launched it. */
1780
+ export function subagentIdentity(input) {
1809
1781
  if (typeof input !== "object" || input === null || Array.isArray(input))
1810
1782
  return undefined;
1811
1783
  const value = input;
@@ -1817,7 +1789,7 @@ function subagentIdentity(input) {
1817
1789
  };
1818
1790
  return Object.values(identity).some(Boolean) ? identity : undefined;
1819
1791
  }
1820
- function mergeSubagentIdentity(previous, next) {
1792
+ export function mergeSubagentIdentity(previous, next) {
1821
1793
  return {
1822
1794
  name: next.name ?? previous?.name,
1823
1795
  description: next.description ?? previous?.description,
@@ -39,4 +39,33 @@ export interface ClaudePermissionPresentationInput {
39
39
  * v2 client as `title` and `description`.
40
40
  */
41
41
  export declare function buildClaudePermissionPresentation(value: ClaudePermissionPresentationInput): Pick<AcpPermissionRequest, "toolCall" | "_meta" | "title" | "description">;
42
+ /**
43
+ * The `_meta.jetbrains.air.permission` of a permission request, from the
44
+ * heading and explanation that {@link buildClaudePermissionPresentation}
45
+ * built. The v2 core adds it for an AIR client, whose tool calls it
46
+ * renders without the AIR tool call contract.
47
+ */
48
+ export declare function airPermissionMeta({ title, description, defaultToNo, }: {
49
+ title: string;
50
+ description?: string;
51
+ defaultToNo?: boolean;
52
+ }): Record<string, unknown>;
53
+ /**
54
+ * The `_meta.claudeCode` of a permission request's tool call: which MCP
55
+ * server serves an `mcp__*` tool and where its definition came from
56
+ * (`mcpServer`, SDK 0.3.274+), so a client can key trust on `source`, and,
57
+ * for clients other than AIR, the tool name and the Agent or Task call of a
58
+ * subagent's request. Undefined when there is nothing to add.
59
+ */
60
+ export declare function permissionToolCallMeta({ toolName, parentToolUseId, mcpServer, airClient, }: {
61
+ toolName: string;
62
+ parentToolUseId: string | undefined;
63
+ mcpServer: {
64
+ name: string;
65
+ source: string;
66
+ } | undefined;
67
+ airClient: boolean;
68
+ }): {
69
+ claudeCode: Record<string, unknown>;
70
+ } | undefined;
42
71
  //# sourceMappingURL=presentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../src/permissions/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG;IAC5D,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,C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;IACb,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,oGAAoG;IACpG,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,iCAAiC,GACvC,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC,CAuD5E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,WAAW,EACX,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU1B;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,eAAe,EACf,SAAS,EACT,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACxD,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,SAAS,CAWtD"}
@@ -80,18 +80,45 @@ export function buildClaudePermissionPresentation(value) {
80
80
  }),
81
81
  // Only AIR gets the permission presentation.
82
82
  ...(title && capabilities.air.client
83
- ? {
84
- _meta: withAirMeta(undefined, AIR_PERMISSION_KEY, {
85
- version: 1,
86
- title,
87
- ...(description ? { description } : {}),
88
- // The CLI's own hint, forwarded so a client that can pre-select
89
- // an option keeps the decline focused; the option order already
90
- // leads with the reject options when this is set.
91
- ...(value.defaultToNo === true ? { defaultToNo: true } : {}),
92
- }),
93
- }
83
+ ? { _meta: airPermissionMeta({ title, description, defaultToNo: value.defaultToNo }) }
94
84
  : {}),
95
85
  ...(capabilities.v2 ? { title, ...(description ? { description } : {}) } : {}),
96
86
  };
97
87
  }
88
+ /**
89
+ * The `_meta.jetbrains.air.permission` of a permission request, from the
90
+ * heading and explanation that {@link buildClaudePermissionPresentation}
91
+ * built. The v2 core adds it for an AIR client, whose tool calls it
92
+ * renders without the AIR tool call contract.
93
+ */
94
+ export function airPermissionMeta({ title, description, defaultToNo, }) {
95
+ return withAirMeta(undefined, AIR_PERMISSION_KEY, {
96
+ version: 1,
97
+ title,
98
+ ...(description ? { description } : {}),
99
+ // The CLI's own hint, forwarded so a client that can pre-select an
100
+ // option keeps the decline focused; the option order already leads with
101
+ // the reject options when this is set.
102
+ ...(defaultToNo === true ? { defaultToNo: true } : {}),
103
+ });
104
+ }
105
+ /**
106
+ * The `_meta.claudeCode` of a permission request's tool call: which MCP
107
+ * server serves an `mcp__*` tool and where its definition came from
108
+ * (`mcpServer`, SDK 0.3.274+), so a client can key trust on `source`, and,
109
+ * for clients other than AIR, the tool name and the Agent or Task call of a
110
+ * subagent's request. Undefined when there is nothing to add.
111
+ */
112
+ export function permissionToolCallMeta({ toolName, parentToolUseId, mcpServer, airClient, }) {
113
+ if (!mcpServer && !(parentToolUseId && !airClient))
114
+ return undefined;
115
+ // The name is the config key as authored: untrusted text, so it rides
116
+ // `_meta` rather than the title.
117
+ return {
118
+ claudeCode: {
119
+ ...(airClient ? {} : { toolName }),
120
+ ...(parentToolUseId && !airClient ? { parentToolUseId } : {}),
121
+ ...(mcpServer ? { mcpServer: { name: mcpServer.name, source: mcpServer.source } } : {}),
122
+ },
123
+ };
124
+ }
package/dist/plans.d.ts CHANGED
@@ -10,11 +10,19 @@ type PlanRemovalUpdate = PlanRemoved & {
10
10
  };
11
11
  /** The ID of the session's checklist, from TodoWrite and the Task tools. Every
12
12
  * update replaces it whole. An approved ExitPlanMode plan is a separate plan
13
- * ({@link PLAN_MODE_PLAN_ID}). */
13
+ * ({@link PLAN_MODE_PLAN_ID}), and so is a subagent's TodoWrite checklist in
14
+ * its parent's session ({@link subagentChecklistPlanId}). */
14
15
  export declare const CHECKLIST_PLAN_ID = "plan";
15
- /** The plan operation that shows the checklist `entries`: `plan_update`, or
16
- * `plan_removed` for an empty checklist. */
17
- export declare function checklistPlanOperation(entries: PlanEntry[]): {
16
+ /** The ID of the TodoWrite checklist of the subagent that the tool call
17
+ * `parentToolUseId` launched, when the checklist goes to its parent's session.
18
+ * Claude Code keeps a TodoWrite list per agent, so it is a separate plan from
19
+ * the main conversation's checklist. The Task tools share one task list
20
+ * between all agents of a session, so their checklist is always
21
+ * {@link CHECKLIST_PLAN_ID}. */
22
+ export declare function subagentChecklistPlanId(parentToolUseId: string): string;
23
+ /** The plan operation that shows the checklist `entries` as the plan `planId`:
24
+ * `plan_update`, or `plan_removed` for an empty checklist. */
25
+ export declare function checklistPlanOperation(entries: PlanEntry[], planId?: string): {
18
26
  sessionUpdate: "plan_update";
19
27
  plan: PlanItems & {
20
28
  type: "items";
@@ -24,11 +32,33 @@ export declare function checklistPlanOperation(entries: PlanEntry[]): {
24
32
  * {@link checklistPlanOperation}), else a legacy `plan`, which with no entries
25
33
  * clears the client's plan. */
26
34
  export declare function checklistPlanUpdate(entries: PlanEntry[], planOperations: boolean): SessionNotification["update"];
35
+ /** The plan IDs of the subagent checklists that the client holds in a session
36
+ * (see {@link subagentChecklistPlanId}). */
37
+ export type SubagentChecklists = Set<string>;
38
+ /**
39
+ * The update that shows the TodoWrite checklist `entries` of the agent that
40
+ * made the call: the main conversation, or the subagent that the tool call
41
+ * `parentToolUseId` launched.
42
+ *
43
+ * A subagent's checklist gets its own plan ID, recorded in `shown` while the
44
+ * client holds it, when it goes to the parent's session. It does not with
45
+ * `childSessions` (native subagent sessions), where it goes to the subagent's
46
+ * own session, which holds no other checklist. A client without plan
47
+ * operations holds one plan per session, so there a subagent's checklist
48
+ * replaces the main one.
49
+ */
50
+ export declare function todoWritePlanUpdate(entries: PlanEntry[], options: {
51
+ planOperations: boolean;
52
+ parentToolUseId?: string | null;
53
+ childSessions: boolean;
54
+ shown?: SubagentChecklists;
55
+ }): SessionNotification["update"];
27
56
  /** The updates that dismiss the plans of a conversation that a reset (`/clear`)
28
- * replaced: the checklist, and the approved ExitPlanMode plan. AIR keeps its
57
+ * replaced: the checklist, the subagent checklists in `subagentChecklists`
58
+ * (which it then empties), and the approved ExitPlanMode plan. AIR keeps its
29
59
  * approved plans, each joined to its approval card in the transcript (see
30
60
  * planModeUpdate). Without plan operations, a legacy empty `plan` clears the
31
61
  * one plan the client holds. */
32
- export declare function resetPlanUpdates(planOperations: boolean, airClient: boolean): SessionNotification["update"][];
62
+ export declare function resetPlanUpdates(planOperations: boolean, airClient: boolean, subagentChecklists?: SubagentChecklists): SessionNotification["update"][];
33
63
  export {};
34
64
  //# sourceMappingURL=plans.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;AAG3C,KAAK,iBAAiB,GAAG,WAAW,GAAG;IAAE,aAAa,EAAE,cAAc,CAAA;CAAE,CAAC;AAEzE;;kCAEkC;AAClC,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC;4CAC4C;AAC5C,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,EAAE,GACnB;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,S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AmB,CACjC,OAAO,EAAE,SAAS,EAAE,EACpB,OAAO,EAAE;IACP,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B,GACA,mBAAmB,CAAC,QAAQ,CAAC,CAS/B;AAED;;;;;gCAKgC;AAChC,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,OAAO,EAClB,kBAAkB,CAAC,EAAE,kBAAkB,GACtC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,CAYjC"}
package/dist/plans.js CHANGED
@@ -1,17 +1,24 @@
1
1
  import { PLAN_MODE_PLAN_ID } from "./exit-plan.js";
2
2
  /** The ID of the session's checklist, from TodoWrite and the Task tools. Every
3
3
  * update replaces it whole. An approved ExitPlanMode plan is a separate plan
4
- * ({@link PLAN_MODE_PLAN_ID}). */
4
+ * ({@link PLAN_MODE_PLAN_ID}), and so is a subagent's TodoWrite checklist in
5
+ * its parent's session ({@link subagentChecklistPlanId}). */
5
6
  export const CHECKLIST_PLAN_ID = "plan";
6
- /** The plan operation that shows the checklist `entries`: `plan_update`, or
7
- * `plan_removed` for an empty checklist. */
8
- export function checklistPlanOperation(entries) {
7
+ /** The ID of the TodoWrite checklist of the subagent that the tool call
8
+ * `parentToolUseId` launched, when the checklist goes to its parent's session.
9
+ * Claude Code keeps a TodoWrite list per agent, so it is a separate plan from
10
+ * the main conversation's checklist. The Task tools share one task list
11
+ * between all agents of a session, so their checklist is always
12
+ * {@link CHECKLIST_PLAN_ID}. */
13
+ export function subagentChecklistPlanId(parentToolUseId) {
14
+ return `${CHECKLIST_PLAN_ID}:${parentToolUseId}`;
15
+ }
16
+ /** The plan operation that shows the checklist `entries` as the plan `planId`:
17
+ * `plan_update`, or `plan_removed` for an empty checklist. */
18
+ export function checklistPlanOperation(entries, planId = CHECKLIST_PLAN_ID) {
9
19
  if (entries.length === 0)
10
- return { sessionUpdate: "plan_removed", planId: CHECKLIST_PLAN_ID };
11
- return {
12
- sessionUpdate: "plan_update",
13
- plan: { type: "items", planId: CHECKLIST_PLAN_ID, entries },
14
- };
20
+ return { sessionUpdate: "plan_removed", planId };
21
+ return { sessionUpdate: "plan_update", plan: { type: "items", planId, entries } };
15
22
  }
16
23
  /** The update that shows the checklist `entries`: a plan operation (see
17
24
  * {@link checklistPlanOperation}), else a legacy `plan`, which with no entries
@@ -19,13 +26,44 @@ export function checklistPlanOperation(entries) {
19
26
  export function checklistPlanUpdate(entries, planOperations) {
20
27
  return planOperations ? checklistPlanOperation(entries) : { sessionUpdate: "plan", entries };
21
28
  }
29
+ /**
30
+ * The update that shows the TodoWrite checklist `entries` of the agent that
31
+ * made the call: the main conversation, or the subagent that the tool call
32
+ * `parentToolUseId` launched.
33
+ *
34
+ * A subagent's checklist gets its own plan ID, recorded in `shown` while the
35
+ * client holds it, when it goes to the parent's session. It does not with
36
+ * `childSessions` (native subagent sessions), where it goes to the subagent's
37
+ * own session, which holds no other checklist. A client without plan
38
+ * operations holds one plan per session, so there a subagent's checklist
39
+ * replaces the main one.
40
+ */
41
+ export function todoWritePlanUpdate(entries, options) {
42
+ const { planOperations, parentToolUseId, childSessions, shown } = options;
43
+ if (!planOperations || !parentToolUseId || childSessions) {
44
+ return checklistPlanUpdate(entries, planOperations);
45
+ }
46
+ const planId = subagentChecklistPlanId(parentToolUseId);
47
+ if (entries.length === 0)
48
+ shown?.delete(planId);
49
+ else
50
+ shown?.add(planId);
51
+ return checklistPlanOperation(entries, planId);
52
+ }
22
53
  /** The updates that dismiss the plans of a conversation that a reset (`/clear`)
23
- * replaced: the checklist, and the approved ExitPlanMode plan. AIR keeps its
54
+ * replaced: the checklist, the subagent checklists in `subagentChecklists`
55
+ * (which it then empties), and the approved ExitPlanMode plan. AIR keeps its
24
56
  * approved plans, each joined to its approval card in the transcript (see
25
57
  * planModeUpdate). Without plan operations, a legacy empty `plan` clears the
26
58
  * one plan the client holds. */
27
- export function resetPlanUpdates(planOperations, airClient) {
59
+ export function resetPlanUpdates(planOperations, airClient, subagentChecklists) {
28
60
  const updates = [checklistPlanUpdate([], planOperations)];
61
+ if (planOperations) {
62
+ for (const planId of subagentChecklists ?? []) {
63
+ updates.push({ sessionUpdate: "plan_removed", planId });
64
+ }
65
+ }
66
+ subagentChecklists?.clear();
29
67
  if (planOperations && !airClient) {
30
68
  updates.push({ sessionUpdate: "plan_removed", planId: PLAN_MODE_PLAN_ID });
31
69
  }