Skip to main content
For the release status of each capability, see Capabilities and progress.This page lists every extension interface in tables, and each item links to the page that explains it. The API version is 0.1.0.
The type files are the full source of truth for the interface. init writes the type declarations into .minimax-plugin/types/ in the development folder, and every preview refreshes them. If this page disagrees with the type files, trust the type files.

Package layout

The package needs only the files above. Modules import only files inside the package and @minimax/mcode-plugin-extension (importing any other module reports EXTENSION_IMPORT_FORBIDDEN).

Modules you can import

Any other import reports EXTENSION_IMPORT_FORBIDDEN: paths outside the package, bare module names, node:, data:, absolute paths, and value imports from .minimax-plugin/types/, the root tsconfig.json, dist/, or node_modules/. The host configures JSX, so files don’t carry a JSX pragma at the top.

The extension tool

You develop extensions by having the Agent call the extension tool. See Write your first extension.
  • pluginId is the plugin name. It starts with a lowercase letter and is made of lowercase letters and digits, which can be joined by a single -, _, or . (such as sprint-board). It’s at most 80 characters.
  • sourcePath is an absolute path that makes test and preview read a package in another folder. By default they read the development folder returned by init. When sourcePath points outside the development folder, test also shows a permission card, as preview does.

Events

You can call on(event, matcher?, hook) only at the top level of register, with a literal matcher. See Events (hooks) and Static rules.turn.* and tool.* events carry sessionId, turnId, and agentId (the main Agent has no agentId). session.measure, ui.close, and command.run carry only sessionId, with no turnId or agentId. session.start carries only cwd. command.run runs right away, like a button action: it doesn’t wait for the turn and doesn’t queue behind observe events. Observe events let you read what happens in the conversation. See Observe events.

ctx methods

Hooks receive ctx, and callbacks use the ctx of the enclosing hook. Write each call in the full ctx.<domain>.<method>(…) form.ctx.mcp.call and ctx.model.complete accept a signal for cancellation. See Cancel a call.

Sites

All three sites draw through the render chain, so keep await next() in what you draw. Coming soon Once the status band is drawn in two steps, above-prompt draws only your plugin’s own row and the render chain runs on above-prompt-list instead; drawings on above-prompt-list, pane, and backdrop still need next.

Elements

Write elements in JSX, such as <Text size="lg" weight="semibold">Title</Text> or <Button variant="plain" icon="refresh" label="Refresh" onPress={…} />. Every element can take a key attribute (such as key="counter"). See Key rules. For details, see Elements.What some properties do:Property values:For which values combine well on screen, see Design rules. There are 33 button icons. See Icons. For how to write <Svg> and its values, see Backdrop and Limits below.

Testing API

Test files import these functions from @minimax/mcode-plugin-extension/testing. See Write tests.

Limits

Next steps

Diagnostic codes

What each diagnostic code means and how to fix it.

Write your first extension

The full flow from init to install.

Test and troubleshoot

Write tests, read inspect, troubleshoot by symptom.