@agentclientprotocol/claude-agent-acp 0.107.4-preview.1 → 0.107.4-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,15 @@ import { BetaBashCodeExecutionResultBlock, BetaBashCodeExecutionToolResultBlockP
6
6
  * These are transformed to valid ACP ContentBlock types by toValidAcpContent().
7
7
  */
8
8
  export type ToolResultContent = TextBlockParam | DocumentBlockParam | ImageBlockParam | BetaImageBlockParam | BetaToolReferenceBlock | BetaToolSearchToolSearchResultBlock | BetaToolSearchToolResultError | WebSearchResultBlock | WebSearchToolResultError | BetaWebFetchBlock | BetaWebFetchToolResultErrorBlock | BetaCodeExecutionResultBlock | BetaCodeExecutionToolResultError | BetaBashCodeExecutionResultBlock | BetaBashCodeExecutionToolResultError | BetaTextEditorCodeExecutionViewResultBlock | BetaTextEditorCodeExecutionCreateResultBlock | BetaTextEditorCodeExecutionStrReplaceResultBlock | BetaTextEditorCodeExecutionToolResultError;
9
+ /**
10
+ * The field `key` of a tool's input when it holds a non-empty string.
11
+ *
12
+ * The input is what the model wrote. Claude Code validates it when it runs the
13
+ * tool, after the adapter reported the tool use, so a field can hold any type:
14
+ * `Read {"file_path": 12345}`. A reporter must not pass such a value on as a
15
+ * path or a title.
16
+ */
17
+ export declare function inputString(input: unknown, key: string): string | undefined;
9
18
  /**
10
19
  * Convert an absolute file path to a project-relative path for display.
11
20
  * Returns the original path if it's outside the project directory or if no cwd is provided.
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/tool-calls/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,E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CAQnD;AAED,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,wBAAwB,GACxB,iCAAiC,GACjC,gCAAgC,GAChC,6BAA6B,GAC7B,qCAAqC,GACrC,yCAAyC,GACzC,+CAA+C,GAC/C,kCAAkC,GAClC,kCAAkC,CAAC;AAEvC,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAEzD;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,GAAG;IACpF,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B,CAEA;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,OAAO,GACpB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAUpD"}
@@ -1,4 +1,18 @@
1
1
  import path from "node:path";
2
+ /**
3
+ * The field `key` of a tool's input when it holds a non-empty string.
4
+ *
5
+ * The input is what the model wrote. Claude Code validates it when it runs the
6
+ * tool, after the adapter reported the tool use, so a field can hold any type:
7
+ * `Read {"file_path": 12345}`. A reporter must not pass such a value on as a
8
+ * path or a title.
9
+ */
10
+ export function inputString(input, key) {
11
+ if (!input || typeof input !== "object")
12
+ return undefined;
13
+ const value = input[key];
14
+ return typeof value === "string" && value !== "" ? value : undefined;
15
+ }
2
16
  /**
3
17
  * Convert an absolute file path to a project-relative path for display.
4
18
  * Returns the original path if it's outside the project directory or if no cwd is provided.
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/bash.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKnE;AAED,gFAAgF;AAChF,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;IAWrC,iFAAiF;IACjF,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,GAAG,SAAS;IAIpE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,eAAe;CAsFvE"}
1
+ {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/bash.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKnE;AAED,gFAAgF;AAChF,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;IAUrC,iFAAiF;IACjF,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,GAAG,SAAS;IAIpE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,eAAe;CAsFvE"}
@@ -1,4 +1,4 @@
1
- import { structuredResult, textContent, toAcpContentUpdate } from "../content.js";
1
+ import { inputString, structuredResult, textContent, toAcpContentUpdate } from "../content.js";
2
2
  /**
3
3
  * Reads a Bash or PowerShell input's description the way the CLI validates it.
4
4
  * Since CLI 2.1.295 the CLI accepts `command_description` for `description`.
@@ -16,10 +16,9 @@ export function shellDescription(input) {
16
16
  /** Bash and PowerShell: a command whose output goes to the terminal channel. */
17
17
  export class BashReporter {
18
18
  toolUse(input) {
19
- const bash = input;
20
19
  const description = shellDescription(input);
21
20
  return {
22
- title: bash?.command ? bash.command : "Terminal",
21
+ title: inputString(input, "command") ?? "Terminal",
23
22
  kind: "execute",
24
23
  command: true,
25
24
  ...(description ? { display: [textContent(description)] } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"file-edit.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/file-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAEf,MAAM,6CAA6C,CAAC;AAQrD,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,qBAAa,aAAc,YAAW,YAAY;IAChD,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,YAAY;IAoCpF,UAAU,IAAI,eAAe;IAI7B,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;CAGrF;AAED,yFAAyF;AACzF,KAAK,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAI9E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,GAAG,SAAS,CAYpF;AAED,qDAAqD;AACrD,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,cAAc,GAAG,YAAY;IA0B5E,UAAU,IAAI,eAAe;IAI7B,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;CAGrF;AAyCD;;;;;;;GAOG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACvD,OAAO,CAAC,KAAK,E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E,OAAO,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,cAAc,GAAG,YAAY;IAqB5E;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe;CAMxD"}
@@ -1,5 +1,5 @@
1
1
  import { patchUpdateFromDiffToolResponse, toolUpdateFromDiffToolResponse, v2UpdateFromDiffToolResponse, } from "../../diff.js";
2
- import { markdownEscape, resultText, textContent, toDisplayPath } from "../content.js";
2
+ import { inputString, markdownEscape, resultText, textContent, toDisplayPath } from "../content.js";
3
3
  /**
4
4
  * Write: the diff holds the file text. The PostToolUse hook sends the final
5
5
  * diff, so the result text is only a confirmation.
@@ -73,21 +73,22 @@ export function normalizeWriteInput(input) {
73
73
  export class EditReporter {
74
74
  toolUse(input, { cwd, capabilities }) {
75
75
  const edit = input;
76
- const displayPath = edit?.file_path ? toDisplayPath(edit.file_path, cwd) : undefined;
76
+ const filePath = inputString(input, "file_path");
77
+ const displayPath = filePath ? toDisplayPath(filePath, cwd) : undefined;
77
78
  const facts = {
78
79
  title: displayPath ? `Edit ${displayPath}` : "Edit",
79
80
  kind: "edit",
80
- locations: edit?.file_path ? [{ path: edit.file_path }] : [],
81
+ locations: filePath ? [{ path: filePath }] : [],
81
82
  };
82
83
  // The standard diff, also for a client that negotiated patches: the input
83
84
  // holds a snippet, not the file, so a patch would need line numbers that
84
85
  // the adapter does not know here. A v2 diff cannot hold a snippet, so a v2
85
86
  // client gets the patch from the PostToolUse hook alone.
86
- if (edit?.file_path && (edit.old_string || edit.new_string) && !capabilities.v2) {
87
+ if (filePath && (edit?.old_string || edit?.new_string) && !capabilities.v2) {
87
88
  facts.change = [
88
89
  {
89
90
  type: "diff",
90
- path: edit.file_path,
91
+ path: filePath,
91
92
  oldText: edit.old_string || null,
92
93
  newText: edit.new_string ?? "",
93
94
  },
@@ -151,9 +152,8 @@ export class NotebookEditReporter {
151
152
  if (!capabilities.air.client)
152
153
  return { title: "NotebookEdit", kind: "other" };
153
154
  const notebook = input;
154
- const displayPath = notebook?.notebook_path
155
- ? toDisplayPath(notebook.notebook_path, cwd)
156
- : undefined;
155
+ const notebookPath = inputString(input, "notebook_path");
156
+ const displayPath = notebookPath ? toDisplayPath(notebookPath, cwd) : undefined;
157
157
  const cell = notebook?.cell_id ? ` ${notebook.cell_id}` : "";
158
158
  const verb = notebook?.edit_mode === "insert"
159
159
  ? "Insert"
@@ -164,7 +164,7 @@ export class NotebookEditReporter {
164
164
  return {
165
165
  title: displayPath ? `${verb} cell${cell} in ${displayPath}` : "Edit notebook",
166
166
  kind: "edit",
167
- locations: notebook?.notebook_path ? [{ path: notebook.notebook_path }] : [],
167
+ locations: notebookPath ? [{ path: notebookPath }] : [],
168
168
  ...(source ? { display: source } : {}),
169
169
  };
170
170
  }
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/read.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,iDAAiD;AACjD,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,YAAY;IAoB9D,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,eAAe;CAiDhF"}
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/read.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,iDAAiD;AACjD,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,YAAY;IAmB9D,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,eAAe;CAiDhF"}
@@ -1,8 +1,9 @@
1
- import { markdownEscape, structuredResult, textContent, toAcpContentBlock, toDisplayPath, } from "../content.js";
1
+ import { inputString, markdownEscape, structuredResult, textContent, toAcpContentBlock, toDisplayPath, } from "../content.js";
2
2
  /** Read: the file text is the result to show. */
3
3
  export class ReadReporter {
4
4
  toolUse(input, { cwd }) {
5
5
  const read = input;
6
+ const filePath = inputString(input, "file_path");
6
7
  let limit = "";
7
8
  if (read?.limit && read.limit > 0) {
8
9
  limit = " (" + (read.offset ?? 1) + " - " + ((read.offset ?? 1) + read.limit - 1) + ")";
@@ -10,15 +11,13 @@ export class ReadReporter {
10
11
  else if (read?.offset) {
11
12
  limit = " (from line " + read.offset + ")";
12
13
  }
13
- const displayPath = read?.file_path ? toDisplayPath(read.file_path, cwd) : "File";
14
+ const displayPath = filePath ? toDisplayPath(filePath, cwd) : "File";
14
15
  return {
15
16
  title: "Read " + displayPath + limit,
16
17
  kind: "read",
17
18
  // Read offsets are 1-based. ACP lines are too, so `offset: 0` (read from
18
19
  // the start) becomes line 1.
19
- locations: read?.file_path
20
- ? [{ path: read.file_path, line: Math.max(read.offset ?? 1, 1) }]
21
- : [],
20
+ locations: filePath ? [{ path: filePath, line: Math.max(read?.offset ?? 1, 1) }] : [],
22
21
  };
23
22
  }
24
23
  toolResult({ toolUse, result, structured }) {
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D,iDAAiD;AACjD,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;CAWtC;AAED,2DAA2D;AAC3D,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;CAoBtC;AAgBD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAK3D"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/tool-calls/reporters/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D,iDAAiD;AACjD,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;CAYtC;AAED,2DAA2D;AAC3D,qBAAa,YAAa,YAAW,YAAY;IAC/C,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;CAoBtC;AAgBD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAK3D"}
@@ -1,16 +1,18 @@
1
+ import { inputString } from "../content.js";
1
2
  /** Glob: the file list is the result to show. */
2
3
  export class GlobReporter {
3
4
  toolUse(input) {
4
5
  const glob = input;
6
+ const searchPath = inputString(input, "path");
5
7
  let label = "Find";
6
- if (glob?.path)
7
- label += ` \`${glob.path}\``;
8
+ if (searchPath)
9
+ label += ` \`${searchPath}\``;
8
10
  if (glob?.pattern)
9
11
  label += ` \`${glob.pattern}\``;
10
12
  return {
11
13
  title: label,
12
14
  kind: "search",
13
- locations: glob?.path ? [{ path: glob.path }] : [],
15
+ locations: searchPath ? [{ path: searchPath }] : [],
14
16
  };
15
17
  }
16
18
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.107.4-preview.1",
6
+ "version": "0.107.4-preview.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",