@cortexkit/opencode-anthropic-auth 1.21.0 → 1.23.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.
Files changed (68) hide show
  1. package/README.md +57 -12
  2. package/dist/billing-lineage.d.ts +51 -0
  3. package/dist/claustrum-enrollment-registry.d.ts +4 -0
  4. package/dist/cli.d.ts +2 -1
  5. package/dist/cli.js +89 -6
  6. package/dist/custody-dimensions.d.ts +36 -0
  7. package/dist/custody-enrollment.d.ts +14 -0
  8. package/dist/custody-live.d.ts +111 -0
  9. package/dist/custody-manifest-watcher.d.ts +16 -0
  10. package/dist/custody-mode.d.ts +186 -0
  11. package/dist/effort-history.d.ts +62 -0
  12. package/dist/fable-fallback.d.ts +6 -7
  13. package/dist/{index-w9d41yy9.js → index-0jfsxyn9.js} +1 -1
  14. package/dist/index-1fq7h6yd.js +430 -0
  15. package/dist/{index-y0khnbt6.js → index-1gr8v4fn.js} +1 -1
  16. package/dist/index-797pmamn.js +2 -0
  17. package/dist/{index-1db17bc2.js → index-8y2t4mwz.js} +2 -2
  18. package/dist/index-a5d6v3ba.js +5 -0
  19. package/dist/index-n96q8pks.js +2 -0
  20. package/dist/index-xxhyhp98.js +2 -0
  21. package/dist/index-xzbhzz0a.js +2 -0
  22. package/dist/index-z7gfdyv3.js +1 -0
  23. package/dist/index.js +28 -21
  24. package/dist/local-login.d.ts +64 -0
  25. package/dist/{logger-ftk4bg3p.js → logger-kk9vyem9.js} +1 -1
  26. package/dist/prime-manager-registry.d.ts +5 -1
  27. package/dist/rpc/notifications.d.ts +3 -3
  28. package/dist/rpc/port-file.js +1 -1
  29. package/dist/rpc/protocol.d.ts +23 -1
  30. package/dist/rpc/protocol.js +1 -1
  31. package/dist/rpc/rpc-client.d.ts +1 -1
  32. package/dist/rpc/rpc-client.js +1 -1
  33. package/dist/rpc/rpc-dir.js +1 -1
  34. package/dist/rpc/server-registry.d.ts +10 -0
  35. package/dist/setup/activation.d.ts +7 -0
  36. package/dist/setup/claustrum.d.ts +26 -0
  37. package/dist/setup/command-runner.d.ts +2 -0
  38. package/dist/setup/command.d.ts +8 -0
  39. package/dist/setup/detect.d.ts +5 -0
  40. package/dist/setup/jsonc.d.ts +9 -0
  41. package/dist/setup/opencode-config.d.ts +18 -0
  42. package/dist/setup/paths.d.ts +15 -0
  43. package/dist/setup/pi.d.ts +8 -0
  44. package/dist/setup/process-fence.d.ts +14 -0
  45. package/dist/setup/types.d.ts +37 -0
  46. package/dist/sidebar-state.d.ts +5 -2
  47. package/dist/sidebar-state.js +1 -1
  48. package/dist/transform.d.ts +17 -1
  49. package/dist/tui/command-dialogs.d.ts +28 -9
  50. package/dist/tui-preferences.js +2 -2
  51. package/package.json +10 -5
  52. package/src/rpc/notifications.ts +28 -24
  53. package/src/rpc/protocol.ts +34 -1
  54. package/src/rpc/rpc-client.ts +1 -1
  55. package/src/rpc/rpc-server.ts +18 -5
  56. package/src/rpc/server-registry.ts +61 -0
  57. package/src/sidebar-state.ts +42 -3
  58. package/src/tui/command-dialogs.tsx +301 -97
  59. package/src/tui-compiled/rpc/protocol.ts +34 -1
  60. package/src/tui-compiled/rpc/rpc-client.ts +1 -1
  61. package/src/tui-compiled/sidebar-state.ts +42 -3
  62. package/src/tui-compiled/tui/command-dialogs.tsx +240 -70
  63. package/src/tui-compiled/tui.tsx +8 -3
  64. package/src/tui.tsx +18 -3
  65. package/dist/index-4nz423bt.js +0 -4
  66. package/dist/index-4x20896x.js +0 -2
  67. package/dist/index-wezdyxst.js +0 -2
  68. package/dist/index-yskwj5e6.js +0 -428
