@howaboua/pi-shepherdr 0.2.23 → 0.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +7 -18
  2. package/README.md +63 -60
  3. package/biome.json +1 -1
  4. package/index.ts +2 -2
  5. package/package.json +14 -9
  6. package/src/agents-discovery.ts +41 -26
  7. package/src/agents-focus.ts +2 -2
  8. package/src/agents-reply.ts +1 -1
  9. package/src/agents-spawn.ts +2 -2
  10. package/src/agents-tool.ts +2 -2
  11. package/src/agents-work.ts +3 -3
  12. package/src/attachment-notes.ts +14 -2
  13. package/src/attachment-protocol.ts +21 -4
  14. package/src/attachment-routing.ts +1 -1
  15. package/src/attachment-target.ts +5 -2
  16. package/src/attachment.ts +2 -3
  17. package/src/board/host.ts +2 -2
  18. package/src/board/membership.ts +1 -1
  19. package/src/{control-panel-actions.ts → control-panel/actions.ts} +2 -2
  20. package/src/{control-panel.ts → control-panel/index.ts} +4 -4
  21. package/src/{control-panel-items.ts → control-panel/items.ts} +3 -3
  22. package/src/{control-panel-view.ts → control-panel/view.ts} +3 -3
  23. package/src/controller.ts +6 -3
  24. package/src/fleet/index.ts +384 -0
  25. package/src/fleet/inspection.ts +141 -0
  26. package/src/fleet/machine.ts +52 -0
  27. package/src/fleet/monitor.ts +71 -0
  28. package/src/fleet/persistence.ts +42 -0
  29. package/src/fleet/reconnect.ts +75 -0
  30. package/src/fleet/setup.ts +92 -0
  31. package/src/messages/attachments.ts +39 -0
  32. package/src/messages/attribution.ts +75 -0
  33. package/src/messages/event-details.ts +69 -0
  34. package/src/messages/events.ts +189 -0
  35. package/src/messages/focus.ts +38 -0
  36. package/src/messages/guidance.ts +83 -0
  37. package/src/messages/render.ts +89 -0
  38. package/src/messages/voice-announcements.ts +79 -0
  39. package/src/monitor.ts +2 -2
  40. package/src/peer-inbox.ts +2 -2
  41. package/src/remote/client.ts +127 -0
  42. package/src/remote/context-relay.ts +84 -0
  43. package/src/remote/deployment.ts +179 -0
  44. package/src/remote/focus-channels.ts +89 -0
  45. package/src/remote/transport.ts +369 -0
  46. package/src/settlement/collector.ts +122 -0
  47. package/src/settlement/delivery.ts +144 -0
  48. package/src/{settlement.ts → settlement/index.ts} +23 -233
  49. package/src/shared-context-host.ts +33 -11
  50. package/src/shared-context.ts +10 -4
  51. package/src/spawn-context.ts +20 -17
  52. package/src/voice-handoff.ts +1 -1
  53. package/src/worker-service.ts +2 -2
  54. package/src/fleet.ts +0 -702
  55. package/src/messages.ts +0 -637
  56. package/src/remote-client.ts +0 -761
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @howaboua/pi-shepherdr
2
2
 
3
+ ## 0.2.24
4
+
5
+ - - **BREAKING CHANGE:** Shared notes and history now use Notes instead of PCC. Install `@howaboua/pi-notes-compaction` and update participating hosts together to retain sharing. PCC remains optional for native parent linkage and cache affinity. Ordinary agent management requires neither extension.
6
+ - Agent guidance now directs controllers to close finished workers without preceding acknowledgement messages.
7
+ - Attached note reads keep private routing details out of results while preserving read-only and stale-checkpoint warnings. Attachment acknowledgements omit internal bookkeeping.
8
+ - GPT mode uses note-style agent help and Board briefings.
9
+
3
10
  ## 0.2.23
4
11
 
5
12
  - - Worker roles now follow shared project instructions, preserving a longer common startup prefix and exact role whitespace across machines. Update and reload Shepherdr on controllers and worker hosts together.
@@ -12,13 +19,11 @@
12
19
  ## 0.2.22
13
20
 
14
21
  - **Worker integrations**
15
-
16
22
  - Fresh workers now share their parent's cache routing with compatible Codex Conversion. Shared notes remain optional, and native sessions and histories remain separate.
17
23
  - Fresh workers inherit the live Board setting before their first request, keeping Board tools and guidance available from startup.
18
24
  - Added an optional Pulses runner with persistent workers, saved-session reuse and completion reports that wake the parent.
19
25
 
20
26
  **Agent tools and guidance**
21
-
22
27
  - Expanded tool calls now show outgoing tasks, messages, replies and focus handoffs in full.
23
28
  - Added compact agent help and hosted Board briefings for PCC GPT prompt mode.
24
29
  - Agent discovery now uses the same help contract across native, Code and Notebook tools.
@@ -32,7 +37,6 @@
32
37
  ## 0.2.20
33
38
 
34
39
  - Requires Pi 1.2.0 or newer.
35
-
36
40
  - Idle assignments and completion reports now apply Pi's full prompt and tool preparation.
37
41
  - Fixed local and remote spawns failing during session startup.
38
42
  - Supervision reminders now distinguish other agents' tasks from the current task after compaction.
@@ -46,7 +50,6 @@
46
50
  ## 0.2.18
47
51
 
48
52
  - Replaced the Ask-specific `answer` action with `reply` for extension replies. Update and reload Ask and Shepherdr together on controllers and workers.
49
-
50
53
  - Assignments now update running agents without losing pending results or replacing existing waiters. Messages and assignments also reach blocked workers.
