@burtson-labs/bandit-stealth-cli 1.7.219 → 1.7.220

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/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1360,7 +1360,7 @@ ${(()=>{let Z=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
1360
1360
  <h1>You're signed in.</h1>
1361
1361
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1362
1362
  </div>
1363
- </body></html>`;t(OSr,"startLoopbackListener");t(FSr,"openBrowser");t(MSr,"buildDefaultDeviceLabel");t(RSr,"runOAuthSignIn")});var Bue=Ot((W6r,jSr)=>{jSr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.219",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:{email:"team@burtson.ai"},license:"MIT",author:{name:"Burtson Labs",email:"team@burtson.ai",url:"https://burtson.ai"},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 gTr={};module.exports=Cet(gTr);var Pm=ku(require("fs")),zue=ku(require("os")),Qp=ku(require("path")),w9=ku(require("readline")),Uue=ku(require("child_process")),em=ku(rZ()),h0=ku(SOe());var aM=ku(require("fs")),TOe=ku(require("os")),F6=ku(require("path")),hZ=ku(require("child_process"));function wb(a){return a==="~"?TOe.homedir():a.startsWith("~/")?F6.join(TOe.homedir(),a.slice(2)):a}t(wb,"expandHome");var y9=16*1024,gZ=32*1024,o_t=1e4,v1r=3e4,kOe=200,xOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function b1r(a){let s=t(_=>{let f=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!f)return[_];let[,y,k,P]=f;return k.split(",").map(O=>`${y}${O.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,f]=c;return{includes:s(f),subDir:_}}return{includes:s(a),subDir:""}}t(b1r,"expandGlobForGrep");var sM=class{constructor(s,c,_={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=_;this._readFiles=new Set;this.customRepoRoots=_.customRepoRoots&&_.customRepoRoots.length>0?_.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(wb(s))}hasFileBeenRead(s){return this._readFiles.has(wb(s))}async readFile(s){return aM.promises.readFile(wb(s),"utf-8")}async writeFile(s,c){let _=wb(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await aM.promises.mkdir(F6.dirname(_),{recursive:!0}),await aM.promises.writeFile(_,c,"utf-8")}async listFiles(s,c){let _=wb(c??this.workspaceRoot),f=S1r(s),y=[];return await c_t(_,_,f,y),y.slice(0,kOe).sort()}async listDirectoryEntries(s){let c=wb(s),_=await aM.promises.readdir(c,{withFileTypes:!0}),f=[];for(let y of _){if(y.name.startsWith("."))continue;let k=y.isDirectory();if(y.isSymbolicLink())try{k=(await aM.promises.stat(F6.join(c,y.name))).isDirectory()}catch{k=!1}f.push(k?`${y.name}/`:y.name)}return f.sort()}async searchCode(s,c,_){let f=wb(c??this.workspaceRoot);return this.runRipgrep(s,f,_).catch(()=>this.runGrep(s,f,_))}async runCommand(s,c,_){let f=c.map(wb),y=_?wb(_):this.workspaceRoot,k={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let O of["GITHUB_TOKEN","GH_TOKEN"]){let L=k[O];typeof L=="string"&&L.trim()===""&&delete k[O]}return new Promise(O=>{let L="",U="",Z=hZ.spawn(s,f,{cwd:y,shell:process.platform==="win32",env:k}),q=setTimeout(()=>{Z.kill("SIGTERM"),O({stdout:L.slice(0,gZ),stderr:U+`
1363
+ </body></html>`;t(OSr,"startLoopbackListener");t(FSr,"openBrowser");t(MSr,"buildDefaultDeviceLabel");t(RSr,"runOAuthSignIn")});var Bue=Ot((W6r,jSr)=>{jSr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.220",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:{email:"team@burtson.ai"},license:"MIT",author:{name:"Burtson Labs",email:"team@burtson.ai",url:"https://burtson.ai"},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 gTr={};module.exports=Cet(gTr);var Pm=ku(require("fs")),zue=ku(require("os")),Qp=ku(require("path")),w9=ku(require("readline")),Uue=ku(require("child_process")),em=ku(rZ()),h0=ku(SOe());var aM=ku(require("fs")),TOe=ku(require("os")),F6=ku(require("path")),hZ=ku(require("child_process"));function wb(a){return a==="~"?TOe.homedir():a.startsWith("~/")?F6.join(TOe.homedir(),a.slice(2)):a}t(wb,"expandHome");var y9=16*1024,gZ=32*1024,o_t=1e4,v1r=3e4,kOe=200,xOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function b1r(a){let s=t(_=>{let f=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!f)return[_];let[,y,k,P]=f;return k.split(",").map(O=>`${y}${O.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,f]=c;return{includes:s(f),subDir:_}}return{includes:s(a),subDir:""}}t(b1r,"expandGlobForGrep");var sM=class{constructor(s,c,_={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=_;this._readFiles=new Set;this.customRepoRoots=_.customRepoRoots&&_.customRepoRoots.length>0?_.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(wb(s))}hasFileBeenRead(s){return this._readFiles.has(wb(s))}async readFile(s){return aM.promises.readFile(wb(s),"utf-8")}async writeFile(s,c){let _=wb(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await aM.promises.mkdir(F6.dirname(_),{recursive:!0}),await aM.promises.writeFile(_,c,"utf-8")}async listFiles(s,c){let _=wb(c??this.workspaceRoot),f=S1r(s),y=[];return await c_t(_,_,f,y),y.slice(0,kOe).sort()}async listDirectoryEntries(s){let c=wb(s),_=await aM.promises.readdir(c,{withFileTypes:!0}),f=[];for(let y of _){if(y.name.startsWith("."))continue;let k=y.isDirectory();if(y.isSymbolicLink())try{k=(await aM.promises.stat(F6.join(c,y.name))).isDirectory()}catch{k=!1}f.push(k?`${y.name}/`:y.name)}return f.sort()}async searchCode(s,c,_){let f=wb(c??this.workspaceRoot);return this.runRipgrep(s,f,_).catch(()=>this.runGrep(s,f,_))}async runCommand(s,c,_){let f=c.map(wb),y=_?wb(_):this.workspaceRoot,k={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let O of["GITHUB_TOKEN","GH_TOKEN"]){let L=k[O];typeof L=="string"&&L.trim()===""&&delete k[O]}return new Promise(O=>{let L="",U="",Z=hZ.spawn(s,f,{cwd:y,shell:process.platform==="win32",env:k}),q=setTimeout(()=>{Z.kill("SIGTERM"),O({stdout:L.slice(0,gZ),stderr:U+`
1364
1364
  [process timed out]`,exitCode:124})},v1r),ve=process.stdout.isTTY===!0,he=t((Te,dt)=>{if(!ve)return;(dt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+Te+"\x1B[0m")},"writeLive");Z.stdout?.on("data",Te=>{let dt=Te.toString();L+=dt,he(dt,!1),L.length>gZ&&Z.kill("SIGTERM")}),Z.stderr?.on("data",Te=>{let dt=Te.toString();U+=dt,he(dt,!0)}),Z.on("close",Te=>{clearTimeout(q);let dt=L.slice(0,gZ);if(Te===0&&/Operation cancelled/i.test(dt)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${f.join(" ")} ${dt}`)){let bt=[s,...f].join(" ");O({stdout:dt,stderr:`Interactive scaffolder detected \u2014 \`${s}\` 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: \`!${bt}\`. 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}O({stdout:dt,stderr:U.slice(0,4*1024),exitCode:Te??0})}),Z.on("error",Te=>{if(clearTimeout(q),Te.code==="ENOENT"){O({stdout:"",stderr:`spawn ${s} ENOENT \u2014 '${s}' not found on PATH. Verify the tool is installed (\`which ${s}\` 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 \`${s}\` on PATH usually fixes it.`,exitCode:127});return}O({stdout:"",stderr:Te.message,exitCode:1})})})}async watchCommand(s,c,_,f){let y=c.map(wb),k=_?wb(_):this.workspaceRoot;return new Promise(P=>{let O="",L="",U=!1,Z=!1,q=hZ.spawn(s,y,{cwd:k,shell:process.platform==="win32",env:{...process.env}}),ve=t(mt=>{Z||(Z=!0,P({stdout:O.slice(0,gZ),stderr:L.slice(0,4*1024),exitCode:mt,endedEarly:U}))},"finish"),he=setTimeout(()=>{try{q.kill("SIGTERM")}catch{}let mt=setTimeout(()=>{try{q.kill("SIGKILL")}catch{}ve(null)},1e3);q.once("close",bt=>{clearTimeout(mt),ve(typeof bt=="number"?bt:null)})},f),Te=process.stdout.isTTY===!0,dt=t((mt,bt)=>{if(!Te)return;(bt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+mt+"\x1B[0m")},"writeLive");q.stdout?.on("data",mt=>{let bt=mt.toString();if(O+=bt,dt(bt,!1),O.length>gZ)try{q.kill("SIGTERM")}catch{}}),q.stderr?.on("data",mt=>{let bt=mt.toString();L+=bt,dt(bt,!0)}),q.on("close",mt=>{Z||(clearTimeout(he),U=!0,ve(typeof mt=="number"?mt:null))}),q.on("error",mt=>{Z||(clearTimeout(he),U=!0,L+=mt.message,ve(1))})})}runRipgrep(s,c,_){return new Promise((f,y)=>{let k=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...xOe].map(U=>["--glob",`!${U}`]).flat()];_&&k.push("--glob",_),k.push(s,c);let P="",O=hZ.spawn("rg",k,{shell:!1}),L=setTimeout(()=>{O.kill("SIGTERM"),f(P.slice(0,y9))},o_t);O.stdout?.on("data",U=>{P+=U.toString(),P.length>y9&&O.kill("SIGTERM")}),O.on("close",U=>{clearTimeout(L),U!=null&&U>=2&&P.length===0?y(new Error(`rg exited with code ${U}`)):f(P.slice(0,y9))}),O.on("error",y)})}runGrep(s,c,_){return new Promise((f,y)=>{let k=[...xOe].map(he=>["--exclude-dir",he]).flat(),P=_?b1r(_):{includes:[],subDir:""},O=P.includes.flatMap(he=>["--include",he]),L=P.subDir?`${c}/${P.subDir}`:c,U=["-rn","-E","--color=never",...k,...O,s,L],Z="",q=hZ.spawn("grep",U,{shell:!1}),ve=setTimeout(()=>{q.kill("SIGTERM"),f(Z.slice(0,y9))},o_t);q.stdout?.on("data",he=>{Z+=he.toString(),Z.length>y9&&q.kill("SIGTERM")}),q.on("close",he=>{clearTimeout(ve),he!=null&&he>=2&&Z.length===0?y(new Error(`grep exited with code ${he}`)):f(Z.slice(0,y9))}),q.on("error",y)})}};function S1r(a){let s=T1r(a);return c=>s.test(c.replace(/\\/g,"/"))}t(S1r,"compileGlob");function T1r(a){let s="^";for(let c=0;c<a.length;c++){let _=a[c];if(_==="*")a[c+1]==="*"?(s+=".*",c++,a[c+1]==="/"&&c++):s+="[^/]*";else if(_==="?")s+="[^/]";else if(_==="{"){let f=a.indexOf("}",c);if(f===-1){s+="\\{";continue}let y=a.slice(c+1,f).split(",").map(k1r).join("|");s+=`(?:${y})`,c=f}else/[.+^$()|\\]/.test(_)?s+="\\"+_:s+=_}return s+="$",new RegExp(s)}t(T1r,"globToRegex");function k1r(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(k1r,"escapeRegex");async function c_t(a,s,c,_){if(_.length>=kOe)return;let f;try{f=await aM.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let y of f){if(_.length>=kOe)return;if(xOe.has(y.name))continue;let k=F6.join(a,y.name),P=F6.relative(s,k);y.isDirectory()?await c_t(k,s,c,_):y.isFile()&&c(P)&&_.push(k)}}t(c_t,"walk");var u_t=ku(require("child_process")),dE=ku(require("fs")),f_t=ku(require("os")),wOe=ku(require("path")),__t=ku(require("crypto"));function COe(){let a=__t.randomBytes(4).toString("hex");return wOe.join(f_t.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(COe,"freshTempPath");function bue(a,s,c={}){try{let _=u_t.spawnSync(a,s,{...c,encoding:void 0});return{stdout:Buffer.isBuffer(_.stdout)?_.stdout:Buffer.from(_.stdout??""),code:_.status}}catch{return{stdout:Buffer.alloc(0),code:null}}}t(bue,"tryExec");async function Sue(){return process.platform==="darwin"?x1r():process.platform==="linux"?w1r():process.platform==="win32"?C1r():null}t(Sue,"readClipboardImage");function x1r(){let a=COe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1365
1365
  set outFile to (open for access (POSIX file "${a}") with write permission)
1366
1366
  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.219",
3
+ "version": "1.7.220",
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",