quantex-cli 0.0.1-beta.12 → 0.0.1-beta.13

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/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{F as e,r as t,s as n}from"./agents-BqvXaaby.mjs";import r from"node:process";import{program as i}from"commander";import a from"picocolors";import o from"prompts";async function s(e,r){let i=await t(e);if(!i)return console.log(a.red(`Unknown agent: ${e}`)),1;let{agent:s,inspection:c}=i;if(!c.inPath){if(!(await o({type:`confirm`,name:`install`,message:`${s.displayName} is not installed. Would you like to install it?`,initial:!0})).install)return console.log(a.yellow(`Installation cancelled.`)),1;if(console.log(a.cyan(`Installing ${s.displayName}...`)),!(await n(s)).success)return console.log(a.red(`Failed to install ${s.displayName}.`)),1}try{let e=Bun.spawn([s.binaryName,...r],{stdio:[`inherit`,`inherit`,`inherit`]});return await e.exited,e.exitCode??1}catch(e){return console.log(a.red(`Failed to launch ${s.displayName}: ${e instanceof Error?e.message:String(e)}`)),1}}const c=await Bun.file(new URL(`../package.json`,import.meta.url)).json();i.name(`quantex`).description(`统一的 AI Agent CLI 管理工具`).version(c.version??`0.0.0`),i.command(`install <agent>`).alias(`i`).description(`安装指定 agent`).action(async e=>{let{installCommand:t}=await import(`./install-ByqdsmAY.mjs`);await t(e)}),i.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-TSJ4YzC3.mjs`);await n(e,t.all??!1)}),i.command(`uninstall <agent>`).alias(`rm`).description(`卸载指定 agent`).action(async e=>{let{uninstallCommand:t}=await import(`./uninstall-BpsxhLQc.mjs`);await t(e)}),i.command(`list`).alias(`ls`).description(`列出所有支持的 agent`).action(async()=>{let{listCommand:e}=await import(`./list-DS5QVFaG.mjs`);await e()}),i.command(`info <agent>`).description(`查看 agent 详细信息`).action(async e=>{let{infoCommand:t}=await import(`./info-DFse72tT.mjs`);await t(e)}),i.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-BlsH3y9N.mjs`);await r(e,t,n)}),i.command(`upgrade`).description(`升级 Quantex CLI`).action(async()=>{let{upgradeCommand:e}=await import(`./upgrade-OYkZNkGN.mjs`);await e()}),i.command(`doctor`).description(`检查环境`).action(async()=>{let{doctorCommand:e}=await import(`./doctor-CgwVG6BK.mjs`);await e()});const l=r.argv[2],u=new Set([...i.commands.map(e=>e.name()),...i.commands.flatMap(e=>e.aliases()),`help`,`--help`,`--version`,`-v`]);if(l&&!l.startsWith(`-`)&&!u.has(l)&&e(l)){let e=await s(l,r.argv.slice(3));r.exit(e)}i.parse();export{};
2
+ import{F as e,r as t,s as n}from"./agents-BqvXaaby.mjs";import{o as r}from"./self-CU98LNZr.mjs";import i from"node:process";import{program as a}from"commander";import o from"picocolors";import s from"prompts";async function c(e,r){let i=await t(e);if(!i)return console.log(o.red(`Unknown agent: ${e}`)),1;let{agent:a,inspection:c}=i;if(!c.inPath){if(!(await s({type:`confirm`,name:`install`,message:`${a.displayName} is not installed. Would you like to install it?`,initial:!0})).install)return console.log(o.yellow(`Installation cancelled.`)),1;if(console.log(o.cyan(`Installing ${a.displayName}...`)),!(await n(a)).success)return console.log(o.red(`Failed to install ${a.displayName}.`)),1}try{let e=Bun.spawn([a.binaryName,...r],{stdio:[`inherit`,`inherit`,`inherit`]});return await e.exited,e.exitCode??1}catch(e){return console.log(o.red(`Failed to launch ${a.displayName}: ${e instanceof Error?e.message:String(e)}`)),1}}a.name(`quantex`).description(`统一的 AI Agent CLI 管理工具`).version(r()),a.command(`install <agent>`).alias(`i`).description(`安装指定 agent`).action(async e=>{let{installCommand:t}=await import(`./install-ByqdsmAY.mjs`);await t(e)}),a.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-TSJ4YzC3.mjs`);await n(e,t.all??!1)}),a.command(`uninstall <agent>`).alias(`rm`).description(`卸载指定 agent`).action(async e=>{let{uninstallCommand:t}=await import(`./uninstall-BpsxhLQc.mjs`);await t(e)}),a.command(`list`).alias(`ls`).description(`列出所有支持的 agent`).action(async()=>{let{listCommand:e}=await import(`./list-DS5QVFaG.mjs`);await e()}),a.command(`info <agent>`).description(`查看 agent 详细信息`).action(async e=>{let{infoCommand:t}=await import(`./info-DFse72tT.mjs`);await t(e)}),a.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-BlsH3y9N.mjs`);await r(e,t,n)}),a.command(`upgrade`).description(`升级 Quantex CLI`).action(async()=>{let{upgradeCommand:e}=await import(`./upgrade-BvKUmR-O.mjs`);await e()}),a.command(`doctor`).description(`检查环境`).action(async()=>{let{doctorCommand:e}=await import(`./doctor-BzcBAwHA.mjs`);await e()});const l=i.argv[2],u=new Set([...a.commands.map(e=>e.name()),...a.commands.flatMap(e=>e.aliases()),`help`,`--help`,`--version`,`-v`]);if(l&&!l.startsWith(`-`)&&!u.has(l)&&e(l)){let e=await c(l,i.argv.slice(3));i.exit(e)}a.parse();export{};
@@ -0,0 +1,3 @@
1
+ import{D as e,E as t,T as n,t as r,w as i}from"./agents-BqvXaaby.mjs";import{a,s as o}from"./self-CU98LNZr.mjs";import s from"picocolors";async function c(){console.log(s.bold(`
2
+ Quantex CLI Environment Check
3
+ `)),console.log(s.bold(`Managed Installers:`));let c=await n();console.log(` Bun: ${c?s.green(`available`):s.red(`not found`)}`);let l=await t();console.log(` npm: ${l?s.green(`available`):s.red(`not found`)}`);let u=await i();console.log(` brew: ${u?s.green(`available`):s.red(`not found`)}`);let d=await e();console.log(` winget:${d?s.green(`available`):s.red(`not found`)}`);let f=await o(),p=f.latestVersion&&f.latestVersion!==f.currentVersion;if(console.log(`\n${s.bold(`Quantex CLI:`)}`),console.log(` Version: ${f.currentVersion}`),console.log(` Source: ${f.installSource}`),console.log(` Auto-update: ${f.canAutoUpdate?s.green(`supported`):s.yellow(`unsupported`)}`),f.latestVersion&&console.log(` Latest: ${f.latestVersion}${p?s.yellow(` (update available)`):``}`),p){let e=a(f.installSource,f.executablePath);e&&console.log(` Recovery: ${e}`)}console.log(`\n${s.bold(`Installed Agents:`)}`);let m=await r(),h=!1;for(let e of m)if(e.inPath){h=!0;let t=e.installedVersion&&e.latestVersion&&e.installedVersion!==e.latestVersion;console.log(` ${e.agent.displayName}: ${e.installedVersion??`unknown`} [${e.lifecycle}; ${e.sourceLabel}]${t?s.yellow(` (update available: ${e.latestVersion})`):``}`)}h||console.log(s.dim(` No agents installed`)),console.log(`\n${s.bold(`Issues:`)}`);let g=[];if(!c&&!l&&!u&&!d&&g.push(`No managed installer found. Install bun, npm, brew, or winget.`),g.length===0)console.log(s.green(` No issues found.`));else for(let e of g)console.log(s.yellow(` - ${e}`));console.log()}export{c as doctorCommand};
package/dist/index.d.mts CHANGED
@@ -175,10 +175,11 @@ declare function createUpdatePlan(inspections: AgentInspection[]): UpdatePlan;
175
175
  declare function isInspectionUpdateAvailable(inspection: Pick<AgentInspection, 'installedVersion' | 'latestVersion'>): boolean;
