claude-code-acp-ts 0.53.0 → 0.57.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- import type { CreateElicitationRequest, CreateElicitationResponse } from "@agentclientprotocol/sdk";
1
+ import { CreateElicitationResponse } from "@agentclientprotocol/sdk";
2
+ import type { CreateElicitationRequest } from "@agentclientprotocol/sdk";
2
3
  import type { ElicitationRequest, ElicitationResult } from "@anthropic-ai/claude-agent-sdk";
3
4
  import type { AskUserQuestionInput } from "@anthropic-ai/claude-agent-sdk/sdk-tools.js";
4
5
  /**
@@ -51,7 +52,8 @@ export declare function extractAskUserQuestions(input: Record<string, unknown>):
51
52
  * question text, so the question text appears in exactly one place per field.
52
53
  * Single-select questions use a titled `oneOf` enum; multi-select questions use
53
54
  * an array with a titled `anyOf` item enum. The enum `const` is always the
54
- * option label, since that is what the tool records as the answer.
55
+ * option label, since that is what the tool records as the answer; an option's
56
+ * secondary text travels in the enum option's own `description` field.
55
57
  *
56
58
  * Each question is followed by its own optional free-text "custom answer" field
57
59
  * (`question_<n>_custom`), mirroring the CLI's per-question "Other" box: the
@@ -76,7 +78,53 @@ export type AskUserQuestionOutcome = {
76
78
  * custom-answer field (`question_<n>_custom`) takes precedence over that
77
79
  * question's selection, since the user typed their own answer instead of
78
80
  * picking one. Decline yields empty answers (the model is told the user skipped
79
- * rather than the turn aborting); cancel aborts the tool call.
81
+ * rather than the turn aborting); cancel — and any custom/future action we
82
+ * don't understand — aborts the tool call.
80
83
  */
81
84
  export declare function applyAskElicitationResponse(response: CreateElicitationResponse, toolInput: Record<string, unknown>, questions: AskUserQuestion[]): AskUserQuestionOutcome;
85
+ /**
86
+ * The `request_user_dialog` kind the CLI emits when a model refusal has a
87
+ * fallback available but needs user consent before retrying (e.g. Claude Fable
88
+ * declining a request with Opus available as the fallback). Declaring this
89
+ * kind in `supportedDialogKinds` is the opt-in: the CLI fails closed and never
90
+ * emits an undeclared kind — the flow degrades to the classic refusal error
91
+ * ending the turn.
92
+ */
93
+ export declare const REFUSAL_FALLBACK_DIALOG_KIND = "refusal_fallback_prompt";
94
+ /**
95
+ * Payload of the `refusal_fallback_prompt` dialog. The dialog protocol
96
+ * transports payloads opaquely, so this shape is recovered from the CLI's own
97
+ * schema (v2.1.177): `originalModel`/`fallbackModel` are required strings;
98
+ * `apiRefusalCategory` (nullable), `guidanceText`, and
99
+ * `retractedMessageUuids` are optional. We ignore `retractedMessageUuids` —
100
+ * ACP has no way to retract already-streamed chunks.
101
+ */
102
+ export type RefusalFallbackPrompt = {
103
+ originalModel: string;
104
+ fallbackModel: string;
105
+ apiRefusalCategory: string | null;
106
+ guidanceText?: string;
107
+ };
108
+ /**
109
+ * Validate the opaque dialog payload into a {@link RefusalFallbackPrompt}.
110
+ * Returns `null` when the required fields are missing or mistyped (a newer CLI
111
+ * may reshape the payload), so the caller can cancel the dialog and let the
112
+ * CLI apply its default behavior instead of rendering something misleading.
113
+ */
114
+ export declare function extractRefusalFallbackPrompt(payload: Record<string, unknown>): RefusalFallbackPrompt | null;
115
+ /**
116
+ * Render the refusal-fallback consent prompt as an ACP form elicitation: a
117
+ * single-select between retrying on the fallback model and keeping the
118
+ * refusal. The enum `const`s are the dialog's wire result values, so the
119
+ * response maps back without a translation table.
120
+ */
121
+ export declare function refusalFallbackToCreateRequest(prompt: RefusalFallbackPrompt, sessionId: string): CreateElicitationRequest;
122
+ /**
123
+ * Map the elicitation response back to the dialog's result enum. Only an
124
+ * explicit accept-with-retry resolves to `retry_fallback`; decline, cancel, a
125
+ * skipped field, or an unrecognized value all keep the refusal — the dialog's
126
+ * own default — so a dismissed or half-filled form can never trigger a model
127
+ * switch the user didn't ask for.
128
+ */
129
+ export declare function refusalFallbackResultFromResponse(response: CreateElicitationResponse): string;
82
130
  //# sourceMappingURL=elicitation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../src/elicit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,MAAM,EAAE,UAAU,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvF;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,yBAAyB,EACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,SAAS,EAAE,eAAe,EAAE,GAC3B,sBAAsB,CAkCxB;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,qBAAqB,GAAG,IAAI,CAW9B;AAYD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,GAChB,wBAAwB,CA+B1B;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,CAG7F"}
