@agentclientprotocol/claude-agent-acp 0.85.2-preview.21 → 0.85.2-preview.23

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.
@@ -14,8 +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 does not advertise the unstable `providers` methods, which the v2
18
- * surface does not serve yet.
17
+ * It does not advertise what the v2 surface does not serve yet: the unstable
18
+ * `providers` methods, and the extensions of {@link UNSERVED_EXTENSION_KEYS}.
19
19
  */
20
20
  export declare function v2InitializeResponse(response: InitializeResponse): v2.InitializeResponse;
21
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;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAiBxF"}
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,CA0BpF;AASD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAoBxF"}
@@ -20,10 +20,12 @@ export function v1InitializeRequest(request) {
20
20
  // reads, writes, and runs commands itself.
21
21
  fs: { readTextFile: false, writeTextFile: false },
22
22
  terminal: false,
23
- // Every v2 client handles boolean config options and notices; v1 asks
24
- // for a marker. With notices, the agent reports advisories as notices
25
- // rather than as transcript messages.
26
- session: { configOptions: { boolean: {} }, notices: {} },
23
+ // Every v2 client handles boolean config options, notices, and
24
+ // compaction updates; v1 asks for a marker. With them, the agent reports
25
+ // advisories as notices rather than as transcript messages, and a
26
+ // compaction as a compaction entity rather than as a "Compact
27
+ // conversation" tool call, also on replay.
28
+ session: { configOptions: { boolean: {} }, notices: {}, compaction: {} },
27
29
  // v1 marks terminal auth support with a boolean, v2 with an object.
28
30
  auth: {
29
31
  terminal: capabilities?.auth?.terminal != null,
@@ -35,17 +37,24 @@ export function v1InitializeRequest(request) {
35
37
  ...(request._meta != null ? { _meta: request._meta } : {}),
36
38
  };
37
39
  }
40
+ /**
41
+ * The top-level `_meta` keys of the agent's v1 `initialize` response that
42
+ * advertise an extension the v2 surface does not serve yet: `steering`, for
43
+ * `_session/steering`.
44
+ */
45
+ const UNSERVED_EXTENSION_KEYS = ["steering"];
38
46
  /**
39
47
  * The v2 `initialize` response for the v1 response of the agent.
40
48
  *
41
- * It does not advertise the unstable `providers` methods, which the v2
42
- * surface does not serve yet.
49
+ * It does not advertise what the v2 surface does not serve yet: the unstable
50
+ * `providers` methods, and the extensions of {@link UNSERVED_EXTENSION_KEYS}.
43
51
  */
44
52
  export function v2InitializeResponse(response) {
45
53
  if (!response.agentInfo) {
46
54
  throw new Error("ACP v2 requires agentInfo, and the agent reported none");
47
55
  }
48
56
  const meta = response.agentCapabilities?._meta;
57
+ const topMeta = Object.fromEntries(Object.entries(response._meta ?? {}).filter(([key]) => !UNSERVED_EXTENSION_KEYS.includes(key)));
49
58
  return {
50
59
  protocolVersion: v2.PROTOCOL_VERSION,
51
60
  info: response.agentInfo,
@@ -56,7 +65,7 @@ export function v2InitializeResponse(response) {
56
65
  ...(meta != null ? { _meta: meta } : {}),
57
66
  },
58
67
  authMethods: (response.authMethods ?? []).map(v2AuthMethod),
59
- ...(response._meta != null ? { _meta: response._meta } : {}),
68
+ ...(Object.keys(topMeta).length > 0 ? { _meta: topMeta } : {}),
60
69
  };
61
70
  }
62
71
  /**
@@ -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;AAIlE;;;;GAIG;AACH,eAAO,MAAM,eAAe,SAAS,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GACvC,EAAE,CAAC,aAAa,GAAG,SAAS,CAwC9B"}
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;AAIlE;;;;GAIG;AACH,eAAO,MAAM,eAAe,SAAS,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GACvC,EAAE,CAAC,aAAa,GAAG,SAAS,CA0C9B"}
@@ -22,6 +22,8 @@ export function v2SessionUpdate(update) {
22
22
  case "session_info_update":
23
23
  case "usage_update":
24
24
  case "notice":
25
+ case "compaction_update":
26
+ case "compaction_summary_chunk":
25
27
  return update;
26
28
  case "agent_message_chunk":
27
29
  case "agent_thought_chunk":
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.85.2-preview.21",
6
+ "version": "0.85.2-preview.23",
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",