@cabane/companion 0.6.168 → 0.6.169
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 +2 -13
- package/dist/runtime.js +2 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4169,7 +4169,6 @@ async function* decodeOpencodeStream(events, ctx2) {
|
|
|
4169
4169
|
let reason;
|
|
4170
4170
|
let settled = false;
|
|
4171
4171
|
const userMessageIds = /* @__PURE__ */ new Set();
|
|
4172
|
-
if (ctx2.skipMessageId) userMessageIds.add(ctx2.skipMessageId);
|
|
4173
4172
|
for await (const ev of events) {
|
|
4174
4173
|
if (ctx2.signal.aborted) return;
|
|
4175
4174
|
if (ev.type === "message.updated") {
|
|
@@ -4345,8 +4344,6 @@ function buildRunSpec(req, resumeSessionId) {
|
|
|
4345
4344
|
parts: buildParts(req),
|
|
4346
4345
|
tools,
|
|
4347
4346
|
allowAllHostTools,
|
|
4348
|
-
// Fresh session → mint + send a client id; resumed → let opencode mint it.
|
|
4349
|
-
sendClientMessageId: resumeSessionId == null,
|
|
4350
4347
|
...dialect.agent ? { agent: dialect.agent } : {},
|
|
4351
4348
|
mcp: buildMcp(req),
|
|
4352
4349
|
// Every server this turn installs with a credential resolved into it: a remote one's
|
|
@@ -4521,14 +4518,12 @@ function createHttpOpencodeTransport(opts) {
|
|
|
4521
4518
|
created = true;
|
|
4522
4519
|
}
|
|
4523
4520
|
await installMcp(doFetch, base, spec, signal);
|
|
4524
|
-
const userMessageId = spec.sendClientMessageId ? newOpencodeMessageId() : null;
|
|
4525
4521
|
const promptRes = await doFetch(
|
|
4526
4522
|
`${base}/session/${encodeURIComponent(sessionId)}/prompt_async`,
|
|
4527
4523
|
{
|
|
4528
4524
|
method: "POST",
|
|
4529
4525
|
headers: { "content-type": "application/json" },
|
|
4530
4526
|
body: JSON.stringify({
|
|
4531
|
-
...userMessageId ? { messageID: userMessageId } : {},
|
|
4532
4527
|
...spec.model ? { model: spec.model } : {},
|
|
4533
4528
|
system: spec.systemPrompt,
|
|
4534
4529
|
parts: spec.parts,
|
|
@@ -4554,7 +4549,6 @@ function createHttpOpencodeTransport(opts) {
|
|
|
4554
4549
|
sessionId,
|
|
4555
4550
|
created,
|
|
4556
4551
|
directory: spec.directory,
|
|
4557
|
-
userMessageId,
|
|
4558
4552
|
// The lock is released when this stream finishes draining.
|
|
4559
4553
|
events: releaseAfter(parseSseStream(eventRes.body, sessionId, signal), release)
|
|
4560
4554
|
};
|
|
@@ -4657,9 +4651,6 @@ function belongsToSession(ev, sessionId) {
|
|
|
4657
4651
|
if (typeof infoSid === "string") return infoSid === sessionId;
|
|
4658
4652
|
return true;
|
|
4659
4653
|
}
|
|
4660
|
-
function newOpencodeMessageId() {
|
|
4661
|
-
return `msg_${crypto.randomUUID().replace(/-/g, "")}`;
|
|
4662
|
-
}
|
|
4663
4654
|
function trimSlash(s) {
|
|
4664
4655
|
return s.endsWith("/") ? s.slice(0, -1) : s;
|
|
4665
4656
|
}
|
|
@@ -4723,8 +4714,7 @@ function createOpencodeAdapter(deps = {}) {
|
|
|
4723
4714
|
}
|
|
4724
4715
|
yield* decodeOpencodeStream(result.events, {
|
|
4725
4716
|
signal,
|
|
4726
|
-
sessionId: result.sessionId
|
|
4727
|
-
skipMessageId: result.userMessageId
|
|
4717
|
+
sessionId: result.sessionId
|
|
4728
4718
|
});
|
|
4729
4719
|
}
|
|
4730
4720
|
};
|
|
@@ -5149,8 +5139,7 @@ var init_conformance3 = __esm({
|
|
|
5149
5139
|
]
|
|
5150
5140
|
},
|
|
5151
5141
|
{
|
|
5152
|
-
// On a
|
|
5153
|
-
// decoder gets no `skipMessageId`. It learns the user-message id from the stream — the
|
|
5142
|
+
// On resume, as on a fresh turn, the decoder learns the user-message id from the stream:
|
|
5154
5143
|
// `message.updated` user frame precedes the echoed part — and drops the echo, so the injected
|
|
5155
5144
|
// per-turn context can't leak into Steps. Only the reply surfaces; no session event.
|
|
5156
5145
|
name: "session resume \u2014 prompt echo filtered via stream-derived user id",
|
package/dist/runtime.js
CHANGED
|
@@ -4988,7 +4988,6 @@ async function* decodeOpencodeStream(events, ctx) {
|
|
|
4988
4988
|
let reason;
|
|
4989
4989
|
let settled = false;
|
|
4990
4990
|
const userMessageIds = /* @__PURE__ */ new Set();
|
|
4991
|
-
if (ctx.skipMessageId) userMessageIds.add(ctx.skipMessageId);
|
|
4992
4991
|
for await (const ev of events) {
|
|
4993
4992
|
if (ctx.signal.aborted) return;
|
|
4994
4993
|
if (ev.type === "message.updated") {
|
|
@@ -5148,8 +5147,6 @@ function buildRunSpec(req, resumeSessionId) {
|
|
|
5148
5147
|
parts: buildParts(req),
|
|
5149
5148
|
tools,
|
|
5150
5149
|
allowAllHostTools,
|
|
5151
|
-
// Fresh session → mint + send a client id; resumed → let opencode mint it.
|
|
5152
|
-
sendClientMessageId: resumeSessionId == null,
|
|
5153
5150
|
...dialect.agent ? { agent: dialect.agent } : {},
|
|
5154
5151
|
mcp: buildMcp(req),
|
|
5155
5152
|
// Every server this turn installs with a credential resolved into it: a remote one's
|
|
@@ -5308,14 +5305,12 @@ function createHttpOpencodeTransport(opts) {
|
|
|
5308
5305
|
created = true;
|
|
5309
5306
|
}
|
|
5310
5307
|
await installMcp(doFetch, base, spec, signal);
|
|
5311
|
-
const userMessageId = spec.sendClientMessageId ? newOpencodeMessageId() : null;
|
|
5312
5308
|
const promptRes = await doFetch(
|
|
5313
5309
|
`${base}/session/${encodeURIComponent(sessionId)}/prompt_async`,
|
|
5314
5310
|
{
|
|
5315
5311
|
method: "POST",
|
|
5316
5312
|
headers: { "content-type": "application/json" },
|
|
5317
5313
|
body: JSON.stringify({
|
|
5318
|
-
...userMessageId ? { messageID: userMessageId } : {},
|
|
5319
5314
|
...spec.model ? { model: spec.model } : {},
|
|
5320
5315
|
system: spec.systemPrompt,
|
|
5321
5316
|
parts: spec.parts,
|
|
@@ -5341,7 +5336,6 @@ function createHttpOpencodeTransport(opts) {
|
|
|
5341
5336
|
sessionId,
|
|
5342
5337
|
created,
|
|
5343
5338
|
directory: spec.directory,
|
|
5344
|
-
userMessageId,
|
|
5345
5339
|
// The lock is released when this stream finishes draining.
|
|
5346
5340
|
events: releaseAfter(parseSseStream(eventRes.body, sessionId, signal), release)
|
|
5347
5341
|
};
|
|
@@ -5449,9 +5443,6 @@ function belongsToSession(ev, sessionId) {
|
|
|
5449
5443
|
if (typeof infoSid === "string") return infoSid === sessionId;
|
|
5450
5444
|
return true;
|
|
5451
5445
|
}
|
|
5452
|
-
function newOpencodeMessageId() {
|
|
5453
|
-
return `msg_${crypto.randomUUID().replace(/-/g, "")}`;
|
|
5454
|
-
}
|
|
5455
5446
|
function trimSlash(s) {
|
|
5456
5447
|
return s.endsWith("/") ? s.slice(0, -1) : s;
|
|
5457
5448
|
}
|
|
@@ -5503,8 +5494,7 @@ function createOpencodeAdapter(deps = {}) {
|
|
|
5503
5494
|
}
|
|
5504
5495
|
yield* decodeOpencodeStream(result.events, {
|
|
5505
5496
|
signal,
|
|
5506
|
-
sessionId: result.sessionId
|
|
5507
|
-
skipMessageId: result.userMessageId
|
|
5497
|
+
sessionId: result.sessionId
|
|
5508
5498
|
});
|
|
5509
5499
|
}
|
|
5510
5500
|
};
|
|
@@ -5903,8 +5893,7 @@ var OPENCODE_CONFORMANCE_FIXTURES = [
|
|
|
5903
5893
|
]
|
|
5904
5894
|
},
|
|
5905
5895
|
{
|
|
5906
|
-
// On a
|
|
5907
|
-
// decoder gets no `skipMessageId`. It learns the user-message id from the stream — the
|
|
5896
|
+
// On resume, as on a fresh turn, the decoder learns the user-message id from the stream:
|
|
5908
5897
|
// `message.updated` user frame precedes the echoed part — and drops the echo, so the injected
|
|
5909
5898
|
// per-turn context can't leak into Steps. Only the reply surfaces; no session event.
|
|
5910
5899
|
name: "session resume \u2014 prompt echo filtered via stream-derived user id",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabane/companion",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.169",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Cabane Companion (headless): connect an 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",
|