@cortexkit/opencode-openai-auth 1.21.0 → 1.22.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 (42) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/{index-qx3zz6dw.js → index-0wh22s62.js} +1 -1
  3. package/dist/{index-zd0hham5.js → index-1k8a281v.js} +2 -2
  4. package/dist/{index-vhn0n16s.js → index-677jqrrt.js} +1 -1
  5. package/dist/{index-ewbggf3b.js → index-67twdyyz.js} +11 -11
  6. package/dist/{index-14m8qtpx.js → index-6afhs2jq.js} +2 -2
  7. package/dist/{index-1arphj0y.js → index-8bt81cys.js} +2 -2
  8. package/dist/index-9tg5xx9a.js +2 -0
  9. package/dist/{index-h41zc747.js → index-b3bgqy7r.js} +2 -2
  10. package/dist/index-dw1nh7dk.js +60 -0
  11. package/dist/{index-4vgtvqfc.js → index-mepr345k.js} +1 -1
  12. package/dist/index-ney54jhs.js +79 -0
  13. package/dist/{index-8kg9h2zj.js → index-vaf4mqd1.js} +2 -2
  14. package/dist/index-w6kars9d.js +1 -0
  15. package/dist/{index-4xa80px1.js → index-xbhtpa9s.js} +2 -2
  16. package/dist/index.d.ts +4 -25
  17. package/dist/index.js +1 -1
  18. package/dist/map-D5PHhv4z.d.ts +72 -0
  19. package/dist/rpc/port-file.js +1 -1
  20. package/dist/rpc/protocol.js +1 -1
  21. package/dist/rpc/rpc-client.js +1 -1
  22. package/dist/rpc/rpc-dir.js +1 -1
  23. package/dist/{codex-request-NjUd_A0U.d.ts → runtime-layout-DdxprfY1.d.ts} +664 -643
  24. package/dist/{sidebar-state-CrRiE9hw.d.ts → sidebar-state--OTpRzFd.d.ts} +2 -72
  25. package/dist/sidebar-state.d.ts +1 -1
  26. package/dist/sidebar-state.js +1 -1
  27. package/dist/{token-01hgthyy.js → token-92yc9q7w.js} +1 -1
  28. package/dist/token-util-g8e70a6j.js +1 -0
  29. package/dist/tui-preferences.js +1 -1
  30. package/dist/tui.d.ts +1 -1
  31. package/dist/v2/server.d.ts +10 -3
  32. package/dist/v2/server.js +4 -4
  33. package/package.json +1 -1
  34. package/src/tui-compiled/raw/logger.js +5 -22
  35. package/src/tui-compiled/raw/shared/d669d72c40e9e116-logger.js +30 -1
  36. package/src/tui-compiled/runtime/logger.js +5 -22
  37. package/src/tui-compiled/runtime/shared/d669d72c40e9e116-logger.js +30 -1
  38. package/dist/index-60v2qzqm.js +0 -75
  39. package/dist/index-cqmzvf2k.js +0 -1
  40. package/dist/index-ksfxd8p5.js +0 -64
  41. package/dist/index-rvphtptz.js +0 -2
  42. package/dist/token-util-29yt43da.js +0 -1
