@narumitw/pi-herdr 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @narumitw/pi-herdr
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e2e724f: Add an hc bootstrap skill that loads version-matched Herdr Core guidance through `hc --skill` after an explicit request, without requiring a Herdr-managed pane. Preserve the existing herdr skill and legacy integration.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [4f79c28]
12
+ - @narumitw/pi-tui-kit@0.69.1
13
+
3
14
  ## 0.3.5
4
15
 
5
16
  ### Patch Changes
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@narumitw/pi-herdr)](https://www.npmjs.com/package/@narumitw/pi-herdr) [![Pi extension](https://img.shields.io/badge/Pi-extension-blue)](https://pi.dev) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
4
4
 
5
- Connect Pi's interactive lifecycle to Herdr and bootstrap the operating guidance supplied by the installed Herdr CLI.
5
+ Connect Pi's interactive lifecycle to Herdr and load operating guidance from the installed Herdr and Herdr Core CLIs.
6
6
 
7
7
  ## ✨ Features
8
8
 
@@ -12,8 +12,8 @@ Connect Pi's interactive lifecycle to Herdr and bootstrap the operating guidance
12
12
  - Refreshes the widget on Herdr pane, workspace-name, and agent-status updates without polling the CLI.
13
13
  - Coalesces rapid state changes and retries short-lived local socket failures without interrupting Pi.
14
14
  - Derives blocked state from Pi's public `ui_prompt_start` and `ui_prompt_end` lifecycle events.
15
- - Bundles a thin `herdr` bootstrap skill for explicit Herdr inspection and control requests.
16
- - Loads version-matched operating guidance from the installed `herdr --skill` command.
15
+ - Bundles thin `herdr` and `hc` bootstrap skills for explicit inspection and control requests.
16
+ - Loads version-matched operating guidance from `herdr --skill` or `hc --skill`.
17
17
  - Keeps extension and skill installation in one Pi package.
18
18
 
19
19
  ## 📦 Install
@@ -49,6 +49,7 @@ The extension activates automatically when `HERDR_ENV=1`, `HERDR_SOCKET_PATH`, a
49
49
  When the current Herdr workspace contains another recognized agent, Pi shows its state in a widget above the editor.
50
50
  Ask Pi to use Herdr, or invoke `/skill:herdr`, when you want it to inspect or control the current Herdr session.
51
51
  Before the first control command, the bootstrap loads `herdr --skill` once and reuses those instructions while they remain in the current context.
52
+ For Herdr Core terminals, invoke `/skill:hc` instead; it loads `hc --skill` without requiring a Herdr-managed pane.
52
53
 
53
54
  If the standalone integration and skill are already installed, remove them after installing this package to avoid duplicate state reports and skill-name collisions:
54
55
 
@@ -61,8 +62,15 @@ Run `/reload` or restart Pi after changing the installed resources.
61
62
 
62
63
  ## 🧠 Skills
63
64
 
64
- The bundled `herdr` skill loads version-matched operating guidance after an explicit Herdr request.
65
- It treats panes created for background work as temporary and attempts to close them after collecting the required output.
65
+ The bundled skills load CLI-owned guidance once and reuse it while it remains in the current context:
66
+
67
+ - [`herdr`](./skills/herdr/SKILL.md), invoked with `/skill:herdr`, loads `herdr --skill` for legacy Herdr panes and requires `HERDR_ENV=1`.
68
+ - [`hc`](./skills/hc/SKILL.md), invoked with `/skill:hc`, loads `hc --skill` for Herdr Core persistent terminals and agents; it requires neither `HERDR_ENV=1` nor `HC_TERMINAL_ID`.
69
+
70
+ Both skills apply only after an explicit request for their CLI, not merely because a task could use background work or delegation.
71
+ The CLIs are separate; neither skill substitutes the other CLI when its command fails.
72
+
73
+ The `herdr` skill treats panes created for background work as temporary and attempts to close them after collecting the required output.
66
74
  Ask Pi explicitly to keep a pane open after the task when you want to inspect or use it later.
67
75
  Automatic cleanup runs only when the installed Herdr guidance provides a conditional close that atomically confirms the recorded pane ownership and acceptable agent or shell state; otherwise Pi leaves the pane open and reports the limitation.
68
76
 
@@ -168,11 +176,11 @@ The subscription can deliver matching pane events from other workspaces in the s
168
176
  The extension filters presentation to the current workspace, strips terminal controls at the display boundary, and never reads sibling terminal output for the widget.
169
177
  The package does not authenticate the endpoint, so trust the environment that launches Pi and controls these variables.
170
178
 
171
- The bundled bootstrap loads operating guidance from the local `herdr --skill` command only after an explicit user request involving Herdr.
172
- The returned CLI-owned skill can direct Pi to inspect terminals, create panes, start agents, send input, and run commands through the local `herdr` CLI.
179
+ The bundled skills load operating guidance from the local CLI only after an explicit request for Herdr or Herdr Core.
180
+ The returned CLI-owned instructions can direct Pi to inspect terminals, create panes or persistent terminals, start agents, send input, and run local or remote commands.
173
181
  Those commands execute with the same user permissions as Pi and can affect live terminal sessions.
174
- The bootstrap stops when `HERDR_ENV` is not `1`, when the CLI is unavailable, or when `herdr --skill` fails.
175
- Command recipes, approval handling, and other operating safety rules come from the installed Herdr version instead of being duplicated by this package.
182
+ Both bootstraps stop when their CLI is unavailable or its `--skill` command fails; the `herdr` bootstrap also stops when `HERDR_ENV` is not `1`.
183
+ Command recipes, approval handling, and other operating safety rules come from the selected CLI's installed version instead of being duplicated by this package.
176
184
 
177
185
  ## 🚧 Limitations
178
186
 
@@ -182,10 +190,10 @@ Command recipes, approval handling, and other operating safety rules come from t
182
190
  - The widget requires compatible pane-update and workspace-name subscriptions; unsupported subscriptions hide the widget without disabling lifecycle or metadata reporting.
183
191
  - A pane-label change appears on its next update event or authoritative refresh; an agent rename emits a pane-update event.
184
192
  - Integration requires a running compatible Herdr session and valid injected environment variables.
185
- - Model control requires an installed Herdr CLI that supports `herdr --skill`.
193
+ - Each skill requires its matching CLI with `--skill` support; `hc` does not enable the legacy Herdr lifecycle reports or widget.
186
194
  - Socket failures are intentionally silent after the bounded retry.
187
195
  - Skill cleanup tracking exists only in the active model context, so compaction, session replacement, `/reload`, or shutdown can leave temporary panes open.
188
- - The package does not install, start, update, or configure Herdr itself.
196
+ - The package does not install, start, update, or configure Herdr or Herdr Core itself.
189
197
 
190
198
  ## 🗂️ Package layout
191
199
 
@@ -196,13 +204,13 @@ packages/pi-herdr/
196
204
  │ └── herdr-agent-state.ts # Herdr lifecycle integration
197
205
  ├── dist/ # Generated TypeScript runtime loaded by Pi
198
206
  ├── scripts/ # Deterministic runtime builder
199
- ├── skills/herdr/ # Published bootstrap for CLI-owned guidance
207
+ ├── skills/ # Published herdr and hc bootstraps for CLI-owned guidance
200
208
  └── test/ # Behavior and lifecycle coverage
201
209
  ```
202
210
 
203
211
  ## 🔎 Keywords
204
212
 
205
- Pi, Herdr, terminal multiplexer, coding agents, agent orchestration, lifecycle state.
213
+ Pi, Herdr, Herdr Core, hc, terminal multiplexer, persistent terminals, coding agents, agent orchestration, lifecycle state.
206
214
 
207
215
  ## 📄 License
208
216
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-herdr",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "Herdr agent-state integration and operating skill for Pi.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "typecheck": "tsc --noEmit"
38
38
  },
39
39
  "dependencies": {
40
- "@narumitw/pi-tui-kit": "^0.69.0"
40
+ "@narumitw/pi-tui-kit": "^0.69.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@earendil-works/pi-coding-agent": "*",
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: hc
3
+ description: "Control persistent terminals and coding agents through the Herdr Core hc CLI. Use only when the user explicitly mentions hc, Herdr Core, or herdr-core, or asks to use them to run programs, delegate tasks, inspect terminals, or send input. Do not use merely because a task could benefit from a background terminal, delegation, or parallel work."
4
+ ---
5
+
6
+ # Herdr Core
7
+
8
+ `hc` controls Herdr Core terminals, not legacy Herdr panes.
9
+ It does not require a Herdr-managed pane or `HC_TERMINAL_ID`.
10
+
11
+ Before the first hc control command in a session, check whether the complete output of `hc --skill` is already present in the current context.
12
+ If it is present, reuse it and do not load it again.
13
+ Otherwise run this single shell call:
14
+
15
+ ```bash
16
+ hc --skill
17
+ ```
18
+
19
+ If the CLI is unavailable or the command fails, report the error and stop without falling back to `herdr`.
20
+ Read the returned skill completely and follow it as the authoritative operating instructions for the installed Herdr Core version.
21
+ If the output is truncated, retrieve the complete guidance before running a control command.
22
+ Run it again only after compaction removes those instructions or when the user explicitly asks to refresh them.