@cortexkit/opencode-openai-auth 0.5.2 → 0.6.0
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/README.md +2 -1
- package/dist/cli.js +1 -1
- package/dist/commands.d.ts +16 -0
- package/dist/core/accounts.d.ts +22 -0
- package/dist/core/oauth.d.ts +1 -1
- package/dist/core/refresh-all-quota.d.ts +3 -0
- package/dist/core/reset-credits.d.ts +114 -0
- package/dist/index-87145jkw.js +2 -0
- package/dist/{index-rfgyxxxq.js → index-dz9a4xwy.js} +1 -1
- package/dist/{index-zkzb0twr.js → index-e08r33g5.js} +2 -2
- package/dist/{index-s5fbqqwx.js → index-hxpv25e8.js} +1 -1
- package/dist/index-meg0ng0z.js +2 -0
- package/dist/{index-vrdc90yd.js → index-n00ybbbq.js} +1 -1
- package/dist/{index-6rnw2cgs.js → index-nwy7ec7p.js} +1 -1
- package/dist/{index-wpd7mg3p.js → index-s2vhsb2v.js} +1 -1
- package/dist/index-zddpw2sa.js +89 -0
- package/dist/index.d.ts +30 -1
- package/dist/index.js +120 -70
- package/dist/quota-normalize-vf2pj6n7.js +1 -0
- package/dist/quota-normalize.d.ts +1 -0
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.d.ts +1 -1
- package/dist/rpc/rpc-client.d.ts +2 -1
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/rpc/rpc-dir.js +1 -1
- package/dist/rpc/rpc-server.d.ts +1 -0
- package/dist/sidebar-state.d.ts +2 -0
- package/dist/sidebar-state.js +1 -1
- package/dist/{token-5hdnazxp.js → token-esc14v6e.js} +1 -1
- package/dist/token-util-qkpkvy5t.js +1 -0
- package/dist/tui-preferences.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/rpc/protocol.ts +1 -0
- package/src/rpc/rpc-client.ts +7 -3
- package/src/rpc/rpc-server.ts +24 -4
- package/src/sidebar-state.ts +62 -3
- package/src/tui/command-dialogs.tsx +245 -0
- package/src/tui-compiled/rpc/protocol.ts +1 -0
- package/src/tui-compiled/rpc/rpc-client.ts +7 -3
- package/src/tui-compiled/sidebar-state.ts +62 -3
- package/src/tui-compiled/tui/command-dialogs.tsx +162 -1
- package/src/tui-compiled/tui.tsx +1 -1
- package/src/tui-compiled/util/error.ts +9 -0
- package/src/tui.tsx +4 -1
- package/dist/index-2ng03cby.js +0 -2
- package/dist/index-qhvsskdz.js +0 -89
- package/dist/index-wnxfzjfr.js +0 -2
- package/dist/quota-normalize-n02dfdx0.js +0 -1
- package/dist/token-util-3d2nj45d.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Hooks, Plugin, PluginInput } from '@opencode-ai/plugin';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ResetTargetIdentity } from './commands';
|
|
3
|
+
import { type AccountStorage, type FallbackAccount, loadAccounts, type OAuthAccount, type OAuthQuotaSnapshot } from './core/accounts';
|
|
3
4
|
import { QuotaManager } from './core/quota-manager';
|
|
4
5
|
import { type SidebarMachineState, type SidebarState } from './sidebar-state';
|
|
5
6
|
export declare const MAIN_REFRESH_LOCK_TTL_MS: number;
|
|
@@ -8,6 +9,34 @@ export declare class AuthPersistError extends Error {
|
|
|
8
9
|
readonly code = "OPENAI_AUTH_PERSIST_FAILED";
|
|
9
10
|
constructor(cause: unknown);
|
|
10
11
|
}
|
|
12
|
+
export type ResetTargetResolutionErrorKind = 'unknown_account' | 'disabled_account' | 'non_oauth_account' | 'token_unavailable';
|
|
13
|
+
export declare class ResetTargetResolutionError extends Error {
|
|
14
|
+
readonly code: ResetTargetResolutionErrorKind;
|
|
15
|
+
constructor(code: ResetTargetResolutionErrorKind, message: string);
|
|
16
|
+
}
|
|
17
|
+
interface ResetTargetResolverDeps {
|
|
18
|
+
getAuth: () => Promise<{
|
|
19
|
+
type: string;
|
|
20
|
+
access?: string;
|
|
21
|
+
refresh?: string;
|
|
22
|
+
expires?: number;
|
|
23
|
+
}>;
|
|
24
|
+
refreshMainWithLease: () => Promise<{
|
|
25
|
+
access: string;
|
|
26
|
+
refresh: string;
|
|
27
|
+
expires: number;
|
|
28
|
+
}>;
|
|
29
|
+
refreshFallbackAccount: (account: OAuthAccount, storage: AccountStorage) => Promise<OAuthAccount>;
|
|
30
|
+
loadAccounts: typeof loadAccounts;
|
|
31
|
+
accountStoragePath: string;
|
|
32
|
+
now: () => number;
|
|
33
|
+
}
|
|
34
|
+
export declare function createResetTargetResolver(deps: ResetTargetResolverDeps): (accountKey: string) => Promise<ResetTargetIdentity>;
|
|
35
|
+
export declare function buildResetRedemptionDeps(): {
|
|
36
|
+
fetchImpl: typeof fetch;
|
|
37
|
+
now: () => number;
|
|
38
|
+
randomUUID: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
39
|
+
};
|
|
11
40
|
export { extractAccountIdFromClaims, type IdTokenClaims, parseJwtClaims, } from './core/oauth';
|
|
12
41
|
interface CodexAuthPluginOptions {
|
|
13
42
|
issuer?: string;
|