@agentclientprotocol/claude-agent-acp 0.85.2-preview.5 → 0.85.2-preview.7

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.
@@ -273,7 +273,8 @@ type Turn = {
273
273
  * clear-context restart keeps the `_meta.quota` rows it earned pre-restart. */
274
274
  carriedModelUsage?: ModelTokenTally;
275
275
  resolve: (outcome: TurnOutcome) => void;
276
- reject: (error: unknown) => void;
276
+ /** `title` describes the failure for the user (see `TurnEvents.failed`). */
277
+ reject: (error: unknown, title?: string) => void;
277
278
  /** Settles once the turn has ended or failed. */
278
279
  completion?: Promise<void>;
279
280
  };
@@ -1167,6 +1168,21 @@ export declare class ClaudeAcpAgent {
1167
1168
  * still healed by the next activation's reset). Structural until the SDK
1168
1169
  * exposes capabilities before the stream starts. */
1169
1170
  private trackOrphanCommand;
1171
+ /** Ask Claude Code to drop user messages it still has queued, so that a
1172
+ * prompt a cancel settled is not run after all. Claude Code keeps queued
1173
+ * messages through an interrupt and runs them next (the receipt's
1174
+ * `still_queued`), unless they are cancelled first with
1175
+ * `cancel_async_message`: a no-op for a message it already dequeued, which
1176
+ * then still runs, as an orphan (see `orphanCommands`).
1177
+ *
1178
+ * Not awaited: the SDK writes control requests in call order, so the drops
1179
+ * reach Claude Code before a request sent after them, and a wedged CLI must
1180
+ * not hold up the cancel. The orphan accounting needs no update here: a
1181
+ * dropped message gets a `cancelled` lifecycle frame and is missing from the
1182
+ * interrupt receipt's `still_queued`, which both already account for. The
1183
+ * SDK implements the request as `Query.cancelAsyncMessage` without typing
1184
+ * it, so it is looked up, and a CLI that lacks it rejects the request. */
1185
+ private dropQueuedMessages;
1170
1186
  cancel(params: CancelNotification): Promise<void>;
1171
1187
  /** Cancel the session's turns and interrupt the SDK query. With
1172
1188
  * `awaitInterrupt: false` the interrupt is sent, but its reply is not
@@ -1 +1 @@
1
- {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"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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,CAyCV;AAED,8BAA8B;AAC9B,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;;;EAMrC"}
package/dist/acp-agent.js CHANGED
@@ -1988,8 +1988,8 @@ export class ClaudeAcpAgent {
1988
1988
  events.ended(outcome);
1989
1989
  completeTurn();
1990
1990
  },
1991
- reject: (error) => {
1992
- events.failed(error);
1991
+ reject: (error, title) => {
1992
+ events.failed(error, title);
1993
1993
  completeTurn();
1994
1994
  },
1995
1995
  };
@@ -2654,18 +2654,23 @@ export class ClaudeAcpAgent {
2654
2654
  }
2655
2655
  }
2656
2656
  resetTurnScratch();
2657
- // Activation is when Claude Code takes the prompt in: its echo, or for an
2658
- // echo-less command, its result. That inserts it into the conversation.
2659
- // A turn can be settled by now: an echo hand-off awaits settling the
2660
- // previous turn, and a cancel in that window settles the queued one.
2661
- if (!turn.insertedReported && !turn.settled) {
2662
- turn.insertedReported = true;
2663
- turn.events.inserted(turn.promptUuid);
2664
- }
2657
+ // Without a command_lifecycle "started" frame before it (see that
2658
+ // handler), activation is the first sign that Claude Code took the
2659
+ // prompt in: its echo, or for an echo-less command, its result.
2660
+ reportInserted(turn);
2665
2661
  // A request can already be open: Claude Code asks for a queued prompt
2666
2662
  // before the consumer reaches its echo.
2667
2663
  this.syncAwaitingUser(session);
2668
2664
  };
2665
+ /** Report that Claude Code took the turn's prompt in, once. A turn can be
2666
+ * settled by now: an echo hand-off awaits settling the previous turn, and
2667
+ * a cancel in that window settles the queued one. */
2668
+ const reportInserted = (turn) => {
2669
+ if (turn.insertedReported || turn.settled)
2670
+ return;
2671
+ turn.insertedReported = true;
2672
+ turn.events.inserted(turn.promptUuid);
2673
+ };
2669
2674
  /** Ensure there is an active turn before a user-turn result that carries no
2670
2675
  * echo to activate it, by promoting the queue head. Most turns are
2671
2676
  * activated by their replayed user message before their result, but some
@@ -3024,7 +3029,7 @@ export class ClaudeAcpAgent {
3024
3029
  };
3025
3030
  /** Reject the active turn (auth required, error result, …) without tearing
3026
3031
  * down the consumer: the stream continues to idle and later turns proceed. */
3027
- const failActive = (error) => {
3032
+ const failActive = (error, title) => {
3028
3033
  disarmForceCancel(session);
3029
3034
  const turn = session.activeTurn;
3030
3035
  if (!turn || turn.settled) {
@@ -3041,7 +3046,7 @@ export class ClaudeAcpAgent {
3041
3046
  // start the next stretch clean, or its stale delivery record would
3042
3047
  // suppress the next turn's issue-#453 result-text fallback.
3043
3048
  session.emittedAssistantText = false;
3044
- turn.reject(error);
3049
+ turn.reject(error, title);
3045
3050
  };
3046
3051
  /** Complete a negotiated terminal failure on the prompt response itself,
3047
3052
  * which is the canonical AIR carrier. Legacy clients keep the historical
@@ -3065,7 +3070,7 @@ export class ClaudeAcpAgent {
3065
3070
  return;
3066
3071
  }
3067
3072
  if (!supportsAirSessionFailures(this.clientCapabilities)) {
3068
- failActive(error);
3073
+ failActive(error, title);
3069
3074
  return;
3070
3075
  }
3071
3076
  if (!session.activeTurn || session.activeTurn.settled) {
@@ -3075,7 +3080,7 @@ export class ClaudeAcpAgent {
3075
3080
  }
3076
3081
  const failure = await createSessionFailure(kind, { title });
3077
3082
  if (!failure) {
3078
- failActive(error);
3083
+ failActive(error, title);
3079
3084
  return;
3080
3085
  }
3081
3086
  sessionFailures.recordActive(failure);
@@ -3270,10 +3275,10 @@ export class ClaudeAcpAgent {
3270
3275
  // prompt() stamps a uuid on every message. The frame is @internal and
3271
3276
  // absent from the SDKMessage union, so handle it BEFORE the exhaustive
3272
3277
  // switch: it must not reach `unreachable`'s error log, and a `case`
3273
- // for it wouldn't typecheck. It feeds only the orphan accounting (see
3274
- // Session.orphanCommands); turn settlement stays driven by
3275
- // echoes/results/idle. (Raw-mode emission above still forwards these
3276
- // frames.)
3278
+ // for it wouldn't typecheck. It feeds the orphan accounting (see
3279
+ // Session.orphanCommands) and reports a turn inserted at "started";
3280
+ // turn activation and settlement stay driven by echoes/results/idle.
3281
+ // (Raw-mode emission above still forwards these frames.)
3277
3282
  if (message.type === "command_lifecycle") {
3278
3283
  const frame = message;
3279
3284
  switch (frame.state) {
@@ -3284,6 +3289,17 @@ export class ClaudeAcpAgent {
3284
3289
  if (queued) {
3285
3290
  queued.commandStarted = true;
3286
3291
  compaction.resume();
3292
+ // Claude Code took the prompt in: it drained into a turn. A
3293
+ // fresh turn reports that before anything it produces, its echo
3294
+ // and first stream events included, so this is the earliest
3295
+ // insertion point. (A prompt folded into a running turn reports
3296
+ // it after its echo, which already activated it.) While another
3297
+ // turn is still active (held for background work, steered, or
3298
+ // cancelled and awaiting its trailing idle), insertion waits
3299
+ // for this turn's echo, whose hand-off ends that turn first.
3300
+ const active = session.activeTurn;
3301
+ if (!active || active.settled || active === queued)
3302
+ reportInserted(queued);
3287
3303
  }
3288
3304
  // ...and promote an already-orphaned command: once dispatched,
3289
3305
  // a bare `cancelled` no longer means "dropped without running".
@@ -3471,6 +3487,7 @@ export class ClaudeAcpAgent {
3471
3487
  update: {
3472
3488
  sessionUpdate: "agent_message_chunk",
3473
3489
  content: { type: "text", text: commandMarkdown ?? message.content },
3490
+ messageId: messageIdForGrouping(message),
3474
3491
  },
3475
3492
  });
3476
3493
  break;
@@ -4406,6 +4423,7 @@ export class ClaudeAcpAgent {
4406
4423
  update: {
4407
4424
  sessionUpdate: "agent_message_chunk",
4408
4425
  content: { type: "text", text: lastRefusalExplanation },
4426
+ messageId: messageIdForGrouping(message),
4409
4427
  },
4410
4428
  });
4411
4429
  }
@@ -4486,7 +4504,7 @@ export class ClaudeAcpAgent {
4486
4504
  break;
4487
4505
  if (commandMarkdown === null)
4488
4506
  break;
4489
- for (const notification of toAcpNotifications(commandMarkdown ?? message.result, "assistant", params.sessionId, session.toolUseCache, routedNotificationClient, this.logger)) {
4507
+ for (const notification of toAcpNotifications(commandMarkdown ?? message.result, "assistant", params.sessionId, session.toolUseCache, routedNotificationClient, this.logger, { messageId: messageIdForGrouping(message) })) {
4490
4508
  await sendUpdate(notification);
4491
4509
  }
4492
4510
  }
@@ -5172,6 +5190,36 @@ export class ClaudeAcpAgent {
5172
5190
  session.pendingOrphanResults = (session.pendingOrphanResults ?? 0) + 1;
5173
5191
  }
5174
5192
  }
5193
+ /** Ask Claude Code to drop user messages it still has queued, so that a
5194
+ * prompt a cancel settled is not run after all. Claude Code keeps queued
5195
+ * messages through an interrupt and runs them next (the receipt's
5196
+ * `still_queued`), unless they are cancelled first with
5197
+ * `cancel_async_message`: a no-op for a message it already dequeued, which
5198
+ * then still runs, as an orphan (see `orphanCommands`).
5199
+ *
5200
+ * Not awaited: the SDK writes control requests in call order, so the drops
5201
+ * reach Claude Code before a request sent after them, and a wedged CLI must
5202
+ * not hold up the cancel. The orphan accounting needs no update here: a
5203
+ * dropped message gets a `cancelled` lifecycle frame and is missing from the
5204
+ * interrupt receipt's `still_queued`, which both already account for. The
5205
+ * SDK implements the request as `Query.cancelAsyncMessage` without typing
5206
+ * it, so it is looked up, and a CLI that lacks it rejects the request. */
5207
+ dropQueuedMessages(sessionId, query, uuids) {
5208
+ const cancelAsyncMessage = query
5209
+ .cancelAsyncMessage;
5210
+ if (typeof cancelAsyncMessage !== "function")
5211
+ return;
5212
+ const logFailure = (uuid, error) => this.logger.error(`Session ${sessionId}: could not drop the queued message ${uuid} from Claude Code:`, error);
5213
+ for (const uuid of uuids) {
5214
+ // Called synchronously: deferring it would let the interrupt go first.
5215
+ try {
5216
+ Promise.resolve(cancelAsyncMessage.call(query, uuid)).catch((error) => logFailure(uuid, error));
5217
+ }
5218
+ catch (error) {
5219
+ logFailure(uuid, error);
5220
+ }
5221
+ }
5222
+ }
5175
5223
  async cancel(params) {
5176
5224
  await this.cancelTurns(params, { awaitInterrupt: true });
5177
5225
  }
@@ -5217,12 +5265,16 @@ export class ClaudeAcpAgent {
5217
5265
  session.toolCallFields?.clear();
5218
5266
  clearHookCallbacks(params.sessionId);
5219
5267
  }
5268
+ // The user messages this cancel abandons while Claude Code may still have
5269
+ // them queued: they are dropped from its queue before the interrupt.
5270
+ const abandoned = [];
5220
5271
  // A priority steer may still be queued in the SDK when cancellation
5221
5272
  // settles its owning turn. Its later echo matches no live turn, and its
5222
5273
  // result must be skipped rather than promoted onto the next prompt.
5223
5274
  if (isSteering(session.activeTurn)) {
5224
5275
  for (const uuid of session.activeTurn.steeredEchoes) {
5225
5276
  this.trackOrphanCommand(session, uuid, "pending");
5277
+ abandoned.push(uuid);
5226
5278
  }
5227
5279
  }
5228
5280
  // Capture the orphan-accounting lane before anything can await: the
@@ -5246,11 +5298,13 @@ export class ClaudeAcpAgent {
5246
5298
  // accumulator (the active turn's tally) is not its spend.
5247
5299
  turn.resolve({ stopReason: "cancelled" });
5248
5300
  orphanedTurns.push(turn);
5301
+ abandoned.push(turn.promptUuid);
5249
5302
  }
5250
5303
  }
5251
- // Each removed queued turn's user message was already pushed to the SDK,
5252
- // which processes input FIFO and will still emit a result for it with no
5253
- // user echo to match (0.3.246+ CLIs do stamp results with the
5304
+ // Each removed queued turn's user message was already pushed to the SDK.
5305
+ // It is dropped from Claude Code's queue below (see dropQueuedMessages),
5306
+ // but one Claude Code already dequeued still runs, FIFO, and emits a
5307
+ // result with no user echo to match (0.3.246+ CLIs do stamp results with the
5254
5308
  // triggering send's user_message_uuid, which ensureActiveTurn uses as
5255
5309
  // an exact join when present). Track those so the consumer skips them
5256
5310
  // (see ensureActiveTurn) rather than misattributing them to the head.
@@ -5395,6 +5449,9 @@ export class ClaudeAcpAgent {
5395
5449
  cancelController.abort();
5396
5450
  }, this.forceCancelGraceMs);
5397
5451
  }
5452
+ // Before the interrupt: once it stops the running turn, Claude Code starts
5453
+ // the next queued message right away.
5454
+ this.dropQueuedMessages(params.sessionId, session.query, abandoned);
5398
5455
  const interrupt = session.query.interrupt();
5399
5456
  if (!options.awaitInterrupt) {
5400
5457
  // The caller closes the query next, which rejects the pending reply.
@@ -13,9 +13,14 @@ export interface TurnEvents {
13
13
  /**
14
14
  * Claude Code took the prompt in as the user message `messageId` of the
15
15
  * conversation. Reported at most once per turn, and never after
16
- * {@link ended} or {@link failed}. For a prompt Claude Code echoes, that is
17
- * the echo; for a command it does not echo (such as `/compact`), it is the
18
- * command's result, after any output the command streamed.
16
+ * {@link ended} or {@link failed}.
17
+ *
18
+ * When Claude Code reports command lifecycles (`msg_lifecycle_v1`), that is
19
+ * when the prompt starts a turn, before the turn's output. Otherwise, and
20
+ * while another turn is still active (held for its background work,
21
+ * steered, or cancelled but not yet ended), it is the prompt's echo, after
22
+ * that turn ended; for a command Claude Code does not echo (such as
23
+ * `/compact`), it is the command's result, after any output it streamed.
19
24
  */
20
25
  inserted(messageId: string): void;
21
26
  /**
@@ -37,9 +42,10 @@ export interface TurnEvents {
37
42
  ended(outcome: TurnOutcome): void;
38
43
  /**
39
44
  * The turn failed. Without {@link inserted} before, Claude Code was not seen
40
- * taking the prompt in.
45
+ * taking the prompt in. `title`, when the agent has one, describes the
46
+ * failure for the user in plain text, such as "API Error: 529 Overloaded".
41
47
  */
42
- failed(error: unknown): void;
48
+ failed(error: unknown, title?: string): void;
43
49
  }
44
50
  /** Why a turn ended. Every ACP version has these reasons. */
45
51
  export type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
@@ -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;;;;;;OAMG;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,OAA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AAG,WAAW,CAAC;AAEnG,wBAAwB;AACxB,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,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":"AAYA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAa9E;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,EAAE,CAAC,QAAQ,CA4Bb"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/v2/agent.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAkB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAc9E;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GACvC,EAAE,CAAC,QAAQ,CAoCb"}
package/dist/v2/agent.js CHANGED
@@ -1,6 +1,7 @@
1
1
  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
+ import { v2Prompt } from "./prompt.js";
4
5
  import { v1NewSessionRequest, v1ResumeSessionRequest, v1SetSessionConfigOptionRequest, v2ConfigOptions, v2NewSessionResponse, v2ResumeSessionResponse, } from "./session.js";
5
6
  import { v2SessionUpdate } from "./session-update.js";
6
7
  /**
@@ -12,10 +13,12 @@ import { v2SessionUpdate } from "./session-update.js";
12
13
  */
13
14
  export function v2AgentApp(logger, onAgent) {
14
15
  let agent;
16
+ let client;
15
17
  return v2
16
18
  .agent({ name: "claude-code-acp" })
17
19
  .onConnect((connection) => {
18
- agent = new ClaudeAcpAgent(new V2ClientConnection(connection.client), logger);
20
+ client = new V2ClientConnection(connection.client, logger ?? console);
21
+ agent = new ClaudeAcpAgent(client, logger);
19
22
  onAgent(agent);
20
23
  })
21
24
  .onRequest(v2.methods.agent.initialize, async ({ params }) => v2InitializeResponse(await agent.initialize(v1InitializeRequest(params))))
@@ -29,19 +32,38 @@ export function v2AgentApp(logger, onAgent) {
29
32
  .onRequest(v2.methods.agent.session.setConfigOption, async ({ params }) => {
30
33
  const { configOptions, ...response } = await agent.setSessionConfigOption(v1SetSessionConfigOptionRequest(params));
31
34
  return { ...response, configOptions: v2ConfigOptions(configOptions) };
32
- });
35
+ })
36
+ .onRequest(v2.methods.agent.session.prompt, ({ params }) => v2Prompt(agent, params, (update) => {
37
+ void client.send({ sessionId: params.sessionId, update });
38
+ }))
39
+ .onNotification(v2.methods.agent.session.cancel, ({ params }) => agent.cancel(params));
33
40
  }
