@clawos-dev/clawd 0.2.24 → 0.2.25
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/cli.cjs +15 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -13408,6 +13408,18 @@ function reduceSession(state, input, deps) {
|
|
|
13408
13408
|
}
|
|
13409
13409
|
}
|
|
13410
13410
|
|
|
13411
|
+
// src/session/stdout-splitter.ts
|
|
13412
|
+
function splitStdoutChunk(buf, chunk) {
|
|
13413
|
+
let next = buf + (typeof chunk === "string" ? chunk : chunk.toString("utf8"));
|
|
13414
|
+
const lines = [];
|
|
13415
|
+
let idx;
|
|
13416
|
+
while ((idx = next.indexOf("\n")) >= 0) {
|
|
13417
|
+
lines.push(next.slice(0, idx));
|
|
13418
|
+
next = next.slice(idx + 1);
|
|
13419
|
+
}
|
|
13420
|
+
return { newBuf: next, lines };
|
|
13421
|
+
}
|
|
13422
|
+
|
|
13411
13423
|
// src/ipc-recorder.ts
|
|
13412
13424
|
var import_node_fs4 = __toESM(require("fs"), 1);
|
|
13413
13425
|
var import_node_path4 = __toESM(require("path"), 1);
|
|
@@ -13682,11 +13694,9 @@ var SessionRunner = class {
|
|
|
13682
13694
|
now: this.hooks.now
|
|
13683
13695
|
});
|
|
13684
13696
|
proc.stdout?.on("data", (chunk) => {
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
const line = this.stdoutBuf.slice(0, idx);
|
|
13689
|
-
this.stdoutBuf = this.stdoutBuf.slice(idx + 1);
|
|
13697
|
+
const { newBuf, lines } = splitStdoutChunk(this.stdoutBuf, chunk);
|
|
13698
|
+
this.stdoutBuf = newBuf;
|
|
13699
|
+
for (const line of lines) {
|
|
13690
13700
|
if (this.tryHandleControlResponse(line)) continue;
|
|
13691
13701
|
this.input({ kind: "stdout-line", line });
|
|
13692
13702
|
}
|