@burtson-labs/bandit-stealth-cli 1.7.242 → 1.7.243

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
@@ -1367,7 +1367,7 @@ ${(()=>{let Z=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
1367
1367
  <h1>You're signed in.</h1>
1368
1368
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1369
1369
  </div>
1370
- </body></html>`;t(eTr,"startLoopbackListener");t(tTr,"openBrowser");t(rTr,"buildDefaultDeviceLabel");t(nTr,"runOAuthSignIn")});var Wue=Nt((pOr,iTr)=>{iTr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.242",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 jTr={};module.exports=Iet(jTr);var Dm=Su(require("fs")),Vue=Su(require("os")),tm=Su(require("path")),O9=Su(require("readline")),Zue=Su(require("child_process")),rm=Su(uZ()),S0=Su(wOe());var z6=Su(require("fs")),COe=Su(require("os")),lT=Su(require("path")),CZ=Su(require("child_process"));function v1(a){return a==="~"?COe.homedir():a.startsWith("~/")?lT.join(COe.homedir(),a.slice(2)):a}t(v1,"expandHome");var x9=16*1024,wZ=32*1024,h_t=1e4,j1r=3e4,POe=200,EOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function L1r(a){let s=t(_=>{let u=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[_];let[,y,S,P]=u;return S.split(",").map(O=>`${y}${O.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,u]=c;return{includes:s(u),subDir:_}}return{includes:s(a),subDir:""}}t(L1r,"expandGlobForGrep");var _M=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(v1(s))}hasFileBeenRead(s){return this._readFiles.has(v1(s))}async readFile(s){return z6.promises.readFile(v1(s),"utf-8")}async writeFile(s,c){let _=v1(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await z6.promises.mkdir(lT.dirname(_),{recursive:!0}),await z6.promises.writeFile(_,c,"utf-8")}async deleteFile(s){let c=lT.resolve(v1(s)),_=lT.resolve(this.workspaceRoot);if(!c.startsWith(_+lT.sep)&&c!==_)throw new Error(`Refusing to delete outside workspace: ${s}`);await z6.promises.unlink(c)}async listFiles(s,c){let _=v1(c??this.workspaceRoot),u=$1r(s),y=[];return await y_t(_,_,u,y),y.slice(0,POe).sort()}async listDirectoryEntries(s){let c=v1(s),_=await z6.promises.readdir(c,{withFileTypes:!0}),u=[];for(let y of _){if(y.name.startsWith("."))continue;let S=y.isDirectory();if(y.isSymbolicLink())try{S=(await z6.promises.stat(lT.join(c,y.name))).isDirectory()}catch{S=!1}u.push(S?`${y.name}/`:y.name)}return u.sort()}async searchCode(s,c,_){let u=v1(c??this.workspaceRoot);return this.runRipgrep(s,u,_).catch(()=>this.runGrep(s,u,_))}async runCommand(s,c,_){let u=c.map(v1),y=_?v1(_):this.workspaceRoot,S={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let O of["GITHUB_TOKEN","GH_TOKEN"]){let L=S[O];typeof L=="string"&&L.trim()===""&&delete S[O]}return new Promise(O=>{let L="",U="",Z=CZ.spawn(s,u,{cwd:y,shell:process.platform==="win32",env:S}),q=setTimeout(()=>{Z.kill("SIGTERM"),O({stdout:L.slice(0,wZ),stderr:U+`
1370
+ </body></html>`;t(eTr,"startLoopbackListener");t(tTr,"openBrowser");t(rTr,"buildDefaultDeviceLabel");t(nTr,"runOAuthSignIn")});var Wue=Nt((pOr,iTr)=>{iTr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.243",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 jTr={};module.exports=Iet(jTr);var Dm=Su(require("fs")),Vue=Su(require("os")),tm=Su(require("path")),O9=Su(require("readline")),Zue=Su(require("child_process")),rm=Su(uZ()),S0=Su(wOe());var z6=Su(require("fs")),COe=Su(require("os")),lT=Su(require("path")),CZ=Su(require("child_process"));function v1(a){return a==="~"?COe.homedir():a.startsWith("~/")?lT.join(COe.homedir(),a.slice(2)):a}t(v1,"expandHome");var x9=16*1024,wZ=32*1024,h_t=1e4,j1r=3e4,POe=200,EOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function L1r(a){let s=t(_=>{let u=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[_];let[,y,S,P]=u;return S.split(",").map(O=>`${y}${O.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,u]=c;return{includes:s(u),subDir:_}}return{includes:s(a),subDir:""}}t(L1r,"expandGlobForGrep");var _M=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(v1(s))}hasFileBeenRead(s){return this._readFiles.has(v1(s))}async readFile(s){return z6.promises.readFile(v1(s),"utf-8")}async writeFile(s,c){let _=v1(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await z6.promises.mkdir(lT.dirname(_),{recursive:!0}),await z6.promises.writeFile(_,c,"utf-8")}async deleteFile(s){let c=lT.resolve(v1(s)),_=lT.resolve(this.workspaceRoot);if(!c.startsWith(_+lT.sep)&&c!==_)throw new Error(`Refusing to delete outside workspace: ${s}`);await z6.promises.unlink(c)}async listFiles(s,c){let _=v1(c??this.workspaceRoot),u=$1r(s),y=[];return await y_t(_,_,u,y),y.slice(0,POe).sort()}async listDirectoryEntries(s){let c=v1(s),_=await z6.promises.readdir(c,{withFileTypes:!0}),u=[];for(let y of _){if(y.name.startsWith("."))continue;let S=y.isDirectory();if(y.isSymbolicLink())try{S=(await z6.promises.stat(lT.join(c,y.name))).isDirectory()}catch{S=!1}u.push(S?`${y.name}/`:y.name)}return u.sort()}async searchCode(s,c,_){let u=v1(c??this.workspaceRoot);return this.runRipgrep(s,u,_).catch(()=>this.runGrep(s,u,_))}async runCommand(s,c,_){let u=c.map(v1),y=_?v1(_):this.workspaceRoot,S={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let O of["GITHUB_TOKEN","GH_TOKEN"]){let L=S[O];typeof L=="string"&&L.trim()===""&&delete S[O]}return new Promise(O=>{let L="",U="",Z=CZ.spawn(s,u,{cwd:y,shell:process.platform==="win32",env:S}),q=setTimeout(()=>{Z.kill("SIGTERM"),O({stdout:L.slice(0,wZ),stderr:U+`
1371
1371
  [process timed out]`,exitCode:124})},j1r),ye=process.stdout.isTTY===!0,ge=t((Te,dt)=>{if(!ye)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,ge(dt,!1),L.length>wZ&&Z.kill("SIGTERM")}),Z.stderr?.on("data",Te=>{let dt=Te.toString();U+=dt,ge(dt,!0)}),Z.on("close",Te=>{clearTimeout(q);let dt=L.slice(0,wZ);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} ${u.join(" ")} ${dt}`)){let bt=[s,...u].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,_,u){let y=c.map(v1),S=_?v1(_):this.workspaceRoot;return new Promise(P=>{let O="",L="",U=!1,Z=!1,q=CZ.spawn(s,y,{cwd:S,shell:process.platform==="win32",env:{...process.env}}),ye=t(mt=>{Z||(Z=!0,P({stdout:O.slice(0,wZ),stderr:L.slice(0,4*1024),exitCode:mt,endedEarly:U}))},"finish"),ge=setTimeout(()=>{try{q.kill("SIGTERM")}catch{}let mt=setTimeout(()=>{try{q.kill("SIGKILL")}catch{}ye(null)},1e3);q.once("close",bt=>{clearTimeout(mt),ye(typeof bt=="number"?bt:null)})},u),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>wZ)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(ge),U=!0,ye(typeof mt=="number"?mt:null))}),q.on("error",mt=>{Z||(clearTimeout(ge),U=!0,L+=mt.message,ye(1))})})}runRipgrep(s,c,_){return new Promise((u,y)=>{let S=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...EOe].map(U=>["--glob",`!${U}`]).flat()];_&&S.push("--glob",_),S.push(s,c);let P="",O=CZ.spawn("rg",S,{shell:!1}),L=setTimeout(()=>{O.kill("SIGTERM"),u(P.slice(0,x9))},h_t);O.stdout?.on("data",U=>{P+=U.toString(),P.length>x9&&O.kill("SIGTERM")}),O.on("close",U=>{clearTimeout(L),U!=null&&U>=2&&P.length===0?y(new Error(`rg exited with code ${U}`)):u(P.slice(0,x9))}),O.on("error",y)})}runGrep(s,c,_){return new Promise((u,y)=>{let S=[...EOe].map(ge=>["--exclude-dir",ge]).flat(),P=_?L1r(_):{includes:[],subDir:""},O=P.includes.flatMap(ge=>["--include",ge]),L=P.subDir?`${c}/${P.subDir}`:c,U=["-rn","-E","--color=never",...S,...O,s,L],Z="",q=CZ.spawn("grep",U,{shell:!1}),ye=setTimeout(()=>{q.kill("SIGTERM"),u(Z.slice(0,x9))},h_t);q.stdout?.on("data",ge=>{Z+=ge.toString(),Z.length>x9&&q.kill("SIGTERM")}),q.on("close",ge=>{clearTimeout(ye),ge!=null&&ge>=2&&Z.length===0?y(new Error(`grep exited with code ${ge}`)):u(Z.slice(0,x9))}),q.on("error",y)})}};function $1r(a){let s=B1r(a);return c=>s.test(c.replace(/\\/g,"/"))}t($1r,"compileGlob");function B1r(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 u=a.indexOf("}",c);if(u===-1){s+="\\{";continue}let y=a.slice(c+1,u).split(",").map(z1r).join("|");s+=`(?:${y})`,c=u}else/[.+^$()|\\]/.test(_)?s+="\\"+_:s+=_}return s+="$",new RegExp(s)}t(B1r,"globToRegex");function z1r(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(z1r,"escapeRegex");async function y_t(a,s,c,_){if(_.length>=POe)return;let u;try{u=await z6.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let y of u){if(_.length>=POe)return;if(EOe.has(y.name))continue;let S=lT.join(a,y.name),P=lT.relative(s,S);y.isDirectory()?await y_t(S,s,c,_):y.isFile()&&c(P)&&_.push(S)}}t(y_t,"walk");var b_t=Su(require("child_process")),yE=Su(require("fs")),S_t=Su(require("os")),DOe=Su(require("path")),T_t=Su(require("crypto"));function IOe(){let a=T_t.randomBytes(4).toString("hex");return DOe.join(S_t.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(IOe,"freshTempPath");function xue(a,s,c={}){try{let _=b_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(xue,"tryExec");async function wue(){return process.platform==="darwin"?U1r():process.platform==="linux"?q1r():process.platform==="win32"?J1r():null}t(wue,"readClipboardImage");function U1r(){let a=IOe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1372
1372
  set outFile to (open for access (POSIX file "${a}") with write permission)
1373
1373
  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.242",
3
+ "version": "1.7.243",
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",