@agentclientprotocol/claude-agent-acp 0.99.2-preview.10 → 0.99.2-preview.12

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":"terminal.d.ts","sourceRoot":"","sources":["../../src/v2/terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,KAAK,EAAE,MAAM,mDAAmD,CAAC;AAE7E,KAAK,gBAAgB,GACjB,CAAC,QAAQ,GAAG;IAAE,aAAa,EAAE,WAAW,CAAA;CAAE,CAAC,GAC3C,CAAC,cAAc,GAAG;IAAE,aAAa,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAAC;AAiB7D,0EAA0E;AAC1E,qBAAa,WAAW;IACtB,oGAAoG;IACpG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+D;IAEvF;;;;;;;;OAQG;IACH,KAAK,CACH,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,GACvB;QAAE,QAAQ,EAAE,EAAE,CAAC,aAAa,EAAE,CAAC;QAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAA;KAAE;IAuCzE,0CAA0C;IAC1C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAKhC"}
1
+ {"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/v2/terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,KAAK,EAAE,MAAM,mDAAmD,CAAC;AAE7E,KAAK,gBAAgB,GACjB,CAAC,QAAQ,GAAG;IAAE,aAAa,EAAE,WAAW,CAAA;CAAE,CAAC,GAC3C,CAAC,cAAc,GAAG;IAAE,aAAa,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAAC;AAiB7D,0EAA0E;AAC1E,qBAAa,WAAW;IACtB,oGAAoG;IACpG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAGpB;IAEJ;;;;;;;;OAQG;IACH,KAAK,CACH,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,GACvB;QAAE,QAAQ,EAAE,EAAE,CAAC,aAAa,EAAE,CAAC;QAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAA;KAAE;IAyCzE;;;;;;OAMG;IACH,eAAe,CACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,UAAQ,GACZ,EAAE,CAAC,aAAa,GAAG,SAAS;IAa/B,0CAA0C;IAC1C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAKhC"}
@@ -42,6 +42,8 @@ export class V2Terminals {
42
42
  ...(exit.exit_code != null ? { exitCode: exit.exit_code } : {}),
43
43
  ...(exit.signal != null ? { signal: exit.signal } : {}),
44
44
  },
45
+ // An exited terminal can no longer be cancelled.
46
+ ...(running.cancellable ? { capabilities: null } : {}),
45
47
  }
46
48
  : {}),
47
49
  });
@@ -58,6 +60,26 @@ export class V2Terminals {
58
60
  }
59
61
  return { terminal, report: withoutTerminalKeys(report) };
60
62
  }
63
+ /**
64
+ * The `terminal_update` that lets the client cancel the running terminal
65
+ * `terminalId` of the session `sessionId` with `terminal/cancel`, with its
66
+ * command, or undefined when the terminal is not running. `again` sends it
67
+ * also when the terminal advertises the capability already, as the current
68
+ * state of the terminal.
69
+ */
70
+ advertiseCancel(sessionId, terminalId, again = false) {
71
+ // The agent names a command's terminal after its tool call.
72
+ const running = this.running.get(`${sessionId} ${terminalId}`);
73
+ if (!running || (running.cancellable && !again))
74
+ return undefined;
75
+ running.cancellable = true;
76
+ return {
77
+ sessionUpdate: "terminal_update",
78
+ terminalId,
79
+ ...(running.command !== undefined ? { command: running.command } : {}),
80
+ capabilities: { cancel: {} },
81
+ };
82
+ }
61
83
  /** Forgets the terminals of a session. */
62
84
  forget(sessionId) {
63
85
  for (const key of this.running.keys()) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.99.2-preview.10",
6
+ "version": "0.99.2-preview.12",
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",
@@ -65,7 +65,7 @@
65
65
  "node": ">=22"
66
66
  },
67
67
  "dependencies": {
68
- "@agentclientprotocol/sdk": "2.2.0",
68
+ "@agentclientprotocol/sdk": "2.4.0",
69
69
  "@anthropic-ai/claude-agent-sdk": "0.3.316",
70
70
  "diff": "9.0.0",
71
71
  "zod": "4.6.7"