@nanobpm/nano-coder 0.49.0 → 0.51.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.
Files changed (2) hide show
  1. package/README.md +31 -22
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -22,11 +22,12 @@ cargo install nano-coder # or build from source
22
22
  Claude Code–compatible external user hooks loaded from `.claude/settings.json`
23
23
  - **Configuration**: TOML-based config file at `~/.config/nano-coder/config.toml`
24
24
  - **Commands**: `/help`, `/compact`, `/context`, `/verbosity`, `/settings`, `/tools`, `/skills`, `/queue`, `/restart`, `/exit`
25
- - **Streaming output**: answers stream in, thinking shows collapsed (Ctrl-O expands it), tool calls show inline
26
- - **Status line** pinned to the bottom of the terminal, plus manual and automatic context compaction
25
+ - **Streaming output**: answers stream in, thinking shows collapsed, tool calls show inline
26
+ - **Status line** as the bottom row of the terminal, plus manual and automatic context compaction
27
27
  - **Task plans**: `plan_*` tools keep a plan with notes outside the conversation, so long tasks survive compaction, resume and a change of worker
28
28
  - **Project instructions**: `AGENTS.md` (or `CLAUDE.md`, `.github/copilot-instructions.md`) from the repository is added to the system prompt
29
29
  - **Safety**: built-in guards block destructive commands (`rm -rf /`, `DROP DATABASE`, force-pushing `main`, ...), user allow/deny rules, and an optional OS sandbox (Seatbelt on macOS, Landlock on Linux)
30
+ - **Herdr**: inside a [Herdr](https://herdr.dev) pane, reports idle/working/blocked state and the resume command
30
31
  - **Skills**: `SKILL.md` folders from the repository, `~/.agents/skills`, and an spm `ai.lock`, loaded on demand with `load_skill`
31
32
 
32
33
  ## Two Execution Modes
@@ -52,7 +53,10 @@ xterm, kitty, WezTerm, Ghostty, iTerm2); elsewhere use `/queue add message`. The
52
53
  line shows how many are waiting. Edit the queue at any time
53
54
  (even mid-turn) with `/queue`: `/queue` lists the waiting messages, `/queue remove N`
54
55
  drops one (or several, `/queue remove N M`), `/queue edit N new text` rewrites one, and
