@henryqw/pi-herdr 0.4.0 → 0.4.2
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 +10 -12
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Run Herdr CLI commands from Node through one thin client. Callers keep orchestra
|
|
|
4
4
|
|
|
5
5
|
## Why
|
|
6
6
|
|
|
7
|
-
- **Created for**:
|
|
8
|
-
- **Advantage**: One thin client keeps orchestration local
|
|
7
|
+
- **Created for**: Call Herdr CLI commands from Node without duplicating wrapper logic across extensions.
|
|
8
|
+
- **Advantage**: One thin client keeps orchestration local. The Herdr CLI remains the source of truth for commands and response shapes.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -22,14 +22,12 @@ const herdr = createHerdrClient(pi.exec.bind(pi));
|
|
|
22
22
|
const response = await herdr.json(["agent", "list"], { cwd: ctx.cwd });
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
| API | Result |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `exec` | Validates string argv and returns the raw process result. |
|
|
28
|
+
| `run` | Requires a successful exit and returns stdout. |
|
|
29
|
+
| `json` | Requires a successful exit and parses a JSON object. |
|
|
30
|
+
| `hasHerdrErrorCode` | Detects structured CLI errors in stdout or stderr. |
|
|
31
|
+
| `startPiAgent` | Validates and builds the shared `agent start --kind pi --pane ... --` boundary. 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. |
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Development
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm test --workspace @henryqw/pi-herdr
|
|
33
|
-
npm run typecheck --workspace @henryqw/pi-herdr
|
|
34
|
-
npm run pack:check --workspace @henryqw/pi-herdr
|
|
35
|
-
```
|
|
33
|
+
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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-herdr",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Shared client for interacting with Herdr from Node.js tools and Pi packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"files": [
|
|
17
|
+
"LICENSE",
|
|
17
18
|
"dist",
|
|
18
|
-
"README.md"
|
|
19
|
-
"LICENSE"
|
|
19
|
+
"README.md"
|
|
20
20
|
],
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"exports": {
|