@nanobpm/nano-coder 0.11.0 → 0.13.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 -14
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -97,7 +97,7 @@ echoes it in `_meta.plan`, and the model is told about it with the first prompt
97
97
  advertises this as `agentCapabilities._meta.planSeed`. See [Task Plans](#task-plans).
98
98
 
99
99
  **Outcomes.** When the model calls `report_outcome`, the `session/prompt` result carries
100
- `_meta.outcome`: `{"status": "completed" | "blocked", "summary": "..."}`. A client can use it
100
+ `_meta.outcome`: `{"status": "completed" | "blocked" | "needs_input", "summary": "..."}`. A client can use it
101
101
  instead of guessing from the stop reason: `blocked` means the model needs help (an
102
102
  escalation). Redelivering the input returns the same outcome. See [Outcomes](#outcomes).
103
103
 
@@ -139,7 +139,9 @@ src/
139
139
  ├── lineedit.rs # Key-by-key prompt input (Ctrl-O, steering on the status line)
140
140
  ├── instructions.rs # AGENTS.md / CLAUDE.md discovery for the system prompt
141
141
  ├── plan.rs # Task plan and the plan_add / plan_update / plan_show tools
142
- ├── goal.rs # report_outcome tool (completed / blocked)
142
+ ├── goal.rs # report_outcome tool (completed / blocked / needs_input)
143
+ ├── mode.rs # Agent mode (normal / plan / auto) and the plan-mode tool gate
144
+ ├── question.rs # question tool and the mid-turn question / turn-cap rendezvous
143
145
  ├── commands.rs # Slash-command table for /help and the as-you-type menu
144
146
  ├── skills.rs # SKILL.md discovery, ai.lock sources and the load_skill tool
145
147
  ├── reminders.rs # <system-reminder> notes appended to tool results
@@ -178,8 +180,11 @@ The harness exposes 6 lifecycle hook events:
178
180
  - `edit_file` - Replace exact text (`path`, `old_string`, `new_string`, optional `replace_all`).
179
181
  Fails unless `old_string` matches exactly once (or `replace_all` is set).
180
182
  - `plan_add`, `plan_update`, `plan_show` - The agent's task plan (see [Task Plans](#task-plans)).
181
- - `report_outcome` - Report the task `completed` or `blocked`, with a `summary`; ends the turn
182
- (see [Outcomes](#outcomes)).
183
+ - `report_outcome` - Report the task `completed`, `blocked` or `needs_input`, with a `summary`; ends
184
+ the turn (see [Outcomes](#outcomes)).
185
+ - `question` - Ask the user a structured question and wait for the answer, without ending the turn.
186
+ Interactive sessions only; in auto mode an unanswered question is resolved after 15s with the
187
+ away message. Headless (ACP) sessions get an error instead.
183
188
  - `load_skill` - Return a skill's instructions and list its other files; `name`. Offered only
184
189
  when skills were found (see [Skills](#skills)).
185
190
 
@@ -263,7 +268,9 @@ model where it may write.
263
268
 
264
269
  Typing `/` at the prompt lists the commands under it, and each further character narrows the
265
270
  list. Tab completes the command, or the part all matches share. Esc hides the list. The
266
- list is built from the same table as `/help` (`src/commands.rs`).
271
+ list is built from the same table as `/help` (`src/commands.rs`). Commands with a known
272
+ argument set (`/model`, `/mode`, `/verbosity`) get the same treatment for their first
273
+ argument: a type-ahead list narrows as you type and Tab completes it.
267
274
 
268
275
  - `/help` - Show available commands
269
276
  - `/compact [focus]` - Summarize older messages with the current model, keeping the latest
@@ -276,6 +283,7 @@ list is built from the same table as `/help` (`src/commands.rs`).
276
283
  base URL, key source (env var, shell command, or a literal key; the file is then
277
284
  written with mode 0600) and default model
278
285
  - temperature, max tokens, system prompt
286
+ - **Turn cap** (`max_iterations`): LLM calls per input; normal mode asks before stopping
279
287
  - **Context**: auto-compaction on/off, threshold, context-window override
280
288
  - **Verbosity**
281
289
  - **Save to config file**: writes only the keys you changed into the config file
@@ -284,7 +292,11 @@ list is built from the same table as `/help` (`src/commands.rs`).
284
292
  - `/tools` - List registered tools
285
293
  - `/skills` - List the skills the agent can load, where each lives, and any loading warnings
286
294
  - `/plan` - Show the agent's task plan with all notes
287
- - `/model [provider/model]` - Show the current model and pick a new one: scroll the provider list, then the model list (Esc steps back). With an argument, switches directly (conversation is kept)
295
+ - `/model [provider/model]` - Show the current model and pick a new one: scroll the provider list, then the 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`
296
+ - `/mode [normal|plan|auto]` - Show or set the agent mode (Shift+Tab cycles it, at the prompt or mid-turn):
297
+ - **normal** - full tools; reaching the turn cap asks whether to keep going
298
+ - **plan** - read-only: mutating tools (`bash`, `write_file`, `edit_file`) are gated, only analysis and output
299
+ - **auto** - no turn cap; a `question` left unanswered for 15s is answered with "the user is away from the keyboard, make the best decision you can"
288
300
  - `/providers` - List providers, endpoints and whether their API key is available
289
301
  - `/session` - Show the session ID and log path
290
302
  - `/restart` - Start a fresh session (clean context) without exiting
@@ -516,10 +528,10 @@ shows when the message was sent. Turn this off with `timestamps = false`.
516
528
  In an interactive terminal the bottom row shows the provider/model, context usage
517
529
  (`~` marks an estimate; without it the figure is anchored to the provider's reported usage),
518
530
  a fill bar, message count, session input/output tokens, the auto-compaction threshold and
519
- count, and what the agent is doing. With a GitHub Copilot model it also shows the session's
520
- AI Credits (`0.4 AIC`), summed from the `total_nano_aiu` each response reports. It uses a
521
- terminal scroll region, follows resizes, and is
522
- off when stdin/stdout isn't a TTY or `AGENTIC_NO_STATUS` is set. The conversation is kept
531
+ count, the active mode when it is `plan` or `auto` (the default `normal` is not shown, to
532
+ save space), and what the agent is doing. With a GitHub Copilot model it also shows the session's
533
+ AI Credits (`0.4 AIC`), summed from the `total_nano_aiu` each response reports. It uses a terminal
534
+ scroll region, follows resizes, and is off when stdin/stdout isn't a TTY or `AGENTIC_NO_STATUS` is set. The conversation is kept
523
535
  directly above the status line (empty space collects at the top), so shrinking the window
524
536
  drops empty rows rather than pushing the conversation out of view.
525
537
 
@@ -641,16 +653,21 @@ Plan and outcome calls don't count. Set `reminders = false` to turn them off.
641
653
  ## Outcomes
642
654
 
643
655
  `report_outcome` is the model's explicit end-of-task signal: `status` is `completed` (the
644
- whole task is done and checked; the summary lists PRs or commits) or `blocked` (after three
656
+ whole task is done and checked; the summary lists PRs or commits), `blocked` (after three
645
657
  or more different failed attempts, or when only a person can unblock it; the summary says
646
- what is needed). The call ends the turn. Other calls in the same response still run, then the
647
- summary becomes the final answer (`Blocked: ...` for blocked), and the outcome is returned
658
+ what is needed), or `needs_input` (the model has a question or needs a decision; the summary
659
+ is the question). The call ends the turn. Other calls in the same response still run, then the
660
+ summary becomes the final answer (`Blocked: ...` / `Question: ...`), and the outcome is returned
648
661
  in ACP `_meta.outcome` and recorded in the session log's `turn_end` record. If the harness
649
662
  stops after the call but before the turn ends, resuming the input finishes it with the
650
663
  recorded outcome without calling the model again. In the terminal the call shows as
651
- `✔ completed` or `■ blocked` followed by the summary. Set `outcome_tool = false` to leave the
664
+ `✔ completed`, `■ blocked`, or `? needs input` followed by the summary. Set `outcome_tool = false` to leave the
652
665
  tool out.
653
666
 
667
+ `needs_input` is the structural "waiting on the user" signal: an orchestrator (or auto mode)
668
+ can tell it apart from a clean `completed` without guessing from the text. For a richer,
669
+ multi-choice question that does not end the turn, the model uses the `question` tool instead.
670
+
654
671
  ## Sessions
655
672
 
656
673
  When `persist_sessions` is on, each conversation is written to `<session_dir>/<id>.jsonl`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-coder",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "A 6MB coding agent. Run a fleet on your laptop.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "node": ">=18"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@nanobpm/nano-coder-darwin-arm64": "0.11.0",
35
- "@nanobpm/nano-coder-darwin-x64": "0.11.0",
36
- "@nanobpm/nano-coder-linux-arm64": "0.11.0",
37
- "@nanobpm/nano-coder-linux-x64": "0.11.0"
34
+ "@nanobpm/nano-coder-darwin-arm64": "0.13.0",
35
+ "@nanobpm/nano-coder-darwin-x64": "0.13.0",
36
+ "@nanobpm/nano-coder-linux-arm64": "0.13.0",
37
+ "@nanobpm/nano-coder-linux-x64": "0.13.0"
38
38
  }
39
39
  }