{"_id":"@danypops/pi-process-harness","_rev":"6-ba24c1c5663486b821adc57056038cd0","name":"@danypops/pi-process-harness","dist-tags":{"latest":"0.3.2"},"versions":{"0.0.1":{"name":"@danypops/pi-process-harness","version":"0.0.1","keywords":["pi","pi-extension","testing","test-harness","integration-test"],"license":"MIT","_id":"@danypops/pi-process-harness@0.0.1","maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"dist":{"shasum":"182005d6baea668089127e00f7dec21482c588b9","tarball":"https://registry.npmjs.org/@danypops/pi-process-harness/-/pi-process-harness-0.0.1.tgz","fileCount":27,"integrity":"sha512-xTGHG+kfRa/p5a/s9BOdU2cUTWLikyrCLeifPChixVubhDq7iDvdDYfJ7HI05H0D7swTxGL8WKkLG4DeYU8IYw==","signatures":[{"sig":"MEQCIBdp/zTW1xC8040XEVS/WVvHIlQzv0E+bOi/+zYUkyzHAiBDf1sNOJ+bKfhm17rukGcYzGp4KZ2Q9iSnzpDRHt6zsw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44166},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"dda6f59430dccc4492c0a9ad24660990399a93e0","scripts":{"test":"bun run build && bun test test","build":"rm -rf dist && tsc -p tsconfig.build.json","format":"biome format --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"danypops","email":"danypops@protonmail.com"},"repository":{"url":"git+https://github.com/DanyPops/pi-integral.git","type":"git","directory":"packages/pi-process-harness"},"_npmVersion":"11.14.1","description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@earendil-works/pi-ai":"*","@danypops/process-support":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"*","bun-types":"latest","typescript":"^5.9.2","@types/node":"^22.0.0","@biomejs/biome":"^2.5.6","@earendil-works/pi-coding-agent":"*"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-process-harness_0.0.1_1785748819277_0.15393666218154745","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@danypops/pi-process-harness","version":"0.1.0","keywords":["pi","pi-extension","testing","test-harness","integration-test"],"license":"MIT","_id":"@danypops/pi-process-harness@0.1.0","maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"dist":{"shasum":"daf82bd759fb0656793ebdc7daa4a75dfa545c57","tarball":"https://registry.npmjs.org/@danypops/pi-process-harness/-/pi-process-harness-0.1.0.tgz","fileCount":36,"integrity":"sha512-CAGoKVm0WfP/foX+8I3kfYEnIgkzNfLaAK3+DTmA54WkFZbgAF7Zs9PjSl/+qqrv+Hr/VvjAqB1G8V61Gi/i8Q==","signatures":[{"sig":"MEYCIQC/ddS1ga+IjntdrBp+VZvcCXT7ULkuUO38+Q6ltSjNpQIhAMdUhBSIUxlVEiN9I+MJWPmZvb3JkBUoO1cDxgzkVULi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@danypops%2fpi-process-harness@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":65678},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"914b6c765ce4925c316a12e6417aec8f5e6b6616","scripts":{"test":"bun run build && bun test test","build":"rm -rf dist && tsc -p tsconfig.build.json","format":"biome format --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:513f6598-9647-4a7c-b4d8-d99d959afc75"}},"repository":{"url":"git+https://github.com/DanyPops/pi-integral.git","type":"git","directory":"packages/pi-process-harness"},"_npmVersion":"12.0.2","description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@earendil-works/pi-ai":"*"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"*","bun-types":"latest","typescript":"^5.9.2","@types/node":"^22.0.0","@biomejs/biome":"^2.5.6","@earendil-works/pi-coding-agent":"*"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-process-harness_0.1.0_1785827005397_0.45579455579552475","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@danypops/pi-process-harness","version":"0.1.1","keywords":["pi","pi-extension","testing","test-harness","integration-test"],"license":"MIT","_id":"@danypops/pi-process-harness@0.1.1","maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"dist":{"shasum":"d1c92fd72fc4e9c187868f28444cfa7e8a366b33","tarball":"https://registry.npmjs.org/@danypops/pi-process-harness/-/pi-process-harness-0.1.1.tgz","fileCount":36,"integrity":"sha512-Rg2iiUp9vYE4HT86ZG8Ov9tx3KkCDR+MN8XUjpXSvVoVnTWCGumA/qscPZiol7vYJfRePiZvDlMBnLy8/D5jGQ==","signatures":[{"sig":"MEYCIQC3rd1DQ3hHVL/qlVgzFoPcKNrzjo1B2PzQIYQBSxsbIgIhAKZ/7J64MiID6bkyZCvX8N6Tu6ZTYQk5bZ22gznMcQFv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@danypops%2fpi-process-harness@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":65966},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"f4ea5d9cb8887b169af97dee191d372cd7d0a68a","scripts":{"test":"bun run build && bun test test","build":"rm -rf dist && tsc -p tsconfig.build.json","format":"biome format --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:513f6598-9647-4a7c-b4d8-d99d959afc75"}},"repository":{"url":"git+https://github.com/DanyPops/pi-integral.git","type":"git","directory":"packages/pi-process-harness"},"_npmVersion":"12.0.2","description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@earendil-works/pi-ai":"*"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"*","bun-types":"latest","typescript":"^5.9.2","@types/node":"^22.0.0","@biomejs/biome":"^2.5.6","@earendil-works/pi-coding-agent":"*"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-process-harness_0.1.1_1785863197507_0.7301182822776471","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@danypops/pi-process-harness","version":"0.1.2","keywords":["pi","pi-extension","testing","test-harness","integration-test"],"license":"MIT","_id":"@danypops/pi-process-harness@0.1.2","maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"dist":{"shasum":"da3e66a7b0edf273184f17ad7093c8aa84663235","tarball":"https://registry.npmjs.org/@danypops/pi-process-harness/-/pi-process-harness-0.1.2.tgz","fileCount":39,"integrity":"sha512-TlSmDWoe6dkBsjSjrudXHTO98cx+vNX3COhntQ9UL83exuQ9THp3zcZBP656xUc6wIe1ik4HbfTuclolmVOZ+A==","signatures":[{"sig":"MEYCIQDm7vwDwRkQsQfZ+IEqvIIkvRJTOM0DDadd+Sk7Ln6OrwIhAKKn29kLwmKZ/QQ2uao5ru9fCW4qds5+QMM5QtGc1bYF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@danypops%2fpi-process-harness@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72898},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"29160aa033fbd53c54c0e8eb83697ac66eed2b7d","scripts":{"test":"bun run build && bun test test","build":"rm -rf dist && tsc -p tsconfig.build.json","format":"biome format --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:513f6598-9647-4a7c-b4d8-d99d959afc75"}},"repository":{"url":"git+https://github.com/DanyPops/pi-integral.git","type":"git","directory":"packages/pi-process-harness"},"_npmVersion":"12.0.2","description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@earendil-works/pi-ai":"*"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"*","bun-types":"latest","typescript":"^5.9.2","@types/node":"^22.0.0","@biomejs/biome":"^2.5.6","@earendil-works/pi-coding-agent":"*"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-process-harness_0.1.2_1786289981780_0.8387559703677863","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@danypops/pi-process-harness","version":"0.1.3","keywords":["pi","pi-extension","testing","test-harness","integration-test"],"license":"MIT","_id":"@danypops/pi-process-harness@0.1.3","maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"dist":{"shasum":"3cc9e144cf81c140d6d2f480b759f80416e5d3d3","tarball":"https://registry.npmjs.org/@danypops/pi-process-harness/-/pi-process-harness-0.1.3.tgz","fileCount":39,"integrity":"sha512-Gj5JTomiIxeSQxPbd6BphMJmVNxSHlMC1hchaGVR62Q0xAGP5aHozeZ+bNFjEyo+lPLE8Ev5nEzHg8yeUiDAAg==","signatures":[{"sig":"MEUCIFdvHtVOThXRnchkAnOD6AlST+CnjUshAe1Da5GRGM+WAiEA+KcUkMTd9WRkTplzlzDGJWxi6WIam9gHj5uuhF+J69E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@danypops%2fpi-process-harness@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":73741},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"cf8b40376c8b9b52303bc7e3c57ecfd7b4d0bcc6","scripts":{"test":"bun run build && bun test test","build":"rm -rf dist && tsc -p tsconfig.build.json","format":"biome format --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:513f6598-9647-4a7c-b4d8-d99d959afc75"}},"repository":{"url":"git+https://github.com/DanyPops/pi-integral.git","type":"git","directory":"packages/pi-process-harness"},"_npmVersion":"12.0.2","description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@earendil-works/pi-ai":"*"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"*","bun-types":"latest","typescript":"^5.9.2","@types/node":"^22.0.0","@biomejs/biome":"^2.5.6","@earendil-works/pi-coding-agent":"*"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-process-harness_0.1.3_1786462967503_0.10689573904289107","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@danypops/pi-process-harness","version":"0.3.2","description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","license":"MIT","type":"module","main":"./dist/index.js","sideEffects":false,"types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"rm -rf dist && tsc -p tsconfig.build.json","test":"bun run build && bun test test","typecheck":"tsc --noEmit","format":"biome format --write ."},"repository":{"type":"git","url":"git+https://github.com/DanyPops/pi-integral.git","directory":"packages/pi-process-harness"},"homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"dependencies":{"@earendil-works/pi-ai":"*"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"devDependencies":{"@biomejs/biome":"^2.5.6","@earendil-works/pi-coding-agent":"*","@types/node":"^22.0.0","bun-types":"latest","typebox":"*","typescript":"^5.9.2"},"keywords":["pi","pi-extension","testing","test-harness","integration-test"],"gitHead":"c9852f42403718aa87958bb4d675ff08bf7bd2ac","_id":"@danypops/pi-process-harness@0.3.2","_nodeVersion":"24.19.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-95vg7a/Fwlk7yfyZsprFktElMLkdXcmuFx5C9NXCl6qBrgxU3EM/Uf3V28RujJzlmH3H7Zg08osDjo5K7NKstA==","shasum":"a7399177ec94ccbb58735b593eca70f34f73f8e2","tarball":"https://registry.npmjs.org/@danypops/pi-process-harness/-/pi-process-harness-0.3.2.tgz","fileCount":39,"unpackedSize":79222,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@danypops%2fpi-process-harness@0.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCcdG/0Dwn9V849OG9tNYrdSbuLZXxeV51PQwux0u61RgIgYrEhrIR86eXHY7K1tHz7MVBKbVfHrdBvMCZa7RWtjPk="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:513f6598-9647-4a7c-b4d8-d99d959afc75"}},"directories":{},"maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-process-harness_0.3.2_1787647930391_0.9711479367210125"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-03T09:20:19.067Z","modified":"2026-08-25T08:52:11.442Z","0.0.1":"2026-08-03T09:20:19.417Z","0.1.0":"2026-08-04T07:03:25.547Z","0.1.1":"2026-08-04T17:06:37.681Z","0.1.2":"2026-08-09T15:39:41.919Z","0.1.3":"2026-08-11T15:42:47.673Z","0.3.2":"2026-08-25T08:52:10.546Z"},"bugs":{"url":"https://github.com/DanyPops/pi-integral/issues"},"license":"MIT","homepage":"https://github.com/DanyPops/pi-integral/tree/main/packages/pi-process-harness#readme","keywords":["pi","pi-extension","testing","test-harness","integration-test"],"repository":{"type":"git","url":"git+https://github.com/DanyPops/pi-integral.git","directory":"packages/pi-process-harness"},"description":"Spawns real `pi` processes (and companion daemons) for integration tests that need a real AgentSession genuinely deciding to call a tool -- scripted via Pi's own first-party faux model provider, no live LLM call. The sibling of @danypops/pi-extension-harn","maintainers":[{"name":"danypops","email":"danypops@protonmail.com"}],"readme":"# @danypops/pi-process-harness\n\nSpawns real `pi` processes (and companion daemon processes) for integration\ntests that need more than [@danypops/pi-extension-harness](https://github.com/DanyPops/pi-extension-harness)'s\nin-process/jiti/mock-cli layers can give: a genuine `AgentSession` deciding,\non its own, to call a tool from a prompt -- not a test hand-feeding a tool\nname directly.\n\n## Why this exists\n\n`pi-extension-harness` is explicit about its own boundary: it never boots a\nreal `AgentSession` or a real LLM. That's the right call for testing one\nextension's own callback behavior in isolation, but it means nothing in that\npackage can prove \"a real agent loop, given this prompt, actually calls this\ntool\" -- or coordinate a companion daemon process (a Vehicle-backed daemon,\nfor instance) alongside a real Pi process for a true end-to-end test.\n\nThis package covers exactly that gap, using Pi's own first-party scriptable\nmodel provider (`@earendil-works/pi-ai`'s `fauxProvider`) so the agent loop's\ntool-call decision is real but deterministic -- no live LLM call, no API\nspend.\n\n## Usage\n\n```ts\nimport { spawnRealPiProcess, resolveFauxProviderExtensionPath, encodeFauxScript, SCRIPT_ENV_VAR, waitForRpcEvent } from \"@danypops/pi-process-harness\";\n\nconst proc = spawnRealPiProcess({\n  extensions: [resolveFauxProviderExtensionPath(), \"/abs/path/to/your/extension.ts\"],\n  extraArgs: [\"--provider\", \"faux\", \"--model\", \"faux-1\"],\n  env: {\n    [SCRIPT_ENV_VAR]: encodeFauxScript([{ type: \"toolCall\", name: \"your_tool\", arguments: { foo: \"bar\" } }]),\n  },\n});\n\nconst events: unknown[] = [];\nproc.onEvent((event) => events.push(event));\nproc.sendPrompt(\"go\");\nawait waitForRpcEvent(events, (event) => event.type === \"tool_execution_end\");\nawait proc.dispose();\n```\n\nThe bundled faux extension is payload-lifecycle aware: it wraps Pi AI's faux provider so\n`before_provider_request` handlers execute at the real provider stream boundary. Because faux has\nno wire protocol, the hook receives a deterministic provider-neutral shape (`system`, `messages`,\n`tools`). Payload rewrites are observational only; provider-specific serialization/rewrite tests\nstill require a local HTTP provider fake.\n\nFor a companion daemon (Epi, or any other real process a test needs alongside\nthe Pi process):\n\n```ts\nimport { spawnCompanionDaemon } from \"@danypops/pi-process-harness\";\n\nconst daemon = await spawnCompanionDaemon({\n  command: \"node\",\n  args: [\"dist/cli.js\", \"serve\"],\n  isReady: async () => fs.existsSync(\"/tmp/my-daemon/handle.json\"),\n});\n// ... drive the test ...\nawait daemon.dispose();\n```\n\n## What this does not do\n\n- No OS sandbox: the harness isolates `HOME` and `PI_CODING_AGENT_DIR` by default, but the real\n  child still has ordinary filesystem/network access like any `child_process.spawn`.\n- No assertion helpers beyond `waitForRpcEvent` -- read the real RPC event\n  stream and assert on it directly.\n- Not a replacement for `pi-extension-harness` -- use that for fast,\n  hermetic, single-extension behavior tests; reach for this only when a test\n  genuinely needs a real agent loop or a real companion process.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}