min-agent 0.6.2 → 0.6.3

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/docs/API.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # min-agent HTTP API
2
2
 
3
- `min-agent serve` 启动本地 HTTP 服务,以编程方式调用代理能力。未配置服务商时使用内置 OpenRouter 模型,不必先运行 `min-agent setup`。
3
+ `min-agent serve` 启动本地 HTTP 服务,以编程方式调用代理能力。未配置服务商时使用内置 OpenRouter 模型(`openrouter/free`,预设锁定、不可修改),不必先运行 `min-agent setup`。
4
4
 
5
5
  ## 启动
6
6
 
@@ -118,6 +118,8 @@ CLI 升级请使用 `min-agent update`(执行 `npm install -g min-agent`)。
118
118
  { "default_model": "gpt-4o", "models": ["gpt-4o", "gpt-4o-mini"] }
119
119
  ```
120
120
 
121
+ 当内置 OpenRouter 预设生效时,`models` 固定为 `["openrouter/free"]`(不发网络请求,也不允许其它模型)。
122
+
121
123
  ## `GET /v1/context`
122
124
 
123
125
  ```json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "min-agent",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "description": "Minimal AI coding agent with tool use, MCP, and skills support",
6
6
  "license": "MIT",
@@ -86,10 +86,10 @@ Instructions...
86
86
 
87
87
  ## Providers
88
88
 
89
- Only in global `config.json`: `providers[]` with `name`, `type` (`openai-compatible` | `openai` | `ollama`), `baseURL`, `apiKey`, optional `defaultModel`, `contextWindow`. `activeProvider` selects one. Project config may set `activeProvider` and `defaultModel` (no keys). If `providers` is missing or empty, a built-in OpenRouter provider (`openrouter`, model `openrouter/free`) is used at runtime and is not written to disk. User-configured providers always win. `MIN_AGENT_NO_BUILTIN_PROVIDER=1` disables the fallback.
89
+ Only in global `config.json`: `providers[]` with `name`, `type` (`openai-compatible` | `openai` | `ollama`), `baseURL`, `apiKey`, optional `defaultModel`, `contextWindow`. `activeProvider` selects one. Project config may set `activeProvider` and `defaultModel` (no keys). If `providers` is missing or empty, a built-in OpenRouter provider (`openrouter`, model `openrouter/free`) is used at runtime and is not written to disk. The preset is **locked**: while it is the active provider, `min-agent setup` rejects adding, editing, switching, or removing providers, the model list is fixed to `openrouter/free` (never fetched), and only that model can be selected (`/model`, `--model`, chat `model`). `MIN_AGENT_NO_BUILTIN_PROVIDER=1` disables the fallback — with it set (or once any user provider exists) the lock no longer applies and setup works normally.
90
90
 
91
91
  `/provider` opens an interactive picker and writes **global** `activeProvider`; that also clears a project `activeProvider` overlay so the choice is what later turns use. Typed `/provider <name>` still works. Adding, editing, or removing providers is `min-agent setup` (not the TUI picker).
92
92
 
93
- CLI: `min-agent setup` (interactive wizard or flags). Flags: `--type openai-compatible|openai|ollama`, `--url`, `--api-key`, `--name`, `--default-model`, `--switch <name>`, `--remove <name>`. `--yes` skips overwrite/delete confirmation during setup; it does not change permission. Keys only in the global file.
93
+ CLI: `min-agent setup` (interactive wizard or flags). Flags: `--type openai-compatible|openai|ollama`, `--url`, `--api-key`, `--name`, `--default-model`, `--switch <name>`, `--remove <name>`. `--yes` skips overwrite/delete confirmation during setup; it does not change permission. Keys only in the global file. While the preset is active the wizard only shows the locked built-in provider (test connection / done).
94
94
 
95
95
  After changing keys or MCP connections, tell the user if a restart is required. Do not print full secrets back in chat.
@@ -72,7 +72,7 @@ Read this when you need exact keys. Files are strict JSON.
72
72
  - Old single-provider configs migrate on first run; write the `providers` array for new files.
73
73
  - Interactive and non-interactive provider setup both go through `min-agent setup`. API keys are written only to the global config.
74
74
  - Interactive `/provider` (and typed `/provider <name>`) writes global `activeProvider` and clears a project `activeProvider` overlay. It does not add, edit, or remove providers.
75
- - If `providers` is missing or empty, runtime uses a built-in OpenRouter provider (`name`: `openrouter`, `defaultModel`: `openrouter/free`) without writing it to disk. User entries always win. `MIN_AGENT_NO_BUILTIN_PROVIDER=1` disables that fallback.
75
+ - If `providers` is missing or empty, runtime uses a built-in OpenRouter provider (`name`: `openrouter`, `defaultModel`: `openrouter/free`) without writing it to disk. The preset is locked: while it is the active provider, `min-agent setup` refuses to add/edit/switch/remove providers, the model list is fixed to `openrouter/free` (no network fetch), and selecting any other model (interactive picker, `/model`, `--model`, HTTP chat `model`) is rejected. `MIN_AGENT_NO_BUILTIN_PROVIDER=1` disables the fallback; with the preset disabled or any user provider stored, the lock does not apply and setup works normally.
76
76
 
77
77
  ## Project `.min-agent/config.json`
78
78