blun-king-cli 9.1.595 → 9.1.596

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/blun.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // BLUN_BUILD_INPUT_SHA256:bb2a99b699d299ac283bd9b157d0c18555ae0ab62c58c7b3c10d8311dfa87a0d
2
+ // BLUN_BUILD_INPUT_SHA256:2c4b3f451c41d328bb5eb43ffb226f0f3b0c458270217cecb6e1ffc63287e8bd
3
3
  import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
4
4
  import { dirname as __cjsShimDirname } from 'node:path';
5
5
  const __filename = __cjsShimFileURLToPath(import.meta.url);
@@ -530546,6 +530546,7 @@ var SessionEventHandler = class {
530546
530546
  currentTurnHasAssistantText = false;
530547
530547
  currentTurnStartedAtMs;
530548
530548
  currentTurnTokenCount;
530549
+ pendingChannelInterruption;
530549
530550
  pendingModelBlockedFallback;
530550
530551
  queuedGoalPromotionPending = false;
530551
530552
  queuedGoalPromotionInFlight = false;
@@ -530566,6 +530567,7 @@ var SessionEventHandler = class {
530566
530567
  this.currentTurnHasAssistantText = false;
530567
530568
  this.currentTurnStartedAtMs = void 0;
530568
530569
  this.currentTurnTokenCount = void 0;
530570
+ this.pendingChannelInterruption = void 0;
530569
530571
  this.pendingModelBlockedFallback = void 0;
530570
530572
  this.queuedGoalPromotionPending = false;
530571
530573
  this.queuedGoalPromotionInFlight = false;
@@ -530578,6 +530580,27 @@ var SessionEventHandler = class {
530578
530580
  clearAgentSwarmProgress() {
530579
530581
  this.subAgentEventHandler.clearAgentSwarmProgress();
530580
530582
  }
530583
+ async interruptForQueuedChannel() {
530584
+ const session = this.host.session;
530585
+ if (session === void 0) return;
530586
+ const pending = {
530587
+ sessionId: session.id,
530588
+ turnId: this.host.streamingUI.getTurnContext().turnId
530589
+ };
530590
+ this.pendingChannelInterruption = pending;
530591
+ try {
530592
+ await session.cancel();
530593
+ } catch (error) {
530594
+ if (this.pendingChannelInterruption === pending) this.pendingChannelInterruption = void 0;
530595
+ throw error;
530596
+ }
530597
+ }
530598
+ consumeChannelInterruption(sessionId, turnId) {
530599
+ const pending = this.pendingChannelInterruption;
530600
+ if (pending === void 0 || pending.sessionId !== sessionId || pending.turnId !== void 0 && pending.turnId !== String(turnId)) return false;
530601
+ this.pendingChannelInterruption = void 0;
530602
+ return true;
530603
+ }
530581
530604
  hasActiveAgentSwarmToolCall() {
530582
530605
  return this.subAgentEventHandler.hasActiveAgentSwarmToolCall();
530583
530606
  }
@@ -530741,6 +530764,7 @@ var SessionEventHandler = class {
530741
530764
  this.mcpServerStatusSpinners.clear();
530742
530765
  }
530743
530766
  handleTurnBegin(event) {
530767
+ this.pendingChannelInterruption = void 0;
530744
530768
  this.host.goalChannelReplies?.beginTurn(event.sessionId, this.host.state.appState.goal?.goalId, event.turnId);
530745
530769
  this.hideCompactionRetry();
530746
530770
  const sessionId = this.host.session?.id;
@@ -530781,6 +530805,7 @@ var SessionEventHandler = class {
530781
530805
  });
530782
530806
  }
530783
530807
  handleTurnEnd(event, sendQueued) {
530808
+ this.consumeChannelInterruption(event.sessionId, event.turnId);
530784
530809
  this.host.restoreQueuedSteerAtTurnEnd(event.turnId);
530785
530810
  const sessionId = this.host.session?.id;
530786
530811
  if (sessionId !== void 0) finishPersonalMemoryRememberIntentTurn(sessionId, event.turnId);
@@ -530867,10 +530892,11 @@ var SessionEventHandler = class {
530867
530892
  this.host.streamingUI.resetToolUi();
530868
530893
  this.host.streamingUI.finalizeLiveTextBuffers("idle");
530869
530894
  const reason = event.reason;
530895
+ const channelInterruption = this.consumeChannelInterruption(event.sessionId, event.turnId);
530870
530896
  if (reason === "error") return;
530871
530897
  if (reason === "aborted" || reason === void 0 || reason === "") {
530872
530898
  this.markActiveAgentSwarmsCancelled();
530873
- this.host.showStatus(uiText("sessionEvent.interrupted.user"), "error");
530899
+ this.host.showStatus(channelInterruption ? uiText("sessionEvent.interrupted.reason", { reason: "Telegram" }) : uiText("sessionEvent.interrupted.user"), channelInterruption ? "warning" : "error");
530874
530900
  return;
530875
530901
  }
530876
530902
  this.host.showError(reason === "max_steps" ? uiText("sessionEvent.interrupted.maxSteps") : uiText("sessionEvent.interrupted.reason", { reason }));
@@ -537787,7 +537813,7 @@ var BlunTUI = class {
537787
537813
  deliverOne: () => this.deliverQueuedChannelHead(),
537788
537814
  canInterruptWaitingWork: () => this.canInterruptForQueuedChannel(),
537789
537815
  interruptWaitingWork: async () => {
537790
- await this.session?.cancel();
537816
+ await this.sessionEventHandler.interruptForQueuedChannel();
537791
537817
  }
537792
537818
  });
537793
537819
  this.managedQuotaWarningController = new ManagedQuotaWarningController({ onChange: (warning) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.595",
3
+ "version": "9.1.596",
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": {
package/worker-host.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // BLUN_BUILD_INPUT_SHA256:bb2a99b699d299ac283bd9b157d0c18555ae0ab62c58c7b3c10d8311dfa87a0d
2
+ // BLUN_BUILD_INPUT_SHA256:2c4b3f451c41d328bb5eb43ffb226f0f3b0c458270217cecb6e1ffc63287e8bd
3
3
  import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
4
4
  import { dirname as __cjsShimDirname } from 'node:path';
5
5
  const __filename = __cjsShimFileURLToPath(import.meta.url);