51
54
  - Extension messages and reply templates now travel between local and remote agents. Replies reach the owning extension without an extra model turn, including while a worker is busy or blocked.
52
55
  - Pending extension messages remain visible until their producer closes them. Blocking messages arrive with the blocked result. Nonblocking messages notify separately once.
@@ -85,7 +88,6 @@
85
88
  ## 0.2.14
86
89
 
87
90
  - Delegated agents keep reporting after task completion, including follow-up work.
88
-
89
91
  - Added shared-board awareness across native, Code and Notebook modes.
90
92
  - Preserves orchestration guidance across compaction and context rollover.
91
93
  - Restores running workers' targets and full tasks after compaction or context rollover to prevent duplicate delegation.
@@ -118,7 +120,6 @@
118
120
  ## 0.2.10
119
121
 
120
122
  - Requires Pi 1.0.0 or later.
121
-
122
123
  - Added optional agent-tree message boards with channels, replies, search, subscriptions and persistent folder-local history. Boards require Node.js 22.13 or later.
123
124
  - Added session, exact-folder and global board settings under `/herdr board`. Board notifications reach running turns without waking idle agents.
124
125
  - Board history is stored as plaintext in `.pi/agent-message-board.sqlite` and remains after disabling boards. Keep this archive out of version control and restricted to its intended readers.
@@ -132,14 +133,12 @@
132
133
  ## 0.2.8
133
134
 
134
135
  - Agent profiles now control delegation waiting and shared context.
135
-
136
136
  - Removed reviewer-name blocking rules. Optional profile `blocking` forces blocking or asynchronous spawns, and help and list report the configured policy with the profile description.
137
137
  - Added `share_context: false` for independent subagent notes and history. Existing installed profiles remain unchanged.
138
138
 
139
139
  ## 0.2.7
140
140
 
141
141
  - Added opt-in shared notes and history for spawned agents with Pi Codex Conversion.
142
-
143
142
  - New and nested workers receive distinct, persistent context identities before their first task.
144
143
  - Local and Tree context stays in its owning sessions and routes through live controllers and existing SSH connections. Remote storage sharing requires the same Codex account.
145
144
  - Sharing follows **Share subagent context** under `/codex context` and affects new spawns only. Existing agents and ordinary delegation remain unchanged.
@@ -151,7 +150,6 @@
151
150
  ## 0.2.6
152
151
 
153
152
  - Fixed exact Ask answer confirmation and retry reconciliation without resending input.
154
-
155
153
  - Keep answers pending while the original Ask is still open.
156
154
  - Preserve accepted receipts when the worker's reply fails.
157
155
  - Report dismissed Asks as rejected.
@@ -159,7 +157,6 @@
159
157
  ## 0.2.5
160
158
 
161
159
  - GPT-6 Sol and Luna now share Astra's Codex support.
162
-
163
160
  - Removed `/terra`; use `/luna` instead.
164
161
  - Added Responses Lite, non-destructive reasoning changes and terse context guidance for GPT-6 Sol and Luna.
165
162
  - Image descriptions now use GPT-6 Luna directly instead of preferring older mini models.
@@ -173,7 +170,6 @@
173
170
  ## 0.2.3
174
171
 
175
172
  - Fixed context continuity, voice replies, and patch preservation.
176
-
177
173
  - V2 compaction preserves the preceding request's reasoning configuration, then starts a fresh baseline without stale overrides. Astra's temporary effort survives continued work across context windows.
178
174
  - Worker updates now accept up to 8 KiB without truncation announcements or offers to read the rest.
179
175
  - Reasoning-summary forwarding now recognizes GPT-6 models.
@@ -195,14 +191,12 @@
195
191
  ## 0.2.1
196
192
 
197
193
  - Deliver peer messages directly to Pi without submitting unsent human drafts.
198
-
199
194
  - Preserve slash-command arguments and use the target session's skill and prompt-template expansion.
200
195
  - Return submission-only acknowledgements for registered extension commands instead of waiting for an assistant reply.
201
196
 
202
197
  Requires Pi 0.84.4 or newer. Update and reload Shepherdr on both controllers and workers, and Pi Codex Conversion where installed.
203
198
 
204
199
  - Fixed idle agent reports and manual checkpoint requests to preserve prompt preparation, coalesce concurrent continuations, and process reports arriving during turn settlement.
205
-
206
200
  - Manual Compact reuses notes saved in the last completed turn for Local, Tree, and Remote notes-only windows, avoiding a redundant checkpoint turn. Explicit compaction instructions still request a checkpoint.
207
201
  - Compact tool output now offers Off, On, and Minimal. Minimal keeps nested tool results and an expand hint while hiding the trailing Code / Notebook text preview until expanded. Existing Off and On settings keep their behavior.
208
202
  - Shepherdr help makes local routing explicit: agent calls default to the host running Pi, while unfiltered discovery searches all machines. Remote calls use profile IDs, not machine labels or hostnames.
@@ -211,7 +205,6 @@
211
205
  ## 0.2.0
212
206
 
213
207
  - Shepherdr now reads existing Herdr machine profiles and requires Herdr 0.9 or newer. Manage profiles in Herdr; `shepherdr.json`, old machine aliases and their saved watches are no longer used.
214
-
215
208
  - Agent prompts and reports identify their source workspace, tab and pane, including current names.
216
209
  - Attributed messages to running Pi Codex agents use developer steering. Idle tasks retain normal user kickoff and extension preparation.
217
210
  - `send` delivers peer messages without blocking or subscribing; use `assign` to delegate work to an existing agent.
