@kervnet/opencode-kiro-auth 1.6.2 → 1.6.3
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/plugin.js +14 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { KIRO_CONSTANTS } from './constants.js';
|
|
2
1
|
import { AuthHandler } from './core/auth/auth-handler.js';
|
|
3
2
|
import { RequestHandler } from './core/request/request-handler.js';
|
|
4
3
|
import { AccountCache } from './infrastructure/database/account-cache.js';
|
|
@@ -21,11 +20,23 @@ export const createKiroPlugin = (id) => async ({ client, directory }) => {
|
|
|
21
20
|
auth: {
|
|
22
21
|
provider: id,
|
|
23
22
|
loader: async (getAuth) => {
|
|
24
|
-
|
|
23
|
+
// Check if we already have accounts synced from kiro-cli
|
|
24
|
+
const accounts = accountManager.getAccounts();
|
|
25
|
+
if (accounts.length === 0) {
|
|
26
|
+
// No accounts, need to authenticate
|
|
27
|
+
await getAuth();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// We have accounts, skip auth prompt
|
|
31
|
+
console.log('[KIRO] Using existing account:', accounts[0]?.email || 'unknown');
|
|
32
|
+
}
|
|
25
33
|
await authHandler.initialize();
|
|
34
|
+
const region = config?.default_region || 'us-east-1';
|
|
35
|
+
const baseURL = `https://q.${region}.amazonaws.com`;
|
|
36
|
+
console.log('[KIRO] Loader called - baseURL:', baseURL, 'region:', region);
|
|
26
37
|
return {
|
|
27
38
|
apiKey: '',
|
|
28
|
-
baseURL
|
|
39
|
+
baseURL,
|
|
29
40
|
fetch: (input, init) => requestHandler.handle(input, init, showToast)
|
|
30
41
|
};
|
|
31
42
|
},
|
package/package.json
CHANGED