@cabane/companion 0.6.163 → 0.6.164
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 -10
- package/dist/runtime.js +4 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12437,7 +12437,9 @@ function clearRuntimeStateIfOurs(instanceId) {
|
|
|
12437
12437
|
}
|
|
12438
12438
|
rmSync3(path, { force: true });
|
|
12439
12439
|
}
|
|
12440
|
-
function readLiveRuntimeState(
|
|
12440
|
+
function readLiveRuntimeState({
|
|
12441
|
+
sweep = true
|
|
12442
|
+
} = {}) {
|
|
12441
12443
|
const path = runtimePath();
|
|
12442
12444
|
if (!existsSync5(path)) return null;
|
|
12443
12445
|
let parsed;
|
|
@@ -12450,7 +12452,7 @@ function readLiveRuntimeState() {
|
|
|
12450
12452
|
try {
|
|
12451
12453
|
process.kill(parsed.pid, 0);
|
|
12452
12454
|
} catch {
|
|
12453
|
-
clearRuntimeState();
|
|
12455
|
+
if (sweep) clearRuntimeState();
|
|
12454
12456
|
return null;
|
|
12455
12457
|
}
|
|
12456
12458
|
return parsed;
|
|
@@ -19060,11 +19062,13 @@ var LABEL_WIDTH2 = 13;
|
|
|
19060
19062
|
function row2(label, value) {
|
|
19061
19063
|
return ` ${label.padEnd(LABEL_WIDTH2)}${value}`;
|
|
19062
19064
|
}
|
|
19063
|
-
async function status() {
|
|
19065
|
+
async function status(deps = {}) {
|
|
19064
19066
|
const out = (line) => void process.stdout.write(`${line}
|
|
19065
19067
|
`);
|
|
19068
|
+
const running = await liveState();
|
|
19069
|
+
const strays = strayStatusLines(running, deps.strays);
|
|
19066
19070
|
out(` ${versionLine()}`);
|
|
19067
|
-
for (const line of otherInstallLines(
|
|
19071
|
+
for (const line of otherInstallLines(running)) out(line);
|
|
19068
19072
|
let cfg = null;
|
|
19069
19073
|
try {
|
|
19070
19074
|
cfg = loadConfig();
|
|
@@ -19073,11 +19077,11 @@ async function status() {
|
|
|
19073
19077
|
}
|
|
19074
19078
|
if (!cfg || !cfg.deviceToken) {
|
|
19075
19079
|
out(` Not paired yet. Run ${cabane("setup")} to set up this device.`);
|
|
19080
|
+
for (const line of strays) out(line);
|
|
19076
19081
|
process.exitCode = 1;
|
|
19077
19082
|
return;
|
|
19078
19083
|
}
|
|
19079
19084
|
out(row2("Paired with", `${cfg.baseUrl}${cfg.deviceLabel ? ` as ${cfg.deviceLabel}` : ""}`));
|
|
19080
|
-
const running = await liveState();
|
|
19081
19085
|
let detection = null;
|
|
19082
19086
|
if (running) {
|
|
19083
19087
|
const mode = running.daemon ? "in the background" : "in a terminal";
|
|
@@ -19087,6 +19091,7 @@ async function status() {
|
|
|
19087
19091
|
} else {
|
|
19088
19092
|
out(row2("Running", `no \u2014 start it with ${cabane("start")}`));
|
|
19089
19093
|
}
|
|
19094
|
+
for (const line of strays) out(line);
|
|
19090
19095
|
const service2 = await serviceState();
|
|
19091
19096
|
for (const line of serviceRows(service2)) out(line);
|
|
19092
19097
|
for (const line of updateRows(readUpdateState(), cfg.update?.auto, {
|
|
@@ -19158,11 +19163,8 @@ function otherInstall(install, own) {
|
|
|
19158
19163
|
return real(found) === ownAlias ? null : dirname15(found);
|
|
19159
19164
|
}
|
|
19160
19165
|
async function liveState() {
|
|
19161
|
-
const running = readLiveRuntimeState();
|
|
19162
|
-
if (running && await verifyRuntime(running) === "stale")
|
|
19163
|
-
clearRuntimeState();
|
|
19164
|
-
return null;
|
|
19165
|
-
}
|
|
19166
|
+
const running = readLiveRuntimeState({ sweep: false });
|
|
19167
|
+
if (running && await verifyRuntime(running) === "stale") return null;
|
|
19166
19168
|
return running;
|
|
19167
19169
|
}
|
|
19168
19170
|
async function runningDetection(running) {
|
|
@@ -19178,6 +19180,11 @@ async function runningDetection(running) {
|
|
|
19178
19180
|
return null;
|
|
19179
19181
|
}
|
|
19180
19182
|
}
|
|
19183
|
+
function strayStatusLines(running, find = findStrayCompanions) {
|
|
19184
|
+
const strays = find(running ? [running.pid] : []);
|
|
19185
|
+
if (strays.length === 0) return [];
|
|
19186
|
+
return strayCompanionLines(strays, cabane("status")).map((line) => ` ${line}`);
|
|
19187
|
+
}
|
|
19181
19188
|
async function agentLines2(cfg, running) {
|
|
19182
19189
|
const detection = running ?? await detectHarnesses(cfg);
|
|
19183
19190
|
return agentRows(detection, { connected: false }).map((agent) => row2(agent.label, agent.text));
|
package/dist/runtime.js
CHANGED
|
@@ -1678,7 +1678,9 @@ function clearRuntimeStateIfOurs(instanceId) {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
rmSync3(path, { force: true });
|
|
1680
1680
|
}
|
|
1681
|
-
function readLiveRuntimeState(
|
|
1681
|
+
function readLiveRuntimeState({
|
|
1682
|
+
sweep = true
|
|
1683
|
+
} = {}) {
|
|
1682
1684
|
const path = runtimePath();
|
|
1683
1685
|
if (!existsSync6(path)) return null;
|
|
1684
1686
|
let parsed;
|
|
@@ -1691,7 +1693,7 @@ function readLiveRuntimeState() {
|
|
|
1691
1693
|
try {
|
|
1692
1694
|
process.kill(parsed.pid, 0);
|
|
1693
1695
|
} catch {
|
|
1694
|
-
clearRuntimeState();
|
|
1696
|
+
if (sweep) clearRuntimeState();
|
|
1695
1697
|
return null;
|
|
1696
1698
|
}
|
|
1697
1699
|
return parsed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabane/companion",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.164",
|
|
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",
|