@@ -1,4 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
+ import { CreateElicitationResponse } from "@agentclientprotocol/sdk";
2
3
  /**
3
4
  * Convert an MCP elicitation request (from the SDK's `onElicitation` callback)
4
5
  * into an ACP `CreateElicitationRequest`. Returns `null` when the request can't
@@ -29,6 +30,17 @@ export function mcpElicitationToCreateRequest(request, sessionId) {
29
30
  requestedSchema: normalizeElicitationSchema(request.requestedSchema),
30
31
  };
31
32
  }
33
+ /**
34
+ * Content of an accepted elicitation response.
35
+ *
36
+ * Uses the SDK's validating guard rather than an `action === "accept"` check:
37
+ * the guard both narrows past the union's custom/future variant and validates
38
+ * the payload, so a malformed accept (right tag, ill-typed content) yields
39
+ * empty content — the same classification the SDK's wire validators apply.
40
+ */
41
+ function acceptedElicitationContent(response) {
42
+ return CreateElicitationResponse.isAccept(response) ? (response.content ?? {}) : {};
43
+ }
32
44
  /**
33
45
  * Map an ACP elicitation response back to the MCP `ElicitResult` the SDK expects
34
46
  * to hand back to the requesting server.
@@ -36,7 +48,7 @@ export function mcpElicitationToCreateRequest(request, sessionId) {
36
48
  export function createElicitationResponseToElicitResult(response) {
37
49
  switch (response.action) {
38
50
  case "accept":
39
- return { action: "accept", content: response.content ?? {} };
51
+ return { action: "accept", content: acceptedElicitationContent(response) };
40
52
  case "decline":
41
53
  return { action: "decline" };
42
54
  case "cancel":
@@ -71,26 +83,12 @@ function questionCustomFieldKey(index) {
71
83
  return `question_${index}_custom`;
72
84
  }
73
85
  /**
74
- * `_meta` key under which a bridged enum option carries its structured
75
- * `description`/`preview`, since ACP's `EnumOption` has no field for either.
76
- * Namespaced like the agent's other `_meta` extensions (`_claude/...`).
86
+ * `_meta` key under which a bridged enum option carries its `preview`, the one
87
+ * option field ACP's `EnumOption` still has no slot for (descriptions are
88
+ * first-class as of schema 1.19). Namespaced like the agent's other `_meta`
89
+ * extensions (`_claude/...`).
77
90
  */
78
91
  const OPTION_META_KEY = "_claude/askUserQuestionOption";
