switchroom 0.12.10 → 0.12.11

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.
@@ -47047,8 +47047,8 @@ var {
47047
47047
  } = import__.default;
47048
47048
 
47049
47049
  // src/build-info.ts
47050
- var VERSION = "0.12.10";
47051
- var COMMIT_SHA = "47240a9e";
47050
+ var VERSION = "0.12.11";
47051
+ var COMMIT_SHA = "334628e8";
47052
47052
 
47053
47053
  // src/cli/agent.ts
47054
47054
  init_source();
@@ -75888,15 +75888,21 @@ function registerMigrateCommand(program3) {
75888
75888
  // src/cli/hostd.ts
75889
75889
  init_source();
75890
75890
  init_helpers();
75891
- init_audit_reader();
75892
75891
  import { existsSync as existsSync74, mkdirSync as mkdirSync39, readdirSync as readdirSync28, readFileSync as readFileSync61, writeFileSync as writeFileSync34, statSync as statSync28, copyFileSync as copyFileSync12 } from "node:fs";
75893
75892
  import { homedir as homedir33 } from "node:os";
75894
75893
  import { join as join64 } from "node:path";
75895
75894
  import { spawnSync as spawnSync11 } from "node:child_process";
75895
+ init_audit_reader();
75896
75896
  var DEFAULT_IMAGE_TAG = "latest";
75897
75897
  var HOSTD_COMPOSE_PROJECT = "switchroom-hostd";
75898
75898
  function renderHostdComposeFile(opts) {
75899
- const { hostHome, imageTag } = opts;
75899
+ const { hostHome, imageTag, operatorUid } = opts;
75900
+ const operatorUidEnv = operatorUid !== undefined ? `
75901
+ # Hostd chowns ~/.switchroom/hostd/operator/sock to this so the
75902
+ # host operator's \\\`switchroom doctor\\\` (et al.) can connect; the
75903
+ # rest of hostd is only reachable agent\u2192hostd. Mirrors
75904
+ # SWITCHROOM_BROKER_OPERATOR_UID.
75905
+ SWITCHROOM_HOSTD_OPERATOR_UID: "${operatorUid}"` : "";
75900
75906
  return `# AUTO-GENERATED by \`switchroom hostd install\` \u2014 do not hand-edit.
75901
75907
  # Edits land at \`switchroom hostd install\` time; backed up to
75902
75908
  # docker-compose.yml.bak-<ts> on overwrite.
@@ -75957,7 +75963,7 @@ services:
75957
75963
  # same config the agent fleet's compose generator did. Point at
75958
75964
  # the resolved /state/config bind so the agent fleet's config-path
75959
75965
  # convention is also what hostd reads.
75960
- SWITCHROOM_CONFIG: /state/config/switchroom.yaml
75966
+ SWITCHROOM_CONFIG: /state/config/switchroom.yaml${operatorUidEnv}
75961
75967
  # PATH must include /usr/local/bin (for the switchroom shim)
75962
75968
  # and docker plugin paths (apt installs to /usr/libexec/docker/cli-plugins).
75963
75969
  PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@@ -76018,7 +76024,8 @@ async function doInstall(opts, program3) {
76018
76024
  mkdirSync39(dir, { recursive: true });
76019
76025
  const yaml = renderHostdComposeFile({
76020
76026
  hostHome: homedir33(),
76021
- imageTag: opts.tag ?? DEFAULT_IMAGE_TAG
76027
+ imageTag: opts.tag ?? DEFAULT_IMAGE_TAG,
76028
+ operatorUid: resolveOperatorUid()
76022
76029
  });
76023
76030
  if (opts.dryRun) {
76024
76031
  console.log(source_default.dim(`# Would write: ${composePath}`));
@@ -15385,6 +15385,44 @@ class HostdServer {
15385
15385
  }
15386
15386
  this.servers.set(sockPath, server);
15387
15387
  }
15388
+ const opUidStr = process.env.SWITCHROOM_HOSTD_OPERATOR_UID;
15389
+ if (opUidStr !== undefined) {
15390
+ const opUid = Number.parseInt(opUidStr, 10);
15391
+ if (!Number.isFinite(opUid) || opUid <= 0) {
15392
+ process.stderr.write(`hostd: SWITCHROOM_HOSTD_OPERATOR_UID='${opUidStr}' is not a positive integer; skipping operator listener
15393
+ `);
15394
+ } else {
15395
+ const dir = join2(hostdDir, "operator");
15396
+ const sockPath = join2(dir, "sock");
15397
+ await mkdir(dir, { recursive: true });
15398
+ await chmod(dir, 493).catch(() => {
15399
+ return;
15400
+ });
15401
+ if (existsSync5(sockPath))
15402
+ await unlink(sockPath).catch(() => {
15403
+ return;
15404
+ });
15405
+ const server = createServer((socket) => this.onConnection(socket, sockPath));
15406
+ server.on("error", (err) => {
15407
+ process.stderr.write(`hostd: server error on ${sockPath}: ${err.message}
15408
+ `);
15409
+ });
15410
+ await new Promise((resolve6, reject) => {
15411
+ server.listen(sockPath, () => resolve6());
15412
+ server.once("error", reject);
15413
+ });
15414
+ await chmod(sockPath, 384).catch(() => {
15415
+ return;
15416
+ });
15417
+ if (process.platform === "linux" && !this.opts.allowNonLinux) {
15418
+ await chown(sockPath, opUid, opUid).catch((err) => {
15419
+ process.stderr.write(`hostd: chown(${sockPath}, uid=${opUid}): ${err.message}
15420
+ `);
15421
+ });
15422
+ }
15423
+ this.servers.set(sockPath, server);
15424
+ }
15425
+ }
15388
15426
  } catch (err) {
15389
15427
  await this.stop();
15390
15428
  throw err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switchroom",
3
- "version": "0.12.10",
3
+ "version": "0.12.11",
4
4
  "description": "Run Claude Code 24/7 on your Claude Pro/Max subscription over Telegram. Open-source alternative to OpenClaw and NanoClaw — no API keys.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46621,11 +46621,11 @@ function sweepStaleTurnActiveMarker(stateDir, opts) {
46621
46621
  }
46622
46622
 
46623
46623
  // ../src/build-info.ts
46624
- var VERSION = "0.12.10";
46625
- var COMMIT_SHA = "47240a9e";
46626
- var COMMIT_DATE = "2026-05-19T01:05:37Z";
46627
- var LATEST_PR = 1526;
46628
- var COMMITS_AHEAD_OF_TAG = 2;
46624
+ var VERSION = "0.12.11";
46625
+ var COMMIT_SHA = "334628e8";
46626
+ var COMMIT_DATE = "2026-05-19T01:32:59Z";
46627
+ var LATEST_PR = 1528;
46628
+ var COMMITS_AHEAD_OF_TAG = 4;
46629
46629
 
46630
46630
  // gateway/boot-version.ts
46631
46631
  function formatRelativeAgo(iso) {