@cortexkit/opencode-anthropic-auth 2.9.1 → 2.10.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.
@@ -61,6 +61,7 @@ export interface NativeSource extends NativeAnthropicSource<OAuthQuotaSnapshot,
61
61
  readonly resetRouting: (sessionID: string) => Promise<void>;
62
62
  /** The account that served the session's latest authorization, if any. */
63
63
  readonly servedAccount: (sessionID: string) => string | undefined;
64
+ readonly peekAccount?: (sessionId: string, modelId: string | undefined, snapshot: NativeAccountSnapshot) => string | undefined;
64
65
  readonly recordPrime: (provenance: NativeSourceProvenance, usage: {
65
66
  inputTokens?: number;
66
67
  outputTokens?: number;
package/dist/v2/tui.js CHANGED
@@ -1,4 +1,4 @@
1
- import{x as q}from"../index-h508mdrx.js";import"../index-pxnn7mg1.js";import"../index-n8xr16kr.js";var N="Open this link in your browser and sign in. Then choose Finish OAuth sign-in in the Accounts menu and paste the code Claude shows you.";async function g(D,M={}){let B=D.client.rpc(q),Z=!0,V=!1,Y=new AbortController,$=()=>{let j=D.ui.router.current();return j.type==="session"?j.sessionID:void 0};function C(j){return new Promise((Q)=>{let z="",J=!1,G=D.keymap.mode.push("cortexkit-protected-entry"),X=(H,W=!0)=>{if(J)return;J=!0,D.renderer.keyInput.off("keypress",O),D.renderer.keyInput.off("paste",P),Y.signal.removeEventListener("abort",K),G();let F=H?z:void 0;if(z="",W)D.ui.dialog.clear();Q(F)},K=()=>X(!1),O=(H)=>{if(H.preventDefault(),H.stopPropagation(),H.name==="escape"||H.ctrl&&H.name==="c")return X(!1);if(H.name==="return"||H.name==="enter")return X(!0);if(H.name==="backspace"){z=Array.from(z).slice(0,-1).join("");return}if(!H.ctrl&&!H.meta&&!H.option&&Array.from(H.sequence).every((W)=>W.charCodeAt(0)>=32&&W.charCodeAt(0)!==127))z=(z+H.sequence).slice(0,4096)},P=(H)=>{H.preventDefault(),H.stopPropagation(),z=(z+Array.from(new TextDecoder().decode(H.bytes)).filter((W)=>W.charCodeAt(0)>=32&&W.charCodeAt(0)!==127).join("")).slice(0,4096)};if(D.renderer.keyInput.prependListener("keypress",O),D.renderer.keyInput.prependListener("paste",P),Y.signal.addEventListener("abort",K,{once:!0}),D.ui.dialog.alert({title:j,message:"Type or paste the value. Input is hidden. Enter accepts; Escape cancels."}).then(()=>X(!1,!1),()=>X(!1,!1)),Y.signal.aborted)K()})}async function E(j){let Q={};for(let z of j.knobs){if(!Z)return;if(z.kind==="choice"){let J=await D.ui.dialog.select({title:z.label,options:z.choices.map((G)=>({title:G.label,value:G.value})),current:z.value});if(J===void 0)return;Q[z.id]=J}else if(z.kind==="toggle"){let J=await D.ui.dialog.select({title:z.label,options:[{title:"On",value:!0},{title:"Off",value:!1}],current:z.value});if(J===void 0)return;Q[z.id]=J}else{let J=z.kind==="text"&&z.masked?await C(z.label):await D.ui.dialog.prompt({title:z.label,value:z.value===void 0?void 0:String(z.value),placeholder:z.kind==="text"?z.placeholder:void 0});if(J===void 0)return;Q[z.id]=J===""&&!z.required?null:z.kind==="number"?Number(J):J}}return Q}async function A(j){if(M.showSignInLink)try{await M.showSignInLink(D,j,Y.signal);return}catch{}await D.ui.dialog.alert({title:"Claude sign-in",message:`${N}
1
+ import{x as q}from"../index-pcyn2rkg.js";import"../index-m7k9zxem.js";import"../index-n8xr16kr.js";var N="Open this link in your browser and sign in. Then choose Finish OAuth sign-in in the Accounts menu and paste the code Claude shows you.";async function g(D,M={}){let B=D.client.rpc(q),Z=!0,V=!1,Y=new AbortController,$=()=>{let j=D.ui.router.current();return j.type==="session"?j.sessionID:void 0};function C(j){return new Promise((Q)=>{let z="",J=!1,G=D.keymap.mode.push("cortexkit-protected-entry"),X=(H,W=!0)=>{if(J)return;J=!0,D.renderer.keyInput.off("keypress",O),D.renderer.keyInput.off("paste",P),Y.signal.removeEventListener("abort",K),G();let F=H?z:void 0;if(z="",W)D.ui.dialog.clear();Q(F)},K=()=>X(!1),O=(H)=>{if(H.preventDefault(),H.stopPropagation(),H.name==="escape"||H.ctrl&&H.name==="c")return X(!1);if(H.name==="return"||H.name==="enter")return X(!0);if(H.name==="backspace"){z=Array.from(z).slice(0,-1).join("");return}if(!H.ctrl&&!H.meta&&!H.option&&Array.from(H.sequence).every((W)=>W.charCodeAt(0)>=32&&W.charCodeAt(0)!==127))z=(z+H.sequence).slice(0,4096)},P=(H)=>{H.preventDefault(),H.stopPropagation(),z=(z+Array.from(new TextDecoder().decode(H.bytes)).filter((W)=>W.charCodeAt(0)>=32&&W.charCodeAt(0)!==127).join("")).slice(0,4096)};if(D.renderer.keyInput.prependListener("keypress",O),D.renderer.keyInput.prependListener("paste",P),Y.signal.addEventListener("abort",K,{once:!0}),D.ui.dialog.alert({title:j,message:"Type or paste the value. Input is hidden. Enter accepts; Escape cancels."}).then(()=>X(!1,!1),()=>X(!1,!1)),Y.signal.aborted)K()})}async function E(j){let Q={};for(let z of j.knobs){if(!Z)return;if(z.kind==="choice"){let J=await D.ui.dialog.select({title:z.label,options:z.choices.map((G)=>({title:G.label,value:G.value})),current:z.value});if(J===void 0)return;Q[z.id]=J}else if(z.kind==="toggle"){let J=await D.ui.dialog.select({title:z.label,options:[{title:"On",value:!0},{title:"Off",value:!1}],current:z.value});if(J===void 0)return;Q[z.id]=J}else{let J=z.kind==="text"&&z.masked?await C(z.label):await D.ui.dialog.prompt({title:z.label,value:z.value===void 0?void 0:String(z.value),placeholder:z.kind==="text"?z.placeholder:void 0});if(J===void 0)return;Q[z.id]=J===""&&!z.required?null:z.kind==="number"?Number(J):J}}return Q}async function A(j){if(M.showSignInLink)try{await M.showSignInLink(D,j,Y.signal);return}catch{}await D.ui.dialog.alert({title:"Claude sign-in",message:`${N}
2
2
 
3
3
  ${j}
4
4
  `})}async function T(j,Q){let z=`${Q.title} status`;if(M.showStatus)try{await M.showStatus(D,{title:z,lines:Q.lines,...Q.slot==="quota"&&{readQuota:(J)=>B.sidebar({sessionId:j},{signal:J,location:D.location})}},Y.signal);return}catch{}await D.ui.dialog.alert({title:z,message:Q.lines.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-anthropic-auth",
3
- "version": "2.9.1",
3
+ "version": "2.10.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -77,8 +77,8 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@clack/prompts": "^1.6.0",
80
- "@cortexkit/anthropic-auth-core": "2.9.1",
81
- "@cortexkit/claustrum-client": "0.17.0",
80
+ "@cortexkit/anthropic-auth-core": "2.10.0",
81
+ "@cortexkit/claustrum-client": "0.18.0",
82
82
  "@cortexkit/private-files": "0.2.2",
83
83
  "@cortexkit/subc-client": "^0.24",
84
84
  "@opentui/core": "0.8.1",
@@ -860,13 +860,14 @@ export function resolveActiveAccount(state: SidebarState): {
860
860
  }
861
861
 
862
862
  /**
863
- * Pretty label for a recoverable-refusal source model (Fable or Opus).
863
+ * Pretty label for a recoverable-refusal source model (Fable, Mythos or Opus).
864
864
  * Falls back to the raw id for unrecognized ids so the sidebar never goes
865
865
  * blank on a future model that has not yet been cataloged here.
866
866
  */
867
867
  export function formatFallbackModelLabel(modelId: string | undefined): string {
868
868
  const row = resolveClaudeModelCapabilities(modelId)
869
- if (row?.id === 'claude-fable-5-2') return row.name.replace(/^Claude /, '')
869
+ if (row?.id === 'claude-fable-5-2' || row?.id === 'claude-mythos-5-2')
870
+ return row.name.replace(/^Claude /, '')
870
871
  if (
871
872
  modelId === 'claude-mythos-5-1' ||
872
873
  modelId?.startsWith('claude-mythos-5-1-')
@@ -860,13 +860,14 @@ export function resolveActiveAccount(state: SidebarState): {
860
860
  }
861
861
 
862
862
  /**
863
- * Pretty label for a recoverable-refusal source model (Fable or Opus).
863
+ * Pretty label for a recoverable-refusal source model (Fable, Mythos or Opus).
864
864
  * Falls back to the raw id for unrecognized ids so the sidebar never goes
865
865
  * blank on a future model that has not yet been cataloged here.
866
866
  */
867
867
  export function formatFallbackModelLabel(modelId: string | undefined): string {
868
868
  const row = resolveClaudeModelCapabilities(modelId)
869
- if (row?.id === 'claude-fable-5-2') return row.name.replace(/^Claude /, '')
869
+ if (row?.id === 'claude-fable-5-2' || row?.id === 'claude-mythos-5-2')
870
+ return row.name.replace(/^Claude /, '')
870
871
  if (
871
872
  modelId === 'claude-mythos-5-1' ||
872
873
  modelId?.startsWith('claude-mythos-5-1-')