@nanobpm/nano-coder 0.30.1 → 0.32.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 +55 -1
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -165,6 +165,7 @@ src/
165
165
  ├── plan.rs # Task plan and the plan_add / plan_update / plan_show tools
166
166
  ├── queue.rs # The interactive message queue and the /queue editor
167
167
  ├── goal.rs # report_outcome tool (completed / blocked / needs_input)
168
+ ├── memory.rs # Cross-session memory: memory_save / memory_search / memory_forget
168
169
  ├── mode.rs # Agent mode (normal / plan / auto) and the plan-mode tool gate
169
170
  ├── question.rs # question tool and the mid-turn question / turn-cap rendezvous
170
171
  ├── commands.rs # Slash-command table for /help and the as-you-type menu
@@ -218,6 +219,9 @@ The harness exposes 6 lifecycle hook events:
218
219
  away message. Headless (ACP) sessions get an error instead.
219
220
  - `load_skill` - Return a skill's instructions and list its other files; `name`. Offered only
220
221
  when skills were found (see [Skills](#skills)).
222
+ - `memory_save`, `memory_search`, `memory_forget` - Cross-session memory: facts the model saves
223
+ in one session and finds in later ones (see [Memory](#memory)). Offered when `memory` is on;
224
+ read-only runs (headless/ACP) offer `memory_search` only.
221
225
 
222
226
  Any other tool's result longer than 40,000 characters is cut the same way as bash output,
223
227
  with the whole result saved under the temp directory (`nano-coder-<pid>/tool-<id>-<name>.txt`)
@@ -326,6 +330,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
326
330
  - `/tools` - List registered tools
327
331
  - `/skills` - List the skills the agent can load, where each lives, and any loading warnings
328
332
  - `/plan` - Show the agent's task plan with all notes
333
+ - `/memory [forget ID]` - List cross-session memories with their ids, or delete one by id (see [Memory](#memory))
329
334
  - `/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.
330
335
  - `/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`
331
336
  - `/mode [normal|plan|auto]` - Show or set the agent mode (Shift+Tab cycles it, at the prompt or mid-turn):
@@ -364,7 +369,7 @@ and `cargo test`; CI checks all three. To keep `git blame` past the one-time ref
364
369
 
365
370
  ## Configuration
366
371
 
367
- Create `~/.config/nano-coder/config.toml` (every field is optional). Directories from before the rename (`agentic-harness`) are still used if the new ones don't exist:
372
+ Create `~/.config/nano-coder/config.toml` (every field is optional). Directories from before the rename (`agentic-harness`, for config and for data such as sessions) are moved to `nano-coder` at startup when the new ones don't exist yet. A symlink is left at the old path so an older nano-coder still finds them. If that compatibility symlink can't be created, a warning is printed and the link is retried on later starts; if the move itself fails, the old directory is used:
368
373
 
369
374
  ```toml
370
375
  model = "anthropic/claude-sonnet-4-5" # provider/model
@@ -388,6 +393,9 @@ project_instruction_files = ["AGENTS.md", "CLAUDE.md", ".github/copilot-instruct
388
393
  plan_tools = true # offer the plan_* tools (see Task Plans)
389
394
  outcome_tool = true # offer report_outcome (see Outcomes)
390
395
  reminders = true # append <system-reminder> notes to tool results
396
+ memory = "on" # on | read_only | off — cross-session memory (see Memory)
397
+ # memory_dir = "/path/to/memory" # default: <platform data dir>/nano-coder/memory
398
+ memory_expiry_days = 90 # expire memories unused this long (0 = never)
391
399
 
392
400
  [skills] # see Skills
393
401
  enabled = true
@@ -813,6 +821,52 @@ tool out.
813
821
  can tell it apart from a clean `completed` without guessing from the text. For a richer,
814
822
  multi-choice question that does not end the turn, the model uses the `question` tool instead.
815
823
 
824
+ ## Memory
825
+
826
+ Cross-session memory lets the model save a fact in one session and find it in later ones, so
827
+ a project's quirks and the machine's setup are not rediscovered every time ("tests run with
828
+ `cargo test`, not `make test`"; "Python comes from `uv`"). A memory is a **hint to verify, not
829
+ a rule**: entries are dated, framed in the prompt as possibly out of date, shown in the
830
+ transcript when saved, undoable with `/memory`, and never grant any permission.
831
+
832
+ Two scopes:
833
+
834
+ - `user` - the machine and your habits (toolchains, auth, preferences).
835
+ - `project` - keyed by the git remote (fallback: the git root path); this repo's quirks and
836
+ setup. Unavailable outside a git repository.
837
+
838
+ Storage mirrors the session log's format but not its write pattern: each scope is a JSONL
839
+ file, one entry per line, under `<memory_dir>/user.jsonl` and `<memory_dir>/projects/<key>.jsonl`
840
+ (default `<data>/memory`, next to `sessions/`). Every save, matching search, expiry prune, and
841
+ forget **atomically rewrites** the complete scope (write a sibling temp file, then rename) rather
842
+ than appending, so do not infer session-log-style append behaviour or append-write performance.
843
+ Each entry has an id, the text, created and last-used dates, the source session, and optional
844
+ evidence (a file path or command). Search is a case-insensitive regex
845
+ over the text and the optional evidence, as in `history_search` - no embeddings or vector
846
+ store.
847
+
848
+ **Tools** (offered when `memory` is on): `memory_save(scope, text, evidence?)`,
849
+ `memory_search(pattern, scope?)`, `memory_forget(id)`.
850
+
851
+ **Prompt.** A capped, dated index (most-recently-used first, ~3 KB) is appended to the system
852
+ prompt at session start, framed as "notes from earlier sessions; may be out of date; verify
853
+ before relying on them". The rest is reachable with `memory_search`.
854
+
855
+ **Control and hygiene.**
856
+
857
+ - Each save is confirmed to the model (`remembered (scope, id): ...`), so it shows in the
858
+ transcript. `/memory` lists every entry with its id; `/memory forget <id>` deletes one; the
859
+ files are human-readable and can be edited directly.
860
+ - Obvious secrets (keys, tokens, passwords, `.env`-style assignments, private-key blocks) are
861
+ rejected on save - store where to find them instead.
862
+ - Using an entry (a `memory_search` match) in a writable session bumps its last-used date;
863
+ read-only and Plan-mode searches never bump it. Entries unused for
864
+ `memory_expiry_days` (default 90; `0` disables) expire on the next load.
865
+ - Memories never touch the permission rules.
866
+
867
+ Set `memory = "on"` (full), `"read_only"` (index and `memory_search` only), or `"off"`.
868
+ Headless/ACP runs downgrade `on` to `read_only` by default, since no human vets a save live.
869
+
816
870
  ## Sessions
817
871
 
818
872
  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.30.1",
3
+ "version": "0.32.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.30.1",
35
- "@nanobpm/nano-coder-darwin-x64": "0.30.1",
36
- "@nanobpm/nano-coder-linux-arm64": "0.30.1",
37
- "@nanobpm/nano-coder-linux-x64": "0.30.1"
34
+ "@nanobpm/nano-coder-darwin-arm64": "0.32.0",
35
+ "@nanobpm/nano-coder-darwin-x64": "0.32.0",
36
+ "@nanobpm/nano-coder-linux-arm64": "0.32.0",
37
+ "@nanobpm/nano-coder-linux-x64": "0.32.0"
38
38
  }
39
39
  }