@agentclientprotocol/claude-agent-acp 0.89.2-preview.2 → 0.89.2-preview.20

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 (52) hide show
  1. package/README.md +51 -8
  2. package/dist/acp-agent.d.ts +131 -23
  3. package/dist/acp-agent.d.ts.map +1 -1
  4. package/dist/acp-agent.js +879 -239
  5. package/dist/acp-subagents.d.ts +16 -6
  6. package/dist/acp-subagents.d.ts.map +1 -1
  7. package/dist/acp-subagents.js +8 -2
  8. package/dist/async-tasks.d.ts +4 -1
  9. package/dist/async-tasks.d.ts.map +1 -1
  10. package/dist/auth-status.d.ts +2 -2
  11. package/dist/auth-status.d.ts.map +1 -1
  12. package/dist/auth-status.js +18 -4
  13. package/dist/exit-plan.d.ts +17 -0
  14. package/dist/exit-plan.d.ts.map +1 -1
  15. package/dist/exit-plan.js +34 -0
  16. package/dist/native-subagents.d.ts +190 -11
  17. package/dist/native-subagents.d.ts.map +1 -1
  18. package/dist/native-subagents.js +419 -40
  19. package/dist/settings.d.ts +6 -0
  20. package/dist/settings.d.ts.map +1 -1
  21. package/dist/settings.js +13 -0
  22. package/dist/subagent-history.d.ts +27 -2
  23. package/dist/subagent-history.d.ts.map +1 -1
  24. package/dist/subagent-history.js +38 -10
  25. package/dist/subagent-replay.d.ts +108 -0
  26. package/dist/subagent-replay.d.ts.map +1 -0
  27. package/dist/subagent-replay.js +261 -0
  28. package/dist/tool-calls/background.d.ts +9 -0
  29. package/dist/tool-calls/background.d.ts.map +1 -1
  30. package/dist/tool-calls/background.js +25 -0
  31. package/dist/tool-calls/renderer.d.ts +32 -7
  32. package/dist/tool-calls/renderer.d.ts.map +1 -1
  33. package/dist/tool-calls/renderer.js +54 -21
  34. package/dist/turn-events.d.ts +39 -17
  35. package/dist/turn-events.d.ts.map +1 -1
  36. package/dist/v2/agent.d.ts.map +1 -1
  37. package/dist/v2/agent.js +52 -14
  38. package/dist/v2/initialize.d.ts.map +1 -1
  39. package/dist/v2/initialize.js +10 -1
  40. package/dist/v2/prompt.d.ts +29 -18
  41. package/dist/v2/prompt.d.ts.map +1 -1
  42. package/dist/v2/prompt.js +54 -43
  43. package/dist/v2/session-update.d.ts +11 -0
  44. package/dist/v2/session-update.d.ts.map +1 -1
  45. package/dist/v2/session-update.js +67 -0
  46. package/dist/v2/session.d.ts +3 -12
  47. package/dist/v2/session.d.ts.map +1 -1
  48. package/dist/v2/session.js +5 -18
  49. package/dist/v2/tool-call-meta.d.ts +44 -0
  50. package/dist/v2/tool-call-meta.d.ts.map +1 -0
  51. package/dist/v2/tool-call-meta.js +72 -0
  52. package/package.json +1 -1
@@ -1,12 +1,22 @@
1
1
  import type { ClientCapabilities, SessionCapabilities, SessionNotification } from "@agentclientprotocol/sdk";
2
2
  export { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY } from "./air-extension.js";
3
3
  /**
4
- * Temporary typed surface for agentclientprotocol/agent-client-protocol#1992.
4
+ * How a client gets native subagent sessions.
5
5
  *
6
- * The wire contract is already defined by the ACP draft, but the published
7
- * TypeScript SDK does not contain it yet. Keep the compatibility boundary in
8
- * this file so it can be replaced by SDK exports without changing lifecycle
9
- * code when the draft ships.
6
+ * - `rfd`: the subagents RFD (agentclientprotocol/agent-client-protocol#1992,
7
+ * as revised): `subagent_update` and `session_message`, which the SDK types.
8
+ * A client that declares `clientCapabilities.subagents` and is not AIR gets
9
+ * it. (ACP v2 clients do not get subagents yet.)
10
+ * - `air`: the earlier draft of that RFD, which AIR implements:
11
+ * `subagent_spawned` and `subagent_state_update`, typed below. AIR gets it,
12
+ * whichever capability it declares (`docs/air-extensions.md`).
13
+ */
14
+ export type SubagentForm = "rfd" | "air";
15
+ /** The form of native subagent sessions that the client gets, or none. */
16
+ export declare function subagentForm(capabilities?: ClientCapabilities | null): SubagentForm | undefined;
17
+ /**
18
+ * The earlier draft of the subagents RFD, which AIR implements and the SDK
19
+ * does not type.
10
20
  */