176
176
  //#endregion
177
177
  //#region src/self/index.d.ts
178
- type SelfInstallSource = 'bun' | 'npm' | 'source' | 'unknown';
178
+ type SelfInstallSource = 'binary' | 'bun' | 'npm' | 'source' | 'unknown';
179
179
  interface SelfInspection {
180
180
  canAutoUpdate: boolean;
181
181
  currentVersion: string;
182
+ executablePath: string;
182
183
  installSource: SelfInstallSource;
183
184
  latestVersion?: string;
184
185
  packageRoot: string;
@@ -191,7 +192,11 @@ interface SelfUpdateResult {
191
192
  declare function inspectSelf(): Promise<SelfInspection>;
192
193
  declare function upgradeSelf(inspection?: SelfInspection): Promise<SelfUpdateResult>;
193
194
  declare function canAutoUpdateSelf(installSource: SelfInstallSource): boolean;
194
- declare function detectSelfInstallSource(packageRoot: string): SelfInstallSource;
195
+ declare function detectSelfInstallSource(packageRoot: string, executablePath?: string): SelfInstallSource;
196
+ declare function getSelfVersion(): string;
197
+ declare function getManualSelfUpgradeCommand(installSource: SelfInstallSource, executablePath?: string): string | undefined;
198
+ declare function getBinaryReleaseAssetName(executablePath?: string): string | undefined;
199
+ declare function getBinaryReleaseDownloadUrl(executablePath?: string): string | undefined;
195
200
  //#endregion
196
201
  //#region src/services/agents.d.ts
197
202
  interface ResolvedAgentInspection {
@@ -245,4 +250,4 @@ declare function getInstalledVersion(binaryName: string): Promise<string | undef
245
250
  declare function getLatestVersion(packageName: string): Promise<string | undefined>;
246
251
  declare function getBinaryPath(binaryName: string): Promise<string | undefined>;
247
252
  //#endregion
248
- export { type AgentDefinition, type AgentInspection, type AgentOperationResult, type AgentPackageMetadata, type AgentSelfUpdate, type BinaryInstallMethod, type InstallMethod, type InstallType, type InstalledAgentState, type ManagedInstallMethod, type ManagedInstallType, type ManagedInstaller, type ManagedPackageSpec, type ManagedUpdateBucket, type PackageTargetKind, type PendingAgentUpdate, type PlannedAgentUpdates, type Platform, type QuantexConfig, type QuantexState, type ResolvedAgentInspection, type ScriptInstallMethod, type SelfInspection, type SelfInstallSource, type SelfUpdateResult, type SingleAgentUpdateStatus, type UpdatePlan, type UpdatePlanEntry, canAutoUpdateSelf, canLookupLatestVersionForInstallType, canUninstallInstallType, canUpdateInstallType, claude, codex, copilot, createUpdatePlan, cursor, detectSelfInstallSource, droid, execCommand, gemini, getAgentByLookupName, getAgentByNameOrAlias, getAllAgents, getBinaryPath, getConfigDir, getConfigFilePath, getInstallLifecycle, getInstalledAgentState, getInstalledVersion, getInstallerCapabilities, getLatestVersion, getManagedInstaller, getOrderedInstallMethods, getPlatform, getSingleAgentUpdateStatus, getStateFilePath, inspectAgent, inspectAllAgents, inspectRegisteredAgents, inspectSelf, installAgent, isBinaryInPath, isBunAvailable, isInspectionUpdateAvailable, isManagedInstallType, isNpmAvailable, loadConfig, loadState, opencode, pi, planAgentUpdates, removeInstalledAgentState, resolveAgent, resolveAgentInspection, saveConfig, saveState, setInstalledAgentState, uninstallAgent, updateAgent, updateAgentsByType, upgradeSelf };
253
+ export { type AgentDefinition, type AgentInspection, type AgentOperationResult, type AgentPackageMetadata, type AgentSelfUpdate, type BinaryInstallMethod, type InstallMethod, type InstallType, type InstalledAgentState, type ManagedInstallMethod, type ManagedInstallType, type ManagedInstaller, type ManagedPackageSpec, type ManagedUpdateBucket, type PackageTargetKind, type PendingAgentUpdate, type PlannedAgentUpdates, type Platform, type QuantexConfig, type QuantexState, type ResolvedAgentInspection, type ScriptInstallMethod, type SelfInspection, type SelfInstallSource, type SelfUpdateResult, type SingleAgentUpdateStatus, type UpdatePlan, type UpdatePlanEntry, canAutoUpdateSelf, canLookupLatestVersionForInstallType, canUninstallInstallType, canUpdateInstallType, claude, codex, copilot, createUpdatePlan, cursor, detectSelfInstallSource, droid, execCommand, gemini, getAgentByLookupName, getAgentByNameOrAlias, getAllAgents, getBinaryPath, getBinaryReleaseAssetName, getBinaryReleaseDownloadUrl, getConfigDir, getConfigFilePath, getInstallLifecycle, getInstalledAgentState, getInstalledVersion, getInstallerCapabilities, getLatestVersion, getManagedInstaller, getManualSelfUpgradeCommand, getOrderedInstallMethods, getPlatform, getSelfVersion, getSingleAgentUpdateStatus, getStateFilePath, inspectAgent, inspectAllAgents, inspectRegisteredAgents, inspectSelf, installAgent, isBinaryInPath, isBunAvailable, isInspectionUpdateAvailable, isManagedInstallType, isNpmAvailable, loadConfig, loadState, opencode, pi, planAgentUpdates, removeInstalledAgentState, resolveAgent, resolveAgentInspection, saveConfig, saveState, setInstalledAgentState, uninstallAgent, updateAgent, updateAgentsByType, upgradeSelf };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{A as e,B as t,C as n,E as r,F as i,H as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as p,T as m,U as h,V as g,W as _,_ as v,a as y,b,c as x,d as S,g as C,i as w,j as T,k as E,l as D,n as O,o as k,r as A,s as j,t as M,u as N,v as P,x as F,y as I,z as L}from"./agents-BqvXaaby.mjs";import{a as R,i as z,n as B,t as V}from"./config-B8_x29hh.mjs";import{n as H,r as U,t as W}from"./version-D1hlVnnS.mjs";import{i as G,n as K,r as q,t as J}from"./update-1metr7-9.mjs";import{i as Y,n as X,r as Z,t as Q}from"./self-Bt9PJylw.mjs";async function $(e,t){try{let n=Bun.spawn([e,...t],{stdio:[`inherit`,`inherit`,`inherit`]});return await n.exited,{success:n.exitCode===0,exitCode:n.exitCode??1}}catch{return{success:!1,exitCode:1}}}export{Q as canAutoUpdateSelf,C as canLookupLatestVersionForInstallType,v as canUninstallInstallType,P as canUpdateInstallType,_ as claude,h as codex,a as copilot,q as createUpdatePlan,g as cursor,X as detectSelfInstallSource,t as droid,$ as execCommand,L as gemini,d as getAgentByLookupName,i as getAgentByNameOrAlias,o as getAllAgents,W as getBinaryPath,V as getConfigDir,B as getConfigFilePath,I as getInstallLifecycle,u as getInstalledAgentState,H as getInstalledVersion,b as getInstallerCapabilities,U as getLatestVersion,S as getManagedInstaller,k as getOrderedInstallMethods,p as getPlatform,J as getSingleAgentUpdateStatus,E as getStateFilePath,w as inspectAgent,y as inspectAllAgents,M as inspectRegisteredAgents,Z as inspectSelf,j as installAgent,n as isBinaryInPath,m as isBunAvailable,G as isInspectionUpdateAvailable,F as isManagedInstallType,r as isNpmAvailable,z as loadConfig,e as loadState,f as opencode,s as pi,K as planAgentUpdates,T as removeInstalledAgentState,O as resolveAgent,A as resolveAgentInspection,R as saveConfig,c as saveState,l as setInstalledAgentState,x as uninstallAgent,D as updateAgent,N as updateAgentsByType,Y as upgradeSelf};
1
+ import{A as e,B as t,C as n,E as r,F as i,H as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as p,T as m,U as h,V as g,W as _,_ as v,a as y,b,c as x,d as S,g as C,i as w,j as T,k as E,l as D,n as ee,o as O,r as k,s as A,t as j,u as M,v as N,x as P,y as F,z as I}from"./agents-BqvXaaby.mjs";import{a as L,i as R,n as z,t as B}from"./config-B8_x29hh.mjs";import{n as V,r as H,t as U}from"./version-D1hlVnnS.mjs";import{i as W,n as G,r as K,t as q}from"./update-1metr7-9.mjs";import{a as J,c as Y,i as X,n as Z,o as Q,r as $,s as te,t as ne}from"./self-CU98LNZr.mjs";async function re(e,t){try{let n=Bun.spawn([e,...t],{stdio:[`inherit`,`inherit`,`inherit`]});return await n.exited,{success:n.exitCode===0,exitCode:n.exitCode??1}}catch{return{success:!1,exitCode:1}}}export{ne as canAutoUpdateSelf,C as canLookupLatestVersionForInstallType,v as canUninstallInstallType,N as canUpdateInstallType,_ as claude,h as codex,a as copilot,K as createUpdatePlan,g as cursor,Z as detectSelfInstallSource,t as droid,re as execCommand,I as gemini,d as getAgentByLookupName,i as getAgentByNameOrAlias,o as getAllAgents,U as getBinaryPath,$ as getBinaryReleaseAssetName,X as getBinaryReleaseDownloadUrl,B as getConfigDir,z as getConfigFilePath,F as getInstallLifecycle,u as getInstalledAgentState,V as getInstalledVersion,b as getInstallerCapabilities,H as getLatestVersion,S as getManagedInstaller,J as getManualSelfUpgradeCommand,O as getOrderedInstallMethods,p as getPlatform,Q as getSelfVersion,q as getSingleAgentUpdateStatus,E as getStateFilePath,w as inspectAgent,y as inspectAllAgents,j as inspectRegisteredAgents,te as inspectSelf,A as installAgent,n as isBinaryInPath,m as isBunAvailable,W as isInspectionUpdateAvailable,P as isManagedInstallType,r as isNpmAvailable,R as loadConfig,e as loadState,f as opencode,s as pi,G as planAgentUpdates,T as removeInstalledAgentState,ee as resolveAgent,k as resolveAgentInspection,L as saveConfig,c as saveState,l as setInstalledAgentState,x as uninstallAgent,D as updateAgent,M as updateAgentsByType,Y as upgradeSelf};
@@ -0,0 +1 @@
1
+ import{o as e,r as t,u as n}from"./version-D1hlVnnS.mjs";import{chmod as r,mkdtemp as i,readFile as a,rename as o,rm as s,stat as c,writeFile as l}from"node:fs/promises";import{basename as u,dirname as d,join as f}from"node:path";import{fileURLToPath as p}from"node:url";import m from"node:process";import{Buffer as h}from"node:buffer";const g=`0.0.1-beta.13`;async function _(e,t){let n=await fetch(e);if(!n.ok)return!1;let a=await i(f(d(t),`.quantex-upgrade-`)),c=f(a,u(t));try{let e=h.from(await n.arrayBuffer()),i=await v(t);return await l(c,e),m.platform===`win32`?y(c,t,a):(await r(c,i),await o(c,t),!0)}catch{return!1}finally{m.platform!==`win32`&&await s(a,{recursive:!0,force:!0})}}async function v(e){try{return(await c(e)).mode&511}catch{return 493}}function y(e,t,n){try{let r=b(e,t,n,m.pid);return Bun.spawn([`powershell.exe`,`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-WindowStyle`,`Hidden`,`-Command`,r],{stdio:[`ignore`,`ignore`,`ignore`],windowsHide:!0}).unref?.(),!0}catch{return!1}}function b(e,t,n,r){let i=x(e),a=x(t),o=x(n);return[`$pidToWait = ${r}`,`$tempPath = '${i}'`,`$targetPath = '${a}'`,`$tempDir = '${o}'`,`while (Get-Process -Id $pidToWait -ErrorAction SilentlyContinue) { Start-Sleep -Milliseconds 200 }`,`for ($attempt = 0; $attempt -lt 50; $attempt++) {`,` try {`,` Remove-Item -LiteralPath $targetPath -Force -ErrorAction Stop`,` break`,` }`,` catch {`,` Start-Sleep -Milliseconds 200`,` }`,`}`,`Move-Item -LiteralPath $tempPath -Destination $targetPath -Force`,`Remove-Item -LiteralPath $tempDir -Force -Recurse -ErrorAction SilentlyContinue`].join(`; `)}function x(e){return e.replaceAll(`'`,`''`)}const S=`quantex-cli`,C=`/node_modules/${S}`;async function w(){let e=await O(),n=await t(S),r=m.execPath,i=D(e.packageRoot,r);return{canAutoUpdate:E(i),currentVersion:e.version||`0.0.1-beta.13`,executablePath:r,installSource:i,latestVersion:n,packageRoot:e.packageRoot,recommendedUpgradeCommand:E(i)?`quantex upgrade`:void 0}}async function T(t){let r=t??await w();if(r.installSource===`bun`)return{installSource:r.installSource,success:await n(S)};if(r.installSource===`npm`)return{installSource:r.installSource,success:await e(S)};if(r.installSource===`binary`){let e=M(r.executablePath);return{installSource:r.installSource,success:e?await _(e,r.executablePath):!1}}return{installSource:r.installSource,success:!1}}function E(e){return e===`binary`||e===`bun`||e===`npm`}function D(e,t=m.execPath){let n=P(e);return n.includes(`/.bun/install/global/`)?`bun`:n.includes(C)?`npm`:F(t)?`binary`:n?`source`:`unknown`}async function O(e=import.meta.url){let t=I(e),n=d(t);for(;;){let e=f(n,`package.json`),t=await N(e);if(t?.name===S)return{packageJsonPath:e,packageRoot:n,version:t.version??`0.0.1-beta.13`};let r=d(n);if(r===n)break;n=r}return{packageJsonPath:f(d(t),`package.json`),packageRoot:d(t),version:g}}function k(){return g}function A(e,t=m.execPath){if(e===`bun`)return`bun add -g ${S}@latest`;if(e===`npm`)return`npm install -g ${S}@latest`;if(e===`binary`){let e=M(t);return e?`download and replace the binary from ${e}`:void 0}}function j(e=m.execPath){if(u(P(e)).endsWith(`.exe`))return`quantex-windows-x64.exe`;if(m.platform===`darwin`)return m.arch===`arm64`?`quantex-darwin-arm64`:`quantex-darwin-x64`;if(m.platform===`linux`)return m.arch===`arm64`?`quantex-linux-arm64`:`quantex-linux-x64`}function M(e=m.execPath){let t=j(e);if(t)return`https://github.com/Drswith/quantex-cli/releases/latest/download/${t}`}async function N(e){try{return JSON.parse(await a(e,`utf8`))}catch{return}}function P(e){return e.replaceAll(`\\`,`/`).toLowerCase()}function F(e){let t=u(P(e));return t!==`bun`&&t!==`bun.exe`}function I(e){try{return p(e)}catch{return m.execPath}}export{A as a,T as c,M as i,D as n,k as o,j as r,w as s,E as t};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,s as n}from"./self-CU98LNZr.mjs";import r from"picocolors";async function i(){let i=await n();if(i.latestVersion&&i.latestVersion===i.currentVersion){console.log(r.green(`Quantex CLI is already up to date (${i.currentVersion}).`));return}if(!i.canAutoUpdate){console.log(r.yellow(`Quantex CLI cannot auto-update from the current install source: ${i.installSource}.`));let t=e(i.installSource,i.executablePath);t&&console.log(r.cyan(`Manual upgrade: ${t}`));return}let a=i.latestVersion?` (${i.currentVersion} -> ${i.latestVersion})`:` (${i.currentVersion})`;if(console.log(r.cyan(`Upgrading Quantex CLI...${a}`)),(await t(i)).success)console.log(r.green(`Quantex CLI upgraded successfully.`));else{console.log(r.red(`Failed to upgrade Quantex CLI.`));let t=e(i.installSource,i.executablePath);t&&console.log(r.cyan(`Manual recovery: ${t}`))}}export{i as upgradeCommand};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quantex-cli",
3
3
  "type": "module",
4
- "version": "0.0.1-beta.12",
4
+ "version": "0.0.1-beta.13",
5
5
  "packageManager": "bun@1.3.11",
6
6
  "description": "统一的 AI Agent CLI 管理工具,支持安装、更新、卸载、查询、快捷启动主流 AI 编程助手",
7
7
  "author": "Drswith <drswith@outlook.com>",
@@ -29,8 +29,9 @@
29
29
  "dist"
30
30
  ],
31
31
  "scripts": {
32
+ "prebuild": "bun run scripts/write-build-metadata.ts",
32
33
  "build": "tsdown",
33
- "build:bin": "bun run scripts/build-bin.ts",
34
+ "build:bin": "bun run scripts/write-build-metadata.ts && bun run scripts/build-bin.ts",
34
35
  "lint:fix": "eslint --fix",
35
36
  "lint": "eslint",
36
37
  "prepublishOnly": "bun run build",
@@ -1,3 +0,0 @@
1
- import{D as e,E as t,T as n,t as r,w as i}from"./agents-BqvXaaby.mjs";import{r as a}from"./self-Bt9PJylw.mjs";import o from"picocolors";async function s(){console.log(o.bold(`
2
- Quantex CLI Environment Check
3
- `)),console.log(o.bold(`Managed Installers:`));let s=await n();console.log(` Bun: ${s?o.green(`available`):o.red(`not found`)}`);let c=await t();console.log(` npm: ${c?o.green(`available`):o.red(`not found`)}`);let l=await i();console.log(` brew: ${l?o.green(`available`):o.red(`not found`)}`);let u=await e();console.log(` winget:${u?o.green(`available`):o.red(`not found`)}`);let d=await a(),f=d.latestVersion&&d.latestVersion!==d.currentVersion;console.log(`\n${o.bold(`Quantex CLI:`)}`),console.log(` Version: ${d.currentVersion}`),console.log(` Source: ${d.installSource}`),console.log(` Auto-update: ${d.canAutoUpdate?o.green(`supported`):o.yellow(`unsupported`)}`),d.latestVersion&&console.log(` Latest: ${d.latestVersion}${f?o.yellow(` (update available)`):``}`),console.log(`\n${o.bold(`Installed Agents:`)}`);let p=await r(),m=!1;for(let e of p)if(e.inPath){m=!0;let t=e.installedVersion&&e.latestVersion&&e.installedVersion!==e.latestVersion;console.log(` ${e.agent.displayName}: ${e.installedVersion??`unknown`} [${e.lifecycle}; ${e.sourceLabel}]${t?o.yellow(` (update available: ${e.latestVersion})`):``}`)}m||console.log(o.dim(` No agents installed`)),console.log(`\n${o.bold(`Issues:`)}`);let h=[];if(!s&&!c&&!l&&!u&&h.push(`No managed installer found. Install bun, npm, brew, or winget.`),h.length===0)console.log(o.green(` No issues found.`));else for(let e of h)console.log(o.yellow(` - ${e}`));console.log()}export{s as doctorCommand};
@@ -1 +0,0 @@
1
- import{o as e,r as t,u as n}from"./version-D1hlVnnS.mjs";import{dirname as r}from"node:path";import{fileURLToPath as i}from"node:url";const a=`quantex-cli`,o=`/node_modules/${a}`;async function s(){let e=f(),n=await d(),r=await t(a),i=u(e);return{canAutoUpdate:l(i),currentVersion:n,installSource:i,latestVersion:r,packageRoot:e,recommendedUpgradeCommand:l(i)?`quantex upgrade`:void 0}}async function c(t){let r=t??await s();return r.installSource===`bun`?{installSource:r.installSource,success:await n(a)}:r.installSource===`npm`?{installSource:r.installSource,success:await e(a)}:{installSource:r.installSource,success:!1}}function l(e){return e===`bun`||e===`npm`}function u(e){let t=p(e);return t.includes(`/.bun/install/global/`)?`bun`:t.includes(o)?`npm`:t?`source`:`unknown`}async function d(){return(await Bun.file(new URL(`../../package.json`,import.meta.url)).json()).version??`0.0.0`}function f(){return r(i(new URL(`../../package.json`,import.meta.url)))}function p(e){return e.replaceAll(`\\`,`/`).toLowerCase()}export{c as i,u as n,s as r,l as t};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./self-Bt9PJylw.mjs";import n from"picocolors";async function r(){let r=await t();if(r.latestVersion&&r.latestVersion===r.currentVersion){console.log(n.green(`Quantex CLI is already up to date (${r.currentVersion}).`));return}if(!r.canAutoUpdate){console.log(n.yellow(`Quantex CLI cannot auto-update from the current install source: ${r.installSource}.`));return}let i=r.latestVersion?` (${r.currentVersion} -> ${r.latestVersion})`:` (${r.currentVersion})`;console.log(n.cyan(`Upgrading Quantex CLI...${i}`)),(await e(r)).success?console.log(n.green(`Quantex CLI upgraded successfully.`)):console.log(n.red(`Failed to upgrade Quantex CLI.`))}export{r as upgradeCommand};