nex-code 0.4.23 → 0.4.24
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/README.md +6 -4
- package/dist/nex-code.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -909,18 +909,20 @@ This enables non-linear conversations: try an approach, and if it doesn't work,
|
|
|
909
909
|
|
|
910
910
|
### Autoresearch
|
|
911
911
|
|
|
912
|
-
Autonomous optimization loops inspired by Karpathy's autoresearch
|
|
912
|
+
Autonomous optimization loops inspired by [Karpathy's autoresearch](https://github.com/karpathy/autoresearch). The agent creates a dedicated experiment branch, edits code, runs experiments, and automatically keeps improvements or reverts failures:
|
|
913
913
|
|
|
914
914
|
```
|
|
915
915
|
/autoresearch reduce test runtime while maintaining correctness
|
|
916
916
|
/autoresearch optimize bundle size under 500kb
|
|
917
917
|
```
|
|
918
918
|
|
|
919
|
-
The agent follows a repeating cycle: **checkpoint**
|
|
919
|
+
The agent follows a repeating cycle on a dedicated `autoresearch/<tag>` branch: **setup branch** -> **checkpoint** -> **edit** -> **run experiment** -> **log result** -> **keep or revert (git reset)**. Runs indefinitely until you interrupt. Experiments are logged to `.nex/autoresearch/experiments.json` with metrics, resource usage, and complexity tracking. Output can be redirected to log files with metric extraction via grep patterns to protect context.
|
|
920
920
|
|
|
921
921
|
```
|
|
922
|
-
/ar-
|
|
923
|
-
/ar-
|
|
922
|
+
/ar-self-improve # self-improvement loop using nex-code's benchmark as metric
|
|
923
|
+
/ar-self-improve sysadmin # focus on a specific weak category
|
|
924
|
+
/ar-status # show experiment history with trends
|
|
925
|
+
/ar-clear # reset experiment history
|
|
924
926
|
```
|
|
925
927
|
|
|
926
928
|
### Memory
|
package/dist/nex-code.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var As=Q((fT,S$)=>{S$.exports={name:"nex-code",version:"0.4.
|
|
2
|
+
var Q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var As=Q((fT,S$)=>{S$.exports={name:"nex-code",version:"0.4.24",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:"esbuild bin/nex-code.js --bundle --platform=node --target=node18 --outfile=dist/nex-code.js --minify --external:axios --external:dotenv --external:playwright",dev:"esbuild bin/nex-code.js --bundle --platform=node --target=node18 --outfile=dist/nex-code.js --external:axios --external:dotenv --external:playwright --watch",test:"jest --forceExit","test:orchestrator":"jest tests/orchestrator.test.js --forceExit",coverage:"jest --coverage --forceExit","test:watch":"jest --watch",typecheck:"tsc --noEmit",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",improve:"node scripts/improve.js","extract-examples":"node scripts/extract-examples.js","benchmark:realworld":"node scripts/benchmark-realworld.js",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",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 Yn=Q((pT,Au)=>{"use strict";var ku="\x1B[0m",Su="\x1B[1m",Os="\x1B[2m";function Z(t,e,n){return`\x1B[38;2;${t};${e};${n}m`}function E$(){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 Eu(){let t=require("os");return require("path").join(t.homedir(),".nex-code",".theme_cache.json")}function T$(t){try{let n=require("fs").readFileSync(Eu(),"utf8"),o=JSON.parse(n);if(o&&typeof o[t]=="boolean")return o[t]}catch{}return null}function R$(t,e){try{let n=require("fs"),o=require("path"),s=Eu(),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 C$(){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=T$(n);if(o!==null)return o;let s=E$(),r=s!==null?s:!0;return R$(n,r),r}var Tu=C$(),Ru={reset:ku,bold:Su,dim:Os,primary:Z(80,190,255),secondary:Z(60,170,190),success:Z(80,210,120),warning:Z(245,175,50),error:Z(230,80,80),muted:Os,subtle:Z(130,130,145),tool_read:Z(80,190,255),tool_write:Z(245,165,55),tool_exec:Z(185,100,235),tool_search:Z(70,185,190),tool_git:Z(90,210,100),tool_web:Z(100,215,250),tool_sysadmin:Z(225,150,75),tool_default:Z(100,205,115),syn_keyword:Z(185,100,235),syn_string:Z(90,210,120),syn_number:Z(245,175,50),syn_comment:Os,syn_key:Z(80,190,255),diff_add:Z(80,210,120),diff_rem:Z(230,80,80),banner_logo:Z(80,200,255),banner_name:Z(80,200,255),banner_version:Os,banner_model:Os,banner_yolo:Z(245,175,50),footer_sep:Os,footer_model:Z(80,175,235),footer_branch:Z(80,210,100),footer_project:Z(130,130,145),footer_divider:Z(80,80,95),footer_mode:Z(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"},Cu={reset:ku,bold:Su,dim:Z(110,110,120),primary:Z(0,110,190),secondary:Z(0,125,148),success:Z(0,148,62),warning:Z(168,92,0),error:Z(188,32,32),muted:Z(110,110,120),subtle:Z(155,155,165),tool_read:Z(0,110,190),tool_write:Z(168,92,0),tool_exec:Z(128,42,188),tool_search:Z(0,122,148),tool_git:Z(0,138,62),tool_web:Z(0,112,178),tool_sysadmin:Z(168,82,0),tool_default:Z(0,138,62),syn_keyword:Z(128,42,188),syn_string:Z(0,138,62),syn_number:Z(168,92,0),syn_comment:Z(135,135,148),syn_key:Z(0,110,190),diff_add:Z(0,148,62),diff_rem:Z(188,32,32),banner_logo:Z(0,122,205),banner_name:Z(0,122,205),banner_version:Z(100,100,118),banner_model:Z(100,100,118),banner_yolo:Z(168,62,0),footer_sep:Z(168,168,178),footer_model:Z(0,102,175),footer_branch:Z(0,138,62),footer_project:Z(135,135,148),footer_divider:Z(168,168,178),footer_mode:Z(148,88,0),white:Z(40,40,52),red:Z(188,32,32),green:Z(0,148,62),yellow:Z(168,92,0),blue:Z(0,110,190),magenta:Z(128,42,188),cyan:Z(0,125,148),gray:Z(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:Z(0,158,182),brightMagenta:Z(158,52,208),brightBlue:Z(0,112,208)},A$=Tu?Ru:Cu;Au.exports={T:A$,isDark:Tu,DARK:Ru,LIGHT:Cu}});var Ms=Q((mT,Nu)=>{var{T:ne}=Yn(),Mr=5,Ns=(()=>{let t=[];for(let e=0;e<Mr;e++)t.push(e);for(let e=Mr-2;e>=1;e--)t.push(e);return t})(),Ou=["\u273D","\u2726","\u2727","\u2726"],Ta=class{constructor(e="Thinking..."){this.text=e,this.frame=0,this.interval=null,this.startTime=null}_render(){if(this._stopped)return;let e=Ns[this.frame%Ns.length],n="";for(let s=0;s<Mr;s++)n+=s===e?`${ne.cyan}\u25CF${ne.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=` ${ne.dim}${r}m ${String(i).padStart(2,"0")}s${ne.reset}`}else s>=1&&(o=` ${ne.dim}${s}s${ne.reset}`)}process.stderr.write(`\x1B[2K\r${n} ${ne.dim}${this.text}${ne.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}},Ra=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=Ns[this.frame%Ns.length],n=`${ne.cyan}\u25CF${ne.reset}`,o=this._formatElapsed(),s=o?` ${ne.dim}${o}${ne.reset}`:"",r=process.stderr.columns||80,i="";for(let c=0;c<this.labels.length;c++){let l,u;switch(this.statuses[c]){case"done":l=`${ne.green}\u2713${ne.reset}`,u=ne.dim;break;case"error":l=`${ne.red}\u2717${ne.reset}`,u=ne.dim;break;case"retry":l=`${ne.yellow}\u21BB${ne.reset}`,u=ne.yellow;break;default:l=c===e?n:" ",u=""}let d=c===this.labels.length-1?s:"",f=r-4-(d?o.length+1:0),p=this.labels[c].length>f?this.labels[c].substring(0,Math.max(10,f-3))+"...":this.labels[c];i+=`\x1B[2K ${l} ${u}${p}${ne.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.24",
|
|
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"
|