@burtson-labs/bandit-stealth-cli 1.7.288 → 1.7.290
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
|
@@ -1489,7 +1489,7 @@ ${(()=>{let J=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
|
|
|
1489
1489
|
<h1>You're signed in.</h1>
|
|
1490
1490
|
<p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
|
|
1491
1491
|
</div>
|
|
1492
|
-
</body></html>`;t(Fwr,"startLoopbackListener");t(Mwr,"openBrowser");t(Rwr,"buildDefaultDeviceLabel");t(jwr,"runOAuthSignIn")});var hfe=At((mFr,Lwr)=>{Lwr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.
|
|
1492
|
+
</body></html>`;t(Fwr,"startLoopbackListener");t(Mwr,"openBrowser");t(Rwr,"buildDefaultDeviceLabel");t(jwr,"runOAuthSignIn")});var hfe=At((mFr,Lwr)=>{Lwr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.290",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:{url:"https://github.com/Burtson-Labs/bandit-agent-framework/issues",email:"team@burtson.ai"},license:"MIT",author:{name:"Burtson Labs",email:"team@burtson.ai",url:"https://burtson.ai"},repository:{type:"git",url:"git+https://github.com/Burtson-Labs/bandit-agent-framework.git",directory:"apps/bandit-cli"},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 Pxr={};module.exports=mtt(Pxr);var Ud=yl(require("fs")),LM=yl(require("os")),Iu=yl(require("path")),r$=yl(require("readline")),vfe=yl(require("child_process")),am=yl(F9()),Tg=yl(Vue());var tO=yl(require("fs")),c3e=yl(require("os")),wT=yl(require("path")),HZ=yl(require("child_process"));function M0(a){return a==="~"?c3e.homedir():a.startsWith("~/")?wT.join(c3e.homedir(),a.slice(2)):a}t(M0,"expandHome");var Z9=16*1024,ZZ=32*1024,wpt=1e4,ZSr=3e4,l3e=200,u3e=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function HSr(a){let s=t(d=>{let u=d.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!u)return[d];let[,h,S,P]=u;return S.split(",").map(N=>`${h}${N.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,d,u]=c;return{includes:s(u),subDir:d}}return{includes:s(a),subDir:""}}t(HSr,"expandGlobForGrep");var NM=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(M0(s))}hasFileBeenRead(s){return this._readFiles.has(M0(s))}async readFile(s){return tO.promises.readFile(M0(s),"utf-8")}async writeFile(s,c){let d=M0(s);if(this.options.approveWrite&&!await this.options.approveWrite(d,c))throw new Error(`Write to ${d} rejected by user`);await tO.promises.mkdir(wT.dirname(d),{recursive:!0}),await tO.promises.writeFile(d,c,"utf-8")}async deleteFile(s){let c=wT.resolve(M0(s)),d=wT.resolve(this.workspaceRoot);if(!c.startsWith(d+wT.sep)&&c!==d)throw new Error(`Refusing to delete outside workspace: ${s}`);await tO.promises.unlink(c)}async listFiles(s,c){let d=M0(c??this.workspaceRoot),u=GSr(s),h=[];return await xpt(d,d,u,h),h.slice(0,l3e).sort()}async listDirectoryEntries(s){let c=M0(s),d=await tO.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 tO.promises.stat(wT.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=M0(c??this.workspaceRoot);return this.runRipgrep(s,u,d).catch(()=>this.runGrep(s,u,d))}async runCommand(s,c,d){let u=c.map(M0),h=d?M0(d):this.workspaceRoot,S={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let N of["GITHUB_TOKEN","GH_TOKEN"]){let R=S[N];typeof R=="string"&&R.trim()===""&&delete S[N]}return new Promise(N=>{let R="",$="",J=HZ.spawn(s,u,{cwd:h,shell:process.platform==="win32",env:S}),B=setTimeout(()=>{J.kill("SIGTERM"),N({stdout:R.slice(0,ZZ),stderr:$+`
|
|
1493
1493
|
[process timed out]`,exitCode:124})},ZSr),ge=process.stdout.isTTY===!0,fe=t((ve,it)=>{if(!ge)return;(it?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+ve+"\x1B[0m")},"writeLive");J.stdout?.on("data",ve=>{let it=ve.toString();R+=it,fe(it,!1),R.length>ZZ&&J.kill("SIGTERM")}),J.stderr?.on("data",ve=>{let it=ve.toString();$+=it,fe(it,!0)}),J.on("close",ve=>{clearTimeout(B);let it=R.slice(0,ZZ);if(ve===0&&/Operation cancelled/i.test(it)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${u.join(" ")} ${it}`)){let gt=[s,...u].join(" ");N({stdout:it,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: \`!${gt}\`. 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}N({stdout:it,stderr:$.slice(0,4*1024),exitCode:ve??0})}),J.on("error",ve=>{if(clearTimeout(B),ve.code==="ENOENT"){N({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}N({stdout:"",stderr:ve.message,exitCode:1})})})}async watchCommand(s,c,d,u){let h=c.map(M0),S=d?M0(d):this.workspaceRoot;return new Promise(P=>{let N="",R="",$=!1,J=!1,B=HZ.spawn(s,h,{cwd:S,shell:process.platform==="win32",env:{...process.env}}),ge=t(pt=>{J||(J=!0,P({stdout:N.slice(0,ZZ),stderr:R.slice(0,4*1024),exitCode:pt,endedEarly:$}))},"finish"),fe=setTimeout(()=>{try{B.kill("SIGTERM")}catch{}let pt=setTimeout(()=>{try{B.kill("SIGKILL")}catch{}ge(null)},1e3);B.once("close",gt=>{clearTimeout(pt),ge(typeof gt=="number"?gt:null)})},u),ve=process.stdout.isTTY===!0,it=t((pt,gt)=>{if(!ve)return;(gt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+pt+"\x1B[0m")},"writeLive");B.stdout?.on("data",pt=>{let gt=pt.toString();if(N+=gt,it(gt,!1),N.length>ZZ)try{B.kill("SIGTERM")}catch{}}),B.stderr?.on("data",pt=>{let gt=pt.toString();R+=gt,it(gt,!0)}),B.on("close",pt=>{J||(clearTimeout(fe),$=!0,ge(typeof pt=="number"?pt:null))}),B.on("error",pt=>{J||(clearTimeout(fe),$=!0,R+=pt.message,ge(1))})})}runRipgrep(s,c,d){return new Promise((u,h)=>{let S=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...u3e].map($=>["--glob",`!${$}`]).flat()];d&&S.push("--glob",d),S.push(s,c);let P="",N=HZ.spawn("rg",S,{shell:!1}),R=setTimeout(()=>{N.kill("SIGTERM"),u(P.slice(0,Z9))},wpt);N.stdout?.on("data",$=>{P+=$.toString(),P.length>Z9&&N.kill("SIGTERM")}),N.on("close",$=>{clearTimeout(R),$!=null&&$>=2&&P.length===0?h(new Error(`rg exited with code ${$}`)):u(P.slice(0,Z9))}),N.on("error",h)})}runGrep(s,c,d){return new Promise((u,h)=>{let S=[...u3e].map(fe=>["--exclude-dir",fe]).flat(),P=d?HSr(d):{includes:[],subDir:""},N=P.includes.flatMap(fe=>["--include",fe]),R=P.subDir?`${c}/${P.subDir}`:c,$=["-rn","-E","--color=never",...S,...N,s,R],J="",B=HZ.spawn("grep",$,{shell:!1}),ge=setTimeout(()=>{B.kill("SIGTERM"),u(J.slice(0,Z9))},wpt);B.stdout?.on("data",fe=>{J+=fe.toString(),J.length>Z9&&B.kill("SIGTERM")}),B.on("close",fe=>{clearTimeout(ge),fe!=null&&fe>=2&&J.length===0?h(new Error(`grep exited with code ${fe}`)):u(J.slice(0,Z9))}),B.on("error",h)})}};function GSr(a){let s=KSr(a);return c=>s.test(c.replace(/\\/g,"/"))}t(GSr,"compileGlob");function KSr(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(XSr).join("|");s+=`(?:${h})`,c=u}else/[.+^$()|\\]/.test(d)?s+="\\"+d:s+=d}return s+="$",new RegExp(s)}t(KSr,"globToRegex");function XSr(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(XSr,"escapeRegex");async function xpt(a,s,c,d){if(d.length>=l3e)return;let u;try{u=await tO.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let h of u){if(d.length>=l3e)return;if(u3e.has(h.name))continue;let S=wT.join(a,h.name),P=wT.relative(s,S);h.isDirectory()?await xpt(S,s,c,d):h.isFile()&&c(P)&&d.push(S)}}t(xpt,"walk");var Ppt=yl(require("child_process")),FE=yl(require("fs")),Ept=yl(require("os")),f3e=yl(require("path")),Dpt=yl(require("crypto"));function d3e(){let a=Dpt.randomBytes(4).toString("hex");return f3e.join(Ept.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(d3e,"freshTempPath");function Zue(a,s,c={}){try{let d=Ppt.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(Zue,"tryExec");async function Hue(){return process.platform==="darwin"?YSr():process.platform==="linux"?QSr():process.platform==="win32"?eTr():null}t(Hue,"readClipboardImage");function YSr(){let a=d3e(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
|
|
1494
1494
|
set outFile to (open for access (POSIX file "${a}") with write permission)
|
|
1495
1495
|
write pngData to outFile
|
package/package.json
CHANGED