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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-flow",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Flow-state delegation extension for Pi coding agent.",
5
5
  "type": "module",
6
6
  "main": "index.ts",
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 - 3; // 3 = " ...".length
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[0m ... " + tailRaw;
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": {