blun-king-cli 9.1.351 → 9.1.352

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 +32 -1
  2. package/package.json +1 -1
package/blun.mjs CHANGED
@@ -507207,6 +507207,9 @@ var SubAgentEventHandler = class {
507207
507207
  subagentInfo = /* @__PURE__ */ new Map();
507208
507208
  agentSwarmProgress = /* @__PURE__ */ new Map();
507209
507209
  backgroundAgentMetadata = /* @__PURE__ */ new Map();
507210
+ swarmDeltaRenderTimer;
507211
+ lastSwarmDeltaFlushAt;
507212
+ pendingSwarmDeltaChars = 0;
507210
507213
  constructor(host, deps) {
507211
507214
  this.host = host;
507212
507215
  this.deps = deps;
@@ -507229,7 +507232,11 @@ var SubAgentEventHandler = class {
507229
507232
  const swarmProgress = this.agentSwarmProgress.get(parentToolCallId);
507230
507233
  if (swarmProgress !== void 0) {
507231
507234
  this.applySubagentEventToSwarmProgress(swarmProgress, event, childAgentId);
507232
- this.requestRender();
507235
+ if (event.type === "assistant.delta" || event.type === "thinking.delta") this.scheduleSwarmDeltaRender(event.delta.length);
507236
+ else {
507237
+ this.clearSwarmDeltaRenderTimer();
507238
+ this.requestRender();
507239
+ }
507233
507240
  return true;
507234
507241
  }
507235
507242
  const toolCall = this.host.streamingUI.getToolComponent(parentToolCallId);
@@ -507264,6 +507271,29 @@ var SubAgentEventHandler = class {
507264
507271
  }
507265
507272
  return true;
507266
507273
  }
507274
+ scheduleSwarmDeltaRender(deltaChars) {
507275
+ this.pendingSwarmDeltaChars += deltaChars;
507276
+ if (this.swarmDeltaRenderTimer !== void 0) return;
507277
+ const interval = resolveStreamingFlushInterval({ assistantChars: this.pendingSwarmDeltaChars });
507278
+ const delay = this.lastSwarmDeltaFlushAt === void 0 ? 0 : Math.max(0, interval - (Date.now() - this.lastSwarmDeltaFlushAt));
507279
+ this.swarmDeltaRenderTimer = setTimeout(() => {
507280
+ this.swarmDeltaRenderTimer = void 0;
507281
+ this.flushPendingSwarmDeltaRender();
507282
+ }, delay);
507283
+ }
507284
+ flushPendingSwarmDeltaRender() {
507285
+ if (this.pendingSwarmDeltaChars === 0) return;
507286
+ this.pendingSwarmDeltaChars = 0;
507287
+ this.lastSwarmDeltaFlushAt = Date.now();
507288
+ this.requestRender();
507289
+ }
507290
+ clearSwarmDeltaRenderTimer() {
507291
+ if (this.swarmDeltaRenderTimer !== void 0) {
507292
+ clearTimeout(this.swarmDeltaRenderTimer);
507293
+ this.swarmDeltaRenderTimer = void 0;
507294
+ }
507295
+ this.pendingSwarmDeltaChars = 0;
507296
+ }
507267
507297
  handleLifecycleEvent(event) {
507268
507298
  switch (event.type) {
507269
507299
  case "subagent.spawned":
@@ -507284,6 +507314,7 @@ var SubAgentEventHandler = class {
507284
507314
  }
507285
507315
  }
507286
507316
  clearAgentSwarmProgress() {
507317
+ this.clearSwarmDeltaRenderTimer();
507287
507318
  for (const progress of this.agentSwarmProgress.values()) progress.dispose();
507288
507319
  this.agentSwarmProgress.clear();
507289
507320
  this.host.updateActivityPane();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.351",
3
+ "version": "9.1.352",
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": {