@@ -220,7 +213,6 @@
220
213
  ## 0.1.6
221
214
 
222
215
  - Deliver blocked-agent handoffs even when transcripts are unavailable.
223
-
224
216
  - Reviewer spawns wait for their result before the controller continues.
225
217
  - Implementation subagents are instructed to work directly rather than delegate implementation again.
226
218
  - Discover and answer Pi Ask questions called inside Code and Notebook Mode.
@@ -235,14 +227,12 @@
235
227
  ## 0.1.4
236
228
 
237
229
  - Preserve extension-owned messages while delivering true developer-role policy through compatible Pi Codex Responses adapters.
238
-
239
230
  - Add an optional custom-message API that retains caller rendering and restoration fields.
240
231
  - Route Shepherdr's unclaimed worker events and orchestration toggles through it, preserving ordinary Pi delivery when unavailable.
241
232
  - Send review preface/triage policy and realtime voice start/end guidance as developer messages without elevating raw reviewer findings, spoken delegations, or transcript tails.
242
233
  - Keep persisted developer messages in context across model switches, using ordinary Pi conversion on incompatible models.
243
234
 
244
235
  - Fix worker settlement, custom model preservation, and prompt-only image generation.
245
-
246
236
  - Settle Shepherdr workers after Pi expands skill or prompt-template invocations.
247
237
  - Preserve custom Codex models and `models.json` overrides, including after refresh.
248
238
  - Keep optional tool arguments optional in Codex Responses requests while preserving explicit strict sampling.
@@ -253,7 +243,6 @@
253
243
  ## 0.1.3
254
244
 
255
245
  - Replaced Shepherdr's fire-and-forget tool with persistent blocking and asynchronous agents in normal Pi, Code Mode, and Notebook Mode.
256
-
257
246
  - Start, steer, inspect, and answer multiple agents through the `agents` tool.
258
247
  - Customize the bundled general, explorer, and reviewer profiles or add your own.
259
248
  - Activate orchestration mode with `/herdr` when the main session should coordinate agent work.
package/README.md CHANGED
@@ -52,20 +52,20 @@ Remote machines connect over noninteractive SSH. The target needs `node` on its
52
52
 
53
53
  Call `agents` with `{}` before first use, alone, then send flat request objects with `action`. Code and Notebook Mode use `await tools.agents()`. Explicit `action: "help"` also returns help.
54
54
 
55
- | Action | Result |
56
- | --- | --- |
57
- | `help` | Live profiles, request shapes, coordination rules and the advanced Herdr escape hatch |
58
- | `list` | Profiles, machines and matching Pi agents |
59
- | `find` | Agents matching a query or status |
60
- | `spawn` | Spawn a profiled Pi agent and send its initial task |
61
- | `send` | Send a peer message without waiting or subscribing |
62
- | `assign` | Delegate a task to an existing agent |
63
- | `attach` | Share context or join a board with an existing idle agent |
64
- | `detach` | Leave selected membership and retain read-only counterpart checkpoints |
65
- | `read` | Read the latest assistant reply or bounded terminal output |
66
- | `reply` | Deliver an opaque reply to a worker's extension |
67
- | `watch` | Push future settlement from an existing Pi agent |
68
- | `unwatch` | Stop reporting an agent |
55
+ | Action | Result |
56
+ | --------- | ------------------------------------------------------------------------------------- |
57
+ | `help` | Live profiles, request shapes, coordination rules and the advanced Herdr escape hatch |
58
+ | `list` | Profiles, machines and matching Pi agents |
59
+ | `find` | Agents matching a query or status |
60
+ | `spawn` | Spawn a profiled Pi agent and send its initial task |
61
+ | `send` | Send a peer message without waiting or subscribing |
62
+ | `assign` | Delegate a task to an existing agent |
63
+ | `attach` | Share context or join a board with an existing idle agent |
64
+ | `detach` | Leave selected membership and retain read-only counterpart checkpoints |
65
+ | `read` | Read the latest assistant reply or bounded terminal output |
66
+ | `reply` | Deliver an opaque reply to a worker's extension |
67
+ | `watch` | Push future settlement from an existing Pi agent |
68
+ | `unwatch` | Stop reporting an agent |
69
69
 
70
70
  `spawn` and `assign` block by default. Set `blocking: false` when the controller should continue other work immediately. A profile's `blocking` setting overrides the call for `spawn`. Task completion and blockage are then delivered automatically.
71
71
 
@@ -83,7 +83,7 @@ Every `spawn` needs an `agent_type` and a concise `label`. The label names both
83
83
 
84
84
  Cancelling a blocking call does not kill its worker. The waiter detaches and the eventual result returns through normal asynchronous delivery.
85
85
 
86
- After Pi compaction or Pi Codex context rollover, the controller receives its supervised agents' exact machine and target, submitted tasks and follow-up instructions, and last observed status, including settled and blocked workers. Read a target for its reply or pending extension messages. This reminder does not start a turn or bypass normal turn preparation.
86
+ After Pi compaction or Notes context rollover, the controller receives its supervised agents' exact machine and target, submitted tasks and follow-up instructions, and last observed status, including settled and blocked workers. Read a target for its reply or pending extension messages. This reminder does not start a turn or bypass normal turn preparation.
87
87
 
88
88
  Prompts sent through `agents` identify peer messages versus delegated tasks and include the sender's host, session, workspace, tab and pane identity, with current names. Reports include source workspace and tab names too. Raw `herdr agent prompt` calls bypass this attribution. These are runtime locations, not the desktop window showing a pane.
