@henryqw/pi-herdr 0.1.1 → 0.1.3

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 +10 -4
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # `@henryqw/pi-herdr`
2
2
 
3
- Shared client for interacting with Herdr from Node.js tools and Pi packages.
3
+ Run Herdr CLI commands from Node through one thin client. Callers keep orchestration and command-specific checks.
4
4
 
5
- This solves common Herdr interaction plumbing: running commands through an injected executor, handling failures consistently, and parsing JSON responses without taking command orchestration away from callers.
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @henryqw/pi-herdr
9
+ ```
10
+
11
+ ## Use
6
12
 
7
13
  ```ts
8
14
  import { createHerdrClient } from "@henryqw/pi-herdr";
@@ -12,9 +18,9 @@ const herdr = createHerdrClient((command, args, options) =>
12
18
  const response = await herdr.json(["agent", "list"], { cwd: ctx.cwd });
13
19
  ```
14
20
 
15
- `exec` validates string argv and returns raw process result, `run` requires successful exit and returns stdout, and `json` also parses JSON object response. `hasHerdrErrorCode` detects structured CLI errors in stdout or stderr.
21
+ `exec` validates string argv and returns the raw process result. `run` requires a successful exit and returns stdout. `json` also parses a JSON object. `hasHerdrErrorCode` detects structured CLI errors in stdout or stderr.
16
22
 
17
- Client does not mirror Herdr command catalog or validate command-specific response fields. Callers keep domain checks; Herdr remains source of truth for supported commands and response shapes.
23
+ Client does not mirror the Herdr command catalog. Herdr remains the source of truth for supported commands and response shapes.
18
24
 
19
25
  ## Development
20
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Shared client for interacting with Herdr from Node.js tools and Pi packages.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -28,7 +28,7 @@
28
28
  "scripts": {
29
29
  "build": "tsc --project tsconfig.build.json",
30
30
  "test": "npm run build && node --test test/*.test.ts",
31
- "typecheck": "tsc --noEmit --allowImportingTsExtensions --target ES2022 --module NodeNext --moduleResolution NodeNext --types node --skipLibCheck src/*.ts test/*.test.ts",
31
+ "typecheck": "tsc --noEmit --allowImportingTsExtensions --target ES2022 --module NodeNext --moduleResolution NodeNext --types node --skipLibCheck src/*.ts",
32
32
  "prepack": "npm run build",
33
33
  "pack:check": "npm pack --dry-run"
34
34
  },