min-agent 0.1.4 → 0.1.5
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 +269 -164
- package/bin/min-agent.js +0 -0
- package/dist/agent.js +383 -16
- package/dist/cli.js +20 -1
- package/dist/clipboard.js +106 -0
- package/dist/code-mode.js +166 -0
- package/dist/compaction.js +243 -48
- package/dist/config.js +34 -7
- package/dist/context-window.js +185 -0
- package/dist/doom-loop.js +36 -0
- package/dist/instructions.js +42 -0
- package/dist/mcp.js +28 -16
- package/dist/output.js +15 -2
- package/dist/serve.js +351 -3
- package/dist/sessions.js +13 -4
- package/dist/structured-output.js +29 -0
- package/dist/title-gen.js +48 -0
- package/dist/tools/bash.js +81 -74
- package/dist/tools/code_search.js +91 -0
- package/dist/tools/explore.js +104 -0
- package/dist/tools/index.js +10 -1
- package/dist/tools/question.js +53 -0
- package/dist/tools/read.js +14 -3
- package/dist/tools/task.js +98 -0
- package/dist/tools/todo.js +88 -0
- package/docs/API.md +298 -111
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,85 +1,144 @@
|
|
|
1
1
|
# min-agent
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
兼容 OpenAI 风格 API(OpenAI、Ollama、vLLM、MiniMax、DeepSeek 等)。
|
|
3
|
+
Minimal yet powerful AI coding agent for the terminal. Supports any OpenAI-compatible API, MCP servers, skills, memory, and multi-agent parallel execution.
|
|
5
4
|
|
|
6
|
-
##
|
|
7
|
-
|
|
8
|
-
需要 **Node.js 20+**。入口为 **`bin/min-agent.js`**(含 `#!/usr/bin/env node`),由 npm/npx 生成 `.cmd` 时用 **`node` 执行**,避免 Windows 把无 shebang 的 `dist/cli.js` 当成「用默认应用打开」。发布包内含 **`tsc` 编译后的 `dist/`**(多文件 ESM),安装时会随 **`dependencies`** 安装 `ai`、`glob` 等;npm 会与同级包 **dedupe**。
|
|
5
|
+
## Install
|
|
9
6
|
|
|
10
7
|
```bash
|
|
11
8
|
npm install -g min-agent
|
|
12
|
-
# 或
|
|
13
|
-
npx -y min-agent --help
|
|
14
9
|
```
|
|
15
10
|
|
|
16
|
-
##
|
|
11
|
+
## Quick Start
|
|
17
12
|
|
|
18
13
|
```bash
|
|
19
|
-
# 1
|
|
14
|
+
# 1. Configure your LLM provider
|
|
20
15
|
min-agent setup
|
|
21
16
|
|
|
22
|
-
# 2)
|
|
23
|
-
min-agent chat "
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
# 2. Chat mode (general assistant)
|
|
18
|
+
min-agent chat "what files are in this directory?"
|
|
19
|
+
|
|
20
|
+
# 3. Code mode (project-aware AI coding)
|
|
21
|
+
min-agent code
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
### Chat
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
min-agent chat <message> # Single-shot message
|
|
32
|
+
min-agent chat # Interactive multi-turn session
|
|
33
|
+
min-agent chat --resume <id> # Resume a previous session
|
|
34
|
+
min-agent chat -m <model> "msg" # Use a specific model
|
|
35
|
+
min-agent chat -i img.png "what's this?" # Attach image
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Code (AI Coding Mode)
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
min-agent
|
|
40
|
+
```bash
|
|
41
|
+
min-agent code # Project-aware coding session
|
|
42
|
+
min-agent code --resume <id> # Resume coding session
|
|
29
43
|
```
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
Code mode automatically:
|
|
46
|
+
- Scans the project (language, framework, git status, structure)
|
|
47
|
+
- Uses a coding-optimized system prompt
|
|
48
|
+
- Includes the `explore` tool for deep codebase analysis
|
|
49
|
+
- Follows project conventions (no comments, match existing style)
|
|
50
|
+
|
|
51
|
+
### Configuration
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
```bash
|
|
54
|
+
min-agent setup # Interactive provider setup
|
|
55
|
+
min-agent models # List available models
|
|
56
|
+
min-agent rules # Show loaded instruction rules
|
|
57
|
+
min-agent rules edit # Edit global rules file
|
|
58
|
+
```
|
|
34
59
|
|
|
35
|
-
|
|
36
|
-
- `.min-agent/mcp.json`(默认 `{ "mcpServers": {} }`)
|
|
60
|
+
### Memory
|
|
37
61
|
|
|
38
|
-
|
|
62
|
+
```bash
|
|
63
|
+
min-agent memory # List all memories
|
|
64
|
+
min-agent memory add "text" # Add manually
|
|
65
|
+
min-agent memory search "query" # Search
|
|
66
|
+
min-agent memory delete <n> # Delete by number
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The agent also saves memories automatically during conversations when you share preferences or important context.
|
|
70
|
+
|
|
71
|
+
### Sessions
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
min-agent history # List saved sessions
|
|
75
|
+
min-agent chat --resume <id> # Resume a session
|
|
76
|
+
```
|
|
39
77
|
|
|
40
|
-
|
|
78
|
+
Sessions are auto-saved when you exit interactive chat/code mode, with LLM-generated titles.
|
|
79
|
+
|
|
80
|
+
### MCP (Model Context Protocol)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
min-agent mcp add <name> <cmd...> # Add local stdio server
|
|
84
|
+
min-agent mcp add <name> --url <url> [--token <t>] # Add remote HTTP server
|
|
85
|
+
min-agent mcp remove <name> # Remove server
|
|
86
|
+
min-agent mcp list # List servers
|
|
87
|
+
min-agent mcp check # Check connectivity
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Skills
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
min-agent skills list # List available skills
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### HTTP API
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
min-agent serve # Start HTTP server (default :8787)
|
|
100
|
+
min-agent serve --port 3000 # Custom port
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
See [docs/API.md](docs/API.md) for full API reference.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Interactive Commands
|
|
108
|
+
|
|
109
|
+
In chat/code mode, use slash commands:
|
|
41
110
|
|
|
42
111
|
| Command | Description |
|
|
43
112
|
|---------|-------------|
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
|
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
| `/mcp` | 查看 MCP 服务与连接状态 |
|
|
74
|
-
| `/tokens` | 显示上下文 token 估算 |
|
|
75
|
-
| `/help` | 显示帮助 |
|
|
76
|
-
| `/exit` | 退出聊天 |
|
|
77
|
-
|
|
78
|
-
## 配置文件与加载规则
|
|
79
|
-
|
|
80
|
-
### Provider 配置
|
|
81
|
-
|
|
82
|
-
保存在 `~/.min-agent/config.json`:
|
|
113
|
+
| `/clear` | Clear conversation history |
|
|
114
|
+
| `/compact` | Force context compaction |
|
|
115
|
+
| `/model [name]` | Show or change model |
|
|
116
|
+
| `/memory [text]` | List or save memory |
|
|
117
|
+
| `/tokens` | Show context window usage |
|
|
118
|
+
| `/path` | Show working directory |
|
|
119
|
+
| `/help` | Show all commands |
|
|
120
|
+
| `/exit` | Exit session |
|
|
121
|
+
|
|
122
|
+
**Ctrl+C** interrupts the current generation without exiting.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Configuration
|
|
127
|
+
|
|
128
|
+
All config lives in `~/.min-agent/`:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
~/.min-agent/
|
|
132
|
+
├── config.json # Provider, model, instructions
|
|
133
|
+
├── rules.md # Global rules (always injected)
|
|
134
|
+
├── mcp.json # MCP server definitions
|
|
135
|
+
├── memory.json # Persistent memories
|
|
136
|
+
├── models-cache.json # Model list cache (fallback)
|
|
137
|
+
├── context-window-cache.json # Context window cache
|
|
138
|
+
└── sessions/ # Saved conversation sessions
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### config.json
|
|
83
142
|
|
|
84
143
|
```json
|
|
85
144
|
{
|
|
@@ -87,70 +146,121 @@ min-agent chat
|
|
|
87
146
|
"type": "openai-compatible",
|
|
88
147
|
"baseURL": "https://api.openai.com/v1",
|
|
89
148
|
"apiKey": "sk-...",
|
|
90
|
-
"defaultModel": "gpt-4o"
|
|
91
|
-
|
|
149
|
+
"defaultModel": "gpt-4o",
|
|
150
|
+
"contextWindow": 128000
|
|
151
|
+
},
|
|
152
|
+
"instructions": [
|
|
153
|
+
"./docs/CODING_RULES.md",
|
|
154
|
+
"https://example.com/team-rules.md"
|
|
155
|
+
]
|
|
92
156
|
}
|
|
93
157
|
```
|
|
94
158
|
|
|
95
|
-
|
|
159
|
+
### Provider Types
|
|
96
160
|
|
|
97
|
-
|
|
98
|
-
|
|
161
|
+
| Type | Description |
|
|
162
|
+
|------|-------------|
|
|
163
|
+
| `openai-compatible` | Any OpenAI-compatible API (MiniMax, DeepSeek, vLLM, etc.) |
|
|
164
|
+
| `openai` | OpenAI official |
|
|
165
|
+
| `ollama` | Local Ollama (`http://localhost:11434/v1`) |
|
|
99
166
|
|
|
100
|
-
###
|
|
167
|
+
### Context Window Auto-Detection
|
|
101
168
|
|
|
102
|
-
|
|
169
|
+
The context window size is automatically detected from:
|
|
170
|
+
1. `config.provider.contextWindow` (manual override)
|
|
171
|
+
2. OpenRouter API (`context_length`)
|
|
172
|
+
3. Ollama API (`/api/show`)
|
|
173
|
+
4. vLLM API (`max_model_len`)
|
|
174
|
+
5. [models.dev](https://models.dev) database
|
|
175
|
+
6. Fallback: 128,000 tokens
|
|
103
176
|
|
|
104
|
-
|
|
177
|
+
---
|
|
105
178
|
|
|
106
|
-
|
|
107
|
-
2. 项目规则(从当前目录向上查找首个命中):
|
|
108
|
-
- `./AGENTS.md`
|
|
109
|
-
- `./RULES.md`
|
|
110
|
-
- `./CLAUDE.md`
|
|
111
|
-
- `./.min-agent/AGENTS.md`
|
|
112
|
-
3. `~/.min-agent/config.json` 的 `instructions` 字段中声明的本地文件与远程 URL
|
|
179
|
+
## Tools
|
|
113
180
|
|
|
114
|
-
|
|
181
|
+
### Built-in
|
|
115
182
|
|
|
116
183
|
| Tool | Description |
|
|
117
184
|
|------|-------------|
|
|
118
|
-
| `bash` |
|
|
119
|
-
| `read` |
|
|
120
|
-
| `write` |
|
|
121
|
-
| `edit` |
|
|
122
|
-
| `glob` |
|
|
123
|
-
| `grep` |
|
|
124
|
-
| `web_search` |
|
|
125
|
-
| `web_fetch` |
|
|
185
|
+
| `bash` | Shell commands (async, timeout, Ctrl+C killable) |
|
|
186
|
+
| `read` | Read files (with context-aware instruction discovery) |
|
|
187
|
+
| `write` | Write/create files (with overwrite confirmation) |
|
|
188
|
+
| `edit` | Search/replace precise editing |
|
|
189
|
+
| `glob` | Find files by pattern |
|
|
190
|
+
| `grep` | Search file contents with regex |
|
|
191
|
+
| `web_search` | Web search via SearXNG |
|
|
192
|
+
| `web_fetch` | Fetch URLs (with Firecrawl fallback for SPAs) |
|
|
193
|
+
| `todo` | Task tracking with progress visibility |
|
|
194
|
+
| `question` | Ask user for clarification |
|
|
195
|
+
| `task` | Spawn parallel sub-agents |
|
|
196
|
+
| `explore` | Deep codebase exploration (read-only sub-agent) |
|
|
197
|
+
| `skill` | Load domain-specific instructions |
|
|
198
|
+
| `memory_save` | Save information for future sessions |
|
|
199
|
+
| `memory_search` | Search saved memories |
|
|
200
|
+
| `memory_delete` | Remove a memory |
|
|
201
|
+
| `codesearch` | Semantic code search via Exa (requires `EXA_API_KEY`) |
|
|
202
|
+
|
|
203
|
+
### Sub-Agent System
|
|
204
|
+
|
|
205
|
+
The `task` tool spawns independent sub-agents that:
|
|
206
|
+
- Have their own context and tool access
|
|
207
|
+
- Can run in parallel (call multiple tasks at once)
|
|
208
|
+
- Are limited to 15 steps with doom loop detection
|
|
209
|
+
- Cannot spawn further sub-agents (no recursion)
|
|
210
|
+
|
|
211
|
+
The `explore` tool is a specialized read-only sub-agent for codebase exploration with configurable thoroughness (quick/medium/thorough).
|
|
212
|
+
|
|
213
|
+
### Plugins
|
|
214
|
+
|
|
215
|
+
Custom tools can be loaded from:
|
|
216
|
+
- `.min-agent/tools/*.ts` (project-level)
|
|
217
|
+
- `~/.min-agent/tools/*.ts` (global)
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
// .min-agent/tools/deploy.ts
|
|
221
|
+
export const deploy = {
|
|
222
|
+
description: "Deploy the application",
|
|
223
|
+
parameters: { env: { type: "string", description: "Target environment" } },
|
|
224
|
+
execute: async ({ env }) => {
|
|
225
|
+
// your logic
|
|
226
|
+
return `Deployed to ${env}`
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
126
230
|
|
|
127
|
-
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## MCP (Model Context Protocol)
|
|
234
|
+
|
|
235
|
+
Connect external tool servers:
|
|
128
236
|
|
|
129
|
-
|
|
237
|
+
```bash
|
|
238
|
+
# Local stdio servers
|
|
239
|
+
min-agent mcp add filesystem npx -y @modelcontextprotocol/server-filesystem /tmp
|
|
240
|
+
min-agent mcp add fetch npx -y @modelcontextprotocol/server-fetch
|
|
130
241
|
|
|
131
|
-
|
|
132
|
-
-
|
|
242
|
+
# Remote HTTP servers
|
|
243
|
+
min-agent mcp add remote-api --url https://mcp.example.com --token $TOKEN
|
|
244
|
+
```
|
|
133
245
|
|
|
134
|
-
|
|
246
|
+
MCP tools are automatically namespaced (`servername_toolname`) and available in all modes.
|
|
135
247
|
|
|
136
|
-
|
|
248
|
+
Supports:
|
|
249
|
+
- Stdio transport (local processes)
|
|
250
|
+
- Streamable HTTP transport
|
|
251
|
+
- SSE transport (legacy)
|
|
252
|
+
- OAuth authentication detection
|
|
253
|
+
- Auto-reconnect on failure
|
|
137
254
|
|
|
138
|
-
|
|
255
|
+
---
|
|
139
256
|
|
|
140
|
-
|
|
141
|
-
2. `<cwd>/.min-agent/skills/`
|
|
142
|
-
3. `<cwd>/.agent-demo/skills/`
|
|
143
|
-
4. `<cwd>/.opencode/skills/`
|
|
144
|
-
5. `<cwd>/.claude/skills/`
|
|
257
|
+
## Skills
|
|
145
258
|
|
|
146
|
-
|
|
259
|
+
Skills provide domain-specific instructions loaded on demand.
|
|
147
260
|
|
|
148
|
-
```text
|
|
149
|
-
~/.agents/skills/<your-skill>/SKILL.md
|
|
150
|
-
.min-agent/skills/<your-skill>/SKILL.md
|
|
151
261
|
```
|
|
152
|
-
|
|
153
|
-
|
|
262
|
+
.min-agent/skills/my-skill/SKILL.md
|
|
263
|
+
```
|
|
154
264
|
|
|
155
265
|
```markdown
|
|
156
266
|
---
|
|
@@ -161,94 +271,89 @@ description: What this skill does
|
|
|
161
271
|
# Instructions for the agent...
|
|
162
272
|
```
|
|
163
273
|
|
|
164
|
-
|
|
274
|
+
Discovery locations:
|
|
275
|
+
- `.min-agent/skills/` (project)
|
|
276
|
+
- `.opencode/skills/` (project)
|
|
277
|
+
- `.claude/skills/` (project, compatibility)
|
|
165
278
|
|
|
166
|
-
|
|
167
|
-
min-agent skills list
|
|
168
|
-
```
|
|
279
|
+
---
|
|
169
280
|
|
|
170
|
-
##
|
|
281
|
+
## Rules (Instructions)
|
|
171
282
|
|
|
172
|
-
|
|
283
|
+
Rules are injected into every conversation as system instructions.
|
|
173
284
|
|
|
174
|
-
|
|
285
|
+
| Source | Priority |
|
|
286
|
+
|--------|----------|
|
|
287
|
+
| `~/.min-agent/rules.md` | Global (always loaded) |
|
|
288
|
+
| `./AGENTS.md` or `./RULES.md` | Project-level |
|
|
289
|
+
| `.min-agent/AGENTS.md` | Project-level |
|
|
290
|
+
| `config.instructions[]` | Paths or URLs |
|
|
175
291
|
|
|
176
|
-
|
|
177
|
-
min-agent mcp add filesystem npx -y @modelcontextprotocol/server-filesystem /tmp
|
|
178
|
-
min-agent mcp add memory npx -y @modelcontextprotocol/server-memory
|
|
179
|
-
min-agent mcp add custom --skip-check node ./my-mcp-server.js
|
|
180
|
-
```
|
|
292
|
+
**Context-aware**: When the agent reads a file, nearby `AGENTS.md`/`RULES.md` files are automatically discovered and injected.
|
|
181
293
|
|
|
182
|
-
|
|
294
|
+
---
|
|
183
295
|
|
|
184
|
-
|
|
296
|
+
## Memory
|
|
297
|
+
|
|
298
|
+
The agent remembers things across sessions:
|
|
185
299
|
|
|
186
300
|
```bash
|
|
187
|
-
min-agent
|
|
188
|
-
min-agent
|
|
189
|
-
min-agent mcp add legacy --url https://old.example.com/sse --sse
|
|
190
|
-
min-agent mcp add legacy --url https://old.example.com/sse --ext/event-stream
|
|
191
|
-
min-agent mcp list
|
|
192
|
-
min-agent mcp check
|
|
301
|
+
min-agent memory add "I prefer functional style"
|
|
302
|
+
min-agent memory add "Project uses PostgreSQL"
|
|
193
303
|
```
|
|
194
304
|
|
|
195
|
-
|
|
305
|
+
Or just tell the agent: "记住:我喜欢用中文回复" — it will automatically save the memory.
|
|
196
306
|
|
|
197
|
-
|
|
198
|
-
{
|
|
199
|
-
"mcpServers": {
|
|
200
|
-
"remote-demo": {
|
|
201
|
-
"url": "https://example.com/mcp",
|
|
202
|
-
"remoteTransport": "auto",
|
|
203
|
-
"token": "optional-bearer-token",
|
|
204
|
-
"headers": { "X-Custom-Header": "value" },
|
|
205
|
-
"enabled": true
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
```
|
|
307
|
+
Memories are injected into the system prompt so the agent always has access to them.
|
|
210
308
|
|
|
211
|
-
|
|
212
|
-
- `remoteTransport`:`auto` | `streamable-http` | `sse`;CLI 中 `--sse` 等价于 `sse`。
|
|
309
|
+
---
|
|
213
310
|
|
|
214
|
-
|
|
311
|
+
## Safety Features
|
|
215
312
|
|
|
216
|
-
- `
|
|
217
|
-
-
|
|
218
|
-
-
|
|
313
|
+
- **Dangerous command confirmation**: `rm -rf`, `sudo`, `git push --force` etc. require approval
|
|
314
|
+
- **File overwrite confirmation**: Existing files prompt before overwriting
|
|
315
|
+
- **Doom loop detection**: Breaks infinite tool call loops (3 identical calls)
|
|
316
|
+
- **Auto-compaction**: Prevents context overflow with structured summarization
|
|
317
|
+
- **`--yes` / `-y` flag**: Skip all confirmations (for automation)
|
|
219
318
|
|
|
220
|
-
|
|
319
|
+
---
|
|
221
320
|
|
|
222
|
-
|
|
223
|
-
/mcp
|
|
224
|
-
```
|
|
321
|
+
## Context Management
|
|
225
322
|
|
|
226
|
-
|
|
323
|
+
- **Real token tracking**: Uses API response usage data (not estimation)
|
|
324
|
+
- **Auto-compaction**: Triggers at 75% of context window
|
|
325
|
+
- **Structured summaries**: Goal/Progress/Decisions/Files format
|
|
326
|
+
- **Incremental updates**: Updates existing summary instead of rewriting
|
|
327
|
+
- **Tool output pruning**: Trims old tool outputs to save space
|
|
328
|
+
- **Auto-continue**: After compaction, agent continues working automatically
|
|
227
329
|
|
|
228
|
-
|
|
330
|
+
---
|
|
229
331
|
|
|
230
|
-
|
|
231
|
-
建议先执行:
|
|
332
|
+
## HTTP API
|
|
232
333
|
|
|
233
|
-
|
|
234
|
-
min-agent setup
|
|
235
|
-
min-agent models
|
|
236
|
-
```
|
|
334
|
+
Start with `min-agent serve`. Full reference: [docs/API.md](docs/API.md)
|
|
237
335
|
|
|
238
|
-
|
|
336
|
+
Key endpoints:
|
|
337
|
+
- `POST /v1/chat` — Chat (streaming SSE or JSON)
|
|
338
|
+
- `GET /v1/sessions` — List sessions
|
|
339
|
+
- `GET /v1/memory` — List memories
|
|
340
|
+
- `GET /v1/mcp` — MCP status
|
|
341
|
+
- `GET /v1/project` — Project scan
|
|
342
|
+
- `POST /v1/chat/compact` — Manual compaction
|
|
239
343
|
|
|
240
|
-
|
|
344
|
+
---
|
|
241
345
|
|
|
242
|
-
|
|
243
|
-
- 检查网络或服务端是否可达
|
|
244
|
-
- 检查服务是否实现 `/models`(Ollama 已做 `/v1/models` 兼容重试)
|
|
346
|
+
## Environment Variables
|
|
245
347
|
|
|
246
|
-
|
|
348
|
+
| Variable | Description |
|
|
349
|
+
|----------|-------------|
|
|
350
|
+
| `AGENT_MODEL` | Override default model |
|
|
351
|
+
| `EXA_API_KEY` | Enable Exa code search tool |
|
|
352
|
+
| `MIN_AGENT_SHOW_THINKING` | Set to `0` to hide thinking output |
|
|
353
|
+
| `MIN_AGENT_SERVE_TOKEN` | API auth token for serve mode |
|
|
354
|
+
| `MIN_AGENT_SERVE_CORS` | Enable CORS for serve mode |
|
|
247
355
|
|
|
248
|
-
|
|
249
|
-
- 在聊天内 `/mcp` 看连接状态(connected/disconnected/disabled)
|
|
250
|
-
- **本地 stdio**:检查命令是否可执行(如 `npx` 是否可用)
|
|
251
|
-
- **远程 URL**:确认地址为 `http(s)://`,必要时加 `--sse` 强制使用旧版 SSE 传输,或用 `mcp check` 查看具体错误信息
|
|
356
|
+
---
|
|
252
357
|
|
|
253
358
|
## License
|
|
254
359
|
|
package/bin/min-agent.js
CHANGED
|
File without changes
|