@burtson-labs/bandit-stealth-cli 1.7.494 → 1.7.495

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 +2 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1217,7 +1217,7 @@ ${c.join(`
1217
1217
  `)}async function iAr(t,e,i,s,o=null){let c=i.trim().toLowerCase(),f=n(m=>Qvr(t,s,o,m),"live"),p=n((...m)=>m.filter(Boolean).join(`
1218
1218
 
1219
1219
  `),"join");switch(c){case"":case"overview":case"all":return p(t.digest.trim(),f());case"tools":return p(Hvr(t,e),f(["tools"]));case"sandbox":return p(f(["sandbox"]),Gvr(t));case"settings":return Jvr(t,e);case"policy":return p(f(["policy","tools"]),Wvr(t));case"features":return Vvr(t);case"version":return p(f(["version","provider"])||"No version facts from this host.");case"troubleshooting":return p(f(["sandbox","policy"]),Zvr(t));case"session":return f()||"This host supplied no live facts.";default:{let m=t.features.find(C=>C.id===c);if(m){let C=(m.rows??[]).map(D=>`- ${Object.values(D).join(" | ")}`);return[`${m.title} (${m.doc}): ${m.summary}`,...C].join(`
1220
- `)}let g=t.tools.find(C=>C.name===c),b=g&&Wtt(g,e),S=rAr(t,e,i),w=/\b(model|provider)\b/.test(c)?f(["provider"]):/\b(version|update)\b/.test(c)?f(["version"]):/\b(network|internet|sandbox|docker|podman|container|offline)\b/.test(c)?f(["sandbox"]):/\b(policy|refused|blocked|denied|locked|admin)\b/.test(c)?f(["policy","tools"]):"";return b?p(`${b.name}(${b.params.join(", ")}): ${b.purpose} ${b.detail??""}`.trim(),`Registered: ${Object.entries(b.hosts).map(([C,D])=>`${C==="ide"?"IDE":"CLI"} ${D}`).join("; ")}`,f(["tools"])):S?p(w,S):p(w,`Nothing in the reference matches "${i}". Topics: ${Uvr.join(", ")}. Features: ${t.features.map(C=>C.id).join(", ")}.`)}}}function bKt(t){let e=t.loadReference??zvr,i=t.maxChars??9e3;return{name:_4e,description:"Facts about Bandit and Stealth and this session: tools, sandbox, settings, policy, features, version, troubleshooting. Check it before saying something is impossible.",parameters:[{name:"topic",description:"A topic, 'session', or words to look up ('vim', 'dev server'). Omit for an overview.",required:!1}],async execute(s){let o;try{o=await e()}catch(m){return{output:`The self-knowledge reference could not be loaded: ${m instanceof Error?m.message:String(m)}`,isError:!0}}let c=null,f=null;if(t.liveFacts)try{c=await t.liveFacts()}catch(m){f=m instanceof Error?m.message:String(m)}let p=await iAr(o,t.host,String(s?.topic??""),c,f);return{output:qvr(p,i),isError:!1}}}}var _4e,Uvr,gKt,Gtt,A$,Kvr,Yvr,Jtt,vKt=Gn(()=>{"use strict";_4e="stealth_about",Uvr=["tools","sandbox","settings","policy","features","version","troubleshooting","session"],gKt=null;n(zvr,"loadBundledReference");Gtt={ide:"the Stealth IDE",cli:"the Stealth CLI"},A$=n((t,e)=>t.length>e?`${t.slice(0,e-1)}\u2026`:t,"clip");n(qvr,"cap");n(Wtt,"toolFor");n(yKt,"toolLine");n(Qvr,"renderLive");n(Hvr,"renderTools");n(Gvr,"renderSandbox");n(Jvr,"renderSettings");n(Wvr,"renderPolicy");n(Vvr,"renderFeatures");n(Zvr,"renderTroubleshooting");Kvr=new Set("a about am an and any are at be been but by can cannot cant could did do does doing for from get got has have how i if in into is it its let me my need no not of on or please our should so tell that the their them then there this to too us use using want was we were what when where which who why will with would you your".split(" ")),Yvr={internet:["network","offline"],online:["network"],offline:["network"],web:["network","web"],shortcut:["keybinding","chord"],shortcuts:["keybinding","chord"],keybinding:["shortcut"],hotkey:["keybinding"],dark:["theme"],llm:["model"],devserver:["server"],docker:["sandbox","runtime"],container:["sandbox"],refused:["policy","denied"],blocked:["policy","denied"],install:["install","installs"]};n(Xvr,"words");n(eAr,"entries");Jtt=n((t,e)=>new RegExp(`(^|[^a-z0-9])${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(s|es)?([^a-z0-9]|$)`).test(t),"hasWord");n(tAr,"weights");n(nAr,"score");n(rAr,"lookUp");n(iAr,"describeStealth");n(bKt,"createStealthAboutTool")});function aAr(t){return[t.rootEntries,t.testsEntries,t.testEntries].some(e=>!!e&&e.some(i=>/^test_.*\.py$|_test\.py$/.test(i)))}function wKt(t){if(t.packageJson!==null)try{let s=JSON.parse(t.packageJson),o={...s.dependencies??{},...s.devDependencies??{}},c=o.vitest?"vitest":o.jest?"jest":o.mocha?"mocha":null;if(c&&t.installedRunners.includes(c))return{kind:"node",program:c,label:c};let f=s.scripts?.test;if(f&&!/no test specified/.test(f))return{kind:"node",program:"npm",label:`the package.json test script (\`${f}\`)`}}catch{}let e=t.rootEntries??[],i=sAr.some(s=>e.includes(s));return aAr(t)||i&&e.includes("tests")?{kind:"python",program:"python3",label:"the Python tests (test_*.py)"}:e.includes("go.mod")?{kind:"go",program:"go",label:"`go test ./...`"}:e.includes("Cargo.toml")?{kind:"cargo",program:"cargo",label:"`cargo test`"}:e.some(s=>/\.(sln|csproj)$/.test(s))?{kind:"dotnet",program:"dotnet",label:"`dotnet test`"}:null}function Ztt(t){return/\b(vitest|jest|mocha|pytest|go\s+test|cargo\s+test|dotnet\s+test|(npm|pnpm|yarn|bun)\s+(run\s+)?test|node\s+--test|python3?\s+-m\s+(pytest|unittest))\b/.test(t)}function Ktt(t){return t?!/\.(md|mdx|markdown|txt|rst|adoc)$/i.test(t)&&!/(^|\/)(LICENSE|CHANGELOG|README)[^/]*$/i.test(t):!0}var AKt,sAr,Vtt,Ytt=Gn(()=>{"use strict";oH();AKt=["vitest","jest","mocha"],sAr=["pytest.ini","pyproject.toml","setup.cfg","tox.ini"];n(aAr,"hasPythonTests");n(wKt,"projectTestsFromFacts");Vtt=new Set(["test_run","run_tests"]);n(Ztt,"isTestSuiteCommand");n(Ktt,"isCodePath")});function xKt(t){let e=t.map(i=>`\`${i}\``).join(", ");return`You changed files without a successful check afterward, and ${e} ${t.length===1?"is":"are"} not available here. Do not look for ${t.length===1?"it":"them"} or try to install ${t.length===1?"it":"them"}. If a check with the tools that are available can show the requested result, run it once; otherwise answer now and say the change is unverified because ${e} ${t.length===1?"is":"are"} unavailable.`}function CKt(t,e="test_run"){return`You checked with a command of your own, but this project has its own tests (${t.label}) and they have not run since your last code change. Run them once with ${e} (a file or name pattern is fine), then answer with what they showed. If they fail because of your change, fix it first.`}var oAr,cAr,SKt,Vme,kKt=Gn(()=>{"use strict";Ytt();oAr=new Set(["apply_edit","apply_patch","replace_range","write_file"]),cAr=new Set(["run_command","run_tests","test_run"]),SKt="You changed files without a successful check afterward. Verify the requested result with a focused assertion, not just a file read or import. A failed or unavailable check is not a pass. Do not repeat installation attempts for unavailable tooling; use a meaningful available check or state what remains unverified. Then answer concisely with what you actually checked.";n(xKt,"verifyNoteForMissing");n(CKt,"verifyNoteForSuite");Vme=class{static{n(this,"VerifyBeforeDone")}editedSinceCheck=!1;codeEditedSinceSuite=!1;suite;suiteTool;constructor(e={}){this.suite=e.projectTests??null,this.suiteTool=e.suiteTool??"test_run"}onToolResult(e,i,s){if(oAr.has(e)){if(!i){this.editedSinceCheck=!0;let o=typeof s?.path=="string"?s.path:void 0;(e==="apply_patch"||Ktt(o))&&(this.codeEditedSinceSuite=!0)}return}if(cAr.has(e)&&!i){this.editedSinceCheck=!1;let o=[s?.cmd,s?.args].filter(c=>typeof c=="string").join(" ");(Vtt.has(e)||e==="run_command"&&Ztt(o))&&(this.codeEditedSinceSuite=!1)}}note(e=[]){let i=this.suite&&!e.includes(this.suite.program)?this.suite:null,s=!!i&&this.codeEditedSinceSuite;if(this.editedSinceCheck){let o=s?` This project has its own tests (${i.label}) and they can run here: ${this.suiteTool} runs them.`:"";return(e.length>0?xKt(e):SKt)+o}if(s)return CKt(i,this.suiteTool)}}});function Xtt(t,e){if(t===0||!e)return null;if(t===127){let o=e.match(/(?:^|\n)[^\n:]*sh: (?:\d+: )?([\w.+-]+): (?:command )?not found/);if(o)return o[1];let c=e.match(/spawn ([\w.+-]+) ENOENT/);if(c)return c[1]}let i=e.match(/No module named ['"]?([\w.]+)['"]?\s*$/m);if(i&&/^[^\n]*python[\d.]*: No module named/m.test(e))return i[1];let s=e.match(/npx canceled due to missing packages[^[\n]*\[\s*["']?((?:@[\w.-]+\/)?[\w.-]+)/);return s?s[1]:null}function ent(t,e){return e?`[unavailable: \`${t}\` is not installed in this sandbox image.]`:`[unavailable: \`${t}\` is not installed in this sandbox image, and the sandbox has no network, so it cannot be installed. Do not look for it or try to install it; use a check that is available, or say the change is unverified.]`}var Zme,EKt=Gn(()=>{"use strict";n(Xtt,"missingProgram");n(ent,"missingProgramNote");Zme=class{static{n(this,"MissingToolTracker")}missing=new Set;pending=0;stepErrors=0;stepMissing=0;lastStep={errors:0,missing:0};onMissingProgram(e){this.missing.add(e),this.pending++}onToolResult(e){let i=this.pending>0;this.pending=0,e&&(this.stepErrors++,i&&this.stepMissing++)}onModelCall(){this.lastStep={errors:this.stepErrors,missing:this.stepMissing},this.stepErrors=0,this.stepMissing=0,this.pending=0}programs(){return[...this.missing]}lastStepFailedOnlyOnMissingPrograms(){return this.lastStep.errors>0&&this.lastStep.missing===this.lastStep.errors}}});async function uAr(t,e,i){let s=String(t.framework??t.runner??"").trim().toLowerCase();if(s)return s==="pytest"||s==="python"||s==="unittest";try{let o=JSON.parse(await e.readFile(`${i}/package.json`)),c={...o.dependencies??{},...o.devDependencies??{}};if(c.vitest||c.jest||c.mocha||o.scripts?.test)return!1}catch{}for(let o of["pytest.ini","pyproject.toml","setup.cfg","tox.ini"])try{return await e.readFile(`${i}/${o}`),!0}catch{}try{return(await e.listFiles("**/test_*.py",i)).length>0}catch{return!1}}function g4e(t){return{...t,async execute(e,i){let s=String(e.cwd??"").trim().replace(/^\.\/?/,"").replace(/\/+$/,""),o=s?s.startsWith("/")?s:`${i.workspaceRoot}/${s}`:i.workspaceRoot;if(!await uAr(e,i,o)||(await i.runCommand("python3",["-c",lAr],o)).exitCode!==3)return t.execute(e,i);let f=String(e.pattern??e.filter??"").trim(),p=await i.runCommand("python3",["-c",TKt,...f?[f]:[]],o),m=p.exitCode===0?"PASS":"FAIL",g=[p.stdout.trim(),p.stderr.trim()?`[stderr]
1220
+ `)}let g=t.tools.find(C=>C.name===c),b=g&&Wtt(g,e),S=rAr(t,e,i),w=/\b(model|provider)\b/.test(c)?f(["provider"]):/\b(version|update)\b/.test(c)?f(["version"]):/\b(network|internet|sandbox|docker|podman|container|offline)\b/.test(c)?f(["sandbox"]):/\b(policy|refused|blocked|denied|locked|admin)\b/.test(c)?f(["policy","tools"]):"";return b?p(`${b.name}(${b.params.join(", ")}): ${b.purpose} ${b.detail??""}`.trim(),`Registered: ${Object.entries(b.hosts).map(([C,D])=>`${C==="ide"?"IDE":"CLI"} ${D}`).join("; ")}`,f(["tools"])):S?p(w,S):p(w,`Nothing in the reference matches "${i}". Topics: ${Uvr.join(", ")}. Features: ${t.features.map(C=>C.id).join(", ")}.`)}}}function bKt(t){let e=t.loadReference??zvr,i=t.maxChars??9e3;return{name:_4e,description:"Facts about Bandit and Stealth and this session: tools, sandbox, settings, policy, features, version, troubleshooting. Check it before saying something is impossible.",parameters:[{name:"topic",description:"A topic, 'session', or words to look up ('vim', 'dev server'). Omit for an overview.",required:!1}],async execute(s){let o;try{o=await e()}catch(m){return{output:`The self-knowledge reference could not be loaded: ${m instanceof Error?m.message:String(m)}`,isError:!0}}let c=null,f=null;if(t.liveFacts)try{c=await t.liveFacts()}catch(m){f=m instanceof Error?m.message:String(m)}let p=await iAr(o,t.host,String(s?.topic??""),c,f);return{output:qvr(p,i),isError:!1}}}}var _4e,Uvr,gKt,Gtt,A$,Kvr,Yvr,Jtt,vKt=Gn(()=>{"use strict";_4e="stealth_about",Uvr=["tools","sandbox","settings","policy","features","version","troubleshooting","session"],gKt=null;n(zvr,"loadBundledReference");Gtt={ide:"the Stealth IDE",cli:"the Stealth CLI"},A$=n((t,e)=>t.length>e?`${t.slice(0,e-1)}\u2026`:t,"clip");n(qvr,"cap");n(Wtt,"toolFor");n(yKt,"toolLine");n(Qvr,"renderLive");n(Hvr,"renderTools");n(Gvr,"renderSandbox");n(Jvr,"renderSettings");n(Wvr,"renderPolicy");n(Vvr,"renderFeatures");n(Zvr,"renderTroubleshooting");Kvr=new Set("a about am an and any are at be been but by can cannot cant could did do does doing for from get got has have how i if in into is it its let me my need no not of on or please our should so tell that the their them then there this to too us use using want was we were what when where which who why will with would you your".split(" ")),Yvr={internet:["network","offline"],online:["network"],offline:["network"],web:["network","web"],shortcut:["keybinding","chord"],shortcuts:["keybinding","chord"],keybinding:["shortcut"],hotkey:["keybinding"],dark:["theme"],llm:["model"],devserver:["server"],docker:["sandbox","runtime"],container:["sandbox"],refused:["policy","denied"],blocked:["policy","denied"],install:["install","installs"]};n(Xvr,"words");n(eAr,"entries");Jtt=n((t,e)=>new RegExp(`(^|[^a-z0-9])${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(s|es)?([^a-z0-9]|$)`).test(t),"hasWord");n(tAr,"weights");n(nAr,"score");n(rAr,"lookUp");n(iAr,"describeStealth");n(bKt,"createStealthAboutTool")});function aAr(t){return[t.rootEntries,t.testsEntries,t.testEntries].some(e=>!!e&&e.some(i=>/^test_.*\.py$|_test\.py$/.test(i)))}function wKt(t){if(t.packageJson!==null)try{let s=JSON.parse(t.packageJson),o={...s.dependencies??{},...s.devDependencies??{}},c=o.vitest?"vitest":o.jest?"jest":o.mocha?"mocha":null;if(c&&t.installedRunners.includes(c))return{kind:"node",program:c,label:c};let f=s.scripts?.test;if(f&&!/no test specified/.test(f))return{kind:"node",program:"npm",label:`the package.json test script (\`${f}\`)`}}catch{}let e=t.rootEntries??[],i=sAr.some(s=>e.includes(s));return aAr(t)||i&&e.includes("tests")?{kind:"python",program:"python3",label:"the Python tests (test_*.py)"}:e.includes("go.mod")?{kind:"go",program:"go",label:"`go test ./...`"}:e.includes("Cargo.toml")?{kind:"cargo",program:"cargo",label:"`cargo test`"}:e.some(s=>/\.(sln|csproj)$/.test(s))?{kind:"dotnet",program:"dotnet",label:"`dotnet test`"}:null}function Ztt(t){return/\b(vitest|jest|mocha|pytest|go\s+test|cargo\s+test|dotnet\s+test|(npm|pnpm|yarn|bun)\s+(run\s+)?test|node\s+--test|python3?\s+-m\s+(pytest|unittest))\b/.test(t)}function Ktt(t){return t?!/\.(md|mdx|markdown|txt|rst|adoc)$/i.test(t)&&!/(^|\/)(LICENSE|CHANGELOG|README)[^/]*$/i.test(t):!0}var AKt,sAr,Vtt,Ytt=Gn(()=>{"use strict";oH();AKt=["vitest","jest","mocha"],sAr=["pytest.ini","pyproject.toml","setup.cfg","tox.ini"];n(aAr,"hasPythonTests");n(wKt,"projectTestsFromFacts");Vtt=new Set(["test_run","run_tests"]);n(Ztt,"isTestSuiteCommand");n(Ktt,"isCodePath")});function xKt(t){let e=t.map(i=>`\`${i}\``).join(", ");return`You changed files without a successful check afterward, and ${e} ${t.length===1?"is":"are"} not available here. Do not look for ${t.length===1?"it":"them"} or try to install ${t.length===1?"it":"them"}. If a check with the tools that are available can show the requested result, run it once; otherwise answer now and say the change is unverified because ${e} ${t.length===1?"is":"are"} unavailable.`}function CKt(t,e="test_run"){return`You checked with a command of your own, but this project has its own tests (${t.label}) and they have not run since your last code change. Run them once with ${e} (a file or name pattern is fine), then answer with what they showed. If they fail because of your change, fix it first.`}var oAr,cAr,SKt,Vme,kKt=Gn(()=>{"use strict";Ytt();oAr=new Set(["apply_edit","apply_patch","replace_range","write_file"]),cAr=new Set(["run_command","run_tests","test_run"]),SKt="You changed files without a successful check afterward. Verify the requested result with a focused assertion, not just a file read or import. A failed or unavailable check is not a pass. Do not repeat installation attempts for unavailable tooling; use a meaningful available check or state what remains unverified. Then answer concisely with what you actually checked.";n(xKt,"verifyNoteForMissing");n(CKt,"verifyNoteForSuite");Vme=class{static{n(this,"VerifyBeforeDone")}editedSinceCheck=!1;codeEditedSinceSuite=!1;suite;suiteTool;constructor(e={}){this.suite=e.projectTests??null,this.suiteTool=e.suiteTool??"test_run"}onToolResult(e,i,s){if(oAr.has(e)){let o=typeof s?.path=="string"?s.path:void 0;!i&&(e==="apply_patch"||Ktt(o))&&(this.editedSinceCheck=!0,this.codeEditedSinceSuite=!0);return}if(cAr.has(e)&&!i){this.editedSinceCheck=!1;let o=[s?.cmd,s?.args].filter(c=>typeof c=="string").join(" ");(Vtt.has(e)||e==="run_command"&&Ztt(o))&&(this.codeEditedSinceSuite=!1)}}note(e=[]){let i=this.suite&&!e.includes(this.suite.program)?this.suite:null,s=!!i&&this.codeEditedSinceSuite;if(this.editedSinceCheck){let o=s?` This project has its own tests (${i.label}) and they can run here: ${this.suiteTool} runs them.`:"";return(e.length>0?xKt(e):SKt)+o}if(s)return CKt(i,this.suiteTool)}}});function Xtt(t,e){if(t===0||!e)return null;if(t===127){let o=e.match(/(?:^|\n)[^\n:]*sh: (?:\d+: )?([\w.+-]+): (?:command )?not found/);if(o)return o[1];let c=e.match(/spawn ([\w.+-]+) ENOENT/);if(c)return c[1]}let i=e.match(/No module named ['"]?([\w.]+)['"]?\s*$/m);if(i&&/^[^\n]*python[\d.]*: No module named/m.test(e))return i[1];let s=e.match(/npx canceled due to missing packages[^[\n]*\[\s*["']?((?:@[\w.-]+\/)?[\w.-]+)/);return s?s[1]:null}function ent(t,e){return e?`[unavailable: \`${t}\` is not installed in this sandbox image.]`:`[unavailable: \`${t}\` is not installed in this sandbox image, and the sandbox has no network, so it cannot be installed. Do not look for it or try to install it; use a check that is available, or say the change is unverified.]`}var Zme,EKt=Gn(()=>{"use strict";n(Xtt,"missingProgram");n(ent,"missingProgramNote");Zme=class{static{n(this,"MissingToolTracker")}missing=new Set;pending=0;stepErrors=0;stepMissing=0;lastStep={errors:0,missing:0};onMissingProgram(e){this.missing.add(e),this.pending++}onToolResult(e){let i=this.pending>0;this.pending=0,e&&(this.stepErrors++,i&&this.stepMissing++)}onModelCall(){this.lastStep={errors:this.stepErrors,missing:this.stepMissing},this.stepErrors=0,this.stepMissing=0,this.pending=0}programs(){return[...this.missing]}lastStepFailedOnlyOnMissingPrograms(){return this.lastStep.errors>0&&this.lastStep.missing===this.lastStep.errors}}});async function uAr(t,e,i){let s=String(t.framework??t.runner??"").trim().toLowerCase();if(s)return s==="pytest"||s==="python"||s==="unittest";try{let o=JSON.parse(await e.readFile(`${i}/package.json`)),c={...o.dependencies??{},...o.devDependencies??{}};if(c.vitest||c.jest||c.mocha||o.scripts?.test)return!1}catch{}for(let o of["pytest.ini","pyproject.toml","setup.cfg","tox.ini"])try{return await e.readFile(`${i}/${o}`),!0}catch{}try{return(await e.listFiles("**/test_*.py",i)).length>0}catch{return!1}}function g4e(t){return{...t,async execute(e,i){let s=String(e.cwd??"").trim().replace(/^\.\/?/,"").replace(/\/+$/,""),o=s?s.startsWith("/")?s:`${i.workspaceRoot}/${s}`:i.workspaceRoot;if(!await uAr(e,i,o)||(await i.runCommand("python3",["-c",lAr],o)).exitCode!==3)return t.execute(e,i);let f=String(e.pattern??e.filter??"").trim(),p=await i.runCommand("python3",["-c",TKt,...f?[f]:[]],o),m=p.exitCode===0?"PASS":"FAIL",g=[p.stdout.trim(),p.stderr.trim()?`[stderr]
1221
1221
  ${p.stderr.trim()}`:""].filter(Boolean).join(`
1222
1222
  `).slice(-6e3);return{output:`${m} \xB7 pytest is not installed here, so the tests ran with Bandit's plain python3 runner (test_* functions, unittest cases, pytest.raises/approx/parametrize/tmp_path; other fixtures are listed as not run).
1223
1223
  ${g}
@@ -3121,7 +3121,7 @@ p{color:#94a6bc;margin:0;line-height:1.6}</style></head><body>
3121
3121
  `)),s}async function Y0e(t,e){let i=xgn(t);if(i===null)return process.stdout.write(W.dim("No graph run to resume. Start one with: ")+W.cyan("BANDIT_GRAPH=1 bandit graph demo")+W.dim(" or ")+W.cyan('bandit graph plan "\u2026" --run')+`
3122
3122
  `),null;if(!i.ok)return process.stdout.write(W.red(`Can't resume: ${i.error}
3123
3123
  `)),null;let{spec:s,checkpoint:o,nodePrompts:c}=i.file,f=s.nodes.filter(m=>!c[m.id]).map(m=>m.id);if(f.length>0)return process.stdout.write(W.red(`Can't resume: run file has no prompts for: ${f.join(", ")}
3124
- `)),null;let p=zPe(c,e);return vG({cwd:t,spec:s,executors:p,nodePrompts:c,resumeFrom:o})}var bG,eN,Vae=Gn(()=>{"use strict";bG=Va(R0(),1);Sy();eN=["read_file","list_files","ls","search_code","find_directory","glob","web_fetch","web_search","read_pdf","read_memory","list_artifacts","fetch_image"];n($Pe,"graphRunPath");n(Sgn,"saveRunFile");n(xgn,"loadRunFile");n(zPe,"executorsFromPrompts");n(vG,"runSpecLive");n(Y0e,"resumeSpecLive")});var LY=$t((pki,YQr)=>{YQr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.494",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",funding:"https://afsp.org/chapter/missouri",bugs:{url:"https://github.com/Burtson-Labs/bandit-stealth/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-stealth.git",directory:"apps/bandit-cli"},type:"module",bin:{bandit:"./dist/cli.js"},main:"dist/cli.js",files:["dist/cli.js","README.md","LICENSE","TERMS.md","THIRD_PARTY_NOTICES.txt"],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",brief:"node build.mjs && node dist/__eval__/brief.js",soak:"node build.mjs && node dist/__eval__/soak.js","soak:dry":"node build.mjs && node dist/__eval__/soak.js --dry-run","bench:agent":"node build.mjs && node dist/__bench__/agent-bench.js","bench:improve":"node build.mjs && node dist/__improve__/improve.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:{"markdown-it":"^14.3.3","pdf-parse":"^2.4.5"},devDependencies:{"@burtson-labs/agent-core":"^1.6.94","@burtson-labs/bandit-skills":"workspace:*","@burtson-labs/host-kit":"^0.4.72","@burtson-labs/stealth-core-runtime":"^1.4.85","@types/markdown-it":"^14.2.0","@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 jY from"child_process";import*as kw from"fs";import*as pT from"path";function eHr(t){return/\b(EACCES|EPERM)\b|permission denied/i.test(t)}function tHr(t){let e=process.env.HOME||"";return e&&t.startsWith(e)?`~${t.slice(e.length)}`:t}function nHr(){return new Promise(t=>{let e=jY.spawn("npm",["view",qPe,"version"],{shell:!1,stdio:["ignore","pipe","pipe"]}),i="";e.stdout?.on("data",o=>{i+=o.toString()});let s=setTimeout(()=>{e.kill("SIGTERM"),t(null)},8e3);e.on("close",o=>{clearTimeout(s),t(o===0?i.trim():null)}),e.on("error",()=>{clearTimeout(s),t(null)})})}function iHr(t){return(t??"").trim().split(/\s+/).filter(Boolean).some(e=>rHr.has(e.toLowerCase()))}function sHr(t,e){let i=[...t].map(f=>f.role).lastIndexOf("user");if(i===-1)return null;let s=t[i],o=typeof s.content=="string"?s.content:"",c=e&&e.trim()?e.trim():o;return c?{prompt:c,trimmedConversation:t.slice(0,i)}:null}function aHr(t,e){let i=n(g=>g.replace(/[^0-9.]/g,"").split(".").map(b=>parseInt(b,10)||0),"parse"),[s,o,c]=i(t),[f,p,m]=i(e);return s!==f?s<f?-1:1:o!==p?o<p?-1:1:c!==m?c<m?-1:1:0}function cHr(t){return $Y.find(e=>e.name===t)}function lHr(){let t=$Y.map(e=>` ${W.cyan("/"+e.name.padEnd(14))} ${W.dim(e.description)}`);return[W.bold("All slash commands:"),...t,"",W.dim("Tip: prefix any file with @ to pin it, or run /help permissions for the permission model.")].join(`
3124
+ `)),null;let p=zPe(c,e);return vG({cwd:t,spec:s,executors:p,nodePrompts:c,resumeFrom:o})}var bG,eN,Vae=Gn(()=>{"use strict";bG=Va(R0(),1);Sy();eN=["read_file","list_files","ls","search_code","find_directory","glob","web_fetch","web_search","read_pdf","read_memory","list_artifacts","fetch_image"];n($Pe,"graphRunPath");n(Sgn,"saveRunFile");n(xgn,"loadRunFile");n(zPe,"executorsFromPrompts");n(vG,"runSpecLive");n(Y0e,"resumeSpecLive")});var LY=$t((pki,YQr)=>{YQr.exports={name:"@burtson-labs/bandit-stealth-cli",version:"1.7.495",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",funding:"https://afsp.org/chapter/missouri",bugs:{url:"https://github.com/Burtson-Labs/bandit-stealth/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-stealth.git",directory:"apps/bandit-cli"},type:"module",bin:{bandit:"./dist/cli.js"},main:"dist/cli.js",files:["dist/cli.js","README.md","LICENSE","TERMS.md","THIRD_PARTY_NOTICES.txt"],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",brief:"node build.mjs && node dist/__eval__/brief.js",soak:"node build.mjs && node dist/__eval__/soak.js","soak:dry":"node build.mjs && node dist/__eval__/soak.js --dry-run","bench:agent":"node build.mjs && node dist/__bench__/agent-bench.js","bench:improve":"node build.mjs && node dist/__improve__/improve.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:{"markdown-it":"^14.3.3","pdf-parse":"^2.4.5"},devDependencies:{"@burtson-labs/agent-core":"^1.6.94","@burtson-labs/bandit-skills":"workspace:*","@burtson-labs/host-kit":"^0.4.72","@burtson-labs/stealth-core-runtime":"^1.4.85","@types/markdown-it":"^14.2.0","@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 jY from"child_process";import*as kw from"fs";import*as pT from"path";function eHr(t){return/\b(EACCES|EPERM)\b|permission denied/i.test(t)}function tHr(t){let e=process.env.HOME||"";return e&&t.startsWith(e)?`~${t.slice(e.length)}`:t}function nHr(){return new Promise(t=>{let e=jY.spawn("npm",["view",qPe,"version"],{shell:!1,stdio:["ignore","pipe","pipe"]}),i="";e.stdout?.on("data",o=>{i+=o.toString()});let s=setTimeout(()=>{e.kill("SIGTERM"),t(null)},8e3);e.on("close",o=>{clearTimeout(s),t(o===0?i.trim():null)}),e.on("error",()=>{clearTimeout(s),t(null)})})}function iHr(t){return(t??"").trim().split(/\s+/).filter(Boolean).some(e=>rHr.has(e.toLowerCase()))}function sHr(t,e){let i=[...t].map(f=>f.role).lastIndexOf("user");if(i===-1)return null;let s=t[i],o=typeof s.content=="string"?s.content:"",c=e&&e.trim()?e.trim():o;return c?{prompt:c,trimmedConversation:t.slice(0,i)}:null}function aHr(t,e){let i=n(g=>g.replace(/[^0-9.]/g,"").split(".").map(b=>parseInt(b,10)||0),"parse"),[s,o,c]=i(t),[f,p,m]=i(e);return s!==f?s<f?-1:1:o!==p?o<p?-1:1:c!==m?c<m?-1:1:0}function cHr(t){return $Y.find(e=>e.name===t)}function lHr(){let t=$Y.map(e=>` ${W.cyan("/"+e.name.padEnd(14))} ${W.dim(e.description)}`);return[W.bold("All slash commands:"),...t,"",W.dim("Tip: prefix any file with @ to pin it, or run /help permissions for the permission model.")].join(`
3125
3125
  `)}function uHr(){return[W.bold("Permission choices"),"",` ${W.accent("allow once")} ${W.dim("Run only this call.")}`,` ${W.accent("allow turn")} ${W.dim("Allow calls like this until the agent finishes the current turn.")}`,` ${W.dim(" ")}${W.dim("Best pick when the model is making a batch of similar edits.")}`,` ${W.accent("allow session")} ${W.dim("Allow them until you exit Bandit.")}`,` ${W.accent("always allow")} ${W.dim("Save the rule to .bandit/settings.json so it survives restarts.")}`,` ${W.accent("deny")} ${W.dim("Block the call. Bandit should not retry it.")}`,` ${W.accent("deny + note")} ${W.dim("Block it and tell Bandit what to do instead.")}`,"",W.dim(" The card shows the exact rule each choice stores, under the highlighted"),W.dim(" option. For shell commands the rule covers a command shape \u2014 approving"),W.dim(" `git status` grants `git status \u2026`, not every command."),"",W.bold("Permission modes")+W.dim(" \u2014 /auto to change"),` ${W.accent("ask")} ${W.dim("Every non-allowlisted call prompts. Default.")}`,` ${W.accent("auto")} ${W.dim("Routine work runs unprompted: reading, editing files in this")}`,` ${W.dim(" ")}${W.dim("project, running builds and tests. Other actions get a context review.")}`,` ${W.accent("dangerous")} ${W.dim("Nothing prompts. CI and sandboxes only; not settable from /auto.")}`,"",W.bold("How auto mode decides"),W.dim(" The selected model reviews the action, targets, effects and your request."),W.dim(" Requested cleanup can proceed; uncertainty or missing authorization asks."),W.dim(" External, system or irreversible effects need explicit authorization."),W.dim(" Explicit ask/deny rules and security guards still apply. A failed review asks."),"",W.dim(" /permissions review what ran unattended and which grants are active"),W.dim(" /doctor explain the current setup and next best actions")].join(`
3126
3126
  `)}function fHr(){let t=[W.bold("Bandit commands"),W.dim("Use /help all for the full list, /help permissions for approval choices."),""],e=new Set;for(let s of oHr){let o=s.names.map(c=>cHr(c)).filter(c=>!!c);if(o.length!==0){t.push(W.bold(s.title));for(let c of o)e.add(c.name),t.push(` ${W.cyan("/"+c.name.padEnd(14))} ${W.dim(c.description)}`);t.push("")}}let i=$Y.filter(s=>!e.has(s.name)&&s.name!=="quit");return i.length>0&&(t.push(W.dim(`Also available: ${i.map(s=>"/"+s.name).join(", ")}`)),t.push("")),t.push(W.dim("Fast path: /doctor \u2192 /connect or /init \u2192 ask for the change \u2192 /review \u2192 /test \u2192 /commit")),t.join(`
3127
3127
  `)}function dHr(t){let e=[],i=t.accomplishments,s=Math.max(1,Math.round((Date.now()-(t.firstSeenAt??Date.now()))/864e5)),o=t.ai?.storyline&&t.ai.storyline.length>0?t.ai.storyline:t.localStory;if(o.length>0){let g=Math.min(process.stdout.columns||80,100),b=Math.max(40,g-4);e.push(W.bold("Your story")+W.dim(` \xB7 ${t.ai?.storyline?.length?t.ai.modelLabel:"local synthesis"}`)),e.push("");for(let S of o){let w=S.replace(/\s+/g," ").trim().split(" "),C="";for(let D of w)C.length===0?C=D:C.length+1+D.length<=b?C+=" "+D:(e.push(" "+C),C=D);C&&e.push(" "+C),e.push("")}}if(e.push(W.bold("How you use Bandit")),e.push(""),e.push(` ${W.dim("sessions ")} ${W.accent(String(t.sessions.length))} ${W.dim("over "+s+" day"+(s===1?"":"s"))}`),e.push(` ${W.dim("prompts ")} ${W.accent(String(t.totalPrompts))} ${W.dim("~"+(t.totalApproxTokens>=1e3?(t.totalApproxTokens/1e3).toFixed(1)+"K":t.totalApproxTokens)+" tokens")}`),(t.streak.current>0||t.streak.longest>0)&&e.push(` ${W.dim("streak ")} ${W.accent(t.streak.current+" day"+(t.streak.current===1?"":"s"))} ${W.dim("(longest "+t.streak.longest+")")}`),t.peakDay&&e.push(` ${W.dim("peak day ")} ${W.accent(t.peakDay.date)} ${W.dim(t.peakDay.prompts+" prompts")}`),e.push(""),e.push(W.bold("What got done")),e.push(` ${W.dim("files touched ")} ${W.accent(String(i.filesTouched))} ${W.dim("("+i.filesWritten+" written, "+i.editsApplied+" edited)")}`),i.gitOperations>0&&e.push(` ${W.dim("git ops ")} ${W.accent(String(i.gitOperations))} ${W.dim("("+i.commitsMade+" commits)")}`),i.testsRun>0&&e.push(` ${W.dim("tests run ")} ${W.accent(String(i.testsRun))}`),i.subagentsSpawned>0&&e.push(` ${W.dim("subagents ")} ${W.accent(String(i.subagentsSpawned))}`),i.languages.length>0){let g=i.languages.slice(0,5).map(b=>`${b.label} ${W.dim("("+b.count+")")}`).join(W.dim(", "));e.push(` ${W.dim("languages ")} ${g}`)}if(t.work.themes.length>0){e.push(""),e.push(W.bold("Bigger arcs"));for(let g of t.work.themes.slice(0,4)){let b=[`${g.turns} turn${g.turns===1?"":"s"}`,g.filesTouched>0?`${g.filesTouched} files`:"",g.testsRun>0?`${g.testsRun} tests`:"",g.externalActions>0?`${g.externalActions} external`:"",g.subagentsSpawned>0?`${g.subagentsSpawned} subagents`:""].filter(Boolean).join(", ");e.push(` ${W.cyan(g.title)} ${W.dim(b?"\u2014 "+b:"")}`),g.outcomes.length>0&&e.push(W.dim(` ${g.outcomes[0]}`)),g.sampleTitles.length>0&&e.push(W.dim(` ${g.sampleTitles[0]}`))}}if(t.work.highlights.length>0){e.push(""),e.push(W.bold("Largest work highlights"));for(let g of t.work.highlights.slice(0,5))e.push(` ${W.cyan(g.date)} ${W.accent(g.area)} ${W.dim("\xB7 "+g.category)}`),e.push(W.dim(` ${g.title}`)),e.push(W.dim(` ${g.summary}`)),g.outcome&&e.push(W.dim(` ${g.outcome}`))}if(i.topFiles.length>0){e.push(""),e.push(W.bold("Most-touched files"));for(let g of i.topFiles.slice(0,5))e.push(` ${W.cyan(g.path)} ${W.dim("\xD7"+g.touches)}`)}let c=[...t.toolStats.entries()].map(([g,b])=>({name:g,calls:b.calls,errors:b.errors,rate:b.calls>0?b.errors/b.calls:0})).sort((g,b)=>b.calls-g.calls).slice(0,6);if(c.length>0){e.push(""),e.push(W.bold("Top tools"));for(let g of c){let b=Math.round(g.rate*100),S=g.calls>=5&&b>=25?" "+W.yellow("\u26A0 "+b+"% error rate"):"";e.push(` ${W.cyan(g.name.padEnd(16))} ${W.accent(String(g.calls).padStart(4))} ${W.dim("calls")}${S}`)}}let f=[...t.errorClusters.entries()].flatMap(([g,b])=>b.map(S=>({tool:g,error:S.error,count:S.count}))).sort((g,b)=>b.count-g.count);if(f.length>0){let g=f[0],b=g.error.replace(/\s+/g," ").slice(0,70);e.push(""),e.push(W.bold("Top friction")),e.push(` ${W.cyan(g.tool)} ${W.dim("\xD7"+g.count)} ${W.dim(b+(g.error.length>70?"\u2026":""))}`)}let p=t.sentiment;if(p.satisfied+p.happy+p.excited+p.frustrated+p.unsatisfied>0){let g=[];p.excited>0&&g.push(W.green("excited ")+W.bold(String(p.excited))),p.happy>0&&g.push(W.green("happy ")+W.bold(String(p.happy))),p.satisfied>0&&g.push(W.green("satisfied ")+W.bold(String(p.satisfied)));let b=[];if(p.unsatisfied>0&&b.push(W.yellow("unsatisfied ")+W.bold(String(p.unsatisfied))),p.frustrated>0&&b.push(W.red("frustrated ")+W.bold(String(p.frustrated))),e.push(""),e.push(W.bold("How you felt")),g.length>0&&e.push(` ${g.join(W.dim(" \xB7 "))}`),b.length>0&&e.push(` ${b.join(W.dim(" \xB7 "))}`),p.notable.length>0){e.push(W.dim(" Frustration moments:"));for(let S of p.notable.slice(0,3))e.push(W.dim(' "')+W.dim(S)+W.dim('"'))}}return e.push(""),e.push(W.dim(" Full report (HTML + AI summary): ")+W.cyan("/insights")),e.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burtson-labs/bandit-stealth-cli",
3
- "version": "1.7.494",
3
+ "version": "1.7.495",
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",