@cortexkit/opencode-anthropic-auth 1.22.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 +37 -20
  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 +5 -1
  12. package/dist/fable-fallback.d.ts +1 -1
  13. package/dist/{index-926t2bzc.js → index-0jfsxyn9.js} +1 -1
  14. package/dist/index-1fq7h6yd.js +430 -0
  15. package/dist/{index-7f57ewkp.js → index-1gr8v4fn.js} +1 -1
  16. package/dist/index-797pmamn.js +2 -0
  17. package/dist/{index-bx5hsgf8.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 +27 -22
  24. package/dist/local-login.d.ts +64 -0
  25. package/dist/{logger-jrkranbz.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 +9 -2
  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 +3 -1
  47. package/dist/sidebar-state.js +1 -1
  48. package/dist/transform.d.ts +5 -1
  49. package/dist/tui/command-dialogs.d.ts +27 -2
  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 +18 -2
  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 +26 -2
  58. package/src/tui/command-dialogs.tsx +273 -68
  59. package/src/tui-compiled/rpc/protocol.ts +18 -2
  60. package/src/tui-compiled/rpc/rpc-client.ts +1 -1
  61. package/src/tui-compiled/sidebar-state.ts +26 -2
  62. package/src/tui-compiled/tui/command-dialogs.tsx +215 -61
  63. package/src/tui-compiled/tui.tsx +1 -0
  64. package/src/tui.tsx +1 -0
  65. package/dist/index-8aga2zwv.js +0 -4
  66. package/dist/index-cgez4m0h.js +0 -2
  67. package/dist/index-d3f8g6ve.js +0 -428
  68. package/dist/index-sh51yqxs.js +0 -2
@@ -1 +1 @@
1
- import{createHash as z}from"node:crypto";import{homedir as F,tmpdir as O}from"node:os";import{join as q,resolve as G}from"node:path";var J="OPENCODE_ANTHROPIC_AUTH_RPC_DIR";function T(g){let k=process.env[J]?.trim();if(k)return G(g,k);let w=z("sha256").update(g).digest("hex").slice(0,16),x=process.env.XDG_STATE_HOME||q(F(),".local","state");return q(x,"cortexkit","anthropic-auth","rpc",w)}export{O as qd,T as rd};
1
+ import{createHash as z}from"node:crypto";import{homedir as F,tmpdir as O}from"node:os";import{join as q,resolve as G}from"node:path";var J="OPENCODE_ANTHROPIC_AUTH_RPC_DIR";function T(g){let k=process.env[J]?.trim();if(k)return G(g,k);let w=z("sha256").update(g).digest("hex").slice(0,16),x=process.env.XDG_STATE_HOME||q(F(),".local","state");return q(x,"cortexkit","anthropic-auth","rpc",w)}export{O as rh,T as sh};
@@ -0,0 +1,2 @@
1
+ import{Ia as H,Sa as N,W as J,_ as K,ma as M}from"./index-1fq7h6yd.js";import{createHash as T}from"node:crypto";import{readFile as W,rename as X,writeFile as Y}from"node:fs/promises";function I(j){if(j.servedVersion!==void 0)return j.servedVersion;if(j.cacheVersion!==void 0)return j.cacheVersion;return j.warn?.(j.accountId),0}function Z(j,k){return{minimumRecordVersion:j+1,observedAt:k}}function S(j,k){let q=k.claustrumDivergence?.[j.credentialId];return!q||j.recordVersion>=q.minimumRecordVersion?{ok:!0}:{ok:!1,message:"missing fresh vault import"}}class Q extends Error{code="custody_login_observation_unavailable";constructor(){super("Local login cannot be verified while OPENCODE_AUTH_CONTENT is set; unset it before signing in.");this.name="CustodyLoginObservationUnavailableError"}}function y(j){if(j.OPENCODE_AUTH_CONTENT!==void 0)throw new Q}function _(j,k){let q=(w)=>`${w.length}:${w}`;return T("sha256").update(q(j)+q(k)).digest("hex")}async function $(j,k,q){if(!j||k?.type!=="oauth")return"not-cleared";if(!k.access||!k.refresh)return"not-cleared";if(_(k.access,k.refresh)!==j.authFingerprint)return"not-cleared";if(await q.beforeRemove?.(),q.divergence)await E(q.divergence.statePath,j.credentialId,q.divergence.lastVaultServedRecordVersion,Date.now());let w=await(q.remove??M)({path:q.manifestPath,entry:q.entry});if(w==="removed")return"cleared";if(w==="missing")return"not-cleared";return w.code===void 0?"refused":"refused-transient"}async function E(j,k,q,w){let B={version:1};try{let D=JSON.parse(await W(j,"utf8"));if(D&&typeof D==="object"&&!Array.isArray(D))B=D}catch{}let F=B.claustrumDivergence&&typeof B.claustrumDivergence==="object"&&!Array.isArray(B.claustrumDivergence)?B.claustrumDivergence:{};F[k]=Z(q,w),B.claustrumDivergence=F;let G=`${j}.${process.pid}.tmp`;await Y(G,JSON.stringify(B,null,2),{mode:384}),await X(G,j)}async function L(j,k){if(!j)return"not-cleared";let q=await N(k.accountStoragePath),w=q?.accounts.find((z)=>z.id===j.accountId&&H(z));if(!q||!w?.label)return"not-cleared";let B=await new K({path:k.manifestPath,provider:"anthropic",serve:"anthropic-auth"}).read();if(B.status!=="ready")return"not-cleared";let F=new Map;for(let z of q.accounts)if(H(z)&&z.label)F.set(z.label,(F.get(z.label)??0)+1);let G=new Set([...F].filter(([,z])=>z>1).map(([z])=>z)),D=J({account:w,manifest:B.manifest,duplicateOAuthLabels:G.size===0?void 0:G});if(D.status!=="resolved"||D.source!=="manifest")return"not-cleared";if(D.credentialId!==j.credentialId)return"not-cleared";return $(j,{type:"oauth",access:w.access,refresh:w.refresh},{manifestPath:k.manifestPath,entry:{label:w.label,handle:D.handle,credentialId:D.credentialId},remove:k.remove,divergence:k.divergence})}
2
+ export{I as a,S as b,y as c,_ as d,$ as e,E as f,L as g};
@@ -1,2 +1,2 @@
1
- var e=["claude-account","claude-cache","claude-cachekeep","claude-prime","claude-start","claude-quota","claude-dump","claude-fast","claude-routing","claude-killswitch","claude-logging"];
2
- export{e as pd};
1
+ var t=["claude-account","claude-cache","claude-cachekeep","claude-prime","claude-start","claude-quota","claude-dump","claude-fast","claude-routing","claude-killswitch","claude-logging"];
2
+ export{t as qh};
@@ -0,0 +1,5 @@
1
+ import*as B from"node:fs";import*as w from"node:os";import*as F from"node:path";var E="9d1c250a-e61b-44d9-88ed-5944d1962f5e",v={console:"https://platform.claude.com/oauth/authorize",max:"https://claude.com/cai/oauth/authorize"},u="https://platform.claude.com/oauth/code/callback",m="https://platform.claude.com/v1/oauth/token",b=/^ckh_[A-Za-z0-9_-]{43}$/,o="axios/1.15.2",d=["org:create_api_key","user:profile","user:inference","user:sessions:claude_code","user:mcp_servers","user:file_upload"],n="user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload",t="mcp_",s=["oauth-2025-04-20","interleaved-thinking-2025-05-14"],l="fast-mode-2026-02-01";function a(q,Q){let W=(q??"").split(",").map(($)=>$.trim()).filter(Boolean);return[...new Set([...W,...Q])].join(",")}function e(q){return typeof q==="string"&&(q.startsWith("claude-opus-4-6")||q.startsWith("claude-opus-4-7")||q.startsWith("claude-opus-4-8")||q.startsWith("claude-opus-5"))}var qq="You are OpenCode",Qq="You are Claude Code, Anthropic's official CLI for Claude.",Wq=["<use_parallel_tool_calls>","For maximum efficiency, whenever you perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially. Prioritize calling independent tools in parallel whenever possible. For example, when reading 3 known files, run 3 tool calls in parallel to read all 3 files into context at the same time. When running multiple independent read-only commands like `ls` or `list_dir`, run all of those commands in parallel. Err on the side of maximizing parallel tool calls for independent work rather than running too many tools sequentially.","","Do not parallelize tool calls when one call depends on the output of another call. If a tool call needs an ID, filename, search result, or any other value returned by a previous tool call, run the first call, wait for its result, then run the dependent call using the real returned value. Never invent placeholder IDs, guessed task IDs, or other guessed values for dependent tool calls just to place them in the same parallel block.","</use_parallel_tool_calls>"].join(`
2
+ `),$q="59cf53e54c78",Bq=[4,7,20],S="2.1.280",O="cli",Jq="0.112.1",jq="v26.3.0",zq=`claude-cli/${S} (external, ${O})`,Kq=["explicit","automatic","hybrid"],Zq="explicit",Hq=["github.com/anomalyco/opencode","opencode.ai/docs"],Yq=[{match:"if OpenCode honestly",replacement:"if the assistant honestly"},{match:"Here is some useful information about the environment you are running in:",replacement:"Environment context you are running in:"}];var X={error:0,warn:1,info:2,debug:3,trace:4},R=new Set(Object.keys(X));function I(q){if(!q)return null;let Q=q.trim().toLowerCase();return R.has(Q)?Q:null}var k=I(process.env.OPENCODE_ANTHROPIC_AUTH_LOG_LEVEL),V=k??"info";function Xq(q){V=q}function Uq(){return V}function C(q){return X[q]<=X[V]}var z=process.env.OPENCODE_ANTHROPIC_AUTH_LOG_FILE??F.join(w.tmpdir(),"opencode-anthropic-auth.log");function Vq(){return z}var f=5242880,D=3;function T(){try{if(!B.existsSync(z))return;if(B.statSync(z).size<f)return}catch{return}try{for(let q=D;q>=1;q--){let Q=q===1?z:`${z}.${q-1}`,W=`${z}.${q}`;try{if(q===D)try{B.unlinkSync(W)}catch{}if(B.existsSync(Q))B.renameSync(Q,W)}catch{}}}catch{}}var _=/^(authorization|x-api-key|cookie|set-cookie|refresh|access|token|handle)$/i;function g(q){if(_.test(q))return!0;let Q=q.toLowerCase().replace(/[-_]/g,"");if(Q.includes("apikey"))return!0;if(Q.endsWith("secret")||Q.endsWith("password"))return!0;if(Q.endsWith("token")&&!Q.endsWith("tokens"))return!0;return!1}var c=[/Bearer\s+\S+/,/sk-[A-Za-z0-9-]+/,/eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/,b];function y(q){if(typeof q!=="string")return!1;return c.some((Q)=>Q.test(q))}function N(q){if(q==null||Object.keys(q).length===0)return;let Q=new WeakSet;function W($){if($==null||typeof $!=="object"){if(y($))return"***REDACTED***";return $}if(Q.has($))return"[Circular]";Q.add($);try{if(Array.isArray($))return $.map(W);let J=$,j={};for(let[H,M]of Object.entries(J)){if(g(H)){j[H]="***REDACTED***";continue}j[H]=W(M)}return j}finally{Q.delete($)}}return W(q)}function L(q,Q,W,$){let J=new Date().toISOString(),j=q.toUpperCase().padEnd(5),H=Q?` [${Q}]`:"",M=(()=>{try{let P=N($),A=P?{...P,pid:process.pid}:{pid:process.pid};return` ${JSON.stringify(A)}`}catch{return` {"pid":${process.pid},"payload":"[unserializable]"}`}})();return`[${J}] ${j}${H} ${W}${M}`}var U=null;function Cq(q){U=q}function K(q,Q,W,$){if(!C(q))return;if(U)try{U({level:q,channel:Q,message:W,payload:N($)})}catch{}if(x)return;try{let J=`${L(q,Q,W,$)}
3
+ `;if(Y.push(J),Y.length>=p)G();else i()}catch{}}var Gq={error(q,Q,W){K("error",q,Q,W)},warn(q,Q,W){K("warn",q,Q,W)},info(q,Q,W){K("info",q,Q,W)},debug(q,Q,W){K("debug",q,Q,W)},trace(q,Q,W){K("trace",q,Q,W)}},x=!1,r=500,p=50,Y=[],Z=null;function G(){if(Z)clearTimeout(Z),Z=null;if(Y.length===0)return;let q=Y.join("");Y=[];try{T(),B.appendFileSync(z,q)}catch{}}function i(){if(Z)return;Z=setTimeout(()=>{Z=null,G()},r)}var h=/^\[([\w-]+)\]\s*/;function Pq(q,Q){if(!C("debug"))return;if(x)return;try{let W="",$=q,J=q.match(h);if(J)W=J[1]??"",$=q.slice(J[0].length);let j;if(Q!=null){if(Q instanceof Error)j={error:`${Q.message}${Q.stack?`
4
+ ${Q.stack}`:""}`};else if(typeof Q==="object")j=Q}K("debug",W,$,j)}catch{}}function bq(q,Q){if(!C("debug"))return;if(x)return;try{let W;if(Q!=null){if(typeof Q==="object"&&!(Q instanceof Error))W=Q}K("debug","relay",q,W)}catch{}}if(!x)process.on("exit",G);
5
+ export{E as Bg,v as Cg,u as Dg,m as Eg,b as Fg,o as Gg,d as Hg,n as Ig,t as Jg,s as Kg,l as Lg,a as Mg,e as Ng,qq as Og,Qq as Pg,Wq as Qg,$q as Rg,Bq as Sg,S as Tg,O as Ug,Jq as Vg,jq as Wg,zq as Xg,Kq as Yg,Zq as Zg,Hq as _g,Yq as $g,I as ah,Xq as bh,Uq as ch,C as dh,Vq as eh,_ as fh,g as gh,N as hh,L as ih,Cq as jh,Gq as kh,Pq as lh,bq as mh};
@@ -0,0 +1,2 @@
1
+ import{createRequire as s}from"node:module";var l=Object.create;var{getPrototypeOf:m,defineProperty:k,getOwnPropertyNames:n}=Object;var o=Object.prototype.hasOwnProperty;function p(a){return this[a]}var q,r,v=(a,b,d)=>{var e=a!=null&&typeof a==="object";if(e){var h=b?q??=new WeakMap:r??=new WeakMap,g=h.get(a);if(g)return g}d=a!=null?l(m(a)):{};let c=b||!a||!a.__esModule?k(d,"default",{value:a,enumerable:!0}):d;for(let f of n(a))if(!o.call(c,f))k(c,f,{get:p.bind(a,f),enumerable:!0});if(e)h.set(a,c);return c};var w=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var y=s(import.meta.url),t=Symbol.dispose||Symbol.for("Symbol.dispose"),u=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),z=(a,b,d)=>{if(b!=null){if(typeof b!=="object"&&typeof b!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var e;if(d)e=b[u];if(e===void 0)e=b[t];if(typeof e!=="function")throw TypeError("Object not disposable");a.push([d,e,b])}else if(d)a.push([d]);return b},A=(a,b,d)=>{var e=typeof SuppressedError==="function"?SuppressedError:function(c,f,i,j){return j=Error(i),j.name="SuppressedError",j.error=c,j.suppressed=f,j},h=(c)=>b=d?new e(c,b,"An error was suppressed during disposal"):(d=!0,c),g=(c)=>{while(c=a.pop())try{var f=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(f).then(g,(i)=>(h(i),g()))}catch(i){h(i)}if(d)throw b};return g()};
2
+ export{v as th,w as uh,y as vh,z as wh,A as xh};
@@ -0,0 +1,2 @@
1
+ import{uh as R,vh as X}from"./index-n96q8pks.js";var T=R((Y,L)=>{(function(D){if(typeof L==="object"&&typeof L.exports==="object"){var z=D(X,Y);if(z!==void 0)L.exports=z}else if(typeof define==="function"&&define.amd)define(["require","exports","./impl/format","./impl/edit","./impl/scanner","./impl/parser"],D)})(function(D,z){Object.defineProperty(z,"__esModule",{value:!0}),z.applyEdits=z.modify=z.format=z.printParseErrorCode=z.ParseErrorCode=z.stripComments=z.visit=z.getNodeValue=z.getNodePath=z.findNodeAtOffset=z.findNodeAtLocation=z.parseTree=z.parse=z.getLocation=z.SyntaxKind=z.ScanError=z.createScanner=void 0;let Z=D("./impl/format"),N=D("./impl/edit"),$=D("./impl/scanner"),B=D("./impl/parser");z.createScanner=$.createScanner;var Q;(function(j){j[j.None=0]="None",j[j.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",j[j.UnexpectedEndOfString=2]="UnexpectedEndOfString",j[j.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",j[j.InvalidUnicode=4]="InvalidUnicode",j[j.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",j[j.InvalidCharacter=6]="InvalidCharacter"})(Q||(z.ScanError=Q={}));var U;(function(j){j[j.OpenBraceToken=1]="OpenBraceToken",j[j.CloseBraceToken=2]="CloseBraceToken",j[j.OpenBracketToken=3]="OpenBracketToken",j[j.CloseBracketToken=4]="CloseBracketToken",j[j.CommaToken=5]="CommaToken",j[j.ColonToken=6]="ColonToken",j[j.NullKeyword=7]="NullKeyword",j[j.TrueKeyword=8]="TrueKeyword",j[j.FalseKeyword=9]="FalseKeyword",j[j.StringLiteral=10]="StringLiteral",j[j.NumericLiteral=11]="NumericLiteral",j[j.LineCommentTrivia=12]="LineCommentTrivia",j[j.BlockCommentTrivia=13]="BlockCommentTrivia",j[j.LineBreakTrivia=14]="LineBreakTrivia",j[j.Trivia=15]="Trivia",j[j.Unknown=16]="Unknown",j[j.EOF=17]="EOF"})(U||(z.SyntaxKind=U={})),z.getLocation=B.getLocation,z.parse=B.parse,z.parseTree=B.parseTree,z.findNodeAtLocation=B.findNodeAtLocation,z.findNodeAtOffset=B.findNodeAtOffset,z.getNodePath=B.getNodePath,z.getNodeValue=B.getNodeValue,z.visit=B.visit,z.stripComments=B.stripComments;var V;(function(j){j[j.InvalidSymbol=1]="InvalidSymbol",j[j.InvalidNumberFormat=2]="InvalidNumberFormat",j[j.PropertyNameExpected=3]="PropertyNameExpected",j[j.ValueExpected=4]="ValueExpected",j[j.ColonExpected=5]="ColonExpected",j[j.CommaExpected=6]="CommaExpected",j[j.CloseBraceExpected=7]="CloseBraceExpected",j[j.CloseBracketExpected=8]="CloseBracketExpected",j[j.EndOfFileExpected=9]="EndOfFileExpected",j[j.InvalidCommentToken=10]="InvalidCommentToken",j[j.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",j[j.UnexpectedEndOfString=12]="UnexpectedEndOfString",j[j.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",j[j.InvalidUnicode=14]="InvalidUnicode",j[j.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",j[j.InvalidCharacter=16]="InvalidCharacter"})(V||(z.ParseErrorCode=V={}));function k(j){switch(j){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>"}z.printParseErrorCode=k;function A(j,I,G){return Z.format(j,I,G)}z.format=A;function M(j,I,G,J){return N.setProperty(j,I,G,J)}z.modify=M;function O(j,I){let G=I.slice(0).sort((H,F)=>{let W=H.offset-F.offset;if(W===0)return H.length-F.length;return W}),J=j.length;for(let H=G.length-1;H>=0;H--){let F=G[H];if(F.offset+F.length<=J)j=N.applyEdit(j,F);else throw Error("Overlapping edit");J=F.offset}return j}z.applyEdits=O})});
2
+ export{T as nh};
@@ -0,0 +1,2 @@
1
+ import{kh as O}from"./index-a5d6v3ba.js";import{randomUUID as H}from"node:crypto";import{mkdir as g,readFile as F,rename as T,rm as z,rmdir as w,stat as P,unlink as y,writeFile as I}from"node:fs/promises";import{tmpdir as m}from"node:os";import{dirname as d,join as L}from"node:path";var v="OPENCODE_ANTHROPIC_AUTH_SIDEBAR_STATE_FILE",c=L(m(),"opencode-anthropic-auth"),u=L(c,"sidebar-state.json");function E(){return process.env[v]||u}var C={main:{quota:null},fallbacks:[],activeId:void 0,route:"main",relay:null,fastMode:!1,lastUpdated:0};function K(J){return J!==null&&typeof J==="object"&&!Array.isArray(J)}function W(J){return typeof J==="number"&&Number.isFinite(J)}function n(J){if(!K(J))return;let Z=Number(J.count),V=Number(J.inputTokens),x=Number(J.outputTokens),Y=Number(J.since);if(![Z,V,x,Y].every(Number.isFinite)||Z<0||V<0||x<0||Y<0)return;return{count:Math.floor(Z),inputTokens:Math.floor(V),outputTokens:Math.floor(x),since:Math.floor(Y)}}function i(J){if(!K(J))return;if(typeof J.id!=="string"||!J.id.trim())return;if(typeof J.label!=="string"||!J.label.trim())return;let Z={id:J.id.trim(),label:J.label.trim()};if(J.nextDueAt===null)Z.nextDueAt=null;else if(W(J.nextDueAt))Z.nextDueAt=J.nextDueAt;if(J.lastPrimedAt===null)Z.lastPrimedAt=null;else if(W(J.lastPrimedAt))Z.lastPrimedAt=J.lastPrimedAt;if(J.lastResult==="ok"||J.lastResult==="error"||J.lastResult==="skipped")Z.lastResult=J.lastResult;let V=n(J.usage);if(V)Z.usage=V;if(W(J.estimatedCostUsd))Z.estimatedCostUsd=J.estimatedCostUsd;return Z}function s(J){if(!K(J))return;if(typeof J.enabled!=="boolean")return;let Z=Array.isArray(J.accounts)?J.accounts.map(i).filter((V)=>V!=null):[];return{enabled:J.enabled,accounts:Z}}function h(J){if(!K(J))return;let Z=Number(J.usedPercent),V=Number(J.remainingPercent);if(!Number.isFinite(Z)||!Number.isFinite(V))return;return{usedPercent:Z,remainingPercent:V,resetsAt:typeof J.resetsAt==="string"?J.resetsAt:void 0}}function A(J){if(!K(J))return null;let Z={},V=h(J.five_hour),x=h(J.seven_day);if(V)Z.five_hour=V;if(x)Z.seven_day=x;if(Array.isArray(J.scoped)){let Y=J.scoped.map((X)=>{if(!K(X))return;let $=h(X);if(!$)return;if(typeof X.id!=="string"||!X.id.trim())return;if(typeof X.title!=="string"||!X.title.trim())return;if(typeof X.modelName!=="string"||!X.modelName.trim())return;let j=typeof X.modelId==="string"&&X.modelId.trim()?X.modelId.trim():void 0;return{...$,id:X.id.trim(),title:X.title.trim(),...j&&{modelId:j},modelName:X.modelName.trim()}}).filter((X)=>X!=null);Z.scoped=Y}if(K(J.extraUsage)){let Y=R(J.extraUsage.used),X=R(J.extraUsage.limit);if(Y&&X&&typeof J.extraUsage.exhausted==="boolean")Z.extraUsage={used:Y,limit:X,...typeof J.extraUsage.utilizationPercent==="number"&&Number.isFinite(J.extraUsage.utilizationPercent)&&{utilizationPercent:J.extraUsage.utilizationPercent},...typeof J.extraUsage.severity==="string"&&{severity:J.extraUsage.severity},exhausted:J.extraUsage.exhausted}}if(typeof J.bindingWindow==="string"&&J.bindingWindow.trim())Z.bindingWindow=J.bindingWindow.trim();if(typeof J.fallbackAdvised==="boolean")Z.fallbackAdvised=J.fallbackAdvised;return Object.keys(Z).length?Z:null}function R(J){if(!K(J))return;if(!Number.isInteger(J.amountMinor)||typeof J.currency!=="string"||!/^[A-Za-z]{3}$/.test(J.currency.trim())||!Number.isInteger(J.exponent)||J.exponent<0||J.exponent>20)return;return{amountMinor:J.amountMinor,currency:J.currency.trim(),exponent:J.exponent}}function p(J){if(!K(J))return{...C};let Z={quota:null};if(K(J.main)){let $=J.main;if(Z.quota=A($.quota),typeof $.tierLabel==="string"&&$.tierLabel.trim())Z.tierLabel=$.tierLabel.trim();if(typeof $.quotaBackedOff==="boolean")Z.quotaBackedOff=$.quotaBackedOff;if(typeof $.quotaBackoffUntil==="number")Z.quotaBackoffUntil=$.quotaBackoffUntil;if(typeof $.refreshBackedOff==="boolean")Z.refreshBackedOff=$.refreshBackedOff;if(typeof $.refreshBackoffUntil==="number")Z.refreshBackoffUntil=$.refreshBackoffUntil}let V=Array.isArray(J.fallbacks)?J.fallbacks.filter(K).filter(($)=>typeof $.id==="string").map(($)=>({id:$.id,label:typeof $.label==="string"?$.label:void 0,quota:A($.quota),enabled:typeof $.enabled==="boolean"?$.enabled:!1,needsReauth:typeof $.needsReauth==="boolean"?$.needsReauth:!1,...$.vaultReauth===!0&&{vaultReauth:!0},...$.vaultServed===!0&&{vaultServed:!0},...typeof $.custodyState==="string"&&{custodyState:$.custodyState},tierLabel:typeof $.tierLabel==="string"&&$.tierLabel.trim()?$.tierLabel.trim():void 0})):[],x=null;if(K(J.relay)){let $=J.relay;if(typeof $.enabled==="boolean"&&typeof $.transport==="string")x={enabled:$.enabled,transport:$.transport}}let Y;if(K(J.cacheKeep)){let $=J.cacheKeep;if(typeof $.enabled==="boolean")Y={enabled:$.enabled,window:typeof $.window==="string"?$.window:void 0,trackedSessions:typeof $.trackedSessions==="number"?$.trackedSessions:void 0}}let X=Array.isArray(J.fableRecoveries)?J.fableRecoveries.filter(K).flatMap(($)=>{if(typeof $.sessionId!=="string"||$.mode!=="opus"&&$.mode!=="fable"&&$.mode!=="server"||typeof $.remaining!=="number"||!Number.isFinite($.remaining)||typeof $.changedAt!=="number"||!Number.isFinite($.changedAt))return[];return[{sessionId:$.sessionId,mode:$.mode,remaining:Math.max(0,Math.floor($.remaining)),changedAt:$.changedAt,requestedModelId:typeof $.requestedModelId==="string"?$.requestedModelId:void 0,targetModelId:typeof $.targetModelId==="string"?$.targetModelId:void 0}]}):[];return{main:Z,fallbacks:V,activeId:typeof J.activeId==="string"?J.activeId:void 0,route:typeof J.route==="string"?J.route:C.route,relay:x,fastMode:typeof J.fastMode==="boolean"?J.fastMode:C.fastMode,cacheKeep:Y,prime:s(J.prime),fableRecoveries:X.length>0?X:void 0,lastUpdated:typeof J.lastUpdated==="number"?J.lastUpdated:0}}var q=Promise.resolve(),l=1000,o=2000,r=5,a=15,U=new Map;function QJ(J,Z=E()){if(J)U.set(Z,J);else U.delete(Z)}function M(J){return U.get(J)}var S=null;function BJ(J){S=J}function OJ(){return S}function t(J){return new Promise((Z)=>setTimeout(Z,J))}async function k(J){let Z=`${J}.lock`,V=M(J),x=V?.lockBudgetMs??l,Y=V?.lockRetryMinMs??r,X=V?.lockRetryMaxMs??a,$=Date.now()+x;while(!0){try{await g(Z);let G=H(),Q=L(Z,G);return await I(Q,"",{encoding:"utf8",mode:384,flag:"wx"}),await V?.onLockAcquired?.(Z),{ownsLock:async()=>{try{return await P(Q),!0}catch{return!1}},release:async()=>{try{await y(Q)}catch{return}await V?.beforeReleaseDirectoryRemoval?.(Z),await w(Z).catch(()=>{})}}}catch(G){if(G.code!=="EEXIST")return O.trace("sidebar","state lock unavailable; write skipped",{stateFile:J,error:G instanceof Error?G.message:String(G)}),null}try{let G=await P(Z);if(Date.now()-G.mtimeMs>o){await V?.afterStaleLockStat?.(Z);let Q=`${Z}.evict-${process.pid}-${H()}`;try{await T(Z,Q)}catch(N){if(N.code==="ENOENT")continue;throw N}await V?.onStaleLockClaimed?.(Z),await z(Q,{recursive:!0,force:!0}).catch(()=>{});continue}}catch(G){if(G.code==="ENOENT")continue;return O.trace("sidebar","state lock inspection failed; write skipped",{stateFile:J,error:G instanceof Error?G.message:String(G)}),null}let j=$-Date.now();if(j<=0)return O.warn("sidebar","lock budget exhausted, write skipped",{stateFile:J,budgetMs:x}),null;let B=Y+Math.floor(Math.random()*(X-Y+1));await t(Math.min(B,j))}}async function NJ(J){return(await k(J))?.release??null}async function e(J,Z,V){let x=M(J),Y=`${J}.${process.pid}.${H()}.tmp`;await I(Y,JSON.stringify(Z),{encoding:"utf8",mode:384});try{if(!await V())return O.trace("sidebar","state lock lost before rename; write aborted",{stateFile:J}),await z(Y,{force:!0}).catch(()=>{}),"lock-lost-before-rename";if(await x?.beforeRename?.(J,Y),!await V())return O.trace("sidebar","state lock lost before rename; write aborted",{stateFile:J}),await z(Y,{force:!0}).catch(()=>{}),"lock-lost-before-rename";if(await T(Y,J),await x?.afterRename?.(J),!await V())return"lock-lost-after-rename";return"written"}catch(X){throw await z(Y,{force:!0}).catch(()=>{}),X}}async function b(J=E()){try{let Z=await F(J,"utf8");return p(JSON.parse(Z))}catch{return C}}async function zJ(J,Z=E(),V={}){return q=q.then(async()=>{await g(d(Z),{recursive:!0});for(let x=0;x<2;x++){let Y=x===1,X=await k(Z);if(!X){if(Y)O.warn("sidebar","post-rename repair lock unavailable; write skipped",{stateFile:Z});return}let $=J,j;try{if(V.routingAuthoritative===!1){let B=await b(Z),G=await V.resolvePreservedRouting?.(B);if(G){let Q=G.state??J;$={...Q,activeId:G.activeId,route:G.route,lastUpdated:Math.max(Q.lastUpdated,B.lastUpdated)}}await M(Z)?.afterMergeRead?.(Z)}else if(Y){let B=await b(Z);$={...B,activeId:J.activeId,route:J.route,relay:J.relay,fastMode:J.fastMode,cacheKeep:J.cacheKeep,lastUpdated:Math.max(B.lastUpdated,J.lastUpdated)}}$=p($),j=await e(Z,$,X.ownsLock)}finally{await X.release()}if(j==="lock-lost-after-rename"){if(Y){O.warn("sidebar","post-rename repair lost lock; write skipped",{stateFile:Z});return}O.warn("sidebar","state lock lost after rename; repairing write",{stateFile:Z});continue}if(j==="lock-lost-before-rename")return;V.onRoutingResolved?.({activeId:$.activeId,route:$.route});return}}).catch(()=>{}),q}async function CJ(){return q}function qJ(J){let Z=J.activeId;if(Z&&Z!=="main"){let V=J.fallbacks?.find((x)=>x.enabled&&x.id===Z);if(V)return{id:V.id,name:V.label??V.id,quota:V.quota}}return{id:"main",name:"main",quota:J.main?.quota??null}}function JJ(J){let Z=J.replace(/\s+only$/i,"").trim();return/^fable$/i.test(Z)?"Fa":Z}function f(J){if(J==="claude-mythos-5-1"||J?.startsWith("claude-mythos-5-1-"))return"Mythos 5.1";if(J==="claude-fable-5-1"||J?.startsWith("claude-fable-5-1-"))return"Fable 5.1";if(J==="claude-fable-5"||J?.startsWith("claude-fable-5-"))return"Fable 5";if(J==="claude-opus-5-5"||J?.startsWith("claude-opus-5-5-"))return"Opus 5.5";if(J==="claude-opus-5"||J?.startsWith("claude-opus-5-"))return"Opus 5";if(J==="claude-opus-4-8"||J?.startsWith("claude-opus-4-8-"))return"Opus 4.8";return J??"Fable 5"}function D(J){return new Date(J).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function ZJ(J){if(J===0)return"0";if(J<0.0001)return J.toExponential(2);return J.toFixed(Math.min(6,Math.max(0,4)))}function WJ(J){if(J.lastResult==="error")return{text:"err",hasError:!0};if(J.lastResult==="skipped")return{text:"skip",hasError:!1};if(J.nextDueAt&&J.nextDueAt>Date.now())return{text:D(J.nextDueAt),hasError:!1};if(J.lastPrimedAt)return{text:`primed ${D(J.lastPrimedAt)} ✓`,hasError:!1};if(J.usage?.count)return{text:`✓ ${J.usage.count} ≈ $${ZJ(J.estimatedCostUsd??0)}`,hasError:!1};return{text:"—",hasError:!1}}function hJ(J,Z){let V=J.fableRecoveries?.find((x)=>x.sessionId===Z);if(!V)return;if(V.mode==="fable")return`${f(V.requestedModelId)} · restored`;if(V.mode==="server")return`${f(V.requestedModelId)}→${f(V.targetModelId)} · safety`;return`Opus 4.8 · ${V.remaining} left`}function fJ(J){let Z=J?.five_hour?.usedPercent??null,V=J?.seven_day?.usedPercent??null,x=J?.scoped??[],Y=x.map((j)=>j.usedPercent);if(Z==null&&V==null&&x.length===0)return{fiveHourUsedPercent:Z,sevenDayUsedPercent:V,scopedUsedPercents:Y,text:null};let X=x.map((j)=>`${JJ(j.title)}: ${Math.round(j.usedPercent)}%`),$=Z==null&&V==null?[]:[`5h: ${Z==null?"—":`${Math.round(Z)}%`}`,`7d: ${V==null?"—":`${Math.round(V)}%`}`];return{fiveHourUsedPercent:Z,sevenDayUsedPercent:V,scopedUsedPercents:Y,text:[...$,...X].join(" ")}}var HJ=18000000,UJ=604800000,$J=300000,VJ=0.01,XJ=1;function LJ(J,Z,V){if(!J.resetsAt)return null;let x=new Date(J.resetsAt).getTime();if(!Number.isFinite(x))return null;let Y=x-Z,X=V-Y;if(X<$J)return null;if(X<Z*VJ)return null;if(X>=Z)return null;let $=J.usedPercent,j=Math.min(Math.max(X/Z*100,0),100),B=$-j,G=Math.abs(B)<XJ?"on-pace":B>0?"deficit":"reserve",Q=null;if($>0){let N=X*100/$,_=Y+N;if(_<x)Q=new Date(_).toISOString()}return{pacePercent:j,deltaPercent:B,state:G,runsOutAt:Q}}
2
+ export{E as h,C as i,p as j,QJ as k,BJ as l,OJ as m,NJ as n,b as o,zJ as p,CJ as q,qJ as r,JJ as s,f as t,D as u,ZJ as v,WJ as w,hJ as x,fJ as y,HJ as z,UJ as A,LJ as B};
@@ -0,0 +1 @@
1
+ import{$ as la,$a as lb,$b as lc,$c as ld,$d as le,$e as mf,$f as mg,Aa as Ma,Ab as Mb,Ac as Mc,Ad as Md,Ae as Me,Af as Nf,Ag as Ng,Ba as Na,Bb as Nb,Bc as Nc,Bd as Nd,Be as Ne,Bf as Of,C as B,Ca as Oa,Cb as Ob,Cc as Oc,Cd as Od,Ce as Oe,Cf as Pf,D as P,Da as Pa,Db as Pb,Dc as Pc,Dd as Pd,De as Pe,Df as Qf,E as Q,Ea as Qa,Eb as Qb,Ec as Qc,Ed as Qd,Ee as Qe,Ef as Rf,F as R,Fa as Ra,Fb as Rb,Fc as Rc,Fd as Rd,Fe as Re,Ff as Sf,G as S,Ga as Sa,Gb as Sb,Gc as Sc,Gd as Sd,Ge as Se,Gf as Tf,H as T,Ha as Ta,Hb as Tb,Hc as Tc,Hd as Td,He as Te,Hf as Uf,I as U,Ia as Ua,Ib as Ub,Ic as Uc,Id as Ud,Ie as Ue,If as Vf,J as V,Ja as Va,Jb as Vb,Jc as Vc,Jd as Vd,Je as Ve,Jf as Wf,K as W,Ka as Wa,Kb as Wb,Kc as Wc,Kd as Wd,Ke as We,Kf as Xf,L as X,La as Xa,Lb as Xb,Lc as Xc,Ld as Xd,Le as Xe,Lf as Yf,M as Y,Ma as Ya,Mb as Yb,Mc as Yc,Md as Yd,Me as Ye,Mf as Zf,N as Z,Na as Za,Nb as Zb,Nc as Zc,Nd as Zd,Ne as Ze,Nf as _f,O as _,Oa as _a,Ob as _b,Oc as _c,Od as _d,Oe as _e,Of as $f,P as $,Pa as $a,Pb as $b,Pc as $c,Pd as $d,Pe as $e,Pf as ag,Q as aa,Qa as ab,Qb as ac,Qc as ad,Qd as ae,Qe as af,Qf as bg,R as ba,Ra as bb,Rb as bc,Rc as bd,Rd as be,Re as bf,Rf as cg,S as ca,Sa as cb,Sb as cc,Sc as cd,Sd as ce,Se as cf,Sf as dg,T as da,Ta as db,Tb as dc,Tc as dd,Td as de,Te as df,Tf as eg,U as ea,Ua as eb,Ub as ec,Uc as ed,Ud as ee,Ue as ef,Uf as fg,V as fa,Va as fb,Vb as fc,Vc as fd,Vd as fe,Ve as ff,Vf as gg,W as ga,Wa as gb,Wb as gc,Wc as gd,Wd as ge,We as gf,Wf as hg,X as ha,Xa as hb,Xb as hc,Xc as hd,Xd as he,Xe as hf,Xf as ig,Y as ia,Ya as ib,Yb as ic,Yc as id,Yd as ie,Ye as jf,Yf as jg,Z as ja,Za as jb,Zb as jc,Zc as jd,Zd as je,Ze as kf,Zf as kg,_ as ka,_a as kb,_b as kc,_c as kd,_d as ke,_e as lf,_f as lg,aa as ma,ab as mb,ac as mc,ad as md,ae as me,af as nf,ag as ng,ba as na,bb as nb,bc as nc,bd as nd,be as ne,bf as of,bg as og,ca as oa,cb as ob,cc as oc,cd as od,ce as oe,cf as pf,cg as pg,da as pa,db as pb,dc as pc,dd as pd,de as pe,df as qf,dg as qg,ea as qa,eb as qb,ec as qc,ed as qd,ee as qe,ef as rf,eg as rg,fa as ra,fb as rb,fc as rc,fd as rd,fe as re,ff as sf,fg as sg,ga as sa,gb as sb,gc as sc,gd as sd,ge as se,gf as tf,gg as tg,ha as ta,hb as tb,hc as tc,hd as td,he as te,hf as uf,hg as ug,ia as ua,ib as ub,ic as uc,id as ud,ie as ue,if as vf,ig as vg,ja as va,jb as vb,jc as vc,jd as vd,je as ve,jf as wf,jg as wg,ka as wa,kb as wb,kc as wc,kd as wd,ke as we,kf as xf,kg as xg,la as xa,lb as xb,lc as xc,ld as xd,le as xe,lf as yf,lg as yg,ma as ya,mb as yb,mc as yc,md as yd,me as ye,mf as zf,mg as zg,na as za,nb as zb,nc as zc,nd as zd,ne as ze,nf as Af,ng as Ag,oa as Aa,ob as Ab,oc as Ac,od as Ad,oe as Ae,of as Bf,og as Bg,pa as Ba,pb as Bb,pc as Bc,pd as Bd,pe as Be,pf as Cf,pg as Cg,qa as Ca,qb as Cb,qc as Cc,qd as Cd,qe as Ce,qf as Df,qg as Dg,ra as Da,rb as Db,rc as Dc,rd as Dd,re as De,rf as Ef,rg as Eg,sa as Ea,sb as Eb,sc as Ec,sd as Ed,se as Ee,sf as Ff,sg as Fg,ta as Fa,tb as Fb,tc as Fc,td as Fd,te as Fe,tf as Gf,tg as Gg,ua as Ga,ub as Gb,uc as Gc,ud as Gd,ue as Ge,uf as Hf,ug as Hg,va as Ha,vb as Hb,vc as Hc,vd as Hd,ve as He,vf as If,vg as Ig,wa as Ia,wb as Ib,wc as Ic,wd as Id,we as Ie,wf as Jf,wg as Jg,xa as Ja,xb as Jb,xc as Jc,xd as Jd,xe as Je,xf as Kf,xg as Kg,ya as Ka,yb as Kb,yc as Kc,yd as Kd,ye as Ke,yf as Lf,yg as Lg,za as La,zb as Lb,zc as Lc,zd as Ld,ze as Le,zf as Mf,zg as Mg}from"./index-1fq7h6yd.js";import{$g as A,Bg as a,Cg as b,Dg as c,Eg as d,Fg as e,Gg as f,Hg as g,Ig as h,Jg as i,Kg as j,Lg as k,Mg as l,Ng as m,Og as n,Pg as o,Qg as p,Rg as q,Sg as r,Tg as s,Ug as t,Vg as u,Wg as v,Xg as w,Yg as x,Zg as y,_g as z,ah as C,bh as D,ch as E,dh as F,eh as G,fh as H,gh as I,hh as J,ih as K,jh as L,kh as M,lh as N,mh as O}from"./index-a5d6v3ba.js";import"./index-n96q8pks.js";export{md as writeDumpFile,za as writeCustodyHandleManifestEntryLocked,xa as writeCustodyHandleManifestEntry,wa as withCustodyManifestLock,xf as usesMidConversationOutputConfig,sc as upsertAccount,Oa as tokenFingerprint,nd as sweepDumpDirectory,Wc as stripBillingLineageFromBody,Vc as stripBillingLineageFields,Eg as stickyRouteKnownFableExhausted,Cg as stickyRouteFamilyForModel,Dg as stickyRouteCandidateWeight,Hg as stickyRetryAfterWithJitter,Bg as stickyQuotaSnapshotIsFresh,Sc as signRequestBody,Ib as shouldFallbackStatus,F as shouldEmit,qg as setRoutingMode,Fb as setPrimePersistentEnabled,Yb as setLogLevelPersistent,D as setLogLevel,lc as setKillswitchPersistent,yb as setFastModePersistentEnabled,ye as setFastModeEnabled,wb as setDumpPersistentEnabled,jd as setDumpEnabled,ib as setClaustrumModePersistent,Db as setCacheKeepSubagentsEnabled,zb as setCacheKeepPersistentWindow,Bb as setCacheKeepPersistentEnabled,Ab as setCacheKeepPersistentAlways,Ec as setCache1hState,ub as setCache1hPersistentMode,tb as setCache1hPersistentEnabled,Dc as setCache1hMode,Cc as setCache1hEnabled,Xc as setBounded,oc as setAccountEnabledPersistent,xc as setAccountEnabled,kg as sendViaRelay,dd as selectClaudeCodeBetas,ob as saveOAuthProfileState,kb as saveAccounts,nb as saveAccountState,T as resolveCustodyHandlesPath,ga as resolveCustodyHandle,S as resolveClaustrumConnectionPath,$c as resolveClaudeCodeIdentity,ze as resetFastModeState,kd as resetDumpState,ae as resetClaustrumEnrollmentState,Zc as resetClaudeCodeIdentityCachesForTest,Fc as resetCache1hState,Qc as resetBillingHeaderCCH,nc as reorderAccountsPersistent,wc as reorderAccounts,ya as removeCustodyHandleManifestEntry,mc as removeAccountPersistent,vc as removeAccount,Af as remapRequestBodyModel,zf as remapModelId,O as relayLog,fe as refreshClaustrumScopedRoster,La as refreshClaudeOAuthToken,Pb as refreshBackoffActive,J as redactPayload,ha as readCustodyHandles,_d as readClaustrumEnrollmentToken,Zd as readClaustrumEnrollmentStatus,cc as quotaSnapshotPassesPolicy,bc as quotaSnapshotPassesModelScope,ac as quotaSnapshotModelScopeIsExhausted,dc as quotaSnapshotHasStandardWindows,db as quotaSnapshotCheckedAt,eb as quotaFieldSource,Ub as quotaBackoffActive,ee as projectClaustrumScopedRoster,Qf as primeStorageFingerprint,Tf as primeMarkerPath,Rf as primeMarkerNamespaceDir,Mf as primeIsEligible,Nf as primeEligibilityReasonLabel,Sf as primeAccountMarkerDir,tc as persistFallbackQuotaHeaderPersistent,rg as parseRoutingCommandAction,Ja as parseRetryAfterHeader,Hf as parsePrimeCommandAction,Ie as parseLoggingCommandAction,C as parseLogLevel,vg as parseLaneStartCommandAction,Ee as parseKillswitchCommandAction,B as parseJsonRedacted,Ae as parseFastModeCommandAction,od as parseDumpCommandAction,ue as parseCustomHeaders,Fd as parseCacheKeepCommandAction,Gc as parseCache1hCommandAction,oe as parseAccountCommandAction,fd as orderClaudeCodeBody,ie as oauthProfileMatchesIdentity,je as oauthProfileIsFresh,$f as normalizeQuotaHeaders,fc as normalizeKillswitchThresholds,Qe as normalizeAnthropicModelId,wf as normalizeAdaptiveEffort,lb as mutateAccountsPersistent,bb as mergeMainRefreshErrorClearedAt,ab as mergeMainQuotaErrorClearedAt,ag as mergeHeaderQuotaSnapshot,fb as mergeHeaderQuotaForPersistence,l as mergeAnthropicBetas,M as logger,N as log,Md as localDayKey,cb as loadAccounts,jc as killswitchRetryAfterSeconds,ic as killswitchPassesPolicy,Kd as isWithinCacheKeepWindow,ca as isValidCustodyLabel,da as isValidCustodyHandle,Kc as isValidBillingPromptId,Wa as isValidApiBaseURL,Jc as isValidAnthropicRequestId,I as isSecretKey,Sb as isQuotaPolicyAuthError,_f as isQuotaBearingHeaderFrame,Eb as isPrimePersistentlyEnabled,Ob as isPermanentRefreshError,uf as isOpenAIReasoningSignature,hb as isOAuthAccountVaultOwned,Ua as isOAuthAccount,gc as isKillswitchEnabled,m as isFastModeSupportedModel,xb as isFastModePersistentlyEnabled,xe as isFastModeEnabled,vb as isDumpPersistentlyEnabled,id as isDumpEnabled,Z as isCustodyTombstoneValue,_ as isCustodyTombstoneOAuth,Xa as isCostZeroingEnabled,hf as isClaudeSonnet5Model,lf as isClaudeOpus5Model,tf as isClaudeOpus5FamilyModel,sf as isClaudeOpus55Model,bf as isClaudeFableOrMythos5Model,cf as isClaudeFableOrMythos51Model,df as isClaudeFable51Model,Cb as isCacheKeepSubagentsEnabled,Id as isCacheKeepPersistentlyEnabled,Jd as isCacheKeepHybridActive,Hd as isCacheKeepAlways,Ld as isCacheKeepActiveNow,rb as isCache1hPersistentlyEnabled,Ac as isCache1hEnabled,Va as isApiKeyAccount,Hb as incrementPrimeUsagePersistent,Mb as hashRefreshToken,ig as hashBody,Ng as hasThinkingBindingControls,Lg as hasReplayableThinkingBlocks,Ta as hasNoLocalCredential,Kg as getThinkingPrefixMismatchBehavior,Gg as getStickyRoutingStatePath,$b as getScopedQuotaWindowForModel,pg as getRoutingMode,gg as getRelayConfig,Lb as getRefreshIntervalMs,Kb as getRefreshBeforeExpiryMs,_b as getQuotaRefreshEveryNRequests,qc as getQuotaNextRefreshAt,Jb as getQuotaMinimumRemainingThresholds,Wb as getQuotaCheckIntervalMs,Zb as getPersistedMainQuota,Xb as getPersistedLogLevel,Gb as getOrCreatePrimeAuthLineageId,mb as getOrCreateMainAccountId,E as getLogLevel,G as getLogFilePath,hc as getKillswitchThresholdsForAccount,kc as getKillswitchConfig,be as getHostClaustrumEnrollmentPaths,Rb as getFallbackReauthLabels,ld as getDumpDirectory,Xf as getDefaultQuotaHeaderFeedDirectory,U as getDefaultClaustrumHandlesPath,R as getDefaultClaustrumConnectionPath,Sd as getDefaultCacheKeepRegistryDirectory,gb as getClaustrumMode,Yd as getClaustrumEnrollmentPaths,ef as getClaudeFableMythos5ReleaseDate,_c as getClaudeCodeIdentityForVerifiedAccount,Yc as getClaudeCodeIdentity,Gd as getCacheKeepWindow,sb as getCache1hPersistentMode,Bc as getCache1hMode,Za as getAccountStoragePath,_a as getAccountStatePath,hg as generateRelayToken,Ia as generatePKCE,Qb as formatRefreshBackoffMessage,dg as formatQuotaMoney,Vb as formatQuotaBackoffMessage,ke as formatOAuthAccountTier,K as formatLogLine,qe as formatEnrollmentStatus,Q as findExistingClaustrumConnectionPath,rc as fetchOAuthQuotaSnapshot,he as fetchOAuthAccountProfile,uc as fallbackAccountUuidForLineage,Mc as extractFirstUserMessageText,Rc as extractBillingHeaderCCH,tg as executeRoutingCommand,Lf as executePrimeCommand,Ke as executeLoggingCommand,wg as executeLaneStartCommand,Fe as executeKillswitchCommand,Ce as executeFastModeCommand,qd as executeDumpCommand,Od as executeCacheKeepCommand,Ic as executeCache1hCommand,se as executeAccountCommand,Na as exchange,If as estimatePrimeCostUsd,td as dumpResponseArtifact,sd as dumpRelayRequest,rd as dumpDirectRequest,V as detectClaustrumConnection,Fg as decideStickyQuotaFailure,Y as custodyTombstoneOAuth,X as custodyTombstoneKey,pe as custodyStatusLabel,fa as custodyCredentialIdFromResolution,ea as custodyCredentialId,jg as createStringPatch,Ag as createStickyNoRouteResponse,$a as createEmptyStorage,le as connectClaustrumScopedClient,Xd as connectClaustrumEnrollmentClient,Ha as connectClaustrumCredentialCache,Ba as connectClaustrumClient,Yf as configuredAnthropicOAuthAccountCount,Pc as computeXxhash64Hex,Tc as computeCcVersionSuffix,Oc as computeCCH,pb as clearClaustrumRefreshErrorPersistent,jb as clearClaustrumHandlePersistent,gd as claudeCodeEntrypoint,sg as buildRoutingStatusSummary,Nb as buildRefreshOperationError,Tb as buildQuotaOperationError,Kf as buildPrimeStatusSummary,Pf as buildPrimeRequestBody,Jf as buildPrimeAccountStatuses,Je as buildLoggingStatusSummary,Be as buildFastModeStatusSummary,eg as buildFallbackQuotaSummaries,pd as buildDumpStatusSummary,fg as buildClaudeQuotaSummary,ad as buildClaudeCodeMetadataUserId,Nd as buildCacheKeepStatusSummary,Pd as buildCacheKeepPrewarmBody,Hc as buildCache1hStatusSummary,Uc as buildBillingHeaderValue,re as buildAccountList,Ma as authorize,ba as assertNotCustodyTombstone,Mg as applyThinkingBindingControls,yf as applyMidConversationOutputConfig,ve as applyCustomHeaders,bd as applyClaudeCodeMetadata,ed as applyClaudeCodeHeaders,ce as adoptClaustrumEnrollment,pc as addAccountPersistent,qb as acquireRefreshFileLock,L as __setLogTestSink,pa as __setCustodyManifestLockTestOptions,va as __deriveCustodyManifestStaleLockPrefix,lg as WORKER_SCRIPT,w as USER_AGENT,i as TOOL_PREFIX,d as TOKEN_URL,Jg as THINKING_BINDING_CONTROLS_BETA,A as TEXT_REPLACEMENTS,Ig as StickySessionRouter,yg as STICKY_ROUTING_SHORT_RESET_GRACE_MS,xg as STICKY_ROUTING_MAIN_ACCOUNT_ID,zg as STICKY_ROUTING_ASSIGNMENT_TTL_MS,H as SECRET_KEY_EXACT,ng as ROUTING_MODES,j as REQUIRED_BETAS,h as REFRESH_SCOPE,bg as QuotaManager,Zf as QuotaHeaderFeedRegistry,Ra as QUOTA_URL,Vf as QUOTA_HEADER_FEED_SCHEMA_VERSION,Wf as QUOTA_HEADER_FEED_LEASE_MS,Sa as QUOTA_FIELD_NAMES,Uf as PrimeManager,ge as PROFILE_TTL_MS,P as PRODUCTION_CLAUSTRUM_CONNECTION_FILE_NAME,Cf as PRIME_TICK_MS,Of as PRIME_REQUEST_BODY,Ff as PRIME_POST_FIRE_REFRESH_MS,Ef as PRIME_MARKER_MAX_AGE_MS,Df as PRIME_DUE_OFFSET_MS,Gf as PRIME_CHECK_THROTTLE_MS,p as PARALLEL_TOOL_CALLS_SYSTEM_PROMPT,z as PARAGRAPH_REMOVAL_ANCHORS,n as OPENCODE_IDENTITY_PREFIX,g as OAUTH_SCOPES,vf as MID_CONVERSATION_OUTPUT_CONFIG_BETA,He as LOGGING_LEVELS,De as KILLSWITCH_COMMAND_NAME,yc as FallbackAccountManager,k as FAST_MODE_BETA,Ya as FALLBACK_BACKGROUND_TICK_MS,Ea as ERROR_CLASS_WIRE_SET,og as DEFAULT_ROUTING_MODE,ec as DEFAULT_KILLSWITCH_THRESHOLDS,Da as DEFAULT_CLAUSTRUM_CREDENTIAL_MIN_TTL_MS,y as DEFAULT_CACHE_1H_MODE,$ as CustodyTombstoneRefreshError,aa as CustodyTombstoneLoginError,ja as CustodyManifestSelectionError,ta as CustodyManifestLockOwnerInvalidError,ua as CustodyManifestLockLeaseLostError,ra as CustodyManifestLockError,sa as CustodyManifestLockBusyError,ka as CustodyHandleManifestReader,me as ClaustrumScopedRuntime,de as ClaustrumScopedCustody,Ud as ClaustrumScopedCredentialError,$d as ClaustrumEnrollmentManager,Fa as ClaustrumCredentialError,Ga as ClaustrumCredentialCache,Aa as ClaustrumClient,Ka as ClaudeOAuthRefreshError,Nc as ClaudeCodeFirstUserTextTracker,Td as CacheKeepSessionRegistry,Qd as CacheKeepManager,W as CUSTODY_TOMBSTONE_PREFIX,ia as CUSTODY_MANIFEST_SELECTION_ERROR_CODES,la as CUSTODY_MANIFEST_LOCK_TTL_MS,na as CUSTODY_MANIFEST_LOCK_RETRY_MIN_MS,oa as CUSTODY_MANIFEST_LOCK_RETRY_MAX_MS,ma as CUSTODY_MANIFEST_LOCK_RENEW_MS,qa as CUSTODY_MANIFEST_LOCK_ERROR_CODES,e as CUSTODY_HANDLE_PATTERN,c as CODE_CALLBACK_URL,a as CLIENT_ID,Wd as CLAUSTRUM_PI_ENROLLMENT_NAME,Vd as CLAUSTRUM_OPENCODE_ENROLLMENT_NAME,Ca as CLAUSTRUM_MODULE_ID,ug as CLAUDE_START_COMMAND_NAME,ff as CLAUDE_SONNET_5_MODEL_ID,gf as CLAUDE_SONNET_5_ADAPTIVE_THINKING,mg as CLAUDE_ROUTING_COMMAND_NAME,cg as CLAUDE_QUOTAS_COMMAND_NAME,Bf as CLAUDE_PRIME_COMMAND_NAME,jf as CLAUDE_OPUS_5_MODEL_ID,kf as CLAUDE_OPUS_5_ADAPTIVE_THINKING,nf as CLAUDE_OPUS_5_5_RELEASE_DATE,qf as CLAUDE_OPUS_5_5_PRICING,mf as CLAUDE_OPUS_5_5_MODEL_ID,pf as CLAUDE_OPUS_5_5_MAX_OUTPUT_TOKENS,of as CLAUDE_OPUS_5_5_CONTEXT_WINDOW,rf as CLAUDE_OPUS_5_5_ADAPTIVE_THINKING,Me as CLAUDE_MYTHOS_5_MODEL_ID,Oe as CLAUDE_MYTHOS_5_1_MODEL_ID,Ge as CLAUDE_LOGGING_COMMAND_NAME,Re as CLAUDE_HAIKU_4_5_PRICING,Pe as CLAUDE_HAIKU_4_5_MODEL_ID,we as CLAUDE_FAST_COMMAND_NAME,Ue as CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING,Ze as CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE,Ve as CLAUDE_FABLE_MYTHOS_5_PRICING,$e as CLAUDE_FABLE_MYTHOS_5_MODEL_SPECS,Te as CLAUDE_FABLE_MYTHOS_5_MODEL_IDS,Ye as CLAUDE_FABLE_MYTHOS_5_MAX_OUTPUT_TOKENS,Xe as CLAUDE_FABLE_MYTHOS_5_CONTEXT_WINDOW,_e as CLAUDE_FABLE_MYTHOS_5_1_RELEASE_DATE,We as CLAUDE_FABLE_MYTHOS_5_1_PRICING,af as CLAUDE_FABLE_MYTHOS_5_1_MODEL_SPECS,Se as CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS,Le as CLAUDE_FABLE_5_MODEL_ID,Ne as CLAUDE_FABLE_5_1_MODEL_ID,hd as CLAUDE_DUMP_COMMAND_NAME,s as CLAUDE_CODE_VERSION,v as CLAUDE_CODE_STAINLESS_RUNTIME_VERSION,u as CLAUDE_CODE_STAINLESS_PACKAGE_VERSION,o as CLAUDE_CODE_IDENTITY,cd as CLAUDE_CODE_FULL_AGENT_BETAS,t as CLAUDE_CODE_ENTRYPOINT,ud as CLAUDE_CACHE_KEEP_COMMAND_NAME,ne as CLAUDE_ACCOUNT_COMMAND_NAME,q as CCH_SALT,r as CCH_POSITIONS,Lc as CCH_PATTERN,vd as CACHE_KEEP_TTL_MS,xd as CACHE_KEEP_TICK_MS,Dd as CACHE_KEEP_RETRY_MAX_MS,Ed as CACHE_KEEP_RETRY_JITTER_MAX_MS,Cd as CACHE_KEEP_RETRY_BASE_MS,Rd as CACHE_KEEP_REGISTRY_LEASE_MS,Bd as CACHE_KEEP_PREWARM_TIMEOUT_MS,wd as CACHE_KEEP_PREWARM_LEAD_MS,zd as CACHE_KEEP_MAX_TARGETS,Ad as CACHE_KEEP_MAX_BODY_BYTES,yd as CACHE_KEEP_EXTENDED_TTL_BETA,x as CACHE_1H_MODES,zc as CACHE_1H_COMMAND_NAME,f as AXIOS_USER_AGENT,b as AUTHORIZE_URLS,te as ANTHROPIC_CUSTOM_HEADERS_ENV,Qa as ACCOUNT_STATE_FILE_NAME,Pa as ACCOUNT_FILE_NAME};