min-agent 3.8.2609240147 → 3.12.2610240042

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 CHANGED
@@ -50,7 +50,8 @@ min-agent ask "your question" # start in ask mode — web Q&A & search only
50
50
  min-agent exec "your message" # one-shot question, then exit
51
51
  min-agent push # shortcut: git commit and push your changes
52
52
  min-agent --resume <id> # resume a previous session
53
- min-agent history # list saved sessions
53
+ min-agent sessions # list saved sessions
54
+ min-agent scope global # share one history across projects (default: per working directory)
54
55
  min-agent -i photo.png "..." # attach an image
55
56
  min-agent -m gpt-5.5 "..." # pick a model for one message
56
57
  min-agent --provider anthropic "..." # pick a provider for one message
@@ -64,7 +65,8 @@ Type `/` to open the command menu; **↑/↓** selects. On an empty input, **↑
64
65
 
65
66
  | Command | What it does |
66
67
  |---|---|
67
- | `/new` · `/sessions` | New session · switch between sessions |
68
+ | `/new` · `/sessions` | New session · switch between sessions (`--global` shows global history) |
69
+ | `/scope` | Where history is saved: per working directory (default) or global |
68
70
  | `/model` · `/provider` | Switch model / provider |
69
71
  | `/ask` · `/agent` | Switch to ask (web Q&A) / agent (coding) mode |
70
72
  | `/plan` | Plan mode — look, don't touch |
@@ -74,10 +76,11 @@ Type `/` to open the command menu; **↑/↓** selects. On an empty input, **↑
74
76
  | `/queue` | List, drop or clear messages waiting behind the running turn |
75
77
  | `/attach` · `/mcp` · `/skills` | Attach an image · MCP servers · skills |
76
78
  | `/tokens` · `/help` | Usage, reuse & cost · all commands |
79
+ | `/exit` · `/quit` | Exit (also `/q`) |
77
80
 
78
- The input box stays live while the agent works: press Enter and the message joins a queue that runs in order once the current turn ends (the status bar and spinner show the backlog). Use `/queue` to inspect it, `/queue rm <n>` to pull one out, `/queue clear` to drop them all; Esc cancels the running turn and drops the queue.
81
+ The input box stays live while the agent works: press Enter and the message joins a queue that runs in order once the current turn ends (the status bar and spinner show the backlog). Use `/queue` to inspect it, `/queue rm <n>` to pull one out, `/queue clear` to drop them all; Esc cancels the running turn and drops the queue. Slash commands never enter that queue.
79
82
 
80
- Commands that only read state or write config — `/permission`, `/sandbox`, `/memory`, `/plan`, `/ask`, `/agent`, `/reload`, `/rename`, and the picker commands given an argument (`/model <id>`, `/think low`, `/ctx 8k`, …) — run immediately even mid-turn, so a permission change applies to the very next tool call instead of waiting behind the whole turn. Everything that mutates the conversation or opens an overlay queues like a message.
83
+ Commands that only read state or write config — `/permission`, `/sandbox`, `/memory`, `/plan`, `/ask`, `/agent`, `/reload`, `/rename`, and the picker commands given an argument (`/model <id>`, `/think low`, `/ctx 8k`, …) — run immediately even mid-turn, so a permission change applies to the very next tool call instead of waiting behind the whole turn. Commands that would mutate the conversation or open an overlay (`/undo`, `/new`, `/compact`, `/model`, …) are refused mid-turn with a notice; they never queue as a user message.
81
84
 
82
85
  Shortcuts: **Ctrl+C** clears input (press twice to exit) · **Shift+Enter** / **Ctrl+J** inserts a newline · **Ctrl+V** pastes an image · **Ctrl+B** copies selected text · **Ctrl+O** expands the tool or thinking row in view · click a tool or thinking block to expand it.
83
86
 
@@ -95,6 +98,8 @@ min-agent --permission allow-all # auto-approve everything — use with care
95
98
  min-agent sandbox workspace # only allow changes inside this folder