@@ -0,0 +1,64 @@
1
+ import { type CustodyHandleAccount, type CustodyHandleManifestRemovalResult } from '@cortexkit/anthropic-auth-core';
2
+ export type CompletedLocalLogin = {
3
+ accountId: string;
4
+ credentialId: string;
5
+ authFingerprint: string;
6
+ completedAt: number;
7
+ };
8
+ export type CustodyDivergence = {
9
+ minimumRecordVersion: number;
10
+ observedAt: number;
11
+ };
12
+ export type CustodyDivergenceState = {
13
+ claustrumDivergence?: Record<string, CustodyDivergence>;
14
+ };
15
+ export declare function lastVaultServedRecordVersion(input: {
16
+ accountId: string;
17
+ servedVersion?: number;
18
+ cacheVersion?: number;
19
+ warn?: (accountId: string) => void;
20
+ }): number;
21
+ export declare function custodyDivergenceMarker(lastVaultServedRecordVersion: number, observedAt: number): CustodyDivergence;
22
+ export declare function custodyPreflightDivergenceCheck(binding: {
23
+ credentialId: string;
24
+ recordVersion: number;
25
+ }, state: CustodyDivergenceState): {
26
+ ok: true;
27
+ } | {
28
+ ok: false;
29
+ message: 'missing fresh vault import';
30
+ };
31
+ export declare class CustodyLoginObservationUnavailableError extends Error {
32
+ readonly code = "custody_login_observation_unavailable";
33
+ constructor();
34
+ }
35
+ export declare function assertLocalLoginObservationAvailable(env: Record<string, string | undefined>): void;
36
+ export type ObservedLocalAuth = {
37
+ type: string;
38
+ access?: string;
39
+ refresh?: string;
40
+ };
41
+ export declare function localAuthFingerprint(access: string, refresh: string): string;
42
+ export type AcknowledgeLocalOAuthLoginOptions = {
43
+ manifestPath: string;
44
+ entry: CustodyHandleAccount;
45
+ remove?: (input: {
46
+ path: string;
47
+ entry: CustodyHandleAccount;
48
+ }) => Promise<CustodyHandleManifestRemovalResult>;
49
+ beforeRemove?: () => Promise<void>;
50
+ divergence?: {
51
+ statePath: string;
52
+ lastVaultServedRecordVersion: number;
53
+ };
54
+ };
55
+ export type AcknowledgeLocalOAuthLoginFromStorageOptions = {
56
+ accountStoragePath: string;
57
+ manifestPath: string;
58
+ remove?: AcknowledgeLocalOAuthLoginOptions['remove'];
59
+ divergence?: AcknowledgeLocalOAuthLoginOptions['divergence'];
60
+ };
61
+ export type AcknowledgeLocalOAuthLoginResult = 'cleared' | 'not-cleared' | 'refused' | 'refused-transient';
62
+ export declare function acknowledgeLocalOAuthLogin(completion: CompletedLocalLogin | undefined, observedAuth: ObservedLocalAuth | undefined, options: AcknowledgeLocalOAuthLoginOptions): Promise<AcknowledgeLocalOAuthLoginResult>;
63
+ export declare function persistCustodyDivergenceState(statePath: string, credentialId: string, lastVaultServedRecordVersion: number, observedAt: number): Promise<void>;
64
+ export declare function acknowledgeLocalOAuthLoginFromStorage(completion: CompletedLocalLogin | undefined, options: AcknowledgeLocalOAuthLoginFromStorageOptions): Promise<AcknowledgeLocalOAuthLoginResult>;
@@ -1 +1 @@
1
- import{Fc as a,Gc as b,Hc as c,Ic as d,Jc as e,Kc as f,Lc as g,Mc as h,Nc as i,Oc as j,Pc as k,Qc as l,Rc as m}from"./index-4nz423bt.js";import"./index-4x20896x.js";export{d as shouldEmit,b as setLogLevel,m as relayLog,h as redactPayload,a as parseLogLevel,k as logger,l as log,g as isSecretKey,c as getLogLevel,e as getLogFilePath,i as formatLogLine,j as __setLogTestSink,f as SECRET_KEY_EXACT};
1
+ import{ah as a,bh as b,ch as c,dh as d,eh as e,fh as f,gh as g,hh as h,ih as i,jh as j,kh as k,lh as l,mh as m}from"./index-a5d6v3ba.js";import"./index-n96q8pks.js";export{d as shouldEmit,b as setLogLevel,m as relayLog,h as redactPayload,a as parseLogLevel,k as logger,l as log,g as isSecretKey,c as getLogLevel,e as getLogFilePath,i as formatLogLine,j as __setLogTestSink,f as SECRET_KEY_EXACT};
@@ -3,5 +3,9 @@ type PrimeManagerAdoption = {
3
3
  slot: string;
4
4
  rebind: (manager: PrimeManager) => void;
5
5
  };
6
- export declare function adoptPrimeManager(storagePath: string, create: () => PrimeManager, adoption: PrimeManagerAdoption): PrimeManager;
6
+ export interface AdoptedPrimeManager {
7
+ manager: PrimeManager;
8
+ release: () => void;
9
+ }
10
+ export declare function adoptPrimeManager(storagePath: string, create: () => PrimeManager, adoption: PrimeManagerAdoption): AdoptedPrimeManager;
7
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { OpenDialogPayload, RpcNotification } from './protocol';
2
- export declare function pushNotification(payload: OpenDialogPayload, sessionId?: string): void;
3
- export declare function drainNotifications(lastReceivedId?: number, sessionId?: string): RpcNotification[];
4
- export declare function isTuiConnected(sessionId?: string): boolean;
2
+ export declare function pushNotification(payload: OpenDialogPayload, sessionId: string): void;
3
+ export declare function drainNotifications(lastReceivedId: number, sessionId: string): RpcNotification[];
4
+ export declare function isTuiConnected(sessionId: string): boolean;
5
5
  export declare function resetNotificationsForTest(): void;
@@ -1 +1 @@
1
- import{Sc as a,Tc as b}from"../index-w9d41yy9.js";import"../index-4x20896x.js";export{a as writePortFile,b as discoverPortFile};
1
+ import{oh as a,ph as b}from"../index-0jfsxyn9.js";import"../index-n96q8pks.js";export{a as writePortFile,b as discoverPortFile};
@@ -1,5 +1,27 @@
1
+ import type { ClaustrumEnrollmentStatus } from '@cortexkit/anthropic-auth-core';
1
2
  export declare const COMMAND_MODAL_NAMES: readonly ['claude-account', 'claude-cache', 'claude-cachekeep', 'claude-prime', 'claude-start', 'claude-quota', 'claude-dump', 'claude-fast', 'claude-routing', 'claude-killswitch', 'claude-logging'];
2
3
  export type CommandModalName = (typeof COMMAND_MODAL_NAMES)[number];
