@kervnet/opencode-kiro-auth 1.6.1 → 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 CHANGED
@@ -1,3 +1,4 @@
1
1
  export { KiroOAuthPlugin } from './plugin.js';
2
+ export { KiroOAuthPlugin as default } from './plugin.js';
2
3
  export type { KiroConfig } from './plugin/config/index.js';
3
4
  export type { KiroAuthMethod, KiroRegion, ManagedAccount } from './plugin/types.js';
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { KiroOAuthPlugin } from './plugin.js';
2
+ export { KiroOAuthPlugin as default } from './plugin.js';
@@ -128,6 +128,9 @@ export function transformToCodeWhisperer(url, body, model, auth, think = false,
128
128
  }
129
129
  }
130
130
  };
131
+ if (auth.profileArn) {
132
+ request.profileArn = auth.profileArn;
133
+ }
131
134
  const toolUsesInHistory = history.flatMap((h) => h.assistantResponseMessage?.toolUses || []);
132
135
  const allToolUseIdsInHistory = new Set(toolUsesInHistory.map((tu) => tu.toolUseId));
133
136
  const finalCurTrs = [];
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
- await getAuth();
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: KIRO_CONSTANTS.BASE_URL.replace('/generateAssistantResponse', '').replace('{{region}}', config.default_region || 'us-east-1'),
39
+ baseURL,
29
40
  fetch: (input, init) => requestHandler.handle(input, init, showToast)
30
41
  };
31
42
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kervnet/opencode-kiro-auth",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "OpenCode plugin for AWS Kiro (CodeWhisperer) providing access to Claude models with IAM auth support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",