# pi-chimera

The **Codex-compatibility extension** for Pi extension/runtime 0.83.0.

After the Workstream 2 split, pi-chimera keeps its name but contains only the
compatibility patch: it discovers the optional
[`@howaboua/pi-codex-conversion`](https://www.npmjs.com/package/@howaboua/pi-codex-conversion)
package when it is loaded and reports the inherited tool names and extension
paths that the multi-agent extension projects into child sessions. The
multi-agent coordination machinery itself now lives in
**[pi-subagents](https://www.npmjs.com/package/pi-subagents)**.

pi-chimera is **standalone**. It never depends on pi-subagents or on the
conversion package. Without the conversion package it is inert: it reports
"no conversion package loaded" and changes nothing. See
[docs/compat-contract.md](docs/compat-contract.md) for the handoff contract
and the behavior matrix.

## Install

```bash
pi install npm:pi-chimera
```

Try the package without a permanent install:

```bash
pi -e npm:pi-chimera
```

### Local development

1. Run `npm install`.
2. Run `pi -e ./pi-chimera/index.ts`.

## What it does

- Registers one tool, `codex_conversion_metadata`, which returns
  `{ conversionPackagePresent, extensionPaths, inheritedToolNames }` derived
  from `pi.getAllTools()` / `pi.getActiveTools()`.
- Registers `/codex-compat`, which prints the same metadata in the UI.
- Shows a footer status (`codex conversion: N tool(s)` or
  `codex conversion: not loaded`).

Discovery rules: see [`docs/compat-contract.md`](docs/compat-contract.md).
The rules are identical in pi-subagents, per the contract.

## Behavior without/with the conversion package

| Loaded | Behavior |
| --- | --- |
| pi-chimera alone | Inert; metadata reports no conversion package. |
| pi-chimera + conversion package | Metadata reports the inherited tool names + extension paths; child sessions in pi-subagents can take advantage of them. |
| pi-chimera + pi-subagents (no conversion) | Compat is inert; pi-subagents behaves as if pi-chimera were absent. |

## Check the package

Run `npm run check` (format, lint, type, unit + integration tests, pack).

## Documentation

- [Compat contract](docs/compat-contract.md)
- [Publishing](docs/publishing.md)
