@burtson-labs/bandit-stealth-cli 1.7.45 → 1.7.46

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
@@ -810,7 +810,7 @@ ${x}`;try{let he=await fe.run(x,d.chat,de);ue("task:done",{goal:x,iterations:he.
810
810
  `),x=g.split(`
811
811
  `),E=T.length,J=x.length;if(E*J>4e4)return{plus:x.length,minus:T.length};let Q=Array.from({length:E+1},()=>new Array(J+1).fill(0));for(let we=1;we<=E;we++)for(let te=1;te<=J;te++)Q[we][te]=T[we-1]===x[te-1]?Q[we-1][te-1]+1:Math.max(Q[we-1][te],Q[we][te-1]);let ue=E,fe=J,de=0,he=0;for(;ue>0&&fe>0;)T[ue-1]===x[fe-1]?(ue--,fe--):Q[ue][fe-1]>=Q[ue-1][fe]?(de++,fe--):(he++,ue--);return de+=fe,he+=ue,{plus:de,minus:he}}t(yIt,"lineCountDiff");function vIt(d){if(d.isNewFile)return"(new file)";let g=d.after.split(`
812
812
  `),T=d.before.split(`
813
- `);for(let x=0;x<g.length;x++)if(g[x]!==T[x]){let E=(g[x]??"").trim();if(E)return E.length>80?E.slice(0,77)+"\u2026":E}return"(whitespace-only edit)"}t(vIt,"describeEdit");var OSe=class{static{t(this,"CheckpointStore")}constructor(g){this.counter=0,this.workspaceRoot=g.workspaceRoot,this.dir=RD.join(g.workspaceRoot,".bandit","checkpoints"),this.maxIndexEntries=g.maxIndexEntries??hIt}async create(g){await qw.promises.mkdir(RD.join(this.dir,g.turnId),{recursive:!0}),this.counter++;let T=`chk-${g.turnId.split("-").pop()??"x"}-${String(this.counter).padStart(3,"0")}`,x=RD.relative(this.workspaceRoot,g.absolutePath)||g.absolutePath,E=g.before.length===0,J={id:T,turnId:g.turnId,timestamp:Date.now(),tool:g.tool,path:g.absolutePath,relPath:x,before:g.before,after:g.after,isNewFile:E,iteration:g.iteration,description:vIt({before:g.before,after:g.after,isNewFile:E})},Q=RD.join(this.dir,g.turnId,`${T}.json`);return await qw.promises.writeFile(Q,JSON.stringify(J,null,2)),await this.appendToIndex(J),J}async list(g=20){return(await this.readIndex()).slice(0,g)}async get(g){let x=(await this.readIndex()).find(J=>J.id===g);if(!x)return null;let E=RD.join(this.dir,x.turnId,`${g}.json`);try{let J=await qw.promises.readFile(E,"utf-8");return JSON.parse(J)}catch{return null}}async rewind(g){let T=await this.get(g);if(!T)return null;try{return T.isNewFile?await qw.promises.unlink(T.path).catch(()=>{}):(await qw.promises.mkdir(RD.dirname(T.path),{recursive:!0}),await qw.promises.writeFile(T.path,T.before)),T}catch{return null}}async readIndex(){let g=RD.join(this.dir,MWe);try{let T=await qw.promises.readFile(g,"utf-8"),x=JSON.parse(T);return Array.isArray(x)?x:[]}catch{return[]}}async writeIndex(g){await qw.promises.mkdir(this.dir,{recursive:!0});let T=RD.join(this.dir,MWe);await qw.promises.writeFile(T,JSON.stringify(g,null,2))}async appendToIndex(g){let{plus:T,minus:x}=yIt(g.before,g.after),E={id:g.id,turnId:g.turnId,timestamp:g.timestamp,tool:g.tool,relPath:g.relPath,iteration:g.iteration,description:g.description,plus:T,minus:x},J=await this.readIndex();J.unshift(E);let Q=J.slice(0,this.maxIndexEntries);await this.writeIndex(Q)}};ek.CheckpointStore=OSe});var LSe=Ti(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.CheckpointStore=Ol.isChatCapable=Ol.suggestOllamaMatch=Ol.listInstalledOllamaModels=Ol.previewText=Ol.openTurnLog=Ol.SessionPermissionStore=Ol.mergePolicies=Ol.emptyPolicy=Ol.evaluatePermission=Ol.buildTaskTool=Ol.buildWebFetchTool=Ol.buildTodoWriteTool=Ol.TodoStore=Ol.expandMentions=Ol.runHooks=Ol.persistAllowEntry=Ol.loadHookSettings=Ol.loadMemory=void 0;var bIt=gWe();Object.defineProperty(Ol,"loadMemory",{enumerable:!0,get:t(function(){return bIt.loadMemory},"get")});var FSe=yWe();Object.defineProperty(Ol,"loadHookSettings",{enumerable:!0,get:t(function(){return FSe.loadHookSettings},"get")});Object.defineProperty(Ol,"persistAllowEntry",{enumerable:!0,get:t(function(){return FSe.persistAllowEntry},"get")});Object.defineProperty(Ol,"runHooks",{enumerable:!0,get:t(function(){return FSe.runHooks},"get")});var SIt=TWe();Object.defineProperty(Ol,"expandMentions",{enumerable:!0,get:t(function(){return SIt.expandMentions},"get")});var MSe=kWe();Object.defineProperty(Ol,"TodoStore",{enumerable:!0,get:t(function(){return MSe.TodoStore},"get")});Object.defineProperty(Ol,"buildTodoWriteTool",{enumerable:!0,get:t(function(){return MSe.buildTodoWriteTool},"get")});Object.defineProperty(Ol,"buildWebFetchTool",{enumerable:!0,get:t(function(){return MSe.buildWebFetchTool},"get")});var TIt=EWe();Object.defineProperty(Ol,"buildTaskTool",{enumerable:!0,get:t(function(){return TIt.buildTaskTool},"get")});var PZ=PWe();Object.defineProperty(Ol,"evaluatePermission",{enumerable:!0,get:t(function(){return PZ.evaluatePermission},"get")});Object.defineProperty(Ol,"emptyPolicy",{enumerable:!0,get:t(function(){return PZ.emptyPolicy},"get")});Object.defineProperty(Ol,"mergePolicies",{enumerable:!0,get:t(function(){return PZ.mergePolicies},"get")});Object.defineProperty(Ol,"SessionPermissionStore",{enumerable:!0,get:t(function(){return PZ.SessionPermissionStore},"get")});var jWe=OWe();Object.defineProperty(Ol,"openTurnLog",{enumerable:!0,get:t(function(){return jWe.openTurnLog},"get")});Object.defineProperty(Ol,"previewText",{enumerable:!0,get:t(function(){return jWe.previewText},"get")});var RSe=FWe();Object.defineProperty(Ol,"listInstalledOllamaModels",{enumerable:!0,get:t(function(){return RSe.listInstalledOllamaModels},"get")});Object.defineProperty(Ol,"suggestOllamaMatch",{enumerable:!0,get:t(function(){return RSe.suggestOllamaMatch},"get")});Object.defineProperty(Ol,"isChatCapable",{enumerable:!0,get:t(function(){return RSe.isChatCapable},"get")});var xIt=LWe();Object.defineProperty(Ol,"CheckpointStore",{enumerable:!0,get:t(function(){return xIt.CheckpointStore},"get")})});var DZ=Ti((NFt,kIt)=>{kIt.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.45",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 WIt={};module.exports=r2t(WIt);var ly=Zu(require("fs")),Mg=Zu(require("path")),GB=Zu(require("readline")),pS=Zu(LY()),EI=Zu(_Se());var kI=Zu(require("fs")),pSe=Zu(require("os")),FD=Zu(require("path")),yZ=Zu(require("child_process"));function VB(d){return d==="~"?pSe.homedir():d.startsWith("~/")?FD.join(pSe.homedir(),d.slice(2)):d}t(VB,"expandHome");var YO=16*1024,fSe=32*1024,Bze=1e4,a4t=3e4,dSe=200,mSe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function o4t(d){let g=t(x=>{let E=x.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!E)return[x];let[,J,Q,ue]=E;return Q.split(",").map(fe=>`${J}${fe.trim()}${ue}`)},"braceExpand"),T=d.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(T){let[,x,E]=T;return{includes:g(E),subDir:x}}return{includes:g(d),subDir:""}}t(o4t,"expandGlobForGrep");var ZO=class{constructor(g,T,x={}){this.workspaceRoot=g;this.languageAdapters=T;this.options=x}static{t(this,"CliToolExecutionContext")}async readFile(g){return kI.promises.readFile(VB(g),"utf-8")}async writeFile(g,T){let x=VB(g);if(this.options.approveWrite&&!await this.options.approveWrite(x,T))throw new Error(`Write to ${x} rejected by user`);await kI.promises.mkdir(FD.dirname(x),{recursive:!0}),await kI.promises.writeFile(x,T,"utf-8")}async listFiles(g,T){let x=VB(T??this.workspaceRoot),E=c4t(g),J=[];return await Jze(x,x,E,J),J.slice(0,dSe).sort()}async listDirectoryEntries(g){let T=VB(g),x=await kI.promises.readdir(T,{withFileTypes:!0}),E=[];for(let J of x){if(J.name.startsWith("."))continue;let Q=J.isDirectory();if(J.isSymbolicLink())try{Q=(await kI.promises.stat(FD.join(T,J.name))).isDirectory()}catch{Q=!1}E.push(Q?`${J.name}/`:J.name)}return E.sort()}async searchCode(g,T,x){let E=VB(T??this.workspaceRoot);return this.runRipgrep(g,E,x).catch(()=>this.runGrep(g,E,x))}async runCommand(g,T,x){return new Promise(E=>{let J="",Q="",ue=yZ.spawn(g,T,{cwd:x??this.workspaceRoot,shell:!1,env:{...process.env}}),fe=setTimeout(()=>{ue.kill("SIGTERM"),E({stdout:J.slice(0,fSe),stderr:Q+`
813
+ `);for(let x=0;x<g.length;x++)if(g[x]!==T[x]){let E=(g[x]??"").trim();if(E)return E.length>80?E.slice(0,77)+"\u2026":E}return"(whitespace-only edit)"}t(vIt,"describeEdit");var OSe=class{static{t(this,"CheckpointStore")}constructor(g){this.counter=0,this.workspaceRoot=g.workspaceRoot,this.dir=RD.join(g.workspaceRoot,".bandit","checkpoints"),this.maxIndexEntries=g.maxIndexEntries??hIt}async create(g){await qw.promises.mkdir(RD.join(this.dir,g.turnId),{recursive:!0}),this.counter++;let T=`chk-${g.turnId.split("-").pop()??"x"}-${String(this.counter).padStart(3,"0")}`,x=RD.relative(this.workspaceRoot,g.absolutePath)||g.absolutePath,E=g.before.length===0,J={id:T,turnId:g.turnId,timestamp:Date.now(),tool:g.tool,path:g.absolutePath,relPath:x,before:g.before,after:g.after,isNewFile:E,iteration:g.iteration,description:vIt({before:g.before,after:g.after,isNewFile:E})},Q=RD.join(this.dir,g.turnId,`${T}.json`);return await qw.promises.writeFile(Q,JSON.stringify(J,null,2)),await this.appendToIndex(J),J}async list(g=20){return(await this.readIndex()).slice(0,g)}async get(g){let x=(await this.readIndex()).find(J=>J.id===g);if(!x)return null;let E=RD.join(this.dir,x.turnId,`${g}.json`);try{let J=await qw.promises.readFile(E,"utf-8");return JSON.parse(J)}catch{return null}}async rewind(g){let T=await this.get(g);if(!T)return null;try{return T.isNewFile?await qw.promises.unlink(T.path).catch(()=>{}):(await qw.promises.mkdir(RD.dirname(T.path),{recursive:!0}),await qw.promises.writeFile(T.path,T.before)),T}catch{return null}}async readIndex(){let g=RD.join(this.dir,MWe);try{let T=await qw.promises.readFile(g,"utf-8"),x=JSON.parse(T);return Array.isArray(x)?x:[]}catch{return[]}}async writeIndex(g){await qw.promises.mkdir(this.dir,{recursive:!0});let T=RD.join(this.dir,MWe);await qw.promises.writeFile(T,JSON.stringify(g,null,2))}async appendToIndex(g){let{plus:T,minus:x}=yIt(g.before,g.after),E={id:g.id,turnId:g.turnId,timestamp:g.timestamp,tool:g.tool,relPath:g.relPath,iteration:g.iteration,description:g.description,plus:T,minus:x},J=await this.readIndex();J.unshift(E);let Q=J.slice(0,this.maxIndexEntries);await this.writeIndex(Q)}};ek.CheckpointStore=OSe});var LSe=Ti(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.CheckpointStore=Ol.isChatCapable=Ol.suggestOllamaMatch=Ol.listInstalledOllamaModels=Ol.previewText=Ol.openTurnLog=Ol.SessionPermissionStore=Ol.mergePolicies=Ol.emptyPolicy=Ol.evaluatePermission=Ol.buildTaskTool=Ol.buildWebFetchTool=Ol.buildTodoWriteTool=Ol.TodoStore=Ol.expandMentions=Ol.runHooks=Ol.persistAllowEntry=Ol.loadHookSettings=Ol.loadMemory=void 0;var bIt=gWe();Object.defineProperty(Ol,"loadMemory",{enumerable:!0,get:t(function(){return bIt.loadMemory},"get")});var FSe=yWe();Object.defineProperty(Ol,"loadHookSettings",{enumerable:!0,get:t(function(){return FSe.loadHookSettings},"get")});Object.defineProperty(Ol,"persistAllowEntry",{enumerable:!0,get:t(function(){return FSe.persistAllowEntry},"get")});Object.defineProperty(Ol,"runHooks",{enumerable:!0,get:t(function(){return FSe.runHooks},"get")});var SIt=TWe();Object.defineProperty(Ol,"expandMentions",{enumerable:!0,get:t(function(){return SIt.expandMentions},"get")});var MSe=kWe();Object.defineProperty(Ol,"TodoStore",{enumerable:!0,get:t(function(){return MSe.TodoStore},"get")});Object.defineProperty(Ol,"buildTodoWriteTool",{enumerable:!0,get:t(function(){return MSe.buildTodoWriteTool},"get")});Object.defineProperty(Ol,"buildWebFetchTool",{enumerable:!0,get:t(function(){return MSe.buildWebFetchTool},"get")});var TIt=EWe();Object.defineProperty(Ol,"buildTaskTool",{enumerable:!0,get:t(function(){return TIt.buildTaskTool},"get")});var PZ=PWe();Object.defineProperty(Ol,"evaluatePermission",{enumerable:!0,get:t(function(){return PZ.evaluatePermission},"get")});Object.defineProperty(Ol,"emptyPolicy",{enumerable:!0,get:t(function(){return PZ.emptyPolicy},"get")});Object.defineProperty(Ol,"mergePolicies",{enumerable:!0,get:t(function(){return PZ.mergePolicies},"get")});Object.defineProperty(Ol,"SessionPermissionStore",{enumerable:!0,get:t(function(){return PZ.SessionPermissionStore},"get")});var jWe=OWe();Object.defineProperty(Ol,"openTurnLog",{enumerable:!0,get:t(function(){return jWe.openTurnLog},"get")});Object.defineProperty(Ol,"previewText",{enumerable:!0,get:t(function(){return jWe.previewText},"get")});var RSe=FWe();Object.defineProperty(Ol,"listInstalledOllamaModels",{enumerable:!0,get:t(function(){return RSe.listInstalledOllamaModels},"get")});Object.defineProperty(Ol,"suggestOllamaMatch",{enumerable:!0,get:t(function(){return RSe.suggestOllamaMatch},"get")});Object.defineProperty(Ol,"isChatCapable",{enumerable:!0,get:t(function(){return RSe.isChatCapable},"get")});var xIt=LWe();Object.defineProperty(Ol,"CheckpointStore",{enumerable:!0,get:t(function(){return xIt.CheckpointStore},"get")})});var DZ=Ti((NFt,kIt)=>{kIt.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.46",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 WIt={};module.exports=r2t(WIt);var ly=Zu(require("fs")),Mg=Zu(require("path")),GB=Zu(require("readline")),pS=Zu(LY()),EI=Zu(_Se());var kI=Zu(require("fs")),pSe=Zu(require("os")),FD=Zu(require("path")),yZ=Zu(require("child_process"));function VB(d){return d==="~"?pSe.homedir():d.startsWith("~/")?FD.join(pSe.homedir(),d.slice(2)):d}t(VB,"expandHome");var YO=16*1024,fSe=32*1024,Bze=1e4,a4t=3e4,dSe=200,mSe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function o4t(d){let g=t(x=>{let E=x.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!E)return[x];let[,J,Q,ue]=E;return Q.split(",").map(fe=>`${J}${fe.trim()}${ue}`)},"braceExpand"),T=d.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(T){let[,x,E]=T;return{includes:g(E),subDir:x}}return{includes:g(d),subDir:""}}t(o4t,"expandGlobForGrep");var ZO=class{constructor(g,T,x={}){this.workspaceRoot=g;this.languageAdapters=T;this.options=x}static{t(this,"CliToolExecutionContext")}async readFile(g){return kI.promises.readFile(VB(g),"utf-8")}async writeFile(g,T){let x=VB(g);if(this.options.approveWrite&&!await this.options.approveWrite(x,T))throw new Error(`Write to ${x} rejected by user`);await kI.promises.mkdir(FD.dirname(x),{recursive:!0}),await kI.promises.writeFile(x,T,"utf-8")}async listFiles(g,T){let x=VB(T??this.workspaceRoot),E=c4t(g),J=[];return await Jze(x,x,E,J),J.slice(0,dSe).sort()}async listDirectoryEntries(g){let T=VB(g),x=await kI.promises.readdir(T,{withFileTypes:!0}),E=[];for(let J of x){if(J.name.startsWith("."))continue;let Q=J.isDirectory();if(J.isSymbolicLink())try{Q=(await kI.promises.stat(FD.join(T,J.name))).isDirectory()}catch{Q=!1}E.push(Q?`${J.name}/`:J.name)}return E.sort()}async searchCode(g,T,x){let E=VB(T??this.workspaceRoot);return this.runRipgrep(g,E,x).catch(()=>this.runGrep(g,E,x))}async runCommand(g,T,x){return new Promise(E=>{let J="",Q="",ue=yZ.spawn(g,T,{cwd:x??this.workspaceRoot,shell:!1,env:{...process.env}}),fe=setTimeout(()=>{ue.kill("SIGTERM"),E({stdout:J.slice(0,fSe),stderr:Q+`
814
814
  [process timed out]`,exitCode:124})},a4t);ue.stdout?.on("data",de=>{J+=de.toString(),J.length>fSe&&ue.kill("SIGTERM")}),ue.stderr?.on("data",de=>{Q+=de.toString()}),ue.on("close",de=>{clearTimeout(fe),E({stdout:J.slice(0,fSe),stderr:Q.slice(0,4*1024),exitCode:de??0})}),ue.on("error",de=>{clearTimeout(fe),E({stdout:"",stderr:de.message,exitCode:1})})})}runRipgrep(g,T,x){return new Promise((E,J)=>{let Q=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...mSe].map(he=>["--glob",`!${he}`]).flat()];x&&Q.push("--glob",x),Q.push(g,T);let ue="",fe=yZ.spawn("rg",Q,{shell:!1}),de=setTimeout(()=>{fe.kill("SIGTERM"),E(ue.slice(0,YO))},Bze);fe.stdout?.on("data",he=>{ue+=he.toString(),ue.length>YO&&fe.kill("SIGTERM")}),fe.on("close",he=>{clearTimeout(de),he!=null&&he>=2&&ue.length===0?J(new Error(`rg exited with code ${he}`)):E(ue.slice(0,YO))}),fe.on("error",J)})}runGrep(g,T,x){return new Promise((E,J)=>{let Q=[...mSe].map(Ve=>["--exclude-dir",Ve]).flat(),ue=x?o4t(x):{includes:[],subDir:""},fe=ue.includes.flatMap(Ve=>["--include",Ve]),de=ue.subDir?`${T}/${ue.subDir}`:T,he=["-rn","-E","--color=never",...Q,...fe,g,de],we="",te=yZ.spawn("grep",he,{shell:!1}),lt=setTimeout(()=>{te.kill("SIGTERM"),E(we.slice(0,YO))},Bze);te.stdout?.on("data",Ve=>{we+=Ve.toString(),we.length>YO&&te.kill("SIGTERM")}),te.on("close",Ve=>{clearTimeout(lt),Ve!=null&&Ve>=2&&we.length===0?J(new Error(`grep exited with code ${Ve}`)):E(we.slice(0,YO))}),te.on("error",J)})}};function c4t(d){let g=l4t(d);return T=>g.test(T.replace(/\\/g,"/"))}t(c4t,"compileGlob");function l4t(d){let g="^";for(let T=0;T<d.length;T++){let x=d[T];if(x==="*")d[T+1]==="*"?(g+=".*",T++,d[T+1]==="/"&&T++):g+="[^/]*";else if(x==="?")g+="[^/]";else if(x==="{"){let E=d.indexOf("}",T);if(E===-1){g+="\\{";continue}let J=d.slice(T+1,E).split(",").map(u4t).join("|");g+=`(?:${J})`,T=E}else/[.+^$()|\\]/.test(x)?g+="\\"+x:g+=x}return g+="$",new RegExp(g)}t(l4t,"globToRegex");function u4t(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(u4t,"escapeRegex");async function Jze(d,g,T,x){if(x.length>=dSe)return;let E;try{E=await kI.promises.readdir(d,{withFileTypes:!0})}catch{return}for(let J of E){if(x.length>=dSe)return;if(mSe.has(J.name))continue;let Q=FD.join(d,J.name),ue=FD.relative(g,Q);J.isDirectory()?await Jze(Q,g,T,x):J.isFile()&&T(ue)&&x.push(Q)}}t(Jze,"walk");var Wze=Zu(require("child_process")),Kx=Zu(require("fs")),Uze=Zu(require("os")),gSe=Zu(require("path")),$ze=Zu(require("crypto"));function hSe(){let d=$ze.randomBytes(4).toString("hex");return gSe.join(Uze.tmpdir(),`bandit-paste-${Date.now()}-${d}.png`)}t(hSe,"freshTempPath");function vZ(d,g,T={}){try{let x=Wze.spawnSync(d,g,{...T,encoding:void 0});return{stdout:Buffer.isBuffer(x.stdout)?x.stdout:Buffer.from(x.stdout??""),code:x.status}}catch{return{stdout:Buffer.alloc(0),code:null}}}t(vZ,"tryExec");async function bZ(){return process.platform==="darwin"?_4t():process.platform==="linux"?f4t():process.platform==="win32"?p4t():null}t(bZ,"readClipboardImage");function _4t(){let d=hSe(),g=`set pngData to (the clipboard as \xABclass PNGf\xBB)
815
815
  set outFile to (open for access (POSIX file "${d}") with write permission)
816
816
  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.45",
3
+ "version": "1.7.46",
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",