nex-code 0.3.4 → 0.3.5
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 +11 -11
- package/cli/sub-agent.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
11
|
-
<b>Agentic coding CLI —
|
|
11
|
+
<b>Agentic coding CLI — open-source and multi-provider.</b><br>
|
|
12
12
|
Use OpenAI, Anthropic, Google Gemini, Ollama Cloud, or local models. Your choice.
|
|
13
13
|
</p>
|
|
14
14
|
|
|
@@ -49,15 +49,15 @@ That's it. You'll see the banner, your project context, and the `>` prompt. Star
|
|
|
49
49
|
|
|
50
50
|
## Why nex-code?
|
|
51
51
|
|
|
52
|
-
| | nex-code |
|
|
53
|
-
|
|
54
|
-
| **Open-source** | MIT |
|
|
55
|
-
| **Multi-provider** | 5 providers, swap at runtime |
|
|
56
|
-
| **Free local models** | Ollama (no API key) |
|
|
57
|
-
| **Runtime dependencies** | 2 (axios, dotenv) | Heavy |
|
|
58
|
-
| **Test coverage** | 1783 tests, 90% coverage | — | — |
|
|
59
|
-
| **Tool tiers** | Auto-adapts tools per model | Fixed | Fixed |
|
|
60
|
-
| **No lock-in** | `/model openai:gpt-4o` ↔ `/model local:llama3` |
|
|
52
|
+
| | nex-code | aider | Cursor |
|
|
53
|
+
|---|---|---|---|
|
|
54
|
+
| **Open-source** | MIT | Apache 2.0 | Proprietary |
|
|
55
|
+
| **Multi-provider** | 5 providers, swap at runtime | Multi-provider | Multi-provider |
|
|
56
|
+
| **Free local models** | Ollama (no API key) | Ollama | — |
|
|
57
|
+
| **Runtime dependencies** | 2 (axios, dotenv) | Heavy | Electron |
|
|
58
|
+
| **Test coverage** | 1783 tests, 90% coverage | — | — |
|
|
59
|
+
| **Tool tiers** | Auto-adapts tools per model | Fixed | Fixed |
|
|
60
|
+
| **No lock-in** | `/model openai:gpt-4o` ↔ `/model local:llama3` | Config change | Config change |
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
@@ -313,7 +313,7 @@ Pressing Ctrl+C during a running request immediately cancels the active HTTP str
|
|
|
313
313
|
- 3x rapid Ctrl+C force-exits the process
|
|
314
314
|
|
|
315
315
|
### Diff Preview
|
|
316
|
-
Every file change is shown in
|
|
316
|
+
Every file change is shown in a diff-style format before being applied:
|
|
317
317
|
- **Header**: `⏺ Update(file)` or `⏺ Create(file)` with relative path
|
|
318
318
|
- **Summary**: `⎿ Added N lines, removed M lines`
|
|
319
319
|
- **Numbered lines**: right-justified line numbers with red `-` / green `+` markers
|
package/cli/sub-agent.js
CHANGED
|
@@ -48,6 +48,7 @@ function isRetryableError(err) {
|
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
<<<<<<< Updated upstream
|
|
51
52
|
async function callWithRetry(messages, tools, options) {
|
|
52
53
|
let lastError;
|
|
53
54
|
for (let attempt = 0; attempt <= MAX_CHAT_RETRIES; attempt++) {
|
|
@@ -55,6 +56,13 @@ async function callWithRetry(messages, tools, options) {
|
|
|
55
56
|
// Use callStream (stream:true) — more reliable than callChat (stream:false)
|
|
56
57
|
// with Ollama Cloud. Silently collect the full response via no-op onToken.
|
|
57
58
|
return await callStream(messages, tools, { ...options, onToken: () => {} });
|
|
59
|
+
=======
|
|
60
|
+
async function callChatWithRetry(messages, tools, options) {
|
|
61
|
+
let lastError;
|
|
62
|
+
for (let attempt = 0; attempt <= MAX_CHAT_RETRIES; attempt++) {
|
|
63
|
+
try {
|
|
64
|
+
return await callChat(messages, tools, options);
|
|
65
|
+
>>>>>>> Stashed changes
|
|
58
66
|
} catch (err) {
|
|
59
67
|
lastError = err;
|
|
60
68
|
if (attempt < MAX_CHAT_RETRIES && isRetryableError(err)) {
|
|
@@ -216,7 +224,11 @@ ERROR RECOVERY:
|
|
|
216
224
|
|
|
217
225
|
try {
|
|
218
226
|
for (let i = 0; i < maxIter; i++) {
|
|
227
|
+
<<<<<<< Updated upstream
|
|
219
228
|
const result = await callWithRetry(messages, availableTools, chatOptions);
|
|
229
|
+
=======
|
|
230
|
+
const result = await callChatWithRetry(messages, availableTools, chatOptions);
|
|
231
|
+
>>>>>>> Stashed changes
|
|
220
232
|
|
|
221
233
|
// Guard against null/undefined responses
|
|
222
234
|
if (!result || typeof result !== 'object') {
|
|
@@ -422,4 +434,8 @@ async function executeSpawnAgents(args) {
|
|
|
422
434
|
}
|
|
423
435
|
}
|
|
424
436
|
|
|
437
|
+
<<<<<<< Updated upstream
|
|
425
438
|
module.exports = { runSubAgent, executeSpawnAgents, clearAllLocks, classifyTask, pickModelForTier, resolveSubAgentModel, isRetryableError, callWithRetry };
|
|
439
|
+
=======
|
|
440
|
+
module.exports = { runSubAgent, executeSpawnAgents, clearAllLocks, classifyTask, pickModelForTier, resolveSubAgentModel, isRetryableError, callChatWithRetry };
|
|
441
|
+
>>>>>>> Stashed changes
|