@nanobpm/nano-coder 0.58.0 → 0.60.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 +38 -5
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -318,9 +318,11 @@ the [permission rules and sandbox](#permissions-and-sandbox) instead.
318
318
 
319
319
  ## Permissions and Sandbox
320
320
 
321
- nano-coder never stops to ask for approval (it runs headless in agent fleets). Every tool call
322
- is checked before it runs instead, and a blocked call returns an error telling the model to
323
- stop and ask the user rather than work around the block.
321
+ Every tool call is checked before it runs, and a blocked call returns an error telling the
322
+ model to stop and ask the user rather than work around the block. Headless runs (agent
323
+ fleets, `-p`, ACP) never stop to ask for approval; an interactive session prompts once for
324
+ the few calls that can be neither approved nor denied automatically (see **Shell loops**
325
+ below).
324
326
 
325
327
  **Order of checks:** `deny` rules, then `allow` rules, then the built-in guards. Deny always
326
328
  wins. An allow rule approves a shell command only when *every* command in it matches, so
@@ -344,6 +346,23 @@ wins. An allow rule approves a shell command only when *every* command in it mat
344
346
  that cannot be parsed, or a script computed at run time (`bash -c "$CMD"`,
345
347
  `eval "$(curl ...)"`), is blocked.
346
348
 
349
+ **Shell loops** (`for`/`select`/`while`/`until`) are checked by effect. A loop whose every
350
+ condition and body command is provably read-only (`echo`, `grep`, `cat`, `wc`, ...) runs
351
+ freely. A `for` loop over a *literal* word list (plain words, quoted strings, brace
352
+ expansions — no globs, substitutions or unknown variables) is unrolled: each value is
353
+ substituted for the loop variable and every resulting body command is checked exactly as if
354
+ written out by hand, so `for q in "a b" "c d"; do gh search repos "$q"; done` is allowed
355
+ wherever the two `gh` commands are, and an unrolled command that is denied or catastrophic
356
+ is denied. The unroll is capped (64 iterations) and refuses a body that rebinds the loop
357
+ variable or still expands something at run time after substitution; those fall through to
358
+ the next rule. A loop that still cannot be verified — a non-literal list, or a static body
359
+ command that is not a known read-only utility — is **asked** about once (showing the whole
360
+ loop) in an interactive session, and blocked with the usual guidance where no one can answer
361
+ (headless `-p`, ACP, a fleet worker). The hard blocks always stand: a command name computed
362
+ at run time, `eval`/interpreters (`sh -c`, `python -c`, ...), path-qualified programs outside
363
+ `/bin`/`/usr/bin`, assignments to `PATH`/`IFS` and other dangerous names, arithmetic-assignment
364
+ tricks, and writes/redirections to computed targets.
365
+
347
366
  **Built-in guards** (`builtin_rules = true`) block:
348
367
 
349
368
  - recursive `rm` (and `mv`, `find -delete`, `chmod -R`/`chown -R`) on `/`, your home directory
@@ -433,7 +452,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
433
452
  - `/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)
434
453
  - `/providers` - List providers, endpoints and whether their API key is available
435
454
  - `/session` - Show the session ID and log path
436
- - `/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
455
+ - `/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
437
456
  - `/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
438
457
  - `/restart` - Start a fresh session (clean context) without exiting
439
458
  - `/update` - Install the latest release through the channel nano-coder was installed from (`npm install -g @nanobpm/nano-coder@latest` or `cargo install nano-coder`), 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 cargo or npm it prints the releases page and changes nothing. Run it at the prompt, not during a turn (see [Updates](#updates))
@@ -1307,9 +1326,23 @@ evidence (a file path or command). Search is a case-insensitive regex
1307
1326
  over the text and the optional evidence, as in `history_search` - no embeddings or vector
1308
1327
  store.
1309
1328
 
1310
- **Tools** (offered when `memory` is on): `memory_save(scope, text, evidence?)`,
1329
+ **Tools** (offered when `memory` is on): `memory_save(scope, text, evidence?, kind?, anchors?)`,
1311
1330
  `memory_search(pattern, scope?)`, `memory_forget(id)`.
1312
1331
 
1332
+ **Recall from tool calls.** Before relying on the model to search, each tool call's arguments
1333
+ are matched (lexically, no model call) against memory *anchors*: backticked spans, path-like
1334
+ tokens and host names in the text and evidence (common commands such as `git` are ignored), or
1335
+ the entry's explicit `anchors` list, which replaces the extracted ones. A match attaches a
1336
+ note to the tool result - `📌 note from an earlier session (verify ...)` with its `check:`
1337
+ command and how long ago it was last used. A `hint` (the default `kind`) is recalled once per
1338
+ context; a `rule` on every match. At most 2 notes are attached per turn. What has been seen is
1339
+ session state (persisted like timers, reset by compaction and new sessions), never stored in
1340
+ the memory file, and a `memory_search` result counts as seen. Recall works in read-only
1341
+ (headless/ACP) sessions too. Each recall, and each recall later followed by a `memory_search`
1342
+ of that memory, is appended to `<memory_dir>/recall.jsonl`; `/memory` shows the counts
1343
+ (`recalled N×, used M×`) so over-broad anchors can be spotted. Entries without `kind`/`anchors`
1344
+ load unchanged.
1345
+
1313
1346
  **Prompt.** A capped, dated index (most-recently-used first, ~4 KB with the guidance) is
1314
1347
  appended to the system prompt at session start, framed as "notes from earlier sessions; may be
1315
1348
  out of date; verify before relying on them". The rest is reachable with `memory_search`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-coder",
3
- "version": "0.58.0",
3
+ "version": "0.60.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.58.0",
31
- "@nanobpm/nano-coder-darwin-x64": "0.58.0",
32
- "@nanobpm/nano-coder-linux-arm64": "0.58.0",
33
- "@nanobpm/nano-coder-linux-x64": "0.58.0"
30
+ "@nanobpm/nano-coder-darwin-arm64": "0.60.0",
31
+ "@nanobpm/nano-coder-darwin-x64": "0.60.0",
32
+ "@nanobpm/nano-coder-linux-arm64": "0.60.0",
33
+ "@nanobpm/nano-coder-linux-x64": "0.60.0"
34
34
  }
35
35
  }