@arhen/pi-core-subagent 1.1.18 → 1.1.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-core-subagent",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "type": "module",
5
5
  "description": "pi extension: fast in-process subagents with single/parallel/chain, background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -226,9 +226,13 @@ function taskStatsWithUsage(task: TaskSnapshot): string {
226
226
  function taskLine(task: TaskSnapshot): string {
227
227
  return `${statusIcon(task.status)} ${task.agent} · ${taskStatsWithUsage(task)} · ${taskTimer(task)}`;
228
228
  }
229
- /** Numbers get the theme's number color, same as the footer's token counters. */
230
- function colorNums(text: string, theme: Theme): string {
231
- return text.replace(/\d+(?:\.\d+)?/g, (n) => theme.fg("syntaxNumber", n));
229
+ /**
230
+ * Numbers take the theme's number color, everything else stays muted — like the footer.
231
+ * Must run on RAW text: styling an already-colored string rewrites the digits
232
+ * inside the ANSI escape codes themselves ("38;2;139;136;122m16 tools").
233
+ */
234
+ export function colorNums(text: string, theme: Theme): string {
235
+ return text.replace(/(\d+(?:\.\d+)?)|([^\d]+)/g, (_m, num?: string, rest?: string) => (num ? theme.fg("syntaxNumber", num) : theme.fg("muted", rest ?? "")));
232
236
  }
233
237
  /**
234
238
  * Themed one-liner. Finished tasks dim entirely (stats included); live tasks
@@ -239,7 +243,7 @@ function themedTaskLine(task: TaskSnapshot, theme: Theme, activity = ""): string
239
243
  if (TERMINAL.includes(task.status)) {
240
244
  return theme.fg("dim", `${statusIcon(task.status)} ${task.agent} · ${tail}`);
241
245
  }
242
- return `${statusIcon(task.status)} ${task.agent} · ${activity}${colorNums(theme.fg("muted", tail), theme)}`;
246
+ return `${statusIcon(task.status)} ${task.agent} · ${activity}${colorNums(tail, theme)}`;
243
247
  }
244
248
  /**
245
249
  * Human-readable activity line: "Read src/index.ts", "Grep wrapSingleLine".