@cortexkit/opencode-openai-auth 1.20.2 → 1.20.3

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 (32) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/{codex-request-Dvj28zFK.d.ts → codex-request-D0oxrTkl.d.ts} +19 -1
  3. package/dist/{index-0mf78d7s.js → index-66eejhpe.js} +1 -1
  4. package/dist/{index-38xyx9nd.js → index-6a1t612m.js} +1 -1
  5. package/dist/{index-a1zh72v8.js → index-8ap9gr0h.js} +1 -1
  6. package/dist/{index-ah9yt0zm.js → index-a7eep73q.js} +1 -1
  7. package/dist/{index-8ge0as5s.js → index-ahbghz6c.js} +1 -1
  8. package/dist/{index-xcsz00nr.js → index-eb631m0m.js} +1 -1
  9. package/dist/{index-jky7c65x.js → index-gxa94644.js} +1 -1
  10. package/dist/index-kakqxnt5.js +101 -0
  11. package/dist/{index-z4tfv40j.js → index-t66h86ed.js} +1 -1
  12. package/dist/{index-rbc7cfbv.js → index-vjb3rsqh.js} +3 -3
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/rpc/port-file.js +1 -1
  16. package/dist/rpc/protocol.js +1 -1
  17. package/dist/rpc/rpc-client.js +1 -1
  18. package/dist/sidebar-state.js +1 -1
  19. package/dist/tui-preferences.js +1 -1
  20. package/dist/v2/server.d.ts +1 -1
  21. package/dist/v2/server.js +4 -4
  22. package/package.json +2 -2
  23. package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +145 -8
  24. package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +32 -0
  25. package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +10 -0
  26. package/src/tui-compiled/raw/shared/c97089ed4243981c-host.js +8 -0
  27. package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +145 -8
  28. package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +32 -0
  29. package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +10 -0
  30. package/src/tui-compiled/runtime/shared/c97089ed4243981c-host.js +8 -0
  31. package/dist/index-x3q449sn.js +0 -101
  32. /package/dist/{index-c4h4t3wg.js → index-tn1ve0gx.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as loadAccounts, _ as parseJwtClaims, a as RESPONSES_LITE_MODELS, b as OAuthAccount, g as extractAccountIdFromClaims, h as TokenResponse, l as ResetTargetIdentity, m as IdTokenClaims, n as CODEX_VERSION, o as RuntimeLayoutOptions, s as PoolLifecycleDeps, t as CODEX_USER_AGENT, u as OpenAiVault, v as AccountStorage, w as QuotaManager, x as OAuthQuotaSnapshot, y as FallbackAccount } from "./codex-request-Dvj28zFK.js";
1
+ import { S as loadAccounts, _ as parseJwtClaims, a as RESPONSES_LITE_MODELS, b as OAuthAccount, g as extractAccountIdFromClaims, h as TokenResponse, l as ResetTargetIdentity, m as IdTokenClaims, n as CODEX_VERSION, o as RuntimeLayoutOptions, s as PoolLifecycleDeps, t as CODEX_USER_AGENT, u as OpenAiVault, v as AccountStorage, w as QuotaManager, x as OAuthQuotaSnapshot, y as FallbackAccount } from "./codex-request-D0oxrTkl.js";
2
2
  import { S as SidebarState, y as SidebarMachineState } from "./sidebar-state-CrRiE9hw.js";
3
3
  import { Hooks, Plugin, PluginInput } from "@opencode-ai/plugin";
4
4
  type TimerHandle = ReturnType<typeof setInterval>;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{$ as t,S as m,T as n,U as o,V as p,W as q,Z as r,_ as s,aa as u,ba as v,fa as w,ga as x,ha as y,ia as z,ja as A,ka as B,la as C,m as c,ma as D,n as d,na as E,o as e,oa as F,pa as G,r as f,s as g,t as h,u as i,v as j,w as k,x as l}from"./index-ah9yt0zm.js";import"./index-rbc7cfbv.js";import"./index-8ge0as5s.js";import{Ae as a,Be as b}from"./index-x3q449sn.js";import"./index-z4tfv40j.js";import"./index-jky7c65x.js";import"./index-a1zh72v8.js";import"./index-0mf78d7s.js";import"./index-xcsz00nr.js";import"./index-c4h4t3wg.js";import"./index-qtaqp1bf.js";import"./index-t15pb3n2.js";export{g as rewriteResponsesLiteBody,v as resolveSidebarSessionId,o as poolResetTarget,a as parseJwtClaims,s as mergePushedQuotaMetadata,x as getMainRefreshLockName,r as findCachekeepFallbackAccount,b as extractAccountIdFromClaims,G as default,p as createResetTargetResolver,l as codexOAuthModelVariantSource,j as codexOAuthModelListed,k as codexOAuthModelLimit,u as buildSidebarState,t as buildSidebarMachineState,q as buildResetRedemptionDeps,B as __resetBootQuotaSeedForTest,C as __menuContextForTest,A as __bootQuotaSeedPromiseForTest,n as ResetTargetResolutionError,c as RESPONSES_LITE_MODELS,D as POOL_MIGRATION_ENABLED,F as OpenAIAuthPlugin,f as MID_CONVERSATION_EFFORT_MODELS,y as MAIN_REFRESH_LOCK_TTL_MS,z as MAIN_REFRESH_LEASE_TTL_MS,w as EMPTY_BEARER_MESSAGE,i as DISALLOWED_MODELS,E as CodexAuthPlugin,d as CODEX_VERSION,e as CODEX_USER_AGENT,m as AuthPersistError,h as ALLOWED_MODELS};