79
- /**
80
- * Build the `_meta` payload that carries an option's structured `description`
81
- * and optional `preview` for clients that can render them as distinct fields.
82
- * Returns `undefined` when neither is present, so we don't emit an empty `_meta`.
83
- */
84
- function askUserQuestionOptionMeta(option) {
85
- const detail = {};
86
- if (option.description) {
87
- detail.description = option.description;
88
- }
89
- if (option.preview) {
90
- detail.preview = option.preview;
91
- }
92
- return Object.keys(detail).length > 0 ? { [OPTION_META_KEY]: detail } : undefined;
93
- }
94
92
  /**
95
93
  * Render the AskUserQuestion tool's questions as an ACP form elicitation.
96
94
  *
@@ -98,7 +96,8 @@ function askUserQuestionOptionMeta(option) {
98
96
  * question text, so the question text appears in exactly one place per field.
99
97
  * Single-select questions use a titled `oneOf` enum; multi-select questions use
100
98
  * an array with a titled `anyOf` item enum. The enum `const` is always the
101
- * option label, since that is what the tool records as the answer.
99
+ * option label, since that is what the tool records as the answer; an option's
100
+ * secondary text travels in the enum option's own `description` field.
102
101
  *
103
102
  * Each question is followed by its own optional free-text "custom answer" field
104
103
  * (`question_<n>_custom`), mirroring the CLI's per-question "Other" box: the
@@ -113,19 +112,16 @@ export function askUserQuestionsToCreateRequest(questions, sessionId, toolCallId
113
112
  const options = question.options.map((option) => {
114
113
  const enumOption = {
115
114
  const: option.label,
116
- // `title` stays a flattened "label — description" string so clients that
117
- // only read `const`/`title` still surface the description. Clients that
118
- // understand the `_meta` below should prefer its structured fields (and
119
- // treat `const` as the clean label) rather than parsing this title.
120
- title: option.description ? `${option.label} — ${option.description}` : option.label,
115
+ title: option.label,
121
116
  };
122
- // The SDK option carries a `description` (secondary text) and an optional
123
- // `preview` (mockups, code snippets, comparisons shown on focus). Neither
124
- // has a structural slot in `EnumOption`, so forward them under ACP's
125
- // reserved `_meta` extension point for clients that can render them.
126
- const meta = askUserQuestionOptionMeta(option);
127
- if (meta) {
128
- enumOption._meta = meta;
117
+ if (option.description) {
118
+ enumOption.description = option.description;
119
+ }
120
+ // The SDK option's `preview` (mockups, code snippets, comparisons shown
121
+ // on focus) still has no structural slot in `EnumOption`, so forward it
122
+ // under ACP's reserved `_meta` extension point for clients that render it.
123
+ if (option.preview) {
124
+ enumOption._meta = { [OPTION_META_KEY]: { preview: option.preview } };
129
125
  }
130
126
  return enumOption;
131
127
  });
@@ -165,16 +161,17 @@ export function askUserQuestionsToCreateRequest(questions, sessionId, toolCallId
165
161
  * custom-answer field (`question_<n>_custom`) takes precedence over that
166
162
  * question's selection, since the user typed their own answer instead of
167
163
  * picking one. Decline yields empty answers (the model is told the user skipped
168
- * rather than the turn aborting); cancel aborts the tool call.
164
+ * rather than the turn aborting); cancel — and any custom/future action we
165
+ * don't understand — aborts the tool call.
169
166
  */
170
167
  export function applyAskElicitationResponse(response, toolInput, questions) {
171
- if (response.action === "cancel") {
172
- return { action: "cancel" };
173
- }
174
168
  if (response.action === "decline") {
175
169
  return { action: "answered", updatedInput: { ...toolInput, answers: {} } };
176
170
  }
177
- const content = response.content ?? {};
171
+ if (response.action !== "accept") {
172
+ return { action: "cancel" };
173
+ }
174
+ const content = acceptedElicitationContent(response);
178
175
  // Typed against the tool's own output schema so the answer/response shapes
179
176
  // stay in sync with what the built-in tool's call() expects to read back.
180
177
  const answers = {};
@@ -209,3 +206,86 @@ function normalizeElicitationSchema(schema) {
209
206
  }
210
207
  return { ...schema, type: "object" };
211
208
  }
