blun-king-cli 9.1.194 → 9.1.196
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/bin/launcher-runtime.js +18 -2
- package/blun.mjs +3 -2
- package/package.json +1 -1
package/bin/launcher-runtime.js
CHANGED
|
@@ -256,11 +256,23 @@ async function waitForRuntimeReady(core, timeoutMs = RUNTIME_READY_TIMEOUT_MS) {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
function resolveHandoffCwd(candidate, fallback) {
|
|
260
|
+
if (typeof candidate !== 'string' || candidate.trim().length === 0 || !path.isAbsolute(candidate)) {
|
|
261
|
+
return fallback;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
return fs.statSync(candidate).isDirectory() ? path.resolve(candidate) : fallback;
|
|
265
|
+
} catch {
|
|
266
|
+
return fallback;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
259
270
|
async function superviseProtectedCore(args, env, cwd, releaseNotice, options = {}) {
|
|
260
271
|
const packageRoot = path.resolve(options.packageRoot || PKG);
|
|
261
272
|
let preparedTarget;
|
|
262
273
|
let handoffSessionId;
|
|
263
274
|
let handoffMode;
|
|
275
|
+
let handoffCwd = cwd;
|
|
264
276
|
let updateStarted = false;
|
|
265
277
|
let runtimeReady = false;
|
|
266
278
|
let runningUpdatePollTimer;
|
|
@@ -273,6 +285,7 @@ async function superviseProtectedCore(args, env, cwd, releaseNotice, options = {
|
|
|
273
285
|
runningUpdateMode = persistedMode;
|
|
274
286
|
handoffSessionId = undefined;
|
|
275
287
|
handoffMode = undefined;
|
|
288
|
+
handoffCwd = cwd;
|
|
276
289
|
}
|
|
277
290
|
};
|
|
278
291
|
const clearRunningUpdatePoll = () => {
|
|
@@ -337,6 +350,7 @@ async function superviseProtectedCore(args, env, cwd, releaseNotice, options = {
|
|
|
337
350
|
runningUpdateMode = normalizeRunningUpdateMode(message.mode);
|
|
338
351
|
handoffSessionId = undefined;
|
|
339
352
|
handoffMode = undefined;
|
|
353
|
+
handoffCwd = cwd;
|
|
340
354
|
clearRunningUpdatePoll();
|
|
341
355
|
if (automaticMode()) {
|
|
342
356
|
if (preparedTarget !== undefined) announcePrepared(child);
|
|
@@ -353,6 +367,7 @@ async function superviseProtectedCore(args, env, cwd, releaseNotice, options = {
|
|
|
353
367
|
&& automaticMode()) {
|
|
354
368
|
handoffSessionId = message.sessionId;
|
|
355
369
|
handoffMode = runningUpdateMode;
|
|
370
|
+
handoffCwd = resolveHandoffCwd(message.cwd, cwd);
|
|
356
371
|
}
|
|
357
372
|
};
|
|
358
373
|
const spawnCore = options.spawnProtectedCore || spawnProtectedCore;
|
|
@@ -394,7 +409,7 @@ async function superviseProtectedCore(args, env, cwd, releaseNotice, options = {
|
|
|
394
409
|
probeTarget: options.probeRunningUpdate || (() => true),
|
|
395
410
|
stopOld: async () => {},
|
|
396
411
|
startCore: async ({ packageRoot: nextRoot, args: nextArgs }) => {
|
|
397
|
-
const nextCore = spawnCore(nextArgs, env,
|
|
412
|
+
const nextCore = spawnCore(nextArgs, env, handoffCwd, { packageRoot: nextRoot });
|
|
398
413
|
const nextLoaded = await nextCore.loaded;
|
|
399
414
|
const ready = nextLoaded && await waitForRuntimeReady(nextCore, options.readyTimeoutMs);
|
|
400
415
|
if (!ready) {
|
|
@@ -408,7 +423,7 @@ async function superviseProtectedCore(args, env, cwd, releaseNotice, options = {
|
|
|
408
423
|
const resumed = handoff.core;
|
|
409
424
|
if (resumed === undefined || resumed.ready !== true) return 1;
|
|
410
425
|
const resumedArgs = handoffArgsForMode(args, handoffMode, handoffSessionId);
|
|
411
|
-
return superviseProtectedCore(resumedArgs, env,
|
|
426
|
+
return superviseProtectedCore(resumedArgs, env, handoffCwd, async () => {}, {
|
|
412
427
|
...options,
|
|
413
428
|
existingCore: resumed,
|
|
414
429
|
packageRoot: handoff.runtime.packageRoot,
|
|
@@ -745,6 +760,7 @@ module.exports = {
|
|
|
745
760
|
RUNNING_UPDATE_RECHECK_MS,
|
|
746
761
|
createManagedNodeEnvironment,
|
|
747
762
|
resolveLauncherPrivatePaths,
|
|
763
|
+
resolveHandoffCwd,
|
|
748
764
|
runningUpdateRecheckDelay,
|
|
749
765
|
runLauncher,
|
|
750
766
|
scheduleRunningUpdateRecheck,
|
package/blun.mjs
CHANGED
|
@@ -418315,7 +418315,7 @@ function bufferContext(state, chatId, tag) {
|
|
|
418315
418315
|
function channelOrigin(envelope) {
|
|
418316
418316
|
return `Telegram · ${envelope.meta.user ?? envelope.meta.chat_id}`;
|
|
418317
418317
|
}
|
|
418318
|
-
const TELEGRAM_REMOTE_COMMANDS = Object.freeze(["loop", "goal", "idea", "chancenradar", "curiosity", "scout", "befehle"]);
|
|
418318
|
+
const TELEGRAM_REMOTE_COMMANDS = Object.freeze(["loop", "goal", "idea", "chancenradar", "curiosity", "scout", "reload", "befehle"]);
|
|
418319
418319
|
function telegramRemoteCommand(text) {
|
|
418320
418320
|
const trimmed = text.trim();
|
|
418321
418321
|
const parsed = parseSlashInput(trimmed);
|
|
@@ -515007,7 +515007,8 @@ function requestRunningUpdateAtSafeBoundary(tui) {
|
|
|
515007
515007
|
type: RUNNING_UPDATE_HANDOFF_MESSAGE,
|
|
515008
515008
|
sessionId,
|
|
515009
515009
|
version: tui.runningUpdatePreparedVersion,
|
|
515010
|
-
mode: tui.runningUpdatePreparedMode
|
|
515010
|
+
mode: tui.runningUpdatePreparedMode,
|
|
515011
|
+
cwd: tui.state.appState.workDir
|
|
515011
515012
|
}, (error) => {
|
|
515012
515013
|
if (error || !isSafeRuntimeBoundary(boundaryState())) {
|
|
515013
515014
|
tui.runningUpdateHandoffStarted = false;
|