Skip to content

Commit 8ced9d8

Browse files
feat: sync the Mini App contract with MiniMax Code 3.1.11 (#105)
* feat(check): validate the MiniMax Code 3.1.11 Mini App contract - deviceAccess accepts "camera" and "notifications" (minimum 3.1.9); hostAccess accepts only ["navigation.read"] (minimum 3.1.11, held in NEXT_RELEASE so a late renumbering is one line). - Minimums are the first release with installers for both macOS and Windows: 3.1.5 shipped none, so session.read, toolAccess, deviceAccess, engines, and the browser-permission gate move to 3.1.6; 3.1.8 shipped no Windows installer, so camera and notifications start at 3.1.9. - ACCESS_UNDECLARED reads the getUserMedia constraints (audio, video, or either when not a literal), covers Notification, and reports host.navigation reads without hostAccess. Browser permissions are one diagnostic per file naming every missing device. - apps references must exist and hold { schemaVersion: 1, provider } with unique providers (MANIFEST_APP_INVALID); MANIFEST_APPS_IGNORED is gone because clients from 3.1.9 read them. - README version mentions rank a pre-release below its release. * docs: publish the MiniMax Code 3.1.11 Mini App contract - Camera and system notifications through deviceAccess (3.1.9), the miniapp.host page API and hostAccess (3.1.11), local apps references, and modeChangeReloadsPage on pop-out. - Lifecycle: from 3.1.11 the service limit depends on memory, and the Host reclaims only when the user opens a Mini App past the limit or the system is short of memory; no idle timeout or keep-alive. Authors persist as they go and finish dispose() within 2 s. - Every 3.1.5 minimum becomes 3.1.6, because 3.1.5 shipped no installers; AGENTS.md now says how to check a release on the CDN. - The root READMEs explain why GitHub import of this repository fails. - Sync the example's client-api.ts from the 3.1.11 creator skill. Assisted-by: Claude Opus 5.5 (OpenCode)
1 parent b9e3706 commit 8ced9d8

24 files changed

Lines changed: 686 additions & 175 deletions

‎AGENTS.md‎

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ package at `plugins/<github-username>/<plugin-id>/`; the rest change the checks
1515
2. Read `docs/runtime.md` before editing `miniapp/node/*`. Read `docs/security.md` before the
1616
Node code reads or writes files, spawns processes, or makes network requests. Read
1717
`docs/client.md` before the page calls `window.mcode` or a browser permission such as
18-
`getUserMedia`, `docs/agent.md` before declaring `agentAccess`, and `docs/tool.md` before
19-
declaring `toolAccess`.
18+
`getUserMedia` or `Notification`, `docs/agent.md` before declaring `agentAccess`, and
19+
`docs/tool.md` before declaring `toolAccess`.
2020
3. Write `README.md` (English; `README.zh-CN.md` optional): what it does, how to install and open
2121
it, and the headings `## Tested environment` and `## Data & access` (files read/written,
22-
network hosts, spawned processes, Agent turns, conversations read, tools called, microphone use,
23-
where state is stored). When the package uses a feature with a minimum client version
22+
network hosts, spawned processes, Agent turns, conversations read, tools called, microphone,
23+
camera, and notification use, Host navigation read, where state is stored). When the package uses a feature with a minimum client version
2424
(`docs/package-contract.md`), name a MiniMax Code version at or above it under
2525
`## Tested environment`.
2626
4. Add one row to the table in both root READMEs.
@@ -36,7 +36,11 @@ package at `plugins/<github-username>/<plugin-id>/`; the rest change the checks
3636
- stdout and stdin belong to the Host. Log through `context.logger`.
3737
- The Node entry is ESM with a named export `start(context)`. Resolve `start` only after the
3838
listener accepts connections on `context.listen`. Return `{ dispose }`; `dispose` closes
39-
everything the entry started: server, timers, child processes, streams, file handles.
39+
everything the entry started: server, timers, child processes, streams, file handles, within
40+
2 seconds.
41+
- While no page is visible, the Host may stop the Node process or reload the page without notice
42+
or callback. Write durable state as it changes and save view state on `visibilitychange`; polling
43+
and heartbeats keep nothing alive.
4044
- Bind only `context.listen.host` / `context.listen.port`, with a `node:http` server (or a framework
4145
on top of it); `https`, `http2`, `tls`, raw `net`, or a child process on that port never becomes
4246
ready. Serve `surface.path` plus your own routes, none under `/__mavis/`.
@@ -46,7 +50,8 @@ package at `plugins/<github-username>/<plugin-id>/`; the rest change the checks
4650
App payload, the page APIs, the Agent API, and the tool API; treat `context.hostConnector` and the
4751
other capabilities as outside its scope.
4852
- Declare exactly the access the code uses: `agentAccess` (`session.run`, `session.read`),
49-
`toolAccess`, `deviceAccess`. A call without its declaration fails at runtime, and
53+
`toolAccess`, `deviceAccess` (`microphone`, `camera`, `notifications`), `hostAccess`
54+
(`navigation.read`). A call without its declaration fails at runtime, and
5055
`npm run check` reports it as `ACCESS_UNDECLARED`; do not declare access the app does not use.
5156
- `agentAccess` gives an Agent with files, shell, and MCP, and `session.read` exposes every user
5257
conversation. Never answer a `permission.requested` with `allowOnce` unless the user chose it.
@@ -62,16 +67,23 @@ package at `plugins/<github-username>/<plugin-id>/`; the rest change the checks
6267
## Review policy
6368

