@nanobpm/nano-coder 1.1.0 → 1.2.1
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.
- package/README.md +50 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -499,6 +499,45 @@ compiler can't check are wrapped in small, commented `@trusted` functions (share
|
|
|
499
499
|
uncommented `@trusted`, raw threads or `__gshared` outside `safeio.d`, or more `@trusted` than
|
|
500
500
|
the budgets in `scripts/` allow. The build uses `-preview=dip1000` and `-preview=nosharedaccess`.
|
|
501
501
|
|
|
502
|
+
Time goes through `nano.clock`: `wallNow`, `monoNow`, `since` and `sleepFor` instead of
|
|
503
|
+
`Clock.currTime`, `MonoTime.currTime`, `StopWatch` and `Thread.sleep`, which check-safe bans
|
|
504
|
+
elsewhere. A test can then install a `FakeClock` (per thread) to pick "now" and make sleeps
|
|
505
|
+
instant. Timeouts and grace periods that tests run into are parameters, so a test passes a
|
|
506
|
+
short one rather than waiting out the production value. The test runner
|
|
507
|
+
(`source/nano/testenv_test.d`) fails a module whose tests take over 1 s, unless
|
|
508
|
+
`scripts/slow-tests` gives it a higher limit and a reason; `NANO_TEST_TIMES=N dub test` lists the
|
|
509
|
+
N slowest modules. `NANO_TEST_JOBS=N` runs modules in parallel (`scripts/ci.sh` uses 4); modules
|
|
510
|
+
that change process-wide state (the cancel flag, environment variables) are listed in
|
|
511
|
+
`scripts/serial-tests` and run alone first.
|
|
512
|
+
|
|
513
|
+
Functions are `pure` wherever they can be: the result depends only on the arguments, with no
|
|
514
|
+
clock, environment, files or global state. Modules that start with `pure:` (parsing, markdown,
|
|
515
|
+
plans, context arithmetic, the status line and others) make up a pure core, and the I/O stays
|
|
516
|
+
in their callers. `pure:` doesn't reach member functions, so `source/nano/pure_core_test.d`
|
|
517
|
+
runs a compile-time audit (`nano.pureaudit`) over those modules. check-safe keeps that list in
|
|
518
|
+
step with the `pure:` modules, and the `pure` count and the number of pure modules can only
|
|
519
|
+
grow (`scripts/pure-floor`, `scripts/pure-module-floor`).
|
|
520
|
+
|
|
521
|
+
The pure core is also strongly pure: no public function takes a `ref`, `out` or other mutable
|
|
522
|
+
argument (the audit fails the build on one), so a call can't change what its caller passed.
|
|
523
|
+
Results come back as values, and so do errors: a function that can fail returns
|
|
524
|
+
`nano.result.Result!(T, E)` (`ok`/`err`, `match`, `map`, `andThen`, `toOption`, and
|
|
525
|
+
`orThrow!(e => new X(e))` for the code that still reports errors by throwing). A missing value is
|
|
526
|
+
`Option!T`. Inside the core, only the shell and TOML parsers throw, to unwind to their own entry
|
|
527
|
+
point, which returns the error. Their exception classes are private, and check-safe caps those
|
|
528
|
+
`throw`s (`scripts/pure-throw-budget`).
|
|
529
|
+
|
|
530
|
+
The agent loop is part of that core too. `nano.turn` is a state machine: `step(state, event)`
|
|
531
|
+
returns the next state and a list of effects. Events are what happened (a call is due, the model
|
|
532
|
+
replied, a call failed, tools ran, a Stop hook ran, compaction finished); effects are what to do
|
|
533
|
+
next (call the model, run the tools, continue a cut-off reply, run the Stop hook, finish). Every
|
|
534
|
+
decision in a turn is made in `step`: the turn cap, stream restarts, the output cap, compacting on
|
|
535
|
+
overflow, continuations, steers, Stop hook blocks and reported outcomes. `Agent.runTurn` only
|
|
536
|
+
carries effects out and feeds the results back in. `source/nano/turn_replay_test.d` replays
|
|
537
|
+
session logs through `step` and checks that each turn asks for what the log shows next and ends
|
|
538
|
+
with the recorded answer. Point `NANO_REPLAY_DIR` at a sessions directory to replay all of its
|
|
539
|
+
turns.
|
|
540
|
+
|
|
502
541
|
## Configuration
|
|
503
542
|
|
|
504
543
|
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:
|
|
@@ -1035,6 +1074,17 @@ makes any change, without having to decide to read them. Block-level `<!-- ... -
|
|
|
1035
1074
|
are removed first. Each file is capped at 32 KiB and the total at 64 KiB; a file over the
|
|
1036
1075
|
limit is named, with a note to read it with `read_file`.
|
|
1037
1076
|
|
|
1077
|
+
**Edits take effect at the next turn.** Before each prompt the files are read again. If what
|
|
1078
|
+
they add to the system prompt has changed (a file was edited, added or removed), the system
|
|
1079
|
+
prompt is rebuilt and a dim `[instruction files changed: ...]` line says so, so there's no
|
|
1080
|
+
need to restart and lose the conversation. Resuming a session (`--resume`) also rebuilds it
|
|
1081
|
+
from the current files. The provider's prompt cache misses once, on the turn after a change.
|
|
1082
|
+
Edits to rules scoped with `paths:` and the files they import are picked up too, as are edits
|
|
1083
|
+
to nested directories' files that already attached (including a file added there). After any
|
|
1084
|
+
change, rules and nested files attach afresh the next time a matching file is touched, so one
|
|
1085
|
+
already in the conversation may appear once more, but never in an old version.
|
|
1086
|
+
ACP sessions (`--acp`) still read the files once, when the session starts.
|
|
1087
|
+
|
|
1038
1088
|
**Imports.** `CLAUDE.md`, `CLAUDE.local.md`, rules and imported files can pull in other files
|
|
1039
1089
|
with `@path`, as in Claude Code: relative to the importing file, `~/` allowed, up to four
|
|
1040
1090
|
levels deep, each file once. Code spans and fenced code blocks are skipped, `\ ` escapes a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/nano-coder",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A 4MB coding agent. Run a fleet on your laptop.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"node": ">=18"
|
|
29
29
|
},
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"@nanobpm/nano-coder-darwin-arm64": "1.1
|
|
32
|
-
"@nanobpm/nano-coder-darwin-x64": "1.1
|
|
33
|
-
"@nanobpm/nano-coder-linux-arm64": "1.1
|
|
34
|
-
"@nanobpm/nano-coder-linux-x64": "1.1
|
|
31
|
+
"@nanobpm/nano-coder-darwin-arm64": "1.2.1",
|
|
32
|
+
"@nanobpm/nano-coder-darwin-x64": "1.2.1",
|
|
33
|
+
"@nanobpm/nano-coder-linux-arm64": "1.2.1",
|
|
34
|
+
"@nanobpm/nano-coder-linux-x64": "1.2.1"
|
|
35
35
|
}
|
|
36
36
|
}
|