@trim21/personal-pi-extensions 0.0.289 → 0.0.290
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/src/spawn-agent.ts +7 -7
package/package.json
CHANGED
package/src/spawn-agent.ts
CHANGED
|
@@ -53,8 +53,8 @@ const MAX_OUTPUT_BYTES = 50 * 1024;
|
|
|
53
53
|
const DEFAULT_TOOLS = ["read", "grep", "find", "ls"];
|
|
54
54
|
/** Progress log keeps only the most recent lines (rolling window). */
|
|
55
55
|
const MAX_PROGRESS_LINES = 5;
|
|
56
|
-
/** Progress line content (without the `tool:` / `text:` prefix) is capped at
|
|
57
|
-
const MAX_PROGRESS_CHARS_PER_LINE =
|
|
56
|
+
/** Progress line content (without the `tool:` / `text:` prefix) is capped at 21 chars; longer text is folded to the first/last 9 chars joined by ` … `. */
|
|
57
|
+
const MAX_PROGRESS_CHARS_PER_LINE = 21;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Tool → extension override map: when a subagent's frontmatter enables a
|
|
@@ -134,15 +134,15 @@ function getFinalOutput(messages: AgentMessage[]): string {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* Fold over-long progress line content: keep the first/last
|
|
138
|
-
*
|
|
139
|
-
* `MAX_PROGRESS_CHARS_PER_LINE` chars (
|
|
137
|
+
* Fold over-long progress line content: keep the first/last 9 chars joined by
|
|
138
|
+
* ` … ` (space, ellipsis, space), so the folded line never exceeds
|
|
139
|
+
* `MAX_PROGRESS_CHARS_PER_LINE` chars (9 + 3 + 9 = 21). Shorter text is
|
|
140
140
|
* returned as-is.
|
|
141
141
|
*/
|
|
142
142
|
function foldProgressLine(text: string): string {
|
|
143
143
|
if (text.length <= MAX_PROGRESS_CHARS_PER_LINE) return text;
|
|
144
|
-
const keep = Math.floor((MAX_PROGRESS_CHARS_PER_LINE -
|
|
145
|
-
return `${text.slice(0, keep)}
|
|
144
|
+
const keep = Math.floor((MAX_PROGRESS_CHARS_PER_LINE - 3) / 2);
|
|
145
|
+
return `${text.slice(0, keep)} … ${text.slice(-keep)}`;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
function formatTokens(count: number): string {
|