@agentclientprotocol/claude-agent-acp 0.85.2-preview.14 → 0.85.2-preview.16

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 +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;IAkCpF,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,EA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,OAAO,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,cAAc,GAAG,YAAY;IAsB5E;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe;CAMxD"}
@@ -19,8 +19,10 @@ export class WriteReporter {
19
19
  // whether the file exists, so the live tool call shows no diff: a diff
20
20
  // without the old text would claim a creation. The adapter reads the
21
21
  // file only for the preview. A replay has no preview and no hook, so it
22
- // keeps the diff.
23
- if (!(capabilities.diffPatch || capabilities.v2) || replay) {
22
+ // keeps the diff, except for a v2 client: a v2 diff names the operation,
23
+ // which the input does not tell.
24
+ const inputDiff = capabilities.v2 ? false : !capabilities.diffPatch || replay;
25
+ if (inputDiff) {
24
26
  facts.change = [
25
27
  {
26
28
  type: "diff",
@@ -14,11 +14,8 @@ export declare function v1InitializeRequest(request: v2.InitializeRequest): Init
14
14
  /**
15
15
  * The v2 `initialize` response for the v1 response of the agent.
16
16
  *
17
- * It advertises no `session` capability yet. A v2 agent that advertises
18
- * `session` must serve the whole session baseline (`session/new`, `list`,
19
- * `resume`, `close`, `prompt`, `cancel`, and `update`), and the v2 surface of
20
- * the adapter does not serve it yet. Nor does it advertise the unstable
21
- * `providers` methods, which the v2 surface does not serve yet either.
17
+ * It does not advertise the unstable `providers` methods, which the v2
18
+ * surface does not serve yet.
22
19
  */
23
20
  export declare function v2InitializeResponse(response: InitializeResponse): v2.InitializeResponse;
24
21
  //# sourceMappingURL=initialize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/v2/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAE/D,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,GAAG,iBAAiB,CAwBpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAcxF"}
1
+ {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/v2/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,0CAA0C,CAAC;AAE/D,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,GAAG,iBAAiB,CAwBpF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAiBxF"}
@@ -38,11 +38,8 @@ export function v1InitializeRequest(request) {
38
38
  /**
39
39
  * The v2 `initialize` response for the v1 response of the agent.
40
40
  *
41
- * It advertises no `session` capability yet. A v2 agent that advertises
42
- * `session` must serve the whole session baseline (`session/new`, `list`,
43
- * `resume`, `close`, `prompt`, `cancel`, and `update`), and the v2 surface of
44
- * the adapter does not serve it yet. Nor does it advertise the unstable
45
- * `providers` methods, which the v2 surface does not serve yet either.
41
+ * It does not advertise the unstable `providers` methods, which the v2
42
+ * surface does not serve yet.
46
43
  */
47
44
  export function v2InitializeResponse(response) {
48
45
  if (!response.agentInfo) {
@@ -54,11 +51,31 @@ export function v2InitializeResponse(response) {
54
51
  info: response.agentInfo,
55
52
  // v1 `auth.logout` has no v2 counterpart: a v2 agent that advertises auth
56
53
  // methods must serve `auth/logout`.
57
- capabilities: meta != null ? { _meta: meta } : {},
54
+ capabilities: {
55
+ session: V2_SESSION_CAPABILITIES,
56
+ ...(meta != null ? { _meta: meta } : {}),
57
+ },
58
58
  authMethods: (response.authMethods ?? []).map(v2AuthMethod),
59
59
  ...(response._meta != null ? { _meta: response._meta } : {}),
60
60
  };
61
61
  }
62
+ /**
63
+ * The session capabilities of the v2 surface, which serves each through a v1
64
+ * method of the agent.
65
+ *
66
+ * - The session baseline: `session/new`, `list`, `resume` (with replay),
67
+ * `close`, `prompt`, `cancel`, and `update`.
68
+ * - `session/delete` and `additionalDirectories`. Not `session/fork` yet.
69
+ * - The prompt content and MCP transports that the agent's v1 `initialize`
70
+ * lists: images, embedded context, and HTTP servers. Stdio servers are in the
71
+ * v1 baseline; v2 has no SSE transport.
72
+ */
73
+ const V2_SESSION_CAPABILITIES = {
74
+ prompt: { image: {}, embeddedContext: {} },
75
+ mcp: { stdio: {}, http: {} },
76
+ delete: {},
77
+ additionalDirectories: {},
78
+ };
62
79
  /** v2 names the id of a method `methodId`, requires `type`, and lists `env` as name and value pairs. */
63
80
  function v2AuthMethod(method) {
64
81
  if ("type" in method && method.type === "terminal") {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.85.2-preview.14",
6
+ "version": "0.85.2-preview.16",
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",