@abacus-ai/cli 1.104.34413 → 1.104.34414

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22,4 +22,4 @@ import{createRequire as sq}from"node:module";var cq=Object.create;var{getPrototy
22
22
  `,u+=d9,this.write(u),this.rl.close()}}class e6 extends Promise{static withResolver(){let D,u;return{promise:new Promise((F,q)=>{D=F,u=q}),resolve:D,reject:u}}}function ZZ(){let D=Error.prepareStackTrace,u=[];try{Error.prepareStackTrace=(_,F)=>{let q=F.slice(1);return u=q,q},Error().stack}catch{return u}return Error.prepareStackTrace=D,u}function D1(D){let u=ZZ();return(F,q={})=>{let{input:$=process.stdin,signal:C}=q,Q=new Set,J=new p9.default;J.pipe(q.output??process.stdout);let K=c9.createInterface({terminal:!0,input:$,output:J}),Z=new z8(K),{promise:V,resolve:B,reject:X}=e6.withResolver(),U=()=>X(new M6);if(C){let S=()=>X(new T6({cause:C.reason}));if(C.aborted)return S(),Object.assign(V,{cancel:U});C.addEventListener("abort",S),Q.add(()=>C.removeEventListener("abort",S))}Q.add(f9((S,a)=>{X(new Y8(`User force closed the prompt with ${S} ${a}`))}));let z=()=>X(new Y8("User force closed the prompt with SIGINT"));K.on("SIGINT",z),Q.add(()=>K.removeListener("SIGINT",z));let j=()=>Z.checkCursorPos();return K.input.on("keypress",j),Q.add(()=>K.input.removeListener("keypress",j)),i5(K,(S)=>{let a=JZ.bind(()=>k0.clearAll());return K.on("close",a),Q.add(()=>K.removeListener("close",a)),S(()=>{try{let m=D(F,(DD)=>{setImmediate(()=>B(DD))});if(m===void 0){let DD=u[1]?.getFileName();throw Error(`Prompt functions must return a string.
23
23
  at ${DD}`)}let[sD,Zu]=typeof m==="string"?[m]:m;Z.render(sD,Zu),k0.run()}catch(m){X(m)}}),Object.assign(V.then((m)=>{return k0.clearAll(),m},(m)=>{throw k0.clearAll(),m}).finally(()=>{Q.forEach((m)=>m()),Z.done({clearContent:Boolean(q.clearPromptOnDone)}),J.end()}).then(()=>V),{cancel:U})})}}function i9(D,u){let _=u!==!1;if(/^(y|yes)/i.test(D))_=!0;else if(/^(n|no)/i.test(D))_=!1;return _}function a9(D){return D?"Yes":"No"}var u1=D1((D,u)=>{let{transformer:_=a9}=D,[F,q]=aD("idle"),[$,C]=aD(""),Q=l2(D.theme),J=S6({status:F,theme:Q});k6((B,X)=>{if(F!=="idle")return;if(w6(B)){let U=i9($,D.default);C(_(U)),q("done"),u(U)}else if(P6(B)){let U=a9(!i9($,D.default));X.clearLine(0),X.write(U),C(U)}else C(X.line)});let K=$,Z="";if(F==="done")K=Q.style.answer($);else Z=` ${Q.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let V=Q.style.message(D.message,F);return`${J} ${V}${Z} ${K}`});var x1=nD(h4(),1);async function g4(D){try{let u=[QD.join(kD.homedir(),kD.platform()==="darwin"?`${D.binName}-${D.version}/${D.appName}.app/Contents/Resources/app`:`${D.binName}-${D.version}`)];if(kD.platform()==="darwin")u.push(`/Applications/${D.appName}.app/Contents/Resources/app`,QD.join(kD.homedir(),`Applications/${D.appName}.app/Contents/Resources/app`));else if(kD.platform()==="win32"){let _=process.env.ProgramFiles||"C:\\Program Files",F=process.env["ProgramFiles(x86)"]||"C:\\Program Files (x86)",q=process.env.LOCALAPPDATA||QD.join(kD.homedir(),"AppData","Local"),$=process.env.APPDATA||QD.join(kD.homedir(),"AppData","Roaming");u.push(QD.join(_,D.appName),QD.join(F,D.appName),QD.join(q,"Programs",D.appName),QD.join($,D.appName))}else u.push(`/usr/share/${D.appName.toLowerCase()}`);return await Promise.any(u.map(async(_)=>{try{let F=JSON.parse(await W1.readFile(QD.join(_,"package.json"),"utf8"));if(!("version"in F)||typeof F.version!=="string"||F.version!==D.version)throw Error(`Invalid version in package.json: ${F.version}`);let q=QD.join(_,"bin",`${D.binName}${kD.platform()==="win32"?".cmd":""}`);if(!b4.existsSync(q))throw Error(`${D.appName} command not found: ${q}`);return q}catch{throw Error(`${D.appName} not found in ${_}`)}}))}catch(u){let _=u instanceof Error?u.message:String(u);if(!_.includes("All promises were rejected"))console.log(`${y.dim}${_}${y.reset}`);console.info(`${y.dim}Could not find installed ${D.appName}${y.reset}`);return}}var _X=new Set(["@abacus-ai/cli","abacusai-cli","@abacus-ai/deepagent","deepagent-cli","@abacus-ai/codellm","codellm-cli"]);async function f4(D,u){try{let _=QD.dirname(D),F=(await W1.readdir(kD.homedir())).filter(($)=>$.startsWith(u.binName)&&!_.includes($)).map(($)=>QD.join(kD.homedir(),$)).filter(($)=>{try{let C=JSON.parse(b4.readFileSync(QD.join($,"package.json"),"utf8"));if(!("name"in C)||typeof C.name!=="string"||!_X.has(C.name))return!1;if(!("version"in C)||typeof C.version!=="string"||!x1.default.valid(C.version)||!x1.default.lt(C.version,u.version))return!1;return!0}catch{return!1}});if(F.length===0)return;if(console.log(`${y.dim}Found old ${u.appName} installations at:
24
24
  ${F.join(`
25
- `)}${y.reset}`),!await u1({message:"Should we remove them?",default:!1}))return;await Promise.all(F.map(async($)=>{try{await W1.rm($,{recursive:!0,force:!0})}catch(C){console.error(`Failed to remove old ${u.appName} installation at '${$}': ${C instanceof Error?C.message:String(C)}`);return}console.log(`${y.dim}Removed old ${u.appName} installation at '${$}'${y.reset}`)}))}catch(_){console.error(_ instanceof Error?_.message:String(_))}}import{execFile as DG}from"child_process";import gq from"process";var hq=nD(Nq(),1);import nY from"os";import Rq from"path";import Ju from"fs";var tY=nY.homedir(),v1=process.env.XDG_CONFIG_HOME||Rq.join(tY,".config","simple-update-notifier"),Eq=(D)=>{return Rq.join(v1,`${D.replace("@","").replace("/","__")}.json`)},vq=()=>{if(!Ju.existsSync(v1))Ju.mkdirSync(v1,{recursive:!0})},Sq=(D)=>{let u=Eq(D);try{if(!Ju.existsSync(u))return;return JSON.parse(Ju.readFileSync(u,"utf8")).lastUpdateCheck}catch{return}},kq=(D)=>{let u=Eq(D);Ju.writeFileSync(u,JSON.stringify({lastUpdateCheck:new Date().getTime()}))};import rY from"https";var oY=async(D,u)=>{let _=`https://registry.npmjs.org/-/package/${D}/dist-tags`;return new Promise((F,q)=>{rY.get(_,($)=>{let C="";$.on("data",(Q)=>C+=Q),$.on("end",()=>{try{let J=JSON.parse(C)[u];if(!J)q(Error("Error getting version"));F(J)}catch{q(Error("Could not parse version response"))}})}).on("error",($)=>q($))})},yq=oY;var eY=async({pkg:D,updateCheckInterval:u=86400000,distTag:_="latest",alwaysRun:F,debug:q})=>{vq();let $=Sq(D.name);if(F||!$||$<new Date().getTime()-u){let C=await yq(D.name,_);if(kq(D.name),hq.default.gt(C,D.version))return C;else if(q)console.error(`Latest version (${C}) not newer than current version (${D.version})`)}else if(q)console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${u}ms but only ${new Date().getTime()-$}ms since last check.`);return!1},bq=eY;import{promisify as uG}from"util";var _G=uG(DG),FG=new Map([["@abacus-ai/deepagent","@abacus-ai/cli"],["deepagent-cli","abacusai-cli"],["@abacus-ai/codellm","@abacus-ai/cli"],["codellm-cli","abacusai-cli"]]);async function fq(D){try{let u=FG.get(D.name)||D.name,_={...D,name:u};if(await bq({pkg:_}))await qG(_)}catch(u){throw Error(`Failed to auto upgrade ${D.appName}. To update, install the latest version from ${D.homepage}`)}}async function qG(D){try{let{command:u,args:_}=await $G(D);console.log(`${y.dim}Upgrading ${D.appName} to ${D.version} via ${u}...${y.reset}`),await _G(u,_),console.log(`${y.dim}${D.name}@${D.version} installed successfully${y.reset}`)}catch(u){throw Error(`Failed to install the ${D.appName}@${D.version}: ${u}. To update, install the latest version from ${D.homepage}`)}}async function $G({name:D,version:u}){try{let _=gq.env.npm_package_json,F=gq.env.npm_config_user_agent;if(Boolean(F?.startsWith("npm"))||Boolean(_?.endsWith("package.json")))return{command:"npm",args:["install","-g",`${D}@${u}`]};if(Boolean(F?.startsWith("yarn")))return{command:"yarn",args:["global","add",`${D}@${u}`]};if(Boolean(F?.startsWith("pnpm")))return{command:"pnpm",args:["install","-g",`${D}@${u}`]};if(Boolean(F?.startsWith("bun")))return{command:"bun",args:["install","-g",`${D}@${u}`]}}catch(_){}return{command:"npm",args:["install","-g",`${D}@${u}`]}}var mq={name:"@abacus-ai/cli",appName:"AbacusAI",binName:"abacusai",version:"1.104.34413",distro:"fb9b4b01c06699c1a80f26ca9de940a9aebb29e0",author:{name:"Abacus AI"},license:"Proprietary",main:"./dist/index.js",module:"./dist/index.js",source:"./src/index.ts",type:"module",homepage:"https://desktop.abacus.ai/",files:["dist"],bugs:{url:"mailto:support@abacus.ai"},bin:{abacusai:"./dist/index.js"},scripts:{build:"tsc && bun build ./src/index.ts --minify --target=node --outdir=dist"},devDependencies:{"@inquirer/prompts":"^7.9.0","@tsconfig/strictest":"^2.0.7","@types/node":"^24.9.2","@types/semver":"^7.7.1","extract-zip":"^2.0.1","node-downloader-helper":"^2.1.9",semver:"^7.7.3","simple-update-notifier":"^2.0.0",tar:"^7.5.2",typescript:"^6.0.0-dev.20251031"},overrides:{yauzl:"3.2.0"}};var g0=mq;async function JG(){fq(g0).catch((_)=>{console.error(_)});let D=await g4(g0);if(process.on("beforeExit",async()=>{if(D===void 0)return;await f4(D,g0)}),D!==void 0)return dq(g0,D);let u=await c5(g0);return dq(g0,u)}JG().catch((D)=>{console.error(D),process.exit(1)});function dq(D,u){let _=process.platform==="win32",F=QG.spawn(u,process.argv.slice(2),{stdio:"inherit",shell:_,windowsVerbatimArguments:_});F.on("error",(q)=>{console.error(`Failed to start ${D.appName}:`,q),process.exit(1)}),F.on("exit",(q,$)=>{if($)process.kill(process.pid,$);else process.exit(q??1)})}
25
+ `)}${y.reset}`),!await u1({message:"Should we remove them?",default:!1}))return;await Promise.all(F.map(async($)=>{try{await W1.rm($,{recursive:!0,force:!0})}catch(C){console.error(`Failed to remove old ${u.appName} installation at '${$}': ${C instanceof Error?C.message:String(C)}`);return}console.log(`${y.dim}Removed old ${u.appName} installation at '${$}'${y.reset}`)}))}catch(_){console.error(_ instanceof Error?_.message:String(_))}}import{execFile as DG}from"child_process";import gq from"process";var hq=nD(Nq(),1);import nY from"os";import Rq from"path";import Ju from"fs";var tY=nY.homedir(),v1=process.env.XDG_CONFIG_HOME||Rq.join(tY,".config","simple-update-notifier"),Eq=(D)=>{return Rq.join(v1,`${D.replace("@","").replace("/","__")}.json`)},vq=()=>{if(!Ju.existsSync(v1))Ju.mkdirSync(v1,{recursive:!0})},Sq=(D)=>{let u=Eq(D);try{if(!Ju.existsSync(u))return;return JSON.parse(Ju.readFileSync(u,"utf8")).lastUpdateCheck}catch{return}},kq=(D)=>{let u=Eq(D);Ju.writeFileSync(u,JSON.stringify({lastUpdateCheck:new Date().getTime()}))};import rY from"https";var oY=async(D,u)=>{let _=`https://registry.npmjs.org/-/package/${D}/dist-tags`;return new Promise((F,q)=>{rY.get(_,($)=>{let C="";$.on("data",(Q)=>C+=Q),$.on("end",()=>{try{let J=JSON.parse(C)[u];if(!J)q(Error("Error getting version"));F(J)}catch{q(Error("Could not parse version response"))}})}).on("error",($)=>q($))})},yq=oY;var eY=async({pkg:D,updateCheckInterval:u=86400000,distTag:_="latest",alwaysRun:F,debug:q})=>{vq();let $=Sq(D.name);if(F||!$||$<new Date().getTime()-u){let C=await yq(D.name,_);if(kq(D.name),hq.default.gt(C,D.version))return C;else if(q)console.error(`Latest version (${C}) not newer than current version (${D.version})`)}else if(q)console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${u}ms but only ${new Date().getTime()-$}ms since last check.`);return!1},bq=eY;import{promisify as uG}from"util";var _G=uG(DG),FG=new Map([["@abacus-ai/deepagent","@abacus-ai/cli"],["deepagent-cli","abacusai-cli"],["@abacus-ai/codellm","@abacus-ai/cli"],["codellm-cli","abacusai-cli"]]);async function fq(D){try{let u=FG.get(D.name)||D.name,_={...D,name:u};if(await bq({pkg:_}))await qG(_)}catch(u){throw Error(`Failed to auto upgrade ${D.appName}. To update, install the latest version from ${D.homepage}`)}}async function qG(D){try{let{command:u,args:_}=await $G(D);console.log(`${y.dim}Upgrading ${D.appName} to ${D.version} via ${u}...${y.reset}`),await _G(u,_),console.log(`${y.dim}${D.name}@${D.version} installed successfully${y.reset}`)}catch(u){throw Error(`Failed to install the ${D.appName}@${D.version}: ${u}. To update, install the latest version from ${D.homepage}`)}}async function $G({name:D,version:u}){try{let _=gq.env.npm_package_json,F=gq.env.npm_config_user_agent;if(Boolean(F?.startsWith("npm"))||Boolean(_?.endsWith("package.json")))return{command:"npm",args:["install","-g",`${D}@${u}`]};if(Boolean(F?.startsWith("yarn")))return{command:"yarn",args:["global","add",`${D}@${u}`]};if(Boolean(F?.startsWith("pnpm")))return{command:"pnpm",args:["install","-g",`${D}@${u}`]};if(Boolean(F?.startsWith("bun")))return{command:"bun",args:["install","-g",`${D}@${u}`]}}catch(_){}return{command:"npm",args:["install","-g",`${D}@${u}`]}}var mq={name:"@abacus-ai/cli",appName:"AbacusAI",binName:"abacusai",version:"1.104.34414",distro:"fb9b4b01c06699c1a80f26ca9de940a9aebb29e0",author:{name:"Abacus AI"},license:"Proprietary",main:"./dist/index.js",module:"./dist/index.js",source:"./src/index.ts",type:"module",homepage:"https://desktop.abacus.ai/",files:["dist"],bugs:{url:"mailto:support@abacus.ai"},bin:{abacusai:"./dist/index.js"},scripts:{build:"tsc && bun build ./src/index.ts --minify --target=node --outdir=dist"},devDependencies:{"@inquirer/prompts":"^7.9.0","@tsconfig/strictest":"^2.0.7","@types/node":"^24.9.2","@types/semver":"^7.7.1","extract-zip":"^2.0.1","node-downloader-helper":"^2.1.9",semver:"^7.7.3","simple-update-notifier":"^2.0.0",tar:"^7.5.2",typescript:"^6.0.0-dev.20251031"},overrides:{yauzl:"3.2.0"}};var g0=mq;async function JG(){fq(g0).catch((_)=>{console.error(_)});let D=await g4(g0);if(process.on("beforeExit",async()=>{if(D===void 0)return;await f4(D,g0)}),D!==void 0)return dq(g0,D);let u=await c5(g0);return dq(g0,u)}JG().catch((D)=>{console.error(D),process.exit(1)});function dq(D,u){let _=process.platform==="win32",F=QG.spawn(u,process.argv.slice(2),{stdio:"inherit",shell:_,windowsVerbatimArguments:_});F.on("error",(q)=>{console.error(`Failed to start ${D.appName}:`,q),process.exit(1)}),F.on("exit",(q,$)=>{if($)process.kill(process.pid,$);else process.exit(q??1)})}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@abacus-ai/cli",
3
3
  "appName": "AbacusAI",
4
4
  "binName": "abacusai",
5
- "version": "1.104.34413",
5
+ "version": "1.104.34414",
6
6
  "distro": "fb9b4b01c06699c1a80f26ca9de940a9aebb29e0",
7
7
  "author": {
8
8
  "name": "Abacus AI"