blun-king-cli 9.1.345 → 9.1.346
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;
|
package/blun.mjs
CHANGED
|
@@ -511411,12 +511411,18 @@ var StreamingUIController = class {
|
|
|
511411
511411
|
this.pendingThinkingFlush = false;
|
|
511412
511412
|
this.pendingToolCallFlushIds.clear();
|
|
511413
511413
|
}
|
|
511414
|
+
getStreamingToolCallArgumentChars() {
|
|
511415
|
+
let chars = 0;
|
|
511416
|
+
for (const streaming of this._streamingToolCallArguments.values()) chars += streaming.argumentsText.length;
|
|
511417
|
+
return chars;
|
|
511418
|
+
}
|
|
511414
511419
|
scheduleFlush() {
|
|
511415
511420
|
if (!this.hasPending()) return;
|
|
511416
511421
|
if (this.flushTimer !== void 0) return;
|
|
511417
511422
|
const flushIntervalMs = resolveStreamingFlushInterval({
|
|
511418
511423
|
assistantChars: this._assistantDraft.length,
|
|
511419
|
-
thinkingChars: this._thinkingDraft.length
|
|
511424
|
+
thinkingChars: this._thinkingDraft.length,
|
|
511425
|
+
toolCallChars: this.getStreamingToolCallArgumentChars()
|
|
511420
511426
|
});
|
|
511421
511427
|
const delay = this.lastFlushAt === void 0 ? 0 : Math.max(0, flushIntervalMs - (Date.now() - this.lastFlushAt));
|
|
511422
511428
|
this.flushTimer = setTimeout(() => {
|