96
99
  ```
97
100
 
101
+ In `workspace` / `strict`, temp dirs, package-manager caches and min-agent's own `~/.min-agent` (config, skills, memory, MCP) stay writable, so the agent can still configure itself. `strict` additionally stops shell commands (via seatbelt / bwrap) from reading the rest of your home directory: only the workspace, its enclosing git repo, `~/.min-agent`, caches and toolchains (`~/.nvm`, `~/.bun`, `~/.cargo`, `~/.gitconfig` …) stay readable; system directories are unaffected. Credential paths such as `~/.ssh`, `~/.aws` and `~/.netrc` are blocked in every mode.
102
+
98
103
  On Windows, OS-level command isolation (macOS seatbelt / Linux bwrap) is unavailable: `strict` refuses shell commands; `workspace` still blocks file tools outside the folder. Shell commands prefer Git Bash when installed.
99
104
 
100
105
  Off by default. Turn it on to keep facts across sessions:
@@ -124,6 +129,8 @@ The built-in OpenRouter preset (`openrouter/free`) is never written to disk. Set
124
129
 
125
130
  Settings live in `~/.min-agent/config.json` (global). Per-project settings go to `~/.min-agent/sessions/<project-key>/config.json` (auto-created; nothing is written inside the project directory).
126
131
 
132
+ Conversation history is saved per working directory by default, in `~/.min-agent/sessions/<project-key>/sessions/` — still inside the global config dir, never in the project. To share one history across projects, run `min-agent scope global` (or `/scope global`); `min-agent scope` shows the current setting.
133
+
127
134
  ## Extending It
128
135
 
129
136
  - **MCP servers** — connect external tools: `min-agent mcp -h`
@@ -171,7 +178,8 @@ min-agent ask "你的问题" # 以 ask 模式进入——仅联网问答
171
178
  min-agent exec "你的消息" # 单次提问后自动退出
172
179
  min-agent push # 快捷指令:git 提交并推送代码
173
180
  min-agent --resume <id> # 恢复之前的会话
174
- min-agent history # 查看已保存的会话
181
+ min-agent sessions # 查看已保存的会话
182
+ min-agent scope global # 所有项目共用一个历史(默认按工作目录分别保存)
175
183
  min-agent -i photo.png "..." # 为一条消息附带图片
176
184
  min-agent -m gpt-5.5 "..." # 为一条消息指定模型
177
185
  min-agent --provider anthropic "..." # 为一条消息指定服务商
@@ -185,7 +193,8 @@ min-agent --provider anthropic "..." # 为一条消息指定服务商
185
193
 
186
194
  | 命令 | 作用 |
187
195
  |---|---|
188
- | `/new` · `/sessions` | 新建会话 · 切换会话 |
196
+ | `/new` · `/sessions` | 新建会话 · 切换会话(`--global` 查看全局历史) |
197
+ | `/scope` | 对话历史保存位置:按工作目录(默认)或全局共用 |
189
198
  | `/model` · `/provider` | 切换模型 / 服务商 |
190
199
  | `/ask` · `/agent` | 切换 ask(联网问答)/ agent(编码)会话模式 |
191
200
  | `/plan` | 计划模式——只看不改 |
@@ -195,10 +204,11 @@ min-agent --provider anthropic "..." # 为一条消息指定服务商
195
204
  | `/queue` | 查看、移出或清空排在当前任务后面的消息 |
196
205
  | `/attach` · `/mcp` · `/skills` | 附加图片 · MCP 服务 · 技能 |
197
206
  | `/tokens` · `/help` | 用量、复用与费用 · 全部命令 |
207
+ | `/exit` · `/quit` | 退出(`/q` 同) |
198
208
 
199
- 任务执行时输入框依然可用:按 Enter 会把消息排进队列,当前任务结束后按顺序执行(运行提示行显示排队数量)。`/queue` 查看队列,`/queue rm <序号>` 移出一条,`/queue clear` 全部清空;Esc 取消当前任务,并丢弃排队消息。
209
+ 任务执行时输入框依然可用:按 Enter 会把消息排进队列,当前任务结束后按顺序执行(运行提示行显示排队数量)。`/queue` 查看队列,`/queue rm <序号>` 移出一条,`/queue clear` 全部清空;Esc 取消当前任务,并丢弃排队消息。斜杠命令不会进入消息队列。
200
210
 
201
- 只读取状态或只写配置的命令——`/permission`、`/sandbox`、`/memory`、`/plan`、`/ask`、`/agent`、`/reload`、`/rename`,以及带参数的选择类命令(`/model <id>`、`/think low`、`/ctx 8k` 等)——在任务执行中也会立即执行:改完确认模式马上对下一次工具调用生效,不必等整轮结束。会改动对话内容或打开浮层的命令则和消息一样排队。
211
+ 只读取状态或只写配置的命令——`/permission`、`/sandbox`、`/memory`、`/plan`、`/ask`、`/agent`、`/reload`、`/rename`,以及带参数的选择类命令(`/model <id>`、`/think low`、`/ctx 8k` 等)——在任务执行中也会立即执行:改完确认模式马上对下一次工具调用生效,不必等整轮结束。会改动对话内容或打开浮层的命令(`/undo`、`/new`、`/compact`、`/model` 等)在任务执行中会被拒绝并提示等本轮结束,不会作为用户消息排队。
202
212
 
203
213
  快捷键:**Ctrl+C** 清空输入(连按两次退出)· **Shift+Enter** / **Ctrl+J** 换行 · **Ctrl+V** 粘贴图片 · **Ctrl+B** 复制选中的文本 · **Ctrl+O** 展开视图中间的工具/思考行 · 点击工具或思考块可展开收起。
204
214
 
@@ -216,6 +226,8 @@ min-agent --permission allow-all # 自动批准所有操作——请谨慎
216
226
  min-agent sandbox workspace # 仅允许修改当前文件夹内内容
217
227
  ```
