@narumitw/pi-herdr 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +84 -29
- package/dist/chunks/{herdr-menu-H74GELLE.ts → herdr-menu-CA4DI2LZ.ts} +10 -7
- package/dist/chunks/herdr-menu-CA4DI2LZ.ts.map +7 -0
- package/dist/index.ts +1999 -781
- package/dist/index.ts.map +4 -4
- package/docs/hc-integration.md +65 -0
- package/docs/peer-provenance.md +35 -0
- package/package.json +15 -4
- package/skills/pi-herdr/SKILL.md +49 -0
- package/src/hc-integration.ts +58 -0
- package/src/hc-observer.ts +270 -0
- package/src/hc-peer-tool.ts +191 -0
- package/src/hc-peer.d.mts +36 -0
- package/src/hc-peer.mjs +390 -0
- package/src/hc-rpc.d.mts +37 -0
- package/src/hc-rpc.mjs +211 -0
- package/src/hc-widget.ts +246 -0
- package/src/herdr-agent-state.ts +14 -4
- package/src/herdr-integration.ts +32 -0
- package/src/herdr-menu.ts +16 -6
- package/src/herdr-observer.ts +4 -1
- package/src/herdr-protocol.ts +13 -0
- package/src/herdr-runtime-claim.ts +22 -0
- package/src/herdr-settings-controller.ts +8 -4
- package/src/herdr-spawn-provenance.ts +61 -0
- package/src/herdr-widget.ts +84 -7
- package/src/index.ts +1 -1
- package/dist/chunks/herdr-menu-H74GELLE.ts.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @narumitw/pi-herdr
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b746e66: Add hc (herdr-core) status and terminal ancestry to the agent widget without duplicating Pi's native status reports. Keep legacy Herdr status, `/herdr`, and display of existing session-validated provenance. Do not ship legacy peer spawning or a `pane.run` fallback.
|
|
8
|
+
|
|
9
|
+
Add the `pi-herdr` skill and `herdr_peer` tool for independent parallel work in hc. The tool requires a valid, complete inherited hc binding. It starts peers with the current Pi runtime's checked absolute Node and Pi CLI paths and the same package resources. Each spawn requires explicit confirmation in an interactive Pi TUI that the local core on that connection was launched by a trusted host with a pre-spawn allowlist for the core's effective program environment. The prompt does not filter that environment or authenticate the endpoint. Headless spawn is rejected.
|
|
10
|
+
|
|
11
|
+
Use a fresh observation token and canonical terminal address to send peer messages. The tool checks sampled identity and idle status before one conditional send. It does not expose terminal text or raw process arguments, and it cannot prevent draft or takeover races.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [df62c83]
|
|
16
|
+
- @narumitw/pi-tui-kit@0.70.1
|
|
17
|
+
|
|
3
18
|
## 0.5.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
# 🐑 pi-herdr — Herdr Integration for Pi
|
|
1
|
+
# 🐑 pi-herdr — Herdr and hc Integration for Pi
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@narumitw/pi-herdr) [](https://pi.dev) [](./LICENSE)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Show Pi agent status in hc (herdr-core) or legacy Herdr. In hc, start independent Pi peers and exchange messages.
|
|
6
6
|
|
|
7
7
|
## ✨ Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- Shows recognized
|
|
12
|
-
-
|
|
9
|
+
- Shows hc's native Pi status and terminal ancestry, or legacy Herdr status and existing session-validated provenance.
|
|
10
|
+
- Reports Pi session identity and `working`, `blocked`, and `idle` lifecycle states to legacy Herdr, with bounded `model`, `provider`, `thinking`, `session`, and `context_usage` sidebar tokens.
|
|
11
|
+
- Shows recognized agents in a passive widget above Pi's editor, with a saved visibility toggle in `/herdr`.
|
|
12
|
+
- Bundles the `pi-herdr` skill for independent parallel work and peer messages through the hc-only `herdr_peer` tool.
|
|
13
|
+
- Refreshes the widget from authoritative event-driven reads without polling the CLI.
|
|
13
14
|
- Coalesces rapid state changes and retries short-lived local socket failures without interrupting Pi.
|
|
14
|
-
- Derives blocked state from Pi's public `ui_prompt_start` and `ui_prompt_end` lifecycle events.
|
|
15
|
+
- Derives legacy Herdr blocked state from Pi's public `ui_prompt_start` and `ui_prompt_end` lifecycle events.
|
|
15
16
|
|
|
16
17
|
## 📦 Install
|
|
17
18
|
|
|
@@ -41,9 +42,12 @@ Install only trusted packages, and review the source before loading this package
|
|
|
41
42
|
|
|
42
43
|
## 🚀 Quick start
|
|
43
44
|
|
|
44
|
-
Start Pi
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
Start interactive Pi in a managed terminal after installation. When another recognized agent is present, Pi shows its state in a widget above the editor.
|
|
46
|
+
|
|
47
|
+
- **hc:** A valid, complete inherited `HC_TERMINAL_ID` and `HC_TERMINAL_SOCKET` binding selects hc and enables `herdr_peer`. An invalid or partial binding does not fall back to legacy Herdr.
|
|
48
|
+
- **Legacy Herdr:** If neither hc binding variable is set, `HERDR_ENV=1`, `HERDR_SOCKET_PATH`, and `HERDR_PANE_ID` enable legacy status and the widget, not peer spawning.
|
|
49
|
+
|
|
50
|
+
In hc, run `/skill:pi-herdr` for authorized independent parallel work. Before spawning, verify that the selected local core was launched by a trusted host with a pre-spawn environment allowlist. If you cannot confirm that for this connection in the Pi TUI, do not spawn. See [Security and privacy](#-security-and-privacy).
|
|
47
51
|
|
|
48
52
|
If the standalone integration is already installed, remove it after installing this package to avoid duplicate state reports:
|
|
49
53
|
|
|
@@ -56,10 +60,32 @@ Run `/reload` or restart Pi after changing the installed resources.
|
|
|
56
60
|
## 💬 Commands
|
|
57
61
|
|
|
58
62
|
`/herdr` opens a menu to toggle the agent widget and view status or help, inspired by `/tool`.
|
|
59
|
-
It accepts no arguments and is available inside
|
|
63
|
+
It accepts no arguments and is available inside either backend in TUI and RPC modes; print and JSON modes reject it.
|
|
60
64
|
RPC can save the preference but does not display the widget.
|
|
61
65
|
Changes apply immediately and closing the menu does not undo saved changes.
|
|
62
66
|
|
|
67
|
+
## 🛠️ Tools
|
|
68
|
+
|
|
69
|
+
`herdr_peer` uses the inherited hc socket. It is registered only with a valid, complete hc binding.
|
|
70
|
+
|
|
71
|
+
| Action | Input and result |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| `spawn` | Supply a name and the complete task text, not a file path. Starts an independent Pi peer after operator confirmation in an interactive Pi TUI. Headless spawn is rejected. |
|
|
74
|
+
| `inspect` | Supply an explicit canonical terminal address. Returns sampled facts and an observation token, not terminal text or raw process arguments. |
|
|
75
|
+
| `send` | Supply the same address, a fresh observation token, and the peer message text. Checks freshly sampled identity and idle status before one idle-conditional send. |
|
|
76
|
+
|
|
77
|
+
Use the token promptly after `inspect`. See [hc integration](./docs/hc-integration.md#peer-tool) for launch, delivery, and recovery limits.
|
|
78
|
+
|
|
79
|
+
## 🧠 Skills
|
|
80
|
+
|
|
81
|
+
Run [`/skill:pi-herdr`](./skills/pi-herdr/SKILL.md) for authorized independent parallel work inside hc. Tasks must use different mutable resources and must not need another active task's intermediate results. Keep dependent work in sequence.
|
|
82
|
+
The skill uses `herdr_peer` only. There is no Bash, CLI, template, or standalone helper path. The package does not spawn peers in legacy Herdr and does not fall back to `pane.run`.
|
|
83
|
+
|
|
84
|
+
## 🔌 hc status and terminal ancestry
|
|
85
|
+
|
|
86
|
+
Pi emits native OSC 7501 status, including `idle`, `working`, `blocked`, `done`, and `error`. The extension does not duplicate those reports or publish legacy metadata to hc. Turning off the widget does not stop Pi's reports.
|
|
87
|
+
hc relationships show **terminal ancestry**, not Pi session identity. They can survive program replacement and recovery. See [hc integration](./docs/hc-integration.md).
|
|
88
|
+
|
|
63
89
|
## ⚙️ Settings
|
|
64
90
|
|
|
65
91
|
Toggle **Agent widget** in `/herdr`, or edit `<getAgentDir()>/pi-herdr.json` (normally `~/.pi/agent/pi-herdr.json`):
|
|
@@ -76,9 +102,12 @@ Manual edits apply after `/reload` or the next session start.
|
|
|
76
102
|
Missing files are not created until an explicit save. Invalid files trigger a warning, use defaults, and block saves until repaired.
|
|
77
103
|
Saves preserve unknown fields and use atomic temporary-file-plus-rename publication, with reads and writes ordered within one Pi process, not across processes.
|
|
78
104
|
Failed saves restore the previous effective value and leave the existing file untouched.
|
|
79
|
-
Turning the widget off closes its subscription and pending requests without disabling lifecycle or
|
|
105
|
+
Turning the widget off closes its subscription and pending requests without disabling legacy lifecycle/metadata reporting or Pi-owned hc status reporting.
|
|
106
|
+
Both backends retain the same settings file, `/herdr` command, widget key, and process-local runtime claim; there are no new extension-owned settings or environment variables.
|
|
107
|
+
|
|
108
|
+
## 🔄 Legacy Herdr lifecycle reporting
|
|
80
109
|
|
|
81
|
-
|
|
110
|
+
This section applies only to legacy Herdr, not hc.
|
|
82
111
|
|
|
83
112
|
The extension reports only interactive TUI sessions because Herdr displays agents attached to terminal panes.
|
|
84
113
|
A session report contains the Herdr pane ID, the integration source, Pi's agent kind, a monotonic sequence, the session start reason, and an absolute Pi session path when available.
|
|
@@ -95,22 +124,28 @@ Replacement aborts pending metadata cleanup.
|
|
|
95
124
|
Native quit cleanup remains Herdr-owned: the extension does not release native Pi identity or clear reporting authority and restore references.
|
|
96
125
|
Herdr ignores official-source release requests, while authority clearing also removes session restore data; neither operation is used during shutdown.
|
|
97
126
|
|
|
98
|
-
## 🏷️
|
|
127
|
+
## 🏷️ Legacy Herdr pane metadata
|
|
99
128
|
|
|
100
|
-
|
|
129
|
+
This section applies only to legacy Herdr; hc does not receive these tokens or session-reference records.
|
|
130
|
+
Lifecycle integration publishes the `model`, `provider`, `thinking`, `session`, and `context_usage` token keys through `pane.report_metadata` under the `herdr:pi` source.
|
|
101
131
|
`model` and `provider` come from Pi's selected model, `thinking` comes from Pi's effective Thinking level, and `session` comes only from Pi's explicit session display name.
|
|
102
132
|
`context_usage` is Pi's current context percentage rounded to the nearest whole percent.
|
|
103
|
-
|
|
133
|
+
Each lifecycle metadata report is a full five-key patch, and an unavailable value is sent as JSON `null` so old data is cleared instead of retained.
|
|
104
134
|
Values are stripped of terminal controls, trimmed, and limited to 80 Unicode characters before crossing the socket.
|
|
105
135
|
The extension never publishes prompts, conversation text, tool arguments, credentials, raw session paths, or inferred session titles as metadata tokens.
|
|
106
136
|
It also never sets Herdr's pane `title`, `display_agent`, `state_labels`, agent lifecycle state, or session restore fields through metadata.
|
|
107
137
|
|
|
108
138
|
Metadata is evaluated after `session_start`, `session_info_changed`, `model_select`, `thinking_level_select`, `agent_settled`, and successful `session_compact` events.
|
|
109
|
-
Unchanged event snapshots are suppressed, rapid changes are coalesced, and the latest unchanged snapshot is refreshed no more often than every 30 minutes.
|
|
139
|
+
Unchanged ordinary event snapshots are suppressed, rapid changes are coalesced, and the latest unchanged snapshot is refreshed no more often than every 30 minutes.
|
|
140
|
+
Session start forces a TTL refresh after the session report completes so observers re-read session identity even when Herdr emits no dedicated identity-change event.
|
|
110
141
|
Each token has a one-hour TTL, so data from a crashed Pi process expires without steady socket traffic.
|
|
111
142
|
Orderly shutdown sends one best-effort five-key clear patch, while abrupt shutdown and failed clears fall back to the TTL.
|
|
112
143
|
Metadata uses the lifecycle reporter's monotonic sequence allocator and bounded best-effort sender, so older delayed reports cannot replace newer accepted values and socket failures never interrupt Pi.
|
|
113
144
|
|
|
145
|
+
The widget can display existing legacy `pi_spawn_*` records. The package does not create those records or spawn legacy peers.
|
|
146
|
+
The widget checks terminal and session identities before it shows an annotation. An annotation does not give a peer authority or process ownership.
|
|
147
|
+
See [Peer spawn provenance](./docs/peer-provenance.md) for the record format and display rules.
|
|
148
|
+
|
|
114
149
|
Herdr custom pane tokens use a `$name` row entry.
|
|
115
150
|
For example, this Herdr configuration displays Pi's model context without replacing pane labels or agent identity:
|
|
116
151
|
|
|
@@ -125,6 +160,10 @@ rows = [
|
|
|
125
160
|
|
|
126
161
|
## 🐑 Agent widget
|
|
127
162
|
|
|
163
|
+
Both backends share the passive five-row widget, separator, visibility setting, and collapse/restore behavior.
|
|
164
|
+
For hc, native error state and explicit terminal-ancestry annotations are described in [hc integration](./docs/hc-integration.md#widget-and-terminal-ancestry).
|
|
165
|
+
The pane, workspace, metadata, session-provenance, and subscription details below apply only to legacy Herdr.
|
|
166
|
+
|
|
128
167
|
The widget lists recognized agents across all workspaces in the connected Herdr session and excludes the pane running the current Pi session.
|
|
129
168
|
Each row presents state, agent, pane, and workspace in that order, using theme hierarchy instead of repeating field labels.
|
|
130
169
|
State icons follow Herdr's distinct static symbols: `×` blocked, `◐` working, `✓` done, `○` idle, and `·` unknown.
|
|
@@ -133,6 +172,10 @@ Agent identity prefers the name assigned by `herdr agent rename`, then Herdr dis
|
|
|
133
172
|
Pane identity uses its label or metadata title with a short pane ID, while workspace identity uses its label with a short workspace ID.
|
|
134
173
|
Terminal titles are not used as agent identity.
|
|
135
174
|
The widget orders agents by `blocked`, `done`, `working`, `idle`, and `unknown`, shows at most five rows, and reports any remaining count.
|
|
175
|
+
Verified spawn annotations use muted text: `spawned by you`, `spawned you`, or `spawned by <peer>`.
|
|
176
|
+
The list stays flat and status-prioritized; provenance confers no privileges.
|
|
177
|
+
Relationships are resolved from the full recognized-agent snapshot before excluding the current pane or limiting rows, so a hidden origin can still be named.
|
|
178
|
+
Missing or mismatched identity evidence does not create a relationship.
|
|
136
179
|
A state label published through Herdr metadata can replace the raw state name.
|
|
137
180
|
Herdr's public pane responses do not expose the blocked prompt message, so the widget cannot show that reason.
|
|
138
181
|
The widget does not focus panes, read terminal output, send prompts, or mark a background `done` state as seen.
|
|
@@ -150,7 +193,7 @@ Session replacement and shutdown abort the subscription, pending reads, reconnec
|
|
|
150
193
|
|
|
151
194
|
## 🔒 Security and privacy
|
|
152
195
|
|
|
153
|
-
|
|
196
|
+
In legacy Herdr mode, the extension connects only to the Unix socket or Windows named pipe provided by `HERDR_SOCKET_PATH`.
|
|
154
197
|
Lifecycle reporting sends the current Herdr pane ID, Pi session path or ID, lifecycle state, session start reason, and blocked label to that endpoint.
|
|
155
198
|
Metadata reporting sends the current Herdr pane ID plus only the selected model ID, provider ID, effective Thinking level, explicit Pi session name, and rounded context-usage percentage.
|
|
156
199
|
For the widget, it reads the canonical current pane and session-wide pane, workspace, and agent lists, then subscribes to pane creation, updates, closure, movement, exit, agent detection, agent-status changes, and workspace creation, closure, and renames.
|
|
@@ -160,17 +203,27 @@ Events from every workspace in the connected Herdr session can refresh the widge
|
|
|
160
203
|
The extension strips terminal controls at the display boundary and never reads sibling terminal output for the widget.
|
|
161
204
|
The package does not authenticate the endpoint, so trust the environment that launches Pi and controls these variables.
|
|
162
205
|
|
|
206
|
+
In hc mode, the extension uses the inherited socket without starting a core. `inspect` and the widget do not read terminal output. Status reports and sampled process facts do not authenticate peers.
|
|
207
|
+
|
|
208
|
+
**Spawn is denied by default.** For each spawn, an operator at an interactive Pi TUI must explicitly confirm that the selected local hc core on this connection was launched by a trusted host with a pre-spawn environment allowlist. The allowlist must govern the effective environment of programs started by hc, not just the environment of the calling Pi process. hc merges launch overrides into its own base environment and retains most of that base. The prompt does not filter the environment or authenticate the endpoint. Task text, environment values, and tool arguments are not proof. Approval applies to one spawn on the same socket. There is no silent retry, reconnect, force, or alternate backend for that spawn.
|
|
209
|
+
|
|
210
|
+
The extension starts the new peer with absolute Node and Pi CLI paths from the current Pi runtime and loads this package's extension and skill. Both executables must resolve outside the topmost Git checkout that contains the current working directory, or outside that directory if there is no Git checkout. The launch does not forward Pi's caller environment. It overrides `NODE_OPTIONS` and `NODE_PATH` as an additional precaution, not as a substitute for the host allowlist. The peer has ordinary user permissions and can incur provider costs. Do not include secrets in tasks or messages. Peer content does not grant user permission.
|
|
211
|
+
|
|
212
|
+
A fresh observation and idle status do not guarantee input ownership. hc can wait on a draft, and a person can take over after the check. The tool cannot check process identity and send atomically. See [hc trust and delivery limits](./docs/hc-integration.md#trust-and-delivery-limits).
|
|
213
|
+
|
|
163
214
|
## 🚧 Limitations
|
|
164
215
|
|
|
165
|
-
-
|
|
166
|
-
- The widget has no settings for placement, workspace scope, or row count; it does not
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
216
|
+
- Extension-owned lifecycle reporting, metadata reporting, and the agent widget are disabled in RPC, JSON, and print modes; hc status remains Pi-owned.
|
|
217
|
+
- The widget has no settings for placement, workspace scope, or row count; it does not configure other sessions or saved machines. hc may expose already configured mirrored terminals in its native list.
|
|
218
|
+
- Peer delivery uses terminal input, not a mailbox. Acknowledgement does not prove that the peer read or completed the task. Results are not forwarded automatically.
|
|
219
|
+
- Real provider collaboration and physical terminal behavior remain unverified.
|
|
220
|
+
- Neither widget reads blocked dialog text from terminal output; legacy Herdr also does not expose it through public pane responses.
|
|
221
|
+
- Legacy Herdr requires compatible pane and workspace subscriptions; unsupported subscriptions hide the widget without disabling lifecycle or metadata reporting.
|
|
222
|
+
- In legacy Herdr, a pane-label change appears on its next update event or authoritative refresh; an agent rename emits a pane-update event.
|
|
223
|
+
- Integration requires a compatible running backend and valid inherited bindings; hc's bounded native readiness checks do not provide legacy `interactive_ready` or authenticated session identity.
|
|
172
224
|
- Socket failures are intentionally silent after the bounded retry.
|
|
173
|
-
-
|
|
225
|
+
- Older Herdr integrations without the runtime-claim protocol must not be enabled alongside this package; remove the legacy integration as described in Quick start.
|
|
226
|
+
- The package does not install, start, update, or configure either backend. hc does not arrange windows; the separate herdr-app does and is not integrated here.
|
|
174
227
|
|
|
175
228
|
## 🗂️ Package layout
|
|
176
229
|
|
|
@@ -180,13 +233,15 @@ packages/pi-herdr/
|
|
|
180
233
|
│ ├── index.ts # Thin repository entrypoint
|
|
181
234
|
│ └── herdr-agent-state.ts # Herdr lifecycle integration
|
|
182
235
|
├── dist/ # Generated TypeScript runtime loaded by Pi
|
|
183
|
-
├── scripts/ #
|
|
184
|
-
|
|
236
|
+
├── scripts/ # Repository-only build and verification tools
|
|
237
|
+
├── docs/ # Legacy provenance and hc integration
|
|
238
|
+
├── skills/pi-herdr/ # Published hc peer skill
|
|
239
|
+
└── test/ # Behavior, lifecycle, and resource coverage
|
|
185
240
|
```
|
|
186
241
|
|
|
187
242
|
## 🔎 Keywords
|
|
188
243
|
|
|
189
|
-
Pi, Herdr, terminal multiplexer, coding agents, agent status, lifecycle state, pane metadata.
|
|
244
|
+
Pi, hc, herdr-core, Herdr, terminal multiplexer, coding agents, independent peers, terminal ancestry, spawn provenance, agent status, lifecycle state, pane metadata.
|
|
190
245
|
|
|
191
246
|
## 📄 License
|
|
192
247
|
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
// src/herdr-menu.ts
|
|
5
5
|
function createHerdrMenu(options) {
|
|
6
|
+
const hc = options.backend === "hc";
|
|
7
|
+
const label = hc ? "hc" : "Herdr";
|
|
6
8
|
return {
|
|
7
9
|
start: "main",
|
|
8
10
|
screens: {
|
|
9
11
|
// One setting stays on the main menu, matching /tool rather than adding a submenu.
|
|
10
12
|
main: () => ({
|
|
11
13
|
kind: "actions",
|
|
12
|
-
title:
|
|
14
|
+
title: label,
|
|
13
15
|
items: [
|
|
14
16
|
{
|
|
15
17
|
id: "widget",
|
|
16
18
|
label: `Agent widget: ${options.isEnabled() ? "On" : "Off"}`,
|
|
17
|
-
description: "Show or hide agents across all workspaces above the editor",
|
|
19
|
+
description: hc ? "Show or hide reporting agents across the connected hc core and machines" : "Show or hide agents across all workspaces above the editor",
|
|
18
20
|
action: "toggle"
|
|
19
21
|
},
|
|
20
22
|
{ id: "status", label: "Status", to: "status" },
|
|
@@ -25,19 +27,20 @@ function createHerdrMenu(options) {
|
|
|
25
27
|
}),
|
|
26
28
|
status: () => ({
|
|
27
29
|
kind: "detail",
|
|
28
|
-
title:
|
|
30
|
+
title: `${label} Status`,
|
|
29
31
|
lines: [
|
|
30
32
|
`Agent widget setting: ${options.isEnabled() ? "on" : "off"}`,
|
|
31
33
|
"The widget appears only in TUI mode with recognized sibling agents.",
|
|
32
|
-
"Scope: all workspaces in the connected Herdr session.",
|
|
33
|
-
"Lifecycle and metadata reporting are independent of this setting.",
|
|
34
|
+
hc ? "Scope: the connected hc core and its connected machines." : "Scope: all workspaces in the connected Herdr session.",
|
|
35
|
+
hc ? "Pi owns native OSC 7501 lifecycle reports; this setting changes only the widget." : "Lifecycle and metadata reporting are independent of this setting.",
|
|
36
|
+
...hc ? ["Spawn annotations describe terminal ancestry, not Pi session identity or authority."] : [],
|
|
34
37
|
`User settings file: ${options.settingsPath}`
|
|
35
38
|
],
|
|
36
39
|
hint: "back"
|
|
37
40
|
}),
|
|
38
41
|
help: () => ({
|
|
39
42
|
kind: "detail",
|
|
40
|
-
title:
|
|
43
|
+
title: `${label} Help`,
|
|
41
44
|
lines: [
|
|
42
45
|
"Toggle Agent widget from /herdr. Changes are saved immediately; closing does not undo them.",
|
|
43
46
|
"Manual pi-herdr.json changes apply after /reload or the next session start.",
|
|
@@ -54,4 +57,4 @@ function createHerdrMenu(options) {
|
|
|
54
57
|
export {
|
|
55
58
|
createHerdrMenu
|
|
56
59
|
};
|
|
57
|
-
//# sourceMappingURL=herdr-menu-
|
|
60
|
+
//# sourceMappingURL=herdr-menu-CA4DI2LZ.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/herdr-menu.ts"],
|
|
4
|
+
"sourcesContent": ["import type { MenuDefinition } from \"@narumitw/pi-tui-kit\";\n\nexport function createHerdrMenu(options: {\n settingsPath: string;\n backend?: \"herdr\" | \"hc\";\n isEnabled(): boolean;\n toggle(signal: AbortSignal): Promise<boolean>;\n}): MenuDefinition<undefined, \"main\" | \"status\" | \"help\", \"toggle\"> {\n const hc = options.backend === \"hc\";\n const label = hc ? \"hc\" : \"Herdr\";\n return {\n start: \"main\",\n screens: {\n // One setting stays on the main menu, matching /tool rather than adding a submenu.\n main: () => ({\n kind: \"actions\",\n title: label,\n items: [\n {\n id: \"widget\",\n label: `Agent widget: ${options.isEnabled() ? \"On\" : \"Off\"}`,\n description: hc\n ? \"Show or hide reporting agents across the connected hc core and machines\"\n : \"Show or hide agents across all workspaces above the editor\",\n action: \"toggle\",\n },\n { id: \"status\", label: \"Status\", to: \"status\" },\n { id: \"help\", label: \"Help\", to: \"help\" },\n { id: \"close\", label: \"Close\", close: true },\n ],\n hint: \"close\",\n }),\n status: () => ({\n kind: \"detail\",\n title: `${label} Status`,\n lines: [\n `Agent widget setting: ${options.isEnabled() ? \"on\" : \"off\"}`,\n \"The widget appears only in TUI mode with recognized sibling agents.\",\n hc\n ? \"Scope: the connected hc core and its connected machines.\"\n : \"Scope: all workspaces in the connected Herdr session.\",\n hc\n ? \"Pi owns native OSC 7501 lifecycle reports; this setting changes only the widget.\"\n : \"Lifecycle and metadata reporting are independent of this setting.\",\n ...(hc ? [\"Spawn annotations describe terminal ancestry, not Pi session identity or authority.\"] : []),\n `User settings file: ${options.settingsPath}`,\n ],\n hint: \"back\",\n }),\n help: () => ({\n kind: \"detail\",\n title: `${label} Help`,\n lines: [\n \"Toggle Agent widget from /herdr. Changes are saved immediately; closing does not undo them.\",\n \"Manual pi-herdr.json changes apply after /reload or the next session start.\",\n \"The widget defaults to on. Project overrides are not read.\",\n ],\n hint: \"back\",\n }),\n },\n actions: {\n toggle: async ({ signal }) => ((await options.toggle(signal)) ? { kind: \"stay\" } : { kind: \"rejected\" }),\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAEO,SAAS,gBAAgB,SAKoC;AAClE,QAAM,KAAK,QAAQ,YAAY;AAC/B,QAAM,QAAQ,KAAK,OAAO;AAC1B,SAAO;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA;AAAA,MAEP,MAAM,OAAO;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO;AAAA,UACL;AAAA,YACE,IAAI;AAAA,YACJ,OAAO,iBAAiB,QAAQ,UAAU,IAAI,OAAO,KAAK;AAAA,YAC1D,aAAa,KACT,4EACA;AAAA,YACJ,QAAQ;AAAA,UACV;AAAA,UACA,EAAE,IAAI,UAAU,OAAO,UAAU,IAAI,SAAS;AAAA,UAC9C,EAAE,IAAI,QAAQ,OAAO,QAAQ,IAAI,OAAO;AAAA,UACxC,EAAE,IAAI,SAAS,OAAO,SAAS,OAAO,KAAK;AAAA,QAC7C;AAAA,QACA,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO;AAAA,QACb,MAAM;AAAA,QACN,OAAO,GAAG,KAAK;AAAA,QACf,OAAO;AAAA,UACL,yBAAyB,QAAQ,UAAU,IAAI,OAAO,KAAK;AAAA,UAC3D;AAAA,UACA,KACI,6DACA;AAAA,UACJ,KACI,qFACA;AAAA,UACJ,GAAI,KAAK,CAAC,qFAAqF,IAAI,CAAC;AAAA,UACpG,uBAAuB,QAAQ,YAAY;AAAA,QAC7C;AAAA,QACA,MAAM;AAAA,MACR;AAAA,MACA,MAAM,OAAO;AAAA,QACX,MAAM;AAAA,QACN,OAAO,GAAG,KAAK;AAAA,QACf,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,QAAQ,OAAO,EAAE,OAAO,MAAQ,MAAM,QAAQ,OAAO,MAAM,IAAK,EAAE,MAAM,OAAO,IAAI,EAAE,MAAM,WAAW;AAAA,IACxG;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|