@kervnet/opencode-kiro-auth 1.7.12 → 1.7.14
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.
|
@@ -39,6 +39,12 @@ export class AuthHandler {
|
|
|
39
39
|
}
|
|
40
40
|
const { syncFromKiroCli } = await import('../../plugin/sync/kiro-cli.js');
|
|
41
41
|
await syncFromKiroCli();
|
|
42
|
+
// Reload accounts from database into memory
|
|
43
|
+
if (this.accountManager) {
|
|
44
|
+
this.repository.invalidateCache();
|
|
45
|
+
const freshAccounts = await this.repository.findAll();
|
|
46
|
+
this.accountManager.replaceAccounts(freshAccounts);
|
|
47
|
+
}
|
|
42
48
|
logger.log('Background token refresh completed');
|
|
43
49
|
}
|
|
44
50
|
catch (e) {
|
|
@@ -10,6 +10,7 @@ export declare class AccountManager {
|
|
|
10
10
|
static loadFromDisk(strategy?: AccountSelectionStrategy): Promise<AccountManager>;
|
|
11
11
|
getAccountCount(): number;
|
|
12
12
|
getAccounts(): ManagedAccount[];
|
|
13
|
+
replaceAccounts(newAccounts: ManagedAccount[]): void;
|
|
13
14
|
shouldShowToast(debounce?: number): boolean;
|
|
14
15
|
shouldShowUsageToast(debounce?: number): boolean;
|
|
15
16
|
getMinWaitTime(): number;
|
package/dist/plugin/accounts.js
CHANGED
|
@@ -50,6 +50,9 @@ export class AccountManager {
|
|
|
50
50
|
getAccounts() {
|
|
51
51
|
return [...this.accounts];
|
|
52
52
|
}
|
|
53
|
+
replaceAccounts(newAccounts) {
|
|
54
|
+
this.accounts = newAccounts;
|
|
55
|
+
}
|
|
53
56
|
shouldShowToast(debounce = 10000) {
|
|
54
57
|
if (Date.now() - this.lastToastTime < debounce)
|
|
55
58
|
return false;
|
|
@@ -3,7 +3,6 @@ import { existsSync } from 'node:fs';
|
|
|
3
3
|
import { createDeterministicAccountId } from '../accounts';
|
|
4
4
|
import * as logger from '../logger';
|
|
5
5
|
import { kiroDb } from '../storage/sqlite';
|
|
6
|
-
import { fetchUsageLimits } from '../usage';
|
|
7
6
|
import { findClientCredsRecursive, getCliDbPath, makePlaceholderEmail, normalizeExpiresAt, safeJsonParse } from './kiro-cli-parser';
|
|
8
7
|
export async function syncFromKiroCli() {
|
|
9
8
|
const dbPath = getCliDbPath();
|
|
@@ -79,20 +78,15 @@ export async function syncFromKiroCli() {
|
|
|
79
78
|
clientSecret,
|
|
80
79
|
email: ''
|
|
81
80
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
limitCount = u.limitCount || 0;
|
|
85
|
-
if (typeof u.email === 'string' && u.email) {
|
|
86
|
-
email = u.email;
|
|
87
|
-
usageOk = true;
|
|
88
|
-
}
|
|
81
|
+
// Skip usage/email fetch for kiro-cli sync - it never works
|
|
82
|
+
// Just use placeholder email and default quota values
|
|
89
83
|
}
|
|
90
84
|
catch (e) {
|
|
91
|
-
logger.warn('Kiro CLI sync:
|
|
85
|
+
logger.warn('Kiro CLI sync: error during sync', {
|
|
92
86
|
authMethod,
|
|
93
87
|
region
|
|
94
88
|
});
|
|
95
|
-
logger.debug('Kiro CLI sync:
|
|
89
|
+
logger.debug('Kiro CLI sync: error', e);
|
|
96
90
|
}
|
|
97
91
|
const all = kiroDb.getAccounts();
|
|
98
92
|
if (!email) {
|
package/package.json
CHANGED