@burtson-labs/bandit-stealth-cli 1.7.191 → 1.7.193

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
@@ -1363,7 +1363,7 @@ ${(()=>{let Z=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
1363
1363
  <h1>You're signed in.</h1>
1364
1364
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1365
1365
  </div>
1366
- </body></html>`;t(PSr,"startLoopbackListener");t(ESr,"openBrowser");t(DSr,"buildDefaultDeviceLabel");t(ISr,"runOAuthSignIn")});var jue=Ot(($6r,ASr)=>{ASr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.191",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 uTr={};module.exports=wet(uTr);var wm=vu(require("fs")),Lue=vu(require("os")),Xp=vu(require("path")),k9=vu(require("readline")),$ue=vu(require("child_process")),Yp=vu(eZ()),Dy=vu(bOe());var rM=vu(require("fs")),SOe=vu(require("os")),N6=vu(require("path")),mZ=vu(require("child_process"));function yb(a){return a==="~"?SOe.homedir():a.startsWith("~/")?N6.join(SOe.homedir(),a.slice(2)):a}t(yb,"expandHome");var g9=16*1024,pZ=32*1024,o_t=1e4,g1r=3e4,TOe=200,kOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function h1r(a){let s=t(_=>{let u=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[_];let[,y,k,P]=u;return k.split(",").map(F=>`${y}${F.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,u]=c;return{includes:s(u),subDir:_}}return{includes:s(a),subDir:""}}t(h1r,"expandGlobForGrep");var nM=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(yb(s))}hasFileBeenRead(s){return this._readFiles.has(yb(s))}async readFile(s){return rM.promises.readFile(yb(s),"utf-8")}async writeFile(s,c){let _=yb(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await rM.promises.mkdir(N6.dirname(_),{recursive:!0}),await rM.promises.writeFile(_,c,"utf-8")}async listFiles(s,c){let _=yb(c??this.workspaceRoot),u=y1r(s),y=[];return await c_t(_,_,u,y),y.slice(0,TOe).sort()}async listDirectoryEntries(s){let c=yb(s),_=await rM.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 rM.promises.stat(N6.join(c,y.name))).isDirectory()}catch{k=!1}u.push(k?`${y.name}/`:y.name)}return u.sort()}async searchCode(s,c,_){let u=yb(c??this.workspaceRoot);return this.runRipgrep(s,u,_).catch(()=>this.runGrep(s,u,_))}async runCommand(s,c,_){let u=c.map(yb),y=_?yb(_):this.workspaceRoot,k={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let F of["GITHUB_TOKEN","GH_TOKEN"]){let L=k[F];typeof L=="string"&&L.trim()===""&&delete k[F]}return new Promise(F=>{let L="",U="",Z=mZ.spawn(s,u,{cwd:y,shell:process.platform==="win32",env:k}),q=setTimeout(()=>{Z.kill("SIGTERM"),F({stdout:L.slice(0,pZ),stderr:U+`
1366
+ </body></html>`;t(PSr,"startLoopbackListener");t(ESr,"openBrowser");t(DSr,"buildDefaultDeviceLabel");t(ISr,"runOAuthSignIn")});var jue=Ot(($6r,ASr)=>{ASr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.193",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 uTr={};module.exports=wet(uTr);var wm=vu(require("fs")),Lue=vu(require("os")),Xp=vu(require("path")),k9=vu(require("readline")),$ue=vu(require("child_process")),Yp=vu(eZ()),Dy=vu(bOe());var rM=vu(require("fs")),SOe=vu(require("os")),N6=vu(require("path")),mZ=vu(require("child_process"));function yb(a){return a==="~"?SOe.homedir():a.startsWith("~/")?N6.join(SOe.homedir(),a.slice(2)):a}t(yb,"expandHome");var g9=16*1024,pZ=32*1024,o_t=1e4,g1r=3e4,TOe=200,kOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function h1r(a){let s=t(_=>{let u=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[_];let[,y,k,P]=u;return k.split(",").map(F=>`${y}${F.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,u]=c;return{includes:s(u),subDir:_}}return{includes:s(a),subDir:""}}t(h1r,"expandGlobForGrep");var nM=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(yb(s))}hasFileBeenRead(s){return this._readFiles.has(yb(s))}async readFile(s){return rM.promises.readFile(yb(s),"utf-8")}async writeFile(s,c){let _=yb(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await rM.promises.mkdir(N6.dirname(_),{recursive:!0}),await rM.promises.writeFile(_,c,"utf-8")}async listFiles(s,c){let _=yb(c??this.workspaceRoot),u=y1r(s),y=[];return await c_t(_,_,u,y),y.slice(0,TOe).sort()}async listDirectoryEntries(s){let c=yb(s),_=await rM.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 rM.promises.stat(N6.join(c,y.name))).isDirectory()}catch{k=!1}u.push(k?`${y.name}/`:y.name)}return u.sort()}async searchCode(s,c,_){let u=yb(c??this.workspaceRoot);return this.runRipgrep(s,u,_).catch(()=>this.runGrep(s,u,_))}async runCommand(s,c,_){let u=c.map(yb),y=_?yb(_):this.workspaceRoot,k={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let F of["GITHUB_TOKEN","GH_TOKEN"]){let L=k[F];typeof L=="string"&&L.trim()===""&&delete k[F]}return new Promise(F=>{let L="",U="",Z=mZ.spawn(s,u,{cwd:y,shell:process.platform==="win32",env:k}),q=setTimeout(()=>{Z.kill("SIGTERM"),F({stdout:L.slice(0,pZ),stderr:U+`
1367
1367
  [process timed out]`,exitCode:124})},g1r),ve=process.stdout.isTTY===!0,he=t((Te,pt)=>{if(!ve)return;(pt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+Te+"\x1B[0m")},"writeLive");Z.stdout?.on("data",Te=>{let pt=Te.toString();L+=pt,he(pt,!1),L.length>pZ&&Z.kill("SIGTERM")}),Z.stderr?.on("data",Te=>{let pt=Te.toString();U+=pt,he(pt,!0)}),Z.on("close",Te=>{clearTimeout(q);let pt=L.slice(0,pZ);if(Te===0&&/Operation cancelled/i.test(pt)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${u.join(" ")} ${pt}`)){let bt=[s,...u].join(" ");F({stdout:pt,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}F({stdout:pt,stderr:U.slice(0,4*1024),exitCode:Te??0})}),Z.on("error",Te=>{if(clearTimeout(q),Te.code==="ENOENT"){F({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}F({stdout:"",stderr:Te.message,exitCode:1})})})}async watchCommand(s,c,_,u){let y=c.map(yb),k=_?yb(_):this.workspaceRoot;return new Promise(P=>{let F="",L="",U=!1,Z=!1,q=mZ.spawn(s,y,{cwd:k,shell:process.platform==="win32",env:{...process.env}}),ve=t(gt=>{Z||(Z=!0,P({stdout:F.slice(0,pZ),stderr:L.slice(0,4*1024),exitCode:gt,endedEarly:U}))},"finish"),he=setTimeout(()=>{try{q.kill("SIGTERM")}catch{}let gt=setTimeout(()=>{try{q.kill("SIGKILL")}catch{}ve(null)},1e3);q.once("close",bt=>{clearTimeout(gt),ve(typeof bt=="number"?bt:null)})},u),Te=process.stdout.isTTY===!0,pt=t((gt,bt)=>{if(!Te)return;(bt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+gt+"\x1B[0m")},"writeLive");q.stdout?.on("data",gt=>{let bt=gt.toString();if(F+=bt,pt(bt,!1),F.length>pZ)try{q.kill("SIGTERM")}catch{}}),q.stderr?.on("data",gt=>{let bt=gt.toString();L+=bt,pt(bt,!0)}),q.on("close",gt=>{Z||(clearTimeout(he),U=!0,ve(typeof gt=="number"?gt:null))}),q.on("error",gt=>{Z||(clearTimeout(he),U=!0,L+=gt.message,ve(1))})})}runRipgrep(s,c,_){return new Promise((u,y)=>{let k=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...kOe].map(U=>["--glob",`!${U}`]).flat()];_&&k.push("--glob",_),k.push(s,c);let P="",F=mZ.spawn("rg",k,{shell:!1}),L=setTimeout(()=>{F.kill("SIGTERM"),u(P.slice(0,g9))},o_t);F.stdout?.on("data",U=>{P+=U.toString(),P.length>g9&&F.kill("SIGTERM")}),F.on("close",U=>{clearTimeout(L),U!=null&&U>=2&&P.length===0?y(new Error(`rg exited with code ${U}`)):u(P.slice(0,g9))}),F.on("error",y)})}runGrep(s,c,_){return new Promise((u,y)=>{let k=[...kOe].map(he=>["--exclude-dir",he]).flat(),P=_?h1r(_):{includes:[],subDir:""},F=P.includes.flatMap(he=>["--include",he]),L=P.subDir?`${c}/${P.subDir}`:c,U=["-rn","-E","--color=never",...k,...F,s,L],Z="",q=mZ.spawn("grep",U,{shell:!1}),ve=setTimeout(()=>{q.kill("SIGTERM"),u(Z.slice(0,g9))},o_t);q.stdout?.on("data",he=>{Z+=he.toString(),Z.length>g9&&q.kill("SIGTERM")}),q.on("close",he=>{clearTimeout(ve),he!=null&&he>=2&&Z.length===0?y(new Error(`grep exited with code ${he}`)):u(Z.slice(0,g9))}),q.on("error",y)})}};function y1r(a){let s=v1r(a);return c=>s.test(c.replace(/\\/g,"/"))}t(y1r,"compileGlob");function v1r(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(b1r).join("|");s+=`(?:${y})`,c=u}else/[.+^$()|\\]/.test(_)?s+="\\"+_:s+=_}return s+="$",new RegExp(s)}t(v1r,"globToRegex");function b1r(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(b1r,"escapeRegex");async function c_t(a,s,c,_){if(_.length>=TOe)return;let u;try{u=await rM.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let y of u){if(_.length>=TOe)return;if(kOe.has(y.name))continue;let k=N6.join(a,y.name),P=N6.relative(s,k);y.isDirectory()?await c_t(k,s,c,_):y.isFile()&&c(P)&&_.push(k)}}t(c_t,"walk");var u_t=vu(require("child_process")),lE=vu(require("fs")),f_t=vu(require("os")),xOe=vu(require("path")),__t=vu(require("crypto"));function wOe(){let a=__t.randomBytes(4).toString("hex");return xOe.join(f_t.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(wOe,"freshTempPath");function gue(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(gue,"tryExec");async function hue(){return process.platform==="darwin"?S1r():process.platform==="linux"?T1r():process.platform==="win32"?k1r():null}t(hue,"readClipboardImage");function S1r(){let a=wOe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1368
1368
  set outFile to (open for access (POSIX file "${a}") with write permission)
1369
1369
  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.191",
3
+ "version": "1.7.193",
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",