@dihak/pix-9router
v0.3.6
Published
Pi extension — 9Router provider + fetch/search tools via router API
Downloads
84
Maintainers
Readme
pix-9router
Pi coding agent extension — 9Router provider + fetch, search, and transcribe tools backed by an internal OpenAI-compatible router API.
What's included
| Module | Type | Description |
|---|---|---|
| provider | provider | Registers 9router provider with live model list from the router API |
| fetch | tool | fetch(url, format, max_characters?) — fetches web pages via exa through the router, falls back to curl |
| search | tool | search(query, search_type, max_results?) — web/news search via exa through the router, falls back to curl |
| transcribe | tool | transcribe(file, model?, language?) — speech-to-text via /audio/transcriptions endpoint (default: dg/nova-3), falls back to curl |
Install
pi install npm:@dihak/pix-9routerEnvironment
| Variable | Required | Default | Description |
|---|---|---|---|
| ROUTER_API_KEY | Yes | — | Bearer token for the router API |
| ROUTER_API_BASE | No | https://9router.example.com/v1 | Override router base URL |
Add to your ~/.zsh_local (or equivalent):
export ROUTER_API_KEY="your-key-here"
# export ROUTER_API_BASE="https://your-router.example.com/v1" # optionalHow it works
- Provider: on load, fetches
/modelsfrom the router and registers them with Pi. The modelgrep catalog (via@dihak/pix-data's shared cache) is used internally to fill missing context window / modality fields where the router response omits them. Model list is cached at~/.cache/pi/9router.json(TTL 30 min). - fetch / search: POST to
/web/fetchand/searchon the router (which proxies to exa). If the router is unreachable, falls back tocurl(forfetch, raw URL fetch; forsearch, the same/searchendpoint via curl). Tool output is rendered dimmed so fetched web content reads like faded context rather than primary output. - transcribe: POST to
/audio/transcriptions(Deepgram Nova 3 by default). Accepts any audio file path; falls back to curl.
Compact results
Terminal tool results collapse after the shared Pix delay into metadata-driven rows while preserving all model-visible content. Examples include ✓ fetch https://example.com · 12.4K chars · markdown, ⚡ search “query” · 8 results · curl fallback, and ✓ transcribe meeting.mp3 · 12.4K chars · dg/nova-3. Failures use ✗; cancelled or fallback outcomes use ⚡. Running and partial updates remain live, and expanding an elapsed row restores the normal dimmed content preview without restarting its timer. Configure the behavior with collapse.delaySec and the fetch, search, or transcribe entries under collapse.tools in ~/.pi/agent/pix.json.
Full distro
Source: github.com/dihak/pix-mono
To install the complete pix suite (all packages + Pi itself):
curl -fsSL https://raw.githubusercontent.com/dihak/pix-mono/main/scripts/install.sh | shLicense
MIT
