{"_id":"@agent-controller/runtime","_rev":"6-46b752f4dfaffac65db1d555b939d8f9","name":"@agent-controller/runtime","dist-tags":{"latest":"0.7.0"},"versions":{"0.3.1":{"name":"@agent-controller/runtime","version":"0.3.1","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"author":{"name":"CCDevelopForFun"},"license":"MIT","_id":"@agent-controller/runtime@0.3.1","maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"dist":{"shasum":"5e1b955a5ff49c385a81929e324cca72c65063a9","tarball":"https://registry.npmjs.org/@agent-controller/runtime/-/runtime-0.3.1.tgz","fileCount":15,"integrity":"sha512-xbVXdKC5yXRAYpGHyvuvcfNg1/8ho4E4Ehln68fwgSfEJ1tVH4NkdnLIXFi/y5L7h39NDTHS1+gqvN2PCzdgcQ==","signatures":[{"sig":"MEUCIHxkOnUyjGdiU3KfEfHiBEzggkEYiCsHXB5IAYtrM1JHAiEA17+q0JA1nZLNfzNZ8nSP4qr+s++/Pf5seh828TIM4wU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92113},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"gitHead":"047c7239f8f9cc7aec54233ea2e1177de0c968c5","scripts":{"test":"vitest run","build":"tsc -p .","test:watch":"vitest"},"_npmUser":{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"},"repository":{"url":"git+https://github.com/CCDevelopForFun/agent-controller.git","type":"git","directory":"runtime"},"_npmVersion":"10.9.8","description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"pi-mcp-extension":"1.5.0","@sinclair/typebox":"0.34.49","@earendil-works/pi-ai":"0.75.5","@earendil-works/pi-coding-agent":"0.75.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"latest","typescript":"latest","@types/node":"latest"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.3.1_1780680212839_0.3520653096886279","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@agent-controller/runtime","version":"0.3.2","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"author":{"name":"CCDevelopForFun"},"license":"MIT","_id":"@agent-controller/runtime@0.3.2","maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"dist":{"shasum":"a7ce7a35efd67d4957319546eafb2cf192401586","tarball":"https://registry.npmjs.org/@agent-controller/runtime/-/runtime-0.3.2.tgz","fileCount":18,"integrity":"sha512-ivvx7edm3P5CG9IsWvo0zq0CjEzsO98WxuDZNSJgxsgTOs3cuE7Ov7Ip2hLEEVi3pujFwGNm1c2wjA7IOR/Qbg==","signatures":[{"sig":"MEUCIQDMFpXcEJ7nE6xZaawxgD/rdgULMXXS6FTKQfj6yrgFBgIgGwetJiEhmZxEbxWIsAoydNifug4+Mzv6pDW6tWUfnKE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118274},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"gitHead":"dbe80a180e0c09f29f50830ca6ba48b58e3d0bc9","scripts":{"test":"vitest run","build":"tsc -p . && node ./scripts/copy-vendored-extensions.mjs","test:watch":"vitest"},"_npmUser":{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"},"repository":{"url":"git+https://github.com/CCDevelopForFun/agent-controller.git","type":"git","directory":"runtime"},"_npmVersion":"10.9.8","description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"pi-mcp-extension":"1.5.0","@sinclair/typebox":"0.34.49","@earendil-works/pi-ai":"0.75.5","@earendil-works/pi-coding-agent":"0.75.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"latest","typescript":"latest","@types/node":"latest"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.3.2_1780933820457_0.3243926029653963","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@agent-controller/runtime","version":"0.3.3","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"author":{"name":"CCDevelopForFun"},"license":"MIT","_id":"@agent-controller/runtime@0.3.3","maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"dist":{"shasum":"842753671e1eb84466fc77b0ad9dc902eb43ec3b","tarball":"https://registry.npmjs.org/@agent-controller/runtime/-/runtime-0.3.3.tgz","fileCount":18,"integrity":"sha512-/BZp8NDANdao6TrBr9A22T7WYrT3XxgzU6rzkpBbHtEAymFZYN95EOiRPOT83oXj4VoUZtVGotp44WS0cp6z4w==","signatures":[{"sig":"MEUCIAS6vB+26nbzYNap5NFPRMXwFub8w5ZZj/KlL8tglMNaAiEA3DhFB3XmI7f18M/ORyr2IvKvrWUfSNm7TdTL7tpxQHQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118274},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"gitHead":"18a06f9e32e628d6364f644211e84e34e465d036","scripts":{"test":"vitest run","build":"tsc -p . && node ./scripts/copy-vendored-extensions.mjs","test:watch":"vitest"},"_npmUser":{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"},"repository":{"url":"git+https://github.com/CCDevelopForFun/agent-controller.git","type":"git","directory":"runtime"},"_npmVersion":"10.9.8","description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"pi-mcp-extension":"1.5.0","@sinclair/typebox":"0.34.49","@earendil-works/pi-ai":"0.75.5","@earendil-works/pi-coding-agent":"0.75.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"latest","typescript":"latest","@types/node":"latest"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.3.3_1781022536381_0.5454057991582177","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@agent-controller/runtime","version":"0.4.0","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"author":{"name":"CCDevelopForFun"},"license":"MIT","_id":"@agent-controller/runtime@0.4.0","maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"dist":{"shasum":"ed66ab682e27fd4384a6971936ac9fda30dc223c","tarball":"https://registry.npmjs.org/@agent-controller/runtime/-/runtime-0.4.0.tgz","fileCount":18,"integrity":"sha512-6VuWEKTLx/PsLa1eeQniY94eQC1iSZqR1L2tijoXa/rv4h39ZtlYDhuuEn2X6jMZspVbfzExpwPYZiqpDKJa9g==","signatures":[{"sig":"MEUCIEChIfHWuuGgJKgGbHL4aWxHLurAW5iUcee20/ay2sCEAiEAxWStYZNpXCVgEIT7a0MpfiUqAN/NDkb9kjWWzQcDFCk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118274},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"gitHead":"50ef945bbc9b46e7ee854710ab07a78ff38fbfa1","scripts":{"test":"vitest run","build":"tsc -p . && node ./scripts/copy-vendored-extensions.mjs","test:watch":"vitest"},"_npmUser":{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"},"repository":{"url":"git+https://github.com/CCDevelopForFun/agent-controller.git","type":"git","directory":"runtime"},"_npmVersion":"10.9.8","description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"pi-mcp-extension":"1.5.0","@sinclair/typebox":"0.34.49","@earendil-works/pi-ai":"0.75.5","@earendil-works/pi-coding-agent":"0.75.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"latest","typescript":"latest","@types/node":"latest"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.4.0_1781034740854_0.2281774928493241","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@agent-controller/runtime","version":"0.5.0","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"author":{"name":"CCDevelopForFun"},"license":"MIT","_id":"@agent-controller/runtime@0.5.0","maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"dist":{"shasum":"a1e91ba2f4d843367c7de6b0e8879167c155e63f","tarball":"https://registry.npmjs.org/@agent-controller/runtime/-/runtime-0.5.0.tgz","fileCount":18,"integrity":"sha512-4wvX62sEEz/3a39c6PIrWUNAD+H9ksoc0Gb3JRzoVHl9w9R3eIgwbqNry7D+UkXczcZTegYWRpP4Svnt/uvIEg==","signatures":[{"sig":"MEUCIQCs27kAglD4t7LqVlW93BKdYYYRaV519VQGIXHTYsfznwIgAUlZaAXTXy12ylcFCbsmuJdbnNZaRSUpCmijsb+eKcc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118776},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"gitHead":"1269a33a5f11a6039b552eb63d4495cc4dc9e7c0","scripts":{"test":"vitest run","build":"tsc -p . && node ./scripts/copy-vendored-extensions.mjs","test:watch":"vitest"},"_npmUser":{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"},"repository":{"url":"git+https://github.com/CCDevelopForFun/agent-controller.git","type":"git","directory":"runtime"},"_npmVersion":"10.9.8","description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"pi-mcp-extension":"1.5.0","@sinclair/typebox":"0.34.49","@earendil-works/pi-ai":"0.75.5","@earendil-works/pi-coding-agent":"0.75.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"latest","typescript":"latest","@types/node":"latest"},"_npmOperationalInternal":{"tmp":"tmp/runtime_0.5.0_1781126272177_0.3765429567480416","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@agent-controller/runtime","version":"0.7.0","description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"repository":{"type":"git","url":"git+https://github.com/CCDevelopForFun/agent-controller.git","directory":"runtime"},"license":"MIT","author":{"name":"CCDevelopForFun"},"type":"module","main":"dist/index.js","publishConfig":{"access":"public"},"engines":{"node":">=22.19.0"},"scripts":{"build":"tsc -p . && node ./scripts/copy-vendored-extensions.mjs","test":"vitest run","test:watch":"vitest"},"dependencies":{"@earendil-works/pi-ai":"0.75.5","@earendil-works/pi-coding-agent":"0.75.5","@opentelemetry/api":"^1.9.1","@opentelemetry/core":"^2.8.0","@opentelemetry/exporter-trace-otlp-http":"^0.219.0","@opentelemetry/resources":"^2.8.0","@opentelemetry/sdk-trace-base":"^2.8.0","@opentelemetry/sdk-trace-node":"^2.8.0","@opentelemetry/semantic-conventions":"^1.41.1","@sinclair/typebox":"0.34.49","pi-mcp-extension":"1.5.0"},"devDependencies":{"@types/node":"latest","typescript":"latest","vitest":"latest"},"_id":"@agent-controller/runtime@0.7.0","gitHead":"d52d44af91e84a6fd78b195b1cfe30c7b0354bff","types":"./dist/index.d.ts","_nodeVersion":"22.23.0","_npmVersion":"10.9.8","dist":{"integrity":"sha512-CnS9hf9htRPoh1jLmlx2zqCZPx41BjCsrOVbKvxzQp75hrOYLWtKN+QYewKoSC8APQcu7hbBNAjDZ4r797rWjQ==","shasum":"1ba45b925854fb7c28fdf6664abfb944a6f8912c","tarball":"https://registry.npmjs.org/@agent-controller/runtime/-/runtime-0.7.0.tgz","fileCount":20,"unpackedSize":154763,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID1CwdxpE5dIfDEDtFUWfijUWF0dY3OFhaQGfP00X9xIAiEA24aCdUaUmKvYTtlwIFtfUQ6bngSp0XAz5XR5N4/4lPw="}]},"_npmUser":{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"},"directories":{},"maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/runtime_0.7.0_1782491230996_0.08965578740648761"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-05T17:23:32.689Z","modified":"2026-06-26T16:27:11.308Z","0.3.1":"2026-06-05T17:23:32.994Z","0.3.2":"2026-06-08T15:50:20.618Z","0.3.3":"2026-06-09T16:28:56.511Z","0.4.0":"2026-06-09T19:52:21.048Z","0.5.0":"2026-06-10T21:17:52.346Z","0.7.0":"2026-06-26T16:27:11.159Z"},"bugs":{"url":"https://github.com/CCDevelopForFun/agent-controller/issues"},"author":{"name":"CCDevelopForFun"},"license":"MIT","homepage":"https://github.com/CCDevelopForFun/agent-controller#readme","keywords":["agent-controller","adl","pi","pi-agent","agent","ai-agents","llm","anthropic","runtime-adapter"],"repository":{"type":"git","url":"git+https://github.com/CCDevelopForFun/agent-controller.git","directory":"runtime"},"description":"Pi runtime adapter for agent-controller — runs an ADL CompiledSpec against a Pi session and emits the NDJSON wire-event stream.","maintainers":[{"name":"ccdevelopforfun","email":"zhenglinchen123@gmail.com"}],"readme":"# `@agent-controller/runtime` — Pi runtime adapter\n\nNode/TypeScript adapter that runs an [agent-controller](https://github.com/CCDevelopForFun/agent-controller) `CompiledSpec` against a Pi session and emits the NDJSON wire-event stream that `agentctl` consumes. This is the original / production adapter; the opencode adapter ([`@agent-controller/runtime-opencode`](https://www.npmjs.com/package/@agent-controller/runtime-opencode)) is the v0.2 sibling.\n\nRequires **Node 22.19.0+** — `@earendil-works/pi-ai` and `@earendil-works/pi-coding-agent` declare `engines.node: \">=22.19.0\"` (the nested `undici` they ship needs that floor). Older Node 22.x will install but is outside the supported range.\n\n## Install\n\n```bash\nnpm install -g @agent-controller/runtime\n# or per-project\nnpm install --save-dev @agent-controller/runtime\n```\n\n## Use with `agentctl`\n\n`agentctl` (the Go CLI) spawns this package as a subprocess. The example specs under [`examples/`](https://github.com/CCDevelopForFun/agent-controller/tree/main/examples) reference cwd-relative registry entries (`tools/`, `extensions/`, `skills/`, `agents/`) that ship with the source repo but not with this npm package. For an npm-only install, use a self-contained spec:\n\n```bash\n# 1) Write a self-contained spec (no tools[]/extensions[]/skills[]/subagents[])\ncat > /tmp/hello.yaml <<'EOF'\napiVersion: agent-controller.dev/v1alpha1\nkind: Agent\nmetadata: { name: hello }\nspec:\n  model: { provider: anthropic, name: claude-sonnet-4-20250514 }\n  persona: { role: Helpful demo, instructions: Answer concisely. }\n  task: Say hello.\n  tools: []\n  runtime: { type: local }\nEOF\n\n# 2) Point agentctl at the adapter and run\nexport ANTHROPIC_API_KEY=sk-ant-...\n\n# global install\nAGENT_CONTROLLER_RUNTIME=\"$(npm root -g)/@agent-controller/runtime/dist/index.js\" \\\n  agentctl run /tmp/hello.yaml\n\n# or per-project (from a directory with the package in node_modules)\nAGENT_CONTROLLER_RUNTIME=\"./node_modules/@agent-controller/runtime/dist/index.js\" \\\n  agentctl run /tmp/hello.yaml\n```\n\nWithout `AGENT_CONTROLLER_RUNTIME`, `agentctl run` looks under `<cwd>/runtime/dist/index.js` — the source-clone-and-build install path.\n\n`agentctl` (matching version) is available from the [GitHub Releases page](https://github.com/CCDevelopForFun/agent-controller/releases) as cross-platform binaries.\n\n## Architecture role\n\nThis package is the **subprocess** spawned by `agentctl run` when `spec.runtime.type` is `local` or `local-pi`. It:\n\n1. Reads a `CompiledSpec` JSON document from stdin\n2. Constructs Pi's `DefaultResourceLoader` from the spec (skills paths, agent files, MCP config)\n3. Materializes `<cwd>/.pi/mcp.json` and `<cwd>/.pi/agents/*.md` for Pi's loaders\n4. Auto-installs `spec.extensions[].source` packages on demand\n5. Builds the system prompt: honesty preamble + persona + role + skill bodies\n6. Calls `createAgentSession` + `session.prompt`\n7. Translates Pi's internal events into the wire-protocol NDJSON envelope\n8. Runs the runtime-side hallucination detector on assistant messages\n\n## Environment variables\n\n| Variable | Effect |\n|---|---|\n| `AGENT_CONTROLLER_EXT_CONFIG` | Per-extension config blob (set by adapter from `spec.extensions[].config`) |\n| `AGENT_CONTROLLER_USE_FAKE_PROVIDER` | If `1`, the adapter loads the test fake-provider before starting the session (Layer-1 E2E only) |\n| `AGENT_CONTROLLER_NO_AUTO_INSTALL` | If `1`, auto-installation of `spec.extensions[].source` is disabled; missing packages fail fast |\n| `ANTHROPIC_BASE_URL` | Forwarded to Pi for model gateway override |\n| `AC_PI_BIN` | Path to the `pi` CLI for subagent process spawning (set by the adapter when subagents exist) |\n| `PI_CODING_AGENT_DIR` | Pi's project-local config dir; isolated under a temp dir in tests |\n\n## What this adapter does NOT cover\n\n- opencode-style native subagents — see [`@agent-controller/runtime-opencode`](https://www.npmjs.com/package/@agent-controller/runtime-opencode)\n- Kubernetes / remote execution — planned v0.4 via the `Backend` interface in the CLI\n\n## Building from source\n\n```bash\ngit clone https://github.com/CCDevelopForFun/agent-controller.git\ncd agent-controller/runtime\nnpm install --ignore-scripts\nnpm run build           # tsc → dist/\nnpm test                # vitest\n```\n\n`--ignore-scripts` is important: Pi's nested install hook will otherwise try to set up the user's `~/.pi` directory.\n\n## Cross-references\n\n- [agent-controller README](https://github.com/CCDevelopForFun/agent-controller#readme) — project overview + quickstart\n- [Dual-adapter architecture overview](https://github.com/CCDevelopForFun/agent-controller/blob/main/docs/architecture/overview.md)\n- [Harness capability matrix](https://github.com/CCDevelopForFun/agent-controller/blob/main/docs/architecture/harness-matrix.md) — per-feature support table\n\n## License\n\nMIT — see [LICENSE](https://github.com/CCDevelopForFun/agent-controller/blob/main/LICENSE).\n","readmeFilename":"README.md"}