@oyasmi/pipiclaw 0.9.0-beta.3 → 0.9.0-beta.4
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.
- package/dist/runtime/delivery.js +8 -4
- package/package.json +1 -1
package/dist/runtime/delivery.js
CHANGED
|
@@ -3,6 +3,10 @@ import { errorMessage } from "../shared/text-utils.js";
|
|
|
3
3
|
const MIN_UPDATE_INTERVAL_MS = 800;
|
|
4
4
|
const ROLLING_WINDOW_SIZE = 3;
|
|
5
5
|
const NO_CONTENT = "";
|
|
6
|
+
// DingTalk's markdown line break: "\n" padded with a space on each side (per DingTalk's
|
|
7
|
+
// own markdown guide). A bare blank line reads as a full paragraph break (too much
|
|
8
|
+
// vertical gap between progress entries); a bare "\n" is swallowed by the renderer.
|
|
9
|
+
const PROGRESS_LINE_BREAK = " \n ";
|
|
6
10
|
// Last-resort ceiling on how long flush() will block a caller. Outbound HTTP now
|
|
7
11
|
// has its own timeout, so the sync loop is already bounded; this only guards against
|
|
8
12
|
// an unforeseen stall so run()'s finally can never hang the channel forever.
|
|
@@ -127,7 +131,7 @@ class ChannelDeliveryController {
|
|
|
127
131
|
this.toolCallCount++;
|
|
128
132
|
}
|
|
129
133
|
if (this.progressSegments.length > 0) {
|
|
130
|
-
this.progressSegments.push(
|
|
134
|
+
this.progressSegments.push(PROGRESS_LINE_BREAK);
|
|
131
135
|
}
|
|
132
136
|
this.progressSegments.push(text);
|
|
133
137
|
this.progressTextDirty = true;
|
|
@@ -390,7 +394,7 @@ class ChannelDeliveryController {
|
|
|
390
394
|
trimToRecentEntries(maxEntries) {
|
|
391
395
|
let entryCount = 0;
|
|
392
396
|
for (const segment of this.progressSegments) {
|
|
393
|
-
if (segment !==
|
|
397
|
+
if (segment !== PROGRESS_LINE_BREAK) {
|
|
394
398
|
entryCount++;
|
|
395
399
|
}
|
|
396
400
|
}
|
|
@@ -401,11 +405,11 @@ class ChannelDeliveryController {
|
|
|
401
405
|
let removedEntries = 0;
|
|
402
406
|
while (removedEntries < entriesToRemove && this.progressSegments.length > 0) {
|
|
403
407
|
const segment = this.progressSegments.shift();
|
|
404
|
-
if (segment !==
|
|
408
|
+
if (segment !== PROGRESS_LINE_BREAK) {
|
|
405
409
|
removedEntries++;
|
|
406
410
|
}
|
|
407
411
|
}
|
|
408
|
-
while (this.progressSegments[0] ===
|
|
412
|
+
while (this.progressSegments[0] === PROGRESS_LINE_BREAK) {
|
|
409
413
|
this.progressSegments.shift();
|
|
410
414
|
}
|
|
411
415
|
this.progressTextDirty = true;
|
package/package.json
CHANGED