@ferris1225/pi-subagents 4.2.0 → 4.2.2
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 +6 -2
- package/agents/explorer.md +1 -1
- package/package.json +1 -1
- package/src/config.ts +35 -1
- package/src/prompt.ts +3 -2
- package/src/rpc-run.ts +993 -993
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ directly when you want exact control.
|
|
|
53
53
|
|
|
54
54
|
| Agent | Access | Best for |
|
|
55
55
|
| ------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
-
| `explorer` | Read-only | Broad search, unfamiliar-area mapping, symbol and dependency tracing. Returns a retrieval index — never proof.
|
|
56
|
+
| `explorer` | Read-only | Broad search, unfamiliar-area mapping, symbol and dependency tracing. Returns a retrieval index — never proof. A single artifact the main agent must fully absorb (one issue, one spec) stays an inline read. |
|
|
57
57
|
| `executor` | Full | The default route for any non-trivial, self-contained task: implementation, fixes, refactors, tests, evidence-first cleanup, docs/comment sync, or merging a fan-out's results into one brief — carried through verification and a result-only handoff. |
|
|
58
58
|
|
|
59
59
|
Custom roles join them with a Markdown file (see [Custom agents](#custom-agents)).
|
|
@@ -262,7 +262,11 @@ strength per agent. Everything else is config-file only, stored at
|
|
|
262
262
|
The delegation directive is always injected; there is no toggle. Invalid values
|
|
263
263
|
fall back safely, and stale keys — including the former `proactiveInjection`,
|
|
264
264
|
`maxConcurrency`, `maxFixRounds`, and `notifyOnReviewPass` knobs — are dropped
|
|
265
|
-
automatically.
|
|
265
|
+
automatically. Built-in roles a newer package no longer ships (such as the
|
|
266
|
+
retired `worker`/`cleaner`/`documenter`/`synthesizer`/`reviewer` set) are pruned
|
|
267
|
+
from `enabledAgents`, `knownAgents`, and the model/thinking tables at first
|
|
268
|
+
load, so the setup wizard never mixes old and new roles; custom agents are
|
|
269
|
+
untouched. At session
|
|
266
270
|
start, model overrides pi no longer reports are removed with a one-time notice. If
|
|
267
271
|
pi's own session compaction fails mid-thread, a notice surfaces the error and the
|
|
268
272
|
automatic retry instead of failing quietly.
|
package/agents/explorer.md
CHANGED
|
@@ -12,7 +12,7 @@ You are an explorer agent: a fast, read-only reconnaissance specialist. You inve
|
|
|
12
12
|
## Hard constraints
|
|
13
13
|
|
|
14
14
|
- You are READ-ONLY. Never create, edit, or delete files; never run mutating commands. Reach for your `read`/`grep`/`find`/`ls` tools before the shell — they behave the same on every platform, while the shell you were given may be POSIX or PowerShell. Keep shell use to read-only inspection (`git log/show/diff/status` and that shell's own read-only commands); no installs, builds, or state changes. Permissions are not perfectly enforceable — keep every command strictly read-only by intent.
|
|
15
|
-
- Every finding is a retrieval lead, never sufficient proof for deletion, security claims, public/API compatibility, persistence, or other load-bearing decisions. The caller must re-read
|
|
15
|
+
- Every finding is a retrieval lead, never sufficient proof for deletion, security claims, public/API compatibility, persistence, or other load-bearing decisions. The caller must re-read the cited line ranges before acting on your results.
|
|
16
16
|
|
|
17
17
|
## Workflow
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ferris1225/pi-subagents",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "A managed sub-agent team for pi: specialized roles, pre-commit documentation sync, retained threads, auto-fix chains, model fallback, and Git worktree isolation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/config.ts
CHANGED
|
@@ -15,6 +15,13 @@ import { getAgentDir, withFileMutationQueue } from "@earendil-works/pi-coding-ag
|
|
|
15
15
|
/** Full catalog of agents shipped with the package (selectable in /subagents-setup). */
|
|
16
16
|
export const BUILTIN_AGENT_NAMES = ["explorer", "executor"] as const;
|
|
17
17
|
|
|
18
|
+
/** Built-in agent names this package no longer ships. Loading an older config
|
|
19
|
+
* prunes them from every record so the setup wizard, dispatch catalog, and
|
|
20
|
+
* model-routing table never surface dead roles. Custom names stay untouched —
|
|
21
|
+
* except one that reuses a removed built-in name, which this cleanup cannot
|
|
22
|
+
* distinguish and deliberately treats as retired. */
|
|
23
|
+
export const REMOVED_BUILTIN_AGENT_NAMES = ["worker", "cleaner", "documenter", "synthesizer", "reviewer"] as const;
|
|
24
|
+
|
|
18
25
|
/** Agents enabled out of the box on a fresh install. */
|
|
19
26
|
export const DEFAULT_ENABLED_AGENTS: readonly string[] = [...BUILTIN_AGENT_NAMES];
|
|
20
27
|
|
|
@@ -183,6 +190,29 @@ function defaultConfig(): SubagentsConfig {
|
|
|
183
190
|
};
|
|
184
191
|
}
|
|
185
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Drop every removed built-in role from an already-normalized config: enabled
|
|
195
|
+
* and known lists, plus per-agent model and thinking routes. The schema-upgrade
|
|
196
|
+
* persistence in loadConfig writes the pruned shape back to disk.
|
|
197
|
+
*/
|
|
198
|
+
function pruneRemovedBuiltins(config: SubagentsConfig): SubagentsConfig {
|
|
199
|
+
const removed = new Set<string>(REMOVED_BUILTIN_AGENT_NAMES);
|
|
200
|
+
const filter = (names: readonly string[]): string[] => names.filter((name) => !removed.has(name));
|
|
201
|
+
const agentModels = { ...config.agentModels };
|
|
202
|
+
const agentThinkingLevels = { ...config.agentThinkingLevels };
|
|
203
|
+
for (const name of REMOVED_BUILTIN_AGENT_NAMES) {
|
|
204
|
+
delete agentModels[name];
|
|
205
|
+
delete agentThinkingLevels[name];
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
...config,
|
|
209
|
+
enabledAgents: filter(config.enabledAgents),
|
|
210
|
+
knownAgents: filter(config.knownAgents),
|
|
211
|
+
agentModels,
|
|
212
|
+
agentThinkingLevels,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
186
216
|
/**
|
|
187
217
|
* A shipped agent the config has never recorded is new in this release; the
|
|
188
218
|
* stale allow-list must not keep it dark. Enable it and adopt explorer's
|
|
@@ -216,6 +246,7 @@ function adoptNewBuiltins(config: SubagentsConfig): SubagentsConfig {
|
|
|
216
246
|
* A file from an older version (missing newer keys or holding extra keys) is
|
|
217
247
|
* normalized and persisted back, so the on-disk config stays current. Built-in
|
|
218
248
|
* agents the file has never seen are adopted: enabled with explorer's route.
|
|
249
|
+
* Built-in roles this package retired are pruned from every record.
|
|
219
250
|
*/
|
|
220
251
|
export async function loadConfig(configPath: string = getConfigPath()): Promise<SubagentsConfig> {
|
|
221
252
|
let text: string;
|
|
@@ -233,7 +264,10 @@ export async function loadConfig(configPath: string = getConfigPath()): Promise<
|
|
|
233
264
|
return defaultConfig();
|
|
234
265
|
}
|
|
235
266
|
|
|
236
|
-
|
|
267
|
+
// Adopt newly shipped roles first so the prune below works on the final
|
|
268
|
+
// catalog, then drop roles this package stopped shipping and persist the
|
|
269
|
+
// cleaned shape back to disk.
|
|
270
|
+
const config = pruneRemovedBuiltins(adoptNewBuiltins(normalizeConfig(parsed)));
|
|
237
271
|
|
|
238
272
|
// Schema upgrade: persist the normalized shape when the file gained fields
|
|
239
273
|
// (new version) or dropped invalid ones.
|
package/src/prompt.ts
CHANGED
|
@@ -24,9 +24,10 @@ export function buildDelegationDirective(
|
|
|
24
24
|
|
|
25
25
|
const dispatchRules = [
|
|
26
26
|
`Delegate aggressively: child contexts are cheap, yours is scarce. Inline only trivial work — a lookup, a single focused edit, an answer already in context${hasExecutor ? "; default every non-trivial delegated task (implementation, fix, refactor, test, cleanup, docs sync, result merging) to `executor`" : ""}.`,
|
|
27
|
+
"A single artifact you must fully absorb yourself (one issue, one spec) is inline work — delegation saves search, not that read.",
|
|
27
28
|
...(hasExplorer
|
|
28
29
|
? [
|
|
29
|
-
"`explorer`: split a broad question into parallel explorers with disjoint scopes. Its findings are leads, never proof — re-read
|
|
30
|
+
"`explorer`: split a broad question into parallel explorers with disjoint scopes. Its findings are leads, never proof — re-read the cited line ranges before acting on them (a child you brief re-verifies).",
|
|
30
31
|
]
|
|
31
32
|
: []),
|
|
32
33
|
...(hasExecutor
|
|
@@ -45,7 +46,7 @@ export function buildDelegationDirective(
|
|
|
45
46
|
];
|
|
46
47
|
|
|
47
48
|
const verificationRules = [
|
|
48
|
-
"Never report an unrun check as passed; surface unavailable checks and pre-existing failures, and inspect actual
|
|
49
|
+
"Never report an unrun check as passed; surface unavailable checks and pre-existing failures, and inspect the actual diff before reporting completion.",
|
|
49
50
|
"Commit or push only when explicitly requested and applicable checks pass.",
|
|
50
51
|
];
|
|
51
52
|
|