@agentclientprotocol/claude-agent-acp 0.89.2-preview.4 → 0.89.2-preview.6

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.
@@ -1,5 +1,5 @@
1
1
  import { AgentApp, AuthenticateRequest, AvailableCommand, CancelNotification, ClientCapabilities, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, DisableProviderRequest, DisableProviderResponse, ForkSessionRequest, ForkSessionResponse, InitializeRequest, InitializeResponse, ListProvidersRequest, ListProvidersResponse, LlmProtocol, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, LogoutRequest, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, ReadTextFileRequest, ReadTextFileResponse, SetProviderRequest, SetProviderResponse, RequestPermissionResponse, ResumeSessionRequest, ResumeSessionResponse, SessionConfigOption, SessionModeState, SessionNotification, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModeRequest, SetSessionModeResponse, CloseSessionRequest, CloseSessionResponse, DeleteSessionRequest, DeleteSessionResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
2
- import type { TurnEvents, TurnOutcome } from "./turn-events.js";
2
+ import type { ForegroundEvents, TurnEvents, TurnOutcome } from "./turn-events.js";
3
3
  import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage, Settings } from "@anthropic-ai/claude-agent-sdk";
4
4
  import { GoalRequest, GoalControlResponse, GoalSnapshot } from "./goal-extension.js";
5
5
  import { SessionTitles } from "./session-titles.js";
