@nanobpm/nano-coder 0.35.0 → 0.37.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.
- package/README.md +94 -7
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -345,7 +345,7 @@ model where it may write.
|
|
|
345
345
|
Typing `/` at the prompt lists the commands under it, and each further character narrows the
|
|
346
346
|
list. Tab completes the command, or the part all matches share. Esc hides the list. The
|
|
347
347
|
list is built from the same table as `/help` (`src/commands.rs`). Commands with a known
|
|
348
|
-
argument set (`/model`, `/mode`, `/verbosity`) get the same treatment for their first
|
|
348
|
+
argument set (`/model`, `/mode`, `/verbosity`, `/thinking`) get the same treatment for their first
|
|
349
349
|
argument: a type-ahead list narrows as you type and Tab completes it.
|
|
350
350
|
|
|
351
351
|
- `/help` - Show available commands
|
|
@@ -379,6 +379,7 @@ argument: a type-ahead list narrows as you type and Tab completes it.
|
|
|
379
379
|
- **normal** - full tools; reaching a positive turn cap asks whether to keep going
|
|
380
380
|
- **plan** - read-only: mutating tools (`bash`, `write_file`, `edit_file`) are gated, only analysis and output
|
|
381
381
|
- **auto** - no turn cap; a `question` left unanswered for 15s is answered with "the user is away from the keyboard, make the best decision you can"
|
|
382
|
+
- `/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)
|
|
382
383
|
- `/providers` - List providers, endpoints and whether their API key is available
|
|
383
384
|
- `/session` - Show the session ID and log path
|
|
384
385
|
- `/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
|
|
@@ -508,7 +509,7 @@ Built-in presets:
|
|
|
508
509
|
| `kimi` | openai | `https://api.moonshot.ai/v1` | `MOONSHOT_API_KEY` |
|
|
509
510
|
| `mistral` | openai | `https://api.mistral.ai/v1` | `MISTRAL_API_KEY` |
|
|
510
511
|
| `gemini` | openai | `https://generativelanguage.googleapis.com/v1beta/openai` | `GEMINI_API_KEY` |
|
|
511
|
-
| `qwen` | openai |
|
|
512
|
+
| `qwen` | openai | Model Studio (default: Standard, Singapore — all plans/regions below) | `DASHSCOPE_API_KEY` / `BAILIAN_*_PLAN_API_KEY` |
|
|
512
513
|
| `ollama` | openai | `http://localhost:11434/v1` | — |
|
|
513
514
|
| `llamacpp` | openai | `http://localhost:8080/v1` | — |
|
|
514
515
|
| `github-copilot` | github-copilot | from session token | `GITHUB_COPILOT_OAUTH_TOKEN` or `--login` (unofficial, see below) |
|
|
@@ -546,11 +547,40 @@ timeout_secs = 300 # idle timeout: max silence between stre
|
|
|
546
547
|
max_retries = 3
|
|
547
548
|
```
|
|
548
549
|
|
|
549
|
-
`qwen` is Qwen Cloud (Alibaba Cloud Model Studio), e.g. `--model qwen/qwen3.8-max`.
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
`
|
|
553
|
-
|
|
550
|
+
`qwen` is Qwen Cloud (Alibaba Cloud Model Studio), e.g. `--model qwen/qwen3.8-max`.
|
|
551
|
+
Model Studio serves the same models through three plans, each with its own hostnames and
|
|
552
|
+
API-key variable. All of them speak OpenAI Chat Completions, so each is just a `base_url`
|
|
553
|
+
+ `api_key_env`:
|
|
554
|
+
|
|
555
|
+
| Plan | Region | Base URL | API key env |
|
|
556
|
+
|---|---|---|---|
|
|
557
|
+
| Standard API key | Singapore (International) | `https://dashscope-intl.aliyuncs.com/compatible-mode/v1` | `DASHSCOPE_API_KEY` |
|
|
558
|
+
| Standard API key | China (Beijing) | `https://dashscope.aliyuncs.com/compatible-mode/v1` | `DASHSCOPE_API_KEY` |
|
|
559
|
+
| Standard API key | US (Virginia) | `https://dashscope-us.aliyuncs.com/compatible-mode/v1` | `DASHSCOPE_API_KEY` |
|
|
560
|
+
| Standard API key | China (Hong Kong) | `https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1` | `DASHSCOPE_API_KEY` |
|
|
561
|
+
| Token Plan | Singapore (International) | `https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1` | `BAILIAN_TOKEN_PLAN_API_KEY` |
|
|
562
|
+
| Token Plan | China (Beijing) | `https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1` | `BAILIAN_TOKEN_PLAN_API_KEY` |
|
|
563
|
+
| Coding Plan | Singapore (International) | `https://coding-intl.dashscope.aliyuncs.com/v1` | `BAILIAN_CODING_PLAN_API_KEY` |
|
|
564
|
+
| Coding Plan | China (Beijing) | `https://coding.dashscope.aliyuncs.com/v1` | `BAILIAN_CODING_PLAN_API_KEY` |
|
|
565
|
+
|
|
566
|
+
The `qwen` preset defaults to **Standard API key, Singapore** (the first row). In
|
|
567
|
+
`/settings` → *Add or edit a provider* → `qwen` these eight endpoints are offered as a
|
|
568
|
+
*Qwen / Model Studio endpoint* picker (plus a custom URL), so you can switch plan and
|
|
569
|
+
region without retyping a URL. Picking a plan also points the provider at that plan's
|
|
570
|
+
API-key variable — the preset's `DASHSCOPE_API_KEY` becomes `BAILIAN_TOKEN_PLAN_API_KEY`
|
|
571
|
+
for Token Plan, and `BAILIAN_CODING_PLAN_API_KEY` for Coding Plan. Set the variable (or a
|
|
572
|
+
key command / literal key) at the key prompt that follows. API keys are also bound to a
|
|
573
|
+
*region*, so a key issued for another region still needs the matching endpoint row.
|
|
574
|
+
|
|
575
|
+
To configure an endpoint in the config file directly, override `base_url` and
|
|
576
|
+
`api_key_env` (append `/compatible-mode/v1` to a workspace domain, e.g.
|
|
577
|
+
`https://<WorkspaceId>.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1`):
|
|
578
|
+
|
|
579
|
+
```toml
|
|
580
|
+
[providers.qwen] # Token Plan, China
|
|
581
|
+
base_url = "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
|
|
582
|
+
api_key_env = "BAILIAN_TOKEN_PLAN_API_KEY"
|
|
583
|
+
```
|
|
554
584
|
|
|
555
585
|
`kimi` is the Kimi API from platform.kimi.ai, e.g. `--model kimi/kimi-k3` or
|
|
556
586
|
`kimi/kimi-k2.7-code`. The preset drops `temperature` (K3 fixes it) and sets
|
|
@@ -582,6 +612,63 @@ top-level `temperature` just doesn't apply to them. Anthropic accepts 0 to 1, so
|
|
|
582
612
|
value is sent as 1, with a warning. `/context` shows the temperature in use and where it
|
|
583
613
|
comes from, and `/settings` edits it for the current model, its provider, or all models.
|
|
584
614
|
|
|
615
|
+
### Thinking
|
|
616
|
+
|
|
617
|
+
`thinking` sets how much the model reasons before it answers: `"default"` sends nothing
|
|
618
|
+
(the model decides), `"off"` turns thinking off, and a level such as `"low"`, `"medium"`,
|
|
619
|
+
`"high"`, `"xhigh"` or `"max"` asks for that much. Like `temperature`, it can be set for all
|
|
620
|
+
models, one provider or one model, and `/thinking LEVEL` overrides them for the session:
|
|
621
|
+
|
|
622
|
+
```toml
|
|
623
|
+
thinking = "medium" # all models that support it
|
|
624
|
+
|
|
625
|
+
[providers.anthropic.models."claude-opus-4-7"]
|
|
626
|
+
thinking = "xhigh" # this model only
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
A model only gets levels it supports. They come from, in order: `thinking_levels` on the
|
|
630
|
+
model or provider; what the endpoint reports for the model; and a built-in table
|
|
631
|
+
of Claude (3.7 Sonnet and later) and OpenAI reasoning models (GPT-5 and later, o1/o3/o4).
|
|
632
|
+
Endpoints that report levels:
|
|
633
|
+
|
|
634
|
+
- **GitHub Copilot:** `/models` lists each model's levels, read with the same request as its
|
|
635
|
+
context window.
|
|
636
|
+
- **Ollama:** a model with the `thinking` capability (`/api/show`) gets `off`, `low`,
|
|
637
|
+
`medium` and `high`. Ollama refuses a level for a model without it, so none is sent then.
|
|
638
|
+
- **llama.cpp:** the loaded model's chat template (`/props`) decides. A template with an
|
|
639
|
+
`enable_thinking` switch (Qwen 3 and the like) gets `off` and `on`, and any named level
|
|
640
|
+
turns thinking on; a template that takes `reasoning_effort` (gpt-oss) gets `low`, `medium`
|
|
641
|
+
and `high`.
|
|
642
|
+
|
|
643
|
+
Ollama and llama.cpp are recognized however the provider is named, the same way as for the
|
|
644
|
+
context window. For other models, list the levels yourself:
|
|
645
|
+
|
|
646
|
+
```toml
|
|
647
|
+
[providers.together.models."deepseek-r1"]
|
|
648
|
+
thinking_levels = ["low", "medium", "high"] # add "off" if thinking can be turned off
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
A level the model lacks is moved to the nearest one it has (the highest below it, else the
|
|
652
|
+
lowest), and a model with no known levels is sent nothing. A setting for the provider, the
|
|
653
|
+
model or the session warns when it is adjusted or ignored; the top-level `thinking` doesn't
|
|
654
|
+
warn, since it applies to every model.
|
|
655
|
+
|
|
656
|
+
How the level is sent depends on the API: `reasoning_effort` (Chat Completions, Ollama
|
|
657
|
+
included; Ollama ignores its native `think` flag on `/v1`), `chat_template_kwargs` for
|
|
658
|
+
llama.cpp (`enable_thinking`, or `reasoning_effort` for templates that take a level; it
|
|
659
|
+
ignores the top-level `reasoning_effort`),
|
|
660
|
+
`reasoning.effort` (Responses), and for Anthropic Messages adaptive thinking with
|
|
661
|
+
`output_config.effort`, or on Claude 3.7 to 4.5 a fixed `budget_tokens` (1024 for minimal, then
|
|
662
|
+
2048, 8192, 16384, 32768, 65536 up to max). The budget has to stay below `max_tokens`, so raise
|
|
663
|
+
`max_tokens` to use a large one. Anthropic takes no custom temperature while thinking, so
|
|
664
|
+
none is sent then. A matching key in the provider's `extra_body` (`reasoning_effort`, `reasoning`,
|
|
665
|
+
`think`, `chat_template_kwargs`, `thinking`, `output_config`) is sent instead, with a warning; the
|
|
666
|
+
configured level is then reported as overridden (not as sent), since the override's value is what
|
|
667
|
+
reaches the wire. The status bar shows
|
|
668
|
+
`think LEVEL` while a level is sent, `/context` shows it with where it comes from,
|
|
669
|
+
`/settings` sets it for the current model, its provider or all models (picking from the
|
|
670
|
+
levels the model supports), and the session log records it for each reply.
|
|
671
|
+
|
|
585
672
|
Other per-provider fields: `replay_reasoning`, `max_tokens_param` (`max_tokens`, or `max_completion_tokens`
|
|
586
673
|
which is the `openai` default), `retry_initial_backoff_ms`, `retry_max_backoff_ms` and
|
|
587
674
|
`retryable_statuses`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/nano-coder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.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.
|
|
35
|
-
"@nanobpm/nano-coder-darwin-x64": "0.
|
|
36
|
-
"@nanobpm/nano-coder-linux-arm64": "0.
|
|
37
|
-
"@nanobpm/nano-coder-linux-x64": "0.
|
|
34
|
+
"@nanobpm/nano-coder-darwin-arm64": "0.37.0",
|
|
35
|
+
"@nanobpm/nano-coder-darwin-x64": "0.37.0",
|
|
36
|
+
"@nanobpm/nano-coder-linux-arm64": "0.37.0",
|
|
37
|
+
"@nanobpm/nano-coder-linux-x64": "0.37.0"
|
|
38
38
|
}
|
|
39
39
|
}
|