@trim21/personal-pi-extensions 0.1.528 → 0.1.529
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 +9 -6
package/package.json
CHANGED
package/src/spawn-agent.ts
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
* `text: <content>` lines for completed text blocks, keeping the last
|
|
16
16
|
* `MAX_PROGRESS_LINES` lines. Consecutive tool calls are merged into a
|
|
17
17
|
* single `tool:` line (`read x 2, glob`) and over-long line content is
|
|
18
|
-
* folded to the first/last
|
|
18
|
+
* folded to the first/last 9 chars joined by `…`, so a burst of tool calls
|
|
19
19
|
* or a long text block does not flood the window; any text block starts a
|
|
20
|
-
* new line.
|
|
20
|
+
* new line. The final line is always the subagent name as a code span
|
|
21
|
+
* (`` `scout` ``), followed by the live usage stats when there are any; it
|
|
22
|
+
* rides outside the rolling window so it is never trimmed.
|
|
21
23
|
*
|
|
22
24
|
* Security default: without an explicit `tools:` in the frontmatter, the
|
|
23
25
|
* subagent only gets read-only tools (read/grep/find/ls) — no bash/write/edit.
|
|
@@ -396,12 +398,13 @@ export async function runAgent(
|
|
|
396
398
|
};
|
|
397
399
|
|
|
398
400
|
const emitUpdate = () => {
|
|
399
|
-
//
|
|
400
|
-
//
|
|
401
|
+
// 最后一行固定是「子代理名 + 运行中统计」:名字用 code span 标出,进度流里
|
|
402
|
+
// 一眼能看出属于哪个 subagent;usage 与它同行,TUI 始终能看到实时 token 开销。
|
|
403
|
+
// 这行位于滚动窗口之外,因此永远不会被挤掉。
|
|
401
404
|
const usageLine = formatUsageStats(result.usage, result.model);
|
|
402
|
-
const
|
|
405
|
+
const footer = usageLine ? `\`${result.agent}\` ${usageLine}` : `\`${result.agent}\``;
|
|
403
406
|
onUpdate?.({
|
|
404
|
-
content: [{ type: "text", text:
|
|
407
|
+
content: [{ type: "text", text: [...logLines, footer].join("\n") }],
|
|
405
408
|
details: { ...result },
|
|
406
409
|
});
|
|
407
410
|
};
|