switchroom 0.12.1 → 0.12.2

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.
@@ -46894,8 +46894,8 @@ var {
46894
46894
  } = import__.default;
46895
46895
 
46896
46896
  // src/build-info.ts
46897
- var VERSION = "0.12.1";
46898
- var COMMIT_SHA = "0de1edd1";
46897
+ var VERSION = "0.12.2";
46898
+ var COMMIT_SHA = "1eeb64be";
46899
46899
 
46900
46900
  // src/cli/agent.ts
46901
46901
  init_source();
@@ -68782,10 +68782,19 @@ function isGitCheckout(scriptPath) {
68782
68782
  }
68783
68783
  return false;
68784
68784
  }
68785
+ function rebuildRefusalMessage(scriptPath) {
68786
+ if (isGitCheckout(scriptPath))
68787
+ return null;
68788
+ return `--rebuild builds the CLI from a git checkout, but switchroom is ` + `running from "${scriptPath}" \u2014 a published install (no .git ` + `ancestor). Rebuilding from source here would drift this host off ` + `the reviewed, CI-published release. Use the published path:
68789
+ ` + `
68790
+ ` + ` npm i -g switchroom@latest && switchroom update
68791
+ ` + `
68792
+ ` + `(\`--rebuild\` is for switchroom maintainers iterating on a source ` + `checkout \u2014 not for published installs.)`;
68793
+ }
68785
68794
  function planUpdate(opts) {
68786
68795
  const composePath = opts.composePath ?? DEFAULT_COMPOSE_PATH;
68787
68796
  const runner = opts.runner ?? defaultRunner;
68788
- const scriptPath = process.argv[1] ?? "";
68797
+ const scriptPath = opts.scriptPath ?? process.argv[1] ?? "";
68789
68798
  const steps = [];
68790
68799
  const releaseOverrideArgs = [];
68791
68800
  if (opts.channel)
@@ -68832,8 +68841,9 @@ function planUpdate(opts) {
68832
68841
  name: "rebuild-source",
68833
68842
  description: "git pull upstream main + bun install + npm run build",
68834
68843
  run: () => {
68835
- if (!isGitCheckout(scriptPath)) {
68836
- throw new Error(`--rebuild requires a git checkout, but the CLI is running ` + `from ${scriptPath} which has no .git ancestor (looks like ` + `an installed binary). Drop --rebuild or invoke from a ` + `source checkout.`);
68844
+ const refusal = rebuildRefusalMessage(scriptPath);
68845
+ if (refusal) {
68846
+ throw new Error(refusal);
68837
68847
  }
68838
68848
  const pull = runner("git", ["pull", "--ff-only", "upstream", "main"]);
68839
68849
  if (pull.status !== 0)
@@ -69153,6 +69163,14 @@ async function runUpdate(opts) {
69153
69163
  `));
69154
69164
  return 2;
69155
69165
  }
69166
+ if (opts.rebuild) {
69167
+ const refusal = rebuildRefusalMessage(opts.scriptPath ?? process.argv[1] ?? "");
69168
+ if (refusal) {
69169
+ stderr(source_default.red(refusal + `
69170
+ `));
69171
+ return 2;
69172
+ }
69173
+ }
69156
69174
  const steps = planUpdate(opts);
69157
69175
  if (opts.check) {
69158
69176
  stdout(source_default.bold(`switchroom update --check (dry-run)
@@ -69190,7 +69208,7 @@ Dry-run only; nothing was changed. Re-run without --check to apply.
69190
69208
  return 0;
69191
69209
  }
69192
69210
  function registerUpdateCommand(program3) {
69193
- program3.command("update").description("Update switchroom on this host: pull images, refresh scaffolds, recreate containers. Wraps the full `pull && apply && up -d` flow.").option("--check", "Dry-run: print the steps that would execute, exit 0.").option("--skip-images", "Skip the docker image pull (offline mode).").option("--rebuild", "Source-checkout users: also git pull + bun install + npm run build before applying. Auto-skipped when the CLI is an installed binary.").option("--status", "Read-only snapshot: report local CLI version, image digest + pull time, container creation time per service. Does NOT invoke any update steps. Wired by Telegram /upgrade-status (#927).").option("--json", "Output as JSON (currently only honored under --status; other modes ignore).").addOption(new Option("--channel <c>", "Override the resolved release block for this update run: follow the named channel (dev|rc|latest). Mutually exclusive with --pin.").choices(["dev", "rc", "latest"]).conflicts("pin")).addOption(new Option("--pin <p>", "Override the resolved release block for this update run: pin to a specific build (sha-<7-40 hex> or v<semver>). Mutually exclusive with --channel.").conflicts("channel")).option("--force", "[legacy v0.6 no-op]").option("--no-restart", "[legacy v0.6 no-op]").option("--resume <file>", "[legacy v0.6 no-op]").option("--phase <phase>", "[legacy v0.6 no-op]").action(async (opts) => {
69211
+ program3.command("update").description("Update switchroom on this host: pull images, refresh scaffolds, recreate containers. Wraps the full `pull && apply && up -d` flow.").option("--check", "Dry-run: print the steps that would execute, exit 0.").option("--skip-images", "Skip the docker image pull (offline mode).").option("--rebuild", "Source-checkout / maintainer only: git pull + bun install + npm run build before applying. REFUSED on a published install \u2014 use `npm i -g switchroom@latest && switchroom update` there.").option("--status", "Read-only snapshot: report local CLI version, image digest + pull time, container creation time per service. Does NOT invoke any update steps. Wired by Telegram /upgrade-status (#927).").option("--json", "Output as JSON (currently only honored under --status; other modes ignore).").addOption(new Option("--channel <c>", "Override the resolved release block for this update run: follow the named channel (dev|rc|latest). Mutually exclusive with --pin.").choices(["dev", "rc", "latest"]).conflicts("pin")).addOption(new Option("--pin <p>", "Override the resolved release block for this update run: pin to a specific build (sha-<7-40 hex> or v<semver>). Mutually exclusive with --channel.").conflicts("channel")).option("--force", "[legacy v0.6 no-op]").option("--no-restart", "[legacy v0.6 no-op]").option("--resume <file>", "[legacy v0.6 no-op]").option("--phase <phase>", "[legacy v0.6 no-op]").action(async (opts) => {
69194
69212
  if (opts.pin && !/^(sha-[0-9a-f]{7,40}|v\d+\.\d+\.\d+)$/.test(opts.pin)) {
69195
69213
  console.error(source_default.red(`--pin "${opts.pin}" is invalid. Expected sha-<7-40 hex> or v<semver>.`));
69196
69214
  process.exit(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switchroom",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
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": {
@@ -46559,11 +46559,11 @@ function sweepStaleTurnActiveMarker(stateDir, opts) {
46559
46559
  }
46560
46560
 
46561
46561
  // ../src/build-info.ts
46562
- var VERSION = "0.12.1";
46563
- var COMMIT_SHA = "0de1edd1";
46564
- var COMMIT_DATE = "2026-05-18T08:08:32Z";
46565
- var LATEST_PR = 1503;
46566
- var COMMITS_AHEAD_OF_TAG = null;
46562
+ var VERSION = "0.12.2";
46563
+ var COMMIT_SHA = "1eeb64be";
46564
+ var COMMIT_DATE = "2026-05-18T09:09:53Z";
46565
+ var LATEST_PR = 1507;
46566
+ var COMMITS_AHEAD_OF_TAG = 2;
46567
46567
 
46568
46568
  // gateway/boot-version.ts
46569
46569
  function formatRelativeAgo(iso) {