@nanobpm/nano-coder 0.69.0 → 1.0.0
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 +124 -337
- package/lib/platform.js +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
# nano-coder
|
|
2
2
|
|
|
3
|
-
**A
|
|
3
|
+
**A 4MB coding agent. Run a fleet on your laptop.**
|
|
4
4
|
|
|
5
|
-
nano-coder is a coding agent for the terminal, written in Rust. It uses about
|
|
5
|
+
nano-coder is a coding agent for the terminal, written in D. Up to 0.69 it was written in Rust; 1.0 is the D rewrite, with the same commands, config (`~/.config/nano-coder/config.toml`, `NANO_CODER_*`), session logs and ACP protocol. It uses about 4MB of memory (peak footprint on macOS), where Node-based agent CLIs take 150–660MB, so you can run dense fleets of agent workers on one machine. It runs interactively, or headless over ACP as a worker for [nano-workforce](https://github.com/nanobpm/nano-workforce) via c8ctl-nano.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npm install -g @nanobpm/nano-coder # prebuilt binaries for macOS and Linux (x64, arm64)
|
|
11
11
|
brew install nanobpm/tap/nano-coder # the same binaries through Homebrew
|
|
12
|
-
cargo install nano-coder # 0.69, the last Rust release
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
The Linux binaries need glibc 2.35+ and the system libcurl (`libcurl4` on Debian/Ubuntu,
|
|
15
|
+
`libcurl` on Fedora); macOS ships libcurl. To build from source, see
|
|
16
|
+
[Building and Running](#building-and-running).
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
nano-coder --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`cargo install nano-coder` still installs the last Rust release (0.69), which is no longer updated.
|
|
17
23
|
|
|
18
24
|
## Features
|
|
19
25
|
|
|
@@ -22,7 +28,7 @@ From 1.0 nano-coder is written in D and published to npm and Homebrew only; crat
|
|
|
22
28
|
- **Providers**: OpenAI-compatible and Anthropic endpoints (remote or local), selected per model as `provider/model`, with retry/backoff
|
|
23
29
|
- **Tool Calling**: Agent can invoke registered tools during conversation, including a real `bash` tool with timeouts and bounded output
|
|
24
30
|
- **Sessions**: Append-only JSONL session logs with resume and input-ID deduplication
|
|
25
|
-
- **Lifecycle Hooks**:
|
|
31
|
+
- **Lifecycle Hooks**: an `AgentEvents` interface for observing agent behavior, plus
|
|
26
32
|
Claude Code–compatible external user hooks loaded from `.claude/settings.json`
|
|
27
33
|
- **Configuration**: TOML-based config file at `~/.config/nano-coder/config.toml`
|
|
28
34
|
- **Commands**: `/help`, `/version`, `/compact`, `/context`, `/verbosity`, `/settings`, `/tools`, `/skills`, `/queue`, `/restart`, `/update`, `/relaunch`, `/exit`
|
|
@@ -63,7 +69,7 @@ show in the same list (marked `steer`, with the id from the `↪ steer #N` note)
|
|
|
63
69
|
be withdrawn or rewritten before the agent's next step. A queued message is never injected while the agent is
|
|
64
70
|
asking for input (the `question` tool's picker owns the terminal until you answer).
|
|
65
71
|
Slash commands work mid-turn too, where it is safe:
|
|
66
|
-
- **Right away:** read-only ones (`/help`, `/
|
|
72
|
+
- **Right away:** read-only ones (`/help`, `/tools`, `/skills`, `/providers`, `/session`, `/plan`,
|
|
67
73
|
`/context`, `/trajectory` (`--json`/`--markdown`), and `/mode` or `/verbosity` without an
|
|
68
74
|
argument) show the current state. `/plan` shows the plan as the agent updates it.
|
|
69
75
|
- **From the agent's next step:** `/mode NAME` applies when the agent takes its next step.
|
|
@@ -80,13 +86,6 @@ Slash commands work mid-turn too, where it is safe:
|
|
|
80
86
|
the running turn, killing any running bash command; a second Ctrl-C at the prompt exits.
|
|
81
87
|
At the idle prompt, **Esc Esc** instead clears the input, so a half-typed or pasted prompt
|
|
82
88
|
can be discarded without deleting it character by character.
|
|
83
|
-
|
|
84
|
-
Tool calls, their results and thinking blocks are shown collapsed (`● bash ls -la`,
|
|
85
|
-
`⎿ first line (+N lines)`, `∴ Thought for 3.1s · 812 chars`). **Ctrl-O** expands the
|
|
86
|
-
latest one in place — the call's full arguments with every line of its result, or the
|
|
87
|
-
full reasoning text — and pressing it again collapses it. It works at the idle prompt
|
|
88
|
-
and mid-turn (where it expands the thinking block that is still streaming), and the
|
|
89
|
-
expanded view reflows on resize. Piped output is unchanged.
|
|
90
89
|
With piped (non-terminal) stdin, lines read during a turn are queued as later prompts
|
|
91
90
|
(never steer).
|
|
92
91
|
|
|
@@ -121,9 +120,7 @@ A steer that arrives too late to join the turn runs as an ordinary prompt, or is
|
|
|
121
120
|
answered with `stopReason: "cancelled"` if the turn was cancelled. Slash-command prompts
|
|
122
121
|
and other requests that arrive mid-turn are handled after the turn ends. Everything
|
|
123
122
|
handled after the turn, late steers included, runs in the order the client sent it.
|
|
124
|
-
`stopReason` is `end_turn`, `cancelled`, or `max_turn_requests`.
|
|
125
|
-
token counts, the result also carries ACP's `usage`: `{"inputTokens", "outputTokens", "totalTokens"}`,
|
|
126
|
-
summed over the turn's model calls.
|
|
123
|
+
`stopReason` is `end_turn`, `cancelled`, or `max_turn_requests`.
|
|
127
124
|
|
|
128
125
|
**Streaming updates.** During a turn the harness sends `session/update` notifications:
|
|
129
126
|
`agent_message_chunk` (with a `messageId`), `tool_call` (`toolCallId`, `title` = tool name,
|
|
@@ -169,71 +166,75 @@ explicitly (`input doesn't look like ACP JSON-RPC …`).
|
|
|
169
166
|
## Architecture
|
|
170
167
|
|
|
171
168
|
```
|
|
172
|
-
|
|
173
|
-
├──
|
|
174
|
-
|
|
175
|
-
├──
|
|
176
|
-
├──
|
|
177
|
-
├── claude_hooks.
|
|
178
|
-
├──
|
|
179
|
-
├──
|
|
180
|
-
├──
|
|
181
|
-
|
|
182
|
-
│ ├──
|
|
183
|
-
│ ├──
|
|
184
|
-
│ ├──
|
|
185
|
-
│ ├──
|
|
186
|
-
│
|
|
187
|
-
|
|
188
|
-
├──
|
|
189
|
-
├──
|
|
190
|
-
├──
|
|
191
|
-
├──
|
|
192
|
-
|
|
193
|
-
├──
|
|
194
|
-
├──
|
|
195
|
-
├──
|
|
196
|
-
├──
|
|
197
|
-
├──
|
|
198
|
-
├──
|
|
199
|
-
├──
|
|
200
|
-
├──
|
|
201
|
-
├──
|
|
202
|
-
├──
|
|
203
|
-
├──
|
|
204
|
-
├──
|
|
205
|
-
├──
|
|
206
|
-
├──
|
|
207
|
-
├──
|
|
208
|
-
├──
|
|
209
|
-
├──
|
|
210
|
-
├──
|
|
211
|
-
├──
|
|
212
|
-
├──
|
|
213
|
-
|
|
169
|
+
source/
|
|
170
|
+
├── app.d # Single binary entry point (interactive + ACP modes), REPL, key reader
|
|
171
|
+
└── nano/
|
|
172
|
+
├── agent.d # Agent core: conversation management, tool execution loop
|
|
173
|
+
├── acp.d # ACP JSON-RPC protocol handler
|
|
174
|
+
├── claude_hooks.d # External Claude Code–compatible user hooks engine
|
|
175
|
+
├── llm.d # Provider-neutral messages and the LLMClient interface
|
|
176
|
+
├── http.d # libcurl transport (streaming, timeouts)
|
|
177
|
+
├── retry.d # Retry classification and backoff
|
|
178
|
+
├── providers/ # Provider registry + presets
|
|
179
|
+
│ ├── openai.d # OpenAI Chat Completions (and compatible servers)
|
|
180
|
+
│ ├── responses.d # OpenAI Responses API
|
|
181
|
+
│ ├── anthropic.d # Anthropic Messages API
|
|
182
|
+
│ ├── muse.d # UNOFFICIAL Meta Muse Code provider
|
|
183
|
+
│ ├── mock.d # Offline scripted client
|
|
184
|
+
│ └── demo.d # Offline demo model (`--model demo/demo`)
|
|
185
|
+
├── copilot.d # UNOFFICIAL Copilot-subscription provider (login, tokens)
|
|
186
|
+
├── tools/ # Tool registry and the built-in tools
|
|
187
|
+
│ ├── bash.d # bash tool: timeout, file capture, bounded output
|
|
188
|
+
│ ├── files.d # read_file / write_file / edit_file
|
|
189
|
+
│ └── search.d # glob / grep
|
|
190
|
+
├── shell.d # Bash parser used by the permission checks
|
|
191
|
+
├── permissions.d, guard.d # Allow/deny rules and built-in guards against destructive commands
|
|
192
|
+
├── sandbox.d, landlock.d # Seatbelt (macOS) / Landlock (Linux) sandbox for shell commands
|
|
193
|
+
├── session.d # Versioned append-only JSONL session log
|
|
194
|
+
├── session_index.d # Session summaries (.index.jsonl) for the --resume picker
|
|
195
|
+
├── resume.d # --resume picker, --resume last, --list-sessions
|
|
196
|
+
├── context.d # Token accounting, context-window heuristics, overflow detection
|
|
197
|
+
├── status.d # Status bar contents (the frame's last row)
|
|
198
|
+
├── ui.d # Verbosity levels and the streaming output renderer
|
|
199
|
+
├── frame.d, frameui.d # App-owned frame renderer and its owner thread
|
|
200
|
+
├── markdown.d, md*.d # Markdown rendering of answers
|
|
201
|
+
├── lineedit.d # Key-by-key prompt input (editing, history, mid-turn steer/queue)
|
|
202
|
+
├── control.d # Turn control shared with the key reader: cancel, steers
|
|
203
|
+
├── instructions.d # AGENTS.md / CLAUDE.md discovery for the system prompt
|
|
204
|
+
├── plan.d # Task plan and the plan_add / plan_update / plan_show tools
|
|
205
|
+
├── queue.d # The interactive message queue and the /queue editor
|
|
206
|
+
├── goal.d # report_outcome tool (completed / blocked / needs_input)
|
|
207
|
+
├── memory.d # Cross-session memory: memory_save / memory_search / memory_forget
|
|
208
|
+
├── mode.d # Agent mode (normal / plan / auto) and the plan-mode tool gate
|
|
209
|
+
├── question.d # question tool and the mid-turn question / turn-cap rendezvous
|
|
210
|
+
├── commands.d # Slash-command table for /help and the as-you-type menu
|
|
211
|
+
├── skills.d # SKILL.md discovery, ai.lock sources and the load_skill tool
|
|
212
|
+
├── reminders.d # <system-reminder> notes appended to tool results
|
|
213
|
+
├── herdr.d # Herdr state / resume / release reports
|
|
214
|
+
├── settings.d, settings_dialog.d # /settings menu and config-file writer
|
|
215
|
+
├── config.d, toml.d, toml_edit.d # Configuration file loading and editing
|
|
216
|
+
└── safeio.d # The audited @trusted wrappers and thread-safe primitives
|
|
214
217
|
```
|
|
215
218
|
|
|
219
|
+
nano-coder was written in Rust up to 0.69; 1.0 is a rewrite in D. The Rust code is on the
|
|
220
|
+
`rust` branch. `PORTING.md` maps every Rust module to its D counterpart and lists the known
|
|
221
|
+
differences, `REVIEW.md` compares the safety and architecture of the two implementations, and
|
|
222
|
+
`parity/manifest.tsv` records how each Rust test was ported.
|
|
223
|
+
|
|
216
224
|
Mode selection: `--acp` flag enables ACP headless mode; default is interactive CLI.
|
|
217
225
|
|
|
218
226
|
## Lifecycle Hooks
|
|
219
227
|
|
|
220
228
|
nano-coder has two hook systems.
|
|
221
229
|
|
|
222
|
-
### Internal
|
|
223
|
-
|
|
224
|
-
The harness exposes 6 internal lifecycle hook events for in-process Rust
|
|
225
|
-
callbacks. These are **observe-only**: a callback can inspect the event payload
|
|
226
|
-
(for logging, metrics, debugging) but cannot block, modify, or redirect the
|
|
227
|
-
agent. They are registered programmatically against `agent.hooks()`.
|
|
230
|
+
### Internal events (observe-only)
|
|
228
231
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
| `before_tool_call` | Before executing a tool |
|
|
236
|
-
| `after_tool_call` | After tool execution completes |
|
|
232
|
+
The agent loop reports what it does through the `AgentEvents` interface
|
|
233
|
+
(`nano/agent.d`): streamed text and reasoning, each tool call's start and end, token
|
|
234
|
+
usage, steering messages and complete replies. The CLI and ACP front ends implement it
|
|
235
|
+
to render output; an implementation can also log or collect metrics. These are
|
|
236
|
+
**observe-only**: they cannot block, modify or redirect the agent. (The Rust version's
|
|
237
|
+
six named internal hook events are replaced by this interface.)
|
|
237
238
|
|
|
238
239
|
### External user hooks (Claude Code–compatible)
|
|
239
240
|
|
|
@@ -324,9 +325,9 @@ the [permission rules and sandbox](#permissions-and-sandbox) instead.
|
|
|
324
325
|
|
|
325
326
|
## Permissions and Sandbox
|
|
326
327
|
|
|
327
|
-
nano-coder never stops to ask for approval
|
|
328
|
-
instead, and a blocked call returns an error telling the model to
|
|
329
|
-
rather than work around the block.
|
|
328
|
+
nano-coder never stops to ask for approval (it runs headless in agent fleets). Every tool call
|
|
329
|
+
is checked before it runs instead, and a blocked call returns an error telling the model to
|
|
330
|
+
stop and ask the user rather than work around the block.
|
|
330
331
|
|
|
331
332
|
**Order of checks:** `deny` rules, then `allow` rules, then the built-in guards. Deny always
|
|
332
333
|
wins. An allow rule approves a shell command only when *every* command in it matches, so
|
|
@@ -350,23 +351,6 @@ wins. An allow rule approves a shell command only when *every* command in it mat
|
|
|
350
351
|
that cannot be parsed, or a script computed at run time (`bash -c "$CMD"`,
|
|
351
352
|
`eval "$(curl ...)"`), is blocked.
|
|
352
353
|
|
|
353
|
-
**Shell loops** (`for`/`select`/`while`/`until`) are checked by effect. A loop whose every
|
|
354
|
-
condition and body command is provably read-only (`echo`, `grep`, `cat`, `wc`, ...) runs
|
|
355
|
-
freely. A `for` loop over a *literal* word list (plain words, quoted strings, brace
|
|
356
|
-
expansions — no globs, substitutions or unknown variables) is unrolled: each value is
|
|
357
|
-
substituted for the loop variable and every resulting body command is checked exactly as if
|
|
358
|
-
written out by hand, so `for q in "a b" "c d"; do gh search repos "$q"; done` is allowed
|
|
359
|
-
wherever the two `gh` commands are, and an unrolled command that is denied or catastrophic
|
|
360
|
-
is denied. The unroll is capped (64 iterations) and refuses a body that rebinds the loop
|
|
361
|
-
variable or still expands something at run time after substitution; those fall through to
|
|
362
|
-
the next rule. A loop that still cannot be verified — a non-literal list, or a static body
|
|
363
|
-
command that is not a known read-only utility — **runs when the OS sandbox is on** (the
|
|
364
|
-
sandbox confines what it can write) and is **blocked** with the usual guidance when it is
|
|
365
|
-
off; nano-coder never prompts for it. The hard blocks always stand: a command name computed
|
|
366
|
-
at run time, `eval`/interpreters (`sh -c`, `python -c`, ...), path-qualified programs outside
|
|
367
|
-
`/bin`/`/usr/bin`, assignments to `PATH`/`IFS` and other dangerous names, arithmetic-assignment
|
|
368
|
-
tricks, and writes/redirections to computed targets.
|
|
369
|
-
|
|
370
354
|
**Built-in guards** (`builtin_rules = true`) block:
|
|
371
355
|
|
|
372
356
|
- recursive `rm` (and `mv`, `find -delete`, `chmod -R`/`chown -R`) on `/`, your home directory
|
|
@@ -416,12 +400,11 @@ can fix it. To send a message that starts with `/`, such as a path, type `//`:
|
|
|
416
400
|
|
|
417
401
|
Typing `/` at the prompt lists the commands under it, and each further character narrows the
|
|
418
402
|
list. Tab completes the command, or the part all matches share. Esc hides the list. The
|
|
419
|
-
list is built from the same table as `/help` (`
|
|
403
|
+
list is built from the same table as `/help` (`nano/commands.d`). Commands with a known
|
|
420
404
|
argument set (`/model`, `/mode`, `/verbosity`, `/thinking`) get the same treatment for their first
|
|
421
405
|
argument: a type-ahead list narrows as you type and Tab completes it.
|
|
422
406
|
|
|
423
407
|
- `/help` - Show available commands
|
|
424
|
-
- `/version` - Show the nano-coder version (the same string `nano-coder --version` prints)
|
|
425
408
|
- `/compact [--smart|--standard] [focus]` - Summarize older messages with the current model,
|
|
426
409
|
keeping the latest message. `--smart` / `--standard` override `compaction_mode` for this
|
|
427
410
|
compaction (see [Smart compaction](#smart-compaction-experimental)). Optional text tells the
|
|
@@ -444,7 +427,6 @@ argument: a type-ahead list narrows as you type and Tab completes it.
|
|
|
444
427
|
- `/tools` - List registered tools
|
|
445
428
|
- `/skills` - List the skills the agent can load, where each lives, and any loading warnings
|
|
446
429
|
- `/plan` - Show the agent's task plan with all notes
|
|
447
|
-
- `/timers` - List the session's timers (the agent schedules them with `timer_set` to come back to you later); shows each timer's id, due time and note (see [Timers](#timers))
|
|
448
430
|
- `/memory [forget ID]` - List cross-session memories with their ids, or delete one by id (see [Memory](#memory))
|
|
449
431
|
- `/hooks` - List the loaded external user hooks (from `.claude/settings.json` and friends), the files they came from, and any skipped entries (see [Lifecycle Hooks](#lifecycle-hooks))
|
|
450
432
|
- `/queue [list|add text|remove N...|edit N text|clear]` - Show or edit the queued messages and unread steers. Works while a turn runs, so a queued message or steer can be removed or rewritten before it is sent.
|
|
@@ -459,86 +441,26 @@ argument: a type-ahead list narrows as you type and Tab completes it.
|
|
|
459
441
|
- `/trajectory` - Show this session's trajectory turn by turn: user input, thinking, answers, tool calls and results, tokens and timings. Each message row is labelled with its `#N` session-log ID, the same ID `history_read` and smart-compaction summaries use (compaction and crash-recovered input rows have no `#N`, as they aren't cited that way). It opens in your pager (`$PAGER`, default `less`), even when it would fit on the screen, so you dismiss it with `q` and it doesn't stay in the transcript or your scrollback — but only at an idle prompt on a terminal: invoked mid-turn (while a turn runs) or with piped output it prints inline instead. `/trajectory --json` or `/trajectory --markdown` prints an export instead; `nano-coder --trajectory SESSION_ID [--json|--markdown]` does the same for any saved session
|
|
460
442
|
- `/resume [ID|last]` - Switch to a saved session without restarting: the same picker as `--resume` (leaving out the session in use), or the session with that ID, or `last` (the most recent other session in this directory). Run it at the prompt, not during a turn
|
|
461
443
|
- `/restart` - Start a fresh session (clean context) without exiting
|
|
462
|
-
- `/update` - Install the latest release through the channel nano-coder was installed from (`npm install -g @nanobpm/nano-coder@latest`, `brew upgrade nanobpm/tap/nano-coder`; a cargo install is told how to switch to one of those), with the installer's progress on the terminal; verifies the installed version afterwards and leaves the running session untouched on failure. On an install that is not managed by npm, Homebrew or cargo it prints the releases page and changes nothing. Run it at the prompt, not during a turn (see [Updates](#updates))
|
|
463
|
-
- `/relaunch` - Restart the binary (re-resolved, so a just-installed update is picked up), resuming the current session — the transcript and scrollback carry over. Works whether or not an update was just installed. An unsent draft or queued messages are confirmed before being discarded. Run it at the prompt, not during a turn (see [Updates](#updates))
|
|
464
444
|
- `/exit` - Exit the agent (prints the session's `--resume` command first, when session persistence is enabled)
|
|
465
445
|
|
|
466
|
-
## Updates
|
|
467
|
-
|
|
468
|
-
In an interactive terminal session, nano-coder checks in the background whether a newer
|
|
469
|
-
release exists: once at startup (in a background task — the first prompt is never delayed)
|
|
470
|
-
and then every hour. The last-check time and the latest-known version are persisted in
|
|
471
|
-
`<platform data dir>/nano-coder/update-check.json`, so rapid restarts do not re-check
|
|
472
|
-
inside the hour. When a newer version is found, a single non-modal hint per new version is
|
|
473
|
-
shown at an idle prompt:
|
|
474
|
-
|
|
475
|
-
> nano-coder 0.43.0 is available (you have 0.42.1) — /update to install it
|
|
476
|
-
|
|
477
|
-
The check runs only in interactive TTY sessions — never in `-p`/headless, ACP or CI runs
|
|
478
|
-
(automated runners use deliberately pinned versions) — and only when the binary is managed
|
|
479
|
-
by a known install channel, detected once at startup from the executable's path:
|
|
480
|
-
|
|
481
|
-
- **npm** (under a `node_modules/@nanobpm/` tree — both launcher states: the
|
|
482
|
-
platform-package binary and the self-replaced copy in `bin/`): the latest version comes
|
|
483
|
-
from `https://registry.npmjs.org/@nanobpm/nano-coder/latest`, and `/update` runs
|
|
484
|
-
`npm install -g @nanobpm/nano-coder@latest`.
|
|
485
|
-
- **Homebrew** (the binary resolves into `<brew prefix>/Cellar/nano-coder/`): the latest
|
|
486
|
-
version is the one the [nanobpm/homebrew-tap](https://github.com/nanobpm/homebrew-tap)
|
|
487
|
-
formula points at (bumped by the release workflow a few minutes after each release), and
|
|
488
|
-
`/update` runs `brew upgrade nanobpm/tap/nano-coder`. `/relaunch` restarts through the
|
|
489
|
-
formula's `opt` link, so it finds the new version after brew removes the old one.
|
|
490
|
-
- **cargo** (in `$CARGO_HOME/bin`, default `~/.cargo/bin`): 1.0 and later are not on
|
|
491
|
-
crates.io, so the latest version comes from npm, and `/update` prints how to switch to
|
|
492
|
-
npm or Homebrew (then `cargo uninstall nano-coder`) instead of running cargo.
|
|
493
|
-
- **anything else** (standalone tarball, a dev build in `target/`, a distro package): no
|
|
494
|
-
background check and no self-modification. `/update` explains that the install is not
|
|
495
|
-
managed and points at the
|
|
496
|
-
[releases page](https://github.com/nanobpm/nano-coder/releases); a locally built binary
|
|
497
|
-
is never overwritten.
|
|
498
|
-
|
|
499
|
-
`/update` runs only at an idle prompt. It suspends the frame UI while the installer owns
|
|
500
|
-
the terminal, then verifies the result with `nano-coder --version`: on success it suggests
|
|
501
|
-
`/relaunch`; on failure it shows the installer's exit status and leaves the running
|
|
502
|
-
session untouched. If the channel's tool (`npm`/`cargo`) is not on `PATH`, `/update`
|
|
503
|
-
prints the exact manual command instead. If you are already on the latest release (a fresh
|
|
504
|
-
check, not the hourly cache), it says so.
|
|
505
|
-
|
|
506
|
-
`/relaunch` restarts the harness without losing the session: it re-resolves the binary
|
|
507
|
-
(so a just-installed update is picked up), restores the terminal modes, and replaces the
|
|
508
|
-
process with the original arguments plus `--resume <current session>`. The session log,
|
|
509
|
-
persisted timers and trust decisions live outside the process and carry over; ephemeral
|
|
510
|
-
state — session-scoped permission grants and MCP connections — is re-established by the
|
|
511
|
-
resume, as with any `--resume`. An unsent draft or queued messages are confirmed before
|
|
512
|
-
being discarded. It also works with no update pending, as a "restart the harness, keep
|
|
513
|
-
the session" verb (unlike `/restart`, which starts a fresh session with clean context).
|
|
514
|
-
|
|
515
|
-
The check fails silently and quickly when the network is unavailable (a short timeout, no
|
|
516
|
-
retries, no effect on turn latency). To opt out, either:
|
|
517
|
-
|
|
518
|
-
```toml
|
|
519
|
-
# ~/.config/nano-coder/config.toml
|
|
520
|
-
check_updates = false
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
or set an environment variable — `NANO_CODER_NO_UPDATE_CHECK=1`, or the de-facto standard
|
|
524
|
-
`NO_UPDATE_NOTIFIER=1`.
|
|
525
|
-
|
|
526
446
|
## Building and Running
|
|
527
447
|
|
|
448
|
+
You need [LDC](https://github.com/ldc-developers/ldc) 1.43+ and dub, plus the libcurl
|
|
449
|
+
development headers on Linux.
|
|
450
|
+
|
|
528
451
|
```bash
|
|
529
|
-
|
|
530
|
-
./
|
|
452
|
+
dub build -b release # ./nano-coder
|
|
453
|
+
./nano-coder
|
|
531
454
|
```
|
|
532
455
|
|
|
533
|
-
|
|
456
|
+
Then, for example:
|
|
534
457
|
|
|
535
458
|
```bash
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
cargo run -- --resume last # the most recent session in this directory
|
|
459
|
+
nano-coder --model anthropic/claude-sonnet-4-5
|
|
460
|
+
nano-coder --model ollama/qwen2.5:1.5b
|
|
461
|
+
nano-coder --resume sess-20260923T012518-7e7923f8
|
|
462
|
+
nano-coder --resume # pick a session
|
|
463
|
+
nano-coder --resume last # the most recent session in this directory
|
|
542
464
|
```
|
|
543
465
|
|
|
544
466
|
**Resuming.** `--resume` without an ID opens a picker of this directory's saved sessions, most
|
|
@@ -564,16 +486,15 @@ asks again on the session's next turn.
|
|
|
564
486
|
|
|
565
487
|
Flags: `--login github-copilot|muse`, `--list-models PROVIDER`, `--trajectory SESSION_ID [--json|--markdown]`, `--acp`, `--model provider/model` (or `AGENTIC_HARNESS_MODEL`), `--resume [SESSION_ID|last]`, `--list-sessions [--all] [--json]`,
|
|
566
488
|
`--config PATH`, `--verbosity LEVEL` (`-v`), `--sandbox off|workspace|read-only` (or `NANO_CODER_SANDBOX`),
|
|
567
|
-
`--allow RULE` and `--deny RULE` (repeatable; added to the config's rules), `--
|
|
568
|
-
|
|
569
|
-
`--wait-timers` keeps the session alive for scheduled timers (see [Timers](#timers)) after input ends.
|
|
570
|
-
In an interactive session the agent already waits at the prompt, but a piped or redirected run exits
|
|
571
|
-
once stdin closes — so a run that reads its prompt from a pipe needs `--wait-timers` to keep waiting
|
|
572
|
-
for timers set during the turn to come due, fire, and be delivered. Ctrl-C exits the wait.
|
|
489
|
+
`--allow RULE` and `--deny RULE` (repeatable; added to the config's rules), `--version` (`-V`).
|
|
573
490
|
|
|
574
|
-
Before opening a PR, run `
|
|
575
|
-
and `
|
|
576
|
-
|
|
491
|
+
Before opening a PR, run `dub build` and `dub test` (both run `scripts/check-safe.sh`
|
|
492
|
+
first) and D-Scanner (`dub run dscanner -- --styleCheck --config dscanner.ini source`); CI
|
|
493
|
+
checks all three. All code is `@safe`: every module starts with `@safe:`, and calls the
|
|
494
|
+
compiler can't check are wrapped in small, commented `@trusted` functions (shared ones in
|
|
495
|
+
`source/nano/safeio.d`). `check-safe.sh` fails the build on a module without `@safe:`, an
|
|
496
|
+
uncommented `@trusted`, raw threads or `__gshared` outside `safeio.d`, or more `@trusted` than
|
|
497
|
+
the budgets in `scripts/` allow. The build uses `-preview=dip1000` and `-preview=nosharedaccess`.
|
|
577
498
|
|
|
578
499
|
## Configuration
|
|
579
500
|
|
|
@@ -593,10 +514,7 @@ session_titles = false # ask the model for a few-word title per
|
|
|
593
514
|
# title_model = "openai/gpt-4o-mini" # model for titles (default: the session's model)
|
|
594
515
|
auto_compact = true # summarize automatically when the context fills up
|
|
595
516
|
auto_compact_threshold = 0.8 # fraction of the context window
|
|
596
|
-
idle_compact = true # already past the threshold? compact at the idle prompt, not on your next message (Esc Esc cancels)
|
|
597
|
-
# idle_compact_hold_secs = 180 # how long the prompt (and any draft) must sit untouched first
|
|
598
517
|
compaction_mode = "standard" # standard | smart (experimental, see Smart compaction)
|
|
599
|
-
# compaction_pin_requests = true # re-attach the user's requests verbatim after each summary (issue #66)
|
|
600
518
|
# context_window = 128000 # override the window (providers can set it too)
|
|
601
519
|
verbosity = "normal" # quiet | normal | verbose | debug (or --verbosity)
|
|
602
520
|
timestamps = true # prefix CLI messages with the local time (HH:MM:SS)
|
|
@@ -607,12 +525,10 @@ user_rules_dirs = ["~/.claude/rules"]
|
|
|
607
525
|
instruction_imports_outside_project = false # let project @imports / rule links leave the repo
|
|
608
526
|
plan_tools = true # offer the plan_* tools (see Task Plans)
|
|
609
527
|
outcome_tool = true # offer report_outcome (see Outcomes)
|
|
610
|
-
verify_before_complete = true # ask once for the check's evidence when completing after an unchecked edit (see Outcomes)
|
|
611
528
|
reminders = true # append <system-reminder> notes to tool results
|
|
612
529
|
memory = "on" # on | read_only | off — cross-session memory (see Memory)
|
|
613
530
|
# memory_dir = "/path/to/memory" # default: <platform data dir>/nano-coder/memory
|
|
614
531
|
memory_expiry_days = 90 # expire memories unused this long (0 = never)
|
|
615
|
-
check_updates = true # hourly background release check, interactive sessions only (see Updates)
|
|
616
532
|
|
|
617
533
|
[skills] # see Skills
|
|
618
534
|
enabled = true
|
|
@@ -692,7 +608,7 @@ kind = "anthropic"
|
|
|
692
608
|
base_url = "https://llm-gateway.example.com/anthropic/v1"
|
|
693
609
|
api_key_env = "WORK_GATEWAY_KEY" # or api_key = "..." (prefer the env var)
|
|
694
610
|
# api_key_command = "op read op://vault/gateway/key" # used when the env var is unset
|
|
695
|
-
timeout_secs = 300 # idle timeout: max silence between streamed bytes (default
|
|
611
|
+
timeout_secs = 300 # idle timeout: max silence between streamed bytes (default 600)
|
|
696
612
|
max_retries = 3
|
|
697
613
|
```
|
|
698
614
|
|
|
@@ -737,45 +653,6 @@ api_key_env = "BAILIAN_TOKEN_PLAN_API_KEY"
|
|
|
737
653
|
as thinking models like K3 require. Set `extra_body = { reasoning_effort = "low" }` to
|
|
738
654
|
make K3 think less.
|
|
739
655
|
|
|
740
|
-
#### Regional OpenRouter workspaces and curated model lists
|
|
741
|
-
|
|
742
|
-
Some OpenRouter workspaces (e.g. Camunda's) reject the global `openrouter.ai` host, so
|
|
743
|
-
the `openrouter` preset fails with them. They accept only the regional hosts
|
|
744
|
-
`us.openrouter.ai` and `eu.openrouter.ai`, and each model is served on just one of them.
|
|
745
|
-
Three provider settings cover this:
|
|
746
|
-
|
|
747
|
-
- `[providers.<name>.models."<model>"]` takes a `base_url`, which overrides the
|
|
748
|
-
provider's for that model, and a display `name`.
|
|
749
|
-
- `list_models = "configured"` makes `/model`, `--list-models` and `/model` Tab completion
|
|
750
|
-
offer only the models configured under `models`, with their names, instead of the
|
|
751
|
-
endpoint's whole `/models` catalogue. The default is `"endpoint"`.
|
|
752
|
-
- `disabled = true` hides a provider (a preset too) from `/providers`, the pickers and
|
|
753
|
-
suggestions. A model spec that names it is an error.
|
|
754
|
-
|
|
755
|
-
```toml
|
|
756
|
-
model = "openrouter-camunda/moonshotai/kimi-k3"
|
|
757
|
-
|
|
758
|
-
[providers.openrouter]
|
|
759
|
-
disabled = true # the global host is rejected
|
|
760
|
-
|
|
761
|
-
[providers.openrouter-camunda]
|
|
762
|
-
kind = "openai"
|
|
763
|
-
base_url = "https://us.openrouter.ai/api/v1"
|
|
764
|
-
api_key_env = "OPENROUTER_API_KEY"
|
|
765
|
-
list_models = "configured"
|
|
766
|
-
|
|
767
|
-
[providers.openrouter-camunda.models."moonshotai/kimi-k3"]
|
|
768
|
-
name = "Kimi K3"
|
|
769
|
-
|
|
770
|
-
[providers.openrouter-camunda.models."amazon/nova-lite-v1"]
|
|
771
|
-
name = "Nova Lite 1.0"
|
|
772
|
-
base_url = "https://eu.openrouter.ai/api/v1" # served in the EU only
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
[`examples/openrouter-camunda.toml`](examples/openrouter-camunda.toml) is the full
|
|
776
|
-
equivalent of the `opencode.json` in Camunda's handbook. A model's `"provider": {"api": …}`
|
|
777
|
-
there becomes its `base_url` here.
|
|
778
|
-
|
|
779
656
|
### Temperature
|
|
780
657
|
|
|
781
658
|
`temperature` is a number, or `"default"` to send none so the model uses its own default.
|
|
@@ -895,34 +772,8 @@ content hash), so session logs stay small and `--resume` still works; a missing
|
|
|
895
772
|
resume is sent as a text placeholder.
|
|
896
773
|
|
|
897
774
|
Other per-provider fields: `replay_reasoning`, `max_tokens_param` (`max_tokens`, or `max_completion_tokens`
|
|
898
|
-
which is the `openai` default), `retry_initial_backoff_ms`, `retry_max_backoff_ms
|
|
899
|
-
`retryable_statuses
|
|
900
|
-
|
|
901
|
-
`timeout_secs` is an *idle* timeout: it resets on every received byte, so a slow but steady
|
|
902
|
-
stream is never cut off — only a genuinely stalled connection trips it. The default is 120 s
|
|
903
|
-
(`NANO_CODER_PROVIDER_TIMEOUT_SECS` overrides the default; an explicit `timeout_secs` wins
|
|
904
|
-
over both). When nano-coder runs under a supervisor that idle-kills a silent run — e.g. the
|
|
905
|
-
c8ctl-nano worker, which kills a run after 300 s of no output — `timeout_secs` must stay
|
|
906
|
-
**below** that budget: at or above it the worker kills the whole run before a stalled stream
|
|
907
|
-
is ever detected and retried. A supervising worker can pass its own derived budget (e.g. its
|
|
908
|
-
idle-kill budget / 2) as `NANO_CODER_PROVIDER_TIMEOUT_SECS` so the two timeouts cannot drift.
|
|
909
|
-
|
|
910
|
-
A transport failure with no HTTP response (DNS, connection refused or reset, connect or
|
|
911
|
-
idle timeout) is treated as the network being down rather than a failed attempt: nano-coder
|
|
912
|
-
backs off (`retry_initial_backoff_ms` doubling to `retry_max_backoff_ms`) and keeps waiting,
|
|
913
|
-
reporting the outage on a single live line (`network unavailable (…); retrying in Ns
|
|
914
|
-
(Ctrl-C to stop)`) when stderr is a terminal, or announcing it once when output is piped, so
|
|
915
|
-
a long outage never floods the log. When a response finally arrives it announces the
|
|
916
|
-
recovery, so a turn survives a laptop sleep, a Wi-Fi change or a VPN reconnect instead of
|
|
917
|
-
failing after about a minute. A redirect-policy error (a redirect loop or a disallowed
|
|
918
|
-
redirect) is *not* an outage — HTTP is flowing — so it surfaces its actionable error at once
|
|
919
|
-
instead of being retried. These waits do not consume `max_retries` (which still bounds
|
|
920
|
-
HTTP-status retries like 429 or 5xx), and the Copilot session-token refresh waits the same
|
|
921
|
-
way. If a stream drops after it started replying, the partial reply is discarded (nothing
|
|
922
|
-
reaches history) and the request is re-sent, up to ten times per model call. The wait is
|
|
923
|
-
unbounded by default; set `offline_budget_ms` to give up after that many milliseconds
|
|
924
|
-
offline — the budget bounds the whole wait, backoff sleeps included, and no further request
|
|
925
|
-
is issued once it is spent.
|
|
775
|
+
which is the `openai` default), `retry_initial_backoff_ms`, `retry_max_backoff_ms` and
|
|
776
|
+
`retryable_statuses`.
|
|
926
777
|
|
|
927
778
|
The old top-level `api_key` / `base_url` still work. They apply to `default_provider`,
|
|
928
779
|
which becomes `openai` if it was `mock`.
|
|
@@ -1117,20 +968,6 @@ another 10% of the window, so a context that can't shrink isn't summarized on ev
|
|
|
1117
968
|
If summarizing fails, the older messages are dropped with a note. The session log records
|
|
1118
969
|
the new conversation, so `--resume` continues from it.
|
|
1119
970
|
|
|
1120
|
-
After the summary, compaction re-attaches the **user's requests verbatim** (a pinned block,
|
|
1121
|
-
`compaction_pin_requests`, on by default). A summary of a summary would otherwise paraphrase
|
|
1122
|
-
the user's original words away over repeated compactions; the pinned block is rebuilt from the
|
|
1123
|
-
original messages each time, so an exact flag, number or phrase the user stated once survives
|
|
1124
|
-
intact. The block is bounded by an allowance derived from the context window (about an eighth
|
|
1125
|
-
of it): when a long session's requests outgrow it, the oldest follow-ups are dropped with an
|
|
1126
|
-
explicit omission note — the goal and the newest requests are kept — so the pin can never push
|
|
1127
|
-
the context past the window. The note names the dropped requests by one covering session-log span
|
|
1128
|
-
(`#2-#40`), so however many requests are dropped the note stays a fixed, small size. Hook output appended to a prompt is not pinned as the user's
|
|
1129
|
-
words — the user-typed text is recorded separately, so a prompt that itself mentions a
|
|
1130
|
-
`<system-reminder>` tag (even at its very start) keeps its whole task in the pin. In smart mode each pinned request is
|
|
1131
|
-
labelled with its `#N` log ID, so the full text is
|
|
1132
|
-
one `history_read` away.
|
|
1133
|
-
|
|
1134
971
|
### Smart compaction (experimental)
|
|
1135
972
|
|
|
1136
973
|
A summary is lossy: whatever it leaves out is gone for the agent, even though the session
|
|
@@ -1323,30 +1160,6 @@ the result:
|
|
|
1323
1160
|
|
|
1324
1161
|
Plan and outcome calls don't count. Set `reminders = false` to turn them off.
|
|
1325
1162
|
|
|
1326
|
-
## Timers
|
|
1327
|
-
|
|
1328
|
-
The `timer_*` tools let the agent schedule a note to itself to come back to you later — for
|
|
1329
|
-
example to check on a long build, or to follow up after a delay. A timer lives only for the
|
|
1330
|
-
session (it is written to the session log, so `--resume` restores pending ones).
|
|
1331
|
-
|
|
1332
|
-
- `timer_set` - schedule a timer. Give exactly one of `after` (a delay like `30m`, `1h30m`,
|
|
1333
|
-
`90s`, `2 hours`, `1.5h`) or `at` (a time like `HH:MM` for the next occurrence, or an ISO
|
|
1334
|
-
date-time such as `2026-10-25T14:30`, local unless you append an offset like `+02:00` or `Z`),
|
|
1335
|
-
plus a `note` describing what to do when it fires. Up to 10 timers can be active at once.
|
|
1336
|
-
- `timer_list` - the session's timers with their ids, due times and notes.
|
|
1337
|
-
- `timer_cancel` - drop a timer by `id`.
|
|
1338
|
-
- `timer_done` - acknowledge a fired timer by `id` once it is handled.
|
|
1339
|
-
|
|
1340
|
-
When a timer comes due it is delivered to the model as an automatic turn. If one fires while a
|
|
1341
|
-
turn is already running it is delivered mid-turn; otherwise it starts a fresh automatic turn
|
|
1342
|
-
when the session is idle. `/timers` shows the current timers in the terminal.
|
|
1343
|
-
|
|
1344
|
-
In an interactive session the agent waits at the prompt, so due timers fire naturally. A piped
|
|
1345
|
-
or redirected (non-interactive) run, however, exits as soon as stdin closes — pass
|
|
1346
|
-
`--wait-timers` to keep such a run alive after input ends so timers set during the turn can come
|
|
1347
|
-
due, fire and be delivered; Ctrl-C exits the wait. The timer tools are available in interactive
|
|
1348
|
-
CLI sessions; ACP headless mode has no idle loop to fire them, so they are not offered there.
|
|
1349
|
-
|
|
1350
1163
|
## Outcomes
|
|
1351
1164
|
|
|
1352
1165
|
`report_outcome` is the model's explicit end-of-task signal: `status` is `completed` (the
|
|
@@ -1361,15 +1174,6 @@ recorded outcome without calling the model again. In the terminal the call shows
|
|
|
1361
1174
|
`✔ completed`, `■ blocked`, or `? needs input` followed by the summary. Set `outcome_tool = false` to leave the
|
|
1362
1175
|
tool out.
|
|
1363
1176
|
|
|
1364
|
-
A `completed` report is expected to name its check: the `summary` description asks for what was done
|
|
1365
|
-
*and how it was checked* (the command run and its result). To back that up, `verify_before_complete`
|
|
1366
|
-
(on by default in the terminal) watches the turn: if the model edited a file (`write_file` / `edit_file`)
|
|
1367
|
-
after its last `bash` call and then reports `completed`, that one report is bounced with a reminder —
|
|
1368
|
-
"You changed files after your last check. Run the relevant tests/build, or report again if no check
|
|
1369
|
-
applies." The reminder fires at most once per turn, so a second `report_outcome` always goes through
|
|
1370
|
-
and the model is never trapped; `blocked` and `needs_input` are never intercepted. The ACP harness
|
|
1371
|
-
turns the flag off because the orchestrator runs its own verification there.
|
|
1372
|
-
|
|
1373
1177
|
`needs_input` is the structural "waiting on the user" signal: an orchestrator (or auto mode)
|
|
1374
1178
|
can tell it apart from a clean `completed` without guessing from the text. For a richer,
|
|
1375
1179
|
multi-choice question that does not end the turn, the model uses the `question` tool instead.
|
|
@@ -1398,23 +1202,9 @@ evidence (a file path or command). Search is a case-insensitive regex
|
|
|
1398
1202
|
over the text and the optional evidence, as in `history_search` - no embeddings or vector
|
|
1399
1203
|
store.
|
|
1400
1204
|
|
|
1401
|
-
**Tools** (offered when `memory` is on): `memory_save(scope, text, evidence
|
|
1205
|
+
**Tools** (offered when `memory` is on): `memory_save(scope, text, evidence?)`,
|
|
1402
1206
|
`memory_search(pattern, scope?)`, `memory_forget(id)`.
|
|
1403
1207
|
|
|
1404
|
-
**Recall from tool calls.** Before relying on the model to search, each tool call's arguments
|
|
1405
|
-
are matched (lexically, no model call) against memory *anchors*: backticked spans, path-like
|
|
1406
|
-
tokens and host names in the text and evidence (common commands such as `git` are ignored), or
|
|
1407
|
-
the entry's explicit `anchors` list, which replaces the extracted ones. A match attaches a
|
|
1408
|
-
note to the tool result - `📌 note from an earlier session (verify ...)` with its `check:`
|
|
1409
|
-
command and how long ago it was last used. A `hint` (the default `kind`) is recalled once per
|
|
1410
|
-
context; a `rule` on every match. At most 2 notes are attached per turn. What has been seen is
|
|
1411
|
-
session state (persisted like timers, reset by compaction and new sessions), never stored in
|
|
1412
|
-
the memory file, and a `memory_search` result counts as seen. Recall works in read-only
|
|
1413
|
-
(headless/ACP) sessions too. Each recall, and each recall later followed by a `memory_search`
|
|
1414
|
-
of that memory, is appended to `<memory_dir>/recall.jsonl`; `/memory` shows the counts
|
|
1415
|
-
(`recalled N×, used M×`) so over-broad anchors can be spotted. Entries without `kind`/`anchors`
|
|
1416
|
-
load unchanged.
|
|
1417
|
-
|
|
1418
1208
|
**Prompt.** A capped, dated index (most-recently-used first, ~4 KB with the guidance) is
|
|
1419
1209
|
appended to the system prompt at session start, framed as "notes from earlier sessions; may be
|
|
1420
1210
|
out of date; verify before relying on them". The rest is reachable with `memory_search`.
|
|
@@ -1489,27 +1279,25 @@ properties and findings.
|
|
|
1489
1279
|
|
|
1490
1280
|
### Adding Tools
|
|
1491
1281
|
|
|
1492
|
-
```
|
|
1493
|
-
|
|
1494
|
-
"
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
// Tool implementation
|
|
1500
|
-
Ok(json!({ "result": "..." }))
|
|
1501
|
-
}));
|
|
1282
|
+
```d
|
|
1283
|
+
agent.tools.register(ToolDefinition("my_tool", "Description of what the tool does",
|
|
1284
|
+
parseJSON(`{"type": "object", "properties": { ... }}`)),
|
|
1285
|
+
(JSONValue args) {
|
|
1286
|
+
// Tool implementation; the string is what the model sees.
|
|
1287
|
+
return "result";
|
|
1288
|
+
});
|
|
1502
1289
|
```
|
|
1503
1290
|
|
|
1504
|
-
|
|
1291
|
+
### Observing the agent
|
|
1505
1292
|
|
|
1506
|
-
|
|
1293
|
+
Pass your own `AgentEvents` to `agent.run`:
|
|
1507
1294
|
|
|
1508
|
-
```
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1295
|
+
```d
|
|
1296
|
+
class Logger : AgentEvents
|
|
1297
|
+
{
|
|
1298
|
+
void toolStart(const ref ToolCall call) { writeln("About to call tool: ", call.name); }
|
|
1299
|
+
// text, toolEnd, usage, userMessage, assistantMessage ...
|
|
1300
|
+
}
|
|
1513
1301
|
```
|
|
1514
1302
|
|
|
1515
1303
|
These callbacks observe only; to block, modify, or add context to a tool call
|
|
@@ -1518,16 +1306,15 @@ or prompt, use the external Claude-compatible user hooks described under
|
|
|
1518
1306
|
|
|
1519
1307
|
### Custom LLM Client
|
|
1520
1308
|
|
|
1521
|
-
Implement the
|
|
1309
|
+
Implement the `LLMClient` interface (`nano/llm.d`), or add a provider in `nano/providers/`:
|
|
1522
1310
|
|
|
1523
|
-
```
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
fn provider_name(&self) -> &str { "mine" }
|
|
1311
|
+
```d
|
|
1312
|
+
class MyClient : LLMClient
|
|
1313
|
+
{
|
|
1314
|
+
LLMResponse chat(const ref ChatRequest req, StreamSink sink) { /* req.messages, req.tools, ... */ }
|
|
1315
|
+
string[] listModels() { return ["my-model"]; }
|
|
1316
|
+
string modelName() const { return "my-model"; }
|
|
1317
|
+
string providerName() const { return "mine"; }
|
|
1531
1318
|
}
|
|
1532
1319
|
```
|
|
1533
1320
|
|
package/lib/platform.js
CHANGED
|
@@ -11,7 +11,7 @@ const PLATFORMS = {
|
|
|
11
11
|
function platformPackage() {
|
|
12
12
|
const key = `${process.platform}-${process.arch}`;
|
|
13
13
|
const pkg = PLATFORMS[key];
|
|
14
|
-
if (!pkg) throw new Error(`no prebuilt binary for ${key} (supported: ${Object.keys(PLATFORMS).join(', ')});
|
|
14
|
+
if (!pkg) throw new Error(`no prebuilt binary for ${key} (supported: ${Object.keys(PLATFORMS).join(', ')}); build it from source with \`dub build -b release\` in a checkout of https://github.com/nanobpm/nano-coder`);
|
|
15
15
|
return pkg;
|
|
16
16
|
}
|
|
17
17
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/nano-coder",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A 4MB coding agent. Run a fleet on your laptop.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"agent",
|
|
14
14
|
"coding-agent",
|
|
15
15
|
"acp",
|
|
16
|
-
"cli"
|
|
16
|
+
"cli",
|
|
17
|
+
"dlang"
|
|
17
18
|
],
|
|
18
19
|
"bin": {
|
|
19
20
|
"nano-coder": "bin/nano-coder"
|
|
@@ -27,9 +28,9 @@
|
|
|
27
28
|
"node": ">=18"
|
|
28
29
|
},
|
|
29
30
|
"optionalDependencies": {
|
|
30
|
-
"@nanobpm/nano-coder-darwin-arm64": "0.
|
|
31
|
-
"@nanobpm/nano-coder-darwin-x64": "0.
|
|
32
|
-
"@nanobpm/nano-coder-linux-arm64": "0.
|
|
33
|
-
"@nanobpm/nano-coder-linux-x64": "0.
|
|
31
|
+
"@nanobpm/nano-coder-darwin-arm64": "1.0.0",
|
|
32
|
+
"@nanobpm/nano-coder-darwin-x64": "1.0.0",
|
|
33
|
+
"@nanobpm/nano-coder-linux-arm64": "1.0.0",
|
|
34
|
+
"@nanobpm/nano-coder-linux-x64": "1.0.0"
|
|
34
35
|
}
|
|
35
36
|
}
|