@cabane/companion 0.6.64 → 0.6.65
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 +17 -32
- package/dist/runtime.js +17 -32
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2597,15 +2597,16 @@ var CabaneApi = class {
|
|
|
2597
2597
|
// (transport errors + 5xx), never a 4xx, so no `(turnId, kind)` row is
|
|
2598
2598
|
// double-posted. The caller threads its turn abort signal so a cancel
|
|
2599
2599
|
// mid-commit aborts the in-flight POST rather than letting it land.
|
|
2600
|
-
// CT11: `kind`
|
|
2601
|
-
//
|
|
2602
|
-
//
|
|
2603
|
-
//
|
|
2604
|
-
//
|
|
2605
|
-
//
|
|
2606
|
-
//
|
|
2607
|
-
//
|
|
2608
|
-
//
|
|
2600
|
+
// CT11: `kind` includes `'stopped'` for the terminal cancel marker — same
|
|
2601
|
+
// wire shape as `progress`/`final`, distinguished only by `kind` so the chat
|
|
2602
|
+
// drawer's turn-group renderer treats it as a closing row. CT1295: this
|
|
2603
|
+
// companion no longer WRITES that kind — the server does, in the transaction
|
|
2604
|
+
// that terminalizes the stopped turn — so the value survives here only as
|
|
2605
|
+
// wire vocabulary the server also speaks. `seq` is the companion's per-turn
|
|
2606
|
+
// monotonic counter, stamped on the row so the merged timeline orders the
|
|
2607
|
+
// commit deterministically against the persisted tool/thinking rows. Both
|
|
2608
|
+
// fields are optional on the wire — an older companion that didn't mint seq
|
|
2609
|
+
// still validates (the server defaults to 0).
|
|
2609
2610
|
postTurnMessage(workspaceId, conversationId, body, signal) {
|
|
2610
2611
|
return this.durableCommit(
|
|
2611
2612
|
"message",
|
|
@@ -4379,7 +4380,7 @@ var BASE_CLAUDE_CODE_CONFORMANCE_FIXTURES = [
|
|
|
4379
4380
|
{
|
|
4380
4381
|
// HIGHEST-RISK: cancel mid-stream. The abort lands after the tool result;
|
|
4381
4382
|
// the adapter stops before the closing reply — no final text, no `result`
|
|
4382
|
-
// event.
|
|
4383
|
+
// event. CT1295: the server writes the `kind:'stopped'` marker.
|
|
4383
4384
|
name: "cancel mid-stream",
|
|
4384
4385
|
request: makeRequest(),
|
|
4385
4386
|
nativeStream: [
|
|
@@ -5500,7 +5501,7 @@ var OPENCODE_CONFORMANCE_FIXTURES = [
|
|
|
5500
5501
|
{
|
|
5501
5502
|
// HIGHEST-RISK: cancel mid-stream. The abort lands after the tool result; the
|
|
5502
5503
|
// adapter stops before the closing reply — no final text, no `result` event.
|
|
5503
|
-
//
|
|
5504
|
+
// CT1295: the server writes the `kind:'stopped'` marker.
|
|
5504
5505
|
name: "cancel mid-stream",
|
|
5505
5506
|
request: makeRequest2(),
|
|
5506
5507
|
nativeStream: [
|
|
@@ -6792,7 +6793,7 @@ var CODEX_CONFORMANCE_FIXTURES = [
|
|
|
6792
6793
|
{
|
|
6793
6794
|
// HIGHEST-RISK: cancel mid-stream. The abort lands after the tool result; the
|
|
6794
6795
|
// adapter stops before the closing reply — no final text, no `result` event.
|
|
6795
|
-
//
|
|
6796
|
+
// CT1295: the server writes the `kind:'stopped'` marker.
|
|
6796
6797
|
name: "cancel mid-stream",
|
|
6797
6798
|
request: makeRequest3(),
|
|
6798
6799
|
nativeStream: [
|
|
@@ -7948,8 +7949,10 @@ var TurnCommitter = class {
|
|
|
7948
7949
|
// End-of-turn progress promotion. The held-text flush is now the adapter's
|
|
7949
7950
|
// job (it emits the closing reply as a `text` event before `result`), so this
|
|
7950
7951
|
// only asks the pump to promote agent-authored interim text. A wordless turn
|
|
7951
|
-
// stays wordless and the dispatcher closes it with a
|
|
7952
|
-
//
|
|
7952
|
+
// stays wordless and the dispatcher closes it with a `silent`/`skipped`
|
|
7953
|
+
// marker (CT1295: a CANCELLED turn is closed by the SERVER's `stopped`
|
|
7954
|
+
// marker, not from this side). Guards on the abort signal, so on cancel no
|
|
7955
|
+
// `final` is forced.
|
|
7953
7956
|
async finalize(okResult) {
|
|
7954
7957
|
await this.pump.finalize(okResult);
|
|
7955
7958
|
}
|
|
@@ -8067,7 +8070,6 @@ var TurnCommitter = class {
|
|
|
8067
8070
|
var PREPARING_TOOL_NAME = "preparing";
|
|
8068
8071
|
var PREPARE_FAILED_PREFIX = "**Couldn't prepare your environment.** I wasn't able to provision a working directory for this conversation, so I can't run this turn. The provisioning command reported:";
|
|
8069
8072
|
var MISSING_SECRET_PREFIX = "**Missing secret on this companion.** This agent's tools need a credential this device hasn't been given, so I can't run this turn safely. Declare it in this companion\u2019s secret store (`~/.cabane/secrets.json`) and try again. Missing:";
|
|
8070
|
-
var STOPPED_MARKER_BODY = "(stopped)";
|
|
8071
8073
|
var RUNTIME_UNAVAILABLE_PREFIX = "**This agent's runtime isn't available on this companion.** The model this agent uses needs a runtime this device isn't running, so I can't run this turn here. Details:";
|
|
8072
8074
|
var UNEXPECTED_ROLE_REASON = `refused the wake trigger (role "system" isn't dispatchable on this companion) \u2014 the companion is likely running outdated code; refresh it, then re-address the agent`;
|
|
8073
8075
|
var SKIPPED_MARKER_BODY = "(skipped)";
|
|
@@ -8900,23 +8902,6 @@ ${reason}`,
|
|
|
8900
8902
|
}
|
|
8901
8903
|
}
|
|
8902
8904
|
}
|
|
8903
|
-
if (userCancelled) {
|
|
8904
|
-
try {
|
|
8905
|
-
await this.opts.api.postTurnMessage(workspaceId, payload.conversationId, {
|
|
8906
|
-
body: STOPPED_MARKER_BODY,
|
|
8907
|
-
kind: "stopped",
|
|
8908
|
-
turnId,
|
|
8909
|
-
seq: nextSeq(),
|
|
8910
|
-
// CT113: the stopped marker is still "about" the triggering message.
|
|
8911
|
-
parentMessageId: payload.messageId
|
|
8912
|
-
});
|
|
8913
|
-
} catch (err) {
|
|
8914
|
-
turnLog.warn(
|
|
8915
|
-
{ err: err instanceof Error ? err.message : String(err) },
|
|
8916
|
-
"dispatcher: stopped-marker commit failed"
|
|
8917
|
-
);
|
|
8918
|
-
}
|
|
8919
|
-
}
|
|
8920
8905
|
const body = {
|
|
8921
8906
|
activeRunStartedAt: null,
|
|
8922
8907
|
// CT277: the server keys the turn-end metadata UPDATE (ended_at + tokens)
|
package/dist/runtime.js
CHANGED
|
@@ -2017,15 +2017,16 @@ var CabaneApi = class {
|
|
|
2017
2017
|
// (transport errors + 5xx), never a 4xx, so no `(turnId, kind)` row is
|
|
2018
2018
|
// double-posted. The caller threads its turn abort signal so a cancel
|
|
2019
2019
|
// mid-commit aborts the in-flight POST rather than letting it land.
|
|
2020
|
-
// CT11: `kind`
|
|
2021
|
-
//
|
|
2022
|
-
//
|
|
2023
|
-
//
|
|
2024
|
-
//
|
|
2025
|
-
//
|
|
2026
|
-
//
|
|
2027
|
-
//
|
|
2028
|
-
//
|
|
2020
|
+
// CT11: `kind` includes `'stopped'` for the terminal cancel marker — same
|
|
2021
|
+
// wire shape as `progress`/`final`, distinguished only by `kind` so the chat
|
|
2022
|
+
// drawer's turn-group renderer treats it as a closing row. CT1295: this
|
|
2023
|
+
// companion no longer WRITES that kind — the server does, in the transaction
|
|
2024
|
+
// that terminalizes the stopped turn — so the value survives here only as
|
|
2025
|
+
// wire vocabulary the server also speaks. `seq` is the companion's per-turn
|
|
2026
|
+
// monotonic counter, stamped on the row so the merged timeline orders the
|
|
2027
|
+
// commit deterministically against the persisted tool/thinking rows. Both
|
|
2028
|
+
// fields are optional on the wire — an older companion that didn't mint seq
|
|
2029
|
+
// still validates (the server defaults to 0).
|
|
2029
2030
|
postTurnMessage(workspaceId, conversationId, body, signal) {
|
|
2030
2031
|
return this.durableCommit(
|
|
2031
2032
|
"message",
|
|
@@ -3878,7 +3879,7 @@ var BASE_CLAUDE_CODE_CONFORMANCE_FIXTURES = [
|
|
|
3878
3879
|
{
|
|
3879
3880
|
// HIGHEST-RISK: cancel mid-stream. The abort lands after the tool result;
|
|
3880
3881
|
// the adapter stops before the closing reply — no final text, no `result`
|
|
3881
|
-
// event.
|
|
3882
|
+
// event. CT1295: the server writes the `kind:'stopped'` marker.
|
|
3882
3883
|
name: "cancel mid-stream",
|
|
3883
3884
|
request: makeRequest(),
|
|
3884
3885
|
nativeStream: [
|
|
@@ -4999,7 +5000,7 @@ var OPENCODE_CONFORMANCE_FIXTURES = [
|
|
|
4999
5000
|
{
|
|
5000
5001
|
// HIGHEST-RISK: cancel mid-stream. The abort lands after the tool result; the
|
|
5001
5002
|
// adapter stops before the closing reply — no final text, no `result` event.
|
|
5002
|
-
//
|
|
5003
|
+
// CT1295: the server writes the `kind:'stopped'` marker.
|
|
5003
5004
|
name: "cancel mid-stream",
|
|
5004
5005
|
request: makeRequest2(),
|
|
5005
5006
|
nativeStream: [
|
|
@@ -6291,7 +6292,7 @@ var CODEX_CONFORMANCE_FIXTURES = [
|
|
|
6291
6292
|
{
|
|
6292
6293
|
// HIGHEST-RISK: cancel mid-stream. The abort lands after the tool result; the
|
|
6293
6294
|
// adapter stops before the closing reply — no final text, no `result` event.
|
|
6294
|
-
//
|
|
6295
|
+
// CT1295: the server writes the `kind:'stopped'` marker.
|
|
6295
6296
|
name: "cancel mid-stream",
|
|
6296
6297
|
request: makeRequest3(),
|
|
6297
6298
|
nativeStream: [
|
|
@@ -7447,8 +7448,10 @@ var TurnCommitter = class {
|
|
|
7447
7448
|
// End-of-turn progress promotion. The held-text flush is now the adapter's
|
|
7448
7449
|
// job (it emits the closing reply as a `text` event before `result`), so this
|
|
7449
7450
|
// only asks the pump to promote agent-authored interim text. A wordless turn
|
|
7450
|
-
// stays wordless and the dispatcher closes it with a
|
|
7451
|
-
//
|
|
7451
|
+
// stays wordless and the dispatcher closes it with a `silent`/`skipped`
|
|
7452
|
+
// marker (CT1295: a CANCELLED turn is closed by the SERVER's `stopped`
|
|
7453
|
+
// marker, not from this side). Guards on the abort signal, so on cancel no
|
|
7454
|
+
// `final` is forced.
|
|
7452
7455
|
async finalize(okResult) {
|
|
7453
7456
|
await this.pump.finalize(okResult);
|
|
7454
7457
|
}
|
|
@@ -7566,7 +7569,6 @@ var TurnCommitter = class {
|
|
|
7566
7569
|
var PREPARING_TOOL_NAME = "preparing";
|
|
7567
7570
|
var PREPARE_FAILED_PREFIX = "**Couldn't prepare your environment.** I wasn't able to provision a working directory for this conversation, so I can't run this turn. The provisioning command reported:";
|
|
7568
7571
|
var MISSING_SECRET_PREFIX = "**Missing secret on this companion.** This agent's tools need a credential this device hasn't been given, so I can't run this turn safely. Declare it in this companion\u2019s secret store (`~/.cabane/secrets.json`) and try again. Missing:";
|
|
7569
|
-
var STOPPED_MARKER_BODY = "(stopped)";
|
|
7570
7572
|
var RUNTIME_UNAVAILABLE_PREFIX = "**This agent's runtime isn't available on this companion.** The model this agent uses needs a runtime this device isn't running, so I can't run this turn here. Details:";
|
|
7571
7573
|
var UNEXPECTED_ROLE_REASON = `refused the wake trigger (role "system" isn't dispatchable on this companion) \u2014 the companion is likely running outdated code; refresh it, then re-address the agent`;
|
|
7572
7574
|
var SKIPPED_MARKER_BODY = "(skipped)";
|
|
@@ -8399,23 +8401,6 @@ ${reason}`,
|
|
|
8399
8401
|
}
|
|
8400
8402
|
}
|
|
8401
8403
|
}
|
|
8402
|
-
if (userCancelled) {
|
|
8403
|
-
try {
|
|
8404
|
-
await this.opts.api.postTurnMessage(workspaceId, payload.conversationId, {
|
|
8405
|
-
body: STOPPED_MARKER_BODY,
|
|
8406
|
-
kind: "stopped",
|
|
8407
|
-
turnId,
|
|
8408
|
-
seq: nextSeq(),
|
|
8409
|
-
// CT113: the stopped marker is still "about" the triggering message.
|
|
8410
|
-
parentMessageId: payload.messageId
|
|
8411
|
-
});
|
|
8412
|
-
} catch (err) {
|
|
8413
|
-
turnLog.warn(
|
|
8414
|
-
{ err: err instanceof Error ? err.message : String(err) },
|
|
8415
|
-
"dispatcher: stopped-marker commit failed"
|
|
8416
|
-
);
|
|
8417
|
-
}
|
|
8418
|
-
}
|
|
8419
8404
|
const body = {
|
|
8420
8405
|
activeRunStartedAt: null,
|
|
8421
8406
|
// CT277: the server keys the turn-end metadata UPDATE (ended_at + tokens)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabane/companion",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.65",
|
|
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",
|