6469
Maintainers gate on three things: manifests pass `npm run check`; the README describes real
65-
behaviour (files, network, processes, Agent turns, conversations read, tools called, microphone
66-
use, tested environment); the package cannot damage Host or user data. Everything else is a
70+
behaviour (files, network, processes, Agent turns, conversations read, tools called, device use,
71+
tested environment); the package cannot damage Host or user data. Everything else is a
6772
suggestion.
6873

6974
## Change the checks or the docs
7075

7176
`scripts/` mirrors the MiniMax Code package reader; `docs/` publishes the same contract.
7277

73-
- A minimum in `FEATURE_MIN_HOST_VERSION` is the first released MiniMax Code that accepts the
74-
field. Preview builds ship features early and are not evidence.
78+
- A minimum in `FEATURE_MIN_HOST_VERSION` is the first MiniMax Code release that accepts the
79+
field and has installers for both macOS and Windows on the production CDN. A tag, a preview
80+
build, or a release on one platform only is not evidence: 3.1.5 shipped no installers and 3.1.8
81+
none for Windows. Check that `MiniMax%20Code-<version>-arm64.dmg` and
82+
`MiniMax%20Code%20Setup%20<version>.exe` answer 200 under both
83+
`https://filecdn.minimax.chat/public/minimax-agent-prod/release/` and
84+
`https://file.cdn.minimax.io/public/minimax-agent-prod/release/`.
85+
- A feature that ships first in the next release uses `NEXT_RELEASE` in `scripts/lib/contract.mjs`.
86+
Its PR stays a draft until that release's installers pass the check above.
7587
- Change `scripts/lib/contract.mjs`, the rule, its `test/<rule>.test.mjs`, and the matching
7688
`docs/` page together, and update the docs' `Verified against` line. The checker stays
7789
dependency-free.
@@ -83,14 +95,15 @@ suggestion.
8395

8496
- `docs/package-contract.md` — layout, the three manifests, portable paths, limits, permission
8597
switches, minimum client versions, declared access versus code
86-
- `docs/runtime.md` — `start(context)`, `dispose`, logger, lifecycle, loopback authentication
87-
- `docs/client.md` — page APIs: `capabilities`, browser permissions, `message.append`, `agent`,
88-
`speech.transcribe`, `tool.request`, `window`
98+
- `docs/runtime.md` — `start(context)`, `dispose`, logger, lifecycle and reclaim, loopback
99+
authentication
100+
- `docs/client.md` — page APIs: `capabilities`, browser permissions (microphone, camera,
101+
notifications), `message.append`, `agent`, `speech.transcribe`, `tool.request`, `host`, `window`
89102
- `docs/agent.md` — `agentAccess`, sessions, calls, `whenBusy`, reading and observing sessions,
90103
events, errors
91104
- `docs/tool.md` — `toolAccess`, `context.tool`, permission prompts, errors
92105
- `docs/security.md` — process boundary, state, writing outside `dataDir`, spawning, network, Agent
93-
turns, reading conversations, calling tools, microphone
106+
turns, reading conversations, calling tools, microphone and camera, notifications, Host navigation
94107
- `docs/snippets/audio-capture.ts` — microphone capture in the format `speech.transcribe` takes
95108
- `examples/hello-miniapp/` — the copyable starting point
96109
- `CONTRIBUTING.md` — fork, pull request, and license steps for people

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We welcome tools, games, and other interesting apps you have built for MiniMax C
66