11
21
  export type SubagentSessionCapabilities = {
12
22
  cancel?: boolean;
@@ -83,6 +93,6 @@ export type SubagentAwareSessionCapabilities = SessionCapabilities & {
83
93
  subagents?: Record<string, never>;
84
94
  };
85
95
  export declare function clientSupportsSubagents(capabilities?: ClientCapabilities | null): boolean;
86
- /** The only cast needed until the TypeScript SDK publishes PR #1992. */
96
+ /** The cast that AIR's draft updates and the async task updates need. */
87
97
  export declare function asSdkSessionNotification(notification: AcpSessionNotification): SessionNotification;
88
98
  //# sourceMappingURL=acp-subagents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"acp-subagents.d.ts","sourceRoot":"","sources":["../src/acp-subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,uCAAuC,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,kBAAkB,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,2BAA2B,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,cAAc,CAAC;AAElF,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,uB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AAE,QAAQ,CAAC,GAAG;IACzE,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,mBAAmB,GAAG;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CASzF;AAED,yEAAyE;AACzE,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,sBAAsB,GACnC,mBAAmB,CAErB"}
@@ -1,5 +1,11 @@
1
- import { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY, clientSupportsAirCapability, } from "./air-extension.js";
1
+ import { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY, clientSupportsAirCapability, isAirClient, } from "./air-extension.js";
2
2
  export { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY } from "./air-extension.js";
3
+ /** The form of native subagent sessions that the client gets, or none. */
4
+ export function subagentForm(capabilities) {
5
+ if (!clientSupportsSubagents(capabilities))
6
+ return undefined;
7
+ return isAirClient(capabilities) ? "air" : "rfd";
8
+ }
3
9
  export function clientSupportsSubagents(capabilities) {
4
10
  const subagents = capabilities?.subagents;
5
11
  if (typeof subagents === "object" && subagents !== null && !Array.isArray(subagents)) {
@@ -7,7 +13,7 @@ export function clientSupportsSubagents(capabilities) {
7
13
  }
8
14
  return clientSupportsAirCapability(capabilities, AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY);
9
15
  }
10
- /** The only cast needed until the TypeScript SDK publishes PR #1992. */
16
+ /** The cast that AIR's draft updates and the async task updates need. */
11
17
  export function asSdkSessionNotification(notification) {
12
18
  return notification;
13
19
  }
@@ -188,7 +188,10 @@ export declare class AsyncTaskRuntime {
188
188
  export declare function backgroundBashTaskFromToolResult(content: unknown, toolUseResult: unknown, toolUses: Record<string, {
189
189
  name: string;
190
190
  input: unknown;
191
- }>): AsyncTaskStarted | undefined;
191
+ }>): (AsyncTaskStarted & {
192
+ taskId: string;
193
+ toolCallId: string;
194
+ }) | undefined;
192
195
  /**
193
196
  * The Bash tool calls in `content` whose command went to the background. Only
194
197
  * structured data counts: the task from the structured tool result, a task
@@ -1 +1 @@
1
- {"version":3,"file":"async-tasks.d.ts","sourceRoot":"","sources":["../src/async-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIjF,KAAK,OAAO,GAAG,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACvE,qEAAqE;AACrE,KAAK,KAAK,GAAG,CAAC,YAAY,EAAE,sBAAsB,KAAK,sBAAsB,GAAG,IAAI,CAAC;AAoCrF,KAAK,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAI5D,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;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YAAY;IAwBpB,oEAAoE;IACpE,OAAO,CAAC,eAAe;IAQvB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAM3B,kFAAkF;YACpE,aAAa;IAK3B,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,mBAAmB;IAQ3B;;;;;;;;;;;;;OAaG;YACW,QAAQ;YAuCR,MAAM;YAkCN,eAAe;IAa7B;;;OAGG;YACW,eAAe;IAqB7B,wFAAwF;YAC1E,YAAY;IAmB1B,yEAAyE;YAC3D,IAAI;CAKnB;AAyBD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,GACzD,CAAC,gBAAgB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CAuCzE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,EAC1D,OAAO,EAAE,gBAAgB,EACzB,cAAc,CAAC,EAAE,gBAAgB,GAChC,GAAG,CAAC,MAAM,CAAC,CAmBb"}
@@ -109,11 +109,11 @@ export declare function accountInfoHasIdentitySignal(account: AccountInfo | unde
109
109
  /** Session-time mapping from the SDK's `AccountInfo`, the richest source when
110
110
  * it is populated. Returns `undefined` when the account carries no identity
111
111
  * signal, so callers keep the status they already know. */
112
- export declare function fromAccountInfo(account: AccountInfo | undefined): AuthStatus | undefined;
112
+ export declare function fromAccountInfo(account: AccountInfo | undefined, apiKeyHelper?: string): AuthStatus | undefined;
113
113
  /** Pre-session mapping from `claude auth status --json` stdout. Returns
114
114
  * `undefined` when the output is not the expected JSON object, so callers can
115
115
  * report "not known" instead of guessing. */
116
- export declare function fromCliStatus(stdout: string): AuthStatus | undefined;
116
+ export declare function fromCliStatus(stdout: string, apiKeyHelper?: string): AuthStatus | undefined;
117
117
  /**
118
118
  * Do two payloads describe the same login? Compared on the field that
119
119
  * identifies each kind — the key source for `api_key`, the email for
@@ -1 +1 @@
1
- {"version":3,"file":"auth-status.d.ts","sourceRoot":"","sources":["../src/auth-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE;uEACuE;AACvE,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAE/D;6CAC6C;AAC7C,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB;4DACwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd;4EACwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAEtE;;;0EAG0E;AAC1E,MAAM,MAAM,oBA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AK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAyBF,wBAAgB,qBAAqB,IAAI,UAAU,CAElD;AAED;kFACkF;AAClF,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAc9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAOtF;AAED;;4DAE4D;AAC5D,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,YAAY,CAAC,EAAE,MAAM,GACpB,UAAU,GAAG,SAAS,CAYxB;AAED;;8CAE8C;AAC9C,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CA6B3F;AAsED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAYlE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAe9F;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAgBhF"}
@@ -53,6 +53,12 @@ const NOT_LOGGED_IN = {
53
53
  kind: "none",
54
54
  label: "Not logged in",
55
55
  };
56
+ const API_KEY_SOURCE_DETAILS = new Map([
57
+ ["apiKeyHelper", "API key helper"],
58
+ ["env", "env"],
59
+ ["ANTHROPIC_API_KEY", "ANTHROPIC_API_KEY"],
60
+ ["ANTHROPIC_AUTH_TOKEN", "ANTHROPIC_AUTH_TOKEN"],
61
+ ]);
56
62
  /** Display names for the non-firstParty backends, where auth lives outside the
57
63
  * agent (AWS credentials, gcloud ADC, …). */
58
64
  const EXTERNAL_PROVIDER_LABELS = {
@@ -108,7 +114,7 @@ export function accountInfoHasIdentitySignal(account) {
108
114
  /** Session-time mapping from the SDK's `AccountInfo`, the richest source when
109
115
  * it is populated. Returns `undefined` when the account carries no identity
110
116
  * signal, so callers keep the status they already know. */
111
- export function fromAccountInfo(account) {
117
+ export function fromAccountInfo(account, apiKeyHelper) {
112
118
  if (!account || !accountInfoHasIdentitySignal(account)) {
113
119
  return undefined;
114
120
  }
@@ -118,12 +124,13 @@ export function fromAccountInfo(account) {
118
124
  apiKeySource: account.apiKeySource,
119
125
  email: account.email,
120
126
  organization: account.organization,
127
+ apiKeyHelper,
121
128
  });
122
129
  }
123
130
  /** Pre-session mapping from `claude auth status --json` stdout. Returns
124
131
  * `undefined` when the output is not the expected JSON object, so callers can
125
132
  * report "not known" instead of guessing. */
126
- export function fromCliStatus(stdout) {
133
+ export function fromCliStatus(stdout, apiKeyHelper) {
127
134
  let parsed;
128
135
  try {
129
136
  parsed = JSON.parse(stdout);
@@ -151,6 +158,7 @@ export function fromCliStatus(stdout) {
151
158
  apiKeySource: status.apiKeySource,
152
159
  email: status.email,
153
160
  organization: status.orgName,
161
+ apiKeyHelper,
154
162
  });
155
163
  }
156
164
  /** Single mapping table shared by both sources; see the `kind`/`label` table in
@@ -175,11 +183,17 @@ function mapAuthFields(fields) {
175
183
  };
176
184
  }
177
185
  if (apiKeySource) {
186
+ if (apiKeySource === "apiKeyHelper" &&
187
+ typeof fields.apiKeyHelper === "string" &&
188
+ /\bcentral\b/i.test(fields.apiKeyHelper) &&
189
+ /\bproxy\s+start\b/i.test(fields.apiKeyHelper)) {
190
+ return { kind: "gateway", label: "JetBrains Air Gateway" };
191
+ }
192
+ const detail = API_KEY_SOURCE_DETAILS.get(apiKeySource);
178
193
  return {
179
194
  kind: "api_key",
180
195
  label: "Anthropic API key",
181
- // The source ("apiKeyHelper", "env", …) is the specifics line.
182
- detail: apiKeySource,
196
+ ...(detail ? { detail } : {}),
183
197
  };
184
198
  }
185
199
  if (subscriptionType) {
@@ -22,11 +22,28 @@ export declare function executionDiagnostic(message: SDKResultMessage): string |
22
22
  /** Whether `message` is the error-shaped diagnostic Claude emits for the cycle
23
23
  * a recorded ExitPlanMode `interrupt: true` answer stopped. */
24
24
  export declare function isExitPlanInterruptionResult(message: SDKResultMessage, pending: ExitPlanState["pendingExitPlanModeInterruption"]): boolean;
25
+ /** The id of the plan that an approved ExitPlanMode publishes. Claude Code
26
+ * keeps one plan file per session, which a later plan mode rewrites, so each
27
+ * approval replaces the plan before it. The TodoWrite checklist is a
28
+ * separate plan. */
29
+ export declare const PLAN_MODE_PLAN_ID = "plan-mode";
30
+ /** The plan, trimmed, that a successful ExitPlanMode result approved: the plan
31
+ * of the structured `output`, which includes the user's edits, else the plan
32
+ * that Claude Code adds to the tool's `input`. Replay has only the input: the
33
+ * SDK's `getSessionMessages` drops the structured output that the transcript
34
+ * keeps. Undefined for a subagent's plan, one that waits for its team lead
35
+ * (both only known from the output), and an empty plan. */
36
+ export declare function approvedPlan(input: unknown, output: unknown): string | undefined;
37
+ /** The update that shows an approved plan to a client that supports plan
38
+ * operations (the `plan` client capability, which every v2 client has). */
39
+ export declare function planModeUpdate(plan: string): SessionNotification["update"];
25
40
  /** Claude wraps a rejected ExitPlanMode explanation in a Markdown code fence.
26
41
  * Strip exactly one complete outer fence for that tool only. */
27
42
  export declare function exitPlanModeRawOutput(toolName: string, content: unknown): unknown;
28
43
  export type ExitPlanRestartHost<Session extends ClearContextSession<Turn>, Turn extends ClearContextTurn> = Omit<ClearContextCoordinatorHost<Session, Turn>, "publishSessionState" | "continuationMessage"> & {
29
44
  sessionUpdate(notification: SessionNotification): Promise<void>;
45
+ /** Whether the client takes plan operations (see planModeUpdate). */
46
+ supportsPlanOperations(): boolean;
30
47
  destroyReplacement(sessionId: string, session: Session): void;
31
48
  settleCancelledTurn(oldSession: Session, turnSession: Session, turn: Turn): void;
32
49
  settleFailedTurn(turnSession: Session, turn: Turn, error: unknown): void;
@@ -1 +1 @@
1
- {"version":3,"file":"exit-plan.d.ts","sourceRoot":"","sources":["../src/exit-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAEtB,MAAM,gCAAgC,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,mBAAmB,EACjC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,mBAAmB,CAarB;AAeD,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;IAC3D,+BAA+B,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,CAAC;IACjF,2BAA2B,CAAC,EAAE,iBAAiB,CAAC;CACjD,CAAC;AA0BF;+EAC+E;AAC/E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,EACrD,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,aAAa,GACnB,MAAM,GAAG,SAAS,CA0BpB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAKjF;AAED;+DAC+D;AAC/D,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,aAAa,CAAC,iCAAiC,CAAC,GACxD,OAAO,CAQT;AAED;gEAC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PlanInterruptionResult(message, pending) {
78
78
  /(?:^|\s)result_type=user(?:\s|$)/.test(diagnostic) &&
79
79
  /(?:^|\s)stop_reason=tool_use(?:\s|$)/.test(diagnostic));
80
80
  }
81
+ /** The id of the plan that an approved ExitPlanMode publishes. Claude Code
82
+ * keeps one plan file per session, which a later plan mode rewrites, so each
83
+ * approval replaces the plan before it. The TodoWrite checklist is a
84
+ * separate plan. */
85
+ export const PLAN_MODE_PLAN_ID = "plan-mode";
86
+ /** The plan, trimmed, that a successful ExitPlanMode result approved: the plan
87
+ * of the structured `output`, which includes the user's edits, else the plan
88
+ * that Claude Code adds to the tool's `input`. Replay has only the input: the
89
+ * SDK's `getSessionMessages` drops the structured output that the transcript
90
+ * keeps. Undefined for a subagent's plan, one that waits for its team lead
91
+ * (both only known from the output), and an empty plan. */
92
+ export function approvedPlan(input, output) {
93
+ const result = output;
94
+ if (result?.isAgent === true || result?.awaitingLeaderApproval === true)
95
+ return undefined;
96
+ const plan = typeof result?.plan === "string"
97
+ ? result.plan
98
+ : input?.plan;
99
+ return typeof plan === "string" && plan.trim() !== "" ? plan.trim() : undefined;
100
+ }
101
+ /** The update that shows an approved plan to a client that supports plan
102
+ * operations (the `plan` client capability, which every v2 client has). */
103
+ export function planModeUpdate(plan) {
104
+ return {
105
+ sessionUpdate: "plan_update",
106
+ plan: { type: "markdown", planId: PLAN_MODE_PLAN_ID, content: plan },
107
+ };
108
+ }
81
109
  /** Claude wraps a rejected ExitPlanMode explanation in a Markdown code fence.
82
110
  * Strip exactly one complete outer fence for that tool only. */
83
111
  export function exitPlanModeRawOutput(toolName, content) {
@@ -115,6 +143,12 @@ export class ExitPlanCoordinator {
115
143
  sessionId: id,
116
144
  update: { sessionUpdate: "config_option_update", configOptions },
117
145
  });
146
+ // The approved plan becomes the session's plan once the fresh
147
+ // context that carries it out exists. Its ExitPlanMode ended with
148
+ // an error result, so toAcpNotifications did not publish it.
149
+ if (this.host.supportsPlanOperations()) {
150
+ await this.host.sessionUpdate({ sessionId: id, update: planModeUpdate(reset.plan) });
151
+ }
118
152
  },
119
153
  continuationMessage: (id, plan, promptUuid) => ({
120
154
  type: "user",
@@ -1,4 +1,9 @@
1
- import type { AcpSessionNotification, SubagentState } from "./acp-subagents.js";
1
+ import { type SessionNotification } from "@agentclientprotocol/sdk";
2
+ import type { AcpSessionNotification, SubagentForm, SubagentState } from "./acp-subagents.js";
3
+ /** The work state of a child, as the RFD's `subagent_update.state` carries it. */
4
+ export type WorkState = NonNullable<Extract<SessionNotification["update"], {
5
+ sessionUpdate: "subagent_update";
6
+ }>["state"]>;
2
7
  export type NativeSubagent = {
3
8
  sessionId: string;
4
9
  parentSessionId: string;
@@ -7,9 +12,32 @@ export type NativeSubagent = {
7
12
  task: string;
8
13
  /**
9
14
  * The exact prompt of this generation, sent as `prompt` in
10
- * `subagent_spawned`. It is absent when the adapter has no prompt.
15
+ * `subagent_spawned`, or as the child's first `session_message` in the RFD
16
+ * form. It is absent when the adapter has no prompt.
11
17
  */
12
18
  prompt?: string;
19
+ /** The RFD form: the parent's label for the child, `subagent_update.title`. */
20
+ title?: string;
21
+ /** The RFD form: the child's role, its `subagent_type`, for the title. */
22
+ role?: string;
23
+ /** The RFD form: the child's purpose, `subagent_update.description`. */
24
+ description?: string;
25
+ /**
26
+ * The RFD form: the work state the client holds. The child is reusable, so
27
+ * `idle` is not terminal. AIR's draft uses {@link terminalState} instead.
28
+ */
29
+ workState?: WorkState["state"];
30
+ /**
31
+ * The RFD form: the child's idle snapshot reports a failure without the
32
+ * SDK's error text, which a later event of the same failure may carry.
33
+ */
34
+ missingError?: boolean;
35
+ /** The RFD form: the open permission and question requests of the child. */
36
+ openRequests?: number;
37
+ /** The RFD form: the ids of the prompt messages in the child's transcript. */
38
+ promptIds?: Set<string>;
39
+ /** The RFD form: the calls that delegated to the child, whose runs ended. */
40
+ endedRuns?: Set<string>;
13
41
  announced?: boolean;
14
42
  terminalState?: SubagentState;
15
43
  /** Connection-local single-flight state; never serialized on the wire. */
@@ -26,6 +54,18 @@ type Publish = (notification: AcpSessionNotification) => Promise<void>;
26
54
  type Logger = {
27
55
  log(message: string): void;
28
56
  };
57
+ /** What the SDK says about the end of a task, beyond its status. */
58
+ export type TaskEnd = {
59
+ /** The SDK's text for a failure. */
60
+ error?: string;
61
+ /** The SDK's reason for an unusual end, such as `worker_restart`. */
62
+ reason?: string;
63
+ /**
64
+ * The adapter knows that the work ended, but not why: the stream ended, or
65
+ * the conversation was reset, with the task still running.
66
+ */
67
+ unexplained?: boolean;
68
+ };
29
69
  type TaskStarted = {
30
70
  taskId: string;
31
71
  toolUseId?: string | null;
@@ -43,6 +83,8 @@ export declare class NativeSubagentRuntime {
43
83
  private readonly publish;
44
84
  private readonly logger;
45
85
  readonly enabled: boolean;
86
+ /** The form of the child sessions; see {@link SubagentForm}. */
87
+ readonly form: SubagentForm | undefined;
46
88
  private readonly children;
47
89
  private readonly taskByToolUse;
48
90
  private readonly parentByToolUse;
@@ -56,11 +98,15 @@ export declare class NativeSubagentRuntime {
56
98
  */
57
99
  private readonly childByToolCall;
58
100
  private readonly taskFinishPromises;
101
+ /** The RFD form: the session that made each SendMessage call. */
102
+ private readonly senderByToolUse;
59
103
  private readonly generationByTaskId;
60
104
  private readonly pending;
61
105
  private pendingCount;
62
- constructor(enabled: boolean, rootSessionId: string, session: NativeSubagentSession, publish: Publish, logger: Logger);
106
+ /** `form` is undefined for a client without native subagent sessions. */
107
+ constructor(form: SubagentForm | undefined, rootSessionId: string, session: NativeSubagentSession, publish: Publish, logger: Logger);
63
108
  route(notification: AcpSessionNotification, deliver: Publish, forcedSessionId?: string): Promise<AcpSessionNotification | null>;
109
+ private routeUpdate;
64
110
  taskStarted(task: TaskStarted, deliver: Publish): Promise<void>;
65
111
  /**
66
112
  * Opens a new generation of a finished child when the SDK resumes the same
@@ -68,14 +114,90 @@ export declare class NativeSubagentRuntime {
68
114
  * running `task_updated` patch or a SendMessage `resumedAgentId` is the
69
115
  * signal. A child that did not finish is not changed. The `prompt` is the
70
116
  * SendMessage text that resumed the child, when the adapter knows it.
117
+ *
118
+ * In the RFD form, the running patch only reports that the child runs: its
119
+ * prompt is a guess (the latest SendMessage to the agent), and the
120
+ * `task_started` or the SendMessage result carries the delegation.
71
121
  */
72
122
  taskResumed(taskId: string, deliver: Publish, prompt?: string): Promise<void>;
73
- finishTask(taskId: string, status: unknown, deliver: Publish, toolUseId?: string | null): Promise<void>;
123
+ /**
124
+ * The SDK reports in a SendMessage result that the call `toolUseId`, with
125
+ * the message `prompt`, resumed the agent `taskId`. AIR's draft treats it as
126
+ * any resume signal. In the RFD form, the call is the delegation, which the
127
+ * child takes unless its run already ended: the result can arrive after it.
128
+ */
129
+ sendMessageResumed(taskId: string, deliver: Publish, prompt?: string, toolUseId?: string): Promise<void>;
130
+ /**
131
+ * The RFD form: whether the run of the call `toolUseId` that delegated to
132
+ * the child `taskId` already ended. AIR's draft has no such runs.
133
+ */
134
+ isEndedDelegation(taskId: string, toolUseId: string | null | undefined): boolean;
135
+ /**
136
+ * The RFD form: whether `toolUseId` is an earlier delegation of the child
137
+ * `taskId`, whose end does not end the current one. AIR's draft has no
138
+ * such delegations.
139
+ */
140
+ isStaleEnd(taskId: string, toolUseId: string | null | undefined): boolean;
141
+ /**
142
+ * Reports that the SDK ended the task's work. `end` has what the SDK says
143
+ * about it: its text for a failure, and its reason for an unusual end.
144
+ */
145
+ finishTask(taskId: string, status: unknown, deliver: Publish, toolUseId?: string | null, end?: TaskEnd): Promise<void>;
146
+ /**
147
+ * Ends every child that still runs, because the stream ended or the
148
+ * conversation was reset. AIR's draft reports `state` for each. In the RFD
149
+ * form the cause of each child's end is unknown, so it is idle with no stop
150
+ * reason: a child that a cancel stopped already reported it from the SDK's
151
+ * events, and a background child that outlived the cancel was not cancelled.
152
+ */
74
153
  finishAll(state: SubagentState, deliver: Publish): Promise<void>;
154
+ /**
155
+ * The parent session got `session/cancel`. AIR's draft ends every child as
156
+ * cancelled here. The RFD form reports nothing: acknowledging a cancel is no
157
+ * evidence that a child stopped. Claude Code's interrupt stops the
158
+ * foreground children that the turn waits on and, currently, background
159
+ * children too, and the SDK's task events report each as cancelled. A child
160
+ * that keeps running keeps its open requests
161
+ * (agentclientprotocol/agent-client-protocol#2308).
162
+ */
163
+ parentCancelled(deliver: Publish): Promise<void>;
164
+ /**
165
+ * Runs `request`, a permission or question request of the session
166
+ * `sessionId`. In the RFD form, a child waiting on it is `requires_action`
167
+ * until its last open request ends.
168
+ */
169
+ awaitingUser<T>(sessionId: string, request: () => Promise<T>): Promise<T>;
75
170
  discardPending(parentToolUseId: string): void;
76
171
  /**
77
- * Routes an update to the child session. An update of a finished child is
78
- * dropped: it never goes to the root session.
172
+ * The RFD form: the child runs again, and keeps its session. `toolUseId` is
173
+ * the call that delegated, usually a SendMessage: the SDK runs the resumed
174
+ * work under its id, so it becomes the child's current delegation, whose
175
+ * end ends the run, and its prompt is the message with that id. A child
176
+ * that is already working only takes the delegation; a prompt already in
177
+ * its transcript is not sent again. A child that was never announced is
178
+ * not changed.
179
+ */
180
+ private resumeChild;
181
+ /**
182
+ * The RFD form: a child that ends before its parent is known stays
183
+ * unexposed, since the RFD forbids guessing its parent. Its buffered updates
184
+ * are dropped, and it is forgotten, so a late frame does not announce it.
185
+ * (Buffering until that frame would also meet the RFD, but the frame comes
186
+ * before the task in the SDK's order, so a child ending without it is rare.)
187
+ */
188
+ private withdraw;
189
+ /**
190
+ * The RFD form: a later event of a failure can carry the SDK's error text
191
+ * that the reported idle snapshot lacks.
192
+ */
193
+ private supplyError;
194
+ /** Announces `child` in the client's form. A runtime without one never does. */
195
+ private announce;
196
+ /** The RFD form: publishes the work state of `child` on its parent. */
197
+ private reportState;
198
+ /**
199
+ * Routes an update to the child session. It never goes to the root session:
200
+ * in AIR's draft, an update of a finished child is dropped.
79
201
  */
80
202
  private toChild;
81
203
  /**
@@ -84,12 +206,18 @@ export declare class NativeSubagentRuntime {
84
206
  * tool call when the work started. An async task can outlive that child: a
85
207
  * subagent can start a background command and end its turn. So the route
86
208
  * still sends `async_task_spawned`, `async_task_progress` and
87
- * `async_task_state_update` to the child generation after it finished. The route drops every other update
88
- * after the child finished. `undefined` means that the root session owns the
89
- * tool call. `eagerSessionId` is the session where a permission request
90
- * created the tool call before the stream routed it.
209
+ * `async_task_state_update` to the child generation after it finished. In
210
+ * AIR's draft, the route drops every other update after the child finished;
211
+ * in the RFD form, an idle child gets them all. `undefined` means that the
212
+ * root session owns the tool call. `eagerSessionId` is the session where a
213
+ * permission request created the tool call before the stream routed it.
91
214
  */
92
215
  routeOfToolCall(toolCallId: string, eagerSessionId?: string): ((notification: AcpSessionNotification) => AcpSessionNotification | null) | undefined;
216
+ /**
217
+ * The RFD form: remembers the session that made a SendMessage call, the
218
+ * sender of the prompt when the call resumes a child.
219
+ */
220
+ private rememberSendMessage;
93
221
  private rememberToolCallOwner;
94
222
  /** The child generation with the ACP session `sessionId`, if one exists. */
95
223
  private childOfSession;
@@ -106,10 +234,49 @@ export declare class NativeSubagentRuntime {
106
234
  * delivers the updates that waited for the child.
107
235
  */
108
236
  private openGeneration;
237
+ /**
238
+ * The ACP session id of a child: the SDK agent id, and in AIR's draft a
239
+ * generation suffix for each resume. The RFD needs it unique within the
240
+ * connection and never under two parents. Agent ids are random, and an
241
+ * agent keeps its parent, so only a fork could repeat one under another
242
+ * root. That holds today because the SDK's `forkSession` copies no
243
+ * `subagents/` history, so a fork cannot resume an agent of the original.
244
+ * If a fork ever can, the RFD requires remapping the copied ids, for
245
+ * example by deriving the child id from the root session id.
246
+ */
109
247
  private nextChildSessionId;
110
248
  }
111
- export declare function announceNativeSubagent(child: NativeSubagent, publish: Publish): Promise<void>;
249
+ /**
250
+ * Announces the child on its parent, once, before any update of the child.
251
+ * The RFD form announces it as running and then sends the prompt as the
252
+ * first message of the child. The child gets no capabilities, so the client
253
+ * may not cancel or otherwise change it.
254
+ */
255
+ export declare function announceNativeSubagent(child: NativeSubagent, publish: Publish, form: SubagentForm): Promise<void>;
112
256
  export declare function finishNativeSubagent(session: NativeSubagentSession, taskId: string, state: SubagentState, publish: Publish): Promise<void>;
257
+ /**
258
+ * The RFD form: the work state at the end of a child's work.
259
+ *
260
+ * A failure is idle with the `error` stop reason and, when the SDK gives its
261
+ * text, the JSON-RPC `error`, as the RFD asks: a v1 child has no prompt
262
+ * response, so this is how a client learns that its work failed. The error is
263
+ * an internal error, as for a failed turn on the v2 surface.
264
+ *
265
+ * A task that a worker restart orphaned, or that was still running when the
266
+ * stream ended, is idle with no stop reason: its work ended, but the adapter
267
+ * did not see a cancellation or a failure, which the RFD forbids claiming.
268
+ */
269
+ export declare function rfdEndState(state: SubagentState, end: TaskEnd | undefined): WorkState;
270
+ /**
271
+ * The RFD form: the parent's labels for a child. The title is the agent's
272
+ * name, with its role after it when both are known, else the role. The
273
+ * description is the task's short description, never the prompt.
274
+ */
275
+ export declare function rfdLabels(name: unknown, role: unknown, description: unknown): {
276
+ title?: string;
277
+ role?: string;
278
+ description?: string;
279
+ };
113
280
  /**
114
281
  * The agent id that a successful SendMessage result resumed. The SDK puts it
115
282
  * in `tool_use_result.resumedAgentId` when a finished agent runs again.
@@ -124,6 +291,18 @@ export declare function sendMessageResumePrompt(toolUses: Record<string, {
124
291
  name: string;
125
292
  input: unknown;
126
293
  } | undefined>, agentId: string, resultToolUseIds?: readonly string[]): string | undefined;
294
+ /**
295
+ * The SendMessage call that resumed the agent `agentId`, and its text when it
296
+ * has one; see {@link sendMessageResumePrompt}. The call is known even
297
+ * without text, so a late result still names the delegation it reports.
298
+ */
299
+ export declare function sendMessageResume(toolUses: Record<string, {
300
+ name: string;
301
+ input: unknown;
302
+ } | undefined>, agentId: string, resultToolUseIds?: readonly string[]): {
303
+ toolUseId: string;
304
+ text?: string;
305
+ } | undefined;
127
306
  export declare function nativeSubagentState(status: unknown): SubagentState | undefined;
128
307
  export declare function isNativeSubagentControlUpdate(update: AcpSessionNotification["update"]): update is Extract<AcpSessionNotification["update"], {
129
308
  sessionUpdate: "tool_call" |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