@scalequality/cli 0.4.26 → 0.4.27

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "sdkVersion": "0.3.281",
3
- "sha256": "ebd46f14f8e05298136ff04bc67f5fb4a2d61ee32e9055dbd67fdf1c029e3c4c",
4
- "sourceCommit": "f76c71e37a1b708ec1ab0e1e09588155c81aeff1"
3
+ "sha256": "17180f5819c1bc15eb3673f2b233c0ed2bfec058b6e5c61f664c1e31a814d8a5",
4
+ "sourceCommit": "2d39889d75ad2d495e1d185212f15d0113581f52"
5
5
  }
package/dist/connect.cjs CHANGED
@@ -14133,9 +14133,14 @@ function confirmCurrent(home, version) {
14133
14133
  const current = readCurrent(home);
14134
14134
  if (!current || current.version !== version || !current.pending) return false;
14135
14135
  writeJsonAtomic(currentPath(home), { ...current, pending: false, attempts: 0, previous: null });
14136
- removeStableCopies(home, [version]);
14136
+ removeStableCopies(home, [version, ...current.previous ? [current.previous.version] : []]);
14137
14137
  return true;
14138
14138
  }
14139
+ function behindCurrent(home, version) {
14140
+ const current = readCurrent(home);
14141
+ if (!current || current.pending || current.version === version || !isNewer(current.version, version) || !(0, import_fs11.existsSync)(current.bin)) return null;
14142
+ return current.version;
14143
+ }
14139
14144
  function autoUpdateEnabled(home, env) {
14140
14145
  return env.SCALEQUALITY_NO_AUTO_UPDATE !== "1" && !(0, import_fs11.existsSync)(autoUpdateOffPath(home));
14141
14146
  }
@@ -14681,7 +14686,7 @@ async function upMain(api, verbose, service) {
14681
14686
  function startSelfUpdate(api, busy, restart) {
14682
14687
  const confirm = setTimeout(() => {
14683
14688
  try {
14684
- if (confirmCurrent(HOME, cliVersion)) say(`Version ${cliVersion} started well; the previous copy was removed.`);
14689
+ if (confirmCurrent(HOME, cliVersion)) say(`Version ${cliVersion} started well.`);
14685
14690
  } catch (e) {
14686
14691
  say(`[warn] version ${cliVersion} not confirmed: ${e.message}`);
14687
14692
  }
@@ -14712,6 +14717,17 @@ function startSelfUpdate(api, busy, restart) {
14712
14717
  };
14713
14718
  setTimeout(() => void check(), UPDATE_FIRST_CHECK_MS).unref();
14714
14719
  setInterval(() => void check(), UPDATE_INTERVAL_MS).unref();
14720
+ if (process.env.SCALEQUALITY_LAUNCHER === "1") setInterval(() => {
14721
+ try {
14722
+ const next = !busy() ? behindCurrent(HOME, cliVersion) : null;
14723
+ if (next) {
14724
+ say(`This computer moved to version ${next}; restarting on it.`);
14725
+ restart();
14726
+ }
14727
+ } catch (e) {
14728
+ say(`[warn] version check failed: ${e.message}`);
14729
+ }
14730
+ }, UPDATE_IDLE_POLL_MS).unref();
14715
14731
  say(style.dim(autoUpdateEnabled(HOME, process.env) ? ` Updates install by themselves while no session runs (scalequality service auto-update off${apiFlag(api)} to stop).` : " Automatic updates are off."));
14716
14732
  }
14717
14733
  async function addMain(api, path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalequality/cli",
3
- "version": "0.4.26",
3
+ "version": "0.4.27",
4
4
  "description": "ScaleQuality CLI. Connect your computer to the ScaleQuality AI Workspace (`scalequality login`), run its coding engine in any folder of your computer, and import your Claude Code and Codex conversations.",
5
5
  "type": "module",
6
6
  "bin": {