nex-code 0.5.28 → 0.5.29

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.
@@ -120,7 +120,7 @@ Selection rationale: components/CommandCenter.tsx is an existing active editing
120
120
  Files: components/CommandCenter.tsx
121
121
  Implementation outline: read the planned implementation file, locate the Apply button if the first range misses it, then add one aria-label without changing behavior
122
122
  Verification plan: npm test && npm run build
123
- Browser/UI applicability: not required for this deterministic harness scenario`,tool_calls:[]}):o.lastStep<2?(o.lastStep=2,{content:"Reading the accepted implementation file.",tool_calls:[Se("read_file",{path:"components/CommandCenter.tsx",line_start:90,line_end:150},"i2")]}):o.lastStep<3?(o.lastStep=3,{content:"Checking labels inside the same planned file.",tool_calls:[Se("grep",{path:"components/CommandCenter.tsx",pattern:"Apply"},"i3")]}):o.lastStep<4?(o.lastStep=4,{content:"Trying the more specific Apply label in the same file.",tool_calls:[Se("grep",{path:"components/CommandCenter.tsx",pattern:"Apply changes"},"i4")]}):o.lastStep<5?(o.lastStep=5,{content:"Locating the Apply action class inside the same planned file.",tool_calls:[Se("grep",{path:"components/CommandCenter.tsx",pattern:"apply-action"},"i5")]}):o.lastStep<6?(o.lastStep=6,{content:"Reading the located Apply button range.",tool_calls:[Se("read_file",{path:"components/CommandCenter.tsx",line_start:200,line_end:230},"i6")]}):o.lastStep<7?(o.lastStep=7,{content:"Applying the scoped accessibility label.",tool_calls:[Se("edit_file",{path:"components/CommandCenter.tsx",old_text:'<button className="apply-action">Apply</button>',new_text:'<button className="apply-action" aria-label="Apply changes">Apply</button>'},"i7")]}):o.lastStep<8?(o.lastStep=8,{content:"Verifying, committing, pushing, and checking final status.",tool_calls:[Se("bash",{command:'npm test && npm run build && git status --short --branch && git add components/CommandCenter.tsx && git commit -m "fix: clarify command center apply label" && git push origin main && git status --short --branch'},"i8")]}):{content:"Located the Apply button with a same-file search after the initial range missed it, implemented the command center accessibility label, verified with npm test and npm run build, committed the scoped change, pushed main to origin, and confirmed the worktree is clean.",tool_calls:[]}}return{content:"No mock scenario matched this prompt. Set a Scenario A\u2013I prompt (or enable malformed mode) to run deterministic E2E flows.",tool_calls:[]}}var bc=class extends f${constructor(e={}){super({name:"mock",baseUrl:"mock://",models:{"mock-model":{id:"mock-model",name:"Mock Model",maxTokens:4096,contextWindow:8192}},defaultModel:"mock-model",...e})}isConfigured(){return process.env.NEX_MOCK_PROVIDER==="1"}async chat(e,n,o={}){return process.env.NEX_MOCK_NULL_RESPONSE==="1"?null:_p(e)}async stream(e,n,o={}){if(process.env.NEX_MOCK_NULL_RESPONSE==="1")return null;let s=typeof o.onToken=="function"?o.onToken:()=>{},r=_p(e),i=String(r.content||""),a=Math.min(i.length,Math.max(1,Math.floor(i.length/2)));return i&&(s(i.slice(0,a)),s(i.slice(a))),r}normalizeResponse(e){return e}};kp.exports={MockProvider:bc}});var _c=ee((vP,k$)=>{k$.exports={name:"nex-code",version:"0.5.28",description:"Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first \u2014 OpenAI, Anthropic, and Gemini when you need them.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","examples/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"node scripts/build.js",dev:"node scripts/build.js --dev",test:"jest --runInBand","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",format:"prettier --write .","scan:secrets":"node scripts/secret-scan.js --staged","install-hooks":"ln -sf ../../hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-commit, pre-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js","benchmark:reallife":"node scripts/benchmark-reallife.js","benchmark:report":"node scripts/benchmark-reallife-report.js","improve:reallife":"node scripts/improve-reallife.js","benchmark:gate":"node scripts/benchmark-gate.js",release:"bash scripts/release.sh"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","gemini","llm","gpt","agentic","terminal","coding-assistant","open-source","free","qwen3","devstral","kimi-k2","deepseek","local-llm","mcp","model-context-protocol","multi-provider"],repository:{type:"git",url:"https://github.com/hybridpicker/nex-code.git"},bugs:{url:"https://github.com/hybridpicker/nex-code/issues"},homepage:"https://github.com/hybridpicker/nex-code#readme",license:"MIT",dependencies:{axios:"^1.15.0",dotenv:"^16.4.0",pixelmatch:"^7.1.0",pngjs:"^7.0.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1",typescript:"^5.9.3"},overrides:{"brace-expansion":">=5.0.5",picomatch:">=4.0.4"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var qs=ee((EP,Rp)=>{var{T:Z}=kn(),$c=5,Oo=(()=>{let t=[];for(let e=0;e<$c;e++)t.push(e);for(let e=$c-2;e>=1;e--)t.push(e);return t})(),xp=["\u273D","\u2726","\u2727","\u2726"],Sp=["\xB7 ","\xB7\xB7 ","\xB7\xB7\xB7"," \xB7\xB7"];function vp(t=""){let e=String(t).toLowerCase();return e.includes("search")||e.includes("read")||e.includes("list")||e.includes("inspect")?{glyph:"\u25CC",color:Z.cyan,accent:"scan"}:e.includes("write")||e.includes("edit")||e.includes("patch")||e.includes("build")?{glyph:"\u2726",color:Z.yellow,accent:"shape"}:e.includes("test")||e.includes("diff")||e.includes("check")||e.includes("verify")?{glyph:"\u25A3",color:Z.green,accent:"verify"}:e.includes("wait")||e.includes("github")||e.includes("fetch")||e.includes("browser")?{glyph:"\u25CD",color:Z.blue,accent:"wait"}:{glyph:"\u25CF",color:Z.cyan,accent:"think"}}function Ep(t,e,n){let o="";for(let s=0;s<$c;s++)s===t?o+=`${n}${e}${Z.reset}`:s===t-1||s===t+1?o+=`${Z.dim}\xB7${Z.reset}`:o+=`${Z.dim}\xB7${Z.reset}`;return o}function Tp(t){return`${Z.dim}${Sp[t%Sp.length]}${Z.reset}`}var kc=class{constructor(e="Thinking..."){this.text=e,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let e=Oo[this.frame%Oo.length],n=vp(this.text),o=Ep(e,n.glyph,n.color),s=Tp(this.frame),r="";if(this.startTime){let i=Math.floor((Date.now()-this.startTime)/1e3);if(i>=60){let a=Math.floor(i/60),l=i%60;r=` ${Z.dim}${a}m ${String(l).padStart(2,"0")}s${Z.reset}`}else i>=1&&(r=` ${Z.dim}${i}s${Z.reset}`)}process.stderr.write(`\x1B[2K\r${n.color}${n.accent.toUpperCase()}${Z.reset}${s} ${o} ${Z.dim}${this.text}${Z.reset}${r}`),this.frame++}start(){this._stopped=!1,this.startTime=Date.now(),process.stderr.isTTY&&(process.stderr.write("\x1B[?25l"),this._render(),this.interval=setInterval(()=>this._render(),100))}update(e){this.text=e}stop(){this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),process.stderr.isTTY&&process.stderr.write("\x1B[2K\r\x1B[?25h"),this.startTime=null}},xc=class{constructor(e){this.labels=e,this.statuses=e.map(()=>"running"),this.frame=0,this.interval=null,this.startTime=null,this.lineCount=e.length}_formatElapsed(){if(!this.startTime)return"";let e=Math.floor((Date.now()-this.startTime)/1e3);if(e<1)return"";let n=Math.floor(e/60),o=e%60;return n>0?`${n}m ${String(o).padStart(2,"0")}s`:`${o}s`}_render(){if(this._stopped)return;let e=Oo[this.frame%Oo.length],n=`${Z.cyan}\u25CC${Z.reset}`,o=this._formatElapsed(),s=o?` ${Z.dim}${o}${Z.reset}`:"",r=process.stderr.columns||80,i="";for(let a=0;a<this.labels.length;a++){let l,c;switch(this.statuses[a]){case"done":l=`${Z.green}\u2713${Z.reset}`,c=Z.dim;break;case"error":l=`${Z.red}\u2717${Z.reset}`,c=Z.dim;break;case"retry":l=`${Z.yellow}\u21BB${Z.reset}`,c=Z.yellow;break;default:l=a===e?n:`${Z.dim}\xB7${Z.reset}`,c=""}let u=a===this.labels.length-1?s:"",d=r-4-(u?o.length+1:0),f=this.labels[a].length>d?this.labels[a].substring(0,Math.max(10,d-3))+"...":this.labels[a];i+=`\x1B[2K ${l} ${c}${f}${Z.reset}${u}
123
+ Browser/UI applicability: not required for this deterministic harness scenario`,tool_calls:[]}):o.lastStep<2?(o.lastStep=2,{content:"Reading the accepted implementation file.",tool_calls:[Se("read_file",{path:"components/CommandCenter.tsx",line_start:90,line_end:150},"i2")]}):o.lastStep<3?(o.lastStep=3,{content:"Checking labels inside the same planned file.",tool_calls:[Se("grep",{path:"components/CommandCenter.tsx",pattern:"Apply"},"i3")]}):o.lastStep<4?(o.lastStep=4,{content:"Trying the more specific Apply label in the same file.",tool_calls:[Se("grep",{path:"components/CommandCenter.tsx",pattern:"Apply changes"},"i4")]}):o.lastStep<5?(o.lastStep=5,{content:"Locating the Apply action class inside the same planned file.",tool_calls:[Se("grep",{path:"components/CommandCenter.tsx",pattern:"apply-action"},"i5")]}):o.lastStep<6?(o.lastStep=6,{content:"Reading the located Apply button range.",tool_calls:[Se("read_file",{path:"components/CommandCenter.tsx",line_start:200,line_end:230},"i6")]}):o.lastStep<7?(o.lastStep=7,{content:"Applying the scoped accessibility label.",tool_calls:[Se("edit_file",{path:"components/CommandCenter.tsx",old_text:'<button className="apply-action">Apply</button>',new_text:'<button className="apply-action" aria-label="Apply changes">Apply</button>'},"i7")]}):o.lastStep<8?(o.lastStep=8,{content:"Verifying, committing, pushing, and checking final status.",tool_calls:[Se("bash",{command:'npm test && npm run build && git status --short --branch && git add components/CommandCenter.tsx && git commit -m "fix: clarify command center apply label" && git push origin main && git status --short --branch'},"i8")]}):{content:"Located the Apply button with a same-file search after the initial range missed it, implemented the command center accessibility label, verified with npm test and npm run build, committed the scoped change, pushed main to origin, and confirmed the worktree is clean.",tool_calls:[]}}return{content:"No mock scenario matched this prompt. Set a Scenario A\u2013I prompt (or enable malformed mode) to run deterministic E2E flows.",tool_calls:[]}}var bc=class extends f${constructor(e={}){super({name:"mock",baseUrl:"mock://",models:{"mock-model":{id:"mock-model",name:"Mock Model",maxTokens:4096,contextWindow:8192}},defaultModel:"mock-model",...e})}isConfigured(){return process.env.NEX_MOCK_PROVIDER==="1"}async chat(e,n,o={}){return process.env.NEX_MOCK_NULL_RESPONSE==="1"?null:_p(e)}async stream(e,n,o={}){if(process.env.NEX_MOCK_NULL_RESPONSE==="1")return null;let s=typeof o.onToken=="function"?o.onToken:()=>{},r=_p(e),i=String(r.content||""),a=Math.min(i.length,Math.max(1,Math.floor(i.length/2)));return i&&(s(i.slice(0,a)),s(i.slice(a))),r}normalizeResponse(e){return e}};kp.exports={MockProvider:bc}});var _c=ee((vP,k$)=>{k$.exports={name:"nex-code",version:"0.5.29",description:"Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first \u2014 OpenAI, Anthropic, and Gemini when you need them.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","examples/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"node scripts/build.js",dev:"node scripts/build.js --dev",test:"jest --runInBand","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",format:"prettier --write .","scan:secrets":"node scripts/secret-scan.js --staged","install-hooks":"ln -sf ../../hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-commit, pre-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js","benchmark:reallife":"node scripts/benchmark-reallife.js","benchmark:report":"node scripts/benchmark-reallife-report.js","improve:reallife":"node scripts/improve-reallife.js","benchmark:gate":"node scripts/benchmark-gate.js",release:"bash scripts/release.sh"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","gemini","llm","gpt","agentic","terminal","coding-assistant","open-source","free","qwen3","devstral","kimi-k2","deepseek","local-llm","mcp","model-context-protocol","multi-provider"],repository:{type:"git",url:"https://github.com/hybridpicker/nex-code.git"},bugs:{url:"https://github.com/hybridpicker/nex-code/issues"},homepage:"https://github.com/hybridpicker/nex-code#readme",license:"MIT",dependencies:{axios:"^1.15.0",dotenv:"^16.4.0",pixelmatch:"^7.1.0",pngjs:"^7.0.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1",typescript:"^5.9.3"},overrides:{"brace-expansion":">=5.0.5",picomatch:">=4.0.4"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var qs=ee((EP,Rp)=>{var{T:Z}=kn(),$c=5,Oo=(()=>{let t=[];for(let e=0;e<$c;e++)t.push(e);for(let e=$c-2;e>=1;e--)t.push(e);return t})(),xp=["\u273D","\u2726","\u2727","\u2726"],Sp=["\xB7 ","\xB7\xB7 ","\xB7\xB7\xB7"," \xB7\xB7"];function vp(t=""){let e=String(t).toLowerCase();return e.includes("search")||e.includes("read")||e.includes("list")||e.includes("inspect")?{glyph:"\u25CC",color:Z.cyan,accent:"scan"}:e.includes("write")||e.includes("edit")||e.includes("patch")||e.includes("build")?{glyph:"\u2726",color:Z.yellow,accent:"shape"}:e.includes("test")||e.includes("diff")||e.includes("check")||e.includes("verify")?{glyph:"\u25A3",color:Z.green,accent:"verify"}:e.includes("wait")||e.includes("github")||e.includes("fetch")||e.includes("browser")?{glyph:"\u25CD",color:Z.blue,accent:"wait"}:{glyph:"\u25CF",color:Z.cyan,accent:"think"}}function Ep(t,e,n){let o="";for(let s=0;s<$c;s++)s===t?o+=`${n}${e}${Z.reset}`:s===t-1||s===t+1?o+=`${Z.dim}\xB7${Z.reset}`:o+=`${Z.dim}\xB7${Z.reset}`;return o}function Tp(t){return`${Z.dim}${Sp[t%Sp.length]}${Z.reset}`}var kc=class{constructor(e="Thinking..."){this.text=e,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let e=Oo[this.frame%Oo.length],n=vp(this.text),o=Ep(e,n.glyph,n.color),s=Tp(this.frame),r="";if(this.startTime){let i=Math.floor((Date.now()-this.startTime)/1e3);if(i>=60){let a=Math.floor(i/60),l=i%60;r=` ${Z.dim}${a}m ${String(l).padStart(2,"0")}s${Z.reset}`}else i>=1&&(r=` ${Z.dim}${i}s${Z.reset}`)}process.stderr.write(`\x1B[2K\r${n.color}${n.accent.toUpperCase()}${Z.reset}${s} ${o} ${Z.dim}${this.text}${Z.reset}${r}`),this.frame++}start(){this._stopped=!1,this.startTime=Date.now(),process.stderr.isTTY&&(process.stderr.write("\x1B[?25l"),this._render(),this.interval=setInterval(()=>this._render(),100))}update(e){this.text=e}stop(){this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),process.stderr.isTTY&&process.stderr.write("\x1B[2K\r\x1B[?25h"),this.startTime=null}},xc=class{constructor(e){this.labels=e,this.statuses=e.map(()=>"running"),this.frame=0,this.interval=null,this.startTime=null,this.lineCount=e.length}_formatElapsed(){if(!this.startTime)return"";let e=Math.floor((Date.now()-this.startTime)/1e3);if(e<1)return"";let n=Math.floor(e/60),o=e%60;return n>0?`${n}m ${String(o).padStart(2,"0")}s`:`${o}s`}_render(){if(this._stopped)return;let e=Oo[this.frame%Oo.length],n=`${Z.cyan}\u25CC${Z.reset}`,o=this._formatElapsed(),s=o?` ${Z.dim}${o}${Z.reset}`:"",r=process.stderr.columns||80,i="";for(let a=0;a<this.labels.length;a++){let l,c;switch(this.statuses[a]){case"done":l=`${Z.green}\u2713${Z.reset}`,c=Z.dim;break;case"error":l=`${Z.red}\u2717${Z.reset}`,c=Z.dim;break;case"retry":l=`${Z.yellow}\u21BB${Z.reset}`,c=Z.yellow;break;default:l=a===e?n:`${Z.dim}\xB7${Z.reset}`,c=""}let u=a===this.labels.length-1?s:"",d=r-4-(u?o.length+1:0),f=this.labels[a].length>d?this.labels[a].substring(0,Math.max(10,d-3))+"...":this.labels[a];i+=`\x1B[2K ${l} ${c}${f}${Z.reset}${u}
124
124
  `}this.lineCount>0&&(i+=`\x1B[${this.lineCount}A`),process.stderr.write(i),this.frame++}start(){this._stopped=!1,this.startTime=Date.now();let e="\x1B[?25l";for(let n=0;n<this.lineCount;n++)e+=`
125
125
  `;this.lineCount>0&&(e+=`\x1B[${this.lineCount}A`),process.stderr.write(e),this._render(),this.interval=setInterval(()=>this._render(),100)}update(e,n){e>=0&&e<this.statuses.length&&(this.statuses[e]=n)}stop(e={}){if(this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),!e.silent)this._renderFinal();else{let n="";for(let o=0;o<this.lineCount;o++)n+=`\x1B[2K
126
126
  `;this.lineCount>0&&(n+=`\x1B[${this.lineCount}A`),process.stderr.write(n)}process.stderr.write("\x1B[?25h")}_renderFinal(){let e=this._formatElapsed(),n=e?` ${Z.dim}${e}${Z.reset}`:"",o=process.stderr.columns||80,s="";for(let r=0;r<this.labels.length;r++){let i;switch(this.statuses[r]){case"done":i=`${Z.green}\u2713${Z.reset}`;break;case"error":i=`${Z.red}\u2717${Z.reset}`;break;case"retry":i=`${Z.yellow}\u21BB${Z.reset}`;break;default:i=`${Z.yellow}\u25CB${Z.reset}`}let a=r===this.labels.length-1?n:"",l=o-4-(a?e.length+1:0),c=this.labels[r].length>l?this.labels[r].substring(0,Math.max(10,l-3))+"...":this.labels[r];s+=`\x1B[2K ${i} ${Z.dim}${c}${Z.reset}${a}
package/dist/benchmark.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";var mc=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var G_=Object.getOwnPropertyNames;var Y_=Object.prototype.hasOwnProperty;var z_=(t,e)=>()=>(t&&(e=t(t=0)),e);var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),K_=(t,e)=>{for(var n in e)mc(t,n,{get:e[n],enumerable:!0})},V_=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of G_(e))!Y_.call(t,s)&&s!==n&&mc(t,s,{get:()=>e[s],enumerable:!(o=H_(e,s))||o.enumerable});return t};var X_=t=>V_(mc({},"__esModule",{value:!0}),t);var xn=te((rM,ip)=>{"use strict";var ep="\x1B[0m",tp="\x1B[1m",Oo="\x1B[2m";function J(t,e,n){return`\x1B[38;2;${t};${e};${n}m`}function J_(){if(!process.stdout.isTTY)return null;try{let{execFileSync:t}=require("child_process"),e=["import sys,os,tty,termios,select","f=open('/dev/tty','r+b',buffering=0)","fd=f.fileno()","s=termios.tcgetattr(fd)","try:"," tty.setraw(fd)"," f.write(bytes([0x1b,0x5d,0x31,0x31,0x3b,0x3f,0x1b,0x5c]))"," r=select.select([fd],[],[],0.1)[0]"," d=b''"," if r:"," while True:"," r2=select.select([fd],[],[],0.05)[0]"," if not r2:break"," c=os.read(fd,1)"," d+=c"," if d[-1:]==bytes([0x07]) or d[-2:]==bytes([0x1b,0x5c]):break"," sys.stdout.buffer.write(d)","finally:"," termios.tcsetattr(fd,termios.TCSADRAIN,s)"," f.close()"].join(`
2
- `),s=t("python3",["-c",e],{encoding:"buffer",timeout:400,stdio:["ignore","pipe","ignore"]}).toString("utf8").match(/rgb:([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)/);if(s){let r=parseInt(s[1].slice(0,2),16),i=parseInt(s[2].slice(0,2),16),a=parseInt(s[3].slice(0,2),16);return .299*r+.587*i+.114*a<128}}catch{}return null}function np(){let t=require("os");return require("path").join(t.homedir(),".nex-code",".theme_cache.json")}function Z_(t){try{let n=require("fs").readFileSync(np(),"utf8"),o=JSON.parse(n);if(o&&typeof o[t]=="boolean")return o[t]}catch(e){console.error("readThemeCache failed:",e.message)}return null}function Q_(t,e){try{let n=require("fs"),o=require("path"),s=np(),r=o.dirname(s),i={};try{i=JSON.parse(n.readFileSync(s,"utf8"))}catch(l){console.error("theme cache failed:",l.message)}i[t]=e;let a=Object.keys(i);a.length>50&&a.slice(0,a.length-50).forEach(l=>delete i[l]),n.existsSync(r)||n.mkdirSync(r,{recursive:!0}),n.writeFileSync(s,JSON.stringify(i),"utf8")}catch{}}function e$(){let t=(process.env.NEX_THEME||"").toLowerCase();if(t==="light")return!1;if(t==="dark")return!0;let e=process.env.COLORFGBG;if(e){let i=e.split(";"),a=parseInt(i[i.length-1],10);if(!isNaN(a))return a<8}let n=process.env.TERM_SESSION_ID||"default",o=Z_(n);if(o!==null)return o;let s=J_(),r=s!==null?s:!0;return Q_(n,r),r}var sp=e$(),op={reset:ep,bold:tp,dim:Oo,primary:J(80,190,255),secondary:J(60,170,190),success:J(80,210,120),warning:J(245,175,50),error:J(230,80,80),muted:Oo,subtle:J(130,130,145),tool_read:J(80,190,255),tool_write:J(245,165,55),tool_exec:J(185,100,235),tool_search:J(70,185,190),tool_git:J(90,210,100),tool_web:J(100,215,250),tool_sysadmin:J(225,150,75),tool_default:J(100,205,115),syn_keyword:J(185,100,235),syn_string:J(90,210,120),syn_number:J(245,175,50),syn_comment:Oo,syn_key:J(80,190,255),diff_add:J(80,210,120),diff_rem:J(230,80,80),banner_logo:J(80,200,255),banner_name:J(80,200,255),banner_version:Oo,banner_model:Oo,banner_yolo:J(245,175,50),banner_gemini:J(138,180,248),footer_sep:Oo,footer_model:J(80,175,235),footer_branch:J(80,210,100),footer_project:J(130,130,145),footer_divider:J(80,80,95),footer_mode:J(210,150,50),white:J(210,210,220),red:J(220,85,85),green:J(80,200,110),yellow:J(230,185,60),blue:J(70,140,230),magenta:J(200,120,190),cyan:J(90,200,215),gray:J(120,120,135),bgRed:"\x1B[48;2;140;40;40m",bgGreen:"\x1B[48;2;30;100;50m",diff_add_bg:"\x1B[48;2;10;46;20m",diff_rem_bg:"\x1B[48;2;58;16;16m",brightCyan:J(110,215,230),brightMagenta:J(220,140,210),brightBlue:J(100,160,240)},rp={reset:ep,bold:tp,dim:J(110,110,120),primary:J(0,110,190),secondary:J(0,125,148),success:J(0,148,62),warning:J(168,92,0),error:J(188,32,32),muted:J(110,110,120),subtle:J(155,155,165),tool_read:J(0,110,190),tool_write:J(168,92,0),tool_exec:J(128,42,188),tool_search:J(0,122,148),tool_git:J(0,138,62),tool_web:J(0,112,178),tool_sysadmin:J(168,82,0),tool_default:J(0,138,62),syn_keyword:J(128,42,188),syn_string:J(0,138,62),syn_number:J(168,92,0),syn_comment:J(135,135,148),syn_key:J(0,110,190),diff_add:J(0,148,62),diff_rem:J(188,32,32),banner_logo:J(0,122,205),banner_name:J(0,122,205),banner_version:J(100,100,118),banner_model:J(100,100,118),banner_yolo:J(168,62,0),banner_gemini:J(26,115,232),footer_sep:J(168,168,178),footer_model:J(0,102,175),footer_branch:J(0,138,62),footer_project:J(135,135,148),footer_divider:J(168,168,178),footer_mode:J(148,88,0),white:J(40,40,52),red:J(188,32,32),green:J(0,148,62),yellow:J(168,92,0),blue:J(0,110,190),magenta:J(128,42,188),cyan:J(0,125,148),gray:J(132,132,142),bgRed:"\x1B[48;2;180;50;50m",bgGreen:"\x1B[48;2;30;130;60m",diff_add_bg:"\x1B[48;2;215;245;220m",diff_rem_bg:"\x1B[48;2;255;215;215m",brightCyan:J(0,158,182),brightMagenta:J(158,52,208),brightBlue:J(0,112,208)},t$=sp?op:rp;ip.exports={T:t$,isDark:sp,DARK:op,LIGHT:rp}});var Zi=te((iM,n$)=>{n$.exports={name:"nex-code",version:"0.5.28",description:"Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first \u2014 OpenAI, Anthropic, and Gemini when you need them.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","examples/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"node scripts/build.js",dev:"node scripts/build.js --dev",test:"jest --runInBand","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",format:"prettier --write .","scan:secrets":"node scripts/secret-scan.js --staged","install-hooks":"ln -sf ../../hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-commit, pre-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js","benchmark:reallife":"node scripts/benchmark-reallife.js","benchmark:report":"node scripts/benchmark-reallife-report.js","improve:reallife":"node scripts/improve-reallife.js","benchmark:gate":"node scripts/benchmark-gate.js",release:"bash scripts/release.sh"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","gemini","llm","gpt","agentic","terminal","coding-assistant","open-source","free","qwen3","devstral","kimi-k2","deepseek","local-llm","mcp","model-context-protocol","multi-provider"],repository:{type:"git",url:"https://github.com/hybridpicker/nex-code.git"},bugs:{url:"https://github.com/hybridpicker/nex-code/issues"},homepage:"https://github.com/hybridpicker/nex-code#readme",license:"MIT",dependencies:{axios:"^1.15.0",dotenv:"^16.4.0",pixelmatch:"^7.1.0",pngjs:"^7.0.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1",typescript:"^5.9.3"},overrides:{"brace-expansion":">=5.0.5",picomatch:">=4.0.4"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var js=te((aM,fp)=>{var{T:Q}=xn(),gc=5,Po=(()=>{let t=[];for(let e=0;e<gc;e++)t.push(e);for(let e=gc-2;e>=1;e--)t.push(e);return t})(),ap=["\u273D","\u2726","\u2727","\u2726"],lp=["\xB7 ","\xB7\xB7 ","\xB7\xB7\xB7"," \xB7\xB7"];function cp(t=""){let e=String(t).toLowerCase();return e.includes("search")||e.includes("read")||e.includes("list")||e.includes("inspect")?{glyph:"\u25CC",color:Q.cyan,accent:"scan"}:e.includes("write")||e.includes("edit")||e.includes("patch")||e.includes("build")?{glyph:"\u2726",color:Q.yellow,accent:"shape"}:e.includes("test")||e.includes("diff")||e.includes("check")||e.includes("verify")?{glyph:"\u25A3",color:Q.green,accent:"verify"}:e.includes("wait")||e.includes("github")||e.includes("fetch")||e.includes("browser")?{glyph:"\u25CD",color:Q.blue,accent:"wait"}:{glyph:"\u25CF",color:Q.cyan,accent:"think"}}function up(t,e,n){let o="";for(let s=0;s<gc;s++)s===t?o+=`${n}${e}${Q.reset}`:s===t-1||s===t+1?o+=`${Q.dim}\xB7${Q.reset}`:o+=`${Q.dim}\xB7${Q.reset}`;return o}function dp(t){return`${Q.dim}${lp[t%lp.length]}${Q.reset}`}var yc=class{constructor(e="Thinking..."){this.text=e,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let e=Po[this.frame%Po.length],n=cp(this.text),o=up(e,n.glyph,n.color),s=dp(this.frame),r="";if(this.startTime){let i=Math.floor((Date.now()-this.startTime)/1e3);if(i>=60){let a=Math.floor(i/60),l=i%60;r=` ${Q.dim}${a}m ${String(l).padStart(2,"0")}s${Q.reset}`}else i>=1&&(r=` ${Q.dim}${i}s${Q.reset}`)}process.stderr.write(`\x1B[2K\r${n.color}${n.accent.toUpperCase()}${Q.reset}${s} ${o} ${Q.dim}${this.text}${Q.reset}${r}`),this.frame++}start(){this._stopped=!1,this.startTime=Date.now(),process.stderr.isTTY&&(process.stderr.write("\x1B[?25l"),this._render(),this.interval=setInterval(()=>this._render(),100))}update(e){this.text=e}stop(){this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),process.stderr.isTTY&&process.stderr.write("\x1B[2K\r\x1B[?25h"),this.startTime=null}},bc=class{constructor(e){this.labels=e,this.statuses=e.map(()=>"running"),this.frame=0,this.interval=null,this.startTime=null,this.lineCount=e.length}_formatElapsed(){if(!this.startTime)return"";let e=Math.floor((Date.now()-this.startTime)/1e3);if(e<1)return"";let n=Math.floor(e/60),o=e%60;return n>0?`${n}m ${String(o).padStart(2,"0")}s`:`${o}s`}_render(){if(this._stopped)return;let e=Po[this.frame%Po.length],n=`${Q.cyan}\u25CC${Q.reset}`,o=this._formatElapsed(),s=o?` ${Q.dim}${o}${Q.reset}`:"",r=process.stderr.columns||80,i="";for(let a=0;a<this.labels.length;a++){let l,c;switch(this.statuses[a]){case"done":l=`${Q.green}\u2713${Q.reset}`,c=Q.dim;break;case"error":l=`${Q.red}\u2717${Q.reset}`,c=Q.dim;break;case"retry":l=`${Q.yellow}\u21BB${Q.reset}`,c=Q.yellow;break;default:l=a===e?n:`${Q.dim}\xB7${Q.reset}`,c=""}let u=a===this.labels.length-1?s:"",d=r-4-(u?o.length+1:0),f=this.labels[a].length>d?this.labels[a].substring(0,Math.max(10,d-3))+"...":this.labels[a];i+=`\x1B[2K ${l} ${c}${f}${Q.reset}${u}
2
+ `),s=t("python3",["-c",e],{encoding:"buffer",timeout:400,stdio:["ignore","pipe","ignore"]}).toString("utf8").match(/rgb:([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)/);if(s){let r=parseInt(s[1].slice(0,2),16),i=parseInt(s[2].slice(0,2),16),a=parseInt(s[3].slice(0,2),16);return .299*r+.587*i+.114*a<128}}catch{}return null}function np(){let t=require("os");return require("path").join(t.homedir(),".nex-code",".theme_cache.json")}function Z_(t){try{let n=require("fs").readFileSync(np(),"utf8"),o=JSON.parse(n);if(o&&typeof o[t]=="boolean")return o[t]}catch(e){console.error("readThemeCache failed:",e.message)}return null}function Q_(t,e){try{let n=require("fs"),o=require("path"),s=np(),r=o.dirname(s),i={};try{i=JSON.parse(n.readFileSync(s,"utf8"))}catch(l){console.error("theme cache failed:",l.message)}i[t]=e;let a=Object.keys(i);a.length>50&&a.slice(0,a.length-50).forEach(l=>delete i[l]),n.existsSync(r)||n.mkdirSync(r,{recursive:!0}),n.writeFileSync(s,JSON.stringify(i),"utf8")}catch{}}function e$(){let t=(process.env.NEX_THEME||"").toLowerCase();if(t==="light")return!1;if(t==="dark")return!0;let e=process.env.COLORFGBG;if(e){let i=e.split(";"),a=parseInt(i[i.length-1],10);if(!isNaN(a))return a<8}let n=process.env.TERM_SESSION_ID||"default",o=Z_(n);if(o!==null)return o;let s=J_(),r=s!==null?s:!0;return Q_(n,r),r}var sp=e$(),op={reset:ep,bold:tp,dim:Oo,primary:J(80,190,255),secondary:J(60,170,190),success:J(80,210,120),warning:J(245,175,50),error:J(230,80,80),muted:Oo,subtle:J(130,130,145),tool_read:J(80,190,255),tool_write:J(245,165,55),tool_exec:J(185,100,235),tool_search:J(70,185,190),tool_git:J(90,210,100),tool_web:J(100,215,250),tool_sysadmin:J(225,150,75),tool_default:J(100,205,115),syn_keyword:J(185,100,235),syn_string:J(90,210,120),syn_number:J(245,175,50),syn_comment:Oo,syn_key:J(80,190,255),diff_add:J(80,210,120),diff_rem:J(230,80,80),banner_logo:J(80,200,255),banner_name:J(80,200,255),banner_version:Oo,banner_model:Oo,banner_yolo:J(245,175,50),banner_gemini:J(138,180,248),footer_sep:Oo,footer_model:J(80,175,235),footer_branch:J(80,210,100),footer_project:J(130,130,145),footer_divider:J(80,80,95),footer_mode:J(210,150,50),white:J(210,210,220),red:J(220,85,85),green:J(80,200,110),yellow:J(230,185,60),blue:J(70,140,230),magenta:J(200,120,190),cyan:J(90,200,215),gray:J(120,120,135),bgRed:"\x1B[48;2;140;40;40m",bgGreen:"\x1B[48;2;30;100;50m",diff_add_bg:"\x1B[48;2;10;46;20m",diff_rem_bg:"\x1B[48;2;58;16;16m",brightCyan:J(110,215,230),brightMagenta:J(220,140,210),brightBlue:J(100,160,240)},rp={reset:ep,bold:tp,dim:J(110,110,120),primary:J(0,110,190),secondary:J(0,125,148),success:J(0,148,62),warning:J(168,92,0),error:J(188,32,32),muted:J(110,110,120),subtle:J(155,155,165),tool_read:J(0,110,190),tool_write:J(168,92,0),tool_exec:J(128,42,188),tool_search:J(0,122,148),tool_git:J(0,138,62),tool_web:J(0,112,178),tool_sysadmin:J(168,82,0),tool_default:J(0,138,62),syn_keyword:J(128,42,188),syn_string:J(0,138,62),syn_number:J(168,92,0),syn_comment:J(135,135,148),syn_key:J(0,110,190),diff_add:J(0,148,62),diff_rem:J(188,32,32),banner_logo:J(0,122,205),banner_name:J(0,122,205),banner_version:J(100,100,118),banner_model:J(100,100,118),banner_yolo:J(168,62,0),banner_gemini:J(26,115,232),footer_sep:J(168,168,178),footer_model:J(0,102,175),footer_branch:J(0,138,62),footer_project:J(135,135,148),footer_divider:J(168,168,178),footer_mode:J(148,88,0),white:J(40,40,52),red:J(188,32,32),green:J(0,148,62),yellow:J(168,92,0),blue:J(0,110,190),magenta:J(128,42,188),cyan:J(0,125,148),gray:J(132,132,142),bgRed:"\x1B[48;2;180;50;50m",bgGreen:"\x1B[48;2;30;130;60m",diff_add_bg:"\x1B[48;2;215;245;220m",diff_rem_bg:"\x1B[48;2;255;215;215m",brightCyan:J(0,158,182),brightMagenta:J(158,52,208),brightBlue:J(0,112,208)},t$=sp?op:rp;ip.exports={T:t$,isDark:sp,DARK:op,LIGHT:rp}});var Zi=te((iM,n$)=>{n$.exports={name:"nex-code",version:"0.5.29",description:"Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first \u2014 OpenAI, Anthropic, and Gemini when you need them.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","examples/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"node scripts/build.js",dev:"node scripts/build.js --dev",test:"jest --runInBand","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",format:"prettier --write .","scan:secrets":"node scripts/secret-scan.js --staged","install-hooks":"ln -sf ../../hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-commit, pre-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js","benchmark:reallife":"node scripts/benchmark-reallife.js","benchmark:report":"node scripts/benchmark-reallife-report.js","improve:reallife":"node scripts/improve-reallife.js","benchmark:gate":"node scripts/benchmark-gate.js",release:"bash scripts/release.sh"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","gemini","llm","gpt","agentic","terminal","coding-assistant","open-source","free","qwen3","devstral","kimi-k2","deepseek","local-llm","mcp","model-context-protocol","multi-provider"],repository:{type:"git",url:"https://github.com/hybridpicker/nex-code.git"},bugs:{url:"https://github.com/hybridpicker/nex-code/issues"},homepage:"https://github.com/hybridpicker/nex-code#readme",license:"MIT",dependencies:{axios:"^1.15.0",dotenv:"^16.4.0",pixelmatch:"^7.1.0",pngjs:"^7.0.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1",typescript:"^5.9.3"},overrides:{"brace-expansion":">=5.0.5",picomatch:">=4.0.4"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var js=te((aM,fp)=>{var{T:Q}=xn(),gc=5,Po=(()=>{let t=[];for(let e=0;e<gc;e++)t.push(e);for(let e=gc-2;e>=1;e--)t.push(e);return t})(),ap=["\u273D","\u2726","\u2727","\u2726"],lp=["\xB7 ","\xB7\xB7 ","\xB7\xB7\xB7"," \xB7\xB7"];function cp(t=""){let e=String(t).toLowerCase();return e.includes("search")||e.includes("read")||e.includes("list")||e.includes("inspect")?{glyph:"\u25CC",color:Q.cyan,accent:"scan"}:e.includes("write")||e.includes("edit")||e.includes("patch")||e.includes("build")?{glyph:"\u2726",color:Q.yellow,accent:"shape"}:e.includes("test")||e.includes("diff")||e.includes("check")||e.includes("verify")?{glyph:"\u25A3",color:Q.green,accent:"verify"}:e.includes("wait")||e.includes("github")||e.includes("fetch")||e.includes("browser")?{glyph:"\u25CD",color:Q.blue,accent:"wait"}:{glyph:"\u25CF",color:Q.cyan,accent:"think"}}function up(t,e,n){let o="";for(let s=0;s<gc;s++)s===t?o+=`${n}${e}${Q.reset}`:s===t-1||s===t+1?o+=`${Q.dim}\xB7${Q.reset}`:o+=`${Q.dim}\xB7${Q.reset}`;return o}function dp(t){return`${Q.dim}${lp[t%lp.length]}${Q.reset}`}var yc=class{constructor(e="Thinking..."){this.text=e,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let e=Po[this.frame%Po.length],n=cp(this.text),o=up(e,n.glyph,n.color),s=dp(this.frame),r="";if(this.startTime){let i=Math.floor((Date.now()-this.startTime)/1e3);if(i>=60){let a=Math.floor(i/60),l=i%60;r=` ${Q.dim}${a}m ${String(l).padStart(2,"0")}s${Q.reset}`}else i>=1&&(r=` ${Q.dim}${i}s${Q.reset}`)}process.stderr.write(`\x1B[2K\r${n.color}${n.accent.toUpperCase()}${Q.reset}${s} ${o} ${Q.dim}${this.text}${Q.reset}${r}`),this.frame++}start(){this._stopped=!1,this.startTime=Date.now(),process.stderr.isTTY&&(process.stderr.write("\x1B[?25l"),this._render(),this.interval=setInterval(()=>this._render(),100))}update(e){this.text=e}stop(){this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),process.stderr.isTTY&&process.stderr.write("\x1B[2K\r\x1B[?25h"),this.startTime=null}},bc=class{constructor(e){this.labels=e,this.statuses=e.map(()=>"running"),this.frame=0,this.interval=null,this.startTime=null,this.lineCount=e.length}_formatElapsed(){if(!this.startTime)return"";let e=Math.floor((Date.now()-this.startTime)/1e3);if(e<1)return"";let n=Math.floor(e/60),o=e%60;return n>0?`${n}m ${String(o).padStart(2,"0")}s`:`${o}s`}_render(){if(this._stopped)return;let e=Po[this.frame%Po.length],n=`${Q.cyan}\u25CC${Q.reset}`,o=this._formatElapsed(),s=o?` ${Q.dim}${o}${Q.reset}`:"",r=process.stderr.columns||80,i="";for(let a=0;a<this.labels.length;a++){let l,c;switch(this.statuses[a]){case"done":l=`${Q.green}\u2713${Q.reset}`,c=Q.dim;break;case"error":l=`${Q.red}\u2717${Q.reset}`,c=Q.dim;break;case"retry":l=`${Q.yellow}\u21BB${Q.reset}`,c=Q.yellow;break;default:l=a===e?n:`${Q.dim}\xB7${Q.reset}`,c=""}let u=a===this.labels.length-1?s:"",d=r-4-(u?o.length+1:0),f=this.labels[a].length>d?this.labels[a].substring(0,Math.max(10,d-3))+"...":this.labels[a];i+=`\x1B[2K ${l} ${c}${f}${Q.reset}${u}
3
3
  `}this.lineCount>0&&(i+=`\x1B[${this.lineCount}A`),process.stderr.write(i),this.frame++}start(){this._stopped=!1,this.startTime=Date.now();let e="\x1B[?25l";for(let n=0;n<this.lineCount;n++)e+=`
4
4
  `;this.lineCount>0&&(e+=`\x1B[${this.lineCount}A`),process.stderr.write(e),this._render(),this.interval=setInterval(()=>this._render(),100)}update(e,n){e>=0&&e<this.statuses.length&&(this.statuses[e]=n)}stop(e={}){if(this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),!e.silent)this._renderFinal();else{let n="";for(let o=0;o<this.lineCount;o++)n+=`\x1B[2K
5
5
  `;this.lineCount>0&&(n+=`\x1B[${this.lineCount}A`),process.stderr.write(n)}process.stderr.write("\x1B[?25h")}_renderFinal(){let e=this._formatElapsed(),n=e?` ${Q.dim}${e}${Q.reset}`:"",o=process.stderr.columns||80,s="";for(let r=0;r<this.labels.length;r++){let i;switch(this.statuses[r]){case"done":i=`${Q.green}\u2713${Q.reset}`;break;case"error":i=`${Q.red}\u2717${Q.reset}`;break;case"retry":i=`${Q.yellow}\u21BB${Q.reset}`;break;default:i=`${Q.yellow}\u25CB${Q.reset}`}let a=r===this.labels.length-1?n:"",l=o-4-(a?e.length+1:0),c=this.labels[r].length>l?this.labels[r].substring(0,Math.max(10,l-3))+"...":this.labels[r];s+=`\x1B[2K ${i} ${Q.dim}${c}${Q.reset}${a}
package/dist/nex-code.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Qu=Object.defineProperty;var Lv=Object.getOwnPropertyDescriptor;var Iv=Object.getOwnPropertyNames;var jv=Object.prototype.hasOwnProperty;var Dv=(e,t)=>()=>(e&&(t=e(e=0)),t);var Q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qv=(e,t)=>{for(var n in t)Qu(e,n,{get:t[n],enumerable:!0})},Fv=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Iv(t))!jv.call(e,s)&&s!==n&&Qu(e,s,{get:()=>t[s],enumerable:!(o=Lv(t,s))||o.enumerable});return e};var Bv=e=>Fv(Qu({},"__esModule",{value:!0}),e);var Ar=Q((SD,Uv)=>{Uv.exports={name:"nex-code",version:"0.5.28",description:"Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first \u2014 OpenAI, Anthropic, and Gemini when you need them.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","examples/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"node scripts/build.js",dev:"node scripts/build.js --dev",test:"jest --runInBand","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",format:"prettier --write .","scan:secrets":"node scripts/secret-scan.js --staged","install-hooks":"ln -sf ../../hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-commit, pre-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js","benchmark:reallife":"node scripts/benchmark-reallife.js","benchmark:report":"node scripts/benchmark-reallife-report.js","improve:reallife":"node scripts/improve-reallife.js","benchmark:gate":"node scripts/benchmark-gate.js",release:"bash scripts/release.sh"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","gemini","llm","gpt","agentic","terminal","coding-assistant","open-source","free","qwen3","devstral","kimi-k2","deepseek","local-llm","mcp","model-context-protocol","multi-provider"],repository:{type:"git",url:"https://github.com/hybridpicker/nex-code.git"},bugs:{url:"https://github.com/hybridpicker/nex-code/issues"},homepage:"https://github.com/hybridpicker/nex-code#readme",license:"MIT",dependencies:{axios:"^1.15.0",dotenv:"^16.4.0",pixelmatch:"^7.1.0",pngjs:"^7.0.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1",typescript:"^5.9.3"},overrides:{"brace-expansion":">=5.0.5",picomatch:">=4.0.4"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var ln=Q((ED,km)=>{"use strict";var gm="\x1B[0m",ym="\x1B[1m",Or="\x1B[2m";function ie(e,t,n){return`\x1B[38;2;${e};${t};${n}m`}function Wv(){if(!process.stdout.isTTY)return null;try{let{execFileSync:e}=require("child_process"),t=["import sys,os,tty,termios,select","f=open('/dev/tty','r+b',buffering=0)","fd=f.fileno()","s=termios.tcgetattr(fd)","try:"," tty.setraw(fd)"," f.write(bytes([0x1b,0x5d,0x31,0x31,0x3b,0x3f,0x1b,0x5c]))"," r=select.select([fd],[],[],0.1)[0]"," d=b''"," if r:"," while True:"," r2=select.select([fd],[],[],0.05)[0]"," if not r2:break"," c=os.read(fd,1)"," d+=c"," if d[-1:]==bytes([0x07]) or d[-2:]==bytes([0x1b,0x5c]):break"," sys.stdout.buffer.write(d)","finally:"," termios.tcsetattr(fd,termios.TCSADRAIN,s)"," f.close()"].join(`
2
+ var Qu=Object.defineProperty;var Lv=Object.getOwnPropertyDescriptor;var Iv=Object.getOwnPropertyNames;var jv=Object.prototype.hasOwnProperty;var Dv=(e,t)=>()=>(e&&(t=e(e=0)),t);var Q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qv=(e,t)=>{for(var n in t)Qu(e,n,{get:t[n],enumerable:!0})},Fv=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Iv(t))!jv.call(e,s)&&s!==n&&Qu(e,s,{get:()=>t[s],enumerable:!(o=Lv(t,s))||o.enumerable});return e};var Bv=e=>Fv(Qu({},"__esModule",{value:!0}),e);var Ar=Q((SD,Uv)=>{Uv.exports={name:"nex-code",version:"0.5.29",description:"Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first \u2014 OpenAI, Anthropic, and Gemini when you need them.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","examples/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"node scripts/build.js",dev:"node scripts/build.js --dev",test:"jest --runInBand","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",format:"prettier --write .","scan:secrets":"node scripts/secret-scan.js --staged","install-hooks":"ln -sf ../../hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && ln -sf ../../hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && ln -sf ../../hooks/post-merge .git/hooks/post-merge && chmod +x .git/hooks/post-merge && echo 'Hooks installed (pre-commit, pre-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js","benchmark:reallife":"node scripts/benchmark-reallife.js","benchmark:report":"node scripts/benchmark-reallife-report.js","improve:reallife":"node scripts/improve-reallife.js","benchmark:gate":"node scripts/benchmark-gate.js",release:"bash scripts/release.sh"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","gemini","llm","gpt","agentic","terminal","coding-assistant","open-source","free","qwen3","devstral","kimi-k2","deepseek","local-llm","mcp","model-context-protocol","multi-provider"],repository:{type:"git",url:"https://github.com/hybridpicker/nex-code.git"},bugs:{url:"https://github.com/hybridpicker/nex-code/issues"},homepage:"https://github.com/hybridpicker/nex-code#readme",license:"MIT",dependencies:{axios:"^1.15.0",dotenv:"^16.4.0",pixelmatch:"^7.1.0",pngjs:"^7.0.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1",typescript:"^5.9.3"},overrides:{"brace-expansion":">=5.0.5",picomatch:">=4.0.4"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var ln=Q((ED,km)=>{"use strict";var gm="\x1B[0m",ym="\x1B[1m",Or="\x1B[2m";function ie(e,t,n){return`\x1B[38;2;${e};${t};${n}m`}function Wv(){if(!process.stdout.isTTY)return null;try{let{execFileSync:e}=require("child_process"),t=["import sys,os,tty,termios,select","f=open('/dev/tty','r+b',buffering=0)","fd=f.fileno()","s=termios.tcgetattr(fd)","try:"," tty.setraw(fd)"," f.write(bytes([0x1b,0x5d,0x31,0x31,0x3b,0x3f,0x1b,0x5c]))"," r=select.select([fd],[],[],0.1)[0]"," d=b''"," if r:"," while True:"," r2=select.select([fd],[],[],0.05)[0]"," if not r2:break"," c=os.read(fd,1)"," d+=c"," if d[-1:]==bytes([0x07]) or d[-2:]==bytes([0x1b,0x5c]):break"," sys.stdout.buffer.write(d)","finally:"," termios.tcsetattr(fd,termios.TCSADRAIN,s)"," f.close()"].join(`
3
3
  `),s=e("python3",["-c",t],{encoding:"buffer",timeout:400,stdio:["ignore","pipe","ignore"]}).toString("utf8").match(/rgb:([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)/);if(s){let r=parseInt(s[1].slice(0,2),16),i=parseInt(s[2].slice(0,2),16),a=parseInt(s[3].slice(0,2),16);return .299*r+.587*i+.114*a<128}}catch{}return null}function $m(){let e=require("os");return require("path").join(e.homedir(),".nex-code",".theme_cache.json")}function Hv(e){try{let n=require("fs").readFileSync($m(),"utf8"),o=JSON.parse(n);if(o&&typeof o[e]=="boolean")return o[e]}catch(t){console.error("readThemeCache failed:",t.message)}return null}function Gv(e,t){try{let n=require("fs"),o=require("path"),s=$m(),r=o.dirname(s),i={};try{i=JSON.parse(n.readFileSync(s,"utf8"))}catch(c){console.error("theme cache failed:",c.message)}i[e]=t;let a=Object.keys(i);a.length>50&&a.slice(0,a.length-50).forEach(c=>delete i[c]),n.existsSync(r)||n.mkdirSync(r,{recursive:!0}),n.writeFileSync(s,JSON.stringify(i),"utf8")}catch{}}function Yv(){let e=(process.env.NEX_THEME||"").toLowerCase();if(e==="light")return!1;if(e==="dark")return!0;let t=process.env.COLORFGBG;if(t){let i=t.split(";"),a=parseInt(i[i.length-1],10);if(!isNaN(a))return a<8}let n=process.env.TERM_SESSION_ID||"default",o=Hv(n);if(o!==null)return o;let s=Wv(),r=s!==null?s:!0;return Gv(n,r),r}var bm=Yv(),wm={reset:gm,bold:ym,dim:Or,primary:ie(80,190,255),secondary:ie(60,170,190),success:ie(80,210,120),warning:ie(245,175,50),error:ie(230,80,80),muted:Or,subtle:ie(130,130,145),tool_read:ie(80,190,255),tool_write:ie(245,165,55),tool_exec:ie(185,100,235),tool_search:ie(70,185,190),tool_git:ie(90,210,100),tool_web:ie(100,215,250),tool_sysadmin:ie(225,150,75),tool_default:ie(100,205,115),syn_keyword:ie(185,100,235),syn_string:ie(90,210,120),syn_number:ie(245,175,50),syn_comment:Or,syn_key:ie(80,190,255),diff_add:ie(80,210,120),diff_rem:ie(230,80,80),banner_logo:ie(80,200,255),banner_name:ie(80,200,255),banner_version:Or,banner_model:Or,banner_yolo:ie(245,175,50),banner_gemini:ie(138,180,248),footer_sep:Or,footer_model:ie(80,175,235),footer_branch:ie(80,210,100),footer_project:ie(130,130,145),footer_divider:ie(80,80,95),footer_mode:ie(210,150,50),white:ie(210,210,220),red:ie(220,85,85),green:ie(80,200,110),yellow:ie(230,185,60),blue:ie(70,140,230),magenta:ie(200,120,190),cyan:ie(90,200,215),gray:ie(120,120,135),bgRed:"\x1B[48;2;140;40;40m",bgGreen:"\x1B[48;2;30;100;50m",diff_add_bg:"\x1B[48;2;10;46;20m",diff_rem_bg:"\x1B[48;2;58;16;16m",brightCyan:ie(110,215,230),brightMagenta:ie(220,140,210),brightBlue:ie(100,160,240)},_m={reset:gm,bold:ym,dim:ie(110,110,120),primary:ie(0,110,190),secondary:ie(0,125,148),success:ie(0,148,62),warning:ie(168,92,0),error:ie(188,32,32),muted:ie(110,110,120),subtle:ie(155,155,165),tool_read:ie(0,110,190),tool_write:ie(168,92,0),tool_exec:ie(128,42,188),tool_search:ie(0,122,148),tool_git:ie(0,138,62),tool_web:ie(0,112,178),tool_sysadmin:ie(168,82,0),tool_default:ie(0,138,62),syn_keyword:ie(128,42,188),syn_string:ie(0,138,62),syn_number:ie(168,92,0),syn_comment:ie(135,135,148),syn_key:ie(0,110,190),diff_add:ie(0,148,62),diff_rem:ie(188,32,32),banner_logo:ie(0,122,205),banner_name:ie(0,122,205),banner_version:ie(100,100,118),banner_model:ie(100,100,118),banner_yolo:ie(168,62,0),banner_gemini:ie(26,115,232),footer_sep:ie(168,168,178),footer_model:ie(0,102,175),footer_branch:ie(0,138,62),footer_project:ie(135,135,148),footer_divider:ie(168,168,178),footer_mode:ie(148,88,0),white:ie(40,40,52),red:ie(188,32,32),green:ie(0,148,62),yellow:ie(168,92,0),blue:ie(0,110,190),magenta:ie(128,42,188),cyan:ie(0,125,148),gray:ie(132,132,142),bgRed:"\x1B[48;2;180;50;50m",bgGreen:"\x1B[48;2;30;130;60m",diff_add_bg:"\x1B[48;2;215;245;220m",diff_rem_bg:"\x1B[48;2;255;215;215m",brightCyan:ie(0,158,182),brightMagenta:ie(158,52,208),brightBlue:ie(0,112,208)},zv=bm?wm:_m;km.exports={T:zv,isDark:bm,DARK:wm,LIGHT:_m}});var jo=Q((TD,Rm)=>{var{T:ae}=ln(),ed=5,Mr=(()=>{let e=[];for(let t=0;t<ed;t++)e.push(t);for(let t=ed-2;t>=1;t--)e.push(t);return e})(),xm=["\u273D","\u2726","\u2727","\u2726"],vm=["\xB7 ","\xB7\xB7 ","\xB7\xB7\xB7"," \xB7\xB7"];function Sm(e=""){let t=String(e).toLowerCase();return t.includes("search")||t.includes("read")||t.includes("list")||t.includes("inspect")?{glyph:"\u25CC",color:ae.cyan,accent:"scan"}:t.includes("write")||t.includes("edit")||t.includes("patch")||t.includes("build")?{glyph:"\u2726",color:ae.yellow,accent:"shape"}:t.includes("test")||t.includes("diff")||t.includes("check")||t.includes("verify")?{glyph:"\u25A3",color:ae.green,accent:"verify"}:t.includes("wait")||t.includes("github")||t.includes("fetch")||t.includes("browser")?{glyph:"\u25CD",color:ae.blue,accent:"wait"}:{glyph:"\u25CF",color:ae.cyan,accent:"think"}}function Em(e,t,n){let o="";for(let s=0;s<ed;s++)s===e?o+=`${n}${t}${ae.reset}`:s===e-1||s===e+1?o+=`${ae.dim}\xB7${ae.reset}`:o+=`${ae.dim}\xB7${ae.reset}`;return o}function Tm(e){return`${ae.dim}${vm[e%vm.length]}${ae.reset}`}var td=class{constructor(t="Thinking..."){this.text=t,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let t=Mr[this.frame%Mr.length],n=Sm(this.text),o=Em(t,n.glyph,n.color),s=Tm(this.frame),r="";if(this.startTime){let i=Math.floor((Date.now()-this.startTime)/1e3);if(i>=60){let a=Math.floor(i/60),c=i%60;r=` ${ae.dim}${a}m ${String(c).padStart(2,"0")}s${ae.reset}`}else i>=1&&(r=` ${ae.dim}${i}s${ae.reset}`)}process.stderr.write(`\x1B[2K\r${n.color}${n.accent.toUpperCase()}${ae.reset}${s} ${o} ${ae.dim}${this.text}${ae.reset}${r}`),this.frame++}start(){this._stopped=!1,this.startTime=Date.now(),process.stderr.isTTY&&(process.stderr.write("\x1B[?25l"),this._render(),this.interval=setInterval(()=>this._render(),100))}update(t){this.text=t}stop(){this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),process.stderr.isTTY&&process.stderr.write("\x1B[2K\r\x1B[?25h"),this.startTime=null}},nd=class{constructor(t){this.labels=t,this.statuses=t.map(()=>"running"),this.frame=0,this.interval=null,this.startTime=null,this.lineCount=t.length}_formatElapsed(){if(!this.startTime)return"";let t=Math.floor((Date.now()-this.startTime)/1e3);if(t<1)return"";let n=Math.floor(t/60),o=t%60;return n>0?`${n}m ${String(o).padStart(2,"0")}s`:`${o}s`}_render(){if(this._stopped)return;let t=Mr[this.frame%Mr.length],n=`${ae.cyan}\u25CC${ae.reset}`,o=this._formatElapsed(),s=o?` ${ae.dim}${o}${ae.reset}`:"",r=process.stderr.columns||80,i="";for(let a=0;a<this.labels.length;a++){let c,u;switch(this.statuses[a]){case"done":c=`${ae.green}\u2713${ae.reset}`,u=ae.dim;break;case"error":c=`${ae.red}\u2717${ae.reset}`,u=ae.dim;break;case"retry":c=`${ae.yellow}\u21BB${ae.reset}`,u=ae.yellow;break;default:c=a===t?n:`${ae.dim}\xB7${ae.reset}`,u=""}let d=a===this.labels.length-1?s:"",f=r-4-(d?o.length+1:0),p=this.labels[a].length>f?this.labels[a].substring(0,Math.max(10,f-3))+"...":this.labels[a];i+=`\x1B[2K ${c} ${u}${p}${ae.reset}${d}
4
4
  `}this.lineCount>0&&(i+=`\x1B[${this.lineCount}A`),process.stderr.write(i),this.frame++}start(){this._stopped=!1,this.startTime=Date.now();let t="\x1B[?25l";for(let n=0;n<this.lineCount;n++)t+=`
5
5
  `;this.lineCount>0&&(t+=`\x1B[${this.lineCount}A`),process.stderr.write(t),this._render(),this.interval=setInterval(()=>this._render(),100)}update(t,n){t>=0&&t<this.statuses.length&&(this.statuses[t]=n)}stop(t={}){if(this._stopped=!0,this.interval&&(clearInterval(this.interval),this.interval=null),!t.silent)this._renderFinal();else{let n="";for(let o=0;o<this.lineCount;o++)n+=`\x1B[2K
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nex-code",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
4
4
  "description": "Run 400B+ open coding models on your codebase without the hardware bill. Ollama Cloud first — OpenAI, Anthropic, and Gemini when you need them.",
5
5
  "bin": {
6
6
  "nex-code": "./dist/nex-code.js"