@burtson-labs/bandit-stealth-cli 1.7.185 → 1.7.186

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 +3 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1350,7 +1350,7 @@ ${(()=>{let Z=`Bandit insights \u2014 ${new Date(s).toISOString().slice(0,10)}`,
1350
1350
  <h1>You're signed in.</h1>
1351
1351
  <p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
1352
1352
  </div>
1353
- </body></html>`;t(fSr,"startLoopbackListener");t(_Sr,"openBrowser");t(dSr,"buildDefaultDeviceLabel");t(pSr,"runOAuthSignIn")});var Mue=Ot((S6r,mSr)=>{mSr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.185",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 HSr={};module.exports=Tet(HSr);var Cm=Tu(require("fs")),Rue=Tu(require("os")),Yp=Tu(require("path")),S9=Tu(require("readline")),jue=Tu(require("child_process")),Qp=Tu(YV()),Iy=Tu(hOe());var QF=Tu(require("fs")),yOe=Tu(require("os")),D6=Tu(require("path")),dZ=Tu(require("child_process"));function Sb(a){return a==="~"?yOe.homedir():a.startsWith("~/")?D6.join(yOe.homedir(),a.slice(2)):a}t(Sb,"expandHome");var p9=16*1024,_Z=32*1024,Qft=1e4,e1r=3e4,vOe=200,bOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function t1r(a){let s=t(_=>{let f=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!f)return[_];let[,y,k,P]=f;return k.split(",").map(F=>`${y}${F.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,f]=c;return{includes:s(f),subDir:_}}return{includes:s(a),subDir:""}}t(t1r,"expandGlobForGrep");var eM=class{constructor(s,c,_={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=_;this._readFiles=new Set;this.customRepoRoots=_.customRepoRoots&&_.customRepoRoots.length>0?_.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(Sb(s))}hasFileBeenRead(s){return this._readFiles.has(Sb(s))}async readFile(s){return QF.promises.readFile(Sb(s),"utf-8")}async writeFile(s,c){let _=Sb(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await QF.promises.mkdir(D6.dirname(_),{recursive:!0}),await QF.promises.writeFile(_,c,"utf-8")}async listFiles(s,c){let _=Sb(c??this.workspaceRoot),f=r1r(s),y=[];return await e_t(_,_,f,y),y.slice(0,vOe).sort()}async listDirectoryEntries(s){let c=Sb(s),_=await QF.promises.readdir(c,{withFileTypes:!0}),f=[];for(let y of _){if(y.name.startsWith("."))continue;let k=y.isDirectory();if(y.isSymbolicLink())try{k=(await QF.promises.stat(D6.join(c,y.name))).isDirectory()}catch{k=!1}f.push(k?`${y.name}/`:y.name)}return f.sort()}async searchCode(s,c,_){let f=Sb(c??this.workspaceRoot);return this.runRipgrep(s,f,_).catch(()=>this.runGrep(s,f,_))}async runCommand(s,c,_){let f=c.map(Sb),y=_?Sb(_):this.workspaceRoot,k={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let F of["GITHUB_TOKEN","GH_TOKEN"]){let L=k[F];typeof L=="string"&&L.trim()===""&&delete k[F]}return new Promise(F=>{let L="",U="",Z=dZ.spawn(s,f,{cwd:y,shell:process.platform==="win32",env:k}),J=setTimeout(()=>{Z.kill("SIGTERM"),F({stdout:L.slice(0,_Z),stderr:U+`
1353
+ </body></html>`;t(fSr,"startLoopbackListener");t(_Sr,"openBrowser");t(dSr,"buildDefaultDeviceLabel");t(pSr,"runOAuthSignIn")});var Mue=Ot((S6r,mSr)=>{mSr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.186",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 HSr={};module.exports=Tet(HSr);var Cm=Tu(require("fs")),Rue=Tu(require("os")),Yp=Tu(require("path")),S9=Tu(require("readline")),jue=Tu(require("child_process")),Qp=Tu(YV()),Iy=Tu(hOe());var QF=Tu(require("fs")),yOe=Tu(require("os")),D6=Tu(require("path")),dZ=Tu(require("child_process"));function Sb(a){return a==="~"?yOe.homedir():a.startsWith("~/")?D6.join(yOe.homedir(),a.slice(2)):a}t(Sb,"expandHome");var p9=16*1024,_Z=32*1024,Qft=1e4,e1r=3e4,vOe=200,bOe=new Set(["node_modules",".git","dist","build","out",".next",".turbo","coverage","target","__pycache__",".venv","venv"]);function t1r(a){let s=t(_=>{let f=_.match(/^(.*?)\{([^}]+)\}(.*)$/);if(!f)return[_];let[,y,k,P]=f;return k.split(",").map(F=>`${y}${F.trim()}${P}`)},"braceExpand"),c=a.match(/^([^*{}]+?)\/\*\*\/(.+)$/);if(c){let[,_,f]=c;return{includes:s(f),subDir:_}}return{includes:s(a),subDir:""}}t(t1r,"expandGlobForGrep");var eM=class{constructor(s,c,_={}){this.workspaceRoot=s;this.languageAdapters=c;this.options=_;this._readFiles=new Set;this.customRepoRoots=_.customRepoRoots&&_.customRepoRoots.length>0?_.customRepoRoots:void 0}static{t(this,"CliToolExecutionContext")}markFileRead(s){this._readFiles.add(Sb(s))}hasFileBeenRead(s){return this._readFiles.has(Sb(s))}async readFile(s){return QF.promises.readFile(Sb(s),"utf-8")}async writeFile(s,c){let _=Sb(s);if(this.options.approveWrite&&!await this.options.approveWrite(_,c))throw new Error(`Write to ${_} rejected by user`);await QF.promises.mkdir(D6.dirname(_),{recursive:!0}),await QF.promises.writeFile(_,c,"utf-8")}async listFiles(s,c){let _=Sb(c??this.workspaceRoot),f=r1r(s),y=[];return await e_t(_,_,f,y),y.slice(0,vOe).sort()}async listDirectoryEntries(s){let c=Sb(s),_=await QF.promises.readdir(c,{withFileTypes:!0}),f=[];for(let y of _){if(y.name.startsWith("."))continue;let k=y.isDirectory();if(y.isSymbolicLink())try{k=(await QF.promises.stat(D6.join(c,y.name))).isDirectory()}catch{k=!1}f.push(k?`${y.name}/`:y.name)}return f.sort()}async searchCode(s,c,_){let f=Sb(c??this.workspaceRoot);return this.runRipgrep(s,f,_).catch(()=>this.runGrep(s,f,_))}async runCommand(s,c,_){let f=c.map(Sb),y=_?Sb(_):this.workspaceRoot,k={...process.env};if((s.split(/[\\/]/).pop()??s)==="gh")for(let F of["GITHUB_TOKEN","GH_TOKEN"]){let L=k[F];typeof L=="string"&&L.trim()===""&&delete k[F]}return new Promise(F=>{let L="",U="",Z=dZ.spawn(s,f,{cwd:y,shell:process.platform==="win32",env:k}),J=setTimeout(()=>{Z.kill("SIGTERM"),F({stdout:L.slice(0,_Z),stderr:U+`
1354
1354
  [process timed out]`,exitCode:124})},e1r),ve=process.stdout.isTTY===!0,he=t((Te,pt)=>{if(!ve)return;(pt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+Te+"\x1B[0m")},"writeLive");Z.stdout?.on("data",Te=>{let pt=Te.toString();L+=pt,he(pt,!1),L.length>_Z&&Z.kill("SIGTERM")}),Z.stderr?.on("data",Te=>{let pt=Te.toString();U+=pt,he(pt,!0)}),Z.on("close",Te=>{clearTimeout(J);let pt=L.slice(0,_Z);if(Te===0&&/Operation cancelled/i.test(pt)&&/(create-vite|create-react-app|create-next|create-svelte|create-astro|create-remix|@clack)/i.test(`${s} ${f.join(" ")} ${pt}`)){let bt=[s,...f].join(" ");F({stdout:pt,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}F({stdout:pt,stderr:U.slice(0,4*1024),exitCode:Te??0})}),Z.on("error",Te=>{if(clearTimeout(J),Te.code==="ENOENT"){F({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}F({stdout:"",stderr:Te.message,exitCode:1})})})}async watchCommand(s,c,_,f){let y=c.map(Sb),k=_?Sb(_):this.workspaceRoot;return new Promise(P=>{let F="",L="",U=!1,Z=!1,J=dZ.spawn(s,y,{cwd:k,shell:process.platform==="win32",env:{...process.env}}),ve=t(gt=>{Z||(Z=!0,P({stdout:F.slice(0,_Z),stderr:L.slice(0,4*1024),exitCode:gt,endedEarly:U}))},"finish"),he=setTimeout(()=>{try{J.kill("SIGTERM")}catch{}let gt=setTimeout(()=>{try{J.kill("SIGKILL")}catch{}ve(null)},1e3);J.once("close",bt=>{clearTimeout(gt),ve(typeof bt=="number"?bt:null)})},f),Te=process.stdout.isTTY===!0,pt=t((gt,bt)=>{if(!Te)return;(bt?process.stderr:process.stdout).write("\r\x1B[2K\x1B[2m"+gt+"\x1B[0m")},"writeLive");J.stdout?.on("data",gt=>{let bt=gt.toString();if(F+=bt,pt(bt,!1),F.length>_Z)try{J.kill("SIGTERM")}catch{}}),J.stderr?.on("data",gt=>{let bt=gt.toString();L+=bt,pt(bt,!0)}),J.on("close",gt=>{Z||(clearTimeout(he),U=!0,ve(typeof gt=="number"?gt:null))}),J.on("error",gt=>{Z||(clearTimeout(he),U=!0,L+=gt.message,ve(1))})})}runRipgrep(s,c,_){return new Promise((f,y)=>{let k=["--color=never","--line-number","--max-count=25","--max-filesize=1M",...[...bOe].map(U=>["--glob",`!${U}`]).flat()];_&&k.push("--glob",_),k.push(s,c);let P="",F=dZ.spawn("rg",k,{shell:!1}),L=setTimeout(()=>{F.kill("SIGTERM"),f(P.slice(0,p9))},Qft);F.stdout?.on("data",U=>{P+=U.toString(),P.length>p9&&F.kill("SIGTERM")}),F.on("close",U=>{clearTimeout(L),U!=null&&U>=2&&P.length===0?y(new Error(`rg exited with code ${U}`)):f(P.slice(0,p9))}),F.on("error",y)})}runGrep(s,c,_){return new Promise((f,y)=>{let k=[...bOe].map(he=>["--exclude-dir",he]).flat(),P=_?t1r(_):{includes:[],subDir:""},F=P.includes.flatMap(he=>["--include",he]),L=P.subDir?`${c}/${P.subDir}`:c,U=["-rn","-E","--color=never",...k,...F,s,L],Z="",J=dZ.spawn("grep",U,{shell:!1}),ve=setTimeout(()=>{J.kill("SIGTERM"),f(Z.slice(0,p9))},Qft);J.stdout?.on("data",he=>{Z+=he.toString(),Z.length>p9&&J.kill("SIGTERM")}),J.on("close",he=>{clearTimeout(ve),he!=null&&he>=2&&Z.length===0?y(new Error(`grep exited with code ${he}`)):f(Z.slice(0,p9))}),J.on("error",y)})}};function r1r(a){let s=n1r(a);return c=>s.test(c.replace(/\\/g,"/"))}t(r1r,"compileGlob");function n1r(a){let s="^";for(let c=0;c<a.length;c++){let _=a[c];if(_==="*")a[c+1]==="*"?(s+=".*",c++,a[c+1]==="/"&&c++):s+="[^/]*";else if(_==="?")s+="[^/]";else if(_==="{"){let f=a.indexOf("}",c);if(f===-1){s+="\\{";continue}let y=a.slice(c+1,f).split(",").map(i1r).join("|");s+=`(?:${y})`,c=f}else/[.+^$()|\\]/.test(_)?s+="\\"+_:s+=_}return s+="$",new RegExp(s)}t(n1r,"globToRegex");function i1r(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}t(i1r,"escapeRegex");async function e_t(a,s,c,_){if(_.length>=vOe)return;let f;try{f=await QF.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let y of f){if(_.length>=vOe)return;if(bOe.has(y.name))continue;let k=D6.join(a,y.name),P=D6.relative(s,k);y.isDirectory()?await e_t(k,s,c,_):y.isFile()&&c(P)&&_.push(k)}}t(e_t,"walk");var r_t=Tu(require("child_process")),lE=Tu(require("fs")),n_t=Tu(require("os")),SOe=Tu(require("path")),i_t=Tu(require("crypto"));function TOe(){let a=i_t.randomBytes(4).toString("hex");return SOe.join(n_t.tmpdir(),`bandit-paste-${Date.now()}-${a}.png`)}t(TOe,"freshTempPath");function pue(a,s,c={}){try{let _=r_t.spawnSync(a,s,{...c,encoding:void 0});return{stdout:Buffer.isBuffer(_.stdout)?_.stdout:Buffer.from(_.stdout??""),code:_.status}}catch{return{stdout:Buffer.alloc(0),code:null}}}t(pue,"tryExec");async function mue(){return process.platform==="darwin"?a1r():process.platform==="linux"?s1r():process.platform==="win32"?o1r():null}t(mue,"readClipboardImage");function a1r(){let a=TOe(),s=`set pngData to (the clipboard as \xABclass PNGf\xBB)
1355
1355
  set outFile to (open for access (POSIX file "${a}") with write permission)
1356
1356
  write pngData to outFile
@@ -1711,7 +1711,7 @@ ${Mi}`},"drainBackgroundCompletions"),U=[];y.on("complete",Mi=>{U.push(ce.dim(`
1711
1711
  `)),process.stdout.write(`
1712
1712
  `+ce.dim(` Type ${ce.cyan("/help")} for commands, ${ce.cyan("@path")} to pin a file, ${ce.cyan("Ctrl+V")} to paste a clipboard image, or ${ce.cyan("exit")} to quit.
1713
1713
 
1714
- `));let Ti=t(Mi=>{let Hi=Mi.match(/@([^\s@]*)$/);if(!Hi)return[[],Mi];let Fs=Hi[1],Ja=TSr(a,Fs,30);return Ja.length===0?[[],Hi[0]]:[Ja.map(yo=>`@${yo}`),Hi[0]]},"completer"),Ma=S9.createInterface({input:process.stdin,output:process.stdout,completer:Ti});S9.emitKeypressEvents(process.stdin);let ki=t(async(Mi,Hi)=>{if(!Hi||Hi.ctrl!==!0||Hi.name!=="v")return;let Fs=await mue();if(Fs)try{let Ja=Yp.join(a,".bandit","pastes");Cm.mkdirSync(Ja,{recursive:!0});let yo=`paste-${Date.now()}.png`,Na=Yp.join(Ja,yo);try{Cm.renameSync(Fs.path,Na)}catch{Cm.copyFileSync(Fs.path,Na);try{Cm.unlinkSync(Fs.path)}catch{}}let cl=Yp.relative(a,Na),ha=Math.round(Fs.sizeBytes/1024);process.stdout.write(`
1714
+ `));let Ti=t(Mi=>{let Hi=Mi.match(/@([^\s@]*)$/);if(!Hi)return[[],Mi];let Fs=Hi[1],Ja=TSr(a,Fs,30);return Ja.length===0?[[],Hi[0]]:[Ja.map(yo=>`@${yo}`),Hi[0]]},"completer"),Ma=S9.createInterface({input:process.stdin,output:process.stdout,completer:Ti});S9.emitKeypressEvents(process.stdin),process.stdin.setMaxListeners(30);let ki=t(async(Mi,Hi)=>{if(!Hi||Hi.ctrl!==!0||Hi.name!=="v")return;let Fs=await mue();if(Fs)try{let Ja=Yp.join(a,".bandit","pastes");Cm.mkdirSync(Ja,{recursive:!0});let yo=`paste-${Date.now()}.png`,Na=Yp.join(Ja,yo);try{Cm.renameSync(Fs.path,Na)}catch{Cm.copyFileSync(Fs.path,Na);try{Cm.unlinkSync(Fs.path)}catch{}}let cl=Yp.relative(a,Na),ha=Math.round(Fs.sizeBytes/1024);process.stdout.write(`
1715
1715
  `+ce.dim(` ${Nc.check} image pasted (${ha} KB) \u2192 ${ce.cyan(cl)}
1716
1716
  `)),Ma.write(`@${cl} `)}catch(Ja){process.stdout.write(`
1717
1717
  `+ce.red(` ${Nc.cross} clipboard paste failed: ${Ja instanceof Error?Ja.message:String(Ja)}
@@ -1721,7 +1721,7 @@ ${Mi}`},"drainBackgroundCompletions"),U=[];y.on("complete",Mi=>{U.push(ce.dim(`
1721
1721
  `)}let yo=[Ft,`${dd} turn${dd===1?"":"s"}`,Fs];Ja&&yo.push(Ja),Z&&yo.push(Z);let Na=y.listByStatus("running").length;Na>0&&yo.push(`bg:${Na} running`),Xt!==void 0&&yo.push(Xt?"think:on":"think:off"),he&&yo.push(ce.accent(`update v${he} available`)),Un&&(Ws.length>0&&yo.push(ce.accent(`queued: ${Ws.length}`)),yo.push(ce.dim("Esc to stop")));let cl=yo.join(" \xB7 "),ha=Math.max(0,Mi-cl.length-1);process.stdout.write(" ".repeat(ha)+ce.dim(cl)+`
1722
1722
  `)},"renderStatusBar");process.stdout.on?.("resize",()=>{});let Tt=t((Mi,Hi)=>{if(!Mi||!Hi)return;let Fs=Hi.replace(/<think\b[\s\S]*?<\/think\s*>/gi,"").replace(/```bandit-reasoning\b[\s\S]*?```/gi,"").replace(/```[\s\S]*?```/g," ").replace(/<tool_call\b[\s\S]*?<\/tool_call\s*>/gi,"").split(`
1723
1723
  `).filter(xf=>!/^\s*\|.*\|\s*$/.test(xf)).filter(xf=>!/^\s*\|?\s*[:\-|\s]+\|\s*[:\-|\s]+/.test(xf)).join(`
1724
- `).replace(/\*\*([^*\n]+)\*\*/g,"$1").replace(/(?<!\*)\*([^*\n]+)\*(?!\*)/g,"$1").replace(/__([^_\n]+)__/g,"$1").replace(/`([^`\n]+)`/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*[-*•]\s+/gm,"").replace(/^\s*-{3,}\s*$/gm,"").replace(/\n{3,}/g,`
1724
+ `).replace(/(\|[^|\n]+){3,}\|?/g," ").replace(/\*\*([^*\n]+)\*\*/g,"$1").replace(/(?<!\*)\*([^*\n]+)\*(?!\*)/g,"$1").replace(/__([^_\n]+)__/g,"$1").replace(/`([^`\n]+)`/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*[-*•]\s+/gm,"").replace(/^\s*-{3,}\s*$/gm,"").replace(/\n{3,}/g,`
1725
1725
 
1726
1726
  `).trim();if(Fs.length<40&&Mi.trim().length<30)return;let Ja=Mi.trim().replace(/\s+/g," ").slice(0,80),yo=Fs.split(/(?<=[.!?])\s+/)[0]?.replace(/\s+/g," ").slice(0,100)??"";if(!yo)return;let Na=process.stdout.columns||80,cl=`\u273B recap: "${Ja}" \u2192 ${yo}`,ha=cl.length>Na-4?cl.slice(0,Na-5)+"\u2026":cl;process.stdout.write(ce.dim(" "+ha)+`
1727
1727
  `)},"renderRecap");Ma.setPrompt(ce.accent(Nc.prompt+" ")),K_(),Ma.prompt();let Or=new eM(a,(0,Qp.createDefaultLanguageAdapters)()),zr={skillRegistry:Nr,session:s,cwd:a,toolCtx:Or,model:{get current(){return Ft},set(Mi){Ft=Mi,Jt={...Jt,model:Mi},bt=CZ(Jt).settings}},setProvider(Mi){let Hi=Mi==="ollama"?"gemma4:e4b":"bandit-logic",Ja=Mi==="ollama"&&/:/.test(Ft)||Mi==="bandit"&&Ft.startsWith("bandit-")?Ft:Hi;Ft=Ja,Jt={...Jt,provider:Mi,model:Ja};let yo=CZ(Jt);bt=yo.settings,Ct=yo.kind},get providerKind(){return Jt.provider},get ollamaUrl(){return bt.ollamaUrl??Jt.ollamaUrl??"http://localhost:11434"},setOllamaUrl(Mi){let Hi=(Mi??"").trim(),Fs=Hi.length>0?Hi:"http://localhost:11434";Jt={...Jt,ollamaUrl:Fs},bt=CZ(Jt).settings},getConversation:t(()=>[...la],"getConversation"),setConversation:t(Mi=>{la.length=0,la.push(...Mi),s.replace([...Mi])},"setConversation"),tokenBudget:t(()=>{let Mi=Jt.provider==="ollama"?(0,Iy.resolveOllamaRuntimeOptions)(Ft).num_ctx:32768;return Math.floor(Mi*.75)},"tokenBudget"),thinkingMode:{get:t(()=>Xt,"get"),set:t(Mi=>{Xt=Mi},"set")},planPreview:{get:t(()=>Hr,"get"),set:t(Mi=>{Hr=Mi},"set")},getConfig:t(()=>Jt,"getConfig"),exit:t(()=>Ma.close(),"exit"),clearConversation:t(()=>{la.length=0,s.replace([])},"clearConversation"),reloadMemory:t(async()=>{let Mi=await(0,Os.loadMemory)(a);return $i.content=Mi.content,$i.sources=Mi.sources,Mi.content},"reloadMemory"),getLine:t(()=>Qd(),"getLine"),queuePrompt:t(Mi=>{Ws.push(Mi)},"queuePrompt"),backgroundStore:y,mcpPool:P,reloadMcpFromDisk:t(async()=>(0,Os.registerMcpServersFromDisk)(a,P),"reloadMcpFromDisk"),revokeMcpTrust:t(async Mi=>{let Hi=P.snapshot().find(Ja=>Ja.name===Mi);if(!Hi)return!1;let Fs=(0,Qp.fingerprintServerConfig)(Hi.name,Hi.config);return await(0,Os.revokeMcpFingerprint)(Fs),k.delete(Fs),!0},"revokeMcpTrust"),setMcpActivation:t(async(Mi,Hi)=>{let Fs=P.snapshot().find(Ja=>Ja.name===Mi);if(!Fs)return!1;P.register(Mi,{...Fs.config,activation:Hi});try{await(0,Os.persistMcpActivation)(a,Mi,Hi)}catch{}return!0},"setMcpActivation"),addGitHubMcp:t(async Mi=>{let Hi=(0,Os.buildGitHubServerConfig)(Mi),Fs=await(0,Os.addMcpServerToConfig)(a,"github",Hi),Ja=(0,Qp.fingerprintServerConfig)("github",Hi);return await(0,Os.approveMcpFingerprint)(Ja).catch(()=>{}),k.add(Ja),await(0,Os.registerMcpServersFromDisk)(a,P),Fs},"addGitHubMcp"),addSlackMcp:t(async(Mi,Hi)=>{let Fs=(0,Os.buildSlackServerConfig)(Mi,Hi),Ja=await(0,Os.addMcpServerToConfig)(a,"slack",Fs),yo=(0,Qp.fingerprintServerConfig)("slack",Fs);return await(0,Os.approveMcpFingerprint)(yo).catch(()=>{}),k.add(yo),await(0,Os.registerMcpServersFromDisk)(a,P),Ja},"addSlackMcp"),addGitLabMcp:t(async(Mi,Hi)=>{let Fs=(0,Os.buildGitLabServerConfig)(Mi,Hi),Ja=await(0,Os.addMcpServerToConfig)(a,"gitlab",Fs),yo=(0,Qp.fingerprintServerConfig)("gitlab",Fs);return await(0,Os.approveMcpFingerprint)(yo).catch(()=>{}),k.add(yo),await(0,Os.registerMcpServersFromDisk)(a,P),Ja},"addGitLabMcp"),addCustomMcp:t(async Mi=>{let Hi=(0,Os.buildCustomServerConfig)({command:Mi.command,args:Mi.args,envInput:Mi.envInput}),Fs=await(0,Os.addMcpServerToConfig)(a,Mi.name,Hi),Ja=(0,Qp.fingerprintServerConfig)(Mi.name,Hi);return await(0,Os.approveMcpFingerprint)(Ja).catch(()=>{}),k.add(Ja),await(0,Os.registerMcpServersFromDisk)(a,P),Fs},"addCustomMcp"),oneShotChat:t(async(Mi,Hi)=>{let Fs=Hi?.timeoutMs??3e4;try{let Ja=await(0,Iy.createProvider)(bt),yo=[];Hi?.systemPrompt&&yo.push({role:"system",content:Hi.systemPrompt}),yo.push({role:"user",content:Mi});let Na={model:Ft,messages:yo,stream:!0,temperature:.3},cl="",ha=new Promise(ks=>setTimeout(()=>ks(null),Fs)),xf=(async()=>{for await(let ks of Ja.chat(Na)){let Bf=ks.message?.content??"";if(Bf&&(cl+=Bf),ks.done)break}return cl})(),io=await Promise.race([xf,ha]);return typeof io=="string"&&io.trim().length>0?io:null}catch{return null}},"oneShotChat")},Ws=[],d_=null,Ay=!1,Qd=t(()=>new Promise(Mi=>{if(Ws.length>0){Mi(Ws.shift());return}d_=t(Hi=>{d_=null,Mi(Hi)},"lineIntercept")}),"replGetLine"),Ig=t(async()=>{if(!Ay){Ay=!0;try{for(;Ws.length>0;){if(d_){let Fs=Ws.shift(),Ja=d_;d_=null,Ja(Fs);continue}let Hi=Ws.shift().trim();if(!Hi){Ma.prompt();continue}if(Hi==="exit"||Hi==="quit"){Ma.close();return}if(/^[yn]$/i.test(Hi)&&la.length>0){let Fs=[...la].reverse().find(Ja=>Ja.role==="assistant");Fs&&bdt(Fs.content)&&(Hi=Hi.toLowerCase()==="y"?"yes":"no")}try{let Fs=ydt(Hi);if(Fs){let ha=await Fs.cmd.run(Fs.args,zr);ha&&process.stdout.write(ha+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burtson-labs/bandit-stealth-cli",
3
- "version": "1.7.185",
3
+ "version": "1.7.186",
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",