1
+ import{$ as t,S as m,T as n,U as o,V as p,W as q,Z as r,_ as s,aa as u,ba as v,fa as w,ga as x,ha as y,ia as z,ja as A,ka as B,la as C,m as c,ma as D,n as d,na as E,o as e,oa as F,pa as G,r as f,s as g,t as h,u as i,v as j,w as k,x as l}from"./index-a7eep73q.js";import"./index-vjb3rsqh.js";import"./index-ahbghz6c.js";import{Ae as a,Be as b}from"./index-kakqxnt5.js";import"./index-t66h86ed.js";import"./index-gxa94644.js";import"./index-8ap9gr0h.js";import"./index-66eejhpe.js";import"./index-eb631m0m.js";import"./index-tn1ve0gx.js";import"./index-qtaqp1bf.js";import"./index-t15pb3n2.js";export{g as rewriteResponsesLiteBody,v as resolveSidebarSessionId,o as poolResetTarget,a as parseJwtClaims,s as mergePushedQuotaMetadata,x as getMainRefreshLockName,r as findCachekeepFallbackAccount,b as extractAccountIdFromClaims,G as default,p as createResetTargetResolver,l as codexOAuthModelVariantSource,j as codexOAuthModelListed,k as codexOAuthModelLimit,u as buildSidebarState,t as buildSidebarMachineState,q as buildResetRedemptionDeps,B as __resetBootQuotaSeedForTest,C as __menuContextForTest,A as __bootQuotaSeedPromiseForTest,n as ResetTargetResolutionError,c as RESPONSES_LITE_MODELS,D as POOL_MIGRATION_ENABLED,F as OpenAIAuthPlugin,f as MID_CONVERSATION_EFFORT_MODELS,y as MAIN_REFRESH_LOCK_TTL_MS,z as MAIN_REFRESH_LEASE_TTL_MS,w as EMPTY_BEARER_MESSAGE,i as DISALLOWED_MODELS,E as CodexAuthPlugin,d as CODEX_VERSION,e as CODEX_USER_AGENT,m as AuthPersistError,h as ALLOWED_MODELS};
@@ -1 +1 @@
1
- import{tg as b,ug as c}from"../index-jky7c65x.js";import{zg as a}from"../index-a1zh72v8.js";import"../index-c4h4t3wg.js";import"../index-qtaqp1bf.js";import"../index-t15pb3n2.js";export{b as writePortFile,c as isOpenaiRpcStateDir,a as discoverPortFile};
1
+ import{tg as b,ug as c}from"../index-gxa94644.js";import{zg as a}from"../index-8ap9gr0h.js";import"../index-tn1ve0gx.js";import"../index-qtaqp1bf.js";import"../index-t15pb3n2.js";export{b as writePortFile,c as isOpenaiRpcStateDir,a as discoverPortFile};
@@ -1 +1 @@
1
- import{Ig as b}from"../index-0mf78d7s.js";import"../index-xcsz00nr.js";import"../index-c4h4t3wg.js";import"../index-t15pb3n2.js";export{b as isNotifyPayload};
1
+ import{Ig as b}from"../index-66eejhpe.js";import"../index-eb631m0m.js";import"../index-tn1ve0gx.js";import"../index-t15pb3n2.js";export{b as isNotifyPayload};
@@ -1 +1 @@
1
- import{Ag as F,Bg as f}from"../index-a1zh72v8.js";import"../index-c4h4t3wg.js";import"../index-t15pb3n2.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
1
+ import{Ag as F,Bg as f}from"../index-8ap9gr0h.js";import"../index-tn1ve0gx.js";import"../index-t15pb3n2.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
@@ -1 +1 @@
1
- import{$c as q,Ad as R,Bd as S,Cd as T,Lc as a,Mc as b,Nc as c,Oc as d,Pc as e,Qc as f,Rc as g,Sc as h,Tc as i,Uc as j,Vc as k,Wc as l,Xc as m,Yc as n,Zc as o,_c as p,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}from"./index-8ge0as5s.js";import"./index-x3q449sn.js";import"./index-z4tfv40j.js";import"./index-0mf78d7s.js";import"./index-xcsz00nr.js";import"./index-c4h4t3wg.js";import"./index-t15pb3n2.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{$c as q,Ad as R,Bd as S,Cd as T,Lc as a,Mc as b,Nc as c,Oc as d,Pc as e,Qc as f,Rc as g,Sc as h,Tc as i,Uc as j,Vc as k,Wc as l,Xc as m,Yc as n,Zc as o,_c as p,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}from"./index-ahbghz6c.js";import"./index-kakqxnt5.js";import"./index-t66h86ed.js";import"./index-66eejhpe.js";import"./index-eb631m0m.js";import"./index-tn1ve0gx.js";import"./index-t15pb3n2.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,4 +1,4 @@
1
- import{ag as _,ig as R,kg as I,lg as x}from"./index-z4tfv40j.js";import"./index-xcsz00nr.js";import{Qg as N,Rg as L,Xg as j}from"./index-c4h4t3wg.js";import"./index-t15pb3n2.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-t66h86ed.js";import"./index-eb631m0m.js";import{Qg as N,Rg as L,Xg as j}from"./index-tn1ve0gx.js";import"./index-t15pb3n2.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.
@@ -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-Dvj28zFK.js";
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-D0oxrTkl.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";