209
+ /**
210
+ * The `request_user_dialog` kind the CLI emits when a model refusal has a
211
+ * fallback available but needs user consent before retrying (e.g. Claude Fable
212
+ * declining a request with Opus available as the fallback). Declaring this
213
+ * kind in `supportedDialogKinds` is the opt-in: the CLI fails closed and never
214
+ * emits an undeclared kind — the flow degrades to the classic refusal error
215
+ * ending the turn.
216
+ */
217
+ export const REFUSAL_FALLBACK_DIALOG_KIND = "refusal_fallback_prompt";
218
+ /**
219
+ * Validate the opaque dialog payload into a {@link RefusalFallbackPrompt}.
220
+ * Returns `null` when the required fields are missing or mistyped (a newer CLI
221
+ * may reshape the payload), so the caller can cancel the dialog and let the
222
+ * CLI apply its default behavior instead of rendering something misleading.
223
+ */
224
+ export function extractRefusalFallbackPrompt(payload) {
225
+ const { originalModel, fallbackModel, apiRefusalCategory, guidanceText } = payload;
226
+ if (typeof originalModel !== "string" || typeof fallbackModel !== "string") {
227
+ return null;
228
+ }
229
+ return {
230
+ originalModel,
231
+ fallbackModel,
232
+ apiRefusalCategory: typeof apiRefusalCategory === "string" ? apiRefusalCategory : null,
233
+ ...(typeof guidanceText === "string" && guidanceText ? { guidanceText } : {}),
234
+ };
235
+ }
236
+ /** Form-field key carrying the user's choice in the refusal-fallback form. */
237
+ const REFUSAL_FALLBACK_CHOICE_KEY = "choice";
238
+ /** Wire values of the dialog's result enum (CLI schema). `edit_prompt` is
239
+ * deliberately not offered: in the CLI it prefills the composer with the
240
+ * refused prompt for edit-and-retry, and ACP has no composer-prefill surface
241
+ * — the user can simply edit and resend on their own. */
242
+ const RETRY_FALLBACK_RESULT = "retry_fallback";
243
+ const KEEP_REFUSAL_RESULT = "cancelled";
244
+ /**
245
+ * Render the refusal-fallback consent prompt as an ACP form elicitation: a
246
+ * single-select between retrying on the fallback model and keeping the
247
+ * refusal. The enum `const`s are the dialog's wire result values, so the
248
+ * response maps back without a translation table.
249
+ */
250
+ export function refusalFallbackToCreateRequest(prompt, sessionId) {
251
+ const category = prompt.apiRefusalCategory ? ` (${prompt.apiRefusalCategory})` : "";
252
+ const guidance = prompt.guidanceText ? `\n\n${prompt.guidanceText}` : "";
253
+ return {
254
+ mode: "form",
255
+ sessionId,
256
+ message: `${prompt.originalModel} declined this request${category}. ` +
257
+ `Retry with ${prompt.fallbackModel}?` +
258
+ guidance,
259
+ requestedSchema: {
260
+ type: "object",
261
+ properties: {
262
+ [REFUSAL_FALLBACK_CHOICE_KEY]: {
263
+ type: "string",
264
+ oneOf: [
265
+ {
266
+ const: RETRY_FALLBACK_RESULT,
267
+ title: `Retry with ${prompt.fallbackModel}`,
268
+ description: `The session continues on ${prompt.fallbackModel}.`,
269
+ },
270
+ {
271
+ const: KEEP_REFUSAL_RESULT,
272
+ title: "Keep the refusal",
273
+ description: "You can send a new message.",
274
+ },
275
+ ],
276
+ },
277
+ },
278
+ },
279
+ };
280
+ }
281
+ /**
282
+ * Map the elicitation response back to the dialog's result enum. Only an
283
+ * explicit accept-with-retry resolves to `retry_fallback`; decline, cancel, a
284
+ * skipped field, or an unrecognized value all keep the refusal — the dialog's
285
+ * own default — so a dismissed or half-filled form can never trigger a model
286
+ * switch the user didn't ask for.
287
+ */
288
+ export function refusalFallbackResultFromResponse(response) {
289
+ const choice = acceptedElicitationContent(response)[REFUSAL_FALLBACK_CHOICE_KEY];
290
+ return choice === RETRY_FALLBACK_RESULT ? RETRY_FALLBACK_RESULT : KEEP_REFUSAL_RESULT;
291
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EASL,eAAe,EACf,gBAAgB,EAChB,eAAe,EAIhB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,oBAAoB,EAEpB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,yCAAyC,EAGzC,qCAAqC,EAGrC,kCAAkC,EAGlC,+CAA+C,EAI/C,wBAAwB,EACxB,kCAAkC,EAIlC,gCAAgC,EAEhC,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA0BxC,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE;YACd,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,eAAe,CAAC,EAAE;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,aAAa,CAAC,EAAE;YACd,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I,CAiB1F;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,CAMpE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnD;AAeD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,OAAO,GAAG;IACrE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC,CAoCA;AAcD,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,wBAEG;IACD,iBAAiB,CAAC,EAAE,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,SAKF,CAAC;AAGF,eAAO,MAAM,qBAAqB,GAE9B,SAAQ,MAAgB,EACxB,UAAU;IACR,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC,KACA,YAoBF,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACxB,SAAS;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAsBpE,CAAC"}
package/dist/tools.js CHANGED
@@ -234,6 +234,23 @@ export function toolInfoFromToolUse(toolUse, supportsTerminalOutput = false, cwd
234
234
  content: [],
235
235
  };
236
236
  }