@@ -104,15 +104,12 @@ type Turn = {
104
104
  * consumer can match the replayed user message to this turn. It is also the
105
105
  * id of the user message the turn reports as inserted. */
106
106
  promptUuid: string;
107
- /** Where the turn reports how it progresses (see {@link TurnEvents}). */
107
+ /** Where the turn reports how its prompt is answered (see {@link TurnEvents}). */
108
108
  events: TurnEvents;
109
109
  /** Set once `events.inserted` has been reported. A clear-context restart
110
110
  * activates the same turn again in the fresh session, which must not report
111
111
  * it twice. */
112
112
  insertedReported?: boolean;
113
- /** Whether the turn last reported that it awaits the user, so that
114
- * `syncAwaitingUser` reports only changes. */
115
- awaitingUser?: boolean;
116
113
  /** Tools surfaced during this turn, awaiting completion or an explicit
117
114
  * background handoff. Intersect with emittedToolCalls at settlement so
118
115
  * tool_result counts even when a presentation hook is still pending. */
@@ -943,10 +940,26 @@ export declare class ClaudeAcpAgent {
943
940
  * express: see {@link ToolCallClientCapabilities.v2}.
944
941
  */
945
942
  private readonly v2;
943
+ /** See the `foreground` constructor option. */
944
+ private readonly foregroundEvents?;
945
+ /**
946
+ * The foreground work of each session while it runs, by the session id that
947
+ * the client knows. A clear-context restart replaces the Claude Code session
948
+ * behind that id and moves the running turn to it, so the work belongs to the
949
+ * id, not to a {@link Session}.
950
+ */
951
+ private readonly foregroundWork;
946
952
  /** The session index (docs/air-extensions.md, "Session index"). */
947
953
  private readonly sessionIndex;
948
954
  constructor(client: AcpClient, logger?: Logger, options?: {
949
955
  v2?: boolean;
956
+ /**
957
+ * Where the agent reports a session's foreground work (see
958
+ * {@link ForegroundEvents}), called each time work starts in the session
959
+ * `sessionId`. Without it, nothing reports the work: a v1 client has no
960
+ * session state, and learns that a turn ended from its prompt response.
961
+ */
962
+ foreground?: (sessionId: string) => ForegroundEvents;
950
963
  });
951
964
  initialize(request: InitializeRequest): Promise<InitializeResponse>;
952
965
  newSession(params: NewSessionRequest): Promise<NewSessionResponse>;
@@ -1290,16 +1303,36 @@ export declare class ClaudeAcpAgent {
1290
1303
  /** Mark a client request as blocking on user input for exactly the lifetime
1291
1304
  * of its promise. Steering consults this session-local count synchronously,
1292
1305
  * so a message arriving while any permission/elicitation card is open uses
1293
- * non-interrupting SDK delivery. The active turn reports that it awaits the
1294
- * user while any such request is open (see `syncAwaitingUser`). */
1306
+ * non-interrupting SDK delivery. The session's foreground work reports that
1307
+ * it awaits the user while any such request is open (see
1308
+ * `syncAwaitingUser`). */
1295
1309
  private withPendingUserInput;
1296
- /** Report whether the session's active turn awaits the user: exactly while
1297
- * a permission request or question is open in the session. A request does
1298
- * not say which prompt it is for, and Claude Code can ask for a queued
1310
+ /** Report whether the session's foreground work awaits the user: exactly
1311
+ * while a permission request or question is open in the session. A request
1312
+ * does not say which prompt it is for, and Claude Code can ask for a queued
1299
1313
  * prompt before the consumer activates it, so a request is not tied to the
1300
- * turn that was active when it opened. Called when the count changes and
1314
+ * work that was running when it opened. Called when the count changes and
1301
1315
  * when a turn activates. */
1302
1316
  private syncAwaitingUser;
1317
+ /** Make `owner` the foreground work of the session `sessionId` (see
1318
+ * {@link ForegroundEvents}): it reports `running`, then waits at once if a
1319
+ * request is open. If work already runs, it goes on under `owner` and
1320
+ * reports nothing new: a turn takes over a cycle that Claude Code started on
1321
+ * its own, and only the owner's end ends the work. */
1322
+ private startForeground;
1323
+ /** End the foreground work of the session `sessionId` with `outcome`, or as
1324
+ * failed with `error`, if `owner` is that work. */
1325
+ private endForeground;
1326
+ /** Start a model cycle that Claude Code started on its own as the foreground
1327
+ * work (see {@link ForegroundEvents}) when `message` is its first output:
1328
+ * model output of the main conversation (not a subagent's) while no work
1329
+ * runs. That includes a turn that v1 holds for its background subagents,
1330
+ * whose work ended at its result, so its follow-up is a cycle. Output after
1331
+ * a cancel is dropped, so it starts nothing. */
1332
+ private startAutonomousCycle;
1333
+ /** End the session's model cycle that Claude Code started on its own, if one
1334
+ * runs. */
1335
+ private endAutonomousCycle;
1303
1336
  /** Forward a permission request to the client, wiring the tool call's
1304
1337
  * `signal` through as a `cancellationSignal`. When the turn is cancelled
1305
1338
  * while the client's prompt is still open the signal aborts, the SDK sends
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,mBAAmB,EAEnB,gBAAgB,EAChB,kBAA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AC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAsHvB;AAED;;;;;;;;;;;oEAWoE;AACpE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAC3D,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,QAAQ,CA0CV;AAED,8BAA8B;AAC9B,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;;;EAMrC"}
package/dist/acp-agent.js CHANGED
@@ -280,6 +280,10 @@ const AUTONOMOUS_RESULT_ORIGINS = new Set([
280
280
  "observer",
281
281
  "observer-activity",
282
282
  ]);
283
+ /** The foreground work of a session (see ForegroundEvents): a prompt's turn,
284
+ * or a model cycle that Claude Code started on its own. At most one cycle
285
+ * runs at a time, so a constant names it. */
286
+ const AUTONOMOUS_CYCLE = "autonomous-cycle";
283
287
  /** Whether this turn's terminal result arrived but its settlement is being
284
288
  * held for background subagents it spawned (see Turn.deferredSettle). The
285
289
  * single spelling of the hold predicate, shared by the consumer's settle
@@ -1194,6 +1198,15 @@ export class ClaudeAcpAgent {
1194
1198
  * express: see {@link ToolCallClientCapabilities.v2}.
1195
1199
  */
1196
1200
  v2;
1201
+ /** See the `foreground` constructor option. */
1202
+ foregroundEvents;
1203
+ /**
1204
+ * The foreground work of each session while it runs, by the session id that
1205
+ * the client knows. A clear-context restart replaces the Claude Code session
1206
+ * behind that id and moves the running turn to it, so the work belongs to the
1207
+ * id, not to a {@link Session}.
1208
+ */
1209
+ foregroundWork = new Map();
1197
1210
  /** The session index (docs/air-extensions.md, "Session index"). */
1198
1211
  sessionIndex = new sessionIndex.SessionIndexConnection({
1199
1212
  agent: this,
@@ -1203,6 +1216,7 @@ export class ClaudeAcpAgent {
1203
1216
  });
1204
1217
  constructor(client, logger, options = {}) {
1205
1218
  this.v2 = options.v2 ?? false;
1219
+ this.foregroundEvents = options.foreground;
1206
1220
  this.sessions = {};
1207
1221
  this.client = new ChangedMetaClient(client, () => this.toolCallCapabilities.air.client);
1208
1222
  this.logger = logger ?? console;
@@ -1987,13 +2001,7 @@ export class ClaudeAcpAgent {
1987
2001
  async prompt(params) {
1988
2002
  let events;
1989
2003
  const outcome = new Promise((resolve, reject) => {
1990
- events = {
1991
- inserted() { },
1992
- awaitingUser() { },
1993
- resumed() { },
1994
- ended: resolve,
1995
- failed: reject,
1996
- };
2004
+ events = { inserted() { }, ended: resolve, failed: reject };
1997
2005
  });
1998
2006
  await this.startTurn(params, events);
1999
2007
  return outcome;
@@ -2066,10 +2074,12 @@ export class ClaudeAcpAgent {
2066
2074
  completeTurn = resolve;
2067
2075
  }),
2068
2076
  resolve: (outcome) => {
2077
+ this.endForeground(params.sessionId, turn, { outcome });
2069
2078
  events.ended(outcome);
2070
2079
  completeTurn();
2071
2080
  },
2072
2081
  reject: (error) => {
2082
+ this.endForeground(params.sessionId, turn, { error });
2073
2083
  events.failed(error);
2074
2084
  completeTurn();
2075
2085
  },
@@ -2400,6 +2410,8 @@ export class ClaudeAcpAgent {
2400
2410
  if (turnInFlight.deferredSettle !== undefined) {
2401
2411
  turnInFlight.steeredSettle = turnInFlight.deferredSettle;
2402
2412
  turnInFlight.deferredSettle = undefined;
2413
+ // The held turn's work had ended at its result; the steer resumes it.
2414
+ this.startForeground(sessionId, turnInFlight);
2403
2415
  }
2404
2416
  session.input.push(userMessage);
2405
2417
  const firstText = params.prompt[0]?.type === "text" ? params.prompt[0].text : "";
@@ -2742,7 +2754,7 @@ export class ClaudeAcpAgent {
2742
2754
  reportInserted(turn);
2743
2755
  // A request can already be open: Claude Code asks for a queued prompt
2744
2756
  // before the consumer reaches its echo.
2745
- this.syncAwaitingUser(session);
2757
+ this.syncAwaitingUser(params.sessionId, session);
2746
2758
  };
2747
2759
  /** Report that Claude Code took the turn's prompt in, once. A turn can be
2748
2760
  * settled by now: an echo hand-off awaits settling the previous turn, and
@@ -2752,6 +2764,7 @@ export class ClaudeAcpAgent {
2752
2764
  return;
2753
2765
  turn.insertedReported = true;
2754
2766
  turn.events.inserted(turn.promptUuid);
2767
+ this.startForeground(params.sessionId, turn);
2755
2768
  };
2756
2769
  /** Ensure there is an active turn before a user-turn result that carries no
2757
2770
  * echo to activate it, by promoting the queue head. Most turns are
@@ -3044,6 +3057,8 @@ export class ClaudeAcpAgent {
3044
3057
  !session.activeTurn.settled &&
3045
3058
  turnAwaitingSubagents(session.activeTurn)) {
3046
3059
  session.activeTurn.deferredSettle = outcome;
3060
+ // The hold delays v1's answer; the turn's work ended at its result.
3061
+ this.endForeground(params.sessionId, session.activeTurn, { outcome });
3047
3062
  }
3048
3063
  else {
3049
3064
  await settleActive(outcome);
@@ -3220,6 +3235,7 @@ export class ClaudeAcpAgent {
3220
3235
  /** Reject every in-flight turn — used when the stream dies. */
3221
3236
  const failAllTurns = (error) => {
3222
3237
  disarmForceCancel(session);
3238
+ this.endAutonomousCycle(params.sessionId, { error });
3223
3239
  const turns = session.activeTurn
3224
3240
  ? [session.activeTurn, ...(session.turnQueue ?? []).filter((t) => t !== session.activeTurn)]
3225
3241
  : [...(session.turnQueue ?? [])];
@@ -3386,6 +3402,9 @@ export class ClaudeAcpAgent {
3386
3402
  // it), but the stored one is the authoritative source.
3387
3403
  const inFlight = session.activeTurn;
3388
3404
  await finishLifecycle(session.cancelled ? "cancelled" : "failed", session.cancelled ? "stopped" : "failed", "at end of stream");
3405
+ this.endAutonomousCycle(params.sessionId, session.cancelled
3406
+ ? { outcome: { stopReason: "cancelled" } }
3407
+ : { error: RequestError.internalError(undefined, SESSION_ENDED_MESSAGE) });
3389
3408
  await settleActive(session.cancelled
3390
3409
  ? cancelledOutcome(session, inFlight)
3391
3410
  : (inFlight?.deferredSettle ?? turnOutcome(session, stopReason)));
@@ -3528,6 +3547,7 @@ export class ClaudeAcpAgent {
3528
3547
  await this.publishRuntimeGoal(params.sessionId, toGoalSnapshot(activeGoal));
3529
3548
  continue;
3530
3549
  }
3550
+ this.startAutonomousCycle(params.sessionId, session, message);
3531
3551
  switch (message.type) {
3532
3552
  case "system":
3533
3553
  switch (message.subtype) {
@@ -3665,6 +3685,17 @@ export class ClaudeAcpAgent {
3665
3685
  session.owedTrailingIdles = 0;
3666
3686
  }
3667
3687
  if (message.state === "idle") {
3688
+ // A model cycle that Claude Code started on its own normally
3689
+ // ends at its result. An idle that no earlier result owes
3690
+ // means that result will not come (the stream dropped
3691
+ // mid-cycle, as for a turn in issue #825), so the cycle ends
3692
+ // here. An owed idle belongs to an earlier result: it can lag
3693
+ // past the cycle's first output.
3694
+ if (session.owedTrailingIdles === 0) {
3695
+ this.endAutonomousCycle(params.sessionId, {
3696
+ outcome: { stopReason: session.cancelled ? "cancelled" : "end_turn" },
3697
+ });
3698
+ }
3668
3699
  // A non-cancelled turn normally settled at its terminal
3669
3700
  // `result` already (issue #773), and that result recorded an
3670
3701
  // owed trailing idle — absorbed here via the decrement. We
@@ -3746,8 +3777,11 @@ export class ClaudeAcpAgent {
3746
3777
  // Via the subagent gate, not settleActive: a steered turn
3747
3778
  // can also have spawned background subagents, which own it
3748
3779
  // from here (settles now if none is live, holds otherwise).
3780
+ const outcome = session.activeTurn.steeredSettle;
3749
3781
  const steered = session.activeTurn;
3750
- steered.deferredSettle = steered.steeredSettle;
3782
+ steered.deferredSettle = outcome;
3783
+ // A hold delays v1's answer; the turn's work ends here.
3784
+ this.endForeground(params.sessionId, steered, { outcome });
3751
3785
  leaveSteerLane(steered);
3752
3786
  await settleDeferredIfDrained();
3753
3787
  }
@@ -4443,6 +4477,26 @@ export class ClaudeAcpAgent {
4443
4477
  }),
4444
4478
  });
4445
4479
  }
4480
+ // A model cycle that Claude Code started on its own ends at its
4481
+ // result, after its usage, also after a cancel. A turn that
4482
+ // Claude Code takes in takes the cycle over, so a cycle that
4483
+ // still runs owns this result, whatever its origin says. A
4484
+ // placeholder result (`num_turns: 0`, see the autonomous lane
4485
+ // below) comes before the shared followup runs, so it ends
4486
+ // nothing. The diagnostic of an ExitPlanMode answer that
4487
+ // interrupted the cycle ends it `cancelled`, as it ends a turn,
4488
+ // unless a held turn continues the accepted plan in a fresh
4489
+ // context: that turn takes the cycle over (see the autonomous
4490
+ // lane below).
4491
+ const exitPlanInterruption = pendingExitPlanModeInterruption !== undefined &&
4492
+ isExitPlanInterruptionResult(message, pendingExitPlanModeInterruption);
4493
+ const continuesPlan = exitPlanInterruption &&
4494
+ isHeldOpen(session.activeTurn) &&
4495
+ pendingExitPlanContextReset?.toolUseId ===
4496
+ pendingExitPlanModeInterruption?.toolUseId;
4497
+ if (!continuesPlan && !(isAutonomousResult && message.num_turns === 0)) {
4498
+ this.endAutonomousCycle(params.sessionId, autonomousCycleEnd(message, resultModelUsage, session.cancelled || exitPlanInterruption));
4499
+ }
4446
4500
  if (session.cancelled) {
4447
4501
  session.pendingExitPlanModeInterruption = undefined;
4448
4502
  session.pendingExitPlanContextReset = undefined;
@@ -4486,8 +4540,11 @@ export class ClaudeAcpAgent {
4486
4540
  pendingExitPlanModeInterruption.toolUseId) {
4487
4541
  // The fresh query has none of this one's background
4488
4542
  // tasks, so the hold can never drain there: drop it, and
4489
- // let the continuation's own result settle the turn.
4543
+ // let the continuation's own result settle the turn. The
4544
+ // continuation is the turn's work again, which takes
4545
+ // over the follow-up cycle that planned it.
4490
4546
  heldTurn.deferredSettle = undefined;
4547
+ this.startForeground(params.sessionId, heldTurn);
4491
4548
  await this.exitPlan.restart(params.sessionId, session, pendingExitPlanContextReset);
4492
4549
  return;
4493
4550
  }
@@ -5769,6 +5826,9 @@ export class ClaudeAcpAgent {
5769
5826
  catch (error) {
5770
5827
  this.logger.error(`Session ${sessionId}: cancellation failed during teardown`, error);
5771
5828
  }
5829
+ // The turns end before this returns; so does a model cycle that Claude
5830
+ // Code started on its own, which no turn waits for.
5831
+ this.endAutonomousCycle(sessionId, { outcome: { stopReason: "cancelled" } });
5772
5832
  // cancel() arms the force-cancel floor and interrupts gracefully, but a
5773
5833
  // wedged consumer only wakes when `cancelController` aborts — closeQueryStream
5774
5834
  // below doesn't touch it. Since we're tearing the session down anyway, wake
@@ -6278,40 +6338,100 @@ export class ClaudeAcpAgent {
6278
6338
  /** Mark a client request as blocking on user input for exactly the lifetime
6279
6339
  * of its promise. Steering consults this session-local count synchronously,
6280
6340
  * so a message arriving while any permission/elicitation card is open uses
6281
- * non-interrupting SDK delivery. The active turn reports that it awaits the
6282
- * user while any such request is open (see `syncAwaitingUser`). */
6341
+ * non-interrupting SDK delivery. The session's foreground work reports that
6342
+ * it awaits the user while any such request is open (see
6343
+ * `syncAwaitingUser`). */
6283
6344
  async withPendingUserInput(sessionId, request) {
6284
6345
  const session = this.sessions[sessionId];
6285
6346
  if (!session)
6286
6347
  return request();
6287
6348
  session.pendingUserInputCount = (session.pendingUserInputCount ?? 0) + 1;
6288
- this.syncAwaitingUser(session);
6349
+ this.syncAwaitingUser(sessionId, session);
6289
6350
  try {
6290
6351
  return await request();
6291
6352
  }
6292
6353
  finally {
6293
6354
  session.pendingUserInputCount = Math.max(0, (session.pendingUserInputCount ?? 1) - 1);
6294
- this.syncAwaitingUser(session);
6355
+ this.syncAwaitingUser(sessionId, session);
6295
6356
  }
6296
6357
  }
6297
- /** Report whether the session's active turn awaits the user: exactly while
6298
- * a permission request or question is open in the session. A request does
6299
- * not say which prompt it is for, and Claude Code can ask for a queued
6358
+ /** Report whether the session's foreground work awaits the user: exactly
6359
+ * while a permission request or question is open in the session. A request
6360
+ * does not say which prompt it is for, and Claude Code can ask for a queued
6300
6361
  * prompt before the consumer activates it, so a request is not tied to the
6301
- * turn that was active when it opened. Called when the count changes and
6362
+ * work that was running when it opened. Called when the count changes and
6302
6363
  * when a turn activates. */
6303
- syncAwaitingUser(session) {
6304
- const turn = session.activeTurn;
6305
- if (!turn || turn.settled || !turn.insertedReported)
6364
+ syncAwaitingUser(sessionId, session) {
6365
+ const work = this.foregroundWork.get(sessionId);
6366
+ if (!work)
6306
6367
  return;
6307
6368
  const waiting = (session.pendingUserInputCount ?? 0) > 0;
6308
- if (waiting === (turn.awaitingUser ?? false))
6369
+ if (waiting === work.awaitingUser)
6309
6370
  return;
6310
- turn.awaitingUser = waiting;
6371
+ work.awaitingUser = waiting;
6311
6372
  if (waiting)
6312
- turn.events.awaitingUser();
6373
+ work.events.awaitingUser();
6374
+ else
6375
+ work.events.running();
6376
+ }
6377
+ /** Make `owner` the foreground work of the session `sessionId` (see
6378
+ * {@link ForegroundEvents}): it reports `running`, then waits at once if a
6379
+ * request is open. If work already runs, it goes on under `owner` and
6380
+ * reports nothing new: a turn takes over a cycle that Claude Code started on
6381
+ * its own, and only the owner's end ends the work. */
6382
+ startForeground(sessionId, owner) {
6383
+ if (!this.foregroundEvents)
6384
+ return;
6385
+ const current = this.foregroundWork.get(sessionId);
6386
+ if (current) {
6387
+ current.owner = owner;
6388
+ return;
6389
+ }
6390
+ const events = this.foregroundEvents(sessionId);
6391
+ this.foregroundWork.set(sessionId, { owner, events, awaitingUser: false });
6392
+ events.running();
6393
+ const session = this.sessions[sessionId];
6394
+ if (session)
6395
+ this.syncAwaitingUser(sessionId, session);
6396
+ }
6397
+ /** End the foreground work of the session `sessionId` with `outcome`, or as
6398
+ * failed with `error`, if `owner` is that work. */
6399
+ endForeground(sessionId, owner, end) {
6400
+ const work = this.foregroundWork.get(sessionId);
6401
+ if (work?.owner !== owner)
6402
+ return;
6403
+ this.foregroundWork.delete(sessionId);
6404
+ if ("outcome" in end)
6405
+ work.events.ended(end.outcome);
6313
6406
  else
6314
- turn.events.resumed();
6407
+ work.events.failed(end.error);
6408
+ }
6409
+ /** Start a model cycle that Claude Code started on its own as the foreground
6410
+ * work (see {@link ForegroundEvents}) when `message` is its first output:
6411
+ * model output of the main conversation (not a subagent's) while no work
6412
+ * runs. That includes a turn that v1 holds for its background subagents,
6413
+ * whose work ended at its result, so its follow-up is a cycle. Output after
6414
+ * a cancel is dropped, so it starts nothing. */
6415
+ startAutonomousCycle(sessionId, session, message) {
6416
+ if (!this.foregroundEvents || this.foregroundWork.has(sessionId) || session.cancelled)
6417
+ return;
6418
+ if (message.type !== "assistant" && message.type !== "stream_event")
6419
+ return;
6420
+ if (message.parent_tool_use_id !== null)
6421
+ return;
6422
+ // A turn that Claude Code started is the foreground work already. Without
6423
+ // lifecycle frames, a queued turn's output can come before its echo, so
6424
+ // output while a turn is queued may be that turn's. With them, a turn that
6425
+ // Claude Code has not started has no output yet.
6426
+ const queued = (session.turnQueue ?? []).some((turn) => !turn.settled && turn !== session.activeTurn);
6427
+ if (queued && !session.msgLifecycleV1)
6428
+ return;
6429
+ this.startForeground(sessionId, AUTONOMOUS_CYCLE);
6430
+ }
6431
+ /** End the session's model cycle that Claude Code started on its own, if one
6432
+ * runs. */
6433
+ endAutonomousCycle(sessionId, end) {
6434
+ this.endForeground(sessionId, AUTONOMOUS_CYCLE, end);
6315
6435
  }
6316
6436
  /** Forward a permission request to the client, wiring the tool call's
6317
6437
  * `signal` through as a `cancellationSignal`. When the turn is cancelled
@@ -7932,16 +8052,57 @@ function cancelledOutcome(session, turn) {
7932
8052
  * so the rows can total more than `token_count`. They are the fuller picture,
7933
8053
  * not a decomposition of it. */
7934
8054
  function turnQuotaMeta(session) {
8055
+ return quotaMeta(session.accumulatedUsage, session.accumulatedModelUsage);
8056
+ }
8057
+ /** `_meta.quota` for work that spent `usage` in its main agent loop and
8058
+ * `modelUsage` by model (see {@link turnQuotaMeta}). */
8059
+ function quotaMeta(usage, modelUsage) {
7935
8060
  return {
7936
8061
  quota: {
7937
- token_count: quotaTokenCount(session.accumulatedUsage),
7938
- model_usage: Object.entries(session.accumulatedModelUsage ?? {}).map(([model, usage]) => ({
8062
+ token_count: quotaTokenCount(usage),
8063
+ model_usage: Object.entries(modelUsage ?? {}).map(([model, usage]) => ({
7939
8064
  model,
7940
8065
  token_count: quotaTokenCount(usage),
7941
8066
  })),
7942
8067
  },
7943
8068
  };
7944
8069
  }
8070
+ /** How a model cycle that Claude Code started on its own ended, read from its
8071
+ * result as a turn's is: a refusal, the token limit, and the turn and budget
8072
+ * limits are their stop reasons, an error result fails the cycle, and a
8073
+ * cancel ends it `cancelled`. The usage and `_meta.quota` are the result's
8074
+ * own, `modelUsage` its increment by model, since autonomous results stay out
8075
+ * of the turn tally. */
8076
+ function autonomousCycleEnd(result, modelUsage, cancelled) {
8077
+ // Typed non-null, but third-party backends have been observed omitting
8078
+ // usage token fields (see snapshotFromUsage).
8079
+ const tally = {
8080
+ inputTokens: result.usage.input_tokens ?? 0,
8081
+ outputTokens: result.usage.output_tokens ?? 0,
8082
+ cachedReadTokens: result.usage.cache_read_input_tokens ?? 0,
8083
+ cachedWriteTokens: result.usage.cache_creation_input_tokens ?? 0,
8084
+ };
8085
+ const ended = (stopReason) => ({
8086
+ outcome: {
8087
+ stopReason,
8088
+ usage: { ...tally, totalTokens: tallyTotal(tally) },
8089
+ _meta: quotaMeta(tally, modelUsage),
8090
+ },
8091
+ });
8092
+ if (cancelled)
8093
+ return ended("cancelled");
8094
+ if (result.stop_reason === "refusal")
8095
+ return ended("refusal");
8096
+ if (result.stop_reason === "max_tokens")
8097
+ return ended("max_tokens");
8098
+ if (result.is_error) {
8099
+ const text = result.subtype === "success" ? result.result : result.errors.join(", ") || result.subtype;
8100
+ return { error: RequestError.internalError(undefined, text) };
8101
+ }
8102
+ return ended(result.subtype === "success" || result.subtype === "error_during_execution"
8103
+ ? "end_turn"
8104
+ : "max_turn_requests");
8105
+ }
7945
8106
  /** One `token_count` object. `cachedInputTokens` is cache reads, matching
7946
8107
  * codex's field; Claude also reports cache writes, which codex has no slot
7947
8108
  * for, so those ride along in an extra sibling (the same name the ACP `usage`
@@ -1,10 +1,11 @@
1
1
  /**
2
- * A prompt turn as the adapter understands it, independent of the ACP version.
2
+ * A prompt turn and the foreground work of a session, as the adapter
3
+ * understands them, independent of the ACP version.
3
4
  *
4
- * The agent reports each turn through {@link TurnEvents}, and each ACP version
5
- * maps the events to its own messages. ACP v1 answers `session/prompt` when the
6
- * turn ends or fails. ACP v2 answers it when the prompt is inserted, and
7
- * reports the rest as session state.
5
+ * The agent reports how each prompt is answered through {@link TurnEvents}:
6
+ * ACP v1 answers `session/prompt` when the turn ends or fails, and ACP v2 when
7
+ * the prompt is inserted. ACP v2 also reports the session's work as state,
8
+ * which the agent reports through {@link ForegroundEvents}.
8
9
  *
9
10
  * The agent calls these synchronously while it updates its own state, so a
10
11
  * handler must not throw, nor call back into the agent before it returns.
@@ -23,18 +24,6 @@ export interface TurnEvents {
23
24
  * `/compact`), it is the command's result, after any output it streamed.
24
25
  */
25
26
  inserted(messageId: string): void;
26
- /**
27
- * The turn waits for the user: a permission request or a question is open in
28
- * the session. Requests do not say which prompt they are for, so this
29
- * includes one opened before the turn was inserted. Only reported after
30
- * {@link inserted}.
31
- */
32
- awaitingUser(): void;
33
- /**
34
- * The turn works again: no request is open any more. A turn that ends or
35
- * fails while it waits reports that instead.
36
- */
37
- resumed(): void;
38
27
  /**
39
28
  * The turn ended. A queued turn that is cancelled before it is inserted
40
29
  * ends too, without {@link inserted}; Claude Code may still run its prompt.
@@ -47,6 +36,39 @@ export interface TurnEvents {
47
36
  */
48
37
  failed(error: unknown): void;
49
38
  }
39
+ /**
40
+ * The foreground work of a session: what a client would wait for before it
41
+ * sends the next prompt. One piece of work runs at a time, and the next starts
42
+ * with {@link running}. The work is either:
43
+ *
44
+ * - A prompt's turn, from {@link TurnEvents.inserted} until its result, or
45
+ * until it fails or is cancelled. A turn that v1 holds open for the
46
+ * background subagents it spawned (`Turn.deferredSettle`) ends its work at
47
+ * its result all the same: the hold only delays v1's answer.
48
+ * - A model cycle that Claude Code starts on its own while no work runs: for
49
+ * example, its follow-up after a background command or subagent finished,
50
+ * or its answer to a message from another session. It runs until its result.
51
+ *
52
+ * A prompt that Claude Code takes in while a cycle runs takes the cycle over:
53
+ * the cycle reports nothing more, and the turn reports from there.
54
+ */
55
+ export interface ForegroundEvents {
56
+ /** The work started, or works again after it waited for the user. */
57
+ running(): void;
58
+ /**
59
+ * The work waits for the user: a permission request or a question is open in
60
+ * the session. Requests do not say which work they are for, so this includes
61
+ * one opened before the work started.
62
+ */
63
+ awaitingUser(): void;
64
+ /** The work ended. */
65
+ ended(outcome: TurnOutcome): void;
66
+ /**
67
+ * The work failed with `error`, the JSON-RPC error that v1 answers the
68
+ * prompt with.
69
+ */
70
+ failed(error: unknown): void;
71
+ }
50
72
  /** Why a turn ended. Every ACP version has these reasons. */
51
73
  export type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
52
74
  /** How a turn ended. */
@@ -1 +1 @@
1
- {"version":3,"file":"turn-events.d.ts","sourceRoot":"","sources":["../src/turn-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;OAKG;IACH,YAAY,IAAI,IAAI,CAAC;IACrB;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,mBAAmB,GAAG,SAAS,GAAG,WAAW,CAAC;AAEnG,wBAAwB;AACxB,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;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CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAmB9E;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,EAAE,CAAC,QAAQ,CAoEb"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAmB9E;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,EAAE,CAAC,QAAQ,CA0Eb"}
package/dist/v2/agent.js CHANGED
@@ -2,7 +2,7 @@ import * as v2 from "@agentclientprotocol/sdk/experimental/v2";
2
2
  import { ClaudeAcpAgent } from "../acp-agent.js";
3
3
  import { v1InitializeRequest, v2InitializeResponse } from "./initialize.js";
4
4
  import { v1PermissionResponse, v2PermissionRequest } from "./permission.js";
5
- import { v2Prompt } from "./prompt.js";
5
+ import { v2Foreground, v2Prompt } from "./prompt.js";
6
6
  import { v1ForkSessionRequests, v1NewSessionRequest, v1RestoreSessionRequest, v1SetSessionConfigOptionRequest, v2AvailableCommands, v2ConfigOptions, v2NewSessionResponse, v2ResumeSessionResponse, } from "./session.js";
7
7
  import { v2SessionUpdate } from "./session-update.js";
8
8
  import { V2Terminals } from "./terminal.js";
@@ -22,7 +22,12 @@ export function v2AgentApp(logger, onAgent) {
22
22
  .agent({ name: "claude-code-acp" })
23
23
  .onConnect((connection) => {
24
24
  client = new V2ClientConnection(connection.client, logger ?? console);
25
- agent = new ClaudeAcpAgent(client, logger, { v2: true });
25
+ agent = new ClaudeAcpAgent(client, logger, {
26
+ v2: true,
27
+ foreground: (sessionId) => v2Foreground((update) => {
28
+ void client.send({ sessionId, update });
29
+ }),
30
+ });
26
31
  onAgent(agent);
27
32
  })
28
33
  .onRequest(v2.methods.agent.initialize, async ({ params }) => v2InitializeResponse(await agent.initialize(v1InitializeRequest(params))))
@@ -7,31 +7,42 @@
7
7
  import { type PromptRequest } from "@agentclientprotocol/sdk";
8
8
  import * as v2 from "@agentclientprotocol/sdk/experimental/v2";
9
9
  import type { ClaudeAcpAgent } from "../acp-agent.js";
10
+ import type { ForegroundEvents } from "../turn-events.js";
10
11
  /**
11
12
  * Starts a turn for `params`, and answers when Claude Code takes the prompt
12
- * in. `send` delivers a session update of the prompt's session; it must not
13
- * throw, and must deliver updates in the order it is called, also relative to
14
- * the agent's own updates.
13
+ * in, with the id of the user message it became. `send` delivers a session
14
+ * update of the prompt's session; it must not throw, and must deliver updates
15
+ * in the order it is called, also relative to the agent's own updates.
15
16
  *
16
- * - Taken in: the prompt's `user_message`, then `running`, then the answer.
17
- * - Waiting on a permission request or a question: `requires_action`, and
18
- * `running` once none is open.
19
- * - Ended: `idle` with the stop reason, usage, and `_meta` of the turn.
20
- * - Failed after it was taken in: `idle` with the `error` stop reason and the
21
- * JSON-RPC error that v1 answers the prompt with, so a client can show its
22
- * message and handle its code as for an error response (for example,
23
- * `-32000` starts the client's sign-in).
17
+ * - Taken in: the prompt's `user_message`, then the answer. From then on, the
18
+ * turn is the session's foreground work, which reports its states (see
19
+ * {@link v2Foreground}).
24
20
  * - Ended or failed before it was taken in: the answer is a JSON-RPC error,
25
21
  * `-32800` for a prompt that a cancel ended in the queue.
26
- *
27
- * Deferred decision: a turn whose background subagents still run ends only
28
- * when they finish (`Turn.deferredSettle`), so `idle` waits for them too. The
29
- * hold exists for v1, whose clients stop listening at the prompt response.
30
- * v2 allows background updates while idle, so it could report `idle` at the
31
- * turn's result instead, with a turn event for the hold. To be decided with
32
- * async tasks (step 6 in `docs/acp-v2.md`).
33
22
  */
34
23
  export declare function v2Prompt(agent: ClaudeAcpAgent, params: v2.PromptRequest, send: (update: v2.SessionUpdate) => void): Promise<v2.PromptResponse>;
24
+ /**
25
+ * Reports the foreground work of a session (see {@link ForegroundEvents}) as
26
+ * its `state_update`s. `send` delivers a session update of that session, as
27
+ * for {@link v2Prompt}.
28
+ *
29
+ * - Started: `running`. For a prompt's turn, right after its `user_message`.
30
+ * - Waiting on a permission request or a question: `requires_action`, and
31
+ * `running` once none is open.
32
+ * - Ended: `idle` with the stop reason, usage, and `_meta` of the work.
33
+ * - Failed: `idle` with the `error` stop reason and the JSON-RPC error that v1
34
+ * answers the prompt with, so a client can show its message and handle its
35
+ * code as for an error response (for example, `-32000` starts the client's
36
+ * sign-in).
37
+ *
38
+ * The work is a prompt's turn or a model cycle that Claude Code started on its
39
+ * own, such as its follow-up after a background subagent finished. A turn's
40
+ * work ends at its result, also when v1 holds the turn's answer for the
41
+ * background subagents it spawned (`Turn.deferredSettle`): v2 allows
42
+ * background updates while idle, so the subagents' output and requests arrive
43
+ * after `idle`, and their follow-up is a cycle of its own.
44
+ */
45
+ export declare function v2Foreground(send: (update: v2.SessionUpdate) => void): ForegroundEvents;
35
46
  /**
36
47
  * A v2 prompt may hold content blocks that v1 cannot express: a custom one,
37
48
  * or one from a newer ACP version. Clients send only the kinds the agent
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/v2/prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,EAAE,CAAC,aAAa,EACxB,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,KAAK,IAAI,GACvC,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC,CAoD5B;AAgCD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,aAAa,GAAG,aAAa,CAEvF"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/v2/prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAuC,MAAM,mBAAmB,CAAC;AAE/F;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,EAAE,CAAC,aAAa,EACxB,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,KAAK,IAAI,GACvC,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC,CAiC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,KAAK,IAAI,GAAG,gBAAgB,CAoBvF;AAgCD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,aAAa,GAAG,aAAa,CAEvF"}
package/dist/v2/prompt.js CHANGED
@@ -8,27 +8,15 @@ import { RequestError, } from "@agentclientprotocol/sdk";
8
8
  import * as v2 from "@agentclientprotocol/sdk/experimental/v2";
9
9
  /**
10
10
  * Starts a turn for `params`, and answers when Claude Code takes the prompt
11
- * in. `send` delivers a session update of the prompt's session; it must not
12
- * throw, and must deliver updates in the order it is called, also relative to
13
- * the agent's own updates.
11
+ * in, with the id of the user message it became. `send` delivers a session
12
+ * update of the prompt's session; it must not throw, and must deliver updates
13
+ * in the order it is called, also relative to the agent's own updates.
14
14
  *
15
- * - Taken in: the prompt's `user_message`, then `running`, then the answer.
16
- * - Waiting on a permission request or a question: `requires_action`, and
17
- * `running` once none is open.
18
- * - Ended: `idle` with the stop reason, usage, and `_meta` of the turn.
19
- * - Failed after it was taken in: `idle` with the `error` stop reason and the
20
- * JSON-RPC error that v1 answers the prompt with, so a client can show its
21
- * message and handle its code as for an error response (for example,
22
- * `-32000` starts the client's sign-in).
15
+ * - Taken in: the prompt's `user_message`, then the answer. From then on, the
16
+ * turn is the session's foreground work, which reports its states (see
17
+ * {@link v2Foreground}).
23
18
  * - Ended or failed before it was taken in: the answer is a JSON-RPC error,
24
19
  * `-32800` for a prompt that a cancel ended in the queue.
25
- *
26
- * Deferred decision: a turn whose background subagents still run ends only
27
- * when they finish (`Turn.deferredSettle`), so `idle` waits for them too. The
28
- * hold exists for v1, whose clients stop listening at the prompt response.
29
- * v2 allows background updates while idle, so it could report `idle` at the
30
- * turn's result instead, with a turn event for the hold. To be decided with
31
- * async tasks (step 6 in `docs/acp-v2.md`).
32
20
  */
33
21
  export function v2Prompt(agent, params, send) {
34
22
  return new Promise((resolve, reject) => {
@@ -37,37 +25,18 @@ export function v2Prompt(agent, params, send) {
37
25
  inserted(messageId) {
38
26
  inserted = true;
39
27
  send({ sessionUpdate: "user_message", messageId, content: params.prompt });
40
- send({ sessionUpdate: "state_update", state: "running" });
41
28
  resolve({ messageId });
42
29
  },
43
- awaitingUser() {
44
- send({ sessionUpdate: "state_update", state: "requires_action" });
45
- },
46
- resumed() {
47
- send({ sessionUpdate: "state_update", state: "running" });
48
- },
49
30
  ended(outcome) {
50
- if (inserted) {
51
- send(idle(outcome));
52
- }
53
- else if (outcome.stopReason === "cancelled") {
54
- reject(RequestError.requestCancelled());
55
- }
56
- else {
57
- reject(RequestError.internalError({ stopReason: outcome.stopReason }, "The turn ended before Claude Code took the prompt in"));
58
- }
31
+ if (inserted)
32
+ return;
33
+ reject(outcome.stopReason === "cancelled"
34
+ ? RequestError.requestCancelled()
35
+ : RequestError.internalError({ stopReason: outcome.stopReason }, "The turn ended before Claude Code took the prompt in"));
59
36
  },
60
37
  failed(error) {
61
- if (!inserted) {
38
+ if (!inserted)
62
39
  reject(error);
63
- return;
64
- }
65
- send({
66
- sessionUpdate: "state_update",
67
- state: "idle",
68
- stopReason: "error",
69
- error: jsonRpcError(error),
70
- });
71
40
  },
72
41
  };
73
42
  let request;
@@ -81,6 +50,48 @@ export function v2Prompt(agent, params, send) {
81
50
  agent.startTurn(request, events).catch(reject);
82
51
  });
83
52
  }
53
+ /**
54
+ * Reports the foreground work of a session (see {@link ForegroundEvents}) as
55
+ * its `state_update`s. `send` delivers a session update of that session, as
56
+ * for {@link v2Prompt}.
57
+ *
58
+ * - Started: `running`. For a prompt's turn, right after its `user_message`.
59
+ * - Waiting on a permission request or a question: `requires_action`, and
60
+ * `running` once none is open.
61
+ * - Ended: `idle` with the stop reason, usage, and `_meta` of the work.
62
+ * - Failed: `idle` with the `error` stop reason and the JSON-RPC error that v1
63
+ * answers the prompt with, so a client can show its message and handle its
64
+ * code as for an error response (for example, `-32000` starts the client's
65
+ * sign-in).
66
+ *
67
+ * The work is a prompt's turn or a model cycle that Claude Code started on its
68
+ * own, such as its follow-up after a background subagent finished. A turn's
69
+ * work ends at its result, also when v1 holds the turn's answer for the
70
+ * background subagents it spawned (`Turn.deferredSettle`): v2 allows
71
+ * background updates while idle, so the subagents' output and requests arrive
72
+ * after `idle`, and their follow-up is a cycle of its own.
73
+ */
74
+ export function v2Foreground(send) {
75
+ return {
76
+ running() {
77
+ send({ sessionUpdate: "state_update", state: "running" });
78
+ },
79
+ awaitingUser() {
80
+ send({ sessionUpdate: "state_update", state: "requires_action" });
81
+ },
82
+ ended(outcome) {
83
+ send(idle(outcome));
84
+ },
85
+ failed(error) {
86
+ send({
87
+ sessionUpdate: "state_update",
88
+ state: "idle",
89
+ stopReason: "error",
90
+ error: jsonRpcError(error),
91
+ });
92
+ },
93
+ };
94
+ }
84
95
  /** The JSON-RPC error that v1 answers a failed prompt with. */
85
96
  function jsonRpcError(error) {
86
97
  if (error instanceof RequestError) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.89.2-preview.4",
6
+ "version": "0.89.2-preview.6",
7
7
  "description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
8
8
  "main": "dist/lib.js",
9
9
  "types": "dist/lib.d.ts",