@arhen/pi-core-subagent 1.1.17 → 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.
package/README.md CHANGED
@@ -100,7 +100,7 @@ Background + intercom:
100
100
  | `send_agent_message` | message to a sibling subagent's mailbox (`to` = its task id, or `"leader"`) |
101
101
  | `poll_agent_messages` | drain this subagent's mailbox |
102
102
 
103
- ## Peek — `/peek` or `ctrl+shift+s`
103
+ ## Peek — `/peek` or `ctrl+shift+a`
104
104
 
105
105
  Read-only pane over the session's subagents:
106
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-core-subagent",
3
- "version": "1.1.17",
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".
@@ -1238,7 +1242,8 @@ export default function (pi: ExtensionAPI) {
1238
1242
  );
1239
1243
  };
1240
1244
  pi.registerCommand("peek", { description: "Peek at running subagents (↑↓ move, enter tails)", handler: (_args, ctx) => openPeek(ctx) });
1241
- pi.registerShortcut("ctrl+shift+s", { description: "Peek at running subagents", handler: openPeek });
1245
+ // ctrl+shift+s belongs to pi-web-access (search curator); 'a' for agents is free.
1246
+ pi.registerShortcut("ctrl+shift+a", { description: "Peek at running subagents", handler: openPeek });
1242
1247
 
1243
1248
  pi.on("agent_start", (_event, ctx) => {
1244
1249
  if (!manager.turnActivity && !manager.hasActiveRun()) manager.clearWidget(ctx);