blun-king-cli 9.1.348 → 9.1.349

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 +26 -0
  2. package/package.json +1 -1
package/blun.mjs CHANGED
@@ -493840,6 +493840,8 @@ var ToolCallComponent = class ToolCallComponent extends Container {
493840
493840
  */
493841
493841
  subagentText = "";
493842
493842
  subagentThinkingText = "";
493843
+ subagentTextRenderTimer;
493844
+ lastSubagentTextFlushAt;
493843
493845
  /** Tracks whether the child agent's latest streamed delta was text or thinking,
493844
493846
  * so the active window can follow whichever is currently live. */
493845
493847
  lastSubagentStreamKind = "text";
@@ -494019,6 +494021,7 @@ var ToolCallComponent = class ToolCallComponent extends Container {
494019
494021
  this.stopStreamingProgressTimer();
494020
494022
  this.stopSubagentElapsedTimer();
494021
494023
  this.stopDetachHintTimer();
494024
+ this.clearSubagentTextFlushTimer();
494022
494025
  if (this.subToolDeltaRenderTimer !== void 0) {
494023
494026
  clearTimeout(this.subToolDeltaRenderTimer);
494024
494027
  this.subToolDeltaRenderTimer = void 0;
@@ -494296,6 +494299,7 @@ var ToolCallComponent = class ToolCallComponent extends Container {
494296
494299
  * token usage plus the result summary for the header chip and tail summary.
494297
494300
  */
494298
494301
  onSubagentCompleted(payload) {
494302
+ this.clearSubagentTextFlushTimer();
494299
494303
  this.subagentPhase = "done";
494300
494304
  this.subagentEndedAtMs ??= Date.now();
494301
494305
  if (payload.contextTokens !== void 0 && payload.contextTokens > 0) this.subagentContextTokens = payload.contextTokens;
@@ -494319,6 +494323,7 @@ var ToolCallComponent = class ToolCallComponent extends Container {
494319
494323
  }
494320
494324
  /** Handles SDK `subagent.failed`. */
494321
494325
  onSubagentFailed(payload) {
494326
+ this.clearSubagentTextFlushTimer();
494322
494327
  this.subagentPhase = "failed";
494323
494328
  this.subagentEndedAtMs ??= Date.now();
494324
494329
  this.subagentError = payload.error;
@@ -494414,11 +494419,32 @@ var ToolCallComponent = class ToolCallComponent extends Container {
494414
494419
  if (kind === "thinking") this.subagentThinkingText += text;
494415
494420
  else this.subagentText += text;
494416
494421
  if (this.subagentPhase === void 0 || this.subagentPhase === "queued" || this.subagentPhase === "spawning") this.subagentPhase = "running";
494422
+ this.scheduleSubagentTextFlush();
494423
+ }
494424
+ scheduleSubagentTextFlush() {
494425
+ if (this.subagentTextRenderTimer !== void 0) return;
494426
+ const interval = resolveStreamingFlushInterval({
494427
+ assistantChars: this.subagentText.length,
494428
+ thinkingChars: this.subagentThinkingText.length
494429
+ });
494430
+ const delay = this.lastSubagentTextFlushAt === void 0 ? 0 : Math.max(0, interval - (Date.now() - this.lastSubagentTextFlushAt));
494431
+ this.subagentTextRenderTimer = setTimeout(() => {
494432
+ this.subagentTextRenderTimer = void 0;
494433
+ this.flushPendingSubagentText();
494434
+ }, delay);
494435
+ }
494436
+ flushPendingSubagentText() {
494437
+ this.lastSubagentTextFlushAt = Date.now();
494417
494438
  this.headerText.setText(this.buildHeader());
494418
494439
  this.rebuildContent();
494419
494440
  this.notifySnapshotChange();
494420
494441
  this.ui?.requestRender();
494421
494442
  }
494443
+ clearSubagentTextFlushTimer() {
494444
+ if (this.subagentTextRenderTimer === void 0) return;
494445
+ clearTimeout(this.subagentTextRenderTimer);
494446
+ this.subagentTextRenderTimer = void 0;
494447
+ }
494422
494448
  appendSubToolCall(call) {
494423
494449
  const existing = this.ongoingSubCalls.get(call.id);
494424
494450
  this.ongoingSubCalls.set(call.id, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.348",
3
+ "version": "9.1.349",
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": {