237
+ case "ReportFindings": {
238
+ const input = toolUse.input;
239
+ const findings = input?.findings ?? [];
240
+ return {
241
+ title: findings.length === 0
242
+ ? "Report findings: none found"
243
+ : `Report ${findings.length} finding${findings.length === 1 ? "" : "s"}`,
244
+ kind: "think",
245
+ content: findings.map((finding) => ({
246
+ type: "content",
247
+ content: {
248
+ type: "text",
249
+ text: `**${finding.file}${finding.line ? `:${finding.line}` : ""}** — ${finding.summary}`,
250
+ },
251
+ })),
252
+ };
253
+ }
237
254
  case "TaskCreate": {
238
255
  const input = toolUse.input;
239
256
  return {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.53.0",
6
+ "version": "0.57.0-beta.2",
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",
@@ -63,23 +63,23 @@
63
63
  "node": ">=22"
64
64
  },
65
65
  "dependencies": {
66
- "@agentclientprotocol/sdk": "1.0.0",
67
- "@anthropic-ai/claude-agent-sdk": "0.3.191",
66
+ "@agentclientprotocol/sdk": "1.2.1",
67
+ "@anthropic-ai/claude-agent-sdk": "0.3.202",
68
68
  "zod": "^3.25.0 || ^4.0.0"
69
69
  },
70
70
  "devDependencies": {
71
- "@anthropic-ai/sdk": "0.106.0",
71
+ "@anthropic-ai/sdk": "0.110.0",
72
72
  "@eslint/js": "10.0.1",
73
73
  "@tsconfig/node22": "22.0.5",
74
- "@types/node": "26.0.1",
75
- "@typescript-eslint/eslint-plugin": "8.62.0",
76
- "@typescript-eslint/parser": "8.62.0",
77
- "eslint": "10.5.0",
74
+ "@types/node": "26.1.0",
75
+ "@typescript-eslint/eslint-plugin": "8.63.0",
76
+ "@typescript-eslint/parser": "8.63.0",
77
+ "eslint": "10.6.0",
78
78
  "eslint-config-prettier": "10.1.8",
79
79
  "globals": "17.7.0",
80
- "prettier": "3.8.4",
80
+ "prettier": "3.9.4",
81
81
  "ts-node": "10.9.2",
82
82
  "typescript": "6.0.3",
83
- "vitest": "4.1.9"
83
+ "vitest": "4.1.10"
84
84
  }
85
85
  }