77
1. Fork this repository and add your complete plugin package under `plugins/<your-github-username>/<plugin-id>/`. Use a lowercase GitHub username for the author directory.
88
2. Start from `examples/hello-miniapp/`. Include the hidden `.minimax-plugin/` directory, `package.json`, `miniapp/`, and all required runtime assets. The plugin must work when copied on its own, without depending on other directories in this repository. The exact rules are in `docs/package-contract.md`, `docs/runtime.md`, `docs/client.md`, `docs/agent.md`, `docs/tool.md`, and `docs/security.md`.
9-
3. Add a short English `README.md`. You may also include `README.zh-CN.md` with links between the two versions. Explain what the app does, how to install and use it, tested client versions and operating systems, required configuration, file access, network requests, any Agent turns it runs, conversations it reads, tools it calls, and microphone use. Screenshots or GIFs are welcome. Declare in `miniapp/miniapp.json` exactly the access the code uses; `npm run check` reports calls without a declaration. If the app uses a feature that needs a newer client, such as `agentAccess`, `toolAccess`, `deviceAccess`, or `surface.window`, name a MiniMax Code version at or above its minimum under `## Tested environment` (see "Minimum client version" in `docs/package-contract.md`).
9+
3. Add a short English `README.md`. You may also include `README.zh-CN.md` with links between the two versions. Explain what the app does, how to install and use it, tested client versions and operating systems, required configuration, file access, network requests, any Agent turns it runs, conversations it reads, tools it calls, microphone, camera, or notification use, and whether it reads which MiniMax Code page you are on. Screenshots or GIFs are welcome. Declare in `miniapp/miniapp.json` exactly the access the code uses; `npm run check` reports calls without a declaration. If the app uses a feature that needs a newer client, such as `agentAccess`, `toolAccess`, `deviceAccess`, `hostAccess`, or `surface.window`, name a MiniMax Code version at or above its minimum under `## Tested environment` (see "Minimum client version" in `docs/package-contract.md`).
1010
4. Include a `LICENSE` you are entitled to use, and preserve required attribution for third-party code and assets.
1111
5. Add an entry to the app tables in both root READMEs, run `npm run check` (Node.js 22 or later) until it reports no errors, and open a pull request.
1212

‎CONTRIBUTING.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
1. Fork 本仓库,在 `plugins/<你的 GitHub username>/<plugin-id>/` 下放入完整插件包。用户名目录统一使用小写。
88
2. 从 `examples/hello-miniapp/` 复制开始。保留 `.minimax-plugin/` 隐藏目录、`package.json`、`miniapp/` 和运行所需资源。插件应能独立复制使用,不依赖仓库里的其他目录。具体规则见 `docs/package-contract.md`、`docs/runtime.md`、`docs/client.md`、`docs/agent.md`、`docs/tool.md` 和 `docs/security.md`(英文)。
9-
3. 添加简短的英文 `README.md`,可另附 `README.zh-CN.md` 并互相链接。说明用途、安装与使用方式、已验证的客户端版本和系统,以及需要的配置、文件访问、网络请求、会运行的 Agent 任务、会读取的会话、会调用的工具和麦克风使用情况。欢迎附上截图或 GIF。`miniapp/miniapp.json` 中只声明代码实际用到的权限;代码调用了未声明的能力时,`npm run check` 会报出来。如果用到了需要较新客户端的能力(如 `agentAccess`、`toolAccess`、`deviceAccess`、`surface.window`),请在 `## Tested environment` 中写明不低于最低要求的 MiniMax Code 版本(见 `docs/package-contract.md` 的 “Minimum client version”)。
9+
3. 添加简短的英文 `README.md`,可另附 `README.zh-CN.md` 并互相链接。说明用途、安装与使用方式、已验证的客户端版本和系统,以及需要的配置、文件访问、网络请求、会运行的 Agent 任务、会读取的会话、会调用的工具,是否使用麦克风、摄像头或系统通知,以及是否读取你当前所在的 MiniMax Code 页面。欢迎附上截图或 GIF。`miniapp/miniapp.json` 中只声明代码实际用到的权限;代码调用了未声明的能力时,`npm run check` 会报出来。如果用到了需要较新客户端的能力(如 `agentAccess`、`toolAccess`、`deviceAccess`、`hostAccess`、`surface.window`),请在 `## Tested environment` 中写明不低于最低要求的 MiniMax Code 版本(见 `docs/package-contract.md` 的 “Minimum client version”)。
1010
4. 添加你有权使用的 `LICENSE`,保留第三方代码和素材要求的署名。
1111
5. 在根目录中英文 README 的作品表格中各增加一行,运行 `npm run check`(需要 Node.js 22 或更高版本)直到没有 error,再提交 Pull Request。
1212

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ The preview uses synthetic data. The app interface is currently in Chinese. See
130130