34
41
  /**
35
42
  * The {@link AcpClient} of an ACP v2 connection: it sends the v1 messages of
36
43
  * the agent as v2 messages.
37
44
  *
38
- * The v2 surface does not serve prompts yet, so permission requests, which
39
- * only a prompt turn makes, still reject.
45
+ * Permission requests still reject until the v2 surface translates them.
40
46
  */
41
47
  class V2ClientConnection {
42
48
  ctx;
43
- constructor(ctx) {
49
+ logger;
50
+ constructor(ctx, logger) {
44
51
  this.ctx = ctx;
52
+ this.logger = logger;
53
+ }
54
+ /**
55
+ * Sends a v2 session update, and logs rather than rejects when that fails.
56
+ * It and {@link sessionUpdate} hand updates to the connection synchronously,
57
+ * so they go out in the order of the calls. The agent's consumer awaits each
58
+ * of its updates before it reports the next turn event, so a turn's state
59
+ * follows the output that came before it. (An update the consumer is still
60
+ * routing can be overtaken by an event from elsewhere, such as a permission
61
+ * request opening.)
62
+ */
63
+ send(notification) {
64
+ return this.ctx.notify(v2.methods.client.session.update, notification).catch((error) => {
65
+ this.logger.error(`Failed to send a ${notification.update.sessionUpdate} update:`, error);
66
+ });
45
67
  }
46
68
  extNotification(method, params) {
47
69
  if (!isExtensionMethod(method)) {
@@ -0,0 +1,47 @@
1
+ /**
2
+ * ACP v2 `session/prompt`, served through the turn events of `ClaudeAcpAgent`.
3
+ *
4
+ * v2 answers the prompt once Claude Code takes it in, with the id of the user
5
+ * message it became, and reports the rest of the turn as `state_update`s.
6
+ */
7
+ import { type PromptRequest } from "@agentclientprotocol/sdk";
8
+ import * as v2 from "@agentclientprotocol/sdk/experimental/v2";
9
+ import type { ClaudeAcpAgent } from "../acp-agent.js";
10
+ /**
11
+ * 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.
15
+ *
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 {@link FAILED_STOP_REASON} and
21
+ * the JSON-RPC error that v1 answers with in `_meta.claudeCode.error`, and
22
+ * an error `notice` before it that shows the failure. v2 has no error on
23
+ * `idle`, and a notice must not be the only report of a failure.
24
+ * - Ended or failed before it was taken in: the answer is a JSON-RPC error,
25
+ * `-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
+ */
34
+ export declare function v2Prompt(agent: ClaudeAcpAgent, params: v2.PromptRequest, send: (update: v2.SessionUpdate) => void): Promise<v2.PromptResponse>;
35
+ /**
36
+ * The stop reason of a turn that failed after it was taken in. v2's stop
37
+ * reasons all describe work that ended without an error, and a custom one
38
+ * starts with `_`; clients show it as a generic stop.
39
+ */
40
+ export declare const FAILED_STOP_REASON = "_error";
41
+ /**
42
+ * A v2 prompt may hold content blocks that v1 cannot express: a custom one,
43
+ * or one from a newer ACP version. Clients send only the kinds the agent
44
+ * advertised, so such a block is rejected rather than silently dropped.
45
+ */
46
+ export declare function v1PromptRequest({ prompt, ...request }: v2.PromptRequest): PromptRequest;
47
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +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;AAItD;;;;;;;;;;;;;;;;;;;;;;;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,CA0D5B;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAW,CAAC;AA2B3C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,aAAa,GAAG,aAAa,CAEvF"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * ACP v2 `session/prompt`, served through the turn events of `ClaudeAcpAgent`.
3
+ *
4
+ * v2 answers the prompt once Claude Code takes it in, with the id of the user
5
+ * message it became, and reports the rest of the turn as `state_update`s.
6
+ */
7
+ import { RequestError, } from "@agentclientprotocol/sdk";
8
+ import * as v2 from "@agentclientprotocol/sdk/experimental/v2";
9
+ import { splitNoticeText } from "../session-notices.js";
10
+ /**
11
+ * 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.
15
+ *
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 {@link FAILED_STOP_REASON} and
21
+ * the JSON-RPC error that v1 answers with in `_meta.claudeCode.error`, and
22
+ * an error `notice` before it that shows the failure. v2 has no error on
23
+ * `idle`, and a notice must not be the only report of a failure.
24
+ * - Ended or failed before it was taken in: the answer is a JSON-RPC error,
25
+ * `-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
+ */
34
+ export function v2Prompt(agent, params, send) {
35
+ return new Promise((resolve, reject) => {
36
+ let inserted = false;
37
+ const events = {
38
+ inserted(messageId) {
39
+ inserted = true;
40
+ send({ sessionUpdate: "user_message", messageId, content: params.prompt });
41
+ send({ sessionUpdate: "state_update", state: "running" });
42
+ resolve({ messageId });
43
+ },
44
+ awaitingUser() {
45
+ send({ sessionUpdate: "state_update", state: "requires_action" });
46
+ },
47
+ resumed() {
48
+ send({ sessionUpdate: "state_update", state: "running" });
49
+ },
50
+ ended(outcome) {
51
+ if (inserted) {
52
+ send(idle(outcome));
53
+ }
54
+ else if (outcome.stopReason === "cancelled") {
55
+ reject(RequestError.requestCancelled());
56
+ }
57
+ else {
58
+ reject(RequestError.internalError({ stopReason: outcome.stopReason }, "The turn ended before Claude Code took the prompt in"));
59
+ }
60
+ },
61
+ failed(error, title) {
62
+ if (!inserted) {
63
+ reject(error);
64
+ return;
65
+ }
66
+ const failure = jsonRpcError(error);
67
+ send({
68
+ sessionUpdate: "notice",
69
+ severity: "error",
70
+ ...splitNoticeText(title ?? failure.message, "The turn failed"),
71
+ });
72
+ send({
73
+ sessionUpdate: "state_update",
74
+ state: "idle",
75
+ stopReason: FAILED_STOP_REASON,
76
+ _meta: { claudeCode: { error: failure } },
77
+ });
78
+ },
79
+ };
80
+ let request;
81
+ try {
82
+ request = v1PromptRequest(params);
83
+ }
84
+ catch (error) {
85
+ reject(error);
86
+ return;
87
+ }
88
+ agent.startTurn(request, events).catch(reject);
89
+ });
90
+ }
91
+ /**
92
+ * The stop reason of a turn that failed after it was taken in. v2's stop
93
+ * reasons all describe work that ended without an error, and a custom one
94
+ * starts with `_`; clients show it as a generic stop.
95
+ */
96
+ export const FAILED_STOP_REASON = "_error";
97
+ /** The JSON-RPC error that v1 answers a failed prompt with. */
98
+ function jsonRpcError(error) {
99
+ if (error instanceof RequestError) {
100
+ return {
101
+ code: error.code,
102
+ message: error.message,
103
+ ...(error.data !== undefined ? { data: error.data } : {}),
104
+ };
105
+ }
106
+ return {
107
+ code: RequestError.internalError().code,
108
+ message: error instanceof Error ? error.message : String(error),
109
+ };
110
+ }
111
+ function idle({ stopReason, usage, _meta }) {
112
+ return {
113
+ sessionUpdate: "state_update",
114
+ state: "idle",
115
+ stopReason,
116
+ ...(usage ? { usage } : {}),
117
+ ...(_meta ? { _meta } : {}),
118
+ };
119
+ }
120
+ /**
121
+ * A v2 prompt may hold content blocks that v1 cannot express: a custom one,
122
+ * or one from a newer ACP version. Clients send only the kinds the agent
123
+ * advertised, so such a block is rejected rather than silently dropped.
124
+ */
125
+ export function v1PromptRequest({ prompt, ...request }) {
126
+ return { ...request, prompt: prompt.map(v1ContentBlock) };
127
+ }
128
+ function v1ContentBlock(block) {
129
+ if (v2.ContentBlock.isText(block) ||
130
+ v2.ContentBlock.isImage(block) ||
131
+ v2.ContentBlock.isAudio(block) ||
132
+ v2.ContentBlock.isResourceLink(block) ||
133
+ v2.ContentBlock.isResource(block)) {
134
+ const { annotations, ...rest } = block;
135
+ return annotations != null ? { ...rest, annotations: v1Annotations(annotations) } : rest;
136
+ }
137
+ throw RequestError.invalidParams({ type: block.type }, `Content blocks of type ${block.type} are not supported`);
138
+ }
139
+ /**
140
+ * v2 also accepts audiences of a newer ACP version; v1 knows two. An audience
141
+ * of only unknown roles is dropped rather than narrowed to nobody.
142
+ */
143
+ function v1Annotations({ audience, ...annotations }) {
144
+ if (audience == null)
145
+ return annotations;
146
+ const known = audience.filter(isV1Role);
147
+ return known.length > 0 || audience.length === 0
148
+ ? { ...annotations, audience: known }
149
+ : annotations;
150
+ }
151
+ function isV1Role(role) {
152
+ return role === "assistant" || role === "user";
153
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"session-update.d.ts","sourceRoot":"","sources":["../../src/v2/session-update.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GACvC,EAAE,CAAC,aAAa,GAAG,SAAS,CAoB9B"}
1
+ {"version":3,"file":"session-update.d.ts","sourceRoot":"","sources":["../../src/v2/session-update.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GACvC,EAAE,CAAC,aAAa,GAAG,SAAS,CA8B9B"}
@@ -16,6 +16,16 @@ export function v2SessionUpdate(update) {
16
16
  case "usage_update":
17
17
  case "notice":
18
18
  return update;
19
+ case "agent_message_chunk":
20
+ case "agent_thought_chunk":
21
+ case "user_message_chunk": {
22
+ // v2 requires the id of the message a chunk belongs to; v1 allows none.
23
+ const { messageId, ...chunk } = update;
24
+ if (!messageId) {
25
+ throw new Error(`An ACP v2 ${update.sessionUpdate} needs a messageId`);
26
+ }
27
+ return { ...chunk, messageId };
28
+ }
19
29
  case "current_mode_update":
20
30
  // v2 has no modes: the mode is the `mode` config option. Every mode
21
31
  // change also reaches the client as a `config_option_update` or in the
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.85.2-preview.5",
6
+ "version": "0.85.2-preview.7",
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",