switchroom 0.12.3 → 0.12.4
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/switchroom.js
CHANGED
|
@@ -46894,8 +46894,8 @@ var {
|
|
|
46894
46894
|
} = import__.default;
|
|
46895
46895
|
|
|
46896
46896
|
// src/build-info.ts
|
|
46897
|
-
var VERSION = "0.12.
|
|
46898
|
-
var COMMIT_SHA = "
|
|
46897
|
+
var VERSION = "0.12.4";
|
|
46898
|
+
var COMMIT_SHA = "a10797c4";
|
|
46899
46899
|
|
|
46900
46900
|
// src/cli/agent.ts
|
|
46901
46901
|
init_source();
|
|
@@ -14693,7 +14693,7 @@ import {
|
|
|
14693
14693
|
renameSync,
|
|
14694
14694
|
mkdirSync
|
|
14695
14695
|
} from "node:fs";
|
|
14696
|
-
import { join as join2, dirname as dirname2 } from "node:path";
|
|
14696
|
+
import { join as join2, dirname as dirname2, resolve as resolve5 } from "node:path";
|
|
14697
14697
|
|
|
14698
14698
|
// src/host-control/protocol.ts
|
|
14699
14699
|
var MAX_FRAME_BYTES = 64 * 1024;
|
|
@@ -15355,8 +15355,8 @@ class HostdServer {
|
|
|
15355
15355
|
process.stderr.write(`hostd: server error on ${sockPath}: ${err.message}
|
|
15356
15356
|
`);
|
|
15357
15357
|
});
|
|
15358
|
-
await new Promise((
|
|
15359
|
-
server.listen(sockPath, () =>
|
|
15358
|
+
await new Promise((resolve6, reject) => {
|
|
15359
|
+
server.listen(sockPath, () => resolve6());
|
|
15360
15360
|
server.once("error", reject);
|
|
15361
15361
|
});
|
|
15362
15362
|
await chmod(sockPath, 432).catch(() => {
|
|
@@ -15378,7 +15378,7 @@ class HostdServer {
|
|
|
15378
15378
|
async stop() {
|
|
15379
15379
|
const paths = [...this.servers.keys()];
|
|
15380
15380
|
for (const [, server] of this.servers) {
|
|
15381
|
-
await new Promise((
|
|
15381
|
+
await new Promise((resolve6) => server.close(() => resolve6()));
|
|
15382
15382
|
}
|
|
15383
15383
|
this.servers.clear();
|
|
15384
15384
|
for (const s of paths) {
|
|
@@ -15604,10 +15604,27 @@ class HostdServer {
|
|
|
15604
15604
|
stderr_tail: tail(res.stderr)
|
|
15605
15605
|
};
|
|
15606
15606
|
}
|
|
15607
|
+
missingApplyAssets() {
|
|
15608
|
+
const root = this.opts.applyAssetsRoot ?? resolve5(import.meta.dirname, "../..");
|
|
15609
|
+
return [
|
|
15610
|
+
join2(root, "profiles"),
|
|
15611
|
+
join2(root, "profiles", "default"),
|
|
15612
|
+
join2(root, "vendor", "hindsight-memory")
|
|
15613
|
+
].filter((p) => !existsSync5(p));
|
|
15614
|
+
}
|
|
15615
|
+
applyAssetPreflight(request_id, started) {
|
|
15616
|
+
const missing = this.missingApplyAssets();
|
|
15617
|
+
if (missing.length === 0)
|
|
15618
|
+
return null;
|
|
15619
|
+
return deniedResponse(request_id, `refused: this switchroom-hostd image is missing apply-time ` + `assets [${missing.join(", ")}]. hostd's in-container ` + `\`switchroom apply\` cannot scaffold agents without them and ` + `would pull images then strand the fleet on the old image ` + `(the klanker incident). Nothing was pulled or changed. Fix: ` + `rebuild/refresh the hostd image — \`switchroom update\` ` + `(refreshes hostd) or \`switchroom hostd install\` on the ` + `host; meanwhile run \`switchroom update\` host-side.`, Date.now() - started);
|
|
15620
|
+
}
|
|
15607
15621
|
handleUpdateApply(req, caller, started) {
|
|
15608
15622
|
const denied = this.checkFleetMutationLock(req.op, req.request_id, started);
|
|
15609
15623
|
if (denied)
|
|
15610
15624
|
return denied;
|
|
15625
|
+
const assetDenied = this.applyAssetPreflight(req.request_id, started);
|
|
15626
|
+
if (assetDenied)
|
|
15627
|
+
return assetDenied;
|
|
15611
15628
|
if (req.args?.channel && req.args?.pin) {
|
|
15612
15629
|
return deniedResponse(req.request_id, "update_apply: `channel` and `pin` are mutually exclusive — pass at most one.", Date.now() - started);
|
|
15613
15630
|
}
|
|
@@ -15663,6 +15680,9 @@ class HostdServer {
|
|
|
15663
15680
|
const denied = this.checkFleetMutationLock(req.op, req.request_id, started);
|
|
15664
15681
|
if (denied)
|
|
15665
15682
|
return denied;
|
|
15683
|
+
const assetDenied = this.applyAssetPreflight(req.request_id, started);
|
|
15684
|
+
if (assetDenied)
|
|
15685
|
+
return assetDenied;
|
|
15666
15686
|
const args = ["apply", "--non-interactive"];
|
|
15667
15687
|
const entry = {
|
|
15668
15688
|
request_id: req.request_id,
|
|
@@ -15755,7 +15775,7 @@ class HostdServer {
|
|
|
15755
15775
|
};
|
|
15756
15776
|
}
|
|
15757
15777
|
runDocker(args) {
|
|
15758
|
-
return new Promise((
|
|
15778
|
+
return new Promise((resolve6, reject) => {
|
|
15759
15779
|
const bin = this.opts.dockerBin ?? "docker";
|
|
15760
15780
|
const child = spawn(bin, args, {
|
|
15761
15781
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -15770,7 +15790,7 @@ class HostdServer {
|
|
|
15770
15790
|
stderr += d.toString("utf8");
|
|
15771
15791
|
});
|
|
15772
15792
|
child.on("error", (err) => reject(err));
|
|
15773
|
-
child.on("close", (code) =>
|
|
15793
|
+
child.on("close", (code) => resolve6({ exit_code: code ?? -1, stdout, stderr }));
|
|
15774
15794
|
});
|
|
15775
15795
|
}
|
|
15776
15796
|
imageRefsForDigestCapture() {
|
|
@@ -15919,7 +15939,7 @@ class HostdServer {
|
|
|
15919
15939
|
});
|
|
15920
15940
|
}
|
|
15921
15941
|
runSwitchroom(args) {
|
|
15922
|
-
return new Promise((
|
|
15942
|
+
return new Promise((resolve6, reject) => {
|
|
15923
15943
|
const bin = this.opts.switchroomBin ?? "switchroom";
|
|
15924
15944
|
const child = spawn(bin, args, {
|
|
15925
15945
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -15934,7 +15954,7 @@ class HostdServer {
|
|
|
15934
15954
|
stderr += d.toString("utf8");
|
|
15935
15955
|
});
|
|
15936
15956
|
child.on("error", (err) => reject(err));
|
|
15937
|
-
child.on("close", (code) =>
|
|
15957
|
+
child.on("close", (code) => resolve6({ exit_code: code ?? -1, stdout, stderr }));
|
|
15938
15958
|
});
|
|
15939
15959
|
}
|
|
15940
15960
|
}
|
package/package.json
CHANGED
|
@@ -46559,10 +46559,10 @@ function sweepStaleTurnActiveMarker(stateDir, opts) {
|
|
|
46559
46559
|
}
|
|
46560
46560
|
|
|
46561
46561
|
// ../src/build-info.ts
|
|
46562
|
-
var VERSION = "0.12.
|
|
46563
|
-
var COMMIT_SHA = "
|
|
46564
|
-
var COMMIT_DATE = "2026-05-
|
|
46565
|
-
var LATEST_PR =
|
|
46562
|
+
var VERSION = "0.12.4";
|
|
46563
|
+
var COMMIT_SHA = "a10797c4";
|
|
46564
|
+
var COMMIT_DATE = "2026-05-18T11:07:19Z";
|
|
46565
|
+
var LATEST_PR = 1511;
|
|
46566
46566
|
var COMMITS_AHEAD_OF_TAG = 2;
|
|
46567
46567
|
|
|
46568
46568
|
// gateway/boot-version.ts
|