@ferris1225/pi-subagents 4.3.31 → 4.3.33

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/LICENSE +1 -1
  3. package/README.md +215 -273
  4. package/index.ts +15 -14
  5. package/package.json +10 -10
  6. package/skills/workflow/SKILL.md +226 -0
  7. package/src/configuration/config.ts +17 -121
  8. package/src/configuration/models.ts +1 -1
  9. package/src/configuration/setup.ts +80 -176
  10. package/src/configuration/ui.ts +28 -66
  11. package/src/delegation/agents.ts +79 -209
  12. package/src/delegation/builtin-agents.ts +60 -0
  13. package/src/delegation/dispatch.ts +32 -149
  14. package/src/delegation/prompt.ts +7 -5
  15. package/src/execution/rpc-control.ts +6 -2
  16. package/src/execution/rpc-run.ts +60 -20
  17. package/src/execution/spawn.ts +17 -28
  18. package/src/isolation/git-command.ts +1 -2
  19. package/src/isolation/recovery.ts +1 -1
  20. package/src/isolation/temp-hygiene.ts +2 -2
  21. package/src/isolation/worktree.ts +31 -17
  22. package/src/lifecycle/completion.ts +1 -1
  23. package/src/lifecycle/dispatch-core.ts +142 -0
  24. package/src/lifecycle/durable.ts +3 -3
  25. package/src/lifecycle/runtime.ts +34 -1
  26. package/src/lifecycle/thread-lifecycle.ts +36 -25
  27. package/src/lifecycle/thread-shared.ts +11 -4
  28. package/src/lifecycle/tools.ts +84 -11
  29. package/src/presentation/monitor.ts +39 -17
  30. package/src/presentation/widget.ts +2 -2
  31. package/src/workflow/durable.ts +195 -0
  32. package/src/workflow/engine.ts +625 -0
  33. package/src/workflow/files.ts +217 -0
  34. package/src/workflow/plan.ts +340 -0
  35. package/src/workflow/state.ts +48 -0
  36. package/src/workflow/tool.ts +269 -0
  37. package/workflows/code-review.md +57 -0
  38. package/workflows/migration.md +52 -0
  39. package/workflows/research.md +47 -0
  40. package/agents/artisan.md +0 -18
  41. package/agents/scout.md +0 -19
package/CHANGELOG.md CHANGED
@@ -3,6 +3,86 @@
3
3
  Release notes for `@ferris1225/pi-subagents`. Only the most recent releases
4
4
  are kept here; every published version is preserved as a GitHub Release.
5
5
 
