@kervnet/opencode-kiro-auth 1.7.9 → 1.7.11

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.
@@ -23,11 +23,15 @@ export class AuthHandler {
23
23
  // Refresh every 15 minutes
24
24
  this.refreshTimer = setInterval(async () => {
25
25
  try {
26
+ const logger = await import('../../plugin/logger.js');
27
+ logger.log('Background token refresh starting...');
26
28
  const { syncFromKiroCli } = await import('../../plugin/sync/kiro-cli.js');
27
29
  await syncFromKiroCli();
30
+ logger.log('Background token refresh completed');
28
31
  }
29
32
  catch (e) {
30
- // Silent fail - will retry in 15 minutes
33
+ const logger = await import('../../plugin/logger.js');
34
+ logger.warn('Background token refresh failed', e);
31
35
  }
32
36
  }, 15 * 60 * 1000);
33
37
  }
@@ -146,6 +146,14 @@ export async function syncFromKiroCli() {
146
146
  }
147
147
  }
148
148
  }
149
+ // Encode refresh token with client credentials for IDC
150
+ const { encodeRefreshToken } = await import('../../kiro/auth.js');
151
+ const encodedRefreshToken = encodeRefreshToken({
152
+ refreshToken,
153
+ clientId,
154
+ clientSecret,
155
+ authMethod: 'idc'
156
+ });
149
157
  await kiroDb.upsertAccount({
150
158
  id,
151
159
  email: resolvedEmail,
@@ -154,7 +162,7 @@ export async function syncFromKiroCli() {
154
162
  clientId,
155
163
  clientSecret,
156
164
  profileArn: tokenProfileArn,
157
- refreshToken,
165
+ refreshToken: encodedRefreshToken,
158
166
  accessToken,
159
167
  expiresAt: tokenExpiresAt,
160
168
  rateLimitResetTime: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kervnet/opencode-kiro-auth",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
4
4
  "description": "OpenCode plugin for AWS Kiro (CodeWhisperer) with IAM Identity Center profile support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",