89
89
 
@@ -97,24 +97,24 @@ Call `agents` with `{ commands: true }` to list this session's available slash c
97
97
 
98
98
  These built-in commands are available through agent messages without an allowlist:
99
99
 
100
- | Command | Result |
101
- | --- | --- |
102
- | `/quit` | Shut down Pi gracefully and close its Herdr pane |
103
- | `/model <provider/model>` | Change the model |
104
- | `/thinking <level>` | Change the thinking level |
105
- | `/name <name>` | Rename the session |
106
- | `/new` | Start a new session |
107
- | `/reload` | Reload Pi resources |
108
- | `/resume <path>` | Resume the session at the supplied path |
109
- | `/compact [instructions]` | Compact the session with optional instructions |
100
+ | Command | Result |
101
+ | ------------------------- | ------------------------------------------------ |
102
+ | `/quit` | Shut down Pi gracefully and close its Herdr pane |
103
+ | `/model <provider/model>` | Change the model |
104
+ | `/thinking <level>` | Change the thinking level |
105
+ | `/name <name>` | Rename the session |
106
+ | `/new` | Start a new session |
107
+ | `/reload` | Reload Pi resources |
108
+ | `/resume <path>` | Resume the session at the supplied path |
109
+ | `/compact [instructions]` | Compact the session with optional instructions |
110
110
 
111
111
  Custom extension commands must be both registered in the receiving Pi session and allowed in its global user config. **Settings → Agent commands** shows the actual config path. The file is `pi-shepherdr.json` in Pi's agent directory, normally `~/.pi/agent`. Add `extensionCommands`, preserving any existing fields:
112
112
 
113
113
  ```json
114
114
  {
115
- "extensionCommands": {
116
- "my-command": "Run my custom extension action"
117
- }
115
+ "extensionCommands": {
116
+ "my-command": "Run my custom extension action"
117
+ }
118
118
  }
119
119
  ```
120
120
 
@@ -130,13 +130,13 @@ An extension can publish a durable message without importing Shepherdr:
130
130
 
131
131
  ```ts
132
132
  pi.appendEntry("shepherdr-extension-message", {
133
- version: 1,
134
- extension: "your-extension",
135
- id: "unique-message-id",
136
- state: "pending",
137
- message: "Extension-authored text for the controller",
138
- reply: "Extension-authored reply template", // optional
139
- blocking: false,
133
+ version: 1,
134
+ extension: "your-extension",
135
+ id: "unique-message-id",
136
+ state: "pending",
137
+ message: "Extension-authored text for the controller",
138
+ reply: "Extension-authored reply template", // optional
139
+ blocking: false,
140
140
  });
141
141
  ```
142
142
 
@@ -145,10 +145,10 @@ Use a unique ID per message within the extension. `blocking` says whether replyi
145
145
  Register the reply handler on Pi's event bus:
146
146
 
147
147
  ```ts
148
- pi.events.on("@howaboua/pi-shepherdr/extension-reply/v1", event => {
149
- const { extension, id, message, respond } = event;
150
- if (extension !== "your-extension") return;
151
- respond(handleReply(id, message));
148
+ pi.events.on("@howaboua/pi-shepherdr/extension-reply/v1", (event) => {
149
+ const { extension, id, message, respond } = event;
150
+ if (extension !== "your-extension") return;
151
+ respond(handleReply(id, message));
152
152
  });
153
153
  ```
154
154
 
@@ -161,24 +161,27 @@ Replies use the authenticated peer connection, including across machines, and ca
161
161
  Use `attach` before delegating when an independently started agent needs shared notes, history or board membership:
162
162
 
163
163
  ```js
164
- await tools.agents({ action: "attach", target: "<target from find>", context: true, board: true })
164
+ await tools.agents({
165
+ action: "attach",
166
+ target: "<target from find>",
167
+ context: true,
168
+ board: true,
169
+ });
165
170
  ```
166
171
 
167
172
  Supply both booleans and enable at least one. `context` shares notes and history through aliases without changing either session's original context identity or moving its notes. `contextAgent` addresses the target from the controller; `controllerContextAgent` addresses the controller from the target. Use these paths as `history`'s `agent_name` or as `<agent>/notes/<path>` for notes. Each agent's relative note paths remain its own. The target receives its controller alias without starting a turn.
168
173
 
169
- Context attachment requires updated Codex Conversion with Local, Tree or Remote storage. Each owner keeps its original context identity and storage, including when the two agents use different stores. Remote access uses the reader's active Codex transport and requires the original account and backend, regardless of provider name. The explicit `context: true` choice does not depend on the controller's spawn-sharing setting. Use Code or Notebook with ordinary query and text for mixed-storage search and writes. Direct sensitive calls cannot cross between encrypted Remote arguments and ordinary Local or Tree arguments. If attachment changes context access during an exec cell, start a new cell before using notes or history.
170
-
171
- An account mismatch rejects context sharing. Each agent keeps its own notes and history. If the account changes after attachment, pinned Remote notes become unavailable, including native Remote notes. Notes do not move to a new account or another store. Use messages to exchange the context the other agent needs.
174
+ Context attachment requires compatible Notes Compaction in both sessions. Each owner keeps its original identity and local notes. Optional encrypted historical reads require compatible PCC transport and the original account and backend. The explicit `context: true` choice does not depend on the controller's spawn-sharing setting. If attachment changes context access during an exec cell, start a new cell before using notes or history.
172
175
 
