@arhen/pi-core-subagent 1.1.21 → 1.1.23
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 +14 -14
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+a`
|
|
103
|
+
## Peek — `/subagents 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.
|
|
3
|
+
"version": "1.1.23",
|
|
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
|
@@ -232,7 +232,8 @@ function taskLine(task: TaskSnapshot): string {
|
|
|
232
232
|
* inside the ANSI escape codes themselves ("38;2;139;136;122m16 tools").
|
|
233
233
|
*/
|
|
234
234
|
export function colorNums(text: string, theme: Theme): string {
|
|
235
|
-
|
|
235
|
+
// A value keeps its unit: "460.6k" and "2m30s" each color as one token, not digit-by-digit.
|
|
236
|
+
return text.replace(/((?:\d+(?:\.\d+)?[a-zA-Z]*)+)|([^\d]+)/g, (_m, num?: string, rest?: string) => (num ? theme.fg("syntaxNumber", num) : theme.fg("muted", rest ?? "")));
|
|
236
237
|
}
|
|
237
238
|
/**
|
|
238
239
|
* Themed one-liner. Finished tasks dim entirely (stats included); live tasks
|
|
@@ -1201,18 +1202,6 @@ const ReplyParam = Type.Object({
|
|
|
1201
1202
|
export default function (pi: ExtensionAPI) {
|
|
1202
1203
|
const manager = new SubagentManager(pi);
|
|
1203
1204
|
|
|
1204
|
-
pi.registerCommand("subagents", {
|
|
1205
|
-
description: "Show recent subagent runs",
|
|
1206
|
-
handler: async (_args, ctx) => {
|
|
1207
|
-
const runs = manager.listRuns().slice(0, 10);
|
|
1208
|
-
if (runs.length === 0) {
|
|
1209
|
-
ctx.ui.notify("No subagent runs in this session.", "info");
|
|
1210
|
-
return;
|
|
1211
|
-
}
|
|
1212
|
-
ctx.ui.notify(runs.flatMap((run) => compactLines(run).concat("")).join("\n") || "No subagent runs in this session.", "info");
|
|
1213
|
-
},
|
|
1214
|
-
});
|
|
1215
|
-
|
|
1216
1205
|
/** Read-only peek: browse agents, enter to tail one. Never mutates run state. */
|
|
1217
1206
|
const openPeek = async (ctx: ExtensionContext) => {
|
|
1218
1207
|
if (!ctx.hasUI) return;
|
|
@@ -1241,7 +1230,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
1241
1230
|
{ overlay: true, overlayOptions: { anchor: "center", width: "70%", minWidth: 60, maxHeight: "70%", margin: 2 } },
|
|
1242
1231
|
);
|
|
1243
1232
|
};
|
|
1244
|
-
pi.registerCommand("
|
|
1233
|
+
pi.registerCommand("subagents", {
|
|
1234
|
+
description: "List subagent runs. `/subagents peek` opens the browsable pane.",
|
|
1235
|
+
handler: async (args, ctx) => {
|
|
1236
|
+
if (String(args ?? "").trim().toLowerCase() === "peek") return openPeek(ctx);
|
|
1237
|
+
const runs = manager.listRuns().slice(0, 10);
|
|
1238
|
+
if (runs.length === 0) {
|
|
1239
|
+
ctx.ui.notify("No subagent runs in this session.", "info");
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
ctx.ui.notify(runs.flatMap((run) => compactLines(run).concat("")).join("\n"), "info");
|
|
1243
|
+
},
|
|
1244
|
+
});
|
|
1245
1245
|
// ctrl+shift+s belongs to pi-web-access (search curator); 'a' for agents is free.
|
|
1246
1246
|
pi.registerShortcut("ctrl+shift+a", { description: "Peek at running subagents", handler: openPeek });
|
|
1247
1247
|
|