@minimax-ai/code 0.6.4 → 0.6.6
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/CHANGELOG.md +77 -0
- package/CHANGELOG.zh-CN.md +33 -0
- package/README.md +44 -7
- package/README.zh-CN.md +23 -4
- package/chunks/{application-YV6I5PN3.js → application-ZJ5NM3DF.js} +1 -1
- package/chunks/{auth-command-F6CMS6YE.js → auth-command-VA6MMKOP.js} +1 -1
- package/chunks/{chunk-Z4VKGZFA.js → chunk-3FETZOUF.js} +30 -30
- package/chunks/{chunk-C2QIYD6E.js → chunk-52X742AN.js} +1 -1
- package/chunks/{chunk-LOIYR2RZ.js → chunk-AKM6CI7T.js} +1 -1
- package/chunks/{chunk-DKHGVKVS.js → chunk-EGP34E73.js} +1 -1
- package/chunks/{chunk-AVYSGYVY.js → chunk-EZ7Q2NM4.js} +94 -94
- package/chunks/{chunk-RWMY26JX.js → chunk-G5QL7ZHU.js} +706 -702
- package/chunks/{chunk-OQ7HN3XJ.js → chunk-LQIEYG3O.js} +1 -1
- package/chunks/{chunk-AQ73XBVZ.js → chunk-VCAGMAY5.js} +1 -1
- package/chunks/{chunk-77TNCP5I.js → chunk-WQPQHX2N.js} +1 -1
- package/chunks/{chunk-IBPQKAN6.js → chunk-WUBVVATA.js} +676 -676
- package/chunks/{data-dir-U4LWH2QP.js → data-dir-IMRONFFA.js} +1 -1
- package/chunks/dist-63237B2W.js +2 -0
- package/chunks/{launcher-74Z5T4C2.js → launcher-AW4MDLKG.js} +87 -87
- package/chunks/{lifecycle-ADITN7NX.js → lifecycle-INAA4RL2.js} +1 -1
- package/chunks/{main-WKTFLQ4A.js → main-AFQG6DBW.js} +2 -2
- package/chunks/{plugin-command-7PC7EX65.js → plugin-command-LOWP3CEB.js} +1 -1
- package/chunks/{provider-command-JWWVMDYX.js → provider-command-CS5TVIBU.js} +1 -1
- package/chunks/{run-acp-command-AAHBRZ4K.js → run-acp-command-2QYNAZF5.js} +2 -2
- package/chunks/{run-exec-command-HGDHDSXT.js → run-exec-command-XCRQ6UR5.js} +1 -1
- package/chunks/{update-X4G4FEY3.js → update-HOQ5YQFF.js} +1 -1
- package/cli.js +2 -2
- package/package.json +1 -1
- package/chunks/dist-KNYBCP4F.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,83 @@ This changelog covers important changes that directly affect MCode TUI users. It
|
|
|
7
7
|
|
|
8
8
|
Internal refactors, test-only changes, and changes limited to other product surfaces are excluded.
|
|
9
9
|
|
|
10
|
+
## 0.6.6 · 2026-10-10
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `config.yaml` has a new `requestMedia` block, read on every use so changes need no restart.
|
|
15
|
+
`requestMedia.image.max_width`, `max_height` and `max_base64_bytes` set the size every image
|
|
16
|
+
entering the conversation is encoded to, for both tool results and user attachments (defaults
|
|
17
|
+
2000 px, 2000 px and 4.5 MiB; the byte limit is capped at 5 MiB). `requestMedia.recoveryDivisor`
|
|
18
|
+
(default `2`) sets how much of the images a rejected request keeps when it is resent. Invalid
|
|
19
|
+
values fall back to the defaults field by field.
|
|
20
|
+
|
|
21
|
+
### Improved
|
|
22
|
+
|
|
23
|
+
- When a provider rejects a request because it carries too many images or too many bytes (HTTP 413,
|
|
24
|
+
`request_too_large`, "Request Entity Too Large", "too many images", per-image size limits), the
|
|
25
|
+
turn now drops the older images and resends once instead of failing every later request the same
|
|
26
|
+
way. The newest image is always kept. Tool result images dropped this way are saved to the
|
|
27
|
+
Session's `reports/tool-outputs/` folder and replaced with a note giving the path, so `read` can
|
|
28
|
+
load them again.
|
|
29
|
+
- Images in each request are kept within a budget: 20 images for MiniMax M3 models and 100 for other
|
|
30
|
+
models unless the model sets `max_images_per_request`, and two thirds of the request body budget in
|
|
31
|
+
bytes. The request body budget defaults by endpoint (28 MiB for the official Messages API host,
|
|
32
|
+
26 MiB for Google Cloud, 64 MiB for `api.openai.com`, 18 MiB for other gateways) unless the model
|
|
33
|
+
sets `max_request_body_bytes`.
|
|
34
|
+
- MCP tool images, Computer Use screenshots and pasted or `@path` images are encoded like Read tool
|
|
35
|
+
images. A shrunk image is followed by a note with its original size and the coordinate scale.
|
|
36
|
+
Computer Use sessions no longer keep only the latest 2 screenshots per step.
|
|
37
|
+
- Compaction summaries no longer send images to the summary model; each image is described by its
|
|
38
|
+
saved path. After a compaction, the summary names the Session's `snapshots/` and
|
|
39
|
+
`reports/tool-outputs/` folders so earlier files can be found.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- A stdio MCP server returning a message over 10 MiB, such as a full-size image, no longer closes
|
|
44
|
+
the connection with `Connection closed`; the limit is now 64 MiB.
|
|
45
|
+
- A 413 with a JSON body from a BYOK provider now recovers: the error keeps its HTTP status, so the
|
|
46
|
+
image recovery above applies instead of the request failing.
|
|
47
|
+
- `requestMedia.image` is now the only resize applied to Read tool images, attached images and
|
|
48
|
+
browser screenshots. Limits above 1920 or 2000 px take effect, an image within the limits is sent
|
|
49
|
+
unchanged, and a scaled-down image, attachments included, carries one note on its original size
|
|
50
|
+
instead of two. Attached images no longer share a 512 KiB budget per message, so one 1900×1000
|
|
51
|
+
image among several is no longer halved. A screenshot taken after a browser action stays within
|
|
52
|
+
1280 px and 1 MiB, or the configured limits when smaller.
|
|
53
|
+
- Rejections for image dimensions, and errors that report a 413 inside another status, are no longer
|
|
54
|
+
retried as transient failures; the image recovery above runs on the first rejection.
|
|
55
|
+
- When images just returned by tools push the context over the automatic compaction threshold, the
|
|
56
|
+
older tool result images are saved to `reports/tool-outputs/` and replaced with their path, keeping
|
|
57
|
+
the newest, instead of summarizing the whole conversation. The summary dropped those images, and
|
|
58
|
+
the model went on to describe images it no longer had.
|
|
59
|
+
- A Bash `rm -f` that is moved to the trash keeps `-f`, so a missing path in
|
|
60
|
+
`cd project && rm -rf missing && mkdir -p output` no longer fails and stops the commands after
|
|
61
|
+
`&&`. A redirect such as `2>&1`, even after `--`, is no longer treated as a file to delete.
|
|
62
|
+
- Long-thinking models behind a gateway that holds the response until generation finishes no longer
|
|
63
|
+
fail after about 5 minutes 15 seconds with `LLM request timed out`. SSE heartbeats from such a
|
|
64
|
+
gateway are not model events, so the stream idle bound used to cut the request and its single
|
|
65
|
+
retry. The stream idle default is now 60 minutes; the first-response bound stays 300 seconds, and
|
|
66
|
+
a connection that stops sending any bytes is still closed after 300 seconds.
|
|
67
|
+
`MCODE_LLM_STREAM_IDLE_TIMEOUT_MS` still overrides it.
|
|
68
|
+
|
|
69
|
+
## 0.6.5 · 2026-10-08
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- The TUI and embedded CLI now honor the per-Session subagent concurrency limit from
|
|
74
|
+
`config.yaml`, the same setting Desktop already used. The default stays `4`, and only a positive
|
|
75
|
+
safe integer takes effect. New `task` and activating `task_append` calls are admitted immediately:
|
|
76
|
+
when the limit is reached they return `SUBAGENT_CONCURRENCY_LIMIT` instead of queueing and
|
|
77
|
+
reporting Started first. Changing the value takes effect after restarting the Runtime. When a TUI
|
|
78
|
+
and Desktop share one data directory, both count occupancy from the same parent-child records, so
|
|
79
|
+
each process sees the same usage.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
|
|
83
|
+
- The output-speed readout no longer spikes at the start of a turn. Output buffered upstream and
|
|
84
|
+
released in one burst is now excluded, so a burst arriving within the first tenth of the request
|
|
85
|
+
no longer reports a rate far above what the model actually produced.
|
|
86
|
+
|
|
10
87
|
## 0.6.4 · 2026-10-08
|
|
11
88
|
|
|
12
89
|
### Added
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,39 @@ TUI 正式版中用户能直接感知的重要变化。收录范围以 TUI 用
|
|
|
8
8
|
|
|
9
9
|
仅内部重构、测试调整,或只影响其他产品界面且不改变 TUI 行为的变化不记录。
|
|
10
10
|
|
|
11
|
+
## 0.6.6 · 2026-10-10
|
|
12
|
+
|
|
13
|
+
### 新增功能
|
|
14
|
+
|
|
15
|
+
- `config.yaml` 新增 `requestMedia` 配置块,每次使用时读取,修改后不用重启。`requestMedia.image.max_width`、`max_height`、`max_base64_bytes` 决定每张进入对话的图片(工具结果图片和用户附件)压到多大,默认 2000 px、2000 px、4.5 MiB,字节上限最大 5 MiB。`requestMedia.recoveryDivisor`(默认 `2`)决定请求被拒后重发时保留多少图片。非法值逐项回退到默认值。
|
|
16
|
+
|
|
17
|
+
### 改进
|
|
18
|
+
|
|
19
|
+
- 供应商因图片太多或请求体太大拒绝请求时(HTTP 413、`request_too_large`、“Request Entity Too Large”、“too many images”、单张图片超限等),本轮会删掉较早的图片后重发一次,不再让之后的每个请求都以同样的方式失败。最新一张图片始终保留。以这种方式移出的工具结果图片会保存到会话的 `reports/tool-outputs/` 目录,并替换为带路径的说明,可用 `read` 重新读取。
|
|
20
|
+
- 每个请求的图片受预算限制:MiniMax M3 系列最多 20 张,其他模型最多 100 张(模型设置了 `max_images_per_request` 时以其为准);字节不超过请求体预算的 2/3。请求体预算按接入地址取默认值(Messages API 官方地址 28 MiB、Google Cloud 26 MiB、`api.openai.com` 64 MiB、其他网关 18 MiB),模型设置了 `max_request_body_bytes` 时以其为准。
|
|
21
|
+
- MCP 工具图片、Computer Use 截图,以及粘贴或 `@path` 引用的图片,现在都和 Read 工具的图片一样压缩。被缩小的图片后会附上原尺寸和坐标换算倍数。Computer Use 会话不再每步只保留最新 2 张截图。
|
|
22
|
+
- 压缩摘要不再把图片发给摘要模型,每张图片改用保存路径描述。压缩后,摘要会写明会话的 `snapshots/` 和 `reports/tool-outputs/` 目录,方便找回更早的文件。
|
|
23
|
+
|
|
24
|
+
### 问题修复
|
|
25
|
+
|
|
26
|
+
- stdio MCP server 返回超过 10 MiB 的消息(例如一张原尺寸大图)时,不再以 `Connection closed` 断开连接;上限提高到 64 MiB。
|
|
27
|
+
- BYOK 渠道返回 JSON 响应体的 413 时现在可以恢复:报错保留 HTTP 状态码,会走上面的图片恢复,而不是直接失败。
|
|
28
|
+
- Read 工具的图片、用户附加的图片和 Browser 截图现在只按 `requestMedia.image` 压缩一次。超过 1920 或 2000 px 的上限可以生效;在上限内的图片原样发送;被缩小的图片(包括附件)只带一条原尺寸说明,不再出现两条。附件不再按每条消息共享 512 KiB 预算压缩,多张图片中的一张 1900×1000 图片不会再被缩成一半。Browser 操作后自动截取的截图不超过 1280 px 和 1 MiB;配置的上限更小时以配置为准。
|
|
29
|
+
- 因图片尺寸被拒绝,或报错中带有 413 但状态码不是 413 时,不再当作临时错误反复重试;第一次被拒就会走上面的图片恢复。
|
|
30
|
+
- 工具刚返回的图片使上下文超过自动压缩阈值时,较早的工具结果图片会保存到 `reports/tool-outputs/` 并替换为路径,保留最新的图片,不再把整段对话压成摘要。此前摘要会丢掉这些图片,模型随后会描述它已经看不到的图片。
|
|
31
|
+
- Bash 的 `rm -f` 改为移到回收站时保留 `-f`:`cd project && rm -rf missing && mkdir -p output` 中路径不存在时不再报错,`&&` 后面的命令会继续执行。`2>&1` 这类重定向(即使写在 `--` 之后)不再被当作要删除的文件。
|
|
32
|
+
- 经过“生成完成后才下发响应”的网关调用长思考模型时,不再在约 5 分 15 秒后以 `LLM request timed out` 失败。这类网关等待期间只发送 SSE 心跳,心跳不算模型事件,此前流空闲时限会连同唯一一次重试一起截断。流空闲时限默认值改为 60 分钟;首个响应时限仍为 300 秒,连接完全不再收到任何数据时仍会在 300 秒后断开。`MCODE_LLM_STREAM_IDLE_TIMEOUT_MS` 覆盖方式不变。
|
|
33
|
+
|
|
34
|
+
## 0.6.5 · 2026-10-08
|
|
35
|
+
|
|
36
|
+
### 新增功能
|
|
37
|
+
|
|
38
|
+
- TUI 和内嵌 CLI 现在也会遵守 `config.yaml` 中按 Session 配置的子代理并发上限,与 Desktop 早已生效的设置一致。默认值仍为 `4`,只有正安全整数才生效。新的 `task` 和激活型 `task_append` 采用立即准入:达到上限时直接返回 `SUBAGENT_CONCURRENCY_LIMIT`,不再先排队再报告已启动。修改该值需要重启对应 Runtime。TUI 与 Desktop 共用同一 dataDir 时,双方按同一份父子关系统计占用,两个进程看到的占用一致。
|
|
39
|
+
|
|
40
|
+
### 问题修复
|
|
41
|
+
|
|
42
|
+
- 修复一轮开头输出速度虚高的问题。上游缓冲后一次性吐出的输出现在会被排除,突发输出落在请求前 10% 区间时不再报出远高于模型真实速度的数值。
|
|
43
|
+
|
|
11
44
|
## 0.6.4 · 2026-10-08
|
|
12
45
|
|
|
13
46
|
### 新增功能
|
package/README.md
CHANGED
|
@@ -218,15 +218,32 @@ Run `mcode exec --help` for the complete set of headless options.
|
|
|
218
218
|
Each model request attempt has a first-response bound: if the provider accepts the request but
|
|
219
219
|
sends no response within 300 seconds, the attempt is aborted and reported as a retryable timeout,
|
|
220
220
|
so the normal model-request retry runs instead of waiting for the 20-minute overall request limit.
|
|
221
|
-
After the first response event, a stream that
|
|
222
|
-
|
|
221
|
+
After the first response event, a stream that sends no model event for 60 minutes fails the same
|
|
222
|
+
way; SSE heartbeats do not count, so the bound leaves room for gateways that hold a long-thinking
|
|
223
|
+
response until generation finishes. Once visible output has started, the turn fails rather than
|
|
224
|
+
retrying. Override the bounds in
|
|
223
225
|
milliseconds with `MCODE_LLM_FIRST_EVENT_TIMEOUT_MS` and `MCODE_LLM_STREAM_IDLE_TIMEOUT_MS`; `0`
|
|
224
226
|
disables a bound. The timeout error names the setting that fired, and the 20-minute overall request
|
|
225
227
|
limit still applies.
|
|
226
228
|
|
|
227
|
-
Each model request carries at most
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
Each model request carries at most 100 images (20 for MiniMax M3 models, 8 for Mistral's API) and
|
|
230
|
+
two thirds of the request body limit of image data. The request body limit is
|
|
231
|
+
`max_request_body_bytes` on the model, else 28 MiB for `https://api.anthropic.com`, 26 MiB for the
|
|
232
|
+
Messages API on Google Cloud, 64 MiB for `api.openai.com` and 18 MiB for any other endpoint. When either limit is
|
|
233
|
+
exceeded, the oldest tool result images are removed from the history until half of each limit
|
|
234
|
+
remains, each replaced with a note naming its file (images without one are first saved under the
|
|
235
|
+
session's `tool-outputs` folder). Images you attach are never removed from the history; when they
|
|
236
|
+
alone exceed a limit, the oldest are left out of that request only. If the provider still rejects a
|
|
237
|
+
request for its size or images, the request is repeated once with half of the images it carried
|
|
238
|
+
(`requestMedia.recoveryDivisor` in `config.yaml` sets the divisor, default `2`), older tool result
|
|
239
|
+
images removed from the history the same way. When images push the context over the automatic
|
|
240
|
+
compaction threshold while the rest of it fits, older tool result images are removed from the
|
|
241
|
+
history the same way instead of summarizing the conversation: the newest images stay, using at most
|
|
242
|
+
half of the room the rest of the context leaves below the threshold. A context summary request
|
|
243
|
+
carries every image as a note naming its file, and the summary ends with the session folders that
|
|
244
|
+
keep the full history before each compaction (`snapshots`) and tool images and outputs
|
|
245
|
+
(`reports/tool-outputs`). If a
|
|
246
|
+
provider allows fewer images per request, set `max_images_per_request` on the model:
|
|
230
247
|
|
|
231
248
|
```yaml
|
|
232
249
|
custom_provider:
|
|
@@ -238,8 +255,28 @@ custom_provider:
|
|
|
238
255
|
max_images_per_request: 8
|
|
239
256
|
```
|
|
240
257
|
|
|
241
|
-
|
|
242
|
-
|
|
258
|
+
Every image you attach and every tool result image is encoded before it enters the conversation.
|
|
259
|
+
An image wider or taller than the limit is scaled down, keeping its aspect ratio, and followed by a
|
|
260
|
+
note on its original size; one with more base64 data than the limit is re-encoded, then scaled down
|
|
261
|
+
until it fits. The limits are set in `config.yaml`, read for each image without a restart:
|
|
262
|
+
|
|
263
|
+
```yaml
|
|
264
|
+
requestMedia:
|
|
265
|
+
image:
|
|
266
|
+
max_width: 2000 # pixels, default 2000
|
|
267
|
+
max_height: 2000 # pixels, default 2000
|
|
268
|
+
max_base64_bytes: 4718592 # base64 bytes of one image, default 4.5 MiB, at most 5 MiB
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
This is the only resize: the Read tool, attached images and browser screenshots pass on the original
|
|
272
|
+
image, so an image within the limits is sent unchanged and a scaled-down one carries a single note.
|
|
273
|
+
A screenshot taken after a browser action stays within 1280 px and 1 MiB, or these limits when
|
|
274
|
+
smaller. If the image processor cannot load, a tool result image over the limits is replaced with a
|
|
275
|
+
note saying so.
|
|
276
|
+
|
|
277
|
+
Deterministic provider rejections, such as an image count, size or dimension limit, a 413 reported
|
|
278
|
+
in the error, or an HTTP 400 `invalid_request_error`, are not retried; size and image rejections go
|
|
279
|
+
straight to the image recovery above.
|
|
243
280
|
|
|
244
281
|
### Browser operations
|
|
245
282
|
|
package/README.zh-CN.md
CHANGED
|
@@ -52,6 +52,7 @@ API Key 从 `MCODE_PROVIDER_API_KEY` 或 `--api-key-env` 指定的环境变量
|
|
|
52
52
|
|
|
53
53
|
第三方 relay 的自定义 header 配置位于 `custom_provider.<id>.options.headers`,例如
|
|
54
54
|
`headers: { HTTP-Referer: "https://example.com", X-Title: "My CLI" }`;请保留已有 provider 和模型配置。不要把 header 中的凭据放进命令行参数或问题反馈。
|
|
55
|
+
第三方 Provider 的模型请求默认携带 `User-Agent: MiniMaxCode`;在上述 headers 中配置 `User-Agent` 可替换为 relay 要求的值。
|
|
55
56
|
|
|
56
57
|
Fullscreen Transcript 提供可点击、拖动的滚动条。`/statusline` 可选择默认关闭的 `context-meter`
|
|
57
58
|
显示剩余上下文刻度,详情见 [状态栏配置](docs/status-line-config.md)。
|
|
@@ -357,12 +358,17 @@ artifacts 访问权限与保留时间。
|
|
|
357
358
|
|
|
358
359
|
### 模型请求超时与图片上限
|
|
359
360
|
|
|
360
|
-
每次模型请求都有首个响应时限:Provider 接受请求后 300 秒内没有任何响应时,本次尝试会中止并按可重试超时处理,走常规模型请求重试,而不是等满 20 分钟的整体请求上限。收到首个响应事件后,流连续
|
|
361
|
+
每次模型请求都有首个响应时限:Provider 接受请求后 300 秒内没有任何响应时,本次尝试会中止并按可重试超时处理,走常规模型请求重试,而不是等满 20 分钟的整体请求上限。收到首个响应事件后,流连续 60 分钟没有模型事件也按同样方式失败;SSE 心跳不计入,以便兼容“长思考生成完成后才下发响应”的网关。已经开始输出可见内容时,本轮直接失败,不再重试。可用
|
|
361
362
|
`MCODE_LLM_FIRST_EVENT_TIMEOUT_MS` 和 `MCODE_LLM_STREAM_IDLE_TIMEOUT_MS`
|
|
362
363
|
以毫秒覆盖这两个时限,设为 `0` 表示关闭。超时错误会写明触发的是哪项设置,20 分钟整体上限仍然有效。
|
|
363
364
|
|
|
364
|
-
单次模型请求默认最多携带 20
|
|
365
|
-
|
|
365
|
+
单次模型请求默认最多携带 100 张图片(MiniMax M3 系列为 20 张,Mistral API 为 8 张),图片数据最多占请求体上限的三分之二。请求体上限取模型的
|
|
366
|
+
`max_request_body_bytes`;未配置时 `https://api.anthropic.com` 为 28 MiB,Google Cloud 上的 Messages API 为 26 MiB,`api.openai.com`
|
|
367
|
+
为 64 MiB,其他地址为 18 MiB。超过任一上限时,最早的工具结果图片会从历史中移除,直到降到上限的一半,每张换成一行写明文件路径的说明(没有路径的图片先保存到会话的
|
|
368
|
+
`tool-outputs` 目录)。你附加的图片不会从历史中移除,只在它们单独超限时从本次请求里去掉最早的几张。Provider
|
|
369
|
+
仍因体积或图片拒绝请求时,会带着原请求一半的图片重发一次(分母可用 `config.yaml` 的 `requestMedia.recoveryDivisor`
|
|
370
|
+
配置,默认 `2`),较早的工具结果图片同样从历史中移除。上下文其余部分未超限、只因图片超过自动压缩阈值时,同样从历史中移除较早的工具结果图片,而不是把对话压成摘要:保留最新的图片,所占不超过其余部分到阈值剩余空间的一半。上下文摘要请求不携带图片,每张图片都换成写明文件路径的说明;生成的摘要末尾附上会话的 `snapshots`(每次压缩前的完整历史)和 `reports/tool-outputs`(工具图片与输出)两个目录。Provider
|
|
371
|
+
允许的单次图片数更少时,可在模型上设置 `max_images_per_request`:
|
|
366
372
|
|
|
367
373
|
```yaml
|
|
368
374
|
custom_provider:
|
|
@@ -374,7 +380,20 @@ custom_provider:
|
|
|
374
380
|
max_images_per_request: 8
|
|
375
381
|
```
|
|
376
382
|
|
|
377
|
-
|
|
383
|
+
你附加的图片和工具结果图片在进入对话前都会先编码:宽或高超过上限的等比缩小,并在图片后附上原尺寸说明;base64
|
|
384
|
+
数据超过上限的先换编码,仍超限再继续缩小,直到满足上限。上限在 `config.yaml` 中配置,每张图片编码时读取当前值,修改后不需要重启:
|
|
385
|
+
|
|
386
|
+
```yaml
|
|
387
|
+
requestMedia:
|
|
388
|
+
image:
|
|
389
|
+
max_width: 2000 # 像素,默认 2000
|
|
390
|
+
max_height: 2000 # 像素,默认 2000
|
|
391
|
+
max_base64_bytes: 4718592 # 单张图片的 base64 字节数,默认 4.5 MiB,最大 5 MiB
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
这是唯一一次缩放:Read 工具、附加的图片和 Browser 截图都交出原图,在上限内的图片原样发送,被缩小的图片只带一条说明。Browser 操作后自动截取的截图不超过 1280 px 和 1 MiB,上面的上限更小时以其为准。图片处理组件无法加载时,超过上限的工具结果图片会替换为一条说明。
|
|
395
|
+
|
|
396
|
+
图片数量、体积或尺寸超限、报错中带有 413、HTTP 400 `invalid_request_error` 等确定性拒绝不再重试;体积和图片类拒绝直接走上面的图片恢复。
|
|
378
397
|
|
|
379
398
|
### Browser 操作
|
|
380
399
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{c as a}from"./chunk-
|
|
2
|
+
import{c as a}from"./chunk-LQIEYG3O.js";import"./chunk-NICEDCLM.js";import"./chunk-FKQFVOLR.js";import"./chunk-3MHUE4DM.js";import"./chunk-RDUENEEQ.js";import"./chunk-HQ2U4QVQ.js";import"./chunk-3FETZOUF.js";import"./chunk-CWWDVX6C.js";import"./chunk-D76SO2ME.js";export{a as McodeUpdateApplication};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{a as o,b as l,c as u}from"./chunk-
|
|
2
|
+
import{a as o,b as l,c as u}from"./chunk-WQPQHX2N.js";import"./chunk-VCAGMAY5.js";import{d as p}from"./chunk-EGP34E73.js";import"./chunk-52X742AN.js";import"./chunk-EZ7Q2NM4.js";import"./chunk-3FETZOUF.js";import"./chunk-CWWDVX6C.js";import"./chunk-ZITT4GJK.js";import"./chunk-D76SO2ME.js";async function A(r={}){let a=r.createApplication?r.createApplication(r.region):await c(r.region,r.prepareDataDir),t=r.writeError??(e=>process.stderr.write(e));return(await a.login(e=>{let n=l(e.verificationUriComplete??e.verificationUri);if(t(`Open: ${n}
|
|
3
3
|
Code: ${e.userCode}
|
|
4
4
|
Waiting for authorization\u2026
|
|
5
5
|
`),r.openBrowser===!1)return;(r.openExternalTarget??o(process.cwd()))(n).catch(()=>{t(`Couldn't open the default browser. Open the authorization URL above manually.
|