173
- `board: true` requires Pi Agent Board loaded in both sessions. It joins the controller's enabled board and returns `boardAgent` for subscriptions and notifications. The target's previous board archive stays untouched. If the folders differ, that archive remains in its original folder rather than becoming part of the controller's archive. Board-only attachment works without Codex Conversion and with Remote context storage.
176
+ `board: true` requires Pi Agent Board loaded in both sessions. It joins the controller's enabled board and returns `boardAgent` for subscriptions and notifications. The target's previous board archive stays untouched. If the folders differ, that archive remains in its original folder rather than becoming part of the controller's archive. Board-only attachment works without Notes or Codex Conversion.
174
177
 
175
178
  The target must be idle and both Pi sessions must be saved. Existing shared-context members and controllers with context children cannot be context targets. Existing board members and roots with board children cannot switch boards. A target supports one controller and one fixed set of attachment choices. Attachment starts no task or watch; `assign` and `send` never attach implicitly.
176
179
 
177
- Attachments survive resume, not forks. Local and Tree live access needs the owning Pi processes and machine connections. Remote access uses authenticated backend references rather than the owner's running process. After an interrupted attachment, resume the original sessions and retry the same target and choices. The target may already have joined even when the controller reports failure; retries reuse the original aliases and membership rather than creating duplicates.
180
+ Attachments survive resume, not forks. Live notes and history access needs the owning Pi processes and machine connections. After an interrupted attachment, resume the original sessions and retry the same target and choices. Retries reuse the original aliases and membership.
178
181
 
179
- To detach, call `agents` with `action: "detach"`, the same target, and both booleans. Enable each membership you want to leave. Context detach retains counterpart notes under the existing aliases read-only. Local and Tree notes use captured checkpoints. Remote notes retain an authenticated reference to the original owner's saved backend notes, not a frozen plaintext snapshot. Counterpart history and writes stop at detach. Native notes and history keep their original identities. Board detach restores the target's previous board and stops its shared-board notifications without deleting either archive. Board members with children cannot detach. Reattachment is unsupported.
182
+ To detach, call `agents` with `action: "detach"`, the same target, and both booleans. Enable each membership you want to leave. Context detach retains counterpart notes under the existing aliases read-only. Local notes use captured checkpoints. Historical Remote references retain their original authenticated address, not a plaintext snapshot. Counterpart history and writes stop at detach. Native identities remain unchanged. Board detach restores the target's previous board without deleting either archive. Board members with children cannot detach. Reattachment is unsupported.
180
183
 
181
- If an attached owner closes or dies, Local and Tree notes reads first use its latest saved checkpoints when the source machine and session file remain reachable. This needs no running owner process and never writes to its session file. If the source is unavailable, reads return the timestamped snapshot captured at attachment, explicitly marked stale with the access failure. No latest-checkpoint guarantee is possible for a disconnected source machine or unsaved notes. Local and Tree counterpart history still requires its live owner. Remote notes and history remain reachable through the backend with the original account and backend. Backend failures stay visible without a local fallback. An incomplete detach fails with a retry instruction rather than claiming success.
184
+ If an attached owner closes, local note reads use its latest saved checkpoints when the source machine and session file remain reachable. Otherwise they return the timestamped attachment snapshot, marked stale with the access failure. This never writes to the owner's session. Historical encrypted reads require their original account and backend. Backend failures remain visible. An incomplete detach fails with a retry instruction rather than claiming success.
182
185
 
183
186
  ## Message board
184
187
 
@@ -198,20 +201,19 @@ Child board calls use the owning Pi sessions and existing SSH connections, not a
198
201
 
199
202
  With compatible Pi Codex Conversion on both ends, Shepherdr marks fresh spawned workers before their first task with their immediate parent's native Pi session ID and `subagentKind: "collab_spawn"`. Workers also inherit the parent's effective cache routing identity, including nested and remote spawns. Each worker keeps its own native session, sockets and history. Cache routing works with shared notes disabled and does not grant notes access or copy the parent's transcript. Only matching prompt prefixes can benefit. Resume preserves the relationship; forks and profiles selecting existing sessions do not acquire it. Older PCC versions retain ordinary delegation and any supported parent linkage. The [extension API guide](../../docs/extension-apis.md#parent-and-worker-relationships) documents PCC's service contract for other orchestrators. Shepherdr owns transport, not a separate public relationship RPC API.
200
203
 
201
- With Pi Codex Conversion 3.0.40 or newer and notes-based continuity, enable **Share subagent context** under `/codex context` in the controller. It is off by default. Shared `spawn` gives each child a unique context identity before its first turn; `contextAgent` in the result identifies its notes and history. Shared nested spawns stay in the same family. Turning sharing off affects new spawns only; existing identity survives resume. `assign` and independently started agents remain unchanged. Older compatible Conversion versions keep ordinary delegation without sharing.
204
+ With Notes Compaction on both ends, enable **Share subagent context** under `/notes` in the controller. It is off by default. Shared `spawn` gives each child a unique context identity before its first turn; `contextAgent` identifies its notes and history. Nested spawns stay in the same family. Turning sharing off affects new spawns only. Existing identity survives resume. `assign` and independently started agents remain unchanged.
202
205
 
203
206
  Set `"share_context": false` in a profile to keep its new workers' notes and history independent even when controller sharing is enabled. Omission or `true` follows the controller setting, never turns sharing on itself. This separates context, not filesystem permissions or information included in the task.
204
207
 
205
208
  Pi creates each worker session normally. The worker records its shared identity before Shepherdr delivers the first task; no pre-created session file or launch override is needed.
206
209
 
