Contributes the image portion of IgorWarzocha/pi-codex-conversion as a focused Pi package. Current release version: 0.2.2.
This package ports the Codex-style image_generation and view_image capabilities without replacing Pi's full tool surface.
It provides:
- Extension tool:
image_generation - Extension tool:
view_image - Skill:
image-generation
pi-codex-image dynamically routes tools based on the currently selected model:
image_generationis active only when the current provider isopenai-codexand the selected model advertises image input support.view_imageis active for any selected model that advertises image input support.- Switching models triggers the router again, adding these tools when supported and removing them when unsupported.
- Existing non-image active tools are preserved while image tools are added or removed.
The image_generation tool mirrors pi-codex-conversion's native-tool approach:
- The agent sees a function-style tool named
image_generation. - Before the provider request is sent, the extension rewrites that function tool into the OpenAI Codex Responses native tool:
{ "type": "image_generation", "output_format": "png" }- The local function body is intentionally not used; if it executes locally, it throws an explanatory error.
Generated image handling is therefore delegated to the active OpenAI Codex Responses provider, matching the referenced adapter's routing semantics.
view_image wraps Pi's native image reader and returns only image content to the model.
Parameters:
{
"path": "./local-image.png",
"detail": "original"
}pathis required and may be absolute or relative to the current working directory.detail: "original"is exposed only for Codex-family image-capable models.file_pathandimage_pathare accepted as compatibility aliases and normalized topath.
From a checkout:
pi install npm:@capyup/pi-codex-imageFor one session:
pi -e /path/to/pi-codex-imageRun /reload after installing into an active session.
Package metadata:
- Package name:
@capyup/pi-codex-image - Version:
0.2.2 - Repository:
https://github.com/capyup/pi-codex-image - Extension entry:
extensions/codex-image.ts - Skill directory:
skills/image-generation
When syncing with upstream, compare against pi-codex-conversion's image-generation-tool.ts, view-image-tool.ts, and dynamic tool routing in index.ts.