@howarewoo/pi-subagents 0.0.0-stage → 0.2.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 +63 -0
- package/LICENSE +21 -0
- package/README.md +499 -2
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/docs/advanced-policies.md +78 -0
- package/docs/delegation-contract.md +297 -0
- package/docs/images/subagent-hub.svg +1 -0
- package/docs/images/subagent-profiles.svg +1 -0
- package/docs/images/subagent-widget.svg +1 -0
- package/docs/parity-inventory.md +330 -0
- package/docs/provenance.md +13 -0
- package/docs/releases.md +236 -0
- package/docs/verification.md +430 -0
- package/package.json +64 -4
- package/src/capabilities.ts +39 -0
- package/src/child-execution.ts +459 -0
- package/src/coordinator.ts +1376 -0
- package/src/delegation-types.ts +111 -0
- package/src/hub.ts +612 -0
- package/src/model-adapter.ts +77 -0
- package/src/model-policy.ts +100 -0
- package/src/outcomes.ts +110 -0
- package/src/pi-extended-subagents.ts +673 -0
- package/src/profile-viewer.ts +246 -0
- package/src/profiles.ts +225 -0
- package/src/scheduling.ts +73 -0
- package/src/subagent-widget.ts +115 -0
- package/src/supported-host.ts +26 -0
- package/src/task-input.ts +74 -0
- package/src/task-presentation.ts +165 -0
- package/src/thread.ts +268 -0
- package/src/tool-schemas.ts +165 -0
- package/src/workspace.ts +46 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
- Simplify README installation and update guidance now that the repository rename is complete. Keep current npm/Git sources, duplicate-loading precautions and a link to the historical package migration instructions.
|
|
6
|
+
|
|
7
|
+
## [0.2.0]
|
|
8
|
+
|
|
9
|
+
Requires Node 22.19+ and stable Pi 1.5.2 or newer. Tested host: Pi 1.5.2; newer stable
|
|
10
|
+
hosts are allowed, not guaranteed compatible. The npm package remains `@howarewoo/pi-subagents`.
|
|
11
|
+
|
|
12
|
+
- Prepare the GitHub repository rename from `howarewoo/pi-extended-subagents` to `howarewoo/pi-subagents`: update canonical links, Git installation examples, package metadata and the release repository guard. The npm package remains `@howarewoo/pi-subagents`; the production entrypoint and runtime behavior are unchanged. The repository owner must coordinate the GitHub rename and verify npm trusted publishing before the next release; these external settings are not changed here.
|
|
13
|
+
|
|
14
|
+
- Simplify the README: put delegation examples before comparisons and architectural rationale, shorten repeated explanations, and make native controls and execution limits easier to scan. Preserve examples, section anchors and safety boundaries.
|
|
15
|
+
- Replace the README's unknown tintinweb messaging comparison with source-verified limited support: parent-to-child steering and result return, without built-in child-initiated or sibling messaging.
|
|
16
|
+
- Clarify in the README and advanced policy documentation that worktree lifecycle management is intentionally caller-owned, not a deferred extension feature; distinguish it from deferred filesystem isolation. Existing `cwd` support, parent permission hooks and global writer serialization are unchanged; workspace selection is not filesystem containment.
|
|
17
|
+
- Compact collapsed Delegate results to task headlines and statuses, keeping error and pause reasons visible. Use Pi’s global tool-output toggle (`Ctrl+O` by default, or the configured binding) to reveal detailed cards; model-facing results, saved artifacts and Subagent Hub behavior are unchanged.
|
|
18
|
+
- Enable child-local codemode for every subagent profile, including nested agents, when codemode is enabled in the parent. Scripts expose only child-authorized tools, with the `models` API disabled; existing permission hooks, workspace mapping, tool budgets and cancellation remain enforced. Failed or permission-blocked edits and writes do not trigger the prewalk model handoff.
|
|
19
|
+
- Remove persistent writer warnings from the pinned Subagents widget and Subagent Hub footer, freeing space for task activity. Keep the coordination caveat in Hub Details and the README; writer serialization is unchanged.
|
|
20
|
+
- Remove unused provider-secret bindings and credential examples from the Pullfrog workflow while retaining its OIDC App token integration.
|
|
21
|
+
- Create new task/generation, agent and transcript directories with private POSIX mode `0700`, preserving exclusive creation and `0600` outcome artifacts. Existing records and parent/global storage permissions are unchanged; Windows access control remains dependent on filesystem ACLs.
|
|
22
|
+
- Enforce live initiator/ancestor grant revocation for nested task-file reads, spawning and coordination before protected effects; malformed policy fails closed. Already in-flight work and accepted mailbox effects are not rolled back.
|
|
23
|
+
|
|
24
|
+
### Release isolation
|
|
25
|
+
|
|
26
|
+
- Separate release validation, human-protected npm publication and GitHub release creation into jobs with distinct credentials. Publish only the exact smoke-tested tarball after mandatory SHA-512 and release-identity verification; suppress npm lifecycle scripts.
|
|
27
|
+
- Repository owners must configure the `npm` environment approval and release-tag protections, and verify npm trusted publishing before a live release. These account settings are not configured by the workflow.
|
|
28
|
+
|
|
29
|
+
### Breaking — minimum supported Pi version
|
|
30
|
+
|
|
31
|
+
- Require stable Pi 1.5.2 or newer for delegated execution, including native and compatibility launches, resume, followup, revive and direct coordinator execution. Below-minimum, prerelease, malformed and unknown versions reject before task-file reads, child allocation, task-directory setup or child model requests, with an error naming the detected version and minimum stable version. Newer stable patch, minor and major versions are allowed; standard build metadata has equal precedence. Tested host remains Pi 1.5.2, not a compatibility guarantee for future allowed stable versions.
|
|
32
|
+
- Keep required wildcard host peers and pinned SDK development packages unchanged. Wildcard peers are a Pi packaging requirement, not a promise of support for every host. Root status, stop/cleanup and diagnostics remain usable where the host can load the extension; arbitrary ancient SDK module-load compatibility is not promised.
|
|
33
|
+
- Migration from 0.1.x: let active tasks drain, install stable Pi 1.5.2 or newer, update the extension to `@howarewoo/pi-subagents@0.2.0` and restart Pi. Shutdown or reload aborts and drains active children rather than migrating them.
|
|
34
|
+
|
|
35
|
+
## [0.1.1]
|
|
36
|
+
|
|
37
|
+
### Scoped npm package
|
|
38
|
+
|
|
39
|
+
- Rename the npm package from `pi-extended-subagents` to `@howarewoo/pi-subagents`. The GitHub repository and production entrypoint are unchanged; the package rename does not change runtime behavior.
|
|
40
|
+
- To prevent duplicate extension loading, run `pi remove npm:pi-extended-subagents`, then `pi install npm:@howarewoo/pi-subagents`, and restart Pi after active tasks finish.
|
|
41
|
+
- Tested host remains Pi 1.5.2; requires Node 22.19 or newer. Shutdown or reload aborts and drains active children rather than migrating them.
|
|
42
|
+
|
|
43
|
+
### Subagent terminology and command migration
|
|
44
|
+
|
|
45
|
+
- Standardize current UI and documentation on Subagent Hub, Subagent Profiles and one-word subagent terminology.
|
|
46
|
+
- Replace `/agent-hub`, `/task-profiles`, `/task-status`, `/task-steer` and `/task-stop` with `/subagent-hub`, `/subagent-profiles`, `/subagent-status`, `/subagent-steer` and `/subagent-stop`, respectively. Update saved instructions and command invocations; the old commands are not registered as aliases.
|
|
47
|
+
- Delegation APIs, permissions, lifecycle and control behavior are unchanged.
|
|
48
|
+
|
|
49
|
+
## [0.1.0]
|
|
50
|
+
|
|
51
|
+
Initial versioned release.
|
|
52
|
+
|
|
53
|
+
- Delegate single assignments and ordered batches through `delegate_task` and the native `subagent` interface.
|
|
54
|
+
- Use explicit role, tool, skill, model and nesting grants, with parent-owned permission hooks.
|
|
55
|
+
- Follow, steer and stop work in Agent Hub, with live transcripts and generation-pinned controls.
|
|
56
|
+
- Validate structured results and retain per-generation transcripts and artifacts.
|
|
57
|
+
- Serialize model-tool writers and abort/drain children when the parent shuts down or reloads.
|
|
58
|
+
|
|
59
|
+
### Compatibility and lifecycle
|
|
60
|
+
|
|
61
|
+
Tested against Pi 1.5.2; requires Node 22.19 or newer. Other Pi versions are not yet verified.
|
|
62
|
+
Only one extension providing `subagent` should be loaded. Updating does not migrate active tasks:
|
|
63
|
+
let them finish before updating, then restart Pi. Shutdown or reload aborts and drains children.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Adam Woo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,500 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @howarewoo/pi-subagents
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@howarewoo/pi-subagents)
|
|
4
|
+
[](https://www.npmjs.com/package/@howarewoo/pi-subagents)
|
|
5
|
+
|
|
6
|
+
Delegate work to subagents in Pi, follow their progress, and steer or stop them from Subagent Hub. Subagents use your selected model by default, with their own assignments and explicit tool grants.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
_Subagent Hub: tasks and conversations side by side, with each profile and status aligned beneath its agent’s name. Illustrated with synthetic demo data._
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Requires **Node 22.19+** and **stable Pi 1.5.2 or newer**. Tested host: Pi 1.5.2;
|
|
15
|
+
newer stable versions are allowed, not guaranteed compatible. Prerelease, older, malformed
|
|
16
|
+
and unknown host versions are rejected before task reads, allocation or model requests.
|
|
17
|
+
Wildcard host peer dependencies follow Pi's package format, not a compatibility promise.
|
|
18
|
+
See [host support](docs/delegation-contract.md#supported-host) for version rules.
|
|
19
|
+
|
|
20
|
+
If the host is unsupported, let active tasks drain, update Pi and restart. Status,
|
|
21
|
+
stop/cleanup and diagnostics remain available where the extension can load; arbitrary
|
|
22
|
+
older SDKs may fail at module load. The minimum-host restriction is a breaking change
|
|
23
|
+
in 0.2.0. When upgrading from 0.1.x, drain active tasks, install stable Pi 1.5.2 or newer,
|
|
24
|
+
update the extension and restart Pi.
|
|
25
|
+
|
|
26
|
+
Install from npm:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pi install npm:@howarewoo/pi-subagents
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Alternatively, install from Git with `pi install git:github.com/howarewoo/pi-subagents`.
|
|
33
|
+
Use only one source: when switching between npm, Git or a local checkout, remove the
|
|
34
|
+
previously registered source first so Pi does not load the extension twice.
|
|
35
|
+
|
|
36
|
+
Restart Pi and run `/subagent-profiles` to check the installation.
|
|
37
|
+
|
|
38
|
+
### Migrate from the old package
|
|
39
|
+
|
|
40
|
+
If you installed the former unscoped package, follow the
|
|
41
|
+
[0.1.1 migration instructions](CHANGELOG.md#011) before installing the current package.
|
|
42
|
+
|
|
43
|
+
## Use delegation
|
|
44
|
+
|
|
45
|
+
Choose a model through Pi's `/login` and `/model` setup. Delegation uses that provider and may incur charges; it does not automatically switch to a cheaper model.
|
|
46
|
+
|
|
47
|
+
Ask Pi:
|
|
48
|
+
|
|
49
|
+
> Use delegate_task with profile scout to locate the startup lifecycle code and report source locations. Run it in the foreground.
|
|
50
|
+
|
|
51
|
+
The corresponding tool call is:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"assignment": "Locate startup lifecycle code and report source locations",
|
|
56
|
+
"profile": "scout",
|
|
57
|
+
"background": false
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or submit a batch:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"tasks": [
|
|
66
|
+
{ "assignment": "Locate startup code", "profile": "scout" },
|
|
67
|
+
{ "assignment": "Review lifecycle tests", "profile": "review", "limits": { "requests": 20 } }
|
|
68
|
+
],
|
|
69
|
+
"background": false
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The default is 16 concurrent tasks, a 32-item queue and up to 16 tasks per batch. Every item passes preflight before any starts. One failed task does not cancel its siblings.
|
|
74
|
+
|
|
75
|
+
`scout` and `review` allow up to `read`, `grep`, `find` and `ls`. `general` and `implementation` also allow `write`, `edit` and `bash`. Each role receives only the builtins already callable in the parent. With Pi's default tools, scouts get `read` only. Tool calls retain the parent's permission hooks; incompatible tool overrides are rejected.
|
|
76
|
+
|
|
77
|
+
`general` inherits available parent skills, not parent instructions or history. Its role prompt and assignment remain intact. Operator/trusted-project `tools` and `skills` settings can narrow inheritance; `[]` removes grants. General can write when its effective tool set allows it.
|
|
78
|
+
|
|
79
|
+
**Extension/MCP tools require operator review.** Set `general.leafTools` to exact names only for trusted tools that never call other Pi tools or change the tool/model/session loadout. Descriptions and annotations do not grant trust. Orchestrating/reaching tools, codemode, tool search, owned controls, hidden/model-only tools and builtin replacements cannot be forwarded. Leaf tools require the global writer lease and the root workspace; only builtins support cwd adaptation. See [restricted inheritance](docs/delegation-contract.md#restricted-general-inheritance).
|
|
80
|
+
|
|
81
|
+
Foreground calls return the final results. Set `background:true` to return immediately and receive one ordered completion message after the batch drains. Use the returned task ID and generation for controls:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
/subagent-profiles
|
|
85
|
+
/subagent-status
|
|
86
|
+
/subagent-status <id> <generation>
|
|
87
|
+
/subagent-steer <id> <generation> <text>
|
|
88
|
+
/subagent-stop <id> <generation>
|
|
89
|
+
/subagent-hub
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Native orchestration
|
|
93
|
+
|
|
94
|
+
Pi discovers the native `subagent` tool at startup through its tool description and coding-worker guidance; no enable call is needed. For replacement use, load only one extension providing `subagent`: Pi uses the first registration, not an automatic provider preference. Switching providers does not migrate or remove old runs.
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"agent": "worker",
|
|
99
|
+
"task": "Implement the approved change; follow the supplied repository guidelines and task references",
|
|
100
|
+
"cwd": "/absolute/path/to/task-worktree"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- `worker` maps to the configured `implementation` profile; `scout`, `review` and `general` are also available.
|
|
105
|
+
- Calls are async by default and wake the parent after drain. Set `async:false` to wait; use `tasks:[{agent,task,cwd?}]` for a batch.
|
|
106
|
+
- Control a task with its returned `id` and `action:"status"`, `"steer"`, `"stop"` or `"resume"`. Steer/resume also require `message`.
|
|
107
|
+
- Resume keeps a paused conversation in the same generation. Completed idle/parked work gets a fresh generation, so include needed prior conclusions.
|
|
108
|
+
|
|
109
|
+
The coordinator supplies an existing workspace and the complete handoff, including accessible skill/reference paths. The extension does not create or manage worktrees. This is the [supported orchestration interface](docs/delegation-contract.md#native-orchestration-compatibility), not compatibility with every competing workflow script or custom agent definition.
|
|
110
|
+
|
|
111
|
+
## Subagent Profiles
|
|
112
|
+
|
|
113
|
+
Run `/subagent-profiles` to inspect the resolved profiles for the current workspace: bundled definitions, operator `delegation.json`, then trusted-project narrowing. It opens a read-only list/details overlay, not an editor. Reopen it after configuration changes to refresh the snapshot.
|
|
114
|
+
|
|
115
|
+
Use ↑/↓ to select a role; j/k, PgUp/PgDn and Home/End scroll details; Esc closes (configured selection bindings also apply). Narrow terminals stack the list above details; tiny terminals ask you to resize. Details show the description, prompt, builtin tool ceiling, exact skill paths, spawn/coordination ceilings and model/prewalk policy.
|
|
116
|
+
|
|
117
|
+
**Ceilings are not callable tools.** Pi's command context has no callable-tool dispatcher, so the viewer reports effective tools as unknown rather than treating active declarations as executable grants. Admission performs the real intersection and remaining checks; inspect a task's `tools` in `/subagent-status` or Hub Details. RPC, JSON and print modes retain the structured `{toolPolicy, profiles}` message instead of opening an overlay. Invalid configuration or missing/invalid granted skills fails resolution, as at admission.
|
|
118
|
+
|
|
119
|
+

|
|
120
|
+
|
|
121
|
+
_Synthetic native-component output; not a terminal screenshot or live-provider verification._
|
|
122
|
+
|
|
123
|
+
## Subagent Hub
|
|
124
|
+
|
|
125
|
+
Subagent Hub shows the task list beside the selected conversation using Pi's native renderers. On narrow terminals, the conversation takes the full width. Details shows results, artifacts, grants and usage; Tools shows full sanitized arguments and result text.
|
|
126
|
+
|
|
127
|
+
The thread follows new output until you scroll up. Press End to follow again. The pinned Subagents widget appears after the first task starts. Closing Subagent Hub does not stop the work.
|
|
128
|
+
|
|
129
|
+
These illustrations use native renderer output with synthetic data modeled on the [offline fleet demo](examples/controlled-fleet.ts); they are not terminal screenshots.
|
|
130
|
+
|
|
131
|
+

|
|
132
|
+
|
|
133
|
+
_Pinned Subagents widget: task counts and recent activity stay visible above the editor._
|
|
134
|
+
|
|
135
|
+
| Key | Action |
|
|
136
|
+
| --------------------- | ------------------------------------------------- |
|
|
137
|
+
| ↑ / ↓ | Select a subagent or historical generation |
|
|
138
|
+
| j / k | Scroll down / up one line |
|
|
139
|
+
| Ctrl+u/d or PgUp/PgDn | Scroll a page |
|
|
140
|
+
| Home / End | Top / latest output |
|
|
141
|
+
| Tab | Switch between thread, details and tools |
|
|
142
|
+
| / | Filter the subagent list |
|
|
143
|
+
| s / m | Steer / send an inbox message |
|
|
144
|
+
| x, then y | Stop the selected subtree; Enter does not confirm |
|
|
145
|
+
| w / p | Wait briefly for an outcome / park an idle task |
|
|
146
|
+
| Esc | Cancel input or close the Hub |
|
|
147
|
+
|
|
148
|
+
Mouse-wheel scrolling works in fullscreen mode. In regular mode, use the keyboard controls because the terminal owns mouse scrollback. Actions stay pinned to the original task and generation; controls refuse to submit if the window cannot show the full target.
|
|
149
|
+
|
|
150
|
+
## Messages and follow-up work
|
|
151
|
+
|
|
152
|
+
Use `delegate_coordinate` to message a running subagent, wait for an outcome or assign follow-up work. Include it in any explicit tool allowlist alongside `delegate_task`.
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{"action":"message","target":{"id":"<task-id>","generation":1},"text":"Check the shutdown path too","mode":"steer"}
|
|
156
|
+
{"action":"wait","target":{"id":"<task-id>","generation":1},"timeoutMs":30000}
|
|
157
|
+
{"action":"followup","target":{"id":"<task-id>","generation":1},"assignment":"Now review the cancellation path"}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Each line is a separate call. An accepted or queued message is not a delivery confirmation; even a delivered receipt does not prove the model understood it. Follow-ups start a new generation without replaying the old conversation, so include the context it needs. Follow-up and revival are model-tool operations, unavailable directly in Subagent Hub. Child messaging is off until explicitly granted. See the [coordination reference](docs/delegation-contract.md#live-parent-messaging-waits-and-presence).
|
|
161
|
+
|
|
162
|
+
### Task files and structured results
|
|
163
|
+
|
|
164
|
+
Use `taskFile` instead of `assignment` to read instructions from a workspace-relative text file. Add `resultSchema` when you need a validated JSON value:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"taskFile": "tasks/review.txt",
|
|
169
|
+
"profile": "review",
|
|
170
|
+
"resultSchema": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"properties": { "summary": { "type": "string" } },
|
|
173
|
+
"required": ["summary"],
|
|
174
|
+
"additionalProperties": false
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Task files must be regular UTF-8 files of 1 to 50000 bytes, outside hidden paths and `node_modules`. Reads use the parent's permission hooks. Schema-required children call `submit_result({value:...})`; missing or invalid results fail visibly. See [supported schemas](docs/delegation-contract.md#required-structured-results) and [task-file checks](docs/delegation-contract.md#checked-task-file-input).
|
|
180
|
+
|
|
181
|
+
## Configuration
|
|
182
|
+
|
|
183
|
+
No configuration is needed for the bundled roles. To change prompts or narrow tools, use `~/.pi/agent/delegation.json`:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"review": {
|
|
188
|
+
"tools": ["read", "grep"],
|
|
189
|
+
"skills": ["/absolute/operator-reviewed/review/SKILL.md"],
|
|
190
|
+
"prompt": "Review this assignment and report concrete findings with source locations."
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
All bundled profiles may delegate to `scout` and `review` by default, within a total depth of two (root 0, child 1, grandchild 2). Other nested targets and child messaging need explicit operator grants. Set `spawn: []` to revoke nesting. General inherits available parent skills; other roles need explicit skill grants. Trusted project configuration in `.pi/delegation.json` can narrow grants, never expand them. Children do not load ambient extension/MCP runtimes or context files; general can forward only the reviewed leaf tools described above.
|
|
196
|
+
|
|
197
|
+
Default task limits are **30 minutes**, **100 model requests** and **100 tool calls**:
|
|
198
|
+
|
|
199
|
+
- A deadline pauses the active subtree after tool/provider drain, releasing capacity and writer leases but retaining sessions and conversations.
|
|
200
|
+
- Use `subagent` resume or root-only `delegate_coordinate` `{action:"resume",target:{id,generation},assignment:"Continue…"}` to continue the same identity and conversation. Only the deadline resets; request/tool/spawn counters remain cumulative.
|
|
201
|
+
- Resume the parent first, then explicitly selected children. Descendants never resume automatically.
|
|
202
|
+
- Stop, shutdown and hard request/tool limits cancel and dispose. Unresponsive code must drain before pause or cancellation can release resources.
|
|
203
|
+
|
|
204
|
+
See [limits and nesting](docs/delegation-contract.md#capacity-and-bounded-execution), [profile grants](docs/delegation-contract.md#subagent-profiles-and-explicit-spawn-grants), and [model selection and prewalk](docs/advanced-policies.md).
|
|
205
|
+
|
|
206
|
+
## Shared checkout and lifetime
|
|
207
|
+
|
|
208
|
+
Subagents use your checkout unless you supply an existing directory as `cwd`. Parent permission hooks still apply and may deny access. **Writers serialize even across worktrees**, and workspace selection is not a sandbox. Manual commands, external editors and other sessions are uncoordinated: avoid conflicting edits. See [workspace safety](#why-workspaces-are-caller-managed-and-writers-serialize).
|
|
209
|
+
|
|
210
|
+
Keep the parent runtime alive until work finishes. Shutdown or reload aborts and drains children; there is no restart recovery or cross-parent revival. Saved transcripts and results may contain sensitive task, tool and model output; protect them like your main Pi transcripts.
|
|
211
|
+
|
|
212
|
+
### Why worktrees are managed externally
|
|
213
|
+
|
|
214
|
+
Create or select a workspace externally, then pass `cwd` as in the
|
|
215
|
+
[native orchestration example](#native-orchestration). The caller owns it throughout the
|
|
216
|
+
assignment, including inspection, integration and removal. Automatic worktree creation,
|
|
217
|
+
commits, apply and cleanup are intentionally outside scope, not planned features.
|
|
218
|
+
|
|
219
|
+
Separate worktrees neither bypass writer serialization nor provide a sandbox.
|
|
220
|
+
See [workspace ownership and writer coordination](#why-workspaces-are-caller-managed-and-writers-serialize).
|
|
221
|
+
|
|
222
|
+
### Why workflows and scheduling stay external
|
|
223
|
+
|
|
224
|
+
Separate packages can compose the public delegation tools and own when and how to run
|
|
225
|
+
assignments within the parent runtime. This does not grant automatic tool/context
|
|
226
|
+
inheritance or promise compatibility with existing third-party workflow packages.
|
|
227
|
+
See [orchestration boundaries](#why-orchestration-stays-with-the-caller).
|
|
228
|
+
|
|
229
|
+
## Updates and rollback
|
|
230
|
+
|
|
231
|
+
Let active subagents finish before updating, then restart Pi. Shutdown or `/reload` aborts
|
|
232
|
+
and drains children; active tasks are not migrated to the new version. There is no extension-owned
|
|
233
|
+
auto-updater.
|
|
234
|
+
|
|
235
|
+
```sh
|
|
236
|
+
# Update an unpinned npm installation
|
|
237
|
+
pi update npm:@howarewoo/pi-subagents
|
|
238
|
+
|
|
239
|
+
# Or update all installed extension packages
|
|
240
|
+
pi update --extensions
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Plain `pi update` updates Pi itself, not installed extension packages. For a Git installation,
|
|
244
|
+
use `pi update git:github.com/howarewoo/pi-subagents`, matching the source you registered.
|
|
245
|
+
An unpinned Git source tracks the repository's default branch, including unreleased commits.
|
|
246
|
+
|
|
247
|
+
For a reproducible npm installation or rollback, select an exact published version:
|
|
248
|
+
|
|
249
|
+
```sh
|
|
250
|
+
pi install npm:@howarewoo/pi-subagents@0.2.0
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
For Git, select a published tag, for example
|
|
254
|
+
`pi install git:github.com/howarewoo/pi-subagents@v0.2.0`.
|
|
255
|
+
Exact npm versions and Git tags stay pinned; updating does not advance them to the next release.
|
|
256
|
+
Install a different version explicitly to change the pin.
|
|
257
|
+
|
|
258
|
+
[CHANGELOG.md](CHANGELOG.md) lists user-facing changes and migrations. Pi shows new package
|
|
259
|
+
changelog entries on the next fresh launch after a version increase. See the
|
|
260
|
+
[maintainer release guide](docs/releases.md) for publishing and recovery.
|
|
261
|
+
|
|
262
|
+
## Feature comparison
|
|
263
|
+
|
|
264
|
+
Compared with two community alternatives using their documentation, checked on 2026-11-11. Tintinweb's messaging scope was additionally checked against source at revision `b72b414` (2026-11-12). This is a feature comparison, not a performance or reliability benchmark. UI cells name documented surfaces; they do not imply other features are absent.
|
|
265
|
+
|
|
266
|
+
| Feature | @howarewoo/pi-subagents | [nicobailon/pi-subagents](https://github.com/nicobailon/pi-subagents) | [tintinweb/pi-subagents](https://github.com/tintinweb/pi-subagents) |
|
|
267
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
268
|
+
| Background tasks | ✅ [Parent-bound by design; until exit or reload](#why-background-tasks-are-parent-bound) | ✅ Supported | ✅ Supported |
|
|
269
|
+
| Nested delegation | ✅ [Supported](#why-nested-delegation-is-foreground-only) | ✅ Supported | ✅ Supported |
|
|
270
|
+
| Task list / conversation | ✅ [Subagent Hub: split panes; full-width thread on narrow terminals](#why-the-ui-observes-one-native-registry) | ✅ Fleet inspector: roster and output pane | ✅ FleetView opens a separate conversation viewer |
|
|
271
|
+
| Message / tool rendering | ✅ [Native Pi message and tool components](#why-the-ui-observes-one-native-registry) | ✅ Structured Markdown/tool transcripts | ✅ Markdown + session-registered tool renderers |
|
|
272
|
+
| Bi-directional agent messaging | ✅ [Supported; parent/child and siblings](#why-agent-messaging-is-family-scoped) | ⚠️ [Child/supervisor requests and replies](https://github.com/nicobailon/pi-subagents/blob/c99503aed6d6b20d2397a1767f7d60730efe3963/docs/workflows.md#supervisor-coordination-child-asks-parent) | ⚠️ [Parent-to-child steering + result return; no built-in child-initiated or sibling messaging](https://github.com/tintinweb/pi-subagents/blob/b72b414581d8aa9bbfb1d44c832aed0d0b0b9053/src/nested-tools.ts#L400-L430) |
|
|
273
|
+
| Live follow / scrollback | ✅ Scroll up to pause; End to follow | ✅ Scroll away to pause; bottom resumes | ✅ Scroll up to pause; End to follow |
|
|
274
|
+
| In-UI task controls | ✅ [Hub: steer, inbox, stop, wait, park](#why-controls-are-identity-pinned) | ✅ Inspector: steer/follow-up and stop async runs | ✅ Viewer: steer, stop, foreground-to-background handoff |
|
|
275
|
+
| Tool / usage inspection | ✅ [Tools: sanitized arguments/results; Details: direct usage](#why-the-ui-observes-one-native-registry) | ✅ Expandable tool details + token counts | ✅ Expandable tool output + tokens; optional cost |
|
|
276
|
+
| Schema-validated results | ✅ [Supported](#why-structured-results-require-explicit-submission) | ✅ Supported | ⚠️ Workflow agents only |
|
|
277
|
+
| Managed Git worktrees | 🚫 [By design; caller-managed worktrees supported](#why-workspaces-are-caller-managed-and-writers-serialize) | ✅ Supported | ✅ Supported |
|
|
278
|
+
| Workflow scripts | 🚫 [By design; caller-owned](#why-orchestration-stays-with-the-caller) | ✅ Supported | ✅ Supported |
|
|
279
|
+
| Scheduled runs | 🚫 [By design; no scheduler](#why-orchestration-stays-with-the-caller) | ✅ Supported | ⚠️ Session-scoped agents only |
|
|
280
|
+
|
|
281
|
+
Legend: ✅ Supported (stated design boundaries apply) · ⚠️ Supported with scope restrictions · 🚫 By design.
|
|
282
|
+
|
|
283
|
+
🚫 marks a deliberate product boundary, not a missing implementation within the current
|
|
284
|
+
contract. Linked explanations describe the trade-offs behind this repo's choices.
|
|
285
|
+
|
|
286
|
+
Sources: [our contract](docs/delegation-contract.md); nicobailon's [README](https://github.com/nicobailon/pi-subagents/blob/c99503aed6d6b20d2397a1767f7d60730efe3963/README.md), [agents](https://github.com/nicobailon/pi-subagents/blob/c99503aed6d6b20d2397a1767f7d60730efe3963/docs/agents.md), [workflows](https://github.com/nicobailon/pi-subagents/blob/c99503aed6d6b20d2397a1767f7d60730efe3963/docs/workflows.md) and [observability](https://github.com/nicobailon/pi-subagents/blob/c99503aed6d6b20d2397a1767f7d60730efe3963/docs/observability.md); tintinweb's [README](https://github.com/tintinweb/pi-subagents/blob/8df7fa7d8e8130151a8fbfa991a1d3fa6b443739/README.md) and [workflows](https://github.com/tintinweb/pi-subagents/blob/8df7fa7d8e8130151a8fbfa991a1d3fa6b443739/docs/workflows.md).
|
|
287
|
+
|
|
288
|
+
## Architectural decisions
|
|
289
|
+
|
|
290
|
+
These choices define the current execution contract and its trade-offs. They are not
|
|
291
|
+
claims that other designs are unsafe or impossible. Deferred capabilities are identified
|
|
292
|
+
separately; an unsupported feature is not automatically a permanent exclusion.
|
|
293
|
+
|
|
294
|
+
### Why background tasks are parent-bound
|
|
295
|
+
|
|
296
|
+
Background tasks belong to the live parent Pi runtime. Shutdown or `/reload` cancels
|
|
297
|
+
children and drains their tools and descendants before releasing capacity and writer
|
|
298
|
+
leases. Closing Subagent Hub does not stop work. This prevents replacement writers
|
|
299
|
+
from overlapping tools that are still stopping.
|
|
300
|
+
|
|
301
|
+
Keep Pi running until tasks finish: there is no detached runner or restart recovery.
|
|
302
|
+
Unresponsive provider, permission or tool code can delay drain; abrupt process death
|
|
303
|
+
cannot guarantee cleanup. Saved transcripts are inspection records, not restart state.
|
|
304
|
+
|
|
305
|
+
In the cited versions, nicobailon uses detached background processes. Tintinweb stops
|
|
306
|
+
agents on shutdown but supports persisted conversation resume and foreground-to-background
|
|
307
|
+
handoff. Persisted conversations do not keep jobs running after exit.
|
|
308
|
+
See [the delegation contract](docs/delegation-contract.md) for continuation semantics.
|
|
309
|
+
|
|
310
|
+
### Why nested delegation is foreground-only
|
|
311
|
+
|
|
312
|
+
Nested calls require explicit profile grants and wait for their children while retaining
|
|
313
|
+
their execution slot. Work that cannot start immediately is rejected rather than queued
|
|
314
|
+
behind waiting ancestors or given extra capacity. A writing child cannot spawn another
|
|
315
|
+
writer beneath itself.
|
|
316
|
+
|
|
317
|
+
This keeps capacity and ownership predictable but limits fan-out. Parent completion or
|
|
318
|
+
stop drains descendants; there are no detached grandchildren.
|
|
319
|
+
See [lifecycle and scheduling](ARCHITECTURE.md#lifecycle-and-scheduling).
|
|
320
|
+
|
|
321
|
+
### Why permissions and resources are explicit
|
|
322
|
+
|
|
323
|
+
Profiles cap tools at what the parent can call. Builtin calls retain the parent's
|
|
324
|
+
permission hooks; operator grants set authority, and trusted-project configuration and
|
|
325
|
+
task requests can only narrow it. Selecting another workspace does not load its trust policy.
|
|
326
|
+
|
|
327
|
+
Children receive their assignment, role prompt and granted skills, not parent
|
|
328
|
+
instructions, history or ambient context. General also inherits available skills and
|
|
329
|
+
may use exact operator-reviewed leaf tools. Full extension/MCP runtime inheritance and
|
|
330
|
+
tool-to-tool forwarding are unsupported, so provide a complete handoff.
|
|
331
|
+
Tool grants and cwd adaptation are not an OS sandbox.
|
|
332
|
+
See [permission and resource boundaries](ARCHITECTURE.md#permission-and-resource-boundaries).
|
|
333
|
+
|
|
334
|
+
### Why model routing is exact
|
|
335
|
+
|
|
336
|
+
Children use the parent's selected model and effort by default. Overrides require exact
|
|
337
|
+
operator-approved provider/model/effort grants. Unavailable selections and unsupported
|
|
338
|
+
effort fail visibly; there is no automatic cheaper-model or provider fallback.
|
|
339
|
+
Authentication stays with the parent's registry, not child task directories.
|
|
340
|
+
|
|
341
|
+
A configured role prewalk can make one approved model switch after an edit/write call;
|
|
342
|
+
it adds no hidden planning inference.
|
|
343
|
+
See [models and authentication](ARCHITECTURE.md#models-and-authentication).
|
|
344
|
+
|
|
345
|
+
### Why workspaces are caller-managed and writers serialize
|
|
346
|
+
|
|
347
|
+
Pass an existing directory as `cwd`, including a caller-created worktree. The extension
|
|
348
|
+
adapts builtin paths and shell cwd through parent permission hooks. Worktree creation,
|
|
349
|
+
branch/base selection, integration and cleanup stay with the caller or separate tooling,
|
|
350
|
+
keeping this extension focused on subagent execution, coordination and UI.
|
|
351
|
+
|
|
352
|
+
Workspace selection is not containment: paths and shell commands can reach outside the
|
|
353
|
+
directory when parent permissions allow. Effective writing tasks share one global lease,
|
|
354
|
+
even across worktrees; coordinated parent model-tool mutations cannot overlap a child
|
|
355
|
+
writer. The lease lasts through actual drain, sacrificing parallel writing throughput
|
|
356
|
+
rather than assuming different directories isolate every write.
|
|
357
|
+
|
|
358
|
+
Manual `!`/`!!` commands, external editors, other sessions and arbitrary extension
|
|
359
|
+
JavaScript are not coordinated. Avoid conflicting edits while a subagent writes.
|
|
360
|
+
See [tool execution and workspaces](ARCHITECTURE.md#tool-execution-and-workspaces)
|
|
361
|
+
and [explicit working directory](docs/delegation-contract.md#explicit-working-directory).
|
|
362
|
+
|
|
363
|
+
### Why structured results require explicit submission
|
|
364
|
+
|
|
365
|
+
Schema-required children must call `submit_result` with a value matching the supported
|
|
366
|
+
bounded JSON Schema subset. Final prose is not parsed. Submission is provisional until
|
|
367
|
+
execution and descendants drain: it cannot override cancellation or failure, and a
|
|
368
|
+
missing required submission fails the task.
|
|
369
|
+
|
|
370
|
+
Whole batches pass preflight before admission. Results keep input order, and a failed
|
|
371
|
+
child does not cancel unrelated siblings. Background batches send one outcome after
|
|
372
|
+
drain, so fast results may wait for slower siblings.
|
|
373
|
+
See [results and persistence](ARCHITECTURE.md#results-and-persistence).
|
|
374
|
+
|
|
375
|
+
### Why the UI observes one native registry
|
|
376
|
+
|
|
377
|
+
Hub, the widget and result cards observe the same coordinator; viewers do not start
|
|
378
|
+
another executor. Pi's native components render sanitized conversations, using split
|
|
379
|
+
panes or a full-width thread on narrow terminals.
|
|
380
|
+
|
|
381
|
+
Usage is reported directly per generation, without recursive parent totals or estimates
|
|
382
|
+
for missing provider usage. Display sanitization does not redact saved files.
|
|
383
|
+
See [observation and terminal UI](ARCHITECTURE.md#observation-and-terminal-ui).
|
|
384
|
+
|
|
385
|
+
### Why controls are identity-pinned
|
|
386
|
+
|
|
387
|
+
Controls target a UUID and generation, so stale selections cannot change newer
|
|
388
|
+
assignments. Paused continuation keeps its conversation; follow-up or revival of completed
|
|
389
|
+
work starts a fresh generation under current, narrowed authority. Supply needed prior
|
|
390
|
+
conclusions: old transcripts are not replayed.
|
|
391
|
+
|
|
392
|
+
Hub uses the same registry authority as the tools, but cannot start new generations:
|
|
393
|
+
its command context lacks Pi's permission-preserving tool dispatcher. Use model-issued
|
|
394
|
+
tool calls for those actions.
|
|
395
|
+
See [coordination, presence and generations](ARCHITECTURE.md#coordination-presence-and-generations).
|
|
396
|
+
|
|
397
|
+
### Why agent messaging is family-scoped
|
|
398
|
+
|
|
399
|
+
Explicit grants allow parent/child messages in both directions and sibling messages
|
|
400
|
+
within the same exact parent generation. Senders must know the recipient's UUID and
|
|
401
|
+
generation. Children cannot enumerate the registry, address arbitrary sessions or read
|
|
402
|
+
peer transcripts.
|
|
403
|
+
|
|
404
|
+
`delegate_coordinate` supports inbox, steering/follow-up delivery and bounded event-driven
|
|
405
|
+
waits. Recipients must be running; inbox delivery does not trigger parent inference.
|
|
406
|
+
Receipts distinguish acceptance, queuing and visibility, not model acknowledgment.
|
|
407
|
+
Mailboxes and waits are finite, waits retain capacity, and cycles are rejected. Callers
|
|
408
|
+
must arrange identities and replies; this is not a durable broker or blocking supervisor
|
|
409
|
+
interview.
|
|
410
|
+
|
|
411
|
+
Nicobailon documents child `contact_supervisor` requests and parent `subagent_supervisor`
|
|
412
|
+
replies, including nested supervision. Tintinweb implements steering and result return.
|
|
413
|
+
At `b72b414`, its [nested steering tool](https://github.com/tintinweb/pi-subagents/blob/b72b414581d8aa9bbfb1d44c832aed0d0b0b9053/src/nested-tools.ts#L400-L430)
|
|
414
|
+
targets only owned children; its [completion outbox](https://github.com/tintinweb/pi-subagents/blob/b72b414581d8aa9bbfb1d44c832aed0d0b0b9053/src/index.ts#L466-L497)
|
|
415
|
+
returns results, not child-initiated dialogue. No built-in upstream or sibling messaging
|
|
416
|
+
was found in that source inspection.
|
|
417
|
+
See the [coordination contract](docs/delegation-contract.md#live-parent-messaging-waits-and-presence).
|
|
418
|
+
|
|
419
|
+
### Why orchestration stays with the caller
|
|
420
|
+
|
|
421
|
+
The caller owns the larger plan and workspace preparation. This extension provides
|
|
422
|
+
bounded assignments, batches and live coordination, not a workflow-script runtime or
|
|
423
|
+
scheduling service. Scripts and recurring jobs need separate tooling and must respect
|
|
424
|
+
the live-parent lifetime.
|
|
425
|
+
|
|
426
|
+
The native `subagent` interface uses the same executor; it does not interpret competitors'
|
|
427
|
+
workflow scripts or custom agent definitions.
|
|
428
|
+
See [entry points and runtime ownership](ARCHITECTURE.md#entry-points-and-runtime-ownership).
|
|
429
|
+
|
|
430
|
+
## Documentation
|
|
431
|
+
|
|
432
|
+
- [Delegation contract](docs/delegation-contract.md): tools, permissions, lifecycle and storage.
|
|
433
|
+
- [Advanced policies](docs/advanced-policies.md): models, prewalk and unsupported capabilities.
|
|
434
|
+
- [Verification](docs/verification.md): checks, terminal evidence and known limits.
|
|
435
|
+
- [Parity inventory](docs/parity-inventory.md), [provenance](docs/provenance.md), [third-party notices](THIRD_PARTY_NOTICES.md).
|
|
436
|
+
|
|
437
|
+
## Local development
|
|
438
|
+
|
|
439
|
+
From a source checkout:
|
|
440
|
+
|
|
441
|
+
```sh
|
|
442
|
+
npm ci --ignore-scripts
|
|
443
|
+
npm run lint
|
|
444
|
+
npm run format:check
|
|
445
|
+
npm run typecheck
|
|
446
|
+
npm test
|
|
447
|
+
npm run exercise
|
|
448
|
+
npm pack --dry-run
|
|
449
|
+
npm run test:package
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
`npm run check` runs lint, formatting, typecheck, tests and the controlled SDK exercise.
|
|
453
|
+
`npm run test:package` packs and installs the tarball in a temporary directory, then checks
|
|
454
|
+
that Pi loads the production entrypoint and registers its tools. It needs registry access
|
|
455
|
+
for runtime dependencies, does not use model credentials and leaves your Pi settings unchanged.
|
|
456
|
+
|
|
457
|
+
Oxlint checks correctness rules; warnings fail the lint command. Control-character regexes are allowed in terminal rendering code and tests because they match ANSI escape sequences. Run `npm run lint:fix` for safe lint fixes and `npm run format` to apply Oxfmt formatting. Formatting skips the generated lockfile and the managed Pullfrog workflow.
|
|
458
|
+
|
|
459
|
+
Load the production entrypoint with `pi -e /absolute/path/to/src/pi-extended-subagents.ts`. Tests and examples use controlled providers without credentials or live inference.
|
|
460
|
+
|
|
461
|
+
### Offline CLI walkthrough
|
|
462
|
+
|
|
463
|
+
Run this from the checkout in a disposable workspace. The controlled example deliberately starts a long background child; normal print-parent exit aborts it.
|
|
464
|
+
|
|
465
|
+
```sh
|
|
466
|
+
repo="$PWD"
|
|
467
|
+
root="$(mktemp -d)"
|
|
468
|
+
node_bin="$(command -v node)"
|
|
469
|
+
mkdir -p "$root/home" "$root/workspace"
|
|
470
|
+
(
|
|
471
|
+
cd "$root/workspace"
|
|
472
|
+
env -i PATH="$PATH" HOME="$root/home" PI_CODING_AGENT_DIR="$root/agent" PI_OFFLINE=1 \
|
|
473
|
+
"$node_bin" "$repo/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js" \
|
|
474
|
+
--offline --no-extensions --no-mcp --no-skills --no-prompt-templates \
|
|
475
|
+
--no-themes --no-context-files --tools read,grep,find,ls,delegate_task \
|
|
476
|
+
--session-dir "$root/sessions" -e "$repo/src/pi-extended-subagents.ts" \
|
|
477
|
+
-e "$repo/examples/controlled-parent.ts" -p 'delegate example' </dev/null
|
|
478
|
+
)
|
|
479
|
+
# Inspect only these new files before removing the temporary walkthrough root:
|
|
480
|
+
find "$root/sessions/delegation" -name '*.jsonl'
|
|
481
|
+
rm -rf -- "$root"
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
The child's JSONL records `stopReason:aborted`. Do not install the controlled example as a production provider. This checks the SDK lifecycle, not live-provider reliability.
|
|
485
|
+
|
|
486
|
+
For the UI exercise, create `input.txt` in a disposable cwd. Run the local CLI with `--offline --no-extensions --no-mcp --no-skills --no-prompt-templates --no-context-files`, `-e /absolute/path/src/pi-extended-subagents.ts -e /absolute/path/examples/controlled-fleet.ts`, and tools `read,grep,find,ls,write,edit,bash,delegate_task,delegate_coordinate`. Enter `fleet example`, then `/subagent-hub`. `/fleet-theme dark` and `/fleet-theme light` switch themes. `fleet coordinate <JSON>` calls the coordination tool. The example writes `fleet-output.txt`; it is not loaded by the package manifest.
|
|
487
|
+
|
|
488
|
+
### Saved output
|
|
489
|
+
|
|
490
|
+
New files live under the parent session directory:
|
|
491
|
+
|
|
492
|
+
```text
|
|
493
|
+
delegation/<parent-session-id>/<task-id>/
|
|
494
|
+
agent/ # scoped child runtime cache location, no copied credentials
|
|
495
|
+
transcripts/<new-id>.jsonl # actual SDK messages/tool results
|
|
496
|
+
result.txt # complete last-assistant text after drain (when referenced)
|
|
497
|
+
structured.json # accepted JSON value, if supplied (when referenced)
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
Completed generations keep their own immutable files. New generations use `<task-id>-g<generation>/`. Old `extended-subagents-proof` data is left untouched and is not loaded or migrated. SDK hosts must emit the public shutdown lifecycle before disposal; bare `session.dispose()` does not perform that cleanup.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The complete-resource-loader shape in `src/coordinator.ts` is adapted from Pi 1.5.2’s `examples/sdk/12-full-control.ts` (earendil-works/pi, commit b4afdddf44e059c67ccf5097e5317d913521b470).
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2025 Mario Zechner
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|