@burtson-labs/bandit-stealth-cli 1.7.304 → 1.7.305

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 CHANGED
@@ -14,7 +14,7 @@ Your code never leaves your machine. Works with any Ollama model.
14
14
 
15
15
  [![npm](https://img.shields.io/npm/v/%40burtson-labs%2Fbandit-stealth-cli?logo=npm&color=cb3837)](https://www.npmjs.com/package/@burtson-labs/bandit-stealth-cli)
16
16
  [![node](https://img.shields.io/node/v/@burtson-labs/bandit-stealth-cli.svg)](https://nodejs.org)
17
- [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
17
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
18
18
 
19
19
  <p>
20
20
  <img src="https://cdn.burtson.ai/images/cli-demo.gif" alt="Bandit CLI demo: boot banner, shortcuts overlay, background subagent + live tile, /insights, async completion" width="780" />
package/dist/cli.js CHANGED
@@ -1501,7 +1501,7 @@ ${(()=>{let J=`Bandit insights \u2014 ${new Date(a).toISOString().slice(0,10)}`,
1501
1501
  <h1>You're signed in.</h1>
1502
1502
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1503
1503
  </div>
1504
- </body></html>`;t(lxr,"startLoopbackListener");t(uxr,"openBrowser");t(fxr,"buildDefaultDeviceLabel");t(dxr,"runOAuthSignIn")});var Tfe=Ot((WFr,pxr)=>{pxr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.304",description:"Bandit \u2014 a local-first AI coding agent for your terminal. Same runtime as the Bandit Stealth VS Code / Cursor extension.",keywords:["ai","agent","cli","coding-agent","llm","ollama","local-first","bandit","burtson-labs","terminal","repl","developer-tools"],homepage:"https://burtson.ai",bugs:{url:"https://github.com/Burtson-Labs/bandit-agent-framework/issues",email:"team@burtson.ai"},license:"MIT",author:{name:"Burtson Labs",email:"team@burtson.ai",url:"https://burtson.ai"},repository:{type:"git",url:"git+https://github.com/Burtson-Labs/bandit-agent-framework.git",directory:"apps/bandit-cli"},bin:{bandit:"./dist/cli.js"},main:"dist/cli.js",files:["dist/cli.js","README.md","LICENSE"],engines:{node:">=20"},publishConfig:{access:"public"},scripts:{typecheck:"tsc -p tsconfig.json --noEmit",build:"node build.mjs","build:publish":"node build.mjs --publish",dev:"node build.mjs --watch",start:"node dist/cli.js",smoke:"node build.mjs && node dist/__smoke__/smoke.js",integration:"node build.mjs && node dist/__integration__/ollama.js",eval:"node build.mjs && node dist/__eval__/eval.js",benchmark:"node build.mjs && node dist/__eval__/benchmark.js","gen-logo":"node scripts/gen-logo.mjs","preview-banner":"node scripts/preview-banner.mjs",clean:"rm -rf dist",prepack:"node scripts/prepack.mjs",postpack:"node scripts/postpack.mjs",prepublishOnly:"pnpm run clean && pnpm run typecheck && pnpm run build:publish"},dependencies:{"pdf-parse":"^2.4.5"},devDependencies:{"@burtson-labs/agent-core":"workspace:*","@burtson-labs/host-kit":"workspace:*","@burtson-labs/stealth-core-runtime":"workspace:*","@types/node":"^20.11.0","@types/pdf-parse":"^1.1.5","@types/pngjs":"^6.0.5",esbuild:"^0.28.0",pngjs:"^7.0.0",typescript:"^5.4.0"}}});var n2r={};module.exports=xtt(n2r);var ed=yl(require("fs")),zM=yl(require("os")),su=yl(require("path")),s$=yl(require("readline")),wfe=yl(require("child_process")),p_=yl(L9()),Eg=yl(Xue());var rO=yl(require("fs")),_3e=yl(require("os")),ET=yl(require("path")),XZ=yl(require("child_process"));function j0(s){return s==="~"?_3e.homedir():s.startsWith("~/")?ET.join(_3e.homedir(),s.slice(2)):s}t(j0,"expandHome");var X9=16*1024,KZ=32*1024,Fpt=1e4,iTr=3e4,m3e=200,g3e=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function sTr(s){let a=t(f=>{let u=f.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[f];let[,g,b,P]=u;return b.split(",").map(N=>`${g}${N.trim()}${P}`)},"braceExpand"),c=s.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,f,u]=c;return{includes:a(u),subDir:f}}return{includes:a(s),subDir:""}}t(sTr,"expandGlobForGrep");var FM=class{constructor(a,c,f={}){this.workspaceRoot=a;this.languageAdapters=c;this.options=f;this._readFiles=new Set;this.customRepoRoots=f.customRepoRoots&&f.customRepoRoots.length>0?f.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(a){this._readFiles.add(j0(a))}hasFileBeenRead(a){return this._readFiles.has(j0(a))}async readFile(a){return rO.promises.readFile(j0(a),"utf-8")}async writeFile(a,c){let f=j0(a);if(this.options.approveWrite&&!await this.options.approveWrite(f,c))throw new Error(`Write to ${f} rejected by user`);await rO.promises.mkdir(ET.dirname(f),{recursive:!0}),await rO.promises.writeFile(f,c,"utf-8")}async deleteFile(a){let c=ET.resolve(j0(a)),f=ET.resolve(this.workspaceRoot);if(!c.startsWith(f+ET.sep)&&c!==f)throw new Error(`Refusing to delete outside workspace: ${a}`);await rO.promises.unlink(c)}async listFiles(a,c){let f=j0(c??this.workspaceRoot),u=aTr(a),g=[];return await Mpt(f,f,u,g),g.slice(0,m3e).sort()}async listDirectoryEntries(a){let c=j0(a),f=await rO.promises.readdir(c,{withFileTypes:!0}),u=[];for(let g of f){if(g.name.startsWith("."))continue;let b=g.isDirectory();if(g.isSymbolicLink())try{b=(await rO.promises.stat(ET.join(c,g.name))).isDirectory()}catch{b=!1}u.push(b?`${g.name}/`:g.name)}return u.sort()}async searchCode(a,c,f){let u=j0(c??this.workspaceRoot);return this.runRipgrep(a,u,f).catch(()=>this.runGrep(a,u,f))}async runCommand(a,c,f){let u=c.map(j0),g=f?j0(f):this.workspaceRoot,b={...process.env};if((a.split(/[\\/]/).pop()??a)==="gh")for(let N of["GITHUB_TOKEN","GH_TOKEN"]){let M=b[N];typeof M=="string"&&M.trim()===""&&delete b[N]}return new Promise(N=>{let M="",L="",J=XZ.spawn(a,u,{cwd:g,shell:process.platform==="win32",env:b}),B=setTimeout(()=>{J.kill("SIGTERM"),N({stdout:M.slice(0,KZ),stderr:L+`
1504
+ </body></html>`;t(lxr,"startLoopbackListener");t(uxr,"openBrowser");t(fxr,"buildDefaultDeviceLabel");t(dxr,"runOAuthSignIn")});var Tfe=Ot((WFr,pxr)=>{pxr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.305",description:"Bandit \u2014 a local-first AI coding agent for your terminal. Same runtime as the Bandit Stealth VS Code / Cursor extension.",keywords:["ai","agent","cli","coding-agent","llm","ollama","local-first","bandit","burtson-labs","terminal","repl","developer-tools"],homepage:"https://burtson.ai",bugs:{url:"https://github.com/Burtson-Labs/bandit-agent-framework/issues",email:"team@burtson.ai"},license:"Apache-2.0",author:{name:"Burtson Labs",email:"team@burtson.ai",url:"https://burtson.ai"},repository:{type:"git",url:"git+https://github.com/Burtson-Labs/bandit-agent-framework.git",directory:"apps/bandit-cli"},bin:{bandit:"./dist/cli.js"},main:"dist/cli.js",files:["dist/cli.js","README.md","LICENSE"],engines:{node:">=20"},publishConfig:{access:"public"},scripts:{typecheck:"tsc -p tsconfig.json --noEmit",build:"node build.mjs","build:publish":"node build.mjs --publish",dev:"node build.mjs --watch",start:"node dist/cli.js",smoke:"node build.mjs && node dist/__smoke__/smoke.js",integration:"node build.mjs && node dist/__integration__/ollama.js",eval:"node build.mjs && node dist/__eval__/eval.js",benchmark:"node build.mjs && node dist/__eval__/benchmark.js","gen-logo":"node scripts/gen-logo.mjs","preview-banner":"node scripts/preview-banner.mjs",clean:"rm -rf dist",prepack:"node scripts/prepack.mjs",postpack:"node scripts/postpack.mjs",prepublishOnly:"pnpm run clean && pnpm run typecheck && pnpm run build:publish"},dependencies:{"pdf-parse":"^2.4.5"},devDependencies:{"@burtson-labs/agent-core":"workspace:*","@burtson-labs/host-kit":"workspace:*","@burtson-labs/stealth-core-runtime":"workspace:*","@types/node":"^20.11.0","@types/pdf-parse":"^1.1.5","@types/pngjs":"^6.0.5",esbuild:"^0.28.0",pngjs:"^7.0.0",typescript:"^5.4.0"}}});var n2r={};module.exports=xtt(n2r);var ed=yl(require("fs")),zM=yl(require("os")),su=yl(require("path")),s$=yl(require("readline")),wfe=yl(require("child_process")),p_=yl(L9()),Eg=yl(Xue());var rO=yl(require("fs")),_3e=yl(require("os")),ET=yl(require("path")),XZ=yl(require("child_process"));function j0(s){return s==="~"?_3e.homedir():s.startsWith("~/")?ET.join(_3e.homedir(),s.slice(2)):s}t(j0,"expandHome");var X9=16*1024,KZ=32*1024,Fpt=1e4,iTr=3e4,m3e=200,g3e=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function sTr(s){let a=t(f=>{let u=f.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[f];let[,g,b,P]=u;return b.split(",").map(N=>`${g}${N.trim()}${P}`)},"braceExpand"),c=s.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,f,u]=c;return{includes:a(u),subDir:f}}return{includes:a(s),subDir:""}}t(sTr,"expandGlobForGrep");var FM=class{constructor(a,c,f={}){this.workspaceRoot=a;this.languageAdapters=c;this.options=f;this._readFiles=new Set;this.customRepoRoots=f.customRepoRoots&&f.customRepoRoots.length>0?f.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(a){this._readFiles.add(j0(a))}hasFileBeenRead(a){return this._readFiles.has(j0(a))}async readFile(a){return rO.promises.readFile(j0(a),"utf-8")}async writeFile(a,c){let f=j0(a);if(this.options.approveWrite&&!await this.options.approveWrite(f,c))throw new Error(`Write to ${f} rejected by user`);await rO.promises.mkdir(ET.dirname(f),{recursive:!0}),await rO.promises.writeFile(f,c,"utf-8")}async deleteFile(a){let c=ET.resolve(j0(a)),f=ET.resolve(this.workspaceRoot);if(!c.startsWith(f+ET.sep)&&c!==f)throw new Error(`Refusing to delete outside workspace: ${a}`);await rO.promises.unlink(c)}async listFiles(a,c){let f=j0(c??this.workspaceRoot),u=aTr(a),g=[];return await Mpt(f,f,u,g),g.slice(0,m3e).sort()}async listDirectoryEntries(a){let c=j0(a),f=await rO.promises.readdir(c,{withFileTypes:!0}),u=[];for(let g of f){if(g.name.startsWith("."))continue;let b=g.isDirectory();if(g.isSymbolicLink())try{b=(await rO.promises.stat(ET.join(c,g.name))).isDirectory()}catch{b=!1}u.push(b?`${g.name}/`:g.name)}return u.sort()}async searchCode(a,c,f){let u=j0(c??this.workspaceRoot);return this.runRipgrep(a,u,f).catch(()=>this.runGrep(a,u,f))}async runCommand(a,c,f){let u=c.map(j0),g=f?j0(f):this.workspaceRoot,b={...process.env};if((a.split(/[\\/]/).pop()??a)==="gh")for(let N of["GITHUB_TOKEN","GH_TOKEN"]){let M=b[N];typeof M=="string"&&M.trim()===""&&delete b[N]}return new Promise(N=>{let M="",L="",J=XZ.spawn(a,u,{cwd:g,shell:process.platform==="win32",env:b}),B=setTimeout(()=>{J.kill("SIGTERM"),N({stdout:M.slice(0,KZ),stderr:L+`
1505
1505
  [process timed out]`,exitCode:124})},iTr),ge=process.stdout.isTTY===!0,le=t((be,it)=>{if(!ge)return;(it?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+be+"\x1B[0m")},"writeLive");J.stdout?.on("data",be=>{let it=be.toString();M+=it,le(it,!1),M.length>KZ&&J.kill("SIGTERM")}),J.stderr?.on("data",be=>{let it=be.toString();L+=it,le(it,!0)}),J.on("close",be=>{clearTimeout(B);let it=M.slice(0,KZ);if(be===0&&/Operation cancelled/i.test(it)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${a} ${u.join(" ")} ${it}`)){let gt=[a,...u].join(" ");N({stdout:it,stderr:`Interactive scaffolder detected \u2014 \`${a}\` aborted with "Operation cancelled" because Bandit captures stdout/stderr (no TTY on stdin) and modern scaffolders refuse to start without one. Tell the user to run this directly in their shell: \`!${gt}\`. The \`!\`-prefix runs through their terminal with real stdin, so the scaffolder's prompts work. After they finish, you can pick up from the resulting filesystem state. Do NOT retry the same command \u2014 it will loop forever.`,exitCode:1});return}N({stdout:it,stderr:L.slice(0,4*1024),exitCode:be??0})}),J.on("error",be=>{if(clearTimeout(B),be.code==="ENOENT"){N({stdout:"",stderr:`spawn ${a} ENOENT \u2014 '${a}' not found on PATH. Verify the tool is installed (\`which ${a}\` in a fresh terminal). If you use nvm/asdf/volta, your shim PATH may not be inherited; relaunching this CLI from the same terminal session that has \`${a}\` on PATH usually fixes it.`,exitCode:127});return}N({stdout:"",stderr:be.message,exitCode:1})})})}async watchCommand(a,c,f,u){let g=c.map(j0),b=f?j0(f):this.workspaceRoot;return new Promise(P=>{let N="",M="",L=!1,J=!1,B=XZ.spawn(a,g,{cwd:b,shell:process.platform==="win32",env:{...process.env}}),ge=t(ut=>{J||(J=!0,P({stdout:N.slice(0,KZ),stderr:M.slice(0,4*1024),exitCode:ut,endedEarly:L}))},"finish"),le=setTimeout(()=>{try{B.kill("SIGTERM")}catch{}let ut=setTimeout(()=>{try{B.kill("SIGKILL")}catch{}ge(null)},1e3);B.once("close",gt=>{clearTimeout(ut),ge(typeof gt=="number"?gt:null)})},u),be=process.stdout.isTTY===!0,it=t((ut,gt)=>{if(!be)return;(gt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+ut+"\x1B[0m")},"writeLive");B.stdout?.on("data",ut=>{let gt=ut.toString();if(N+=gt,it(gt,!1),N.length>KZ)try{B.kill("SIGTERM")}catch{}}),B.stderr?.on("data",ut=>{let gt=ut.toString();M+=gt,it(gt,!0)}),B.on("close",ut=>{J||(clearTimeout(le),L=!0,ge(typeof ut=="number"?ut:null))}),B.on("error",ut=>{J||(clearTimeout(le),L=!0,M+=ut.message,ge(1))})})}runRipgrep(a,c,f){return new Promise((u,g)=>{let b=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...g3e].map(L=>["--glob",`!${L}`]).flat()];f&&b.push("--glob",f),b.push(a,c);let P="",N=XZ.spawn("rg",b,{shell:!1}),M=setTimeout(()=>{N.kill("SIGTERM"),u(P.slice(0,X9))},Fpt);N.stdout?.on("data",L=>{P+=L.toString(),P.length>X9&&N.kill("SIGTERM")}),N.on("close",L=>{clearTimeout(M),L!=null&&L>=2&&P.length===0?g(new Error(`rg exited with code ${L}`)):u(P.slice(0,X9))}),N.on("error",g)})}runGrep(a,c,f){return new Promise((u,g)=>{let b=[...g3e].map(le=>["--exclude-dir",le]).flat(),P=f?sTr(f):{includes:[],subDir:""},N=P.includes.flatMap(le=>["--include",le]),M=P.subDir?`${c}/${P.subDir}`:c,L=["-rn","-E","--color=never",...b,...N,a,M],J="",B=XZ.spawn("grep",L,{shell:!1}),ge=setTimeout(()=>{B.kill("SIGTERM"),u(J.slice(0,X9))},Fpt);B.stdout?.on("data",le=>{J+=le.toString(),J.length>X9&&B.kill("SIGTERM")}),B.on("close",le=>{clearTimeout(ge),le!=null&&le>=2&&J.length===0?g(new Error(`grep exited with code ${le}`)):u(J.slice(0,X9))}),B.on("error",g)})}};function aTr(s){let a=oTr(s);return c=>a.test(c.replace(/\\/g,"/"))}t(aTr,"compileGlob");function oTr(s){let a="^";for(let c=0;c<s.length;c++){let f=s[c];if(f==="*")s[c+1]==="*"?(a+=".*",c++,s[c+1]==="/"&&c++):a+="[^/]*";else if(f==="?")a+="[^/]";else if(f==="{"){let u=s.indexOf("}",c);if(u===-1){a+="\\{";continue}let g=s.slice(c+1,u).split(",").map(cTr).join("|");a+=`(?:${g})`,c=u}else/[.+^$()|\\]/.test(f)?a+="\\"+f:a+=f}return a+="$",new RegExp(a)}t(oTr,"globToRegex");function cTr(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(cTr,"escapeRegex");async function Mpt(s,a,c,f){if(f.length>=m3e)return;let u;try{u=await rO.promises.readdir(s,{withFileTypes:!0})}catch{return}for(let g of u){if(f.length>=m3e)return;if(g3e.has(g.name))continue;let b=ET.join(s,g.name),P=ET.relative(a,b);g.isDirectory()?await Mpt(b,a,c,f):g.isFile()&&c(P)&&f.push(b)}}t(Mpt,"walk");var jpt=yl(require("child_process")),RE=yl(require("fs")),Lpt=yl(require("os")),h3e=yl(require("path")),$pt=yl(require("crypto"));function y3e(){let s=$pt.randomBytes(4).toString("hex");return h3e.join(Lpt.tmpdir(),`bandit-paste-${Date.now()}-${s}.png`)}t(y3e,"freshTempPath");function Yue(s,a,c={}){try{let f=jpt.spawnSync(s,a,{...c,encoding:void 0});return{stdout:Buffer.isBuffer(f.stdout)?f.stdout:Buffer.from(f.stdout??""),code:f.status}}catch{return{stdout:Buffer.alloc(0),code:null}}}t(Yue,"tryExec");async function Que(){return process.platform==="darwin"?lTr():process.platform==="linux"?uTr():process.platform==="win32"?fTr():null}t(Que,"readClipboardImage");function lTr(){let s=y3e(),a=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1506
1506
  set outFile to (open for access (POSIX file "${s}") with write permission)
1507
1507
  write pngData to outFile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burtson-labs/bandit-stealth-cli",
3
- "version": "1.7.304",
3
+ "version": "1.7.305",
4
4
  "description": "Bandit — a local-first AI coding agent for your terminal. Same runtime as the Bandit Stealth VS Code / Cursor extension.",
5
5
  "keywords": [
6
6
  "ai",
@@ -26,7 +26,7 @@
26
26
  "url": "git+https://github.com/Burtson-Labs/bandit-agent-framework.git",
27
27
  "directory": "apps/bandit-cli"
28
28
  },
29
- "license": "MIT",
29
+ "license": "Apache-2.0",
30
30
  "author": {
31
31
  "name": "Burtson Labs",
32
32
  "email": "team@burtson.ai",