@burtson-labs/bandit-stealth-cli 1.7.271 → 1.7.272

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
@@ -1462,7 +1462,7 @@ ${(()=>{let W=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
1462
1462
  <h1>You're signed in.</h1>
1463
1463
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1464
1464
  </div>
1465
- </body></html>`;t(GTr,"startLoopbackListener");t(KTr,"openBrowser");t(XTr,"buildDefaultDeviceLabel");t(YTr,"runOAuthSignIn")});var efe=Nt((w3r,QTr)=>{QTr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.271",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 Ukr={};module.exports=Wet(Ukr);var kp=iu(require("fs")),V9=iu(require("os")),vd=iu(require("path")),Z9=iu(require("readline")),rfe=iu(require("child_process")),Yp=iu(w9()),By=iu(jOe());var K6=iu(require("fs")),LOe=iu(require("os")),_T=iu(require("path")),LZ=iu(require("child_process"));function wv(a){return a==="~"?LOe.homedir():a.startsWith("~/")?_T.join(LOe.homedir(),a.slice(2)):a}t(wv,"expandHome");var j9=16*1024,jZ=32*1024,Mdt=1e4,g1r=3e4,$Oe=200,BOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function h1r(a){let s=t(d=>{let u=d.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[d];let[,h,S,P]=u;return S.split(",").map(O=>`${h}${O.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,d,u]=c;return{includes:s(u),subDir:d}}return{includes:s(a),subDir:""}}t(h1r,"expandGlobForGrep");var TM=class{constructor(s,c,d={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=d;this._readFiles=new Set;this.customRepoRoots=d.customRepoRoots&&d.customRepoRoots.length>0?d.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(wv(s))}hasFileBeenRead(s){return this._readFiles.has(wv(s))}async readFile(s){return K6.promises.readFile(wv(s),"utf-8")}async writeFile(s,c){let d=wv(s);if(this.options.approveWrite&&!await this.options.approveWrite(d,c))throw new Error(`Write to ${d} rejected by user`);await K6.promises.mkdir(_T.dirname(d),{recursive:!0}),await K6.promises.writeFile(d,c,"utf-8")}async deleteFile(s){let c=_T.resolve(wv(s)),d=_T.resolve(this.workspaceRoot);if(!c.startsWith(d+_T.sep)&&c!==d)throw new Error(`Refusing to delete outside workspace: ${s}`);await K6.promises.unlink(c)}async listFiles(s,c){let d=wv(c??this.workspaceRoot),u=y1r(s),h=[];return await Rdt(d,d,u,h),h.slice(0,$Oe).sort()}async listDirectoryEntries(s){let c=wv(s),d=await K6.promises.readdir(c,{withFileTypes:!0}),u=[];for(let h of d){if(h.name.startsWith("."))continue;let S=h.isDirectory();if(h.isSymbolicLink())try{S=(await K6.promises.stat(_T.join(c,h.name))).isDirectory()}catch{S=!1}u.push(S?`${h.name}/`:h.name)}return u.sort()}async searchCode(s,c,d){let u=wv(c??this.workspaceRoot);return this.runRipgrep(s,u,d).catch(()=>this.runGrep(s,u,d))}async runCommand(s,c,d){let u=c.map(wv),h=d?wv(d):this.workspaceRoot,S={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let O of["GITHUB_TOKEN","GH_TOKEN"]){let j=S[O];typeof j=="string"&&j.trim()===""&&delete S[O]}return new Promise(O=>{let j="",$="",W=LZ.spawn(s,u,{cwd:h,shell:process.platform==="win32",env:S}),B=setTimeout(()=>{W.kill("SIGTERM"),O({stdout:j.slice(0,jZ),stderr:$+`
1465
+ </body></html>`;t(GTr,"startLoopbackListener");t(KTr,"openBrowser");t(XTr,"buildDefaultDeviceLabel");t(YTr,"runOAuthSignIn")});var efe=Nt((w3r,QTr)=>{QTr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.272",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 Ukr={};module.exports=Wet(Ukr);var kp=iu(require("fs")),V9=iu(require("os")),vd=iu(require("path")),Z9=iu(require("readline")),rfe=iu(require("child_process")),Yp=iu(w9()),By=iu(jOe());var K6=iu(require("fs")),LOe=iu(require("os")),_T=iu(require("path")),LZ=iu(require("child_process"));function wv(a){return a==="~"?LOe.homedir():a.startsWith("~/")?_T.join(LOe.homedir(),a.slice(2)):a}t(wv,"expandHome");var j9=16*1024,jZ=32*1024,Mdt=1e4,g1r=3e4,$Oe=200,BOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function h1r(a){let s=t(d=>{let u=d.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[d];let[,h,S,P]=u;return S.split(",").map(O=>`${h}${O.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,d,u]=c;return{includes:s(u),subDir:d}}return{includes:s(a),subDir:""}}t(h1r,"expandGlobForGrep");var TM=class{constructor(s,c,d={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=d;this._readFiles=new Set;this.customRepoRoots=d.customRepoRoots&&d.customRepoRoots.length>0?d.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(wv(s))}hasFileBeenRead(s){return this._readFiles.has(wv(s))}async readFile(s){return K6.promises.readFile(wv(s),"utf-8")}async writeFile(s,c){let d=wv(s);if(this.options.approveWrite&&!await this.options.approveWrite(d,c))throw new Error(`Write to ${d} rejected by user`);await K6.promises.mkdir(_T.dirname(d),{recursive:!0}),await K6.promises.writeFile(d,c,"utf-8")}async deleteFile(s){let c=_T.resolve(wv(s)),d=_T.resolve(this.workspaceRoot);if(!c.startsWith(d+_T.sep)&&c!==d)throw new Error(`Refusing to delete outside workspace: ${s}`);await K6.promises.unlink(c)}async listFiles(s,c){let d=wv(c??this.workspaceRoot),u=y1r(s),h=[];return await Rdt(d,d,u,h),h.slice(0,$Oe).sort()}async listDirectoryEntries(s){let c=wv(s),d=await K6.promises.readdir(c,{withFileTypes:!0}),u=[];for(let h of d){if(h.name.startsWith("."))continue;let S=h.isDirectory();if(h.isSymbolicLink())try{S=(await K6.promises.stat(_T.join(c,h.name))).isDirectory()}catch{S=!1}u.push(S?`${h.name}/`:h.name)}return u.sort()}async searchCode(s,c,d){let u=wv(c??this.workspaceRoot);return this.runRipgrep(s,u,d).catch(()=>this.runGrep(s,u,d))}async runCommand(s,c,d){let u=c.map(wv),h=d?wv(d):this.workspaceRoot,S={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let O of["GITHUB_TOKEN","GH_TOKEN"]){let j=S[O];typeof j=="string"&&j.trim()===""&&delete S[O]}return new Promise(O=>{let j="",$="",W=LZ.spawn(s,u,{cwd:h,shell:process.platform==="win32",env:S}),B=setTimeout(()=>{W.kill("SIGTERM"),O({stdout:j.slice(0,jZ),stderr:$+`
1466
1466
  [process timed out]`,exitCode:124})},g1r),ye=process.stdout.isTTY===!0,pe=t((Te,ct)=>{if(!ye)return;(ct?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+Te+"\x1B[0m")},"writeLive");W.stdout?.on("data",Te=>{let ct=Te.toString();j+=ct,pe(ct,!1),j.length>jZ&&W.kill("SIGTERM")}),W.stderr?.on("data",Te=>{let ct=Te.toString();$+=ct,pe(ct,!0)}),W.on("close",Te=>{clearTimeout(B);let ct=j.slice(0,jZ);if(Te===0&&/Operation cancelled/i.test(ct)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${u.join(" ")} ${ct}`)){let vt=[s,...u].join(" ");O({stdout:ct,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: \`!${vt}\`. 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:ct,stderr:$.slice(0,4*1024),exitCode:Te??0})}),W.on("error",Te=>{if(clearTimeout(B),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,d,u){let h=c.map(wv),S=d?wv(d):this.workspaceRoot;return new Promise(P=>{let O="",j="",$=!1,W=!1,B=LZ.spawn(s,h,{cwd:S,shell:process.platform==="win32",env:{...process.env}}),ye=t(gt=>{W||(W=!0,P({stdout:O.slice(0,jZ),stderr:j.slice(0,4*1024),exitCode:gt,endedEarly:$}))},"finish"),pe=setTimeout(()=>{try{B.kill("SIGTERM")}catch{}let gt=setTimeout(()=>{try{B.kill("SIGKILL")}catch{}ye(null)},1e3);B.once("close",vt=>{clearTimeout(gt),ye(typeof vt=="number"?vt:null)})},u),Te=process.stdout.isTTY===!0,ct=t((gt,vt)=>{if(!Te)return;(vt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+gt+"\x1B[0m")},"writeLive");B.stdout?.on("data",gt=>{let vt=gt.toString();if(O+=vt,ct(vt,!1),O.length>jZ)try{B.kill("SIGTERM")}catch{}}),B.stderr?.on("data",gt=>{let vt=gt.toString();j+=vt,ct(vt,!0)}),B.on("close",gt=>{W||(clearTimeout(pe),$=!0,ye(typeof gt=="number"?gt:null))}),B.on("error",gt=>{W||(clearTimeout(pe),$=!0,j+=gt.message,ye(1))})})}runRipgrep(s,c,d){return new Promise((u,h)=>{let S=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...BOe].map($=>["--glob",`!${$}`]).flat()];d&&S.push("--glob",d),S.push(s,c);let P="",O=LZ.spawn("rg",S,{shell:!1}),j=setTimeout(()=>{O.kill("SIGTERM"),u(P.slice(0,j9))},Mdt);O.stdout?.on("data",$=>{P+=$.toString(),P.length>j9&&O.kill("SIGTERM")}),O.on("close",$=>{clearTimeout(j),$!=null&&$>=2&&P.length===0?h(new Error(`rg exited with code ${$}`)):u(P.slice(0,j9))}),O.on("error",h)})}runGrep(s,c,d){return new Promise((u,h)=>{let S=[...BOe].map(pe=>["--exclude-dir",pe]).flat(),P=d?h1r(d):{includes:[],subDir:""},O=P.includes.flatMap(pe=>["--include",pe]),j=P.subDir?`${c}/${P.subDir}`:c,$=["-rn","-E","--color=never",...S,...O,s,j],W="",B=LZ.spawn("grep",$,{shell:!1}),ye=setTimeout(()=>{B.kill("SIGTERM"),u(W.slice(0,j9))},Mdt);B.stdout?.on("data",pe=>{W+=pe.toString(),W.length>j9&&B.kill("SIGTERM")}),B.on("close",pe=>{clearTimeout(ye),pe!=null&&pe>=2&&W.length===0?h(new Error(`grep exited with code ${pe}`)):u(W.slice(0,j9))}),B.on("error",h)})}};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 d=a[c];if(d==="*")a[c+1]==="*"?(s+=".*",c++,a[c+1]==="/"&&c++):s+="[^/]*";else if(d==="?")s+="[^/]";else if(d==="{"){let u=a.indexOf("}",c);if(u===-1){s+="\\{";continue}let h=a.slice(c+1,u).split(",").map(b1r).join("|");s+=`(?:${h})`,c=u}else/[.+^$()|\\]/.test(d)?s+="\\"+d:s+=d}return s+="$",new RegExp(s)}t(v1r,"globToRegex");function b1r(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(b1r,"escapeRegex");async function Rdt(a,s,c,d){if(d.length>=$Oe)return;let u;try{u=await K6.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let h of u){if(d.length>=$Oe)return;if(BOe.has(h.name))continue;let S=_T.join(a,h.name),P=_T.relative(s,S);h.isDirectory()?await Rdt(S,s,c,d):h.isFile()&&c(P)&&d.push(S)}}t(Rdt,"walk");var Ldt=iu(require("child_process")),EE=iu(require("fs")),$dt=iu(require("os")),zOe=iu(require("path")),Bdt=iu(require("crypto"));function UOe(){let a=Bdt.randomBytes(4).toString("hex");return zOe.join($dt.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(UOe,"freshTempPath");function Oue(a,s,c={}){try{let d=Ldt.spawnSync(a,s,{...c,encoding:void 0});return{stdout:Buffer.isBuffer(d.stdout)?d.stdout:Buffer.from(d.stdout??""),code:d.status}}catch{return{stdout:Buffer.alloc(0),code:null}}}t(Oue,"tryExec");async function Fue(){return process.platform==="darwin"?S1r():process.platform==="linux"?T1r():process.platform==="win32"?k1r():null}t(Fue,"readClipboardImage");function S1r(){let a=UOe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1467
1467
  set outFile to (open for access (POSIX file "${a}") with write permission)
1468
1468
  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.271",
3
+ "version": "1.7.272",
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",