opencode-kiro 0.3.5 → 0.3.6-rc.1

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 +14 -7
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -150,13 +150,20 @@ async function notifyIfTokenExpired(client) {
150
150
  }
151
151
  }
152
152
  function hasStoredKiroCredential() {
153
- try {
154
- const path = process.env.XDG_DATA_HOME ? join(process.env.XDG_DATA_HOME, "opencode", "auth.json") : process.platform === "win32" ? join(homedir(), ".opencode", "auth.json") : join(homedir(), ".local", "share", "opencode", "auth.json");
155
- const parsed = JSON.parse(readFileSync(path, "utf8"));
156
- return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) && "kiro" in parsed;
157
- } catch {
158
- return false;
159
- }
153
+ return authJsonPaths().some((path) => {
154
+ try {
155
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
156
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) && "kiro" in parsed;
157
+ } catch {
158
+ return false;
159
+ }
160
+ });
161
+ }
162
+ function authJsonPaths() {
163
+ if (process.env.XDG_DATA_HOME) return [join(process.env.XDG_DATA_HOME, "opencode", "auth.json")];
164
+ const current = join(homedir(), ".local", "share", "opencode", "auth.json");
165
+ if (process.platform !== "win32") return [current];
166
+ return [current, join(homedir(), ".opencode", "auth.json")];
160
167
  }
161
168
  function tuiConfigPath() {
162
169
  const base = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-kiro",
3
- "version": "0.3.5",
3
+ "version": "0.3.6-rc.1",
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)",
@@ -42,7 +42,7 @@
42
42
  "@opencode-ai/plugin": "*"
43
43
  },
44
44
  "dependencies": {
45
- "kiro-acp-ai-provider": "2.1.1"
45
+ "kiro-acp-ai-provider": "2.1.2-rc.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@opencode-ai/plugin": "1.16.2",