218
228
 
229
+ `workspace` / `strict` 下,临时目录、包管理器缓存,以及 min-agent 自己的 `~/.min-agent`(配置、技能、记忆、MCP)仍可读写,智能体照样能改自己的配置。`strict` 还会(通过 seatbelt / bwrap)禁止 shell 命令读取 home 目录下的其他内容:只有工作区、所在的 git 仓库、`~/.min-agent`、缓存与工具链(`~/.nvm`、`~/.bun`、`~/.cargo`、`~/.gitconfig` 等)可读,系统目录不受影响;`~/.ssh`、`~/.aws`、`~/.netrc` 等凭据路径在任何模式下都不可访问。
230
+
219
231
  Windows 上没有 macOS/Linux 那种命令级隔离:`strict` 会拒绝执行 shell;`workspace` 仍会限制文件工具写到目录外。装了 Git Bash 时优先用它跑命令。
220
232
 
221
233
  ## 记忆
@@ -247,6 +259,8 @@ min-agent 内置一个免费的 OpenRouter 预设(`openrouter/free`),开
247
259
 
248
260
  配置保存在 `~/.min-agent/config.json`(全局生效)。项目级配置保存在 `~/.min-agent/sessions/<project-key>/config.json`(自动创建,不会在项目目录里生成任何文件),仅对该项目生效。
249
261
 
262
+ 对话历史默认按工作目录保存:`~/.min-agent/sessions/<project-key>/sessions/`,同样在全局配置目录下,不会写进项目目录。想让所有项目共用一个历史,执行 `min-agent scope global`(或对话中 `/scope global`);`min-agent scope` 查看当前设置。
263
+
250
264
  ## 扩展能力
251
265
 
252
266
  - **MCP 服务**:连接外部工具与数据源,`min-agent mcp -h`
@@ -257,6 +271,8 @@ min-agent 内置一个免费的 OpenRouter 预设(`openrouter/free`),开
257
271
 
258
272
  `min-agent serve` 可启动本地 HTTP API 服务,供其他应用调用。完整说明见 [docs/API.md](docs/API.md)
259
273
 
274
+ 开启 CORS(`MIN_AGENT_SERVE_CORS=1`)且未设置 `MIN_AGENT_SERVE_TOKEN` 时,只接受本机来源的浏览器请求;`file://` 页面或 sandbox iframe 发出的 `Origin: null` 默认拒绝,需要时设 `MIN_AGENT_SERVE_ALLOW_NULL_ORIGIN=1`。
275
+
260
276
  ## 网页版
261
277
 
262
278
  ```bash