pi-subagent-manager 1.11.0 → 1.13.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.
Files changed (169) hide show
  1. package/README.md +9 -9
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.js +1 -47
  4. package/dist/orch/checklist-integration.js +2 -30
  5. package/dist/orch/context-entries.js +0 -2
  6. package/dist/orch/cost-ledger.js +0 -5
  7. package/dist/orch/diagnostics.js +0 -9
  8. package/dist/orch/extensions.js +22 -21
  9. package/dist/orch/housekeeping-usage.js +0 -5
  10. package/dist/orch/housekeeping.js +1 -34
  11. package/dist/orch/inherited-tools.js +0 -14
  12. package/dist/orch/mailbox.js +0 -1
  13. package/dist/orch/manager.js +4 -44
  14. package/dist/orch/paths.js +0 -4
  15. package/dist/orch/prompt.js +1 -5
  16. package/dist/orch/registry.js +1 -20
  17. package/dist/orch/runtime.js +1 -48
  18. package/dist/orch/tools.js +0 -2
  19. package/dist/orch/transcript.js +0 -11
  20. package/dist/prefs/agent-import.js +2 -10
  21. package/dist/prefs/config.js +3 -51
  22. package/dist/prefs/import-discovery.js +0 -15
  23. package/dist/prefs/import-instructions.js +0 -2
  24. package/dist/prefs/models.js +0 -1
  25. package/dist/prefs/settings.js +22 -25
  26. package/dist/types.js +0 -1
  27. package/dist/ui/agent-loader.js +0 -10
  28. package/dist/ui/agent-navigation-editor.js +0 -21
  29. package/dist/ui/cost-footer.js +3 -9
  30. package/dist/ui/dialog.js +1 -29
  31. package/dist/ui/import-picker.js +0 -20
  32. package/dist/ui/live-agent-view.js +0 -19
  33. package/dist/ui/model-picker.js +0 -20
  34. package/dist/ui/settings-ui.js +8 -12
  35. package/dist/ui/status-ui.js +0 -17
  36. package/dist/ui/thread-tree.js +1 -12
  37. package/dist/ui/tool-picker.js +1 -4
  38. package/dist/ui/transcript-tool.js +0 -9
  39. package/dist/ui/ui.js +1 -29
  40. package/package.json +3 -3
  41. package/dist/index.d.ts.map +0 -1
  42. package/dist/index.js.map +0 -1
  43. package/dist/orch/checklist-integration.d.ts +0 -48
  44. package/dist/orch/checklist-integration.d.ts.map +0 -1
  45. package/dist/orch/checklist-integration.js.map +0 -1
  46. package/dist/orch/context-entries.d.ts +0 -8
  47. package/dist/orch/context-entries.d.ts.map +0 -1
  48. package/dist/orch/context-entries.js.map +0 -1
  49. package/dist/orch/cost-ledger.d.ts +0 -16
  50. package/dist/orch/cost-ledger.d.ts.map +0 -1
  51. package/dist/orch/cost-ledger.js.map +0 -1
  52. package/dist/orch/diagnostics.d.ts +0 -13
  53. package/dist/orch/diagnostics.d.ts.map +0 -1
  54. package/dist/orch/diagnostics.js.map +0 -1
  55. package/dist/orch/extensions.d.ts +0 -15
  56. package/dist/orch/extensions.d.ts.map +0 -1
  57. package/dist/orch/extensions.js.map +0 -1
  58. package/dist/orch/housekeeping-usage.d.ts +0 -14
  59. package/dist/orch/housekeeping-usage.d.ts.map +0 -1
  60. package/dist/orch/housekeeping-usage.js.map +0 -1
  61. package/dist/orch/housekeeping.d.ts +0 -89
  62. package/dist/orch/housekeeping.d.ts.map +0 -1
  63. package/dist/orch/housekeeping.js.map +0 -1
  64. package/dist/orch/inherited-tools.d.ts +0 -18
  65. package/dist/orch/inherited-tools.d.ts.map +0 -1
  66. package/dist/orch/inherited-tools.js.map +0 -1
  67. package/dist/orch/mailbox.d.ts +0 -59
  68. package/dist/orch/mailbox.d.ts.map +0 -1
  69. package/dist/orch/mailbox.js.map +0 -1
  70. package/dist/orch/manager.d.ts +0 -82
  71. package/dist/orch/manager.d.ts.map +0 -1
  72. package/dist/orch/manager.js.map +0 -1
  73. package/dist/orch/paths.d.ts +0 -7
  74. package/dist/orch/paths.d.ts.map +0 -1
  75. package/dist/orch/paths.js.map +0 -1
  76. package/dist/orch/prompt.d.ts +0 -7
  77. package/dist/orch/prompt.d.ts.map +0 -1
  78. package/dist/orch/prompt.js.map +0 -1
  79. package/dist/orch/registry.d.ts +0 -49
  80. package/dist/orch/registry.d.ts.map +0 -1
  81. package/dist/orch/registry.js.map +0 -1
  82. package/dist/orch/runtime.d.ts +0 -11
  83. package/dist/orch/runtime.d.ts.map +0 -1
  84. package/dist/orch/runtime.js.map +0 -1
  85. package/dist/orch/tools.d.ts +0 -6
  86. package/dist/orch/tools.d.ts.map +0 -1
  87. package/dist/orch/tools.js.map +0 -1
  88. package/dist/orch/transcript.d.ts +0 -28
  89. package/dist/orch/transcript.d.ts.map +0 -1
  90. package/dist/orch/transcript.js.map +0 -1
  91. package/dist/prefs/agent-import.d.ts +0 -37
  92. package/dist/prefs/agent-import.d.ts.map +0 -1
  93. package/dist/prefs/agent-import.js.map +0 -1
  94. package/dist/prefs/config.d.ts +0 -108
  95. package/dist/prefs/config.d.ts.map +0 -1
  96. package/dist/prefs/config.js.map +0 -1
  97. package/dist/prefs/import-discovery.d.ts +0 -28
  98. package/dist/prefs/import-discovery.d.ts.map +0 -1
  99. package/dist/prefs/import-discovery.js.map +0 -1
  100. package/dist/prefs/import-instructions.d.ts +0 -3
  101. package/dist/prefs/import-instructions.d.ts.map +0 -1
  102. package/dist/prefs/import-instructions.js.map +0 -1
  103. package/dist/prefs/models.d.ts +0 -24
  104. package/dist/prefs/models.d.ts.map +0 -1
  105. package/dist/prefs/models.js.map +0 -1
  106. package/dist/prefs/settings.d.ts +0 -89
  107. package/dist/prefs/settings.d.ts.map +0 -1
  108. package/dist/prefs/settings.js.map +0 -1
  109. package/dist/types.d.ts +0 -293
  110. package/dist/types.d.ts.map +0 -1
  111. package/dist/types.js.map +0 -1
  112. package/dist/ui/agent-loader.d.ts +0 -21
  113. package/dist/ui/agent-loader.d.ts.map +0 -1
  114. package/dist/ui/agent-loader.js.map +0 -1
  115. package/dist/ui/agent-navigation-editor.d.ts +0 -46
  116. package/dist/ui/agent-navigation-editor.d.ts.map +0 -1
  117. package/dist/ui/agent-navigation-editor.js.map +0 -1
  118. package/dist/ui/cost-footer.d.ts +0 -37
  119. package/dist/ui/cost-footer.d.ts.map +0 -1
  120. package/dist/ui/cost-footer.js.map +0 -1
  121. package/dist/ui/dialog.d.ts +0 -135
  122. package/dist/ui/dialog.d.ts.map +0 -1
  123. package/dist/ui/dialog.js.map +0 -1
  124. package/dist/ui/import-picker.d.ts +0 -38
  125. package/dist/ui/import-picker.d.ts.map +0 -1
  126. package/dist/ui/import-picker.js.map +0 -1
  127. package/dist/ui/live-agent-view.d.ts +0 -82
  128. package/dist/ui/live-agent-view.d.ts.map +0 -1
  129. package/dist/ui/live-agent-view.js.map +0 -1
  130. package/dist/ui/model-picker.d.ts +0 -109
  131. package/dist/ui/model-picker.d.ts.map +0 -1
  132. package/dist/ui/model-picker.js.map +0 -1
  133. package/dist/ui/settings-ui.d.ts +0 -17
  134. package/dist/ui/settings-ui.d.ts.map +0 -1
  135. package/dist/ui/settings-ui.js.map +0 -1
  136. package/dist/ui/status-ui.d.ts +0 -67
  137. package/dist/ui/status-ui.d.ts.map +0 -1
  138. package/dist/ui/status-ui.js.map +0 -1
  139. package/dist/ui/thread-tree.d.ts +0 -22
  140. package/dist/ui/thread-tree.d.ts.map +0 -1
  141. package/dist/ui/thread-tree.js.map +0 -1
  142. package/dist/ui/tool-picker.d.ts +0 -46
  143. package/dist/ui/tool-picker.d.ts.map +0 -1
  144. package/dist/ui/tool-picker.js.map +0 -1
  145. package/dist/ui/transcript-tool.d.ts +0 -2
  146. package/dist/ui/transcript-tool.d.ts.map +0 -1
  147. package/dist/ui/transcript-tool.js.map +0 -1
  148. package/dist/ui/ui.d.ts +0 -41
  149. package/dist/ui/ui.d.ts.map +0 -1
  150. package/dist/ui/ui.js.map +0 -1
  151. package/docs/assets/subagent-manager-demo.gif +0 -0
  152. package/docs/async-lifecycle.md +0 -153
  153. package/docs/custom-agents.md +0 -154
  154. package/docs/default-agents.md +0 -95
  155. package/docs/demo.md +0 -63
  156. package/docs/development.md +0 -75
  157. package/docs/importing-agents.md +0 -41
  158. package/docs/pi-footer.md +0 -128
  159. package/docs/research-claude.md +0 -258
  160. package/docs/research-codex.md +0 -143
  161. package/docs/research-default-agent-models.md +0 -121
  162. package/docs/research-model-audit-2026-10.md +0 -154
  163. package/docs/research-model-roles-coding.md +0 -99
  164. package/docs/research-model-roles-writing.md +0 -78
  165. package/docs/research-researcher-workflow.md +0 -97
  166. package/docs/settings.md +0 -293
  167. package/docs/subagent-extension-limitations.md +0 -98
  168. package/docs/threads.md +0 -73
  169. package/docs/tools-and-ui.md +0 -129
