@burtson-labs/bandit-stealth-cli 1.7.153 → 1.7.155
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
|
@@ -1269,7 +1269,7 @@ ${(()=>{let H=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
|
|
|
1269
1269
|
<h1>You're signed in.</h1>
|
|
1270
1270
|
<p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
|
|
1271
1271
|
</div>
|
|
1272
|
-
</body></html>`;t(jbr,"startLoopbackListener");t(Lbr,"openBrowser");t($br,"buildDefaultDeviceLabel");t(Bbr,"runOAuthSignIn")});var Iue=Ot((J4r,zbr)=>{zbr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.
|
|
1272
|
+
</body></html>`;t(jbr,"startLoopbackListener");t(Lbr,"openBrowser");t($br,"buildDefaultDeviceLabel");t(Bbr,"runOAuthSignIn")});var Iue=Ot((J4r,zbr)=>{zbr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.155",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 vSr={};module.exports=det(vSr);var Cm=hu(require("fs")),Aue=hu(require("os")),Kp=hu(require("path")),g9=hu(require("readline")),Nue=hu(require("child_process")),Xp=hu(VV()),o1=hu(uOe());var HF=hu(require("fs")),fOe=hu(require("os")),k6=hu(require("path")),oZ=hu(require("child_process"));function j2(a){return a==="~"?fOe.homedir():a.startsWith("~/")?k6.join(fOe.homedir(),a.slice(2)):a}t(j2,"expandHome");var o9=16*1024,sZ=32*1024,zft=1e4,Cvr=3e4,_Oe=200,dOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function Pvr(a){let s=t(d=>{let f=d.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!f)return[d];let[,y,x,P]=f;return x.split(",").map(M=>`${y}${M.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,d,f]=c;return{includes:s(f),subDir:d}}return{includes:s(a),subDir:""}}t(Pvr,"expandGlobForGrep");var GF=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(j2(s))}hasFileBeenRead(s){return this._readFiles.has(j2(s))}async readFile(s){return HF.promises.readFile(j2(s),"utf-8")}async writeFile(s,c){let d=j2(s);if(this.options.approveWrite&&!await this.options.approveWrite(d,c))throw new Error(`Write to ${d} rejected by user`);await HF.promises.mkdir(k6.dirname(d),{recursive:!0}),await HF.promises.writeFile(d,c,"utf-8")}async listFiles(s,c){let d=j2(c??this.workspaceRoot),f=Evr(s),y=[];return await Uft(d,d,f,y),y.slice(0,_Oe).sort()}async listDirectoryEntries(s){let c=j2(s),d=await HF.promises.readdir(c,{withFileTypes:!0}),f=[];for(let y of d){if(y.name.startsWith("."))continue;let x=y.isDirectory();if(y.isSymbolicLink())try{x=(await HF.promises.stat(k6.join(c,y.name))).isDirectory()}catch{x=!1}f.push(x?`${y.name}/`:y.name)}return f.sort()}async searchCode(s,c,d){let f=j2(c??this.workspaceRoot);return this.runRipgrep(s,f,d).catch(()=>this.runGrep(s,f,d))}async runCommand(s,c,d){let f=c.map(j2),y=d?j2(d):this.workspaceRoot,x={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let M of["GITHUB_TOKEN","GH_TOKEN"]){let L=x[M];typeof L=="string"&&L.trim()===""&&delete x[M]}return new Promise(M=>{let L="",J="",H=oZ.spawn(s,f,{cwd:y,shell:process.platform==="win32",env:x}),q=setTimeout(()=>{H.kill("SIGTERM"),M({stdout:L.slice(0,sZ),stderr:J+`
|
|
1273
1273
|
[process timed out]`,exitCode:124})},Cvr),ve=process.stdout.isTTY===!0,ye=t((Ce,gt)=>{if(!ve)return;(gt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+Ce+"\x1B[0m")},"writeLive");H.stdout?.on("data",Ce=>{let gt=Ce.toString();L+=gt,ye(gt,!1),L.length>sZ&&H.kill("SIGTERM")}),H.stderr?.on("data",Ce=>{let gt=Ce.toString();J+=gt,ye(gt,!0)}),H.on("close",Ce=>{clearTimeout(q);let gt=L.slice(0,sZ);if(Ce===0&&/Operation cancelled/i.test(gt)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${f.join(" ")} ${gt}`)){let bt=[s,...f].join(" ");M({stdout:gt,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}M({stdout:gt,stderr:J.slice(0,4*1024),exitCode:Ce??0})}),H.on("error",Ce=>{if(clearTimeout(q),Ce.code==="ENOENT"){M({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}M({stdout:"",stderr:Ce.message,exitCode:1})})})}async watchCommand(s,c,d,f){let y=c.map(j2),x=d?j2(d):this.workspaceRoot;return new Promise(P=>{let M="",L="",J=!1,H=!1,q=oZ.spawn(s,y,{cwd:x,shell:process.platform==="win32",env:{...process.env}}),ve=t(vt=>{H||(H=!0,P({stdout:M.slice(0,sZ),stderr:L.slice(0,4*1024),exitCode:vt,endedEarly:J}))},"finish"),ye=setTimeout(()=>{try{q.kill("SIGTERM")}catch{}let vt=setTimeout(()=>{try{q.kill("SIGKILL")}catch{}ve(null)},1e3);q.once("close",bt=>{clearTimeout(vt),ve(typeof bt=="number"?bt:null)})},f),Ce=process.stdout.isTTY===!0,gt=t((vt,bt)=>{if(!Ce)return;(bt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+vt+"\x1B[0m")},"writeLive");q.stdout?.on("data",vt=>{let bt=vt.toString();if(M+=bt,gt(bt,!1),M.length>sZ)try{q.kill("SIGTERM")}catch{}}),q.stderr?.on("data",vt=>{let bt=vt.toString();L+=bt,gt(bt,!0)}),q.on("close",vt=>{H||(clearTimeout(ye),J=!0,ve(typeof vt=="number"?vt:null))}),q.on("error",vt=>{H||(clearTimeout(ye),J=!0,L+=vt.message,ve(1))})})}runRipgrep(s,c,d){return new Promise((f,y)=>{let x=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...dOe].map(J=>["--glob",`!${J}`]).flat()];d&&x.push("--glob",d),x.push(s,c);let P="",M=oZ.spawn("rg",x,{shell:!1}),L=setTimeout(()=>{M.kill("SIGTERM"),f(P.slice(0,o9))},zft);M.stdout?.on("data",J=>{P+=J.toString(),P.length>o9&&M.kill("SIGTERM")}),M.on("close",J=>{clearTimeout(L),J!=null&&J>=2&&P.length===0?y(new Error(`rg exited with code ${J}`)):f(P.slice(0,o9))}),M.on("error",y)})}runGrep(s,c,d){return new Promise((f,y)=>{let x=[...dOe].map(ye=>["--exclude-dir",ye]).flat(),P=d?Pvr(d):{includes:[],subDir:""},M=P.includes.flatMap(ye=>["--include",ye]),L=P.subDir?`${c}/${P.subDir}`:c,J=["-rn","-E","--color=never",...x,...M,s,L],H="",q=oZ.spawn("grep",J,{shell:!1}),ve=setTimeout(()=>{q.kill("SIGTERM"),f(H.slice(0,o9))},zft);q.stdout?.on("data",ye=>{H+=ye.toString(),H.length>o9&&q.kill("SIGTERM")}),q.on("close",ye=>{clearTimeout(ve),ye!=null&&ye>=2&&H.length===0?y(new Error(`grep exited with code ${ye}`)):f(H.slice(0,o9))}),q.on("error",y)})}};function Evr(a){let s=Dvr(a);return c=>s.test(c.replace(/\\/g,"/"))}t(Evr,"compileGlob");function Dvr(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 y=a.slice(c+1,f).split(",").map(Ivr).join("|");s+=`(?:${y})`,c=f}else/[.+^$()|\\]/.test(d)?s+="\\"+d:s+=d}return s+="$",new RegExp(s)}t(Dvr,"globToRegex");function Ivr(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(Ivr,"escapeRegex");async function Uft(a,s,c,d){if(d.length>=_Oe)return;let f;try{f=await HF.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let y of f){if(d.length>=_Oe)return;if(dOe.has(y.name))continue;let x=k6.join(a,y.name),P=k6.relative(s,x);y.isDirectory()?await Uft(x,s,c,d):y.isFile()&&c(P)&&d.push(x)}}t(Uft,"walk");var Jft=hu(require("child_process")),tE=hu(require("fs")),Wft=hu(require("os")),pOe=hu(require("path")),Vft=hu(require("crypto"));function mOe(){let a=Vft.randomBytes(4).toString("hex");return pOe.join(Wft.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(mOe,"freshTempPath");function lue(a,s,c={}){try{let d=Jft.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(lue,"tryExec");async function uue(){return process.platform==="darwin"?Avr():process.platform==="linux"?Nvr():process.platform==="win32"?Ovr():null}t(uue,"readClipboardImage");function Avr(){let a=mOe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
|
|
1274
1274
|
set outFile to (open for access (POSIX file "${a}") with write permission)
|
|
1275
1275
|
write pngData to outFile
|
package/package.json
CHANGED