@henryqw/pi-herdr 0.5.0 → 0.5.1

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 (2) hide show
  1. package/README.md +5 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@henryqw/pi-herdr`
2
2
 
3
- Call the Herdr CLI from Node through one thin client. Extension authors share process handling without copying Herdr's command catalog. Pi users normally install a Herdr companion extension instead.
3
+ Call the Herdr CLI from Node through one Herdr Client. Extension authors share process handling without copying the list of Herdr commands. Pi users usually install a Herdr companion extension instead.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,11 +8,11 @@ Call the Herdr CLI from Node through one thin client. Extension authors share pr
8
8
  npm install @henryqw/pi-herdr
9
9
  ```
10
10
 
11
- Install the Herdr CLI and make `herdr` available on the calling process's `PATH`. Requires Herdr 0.9.3 or later. Run `herdr --version` to verify it.
11
+ Install the Herdr CLI. Make `herdr` available on the calling process's `PATH`. The client requires Herdr 0.9.3 or later. Run `herdr --version` to verify the version.
12
12
 
13
13
  ## Use
14
14
 
15
- Create a client and run a command. The client returns the parsed response.
15
+ Create a Herdr Client. Run a command. The client returns the parsed response.
16
16
 
17
17
  ```ts
18
18
  import { createHerdrClient } from "@henryqw/pi-herdr";
@@ -31,6 +31,6 @@ For a ready-to-use Pi workflow, see [`@henryqw/pi-herdr-tools`](https://pi.henry
31
31
  | `run` | function | Requires a successful exit and returns stdout. |
32
32
  | `json` | function | Requires a successful exit and parses a JSON object. |
33
33
  | `hasHerdrErrorCode` | function | Detects structured CLI errors in stdout or stderr. |
34
- | `startPiAgent` | function | Validates and builds the shared `agent start --kind pi --pane ... --` boundary. Before each start it checks with `pane process-info` that the pane shell still owns the foreground process group, runs `pane run <pane> "echo <token>"`, and polls `pane read` for up to 20 seconds until the token appears as its own output line with a prompt drawn after it. That proves the shell is reading input; without it, a launch command longer than 1024 bytes typed into a shell that is still starting or running a prompt hook loses its Enter on macOS and the pane waits forever. An occupied pane is not probed, so `agent start` still reports `agent_pane_busy`. A failed probe is returned as the result without starting the agent. It retries structured `agent_pane_busy` responses allowed by the caller's result-aware policy, with a five-attempt limit, and returns the raw final result. |
34
+ | `startPiAgent` | function | Validates and builds the shared `agent start --kind pi --pane ... --` boundary. Before each start, it checks `pane process-info`. The pane shell must still own the foreground process group. It runs `pane run <pane> "echo <token>"`. It then polls `pane read` for up to 20 seconds. The token must appear as its own output line, with a prompt after it. This proves that the shell is reading input. Without this check, a shell on macOS can lose Enter for a launch command longer than 1024 bytes. This occurs while the shell starts or runs a prompt hook. The pane then waits forever. The helper does not probe an occupied pane, so `agent start` still reports `agent_pane_busy`. If the probe fails, the helper returns its result without starting the agent. It retries structured `agent_pane_busy` responses when the caller's result-aware policy permits it. The limit is five tries. It returns the raw final result. |
35
35
 
36
- Callers build Pi-specific arguments and validate responses. The client does not mirror the Herdr command catalog. Herdr remains the source of truth for supported commands and response shapes.
36
+ Callers build Pi-specific arguments and validate responses. The Herdr Client does not copy the list of Herdr commands. Herdr defines the supported commands and response shapes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Shared client for interacting with Herdr from Node.js tools and Pi packages.",
5
5
  "keywords": [
6
6
  "pi-package",