pi-subagent-manager 1.13.0 โ 1.13.3
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 +28 -18
- package/dist/index.js +20 -4
- package/dist/orch/housekeeping.js +1 -1
- package/dist/ui/ui.js +4 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/pi-subagent-manager)
|
|
4
4
|
[](https://www.npmjs.com/package/pi-subagent-manager)
|
|
@@ -8,29 +8,29 @@
|
|
|
8
8
|
|
|
9
9
|
Let pi hand work to helper agents in parallel. Watch what they're doing, give them more direction, or pick up a finished agent's conversation.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Install
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
```bash
|
|
14
|
+
pi install npm:pi-subagent-manager
|
|
15
|
+
```
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
Requires pi **0.99.2+**.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
- [](https://github.com/championswimmer/pi-checklist) โ Session task checklist with dependencies and a TUI renderer.
|
|
19
|
-
- [](https://github.com/championswimmer/pi-context-decisions) โ Selects relevant skills and optionally filters tools for each task.
|
|
20
|
-
- [](https://github.com/championswimmer/pi-context-prune) โ Prunes verbose tool outputs from context while preserving history.
|
|
21
|
-
- [](https://github.com/championswimmer/pi-context-usage) โ Dot-grid visualization of context window token usage.
|
|
22
|
-
- [](https://github.com/championswimmer/pi-gauge) โ Live tokens/sec and TTFT in the status bar.
|
|
23
|
-
- [](https://github.com/championswimmer/pi-subagent-manager) โ Delegate work to parallel subagents and monitor their progress.
|
|
19
|
+
## Why use it
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
- Hand independent jobs to helper agents that run in parallel.
|
|
22
|
+
- Watch any agent live in a nested agent tree.
|
|
23
|
+
- Steer a running agent with more direction, or resume it after it finishes.
|
|
24
|
+
- Choose `fork:` to share your conversation or `fresh:` to start clean.
|
|
25
|
+
- Six bundled roles, with per-role model, tools, and instructions you can change, plus custom agents.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
## How to use
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
A real Pi session with a customized footer and Nerd Font: parallel work, nested delegation, watching, and steering. [Recording details](https://github.com/championswimmer/pi-subagent-manager/blob/main/docs/demo.md) (37 seconds; pauses shortened).
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
### Start using it
|
|
34
34
|
|
|
35
35
|
Ask pi to delegate in plain language:
|
|
36
36
|
|
|
@@ -46,7 +46,7 @@ Or start an agent yourself:
|
|
|
46
46
|
|
|
47
47
|
The **Agents** widget above the input shows what's running. Open `/agents tree`, select an agent, and press **Enter** to watch it. Type in the **Steer** input to give it more direction or resume it after it finishes. Results also return to the main agent.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
### Bundled agents
|
|
50
50
|
|
|
51
51
|
| Agent | Use it for |
|
|
52
52
|
| ------------ | --------------------------------------- |
|
|
@@ -74,3 +74,13 @@ Agents share your working directory and OS permissions: **tool policies are not
|
|
|
74
74
|
- [Development](https://github.com/championswimmer/pi-subagent-manager/blob/main/docs/development.md) ยท [Changelog](CHANGELOG.md)
|
|
75
75
|
|
|
76
76
|
[MIT license](LICENSE)
|
|
77
|
+
|
|
78
|
+
## Check out my other Pi extensions
|
|
79
|
+
|
|
80
|
+
- [](https://github.com/championswimmer/pi-cache-graph) โ Real-time prompt cache hit rates and token metrics.
|
|
81
|
+
- [](https://github.com/championswimmer/pi-checklist) โ Session task checklist with dependencies and a TUI renderer.
|
|
82
|
+
- [](https://github.com/championswimmer/pi-context-decisions) โ Selects relevant skills and optionally filters tools for each task.
|
|
83
|
+
- [](https://github.com/championswimmer/pi-context-prune) โ Prunes verbose tool outputs from context while preserving history.
|
|
84
|
+
- [](https://github.com/championswimmer/pi-context-usage) โ Dot-grid visualization of context window token usage.
|
|
85
|
+
- [](https://github.com/championswimmer/pi-gauge) โ Live tokens/sec and TTFT in the status bar.
|
|
86
|
+
- [](https://github.com/championswimmer/pi-subagent-manager) โ Delegate work to parallel subagents and monitor their progress.
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CAPABILITY_PROBE_CHANNEL, respondDiagnosticCapability, diagnosticAgentText, } from "./orch/diagnostics.js";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { buildSessionContext, getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
4
|
-
import { fuzzyFilter } from "@earendil-works/pi-tui";
|
|
4
|
+
import { fuzzyFilter, Text } from "@earendil-works/pi-tui";
|
|
5
5
|
import { ConfigStore } from "./prefs/config.js";
|
|
6
6
|
import { IMPORT_REQUEST_PREFIX, markImportOffered, offerAgentImport, } from "./prefs/agent-import.js";
|
|
7
7
|
import { ThreadManager } from "./orch/manager.js";
|
|
@@ -16,11 +16,12 @@ import { createInheritedToolSource } from "./orch/inherited-tools.js";
|
|
|
16
16
|
import { subagentPrompt } from "./orch/prompt.js";
|
|
17
17
|
import { ChecklistMetaMirror, checklistStatus } from "./orch/checklist-integration.js";
|
|
18
18
|
import { agentTools } from "./orch/tools.js";
|
|
19
|
-
import { editAgentTypes, updateWidget } from "./ui/ui.js";
|
|
19
|
+
import { agentStartupList, editAgentTypes, updateWidget } from "./ui/ui.js";
|
|
20
20
|
import { canOpenDialog, dialogMenu } from "./ui/dialog.js";
|
|
21
21
|
import { COST_ENTRY, CostLedger } from "./orch/cost-ledger.js";
|
|
22
22
|
import { readRegistry, RegistryWriter } from "./orch/registry.js";
|
|
23
23
|
import { CostFooterController } from "./ui/cost-footer.js";
|
|
24
|
+
const STARTUP_AGENTS_ENTRY = "pi-subagent:startup-agents:v1";
|
|
24
25
|
const ROOT_MAILBOX_ENTRY = "pi-subagent:root-mailbox:v1";
|
|
25
26
|
const ROOT_SUMMARY_MESSAGE = "pi-subagent:final-recap";
|
|
26
27
|
const ROOT_WAKE_MESSAGE = "pi-subagent:wake";
|
|
@@ -31,6 +32,12 @@ export default function piSubagent(pi) {
|
|
|
31
32
|
respondDiagnosticCapability(payload);
|
|
32
33
|
});
|
|
33
34
|
let context;
|
|
35
|
+
let startupAgents;
|
|
36
|
+
pi.registerEntryRenderer(STARTUP_AGENTS_ENTRY, (entry, _options, theme) => {
|
|
37
|
+
if (!startupAgents || entry.data?.id !== startupAgents.id)
|
|
38
|
+
return undefined;
|
|
39
|
+
return new Text(agentStartupList(startupAgents.agents, theme, startupAgents.icons), 0, 0);
|
|
40
|
+
});
|
|
34
41
|
const inheritedTools = createInheritedToolSource(pi);
|
|
35
42
|
let store = new ConfigStore({
|
|
36
43
|
cwd: process.cwd(),
|
|
@@ -590,11 +597,20 @@ export default function piSubagent(pi) {
|
|
|
590
597
|
};
|
|
591
598
|
pi.on("session_start", async (event, ctx) => {
|
|
592
599
|
capabilityActive = true;
|
|
600
|
+
startupAgents = undefined;
|
|
593
601
|
await attachSession(ctx, true, event.reason !== "startup");
|
|
594
|
-
if (limits.subagentMode !== "off")
|
|
602
|
+
if (limits.subagentMode !== "off") {
|
|
595
603
|
await importAgents(ctx, true);
|
|
604
|
+
if (event.reason === "startup" && ctx.hasUI && ctx.mode === "tui") {
|
|
605
|
+
startupAgents = { id: randomUUID(), agents: store.list(), icons: limits.nerdFontIcons };
|
|
606
|
+
pi.appendEntry(STARTUP_AGENTS_ENTRY, { id: startupAgents.id });
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
pi.on("session_tree", async (_event, ctx) => {
|
|
611
|
+
startupAgents = undefined;
|
|
612
|
+
await attachSession(ctx);
|
|
596
613
|
});
|
|
597
|
-
pi.on("session_tree", async (_event, ctx) => attachSession(ctx));
|
|
598
614
|
const stopWorkingThreads = async () => {
|
|
599
615
|
cancelSummary();
|
|
600
616
|
closeNavigation();
|
|
@@ -229,7 +229,7 @@ export function createHousekeepingCompleter(getContext, getModelIdentity, onUsag
|
|
|
229
229
|
timestamp: Date.now(),
|
|
230
230
|
},
|
|
231
231
|
],
|
|
232
|
-
}, { signal, maxTokens: 96, cacheRetention: "none" })
|
|
232
|
+
}, { signal, maxTokens: 96, cacheRetention: "none", sessionId: session?.sessionId })
|
|
233
233
|
.result();
|
|
234
234
|
const entry = reportHousekeepingUsage(session, response);
|
|
235
235
|
try {
|
package/dist/ui/ui.js
CHANGED
|
@@ -43,6 +43,10 @@ export function agentTypeLabel(type, icon, nerdFontIcons = false, loaderIcon) {
|
|
|
43
43
|
const progress = loaderIcon && isAgentLoaderGlyph(loaderIcon, nerdFontIcons) ? `${loaderIcon} ` : "";
|
|
44
44
|
return `${progress}${role}${sanitizeText(type)}`;
|
|
45
45
|
}
|
|
46
|
+
export function agentStartupList(agents, theme, nerdFontIcons) {
|
|
47
|
+
const names = agents.map((agent) => theme.fg(agentColorToken(agent.color), agentTypeLabel(agent.name, agent.icon, nerdFontIcons)));
|
|
48
|
+
return `${theme.fg("warning", "[Agents]")}\n ${names.length ? names.join(", ") : "(none)"}`;
|
|
49
|
+
}
|
|
46
50
|
export function agentTypeBadge(type, color, theme, icon, nerdFontIcons = false, loaderIcon) {
|
|
47
51
|
return contrastPill(agentTypeLabel(type, icon, nerdFontIcons, loaderIcon), color, theme);
|
|
48
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-subagent-manager",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.3",
|
|
4
4
|
"description": "Hierarchical, steerable subagent threads for pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"pi": {
|
|
43
43
|
"extensions": [
|
|
44
44
|
"./dist/index.js"
|
|
45
|
-
]
|
|
45
|
+
],
|
|
46
|
+
"image": "https://raw.githubusercontent.com/championswimmer/pi-subagent-manager/main/assets/banner.png"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|