blun-king-cli 9.1.345 → 9.1.347
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.
|
@@ -9,7 +9,11 @@ function safeChars(value) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function resolveStreamingFlushInterval(input = {}) {
|
|
12
|
-
const chars = Math.max(
|
|
12
|
+
const chars = Math.max(
|
|
13
|
+
safeChars(input.assistantChars),
|
|
14
|
+
safeChars(input.thinkingChars),
|
|
15
|
+
safeChars(input.toolCallChars),
|
|
16
|
+
);
|
|
13
17
|
if (chars <= SHORT_STREAM_MAX_CHARS) return 50;
|
|
14
18
|
if (chars <= MEDIUM_STREAM_MAX_CHARS) return 100;
|
|
15
19
|
if (chars <= LONG_STREAM_MAX_CHARS) return 250;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function shouldParseStreamingToolCallImmediately(input = {}) {
|
|
4
|
+
return input.eventName === 'AgentSwarm'
|
|
5
|
+
|| input.activeName === 'AgentSwarm'
|
|
6
|
+
|| input.hasAgentSwarmProgress === true;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
module.exports = { shouldParseStreamingToolCallImmediately };
|
package/blun.mjs
CHANGED
|
@@ -508123,8 +508123,14 @@ var SessionEventHandler = class {
|
|
|
508123
508123
|
if (event.argumentsPart.length > 0) this.turnWatchdog.recordProgress();
|
|
508124
508124
|
const { state, streamingUI } = this.host;
|
|
508125
508125
|
streamingUI.accumulateToolCallDelta(event.toolCallId, event.name, event.argumentsPart);
|
|
508126
|
-
|
|
508127
|
-
|
|
508126
|
+
if (shouldParseStreamingToolCallImmediately({
|
|
508127
|
+
eventName: event.name,
|
|
508128
|
+
activeName: streamingUI.getActiveToolCall(event.toolCallId)?.name,
|
|
508129
|
+
hasAgentSwarmProgress: this.subAgentEventHandler.hasAgentSwarmProgress(event.toolCallId)
|
|
508130
|
+
})) {
|
|
508131
|
+
const preview = streamingUI.getStreamingToolCallPreview(event.toolCallId);
|
|
508132
|
+
if (preview !== void 0) this.subAgentEventHandler.handleAgentSwarmToolCallDelta(event.toolCallId, preview.args, { streamingArguments: preview.argumentsText });
|
|
508133
|
+
}
|
|
508128
508134
|
this.host.patchLivePane({
|
|
508129
508135
|
mode: "tool",
|
|
508130
508136
|
pendingApproval: null,
|
|
@@ -511411,12 +511417,18 @@ var StreamingUIController = class {
|
|
|
511411
511417
|
this.pendingThinkingFlush = false;
|
|
511412
511418
|
this.pendingToolCallFlushIds.clear();
|
|
511413
511419
|
}
|
|
511420
|
+
getStreamingToolCallArgumentChars() {
|
|
511421
|
+
let chars = 0;
|
|
511422
|
+
for (const streaming of this._streamingToolCallArguments.values()) chars += streaming.argumentsText.length;
|
|
511423
|
+
return chars;
|
|
511424
|
+
}
|
|
511414
511425
|
scheduleFlush() {
|
|
511415
511426
|
if (!this.hasPending()) return;
|
|
511416
511427
|
if (this.flushTimer !== void 0) return;
|
|
511417
511428
|
const flushIntervalMs = resolveStreamingFlushInterval({
|
|
511418
511429
|
assistantChars: this._assistantDraft.length,
|
|
511419
|
-
thinkingChars: this._thinkingDraft.length
|
|
511430
|
+
thinkingChars: this._thinkingDraft.length,
|
|
511431
|
+
toolCallChars: this.getStreamingToolCallArgumentChars()
|
|
511420
511432
|
});
|
|
511421
511433
|
const delay = this.lastFlushAt === void 0 ? 0 : Math.max(0, flushIntervalMs - (Date.now() - this.lastFlushAt));
|
|
511422
511434
|
this.flushTimer = setTimeout(() => {
|
|
@@ -515918,6 +515930,7 @@ const {
|
|
|
515918
515930
|
writeRunningUpdateMode
|
|
515919
515931
|
} = __require("./bin/running-update-preference.cjs");
|
|
515920
515932
|
const { resolveStreamingFlushInterval } = __require("./bin/streaming-flush-performance-policy.cjs");
|
|
515933
|
+
const { shouldParseStreamingToolCallImmediately } = __require("./bin/tool-stream-preview-policy.cjs");
|
|
515921
515934
|
const RUNNING_UPDATE_RESUME_SESSION_ENV = "BLUN_RUNNING_UPDATE_RESUME_SESSION_ID";
|
|
515922
515935
|
function shouldContinueActiveGoalAfterRunningUpdate(expectedSessionId, currentSessionId, goalStatus) {
|
|
515923
515936
|
return typeof expectedSessionId === "string" && expectedSessionId.length > 0 && currentSessionId === expectedSessionId && goalStatus === "active";
|