blun-king-cli 9.1.349 → 9.1.350

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.
Files changed (2) hide show
  1. package/blun.mjs +34 -0
  2. package/package.json +1 -1
package/blun.mjs CHANGED
@@ -493833,6 +493833,9 @@ var ToolCallComponent = class ToolCallComponent extends Container {
493833
493833
  pendingSubToolDeltaIds = /* @__PURE__ */ new Set();
493834
493834
  subToolDeltaRenderTimer;
493835
493835
  lastSubToolDeltaFlushAt;
493836
+ pendingSubToolLiveOutputIds = /* @__PURE__ */ new Set();
493837
+ subToolLiveOutputRenderTimer;
493838
+ lastSubToolLiveOutputFlushAt;
493836
493839
  hiddenSubCallCount = 0;
493837
493840
  /**
493838
493841
  * Recent normal-output lines from the child agent. Historical replay can also
@@ -494027,6 +494030,11 @@ var ToolCallComponent = class ToolCallComponent extends Container {
494027
494030
  this.subToolDeltaRenderTimer = void 0;
494028
494031
  }
494029
494032
  this.pendingSubToolDeltaIds.clear();
494033
+ if (this.subToolLiveOutputRenderTimer !== void 0) {
494034
+ clearTimeout(this.subToolLiveOutputRenderTimer);
494035
+ this.subToolLiveOutputRenderTimer = void 0;
494036
+ }
494037
+ this.pendingSubToolLiveOutputIds.clear();
494030
494038
  if (this.liveOutputRenderTimer !== void 0) {
494031
494039
  clearTimeout(this.liveOutputRenderTimer);
494032
494040
  this.liveOutputRenderTimer = void 0;
@@ -494514,12 +494522,38 @@ var ToolCallComponent = class ToolCallComponent extends Container {
494514
494522
  let output = (activity?.output ?? "") + text;
494515
494523
  if (output.length > MAX_LIVE_OUTPUT_CHARS) output = `${uiText("toolCall.output.truncated")}\n${output.slice(output.length - MAX_LIVE_OUTPUT_CHARS)}`;
494516
494524
  this.upsertSubToolActivity(id, name, args, activity?.phase ?? "ongoing", output);
494525
+ this.pendingSubToolLiveOutputIds.add(id);
494526
+ this.scheduleSubToolLiveOutputFlush();
494527
+ }
494528
+ scheduleSubToolLiveOutputFlush() {
494529
+ if (this.subToolLiveOutputRenderTimer !== void 0) return;
494530
+ let chars = 0;
494531
+ for (const id of this.pendingSubToolLiveOutputIds) chars += this.subToolActivities.get(id)?.output?.length ?? 0;
494532
+ const interval = resolveStreamingFlushInterval({ toolCallChars: chars });
494533
+ const delay = this.lastSubToolLiveOutputFlushAt === void 0 ? 0 : Math.max(0, interval - (Date.now() - this.lastSubToolLiveOutputFlushAt));
494534
+ this.subToolLiveOutputRenderTimer = setTimeout(() => {
494535
+ this.subToolLiveOutputRenderTimer = void 0;
494536
+ this.flushPendingSubToolLiveOutputs();
494537
+ }, delay);
494538
+ }
494539
+ clearPendingSubToolLiveOutput(id) {
494540
+ if (!this.pendingSubToolLiveOutputIds.delete(id)) return;
494541
+ if (this.pendingSubToolLiveOutputIds.size === 0 && this.subToolLiveOutputRenderTimer !== void 0) {
494542
+ clearTimeout(this.subToolLiveOutputRenderTimer);
494543
+ this.subToolLiveOutputRenderTimer = void 0;
494544
+ }
494545
+ }
494546
+ flushPendingSubToolLiveOutputs() {
494547
+ if (this.pendingSubToolLiveOutputIds.size === 0) return;
494548
+ this.pendingSubToolLiveOutputIds.clear();
494549
+ this.lastSubToolLiveOutputFlushAt = Date.now();
494517
494550
  this.rebuildContent();
494518
494551
  this.notifySnapshotChange();
494519
494552
  this.ui?.requestRender();
494520
494553
  }
494521
494554
  finishSubToolCall(result) {
494522
494555
  this.applyPendingSubToolDelta(result.tool_call_id);
494556
+ this.clearPendingSubToolLiveOutput(result.tool_call_id);
494523
494557
  const ongoing = this.ongoingSubCalls.get(result.tool_call_id);
494524
494558
  if (ongoing === void 0) return;
494525
494559
  this.ongoingSubCalls.delete(result.tool_call_id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.349",
3
+ "version": "9.1.350",
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": {