@ferris1225/pi-subagents 6.0.2 → 6.0.4

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.4
4
+
5
+ ### Changes
6
+
7
+ - Open `/subagents-setup` role configuration and model/thinking pickers in
8
+ standalone centered modal overlay panels instead of squeezing them into the
9
+ input editor dock.
10
+ - Streamline delegation to the three core roles (`scout`, `artisan`, `sentinel`),
11
+ consolidating implementation review and claim-challenge verification into
12
+ `sentinel` and removing separate workflow/phase-scope machinery.
13
+
14
+ ## 6.0.3
15
+
16
+ ### Changes
17
+
18
+ - Update the Pi SDK dependencies and minimum supported Pi version to 1.5.0.
19
+ - Preserve typed isolation and workflow enums with Pi's new JSON Schema
20
+ validation while retaining the existing tool parameter format.
21
+ - Keep setup search focus stable and show configured navigation shortcuts.
22
+ Preserve acceptance verdicts and worktree application state on narrow panels.
23
+ - Make follow-ups prioritize the current objective and reuse relevant history.
24
+ Clarify research evidence standards and reduce overlapping workflow prompts.
25
+
3
26
  ## 6.0.2
4
27
 
5
28
  ### Fixes
package/README.md CHANGED
@@ -1,35 +1,30 @@
1
1
  # pi-subagents
2
2
 
