opencode-kiro 0.3.2 → 0.3.4

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.
Files changed (2) hide show
  1. package/dist/server.js +7 -11
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -43,18 +43,14 @@ var server = async (input) => {
43
43
  throw new Error(
44
44
  "kiro-cli is not installed. Install it from https://kiro.dev/docs/cli/"
45
45
  );
46
- const onSuccess = async () => {
47
- if (inputs?.sidebar === "yes") await enableSidebarConfig(tuiConfigPath(), input);
48
- };
46
+ if (inputs?.sidebar === "yes") await enableSidebarConfig(tuiConfigPath(), input);
49
47
  if (status.authenticated) {
50
48
  return {
51
49
  url: "",
52
50
  instructions: "",
53
51
  method: "auto",
54
52
  async callback() {
55
- const result = await readToken(status.tokenPath);
56
- if (result.type === "success") await onSuccess();
57
- return result;
53
+ return readToken(status.tokenPath);
58
54
  }
59
55
  };
60
56
  }
@@ -74,9 +70,7 @@ var server = async (input) => {
74
70
  const check = verifyAuth();
75
71
  if (check.authenticated) {
76
72
  child.kill();
77
- const result = await readToken(check.tokenPath);
78
- if (result.type === "success") await onSuccess();
79
- return result;
73
+ return readToken(check.tokenPath);
80
74
  }
81
75
  }
82
76
  child.kill();
@@ -99,7 +93,8 @@ var server = async (input) => {
99
93
  provider: {
100
94
  id: "kiro",
101
95
  // inject per-model reasoning-effort variants (consumed as providerOptions.kiro.reasoningEffort)
102
- async models(provider, _ctx) {
96
+ async models(provider, ctx) {
97
+ if (!ctx.auth) return provider.models;
103
98
  const { reasoningEffortsFor } = await import("kiro-acp-ai-provider");
104
99
  for (const model of Object.values(provider.models)) {
105
100
  const apiId = model.api?.id;
@@ -208,7 +203,8 @@ async function enableSidebarConfig(path, input) {
208
203
  });
209
204
  } catch {
210
205
  }
211
- } catch {
206
+ } catch (err) {
207
+ console.error("opencode-kiro: failed to enable the Kiro credits sidebar in tui.json:", err);
212
208
  }
213
209
  }
214
210
  var KiroAuthPlugin = server;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-kiro",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
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)",