blun-king-cli 9.1.638 → 9.1.639

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 9.1.639
2
+
3
+ - Telegram entfernt jedes exakte Silent-Token aus ausgehenden Texten; leerer Rest wird unterdrückt.
4
+ - Strg+S erkennt fragmentierte Tastensequenzen mit eingeschobenen Terminalantworten.
5
+ - Ein ausdrücklich angeforderter Warteschlangen-Flush wird nach der Kompaktierung eines laufenden Turns fortgesetzt.
6
+
1
7
  ## 9.1.638
2
8
 
3
9
  - Die Größenwarnung der Anweisungsdatei erscheint in der Konsole nicht mehr
package/blun.mjs CHANGED
@@ -379760,6 +379760,18 @@ function extractCompleteSequences(buffer) {
379760
379760
  let pos = 0;
379761
379761
  while (pos < buffer.length) {
379762
379762
  const remaining = buffer.slice(pos);
379763
+ // Keep an interrupted keyboard CSI while delivering an embedded terminal reply.
379764
+ const nestedEscape = remaining.indexOf(ESC$1, 2);
379765
+ if (nestedEscape > 1 && /^\x1b\[[0-9:;]*$/.test(remaining.slice(0, nestedEscape))) {
379766
+ const nested = remaining.slice(nestedEscape);
379767
+ const reply = nested.match(/^\x1b\[(?:8;\d+;\d+t|\?[\d;]*[cu])/);
379768
+ if (reply !== null) {
379769
+ sequences.push(reply[0]);
379770
+ buffer = buffer.slice(0, pos) + remaining.slice(0, nestedEscape) + nested.slice(reply[0].length);
379771
+ continue;
379772
+ }
379773
+ if (/^\x1b(?:\[(?:\?[\d;]*|8(?:;\d*){0,2})?)?$/.test(nested)) return { sequences, remainder: remaining };
379774
+ }
379763
379775
  if (remaining.startsWith(ESC$1)) {
379764
379776
  let seqEnd = 1;
379765
379777
  while (seqEnd <= remaining.length) {
@@ -379874,7 +379886,7 @@ var init_stdin_buffer = __esmMin((() => {
379874
379886
  if (this.buffer.length > 0) this.timeout = setTimeout(() => {
379875
379887
  const flushed = this.flush();
379876
379888
  for (const sequence of flushed) this.emitDataSequence(sequence);
379877
- }, this.timeoutMs);
379889
+ }, this.buffer.startsWith(`${ESC$1}[`) ? Math.max(this.timeoutMs, 100) : this.timeoutMs);
379878
379890
  }
379879
379891
  emitDataSequence(sequence) {
379880
379892
  const rawCodepoint = sequence.length === 1 ? sequence.codePointAt(0) : void 0;
@@ -536295,7 +536307,7 @@ var init_session_event_handler = __esmMin((() => {
536295
536307
  });
536296
536308
  this.host.resetLivePane();
536297
536309
  this.host.requestQueueDrain();
536298
- } else this.host.setAppState({ isCompacting: false });
536310
+ } else { this.host.setAppState({ isCompacting: false }); this.host.steerQueueFlushPrefix(); }
536299
536311
  }
536300
536312
  handleBackgroundTaskEvent(event) {
536301
536313
  const { state } = this.host;
@@ -542716,7 +542728,10 @@ function isGroupSuppressed(text, _contextOnly) {
542716
542728
  return isGroupNoiseReply(text);
542717
542729
  }
542718
542730
  async function sendReplyFallback(chatId, text, contextOnly = false, requireDelivery = false, progress) {
542719
- if (typeof text === "string" && text.trim() === "[[BLUN_TELEGRAM_SILENT]]") return true;
542731
+ if (typeof text === "string") {
542732
+ text = text.split("[[BLUN_TELEGRAM_SILENT]]").join("");
542733
+ if (text.trim().length === 0) return true;
542734
+ }
542720
542735
  if (isGroupChat(chatId) && isGroupSuppressed(text, contextOnly)) {
542721
542736
  try {
542722
542737
  appendFileSync(outboxPath(), `${JSON.stringify({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.638",
3
+ "version": "9.1.639",
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": {
@@ -68029,7 +68029,10 @@ function scrubSecrets(text) {
68029
68029
  * log it to outbox.jsonl as kind "reply-fallback". Returns true on success.
68030
68030
  */
68031
68031
  async function sendReplyFallback(chatId, rawText) {
68032
- if (typeof rawText === "string" && rawText.trim() === "[[BLUN_TELEGRAM_SILENT]]") return true;
68032
+ if (typeof rawText === "string") {
68033
+ rawText = rawText.split("[[BLUN_TELEGRAM_SILENT]]").join("");
68034
+ if (rawText.trim().length === 0) return true;
68035
+ }
68033
68036
  const token = botToken();
68034
68037
  if (token === void 0) return false;
68035
68038
  if (isGroupChat(chatId) && isGroupNoiseReply(rawText)) {
@@ -73600,7 +73600,10 @@ async function runTool(api, token, name, args) {
73600
73600
  case "download_attachment": return runDownload(api, token, args["file_id"]);
73601
73601
  case "edit_message": {
73602
73602
  const chatId = resolveAllowedChatId(args["chat_id"]);
73603
- if (typeof args["text"] === "string" && args["text"].trim() === "[[BLUN_TELEGRAM_SILENT]]") return "unterdrückt";
73603
+ if (typeof args["text"] === "string") {
73604
+ args = { ...args, text: args["text"].split("[[BLUN_TELEGRAM_SILENT]]").join("") };
73605
+ if (args["text"].trim().length === 0) return "unterdrückt";
73606
+ }
73604
73607
  assertTelegramLanguageReleased(args["text"], args["release_token"]);
73605
73608
  const parseMode = args["format"] === "markdownv2" ? "MarkdownV2" : void 0;
73606
73609
  const edited = await api.editMessageText(chatId, Number(args["message_id"]), args["text"], parseMode !== void 0 ? { parse_mode: parseMode } : void 0);
@@ -73649,8 +73652,8 @@ function isRecentDuplicate(chatId, text) {
73649
73652
  }
73650
73653
  async function runReply(api, args) {
73651
73654
  const chatId = resolveAllowedChatId(args["chat_id"]);
73652
- const text = args["text"];
73653
- if (typeof text === "string" && text.trim() === "[[BLUN_TELEGRAM_SILENT]]") return "unterdrückt";
73655
+ const text = typeof args["text"] === "string" ? args["text"].split("[[BLUN_TELEGRAM_SILENT]]").join("") : args["text"];
73656
+ if (typeof text === "string" && text.trim().length === 0) return "unterdrückt";
73654
73657
  const replyTo = args["reply_to"] !== null && args["reply_to"] !== void 0 ? Number(args["reply_to"]) : void 0;
73655
73658
  const files = args["files"] ?? [];
73656
73659
  const parseMode = args["format"] === "markdownv2" ? "MarkdownV2" : void 0;