@@ -1,3 +1,4 @@
1
+ import { n as QuotaCredits, t as QuotaCounter } from "./map-D5PHhv4z.js";
1
2
  interface ChannelLogger {
2
3
  error(message: string, data?: unknown): void;
3
4
  warn(message: string, data?: unknown): void;
@@ -6,77 +7,6 @@ interface ChannelLogger {
6
7
  trace(message: string, data?: unknown): void;
7
8
  }
8
9
  declare function createLogger(channel: string): ChannelLogger;
9
- interface QuotaReadingEntry {
10
- scope: string;
11
- label: string;
12
- kind: 'reading';
13
- checkedAt: number;
14
- usedPercent: number;
15
- /** ISO timestamp at which the window resets, as the provider reported it. */
16
- resetsAt?: string;
17
- /** Window length in minutes, when the provider reported one. */
18
- windowMinutes?: number;
19
- }
20
- interface QuotaRetiredEntry {
21
- scope: string;
22
- label: string;
23
- kind: 'retired';
24
- retiredAt: number;
25
- }
26
- interface QuotaAbsentEntry {
27
- scope: string;
28
- label: string;
29
- kind: 'absent';
30
- checkedAt: number;
31
- }
32
- type QuotaEntry = QuotaReadingEntry | QuotaRetiredEntry | QuotaAbsentEntry;
33
- interface CreditBudgetReading {
34
- kind: 'reading';
35
- checkedAt: number;
36
- /** The provider's own verdict that the budget is spent. */
37
- reached: boolean;
38
- remainingPercent?: number;
39
- usedPercent?: number;
40
- resetsAt?: string;
41
- limit?: number;
42
- used?: number;
43
- remaining?: number;
44
- unit?: string;
45
- }
46
- interface CreditBudgetCleared {
47
- kind: 'cleared';
48
- checkedAt: number;
49
- }
50
- type CreditBudgetEntry = CreditBudgetReading | CreditBudgetCleared;
51
- interface QuotaCounter {
52
- value: number;
53
- checkedAt: number;
54
- }
55
- /**
56
- * Prepaid credits a provider account holds beside its rate-limit windows (for
57
- * example a ChatGPT workspace's credits, which keep requests working after a
58
- * window is used up). This is a state, not a count or the spend budget: the
59
- * account has credits or not, they may be unlimited, and the provider may
60
- * report a balance. It carries its own observation time.
61
- */
62
- interface QuotaCredits {
63
- hasCredits: boolean;
64
- unlimited: boolean;
65
- /** The balance the provider reported, when it reported one. */
66
- balance?: number;
67
- /** The provider's verdict that the overage allowance is used up. */
68
- overageLimitReached?: boolean;
69
- checkedAt: number;
70
- }
71
- interface QuotaMap {
72
- limits: QuotaEntry[];
73
- /** Absent means no observation has reported on the budget yet. */
74
- budget?: CreditBudgetEntry;
75
- /** Provider-named counts, each with its own observation time. */
76
- counters?: Record<string, QuotaCounter>;
77
- /** Absent means no observation has reported on prepaid credits yet. */
78
- credits?: QuotaCredits;
79
- }
80
10
  interface ProjectedLimit {
81
11
  scope: string;
82
12
  label: string;
@@ -539,4 +469,4 @@ interface QuotaPacing {
539
469
  runsOutAt: string | null;
540
470
  }
541
471
  declare function computeQuotaPacing(window: QuotaWindow, windowMs: number, now: number): QuotaPacing | null;
542
- export { planSidebarStickyAssignment as $, StickyPinOverlayEntry as A, exhaustedQuotaResetAt as B, SidebarStateCache as C, StickyAssignmentMap as D, StickyAssignmentChoice as E, computeQuotaPacing as F, getPresentQuotaWindows as G, formatWindowLabel as H, createSidebarBookkeepingQueue as I, hashSidebarSessionId as J, getSidebarState as K, createSidebarStateCache as L, accountServesOnCredits as M, applyStickyPinOverlay as N, StickyAssignmentPlan as O, clearSidebarStickyAssignment as P, persistSidebarStickyAssignment as Q, displayWidth as R, SidebarState as S, StickyAssignment as T, getCollapsedAccountLines as U, fitCollapsedLabel as V, getCollapsedQuotaSummary as W, isUsableRoutingEntry as X, isQuotaExhausted as Y, normalizeSidebarState as Z, SidebarAccountState as _, ActiveRoutingEntry as a, resolveActiveAccount as at, SidebarRoutingAccount as b, DEFAULT_SIDEBAR_STATE as c, resolveSidebarStickyAssignment as ct, QuotaPacing as d, setSidebarState as dt, planSidebarStickyAssignmentFromSnapshot as et, QuotaWindow as f, settleWithinBudget as ft, STICKY_ASSIGNMENT_MAX_ENTRIES as g, QuotaMap as gt, STICKY_ASSIGNMENT_MAX_AGE_MS as h, upsertSidebarActiveRouting as ht, AccountQuota as i, removeSidebarActiveRouting as it, accountCreditsText as j, StickyPinOverlay as k, HOT_PATH_READ_BUDGET_MS as l, setSidebarLegacyRouting as lt, ResolveStickyAssignmentInput as m, spendControlExhaustedResetAt as mt, ACTIVE_ROUTING_MAX_ENTRIES as n, pruneStickyAssignments as nt, ActiveRoutingMap as o, resolveSessionSidebarRouting as ot, QuotaWindowKey as p, sidebarQuotaProjection as pt, getSidebarStateFile as q, AccountCredits as r, rememberStickyPin as rt, CollapsedAccountLine as s, resolveSessionStickyAccount as st, ACTIVE_ROUTING_MAX_AGE_MS as t, pruneActiveRouting as tt, PresentQuotaWindow as u, setSidebarMachineState as ut, SidebarBookkeepingQueue as v, SpendControlReading as w, SidebarSnapshot as x, SidebarMachineState as y, drainSidebarWrites as z };
472
+ export { planSidebarStickyAssignment as $, StickyPinOverlayEntry as A, exhaustedQuotaResetAt as B, SidebarStateCache as C, StickyAssignmentMap as D, StickyAssignmentChoice as E, computeQuotaPacing as F, getPresentQuotaWindows as G, formatWindowLabel as H, createSidebarBookkeepingQueue as I, hashSidebarSessionId as J, getSidebarState as K, createSidebarStateCache as L, accountServesOnCredits as M, applyStickyPinOverlay as N, StickyAssignmentPlan as O, clearSidebarStickyAssignment as P, persistSidebarStickyAssignment as Q, displayWidth as R, SidebarState as S, StickyAssignment as T, getCollapsedAccountLines as U, fitCollapsedLabel as V, getCollapsedQuotaSummary as W, isUsableRoutingEntry as X, isQuotaExhausted as Y, normalizeSidebarState as Z, SidebarAccountState as _, ActiveRoutingEntry as a, resolveActiveAccount as at, SidebarRoutingAccount as b, DEFAULT_SIDEBAR_STATE as c, resolveSidebarStickyAssignment as ct, QuotaPacing as d, setSidebarState as dt, planSidebarStickyAssignmentFromSnapshot as et, QuotaWindow as f, settleWithinBudget as ft, STICKY_ASSIGNMENT_MAX_ENTRIES as g, STICKY_ASSIGNMENT_MAX_AGE_MS as h, upsertSidebarActiveRouting as ht, AccountQuota as i, removeSidebarActiveRouting as it, accountCreditsText as j, StickyPinOverlay as k, HOT_PATH_READ_BUDGET_MS as l, setSidebarLegacyRouting as lt, ResolveStickyAssignmentInput as m, spendControlExhaustedResetAt as mt, ACTIVE_ROUTING_MAX_ENTRIES as n, pruneStickyAssignments as nt, ActiveRoutingMap as o, resolveSessionSidebarRouting as ot, QuotaWindowKey as p, sidebarQuotaProjection as pt, getSidebarStateFile as q, AccountCredits as r, rememberStickyPin as rt, CollapsedAccountLine as s, resolveSessionStickyAccount as st, ACTIVE_ROUTING_MAX_AGE_MS as t, pruneActiveRouting as tt, PresentQuotaWindow as u, setSidebarMachineState as ut, SidebarBookkeepingQueue as v, SpendControlReading as w, SidebarSnapshot as x, SidebarMachineState as y, drainSidebarWrites as z };
@@ -1,2 +1,2 @@
1
- import { $ as planSidebarStickyAssignment, A as StickyPinOverlayEntry, B as exhaustedQuotaResetAt, C as SidebarStateCache, D as StickyAssignmentMap, E as StickyAssignmentChoice, F as computeQuotaPacing, G as getPresentQuotaWindows, H as formatWindowLabel, I as createSidebarBookkeepingQueue, J as hashSidebarSessionId, K as getSidebarState, L as createSidebarStateCache, M as accountServesOnCredits, N as applyStickyPinOverlay, O as StickyAssignmentPlan, P as clearSidebarStickyAssignment, Q as persistSidebarStickyAssignment, R as displayWidth, S as SidebarState, T as StickyAssignment, U as getCollapsedAccountLines, V as fitCollapsedLabel, W as getCollapsedQuotaSummary, X as isUsableRoutingEntry, Y as isQuotaExhausted, Z as normalizeSidebarState, _ as SidebarAccountState, a as ActiveRoutingEntry, at as resolveActiveAccount, b as SidebarRoutingAccount, c as DEFAULT_SIDEBAR_STATE, ct as resolveSidebarStickyAssignment, d as QuotaPacing, dt as setSidebarState, et as planSidebarStickyAssignmentFromSnapshot, f as QuotaWindow, ft as settleWithinBudget, g as STICKY_ASSIGNMENT_MAX_ENTRIES, h as STICKY_ASSIGNMENT_MAX_AGE_MS, ht as upsertSidebarActiveRouting, i as AccountQuota, it as removeSidebarActiveRouting, j as accountCreditsText, k as StickyPinOverlay, l as HOT_PATH_READ_BUDGET_MS, lt as setSidebarLegacyRouting, m as ResolveStickyAssignmentInput, mt as spendControlExhaustedResetAt, n as ACTIVE_ROUTING_MAX_ENTRIES, nt as pruneStickyAssignments, o as ActiveRoutingMap, ot as resolveSessionSidebarRouting, p as QuotaWindowKey, pt as sidebarQuotaProjection, q as getSidebarStateFile, r as AccountCredits, rt as rememberStickyPin, s as CollapsedAccountLine, st as resolveSessionStickyAccount, t as ACTIVE_ROUTING_MAX_AGE_MS, tt as pruneActiveRouting, u as PresentQuotaWindow, ut as setSidebarMachineState, v as SidebarBookkeepingQueue, w as SpendControlReading, x as SidebarSnapshot, y as SidebarMachineState, z as drainSidebarWrites } from "./sidebar-state-CrRiE9hw.js";
1
+ import { $ as planSidebarStickyAssignment, A as StickyPinOverlayEntry, B as exhaustedQuotaResetAt, C as SidebarStateCache, D as StickyAssignmentMap, E as StickyAssignmentChoice, F as computeQuotaPacing, G as getPresentQuotaWindows, H as formatWindowLabel, I as createSidebarBookkeepingQueue, J as hashSidebarSessionId, K as getSidebarState, L as createSidebarStateCache, M as accountServesOnCredits, N as applyStickyPinOverlay, O as StickyAssignmentPlan, P as clearSidebarStickyAssignment, Q as persistSidebarStickyAssignment, R as displayWidth, S as SidebarState, T as StickyAssignment, U as getCollapsedAccountLines, V as fitCollapsedLabel, W as getCollapsedQuotaSummary, X as isUsableRoutingEntry, Y as isQuotaExhausted, Z as normalizeSidebarState, _ as SidebarAccountState, a as ActiveRoutingEntry, at as resolveActiveAccount, b as SidebarRoutingAccount, c as DEFAULT_SIDEBAR_STATE, ct as resolveSidebarStickyAssignment, d as QuotaPacing, dt as setSidebarState, et as planSidebarStickyAssignmentFromSnapshot, f as QuotaWindow, ft as settleWithinBudget, g as STICKY_ASSIGNMENT_MAX_ENTRIES, h as STICKY_ASSIGNMENT_MAX_AGE_MS, ht as upsertSidebarActiveRouting, i as AccountQuota, it as removeSidebarActiveRouting, j as accountCreditsText, k as StickyPinOverlay, l as HOT_PATH_READ_BUDGET_MS, lt as setSidebarLegacyRouting, m as ResolveStickyAssignmentInput, mt as spendControlExhaustedResetAt, n as ACTIVE_ROUTING_MAX_ENTRIES, nt as pruneStickyAssignments, o as ActiveRoutingMap, ot as resolveSessionSidebarRouting, p as QuotaWindowKey, pt as sidebarQuotaProjection, q as getSidebarStateFile, r as AccountCredits, rt as rememberStickyPin, s as CollapsedAccountLine, st as resolveSessionStickyAccount, t as ACTIVE_ROUTING_MAX_AGE_MS, tt as pruneActiveRouting, u as PresentQuotaWindow, ut as setSidebarMachineState, v as SidebarBookkeepingQueue, w as SpendControlReading, x as SidebarSnapshot, y as SidebarMachineState, z as drainSidebarWrites } from "./sidebar-state--OTpRzFd.js";
2
2
  export { ACTIVE_ROUTING_MAX_AGE_MS, ACTIVE_ROUTING_MAX_ENTRIES, AccountCredits, AccountQuota, ActiveRoutingEntry, ActiveRoutingMap, CollapsedAccountLine, DEFAULT_SIDEBAR_STATE, HOT_PATH_READ_BUDGET_MS, PresentQuotaWindow, QuotaPacing, QuotaWindow, QuotaWindowKey, ResolveStickyAssignmentInput, STICKY_ASSIGNMENT_MAX_AGE_MS, STICKY_ASSIGNMENT_MAX_ENTRIES, SidebarAccountState, SidebarBookkeepingQueue, SidebarMachineState, SidebarRoutingAccount, SidebarSnapshot, SidebarState, SidebarStateCache, SpendControlReading, StickyAssignment, StickyAssignmentChoice, StickyAssignmentMap, StickyAssignmentPlan, StickyPinOverlay, StickyPinOverlayEntry, accountCreditsText, accountServesOnCredits, applyStickyPinOverlay, clearSidebarStickyAssignment, computeQuotaPacing, createSidebarBookkeepingQueue, createSidebarStateCache, displayWidth, drainSidebarWrites, exhaustedQuotaResetAt, fitCollapsedLabel, formatWindowLabel, getCollapsedAccountLines, getCollapsedQuotaSummary, getPresentQuotaWindows, getSidebarState, getSidebarStateFile, hashSidebarSessionId, isQuotaExhausted, isUsableRoutingEntry, normalizeSidebarState, persistSidebarStickyAssignment, planSidebarStickyAssignment, planSidebarStickyAssignmentFromSnapshot, pruneActiveRouting, pruneStickyAssignments, rememberStickyPin, removeSidebarActiveRouting, resolveActiveAccount, resolveSessionSidebarRouting, resolveSessionStickyAccount, resolveSidebarStickyAssignment, setSidebarLegacyRouting, setSidebarMachineState, setSidebarState, settleWithinBudget, sidebarQuotaProjection, spendControlExhaustedResetAt, upsertSidebarActiveRouting };
@@ -1 +1 @@
1
- import{$c as o,Ad as P,Bd as Q,Cd as R,Dd as S,Ed as T,Nc as a,Oc as b,Pc as c,Qc as d,Rc as e,Sc as f,Tc as g,Uc as h,Vc as i,Wc as j,Xc as k,Yc as l,Zc as m,_c as n,ad as p,bd as q,cd as r,dd as s,ed as t,fd as u,gd as v,hd as w,id as x,jd as y,kd as z,ld as A,md as B,nd as C,od as D,pd as E,qd as F,rd as G,sd as H,td as I,ud as J,vd as K,wd as L,xd as M,yd as N,zd as O}from"./index-4xa80px1.js";import"./index-ewbggf3b.js";import"./index-14m8qtpx.js";import"./index-cqmzvf2k.js";import"./index-8kg9h2zj.js";import"./index-h41zc747.js";import"./index-rvphtptz.js";export{y as upsertSidebarActiveRouting,p as spendControlExhaustedResetAt,O as sidebarQuotaProjection,I as settleWithinBudget,w as setSidebarState,x as setSidebarMachineState,z as setSidebarLegacyRouting,e as setLegacySidebarStateFileForTest,C as resolveSidebarStickyAssignment,s as resolveSessionStickyAccount,t as resolveSessionSidebarRouting,N as resolveActiveAccount,A as removeSidebarActiveRouting,K as rememberStickyPin,v as pruneStickyAssignments,u as pruneActiveRouting,D as planSidebarStickyAssignmentFromSnapshot,B as planSidebarStickyAssignment,E as persistSidebarStickyAssignment,k as normalizeSidebarState,o as isUsableRoutingEntry,r as isQuotaExhausted,h as hashSidebarSessionId,i as getSidebarStateFile,l as getSidebarState,d as getPresentQuotaWindows,P as getCollapsedQuotaSummary,Q as getCollapsedAccountLines,c as formatWindowLabel,S as fitCollapsedLabel,q as exhaustedQuotaResetAt,G as drainSidebarWrites,R as displayWidth,J as createSidebarStateCache,M as createSidebarBookkeepingQueue,T as computeQuotaPacing,F as clearSidebarStickyAssignment,L as applyStickyPinOverlay,b as accountServesOnCredits,a as accountCreditsText,g as STICKY_ASSIGNMENT_MAX_ENTRIES,f as STICKY_ASSIGNMENT_MAX_AGE_MS,H as HOT_PATH_READ_BUDGET_MS,j as DEFAULT_SIDEBAR_STATE,n as ACTIVE_ROUTING_MAX_ENTRIES,m as ACTIVE_ROUTING_MAX_AGE_MS};
1
+ import{$d as S,Ad as r,Bd as s,Cd as t,Dd as u,Ed as v,Fd as w,Gd as x,Hd as y,Id as z,Jd as A,Kd as B,Ld as C,Md as D,Nd as E,Od as F,Pd as G,Qd as H,Rd as I,Sd as J,Td as K,Ud as L,Vd as M,Wd as N,Xd as O,Yd as P,Zd as Q,_d as R,ae as T,jd as a,kd as b,ld as c,md as d,nd as e,od as f,pd as g,qd as h,rd as i,sd as j,td as k,ud as l,vd as m,wd as n,xd as o,yd as p,zd as q}from"./index-xbhtpa9s.js";import"./index-67twdyyz.js";import"./index-6afhs2jq.js";import"./index-w6kars9d.js";import"./index-vaf4mqd1.js";import"./index-b3bgqy7r.js";import"./index-9tg5xx9a.js";export{y as upsertSidebarActiveRouting,p as spendControlExhaustedResetAt,O as sidebarQuotaProjection,I as settleWithinBudget,w as setSidebarState,x as setSidebarMachineState,z as setSidebarLegacyRouting,e as setLegacySidebarStateFileForTest,C as resolveSidebarStickyAssignment,s as resolveSessionStickyAccount,t as resolveSessionSidebarRouting,N as resolveActiveAccount,A as removeSidebarActiveRouting,K as rememberStickyPin,v as pruneStickyAssignments,u as pruneActiveRouting,D as planSidebarStickyAssignmentFromSnapshot,B as planSidebarStickyAssignment,E as persistSidebarStickyAssignment,k as normalizeSidebarState,o as isUsableRoutingEntry,r as isQuotaExhausted,h as hashSidebarSessionId,i as getSidebarStateFile,l as getSidebarState,d as getPresentQuotaWindows,P as getCollapsedQuotaSummary,Q as getCollapsedAccountLines,c as formatWindowLabel,S as fitCollapsedLabel,q as exhaustedQuotaResetAt,G as drainSidebarWrites,R as displayWidth,J as createSidebarStateCache,M as createSidebarBookkeepingQueue,T as computeQuotaPacing,F as clearSidebarStickyAssignment,L as applyStickyPinOverlay,b as accountServesOnCredits,a as accountCreditsText,g as STICKY_ASSIGNMENT_MAX_ENTRIES,f as STICKY_ASSIGNMENT_MAX_AGE_MS,H as HOT_PATH_READ_BUDGET_MS,j as DEFAULT_SIDEBAR_STATE,n as ACTIVE_ROUTING_MAX_ENTRIES,m as ACTIVE_ROUTING_MAX_AGE_MS};
@@ -1 +1 @@
1
- import{a as U,b as V}from"./index-qx3zz6dw.js";import{gh as R}from"./index-rvphtptz.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();
1
+ import{a as U,b as V}from"./index-0wh22s62.js";import{Gh as R}from"./index-9tg5xx9a.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-0wh22s62.js";import"./index-9tg5xx9a.js";export default a();
@@ -1,4 +1,4 @@
1
- import{cg as _,kg as R,mg as I,ng as x}from"./index-14m8qtpx.js";import"./index-8kg9h2zj.js";import{Sg as N,Tg as L,Zg as j}from"./index-h41zc747.js";import"./index-rvphtptz.js";import{mkdir as T,writeFile as h}from"node:fs/promises";import{homedir as y}from"node:os";import{dirname as f,join as C}from"node:path";import{applyEdits as g,modify as k,parse as b}from"jsonc-parser";function E(z){return z!==null&&typeof z==="object"&&!Array.isArray(z)}async function S(z){try{let q=[],H=b(await j(z,N),q,{allowTrailingComma:!0});return q.length===0&&E(H)?H:{}}catch(q){if(q instanceof L&&q.code!=="ENOENT")throw q;return{}}}var w=`// Shared preferences for TUI plugins.
1
+ import{Ag as _,Ig as R,Kg as I,Lg as x}from"./index-6afhs2jq.js";import"./index-vaf4mqd1.js";import{qh as N,rh as L,xh as j}from"./index-b3bgqy7r.js";import"./index-9tg5xx9a.js";import{mkdir as T,writeFile as h}from"node:fs/promises";import{homedir as y}from"node:os";import{dirname as f,join as C}from"node:path";import{applyEdits as g,modify as k,parse as b}from"jsonc-parser";function E(z){return z!==null&&typeof z==="object"&&!Array.isArray(z)}async function S(z){try{let q=[],H=b(await j(z,N),q,{allowTrailingComma:!0});return q.length===0&&E(H)?H:{}}catch(q){if(q instanceof L&&q.code!=="ENOENT")throw q;return{}}}var w=`// Shared preferences for TUI plugins.
2
2
  // Plugins update individual keys in place and preserve comments.
3
3
  {}
4
4
  `;function A(z){let{file:q,pluginKey:H,beforeCommit:Q}=z,X={...I.preferences,timeoutMs:z.timeoutMs??I.preferences.timeoutMs},$=Promise.resolve();async function V(J,D){await R(q,X,async(U)=>{let B;try{B=await j(q,N)}catch(M){if(M.code!=="ENOENT")throw M;B=""}if(B.trim()==="")B=w;let W=g(B,k(B,[H,...J],D,{formattingOptions:{insertSpaces:!0,tabSize:2}}));await _(q,W,{serialize:(M)=>String(M),beforeRename:async()=>{await Q?.(),await U.assertOwned()}})})}return{queueTuiPreferenceUpdate(J,D){let U=[...J],B=structuredClone(D),W=$.then(()=>V(U,B));return $=W.catch(()=>{}),W}}}var p="OPENCODE_TUI_PREFERENCES_FILE",c="tui-preferences.jsonc";function K(){let z=process.env[p];if(z)return z;let q=process.env.OPENCODE_CONFIG_DIR||C(process.env.XDG_CONFIG_HOME||C(y(),".config"),"opencode");return C(q,c)}function Y(z){return typeof z==="object"&&z!==null&&!Array.isArray(z)}function Jq(){return S(K())}var v="openai-auth",d=160,m={forceToTop:!1,order:d,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 Z(z,q){return typeof z==="boolean"?z:q}function G(z,q,H,Q){if(typeof z!=="number"||!Number.isFinite(z))return q;return Math.min(Math.max(Math.round(z),H),Q)}function u(z,q,H){if(typeof z!=="string"||z.length===0)return q;return z.slice(0,H)}function P(z,q){if(typeof z!=="string")return q;return[...z][0]??q}function Yq(z){let q=z[v];if(!Y(q))return structuredClone(m);let H=m,Q=Y(q.header)?q.header:{},X=Y(q.sections)?q.sections:{},$=Y(q.appearance)?q.appearance:{},V=G($.warnThreshold,H.appearance.warnThreshold,0,99),J=Math.max(G($.errorThreshold,H.appearance.errorThreshold,0,100),Math.min(V+1,100));return{forceToTop:Z(q.forceToTop,H.forceToTop),order:G(q.order,H.order,-1e4,1e4),startCollapsed:Z(q.startCollapsed,H.startCollapsed),rememberCollapsed:Z(q.rememberCollapsed,H.rememberCollapsed),collapsed:typeof q.collapsed==="boolean"?q.collapsed:null,pollMs:G(q.pollMs,H.pollMs,500,30000),refreshDebounceMs:G(q.refreshDebounceMs,H.refreshDebounceMs,50,5000),header:{label:u(Q.label,H.header.label,20),showVersion:Z(Q.showVersion,H.header.showVersion)},sections:{quota:Z(X.quota,H.sections.quota),fallbackAccounts:Z(X.fallbackAccounts,H.sections.fallbackAccounts),routing:Z(X.routing,H.sections.routing),health:Z(X.health,H.sections.health),pacing:Z(X.pacing,H.sections.pacing)},appearance:{barWidth:G($.barWidth,H.appearance.barWidth,4,40),barFilledChar:P($.barFilledChar,H.appearance.barFilledChar),barEmptyChar:P($.barEmptyChar,H.appearance.barEmptyChar),warnThreshold:V,errorThreshold:J}}}var s=-1e5;function Vq(z,q,H){let Q=z[q];if(!Y(Q))return H;if(Q.forceToTop===!0)return s+Object.keys(z).indexOf(q);return G(Q.order,H,-1e4,1e4)}var n=`// Shared preferences for opencode TUI plugins.
package/dist/tui.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SidebarState, d as QuotaPacing, f as QuotaWindow, i as AccountQuota, w as SpendControlReading } from "./sidebar-state-CrRiE9hw.js";
1
+ import { S as SidebarState, d as QuotaPacing, f as QuotaWindow, i as AccountQuota, w as SpendControlReading } from "./sidebar-state--OTpRzFd.js";
2
2
  import { i as OpenDialogPayload, n as ApplyResult, t as ApplyRequest } from "./protocol-BZZtDn5h.js";
3
3
  import { t as RpcClient } from "./rpc-client-rWuV04C-.js";
4
4
  import { Plugin } from "@opencode/plugin/tui";
@@ -1,4 +1,4 @@
1
- import { C as AccountPaths, c as HostSlotAdapter, d as OpenAiVaultOptions, f as BeginAccountLoginOptions, i as CodexSessionMetadata, o as RuntimeLayoutOptions, p as BeginAccountLoginResult, r as CodexRequestRuntime, s as PoolLifecycleDeps } from "../codex-request-NjUd_A0U.js";
1
+ import { C as AccountPaths, a as BeginAccountLoginOptions, g as OpenAiVaultOptions, m as CodexSessionMetadata, n as PoolLifecycleDeps, o as BeginAccountLoginResult, p as CodexRequestRuntime, r as HostSlotAdapter, t as RuntimeLayoutOptions } from "../runtime-layout-DdxprfY1.js";
2
2
  import { i as OpenDialogPayload, n as ApplyResult } from "../protocol-BZZtDn5h.js";
3
3
  import { Plugin } from "@opencode/plugin";
4
4
  import "@opencode/plugin/promise/integration";
@@ -59,6 +59,12 @@ declare class FrameTurnState {
59
59
  /** Drops a deleted host session; its next frame starts a new turn. */
60
60
  forget(sessionID: string): void;
61
61
  }
62
+ /** The last primary turn sent on either transport, without either transport's history. */
63
+ declare class CodexPrimaryTurns {
64
+ #private;
65
+ record(session: CodexSessionMetadata, { turnID, turnStartedAt }?: Pick<CodexSessionMetadata, keyof FrameTurn>): void;
66
+ forAuxiliary(session: CodexSessionMetadata, runtime?: CodexRequestRuntime): CodexSessionMetadata;
67
+ }
62
68
  interface CodexSessionStoreOptions {
63
69
  /** Mints the turn ids of loaded sessions; UUIDv7 by default. */
64
70
  uuid?: () => string;
@@ -81,6 +87,7 @@ declare class CodexSessionStore {
81
87
  * to the session file at `path`.
82
88
  */
83
89
  readonly frameTurns: FrameTurnState;
90
+ readonly primaryTurns: CodexPrimaryTurns;
84
91
  constructor(path: string, options?: CodexSessionStoreOptions);
85
92
  /** The session's metadata; a new session gets a new thread id and is saved. */
86
93
  get(sessionID: string, uuid?: () => string): CodexSessionMetadata;
@@ -112,10 +119,10 @@ declare class CodexHttpState {
112
119
  /**
113
120
  * Each session's WebSocket frame turn (see `frame-turn.ts`). With a store
114
121
  * this is the store's process-wide state; without a store it is this
115
- * object's own. Only WebSocket frames update it; HTTP requests of every
116
- * kind leave it alone.
122
+ * object's own. Only primary WebSocket frames update it.
117
123
  */
118
124
  readonly frameTurns: FrameTurnState;
125
+ readonly primaryTurns: CodexPrimaryTurns;
119
126
  readonly installationID: string;
120
127
  constructor(runtime?: CodexRequestRuntime | undefined, installationID?: string, store?: CodexSessionStore | undefined);
121
128
  get(sessionID: string): CodexSessionMetadata;