3
3
  Sub-agents for [Pi](https://github.com/earendil-works/pi): research, implementation,
4
- dependency workflows, and Git worktree isolation.
4
+ independent review, interactive follow-ups, and Git worktree isolation.
5
5
 
6
6
  ## Install
7
7
 
8
- Requires **Pi >= 1.4.0** and **Node.js >= 22.19.0**. Development and native
9
- integration tests use the Pi 1.4.0 SDK.
8
+ Requires **Pi >= 1.5.0** and **Node.js >= 22.19.0**. Development and native
9
+ integration tests use the Pi 1.5.0 SDK.
10
10
 
11
11
  ```bash
12
12
  pi install npm:@ferris1225/pi-subagents
13
13
  ```
14
14
 
15
- Run `/subagents-setup`, choose a role, then choose **Model**, **Thinking**, or
16
- **Reset defaults**. Every screen uses ↑/↓ and Enter; Esc goes back one level
17
- without applying an unconfirmed choice. Selections save immediately and return
18
- to the same setting; returning to the role list keeps that role selected.
19
-
20
- Model and thinking choices support search, Unicode paste, and PgUp/PgDn paging.
21
- Models show their friendly name and provider; search also matches exact model
22
- references and capabilities. **[saved]** marks the stored selection independently
23
- of the navigation cursor. **Follow main (dynamic)** tracks the main window's
24
- model, including future changes; choosing a specific model pins that reference,
25
- even when it currently matches main. Tab toggles complete details (including
26
- exact references); ↑/↓ and PgUp/PgDn scroll them. Tab or Esc returns from details
27
- to the list, keeping the search and cursor.
28
- The list takes priority over details on short terminals. Setup reserves space
29
- for the workflow identity and required-acceptance row.
15
+ Run `/subagents-setup` to open a standalone centered modal panel rather than
16
+ squeezing menus into the input editor dock. Wide panels place the role register
17
+ and the focused role's settings side by side; narrow panels stack them. ↑/↓
18
+ changes the role, ←/→ selects **Model**, **Thinking**, or **Reset**, and Enter
19
+ edits it in a searchable modal picker. The selected role shows its full model
20
+ reference, effective reasoning level, requested level when clamped, and
21
+ default/override source. Each selection saves immediately; Esc returns without
22
+ applying a picker selection and keeps focus. Model pickers support search,
23
+ paste, and paging. On short terminals, PgUp/PgDn scrolls the settings while the
24
+ selected role and field stay pinned.
30
25
 
31
26
  All roles follow the main model by default; thinking defaults to `low` for scout
32
- and `high` for artisan, sentinel, and skeptic. The panel distinguishes defaults from overrides and
27
+ and `high` for artisan and sentinel. The panel distinguishes defaults from overrides and
33
28
  shows the effective level when model capabilities clamp a preference. Changing
34
29
  a model preserves the thinking preference. Settings live in
35
30
  `~/.pi/agent/pi-subagents.json` as `agentModels` and `agentThinkingLevels`.
@@ -40,25 +35,22 @@ a model preserves the thinking preference. Settings live in
40
35
  | --- | --- | --- |
41
36
  | `scout` | Code, documentation, and web research with citations | Read-only tools; no commands or edits |
42
37
  | `artisan` | Implementation and fixes with tests and checks | Parent's tool surface, including codemode |
43
- | `sentinel` | Inspect an implementation or diff against requirements and callers | Parent's tool surface; instructed not to edit |
44
- | `skeptic` | Test a named claim, assumption, or review finding with counterexamples | Parent's tool surface; instructed not to edit |
38
+ | `sentinel` | Inspect an implementation or diff and challenge claims or assumptions for defects and regressions | Parent's tool surface; instructed not to edit |
45
39
 
46
40
  The main model chooses from these role descriptions; names alone do not route a
47
- task. Use `sentinel` for "inspect this diff" and `skeptic` for "does this claim
48
- hold?" Default to one review role. Both are justified only by distinct questions, such as
49
- reviewing an implementation and then testing its specific findings. A skeptic
50
- without a named claim reports the gap and stops instead of starting another review.
41
+ task. Use `sentinel` to inspect implementations/diffs or challenge a specific claim
42
+ or assumption with counterexamples and focused checks.
51
43
 
52
- Sentinel and skeptic may run focused checks, so their no-edit boundary is an
53
- instruction, not a tool-enforced restriction. Change reviews focus on introduced
54
- defects; a wider audit needs an explicit brief. All roles reuse existing facts
55
- and valid checks, filling gaps rather than repeating main or upstream work.
44
+ Sentinel may run focused checks, so its no-edit boundary is an instruction, not
45
+ a tool-enforced restriction. Change reviews focus on introduced defects; a wider
46
+ audit needs an explicit brief. All roles reuse existing facts and valid checks,
47
+ filling gaps rather than repeating main or upstream work.
56
48
 
57
- Only `scout`, `artisan`, `sentinel`, and `skeptic` are valid runtime role names.
49
+ Only `scout`, `artisan`, and `sentinel` are valid runtime role names.
58
50
  Existing model/thinking settings and interrupted run records migrate on load
59
- and are saved with the new names. Explicit valid settings under the new names
60
- win. Custom roles and user-defined workflows are not supported. Retained records
61
- from older releases remain available for recovery.
51
+ (`reviewer`, `critic`, and `skeptic` map to `sentinel`) and are saved with the
52
+ current names. Explicit valid settings under the current names win. Custom roles
53
+ are not supported. Retained records from older releases remain available for recovery.
62
54
 
63
55
  Children receive a self-contained brief and project instructions, but no parent
64
56
  conversation. They cannot delegate or release. Main owns planning, integration,
@@ -77,7 +69,7 @@ avoid subagents take precedence.
77
69
  Use one owner per deliverable, including its regression tests. Brief the child
78
70
  with the outcome, done condition, relevant paths, established evidence, write
79
71
  boundaries, required checks, and a compact expected result. Scout retrieves
80
- sources; artisan implements, while sentinel and skeptic can execute focused checks. This policy applies the context-isolation,
72
+ sources; artisan implements, while sentinel can execute focused checks. This policy applies the context-isolation,
81
73
  focused-role, and coordination-cost guidance in the official
82
74
  [Codex subagents](https://developers.openai.com/codex/subagents) and
83
75
  [Claude Code subagents](https://code.claude.com/docs/en/sub-agents) docs to Pi's
@@ -88,14 +80,12 @@ authorized and requests focused confirmation only when material uncertainty
88
80
  remains. Before reporting success, main checks each done condition and any
89
81
  blockers in the child's answer as well as the integrated diff.
90
82
 
91
- Ask Pi to delegate explicitly, or call the tools directly:
83
+ Ask Pi to delegate explicitly, or call the tool directly:
92
84
 
93
85
  ```ts
94
86
  subagent({
95
87
  agent: "artisan",
96
- phaseId: "cache-fix",
97
88
  task: "Fix cache invalidation in src/cache, add regression tests, and run the checks.",
98
- scope: { paths: ["src/cache", "test/cache.test.ts"] },
99
89
  });
100
90
  ```
101
91
 
@@ -106,159 +96,54 @@ subagent({
106
96
  tasks: [
107
97
  {
108
98
  agent: "artisan",
109
- phaseId: "config-fix",
110
99
  task: "Fix config validation and its regression tests.",
111
- scope: { paths: ["src/config.ts", "test/config.test.ts"] },
112
100
  },
113
101
  {
114
102
  agent: "artisan",
115
- phaseId: "provider-docs",
116
103
  task: "Update docs/providers.md from the established API citations.",
117
- scope: { paths: ["docs/providers.md"] },
118
104
  },
119
105
  ],
120
106
  });
121
107
  ```
122
108
 
123
- Use `wait: true` when the next step needs the result. `subagent`,
124
- `subagent_workflow`, and completed-run `subagent_message` follow-ups default to
125
- waiting in one-shot `pi -p` / JSON sessions, so the parent stays alive until the
126
- work finishes. TUI and RPC sessions default to background delivery; `wait: false`
127
- explicitly selects it in any mode. Each result is delivered once, after
128
- integration, either in the waiting tool call or as a background completion.
129
- Awaited failures are tool errors with retained evidence.
109
+ Use `wait: true` when the next step needs the result. `subagent` and completed-run
110
+ `subagent_message` follow-ups default to waiting in one-shot `pi -p` / JSON sessions,
111
+ so the parent stays alive until the work finishes. TUI and RPC sessions default
112
+ to background delivery; `wait: false` explicitly selects it in any mode. Each
113
+ result is delivered once, after integration, either in the waiting tool call or
114
+ as a background completion. Awaited failures are tool errors with retained evidence.
130
115
 
131
116
  A launch receipt only confirms delegation. Main continues independent work or
132
117
  pauses until the completion wakes it, then finishes the requested outcome and
133
118
  final checks. It does not poll or treat a successful launch as task completion.
134
- Use stable `phaseId` values: completed phases stay owned for the parent session,
135
- and interrupted phases retain ownership across reloads. Equal normalized tasks
136
- in the same cwd are also rejected, even with a different `phaseId`. Reuse the
137
- result, or use `subagent_message` for an additional bounded step.
138
-
139
- Ownership includes main, individual runs, and workflow nodes still waiting on
140
- dependencies. Main continues only disjoint work and passes its completed research
141
- and checks into the child brief. Pending graph nodes reserve their declared write
142
- scopes; external conflicts reject a batch or graph before any child starts.
143
- Main `edit`/`write` calls, including nested calls through `codemode`, are blocked
144
- on those scopes. In-flight main writes also prevent conflicting dispatches.
145
- Stopped writers keep their claims until execution and integration finish.
146
-
147
- These checks use declared phase identity and exact paths/symbols. Main file writes
148
- conservatively conflict with any claimed symbol in that file. Omitted scopes,
149
- arbitrary shell/custom-tool effects, symlink aliases, and differently worded work
150
- without a shared phase id cannot be inferred reliably; this is coordination,
151
- not a sandbox or semantic duplicate detector. Use `subagent_status` to inspect
152
- phase/scope ownership; an exact run id also retrieves its retained result for reuse.
153
-
154
- ## Workflows
155
-
156
- `subagent_workflow` runs a built-in plan with named task inputs. Its only source
157
- is the catalog in [templates.ts](./src/workflow/templates.ts): no inline `nodes`,
158
- `file`, custom graph name, user directory, or project directory is loaded.
159
- The model's routing rules are embedded in [prompt.ts](./src/delegation/prompt.ts),
160
- so no separate workflow skill needs to be loaded.
161
-
162
- | Workflow | Work before acceptance | Required inputs |
163
- | --- | --- | --- |
164
- | `code-review` | Sentinel inspects the target and produces supported findings | `TARGET` |
165
- | `research` | Three scouts investigate first-party sources, practice, and the repository; a fourth synthesizes the answer | `QUESTION` |
166
- | `migration` | Two artisans implement disjoint slices; an integrated gate checks and fixes their combined result | `TARGET`, `CONTRACT`, `CORE_CHANGE`, `ADAPTER_CHANGE`, `CORE_SCOPE`, `CORE_TEST_SCOPE`, `ADAPTER_SCOPE`, `ADAPTER_TEST_SCOPE` |
167
-
168
- ```ts
169
- subagent_workflow({
170
- workflow: "code-review",
171
- inputs: { TARGET: "HEAD~1..HEAD; inspect the cache invalidation fix" },
172
- wait: true,
173
- });
174
-
175
- subagent_workflow({
176
- workflow: "research",
177
- inputs: { QUESTION: "How should this repository invalidate its HTTP cache?" },
178
- });
179
- ```
180
-
181
- Migration inputs must name the shared interface contract, both slice briefs, and
182
- exact write paths. Each slice owns its implementation and regression tests;
183
- shared paths are rejected before any child starts. The integrated gate waits
184
- for both slices and can edit their combined scope. For example:
185
-
186
- ```ts
187
- subagent_workflow({
188
- workflow: "migration",
189
- inputs: {
190
- TARGET: "the version 2 cache API",
191
- CONTRACT: "docs/cache-v2.md",
192
- CORE_CHANGE: "Update storage and its invalidation rules",
193
- ADAPTER_CHANGE: "Update HTTP callers to the new interface",
194
- CORE_SCOPE: "src/core",
195
- CORE_TEST_SCOPE: "test/core",
196
- ADAPTER_SCOPE: "src/adapters",
197
- ADAPTER_TEST_SCOPE: "test/adapters",
198
- },
199
- });
200
- ```
201
-
202
- Choose a built-in workflow when its fixed phases fit the task. For one bounded
203
- phase use `subagent`; for independent work use `subagent({ tasks: [...] })`.
204
- If research must determine the next task or its scope, run it first and decide
205
- in main. Missing, unknown, or unused template inputs are rejected with the exact
206
- parameter names before a child starts. Task inputs remain literal, including
207
- `{{...}}` text.
208
-
209
- Every workflow ends with an independent **sentinel acceptance officer**. The
210
- runtime adds this node, waits until all work has settled and integrated, and
211
- passes a bounded evidence brief plus the complete report. Failed and blocked
212
- branches are included. The officer reviews the delivered outcome, reuses valid
213
- checks, and may run focused checks to close evidence gaps. It does not edit or
214
- release. A successful code review can report defects in the target; acceptance
215
- judges the accuracy and completeness of that review.
216
-
217
- The final answer must end with `WORKFLOW_ACCEPTANCE: PASS` or
218
- `WORKFLOW_ACCEPTANCE: FAIL`. A missing, ambiguous, malformed, or negative verdict
219
- fails the workflow even when the reviewer process exits normally. A PASS cannot
220
- clear failures in earlier work. Explicit cancellation or session interruption
221
- stops the graph without starting acceptance. The graph sends one final summary
222
- containing its acceptance result, or returns it in the tool call with `wait: true`.
223
- Waiting includes integration and acceptance, streams progress, and stops owned
224
- work on parent cancellation without a background wake-up. Main still owns
225
- remediation, the final gate, and release.
226
-
227
- Phase identity includes the built-in plan and its inputs. The same deliverable
228
- remains owned within its workspace; different questions or targets can run in
229
- the same session. Inspect retained results instead of repeating completed work.
119
+ Equal normalized tasks in the same cwd are rejected as duplicates while active
120
+ or settled in the current session. Reuse the result, or use `subagent_message`
121
+ for an additional bounded step.
230
122
 
231
123
  ## Status, cancellation, and recovery
232
124
 
233
125
  | Tool | Use |
234
126
  | --- | --- |
235
127
  | `subagent_status({ id: 12 })` | Inspect a run's progress, result, and recovery paths |
236
- | `subagent_status({ workflow: 3 })` | Inspect graph nodes and dependencies |
237
128
  | `subagent_message({ id: 12, message: "Check the caller too" })` | Steer a running child, or continue a completed run using its session when available and a summary otherwise |
238
129
  | `subagent_message({ id: 12, message: "Add the test", context: "summary" })` | Start a new next step with only a bounded summary of the earlier run |
239
130
  | `subagent_stop({ id: "12" })` | Stop a run and retire its retained session |
240
- | `subagent_stop({ workflow: 3 })` | Stop a graph and finalize its active nodes |
241
- | `subagent_stop({ all: true })` | Stop all active runs and graphs |
242
-
243
- The widget is a terminal task board capped at 10 lines: a quiet overview,
244
- workflow identity and work progress, then task rows with status/time at the
245
- right. Failures and blocked reasons get space before optional telemetry; narrow
246
- terminals keep task identity visible. Model, thinking, token usage, and worktree
247
- state appear as secondary detail. Each workflow has a separate **Acceptance
248
- required** row showing pending, running, PASS, or FAIL. Acceptance does not
249
- inflate the ordinary work count or hidden-task total. Completed work collapses
250
- into progress while acceptance is pending; a successfully accepted workflow
251
- hides automatically. Failed or blocked work stays until the next dispatch.
252
- Completion messages and status lookups retain the results. Overflow reports
253
- hidden tasks. Runs preparing their child process show `starting`. The refresh
254
- timer runs only while visible active work needs it. There is no process-count
255
- limit or shared-checkout startup lock: independent runs start together, including
256
- separate dispatch calls while another call awaits results.
131
+ | `subagent_stop({ all: true })` | Stop all active runs in this session |
132
+
133
+ The widget is a terminal task board capped at 10 lines: a quiet overview, then
134
+ task rows with status/time at the right. Failures get space before optional
135
+ telemetry; narrow terminals keep task identity visible. Model, thinking, token
136
+ usage, and worktree state appear as secondary detail. Failed work stays until
137
+ the next dispatch. Completion messages and status lookups retain the results.
138
+ Overflow reports hidden tasks. Runs preparing their child process show `starting`.
139
+ The refresh timer runs only while visible active work needs it. There is no
140
+ process-count limit or shared-checkout startup lock: independent runs start
141
+ together, including separate dispatch calls while another call awaits results.
257
142
 
258
143
  Usually omit `isolation`: implementation tasks use detached Git worktrees in
259
- single calls, parallel batches, and workflows. Reading and review use the current
260
- directory. Without a Git repository or committed `HEAD`, automatic isolation uses
261
- the caller's directory and reports why. Unexpected setup or integration failures
144
+ single calls and parallel batches. Reading and review use the current directory.
145
+ Without a Git repository or committed `HEAD`, automatic isolation uses the
146
+ caller's directory and reports why. Unexpected setup or integration failures
262
147
  remain failures; an explicit `isolation: "worktree"` requires isolation and never
263
148
  falls back. `isolation: "shared"` is an advanced override for tasks that need to
264
149
  write directly in the caller's checkout.
@@ -266,21 +151,18 @@ write directly in the caller's checkout.
266
151
  Each worktree starts from the caller's current tracked files and non-ignored
267
152
  untracked files, including uncommitted changes. Its initial snapshot is also the
268
153
  integration base, so dependent tasks see earlier results without reapplying them.
269
- The caller's index, branch, and `HEAD` stay unchanged. Declare exact write paths
270
- or symbols in `scope` to detect conflicts. Worktrees isolate Git changes, not
271
- tool permissions. Independent tasks start together; only the final application
272
- of worktree changes to the original checkout is serialized. Integration leaves
273
- your index untouched, and failures retain recovery artifacts.
154
+ The caller's index, branch, and `HEAD` stay unchanged. Worktrees isolate Git
155
+ changes, not tool permissions. Independent tasks start together; only the final
156
+ application of worktree changes to the original checkout is serialized.
157
+ Integration leaves your index untouched, and failures retain recovery artifacts.
274
158
 
275
159
  Cancelling the parent run with Escape stops unfinished work without waking the
276
160
  parent. A cancellation receipt is supplied on the next user turn with the stopped
277
- run and workflow ids, so main knows no additional `subagent_stop` is needed.
278
- Cancelled work must not restart automatically. A stopped run keeps its phase
279
- and declared writer leases until its child and Git finalization quiesce, even if
280
- the stop call reaches its wait deadline. Conversation-tree navigation also
281
- stops unfinished work. New/resume/fork/reload ends old children and retains interrupted work
282
- for manual recovery. Runs do not resume automatically; main finishes incomplete
283
- work from partial changes and artifacts.
161
+ run ids, so main knows no additional `subagent_stop` is needed. Cancelled work
162
+ must not restart automatically. Conversation-tree navigation also stops
163
+ unfinished work. New/resume/fork/reload ends old children and retains interrupted
164
+ work for manual recovery. Runs do not resume automatically; main finishes
165
+ incomplete work from partial changes and artifacts.
284
166
 
285
167
  A steering call waits for the child's existing RPC channel to acknowledge the
286
168
  matching request ID. The tool card shows **Received · queued** when Pi confirms
@@ -310,14 +192,13 @@ startup and the copied session header use the same physical directory, so macOS
310
192
  path aliases and Windows junctions do not trigger a cross-project fork prompt.
311
193
  The continuation is instructed to re-read files before editing in the current cwd.
312
194
 
313
- Every follow-up preserves the role, workspace and scope and passes through normal
195
+ Every follow-up preserves the role and workspace and passes through normal
314
196
  admission and isolation. Set `wait: true` to receive its final result in the same
315
197
  call; this waiting option applies to newly started follow-ups, while steering a
316
198
  running child returns its acknowledgement. `subagent_status` reports whether a
317
199
  completed run has a session available or only summary context. Results and summaries remain
318
200
  available within the current parent runtime; completed runs are not restored
319
- after reload. Pending runs cannot be steered, and fixed workflow graphs cannot
320
- be edited.
201
+ after reload. Pending runs cannot be steered.
321
202
 
322
203
  Children use Pi's native `--mode rpc` CLI with piped input/output, retries, and
323
204
  session persistence. On Windows, console hiding covers the Pi child and Node
@@ -339,13 +220,13 @@ overrides the agent directory.
339
220
 
340
221
  ## Pi codemode compatibility
341
222
 
342
- Call `subagent`, `subagent_workflow`, and the control tools directly. They use
343
- Pi's `model-only` exposure and are intentionally unavailable as nested
344
- `tools.subagent(...)` calls inside codemode. Children can still use codemode
345
- with their inherited callable tools. Indirect tools retain their exposure;
346
- scout promotes approved read-only tools for direct use. It waits up to ten
347
- seconds for startup registration and activates later arrivals between turns.
348
- Read-only classification uses Pi tool metadata.
223
+ Call `subagent` and the control tools directly. They use Pi's `model-only`
224
+ exposure and are intentionally unavailable as nested `tools.subagent(...)` calls
225
+ inside codemode. Children can still use codemode with their inherited callable
226
+ tools. Indirect tools retain their exposure; scout promotes approved read-only
227
+ tools for direct use. It waits up to ten seconds for startup registration and
228
+ activates later arrivals between turns. Read-only classification uses Pi tool
229
+ metadata.
349
230
 
350
231
  Child RPC dialogs that require confirmation, selection, or text input are
351
232
  cancelled with a matching response and an explanation, so an unattended child
@@ -382,13 +263,12 @@ automatically on settlement.
382
263
  ## Development
383
264
 
384
265
  Runtime code lives under `src/`; the package has no skill or workflow resource
385
- directories. Built-in prompts and plans change with the code and its tests.
266
+ directories. Built-in prompts change with the code and its tests.
386
267
 
387
268
  | Module | Responsibility |
388
269
  | --- | --- |
389
- | `delegation/` | Built-in roles, parent routing prompt, and phase/scope ownership |
390
- | `workflow/` | Built-in templates, parameter validation, scheduling, and mandatory acceptance |
391
- | `configuration/` | Model and thinking settings, plus the setup interface |
270
+ | `delegation/` | Built-in roles, parent routing prompt, and duplicate-dispatch admission |
271
+ | `configuration/` | Model and thinking settings, plus the standalone setup modal panel |
392
272
  | `presentation/` | Running task board, activity, status, and result formatting |
393
273
  | `execution/`, `lifecycle/`, `isolation/` | Child processes, durable state, cancellation, worktrees, and recovery |
394
274
 
package/index.ts CHANGED
@@ -7,7 +7,6 @@
7
7
  * - configuration/ — persisted settings, model routes, and setup UI
8
8
  * - execution/ — background tasks, native RPC transport, and model handoff
9
9
  * - lifecycle/ — durable threads, restoration, controls, and delivery
10
- * - workflow/ — built-in plans, dependency runner, and acceptance
11
10
  * - isolation/ — Git worktrees, recovery, and temporary-state hygiene
12
11
  * - presentation/ — announcements, formatting, monitor, and the active-run
13
12
  * widget
@@ -27,18 +26,15 @@ import { runSetup } from "./src/configuration/setup.ts";
27
26
  import { loadBuiltinAgents } from "./src/delegation/agents.ts";
28
27
  import { registerSubagentTool } from "./src/delegation/dispatch.ts";
29
28
  import { buildDelegationDirective, installDelegationSections } from "./src/delegation/prompt.ts";
30
- import { pendingWorkflowLeases, registerMainOwnershipGuard } from "./src/delegation/ownership.ts";
31
- import { currentSubagentDepth } from "./src/execution/spawn.ts";
29
+ import { currentSubagentDepth, getSubagentsRoot } from "./src/execution/spawn.ts";
32
30
  import { createDispatchCore } from "./src/lifecycle/dispatch-core.ts";
33
31
  import { registerCancellationHooks } from "./src/lifecycle/cancellation.ts";
34
32
  import { createRuntime } from "./src/lifecycle/runtime.ts";
35
33
  import { bootstrapDurableState } from "./src/lifecycle/thread-restore.ts";
36
34
  import { registerLookupTools } from "./src/lifecycle/tools.ts";
37
- import { registerWorkflowTool, restoreWorkflowState } from "./src/workflow/tool.ts";
38
35
  import { registerAnnouncements } from "./src/presentation/announcements.ts";
39
36
  import { clearActiveRunsWidget } from "./src/presentation/widget.ts";
40
37
  import { formatBytes, measureDurableUsage, runStorageCleanup } from "./src/isolation/cleanup.ts";
41
- import { getSubagentsRoot } from "./src/execution/spawn.ts";
42
38
 
43
39
  export default function (pi: ExtensionAPI): void {
44
40
  // Recursion guard: sub-agent children are leaf processes. The `subagent` tool is
@@ -71,15 +67,10 @@ export default function (pi: ExtensionAPI): void {
71
67
  await runtime.shutdown();
72
68
  });
73
69
 
74
- // One dispatcher serves both delegation tools, so a workflow node is an
75
- // ordinary managed run: same lifecycle ownership, admission, isolation, and
76
- // durable checkpointing.
77
70
  const dispatchCore = createDispatchCore(runtime);
78
71
  registerSubagentTool(pi, runtime, dispatchCore);
79
- registerWorkflowTool(pi, runtime, dispatchCore);
80
72
  registerLookupTools(pi, runtime, dispatchCore);
81
73
  registerCancellationHooks(pi, runtime);
82
- registerMainOwnershipGuard(pi, runtime);
83
74
 
84
75
  pi.registerCommand("subagents-setup", {
85
76
  description: "Configure pi-subagents: model and thinking per role",
@@ -111,7 +102,6 @@ export default function (pi: ExtensionAPI): void {
111
102
 
112
103
  pi.on("session_start", async (_event, ctx) => {
113
104
  await bootstrapDurableState(runtime, ctx.cwd);
114
- await restoreWorkflowState(runtime, ctx);
115
105
  });
116
106
  registerAnnouncements(pi, runtime);
117
107
 
@@ -120,7 +110,7 @@ export default function (pi: ExtensionAPI): void {
120
110
  pi.on("before_agent_start", async (event) => {
121
111
  await runtime.durableRestore;
122
112
  const agents = loadBuiltinAgents();
123
- const sources = [...runtime.threads.values(), ...pendingWorkflowLeases(runtime)];
113
+ const sources = [...runtime.threads.values()];
124
114
  const sections = event.systemPromptOptions?.sections;
125
115
  if (sections) {
126
116
  installDelegationSections(sections, agents, sources);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferris1225/pi-subagents",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "description": "A managed sub-agent team for pi: research, implementation, independent review, interactive follow-ups, and Git worktree isolation.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,15 +40,15 @@
40
40
  "prepack": "npm run check"
41
41
  },
42
42
  "peerDependencies": {
43
- "@earendil-works/pi-ai": ">=1.4.0",
44
- "@earendil-works/pi-coding-agent": ">=1.4.0",
45
- "@earendil-works/pi-tui": ">=1.4.0",
43
+ "@earendil-works/pi-ai": ">=1.5.0",
44
+ "@earendil-works/pi-coding-agent": ">=1.5.0",
45
+ "@earendil-works/pi-tui": ">=1.5.0",
46
46
  "typebox": "*"
47
47
  },
48
48
  "devDependencies": {
49
- "@earendil-works/pi-ai": "^1.4.0",
50
- "@earendil-works/pi-coding-agent": "^1.4.0",
51
- "@earendil-works/pi-tui": "^1.4.0",
49
+ "@earendil-works/pi-ai": "^1.5.0",
50
+ "@earendil-works/pi-coding-agent": "^1.5.0",
51
+ "@earendil-works/pi-tui": "^1.5.0",
52
52
  "@types/node": "^22.10.0",
53
53
  "typebox": "^1.3.27",
54
54
  "typescript": "^5.9.0"
@@ -17,7 +17,7 @@ import { getAgentDir, withFileMutationQueue } from "@earendil-works/pi-coding-ag
17
17
  import { migrateStoredRoleKeys } from "./role-migration.ts";
18
18
 
19
19
  /** Full catalog of agents shipped with the package; all of them always run. */
20
- export const BUILTIN_AGENT_NAMES = ["scout", "artisan", "sentinel", "skeptic"] as const;
20
+ export const BUILTIN_AGENT_NAMES = ["scout", "artisan", "sentinel"] as const;
21
21
 
22
22
  /** Thinking levels accepted by pi's `--thinking` option. */
23
23
  const THINKING_LEVEL_VALUES = ["off", "minimal", "low", "medium", "high", "xhigh", "max"] as const;
@@ -32,7 +32,6 @@ export function roleThinkingLevel(agentName: string): ThinkingLevel {
32
32
  return "low";
33
33
  case "artisan":
34
34
  case "sentinel":
35
- case "skeptic":
36
35
  return "high";
37
36
  default:
38
37
  return DEFAULT_THINKING_LEVEL;
@@ -53,10 +52,7 @@ export const AGENT_PROFILES: Record<(typeof BUILTIN_AGENT_NAMES)[number], AgentP
53
52
  remark: "Implement one substantial change with its tests and verification.",
54
53
  },
55
54
  sentinel: {
56
- remark: "Inspect an implementation or diff against requirements and callers for defects and regressions. No edits.",
57
- },
58
- skeptic: {
59
- remark: "Test a named claim, design assumption, or review finding with counterexamples and focused checks. No edits.",
55
+ remark: "Inspect an implementation or diff and challenge claims or assumptions for defects and regressions. No edits.",
60
56
  },
61
57
  };
62
58
 
@@ -2,8 +2,7 @@
2
2
  * current catalog names; these helpers are used only at storage boundaries. */
3
3
 
4
4
  export function migrateStoredAgentName(name: string): string {
5
- if (name === "reviewer") return "sentinel";
6
- if (name === "critic") return "skeptic";
5
+ if (name === "reviewer" || name === "critic" || name === "skeptic") return "sentinel";
7
6
  return name;
8
7
  }
9
8
 
@@ -30,21 +29,11 @@ function migrateField(value: unknown, key: string): boolean {
30
29
  return true;
31
30
  }
32
31
 
33
- /** Retained graph nodes keep their original briefs, ids, and dependencies. */
34
- function migrateStoredWorkflowRoles(value: unknown): boolean {
35
- const nodes = Array.isArray(value) ? value : value && typeof value === "object" ? (value as { nodes?: unknown }).nodes : undefined;
36
- if (!Array.isArray(nodes)) return false;
37
- let changed = false;
38
- for (const node of nodes) changed = migrateField(node, "agent") || changed;
39
- return changed;
40
- }
41
-
42
- /** Thread and workflow manifests retain their ids, leases, and recovery paths. */
32
+ /** Thread manifests retain their ids, leases, and recovery paths. */
43
33
  export function migrateStoredRecordRoles(value: unknown): boolean {
44
34
  if (!value || typeof value !== "object") return false;
45
35
  const summary = (value as { resultSummary?: unknown }).resultSummary;
46
36
  const threadChanged = migrateField(value, "agentName");
47
37
  const summaryChanged = migrateField(summary, "agent");
48
- const nodesChanged = migrateStoredWorkflowRoles(value);
49
- return threadChanged || summaryChanged || nodesChanged;
38
+ return threadChanged || summaryChanged;
50
39
  }
@@ -0,0 +1,10 @@
1
+ import { StringEnum } from "@earendil-works/pi-ai";
2
+ import { Type } from "typebox";
3
+
4
+ /** Preserve enum inference when Pi's JSON Schema helpers are nested in TypeBox. */
5
+ export function stringEnum<const T extends readonly string[]>(
6
+ values: T,
7
+ options?: { description?: string; default?: T[number] },
8
+ ) {
9
+ return Type.Unsafe<T[number]>(StringEnum(values, options));
10
+ }