@agentclientprotocol/claude-agent-acp 0.94.0 → 0.94.1-preview.10

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 (50) hide show
  1. package/README.md +21 -9
  2. package/dist/acp-agent.d.ts +39 -3
  3. package/dist/acp-agent.d.ts.map +1 -1
  4. package/dist/acp-agent.js +196 -67
  5. package/dist/acp-subagents.d.ts +2 -1
  6. package/dist/acp-subagents.d.ts.map +1 -1
  7. package/dist/air-extension.d.ts +5 -0
  8. package/dist/air-extension.d.ts.map +1 -1
  9. package/dist/air-extension.js +5 -0
  10. package/dist/async-tasks.d.ts +19 -0
  11. package/dist/async-tasks.d.ts.map +1 -1
  12. package/dist/async-tasks.js +52 -0
  13. package/dist/clear-context-coordinator.d.ts +1 -0
  14. package/dist/clear-context-coordinator.d.ts.map +1 -1
  15. package/dist/clear-context-coordinator.js +1 -0
  16. package/dist/index.js +2 -3
  17. package/dist/native-subagents.d.ts +64 -0
  18. package/dist/native-subagents.d.ts.map +1 -1
  19. package/dist/native-subagents.js +224 -9
  20. package/dist/permissions/options/shared.d.ts +3 -0
  21. package/dist/permissions/options/shared.d.ts.map +1 -1
  22. package/dist/permissions/options/tools.js +1 -1
  23. package/dist/serve.d.ts +19 -11
  24. package/dist/serve.d.ts.map +1 -1
  25. package/dist/serve.js +26 -18
  26. package/dist/session-index/activity.d.ts +4 -0
  27. package/dist/session-index/activity.d.ts.map +1 -1
  28. package/dist/session-index/activity.js +16 -0
  29. package/dist/session-index/background-tasks.d.ts +69 -0
  30. package/dist/session-index/background-tasks.d.ts.map +1 -0
  31. package/dist/session-index/background-tasks.js +173 -0
  32. package/dist/session-index/service.d.ts +2 -0
  33. package/dist/session-index/service.d.ts.map +1 -1
  34. package/dist/session-index/service.js +6 -1
  35. package/dist/session-index/session-index.d.ts +14 -0
  36. package/dist/session-index/session-index.d.ts.map +1 -1
  37. package/dist/session-index/session-index.js +25 -2
  38. package/dist/session-index/transcript-scan.d.ts +8 -1
  39. package/dist/session-index/transcript-scan.d.ts.map +1 -1
  40. package/dist/session-index/transcript-scan.js +22 -1
  41. package/dist/session-titles.d.ts +44 -16
  42. package/dist/session-titles.d.ts.map +1 -1
  43. package/dist/session-titles.js +89 -27
  44. package/dist/subagent-replay.d.ts +21 -1
  45. package/dist/subagent-replay.d.ts.map +1 -1
  46. package/dist/subagent-replay.js +51 -3
  47. package/dist/task-notifications.d.ts +30 -0
  48. package/dist/task-notifications.d.ts.map +1 -0
  49. package/dist/task-notifications.js +62 -0
  50. package/package.json +1 -1
package/dist/acp-agent.js CHANGED
@@ -5,7 +5,7 @@ import { promptSuggestionsMeta, promptSuggestionText } from "./prompt-suggestion
5
5
  import { sanitizeTitle, SessionTitles } from "./session-titles.js";
6
6
  import { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY, asSdkSessionNotification, clientSupportsSubagents, subagentForm, } from "./acp-subagents.js";
7
7
  import { isNativeSubagentControlTool, isNativeSubagentControlUpdate, NativeSubagentRuntime, nativeSubagentState, resumedNativeSubagentId, sendMessageResume, sendMessageResumePrompt, } from "./native-subagents.js";
8
- import { AIR_ASYNC_TASKS_CAPABILITY, AIR_CUSTOM_INSTRUCTIONS_CAPABILITY, airCustomInstructions, AIR_DIFF_PATCH_CAPABILITY, AIR_PLAN_FILE_CAPABILITY, AIR_GOAL_KEY, AIR_KIND_KEY, AIR_LOAD_REPLAY_END_CAPABILITY, AIR_LOAD_REPLAY_END_KEY, AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, AIR_SKILL_PATH_KEY, clientSupportsAirCapability, withAirMeta, } from "./air-extension.js";
8
+ import { AIR_ASYNC_TASKS_CAPABILITY, AIR_BACKGROUND_SUBAGENTS_CAPABILITY, AIR_CUSTOM_INSTRUCTIONS_CAPABILITY, airCustomInstructions, AIR_DIFF_PATCH_CAPABILITY, AIR_PLAN_FILE_CAPABILITY, AIR_GOAL_KEY, AIR_KIND_KEY, AIR_LOAD_REPLAY_END_CAPABILITY, AIR_LOAD_REPLAY_END_KEY, AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, AIR_SKILL_PATH_KEY, clientSupportsAirCapability, withAirMeta, } from "./air-extension.js";
9
9
  import * as sessionIndex from "./session-index/connection.js";
