howtofixcli 0.7.7 → 0.7.9

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 (152) hide show
  1. package/dist/chunk-27TRKD65.js +2 -0
  2. package/dist/chunk-3FYCFLNK.js +1 -0
  3. package/dist/chunk-56SEAGAQ.js +1 -0
  4. package/dist/chunk-63ZCQDXH.js +6 -0
  5. package/dist/chunk-6FUWMLWO.js +1 -0
  6. package/dist/chunk-7CHDNTH6.js +1 -0
  7. package/dist/chunk-ACOMNDUL.js +185 -0
  8. package/dist/chunk-AEVPET7X.js +2 -0
  9. package/dist/chunk-AGGIYXN7.js +2 -0
  10. package/dist/chunk-BHVBO4SC.js +1 -0
  11. package/dist/chunk-FPXVDP32.js +8 -0
  12. package/dist/chunk-GIUYIKH3.js +109 -0
  13. package/dist/chunk-GQCAJ56I.js +5 -0
  14. package/dist/chunk-GXB7RZHH.js +1 -0
  15. package/dist/chunk-IGEY3AWF.js +1 -0
  16. package/dist/chunk-ILDDDLRC.js +1 -0
  17. package/dist/chunk-JFYVRWJI.js +2 -0
  18. package/dist/chunk-MVLCGU3G.js +1 -0
  19. package/dist/chunk-N345KWWK.js +1 -0
  20. package/dist/chunk-NBQFPCRT.js +1 -0
  21. package/dist/chunk-OIPSLIZE.js +5 -0
  22. package/dist/chunk-ORJ2QZBG.js +3 -0
  23. package/dist/chunk-PCALBZOO.js +2 -0
  24. package/dist/chunk-PDNBGUYP.js +2 -0
  25. package/dist/chunk-S656RE4A.js +1 -0
  26. package/dist/chunk-TSEKPGK4.js +1 -0
  27. package/dist/chunk-U6CI6KXN.js +34 -0
  28. package/dist/chunk-UTYFLLSM.js +1 -0
  29. package/dist/chunk-V3R4FYTJ.js +1 -0
  30. package/dist/chunk-V656XVXV.js +8 -0
  31. package/dist/chunk-WKUJ7CFO.js +1 -0
  32. package/dist/chunk-WOT6VMZA.js +1 -0
  33. package/dist/chunk-WUPU6LTD.js +4 -0
  34. package/dist/chunk-WX3V5P7U.js +5 -0
  35. package/dist/chunk-ZKZ6WCI3.js +2 -0
  36. package/dist/main.js +94 -536
  37. package/package.json +15 -62
  38. package/dist/account-credential.js +0 -136
  39. package/dist/account-credential.test.js +0 -38
  40. package/dist/activity.js +0 -124
  41. package/dist/agent-defs.js +0 -237
  42. package/dist/agent-limiter.js +0 -68
  43. package/dist/agents.js +0 -554
  44. package/dist/anim.js +0 -361
  45. package/dist/args.js +0 -228
  46. package/dist/at-file.js +0 -28
  47. package/dist/brand-extension.js +0 -87
  48. package/dist/brand.js +0 -76
  49. package/dist/browser.js +0 -58
  50. package/dist/cache-report.js +0 -139
  51. package/dist/checkpoint.js +0 -437
  52. package/dist/claims.js +0 -167
  53. package/dist/cli-auth.js +0 -142
  54. package/dist/cli-checkin.js +0 -116
  55. package/dist/cli-credentials.js +0 -254
  56. package/dist/clipboard.js +0 -149
  57. package/dist/collapse.js +0 -129
  58. package/dist/commands.js +0 -301
  59. package/dist/compaction-guard.js +0 -81
  60. package/dist/context-extension.js +0 -17
  61. package/dist/dcp/commands.js +0 -172
  62. package/dist/dcp/compress-state.js +0 -139
  63. package/dist/dcp/compress.js +0 -329
  64. package/dist/dcp/dcp-extension.js +0 -288
  65. package/dist/dcp/dedup.js +0 -93
  66. package/dist/dcp/ids.js +0 -189
  67. package/dist/dcp/index.js +0 -25
  68. package/dist/dcp/prompts.js +0 -68
  69. package/dist/dcp/protected-content.js +0 -221
  70. package/dist/dcp/protected.js +0 -161
  71. package/dist/dcp/prune.js +0 -418
  72. package/dist/dcp/state.js +0 -176
  73. package/dist/device-id.js +0 -90
  74. package/dist/device-id.test.js +0 -23
  75. package/dist/errors.js +0 -63
  76. package/dist/extensions.js +0 -48
  77. package/dist/fatal.js +0 -35
  78. package/dist/feed.js +0 -498
  79. package/dist/fs-atomic.js +0 -54
  80. package/dist/gateway-errors.js +0 -90
  81. package/dist/git.js +0 -230
  82. package/dist/goal-extension.js +0 -88
  83. package/dist/goal.js +0 -222
  84. package/dist/hooks-extension.js +0 -176
  85. package/dist/hooks.js +0 -443
  86. package/dist/howtofix-account.js +0 -715
  87. package/dist/hud-line.js +0 -153
  88. package/dist/hwid.js +0 -130
  89. package/dist/interrupt.js +0 -60
  90. package/dist/json-events.js +0 -50
  91. package/dist/level-style.js +0 -112
  92. package/dist/loop-guard.js +0 -95
  93. package/dist/lsp-tools.js +0 -32
  94. package/dist/lsp.js +0 -347
  95. package/dist/mcp-config.js +0 -85
  96. package/dist/mcp-lifecycle.js +0 -147
  97. package/dist/model-catalog.js +0 -217
  98. package/dist/model-resolve.js +0 -65
  99. package/dist/notes.js +0 -78
  100. package/dist/oauth-login.js +0 -568
  101. package/dist/paths.js +0 -61
  102. package/dist/permissions.js +0 -298
  103. package/dist/plan-mode.js +0 -363
  104. package/dist/preset-command.js +0 -227
  105. package/dist/preset-extension.js +0 -35
  106. package/dist/preset-mcp.js +0 -292
  107. package/dist/presets.js +0 -727
  108. package/dist/prompt-files.js +0 -103
  109. package/dist/prompt-text.js +0 -41
  110. package/dist/proxy.js +0 -137
  111. package/dist/quality/ast.js +0 -196
  112. package/dist/quality/cognitive.js +0 -83
  113. package/dist/quality/cyclomatic.js +0 -30
  114. package/dist/quality/halstead.js +0 -83
  115. package/dist/quality/index.js +0 -18
  116. package/dist/quality/length.js +0 -3
  117. package/dist/quality/maintainability.js +0 -15
  118. package/dist/quality/nesting.js +0 -57
  119. package/dist/quality/report.js +0 -803
  120. package/dist/quality/smells.js +0 -67
  121. package/dist/quality-tool.js +0 -63
  122. package/dist/read-only-commands.js +0 -597
  123. package/dist/repo-map.js +0 -292
  124. package/dist/rtk.js +0 -193
  125. package/dist/sandbox.js +0 -105
  126. package/dist/schema.js +0 -214
  127. package/dist/session-lifecycle.js +0 -19
  128. package/dist/session-retention.js +0 -111
  129. package/dist/session.js +0 -446
  130. package/dist/sessions.js +0 -100
  131. package/dist/settings.js +0 -148
  132. package/dist/skills.js +0 -35
  133. package/dist/slop-tool.js +0 -96
  134. package/dist/spend-cap.js +0 -43
  135. package/dist/subagent.js +0 -171
  136. package/dist/tar.js +0 -146
  137. package/dist/theme.js +0 -79
  138. package/dist/thinking.js +0 -45
  139. package/dist/todo.js +0 -114
  140. package/dist/tool-loadout.js +0 -97
  141. package/dist/tool-render.js +0 -769
  142. package/dist/tools.js +0 -176
  143. package/dist/ui.js +0 -4751
  144. package/dist/update.js +0 -533
  145. package/dist/usage-segment.js +0 -69
  146. package/dist/web-tools.js +0 -46
  147. package/dist/web.js +0 -265
  148. package/dist/welcome.js +0 -179
  149. package/dist/workflow-engine.js +0 -246
  150. package/dist/workflow-progress.js +0 -446
  151. package/dist/workflow-view.js +0 -195
  152. package/dist/workflow.js +0 -349
