pi-herdsman 0.1.4 → 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/README.md +33 -29
- package/SKILL.md +81 -70
- package/dist/agent-definitions/{worker.md → generalist.md} +3 -3
- package/dist/agent-definitions/implementer.md +3 -3
- package/dist/agent-definitions/researcher.md +1 -1
- package/dist/agent-definitions/reviewer.md +2 -2
- package/dist/agent-definitions/scout.md +2 -2
- package/dist/index.js +139 -104
- package/docs/README.md +11 -11
- package/docs/agent-api.md +18 -18
- package/docs/concepts/{workers.md → agents.md} +36 -33
- package/docs/concepts/delegation.md +32 -32
- package/docs/concepts/lifecycle.md +26 -26
- package/docs/concepts/supervision.md +15 -11
- package/docs/development/documentation.md +4 -4
- package/docs/development/smoke-testing.md +52 -52
- package/docs/getting-started.md +20 -20
- package/docs/guides/agent-definitions.md +24 -19
- package/docs/guides/customizing-agents.md +14 -12
- package/docs/guides/handoffs.md +47 -17
- package/docs/guides/recovery.md +24 -24
- package/docs/reference/agent-definition-schema.md +40 -37
- package/docs/reference/{worker-states.md → agent-states.md} +17 -17
- package/docs/reference/{worker.md → agent.md} +81 -56
- package/docs/reference/ask-owner.md +23 -23
- package/docs/reference/commands.md +28 -23
- package/docs/reference/configuration.md +16 -13
- package/docs/reference/errors.md +6 -6
- package/docs/reference/status-widget.md +22 -22
- package/docs/reference/supervision.md +54 -19
- package/package.json +6 -4
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
[Documentation index](../README.md)
|
|
4
4
|
|
|
5
5
|
The TUI status widget is a local, display-only projection of exact managed
|
|
6
|
-
|
|
6
|
+
agents plus controller-local transient starting assignments.
|
|
7
7
|
|
|
8
8
|
It does not replace mailbox assignment/result authority.
|
|
9
9
|
|
|
10
10
|
An active chief receives a separate leads-only widget. It shows the
|
|
11
|
-
supervision projection, not managed
|
|
11
|
+
supervision projection, not managed agent rows. Its complete
|
|
12
12
|
overview, peek, and focus behavior is documented in the
|
|
13
13
|
[supervision reference](supervision.md). The two widgets are never combined.
|
|
14
14
|
|
|
@@ -28,16 +28,16 @@ A lead Pi session gets its exact owned subtree view.
|
|
|
28
28
|
|
|
29
29
|
A valid managed leaf can receive an identity-only header.
|
|
30
30
|
|
|
31
|
-
A delegation-enabled
|
|
31
|
+
A delegation-enabled agent can receive its direct-agent counts and rows.
|
|
32
32
|
|
|
33
|
-
Unmanaged or invalid
|
|
33
|
+
Unmanaged or invalid agent environments do not receive the managed widget.
|
|
34
34
|
|
|
35
35
|
## Refresh
|
|
36
36
|
|
|
37
37
|
The widget refreshes managed herdr data plus mailbox state every two seconds.
|
|
38
38
|
|
|
39
39
|
Refresh performs a bounded herdr pane-list lookup to validate the lead
|
|
40
|
-
boundary. It does not add a socket transport or another
|
|
40
|
+
boundary. It does not add a socket transport or another agent-control protocol.
|
|
41
41
|
|
|
42
42
|
A refresh failure never mutates mailbox/control eligibility.
|
|
43
43
|
|
|
@@ -49,12 +49,12 @@ Example:
|
|
|
49
49
|
● herd → implementer → scout
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
The breadcrumb uses validated definition/
|
|
52
|
+
The breadcrumb uses validated definition/agent ancestry.
|
|
53
53
|
|
|
54
|
-
Delegating-
|
|
54
|
+
Delegating-agent and leaf panes append their current Pi active tool names as
|
|
55
55
|
muted bracketed metadata after the current identity, preserving Pi's exact
|
|
56
56
|
order. Lead Pi sessions do not show this metadata. It is local to the current
|
|
57
|
-
pane, is never copied to
|
|
57
|
+
pane, is never copied to agent rows or authoritative agent state, and is
|
|
58
58
|
truncated or omitted before breadcrumb identity is shortened when width is
|
|
59
59
|
limited.
|
|
60
60
|
|
|
@@ -76,7 +76,7 @@ Example:
|
|
|
76
76
|
The header reports exact non-zero lifecycle states in the order `working`,
|
|
77
77
|
`blocked`, `settling`, `starting`, and `unknown`. `starting` is a
|
|
78
78
|
presentation-only count for assignments whose final label and mailbox claim
|
|
79
|
-
are known but whose authoritative
|
|
79
|
+
are known but whose authoritative agent startup has not completed. It is not
|
|
80
80
|
mailbox state, control authority, or Running inventory.
|
|
81
81
|
|
|
82
82
|
Before the first successful refresh, the header says `unavailable`.
|
|
@@ -84,13 +84,13 @@ Before the first successful refresh, the header says `unavailable`.
|
|
|
84
84
|
After a later refresh failure, the widget retains the last valid snapshot and
|
|
85
85
|
marks the header `stale`.
|
|
86
86
|
|
|
87
|
-
Header refresh staleness is not
|
|
87
|
+
Header refresh staleness is not agent inactivity.
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## Agent rows
|
|
90
90
|
|
|
91
|
-
Every visible
|
|
91
|
+
Every visible agent is rendered in a stable tree. Siblings are sorted by
|
|
92
92
|
logical label and use Pi's `├─`, `└─`, and `│` connectors.
|
|
93
|
-
The row shows the agent definition and its exact logical
|
|
93
|
+
The row shows the agent definition and its exact logical agent label
|
|
94
94
|
separately. Recovery-only ancestry evidence is retained by structured status
|
|
95
95
|
paths but is not included in this human projection.
|
|
96
96
|
|
|
@@ -105,12 +105,12 @@ Working rows use `● working`, blocked rows use `◐ blocked`, settling rows us
|
|
|
105
105
|
`◌ settling`, starting rows use `◌ starting`, and unknown rows use `? unknown`.
|
|
106
106
|
Working, settling, and starting animate; blocked and unknown rows are static. A
|
|
107
107
|
starting row is reconciled away
|
|
108
|
-
when authoritative
|
|
108
|
+
when authoritative agent evidence replaces it, and is removed on startup
|
|
109
109
|
failure, rollback, repeated session start, or shutdown.
|
|
110
110
|
|
|
111
|
-
`Running` inspection shows every authoritative
|
|
111
|
+
`Running` inspection shows every authoritative agent row and excludes
|
|
112
112
|
presentation-only starting rows. A terminal result is followed by cleanup; the
|
|
113
|
-
widget does not retain an idle completed
|
|
113
|
+
widget does not retain an idle completed agent.
|
|
114
114
|
|
|
115
115
|
## Optional metadata
|
|
116
116
|
|
|
@@ -121,7 +121,7 @@ Rows can include best-effort:
|
|
|
121
121
|
- compact model;
|
|
122
122
|
- thinking;
|
|
123
123
|
- context percentage;
|
|
124
|
-
-
|
|
124
|
+
- agent type/display metadata.
|
|
125
125
|
|
|
126
126
|
These fields are not control authority.
|
|
127
127
|
|
|
@@ -131,18 +131,18 @@ and bounds every output line by visible Unicode width.
|
|
|
131
131
|
The current widget does **not** claim to display the full effective tool list.
|
|
132
132
|
That remains separate from the definition overview.
|
|
133
133
|
|
|
134
|
-
##
|
|
134
|
+
## Agent inactivity
|
|
135
135
|
|
|
136
|
-
A `working`
|
|
136
|
+
A `working` agent can expose an advisory inactivity marker based on durable
|
|
137
137
|
Pi-observed activity.
|
|
138
138
|
|
|
139
139
|
This is distinct from header `stale`, which means the widget failed to refresh
|
|
140
140
|
its latest snapshot.
|
|
141
141
|
|
|
142
|
-
Neither changes
|
|
142
|
+
Neither changes agent control state.
|
|
143
143
|
|
|
144
144
|
## See also
|
|
145
145
|
|
|
146
|
-
- [
|
|
147
|
-
- [`/
|
|
146
|
+
- [Agent states](agent-states.md)
|
|
147
|
+
- [`/agents definitions`](commands.md#agents-definitions)
|
|
148
148
|
- [Recovery](../guides/recovery.md)
|
|
@@ -22,7 +22,11 @@ directory, keyed by the SHA-256 hash of its exact Pi session ID:
|
|
|
22
22
|
"version": 1,
|
|
23
23
|
"instanceId": "<lead generation>",
|
|
24
24
|
"piSessionId": "<exact Pi session ID>",
|
|
25
|
-
"pendingAsk": {
|
|
25
|
+
"pendingAsk": {
|
|
26
|
+
"askId": "<id>",
|
|
27
|
+
"question": "<text>",
|
|
28
|
+
"text": "<prepared text>"
|
|
29
|
+
},
|
|
26
30
|
"updatedAt": 0
|
|
27
31
|
}
|
|
28
32
|
```
|
|
@@ -31,7 +35,9 @@ directory, keyed by the SHA-256 hash of its exact Pi session ID:
|
|
|
31
35
|
entry is authoritative during lead startup. A fresh `instanceId` is created
|
|
32
36
|
for every initialization. The lead record is checked against exact live
|
|
33
37
|
Herdr/Pi identity; missing, malformed, stale, duplicate, or ambiguous evidence
|
|
34
|
-
fails closed. The record is bounded to
|
|
38
|
+
fails closed. The coordination record is bounded to 16 KiB; individual
|
|
39
|
+
transport message records remain bounded by the fixed 8 KiB supervision record
|
|
40
|
+
ceiling. Questions are limited to 1,024
|
|
35
41
|
characters and 1,024 UTF-8 bytes.
|
|
36
42
|
|
|
37
43
|
The record does not represent scheduling, capacity, permission, or message
|
|
@@ -46,7 +52,7 @@ supervised leads. `/chief leave` restores the session's ordinary tools.
|
|
|
46
52
|
## Lead projection and actions
|
|
47
53
|
|
|
48
54
|
An eligible lead requires one exact live recognized Pi agent, a matching lead
|
|
49
|
-
record, and no chief or validated managed
|
|
55
|
+
record, and no chief or validated managed agent identity. A lead's observed
|
|
50
56
|
runtime state is informational. Every exact-identity-verified live lead has
|
|
51
57
|
`inspect` and `message`, whether it is idle, working, blocked, done, or unknown.
|
|
52
58
|
A pending ask is separate attention state: it projects as `needs_you`, exposes
|
|
@@ -54,12 +60,12 @@ the bounded question and ask ID, and adds `reply`.
|
|
|
54
60
|
|
|
55
61
|
The `staff list` representation contains `lead` (the exact full Pi session ID),
|
|
56
62
|
`display_name` (a presentation-only label), identity fields, `runtime_state`,
|
|
57
|
-
`needs_you`, optional pending-ask fields, `
|
|
63
|
+
`needs_you`, optional pending-ask fields, `agent_counts`, optional
|
|
58
64
|
`last_activity`, and `available_actions`. The automatic
|
|
59
|
-
`<supervision_state>` context is hard-bounded to 16 KiB
|
|
60
|
-
`leads`, `
|
|
61
|
-
|
|
62
|
-
fresh complete roster is required.
|
|
65
|
+
`<supervision_state>` context is state-only and hard-bounded to 16 KiB; it uses
|
|
66
|
+
`leads`, `agent_counts`, and `agents`, not inspect terminal/process evidence.
|
|
67
|
+
Oversized output is truncated only at complete lead records and identifies
|
|
68
|
+
omitted state. Use `staff list` when a fresh complete roster is required.
|
|
63
69
|
|
|
64
70
|
The `lead` value is the exact full Pi session ID shown in a fresh supervision
|
|
65
71
|
snapshot or returned by `staff list`; the `display_name` label is never accepted
|
|
@@ -85,7 +91,10 @@ publication does not change communication authority.
|
|
|
85
91
|
Messages are bounded, versioned JSON files in the target session's hashed
|
|
86
92
|
`inbox/` directory. Each record includes exact sender, target, `leadSessionId`,
|
|
87
93
|
chief lease, kind, ID, text, and `createdAt`; asks and replies also include an
|
|
88
|
-
ask ID.
|
|
94
|
+
ask ID. Attachments are consumed at submission and rendered into the ordinary
|
|
95
|
+
text field using the same canonical file renderer and configured inline/mailbox
|
|
96
|
+
limits as agent messages. The durable supervision record remains text-only.
|
|
97
|
+
Extra fields are rejected. Transport kinds are:
|
|
89
98
|
|
|
90
99
|
```text
|
|
91
100
|
chief_message
|
|
@@ -110,23 +119,36 @@ extra fields. Both actions require a currently valid chief; descendants use
|
|
|
110
119
|
### `message`
|
|
111
120
|
|
|
112
121
|
```json
|
|
113
|
-
{
|
|
122
|
+
{
|
|
123
|
+
"action": "message",
|
|
124
|
+
"message": "Build completed.",
|
|
125
|
+
"files": ["/tmp/result.txt"]
|
|
126
|
+
}
|
|
114
127
|
```
|
|
115
128
|
|
|
116
129
|
Use `message` for meaningful progress, reports, results, warnings, and
|
|
117
130
|
completion. It queues one bounded `chief_message` and does not change lead
|
|
118
131
|
coordination state.
|
|
132
|
+
`message` accepts an optional `files` array. Files use the same submission-time
|
|
133
|
+
canonicalization, UTF-8 embedding, reference fallback, and configured byte
|
|
134
|
+
limits as agent messages.
|
|
119
135
|
|
|
120
136
|
### `ask`
|
|
121
137
|
|
|
122
138
|
```json
|
|
123
|
-
{
|
|
139
|
+
{
|
|
140
|
+
"action": "ask",
|
|
141
|
+
"question": "Should the release include the endpoint?",
|
|
142
|
+
"files": ["/tmp/evidence.md"]
|
|
143
|
+
}
|
|
124
144
|
```
|
|
125
145
|
|
|
126
146
|
Use `ask` only when a chief decision is genuinely required. One pending ask is
|
|
127
|
-
allowed per lead. The call durably records its ask ID and question, then
|
|
128
|
-
the
|
|
129
|
-
|
|
147
|
+
allowed per lead. The call durably records its ask ID and clean question, then
|
|
148
|
+
queues the prepared text. The prepared text, including attachment rendering, is
|
|
149
|
+
persisted before publication so reconciliation can deliver it after a failed
|
|
150
|
+
initial publication. It is a terminating coordination call: make it the final
|
|
151
|
+
tool call of the turn and wait rather than guessing.
|
|
130
152
|
|
|
131
153
|
## `staff`
|
|
132
154
|
|
|
@@ -159,7 +181,12 @@ Returns a fresh supervision projection and fresh `available_actions`.
|
|
|
159
181
|
```
|
|
160
182
|
|
|
161
183
|
Inspect is read-only and requires an active chief and eligible exact lead. It
|
|
162
|
-
returns
|
|
184
|
+
returns live identity-checked terminal/process evidence: Herdr's up to 80
|
|
185
|
+
recent-unwrapped terminal lines with a Herdsman-local 16 KiB byte cap, plus
|
|
186
|
+
separately bounded process evidence. The public
|
|
187
|
+
`recent_output_truncated` boolean is true only when that local byte cap
|
|
188
|
+
truncates the terminal output and false otherwise. It does not expose persisted
|
|
189
|
+
Pi session-message history.
|
|
163
190
|
|
|
164
191
|
### `message`
|
|
165
192
|
|
|
@@ -167,12 +194,14 @@ returns bounded identity-checked recent output and process evidence.
|
|
|
167
194
|
{
|
|
168
195
|
"action": "message",
|
|
169
196
|
"lead": "<exact full Pi session ID shown as lead in a fresh snapshot>",
|
|
170
|
-
"message": "Run checks."
|
|
197
|
+
"message": "Run checks.",
|
|
198
|
+
"files": ["/tmp/checklist.md"]
|
|
171
199
|
}
|
|
172
200
|
```
|
|
173
201
|
|
|
174
202
|
The exact lead must currently expose `message`. Atomic creation of one bounded
|
|
175
203
|
`chief_message` record queues a follow-up and does not wait for completion.
|
|
204
|
+
`staff message` accepts optional `files`.
|
|
176
205
|
|
|
177
206
|
### `reply`
|
|
178
207
|
|
|
@@ -181,12 +210,15 @@ The exact lead must currently expose `message`. Atomic creation of one bounded
|
|
|
181
210
|
"action": "reply",
|
|
182
211
|
"lead": "<exact full Pi session ID shown as lead in a fresh snapshot>",
|
|
183
212
|
"askId": "<exact pending ask ID>",
|
|
184
|
-
"message": "Proceed."
|
|
213
|
+
"message": "Proceed.",
|
|
214
|
+
"files": ["/tmp/decision.md"]
|
|
185
215
|
}
|
|
186
216
|
```
|
|
187
217
|
|
|
188
218
|
The exact lead, unchanged pending ask ID, current lead identity, and chief
|
|
189
219
|
lease must validate. The pending ask is cleared only after accepted delivery.
|
|
220
|
+
`staff reply` accepts optional `files`. Lead activity returns asynchronously;
|
|
221
|
+
continue only independent chief work, otherwise end the turn and do not poll.
|
|
190
222
|
|
|
191
223
|
## UI and failure rules
|
|
192
224
|
|
|
@@ -199,5 +231,8 @@ The active chief gets a width-aware compact leads-only ambient widget and a
|
|
|
199
231
|
native `/chief` overview with peek and focus. Leads are ordered by needs-you,
|
|
200
232
|
working, blocked, idle/done, then unknown. The ambient widget uses
|
|
201
233
|
presentation-only tree branches for visible lead rows, while the native
|
|
202
|
-
overview stays flat.
|
|
203
|
-
|
|
234
|
+
overview stays flat. Human supervision peek renders at most 40 lines after
|
|
235
|
+
width-safe presentation of its state, recent output, agents, and process
|
|
236
|
+
evidence; this rendering bound is separate from the inspect capture bounds.
|
|
237
|
+
Missing, replaced, ambiguous, or conflicting identity fails closed. There is no
|
|
238
|
+
descendant selector or force-takeover action.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-herdsman",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Asynchronous
|
|
5
|
+
"description": "Asynchronous Pi agent orchestration with nested delegation, parallel execution, and supervision in herdr.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
"pi-extension",
|
|
20
20
|
"subagent",
|
|
21
21
|
"subagents",
|
|
22
|
-
"
|
|
22
|
+
"agents",
|
|
23
23
|
"ai-agents",
|
|
24
24
|
"coding-agents",
|
|
25
25
|
"multi-agent",
|
|
26
|
+
"multi-agent-coding",
|
|
26
27
|
"agent-orchestration",
|
|
27
28
|
"orchestration",
|
|
28
29
|
"delegation",
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
],
|
|
37
38
|
"skills": [
|
|
38
39
|
"."
|
|
39
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"image": "https://raw.githubusercontent.com/boadij/pi-herdsman/main/docs/assets/banner.webp"
|
|
40
42
|
},
|
|
41
43
|
"scripts": {
|
|
42
44
|
"test": "node --experimental-test-module-mocks --test --test-timeout=10000",
|