@arhen/pi-core-subagent 1.1.18 → 1.1.20
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 +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -5
- package/src/peek.ts +4 -3
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Background + intercom:
|
|
|
104
104
|
|
|
105
105
|
Read-only pane over the session's subagents:
|
|
106
106
|
|
|
107
|
-
-
|
|
107
|
+
- `shift+↑`/`shift+↓` (or `j`/`k`) — move between agents; bare arrows work too where the terminal doesn't reserve them
|
|
108
108
|
- `enter` — live tail of that child's session file (`esc` goes back)
|
|
109
109
|
- `x` then `y` — abort ONE subagent (only mutation; `n`/any other key cancels)
|
|
110
110
|
- `esc` — close
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arhen/pi-core-subagent",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.20",
|
|
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
|
-
/**
|
|
230
|
-
|
|
231
|
-
|
|
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(
|
|
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".
|
|
@@ -1237,7 +1241,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1237
1241
|
{ overlay: true, overlayOptions: { anchor: "center", width: "80%", maxHeight: "70%" } },
|
|
1238
1242
|
);
|
|
1239
1243
|
};
|
|
1240
|
-
pi.registerCommand("peek", { description: "Peek at running subagents (
|
|
1244
|
+
pi.registerCommand("peek", { description: "Peek at running subagents (shift+↑↓ or j/k move, enter tails)", handler: (_args, ctx) => openPeek(ctx) });
|
|
1241
1245
|
// ctrl+shift+s belongs to pi-web-access (search curator); 'a' for agents is free.
|
|
1242
1246
|
pi.registerShortcut("ctrl+shift+a", { description: "Peek at running subagents", handler: openPeek });
|
|
1243
1247
|
|
package/src/peek.ts
CHANGED
|
@@ -105,7 +105,7 @@ export function createPeekPane(
|
|
|
105
105
|
selected = clamp(selected, tasks.length);
|
|
106
106
|
if (tasks.length === 0) return [theme.fg("dim", "No subagents in this session.")];
|
|
107
107
|
const task = tasks[selected]!;
|
|
108
|
-
const hint = confirming ? theme.fg("error", `abort ${task.agent}? y / n`) : tailing ? "esc back · x abort" : "
|
|
108
|
+
const hint = confirming ? theme.fg("error", `abort ${task.agent}? y / n`) : tailing ? "esc back · x abort" : "shift+↑↓ or j/k move · enter tail · x abort · esc close";
|
|
109
109
|
const head = `${theme.fg("accent", theme.bold(tailing ? task.agent : "Subagents"))} ${theme.fg("dim", `(${selected + 1}/${tasks.length}) · ${hint}`)}`;
|
|
110
110
|
if (!tailing) {
|
|
111
111
|
return [head, ...tasks.map((t, i) => truncateToWidth(`${i === selected ? theme.fg("accent", "❯ ") : " "}${t.line}`, width, "…"))];
|
|
@@ -136,9 +136,10 @@ export function createPeekPane(
|
|
|
136
136
|
tailing = true;
|
|
137
137
|
} else if (matchesKey(data, Key.left)) {
|
|
138
138
|
tailing = false;
|
|
139
|
-
} else if (matchesKey(data, Key.up)) {
|
|
139
|
+
} else if (matchesKey(data, "shift+up") || matchesKey(data, Key.up) || data === "k") {
|
|
140
|
+
// shift+↑↓ and j/k are the reliable pair: bare arrows can be eaten by prompt history.
|
|
140
141
|
selected = clamp(selected - 1, len);
|
|
141
|
-
} else if (matchesKey(data, Key.down)) {
|
|
142
|
+
} else if (matchesKey(data, "shift+down") || matchesKey(data, Key.down) || data === "j") {
|
|
142
143
|
selected = clamp(selected + 1, len);
|
|
143
144
|
}
|
|
144
145
|
requestRender();
|