@cortexkit/opencode-openai-auth 0.7.1 → 0.8.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 +9 -5
- package/dist/{index-9jpc8yct.js → index-02h7g5f9.js} +1 -1
- package/dist/index-2xppkvkx.js +2 -0
- package/dist/index-3w4vmckx.js +2 -0
- package/dist/{index-zxqb5ydj.js → index-507jh8bv.js} +1 -1
- package/dist/{index-zg1x8sty.js → index-944gsj1s.js} +1 -1
- package/dist/index-nshbgkz1.js +198 -0
- package/dist/{index-87145jkw.js → index-xyg86jgt.js} +1 -1
- package/dist/index.d.ts +381 -35
- package/dist/index.js +66 -161
- package/dist/protocol-Cv9ZmU0p.d.ts +24 -0
- package/dist/quota-normalize-wap0rne8.js +1 -0
- package/dist/rpc/port-file.d.ts +11 -9
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.d.ts +2 -21
- package/dist/rpc/rpc-client.d.ts +6 -4
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/rpc/rpc-dir.d.ts +7 -5
- package/dist/rpc/rpc-dir.js +1 -1
- package/dist/sidebar-state.d.ts +84 -83
- package/dist/sidebar-state.js +1 -1
- package/dist/{token-bvp0y166.js → token-jdvpwk60.js} +1 -1
- package/dist/token-util-zzm7paz9.js +1 -0
- package/dist/tui-preferences.d.ts +27 -26
- package/dist/tui-preferences.js +1 -1
- package/dist/tui.d.ts +18 -17
- package/package.json +10 -17
- package/src/tui/entry.mjs +2 -2
- package/src/tui-compiled/{core/account-paths.ts → raw/core-account-paths.ts} +29 -18
- package/src/tui-compiled/raw/logger.ts +53 -0
- package/src/tui-compiled/{rpc/port-file.ts → raw/rpc-port-file.ts} +1 -1
- package/src/tui-compiled/raw/rpc-protocol.ts +12 -0
- package/src/{rpc/rpc-client.ts → tui-compiled/raw/rpc-rpc-client.ts} +2 -2
- package/src/{sidebar-state.ts → tui-compiled/raw/sidebar-state.ts} +2 -2
- package/src/{tui/command-dialogs.tsx → tui-compiled/raw/tui-command-dialogs.tsx} +5 -5
- package/src/{tui.tsx → tui-compiled/raw/tui.tsx} +11 -10
- package/src/{core/account-paths.ts → tui-compiled/runtime/core-account-paths.ts} +29 -18
- package/src/tui-compiled/runtime/logger.ts +53 -0
- package/src/{rpc/port-file.ts → tui-compiled/runtime/rpc-port-file.ts} +1 -1
- package/src/tui-compiled/runtime/rpc-protocol.ts +12 -0
- package/src/tui-compiled/{rpc/rpc-client.ts → runtime/rpc-rpc-client.ts} +2 -2
- package/src/tui-compiled/{sidebar-state.ts → runtime/sidebar-state.ts} +2 -2
- package/src/tui-compiled/{tui/command-dialogs.tsx → runtime/tui-command-dialogs.tsx} +3 -4
- package/src/tui-compiled/{tui.tsx → runtime/tui.tsx} +10 -10
- package/src/tui-compiled/shared/internal.ts +6 -0
- package/src/{logger.ts → tui-compiled/shared/logger.ts} +82 -21
- package/src/tui-compiled/shared/paths.ts +33 -0
- package/src/{core → tui-compiled/shared}/refresh-file-lock.ts +7 -4
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -15
- package/dist/codex-http.d.ts +0 -3
- package/dist/commands.d.ts +0 -88
- package/dist/config.d.ts +0 -47
- package/dist/core/account-paths.d.ts +0 -25
- package/dist/core/accounts.d.ts +0 -330
- package/dist/core/atomic-write.d.ts +0 -1
- package/dist/core/background-quota-refresh.d.ts +0 -46
- package/dist/core/backoff.d.ts +0 -53
- package/dist/core/cachekeep.d.ts +0 -118
- package/dist/core/oauth.d.ts +0 -138
- package/dist/core/provider.d.ts +0 -70
- package/dist/core/quota-manager.d.ts +0 -192
- package/dist/core/refresh-all-quota.d.ts +0 -86
- package/dist/core/refresh-file-lock.d.ts +0 -12
- package/dist/core/reset-credits.d.ts +0 -116
- package/dist/core/sticky-routing.d.ts +0 -43
- package/dist/dump.d.ts +0 -20
- package/dist/hosted-web-search.d.ts +0 -5
- package/dist/index-8f1200qx.js +0 -6
- package/dist/index-nrvjr97q.js +0 -3
- package/dist/index-qaggaze1.js +0 -2
- package/dist/index-sdcpzbnk.js +0 -2
- package/dist/index-zf3axndm.js +0 -89
- package/dist/logger.d.ts +0 -22
- package/dist/model-costs.d.ts +0 -29
- package/dist/prompt-context.d.ts +0 -19
- package/dist/quota-normalize-dvwtmy7f.js +0 -1
- package/dist/quota-normalize.d.ts +0 -43
- package/dist/raw-ws-bun.d.ts +0 -40
- package/dist/raw-ws-node.d.ts +0 -37
- package/dist/raw-ws-upgrade.d.ts +0 -2
- package/dist/raw-ws.d.ts +0 -3
- package/dist/response-stream-error.d.ts +0 -12
- package/dist/rpc/notifications.d.ts +0 -5
- package/dist/rpc/rpc-server.d.ts +0 -17
- package/dist/token-util-jcj7k7pa.js +0 -1
- package/dist/tui/command-dialogs.d.ts +0 -21
- package/dist/util/error.d.ts +0 -1
- package/dist/util/open-url.d.ts +0 -6
- package/dist/util/proxy-env.d.ts +0 -4
- package/dist/util/record.d.ts +0 -1
- package/dist/util/stable-json.d.ts +0 -1
- package/dist/util/uuid-v7.d.ts +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/ws-pool.d.ts +0 -57
- package/dist/ws.d.ts +0 -53
- package/src/rpc/notifications.ts +0 -54
- package/src/rpc/protocol.ts +0 -33
- package/src/rpc/rpc-server.ts +0 -172
- package/src/tui-compiled/core/refresh-file-lock.ts +0 -381
- package/src/tui-compiled/logger.ts +0 -196
- package/src/tui-compiled/rpc/protocol.ts +0 -33
- package/src/util/error.ts +0 -9
- package/src/util/open-url.ts +0 -30
- package/src/util/proxy-env.ts +0 -42
- package/src/util/record.ts +0 -3
- package/src/util/stable-json.ts +0 -15
- package/src/util/uuid-v7.ts +0 -18
- /package/src/{rpc/rpc-dir.ts → tui-compiled/raw/rpc-rpc-dir.ts} +0 -0
- /package/src/tui-compiled/{tui-preferences.ts → raw/tui-preferences.ts} +0 -0
- /package/src/tui-compiled/{rpc/rpc-dir.ts → runtime/rpc-rpc-dir.ts} +0 -0
- /package/src/{tui-preferences.ts → tui-compiled/runtime/tui-preferences.ts} +0 -0
- /package/src/tui-compiled/{util → shared/util}/error.ts +0 -0
- /package/src/tui-compiled/{util → shared/util}/open-url.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../core/dist/protocol.d.ts
|
|
2
|
+
type CommandModalName = 'openai-quota' | 'openai-account' | 'openai-routing' | 'openai-killswitch' | 'openai-dump' | 'openai-logging' | 'openai-cachekeep' | 'openai-reset';
|
|
3
|
+
interface OpenDialogPayload {
|
|
4
|
+
command: CommandModalName;
|
|
5
|
+
text: string;
|
|
6
|
+
knobs: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
interface RpcNotification {
|
|
9
|
+
id: number;
|
|
10
|
+
type: 'open-dialog';
|
|
11
|
+
payload: OpenDialogPayload;
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ApplyRequest {
|
|
15
|
+
command: CommandModalName;
|
|
16
|
+
arguments: string;
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
}
|
|
19
|
+
interface ApplyResult {
|
|
20
|
+
text: string;
|
|
21
|
+
knobs: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { RpcNotification as a, OpenDialogPayload as i, ApplyResult as n, CommandModalName as r, ApplyRequest as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Na as a,Oa as b,Pa as c,Qa as d,Ra as e}from"./index-xyg86jgt.js";import"./index-507jh8bv.js";export{a as toResetIso,d as normalizeWsFrame,e as normalizeWham,b as normalizeQuotaHeaders,c as isCompleteQuotaHeaderFrame};
|
package/dist/rpc/port-file.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
//#region src/rpc/port-file.d.ts
|
|
1
2
|
export interface PortFileEntry {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
port: number;
|
|
4
|
+
token: string;
|
|
5
|
+
pid: number;
|
|
6
|
+
startedAt: number;
|
|
6
7
|
}
|
|
7
8
|
export declare function writePortFile(dir: string, entry: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
port: number;
|
|
10
|
+
token: string;
|
|
11
|
+
pid: number;
|
|
11
12
|
}, options?: {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
secureDir?: boolean;
|
|
14
|
+
beforeWrite?: () => void | Promise<void>;
|
|
14
15
|
}): Promise<string>;
|
|
15
16
|
export declare function sweepRpcState(root: string, activeDir: string): Promise<void>;
|
|
16
17
|
export declare function discoverPortFile(dir: string, expectedPid?: number): Promise<PortFileEntry | null>;
|
|
18
|
+
//#endregion
|
package/dist/rpc/port-file.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as a,G as b,H as c}from"../index-3w4vmckx.js";import"../index-nshbgkz1.js";import"../index-xyg86jgt.js";import"../index-507jh8bv.js";export{a as writePortFile,b as sweepRpcState,c as discoverPortFile};
|
package/dist/rpc/protocol.d.ts
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
command: CommandModalName;
|
|
4
|
-
text: string;
|
|
5
|
-
knobs: Record<string, unknown>;
|
|
6
|
-
}
|
|
7
|
-
export interface RpcNotification {
|
|
8
|
-
id: number;
|
|
9
|
-
type: 'open-dialog';
|
|
10
|
-
payload: OpenDialogPayload;
|
|
11
|
-
sessionId?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ApplyRequest {
|
|
14
|
-
command: CommandModalName;
|
|
15
|
-
arguments: string;
|
|
16
|
-
sessionId?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ApplyResult {
|
|
19
|
-
text: string;
|
|
20
|
-
knobs: Record<string, unknown>;
|
|
21
|
-
}
|
|
1
|
+
import { a as RpcNotification, i as OpenDialogPayload, n as ApplyResult, r as CommandModalName, t as ApplyRequest } from "../protocol-Cv9ZmU0p.js";
|
|
2
|
+
export type { ApplyRequest, ApplyResult, CommandModalName, OpenDialogPayload, RpcNotification };
|
package/dist/rpc/rpc-client.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { a as RpcNotification, n as ApplyResult, t as ApplyRequest } from "../protocol-Cv9ZmU0p.js";
|
|
2
|
+
import { PortFileEntry } from "./port-file.js";
|
|
3
|
+
//#region src/rpc/rpc-client.d.ts
|
|
3
4
|
export interface RpcClient {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
pending: (lastReceivedId: number, sessionId?: string) => Promise<RpcNotification[]>;
|
|
6
|
+
apply: (request: ApplyRequest, timeoutMs?: number) => Promise<ApplyResult>;
|
|
6
7
|
}
|
|
7
8
|
export declare const DEFAULT_RPC_TIMEOUT_MS = 2000;
|
|
8
9
|
export declare function createRpcClient(dir: string, expectedPid?: number, onSelected?: (entry: PortFileEntry | null) => void): RpcClient;
|
|
10
|
+
//#endregion
|
package/dist/rpc/rpc-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{H as c}from"../index-3w4vmckx.js";import"../index-nshbgkz1.js";import"../index-xyg86jgt.js";import"../index-507jh8bv.js";var y=2000;async function p(n,r,s,o,i,e=y){let t=await c(n,r);if(s?.(t),!t)return null;let l=new AbortController,u=setTimeout(()=>l.abort(),e);try{let a=await fetch(`http://127.0.0.1:${t.port}/rpc/${o}`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${t.token}`},body:JSON.stringify(i),signal:l.signal});if(!a.ok)return null;return await a.json()}catch{return null}finally{clearTimeout(u)}}function m(n,r,s){let o=!1,i=(e)=>{if(o)return;o=!0,s?.(e)};return{async pending(e,t){return(await p(n,r,i,"pending-notifications",{lastReceivedId:e,sessionId:t}))?.messages??[]},async apply(e,t){return await p(n,r,i,"apply",{...e},t)??{text:"apply failed",knobs:{}}}}}export{m as createRpcClient,y as DEFAULT_RPC_TIMEOUT_MS};
|
package/dist/rpc/rpc-dir.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { tmpdir } from
|
|
1
|
+
import { tmpdir } from "node:os";
|
|
2
|
+
//#region src/rpc/rpc-dir.d.ts
|
|
2
3
|
export interface RpcDirResolution {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
dir: string;
|
|
5
|
+
secureDir: boolean;
|
|
6
|
+
sweepRoot?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function getRpcDir(projectDirectory: string): string;
|
|
8
9
|
export declare function resolveRpcDir(projectDirectory: string): Promise<RpcDirResolution>;
|
|
9
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
export { tmpdir };
|
package/dist/rpc/rpc-dir.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ka as a,La as b,Ma as c}from"../index-944gsj1s.js";import"../index-507jh8bv.js";export{a as tmpdir,c as resolveRpcDir,b as getRpcDir};
|
package/dist/sidebar-state.d.ts
CHANGED
|
@@ -1,86 +1,87 @@
|
|
|
1
|
+
//#region src/sidebar-state.d.ts
|
|
1
2
|
export interface QuotaWindow {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
usedPercent: number;
|
|
4
|
+
remainingPercent: number;
|
|
5
|
+
checkedAt?: number;
|
|
6
|
+
resetsAt?: string;
|
|
7
|
+
windowMinutes?: number;
|
|
7
8
|
}
|
|
8
9
|
export interface AccountQuota {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
checkedAt?: number;
|
|
11
|
+
primary?: QuotaWindow;
|
|
12
|
+
secondary?: QuotaWindow;
|
|
13
|
+
resetCreditsAvailable?: number;
|
|
13
14
|
}
|
|
14
15
|
export type QuotaWindowKey = 'primary' | 'secondary';
|
|
15
16
|
export declare function formatWindowLabel(windowMinutes: number | undefined, fallbackKey: QuotaWindowKey): string;
|
|
16
17
|
export interface PresentQuotaWindow {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
key: QuotaWindowKey;
|
|
19
|
+
label: string;
|
|
20
|
+
window: QuotaWindow;
|
|
21
|
+
windowMs: number | null;
|
|
21
22
|
}
|
|
22
23
|
export declare function getPresentQuotaWindows(quota: AccountQuota | null): PresentQuotaWindow[];
|
|
23
24
|
export interface SidebarAccountState {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
id: string;
|
|
26
|
+
label: string | undefined;
|
|
27
|
+
/** ChatGPT identity of the account this quota belongs to. */
|
|
28
|
+
accountId?: string;
|
|
29
|
+
quota: AccountQuota | null;
|
|
30
|
+
killed: boolean;
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
resetCredits?: number;
|
|
32
33
|
}
|
|
33
34
|
export interface ActiveRoutingEntry {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
activeId: string;
|
|
36
|
+
route: string;
|
|
37
|
+
updatedAt: number;
|
|
37
38
|
}
|
|
38
39
|
export type ActiveRoutingMap = Record<string, ActiveRoutingEntry>;
|
|
39
40
|
export interface StickyAssignment {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
accountId: string;
|
|
42
|
+
wireAccountId?: string;
|
|
43
|
+
assignedAt: number;
|
|
44
|
+
lastSeenAt: number;
|
|
45
|
+
inputBytes: number;
|
|
46
|
+
quotaCheckedAt?: number;
|
|
46
47
|
}
|
|
47
48
|
export type StickyAssignmentMap = Record<string, StickyAssignment>;
|
|
48
49
|
export interface StickyAssignmentChoice {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
accountId: string;
|
|
51
|
+
quotaCheckedAt?: number;
|
|
51
52
|
}
|
|
52
53
|
export interface ResolveStickyAssignmentInput {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
sessionId: string;
|
|
55
|
+
requestBytes: number;
|
|
56
|
+
now: number;
|
|
57
|
+
validPinnedAccountIds: readonly string[];
|
|
58
|
+
excludeAccountIds?: readonly string[];
|
|
59
|
+
quotaCheckedAtByAccount: Readonly<Record<string, number | undefined>>;
|
|
60
|
+
wireAccountIdByAccount?: Readonly<Record<string, string | undefined>>;
|
|
61
|
+
choose: (pendingBytes: ReadonlyMap<string, number>) => StickyAssignmentChoice | undefined;
|
|
61
62
|
}
|
|
62
63
|
export interface SidebarState {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
main: {
|
|
65
|
+
quota: AccountQuota | null;
|
|
66
|
+
/** ChatGPT identity of the main account this quota belongs to. */
|
|
67
|
+
mainAccountId?: string;
|
|
68
|
+
killed: boolean;
|
|
69
|
+
quotaBackedOff?: boolean;
|
|
70
|
+
quotaBackoffUntil?: number;
|
|
71
|
+
refreshBackedOff?: boolean;
|
|
72
|
+
refreshBackoffUntil?: number;
|
|
73
|
+
resetCredits?: number;
|
|
74
|
+
};
|
|
75
|
+
fallbacks: SidebarAccountState[];
|
|
76
|
+
/** @deprecated Compatibility field for readers that do not consume activeRouting. */
|
|
77
|
+
activeId: string | undefined;
|
|
78
|
+
/** Machine-global routing mode and compatibility value for older readers. */
|
|
79
|
+
route: string;
|
|
80
|
+
activeRouting?: ActiveRoutingMap;
|
|
81
|
+
stickyAssignments?: StickyAssignmentMap;
|
|
82
|
+
planType?: string;
|
|
83
|
+
credits?: number;
|
|
84
|
+
lastUpdated: number;
|
|
84
85
|
}
|
|
85
86
|
export declare const STICKY_ASSIGNMENT_MAX_AGE_MS: number;
|
|
86
87
|
export declare const STICKY_ASSIGNMENT_MAX_ENTRIES = 256;
|
|
@@ -101,25 +102,25 @@ export declare function getSidebarState(stateFile?: string): Promise<SidebarStat
|
|
|
101
102
|
export declare const ACTIVE_ROUTING_MAX_AGE_MS: number;
|
|
102
103
|
export declare const ACTIVE_ROUTING_MAX_ENTRIES = 128;
|
|
103
104
|
export type SidebarRoutingAccount = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
id: string;
|
|
106
|
+
enabled?: boolean;
|
|
107
|
+
killed?: boolean;
|
|
107
108
|
};
|
|
108
109
|
export declare function isUsableRoutingEntry(entry: ActiveRoutingEntry, accounts: readonly SidebarRoutingAccount[] | undefined, now?: number): boolean;
|
|
109
110
|
export declare function exhaustedQuotaResetAt(quota: AccountQuota | null | undefined, now?: number): {
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
resetsAt: string;
|
|
112
|
+
resetAtMs: number;
|
|
112
113
|
} | undefined;
|
|
113
114
|
export declare function isQuotaExhausted(quota: AccountQuota | null | undefined, now?: number): boolean;
|
|
114
115
|
export declare function resolveSessionStickyAccount(state: SidebarState, sessionId: string | undefined, now?: number): string | undefined;
|
|
115
116
|
export declare function resolveSessionSidebarRouting(state: SidebarState, sessionId?: string, now?: number): {
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
activeId: string;
|
|
118
|
+
route: string;
|
|
118
119
|
};
|
|
119
120
|
export declare function pruneActiveRouting(activeRouting: ActiveRoutingMap | undefined, accounts: readonly SidebarRoutingAccount[] | undefined, now?: number, removedSessionId?: string): ActiveRoutingMap | undefined;
|
|
120
121
|
export declare function pruneStickyAssignments(assignments: StickyAssignmentMap | undefined, validAccountIds: ReadonlySet<string> | undefined, now?: number, removedSessionHash?: string): StickyAssignmentMap | undefined;
|
|
121
122
|
interface SidebarMergeHooks {
|
|
122
|
-
|
|
123
|
+
beforeRecheck?: () => void | Promise<void>;
|
|
123
124
|
}
|
|
124
125
|
/**
|
|
125
126
|
* Write sidebar state to disk, serialized through a promise chain so
|
|
@@ -134,11 +135,11 @@ interface SidebarMergeHooks {
|
|
|
134
135
|
*/
|
|
135
136
|
export declare function setSidebarState(state: SidebarState, file?: string): Promise<void>;
|
|
136
137
|
export type SidebarMachineState = Pick<SidebarState, 'main' | 'fallbacks' | 'planType' | 'credits' | 'lastUpdated'> & {
|
|
137
|
-
|
|
138
|
+
route: string;
|
|
138
139
|
};
|
|
139
140
|
export declare function setSidebarMachineState(machineState: SidebarMachineState, file?: string, hooks?: SidebarMergeHooks): Promise<void>;
|
|
140
141
|
export declare function upsertSidebarActiveRouting(input: {
|
|
141
|
-
|
|
142
|
+
sessionId: string;
|
|
142
143
|
} & ActiveRoutingEntry, accounts: readonly SidebarRoutingAccount[] | undefined, file?: string, hooks?: SidebarMergeHooks): Promise<void>;
|
|
143
144
|
export declare function setSidebarLegacyRouting(input: ActiveRoutingEntry, file?: string): Promise<void>;
|
|
144
145
|
export declare function removeSidebarActiveRouting(sessionId: string, accounts: readonly SidebarRoutingAccount[] | undefined, file?: string, hooks?: SidebarMergeHooks): Promise<void>;
|
|
@@ -151,21 +152,21 @@ export declare function clearSidebarStickyAssignment(sessionId: string, file?: s
|
|
|
151
152
|
*/
|
|
152
153
|
export declare function drainSidebarWrites(): Promise<void>;
|
|
153
154
|
export declare function resolveActiveAccount(state: SidebarState): {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
id: string;
|
|
156
|
+
name: string;
|
|
157
|
+
quota: AccountQuota | null;
|
|
158
|
+
killed: boolean;
|
|
158
159
|
};
|
|
159
160
|
export declare function getCollapsedQuotaSummary(quota: AccountQuota | null): {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
primaryUsedPercent: number | null;
|
|
162
|
+
secondaryUsedPercent: number | null;
|
|
163
|
+
text: string | null;
|
|
163
164
|
};
|
|
164
165
|
export interface QuotaPacing {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
pacePercent: number;
|
|
167
|
+
deltaPercent: number;
|
|
168
|
+
state: 'deficit' | 'reserve' | 'on-pace';
|
|
169
|
+
runsOutAt: string | null;
|
|
169
170
|
}
|
|
170
171
|
export declare function computeQuotaPacing(window: QuotaWindow, windowMs: number, now: number): QuotaPacing | null;
|
|
171
|
-
|
|
172
|
+
//#endregion
|
package/dist/sidebar-state.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as y,B as z,C as A,D as B,E as C,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"./index-2xppkvkx.js";import"./index-nshbgkz1.js";import"./index-xyg86jgt.js";import"./index-507jh8bv.js";export{u as upsertSidebarActiveRouting,s as setSidebarState,t as setSidebarMachineState,v as setSidebarLegacyRouting,x as resolveSidebarStickyAssignment,o as resolveSessionStickyAccount,p as resolveSessionSidebarRouting,A as resolveActiveAccount,w as removeSidebarActiveRouting,r as pruneStickyAssignments,q as pruneActiveRouting,h as normalizeSidebarState,l as isUsableRoutingEntry,n as isQuotaExhausted,e as hashSidebarSessionId,f as getSidebarStateFile,i as getSidebarState,b as getPresentQuotaWindows,B as getCollapsedQuotaSummary,a as formatWindowLabel,m as exhaustedQuotaResetAt,z as drainSidebarWrites,C as computeQuotaPacing,y as clearSidebarStickyAssignment,d as STICKY_ASSIGNMENT_MAX_ENTRIES,c as STICKY_ASSIGNMENT_MAX_AGE_MS,g as DEFAULT_SIDEBAR_STATE,k as ACTIVE_ROUTING_MAX_ENTRIES,j as ACTIVE_ROUTING_MAX_AGE_MS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as U,b as V}from"./index-
|
|
1
|
+
import{a as U,b as V}from"./index-02h7g5f9.js";import{Ta as R}from"./index-507jh8bv.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a}from"./index-02h7g5f9.js";import"./index-507jh8bv.js";export default a();
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
+
//#region src/tui-preferences.d.ts
|
|
1
2
|
export declare const TUI_PREFS_FILE_ENV = "OPENCODE_TUI_PREFERENCES_FILE";
|
|
2
3
|
export declare function getTuiPreferencesFile(): string;
|
|
3
4
|
export declare function readTuiPreferencesFile(): Promise<Record<string, unknown>>;
|
|
4
5
|
export declare const PLUGIN_KEY = "openai-auth";
|
|
5
6
|
export declare const DEFAULT_SLOT_ORDER = 160;
|
|
6
7
|
export interface OpenaiAuthTuiPrefs {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
forceToTop: boolean;
|
|
9
|
+
order: number;
|
|
10
|
+
startCollapsed: boolean;
|
|
11
|
+
rememberCollapsed: boolean;
|
|
12
|
+
collapsed: boolean | null;
|
|
13
|
+
pollMs: number;
|
|
14
|
+
refreshDebounceMs: number;
|
|
15
|
+
header: {
|
|
16
|
+
label: string;
|
|
17
|
+
showVersion: boolean;
|
|
18
|
+
};
|
|
19
|
+
sections: {
|
|
20
|
+
quota: boolean;
|
|
21
|
+
fallbackAccounts: boolean;
|
|
22
|
+
routing: boolean;
|
|
23
|
+
health: boolean;
|
|
24
|
+
pacing: boolean;
|
|
25
|
+
};
|
|
26
|
+
appearance: {
|
|
27
|
+
barWidth: number;
|
|
28
|
+
barFilledChar: string;
|
|
29
|
+
barEmptyChar: string;
|
|
30
|
+
warnThreshold: number;
|
|
31
|
+
errorThreshold: number;
|
|
32
|
+
};
|
|
32
33
|
}
|
|
33
34
|
export type AppearancePrefs = OpenaiAuthTuiPrefs['appearance'];
|
|
34
35
|
export declare const DEFAULT_PREFS: OpenaiAuthTuiPrefs;
|
|
@@ -37,4 +38,4 @@ export declare function computeEffectiveOrder(root: Record<string, unknown>, plu
|
|
|
37
38
|
type JsonValue = string | number | boolean | null;
|
|
38
39
|
export declare function queueTuiPreferenceUpdate(pluginKey: string, path: string[], value: JsonValue): Promise<void>;
|
|
39
40
|
export declare function watchTuiPreferences(onChange: () => void): () => void;
|
|
40
|
-
|
|
41
|
+
//#endregion
|
package/dist/tui-preferences.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Sa as P,Ta as C,Va as _}from"./index-507jh8bv.js";var g=C((T,L)=>{(function(Q){if(typeof L==="object"&&typeof L.exports==="object"){var J=Q(_,T);if(J!==void 0)L.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"),Z=Q("./impl/edit"),G=Q("./impl/scanner"),$=Q("./impl/parser");J.createScanner=G.createScanner;var W;(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"})(W||(J.ScanError=W={}));var H;(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"})(H||(J.SyntaxKind=H={})),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 q;(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"})(q||(J.ParseErrorCode=q={}));function D(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=D;function m(z,U,j){return X.format(z,U,j)}J.format=m;function f(z,U,j,A){return Z.setProperty(z,U,j,A)}J.modify=f;function u(z,U){let j=U.slice(0).sort((I,Y)=>{let F=I.offset-Y.offset;if(F===0)return I.length-Y.length;return F}),A=z.length;for(let I=j.length-1;I>=0;I--){let Y=j[I];if(Y.offset+Y.length<=A)z=Z.applyEdit(z,Y);else throw Error("Overlapping edit");A=Y.offset}return z}J.applyEdits=u})});var M=P(g(),1);import{watch as K}from"node:fs";import{mkdir as c,readFile as O,rename as y,writeFile as S}from"node:fs/promises";import{homedir as E}from"node:os";import{basename as l,dirname as v,join as k}from"node:path";var p="OPENCODE_TUI_PREFERENCES_FILE",x="tui-preferences.jsonc";function w(){let Q=process.env[p];if(Q)return Q;let J=process.env.OPENCODE_CONFIG_DIR||k(process.env.XDG_CONFIG_HOME||k(E(),".config"),"opencode");return k(J,x)}function N(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}async function Xz(){try{let Q=await O(w(),"utf8"),J=[],X=M.parse(Q,J,{allowTrailingComma:!0});if(J.length>0)return{};return N(X)?X:{}}catch{return{}}}var i="openai-auth",s=160,b={forceToTop:!1,order:s,startCollapsed:!1,rememberCollapsed:!0,collapsed:null,pollMs:1500,refreshDebounceMs:200,header:{label:"OPENAI",showVersion:!0},sections:{quota:!0,fallbackAccounts:!0,routing:!0,health:!0,pacing:!0},appearance:{barWidth:10,barFilledChar:"█",barEmptyChar:"░",warnThreshold:50,errorThreshold:80}};function V(Q,J){return typeof Q==="boolean"?Q:J}function B(Q,J,X,Z){if(typeof Q!=="number"||!Number.isFinite(Q))return J;return Math.min(Math.max(Math.round(Q),X),Z)}function d(Q,J,X){if(typeof Q!=="string"||Q.length===0)return J;return Q.slice(0,X)}function h(Q,J){if(typeof Q!=="string")return J;return[...Q][0]??J}function Zz(Q){let J=Q[i];if(!N(J))return structuredClone(b);let X=b,Z=N(J.header)?J.header:{},G=N(J.sections)?J.sections:{},$=N(J.appearance)?J.appearance:{},W=B($.warnThreshold,X.appearance.warnThreshold,0,99),H=Math.max(B($.errorThreshold,X.appearance.errorThreshold,0,100),Math.min(W+1,100));return{forceToTop:V(J.forceToTop,X.forceToTop),order:B(J.order,X.order,-1e4,1e4),startCollapsed:V(J.startCollapsed,X.startCollapsed),rememberCollapsed:V(J.rememberCollapsed,X.rememberCollapsed),collapsed:typeof J.collapsed==="boolean"?J.collapsed:null,pollMs:B(J.pollMs,X.pollMs,500,30000),refreshDebounceMs:B(J.refreshDebounceMs,X.refreshDebounceMs,50,5000),header:{label:d(Z.label,X.header.label,20),showVersion:V(Z.showVersion,X.header.showVersion)},sections:{quota:V(G.quota,X.sections.quota),fallbackAccounts:V(G.fallbackAccounts,X.sections.fallbackAccounts),routing:V(G.routing,X.sections.routing),health:V(G.health,X.sections.health),pacing:V(G.pacing,X.sections.pacing)},appearance:{barWidth:B($.barWidth,X.appearance.barWidth,4,40),barFilledChar:h($.barFilledChar,X.appearance.barFilledChar),barEmptyChar:h($.barEmptyChar,X.appearance.barEmptyChar),warnThreshold:W,errorThreshold:H}}}var n=-1e5;function $z(Q,J,X){let Z=Q[J];if(!N(Z))return X;if(Z.forceToTop===!0)return n+Object.keys(Q).indexOf(J);return B(Z.order,X,-1e4,1e4)}var t=`// 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.
|
package/dist/tui.d.ts
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { r as CommandModalName, t as ApplyRequest } from "./protocol-Cv9ZmU0p.js";
|
|
2
|
+
import { AccountQuota, QuotaPacing, QuotaWindow, SidebarState } from "./sidebar-state.js";
|
|
3
|
+
import { TuiPluginModule } from "@opencode-ai/plugin/tui";
|
|
4
|
+
//#region src/tui.d.ts
|
|
5
5
|
export declare function buildApplyRequest(command: CommandModalName, arguments_: string, sessionId?: string): ApplyRequest;
|
|
6
6
|
type Tone = 'ok' | 'warn' | 'err' | 'muted' | 'accent' | 'text';
|
|
7
7
|
export declare function formatResetIn(resetsAt: string | undefined): string;
|
|
8
8
|
export interface QuotaDisplayRow {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
key: 'primary' | 'secondary';
|
|
10
|
+
label: string;
|
|
11
|
+
window: QuotaWindow;
|
|
12
|
+
pacing: QuotaPacing | null;
|
|
13
13
|
}
|
|
14
14
|
export declare function buildQuotaRowsForDisplay(quota: AccountQuota | null, now: number, pacingEnabled: boolean): QuotaDisplayRow[];
|
|
15
15
|
export declare function isQuotaLoaded(quota: AccountQuota | null): boolean;
|
|
16
16
|
export declare function getQuotaMetadataRows(state: SidebarState): Array<{
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
19
|
}>;
|
|
20
20
|
export declare function getAccountMetadataRows(resetCredits: number | undefined): Array<{
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
23
|
}>;
|
|
24
24
|
export declare function readStateFromFile(): Promise<SidebarState>;
|
|
25
25
|
export declare function resolveQuotaDialogActiveId(state: SidebarState, sessionId: string | undefined, now?: number): string | undefined;
|
|
26
26
|
export interface RoutingDisplayRow {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
tone: Tone;
|
|
30
30
|
}
|
|
31
31
|
export declare function buildRoutingRowsForDisplay(state: SidebarState, sessionId: string | undefined, now?: number): RoutingDisplayRow[];
|
|
32
32
|
declare const plugin: TuiPluginModule & {
|
|
33
|
-
|
|
33
|
+
id: string;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
//#endregion
|
|
36
|
+
export { plugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-openai-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
},
|
|
11
11
|
"main": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"bin": {
|
|
14
|
-
"openai-auth": "./dist/cli.js"
|
|
15
|
-
},
|
|
16
13
|
"exports": {
|
|
17
14
|
".": {
|
|
18
15
|
"import": "./dist/index.js",
|
|
@@ -36,22 +33,15 @@
|
|
|
36
33
|
},
|
|
37
34
|
"files": [
|
|
38
35
|
"dist",
|
|
39
|
-
"src/tui.
|
|
40
|
-
"src/tui",
|
|
36
|
+
"src/tui/entry.mjs",
|
|
41
37
|
"src/tui-compiled",
|
|
42
|
-
"src/sidebar-state.ts",
|
|
43
|
-
"src/tui-preferences.ts",
|
|
44
|
-
"src/logger.ts",
|
|
45
|
-
"src/core/account-paths.ts",
|
|
46
|
-
"src/core/refresh-file-lock.ts",
|
|
47
|
-
"src/util",
|
|
48
|
-
"src/rpc",
|
|
49
38
|
"README.md",
|
|
50
39
|
"LICENSE"
|
|
51
40
|
],
|
|
52
41
|
"scripts": {
|
|
53
|
-
"build": "rm -rf dist && bun build src/index.ts src/
|
|
42
|
+
"build": "rm -rf dist && bun build src/index.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 && bun run build:types && bun run build:tui",
|
|
54
43
|
"build:tui": "bun scripts/build-tui.ts",
|
|
44
|
+
"build:types": "cd ../core && bun run build && cd ../opencode && tsdown --config tsdown.config.ts",
|
|
55
45
|
"build:dev": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
56
46
|
"test": "bun test src/tests",
|
|
57
47
|
"typecheck": "tsc",
|
|
@@ -61,10 +51,13 @@
|
|
|
61
51
|
"peerDependencies": {
|
|
62
52
|
"@opencode-ai/plugin": "*"
|
|
63
53
|
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@cortexkit/openai-auth-core": "workspace:*"
|
|
56
|
+
},
|
|
64
57
|
"dependencies": {
|
|
65
|
-
"@opentui/core": ">=0.5.
|
|
66
|
-
"@opentui/solid": ">=0.5.
|
|
67
|
-
"ai": "^7.0.
|
|
58
|
+
"@opentui/core": ">=0.5.11",
|
|
59
|
+
"@opentui/solid": ">=0.5.11",
|
|
60
|
+
"ai": "^7.0.99",
|
|
68
61
|
"jsonc-parser": "^3.3.1",
|
|
69
62
|
"solid-js": "1.9.12"
|
|
70
63
|
}
|
package/src/tui/entry.mjs
CHANGED
|
@@ -22,12 +22,12 @@ try {
|
|
|
22
22
|
}
|
|
23
23
|
// Older hosts and bare Bun do not provide the virtual registry. Their source
|
|
24
24
|
// loader still applies the Solid transform, so retain the raw TSX fallback.
|
|
25
|
-
mod = await import('../tui.tsx')
|
|
25
|
+
mod = await import('../tui-compiled/raw/tui.tsx')
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (!mod) {
|
|
29
29
|
try {
|
|
30
|
-
mod = await import('../tui-compiled/tui.tsx')
|
|
30
|
+
mod = await import('../tui-compiled/runtime/tui.tsx')
|
|
31
31
|
} catch (error) {
|
|
32
32
|
console.error('OpenAI Auth compiled TUI failed to load', error)
|
|
33
33
|
throw error
|