Repository navigation
Sync the package checks and docs with the MiniMax Code 3.1.2 Mini App contract - #24
Merged
Merged
Conversation
added 2 commits
October 16, 2026 17:35
…he loopback port rules The checker mirrors the 3.1.2 package reader: - miniapp.json accepts agentAccess (only "session.run") and agentConcurrency (integer 1-32). - surface.window is validated with the Host's rule set: whitelisted fields, dimensions 200-10000, min* not above the size, booleans, and transparent only with frame: false. - plugin.json accepts agents (agents/<name>.md, file must exist). Other unknown fields stay errors because clients before 3.1.2 reject them. Clients before 3.1.2 reject a package that declares any of these, so FEATURE_MIN_HOST_VERSION records the minimum per feature, and README_MIN_VERSION_MISSING warns until the README's "## Tested environment" names a MiniMax Code version at or above it. The Host now authenticates the assigned port inside node:http and owns /__mavis/: - surface.path or an MCP endpoint path under /__mavis/ is an error (MINIAPP_ROUTE_RESERVED). - A Node file that creates an https, http2, net, or tls server, or mentions a /__mavis/ route, gets a warning (NODE_UNGUARDED_SERVER, NODE_RESERVED_ROUTE). Assisted-by: Claude Opus 5.5 (OpenCode)
- package-contract.md: surface.window, agentAccess, agentConcurrency, plugin.json agents, the /__mavis/ reservation, and a minimum client version table. - runtime.md: context.agent and the loopback authentication rules (serve the assigned port with node:http, keep /__mavis/ free, expect 401 after a restart until Refresh). - agent.md (new): the Agent grant, sessions, calls, interaction, events, and errors for Node and the page. - client.md (new): window.mcode.miniapp.message, agent, and the proposed window handle. - security.md: loopback rules and Agent turns (approvals stay with the user, untrusted input). - AGENTS.md, CONTRIBUTING, root READMEs: the new docs and the minimum version requirement. - hello-miniapp: miniapp-api.ts synced to the 3.1.2 Host snapshot, and client-api.ts added for page type checking. The example uses none of the new features, so its tested environment is unchanged. Assisted-by: Claude Opus 5.5 (OpenCode)
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Syncs the package checks and contributor docs with the MiniMax Code 3.1.2 Mini App contract (Agent API, pop-out window, loopback authentication).
npm run checkminiapp.jsonacceptsagentAccess(only"session.run") andagentConcurrency(integer 1–32)surface.windowvalidated with the Host's rule set (whitelisted fields, 200–10000,min* ≤ size, booleans,transparentneedsframe: false)plugin.jsonacceptsagents(agents/<name>.md, must exist); other unknown fields remain errors because clients before 3.1.2 reject themsurface.path/ MCP endpointpathunder the Host-reserved/__mavis/MINIAPP_ROUTE_RESERVEDhttps/http2/net/tlsserver (the loopback guard covers onlynode:http)NODE_UNGUARDED_SERVER/__mavis/routeNODE_RESERVED_ROUTE## Tested environmentnames no MiniMax Code version at or above itREADME_MIN_VERSION_MISSINGMinimum versions live in one table (
FEATURE_MIN_HOST_VERSIONinscripts/lib/contract.mjs); every new feature is 3.1.2. CI is unchanged and runs these throughnpm run check.Docs and example
docs/package-contract.md: new fields,/__mavis/, and a "Minimum client version" section.docs/runtime.md:context.agentand "Loopback authentication".docs/agent.md(new): Agent grant, sessions, calls, interaction, events, errors.docs/client.md(new):window.mcode.miniapp.message,agent, and the proposedwindowhandle.docs/security.md: loopback rules; Agent turns (approvals stay with the user, prompt input is untrusted).AGENTS.md,CONTRIBUTING*.md, root READMEs: new docs and the minimum version requirement.examples/hello-miniapp:miniapp-api.tsreplaced with the 3.1.2 Host snapshot;client-api.tsadded for page type checking. The only local edit is the header line, which now points todocs/client.md. The example uses none of the new features, so its tested environment stays at 3.0.73.Verification
npm run check: 69 tests pass. All 9 plugins and the example produce the same results as onmain: no errors, and only the existingREADME_HEADING_MISSINGwarnings onmcode-token-usage-boardandmcode-usage-monitor.scripts/validate.mjson a throwaway copy of the example that declares every new field. It reports oneREADME_MIN_VERSION_MISSING, which clears once the README names 3.1.2. With a reserved route, framed transparency,agentConcurrency: 64, and anhttps.createServer, it reports the matching three errors and one warning.surface.window: 314 cases compared against the Host's ownvalidateMiniAppSurfaceWindow, 0 mismatches.agentAccess/agentConcurrencywere compared against a copy of the Host's two checks, not the Host function itself, because its reader cannot be imported on its own.tsc --checkJs(non-strict) passes for the example entry with the newminiapp-api.ts, and forclient-api.ts.Not verified
NODE_UNGUARDED_SERVERandNODE_RESERVED_ROUTEare pattern checks. They can miss renamed imports and flag comments, so they are warnings.Merge timing
Clients up to 3.1.1 reject packages that declare the new fields. Please merge once 3.1.2 is released.
Need help on this PR? Tag
@codesmith-botwith what you need.