55
- `/queue clear` empties the queue. A queued message is never injected while the agent is
56
+ `/queue clear` empties the queue. Steers you have sent but the agent has not read yet
57
+ show in the same list (marked `steer`, with the id from the `↪ steer #N` note), and
58
+ `remove`/`edit`/`clear` apply to them too — so a steer the running turn has made stale can
59
+ be withdrawn or rewritten before the agent's next step. A queued message is never injected while the agent is
56
60
  asking for input (the `question` tool's picker owns the terminal until you answer).
57
61
  Slash commands work mid-turn too, where it is safe:
58
62
  - **Right away:** read-only ones (`/help`, `/tools`, `/skills`, `/providers`, `/session`, `/plan`,
@@ -177,10 +181,10 @@ src/
177
181
  ├── session_index.rs # Session summaries (.index.jsonl) for the --resume picker
178
182
  ├── resume.rs # --resume picker, --resume last, --list-sessions
179
183
  ├── context.rs # Token accounting, context-window heuristics, overflow detection
180
- ├── status.rs # Bottom-of-terminal status line
184
+ ├── status.rs # Status bar contents (the frame's last row)
181
185
  ├── ui.rs # Verbosity levels and the streaming output renderer
182
- ├── frame.rs # App-owned frame renderer (renderer = "frame"): full redraw on resize
183
- ├── lineedit.rs # Key-by-key prompt input (Ctrl-O, mid-turn input on the status line)
186
+ ├── frame.rs # App-owned frame renderer: full redraw on resize
187
+ ├── lineedit.rs # Key-by-key prompt input (editing, history, mid-turn steer/queue)
184
188
  ├── input_history.rs # Up/Down recall of submitted lines (session-scoped)
185
189
  ├── instructions.rs # AGENTS.md / CLAUDE.md discovery for the system prompt
186
190
  ├── plan.rs # Task plan and the plan_add / plan_update / plan_show tools
@@ -411,7 +415,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
411
415
  - `/plan` - Show the agent's task plan with all notes
412
416
  - `/memory [forget ID]` - List cross-session memories with their ids, or delete one by id (see [Memory](#memory))
413
417
  - `/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))
414
- - `/queue [list|add text|remove N...|edit N text|clear]` - Show or edit the queued messages. Works while a turn runs, so a queued message can be removed or rewritten before it is sent.
418
+ - `/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.
415
419
  - `/model [provider/model]` - Show the current model and pick a new one. The list starts with the last four models you used (the current one marked; the previous one highlighted, so `/model` then Enter switches back), then the providers: pick a provider to scroll its model list (Esc steps back). With an argument, switches directly (conversation is kept). Typing `/model ` shows a type-ahead of the current model, recently used models, and each configured provider's default model; Tab completes (a bare provider name completes to its default model). Recently used models are kept in `~/.local/share/nano-coder/recent-models.json`
416
420
  - `/mode [normal|plan|auto]` - Show or set the agent mode (Shift+Tab cycles it, at the prompt or mid-turn):
417
421
  - **normal** - full tools; reaching a positive turn cap asks whether to keep going
@@ -420,7 +424,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
420
424
  - `/thinking [level|default|off|reset]` - Show the thinking level in use and the levels the current model takes, or set one for this session (`reset` goes back to the configured level). See [Thinking](#thinking)
421
425
  - `/providers` - List providers, endpoints and whether their API key is available
422
426
  - `/session` - Show the session ID and log path
423
- - `/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). When it doesn't fit on the screen it opens in your pager (`$PAGER`, default `less`) — but only at an idle prompt with the frame renderer: invoked mid-turn (while a turn runs) or under the legacy renderer 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
427
+ - `/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). When it doesn't fit on the screen it opens in your pager (`$PAGER`, default `less`) — 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
424
428
  - `/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
425
429
  - `/restart` - Start a fresh session (clean context) without exiting
426
430
  - `/exit` - Exit the agent (prints the session's `--resume` command first, when session persistence is enabled)
@@ -493,7 +497,6 @@ auto_compact_threshold = 0.8 # fraction of the context window
493
497
  compaction_mode = "standard" # standard | smart (experimental, see Smart compaction)
494
498
  # context_window = 128000 # override the window (providers can set it too)
495
499
  verbosity = "normal" # quiet | normal | verbose | debug (or --verbosity)
496
- renderer = "frame" # frame (default: app-owned redraw on resize) | legacy
497
500
  timestamps = true # prefix CLI messages with the local time (HH:MM:SS)
498
501
  project_instructions = true # load AGENTS.md etc. (see Project Instructions)
499
502
  project_instruction_files = ["AGENTS.md", "CLAUDE.md", ".claude/CLAUDE.md", ".github/copilot-instructions.md"]
@@ -857,10 +860,8 @@ with `/verbosity`, `--verbosity`, or `verbosity` in the config (default `normal`
857
860
  | `verbose` | Also the first lines of each tool's output |
858
861
  | `debug` | Also lifecycle hook events (`[hook] ...`) |
859
862
 
860
- **Thinking.** Reasoning streams as a single line that updates in place
861
- (`∴ Thinking: ...`) and becomes `∴ Thought for 3.1s · 812 chars` when the answer starts.
862
- **Ctrl-O** switches to showing thinking in full, including the block that is streaming. At
863
- the prompt it prints the last thinking in full. Press it again to collapse. Reasoning is read
863
+ **Thinking.** Reasoning shows as a single collapsed line while it streams and becomes
864
+ `∴ Thought for 3.1s · 812 chars` when the answer starts. Reasoning is read
864
865
  from `reasoning_content` / `reasoning` fields (DeepSeek, llama.cpp, vLLM, OpenRouter, Ollama),
865
866
  from `<think>...</think>` in the content, and from Anthropic `thinking` blocks. Anthropic
866
867
  thinking blocks are kept with the conversation so tool use keeps working when thinking is
@@ -870,7 +871,7 @@ enabled (e.g. `extra_body = { thinking = { type = "enabled", budget_tokens = 400
870
871
  error).
871
872
 
872
873
  **Input.** On a terminal, input is read key by key. While a turn runs, what you type shows
873
- on the status line; Enter sends it to steer the running turn, Ctrl-Enter (or Cmd-Enter)
874
+ in the input editor; Enter sends it to steer the running turn, Ctrl-Enter (or Cmd-Enter)
874
875
  adds it to the message queue (one queued message runs per following turn; `/queue` lists,
875
876
  edits and removes them), and Esc Esc or Ctrl-C cancels the turn. The prompt supports
876
877
  editing: Left/Right move the cursor, Home/End (or Ctrl-A/Ctrl-E) jump to the start/end,
@@ -890,8 +891,7 @@ Every message (your prompt, answers, tool calls and results, thinking, notes) st
890
891
  the local time as `HH:MM:SS`. The prompt's time is rewritten when you press Enter, so it
891
892
  shows when the message was sent. Turn this off with `timestamps = false`.
892
893
 
893
- **Renderer.** By default (`renderer = "frame"`) nano-coder uses an **app-owned frame
894
- renderer**: it composes the whole screen — transcript, input
894
+ **Renderer.** In a terminal nano-coder uses an **app-owned frame renderer**: it composes the whole screen — transcript, input
895
895
  editor, then the status bar as the last line — into one frame and diff-renders it through a
896
896
  single writer, wrapped in synchronized-output markers so a half-drawn frame is never visible.
897
897
  On a width change it re-renders the entire frame (clearing the screen and scrollback) instead
@@ -902,9 +902,9 @@ when nano-coder is waiting for you, and a spinner with `working 12s · Enter ste
902
902
  cancels` while a turn runs (the hint shows while the input is empty). The `working` count is
903
903
  working time, not wall time: while the turn is blocked waiting for a picker — the agent
904
904
  asking a question, or the turn-cap prompt — the clock pauses, so the time you spend
905
- answering does not inflate it. It never captures the mouse. Setting `renderer = "legacy"` (or picking it in
906
- `/settings`) switches back to the scroll-region renderer, where the terminal owns the
907
- scrollback and reflows history itself on a resize, with the status line pinned to the bottom.
905
+ answering does not inflate it. It never captures the mouse. When stdout is not a terminal
906
+ (piped or redirected), output is plain text instead. The scroll-region `renderer = "legacy"`
907
+ option was removed; a config that still sets `renderer` loads, with a one-line notice.
908
908
 
909
909
  ## Status Line and Compaction
910
910
 
@@ -915,9 +915,8 @@ In an interactive terminal the bottom row shows the provider/model, the working
915
915
  a fill bar, message count, session input/output tokens, the auto-compaction threshold and
916
916
  count (labelled `smart-compact` when compactions are smart, else `auto-compact`), the active mode when it is `plan` or `auto` (the default `normal` is not shown, to
917
917
  save space), and what the agent is doing. With a GitHub Copilot model it also shows the session's
918
- AI Credits (`0.4 AIC`), summed from the `total_nano_aiu` each response reports. In the legacy
919
- renderer it uses a terminal scroll region (DECSTBM); the default frame renderer instead composes
920
- the bar as the frame's final row. Either way it follows resizes, and is off when stdin/stdout isn't a TTY or `AGENTIC_NO_STATUS` is set. The conversation is kept
918
+ AI Credits (`0.4 AIC`), summed from the `total_nano_aiu` each response reports. The frame
919
+ renderer draws the bar as the frame's final row; it follows resizes, and is off when stdin/stdout isn't a TTY or `AGENTIC_NO_STATUS` is set. The conversation is kept
921
920
  directly above the status line (empty space collects at the top), so shrinking the window
922
921
  drops empty rows rather than pushing the conversation out of view.
923
922
 
@@ -1239,6 +1238,16 @@ Record times and each message's `timestamp` are RFC 3339 with the local UTC offs
1239
1238
  Redelivering an input whose turn was interrupted resumes that turn without duplicating
1240
1239
  the user message.
1241
1240
 
1241
+ ## Herdr
1242
+
1243
+ Run inside a [Herdr](https://herdr.dev) pane (`HERDR_ENV=1`, `HERDR_PANE_ID` and
1244
+ `HERDR_BIN_PATH` set), the interactive CLI reports itself to Herdr: `working` while a
1245
+ turn runs, `blocked` while a question or the turn limit waits for you, and `idle` at the
1246
+ prompt. A saved session is reported with the command that resumes it
1247
+ (`nano-coder --resume <id> --model <provider/model>`, plus `--config` if given), so Herdr
1248
+ can reopen it after a restart (Herdr 0.9.2 or later). The pane is released on exit.
1249
+ Reports run in the background and failures are ignored; outside Herdr nothing is sent.
1250
+
1242
1251
  ## Formal Verification
1243
1252
 
1244
1253
  `tla/` holds TLA+ specifications of ACP turn routing (steer, cancel, deferred
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-coder",
3
- "version": "0.49.0",
3
+ "version": "0.51.0",
4
4
  "description": "A 6MB coding agent. Run a fleet on your laptop.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -27,9 +27,9 @@
27
27
  "node": ">=18"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@nanobpm/nano-coder-darwin-arm64": "0.49.0",
31
- "@nanobpm/nano-coder-darwin-x64": "0.49.0",
32
- "@nanobpm/nano-coder-linux-arm64": "0.49.0",
33
- "@nanobpm/nano-coder-linux-x64": "0.49.0"
30
+ "@nanobpm/nano-coder-darwin-arm64": "0.51.0",
31
+ "@nanobpm/nano-coder-darwin-x64": "0.51.0",
32
+ "@nanobpm/nano-coder-linux-arm64": "0.51.0",
33
+ "@nanobpm/nano-coder-linux-x64": "0.51.0"
34
34
  }
35
35
  }