@burtson-labs/bandit-stealth-cli 1.7.394 → 1.7.395
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 +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2021,7 +2021,7 @@ Upgrade it with:
|
|
|
2021
2021
|
<h1>You're signed in.</h1>
|
|
2022
2022
|
<p>Bandit picked up your session. You can close this tab and return to your terminal.</p>
|
|
2023
2023
|
</div>
|
|
2024
|
-
</body></html>`;t(EVn,"startLoopbackListener");t(TVn,"openBrowser");t(wVn,"buildDefaultDeviceLabel");t(xVn,"runOAuthSignIn")});var Sse=Bt((Gvr,kVn)=>{kVn.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.
|
|
2024
|
+
</body></html>`;t(EVn,"startLoopbackListener");t(TVn,"openBrowser");t(wVn,"buildDefaultDeviceLabel");t(xVn,"runOAuthSignIn")});var Sse=Bt((Gvr,kVn)=>{kVn.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.395",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:"Apache-2.0",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"},type:"module",bin:{bandit:"./dist/cli.js"},main:"dist/cli.js",files:["dist/cli.js","README.md","LICENSE"],engines:{node:">=20"},publishConfig:{access:"public"},scripts:{test:"vitest run",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","@types/react":"^19.2.2",esbuild:"^0.28.0",ink:"^7.0.4","ink-text-input":"^6.0.0",pngjs:"^7.0.0",react:"^19.2.0",typescript:"^5.4.0",vitest:"^4.0.10"}}});import*as Sq from"child_process";import*as y1 from"fs";import*as Aw from"path";function IVn(r){let i=process.env.HOME||"";return i&&r.startsWith(i)?`~${r.slice(i.length)}`:r}function DVn(){return new Promise(r=>{let i=Sq.spawn("npm",["view",PSe,"version"],{shell:!1,stdio:["ignore","pipe","pipe"]}),s="";i.stdout?.on("data",u=>{s+=u.toString()});let l=setTimeout(()=>{i.kill("SIGTERM"),r(null)},8e3);i.on("close",u=>{clearTimeout(l),r(u===0?s.trim():null)}),i.on("error",()=>{clearTimeout(l),r(null)})})}function NVn(r){return(r??"").trim().split(/\s+/).filter(Boolean).some(i=>PVn.has(i.toLowerCase()))}function OVn(r,i){let s=[...r].map(h=>h.role).lastIndexOf("user");if(s===-1)return null;let l=r[s],u=typeof l.content=="string"?l.content:"",_=i&&i.trim()?i.trim():u;return _?{prompt:_,trimmedConversation:r.slice(0,s)}:null}function RVn(r,i){let s=t(O=>O.replace(/[^0-9.]/g,"").split(".").map(L=>parseInt(L,10)||0),"parse"),[l,u,_]=s(r),[h,E,P]=s(i);return l!==h?l<h?-1:1:u!==E?u<E?-1:1:_!==P?_<P?-1:1:0}function BVn(r){return NSe.find(i=>i.name===r)}function FVn(){let r=NSe.map(i=>` ${H.cyan("/"+i.name.padEnd(14))} ${H.dim(i.description)}`);return[H.bold("All slash commands:"),...r,"",H.dim("Tip: prefix any file with @ to pin it, or run /help permissions for the permission model.")].join(`
|
|
2025
2025
|
`)}function LVn(){return[H.bold("Permission choices"),"",` ${H.accent("allow once")} ${H.dim("Run only this call.")}`,` ${H.accent("allow turn")} ${H.dim("Allow calls like this until the agent finishes the current turn.")}`,` ${H.dim(" ")}${H.dim("Best pick when the model is making a batch of similar edits.")}`,` ${H.accent("allow session")} ${H.dim("Allow them until you exit Bandit.")}`,` ${H.accent("always allow")} ${H.dim("Save the rule to .bandit/settings.json so it survives restarts.")}`,` ${H.accent("deny")} ${H.dim("Block the call. Bandit should not retry it.")}`,` ${H.accent("deny + note")} ${H.dim("Block it and tell Bandit what to do instead.")}`,"",H.dim(" The card shows the exact rule each choice stores, under the highlighted"),H.dim(" option. For shell commands the rule covers a command shape \u2014 approving"),H.dim(" `git status` grants `git status \u2026`, not every command."),"",H.bold("Permission modes")+H.dim(" \u2014 /auto to change"),` ${H.accent("ask")} ${H.dim("Every non-allowlisted call prompts. Default.")}`,` ${H.accent("auto")} ${H.dim("Routine work runs unprompted: reading, editing files in this")}`,` ${H.dim(" ")}${H.dim("project, running builds and tests. Everything else still asks.")}`,` ${H.accent("dangerous")} ${H.dim("Nothing prompts. CI and sandboxes only; not settable from /auto.")}`,"",H.bold("What auto mode never does without asking"),H.dim(" Deleting files \xB7 writing outside the project \xB7 force-push and history"),H.dim(" rewrites \xB7 global installs and publishes \xB7 touching credential files \xB7"),H.dim(" sending data off the machine \xB7 mutating a connected service."),H.dim(" That floor holds even if a saved allow rule would cover the call."),"",H.dim(" /permissions review what ran unattended and which grants are active"),H.dim(" /doctor explain the current setup and next best actions")].join(`
|
|
2026
2026
|
`)}function jVn(){let r=[H.bold("Bandit commands"),H.dim("Use /help all for the full list, /help permissions for approval choices."),""],i=new Set;for(let l of MVn){let u=l.names.map(_=>BVn(_)).filter(_=>!!_);if(u.length!==0){r.push(H.bold(l.title));for(let _ of u)i.add(_.name),r.push(` ${H.cyan("/"+_.name.padEnd(14))} ${H.dim(_.description)}`);r.push("")}}let s=NSe.filter(l=>!i.has(l.name)&&l.name!=="quit");return s.length>0&&(r.push(H.dim(`Also available: ${s.map(l=>"/"+l.name).join(", ")}`)),r.push("")),r.push(H.dim("Fast path: /doctor \u2192 /connect or /init \u2192 ask for the change \u2192 /review \u2192 /test \u2192 /commit")),r.join(`
|
|
2027
2027
|
`)}function $Vn(r){let i=[],s=r.accomplishments,l=Math.max(1,Math.round((Date.now()-(r.firstSeenAt??Date.now()))/864e5)),u=r.ai?.storyline&&r.ai.storyline.length>0?r.ai.storyline:r.localStory;if(u.length>0){let O=Math.min(process.stdout.columns||80,100),L=Math.max(40,O-4);i.push(H.bold("Your story")+H.dim(` \xB7 ${r.ai?.storyline?.length?r.ai.modelLabel:"local synthesis"}`)),i.push("");for(let J of u){let $=J.replace(/\s+/g," ").trim().split(" "),ae="";for(let ie of $)ae.length===0?ae=ie:ae.length+1+ie.length<=L?ae+=" "+ie:(i.push(" "+ae),ae=ie);ae&&i.push(" "+ae),i.push("")}}if(i.push(H.bold("How you use Bandit")),i.push(""),i.push(` ${H.dim("sessions ")} ${H.accent(String(r.sessions.length))} ${H.dim("over "+l+" day"+(l===1?"":"s"))}`),i.push(` ${H.dim("prompts ")} ${H.accent(String(r.totalPrompts))} ${H.dim("~"+(r.totalApproxTokens>=1e3?(r.totalApproxTokens/1e3).toFixed(1)+"K":r.totalApproxTokens)+" tokens")}`),(r.streak.current>0||r.streak.longest>0)&&i.push(` ${H.dim("streak ")} ${H.accent(r.streak.current+" day"+(r.streak.current===1?"":"s"))} ${H.dim("(longest "+r.streak.longest+")")}`),r.peakDay&&i.push(` ${H.dim("peak day ")} ${H.accent(r.peakDay.date)} ${H.dim(r.peakDay.prompts+" prompts")}`),i.push(""),i.push(H.bold("What got done")),i.push(` ${H.dim("files touched ")} ${H.accent(String(s.filesTouched))} ${H.dim("("+s.filesWritten+" written, "+s.editsApplied+" edited)")}`),s.gitOperations>0&&i.push(` ${H.dim("git ops ")} ${H.accent(String(s.gitOperations))} ${H.dim("("+s.commitsMade+" commits)")}`),s.testsRun>0&&i.push(` ${H.dim("tests run ")} ${H.accent(String(s.testsRun))}`),s.subagentsSpawned>0&&i.push(` ${H.dim("subagents ")} ${H.accent(String(s.subagentsSpawned))}`),s.languages.length>0){let O=s.languages.slice(0,5).map(L=>`${L.label} ${H.dim("("+L.count+")")}`).join(H.dim(", "));i.push(` ${H.dim("languages ")} ${O}`)}if(r.work.themes.length>0){i.push(""),i.push(H.bold("Bigger arcs"));for(let O of r.work.themes.slice(0,4)){let L=[`${O.turns} turn${O.turns===1?"":"s"}`,O.filesTouched>0?`${O.filesTouched} files`:"",O.testsRun>0?`${O.testsRun} tests`:"",O.externalActions>0?`${O.externalActions} external`:"",O.subagentsSpawned>0?`${O.subagentsSpawned} subagents`:""].filter(Boolean).join(", ");i.push(` ${H.cyan(O.title)} ${H.dim(L?"\u2014 "+L:"")}`),O.outcomes.length>0&&i.push(H.dim(` ${O.outcomes[0]}`)),O.sampleTitles.length>0&&i.push(H.dim(` ${O.sampleTitles[0]}`))}}if(r.work.highlights.length>0){i.push(""),i.push(H.bold("Largest work highlights"));for(let O of r.work.highlights.slice(0,5))i.push(` ${H.cyan(O.date)} ${H.accent(O.area)} ${H.dim("\xB7 "+O.category)}`),i.push(H.dim(` ${O.title}`)),i.push(H.dim(` ${O.summary}`)),O.outcome&&i.push(H.dim(` ${O.outcome}`))}if(s.topFiles.length>0){i.push(""),i.push(H.bold("Most-touched files"));for(let O of s.topFiles.slice(0,5))i.push(` ${H.cyan(O.path)} ${H.dim("\xD7"+O.touches)}`)}let _=[...r.toolStats.entries()].map(([O,L])=>({name:O,calls:L.calls,errors:L.errors,rate:L.calls>0?L.errors/L.calls:0})).sort((O,L)=>L.calls-O.calls).slice(0,6);if(_.length>0){i.push(""),i.push(H.bold("Top tools"));for(let O of _){let L=Math.round(O.rate*100),J=O.calls>=5&&L>=25?" "+H.yellow("\u26A0 "+L+"% error rate"):"";i.push(` ${H.cyan(O.name.padEnd(16))} ${H.accent(String(O.calls).padStart(4))} ${H.dim("calls")}${J}`)}}let h=[...r.errorClusters.entries()].flatMap(([O,L])=>L.map(J=>({tool:O,error:J.error,count:J.count}))).sort((O,L)=>L.count-O.count);if(h.length>0){let O=h[0],L=O.error.replace(/\s+/g," ").slice(0,70);i.push(""),i.push(H.bold("Top friction")),i.push(` ${H.cyan(O.tool)} ${H.dim("\xD7"+O.count)} ${H.dim(L+(O.error.length>70?"\u2026":""))}`)}let E=r.sentiment;if(E.satisfied+E.happy+E.excited+E.frustrated+E.unsatisfied>0){let O=[];E.excited>0&&O.push(H.green("excited ")+H.bold(String(E.excited))),E.happy>0&&O.push(H.green("happy ")+H.bold(String(E.happy))),E.satisfied>0&&O.push(H.green("satisfied ")+H.bold(String(E.satisfied)));let L=[];if(E.unsatisfied>0&&L.push(H.yellow("unsatisfied ")+H.bold(String(E.unsatisfied))),E.frustrated>0&&L.push(H.red("frustrated ")+H.bold(String(E.frustrated))),i.push(""),i.push(H.bold("How you felt")),O.length>0&&i.push(` ${O.join(H.dim(" \xB7 "))}`),L.length>0&&i.push(` ${L.join(H.dim(" \xB7 "))}`),E.notable.length>0){i.push(H.dim(" Frustration moments:"));for(let J of E.notable.slice(0,3))i.push(H.dim(' "')+H.dim(J)+H.dim('"'))}}return i.push(""),i.push(H.dim(" Full report (HTML + AI summary): ")+H.cyan("/insights")),i.join(`
|
|
@@ -2480,7 +2480,7 @@ Decide whether to retry this scope, work around it, or proceed without that suba
|
|
|
2480
2480
|
`);process.stdout.write(`
|
|
2481
2481
|
`)}catch{}process.stdout.write(H.dim(` ${Io.spark} booting\u2026
|
|
2482
2482
|
`));let gt=await mq(r);if(gt.theme)l$(gt.theme);else if(process.stdout.isTTY){let tn=await _Wn();tn&&(l$(tn),await rse(tn),gt.theme=tn)}let Et=gq(gt,s),st=Eq(Et),{settings:Dt,model:Fn,kind:Zt}=st,Sn=Et,Pn=(0,sY.resolveTelemetryConfig)({telemetry:gt.telemetry,banditApiKey:Sn.apiKey});Wze(Pn)&&Pn&&process.stdout.write(H.dim(` ${Io.spark} telemetry on \xB7 ${Pn.endpoint}`)+`
|
|
2483
|
-
`);let xr=t(tn=>{Yze(Sn.notifications,tn)},"sendNotification"),ur=st.modelWasExplicit;Zt==="openai-compatible"&&Sn.openaiBaseUrl&&Sn.model&&(async()=>{let tn=await(0,Jp.queryModelsDevCapabilities)(Sn.model,Sn.openaiBaseUrl);if(tn){(0,Jp.registerModelCapabilities)(Sn.model,tn);return}let qr=await(0,Jp.queryOpenAICompatibleModelInfo)(Sn.model,Sn.openaiBaseUrl,Sn.openaiApiKey);if(qr?.exists&&qr.contextWindow){let fr=(0,Jp.getModelCapabilities)(Sn.model);(0,Jp.registerModelCapabilities)(Sn.model,{...fr,contextWindow:qr.contextWindow,label:Sn.model})}})().catch(()=>{});let Kt=t(tn=>{if(Dt.kind!=="ollama"||!tn)return;let qr=Dt.ollamaUrl??Sn.ollamaUrl??"http://localhost:11434";(0,Jp.queryOllamaModelCapabilities)(tn,qr).then(fr=>{fr&&(0,Jp.registerModelCapabilities)(tn,fr)}).catch(()=>{})},"probeOllamaCapabilities");Kt(Fn);let Un,cr=Dze(gt.reasoningDisplay)?gt.reasoningDisplay:"compact",an=/^(1|true)$/i.test(process.env.BANDIT_NO_COAUTHOR??""),Pi=an?!1:Sn.coauthor!==!1,ma=Sn.watchdogMs,ds=!1,un=!1,wi=null,rs,is=0,Nc=0,ka="\
|
|
2483
|
+
`);let xr=t(tn=>{Yze(Sn.notifications,tn)},"sendNotification"),ur=st.modelWasExplicit;Zt==="openai-compatible"&&Sn.openaiBaseUrl&&Sn.model&&(async()=>{let tn=await(0,Jp.queryModelsDevCapabilities)(Sn.model,Sn.openaiBaseUrl);if(tn){(0,Jp.registerModelCapabilities)(Sn.model,tn);return}let qr=await(0,Jp.queryOpenAICompatibleModelInfo)(Sn.model,Sn.openaiBaseUrl,Sn.openaiApiKey);if(qr?.exists&&qr.contextWindow){let fr=(0,Jp.getModelCapabilities)(Sn.model);(0,Jp.registerModelCapabilities)(Sn.model,{...fr,contextWindow:qr.contextWindow,label:Sn.model})}})().catch(()=>{});let Kt=t(tn=>{if(Dt.kind!=="ollama"||!tn)return;let qr=Dt.ollamaUrl??Sn.ollamaUrl??"http://localhost:11434";(0,Jp.queryOllamaModelCapabilities)(tn,qr).then(fr=>{fr&&(0,Jp.registerModelCapabilities)(tn,fr)}).catch(()=>{})},"probeOllamaCapabilities");Kt(Fn);let Un,cr=Dze(gt.reasoningDisplay)?gt.reasoningDisplay:"compact",an=/^(1|true)$/i.test(process.env.BANDIT_NO_COAUTHOR??""),Pi=an?!1:Sn.coauthor!==!1,ma=Sn.watchdogMs,ds=!1,un=!1,wi=null,rs,is=0,Nc=0,ka="\u2726",Hc=process.stdout.write.bind(process.stdout),Ql=t(tn=>{if(!process.stdout.isTTY||process.env.BANDIT_NO_TITLE)return;let qr=tn.replace(/[\u0000-\u001f\u007f]/g,"").replace(/\s+/g," ").trim().slice(0,70),fr=qr?`${ka} ${qr}`:"";Hc(`\x1B]0;${fr}\x07`)},"setWindowTitle"),cs="Bandit";if(Ql(cs),Zt==="ollama"){process.stdout.write(H.dim(` ${Io.spark} checking ollama (${Dt.ollamaUrl})\u2026
|
|
2484
2484
|
`));let tn=await U4t(Fn,Dt.ollamaUrl??"",!ur);tn.ok||(process.stderr.write(H.red("\u2717 ")+tn.message+`
|
|
2485
2485
|
`),process.exit(1)),tn.autoSwitched&&(ur&&process.stdout.write(H.dim(`${Io.info} ${tn.fromModel} not pulled \u2014 using ${H.accent(tn.model)} instead
|
|
2486
2486
|
`)),Fn=tn.model,Dt.ollamaModel=tn.model,Sn={...Sn,model:tn.model})}process.stdout.write(H.dim(` ${Io.spark} loading skills + memory\u2026
|
package/package.json
CHANGED