min-agent 0.5.0 → 0.6.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 +32 -18
- package/dist/cli.js +538 -12
- package/docs/API.md +25 -8
- package/package.json +6 -6
- package/skills/self-config/SKILL.md +7 -3
- package/skills/self-config/reference.md +8 -4
- package/dist/agent.js +0 -1342
- package/dist/assistant-stream.js +0 -131
- package/dist/cli/commands/chat.js +0 -13
- package/dist/cli/commands/exec.js +0 -35
- package/dist/cli/commands/history.js +0 -58
- package/dist/cli/commands/index.js +0 -241
- package/dist/cli/commands/init.js +0 -18
- package/dist/cli/commands/mcp.js +0 -173
- package/dist/cli/commands/memory.js +0 -87
- package/dist/cli/commands/models.js +0 -21
- package/dist/cli/commands/permission.js +0 -12
- package/dist/cli/commands/rules.js +0 -33
- package/dist/cli/commands/sandbox.js +0 -13
- package/dist/cli/commands/serve.js +0 -9
- package/dist/cli/commands/setup.js +0 -4
- package/dist/cli/commands/shared.js +0 -16
- package/dist/cli/commands/skills.js +0 -119
- package/dist/cli/commands/think.js +0 -12
- package/dist/cli/commands/update.js +0 -7
- package/dist/cli/commands/write-config.js +0 -52
- package/dist/cli/errors.js +0 -36
- package/dist/cli/exec-prompt.js +0 -26
- package/dist/cli/option-helpers.js +0 -65
- package/dist/cli/program.js +0 -217
- package/dist/clipboard.js +0 -142
- package/dist/code-mode.js +0 -184
- package/dist/compaction.js +0 -644
- package/dist/config.js +0 -470
- package/dist/confirm.js +0 -172
- package/dist/context-window.js +0 -246
- package/dist/doom-loop.js +0 -278
- package/dist/fetch-timeout.js +0 -152
- package/dist/http-approvals.js +0 -60
- package/dist/http.js +0 -119
- package/dist/instructions.js +0 -196
- package/dist/logger.js +0 -95
- package/dist/markdown.js +0 -259
- package/dist/mcp.js +0 -1036
- package/dist/memory-cli.js +0 -33
- package/dist/memory.js +0 -295
- package/dist/model-catalog.js +0 -285
- package/dist/output.js +0 -76
- package/dist/paste-handler.js +0 -41
- package/dist/permission-cli.js +0 -40
- package/dist/plugins.js +0 -131
- package/dist/pricing.js +0 -119
- package/dist/provider.js +0 -63
- package/dist/question-format.js +0 -60
- package/dist/reasoning-stream.js +0 -158
- package/dist/sandbox-cli.js +0 -79
- package/dist/sandbox.js +0 -403
- package/dist/save-throttle.js +0 -45
- package/dist/scope.js +0 -23
- package/dist/serve/common.js +0 -425
- package/dist/serve/routes-chat.js +0 -367
- package/dist/serve/routes-mcp.js +0 -212
- package/dist/serve/routes-memory.js +0 -95
- package/dist/serve/routes-meta.js +0 -233
- package/dist/serve/routes-sessions.js +0 -61
- package/dist/serve/routes-skills.js +0 -70
- package/dist/serve.js +0 -138
- package/dist/sessions.js +0 -265
- package/dist/skills.js +0 -599
- package/dist/structured-output.js +0 -29
- package/dist/synthetic.js +0 -7
- package/dist/think-cli.js +0 -36
- package/dist/thinking-wire.js +0 -228
- package/dist/thinking.js +0 -142
- package/dist/title-gen.js +0 -55
- package/dist/token-display.js +0 -39
- package/dist/tool-display.js +0 -178
- package/dist/tool-output.js +0 -126
- package/dist/tools/apply_patch.js +0 -265
- package/dist/tools/atomic-file.js +0 -35
- package/dist/tools/backend.js +0 -61
- package/dist/tools/bash.js +0 -231
- package/dist/tools/code_search.js +0 -98
- package/dist/tools/edit.js +0 -68
- package/dist/tools/explore.js +0 -232
- package/dist/tools/glob.js +0 -40
- package/dist/tools/grep.js +0 -174
- package/dist/tools/index.js +0 -34
- package/dist/tools/question.js +0 -54
- package/dist/tools/read.js +0 -109
- package/dist/tools/search-searxng.js +0 -223
- package/dist/tools/search-serper.js +0 -189
- package/dist/tools/task.js +0 -165
- package/dist/tools/todo.js +0 -213
- package/dist/tools/web_fetch.js +0 -195
- package/dist/tools/web_search.js +0 -228
- package/dist/tools/write.js +0 -55
- package/dist/tui/App.js +0 -126
- package/dist/tui/ConfirmBar.js +0 -66
- package/dist/tui/InputBar.js +0 -616
- package/dist/tui/MessageList.js +0 -718
- package/dist/tui/ModelPicker.js +0 -113
- package/dist/tui/QuestionBar.js +0 -136
- package/dist/tui/SessionPicker.js +0 -79
- package/dist/tui/Spinner.js +0 -6
- package/dist/tui/StatusBar.js +0 -22
- package/dist/tui/ThinkPicker.js +0 -77
- package/dist/tui/agent-runner.js +0 -223
- package/dist/tui/bracketed-paste.js +0 -37
- package/dist/tui/caret-pos.js +0 -179
- package/dist/tui/caret.js +0 -69
- package/dist/tui/click-count.js +0 -13
- package/dist/tui/diff-view.js +0 -61
- package/dist/tui/drag-state.js +0 -49
- package/dist/tui/hydrate.js +0 -129
- package/dist/tui/index.js +0 -258
- package/dist/tui/input-history.js +0 -125
- package/dist/tui/layout.js +0 -105
- package/dist/tui/mouse.js +0 -46
- package/dist/tui/overlay-input.js +0 -12
- package/dist/tui/paste-draft.js +0 -173
- package/dist/tui/prompt-queue.js +0 -24
- package/dist/tui/selection.js +0 -232
- package/dist/tui/session-switch.js +0 -28
- package/dist/tui/slash-commands.js +0 -123
- package/dist/tui/slash-handler.js +0 -589
- package/dist/tui/text-width.js +0 -113
- package/dist/tui/theme.js +0 -12
- package/dist/tui/token-info.js +0 -7
- package/dist/tui/tool-children.js +0 -19
- package/dist/tui/types.js +0 -1
- package/dist/tui/undo-stack.js +0 -14
- package/dist/tui/use-sgr-mouse.js +0 -29
- package/dist/tui-chat.js +0 -456
- package/dist/updater.js +0 -116
- package/dist/xml-search.js +0 -194
- package/docs/superpowers/plans/2026-08-16-batch1-tui-improvements.md +0 -1510
- package/docs/superpowers/plans/2026-08-16-batch2-cli-tools-api.md +0 -2105
- package/docs/superpowers/plans/2026-08-16-batch3-config-engineering.md +0 -1595
- package/docs/superpowers/plans/2026-08-16-input-caret.md +0 -782
- package/docs/superpowers/plans/2026-08-20-tui-completeness.md +0 -873
- package/docs/superpowers/plans/2026-08-20-unified-tui-default.md +0 -631
- package/docs/superpowers/plans/2026-08-23-input-paste-attachments.md +0 -475
- package/docs/superpowers/plans/2026-08-23-thinking-wire-profile.md +0 -450
- package/docs/superpowers/specs/2026-08-16-batch1-tui-improvements-design.md +0 -183
- package/docs/superpowers/specs/2026-08-16-batch2-cli-tools-api-design.md +0 -220
- package/docs/superpowers/specs/2026-08-16-batch3-config-engineering-design.md +0 -196
- package/docs/superpowers/specs/2026-08-16-input-caret-design.md +0 -63
- package/docs/superpowers/specs/2026-08-17-mouse-selection-design.md +0 -116
- package/docs/superpowers/specs/2026-08-20-config-http-alignment-design.md +0 -47
- package/docs/superpowers/specs/2026-08-20-mcp-plugins-alignment-design.md +0 -37
- package/docs/superpowers/specs/2026-08-20-sandbox-permissions-design.md +0 -68
- package/docs/superpowers/specs/2026-08-20-tui-completeness-design.md +0 -273
- package/docs/superpowers/specs/2026-08-20-unified-tui-default-design.md +0 -165
- package/docs/superpowers/specs/2026-08-23-input-paste-attachments-design.md +0 -174
- package/docs/superpowers/specs/2026-08-23-thinking-wire-profile-design.md +0 -140
package/docs/API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# min-agent HTTP API
|
|
2
2
|
|
|
3
|
-
`min-agent serve` 启动本地 HTTP
|
|
3
|
+
`min-agent serve` 启动本地 HTTP 服务,以编程方式调用代理能力。未配置服务商时使用内置 OpenRouter 模型,不必先运行 `min-agent setup`。
|
|
4
4
|
|
|
5
5
|
## 启动
|
|
6
6
|
|
|
@@ -33,6 +33,7 @@ min-agent serve --host 0.0.0.0 --port 3000
|
|
|
33
33
|
| GET | `/v1/update` | 检查 npm 是否有新版本(不执行安装) |
|
|
34
34
|
| GET | `/v1/models` | 模型列表 |
|
|
35
35
|
| GET | `/v1/context` | 上下文窗口信息 |
|
|
36
|
+
| POST | `/v1/context` | 设置本地模型上下文档位 |
|
|
36
37
|
| GET | `/v1/project` | 项目扫描 |
|
|
37
38
|
| POST | `/v1/chat` | 对话(项目感知) |
|
|
38
39
|
| POST | `/v1/code` | 与 `/v1/chat` 相同(兼容路径) |
|
|
@@ -90,7 +91,7 @@ min-agent serve --host 0.0.0.0 --port 3000
|
|
|
90
91
|
## `GET /v1/meta`
|
|
91
92
|
|
|
92
93
|
```json
|
|
93
|
-
{ "version": "0.1.0", "cwd": "/path/to/project", "instructions_chars": 1234, "sandbox": { "mode": "off", "network": "allow", "extraWriteRoots": [], "extraReadRoots": [], "source": null, "label": "未隔离,允许联网" }, "permission": { "permission": "
|
|
94
|
+
{ "version": "0.1.0", "cwd": "/path/to/project", "instructions_chars": 1234, "sandbox": { "mode": "off", "network": "allow", "extraWriteRoots": [], "extraReadRoots": [], "source": null, "label": "未隔离,允许联网" }, "permission": { "permission": "accept-edits", "source": null, "label": "accept edits" }, "thinking": { "thinking": "medium", "source": null, "label": "medium" }, "memory": { "memory": "off", "source": null, "label": "off" } }
|
|
94
95
|
```
|
|
95
96
|
|
|
96
97
|
## `GET /v1/update`
|
|
@@ -118,10 +119,26 @@ CLI 升级请使用 `min-agent update`(执行 `npm install -g min-agent`)。
|
|
|
118
119
|
## `GET /v1/context`
|
|
119
120
|
|
|
120
121
|
```json
|
|
121
|
-
{ "context_window": 1000000, "source": "config", "model": "gpt-4o" }
|
|
122
|
+
{ "context_window": 1000000, "source": "config", "model": "gpt-4o", "configurable": false, "level": null }
|
|
122
123
|
```
|
|
123
124
|
|
|
124
|
-
`source` 为 `config`(配置中的 `contextWindow`)、`detected`(从接口读到)或 `fallback
|
|
125
|
+
`source` 为 `config`(配置中的 `contextWindow`)、`detected`(从接口读到)或 `fallback`(未读到:Ollama 按 2048,其余按 512k)。Ollama 的 detected 值是运行时窗口(优先 Modelfile `num_ctx`,否则不超过 32768),不是架构标称上限。对话请求走原生 `/api/chat` 并带上该窗口;只改 OpenAI 兼容接口的 `num_ctx` 不会生效。
|
|
126
|
+
|
|
127
|
+
当前为 Ollama 时额外返回 `configurable: true` 与 `level`(`2k`…`256k` 或 `auto`)。其它 provider 为 `configurable: false`、`level: null`。
|
|
128
|
+
|
|
129
|
+
## `POST /v1/context`
|
|
130
|
+
|
|
131
|
+
仅 Ollama provider。将当前 provider 的 `contextWindow` 写成对应档位;`auto` 删除覆盖,回到探测值。
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{ "level": "8k" }
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{ "ok": true, "context_window": 8192, "source": "config", "model": "qwen3:4b", "configurable": true, "level": "8k" }
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
非法档位返回 `400 invalid_context_level`。当前不是 Ollama 时返回 `400 ctx_not_supported`。
|
|
125
142
|
|
|
126
143
|
## `GET /v1/project`
|
|
127
144
|
|
|
@@ -209,7 +226,7 @@ CLI 升级请使用 `min-agent update`(执行 `npm install -g min-agent`)。
|
|
|
209
226
|
| `error` | message | 错误 |
|
|
210
227
|
| `done` | step_count, usage, context_tokens, has_error, aborted, max_steps_reached, incomplete, budget_exceeded, continues, stopped, empty_response, empty_attempts, messages, session_id, task_state, project | 结束 |
|
|
211
228
|
| `confirm` | id, message | 等待确认(仅 `auto_approve: false`) |
|
|
212
|
-
| `question` | id, prompt, options | 等待回答(仅 `auto_approve: false`)。`options` 为字符串数组;对象选项(如 `{label, description}
|
|
229
|
+
| `question` | id, prompt, options, multiple | 等待回答(仅 `auto_approve: false`)。`options` 为字符串数组;对象选项(如 `{label, description}`)会先被规范成字符串再下发。有选项时末尾会补上「其他」以便自定义输入。`multiple: true` 表示可多选 |
|
|
213
230
|
| `fatal` | message | 致命错误 |
|
|
214
231
|
|
|
215
232
|
---
|
|
@@ -321,10 +338,10 @@ CLI 升级请使用 `min-agent update`(执行 `npm install -g min-agent`)。
|
|
|
321
338
|
## `GET /v1/permission`
|
|
322
339
|
|
|
323
340
|
```json
|
|
324
|
-
{ "permission": "
|
|
341
|
+
{ "permission": "accept-edits", "source": null, "label": "accept edits" }
|
|
325
342
|
```
|
|
326
343
|
|
|
327
|
-
`permission` 为 `ask` / `accept-edits` / `allow-all`。`source` 为 `cli`、`project`、`global` 或 `null
|
|
344
|
+
`permission` 为 `ask` / `accept-edits` / `allow-all`。`source` 为 `cli`、`project`、`global` 或 `null`(使用默认:`accept-edits`,自动允许文件修改)。
|
|
328
345
|
|
|
329
346
|
## `POST /v1/permission`
|
|
330
347
|
|
|
@@ -398,7 +415,7 @@ CLI 升级请使用 `min-agent update`(执行 `npm install -g min-agent`)。
|
|
|
398
415
|
|
|
399
416
|
## `POST /v1/answers`
|
|
400
417
|
|
|
401
|
-
配合 SSE `question` 事件。`answer` 为 `null`
|
|
418
|
+
配合 SSE `question` 事件。`answer` 为 `null` 表示跳过。单选传选项原文或自定义文字;多选可传 JSON 字符串数组(如 `["A","自定义"]`),或单个字符串。
|
|
402
419
|
|
|
403
420
|
```json
|
|
404
421
|
// 请求
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "min-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Minimal AI coding agent with tool use, MCP, and skills support",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
8
|
-
"min-agent": "
|
|
8
|
+
"min-agent": "bin/min-agent.js"
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=20.0.0"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"bin",
|
|
15
15
|
"dist",
|
|
16
|
-
"docs",
|
|
16
|
+
"docs/API.md",
|
|
17
17
|
"skills",
|
|
18
18
|
"README.md",
|
|
19
19
|
"LICENSE"
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"homepage": "https://gitee.com/lemon8510/min-agent",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev": "bun run src/cli.ts",
|
|
34
|
-
"build": "
|
|
34
|
+
"build": "bun run scripts/bundle.ts",
|
|
35
35
|
"typecheck": "tsc --noEmit",
|
|
36
36
|
"test": "bun test",
|
|
37
|
-
"lint": "biome check src tests",
|
|
38
|
-
"format": "biome format --write src tests",
|
|
37
|
+
"lint": "biome check src tests scripts",
|
|
38
|
+
"format": "biome format --write src tests scripts",
|
|
39
39
|
"prepack": "npm run typecheck && npm run build"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
@@ -80,12 +80,16 @@ 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: `
|
|
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`). 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`.
|
|
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.
|
|
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).
|
|
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.
|
|
90
|
+
|
|
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
|
+
|
|
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.
|
|
90
94
|
|
|
91
95
|
After changing keys or MCP connections, tell the user if a restart is required. Do not print full secrets back in chat.
|
|
@@ -23,7 +23,7 @@ Read this when you need exact keys. Files are strict JSON.
|
|
|
23
23
|
"webFetchURL": "https://firecrawl.example.com",
|
|
24
24
|
"instructions": ["./docs/rules.md"],
|
|
25
25
|
"disabledSkills": [],
|
|
26
|
-
"permission": "
|
|
26
|
+
"permission": "accept-edits",
|
|
27
27
|
"thinking": "max",
|
|
28
28
|
"memory": "on",
|
|
29
29
|
"sandbox": {
|
|
@@ -58,7 +58,7 @@ Read this when you need exact keys. Files are strict JSON.
|
|
|
58
58
|
|
|
59
59
|
- `thinking`: `off` | `low` | `medium` | `high` | `max`; omit to use medium. A project `thinking` value overlays global; writing thinking globally removes the project overlay so the chosen level is what later sessions use. `/think --project` writes only the project file.
|
|
60
60
|
- `memory`: `on` | `off`; omit to keep **off**. When off, stored `memory.json` entries are not injected and memory tools are unavailable. A project `memory` value overlays global; writing memory globally removes the project overlay. `/memory --project` writes only the project file.
|
|
61
|
-
- `contextWindow`: tokens; omit to query the API, then 512k fallback.
|
|
61
|
+
- `contextWindow`: tokens; omit to query the API. An `ollama` provider uses `POST /api/show`: Modelfile `num_ctx` if set, otherwise min(architecture context_length, 32768), else 2048. Chat goes to native `POST /api/chat` with that value as `options.num_ctx` (OpenAI-compatible `/v1` ignores it). Interactive `/ctx` (and `min-agent ctx`) sets this field on the active ollama provider to a fixed level (`2k` / `4k` / `8k` / `12k` / `16k` / `32k` / `64k` / `128k` / `256k`) or `auto` to clear it. Other providers then 512k fallback.
|
|
62
62
|
- `agent.autoContinue` omitted → uses `compaction.autoContinue` (default true).
|
|
63
63
|
- `agent.maxSteps` omitted → no tool-step ceiling.
|
|
64
64
|
- `agent.maxEmptyAttempts` / `agent.emptyRetryDelayMs`: retries when the provider returns an empty stream (HTTP 200, no content). First retry is immediate, later ones back off exponentially, capped at 8s.
|
|
@@ -70,6 +70,9 @@ Read this when you need exact keys. Files are strict JSON.
|
|
|
70
70
|
- `MIN_AGENT_TRACE=1` logs a request/response summary for every model call (model, message and tool counts, status, time to first byte).
|
|
71
71
|
- Web search/fetch that has not yet produced the requested output still continues even when `autoContinue` is false; further search/fetch calls return a stop-and-write notice instead of new results.
|
|
72
72
|
- Old single-provider configs migrate on first run; write the `providers` array for new files.
|
|
73
|
+
- Interactive and non-interactive provider setup both go through `min-agent setup`. API keys are written only to the global config.
|
|
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.
|
|
73
76
|
|
|
74
77
|
## Project `.min-agent/config.json`
|
|
75
78
|
|
|
@@ -137,9 +140,10 @@ Array of `{ "content": string, "tags": string[], "created": string }`. Prefer me
|
|
|
137
140
|
|
|
138
141
|
| Variable | Role |
|
|
139
142
|
|----------|------|
|
|
140
|
-
| `MIN_AGENT_CONFIG_DIR` | Replaces `~/.min-agent` (includes `model-catalog-cache.json`, `thinking-wire-cache.json`) |
|
|
143
|
+
| `MIN_AGENT_CONFIG_DIR` | Replaces `~/.min-agent` (includes `model-catalog-cache.json`, `thinking-wire-cache.json`, `ollama-model-cache.json`) |
|
|
141
144
|
| `MIN_AGENT_SKILLS_DIRS` | Replaces user skill roots (path-delimiter separated) |
|
|
142
145
|
| `MIN_AGENT_NO_BUILTIN_SKILLS` | `1` / `true` skips packaged skills |
|
|
146
|
+
| `MIN_AGENT_NO_BUILTIN_PROVIDER` | `1` / `true` skips the built-in OpenRouter fallback |
|
|
143
147
|
| `MIN_AGENT_SANDBOX` / `MIN_AGENT_SANDBOX_NETWORK` | Isolation |
|
|
144
148
|
| `MIN_AGENT_MODELS_API_URL` | Model catalog base (default `https://models.lonae.com`) |
|
|
145
149
|
| `MIN_AGENT_SERPER_API_KEY` | Overrides `serperApiKey` |
|
|
@@ -151,4 +155,4 @@ Array of `{ "content": string, "tags": string[], "created": string }`. Prefer me
|
|
|
151
155
|
|
|
152
156
|
## HTTP (only if the user is running `min-agent serve`)
|
|
153
157
|
|
|
154
|
-
Skills: `GET /v1/skills`, `GET /v1/skills/:name`, `POST /v1/skills/reload`, `POST /v1/skills/:name/enable|disable` with `{ "scope": "project"|"global" }`. MCP enable/disable similarly. Thinking: `GET/POST /v1/thinking`. Memory switch: `GET/POST /v1/memory/mode`. Full list is `docs/API.md` in the min-agent package; do not treat that file as this skill's replacement.
|
|
158
|
+
Skills: `GET /v1/skills`, `GET /v1/skills/:name`, `POST /v1/skills/reload`, `POST /v1/skills/:name/enable|disable` with `{ "scope": "project"|"global" }`. MCP enable/disable similarly. Thinking: `GET/POST /v1/thinking`. Memory switch: `GET/POST /v1/memory/mode`. Ollama context level: `GET/POST /v1/context` with `{ "level": "8k" }` or `"auto"`. Full list is `docs/API.md` in the min-agent package; do not treat that file as this skill's replacement.
|