min-agent 0.6.8 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "min-agent",
3
- "version": "0.6.8",
3
+ "version": "0.7.0",
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,12 @@ 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. 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.
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. While that preset is the active provider it is **locked against edits**: it cannot itself be edited, switched away from, or removed (`min-agent setup --switch/--remove` refuse it), the model list is fixed to `openrouter/free` (never fetched), and only that model can be selected (`/model`, `--model`, chat `model`). But you can **always add** your own provider — `min-agent setup --type …` and the wizard's "添加" entry work even while the preset is active, and once a usable provider exists it takes over automatically (the preset is no longer injected, so the lock lifts). `MIN_AGENT_NO_BUILTIN_PROVIDER=1` disables the fallback entirely.
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. While the preset is active the wizard only shows the locked built-in provider (test connection / done).
93
+ CLI: `min-agent provider` (no args) prints the active provider and the available list; `min-agent provider <name>` switches the active provider (writes global `activeProvider`, clears the project overlay). Add/edit/remove go through `min-agent setup` (interactive wizard or 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.
94
+
95
+ HTTP: `GET /v1/provider` returns `{ active, providers[] }`; `POST /v1/provider` with `{ "provider": "<name>" }` switches (writes global, clears project overlay; no `scope`, since providers are global-only). Missing/empty name → `400 invalid_provider`; unknown name → `404 provider_not_found`.
94
96
 
95
97
  After changing keys or MCP connections, tell the user if a restart is required. Do not print full secrets back in chat.