207
- Remote sharing requires Remote storage and the same Codex account on both ends. Local and Tree route through the owning Pi sessions and existing SSH connections. Those owners and intermediate controllers must be running; unavailable routes fail explicitly. Resume the owner and reconnect under `/herdr` → **Status** after a connection loss. No note store is copied or silently substituted.
210
+ Shared notes route through their owning Pi sessions and existing SSH connections. Those owners and intermediate controllers must be running. Resume the owner and reconnect under `/herdr` → **Status** after a connection loss. No note store is copied or silently substituted. New writes stay local; optional hybrid lookup is read-only.
208
211
 
209
- Both extensions work independently. A target without active context support still starts, with a warning that its context is not shared. A conflicting storage mode or account rejects the shared spawn before task delivery. Profiles that select or resume an existing session cannot participate in shared `spawn`; use `attach` for context access, then `assign`.
212
+ Shepherdr works without Notes or PCC. A target without active Notes sharing still starts independently with a warning. Invalid bindings fail before task delivery. Profiles selecting existing sessions cannot participate in shared `spawn`; use `attach`, then `assign`.
210
213
 
211
214
  ## Profiles
212
215
 
213
216
  On first load, Shepherdr installs three editable profiles:
214
-
215
217
  - `general` uses `openai-codex/gpt-6-sol` with `high` thinking for implementation
216
218
  - `explorer` uses `openai-codex/gpt-6-luna` with `high` thinking for read-only discovery
217
219
  - `reviewer` uses `openai-codex/gpt-6-luna` with `xhigh` thinking for generic read-only review
@@ -228,19 +230,18 @@ That directory is authoritative after initialization. Edit a profile to change i
228
230
 
229
231
  ```json
230
232
  {
231
- "description": "Read-only dependency review",
232
- "model": "provider/model",
233
- "thinking": "high",
234
- "prompt": "prompt.md",
235
- "accepts": ["base"],
236
- "pi_args": []
233
+ "description": "Read-only dependency review",
234
+ "model": "provider/model",
235
+ "thinking": "high",
236
+ "prompt": "prompt.md",
237
+ "accepts": ["base"],
238
+ "pi_args": []
237
239
  }
238
240
  ```
239
241
 
240
242
  `prompt` is read as system-prompt text. An optional `prepare` module may export `prepare({ cwd, message, base, local })` and return the worker message. Preparation runs on the controlling machine before dispatch; `local` says whether that machine also hosts the worker.
241
243
 
242
244
  Optional profile settings:
243
-
244
245
  - `blocking`: `true` forces blocking spawns, `false` forces asynchronous spawns. Omission respects the call's `blocking` value, which defaults to `true`. This does not affect `assign` to existing agents.
245
246
  - `share_context`: `false` opts new spawns out of shared notes and history. Omission or `true` follows the controller setting.
246
247
 
@@ -261,8 +262,10 @@ Other extensions can query the current role synchronously through public Pi even
261
262
  ```ts
262
263
  let worker = false;
263
264
  pi.events.emit("shepherdr:worker-role:v1", {
264
- sessionManager: ctx.sessionManager,
265
- reply: (value: boolean) => { worker = value; },
265
+ sessionManager: ctx.sessionManager,
266
+ reply: (value: boolean) => {
267
+ worker = value;
268
+ },
266
269
  });
267
270
  ```
268
271
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
3
3
  "vcs": {
4
4
  "enabled": true,
5
5
  "clientKind": "git",
package/index.ts CHANGED
@@ -6,8 +6,8 @@ import { createAgentsTool } from "./src/agents-tool.js";
6
6
  import { AgentBoard } from "./src/board/host.js";
7
7
  import { registerAgentController } from "./src/controller.js";
8
8
  import { registerDeveloperDelivery } from "./src/delivery.js";
9
- import { AgentFleet } from "./src/fleet.js";
10
- import { registerAgentEventRenderer } from "./src/messages.js";
9
+ import { AgentFleet } from "./src/fleet/index.js";
10
+ import { registerAgentEventRenderer } from "./src/messages/render.js";
11
11
  import { createPeerCommands } from "./src/peer-commands.js";
12
12
  import { registerPeerInbox } from "./src/peer-inbox.js";
13
13
  import { registerProfilePrompt } from "./src/profile-prompt.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howaboua/pi-shepherdr",
3
- "version": "0.2.23",
3
+ "version": "0.2.24",
4
4
  "description": "Persistent blocking and asynchronous Pi agents through Herdr.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,28 +43,33 @@
43
43
  "pack:dry": "npm pack --dry-run"
44
44
  },
45
45
  "peerDependencies": {
46
- "@howaboua/pi-codex-conversion": ">=4.0.3",
46
+ "@howaboua/pi-notes-compaction": ">=0.0.10",
47
+ "@howaboua/pi-codex-conversion": ">=4.0.5",
47
48
  "@earendil-works/pi-ai": ">=1.1.0",
48
49
  "@earendil-works/pi-coding-agent": ">=1.2.0",
49
50
  "@earendil-works/pi-tui": ">=1.1.0",
50
51
  "typebox": "*"
51
52
  },
52
53
  "peerDependenciesMeta": {
54
+ "@howaboua/pi-notes-compaction": {
55
+ "optional": true
56
+ },
53
57
  "@howaboua/pi-codex-conversion": {
54
58
  "optional": true
55
59
  }
56
60
  },
57
61
  "dependencies": {
58
- "@howaboua/pi-agent-board": "0.0.3"
62
+ "@howaboua/pi-agent-board": "0.0.4"
59
63
  },
