{"_id":"@dzackgarza/prompt-router","name":"@dzackgarza/prompt-router","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dzackgarza/prompt-router","scripts":{"test":"bun test","typecheck":"tsc --noEmit"},"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"dependencies":{"@opencode-ai/plugin":"^1.2.20","yaml":"^2.8.1"},"module":"./src/index.ts","version":"0.1.0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dzackgarza/prompt-router.git"},"keywords":["opencode","plugin"],"gitHead":"59898d0afdafdd3fdb8bac18f54b38b427f09bd2","_id":"@dzackgarza/prompt-router@0.1.0","description":"[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I57UKJ8)","bugs":{"url":"https://github.com/dzackgarza/prompt-router/issues"},"homepage":"https://github.com/dzackgarza/prompt-router#readme","_nodeVersion":"25.6.1","_npmVersion":"11.9.0","dist":{"integrity":"sha512-NmBsCGcv0DJcc4azP/2VsIYUxTGc53ETXdpzl/PwjvgXNqh6fKh/e28ZZosoc04B3jLKTByNzxKa+RrTOvCjLA==","shasum":"9ba5b2dd3677d3c88303b10a930bdc3a282faa3e","tarball":"https://registry.npmjs.org/@dzackgarza/prompt-router/-/prompt-router-0.1.0.tgz","fileCount":92,"unpackedSize":315418,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDm+sR3ijbG0fvftE978VZjE7NxQ8zcAQp8AvXWJ7g0igIhAPVnqzHftl530f6i48g0dE/R9zMDWUNQP+b3G2MaXKSC"}]},"_npmUser":{"name":"dzackgarza","email":"dzackgarza@gmail.com"},"directories":{},"maintainers":[{"name":"dzackgarza","email":"dzackgarza@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prompt-router_0.1.0_1773137233651_0.9306442661742318"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-10T10:07:13.584Z","0.1.0":"2026-03-10T10:07:13.808Z","modified":"2026-03-10T10:07:14.030Z"},"maintainers":[{"name":"dzackgarza","email":"dzackgarza@gmail.com"}],"description":"[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I57UKJ8)","homepage":"https://github.com/dzackgarza/prompt-router#readme","keywords":["opencode","plugin"],"repository":{"type":"git","url":"git+https://github.com/dzackgarza/prompt-router.git"},"bugs":{"url":"https://github.com/dzackgarza/prompt-router/issues"},"readme":"[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I57UKJ8)\n\n# prompt-router\n\nClassify user prompts into routing tiers and rewrite messages with this OpenCode plugin. It uses `chat.message` to transform user text.\n\n## Install\n\nRun these commands to install:\n\n```bash\ncd /home/dzack/opencode-plugins/prompt-router\njust install\n```\n\nRegister the plugin via `file:` in your OpenCode config:\n\n```json\n{\n  \"plugin\": [\n    \"file:///home/dzack/opencode-plugins/prompt-router/src/index.ts\"\n  ]\n}\n```\n\nView a sample configuration here: [`prompt-router/.config/opencode.json`](/home/dzack/opencode-plugins/prompt-router/.config/opencode.json)\n\n**MCP**: None. This package provides a chat-transform hook rather than a tool server.\n\n## Agent Surface\n\nThis plugin intercepts chat messages without exposing tool names. It performs these actions:\n\n- **Reads** the latest user text.\n- **Classifies** input into tiers: `model-self`, `knowledge`, `C`, `B`, `A`, or `S`.\n- **Injects** instructions from the canonical response template.\n\nDependencies:\n\n- **Runtime**: Bun, `@opencode-ai/plugin`, `yaml`\n- **External local assets**: `~/ai/prompts/...`\n- **External local runtime**: `~/ai/opencode/.venv`, which provides `llm-run` and `llm-template-render` from the GitHub-backed `llm-runner` and `llm-templating-engine` dependencies declared in `~/ai/opencode/pyproject.toml`\n\n## LLM Integration\n\n`prompt-router` does not call the legacy `~/ai/scripts/llm` bridge. It shells into the standalone JSON CLIs instead:\n\n- `llm-run` for prompt execution and structured classifier output\n- `llm-template-render` for response-template rendering\n\nThat means the local OpenCode environment must be synced first:\n\n```bash\ncd /home/dzack/ai/opencode\nuv sync --dev\n```\n\nFor ad hoc smoke tests outside the project environment, the canonical upstream CLIs are also available directly from GitHub via `uvx --from`:\n\n```bash\nuvx --from git+https://github.com/dzackgarza/llm-runner.git llm-run --help\nuvx --from git+https://github.com/dzackgarza/llm-templating-engine.git llm-template-render --help\n```\n\n## Checks\n\nRun checks with just:\n\n```bash\njust typecheck\njust test\n```\n","readmeFilename":"README.md","_rev":"1-21022276483f9af4284a7086765dcf5d"}