{"_id":"@ageflow/runner-codex","_rev":"7-04a854da51cb89d479008346a989094c","name":"@ageflow/runner-codex","dist-tags":{"latest":"0.3.5"},"versions":{"0.1.0":{"name":"@ageflow/runner-codex","version":"0.1.0","_id":"@ageflow/runner-codex@0.1.0","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"dist":{"shasum":"6db75be79249bf8c4cda6dfc06fd0964c8fa19d3","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.1.0.tgz","fileCount":10,"integrity":"sha512-iSkc1b+Cm7POi9UGn19FJAr8VyeeWO8vjQpM4dXC/LT1h1P7/ueZPic8HNz+5ZPHOZGbL2K8abJdjt8CxX/Vfg==","signatures":[{"sig":"MEUCIQDYz5M4y670jpf52zaLXq/KW5uqUHRG1BxO5ZKVK7YlQQIgS1q3JjODzOVGvKUN9EsQ162d6K/Yl9smtaY4Ne+rq1Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71604},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"eae9a8649a06fea53d806b347241c2855d71a6ba","private":false,"scripts":{"lint":"biome check src/","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"_npmVersion":"11.11.0","directories":{},"_nodeVersion":"25.8.1","dependencies":{"@ageflow/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","@types/bun":"^1.1.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/runner-codex_0.1.0_1776288860198_0.8844264865088176","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ageflow/runner-codex","version":"0.2.0","keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"license":"MIT","_id":"@ageflow/runner-codex@0.2.0","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"homepage":"https://github.com/Neftedollar/ageflow/tree/master/agentflow/packages/runners/codex","bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"dist":{"shasum":"d7db1acc9548db4b4fd8c12c21dc702a7a2048bd","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.2.0.tgz","fileCount":11,"integrity":"sha512-Z6EyYl3k9SOfOEVFBsUmrRiI6ncCig8PenJAqz6sVvr/4EE4c9EMdYWwn8bLS04ZpNvWunTrhIy0B6HdowF0Gg==","signatures":[{"sig":"MEUCIQDnYq/duLaKnlz7sEG5/axm8mpvPUNxEOgSrHcUd5KOKQIgL7s6s7sZTo+i2VKuSM/OLBfYoD/3hb8qtLelwb+Ta+A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73678},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"c9ec02fd33cba8108a1255623ba329097acfe908","private":false,"scripts":{"lint":"biome check src/","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"repository":{"url":"git+https://github.com/Neftedollar/ageflow.git","type":"git"},"_npmVersion":"11.11.0","description":"OpenAI Codex CLI subprocess runner for ageflow","directories":{},"_nodeVersion":"25.8.1","dependencies":{"@ageflow/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","@types/bun":"^1.1.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/runner-codex_0.2.0_1776330796501_0.3891222215068755","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ageflow/runner-codex","version":"0.3.0","keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"license":"MIT","_id":"@ageflow/runner-codex@0.3.0","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"homepage":"https://github.com/Neftedollar/ageflow/tree/master/packages/runners/codex","bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"dist":{"shasum":"2fdc009d8a6ad17c813994fc00644e6820698e42","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.3.0.tgz","fileCount":15,"integrity":"sha512-qsYAPOjcb1sYxJBkGeQNf7J6fchEv9qM/u19DXdUCJgh7sY22gCqihffpowUa81yky1msCI7ewgxbu4/kLZ3zQ==","signatures":[{"sig":"MEQCIEJx7KruLHrd47DztBqt/LFWhe9xJUp+qa4wZu7/Ft9YAiBYRY1MIijq4ankJhhxIQ2RlNXsZXvHkwVRHEO1LmYcew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81582},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f055450765c4b4f8e6a06d3bcedb2e337395adb8","private":false,"scripts":{"lint":"biome check src/","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"repository":{"url":"git+https://github.com/Neftedollar/ageflow.git","type":"git"},"_npmVersion":"11.11.0","description":"OpenAI Codex CLI subprocess runner for ageflow","directories":{},"_nodeVersion":"25.8.1","dependencies":{"@ageflow/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","@types/bun":"^1.1.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/runner-codex_0.3.0_1776377989681_0.8166220231650936","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@ageflow/runner-codex","version":"0.3.2","keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"license":"MIT","_id":"@ageflow/runner-codex@0.3.2","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"homepage":"https://github.com/Neftedollar/ageflow/tree/master/packages/runners/codex","bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"dist":{"shasum":"af4068eef666a98a422dd0bed3c60f0c8ba28a13","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.3.2.tgz","fileCount":19,"integrity":"sha512-BGiTonHOLLEGMszga5utQsDkgVrEs07Z+rpyF9DXnkuqdltV7OyEOrwupsGyRJ0c1ehHagvvTKE07KELNUQppQ==","signatures":[{"sig":"MEQCIEQecHYlg3QTuz7KEDfVZjlb0MeaoYQpXCjLh9k/j5XUAiA7sjf3r7CiNKxt2lA2rl/TSOoUEgelrmyks98DaE7Oew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82502},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"67e25292e8f64b4c7643f1ac12164e771122c632","private":false,"scripts":{"lint":"biome check src/","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"repository":{"url":"git+https://github.com/Neftedollar/ageflow.git","type":"git"},"_npmVersion":"11.11.0","description":"OpenAI Codex CLI subprocess runner for ageflow","directories":{},"_nodeVersion":"25.8.1","dependencies":{"@ageflow/core":"^0.3.2"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","@types/bun":"^1.1.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/runner-codex_0.3.2_1776395151798_0.6984684942927304","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@ageflow/runner-codex","version":"0.3.3","keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"license":"MIT","_id":"@ageflow/runner-codex@0.3.3","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"homepage":"https://github.com/Neftedollar/ageflow/tree/master/packages/runners/codex","bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"dist":{"shasum":"d0dc518d5acac62b06524fa41634d2f301aeb788","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.3.3.tgz","fileCount":23,"integrity":"sha512-v380Jw1awGG3yud1vYkUehAqLcmj7xst3Zi8ZVmBkDWOz0BaP2SrSbzbfzYH4awvfwHXD0ZQ5onjTfe2GvKrCw==","signatures":[{"sig":"MEYCIQC7P4lehHorYiV8KmH7kWTeXqXAD3pf8FCero3WYP1fCAIhAOgzhPg+VtVKvdLPEivGctlADgeqTlmz5Q2RS3hypaS7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83050},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"lint":"biome check src/","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"repository":{"url":"git+https://github.com/Neftedollar/ageflow.git","type":"git"},"_npmVersion":"11.11.0","description":"OpenAI Codex CLI subprocess runner for ageflow","directories":{},"_nodeVersion":"25.8.1","dependencies":{"@ageflow/core":"^0.4.3"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","@types/bun":"^1.1.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/runner-codex_0.3.3_1776415468227_0.2094298998466111","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@ageflow/runner-codex","version":"0.3.4","keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"license":"MIT","_id":"@ageflow/runner-codex@0.3.4","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"homepage":"https://github.com/Neftedollar/ageflow/tree/master/packages/runners/codex","bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"dist":{"shasum":"60652f33a77e8f176cbe66369aee47c8a042ee5a","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.3.4.tgz","fileCount":15,"integrity":"sha512-30lf3Qan4adtJ532rnUilyeuWXewDgFb5wIN1JXypF31PDswMii/GJuSSd1jFzUFWr11+9jS/Ko5Odrk1XCCjg==","signatures":[{"sig":"MEQCIFLb2mBcZj8Ql3c/5sbjHMxkL52MB7IfmV5uYSJRCSw7AiBGq0LMIbN1b6cIaweWN7jnWEfhqwlG3dW1u0w/y6v/iw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81572},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"lint":"biome check src/","test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"repository":{"url":"git+https://github.com/Neftedollar/ageflow.git","type":"git"},"_npmVersion":"11.11.0","description":"OpenAI Codex CLI subprocess runner for ageflow","directories":{},"_nodeVersion":"25.8.1","dependencies":{"@ageflow/core":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","@types/bun":"^1.1.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/runner-codex_0.3.4_1776422117141_0.5283052601722451","host":"s3://npm-registry-packages-npm-production"}},"0.3.5":{"name":"@ageflow/runner-codex","version":"0.3.5","description":"OpenAI Codex CLI subprocess runner for ageflow","homepage":"https://github.com/Neftedollar/ageflow/tree/master/packages/runners/codex","type":"module","private":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"vitest run","lint":"biome check src/"},"dependencies":{"@ageflow/core":"^0.6.0"},"devDependencies":{"@types/bun":"^1.1.0","@types/node":"^22.0.0","vitest":"^2.1.0"},"repository":{"type":"git","url":"git+https://github.com/Neftedollar/ageflow.git"},"keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"license":"MIT","_id":"@ageflow/runner-codex@0.3.5","bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"_nodeVersion":"25.8.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-A/gHD+zjyBxEGsobVp1E6QjfrYIKQ+jz0VB5oRa2oB0Wsejp1HXunXDpF39sDZhOftu3CGhaofs3jSLPzaPv1Q==","shasum":"9f39a9a5525df411b029b0bd81f532a073f038d2","tarball":"https://registry.npmjs.org/@ageflow/runner-codex/-/runner-codex-0.3.5.tgz","fileCount":15,"unpackedSize":82063,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCgMZt7xGaWQ2AUXBcoEBb/DBxvGtVSN+xau1FIpN7wMwIhAJhjPErmdHxtivyRuqE80BGtOXbSUhvIk52rhuQ3XcXv"}]},"_npmUser":{"name":"neftedollar","email":"oildollar@gmail.com"},"directories":{},"maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/runner-codex_0.3.5_1776434946012_0.6771324324151786"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-15T21:34:20.134Z","modified":"2026-04-17T14:09:06.314Z","0.1.0":"2026-04-15T21:34:20.321Z","0.2.0":"2026-04-16T09:13:16.639Z","0.3.0":"2026-04-16T22:19:49.821Z","0.3.2":"2026-04-17T03:05:51.960Z","0.3.3":"2026-04-17T08:44:28.361Z","0.3.4":"2026-04-17T10:35:17.300Z","0.3.5":"2026-04-17T14:09:06.205Z"},"bugs":{"url":"https://github.com/Neftedollar/ageflow/issues"},"license":"MIT","homepage":"https://github.com/Neftedollar/ageflow/tree/master/packages/runners/codex","keywords":["ai","agents","workflow","llm","dsl","typescript","claude","openai","multi-agent"],"repository":{"type":"git","url":"git+https://github.com/Neftedollar/ageflow.git"},"description":"OpenAI Codex CLI subprocess runner for ageflow","maintainers":[{"name":"neftedollar","email":"oildollar@gmail.com"}],"readme":"# @ageflow/runner-codex\n\n[![npm](https://img.shields.io/npm/v/@ageflow/runner-codex)](https://www.npmjs.com/package/@ageflow/runner-codex)\n\nOpenAI Codex CLI runner for [ageflow](../../../README.md). Spawns the [`codex`](https://github.com/openai/codex) CLI as a subprocess and parses its event stream output.\n\n## Install\n\n```bash\nbun add @ageflow/runner-codex\n```\n\nRequires the Codex CLI to be installed and authenticated:\n\n```bash\nnpm install -g @openai/codex\ncodex --version  # verify\n```\n\n## Usage\n\n```ts\nimport { registerRunner } from \"@ageflow/core\";\nimport { CodexRunner } from \"@ageflow/runner-codex\";\n\nregisterRunner(\"codex\", new CodexRunner());\n```\n\nThen use `runner: \"codex\"` in any `defineAgent` call:\n\n```ts\nconst codeAgent = defineAgent({\n  runner: \"codex\",\n  model: \"o4-mini\",   // or \"o3\"\n  input: z.object({ task: z.string() }),\n  output: z.object({ code: z.string() }),\n  prompt: ({ task }) => `Write TypeScript code that: ${task}`,\n});\n```\n\n## Features\n\n- **Session continuity** — when an agent uses `sessionToken`, the runner passes `resume <thread_id>` to continue an existing Codex thread\n- **Event stream parsing** — handles `thread.started`, `item.completed`, and `turn.completed` events from the Codex JSON stream\n- **Token tracking** — extracts input/output token counts from `turn.completed` for budget tracking\n\n## Supported models\n\nAny model supported by your `codex` CLI version:\n\n| Model | ID |\n|---|---|\n| o4-mini | `o4-mini` |\n| o3 | `o3` |\n\n## Using MCP servers\n\nPass MCP server configuration via `mcp.servers` on any `defineAgent` call. The\nCodex runner emits `-c mcp_servers.<name>.command=...` overrides to the Codex\nCLI — no external config file is required.\n\n```ts\nimport { defineAgent, safePath } from \"@ageflow/core\";\nimport { z } from \"zod\";\n\nconst fileAgent = defineAgent({\n  runner: \"codex\",\n  model: \"o4-mini\",\n  input: z.object({ query: z.string() }),\n  output: z.object({ result: z.string() }),\n  prompt: ({ query }) => query,\n  mcp: {\n    servers: [\n      {\n        name: \"filesystem\",\n        command: \"npx\",\n        args: [\"-y\", \"@modelcontextprotocol/server-filesystem\", \"/workspace\"],\n        // Allowlist — only these tools are exposed to the model\n        tools: [\"read_file\", \"list_directory\"],\n        // Refine — validate path args before forwarding to the server\n        refine: {\n          read_file: z.object({ path: safePath({ allowAbsolute: false }) }),\n        },\n        // ${env:VAR} is resolved at launch time by the executor\n        env: { NODE_ENV: \"${env:NODE_ENV}\" },\n      },\n    ],\n  },\n});\n```\n\n**Allowlist** (`tools`): when set, the tool names are forwarded via\n`-c mcp_servers.filesystem.enabled_tools=[\"read_file\",\"list_directory\"]`. Unlisted\ntools are denied before they reach the model.\n\n**Refine** (`refine`): a map of tool name → Zod schema. Arguments are validated\nagainst the schema before the call is dispatched. Use `safePath()` to prevent\npath traversal.\n\n**Environment expansion** (`env`): values of the form `${env:VAR}` are replaced\nwith the corresponding process environment variable at launch time.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}