4
+ export interface AccountDialogAccount {
5
+ id: string;
6
+ label: string;
7
+ role: 'main' | 'fallback';
8
+ enabled: boolean;
9
+ quotaPercent: number | null;
10
+ tierLabel?: string;
11
+ claustrumGate: 'on' | 'off' | 'na';
12
+ vaultServed: boolean;
13
+ vaultReauth: boolean;
14
+ custodyState: 'na' | 'off' | 'on-vault-served' | 'on-vault-reauth' | 'on-cold' | 'unknown-identity' | 'on-identity-mismatch' | 'on-corrupt-binding';
15
+ }
16
+ export interface AccountDialogKnobs {
17
+ accounts: AccountDialogAccount[];
18
+ claustrumDetection: string;
19
+ custodyMode?: 'local' | 'claustrum';
20
+ custodyModeKnown?: boolean;
21
+ enrollmentStatus?: string;
22
+ claustrumEnrollment?: ClaustrumEnrollmentStatus;
23
+ [key: string]: unknown;
24
+ }
3
25
  export interface OpenDialogPayload {
4
26
  command: CommandModalName;
5
27
  text: string;
@@ -9,7 +31,7 @@ export interface RpcNotification {
9
31
  id: number;
10
32
  type: 'open-dialog';
11
33
  payload: OpenDialogPayload;
12
- sessionId?: string;
34
+ sessionId: string;
13
35
  }
14
36
  export interface ApplyRequest {
15
37
  command: CommandModalName;
@@ -1 +1 @@
1
- import{Uc as a}from"../index-1db17bc2.js";import"../index-4x20896x.js";export{a as COMMAND_MODAL_NAMES};
1
+ import{qh as a}from"../index-8y2t4mwz.js";import"../index-n96q8pks.js";export{a as COMMAND_MODAL_NAMES};
@@ -1,6 +1,6 @@
1
1
  import type { ApplyRequest, ApplyResult, RpcNotification } from './protocol';
2
2
  export interface RpcClient {
3
- pending: (lastReceivedId: number, sessionId?: string) => Promise<RpcNotification[]>;
3
+ pending: (lastReceivedId: number, sessionId: string) => Promise<RpcNotification[]>;
4
4
  apply: (request: ApplyRequest) => Promise<ApplyResult>;
5
5
  }
6
6
  export declare function createRpcClient(dir: string, expectedPid?: number): RpcClient;
@@ -1 +1 @@
1
- import{Tc as l}from"../index-w9d41yy9.js";import"../index-4x20896x.js";async function a(n,e,t,o){let r=await l(n,o);if(!r)return null;let i=new AbortController,p=setTimeout(()=>i.abort(),2000);try{let s=await fetch(`http://127.0.0.1:${r.port}/rpc/${e}`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${r.token}`},body:JSON.stringify(t),signal:i.signal});if(!s.ok)return null;return await s.json()}catch{return null}finally{clearTimeout(p)}}function u(n,e){return{async pending(t,o){return(await a(n,"pending-notifications",{lastReceivedId:t,sessionId:o},e))?.messages??[]},async apply(t){return await a(n,"apply",{...t},e)??{text:"apply failed",knobs:{}}}}}export{u as createRpcClient};
1
+ import{ph as l}from"../index-0jfsxyn9.js";import"../index-n96q8pks.js";async function a(n,e,t,o){let r=await l(n,o);if(!r)return null;let i=new AbortController,p=setTimeout(()=>i.abort(),2000);try{let s=await fetch(`http://127.0.0.1:${r.port}/rpc/${e}`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${r.token}`},body:JSON.stringify(t),signal:i.signal});if(!s.ok)return null;return await s.json()}catch{return null}finally{clearTimeout(p)}}function u(n,e){return{async pending(t,o){return(await a(n,"pending-notifications",{lastReceivedId:t,sessionId:o},e))?.messages??[]},async apply(t){return await a(n,"apply",{...t},e)??{text:"apply failed",knobs:{}}}}}export{u as createRpcClient};
@@ -1 +1 @@
1
- import{Vc as a,Wc as b}from"../index-y0khnbt6.js";import"../index-4x20896x.js";export{a as tmpdir,b as getRpcDir};
1
+ import{rh as a,sh as b}from"../index-1gr8v4fn.js";import"../index-n96q8pks.js";export{a as tmpdir,b as getRpcDir};
@@ -0,0 +1,10 @@
1
+ import type { RpcServerHandle } from './rpc-server';
2
+ export interface RpcServerAdoption {
3
+ server: RpcServerHandle;
4
+ release: () => Promise<void>;
5
+ }
6
+ /**
7
+ * Serializes same-directory replacement and returns an identity-fenced lease.
8
+ * Distinct project directories remain independent.
9
+ */
10
+ export declare function adoptRpcServer(rpcDir: string, create: () => Promise<RpcServerHandle>): Promise<RpcServerAdoption>;
@@ -0,0 +1,7 @@
1
+ import type { ProcessFence } from './types.ts';
2
+ export interface WriteOpenCodeTombstoneOptions {
3
+ authPath: string;
4
+ fence?: ProcessFence;
5
+ beforeRename?: () => Promise<void>;
6
+ }
7
+ export declare function writeOpenCodeTombstoneAuth(options: WriteOpenCodeTombstoneOptions): Promise<void>;
@@ -0,0 +1,26 @@
1
+ import { type ClaustrumEnrollmentClient, type ClaustrumScopedClient } from '@cortexkit/anthropic-auth-core';
2
+ import type { CommandRunner, HarnessKind } from './types.ts';
3
+ export interface SetupClaustrumOptions {
4
+ paths?: {
5
+ tokenPath: string;
6
+ statePath: string;
7
+ };
8
+ ckBinary?: string;
9
+ runner?: CommandRunner;
10
+ enrollmentClient?: ClaustrumEnrollmentClient & {
11
+ close?: () => void;
12
+ };
13
+ scopedClient?: ClaustrumScopedClient & {
14
+ close?: () => void;
15
+ };
16
+ env?: NodeJS.ProcessEnv;
17
+ }
18
+ export interface SetupClaustrumResult {
19
+ ok: boolean;
20
+ message: string;
21
+ discoveredAccounts: Array<{
22
+ credentialId: string;
23
+ accountId: string;
24
+ }>;
25
+ }
26
+ export declare function setupClaustrumForHost(host: HarnessKind, options?: SetupClaustrumOptions): Promise<SetupClaustrumResult>;
@@ -0,0 +1,2 @@
1
+ import type { CommandRunner } from './types.ts';
2
+ export declare const defaultCommandRunner: CommandRunner;
@@ -0,0 +1,8 @@
1
+ import type { CommandRunner, ProcessFence } from './types.ts';
2
+ export interface SetupCommandOptions {
3
+ runner?: CommandRunner;
4
+ fence?: ProcessFence;
5
+ env?: NodeJS.ProcessEnv;
6
+ isInteractive?: boolean;
7
+ }
8
+ export declare function runSetupCommand(argv?: string[], options?: SetupCommandOptions): Promise<number>;
@@ -0,0 +1,5 @@
1
+ import type { ClaustrumDetection, CommandRunner, HostDetection, SetupDetection } from './types.ts';
2
+ export declare function detectOpenCode(env?: NodeJS.ProcessEnv, runner?: CommandRunner): Promise<HostDetection>;
3
+ export declare function detectPi(env?: NodeJS.ProcessEnv, runner?: CommandRunner): Promise<HostDetection>;
4
+ export declare function detectClaustrum(env?: NodeJS.ProcessEnv, runner?: CommandRunner): Promise<ClaustrumDetection>;
5
+ export declare function detectAll(env?: NodeJS.ProcessEnv, runner?: CommandRunner): Promise<SetupDetection>;
@@ -0,0 +1,9 @@
1
+ export declare function readJsonc<T = unknown>(path: string): {
2
+ value: T | null;
3
+ text: string;
4
+ exists: boolean;
5
+ };
6
+ export declare function updateJsoncArray(originalText: string, arrayPath: (string | number)[], entryToInsertOrUpdate: string, matcher: (existing: string) => boolean): {
7
+ text: string;
8
+ changed: boolean;
9
+ };
@@ -0,0 +1,18 @@
1
+ export declare function detectOpenCodeConfigFile(configDir: string): {
2
+ path: string;
3
+ exists: boolean;
4
+ };
5
+ export declare function detectOpenCodeTuiConfigFile(configDir: string): {
6
+ path: string;
7
+ exists: boolean;
8
+ };
9
+ export declare function ensureOpenCodePluginConfig(version: string, env?: NodeJS.ProcessEnv): Promise<{
10
+ configPath: string;
11
+ changed: boolean;
12
+ created: boolean;
13
+ }>;
14
+ export declare function ensureOpenCodeTuiConfig(version: string, env?: NodeJS.ProcessEnv): Promise<{
15
+ configPath: string;
16
+ changed: boolean;
17
+ created: boolean;
18
+ }>;
@@ -0,0 +1,15 @@
1
+ export declare const OPENCODE_PACKAGE_NAME = "@cortexkit/opencode-anthropic-auth";
2
+ export declare const PI_PACKAGE_NAME = "@cortexkit/pi-anthropic-auth";
3
+ export declare function getOpenCodeConfigDir(env?: NodeJS.ProcessEnv): string;
4
+ export declare function getOpenCodeDataDir(env?: NodeJS.ProcessEnv): string;
5
+ export declare function getOpenCodeAuthPath(env?: NodeJS.ProcessEnv): string;
6
+ export declare function getPiAgentDir(env?: NodeJS.ProcessEnv): string;
7
+ export declare function getPiAuthPath(env?: NodeJS.ProcessEnv): string;
8
+ export declare function opencodePluginEntry(version: string): string;
9
+ export declare function opencodeTuiEntry(version: string): string;
10
+ export declare function piPluginEntry(version: string): string;
11
+ /**
12
+ * Robustly resolve the package version from both source (src/setup/paths.ts)
13
+ * and bundled layouts (dist/cli.js, dist/index.js, etc.).
14
+ */
15
+ export declare function getSetupPackageVersion(): Promise<string>;
@@ -0,0 +1,8 @@
1
+ import type { CommandRunner } from './types.ts';
2
+ export declare function isPiPackageInstalled(env?: NodeJS.ProcessEnv): boolean;
3
+ export declare function hasPiLocalAnthropicAuth(env?: NodeJS.ProcessEnv): Promise<boolean>;
4
+ export declare function cleanPiLocalAnthropicAuth(env?: NodeJS.ProcessEnv): Promise<boolean>;
5
+ export declare function installPiExtension(version: string, runner?: CommandRunner, env?: NodeJS.ProcessEnv): Promise<{
6
+ ok: boolean;
7
+ message: string;
8
+ }>;
@@ -0,0 +1,14 @@
1
+ import type { CommandRunner, ProcessFence } from './types.ts';
2
+ export declare class ProcessFenceViolationError extends Error {
3
+ readonly activeHosts: Array<{
4
+ pid: number;
5
+ command: string;
6
+ }>;
7
+ constructor(activeHosts: Array<{
8
+ pid: number;
9
+ command: string;
10
+ }>);
11
+ }
12
+ export declare function createProcessFence(runner?: CommandRunner): ProcessFence;
13
+ export declare const defaultProcessFence: ProcessFence;
14
+ export declare function assertHostsStopped(fence?: ProcessFence): Promise<void>;
@@ -0,0 +1,37 @@
1
+ export type HarnessKind = 'opencode' | 'pi';
2
+ export interface HostDetection {
3
+ kind: HarnessKind;
4
+ installed: boolean;
5
+ version: string | null;
6
+ configPath: string;
7
+ pluginInstalled: boolean;
8
+ hasLocalAuth?: boolean;
9
+ }
10
+ export interface ClaustrumDetection {
11
+ ckInstalled: boolean;
12
+ ckVersion: string | null;
13
+ daemonRunning: boolean;
14
+ connectionPath: string | null;
15
+ }
16
+ export interface SetupDetection {
17
+ opencode: HostDetection;
18
+ pi: HostDetection;
19
+ claustrum: ClaustrumDetection;
20
+ }
21
+ export interface CommandRunnerResult {
22
+ exitCode: number;
23
+ stdout: string;
24
+ stderr: string;
25
+ }
26
+ export interface CommandRunner {
27
+ run(command: string, args: string[], options?: {
28
+ env?: Record<string, string | undefined>;
29
+ timeoutMs?: number;
30
+ }): Promise<CommandRunnerResult>;
31
+ }
32
+ export interface ProcessFence {
33
+ listRunningHosts(env?: Record<string, string | undefined>): Promise<Array<{
34
+ pid: number;
35
+ command: string;
36
+ }>>;
37
+ }
@@ -37,6 +37,9 @@ export interface SidebarAccountState {
37
37
  quota: AccountQuota | null;
38
38
  enabled: boolean;
39
39
  needsReauth: boolean;
40
+ vaultReauth?: boolean;
41
+ vaultServed?: boolean;
42
+ custodyState?: 'off' | 'on-vault-served' | 'on-vault-reauth' | 'on-cold' | 'unknown-identity' | 'on-identity-mismatch' | 'on-corrupt-binding';
40
43
  tierLabel?: string;
41
44
  }
42
45
  export interface FableRecoverySidebarState {
@@ -58,7 +61,7 @@ export interface PrimeSidebarAccountState {
58
61
  label: string;
59
62
  nextDueAt?: number | null;
60
63
  lastPrimedAt?: number | null;
61
- lastResult?: 'ok' | 'error';
64
+ lastResult?: 'ok' | 'error' | 'skipped';
62
65
  usage?: PrimeUsageCounters;
63
66
  estimatedCostUsd?: number;
64
67
  }
@@ -140,7 +143,7 @@ export declare function resolveActiveAccount(state: SidebarState): {
140
143
  };
141
144
  export declare function formatScopedQuotaLabel(title: string): string;
142
145
  /**
143
- * Pretty label for a recoverable-refusal source model (Fable 5 or Opus 5).
146
+ * Pretty label for a recoverable-refusal source model (Fable 5/5.1 or Opus 5).
144
147
  * Falls back to the raw id for unrecognized ids so the sidebar never goes
145
148
  * blank on a future model that has not yet been cataloged here.
146
149
  */
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./index-wezdyxst.js";import"./index-yskwj5e6.js";import"./index-4nz423bt.js";import"./index-4x20896x.js";export{i as setSidebarState,k as resolveActiveAccount,c as normalizeSidebarState,a as getSidebarStateFile,h as getSidebarState,f as getInitialSidebarRoutingTestHooks,q as getFableRecoverySummary,r as getCollapsedQuotaSummary,l as formatScopedQuotaLabel,n as formatPrimeTime,o as formatPrimeCost,p as formatPrimeAccountValue,m as formatFallbackModelLabel,j as drainSidebarWrites,u as computeQuotaPacing,d as __setSidebarStateWriteTestHooks,e as __setInitialSidebarRoutingTestHooks,g as __acquireSidebarStateLockForTest,t as SEVEN_DAY_MS,s as FIVE_HOUR_MS,b as DEFAULT_SIDEBAR_STATE};
1
+ import{A as t,B as u,h as a,i as b,j as c,k as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p,x as q,y as r,z as s}from"./index-xzbhzz0a.js";import"./index-1fq7h6yd.js";import"./index-a5d6v3ba.js";import"./index-n96q8pks.js";export{i as setSidebarState,k as resolveActiveAccount,c as normalizeSidebarState,a as getSidebarStateFile,h as getSidebarState,f as getInitialSidebarRoutingTestHooks,q as getFableRecoverySummary,r as getCollapsedQuotaSummary,l as formatScopedQuotaLabel,n as formatPrimeTime,o as formatPrimeCost,p as formatPrimeAccountValue,m as formatFallbackModelLabel,j as drainSidebarWrites,u as computeQuotaPacing,d as __setSidebarStateWriteTestHooks,e as __setInitialSidebarRoutingTestHooks,g as __acquireSidebarStateLockForTest,t as SEVEN_DAY_MS,s as FIVE_HOUR_MS,b as DEFAULT_SIDEBAR_STATE};
@@ -1,4 +1,5 @@
1
- import { type Cache1hMode, type ClaudeCodeIdentity } from '@cortexkit/anthropic-auth-core';
1
+ import { type BillingLineageFields, type Cache1hMode, type ClaudeCodeIdentity, type ThinkingPrefixMismatchBehavior } from '@cortexkit/anthropic-auth-core';
2
+ import { type OpenCodeEffortMarkerPlan } from './effort-history';
2
3
  import { type ServerSideFallbackOutcome } from './server-fallback';
3
4
  export declare const NON_STREAMING_DIAGNOSTICS_MAX_BYTES: number;
4
5
  export type FetchInput = string | URL | Request;
@@ -79,17 +80,31 @@ export declare function prepareFableCacheWarmSource(bodyText: string, fableModel
79
80
  * Rewrite the full request body: sanitize system prompt and prefix tool names.
80
81
  */
81
82
  type RewritePerfCallback = (stage: string, data?: Record<string, unknown>) => void;
83
+ export declare const CC_VERSION_SUFFIX_SESSION_LIMIT = 1000;
84
+ export declare function resetPinnedFirstUserTextsForTest(): void;
85
+ export declare function hasPinnedFirstUserTextForTest(sessionId: string): boolean;
82
86
  export declare function rewriteRequestBody(body: string, options?: {
83
87
  cache1hEnabled?: boolean;
84
88
  cache1hMode?: Cache1hMode;
85
89
  fastModeEnabled?: boolean;
86
90
  identity?: ClaudeCodeIdentity;
91
+ sessionId?: string;
92
+ thinkingPrefixMismatchBehavior?: ThinkingPrefixMismatchBehavior;
93
+ midConversationEffortEnabled?: boolean;
94
+ midConversationEffortPlan?: string;
95
+ midConversationEffortResolvedPlan?: OpenCodeEffortMarkerPlan;
87
96
  perf?: RewritePerfCallback;
88
97
  hybridStandbyAnchor?: HybridMessageCacheAnchor;
89
98
  serverSideFallbackEnabled?: boolean;
99
+ modelRemapEnabled?: boolean;
90
100
  laneStart?: boolean;
101
+ billingLineage?: BillingLineageFields;
91
102
  cacheDiagnosticsPreviousMessageId?: string | null;
92
103
  }): Promise<string>;
104
+ type RelayUpstreamStatus = {
105
+ status: number;
106
+ source: 'relay_status_field' | 'relay_message_parse';
107
+ };
93
108
  /**
94
109
  * Create a streaming response that strips the tool prefix from tool names.
95
110
  */
@@ -108,6 +123,7 @@ export declare function createStrippedStream(response: Response, options?: {
108
123
  stopReason?: string;
109
124
  }) => void;
110
125
  onMessageResponse?: (message: Record<string, unknown>) => void;
126
+ onRelayUpstreamError?: (status: RelayUpstreamStatus) => void;
111
127
  onStreamEnd?: () => void | Promise<void>;
112
128
  responseMode?: 'json';
113
129
  laneStart?: boolean;
@@ -1,6 +1,7 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
- import type { PrimeAccountStatus } from '@cortexkit/anthropic-auth-core';
2
+ import { type PrimeAccountStatus } from '@cortexkit/anthropic-auth-core';
3
3
  import type { TuiPluginApi } from '@opencode-ai/plugin/tui';
4
+ import type { AccountDialogAccount } from '../rpc/protocol';
4
5
  import type { OpenDialogPayload } from '../rpc/protocol.js';
5
6
  type ApplyFn = (command: OpenDialogPayload['command'], args: string) => Promise<{
6
7
  text: string;
@@ -11,6 +12,19 @@ type KillswitchDialogConfig = {
11
12
  main?: Record<string, number>;
12
13
  accounts?: Record<string, Record<string, number>>;
13
14
  };
15
+ type TuiAccountDialogAccount = Omit<AccountDialogAccount, 'vaultReauth' | 'custodyState'> & Partial<Pick<AccountDialogAccount, 'vaultReauth' | 'custodyState'>>;
16
+ type TuiAccountDialogPayload = {
17
+ accounts: TuiAccountDialogAccount[];
18
+ claustrumDetection: string;
19
+ custodyMode?: TuiCustodyMode;
20
+ enrollmentStatus?: string;
21
+ };
22
+ type TuiCustodyMode = 'local' | 'claustrum' | `mismatch: ${string}`;
23
+ type AccountDialogOption = {
24
+ title: string;
25
+ value: string;
26
+ description?: string;
27
+ };
14
28
  export declare const PRIME_DIALOG_OPTIONS: {
15
29
  title: string;
16
30
  value: string;
@@ -19,18 +33,23 @@ export declare function handlePrimeStatusOption(option: {
19
33
  value: string;
20
34
  }, renderMain: () => void): void;
21
35
  export declare function buildKillswitchThresholdSeed(config: KillswitchDialogConfig, accountIds: string[]): string;
22
- export declare function buildAccountDialogOption(account: {
23
- id: string;
24
- label: string;
25
- role: string;
26
- enabled: boolean;
27
- quotaPercent: number | null;
28
- tierLabel?: string;
29
- }): {
36
+ export declare function normalizeAccountDialogPayload(value: unknown): TuiAccountDialogPayload;
37
+ export declare function buildAccountDialogOption(account: TuiAccountDialogAccount): {
30
38
  title: string;
31
39
  value: string;
32
40
  description?: string | undefined;
33
41
  };
42
+ export declare function buildManageAccountOptions(account: TuiAccountDialogAccount): AccountDialogOption[];
43
+ export declare function buildAccountDialogL1(value: unknown): {
44
+ header: string;
45
+ options: AccountDialogOption[];
46
+ enrollmentStatus?: string;
47
+ modeAction?: {
48
+ command: 'claude-account';
49
+ arguments: 'local' | 'claustrum';
50
+ };
51
+ };
52
+ export declare function retainAccountDialogProjection(current: Record<string, unknown>, incoming: Record<string, unknown>): Record<string, unknown>;
34
53
  /**
35
54
  * Format the per-account status lines shown in the Claude prime Status
36
55
  * view. Pure: consumed by the dialog's Status pane; the sidebar uses a
@@ -1,6 +1,6 @@
1
- import{Xc as c,Yc as C,Zc as v}from"./index-4x20896x.js";var m=C((h,k)=>{(function(Q){if(typeof k==="object"&&typeof k.exports==="object"){var J=Q(v,h);if(J!==void 0)k.exports=J}else if(typeof define==="function"&&define.amd)define(["require","exports","./impl/format","./impl/edit","./impl/scanner","./impl/parser"],Q)})(function(Q,J){Object.defineProperty(J,"__esModule",{value:!0}),J.applyEdits=J.modify=J.format=J.printParseErrorCode=J.ParseErrorCode=J.stripComments=J.visit=J.getNodeValue=J.getNodePath=J.findNodeAtOffset=J.findNodeAtLocation=J.parseTree=J.parse=J.getLocation=J.SyntaxKind=J.ScanError=J.createScanner=void 0;let X=Q("./impl/format"),G=Q("./impl/edit"),Z=Q("./impl/scanner"),$=Q("./impl/parser");J.createScanner=Z.createScanner;var V;(function(z){z[z.None=0]="None",z[z.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",z[z.UnexpectedEndOfString=2]="UnexpectedEndOfString",z[z.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",z[z.InvalidUnicode=4]="InvalidUnicode",z[z.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",z[z.InvalidCharacter=6]="InvalidCharacter"})(V||(J.ScanError=V={}));var Y;(function(z){z[z.OpenBraceToken=1]="OpenBraceToken",z[z.CloseBraceToken=2]="CloseBraceToken",z[z.OpenBracketToken=3]="OpenBracketToken",z[z.CloseBracketToken=4]="CloseBracketToken",z[z.CommaToken=5]="CommaToken",z[z.ColonToken=6]="ColonToken",z[z.NullKeyword=7]="NullKeyword",z[z.TrueKeyword=8]="TrueKeyword",z[z.FalseKeyword=9]="FalseKeyword",z[z.StringLiteral=10]="StringLiteral",z[z.NumericLiteral=11]="NumericLiteral",z[z.LineCommentTrivia=12]="LineCommentTrivia",z[z.BlockCommentTrivia=13]="BlockCommentTrivia",z[z.LineBreakTrivia=14]="LineBreakTrivia",z[z.Trivia=15]="Trivia",z[z.Unknown=16]="Unknown",z[z.EOF=17]="EOF"})(Y||(J.SyntaxKind=Y={})),J.getLocation=$.getLocation,J.parse=$.parse,J.parseTree=$.parseTree,J.findNodeAtLocation=$.findNodeAtLocation,J.findNodeAtOffset=$.findNodeAtOffset,J.getNodePath=$.getNodePath,J.getNodeValue=$.getNodeValue,J.visit=$.visit,J.stripComments=$.stripComments;var A;(function(z){z[z.InvalidSymbol=1]="InvalidSymbol",z[z.InvalidNumberFormat=2]="InvalidNumberFormat",z[z.PropertyNameExpected=3]="PropertyNameExpected",z[z.ValueExpected=4]="ValueExpected",z[z.ColonExpected=5]="ColonExpected",z[z.CommaExpected=6]="CommaExpected",z[z.CloseBraceExpected=7]="CloseBraceExpected",z[z.CloseBracketExpected=8]="CloseBracketExpected",z[z.EndOfFileExpected=9]="EndOfFileExpected",z[z.InvalidCommentToken=10]="InvalidCommentToken",z[z.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",z[z.UnexpectedEndOfString=12]="UnexpectedEndOfString",z[z.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",z[z.InvalidUnicode=14]="InvalidUnicode",z[z.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",z[z.InvalidCharacter=16]="InvalidCharacter"})(A||(J.ParseErrorCode=A={}));function L(z){switch(z){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}J.printParseErrorCode=L;function W(z,B,j){return X.format(z,B,j)}J.format=W;function q(z,B,j,R){return G.setProperty(z,B,j,R)}J.modify=q;function O(z,B){let j=B.slice(0).sort((M,N)=>{let T=M.offset-N.offset;if(T===0)return M.length-N.length;return T}),R=z.length;for(let M=j.length-1;M>=0;M--){let N=j[M];if(N.offset+N.length<=R)z=G.applyEdit(z,N);else throw Error("Overlapping edit");R=N.offset}return z}J.applyEdits=O})});var I=c(m(),1);import{readFileSync as y,watch as S}from"node:fs";import{mkdir as E,readFile as g,rename as p,writeFile as l}from"node:fs/promises";import{homedir as x}from"node:os";import{basename as i,dirname as P,join as w}from"node:path";import{clearTimeout as _,setTimeout as f}from"node:timers";var s="OPENCODE_TUI_PREFERENCES_FILE",d="tui-preferences.jsonc";function b(){let Q=process.env[s];if(Q)return Q;let J=process.env.OPENCODE_CONFIG_DIR||w(process.env.XDG_CONFIG_HOME||w(x(),".config"),"opencode");return w(J,d)}function U(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}async function Yz(){try{let Q=await g(b(),"utf8"),J=[],X=I.parse(Q,J,{allowTrailingComma:!0});if(J.length>0)return{};return U(X)?X:{}}catch{return{}}}var n="anthropic-auth",t=160,u={forceToTop:!1,order:t,startCollapsed:!1,rememberCollapsed:!0,collapsed:null,pollMs:1500,refreshDebounceMs:200,header:{label:"CLAUDE",showVersion:!0},sections:{quota:!0,fallbackAccounts:!0,routing:!0,cache:!0,health:!0,pacing:!0},appearance:{barWidth:10,barFilledChar:"█",barEmptyChar:"░",warnThreshold:50,errorThreshold:80}};function H(Q,J){return typeof Q==="boolean"?Q:J}function D(Q,J,X,G){if(typeof Q!=="number"||!Number.isFinite(Q))return J;return Math.min(Math.max(Math.round(Q),X),G)}function a(Q,J,X){if(typeof Q!=="string"||Q.length===0)return J;return Q.slice(0,X)}function K(Q,J){if(typeof Q!=="string")return J;return[...Q][0]??J}function Bz(Q){let J=Q[n];if(!U(J))return structuredClone(u);let X=u,G=U(J.header)?J.header:{},Z=U(J.sections)?J.sections:{},$=U(J.appearance)?J.appearance:{},V=D($.warnThreshold,X.appearance.warnThreshold,0,99),Y=Math.max(D($.errorThreshold,X.appearance.errorThreshold,0,100),Math.min(V+1,100));return{forceToTop:H(J.forceToTop,X.forceToTop),order:D(J.order,X.order,-1e4,1e4),startCollapsed:H(J.startCollapsed,X.startCollapsed),rememberCollapsed:H(J.rememberCollapsed,X.rememberCollapsed),collapsed:typeof J.collapsed==="boolean"?J.collapsed:null,pollMs:D(J.pollMs,X.pollMs,500,30000),refreshDebounceMs:D(J.refreshDebounceMs,X.refreshDebounceMs,50,5000),header:{label:a(G.label,X.header.label,20),showVersion:H(G.showVersion,X.header.showVersion)},sections:{quota:H(Z.quota,X.sections.quota),fallbackAccounts:H(Z.fallbackAccounts,X.sections.fallbackAccounts),routing:H(Z.routing,X.sections.routing),cache:H(Z.cache,X.sections.cache),health:H(Z.health,X.sections.health),pacing:H(Z.pacing,X.sections.pacing)},appearance:{barWidth:D($.barWidth,X.appearance.barWidth,4,40),barFilledChar:K($.barFilledChar,X.appearance.barFilledChar),barEmptyChar:K($.barEmptyChar,X.appearance.barEmptyChar),warnThreshold:V,errorThreshold:Y}}}var o=-1e5;function Hz(Q,J,X){let G=Q[J];if(!U(G))return X;if(G.forceToTop===!0)return o+Object.keys(Q).indexOf(J);return D(G.order,X,-1e4,1e4)}var e=`// Shared preferences for opencode TUI plugins.
1
+ import{nh as _}from"./index-xxhyhp98.js";import{th as C}from"./index-n96q8pks.js";var W=C(_(),1);import{readFileSync as E,watch as b}from"node:fs";import{mkdir as g,readFile as A,rename as F,writeFile as T}from"node:fs/promises";import{homedir as y}from"node:os";import{basename as f,dirname as x,join as D}from"node:path";import{clearTimeout as U,setTimeout as R}from"node:timers";var v="OPENCODE_TUI_PREFERENCES_FILE",h="tui-preferences.jsonc";function K(){let J=process.env[v];if(J)return J;let z=process.env.OPENCODE_CONFIG_DIR||D(process.env.XDG_CONFIG_HOME||D(y(),".config"),"opencode");return D(z,h)}function H(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}async function e(){try{let J=await A(K(),"utf8"),z=[],q=W.parse(J,z,{allowTrailingComma:!0});if(z.length>0)return{};return H(q)?q:{}}catch{return{}}}var m="anthropic-auth",p=160,w={forceToTop:!1,order:p,startCollapsed:!1,rememberCollapsed:!0,collapsed:null,pollMs:1500,refreshDebounceMs:200,header:{label:"CLAUDE",showVersion:!0},sections:{quota:!0,fallbackAccounts:!0,routing:!0,cache:!0,health:!0,pacing:!0},appearance:{barWidth:10,barFilledChar:"█",barEmptyChar:"░",warnThreshold:50,errorThreshold:80}};function $(J,z){return typeof J==="boolean"?J:z}function Y(J,z,q,X){if(typeof J!=="number"||!Number.isFinite(J))return z;return Math.min(Math.max(Math.round(J),q),X)}function c(J,z,q){if(typeof J!=="string"||J.length===0)return z;return J.slice(0,q)}function P(J,z){if(typeof J!=="string")return z;return[...J][0]??z}function qq(J){let z=J[m];if(!H(z))return structuredClone(w);let q=w,X=H(z.header)?z.header:{},Q=H(z.sections)?z.sections:{},Z=H(z.appearance)?z.appearance:{},G=Y(Z.warnThreshold,q.appearance.warnThreshold,0,99),V=Math.max(Y(Z.errorThreshold,q.appearance.errorThreshold,0,100),Math.min(G+1,100));return{forceToTop:$(z.forceToTop,q.forceToTop),order:Y(z.order,q.order,-1e4,1e4),startCollapsed:$(z.startCollapsed,q.startCollapsed),rememberCollapsed:$(z.rememberCollapsed,q.rememberCollapsed),collapsed:typeof z.collapsed==="boolean"?z.collapsed:null,pollMs:Y(z.pollMs,q.pollMs,500,30000),refreshDebounceMs:Y(z.refreshDebounceMs,q.refreshDebounceMs,50,5000),header:{label:c(X.label,q.header.label,20),showVersion:$(X.showVersion,q.header.showVersion)},sections:{quota:$(Q.quota,q.sections.quota),fallbackAccounts:$(Q.fallbackAccounts,q.sections.fallbackAccounts),routing:$(Q.routing,q.sections.routing),cache:$(Q.cache,q.sections.cache),health:$(Q.health,q.sections.health),pacing:$(Q.pacing,q.sections.pacing)},appearance:{barWidth:Y(Z.barWidth,q.appearance.barWidth,4,40),barFilledChar:P(Z.barFilledChar,q.appearance.barFilledChar),barEmptyChar:P(Z.barEmptyChar,q.appearance.barEmptyChar),warnThreshold:G,errorThreshold:V}}}var u=-1e5;function zq(J,z,q){let X=J[z];if(!H(X))return q;if(X.forceToTop===!0)return u+Object.keys(J).indexOf(z);return Y(X.order,q,-1e4,1e4)}var s=`// Shared preferences for opencode TUI plugins.
2
2
  // One top-level key per plugin (short name). See each plugin's README for
3
3
  // its supported settings. This file is safe to hand-edit; plugins update
4
4
  // individual keys in place and preserve comments.
5
5
  {}
6
- `;async function r(Q,J,X){let G=b();await E(P(G),{recursive:!0});let Z;try{Z=await g(G,"utf8")}catch{Z=""}if(Z.trim()==="")Z=e;let $=I.modify(Z,[Q,...J],X,{formattingOptions:{insertSpaces:!0,tabSize:2}}),V=I.applyEdits(Z,$),Y=`${G}.${process.pid}.tmp`;await l(Y,V,"utf8"),await p(Y,G)}var F=Promise.resolve();function Wz(Q,J,X){return F=F.then(()=>r(Q,J,X)).catch(()=>{}),F}var zz=150,Jz=100;function jz(Q,J={}){let X=b(),G=i(X),Z=null,$=null;try{$=y(X,"utf8")}catch{}let V=!1,Y=async()=>{let z=await g(X,"utf8").catch(()=>null);if(V||z===null)return;if(z===$)return;$=z,Q()},A=()=>{if(Z)_(Z);Z=f(()=>{Z=null,Y()},zz)},L=null;try{L=(J.watchDirectory??S)(P(X),(z,B)=>{let j=B===G||B?.startsWith(`${G}.`)&&B.endsWith(".tmp");if(B!=null&&!j)return;A()})}catch{if($===null)return()=>{}}let W=null,q=!1,O=()=>{if(V||W)return;W=f(()=>{if(W=null,V||q)return;q=!0,Y().finally(()=>{q=!1,O()})},Jz),W.unref?.()};return O(),()=>{if(V=!0,Z)_(Z);if(W)_(W);L?.close()}}export{jz as watchTuiPreferences,Bz as resolveAnthropicAuthPrefs,Yz as readTuiPreferencesFile,Wz as queueTuiPreferenceUpdate,b as getTuiPreferencesFile,Hz as computeEffectiveOrder,s as TUI_PREFS_FILE_ENV,n as PLUGIN_KEY,t as DEFAULT_SLOT_ORDER,u as DEFAULT_PREFS};
6
+ `;async function d(J,z,q){let X=K();await g(x(X),{recursive:!0});let Q;try{Q=await A(X,"utf8")}catch{Q=""}if(Q.trim()==="")Q=s;let Z=W.modify(Q,[J,...z],q,{formattingOptions:{insertSpaces:!0,tabSize:2}}),G=W.applyEdits(Q,Z),V=`${X}.${process.pid}.tmp`;await T(V,G,"utf8"),await F(V,X)}var I=Promise.resolve();function Jq(J,z,q){return I=I.then(()=>d(J,z,q)).catch(()=>{}),I}var o=150,n=100;function Qq(J,z={}){let q=K(),X=f(q),Q=null,Z=null;try{Z=E(q,"utf8")}catch{}let G=!1,V=async()=>{let j=await A(q,"utf8").catch(()=>null);if(G||j===null)return;if(j===Z)return;Z=j,J()},S=()=>{if(Q)U(Q);Q=R(()=>{Q=null,V()},o)},O=null;try{O=(z.watchDirectory??b)(x(q),(j,M)=>{let k=M===X||M?.startsWith(`${X}.`)&&M.endsWith(".tmp");if(M!=null&&!k)return;S()})}catch{if(Z===null)return()=>{}}let B=null,N=!1,L=()=>{if(G||B)return;B=R(()=>{if(B=null,G||N)return;N=!0,V().finally(()=>{N=!1,L()})},n),B.unref?.()};return L(),()=>{if(G=!0,Q)U(Q);if(B)U(B);O?.close()}}export{Qq as watchTuiPreferences,qq as resolveAnthropicAuthPrefs,e as readTuiPreferencesFile,Jq as queueTuiPreferenceUpdate,K as getTuiPreferencesFile,zq as computeEffectiveOrder,v as TUI_PREFS_FILE_ENV,m as PLUGIN_KEY,p as DEFAULT_SLOT_ORDER,w as DEFAULT_PREFS};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-anthropic-auth",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,9 +45,10 @@
45
45
  "LICENSE"
46
46
  ],
47
47
  "scripts": {
48
- "build": "rm -rf dist && bun build src/index.ts src/cli.ts src/sidebar-state.ts src/tui-preferences.ts src/rpc/rpc-client.ts src/rpc/port-file.ts src/rpc/protocol.ts src/rpc/rpc-dir.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --minify && tsc -p tsconfig.build.json --emitDeclarationOnly && bun run build:tui",
48
+ "build": "rm -rf dist && bun build src/index.ts src/cli.ts src/sidebar-state.ts src/tui-preferences.ts src/rpc/rpc-client.ts src/rpc/port-file.ts src/rpc/protocol.ts src/rpc/rpc-dir.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --minify && tsc -p tsconfig.build.json --emitDeclarationOnly && bun run build:tui && bun run check:bundle",
49
49
  "build:tui": "bun scripts/build-tui.ts",
50
50
  "smoke:tui": "bun scripts/smoke-tui-pack-install.ts",
51
+ "check:bundle": "bun scripts/check-bundle-globals.ts",
51
52
  "build:dev": "rm -rf dist && tsc -p tsconfig.build.json",
52
53
  "dev": "bun ../../scripts/dev.ts",
53
54
  "dev:clean": "bun ../../scripts/dev-clean.ts",
@@ -61,10 +62,14 @@
61
62
  "@opencode-ai/plugin": "*"
62
63
  },
63
64
  "dependencies": {
64
- "@cortexkit/anthropic-auth-core": "1.21.0",
65
- "@opentui/core": "0.5.7",
66
- "@opentui/solid": "0.5.7",
65
+ "@clack/prompts": "^1.6.0",
66
+ "@cortexkit/anthropic-auth-core": "1.23.0",
67
+ "@opentui/core": "0.5.11",
68
+ "@opentui/solid": "0.5.11",
67
69
  "jsonc-parser": "^3.3.1",
68
70
  "solid-js": "1.9.12"
71
+ },
72
+ "devDependencies": {
73
+ "@ai-sdk/anthropic": "3.0.111"
69
74
  }
70
75
  }