6
+ ## 4.3.33
7
+
8
+ - Add `subagent_workflow`: declare a graph of phases with `dependsOn` and the
9
+ runtime dispatches each node the moment its prerequisites settle and a process
10
+ slot frees, without a parent model turn between waves. The graph is validated
11
+ before the first child starts (unique ids, existing dependencies, no cycles,
12
+ resolvable `{{id}}` placeholders, no declared writer-scope overlap between
13
+ nodes no dependency orders), so an invalid plan costs zero child processes.
14
+ - Nodes are ordinary one-shot runs: same dispatcher, admission, isolation,
15
+ durable checkpointing, and usage accounting. A node's result registers only
16
+ after its worktree is integrated, so a dependent reads what its prerequisite
17
+ actually left behind.
18
+ - A node completion is quiet; the graph reports once. The summary names
19
+ completed, failed, and never-ran nodes with the reason, inlines each node's
20
+ answer (clipped, with a full-report artifact when anything was cut), and adds a
21
+ per-model tally. A failed node blocks only its dependents.
22
+ - Saved definitions: `.pi/workflows/<name>.json` or `.md` in a trusted project,
23
+ `~/.pi/agent/workflows/` for the user, and `code-review`, `research`, and
24
+ `migration` templates shipped with the package. Markdown definitions carry
25
+ prose plus one `json` fenced block.
26
+ - `subagent_status` accepts `workflow` and reports graph nodes, wait reasons, and
27
+ retained graphs; `subagent_stop` accepts `workflow` and stops a graph without
28
+ starting its idle dependents. An unfinished graph's shape is retained on disk
29
+ for the next session's notice instead of resuming automatically.
30
+ - Ship a `workflow` skill with the authoring guidance, and describe the graph
31
+ tool in the delegation contract.
32
+ ## 4.3.32
33
+
34
+ - Derive a role's tools from the live catalog instead of a hardcoded name list.
35
+ No role file names extension, MCP, or vendor tools any more: `scout` keeps
36
+ every active tool the host proves read-only (`annotations.readOnlyHint`, plus
37
+ pi's own `read`, `grep`, `find`, `ls`), so any retrieval extension or MCP
38
+ search server works for it without being named. The former `anysearch`,
39
+ `anchor_grep`, `web_search`, and `fetch_content` entries are gone.
40
+ - Keep a tool that reaches other tools out of a read-only role. `codemode` and
41
+ `tool_search` can reach a writer, so scout never receives them even when they
42
+ are annotated read-only; broad roles still inherit the session's live surface,
43
+ codemode included, and a code-mode parent therefore produces code-mode
44
+ children under the same `codemode.mode`.
45
+ - Reach read-only MCP tools without reconfiguring the server. A server left at
46
+ pi's default `codemode` exposure keeps its tools out of the model's
47
+ declarations, so scout previously got nothing from it. It now receives the
48
+ read-only ones directly — exactly those, since a named MCP tool also filters the
49
+ rest — so a script-only search server works for scout with no `mcp.json` edit,
50
+ and the child still cannot reach an MCP writer.
51
+ - Keep MCP tools out of a child that names none. pi keeps MCP tools unless a
52
+ `--tools` entry names one, so a resolved child list that names none now adds
53
+ `mcp__*` to the excluded tools; scout's read-only boundary can no longer leak
54
+ an MCP writer.
55
+ - Treat tools without a read-only annotation as write-capable for worktree and
56
+ repository-lane decisions, instead of trusting a built-in name list.
57
+ - Ship the two built-in role prompts as code and drop `agents/` from the
58
+ package. Custom role files are gone entirely: nothing is discovered from
59
+ `~/.pi/agent/agents/` or `.pi/agents/` any more, `scout` and `artisan` are
60
+ always enabled, and a role can no longer declare its own tool list or
61
+ isolation default.
62
+ - Reduce the config file to `agentModels` and `agentThinkingLevels`.
63
+ `enabledAgents`, `knownAgents`, `agentScope`, `maxConcurrentAgents`,
64
+ `idleTimeoutSec`, and `maxResultLines` are removed — capacity, idle timeout,
65
+ and result length are fixed constants — and obsolete keys in an older file
66
+ are dropped on load. `/subagents-setup` now lists the two fixed roles with
67
+ their current route and walks model then thinking for one or both.
68
+ - Show a code-mode script's first meaningful line in the activity trail instead
69
+ of a bare tool name, and drop the remaining vendor tool names from the
70
+ formatter.
71
+ - Default to delegating instead of requiring a proven benefit first. The
72
+ delegation directive and the `subagent` tool description now tell main to
73
+ dispatch independent or self-contained work — parallel phases usually beat a
74
+ serialized main — and keep only what needs conversation context or is too
75
+ small to brief.
76
+ - Development dependencies track Pi 1.4.0. The unused
77
+ `@earendil-works/pi-server` and `@earendil-works/pi-agent-core` peer and
78
+ development dependencies are removed, and the source no longer uses parameter
79
+ properties, so `npm test` runs without an experimental flag on Node 26 as well
80
+ as Node 22 and 24.
81
+ - Drop dead code and tighten the module surface: stale re-exports
82
+ (`matchRunIds`, `runInManagedRepositoryLane`, the `rpc-run` passthroughs) and
83
+ the never-read `WorktreeSetupError.retainedPaths` are gone, and internal
84
+ helpers and tuning constants are no longer exported. No behavior change.
85
+
6
86
  ## 4.3.31
7
87
 
8
88
  - Write the config on first start instead of prompting. A missing
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2025 ferris1225
4
- Portions of agents/cleaner.md adapted from reclaim-code-entropy:
4
+ Portions of the built-in role prompts adapted from reclaim-code-entropy:
5
5
  Copyright (c) 2026 Yevanchen
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy