blun-king-cli 9.1.296 → 9.1.297

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.
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ function isQueuedReload(item) {
4
+ if (item?.mode === 'channel-command') {
5
+ return item.telegramCommandName === 'reload';
6
+ }
7
+ return item?.mode === 'command' && item.text?.trim() === '/reload';
8
+ }
9
+
10
+ function removeQueuedReloadCommands(queue) {
11
+ const removed = [];
12
+ let writeIndex = 0;
13
+
14
+ for (const item of queue) {
15
+ if (isQueuedReload(item)) {
16
+ removed.push(item);
17
+ continue;
18
+ }
19
+ queue[writeIndex] = item;
20
+ writeIndex += 1;
21
+ }
22
+
23
+ queue.length = writeIndex;
24
+ return removed;
25
+ }
26
+
27
+ module.exports = { removeQueuedReloadCommands };
package/blun.mjs CHANGED
@@ -418833,6 +418833,7 @@ registerUiCatalogFragment({
418833
418833
  */
418834
418834
  var { projectUnaddressedTelegramContext } = createRequire(import.meta.url)("./bin/telegram-context-projection-policy.cjs");
418835
418835
  var { enqueueTelegramUrgent, rewriteTelegramUrgentEnvelope, telegramUrgentMessage } = createRequire(import.meta.url)("./bin/telegram-urgent-policy.cjs");
418836
+ var { removeQueuedReloadCommands } = createRequire(import.meta.url)("./bin/reload-queue-policy.cjs");
418836
418837
  const MAX_BUFFERED_CONTEXT_MESSAGES = 20;
418837
418838
  const MAX_BUFFERED_CONTEXT_CHARS = 24e3;
418838
418839
  const CONTEXT_TRUNCATED_MARKER = "\n[Telegram-Kontext gekuerzt]";
@@ -504519,6 +504520,7 @@ var EditorKeyboardController = class {
504519
504520
  return;
504520
504521
  }
504521
504522
  if (host.state.appState.isCompacting && host.streamingUI.hasActiveTurn()) {
504523
+ host.discardQueuedReloadCommands();
504522
504524
  this.cancelCurrentStream();
504523
504525
  this.clearPendingUndoEsc();
504524
504526
  return;
@@ -504533,6 +504535,7 @@ var EditorKeyboardController = class {
504533
504535
  return;
504534
504536
  }
504535
504537
  if (host.queueSteerInFlight !== void 0 || host.streamingUI.hasActiveTurn() || host.state.appState.streamingPhase !== "idle") {
504538
+ host.discardQueuedReloadCommands();
504536
504539
  this.cancelCurrentStream();
504537
504540
  this.clearPendingUndoEsc();
504538
504541
  return;
@@ -516903,7 +516906,18 @@ var BlunTUI = class {
516903
516906
  }
516904
516907
  }, routedEnvelope, this.channelPreamble);
516905
516908
  }
516909
+ discardQueuedReloadCommands() {
516910
+ const removed = removeQueuedReloadCommands(this.state.queuedMessages);
516911
+ if (removed.length === 0) return 0;
516912
+ for (const item of removed) item.channelAcknowledge?.();
516913
+ this.queueFlushBatchRemaining = Math.max(0, this.queueFlushBatchRemaining - removed.length);
516914
+ this.syncChannelQueueDeadline();
516915
+ this.updateQueueDisplay();
516916
+ this.state.ui.requestRender();
516917
+ return removed.length;
516918
+ }
516906
516919
  injectTelegramRemoteCommand(envelope, command, acknowledge) {
516920
+ if (command.name === "reload") this.discardQueuedReloadCommands();
516907
516921
  const item = {
516908
516922
  text: command.input,
516909
516923
  displayText: command.displayText,
@@ -517260,6 +517274,7 @@ var BlunTUI = class {
517260
517274
  this.track("input_queue");
517261
517275
  }
517262
517276
  enqueueSlashCommand(text) {
517277
+ if (parseSlashInput(text)?.name === "reload") this.discardQueuedReloadCommands();
517263
517278
  this.state.queuedMessages.push({
517264
517279
  text,
517265
517280
  agentId: this.harness.interactiveAgentId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.296",
3
+ "version": "9.1.297",
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": {