diff --git a/plugins/weekbin/mcode-docs/.claude-plugin/plugin.json b/plugins/weekbin/mcode-docs/.claude-plugin/plugin.json new file mode 100644 index 00000000..d2eaf120 --- /dev/null +++ b/plugins/weekbin/mcode-docs/.claude-plugin/plugin.json @@ -0,0 +1,23 @@ +{ + "name": "mcode-docs", + "version": "0.1.0", + "description": "MiniMax Code(mcode)概要说明与事实基线。逐节说明使用形态与安装、CLI 与无头执行全量参数、ACP 接入、52 条 TUI slash 命令全表、配置结构与开关、内置 Agent 与 Skill、插件与 MiniApp 编写契约、Hook 系统完整契约(事件、注册文档、stdin 契约、进程环境白名单、控制输出字段、权限更新、时间预算与诊断码)、MCP 与内置工具、权限模式与 Plan Mode、会话管理。本文档不止罗列功能:每条主张均按 A(本机实跑)/B(厂商随包文件)/C(官方源码定义)/D(运行时真实配置)四级取证,可追溯至 VERIFICATION.md;经核实不存在的能力明确标注为不存在并给出替代路径,而非省略或推测。功能定义取自官方开源仓库源码,界面行为取自本机实跑,取证基线版本 0.5.8。随附中英双语纯静态 HTML 文档站,无构建步骤、无 MCP 服务,可离线阅读。 / Overview and factual baseline for MiniMax Code (mcode). Walks through the usage forms and installation, the complete CLI and headless flag set, ACP integration, all 52 TUI slash commands, configuration structure and switches, the built-in agents and skills, the authoring contracts for plugins and MiniApps, the full Hook contract (events, registration document, stdin contract, process environment allow-list, control output fields, permission updates, time budgets and diagnostic codes), MCP and the built-in tools, permission modes and Plan Mode, and session management. This is not a feature list: every claim is graded A (live run on this machine), B (first-party vendor files shipped in the package), C (authoritative definitions in the official source) or D (real runtime configuration on this machine), and is traceable to VERIFICATION.md. Capabilities checked and found absent are stated as absent together with a substitute path, rather than being omitted or guessed. Functional definitions come from the official open-source repository, interface behaviour comes from live execution on a local installation, and the evidence baseline is version 0.5.8. The documentation site is a bilingual purely static HTML build with no build step and no MCP server, and reads offline.", + "author": { + "name": "weekbin", + "url": "https://github.com/weekbin" + }, + "license": "Apache-2.0", + "homepage": "https://github.com/weekbin/MiniMax-Code-Plugins/tree/main/plugins/weekbin/mcode-docs", + "repository": "https://github.com/weekbin/MiniMax-Code-Plugins/tree/main/plugins/weekbin/mcode-docs", + "icon": "icon.png", + "keywords": [ + "mcode", + "documentation", + "reference", + "cli", + "tui" + ], + "skills": [ + "./skills/mcode-docs/SKILL.md" + ] +} diff --git a/plugins/weekbin/mcode-docs/.minimax-plugin/plugin.json b/plugins/weekbin/mcode-docs/.minimax-plugin/plugin.json new file mode 100644 index 00000000..5086d176 --- /dev/null +++ b/plugins/weekbin/mcode-docs/.minimax-plugin/plugin.json @@ -0,0 +1,22 @@ +{ + "schemaVersion": 1, + "name": "mcode-docs", + "displayName": "MiniMax Code 概要说明与事实基线 mcode-docs", + "version": "0.1.0", + "description": "MiniMax Code(mcode)概要说明与事实基线。逐节说明使用形态与安装、CLI 与无头执行全量参数、ACP 接入、52 条 TUI slash 命令全表、配置结构与开关、内置 Agent 与 Skill、插件与 MiniApp 编写契约、Hook 系统完整契约(事件、注册文档、stdin 契约、进程环境白名单、控制输出字段、权限更新、时间预算与诊断码)、MCP 与内置工具、权限模式与 Plan Mode、会话管理。本文档不止罗列功能:每条主张均按 A(本机实跑)/B(厂商随包文件)/C(官方源码定义)/D(运行时真实配置)四级取证,可追溯至 VERIFICATION.md;经核实不存在的能力明确标注为不存在并给出替代路径,而非省略或推测。功能定义取自官方开源仓库源码,界面行为取自本机实跑,取证基线版本 0.5.8。随附中英双语纯静态 HTML 文档站,无构建步骤、无 MCP 服务,可离线阅读。 / Overview and factual baseline for MiniMax Code (mcode). Walks through the usage forms and installation, the complete CLI and headless flag set, ACP integration, all 52 TUI slash commands, configuration structure and switches, the built-in agents and skills, the authoring contracts for plugins and MiniApps, the full Hook contract (events, registration document, stdin contract, process environment allow-list, control output fields, permission updates, time budgets and diagnostic codes), MCP and the built-in tools, permission modes and Plan Mode, and session management. This is not a feature list: every claim is graded A (live run on this machine), B (first-party vendor files shipped in the package), C (authoritative definitions in the official source) or D (real runtime configuration on this machine), and is traceable to VERIFICATION.md. Capabilities checked and found absent are stated as absent together with a substitute path, rather than being omitted or guessed. Functional definitions come from the official open-source repository, interface behaviour comes from live execution on a local installation, and the evidence baseline is version 0.5.8. The documentation site is a bilingual purely static HTML build with no build step and no MCP server, and reads offline.", + "author": "weekbin", + "icon": "icon.png", + "category": "Other", + "exampleQueries": [ + "mcode 提供哪些 slash 命令? / Which slash commands does mcode provide?", + "mcode 的 Hook 系统支持哪些事件? / Which events does the mcode hook system support?", + "mcode 的权限模式如何配置? / How are mcode permission modes configured?", + "mcode 是否支持文件快照回滚? / Does mcode support filesystem snapshot rollback?", + "查阅 mcode 完整概要说明文档 / Consult the complete mcode overview and factual baseline" + ], + "apps": [], + "mcpServers": [], + "skills": [ + "skills/mcode-docs/SKILL.md" + ] +} diff --git a/plugins/weekbin/mcode-docs/LICENSE b/plugins/weekbin/mcode-docs/LICENSE new file mode 100644 index 00000000..125be1b8 --- /dev/null +++ b/plugins/weekbin/mcode-docs/LICENSE @@ -0,0 +1,192 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + Copyright 2026 MCode Plugins contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/weekbin/mcode-docs/README.md b/plugins/weekbin/mcode-docs/README.md new file mode 100644 index 00000000..a6d8bcec --- /dev/null +++ b/plugins/weekbin/mcode-docs/README.md @@ -0,0 +1,172 @@ +# mcode-docs + +English | [简体中文](./README.zh-CN.md) + +**An overview and factual baseline for MiniMax Code (`mcode`).** + +This plugin ships **no MCP server**. Its deliverables are a reusable Skill and a fully +static HTML documentation site (Chinese and English), readable offline by opening `site/index.html` +directly in a browser. + +This documentation is not a feature list but a **factual baseline**: it walks through mcode's +usage forms, command surface, configuration, extension mechanisms and permission model, and gives +a verdict traceable to `VERIFICATION.md` for any "does mcode support X?" question. Capabilities +that were checked and found absent are stated as absent together with a substitute path, rather +than being omitted or guessed. + +## Rationale + +Material describing `mcode` is distributed across the packaged README, the official +open-source repository, runtime configuration files, and build artifacts. The principal +risk in this setting is not difficulty of retrieval but the adoption of plausible but +incorrect assertions. Three failure modes recur: + +- `mcode mcp add`, `mcode skill list`, and similar subcommands are widely assumed to exist. + Direct execution shows that **none of them are present**; the corresponding capabilities + are provided through configuration files and TUI slash commands. +- The absence of `PreToolUse` in minified build artifacts is frequently taken as evidence + that no hook system exists. The source shows the opposite: **eleven events** are defined, + and they are **compatible with the Claude Code event model**. +- Filesystem snapshot rollback, Gist sharing, code formatters, and warming are often + attributed to `mcode`. **None of these are implemented.** + +This plugin resolves each of these points and, importantly, **retains the correction +records** in `VERIFICATION.md`, so that the derivation of every conclusion remains +inspectable rather than merely asserted. + +## Evidence baseline + +| Source | Version | Role | +| --- | --- | --- | +| Local installation `/@minimax-ai/code` | **0.5.8** | Live `--help` execution, packaged README, actual runtime configuration | +| [`MiniMax-AI/minimax-code`](https://github.com/MiniMax-AI/minimax-code) `main` | **0.5.8** | Authoritative TypeScript definitions | + +Feature definitions are taken from the **source**, which carries explicit types and is +therefore semantically unambiguous. **Live execution** serves a complementary purpose: +it establishes that a capability is genuinely present on the locally installed 0.5.8. +The ledger `VERIFICATION.md` grades every claim A–D by evidence strength. + +## Contents + +``` +mcode-docs/ +├── plugin.json # agent-plugins.org manifest +├── .minimax-plugin/plugin.json # mcode marketplace manifest +├── .claude-plugin/plugin.json # Claude-compatible manifest +├── VERIFICATION.md # Evidence ledger: proof, counter-examples, corrections +├── icon.png +├── LICENSE +├── skills/mcode-docs/ +│ ├── SKILL.md # Reusable Skill +│ └── reference/ # Nine reference documents +│ ├── commands.md # Complete table of the TUI slash commands +│ ├── cli.md # CLI, headless execution, ACP +│ ├── config.md # Configuration structure and all known keys +│ ├── agents-skills.md # Agents, skills, tools +│ ├── plugins.md # Plugin container, manifest contract, hook system +│ ├── miniapp.md # MiniApp contract, lifecycle, authoring +│ ├── mcp-tools.md # MCP, attachments +│ ├── permissions.md # Permission modes, Plan Mode, sessions +│ └── coverage.md # Capability-boundary crosswalk against opencode v2 +└── site/ # Fully static HTML site (zh + en) + ├── index.html # Chinese, default entry + ├── index.en.html # English + └── assets/{style.css, app.js} +``` + +## The documentation site + +- **Entirely static.** No build step, no package manager, no MCP server, no CDN, and no + network request of any kind. +- Operates under `file://`. The clipboard fallback path was verified explicitly. +- The visual system is derived from the **MiniMax platform documentation** + (), with the component geometry + and neutral-grey palette additionally measured pixel-by-pixel from the **platform.minimaxi.com + documentation site** screenshots. Design tokens were extracted by measurement rather than by + inspection: 404 CSS variables from the live page, supplemented by `getComputedStyle` on key + elements and per-pixel sampling of official screenshots. Principal measured values: + `--primary 24 30 37`, `--primary-light 74 222 128`, `--gray-100 #EEEEEF` as the default + border, headings `#171717`, second-level headings and body links `#1E293B` at weight 600 + with underlining, body text `#3F3F3F` at 16px/24px, navigation `#707071`, inline code on + `#EEEEEF@50%` with 2px 8px padding and a 6px radius, white code blocks at a 16px radius + with 14px 16px padding, note boxes on `#EFF6FF` with a `#BFDBFE` border at a 16px radius, + and 0.667px dividers. Screenshot-sampled component values: an 8px-radius `#E8E8E8` fill and a + 48px row height for the active sidebar item (no left rule, `#101113` text, `#2D2D2D` for the + rest), a `#E5E5E5` 1px card border at a 12px radius, a centred 588×40 search field at a 10px + radius, and a right-hand outline with no uppercase and no left rule (`#08090B` at weight 600 for + the current entry, `#424242` for the rest). +- **Light theme by default.** The system `prefers-color-scheme` media query is deliberately + not consulted on first visit. Dark mode is opt-in and the selection persists. The same rule + governs language: `index.html` is always Chinese and `index.en.html` always English, with no + automatic detection. +- Full-text search (`Cmd`/`Ctrl` + `K`), per-block copy controls, a scroll-tracking + outline, and a mobile drawer. + +## Usage + +As a Skill: once the plugin is installed, the agent loads `mcode-docs` when the subject of +inquiry concerns mcode commands, configuration, agents, skills, plugins, hooks, MCP, +permissions, or sessions. + +For direct reading: open `site/index.html` (Chinese) or `site/index.en.html` (English). + +## Example + +**Prompt** + +```text +Does mcode have filesystem snapshots with point-in-time rollback? +I need to restore a file to how it looked 20 minutes ago. +``` + +**Expected result** + +The agent answers that `mcode` has **no** global filesystem snapshot facility, and does +not stop at the denial. It states that `/history`, `/fork` and `/rewind` act on **sessions +and conversation history** rather than on the filesystem, so they are not a substitute; it +gives git as the supported alternative; and it cites both the ledger entry in +`VERIFICATION.md` and the manual section that settles the question. The answer separates +what was checked from what is assumed, rather than inferring from similarly named tools in +other agents. + +## Documented scope + +**Verified as implemented**, and documented in full: the TUI slash command table; the complete +CLI and headless flag set; ACP; the configuration structure and per-OS data directories; the +built-in agents and skills; the base tools; user-level and project-level MCP; the hook events +in the `MINIMAX`, `CLAUDE`, and `CODEX` formats; `PermissionMode`; Plan Mode; and session management. + +**Verified as absent.** Each is stated explicitly in the documentation, together with the +supported alternative. + +| Capability | Documented alternative | +| --- | --- | +| Filesystem snapshots and point-in-time rollback (opencode *Snapshots*) | Version control with git | +| Code formatters (opencode *Formatters*) | Explicit invocation of the project's own formatter by the agent | +| Gist and remote sharing (opencode *Sharing*) | `/export [path.md]` | +| A standalone policy engine (opencode *Policies*) | Least-privilege selection through `/permission` | +| Warming (opencode *Warming*) | Not required; the runtime manages model caching | +| *Migrate from V1* | Not applicable; upgrade through `mcode update` | +| Browser Use in the TUI/CLI | Not exposed there; Browser is a desktop-host capability | + +> `/history`, `/fork`, and `/rewind` operate on **sessions and conversation history**. They +> are not a filesystem snapshot facility, and the two must not be conflated. + +## Maintenance + +Following a version increment, re-verify using the method recorded in `VERIFICATION.md`: + +```bash +mcode --version +mcode --help +git clone --depth 1 https://github.com/MiniMax-AI/minimax-code.git +``` + +Priority re-check targets: the two command registries +(`packages/tui/src/tui/commands/catalog.ts` and +`packages/tui/src/application/command-descriptors.ts`), `PLUGIN_HOOK_EVENTS`, +`PermissionMode`, and `MANIFEST_FIELDS`. + +## License + +[Apache-2.0](./LICENSE) diff --git a/plugins/weekbin/mcode-docs/README.zh-CN.md b/plugins/weekbin/mcode-docs/README.zh-CN.md new file mode 100644 index 00000000..368502bf --- /dev/null +++ b/plugins/weekbin/mcode-docs/README.zh-CN.md @@ -0,0 +1,149 @@ +# mcode-docs + +English | [简体中文](./README.zh-CN.md) + +**MiniMax Code(`mcode`)概要说明与事实基线。** + +本插件不提供 MCP 服务。交付物为可复用 Skill 与纯静态 HTML 文档站;后者可直接在浏览器中 +打开 `site/index.html` 离线阅读。 + +这份文档的定位不是功能罗列,而是一份**事实基线**:逐节说明 mcode 的使用形态、命令面、 +配置、扩展机制与权限模型,并对「mcode 是否具备某项能力」给出可追溯到 `VERIFICATION.md` +的判定;经核实不存在的能力会明确标注为不存在并给出替代路径,而不是省略或推测。 + +## 立论依据 + +关于 `mcode` 的资料分散于随包 README、官方开源仓库、运行时配置文件与打包产物之中。 +在此情形下,主要风险并非检索困难,而是似是而非的论断被当作事实采纳。以下三类偏差反复出现: + +- `mcode mcp add`、`mcode skill list` 等子命令常被假定存在。经直接执行验证,**此类子命令均不存在**; + 对应能力由配置文件与 TUI slash 命令提供。 +- 打包产物中检索不到 `PreToolUse`,常被据以推断 mcode 不具备 Hook 系统。源码所证恰相反: + **已定义 11 个事件**,且**兼容 Claude Code 事件模型**。 +- 文件系统快照回滚、Gist 分享、代码格式化器与预热常被归于 mcode。**上述能力均未实现。** + +本插件对上述各点逐一澄清,并**保留纠错记录**(见 `VERIFICATION.md`),使每项结论的推导过程 +可被检视,而非仅被断言。 + +## 取证基线 + +| 来源 | 版本 | 作用 | +| --- | --- | --- | +| 本机安装 `/@minimax-ai/code` | **0.5.8** | 逐条实跑 `--help`、随包 README、运行时真实配置 | +| [`MiniMax-AI/minimax-code`](https://github.com/MiniMax-AI/minimax-code) `main` | **0.5.8** | TypeScript 权威定义 | + +功能定义以**源码**为准:源码携带显式类型,语义无歧义。**实跑**承担互补职能,用以确认某项能力 +确在本机 0.5.8 上存在。台账 `VERIFICATION.md` 按 A–D 四级对每条主张的证据强度评级。 + +## 交付内容 + +``` +mcode-docs/ +├── plugin.json # agent-plugins.org 清单 +├── .minimax-plugin/plugin.json # mcode 市场清单 +├── .claude-plugin/plugin.json # Claude 兼容清单 +├── VERIFICATION.md # 取证台账:证据、反例与纠错记录 +├── icon.png +├── LICENSE +├── skills/mcode-docs/ +│ ├── SKILL.md # 可复用 Skill +│ └── reference/ # 九份参考文档 +│ ├── commands.md # slash 命令全表(基础 + 分类) +│ ├── cli.md # CLI、无头执行与 ACP +│ ├── config.md # 配置结构与数据目录 +│ ├── agents-skills.md # Agent、Skill 与工具 +│ ├── plugins.md # 插件容器、manifest 契约与 Hook 系统 +│ ├── miniapp.md # MiniApp 契约、生命周期与编写 +│ ├── mcp-tools.md # MCP 与附件 +│ ├── permissions.md # 权限模式、Plan Mode 与会话 +│ └── coverage.md # opencode v2 章节能力边界对照 +└── site/ # 纯静态 HTML 文档站(中英双语) + ├── index.html # 中文,默认入口 + ├── index.en.html # 英文 + └── assets/{style.css, app.js} +``` + +## HTML 文档站 + +- **完全静态。** 无构建步骤、无包管理器、无 MCP 服务、无 CDN,不发起任何网络请求。 +- **中英双语。** `index.html` 与 `index.en.html` 共享同一套 `assets/style.css` 与 + `assets/app.js`;两版锚点集合与顺序一致。顶栏可切换语言,**不做任何语言自动判定**—— + 打开哪份文件就是哪种语言,手动选择后持久化。不使用 `fetch` 加载语言包,以保持 `file://` 可用。 +- 可在 `file://` 下运行;剪贴板降级路径已单独验证。 +- 视觉系统取自 **MiniMax 开放平台文档中心** + (),组件几何与中性灰配色另据 + **platform.minimaxi.com 文档站**截图逐像素取样。设计令牌以实测方式提取,非目测比对:取自该页 + 的 CSS 变量,并以关键元素的 `getComputedStyle` 与官方截图逐像素取样补充。主要实测值: + `--primary 24 30 37`、`--primary-light 74 222 128`、默认边框 `--gray-100 #EEEEEF`、 + 标题 `#171717`、二级标题与正文链接 `#1E293B`(字重 600,带下划线)、正文 `#3F3F3F` + `16px/24px`、导航 `#707071`、行内代码底色 `#EEEEEF@50%`(`2px 8px` 内边距,`6px` 圆角)、 + 代码块白底 `16px` 圆角 `14px 16px` 内边距、提示框 `#EFF6FF` 底 `#BFDBFE` 边 `16px` 圆角、 + 分隔线 `0.667px`。截图实测的组件值:左栏激活项 `#E8E8E8` 填充、`8px` 圆角、`48px` 行高 + (无左侧竖线,文字 `#101113`,非当前项 `#2D2D2D`);卡片 `#E5E5E5` 描边 `1px`、`12px` 圆角; + 搜索框居中、`588×40`、`10px` 圆角;右栏大纲非大写、无左侧竖线(当前项 `#08090B` 字重 600, + 非当前项 `#424242`)。 +- **默认浅色主题。** 首访刻意不查询系统 `prefers-color-scheme` 媒体特性;深色主题为可选项, + 选择结果持久化保存。 +- 全文检索(`Cmd`/`Ctrl` + `K`)、代码块复制、随滚动定位的大纲、移动端抽屉。 + +## 使用方式 + +作为 Skill 使用:插件安装后,当问询对象涉及 mcode 的命令、配置、Agent、Skill、插件、Hook、 +MCP、权限或会话时,Agent 加载 `mcode-docs`。 + +直接阅读:打开 `site/index.html`(中文)或 `site/index.en.html`(英文)。 + +## 示例 + +**Prompt** + +```text +mcode 有文件系统快照和时点回滚吗?我需要把一个文件还原到 20 分钟前的样子。 +``` + +**预期结果** + +Agent 回答 `mcode` **没有**全局文件系统快照设施,并且不止步于否认。它会说明 +`/history`、`/fork`、`/rewind` 作用于**会话与对话历史**而非文件系统,因此不能拿来 +替代;指出受支持的替代路径是 git;并同时给出 `VERIFICATION.md` 中裁定该问题的台账 +条目与手册对应小节。答案区分「已核实」与「推测」,而不是根据其他 Agent 中名称相近的 +工具反推。 + +## 文档口径 + +**经核实已实现**并给出完整说明:slash 命令全表;CLI 与无头执行全量参数;ACP;配置结构 +与跨平台数据目录;内置 Agent;内置 Skill;基础工具;用户级与项目级 MCP;Hook 事件 +(`MINIMAX`、`CLAUDE`、`CODEX` 三种格式);`PermissionMode`;Plan Mode;会话管理。 + +**经核实不存在**。文档中均予以明确标注,并给出受支持的替代路径。 + +| 能力 | 替代路径 | +| --- | --- | +| 文件系统快照与时点回滚(opencode *Snapshots*) | 使用 git 进行版本控制 | +| 代码格式化器(opencode *Formatters*) | 由 Agent 显式调用项目自身的格式化命令 | +| Gist 与远程分享(opencode *Sharing*) | `/export [path.md]` | +| 独立策略引擎(opencode *Policies*) | 经 `/permission` 选择最小可用权限 | +| 预热(opencode *Warming*) | 无需此步骤;模型缓存由 Runtime 处理 | +| *Migrate from V1* | 不适用;经 `mcode update` 升级 | +| TUI/CLI 中的 Browser Use | 未在该端暴露;Browser 属桌面端宿主能力 | + +> `/history`、`/fork`、`/rewind` 作用于**会话与对话历史**,并非文件系统快照机制, +> 二者不应混同。 + +## 维护 + +版本递增后,按 `VERIFICATION.md` 记录的方式重新核验: + +```bash +mcode --version +mcode --help +git clone --depth 1 https://github.com/MiniMax-AI/minimax-code.git +``` + +优先复核对象:两个命令注册表(`packages/tui/src/tui/commands/catalog.ts` 与 +`packages/tui/src/application/command-descriptors.ts`)、`PLUGIN_HOOK_EVENTS`、 +`PermissionMode`、`MANIFEST_FIELDS`。 + +## License + +[Apache-2.0](./LICENSE) diff --git a/plugins/weekbin/mcode-docs/VERIFICATION.md b/plugins/weekbin/mcode-docs/VERIFICATION.md new file mode 100644 index 00000000..52758684 --- /dev/null +++ b/plugins/weekbin/mcode-docs/VERIFICATION.md @@ -0,0 +1,1346 @@ +# Verification Ledger — mcode-docs + +本文件是本插件每一条文档内容的取证台账。**任何未在本文件中出现的功能主张,都不应出现在文档里。** + +## 取证来源 + +| # | 来源 | 版本 | 用途 | +| --- | --- | --- | --- | +| S1 | 本机安装 `/@minimax-ai/code` | **0.5.8** | 随包 README、`configs/data-minimal.yaml`、命令注册数组、运行时真实配置 | +| S2 | `https://github.com/MiniMax-AI/minimax-code`(官方开源仓库,`main`) | **0.5.8** | TypeScript 源码级权威定义 | +| S3 | `https://platform.minimax.cn/docs/api-reference/api-overview` 及其文档子页 | 线上 | **样式基准**:官方 CSS 变量、样式表源码、`.prose` 排版系统、组件实测值、暗色 callout 实测 | + +> **版本声明**:本机运行版本为 **0.5.8**,与官方仓库 `main` 同版本,双源对齐。 +> 文档以 **S2 源码**为功能定义的权威来源(源码含类型定义,语义无歧义), +> 并以 **S1 实跑**验证「该能力在本机 0.5.8 上确实存在」。 + +> **复核记录(2026-09-29)**:本台账初版以 0.5.7 实跑 + 0.5.8 源码为基线。 +> 复核时发现两处失准,已按 0.5.8 实测修正: +> 1. 内置 Skill 实为 **16 个**,初版所列的 `x-link-reader` 在 0.5.8 包内与运行时均不存在; +> 2. 内置 Skill 的包内布局已由单一 `assets/skills/` 改为按 Agent 分散 +> (`assets/agents/mavis/skills/`),初版对包内路径的描述已过时。 +> +> **内置 Agent 仍为 4 个**(`assets/agents/builtin-agents.json` 实测)。 +> 运行时 `~/.minimax/agents/` 下若存在更多目录,属用户自建 Agent,不计入内置清单。 + +## 证据等级 + +| 等级 | 含义 | +| --- | --- | +| **A** | 在本机实跑命令得到的真实输出 | +| **B** | S1 随包发布的厂商第一手文件 | +| **C** | S2 源码中的权威定义(类型/常量/注册表) | +| **D** | 本机运行时真实配置或状态文件 | + +--- + +## 1. CLI 命令面(A 级:`mcode --help` 逐条实跑) + +真实存在的顶层命令: + +| 命令 | 说明 | +| --- | --- | +| `mcode [prompt]` | 启动交互式 TUI | +| `mcode init [directory]` | 分析代码库生成 `AGENTS.md`(使用内置 `init` Skill) | +| `mcode exec [prompt]` | 不启动 TUI,执行一次任务 | +| `mcode exec review` | 审查 staged / unstaged / untracked 本地改动 | +| `mcode acp` | 以 Agent Client Protocol 服务运行(stdio) | +| `mcode login` / `mcode logout` | 管理登录态(`--region cn\|global`) | +| `mcode update` | 检查并安装更新 | +| `mcode provider ...` | `list` / `add` / `remove` / `test` / `use` / `set-minimax-key` | +| `mcode plugin ...` | `list` / `add` / `remove` / `enable` / `disable` / `marketplace` | + +全局选项(A 级实跑):`-V, --version`、`-m, --model `、`--lane `、 +`--session [id]`、`-c, --continue`、`--tui-mode `。 + +### 1.1 不存在的 CLI 子命令(反例,已实跑确认) + +`mcode mcp`、`mcode config`、`mcode agent`、`mcode skill`、`mcode hook`、`mcode workflow` +**全部回落到根帮助**,0.5.8 无这些子命令。对应能力通过**配置文件**与 **TUI slash 命令**提供。 + +### 1.2 `mcode exec` 完整参数(A 级实跑 `--help`) + +`--input `(仅 `-`)、`--input-format text|json`、`--cwd `、`--file `(可重复)、 +`--model`、`--effort `、`--prompt-mode tui|coding|work`、`--session `、`--continue`、 +`--config `、`--permission smart|full|off`、`--timeout `、`--max-steps `、 +`--output-format text|json|stream-json`、`--diagnostics-dir `、`--output-schema `、 +`-o, --output-last-message `。 + +`mcode exec review` 仅支持:`--cwd`、`--model`、`--effort`、`--config`、`--permission`、 +`--timeout`、`--max-steps`、`--output-format`、`--output-last-message`(B 级:B1 明确说明 +`--session`/`--continue`/`--input`/`--file`/`--output-schema`/`--diagnostics-dir` 不支持)。 + +--- + +## 2. TUI slash 命令:**52 条**(C 级 + A 级实跑) + +对外口径只讲「共 52 条,按 7 类分组」,**不暴露源码注册表路径**(源码位置属于内部实现, +对用户无操作价值)。分组的 41 + 11 拆分保留在内部台账: + +- `packages/tui/src/tui/commands/catalog.ts` → **41** 条 +- `packages/tui/src/application/command-descriptors.ts`(`TUI_COMMAND_DESCRIPTORS`)→ **11** 条 + +> **修正记录**:仅对打包后 minified chunk 做正则提取会漏命令(漏掉 `/doctor`、`/help`、 +> `/model` 等 11 条,并漏掉 `/history`、`/fork`、`/rewind`、`/edit`)。 +> 本节以源码为准。 + +### 2.1 Descriptors 注册表(11 条,原文描述) + +| 命令 | 描述(源码原文) | +| --- | --- | +| `help` | Show available commands | +| `new` | Start a fresh session in the current workspace | +| `model` | Choose a model | +| `status` | Show account and model status | +| `doctor` | Check the local config file | +| `context` | Show the Runtime-owned context snapshot | +| `skills` | List built-in and user Skills | +| `mcp` | Inspect MCP capabilities and project configuration | +| `usage` | Show session usage | +| `compact` | Shorten the active conversation | +| `export` | Export the current Session as Markdown | + +### 2.2 Catalog 注册表(41 条) + +`update`、`changelog`、`sessions`、`goal`、`plan`、`review`、`parent`、`btw`、`history`、 +`fork`、`rewind`、`edit`、`retry`、`rename`、`archive`、`tasks`、`permission`、`login`、 +`logout`、`config`、`steer`、`feedback`、`checkin`、`settings`、`statusline`、`theme`、 +`hotkeys`、`reload`、`provider`、`plugins`、`add-dir`、`decision`、`transcript`、`copy`、 +`allow`、`always`、`deny`、`permissions`、`stop`、`queue`、`quit` + +**别名(C 级,源码 `aliases` 字段全量)**: +`clear` → `new`、`exit` → `quit`、`resume` → `sessions`、`side` → `btw` + +**参数提示(源码 `argumentHint`)**: +`sessions [query]`、`goal `、`plan [on | off | status | view]`、 +`permission [status | ask | auto | full]`、`btw [question]`、`rename [title]`、 +`steer `、`feedback `、`add-dir `、`export [path.md]`、 +`plugins [filter]`。 + +**分类(C 级 `TuiCommandCategory`)**: +`Session` / `Runtime` / `Capability` / `Input` / `Transcript` / `Decision` / `Application` + +**侧会话只读命令集**(C 级,随包 chunk 内的命令名集合字面量): +`help`、`changelog`、`context`、`status`、`usage`、`export`、`transcript`、`copy`、`parent`。 + +> **修正记录**:此处曾标注符号名 `SIDE_MODE_READ_ONLY_COMMANDS`。该名称在 +> 0.5.8 随包 bundle 中并不存在——产物已压缩,符号名被改写,只有字符串字面量保留。 +> 改按命令名集合字面量取证;`verify/domains/cli.mjs` 的 `cli.side-session-commands` +> 持续复验这一集合。 + +--- + +## 3. Hook 系统:**确实存在**,兼容 Claude Code 事件模型(C 级) + +> **修正记录**:早期仅检索打包 minified chunk 时 `PreToolUse` 等事件名命中为 0, +> 曾误判为「mcode 无生命周期 Hook」。源码显示该结论错误,现已按源码更正。 +> 本节内容于本轮按 `main` 最新源码逐文件复核并**大幅扩充**。 + +**取证文件**(S2,均为 `packages/agent-modules/plugin-hooks/src/`): + +| 文件 | 提供的事实 | +| --- | --- | +| `contracts.ts` | 事件常量、来源格式、处理器与控制输出类型、诊断码 | +| `parser.ts` | 注册文档 schema、matcher 校验、字段级格式限制、注册级上限 | +| `command-invocation.ts` | shell / exec 形式的解析与平台差异 | +| `runner.ts` | stdin 输入序列化、环境变量注入、退出码与输出解析、时间预算 | +| `packages/local-runtime-v2/…/hook/documents.ts` | manifest `hooks` 字段的五种引用形式 | +| `docs/hooks.md` | 官方 `systemMessage` 行为说明与手工验证步骤(B 级) | + +### 3.1 事件与处理器 + +`PLUGIN_HOOK_EVENTS` 权威定义 —— **11 个事件**: + +``` +SessionStart, SessionEnd, UserPromptSubmit, PreToolUse, PermissionRequest, +PostToolUse, SubagentStart, SubagentStop, Stop, PreCompact, PostCompact +``` + +- **来源格式**:`PluginHookSourceFormat = 'MINIMAX' | 'CLAUDE' | 'CODEX'`(C 级)。 +- **处理器结构**(C 级 `PluginHookCommandHandler`): + `{ kind, sourceFormat, pluginName, pluginRoot, pluginDataDir?, activationKey?, sourcePath, event, matcher?, command, args?, shell?, condition?, timeoutMs, additionalContextLimit?, declarationOrder }` +- **仅同步 `type: 'command'` 受支持**:`parser.ts` 中 `type !== 'command' || async === true || asyncRewake === true` + 一律判为 `HOOK_HANDLER_UNSUPPORTED`。 +- `SessionStart` 来源(`PluginHookSessionStartSource`): + `startup | resume | clear | compact | fork | plugin_activation`。 +- 工具使用上下文内的 effort(`PluginHookEffort`):`low | medium | high | xhigh | max`。 + +### 3.2 注册文档 + +- manifest `hooks` 字段接受:字符串路径、`{ path }` 对象、二者组成的数组、 + **内联注册文档对象**(`sourcePath` 记为 ``)、省略时按默认路径自动纳入(C 级 `documents.ts`)。 +- 信封两种等价写法:外层带 `hooks` 键,或直接以事件名为顶层键(C 级 `parser.ts` `readHooksEnvelope`)。 +- 注册文档形态(B1): + ```json + { "hooks": { "Stop": [ { "hooks": [ { "type": "command", "command": "node \"${PLUGIN_ROOT}/scripts/notice.cjs\"", "timeout": 5 } ] } ] } } + ``` +- **`timeout` 单位为秒**(C 级 `timeoutValue`):整数 1–10,缺省 5000 ms,上限 10000 ms; + 非整数或越界记 `HOOK_SCHEMA_INVALID`。官方示例中的 `"timeout": 5` 即 5 秒。 +- 字段级格式限制(C 级 `parser.ts`):`args` 与 `shell` **仅 `CLAUDE`**; + `if`(工具谓词如 `Bash(rm *)`)**仅 `CLAUDE`** 且仅 `PreToolUse`/`PermissionRequest`/`PostToolUse`; + `additionalContextLimit` **仅 `CODEX`** 且仅 5 个事件。 +- `matcher` 上限 256 字符;`UserPromptSubmit` 与 `Stop` 不校验内容;`CODEX` 仅接受 `[A-Za-z0-9_|]+`; + 其余须为 `[A-Za-z0-9_.:/-]+` 的分支,或**可移植正则**——仅允许非捕获组 `(?:...)`, + 拒绝环视/命名组/反向引用/悬空转义,同一原子重复量词达 4 次即拒绝。 +- **单插件可执行处理器上限 64**(`MAX_EXECUTABLE_HANDLERS`),超出记 `HOOK_HANDLER_LIMIT_EXCEEDED`。 + +### 3.3 进程环境与输入 + +- **环境变量继承白名单仅 17 个**(C 级 `safeHookEnvironment`): + `PATH HOME LANG TERM SHELL USER TMPDIR TEMP TMP PATHEXT SystemRoot ComSpec + USERPROFILE HOMEDRIVE HOMEPATH APPDATA LOCALAPPDATA`。 + 宿主注入 `PLUGIN_ROOT`/`PLUGIN_DATA`/`*_PROJECT_DIR` 等 9 个变量, + `CLAUDE` 格式另注入 `CLAUDE_EFFORT`。**插件根目录只读**(`pluginDataDir` 以 `0700` 创建)。 +- **stdin 为单个 UTF-8 JSON 对象**(C 级 `serializeHookInput`): + 事件特有字段先行展开,其后为 `hook_event_name`、`session_id`、`turn_id?`、`prompt_id?`、 + `transcript_path`(可为 `null`)、`cwd`、`model?`、`permission_mode?`、`effort?`。 + 序列化超过 **1 MiB**(`MAX_INPUT_BYTES`)则不投递。 + +### 3.4 输出、裁决与预算 + +- **退出码语义**(C 级 `runner.ts`):`exit 2`(非 `MINIMAX` 格式)触发事件级阻断且 + **JSON 无法覆盖**;`CODEX` 仅在退出码 0 时解释 stdout;`CLAUDE` 在任意退出码均解析 JSON。 +- stdout/stderr 各截断于 **64 KiB**(`MAX_OUTPUT_BYTES`),溢出记 `HOOK_INVALID_OUTPUT`。 +- **裁决合并**(C 级 `mergePluginHookDecisions`):按**最强裁决**合并 + (`deny` > `ask` > `defer` > `allow`),而非后者覆盖前者。 + 空输出默认裁决:`PermissionRequest` 为 `allow` + `permissionDecision: 'abstain'`, + `PreToolUse` 为 `allow` + `toolPermissionDecision: 'abstain'`,其余为 `allow`。 +- **控制输出字段**(C 级 `PluginHookDecision`,共 20 项):`decision`、`reason`(≤4096 字符)、 + `continue`、`stopReason`、`continuePrompt`、`defer`、`suppressOutput`、 + `additionalContext`(≤65536 字符)、`updatedInput`、`updatedResult`、 + `updatedResultFormat`、`postToolFeedback`、`terminalSequence`、`systemMessage`、 + `permissionDecision`、`permissionAutoApproval`、`toolPermissionDecision`、 + `updatedPermissions`、`interrupt`。 +- **权限更新**:`updatedPermissions` 为原子数组,三种形态 `addRules`/`replaceRules`/`removeRules`、 + `setMode`、`addDirectories`/`removeDirectories`;`destination` 四值、`mode` 七值(C 级)。 +- **时间预算**:普通事件 `ORDINARY_EVENT_BUDGET_MS = 15 000`, + `SessionEnd` `SESSION_END_BUDGET_MS = 3 000`,进程回收 `PROCESS_DRAIN_BUDGET_MS = 500`。 + 单处理器实际超时取声明值与剩余预算之较小者。 +- **诊断码**:解析期 `HOOK_SCHEMA_INVALID`、`HOOK_EVENT_UNSUPPORTED`、 + `HOOK_HANDLER_UNSUPPORTED`、`HOOK_HANDLER_LIMIT_EXCEEDED`; + 运行期 `HOOK_ABORTED`、`HOOK_INVALID_INPUT`、`HOOK_INVALID_OUTPUT`、 + `HOOK_PROCESS_ERROR`、`HOOK_PROCESS_EXITED`、`HOOK_TIMEOUT`。 + +### 3.5 `systemMessage` 与事件限制(B 级 `docs/hooks.md`) + +- 向 stdout 输出 `{"systemMessage":"..."}` 并 exit 0,可在 TUI 显示提示而**不写入模型上下文**; + 该文本不进入 canonical model history、compaction 输入、最终回答复制与默认 Markdown 导出, + 但**确实**写入本地显示存储。单独返回该字段**不**触发额外模型调用; + `suppressOutput` **不**控制该通知。 +- 通知持久化于 Session 显示历史,重开 Session 恢复且不重复; + 相互独立的 Hook 调用可重复同一文本并各自产生通知;子 Session 通知**不**向父 Session 广播。 +- 只有带分类的插件用户消息会显示;诊断消息、终端控制通知与无分类的旧事件保持隐藏。 + 该行为仅涉及交互式 TUI,headless 与 ACP 输出策略不变。 +- 注意:只有同步 command Hook 覆盖上述通知;`PreCompact` 与手动 `PostCompact` + 当前不发出该通知,`SessionEnd` 为尽力而为。Claude 兼容适配器会丢弃 + `PreCompact`/`PostCompact`/`SessionEnd` 的 `systemMessage`,Codex 适配器丢弃 `SessionEnd` 的。 +- 官方 `docs/hooks.md` 另给出 5 步手工验证流程,并明确要求:验证上下文隔离时 + 不得将通知标记写入提示词,须检视下一次模型请求与真实 compaction 请求。 + +--- + +## 4. 权限模式(C 级 + D 级) + +`PermissionMode` 联合类型(`packages/config/src`)—— **5 个取值**: + +``` +"default" | "acceptEdits" | "bypassPermissions" | "auto" | "off" +``` + +TUI 界面文案(C 级):`default` → "Confirm sensitive actions"、 +`auto` → "Ask only when risk is high"、`bypassPermissions` → "Run without confirmation"。 + +- `/permission` 参数提示为 `[status | ask | auto | full]`(C 级)。 +- 本机 `~/.minimax/config.yaml` 实测 `permissionMode: bypassPermissions`(D 级)。 +- `mcode exec --permission` 是另一套命名空间:`smart | full | off`(A 级)。 +- 运行时另存在 `~/.minimax/permission.json`(D 级)。 + +--- + +## 5. 内置工具(B/C 级,源码 `packages/agent-tools/src`) + +基础工具 **12 个**: + +`read`、`write`、`edit`、`bash`、`grep`、`glob`、`task`、`todowrite`、 +`skill`、`ask_user`、`web_search`、`web_fetch` + +- 本会话实际注入的工具列表与之吻合(含 `mcp__*` 前缀的 MCP 工具、`request_feature_enable` 等宿主工具)。 +- **实测反证**:在本机(其 `config.yaml` 确有 `beta.browserUseTooling: true`)让 + `mcode exec` 自列可用工具,返回的工具清单中**不含任何 Browser 工具** + (无 `navigate`/`open_tab`/`screenshot` 等),仅有 12 个基础工具与 `mcp__*`。 + 即便 beta 开关为真,**Browser 也不会装配到 TUI/CLI**(A 级,见 §14)。 + +--- + +## 6. 内置 Agent 与 Skill(B + D 级,双源互证) + +**Agent**:`assets/agents/builtin-agents.json`(B 级)= `["mavis", "explore", "worker", "verifier"]`; +运行时 `~/.minimax/agents/`(D 级)实际目录一致。两个独立来源吻合。 + +**Skill**(B + D 级,运行时 `~/.minimax/.builtin-skills/`,实测 16 个): +`code-review`、`deep-research`、`deploy-website`、`docx`、`edit-deployed-website`、`init`、 +`lark-tools`、`llm-call`、`mcode-tools-master`、`pdf`、`pptx`、`resume-codex`、`skill-creator`、 +`skill-refiner`、`visual-page`、`xlsx`。 + +> 初版此处记为「包内 `assets/skills/`,实测 17 个」并含 `x-link-reader`。 +> 0.5.8 复核:该 Skill 在包内与运行时**均不存在**,已移除。 +> 包内路径亦已由 `assets/skills/` 改为 `assets/agents/mavis/skills/`, +> 故本项证据等级由 B 调整为 B + D(包内 + 运行时双证)。 + +--- + +## 7. 配置(D 级真实文件 + B 级基线 + C 级类型) + +主配置:`~/.minimax/config.yaml`。实测顶层键:`logLevel`、`provider`、`defaultModel`、 +`permissionMode`、`custom_provider`、`tui`;二级键含 `statusLine`、`customStatusLine`、 +`effort`、`defaultModelContextWindow`、`defaultModelVariant`、`defaultModelThinking.effort`。 + +**`tui` 段**(B 级,官方 `docs/tui-capabilities.md` 给出完整 schema): + +```yaml +tui: + terminalTitle: [status, session-name, app-name] # 可排序/省略;project-name 亦可用;null 或 [] 关闭 + notifications: + when: unfocused # unfocused | always | never + method: auto # auto | osc9 | osc777 | bel + events: [turn-complete, turn-failed, permission-required, question-required] # 省略=全部,[] = 关闭 +``` + +**`beta.*` 开关:判定为「未暴露给用户,已从文档移除」**(C 级 + A 级)。 + +原口径把随包 `configs/data-minimal.yaml` 的 19 个 beta 开关全量写进文档。本轮复核后移除,理由: + +1. 该文件**自述为数据生产基线**,不是用户配置样例—— + 文件头注释原文:`Minimax Code M1 data-generation baseline. Run it with an isolated + MINIMAX_DATA_DIR so user, workspace, Plugin, and configured MCP state from a Desktop + profile cannot enter the capability set.`(B 级)。 +2. 对 0.5.8 全部 chunk 逐个匹配 `beta.`,**19 个键中只有 6 个被随包 CLI 代码读取** + (`browserUseTooling`、`peek`、`promptOverride`、`threadGoal`、`mcodeTools`、`codexOAuth`), + 其余 13 个在 CLI 侧**零引用**(C 级)。 +3. 这 6 个也都带额外门槛,非用户可自选:`peek` 需 `buildEnv!=="prod"`; + `threadGoal` 走 `internalBuild` 开关;`codexOAuth` 赋值为 `e.isInternalBuild`; + `mcodeTools` 需内建标志 `i`;`promptOverride` 读 `/internal/prompts/*.md`。 + +结论:属于生产管线/内部构建开关,**不写入面向用户的文档**。 + +## 8. 插件 manifest 契约(C 级 `MANIFEST_FIELDS`) + +MiniMax 格式插件清单路径 `.minimax-plugin/plugin.json`,`schemaVersion` 必须为 `1`。 +合法字段**全集**: + +``` +$schema, schemaVersion, name, displayName, version, description, author, +icon, darkIcon, category, exampleQueries, apps, mcpServers, skills, +hooks, hostBindings +``` + +字段之外的键会被拒绝。`hostBindings` 元素须为严格 `schemaVersion: 1`, +含 `bindingId`、`logicalToolName`、`hostCapability{id,version}`、`requiredSkills`、 +`allowedSurfaces`(当前仅支持 `interactive`)。 + +--- + +## 9. MCP / Browser / 网络(B + D 级) + +- 用户级 MCP:`~/.minimax/mcp.json`,`{"mcpServers":{"":{type,command,args,env,…}}}`(D 级)。 + 实测含 `codegraph`、`playwright`、`codebuddy`;`env` 支持 `${PLUGIN_ROOT}`、`${PLUGIN_DATA}`。 +- 项目级 MCP:`/.mcp.json`,与 Desktop、exec、ACP 共用规则(B1)。 +- TUI 查看入口:`/mcp`(descriptors,Inspect MCP capabilities and project configuration)。 +- **Browser:判定为「未暴露给 TUI/CLI,已从文档移除」**(A 级实测,见 §14)。 +- 网络代理(B1):读取 `HTTP_PROXY`、`HTTPS_PROXY`、`ALL_PROXY`、`NO_PROXY` 及小写形式; + `localhost`、`127.0.0.1`、`::1` 始终直连;无需 `NODE_USE_ENV_PROXY`。 + +--- + +## 10. 明确**不存在**的能力(反例,禁止编造) + +| 能力 | 核实结果 | 取证 | +| --- | --- | --- | +| 代码格式化器(opencode Formatters) | 无。源码与打包产物均无 formatter 概念 | B+C | +| 预热(opencode Warming) | 无此概念 | B+C | +| 文件快照 / 一键回滚到任意文件态(opencode Snapshots) | **无此用户可见功能**。TUI 内部 `snapshot` 均为渲染/任务列表状态快照,与文件无关 | C | +| Gist / 远程分享(opencode Sharing) | 无。提供 `/export [path.md]` 导出 Markdown | C | +| 独立策略引擎(opencode Policies) | 无独立策略层;相关语义由 `PermissionMode` 承载 | C | +| Migrate from V1 | 不适用。mcode 无 V1/V2 分代迁移概念 | C | +| Desktop / Web / Docker 客户端 | 本仓库开源范围为「terminal TUI, headless CLI, and ACP」,桌面端源码未公开 | 仓库 README | + +> `history` / `fork` / `rewind` 是**会话与对话**层面的操作(回退对话、分叉、重入历史), +> 不是文件系统快照回滚。文档中不得将二者混为一谈。 + +--- + +## 11. 其它已验证事实速查 + +| 事实 | 证据 | +| --- | --- | +| 版本 `0.5.8`;Node `>=22.19 <23 \|\| >=24 <27` | A + B | +| 安装同时提供 `mcode` 与 `mcode-tools` 两个命令 | B1 | +| Shell 模式:`!cmd` 结果交给模型,`!!cmd` 仅本地显示;每条命令独立 Shell | B1 | +| Shell 补全只读本地目录,不调用模型、不执行草稿 | B1 | +| 附件:`--file`、图片 `[Image #n]` 标签;预览上限 20 MB / 2500 万像素 | B1 | +| `/review` 默认 `inline`;配置 `review.mode: subagent` 改用子代理 | B1 | +| `--effort` 与 `--model` 相互独立且不写回 Session | B1 | +| TUI、`exec`、ACP 共用同一进程内 Runtime 生命周期 | B1 | +| Bash 工具:原生长任务时前台等待 60s 后转后台;总超时默认 600s、上限 600s;无 `task_output` 时前台默认 120s、上限 300s | S2 `docs/tui-capabilities.md` | +| 仅退出码 0 视为成功;大输出保留首尾 24 KiB | S2 同上 | +| Telemetry 默认全关,需 `telemetry.diagnostics` 等单独开启;`MCODE_DISABLE_TELEMETRY` / `DO_NOT_TRACK` 全局覆盖 | S2 `docs/telemetry.md` + S2 能力表 | +| 官方快速开始文档位于 `https://agent.minimax.io/docs/cli/quick-start` | S2 `docs/README.md` | + +--- + +## 12. 样式来源与修正记录(S3) + +`site/assets/style.css` 中的每一个颜色、尺寸、圆角都取自 S3,**不自创**。 +本节记录样式侧的取证方式与修正历史。 + +### 12.1 取证方式 + +| 手段 | 产出 | +| --- | --- | +| 读取官方页面 `getComputedStyle` 全量 CSS 变量 | 404 个变量落盘(mint 调色板 17、Tailwind 原语 54、`--tw-prose-*` 18、`--tw-prose-invert-*` 18) | +| 下载官方样式表 | `official-462bacc…css`(4195 B,Inter/PaperMono `@font-face`)、`official-aaa51283…css`(451 651 B) | +| 提取官方内联 `