blun-king-cli 9.1.71 → 9.1.73
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/update-notice.js +16 -13
- package/blun.mjs +5 -5
- package/package.json +1 -1
package/bin/update-notice.js
CHANGED
|
@@ -400,8 +400,9 @@ function statePath(blunDir) {
|
|
|
400
400
|
return path.join(blunDir, STATE_FILE);
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
function readSnoozeState(blunDir, now = Date.now()) {
|
|
403
|
+
function readSnoozeState(blunDir, targetVersion, now = Date.now()) {
|
|
404
404
|
try {
|
|
405
|
+
if (!parseSemver(targetVersion)) return false;
|
|
405
406
|
const filePath = statePath(blunDir);
|
|
406
407
|
if (!fs.existsSync(filePath)) return false;
|
|
407
408
|
securePrivateFile(filePath);
|
|
@@ -409,10 +410,13 @@ function readSnoozeState(blunDir, now = Date.now()) {
|
|
|
409
410
|
if (!stat.isFile() || stat.isSymbolicLink() || stat.size > 1_024) return false;
|
|
410
411
|
const record = exactDataRecord(JSON.parse(fs.readFileSync(filePath, 'utf8')), [
|
|
411
412
|
'snoozedUntil',
|
|
413
|
+
'targetVersion',
|
|
412
414
|
'version',
|
|
413
415
|
]);
|
|
414
416
|
if (!record
|
|
415
|
-
|| record.version !==
|
|
417
|
+
|| record.version !== 2
|
|
418
|
+
|| record.targetVersion !== targetVersion
|
|
419
|
+
|| !parseSemver(record.targetVersion)
|
|
416
420
|
|| !Number.isSafeInteger(record.snoozedUntil)
|
|
417
421
|
|| record.snoozedUntil <= now
|
|
418
422
|
|| record.snoozedUntil > now + SNOOZE_MS) {
|
|
@@ -424,7 +428,8 @@ function readSnoozeState(blunDir, now = Date.now()) {
|
|
|
424
428
|
}
|
|
425
429
|
}
|
|
426
430
|
|
|
427
|
-
function writeSnoozeState(blunDir, now = Date.now()) {
|
|
431
|
+
function writeSnoozeState(blunDir, targetVersion, now = Date.now()) {
|
|
432
|
+
if (!parseSemver(targetVersion)) throw new Error('INVALID_UPDATE_VERSION');
|
|
428
433
|
ensurePrivateDirectory(blunDir);
|
|
429
434
|
const filePath = statePath(blunDir);
|
|
430
435
|
const temporaryPath = path.join(
|
|
@@ -433,7 +438,8 @@ function writeSnoozeState(blunDir, now = Date.now()) {
|
|
|
433
438
|
);
|
|
434
439
|
try {
|
|
435
440
|
writePrivateFile(temporaryPath, `${JSON.stringify({
|
|
436
|
-
version:
|
|
441
|
+
version: 2,
|
|
442
|
+
targetVersion,
|
|
437
443
|
snoozedUntil: now + SNOOZE_MS,
|
|
438
444
|
})}\n`);
|
|
439
445
|
const handle = fs.openSync(temporaryPath, 'r+');
|
|
@@ -1340,9 +1346,6 @@ async function runUpdateFlow(options, explicitUpdate) {
|
|
|
1340
1346
|
pendingVersion = undefined;
|
|
1341
1347
|
}
|
|
1342
1348
|
const now = (options.now || Date.now)();
|
|
1343
|
-
if (!explicitUpdate && pendingVersion === undefined && readSnoozeState(blunDir, now)) {
|
|
1344
|
-
return { kind: 'continue', reason: 'snoozed' };
|
|
1345
|
-
}
|
|
1346
1349
|
|
|
1347
1350
|
const packageRoot = path.resolve(options.packageRoot || path.resolve(__dirname, '..'));
|
|
1348
1351
|
let leaseResult;
|
|
@@ -1373,11 +1376,6 @@ async function runUpdateFlow(options, explicitUpdate) {
|
|
|
1373
1376
|
let installerSession;
|
|
1374
1377
|
|
|
1375
1378
|
try {
|
|
1376
|
-
if (!explicitUpdate
|
|
1377
|
-
&& pendingVersion === undefined
|
|
1378
|
-
&& readSnoozeState(blunDir, (options.now || Date.now)())) {
|
|
1379
|
-
return { kind: 'continue', reason: 'snoozed' };
|
|
1380
|
-
}
|
|
1381
1379
|
let sources;
|
|
1382
1380
|
try {
|
|
1383
1381
|
sources = await (options.loadReleaseSources || loadReleaseSources)();
|
|
@@ -1395,6 +1393,11 @@ async function runUpdateFlow(options, explicitUpdate) {
|
|
|
1395
1393
|
? explicitNoTarget(stdout, reason, currentVersion)
|
|
1396
1394
|
: { kind: 'continue', reason };
|
|
1397
1395
|
}
|
|
1396
|
+
if (!explicitUpdate
|
|
1397
|
+
&& pendingVersion === undefined
|
|
1398
|
+
&& readSnoozeState(blunDir, release.version, now)) {
|
|
1399
|
+
return { kind: 'continue', reason: 'snoozed' };
|
|
1400
|
+
}
|
|
1398
1401
|
const queuedForRelease = pendingVersion === release.version;
|
|
1399
1402
|
const initialInstallLease = await probeInstallLease(options, packageRoot);
|
|
1400
1403
|
if (initialInstallLease === 'busy') {
|
|
@@ -1478,7 +1481,7 @@ async function runUpdateFlow(options, explicitUpdate) {
|
|
|
1478
1481
|
return { kind: 'continue', reason: 'skipped_version' };
|
|
1479
1482
|
}
|
|
1480
1483
|
try {
|
|
1481
|
-
writeSnoozeState(blunDir, (options.now || Date.now)());
|
|
1484
|
+
writeSnoozeState(blunDir, release.version, (options.now || Date.now)());
|
|
1482
1485
|
} catch {
|
|
1483
1486
|
// A failed preference write must not block the existing console.
|
|
1484
1487
|
}
|
package/blun.mjs
CHANGED
|
@@ -502426,7 +502426,7 @@ var EditorKeyboardController = class {
|
|
|
502426
502426
|
this.clearPendingExit();
|
|
502427
502427
|
return;
|
|
502428
502428
|
}
|
|
502429
|
-
if (host.state.appState.streamingPhase !== "idle") {
|
|
502429
|
+
if (host.streamingUI.hasActiveTurn() || host.state.appState.streamingPhase !== "idle") {
|
|
502430
502430
|
this.clearPendingExit();
|
|
502431
502431
|
this.cancelCurrentStream();
|
|
502432
502432
|
return;
|
|
@@ -502475,7 +502475,7 @@ var EditorKeyboardController = class {
|
|
|
502475
502475
|
this.clearPendingUndoEsc();
|
|
502476
502476
|
return;
|
|
502477
502477
|
}
|
|
502478
|
-
if (host.state.appState.streamingPhase !== "idle") {
|
|
502478
|
+
if (host.streamingUI.hasActiveTurn() || host.state.appState.streamingPhase !== "idle") {
|
|
502479
502479
|
this.cancelCurrentStream();
|
|
502480
502480
|
this.clearPendingUndoEsc();
|
|
502481
502481
|
return;
|
|
@@ -514511,7 +514511,7 @@ var BlunTUI = class {
|
|
|
514511
514511
|
this.channelQueueDeadline.requestDeliveryAtSafePoint();
|
|
514512
514512
|
}
|
|
514513
514513
|
canDrainQueue() {
|
|
514514
|
-
return !this.isShuttingDown && !this.queueCommandRunning && this.queueSteerInFlight === void 0 && !this.editorReplacementActive && !this.deferUserMessages && this.state.appState.streamingPhase === "idle" && !this.state.appState.isCompacting;
|
|
514514
|
+
return !this.isShuttingDown && !this.queueCommandRunning && this.queueSteerInFlight === void 0 && !this.editorReplacementActive && !this.deferUserMessages && !this.streamingUI.hasActiveTurn() && this.state.appState.streamingPhase === "idle" && !this.state.appState.isCompacting;
|
|
514515
514515
|
}
|
|
514516
514516
|
scheduleQueueDrain() {
|
|
514517
514517
|
if (this.queueDrainTimer !== void 0 || !this.canDrainQueue()) return;
|
|
@@ -514640,7 +514640,7 @@ var BlunTUI = class {
|
|
|
514640
514640
|
}
|
|
514641
514641
|
injectChannelEnvelope({
|
|
514642
514642
|
canDeliver: () => this.session !== void 0 && this.state.appState.model.trim().length > 0,
|
|
514643
|
-
isBusy: () => this.state.queuedMessages.length > 0 || this.queueSteerInFlight !== void 0 || this.deferUserMessages || this.state.appState.streamingPhase !== "idle" || this.state.appState.isCompacting,
|
|
514643
|
+
isBusy: () => this.state.queuedMessages.length > 0 || this.queueSteerInFlight !== void 0 || this.deferUserMessages || this.streamingUI.hasActiveTurn() || this.state.appState.streamingPhase !== "idle" || this.state.appState.isCompacting,
|
|
514644
514644
|
deliverNow: (modelInput, displayText, origin, contextOnly) => {
|
|
514645
514645
|
this.sendChannelMessageInternal(this.requireSession(), modelInput, displayText, origin, envelope.meta.chat_id, envelope.meta["image_path"], contextOnly, false, acknowledge);
|
|
514646
514646
|
},
|
|
@@ -514694,7 +514694,7 @@ var BlunTUI = class {
|
|
|
514694
514694
|
channelAcknowledge: acknowledge,
|
|
514695
514695
|
telegramCommandName: command.name
|
|
514696
514696
|
};
|
|
514697
|
-
const busy = this.state.queuedMessages.length > 0 || this.queueSteerInFlight !== void 0 || this.pendingChannelReplyGuard !== void 0 || this.deferUserMessages || this.state.appState.streamingPhase !== "idle" || this.state.appState.isCompacting;
|
|
514697
|
+
const busy = this.state.queuedMessages.length > 0 || this.queueSteerInFlight !== void 0 || this.pendingChannelReplyGuard !== void 0 || this.deferUserMessages || this.streamingUI.hasActiveTurn() || this.state.appState.streamingPhase !== "idle" || this.state.appState.isCompacting;
|
|
514698
514698
|
if (busy) {
|
|
514699
514699
|
this.state.queuedMessages.push(item);
|
|
514700
514700
|
this.track("input_queue", { kind: "channel-command" });
|