min-agent 0.6.9 → 0.7.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 +12 -8
- package/dist/cli.js +208 -204
- package/package.json +1 -1
- package/skills/self-config/SKILL.md +5 -3
package/package.json
CHANGED
|
@@ -80,16 +80,18 @@ Instructions...
|
|
|
80
80
|
|
|
81
81
|
- Rules: edit the files in the table above. `/reload` reloads rules only, not MCP.
|
|
82
82
|
- Memory: **off** by default. Config `memory` is `on` | `off` (`true`/`enable` → on, `false`/`disable` → off). Project overlays global; writing `memory` globally also removes a project `memory` overlay. When off, memories are not injected and `memory_save` / `memory_search` / `memory_delete` are not registered (takes effect next turn after you change the file). CLI `min-agent memory on|off` / `--memory` follow the same write-vs-this-run rule as permission. `/memory on|off` writes **global** by default (and clears a project overlay); `/memory --project` writes only the project file. `/memory` lists the switch plus stored entries; `/memory <text>` still writes `memory.json` even when off. Default save scope is project when `.min-agent/` exists. Shape: `{ "content": string, "tags": string[], "created": ISO string }` array. When on, memories are injected each turn as background reference, not as work to resume. Do not store secrets or API keys. HTTP: `GET/POST /v1/memory/mode`, chat body `memory`, and `GET /v1/memory` include `memory` / `source` / `label`.
|
|
83
|
-
- Permission: `accept-edits` (default) | `ask` | `allow-all` in config `permission`. CLI `min-agent permission …` / `--permission` without a message writes config and exits; with a message it is this session only. `--yes` is this session only and does not write config. `min-agent exec` (one-shot) uses a permissive default when neither `--permission` nor `--yes` is given: file edits and ordinary commands run without asking, and only genuinely destructive commands (deleting files/dirs, `drop`/`truncate`/`delete from`, `mkfs`/`dd`/raw-device writes, `shred`/`wipefs`, `git reset --hard`/`git clean -f`, `docker rm`/`prune`, `find … -delete`/`-exec rm`) still prompt. An explicit `--permission` (or `--yes`) overrides this and behaves exactly as in interactive sessions (`allow-all` runs even destructive commands silently). Confirmation prompts are coalesced: when several actions in one step need approval, a single overlay lists them all and one allow/deny decision applies to the whole batch instead of stacking separate prompts.
|
|
83
|
+
- Permission: `accept-edits` (default) | `ask` | `allow-all` in config `permission`. CLI `min-agent permission …` / `--permission` without a message writes config and exits; with a message it is this session only. `--yes` is this session only and does not write config. `min-agent exec` (one-shot) uses a permissive default when neither `--permission` nor `--yes` is given: file edits and ordinary commands run without asking, and only genuinely destructive commands (deleting files/dirs, `drop`/`truncate`/`delete from`, `mkfs`/`dd`/raw-device writes, `shred`/`wipefs`, `git reset --hard`/`git clean -f`, `docker rm`/`prune`, `find … -delete`/`-exec rm`) still prompt. An explicit `--permission` (or `--yes`) overrides this and behaves exactly as in interactive sessions (`allow-all` runs even destructive commands silently). In `ask` / `accept-edits`, "dangerous commands" that still prompt do NOT include ordinary `git push`, `git stash`/`git stash pop`, `git rebase`, or `chmod` — only their harmful forms count: force pushes (`git push --force`/`-f`/`--force-with-lease`) and `git stash drop`/`git stash clear` (plus `git reset --hard`, `git clean -f`, `git checkout .`, `rm -r/-f`, `sudo`, disk/db operations, etc.). Confirmation prompts are coalesced: when several actions in one step need approval, a single overlay lists them all and one allow/deny decision applies to the whole batch instead of stacking separate prompts.
|
|
84
84
|
- Thinking intensity: `off` | `low` | `medium` | `high` | `max` in config `thinking`. Omit the field to use **medium**, then clamp to levels the current model actually exposes (from the model catalog). `/think` opens an interactive picker of those English levels and writes **global** config; that also clears a project `thinking` overlay so a leftover project `off` cannot hide the new value after restart. `/think --project` writes only the project file. Typed `/think off|low|medium|high|max` still works when the model supports that value. `min-agent think …` / `--think` follow the same write-vs-this-run rule as permission. `xhigh` / `extra-high` / `none` are accepted as aliases (`xhigh` → `max`, `none` → `off`). Each request maps that intensity onto the current model and gateway (MiniMax uses `adaptive`/`disabled`; official OpenAI omits `thinking` and maps `max` to `xhigh`; an `ollama` provider uses native chat with `think` plus the configured window). Learned mappings are cached in `~/.min-agent/thinking-wire-cache.json` for 7 days. Per-model context window and supported effort values are loaded from the model catalog (`https://models.lonae.com`, override with `MIN_AGENT_MODELS_API_URL`) and cached in `~/.min-agent/model-catalog-cache.json` for 7 days after a successful lookup. When the provider host is unknown, effort levels are the majority across offerings that actually list efforts (toggle-only rows do not vote), so a single gateway cannot invent `medium`. An `ollama` provider skips that catalog and uses native `POST /api/show` instead (whether the model advertises thinking, plus the loaded window: Modelfile `num_ctx` if set, otherwise the architecture length capped at 32768). Chat completions are sent to native `POST /api/chat` so `options.num_ctx` and `think` actually apply — the OpenAI-compatible `/v1` endpoint ignores both. `/ctx` opens a picker of `2k` / `4k` / `8k` / `12k` / `16k` / `32k` / `64k` / `128k` / `256k` / `auto` and writes the active provider's `contextWindow` (global only; providers are not in project config). Typed `/ctx 8k` and CLI `min-agent ctx 8k` do the same; `auto` clears the override. The menu item is hidden unless the active provider is ollama. Results are cached in `~/.min-agent/ollama-model-cache.json` for 7 days.
|
|
85
85
|
- Sandbox default is **off**. `mode`: `off` | `workspace` | `strict`. Optional `network`, `extraWriteRoots`, `extraReadRoots`. Isolation is independent of permission. `--sandbox` / `--network` without a message write config and exit.
|
|
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.
|
|
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)
|
|
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.
|