@cabane/companion 0.6.153 → 0.6.154

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.
package/dist/cli.js CHANGED
@@ -10232,6 +10232,23 @@ var init_dispatcher = __esm({
10232
10232
  }
10233
10233
  return true;
10234
10234
  }
10235
+ // Abort every run in flight in THIS process, whatever its conversation. For
10236
+ // an agent taken off this device: nothing it is still running here is
10237
+ // legitimate, and a cancel frame that arrives after it is dropped from the
10238
+ // roster finds no dispatcher to reach. True if any was aborted.
10239
+ cancelAll() {
10240
+ let aborted = false;
10241
+ for (const pair2 of this.aborts.values()) {
10242
+ for (const ac of [...pair2.values()]) {
10243
+ try {
10244
+ ac.abort();
10245
+ aborted = true;
10246
+ } catch {
10247
+ }
10248
+ }
10249
+ }
10250
+ return aborted;
10251
+ }
10235
10252
  };
10236
10253
  }
10237
10254
  });
@@ -15738,6 +15755,12 @@ var CompanionSupervisor = class {
15738
15755
  removeAgent(wr, agentId) {
15739
15756
  const runner = wr.agents.get(agentId);
15740
15757
  if (!runner) return;
15758
+ if (runner.dispatcher.cancelAll()) {
15759
+ this.log.info(
15760
+ { workspaceId: wr.workspaceId, agentId },
15761
+ `Stopped ${runner.displayName}'s running turns (no longer on this device)`
15762
+ );
15763
+ }
15741
15764
  runner.cancelDrain();
15742
15765
  wr.agents.delete(agentId);
15743
15766
  this.hub.removeAgent(wr.workspaceId, agentId);
package/dist/runtime.js CHANGED
@@ -11196,6 +11196,23 @@ var Dispatcher = class {
11196
11196
  }
11197
11197
  return true;
11198
11198
  }
11199
+ // Abort every run in flight in THIS process, whatever its conversation. For
11200
+ // an agent taken off this device: nothing it is still running here is
11201
+ // legitimate, and a cancel frame that arrives after it is dropped from the
11202
+ // roster finds no dispatcher to reach. True if any was aborted.
11203
+ cancelAll() {
11204
+ let aborted = false;
11205
+ for (const pair of this.aborts.values()) {
11206
+ for (const ac of [...pair.values()]) {
11207
+ try {
11208
+ ac.abort();
11209
+ aborted = true;
11210
+ } catch {
11211
+ }
11212
+ }
11213
+ }
11214
+ return aborted;
11215
+ }
11199
11216
  };
11200
11217
 
11201
11218
  // src/providers/local-process.ts
@@ -13612,6 +13629,12 @@ var CompanionSupervisor = class {
13612
13629
  removeAgent(wr, agentId) {
13613
13630
  const runner = wr.agents.get(agentId);
13614
13631
  if (!runner) return;
13632
+ if (runner.dispatcher.cancelAll()) {
13633
+ this.log.info(
13634
+ { workspaceId: wr.workspaceId, agentId },
13635
+ `Stopped ${runner.displayName}'s running turns (no longer on this device)`
13636
+ );
13637
+ }
13615
13638
  runner.cancelDrain();
13616
13639
  wr.agents.delete(agentId);
13617
13640
  this.hub.removeAgent(wr.workspaceId, agentId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/companion",
3
- "version": "0.6.153",
3
+ "version": "0.6.154",
4
4
  "type": "module",
5
5
  "description": "The Cabane Companion (headless): connect a coding agent on your machine to your Cabane workspace as a responder — drive work against your own codebase, files, and MCP servers without putting any of it in Cabane.",
6
6
  "license": "UNLICENSED",