131131
### Requirements
132132

133-
Use a MiniMax Code desktop version that supports MiniApps. Check the app's README for tested client versions, operating systems, configuration, and known limitations. Compatibility is documented per app. Apps that use newer capabilities need a newer client, and older versions cannot install them: running Agent tasks or opening in their own window needs MiniMax Code 3.1.2 or later; reading your conversations, calling your installed tools, or using the microphone needs 3.1.5 or later. From 3.1.5 you can switch off each permission an app declares, one by one, in its plugin details.
133+
Use a MiniMax Code desktop version that supports MiniApps. Check the app's README for tested client versions, operating systems, configuration, and known limitations. Compatibility is documented per app. Apps that use newer capabilities need a newer client, and older versions cannot install them: running Agent tasks or opening in their own window needs MiniMax Code 3.1.2 or later; reading your conversations, calling your installed tools, or using the microphone needs 3.1.6 or later; using the camera or showing system notifications needs 3.1.9 or later; following which MiniMax Code page you are on needs 3.1.11 or later. From 3.1.6 you can switch off each permission an app declares, one by one, in its plugin details.
134134

135135
### 1. Download
136136

@@ -163,7 +163,7 @@ The installed manifest must be at:
163163

164164
The author directory (`amszuidas/`) only groups contributions in the repository. Copy the plugin directory directly into the client's `plugins/` directory, without that extra author level.
165165

166-
These packages use **manual installation**. The client's GitHub plugin import feature does not support these MiniApp packages.
166+
These packages use **manual installation**. Importing them with the client's GitHub plugin import does not work: the client downloads the whole repository, which is larger than its 128 MiB limit.
167167

168168
### 3. Open
169169

‎README.zh-CN.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求
130130

131131
### 使用要求
132132

133-
需要支持 MiniApp 的 MiniMax Code 桌面端版本。各作品的 README 会说明已验证的客户端版本、操作系统、所需配置和已知限制,兼容性以具体作品为准。使用较新能力的作品需要较新的客户端,旧版本无法安装:运行 Agent 任务、在独立窗口中打开需要 MiniMax Code 3.1.2 或更高版本;读取你的会话、调用你已安装的工具或使用麦克风需要 3.1.5 或更高版本。从 3.1.5 起,你可以在每个作品的插件详情里逐项关闭它声明的权限。
133+
需要支持 MiniApp 的 MiniMax Code 桌面端版本。各作品的 README 会说明已验证的客户端版本、操作系统、所需配置和已知限制,兼容性以具体作品为准。使用较新能力的作品需要较新的客户端,旧版本无法安装:运行 Agent 任务、在独立窗口中打开需要 MiniMax Code 3.1.2 或更高版本;读取你的会话、调用你已安装的工具或使用麦克风需要 3.1.6 或更高版本;使用摄像头或发送系统通知需要 3.1.9 或更高版本;读取你当前所在的 MiniMax Code 页面需要 3.1.11 或更高版本。从 3.1.6 起,你可以在每个作品的插件详情里逐项关闭它声明的权限。
134134

135135
### 1. 下载
136136

@@ -163,7 +163,7 @@ git clone https://github.com/MiniMax-AI/MiniMax-Code-MiniApps.git
163163

164164
作者目录(`amszuidas/`)只用于仓库归类。复制到客户端时,将插件目录直接放入 `plugins/`,不要多套一层作者目录。
165165

166-
这些插件包采用**手动安装**方式,客户端的 GitHub 插件导入功能目前不支持这类 MiniApp 包。
166+
这些插件包采用**手动安装**方式。用客户端的 GitHub 插件导入功能无法安装:客户端会下载整个仓库,而本仓库已超过它 128 MiB 的上限。
167167

168168
### 3. 打开
169169

‎docs/agent.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Mini App Agent API
22

