{"_id":"@brooswit/herdr-sdk","_rev":"5-664e1223681382285543251809e25b83","name":"@brooswit/herdr-sdk","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@brooswit/herdr-sdk","version":"0.1.0","license":"MIT","_id":"@brooswit/herdr-sdk@0.1.0","maintainers":[{"name":"brooswit","email":"brooswit@gmail.com"}],"dist":{"shasum":"2da8de9932817b53ea333f1e0ce3f52412c3ef7f","tarball":"https://registry.npmjs.org/@brooswit/herdr-sdk/-/herdr-sdk-0.1.0.tgz","fileCount":39,"integrity":"sha512-XXZAmNZKHovG8yMeSHc/Is0rao7YLxYTAZQfyCvNxZxbQ4+2q06U3gIDaHY2lNFKzDkIvTq/WYTp/4nVomQy7A==","signatures":[{"sig":"MEYCIQCEadK4YGicCr1QVAYZpZ9tvmE7ptkd9wZ9Ef50MCofywIhALR/QhlwC84MuPxnxTppor8vd0W2uBYfwyTaMfvpkaB7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":436157},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"2da8de9932817b53ea333f1e0ce3f52412c3ef7f","engines":{"bun":">=1.1"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"bun test","build":"bun run generate && bun build src/index.ts --outdir dist --target bun --sourcemap=external && tsc -p tsconfig.build.json","check":"bun run generate && bun run typecheck && bun test test/unit && bun run scripts/verify-generated-is-committed.ts","generate":"bun run scripts/gen/index.ts","test:live":"HERDR_LIVE=1 bun test test/live","test:unit":"bun test test/unit","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"brooswit","email":"brooswit@gmail.com"},"_integrity":"sha512-XXZAmNZKHovG8yMeSHc/Is0rao7YLxYTAZQfyCvNxZxbQ4+2q06U3gIDaHY2lNFKzDkIvTq/WYTp/4nVomQy7A==","_npmVersion":"10.8.3","description":"Typed TypeScript client for the herdr socket API, generated from herdr's published JSON Schema","directories":{},"_nodeVersion":"24.3.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/herdr-sdk_0.1.0_1787581520089_0.34739650848843584","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@brooswit/herdr-sdk","version":"0.1.2","license":"MIT","_id":"@brooswit/herdr-sdk@0.1.2","maintainers":[{"name":"brooswit","email":"brooswit@gmail.com"}],"homepage":"https://github.com/brooswit/jsHerdrSDK#readme","bugs":{"url":"https://github.com/brooswit/jsHerdrSDK/issues"},"dist":{"shasum":"7a8325a49cef5866a7952917528f99f791cc81a5","tarball":"https://registry.npmjs.org/@brooswit/herdr-sdk/-/herdr-sdk-0.1.2.tgz","fileCount":45,"integrity":"sha512-iWpNAkPxcdqgF7PcQEKm/z1rQOvKvi4uMIHOBknmsNS7qXOPyYsEAJG2VSZUieHvv0+7Ldtsyir+QyeLEhGAPg==","signatures":[{"sig":"MEYCIQDqEKdpuEyo8JZdLNIPKVngvA3LcQMCKmyzoK/T7ZxRpgIhAM8xo8M7mNfTnz5kQcL8DfCkuOKX3LgwWCjfDiiiKQv+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@brooswit%2fherdr-sdk@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":453904},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.1"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3f490cfa7a19ec24e5166781b5c4b35042a8f92c","scripts":{"test":"bun test","build":"bun run generate && bun build src/index.ts --outdir dist --target bun --sourcemap=external && tsc -p tsconfig.build.json","check":"bun run generate && bun run typecheck && bun test test/unit test/load && bun run scripts/coverage/gate.ts && bun run scripts/verify-generated-is-committed.ts","generate":"bun run scripts/gen/index.ts && bun run scripts/load/generate.ts","test:live":"HERDR_LIVE=1 bun test test/live","test:load":"bun test test/load","test:unit":"bun test test/unit test/load && bun run scripts/coverage/gate.ts","typecheck":"tsc -p tsconfig.json --noEmit","release:check":"bun run scripts/release/check.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e53a42c2-cb4c-4392-93f0-e6f22f1336a1"}},"repository":{"url":"git+https://github.com/brooswit/jsHerdrSDK.git","type":"git"},"_npmVersion":"12.0.2","description":"Typed TypeScript client for the herdr socket API, generated from herdr's published JSON Schema","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/herdr-sdk_0.1.2_1787583127759_0.8850351758626587","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@brooswit/herdr-sdk","version":"0.1.3","license":"MIT","_id":"@brooswit/herdr-sdk@0.1.3","maintainers":[{"name":"brooswit","email":"brooswit@gmail.com"}],"homepage":"https://github.com/brooswit-factory/jsHerdrSDK#readme","bugs":{"url":"https://github.com/brooswit-factory/jsHerdrSDK/issues"},"dist":{"shasum":"d3e336b85c86a0529b55d3475b517bfb40de3bfc","tarball":"https://registry.npmjs.org/@brooswit/herdr-sdk/-/herdr-sdk-0.1.3.tgz","fileCount":45,"integrity":"sha512-mEwipLDaDGnUEtUhGBSjDUhFU3gB3HvkjyC9Q7OLJNugpU7Hk3romKnO1ZUna9WyZYq7lteqaLu5TmPvILkekQ==","signatures":[{"sig":"MEQCICMYHe+Wk+20pYCQc8ynMHX7DVWopDAZR4pUMf8oz7eDAiBlCTLHaen4iBMmUGH8R7LUmcJDReQJcfSfIp1LZVQqFw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@brooswit%2fherdr-sdk@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":453928},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.1"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"e34fd3f2cf32722ed570d1c232c35bdd83eef312","scripts":{"test":"bun test","build":"bun run generate && bun build src/index.ts --outdir dist --target bun --sourcemap=external && tsc -p tsconfig.build.json","check":"bun run generate && bun run typecheck && bun test test/unit test/load && bun run scripts/coverage/gate.ts && bun run scripts/verify-generated-is-committed.ts","generate":"bun run scripts/gen/index.ts && bun run scripts/load/generate.ts","test:live":"HERDR_LIVE=1 bun test test/live","test:load":"bun test test/load","test:unit":"bun test test/unit test/load && bun run scripts/coverage/gate.ts","typecheck":"tsc -p tsconfig.json --noEmit","release:check":"bun run scripts/release/check.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f605c895-b393-4e54-92f4-45aee133ce1e"}},"repository":{"url":"git+https://github.com/brooswit-factory/jsHerdrSDK.git","type":"git"},"_npmVersion":"12.0.2","description":"Typed TypeScript client for the herdr socket API, generated from herdr's published JSON Schema","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/herdr-sdk_0.1.3_1787773883871_0.9945857478558497","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@brooswit/herdr-sdk","version":"0.2.0","license":"MIT","_id":"@brooswit/herdr-sdk@0.2.0","maintainers":[{"name":"brooswit","email":"brooswit@gmail.com"}],"homepage":"https://github.com/brooswit-factory/jsHerdrSDK#readme","bugs":{"url":"https://github.com/brooswit-factory/jsHerdrSDK/issues"},"dist":{"shasum":"8cdeadf209dd37b6b35bff76f550db73446f902d","tarball":"https://registry.npmjs.org/@brooswit/herdr-sdk/-/herdr-sdk-0.2.0.tgz","fileCount":45,"integrity":"sha512-KOY+DjuwYuteM3gmsoTEdt1fZgoJP1yrfcAYhlo9Sa4v5FAgWsZVur9JE12y49rgBbOfbbYEJTV2XdY4OWONVA==","signatures":[{"sig":"MEQCIHCNviPcZfuSu0aqpo2BlqXXTDPqGBQFd3Zg03qDiubSAiAomgkkUuESc9DgxyRMFOuKZzx3LVVyRuSHztH9+BGwHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDubyohvNvrgFCp2pbprHmKxvxQJs5hsrGk6g3kOP8XoQIgYTsG73LuWIyzpLaN5/qGMzIucc4Dv8VPUreroCuaeAM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@brooswit%2fherdr-sdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":464304},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.1"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"98c2d548e5efae9acfc1b08f70780a603c813ca0","scripts":{"test":"bun test","build":"bun run generate && bun build src/index.ts --outdir dist --target bun --sourcemap=external && tsc -p tsconfig.build.json","check":"bun run generate && bun run typecheck && bun test test/unit test/load && bun run scripts/coverage/gate.ts && bun run scripts/verify-generated-is-committed.ts","generate":"bun run scripts/gen/index.ts && bun run scripts/load/generate.ts","test:live":"HERDR_LIVE=1 bun test test/live","test:load":"bun test test/load","test:unit":"bun test test/unit test/load && bun run scripts/coverage/gate.ts","typecheck":"tsc -p tsconfig.json --noEmit","release:check":"bun run scripts/release/check.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f605c895-b393-4e54-92f4-45aee133ce1e"}},"repository":{"url":"git+https://github.com/brooswit-factory/jsHerdrSDK.git","type":"git"},"_npmVersion":"12.1.0","description":"Typed TypeScript client for the herdr socket API, generated from herdr's published JSON Schema","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/herdr-sdk_0.2.0_1790565932967_0.5603382563738539","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@brooswit/herdr-sdk@0.3.0","bugs":{"url":"https://github.com/brooswit-factory/jsHerdrSDK/issues"},"dist":{"shasum":"4ebace392fa07070b40d73a4eb422229b5bd50ab","tarball":"https://registry.npmjs.org/@brooswit/herdr-sdk/-/herdr-sdk-0.3.0.tgz","fileCount":45,"integrity":"sha512-55Hlf3/VFiXjJIj3i+p1K/vqivjN+ar3ebKDhR0XXvFmdte+Z7SLEQhvDW+hDdZcBqX3MfYTaQ8vvkkFFK4wvA==","signatures":[{"sig":"MEUCIQCu+QFbDJnQOH1HCu3plC6AYnNH1pXq+lH3IXS1fGhkcQIgUvnkGDX3T4K3GMICOx9ncscy6S5Pd34NvWbplXCLwDo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDYS2QwwYr6nUDuBDuFLiXY4VptE3hFwR8uvO51hVgQlgIhAOhLiq5XBCHEmB471LHBlObNeZ5mNftz83fLZJlgNZ7W"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@brooswit%2fherdr-sdk@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":501545},"main":"./dist/index.js","name":"@brooswit/herdr-sdk","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.1"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3b7580ae00a9e35b4cf0af9fc03948998885d4a2","license":"MIT","scripts":{"test":"bun test","build":"bun run generate && bun build src/index.ts --outdir dist --target bun --sourcemap=external && tsc -p tsconfig.build.json","check":"bun run generate && bun run typecheck && bun test test/unit test/load && bun run scripts/coverage/gate.ts && bun run scripts/verify-generated-is-committed.ts","generate":"bun run scripts/gen/index.ts && bun run scripts/load/generate.ts","test:live":"HERDR_LIVE=1 bun test test/live","test:load":"bun test test/load","test:unit":"bun test test/unit test/load && bun run scripts/coverage/gate.ts","typecheck":"tsc -p tsconfig.json --noEmit","release:check":"bun run scripts/release/check.ts"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f605c895-b393-4e54-92f4-45aee133ce1e"}},"homepage":"https://github.com/brooswit-factory/jsHerdrSDK#readme","repository":{"url":"git+https://github.com/brooswit-factory/jsHerdrSDK.git","type":"git"},"_npmVersion":"12.1.0","description":"Typed TypeScript client for the herdr socket API, generated from herdr's published JSON Schema","directories":{},"maintainers":[{"name":"brooswit","email":"brooswit@gmail.com"}],"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/herdr-sdk_0.3.0_1790566599708_0.21222441502508205"}}},"time":{"created":"2026-08-24T14:25:19.963Z","modified":"2026-09-28T03:36:40.129Z","0.1.0":"2026-08-24T14:25:20.241Z","0.1.2":"2026-08-24T14:52:07.959Z","0.1.3":"2026-08-26T19:51:24.010Z","0.2.0":"2026-09-28T03:25:33.075Z","0.3.0":"2026-09-28T03:36:39.783Z"},"bugs":{"url":"https://github.com/brooswit-factory/jsHerdrSDK/issues"},"license":"MIT","homepage":"https://github.com/brooswit-factory/jsHerdrSDK#readme","repository":{"url":"git+https://github.com/brooswit-factory/jsHerdrSDK.git","type":"git"},"description":"Typed TypeScript client for the herdr socket API, generated from herdr's published JSON Schema","maintainers":[{"name":"brooswit","email":"brooswit@gmail.com"}],"readme":"# @brooswit/herdr-sdk\n\nTyped TypeScript client for the [herdr](https://herdr.dev) socket API, generated from the schema herdr itself publishes (`herdr api schema --json`).\n\n```ts\nimport { HerdrClient } from \"@brooswit/herdr-sdk\";\n\nconst h = new HerdrClient();                       // herdr's own default config dir, or $HERDR_SOCKET_PATH\nconst { snapshot } = await h.session.snapshot();  // fully typed\nawait h.agent.wait({ target: \"w1:p3\", until: [\"idle\"], timeout_ms: 30_000 });\n\nconst sub = await h.subscribe([{ type: \"pane.agent_status_changed\", pane_id: \"w1:p3\" }]);\nfor await (const frame of sub) console.log(frame.event, frame.data);\n```\n\n## Layers\n\n| dir | job |\n|---|---|\n| `src/transport` | unix socket ↔ newline-delimited frames. No JSON, no protocol. |\n| `src/protocol` | envelope shapes, `HerdrError`, ids. No I/O. |\n| `src/client` | one request → one response → server closes (that is herdr's wire behaviour). |\n| `src/events` | `events.subscribe`: the one long-lived connection, as an async iterator. |\n| `src/services` | one file per method family; thin typed façades. |\n| `src/reducers` | pure: snapshot + push frames → current fleet state. |\n| `src/generated` | codegen output. **Do not edit**; run `bun run generate`. |\n| `scripts/gen` | the generator, one file per output. |\n\n## Socket address\n\n- **Env var precedence:** `HERDR_SOCKET_PATH` (herdr's own published override) wins; `HERDR_SOCKET` is honored only as a deprecated fallback when `HERDR_SOCKET_PATH` is unset. Prefer `HERDR_SOCKET_PATH` in new code.\n- **Default path**, when neither is set, mirrors herdr's own config-dir resolution: `XDG_CONFIG_HOME` if set; else on Windows `%APPDATA%`, then `%USERPROFILE%\\AppData\\Roaming`, then `$HOME/.config`, then the temp dir; else (POSIX) `$HOME/.config`, then the temp dir — joined with `herdr/herdr.sock` (or `herdr-dev/herdr.sock` with `{ dev: true }`, or `.../sessions/<name>/herdr.sock` with `{ sessionName }`).\n- **Per-OS address:** on Linux/macOS the path above is a real Unix-domain socket, used unchanged. On Windows, herdr listens on the named pipe `\\\\.\\pipe\\<path>` instead — the path itself is only ever prefixed, never otherwise rewritten. This SDK derives that automatically from `process.platform`; `socketEndpoint()` (exported from `src/transport/socket-path.ts`) does the derivation if you need it directly.\n- **Dev builds / named sessions:** pass `{ dev: true }` to point at a `herdr-dev` build's config dir, or `{ sessionName }` to connect to a named session's socket, e.g. `new HerdrClient({ dev: true, sessionName: \"work\" })`. Neither is ever guessed at runtime.\n\n## Wire facts this is built on (herdr 0.8.2, protocol 20)\n\n- Request `{id, method, params}` → `{id, result:{type,…}}` or `{id, error:{code,message}}`.\n- The server **closes after one response**. Each RPC is its own connection.\n- `events.subscribe` acks `subscription_started` and then keeps the connection open, streaming `{event, data}` frames.\n- Timeouts are typed errors (`code: \"timeout\"`), never hangs. `isTimeout(e)`.\n- The schema does not say which result each method returns; `scripts/gen/method-result-map.ts` does, and `test/live` proves it.\n\n## Scripts\n\n```\nbun run generate     # schema → src/generated\nbun run check        # generate + drift guard + typecheck + unit  (what CI runs)\nbun run build\nHERDR_LIVE=1 bun test test/live   # against your running herdr\n```\n","readmeFilename":"README.md"}