pi-agent-flow 0.2.6 → 0.2.7
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/package.json +1 -1
- package/render-utils.ts +2 -2
- package/render.ts +1 -1
package/package.json
CHANGED
package/render-utils.ts
CHANGED
|
@@ -101,7 +101,7 @@ function truncateAnsi(text: string, max: number): string {
|
|
|
101
101
|
if (visibleLength(text) <= max) return text;
|
|
102
102
|
|
|
103
103
|
const head = Math.ceil(max * 0.6);
|
|
104
|
-
const tail = max - head -
|
|
104
|
+
const tail = max - head - 5; // 5 = " ... ".length
|
|
105
105
|
|
|
106
106
|
// Walk through the string, collecting raw chars until we've consumed
|
|
107
107
|
// `count` visible characters. ANSI sequences are copied through without
|
|
@@ -153,7 +153,7 @@ function truncateAnsi(text: string, max: number): string {
|
|
|
153
153
|
|
|
154
154
|
const tailRaw = takeVisibleFromEnd(text, tail);
|
|
155
155
|
|
|
156
|
-
return headResult.raw + "\x1b[
|
|
156
|
+
return headResult.raw + "\x1b[39m ... " + tailRaw;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
export function truncateChars(text: string, max: number): string {
|
package/render.ts
CHANGED
|
@@ -38,7 +38,7 @@ function formatFlowToolCall(toolName: string, args: Record<string, unknown>, fg:
|
|
|
38
38
|
|
|
39
39
|
switch (toolName) {
|
|
40
40
|
case "bash": {
|
|
41
|
-
const cmd = (args.command as string) || "...";
|
|
41
|
+
const cmd = ((args.command as string) || "...").replace(/[\n\r\t]+/g, " ").replace(/ +/g, " ").trim();
|
|
42
42
|
return fg("muted", "$ ") + fg("toolOutput", cmd);
|
|
43
43
|
}
|
|
44
44
|
case "read": {
|