@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trim21/personal-pi-extensions",
3
- "version": "0.1.528",
3
+ "version": "0.1.529",
4
4
  "type": "module",
5
5
  "description": "Custom pi coding-agent extensions: bwrap sandbox, workspace guard, opencode edit, and more",
6
6
  "keywords": [
@@ -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 7 chars joined by `…`, so a burst of tool calls
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
- // Usage line rides on the last row so the TUI always shows live token
400
- // cost; it lives outside the rolling window so it is never trimmed.
401
+ // 最后一行固定是「子代理名 + 运行中统计」:名字用 code span 标出,进度流里
402
+ // 一眼能看出属于哪个 subagent;usage 与它同行,TUI 始终能看到实时 token 开销。
403
+ // 这行位于滚动窗口之外,因此永远不会被挤掉。
401
404
  const usageLine = formatUsageStats(result.usage, result.model);
402
- const lines = usageLine ? [...logLines, usageLine] : logLines;
405
+ const footer = usageLine ? `\`${result.agent}\` ${usageLine}` : `\`${result.agent}\``;
403
406
  onUpdate?.({
404
- content: [{ type: "text", text: lines.join("\n") || "(running...)" }],
407
+ content: [{ type: "text", text: [...logLines, footer].join("\n") }],
405
408
  details: { ...result },
406
409
  });
407
410
  };