@burtson-labs/bandit-stealth-cli 1.7.69 → 1.7.70
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
|
@@ -1000,7 +1000,7 @@ ${T.synopsis??"(no synopsis)"}`,isError:!1})):T.status==="failed"?(d.markConsume
|
|
|
1000
1000
|
</div>
|
|
1001
1001
|
</body>
|
|
1002
1002
|
</html>
|
|
1003
|
-
`}function a2e(d){let m=v$e(d.cwd),S=b$e(m),T=d.out?SS.resolve(d.cwd,d.out):SS.join(y$e,".bandit","insights.html");return m0.mkdirSync(SS.dirname(T),{recursive:!0}),m0.writeFileSync(T,S,"utf-8"),T}var m0,h$e,SS,y$e,vF,g$e,lNt,o2e=j2t(()=>{"use strict";m0=fu(require("fs")),h$e=fu(require("os")),SS=fu(require("path")),y$e=h$e.homedir();t(sNt,"loadSessions");t(aNt,"loadTurnFiles");t(oNt,"aggregate");t(v$e,"computeInsights");t(cNt,"buildTips");vF=t(d=>d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),"escape"),g$e=t(d=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}K`:`${d}`,"fmtBytes"),lNt=t((d,m)=>{let S=m-d;return S<6e4?"just now":S<36e5?`${Math.round(S/6e4)}m ago`:S<864e5?`${Math.round(S/36e5)}h ago`:S<7*864e5?`${Math.round(S/864e5)}d ago`:new Date(d).toISOString().slice(0,10)},"fmtRelative");t(b$e,"renderInsightsHtml");t(a2e,"writeInsightsReport")});var KZ=Si((x5t,uNt)=>{uNt.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.
|
|
1003
|
+
`}function a2e(d){let m=v$e(d.cwd),S=b$e(m),T=d.out?SS.resolve(d.cwd,d.out):SS.join(y$e,".bandit","insights.html");return m0.mkdirSync(SS.dirname(T),{recursive:!0}),m0.writeFileSync(T,S,"utf-8"),T}var m0,h$e,SS,y$e,vF,g$e,lNt,o2e=j2t(()=>{"use strict";m0=fu(require("fs")),h$e=fu(require("os")),SS=fu(require("path")),y$e=h$e.homedir();t(sNt,"loadSessions");t(aNt,"loadTurnFiles");t(oNt,"aggregate");t(v$e,"computeInsights");t(cNt,"buildTips");vF=t(d=>d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),"escape"),g$e=t(d=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}K`:`${d}`,"fmtBytes"),lNt=t((d,m)=>{let S=m-d;return S<6e4?"just now":S<36e5?`${Math.round(S/6e4)}m ago`:S<864e5?`${Math.round(S/36e5)}h ago`:S<7*864e5?`${Math.round(S/864e5)}d ago`:new Date(d).toISOString().slice(0,10)},"fmtRelative");t(b$e,"renderInsightsHtml");t(a2e,"writeInsightsReport")});var KZ=Si((x5t,uNt)=>{uNt.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.70",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 DNt={};module.exports=EBe(DNt);var Dd=fu(require("fs")),c2e=fu(require("os")),Zp=fu(require("path")),TF=fu(require("readline")),ZZ=fu(require("child_process")),xS=fu(nZ()),WI=fu(NSe());var jI=fu(require("fs")),OSe=fu(require("os")),HD=fu(require("path")),pJ=fu(require("child_process"));function fJ(d){return d==="~"?OSe.homedir():d.startsWith("~/")?HD.join(OSe.homedir(),d.slice(2)):d}t(fJ,"expandHome");var dF=16*1024,_J=32*1024,gWe=1e4,B4t=3e4,FSe=200,MSe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function J4t(d){let m=t(T=>{let w=T.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!w)return[T];let[,B,V,ne]=w;return V.split(",").map(oe=>`${B}${oe.trim()}${ne}`)},"braceExpand"),S=d.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(S){let[,T,w]=S;return{includes:m(w),subDir:T}}return{includes:m(d),subDir:""}}t(J4t,"expandGlobForGrep");var mF=class{constructor(m,S,T={}){this.workspaceRoot=m;this.languageAdapters=S;this.options=T}static{t(this,"CliToolExecutionContext")}async readFile(m){return jI.promises.readFile(fJ(m),"utf-8")}async writeFile(m,S){let T=fJ(m);if(this.options.approveWrite&&!await this.options.approveWrite(T,S))throw new Error(`Write to ${T} rejected by user`);await jI.promises.mkdir(HD.dirname(T),{recursive:!0}),await jI.promises.writeFile(T,S,"utf-8")}async listFiles(m,S){let T=fJ(S??this.workspaceRoot),w=z4t(m),B=[];return await hWe(T,T,w,B),B.slice(0,FSe).sort()}async listDirectoryEntries(m){let S=fJ(m),T=await jI.promises.readdir(S,{withFileTypes:!0}),w=[];for(let B of T){if(B.name.startsWith("."))continue;let V=B.isDirectory();if(B.isSymbolicLink())try{V=(await jI.promises.stat(HD.join(S,B.name))).isDirectory()}catch{V=!1}w.push(V?`${B.name}/`:B.name)}return w.sort()}async searchCode(m,S,T){let w=fJ(S??this.workspaceRoot);return this.runRipgrep(m,w,T).catch(()=>this.runGrep(m,w,T))}async runCommand(m,S,T){return new Promise(w=>{let B="",V="",ne=pJ.spawn(m,S,{cwd:T??this.workspaceRoot,shell:process.platform==="win32",env:{...process.env}}),oe=setTimeout(()=>{ne.kill("SIGTERM"),w({stdout:B.slice(0,_J),stderr:V+`
|
|
1004
1004
|
[process timed out]`,exitCode:124})},B4t);ne.stdout?.on("data",me=>{B+=me.toString(),B.length>_J&&ne.kill("SIGTERM")}),ne.stderr?.on("data",me=>{V+=me.toString()}),ne.on("close",me=>{clearTimeout(oe),w({stdout:B.slice(0,_J),stderr:V.slice(0,4*1024),exitCode:me??0})}),ne.on("error",me=>{clearTimeout(oe),w({stdout:"",stderr:me.message,exitCode:1})})})}async watchCommand(m,S,T,w){return new Promise(B=>{let V="",ne="",oe=!1,me=!1,pe=pJ.spawn(m,S,{cwd:T??this.workspaceRoot,shell:process.platform==="win32",env:{...process.env}}),ve=t(et=>{me||(me=!0,B({stdout:V.slice(0,_J),stderr:ne.slice(0,4*1024),exitCode:et,endedEarly:oe}))},"finish"),Y=setTimeout(()=>{try{pe.kill("SIGTERM")}catch{}let et=setTimeout(()=>{try{pe.kill("SIGKILL")}catch{}ve(null)},1e3);pe.once("close",Je=>{clearTimeout(et),ve(typeof Je=="number"?Je:null)})},w);pe.stdout?.on("data",et=>{if(V+=et.toString(),V.length>_J)try{pe.kill("SIGTERM")}catch{}}),pe.stderr?.on("data",et=>{ne+=et.toString()}),pe.on("close",et=>{me||(clearTimeout(Y),oe=!0,ve(typeof et=="number"?et:null))}),pe.on("error",et=>{me||(clearTimeout(Y),oe=!0,ne+=et.message,ve(1))})})}runRipgrep(m,S,T){return new Promise((w,B)=>{let V=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...MSe].map(pe=>["--glob",`!${pe}`]).flat()];T&&V.push("--glob",T),V.push(m,S);let ne="",oe=pJ.spawn("rg",V,{shell:!1}),me=setTimeout(()=>{oe.kill("SIGTERM"),w(ne.slice(0,dF))},gWe);oe.stdout?.on("data",pe=>{ne+=pe.toString(),ne.length>dF&&oe.kill("SIGTERM")}),oe.on("close",pe=>{clearTimeout(me),pe!=null&&pe>=2&&ne.length===0?B(new Error(`rg exited with code ${pe}`)):w(ne.slice(0,dF))}),oe.on("error",B)})}runGrep(m,S,T){return new Promise((w,B)=>{let V=[...MSe].map(Je=>["--exclude-dir",Je]).flat(),ne=T?J4t(T):{includes:[],subDir:""},oe=ne.includes.flatMap(Je=>["--include",Je]),me=ne.subDir?`${S}/${ne.subDir}`:S,pe=["-rn","-E","--color=never",...V,...oe,m,me],ve="",Y=pJ.spawn("grep",pe,{shell:!1}),et=setTimeout(()=>{Y.kill("SIGTERM"),w(ve.slice(0,dF))},gWe);Y.stdout?.on("data",Je=>{ve+=Je.toString(),ve.length>dF&&Y.kill("SIGTERM")}),Y.on("close",Je=>{clearTimeout(et),Je!=null&&Je>=2&&ve.length===0?B(new Error(`grep exited with code ${Je}`)):w(ve.slice(0,dF))}),Y.on("error",B)})}};function z4t(d){let m=W4t(d);return S=>m.test(S.replace(/\\/g,"/"))}t(z4t,"compileGlob");function W4t(d){let m="^";for(let S=0;S<d.length;S++){let T=d[S];if(T==="*")d[S+1]==="*"?(m+=".*",S++,d[S+1]==="/"&&S++):m+="[^/]*";else if(T==="?")m+="[^/]";else if(T==="{"){let w=d.indexOf("}",S);if(w===-1){m+="\\{";continue}let B=d.slice(S+1,w).split(",").map($4t).join("|");m+=`(?:${B})`,S=w}else/[.+^$()|\\]/.test(T)?m+="\\"+T:m+=T}return m+="$",new RegExp(m)}t(W4t,"globToRegex");function $4t(d){return d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t($4t,"escapeRegex");async function hWe(d,m,S,T){if(T.length>=FSe)return;let w;try{w=await jI.promises.readdir(d,{withFileTypes:!0})}catch{return}for(let B of w){if(T.length>=FSe)return;if(MSe.has(B.name))continue;let V=HD.join(d,B.name),ne=HD.relative(m,V);B.isDirectory()?await hWe(V,m,S,T):B.isFile()&&S(ne)&&T.push(V)}}t(hWe,"walk");var vWe=fu(require("child_process")),ck=fu(require("fs")),bWe=fu(require("os")),RSe=fu(require("path")),SWe=fu(require("crypto"));function LSe(){let d=SWe.randomBytes(4).toString("hex");return RSe.join(bWe.tmpdir(),`bandit-paste-${Date.now()}-${d}.png`)}t(LSe,"freshTempPath");function LZ(d,m,S={}){try{let T=vWe.spawnSync(d,m,{...S,encoding:void 0});return{stdout:Buffer.isBuffer(T.stdout)?T.stdout:Buffer.from(T.stdout??""),code:T.status}}catch{return{stdout:Buffer.alloc(0),code:null}}}t(LZ,"tryExec");async function jZ(){return process.platform==="darwin"?U4t():process.platform==="linux"?V4t():process.platform==="win32"?q4t():null}t(jZ,"readClipboardImage");function U4t(){let d=LSe(),m=`set pngData to (the clipboard as \xABclass PNGf\xBB)
|
|
1005
1005
|
set outFile to (open for access (POSIX file "${d}") with write permission)
|
|
1006
1006
|
write pngData to outFile
|
package/package.json
CHANGED