@@ -1,154 +0,0 @@
1
- # Write your own agent
2
-
3
- A full agent type is a Markdown file: YAML frontmatter on top, system prompt below.
4
- A settings-only customization is a sparse YAML overlay.
5
-
6
- ## 1. Pick a location
7
-
8
- | Scope | Directory |
9
- | ------- | ------------------------------------------------------------------------------------------- |
10
- | User | `<pi-agent-dir>/subagent-manager/agents/` (normally `~/.pi/agent/subagent-manager/agents/`) |
11
- | Project | `<cwd>/.pi/agent/subagent-manager/agents/` — loaded only when pi trusts the project |
12
-
13
- Precedence: **project > user > bundled**. Markdown definitions replace lower-layer
14
- definitions; YAML overlays inherit any fields they do not specify.
15
-
16
- ## Tweak settings or fork the agent?
17
-
18
- Two ways to customize a bundled agent. Pick one per agent — a scope (user or
19
- project) cannot hold both a `.md` and a `.yml` for the same name.
20
-
21
- | | Tweak settings (`<name>.yml`) | Fork agent (`<name>.md`) |
22
- |---|---|---|
23
- | What it is | Settings-only override merged on top of the bundled definition | Full copy that replaces the bundled definition |
24
- | System prompt | Stays bundled; you keep receiving prompt updates | Copied; you own it, bundled prompt updates no longer apply |
25
- | Editable | Settings (models, tools, thinking, color, icon, description) | Everything, including name and system prompt |
26
- | File | Plain YAML mapping, no frontmatter, no Markdown body | YAML frontmatter on top, system prompt below |
27
-
28
- `~/.pi/agent/subagent-manager/agents/coder.yml`:
29
-
30
- ```yaml
31
- thinkingLevel: low
32
- tools:
33
- allow:
34
- - read
35
- - grep
36
- - agent_update
37
- - agent_pause
38
- ```
39
-
40
- Only listed fields override; everything else follows the lower-layer definition,
41
- so untouched models, settings, descriptions, and prompts keep tracking extension
42
- updates. `tools.allow` and `tools.block` merge independently: changing one does
43
- not pin the other. Lists replace the corresponding list, rather than appending.
44
- An empty tool list (`[]`) is an explicit empty list.
45
-
46
- Omit a field to inherit it. Set an optional field to `null` to **remove** it from
47
- the effective definition, not to restore the bundled value: `models: null` uses
48
- the parent/default model; `icon: null` hides the icon; `tools.allow: null` removes
49
- the allow list while keeping the inherited block list; `tools: null` removes the
50
- whole policy. To restore inheritance, delete that setting from the YAML file.
51
- `name` is optional and, when present, must match the filename. `.yml` and `.yaml`
52
- are both supported. An override needs a matching lower-layer agent — an orphan
53
- YAML file is rejected. Prompt fields/bodies are not allowed in YAML overlays.
54
-
55
- In `/agents types`, editing a bundled agent asks you to pick one mode first,
56
- and settings stay locked until you choose. **Tweak settings** starts with an
57
- empty overlay (`{}` when saved unchanged), not a copy of the definition. Saving
58
- writes only changed settings and retains existing explicit overrides, even if
59
- an override currently matches a default. Saving to another scope writes the
60
- edits into that scope without copying unchanged values from the displayed
61
- scope. Project overlays inherit user customizations; user overlays inherit
62
- bundled definitions. Overrides cannot rename the agent or edit the system
63
- prompt — fork it instead. Full Markdown forks remain full copies.
64
-
65
- To undo a fork or override, choose **Reset to bundled** (after Save) in the editor.
66
- It deletes the customization file after confirmation and the lower-layer agent
67
- applies again (the user customization, if any, or the shipped definition).
68
-
69
- These are the only locations read. Other packages' `~/.pi/agent/agents` or `.pi/agents` are ignored — use [`/agents import`](importing-agents.md) for those.
70
-
71
- ## 2. Write the file
72
-
73
- `~/.pi/agent/subagent-manager/agents/api-scout.md`:
74
-
75
- ```markdown
76
- ---
77
- name: api-scout
78
- description: Investigate APIs and find evidence before implementation
79
- thinkingLevel: high
80
- icon: "\uf002"
81
- models:
82
- - anthropic/claude-sonnet-4-6
83
- - openai/gpt-5
84
- tools:
85
- allow: [read, grep, find, ls, agent_update, agent_pause]
86
- ---
87
-
88
- You are an API scout. Read the relevant source and docs,
89
- report concrete findings with file paths, and do not modify files.
90
- ```
91
-
92
- ## 3. Load it
93
-
94
- Run `/agents reload`. Diagnostics show any errors. Or just start a new turn — definitions reload after model turns.
95
-
96
- Ask the main model to use it: _"spawn an api-scout at `stripe-webhooks` to check how retries work"_.
97
-
98
- ## Fields
99
-
100
- | Field | Required | What it does |
101
- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102
- | `name` | yes | Type name used in `agent_spawn` |
103
- | `description` | yes | Shown to the parent model so it knows when to pick this type |
104
- | `models` | no | Ordered `provider/model-id` preferences. How they're used depends on [Model Picking](settings.md#model-picking-modelselection). Omit to inherit the parent's model. |
105
- | `thinkingLevel` | no | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Clamped to what the model supports. |
106
- | `tools` | no | `allow` / `block` lists of exact tool names. Applied per [Tool Filtering](settings.md#tool-filtering-toolfiltering). |
107
- | `color` | no | pi semantic color (`accent`, `success`, `warning`, `error`, `muted`, `dim`) for the type pill and path. Default `accent`. |
108
- | `icon` | no | Single literal Nerd Font glyph. Displayed only with **[labs] Nerd Font icons** enabled; omit for text-only labels. |
109
- | `modelSuggestions` | no | Plain model names (e.g. `sonnet-5.5`) that rank the model picker's search. **Never** select a model at runtime. |
110
- | `model` | no | Deprecated single-model alias. Still parsed; saved back as `models`. |
111
-
112
- The Markdown body is the system prompt.
113
-
114
- ## Icons [labs]
115
-
116
- The optional `icon` field works for any custom or bundled agent type. Choose a glyph from the [Nerd Fonts cheat sheet](https://www.nerdfonts.com/cheat-sheet) and copy the actual character into quoted YAML, for example:
117
-
118
- ```yaml
119
- icon: "\uf002" # nf-fa-search, U+F002
120
- ```
121
-
122
- Use one Unicode private-use character, not an icon name (`nf-fa-search`), codepoint text (`U+F002`), emoji, or multiple glyphs. Both BMP and supplementary Nerd Font glyphs are supported. Omit the field to remove an icon; empty `icon:` values are invalid.
123
-
124
- In `/agents types`, select **[labs] Icon** and paste the glyph, then save the agent. Leave the editor blank to remove it. You can configure icons while the feature is off; enable **[labs] Nerd Font icons** in `/agents` settings to see them. A Nerd Font must also be selected in your terminal. Icons supplement names, never replace them.
125
-
126
- ## Tips
127
-
128
- - **Tools default to none.** With default filtering, an empty or missing `allow` list means the agent gets no tools. List what it needs.
129
- - **To delegate**, a type needs `agent_spawn` and `agent_wait` in `allow`.
130
- - **Include `agent_update` / `agent_pause`** so the agent can report progress or hand back early.
131
- - **Model matching is exact.** If no preference is available (or scoped, in scoped mode), spawn fails — no silent fallback.
132
- - **Unknown tool names fail** rather than widening access.
133
- - **Edits affect new threads only.** Running and retained threads keep the definition they started with.
134
-
135
- ## Editing in the TUI
136
-
137
- `/agents types` opens a browser and two-column editor.
138
-
139
- | Key | Action |
140
- | -------- | ---------------------------------------------- |
141
- | ↑↓ / Tab | Select field |
142
- | Enter | Edit field |
143
- | Ctrl+S | Save (or apply a multiline field to the draft) |
144
- | Esc | Discard draft |
145
-
146
- The model picker lists selected models first, in fallback order. **Enter** toggles a model; **w/s** moves a selected model up/down in browse mode. **/** or **Tab** enters search, where typing (including w/s) filters; **Tab** returns to browsing while keeping the filter. Other typed letters also start search. Unselected models are ranked by fuzzy match against `modelSuggestions`, scoped models first.
147
-
148
- **External editor** opens the whole Markdown definition in `$VISUAL`, `$EDITOR`,
149
- or `vi` in fork mode. For an overlay, edit its YAML file directly and reload.
150
-
151
- ## Errors
152
-
153
- - Malformed files and duplicate names in the same scope show diagnostics and disable only the affected type.
154
- - An unavailable tool or model fails the spawn with a clear message.
@@ -1,95 +0,0 @@
1
- # Bundled task-specialized agents
2
-
3
- Six packaged roles are Markdown definitions in `agents/`. User/project definitions can override any role. Retained threads keep their saved definitions until replaced through the normal configuration flow.
4
-
5
- The original model shortlist was audited **October 4, 2026 local time (October 3 UTC)**. The suggestions below include subsequent user-selected updates checked against the Pi and OpenRouter model catalogs. Read the [source-backed model audit](research-model-audit-2026-10.md) for historical measurements and qualifications, and [researcher workflow research](research-researcher-workflow.md) for retrieval guidance. The older [five-role shortlist](research-default-agent-models.md) is historical.
6
-
7
- ## Role routing
8
-
9
- | Role | Work and boundaries | Thinking |
10
- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
11
- | `architect` | Design, ambiguity, tradeoffs, verifiable plans, and explicitly authorized coordination. Not an implementation mandate or an unlimited research job. | `high` |
12
- | `coder` | Complex or sustained implementation, refactoring, debugging, and frontend UI through a checked patch. | `high` |
13
- | `researcher` | Source-backed local/remote codebase, library/API, and internet research; verification and synthesis. No implementation edits or delegation. | `medium` |
14
- | `reviewer` | Scoped, non-mutating correctness/security review with demonstrable defects and minimal local repair suggestions. No implementation or comment quota. | `high` |
15
- | `tasker` | Bounded coding, scripts, SQL/database queries, git housekeeping, diagnostics, and lookups. Escalate complex or sustained implementation. | `low` |
16
- | `writer` | Original or revised prose for a stated audience and voice, using supplied/local evidence. No invented facts or live evidence gathering. | `medium` |
17
-
18
- Use tasker for one symbol or a few facts already in the repository; use researcher for tracing behavior across a codebase, versioned API evidence, outside sources, or contradictory claims. Researcher gathers what is true; architect decides what to build. Writer turns verified material into prose.
19
-
20
- Existing user/project `researcher` overrides still win over the new packaged default. Bundled `worker`, `explorer`, and `designer` remain absent: bounded work routes to tasker, complex or sustained implementation to coder, and source investigation to researcher. Nothing is automatically renamed.
21
-
22
- ## Nerd Font icons
23
-
24
- The optional **[labs] Nerd Font icons** [setting](settings.md#labs-nerd-font-icons-nerdfonticons) is off by default and requires a Nerd Font in your terminal. Each default has a distinct literal `icon` in its frontmatter:
25
-
26
- | Role | Nerd Fonts identifier | Codepoint | Why this icon |
27
- | ------------ | --------------------- | --------- | --------------------------------------------- |
28
- | `architect` | `nf-md-floor_plan` | `U+F0821` | Structure, layout, and architecture planning. |
29
- | `coder` | `nf-fa-code` | `U+F121` | Implementation and source code. |
30
- | `researcher` | `nf-fa-search` | `U+F002` | Evidence gathering and investigation. |
31
- | `reviewer` | `nf-cod-inspect` | `U+EBD1` | Inspecting code for concrete defects. |
32
- | `tasker` | `nf-oct-checklist` | `U+F45E` | Bounded tasks and checklist-style execution. |
33
- | `writer` | `nf-fa-pencil` | `U+F040` | Writing and editorial work. |
34
-
35
- Names and codepoints were checked against the [official Nerd Fonts glyph mapping](https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json); the [cheat sheet](https://www.nerdfonts.com/cheat-sheet) offers previews and character copying. These are role-based design choices, not font-detected fallbacks. User/project overrides may choose another icon or omit it entirely. See [custom icons](custom-agents.md#icons-labs).
36
-
37
- ## Model suggestions are plain names, not pins
38
-
39
- Suggestions are chosen by task capability, quality, cost, and speed. API formats, SDK adapter compatibility, provider access, and deployment convenience are not selection criteria; Pi's `pi-ai` SDK abstracts model API differences. Availability/release facts are source metadata, not a reason to downrank a capable model.
40
-
41
- Every `modelSuggestions` entry is a single plain model-name string suitable for fuzzy search—no parentheticals, tier labels, benchmark scores, or provider paths. Those belong in this guide and the audit. Suggestions are advisory: they **do not select a runtime model**. Defaults inherit the parent/default model until configured. Actual runtime preferences belong in `models` as eligible `provider/model-id` identities and are subject to scoped-model filtering.
42
-
43
- | Role | Suggested names, in order | Rationale |
44
- | ---------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
45
- | architect | `gemini-4-neon`, `claude-opus-5.5`, `claude-fable-5.2`, `gpt-6.2-astra` | User-selected shortlist for ambiguous architecture, difficult constraints, and consequential plans. |
46
- | coder | `gemini-4-hydrogen`, `gpt-6.2-sol`, `claude-sonnet-5.5` | User-selected implementation shortlist, with high thinking by default. |
47
- | researcher | `claude-sonnet-5.5`, `gpt-6.1-terra`, `gemini-4-hydrogen` | User-selected research shortlist, with medium thinking by default. |
48
- | reviewer | `gpt-6.1-sol`, `sonnet-5.5`, `opus-5.5`, `glm-5.3`, `gemini-4-argon` | Reasoning and code evidence, without treating premium Astra as necessary for every review. |
49
- | tasker | `gpt-6-luna`, `haiku-5.5`, `deepseek-v4.1-flash-1017` | User-selected bounded-task shortlist, with low thinking by default. |
50
- | writer | `gemini-4-carbon`, `claude-opus-5.5` | User-selected shortlist for drafting and revision, with medium thinking by default. |
51
-
52
- These are choices, not an automatic fallback/escalation chain or a universal quality ranking. The architect, coder, researcher, and writer names use the model-ID suffixes from [OpenRouter](https://openrouter.ai/api/v1/models), cross-checked against the [Pi catalog](https://pi.dev/models) and local `pi --list-models`. Fuzzy matching can surface the same model across providers and normalize version separators (for example, `claude-fable-5.2` and `claude-fable-5-2`). The picker saves the concrete provider/model ID only when selected and confirmed. The historical audit is not a new benchmark evaluation of these updates. Deep-research product results are not automatically results for their underlying base models.
53
-
54
- The November 4, 2026 additions were checked against provider sources and the current catalog:
55
-
56
- - Tasker uses `deepseek-v4.1-flash-1017`, the latest V4.1 Flash weight revision. [DeepSeek](https://api-docs.deepseek.com/) serves it through `deepseek-flash`; Pi and OpenRouter also list the explicit `deepseek/deepseek-v4.1-flash-1017` identifier.
57
- - Reviewer adds `gemini-4-argon` (`google/gemini-4-argon` in the [OpenRouter catalog](https://openrouter.ai/api/v1/models)).
58
-
59
- ### Quality, price, and speed are different axes
60
-
61
- - Prefer independent task measurements alongside official releases/pricing. Arena is preference evidence, not proof of code correctness, security review, factuality, or citation fidelity. Vendor and independent benchmarks with different harnesses or thinking settings are not directly comparable.
62
- - Tasker starts with low effort and cheap models; do not spend premium reasoning tokens on a mechanical edit. A fast token rate alone does not measure wall-clock completion: include first-token latency, reasoning, tool round trips, retries, and verification.
63
- - Architect/reviewer use high effort by default. Researcher defaults to medium for source tracing and synthesis; configure high for difficult investigations or use tasker for a narrow retrieval-only job. Low-priced models are economical only if they finish reliably.
64
- - Gemini 3.8 Flash's introductory rates are time-limited; DeepSeek Flash's off-peak rates are not its general price. Distinguish cached input, batch discounts, and reasoning-output tokens. Research adds retrieval/API charges to model spend.
65
- - Researcher prioritizes low hallucination alongside factual accuracy and research/tool capability. Historical AA-Omniscience rates and their effort settings are recorded in the audit; they do not establish equivalent performance for the current shortlist at medium effort.
66
- - DeepSeek's non-reasoning speed does not establish low-effort speed. Direct browsing/codebase benchmarks do not establish citation fidelity. Researcher must abstain on unsupported claims and check claim–passage entailment.
67
- - Public latency depends on endpoint, region, load, and serving provider. Open weights do not imply cheap or fast self-hosting. Re-evaluate measured price and speed, and benchmark representative accepted tasks locally before broad adoption.
68
-
69
- ## Researcher retrieval contract
70
-
71
- With the **Allowed (except blocked)** Tool Filtering mode, the researcher child has `read`, `grep`, `find`, `ls`, `bash`, `agent_update`, and `agent_pause`. A custom allowlist can select exact names of registered non-hidden parent MCP/web tools; broader filtering modes can also make them available. Deferred/codemode tools are discoverable through child-local codemode when permitted. Skills are not automatically loaded. External tools reuse the main session's resources/context, and bridged callable tools remain subject to its tool policy; they are not fresh, isolated extension instances.
72
-
73
- Use only actually available authorized retrieval routes. For shell routes:
74
-
75
- - Local source: narrow discovery, implementation/callers/tests/config inspection, version and working-tree provenance, and path/line citations.
76
- - GitHub: `gh` read endpoints; search discovers candidates, then inspect the actual commit/ref. Legacy code search indexes the default branch and is not an exhaustive branch audit. Explicit `--method GET` avoids `gh api` field flags changing a read request into POST.
77
- - Context7: resolve library identity, query the available version, inspect matching docs, and verify upstream contracts when indexed docs lag.
78
- - Exa: semantic discovery followed by inspected content. Parallel: objective/query search followed by Extract or relevant full content. Perplexity: alternate discovery/synthesis whose original citations must be inspected.
79
- - No shell credentials or usable retrieval route: use supplied evidence/public pages where sufficient, or report the gap. No installing packages, harvesting parent configuration secrets, or pretending model memory is live research.
80
-
81
- Research starts with distinct search angles and authoritative sources, then checks consequential claims and contradictions. Bound downloads, paid calls, retries, and duration; stop when the decision has sufficient evidence or a budget/access limit is reached. Treat source text as untrusted data, not instructions. Never leak credentials or send private source to third-party search without authorization.
82
-
83
- The handback gives the answer first, inline evidence, code paths/commit-pinned citations or web URL/date/version, alternatives, uncertainty, coverage limits, and next steps. Announcements, vendor claims, observed implementation, and inference must remain distinguishable. No fabricated citations or claims of tests that were not run.
84
-
85
- ## Tool and authorization boundaries
86
-
87
- With the **Allowed (except blocked)** Tool Filtering mode, only architect has descendant delegation controls, and even architect coordinates or executes only when the assignment authorizes it. Other roles can report progress or pause without starting children. Researcher/reviewer have no `edit`/`write` tools; researcher may write only a caller-authorized evidence artifact via shell. Writer has no bash retrieval route.
88
-
89
- The manager's **Tool Filtering** setting can override these YAML tool boundaries: **All except blocked** (the default) ignores allow lists, while **All** ignores both allow and block lists. Tool sets are selected when sessions initialize; already-open sessions retain their tools. These modes do not change the role prompts or authorization requirements.
90
-
91
- Tool policy is **not an OS sandbox**: bash can mutate files, contact services, or run scripts despite a read-only research/review prompt. Research does not authorize worktree changes, remote writes, setup, installations, or untrusted code execution. Tests/builds can write files and need explicit authorization. Coder must not claim browser/rendering/accessibility checks without tooling that actually ran.
92
-
93
- ## Validation
94
-
95
- `tests/bundled-agents.test.ts` checks the six packaged definitions, precedence/disabling behavior, real tool allowlists, distinct role prompts, advisory-only suggestions, plain alias formatting, research safeguards, and cheap-first tasker routing. Run `npm run check` and `npm test` after changing defaults (this package has no build script).
package/docs/demo.md DELETED
@@ -1,63 +0,0 @@
1
- # README demo
2
-
3
- [Watch the GIF](assets/subagent-manager-demo.gif).
4
-
5
- ## What it shows
6
-
7
- An actual interactive Pi session: six parallel agent roles, two nested taskers,
8
- the live Agents widget, the fullscreen tree, watching a thread, steering a completed
9
- writer back into action, passing API checks, and the final recap. A preparatory
10
- reader makes nine agents in total.
11
-
12
- The fictional **Orbit** project lived in a private temporary demo folder, outside
13
- this repository. Its documents and Python checks were synthetic and local; the
14
- agents still used live model providers. The deliberately slow checks left time to
15
- browse live activity. No production code or data was used.
16
-
17
- ## Recording
18
-
19
- - Pi **1.3.0**, pi-subagent-manager **0.29.3**.
20
- - Started **plain `pi`**, with the user's existing configuration and all configured
21
- extensions. No `-ne`, replacement agent directory, or stripped-down configuration.
22
- - The colorful footer and checklist come from the author's configured extensions;
23
- they are not installed by pi-subagent-manager.
24
- - **Maple Mono NF**, 17 px, 112 × 34 terminal cells. Reused this installed Nerd Font
25
- rather than installing JetBrains Mono. Chromium confirmed MapleMono-NF-Regular
26
- for every footer icon; the rendered footer and role glyphs were visually checked.
27
- - Used the [ttyd-testing skill](../.agents/skills/ttyd-testing/SKILL.md): a real PTY
28
- in localhost-only authenticated ttyd, rendered by isolated headless Chrome 154
29
- through Playwright. Reused system Chrome; capture-only Playwright lived in a
30
- private temporary directory. No project dependencies or Pi settings changed.
31
- - Sampled actual screenshots at approximately 4 fps. Idle intervals were cut, a
32
- short tree section runs at 2×, and selected frames are held for readability.
33
- No UI content was synthesized, redrawn, or overlaid.
34
- - Encoded with FFmpeg's `palettegen` / `paletteuse` filters, no dithering, variable
35
- frame timing, and infinite looping: **1150 × 759 px**, **37.28 seconds**,
36
- **1,332,767 bytes** (about 1.27 MiB).
37
- - Decoded the finished GIF and inspected representative frames for text, borders,
38
- glyphs, footer, and transitions. Stopped the recording, Pi, ttyd, and browser.
39
- Private session logs, control credentials, and raw captures are not committed.
40
-
41
- To record another session, read the skill first, run its `doctor` with an installed
42
- Nerd Font, and start a fresh session in a disposable folder:
43
-
44
- ```sh
45
- SKILL="$PWD/.agents/skills/ttyd-testing"
46
- WORK="$(mktemp -d)"
47
- node "$SKILL/scripts/terminal.mjs" doctor --font 'Maple Mono NF'
48
- node "$SKILL/scripts/terminal.mjs" start \
49
- --session readme-demo --cwd "$WORK" --cols 112 --rows 34 \
50
- --font 'Maple Mono NF' --font-size 17 -- pi
51
- ```
52
-
53
- Populate the disposable folder with a small fictional project and task brief before
54
- submitting a prompt. This recording asked Pi to fan out six named roles and have the
55
- architect delegate two more, staying offline and inside the demo folder. Open the
56
- tree with **←**, select a thread and press **Enter**, send a message in **Steer**,
57
- and use **Ctrl+Q** to return to the main editor. Capture named screenshots after
58
- meaningful actions and inspect them. For continuous sampling, avoid a long `wait`
59
- action on the same session: the harness serializes controls, so it blocks captures.
60
- Always finish with `terminal.mjs stop --session readme-demo`.
61
-
62
- The GIF is an edited demonstration, not a timing benchmark or a guarantee that
63
- other fonts, themes, terminal sizes, or agent models render identically.
@@ -1,75 +0,0 @@
1
- # Development
2
-
3
- ```sh
4
- npm ci
5
- npm run check # typecheck
6
- npm run build # compile src/ -> dist/ (.js + .d.ts)
7
- npm test
8
- npm run format:check
9
- ```
10
-
11
- Tests run offline with no model credentials. Scripted-provider SDK tests cover nested parallel launches, level limits, pause, persistence and recovery. Generated JSONL scenarios cover multilevel trees, unopened parents, interrupted work, durable mailboxes, root forks and same-file tree navigation.
12
-
13
- ## Code layout
14
-
15
- | Path | Responsibility |
16
- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
17
- | `src/index.ts` | Parent-session lifecycle and extension wiring |
18
- | `src/orch/manager.ts` | Ownership, lifecycle, retained registry. `scope(caller)` gives tools and UI the same caller-bound `ThreadService`. |
19
- | `src/orch/registry.ts` | Registry persistence: a full entry per attach, then deltas of changed fields |
20
- | `src/orch/runtime.ts` | Isolated pi SDK sessions, providers, safe turn boundaries |
21
- | `src/orch/paths.ts` | Canonical ancestry and context snapshots |
22
- | `src/orch/mailbox.ts` | Input persistence, replay, transcript reconciliation |
23
- | `src/orch/tools.ts` | Caller-bound model tools |
24
- | `src/orch/prompt.ts` | System-prompt guidance per mode |
25
- | `src/orch/housekeeping.ts` | [labs] Housekeeping summarizer: throttling, cancellation, model resolution and the one-line summary call |
26
- | `src/prefs/config.ts` | Frontmatter validation, precedence, atomic saves |
27
- | `src/prefs/settings.ts` | Manager settings, validation, safe paths |
28
- | `src/prefs/models.ts` | Model selection |
29
- | `src/prefs/agent-import.ts`, `import-discovery.ts`, `import-instructions.ts` | Import consent, read-only discovery, migration guidance |
30
- | `src/ui/` | Dialogs, settings, type editor, model and import pickers, thread tree, widget |
31
- | `agents/` | Bundled agent definitions |
32
-
33
- ## Changelog
34
-
35
- [CHANGELOG.md](../CHANGELOG.md) is generated by the [changelog workflow](../.github/workflows/changelog.yml) when a version tag is pushed, together with a GitHub Release. Don't edit generated entries — edit the GitHub Release and rerun.
36
-
37
- - Headings: major `##`, minor `###`, patch `####`. Missing initial tags get series headings (`0.x`, `0.1.x`).
38
- - Stable releases compare against the previous stable ancestor tag; prereleases against the previous ancestor tag and are listed separately.
39
- - Built from GitHub's generated notes, plus a scan of all closed PRs to catch any merged into the tag range (bots, squash/rebase). Direct commits appear only in compare links.
40
- - Handwritten release highlights survive reruns.
41
- - Needs only `GITHUB_TOKEN` with `contents: write` and `pull-requests: read`. Pushes `CHANGELOG.md` to the default branch without force; branch protection must allow it.
42
-
43
- **Backfill:** Actions → Publish changelog → Run workflow. Empty `tag` rebuilds the file only; a tag also publishes/repairs that release.
44
-
45
- **Local preview** (needs authenticated `gh` with contents-write):
46
-
47
- ```sh
48
- git fetch origin --tags
49
- GITHUB_REPOSITORY=championswimmer/pi-subagent-manager npm run changelog
50
- ```
51
-
52
- Rewrites local `CHANGELOG.md` only. The workflow adds `--publish`.
53
-
54
- **Why native notes:** they fit the existing tag-based release without another release manager. Release Drafter adds a draft lifecycle; release-please takes over versioning and needs Conventional Commits; git-cliff is commit-oriented; github-changelog-generator adds Ruby/Docker.
55
-
56
- ## Publishing
57
-
58
- Pushing a `v<version>` tag runs [release.yml](../.github/workflows/release.yml): checks the tag matches `package.json`, typechecks, tests, and publishes to npm with provenance via GitHub OIDC. No `NPM_TOKEN`.
59
-
60
- npm trusted publisher: owner `championswimmer`, repo `pi-subagent-manager`, workflow `release.yml`, environment empty.
61
-
62
- To release:
63
-
64
- ```sh
65
- npm version minor --no-git-tag-version # updates package.json + lock
66
- # validate, commit
67
- git tag -a v<version> -m v<version>
68
- git push && git push --tags
69
- ```
70
-
71
- The package ships compiled ESM and `.d.ts` declarations from `dist/` (gitignored, built via `npm run build` / `prepack`) plus `agents/`; check `files` in `package.json` when adding assets.
72
-
73
- ## Background
74
-
75
- Initial design: [`.agents/plans`](https://github.com/championswimmer/pi-subagent-manager/tree/main/.agents/plans). Prior-art research: [Claude](research-claude.md), [Codex](research-codex.md).
@@ -1,41 +0,0 @@
1
- # Importing agents
2
-
3
- Already have agents for another pi subagent package? Import them.
4
-
5
- ## How
6
-
7
- - **First run:** in an interactive TUI session, you're offered an import once. (Not in `off` or `orchestration` mode.)
8
- - **Any time:** `/agents import`.
9
-
10
- The checkbox picker starts with nothing selected.
11
-
12
- | Key | Action |
13
- | ------ | --------------------- |
14
- | ↑↓ | Navigate |
15
- | Space | Toggle row |
16
- | Ctrl+A | Toggle all |
17
- | Enter | Submit (empty = skip) |
18
- | Esc | Cancel |
19
-
20
- ## What happens
21
-
22
- Your **current main model** does the conversion, in your current conversation. There's no converter code and no separate agent.
23
-
24
- - It receives only the selected file paths, relevant source settings paths, the target schema, your scoped models and tools, and migration instructions.
25
- - It must explain and get your approval for anything lossy: unsupported features, dropped security restrictions, unavailable models, name collisions.
26
- - Originals are never modified.
27
- - New definitions load after the turn, or with `/agents reload`.
28
-
29
- Requires `opportunistic` mode (it uses the main thread's file tools). TUI only — RPC/print/JSON sessions never prompt.
30
-
31
- ## Where it looks
32
-
33
- Supported sources: [`@tintinweb/pi-subagents` 0.19.0](https://github.com/tintinweb/pi-subagents/blob/e955e29c51b7a6cce37e1108cd2d6c57a77e151c/src/custom-agents.ts) and [npm `pi-subagents` 0.74.0](https://github.com/nicobailon/pi-subagents/blob/b6bda32f03b7f549623bc404c9be14dca298ddc4/src/agents/agents.ts).
34
-
35
- - **User:** `<pi-agent-dir>/agents`; recursive `~/.agents` (npm).
36
- - **Project (trusted only):** `.pi/agents`, `.agents/agents` (tintinweb), recursive `.agents` (npm), including npm's nearest configured ancestor.
37
- - **Extra:** npm's `PI_SUBAGENT_EXTRA_AGENT_DIRS` and `settings.json` → `subagents.agentScanDirs` / `agentExcludeDirs`.
38
-
39
- Skipped: `skills`/`.skills` trees, any `SKILL.md`, symlinks, `.chain.md` workflows, installed-package builtins. npm's git-root anchoring isn't reproduced.
40
-
41
- The offer is remembered in `<pi-agent-dir>/subagent-manager/.import-offered`.
package/docs/pi-footer.md DELETED
@@ -1,128 +0,0 @@
1
- # Subagent dollar totals in pi-footer
2
-
3
- With `npm:pi-footer` loaded, choose one of the two integration paths below. Both
4
- show the selected **Display value**: settled subagent-only USD (default), or total
5
- main-session + settled-subagent USD. Keep pi-footer’s native cost widget if you
6
- want the main-session cost shown separately.
7
-
8
- The shared status key / event Widget ID is exactly **`subagent_cost`**. It is not
9
- `pi-subagent-manager`, an extension file path, or an npm package ID.
10
-
11
- ## Extension Status (recommended; default)
12
-
13
- 1. Open `/agents settings` → **Footer display** → **Location**, choose
14
- **pi-footer status widget**, return to settings, and save with **Ctrl+S**.
15
- 2. Open `/footer`, choose **Edit lines**, select a row, and add **Extension Status**.
16
- 3. Set **Status key** to **`subagent_cost`** and enable **Raw value only**.
17
- 4. Save the footer configuration.
18
-
19
- The corresponding subagent-manager setting is:
20
-
21
- ```json
22
- {
23
- "costDisplay": "pi-footer-status"
24
- }
25
- ```
26
-
27
- For a file-based footer setup, insert this widget object into an existing row
28
- array in `lines` in `~/.pi/agent/extensions/pi-footer.json`:
29
-
30
- ```json
31
- {
32
- "id": "subagent-cost-status",
33
- "type": "external-status",
34
- "enabled": true,
35
- "options": {
36
- "externalStatusKey": "subagent_cost",
37
- "raw": true,
38
- "hideWhenEmpty": true,
39
- "trimValue": 0
40
- }
41
- }
42
- ```
43
-
44
- Here `id` identifies the footer widget instance; **`externalStatusKey`** is the
45
- lookup key that must match the publisher. Do not put the package name in it.
46
- The manager already publishes the value using this API (no extra extension needed):
47
-
48
- ```typescript
49
- ctx.ui.setStatus("subagent_cost", "💵 $0.1234");
50
- ```
51
-
52
- It clears the status with `ctx.ui.setStatus("subagent_cost", undefined)`.
53
-
54
- ## Pi Event Value (alternative)
55
-
56
- 1. Open `/agents settings` → **Footer display** → **Location**, choose
57
- **pi-footer event**, return to settings, and save with **Ctrl+S**.
58
- 2. In `/footer`, add a **Pi Event Value** widget to the desired row.
59
- 3. Enter **Widget ID** as **`subagent_cost`** manually, replacing the generated ID,
60
- and enable **Raw value only**. Event IDs do **not** appear in the status-key selector.
61
- 4. Save the footer configuration.
62
-
63
- The corresponding subagent-manager setting is:
64
-
65
- ```json
66
- {
67
- "costDisplay": "pi-footer-event"
68
- }
69
- ```
70
-
71
- Insert this widget object into an existing row array in the footer's `lines`:
72
-
73
- ```json
74
- {
75
- "id": "subagent-cost-event",
76
- "type": "event",
77
- "enabled": true,
78
- "options": {
79
- "widgetId": "subagent_cost",
80
- "raw": true,
81
- "hideWhenEmpty": true
82
- }
83
- }
84
- ```
85
-
86
- The manager already emits the following event; no custom publisher is required.
87
- This is the exact event name and payload shape, with an illustrative dollar value:
88
-
89
- ```typescript
90
- pi.events.emit("pi-footer:update-widget", {
91
- widgetId: "subagent_cost",
92
- value: "💵 $0.1234",
93
- });
94
- ```
95
-
96
- To clear the event value, the manager emits:
97
-
98
- ```typescript
99
- pi.events.emit("pi-footer:update-widget", {
100
- widgetId: "subagent_cost",
101
- value: null,
102
- });
103
- ```
104
-
105
- ## File locations and refresh behavior
106
-
107
- - Merge `costDisplay`, `costValue`, and `costIcon` settings into
108
- `~/.pi/agent/subagent-manager/settings.json`, or the trusted-project override
109
- `.pi/agent/subagent-manager/settings.json`. Preserve your other settings.
110
- - Footer widget snippets are **objects inside a row**, not complete configuration
111
- files: the structure is `"lines": [[widgetObject, otherWidgetObject]]`. Preserve
112
- existing rows and widgets. `PI_FOOTER_CONFIG` can override the footer file path.
113
- - After manual file edits, use Pi's `/reload` to reload extensions and settings.
114
- Using the settings dialogs applies changes immediately when saved.
115
- - Choose only the widget matching your selected mode. Switching modes clears the
116
- old output; shutdown clears the published value too.
117
- - `$0.0000` appears at session start/reload and immediately on subagent startup.
118
- Running costs settle on completion, pause, stop, or failure; they remain in
119
- agent rows until then. Nested agents are counted once, and accounting survives
120
- resume and reaping. The selected money, coins, or wallet icon prefixes the
121
- dollar value: emoji with Nerd Font icons off, or a Nerd Font glyph with it on.
122
- - If the status key is missing, check that the manager is loaded and the location
123
- is **pi-footer status widget**, not **pi-footer event**. **Replace Pi status**
124
- uses the same status key but includes a Subagents/Total label. All locations
125
- support either display value; choose **Only subagent cost** for a subtotal.
126
-
127
- See [Cost display settings](settings.md#labs-cost-display-costdisplay) for all modes
128
- and fallback behavior when pi-footer is not loaded.