opencode-kiro 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  The ACP-compliant [Kiro](https://kiro.dev) auth plugin for [opencode](https://opencode.ai).
4
4
 
5
- opencode learns the `kiro` provider and its 12 models from the
6
- [models.dev](https://models.dev) catalog, exactly like the first-party Copilot and
7
- GitLab integrations. This plugin supplies the piece the catalog can't: the **auth**.
5
+ opencode learns the `kiro` provider and its available models (US region) from the
6
+ [models.dev](https://models.dev) catalog. This plugin supplies the following pieces:
8
7
 
9
8
  - **Auth** via the official `kiro-cli` login flow (`opencode auth login`, then "Kiro CLI Login")
10
9
  - **Provider options loader**: the `cwd`, `agent`, `trustAllTools`, `mcpTimeout` values
@@ -19,13 +18,12 @@ the catalog's `npm` field. This is the supported integration path: requests go t
19
18
  kiro-cli exactly like Kiro's own IDE clients, with no credential scraping and no reuse of
20
19
  Kiro credentials against other providers.
21
20
 
22
- Not affiliated with any other kiro-named npm packages.
23
-
24
21
  ## Prerequisites
25
22
 
26
23
  | Requirement | Notes |
27
24
  |---|---|
28
25
  | [kiro-cli](https://kiro.dev/docs/cli/) | Must be installed and on `PATH`; a Kiro subscription / AWS Builder ID account |
26
+ | [Node.js](https://nodejs.org) `>= 20` | Enforced via `engines.node`. |
29
27
  | opencode `>= 1.16.0` | Enforced via `engines.opencode` on released builds. The shipped catalog must include the `kiro` provider (see [Troubleshooting](#troubleshooting)). |
30
28
 
31
29
  ## Install
@@ -127,27 +125,10 @@ If the flow times out, authenticate directly with kiro-cli (`kiro-cli login`) an
127
125
 
128
126
  ## Models
129
127
 
130
- 12 models, defined in the [models.dev](https://models.dev) `kiro` catalog entry. opencode
131
- loads them from there; the table below is a convenience snapshot, not the source of
132
- truth. All models support tool calling and have a 64K-token output limit.
133
-
134
- | Model | ID | Context window | Image input |
135
- |---|---|---|---|
136
- | Auto | `auto` | 1,000,000 | yes |
137
- | Claude Haiku 4.5 | `claude-haiku-4.5` | 200,000 | yes |
138
- | Claude Opus 4.5 | `claude-opus-4.5` | 200,000 | yes |
139
- | Claude Opus 4.6 | `claude-opus-4.6` | 1,000,000 | yes |
140
- | Claude Opus 4.7 | `claude-opus-4.7` | 1,000,000 | yes |
141
- | Claude Sonnet 4 | `claude-sonnet-4` | 200,000 | yes |
142
- | Claude Sonnet 4.5 | `claude-sonnet-4.5` | 200,000 | yes |
143
- | Claude Sonnet 4.6 | `claude-sonnet-4.6` | 1,000,000 | yes |
144
- | Deepseek v3.2 | `deepseek-3.2` | 164,000 | yes |
145
- | MiniMax M2.1 | `minimax-m2.1` | 196,000 | yes |
146
- | MiniMax M2.5 | `minimax-m2.5` | 196,000 | no |
147
- | Qwen3 Coder Next | `qwen3-coder-next` | 256,000 | yes |
148
-
128
+ This plugin supports all models in the US region, defined in the [models.dev](https://models.dev) `kiro`
129
+ catalog entry. opencode loads them from there. List them with:
149
130
  ```bash
150
- opencode models # lists kiro/auto, kiro/claude-sonnet-4.6, ...
131
+ opencode models # lists kiro/auto, kiro/claude-opus-4.8, ...
151
132
  opencode run -m kiro/auto "hello"
152
133
  ```
153
134
 
@@ -178,8 +159,8 @@ Disable the builtin box in `tui.json` so only the replacement renders:
178
159
  ```
179
160
 
180
161
  Without this you will see **two** context boxes (cosmetic duplication: the builtin
181
- one plus the plugin's). The credits value and its unit come from provider metadata
182
- emitted by the SDK (kiro-cli reports the unit); nothing is hardcoded client-side.
162
+ one plus the plugin's). The credits value and its unit come from the metadata the SDK
163
+ attaches to each message part (kiro-cli reports the unit); nothing is hardcoded client-side.
183
164
 
184
165
  Trade-off: the replacement box applies to **every** session and disabling the builtin
185
166
  is global. The replacement reproduces the builtin `$X.XX spent` line for non-Kiro
@@ -187,11 +168,11 @@ sessions (and stacks it above credits when a session used both), so mixed-provid
187
168
  users keep dollar cost in the sidebar; if you prefer the original built-in box, leave
188
169
  it enabled at the cost of the duplicate box.
189
170
 
190
- ## Known limitation (read this)
171
+ ## Known limitation
191
172
 
192
173
  **Credits render in the TUI only.** Two TUI surfaces show them: the sidebar context
193
174
  box (above) and the input/prompt meta row chip (`session_prompt_right`), which sits
194
- beside the host's `$` cost chip. Every other cost surface (ACP clients, the web app,
175
+ above the host's `$` cost chip. Every other cost surface (ACP clients, the web app,
195
176
  desktop, web share pages, and CLI cost output) shows $0.00 for Kiro sessions. The
196
177
  models.dev catalog declares Kiro's per-token `cost` as 0 (it is a subscription-metered
197
178
  provider with no per-token pricing), so opencode core computes $0.00 everywhere it
@@ -216,11 +197,11 @@ would require opencode core changes and is intentionally out of scope for this p
216
197
  `kiro-acp-ai-provider` to check kiro-cli installation/login state.
217
198
  - **Session affinity & reset (in-SDK)**: the SDK keys kiro-cli sessions off opencode's
218
199
  `x-session-affinity` header, isolates tool-less utility calls (title generation) on
219
- an ephemeral session, detects prompt-history divergence (fork/`/undo`), and starts a
200
+ an ephemeral session, detects prompt-history divergence (`fork/undo`), and starts a
220
201
  fresh kiro session when needed. No host-side session plumbing.
221
- - **Credits metadata**: the SDK attaches `{ kiro: { credits, creditsUnit } }` provider
222
- metadata to the final part of each turn; opencode persists it, and the TUI plugin
223
- sums it per assistant message (deduped across text/reasoning parts) for the sidebar.
202
+ - **Credits metadata**: the SDK attaches `{ kiro: { credits, creditsUnit } }` to the
203
+ `metadata` of the final message part of each turn; opencode persists it, and the TUI
204
+ plugin sums it per assistant message (deduped across text/reasoning parts) for the sidebar.
224
205
 
225
206
  ## Troubleshooting
226
207
 
@@ -230,8 +211,9 @@ would require opencode core changes and is intentionally out of scope for this p
230
211
  | Auth times out after ~120s | Complete the browser login faster, or run `kiro-cli login` yourself, then re-run `opencode auth login` (fast path). |
231
212
  | Two "Context" boxes in the sidebar | Add `"plugin_enabled": { "internal:sidebar-context": false }` to `tui.json` (see [Credits in the sidebar](#credits-in-the-sidebar)). |
232
213
  | No credits line / credits stay 0 | Credits appear after the first **completed** kiro turn; cancelled turns and turns without usage metadata contribute nothing. Check the TUI plugin is `active` in the Plugins dialog (and listed in `tui.json`). |
214
+ | Credits sidebar box never appears (even with `tui.json` configured correctly) | The TUI credits box renders only when `opencode-kiro` is resolvable in opencode's package cache. If the package is missing from the cache the box silently does not appear. Fix: ensure `opencode-kiro` is installed so it resolves in the cache. Do **not** manually clear the package cache: clearing can trigger a flaky on-demand refetch that fails with an "unknown git error". |
233
215
  | `kiro` provider not showing in `opencode models` | The provider comes from the models.dev catalog, not this plugin. Ensure your opencode version ships a catalog that includes `kiro` (run `opencode models --refresh` to update the cache). For local development, point opencode at a kiro-inclusive catalog via `OPENCODE_MODELS_PATH=/path/to/api.json` (see [Local development](#local-development-path-source)). |
234
- | `sdk.languageModel is not a function` | A stale `kiro-acp-ai-provider` < 2.0.0 resolved from opencode's package cache. Remove the cached copy (`$XDG_CACHE_HOME/opencode/packages/kiro-acp-ai-provider`, default `~/.cache/opencode/packages/...`) and retry; 2.0.0 fixed the factory auto-discovery clash. |
216
+ | `sdk.languageModel is not a function` | A stale `kiro-acp-ai-provider` from before the 2.0.x line resolved from opencode's package cache. Remove the cached copy (`$XDG_CACHE_HOME/opencode/packages/kiro-acp-ai-provider`, default `~/.cache/opencode/packages/...`) and retry; the factory auto-discovery clash was fixed in the 2.0.x line, and this plugin currently pins 2.0.2. |
235
217
  | Path install rejected (`must export id`) | Run `npm run build` in your checkout first and reference the repo root (both entry modules export ids). |
236
218
  | Provider visible but runs fail | The provider is selectable (from the catalog) before any credential exists. Run `opencode auth login` first. |
237
219
 
@@ -246,4 +228,4 @@ npm test # vitest
246
228
 
247
229
  ## License
248
230
 
249
- [MIT](./LICENSE)
231
+ [MIT](./LICENSE) © Nacho F. Lizaur
@@ -38,10 +38,11 @@ function createContextView(api, sessionID) {
38
38
  root,
39
39
  mutedLine(theme, () => `${usage().percent ?? 0}% used`)
40
40
  );
41
- const costBox = createElement("box");
42
- insertNode(root, costBox);
43
41
  const costLines = createMemo(() => spendLines({ cost: cost(), credits: credits() }));
44
- insert(costBox, () => costLines().map((line) => mutedLine(theme, () => line)));
42
+ insertNode(
43
+ root,
44
+ mutedLine(theme, () => costLines().join("\n"))
45
+ );
45
46
  return root;
46
47
  }
47
48
  function headerLine(theme) {
package/dist/server.js CHANGED
@@ -84,7 +84,7 @@ var server = async (input) => {
84
84
  }
85
85
  child.kill();
86
86
  throw new Error(
87
- "Kiro authentication timed out. Run `kiro-cli auth login` manually."
87
+ "Kiro authentication timed out. Run `kiro-cli login` manually."
88
88
  );
89
89
  }
90
90
  };
package/dist/tui.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  // src/tui.ts
11
11
  var tui = async (api) => {
12
- const { createContextView } = await import("./context-view-UFA6UYZV.js");
12
+ const { createContextView } = await import("./context-view-E6Q2FXL3.js");
13
13
  const { createCreditsChipView } = await import("./credits-chip-view-RL5JAEZ5.js");
14
14
  api.slots.register({
15
15
  order: 100,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-kiro",
3
- "version": "0.1.5",
4
- "description": "The ACP-compliant Kiro plugin for opencode: auth via the official kiro-cli login, 12 Kiro models through the Agent Client Protocol, and TUI credits display",
3
+ "version": "0.1.7",
4
+ "description": "The ACP-compliant Kiro plugin for opencode: auth via the official kiro-cli login, the live Kiro model lineup through the Agent Client Protocol, and TUI credits display",
5
5
  "license": "MIT",
6
6
  "author": "Nacho F. Lizaur (https://github.com/NachoFLizaur)",
7
7
  "repository": {