@burtson-labs/bandit-stealth-cli 1.7.235 → 1.7.236

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
@@ -1361,7 +1361,7 @@ ${(()=>{let Z=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
1361
1361
  <h1>You're signed in.</h1>
1362
1362
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1363
1363
  </div>
1364
- </body></html>`;t(MSr,"startLoopbackListener");t(RSr,"openBrowser");t(jSr,"buildDefaultDeviceLabel");t(LSr,"runOAuthSignIn")});var Bue=Ot((Z6r,$Sr)=>{$Sr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.235",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 yTr={};module.exports=Cet(yTr);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 M6=ku(require("fs")),TOe=ku(require("os")),aT=ku(require("path")),yZ=ku(require("child_process"));function m1(a){return a==="~"?TOe.homedir():a.startsWith("~/")?aT.join(TOe.homedir(),a.slice(2)):a}t(m1,"expandHome");var y9=16*1024,hZ=32*1024,c_t=1e4,b1r=3e4,kOe=200,xOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function S1r(a){let s=t(_=>{let u=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[_];let[,y,k,P]=u;return k.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(S1r,"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(m1(s))}hasFileBeenRead(s){return this._readFiles.has(m1(s))}async readFile(s){return M6.promises.readFile(m1(s),"utf-8")}async writeFile(s,c){let _=m1(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await M6.promises.mkdir(aT.dirname(_),{recursive:!0}),await M6.promises.writeFile(_,c,"utf-8")}async deleteFile(s){let c=aT.resolve(m1(s)),_=aT.resolve(this.workspaceRoot);if(!c.startsWith(_+aT.sep)&&c!==_)throw new Error(`Refusing to delete outside workspace: ${s}`);await M6.promises.unlink(c)}async listFiles(s,c){let _=m1(c??this.workspaceRoot),u=T1r(s),y=[];return await l_t(_,_,u,y),y.slice(0,kOe).sort()}async listDirectoryEntries(s){let c=m1(s),_=await M6.promises.readdir(c,{withFileTypes:!0}),u=[];for(let y of _){if(y.name.startsWith("."))continue;let k=y.isDirectory();if(y.isSymbolicLink())try{k=(await M6.promises.stat(aT.join(c,y.name))).isDirectory()}catch{k=!1}u.push(k?`${y.name}/`:y.name)}return u.sort()}async searchCode(s,c,_){let u=m1(c??this.workspaceRoot);return this.runRipgrep(s,u,_).catch(()=>this.runGrep(s,u,_))}async runCommand(s,c,_){let u=c.map(m1),y=_?m1(_):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=yZ.spawn(s,u,{cwd:y,shell:process.platform==="win32",env:k}),q=setTimeout(()=>{Z.kill("SIGTERM"),O({stdout:L.slice(0,hZ),stderr:U+`
1364
+ </body></html>`;t(MSr,"startLoopbackListener");t(RSr,"openBrowser");t(jSr,"buildDefaultDeviceLabel");t(LSr,"runOAuthSignIn")});var Bue=Ot((Z6r,$Sr)=>{$Sr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.236",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 yTr={};module.exports=Cet(yTr);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 M6=ku(require("fs")),TOe=ku(require("os")),aT=ku(require("path")),yZ=ku(require("child_process"));function m1(a){return a==="~"?TOe.homedir():a.startsWith("~/")?aT.join(TOe.homedir(),a.slice(2)):a}t(m1,"expandHome");var y9=16*1024,hZ=32*1024,c_t=1e4,b1r=3e4,kOe=200,xOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function S1r(a){let s=t(_=>{let u=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[_];let[,y,k,P]=u;return k.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(S1r,"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(m1(s))}hasFileBeenRead(s){return this._readFiles.has(m1(s))}async readFile(s){return M6.promises.readFile(m1(s),"utf-8")}async writeFile(s,c){let _=m1(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await M6.promises.mkdir(aT.dirname(_),{recursive:!0}),await M6.promises.writeFile(_,c,"utf-8")}async deleteFile(s){let c=aT.resolve(m1(s)),_=aT.resolve(this.workspaceRoot);if(!c.startsWith(_+aT.sep)&&c!==_)throw new Error(`Refusing to delete outside workspace: ${s}`);await M6.promises.unlink(c)}async listFiles(s,c){let _=m1(c??this.workspaceRoot),u=T1r(s),y=[];return await l_t(_,_,u,y),y.slice(0,kOe).sort()}async listDirectoryEntries(s){let c=m1(s),_=await M6.promises.readdir(c,{withFileTypes:!0}),u=[];for(let y of _){if(y.name.startsWith("."))continue;let k=y.isDirectory();if(y.isSymbolicLink())try{k=(await M6.promises.stat(aT.join(c,y.name))).isDirectory()}catch{k=!1}u.push(k?`${y.name}/`:y.name)}return u.sort()}async searchCode(s,c,_){let u=m1(c??this.workspaceRoot);return this.runRipgrep(s,u,_).catch(()=>this.runGrep(s,u,_))}async runCommand(s,c,_){let u=c.map(m1),y=_?m1(_):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=yZ.spawn(s,u,{cwd:y,shell:process.platform==="win32",env:k}),q=setTimeout(()=>{Z.kill("SIGTERM"),O({stdout:L.slice(0,hZ),stderr:U+`
1365
1365
  [process timed out]`,exitCode:124})},b1r),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>hZ&&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,hZ);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(m1),k=_?m1(_):this.workspaceRoot;return new Promise(P=>{let O="",L="",U=!1,Z=!1,q=yZ.spawn(s,y,{cwd:k,shell:process.platform==="win32",env:{...process.env}}),ye=t(mt=>{Z||(Z=!0,P({stdout:O.slice(0,hZ),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>hZ)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 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=yZ.spawn("rg",k,{shell:!1}),L=setTimeout(()=>{O.kill("SIGTERM"),u(P.slice(0,y9))},c_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}`)):u(P.slice(0,y9))}),O.on("error",y)})}runGrep(s,c,_){return new Promise((u,y)=>{let k=[...xOe].map(ge=>["--exclude-dir",ge]).flat(),P=_?S1r(_):{includes:[],subDir:""},O=P.includes.flatMap(ge=>["--include",ge]),L=P.subDir?`${c}/${P.subDir}`:c,U=["-rn","-E","--color=never",...k,...O,s,L],Z="",q=yZ.spawn("grep",U,{shell:!1}),ye=setTimeout(()=>{q.kill("SIGTERM"),u(Z.slice(0,y9))},c_t);q.stdout?.on("data",ge=>{Z+=ge.toString(),Z.length>y9&&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,y9))}),q.on("error",y)})}};function T1r(a){let s=k1r(a);return c=>s.test(c.replace(/\\/g,"/"))}t(T1r,"compileGlob");function k1r(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(x1r).join("|");s+=`(?:${y})`,c=u}else/[.+^$()|\\]/.test(_)?s+="\\"+_:s+=_}return s+="$",new RegExp(s)}t(k1r,"globToRegex");function x1r(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(x1r,"escapeRegex");async function l_t(a,s,c,_){if(_.length>=kOe)return;let u;try{u=await M6.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let y of u){if(_.length>=kOe)return;if(xOe.has(y.name))continue;let k=aT.join(a,y.name),P=aT.relative(s,k);y.isDirectory()?await l_t(k,s,c,_):y.isFile()&&c(P)&&_.push(k)}}t(l_t,"walk");var f_t=ku(require("child_process")),pE=ku(require("fs")),__t=ku(require("os")),wOe=ku(require("path")),d_t=ku(require("crypto"));function COe(){let a=d_t.randomBytes(4).toString("hex");return wOe.join(__t.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(COe,"freshTempPath");function bue(a,s,c={}){try{let _=f_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"?w1r():process.platform==="linux"?C1r():process.platform==="win32"?P1r():null}t(Sue,"readClipboardImage");function w1r(){let a=COe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1366
1366
  set outFile to (open for access (POSIX file "${a}") with write permission)
1367
1367
  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.235",
3
+ "version": "1.7.236",
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",