@arhen/pi-core-subagent 1.3.7 → 1.3.8
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/package.json +1 -1
- package/src/index.ts +11 -4
- package/src/manager.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arhen/pi-core-subagent",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -76,7 +76,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
76
76
|
);
|
|
77
77
|
};
|
|
78
78
|
pi.registerCommand("subagents", {
|
|
79
|
-
description:
|
|
79
|
+
description:
|
|
80
|
+
"List subagent runs. `/subagents peek` opens the browsable pane; `/subagents auto-bg on|off` toggles background-by-default.",
|
|
80
81
|
handler: async (args, ctx) => {
|
|
81
82
|
const arg = String(args ?? "")
|
|
82
83
|
.trim()
|
|
@@ -86,9 +87,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
86
87
|
const value = arg.split(/\s+/)[1];
|
|
87
88
|
if (value === "on" || value === "off") {
|
|
88
89
|
const next = manager.setAutoBg(value === "on");
|
|
89
|
-
ctx.ui.notify(
|
|
90
|
+
ctx.ui.notify(
|
|
91
|
+
`auto-bg ${next ? "on" : "off"} — subagent calls default to ${next ? "background" : "blocking (inline result)"}.`,
|
|
92
|
+
"info",
|
|
93
|
+
);
|
|
90
94
|
} else {
|
|
91
|
-
ctx.ui.notify(
|
|
95
|
+
ctx.ui.notify(
|
|
96
|
+
`auto-bg is ${manager.autoBgOn ? "on" : "off"} — use \`/subagents auto-bg on|off\` to change it.`,
|
|
97
|
+
"info",
|
|
98
|
+
);
|
|
92
99
|
}
|
|
93
100
|
return;
|
|
94
101
|
}
|
|
@@ -128,7 +135,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
128
135
|
// ponytail: this string is billed on every request. No example block — an example
|
|
129
136
|
// biases the model toward one shape; guidelines + JSON schema describe all of them.
|
|
130
137
|
description:
|
|
131
|
-
|
|
138
|
+
"Run isolated subagents (own context, own session). You invent each agent: name, optional system prompt, toolset (read-only default, write:true to edit). Use `agent`+`task` for one, `tasks` for many. `needs` declares dependency edges: a task waits for its needs and receives their outputs prepended to its prompt. background is the default (returns a runId immediately; toggle via `/subagents auto-bg off`); set background:false when you need the result inline in this turn. allowIntercom:true lets children talk to you and each other.",
|
|
132
139
|
promptSnippet: "Define and delegate work to specialized subagents.",
|
|
133
140
|
promptGuidelines: [
|
|
134
141
|
"Use subagent when independent review, testing, research, or parallel analysis improves quality.",
|
package/src/manager.ts
CHANGED
|
@@ -217,7 +217,9 @@ export class SubagentManager {
|
|
|
217
217
|
/** Flip the background-by-default flag; persists to the agent dir. Returns the new value. */
|
|
218
218
|
setAutoBg(on: boolean): boolean {
|
|
219
219
|
this.autoBg = on;
|
|
220
|
-
void writeFile(join(getAgentDir(), "subagents-config.json"), JSON.stringify({ autoBg: on }, null, 2)).catch(
|
|
220
|
+
void writeFile(join(getAgentDir(), "subagents-config.json"), JSON.stringify({ autoBg: on }, null, 2)).catch(
|
|
221
|
+
() => {},
|
|
222
|
+
);
|
|
221
223
|
return on;
|
|
222
224
|
}
|
|
223
225
|
|