3-
Verified against MiniMax Code 3.1.6. Clients before 3.1.2 reject packages that declare
4-
`agentAccess`, and clients before 3.1.5 reject `"session.read"`.
3+
Verified against MiniMax Code 3.1.11. Clients before 3.1.2 reject packages that declare
4+
`agentAccess`, and clients before 3.1.6 reject `"session.read"`.
55

66
A Mini App can run Agent turns from its Node entry (`context.agent`) or its page
77
(`window.mcode.miniapp.agent`). The Agent keeps its full capabilities: files, shell, Skills, and MCP,
@@ -22,22 +22,22 @@ at runtime; a page that only prepares text for the user to send should use
2222
`context.agent` is absent and page calls reject with `not_permitted`.
2323
- `"session.run"` runs Agent turns in this Mini App's own sessions: `run`, `answer`, `reply`,
2424
`cancel`, `open`, `models`, `agents`, `create`.
25-
- `"session.read"` (MiniMax Code 3.1.5 or later) lists, reads, and observes the user's own
25+
- `"session.read"` (MiniMax Code 3.1.6 or later) lists, reads, and observes the user's own
2626
conversations, including the final reply of every turn: `sessions()`, `session()`, and
2727
`observe()` (see [Reading and observing the user's sessions](#reading-and-observing-the-users-sessions)).
2828
It does not let the Mini App run, answer, or continue those conversations.
2929
- The two values are independent; declare both when the Mini App needs both. Either one lets the
3030
Mini App read and observe its own sessions.
3131
- `agentConcurrency` (1–32, default 4) caps how many turns of this Mini App run at once.
3232
- Changing any of these fields restarts the Mini App process when the package is updated.
33-
- The user can switch either value off in the plugin details (MiniMax Code 3.1.5 or later). The
33+
- The user can switch either value off in the plugin details (MiniMax Code 3.1.6 or later). The
3434
Mini App keeps running and `context.agent` stays; calls covered by that value fail with
3535
`NOT_PERMITTED` / `not_permitted` until the user switches it back on. Show an explanation in the
3636
page instead of failing.
3737
- State in the README `## Data & access` that the Mini App runs Agent turns or reads the user's
3838
conversations, and what it does with them (see `docs/security.md`).
3939
- Feature-detect calls added after 3.1.2 with `capabilities?.has(...)`: `agent.observe`,
40-
`agent.sessions`, and `agent.session` exist from 3.1.5.
40+
`agent.sessions`, and `agent.session` exist from 3.1.6.
4141

4242
## Sessions
4343

@@ -86,7 +86,7 @@ Node calls take an options object `{ signal?, onEvent? }`; page calls take `{ on
8686

8787
### Follow-ups while the session is busy (`whenBusy`)
8888

89-
From MiniMax Code 3.1.5, `run({ sessionId, text, whenBusy })` decides what happens when that session
89+
From MiniMax Code 3.1.6, `run({ sessionId, text, whenBusy })` decides what happens when that session
9090
is already running a turn; without `whenBusy` the call fails with `busy`. On an idle session both
9191
values just start a turn.
9292

@@ -111,7 +111,7 @@ to free the slot.
111111
`answer` calls wait in order, up to four times `agentConcurrency`; beyond that they fail with
112112
`busy`.
113113
- A Mini App starts at most 12 turns per 60 seconds, or 5 × `agentConcurrency` when that is larger
114-
(MiniMax Code 3.1.5 or later). Past that, calls fail with `busy`. The count survives a Mini App
114+
(MiniMax Code 3.1.6 or later). Past that, calls fail with `busy`. The count survives a Mini App
115115
restart.
116116
- Node sees why a call is `BUSY` in `reason`: `session_busy`, `queue_full`, `rate_limited`, or
117117
`observer_limit`. The page only receives `busy`.
@@ -179,7 +179,7 @@ Ignore any `type` you do not know; new types may be added.
179179

180180
## Reading and observing the user's sessions
181181

182-
These calls exist from MiniMax Code 3.1.5. They need `"session.read"`, except for this Mini App's own
182+
These calls exist from MiniMax Code 3.1.6. They need `"session.read"`, except for this Mini App's own
183183
sessions, which either `agentAccess` value covers. They change nothing: a lost answer is
184184
`AGENT_UNAVAILABLE` / `runtime_unavailable` and safe to retry.
185185

0 commit comments

Comments
 (0)