@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,92 @@
1
+ import { orderedSubagentConfiguration, subagentHookOptions } from "../subagent-configuration.js";
2
+ /** The most children not announced yet whose options wait. */
3
+ const MAX_PENDING_CHILDREN = 64;
4
+ export class ChildConfigurations {
5
+ host;
6
+ /** Each child's options, by id, and the snapshot that the client last got. */
7
+ children = new Map();
8
+ /** The custom agents of the session, for the description of a child's agent type. */
9
+ agents = [];
10
+ constructor(host) {
11
+ this.host = host;
12
+ }
13
+ /** The session's custom agents, from Claude Code's initialization (see `customAgents`). */
14
+ configureAgents(agents) {
15
+ this.agents = agents;
16
+ }
17
+ /** The options that a hook of a subagent reports of it. */
18
+ hookOptions(input) {
19
+ return subagentHookOptions(input, {
20
+ availableModes: this.host.modes(),
21
+ models: this.host.models(),
22
+ agents: this.agents,
23
+ });
24
+ }
25
+ /**
26
+ * Takes options of the child `agentId`. Those of a child that is not
27
+ * announced wait for it, for at most {@link MAX_PENDING_CHILDREN} children.
28
+ * Returns whether they were kept.
29
+ */
30
+ take(agentId, options) {
31
+ if (options.length === 0)
32
+ return false;
33
+ let config = this.children.get(agentId);
34
+ if (!config) {
35
+ const pending = [...this.children.keys()].filter((id) => !this.host.announced(id)).length;
36
+ if (!this.host.announced(agentId) && pending >= MAX_PENDING_CHILDREN)
37
+ return false;
38
+ config = { options: new Map() };
39
+ this.children.set(agentId, config);
40
+ }
41
+ for (const option of options)
42
+ config.options.set(option.id, option);
43
+ return true;
44
+ }
45
+ /**
46
+ * The child's configuration to send, or undefined when the client holds it
47
+ * already. It counts as sent.
48
+ */
49
+ unsent(agentId) {
50
+ const config = this.children.get(agentId);
51
+ if (!config)
52
+ return undefined;
53
+ const options = orderedSubagentConfiguration(config.options.values());
54
+ const snapshot = JSON.stringify(options);
55
+ if (config.published === snapshot)
56
+ return undefined;
57
+ config.published = snapshot;
58
+ return options;
59
+ }
60
+ /** The configuration that the client last got for the child `agentId`, if any. */
61
+ published(agentId) {
62
+ const published = this.children.get(agentId)?.published;
63
+ return published === undefined ? undefined : JSON.parse(published);
64
+ }
65
+ /** A child that stays unexposed: its options go nowhere. */
66
+ forget(agentId) {
67
+ this.children.delete(agentId);
68
+ }
69
+ }
70
+ /**
71
+ * The hook that reports a subagent's hooks to `report`, for each hook event
72
+ * that reports them. The hook makes no decision.
73
+ */
74
+ export function subagentHooks(report) {
75
+ const matcher = {
76
+ hooks: [
77
+ async (input) => {
78
+ if (input.agent_id)
79
+ report(input);
80
+ return { continue: true };
81
+ },
82
+ ],
83
+ };
84
+ return {
85
+ SubagentStart: matcher,
86
+ SubagentStop: matcher,
87
+ PreToolUse: matcher,
88
+ PostToolUse: matcher,
89
+ PostToolUseFailure: matcher,
90
+ PostModelSwitch: matcher,
91
+ };
92
+ }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * ExitPlanMode's "Yes, clear context" option on the v2 core: the
3
+ * approved plan runs in a fresh context, in the same turn.
4
+ *
5
+ * The answer denies ExitPlanMode with an interrupt (`permissions/effects.ts`),
6
+ * so the plan does not run in the old context. Claude Code ends that cycle
7
+ * with an interruption result (`isExitPlanInterruptionResult`). The turn stays
8
+ * open, and the session sends Claude Code `/clear`, which mounts a fresh
9
+ * conversation (`conversation_reset`), sets the mode the user picked, and
10
+ * sends the plan as the prompt "Implement the following plan". The turn ends
11
+ * with that prompt's result, with the usage of the whole turn.
12
+ *
13
+ * The query stays, unlike v1's fresh query (`clear-context-coordinator.ts`):
14
+ * `/clear` is Claude Code's own way to start a fresh conversation, and the
15
+ * query's tasks, MCP servers and settings stay. The client sees the accepted plan's tool call `completed`, the
16
+ * options with the new mode, a `usage_update` of an empty context, the plan
17
+ * as the session's markdown plan, then the plan's run in the open turn, with
18
+ * no `user_message` for the adapter's prompts.
19
+ */
20
+ import type { AcpSessionNotification } from "../acp-subagents.js";
21
+ import type { ClearContextReset } from "../clear-context-coordinator.js";
22
+ import type { PermissionMode, SDKResultMessage } from "@anthropic-ai/claude-agent-sdk";
23
+ import type { TurnEnd } from "./outcome.js";
24
+ type Uuid = `${string}-${string}-${string}-${string}-${string}`;
25
+ /** What the session does for a fresh context. */
26
+ export interface ClearContextHost {
27
+ /** Sends Claude Code the prompt `text` with `uuid`, as the adapter's own prompt. */
28
+ push(text: string, uuid: Uuid): void;
29
+ /** Sets the permission mode on the query and in the options. */
30
+ enterMode(mode: PermissionMode): Promise<void>;
31
+ /** Sends the fresh context's options, its empty usage, and the plan. */
32
+ publish(plan: string): void;
33
+ logError(message: string, error: unknown): void;
34
+ }
35
+ export declare class ClearContext {
36
+ private readonly host;
37
+ private readonly newUuid;
38
+ /** The plan the user accepted with clearing the context, until its interruption. */
39
+ private accepted;
40
+ /** An ExitPlanMode answer that interrupts the cycle, and whether its tool result came. */
41
+ private interruption;
42
+ private continuation;
43
+ /** The tool calls of the old context's tool uses, by id (`toolUseCache`). */
44
+ private readonly toolUses;
45
+ constructor(host: ClearContextHost, toolUses: () => Record<string, {
46
+ name: string;
47
+ } | undefined>, newUuid: () => Uuid);
48
+ /**
49
+ * An ExitPlanMode answer that interrupts the cycle: "No, keep planning",
50
+ * or a plan accepted with clearing the context (`reset`).
51
+ */
52
+ interrupting(toolUseId: string, reset: ClearContextReset | undefined): void;
53
+ /**
54
+ * A user message of the main conversation. Returns the rewrite of its
55
+ * updates: the accepted plan's tool result, which Claude Code reports as a
56
+ * rejection, goes out `completed`, without the rejection's text.
57
+ */
58
+ toolResults(message: {
59
+ type: string;
60
+ tool_result_meta?: unknown;
61
+ message?: {
62
+ content?: unknown;
63
+ };
64
+ }): ((notification: AcpSessionNotification) => AcpSessionNotification) | undefined;
65
+ /**
66
+ * A result of the open turn. Returns whether the turn goes on: it is the
67
+ * interruption of a plan accepted with clearing the context, or `/clear`'s.
68
+ * The fresh context starts with the first.
69
+ */
70
+ holdsResult(message: SDKResultMessage, end: TurnEnd): boolean;
71
+ /** Claude Code mounted a fresh conversation: the plan goes out in it. */
72
+ conversationReset(): void;
73
+ /** Whether the open turn waits for the plan's prompt to start. */
74
+ holdsTurn(): boolean;
75
+ /** Claude Code took in the prompt `uuid`. Returns whether it is the plan's prompt. */
76
+ promptStarted(uuid: string): boolean;
77
+ /** Whether `uuid` is one of the adapter's prompts for the fresh context: the client gets no `user_message`. */
78
+ ownsPrompt(uuid: string): boolean;
79
+ /**
80
+ * The end of the turn that `end`'s result ends: with the usage of the
81
+ * results before it in the turn, the old context's and `/clear`'s.
82
+ */
83
+ turnEnd(end: TurnEnd): TurnEnd;
84
+ /**
85
+ * The turn ends otherwise (a cancel, a close): the fresh context goes on
86
+ * without the plan. Returns the uuids of the adapter's prompts that Claude
87
+ * Code may still run, whose work the client did not see.
88
+ */
89
+ stop(): string[];
90
+ /** The fresh context is mounted: the mode, the plan, and the plan's prompt. */
91
+ private mounted;
92
+ }
93
+ export {};
94
+ //# sourceMappingURL=clear-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear-context.d.ts","sourceRoot":"","sources":["../../src/v2/clear-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAMzE,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,KAAK,IAAI,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAEhE,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IACrC,gEAAgE;IAChE,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,wEAAwE;IACxE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,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GAAG,OAAO;IAM9B;;;;OAIG;IACH,IAAI,IAAI,MAAM,EAAE;IAWhB,+EAA+E;IAC/E,OAAO,CAAC,OAAO;CAgBhB"}
@@ -0,0 +1,176 @@
1
+ import { acceptedPlanToolResult, isExitPlanInterruptionResult, observeExitPlanToolResults, } from "../exit-plan.js";
2
+ import { quotaMeta } from "../session-usage.js";
3
+ export class ClearContext {
4
+ host;
5
+ newUuid;
6
+ /** The plan the user accepted with clearing the context, until its interruption. */
7
+ accepted;
8
+ /** An ExitPlanMode answer that interrupts the cycle, and whether its tool result came. */
9
+ interruption;
10
+ continuation;
11
+ /** The tool calls of the old context's tool uses, by id (`toolUseCache`). */
12
+ toolUses;
13
+ constructor(host, toolUses, newUuid) {
14
+ this.host = host;
15
+ this.newUuid = newUuid;
16
+ this.toolUses = toolUses;
17
+ }
18
+ /**
19
+ * An ExitPlanMode answer that interrupts the cycle: "No, keep planning",
20
+ * or a plan accepted with clearing the context (`reset`).
21
+ */
22
+ interrupting(toolUseId, reset) {
23
+ this.interruption = { toolUseId, toolResultSeen: false };
24
+ this.accepted = reset;
25
+ }
26
+ /**
27
+ * A user message of the main conversation. Returns the rewrite of its
28
+ * updates: the accepted plan's tool result, which Claude Code reports as a
29
+ * rejection, goes out `completed`, without the rejection's text.
30
+ */
31
+ toolResults(message) {
32
+ const state = {
33
+ toolUseCache: this.toolUses(),
34
+ pendingExitPlanModeInterruption: this.interruption,
35
+ pendingExitPlanContextReset: this.accepted,
36
+ };
37
+ const acceptedToolUse = observeExitPlanToolResults(message, message.message?.content, state);
38
+ this.interruption = state.pendingExitPlanModeInterruption;
39
+ if (!acceptedToolUse)
40
+ return undefined;
41
+ return (notification) => acceptedPlanToolResult(notification, acceptedToolUse);
42
+ }
43
+ /**
44
+ * A result of the open turn. Returns whether the turn goes on: it is the
45
+ * interruption of a plan accepted with clearing the context, or `/clear`'s.
46
+ * The fresh context starts with the first.
47
+ */
48
+ holdsResult(message, end) {
49
+ const continuation = this.continuation;
50
+ if (continuation) {
51
+ if (continuation.planStarted)
52
+ return false;
53
+ continuation.carried.push(end);
54
+ // Without a `conversation_reset` (an older Claude Code), `/clear`'s result shows it ran.
55
+ this.mounted();
56
+ return true;
57
+ }
58
+ const interruption = this.interruption;
59
+ if (!interruption || !isExitPlanInterruptionResult(message, interruption))
60
+ return false;
61
+ this.interruption = undefined;
62
+ const reset = this.accepted;
63
+ this.accepted = undefined;
64
+ // "No, keep planning": the turn ends.
65
+ if (!reset || reset.toolUseId !== interruption.toolUseId)
66
+ return false;
67
+ const clearUuid = this.newUuid();
68
+ this.continuation = {
69
+ reset,
70
+ clearUuid,
71
+ planUuid: this.newUuid(),
72
+ carried: [end],
73
+ planSent: false,
74
+ planStarted: false,
75
+ };
76
+ this.host.push("/clear", clearUuid);
77
+ return true;
78
+ }
79
+ /** Claude Code mounted a fresh conversation: the plan goes out in it. */
80
+ conversationReset() {
81
+ this.mounted();
82
+ }
83
+ /** Whether the open turn waits for the plan's prompt to start. */
84
+ holdsTurn() {
85
+ return this.continuation !== undefined && !this.continuation.planStarted;
86
+ }
87
+ /** Claude Code took in the prompt `uuid`. Returns whether it is the plan's prompt. */
88
+ promptStarted(uuid) {
89
+ if (this.continuation?.planUuid !== uuid)
90
+ return false;
91
+ this.continuation.planStarted = true;
92
+ return true;
93
+ }
94
+ /** Whether `uuid` is one of the adapter's prompts for the fresh context: the client gets no `user_message`. */
95
+ ownsPrompt(uuid) {
96
+ return this.continuation?.clearUuid === uuid || this.continuation?.planUuid === uuid;
97
+ }
98
+ /**
99
+ * The end of the turn that `end`'s result ends: with the usage of the
100
+ * results before it in the turn, the old context's and `/clear`'s.
101
+ */
102
+ turnEnd(end) {
103
+ const carried = this.continuation?.carried;
104
+ this.continuation = undefined;
105
+ return carried && carried.length > 0 ? combinedEnd([...carried, end]) : end;
106
+ }
107
+ /**
108
+ * The turn ends otherwise (a cancel, a close): the fresh context goes on
109
+ * without the plan. Returns the uuids of the adapter's prompts that Claude
110
+ * Code may still run, whose work the client did not see.
111
+ */
112
+ stop() {
113
+ this.interruption = undefined;
114
+ this.accepted = undefined;
115
+ const continuation = this.continuation;
116
+ this.continuation = undefined;
117
+ if (!continuation || continuation.planStarted)
118
+ return [];
119
+ return continuation.planSent
120
+ ? [continuation.clearUuid, continuation.planUuid]
121
+ : [continuation.clearUuid];
122
+ }
123
+ /** The fresh context is mounted: the mode, the plan, and the plan's prompt. */
124
+ mounted() {
125
+ const continuation = this.continuation;
126
+ if (!continuation || continuation.planSent)
127
+ return;
128
+ continuation.planSent = true;
129
+ const { mode, plan } = continuation.reset;
130
+ // Nothing orders the mode before the plan's prompt but this chain: the
131
+ // prompt goes out once Claude Code took the mode.
132
+ void this.host
133
+ .enterMode(mode)
134
+ .catch((error) => this.host.logError("Failed to set the plan's mode", error))
135
+ .then(() => {
136
+ if (this.continuation !== continuation)
137
+ return;
138
+ this.host.publish(plan);
139
+ this.host.push(`Implement the following plan:\n\n${plan}`, continuation.planUuid);
140
+ });
141
+ }
142
+ }
143
+ /** The end of a turn of several results: the last result, with their usage summed. */
144
+ function combinedEnd(ends) {
145
+ const total = {
146
+ inputTokens: 0,
147
+ outputTokens: 0,
148
+ cachedReadTokens: 0,
149
+ cachedWriteTokens: 0,
150
+ };
151
+ const rows = {};
152
+ for (const { _meta } of ends) {
153
+ add(total, _meta.quota.token_count);
154
+ for (const row of _meta.quota.model_usage) {
155
+ add((rows[row.model] ??= {
156
+ inputTokens: 0,
157
+ outputTokens: 0,
158
+ cachedReadTokens: 0,
159
+ cachedWriteTokens: 0,
160
+ }), row.token_count);
161
+ }
162
+ }
163
+ const last = ends[ends.length - 1];
164
+ const meta = quotaMeta(total, rows);
165
+ return {
166
+ result: last.result,
167
+ usage: { ...total, totalTokens: meta.quota.token_count.totalTokens },
168
+ _meta: meta,
169
+ };
170
+ }
171
+ function add(into, count) {
172
+ into.inputTokens += count.inputTokens;
173
+ into.outputTokens += count.outputTokens;
174
+ into.cachedReadTokens += count.cachedInputTokens;
175
+ into.cachedWriteTokens += count.cachedWriteTokens;
176
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The slash commands of a v2 session: the list that setup responses
3
+ * and `available_commands_update` carry, and the adapter's own `/mcp`.
4
+ *
5
+ * The list is built by the v1 core's `getAvailableSlashCommands`, so both
6
+ * cores advertise the same commands: Claude Code's commands without the
7
+ * unsupported and terminal-bound ones, MCP prompts as `mcp:<server>:<name>`,
8
+ * the adapter's `/mcp`, and the adapter's `/remote-control` when the query
9
+ * serves Remote Control and Claude Code offers no command of that name (see
10
+ * `remote-control.ts`).
11
+ *
12
+ * `/mcp` is served as on v1 (`runMcpCommand`): Claude Code runs the command,
13
+ * and the adapter's server list replaces Claude Code's text in the turn's
14
+ * output.
15
+ */
16
+ import type { ContentBlock } from "@agentclientprotocol/sdk/unstable";
17
+ import type * as v2 from "@agentclientprotocol/sdk/experimental/v2/unstable";
18
+ import type { Query, SDKSystemMessage, SlashCommand } from "@anthropic-ai/claude-agent-sdk";
19
+ import { runMcpCommand, type McpCommand } from "../mcp-command.js";
20
+ export declare class SessionCommands {
21
+ private readonly query;
22
+ /** Claude Code's terminal-bound commands, from the turn's `system/init`. */
23
+ private terminalCommands;
24
+ constructor(query: Query);
25
+ /** The session's commands, in v2 form. */
26
+ list(): Promise<v2.AvailableCommand[]>;
27
+ /** The `available_commands_update` of Claude Code's `commands_changed` list. */
28
+ changed(commands: SlashCommand[]): v2.SessionUpdate;
29
+ /**
30
+ * Records the terminal-bound commands of a `system/init`. Returns whether
31
+ * they changed, so the list must go out again.
32
+ */
33
+ init(message: SDKSystemMessage): boolean;
34
+ /** Claude Code's terminal-bound commands, which it does not offer. */
35
+ terminal(): readonly string[] | undefined;
36
+ /** The `/mcp` command that a prompt is, if it is one. */
37
+ localCommand(prompt: ContentBlock[]): McpCommand | undefined;
38
+ /**
39
+ * The text that replaces Claude Code's `output` of `command`, or `output`
40
+ * when the adapter cannot build it (a status read failed, or `signal`
41
+ * aborted).
42
+ */
43
+ replace(query: Parameters<typeof runMcpCommand>[0], command: McpCommand, output: string, signal: AbortSignal, logError: (message: string) => void): Promise<string>;
44
+ private render;
45
+ }
46
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/v2/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,KAAK,EAAE,MAAM,mDAAmD,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,EAAmB,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpF,qBAAa,eAAe;IAId,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,4EAA4E;IAC5E,OAAO,CAAC,gBAAgB,CAAuB;gBAElB,KAAK,EAAE,KAAK;IAEzC,0CAA0C;IACpC,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAI5C,gFAAgF;IAChF,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa;IAInD;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;IASxC,sEAAsE;IACtE,QAAQ,IAAI,SAAS,MAAM,EAAE,GAAG,SAAS;IAIzC,yDAAyD;IACzD,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,GAAG,SAAS;IAM5D;;;;OAIG;IACG,OAAO,CACX,KAAK,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,EAC1C,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAClC,OAAO,CAAC,MAAM,CAAC;IAKlB,OAAO,CAAC,MAAM;CAKf"}
@@ -0,0 +1,54 @@
1
+ import { getAvailableSlashCommands } from "../acp-agent.js";
2
+ import { parseMcpCommand, runMcpCommand } from "../mcp-command.js";
3
+ import { v2AvailableCommands } from "./session-requests.js";
4
+ export class SessionCommands {
5
+ query;
6
+ /** Claude Code's terminal-bound commands, from the turn's `system/init`. */
7
+ terminalCommands;
8
+ constructor(query) {
9
+ this.query = query;
10
+ }
11
+ /** The session's commands, in v2 form. */
12
+ async list() {
13
+ return this.render(await this.query.supportedCommands());
14
+ }
15
+ /** The `available_commands_update` of Claude Code's `commands_changed` list. */
16
+ changed(commands) {
17
+ return { sessionUpdate: "available_commands_update", availableCommands: this.render(commands) };
18
+ }
19
+ /**
20
+ * Records the terminal-bound commands of a `system/init`. Returns whether
21
+ * they changed, so the list must go out again.
22
+ */
23
+ init(message) {
24
+ const terminal = message.terminal_slash_commands;
25
+ if (!terminal || JSON.stringify(terminal) === JSON.stringify(this.terminalCommands)) {
26
+ return false;
27
+ }
28
+ this.terminalCommands = terminal;
29
+ return true;
30
+ }
31
+ /** Claude Code's terminal-bound commands, which it does not offer. */
32
+ terminal() {
33
+ return this.terminalCommands;
34
+ }
35
+ /** The `/mcp` command that a prompt is, if it is one. */
36
+ localCommand(prompt) {
37
+ const [first] = prompt;
38
+ if (prompt.length !== 1 || first?.type !== "text")
39
+ return undefined;
40
+ return parseMcpCommand(first.text) ?? undefined;
41
+ }
42
+ /**
43
+ * The text that replaces Claude Code's `output` of `command`, or `output`
44
+ * when the adapter cannot build it (a status read failed, or `signal`
45
+ * aborted).
46
+ */
47
+ async replace(query, command, output, signal, logError) {
48
+ const { markdown } = await runMcpCommand(query, command, output, signal, logError);
49
+ return markdown ?? output;
50
+ }
51
+ render(commands) {
52
+ return v2AvailableCommands(getAvailableSlashCommands(commands, this.terminalCommands, undefined, undefined, this.query));
53
+ }
54
+ }
@@ -0,0 +1,187 @@
1
+ /**
2
+ * The config options of a v2 session: its permission mode, model,
3
+ * effort, Fast mode, ultracode and main-thread agent. Claude Code owns them
4
+ * all. The session sets each on the query when the client picks a value, and
5
+ * follows the changes it learns of (an approved plan's mode, a model switch
6
+ * that the adapter did not make, the Fast mode state that Claude Code
7
+ * reports).
8
+ *
9
+ * The options are built and changed by the v1 core's rules, from the shared
10
+ * modules (`session-config-options.ts`, `session-effort.ts`,
11
+ * `session-fast-mode.ts`, `session-ultracode.ts`, `session-model.ts`,
12
+ * `session-mode.ts`). Fast mode and ultracode are boolean options: every v2
13
+ * client takes them. For an AIR client that declares `recommendedValue`, the
14
+ * model and effort options carry no `default` row and name a recommendation
15
+ * (`_meta.jetbrains.air.recommendedValue`), and the effort they show is set
16
+ * on the query at the start and at each model switch, as on v1.
17
+ *
18
+ * The mode follows `SessionModeManager`: a model whose `ModelInfo` does not
19
+ * report `supportsAutoMode` runs `auto` as `acceptEdits`, with a notice,
20
+ * whether the client picks `auto`, an answer to ExitPlanMode does, or a model
21
+ * switch leaves the session in it.
22
+ *
23
+ * The changes of one session run one at a time, in the order they came, as
24
+ * the v1 core's `serializeConfigurationChange` runs them: a change awaits
25
+ * Claude Code between its steps, and a model switch rebuilds every option at
26
+ * its end, so a change that ran meanwhile would be lost.
27
+ */
28
+ import { type SessionModeState, type SessionNotification } from "@agentclientprotocol/sdk/unstable";
29
+ import type * as v2 from "@agentclientprotocol/sdk/experimental/v2/unstable";
30
+ import type { FastModeDisabledReason, FastModeState, HookCallbackMatcher, ModelInfo, PermissionMode, PermissionResult, Query, Settings } from "@anthropic-ai/claude-agent-sdk";
31
+ import type { Logger } from "../acp-agent.js";
32
+ import type { SubagentModels } from "../native-subagents.js";
33
+ import { type SessionModelState } from "../session-model.js";
34
+ import { type ModeAvailability } from "../session-mode.js";
35
+ type ConfigQuery = Pick<Query, "setPermissionMode" | "setModel" | "applyFlagSettings" | "supportedAgents">;
36
+ /** What a session starts with besides its mode and models (see {@link SessionConfig.start}). */
37
+ export interface ConfigSetup {
38
+ /** The `fast_mode_state` and `fast_mode_disabled_reason` of the query's initialization. */
39
+ fastMode: {
40
+ state?: FastModeState;
41
+ disabledReason?: FastModeDisabledReason;
42
+ };
43
+ /** The client's `_meta.claudeCode.options`: its `effort` and `agent`. */
44
+ client: {
45
+ effort?: string;
46
+ agent?: string;
47
+ } | undefined;
48
+ /** The settings that effort resolves from (`mergeEffortSettings`), read at each model switch. */
49
+ effortSettings(): Settings;
50
+ /** The client declared AIR's `recommendedValue` (see the module doc). */
51
+ recommendedValue: boolean;
52
+ }
53
+ export declare class SessionConfig {
54
+ private readonly sessionId;
55
+ /** What Claude Code reports of each model: its descriptions and capabilities. */
56
+ private readonly modelInfos;
57
+ private readonly effortSettings;
58
+ /** The client declared AIR's `recommendedValue` (see the module doc). */
59
+ private readonly recommendedValue;
60
+ /** Sends an update of the session, such as the Auto mode fallback's notice. */
61
+ private readonly notify;
62
+ private readonly logger;
63
+ private readonly session;
64
+ private readonly rules;
65
+ private readonly agents;
66
+ private currentAgent;
67
+ /** Whether the client picked the agent (`session/set_config_option`), which a restart restores. */
68
+ private agentSelected;
69
+ private effort;
70
+ private fastModeEnabled;
71
+ private fastModeDisabledReason;
72
+ private ultracodeEnabled;
73
+ private readonly ultracodeWorkflowsEnabled;
74
+ /** The end of the last change (see the module doc). */
75
+ private changes;
76
+ private constructor();
77
+ /**
78
+ * The config of a session that starts in `mode`, as the v1 core starts one
79
+ * (`ClaudeAcpAgent.createSession`): a mode the model cannot serve falls
80
+ * back, and the fallback's notice goes out with the first prompt. The
81
+ * custom agents are discovered, Fast mode follows the reported state, and
82
+ * ultracode follows Claude Code's `get_settings` report, or the settings
83
+ * without one. The client's `effort` pins the effort when the model offers
84
+ * it.
85
+ */
86
+ static start(sessionId: string, query: ConfigQuery & Query, mode: {
87
+ mode: PermissionMode;
88
+ builtInDefault: boolean;
89
+ } & ModeAvailability, models: SessionModelState, modelInfos: ModelInfo[], currentModelInfo: ModelInfo | undefined, setup: ConfigSetup, notify: (notification: SessionNotification) => void, logger: Logger): Promise<SessionConfig>;
90
+ /** The options, in v2 form. */
91
+ options(): v2.SessionConfigOption[];
92
+ /** The entries of the `model` option, for the `model` of a subagent's session. */
93
+ subagentModels(): SubagentModels;
94
+ /** The current model, and what Claude Code reports of it. */
95
+ currentModel(): {
96
+ id: string;
97
+ info: ModelInfo | undefined;
98
+ };
99
+ availableModeIds(): string[];
100
+ /** The session's modes, for the name of a subagent's mode. */
101
+ availableModes(): SessionModeState["availableModes"];
102
+ /** The mode the session left when it entered plan mode, while it is in plan. */
103
+ prePlanMode(): string | undefined;
104
+ /** A prompt goes out: the notice of a fallback at the session's start goes with the first. */
105
+ promptSent(): Promise<void>;
106
+ /**
107
+ * Sets the value of `params` on the query, and records it once Claude Code
108
+ * took it. The value is checked against the option as the session
109
+ * advertised it (`configOptionValue`): a select takes an `id` of its
110
+ * entries (or a model alias), a boolean takes a boolean.
111
+ */
112
+ set(params: v2.SetSessionConfigOptionRequest): Promise<void>;
113
+ /**
114
+ * Sets the choices of `previous`, the config of the query that this one
115
+ * replaced (see `restarts.ts`), as the v1 core's `restoreSessionChoices`
116
+ * does: the model, then the mode, which the model decides, and its
117
+ * pre-plan mode, then ultracode, Fast mode, the effort pin (after
118
+ * ultracode, which its flag carries) and the agent the client picked. A
119
+ * value the new query refuses is logged.
120
+ */
121
+ restoreFrom(previous: SessionConfig): Promise<void>;
122
+ private serialized;
123
+ private apply;
124
+ /**
125
+ * Sets the mode `requested` on the query, and records it once Claude Code
126
+ * took it: `auto` that the model cannot serve runs as its fallback, with a
127
+ * notice.
128
+ */
129
+ enterMode(requested: PermissionMode): Promise<void>;
130
+ /** The mode that `requested` runs as on the current model (see the module doc). */
131
+ effectiveMode(requested: PermissionMode): PermissionMode;
132
+ private applyMode;
133
+ /** Claude Code switched the mode itself. Returns whether the option changed. */
134
+ modeChanged(mode: PermissionMode): boolean;
135
+ /**
136
+ * Claude Code switched the model without the adapter: a typed `/model`, or
137
+ * a refusal fallback. Returns whether the options changed. A model that the
138
+ * option does not list is recorded by its id, which the option then lists.
139
+ */
140
+ modelSwitched(model: string): Promise<boolean>;
141
+ /**
142
+ * Claude Code reported a Fast mode state (`system`/init, a result). Returns
143
+ * whether the option changed. Without a Fast mode option the model does not
144
+ * support it, and the state says nothing of the user's intent, which stays
145
+ * for a model that does (see `fastModeStateChange`).
146
+ */
147
+ fastModeReported(state: FastModeState | undefined, reason: FastModeDisabledReason | undefined): boolean;
148
+ /**
149
+ * An allowed permission answer, with an `auto` mode that the model cannot
150
+ * serve set as its fallback (see the module doc).
151
+ */
152
+ permissionAllowed(result: PermissionResult): Promise<PermissionResult>;
153
+ /**
154
+ * `null` clears the flag layer back to the standard Claude Code agent. The
155
+ * change takes effect on the next turn. Applied first, so a rejected
156
+ * control request leaves the option as it was.
157
+ */
158
+ private selectAgent;
159
+ /** Applied first, so a rejected control request leaves the option as it was. */
160
+ private setFastMode;
161
+ /**
162
+ * An explicit boolean leaves the effort level alone (`null` would reset the
163
+ * flag layer). Applied first, so a rejected control request leaves the
164
+ * option as it was.
165
+ */
166
+ private setUltracode;
167
+ private refreshFastModeOption;
168
+ private replaceOption;
169
+ private setCurrentValue;
170
+ /**
171
+ * Records the model `value`, as the v1 core does (`applyConfigOptionValue`):
172
+ * an `auto` mode it cannot serve falls back, and the options are rebuilt
173
+ * for it. Effort follows `effortForModelSwitch`; Fast mode and ultracode
174
+ * show only on a model that supports them, with the user's retained
175
+ * choice.
176
+ */
177
+ private recordModel;
178
+ }
179
+ /**
180
+ * The PostModelSwitch hook: a switch of the root's model that the adapter
181
+ * did not make (`source` other than `sdk`, its own `setModel`, and `resume`,
182
+ * which the setup read already) updates the `model` option. A subagent's
183
+ * switch (`agent_id`) is not the session's.
184
+ */
185
+ export declare function modelSwitchHook(switched: (model: string) => void): HookCallbackMatcher;
186
+ export {};
187
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/v2/config.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