@ferris1225/pi-subagents 4.2.13 → 4.3.0
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/CHANGELOG.md +15 -0
- package/README.md +63 -57
- package/agents/{executor.md → artisan.md} +5 -12
- package/agents/{explorer.md → scout.md} +2 -3
- package/agents/steward.md +51 -0
- package/package.json +4 -3
- package/src/agents.ts +3 -10
- package/src/announcements.ts +12 -5
- package/src/config.ts +161 -27
- package/src/dispatch.ts +5 -16
- package/src/index.ts +1 -1
- package/src/monitor.ts +2 -2
- package/src/prompt.ts +13 -7
- package/src/setup.ts +121 -101
- package/src/thread-lifecycle.ts +8 -20
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ Published versions of `@ferris1225/pi-subagents`. Unpublished numbers
|
|
|
4
4
|
(`4.2.3`, `4.2.6`, `4.2.9`–`4.2.11`) never shipped on npm; their changes
|
|
5
5
|
landed in the next published release.
|
|
6
6
|
|
|
7
|
+
## 4.3.0
|
|
8
|
+
|
|
9
|
+
- Built-in team is `scout`, `artisan`, and `steward`. All three stay enabled.
|
|
10
|
+
- `explorer` / `executor` configs rename in place (models and thinking
|
|
11
|
+
overrides follow). `steward` is adopted. That migration is deleted in the
|
|
12
|
+
next major.
|
|
13
|
+
- Artisan owns implement / fix / refactor / test. Steward owns cleanup, docs
|
|
14
|
+
sync, and merge — dispatched only when that work exists.
|
|
15
|
+
- Thinking is a role default (scout low, artisan high, steward medium) that
|
|
16
|
+
`/subagents-setup` can override. Per-call `thinking` and agent-file
|
|
17
|
+
`thinking` are gone. There is no Auto row.
|
|
18
|
+
- First session and first-run setup explain each role and ask for a model.
|
|
19
|
+
- Unit tests cover catalog migration, role prompts, dispatch routing, and
|
|
20
|
+
honest footer / truncation notes.
|
|
21
|
+
|
|
7
22
|
## 4.2.13
|
|
8
23
|
|
|
9
24
|
- README: table of contents, a What's new lead-in, and a pointer at this
|
package/README.md
CHANGED
|
@@ -6,20 +6,23 @@
|
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
A managed engineering team for [pi](https://github.com/earendil-works/pi):
|
|
9
|
+
A managed engineering team for [pi](https://github.com/earendil-works/pi): three
|
|
10
10
|
focused sub-agents, durable threads, and Git worktree
|
|
11
11
|
isolation. You install it once and your main agent delegates on its own.
|
|
12
12
|
|
|
13
13
|
## What's new
|
|
14
14
|
|
|
15
|
+
**4.3.0** — the team is `scout`, `artisan`, and `steward`. Existing
|
|
16
|
+
`explorer`/`executor` configs migrate. Thinking is a role default you can
|
|
17
|
+
change in `/subagents-setup` (no Auto, no per-call flag). All three roles
|
|
18
|
+
start on. See [CHANGELOG.md](./CHANGELOG.md).
|
|
19
|
+
|
|
15
20
|
**4.2.13** — this page now leads with current changes and keeps the 4.2 line
|
|
16
|
-
in
|
|
21
|
+
in the changelog.
|
|
17
22
|
|
|
18
23
|
**4.2.12**
|
|
19
24
|
|
|
20
|
-
-
|
|
21
|
-
- Footer settled counts stay honest, and only while a sibling is still live.
|
|
22
|
-
- Merging to `main` publishes npm and opens a matching GitHub Release.
|
|
25
|
+
- Confirm-before-fix; honest footer counts; `main` publishes npm + GitHub Release.
|
|
23
26
|
|
|
24
27
|
## Contents
|
|
25
28
|
|
|
@@ -65,10 +68,10 @@ Requires **pi >= 0.84.4** and **Node.js >= 22.19.0**.
|
|
|
65
68
|
pi install npm:@ferris1225/pi-subagents
|
|
66
69
|
```
|
|
67
70
|
|
|
68
|
-
Open pi and run `/subagents-setup
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
for work:
|
|
71
|
+
Open pi and run `/subagents-setup`. The first session tells you how: pick a
|
|
72
|
+
model for `scout`, `artisan`, and `steward` (all three stay on). Each row in
|
|
73
|
+
the wizard names the role and what it owns. Thinking has a role default you
|
|
74
|
+
can change there. Then just ask for work:
|
|
72
75
|
|
|
73
76
|
```text
|
|
74
77
|
Map how authentication works, fix the refresh race, run the tests, and review the diff.
|
|
@@ -79,10 +82,11 @@ directly when you want exact control.
|
|
|
79
82
|
|
|
80
83
|
## The team
|
|
81
84
|
|
|
82
|
-
| Agent
|
|
83
|
-
|
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
85
|
+
| Agent | Access | Best for |
|
|
86
|
+
| ---------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `scout` | 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. |
|
|
88
|
+
| `artisan` | Full | One deliverable that changes the repository: implement, fix, refactor, or test — confirmed on current code, then verified, then a result-only handoff. |
|
|
89
|
+
| `steward` | Full | Use only when that work exists: evidence-first cleanup, docs/comment sync, or merging a fan-out's result artifacts into one brief. |
|
|
86
90
|
|
|
87
91
|
Custom roles join them with a Markdown file (see [Custom agents](#custom-agents)).
|
|
88
92
|
|
|
@@ -91,14 +95,15 @@ memory of your conversation, so the brief is its only input. A good brief carrie
|
|
|
91
95
|
the goal, exact paths, constraints, and expected output — which is what the
|
|
92
96
|
injected delegation guidance produces when the main agent dispatches for you.
|
|
93
97
|
A named defect is not yet a change: confirm it on current code before fixing
|
|
94
|
-
or briefing a fix. The
|
|
98
|
+
or briefing a fix. The artisan re-reads before it edits. Steward is
|
|
99
|
+
dispatched only when cleanup, docs sync, or a merge is actually needed.
|
|
95
100
|
|
|
96
101
|
```text
|
|
97
102
|
You
|
|
98
103
|
└─ pi main agent
|
|
99
|
-
├─
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
├─ scout ─── parallel recon, retrieval leads only
|
|
105
|
+
├─ artisan ─── implement, fix, refactor, or test → verify → deliver
|
|
106
|
+
└─ steward ─── cleanup, docs sync, or merge fan-out results (when needed)
|
|
102
107
|
```
|
|
103
108
|
|
|
104
109
|
## Dispatching work
|
|
@@ -106,17 +111,16 @@ You
|
|
|
106
111
|
```ts
|
|
107
112
|
// One task
|
|
108
113
|
subagent({
|
|
109
|
-
agent: "
|
|
114
|
+
agent: "artisan",
|
|
110
115
|
task: "Fix the cache invalidation bug in src/cache, add regression tests, run the checks.",
|
|
111
116
|
});
|
|
112
117
|
|
|
113
118
|
// Parallel: as many genuinely independent units as the work has
|
|
114
119
|
subagent({
|
|
115
120
|
tasks: [
|
|
116
|
-
{ agent: "
|
|
117
|
-
{ agent: "
|
|
118
|
-
|
|
119
|
-
{ agent: "executor", task: "Run the suite and report failures.", thinking: "low" },
|
|
121
|
+
{ agent: "scout", task: "Trace model fallback from dispatch to completion." },
|
|
122
|
+
{ agent: "artisan", task: "Add edge-case tests for config migration." },
|
|
123
|
+
{ agent: "steward", task: "Merge the result artifacts under results/ into one brief." },
|
|
120
124
|
],
|
|
121
125
|
});
|
|
122
126
|
```
|
|
@@ -140,8 +144,8 @@ main agent inspects the actual changes before calling anything done.
|
|
|
140
144
|
|
|
141
145
|
## Parallel edits
|
|
142
146
|
|
|
143
|
-
- Single tasks use your checkout. Every parallel write-capable agent (`
|
|
144
|
-
and custom writers) defaults to a detached Git worktree, so
|
|
147
|
+
- Single tasks use your checkout. Every parallel write-capable agent (`artisan`,
|
|
148
|
+
`steward`, and custom writers) defaults to a detached Git worktree, so
|
|
145
149
|
parallel writers run at the same time. Worktree mode needs a committed `HEAD`,
|
|
146
150
|
and read-only agents reject it.
|
|
147
151
|
- A role file can pin its own default with `isolation: worktree` or
|
|
@@ -213,12 +217,12 @@ two lines: what it is — agent, task, token flow, cost, provider/model, elapsed
|
|
|
213
217
|
and, dim under the label column, what it is doing right now:
|
|
214
218
|
|
|
215
219
|
```text
|
|
216
|
-
● #12
|
|
220
|
+
● #12 artisan src/cache.ts · worktree:a91f3c · ↑5.2k ↓41.0k R210.0k W6.1k $1.9400 · 12m06s
|
|
217
221
|
↳ edit src/auth.ts
|
|
218
|
-
● #15
|
|
222
|
+
● #15 scout src/models.ts · ↑1.2k ↓8.4k R31.0k W1.1k $0.0900 · openai/gpt-5-mini · 3m07s
|
|
219
223
|
↳ grep fallback
|
|
220
|
-
○ #23
|
|
221
|
-
○ #24
|
|
224
|
+
○ #23 artisan src/config.ts · repo lane
|
|
225
|
+
○ #24 artisan ↻ tests/config.test.ts · queued · 5m02s
|
|
222
226
|
```
|
|
223
227
|
|
|
224
228
|
Telemetry drops leftmost-first when a row runs out of width (badge, wait
|
|
@@ -270,14 +274,13 @@ is missing, rate-limited, or fails at the provider level, the **same retained
|
|
|
270
274
|
session** continues on the main model, so finished searches, reads, and edits
|
|
271
275
|
survive. Ordinary task failures do not trigger a handoff.
|
|
272
276
|
|
|
273
|
-
Thinking
|
|
274
|
-
effective model supports. `/subagents-setup` →
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
vision mode — assign a multimodal model and name the image paths in the task.
|
|
277
|
+
Thinking is a **role default** — scout `low`, artisan `high`, steward
|
|
278
|
+
`medium` — clamped to what the effective model supports. `/subagents-setup` →
|
|
279
|
+
_Configure an agent_ lists only the levels that model supports, with the role
|
|
280
|
+
default marked. There is no Auto choice, no per-dispatch `thinking` flag, and
|
|
281
|
+
no `thinking` field in agent Markdown. Precedence: your setup override > the
|
|
282
|
+
role default, then the model clamp. There is no separate vision mode — assign
|
|
283
|
+
a multimodal model and name the image paths in the task.
|
|
281
284
|
|
|
282
285
|
Every dispatch, resume, retry, and fallback snapshots the parent's
|
|
283
286
|
currently active tools. A role with no explicit list inherits the full set. An
|
|
@@ -297,16 +300,17 @@ child cannot run.
|
|
|
297
300
|
|
|
298
301
|
## Configuration
|
|
299
302
|
|
|
300
|
-
`/subagents-setup` stays one level deep:
|
|
301
|
-
|
|
303
|
+
`/subagents-setup` stays one level deep: the team (all three stay on), plus a
|
|
304
|
+
model and optional thinking override per agent. First run explains each role
|
|
305
|
+
before you pick models. Everything else is config-file only, stored at
|
|
302
306
|
`~/.pi/agent/pi-subagents.json` (following `PI_CODING_AGENT_DIR`):
|
|
303
307
|
|
|
304
308
|
```json
|
|
305
309
|
{
|
|
306
|
-
"enabledAgents": ["
|
|
307
|
-
"knownAgents": ["
|
|
308
|
-
"agentModels": { "
|
|
309
|
-
"agentThinkingLevels": { "
|
|
310
|
+
"enabledAgents": ["scout", "artisan", "steward"],
|
|
311
|
+
"knownAgents": ["scout", "artisan", "steward"],
|
|
312
|
+
"agentModels": { "scout": "anthropic/claude-haiku-4-5" },
|
|
313
|
+
"agentThinkingLevels": { "artisan": "high" },
|
|
310
314
|
"maxResultLines": 40,
|
|
311
315
|
"agentScope": "user",
|
|
312
316
|
"idleTimeoutSec": 90
|
|
@@ -318,7 +322,7 @@ strength per agent. Everything else is config-file only, stored at
|
|
|
318
322
|
| `enabledAgents` | Agents available for discovery and delegation. `[]` disables all. |
|
|
319
323
|
| `knownAgents` | Built-ins this config has seen; automatic bookkeeping — never edit it. |
|
|
320
324
|
| `agentModels` | Optional `provider/model-id` per agent; missing = current main model. |
|
|
321
|
-
| `agentThinkingLevels` | Optional
|
|
325
|
+
| `agentThinkingLevels` | Optional setup override per agent; missing = the role default. |
|
|
322
326
|
| `maxResultLines` | Lines kept in a completion message before the artifact takes over. Default `40`. |
|
|
323
327
|
| `agentScope` | Discover `user`, `project`, or `both` agent directories. Default `user`. |
|
|
324
328
|
| `idleTimeoutSec` | Seconds without child RPC output before termination; `0` disables. Default `90`. |
|
|
@@ -327,20 +331,22 @@ The delegation directive is always injected; there is no toggle. Invalid values
|
|
|
327
331
|
fall back safely, and stale keys — including the former `proactiveInjection`,
|
|
328
332
|
`maxConcurrency`, `maxFixRounds`, and `notifyOnReviewPass` knobs — are dropped
|
|
329
333
|
automatically. Built-in roles a newer package no longer ships (such as the
|
|
330
|
-
retired `worker`/`cleaner`/`documenter`/`synthesizer`/`reviewer` set
|
|
334
|
+
retired `worker`/`cleaner`/`documenter`/`synthesizer`/`reviewer` set, and the
|
|
335
|
+
renamed `explorer`/`executor` names after they have been mapped) are pruned
|
|
331
336
|
from `enabledAgents`, `knownAgents`, and the model/thinking tables at first
|
|
332
337
|
load, so the setup wizard never mixes old and new roles; custom agents are
|
|
333
|
-
untouched.
|
|
338
|
+
untouched. A 4.2 config that still says `explorer`/`executor` is rewritten to
|
|
339
|
+
`scout`/`artisan` and gains `steward`; their model and thinking overrides move
|
|
340
|
+
with the names. That rename lives in `src/config.ts` and will be deleted in
|
|
341
|
+
the next major. At session
|
|
334
342
|
start, model overrides pi no longer reports are removed with a one-time notice. If
|
|
335
343
|
pi's own session compaction fails mid-thread, a notice surfaces the error and the
|
|
336
344
|
automatic retry instead of failing quietly.
|
|
337
345
|
|
|
338
346
|
Agents shipped by a newer package version turn themselves on at the next
|
|
339
|
-
session
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
(`knownAgents` is what tells the two cases apart). Enabling a role in
|
|
343
|
-
`/subagents-setup` adopts the same explorer route.
|
|
347
|
+
session. Scout, artisan, and steward stay enabled even if a stale allow-list
|
|
348
|
+
left one off. A one-shot notice then points at `/subagents-setup` so you can
|
|
349
|
+
pick a model for each.
|
|
344
350
|
|
|
345
351
|
## Custom agents
|
|
346
352
|
|
|
@@ -352,17 +358,15 @@ Built-ins ship with the package. Add or replace them with Markdown files:
|
|
|
352
358
|
|
|
353
359
|
```yaml
|
|
354
360
|
---
|
|
355
|
-
name:
|
|
361
|
+
name: scout
|
|
356
362
|
description: Fast read-only codebase reconnaissance
|
|
357
|
-
thinking: low
|
|
358
363
|
isolation: shared
|
|
359
364
|
tools: read, bash
|
|
360
365
|
---
|
|
361
366
|
…additional system prompt…
|
|
362
367
|
```
|
|
363
368
|
|
|
364
|
-
`description` is the routing line the main model reads
|
|
365
|
-
role's Auto preference, which a wizard choice overrides. `isolation` pins the
|
|
369
|
+
`description` is the routing line the main model reads. `isolation` pins the
|
|
366
370
|
role's default boundary as described under [Parallel edits](#parallel-edits).
|
|
367
371
|
Models come only from `/subagents-setup`; an agent file cannot pin one. An
|
|
368
372
|
explicit `tools` list is the capability boundary, and omitting it inherits the
|
|
@@ -398,17 +402,19 @@ npm install
|
|
|
398
402
|
npm run check
|
|
399
403
|
```
|
|
400
404
|
|
|
401
|
-
|
|
405
|
+
`npm run check` is `tsc --noEmit` plus the unit tests (`npm test`). There are
|
|
406
|
+
no bundled runtime dependencies; pi and TypeBox are peers. The source is
|
|
402
407
|
split by responsibility: dispatch policy, thread lifecycle, RPC
|
|
403
408
|
transport, worktree integration, completion delivery, tools, and TUI status.
|
|
404
409
|
|
|
405
410
|
## Changelog
|
|
406
411
|
|
|
407
|
-
The 4.
|
|
408
|
-
version is **4.
|
|
412
|
+
The 4.3 line lives in [CHANGELOG.md](./CHANGELOG.md). Latest published
|
|
413
|
+
version is **4.3.0**.
|
|
409
414
|
|
|
410
415
|
| Version | What changed |
|
|
411
416
|
| ------- | ------------ |
|
|
417
|
+
| 4.3.0 | Team is `scout` + `artisan` + `steward`; role thinking defaults; config migrate. |
|
|
412
418
|
| 4.2.13 | README navigation, What's new, and this changelog. |
|
|
413
419
|
| 4.2.12 | Confirm-before-fix; honest footer counts; `main` publishes npm + GitHub Release. |
|
|
414
420
|
| 4.2.8 | Footer roll-up; wait-path token usage; hold completions across compaction. |
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: A self-contained unit that changes the repository
|
|
4
|
-
thinking: high
|
|
2
|
+
name: artisan
|
|
3
|
+
description: A self-contained unit that changes the repository — implement, fix, refactor, or test — carried through verification to a result-only handoff.
|
|
5
4
|
# No `tools` field => inherits all tools (full capability).
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
You are an
|
|
7
|
+
You are an artisan with full capabilities in an isolated context window. You own one delegated implementation task end to end so the main conversation stays clean. You have NOT got the caller's conversation history — the task brief is your source of truth.
|
|
9
8
|
|
|
10
9
|
Repository instructions (AGENTS.md) and any skills available in this session apply to you as to any agent: follow their process for the domains they own (language style, tests, debugging, cleanup discipline, verification). Where a skill covers the same ground as this brief, the skill's discipline wins — except for the release boundary below, which always wins.
|
|
11
10
|
|
|
11
|
+
Cleanup, documentation sync, and merging fan-out results belong to `steward`. If the brief is only that work, do not improvise it here — say so and stop.
|
|
12
|
+
|
|
12
13
|
## Procedure
|
|
13
14
|
|
|
14
15
|
1. **Context.** Read the brief fully, plus referenced files and images, before acting. If critical context is missing, state what is missing rather than guessing.
|
|
@@ -17,14 +18,6 @@ Repository instructions (AGENTS.md) and any skills available in this session app
|
|
|
17
18
|
4. **Implement.** Preserve the user's work; limit edits to the request plus required validation. Follow the project's error handling, naming, and style. Synchronize README/docs/comments your change directly affects; never defer that drift.
|
|
18
19
|
5. **Verify.** Run the project's format/build/tests when they exist. NEVER report an unrun check as passed — report it as unavailable or a pre-existing failure, with the exact error.
|
|
19
20
|
|
|
20
|
-
## Conditional playbooks
|
|
21
|
-
|
|
22
|
-
Skip both unless the brief matches one.
|
|
23
|
-
|
|
24
|
-
**Cleanup** (dead code, duplication, simplification): a candidate is not a deletion. Re-read the load-bearing files and repeat the decisive searches yourself — never inherit proof from another agent's report — and search the whole repository for consumers first. Keep a candidate when a real consumer exists, dynamic reachability is unresolved, or the cut removes a user capability, public API, persisted format, or compatibility path the brief did not explicitly approve. Finding no safe cut and making zero edits is valid.
|
|
25
|
-
|
|
26
|
-
**Merging inputs** (result artifacts, reports, logs): read every named input fully before writing, deduplicate restatements into one attributed entry, and report surviving conflicts side by side instead of averaging them away. Stay within the named inputs; report what they cannot answer as a gap.
|
|
27
|
-
|
|
28
21
|
## Boundaries
|
|
29
22
|
|
|
30
23
|
- Never commit, push, publish, tag, release, or bump a package version — the caller owns every release action, even when repository instructions normally automate release after green checks.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: scout
|
|
3
3
|
description: Fast read-only reconnaissance for broad or multi-file search in unfamiliar areas; returns exact paths and compressed findings as retrieval leads.
|
|
4
4
|
tools: read, grep, find, ls, bash
|
|
5
5
|
# At launch, this shell slot follows the parent and parent-active plugin tools
|
|
6
6
|
# are appended; the listed non-shell Pi built-ins remain the permission boundary.
|
|
7
|
-
thinking: low
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
You are
|
|
9
|
+
You are a scout: a fast, read-only reconnaissance specialist. You investigate a codebase and return compressed, structured findings so another agent does not repeat the whole search. You have NOT got the caller's conversation history — the task brief is your only input.
|
|
11
10
|
|
|
12
11
|
## Hard constraints
|
|
13
12
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: steward
|
|
3
|
+
description: Condenses a finished change or a pile of inputs — evidence-first cleanup, docs/comment sync, or merging fan-out results into one brief.
|
|
4
|
+
# No `tools` field => inherits all tools (full capability).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a steward: you tidy, document, or fold inputs together so the caller does not. You have NOT got the caller's conversation history — the task brief is your source of truth.
|
|
8
|
+
|
|
9
|
+
Pick one mode from the brief and skip the others. Finding nothing safe to do and making zero edits is valid.
|
|
10
|
+
|
|
11
|
+
## Cleanup
|
|
12
|
+
|
|
13
|
+
A candidate is not a deletion. Re-read the load-bearing files and repeat the decisive searches yourself — never inherit proof from another agent's report — and search the whole repository for consumers first. Keep a candidate when a real consumer exists, dynamic reachability is unresolved, or the cut removes a user capability, public API, persisted format, or compatibility path the brief did not explicitly approve.
|
|
14
|
+
|
|
15
|
+
Honor an explicit scope (uncommitted diff, Git range, directory). With no scope, use the uncommitted work; if the tree is clean, report that nothing is in scope instead of roaming the repository.
|
|
16
|
+
|
|
17
|
+
## Docs sync
|
|
18
|
+
|
|
19
|
+
Update comments, README, examples, and user docs to match the code. Never change runtime behavior to make the documentation true. Prefer the current implementation over another document. Do not start a standalone docs pass the brief did not ask for.
|
|
20
|
+
|
|
21
|
+
## Merging inputs
|
|
22
|
+
|
|
23
|
+
Read every named input fully before writing. Deduplicate restatements into one attributed entry. Report surviving conflicts side by side instead of averaging them away. Stay within the named inputs; report what they cannot answer as a gap.
|
|
24
|
+
|
|
25
|
+
## Boundaries
|
|
26
|
+
|
|
27
|
+
- Never commit, push, publish, tag, release, or bump a package version — the caller owns every release action.
|
|
28
|
+
- Children are leaf processes: you cannot dispatch sub-agents.
|
|
29
|
+
- Implementation, fixes, refactors, and tests belong to `artisan`. If the brief is only that work, say so and stop.
|
|
30
|
+
|
|
31
|
+
## Output format
|
|
32
|
+
|
|
33
|
+
Return only the concrete outcome. Do not repeat the task brief, the investigation, or the tool chronology.
|
|
34
|
+
|
|
35
|
+
## Completed
|
|
36
|
+
|
|
37
|
+
What was done, in a few lines. For a merge, one brief with conflicts and gaps (omit empty sections).
|
|
38
|
+
|
|
39
|
+
## Files Changed
|
|
40
|
+
|
|
41
|
+
- `path/to/file.ts` — what changed. Omit when the mode was read-only merge.
|
|
42
|
+
|
|
43
|
+
## Verification
|
|
44
|
+
|
|
45
|
+
Which checks you ACTUALLY ran and their result. State explicitly anything you could not run and why.
|
|
46
|
+
|
|
47
|
+
## Notes (only when material)
|
|
48
|
+
|
|
49
|
+
Unresolved blockers, kept candidates that need a product decision, or gaps in the inputs. Omit when nothing actionable.
|
|
50
|
+
|
|
51
|
+
Keep the final response comfortably below the 40-line delivery cap unless the result genuinely requires more.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ferris1225/pi-subagents",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "A managed sub-agent team for pi:
|
|
3
|
+
"version": "4.3.0",
|
|
4
|
+
"description": "A managed sub-agent team for pi: scout, artisan, and steward roles, durable threads, model fallback, and Git worktree isolation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"check": "tsc --noEmit",
|
|
40
|
+
"check": "tsc --noEmit && npm test",
|
|
41
|
+
"test": "node --experimental-transform-types --test test/*.test.ts",
|
|
41
42
|
"prepack": "npm run check"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
package/src/agents.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { type Dirent, existsSync, readdirSync, readFileSync, statSync } from "no
|
|
|
15
15
|
import { dirname, join } from "node:path";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
17
17
|
import { CONFIG_DIR_NAME, getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent";
|
|
18
|
-
import {
|
|
18
|
+
import { type AgentScope } from "./config.ts";
|
|
19
19
|
import type { IsolationMode } from "./worktree.ts";
|
|
20
20
|
|
|
21
21
|
export type AgentSource = "builtin" | "user" | "project";
|
|
@@ -26,8 +26,6 @@ export interface AgentConfig {
|
|
|
26
26
|
tools?: string[];
|
|
27
27
|
/** Model ref this run was routed to; filled in by dispatch, never declared by the agent file. */
|
|
28
28
|
model?: string;
|
|
29
|
-
/** Per-agent default thinking strength (frontmatter `thinking`); config override wins. */
|
|
30
|
-
thinking?: ThinkingLevel;
|
|
31
29
|
/** Role-declared default isolation (frontmatter `isolation`); an explicit
|
|
32
30
|
* per-call request wins, and `worktree` applies to write-capable roles only. */
|
|
33
31
|
isolation?: IsolationMode;
|
|
@@ -94,8 +92,8 @@ export function resolveAgentTools(
|
|
|
94
92
|
export function isWriteCapableAgent(
|
|
95
93
|
agent: Pick<AgentConfig, "name" | "tools">,
|
|
96
94
|
): boolean {
|
|
97
|
-
if (agent.name === "
|
|
98
|
-
if (agent.name === "
|
|
95
|
+
if (agent.name === "scout") return false;
|
|
96
|
+
if (agent.name === "artisan" || agent.name === "steward") return true;
|
|
99
97
|
if (!agent.tools) return true;
|
|
100
98
|
return agent.tools.includes("edit") || agent.tools.includes("write");
|
|
101
99
|
}
|
|
@@ -145,10 +143,6 @@ function loadAgentsFromDir(dir: string, source: AgentSource): AgentConfig[] {
|
|
|
145
143
|
?.split(",")
|
|
146
144
|
.map((t) => t.trim())
|
|
147
145
|
.filter(Boolean);
|
|
148
|
-
const rawThinking = str(frontmatter.thinking)?.trim();
|
|
149
|
-
const thinking = (THINKING_LEVEL_VALUES as readonly string[]).includes(rawThinking ?? "")
|
|
150
|
-
? (rawThinking as ThinkingLevel)
|
|
151
|
-
: undefined;
|
|
152
146
|
const rawIsolation = str(frontmatter.isolation)?.trim();
|
|
153
147
|
const isolation = rawIsolation === "worktree" || rawIsolation === "shared"
|
|
154
148
|
? (rawIsolation as IsolationMode)
|
|
@@ -158,7 +152,6 @@ function loadAgentsFromDir(dir: string, source: AgentSource): AgentConfig[] {
|
|
|
158
152
|
name,
|
|
159
153
|
description,
|
|
160
154
|
tools: tools && tools.length > 0 ? tools : undefined,
|
|
161
|
-
...(thinking ? { thinking } : {}),
|
|
162
155
|
...(isolation ? { isolation } : {}),
|
|
163
156
|
systemPrompt: body,
|
|
164
157
|
source,
|
package/src/announcements.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
|
-
import { loadConfig, saveConfig } from "./config.ts";
|
|
5
|
+
import { FIRST_RUN_SETUP_HINT, loadConfig, saveConfig } from "./config.ts";
|
|
6
6
|
import { availableModelsInScope, filterUnavailableModelOverrides } from "./models.ts";
|
|
7
7
|
import { announceRecoveryRecords } from "./recovery.ts";
|
|
8
8
|
import type { SubagentRuntime } from "./runtime.ts";
|
|
@@ -39,13 +39,20 @@ async function migrateUnavailableAgentModels(
|
|
|
39
39
|
export function registerAnnouncements(pi: ExtensionAPI, runtime: SubagentRuntime): void {
|
|
40
40
|
pi.on("session_start", async (_event, ctx) => {
|
|
41
41
|
if (!existsSync(runtime.configPath)) {
|
|
42
|
-
ctx.ui.notify(
|
|
43
|
-
"pi-subagents: no configuration yet — run /subagents-setup to pick agents, models, and thinking strengths. Defaults (all built-in agents on the main model) apply until then.",
|
|
44
|
-
"info",
|
|
45
|
-
);
|
|
42
|
+
ctx.ui.notify(`pi-subagents: ${FIRST_RUN_SETUP_HINT}`, "info");
|
|
46
43
|
}
|
|
47
44
|
await announceRecoveryRecords(runtime.configPath, ctx);
|
|
48
45
|
await migrateUnavailableAgentModels(ctx, runtime);
|
|
46
|
+
try {
|
|
47
|
+
const config = await loadConfig(runtime.configPath);
|
|
48
|
+
if (config.pendingSetupNotice) {
|
|
49
|
+
ctx.ui.notify(`pi-subagents: ${config.pendingSetupNotice}`, "info");
|
|
50
|
+
const { pendingSetupNotice: _cleared, ...rest } = config;
|
|
51
|
+
await saveConfig(rest, runtime.configPath);
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
/* notice is non-fatal */
|
|
55
|
+
}
|
|
49
56
|
// Restore starts at extension load and session_start fires right behind
|
|
50
57
|
// it, so without this the notice reports whatever the race left behind.
|
|
51
58
|
await runtime.durableRestore;
|