nex-code 0.4.10 → 0.4.11
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/nex-code.js +1 -1
- package/package.json +1 -1
package/dist/nex-code.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Mn=H((Lk,Um)=>{Um.exports={name:"nex-code",version:"0.4.
|
|
2
|
+
var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Mn=H((Lk,Um)=>{Um.exports={name:"nex-code",version:"0.4.11",description:"The open-source agentic coding CLI. Free with Ollama Cloud \u2014 switch to OpenAI, Anthropic or Gemini anytime. Alternative to Claude Code & Gemini CLI.",bin:{"nex-code":"./dist/nex-code.js"},files:["dist/","README.md","LICENSE"],engines:{node:">=18.0.0"},scripts:{start:"node dist/nex-code.js",build:"esbuild bin/nex-code.js --bundle --platform=node --target=node18 --outfile=dist/nex-code.js --minify --external:axios --external:dotenv --external:playwright",test:"jest --forceExit","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",format:"prettier --write .","install-hooks":"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-push, post-merge).'",prepublishOnly:"npm run build && npm test","merge-to-main":"bash scripts/merge-to-main.sh",release:"npm version patch && git push --follow-tags && npm publish"},keywords:["ai","cli","coding","agent","ollama","ollama-cloud","openai","anthropic","claude","gemini","llm","gpt","agentic","terminal","coding-assistant","claude-code-alternative","gemini-cli-alternative","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.7.0",dotenv:"^16.4.0"},devDependencies:{esbuild:"^0.27.3",jest:"^29.7.0",prettier:"^3.8.1"},jest:{coverageThreshold:{global:{lines:45,functions:30,branches:35},"./cli/sub-agent.js":{lines:70,functions:60,branches:55}}}}});var pn=H((Dk,Cc)=>{"use strict";var kc="\x1B[0m",vc="\x1B[1m",Pn="\x1B[2m";function q(t,e,n){return`\x1B[38;2;${t};${e};${n}m`}function Wm(){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(`
|
|
3
3
|
`),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),c=parseInt(s[3].slice(0,2),16);return .299*r+.587*i+.114*c<128}}catch{}return null}function Sc(){let t=require("os");return require("path").join(t.homedir(),".nex-code",".theme_cache.json")}function Bm(t){try{let n=require("fs").readFileSync(Sc(),"utf8"),o=JSON.parse(n);if(o&&typeof o[t]=="boolean")return o[t]}catch{}return null}function Hm(t,e){try{let n=require("fs"),o=require("path"),s=Sc(),r=o.dirname(s),i={};try{i=JSON.parse(n.readFileSync(s,"utf8"))}catch{}i[t]=e;let c=Object.keys(i);c.length>50&&c.slice(0,c.length-50).forEach(l=>delete i[l]),n.existsSync(r)||n.mkdirSync(r,{recursive:!0}),n.writeFileSync(s,JSON.stringify(i),"utf8")}catch{}}function Gm(){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(";"),c=parseInt(i[i.length-1],10);if(!isNaN(c))return c<8}let n=process.env.TERM_SESSION_ID||"default",o=Bm(n);if(o!==null)return o;let s=Wm(),r=s!==null?s:!0;return Hm(n,r),r}var Ec=Gm(),Tc={reset:kc,bold:vc,dim:Pn,primary:q(80,190,255),secondary:q(60,170,190),success:q(80,210,120),warning:q(245,175,50),error:q(230,80,80),muted:Pn,subtle:q(130,130,145),tool_read:q(80,190,255),tool_write:q(245,165,55),tool_exec:q(185,100,235),tool_search:q(70,185,190),tool_git:q(90,210,100),tool_web:q(100,215,250),tool_sysadmin:q(225,150,75),tool_default:q(100,205,115),syn_keyword:q(185,100,235),syn_string:q(90,210,120),syn_number:q(245,175,50),syn_comment:Pn,syn_key:q(80,190,255),diff_add:q(80,210,120),diff_rem:q(230,80,80),banner_logo:q(80,200,255),banner_name:q(80,200,255),banner_version:Pn,banner_model:Pn,banner_yolo:q(245,175,50),footer_sep:Pn,footer_model:q(80,175,235),footer_branch:q(80,210,100),footer_project:q(130,130,145),footer_divider:q(80,80,95),footer_mode:q(210,150,50),white:"\x1B[37m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",diff_add_bg:"\x1B[48;2;10;46;20m",diff_rem_bg:"\x1B[48;2;58;16;16m",brightCyan:"\x1B[96m",brightMagenta:"\x1B[95m",brightBlue:"\x1B[94m"},Rc={reset:kc,bold:vc,dim:q(110,110,120),primary:q(0,110,190),secondary:q(0,125,148),success:q(0,148,62),warning:q(168,92,0),error:q(188,32,32),muted:q(110,110,120),subtle:q(155,155,165),tool_read:q(0,110,190),tool_write:q(168,92,0),tool_exec:q(128,42,188),tool_search:q(0,122,148),tool_git:q(0,138,62),tool_web:q(0,112,178),tool_sysadmin:q(168,82,0),tool_default:q(0,138,62),syn_keyword:q(128,42,188),syn_string:q(0,138,62),syn_number:q(168,92,0),syn_comment:q(135,135,148),syn_key:q(0,110,190),diff_add:q(0,148,62),diff_rem:q(188,32,32),banner_logo:q(0,122,205),banner_name:q(0,122,205),banner_version:q(100,100,118),banner_model:q(100,100,118),banner_yolo:q(168,62,0),footer_sep:q(168,168,178),footer_model:q(0,102,175),footer_branch:q(0,138,62),footer_project:q(135,135,148),footer_divider:q(168,168,178),footer_mode:q(148,88,0),white:q(40,40,52),red:q(188,32,32),green:q(0,148,62),yellow:q(168,92,0),blue:q(0,110,190),magenta:q(128,42,188),cyan:q(0,125,148),gray:q(132,132,142),bgRed:"\x1B[41m",bgGreen:"\x1B[42m",diff_add_bg:"\x1B[48;2;215;245;220m",diff_rem_bg:"\x1B[48;2;255;215;215m",brightCyan:q(0,158,182),brightMagenta:q(158,52,208),brightBlue:q(0,112,208)},Km=Ec?Tc:Rc;Cc.exports={T:Km,isDark:Ec,DARK:Tc,LIGHT:Rc}});var Ln=H((jk,Oc)=>{var{T:K}=pn(),mo=5,In=(()=>{let t=[];for(let e=0;e<mo;e++)t.push(e);for(let e=mo-2;e>=1;e--)t.push(e);return t})(),Ac=["\u273D","\u2726","\u2727","\u2726"],zr=class{constructor(e="Thinking..."){this.text=e,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let e=In[this.frame%In.length],n="";for(let s=0;s<mo;s++)n+=s===e?`${K.cyan}\u25CF${K.reset}`:" ";let o="";if(this.startTime){let s=Math.floor((Date.now()-this.startTime)/1e3);if(s>=60){let r=Math.floor(s/60),i=s%60;o=` ${K.dim}${r}m ${String(i).padStart(2,"0")}s${K.reset}`}else s>=1&&(o=` ${K.dim}${s}s${K.reset}`)}process.stderr.write(`\x1B[2K\r${n} ${K.dim}${this.text}${K.reset}${o}`),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}},Xr=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=In[this.frame%In.length],n=`${K.cyan}\u25CF${K.reset}`,o=`${K.dim}\u25CB${K.reset}`,s=this._formatElapsed(),r=s?` ${K.dim}${s}${K.reset}`:"",i="";for(let c=0;c<this.labels.length;c++){let l,u;switch(this.statuses[c]){case"done":l=`${K.green}\u2713${K.reset}`,u=K.dim;break;case"error":l=`${K.red}\u2717${K.reset}`,u=K.dim;break;default:l=c===e?n:" ",u=""}let d=c===this.labels.length-1?r:"";i+=`\x1B[2K ${l} ${u}${this.labels[c]}${K.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 e="\x1B[?25l";for(let n=0;n<this.lineCount;n++)e+=`
|
|
5
5
|
`;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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nex-code",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "The open-source agentic coding CLI. Free with Ollama Cloud — switch to OpenAI, Anthropic or Gemini anytime. Alternative to Claude Code & Gemini CLI.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nex-code": "./dist/nex-code.js"
|