@cabane/companion 0.6.109 → 0.6.111

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
@@ -3114,8 +3114,11 @@ var CabaneApi = class {
3114
3114
  // from the start of the conversation, the agent's own words included, and
3115
3115
  // the first-turn material — what the adapter runs on when it refused to
3116
3116
  // resume the stored session and is starting a fresh one.
3117
- getTurnContext(conversationId, messageId2, turnId, resumed, fresh) {
3118
- const q = `conversationId=${encodeURIComponent(conversationId)}&messageId=${encodeURIComponent(messageId2)}` + (turnId ? `&turnId=${encodeURIComponent(turnId)}` : "") + (resumed ? "&resumed=1" : "") + (fresh ? "&fresh=1" : "");
3117
+ // CT1543: `episode` is the dispatch event's own, echoed back so the server can
3118
+ // tell this frame from a later wake on the same message. Omitted when the
3119
+ // event didn't carry one, which is the only thing an older event can mean.
3120
+ getTurnContext(conversationId, messageId2, turnId, resumed, fresh, episode) {
3121
+ const q = `conversationId=${encodeURIComponent(conversationId)}&messageId=${encodeURIComponent(messageId2)}` + (turnId ? `&turnId=${encodeURIComponent(turnId)}` : "") + (resumed ? "&resumed=1" : "") + (fresh ? "&fresh=1" : "") + (episode !== void 0 ? `&episode=${encodeURIComponent(String(episode))}` : "");
3119
3122
  return this.request("GET", `/api/agent/turn-context?${q}`);
3120
3123
  }
3121
3124
  // CT1380: the local half of a resumed turn's seq floor (see
@@ -9666,7 +9669,9 @@ var TurnExecution = class {
9666
9669
  payload.conversationId,
9667
9670
  payload.messageId,
9668
9671
  turnId,
9669
- this.resumed
9672
+ this.resumed,
9673
+ void 0,
9674
+ payload.episode
9670
9675
  );
9671
9676
  } catch (err) {
9672
9677
  const status2 = err instanceof ApiError ? err.status : 0;
@@ -9898,7 +9903,11 @@ var TurnExecution = class {
9898
9903
  ...this.turnContext.readThrough !== void 0 ? { readThrough: this.turnContext.readThrough } : {},
9899
9904
  ...this.turnContext.readRevision !== void 0 ? { readRevision: this.turnContext.readRevision } : {},
9900
9905
  // Rooms: the attempt this request's session belongs to (null = fresh).
9901
- ...this.turnContext.attemptId !== void 0 ? { attemptId: this.turnContext.attemptId } : {}
9906
+ ...this.turnContext.attemptId !== void 0 ? { attemptId: this.turnContext.attemptId } : {},
9907
+ // CT1543: the frame this start acts on. The turn-context fetch already
9908
+ // checked it, but that was before an assembly this turn awaited — the
9909
+ // lease checks it again where the stamp is actually taken.
9910
+ ...payload.episode !== void 0 ? { dispatchMessageId: payload.messageId, dispatchEpisode: payload.episode } : {}
9902
9911
  });
9903
9912
  } catch (err) {
9904
9913
  if (leaseRefusal(err) === "dispatch_context_stale" && !this.recomposedForLease) {
package/dist/runtime.js CHANGED
@@ -2448,8 +2448,11 @@ var CabaneApi = class {
2448
2448
  // from the start of the conversation, the agent's own words included, and
2449
2449
  // the first-turn material — what the adapter runs on when it refused to
2450
2450
  // resume the stored session and is starting a fresh one.
2451
- getTurnContext(conversationId, messageId2, turnId, resumed, fresh) {
2452
- const q = `conversationId=${encodeURIComponent(conversationId)}&messageId=${encodeURIComponent(messageId2)}` + (turnId ? `&turnId=${encodeURIComponent(turnId)}` : "") + (resumed ? "&resumed=1" : "") + (fresh ? "&fresh=1" : "");
2451
+ // CT1543: `episode` is the dispatch event's own, echoed back so the server can
2452
+ // tell this frame from a later wake on the same message. Omitted when the
2453
+ // event didn't carry one, which is the only thing an older event can mean.
2454
+ getTurnContext(conversationId, messageId2, turnId, resumed, fresh, episode) {
2455
+ const q = `conversationId=${encodeURIComponent(conversationId)}&messageId=${encodeURIComponent(messageId2)}` + (turnId ? `&turnId=${encodeURIComponent(turnId)}` : "") + (resumed ? "&resumed=1" : "") + (fresh ? "&fresh=1" : "") + (episode !== void 0 ? `&episode=${encodeURIComponent(String(episode))}` : "");
2453
2456
  return this.request("GET", `/api/agent/turn-context?${q}`);
2454
2457
  }
2455
2458
  // CT1380: the local half of a resumed turn's seq floor (see
@@ -9089,7 +9092,9 @@ var TurnExecution = class {
9089
9092
  payload.conversationId,
9090
9093
  payload.messageId,
9091
9094
  turnId,
9092
- this.resumed
9095
+ this.resumed,
9096
+ void 0,
9097
+ payload.episode
9093
9098
  );
9094
9099
  } catch (err) {
9095
9100
  const status = err instanceof ApiError ? err.status : 0;
@@ -9321,7 +9326,11 @@ var TurnExecution = class {
9321
9326
  ...this.turnContext.readThrough !== void 0 ? { readThrough: this.turnContext.readThrough } : {},
9322
9327
  ...this.turnContext.readRevision !== void 0 ? { readRevision: this.turnContext.readRevision } : {},
9323
9328
  // Rooms: the attempt this request's session belongs to (null = fresh).
9324
- ...this.turnContext.attemptId !== void 0 ? { attemptId: this.turnContext.attemptId } : {}
9329
+ ...this.turnContext.attemptId !== void 0 ? { attemptId: this.turnContext.attemptId } : {},
9330
+ // CT1543: the frame this start acts on. The turn-context fetch already
9331
+ // checked it, but that was before an assembly this turn awaited — the
9332
+ // lease checks it again where the stamp is actually taken.
9333
+ ...payload.episode !== void 0 ? { dispatchMessageId: payload.messageId, dispatchEpisode: payload.episode } : {}
9325
9334
  });
9326
9335
  } catch (err) {
9327
9336
  if (leaseRefusal(err) === "dispatch_context_stale" && !this.recomposedForLease) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/companion",
3
- "version": "0.6.109",
3
+ "version": "0.6.111",
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",