@nanobpm/nano-coder 0.32.1 → 0.34.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 +29 -1
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -155,6 +155,8 @@ src/
155
155
  ├── sandbox.rs # Seatbelt (macOS) / Landlock (Linux) sandbox for shell commands
156
156
  ├── output.rs # Head/tail output bounding, spilling long output to disk
157
157
  ├── session.rs # Versioned append-only JSONL session log
158
+ ├── session_index.rs # Session summaries (.index.jsonl) for the --resume picker
159
+ ├── resume.rs # --resume picker, --resume last, --list-sessions
158
160
  ├── context.rs # Token accounting, context-window heuristics, overflow detection
159
161
  ├── status.rs # Bottom-of-terminal status line
160
162
  ├── ui.rs # Verbosity levels and the streaming output renderer
@@ -340,6 +342,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
340
342
  - `/providers` - List providers, endpoints and whether their API key is available
341
343
  - `/session` - Show the session ID and log path
342
344
  - `/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
345
+ - `/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
343
346
  - `/restart` - Start a fresh session (clean context) without exiting
344
347
  - `/exit` - Exit the agent (prints the session's `--resume` command first, when session persistence is enabled)
345
348
 
@@ -357,9 +360,32 @@ cargo run
357
360
  cargo run -- --model anthropic/claude-sonnet-4-5
358
361
  cargo run -- --model ollama/qwen2.5:1.5b
359
362
  cargo run -- --resume sess-20260923T012518-7e7923f8
363
+ cargo run -- --resume # pick a session
364
+ cargo run -- --resume last # the most recent session in this directory
360
365
  ```
361
366
 
362
- Flags: `--login github-copilot`, `--list-models PROVIDER`, `--trajectory SESSION_ID [--json|--markdown]`, `--acp`, `--model provider/model` (or `AGENTIC_HARNESS_MODEL`), `--resume SESSION_ID`,
367
+ **Resuming.** `--resume` without an ID opens a picker of this directory's saved sessions, most
368
+ recently used first. Each row shows when the session was last used, its project (the last part of
369
+ its directory), how many prompts it has, and its last prompt. When the last prompt says little
370
+ ("do it"), the row also shows the more telling prompt before it. Type to filter, Enter to resume,
371
+ Esc to cancel. The last entry shows sessions from every directory. At the prompt, `/resume` does the same without restarting. Sessions with no prompts are
372
+ left out. Sessions from before this feature don't record their directory: they are shown in every
373
+ directory, with `?` as the project. Without a terminal, `--resume` prints the list and exits.
374
+ `--list-sessions [--all] [--json]` prints the list for scripts (`--all`: every directory).
375
+
376
+ The picker reads `.index.jsonl` in the session directory: one summary per session, updated at the
377
+ end of each turn. It is only a cache. A session that is missing from it, or whose log changed
378
+ since it was indexed, is summarized from its log again, and deleting the file rebuilds it.
379
+
380
+ **Titles.** With `session_titles = true`, once a session has a prompt that says something (not
381
+ just "hi"), nano-coder asks the model for a title of at most six words in the background. It uses
382
+ `title_model` (a cheap one is enough) or the session's model. The request is a few hundred tokens,
383
+ tried at most once per session per run (so a failed or deleted title is retried after a restart,
384
+ not on the next turn). The picker then shows `title · last prompt`. Titles live only in the index,
385
+ so older nano-coders can still read the logs. Deleting `index.jsonl` loses them; a new run then
386
+ asks again on the session's next turn.
387
+
388
+ Flags: `--login github-copilot`, `--list-models PROVIDER`, `--trajectory SESSION_ID [--json|--markdown]`, `--acp`, `--model provider/model` (or `AGENTIC_HARNESS_MODEL`), `--resume [SESSION_ID|last]`, `--list-sessions [--all] [--json]`,
363
389
  `--config PATH`, `--verbosity LEVEL` (`-v`), `--sandbox off|workspace|read-only` (or `NANO_CODER_SANDBOX`),
364
390
  `--allow RULE` and `--deny RULE` (repeatable; added to the config's rules), `--version` (`-V`).
365
391
 
@@ -381,6 +407,8 @@ system_prompt = "You are a helpful assistant with access to tools."
381
407
  bash_timeout_secs = 600
382
408
  persist_sessions = true
383
409
  # session_dir = "/path/to/sessions" # default: <platform data dir>/nano-coder/sessions
410
+ session_titles = false # ask the model for a few-word title per session (--resume picker)
411
+ # title_model = "openai/gpt-4o-mini" # model for titles (default: the session's model)
384
412
  auto_compact = true # summarize automatically when the context fills up
385
413
  auto_compact_threshold = 0.8 # fraction of the context window
386
414
  compaction_mode = "standard" # standard | smart (experimental, see Smart compaction)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-coder",
3
- "version": "0.32.1",
3
+ "version": "0.34.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.32.1",
35
- "@nanobpm/nano-coder-darwin-x64": "0.32.1",
36
- "@nanobpm/nano-coder-linux-arm64": "0.32.1",
37
- "@nanobpm/nano-coder-linux-x64": "0.32.1"
34
+ "@nanobpm/nano-coder-darwin-arm64": "0.34.0",
35
+ "@nanobpm/nano-coder-darwin-x64": "0.34.0",
36
+ "@nanobpm/nano-coder-linux-arm64": "0.34.0",
37
+ "@nanobpm/nano-coder-linux-x64": "0.34.0"
38
38
  }
39
39
  }