pi-herdsman 0.3.2 → 0.5.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 +18 -6
- package/SKILL.md +18 -16
- package/dist/index.js +83 -84
- package/docs/agent-api.md +1 -1
- package/docs/assets/banner.webp +0 -0
- package/docs/assets/thumbnail.webp +0 -0
- package/docs/concepts/agents.md +15 -16
- package/docs/concepts/lifecycle.md +5 -5
- package/docs/concepts/supervision.md +1 -1
- package/docs/development/documentation.md +1 -1
- package/docs/development/smoke-testing.md +17 -12
- package/docs/getting-started.md +8 -9
- package/docs/guides/agent-definitions.md +40 -14
- package/docs/guides/customizing-agents.md +1 -1
- package/docs/guides/handoffs.md +54 -20
- package/docs/guides/recovery.md +8 -7
- package/docs/reference/agent-definition-schema.md +13 -5
- package/docs/reference/agent.md +32 -37
- package/docs/reference/commands.md +7 -7
- package/docs/reference/configuration.md +48 -108
- package/docs/reference/errors.md +1 -1
- package/package.json +7 -6
package/docs/agent-api.md
CHANGED
|
@@ -78,7 +78,7 @@ question.
|
|
|
78
78
|
|
|
79
79
|
## Pass evidence through handoffs
|
|
80
80
|
|
|
81
|
-
Read [Handoffs and files](guides/handoffs.md) for `files`, result
|
|
81
|
+
Read [Handoffs and files](guides/handoffs.md) for `files`, result references, body
|
|
82
82
|
references, and coordination artifacts. That guide owns the evidence-transfer
|
|
83
83
|
workflow; the `agent` reference owns the accepted request fields.
|
|
84
84
|
|
package/docs/assets/banner.webp
CHANGED
|
Binary file
|
|
Binary file
|
package/docs/concepts/agents.md
CHANGED
|
@@ -32,8 +32,9 @@ my-review
|
|
|
32
32
|
|
|
33
33
|
Use the exact `agent` value from `agent list` only for
|
|
34
34
|
`steer.agent`, `reply.agent`, or `close.agent` while those actions are listed
|
|
35
|
-
in `available_actions`. An agent label is the
|
|
36
|
-
|
|
35
|
+
in `available_actions`. An agent label is the stable logical name across
|
|
36
|
+
sequential generations of one managed session, not a continuation selector.
|
|
37
|
+
It is a control target only for the currently live generation.
|
|
37
38
|
|
|
38
39
|
Labels must begin with a lowercase letter, contain only lowercase letters,
|
|
39
40
|
digits, `_`, or `-`, and be at most 32 characters.
|
|
@@ -43,14 +44,13 @@ digits, `_`, or `-`, and be at most 32 characters.
|
|
|
43
44
|
Every managed agent has an exact Pi session. The list may expose the session
|
|
44
45
|
ID and path for correlation.
|
|
45
46
|
|
|
46
|
-
A session path or full UUID can be supplied
|
|
47
|
-
historical work.
|
|
48
|
-
assignment and uses the saved session's cwd
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
blocks concurrent activation of that session.
|
|
47
|
+
A session path or full UUID can be supplied to the `continue` action to continue
|
|
48
|
+
historical work. Continuation creates a new agent generation for one new
|
|
49
|
+
assignment and uses the saved session's cwd, definition, logical label, and
|
|
50
|
+
historical context. The caller cannot rename the continued session. The Pi
|
|
51
|
+
session remains the continuation identity, not a live-control identity. An
|
|
52
|
+
exact active or unresolved managed representation blocks concurrent activation
|
|
53
|
+
of that session.
|
|
54
54
|
|
|
55
55
|
### herdr identities
|
|
56
56
|
|
|
@@ -104,18 +104,17 @@ and runtime state are cleaned up. Failed assignments follow the same terminal
|
|
|
104
104
|
cleanup path.
|
|
105
105
|
|
|
106
106
|
The Pi session remains available after agent cleanup. To continue the same
|
|
107
|
-
conversational context,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
delegation.
|
|
107
|
+
conversational context, use `continue` with the exact session ID or session path
|
|
108
|
+
returned with the result. This creates a new agent generation, which uses the
|
|
109
|
+
current effective authorized configuration for the saved agent definition. To
|
|
110
|
+
derive a separate context instead, use `fork` on a `delegate` action.
|
|
112
111
|
|
|
113
112
|
The identities are therefore:
|
|
114
113
|
|
|
115
114
|
```text
|
|
116
115
|
agent definition → configuration for new work
|
|
117
116
|
Pi session → durable conversational context and continuation identity
|
|
118
|
-
agent label → live control
|
|
117
|
+
agent label → stable logical name across sequential generations; live control target only for the current generation
|
|
119
118
|
```
|
|
120
119
|
|
|
121
120
|
## See also
|
|
@@ -102,11 +102,11 @@ exactly-once delivery for both completed and failed terminal results.
|
|
|
102
102
|
## Session continuation
|
|
103
103
|
|
|
104
104
|
Agent cleanup does not delete the Pi session. To continue completed context,
|
|
105
|
-
use the exact returned session with `
|
|
106
|
-
|
|
107
|
-
and
|
|
108
|
-
|
|
109
|
-
session is required.
|
|
105
|
+
use the exact returned session with `continue`; Pi Herdsman starts a new agent
|
|
106
|
+
generation for the new assignment. The continuation uses the saved cwd, session
|
|
107
|
+
history, definition, and logical label together with the current effective
|
|
108
|
+
authorized definition configuration. The caller cannot rename the continued
|
|
109
|
+
session. Use `delegate` with `fork` when a separate derived session is required.
|
|
110
110
|
Session continuation does not retain the old Herdr tab. A still-live
|
|
111
111
|
generation may be restored from its exact managed identity, while ordinary
|
|
112
112
|
same-workspace tab movement remains presentation-only and does not change
|
|
@@ -60,7 +60,7 @@ correlated `staff reply`; a reply clears the pending ask only after accepted
|
|
|
60
60
|
follow-up delivery. A replacement chief can answer an existing ask using its
|
|
61
61
|
current lease and unchanged ask ID. Chief and staff message actions accept
|
|
62
62
|
files; their text is prepared with the same canonical attachment renderer and
|
|
63
|
-
configured
|
|
63
|
+
configured Herdsman byte limits as agent messages, while durable supervision
|
|
64
64
|
records remain text-only.
|
|
65
65
|
|
|
66
66
|
## Supervision state
|
|
@@ -121,7 +121,7 @@ registry, or another synchronization subsystem.
|
|
|
121
121
|
- One H1 per file.
|
|
122
122
|
- Short descriptive headings.
|
|
123
123
|
- Current behavior only.
|
|
124
|
-
- Spell the visible product name `Pi Herdsman`, the package and repository identifier `pi-herdsman`, the local coordination directory `.pi-herdsman`, the
|
|
124
|
+
- Spell the visible product name `Pi Herdsman`, the package and repository identifier `pi-herdsman`, the local coordination directory `.pi-herdsman`, the configuration file `config.json`, and the upstream dependency `herdr`.
|
|
125
125
|
- No backlog task numbers in product docs.
|
|
126
126
|
- Keep canonical user and reference pages focused on current behavior.
|
|
127
127
|
- Examples must match current accepted schemas.
|
|
@@ -15,16 +15,19 @@ Verify:
|
|
|
15
15
|
```sh
|
|
16
16
|
node --version
|
|
17
17
|
pi --version
|
|
18
|
-
herdr --
|
|
18
|
+
herdr status --json
|
|
19
19
|
herdr integration status
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
The `herdr status --json` output is the Herdr 0.9 CLI protocol compatibility
|
|
23
|
+
preflight. It must report a Herdr client version of `>=0.9.0`,
|
|
24
|
+
`server.running` as `true`, and `server.compatible` as `true`.
|
|
25
|
+
|
|
22
26
|
The supported repository contract requires:
|
|
23
27
|
|
|
24
28
|
- Node `>=22.19.0`
|
|
25
29
|
- Pi `>=0.84.2 <0.86.0`
|
|
26
|
-
- herdr `>=0.
|
|
27
|
-
- herdr Pi integration version `2` or newer
|
|
30
|
+
- herdr `>=0.9.0`
|
|
28
31
|
|
|
29
32
|
Run focused tests and other intermediate checks before this smoke suite. Do
|
|
30
33
|
not format during smoke testing; complete smoke testing and review before the
|
|
@@ -55,7 +58,7 @@ Use the exact returned session ID or path for a follow-up assignment:
|
|
|
55
58
|
|
|
56
59
|
```json
|
|
57
60
|
{
|
|
58
|
-
"action": "
|
|
61
|
+
"action": "continue",
|
|
59
62
|
"session": "<exact session>",
|
|
60
63
|
"task": "Continue the investigation with one short follow-up."
|
|
61
64
|
}
|
|
@@ -65,25 +68,27 @@ Verify:
|
|
|
65
68
|
|
|
66
69
|
- the same Pi session and session file are used;
|
|
67
70
|
- a new agent generation, run ID, request ID, and pane are created;
|
|
71
|
+
- the saved logical label is reused exactly (there is no continuation label override);
|
|
68
72
|
- the saved conversation context is available;
|
|
69
73
|
- the current effective definition configuration is used;
|
|
70
74
|
- exactly one result reaches the owner;
|
|
71
75
|
- cleanup removes the second agent, pane, mailbox, and runtime.
|
|
72
76
|
|
|
73
|
-
While the continuation assignment is active, submit another
|
|
74
|
-
|
|
77
|
+
While the continuation assignment is active, submit another `continue` request
|
|
78
|
+
for the same exact session. Verify it fails with
|
|
75
79
|
`agent_busy`, creates no duplicate agent or pane, and leaves the active
|
|
76
80
|
assignment unchanged. After both assignments finish, `agent list` must show
|
|
77
81
|
no completed idle agent.
|
|
78
82
|
|
|
79
|
-
## Historical session
|
|
83
|
+
## Historical session continuation
|
|
80
84
|
|
|
81
85
|
Use an exact saved session path or full UUID.
|
|
82
86
|
|
|
83
87
|
Verify:
|
|
84
88
|
|
|
85
89
|
- saved definition and cwd are respected;
|
|
86
|
-
-
|
|
90
|
+
- the saved logical label is reused exactly;
|
|
91
|
+
- session continuation uses the saved cwd;
|
|
87
92
|
- current effective agent override values are used for the new agent
|
|
88
93
|
generation;
|
|
89
94
|
- the exact session continues.
|
|
@@ -189,9 +194,9 @@ Verify the native Definitions selector shows:
|
|
|
189
194
|
Structured `agent list` should still retain exact deterministic metadata.
|
|
190
195
|
|
|
191
196
|
Select a disposable bundled, project, or global definition and change its
|
|
192
|
-
model, thinking, and enabled state. Confirm that project discovery requires
|
|
193
|
-
|
|
194
|
-
|
|
197
|
+
model, thinking, and enabled state. Confirm that project discovery requires Pi
|
|
198
|
+
project trust and that these edits write global overrides only, not project
|
|
199
|
+
files.
|
|
195
200
|
|
|
196
201
|
Verify unrelated frontmatter and body remain unchanged, `Use default` removes
|
|
197
202
|
only the selected field, fresh definition delegations and session continuations
|
|
@@ -249,7 +254,7 @@ substitutes for these checks.
|
|
|
249
254
|
| Discover leads across multiple workspaces | NOT RUN |
|
|
250
255
|
| Exclude managed agents and the active Chief from leads | NOT RUN |
|
|
251
256
|
| Agent exclusion uses the production validated snapshot and stale/ambiguous generations fail closed | NOT RUN |
|
|
252
|
-
| Herdr `agent_status
|
|
257
|
+
| Herdr `agent_status` lifecycle normalization is reflected | NOT RUN |
|
|
253
258
|
| Nested agent aggregation attaches only to the proven lead | NOT RUN |
|
|
254
259
|
| A blocked agent does not mark its lead `needs you` | NOT RUN |
|
|
255
260
|
| Duplicate live agents, coordination records, or agent evidence fail closed | NOT RUN |
|
package/docs/getting-started.md
CHANGED
|
@@ -10,9 +10,8 @@ path.
|
|
|
10
10
|
|
|
11
11
|
You need:
|
|
12
12
|
|
|
13
|
-
- [herdr](https://github.com/herdrdev/herdr) `>=0.
|
|
13
|
+
- [herdr](https://github.com/herdrdev/herdr) `>=0.9.0`;
|
|
14
14
|
- Pi `>=0.84.2 <0.86.0` (the version range tested for this release);
|
|
15
|
-
- herdr Pi integration version `2` or newer;
|
|
16
15
|
- Node `>=22.19.0`.
|
|
17
16
|
|
|
18
17
|
Install or refresh the herdr Pi integration:
|
|
@@ -83,10 +82,10 @@ Stop all…
|
|
|
83
82
|
|
|
84
83
|
`Running` is the complete authoritative live-agent inventory and focuses the
|
|
85
84
|
selected pane directly. `Definitions` manages the effective bundled, project,
|
|
86
|
-
and global agent definitions.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
and global agent definitions. Trusted projects contribute definitions from
|
|
86
|
+
`.pi/agents/`; effective precedence is bundled < project < global. `Layout`
|
|
87
|
+
controls whether newly started agents use tabs or splits. `Stop all…` is
|
|
88
|
+
destructive emergency control.
|
|
90
89
|
|
|
91
90
|
See [`/agents` commands](reference/commands.md) for exact behavior.
|
|
92
91
|
|
|
@@ -127,9 +126,9 @@ See [Status widget](reference/status-widget.md) for exact state, refresh, and
|
|
|
127
126
|
rendering behavior.
|
|
128
127
|
|
|
129
128
|
To continue a completed assignment with its existing conversational context,
|
|
130
|
-
use the exact `session_id` returned with its result in a new `
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
use the exact `session_id` returned with its result in a new `continue` request.
|
|
130
|
+
This starts a new agent generation with the saved session and current effective
|
|
131
|
+
definition configuration.
|
|
133
132
|
|
|
134
133
|
## 7. Recover only when needed
|
|
135
134
|
|
|
@@ -29,26 +29,23 @@ Project definitions are optional and live in the current project:
|
|
|
29
29
|
<cwd>/.pi/agents/
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Pi Herdsman discovers project definitions when Pi considers the project
|
|
33
|
+
trusted. Precedence is:
|
|
33
34
|
|
|
34
35
|
```text
|
|
35
|
-
|
|
36
|
-
├── settings.json
|
|
37
|
-
└── agents/
|
|
38
|
-
└── reviewer.md
|
|
36
|
+
bundled < project < global
|
|
39
37
|
```
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
Global definitions remain final user policy. For example:
|
|
42
40
|
|
|
43
|
-
```
|
|
44
|
-
|
|
41
|
+
```text
|
|
42
|
+
.pi/
|
|
43
|
+
└── agents/
|
|
44
|
+
└── reviewer.md
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
global definitions remain final user policy. Project definitions apply only to
|
|
50
|
-
their project cwd, and the Definitions UI writes global overrides, never
|
|
51
|
-
project files.
|
|
47
|
+
Project definitions apply only to their project cwd, and the Definitions UI
|
|
48
|
+
writes global overrides, never project files.
|
|
52
49
|
|
|
53
50
|
When Pi uses a custom agent directory, the global definitions live under that
|
|
54
51
|
agent directory's `agents/` subdirectory.
|
|
@@ -56,6 +53,35 @@ agent directory's `agents/` subdirectory.
|
|
|
56
53
|
A project or global definition whose `name` matches a lower-precedence
|
|
57
54
|
definition overlays it. An unmatched definition is standalone.
|
|
58
55
|
|
|
56
|
+
### Permission-aware extensions
|
|
57
|
+
|
|
58
|
+
Agent definitions may include a `permission:` mapping for compatible
|
|
59
|
+
permission-aware Pi extensions.
|
|
60
|
+
|
|
61
|
+
[`pi-permission-system`](https://github.com/gotgenes/pi-packages/tree/main/packages/pi-permission-system)
|
|
62
|
+
can consume the same global or trusted project-local agent definition as Pi
|
|
63
|
+
Herdsman:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
---
|
|
67
|
+
name: reviewer
|
|
68
|
+
tools: ["read", "ls", "find", "grep"]
|
|
69
|
+
permission:
|
|
70
|
+
"*": deny
|
|
71
|
+
read: allow
|
|
72
|
+
ls: allow
|
|
73
|
+
find: allow
|
|
74
|
+
grep: allow
|
|
75
|
+
---
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Pi Herdsman accepts and preserves `permission:` but does not evaluate its
|
|
79
|
+
contents or make authorization decisions from it. Managed agents also publish
|
|
80
|
+
the conventional active-agent identity and subagent lineage metadata used by
|
|
81
|
+
compatible extensions. Permission policy is effective only when the
|
|
82
|
+
compatible permission extension is loaded in that Pi session. The permission
|
|
83
|
+
extension is optional; Pi Herdsman does not install or depend on it.
|
|
84
|
+
|
|
59
85
|
## Enable or disable a definition
|
|
60
86
|
|
|
61
87
|
Definitions are enabled by default. Set `enabled: false` in a matching project
|
|
@@ -76,7 +102,7 @@ referencing a disabled definition can remain discoverable, but is rejected durin
|
|
|
76
102
|
assignment or fresh agent startup with an explicit disabled-definition reason
|
|
77
103
|
rather than silently dropping that definition.
|
|
78
104
|
|
|
79
|
-
|
|
105
|
+
`delegate` and `continue` reject disabled definitions with an
|
|
80
106
|
actionable error. An already active agent may finish and remains controllable
|
|
81
107
|
according to its current available actions; disabling a definition does not
|
|
82
108
|
mutate that assignment.
|
|
@@ -229,7 +229,7 @@ Enable and disable write the scalar `enabled` field in the same global override.
|
|
|
229
229
|
Removing that field inherits the bundled value, or `true` when no source
|
|
230
230
|
declares it.
|
|
231
231
|
|
|
232
|
-
Changes affect future
|
|
232
|
+
Changes affect future `delegate` assignments and `continue` assignments, whose
|
|
233
233
|
runtime configuration comes from the current effective definition. They do not
|
|
234
234
|
mutate an already-running agent or the lead Pi session.
|
|
235
235
|
|
package/docs/guides/handoffs.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Pi Herdsman has two text-file mechanisms with different purposes:
|
|
6
6
|
|
|
7
|
-
- `files` supplies evidence to delegate
|
|
7
|
+
- `files` supplies evidence to delegate, continue, steer, reply,
|
|
8
8
|
or ask_owner.
|
|
9
9
|
- whole-line body `@file` references put definition-owned text into the agent
|
|
10
10
|
system prompt when a new agent generation is built.
|
|
@@ -14,7 +14,7 @@ canonical local references and are not copied or snapshotted.
|
|
|
14
14
|
|
|
15
15
|
## Message `files`
|
|
16
16
|
|
|
17
|
-
For `delegate
|
|
17
|
+
For `delegate`, `continue`, `steer`, and
|
|
18
18
|
`reply`, make the message self-contained. Do not attach or mention agent
|
|
19
19
|
instruction files such as `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, or equivalents
|
|
20
20
|
merely because they exist; rely on normal project or runtime discovery.
|
|
@@ -34,7 +34,10 @@ Example:
|
|
|
34
34
|
"action": "delegate",
|
|
35
35
|
"definition": "reviewer",
|
|
36
36
|
"task": "Review the implementation against the approved plan.",
|
|
37
|
-
"files": [
|
|
37
|
+
"files": [
|
|
38
|
+
".pi-herdsman/plan.md",
|
|
39
|
+
"result:550e8400-e29b-41d4-a716-446655440000"
|
|
40
|
+
]
|
|
38
41
|
}
|
|
39
42
|
```
|
|
40
43
|
|
|
@@ -52,17 +55,35 @@ A reference-only file uses a self-closing tag:
|
|
|
52
55
|
<file name="/absolute/canonical/path" bytes="123" />
|
|
53
56
|
```
|
|
54
57
|
|
|
55
|
-
`name` is the canonical absolute path and `bytes` is the
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
content remains raw text. This markup frames evidence for the model and is not
|
|
59
|
-
a security boundary.
|
|
58
|
+
For an ordinary file, `name` is the canonical absolute path and `bytes` is the
|
|
59
|
+
observed file size. For a result reference, an embedded file uses the exact
|
|
60
|
+
`result:<request-id>` as `name`:
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
```xml
|
|
63
|
+
<file name="result:550e8400-e29b-41d4-a716-446655440000" bytes="123">
|
|
64
|
+
contents
|
|
65
|
+
</file>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A result that is supplied by reference keeps both identities in its
|
|
69
|
+
self-closing envelope:
|
|
70
|
+
|
|
71
|
+
```xml
|
|
72
|
+
<file name="result:550e8400-e29b-41d4-a716-446655440000" path="/absolute/canonical/path" bytes="123" />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
A body means the complete submission-time UTF-8 snapshot was embedded. For an
|
|
76
|
+
ordinary file, a self-closing tag carries its canonical path and observed byte
|
|
77
|
+
size; for a result reference, it carries the logical result name, the physical
|
|
78
|
+
path attribute, and observed byte size. File content remains raw text. This
|
|
79
|
+
markup frames evidence for the model and is not a security boundary.
|
|
80
|
+
|
|
81
|
+
`files` is supported by `delegate`, `continue`,
|
|
62
82
|
`steer`, `reply`, and `ask_owner`. For
|
|
63
83
|
controller actions, relative paths resolve from the calling controller's cwd;
|
|
64
|
-
for `ask_owner`, they resolve from the managed agent's cwd.
|
|
65
|
-
|
|
84
|
+
for `ask_owner`, they resolve from the managed agent's cwd. Accepted ordinary
|
|
85
|
+
filesystem paths retain canonical absolute-path names; `result:<request-id>`
|
|
86
|
+
inputs retain the logical result reference as the model-facing name.
|
|
66
87
|
|
|
67
88
|
Supplied paths must resolve to readable regular files. Missing, broken,
|
|
68
89
|
unreadable, and non-regular paths reject the whole operation. Canonical
|
|
@@ -79,8 +100,10 @@ For each regular file:
|
|
|
79
100
|
|
|
80
101
|
- complete strict UTF-8 text without NUL bytes is embedded when the complete
|
|
81
102
|
message fits the effective configured `mailboxPayloadLimitBytes` boundary;
|
|
82
|
-
- invalid UTF-8, NUL-containing, binary, and non-fitting files are
|
|
83
|
-
only by
|
|
103
|
+
- invalid UTF-8, NUL-containing, binary, and non-fitting ordinary files are
|
|
104
|
+
represented only by their canonical local path and observed byte size;
|
|
105
|
+
result references retain their logical name and carry the physical path and
|
|
106
|
+
observed byte size.
|
|
84
107
|
|
|
85
108
|
The fixed 1 MiB mailbox protocol safety ceiling is a separate read limit for
|
|
86
109
|
mailbox records; it does not replace the configured admission limit for new
|
|
@@ -92,7 +115,10 @@ or disappear after submission, and the recipient must already have local
|
|
|
92
115
|
filesystem/tool access to inspect them. `files` supplies evidence and does not
|
|
93
116
|
grant runtime capabilities.
|
|
94
117
|
|
|
95
|
-
Files are read through their canonical `realpath` target.
|
|
118
|
+
Files are read through their canonical `realpath` target. Ordinary file inputs
|
|
119
|
+
are rendered with that canonical path; result references retain the
|
|
120
|
+
`result:<request-id>` name so recipients can pass the same reference through
|
|
121
|
+
`files` again.
|
|
96
122
|
|
|
97
123
|
## Canonical deduplication
|
|
98
124
|
|
|
@@ -184,22 +210,30 @@ definition configuration while preserving the saved Pi session context.
|
|
|
184
210
|
|
|
185
211
|
## Result handoff
|
|
186
212
|
|
|
187
|
-
Successful agent completion
|
|
213
|
+
Successful agent completion exposes a canonical `resultRef` such as
|
|
214
|
+
`result:550e8400-e29b-41d4-a716-446655440000`.
|
|
188
215
|
|
|
189
|
-
|
|
190
|
-
|
|
216
|
+
Pass the exact result reference directly through `files` rather than copying a
|
|
217
|
+
large result or reconstructing its physical path:
|
|
191
218
|
|
|
192
219
|
```json
|
|
193
220
|
{
|
|
194
221
|
"action": "delegate",
|
|
195
222
|
"definition": "reviewer",
|
|
196
223
|
"task": "Review the implementation described in the supplied result.",
|
|
197
|
-
"files": ["
|
|
224
|
+
"files": ["result:550e8400-e29b-41d4-a716-446655440000"]
|
|
198
225
|
}
|
|
199
226
|
```
|
|
200
227
|
|
|
201
|
-
|
|
202
|
-
|
|
228
|
+
`files` accepts ordinary readable regular local file paths and result
|
|
229
|
+
references. A result reference resolves internally to the normal private
|
|
230
|
+
result file under Pi Herdsman's durable data directory; it is still validated,
|
|
231
|
+
canonicalized, and deduplicated like any other file. Copy the exact reference
|
|
232
|
+
returned by completion. Do not guess or reconstruct the underlying path.
|
|
233
|
+
Completion results live under Pi's agent data directory
|
|
234
|
+
(`~/.pi/agent/pi-herdsman/results` by default, respecting Pi's configured agent
|
|
235
|
+
directory) rather than the OS temporary directory, so result handoffs are not
|
|
236
|
+
subject to temporary-directory cleanup.
|
|
203
237
|
Oversized non-completion registered-tool output may additionally expose
|
|
204
238
|
`full_output_path` when overflow persistence succeeds. Model-visible content
|
|
205
239
|
remains bounded in both cases.
|
package/docs/guides/recovery.md
CHANGED
|
@@ -65,7 +65,7 @@ Do not close solely because of inactivity.
|
|
|
65
65
|
|
|
66
66
|
## Startup failure
|
|
67
67
|
|
|
68
|
-
Fresh and historical-session
|
|
68
|
+
Fresh delegation and historical-session continuation startup is bounded.
|
|
69
69
|
|
|
70
70
|
When herdr returns a structured failure, Pi Herdsman preserves it. When startup
|
|
71
71
|
returns empty or malformed output and no better structured error is available,
|
|
@@ -116,16 +116,17 @@ not the normal model orchestration interface.
|
|
|
116
116
|
|
|
117
117
|
## Historical session failure
|
|
118
118
|
|
|
119
|
-
A `
|
|
119
|
+
A `continue` requires an exact session path or full UUID.
|
|
120
120
|
|
|
121
121
|
The saved session header must contain a non-empty working directory. Session
|
|
122
|
-
|
|
122
|
+
continuation uses that saved cwd and does not accept a caller-supplied `cwd`.
|
|
123
123
|
|
|
124
|
-
The saved agent-definition name
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
The saved agent-definition name and logical label are restored from the managed
|
|
125
|
+
session identity. If the definition no longer exists, continuation fails instead
|
|
126
|
+
of guessing a replacement; a missing or malformed session identity also fails
|
|
127
|
+
closed. The definition must also be enabled and authorized for the current
|
|
127
128
|
controller, and its current effective configuration is used for the new agent
|
|
128
|
-
generation.
|
|
129
|
+
generation. Continuation cannot override or regenerate its saved label.
|
|
129
130
|
|
|
130
131
|
An exact session that is already represented by active or unresolved managed
|
|
131
132
|
work cannot be activated concurrently. The session-start exclusion applies to
|
|
@@ -57,15 +57,15 @@ Global definitions by default:
|
|
|
57
57
|
A matching project or global name overlays the lower-precedence definition.
|
|
58
58
|
|
|
59
59
|
An unmatched project or global definition is standalone. Project definitions
|
|
60
|
-
are loaded from `<cwd>/.pi/agents/`
|
|
61
|
-
|
|
60
|
+
are loaded from `<cwd>/.pi/agents/` when Pi considers the project trusted.
|
|
61
|
+
Precedence is `bundled < project < global`.
|
|
62
62
|
|
|
63
63
|
All effective definitions are sorted and validated together, including every
|
|
64
64
|
`agents` reference.
|
|
65
65
|
|
|
66
66
|
`enabled` controls definition availability. A disabled definition remains in the
|
|
67
67
|
lead roster so it can be enabled again, but owner-visible definition lists omit
|
|
68
|
-
it.
|
|
68
|
+
it. `delegate` and `continue` reject a disabled definition. An already
|
|
69
69
|
active agent may finish and remains controllable according to its current
|
|
70
70
|
available actions; disabling a definition does not mutate that assignment.
|
|
71
71
|
|
|
@@ -74,7 +74,7 @@ available actions; disabling a definition does not mutate that assignment.
|
|
|
74
74
|
| Field | Accepted value | Omitted/default behavior | Runtime/composition behavior |
|
|
75
75
|
| ----------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
76
76
|
| `name` | non-empty string | required | Effective definition identity. |
|
|
77
|
-
| `enabled` | boolean | `true` | `false` makes
|
|
77
|
+
| `enabled` | boolean | `true` | `false` makes `delegate` and `continue` unavailable; it does not mutate an active agent. |
|
|
78
78
|
| `description` | string | absent | Display/selection description. |
|
|
79
79
|
| `model` | non-empty string | Pi default/current launch behavior | Passed as Pi model selection. |
|
|
80
80
|
| `thinking` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`, or `false` | Pi default/current launch behavior | `false` launches as `off`. |
|
|
@@ -84,6 +84,7 @@ available actions; disabling a definition does not mutate that assignment.
|
|
|
84
84
|
| `noBuiltinTools` | boolean | Pi normal built-in tool policy | `true` emits `--no-builtin-tools`. |
|
|
85
85
|
| `tools` | array of non-empty strings | no explicit allowlist | Passed to Pi as a source-agnostic tool-name allowlist; matching overlay replaces whole array. |
|
|
86
86
|
| `excludeTools` | array of non-empty strings | no explicit exclusions | Passed to Pi as source-agnostic tool-name exclusions; matching override replaces whole array. |
|
|
87
|
+
| `permission` | mapping | absent | Opaque interoperability policy for permission-aware extensions; Pi Herdsman does not evaluate it. |
|
|
87
88
|
| `noSkills` | boolean | skills disabled unless `inheritSkills: true` | Controls Pi native skill discovery; explicit `skills` values are still passed separately. |
|
|
88
89
|
| `inheritSkills` | boolean | does not enable by itself unless `true` | `true` changes omitted `noSkills` default so native skills remain available. Explicit `noSkills` wins. |
|
|
89
90
|
| `skills` | array of non-empty strings | no explicit skill arguments | Each value is passed unchanged as a Pi skill path/resource. |
|
|
@@ -93,6 +94,10 @@ available actions; disabling a definition does not mutate that assignment.
|
|
|
93
94
|
| `inheritProjectContext` | boolean | `true` only for definition name `delegate`; otherwise `false` | Controls project context-file inheritance. |
|
|
94
95
|
| `inheritGlobalContext` | boolean | follows effective `inheritProjectContext` | Controls global context-file inheritance. |
|
|
95
96
|
|
|
97
|
+
`permission` is reserved for compatible permission extensions. Pi Herdsman
|
|
98
|
+
accepts and preserves the mapping but does not validate its internal policy
|
|
99
|
+
schema or make authorization decisions from it.
|
|
100
|
+
|
|
96
101
|
Arrays supplied by an override replace the complete inherited array, including
|
|
97
102
|
an explicit `[]`.
|
|
98
103
|
|
|
@@ -230,10 +235,13 @@ Pi base system prompt
|
|
|
230
235
|
selected project/global context-file additions
|
|
231
236
|
↓
|
|
232
237
|
shared herdr agent guidance
|
|
238
|
+
↓
|
|
239
|
+
<active_agent name="<definition>"/>
|
|
233
240
|
```
|
|
234
241
|
|
|
235
242
|
The final effective body and shared guidance are delivered through private
|
|
236
|
-
temporary prompt snapshots.
|
|
243
|
+
temporary prompt snapshots. The active-agent tag is appended directly as
|
|
244
|
+
interoperability metadata for compatible Pi extensions.
|
|
237
245
|
|
|
238
246
|
## Complete override example
|
|
239
247
|
|