Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ update one package at `plugins/<github-username>/<plugin-id>/`.
their shape only, and the Host validates them at install time. This repository documents the Mini
App payload, the page APIs, and the Agent API; treat `context.hostConnector` and the other
capabilities as outside its scope.
- `agentAccess` gives an Agent with files, shell, and MCP. Declare it only when needed, and never
answer a `permission.requested` with `allowOnce` unless the user chose it.
- `agentAccess: ["session.run"]` gives an Agent with files, shell, and MCP. `session.read` is a
separate read-only Host extension; it does not authorize Agent turns. Declare only the grants
the app needs, and never answer a `permission.requested` with `allowOnce` unless the user chose it.
- The runtime payload is exactly `miniapp/client` and `miniapp/node`. Keep tests and docs outside
`miniapp/`. Vendor third-party code inside the payload; `node_modules` is never committed.
- Paths are portable: ASCII, no symlinks, no `..`. `npm run check` enforces the full rule set.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques
| [Anatomy Gallery](plugins/zch0227/anatomy-gallery/) | A gallery for interactive isometric figures made with the anatomy skill: hang them in rooms you organize, view light and dark editions full screen, keep every version, and have an Agent create or edit figures from the gallery with a per-run process log. The anatomy skill is bundled. Requires MiniMax Code 3.1.2 or later | [zch0227](https://github.com/zch0227) |
| [仓库透视 / Repo X-Ray](plugins/yujiachen-y/repo-xray/) | Understand a codebase from its Git history: a code map you can drill into, hotspots and bug magnets, high-risk files, owners and knowledge loss, commit rhythm and firefighting, and the tech stack. Works with GitHub, GitLab, and local repositories; analysis runs on your machine | [yujiachen-y](https://github.com/yujiachen-y) |
| [Disk Insight](plugins/zch0227/disk-insight/) | See where disk space went on macOS and Windows with a sunburst space map, find junk files sorted into three safety tiers, large and duplicate files, and how much code repositories and Git worktrees take; ask an Agent about any item, and permanently delete what you select after a confirmation that lists every item. Requires MiniMax Code 3.1.2 or later | [zch0227](https://github.com/zch0227) |
| [MiniMax Pet](plugins/minimax-ai/minimax-pet/) | A lightweight companion with appearance, task and settings tabs, visible-session activity, answer-needed reminders and a transparent desktop pet. Requires a Host build with the read/observe APIs documented in its README | [MiniMax](https://github.com/MiniMax-AI) |

<details>
<summary>Preview: Token Usage Board</summary>
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求
| [Anatomy 画廊](plugins/zch0227/anatomy-gallery/README.zh-CN.md) | 集中展示 anatomy 技能做出的交互式等距图解:按自建展区挂墙,全屏查看明暗两版,保留全部历史版本;在画廊里让 Agent 新建或修改作品,每次运行都有过程记录。自带 anatomy 技能。需要 MiniMax Code 3.1.2 或更高版本 | [zch0227](https://github.com/zch0227) |
| [仓库透视](plugins/yujiachen-y/repo-xray/README.zh-CN.md) | 从 Git 历史看懂一个代码仓库:可逐层下钻的代码地图、热点与 Bug 磁铁、高风险文件、负责人与知识流失、提交节奏与救火记录、技术栈;支持 GitHub、GitLab 和本机仓库,全部在本机分析 | [yujiachen-y](https://github.com/yujiachen-y) |
| [磁盘透视](plugins/zch0227/disk-insight/README.zh-CN.md) | 查看 macOS 和 Windows 的磁盘空间去向:旭日图空间地图,按三档风险分类的垃圾文件,大文件和重复文件,代码仓库和 Git worktree 的占用;任何条目都可以问 Agent,选中的条目在确认框里逐一列出,确认后直接永久删除。需要 MiniMax Code 3.1.2 或更高版本 | [zch0227](https://github.com/zch0227) |
| [MiniMax Pet](plugins/minimax-ai/minimax-pet/) | 提供外观/任务/设置、可见会话状态、需要回答提醒和透明桌宠;需使用具备 README 所列读取/观察接口的 Host 版本 | [MiniMax](https://github.com/MiniMax-AI) |

<details>
<summary>预览:Token 用量看板</summary>
Expand Down
42 changes: 41 additions & 1 deletion docs/agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Mini App Agent API

Verified against MiniMax Code 3.1.2. Earlier clients reject packages that declare `agentAccess`.
Agent-turn APIs verified against MiniMax Code 3.1.2. Earlier clients reject packages that declare
`agentAccess`. Read access requires 3.1.4 or later (observed on 3.1.4-preview). The observation
extension below needs additional Host support; its minimum released client version is unverified.

A Mini App can run Agent turns from its Node entry (`context.agent`) or its page
(`window.mcode.miniapp.agent`). The Agent keeps its full capabilities: files, shell, Skills, and MCP,
Expand Down Expand Up @@ -32,6 +34,44 @@ at runtime; a page that only prepares text for the user to send should use
- State in the README `## Data & access` that the Mini App runs Agent turns and what it asks them
to do (see `docs/security.md`).

### Read-only session extension

`agentAccess: ["session.read"]` declares read access without permission to create or run Agent
turns, answer questions, decide approvals, or stop the user's work. `session.run` does not imply
read access to user conversations. A package that needs both must declare both, once each.

The `sessions` and `session` reads require 3.1.4 or later, as above. The observation methods used
by the desktop pet additionally require a supporting Host build; their minimum released version
has not been verified. Check the page's `capabilities.has` and method availability before use
(see `docs/client.md`).

| Page call | Read behavior |
| --- | --- |
| `sessions()` | Returns `{ sessions }` containing up to the 50 most recently updated visible root user conversations. It excludes Mini App-owned, scheduled and sub-Agent sessions. |
| `session()` | Returns the conversation this page belongs to. The observed 3.1.4-preview build rejects with `not_permitted` outside a conversation; callers should also handle an absent result from other builds. This is not a promise to identify the currently focused main-window conversation. |
| `session(sessionId)` | Returns a visible conversation's summary, current model when available, and latest assistant reply when available. It does not expose arbitrary Host files. |
| `observe({ all: true, requestId }, { onEvent })` | Tails lifecycle events for visible user conversations. Use it together with `sessions()`; it is not a complete historical snapshot. |
| `observe({ sessionId, requestId }, { onEvent })` | Tails progress events for one readable conversation. It does not replay earlier events or deliver actionable approval/question requests to the observer. |
| `cancel(requestId)` | Cancels this Mini App's observation request, not the observed user's Agent turn. |

Summary statuses are `idle`, `running`, `error`, or `aborted`; timestamps use Unix milliseconds.
Global observation provides `turn.started`, `message.committed`, and `turn.finished`; a single
session also exposes progress such as text and tool events. Ignore unknown event types. Inferring
an ask reminder from a tool event does not authorize answering the question, and missing events
do not prove there is no pending ask.

Exactly one observation target is required. Each Mini App has at most four concurrent observers;
observers consume no Agent-run slots. An observation's promise settles when the subscription
ends. When replacing one, cancel it and wait for that promise to settle before admitting a new
observer. Observers are tail-only, so interrupted or late subscriptions can miss events. Permission
revocation, page/process shutdown or deletion can end them; clear stale UI state and reconnect
only while permission is available. These are observation limits, separate from `agentConcurrency`.

Keep user conversation data transient unless the app explicitly documents persistence. Do not
forward it to a network service or include it in diagnostics without the user's authorization.
The version check for the read grant does not prove that the observation methods are available
or that an installed Host has granted access.

## Sessions

Each Mini App owns its sessions and can continue only those. They are hidden from the user's
Expand Down
43 changes: 39 additions & 4 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Verified against MiniMax Code 3.1.2.

Session reads require 3.1.4 or later (observed on 3.1.4-preview). Observation and speech additionally
require a Host build that implements them; their minimum released client version is unverified.
These capabilities are not part of the 3.1.2 verification claim.

MiniMax Code injects `window.mcode.miniapp` into the Mini App's own page. Older clients, ordinary
Browser tabs, and other browsers do not provide it, so check that a method exists before calling
it. No SDK is needed. For type checking, copy `examples/hello-miniapp/miniapp/client/client-api.ts`
Expand All @@ -16,7 +20,7 @@ scripts out of that document: anything running there shares the page's access to
Asks the user to add plain text to the chat input of the conversation the Mini App is open in. The
Host shows its own confirmation with the plugin, the target conversation, and the text. After the
user confirms, the text is appended to the unsent draft; the user can still edit it and must press
Send. The page cannot send messages, read chat history, or change sent messages.
Send. This method cannot send messages, read chat history, or change sent messages.

```js
async function addToChat(text, status) {
Expand Down Expand Up @@ -44,9 +48,40 @@ async function addToChat(text, status) {

## `miniapp.agent`

Runs Agent turns from the page. Present only on MiniMax Code 3.1.2 or later, and calls reject with
`not_permitted` unless `miniapp.json` declares `agentAccess`. The calls, sessions, events, and
errors are in `docs/agent.md`.
Runs Agent turns from the page with `agentAccess: ["session.run"]` on MiniMax Code 3.1.2 or later.
Hosts with the read extension also offer `sessions`, `session` and `observe` with
`agentAccess: ["session.read"]`; this does not authorize running or answering a turn. The calls,
sessions, events, and errors are in `docs/agent.md`.

## Capability checks for Host extensions

Some Host builds expose `window.mcode.miniapp.capabilities.has(name)`. It reports whether the Host
offers an API, independently of the Mini App's manifest and the user's permission switches.
Older Hosts may omit `capabilities` altogether. Check both the capability and the method before
showing an extension-dependent control, and still handle permission and runtime errors.

For read-only session features, the capability names are `agent.sessions`, `agent.session`, and
`agent.observe`. For speech, check `speech.transcribe`. Neither a capability probe nor a passing
repository validator guarantees that the user granted access.

## `miniapp.speech` (Host extension)

Requires a Host build with `capabilities?.has('speech.transcribe') === true`, a callable
`speech.transcribe`, `deviceAccess: ["microphone"]`, and microphone permission. A released minimum
client version has not been verified. Feature-detect it and keep text input available when absent.

The page captures an utterance only after the user starts recording. Stop the microphone tracks
when recording ends or the page closes. `transcribe({ audio, format }, { onPartial? })` accepts raw
signed 16-bit mono PCM at 16,000 Hz (`format: { sampleRate: 16000, channelCount: 1,
sampleFormat: 's16' }`), not an encoded WAV/WebM/MP3 file. It returns `{ text }`; optional
`onPartial(text)` receives transcription progress. The supported build accepts up to 16,000,000
audio bytes and one transcription per Mini App at a time. Handle rejection and preserve the user's
existing text; do not automatically retry a result whose outcome is unknown.

The Host performs transcription and may contact its speech service. Disclose that audio leaves
the page through the Host; do not claim an offline-only flow unless that environment was tested.
Transcription fills the Mini App's draft. Appending to the chat still uses `message.append`, with
its separate Host confirmation, and the user still presses Send.

## `miniapp.window` (proposed)

Expand Down
30 changes: 25 additions & 5 deletions docs/package-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Verified against MiniMax Code 3.1.2.

The `session.read` grant requires MiniMax Code 3.1.4 or later (observed on 3.1.4-preview).
Observation and `deviceAccess` below additionally require a Host build that implements them;
their minimum released client version has not been verified. Declaration checks do not prove
runtime availability.

A Mini App is a MiniMax Plugin whose `package.json` declares a Mini App payload. MiniMax Code
enforces the manifest, payload, and path rules below when the package is installed. `npm run check`
enforces the same rules here, plus this repository's own requirements: `README.md` and `LICENSE`,
Expand Down Expand Up @@ -115,13 +120,23 @@ No other keys are allowed inside `mcode`. Other top-level keys (`name`, `type`,
- `hostConnectorAccess` is optional: `{ "providers": string[] }`, each matching
`^[a-z0-9_-]{1,64}$` and unique. Declared providers are granted by the Host at install time; this
repository does not document their use.
- `agentAccess` is optional: an array of `"session.run"` (run Agent turns) and `"session.read"`
(read sessions: the page's `agent.session()` returns the chat it is open in, see `docs/agent.md`).
Absent or `[]` means no Agent access. See `docs/agent.md` before declaring it. Requires MiniMax
Code 3.1.2 or later; `"session.read"` requires 3.1.4 or later.
- `agentAccess` is optional: a unique string array containing `"session.run"`, `"session.read"`,
or both. `session.run` lets the Mini App run its own Agent turns (MiniMax Code 3.1.2 or later).
`session.read` reads visible conversations, including the chat the page is open in, and
requires 3.1.4 or later. Neither grant implies the other. Absent or `[]` means no Agent access.
Observation requires additional Host support; see `docs/agent.md` before declaring it.
- `agentConcurrency` is optional: an integer from 1 to 32, default 4. It caps how many Agent turns
of this Mini App run at once; it has no effect without `agentAccess`. Requires MiniMax Code 3.1.2
or later.
- `deviceAccess` is optional: a unique string array containing only `"microphone"`. It declares
microphone use for capture and the optional Host speech API; it does not grant Agent runs.
Absent or `[]` declares no device access. The Host and operating system must still authorize
microphone use. Its minimum released client version is unverified; see `docs/client.md`.

`npm run check` rejects unknown capabilities and duplicate grants. It reports
`HOST_EXTENSION_UNVERIFIED` for microphone declarations so contributors explain
the tested Host build and unverified release compatibility in the README and pull request. The
check validates manifest shape, not whether the installed Host has or grants these capabilities.

### `surface.window`

Expand Down Expand Up @@ -172,7 +187,7 @@ the package cannot be installed there at all.
| Feature | Declared in | Minimum MiniMax Code |
| --- | --- | --- |
| `agents` | `plugin.json` | 3.1.2 |
| `agentAccess` | `miniapp/miniapp.json` | 3.1.2 |
| `agentAccess: ["session.run"]` | `miniapp/miniapp.json` | 3.1.2 |
| `agentAccess` with `"session.read"` | `miniapp/miniapp.json` | 3.1.4 |
| `agentConcurrency` | `miniapp/miniapp.json` | 3.1.2 |
| `surface.window` | `miniapp/miniapp.json` | 3.1.2 |
Expand All @@ -181,6 +196,11 @@ When a package declares any of these, name a MiniMax Code version at or above th
`## Tested environment` in its README, for example `- MiniMax Code 3.1.2 on macOS 15`.
`npm run check` warns until it finds one there.

The table does not establish observation or `deviceAccess` availability. Packages using these
extensions must name the Host build they actually tested and state that their minimum released
version is unverified. Older clients may reject the entire manifest. Do not remove a required
grant or replace read access with run access merely to make a package install.

## Portable paths

Every path inside the package, and every path written in a manifest, must be portable:
Expand Down
18 changes: 17 additions & 1 deletion docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Disclose every outbound host in the README. The default is none.

## Agent turns

An Agent run by a Mini App (`agentAccess`, see `docs/agent.md`) can read and write files, run
An Agent run by a Mini App (`agentAccess: ["session.run"]`, see `docs/agent.md`) can read and write files, run
shell commands, and call MCP tools.

- Declare `agentAccess` only when the Mini App needs it, and state in the README `## Data & access`
Expand All @@ -47,3 +47,19 @@ shell commands, and call MCP tools.
answer `allowOnce` automatically.
- Text from the page, files, or the network is untrusted. Build prompts from your own instructions
plus that text clearly marked as data, and validate anything the Agent returns before acting on it.

## Read-only sessions and microphone extensions

`session.read` grants access to user conversation status and content on supporting Host builds;
it does not authorize Agent turns or user-conversation mutations. Request it only when needed,
explain the data shown and retained, and treat titles, replies and tool input as untrusted data.
Do not insert them as HTML or executable code. Do not persist or send private conversation data
elsewhere without disclosing that behavior and obtaining authorization.

`deviceAccess: ["microphone"]` separately declares microphone use. Record only after a user action,
show recording state, and release audio capture on stop, cancel or page disposal. Host speech
transcription may send audio to the Host's speech service; state this in the Mini App README and
preserve text input when the feature or permission is unavailable. Read access requires 3.1.4
or later (observed on 3.1.4-preview); the minimum released version for observation and microphone/
transcription remains unverified. Declaration validation is not a permission grant or a runtime
compatibility guarantee.
19 changes: 19 additions & 0 deletions plugins/minimax-ai/minimax-pet/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"schemaVersion": 1,
"name": "minimax-pet",
"displayName": "MiniMax Pet",
"version": "0.5.8",
"description": "轻量桌宠,聚合主窗口可见会话的任务状态、需要回答的提醒和最新结果,支持外观切换及图集导入。",
"author": "MiniMax",
"icon": "icon.png",
"category": "Other",
"exampleQueries": [
"打开 MiniMax Pet,查看任务提醒",
"制作一只原创桌宠,生成可导入的图集"
],
"apps": [],
"mcpServers": [],
"skills": [
"skills/minimax-pet/SKILL.md"
]
}
13 changes: 13 additions & 0 deletions plugins/minimax-ai/minimax-pet/ARTWORK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MiniMax Pet artwork

The bundled `minimax-original` pet and `icon.png` are original geometric artwork created for this plugin. Copyright (c) 2026 MiniMax. They are distributed under the plugin's [MIT License](LICENSE).

The editable source is `scripts/generate-pet-art.mjs` in `sources/minimax-ai/minimax-pet`. It draws the character and encodes its PNGs using Node built-ins, without loading external images, fonts, or models. To regenerate from that source:

```sh
npm run generate:art
```

The generated atlas is 1536 × 2288 pixels: eight 192 × 208 cells per row, nine animation rows and two rows of look directions. It is compatible with the existing player, including idle, running, waving, jumping, failure, waiting, work and review poses. Tests compare decoded pixels with a fresh deterministic generation, so PNG compression differences between Node releases do not change the artwork contract. The source/distribution package check still compares every shipped file byte.

No third-party character art or externally sourced pet spritesheet is included in the current package. User-imported artwork is not part of this distribution and keeps its own license.
Loading
Loading