{"_id":"@dragenetlabs/opencode-kilo-gateway","name":"@dragenetlabs/opencode-kilo-gateway","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dragenetlabs/opencode-kilo-gateway","version":"0.1.0","description":"opencode auth + provider plugin for the Kilo gateway: device-auth login, cross-surface organization selection, and dynamic model listing.","type":"module","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/dragenet/opencode-kilo-gateway.git"},"homepage":"https://github.com/dragenet/opencode-kilo-gateway#readme","bugs":{"url":"https://github.com/dragenet/opencode-kilo-gateway/issues"},"publishConfig":{"access":"public","provenance":true},"packageManager":"yarn@4.17.1","scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","test:watch":"vitest"},"devDependencies":{"@changesets/cli":"^2.31.1","@opencode-ai/plugin":"1.18.2","@types/node":"^22.0.0","typescript":"^5.6.0","vitest":"^2.1.0"},"gitHead":"a347e242a35f2e49d74696aa6eae0402945f8d6b","_id":"@dragenetlabs/opencode-kilo-gateway@0.1.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-jI6fGmFPlN/ICF+NkEPvETCBSfnVMRmg/exFwLTuX+WmQISB0/66FNOSgZVYX322UU++lCi81pbYX23DuihABQ==","shasum":"6dd5b7387d813ea1bda068731f8e277e35bcf33a","tarball":"https://registry.npmjs.org/@dragenetlabs/opencode-kilo-gateway/-/opencode-kilo-gateway-0.1.0.tgz","fileCount":23,"unpackedSize":36855,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCn1sjg/OjJMhd5+0dC8RAxOwIdrg7bT8WQtVhxv9r/wQIhAJDkoUHkOwh6lkALcI5sM0mPS1ZmkScIEc4uTZmnL991"}]},"_npmUser":{"name":"dragenetlabs","email":"domagalski.dominik@gmail.com"},"directories":{},"maintainers":[{"name":"dragenetlabs","email":"domagalski.dominik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opencode-kilo-gateway_0.1.0_1784717536463_0.6670773166674435"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T10:52:16.295Z","0.1.0":"2026-07-22T10:52:16.609Z","modified":"2026-07-22T10:52:16.830Z"},"maintainers":[{"name":"dragenetlabs","email":"domagalski.dominik@gmail.com"}],"description":"opencode auth + provider plugin for the Kilo gateway: device-auth login, cross-surface organization selection, and dynamic model listing.","homepage":"https://github.com/dragenet/opencode-kilo-gateway#readme","repository":{"type":"git","url":"git+https://github.com/dragenet/opencode-kilo-gateway.git"},"bugs":{"url":"https://github.com/dragenet/opencode-kilo-gateway/issues"},"license":"MIT","readme":"# opencode-kilo-gateway\n\nAn [opencode](https://opencode.ai) plugin that replaces the static `kilo` provider with:\n\n- **Device-authorization OAuth login** to the Kilo gateway (`https://api.kilo.ai`), matching\n  the Kilo CLI's own login flow — no static API key required.\n- **Cross-surface organization selection**: your default organization is selected\n  automatically at first login; switch to a different one later via the native\n  **\"Kilo · Switch organization\"** login method, which works identically in the CLI\n  (`opencode auth login`) and the TUI (`/connect`).\n- **Dynamic, organization-scoped model listing**, fetched live from the Kilo gateway instead\n  of a static model list.\n\nSee [`docs/design.md`](docs/design.md) for the full design rationale and\n[`docs/superpowers/plans/2026-07-20-opencode-kilo-gateway.md`](docs/superpowers/plans/2026-07-20-opencode-kilo-gateway.md)\nfor the implementation plan.\n\n## Install\n\nBuild the plugin, then either:\n\n**Local development** — opencode only auto-discovers individual `.js`/`.ts` files\nplaced directly inside `~/.config/opencode/plugins/` (not a symlinked package\ndirectory), so symlink the built entry point itself:\n\n```bash\nyarn install\nyarn build\nln -sf \"$(pwd)/dist/index.js\" ~/.config/opencode/plugins/opencode-kilo-gateway.js\n```\n\n**Published package** — add to your opencode config's plugin list:\n\n```jsonc\n{\n  \"plugin\": [\"@dragenetlabs/opencode-kilo-gateway\"]\n}\n```\n\n## Configuration\n\n- `KILO_API_URL` (optional) — override the Kilo gateway base URL. Defaults to\n  `https://api.kilo.ai`.\n- `KILO_API_KEY` (optional) — directly supply a gateway API key as the bearer\n  token, bypassing interactive OAuth login entirely. Best for non-interactive\n  and CI environments.\n- `KILO_ORG_ID` (optional) — override the organization ID used for scoping\n  model listings and API requests. Best for non-interactive and CI environments.\n  Composes with either credential source (OAuth or `KILO_API_KEY`).\n\nIf you were previously using a static `kilo` provider with a manually configured\norganization header, remove it — this plugin supplies the organization automatically:\n\n```jsonc\n// Remove this once @dragenetlabs/opencode-kilo-gateway is installed:\n\"provider\": {\n  \"kilo\": { \"options\": { \"headers\": { \"X-KiloCode-OrganizationId\": \"...\" } } }\n}\n```\n\nYour existing `kilo/<vendor>/<model>` references (e.g. `kilo/z-ai/glm-5.1`) keep working\nunchanged — the plugin owns the same `kilo` provider id.\n\n## Manual verification checklist\n\n1. `opencode auth login` → select **Kilo** → **Login with Kilo** → approve the device code\n   shown in your browser → confirm login succeeds and a default organization is selected.\n2. In the opencode TUI, run `/connect` → select **Kilo** → confirm the same device flow\n   completes and the model picker is populated.\n3. Run the **Kilo · Switch organization** method (via `opencode auth login` and via\n   `/connect`) → confirm the organization changes and the model list updates accordingly.\n4. Start a chat using a `kilo/...` model → confirm the request succeeds through the\n   shared `/api/openrouter` base with the `X-KiloCode-OrganizationId` header set when an\n   organization is selected (inspect via `KILO_API_URL` pointed at a local proxy/logger if\n   needed).\n5. If you have a token with an embedded base-URL prefix (self-hosted gateway), confirm it\n   overrides the default/`KILO_API_URL` base.\n\n## Development\n\n```bash\nyarn install\nyarn test        # run the unit test suite\nyarn build       # compile TypeScript to dist/\n```\n\n## Releasing\n\nThis project uses [Changesets](https://github.com/changesets/changesets) for automated\nsemantic versioning and changelog generation.\n\n- **Add a changeset in your PR**: run `yarn changeset`, describe your change, and pick\n  the appropriate bump (patch, minor, or major). Commit the generated `.changeset/*.md`\n  file alongside your code.\n- **Version Packages PR**: merging to `master` triggers `release.yml`, which opens or\n  updates a \"Version Packages\" PR that bumps `package.json` and writes `CHANGELOG.md`\n  from all pending changesets.\n- **Publish**: merging the Version Packages PR triggers the actual `npm publish` via\n  OIDC trusted publishing (no long-lived tokens).\n\nThe very first release (0.1.0) was published manually from a local machine — this is\nrequired because npm's Trusted Publisher can only be configured after the package\nalready exists. All subsequent releases are governed by the automated Changesets flow\nabove.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-c4127a0c2662358bd13ed78352c61af6"}