quantex-cli 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/README.zh-CN.md +9 -5
- package/dist/agents-BVcaPgcE.mjs +1 -0
- package/dist/{capabilities-Bkl5TSUt.mjs → capabilities-BcirrDgv.mjs} +1 -1
- package/dist/capabilities-Dv-KUALO.mjs +1 -0
- package/dist/cli.mjs +2 -2
- package/dist/color-P2uVwGzw.mjs +5 -0
- package/dist/commands-DdZ1o2av.mjs +1 -0
- package/dist/{commands-BZ2XInF6.mjs → commands-QSNJQkwT.mjs} +1 -1
- package/dist/{config-CkkMMM5O.mjs → config-CGQNhYN9.mjs} +1 -1
- package/dist/detect-2jeRd2sI.mjs +1 -0
- package/dist/{doctor-CrC2nRsW.mjs → doctor-D0hquPsq.mjs} +1 -1
- package/dist/{ensure-BhO96BrF.mjs → ensure-BR_DwDzl.mjs} +1 -1
- package/dist/ensure-C1R6CFS_.mjs +1 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +2 -2
- package/dist/{info-CJU-8DDE.mjs → info-4JHWiNXK.mjs} +1 -1
- package/dist/inspect-CZJdyaQA.mjs +1 -0
- package/dist/{inspect-CLah6J00.mjs → inspect-CuJd8vNZ.mjs} +1 -1
- package/dist/{install-DW-jmPqm.mjs → install-DUWi242L.mjs} +1 -1
- package/dist/{list-zF0gAY_Y.mjs → list-CLj2KsEf.mjs} +1 -1
- package/dist/{resolve-DVFN04ba.mjs → resolve-B9HkxPmw.mjs} +1 -1
- package/dist/resolve-Yp7_1ni8.mjs +1 -0
- package/dist/{schema-ZZ76v7eB.mjs → schema-cVptJ-GO.mjs} +1 -1
- package/dist/schema-kltaay-J.mjs +1 -0
- package/dist/{uninstall-D6HrR4V-.mjs → uninstall-BR6Y8hk2.mjs} +1 -1
- package/dist/{update-BIDdmLAf.mjs → update-BlxqUwh8.mjs} +1 -1
- package/dist/{update-jZ_ZHoA5.mjs → update-CXSiym15.mjs} +1 -1
- package/dist/{upgrade-CH9zC7DU.mjs → upgrade-BstKxwge.mjs} +1 -1
- package/dist/{user-output-VyXfqiUK.mjs → user-output-Dm9t9jPa.mjs} +1 -1
- package/package.json +4 -1
- package/dist/agents-Jo9kz0sn.mjs +0 -1
- package/dist/capabilities-CTH49oSj.mjs +0 -1
- package/dist/color-DsW76Q6X.mjs +0 -5
- package/dist/commands-kENbdAMH.mjs +0 -1
- package/dist/detect-BD2Ph-sr.mjs +0 -1
- package/dist/ensure-BJTVMieD.mjs +0 -1
- package/dist/inspect-CWc7vqBK.mjs +0 -1
- package/dist/resolve-CDiwMxPa.mjs +0 -1
- package/dist/schema-nm2KIL1F.mjs +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Quantex is a `human-friendly + agent-friendly` lifecycle CLI for AI coding agent
|
|
|
27
27
|
|
|
28
28
|
## Agent Quick Start
|
|
29
29
|
|
|
30
|
-
If you are using a coding agent with Quantex, start by installing the repo-provided Quantex skill:
|
|
30
|
+
If you are using a coding agent with Quantex, start by installing the repo-provided user-facing Quantex CLI skill:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
npx skills add Drswith/quantex-cli --skill quantex-cli -a codex -a claude-code -a opencode -y
|
|
@@ -56,7 +56,7 @@ Before finishing, run bun run lint, bun run format:check, and bun run typecheck.
|
|
|
56
56
|
If command behavior changed, also run bun run test.
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
The repo-local Quantex skill lives in [`skills/quantex-cli/`](./skills/quantex-cli/). It can be installed from GitHub through [skills.sh](https://skills.sh/) with `npx skills add`, but this repository remains the publishing source; it is not a separate npm package. See the [skill distribution notes](./docs/skill-installation-and-distribution.md) for installation and sync options.
|
|
59
|
+
The repo-local user-facing Quantex CLI skill lives in [`skills/quantex-cli/`](./skills/quantex-cli/). It can be installed from GitHub through [skills.sh](https://skills.sh/) with `npx skills add`, but this repository remains the publishing source; it is not a separate npm package. The separate [`skills/quantex-agent-runtime/`](./skills/quantex-agent-runtime/) directory is contributor-facing runtime for agents working inside this repository, not the normal external user skill. See the [skill distribution notes](./docs/skill-installation-and-distribution.md) for installation and sync options.
|
|
60
60
|
|
|
61
61
|
## Install
|
|
62
62
|
|
|
@@ -66,12 +66,14 @@ With Bun:
|
|
|
66
66
|
bun add -g quantex-cli
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
With npm:
|
|
69
|
+
With npm (Node.js 20+):
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
npm i -g quantex-cli
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
The published JS CLI runs on Node after installation. Bun remains a supported package-manager path for install and self-upgrade, while the standalone binary release remains the zero-runtime option.
|
|
76
|
+
|
|
75
77
|
You can also download standalone binaries from [GitHub Releases](https://github.com/Drswith/quantex-cli/releases), or use the install script:
|
|
76
78
|
|
|
77
79
|
```bash
|
|
@@ -88,7 +90,7 @@ After installation, prefer `qtx` for the shortest copyable path. If you prefer t
|
|
|
88
90
|
|
|
89
91
|
## Try It Without Installing
|
|
90
92
|
|
|
91
|
-
If your environment already provides
|
|
93
|
+
If your environment already provides Node.js 20 or newer, you can try read-only commands before doing a global install:
|
|
92
94
|
|
|
93
95
|
```bash
|
|
94
96
|
bunx quantex-cli list
|
|
@@ -100,7 +102,8 @@ pnpm --package=quantex-cli dlx qtx doctor
|
|
|
100
102
|
Notes:
|
|
101
103
|
|
|
102
104
|
- These commands are intended for read-only and discovery-oriented flows such as `list`, `info`, `inspect`, `doctor`, `capabilities`, `commands`, and `schema`.
|
|
103
|
-
-
|
|
105
|
+
- `npx`, `npm exec`, and `pnpm dlx` run the published JS CLI through Node and do not require `bun` on `PATH`.
|
|
106
|
+
- `bunx` still requires Bun because `bunx` itself is Bun's launcher.
|
|
104
107
|
- For `install`, `ensure`, `update`, `uninstall`, `upgrade`, or any flow that should record install-source state, prefer a normal install first.
|
|
105
108
|
|
|
106
109
|
## Quick Start
|
|
@@ -257,6 +260,7 @@ If you are contributing to this repository or letting a coding agent work here,
|
|
|
257
260
|
- [openspec/README.md](./openspec/README.md): OpenSpec / OPSX change workflow.
|
|
258
261
|
- [docs/github-collaboration.md](./docs/github-collaboration.md): Issue, PR, and Discussion collaboration flow.
|
|
259
262
|
- [skills/quantex-cli/SKILL.md](./skills/quantex-cli/SKILL.md): repo-native skill for agents using Quantex.
|
|
263
|
+
- [skills/quantex-agent-runtime/SKILL.md](./skills/quantex-agent-runtime/SKILL.md): contributor-facing runtime for agents working inside this repository.
|
|
260
264
|
|
|
261
265
|
Common local development commands:
|
|
262
266
|
|
package/README.zh-CN.md
CHANGED
|
@@ -27,7 +27,7 @@ Quantex 是一个 `human-friendly + agent-friendly` 的 agent lifecycle CLI。
|
|
|
27
27
|
|
|
28
28
|
## Agent 快速接入
|
|
29
29
|
|
|
30
|
-
如果你正在让 coding agent 使用 Quantex
|
|
30
|
+
如果你正在让 coding agent 使用 Quantex,可以先安装仓库里的面向用户的 Quantex CLI skill:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
npx skills add Drswith/quantex-cli --skill quantex-cli -a codex -a claude-code -a opencode -y
|
|
@@ -56,7 +56,7 @@ Before finishing, run bun run lint, bun run format:check, and bun run typecheck.
|
|
|
56
56
|
If command behavior changed, also run bun run test.
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
仓库内置的面向用户的 Quantex CLI skill 位于 [`skills/quantex-cli/`](./skills/quantex-cli/)。它可以通过 [skills.sh](https://skills.sh/) 的 `npx skills add` 从 GitHub 安装,但仍然以本仓库为发布源,不是单独的 npm package。单独的 [`skills/quantex-agent-runtime/`](./skills/quantex-agent-runtime/) 是面向本仓库开发协作的 contributor runtime,不是普通外部用户的默认 skill;安装和同步方式见 [skill 分发说明](./docs/skill-installation-and-distribution.md)。
|
|
60
60
|
|
|
61
61
|
## 安装
|
|
62
62
|
|
|
@@ -66,12 +66,14 @@ If command behavior changed, also run bun run test.
|
|
|
66
66
|
bun add -g quantex-cli
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
使用 npm
|
|
69
|
+
使用 npm(Node.js 20+):
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
npm i -g quantex-cli
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
已发布的 JS CLI 在安装后通过 Node 运行。Bun 仍然是受支持的安装与自升级路径,而独立二进制仍然是完全不依赖额外运行时的选项。
|
|
76
|
+
|
|
75
77
|
也可以从 [GitHub Releases](https://github.com/Drswith/quantex-cli/releases) 下载独立二进制,或使用安装脚本:
|
|
76
78
|
|
|
77
79
|
```bash
|
|
@@ -88,7 +90,7 @@ irm https://raw.githubusercontent.com/Drswith/quantex-cli/main/install.ps1 | iex
|
|
|
88
90
|
|
|
89
91
|
## 免安装试用
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
如果你的环境已经有 Node.js 20 或更高版本,可以先不做全局安装,直接试用只读命令:
|
|
92
94
|
|
|
93
95
|
```bash
|
|
94
96
|
bunx quantex-cli list
|
|
@@ -100,7 +102,8 @@ pnpm --package=quantex-cli dlx qtx doctor
|
|
|
100
102
|
注意事项:
|
|
101
103
|
|
|
102
104
|
- 这些命令适合 `list`、`info`、`inspect`、`doctor`、`capabilities`、`commands`、`schema` 这类只读或发现型操作。
|
|
103
|
-
-
|
|
105
|
+
- `npx`、`npm exec`、`pnpm dlx` 会通过 Node 运行已发布的 JS CLI,不要求环境里存在 `bun`。
|
|
106
|
+
- `bunx` 仍然需要 Bun,因为它本身就是 Bun 提供的启动器。
|
|
104
107
|
- `install`、`ensure`、`update`、`uninstall`、`upgrade` 这类会写状态或依赖已记录安装来源的操作,仍然建议先按上面的方式正常安装再执行。
|
|
105
108
|
|
|
106
109
|
## 快速开始
|
|
@@ -257,6 +260,7 @@ Quantex 使用 release-please 维护 Release PR,发布说明以 GitHub Release
|
|
|
257
260
|
- [openspec/README.md](./openspec/README.md):OpenSpec / OPSX 变更流程。
|
|
258
261
|
- [docs/github-collaboration.md](./docs/github-collaboration.md):Issue、PR、Discussion 协作流程。
|
|
259
262
|
- [skills/quantex-cli/SKILL.md](./skills/quantex-cli/SKILL.md):面向 agent 使用 Quantex 的 repo-native skill。
|
|
263
|
+
- [skills/quantex-agent-runtime/SKILL.md](./skills/quantex-agent-runtime/SKILL.md):面向本仓库开发协作的 agent runtime。
|
|
260
264
|
|
|
261
265
|
本地开发常用命令:
|
|
262
266
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,t as s}from"./detect-2jeRd2sI.mjs";import{A as c,D as l,E as ee,H as u,I as d,M as f,R as p,T as m,_ as h,b as g,g as te,h as ne,j as _,m as re,q as v,v as ie,w as ae,x as oe,y as se}from"./color-P2uVwGzw.mjs";import ce from"node:process";const le={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`},npm:{canInstall:!0,canLookupLatestVersion:!0,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 y(e){return le[e]}function b(e){return y(e).lifecycle===`managed`}function x(e){return y(e).lifecycle}function S(e){return y(e).canUpdate}function ue(e){return y(e).canUninstall}function C(e){return y(e).canLookupLatestVersion}function w(e,t){return e?t===`cask`?` (${e} cask)`:t===`id`?` (${e} id)`:` (${e})`:``}function T(e,t){return t.packageName||e.packages?.npm||void 0}function E(e){return e?S(e.installType):!1}function D(e,t){return E(t)||!!e.selfUpdate}function de(e){return!!e&&C(e.installType)}function fe(e){return e.length>0&&e.every(e=>C(e.type))}function pe(e){return b(e.type)?`${x(e.type)}/${e.type}${w(e.packageName,e.packageTargetKind)}`:e.type===`script`?`unmanaged/script`:`unmanaged/binary`}function me(e){return e?b(e.installType)?`managed via ${e.installType}${w(e.packageName,e.packageTargetKind)}`:e.installType===`script`?`script installer`:`binary installer`:`detected in PATH`}function he(e,t){let n=I({agent:e,installedState:t,methods:[]});return n===`managed`?`managed update`:n===`self-update`?`command update`:`manual update`}function ge(e,t){if(t.type===`bun`){let n=T(e,t);return n?`bun add -g ${n}`:``}if(t.type===`npm`){let n=T(e,t);return n?`npm i -g ${n}`:``}return t.type===`brew`?t.packageName?t.packageTargetKind===`cask`?`brew install --cask ${t.packageName}`:`brew install ${t.packageName}`:``:t.type===`winget`?t.packageName?`winget install --id ${t.packageName} -e`:``:t.command??``}function _e(e,t,n){if(t)return de(t)&&(t.packageName||e.packages?.npm)||void 0;if(!(!e.packages?.npm||!fe(n)))return e.packages.npm}function O(e,t){let n=k(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 k(e){if(!e)return;let t=e.replaceAll(`\\`,`/`);if(t.includes(`/.bun/bin/`)||t.includes(`/.bun/install/global/`))return`bun`;if(t.includes(`/node_modules/.bin/`)||t.includes(`/node_modules/`))return`npm`}function A(e){if(e.installedState&&b(e.installedState.installType))return e.installedState.installType;for(let t of e.methods)if(b(t.type)&&S(t.type))return t.type}const j={strategy:`managed`,canHandle:e=>!!A(e),getManagedInstallerType:e=>A(e)},M={strategy:`self-update`,canHandle:e=>!E(e.installedState)&&!!e.agent.selfUpdate},N={strategy:`manual-hint`,canHandle:()=>!0},P=[j,M,N];function F(e){return P.find(t=>t.canHandle(e))??N}function I(e){return F(e).strategy}function L(e){return D(e.agent,e.installedState)}async function R(e){let t=s(),n=typeof e==`function`?e(t):e;try{return ce.platform===`win32`?await _(c([`powershell.exe`,`-Command`,n]))===0:await _(c([`sh`,`-c`,n]))===0}catch{return!1}}function ve(e){return e===`cask`?[`--cask`]:[]}async function z(e,t,n){try{return await _(c([`brew`,e,...ve(n),t]))===0}catch{return!1}}async function ye(e,t){return z(`install`,e,t)}async function B(e,t){return z(`upgrade`,e,t)}async function be(e){for(let t of e)if(!await B(t.packageName,t.packageTargetKind))return!1;return!0}async function xe(e,t){return z(`uninstall`,e,t)}async function V(e,t){try{return await _(c([`winget`,e,`--id`,t,`-e`]))===0}catch{return!1}}async function Se(e){return V(`install`,e)}async function H(e){return V(`upgrade`,e)}async function Ce(e){for(let t of e)if(!await H(t.packageName))return!1;return!0}async function we(e){return V(`uninstall`,e)}const Te={brew:{type:`brew`,isAvailable:async()=>o(),install:async(e,t)=>ye(e,t),uninstall:async(e,t)=>xe(e,t),update:async(e,t)=>B(e,t),updateMany:async e=>be(e)},bun:{type:`bun`,isAvailable:async()=>n(),install:async e=>ie(e),uninstall:async e=>se(e),update:async(e,t,n)=>g(e,n?.npmBunUpdateStrategy),updateMany:async(e,t)=>oe(e.map(e=>e.packageName),t?.npmBunUpdateStrategy)},npm:{type:`npm`,isAvailable:async()=>e(),install:async e=>re(e),uninstall:async e=>ne(e),update:async(e,t,n)=>te(e,n?.npmBunUpdateStrategy),updateMany:async(e,t)=>h(e.map(e=>e.packageName),t?.npmBunUpdateStrategy)},winget:{type:`winget`,isAvailable:async()=>a(),install:async e=>Se(e),uninstall:async e=>we(e),update:async e=>H(e),updateMany:async e=>Ce(e.map(e=>({packageName:e.packageName})))}};function U(e){return Te[e]}const W={resource:`agent lifecycle`,scope:[`agent-lifecycle`]};async function Ee(){return(await v()).defaultPackageManager}async function G(){return{npmBunUpdateStrategy:(await v()).npmBunUpdateStrategy}}async function K(e){let t=s(),n=e.platforms[t];if(!n)return[];let r=await Ee();return r?[...n.filter(e=>e.type===r),...n.filter(e=>e.type!==r)]:[...n]}async function q(e,t,n,r,i){let a=U(e);return await a.isAvailable()?r===`install`?a.install(t,n):r===`update`?a.update(t,n,{npmBunUpdateStrategy:i}):a.uninstall(t,n):!1}async function J(e,t,n,r){if(b(t.type)){let i=T(e,t);return i?q(t.type,i,t.packageTargetKind,n,r):!1}return n===`update`&&!S(t.type)||!t.command?!1:R(t.command)}async function Y(e,t,n){return b(e.installType)?e.packageName?q(e.installType,e.packageName,e.packageTargetKind,t,n):!1:t!==`install`||!e.command?!1:R(e.command)}async function De(e){if(!e.selfUpdate)return!1;let t=[e.selfUpdate.command,...e.selfUpdate.fallbackCommands??[]];for(let e of t)if(await R(e.join(` `)))return!0;return!1}async function X(e,t){let n={agentName:e.name,installType:t.type,packageName:T(e,t),packageTargetKind:t.packageTargetKind,command:`command`in t?t.command:void 0};return await p(n),n}async function Oe(e,t){return u(W,async()=>X(e,t))}async function ke(e){return u(W,async()=>{let t=await K(e);for(let n of t)if(await J(e,n,`install`))return{success:!0,installedState:await X(e,n)};return{success:!1}})}async function Ae(e,t){return u(W,async()=>{let{npmBunUpdateStrategy:n}=await G(),r=await K(e);if(t&&await Y(t,`update`,n))return await p(t),{success:!0,installedState:t};if(!t){for(let t of r)if(await J(e,t,`update`,n))return{success:!0,installedState:await X(e,t)}}if(await De(e))return{success:!0};if(t){for(let t of r)if(await J(e,t,`update`,n))return{success:!0,installedState:await X(e,t)}}return{success:!1}})}async function je(e,t){return u(W,async()=>{let n=[...new Map(t.filter(e=>e.packageName).map(e=>[`${e.packageTargetKind??`package`}:${e.packageName}`,e])).values()],r=U(e);return await r.isAvailable()?r.updateMany(n,await G()):!1})}async function Me(e){return u(W,async()=>{let t=await f(e.name);if(!t)return!1;let n=await Y(t,`uninstall`);return n&&await d(e.name),n})}async function Z(e){let[t,n,r]=await Promise.all([K(e),f(e.name),i(e.binaryName)]),[a,o,s]=await Promise.all([r?m(e.binaryName,e.versionProbe):Promise.resolve(void 0),r?ae(e.binaryName):Promise.resolve(void 0),Ne(e,n,t)]);return{agent:e,methods:t,installedState:n,inPath:r,installedVersion:a,latestVersion:s,binaryPath:o,resolvedBinaryPath:await l(o),sourceLabel:me(n),updateLabel:he(e,n),lifecycle:n?x(n.installType):`unmanaged`}}async function Q(e){return Promise.all(e.map(Z))}async function Ne(e,t,n){let r=_e(e,t,n);if(r)return ee(r)}function $(e){return t(e)}async function Pe(e){let t=$(e);if(t)return{agent:t,inspection:await Z(t)}}async function Fe(){return Q(r())}export{ue as C,b as D,y as E,C as S,x as T,D as _,Q as a,O as b,Oe as c,je as d,U as f,F as g,I as h,Z as i,Me as l,L as m,$ as n,K as o,P as p,Pe as r,ke as s,Fe as t,Ae as u,ge as v,S as w,T as x,pe as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,i as t,l as n,o as r,r as i,t as a}from"./detect-
|
|
1
|
+
import{a as e,i as t,l as n,o as r,r as i,t as a}from"./detect-2jeRd2sI.mjs";import{a as o,r as s,t as c,u as l}from"./color-P2uVwGzw.mjs";import u from"node:process";async function d(){let[c,d,m,h,g]=await Promise.all([t(),e(),i(),r(),l()]);return o(s({action:`capabilities`,data:{agents:n().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:g.canAutoUpdate,timeout:!0},installers:{brew:{available:m,reason:m?void 0:f(`brew`)},bun:{available:c,reason:c?void 0:f(`bun`)},npm:{available:d,reason:d?void 0:f(`npm`)},winget:{available:h,reason:h?void 0:f(`winget`)}},outputModes:[`human`,`json`,`ndjson`],platform:{arch:u.arch,os:a()}},target:{kind:`system`,name:`capabilities`}}),p)}function f(e){return e===`winget`&&u.platform!==`win32`||e===`brew`&&u.platform===`win32`?`not-on-platform`:`not-found`}function p(e){e.data&&(console.log(c.bold(`
|
|
2
2
|
Quantex Capabilities
|
|
3
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(c.bold(`
|
|
4
4
|
Installers:`)),console.log(` bun: ${m(e.data.installers.bun)}`),console.log(` npm: ${m(e.data.installers.npm)}`),console.log(` brew: ${m(e.data.installers.brew)}`),console.log(` winget: ${m(e.data.installers.winget)}`),console.log(c.bold(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./capabilities-BcirrDgv.mjs";export{e as capabilitiesCommand};
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import{r as e,s as t,v as n,y as r}from"./agents-Jo9kz0sn.mjs";import{c as i}from"./detect-BD2Ph-sr.mjs";import{C as a,J as o,Q as s,R as c,S as l,V as u,X as d,Y as f,Z as p,a as m,i as h,l as g,n as _,r as v,t as y}from"./color-DsW76Q6X.mjs";import{a as b,i as x,n as S,o as C,r as w,t as T}from"./user-output-VyXfqiUK.mjs";import{n as E,t as D}from"./errors-DCtNasuC.mjs";import O from"node:process";import{mkdir as ee,readFile as k,rm as A,writeFile as j}from"node:fs/promises";import{join as M}from"node:path";import{program as N}from"commander";import P from"prompts";function F(){return M(u(),`idempotency`)}function I(e){return M(F(),`${z(e)}.json`)}async function L(e){try{let t=JSON.parse(await k(I(e),`utf8`));if(Date.parse(t.expiresAt)<=Date.now()){await A(I(e),{force:!0});return}return t}catch{return}}async function R(e,t){await ee(F(),{recursive:!0});let n=new Date().toISOString(),r=new Date(Date.now()+864e5).toISOString(),i={action:t.action,createdAt:n,expiresAt:r,result:t.result,target:t.target};await j(I(e),`${JSON.stringify(i,null,2)}\n`,`utf8`)}function z(e){return e.replace(/[^\w.-]/g,`_`)}async function B(e){let t=await H(e.action,e.target);if(t)return t;let n=f().timeoutMs;if(n===void 0)return W(e,()=>e.run().then(t=>U(e.action,e.target,t)));let r;try{let t=new Promise(t=>{r=setTimeout(()=>{o(),h({action:e.action,data:{reason:`timeout`,timeoutMs:n},target:e.target,type:`cancelled`},{force:!0}),t(m(_({action:e.action,error:{code:`TIMEOUT`,details:{timeoutMs:n},message:`Command timed out after ${n}ms.`},target:e.target}),V,{force:!0}))},n)});return await W(e,()=>Promise.race([e.run().then(t=>U(e.action,e.target,t)),t]))}finally{r&&clearTimeout(r)}}function V(e){e.error&&console.error(y.red(e.error.message))}async function H(e,t){let n=f();if(!n.idempotencyKey)return;let r=await L(n.idempotencyKey);if(!r)return;if(r.action!==e)return m(_({action:e,error:{code:`INVALID_ARGUMENT`,details:{existingAction:r.action,idempotencyKey:n.idempotencyKey},message:`Idempotency key ${n.idempotencyKey} was already used for ${r.action}.`},target:t}),V,{force:!0});let i={...r.result,meta:{...r.result.meta,mode:n.outputMode,runId:n.runId,timestamp:new Date().toISOString()}};return m(i,V,{force:!0}),i}async function U(e,t,n){let r=f();return r.idempotencyKey&&await R(r.idempotencyKey,{action:e,result:n,target:t}),n}async function W(e,t){let n;try{let r=new Promise(t=>{let r=n=>{o(),h({action:e.action,data:{reason:`signal`,signal:n},target:e.target,type:`cancelled`},{force:!0}),t(m(_({action:e.action,error:{code:`CANCELLED`,details:{signal:n},message:`Command cancelled by ${n}.`},target:e.target}),V,{force:!0}))},i=()=>r(`SIGINT`),a=()=>r(`SIGTERM`);O.once(`SIGINT`,i),O.once(`SIGTERM`,a),n=()=>{O.off(`SIGINT`,i),O.off(`SIGTERM`,a)}});return await Promise.race([t(),r])}finally{n?.()}}async function G(t,n,r={}){let i=await e(t);if(!i)return q({agent:{name:t},errorCode:`AGENT_NOT_FOUND`,errorMessage:`Unknown agent: ${t}`,execution:{args:n,installPolicy:r.install??`prompt`,installed:!1,interactive:!1,launched:!1}}),D(`AGENT_NOT_FOUND`);let{agent:a,inspection:o}=i,s=r.nonInteractive?!1:f().interactive,c=r.assumeYes??T(),u=r.dryRun??S(),d=r.install??`prompt`;if(!o.inPath){if(d===`never`)return q({agent:{binaryName:a.binaryName,displayName:a.displayName,name:a.name},errorCode:`AGENT_NOT_INSTALLED`,errorMessage:`${a.displayName} is not installed.`,execution:{args:n,installGuidance:K(a,o.methods,n),installPolicy:d,installed:!1,interactive:s,launched:!1}}),D(`AGENT_NOT_INSTALLED`);if(d===`if-missing`||d===`always`){if(u?C(y.cyan(`Dry run: would install ${a.displayName}.`)):x(y.cyan(`Installing ${a.displayName}...`)),!(await Y(a,u)).success)return w(y.red(`Failed to install ${a.displayName}.`)),1}else if(s){if(!(c||u?{install:!0}:await P({type:`confirm`,name:`install`,message:`${a.displayName} is not installed. Would you like to install it?`,initial:!0})).install)return b(y.yellow(`Installation cancelled.`)),1;if(u?C(y.cyan(`Dry run: would install ${a.displayName}.`)):x(y.cyan(`Installing ${a.displayName}...`)),!(await Y(a,u)).success)return w(y.red(`Failed to install ${a.displayName}.`)),1}else return q({agent:{binaryName:a.binaryName,displayName:a.displayName,name:a.name},errorCode:`INTERACTION_REQUIRED`,errorMessage:`${a.displayName} is not installed and interactive installation is disabled.`,execution:{args:n,installGuidance:K(a,o.methods,n),installPolicy:d,installed:!1,interactive:s,launched:!1}}),D(`INTERACTION_REQUIRED`)}if(u)return J({agent:{binaryName:a.binaryName,displayName:a.displayName,name:a.name},execution:{args:n,installPolicy:d,installed:!0,interactive:s,launched:!1},message:`Dry run: would run ${[a.binaryName,...n].join(` `)}`}),0;try{return await X(l([a.binaryName,...n]),a.displayName)}catch(e){return w(y.red(`Failed to launch ${a.displayName}: ${e instanceof Error?e.message:String(e)}`)),1}}function K(e,t,i){return{docsRef:`skills/quantex-cli/references/command-recipes.md`,installMethods:t.map(t=>({command:n(e,t),label:r(t),type:t.type})).filter(e=>e.command),suggestedAction:`rerun-with-install-policy`,suggestedEnsureCommand:`quantex ensure ${e.name}`,suggestedExecCommand:[`quantex`,`exec`,e.name,`--install`,`if-missing`,`--`,...i].join(` `)}}function q(e){if(f().outputMode===`human`){w(y.red(e.errorMessage));let t=e.execution.installGuidance;t&&(C(y.dim(`Try: ${t.suggestedEnsureCommand}`)),C(y.dim(`Or: ${t.suggestedExecCommand}`)));return}m(_({action:`exec`,data:{agent:e.agent,execution:e.execution},error:{code:e.errorCode,details:e.execution.installGuidance,message:e.errorMessage},target:{kind:`agent`,name:e.agent.name}}),()=>{})}function J(e){if(f().outputMode===`human`){C(y.cyan(e.message));return}m(v({action:`exec`,data:{agent:e.agent,execution:e.execution},target:{kind:`agent`,name:e.agent.name}}),()=>{})}async function Y(e,n=S()){if(n)return{success:!0};try{return await t(e)}catch(t){return c(t)?(w(y.red(t.message)),{success:!1}):(w(y.red(`Failed to install ${e.displayName}: ${t instanceof Error?t.message:String(t)}`)),{success:!1})}}async function X(e,t){let{timeoutMs:n}=f(),r,i;try{let s=new Promise(e=>{let n=n=>{o(),w(y.red(`${t} was cancelled by ${n}.`)),e(D(`CANCELLED`))},i=()=>n(`SIGINT`),a=()=>n(`SIGTERM`);O.once(`SIGINT`,i),O.once(`SIGTERM`,a),r=()=>{O.off(`SIGINT`,i),O.off(`SIGTERM`,a)}}),c=n===void 0?void 0:new Promise(e=>{i=setTimeout(()=>{o(),w(y.red(`${t} timed out after ${n}ms.`)),e(D(`TIMEOUT`))},n)});return await Promise.race([a(e),s,...c?[c]:[]])}finally{i&&clearTimeout(i),r?.()}}N.name(`quantex`).description(`统一的 AI Agent CLI 管理工具`).option(`--json`,`Output structured JSON`).option(`--output <mode>`,`Output mode: human, json, or ndjson`).option(`--non-interactive`,`Disable interactive prompts and confirmations`).option(`--yes`,`Automatically accept safe default confirmations`).option(`--quiet`,`Suppress non-essential human logs`).option(`--color <mode>`,`Color mode: auto, always, or never`).option(`--log-level <level>`,`Log level: silent, error, warn, info, or debug`).option(`--dry-run`,`Show what would happen without making changes`).option(`--refresh`,`Refresh cached version metadata before returning results`).option(`--no-cache`,`Bypass the local version cache for this command`).option(`--run-id <id>`,`Attach a run id to structured output and logs`).option(`--idempotency-key <key>`,`Deduplicate repeated mutating requests by client-supplied key`).option(`--timeout <duration>`,`Abort a command after the given duration, e.g. 500ms, 30s, 5m`).version(g()),N.hook(`preAction`,(e,t)=>{try{s(p(t.optsWithGlobals()))}catch(e){console.log(y.red(e instanceof Error?e.message:String(e))),O.exit(2)}}),N.hook(`postAction`,()=>{d()}),N.command(`schema`).argument(`[command]`,`Optional command name`).description(`查看结构化输出 schema`).action(async e=>{let{schemaCommand:t}=await import(`./schema-nm2KIL1F.mjs`);O.exitCode=await $({action:`schema`,run:()=>t(e),target:{kind:`system`,name:`schema`}})}),N.command(`commands`).description(`查看命令目录与稳定能力`).action(async()=>{let{commandsCommand:e}=await import(`./commands-kENbdAMH.mjs`);O.exitCode=await $({action:`commands`,run:()=>e(),target:{kind:`system`,name:`commands`}})}),N.command(`capabilities`).description(`查看当前环境与 surface 能力`).action(async()=>{let{capabilitiesCommand:e}=await import(`./capabilities-CTH49oSj.mjs`);O.exitCode=await $({action:`capabilities`,run:()=>e(),target:{kind:`system`,name:`capabilities`}})}),N.command(`inspect <agent>`).description(`查看 agent 结构化状态`).action(async e=>{let{inspectCommand:t}=await import(`./inspect-CWc7vqBK.mjs`);O.exitCode=await $({action:`inspect`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`resolve <agent>`).description(`解析 agent 可执行入口`).action(async e=>{let{resolveCommand:t}=await import(`./resolve-CDiwMxPa.mjs`);O.exitCode=await $({action:`resolve`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`install <agent>`).alias(`i`).description(`安装指定 agent`).action(async e=>{let{installCommand:t}=await import(`./install-DW-jmPqm.mjs`);O.exitCode=await $({action:`install`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`ensure <agent>`).description(`确保指定 agent 已安装`).action(async e=>{let{ensureCommand:t}=await import(`./ensure-BJTVMieD.mjs`);O.exitCode=await $({action:`ensure`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`exec <agent>`).description(`以显式策略启动 agent`).allowUnknownOption().option(`--install <policy>`,`Install policy: never, if-missing, always`,`never`).argument(`[args...]`,`Arguments passed through to the agent`).action(async(e,t,n,r)=>{let i=n.install;if(i!==`never`&&i!==`if-missing`&&i!==`always`){console.log(y.red(`Unknown install policy: ${i}`)),O.exitCode=2;return}let a=te(r);O.exitCode=await G(e,a.length>0?a:t,{install:i,nonInteractive:r.optsWithGlobals().nonInteractive})}),N.command(`update`).argument(`[agent]`,`Agent name or alias`).option(`--all`,`更新所有已安装的 agent`).alias(`u`).description(`更新指定 agent`).action(async(e,t)=>{let{updateCommand:n}=await import(`./update-BIDdmLAf.mjs`);O.exitCode=await $({action:`update`,run:()=>n(e,t.all??!1),target:{kind:`agent`,name:e}})}),N.command(`uninstall <agent>`).alias(`rm`).description(`卸载指定 agent`).action(async e=>{let{uninstallCommand:t}=await import(`./uninstall-D6HrR4V-.mjs`);O.exitCode=await $({action:`uninstall`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`list`).alias(`ls`).description(`列出所有支持的 agent`).action(async()=>{let{listCommand:e}=await import(`./list-zF0gAY_Y.mjs`);O.exitCode=await $({action:`list`,run:()=>e(),target:{kind:`system`,name:`agents`}})}),N.command(`info <agent>`).description(`查看 agent 详细信息`).action(async e=>{let{infoCommand:t}=await import(`./info-CJU-8DDE.mjs`);O.exitCode=await $({action:`info`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`config`).argument(`[action]`,`Action: get, set, reset`).argument(`[key]`,`Config key`).argument(`[value]`,`Config value`).description(`配置管理`).action(async(e,t,n)=>{let{configCommand:r}=await import(`./config-CkkMMM5O.mjs`);O.exitCode=await $({action:`config`,run:()=>r(e,t,n),target:{kind:`config`,name:t}})}),N.command(`upgrade`).description(`升级 Quantex CLI`).option(`--channel <channel>`,`Update channel: stable or beta`).option(`--check`,`Only check whether an update is available`).action(async e=>{let{upgradeCommand:t}=await import(`./upgrade-CH9zC7DU.mjs`);O.exitCode=await $({action:`upgrade`,run:()=>t({channel:e.channel===`beta`?`beta`:void 0,check:e.check??!1}),target:{kind:`self`,name:`quantex`}})}),N.command(`doctor`).description(`检查环境`).action(async()=>{let{doctorCommand:e}=await import(`./doctor-CrC2nRsW.mjs`);O.exitCode=await $({action:`doctor`,run:()=>e(),target:{kind:`system`,name:`doctor`}})});const Z=new Set([...N.commands.map(e=>e.name()),...N.commands.flatMap(e=>e.aliases()),`help`,`--help`,`--version`,`-v`]),Q=ne(O.argv.slice(2),Z);if(Q?.error&&(console.log(y.red(Q.error)),O.exit(2)),Q&&i(Q.agentName)){try{s(p({color:Q.color,dryRun:Q.dryRun,idempotencyKey:Q.idempotencyKey,logLevel:Q.logLevel,noCache:Q.noCache,nonInteractive:Q.nonInteractive,quiet:Q.quiet,refresh:Q.refresh,runId:Q.runId,timeout:Q.timeout,yes:Q.yes}))}catch(e){console.log(y.red(e instanceof Error?e.message:String(e))),O.exit(2)}try{let e=await G(Q.agentName,Q.agentArgs,{assumeYes:Q.yes,dryRun:Q.dryRun,nonInteractive:Q.nonInteractive});O.exit(e)}finally{d()}}N.parse();function te(e){let t=e.processedArgs.at(-1);return Array.isArray(t)?t:e.args.slice(1)}function ne(e,t){let n=O.stdin.isTTY===!1||O.stdout.isTTY===!1,r,i=!1,a=0,o,s=!1,c,l=!1,u=!1,d,f=!1,p=!1,m,h,g=!1;for(;a<e.length;){let _=e[a];if(_===`--json`){s=!0,a+=1;continue}if(_===`--output`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--output requires a value`};d=t,a+=2;continue}if(_===`--non-interactive`){u=!0,a+=1;continue}if(_===`--yes`){g=!0,a+=1;continue}if(_===`--quiet`){f=!0,a+=1;continue}if(_===`--color`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--color requires a value`};r=t,a+=2;continue}if(_===`--log-level`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--log-level requires a value`};c=t,a+=2;continue}if(_===`--dry-run`){i=!0,a+=1;continue}if(_===`--refresh`){p=!0,a+=1;continue}if(_===`--no-cache`){l=!0,a+=1;continue}if(_===`--idempotency-key`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--idempotency-key requires a value`};o=t,a+=2;continue}if(_===`--run-id`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--run-id requires a value`};m=t,a+=2;continue}if(_===`--timeout`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--timeout requires a value`};h=t,a+=2;continue}return _.startsWith(`-`)||t.has(_)?void 0:s||d===`json`||d===`ndjson`||n&&d!==`human`?{agentArgs:[],agentName:``,error:`Structured output is not supported for shortcut agent execution yet. Use a management command instead.`}:{agentArgs:e.slice(a+1),agentName:_,color:r,dryRun:i,idempotencyKey:o,logLevel:c,noCache:l,nonInteractive:u,quiet:f,refresh:p,runId:m,timeout:h,yes:g}}}async function $(e){return E(await B(e))}export{};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e,s as t,v as n,y as r}from"./agents-BVcaPgcE.mjs";import{c as i}from"./detect-2jeRd2sI.mjs";import{$ as a,A as o,B as s,N as c,Q as l,V as u,W as d,Z as f,a as p,et as m,i as h,j as g,l as _,n as v,r as ee,t as y,tt as b,u as x}from"./color-P2uVwGzw.mjs";import{a as te,i as S,n as C,o as w,r as T,t as ne}from"./user-output-Dm9t9jPa.mjs";import{n as re,t as E}from"./errors-DCtNasuC.mjs";import D from"node:process";import{mkdir as O,readFile as k,rm as A,writeFile as j}from"node:fs/promises";import{join as M}from"node:path";import{program as N}from"commander";import P from"prompts";function F(){return M(d(),`idempotency`)}function I(e){return M(F(),`${z(e)}.json`)}async function L(e){try{let t=JSON.parse(await k(I(e),`utf8`));if(Date.parse(t.expiresAt)<=Date.now()){await A(I(e),{force:!0});return}return t}catch{return}}async function R(e,t){await O(F(),{recursive:!0});let n=new Date().toISOString(),r=new Date(Date.now()+864e5).toISOString(),i={action:t.action,createdAt:n,expiresAt:r,result:t.result,target:t.target};await j(I(e),`${JSON.stringify(i,null,2)}\n`,`utf8`)}function z(e){return e.replace(/[^\w.-]/g,`_`)}const B=new Set([`doctor`,`upgrade`]);async function V(e){if(!e.ok||B.has(e.action))return;let t=l();if(t.outputMode!==`human`||t.quiet)return;let n=await x();if(!n.latestVersion||n.latestVersion===n.currentVersion)return;let r=await c(),i=Date.now();if(H(r.updateNoticeVersion,r.updateNoticeAt,n.latestVersion,i))return;let a=n.canAutoUpdate?"Run `quantex upgrade`.":"Run `quantex doctor` for source-specific update steps.";S(y.yellow(`Quantex CLI ${n.latestVersion} is available (current ${n.currentVersion}). ${a}`)),await s(n.latestVersion,new Date(i).toISOString())}function H(e,t,n,r){if(!e||!t||e!==n)return!1;let i=Date.parse(t);return Number.isNaN(i)?!1:r-i<864e5}async function U(e){let t=await K(e.action,e.target);if(t)return t;let n=l().timeoutMs;if(n===void 0)return q(e,()=>e.run().then(t=>W(e.action,e.target,t)));let r;try{let t=new Promise(t=>{r=setTimeout(()=>{f(),h({action:e.action,data:{reason:`timeout`,timeoutMs:n},target:e.target,type:`cancelled`},{force:!0}),t(p(v({action:e.action,error:{code:`TIMEOUT`,details:{timeoutMs:n},message:`Command timed out after ${n}ms.`},target:e.target}),G,{force:!0}))},n)});return await q(e,async()=>{let n=await Promise.race([e.run(),t]);return r!==void 0&&(clearTimeout(r),r=void 0),W(e.action,e.target,n)})}finally{r&&clearTimeout(r)}}async function W(e,t,n){let r=await ie(e,t,n);try{await V({action:e,ok:r.ok})}catch{}return r}function G(e){e.error&&console.error(y.red(e.error.message))}async function K(e,t){let n=l();if(!n.idempotencyKey)return;let r=await L(n.idempotencyKey);if(!r)return;if(r.action!==e)return p(v({action:e,error:{code:`INVALID_ARGUMENT`,details:{existingAction:r.action,idempotencyKey:n.idempotencyKey},message:`Idempotency key ${n.idempotencyKey} was already used for ${r.action}.`},target:t}),G,{force:!0});let i={...r.result,meta:{...r.result.meta,mode:n.outputMode,runId:n.runId,timestamp:new Date().toISOString()}};return p(i,G,{force:!0}),i}async function ie(e,t,n){let r=l();return r.idempotencyKey&&await R(r.idempotencyKey,{action:e,result:n,target:t}),n}async function q(e,t){let n;try{let r=new Promise(t=>{let r=n=>{f(),h({action:e.action,data:{reason:`signal`,signal:n},target:e.target,type:`cancelled`},{force:!0}),t(p(v({action:e.action,error:{code:`CANCELLED`,details:{signal:n},message:`Command cancelled by ${n}.`},target:e.target}),G,{force:!0}))},i=()=>r(`SIGINT`),a=()=>r(`SIGTERM`);D.once(`SIGINT`,i),D.once(`SIGTERM`,a),n=()=>{D.off(`SIGINT`,i),D.off(`SIGTERM`,a)}});return await Promise.race([t(),r])}finally{n?.()}}async function J(t,n,r={}){let i=await e(t);if(!i)return X({agent:{name:t},errorCode:`AGENT_NOT_FOUND`,errorMessage:`Unknown agent: ${t}`,execution:{args:n,installPolicy:r.install??`prompt`,installed:!1,interactive:!1,launched:!1}}),E(`AGENT_NOT_FOUND`);let{agent:a,inspection:s}=i,c=r.nonInteractive?!1:l().interactive,u=r.assumeYes??ne(),d=r.dryRun??C(),f=r.install??`prompt`;if(!s.inPath){if(f===`never`)return X({agent:{binaryName:a.binaryName,displayName:a.displayName,name:a.name},errorCode:`AGENT_NOT_INSTALLED`,errorMessage:`${a.displayName} is not installed.`,execution:{args:n,installGuidance:Y(a,s.methods,n),installPolicy:f,installed:!1,interactive:c,launched:!1}}),E(`AGENT_NOT_INSTALLED`);if(f===`if-missing`||f===`always`){if(d?w(y.cyan(`Dry run: would install ${a.displayName}.`)):S(y.cyan(`Installing ${a.displayName}...`)),!(await Z(a,d)).success)return T(y.red(`Failed to install ${a.displayName}.`)),1}else if(c){if(!(u||d?{install:!0}:await P({type:`confirm`,name:`install`,message:`${a.displayName} is not installed. Would you like to install it?`,initial:!0})).install)return te(y.yellow(`Installation cancelled.`)),1;if(d?w(y.cyan(`Dry run: would install ${a.displayName}.`)):S(y.cyan(`Installing ${a.displayName}...`)),!(await Z(a,d)).success)return T(y.red(`Failed to install ${a.displayName}.`)),1}else return X({agent:{binaryName:a.binaryName,displayName:a.displayName,name:a.name},errorCode:`INTERACTION_REQUIRED`,errorMessage:`${a.displayName} is not installed and interactive installation is disabled.`,execution:{args:n,installGuidance:Y(a,s.methods,n),installPolicy:f,installed:!1,interactive:c,launched:!1}}),E(`INTERACTION_REQUIRED`)}if(d)return ae({agent:{binaryName:a.binaryName,displayName:a.displayName,name:a.name},execution:{args:n,installPolicy:f,installed:!0,interactive:c,launched:!1},message:`Dry run: would run ${[a.binaryName,...n].join(` `)}`}),0;try{return await oe(o([a.binaryName,...n]),a.displayName)}catch(e){return T(y.red(`Failed to launch ${a.displayName}: ${e instanceof Error?e.message:String(e)}`)),1}}function Y(e,t,i){return{docsRef:`skills/quantex-cli/references/command-recipes.md`,installMethods:t.map(t=>({command:n(e,t),label:r(t),type:t.type})).filter(e=>e.command),suggestedAction:`rerun-with-install-policy`,suggestedEnsureCommand:`quantex ensure ${e.name}`,suggestedExecCommand:[`quantex`,`exec`,e.name,`--install`,`if-missing`,`--`,...i].join(` `)}}function X(e){if(l().outputMode===`human`){T(y.red(e.errorMessage));let t=e.execution.installGuidance;t&&(w(y.dim(`Try: ${t.suggestedEnsureCommand}`)),w(y.dim(`Or: ${t.suggestedExecCommand}`)));return}p(v({action:`exec`,data:{agent:e.agent,execution:e.execution},error:{code:e.errorCode,details:e.execution.installGuidance,message:e.errorMessage},target:{kind:`agent`,name:e.agent.name}}),()=>{})}function ae(e){if(l().outputMode===`human`){w(y.cyan(e.message));return}p(ee({action:`exec`,data:{agent:e.agent,execution:e.execution},target:{kind:`agent`,name:e.agent.name}}),()=>{})}async function Z(e,n=C()){if(n)return{success:!0};try{return await t(e)}catch(t){return u(t)?(T(y.red(t.message)),{success:!1}):(T(y.red(`Failed to install ${e.displayName}: ${t instanceof Error?t.message:String(t)}`)),{success:!1})}}async function oe(e,t){let{timeoutMs:n}=l(),r,i;try{let a=new Promise(e=>{let n=n=>{f(),T(y.red(`${t} was cancelled by ${n}.`)),e(E(`CANCELLED`))},i=()=>n(`SIGINT`),a=()=>n(`SIGTERM`);D.once(`SIGINT`,i),D.once(`SIGTERM`,a),r=()=>{D.off(`SIGINT`,i),D.off(`SIGTERM`,a)}}),o=n===void 0?void 0:new Promise(e=>{i=setTimeout(()=>{f(),T(y.red(`${t} timed out after ${n}ms.`)),e(E(`TIMEOUT`))},n)});return await Promise.race([g(e),a,...o?[o]:[]])}finally{i&&clearTimeout(i),r?.()}}N.name(`quantex`).description(`统一的 AI Agent CLI 管理工具`).option(`--json`,`Output structured JSON`).option(`--output <mode>`,`Output mode: human, json, or ndjson`).option(`--non-interactive`,`Disable interactive prompts and confirmations`).option(`--yes`,`Automatically accept safe default confirmations`).option(`--quiet`,`Suppress non-essential human logs`).option(`--color <mode>`,`Color mode: auto, always, or never`).option(`--log-level <level>`,`Log level: silent, error, warn, info, or debug`).option(`--dry-run`,`Show what would happen without making changes`).option(`--refresh`,`Refresh cached version metadata before returning results`).option(`--no-cache`,`Bypass the local version cache for this command`).option(`--run-id <id>`,`Attach a run id to structured output and logs`).option(`--idempotency-key <key>`,`Deduplicate repeated mutating requests by client-supplied key`).option(`--timeout <duration>`,`Abort a command after the given duration, e.g. 500ms, 30s, 5m`).version(_()),N.hook(`preAction`,(e,t)=>{try{b(m(t.optsWithGlobals()))}catch(e){console.log(y.red(e instanceof Error?e.message:String(e))),D.exit(2)}}),N.hook(`postAction`,()=>{a()}),N.command(`schema`).argument(`[command]`,`Optional command name`).description(`查看结构化输出 schema`).action(async e=>{let{schemaCommand:t}=await import(`./schema-kltaay-J.mjs`);D.exitCode=await $({action:`schema`,run:()=>t(e),target:{kind:`system`,name:`schema`}})}),N.command(`commands`).description(`查看命令目录与稳定能力`).action(async()=>{let{commandsCommand:e}=await import(`./commands-DdZ1o2av.mjs`);D.exitCode=await $({action:`commands`,run:()=>e(),target:{kind:`system`,name:`commands`}})}),N.command(`capabilities`).description(`查看当前环境与 surface 能力`).action(async()=>{let{capabilitiesCommand:e}=await import(`./capabilities-Dv-KUALO.mjs`);D.exitCode=await $({action:`capabilities`,run:()=>e(),target:{kind:`system`,name:`capabilities`}})}),N.command(`inspect <agent>`).description(`查看 agent 结构化状态`).action(async e=>{let{inspectCommand:t}=await import(`./inspect-CZJdyaQA.mjs`);D.exitCode=await $({action:`inspect`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`resolve <agent>`).description(`解析 agent 可执行入口`).action(async e=>{let{resolveCommand:t}=await import(`./resolve-Yp7_1ni8.mjs`);D.exitCode=await $({action:`resolve`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`install <agent>`).alias(`i`).description(`安装指定 agent`).action(async e=>{let{installCommand:t}=await import(`./install-DUWi242L.mjs`);D.exitCode=await $({action:`install`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`ensure <agent>`).description(`确保指定 agent 已安装`).action(async e=>{let{ensureCommand:t}=await import(`./ensure-C1R6CFS_.mjs`);D.exitCode=await $({action:`ensure`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`exec <agent>`).description(`以显式策略启动 agent`).allowUnknownOption().option(`--install <policy>`,`Install policy: never, if-missing, always`,`never`).argument(`[args...]`,`Arguments passed through to the agent`).action(async(e,t,n,r)=>{let i=n.install;if(i!==`never`&&i!==`if-missing`&&i!==`always`){console.log(y.red(`Unknown install policy: ${i}`)),D.exitCode=2;return}let a=ce(r);D.exitCode=await J(e,a.length>0?a:t,{install:i,nonInteractive:r.optsWithGlobals().nonInteractive})}),N.command(`update`).argument(`[agent]`,`Agent name or alias`).option(`--all`,`更新所有已安装的 agent`).alias(`u`).description(`更新指定 agent`).action(async(e,t)=>{let{updateCommand:n}=await import(`./update-BlxqUwh8.mjs`);D.exitCode=await $({action:`update`,run:()=>n(e,t.all??!1),target:{kind:`agent`,name:e}})}),N.command(`uninstall <agent>`).alias(`rm`).description(`卸载指定 agent`).action(async e=>{let{uninstallCommand:t}=await import(`./uninstall-BR6Y8hk2.mjs`);D.exitCode=await $({action:`uninstall`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`list`).alias(`ls`).description(`列出所有支持的 agent`).action(async()=>{let{listCommand:e}=await import(`./list-CLj2KsEf.mjs`);D.exitCode=await $({action:`list`,run:()=>e(),target:{kind:`system`,name:`agents`}})}),N.command(`info <agent>`).description(`查看 agent 详细信息`).action(async e=>{let{infoCommand:t}=await import(`./info-4JHWiNXK.mjs`);D.exitCode=await $({action:`info`,run:()=>t(e),target:{kind:`agent`,name:e}})}),N.command(`config`).argument(`[action]`,`Action: get, set, reset`).argument(`[key]`,`Config key`).argument(`[value]`,`Config value`).description(`配置管理`).action(async(e,t,n)=>{let{configCommand:r}=await import(`./config-CGQNhYN9.mjs`);D.exitCode=await $({action:`config`,run:()=>r(e,t,n),target:{kind:`config`,name:t}})}),N.command(`upgrade`).description(`升级 Quantex CLI`).option(`--channel <channel>`,`Update channel: stable or beta`).option(`--check`,`Only check whether an update is available`).action(async e=>{let{upgradeCommand:t}=await import(`./upgrade-BstKxwge.mjs`);D.exitCode=await $({action:`upgrade`,run:()=>t({channel:e.channel===`beta`?`beta`:void 0,check:e.check??!1}),target:{kind:`self`,name:`quantex`}})}),N.command(`doctor`).description(`检查环境`).action(async()=>{let{doctorCommand:e}=await import(`./doctor-D0hquPsq.mjs`);D.exitCode=await $({action:`doctor`,run:()=>e(),target:{kind:`system`,name:`doctor`}})});const se=new Set([...N.commands.map(e=>e.name()),...N.commands.flatMap(e=>e.aliases()),`help`,`--help`,`--version`,`-v`]),Q=le(D.argv.slice(2),se);if(Q?.error&&(console.log(y.red(Q.error)),D.exit(2)),Q&&i(Q.agentName)){try{b(m({color:Q.color,dryRun:Q.dryRun,idempotencyKey:Q.idempotencyKey,logLevel:Q.logLevel,noCache:Q.noCache,nonInteractive:Q.nonInteractive,quiet:Q.quiet,refresh:Q.refresh,runId:Q.runId,timeout:Q.timeout,yes:Q.yes}))}catch(e){console.log(y.red(e instanceof Error?e.message:String(e))),D.exit(2)}try{let e=await J(Q.agentName,Q.agentArgs,{assumeYes:Q.yes,dryRun:Q.dryRun,nonInteractive:Q.nonInteractive});D.exit(e)}finally{a()}}N.parse();function ce(e){let t=e.processedArgs.at(-1);return Array.isArray(t)?t:e.args.slice(1)}function le(e,t){let n=D.stdin.isTTY===!1||D.stdout.isTTY===!1,r,i=!1,a=0,o,s=!1,c,l=!1,u=!1,d,f=!1,p=!1,m,h,g=!1;for(;a<e.length;){let _=e[a];if(_===`--json`){s=!0,a+=1;continue}if(_===`--output`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--output requires a value`};d=t,a+=2;continue}if(_===`--non-interactive`){u=!0,a+=1;continue}if(_===`--yes`){g=!0,a+=1;continue}if(_===`--quiet`){f=!0,a+=1;continue}if(_===`--color`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--color requires a value`};r=t,a+=2;continue}if(_===`--log-level`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--log-level requires a value`};c=t,a+=2;continue}if(_===`--dry-run`){i=!0,a+=1;continue}if(_===`--refresh`){p=!0,a+=1;continue}if(_===`--no-cache`){l=!0,a+=1;continue}if(_===`--idempotency-key`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--idempotency-key requires a value`};o=t,a+=2;continue}if(_===`--run-id`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--run-id requires a value`};m=t,a+=2;continue}if(_===`--timeout`){let t=e[a+1];if(!t)return{agentArgs:[],agentName:``,error:`--timeout requires a value`};h=t,a+=2;continue}return _.startsWith(`-`)||t.has(_)?void 0:s||d===`json`||d===`ndjson`||n&&d!==`human`?{agentArgs:[],agentName:``,error:`Structured output is not supported for shortcut agent execution yet. Use a management command instead.`}:{agentArgs:e.slice(a+1),agentName:_,color:r,dryRun:i,idempotencyKey:o,logLevel:c,noCache:l,nonInteractive:u,quiet:f,refresh:p,runId:m,timeout:h,yes:g}}}async function $(e){return re(await U(e))}export{};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{createHash as e,randomUUID as t}from"node:crypto";import n from"node:process";import{chmod as r,mkdir as i,mkdtemp as a,readFile as o,realpath as s,rename as c,rm as l,stat as u,writeFile as d}from"node:fs/promises";import{basename as f,dirname as p,join as m}from"node:path";import{fileURLToPath as h}from"node:url";import{homedir as g}from"node:os";import{spawn as ee}from"node:child_process";import{text as te}from"node:stream/consumers";import{Buffer as ne}from"node:buffer";import{existsSync as _}from"node:fs";import re from"picocolors";function ie(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??=de(),v}function ae(e){y=new Set,v={...e,cacheMode:e.cacheMode??`default`,cancelled:e.cancelled??!1}}function oe(){v=void 0,y=new Set}function x(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:ie(e.timeout),c=fe(e.color),l=pe(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 se(){v&&(v.cancelled=!0)}function ce(){se();for(let e of y)e();y.clear()}function le(e){return y.add(e),()=>{y.delete(e)}}function ue(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 de(){return x()}function fe(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 pe(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 me=`https://registry.npmjs.org`;function S(e){if(e)try{return new URL(e.trim()).toString().replace(/\/+$/,``)}catch{return}}function he(e,t,n){return`${S(n)}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}const ge={defaultPackageManager:`bun`,networkRetries:2,networkTimeoutMs:1e4,npmBunUpdateStrategy:`latest-major`,selfUpdateChannel:`stable`,selfUpdateRegistry:void 0,versionCacheTtlHours:6};function C(){return m(n.env.HOME||n.env.USERPROFILE||g(),`.quantex`)}function w(){return m(C(),`config.json`)}async function T(){let e={...ge,...await ye()};return{...e,defaultPackageManager:e.defaultPackageManager===`npm`?`npm`:`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`?S(e.selfUpdateRegistry):void 0,versionCacheTtlHours:E(e.versionCacheTtlHours,6)}}function _e(e){return e===`latest-major`||e===`respect-semver`}async function ve(e){await i(C(),{recursive:!0}),await d(w(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}async function ye(){try{let e=await o(w(),`utf8`),t=JSON.parse(e);return be(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 be(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const D=`quantex-cli`,O=`https://github.com/Drswith/quantex-cli`,xe=`0.13.0`;var k=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 A(e){return e instanceof k}function Se(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 m(C(),`locks`,...r,i)}async function j(e){let t=Se(e.scope);await i(p(t),{recursive:!0});try{await i(t,{recursive:!1})}catch(n){throw typeof n==`object`&&n&&`code`in n&&n.code===`EEXIST`?new k(e.resource,t):n}return async()=>{await l(t,{force:!0,recursive:!0})}}async function Ce(e,t){let n=await j(e);try{return await t()}finally{await n()}}const we={installedAgents:{},self:{}};function M(){return m(C(),`state.json`)}async function N(){return Me()}async function Te(e){let t=await j({resource:`state`,scope:[`state`]});try{await Ne(e)}finally{await t()}}async function Ee(e){return(await N()).installedAgents[e]}async function De(e){await P(t=>{t.installedAgents[e.agentName]=e})}async function Oe(e){await P(t=>{delete t.installedAgents[e]})}async function ke(){return(await N()).self}async function Ae(e){await P(t=>{t.self.installSource=e})}async function je(e,t){await P(n=>{n.self.updateNoticeVersion=e,n.self.updateNoticeAt=t})}async function Me(){try{let e=JSON.parse(await o(M(),`utf8`));return{installedAgents:e.installedAgents??{},self:{installSource:e.self?.installSource,updateNoticeAt:e.self?.updateNoticeAt,updateNoticeVersion:e.self?.updateNoticeVersion}}}catch{return{...we}}}async function Ne(e){await i(C(),{recursive:!0}),await d(M(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}async function P(e){let t=await j({resource:`state`,scope:[`state`]});try{let t=await Me();await e(t),await Ne(t)}finally{await t()}}function F(e,t={}){if(b().outputMode===`human`){let n=L(e,{...t,stdio:[`inherit`,`inherit`,`inherit`]});return{cleanup:le(()=>n.kill?.(`SIGTERM`)),outputDrained:Promise.resolve(),proc:n}}let n=L(e,{...t,stdio:[`ignore`,`pipe`,`pipe`]});return{cleanup:le(()=>n.kill?.(`SIGTERM`)),outputDrained:Promise.all([z(n.stdout),z(n.stderr)]).then(()=>void 0),proc:n}}async function I(e){try{let t=await e.proc.exited;return await e.outputDrained,t}finally{e.cleanup()}}function L(e,t={}){let n=Ie();if(n)return Le(e,t,n);let[r,...i]=e;if(!r)throw Error(`spawnCommand requires a non-empty command array.`);let a=ee(r,i,{...t,shell:t.shell??Fe(r)});return{get exitCode(){return a.exitCode},stderr:a.stderr,stdout:a.stdout,exited:Pe(a),kill:a.kill.bind(a),unref:()=>a.unref()}}async function R(e){let[t,n,r]=await Promise.all([B(e.stdout),B(e.stderr),e.exited]);return{exitCode:r,stderr:n,stdout:t}}async function z(e){if(!e)return;let t=await B(e);t&&n.stderr.write(t)}async function Pe(e){return new Promise((t,n)=>{e.once(`error`,n),e.once(`close`,e=>{t(typeof e==`number`?e:1)})})}async function B(e){return e?typeof e==`string`?e:typeof e.getReader==`function`?new Response(e).text():te(e):``}function Fe(e){return n.platform!==`win32`||e.includes(`/`)||e.includes(`\\`)?!1:!/\.[a-z0-9]+$/i.test(e)}function Ie(){let e=globalThis.Bun?.spawn;return typeof e==`function`?e:void 0}function Le(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 V(e,t){let n=await Re(e,t,`json`);if(n)try{return JSON.parse(n)}catch{return}}async function Re(e,t,n=`text`){let r=await T(),i=r.versionCacheTtlHours*60*60*1e3,a=b().cacheMode,o=a===`no-cache`?{entries:{}}:await Be(),s=o.entries[t],c=Date.now();if(a===`default`&&s&&s.expiresAt>c)return H(s,i),s.body;let l=await ze(e,{headers:a!==`no-cache`&&s?.etag?{"If-None-Match":s.etag}:void 0,retries:r.networkRetries,timeoutMs:r.networkTimeoutMs});if(!l)return s&&H(s,i),s?.body;if(l.status===304&&s)return o.entries[t]={...s,expiresAt:c+i,fetchedAt:c},a!==`no-cache`&&await Ve(o),Ue(c,c+i),s.body;if(!l.ok)return s&&H(s,i),s?.body;let u=await l.text();if(n===`json`)try{JSON.parse(u)}catch{return s&&H(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 Ve(o)),Ue(c,c+i),u}async function ze(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 Be(){try{return JSON.parse(await o(He(),`utf8`))}catch{return{entries:{}}}}async function Ve(e){await i(m(C(),`cache`),{recursive:!0}),await d(He(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}function He(){return m(C(),`cache`,`versions.json`)}function H(e,t){let n=e.fetchedAt??Math.max(0,e.expiresAt-t);ue({fetchedAt:new Date(n).toISOString(),source:`cache`,staleAfter:new Date(e.expiresAt).toISOString()})}function Ue(e,t){ue({fetchedAt:new Date(e).toISOString(),source:`network`,staleAfter:new Date(t).toISOString()})}const We=/v?(\d+\.\d+\.\d+(?:-[a-z0-9.]+)?)/i;function Ge(e,t){if(t)return t(e);let n=e.trim().split(`
|
|
2
|
+
`)[0],r=n.match(We);return r?r[1]:n||void 0}async function Ke(e,t){let n=t?.command??[e,`--version`];try{let{exitCode:e,stdout:r}=await R(L(n));return e===0?Ge(r,t?.parser):void 0}catch{return}}async function U(e,t=`latest`,n={}){try{let r=S(n.registry)??`https://registry.npmjs.org`;return(await V(he(e,t,r),`npm:${r}:${e}:${t}`))?.version}catch{return}}async function qe(e){try{let{exitCode:t,stdout:r}=await R(L([n.platform===`win32`?`where`:`which`,e]));return t===0?r.trim().split(`
|
|
3
|
+
`)[0]:void 0}catch{return}}async function Je(e){if(e)try{return await s(e)}catch{return e}}async function Ye(){try{return await j({resource:`self upgrade`,scope:[`self-upgrade`]})}catch(e){if(A(e))return;throw e}}async function Xe(e,t,i,o){let s;try{s=await fetch(e)}catch(t){return G(`network`,`Failed to download ${e}.`,t)}if(!s.ok)return G(`network`,`Failed to download ${e}: HTTP ${s.status}.`);let u=await a(m(p(t),`.quantex-upgrade-`)),h=m(u,f(t)),g=`${t}.bak`;try{let a=ne.from(await s.arrayBuffer()),f=await Ze(t),p=rt(a);if(p!==it(i))return G(`checksum`,`Checksum mismatch for ${e}. Expected ${it(i)}, got ${p}.`);if(await d(h,a),n.platform===`win32`)return Qe(h,t,g,u,o);await r(h,f),await l(g,{force:!0}),await c(t,g),await c(h,t);let m=await nt(t,o);return m.success?(await l(g,{force:!0}),{success:!0}):(await tt(g,t),m)}catch(e){return G(et(e),`Failed to replace the current Quantex binary.`,e)}finally{n.platform!==`win32`&&await l(u,{recursive:!0,force:!0})}}async function Ze(e){try{return(await u(e)).mode&511}catch{return 493}}function Qe(e,t,r,i,a){try{return L([`powershell.exe`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-WindowStyle`,`Hidden`,`-Command`,$e(e,t,r,i,n.pid,a)],{stdio:[`ignore`,`ignore`,`ignore`],windowsHide:!0}).unref(),{success:!0}}catch(e){return G(`locked`,`Failed to schedule Windows binary replacement.`,e)}}function $e(e,t,n,r,i,a){let o=W(e),s=W(t),c=W(n),l=W(r),u=W(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 W(e){return e.replaceAll(`'`,`''`)}function G(e,t,n){return{error:{detail:n,kind:e,message:t},success:!1}}function et(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 tt(e,t){await l(t,{force:!0}),await c(e,t)}async function nt(e,t){if(!t)return{success:!0};try{let{exitCode:n,stdout:r}=await R(L([e,`--version`],{stdio:[`ignore`,`pipe`,`ignore`]}));return n===0?r.includes(t)?{success:!0}:G(`verify`,`The upgraded Quantex binary reported an unexpected version during verification.`):G(`verify`,`The upgraded Quantex binary exited with code ${n} during verification.`)}catch(e){return G(`verify`,`Failed to execute the upgraded Quantex binary for verification.`,e)}}function rt(t){return e(`sha256`).update(t).digest(`hex`)}function it(e){return e.trim().toLowerCase()}function at(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function K(e=n.execPath){if(f(at(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 ot(e=n.execPath){let t=K(e);if(t)return`${O}/releases/latest/download/${t}`}function st(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 ct(e){let t=await V(await lt(e),`self:manifest:${e}`);if(!t)throw Error(`Failed to download release manifest.`);return t}async function lt(e){if(e===`stable`)return`${O}/releases/latest/download/manifest.json`;let t=(await ut(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 ut(e){let t=ft();if(!t)throw Error(`Failed to resolve the GitHub repository slug for Quantex releases.`);let n=await V(`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 dt(e,t=n.execPath){let r=n.platform,i=n.arch===`arm64`?`arm64`:`x64`,a=K(t);return e.assets.find(e=>e.platform===r&&e.arch===i&&(!a||e.name===a))}function ft(){return O.match(/github\.com\/([^/]+\/[^/]+)$/)?.[1]}const pt={source:`binary`,canHandle:e=>e.installSource===`binary`,getRecoveryHint:(e,t)=>{let n=t?.error?.detail&&typeof t.error.detail==`object`&&`downloadUrl`in t.error.detail?String(t.error.detail.downloadUrl):ot(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){if(!K(e.executablePath))return{error:{kind:`unsupported`,message:`No release artifact is available for the current platform and architecture.`},installSource:e.installSource,success:!1};let t;try{t=await ct(e.updateChannel)}catch(t){return{error:{detail:t,kind:`network`,message:`Failed to resolve the ${e.updateChannel} release manifest.`},installSource:e.installSource,success:!1}}let n=dt(t,e.executablePath);if(!n)return{error:{detail:{channel:e.updateChannel},kind:`unsupported`,message:`No binary asset is available for the current platform on the ${e.updateChannel} channel.`},installSource:e.installSource,success:!1};let r=await Xe(n.downloadUrl,e.executablePath,n.checksum,t.version);return{...!r.success&&r.error?{...r,error:{...r.error,detail:{...typeof r.error.detail==`object`&&r.error.detail?r.error.detail:{},downloadUrl:n.downloadUrl}}}:r,installSource:e.installSource,newVersion:r.success?t.version:void 0}}};async function mt(e,t,n){try{let r=t?`${e}@${t}`:e,i=S(n);return await q([`bun`,`add`,`-g`,...i?[`--registry`,i]:[],r],[e])}catch{return!1}}async function ht(e,t=`latest-major`,n=`latest`,r){try{let i=n===`latest`?e:`${e}@${n}`,a=S(r);return await q([`bun`,`update`,`-g`,...t===`latest-major`?[`--latest`]:[],...a?[`--registry`,a]:[],i],[e])}catch{return!1}}async function gt(e,t=`latest-major`){if(e.length===0)return!0;try{return await q([`bun`,`update`,`-g`,...t===`latest-major`?[`--latest`]:[],...e],e)}catch{return!1}}async function _t(e){try{return await I(F([`bun`,`remove`,`-g`,e]))===0}catch{return!1}}async function q(e,t){return await I(F(e))===0?vt(t):!1}async function vt(e){let t=[...new Set(e)];if(t.length===0)return!0;let n=await yt();if(!n)return!0;let r=bt(n),i=t.filter(e=>r.has(e));return i.length===0?!0:await I(F([`bun`,`pm`,`-g`,`trust`,...i]))===0}async function yt(){try{let{exitCode:e,stdout:t}=await R(L([`bun`,`pm`,`-g`,`untrusted`],{stdio:xt()}));return e===0?t:void 0}catch{return}}function bt(e){let t=new Set;for(let n of e.split(`
|
|
4
|
+
`)){let e=n.match(/^\.\/node_modules\/(.+?) @/);e?.[1]&&t.add(e[1])}return t}function xt(){return[`ignore`,`pipe`,`ignore`]}const St={source:`bun`,canHandle:e=>e.installSource===`bun`,getRecoveryHint:e=>`bun add -g ${D}@${e.updateChannel===`beta`?`beta`:`latest`}`,async upgrade(e){let t=await mt(D,e.updateChannel===`beta`?`beta`:`latest`,e.managedRegistry);return{error:t?void 0:{kind:`unknown`,message:`Failed to update ${D} through Bun.`},installSource:e.installSource,newVersion:t?e.latestVersion:void 0,success:t}}};async function Ct(e,t,n){try{let r=t?`${e}@${t}`:e,i=S(n);return await I(F([`npm`,`install`,`-g`,r,...i?[`--registry`,i]:[]]))===0}catch{return!1}}async function wt(e,t=`latest-major`,n=`latest`,r){try{let i=S(r);return await I(F(t===`latest-major`?[`npm`,`install`,`-g`,`${e}@${n}`,...i?[`--registry`,i]:[]]:[`npm`,`update`,`-g`,e,...i?[`--registry`,i]:[]]))===0}catch{return!1}}async function Tt(e,t=`latest-major`){if(e.length===0)return!0;try{return await I(F(t===`latest-major`?[`npm`,`install`,`-g`,...e.map(e=>`${e}@latest`)]:[`npm`,`update`,`-g`,...e]))===0}catch{return!1}}async function Et(e){try{return await I(F([`npm`,`uninstall`,`-g`,e]))===0}catch{return!1}}const Dt={source:`npm`,canHandle:e=>e.installSource===`npm`,getRecoveryHint:e=>`npm install -g ${D}@${e.updateChannel===`beta`?`beta`:`latest`}`,async upgrade(e){let t=await Ct(D,e.updateChannel===`beta`?`beta`:`latest`,e.managedRegistry);return{error:t?void 0:{kind:`unknown`,message:`Failed to update ${D} through npm.`},installSource:e.installSource,newVersion:t?e.latestVersion:void 0,success:t}}},Ot={source:`source`,canHandle:e=>e.installSource===`source`||e.installSource===`unknown`,getRecoveryHint:()=>void 0,async upgrade(e){return{error:{kind:`unsupported`,message:`Install source "${e.installSource}" does not support auto-update.`},installSource:e.installSource,success:!1}}},kt=[St,Dt,pt,Ot];function J(e){return kt.find(t=>t.canHandle(e))??Ot}function At(e,t,n=`stable`){return J({canAutoUpdate:e===`binary`||e===`bun`||e===`npm`,currentVersion:``,executablePath:t,installSource:e,packageRoot:``,updateChannel:n})}function jt(e,t,n=`stable`,r){return r?.error?.kind===`locked`?`another qtx upgrade is already running; wait for it to finish and retry`:At(e,t,n).getRecoveryHint({canAutoUpdate:e===`binary`||e===`bun`||e===`npm`,currentVersion:``,executablePath:t,installSource:e,packageRoot:``,updateChannel:n},r)}function Mt(e,t){return t?.error?.kind===`locked`?`another qtx upgrade is already running; wait for it to finish and retry`:J(e).getRecoveryHint(e,t)}async function Nt(e,t,r=n.env,i=n.cwd()){if(e!==`bun`&&e!==`npm`)return;let a=S(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 Pt(e,r,i)||{isOverride:!1,registry:me,source:`fallback`}}async function Pt(e,t,n){if(e===`bun`){let e=Ft(t,[`BUN_CONFIG_REGISTRY`,`NPM_CONFIG_REGISTRY`,`npm_config_registry`]);if(e)return{isOverride:!1,registry:e,source:`bun-env`};let r=await It(n,t);if(r)return{isOverride:!1,registry:r,source:`bunfig`}}let r=Ft(t,[`NPM_CONFIG_REGISTRY`,`npm_config_registry`]);if(r)return{isOverride:!1,registry:r,source:`npm-env`};let i=await Rt(n,t);if(i)return{isOverride:!1,registry:i,source:`npmrc`}}function Ft(e,t){for(let n of t){let t=S(e[n]);if(t)return t}}async function It(e,t){let n=Vt(t),r=t.XDG_CONFIG_HOME,i=Bt(e,`bunfig.toml`),a=[m(n,`.bunfig.toml`),r?m(r,`.bunfig.toml`):void 0];if(i){let e=await Lt(i);if(e)return e}for(let e of a){if(!e||!_(e))continue;let t=await Lt(e);if(t)return t}}async function Lt(e){try{return Ht(await o(e,`utf8`))}catch{return}}async function Rt(e,t){let n=Vt(t),r=Bt(e,`.npmrc`),i=m(n,`.npmrc`);if(r){let e=await zt(r);if(e)return e}if(_(i))return zt(i)}async function zt(e){try{let t=(await o(e,`utf8`)).split(`
|
|
5
|
+
`).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=S(r[1]);if(i)return i}}catch{}}function Bt(e,t){let n=e;for(;;){let e=m(n,t);if(_(e))return e;let r=p(n);if(r===n)return;n=r}}function Vt(e){return e.HOME||e.USERPROFILE||g()}function Ht(e){let t=Y(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 S(t);let n=e.match(/(?:^|\n)\s*\[install\]\s*\n([\s\S]*?)(?=\n\s*\[[^\]]+\]|\s*$)/)?.[1];if(n)return S(Y(n,[/(?:^|\n)\s*registry\s*=\s*["']([^"'#\n]+)["']/,/(?:^|\n)\s*registry\s*=\s*\{\s*url\s*=\s*["']([^"'#\n]+)["']/]))}function Y(e,t){for(let n of t){let t=e.match(n)?.[1];if(t)return t}}const X=D,Ut=`/node_modules/${X}`;async function Wt(e){let t=await qt(),r=n.execPath,i=t.foundPackageJson?Q(t.packageRoot):Q(``,r),a=await Kt((await ke()).installSource,i),o=await T(),s=st(e?.updateChannel,o.selfUpdateChannel),c=await Yt(a,r,s,o);return{canAutoUpdate:Z(a),currentVersion:t.version||`0.13.0`,executablePath:r,installSource:a,latestVersion:c.installableLatestVersion,managedRegistry:c.managedRegistry,managedRegistryIsOverride:c.managedRegistryIsOverride,packageRoot:t.packageRoot,recommendedUpgradeCommand:Z(a)?`quantex upgrade`:void 0,upstreamLatestVersion:c.upstreamLatestVersion,updateChannel:s}}async function Gt(e){let t=e??await Wt(),n=await Ye();if(!n)return{error:{kind:`locked`,message:`Another qtx upgrade is already running.`},installSource:t.installSource,success:!1};try{return Xt(t,await J(t).upgrade(t))}finally{await n()}}function Z(e){return e===`binary`||e===`bun`||e===`npm`}async function Kt(e,t){return t!==`unknown`&&e!==t?(await Ae(t),t):e??t}function Q(e,t=n.execPath){let r=Qt(e);return r.includes(`/.bun/install/global/`)?`bun`:r.includes(Ut)?`npm`:r?`source`:$t(t)?`binary`:`unknown`}async function qt(e=import.meta.url){let t=en(e),n=p(t);for(;;){let e=m(n,`package.json`),t=await Zt(e);if(t?.name===X)return{foundPackageJson:!0,packageJsonPath:e,packageRoot:n,version:t.version??`0.13.0`};let r=p(n);if(r===n)break;n=r}return{foundPackageJson:!1,packageJsonPath:m(p(t),`package.json`),packageRoot:p(t),version:xe}}function $(){return xe}function Jt(e,t=n.execPath){return jt(e,t)}async function Yt(e,t,n,r){if(e===`binary`)try{let e=await ct(n);return{installableLatestVersion:dt(e,t)?e.version:void 0}}catch{return{}}let i=n===`beta`?`beta`:`latest`,a=await U(X,i,{registry:me});if(e===`bun`||e===`npm`){let t=await Nt(e,r);return{installableLatestVersion:await U(X,i,{registry:t?.registry}),managedRegistry:t?.registry,managedRegistryIsOverride:t?.isOverride??!1,upstreamLatestVersion:a}}return{installableLatestVersion:a,upstreamLatestVersion:a}}async function Xt(e,t){if(!t.success||e.installSource!==`bun`&&e.installSource!==`npm`)return t;let n=await Ke(e.executablePath);if(!n)return{error:{kind:`verify`,message:`Managed self-upgrade finished but Quantex could not verify the installed version afterwards.`},installSource:e.installSource,success:!1};let r=t.newVersion??e.latestVersion;return r&&n!==r?{error:{detail:{expectedVersion:r,observedVersion:n},kind:`verify`,message:`Managed self-upgrade installed version ${n}, but expected ${r}.`},installSource:e.installSource,success:!1}:!r&&n===e.currentVersion?{error:{detail:{observedVersion:n},kind:`verify`,message:`Managed self-upgrade completed without changing the installed Quantex version.`},installSource:e.installSource,success:!1}:{...t,newVersion:n}}async function Zt(e){try{return JSON.parse(await o(e,`utf8`))}catch{return}}function Qt(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function $t(e){let t=f(Qt(e));return t!==`bun`&&t!==`bun.exe`}function en(e){try{return h(e)}catch{return n.execPath}}function tn(e){return on({...e,error:null,ok:!0})}function nn(e){return on({...e,ok:!1})}function rn(e,t,n={}){let r=b();return r.cancelled&&!n.force||(r.outputMode===`json`?console.log(JSON.stringify(e,null,2)):r.outputMode===`ndjson`?cn({action:e.action,data:e,target:e.target,type:`result`}):t(e)),e}function an(e,t={}){let n=b();if(!(n.cancelled&&!t.force)&&n.outputMode===`ndjson`)return cn(e)}function on(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:$()},ok:e.ok,target:e.target,warnings:e.warnings??[]}}function sn(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:$()},target:e.target,type:e.type}}function cn(e){let t=sn(e);return console.log(JSON.stringify(t)),t}const{createColors:ln,isColorSupported:un}=re;function dn(){let e=b().colorMode??`auto`;return ln(e===`always`?!0:e===`never`?!1:un)}const fn=new Proxy({},{get(e,t){let n=dn(),r=n[t];return typeof r==`function`?r.bind(n):r}});export{oe as $,F as A,je as B,ot as C,Je as D,U as E,N as F,w as G,Ce as H,Oe as I,ve as J,_e as K,Te as L,Ee as M,ke as N,R as O,M as P,b as Q,De as R,K as S,Ke as T,D as U,A as V,C as W,S as X,ge as Y,ce as Z,Tt as _,rn as a,ht as b,Jt as c,Gt as d,x as et,jt as f,wt as g,Et as h,an as i,I as j,L as k,$ as l,Ct as m,nn as n,Z as o,Mt as p,T as q,tn as r,Q as s,fn as t,ae as tt,Wt as u,mt as v,qe as w,gt as x,_t as y,Ae as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./commands-QSNJQkwT.mjs";export{e as commandsCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,r as t,t as n}from"./color-
|
|
1
|
+
import{a as e,r as t,t as n}from"./color-P2uVwGzw.mjs";const r=[{flags:[`--json`,`--output`,`--non-interactive`,`--quiet`,`--color`,`--log-level`,`--refresh`,`--no-cache`,`--timeout`],name:`capabilities`,outputSchemaRef:`#/commands/capabilities`,stability:`stable`,summary:`Return environment and surface capabilities`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--timeout`],name:`commands`,outputSchemaRef:`#/commands/commands`,stability:`stable`,summary:`Return the stable command catalog`},{flags:[`get`,`set`,`reset`,`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--timeout`],name:`config`,outputSchemaRef:`#/commands/config`,stability:`stable`,summary:`Read and modify Quantex configuration`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--refresh`,`--no-cache`,`--timeout`],name:`doctor`,outputSchemaRef:`#/commands/doctor`,stability:`stable`,summary:`Diagnose the current environment and installed tools`},{flags:[`--install`,`--non-interactive`,`--yes`,`--quiet`,`--color`,`--log-level`,`--dry-run`,`--output`],name:`exec`,outputSchemaRef:`#/commands/exec`,stability:`stable`,summary:`Run an agent with explicit install policy`},{flags:[`--json`,`--output`,`--yes`,`--quiet`,`--color`,`--log-level`,`--dry-run`,`--timeout`,`--idempotency-key`],name:`ensure`,outputSchemaRef:`#/commands/ensure`,stability:`stable`,summary:`Ensure an agent is installed`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--refresh`,`--no-cache`,`--timeout`],name:`info`,outputSchemaRef:`#/commands/info`,stability:`stable`,summary:`Show human-friendly agent details`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--refresh`,`--no-cache`,`--timeout`],name:`inspect`,outputSchemaRef:`#/commands/inspect`,stability:`stable`,summary:`Return structured agent state`},{flags:[`--json`,`--output`,`--yes`,`--quiet`,`--color`,`--log-level`,`--dry-run`,`--timeout`,`--idempotency-key`],name:`install`,outputSchemaRef:`#/commands/install`,stability:`stable`,summary:`Install an agent`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--refresh`,`--no-cache`,`--timeout`],name:`list`,outputSchemaRef:`#/commands/list`,stability:`stable`,summary:`List supported agents`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--refresh`,`--no-cache`,`--timeout`],name:`resolve`,outputSchemaRef:`#/commands/resolve`,stability:`stable`,summary:`Resolve an agent executable entrypoint`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--timeout`],name:`schema`,outputSchemaRef:`#/commands/schema`,stability:`stable`,summary:`Return structured output schemas`},{flags:[`--all`,`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--dry-run`,`--refresh`,`--no-cache`,`--timeout`,`--idempotency-key`],name:`update`,outputSchemaRef:`#/commands/update`,stability:`stable`,summary:`Update one or all agents`},{flags:[`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--dry-run`,`--timeout`,`--idempotency-key`],name:`uninstall`,outputSchemaRef:`#/commands/uninstall`,stability:`stable`,summary:`Uninstall an agent`},{flags:[`--check`,`--channel`,`--json`,`--output`,`--quiet`,`--color`,`--log-level`,`--dry-run`,`--refresh`,`--no-cache`,`--timeout`,`--idempotency-key`],name:`upgrade`,outputSchemaRef:`#/commands/upgrade`,stability:`stable`,summary:`Upgrade Quantex CLI itself`}];async function i(){return e(t({action:`commands`,data:{commands:r},target:{kind:`system`,name:`commands`}}),a)}function a(e){if(e.data){console.log(n.bold(`
|
|
2
2
|
Quantex Commands
|
|
3
3
|
`));for(let t of e.data.commands){let e=t.flags.length>0?n.dim(` [${t.flags.join(`, `)}]`):``;console.log(` ${n.cyan(t.name)}${e}`),console.log(` ${t.summary}`),console.log(` ${n.dim(t.outputSchemaRef)}`)}console.log()}}export{i as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as e,K as t,X as n,Y as r,a as i,n as a,q as o,r as s,t as c}from"./color-P2uVwGzw.mjs";async function l(c,l,d){if(!c)return i(s({action:`config`,data:{action:`list`,config:await o()},target:{kind:`config`}}),u);switch(c){case`get`:{if(!l)return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`Please specify a key`},target:{kind:`config`}}),u);let e=(await o())[l];return i(s({action:`config`,data:{action:`get`,key:l,value:typeof e==`number`||typeof e==`string`?e:void 0},target:{kind:`config`,name:l}}),u)}case`set`:{if(!l||d===void 0)return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`Please specify both key and value`},target:{kind:`config`}}),u);if(l===`defaultPackageManager`&&d!==`bun`&&d!==`npm`)return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`defaultPackageManager must be bun or npm`},target:{kind:`config`,name:l}}),u);if(l===`npmBunUpdateStrategy`&&!t(d))return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`npmBunUpdateStrategy must be latest-major or respect-semver`},target:{kind:`config`,name:l}}),u);if(l===`selfUpdateChannel`&&d!==`stable`&&d!==`beta`)return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`selfUpdateChannel must be stable or beta`},target:{kind:`config`,name:l}}),u);if(l===`selfUpdateRegistry`&&!n(d))return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`selfUpdateRegistry must be a valid absolute URL`},target:{kind:`config`,name:l}}),u);if([`networkRetries`,`networkTimeoutMs`,`versionCacheTtlHours`].includes(l)){let e=Number.parseInt(d,10);if(!Number.isInteger(e)||e<=0)return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,message:`${l} must be a positive integer`},target:{kind:`config`,name:l}}),u);d=`${e}`}let r={};try{r=await o()}catch{}return r[l]=[`networkRetries`,`networkTimeoutMs`,`versionCacheTtlHours`].includes(l)?Number.parseInt(d,10):l===`selfUpdateRegistry`?n(d):d,await e(r),i(s({action:`config`,data:{action:`set`,key:l,value:r[l]},target:{kind:`config`,name:l}}),u)}case`reset`:return await e(r),i(s({action:`config`,data:{action:`reset`,config:r},target:{kind:`config`}}),u);default:return i(a({action:`config`,error:{code:`INVALID_ARGUMENT`,details:{action:c},message:`Unknown action: ${c}`},target:{kind:`config`},warnings:[{code:`AVAILABLE_ACTIONS`,message:`Available actions: get, set, reset`}]}),u)}}function u(e){if(e.error){console.log(c.red(e.error.message));for(let t of e.warnings)console.log(t.message);return}if(e.data)switch(e.data.action){case`list`:console.log(c.bold(`
|
|
2
2
|
Current Configuration:
|
|
3
3
|
`)),console.log(JSON.stringify(e.data.config,null,2)),console.log();break;case`get`:console.log(e.data.value===void 0?c.gray(`(not set)`):String(e.data.value));break;case`set`:console.log(c.green(`Set ${e.data.key} = ${e.data.value}`));break;case`reset`:console.log(c.green(`Configuration reset to defaults.`));break}}export{l as configCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,k as t}from"./color-P2uVwGzw.mjs";import n from"node:process";function r(e){return{packageName:e,type:`bun`}}function i(e){return{packageName:e,type:`npm`}}function a(e,t){return{packageName:e,packageTargetKind:t,type:`brew`}}function o(e){return{packageName:e,packageTargetKind:`id`,type:`winget`}}function s(e){return{command:e,type:`script`}}function c(e){return{command:e,type:`binary`}}const l={name:`amp`,displayName:`Amp`,homepage:`https://ampcode.com/`,packages:{npm:`@sourcegraph/amp`},binaryName:`amp`,selfUpdate:{command:[`amp`,`update`]},versionProbe:{command:[`amp`,`version`]},platforms:{windows:[r(),i()],macos:[r(),i()],linux:[r(),i()]}},u={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:[r(),i()],linux:[r(),i()]}},d={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:[s(`iwr -useb https://autohand.ai/install.ps1 | iex`)],macos:[s(`curl -fsSL https://autohand.ai/install.sh | bash`)],linux:[s(`curl -fsSL https://autohand.ai/install.sh | bash`)]}},f={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:[r(),i(),s(`irm https://claude.ai/install.ps1 | iex`),o(`Anthropic.ClaudeCode`)],macos:[r(),i(),s(`curl -fsSL https://claude.ai/install.sh | bash`),a(`claude-code`,`cask`)],linux:[r(),i(),s(`curl -fsSL https://claude.ai/install.sh | bash`),a(`claude-code`,`cask`)]}},p={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:[r(),i(),s(`irm https://www.codebuddy.cn/cli/install.ps1 | iex`)],macos:[r(),i(),s(`curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash`),a(`Tencent-CodeBuddy/tap/codebuddy-code`)],linux:[r(),i(),s(`curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash`),a(`Tencent-CodeBuddy/tap/codebuddy-code`)]}},m={name:`codex`,displayName:`Codex CLI`,homepage:`https://developers.openai.com/codex/cli`,packages:{npm:`@openai/codex`},binaryName:`codex`,selfUpdate:{command:[`codex`,`--upgrade`]},platforms:{windows:[r(),i()],macos:[r(),i(),a(`codex`)],linux:[r(),i(),a(`codex`)]}},h={name:`copilot`,displayName:`GitHub Copilot CLI`,homepage:`https://github.com/features/copilot/cli`,packages:{npm:`@github/copilot`},binaryName:`copilot`,platforms:{windows:[o(`GitHub.Copilot`)],macos:[r(),i(),s(`curl -fsSL https://gh.io/copilot-install | bash`),a(`copilot-cli`)],linux:[r(),i(),s(`curl -fsSL https://gh.io/copilot-install | bash`),a(`copilot-cli`)]}},g={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:[r(),i(),o(`charmbracelet.crush`)],macos:[r(),i(),a(`charmbracelet/tap/crush`)],linux:[r(),i(),a(`charmbracelet/tap/crush`)]}},_={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:[s(`irm 'https://cursor.com/install?win32=true' | iex`)],macos:[s(`curl https://cursor.com/install -fsS | bash`)],linux:[s(`curl https://cursor.com/install -fsS | bash`)]}},v={name:`devin`,displayName:`Devin for Terminal`,homepage:`https://cli.devin.ai/`,binaryName:`devin`,selfUpdate:{command:[`devin`,`update`]},versionProbe:{command:[`devin`,`version`]},platforms:{windows:[s(`irm https://static.devin.ai/cli/setup.ps1 | iex`)],macos:[s(`curl -fsSL https://cli.devin.ai/install.sh | bash`)],linux:[s(`curl -fsSL https://cli.devin.ai/install.sh | bash`)]}},y={name:`droid`,displayName:`Droid`,homepage:`https://docs.factory.ai/cli/getting-started/overview`,packages:{npm:`droid`},binaryName:`droid`,selfUpdate:{command:[`droid`,`update`]},platforms:{windows:[r(),i(),s(`irm https://app.factory.ai/cli/windows | iex`)],macos:[r(),i(),s(`curl -fsSL https://app.factory.ai/cli | sh`),a(`droid`,`cask`)],linux:[r(),i(),s(`curl -fsSL https://app.factory.ai/cli | sh`),a(`droid`,`cask`)]}},b={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:[r(),i(),s(`irm https://forgecode.dev/cli | iex`)],macos:[r(),i(),s(`curl -fsSL https://forgecode.dev/cli | sh`)],linux:[r(),i(),s(`curl -fsSL https://forgecode.dev/cli | sh`)]}},x={name:`gemini`,displayName:`Gemini CLI`,homepage:`https://google-gemini.github.io/gemini-cli/docs/`,packages:{npm:`@google/gemini-cli`},binaryName:`gemini`,platforms:{windows:[r(),i()],macos:[r(),i(),a(`gemini-cli`)],linux:[r(),i(),a(`gemini-cli`)]}},S={name:`goose`,displayName:`Goose`,homepage:`https://github.com/aaif-goose/goose`,binaryName:`goose`,selfUpdate:{command:[`goose`,`update`]},versionProbe:{command:[`goose`,`--version`]},platforms:{windows:[s(`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`),s(`Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aaif-goose/goose/main/download_cli.ps1" -OutFile "download_cli.ps1"; ./download_cli.ps1`)],macos:[s(`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`),a(`block-goose-cli`)],linux:[s(`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`),a(`block-goose-cli`)]}},C={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:[r(),i(),s(`iex (irm 'https://junie.jetbrains.com/install.ps1')`)],macos:[r(),i(),s(`curl -fsSL https://junie.jetbrains.com/install.sh | bash`),a(`jetbrains-junie/junie/junie`)],linux:[r(),i(),s(`curl -fsSL https://junie.jetbrains.com/install.sh | bash`),a(`jetbrains-junie/junie/junie`)]}},w={name:`kilo`,displayName:`Kilo CLI`,homepage:`https://kilo.ai/docs/cli`,packages:{npm:`@kilocode/cli`},binaryName:`kilo`,selfUpdate:{command:[`kilo`,`upgrade`]},platforms:{windows:[r(),i()],macos:[r(),i()],linux:[r(),i()]}},T={name:`kimi`,lookupAliases:[`kimi-code`,`kimi-cli`],displayName:`Kimi Code`,homepage:`https://moonshotai.github.io/kimi-cli/`,binaryName:`kimi`,selfUpdate:{command:[`uv`,`tool`,`upgrade`,`kimi-cli`,`--no-cache`]},versionProbe:{command:[`kimi`,`--version`]},platforms:{windows:[s(`irm https://code.kimi.com/install.ps1 | iex`)],macos:[s(`curl -LsSf https://code.kimi.com/install.sh | bash`)],linux:[s(`curl -LsSf https://code.kimi.com/install.sh | bash`)]}},E={name:`kiro`,lookupAliases:[`kiro-cli`],displayName:`Kiro CLI`,homepage:`https://kiro.dev/cli/`,binaryName:`kiro-cli`,versionProbe:{command:[`kiro-cli`,`--version`]},platforms:{windows:[s(`irm 'https://cli.kiro.dev/install.ps1' | iex`)],macos:[s(`curl -fsSL https://cli.kiro.dev/install | bash`)],linux:[s(`curl -fsSL https://cli.kiro.dev/install | bash`)]}},D={name:`opencode`,displayName:`OpenCode`,homepage:`https://opencode.ai`,packages:{npm:`opencode-ai`},binaryName:`opencode`,selfUpdate:{command:[`opencode`,`upgrade`]},platforms:{windows:[r(),i()],macos:[r(),i(),s(`curl -fsSL https://opencode.ai/install | bash`),a(`anomalyco/tap/opencode`)],linux:[r(),i(),s(`curl -fsSL https://opencode.ai/install | bash`),a(`anomalyco/tap/opencode`)]}},O={name:`openhands`,displayName:`OpenHands CLI`,homepage:`https://docs.openhands.dev/openhands/usage/cli/installation`,binaryName:`openhands`,selfUpdate:{command:[`uv`,`tool`,`upgrade`,`openhands`,`--python`,`3.12`]},versionProbe:{command:[`openhands`,`--version`]},platforms:{macos:[c(`uv tool install openhands --python 3.12`),s(`curl -fsSL https://install.openhands.dev/install.sh | sh`)],linux:[c(`uv tool install openhands --python 3.12`),s(`curl -fsSL https://install.openhands.dev/install.sh | sh`)]}},k={name:`pi`,displayName:`Pi`,homepage:`https://pi.dev`,packages:{npm:`@mariozechner/pi-coding-agent`},binaryName:`pi`,selfUpdate:{command:[`pi`,`update`]},platforms:{windows:[r(),i()],macos:[r(),i()],linux:[r(),i()]}},A={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:[r(),i()],macos:[r(),i(),s(`curl -fsSL https://qoder.com/install | bash`),a(`qoderai/qoder/qodercli`,`cask`)],linux:[r(),i(),s(`curl -fsSL https://qoder.com/install | bash`),a(`qoderai/qoder/qodercli`,`cask`)]}},j={name:`qwen`,displayName:`Qwen Code`,homepage:`https://qwenlm.github.io/qwen-code-docs/`,packages:{npm:`@qwen-code/qwen-code`},binaryName:`qwen`,platforms:{windows:[s(`curl -fsSL -o %TEMP%\\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\\install-qwen.bat`),r(),i()],macos:[s(`curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash`),r(),i(),a(`qwen-code`)],linux:[s(`curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash`),r(),i(),a(`qwen-code`)]}},M={name:`vibe`,lookupAliases:[`mistral-vibe`],displayName:`Mistral Vibe`,homepage:`https://docs.mistral.ai/mistral-vibe/terminal/install`,binaryName:`vibe`,versionProbe:{command:[`vibe`,`--version`]},platforms:{windows:[c(`uv tool install mistral-vibe`),c(`pip install mistral-vibe`)],macos:[s(`curl -LsSf https://mistral.ai/vibe/install.sh | bash`),c(`uv tool install mistral-vibe`),c(`pip install mistral-vibe`)],linux:[s(`curl -LsSf https://mistral.ai/vibe/install.sh | bash`),c(`uv tool install mistral-vibe`),c(`pip install mistral-vibe`)]}},N=[u,d,l,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,O,D,k,A,j,M];function P(){return N}function F(e){return N.find(t=>t.name===e||(t.lookupAliases?.includes(e)??!1))}function I(e){return F(e)}function L(){switch(n.platform){case`win32`:return`windows`;case`darwin`:return`macos`;default:return`linux`}}async function R(n){try{let{exitCode:r}=await e(t([n,`--version`]));return r===0}catch{return!1}}async function z(){return R(`bun`)}async function B(){return R(`npm`)}async function V(){return R(`brew`)}async function H(){return R(`winget`)}async function U(r){try{let{exitCode:i}=await e(t([n.platform===`win32`?`where`:`which`,r]));return i===0}catch{return!1}}export{p as C,m as S,d as T,x as _,B as a,_ as b,I as c,A as d,k as f,C as g,w as h,z as i,P as l,D as m,U as n,H as o,O as p,V as r,F as s,L as t,M as u,y as v,f as w,h as x,v as y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,t}from"./messages-qcLhD-Gc.mjs";import{t as n}from"./agents-
|
|
1
|
+
import{n as e,t}from"./messages-qcLhD-Gc.mjs";import{t as n}from"./agents-BVcaPgcE.mjs";import{a as r,i,o as a,r as o}from"./detect-2jeRd2sI.mjs";import{U as s,a as c,p as l,r as u,t as d,u as f}from"./color-P2uVwGzw.mjs";async function p(){let s=await i(),d=await r(),p=await o(),g=await a(),_=await f(),v=_.latestVersion&&_.latestVersion!==_.currentVersion,y=await n(),b=y.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})),x=[],S=`docs/runbooks/quantex-troubleshooting.md`,C=`docs/runbooks/release-and-self-upgrade-debugging.md`;if(!s&&!d&&!p&&!g&&x.push({blocking:!0,category:`installers`,code:`NO_MANAGED_INSTALLER`,docsRef:S,message:`No managed installer found. Install bun, npm, brew, or winget before relying on managed lifecycle operations.`,severity:`warning`,subject:{kind:`system`},suggestedAction:`restore-managed-installer`,suggestedCommands:[]}),(_.installSource===`bun`&&!s||_.installSource===`npm`&&!d)&&x.push({blocking:!0,category:`self`,code:`SELF_INSTALLER_MISSING`,docsRef:C,message:`Quantex CLI is tracked as a ${_.installSource} install, but ${_.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:h(_.installSource,_.updateChannel)}),_.canAutoUpdate||x.push({blocking:!1,category:`self`,code:`SELF_AUTO_UPDATE_UNAVAILABLE`,docsRef:C,message:`Quantex CLI cannot auto-update from install source "${_.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:[]}),v&&_.recommendedUpgradeCommand){let e=l(_);x.push({blocking:!1,category:`self`,code:`SELF_UPDATE_AVAILABLE`,docsRef:C,message:e?`Quantex CLI ${_.currentVersion} is behind ${_.latestVersion}. Run ${_.recommendedUpgradeCommand} or follow: ${e}`:`Quantex CLI ${_.currentVersion} is behind ${_.latestVersion}. Run ${_.recommendedUpgradeCommand}.`,severity:`warning`,subject:{kind:`self`,name:`quantex`},suggestedAction:`run-self-upgrade`,suggestedCommands:[_.recommendedUpgradeCommand]})}for(let n of y.filter(e=>e.inPath)){if(n.installedState||x.push({blocking:!1,category:`agent`,code:`AGENT_UNTRACKED_IN_PATH`,docsRef:S,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);x.push({blocking:!1,category:`agent`,code:`AGENT_MANUAL_UPDATE_REQUIRED`,docsRef:S,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 c(u({action:`doctor`,data:{agents:b,issues:x,installers:{brew:p,bun:s,npm:d,winget:g},self:{canAutoUpdate:_.canAutoUpdate,currentVersion:_.currentVersion,installSource:_.installSource,latestVersion:_.latestVersion,outdated:!!v,recoveryHint:v?l(_):void 0}},target:{kind:`system`,name:`doctor`}}),m)}function m(e){if(e.data){if(console.log(d.bold(`
|
|
2
2
|
Quantex CLI Environment Check
|
|
3
3
|
`)),console.log(d.bold(`Managed Installers:`)),console.log(` Bun: ${e.data.installers.bun?d.green(`available`):d.red(`not found`)}`),console.log(` npm: ${e.data.installers.npm?d.green(`available`):d.red(`not found`)}`),console.log(` brew: ${e.data.installers.brew?d.green(`available`):d.red(`not found`)}`),console.log(` winget:${e.data.installers.winget?d.green(`available`):d.red(`not found`)}`),console.log(`\n${d.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?d.green(`supported`):d.yellow(`unsupported`)}`),e.data.self.latestVersion&&console.log(` Latest: ${e.data.self.latestVersion}${e.data.self.outdated?d.yellow(` (update available)`):``}`),e.data.self.recoveryHint&&console.log(` Recovery: ${e.data.self.recoveryHint}`),console.log(`\n${d.bold(`Installed Agents:`)}`),e.data.agents.length===0)console.log(d.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?d.yellow(` (update available: ${t.latestVersion})`):``}`);if(console.log(`\n${d.bold(`Issues:`)}`),e.data.issues.length===0)console.log(d.green(` No issues found.`));else for(let t of e.data.issues)console.log(d.yellow(` - ${t.message}`)),t.suggestedCommands.length>0&&console.log(d.dim(` Next: ${t.suggestedCommands.join(` | `)}`));console.log()}}function h(e,t){let n=t===`beta`?`beta`:`latest`;return e===`bun`?[`bun add -g ${s}@${n}`]:e===`npm`?[`npm install -g ${s}@${n}`]:[]}export{p as doctorCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as t,r as n,s as r}from"./agents-
|
|
1
|
+
import{b as e,c as t,r as n,s as r}from"./agents-BVcaPgcE.mjs";import{V as i,a,i as o,n as s,r as c,t as l}from"./color-P2uVwGzw.mjs";import{t as u}from"./lifecycle-errors-D7JpbOsK.mjs";import{a as d,i as f,n as p,r as m}from"./user-output-Dm9t9jPa.mjs";async function h(l){let d=await n(l);if(!d)return a(s({action:`ensure`,error:{code:`AGENT_NOT_FOUND`,details:{input:l},message:`Unknown agent: ${l}`},target:{kind:`agent`,name:l}}),g);let{agent:f,inspection:m}=d;if(m.inPath){if(m.installedState)return a(c({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`ALREADY_INSTALLED`,message:`${f.displayName} is already installed.`}]}),g);let n=e(m.methods,m.resolvedBinaryPath??m.binaryPath);if(n){if(p())return a(c({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`DRY_RUN`,message:`Dry run: would record the existing ${f.displayName} install in Quantex state.`}]}),g);o({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name}},target:{kind:`agent`,name:f.name},type:`started`});try{let e=await t(f,n);return a(c({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!0,installState:{installType:e.installType,packageName:e.packageName},installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`TRACKED_EXISTING_INSTALL`,message:`${f.displayName} is already installed. Quantex is now tracking the existing install.`}]}),g)}catch(e){if(i(e))return a(s({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},...u(e,{kind:`agent`,name:f.name})}),g);throw e}}return a(c({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`UNTRACKED_EXISTING_INSTALL`,message:`${f.displayName} is already installed but not tracked by Quantex. Quantex could not safely determine the supported install source, so the existing install remains unmanaged.`}]}),g)}if(p())return a(c({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!1},target:{kind:`agent`,name:f.name},warnings:[{code:`DRY_RUN`,message:`Dry run: would install ${f.displayName}.`}]}),g);o({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name}},target:{kind:`agent`,name:f.name},type:`started`});let h;try{h=await r(f)}catch(e){if(i(e))return a(s({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!1},...u(e,{kind:`agent`,name:f.name})}),g);throw e}return h.success?a(c({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!0,installState:h.installedState?{installType:h.installedState.installType,packageName:h.installedState.packageName}:void 0,installed:!0},target:{kind:`agent`,name:f.name}}),g):a(s({action:`ensure`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!1},error:{code:`INSTALL_FAILED`,message:`Failed to install ${f.displayName}.`},target:{kind:`agent`,name:f.name}}),g)}function g(e){if(e.error){m(l.red(e.error.message));return}if(e.data){if(e.warnings.length>0){for(let t of e.warnings){if(t.code===`TRACKED_EXISTING_INSTALL`){f(l.green(t.message));continue}if(t.code===`DRY_RUN`){d(l.cyan(t.message));continue}d(l.yellow(t.message))}return}if(e.data.changed){f(l.cyan(`Installing ${e.data.agent.displayName}...`)),f(l.green(`${e.data.agent.displayName} is now installed.`));return}f(l.green(`${e.data.agent.displayName} is already installed.`))}}export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ensure-BR_DwDzl.mjs";export{e as ensureCommand};
|
package/dist/index.d.mts
CHANGED
|
@@ -137,6 +137,8 @@ interface InstalledAgentState {
|
|
|
137
137
|
}
|
|
138
138
|
interface SelfState {
|
|
139
139
|
installSource?: SelfInstallSource;
|
|
140
|
+
updateNoticeAt?: string;
|
|
141
|
+
updateNoticeVersion?: string;
|
|
140
142
|
}
|
|
141
143
|
interface QuantexState {
|
|
142
144
|
installedAgents: Record<string, InstalledAgentState>;
|
|
@@ -150,6 +152,7 @@ declare function setInstalledAgentState(agentState: InstalledAgentState): Promis
|
|
|
150
152
|
declare function removeInstalledAgentState(agentName: string): Promise<void>;
|
|
151
153
|
declare function getSelfState(): Promise<SelfState>;
|
|
152
154
|
declare function setSelfInstallSource(installSource: SelfInstallSource): Promise<void>;
|
|
155
|
+
declare function setSelfUpdateNoticeState(updateNoticeVersion: string, updateNoticeAt: string): Promise<void>;
|
|
153
156
|
//#endregion
|
|
154
157
|
//#region src/agent-update/types.d.ts
|
|
155
158
|
type AgentUpdateStrategy = 'managed' | 'manual-hint' | 'self-update';
|
|
@@ -655,4 +658,4 @@ declare function getLatestVersion(packageName: string, distTag?: string, options
|
|
|
655
658
|
}): Promise<string | undefined>;
|
|
656
659
|
declare function getBinaryPath(binaryName: string): Promise<string | undefined>;
|
|
657
660
|
//#endregion
|
|
658
|
-
export { type AgentDefinition, type AgentInspection, type AgentOperationResult, type AgentPackageMetadata, type AgentSelfUpdate, type AgentUpdateContext, type AgentUpdateProvider, type AgentUpdateStrategy, type AgentVersionProbe, type BinaryInstallMethod, type CliContext, type CliContextOptions, type CliErrorCode, type CommandError, type CommandMeta, type CommandResult, type CommandTarget, type CommandWarning, type ExecCommandOptions, type ExecInstallPolicy, type HumanRenderer, type InstallMethod, type InstallType, type InstalledAgentState, type ManagedInstallMethod, type ManagedInstallType, type ManagedInstaller, type ManagedPackageSpec, type ManagedUpdateBucket, type OutputMode, type PackageTargetKind, type PendingAgentUpdate, type PlannedAgentUpdates, type Platform, type QuantexConfig, type QuantexState, type ReleaseArtifactTarget, type ReleaseChannel, type ReleaseManifest, type ReleaseManifestAsset, type ResolvedAgentInspection, type ScriptInstallMethod, type SelfInspection, type SelfInstallSource, type SelfState, type SelfUpdateResult, type SingleAgentUpdateStatus, type UpdatePlan, type UpdatePlanEntry, agentUpdateProviders, autohand, canAutoUpdateSelf, canLookupLatestVersionForInstallType, canResolveAgentUpdate, canUninstallInstallType, canUpdateInstallType, capabilitiesCommand, claude, codebuddy, codex, commandsCommand, copilot, createErrorResult, createReleaseManifest, createSuccessResult, createUpdatePlan, cursor, detectSelfInstallSource, devin, droid, emitCommandResult, ensureCommand, execCommand, formatChecksums, gemini, getAgentByLookupName, getAgentByNameOrAlias, getAgentUpdateFailureHint, getAgentUpdateStrategy, getAllAgents, getBinaryPath, getBinaryReleaseAssetName, getBinaryReleaseDownloadUrl, getCliContext, getConfigDir, getConfigFilePath, getExitCodeForError, getExitCodeForResult, getInstallLifecycle, getInstalledAgentState, getInstalledVersion, getInstallerCapabilities, getLatestVersion, getManagedInstaller, getManualAgentUpdateMessage, getManualSelfUpgradeCommand, getOrderedInstallMethods, getPlatform, getSchemaCatalog, getSelfState, getSelfUpgradeRecoveryHint, getSelfUpgradeRecoveryHintForInspection, getSelfVersion, getSingleAgentUpdateStatus, getStateFilePath, inspectAgent, inspectAllAgents, inspectCommand, inspectRegisteredAgents, inspectSelf, installAgent, isBinaryInPath, isBunAvailable, isInspectionUpdateAvailable, isManagedInstallType, isNpmAvailable, junie, kilo, loadConfig, loadState, normalizeRepositoryUrl, opencode, openhands, parseBinaryTarget, parseChecksums, pi, planAgentUpdates, qoder, removeInstalledAgentState, resetCliContext, resolveAgent, resolveAgentInspection, resolveAgentUpdateProvider, resolveCliContext, resolveCommand, resolveReleaseChannel, saveConfig, saveState, schemaCommand, setCliContext, setInstalledAgentState, setSelfInstallSource, uninstallAgent, updateAgent, updateAgentsByType, upgradeSelf, validateReleaseManifest, vibe };
|
|
661
|
+
export { type AgentDefinition, type AgentInspection, type AgentOperationResult, type AgentPackageMetadata, type AgentSelfUpdate, type AgentUpdateContext, type AgentUpdateProvider, type AgentUpdateStrategy, type AgentVersionProbe, type BinaryInstallMethod, type CliContext, type CliContextOptions, type CliErrorCode, type CommandError, type CommandMeta, type CommandResult, type CommandTarget, type CommandWarning, type ExecCommandOptions, type ExecInstallPolicy, type HumanRenderer, type InstallMethod, type InstallType, type InstalledAgentState, type ManagedInstallMethod, type ManagedInstallType, type ManagedInstaller, type ManagedPackageSpec, type ManagedUpdateBucket, type OutputMode, type PackageTargetKind, type PendingAgentUpdate, type PlannedAgentUpdates, type Platform, type QuantexConfig, type QuantexState, type ReleaseArtifactTarget, type ReleaseChannel, type ReleaseManifest, type ReleaseManifestAsset, type ResolvedAgentInspection, type ScriptInstallMethod, type SelfInspection, type SelfInstallSource, type SelfState, type SelfUpdateResult, type SingleAgentUpdateStatus, type UpdatePlan, type UpdatePlanEntry, agentUpdateProviders, autohand, canAutoUpdateSelf, canLookupLatestVersionForInstallType, canResolveAgentUpdate, canUninstallInstallType, canUpdateInstallType, capabilitiesCommand, claude, codebuddy, codex, commandsCommand, copilot, createErrorResult, createReleaseManifest, createSuccessResult, createUpdatePlan, cursor, detectSelfInstallSource, devin, droid, emitCommandResult, ensureCommand, execCommand, formatChecksums, gemini, getAgentByLookupName, getAgentByNameOrAlias, getAgentUpdateFailureHint, getAgentUpdateStrategy, getAllAgents, getBinaryPath, getBinaryReleaseAssetName, getBinaryReleaseDownloadUrl, getCliContext, getConfigDir, getConfigFilePath, getExitCodeForError, getExitCodeForResult, getInstallLifecycle, getInstalledAgentState, getInstalledVersion, getInstallerCapabilities, getLatestVersion, getManagedInstaller, getManualAgentUpdateMessage, getManualSelfUpgradeCommand, getOrderedInstallMethods, getPlatform, getSchemaCatalog, getSelfState, getSelfUpgradeRecoveryHint, getSelfUpgradeRecoveryHintForInspection, getSelfVersion, getSingleAgentUpdateStatus, getStateFilePath, inspectAgent, inspectAllAgents, inspectCommand, inspectRegisteredAgents, inspectSelf, installAgent, isBinaryInPath, isBunAvailable, isInspectionUpdateAvailable, isManagedInstallType, isNpmAvailable, junie, kilo, loadConfig, loadState, normalizeRepositoryUrl, opencode, openhands, parseBinaryTarget, parseChecksums, pi, planAgentUpdates, qoder, removeInstalledAgentState, resetCliContext, resolveAgent, resolveAgentInspection, resolveAgentUpdateProvider, resolveCliContext, resolveCommand, resolveReleaseChannel, saveConfig, saveState, schemaCommand, setCliContext, setInstalledAgentState, setSelfInstallSource, setSelfUpdateNoticeState, uninstallAgent, updateAgent, updateAgentsByType, upgradeSelf, validateReleaseManifest, vibe };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,t}from"./messages-qcLhD-Gc.mjs";import{C as n,D as r,E as i,S as a,T as ee,a as te,d as ne,f as re,g as ie,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,w as _}from"./agents-
|
|
2
|
-
`)}\n`}function
|
|
1
|
+
import{n as e,t}from"./messages-qcLhD-Gc.mjs";import{C as n,D as r,E as i,S as a,T as ee,a as te,d as ne,f as re,g as ie,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,w as _}from"./agents-BVcaPgcE.mjs";import{C as v,S as y,T as b,_ as x,a as S,b as C,c as w,d as T,f as E,g as D,h as O,i as k,l as A,m as j,n as M,p as N,s as P,t as F,u as I,v as L,w as R,x as z,y as B}from"./detect-2jeRd2sI.mjs";import{$ as V,A as H,B as U,C as W,E as G,F as K,G as q,I as J,J as Y,L as ae,M as oe,N as se,P as ce,Q as le,R as ue,S as de,T as fe,W as pe,a as me,c as he,d as ge,et as _e,f as ve,j as ye,l as be,n as xe,o as Se,p as Ce,q as we,r as Te,s as Ee,tt as De,u as Oe,w as ke,z as Ae}from"./color-P2uVwGzw.mjs";import{t as je}from"./capabilities-BcirrDgv.mjs";import{t as Me}from"./commands-QSNJQkwT.mjs";import{t as Ne}from"./ensure-BR_DwDzl.mjs";import{t as Pe}from"./inspect-CuJd8vNZ.mjs";import{t as Fe}from"./resolve-B9HkxPmw.mjs";import{n as Ie,t as Le}from"./schema-cVptJ-GO.mjs";import{n as X,t as Re}from"./errors-DCtNasuC.mjs";import{a as ze,i as Be,n as Ve,t as He}from"./update-CXSiym15.mjs";const Ue=[`quantex-darwin-arm64`,`quantex-darwin-x64`,`quantex-linux-arm64`,`quantex-linux-x64`,`quantex-windows-x64.exe`];function We(e){return`${e.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>`${e.checksum} ${e.name}`).join(`
|
|
2
|
+
`)}\n`}function Ge(e){let t=new Map;for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e)continue;let[r,i]=e.split(/\s+/,2),a=i?.replace(/^\*/,``);r&&a&&t.set(a,r)}return t}function Z(e){let t=e.match(/^quantex-(darwin|linux|windows)-(arm64|x64)(?:\.exe)?$/);if(t)return{arch:t[2]===`arm64`?`arm64`:`x64`,platform:t[1]===`windows`?`win32`:t[1]===`darwin`?`darwin`:`linux`}}function Q(e){return e?e.startsWith(`git+`)?e.slice(4).replace(/\.git$/,``):e.startsWith(`git@github.com:`)?e.replace(`git@github.com:`,`https://github.com/`).replace(/\.git$/,``):e.replace(/\.git$/,``):`https://github.com/Drswith/quantex-cli`}function $(e){return e.includes(`beta`)?`beta`:`stable`}function Ke(e){let t=Q(e.repositoryUrl),n=$(e.version),r=e.files.map(n=>{let r=Z(n.name);if(!r)return;let i=e.checksums.get(n.name);if(!i)throw Error(`Missing checksum entry for ${n.name}.`);return{arch:r.arch,checksum:i,downloadUrl:`${t}/releases/download/v${e.version}/${n.name}`,name:n.name,platform:r.platform,size:n.size}}).filter(e=>e!==void 0).sort((e,t)=>e.name.localeCompare(t.name));if(r.length===0)throw Error(`No release binaries were found when creating manifest.json.`);return{assets:r,channel:n,version:e.version}}function qe(e,t){if(e.assets.length===0)throw Error(`manifest.json must contain at least one binary asset.`);let n=new Set(e.assets.map(e=>e.name));for(let e of Ue)if(!n.has(e))throw Error(`manifest.json is missing required release asset: ${e}.`);for(let n of e.assets){let e=t.get(n.name);if(!e)throw Error(`manifest.json references ${n.name}, but it is missing from SHA256SUMS.txt.`);if(n.checksum!==e)throw Error(`manifest.json checksum mismatch for ${n.name}.`);if(!Z(n.name))throw Error(`manifest.json contains an invalid binary asset name: ${n.name}.`)}}async function Je(e,t){try{let n=await ye(H([e,...t]));return{success:n===0,exitCode:n}}catch{return{success:!1,exitCode:1}}}export{f as agentUpdateProviders,b as autohand,Se as canAutoUpdateSelf,a as canLookupLatestVersionForInstallType,l as canResolveAgentUpdate,n as canUninstallInstallType,_ as canUpdateInstallType,je as capabilitiesCommand,R as claude,v as codebuddy,y as codex,Me as commandsCommand,z as copilot,xe as createErrorResult,Ke as createReleaseManifest,Te as createSuccessResult,Be as createUpdatePlan,C as cursor,Ee as detectSelfInstallSource,B as devin,L as droid,me as emitCommandResult,Ne as ensureCommand,Je as execCommand,We as formatChecksums,x as gemini,P as getAgentByLookupName,w as getAgentByNameOrAlias,t as getAgentUpdateFailureHint,o as getAgentUpdateStrategy,A as getAllAgents,ke as getBinaryPath,de as getBinaryReleaseAssetName,W as getBinaryReleaseDownloadUrl,le as getCliContext,pe as getConfigDir,q as getConfigFilePath,Re as getExitCodeForError,X as getExitCodeForResult,ee as getInstallLifecycle,oe as getInstalledAgentState,fe as getInstalledVersion,i as getInstallerCapabilities,G as getLatestVersion,re as getManagedInstaller,e as getManualAgentUpdateMessage,he as getManualSelfUpgradeCommand,d as getOrderedInstallMethods,F as getPlatform,Le as getSchemaCatalog,se as getSelfState,ve as getSelfUpgradeRecoveryHint,Ce as getSelfUpgradeRecoveryHintForInspection,be as getSelfVersion,He as getSingleAgentUpdateStatus,ce as getStateFilePath,s as inspectAgent,te as inspectAllAgents,Pe as inspectCommand,h as inspectRegisteredAgents,Oe as inspectSelf,m as installAgent,M as isBinaryInPath,k as isBunAvailable,ze as isInspectionUpdateAvailable,r as isManagedInstallType,S as isNpmAvailable,D as junie,O as kilo,we as loadConfig,K as loadState,Q as normalizeRepositoryUrl,j as opencode,N as openhands,Z as parseBinaryTarget,Ge as parseChecksums,E as pi,Ve as planAgentUpdates,T as qoder,J as removeInstalledAgentState,V as resetCliContext,u as resolveAgent,p as resolveAgentInspection,ie as resolveAgentUpdateProvider,_e as resolveCliContext,Fe as resolveCommand,$ as resolveReleaseChannel,Y as saveConfig,ae as saveState,Ie as schemaCommand,De as setCliContext,ue as setInstalledAgentState,Ae as setSelfInstallSource,U as setSelfUpdateNoticeState,c as uninstallAgent,g as updateAgent,ne as updateAgentsByType,ge as upgradeSelf,qe as validateReleaseManifest,I as vibe};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,v as t,y as n}from"./agents-
|
|
1
|
+
import{r as e,v as t,y as n}from"./agents-BVcaPgcE.mjs";import{a as r,n as i,r as a,t as o}from"./color-P2uVwGzw.mjs";async function s(o){let s=await e(o);if(!s)return r(i({action:`info`,error:{code:`AGENT_NOT_FOUND`,details:{input:o},message:`Unknown agent: ${o}`},target:{kind:`agent`,name:o}}),c);let{agent:l,inspection:u}=s,d=l.selfUpdate?[l.selfUpdate.command,...l.selfUpdate.fallbackCommands??[]].map(e=>e.join(` `)):[];return r(a({action:`info`,data:{agent:{aliases:l.lookupAliases??[],binaryName:l.binaryName,displayName:l.displayName,installMethods:u.methods.map(e=>({command:t(l,e),label:n(e),type:e.type})),name:l.name,packageName:l.packages?.npm,selfUpdateCommands:d},inspection:{binaryPath:u.binaryPath,installed:u.inPath,installedVersion:u.installedVersion,latestVersion:u.latestVersion,lifecycle:u.lifecycle,sourceLabel:u.inPath?u.sourceLabel:void 0}},target:{kind:`agent`,name:l.name}}),c)}function c(e){if(e.error){console.log(o.red(e.error.message));return}if(e.data){console.log(o.bold(`\n${e.data.agent.displayName}\n`)),console.log(` Name: ${e.data.agent.name}`),console.log(` Aliases: ${e.data.agent.aliases.join(`, `)||`-`}`),console.log(` Package: ${e.data.agent.packageName??`-`}`),console.log(` Binary: ${e.data.agent.binaryName}`),console.log(` Update: ${e.data.agent.selfUpdateCommands.join(` || `)||`-`}`),console.log(` Installed: ${e.data.inspection.installed?o.green(`Yes`):o.red(`No`)}`),e.data.inspection.sourceLabel&&console.log(` Source: ${e.data.inspection.sourceLabel}`),e.data.inspection.installed&&console.log(` Lifecycle: ${e.data.inspection.lifecycle}`),e.data.inspection.installedVersion&&console.log(` Version: ${e.data.inspection.installedVersion}`),e.data.inspection.latestVersion&&console.log(` Latest: ${e.data.inspection.latestVersion}`),e.data.inspection.binaryPath&&console.log(` Path: ${e.data.inspection.binaryPath}`),console.log(o.bold(`
|
|
2
2
|
Install Methods:`));for(let t of e.data.agent.installMethods)console.log(` ${o.green(`+`)} [${t.label}] ${t.command}`);console.log()}}export{s as infoCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./inspect-CuJd8vNZ.mjs";export{e as inspectCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e,v as t,y as n}from"./agents-
|
|
1
|
+
import{r as e,v as t,y as n}from"./agents-BVcaPgcE.mjs";import{a as r,n as i,r as a,t as o}from"./color-P2uVwGzw.mjs";async function s(o){let s=await e(o);if(!s)return r(i({action:`inspect`,error:{code:`AGENT_NOT_FOUND`,details:{input:o},message:`Unknown agent: ${o}`},target:{kind:`agent`,name:o}}),c);let{agent:l,inspection:u}=s,d=l.selfUpdate?[l.selfUpdate.command,...l.selfUpdate.fallbackCommands??[]].map(e=>e.join(` `)):[];return r(a({action:`inspect`,data:{agent:{aliases:l.lookupAliases??[],binaryName:l.binaryName,displayName:l.displayName,installMethods:u.methods.map(e=>({command:t(l,e),label:n(e),type:e.type})),name:l.name,packageName:l.packages?.npm,selfUpdateCommands:d},capabilities:{canAutoInstall:u.methods.length>0,canAutoUninstall:u.inPath&&u.lifecycle===`managed`,canRun:u.inPath,canSelfUpdate:d.length>0},inspection:{binaryPath:u.binaryPath,installed:u.inPath,installedVersion:u.installedVersion,latestVersion:u.latestVersion,lifecycle:u.lifecycle,sourceLabel:u.inPath?u.sourceLabel:void 0,updateLabel:u.updateLabel}},target:{kind:`agent`,name:l.name}}),c)}function c(e){if(e.error){console.log(o.red(e.error.message));return}if(e.data){console.log(o.bold(`\n${e.data.agent.displayName}\n`)),console.log(` Name: ${e.data.agent.name}`),console.log(` Aliases: ${e.data.agent.aliases.join(`, `)||`-`}`),console.log(` Package: ${e.data.agent.packageName??`-`}`),console.log(` Binary: ${e.data.agent.binaryName}`),console.log(` Installed: ${e.data.inspection.installed?o.green(`Yes`):o.red(`No`)}`),console.log(` Update Mode: ${e.data.inspection.updateLabel}`),console.log(` Self Update: ${e.data.agent.selfUpdateCommands.join(` || `)||`-`}`),e.data.inspection.sourceLabel&&console.log(` Source: ${e.data.inspection.sourceLabel}`),e.data.inspection.installedVersion&&console.log(` Version: ${e.data.inspection.installedVersion}`),e.data.inspection.latestVersion&&console.log(` Latest: ${e.data.inspection.latestVersion}`),e.data.inspection.binaryPath&&console.log(` Path: ${e.data.inspection.binaryPath}`),console.log(o.bold(`
|
|
2
2
|
Capabilities:`)),console.log(` auto-install: ${e.data.capabilities.canAutoInstall?`yes`:`no`}`),console.log(` self-update: ${e.data.capabilities.canSelfUpdate?`yes`:`no`}`),console.log(` auto-uninstall: ${e.data.capabilities.canAutoUninstall?`yes`:`no`}`),console.log(` runnable: ${e.data.capabilities.canRun?`yes`:`no`}`),console.log(o.bold(`
|
|
3
3
|
Install Methods:`));for(let t of e.data.agent.installMethods)console.log(` ${o.green(`+`)} [${t.label}] ${t.command}`);console.log()}}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as t,r as n,s as r}from"./agents-
|
|
1
|
+
import{b as e,c as t,r as n,s as r}from"./agents-BVcaPgcE.mjs";import{V as i,a,i as o,n as s,r as c,t as l}from"./color-P2uVwGzw.mjs";import{t as u}from"./lifecycle-errors-D7JpbOsK.mjs";import{a as d,i as f,n as p,r as m}from"./user-output-Dm9t9jPa.mjs";async function h(l){let d=await n(l);if(!d)return a(s({action:`install`,error:{code:`AGENT_NOT_FOUND`,details:{input:l},message:`Unknown agent: ${l}`},target:{kind:`agent`,name:l}}),g);let{agent:f,inspection:m}=d;if(m.inPath){if(m.installedState)return a(c({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`ALREADY_INSTALLED`,message:`${f.displayName} is already installed.`}]}),g);let n=e(m.methods,m.resolvedBinaryPath??m.binaryPath);if(n){if(p())return a(c({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`DRY_RUN`,message:`Dry run: would record the existing ${f.displayName} install in Quantex state.`}]}),g);o({action:`install`,data:{agent:{displayName:f.displayName,name:f.name}},target:{kind:`agent`,name:f.name},type:`started`});try{let e=await t(f,n);return a(c({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!0,installState:{installType:e.installType,packageName:e.packageName},installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`TRACKED_EXISTING_INSTALL`,message:`${f.displayName} is already installed. Quantex is now tracking the existing install.`}]}),g)}catch(e){if(i(e))return a(s({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},...u(e,{kind:`agent`,name:f.name})}),g);throw e}}return a(c({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!0},target:{kind:`agent`,name:f.name},warnings:[{code:`UNTRACKED_EXISTING_INSTALL`,message:`${f.displayName} is already installed but not tracked by Quantex. Quantex could not safely determine the supported install source, so the existing install remains unmanaged.`}]}),g)}if(p())return a(c({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!1},target:{kind:`agent`,name:f.name},warnings:[{code:`DRY_RUN`,message:`Dry run: would install ${f.displayName}.`}]}),g);o({action:`install`,data:{agent:{displayName:f.displayName,name:f.name}},target:{kind:`agent`,name:f.name},type:`started`});let h;try{h=await r(f)}catch(e){if(i(e))return a(s({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!1},...u(e,{kind:`agent`,name:f.name})}),g);throw e}return h.success?a(c({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!0,installState:h.installedState?{installType:h.installedState.installType,packageName:h.installedState.packageName}:void 0,installed:!0},target:{kind:`agent`,name:f.name}}),g):a(s({action:`install`,data:{agent:{displayName:f.displayName,name:f.name},changed:!1,installed:!1},error:{code:`INSTALL_FAILED`,message:`Failed to install ${f.displayName}.`},target:{kind:`agent`,name:f.name}}),g)}function g(e){if(e.error){m(l.red(e.error.message));return}if(e.data){if(e.warnings.length>0){for(let t of e.warnings){if(t.code===`TRACKED_EXISTING_INSTALL`){f(l.green(t.message));continue}if(t.code===`DRY_RUN`){d(l.cyan(t.message));continue}d(l.yellow(t.message))}return}f(l.cyan(`Installing ${e.data.agent.displayName}...`)),f(l.green(`${e.data.agent.displayName} installed successfully!`))}}export{h as installCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as e}from"./agents-
|
|
1
|
+
import{t as e}from"./agents-BVcaPgcE.mjs";import{a as t,r as n,t as r}from"./color-P2uVwGzw.mjs";async function i(){return t(n({action:`list`,data:{agents:(await e()).map(e=>({binaryName:e.agent.binaryName,displayName:e.agent.displayName,installed:e.inPath,installedVersion:e.installedVersion,latestVersion:e.latestVersion,lifecycle:e.lifecycle,name:e.agent.name,sourceLabel:e.sourceLabel,updateLabel:e.updateLabel}))},target:{kind:`system`,name:`agents`}}),a)}function a(e){console.log(r.bold(`
|
|
2
2
|
AI Agents:
|
|
3
3
|
`));for(let t of e.data?.agents??[]){let e=t.displayName.padEnd(18),n=t.installed?r.green(`installed`):r.gray(`not installed`),i=t.installed?r.dim(t.installedVersion??`unknown version`):``,a=t.installed?r.cyan(t.updateLabel):``,o=t.installed?r.dim(t.sourceLabel):``;console.log(` ${e} ${n} ${i}${a?` ${a}`:``}${o?` ${o}`:``}`)}console.log()}export{i as listCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,v as t,y as n}from"./agents-
|
|
1
|
+
import{r as e,v as t,y as n}from"./agents-BVcaPgcE.mjs";import{a as r,n as i,r as a,t as o}from"./color-P2uVwGzw.mjs";async function s(o){let s=await e(o);if(!s)return r(i({action:`resolve`,error:{code:`AGENT_NOT_FOUND`,details:{input:o},message:`Unknown agent: ${o}`},target:{kind:`agent`,name:o}}),c);let{agent:l,inspection:u}=s;if(!u.inPath||!u.binaryPath){let e=u.methods.map(e=>({command:t(l,e),label:n(e),type:e.type})).filter(e=>e.command);return r(i({action:`resolve`,data:{agent:{binaryName:l.binaryName,displayName:l.displayName,name:l.name},resolution:{binaryPath:``,installGuidance:{docsRef:`skills/quantex-cli/references/command-recipes.md`,installMethods:e,suggestedAction:`ensure-agent-installed`,suggestedEnsureCommand:`quantex ensure ${l.name}`},installed:!1,installSource:`not-installed`,lifecycle:`unmanaged`,sourceLabel:`not installed`,suggestedLaunchCommand:[]}},error:{code:`AGENT_NOT_INSTALLED`,details:{docsRef:`skills/quantex-cli/references/command-recipes.md`,installMethods:e,suggestedAction:`ensure-agent-installed`,suggestedEnsureCommand:`quantex ensure ${l.name}`},message:`${l.displayName} is not installed.`},target:{kind:`agent`,name:l.name}}),c)}return r(a({action:`resolve`,data:{agent:{binaryName:l.binaryName,displayName:l.displayName,name:l.name},resolution:{binaryPath:u.binaryPath,installed:!0,installSource:u.installedState?.installType??`detected-in-path`,installedVersion:u.installedVersion,lifecycle:u.lifecycle,sourceLabel:u.sourceLabel,suggestedLaunchCommand:[u.binaryPath]}},target:{kind:`agent`,name:l.name}}),c)}function c(e){if(e.error){console.log(o.red(e.error.message));let t=e.data?.resolution.installGuidance;if(t){console.log(o.dim(`Try: ${t.suggestedEnsureCommand}`));for(let e of t.installMethods)console.log(o.dim(`Install: [${e.label}] ${e.command}`))}return}e.data&&(console.log(o.bold(`\n${e.data.agent.displayName}\n`)),console.log(` Name: ${e.data.agent.name}`),console.log(` Binary: ${e.data.agent.binaryName}`),console.log(` Path: ${e.data.resolution.binaryPath}`),console.log(` Source: ${e.data.resolution.sourceLabel}`),console.log(` Lifecycle: ${e.data.resolution.lifecycle}`),console.log(` Install Type: ${e.data.resolution.installSource}`),e.data.resolution.installedVersion&&console.log(` Version: ${e.data.resolution.installedVersion}`),console.log(` Launch: ${e.data.resolution.suggestedLaunchCommand.join(` `)}`),console.log())}export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./resolve-B9HkxPmw.mjs";export{e as resolveCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,n as t,r as n,t as r}from"./color-
|
|
1
|
+
import{a as e,n as t,r as n,t as r}from"./color-P2uVwGzw.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=[{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:{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`},npm:{type:`boolean`},winget:{type:`boolean`}},required:[`brew`,`bun`,`npm`,`winget`],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`}},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 s(r){let i=r?o.filter(e=>e.name===r):o;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`}}),c):e(n({action:`schema`,data:{commands:i},target:{kind:`system`,name:`schema`}}),c)}function c(e){if(e.error){console.log(r.red(e.error.message));return}if(e.data){console.log(r.bold(`
|
|
2
2
|
Quantex Schemas
|
|
3
3
|
`));for(let t of e.data.commands)console.log(` ${r.cyan(t.name)}`),console.log(` ${t.description}`);console.log()}}function l(){return o}export{s as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./schema-cVptJ-GO.mjs";export{e as schemaCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,n as t}from"./agents-
|
|
1
|
+
import{l as e,n as t}from"./agents-BVcaPgcE.mjs";import{M as n,V as r,a as i,n as a,r as o,t as s}from"./color-P2uVwGzw.mjs";import{t as c}from"./lifecycle-errors-D7JpbOsK.mjs";import{a as l,i as u,n as d,r as f}from"./user-output-Dm9t9jPa.mjs";async function p(s){let l=t(s);if(!l)return i(a({action:`uninstall`,error:{code:`AGENT_NOT_FOUND`,details:{input:s},message:`Unknown agent: ${s}`},target:{kind:`agent`,name:s}}),m);if(d())return await n(l.name)?i(o({action:`uninstall`,data:{agent:{displayName:l.displayName,name:l.name},changed:!1},target:{kind:`agent`,name:l.name},warnings:[{code:`DRY_RUN`,message:`Dry run: would uninstall ${l.displayName}.`}]}),m):i(a({action:`uninstall`,data:{agent:{displayName:l.displayName,name:l.name},changed:!1},error:{code:`UNINSTALL_FAILED`,message:`Failed to uninstall ${l.displayName}.`},target:{kind:`agent`,name:l.name}}),m);let u;try{u=await e(l)}catch(e){if(r(e))return i(a({action:`uninstall`,data:{agent:{displayName:l.displayName,name:l.name},changed:!1},...c(e,{kind:`agent`,name:l.name})}),m);throw e}return i(u?o({action:`uninstall`,data:{agent:{displayName:l.displayName,name:l.name},changed:!0},target:{kind:`agent`,name:l.name}}):a({action:`uninstall`,data:{agent:{displayName:l.displayName,name:l.name},changed:!1},error:{code:`UNINSTALL_FAILED`,message:`Failed to uninstall ${l.displayName}.`},target:{kind:`agent`,name:l.name}}),m)}function m(e){if(e.error){f(s.red(e.error.message));return}if(e.data){if(e.warnings&&e.warnings.length>0){for(let t of e.warnings)l(s.yellow(t.message));return}u(s.cyan(`Uninstalling ${e.data.agent.displayName}...`)),u(s.green(`${e.data.agent.displayName} uninstalled successfully!`))}}export{p as uninstallCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./messages-qcLhD-Gc.mjs";import{_ as r,d as i,h as a,n as o,u as s,w as c}from"./agents-
|
|
1
|
+
import{n as e,r as t,t as n}from"./messages-qcLhD-Gc.mjs";import{_ as r,d as i,h as a,n as o,u as s,w as c}from"./agents-BVcaPgcE.mjs";import{T as l,V as u,a as d,i as f,n as p,r as m,t as h}from"./color-P2uVwGzw.mjs";import{a as g,i as _,n as v,r as y}from"./user-output-Dm9t9jPa.mjs";import{n as b,r as x}from"./update-CXSiym15.mjs";async function S(e,t){if(t)return C();if(!e)return d(p({action:`update`,error:{code:`INVALID_ARGUMENT`,message:`Please specify an agent name or use --all flag`},target:{kind:`agent`}}),A);let n=o(e);return n?w(n):d(p({action:`update`,error:{code:`AGENT_NOT_FOUND`,details:{input:e},message:`Unknown agent: ${e}`},target:{kind:`agent`,name:e}}),A)}async function C(){f({action:`update`,data:{scope:`all`},target:{kind:`agent`},type:`started`});let e=await T(await b());return e.hasFailures?d(p({action:`update`,data:{results:e.results,scope:`all`},error:{code:`UPDATE_FAILED`,message:`One or more agents failed to update.`},target:{kind:`agent`}}),A):d(m({action:`update`,data:{results:e.results,scope:`all`},target:{kind:`agent`}}),A)}async function w(e){f({action:`update`,data:{agent:e.name,scope:`single`},target:{kind:`agent`,name:e.name},type:`started`});let{inspection:t,plan:n}=await x(e);if(!t.inPath)return d(p({action:`update`,error:{code:`AGENT_NOT_INSTALLED`,message:`${e.displayName} is not installed.`},target:{kind:`agent`,name:e.name}}),A);let r=await T(n),i=k(r.results);return i?d(p({action:`update`,data:{results:r.results,scope:`single`},error:{code:`RESOURCE_LOCKED`,details:i.resource?{resource:i.resource}:void 0,message:i.message??`Another quantex process is already updating ${e.displayName}.`},target:{kind:`agent`,name:e.name}}),A):r.hasFailures?d(p({action:`update`,data:{results:r.results,scope:`single`},error:{code:`UPDATE_FAILED`,message:`Failed to update ${e.displayName}.`},target:{kind:`agent`,name:e.name}}),A):d(m({action:`update`,data:{results:r.results,scope:`single`},target:{kind:`agent`,name:e.name}}),A)}async function T(n){let r=[];for(let e of n.upToDate)E(r,{displayName:e.agent.displayName,installedVersion:e.installedVersion,latestVersion:e.latestVersion,name:e.agent.name,status:`up-to-date`});for(let t of n.skippedManualCheck)E(r,{displayName:t.agent.displayName,message:e(t.agent),name:t.agent.name,status:`manual-required`});for(let e of n.untrackedInPath)E(r,{displayName:e.agent.displayName,message:t(e.agent),name:e.agent.name,status:`manual-required`});for(let e of n.grouped){let t=await D(e.type,e.packages,e.updates);for(let e of t)E(r,e)}for(let e of n.manual)E(r,await O(e.agent,e.state,e.inspection.methods,e.inspection));return{hasFailures:r.some(e=>e.status===`failed`||e.status===`locked`),results:r}}function E(e,t){e.push(t),f({action:`update`,data:t,target:{kind:`agent`,name:t.name},type:`progress`})}async function D(e,t,n){if(n.length===0)return[];if(v())return n.map(({agent:t,inspection:n,strategy:r})=>({displayName:t.displayName,installedVersion:n.installedVersion,latestVersion:n.latestVersion,message:`Dry run: would update ${t.displayName}.`,name:t.name,status:`planned`,strategy:r===`managed`?`managed/${e}`:r}));try{return await i(e,t)?n.map(({agent:t,inspection:n,strategy:r})=>({displayName:t.displayName,installedVersion:n.installedVersion,latestVersion:n.latestVersion,name:t.name,status:`updated`,strategy:r===`managed`?`managed/${e}`:r})):await Promise.all(n.map(({agent:e,inspection:t,state:n})=>O(e,n,t.methods,t)))}catch(t){if(!u(t))throw t;return n.map(({agent:n,inspection:r,strategy:i})=>({displayName:n.displayName,installedVersion:r.installedVersion,latestVersion:r.latestVersion,message:t.message,name:n.name,resource:t.resource,status:`locked`,strategy:i===`managed`?`managed/${e}`:i}))}}async function O(t,i,o,d){let f=o??d?.methods??[],p=a({agent:t,installedState:i,methods:f}),m=d?.installedVersion,h=d?.latestVersion;if(p===`manual-hint`&&!r(t,i)&&!f.some(e=>c(e.type)))return{displayName:t.displayName,installedVersion:m,latestVersion:h,message:e(t),name:t.name,status:`manual-required`,strategy:p};if(v())return{displayName:t.displayName,installedVersion:m,latestVersion:h,message:`Dry run: would update ${t.displayName}.`,name:t.name,status:`planned`,strategy:p};let g;try{g=await s(t,i)}catch(e){if(u(e))return{displayName:t.displayName,installedVersion:m,latestVersion:h,message:e.message,name:t.name,resource:e.resource,status:`locked`,strategy:p};throw e}if(g.success){if(p===`self-update`){let e=await l(t.binaryName,t.versionProbe);if(m&&e)return e===m?{displayName:t.displayName,installedVersion:e,latestVersion:e,name:t.name,status:`up-to-date`,strategy:p}:{displayName:t.displayName,installedVersion:m,latestVersion:e,name:t.name,status:`updated`,strategy:p}}return{displayName:t.displayName,installedVersion:m,latestVersion:h,name:t.name,status:`updated`,strategy:p}}return{displayName:t.displayName,hint:n(t,p),installedVersion:m,latestVersion:h,name:t.name,status:`failed`,strategy:p}}function k(e){if(e.length===1)return e[0]?.status===`locked`?e[0]:void 0}function A(e){if(!e.data){e.error&&y(h.red(e.error.message));return}for(let t of e.data.results)switch(t.status){case`up-to-date`:_(h.green(`${t.displayName} is up to date (${t.installedVersion??`unknown`})`));break;case`manual-required`:g(h.yellow(`${t.displayName}: manual action required.`)),t.message&&g(h.cyan(`Next step: ${t.message}`));break;case`planned`:g(h.cyan(`Would update ${t.displayName}${t.strategy?` via ${t.strategy}`:``}${j(t.installedVersion,t.latestVersion)}`));break;case`updated`:_(h.cyan(`Updating ${t.displayName}${t.strategy?` via ${t.strategy}`:``}...${j(t.installedVersion,t.latestVersion)}`)),_(h.green(`${t.displayName} updated successfully!`));break;case`failed`:_(h.cyan(`Updating ${t.displayName}${t.strategy?` via ${t.strategy}`:``}...${j(t.installedVersion,t.latestVersion)}`)),y(h.red(`Failed to update ${t.displayName}.`)),t.hint&&g(h.cyan(`Next step: ${t.hint}`));break;case`locked`:g(h.yellow(t.message??`Another quantex process is already updating ${t.displayName}.`));break}e.data.results.length>1&&M(e.data.results),!e.data.results.length&&e.error&&y(h.red(e.error.message))}function j(e,t){return e?` (${e} -> ${t??`latest`})`:``}function M(e){let t={failed:0,locked:0,manualRequired:0,planned:0,upToDate:0,updated:0};for(let n of e)switch(n.status){case`up-to-date`:t.upToDate+=1;break;case`manual-required`:t.manualRequired+=1;break;case`planned`:t.planned+=1;break;case`updated`:t.updated+=1;break;case`failed`:t.failed+=1;break;case`locked`:t.locked+=1;break}let n=[t.updated?`updated ${t.updated}`:void 0,t.upToDate?`up to date ${t.upToDate}`:void 0,t.manualRequired?`manual ${t.manualRequired}`:void 0,t.failed?`failed ${t.failed}`:void 0,t.locked?`locked ${t.locked}`:void 0,t.planned?`planned ${t.planned}`:void 0].filter(Boolean);n.length>0&&_(h.bold(`Summary: ${n.join(`, `)}`))}export{S as updateCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,g as t,i as n,t as r,x as i}from"./agents-
|
|
1
|
+
import{_ as e,g as t,i as n,t as r,x as i}from"./agents-BVcaPgcE.mjs";function a(e,n={}){let r={bun:[],npm:[],brew:[],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.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`,`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=c.map(e=>p(e,n.grouped[e])).filter(e=>e!==void 0);return{entries:n.entries.map(e=>m(e.inspection)),grouped:r,manual:n.manual.map(e=>m(e.inspection)),skippedManualCheck:n.skippedManualCheck,untrackedInPath:n.untrackedInPath,upToDate:n.upToDate}}function p(e,t){if(t.length===0)return;let n=t.map(e=>m(e.inspection));return{type:e,packages:n.flatMap(e=>e.package?.packageName?[e.package]:[]),updates:n}}function m(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?h(e.agent,e.installedState,e.methods,r):void 0,state:e.installedState,strategy:n.strategy}}function h(e,t,n,r){if(t?.packageName&&t.installType===r)return{packageName:t.packageName,packageTargetKind:t.packageTargetKind};let a=n.find(e=>e.type===r);if(!a)return;let o=i(e,a);if(o)return{packageName:o,packageTargetKind:a.packageTargetKind}}export{o as a,a as i,u as n,d as r,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,d as t,n,p as r,r as i,t as a,u as o}from"./color-
|
|
1
|
+
import{a as e,d as t,n,p as r,r as i,t as a,u as o}from"./color-P2uVwGzw.mjs";import{a as s,i as c,n as l,r as u}from"./user-output-Dm9t9jPa.mjs";async function d(a={}){let s=await o({updateChannel:a.channel}),c=l(),u=p(s);if(s.latestVersion&&s.latestVersion===s.currentVersion)return e(i({action:`upgrade`,data:{canAutoUpdate:s.canAutoUpdate,channel:s.updateChannel,currentVersion:s.currentVersion,installSource:s.installSource,latestVersion:s.latestVersion,status:`up-to-date`},target:{kind:`self`,name:`quantex`},warnings:u}),f);if(a.check||c)return s.latestVersion?e(i({action:`upgrade`,data:{canAutoUpdate:s.canAutoUpdate,channel:s.updateChannel,currentVersion:s.currentVersion,installSource:s.installSource,latestVersion:s.latestVersion,status:`update-available`},exitCode:a.check?1:void 0,target:{kind:`self`,name:`quantex`},warnings:[...u,...c?[{code:`DRY_RUN`,message:`Dry run: would upgrade Quantex CLI.`}]:[]]}),f):e(n({action:`upgrade`,data:{canAutoUpdate:s.canAutoUpdate,channel:s.updateChannel,currentVersion:s.currentVersion,installSource:s.installSource,status:`check-unavailable`},error:{code:`NETWORK_ERROR`,message:`Unable to determine the latest Quantex CLI version.`},target:{kind:`self`,name:`quantex`},warnings:u}),f);if(!s.canAutoUpdate){let t=r(s);return e(n({action:`upgrade`,data:{canAutoUpdate:s.canAutoUpdate,channel:s.updateChannel,currentVersion:s.currentVersion,installSource:s.installSource,latestVersion:s.latestVersion,recoveryHint:t,status:`manual-required`},error:{code:`MANUAL_ACTION_REQUIRED`,message:`Quantex CLI cannot auto-update from the current install source: ${s.installSource}.`},target:{kind:`self`,name:`quantex`},warnings:u}),f)}let d=await t(s);if(d.success)return e(i({action:`upgrade`,data:{canAutoUpdate:s.canAutoUpdate,channel:s.updateChannel,currentVersion:s.currentVersion,installSource:s.installSource,latestVersion:s.latestVersion,status:`updated`},target:{kind:`self`,name:`quantex`},warnings:u}),f);let m=r(s,d);return e(n({action:`upgrade`,data:{canAutoUpdate:s.canAutoUpdate,channel:s.updateChannel,currentVersion:s.currentVersion,installSource:s.installSource,latestVersion:s.latestVersion,recoveryHint:m,status:`manual-required`},error:{code:`UPGRADE_FAILED`,details:d.error?.kind?{kind:d.error.kind}:void 0,message:d.error?.message??`Failed to upgrade Quantex CLI.`},target:{kind:`self`,name:`quantex`},warnings:[...u,...m?[{code:`MANUAL_RECOVERY`,message:`Manual recovery: ${m}`}]:[]]}),f)}function f(e){if(!e.data){e.error&&u(a.red(e.error.message));return}if(e.data.status===`up-to-date`){c(a.green(`Quantex CLI is already up to date (${e.data.currentVersion}).`)),m(e.warnings);return}if(e.data.status===`update-available`){let t=e.warnings.some(e=>e.message.includes(`Dry run`))?`Dry run: `:``;s(a.yellow(`${t}Update available for Quantex CLI: ${e.data.currentVersion} -> ${e.data.latestVersion} (${e.data.channel}).`)),m(e.warnings);return}if(e.data.status===`check-unavailable`){e.error&&s(a.yellow(e.error.message)),m(e.warnings);return}if(e.data.status===`manual-required`&&e.error?.code===`MANUAL_ACTION_REQUIRED`){s(a.yellow(e.error.message)),e.data.recoveryHint&&s(a.cyan(`Next step: ${e.data.recoveryHint}`));return}let t=e.data.latestVersion?` (${e.data.currentVersion} -> ${e.data.latestVersion})`:` (${e.data.currentVersion})`;if(c(a.cyan(`Upgrading Quantex CLI...${t}`)),!e.error){c(a.green(`Quantex CLI upgraded successfully.`)),m(e.warnings);return}u(a.red(`Failed to upgrade Quantex CLI.`)),s(a.yellow(`Reason: ${e.error.message}`));for(let t of e.warnings)s(a.cyan(t.message.replace(/^Manual recovery:/,`Next step:`)))}function p(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 m(e){for(let t of e)t.code===`DRY_RUN`||t.code===`MANUAL_RECOVERY`||s(a.yellow(t.message))}export{d as upgradeCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Q as e}from"./color-P2uVwGzw.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.13.0",
|
|
4
4
|
"description": "A unified lifecycle CLI for installing, inspecting, updating, uninstalling, and launching popular AI coding assistants",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/Drswith/quantex-cli#readme",
|
|
@@ -90,5 +90,8 @@
|
|
|
90
90
|
"oxfmt --write"
|
|
91
91
|
]
|
|
92
92
|
},
|
|
93
|
+
"engines": {
|
|
94
|
+
"node": ">=20"
|
|
95
|
+
},
|
|
93
96
|
"packageManager": "bun@1.3.11"
|
|
94
97
|
}
|
package/dist/agents-Jo9kz0sn.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,t as s}from"./detect-BD2Ph-sr.mjs";import{A as c,C as l,D as ee,E as u,I as d,O as f,P as p,S as m,W as h,_ as g,b as te,g as ne,h as re,k as ie,m as ae,v as oe,x as se,y as ce,z as _}from"./color-DsW76Q6X.mjs";import le from"node:process";const ue={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`},npm:{canInstall:!0,canLookupLatestVersion:!0,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 v(e){return ue[e]}function y(e){return v(e).lifecycle===`managed`}function b(e){return v(e).lifecycle}function x(e){return v(e).canUpdate}function S(e){return v(e).canUninstall}function C(e){return v(e).canLookupLatestVersion}function w(e,t){return e?t===`cask`?` (${e} cask)`:t===`id`?` (${e} id)`:` (${e})`:``}function T(e,t){return t.packageName||e.packages?.npm||void 0}function E(e){return e?x(e.installType):!1}function D(e,t){return E(t)||!!e.selfUpdate}function de(e){return!!e&&C(e.installType)}function fe(e){return e.length>0&&e.every(e=>C(e.type))}function pe(e){return y(e.type)?`${b(e.type)}/${e.type}${w(e.packageName,e.packageTargetKind)}`:e.type===`script`?`unmanaged/script`:`unmanaged/binary`}function me(e){return e?y(e.installType)?`managed via ${e.installType}${w(e.packageName,e.packageTargetKind)}`:e.installType===`script`?`script installer`:`binary installer`:`detected in PATH`}function he(e,t){let n=I({agent:e,installedState:t,methods:[]});return n===`managed`?`managed update`:n===`self-update`?`command update`:`manual update`}function ge(e,t){if(t.type===`bun`){let n=T(e,t);return n?`bun add -g ${n}`:``}if(t.type===`npm`){let n=T(e,t);return n?`npm i -g ${n}`:``}return t.type===`brew`?t.packageName?t.packageTargetKind===`cask`?`brew install --cask ${t.packageName}`:`brew install ${t.packageName}`:``:t.type===`winget`?t.packageName?`winget install --id ${t.packageName} -e`:``:t.command??``}function _e(e,t,n){if(t)return de(t)&&(t.packageName||e.packages?.npm)||void 0;if(!(!e.packages?.npm||!fe(n)))return e.packages.npm}function O(e,t){let n=k(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 k(e){if(!e)return;let t=e.replaceAll(`\\`,`/`);if(t.includes(`/.bun/bin/`)||t.includes(`/.bun/install/global/`))return`bun`;if(t.includes(`/node_modules/.bin/`)||t.includes(`/node_modules/`))return`npm`}function A(e){if(e.installedState&&y(e.installedState.installType))return e.installedState.installType;for(let t of e.methods)if(y(t.type)&&x(t.type))return t.type}const j={strategy:`managed`,canHandle:e=>!!A(e),getManagedInstallerType:e=>A(e)},M={strategy:`self-update`,canHandle:e=>!E(e.installedState)&&!!e.agent.selfUpdate},N={strategy:`manual-hint`,canHandle:()=>!0},P=[j,M,N];function F(e){return P.find(t=>t.canHandle(e))??N}function I(e){return F(e).strategy}function L(e){return D(e.agent,e.installedState)}async function R(e){let t=s(),n=typeof e==`function`?e(t):e;try{return le.platform===`win32`?await l(m([`powershell.exe`,`-Command`,n]))===0:await l(m([`sh`,`-c`,n]))===0}catch{return!1}}function ve(e){return e===`cask`?[`--cask`]:[]}async function z(e,t,n){try{return await l(m([`brew`,e,...ve(n),t]))===0}catch{return!1}}async function ye(e,t){return z(`install`,e,t)}async function B(e,t){return z(`upgrade`,e,t)}async function be(e){for(let t of e)if(!await B(t.packageName,t.packageTargetKind))return!1;return!0}async function xe(e,t){return z(`uninstall`,e,t)}async function V(e,t){try{return await l(m([`winget`,e,`--id`,t,`-e`]))===0}catch{return!1}}async function Se(e){return V(`install`,e)}async function H(e){return V(`upgrade`,e)}async function Ce(e){for(let t of e)if(!await H(t.packageName))return!1;return!0}async function we(e){return V(`uninstall`,e)}const Te={brew:{type:`brew`,isAvailable:async()=>o(),install:async(e,t)=>ye(e,t),uninstall:async(e,t)=>xe(e,t),update:async(e,t)=>B(e,t),updateMany:async e=>be(e)},bun:{type:`bun`,isAvailable:async()=>n(),install:async e=>oe(e),uninstall:async e=>ce(e),update:async(e,t,n)=>te(e,n?.npmBunUpdateStrategy),updateMany:async(e,t)=>se(e.map(e=>e.packageName),t?.npmBunUpdateStrategy)},npm:{type:`npm`,isAvailable:async()=>e(),install:async e=>ae(e),uninstall:async e=>re(e),update:async(e,t,n)=>ne(e,n?.npmBunUpdateStrategy),updateMany:async(e,t)=>g(e.map(e=>e.packageName),t?.npmBunUpdateStrategy)},winget:{type:`winget`,isAvailable:async()=>a(),install:async e=>Se(e),uninstall:async e=>we(e),update:async e=>H(e),updateMany:async e=>Ce(e.map(e=>({packageName:e.packageName})))}};function U(e){return Te[e]}const W={resource:`agent lifecycle`,scope:[`agent-lifecycle`]};async function Ee(){return(await h()).defaultPackageManager}async function G(){return{npmBunUpdateStrategy:(await h()).npmBunUpdateStrategy}}async function K(e){let t=s(),n=e.platforms[t];if(!n)return[];let r=await Ee();return r?[...n.filter(e=>e.type===r),...n.filter(e=>e.type!==r)]:[...n]}async function q(e,t,n,r,i){let a=U(e);return await a.isAvailable()?r===`install`?a.install(t,n):r===`update`?a.update(t,n,{npmBunUpdateStrategy:i}):a.uninstall(t,n):!1}async function J(e,t,n,r){if(y(t.type)){let i=T(e,t);return i?q(t.type,i,t.packageTargetKind,n,r):!1}return n===`update`&&!x(t.type)||!t.command?!1:R(t.command)}async function Y(e,t,n){return y(e.installType)?e.packageName?q(e.installType,e.packageName,e.packageTargetKind,t,n):!1:t!==`install`||!e.command?!1:R(e.command)}async function De(e){if(!e.selfUpdate)return!1;let t=[e.selfUpdate.command,...e.selfUpdate.fallbackCommands??[]];for(let e of t)if(await R(e.join(` `)))return!0;return!1}async function X(e,t){let n={agentName:e.name,installType:t.type,packageName:T(e,t),packageTargetKind:t.packageTargetKind,command:`command`in t?t.command:void 0};return await d(n),n}async function Oe(e,t){return _(W,async()=>X(e,t))}async function ke(e){return _(W,async()=>{let t=await K(e);for(let n of t)if(await J(e,n,`install`))return{success:!0,installedState:await X(e,n)};return{success:!1}})}async function Ae(e,t){return _(W,async()=>{let{npmBunUpdateStrategy:n}=await G(),r=await K(e);if(t&&await Y(t,`update`,n))return await d(t),{success:!0,installedState:t};if(!t){for(let t of r)if(await J(e,t,`update`,n))return{success:!0,installedState:await X(e,t)}}if(await De(e))return{success:!0};if(t){for(let t of r)if(await J(e,t,`update`,n))return{success:!0,installedState:await X(e,t)}}return{success:!1}})}async function je(e,t){return _(W,async()=>{let n=[...new Map(t.filter(e=>e.packageName).map(e=>[`${e.packageTargetKind??`package`}:${e.packageName}`,e])).values()],r=U(e);return await r.isAvailable()?r.updateMany(n,await G()):!1})}async function Me(e){return _(W,async()=>{let t=await c(e.name);if(!t)return!1;let n=await Y(t,`uninstall`);return n&&await p(e.name),n})}async function Z(e){let[t,n,r]=await Promise.all([K(e),c(e.name),i(e.binaryName)]),[a,o,s]=await Promise.all([r?ee(e.binaryName,e.versionProbe):Promise.resolve(void 0),r?u(e.binaryName):Promise.resolve(void 0),Ne(e,n,t)]);return{agent:e,methods:t,installedState:n,inPath:r,installedVersion:a,latestVersion:s,binaryPath:o,resolvedBinaryPath:await ie(o),sourceLabel:me(n),updateLabel:he(e,n),lifecycle:n?b(n.installType):`unmanaged`}}async function Q(e){return Promise.all(e.map(Z))}async function Ne(e,t,n){let r=_e(e,t,n);if(r)return f(r)}function $(e){return t(e)}async function Pe(e){let t=$(e);if(t)return{agent:t,inspection:await Z(t)}}async function Fe(){return Q(r())}export{S as C,y as D,v as E,C as S,b as T,D as _,Q as a,O as b,Oe as c,je as d,U as f,F as g,I as h,Z as i,Me as l,L as m,$ as n,K as o,P as p,Pe as r,ke as s,Fe as t,Ae as u,ge as v,x as w,T as x,pe as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./capabilities-Bkl5TSUt.mjs";export{e as capabilitiesCommand};
|
package/dist/color-DsW76Q6X.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{createHash as e,randomUUID as t}from"node:crypto";import n from"node:process";import{chmod as r,mkdir as i,mkdtemp as a,readFile as o,realpath as s,rename as c,rm as l,stat as u,writeFile as d}from"node:fs/promises";import{basename as f,dirname as p,join as m}from"node:path";import{fileURLToPath as h}from"node:url";import{homedir as g}from"node:os";import{Buffer as ee}from"node:buffer";import{existsSync as _}from"node:fs";import{createColors as te,isColorSupported as ne}from"picocolors";function re(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??=de(),v}function ie(e){y=new Set,v={...e,cacheMode:e.cacheMode??`default`,cancelled:e.cancelled??!1}}function ae(){v=void 0,y=new Set}function oe(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:re(e.timeout),c=fe(e.color),l=pe(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 se(){v&&(v.cancelled=!0)}function ce(){se();for(let e of y)e();y.clear()}function le(e){return y.add(e),()=>{y.delete(e)}}function ue(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 de(){return oe()}function fe(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 pe(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 x=`https://registry.npmjs.org`;function S(e){if(e)try{return new URL(e.trim()).toString().replace(/\/+$/,``)}catch{return}}function me(e,t,n){return`${S(n)}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}const C={defaultPackageManager:`bun`,networkRetries:2,networkTimeoutMs:1e4,npmBunUpdateStrategy:`latest-major`,selfUpdateChannel:`stable`,selfUpdateRegistry:void 0,versionCacheTtlHours:6};function w(){return m(n.env.HOME||n.env.USERPROFILE||g(),`.quantex`)}function T(){return m(w(),`config.json`)}async function E(){let e={...C,...await _e()};return{...e,defaultPackageManager:e.defaultPackageManager===`npm`?`npm`:`bun`,networkRetries:D(e.networkRetries,2),networkTimeoutMs:D(e.networkTimeoutMs,1e4),npmBunUpdateStrategy:e.npmBunUpdateStrategy===`respect-semver`?`respect-semver`:`latest-major`,selfUpdateChannel:e.selfUpdateChannel===`beta`?`beta`:`stable`,selfUpdateRegistry:typeof e.selfUpdateRegistry==`string`?S(e.selfUpdateRegistry):void 0,versionCacheTtlHours:D(e.versionCacheTtlHours,6)}}function he(e){return e===`latest-major`||e===`respect-semver`}async function ge(e){await i(w(),{recursive:!0}),await Bun.write(T(),`${JSON.stringify(e,null,2)}\n`)}async function _e(){try{let e=await o(T(),`utf8`),t=JSON.parse(e);return ve(t)?t:{}}catch{return{}}}function D(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 ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const O=`quantex-cli`,k=`https://github.com/Drswith/quantex-cli`,ye=`0.12.0`;var be=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 A(e){return e instanceof be}function xe(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 m(w(),`locks`,...r,i)}async function j(e){let t=xe(e.scope);await i(p(t),{recursive:!0});try{await i(t,{recursive:!1})}catch(n){throw typeof n==`object`&&n&&`code`in n&&n.code===`EEXIST`?new be(e.resource,t):n}return async()=>{await l(t,{force:!0,recursive:!0})}}async function Se(e,t){let n=await j(e);try{return await t()}finally{await n()}}const Ce={installedAgents:{},self:{}};function M(){return m(w(),`state.json`)}async function N(){return ke()}async function we(e){let t=await j({resource:`state`,scope:[`state`]});try{await Ae(e)}finally{await t()}}async function Te(e){return(await N()).installedAgents[e]}async function Ee(e){await F(t=>{t.installedAgents[e.agentName]=e})}async function De(e){await F(t=>{delete t.installedAgents[e]})}async function P(){return(await N()).self}async function Oe(e){await F(t=>{t.self.installSource=e})}async function ke(){try{let e=await Bun.file(M()).json();return{installedAgents:e.installedAgents??{},self:e.self??{}}}catch{return{...Ce}}}async function Ae(e){await i(w(),{recursive:!0}),await Bun.write(M(),`${JSON.stringify(e,null,2)}\n`)}async function F(e){let t=await j({resource:`state`,scope:[`state`]});try{let t=await ke();await e(t),await Ae(t)}finally{await t()}}async function I(e,t){let n=await je(e,t,`json`);if(n)try{return JSON.parse(n)}catch{return}}async function je(e,t,n=`text`){let r=await E(),i=r.versionCacheTtlHours*60*60*1e3,a=b().cacheMode,o=a===`no-cache`?{entries:{}}:await Ne(),s=o.entries[t],c=Date.now();if(a===`default`&&s&&s.expiresAt>c)return L(s,i),s.body;let l=await Me(e,{headers:a!==`no-cache`&&s?.etag?{"If-None-Match":s.etag}:void 0,retries:r.networkRetries,timeoutMs:r.networkTimeoutMs});if(!l)return s&&L(s,i),s?.body;if(l.status===304&&s)return o.entries[t]={...s,expiresAt:c+i,fetchedAt:c},a!==`no-cache`&&await Pe(o),Ie(c,c+i),s.body;if(!l.ok)return s&&L(s,i),s?.body;let u=await l.text();if(n===`json`)try{JSON.parse(u)}catch{return s&&L(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 Pe(o)),Ie(c,c+i),u}async function Me(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 Ne(){try{return JSON.parse(await o(Fe(),`utf8`))}catch{return{entries:{}}}}async function Pe(e){await i(m(w(),`cache`),{recursive:!0}),await d(Fe(),`${JSON.stringify(e,null,2)}\n`,`utf8`)}function Fe(){return m(w(),`cache`,`versions.json`)}function L(e,t){let n=e.fetchedAt??Math.max(0,e.expiresAt-t);ue({fetchedAt:new Date(n).toISOString(),source:`cache`,staleAfter:new Date(e.expiresAt).toISOString()})}function Ie(e,t){ue({fetchedAt:new Date(e).toISOString(),source:`network`,staleAfter:new Date(t).toISOString()})}const Le=/v?(\d+\.\d+\.\d+(?:-[a-z0-9.]+)?)/i;function Re(e,t){if(t)return t(e);let n=e.trim().split(`
|
|
2
|
-
`)[0],r=n.match(Le);return r?r[1]:n||void 0}async function R(e,t){let n=t?.command??[e,`--version`];try{let e=Bun.spawn(n,{stdout:`pipe`,stderr:`pipe`});return await e.exited,e.exitCode===0?Re(await new Response(e.stdout).text(),t?.parser):void 0}catch{return}}async function z(e,t=`latest`,n={}){try{let r=S(n.registry)??`https://registry.npmjs.org`;return(await I(me(e,t,r),`npm:${r}:${e}:${t}`))?.version}catch{return}}async function ze(e){try{let t=n.platform===`win32`?`where`:`which`,r=Bun.spawn([t,e],{stdout:`pipe`,stderr:`pipe`});return await r.exited,r.exitCode===0?(await new Response(r.stdout).text()).trim().split(`
|
|
3
|
-
`)[0]:void 0}catch{return}}async function Be(e){if(e)try{return await s(e)}catch{return e}}async function Ve(){try{return await j({resource:`self upgrade`,scope:[`self-upgrade`]})}catch(e){if(A(e))return;throw e}}async function He(e,t,i,o){let s;try{s=await fetch(e)}catch(t){return V(`network`,`Failed to download ${e}.`,t)}if(!s.ok)return V(`network`,`Failed to download ${e}: HTTP ${s.status}.`);let u=await a(m(p(t),`.quantex-upgrade-`)),h=m(u,f(t)),g=`${t}.bak`;try{let a=ee.from(await s.arrayBuffer()),f=await Ue(t),p=Ye(a);if(p!==H(i))return V(`checksum`,`Checksum mismatch for ${e}. Expected ${H(i)}, got ${p}.`);if(await d(h,a),n.platform===`win32`)return We(h,t,g,u,o);await r(h,f),await l(g,{force:!0}),await c(t,g),await c(h,t);let m=await Je(t,o);return m.success?(await l(g,{force:!0}),{success:!0}):(await qe(g,t),m)}catch(e){return V(Ke(e),`Failed to replace the current Quantex binary.`,e)}finally{n.platform!==`win32`&&await l(u,{recursive:!0,force:!0})}}async function Ue(e){try{return(await u(e)).mode&511}catch{return 493}}function We(e,t,r,i,a){try{let o=Ge(e,t,r,i,n.pid,a);return Bun.spawn([`powershell.exe`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-WindowStyle`,`Hidden`,`-Command`,o],{stdio:[`ignore`,`ignore`,`ignore`],windowsHide:!0}).unref?.(),{success:!0}}catch(e){return V(`locked`,`Failed to schedule Windows binary replacement.`,e)}}function Ge(e,t,n,r,i,a){let o=B(e),s=B(t),c=B(n),l=B(r),u=B(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 B(e){return e.replaceAll(`'`,`''`)}function V(e,t,n){return{error:{detail:n,kind:e,message:t},success:!1}}function Ke(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 qe(e,t){await l(t,{force:!0}),await c(e,t)}async function Je(e,t){if(!t)return{success:!0};try{let n=Bun.spawn([e,`--version`],{stdio:[`ignore`,`pipe`,`ignore`]}),r=n.stdout?await new Response(n.stdout).text():``,i=await n.exited;return i===0?r.includes(t)?{success:!0}:V(`verify`,`The upgraded Quantex binary reported an unexpected version during verification.`):V(`verify`,`The upgraded Quantex binary exited with code ${i} during verification.`)}catch(e){return V(`verify`,`Failed to execute the upgraded Quantex binary for verification.`,e)}}function Ye(t){return e(`sha256`).update(t).digest(`hex`)}function H(e){return e.trim().toLowerCase()}function Xe(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function U(e=n.execPath){if(f(Xe(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 W(e=n.execPath){let t=U(e);if(t)return`${k}/releases/latest/download/${t}`}function Ze(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 Qe(e){let t=await I(await $e(e),`self:manifest:${e}`);if(!t)throw Error(`Failed to download release manifest.`);return t}async function $e(e){if(e===`stable`)return`${k}/releases/latest/download/manifest.json`;let t=(await et(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 et(e){let t=nt();if(!t)throw Error(`Failed to resolve the GitHub repository slug for Quantex releases.`);let n=await I(`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 tt(e,t=n.execPath){let r=n.platform,i=n.arch===`arm64`?`arm64`:`x64`,a=U(t);return e.assets.find(e=>e.platform===r&&e.arch===i&&(!a||e.name===a))}function nt(){return k.match(/github\.com\/([^/]+\/[^/]+)$/)?.[1]}const rt={source:`binary`,canHandle:e=>e.installSource===`binary`,getRecoveryHint:(e,t)=>{let n=t?.error?.detail&&typeof t.error.detail==`object`&&`downloadUrl`in t.error.detail?String(t.error.detail.downloadUrl):W(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){if(!U(e.executablePath))return{error:{kind:`unsupported`,message:`No release artifact is available for the current platform and architecture.`},installSource:e.installSource,success:!1};let t;try{t=await Qe(e.updateChannel)}catch(t){return{error:{detail:t,kind:`network`,message:`Failed to resolve the ${e.updateChannel} release manifest.`},installSource:e.installSource,success:!1}}let n=tt(t,e.executablePath);if(!n)return{error:{detail:{channel:e.updateChannel},kind:`unsupported`,message:`No binary asset is available for the current platform on the ${e.updateChannel} channel.`},installSource:e.installSource,success:!1};let r=await He(n.downloadUrl,e.executablePath,n.checksum,t.version);return{...!r.success&&r.error?{...r,error:{...r.error,detail:{...typeof r.error.detail==`object`&&r.error.detail?r.error.detail:{},downloadUrl:n.downloadUrl}}}:r,installSource:e.installSource,newVersion:r.success?t.version:void 0}}};function G(e,t={}){if(b().outputMode===`human`){let n=Bun.spawn(e,{...t,stdio:[`inherit`,`inherit`,`inherit`]});return{cleanup:le(()=>n.kill?.(`SIGTERM`)),outputDrained:Promise.resolve(),proc:n}}let n=Bun.spawn(e,{...t,stdio:[`ignore`,`pipe`,`pipe`]});return{cleanup:le(()=>n.kill?.(`SIGTERM`)),outputDrained:Promise.all([it(n.stdout),it(n.stderr)]).then(()=>void 0),proc:n}}async function K(e){try{return await e.proc.exited,await e.outputDrained,e.proc.exitCode??1}finally{e.cleanup()}}async function it(e){if(!e)return;let t=await new Response(e).text();t&&n.stderr.write(t)}async function at(e,t,n){try{let r=t?`${e}@${t}`:e,i=S(n);return await q([`bun`,`add`,`-g`,...i?[`--registry`,i]:[],r],[e])}catch{return!1}}async function ot(e,t=`latest-major`,n=`latest`,r){try{let i=n===`latest`?e:`${e}@${n}`,a=S(r);return await q([`bun`,`update`,`-g`,...t===`latest-major`?[`--latest`]:[],...a?[`--registry`,a]:[],i],[e])}catch{return!1}}async function st(e,t=`latest-major`){if(e.length===0)return!0;try{return await q([`bun`,`update`,`-g`,...t===`latest-major`?[`--latest`]:[],...e],e)}catch{return!1}}async function ct(e){try{return await K(G([`bun`,`remove`,`-g`,e]))===0}catch{return!1}}async function q(e,t){return await K(G(e))===0?lt(t):!1}async function lt(e){let t=[...new Set(e)];if(t.length===0)return!0;let n=await ut();if(!n)return!0;let r=dt(n),i=t.filter(e=>r.has(e));return i.length===0?!0:await K(G([`bun`,`pm`,`-g`,`trust`,...i]))===0}async function ut(){try{let e=Bun.spawn([`bun`,`pm`,`-g`,`untrusted`],{stdio:ft()}),t=await new Response(e.stdout).text();return await e.exited,e.exitCode===0?t:void 0}catch{return}}function dt(e){let t=new Set;for(let n of e.split(`
|
|
4
|
-
`)){let e=n.match(/^\.\/node_modules\/(.+?) @/);e?.[1]&&t.add(e[1])}return t}function ft(){return[`ignore`,`pipe`,`ignore`]}const pt={source:`bun`,canHandle:e=>e.installSource===`bun`,getRecoveryHint:e=>`bun add -g ${O}@${e.updateChannel===`beta`?`beta`:`latest`}`,async upgrade(e){let t=await at(O,e.updateChannel===`beta`?`beta`:`latest`,e.managedRegistry);return{error:t?void 0:{kind:`unknown`,message:`Failed to update ${O} through Bun.`},installSource:e.installSource,newVersion:t?e.latestVersion:void 0,success:t}}};async function J(e,t,n){try{let r=t?`${e}@${t}`:e,i=S(n);return await K(G([`npm`,`install`,`-g`,r,...i?[`--registry`,i]:[]]))===0}catch{return!1}}async function mt(e,t=`latest-major`,n=`latest`,r){try{let i=S(r);return await K(G(t===`latest-major`?[`npm`,`install`,`-g`,`${e}@${n}`,...i?[`--registry`,i]:[]]:[`npm`,`update`,`-g`,e,...i?[`--registry`,i]:[]]))===0}catch{return!1}}async function ht(e,t=`latest-major`){if(e.length===0)return!0;try{return await K(G(t===`latest-major`?[`npm`,`install`,`-g`,...e.map(e=>`${e}@latest`)]:[`npm`,`update`,`-g`,...e]))===0}catch{return!1}}async function gt(e){try{return await K(G([`npm`,`uninstall`,`-g`,e]))===0}catch{return!1}}const _t={source:`npm`,canHandle:e=>e.installSource===`npm`,getRecoveryHint:e=>`npm install -g ${O}@${e.updateChannel===`beta`?`beta`:`latest`}`,async upgrade(e){let t=await J(O,e.updateChannel===`beta`?`beta`:`latest`,e.managedRegistry);return{error:t?void 0:{kind:`unknown`,message:`Failed to update ${O} through npm.`},installSource:e.installSource,newVersion:t?e.latestVersion:void 0,success:t}}},vt={source:`source`,canHandle:e=>e.installSource===`source`||e.installSource===`unknown`,getRecoveryHint:()=>void 0,async upgrade(e){return{error:{kind:`unsupported`,message:`Install source "${e.installSource}" does not support auto-update.`},installSource:e.installSource,success:!1}}},yt=[pt,_t,rt,vt];function Y(e){return yt.find(t=>t.canHandle(e))??vt}function bt(e,t,n=`stable`){return Y({canAutoUpdate:e===`binary`||e===`bun`||e===`npm`,currentVersion:``,executablePath:t,installSource:e,packageRoot:``,updateChannel:n})}function xt(e,t,n=`stable`,r){return r?.error?.kind===`locked`?`another qtx upgrade is already running; wait for it to finish and retry`:bt(e,t,n).getRecoveryHint({canAutoUpdate:e===`binary`||e===`bun`||e===`npm`,currentVersion:``,executablePath:t,installSource:e,packageRoot:``,updateChannel:n},r)}function St(e,t){return t?.error?.kind===`locked`?`another qtx upgrade is already running; wait for it to finish and retry`:Y(e).getRecoveryHint(e,t)}async function Ct(e,t,r=n.env,i=n.cwd()){if(e!==`bun`&&e!==`npm`)return;let a=S(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 wt(e,r,i)||{isOverride:!1,registry:x,source:`fallback`}}async function wt(e,t,n){if(e===`bun`){let e=Tt(t,[`BUN_CONFIG_REGISTRY`,`NPM_CONFIG_REGISTRY`,`npm_config_registry`]);if(e)return{isOverride:!1,registry:e,source:`bun-env`};let r=await Et(n,t);if(r)return{isOverride:!1,registry:r,source:`bunfig`}}let r=Tt(t,[`NPM_CONFIG_REGISTRY`,`npm_config_registry`]);if(r)return{isOverride:!1,registry:r,source:`npm-env`};let i=await Ot(n,t);if(i)return{isOverride:!1,registry:i,source:`npmrc`}}function Tt(e,t){for(let n of t){let t=S(e[n]);if(t)return t}}async function Et(e,t){let n=jt(t),r=t.XDG_CONFIG_HOME,i=At(e,`bunfig.toml`),a=[m(n,`.bunfig.toml`),r?m(r,`.bunfig.toml`):void 0];if(i){let e=await Dt(i);if(e)return e}for(let e of a){if(!e||!_(e))continue;let t=await Dt(e);if(t)return t}}async function Dt(e){try{let t=Bun.TOML.parse(await o(e,`utf8`)).install?.registry;return S(typeof t==`string`?t:t?.url)}catch{return}}async function Ot(e,t){let n=jt(t),r=At(e,`.npmrc`),i=m(n,`.npmrc`);if(r){let e=await kt(r);if(e)return e}if(_(i))return kt(i)}async function kt(e){try{let t=(await o(e,`utf8`)).split(`
|
|
5
|
-
`).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=S(r[1]);if(i)return i}}catch{}}function At(e,t){let n=e;for(;;){let e=m(n,t);if(_(e))return e;let r=p(n);if(r===n)return;n=r}}function jt(e){return e.HOME||e.USERPROFILE||g()}const X=O,Mt=`/node_modules/${X}`;async function Nt(e){let t=await It(),r=n.execPath,i=t.foundPackageJson?Q(t.packageRoot):Q(``,r),a=await Ft((await P()).installSource,i),o=await E(),s=Ze(e?.updateChannel,o.selfUpdateChannel),c=await Rt(a,r,s,o);return{canAutoUpdate:Z(a),currentVersion:t.version||`0.12.0`,executablePath:r,installSource:a,latestVersion:c.installableLatestVersion,managedRegistry:c.managedRegistry,managedRegistryIsOverride:c.managedRegistryIsOverride,packageRoot:t.packageRoot,recommendedUpgradeCommand:Z(a)?`quantex upgrade`:void 0,upstreamLatestVersion:c.upstreamLatestVersion,updateChannel:s}}async function Pt(e){let t=e??await Nt(),n=await Ve();if(!n)return{error:{kind:`locked`,message:`Another qtx upgrade is already running.`},installSource:t.installSource,success:!1};try{return zt(t,await Y(t).upgrade(t))}finally{await n()}}function Z(e){return e===`binary`||e===`bun`||e===`npm`}async function Ft(e,t){return t!==`unknown`&&e!==t?(await Oe(t),t):e??t}function Q(e,t=n.execPath){let r=Vt(e);return r.includes(`/.bun/install/global/`)?`bun`:r.includes(Mt)?`npm`:r?`source`:Ht(t)?`binary`:`unknown`}async function It(e=import.meta.url){let t=Ut(e),n=p(t);for(;;){let e=m(n,`package.json`),t=await Bt(e);if(t?.name===X)return{foundPackageJson:!0,packageJsonPath:e,packageRoot:n,version:t.version??`0.12.0`};let r=p(n);if(r===n)break;n=r}return{foundPackageJson:!1,packageJsonPath:m(p(t),`package.json`),packageRoot:p(t),version:ye}}function $(){return ye}function Lt(e,t=n.execPath){return xt(e,t)}async function Rt(e,t,n,r){if(e===`binary`)try{let e=await Qe(n);return{installableLatestVersion:tt(e,t)?e.version:void 0}}catch{return{}}let i=n===`beta`?`beta`:`latest`,a=await z(X,i,{registry:x});if(e===`bun`||e===`npm`){let t=await Ct(e,r);return{installableLatestVersion:await z(X,i,{registry:t?.registry}),managedRegistry:t?.registry,managedRegistryIsOverride:t?.isOverride??!1,upstreamLatestVersion:a}}return{installableLatestVersion:a,upstreamLatestVersion:a}}async function zt(e,t){if(!t.success||e.installSource!==`bun`&&e.installSource!==`npm`)return t;let n=await R(e.executablePath);if(!n)return{error:{kind:`verify`,message:`Managed self-upgrade finished but Quantex could not verify the installed version afterwards.`},installSource:e.installSource,success:!1};let r=t.newVersion??e.latestVersion;return r&&n!==r?{error:{detail:{expectedVersion:r,observedVersion:n},kind:`verify`,message:`Managed self-upgrade installed version ${n}, but expected ${r}.`},installSource:e.installSource,success:!1}:!r&&n===e.currentVersion?{error:{detail:{observedVersion:n},kind:`verify`,message:`Managed self-upgrade completed without changing the installed Quantex version.`},installSource:e.installSource,success:!1}:{...t,newVersion:n}}async function Bt(e){try{return JSON.parse(await o(e,`utf8`))}catch{return}}function Vt(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function Ht(e){let t=f(Vt(e));return t!==`bun`&&t!==`bun.exe`}function Ut(e){try{return h(e)}catch{return n.execPath}}function Wt(e){return Jt({...e,error:null,ok:!0})}function Gt(e){return Jt({...e,ok:!1})}function Kt(e,t,n={}){let r=b();return r.cancelled&&!n.force||(r.outputMode===`json`?console.log(JSON.stringify(e,null,2)):r.outputMode===`ndjson`?Xt({action:e.action,data:e,target:e.target,type:`result`}):t(e)),e}function qt(e,t={}){let n=b();if(!(n.cancelled&&!t.force)&&n.outputMode===`ndjson`)return Xt(e)}function Jt(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:$()},ok:e.ok,target:e.target,warnings:e.warnings??[]}}function Yt(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:$()},target:e.target,type:e.type}}function Xt(e){let t=Yt(e);return console.log(JSON.stringify(t)),t}function Zt(){let e=b().colorMode??`auto`;return te(e===`always`?!0:e===`never`?!1:ne)}const Qt=new Proxy({},{get(e,t){let n=Zt(),r=n[t];return typeof r==`function`?r.bind(n):r}});export{Te as A,O as B,K as C,R as D,ze as E,we as F,ge as G,T as H,Ee as I,ce as J,C as K,Oe as L,M,N,z as O,De as P,ie as Q,A as R,G as S,W as T,he as U,w as V,E as W,ae as X,b as Y,oe as Z,ht as _,Kt as a,ot as b,Lt as c,Pt as d,xt as f,mt as g,gt as h,qt as i,P as j,Be as k,$ as l,J as m,Gt as n,Z as o,St as p,S as q,Wt as r,Q as s,Qt as t,Nt as u,at as v,U as w,st as x,ct as y,Se as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./commands-BZ2XInF6.mjs";export{e as commandsCommand};
|
package/dist/detect-BD2Ph-sr.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:process";function t(e){return{packageName:e,type:`bun`}}function n(e){return{packageName:e,type:`npm`}}function r(e,t){return{packageName:e,packageTargetKind:t,type:`brew`}}function i(e){return{packageName:e,packageTargetKind:`id`,type:`winget`}}function a(e){return{command:e,type:`script`}}function o(e){return{command:e,type:`binary`}}const s={name:`amp`,displayName:`Amp`,homepage:`https://ampcode.com/`,packages:{npm:`@sourcegraph/amp`},binaryName:`amp`,selfUpdate:{command:[`amp`,`update`]},versionProbe:{command:[`amp`,`version`]},platforms:{windows:[t(),n()],macos:[t(),n()],linux:[t(),n()]}},c={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:[t(),n()],linux:[t(),n()]}},l={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:[a(`iwr -useb https://autohand.ai/install.ps1 | iex`)],macos:[a(`curl -fsSL https://autohand.ai/install.sh | bash`)],linux:[a(`curl -fsSL https://autohand.ai/install.sh | bash`)]}},u={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:[t(),n(),a(`irm https://claude.ai/install.ps1 | iex`),i(`Anthropic.ClaudeCode`)],macos:[t(),n(),a(`curl -fsSL https://claude.ai/install.sh | bash`),r(`claude-code`,`cask`)],linux:[t(),n(),a(`curl -fsSL https://claude.ai/install.sh | bash`),r(`claude-code`,`cask`)]}},d={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:[t(),n(),a(`irm https://www.codebuddy.cn/cli/install.ps1 | iex`)],macos:[t(),n(),a(`curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash`),r(`Tencent-CodeBuddy/tap/codebuddy-code`)],linux:[t(),n(),a(`curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash`),r(`Tencent-CodeBuddy/tap/codebuddy-code`)]}},f={name:`codex`,displayName:`Codex CLI`,homepage:`https://developers.openai.com/codex/cli`,packages:{npm:`@openai/codex`},binaryName:`codex`,selfUpdate:{command:[`codex`,`--upgrade`]},platforms:{windows:[t(),n()],macos:[t(),n(),r(`codex`)],linux:[t(),n(),r(`codex`)]}},p={name:`copilot`,displayName:`GitHub Copilot CLI`,homepage:`https://github.com/features/copilot/cli`,packages:{npm:`@github/copilot`},binaryName:`copilot`,platforms:{windows:[i(`GitHub.Copilot`)],macos:[t(),n(),a(`curl -fsSL https://gh.io/copilot-install | bash`),r(`copilot-cli`)],linux:[t(),n(),a(`curl -fsSL https://gh.io/copilot-install | bash`),r(`copilot-cli`)]}},m={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:[t(),n(),i(`charmbracelet.crush`)],macos:[t(),n(),r(`charmbracelet/tap/crush`)],linux:[t(),n(),r(`charmbracelet/tap/crush`)]}},h={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:[a(`irm 'https://cursor.com/install?win32=true' | iex`)],macos:[a(`curl https://cursor.com/install -fsS | bash`)],linux:[a(`curl https://cursor.com/install -fsS | bash`)]}},g={name:`devin`,displayName:`Devin for Terminal`,homepage:`https://cli.devin.ai/`,binaryName:`devin`,selfUpdate:{command:[`devin`,`update`]},versionProbe:{command:[`devin`,`version`]},platforms:{windows:[a(`irm https://static.devin.ai/cli/setup.ps1 | iex`)],macos:[a(`curl -fsSL https://cli.devin.ai/install.sh | bash`)],linux:[a(`curl -fsSL https://cli.devin.ai/install.sh | bash`)]}},_={name:`droid`,displayName:`Droid`,homepage:`https://docs.factory.ai/cli/getting-started/overview`,packages:{npm:`droid`},binaryName:`droid`,selfUpdate:{command:[`droid`,`update`]},platforms:{windows:[t(),n(),a(`irm https://app.factory.ai/cli/windows | iex`)],macos:[t(),n(),a(`curl -fsSL https://app.factory.ai/cli | sh`),r(`droid`,`cask`)],linux:[t(),n(),a(`curl -fsSL https://app.factory.ai/cli | sh`),r(`droid`,`cask`)]}},v={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:[t(),n(),a(`irm https://forgecode.dev/cli | iex`)],macos:[t(),n(),a(`curl -fsSL https://forgecode.dev/cli | sh`)],linux:[t(),n(),a(`curl -fsSL https://forgecode.dev/cli | sh`)]}},y={name:`gemini`,displayName:`Gemini CLI`,homepage:`https://google-gemini.github.io/gemini-cli/docs/`,packages:{npm:`@google/gemini-cli`},binaryName:`gemini`,platforms:{windows:[t(),n()],macos:[t(),n(),r(`gemini-cli`)],linux:[t(),n(),r(`gemini-cli`)]}},b={name:`goose`,displayName:`Goose`,homepage:`https://github.com/aaif-goose/goose`,binaryName:`goose`,selfUpdate:{command:[`goose`,`update`]},versionProbe:{command:[`goose`,`--version`]},platforms:{windows:[a(`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`),a(`Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aaif-goose/goose/main/download_cli.ps1" -OutFile "download_cli.ps1"; ./download_cli.ps1`)],macos:[a(`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`),r(`block-goose-cli`)],linux:[a(`curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash`),r(`block-goose-cli`)]}},x={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:[t(),n(),a(`iex (irm 'https://junie.jetbrains.com/install.ps1')`)],macos:[t(),n(),a(`curl -fsSL https://junie.jetbrains.com/install.sh | bash`),r(`jetbrains-junie/junie/junie`)],linux:[t(),n(),a(`curl -fsSL https://junie.jetbrains.com/install.sh | bash`),r(`jetbrains-junie/junie/junie`)]}},S={name:`kilo`,displayName:`Kilo CLI`,homepage:`https://kilo.ai/docs/cli`,packages:{npm:`@kilocode/cli`},binaryName:`kilo`,selfUpdate:{command:[`kilo`,`upgrade`]},platforms:{windows:[t(),n()],macos:[t(),n()],linux:[t(),n()]}},C={name:`kimi`,lookupAliases:[`kimi-code`,`kimi-cli`],displayName:`Kimi Code`,homepage:`https://moonshotai.github.io/kimi-cli/`,binaryName:`kimi`,selfUpdate:{command:[`uv`,`tool`,`upgrade`,`kimi-cli`,`--no-cache`]},versionProbe:{command:[`kimi`,`--version`]},platforms:{windows:[a(`irm https://code.kimi.com/install.ps1 | iex`)],macos:[a(`curl -LsSf https://code.kimi.com/install.sh | bash`)],linux:[a(`curl -LsSf https://code.kimi.com/install.sh | bash`)]}},w={name:`kiro`,lookupAliases:[`kiro-cli`],displayName:`Kiro CLI`,homepage:`https://kiro.dev/cli/`,binaryName:`kiro-cli`,versionProbe:{command:[`kiro-cli`,`--version`]},platforms:{windows:[a(`irm 'https://cli.kiro.dev/install.ps1' | iex`)],macos:[a(`curl -fsSL https://cli.kiro.dev/install | bash`)],linux:[a(`curl -fsSL https://cli.kiro.dev/install | bash`)]}},T={name:`opencode`,displayName:`OpenCode`,homepage:`https://opencode.ai`,packages:{npm:`opencode-ai`},binaryName:`opencode`,selfUpdate:{command:[`opencode`,`upgrade`]},platforms:{windows:[t(),n()],macos:[t(),n(),a(`curl -fsSL https://opencode.ai/install | bash`),r(`anomalyco/tap/opencode`)],linux:[t(),n(),a(`curl -fsSL https://opencode.ai/install | bash`),r(`anomalyco/tap/opencode`)]}},E={name:`openhands`,displayName:`OpenHands CLI`,homepage:`https://docs.openhands.dev/openhands/usage/cli/installation`,binaryName:`openhands`,selfUpdate:{command:[`uv`,`tool`,`upgrade`,`openhands`,`--python`,`3.12`]},versionProbe:{command:[`openhands`,`--version`]},platforms:{macos:[o(`uv tool install openhands --python 3.12`),a(`curl -fsSL https://install.openhands.dev/install.sh | sh`)],linux:[o(`uv tool install openhands --python 3.12`),a(`curl -fsSL https://install.openhands.dev/install.sh | sh`)]}},D={name:`pi`,displayName:`Pi`,homepage:`https://pi.dev`,packages:{npm:`@mariozechner/pi-coding-agent`},binaryName:`pi`,selfUpdate:{command:[`pi`,`update`]},platforms:{windows:[t(),n()],macos:[t(),n()],linux:[t(),n()]}},O={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:[t(),n()],macos:[t(),n(),a(`curl -fsSL https://qoder.com/install | bash`),r(`qoderai/qoder/qodercli`,`cask`)],linux:[t(),n(),a(`curl -fsSL https://qoder.com/install | bash`),r(`qoderai/qoder/qodercli`,`cask`)]}},k={name:`qwen`,displayName:`Qwen Code`,homepage:`https://qwenlm.github.io/qwen-code-docs/`,packages:{npm:`@qwen-code/qwen-code`},binaryName:`qwen`,platforms:{windows:[a(`curl -fsSL -o %TEMP%\\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\\install-qwen.bat`),t(),n()],macos:[a(`curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash`),t(),n(),r(`qwen-code`)],linux:[a(`curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash`),t(),n(),r(`qwen-code`)]}},A={name:`vibe`,lookupAliases:[`mistral-vibe`],displayName:`Mistral Vibe`,homepage:`https://docs.mistral.ai/mistral-vibe/terminal/install`,binaryName:`vibe`,versionProbe:{command:[`vibe`,`--version`]},platforms:{windows:[o(`uv tool install mistral-vibe`),o(`pip install mistral-vibe`)],macos:[a(`curl -LsSf https://mistral.ai/vibe/install.sh | bash`),o(`uv tool install mistral-vibe`),o(`pip install mistral-vibe`)],linux:[a(`curl -LsSf https://mistral.ai/vibe/install.sh | bash`),o(`uv tool install mistral-vibe`),o(`pip install mistral-vibe`)]}},j=[c,l,s,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,E,T,D,O,k,A];function M(){return j}function N(e){return j.find(t=>t.name===e||(t.lookupAliases?.includes(e)??!1))}function P(e){return N(e)}function F(){switch(e.platform){case`win32`:return`windows`;case`darwin`:return`macos`;default:return`linux`}}async function I(e){try{let t=Bun.spawn([e,`--version`],{stdout:`pipe`,stderr:`pipe`});return await t.exited,t.exitCode===0}catch{return!1}}async function L(){return I(`bun`)}async function R(){return I(`npm`)}async function z(){return I(`brew`)}async function B(){return I(`winget`)}async function V(t){try{let n=e.platform===`win32`?`where`:`which`,r=Bun.spawn([n,t],{stdout:`pipe`,stderr:`pipe`});return await r.exited,r.exitCode===0}catch{return!1}}export{d as C,f as S,l as T,y as _,R as a,h as b,P as c,O as d,D as f,x as g,S as h,L as i,M as l,T as m,V as n,B as o,E as p,z as r,N as s,F as t,A as u,_ as v,u as w,p as x,g as y};
|
package/dist/ensure-BJTVMieD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ensure-BhO96BrF.mjs";export{e as ensureCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./inspect-CLah6J00.mjs";export{e as inspectCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./resolve-DVFN04ba.mjs";export{e as resolveCommand};
|
package/dist/schema-nm2KIL1F.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./schema-ZZ76v7eB.mjs";export{e as schemaCommand};
|