{"_id":"@carter-mcalister/pi-codex-image-gen","name":"@carter-mcalister/pi-codex-image-gen","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@carter-mcalister/pi-codex-image-gen","version":"0.2.0","description":"Codex-compatible image_generation tool for Pi","author":{"name":"Carter McAlister"},"type":"module","repository":{"type":"git","url":"git+https://github.com/CarterMcAlister/pi-packages.git","directory":"packages/pi-codex-image-gen"},"bugs":{"url":"https://github.com/CarterMcAlister/pi-packages/issues"},"homepage":"https://github.com/CarterMcAlister/pi-packages/tree/main/packages/pi-codex-image-gen#readme","publishConfig":{"access":"public"},"keywords":["pi-package","pi-extension","pi","codex","image-generation"],"scripts":{"format":"bunx @biomejs/biome check --write .","lint":"bunx @biomejs/biome check .","typecheck":"bunx tsc -p ../../tsconfig.json --noEmit","test":"bun test tests","check":"bun run lint && bun run typecheck && bun run test"},"pi":{"extensions":["./src/index.ts"]},"peerDependencies":{"@earendil-works/pi-coding-agent":"*","@earendil-works/pi-tui":"*","typebox":"*"},"devDependencies":{"@biomejs/biome":"2.4.13","@earendil-works/pi-coding-agent":"*","@earendil-works/pi-tui":"*","bun-types":"latest","typescript":"^5.9.3"},"license":"MIT","_id":"@carter-mcalister/pi-codex-image-gen@0.2.0","gitHead":"9ff3518aa7be51b160924a8f83e9a6001db88b10","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-l3NNe65LXGeX7GHaeLYXou1CkS9QhjeCAz4EdGOmYk4p49m5pNgVeTqrl6zBEkmxheIVtPY/RfHyUiNaE7v8jw==","shasum":"46110e6ab6a2e5ec062d0a86681c8539c9f53cf4","tarball":"https://registry.npmjs.org/@carter-mcalister/pi-codex-image-gen/-/pi-codex-image-gen-0.2.0.tgz","fileCount":3,"unpackedSize":29501,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@carter-mcalister%2fpi-codex-image-gen@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE/8wAZiu+HuzArXJhAH/AHPOwcRWMJaWgUkCbKYuu4oAiEAmBXUHUyYB8kf5szfokKnplz5NxplM+SCazSEr0MW0IU="}]},"_npmUser":{"name":"carter-mcalister","email":"carterm126@gmail.com"},"directories":{},"maintainers":[{"name":"carter-mcalister","email":"carterm126@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-codex-image-gen_0.2.0_1778371195184_0.1785508345872231"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T23:59:55.054Z","0.2.0":"2026-05-09T23:59:55.306Z","modified":"2026-05-09T23:59:55.681Z"},"maintainers":[{"name":"carter-mcalister","email":"carterm126@gmail.com"}],"description":"Codex-compatible image_generation tool for Pi","homepage":"https://github.com/CarterMcAlister/pi-packages/tree/main/packages/pi-codex-image-gen#readme","keywords":["pi-package","pi-extension","pi","codex","image-generation"],"repository":{"type":"git","url":"git+https://github.com/CarterMcAlister/pi-packages.git","directory":"packages/pi-codex-image-gen"},"author":{"name":"Carter McAlister"},"bugs":{"url":"https://github.com/CarterMcAlister/pi-packages/issues"},"license":"MIT","readme":"# pi-codex-image-gen\n\nA Pi extension that exposes a Codex-compatible `image_generation` tool.\n\nThe tool calls the hosted Codex Responses API with the native `image_generation` tool enabled, parses `image_generation_call` stream events, renders the generated image in Pi, and saves the artifact under:\n\n```text\n${CODEX_HOME:-~/.codex}/generated_images/<pi-session>/<image-id>.<format>\n```\n\n## Install\n\nFrom this monorepo, include the package extension in Pi settings or install it as a Pi package once published.\n\n```json\n{\n  \"packages\": [\"npm:@carter-mcalister/pi-codex-image-gen\"]\n}\n```\n\n## Auth\n\nThe extension uses `openai-codex` OAuth credentials from Pi first, then falls back to Codex auth:\n\n- `${PI_CODING_AGENT_DIR:-~/.pi/agent}/auth.json`\n- `${CODEX_HOME:-~/.codex}/auth.json`\n\nRun `/login openai-codex` in Pi if credentials are missing.\n\n## Tool Surface\n\nRegistered tool: `image_generation`\n\nParameters:\n\n- `prompt` — required image prompt; pass the user's request verbatim unless they asked for refinement.\n- `images` — optional local image paths for reference/edit context.\n- `model` — optional openai-codex model override.\n- `output_format` — optional `png`, `jpeg`, or `webp`; defaults to `png` to match Codex.\n- `timeout_ms` — optional per-call timeout override in milliseconds.\n\nCodex native `image_generation` is a Responses API built-in rather than a JSON function tool. Pi custom tools require parameters, so this package keeps the Codex tool name, `output_format` naming, `image_generation_call` result details, and default save behavior while adding the minimal prompt/path inputs needed for Pi.\n\nGenerated image bytes are not stored in the Pi session. Tool results persist only metadata and `saved_path`; the custom renderer reads the saved file from disk transiently when drawing the image in the terminal.\n\n## Timeout\n\nImage requests default to a 180 second timeout. Set `PI_CODEX_IMAGE_GEN_TIMEOUT_MS` to a positive millisecond value to allow longer generations globally, or pass `timeout_ms` for a single tool call.\n\n## Command\n\n```text\n/image-generation <prompt>\n```\n","readmeFilename":"README.md","_rev":"1-3e722e9867db6c61b5f7f8e61af940d8"}