@cabane/companion 0.6.17 → 0.6.18

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
@@ -7199,7 +7199,12 @@ var Dispatcher = class {
7199
7199
  // clear is durable (CT93 outbox, last-writer-wins per pair), so a terminal
7200
7200
  // failure here just logs and the server age-sweep backstops it.
7201
7201
  async concludeBeforeRun(payload, turnLog, startedAt, reason, errorReason) {
7202
- const body = { activeRunStartedAt: null };
7202
+ const body = {
7203
+ activeRunStartedAt: null,
7204
+ // CT1046: this dispatch is over before it ran — retire its evidence so it
7205
+ // can't authorize a turn-token mint afterwards.
7206
+ settledMessageId: payload.messageId
7207
+ };
7203
7208
  if (errorReason) body.errorReason = errorReason.slice(0, 200);
7204
7209
  try {
7205
7210
  await this.opts.api.setActiveRun(
@@ -7959,7 +7964,12 @@ ${reason}`,
7959
7964
  // CT277: the server keys the turn-end metadata UPDATE (ended_at + tokens)
7960
7965
  // off this turn id, so the settle PATCH must carry it — the start PATCH
7961
7966
  // isn't enough. Always sent (every settle closes a real turn).
7962
- turnId
7967
+ turnId,
7968
+ // CT1046: and the trigger this turn answered, so the server retires the
7969
+ // dispatch that authorized it. Always sent, unlike `lastSeenMessageId`
7970
+ // below (which is a success-only catch-up advance): a failed or cancelled
7971
+ // turn is just as over, and its evidence must die with it.
7972
+ settledMessageId: payload.messageId
7963
7973
  };
7964
7974
  if (turnUsage) {
7965
7975
  body.usage = turnUsage;
package/dist/runtime.js CHANGED
@@ -6852,7 +6852,12 @@ var Dispatcher = class {
6852
6852
  // clear is durable (CT93 outbox, last-writer-wins per pair), so a terminal
6853
6853
  // failure here just logs and the server age-sweep backstops it.
6854
6854
  async concludeBeforeRun(payload, turnLog, startedAt, reason, errorReason) {
6855
- const body = { activeRunStartedAt: null };
6855
+ const body = {
6856
+ activeRunStartedAt: null,
6857
+ // CT1046: this dispatch is over before it ran — retire its evidence so it
6858
+ // can't authorize a turn-token mint afterwards.
6859
+ settledMessageId: payload.messageId
6860
+ };
6856
6861
  if (errorReason) body.errorReason = errorReason.slice(0, 200);
6857
6862
  try {
6858
6863
  await this.opts.api.setActiveRun(
@@ -7612,7 +7617,12 @@ ${reason}`,
7612
7617
  // CT277: the server keys the turn-end metadata UPDATE (ended_at + tokens)
7613
7618
  // off this turn id, so the settle PATCH must carry it — the start PATCH
7614
7619
  // isn't enough. Always sent (every settle closes a real turn).
7615
- turnId
7620
+ turnId,
7621
+ // CT1046: and the trigger this turn answered, so the server retires the
7622
+ // dispatch that authorized it. Always sent, unlike `lastSeenMessageId`
7623
+ // below (which is a success-only catch-up advance): a failed or cancelled
7624
+ // turn is just as over, and its evidence must die with it.
7625
+ settledMessageId: payload.messageId
7616
7626
  };
7617
7627
  if (turnUsage) {
7618
7628
  body.usage = turnUsage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/companion",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
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",