@abacus-ai/cli 2.2.9 → 2.2.11
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/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -85589,7 +85589,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
85589
85589
|
`:`
|
|
85590
85590
|
`)+n,i=r+1,r=e.indexOf(`
|
|
85591
85591
|
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:GP,stderr:KP}=HP,qP=Symbol(`GENERATOR`),JP=Symbol(`STYLER`),YP=Symbol(`IS_EMPTY`),XP=[`ansi`,`ansi`,`ansi256`,`ansi16m`],ZP=Object.create(null),QP=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=GP?GP.level:0;e.level=t.level===void 0?n:t.level},$P=e=>{let t=(...e)=>e.join(` `);return QP(t,e),Object.setPrototypeOf(t,eF.prototype),t};function eF(e){return $P(e)}Object.setPrototypeOf(eF.prototype,Function.prototype);for(let[e,t]of Object.entries(FP))ZP[e]={get(){let n=iF(this,rF(t.open,t.close,this[JP]),this[YP]);return Object.defineProperty(this,e,{value:n}),n}};ZP.visible={get(){let e=iF(this,this[JP],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const tF=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?FP[n].ansi16m(...r):t===`ansi256`?FP[n].ansi256(FP.rgbToAnsi256(...r)):FP[n].ansi(FP.rgbToAnsi(...r)):e===`hex`?tF(`rgb`,t,n,...FP.hexToRgb(...r)):FP[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){ZP[e]={get(){let{level:t}=this;return function(...n){let r=rF(tF(e,XP[t],`color`,...n),FP.color.close,this[JP]);return iF(this,r,this[YP])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);ZP[t]={get(){let{level:t}=this;return function(...n){let r=rF(tF(e,XP[t],`bgColor`,...n),FP.bgColor.close,this[JP]);return iF(this,r,this[YP])}}}}const nF=Object.defineProperties(()=>{},{...ZP,level:{enumerable:!0,get(){return this[qP].level},set(e){this[qP].level=e}}}),rF=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},iF=(e,t,n)=>{let r=(...e)=>aF(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,nF),r[qP]=e,r[JP]=t,r[YP]=n,r},aF=(e,t)=>{if(e.level<=0||!t)return e[YP]?``:t;let n=e[JP];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=UP(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
85592
|
-
`);return a!==-1&&(t=WP(t,i,r,a)),r+t+i};Object.defineProperties(eF.prototype,ZP);const oF=eF();eF({level:KP?KP.level:0});var sF=W(((e,t)=>{t.exports={name:`@codellm/cli`,version:`2.2.
|
|
85592
|
+
`);return a!==-1&&(t=WP(t,i,r,a)),r+t+i};Object.defineProperties(eF.prototype,ZP);const oF=eF();eF({level:KP?KP.level:0});var sF=W(((e,t)=>{t.exports={name:`@codellm/cli`,version:`2.2.11`,private:!0,bin:{abacusai:`dist/index.mjs`},files:[`dist`,`LICENSE.txt`],type:`module`,scripts:{"prepare-publish":`bun ./scripts/prepare-publish.ts`,build:`tsdown`,"check-types":`tsgo -b --noEmit`,test:`FORCE_COLOR=1 vitest run`,"test:watch":`FORCE_COLOR=1 vitest`,"test:ui":`FORCE_COLOR=1 vitest --ui`,"test:coverage":`FORCE_COLOR=1 vitest run --coverage`},dependencies:{"@clack/prompts":`^0.11.0`,"@codellm/agent":`workspace:*`,"@codellm/api":`workspace:*`,"@codellm/auth":`workspace:*`,"@codellm/comms":`workspace:*`,"@codellm/jar":`workspace:*`,"@codellm/product":`workspace:*`,"@orpc/client":`catalog:`,"@orpc/contract":`catalog:`,"@orpc/server":`catalog:`,"@sentry/node-core":`^10.42.0`,"@slack/web-api":`^7.0.0`,"@tanstack/react-query":`^5.90.19`,"@vscode/ripgrep":`^1.17.0`,"ansi-styles":`^6.2.3`,"beautiful-mermaid":`^1.1.3`,chalk:`^5.6.2`,"cli-boxes":`^4.0.1`,"cli-highlight":`^2.1.11`,conf:`^15.0.2`,diff:`^8.0.3`,fzf:`^0.5.2`,"gradient-string":`^3.0.0`,immer:`^11.1.4`,"isomorphic-git":`^1.36.1`,marked:`^17.0.4`,"patchright-core":`^1.58.2`,react:`^19.2.3`,"react-compiler-runtime":`^1.0.0`,remend:`^1.2.2`,semver:`^7.7.4`,"shell-history":`^2.0.1`,"string-width":`^8.1.0`,"strip-ansi":`^7.2.0`,trash:`^9.0.0`,zod:`catalog:`},devDependencies:{"@codellm/configs":`workspace:*`,"@playwright/mcp":`^0.0.68`,"@types/diff":`^8.0.0`,"@types/node":`catalog:`,"@types/react":`^19.2.9`,"@types/semver":`^7.7.1`,"@typescript/native-preview":`catalog:`,"@vitejs/plugin-react":`^5.1.2`,"@vitest/coverage-v8":`^4.0.18`,"@vitest/ui":`^4.0.18`,"@xterm/addon-serialize":`^0.14.0`,"@xterm/headless":`^6.0.0`,"babel-plugin-react-compiler":`^1.0.0`,"cli-testing-library":`^3.0.1`,jsdom:`^27.4.0`,"node-pty":`^1.1.0`,"react-devtools-core":`^6.1.5`,"svg-term-cli":`^2.1.1`,tsdown:`^0.21.0`,vite:`catalog:`,vitest:`^4.0.18`},engines:{node:`>=18`}}})),cF=Oe(sF(),1);let lF=null;function uF(e){let t=(0,dP.prerelease)(e);return t&&t.length>0&&typeof t[0]==`string`?t[0]:`latest`}function dF(){let e=process.env.npm_command;if(e===`exec`||e===`dlx`)return!0;let t=process.argv[1]??``;return!!/_npx[/\\]|[/\\]dlx[/\\]|\.cache[/\\]/.test(t)}function fF(){if(process.versions.bun===void 0)return!1;let e=process.argv[1]??process.argv[0]??``;return/[/\\]\.abacusai[/\\]bin[/\\]/.test(e)}function pF(){let e=`${Re.internalEnvPrefix}DEV`,t=process.env[e];if(t===`1`||t===`true`)return!0;let n=process.argv[1]??``;try{n=x(n)}catch{}if(/[/\\]\.abacusai[/\\]bin[/\\]/.test(n))return!1;let r=/[/\\]node_modules[/\\]/.test(n)||/[/\\]\.npm[/\\]/.test(n)||/[/\\]\.bun[/\\]/.test(n),i=!!process.env.npm_config_user_agent;return!r&&!i}function mF(){return`${process.platform===`win32`?`win32`:process.platform===`darwin`?`darwin`:`linux`}-${process.arch===`arm64`?`arm64`:`x64`}`}function hF(){let e=process.env.npm_config_user_agent;if(e){let t=e.split(`/`)[0];if(t===`yarn`||t===`pnpm`||t===`bun`||t===`npm`)return t}let t=process.argv[1]??``;return t.includes(`yarn`)?`yarn`:t.includes(`pnpm`)?`pnpm`:t.includes(`bun`)?`bun`:`npm`}async function gF(e){let t=Date.now();if(lF&&t-lF.timestamp<6e4)return lF.tags;let n=await fetch(`https://registry.npmjs.org/${e}`,{signal:AbortSignal.timeout(1e4),headers:{accept:`application/json`}});if(!n.ok)throw Error(`Registry returned ${n.status}`);let r=(await n.json())[`dist-tags`]??{};return lF={tags:r,timestamp:t},r}async function _F(e,t,n,r){let i=t??uF(e),a=(r??`https://apps.abacus.ai`).replace(/\/$/,``),o=new URL(`${a}/api/v0/_getCodellmCliVersion`);o.searchParams.set(`channel`,i),n&&o.searchParams.set(`platform`,n),o.searchParams.set(`cli_version`,e);let s=await fetch(o.toString(),{signal:AbortSignal.timeout(1e4)});if(s.status===204)return null;if(!s.ok)throw Error(`API returned ${s.status}`);let c=await s.json();return{currentVersion:e,latestVersion:c.result.version,tag:c.result.channel,packageManager:hF(),isEphemeral:dF(),downloadUrl:c.result.url}}async function vF(e){let t=uF(e),n=hF(),r=dF(),i=(await gF(ze.publishName))[t];return!i&&t!==`latest`||!i||i===e?null:{currentVersion:e,latestVersion:i,tag:t,packageManager:n,isEphemeral:r}}async function yF(e,t,n){try{return await _F(e,t,fF()?mF():void 0,n)}catch{return fF()?null:await vF(e)}}function bF(){return`${Re.binName} upgrade`}function xF(e){let t=`${ze.publishName}@${e.tag}`;switch(e.packageManager){case`yarn`:return`yarn global add ${t}`;case`pnpm`:return`pnpm add -g ${t}`;case`bun`:return`bun add -g ${t}`;default:return`npm install -g ${t}`}}function SF(e){try{return d(xF(e),{stdio:`pipe`}),!0}catch{return!1}}function CF(e,t){let n=xF(e).split(` `),r=n[0],i=n.slice(1);return new Promise(e=>{let n=f(r,i,{stdio:[`ignore`,`pipe`,`pipe`],shell:!1,env:{...process.env}}),a=[],o=e=>{let n=e.toString(`utf-8`);for(let e of n.split(`
|
|
85593
85593
|
`)){let n=e.trim();n&&(a.push(n),t(n))}};n.stdout?.on(`data`,o),n.stderr?.on(`data`,o);let s=null;n.on(`error`,t=>{e({ok:!1,output:t.message})}),n.on(`exit`,e=>{s=e}),n.on(`close`,()=>{e({ok:s===0,output:a.join(`
|
|
85594
85594
|
`)})})})}async function wF(e){if(!e.downloadUrl)return{ok:!1,output:`No download URL`};let n=w.join(t.tmpdir(),`abacusai-update-${Date.now()}`),r=w.join(t.homedir(),`.${Re.configDirName}`,`bin`),i=process.platform===`win32`,a=i?`${Re.binName}.exe`:Re.binName;try{await z.mkdir(n,{recursive:!0});let t=w.join(n,i?`update.zip`:`update.tar.gz`),o=await fetch(e.downloadUrl);if(!o.ok)throw Error(`Download failed: ${o.status}`);let s=Buffer.from(await o.arrayBuffer());await z.writeFile(t,s),d(i?`powershell -Command "Expand-Archive -Path '${t}' -DestinationPath '${n}' -Force"`:`tar -xzf "${t}" -C "${n}"`,{stdio:`pipe`});let c=w.join(n,a),l=w.join(r,a);return await z.copyFile(c,l),i||await z.chmod(l,493),{ok:!0,output:`Updated to ${e.latestVersion}`}}catch(e){return{ok:!1,output:e instanceof Error?e.message:`Unknown error`}}finally{await z.rm(n,{recursive:!0,force:!0}).catch(()=>{})}}function TF(e,t){let n=e=>{let n=e.toLowerCase();if(n===t)return 1e3;if(n.startsWith(t))return 900;let r=0,i=-1;for(let e of t){let t=n.indexOf(e,i+1);if(t===-1)return 0;r+=100-(t-i),i=t}return r+=Math.max(0,50-n.length),r},r=null,i=0;for(let t of e){let e=Math.max(n(t.name??``),n(t.llmName));e>i&&(i=e,r=t.llmName)}return i>=100?r:null}async function EF(e,t){let n=(await e.listLLMModels())?.result??[];return n.length||(process.stderr.write(`Error: No models available.
|
|
85595
85595
|
`),process.exit(1)),t?TF(n,t.toLowerCase())||(process.stderr.write(`Warning: Model "${t}" not found. Using default: ${n[0].llmName}\n`),n[0].llmName):n[0].llmName}const DF=T.join(i(),Re.configDirName,Re.logsDirName),OF=T.join(DF,`cli.log`);let kF=!1;function AF(){if(!kF)try{v(DF)||y(DF,{recursive:!0}),kF=!0}catch{}}function jF(e){return e.length===0?``:` `+e.map(e=>{if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function MF(e,t,n){AF();let r=`[${new Date().toISOString()}] [${e}] ${t instanceof Error?`${t.message}${t.stack?`
|