@nanobpm/nano-coder 0.58.1 → 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 +37 -4
  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
@@ -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.1",
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.1",
31
- "@nanobpm/nano-coder-darwin-x64": "0.58.1",
32
- "@nanobpm/nano-coder-linux-arm64": "0.58.1",
33
- "@nanobpm/nano-coder-linux-x64": "0.58.1"
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
  }