@burtson-labs/bandit-stealth-cli 1.7.143 → 1.7.144
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.
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1244,7 +1244,7 @@ ${(()=>{let G=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
|
|
|
1244
1244
|
<h1>You're signed in.</h1>
|
|
1245
1245
|
<p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
|
|
1246
1246
|
</div>
|
|
1247
|
-
</body></html>`;t(Tbr,"startLoopbackListener");t(kbr,"openBrowser");t(xbr,"buildDefaultDeviceLabel");t(wbr,"runOAuthSignIn")});var wue=Ot((P4r,Cbr)=>{Cbr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.
|
|
1247
|
+
</body></html>`;t(Tbr,"startLoopbackListener");t(kbr,"openBrowser");t(xbr,"buildDefaultDeviceLabel");t(wbr,"runOAuthSignIn")});var wue=Ot((P4r,Cbr)=>{Cbr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.144",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 iSr={};module.exports=oet(iSr);var xm=hu(require("fs")),Cue=hu(require("os")),Hp=hu(require("path")),m9=hu(require("readline")),Pue=hu(require("child_process")),Gp=hu(WV()),a1=hu(iOe());var ZF=hu(require("fs")),aOe=hu(require("os")),S6=hu(require("path")),sZ=hu(require("child_process"));function F2(a){return a==="~"?aOe.homedir():a.startsWith("~/")?S6.join(aOe.homedir(),a.slice(2)):a}t(F2,"expandHome");var s9=16*1024,aZ=32*1024,Nft=1e4,fvr=3e4,sOe=200,oOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function _vr(a){let s=t(d=>{let f=d.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!f)return[d];let[,v,x,D]=f;return x.split(",").map(M=>`${v}${M.trim()}${D}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,d,f]=c;return{includes:s(f),subDir:d}}return{includes:s(a),subDir:""}}t(_vr,"expandGlobForGrep");var HF=class{constructor(s,c,d={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=d;this._readFiles=new Set}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(F2(s))}hasFileBeenRead(s){return this._readFiles.has(F2(s))}async readFile(s){return ZF.promises.readFile(F2(s),"utf-8")}async writeFile(s,c){let d=F2(s);if(this.options.approveWrite&&!await this.options.approveWrite(d,c))throw new Error(`Write to ${d} rejected by user`);await ZF.promises.mkdir(S6.dirname(d),{recursive:!0}),await ZF.promises.writeFile(d,c,"utf-8")}async listFiles(s,c){let d=F2(c??this.workspaceRoot),f=dvr(s),v=[];return await Oft(d,d,f,v),v.slice(0,sOe).sort()}async listDirectoryEntries(s){let c=F2(s),d=await ZF.promises.readdir(c,{withFileTypes:!0}),f=[];for(let v of d){if(v.name.startsWith("."))continue;let x=v.isDirectory();if(v.isSymbolicLink())try{x=(await ZF.promises.stat(S6.join(c,v.name))).isDirectory()}catch{x=!1}f.push(x?`${v.name}/`:v.name)}return f.sort()}async searchCode(s,c,d){let f=F2(c??this.workspaceRoot);return this.runRipgrep(s,f,d).catch(()=>this.runGrep(s,f,d))}async runCommand(s,c,d){let f=c.map(F2),v=d?F2(d):this.workspaceRoot;return new Promise(x=>{let D="",M="",L=sZ.spawn(s,f,{cwd:v,shell:process.platform==="win32",env:{...process.env}}),q=setTimeout(()=>{L.kill("SIGTERM"),x({stdout:D.slice(0,aZ),stderr:M+`
|
|
1248
1248
|
[process timed out]`,exitCode:124})},fvr),G=process.stdout.isTTY===!0,J=t((he,Se)=>{if(!G)return;(Se?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+he+"\x1B[0m")},"writeLive");L.stdout?.on("data",he=>{let Se=he.toString();D+=Se,J(Se,!1),D.length>aZ&&L.kill("SIGTERM")}),L.stderr?.on("data",he=>{let Se=he.toString();M+=Se,J(Se,!0)}),L.on("close",he=>{clearTimeout(q);let Se=D.slice(0,aZ);if(he===0&&/Operation cancelled/i.test(Se)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${f.join(" ")} ${Se}`)){let vt=[s,...f].join(" ");x({stdout:Se,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}x({stdout:Se,stderr:M.slice(0,4*1024),exitCode:he??0})}),L.on("error",he=>{if(clearTimeout(q),he.code==="ENOENT"){x({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}x({stdout:"",stderr:he.message,exitCode:1})})})}async watchCommand(s,c,d,f){let v=c.map(F2),x=d?F2(d):this.workspaceRoot;return new Promise(D=>{let M="",L="",q=!1,G=!1,J=sZ.spawn(s,v,{cwd:x,shell:process.platform==="win32",env:{...process.env}}),he=t(yt=>{G||(G=!0,D({stdout:M.slice(0,aZ),stderr:L.slice(0,4*1024),exitCode:yt,endedEarly:q}))},"finish"),Se=setTimeout(()=>{try{J.kill("SIGTERM")}catch{}let yt=setTimeout(()=>{try{J.kill("SIGKILL")}catch{}he(null)},1e3);J.once("close",bt=>{clearTimeout(yt),he(typeof bt=="number"?bt:null)})},f),De=process.stdout.isTTY===!0,vt=t((yt,bt)=>{if(!De)return;(bt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+yt+"\x1B[0m")},"writeLive");J.stdout?.on("data",yt=>{let bt=yt.toString();if(M+=bt,vt(bt,!1),M.length>aZ)try{J.kill("SIGTERM")}catch{}}),J.stderr?.on("data",yt=>{let bt=yt.toString();L+=bt,vt(bt,!0)}),J.on("close",yt=>{G||(clearTimeout(Se),q=!0,he(typeof yt=="number"?yt:null))}),J.on("error",yt=>{G||(clearTimeout(Se),q=!0,L+=yt.message,he(1))})})}runRipgrep(s,c,d){return new Promise((f,v)=>{let x=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...oOe].map(q=>["--glob",`!${q}`]).flat()];d&&x.push("--glob",d),x.push(s,c);let D="",M=sZ.spawn("rg",x,{shell:!1}),L=setTimeout(()=>{M.kill("SIGTERM"),f(D.slice(0,s9))},Nft);M.stdout?.on("data",q=>{D+=q.toString(),D.length>s9&&M.kill("SIGTERM")}),M.on("close",q=>{clearTimeout(L),q!=null&&q>=2&&D.length===0?v(new Error(`rg exited with code ${q}`)):f(D.slice(0,s9))}),M.on("error",v)})}runGrep(s,c,d){return new Promise((f,v)=>{let x=[...oOe].map(Se=>["--exclude-dir",Se]).flat(),D=d?_vr(d):{includes:[],subDir:""},M=D.includes.flatMap(Se=>["--include",Se]),L=D.subDir?`${c}/${D.subDir}`:c,q=["-rn","-E","--color=never",...x,...M,s,L],G="",J=sZ.spawn("grep",q,{shell:!1}),he=setTimeout(()=>{J.kill("SIGTERM"),f(G.slice(0,s9))},Nft);J.stdout?.on("data",Se=>{G+=Se.toString(),G.length>s9&&J.kill("SIGTERM")}),J.on("close",Se=>{clearTimeout(he),Se!=null&&Se>=2&&G.length===0?v(new Error(`grep exited with code ${Se}`)):f(G.slice(0,s9))}),J.on("error",v)})}};function dvr(a){let s=pvr(a);return c=>s.test(c.replace(/\\/g,"/"))}t(dvr,"compileGlob");function pvr(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 f=a.indexOf("}",c);if(f===-1){s+="\\{";continue}let v=a.slice(c+1,f).split(",").map(mvr).join("|");s+=`(?:${v})`,c=f}else/[.+^$()|\\]/.test(d)?s+="\\"+d:s+=d}return s+="$",new RegExp(s)}t(pvr,"globToRegex");function mvr(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(mvr,"escapeRegex");async function Oft(a,s,c,d){if(d.length>=sOe)return;let f;try{f=await ZF.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let v of f){if(d.length>=sOe)return;if(oOe.has(v.name))continue;let x=S6.join(a,v.name),D=S6.relative(s,x);v.isDirectory()?await Oft(x,s,c,d):v.isFile()&&c(D)&&d.push(x)}}t(Oft,"walk");var Mft=hu(require("child_process")),KP=hu(require("fs")),Rft=hu(require("os")),cOe=hu(require("path")),jft=hu(require("crypto"));function lOe(){let a=jft.randomBytes(4).toString("hex");return cOe.join(Rft.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(lOe,"freshTempPath");function sue(a,s,c={}){try{let d=Mft.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(sue,"tryExec");async function oue(){return process.platform==="darwin"?gvr():process.platform==="linux"?hvr():process.platform==="win32"?yvr():null}t(oue,"readClipboardImage");function gvr(){let a=lOe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
|
|
1249
1249
|
set outFile to (open for access (POSIX file "${a}") with write permission)
|
|
1250
1250
|
write pngData to outFile
|
package/package.json
CHANGED