blun-king-cli 9.1.339 → 9.1.341

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.
@@ -272,6 +272,13 @@ function isAutomaticRunningUpdateMode(mode) {
272
272
  return mode === RUNNING_UPDATE_MODES.RESUME || mode === RUNNING_UPDATE_MODES.NEW;
273
273
  }
274
274
 
275
+ function shouldLaunchPreparedRuntimeAutomatically(runtime, mode) {
276
+ return runtime !== undefined
277
+ && runtime !== null
278
+ && isAutomaticRunningUpdateMode(mode)
279
+ && runtime.mode === mode;
280
+ }
281
+
275
282
  async function prepareAutomaticStartupRuntime(options) {
276
283
  if (options.existingRuntime !== undefined) return options.existingRuntime;
277
284
  const runningUpdateMode = readRunningUpdateMode(options.profileHome);
@@ -796,6 +803,23 @@ async function runLauncher(options = {}) {
796
803
  } catch {}
797
804
  }
798
805
 
806
+ if (shouldLaunchPreparedRuntimeAutomatically(deferredPendingRuntime, runningUpdateMode)) {
807
+ const pendingArgs = deferredPendingRuntime.mode === RUNNING_UPDATE_MODES.RESUME
808
+ && deferredPendingRuntime.sessionId !== undefined
809
+ ? handoffArgsForMode(RAW_ARGS, deferredPendingRuntime.mode, deferredPendingRuntime.sessionId)
810
+ : RAW_ARGS;
811
+ await releaseNotice();
812
+ process.exitCode = await spawnActiveLauncher(
813
+ deferredPendingRuntime.packageRoot,
814
+ deferredPendingRuntime.cwd || callerCwd,
815
+ pendingArgs,
816
+ deferredPendingRuntime.mode === RUNNING_UPDATE_MODES.RESUME
817
+ ? { resumeSessionId: deferredPendingRuntime.sessionId }
818
+ : {},
819
+ );
820
+ return;
821
+ }
822
+
799
823
  // --- 1. Oeffentlicher npm-Update-Dialog. -------------------------------
800
824
  const updateResult = options.skipUpdateNotice === true
801
825
  ? { kind: 'continue', reason: 'notice_busy' }
@@ -917,6 +941,7 @@ module.exports = {
917
941
  runningUpdateRecheckDelay,
918
942
  runLauncher,
919
943
  scheduleRunningUpdateRecheck,
944
+ shouldLaunchPreparedRuntimeAutomatically,
920
945
  shouldRecoverActivatedRuntime,
921
946
  shouldDetachProtectedCore,
922
947
  spawnManagedLauncher,
package/blun.mjs CHANGED
@@ -340412,7 +340412,8 @@ function getUpdateStateFile() {
340412
340412
  * Return the update install state file: `<dataDir>/updates/install.json`.
340413
340413
  */
340414
340414
  function getUpdateInstallStateFile() {
340415
- return join(getDataDir(), BLUN_UPDATE_DIR_NAME, BLUN_UPDATE_INSTALL_STATE_FILE_NAME);
340415
+ const sharedHome = process.env["BLUN_SHARED_HOME"]?.trim();
340416
+ return join(sharedHome || getDataDir(), BLUN_UPDATE_DIR_NAME, BLUN_UPDATE_INSTALL_STATE_FILE_NAME);
340416
340417
  }
340417
340418
  /**
340418
340419
  * Return the rollout decision log: `<dataDir>/updates/rollout.log`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.339",
3
+ "version": "9.1.341",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {