@nanobpm/nano-coder 0.40.0 → 0.41.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 +33 -0
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -679,6 +679,39 @@ reaches the wire. The status bar shows
679
679
  `/settings` sets it for the current model, its provider or all models (picking from the
680
680
  levels the model supports), and the session log records it for each reply.
681
681
 
682
+ ### Vision
683
+
684
+ `read_file` returns images (PNG, JPEG, GIF and WebP, recognised by magic bytes) to
685
+ models that can view them: the result is a short text part (`image/png, 1600×900, 131 KB`)
686
+ plus an image attachment the model sees directly. Images over the provider's limits are
687
+ downscaled first (longest side 1568 px, under the model's byte cap), and re-encoded to
688
+ JPEG/PNG when the model doesn't accept the source type. Other binary files still return
689
+ the "looks like a binary file" error, which notes whether the current model supports
690
+ images.
691
+
692
+ Whether a model can see images comes from, in order: a `vision = true|false` override
693
+ (global, `[providers.<name>]`, or `[providers.<name>.models."<model>"]`, like `thinking`);
694
+ what the endpoint reports (GitHub Copilot `/models` `capabilities.supports.vision` and its
695
+ `limits.vision`, Ollama `/api/show`'s `vision` capability, llama.cpp `/props`
696
+ `modalities.vision`); and a built-in assumption for current Anthropic and OpenAI model
697
+ families. A model that can't see images gets the text error with a hint to switch models
698
+ or set `vision = true`:
699
+
700
+ ```toml
701
+ vision = true # all models
702
+
703
+ [providers.ollama.models."my-clip-model"]
704
+ vision = true # this model only
705
+ ```
706
+
707
+ A request carries only the newest few images the model allows (GitHub Copilot's
708
+ `max_prompt_images`, default 1); older ones become `[image omitted: path (sent earlier)]`.
709
+ Each image counts toward the context estimate at a fixed cost from its size, so the status
710
+ bar and auto-compaction stay honest, and compaction replaces images with the same
711
+ placeholder. Images are stored once per session under `<session>.attachments/` (named by
712
+ content hash), so session logs stay small and `--resume` still works; a missing file on
713
+ resume is sent as a text placeholder.
714
+
682
715
  Other per-provider fields: `replay_reasoning`, `max_tokens_param` (`max_tokens`, or `max_completion_tokens`
683
716
  which is the `openai` default), `retry_initial_backoff_ms`, `retry_max_backoff_ms` and
684
717
  `retryable_statuses`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/nano-coder",
3
- "version": "0.40.0",
3
+ "version": "0.41.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.40.0",
35
- "@nanobpm/nano-coder-darwin-x64": "0.40.0",
36
- "@nanobpm/nano-coder-linux-arm64": "0.40.0",
37
- "@nanobpm/nano-coder-linux-x64": "0.40.0"
34
+ "@nanobpm/nano-coder-darwin-arm64": "0.41.0",
35
+ "@nanobpm/nano-coder-darwin-x64": "0.41.0",
36
+ "@nanobpm/nano-coder-linux-arm64": "0.41.0",
37
+ "@nanobpm/nano-coder-linux-x64": "0.41.0"
38
38
  }
39
39
  }