quantex-cli 0.20.0 → 0.21.1
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.
- package/README.md +4 -0
- package/README.zh-CN.md +4 -0
- package/dist/agents-CXJLxw8j.mjs +1 -0
- package/dist/capabilities-BTOJ0kaS.mjs +5 -0
- package/dist/capabilities-Cl3gp573.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/color-DSVKeNpv.mjs +6 -0
- package/dist/commands-CcjvWI3b.mjs +1 -0
- package/dist/{commands-B_Hju0lq.mjs → commands-DoiBUV3g.mjs} +1 -1
- package/dist/{config-CFYt99os.mjs → config-DttlCFVr.mjs} +1 -1
- package/dist/detect-Bqm_mjTq.mjs +1 -0
- package/dist/doctor-D2a_99Z8.mjs +3 -0
- package/dist/{ensure-DpX11qbo.mjs → ensure-CHdbUTxg.mjs} +1 -1
- package/dist/ensure-CS7zwh7w.mjs +1 -0
- package/dist/index.d.mts +55 -3
- package/dist/index.mjs +2 -2
- package/dist/{info-BUsquCrf.mjs → info-BsR4unMZ.mjs} +1 -1
- package/dist/inspect-6f2xR5k8.mjs +1 -0
- package/dist/{inspect-CihiIfvE.mjs → inspect-Dv2vJ28l.mjs} +1 -1
- package/dist/{install-YLaojYug.mjs → install-DfENrV-i.mjs} +1 -1
- package/dist/{list-D79BiyLS.mjs → list-Dy7KyZI_.mjs} +1 -1
- package/dist/{resolve-BhJphfVN.mjs → resolve-CL20XmE2.mjs} +1 -1
- package/dist/resolve-Cj4FpG-J.mjs +1 -0
- package/dist/schema-Pi2h96nT.mjs +1 -0
- package/dist/schema-Pm-_bDkf.mjs +3 -0
- package/dist/{uninstall-C0IfMGxA.mjs → uninstall-tPD85IT2.mjs} +1 -1
- package/dist/update-DxXBIcgR.mjs +1 -0
- package/dist/{update-DNz98nPV.mjs → update-Dybu18B9.mjs} +1 -1
- package/dist/{upgrade-C60CHTun.mjs → upgrade-wuryVVTl.mjs} +1 -1
- package/dist/{user-output-DoYIFFWA.mjs → user-output-lYZ8Muqt.mjs} +1 -1
- package/package.json +1 -1
- package/dist/agents-Egq0RCta.mjs +0 -1
- package/dist/capabilities-DVYVq0Kb.mjs +0 -1
- package/dist/capabilities-LjMH_zbA.mjs +0 -5
- package/dist/color-DEbCq7kh.mjs +0 -6
- package/dist/commands-CBYZqBF0.mjs +0 -1
- package/dist/detect-DWabXMgY.mjs +0 -1
- package/dist/doctor-Dp9VEmRS.mjs +0 -3
- package/dist/ensure-B-zpnaT-.mjs +0 -1
- package/dist/inspect-DO3c51A6.mjs +0 -1
- package/dist/resolve-D3cko00u.mjs +0 -1
- package/dist/schema-1VaAQRYe.mjs +0 -1
- package/dist/schema-C7v-CajU.mjs +0 -3
- package/dist/update-DgZD1TXs.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,S as t,a as n,c as r,n as i,r as a,t as o,u as s,x as c}from"./color-
|
|
1
|
+
import{L as e,S as t,a as n,c as r,n as i,r as a,t as o,u as s,x as c}from"./color-DSVKeNpv.mjs";import{a as l,i as u,n as d,r as f}from"./user-output-lYZ8Muqt.mjs";async function p(e={}){let o=await t({updateChannel:e.channel}),l=c(o),u=d(),f=h(l),p=_(l);if(o.status===`up-to-date`)return n(a({action:`upgrade`,data:{canAutoUpdate:l.canAutoUpdate,channel:l.updateChannel,currentVersion:l.currentVersion,installSource:l.installSource,latestVersion:l.latestVersion,status:`up-to-date`},target:{kind:`self`,name:`quantex`},warnings:[...f,...p?[p]:[]]}),m);if(e.check||u)return o.status===`update-available`?n(a({action:`upgrade`,data:{canAutoUpdate:l.canAutoUpdate,channel:l.updateChannel,currentVersion:l.currentVersion,installSource:l.installSource,latestVersion:l.latestVersion,status:`update-available`},exitCode:e.check?1:void 0,target:{kind:`self`,name:`quantex`},warnings:[...f,...p?[p]:[],...u?[{code:`DRY_RUN`,message:`Dry run: would upgrade Quantex CLI.`}]:[]]}),m):n(i({action:`upgrade`,data:{canAutoUpdate:l.canAutoUpdate,channel:l.updateChannel,currentVersion:l.currentVersion,installSource:l.installSource,status:`check-unavailable`},error:{code:`NETWORK_ERROR`,message:`Unable to determine the latest Quantex CLI version.`},target:{kind:`self`,name:`quantex`},warnings:[...f,...p?[p]:[]]}),m);if(o.status===`manual-required`){let e=s(l);return n(i({action:`upgrade`,data:{canAutoUpdate:l.canAutoUpdate,channel:l.updateChannel,currentVersion:l.currentVersion,installSource:l.installSource,latestVersion:l.latestVersion,recoveryHint:e,status:`manual-required`},error:{code:`MANUAL_ACTION_REQUIRED`,message:`Quantex CLI cannot auto-update from the current install source: ${l.installSource}.`},target:{kind:`self`,name:`quantex`},warnings:[...f,...p?[p]:[]]}),m)}let g=await r(o);if(g.success)return n(a({action:`upgrade`,data:{canAutoUpdate:l.canAutoUpdate,channel:l.updateChannel,currentVersion:l.currentVersion,installSource:l.installSource,latestVersion:l.latestVersion,status:`updated`},target:{kind:`self`,name:`quantex`},warnings:[...f,...p?[p]:[]]}),m);let v=s(l,g);return n(i({action:`upgrade`,data:{canAutoUpdate:l.canAutoUpdate,channel:l.updateChannel,currentVersion:l.currentVersion,installSource:l.installSource,latestVersion:l.latestVersion,recoveryHint:v,status:`manual-required`},error:{code:`UPGRADE_FAILED`,details:g.error?.kind?{kind:g.error.kind}:void 0,message:g.error?.message??`Failed to upgrade Quantex CLI.`},target:{kind:`self`,name:`quantex`},warnings:[...f,...v?[{code:`MANUAL_RECOVERY`,message:`Manual recovery: ${v}`}]:[]]}),m)}function m(e){if(!e.data){e.error&&f(o.red(e.error.message));return}if(e.data.status===`up-to-date`){u(o.green(`Quantex CLI is already up to date (${e.data.currentVersion}).`)),g(e.warnings);return}if(e.data.status===`update-available`){let t=e.warnings.some(e=>e.message.includes(`Dry run`))?`Dry run: `:``;l(o.yellow(`${t}Update available for Quantex CLI: ${e.data.currentVersion} -> ${e.data.latestVersion} (${e.data.channel}).`)),g(e.warnings);return}if(e.data.status===`check-unavailable`){e.error&&l(o.yellow(e.error.message)),g(e.warnings);return}if(e.data.status===`manual-required`&&e.error?.code===`MANUAL_ACTION_REQUIRED`){l(o.yellow(e.error.message)),e.data.recoveryHint&&l(o.cyan(`Next step: ${e.data.recoveryHint}`));return}let t=e.data.latestVersion?` (${e.data.currentVersion} -> ${e.data.latestVersion})`:` (${e.data.currentVersion})`;if(u(o.cyan(`Upgrading Quantex CLI...${t}`)),!e.error){u(o.green(`Quantex CLI upgraded successfully.`)),g(e.warnings);return}f(o.red(`Failed to upgrade Quantex CLI.`)),l(o.yellow(`Reason: ${e.error.message}`));for(let t of e.warnings)l(o.cyan(t.message.replace(/^Manual recovery:/,`Next step:`)))}function h(e){return!e.latestVersion||!e.upstreamLatestVersion||e.latestVersion===e.upstreamLatestVersion||e.installSource!==`bun`&&e.installSource!==`npm`?[]:[{code:`MIRROR_LAG`,details:{installableLatestVersion:e.latestVersion,upstreamLatestVersion:e.upstreamLatestVersion},message:`The selected registry currently installs ${e.latestVersion}, while upstream npm has ${e.upstreamLatestVersion}. Retry later or set selfUpdateRegistry / QTX_SELF_UPDATE_REGISTRY to another registry if you need the upstream release now.`}]}function g(e){for(let t of e)t.code===`DRY_RUN`||t.code===`MANUAL_RECOVERY`||l(o.yellow(t.message))}function _(t){if(!t.latestVersion)return;let n=e(t.latestVersion,t.currentVersion);if(!(n===void 0||n>=0))return{code:`STALE_LATEST_VERSION`,details:{currentVersion:t.currentVersion,latestVersion:t.latestVersion},message:`The resolved latest version ${t.latestVersion} is older than the installed Quantex CLI ${t.currentVersion}. Quantex will not downgrade; retry with --refresh or --no-cache if you need a fresh check.`}}export{p as upgradeCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e}from"./color-
|
|
1
|
+
import{at as e}from"./color-DSVKeNpv.mjs";import t from"node:process";const n={debug:4,error:1,info:3,silent:0,warn:2};function r(e){o(`info`)&&t.stdout.write(`${e}\n`)}function i(e){o(`warn`)&&t.stdout.write(`${e}\n`)}function a(e){o(`error`)&&t.stdout.write(`${e}\n`)}function o(t){let r=e();return r.outputMode===`human`?r.quiet&&t===`info`?!1:n[r.logLevel??`info`]>=n[t]:!0}function s(){return!!e().assumeYes}function c(){return!!e().dryRun}function l(e){t.stdout.write(`${e}\n`)}export{i as a,r as i,c as n,l as o,a as r,s as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quantex-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Agent-friendly lifecycle CLI for AI coding assistant CLIs: install, inspect, update, uninstall, run, and automate Codex, Claude Code, Gemini, Cursor, OpenCode, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-cli",
|
package/dist/agents-Egq0RCta.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,f as n,i as r,l as i,n as a,o,p as s,r as ee,s as te,t as c,u as ne}from"./detect-DWabXMgY.mjs";import{B as re,G as l,K as u,M as ie,O as d,P as f,R as ae,U as p,V as oe,W as m,Y as h,_ as se,b as ce,d as le,et as ue,f as de,g as fe,h as pe,m as me,p as he,v as ge,y as _e,z as ve}from"./color-DEbCq7kh.mjs";import ye from"node:process";const be={binary:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!1,canUpdate:!1,lifecycle:`unmanaged`},brew:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},bun:{canInstall:!0,canLookupLatestVersion:!0,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},cargo:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},mise:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},npm:{canInstall:!0,canLookupLatestVersion:!0,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},pip:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},uv:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!0,canUpdate:!0,lifecycle:`managed`},script:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!1,canUpdate:!1,lifecycle:`unmanaged`},winget:{canInstall:!0,canLookupLatestVersion:!1,canUninstall:!0,canUpdate:!0,lifecycle:`managed`}};function g(e){return be[e]}function _(e){return g(e).lifecycle===`managed`}function v(e){return g(e).lifecycle}function y(e){return g(e).canUpdate}function xe(e){return g(e).canUninstall}function b(e){return g(e).canLookupLatestVersion}function x(e,t){return e?t===`cask`?` (${e} cask)`:t===`id`?` (${e} id)`:` (${e})`:``}function S(e,t){if(t.packageName)return t.packageName;if(t.type===`cargo`)return e.packages?.cargo;if(t.type===`mise`)return e.packages?.mise;if(t.type===`pip`)return e.packages?.pip;if(t.type===`uv`)return e.packages?.uv;if(t.type===`bun`||t.type===`npm`)return e.packages?.npm}function C(e){return e?y(e.installType):!1}function w(e,t){return C(t)||!!e.selfUpdate}function Se(e){return!!e&&b(e.installType)}function Ce(e){return e.length>0&&e.every(e=>b(e.type))}function we(e){return _(e.type)?`${v(e.type)}/${e.type}${x(e.packageName,e.packageTargetKind)}`:e.type===`script`?`unmanaged/script`:`unmanaged/binary`}function Te(e){return e?_(e.installType)?`managed via ${e.installType}${x(e.packageName,e.packageTargetKind)}`:e.installType===`script`?`script installer`:`binary installer`:`detected in PATH`}function Ee(e,t){let n=k({agent:e,installedState:t,methods:[]});return n===`managed`?`managed update`:n===`self-update`?`command update`:`manual update`}function De(e,t){if(t.type===`bun`){let n=S(e,t);return n?`bun add -g ${n}`:``}if(t.type===`npm`){let n=S(e,t);return n?`npm i -g ${n}`:``}if(t.type===`brew`)return t.packageName?t.packageTargetKind===`cask`?`brew install --cask ${t.packageName}`:`brew install ${t.packageName}`:``;if(t.type===`cargo`){let n=S(e,t);return n?[`cargo`,`install`,n,...t.packageInstallArgs??[]].join(` `):``}if(t.type===`mise`){let n=S(e,t);return n?`mise use --global ${n}`:``}if(t.type===`pip`){let n=S(e,t);return n?`pip install ${n}`:``}if(t.type===`uv`){let n=S(e,t);return n?[`uv`,`tool`,`install`,n,...t.packageInstallArgs??[]].join(` `):``}return t.type===`winget`?t.packageName?`winget install --id ${t.packageName} -e`:``:t.command??``}function Oe(e,t,n){if(t)return Se(t)&&(t.packageName||e.packages?.npm)||void 0;if(!(!e.packages?.npm||!Ce(n)))return e.packages.npm}function ke(e,t){let n=Ae(t);if(n){let t=e.find(e=>e.type===n);if(t)return t}if(e.length!==1)return;let[r]=e;if(!(r.type!==`script`&&r.type!==`binary`))return r}function Ae(e){if(!e)return;let t=e.replaceAll(`\\`,`/`);if(t.includes(`/.bun/bin/`)||t.includes(`/.bun/install/global/`))return`bun`;if(t.includes(`/.local/share/mise/shims/`)||t.includes(`/.mise/shims/`))return`mise`;if(t.includes(`/node_modules/.bin/`)||t.includes(`/node_modules/`))return`npm`}function T(e){if(e.installedState)return _(e.installedState.installType)?e.installedState.installType:void 0;for(let t of e.methods)if(_(t.type)&&y(t.type))return t.type}const je={strategy:`managed`,canHandle:e=>!!T(e),getManagedInstallerType:e=>T(e)},Me={strategy:`self-update`,canHandle:e=>!C(e.installedState)&&!!e.agent.selfUpdate},E={strategy:`manual-hint`,canHandle:()=>!0},D=[je,Me,E];function O(e){return D.find(t=>t.canHandle(e))??E}function k(e){return O(e).strategy}function Ne(e){return w(e.agent,e.installedState)}async function A(e){let t=c(),n=typeof e==`function`?e(t):e;try{return ye.platform===`win32`?await u(l([`powershell.exe`,`-Command`,n]))===0:await u(l([`sh`,`-c`,n]))===0}catch{return!1}}function Pe(e){return e===`cask`?[`--cask`]:[]}async function j(e,t,n){try{return await u(l([`brew`,e,...Pe(n),t]))===0}catch{return!1}}async function Fe(e,t){return j(`install`,e,t)}async function M(e,t){return j(`upgrade`,e,t)}async function Ie(e){for(let t of e)if(!await M(t.packageName,t.packageTargetKind))return!1;return!0}async function Le(e,t){return j(`uninstall`,e,t)}async function N(e,t,n=[]){try{return await u(l([`cargo`,e,t,...n]))===0}catch{return!1}}async function P(e,t){return N(`install`,e,t)}async function F(e,t){return P(e,[`--force`,...t??[]])}async function Re(e){for(let t of e)if(!await F(t.packageName,t.packageInstallArgs))return!1;return!0}async function ze(e){return N(`uninstall`,e)}async function I(e,t=!1){try{return await u(l([`mise`,`use`,`--global`,...t?[`--force`]:[],e]))===0}catch{return!1}}async function Be(e){return I(e)}async function L(e){return I(e,!0)}async function Ve(e){for(let t of e)if(!await L(t.packageName))return!1;return!0}async function He(e){try{return await u(l([`mise`,`unuse`,`--global`,e]))===0}catch{return!1}}async function Ue(e){try{let{exitCode:t,stdout:n}=await p(m([`mise`,`ls`,`--installed`,`--json`,e],{stdio:[`ignore`,`pipe`,`ignore`]}));return t===0?We(n,e):void 0}catch{return}}function We(e,t){try{let n=JSON.parse(e);if(!R(n))return;let r=Ge(n,t),i=r?n[r]:void 0;if(!Array.isArray(i))return;for(let e of i)if(R(e)&&typeof e.version==`string`&&e.version.length>0)return e.version;return}catch{return}}function Ge(e,t){if(Array.isArray(e[t]))return t;let n=t.split(`:`).pop()?.split(`/`).pop();if(n)return Object.keys(e).find(t=>t===n&&Array.isArray(e[t]))}function R(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let z=null;async function Ke(){if(z)return z;for(let e of[[`pip`],[`pip3`],[`python`,`-m`,`pip`],[`python3`,`-m`,`pip`]])try{let{exitCode:t}=await p(m([...e,`--version`]));if(t===0)return z=e,e}catch{}return z=[`pip`],z}async function B(e){try{return await u(l([...await Ke(),...e]))===0}catch{return!1}}async function qe(e){return B([`install`,e])}async function V(e){return B([`install`,`--upgrade`,e])}async function Je(e){if(e.length===0)return!0;for(let t of e)if(!await V(t.packageName))return!1;return!0}async function Ye(e){return B([`uninstall`,`-y`,e])}async function H(e,t,n=[]){try{return await u(l([`uv`,`tool`,e,t,...n]))===0}catch{return!1}}async function Xe(e,t){return H(`install`,e,t)}async function U(e,t){return H(`upgrade`,e,t)}async function Ze(e){for(let t of e)if(!await U(t.packageName,t.packageInstallArgs))return!1;return!0}async function Qe(e){try{return await u(l([`uv`,`tool`,`uninstall`,e]))===0}catch{return!1}}async function $e(e){try{let{exitCode:t,stdout:n}=await p(m([`uv`,`tool`,`list`],{stdio:[`ignore`,`pipe`,`ignore`]}));return t===0?et(n,e):void 0}catch{return}}function et(e,t){let n=W(t);for(let t of e.split(/\r?\n/)){let e=t.trim(),r=/^(\S+)\s+v([^\s]+)/.exec(e);if(!r)continue;let[,i,a]=r;if(W(i)===n)return a}}function W(e){return e.toLowerCase().replaceAll(/[-_.]+/g,`-`)}async function G(e,t){try{return await u(l([`winget`,e,`--id`,t,`-e`]))===0}catch{return!1}}async function tt(e){return G(`install`,e)}async function K(e){return G(`upgrade`,e)}async function nt(e){for(let t of e)if(!await K(t.packageName))return!1;return!0}async function rt(e){return G(`uninstall`,e)}const it={brew:{type:`brew`,isAvailable:async()=>ee(),install:async(e,t)=>Fe(e,t),uninstall:async(e,t)=>Le(e,t),update:async(e,t)=>M(e,t),updateMany:async e=>Ie(e)},bun:{type:`bun`,getInstalledVersion:async e=>fe(e),isAvailable:async()=>r(),install:async e=>se(e),uninstall:async e=>ge(e),update:async(e,t,n)=>_e(e,n?.npmBunUpdateStrategy),updateMany:async(e,t)=>ce(e.map(e=>e.packageName),t?.npmBunUpdateStrategy)},cargo:{type:`cargo`,isAvailable:async()=>e(),install:async(e,t,n)=>P(e,n),uninstall:async e=>ze(e),update:async(e,t,n)=>F(e,n?.packageInstallArgs),updateMany:async e=>Re(e.map(e=>({packageInstallArgs:e.packageInstallArgs,packageName:e.packageName})))},mise:{type:`mise`,getInstalledVersion:async e=>Ue(e),isAvailable:async()=>o(),install:async e=>Be(e),uninstall:async e=>He(e),update:async e=>L(e),updateMany:async e=>Ve(e.map(e=>({packageName:e.packageName})))},npm:{type:`npm`,getInstalledVersion:async e=>le(e),isAvailable:async()=>te(),install:async e=>de(e),uninstall:async e=>he(e),update:async(e,t,n)=>me(e,n?.npmBunUpdateStrategy),updateMany:async(e,t)=>pe(e.map(e=>e.packageName),t?.npmBunUpdateStrategy)},pip:{type:`pip`,isAvailable:async()=>t(),install:async e=>qe(e),uninstall:async e=>Ye(e),update:async e=>V(e),updateMany:async e=>Je(e.map(e=>({packageName:e.packageName})))},uv:{type:`uv`,getInstalledVersion:async e=>$e(e),isAvailable:async()=>i(),install:async(e,t,n)=>Xe(e,n),uninstall:async e=>Qe(e),update:async(e,t,n)=>U(e,n?.packageInstallArgs),updateMany:async e=>Ze(e.map(e=>({packageInstallArgs:e.packageInstallArgs,packageName:e.packageName})))},winget:{type:`winget`,isAvailable:async()=>ne(),install:async e=>tt(e),uninstall:async e=>rt(e),update:async e=>K(e),updateMany:async e=>nt(e.map(e=>({packageName:e.packageName})))}};function q(e){return it[e]}const J={resource:`agent lifecycle`,scope:[`agent-lifecycle`]};async function at(){return(await ue()).defaultPackageManager}async function ot(){return{npmBunUpdateStrategy:(await ue()).npmBunUpdateStrategy}}async function Y(e){let t=c(),n=e.platforms[t];if(!n)return[];let r=await at();return r?[...n.filter(e=>e.type===r),...n.filter(e=>e.type!==r)]:[...n]}async function st(e,t,n,r,i,a){let o=q(e);return await o.isAvailable()?i===`install`?o.install(t,r,n):i===`update`?o.update(t,r,{npmBunUpdateStrategy:a,packageInstallArgs:n}):o.uninstall(t,r):!1}async function X(e,t,n,r){if(_(t.type)){let i=S(e,t);return i?st(t.type,i,t.packageInstallArgs,t.packageTargetKind,n,r):!1}return n===`update`&&!y(t.type)||!t.command?!1:A(t.command)}async function ct(e,t,n){return _(e.installType)?e.packageName?st(e.installType,e.packageName,e.packageInstallArgs,e.packageTargetKind,t,n):!1:t!==`install`||!e.command?!1:A(e.command)}async function lt(e){if(!e.selfUpdate)return!1;let t=[e.selfUpdate.command,...e.selfUpdate.fallbackCommands??[]];for(let e of t)if(await A(e.join(` `)))return!0;return!1}async function Z(e,t){let n={agentName:e.name,installType:t.type,packageName:S(e,t),packageTargetKind:t.packageTargetKind,command:`command`in t?t.command:void 0};return t.packageInstallArgs?.length&&(n.packageInstallArgs=t.packageInstallArgs),await f(n),n}async function ut(e,t){return h(J,async()=>Z(e,t))}async function dt(e){return h(J,async()=>{let t=await Y(e);for(let n of t)if(await X(e,n,`install`))return{success:!0,installedState:await Z(e,n)};return{success:!1}})}async function ft(e,t){return h(J,async()=>{let{npmBunUpdateStrategy:n}=await ot(),r=await Y(e);if(t&&await ct(t,`update`,n))return await f(t),{success:!0,installedState:t};if(!t){for(let t of r)if(await X(e,t,`update`,n))return{success:!0,installedState:await Z(e,t)}}return await lt(e)?{success:!0}:{success:!1}})}async function pt(e,t){return h(J,async()=>{let n=[...new Map(t.filter(e=>e.packageName).map(e=>[`${e.packageTargetKind??`package`}:${e.packageName}:${e.packageInstallArgs?.join(` `)??``}`,e])).values()];if(n.length===0)return!1;let r=q(e);return await r.isAvailable()?r.updateMany(n,await ot()):!1})}async function mt(e,t,n){let r=q(e);if(r.getInstalledVersion&&await r.isAvailable())return r.getInstalledVersion(t,n)}async function ht(e){return h(J,async()=>{let t=await d(e.name);if(!t)return!1;let n=await ct(t,`uninstall`);return n&&await ie(e.name),n})}async function Q(e){let[t,n,r]=await Promise.all([Y(e),d(e.name),a(e.binaryName)]),[i,o,s]=await Promise.all([r?_t(e,n):Promise.resolve(void 0),r?ae(e.binaryName):Promise.resolve(void 0),vt(e,n,t)]);return{agent:e,methods:t,installedState:n,inPath:r,installedVersion:i,latestVersion:s,binaryPath:o,resolvedBinaryPath:await oe(o),sourceLabel:Te(n),updateLabel:Ee(e,n),lifecycle:n?v(n.installType):`unmanaged`}}async function gt(e){return Promise.all(e.map(Q))}async function _t(e,t){if(t&&_(t.installType)&&t.packageName){let e=await mt(t.installType,t.packageName,t.packageTargetKind);if(e)return e}return ve(e.binaryName,e.versionProbe)}async function vt(e,t,n){let r=Oe(e,t,n);if(r)return re(r)}function $(e){return n(e)}async function yt(e){let t=$(e);if(t)return{agent:t,inspection:await Q(t)}}async function bt(){return gt(s())}export{xe as C,_ as D,g as E,b as S,v as T,w as _,gt as a,ke as b,ut as c,pt as d,q as f,O as g,k as h,Q as i,ht as l,Ne as m,$ as n,Y as o,D as p,yt as r,dt as s,bt as t,ft as u,De as v,y as w,S as x,we as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./capabilities-LjMH_zbA.mjs";export{e as capabilitiesCommand};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,o as i,p as a,r as o,s,t as c,u as l}from"./detect-DWabXMgY.mjs";import{a as u,r as d,s as f,t as p}from"./color-DEbCq7kh.mjs";import m from"node:process";async function h(){let[p,h,v,y,b,x,S,C,w]=await Promise.all([n(),s(),o(),e(),i(),t(),r(),l(),f()]);return u(d({action:`capabilities`,data:{agents:a().map(e=>e.name),features:{assumeYes:!0,cacheBypass:!0,cacheRefresh:!0,channels:[`stable`,`beta`],colorModes:[`auto`,`always`,`never`],dryRun:!0,execInstallPolicies:[`never`,`if-missing`,`always`],freshnessMetadata:!0,idempotencyKey:!0,logLevels:[`silent`,`error`,`warn`,`info`,`debug`],quietLogs:!0,selfUpgrade:w.canAutoUpdate,timeout:!0},installers:{brew:{available:v,reason:v?void 0:g(`brew`)},bun:{available:p,reason:p?void 0:g(`bun`)},cargo:{available:y,reason:y?void 0:g(`cargo`)},mise:{available:b,reason:b?void 0:g(`mise`)},npm:{available:h,reason:h?void 0:g(`npm`)},pip:{available:x,reason:x?void 0:g(`pip`)},uv:{available:S,reason:S?void 0:g(`uv`)},winget:{available:C,reason:C?void 0:g(`winget`)}},outputModes:[`human`,`json`,`ndjson`],platform:{arch:m.arch,os:c()}},target:{kind:`system`,name:`capabilities`}}),_)}function g(e){return e===`winget`&&m.platform!==`win32`||e===`brew`&&m.platform===`win32`?`not-on-platform`:`not-found`}function _(e){e.data&&(console.log(p.bold(`
|
|
2
|
-
Quantex Capabilities
|
|
3
|
-
`)),console.log(` Platform: ${e.data.platform.os}/${e.data.platform.arch}`),console.log(` Output Modes: ${e.data.outputModes.join(`, `)}`),console.log(` Agents: ${e.data.agents.join(`, `)}`),console.log(p.bold(`
|
|
4
|
-
Installers:`)),console.log(` bun: ${v(e.data.installers.bun)}`),console.log(` npm: ${v(e.data.installers.npm)}`),console.log(` brew: ${v(e.data.installers.brew)}`),console.log(` cargo: ${v(e.data.installers.cargo)}`),console.log(` mise: ${v(e.data.installers.mise)}`),console.log(` pip: ${v(e.data.installers.pip)}`),console.log(` uv: ${v(e.data.installers.uv)}`),console.log(` winget: ${v(e.data.installers.winget)}`),console.log(p.bold(`
|
|
5
|
-
Features:`)),console.log(` --yes: ${e.data.features.assumeYes?`yes`:`no`}`),console.log(` cache-refresh: ${e.data.features.cacheRefresh?`yes`:`no`}`),console.log(` color-modes: ${e.data.features.colorModes.join(`, `)}`),console.log(` no-cache: ${e.data.features.cacheBypass?`yes`:`no`}`),console.log(` dry-run: ${e.data.features.dryRun?`yes`:`no`}`),console.log(` freshness-metadata: ${e.data.features.freshnessMetadata?`yes`:`no`}`),console.log(` self-upgrade: ${e.data.features.selfUpgrade?`yes`:`no`}`),console.log(` idempotency-key: ${e.data.features.idempotencyKey?`yes`:`no`}`),console.log(` log-levels: ${e.data.features.logLevels.join(`, `)}`),console.log(` quiet-logs: ${e.data.features.quietLogs?`yes`:`no`}`),console.log(` timeout: ${e.data.features.timeout?`yes`:`no`}`),console.log(` channels: ${e.data.features.channels.join(`, `)}`),console.log(` exec-install-policy: ${e.data.features.execInstallPolicies.join(`, `)}`),console.log())}function v(e){return e.available?p.green(`available`):p.red(e.reason??`not-found`)}export{h as t};
|
package/dist/color-DEbCq7kh.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{createHash as e,randomUUID as t}from"node:crypto";import n from"node:process";import{existsSync as r,mkdirSync as i,writeFileSync as a}from"node:fs";import{chmod as o,mkdir as s,mkdtemp as c,readFile as l,realpath as u,rename as d,rm as f,stat as p,writeFile as m}from"node:fs/promises";import{basename as h,dirname as g,join as _}from"node:path";import{homedir as ee}from"node:os";import{spawn as te}from"node:child_process";import{text as ne}from"node:stream/consumers";import{fileURLToPath as re}from"node:url";import{Buffer as ie}from"node:buffer";import ae from"picocolors";function oe(e){let t=e.trim().match(/^(\d+)(ms|[smh])?$/);if(!t)return;let n=Number.parseInt(t[1],10),r=t[2]??`ms`;if(Number.isFinite(n))switch(r){case`ms`:return n;case`s`:return n*1e3;case`m`:return n*60*1e3;case`h`:return n*60*60*1e3;default:return}}let v,y=new Set;function b(){return v??=me(),v}function se(e){y=new Set,v={...e,cacheMode:e.cacheMode??`default`,cancelled:e.cancelled??!1}}function ce(){v=void 0,y=new Set}function le(e={}){let r=n.stdin.isTTY!==!1,i=n.stdout.isTTY!==!1,a=!r||!i,o=e.json||e.output===`json`?`json`:e.output===`ndjson`?`ndjson`:e.output===`human`?`human`:a?`json`:`human`,s=e.timeout===void 0?void 0:oe(e.timeout),c=he(e.color),l=ge(e.logLevel);if(e.timeout!==void 0&&s===void 0)throw Error(`Invalid timeout value: ${e.timeout}`);if(e.refresh&&e.noCache)throw Error(`Cannot combine --refresh with --no-cache.`);return{assumeYes:e.yes,cacheMode:e.noCache?`no-cache`:e.refresh?`refresh`:`default`,cancelled:!1,colorMode:c,dryRun:e.dryRun,idempotencyKey:e.idempotencyKey,interactive:!e.nonInteractive&&!a&&r&&i,logLevel:l,outputMode:o,quiet:e.quiet,runId:e.runId??n.env.QUANTEX_RUN_ID??t(),timeoutMs:s}}function ue(){v&&(v.cancelled=!0)}function de(){ue();for(let e of y)e();y.clear()}function fe(e){return y.add(e),()=>{y.delete(e)}}function pe(e){let t=b();if(!t.freshness){t.freshness=e;return}t.freshness={fetchedAt:t.freshness.fetchedAt<=e.fetchedAt?t.freshness.fetchedAt:e.fetchedAt,source:t.freshness.source===`network`&&e.source===`network`?`network`:`cache`,staleAfter:t.freshness.staleAfter<=e.staleAfter?t.freshness.staleAfter:e.staleAfter}}function me(){return le()}function he(e){if(e===void 0||e===`auto`)return`auto`;if(e===`always`)return`always`;if(e===`never`)return`never`;throw Error(`Invalid color mode: ${e}`)}function ge(e){if(e===void 0||e===`info`)return`info`;if(e===`silent`||e===`error`||e===`warn`||e===`debug`)return e;throw Error(`Invalid log level: ${e}`)}const _e=`https://registry.npmjs.org`;function x(e){if(e)try{return new URL(e.trim()).toString().replace(/\/+$/,``)}catch{return}}function ve(e,t,n){return`${x(n)}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}const ye={defaultPackageManager:`bun`,networkRetries:2,networkTimeoutMs:1e4,npmBunUpdateStrategy:`latest-major`,selfUpdateChannel:`stable`,selfUpdateRegistry:void 0,versionCacheTtlHours:6};function S(){return _(n.env.HOME||n.env.USERPROFILE||ee(),`.quantex`)}function C(){return _(S(),`config.json`)}async function w(){let e={...ye,...await Se()};return{...e,defaultPackageManager:T(e.defaultPackageManager)?e.defaultPackageManager:`bun`,networkRetries:E(e.networkRetries,2),networkTimeoutMs:E(e.networkTimeoutMs,1e4),npmBunUpdateStrategy:e.npmBunUpdateStrategy===`respect-semver`?`respect-semver`:`latest-major`,selfUpdateChannel:e.selfUpdateChannel===`beta`?`beta`:`stable`,selfUpdateRegistry:typeof e.selfUpdateRegistry==`string`?x(e.selfUpdateRegistry):void 0,versionCacheTtlHours:E(e.versionCacheTtlHours,6)}}function T(e){return e===`bun`||e===`mise`||e===`npm`}function be(e){return e===`latest-major`||e===`respect-semver`}async function xe(e){await s(S(),{recursive:!0}),await m(C(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}async function Se(){try{let e=await l(C(),`utf8`),t=JSON.parse(e);return Ce(t)?t:{}}catch{return{}}}function E(e,t){if(typeof e==`number`&&Number.isInteger(e)&&e>0)return e;if(typeof e==`string`){let t=Number.parseInt(e,10);if(Number.isInteger(t)&&t>0)return t}return t}function Ce(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var D=class extends Error{lockPath;resource;constructor(e,t){super(`Another quantex process is already using the ${e} lock.`),this.name=`ResourceLockError`,this.lockPath=t,this.resource=e}};function we(e){return e instanceof D}function Te(e){let t=e.map(e=>e.trim().replaceAll(/[^\w.-]+/g,`-`).replaceAll(/-+/g,`-`).replaceAll(/^-|-$/g,``)).filter(Boolean),n=t.length>0?t:[`default`],r=n.slice(0,-1),i=`${n.at(-1)}.lock`;return _(S(),`locks`,...r,i)}async function O(e){let t=Te(e.scope);return await s(g(t),{recursive:!0}),await Ee(e.resource,t),async()=>{await f(t,{force:!0,recursive:!0})}}async function Ee(e,t){try{i(t,{recursive:!1}),De(t);return}catch(e){if(!Me(e))throw e}if(!await Oe(t))throw new D(e,t);try{i(t,{recursive:!1}),De(t)}catch(n){throw Me(n)?new D(e,t):n}}function De(e){a(_(e,`owner.json`),`${JSON.stringify({pid:n.pid,createdAt:new Date().toISOString()})}\n`,`utf8`)}async function Oe(e){let t;try{t=await ke(e)}catch{return!1}return t&&je(t.pid)?!1:(await f(e,{force:!0,recursive:!0}),!0)}async function ke(e){let t=Date.now()+100;for(;Date.now()<t;){let t=await Ae(e);if(t)return t;await new Promise(e=>setTimeout(e,2))}return await Ae(e)}async function Ae(e){try{let t=await l(_(e,`owner.json`),`utf8`),n=JSON.parse(t);return typeof n.pid==`number`&&Number.isInteger(n.pid)&&n.pid>0?{pid:n.pid}:void 0}catch(e){if(Ne(e))return;throw e}}function je(e){try{return n.kill(e,0),!0}catch(e){return(typeof e==`object`&&e&&`code`in e?e.code:void 0)===`EPERM`}}function Me(e){return typeof e==`object`&&!!e&&`code`in e&&e.code===`EEXIST`}function Ne(e){let t=typeof e==`object`&&e&&`code`in e?e.code:void 0;return t===`ENOENT`||t===`ENOTDIR`}async function Pe(e,t){let n=await O(e);try{return await t()}finally{await n()}}async function Fe(){try{return await O({resource:`self upgrade`,scope:[`self-upgrade`]})}catch(e){if(we(e))return;throw e}}const k=`quantex-cli`,A=`https://github.com/Drswith/quantex-cli`,j=`0.20.0`;function M(e,t={}){if(b().outputMode===`human`){let n=P(e,{...t,stdio:[`inherit`,`inherit`,`inherit`]});return{cleanup:fe(()=>n.kill?.(`SIGTERM`)),outputDrained:Promise.resolve(),proc:n}}let n=P(e,{...t,stdio:[`ignore`,`pipe`,`pipe`]});return{cleanup:fe(()=>n.kill?.(`SIGTERM`)),outputDrained:Promise.all([Ie(n.stdout),Ie(n.stderr)]).then(()=>void 0),proc:n}}async function N(e){try{let t=await e.proc.exited;return await e.outputDrained,t}finally{e.cleanup()}}function P(e,t={}){let n=ze();if(n)return Be(e,t,n);let[r,...i]=e;if(!r)throw Error(`spawnCommand requires a non-empty command array.`);let a=te(r,i,{...t,shell:t.shell??Re(r)});return{get exitCode(){return a.exitCode},stderr:a.stderr,stdout:a.stdout,exited:Le(a),kill:a.kill.bind(a),unref:()=>a.unref()}}async function F(e){let[t,n,r]=await Promise.all([I(e.stdout),I(e.stderr),e.exited]);return{exitCode:r,stderr:n,stdout:t}}async function Ie(e){if(!e)return;let t=await I(e);t&&n.stderr.write(t)}async function Le(e){return new Promise((t,n)=>{e.once(`error`,n),e.once(`close`,e=>{t(typeof e==`number`?e:1)})})}async function I(e){return e?typeof e==`string`?e:typeof e.getReader==`function`?new Response(e).text():ne(e):``}function Re(e){return n.platform!==`win32`||e.includes(`/`)||e.includes(`\\`)?!1:!/\.[a-z0-9]+$/i.test(e)}function ze(){let e=globalThis.Bun?.spawn;return typeof e==`function`?e:void 0}function Be(e,t,n){let r=n([...e],t);return{get exitCode(){return r.exitCode},stderr:r.stderr,stdout:r.stdout,exited:r.exited.then(()=>typeof r.exitCode==`number`?r.exitCode:1),kill:e=>r.kill?.(e)??!1,unref:()=>r.unref?.()}}async function L(e,t){let n=await Ve(e,t,`json`);if(n)try{return JSON.parse(n)}catch{return}}async function Ve(e,t,n=`text`){let r=await w(),i=r.versionCacheTtlHours*60*60*1e3,a=b().cacheMode,o=a===`no-cache`?{entries:{}}:await Ue(),s=o.entries[t],c=Date.now();if(a===`default`&&s&&s.expiresAt>c)return R(s,i),s.body;let l=await He(e,{headers:a!==`no-cache`&&s?.etag?{"If-None-Match":s.etag}:void 0,retries:r.networkRetries,timeoutMs:r.networkTimeoutMs});if(!l)return s&&R(s,i),s?.body;if(l.status===304&&s)return o.entries[t]={...s,expiresAt:c+i,fetchedAt:c},a!==`no-cache`&&await We(o),Ke(c,c+i),s.body;if(!l.ok)return s&&R(s,i),s?.body;let u=await l.text();if(n===`json`)try{JSON.parse(u)}catch{return s&&R(s,i),s?.body}let d={body:u,etag:l.headers.get(`etag`)??void 0,expiresAt:c+i,fetchedAt:c};return a!==`no-cache`&&(o.entries[t]=d,await We(o)),Ke(c,c+i),u}async function He(e,t){for(let n=0;n<=t.retries;n++){let r=new AbortController,i=setTimeout(()=>r.abort(),t.timeoutMs);try{return await fetch(e,{headers:t.headers,signal:r.signal})}catch{if(n===t.retries)return}finally{clearTimeout(i)}}}async function Ue(){try{return JSON.parse(await l(Ge(),`utf8`))}catch{return{entries:{}}}}async function We(e){await s(_(S(),`cache`),{recursive:!0}),await m(Ge(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}function Ge(){return _(S(),`cache`,`versions.json`)}function R(e,t){let n=e.fetchedAt??Math.max(0,e.expiresAt-t);pe({fetchedAt:new Date(n).toISOString(),source:`cache`,staleAfter:new Date(e.expiresAt).toISOString()})}function Ke(e,t){pe({fetchedAt:new Date(e).toISOString(),source:`network`,staleAfter:new Date(t).toISOString()})}const qe=/v?(\d+\.\d+\.\d+(?:-[a-z0-9.]+)?)/i;function Je(e,t){if(t)return t(e);let n=e.trim().split(`
|
|
2
|
-
`)[0],r=n.match(qe);return r?r[1]:n||void 0}function Ye(e,t){let n=Qe(e),r=Qe(t);if(!(!n||!r)){for(let e=0;e<3;e+=1){let t=n.core[e]-r.core[e];if(t!==0)return t>0?1:-1}return $e(n.prerelease,r.prerelease)}}function z(e,t){return Ye(e,t)===1}async function B(e,t){let n=t?.command??[e,`--version`];try{let{exitCode:e,stdout:r}=await F(P(n));return e===0?Je(r,t?.parser):void 0}catch{return}}async function V(e,t=`latest`,n={}){try{let r=x(n.registry)??`https://registry.npmjs.org`;return(await L(ve(e,t,r),`npm:${r}:${e}:${t}`))?.version}catch{return}}async function Xe(e){try{let{exitCode:t,stdout:r}=await F(P([n.platform===`win32`?`where`:`which`,e]));return t===0?r.trim().split(`
|
|
3
|
-
`)[0]:void 0}catch{return}}async function Ze(e){if(e)try{return await u(e)}catch{return e}}function Qe(e){let t=e.trim().match(/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9a-z.-]+))?$/i);if(t)return{core:[Number(t[1]),Number(t[2]),Number(t[3])],prerelease:t[4]?t[4].split(`.`):[]}}function $e(e,t){if(e.length===0&&t.length===0)return 0;if(e.length===0)return 1;if(t.length===0)return-1;let n=Math.max(e.length,t.length);for(let r=0;r<n;r+=1){let n=e[r],i=t[r];if(n===void 0)return-1;if(i===void 0)return 1;if(n===i)continue;let a=/^\d+$/.test(n),o=/^\d+$/.test(i);return a&&o?Number(n)>Number(i)?1:-1:a?-1:o||n>i?1:-1}return 0}const et={installedAgents:{},self:{}};function H(){return _(S(),`state.json`)}async function U(){return ct()}async function tt(e){let t=await O({resource:`state`,scope:[`state`]});try{await ft(e)}finally{await t()}}async function nt(e){return(await U()).installedAgents[e]}async function rt(e){await W(t=>{t.installedAgents[e.agentName]=e})}async function it(e){await W(t=>{delete t.installedAgents[e]})}async function at(){return(await U()).self}async function ot(e){await W(t=>{t.self.installSource=e})}async function st(e,t){await W(n=>{n.self.updateNoticeVersion=e,n.self.updateNoticeAt=t})}async function ct(){try{let e=JSON.parse(await l(H(),`utf8`)),t=lt(e.self);return{installedAgents:e.installedAgents??{},self:t}}catch{return{...et}}}function lt(e){if(!dt(e))return{};let t={...e};return ut(e.installSource)?t.installSource=e.installSource:delete t.installSource,typeof e.updateNoticeAt==`string`?t.updateNoticeAt=e.updateNoticeAt:delete t.updateNoticeAt,typeof e.updateNoticeVersion==`string`?t.updateNoticeVersion=e.updateNoticeVersion:delete t.updateNoticeVersion,t}function ut(e){return e===`binary`||e===`bun`||e===`npm`||e===`source`||e===`unknown`}function dt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function ft(e){await s(S(),{recursive:!0}),await m(H(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}async function W(e){let t=await O({resource:`state`,scope:[`state`]});try{let t=await ct();await e(t),await ft(t)}finally{await t()}}function pt(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function G(e=n.execPath){if(h(pt(e)).endsWith(`.exe`))return`quantex-windows-x64.exe`;if(n.platform===`darwin`)return n.arch===`arm64`?`quantex-darwin-arm64`:`quantex-darwin-x64`;if(n.platform===`linux`)return n.arch===`arm64`?`quantex-linux-arm64`:`quantex-linux-x64`}function mt(e=n.execPath){let t=G(e);if(t)return`${A}/releases/latest/download/${t}`}function ht(e,t,r=n.env){return e||(r.QUANTEX_UPDATE_CHANNEL===`beta`?`beta`:r.QUANTEX_UPDATE_CHANNEL===`stable`?`stable`:t===`beta`?`beta`:`stable`)}async function gt(e){let t=await L(await _t(e),`self:manifest:${e}`);if(!t)throw Error(`Failed to download release manifest.`);return t}async function _t(e){if(e===`stable`)return`${A}/releases/latest/download/manifest.json`;let t=(await vt(e)).assets.find(e=>e.name===`manifest.json`);if(!t?.browser_download_url)throw Error(`No manifest.json asset was found for the ${e} release channel.`);return t.browser_download_url}async function vt(e){let t=bt();if(!t)throw Error(`Failed to resolve the GitHub repository slug for Quantex releases.`);let n=await L(`https://api.github.com/repos/${t}/releases?per_page=20`,`self:github-releases`);if(!n)throw Error(`Failed to query GitHub releases.`);let r=n.find(t=>e===`beta`?t.prerelease:!t.prerelease);if(!r)throw Error(`No GitHub release was found for the ${e} channel.`);return r}function yt(e,t=n.execPath){let r=n.platform,i=n.arch===`arm64`?`arm64`:`x64`,a=G(t);return e.assets.find(e=>e.platform===r&&e.arch===i&&(!a||e.name===a))}function bt(){return A.match(/github\.com\/([^/]+\/[^/]+)$/)?.[1]}const xt=k,St=`/node_modules/${xt}`;async function Ct(e){let t=await Et(),r=n.execPath,i=t.foundPackageJson?K(t.packageRoot):K(``,r),a=await Tt((await at()).installSource,i),o=await w(),s=ht(e?.updateChannel,o.selfUpdateChannel);return{canAutoUpdate:wt(a),currentVersion:t.version||`0.20.0`,executablePath:r,installSource:a,packageRoot:t.packageRoot,updateChannel:s}}function wt(e){return e===`binary`||e===`bun`||e===`npm`}async function Tt(e,t){return t!==`unknown`&&e!==t?(await ot(t),t):e??t}function K(e,t=n.execPath){let r=Ot(e);return r.includes(`/.bun/install/global/`)?`bun`:r.includes(St)?`npm`:r?`source`:kt(t)?`binary`:`unknown`}async function Et(e=import.meta.url){let t=At(e),n=g(t);for(;;){let e=_(n,`package.json`),t=await Dt(e);if(t?.name===xt)return{foundPackageJson:!0,packageJsonPath:e,packageRoot:n,version:t.version??`0.20.0`};let r=g(n);if(r===n)break;n=r}return{foundPackageJson:!1,packageJsonPath:_(g(t),`package.json`),packageRoot:g(t),version:j}}function q(){return j}async function Dt(e){try{return JSON.parse(await l(e,`utf8`))}catch{return}}function Ot(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function kt(e){let t=h(Ot(e));return t!==`bun`&&t!==`bun.exe`}function At(e){try{return re(e)}catch{return n.execPath}}async function jt(e,t,r=n.env,i=n.cwd()){if(e!==`bun`&&e!==`npm`)return;let a=x(r.QTX_SELF_UPDATE_REGISTRY);return a?{isOverride:!0,registry:a,source:`quantex-env`}:t.selfUpdateRegistry?{isOverride:!0,registry:t.selfUpdateRegistry,source:`quantex-config`}:await Mt(e,r,i)||{isOverride:!1,registry:_e,source:`fallback`}}async function Mt(e,t,n){if(e===`bun`){let e=Nt(t,[`BUN_CONFIG_REGISTRY`,`NPM_CONFIG_REGISTRY`,`npm_config_registry`]);if(e)return{isOverride:!1,registry:e,source:`bun-env`};let r=await Pt(n,t);if(r)return{isOverride:!1,registry:r,source:`bunfig`}}let r=Nt(t,[`NPM_CONFIG_REGISTRY`,`npm_config_registry`]);if(r)return{isOverride:!1,registry:r,source:`npm-env`};let i=await It(n,t);if(i)return{isOverride:!1,registry:i,source:`npmrc`}}function Nt(e,t){for(let n of t){let t=x(e[n]);if(t)return t}}async function Pt(e,t){let n=zt(t),i=t.XDG_CONFIG_HOME,a=Rt(e,`bunfig.toml`),o=[_(n,`.bunfig.toml`),i?_(i,`.bunfig.toml`):void 0];if(a){let e=await Ft(a);if(e)return e}for(let e of o){if(!e||!r(e))continue;let t=await Ft(e);if(t)return t}}async function Ft(e){try{return Bt(await l(e,`utf8`))}catch{return}}async function It(e,t){let n=zt(t),i=Rt(e,`.npmrc`),a=_(n,`.npmrc`);if(i){let e=await Lt(i);if(e)return e}if(r(a))return Lt(a)}async function Lt(e){try{let t=(await l(e,`utf8`)).split(`
|
|
4
|
-
`).map(e=>e.trim());for(let e=t.length-1;e>=0;--e){let n=t[e];if(!n||n.startsWith(`#`)||n.startsWith(`;`))continue;let r=n.match(/^registry\s*=\s*(.+)$/);if(!r?.[1])continue;let i=x(r[1]);if(i)return i}}catch{}}function Rt(e,t){let n=e;for(;;){let e=_(n,t);if(r(e))return e;let i=g(n);if(i===n)return;n=i}}function zt(e){return e.HOME||e.USERPROFILE||ee()}function Bt(e){let t=Vt(e,[/(?:^|\n)\s*install\.registry\s*=\s*["']([^"'#\n]+)["']/,/(?:^|\n)\s*install\.registry\s*=\s*\{\s*url\s*=\s*["']([^"'#\n]+)["']/,/(?:^|\n)\s*install\s*=\s*\{[\s\S]*?\bregistry\s*=\s*["']([^"'#\n]+)["'][\s\S]*?\}/,/(?:^|\n)\s*install\s*=\s*\{[\s\S]*?\bregistry\s*=\s*\{\s*url\s*=\s*["']([^"'#\n]+)["'][\s\S]*?\}[\s\S]*?\}/]);if(t)return x(t);let n=e.match(/(?:^|\n)\s*\[install\]\s*\n([\s\S]*?)(?=\n\s*\[[^\]]+\]|\s*$)/)?.[1];if(n)return x(Vt(n,[/(?:^|\n)\s*registry\s*=\s*["']([^"'#\n]+)["']/,/(?:^|\n)\s*registry\s*=\s*\{\s*url\s*=\s*["']([^"'#\n]+)["']/]))}function Vt(e,t){for(let n of t){let t=e.match(n)?.[1];if(t)return t}}async function Ht(e){let t=await w();if(e.installSource===`binary`)try{let t=await gt(e.updateChannel),n=yt(t,e.executablePath);return n?{binaryAsset:n,targetVersion:t.version}:{resolutionError:{detail:{channel:e.updateChannel},kind:`unsupported`,message:`No binary asset is available for the current platform on the ${e.updateChannel} channel.`}}}catch{return{resolutionError:{kind:`network`,message:`Failed to resolve the ${e.updateChannel} release manifest.`}}}let n=e.updateChannel===`beta`?`beta`:`latest`,r=await V(k,n,{registry:_e});if(e.installSource===`bun`||e.installSource===`npm`){let i=await jt(e.installSource,t);return{managedRegistry:i?.registry,managedRegistryIsOverride:i?.isOverride??!1,packageTag:n,targetVersion:await V(k,n,{registry:i?.registry}),upstreamLatestVersion:r,verificationCommand:Jt(e.packageRoot)}}return{packageTag:n,targetVersion:r,upstreamLatestVersion:r}}async function J(e){let t=e?.facts??await Ct({updateChannel:e?.updateChannel}),n=e?.target??await Ht(t),r=n.targetVersion?z(n.targetVersion,t.currentVersion):!1;return{facts:t,status:Kt(t,n,r),target:n,updateAvailable:r}}function Ut(e){return{canAutoUpdate:e.facts.canAutoUpdate,currentVersion:e.facts.currentVersion,executablePath:e.facts.executablePath,installSource:e.facts.installSource,latestVersion:e.target.targetVersion,managedRegistry:e.target.managedRegistry,managedRegistryIsOverride:e.target.managedRegistryIsOverride,packageRoot:e.facts.packageRoot,recommendedUpgradeCommand:e.facts.canAutoUpdate?`quantex upgrade`:void 0,upstreamLatestVersion:e.target.upstreamLatestVersion,updateChannel:e.facts.updateChannel}}async function Wt(e,t){if(!t.success||e.facts.installSource!==`bun`&&e.facts.installSource!==`npm`)return t;let n=await qt(e);if(!n)return{error:{kind:`verify`,message:`Managed self-upgrade finished but Quantex could not verify the installed version afterwards.`},installSource:e.facts.installSource,success:!1};let r=t.newVersion??e.target.targetVersion;return r&&n!==r?{error:{detail:{expectedVersion:r,observedVersion:n},kind:`verify`,message:`Managed self-upgrade installed version ${n}, but expected ${r}.`},installSource:e.facts.installSource,success:!1}:!r&&n===e.facts.currentVersion&&e.target.targetVersion!==void 0?{error:{detail:{observedVersion:n},kind:`verify`,message:`Managed self-upgrade completed without changing the installed Quantex version.`},installSource:e.facts.installSource,success:!1}:{...t,newVersion:n}}function Gt(e){let t={canAutoUpdate:e.canAutoUpdate,currentVersion:e.currentVersion,executablePath:e.executablePath,installSource:e.installSource,packageRoot:e.packageRoot,updateChannel:e.updateChannel},n={managedRegistry:e.managedRegistry,managedRegistryIsOverride:e.managedRegistryIsOverride,packageTag:e.updateChannel===`beta`?`beta`:`latest`,targetVersion:e.latestVersion,upstreamLatestVersion:e.upstreamLatestVersion,verificationCommand:Jt(e.packageRoot)},r=e.latestVersion?z(e.latestVersion,e.currentVersion):!1;return{facts:t,status:Kt(t,n,r),target:n,updateAvailable:r}}function Kt(e,t,n){return e.canAutoUpdate?t.targetVersion&&!n?`up-to-date`:t.targetVersion?`update-available`:`check-unavailable`:`manual-required`}async function qt(e){if(e.target.verificationCommand){let t=await B(e.facts.executablePath,{command:e.target.verificationCommand});if(t)return t}return B(e.facts.executablePath)}function Jt(e){if(e)return[n.execPath,_(e,`dist`,`cli.mjs`),`--version`]}async function Yt(e,t,r,i){let a;try{a=await fetch(e)}catch(t){return X(`network`,`Failed to download ${e}.`,t)}if(!a.ok)return X(`network`,`Failed to download ${e}: HTTP ${a.status}.`);let s=await c(_(g(t),`.quantex-upgrade-`)),l=_(s,h(t)),u=`${t}.bak`,p=!1;try{let c=ie.from(await a.arrayBuffer()),h=await Xt(t),g=nn(c);if(g!==rn(r))return X(`checksum`,`Checksum mismatch for ${e}. Expected ${rn(r)}, got ${g}.`);if(await m(l,c),n.platform===`win32`)return Zt(l,t,u,s,i);await o(l,h),await f(u,{force:!0}),await d(t,u),p=!0,await d(l,t);let _=await tn(t,i);return _.success?(p=!1,await f(u,{force:!0}),{success:!0}):(await en(u,t),p=!1,_)}catch(e){if(p){try{await en(u,t)}catch{}p=!1}return X($t(e),`Failed to replace the current Quantex binary.`,e)}finally{n.platform!==`win32`&&await f(s,{recursive:!0,force:!0})}}async function Xt(e){try{return(await p(e)).mode&511}catch{return 493}}function Zt(e,t,r,i,a){try{return P([`powershell.exe`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-WindowStyle`,`Hidden`,`-Command`,Qt(e,t,r,i,n.pid,a)],{stdio:[`ignore`,`ignore`,`ignore`],windowsHide:!0}).unref(),{success:!0}}catch(e){return X(`locked`,`Failed to schedule Windows binary replacement.`,e)}}function Qt(e,t,n,r,i,a){let o=Y(e),s=Y(t),c=Y(n),l=Y(r),u=Y(a??``);return[`$pidToWait = ${i}`,`$tempPath = '${o}'`,`$targetPath = '${s}'`,`$backupPath = '${c}'`,`$tempDir = '${l}'`,`$expectedVersion = '${u}'`,`while (Get-Process -Id $pidToWait -ErrorAction SilentlyContinue) { Start-Sleep -Milliseconds 200 }`,`for ($attempt = 0; $attempt -lt 50; $attempt++) {`,` try {`,` if (Test-Path -LiteralPath $backupPath) { Remove-Item -LiteralPath $backupPath -Force -ErrorAction SilentlyContinue }`,` Move-Item -LiteralPath $targetPath -Destination $backupPath -Force -ErrorAction Stop`,` break`,` }`,` catch {`,` Start-Sleep -Milliseconds 200`,` }`,`}`,`Move-Item -LiteralPath $tempPath -Destination $targetPath -Force`,`if ($expectedVersion -ne '') {`,` $output = & $targetPath --version 2>$null`,` if ($LASTEXITCODE -ne 0 -or ($output -notmatch [regex]::Escape($expectedVersion))) {`,` Remove-Item -LiteralPath $targetPath -Force -ErrorAction SilentlyContinue`,` Move-Item -LiteralPath $backupPath -Destination $targetPath -Force`,` Remove-Item -LiteralPath $tempDir -Force -Recurse -ErrorAction SilentlyContinue`,` exit 1`,` }`,`}`,`Remove-Item -LiteralPath $backupPath -Force -ErrorAction SilentlyContinue`,`Remove-Item -LiteralPath $tempDir -Force -Recurse -ErrorAction SilentlyContinue`].join(`; `)}function Y(e){return e.replaceAll(`'`,`''`)}function X(e,t,n){return{error:{detail:n,kind:e,message:t},success:!1}}function $t(e){let t=typeof e==`object`&&e&&`code`in e?String(e.code):``;return t===`EACCES`||t===`EPERM`?`permission`:t===`EBUSY`?`locked`:`unknown`}async function en(e,t){await f(t,{force:!0}),await d(e,t)}async function tn(e,t){if(!t)return{success:!0};try{let{exitCode:n,stdout:r}=await F(P([e,`--version`],{stdio:[`ignore`,`pipe`,`ignore`]}));return n===0?r.includes(t)?{success:!0}:X(`verify`,`The upgraded Quantex binary reported an unexpected version during verification.`):X(`verify`,`The upgraded Quantex binary exited with code ${n} during verification.`)}catch(e){return X(`verify`,`Failed to execute the upgraded Quantex binary for verification.`,e)}}function nn(t){return e(`sha256`).update(t).digest(`hex`)}function rn(e){return e.trim().toLowerCase()}const an={source:`binary`,canHandle:e=>on(e)===`binary`,getRecoveryHint:(e,t)=>{let n=t?.error?.detail&&typeof t.error.detail==`object`&&`downloadUrl`in t.error.detail?String(t.error.detail.downloadUrl):mt(e.executablePath);if(n)return t?.error?.kind===`locked`?`close other qtx processes and retry, or download and replace the binary from ${n}`:t?.error?.kind===`permission`?`check write permission for the current binary path, or download and replace the binary from ${n}`:t?.error?.kind===`network`?`check network access and retry, or download and replace the binary from ${n}`:`download and replace the binary from ${n}`},async upgrade(e){let t=e.target.binaryAsset;if(!t)return{error:e.target.resolutionError??{kind:`unsupported`,message:`No release artifact is available for the current platform and architecture.`},installSource:e.facts.installSource,success:!1};let n=await Yt(t.downloadUrl,e.facts.executablePath,t.checksum,e.target.targetVersion??`latest`);return{...!n.success&&n.error?{...n,error:{...n.error,detail:{...typeof n.error.detail==`object`&&n.error.detail?n.error.detail:{},downloadUrl:t.downloadUrl}}}:n,installSource:e.facts.installSource,newVersion:n.success?e.target.targetVersion:void 0}}};function on(e){return`facts`in e?e.facts.installSource:e.installSource}async function sn(e,t,n){try{let r=t?`${e}@${t}`:e,i=x(n);return await Z([`bun`,`add`,`-g`,...i?[`--registry`,i]:[],r],[e])}catch{return!1}}async function cn(e,t=`latest-major`,n=`latest`,r){try{let i=n===`latest`?e:`${e}@${n}`,a=x(r);return await Z([`bun`,`update`,`-g`,...t===`latest-major`?[`--latest`]:[],...a?[`--registry`,a]:[],i],[e])}catch{return!1}}async function ln(e,t=`latest-major`){if(e.length===0)return!0;try{return await Z([`bun`,`update`,`-g`,...t===`latest-major`?[`--latest`]:[],...e],e)}catch{return!1}}async function un(e){try{return await N(M([`bun`,`remove`,`-g`,e]))===0}catch{return!1}}async function dn(e){try{let{exitCode:t,stdout:n}=await F(P([`bun`,`pm`,`-g`,`ls`],{stdio:gn()}));return t===0?fn(n,e):void 0}catch{return}}function fn(e,t){let n=`${t}@`;for(let t of e.split(`
|
|
5
|
-
`)){let e=t.trim().split(/\s+/).at(-1);if(!e?.startsWith(n))continue;let r=e.slice(n.length);if(r)return r}}async function Z(e,t){return await N(M(e))===0?pn(t):!1}async function pn(e){let t=[...new Set(e)];if(t.length===0)return!0;let n=await mn();if(!n)return!0;let r=hn(n),i=t.filter(e=>r.has(e));return i.length===0?!0:await N(M([`bun`,`pm`,`-g`,`trust`,...i]))===0}async function mn(){try{let{exitCode:e,stdout:t}=await F(P([`bun`,`pm`,`-g`,`untrusted`],{stdio:gn()}));return e===0?t:void 0}catch{return}}function hn(e){let t=new Set;for(let n of e.split(`
|
|
6
|
-
`)){let e=n.replaceAll(`\\`,`/`).match(/^\.\/node_modules\/(.+?) @/);e?.[1]&&t.add(e[1])}return t}function gn(){return[`ignore`,`pipe`,`ignore`]}const _n={source:`bun`,canHandle:e=>vn(e)===`bun`,getRecoveryHint:e=>`bun add -g ${k}@${e.updateChannel===`beta`?`beta`:`latest`}`,async upgrade(e){let t=await sn(k,e.target.packageTag??(e.facts.updateChannel===`beta`?`beta`:`latest`),e.target.managedRegistry);return{error:t?void 0:{kind:`unknown`,message:`Failed to update ${k} through Bun.`},installSource:e.facts.installSource,newVersion:t?e.target.targetVersion:void 0,success:t}}};function vn(e){return`facts`in e?e.facts.installSource:e.installSource}async function Q(e,t,n){try{let r=t?`${e}@${t}`:e,i=x(n);return await N(M([`npm`,`install`,`-g`,r,...i?[`--registry`,i]:[]]))===0}catch{return!1}}async function yn(e,t=`latest-major`,n=`latest`,r){try{let i=x(r);return await N(M(t===`latest-major`?[`npm`,`install`,`-g`,`${e}@${n}`,...i?[`--registry`,i]:[]]:[`npm`,`update`,`-g`,e,...i?[`--registry`,i]:[]]))===0}catch{return!1}}async function bn(e,t=`latest-major`){if(e.length===0)return!0;try{return await N(M(t===`latest-major`?[`npm`,`install`,`-g`,...e.map(e=>`${e}@latest`)]:[`npm`,`update`,`-g`,...e]))===0}catch{return!1}}async function xn(e){try{return await N(M([`npm`,`uninstall`,`-g`,e]))===0}catch{return!1}}async function Sn(e){try{let{exitCode:t,stdout:n}=await F(P([`npm`,`list`,`-g`,`--depth=0`,`--json`],{stdio:[`ignore`,`pipe`,`ignore`]}));return t===0?Cn(n,e):void 0}catch{return}}function Cn(e,t){let n=JSON.parse(e).dependencies?.[t]?.version;return typeof n==`string`?n:void 0}const wn={source:`npm`,canHandle:e=>Tn(e)===`npm`,getRecoveryHint:e=>`npm install -g ${k}@${e.updateChannel===`beta`?`beta`:`latest`}`,async upgrade(e){let t=await Q(k,e.target.packageTag??(e.facts.updateChannel===`beta`?`beta`:`latest`),e.target.managedRegistry);return{error:t?void 0:{kind:`unknown`,message:`Failed to update ${k} through npm.`},installSource:e.facts.installSource,newVersion:t?e.target.targetVersion:void 0,success:t}}};function Tn(e){return`facts`in e?e.facts.installSource:e.installSource}const En={source:`source`,canHandle:e=>{let t=`facts`in e?e.facts.installSource:e.installSource;return t===`source`||t===`unknown`},getRecoveryHint:()=>void 0,async upgrade(e){return{error:{kind:`unsupported`,message:`Install source "${e.facts.installSource}" does not support auto-update.`},installSource:e.facts.installSource,success:!1}}},Dn=[_n,wn,an,En];function $(e){return Dn.find(t=>t.canHandle(e))??En}function On(e,t,n=`stable`){return $({canAutoUpdate:e===`binary`||e===`bun`||e===`npm`,currentVersion:``,executablePath:t,installSource:e,packageRoot:``,updateChannel:n})}function kn(e,t,n=`stable`,r){return r?.error?.kind===`locked`?`another qtx upgrade is already running; wait for it to finish and retry`:On(e,t,n).getRecoveryHint({canAutoUpdate:e===`binary`||e===`bun`||e===`npm`,currentVersion:``,executablePath:t,installSource:e,packageRoot:``,updateChannel:n},r)}function An(e,t){return t?.error?.kind===`locked`?`another qtx upgrade is already running; wait for it to finish and retry`:$(e).getRecoveryHint(e,t)}async function jn(e){return Ut(await J({updateChannel:e?.updateChannel}))}async function Mn(e){let t=await Pn(e),n=await Fe();if(!n)return{error:{kind:`locked`,message:`Another qtx upgrade is already running.`},installSource:t.facts.installSource,success:!1};try{return Wt(t,await $(t).upgrade(t))}finally{await n()}}function Nn(e,t=n.execPath){return kn(e,t)}async function Pn(e){return e?`facts`in e?e:e.installSource===`binary`?J({facts:{canAutoUpdate:e.canAutoUpdate,currentVersion:e.currentVersion,executablePath:e.executablePath,installSource:e.installSource,packageRoot:e.packageRoot,updateChannel:e.updateChannel}}):Gt(e):J()}function Fn(e){return zn({...e,error:null,ok:!0})}function In(e){return zn({...e,ok:!1})}function Ln(e,t,n={}){let r=b();return r.cancelled&&!n.force||(r.outputMode===`json`?console.log(JSON.stringify(e,null,2)):r.outputMode===`ndjson`?Vn({action:e.action,data:e,target:e.target,type:`result`}):t(e)),e}function Rn(e,t={}){let n=b();if(!(n.cancelled&&!t.force)&&n.outputMode===`ndjson`)return Vn(e)}function zn(e){let t=b();return{action:e.action,data:e.data,error:e.error??null,exitCode:e.exitCode,meta:{fetchedAt:t.freshness?.fetchedAt,mode:t.outputMode,runId:t.runId,schemaVersion:`1`,source:t.freshness?.source,staleAfter:t.freshness?.staleAfter,timestamp:new Date().toISOString(),version:q()},ok:e.ok,target:e.target,warnings:e.warnings??[]}}function Bn(e){let t=b();return{action:e.action,data:e.data,meta:{fetchedAt:t.freshness?.fetchedAt,mode:`ndjson`,runId:t.runId,schemaVersion:`1`,source:t.freshness?.source,staleAfter:t.freshness?.staleAfter,timestamp:new Date().toISOString(),version:q()},target:e.target,type:e.type}}function Vn(e){let t=Bn(e);return console.log(JSON.stringify(t)),t}const{createColors:Hn,isColorSupported:Un}=ae;function Wn(){let e=b().colorMode??`auto`;return Hn(e===`always`?!0:e===`never`?!1:Un)}const Gn=new Proxy({},{get(e,t){let n=Wn(),r=n[t];return typeof r==`function`?r.bind(n):r}});export{be as $,H as A,V as B,wt as C,mt as D,G as E,ot as F,M as G,z as H,st as I,we as J,N as K,Ye as L,it as M,tt as N,nt as O,rt as P,T as Q,Xe as R,J as S,q as T,F as U,Ze as V,P as W,S as X,Pe as Y,C as Z,sn as _,Ln as a,b as at,ln as b,Mn as c,se as ct,Sn as d,w as et,Q as f,dn as g,bn as h,Rn as i,de as it,U as j,at as k,kn as l,yn as m,In as n,ye as nt,Nn as o,ce as ot,xn as p,k as q,Fn as r,x as rt,jn as s,le as st,Gn as t,xe as tt,An as u,un as v,K as w,Ut as x,cn as y,B as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./commands-B_Hju0lq.mjs";export{e as commandsCommand};
|
package/dist/detect-DWabXMgY.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as e,W as t}from"./color-DEbCq7kh.mjs";import{toJSONSchema as n,z as r}from"zod";import i from"node:process";const a=[{name:`amp`,displayName:`Amp`,homepage:`https://ampcode.com/`,packages:{npm:`@sourcegraph/amp`},binaryName:`amp`,selfUpdate:{command:[`amp`,`update`]},versionProbe:{command:[`amp`,`version`]},platforms:{windows:[{type:`bun`},{type:`npm`}],macos:[{type:`bun`},{type:`npm`}],linux:[{type:`bun`},{type:`npm`}]}},{name:`auggie`,displayName:`Auggie CLI`,homepage:`https://docs.augmentcode.com/cli/overview`,packages:{npm:`@augmentcode/auggie`},binaryName:`auggie`,selfUpdate:{command:[`auggie`,`upgrade`]},versionProbe:{command:[`auggie`,`--version`]},platforms:{macos:[{type:`bun`},{type:`npm`}],linux:[{type:`bun`},{type:`npm`}]}},{name:`autohand`,lookupAliases:[`autohand-cli`],displayName:`Autohand Code CLI`,homepage:`https://autohand.ai/cli/`,packages:{npm:`autohand-cli`},binaryName:`autohand`,versionProbe:{command:[`autohand`,`--version`]},platforms:{windows:[{command:`iwr -useb https://autohand.ai/install.ps1 | iex`,type:`script`}],macos:[{command:`curl -fsSL https://autohand.ai/install.sh | bash`,type:`script`}],linux:[{command:`curl -fsSL https://autohand.ai/install.sh | bash`,type:`script`}]}},{name:`claude`,displayName:`Claude Code`,homepage:`https://code.claude.com/docs`,packages:{npm:`@anthropic-ai/claude-code`},binaryName:`claude`,selfUpdate:{command:[`claude`,`update`],fallbackCommands:[[`claude`,`upgrade`]]},platforms:{windows:[{type:`bun`},{type:`npm`},{command:`irm https://claude.ai/install.ps1 | iex`,type:`script`},{packageName:`Anthropic.ClaudeCode`,packageTargetKind:`id`,type:`winget`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://claude.ai/install.sh | bash`,type:`script`},{packageName:`claude-code`,packageTargetKind:`cask`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://claude.ai/install.sh | bash`,type:`script`},{packageName:`claude-code`,packageTargetKind:`cask`,type:`brew`}]}},{name:`codebuddy`,lookupAliases:[`codebuddy-code`],displayName:`CodeBuddy Code`,homepage:`https://www.codebuddy.cn/docs/cli/installation`,packages:{npm:`@tencent-ai/codebuddy-code`},binaryName:`codebuddy`,selfUpdate:{command:[`codebuddy`,`update`]},versionProbe:{command:[`codebuddy`,`--version`]},platforms:{windows:[{type:`bun`},{type:`npm`},{command:`irm https://www.codebuddy.cn/cli/install.ps1 | iex`,type:`script`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash`,type:`script`},{packageName:`Tencent-CodeBuddy/tap/codebuddy-code`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash`,type:`script`},{packageName:`Tencent-CodeBuddy/tap/codebuddy-code`,type:`brew`}]}},{name:`codex`,displayName:`Codex CLI`,homepage:`https://developers.openai.com/codex/cli`,packages:{mise:`npm:@openai/codex`,npm:`@openai/codex`},binaryName:`codex`,selfUpdate:{command:[`codex`,`--upgrade`]},platforms:{windows:[{type:`bun`},{type:`npm`},{type:`mise`}],macos:[{type:`bun`},{type:`npm`},{type:`mise`},{packageName:`codex`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{type:`mise`},{packageName:`codex`,type:`brew`}]}},{name:`copilot`,displayName:`GitHub Copilot CLI`,homepage:`https://github.com/features/copilot/cli`,packages:{npm:`@github/copilot`},binaryName:`copilot`,platforms:{windows:[{packageName:`GitHub.Copilot`,packageTargetKind:`id`,type:`winget`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://gh.io/copilot-install | bash`,type:`script`},{packageName:`copilot-cli`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://gh.io/copilot-install | bash`,type:`script`},{packageName:`copilot-cli`,type:`brew`}]}},{name:`crush`,displayName:`Crush`,homepage:`https://github.com/charmbracelet/crush`,packages:{npm:`@charmland/crush`},binaryName:`crush`,selfUpdate:{command:[`crush`,`update`]},versionProbe:{command:[`crush`,`--version`]},platforms:{windows:[{type:`bun`},{type:`npm`},{packageName:`charmbracelet.crush`,packageTargetKind:`id`,type:`winget`}],macos:[{type:`bun`},{type:`npm`},{packageName:`charmbracelet/tap/crush`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{packageName:`charmbracelet/tap/crush`,type:`brew`}]}},{name:`cursor`,lookupAliases:[`agent`],displayName:`Cursor CLI`,homepage:`https://cursor.com/docs/cli`,binaryName:`agent`,selfUpdate:{command:[`agent`,`update`]},versionProbe:{command:[`agent`,`--version`]},platforms:{windows:[{command:`irm 'https://cursor.com/install?win32=true' | iex`,type:`script`}],macos:[{command:`curl https://cursor.com/install -fsS | bash`,type:`script`}],linux:[{command:`curl https://cursor.com/install -fsS | bash`,type:`script`}]}},{name:`deepseek`,lookupAliases:[`deepseek-tui`],displayName:`DeepSeek TUI`,homepage:`https://github.com/Hmbown/DeepSeek-TUI`,packages:{cargo:`deepseek-tui-cli`,npm:`deepseek-tui`},binaryName:`deepseek`,selfUpdate:{command:[`deepseek`,`update`]},versionProbe:{command:[`deepseek`,`--version`]},platforms:{windows:[{type:`npm`},{packageInstallArgs:[`--locked`],type:`cargo`}],macos:[{type:`npm`},{packageInstallArgs:[`--locked`],type:`cargo`}],linux:[{type:`npm`},{packageInstallArgs:[`--locked`],type:`cargo`}]}},{name:`devin`,displayName:`Devin for Terminal`,homepage:`https://cli.devin.ai/`,binaryName:`devin`,selfUpdate:{command:[`devin`,`update`]},versionProbe:{command:[`devin`,`version`]},platforms:{windows:[{command:`irm https://static.devin.ai/cli/setup.ps1 | iex`,type:`script`}],macos:[{command:`curl -fsSL https://cli.devin.ai/install.sh | bash`,type:`script`}],linux:[{command:`curl -fsSL https://cli.devin.ai/install.sh | bash`,type:`script`}]}},{name:`droid`,displayName:`Droid`,homepage:`https://docs.factory.ai/cli/getting-started/overview`,packages:{npm:`droid`},binaryName:`droid`,selfUpdate:{command:[`droid`,`update`]},platforms:{windows:[{type:`bun`},{type:`npm`},{command:`irm https://app.factory.ai/cli/windows | iex`,type:`script`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://app.factory.ai/cli | sh`,type:`script`},{packageName:`droid`,packageTargetKind:`cask`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://app.factory.ai/cli | sh`,type:`script`},{packageName:`droid`,packageTargetKind:`cask`,type:`brew`}]}},{name:`forgecode`,lookupAliases:[`forge`],displayName:`ForgeCode`,homepage:`https://forgecode.dev`,packages:{npm:`forgecode`},binaryName:`forge`,selfUpdate:{command:[`forge`,`update`]},versionProbe:{command:[`forge`,`--version`]},platforms:{windows:[{type:`bun`},{type:`npm`},{command:`irm https://forgecode.dev/cli | iex`,type:`script`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://forgecode.dev/cli | sh`,type:`script`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://forgecode.dev/cli | sh`,type:`script`}]}},{name:`gemini`,displayName:`Gemini CLI`,homepage:`https://google-gemini.github.io/gemini-cli/docs/`,packages:{npm:`@google/gemini-cli`},binaryName:`gemini`,platforms:{windows:[{type:`bun`},{type:`npm`}],macos:[{type:`bun`},{type:`npm`},{packageName:`gemini-cli`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{packageName:`gemini-cli`,type:`brew`}]}},{name:`goose`,displayName:`Goose`,homepage:`https://github.com/aaif-goose/goose`,binaryName:`goose`,selfUpdate:{command:[`goose`,`update`]},versionProbe:{command:[`goose`,`--version`]},platforms:{windows:[{command:`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`,type:`script`},{command:`Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aaif-goose/goose/main/download_cli.ps1" -OutFile "download_cli.ps1"; ./download_cli.ps1`,type:`script`}],macos:[{command:`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`,type:`script`},{packageName:`block-goose-cli`,type:`brew`}],linux:[{command:`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`,type:`script`},{packageName:`block-goose-cli`,type:`brew`}]}},{name:`jcode`,displayName:`JCode`,homepage:`https://github.com/1jehuang/jcode`,binaryName:`jcode`,versionProbe:{command:[`jcode`,`--version`]},platforms:{windows:[{command:`irm https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.ps1 | iex`,type:`script`}],macos:[{packageName:`1jehuang/jcode/jcode`,type:`brew`},{command:`curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash`,type:`script`}],linux:[{command:`curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash`,type:`script`}]}},{name:`junie`,displayName:`Junie CLI`,homepage:`https://junie.jetbrains.com/docs/junie-cli.html`,packages:{npm:`@jetbrains/junie`},binaryName:`junie`,versionProbe:{command:[`junie`,`--version`]},platforms:{windows:[{type:`bun`},{type:`npm`},{command:`iex (irm 'https://junie.jetbrains.com/install.ps1')`,type:`script`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://junie.jetbrains.com/install.sh | bash`,type:`script`},{packageName:`jetbrains-junie/junie/junie`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://junie.jetbrains.com/install.sh | bash`,type:`script`},{packageName:`jetbrains-junie/junie/junie`,type:`brew`}]}},{name:`kilo`,displayName:`Kilo CLI`,homepage:`https://kilo.ai/docs/cli`,packages:{npm:`@kilocode/cli`},binaryName:`kilo`,selfUpdate:{command:[`kilo`,`upgrade`]},platforms:{windows:[{type:`bun`},{type:`npm`}],macos:[{type:`bun`},{type:`npm`}],linux:[{type:`bun`},{type:`npm`}]}},{name:`kimi`,lookupAliases:[`kimi-code`,`kimi-cli`],displayName:`Kimi Code`,homepage:`https://moonshotai.github.io/kimi-cli/`,binaryName:`kimi`,packages:{uv:`kimi-cli`},selfUpdate:{command:[`uv`,`tool`,`upgrade`,`kimi-cli`,`--no-cache`]},versionProbe:{command:[`kimi`,`--version`]},platforms:{windows:[{command:`irm https://code.kimi.com/install.ps1 | iex`,type:`script`}],macos:[{packageInstallArgs:[`--python`,`3.13`],type:`uv`},{command:`curl -LsSf https://code.kimi.com/install.sh | bash`,type:`script`}],linux:[{packageInstallArgs:[`--python`,`3.13`],type:`uv`},{command:`curl -LsSf https://code.kimi.com/install.sh | bash`,type:`script`}]}},{name:`kiro`,lookupAliases:[`kiro-cli`],displayName:`Kiro CLI`,homepage:`https://kiro.dev/cli/`,binaryName:`kiro-cli`,versionProbe:{command:[`kiro-cli`,`--version`]},platforms:{windows:[{command:`irm 'https://cli.kiro.dev/install.ps1' | iex`,type:`script`}],macos:[{command:`curl -fsSL https://cli.kiro.dev/install | bash`,type:`script`}],linux:[{command:`curl -fsSL https://cli.kiro.dev/install | bash`,type:`script`}]}},{name:`opencode`,displayName:`OpenCode`,homepage:`https://opencode.ai`,packages:{npm:`opencode-ai`},binaryName:`opencode`,selfUpdate:{command:[`opencode`,`upgrade`]},platforms:{windows:[{type:`bun`},{type:`npm`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://opencode.ai/install | bash`,type:`script`},{packageName:`anomalyco/tap/opencode`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://opencode.ai/install | bash`,type:`script`},{packageName:`anomalyco/tap/opencode`,type:`brew`}]}},{name:`openhands`,displayName:`OpenHands CLI`,homepage:`https://docs.openhands.dev/openhands/usage/cli/installation`,binaryName:`openhands`,packages:{uv:`openhands`},selfUpdate:{command:[`uv`,`tool`,`upgrade`,`openhands`,`--python`,`3.12`]},versionProbe:{command:[`openhands`,`--version`]},platforms:{macos:[{packageInstallArgs:[`--python`,`3.12`],type:`uv`},{command:`curl -fsSL https://install.openhands.dev/install.sh | sh`,type:`script`}],linux:[{packageInstallArgs:[`--python`,`3.12`],type:`uv`},{command:`curl -fsSL https://install.openhands.dev/install.sh | sh`,type:`script`}]}},{name:`pi`,displayName:`Pi`,homepage:`https://pi.dev`,packages:{npm:`@mariozechner/pi-coding-agent`},binaryName:`pi`,selfUpdate:{command:[`pi`,`update`]},platforms:{windows:[{type:`bun`},{type:`npm`}],macos:[{type:`bun`},{type:`npm`}],linux:[{type:`bun`},{type:`npm`}]}},{name:`qoder`,lookupAliases:[`qodercli`],displayName:`Qoder CLI`,homepage:`https://docs.qoder.com/cli/quick-start`,packages:{npm:`@qoder-ai/qodercli`},binaryName:`qodercli`,selfUpdate:{command:[`qodercli`,`update`]},platforms:{windows:[{type:`bun`},{type:`npm`}],macos:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://qoder.com/install | bash`,type:`script`},{packageName:`qoderai/qoder/qodercli`,packageTargetKind:`cask`,type:`brew`}],linux:[{type:`bun`},{type:`npm`},{command:`curl -fsSL https://qoder.com/install | bash`,type:`script`},{packageName:`qoderai/qoder/qodercli`,packageTargetKind:`cask`,type:`brew`}]}},{name:`qwen`,displayName:`Qwen Code`,homepage:`https://qwenlm.github.io/qwen-code-docs/`,packages:{npm:`@qwen-code/qwen-code`},binaryName:`qwen`,platforms:{windows:[{command:`curl -fsSL -o %TEMP%\\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\\install-qwen.bat`,type:`script`},{type:`bun`},{type:`npm`}],macos:[{command:`curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash`,type:`script`},{type:`bun`},{type:`npm`},{packageName:`qwen-code`,type:`brew`}],linux:[{command:`curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash`,type:`script`},{type:`bun`},{type:`npm`},{packageName:`qwen-code`,type:`brew`}]}},{name:`reasonix`,lookupAliases:[`deepseek-reasonix`],displayName:`Reasonix`,homepage:`https://github.com/esengine/DeepSeek-Reasonix`,packages:{npm:`reasonix`},binaryName:`reasonix`,selfUpdate:{command:[`reasonix`,`update`]},versionProbe:{command:[`reasonix`,`--version`]},platforms:{windows:[{type:`npm`}],macos:[{type:`npm`}],linux:[{type:`npm`}]}},{name:`vibe`,lookupAliases:[`mistral-vibe`],displayName:`Mistral Vibe`,homepage:`https://docs.mistral.ai/mistral-vibe/terminal/install`,binaryName:`vibe`,packages:{pip:`mistral-vibe`,uv:`mistral-vibe`},versionProbe:{command:[`vibe`,`--version`]},platforms:{windows:[{packageName:`mistral-vibe`,type:`uv`},{packageName:`mistral-vibe`,type:`pip`}],macos:[{command:`curl -LsSf https://mistral.ai/vibe/install.sh | bash`,type:`script`},{packageName:`mistral-vibe`,type:`uv`},{packageName:`mistral-vibe`,type:`pip`}],linux:[{command:`curl -LsSf https://mistral.ai/vibe/install.sh | bash`,type:`script`},{packageName:`mistral-vibe`,type:`uv`},{packageName:`mistral-vibe`,type:`pip`}]}},{name:`vtcode`,displayName:`VTCode`,homepage:`https://github.com/vinhnx/vtcode`,packages:{cargo:`vtcode`},binaryName:`vtcode`,selfUpdate:{command:[`vtcode`,`update`]},versionProbe:{command:[`vtcode`,`--version`]},platforms:{windows:[{command:`irm https://raw.githubusercontent.com/vinhnx/vtcode/main/scripts/install.ps1 | iex`,type:`script`},{type:`cargo`}],macos:[{command:`curl -fsSL https://raw.githubusercontent.com/vinhnx/vtcode/main/scripts/install.sh | bash`,type:`script`},{type:`cargo`},{packageName:`vtcode`,type:`brew`}],linux:[{command:`curl -fsSL https://raw.githubusercontent.com/vinhnx/vtcode/main/scripts/install.sh | bash`,type:`script`},{type:`cargo`},{packageName:`vtcode`,type:`brew`}]}}],o=r.string().min(1),s=r.array(o).min(1);r.enum([`windows`,`macos`,`linux`]);const c=r.enum([`bun`,`npm`,`brew`,`cargo`,`mise`,`pip`,`uv`,`winget`]),l=r.enum([`package`,`cask`,`id`]),u={packageInstallArgs:r.array(o).min(1).optional(),packageName:o.optional(),packageTargetKind:l.optional()},d=r.object({...u,type:c}).strict(),f=r.object({...u,command:o,type:r.literal(`script`)}).strict(),p=r.object({...u,command:o,type:r.literal(`binary`)}).strict(),m=r.discriminatedUnion(`type`,[d,f,p]),h=r.object({cargo:o.optional(),mise:o.optional(),npm:o.optional(),pip:o.optional(),uv:o.optional()}).strict().refine(e=>Object.values(e).some(Boolean),{message:`packages must include at least one package identifier`}),g=r.object({command:s,fallbackCommands:r.array(s).min(1).optional(),versionAfter:r.enum([`same-process`,`respawn`]).optional()}).strict(),ee=r.object({command:s.optional()}).strict().refine(e=>e.command!==void 0,{message:`versionProbe must include a serializable command`}),_=r.object({linux:r.array(m).min(1).optional(),macos:r.array(m).min(1).optional(),windows:r.array(m).min(1).optional()}).strict().refine(e=>Object.values(e).some(Boolean),{message:`platforms must include at least one supported platform`}),v=r.object({binaryName:o,displayName:o,homepage:r.url().startsWith(`https://`),lookupAliases:r.array(o).min(1).optional(),name:o.regex(/^[a-z0-9][a-z0-9-]*$/),packages:h.optional(),platforms:_,selfUpdate:g.optional(),versionProbe:ee.optional()}).strict(),y=r.array(v).min(1),b={...n(y),$id:`https://github.com/Drswith/quantex-cli/schemas/agent-catalog.schema.json`,title:`Quantex Supported Agent Catalog`},x={},S=y.parse(a).map(E),C=new Map(S.map(e=>[e.name,e]));function w(){return S}function T(e){let t=C.get(e);if(!t)throw Error(`Unknown catalog agent: ${e}`);return t}function E(e){let t=x[e.name],n=D(e.versionProbe,t);return{...e,versionProbe:n}}function D(e,t){if(!(!e&&!t?.versionProbeParser))return{...e,...t?.versionProbeParser?{parser:t.versionProbeParser}:{}}}T(`amp`),T(`auggie`);const O=T(`autohand`),k=T(`claude`),A=T(`codebuddy`),j=T(`codex`),M=T(`copilot`);T(`crush`);const N=T(`cursor`),P=T(`deepseek`),F=T(`devin`),I=T(`droid`);T(`forgecode`);const te=T(`gemini`);T(`goose`);const L=T(`jcode`),R=T(`junie`),z=T(`kilo`);T(`kimi`),T(`kiro`);const B=T(`opencode`),V=T(`openhands`),H=T(`pi`),U=T(`qoder`);T(`qwen`);const W=T(`reasonix`),G=T(`vibe`),K=T(`vtcode`),q=w();function J(){return q}function Y(e){return q.find(t=>t.name===e||(t.lookupAliases?.includes(e)??!1))}function X(e){return Y(e)}function Z(){switch(i.platform){case`win32`:return`windows`;case`darwin`:return`macos`;default:return`linux`}}async function Q(n){try{let{exitCode:r}=await e(t([n,`--version`]));return r===0}catch{return!1}}async function ne(){return Q(`bun`)}async function re(){return Q(`npm`)}async function ie(){return Q(`brew`)}async function ae(){return Q(`cargo`)}async function oe(){return Q(`mise`)}async function $(){return Q(`winget`)}async function se(){return await Q(`pip`)||await Q(`pip3`)?!0:le()}async function ce(){return Q(`uv`)}async function le(){try{let{exitCode:n}=await e(t([`python`,`-m`,`pip`,`--version`]));if(n===0)return!0}catch{}try{let{exitCode:n}=await e(t([`python3`,`-m`,`pip`,`--version`]));return n===0}catch{return!1}}async function ue(n){try{let{exitCode:r}=await e(t([i.platform===`win32`?`where`:`which`,n]));return r===0}catch{return!1}}export{U as A,te as C,B as D,z as E,w as F,v as I,b as L,G as M,K as N,V as O,T as P,y as R,I as S,R as T,j as _,ae as a,P as b,se as c,Y as d,X as f,A as g,k as h,ne as i,W as j,H as k,ce as l,O as m,ue as n,oe as o,J as p,ie as r,re as s,Z as t,$ as u,M as v,L as w,F as x,N as y};
|
package/dist/doctor-Dp9VEmRS.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./messages-qcLhD-Gc.mjs";import{t as n}from"./agents-Egq0RCta.mjs";import{a as r,c as i,i as a,l as o,o as s,r as c,s as l,u}from"./detect-DWabXMgY.mjs";import{H as d,a as f,q as p,r as m,s as h,t as g,u as _}from"./color-DEbCq7kh.mjs";async function v(){let p=await a(),g=await l(),v=await c(),x=await r(),S=await s(),C=await i(),w=await o(),T=await u(),E=await h(),D=E.latestVersion?d(E.latestVersion,E.currentVersion):!1,O=await n(),k=O.filter(e=>e.inPath).map(e=>({displayName:e.agent.displayName,installedVersion:e.installedVersion,latestVersion:e.latestVersion,lifecycle:e.lifecycle,outdated:!!(e.installedVersion&&e.latestVersion&&e.installedVersion!==e.latestVersion),sourceLabel:e.sourceLabel})),A=[],j=`docs/runbooks/quantex-troubleshooting.md`,M=`docs/runbooks/release-and-self-upgrade-debugging.md`;if(!p&&!g&&!v&&!x&&!S&&!C&&!w&&!T&&A.push({blocking:!0,category:`installers`,code:`NO_MANAGED_INSTALLER`,docsRef:j,message:`No managed installer found. Install bun, npm, brew, cargo, mise, pip, uv, or winget before relying on managed lifecycle operations.`,severity:`warning`,subject:{kind:`system`},suggestedAction:`restore-managed-installer`,suggestedCommands:[]}),(E.installSource===`bun`&&!p||E.installSource===`npm`&&!g)&&A.push({blocking:!0,category:`self`,code:`SELF_INSTALLER_MISSING`,docsRef:M,message:`Quantex CLI is tracked as a ${E.installSource} install, but ${E.installSource} is not available in PATH. Reinstall that package manager or reinstall Quantex from a supported source.`,severity:`warning`,subject:{kind:`self`,name:`quantex`},suggestedAction:`restore-self-installer`,suggestedCommands:b(E.installSource,E.updateChannel)}),E.canAutoUpdate||A.push({blocking:!1,category:`self`,code:`SELF_AUTO_UPDATE_UNAVAILABLE`,docsRef:M,message:`Quantex CLI cannot auto-update from install source "${E.installSource}". Reinstall via bun, npm, or the standalone binary if you want \`quantex upgrade\` support.`,severity:`warning`,subject:{kind:`self`,name:`quantex`},suggestedAction:`reinstall-self-with-auto-update-source`,suggestedCommands:[]}),D&&E.recommendedUpgradeCommand){let e=_(E);A.push({blocking:!1,category:`self`,code:`SELF_UPDATE_AVAILABLE`,docsRef:M,message:e?`Quantex CLI ${E.currentVersion} is behind ${E.latestVersion}. Run ${E.recommendedUpgradeCommand} or follow: ${e}`:`Quantex CLI ${E.currentVersion} is behind ${E.latestVersion}. Run ${E.recommendedUpgradeCommand}.`,severity:`warning`,subject:{kind:`self`,name:`quantex`},suggestedAction:`run-self-upgrade`,suggestedCommands:[E.recommendedUpgradeCommand]})}for(let n of O.filter(e=>e.inPath)){if(n.installedState||A.push({blocking:!1,category:`agent`,code:`AGENT_UNTRACKED_IN_PATH`,docsRef:j,message:`${n.agent.displayName} is available in PATH but not tracked as a managed Quantex install. Use \`quantex inspect ${n.agent.name} --json\` to confirm the source, then reinstall through Quantex if you want managed lifecycle operations.`,severity:`warning`,subject:{kind:`agent`,name:n.agent.name},suggestedAction:`inspect-agent-install-source`,suggestedCommands:[`quantex inspect ${n.agent.name} --json`,`quantex install ${n.agent.name}`]}),!(n.installedVersion&&n.latestVersion&&n.installedVersion!==n.latestVersion)||n.lifecycle===`managed`)continue;let r=t(n.agent,n.agent.selfUpdate?`self-update`:`manual-hint`)??e(n.agent);A.push({blocking:!1,category:`agent`,code:`AGENT_MANUAL_UPDATE_REQUIRED`,docsRef:j,message:`${n.agent.displayName} ${n.installedVersion} is behind ${n.latestVersion}, but the current source is ${n.sourceLabel}. ${r}`,severity:`warning`,subject:{kind:`agent`,name:n.agent.name},suggestedAction:n.agent.selfUpdate?`run-agent-self-update`:`follow-manual-agent-update`,suggestedCommands:n.agent.selfUpdate?[n.agent.selfUpdate.command.join(` `)]:[]})}return f(m({action:`doctor`,data:{agents:k,issues:A,installers:{brew:v,bun:p,cargo:x,mise:S,npm:g,pip:C,uv:w,winget:T},self:{canAutoUpdate:E.canAutoUpdate,currentVersion:E.currentVersion,installSource:E.installSource,latestVersion:E.latestVersion,outdated:!!D,recoveryHint:D?_(E):void 0}},target:{kind:`system`,name:`doctor`}}),y)}function y(e){if(e.data){if(console.log(g.bold(`
|
|
2
|
-
Quantex CLI Environment Check
|
|
3
|
-
`)),console.log(g.bold(`Managed Installers:`)),console.log(` Bun: ${e.data.installers.bun?g.green(`available`):g.red(`not found`)}`),console.log(` npm: ${e.data.installers.npm?g.green(`available`):g.red(`not found`)}`),console.log(` brew: ${e.data.installers.brew?g.green(`available`):g.red(`not found`)}`),console.log(` cargo: ${e.data.installers.cargo?g.green(`available`):g.red(`not found`)}`),console.log(` mise: ${e.data.installers.mise?g.green(`available`):g.red(`not found`)}`),console.log(` pip: ${e.data.installers.pip?g.green(`available`):g.red(`not found`)}`),console.log(` uv: ${e.data.installers.uv?g.green(`available`):g.red(`not found`)}`),console.log(` winget:${e.data.installers.winget?g.green(`available`):g.red(`not found`)}`),console.log(`\n${g.bold(`Quantex CLI:`)}`),console.log(` Version: ${e.data.self.currentVersion}`),console.log(` Source: ${e.data.self.installSource}`),console.log(` Auto-update: ${e.data.self.canAutoUpdate?g.green(`supported`):g.yellow(`unsupported`)}`),e.data.self.latestVersion&&console.log(` Latest: ${e.data.self.latestVersion}${e.data.self.outdated?g.yellow(` (update available)`):``}`),e.data.self.recoveryHint&&console.log(` Recovery: ${e.data.self.recoveryHint}`),console.log(`\n${g.bold(`Installed Agents:`)}`),e.data.agents.length===0)console.log(g.dim(` No agents installed`));else for(let t of e.data.agents)console.log(` ${t.displayName}: ${t.installedVersion??`unknown`} [${t.lifecycle}; ${t.sourceLabel}]${t.outdated?g.yellow(` (update available: ${t.latestVersion})`):``}`);if(console.log(`\n${g.bold(`Issues:`)}`),e.data.issues.length===0)console.log(g.green(` No issues found.`));else for(let t of e.data.issues)console.log(g.yellow(` - ${t.message}`)),t.suggestedCommands.length>0&&console.log(g.dim(` Next: ${t.suggestedCommands.join(` | `)}`));console.log()}}function b(e,t){let n=t===`beta`?`beta`:`latest`;return e===`bun`?[`bun add -g ${p}@${n}`]:e===`npm`?[`npm install -g ${p}@${n}`]:[]}export{v as doctorCommand};
|
package/dist/ensure-B-zpnaT-.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ensure-DpX11qbo.mjs";export{e as ensureCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./inspect-CihiIfvE.mjs";export{e as inspectCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./resolve-BhJphfVN.mjs";export{e as resolveCommand};
|
package/dist/schema-1VaAQRYe.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./schema-C7v-CajU.mjs";export{e as schemaCommand};
|
package/dist/schema-C7v-CajU.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,r as n,t as r}from"./color-DEbCq7kh.mjs";const i={additionalProperties:!1,properties:{action:{type:`string`},data:{type:`object`},error:{additionalProperties:!1,properties:{code:{type:`string`},message:{type:`string`}},required:[`code`,`message`],type:`object`},exitCode:{type:`integer`},meta:{additionalProperties:!1,properties:{mode:{type:`string`},runId:{type:`string`},schemaVersion:{type:`string`},source:{type:`string`},fetchedAt:{type:`string`},staleAfter:{type:`string`},timestamp:{type:`string`},version:{type:`string`}},required:[`mode`,`runId`,`schemaVersion`,`timestamp`,`version`],type:`object`},ok:{type:`boolean`},target:{additionalProperties:!1,properties:{kind:{type:`string`},name:{type:`string`}},required:[`kind`],type:`object`},warnings:{items:{additionalProperties:!1,properties:{code:{type:`string`},message:{type:`string`}},required:[`code`,`message`],type:`object`},type:`array`}},required:[`action`,`error`,`meta`,`ok`,`warnings`],type:`object`},a={additionalProperties:!1,properties:{action:{type:`string`},data:{type:`object`},meta:{additionalProperties:!1,properties:{mode:{type:`string`},runId:{type:`string`},schemaVersion:{type:`string`},source:{type:`string`},fetchedAt:{type:`string`},staleAfter:{type:`string`},timestamp:{type:`string`},version:{type:`string`}},required:[`mode`,`runId`,`schemaVersion`,`timestamp`,`version`],type:`object`},target:{additionalProperties:!1,properties:{kind:{type:`string`},name:{type:`string`}},required:[`kind`],type:`object`},type:{type:`string`}},required:[`action`,`meta`,`type`],type:`object`},o={additionalProperties:!1,properties:{available:{type:`boolean`},reason:{type:`string`}},required:[`available`],type:`object`},s={brew:o,bun:o,cargo:o,mise:o,npm:o,pip:o,uv:o,winget:o},c=[`brew`,`bun`,`cargo`,`mise`,`npm`,`pip`,`uv`,`winget`],l=[{dataSchema:{additionalProperties:!1,properties:{agents:{items:{type:`string`},type:`array`},features:{additionalProperties:!1,properties:{assumeYes:{type:`boolean`},cacheBypass:{type:`boolean`},cacheRefresh:{type:`boolean`},channels:{items:{type:`string`},type:`array`},colorModes:{items:{type:`string`},type:`array`},dryRun:{type:`boolean`},execInstallPolicies:{items:{type:`string`},type:`array`},freshnessMetadata:{type:`boolean`},idempotencyKey:{type:`boolean`},logLevels:{items:{type:`string`},type:`array`},quietLogs:{type:`boolean`},selfUpgrade:{type:`boolean`},timeout:{type:`boolean`}},required:[`assumeYes`,`cacheBypass`,`cacheRefresh`,`channels`,`colorModes`,`dryRun`,`execInstallPolicies`,`freshnessMetadata`,`idempotencyKey`,`logLevels`,`quietLogs`,`selfUpgrade`,`timeout`],type:`object`},installers:{additionalProperties:!1,properties:s,required:c,type:`object`},outputModes:{items:{type:`string`},type:`array`},platform:{additionalProperties:!1,properties:{arch:{type:`string`},os:{type:`string`}},required:[`arch`,`os`],type:`object`}},required:[`agents`,`features`,`installers`,`outputModes`,`platform`],type:`object`},description:`Environment and surface capabilities`,envelopeSchema:i,name:`capabilities`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{commands:{items:{additionalProperties:!1,properties:{flags:{items:{type:`string`},type:`array`},name:{type:`string`},outputSchemaRef:{type:`string`},stability:{type:`string`},summary:{type:`string`}},required:[`flags`,`name`,`outputSchemaRef`,`stability`,`summary`],type:`object`},type:`array`}},required:[`commands`],type:`object`},description:`Stable command catalog`,envelopeSchema:i,name:`commands`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{agents:{items:{additionalProperties:!1,properties:{displayName:{type:`string`},installedVersion:{type:`string`},latestVersion:{type:`string`},lifecycle:{type:`string`},outdated:{type:`boolean`},sourceLabel:{type:`string`}},required:[`displayName`,`lifecycle`,`outdated`,`sourceLabel`],type:`object`},type:`array`},installers:{additionalProperties:!1,properties:{brew:{type:`boolean`},bun:{type:`boolean`},cargo:{type:`boolean`},mise:{type:`boolean`},npm:{type:`boolean`},pip:{type:`boolean`},uv:{type:`boolean`},winget:{type:`boolean`}},required:c,type:`object`},issues:{items:{additionalProperties:!1,properties:{blocking:{type:`boolean`},category:{type:`string`},code:{type:`string`},docsRef:{type:`string`},message:{type:`string`},severity:{type:`string`},subject:{additionalProperties:!1,properties:{kind:{type:`string`},name:{type:`string`}},required:[`kind`],type:`object`},suggestedAction:{type:`string`},suggestedCommands:{items:{type:`string`},type:`array`}},required:[`blocking`,`category`,`code`,`message`,`severity`,`subject`,`suggestedAction`,`suggestedCommands`],type:`object`},type:`array`},self:{additionalProperties:!1,properties:{canAutoUpdate:{type:`boolean`},currentVersion:{type:`string`},installSource:{type:`string`},latestVersion:{type:`string`},outdated:{type:`boolean`},recoveryHint:{type:`string`}},required:[`canAutoUpdate`,`currentVersion`,`installSource`,`outdated`],type:`object`}},required:[`agents`,`installers`,`issues`,`self`],type:`object`},description:`Diagnostic state and remediation guidance for the current environment`,envelopeSchema:i,name:`doctor`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{agent:{additionalProperties:!1,properties:{binaryName:{type:`string`},displayName:{type:`string`},name:{type:`string`}},required:[`name`],type:`object`},execution:{additionalProperties:!1,properties:{args:{items:{type:`string`},type:`array`},installGuidance:{additionalProperties:!1,properties:{docsRef:{type:`string`},installMethods:{items:{additionalProperties:!1,properties:{command:{type:`string`},label:{type:`string`},type:{type:`string`}},required:[`command`,`label`,`type`],type:`object`},type:`array`},suggestedAction:{type:`string`},suggestedEnsureCommand:{type:`string`},suggestedExecCommand:{type:`string`}},required:[`docsRef`,`installMethods`,`suggestedAction`,`suggestedEnsureCommand`,`suggestedExecCommand`],type:`object`},installPolicy:{type:`string`},installed:{type:`boolean`},interactive:{type:`boolean`},launched:{type:`boolean`}},required:[`args`,`installPolicy`,`installed`,`interactive`,`launched`],type:`object`}},required:[`agent`,`execution`],type:`object`},description:`Preflight contract for managed agent execution`,envelopeSchema:i,name:`exec`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{agent:{type:`object`},changed:{type:`boolean`},installState:{type:`object`},installed:{type:`boolean`},results:{items:{additionalProperties:!1,properties:{agent:{type:`object`},changed:{type:`boolean`},error:{type:`object`},input:{type:`string`},installState:{type:`object`},installed:{type:`boolean`},ok:{type:`boolean`},status:{type:`string`},warnings:{items:{type:`object`},type:`array`}},required:[`agent`,`changed`,`input`,`installed`,`ok`,`status`,`warnings`],type:`object`},type:`array`},scope:{type:`string`},summary:{type:`object`}},type:`object`},description:`Install result for one or more agents`,envelopeSchema:i,name:`install`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{agent:{type:`object`},changed:{type:`boolean`},installState:{type:`object`},installed:{type:`boolean`}},required:[`agent`,`changed`,`installed`],type:`object`},description:`Ensure result for an agent`,envelopeSchema:i,name:`ensure`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{agent:{type:`object`},capabilities:{type:`object`},inspection:{type:`object`}},required:[`agent`,`capabilities`,`inspection`],type:`object`},description:`Structured inspection result for an agent`,envelopeSchema:i,name:`inspect`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{agent:{type:`object`},resolution:{additionalProperties:!1,properties:{binaryPath:{type:`string`},installGuidance:{additionalProperties:!1,properties:{docsRef:{type:`string`},installMethods:{items:{additionalProperties:!1,properties:{command:{type:`string`},label:{type:`string`},type:{type:`string`}},required:[`command`,`label`,`type`],type:`object`},type:`array`},suggestedAction:{type:`string`},suggestedEnsureCommand:{type:`string`}},required:[`docsRef`,`installMethods`,`suggestedAction`,`suggestedEnsureCommand`],type:`object`},installed:{type:`boolean`},installSource:{type:`string`},installedVersion:{type:`string`},lifecycle:{type:`string`},sourceLabel:{type:`string`},suggestedLaunchCommand:{items:{type:`string`},type:`array`}},required:[`binaryPath`,`installed`,`installSource`,`lifecycle`,`sourceLabel`,`suggestedLaunchCommand`],type:`object`}},required:[`agent`,`resolution`],type:`object`},description:`Resolved executable entrypoint for an agent`,envelopeSchema:i,name:`resolve`,ndjsonEventSchema:a},{dataSchema:{additionalProperties:!1,properties:{commands:{items:{additionalProperties:!1,properties:{dataSchema:{type:`object`},description:{type:`string`},envelopeSchema:{type:`object`},name:{type:`string`},ndjsonEventSchema:{type:`object`}},required:[`dataSchema`,`description`,`envelopeSchema`,`name`],type:`object`},type:`array`}},required:[`commands`],type:`object`},description:`Structured schema catalog`,envelopeSchema:i,name:`schema`,ndjsonEventSchema:a}];async function u(r){let i=r?l.filter(e=>e.name===r):l;return r&&i.length===0?e(t({action:`schema`,error:{code:`INVALID_ARGUMENT`,details:{command:r},message:`Unknown schema target: ${r}`},target:{kind:`system`,name:`schema`}}),d):e(n({action:`schema`,data:{commands:i},target:{kind:`system`,name:`schema`}}),d)}function d(e){if(e.error){console.log(r.red(e.error.message));return}if(e.data){console.log(r.bold(`
|
|
2
|
-
Quantex Schemas
|
|
3
|
-
`));for(let t of e.data.commands)console.log(` ${r.cyan(t.name)}`),console.log(` ${t.description}`);console.log()}}function f(){return l}export{u as n,f as t};
|
package/dist/update-DgZD1TXs.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,g as t,i as n,t as r,x as i}from"./agents-Egq0RCta.mjs";function a(e,n={}){let r={bun:[],npm:[],brew:[],cargo:[],mise:[],pip:[],uv:[],winget:[]},i=[],a=[],c=[],l=[];for(let u of e){if(!u.inPath)continue;if(n.skipUntrackedInPath&&!u.installedState){c.push(u);continue}if(s(u)){a.push(u);continue}if(!o(u)){l.push(u);continue}let e=t({agent:u.agent,installedState:u.installedState,methods:u.methods}),d=e.strategy===`managed`?e.getManagedInstallerType?.({agent:u.agent,installedState:u.installedState,methods:u.methods}):void 0;if(d){let e={inspection:u,installerType:d,strategy:`grouped`};r[d].push(e);continue}i.push({inspection:u,strategy:e.strategy===`self-update`?`self-update`:`manual`})}return{entries:[...r.bun,...r.npm,...r.brew,...r.cargo,...r.mise,...r.pip,...r.uv,...r.winget,...i],grouped:r,manual:i,skippedManualCheck:a,untrackedInPath:c,upToDate:l}}function o(e){return e.installedVersion&&e.latestVersion?e.installedVersion!==e.latestVersion:!0}function s(t){return!t.latestVersion&&!e(t.agent,t.installedState)}const c=[`bun`,`npm`,`brew`,`cargo`,`mise`,`pip`,`uv`,`winget`];async function l(e){let t=await n(e);return{agent:e,inspection:t,updateAvailable:o(t)}}async function u(){return f(await r(),{skipUntrackedInPath:!0})}async function d(e){let t=await n(e);return{inspection:t,plan:f([t])}}function f(e,t={}){let n=a(e,t),r=[],i=c.map(e=>p(e,n.grouped[e],r)).filter(e=>e!==void 0);return{entries:n.entries.map(e=>h(e.inspection)),grouped:i,manual:[...r,...n.manual.map(e=>h(e.inspection))],skippedManualCheck:n.skippedManualCheck,untrackedInPath:n.untrackedInPath,upToDate:n.upToDate}}function p(e,t,n){if(t.length===0)return;let r=t.map(e=>h(e.inspection)),i=r.filter(m);if(n.push(...r.filter(e=>!m(e))),i.length!==0)return{type:e,packages:i.map(e=>e.package),updates:i}}function m(e){return!!e.package?.packageName}function h(e){let n=t({agent:e.agent,installedState:e.installedState,methods:e.methods}),r=n.getManagedInstallerType?.({agent:e.agent,installedState:e.installedState,methods:e.methods});return{agent:e.agent,inspection:e,installerType:r,package:r?g(e.agent,e.installedState,e.methods,r):void 0,state:e.installedState,strategy:n.strategy}}function g(e,t,n,r){if(t?.packageName&&t.installType===r)return{packageName:t.packageName,packageInstallArgs:t.packageInstallArgs,packageTargetKind:t.packageTargetKind};let a=n.find(e=>e.type===r);if(!a)return;let o=i(e,a);if(o)return{packageName:o,packageInstallArgs:a.packageInstallArgs,packageTargetKind:a.packageTargetKind}}export{o as a,a as i,u as n,d as r,l as t};
|