@@ -0,0 +1,2 @@
1
+ import{a as u}from"./chunk-UTYFLLSM.js";import{existsSync as l,mkdirSync as f,readFileSync as c}from"node:fs";import{dirname as p,join as m}from"node:path";var a={skipPermissions:!1,autoUpdate:!0,rightClickPaste:"auto",welcomeSeen:!1,compressToolOutput:!1};function g(t){return m(t,"settings.json")}function k(t){try{let e=JSON.parse(c(g(t),"utf8")),n=r=>{let i=e[r];return typeof i=="boolean"?i:a[r]},o=e.rightClickPaste;return{skipPermissions:n("skipPermissions"),autoUpdate:n("autoUpdate"),rightClickPaste:o==="on"||o==="off"||o==="auto"?o:a.rightClickPaste,welcomeSeen:n("welcomeSeen"),compressToolOutput:n("compressToolOutput"),...typeof e.agents=="number"&&Number.isInteger(e.agents)&&e.agents>0?{agents:e.agents}:{}}}catch{return{...a}}}function h(t,e,n){return s(t,e,n)}function w(t){return s(t,"welcomeSeen",!0)}function P(t,e){return s(t,"rightClickPaste",e==="auto"?void 0:e)}function y(t){return t==="on"?!0:t==="off"?!1:process.platform!=="win32"}function x(t,e){let n=typeof e=="number"&&Number.isInteger(e)&&e>0?e:void 0;return s(t,"agents",n)}function C(t,e,n){let o=n.trim();return s(t,e,o===""?void 0:o)}function s(t,e,n){let o=g(t),r={};try{let i=JSON.parse(c(o,"utf8"));i&&typeof i=="object"&&!Array.isArray(i)&&(r=i)}catch{if(l(o))return!1}n===void 0?delete r[e]:r[e]=n;try{f(p(o),{recursive:!0}),u(o,`${JSON.stringify(r,null,2)}
2
+ `)}catch{return!1}return!0}export{a,k as b,h as c,w as d,P as e,y as f,x as g,C as h};
@@ -0,0 +1 @@
1
+ import{readFileSync as u}from"node:fs";import{join as c}from"node:path";import{EnvHttpProxyAgent as p,ProxyAgent as l,getGlobalDispatcher as a,setGlobalDispatcher as s}from"undici";var f="httpsProxy";function d(n){let e;try{e=JSON.parse(u(c(n,"settings.json"),"utf8"))}catch{return}let r=e[f];if(typeof r!="string")return;let t=r.trim();return t===""?void 0:t}function m(){let e=(process.env.HTTPS_PROXY??process.env.HTTP_PROXY??process.env.ALL_PROXY)?.trim();return e||void 0}function g(n){let e=n.trim();if(e==="")return{ok:!1,problem:"empty"};let r;try{r=new URL(e)}catch{return{ok:!1,problem:`"${e}" is not a URL`}}let t=r.protocol.replace(/:$/,"").toLowerCase();return t!=="http"&&t!=="https"?{ok:!1,problem:`unsupported scheme "${t}"; use http:// or https://`}:r.hostname?{ok:!0,url:e}:{ok:!1,problem:"no host in the proxy URL"}}var i;function P(n){let e=()=>{i===void 0&&(i=a()),s(i)},r=d(n);if(r){let o=g(r);if(!o.ok)return{source:"settings"};try{s(new l(o.url))}catch{return e(),{source:"settings"}}return{url:o.url,source:"settings"}}let t=m();if(t){try{s(new p)}catch{return e(),{source:"env"}}return{url:t,source:"env"}}return e(),{source:"none"}}export{f as a,d as b,m as c,g as d,P as e};
@@ -0,0 +1 @@
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q}from"./chunk-JFYVRWJI.js";import"./chunk-WOT6VMZA.js";export{c as APPROVAL_LABELS,b as APPROVAL_MODES,f as MODE_MAX_TIER,e as TIER_RANK,q as createPermissionExtension,h as criticalCommand,n as decideToolCall,o as describeToolCall,p as formatApprovalPrompt,j as getApprovalMode,d as isApprovalMode,l as isDangerousBypass,a as isReadOnlyCommand,g as resolveTier,i as setApprovalMode,m as setApprovalPrompt,k as setDangerousBypass};
@@ -0,0 +1,6 @@
1
+ import{a as g}from"./chunk-UTYFLLSM.js";import{h as p,i as E}from"./chunk-ZKZ6WCI3.js";import{existsSync as L,mkdirSync as R,readFileSync as y}from"node:fs";import{join as w}from"node:path";var P="https://models.dev/api.json";var _=["anthropic","openai","google","deepseek","zai","xai","moonshotai","minimax","alibaba","xiaomi","meta","tencent","nvidia","venice","openrouter"];function h(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"")}function A(n){let s=n.split("/");return h(s[s.length-1]??n)}function F(n){let s=new Map,o=new Map;if(!n||typeof n!="object")return s;let t=n,e=a=>{let r=_.indexOf(a);return r===-1?_.length:r};for(let a of Object.keys(t).sort()){let r=t[a]?.models;if(!(!r||typeof r!="object"))for(let i of Object.keys(r)){let c=r[i],l=Number(c?.limit?.context);if(!Number.isFinite(l)||l<=0)continue;let u=h(i),d=e(a),f=o.get(u);if(f!==void 0&&f<=d)continue;let m=Number(c?.limit?.output);s.set(u,{contextWindow:Math.floor(l),maxTokens:Number.isFinite(m)&&m>0?Math.floor(m):void 0,reasoning:c?.reasoning===!0,vision:Array.isArray(c?.modalities?.input)&&c.modalities.input.includes("image")}),o.set(u,d)}}return s}function T(n,s){let o=h(s);if(!o)return;let t=n.get(o);if(t)return t;let e=A(s);for(let[a,r]of n)if(A(a)===e)return r;for(let[a,r]of n)if(a.endsWith(o)||o.endsWith(a))return r}function O(n){return`${n}/models-dev-cache.json`}function S(n){let s={};for(let[o,t]of n)s[o]=[t.contextWindow,t.maxTokens??0,t.reasoning?1:0,t.vision?1:0];return JSON.stringify(s)}function v(n){let s=new Map,o;try{o=JSON.parse(n)}catch{return s}if(!o||typeof o!="object")return s;for(let[t,e]of Object.entries(o)){if(!Array.isArray(e)||e.length<3)continue;let a=Number(e[0]),r=Number(e[1]);!Number.isFinite(a)||a<=0||s.set(t,{contextWindow:Math.floor(a),maxTokens:Number.isFinite(r)&&r>0?Math.floor(r):void 0,reasoning:e[2]===1||e[2]===!0,vision:e[3]===1||e[3]===!0})}return s}async function I(n){let s=n?.url??P,o=n?.fetchImpl??fetch,t=n?.timeoutMs??2e4,e=new AbortController,a=setTimeout(()=>e.abort(),t);try{let r=await o(s,{signal:e.signal,headers:{Accept:"application/json"}});if(!r.ok)return{ok:!1,message:`the model catalogue answered ${r.status}`};let i=F(await r.json());return i.size===0?{ok:!1,message:"the model catalogue was empty or in an unexpected shape"}:{ok:!0,index:i}}catch(r){return{ok:!1,message:r instanceof Error&&r.name==="AbortError"?`the model catalogue did not answer within ${Math.round(t/1e3)}s`:"could not reach the model catalogue"}}finally{clearTimeout(a)}}var x="https://api.howtofix.id/v1",te="https://howtofix.id/keys",M=["howtofix","howtofix-free"];function ne(){return{baseUrl:x,api:"openai-completions",headers:{[p]:E()}}}function oe(n){let s=w(n,"models.json"),o;try{o=JSON.parse(y(s,"utf8"))}catch{return 0}let t=o.providers;if(!t||typeof t!="object")return 0;let e=0;for(let a of M){let r=t[a];if(!r||!Array.isArray(r.models))continue;let i=B(r.models),c={...r.headers??{},[p]:E()},l=r.headers?.[p]!==c[p];i.changed===0&&!l||(r.models=i.models,r.headers=c,e+=i.changed===0?1:i.changed)}if(e===0)return 0;try{g(s,`${JSON.stringify(o,null,2)}
2
+ `)}catch{return 0}return e}var W=10080*60*1e3;async function $(n,s){let o=O(n),t=s?.now??Date.now(),e,a=0;try{let c=JSON.parse(y(o,"utf8"));typeof c?.entries=="string"&&(e=v(c.entries),a=Number(c.at)||0)}catch{e=void 0}if(e&&e.size>0&&t-a<W&&!s?.force)return{index:e};let i=await I({fetchImpl:s?.fetchImpl});if(!i.ok)return e&&e.size>0?{index:e,message:i.message}:{index:new Map,message:i.message};try{R(n,{recursive:!0}),g(o,`${JSON.stringify({at:t,entries:S(i.index)})}
3
+ `)}catch{}return{index:i.index}}async function re(n,s){let o=w(n,"models.json"),t;try{t=JSON.parse(y(o,"utf8"))}catch{return{changed:0}}let e=t.providers;if(!e||typeof e!="object")return{changed:0};let{index:a,message:r}=await $(n,s);if(a.size===0)return{changed:0,message:r};let i=0;for(let c of M){let l=e[c];if(!l||!Array.isArray(l.models))continue;let u=X(l.models,a);u.changed!==0&&(l.models=u.models,i+=u.changed)}if(i>0)try{g(o,`${JSON.stringify(t,null,2)}
4
+ `)}catch{return{changed:0,message:"the models file could not be written"}}return{changed:i,message:r}}var D=3e5;function se(n){let s=w(n,"settings.json"),o={};try{let t=y(s,"utf8"),e=JSON.parse(t);e&&typeof e=="object"&&!Array.isArray(e)&&(o=e)}catch{if(L(s))return!1}if("httpIdleTimeoutMs"in o)return!1;o.httpIdleTimeoutMs=D;try{R(n,{recursive:!0}),g(s,`${JSON.stringify(o,null,2)}
5
+ `)}catch{return!1}return!0}var N={supportsDeveloperRole:!1},j=128e3;function ae(n){let s=n.trim();return s.length<=10?"***":`${s.slice(0,6)}\u2026${s.slice(-4)}`}function ie(n){return/^sk-[A-Za-z0-9_-]{8,}$/.test(n.trim())}function z(n){let s=(()=>{if(Array.isArray(n))return n;if(n&&typeof n=="object"){let t=n;if(Array.isArray(t.data))return t.data;if(Array.isArray(t.models))return t.models}return[]})(),o=[];for(let t of s){let e=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.id=="string"?t.id:void 0;e&&!o.includes(e)&&o.push(e)}return o}function ce(n){return M.includes(n)}var J=1e8;async function H(n,s){let o=await n(s,{headers:{Accept:"application/json"}});if(!o.ok)return"USD";let e=(await o.json())?.data?.quota_display_type;return typeof e=="string"&&e.trim()?e.trim().toUpperCase():"USD"}async function le(n,s){let o=(s?.baseUrl??x).replace(/\/+$/,""),t=s?.fetchImpl??fetch,e=s?.timeoutMs??15e3,a=n.trim();if(!a)return{ok:!1,unlimited:!1,unit:"USD",message:"no token given"};let r=`${o.replace(/\/v1$/,"")}/api/status`,i=await H(t,r).catch(()=>"USD"),c=new AbortController,l=setTimeout(()=>c.abort(),e),u={Authorization:`Bearer ${a}`};try{let[d,f]=await Promise.all([t(`${o}/dashboard/billing/subscription`,{headers:u,signal:c.signal}),t(`${o}/dashboard/billing/usage`,{headers:u,signal:c.signal})]);if(d.status===401||d.status===403)return{ok:!1,unlimited:!1,unit:i,message:"the gateway rejected that token when asking for the balance"};if(!d.ok)return{ok:!1,unlimited:!1,unit:i,message:`the balance endpoint answered ${d.status}`};let m=await d.json();if(m.error?.message)return{ok:!1,unlimited:!1,unit:i,message:m.error.message};let b=Number(m.hard_limit_usd??m.soft_limit_usd??0);if(b>=J)return{ok:!0,unlimited:!0,unit:i,message:"this token has no quota limit"};let k=0;if(f.ok){let U=await f.json();k=Number(U.total_usage??0)/100}let C=Math.max(0,b-k);return{ok:!0,unlimited:!1,limit:b,used:k,remaining:C,unit:i,message:`${C.toFixed(2)} ${i} left of ${b.toFixed(2)} (${k.toFixed(2)} used)`}}catch(d){let f=d instanceof Error&&d.name==="AbortError";return{ok:!1,unlimited:!1,unit:i,message:f?`the gateway did not answer within ${Math.round(e/1e3)}s`:"could not reach the gateway"}}finally{clearTimeout(l)}}async function ue(n,s){let o=w(n,"models.json"),t;try{t=JSON.parse(y(o,"utf8"))}catch{return{added:0,touched:0}}let e=t.providers;if(!e||typeof e!="object")return{added:0,touched:0};let{index:a}=await $(n).catch(()=>({index:new Map})),r=0,i=0;for(let c of M){let l=e[c];if(!l||!Array.isArray(l.models))continue;let u=l.models.length;l.models=G(l.models,s,a),r+=l.models.length-u,i++}if(r===0)return{added:0,touched:i};try{g(o,`${JSON.stringify(t,null,2)}
6
+ `)}catch{return{added:0,touched:i}}return{added:r,touched:i}}function G(n,s,o){let t=new Set(n.map(a=>a.id)),e=[...n];for(let a of s){if(t.has(a))continue;t.add(a);let r=o?.get(h(a))??(o?T(o,a):void 0);e.push({id:a,contextWindow:r?.contextWindow??j,...r?.maxTokens?{maxTokens:r.maxTokens}:{},...r?{reasoning:r.reasoning}:{},...r?.vision?{input:["text","image"]}:{},compat:{...N}})}return e}function X(n,s){let o=0;return{models:n.map(e=>{let a=T(s,e.id);if(!a)return e;let r={...e},i=!1;return a.contextWindow&&e.contextWindow===j&&(r.contextWindow=a.contextWindow,i=!0),a.maxTokens&&!e.maxTokens&&(r.maxTokens=a.maxTokens,i=!0),e.reasoning===void 0&&(r.reasoning=a.reasoning,i=!0),a.vision&&!(e.input??[]).includes("image")&&(r.input=[...(e.input??["text"]).filter(c=>c!=="image"),"image"],i=!0),i?(o++,r):e}),changed:o}}function B(n){let s=0;return{models:n.map(t=>t.compat?.supportsDeveloperRole===!1?t:(s++,{...t,compat:{...t.compat,...N}})),changed:s}}function de(n,s){let o=new Set(n.map(t=>t.id));return s.filter(t=>!o.has(t)).length}async function V(n,s,o){let t=(o?.baseUrl??x).replace(/\/+$/,""),e=o?.fetchImpl??fetch,a=o?.timeoutMs??1e4,r=new AbortController,i=setTimeout(()=>r.abort(),a);try{let c=await e(`${t}/chat/completions`,{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({model:n,messages:[{role:"user",content:"hi"}],max_tokens:1}),signal:r.signal});if(c.ok)return{ok:!0,detail:"ok"};let l=await c.text().catch(()=>"");return{ok:!1,detail:/"message"\s*:\s*"([^"]{0,80})/.exec(l)?.[1]??`HTTP ${c.status}`}}catch(c){return{ok:!1,detail:c instanceof Error&&c.name==="AbortError"?"timed out":"unreachable"}}finally{clearTimeout(i)}}async function me(n,s,o){let t=Math.max(0,o?.limit??4),e=[...new Set(n)].filter(r=>r!==o?.exclude).slice(0,t),a=await Promise.all(e.map(r=>V(r,s,o)));return{live:e.filter((r,i)=>a[i]?.ok),probed:e}}async function fe(n,s){let o=(s?.baseUrl??x).replace(/\/+$/,""),t=s?.fetchImpl??fetch,e=s?.timeoutMs??15e3,a=n.trim();if(!a)return{ok:!1,models:[],message:"no token given"};let r=new AbortController,i=setTimeout(()=>r.abort(),e);try{let c=await t(`${o}/models`,{headers:{Authorization:`Bearer ${a}`},signal:r.signal});if(c.status===401)return{ok:!1,models:[],message:"the gateway rejected that token (401). Check it in the Console, or make a new one."};if(c.status===403)return{ok:!1,models:[],message:"that token is not allowed to list models (403). The Console shows what a token may call."};if(!c.ok)return{ok:!1,models:[],message:`the gateway answered ${c.status}`};let l=z(await c.json());return l.length===0?{ok:!1,models:[],message:"the token works but the gateway listed no models"}:{ok:!0,models:l,message:`${l.length} models available to this token`}}catch(c){let l=c instanceof Error&&c.name==="AbortError";return{ok:!1,models:[],message:l?`the gateway did not answer within ${Math.round(e/1e3)}s`:"could not reach the gateway"}}finally{clearTimeout(i)}}export{x as a,te as b,M as c,ne as d,oe as e,W as f,$ as g,re as h,D as i,se as j,N as k,j as l,ae as m,ie as n,z as o,ce as p,J as q,le as r,ue as s,G as t,X as u,B as v,de as w,V as x,me as y,fe as z};
@@ -0,0 +1 @@
1
+ function o(e){let n=0,r;return{limit:e,close(t){n+=t},total(t){return n+t},check(t){if(e===void 0||r!==void 0)return r;let d=n+t;return d-e>1e-9&&(r={spent:d,limit:e}),r}}}function u(e,n){return`stopped \u2014 spent $${e.toFixed(4)} of a $${n.toFixed(2)} budget.`}function i(e,n){return`--max-budget-usd needs a model with prices, and ${e} declares none (its rates are zero, so every turn costs $0 and the budget would never fire). Add a cost to that model in ${n}/models.json, or drop the flag.`}export{o as a,u as b,i as c};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-WUPU6LTD.js";import"./chunk-WOT6VMZA.js";export{f as BROKEN_LOCK_GRACE_MS,c as CHECK_ATTEMPTS,k as CHECK_FAILED_MESSAGE,b as CHECK_TIMEOUT_MS,d as INSTALL_TIMEOUT_MS,e as LOCK_TIMEOUT_MS,j as NPM_MISSING_MESSAGE,a as PACKAGE_NAME,n as acquireUpdateLock,u as autoUpdateEnabled,l as checkFailedNote,q as checkForUpdate,g as compareVersions,s as installUpdate,t as isInstalledCopy,h as isNewer,p as latestVersion,r as npmFailureDetail,m as pidAlive,o as releaseUpdateLock,i as resolveNpm};