60
64
  "devDependencies": {
61
- "@howaboua/pi-codex-conversion": "4.0.3",
62
- "@biomejs/biome": "^2.5.15",
63
- "@earendil-works/pi-ai": "1.3.0",
64
- "@earendil-works/pi-coding-agent": "1.3.0",
65
- "@earendil-works/pi-tui": "1.3.0",
65
+ "@howaboua/pi-notes-compaction": "0.0.10",
66
+ "@howaboua/pi-codex-conversion": "4.0.5",
67
+ "@biomejs/biome": "^2.6.3",
68
+ "@earendil-works/pi-ai": "1.4.0",
69
+ "@earendil-works/pi-coding-agent": "1.4.0",
70
+ "@earendil-works/pi-tui": "1.4.0",
66
71
  "@types/node": "^26.6.5",
67
- "typebox": "1.3.37",
72
+ "typebox": "1.4.3",
68
73
  "typescript": "^7.0.2"
69
74
  },
70
75
  "pi": {
@@ -1,5 +1,5 @@
1
1
  import type { AgentsParams, READ_SOURCES } from "./agents-contract.js";
2
- import type { AgentFleet, ConnectedMachine } from "./fleet.js";
2
+ import type { AgentFleet, ConnectedMachine } from "./fleet/index.js";
3
3
  import { type AgentProfile, loadAgentProfiles } from "./profiles.js";
4
4
  import type { AgentStatus, PaneInfo, SessionSnapshot } from "./types.js";
5
5
 
@@ -30,7 +30,7 @@ export async function agentsHelp(
30
30
  const profiles = await loadAgentProfiles();
31
31
  return {
32
32
  commands: gpt
33
- ? "commands:true lists slash commands/descriptions, never executes. Default this session; target/machine select another"
33
+ ? "commands:true lists slash commands/descriptions, NEVER executes; default=this session; target/machine→another"
34
34
  : "commands: true lists available slash commands with descriptions; defaults to this session, target and machine optionally select another session; does not execute commands",
35
35
  actions: {
36
36
  help: "",
@@ -51,46 +51,61 @@ export async function agentsHelp(
51
51
  },
52
52
  rules: {
53
53
  reply: gpt
54
- ? "Use extension report/read template; send cannot resolve. Blocking waits for resumed work; others return after semantic delivery"
54
+ ? "Extension report/read template required; send≠resolve; blocking waits resumed work; others return after semantic delivery"
55
55
  : "Use the extension-authored template from its report/read; send does not resolve it. Blocking messages wait for resumed work; other replies return after semantic delivery",
56
- machine:
57
- "Omit for local (host running Pi); list/find omit for all machines. Remote: profile ID from list, not label/hostname",
58
- target:
59
- "Use spawn/find target exactly; /root selects this family's live root",
60
- label: "Short tab/session name; prefer two words when useful",
56
+ machine: gpt
57
+ ? "machine omitted=local Pi host; list/find omitted=all machines; remote=list profile ID, NOT label/hostname"
58
+ : "Omit for local (host running Pi); list/find omit for all machines. Remote: profile ID from list, not label/hostname",
59
+ target: gpt
60
+ ? "spawn/find target EXACT; /root=this family live root"
61
+ : "Use spawn/find target exactly; /root selects this family's live root",
62
+ label: gpt
63
+ ? "Short tab/session name; two words IF useful"
64
+ : "Short tab/session name; prefer two words when useful",
61
65
  ...(boardAvailable
62
66
  ? {
63
- board_thread_id:
64
- "Existing shared-board thread; child receives a read reference",
67
+ board_thread_id: gpt
68
+ ? "Existing board thread→child read ref"
69
+ : "Existing shared-board thread; child receives a read reference",
65
70
  }
66
71
  : {}),
67
- send: "Message or work update; wakes idle agents, no wait/watch. Close finished workers with /quit, not acknowledgement messages",
72
+ send: gpt
73
+ ? "/quit next→NO preceding message; sends wake idle agents; NO wait/watch"
74
+ : "When closing an agent, send /quit without another message first. Messages wake idle agents. No waiting or watching.",
68
75
  assign: gpt
69
- ? "Delegate/update work. Active updates share pending result, never replace existing wait"
76
+ ? "Delegate/update work; active→share pending result, NEVER replace wait"
70
77
  : "Delegate or update work; active updates share its pending result, never replace an existing wait",
71
78
  focus: gpt
72
- ? "Running session; passive arrival+return call, no task/watch. voice=false default; true transfers active mic asynchronously. handoff=context. Remote selects target Herdr session, not client machine"
79
+ ? "Running session; passive arrival+return call, NO task/watch; voice default false, true=async active mic transfer; handoff=context; remote=target Herdr session≠client machine"
73
80
  : "Select a running session; passive arrival with return call, no task/watch. voice defaults false; true carries the active microphone asynchronously. handoff adds context. Remote focus selects the target's Herdr session, not the client's machine",
74
81
  attach: boardAvailable
75
- ? "Idle target; context/board booleans choose shared access and board membership independently; no task/watch"
76
- : "Idle target; context shares notes/history; use board:false while shared boards are unavailable; no task/watch",
77
- detach:
78
- "Stop selected membership; retain counterpart checkpoints read-only; idle target",
82
+ ? gpt
83
+ ? "Idle target; context/board=independent sharing/membership; NO task/watch"
84
+ : "Idle target; context/board booleans choose shared access and board membership independently; no task/watch"
85
+ : gpt
86
+ ? "Idle target; context=shared notes/history; boards unavailable→board:false; NO task/watch"
87
+ : "Idle target; context shares notes/history; use board:false while shared boards are unavailable; no task/watch",
88
+ detach: gpt
89
+ ? "Idle target; stop selected membership; counterpart checkpoints remain readonly"
90
+ : "Stop selected membership; retain counterpart checkpoints read-only; idle target",
79
91
  blocking: gpt
80
- ? "spawn/assign default true; profile overrides spawn. JS cells parallel+wait: await Promise.allSettled. false=continue other work; completion/blockage after reply. No polling/sleep waits"
92
+ ? "spawn/assign default true; profile overrides spawn; JS parallel+wait: await Promise.allSettled; false ONLY if other work continues; completion/blockage AFTER reply; NO poll/sleep"
81
93
  : "spawn/assign default true; profile blocking overrides spawn. In JavaScript cells, use await Promise.allSettled for parallel calls that wait for every result, including failures. Use false only to continue other work; completion/blockage arrives after your reply. No polling or sleep waits",
82
- share_context:
83
- "Profile false isolates notes/history; otherwise follows controller sharing setting",
84
- watch:
85
- "Delegation and watch keep reporting subsequent work until unwatch or close",
94
+ share_context: gpt
95
+ ? "Profile false→isolated notes/history; otherwise→controller sharing setting"
96
+ : "Profile false isolates notes/history; otherwise follows controller sharing setting",
97
+ watch: gpt
98
+ ? "Delegation/watch→report subsequent work UNTIL unwatch/close"
99
+ : "Delegation and watch keep reporting subsequent work until unwatch or close",
86
100
  prompt: gpt
87
- ? "Distinct worker scope, outcome, project context, issue references. Define success, not forbidden investigations"
101
+ ? "Distinct scope/outcome/project context/issue refs; define success, NOT forbidden investigations"
88
102
  : "Give each worker a distinct scope, desired outcome, relevant project context and issue references. Describe success rather than lists of forbidden investigations",
89
103
  slash: gpt
90
- ? "Leading / routes target commands/skills/templates. Commands skip task waiting including assign/spawn; blocked returns choices. /quit exits Pi and closes pane"
104
+ ? "Leading / routes target commands/skills/templates; commands skip task wait EVEN assign/spawn; blocked→choices; /quit exits Pi+closes pane"
91
105
  : "Leading / routes target commands/skills/templates. Commands skip task waiting, even with assign/spawn; blocked commands return available choices. /quit shuts down Pi and closes its pane",
92
- reuse:
93
- "Reuse only same investigation; reviews independent; new scope = new agent",
106
+ reuse: gpt
107
+ ? "Reuse ONLY same investigation; reviews independent; new scope=new agent"
108
+ : "Reuse only same investigation; reviews independent; new scope = new agent",
94
109
  ...(profiles.has("general")
95
110
  ? {
96
111
  general: "Only when requested/orchestrating",
@@ -7,7 +7,7 @@ import {
7
7
  recordContextBriefing,
8
8
  registerContextBriefing,
9
9
  } from "@howaboua/pi-agent-board/integration";
10
- import type { AgentFleet, ConnectedMachine } from "./fleet.js";
10
+ import type { AgentFleet, ConnectedMachine } from "./fleet/index.js";
11
11
  import {
12
12
  getAgent,
13
13
  getCurrentPane,
@@ -15,7 +15,7 @@ import {
15
15
  sessionPath,
16
16
  } from "./herdr.js";
17
17
  import { isDispatchRejected } from "./herdr-client.js";
18
- import { focusArrivalContent } from "./messages.js";
18
+ import { focusArrivalContent } from "./messages/focus.js";
19
19
  import type { FocusRequest, PaneInfo } from "./types.js";
20
20
  import { activeVoiceService, observeVoiceTransfer } from "./voice-handoff.js";
21
21
 
@@ -5,7 +5,7 @@ import {
5
5
  settlementResult,
6
6
  toolResult,
7
7
  } from "./agents-work.js";
8
- import type { ConnectedMachine } from "./fleet.js";
8
+ import type { ConnectedMachine } from "./fleet/index.js";
9
9
  import type { PaneInfo } from "./types.js";
10
10
 
11
11
  export async function replyAgent(
@@ -15,14 +15,14 @@ import {
15
15
  toolResult,
16
16
  } from "./agents-work.js";
17
17
  import type { AgentBoard } from "./board/host.js";
18
- import type { AgentFleet, ConnectedMachine } from "./fleet.js";
18
+ import type { AgentFleet, ConnectedMachine } from "./fleet/index.js";
19
19
  import { isDispatchRejected } from "./herdr-client.js";
20
20
  import {
21
21
  resolvePreparationDirectory,
22
22
  rollbackStartedAgent,
23
23
  startAgent,
24
24
  } from "./launch.js";
25
- import { attributeAgentPrompt } from "./messages.js";
25
+ import { attributeAgentPrompt } from "./messages/attribution.js";
26
26
  import {
27
27
  loadAgentProfiles,
28
28
  prepareProfileMessage,
@@ -26,9 +26,9 @@ import {
26
26
  toolResult,
27
27
  } from "./agents-work.js";
28
28
  import type { AgentBoard } from "./board/host.js";
29
- import type { AgentFleet } from "./fleet.js";
29
+ import type { AgentFleet } from "./fleet/index.js";
30
30
  import { resolvePiAgent } from "./herdr.js";
31
- import { attributeAgentPrompt } from "./messages.js";
31
+ import { attributeAgentPrompt } from "./messages/attribution.js";
32
32
  import type { createPeerCommands } from "./peer-commands.js";
33
33
  import type { SharedAgentContext } from "./shared-context.js";
34
34