@oai404iao/pi-subagent 0.4.0-alpha.0 → 0.4.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/README.md +102 -72
- package/config.example.json +1 -4
- package/config.schema.json +14 -28
- package/index.ts +2 -0
- package/package.json +9 -8
- package/src/agent-sync.ts +112 -40
- package/src/catalog.ts +14 -16
- package/src/config.ts +15 -52
- package/src/coordinator.ts +114 -422
- package/src/descriptor.ts +51 -81
- package/src/index.ts +57 -88
- package/src/render.ts +5 -15
- package/src/schemas.ts +8 -70
- package/src/task-path.ts +5 -47
- package/src/types.ts +14 -25
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ The design independently adapts the
|
|
|
5
5
|
[DeepSeek Harness subagent seam](https://github.com/deepseek-ai/deepseek-harness/tree/4d03472cd098dc48a630e526ca620f4f37f18a0e/docs/subsystems)
|
|
6
6
|
to Pi's extension and SDK APIs.
|
|
7
7
|
|
|
8
|
-
Peer floor: Pi 0.
|
|
8
|
+
Peer floor: Pi 0.85.1; tested against 0.85.1.
|
|
9
9
|
|
|
10
10
|
> npm identity: `@oai404iao/pi-subagent`. Once the selected version is
|
|
11
11
|
> available on npm, install it from npm; use a local checkout before its
|
|
@@ -19,20 +19,22 @@ Peer floor: Pi 0.84.2; tested against 0.84.2 and 0.85.1.
|
|
|
19
19
|
- **Readable task paths** such as `/root/review/auth`, with relative addressing
|
|
20
20
|
- **Explicit context inheritance**: `fresh`, `all_completed`, or
|
|
21
21
|
`last_n_completed`
|
|
22
|
-
- **
|
|
23
|
-
- foreground one-shot runs return the child's final answer
|
|
24
|
-
- background continuable runs return a readable path and stable agent id
|
|
25
|
-
prompt acceptance
|
|
26
|
-
- **Foreground-only policy** that removes background scheduling and lifecycle
|
|
22
|
+
- **One scheduling mode per session** (`runtimeMode`)
|
|
23
|
+
- `foreground`: one-shot runs return the child's final answer
|
|
24
|
+
- `background`: continuable runs return a readable path and stable agent id
|
|
25
|
+
at prompt acceptance
|
|
26
|
+
- **Foreground-only policy** that removes background scheduling and lifecycle
|
|
27
|
+
controls when `runtimeMode` is `foreground`
|
|
27
28
|
- **Independent context and session** for every child
|
|
28
29
|
- **User-owned agent catalog** with bundled templates used only for
|
|
29
30
|
first-install and package-version initialization
|
|
30
31
|
- **Durable descriptors and lineage** stored in child JSONL sessions
|
|
31
|
-
- **
|
|
32
|
-
|
|
32
|
+
- **Durable mailbox protocol**: enqueue-only `send_message` plus explicit
|
|
33
|
+
`followup_task` turn starts
|
|
33
34
|
- **Quiet durable completion updates** with event-driven `wait_agent`
|
|
34
35
|
- **Control plane** with listing and interruption
|
|
35
|
-
- **Child-to-parent `report` channel** for continuable children
|
|
36
|
+
- **Child-to-parent `report` channel** for continuable children (quiet: it never
|
|
37
|
+
starts a parent turn)
|
|
36
38
|
- **Nested delegation** with an absolute persisted depth limit
|
|
37
39
|
- **Dynamic agent-name enums** generated from the effective user/project catalog
|
|
38
40
|
- **Parallel-safe delegation**: multiple `subagent` calls in one assistant message may overlap
|
|
@@ -65,20 +67,20 @@ For a temporary test:
|
|
|
65
67
|
pi -e /absolute/path/to/pi-extensions/pi-subagent
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
Development
|
|
70
|
+
Development and the supported compatibility floor are pinned to Pi `0.85.1`.
|
|
69
71
|
|
|
70
72
|
## Model-facing tools
|
|
71
73
|
|
|
72
74
|
| Tool | Behavior |
|
|
73
75
|
| --- | --- |
|
|
74
|
-
| `subagent` | Starts a named child with selectable context inheritance.
|
|
75
|
-
| `subagent_fork` | Starts a child with all completed parent turns
|
|
76
|
-
| `send_message` |
|
|
77
|
-
| `followup_task` |
|
|
78
|
-
| `wait_agent` |
|
|
79
|
-
| `interrupt_agent` | Requests cancellation of a live descendant by path or id without deleting its session. Active only
|
|
80
|
-
| `list_agents` | Lists readable descendant paths as `running`, `idle`, or `ready`, including separate `pending=N` task and `updates=N` completion counts. Active only
|
|
81
|
-
| `report` | Child-only return channel. Installed automatically in continuable children. |
|
|
76
|
+
| `subagent` | Starts a named child with selectable context inheritance. In `background` mode it is continuable and returns at prompt acceptance; in `foreground` mode it waits for the final answer. |
|
|
77
|
+
| `subagent_fork` | Starts a child with all completed parent turns and uses the same session scheduling mode. |
|
|
78
|
+
| `send_message` | Durably appends a message to a direct child's FIFO mailbox. It never starts or resumes the child. |
|
|
79
|
+
| `followup_task` | Targets a direct child by path or id, atomically claims the pending FIFO batch, and starts one scheduled turn. |
|
|
80
|
+
| `wait_agent` | Waits event-driven for unread direct-child completions without starting a model turn or consuming a scheduler slot. |
|
|
81
|
+
| `interrupt_agent` | Requests cancellation of a live descendant by path or id without deleting its session. Active only in `background` mode. |
|
|
82
|
+
| `list_agents` | Lists readable descendant paths as `running`, `idle`, or `ready`, including separate `pending=N` task and `updates=N` completion counts. Active only in `background` mode. |
|
|
83
|
+
| `report` | Child-only return channel. Installed automatically in continuable children; the entry is recorded in the parent session without waking it. |
|
|
82
84
|
|
|
83
85
|
The `/subagents` command shows the effective scheduling mode, available agent definitions,
|
|
84
86
|
and the current descendant catalog.
|
|
@@ -102,7 +104,7 @@ Use subagent_fork with planner to plan the change using our completed discussion
|
|
|
102
104
|
List my subagents, then send the scout a follow-up asking for exact call sites.
|
|
103
105
|
```
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
In the default background mode, enqueue first and start explicitly:
|
|
106
108
|
|
|
107
109
|
```text
|
|
108
110
|
Send the scout two mailbox messages, then call followup_task once so it handles
|
|
@@ -112,6 +114,10 @@ its quiet completion update.
|
|
|
112
114
|
|
|
113
115
|
Pi executes sibling tool calls in parallel, so this package deliberately accepts one delegation per `subagent` call instead of embedding a separate `tasks` array.
|
|
114
116
|
|
|
117
|
+
Every child follows the session's `runtimeMode`; there is no per-call background
|
|
118
|
+
flag. Independent foreground calls still execute in parallel within one
|
|
119
|
+
assistant message.
|
|
120
|
+
|
|
115
121
|
### Task paths and context
|
|
116
122
|
|
|
117
123
|
Every new child has an immutable path rooted at `/root`:
|
|
@@ -168,15 +174,15 @@ when fewer than the requested number of explicit completed turns remain.
|
|
|
168
174
|
Context is copied once into a new child session. Descriptor, lineage, mailbox,
|
|
169
175
|
completion, and other plain extension-state entries are not copied.
|
|
170
176
|
|
|
171
|
-
`subagent_fork` is the compatibility shortcut for `all_completed
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
same legacy or mailbox-v2 follow-up lifecycle as a fresh child.
|
|
177
|
+
`subagent_fork` is the compatibility shortcut for `all_completed` and follows
|
|
178
|
+
the session's `runtimeMode` exactly like `subagent`: in `background` mode the
|
|
179
|
+
fork is continuable and uses the same mailbox lifecycle as a fresh child.
|
|
175
180
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
Every child persists descriptor version 4 with its task path, context policy,
|
|
182
|
+
and `runtimeMode`. Descriptors written by earlier releases use retired
|
|
183
|
+
scheduling switches and a background-protocol snapshot; they are **not**
|
|
184
|
+
readable any more. Such sessions stay on disk but appear as a corrupt
|
|
185
|
+
diagnostic in `list_agents` and cannot be addressed by path or id.
|
|
180
186
|
|
|
181
187
|
## Agent definitions
|
|
182
188
|
|
|
@@ -203,8 +209,26 @@ After the current package version has been initialized, the user directory is
|
|
|
203
209
|
authoritative. Same-version startups do not restore missing files or refresh
|
|
204
210
|
changed templates. If the user deletes every agent definition, the effective
|
|
205
211
|
catalog is empty and delegation tools are inactive after restart or `/reload`.
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
|
|
213
|
+
### Deleting a bundled preset
|
|
214
|
+
|
|
215
|
+
Deleting a managed preset file is a durable decision, not a transient one:
|
|
216
|
+
|
|
217
|
+
- every startup compares the manifest with the user agent directory; a managed
|
|
218
|
+
preset that is missing is recorded in `agents-manifest.json` as `retired`;
|
|
219
|
+
- later package-version changes install **new** bundled presets but never
|
|
220
|
+
restore a preset you deleted;
|
|
221
|
+
- presets that were never previously managed are still installed, and a preset
|
|
222
|
+
the user deleted before this version was first run is detected on the next
|
|
223
|
+
startup;
|
|
224
|
+
- recreating the file (for example by copying a backup) makes it a managed
|
|
225
|
+
preset again; from then on an ordinary package-version change refreshes it
|
|
226
|
+
with a backup like any other existing preset;
|
|
227
|
+
- deleting every preset leaves delegation tools inactive after restart or
|
|
228
|
+
`/reload`; run `/subagents` to see the effective catalog.
|
|
229
|
+
|
|
230
|
+
Retirement is reported at startup (`deleted by you (not restored): ...`) and a
|
|
231
|
+
name is dropped from the retirement list once it is no longer bundled.
|
|
208
232
|
|
|
209
233
|
Initialization behavior:
|
|
210
234
|
|
|
@@ -212,8 +236,8 @@ Initialization behavior:
|
|
|
212
236
|
is backed up before the bundled version replaces it.
|
|
213
237
|
2. **Ordinary restart of the same release:** user edits are preserved.
|
|
214
238
|
3. **Plugin update:** differing user presets are backed up, then replaced with the new
|
|
215
|
-
bundled versions.
|
|
216
|
-
trigger a refresh.
|
|
239
|
+
bundled versions. Presets deleted by the user stay deleted. A bundled prompt
|
|
240
|
+
change without a package-version change does not trigger a refresh.
|
|
217
241
|
4. **Retired preset:** a formerly bundled name is backed up and removed so an obsolete
|
|
218
242
|
prompt does not remain silently active.
|
|
219
243
|
5. Files whose names were never managed bundled presets are left untouched.
|
|
@@ -315,12 +339,9 @@ See [`config.example.json`](config.example.json) and [`config.schema.json`](conf
|
|
|
315
339
|
"$schema": "/path/to/pi-subagent/config.schema.json",
|
|
316
340
|
"agentScope": "user",
|
|
317
341
|
"maxDepth": 3,
|
|
318
|
-
"
|
|
319
|
-
"defaultBackground": true,
|
|
342
|
+
"runtimeMode": "background",
|
|
320
343
|
"maxConcurrentBackgroundRuns": 4,
|
|
321
344
|
"maxIdleRuntimes": 0,
|
|
322
|
-
"backgroundProtocol": "legacy",
|
|
323
|
-
"reportDelivery": "wakeup",
|
|
324
345
|
"inheritExtensions": false,
|
|
325
346
|
"openAIIdentity": false,
|
|
326
347
|
"maxOutputBytes": 51200
|
|
@@ -331,21 +352,35 @@ See [`config.example.json`](config.example.json) and [`config.schema.json`](conf
|
|
|
331
352
|
| --- | --- | --- |
|
|
332
353
|
| `agentScope` | `user` | Select user definitions, project definitions, or user definitions followed by project overrides. |
|
|
333
354
|
| `maxDepth` | `3` | Absolute delegation depth; a top-level Pi session is depth 0. |
|
|
334
|
-
| `
|
|
335
|
-
| `defaultBackground` | `true` | Default scheduling for `subagent` calls when background execution is enabled. `subagent_fork` remains foreground unless explicitly requested. |
|
|
355
|
+
| `runtimeMode` | `background` | The single scheduling switch. `background` starts continuable children and exposes their lifecycle tools; `foreground` waits for every child's final answer and removes those tools. |
|
|
336
356
|
| `maxConcurrentBackgroundRuns` | `4` | Maximum continuable subagent turns executing at once in one extension runtime. Additional top-level runs wait in FIFO order; nested work fails at capacity instead of deadlocking its parent turn. |
|
|
337
357
|
| `maxIdleRuntimes` | `0` | Process-wide LRU capacity for settled continuable runtimes. `0` preserves immediate unload; a positive value keeps the most recently used idle runtimes and transparently cold-resumes evicted paths. |
|
|
338
|
-
| `backgroundProtocol` | `legacy` | `legacy` preserves immediate `send_message` turns. `mailbox-v2` makes `send_message` enqueue-only and requires `followup_task` to start a turn. The protocol is snapshotted in each child descriptor. |
|
|
339
|
-
| `reportDelivery` | `wakeup` | Controls explicit `report` calls: `wakeup` starts/queues a parent turn; `quiet` waits for the parent's next turn. Mailbox-v2 completion updates are always quiet. |
|
|
340
358
|
| `inheritExtensions` | `false` | Load other Pi extensions in child runtimes. This package filters itself out; explicit agent tool ceilings still apply. |
|
|
341
359
|
| `openAIIdentity` | `false` | For OpenAI Responses child models, inject only the named `pi-codex-minimal-tools` identity lifecycle inline. Codex Session/Thread/Turn/Window ids remain owned and serialized by that package. |
|
|
342
|
-
| `maxOutputBytes` | `51200` | Cap for parent-visible foreground output, reports, completion updates
|
|
360
|
+
| `maxOutputBytes` | `51200` | Cap for parent-visible foreground output, reports, and completion updates. Full output remains in the child session. |
|
|
343
361
|
|
|
344
362
|
Invalid configuration and unknown child tool names fail loud before the child's first model request.
|
|
345
363
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
364
|
+
### Migrating an existing configuration
|
|
365
|
+
|
|
366
|
+
Earlier releases configured two booleans (`enableRunInBackground`,
|
|
367
|
+
`defaultBackground`) plus a `backgroundProtocol` selector, and 0.2/0.3 added a
|
|
368
|
+
`syncBundledAgents` switch. Every one of them is retired and is now rejected as
|
|
369
|
+
an unknown setting, and the extension never rewrites a configuration file:
|
|
370
|
+
|
|
371
|
+
| Retired key | Replace with |
|
|
372
|
+
| --- | --- |
|
|
373
|
+
| `enableRunInBackground: false` | `runtimeMode: "foreground"` |
|
|
374
|
+
| `enableRunInBackground: true` (or absent) | `runtimeMode: "background"` |
|
|
375
|
+
| `defaultBackground` | nothing; background children are always continuable |
|
|
376
|
+
| `backgroundProtocol` | nothing; the durable mailbox is the only background protocol |
|
|
377
|
+
| `syncBundledAgents` | nothing; template initialization is automatic |
|
|
378
|
+
| `reportDelivery` | nothing; `report` never starts a parent turn |
|
|
379
|
+
|
|
380
|
+
`reportDelivery` was removed together with the parent-wakeup path. A child
|
|
381
|
+
`report` is appended to the parent session (so the parent model sees it on its
|
|
382
|
+
next turn) and displayed in the TUI, but it never starts or queues a parent
|
|
383
|
+
turn. Durable completion updates are read with `wait_agent`.
|
|
349
384
|
|
|
350
385
|
`openAIIdentity` and `inheritExtensions` are independent. The former adds only
|
|
351
386
|
the lightweight Codex identity lifecycle even when normal extension inheritance
|
|
@@ -361,25 +396,23 @@ with an actionable missing-adapter error.
|
|
|
361
396
|
|
|
362
397
|
```json
|
|
363
398
|
{
|
|
364
|
-
"
|
|
399
|
+
"runtimeMode": "foreground"
|
|
365
400
|
}
|
|
366
401
|
```
|
|
367
402
|
|
|
368
403
|
In this mode:
|
|
369
404
|
|
|
370
|
-
- `subagent` always
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
- nested subagents inherit the foreground-only policy through the durable runtime snapshot;
|
|
405
|
+
- `subagent` and `subagent_fork` always wait for the child's final answer;
|
|
406
|
+
- no per-call background flag exists, so a child can never be created continuable;
|
|
407
|
+
- nested subagents inherit the mode through the durable runtime snapshot;
|
|
374
408
|
- `send_message`, `followup_task`, `wait_agent`, `interrupt_agent`, and `list_agents` are removed from the active
|
|
375
409
|
model tool set, including inside nested children;
|
|
376
410
|
- sibling foreground calls may still execute in parallel in one assistant message.
|
|
377
411
|
|
|
378
|
-
`
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
Pi after changing this setting so the active tool set and displayed schema are
|
|
412
|
+
The `/subagents` command remains available for human inspection of historical
|
|
413
|
+
children, but persisted continuable children cannot be resumed until
|
|
414
|
+
`runtimeMode` is set back to `background`. Run `/reload` or restart Pi after
|
|
415
|
+
changing this setting so the active tool set and displayed schema are
|
|
383
416
|
refreshed.
|
|
384
417
|
|
|
385
418
|
## Lifecycle
|
|
@@ -407,17 +440,17 @@ generated once per subagent, recorded in the child's session as `pi-subagent/age
|
|
|
407
440
|
and chained through `parentAgentId` in the descriptor, so children stay addressable
|
|
408
441
|
even when a parent session is forked or re-created. When an activation settles:
|
|
409
442
|
|
|
410
|
-
1.
|
|
411
|
-
appends a quiet completion update to the direct parent's session instead;
|
|
443
|
+
1. the child appends a quiet completion update to the direct parent's session;
|
|
412
444
|
2. once owned descendants are done, the child runtime is either disposed or
|
|
413
445
|
retained in the optional idle LRU;
|
|
414
446
|
3. an unloaded persistent session is `ready`; a retained settled runtime is
|
|
415
447
|
`idle`;
|
|
416
|
-
4.
|
|
417
|
-
|
|
448
|
+
4. `send_message` plus `followup_task` can cold-resume that same session for
|
|
449
|
+
another turn.
|
|
418
450
|
|
|
419
|
-
A child can explicitly call `report` before settlement.
|
|
420
|
-
|
|
451
|
+
A child can explicitly call `report` before settlement. A report is recorded in
|
|
452
|
+
the parent session and never starts or queues a parent turn; it is a content
|
|
453
|
+
channel that is separate from the quiet completion update.
|
|
421
454
|
|
|
422
455
|
Continuable turns share a bounded scheduler. Calls targeting the same durable
|
|
423
456
|
agent are serialized so concurrent messages cannot create multiple cold
|
|
@@ -435,9 +468,9 @@ settlements. Eviction disposes only the runtime; the descriptor, path, context,
|
|
|
435
468
|
session history, task mailbox, and completion mailbox remain durable, so the
|
|
436
469
|
next accepted turn cold-resumes normally.
|
|
437
470
|
|
|
438
|
-
#### Mailbox
|
|
471
|
+
#### Mailbox protocol
|
|
439
472
|
|
|
440
|
-
|
|
473
|
+
The mailbox separates delivery from execution:
|
|
441
474
|
|
|
442
475
|
1. `send_message` appends a bounded message record to the direct child's JSONL
|
|
443
476
|
session and returns its stable message id. It does not create a runtime,
|
|
@@ -476,16 +509,13 @@ order of concurrent `send_message` calls. Each returned `pendingMessages` count
|
|
|
476
509
|
describes that append. If one message must precede another, await the first send
|
|
477
510
|
before starting the next.
|
|
478
511
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
mailbox-v2 child keeps its protocol snapshot. `followup_task` and `wait_agent` remain available
|
|
482
|
-
when such a child exists even if the current default is later changed back to
|
|
483
|
-
legacy.
|
|
512
|
+
The durable mailbox is the only background protocol: `send_message` always
|
|
513
|
+
enqueues and `followup_task` is always required to start the queued batch.
|
|
484
514
|
|
|
485
515
|
`wait_agent` observes only completions written by the current agent's direct
|
|
486
516
|
children. Nested parents consume their own child updates; a root wait does not
|
|
487
|
-
steal grandchild updates.
|
|
488
|
-
|
|
517
|
+
steal grandchild updates. Nothing in this extension wakes a parent turn: work
|
|
518
|
+
continues until the parent reads its mailbox.
|
|
489
519
|
|
|
490
520
|
### Inherited-context boundary
|
|
491
521
|
|
|
@@ -520,10 +550,10 @@ becoming child descriptors or mailbox ownership.
|
|
|
520
550
|
actor-graph residency, orphan handling, and background GC are not implemented.
|
|
521
551
|
- Pi lazily creates a new child JSONL file on its first assistant entry. The
|
|
522
552
|
initial background agent id therefore has a crash window after prompt
|
|
523
|
-
acceptance;
|
|
524
|
-
|
|
525
|
-
-
|
|
526
|
-
`
|
|
553
|
+
acceptance; `send_message` waits for that first durable checkpoint before
|
|
554
|
+
acknowledging an enqueue.
|
|
555
|
+
- A foreground child that is still being created has no mailbox; only
|
|
556
|
+
`runtimeMode: "background"` children accept durable messages.
|
|
527
557
|
- `interrupt_agent` is fire-and-return and relies on Pi's current `AgentSession.abort()` queue behavior.
|
|
528
558
|
- Structured-output delegation is not implemented yet.
|
|
529
559
|
- Continuable starts require a persisted parent session; ephemeral (`--no-session`) parents can use foreground one-shot delegation only.
|
package/config.example.json
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
"$schema": "./config.schema.json",
|
|
3
3
|
"agentScope": "user",
|
|
4
4
|
"maxDepth": 3,
|
|
5
|
-
"
|
|
6
|
-
"defaultBackground": true,
|
|
5
|
+
"runtimeMode": "background",
|
|
7
6
|
"maxConcurrentBackgroundRuns": 4,
|
|
8
7
|
"maxIdleRuntimes": 0,
|
|
9
|
-
"backgroundProtocol": "legacy",
|
|
10
|
-
"reportDelivery": "wakeup",
|
|
11
8
|
"inheritExtensions": false,
|
|
12
9
|
"openAIIdentity": false,
|
|
13
10
|
"maxOutputBytes": 51200
|
package/config.schema.json
CHANGED
|
@@ -13,15 +13,14 @@
|
|
|
13
13
|
},
|
|
14
14
|
"agentScope": {
|
|
15
15
|
"type": "string",
|
|
16
|
-
"enum": [
|
|
16
|
+
"enum": [
|
|
17
|
+
"user",
|
|
18
|
+
"project",
|
|
19
|
+
"both"
|
|
20
|
+
],
|
|
17
21
|
"description": "Select user definitions, project definitions, or user definitions followed by project overrides.",
|
|
18
22
|
"default": "user"
|
|
19
23
|
},
|
|
20
|
-
"syncBundledAgents": {
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"deprecated": true,
|
|
23
|
-
"description": "Retired user-level compatibility key from versions 0.2 and 0.3. It is validated but ignored; template initialization is automatic and bundled definitions are never used at runtime."
|
|
24
|
-
},
|
|
25
24
|
"maxDepth": {
|
|
26
25
|
"type": "integer",
|
|
27
26
|
"minimum": 0,
|
|
@@ -29,15 +28,14 @@
|
|
|
29
28
|
"description": "Absolute delegation depth. A top-level Pi session has depth 0.",
|
|
30
29
|
"default": 3
|
|
31
30
|
},
|
|
32
|
-
"
|
|
33
|
-
"type": "
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"default": true
|
|
31
|
+
"runtimeMode": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"enum": [
|
|
34
|
+
"foreground",
|
|
35
|
+
"background"
|
|
36
|
+
],
|
|
37
|
+
"description": "Single execution mode. foreground waits for every child's final answer and exposes no lifecycle tools; background starts continuable mailbox-v2 children that return a readable path plus durable id.",
|
|
38
|
+
"default": "background"
|
|
41
39
|
},
|
|
42
40
|
"maxConcurrentBackgroundRuns": {
|
|
43
41
|
"type": "integer",
|
|
@@ -53,18 +51,6 @@
|
|
|
53
51
|
"description": "Maximum settled continuable child runtimes retained in the process-wide idle LRU. Zero unloads immediately.",
|
|
54
52
|
"default": 0
|
|
55
53
|
},
|
|
56
|
-
"backgroundProtocol": {
|
|
57
|
-
"type": "string",
|
|
58
|
-
"enum": ["legacy", "mailbox-v2"],
|
|
59
|
-
"description": "Background message protocol. legacy starts or follows a turn from send_message; mailbox-v2 durably enqueues until followup_task explicitly starts one turn.",
|
|
60
|
-
"default": "legacy"
|
|
61
|
-
},
|
|
62
|
-
"reportDelivery": {
|
|
63
|
-
"type": "string",
|
|
64
|
-
"enum": ["wakeup", "quiet"],
|
|
65
|
-
"description": "Whether explicit child reports trigger a parent turn or wait for the parent's next turn. mailbox-v2 completion updates are always quiet.",
|
|
66
|
-
"default": "wakeup"
|
|
67
|
-
},
|
|
68
54
|
"inheritExtensions": {
|
|
69
55
|
"type": "boolean",
|
|
70
56
|
"description": "Load the parent's other Pi extensions in child runtimes. pi-subagent itself is filtered out and explicit agent tool ceilings still apply.",
|
|
@@ -79,7 +65,7 @@
|
|
|
79
65
|
"type": "integer",
|
|
80
66
|
"minimum": 1024,
|
|
81
67
|
"maximum": 1048576,
|
|
82
|
-
"description": "Maximum child output inserted into a parent tool result, report, or
|
|
68
|
+
"description": "Maximum child output inserted into a parent tool result, report, or completion update.",
|
|
83
69
|
"default": 51200
|
|
84
70
|
}
|
|
85
71
|
}
|
package/index.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oai404iao/pi-subagent",
|
|
3
|
-
"version": "0.4.0
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Durable, continuable subagents for Pi with spawn/fork providers and lifecycle controls.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
},
|
|
28
28
|
"pi": {
|
|
29
29
|
"extensions": [
|
|
30
|
-
"./
|
|
30
|
+
"./index.ts"
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@earendil-works/pi-agent-core": ">=0.
|
|
35
|
-
"@earendil-works/pi-ai": ">=0.
|
|
36
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
37
|
-
"@earendil-works/pi-tui": ">=0.
|
|
34
|
+
"@earendil-works/pi-agent-core": ">=0.85.1",
|
|
35
|
+
"@earendil-works/pi-ai": ">=0.85.1",
|
|
36
|
+
"@earendil-works/pi-coding-agent": ">=0.85.1",
|
|
37
|
+
"@earendil-works/pi-tui": ">=0.85.1",
|
|
38
38
|
"typebox": "*"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@oai404iao/pi-codex-minimal-tools": "
|
|
41
|
+
"@oai404iao/pi-codex-minimal-tools": "2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@earendil-works/pi-agent-core": "0.85.1",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"check": "npm run typecheck && npm test"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
|
+
"index.ts",
|
|
59
60
|
"agents/",
|
|
60
61
|
"LICENSES/",
|
|
61
62
|
"provenance/",
|
|
@@ -87,5 +88,5 @@
|
|
|
87
88
|
"optional": true
|
|
88
89
|
}
|
|
89
90
|
},
|
|
90
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "88cb6f56447d88b71232cd764ca5b29251341d23"
|
|
91
92
|
}
|