10
10
  import { AsyncTaskRuntime, backgroundBashTaskFromToolResult, backgroundedBashToolCallIds, clientSupportsAsyncTasks, } from "./async-tasks.js";
11
11
  import { AUTH_STATUS_PROBE_TIMEOUT_MS, AUTH_STATUS_UPDATE_METHOD, authStatusCapability, fromAccountInfo, fromCliStatus, gatewayAuthStatus, mergeAuthStatus, notLoggedInAuthStatus, sameAuthStatus, } from "./auth-status.js";
@@ -45,6 +45,7 @@ import { messageLoopYielder, nodeToWebReadable, nodeToWebWritable, Pushable, rac
45
45
  import { acceptedPlanToolResult, approvedPlan, ExitPlanCoordinator, isExitPlanInterruptionResult, observeExitPlanToolResults, planModeUpdate, } from "./exit-plan.js";
46
46
  import { DEFAULT_AGENT_ID } from "./session-config-ids.js";
47
47
  import { parseToolResultMeta } from "./tool-result-meta.js";
48
+ import { markerTagText, TASK_NOTIFICATION_TAG, taskNotificationsOf, } from "./task-notifications.js";
48
49
  import { formatUsageResponse, isUsageCommandText, parseUsageResponse } from "./usage-markdown.js";
49
50
  export { DEFAULT_AGENT_ID } from "./session-config-ids.js";
50
51
  import { MCP_AVAILABLE_COMMAND, parseMcpCommand, runMcpCommand } from "./mcp-command.js";
@@ -200,6 +201,16 @@ function parseRemoteControlCommand(prompt) {
200
201
  return { action: "disconnect" };
201
202
  return argument ? { action: "connect", name: argument } : { action: "connect" };
202
203
  }
204
+ /** A top-level message a person typed in another client of the session, such
205
+ * as claude.ai or the Claude mobile app over Remote Control. Tool results and
206
+ * the CLI's own synthetic messages are user-role too, but carry no human
207
+ * origin. */
208
+ function isRemoteHumanMessage(message) {
209
+ return (message.type === "user" &&
210
+ message.origin?.kind === "human" &&
211
+ message.parent_tool_use_id === null &&
212
+ !message.isSynthetic);
213
+ }
203
214
  /** Whether Claude Code offers a slash command of this name to an ACP client.
204
215
  * This is the rule `getAvailableSlashCommands` applies when it lists the
205
216
  * commands, so the adapter stands in for the command exactly when the client
@@ -332,7 +343,8 @@ const UNREPORTED_FOREGROUND = {
332
343
  /** Whether this turn's terminal result arrived but its settlement is being
333
344
  * held for background subagents it spawned (see Turn.deferredSettle). The
334
345
  * single spelling of the hold predicate, shared by the consumer's settle
335
- * lanes and cancel(). */
346
+ * lanes and cancel(). Always false for a client with `backgroundSubagents`,
347
+ * because no turn of that client is held. */
336
348
  function isHeldOpen(turn) {
337
349
  return turn != null && turn.deferredSettle !== undefined && !turn.settled;
338
350
  }
@@ -739,7 +751,6 @@ const LOCAL_COMMAND_MARKERS = [
739
751
  // model that a background task stopped; live, the SDK `task_notification`
740
752
  // frame reports the same stop, so replay restores the task state from it (see
741
753
  // taskNotificationsOf) instead of showing it.
742
- const TASK_NOTIFICATION_TAG = "task-notification";
743
754
  const INJECTED_CONTEXT_MARKERS = ["system-reminder", TASK_NOTIFICATION_TAG].map((tag) => ({
744
755
  open: `<${tag}>`,
745
756
  close: `</${tag}>`,
@@ -773,17 +784,6 @@ function stripMarkerTags(text) {
773
784
  }
774
785
  return result + text.slice(copiedUpTo);
775
786
  }
776
- function markerTagText(text, tag) {
777
- const open = `<${tag}>`;
778
- const close = `</${tag}>`;
779
- const start = text.indexOf(open);
780
- if (start === -1)
781
- return undefined;
782
- const end = text.indexOf(close, start + open.length);
783
- if (end === -1)
784
- return undefined;
785
- return text.slice(start + open.length, end);
786
- }
787
787
  function hasMarkerTag(text, tag) {
788
788
  return markerTagText(text, tag) !== undefined;
789
789
  }
@@ -842,44 +842,6 @@ export function stripLocalCommandMetadata(content) {
842
842
  export function isLocalCommandMetadata(content) {
843
843
  return stripLocalCommandMetadata(content) === null;
844
844
  }
845
- /**
846
- * Returns each `<task-notification>` in user-message content (a string or its
847
- * text blocks). The `<result>` body is model context that the live frame does
848
- * not carry, so the scan stops at it and a tag quoted in it cannot match.
849
- */
850
- function taskNotificationsOf(content) {
851
- const texts = typeof content === "string"
852
- ? [content]
853
- : Array.isArray(content)
854
- ? content.flatMap((block) => block?.type === "text" && typeof block.text === "string" ? [block.text] : [])
855
- : [];
856
- const open = `<${TASK_NOTIFICATION_TAG}>`;
857
- const close = `</${TASK_NOTIFICATION_TAG}>`;
858
- const notifications = [];
859
- for (const text of texts) {
860
- let start = text.indexOf(open);
861
- while (start !== -1) {
862
- const end = text.indexOf(close, start + open.length);
863
- if (end === -1)
864
- break;
865
- const body = text.slice(start + open.length, end).split("<result>", 1)[0];
866
- const field = (tag) => markerTagText(body, tag)?.trim() || undefined;
867
- const taskId = field("task-id");
868
- const status = field("status");
869
- if (taskId && status) {
870
- notifications.push({
871
- task_id: taskId,
872
- status,
873
- tool_use_id: field("tool-use-id"),
874
- summary: field("summary"),
875
- output_file: field("output-file"),
876
- });
877
- }
878
- start = text.indexOf(open, end + close.length);
879
- }
880
- }
881
- return notifications;
882
- }
883
845
  /**
884
846
  * True for a user record that the CLI wrote to tell the model that a
885
847
  * background task stopped. A `subkind` marks the delivery of a prompt, for
@@ -1232,6 +1194,16 @@ export class ClaudeAcpAgent {
1232
1194
  interruptSession: (sessionId) => this.cancelTurns({ sessionId }, { awaitInterrupt: false }),
1233
1195
  teardownSession: (sessionId) => this.teardownSession(sessionId),
1234
1196
  });
1197
+ /**
1198
+ * Whether a turn ends at its result while background subagents that it
1199
+ * spawned or resumed still run. Only an ACP v1 AIR client that declares
1200
+ * `backgroundSubagents` gets this. Every other client keeps the hold of
1201
+ * `Turn.deferredSettle`.
1202
+ */
1203
+ endsTurnsWithLiveSubagents() {
1204
+ return (!this.v2 &&
1205
+ clientSupportsAirCapability(this.clientCapabilities, AIR_BACKGROUND_SUBAGENTS_CAPABILITY));
1206
+ }
1235
1207
  constructor(client, logger, options = {}) {
1236
1208
  this.v2 = options.v2 ?? false;
1237
1209
  this.foregroundEvents = options.foreground;
@@ -1456,7 +1428,9 @@ export class ClaudeAcpAgent {
1456
1428
  // `jetbrains.air`.
1457
1429
  _meta: {
1458
1430
  ...(this.toolCallCapabilities.air.client
1459
- ? withAirMeta(airSessionFailureCapabilityMeta(AGENT_FILE_CHANGE_REPORT_CAPABILITY, AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY, AIR_ASYNC_TASKS_CAPABILITY, AIR_CUSTOM_INSTRUCTIONS_CAPABILITY, AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, AIR_DIFF_PATCH_CAPABILITY, AIR_PLAN_FILE_CAPABILITY, ...this.sessionIndex.capabilities()), AIR_GOAL_KEY, {
1431
+ ? withAirMeta(airSessionFailureCapabilityMeta(AGENT_FILE_CHANGE_REPORT_CAPABILITY, AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY, AIR_ASYNC_TASKS_CAPABILITY, AIR_CUSTOM_INSTRUCTIONS_CAPABILITY, AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, AIR_DIFF_PATCH_CAPABILITY, AIR_PLAN_FILE_CAPABILITY,
1432
+ // ACP v2 keeps the hold (see `src/v2/prompt.ts`).
1433
+ ...(this.v2 ? [] : [AIR_BACKGROUND_SUBAGENTS_CAPABILITY]), ...this.sessionIndex.capabilities()), AIR_GOAL_KEY, {
1460
1434
  version: GOAL_EXTENSION_VERSION,
1461
1435
  controlMethod: GOAL_CONTROL_METHOD,
1462
1436
  actions: [...GOAL_ACTIONS],
@@ -2175,6 +2149,11 @@ export class ClaudeAcpAgent {
2175
2149
  if (session.remoteControlCommand) {
2176
2150
  throw RequestError.invalidRequest(undefined, "Remote Control is already being changed. Try again in a moment.");
2177
2151
  }
2152
+ // Once Remote Control is on, other clients can start turns or send
2153
+ // messages on their own. Something has to read the query stream for
2154
+ // those to reach this client, and a command that answers without a turn
2155
+ // would otherwise leave the stream unread until the next prompt.
2156
+ this.ensureConsumer(session, params.sessionId);
2178
2157
  // Answered by the adapter without a model turn; v2 clients treat an
2179
2158
  // `ended` without a prior `inserted` as a refused prompt.
2180
2159
  events.inserted(randomUUID());
@@ -2271,8 +2250,10 @@ export class ClaudeAcpAgent {
2271
2250
  };
2272
2251
  session.turnQueue ??= [];
2273
2252
  session.turnQueue.push(turn);
2253
+ (session.sentUserUuids ??= new Set()).add(promptUuid);
2274
2254
  session.input.push(userMessage);
2275
2255
  this.ensureConsumer(session, params.sessionId);
2256
+ session.titles.onPromptQueued(session, params.prompt);
2276
2257
  // The prompt is queued, so its turn goes ahead even if the client misses
2277
2258
  // the goal it sets; the turn's events report the outcome.
2278
2259
  await this.publishGoalFromPrompt(params.sessionId, firstText, promptUuid).catch((error) => this.logger.error(`Session ${params.sessionId}: failed to publish the prompt's goal:`, error));
@@ -2660,6 +2641,7 @@ export class ClaudeAcpAgent {
2660
2641
  // The held turn's work had ended at its result; the steer resumes it.
2661
2642
  this.startForeground(sessionId, turnInFlight);
2662
2643
  }
2644
+ (session.sentUserUuids ??= new Set()).add(steeredUuid);
2663
2645
  session.input.push(userMessage);
2664
2646
  const firstText = params.prompt[0]?.type === "text" ? params.prompt[0].text : "";
2665
2647
  await this.publishGoalFromPrompt(sessionId, firstText, steeredUuid);
@@ -2671,7 +2653,19 @@ export class ClaudeAcpAgent {
2671
2653
  if (!session || !asyncTasks?.claimStop(params.asyncTaskId))
2672
2654
  return { stopped: false };
2673
2655
  try {
2674
- await session.query.stopTask(params.asyncTaskId);
2656
+ if (asyncTasks.isAutonomousTurn(params.asyncTaskId)) {
2657
+ // The task stands for a turn that Claude Code started on its own, so
2658
+ // stopping it interrupts that turn. A prompt that waits for its turn
2659
+ // would be folded into it, and the interrupt would drop that prompt.
2660
+ if ((session.turnQueue ?? []).some((turn) => !turn.settled)) {
2661
+ asyncTasks.releaseStop(params.asyncTaskId);
2662
+ return { stopped: false };
2663
+ }
2664
+ await session.query.interrupt();
2665
+ }
2666
+ else {
2667
+ await session.query.stopTask(params.asyncTaskId);
2668
+ }
2675
2669
  await asyncTasks.taskStopped(params.asyncTaskId);
2676
2670
  return { stopped: true };
2677
2671
  }
@@ -2764,10 +2758,29 @@ export class ClaudeAcpAgent {
2764
2758
  // Tool-use blocks start streaming before their JSON input. Keep the
2765
2759
  // partial input per parent message and block index so completed top-level
2766
2760
  // fields can refine the pending tool call while it streams. Entries are
2767
- // dropped at block/message boundaries; the whole map is swept when a turn
2761
+ // dropped at block/message boundaries; the map is swept when a turn
2768
2762
  // settles, since an interrupted subagent stream (keyed by a
2769
2763
  // parent_tool_use_id that never recurs) has no boundary event of its own.
2770
2764
  const streamedToolInputs = new Map();
2765
+ /** Sweeps `streamedToolInputs` when a turn ends. A turn of a client with
2766
+ * `backgroundSubagents` can end while its subagents still stream tool
2767
+ * input, so the sweep keeps the lanes of live subagents, unless the turn
2768
+ * ends cancelled. Their own message boundaries drop them later. */
2769
+ const sweepStreamedToolInputs = (turnStopReason) => {
2770
+ if (turnStopReason === "cancelled" || !this.endsTurnsWithLiveSubagents()) {
2771
+ streamedToolInputs.clear();
2772
+ return;
2773
+ }
2774
+ const liveLanes = new Set();
2775
+ for (const task of session.liveBackgroundTasks.values()) {
2776
+ if (task.isSubagent && task.parentToolUseId)
2777
+ liveLanes.add(task.parentToolUseId);
2778
+ }
2779
+ for (const lane of streamedToolInputs.keys()) {
2780
+ if (!liveLanes.has(lane))
2781
+ streamedToolInputs.delete(lane);
2782
+ }
2783
+ };
2771
2784
  // Stop reason accumulated for the active turn (result subtype, refusal,
2772
2785
  // max_tokens, …). Reset per turn; read when the turn settles at idle.
2773
2786
  let stopReason = "end_turn";
@@ -3162,6 +3175,8 @@ export class ClaudeAcpAgent {
3162
3175
  if (!head) {
3163
3176
  return;
3164
3177
  }
3178
+ if (asyncTasks.autonomousTurnOpen)
3179
+ await asyncTasks.autonomousTurnEnded("completed");
3165
3180
  activateTurn(head);
3166
3181
  };
3167
3182
  /** Result-time bookkeeping that must run whether or not the result can be
@@ -3257,9 +3272,10 @@ export class ClaudeAcpAgent {
3257
3272
  };
3258
3273
  /** Registers a live background task (see `liveBackgroundTasks`). A
3259
3274
  * subagent is also recorded on the active turn, so that turn holds until
3260
- * the subagent settles (see `Turn.spawnedTaskIds`). Its requests may
3261
- * already be open, and where it runs decides whether they block the
3262
- * foreground work, so that is checked again. */
3275
+ * the subagent settles (see `Turn.spawnedTaskIds`). A client with
3276
+ * `backgroundSubagents` gets no hold (see `turnAwaitingSubagents`).
3277
+ * Its requests may already be open, and where it runs decides
3278
+ * whether they block the foreground work, so that is checked again. */
3263
3279
  const registerLiveTask = (taskId, parentToolUseId, isSubagent, placement = {}) => {
3264
3280
  session.liveBackgroundTasks.set(taskId, {
3265
3281
  parentToolUseId,
@@ -3307,8 +3323,9 @@ export class ClaudeAcpAgent {
3307
3323
  };
3308
3324
  /** Registers a settled subagent again when the SDK resumes it without a
3309
3325
  * new `task_started`. The active turn is the one that resumed it, so it
3310
- * holds until the subagent settles again. A repeated resume signal finds
3311
- * the subagent live and changes nothing. */
3326
+ * holds until the subagent settles again, unless the client declared
3327
+ * `backgroundSubagents`. A repeated resume signal finds the subagent live
3328
+ * and changes nothing. */
3312
3329
  const resumeLiveTask = (taskId) => {
3313
3330
  if (session.liveBackgroundTasks.has(taskId))
3314
3331
  return;
@@ -3320,9 +3337,12 @@ export class ClaudeAcpAgent {
3320
3337
  /** Whether any background subagent this turn spawned is still live —
3321
3338
  * while true, the turn's settlement stays deferred so the subagent's
3322
3339
  * output and permission requests land inside it (see
3323
- * Turn.deferredSettle). */
3340
+ * Turn.deferredSettle). Always false for a client that declared
3341
+ * `backgroundSubagents`: its turns end at their result, and the subagent
3342
+ * traffic goes out after the prompt response. This is the single gate of
3343
+ * the hold, so no turn of such a client is ever held open. */
3324
3344
  const turnAwaitingSubagents = (turn) => {
3325
- if (!turn.spawnedTaskIds?.size) {
3345
+ if (this.endsTurnsWithLiveSubagents() || !turn.spawnedTaskIds?.size) {
3326
3346
  return false;
3327
3347
  }
3328
3348
  for (const taskId of turn.spawnedTaskIds) {
@@ -3353,7 +3373,8 @@ export class ClaudeAcpAgent {
3353
3373
  * turn open (see Turn.deferredSettle). Every result-time settle of a
3354
3374
  * turn that can have spawned subagents must route through here: a site
3355
3375
  * calling settleActive directly bypasses the hold and re-opens the
3356
- * out-of-turn permission deadlock (issue #866) through its lane. */
3376
+ * out-of-turn permission deadlock (issue #866) through its lane. For a
3377
+ * client with `backgroundSubagents` this always settles now. */
3357
3378
  const settleOrDefer = async (outcome) => {
3358
3379
  // No result ends a steered turn: the steer aborted the cycle this result
3359
3380
  // may belong to, and the steered one is still to come. Record the outcome
@@ -3632,7 +3653,7 @@ export class ClaudeAcpAgent {
3632
3653
  disarmForceCancel(session);
3633
3654
  session.turnQueue = (session.turnQueue ?? []).filter((t) => t !== turn);
3634
3655
  session.activeTurn = null;
3635
- streamedToolInputs.clear();
3656
+ sweepStreamedToolInputs(result.stopReason);
3636
3657
  if (wasHeld) {
3637
3658
  // Settling a held turn is its delivery-stretch boundary: the turn's
3638
3659
  // answer finished long ago, so text streamed since the last boundary
@@ -3663,7 +3684,7 @@ export class ClaudeAcpAgent {
3663
3684
  turn.settled = true;
3664
3685
  session.turnQueue = (session.turnQueue ?? []).filter((t) => t !== turn);
3665
3686
  session.activeTurn = null;
3666
- streamedToolInputs.clear();
3687
+ sweepStreamedToolInputs();
3667
3688
  // A failed turn's stretch is over, and some failure lanes (the issue
3668
3689
  // #825 idle-fail) never see the result whose `finally` would close it —
3669
3690
  // start the next stretch clean, or its stale delivery record would
@@ -4039,6 +4060,18 @@ export class ClaudeAcpAgent {
4039
4060
  continue;
4040
4061
  }
4041
4062
  this.startAutonomousCycle(params.sessionId, session, message);
4063
+ // From CLI 2.1.270 the state stays `running` while background agents
4064
+ // run, so a turn that their notification starts has no `running`
4065
+ // transition. Its first output with no prompt open starts its task.
4066
+ if (asyncTasks.enabled &&
4067
+ !asyncTasks.autonomousTurnOpen &&
4068
+ (message.type === "assistant" || message.type === "stream_event") &&
4069
+ message.parent_tool_use_id === null &&
4070
+ !session.cancelled &&
4071
+ !session.activeTurn &&
4072
+ !firstUnsettledQueuedTurn()) {
4073
+ await asyncTasks.autonomousTurnStarted();
4074
+ }
4042
4075
  switch (message.type) {
4043
4076
  case "system":
4044
4077
  switch (message.subtype) {
@@ -4178,6 +4211,19 @@ export class ClaudeAcpAgent {
4178
4211
  if (message.state === "running")
4179
4212
  this.sessionIndex.onTurnStarted(params.sessionId);
4180
4213
  this.sessionIndex.onOwnSessionChanged(params.sessionId);
4214
+ // With no prompt active or queued, the agent runs a turn of
4215
+ // its own, for example for a task notification. The client
4216
+ // sees it as an async task (see autonomousTurnStarted).
4217
+ if (asyncTasks.enabled &&
4218
+ message.state === "running" &&
4219
+ previousState !== "running" &&
4220
+ !session.activeTurn &&
4221
+ !firstUnsettledQueuedTurn()) {
4222
+ await asyncTasks.autonomousTurnStarted();
4223
+ }
4224
+ else if (message.state === "idle" && asyncTasks.autonomousTurnOpen) {
4225
+ await asyncTasks.autonomousTurnEnded("completed");
4226
+ }
4181
4227
  if (message.state === "running" &&
4182
4228
  previousState !== "running" &&
4183
4229
  session.owedTrailingIdles > 0) {
@@ -4819,6 +4865,13 @@ export class ClaudeAcpAgent {
4819
4865
  // ran, so its result answers the prompt (see answersPendingPrompt).
4820
4866
  const startedByClaudeCode = message.origin != null && AUTONOMOUS_RESULT_ORIGINS.has(message.origin.kind);
4821
4867
  const isAutonomousResult = startedByClaudeCode && !answersPendingPrompt(message);
4868
+ // A placeholder result (`num_turns: 0`, see below) comes before
4869
+ // the followup that answers it, so the autonomous turn goes on.
4870
+ if (isAutonomousResult &&
4871
+ asyncTasks.autonomousTurnOpen &&
4872
+ (message.num_turns > 0 || message.is_error)) {
4873
+ await asyncTasks.autonomousTurnEnded(message.is_error ? "failed" : "completed");
4874
+ }
4822
4875
  const pendingExitPlanModeInterruption = session.pendingExitPlanModeInterruption;
4823
4876
  const pendingExitPlanContextReset = session.pendingExitPlanContextReset;
4824
4877
  try {
@@ -5107,6 +5160,33 @@ export class ClaudeAcpAgent {
5107
5160
  await settleOrDefer({ ...heldTurn.deferredSettle, stopReason: "cancelled" });
5108
5161
  break;
5109
5162
  }
5163
+ // The same followup with no held turn: the client declared
5164
+ // `backgroundSubagents`, or the hold already ended. A user
5165
+ // turn that took the cycle over owns the request (see
5166
+ // `requestOwnerTurn`), so it continues the accepted plan in a
5167
+ // fresh context, as the user lane does. With no such turn
5168
+ // the user answered out of a turn, and the interrupt only
5169
+ // stops this autonomous cycle. Drop the markers, so that a
5170
+ // later user-turn result is not read as this interruption.
5171
+ // `canUseTool` offers no clear-context option to a request
5172
+ // without an owner turn, so a reset here is only a race with
5173
+ // the end of a turn.
5174
+ if (pendingExitPlanModeInterruption &&
5175
+ isExitPlanInterruptionResult(message, pendingExitPlanModeInterruption)) {
5176
+ session.pendingExitPlanModeInterruption = undefined;
5177
+ const ownerTurn = this.requestOwnerTurn(params.sessionId, session);
5178
+ if (pendingExitPlanContextReset?.toolUseId ===
5179
+ pendingExitPlanModeInterruption.toolUseId &&
5180
+ ownerTurn !== undefined &&
5181
+ ownerTurn === session.activeTurn) {
5182
+ await this.exitPlan.restart(params.sessionId, session, pendingExitPlanContextReset);
5183
+ return;
5184
+ }
5185
+ if (pendingExitPlanContextReset) {
5186
+ session.pendingExitPlanContextReset = undefined;
5187
+ this.logger.error(`Session ${params.sessionId}: no turn to continue the accepted plan in a fresh context`);
5188
+ }
5189
+ }
5110
5190
  // CLI 2.1.274+ answers background-task completions that were
5111
5191
  // already queued with ONE model call: every queued
5112
5192
  // notification still gets its own result, but all except the
@@ -5360,7 +5440,9 @@ export class ClaudeAcpAgent {
5360
5440
  // permission requests, and the model's promised summary all land
5361
5441
  // inside the turn. `session/cancel` and the next prompt's echo
5362
5442
  // hand-off still settle a deferred turn early, so a long-running
5363
- // subagent never holds the prompt hostage.
5443
+ // subagent never holds the prompt hostage. A client with
5444
+ // `backgroundSubagents` gets no hold: the turn settles here, and
5445
+ // the subagent traffic goes out after the prompt response.
5364
5446
  //
5365
5447
  // is_error/auth already settled via failActive (activeTurn is null
5366
5448
  // then, so both branches no-op); a cancelled turn settles at
@@ -5609,6 +5691,9 @@ export class ClaudeAcpAgent {
5609
5691
  if (session.pendingGoalUpdate?.commandUuid === message.uuid) {
5610
5692
  session.pendingGoalUpdate.started = true;
5611
5693
  }
5694
+ // Taken out for every echo, not only in the branch below, so the
5695
+ // set does not grow with each prompt.
5696
+ const sentByAdapter = session.sentUserUuids?.delete(message.uuid) ?? false;
5612
5697
  const queued = findUnsettledTurn(message.uuid);
5613
5698
  if (queued) {
5614
5699
  // Only (re)activate if this isn't already the active turn — a
@@ -5675,6 +5760,10 @@ export class ClaudeAcpAgent {
5675
5760
  // mid-message, so deltas already streamed belong to the turn
5676
5761
  // being activated — clearing would forget them and let its
5677
5762
  // result re-emit the answer.
5763
+ // A prompt folded into an autonomous turn owns that turn now.
5764
+ if (asyncTasks.autonomousTurnOpen) {
5765
+ await asyncTasks.autonomousTurnEnded("completed");
5766
+ }
5678
5767
  activateTurn(queued);
5679
5768
  }
5680
5769
  break;
@@ -5690,7 +5779,25 @@ export class ClaudeAcpAgent {
5690
5779
  session.activeTurn.steeredEchoes.delete(message.uuid)) {
5691
5780
  session.activeTurn.steeredAwaitingResult = true;
5692
5781
  }
5693
- // Unrelated replay (e.g. the echo of an already-settled turn).
5782
+ // A message typed in another client of the session (Remote
5783
+ // Control from claude.ai or the mobile app). The adapter's own
5784
+ // prompts and steers are stamped human too, so they are told
5785
+ // apart by uuid: a steer matches no turn, and a turn can settle
5786
+ // before its echo comes.
5787
+ const remoteContent = !sentByAdapter && isRemoteHumanMessage(message)
5788
+ ? stripLocalCommandMetadata(message.message.content)
5789
+ : null;
5790
+ if (remoteContent !== null) {
5791
+ for (const notification of toAcpNotifications(remoteContent, "user", params.sessionId, session.toolUseCache, routedNotificationClient, this.logger, {
5792
+ clientCapabilities: this.clientCapabilities,
5793
+ toolCallCapabilities: this.toolCallCapabilities,
5794
+ cwd: session.cwd,
5795
+ messageId: messageIdForGrouping(message),
5796
+ })) {
5797
+ await sendUpdate(notification);
5798
+ }
5799
+ }
5800
+ // Otherwise an unrelated replay (e.g. the echo of an already-settled turn).
5694
5801
  break;
5695
5802
  }
5696
5803
  }
@@ -7069,6 +7176,8 @@ export class ClaudeAcpAgent {
7069
7176
  isNativeSubagentControlTool(toolName)) {
7070
7177
  continue;
7071
7178
  }
7179
+ if (rfdReplay && (await rfdReplay.toolCallUpdate(notification.update, child)))
7180
+ continue;
7072
7181
  await this.client.sessionUpdate({ ...notification, sessionId: replayTargetSessionId });
7073
7182
  }
7074
7183
  // The history of each subagent is in its own transcript. The replay
@@ -7360,6 +7469,21 @@ export class ClaudeAcpAgent {
7360
7469
  runsAutonomousCycle(sessionId) {
7361
7470
  return this.foregroundWork.get(sessionId)?.owner === AUTONOMOUS_CYCLE;
7362
7471
  }
7472
+ /** The ACP turn that owns a root request of the session now, if any. A
7473
+ * model cycle that Claude Code started on its own owns no turn. A turn that
7474
+ * took a cycle over owns it. A queued turn owns the request too, because
7475
+ * Claude Code can ask for a queued prompt before the consumer reaches its
7476
+ * echo (see `recordForegroundToolCall`). The ExitPlanMode request and the
7477
+ * result of its interruption use this one rule, so an offered
7478
+ * clear-context option always has a turn to continue. */
7479
+ requestOwnerTurn(sessionId, session) {
7480
+ if (this.runsAutonomousCycle(sessionId))
7481
+ return undefined;
7482
+ const active = session.activeTurn;
7483
+ if (active && !active.settled)
7484
+ return active;
7485
+ return session.turnQueue?.find((queued) => !queued.settled);
7486
+ }
7363
7487
  /** Forward a permission request to the client, wiring the tool call's
7364
7488
  * `signal` through as a `cancellationSignal`. When the turn is cancelled
7365
7489
  * while the client's prompt is still open the signal aborts, the SDK sends
@@ -7644,6 +7768,11 @@ export class ClaudeAcpAgent {
7644
7768
  defaultToNo,
7645
7769
  availableModes: this.sessionModes.availableModeIds(session.modes),
7646
7770
  prePlanMode: session.prePlanMode,
7771
+ // A fresh context continues the ACP turn that owns the request. With
7772
+ // `backgroundSubagents` a followup cycle can ask out of a turn, and
7773
+ // then there is no turn to continue.
7774
+ allowContextReset: !this.endsTurnsWithLiveSubagents() ||
7775
+ this.requestOwnerTurn(sessionId, session) !== undefined,
7647
7776
  contextUsedPercent: session.contextUsedTokens === undefined || session.contextWindowSize <= 0
7648
7777
  ? undefined
7649
7778
  : Math.max(0, Math.min(100, Math.round((session.contextUsedTokens / session.contextWindowSize) * 100))),
@@ -6,7 +6,8 @@ export { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY } from "./air-extension.js";
6
6
  * - `rfd`: the subagents RFD (agentclientprotocol/agent-client-protocol#1992,
7
7
  * as revised): `subagent_update` and `session_message`, which the SDK types.
8
8
  * A client that declares `clientCapabilities.subagents` and is not AIR gets
9
- * it. (ACP v2 clients do not get subagents yet.)
9
+ * it. (An ACP v2 client gets it without declaring anything, since subagents
10
+ * are part of v2's baseline.)
10
11
  * - `air`: the earlier draft of that RFD, which AIR implements:
11
12
  * `subagent_spawned` and `subagent_state_update`, typed below. AIR gets it,
12
13
  * whichever capability it declares (`docs/air-extensions.md`).
@@ -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,mCAAmC,CAAC;AAO3C,OAAO,EAAE,uCAAuC,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,CAAC;AAEzC,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,YAAY,GAAG,SAAS,CAG/F;AAED;;;GAGG;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,GA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yB,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,EAAE,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,10 @@
1
1
  export declare const AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY = "nativeSubagentSessions";
2
2
  export declare const AIR_ASYNC_TASKS_CAPABILITY = "asyncTasks";
3
+ /**
4
+ * A prompt turn ends at its result also while its background subagents run.
5
+ * The subagent updates and requests then go out after the prompt response.
6
+ */
7
+ export declare const AIR_BACKGROUND_SUBAGENTS_CAPABILITY = "backgroundSubagents";
3
8
  export declare const AIR_SESSION_FAILURE_CAPABILITY = "sessionFailure";
4
9
  export declare const AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY = "recommendedValue";
5
10
  export declare const AIR_CUSTOM_INSTRUCTIONS_CAPABILITY = "customInstructions";
@@ -1 +1 @@
1
- {"version":3,"file":"air-extension.d.ts","sourceRoot":"","sources":["../src/air-extension.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,2BAA2B,CAAC;AAChF,eAAO,MAAM,0BAA0B,eAAe,CAAC;AACvD,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D,eAAO,MAAM,uCAAuC,qBAAqB,CAAC;AAC1E,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,yBAAyB,cAAc,CAAC;AACrD,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,sBAAsB,CAAC;AACtE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,aAAa,CAAC;AACnD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,yBAAyB,CAAC;AAC5E;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,qBAAqB,CAAC;AACnE;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,kBAAkB,CAAC;AAE9D,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AACpD,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,eAAO,MAAM,aAAa,UAAU,CAAC;AACrC,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAC9D,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAC9C,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAC/C,eAAO,MAA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,GAAG,YAAY,EAAE,MAAM,EAAE,2BAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAChD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAE1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAErC;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAKnF;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAY9F;AAED,4DAA4D;AAC5D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAIvE"}
@@ -1,5 +1,10 @@
1
1
  export const AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY = "nativeSubagentSessions";
2
2
  export const AIR_ASYNC_TASKS_CAPABILITY = "asyncTasks";
3
+ /**
4
+ * A prompt turn ends at its result also while its background subagents run.
5
+ * The subagent updates and requests then go out after the prompt response.
6
+ */
7
+ export const AIR_BACKGROUND_SUBAGENTS_CAPABILITY = "backgroundSubagents";
3
8
  export const AIR_SESSION_FAILURE_CAPABILITY = "sessionFailure";
4
9
  export const AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY = "recommendedValue";
5
10
  export const AIR_CUSTOM_INSTRUCTIONS_CAPABILITY = "customInstructions";
@@ -86,6 +86,10 @@ export declare class AsyncTaskRuntime {
86
86
  * The oldest entries are dropped.
87
87
  */
88
88
  private readonly outputPathsByToolCall;
89
+ /** The task of the autonomous turn that runs now. */
90
+ private autonomousTurn?;
91
+ /** The summary of the last task notification, which usually starts the next autonomous turn. */
92
+ private lastNotificationSummary?;
89
93
  constructor(enabled: boolean, sessionId: string, publish: Publish,
90
94
  /** `notices`: the client can present `notice` updates, so the stop
91
95
  * acknowledgement need not be a transcript line. `routeOf`: the route of
@@ -119,6 +123,21 @@ export declare class AsyncTaskRuntime {
119
123
  claimStop(taskId: string): boolean;
120
124
  releaseStop(taskId: string): void;
121
125
  taskStopped(taskId: string): Promise<void>;
126
+ /**
127
+ * Publishes a model turn that Claude Code started with no prompt open, for
128
+ * example to answer a task notification. ACP v1 has no session state, and
129
+ * the client already got the stop reason of its last prompt, so this task is
130
+ * the only sign that the agent works. The tool calls of the turn are in the
131
+ * transcript already, so the task is not shown there. Does nothing while
132
+ * such a task is open.
133
+ */
134
+ autonomousTurnStarted(): Promise<void>;
135
+ /** Whether the task of an autonomous turn is open. */
136
+ get autonomousTurnOpen(): boolean;
137
+ /** Ends the task of the autonomous turn that runs now, if there is one. */
138
+ autonomousTurnEnded(state: "completed" | "failed"): Promise<void>;
139
+ /** Whether the task stands for an autonomous turn, which a stop interrupts. */
140
+ isAutonomousTurn(taskId: string): boolean;
122
141
  /** Whether a task of the tool call went to the background, so the client gets it. */
123
142
  isBackgroundedToolCall(toolCallId: string): boolean;
124
143
  /**
@@ -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,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,oBAAoB,C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