Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.
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
<development-folder>/├── .minimax-plugin/plugin.json # "hooks": ["hooks/hooks.json"]; name equals pluginId├── .minimax-plugin/types/ # Editor types maintained by the host; not counted as package contents├── hooks/hooks.json # { "modules": ["./register.tsx"] }├── hooks/register.tsx # export const register: Register = (on) => { … }├── hooks/state.ts # defineState({ … })├── hooks/*.test.tsx # Tests. The module doesn't import them├── <server>.mcp.json # Optional: an MCP server bundled with the plugin├── tsconfig.json # Yours. It only needs to extend ./.minimax-plugin/types/tsconfig.json└── icon.png
File
Required
Contents
.minimax-plugin/plugin.json
Yes
The plugin manifest. An extension needs "hooks": ["hooks/hooks.json"]. name must equal pluginId, or you get EXTENSION_NAME_MISMATCH. Other required fields: schemaVersion: 1, version, description, author, icon, category, exampleQueries, apps, mcpServers, skills
hooks/hooks.json
Yes
Only the single entry { "modules": ["./register.tsx"] }
hooks/register.tsx
Yes
The extension module and only entry point. It exports register. See Register hooks
hooks/state.ts
When you use ctx.state
defineState({ … }), re-exported by the module with export { state } from './state'. See Save state
An MCP server bundled with the plugin. List it in the manifest’s mcpServers and keep the server files in the package. See Call MCP tools
.minimax-plugin/types/
No
Type files written by init and refreshed by preview. The host maintains them, and they aren’t copied on install
tsconfig.json
No
Yours to manage. The host doesn’t read it
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
Module specifier
Who can import it
Contents
@minimax/mcode-plugin-extension
Modules and tests
Types and functions such as Register and defineState
The JSX runtime. .tsx files use it automatically, so you rarely write it yourself
@minimax/mcode-plugin-extension/testing
Tests only
Test utilities
Relative paths inside the package
Modules and tests
For example ./state
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.
Writes the template package and returns the development folder packagePath. If the package already exists, it only refreshes the editor types. Only init accepts title, which becomes the template button’s text and the draft prefix
test
pluginId, sourcePath?
Validates by the preview rules, then runs all tests in a real extension host. See Run tests
preview
pluginId, sourcePath?
Needs the user’s permission. Validates the package and loads it into the current session
inspect
pluginId
Returns source (validation summary), preview (the running version), and runtime (diagnostics, console output). See Check state with inspect
withdraw
pluginId
Withdraws the preview from this session. Files and stored data are kept
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.
The user ran a slash command (/ command) you registered
command (required; a command name this module registers, case-insensitive)
sessionId, command, args (the text after the command name, with leading and trailing whitespace trimmed). The hook returns { text } or nothing
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.
Write from callbacks, ctx.clock callbacks, or observe events; a write during a draw reports STATE_WRITE_IN_RENDER; at most 256 keys; 64 KB per value, 1 MB total per session
Call it in session.start, inside try/catch; write the argument as an object literal with a literal name; rejected when the name is taken (COMMAND_NAME_RESERVED, COMMAND_NAME_TAKEN). See the command rows of Limits
Sets this session’s plugin theme: the backdrop and the colors
Promise<void>
Give at least one field; replaces the current theme as a whole, one theme per session; kept only in memory. Too little color contrast reports THEME_PALETTE_REJECTED, invalid arguments report ARGUMENT_INVALID. See the theme rows of Limits for values
Status band: the strip above the message box, inside its border. All plugins share one band, and each draws a line or two in it
Box, Text, Button, Tag, Spinner, plus Progress, Link, and SvgComing soon
One per session, drawn in layers by all plugins; about 12 lines tall, scrolls inside when taller. Coming soon Once the band is drawn in two steps, each plugin draws only its own row, and returning undefined draws nothing
Arranging the status band’s rows: the same band, run after every plugin’s row is drawn
Same as above-prompt
One per session, drawn in layers by all plugins. e.props.rows holds the rows the plugins drew ({ plugin, tree }[]); filter or reorder them and pass them unchanged to next(e). Changing, making up, or repeating a row reports EXTENSION_ROWS_INVALID
Backdrop: the backdrop behind the conversation, a layer in the main window under every panel. It replaces the wallpaper while a theme is active
Box, Text, Svg
One per session, drawn in layers by all plugins; drawn only when the session has a plugin theme (ctx.theme.set({ backdrop })). Every layer runs, so draw only your own theme, checked by e.props.plugin and e.props.scene, and return next() otherwise; takes no presses or input
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.
source (required, the SVG source), alt, width, height; no children
What some properties do:
Property
What it does
<Box width="50%">
Takes a percentage of the parent’s width
<Box shrink={false}>
Keeps its own size when a row runs out of room
<Box scrollX>
Scrolls horizontally when its content is wider than it is
<Box paddingX="2" paddingY="1">
Sets horizontal or vertical padding on its own, overriding padding
<Text mono>
Monospace font at the same size
<Text tabular>
Fixed-width digits, for numbers that line up or change in place
<Text maxLines={2}>
Truncates after this many lines; takes precedence over truncate
<Markdown dim>
Body text (including quotes, list markers, table headers, and inline code) uses the secondary tone; code blocks keep their colors
<Code wrap>
Fixes whether this code wraps and hides the wrap toggle; without it, the user’s own setting applies
<Input rows={4}>
2 or more is a fixed-height multi-line input that scrolls inside. With onSubmit, Enter, Cmd+Enter, and Ctrl+Enter submit, and Shift+Enter adds a new line
<Input submitLabel="Send">
With onSubmit, shows a submit button that does the same as pressing Enter
<Progress label="Sync" value={0.4} />
With value, draws a progress bar and a number; without value, draws a task in progress (a spinner with text)
<Button role="dismiss" label="Close">
Coming soon Draws as a compact × button at the end of its row, with label as the name screen readers read. onPress runs as usual, so change ctx.state in it to hide the row
<Link href="https://…">Docs</Link>
Shows the child text, or label when there’s none, or the address when there’s neither. A click follows the user’s link-opening setting, and Cmd / Ctrl click opens the system browser
<Svg source={…} alt="" />
Draws the SVG as an image. <style>, CSS animations, and SMIL animations all work. On the backdrop, animations are removed when the user turns on reduced motion
Color (tone and background on <Text>, background on <Box>, tone on <Progress>)
The tones above, or a hex color: #rgb, #rgba, #rrggbb, #rrggbbaa. Tones follow light and dark mode; hex colors draw as written in both modes. hover.background on <Box> and tone on <Button> and <Tag> accept only tones
Width (width on <Box>)
An integer percentage, "1%" to "100%"
Lines (maxLines on <Text>)
An integer, 1 to 100
Lines (rows on <Input>)
An integer, 1 to 12, default 1
submitLabel on <Input>
Not blank, at most 64 characters; shown only with onSubmit
label, valueText on <Progress>
label is not blank, at most 256 characters; valueText is at most 256 characters, such as "412 / 900"
value, max on <Progress>
max defaults to 1, so value: 0.4 is 40%. A progress bar is drawn when value and max are both finite and max is greater than 0. Without valueText, it shows an integer percentage, and shows 0% or 100% only exactly at the ends (below 0 shows 0%, above max shows 100%); values in between show 1% to 99%. When value is missing, NaN, or infinite, or max is 0 or less, it draws a task in progress
href on <Link>
At most 2048 characters. It opens only for https: addresses, or http://localhost on any port, with no username or password; other addresses show as plain text, with no error. Links in <Markdown> follow the same rule
Corner radius (radius)
sm, md, lg, full
Alignment (align)
start, center, end, stretch
Distribution (justify)
start, center, end, between
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.
API
What it does
See
test(name, fn)
Defines a test. A single test can run up to 10 seconds
Runs a command as if the user typed /<name> <args>, and returns the answer { text }; fails with codes such as COMMAND_UNHANDLED, COMMAND_FAILED, and COMMAND_UNKNOWN
6 per plugin per minute (toast.dropped); text truncated past 500 characters
ctx.mcp.call
60 calls per plugin per minute (MCP_CALL_RATE_LIMITED)
Queued button actions and commands / observe events
One queue each per plugin in each session, 10 / 32 (including the one running). Button actions and commands share the first queue. While an earlier hook is still running, later ones queue. Past the limit, the newest button action is rejected (GESTURE_QUEUE_FULL, and the UI asks the user to try again later), the newest command is rejected with COMMAND_BUSY, and the newest observe event is dropped, with a GESTURE_QUEUE_FULL entry in inspect.runtime.diagnostics
Panels one plugin opens in a session
16; opening more reports ARGUMENT_INVALID
Panel id / title
id up to 200 characters; titles truncated past 200 characters
Status band height
About 12 lines; scrolls vertically inside when taller
Status band design budget (recommended)
1 line per plugin, 2 at most; at most 3 buttons; short lists at most 3 items
Element tree
At most 5000 nodes, 24 levels deep, 200 KB, 10 000 characters per text run
ctx.prompt.suggest
One line of text, non-empty after trimming whitespace, at most 120 characters (whitespace counts), or you get ARGUMENT_INVALID
ctx.prompt.fill
Text up to 100 000 characters
ctx.prompt.read, suggest waiting for the message box
2 seconds
ctx.model.complete
maxTokens defaults to 1024 and can’t exceed the model’s output limit (64000 at most); timeoutMs has no default, maximum 2147483647
ctx.agent.spawn
description up to 50 characters; running sub-agents can’t exceed the session’s sub-agent limit (AGENT_CONCURRENCY_LIMIT)
Sub-agent answer
Up to 32 KB, truncated past that with answerTruncated: true; turn.complete can arrive up to 10 seconds late
ctx.state
At most 256 keys; keys use letters, digits, and _ $ . -, 1 to 128 characters; 64 KB per value, 1 MB total per session, or you get ARGUMENT_INVALID
ctx.store
256 KB per value, 8 MB total per plugin. Past a limit, ctx.store.set throws EXTENSION_SERVICE_FAILED, and message names the limit
ctx.store keys
Must match ^[A-Za-z0-9._-]{1,128}$ and be something other than . or ... An invalid key gives the extension EXTENSION_SERVICE_FAILED
console output
200 lines per plugin per minute (console.dropped)
Command name (name in ctx.command.register)
A string literal matching ^[A-Za-z0-9_-]{1,64}$, without /, compared case-insensitively. It can’t be a built-in command (advisor, btw, clear, cloud, compact, fork, goal, mcp, memory, new, new-bunny, plan, review, sidechat, turn-to-session), and can’t match a Skill or a plugin command registered earlier. When test and preview validate the package, a name that breaks the rule or is a built-in command gives EXTENSION_COMMAND_NAME_INVALID. At run time, register gives COMMAND_NAME_RESERVED for a name a built-in command or a Skill holds, and COMMAND_NAME_TAKEN for a name another plugin’s command holds
Command description / argumentHint
1 to 200 characters / 1 to 64 characters; longer values are rejected (ARGUMENT_INVALID), not truncated
Number of commands
At most 32 plugin commands per session; at most 64 register calls that change commands per Activation. Repeating an identical registration and rejected registrations don’t count. Past either limit, register gives COMMAND_LIMIT_REACHED
Command args (e.args)
At most 4096 characters after trimming leading and trailing whitespace, also in runCommand in tests (COMMAND_ARGS_TOO_LONG)
text in a command.run answer
At most 500 characters, truncated past that (COMMAND_TEXT_TRUNCATED); doesn’t count toward the ctx.ui.toast limit
Wait time for one command
15 seconds, including time in the queue (COMMAND_TIMEOUT)
source on <Svg>
Not blank, at most 131 072 characters (measured by JS String.length); it also counts toward the 200 KB element tree limit
width, height on <Svg>
CSS pixels, finite, greater than 0, at most 4096. When absent: on the backdrop, fills the area in that direction; in the status band and panels, the image shows at its own size, and without width its width fits the content
One <Svg> image on the backdrop
At most 5000 nodes (elements and text, plus the elements each <use> copies); at most 16 elements in one marker, and no marker inside a marker; a <use> can’t point to another <use> or to an element containing a <use> (EXTENSION_SVG_REFUSED)
Theme backdrop
scene: 1 to 64 characters, required; blur: 0 to 30, default 0; dim: 0 to 100, default 22
Theme backdrop.glass
{ blur?, tint?, opacity? } or false (no reading surface under the reply area). blur: 0 to 30 pixels, default 8; tint: a hex color, defaults to the panel color; opacity: 0 to 1, defaults to the color’s own alpha
Theme colors
One set of anchor colors, or { light?, dark? } split by mode (at least one). Each set has 2 to 7 anchors: surface-0 and text-primary are required; surface-1, text-secondary, text-tertiary, accent, and border are optional. Colors are hex: #rgb, #rgba, #rrggbb, #rrggbbaa. Mixing anchors with modes, unknown keys, and empty objects all report ARGUMENT_INVALID
Theme contrast
Computed from the colors you wrote. If a text anchor is below 3:1 against a surface anchor in the same set, the whole set is rejected (THEME_PALETTE_REJECTED). At 3:1 or more it’s accepted, and text colors below 4.5:1 are darkened or lightened to get as close to 4.5:1 as possible, with a THEME_PALETTE_ADJUSTED record
A single test
10 seconds
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.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MiniMax Code Docs","colors":{"primary":"#181E25","dark":"#181E25"},"logo":{"light":"https://mintcdn.com/agent-en/AWwAA_JD3rUWnMtN/logo/light.svg?fit=max\u0026auto=format\u0026n=AWwAA_JD3rUWnMtN\u0026q=85\u0026s=dd070cb1a0cc203f11cd45f588926f57","dark":"https://mintcdn.com/agent-en/AWwAA_JD3rUWnMtN/logo/dark.svg?fit=max\u0026auto=format\u0026n=AWwAA_JD3rUWnMtN\u0026q=85\u0026s=8796874562c21bdce4110337c42efc73","href":"https://code.minimax.io/about"},"favicon":"https://mintcdn.com/agent-en/P5MzPaVjsb-042G7/favicon.ico?fit=max\u0026auto=format\u0026n=P5MzPaVjsb-042G7\u0026q=85\u0026s=fa22cbc6858a880da7c77691939715bf","appearance":{"default":"light","strict":false},"navbar":{"links":[{"href":"https://agent.minimax.io","label":"Get Started","type":"button"}]},"footer":{"socials":{"discord":"https://discord.com/invite/hvvt8hAye6","x":"https://x.com/MiniMax_AI","linkedin":"https://www.linkedin.com/company/minimax-ai","github":"https://github.com/MiniMax-AI"}},"seo":{"metatags":{"canonical":"https://code.minimax.io/docs","og:image":"https://file.cdn.minimax.io/public/58eca777-e31f-448a-9823-e2220e49b426.png","og:type":"website","og:site_name":"MiniMax Code","og:locale":"en_US","title":"MiniMax Code – AI Agent for Complex Tasks | Changelog \u0026 Docs","description":"MiniMax Code is a general-purpose AI agent that builds full-stack web apps, presentations, deep research reports, and more. View the latest product updates, features, and research.","keywords":"MiniMax Code, AI agent, AI coding assistant, full-stack AI, PPT generator, deep research AI, MCP integration, Supabase AI, AI web app builder, MiniMax changelog","charset":"UTF-8","viewport":"width=device-width, initial-scale=1.0","twitter:card":"summary_large_image","twitter:site":"@MiniMax_AI","twitter:title":"MiniMax Code – AI Agent for Complex Tasks","twitter:description":"Build full-stack apps, presentations, and research reports with MiniMax Code. Powered by multi-agent AI.","twitter:image":"https://file.cdn.minimax.io/public/58eca777-e31f-448a-9823-e2220e49b426.png","robots":"index, follow"},"indexing":"all"},"fonts":{"family":"DM Sans"},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"agent-en","hasAudioNarration":false,"actualSubdomain":"agent-en","customDomains":["agent.minimax.io"],"gitSource":{"type":"github","owner":"minimax-ai-dev","repo":"agent-docs","deployBranch":"main","contentDirectory":"packages/docs-en","isPrivate":true,"mountPath":"","label":"","_id":"6b10db109ffae5051c40f1ee"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b1192b0bc251608b368d7c2","clientVersion":"0.0.4448","searchFilterCounts":[{"language":"default","tag":"MiniMax Code","count":48},{"language":"default","tag":"Mini App Development","count":21},{"language":"default","tag":"CLI","count":12},{"language":"default","tag":"Agent Capabilities","count":10},{"language":"default","tag":"Desktop Features","count":9},{"language":"default","tag":"Extension Development","count":9},{"language":"default","tag":"Develop","count":8},{"language":"default","tag":"Core Workflows","count":6},{"language":"default","tag":"Get Started","count":5},{"language":"default","tag":"Learn","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"[class*=\"ask-ai\"],[id*=\"ask-ai\"],[class*=\"AskAI\"],button[aria-label*=\"Ask AI\"]{display:none!important}article h2{display:inline-block;padding:2px 14px;border-radius:16px;background-color:#EBF5FF;color:#0969DA;font-size:14px;font-weight:500;border:1px solid #B6D4FE;margin-top:2rem}article .techblog-list h2,.techblog-list h2{display:block!important;background-color:transparent!important;border:none!important;border-top:1px solid #E5E7EB!important;border-radius:0!important;padding:2rem 0 0 0!important;color:#374151!important;font-size:16px!important;font-weight:500!important;margin-top:2.5rem!important;margin-bottom:0.5rem!important}.techblog-list h2:first-of-type{margin-top:2.5rem!important}.dark .techblog-list h2{color:#E5E7EB!important;border-top-color:#374151!important}.techblog-list h2,.techblog-list h3{scroll-margin-top:80px}#footer a[href*=\"mintlify\"],[class*=\"attribution\"],footer a[href*=\"mintlify\"]{display:none!important}img{max-width:100%;height:auto;object-fit:contain}@media (min-width: 1024px){#sidebar{top:max(\n calc(var(--mintlify-slot-header-height, 7rem) + var(--banner-height, 0px)),\n 5rem\n )!important}}@media (max-width: 1023px){#sidebar>div:first-child,#sidebar-content>div:first-child{padding-top:16px!important}}.code-docs h2,.code-docs h3{display:block!important;padding:0!important;border-radius:0!important;background-color:transparent!important;color:inherit!important;border:none!important}.code-image-placeholder{border:1px dashed #CBD5E1;border-radius:8px;padding:16px;background:#F8FAFC;color:#475569;font-size:14px;line-height:22px;margin:16px 0 24px}.dark .code-image-placeholder{border-color:#475569;background:#111827;color:#CBD5E1}.code-screenshot{display:block;width:100%;margin:16px 0 24px;border:1px solid #E2E8F0;border-radius:8px;background:#FFFFFF}.dark .code-screenshot{border-color:#334155;background:#0F172A}.code-community-panel{display:grid;grid-template-columns:minmax(0, 1fr) 180px;gap:24px;align-items:center;border:1px solid #E2E8F0;border-radius:8px;padding:20px;margin:16px 0 8px;background:#FFFFFF}.code-community-panel p{margin-bottom:0}.code-qr-placeholder{display:flex;min-height:180px;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:1px dashed #CBD5E1;border-radius:8px;background:#F8FAFC;color:#334155;text-align:center}.code-qr-placeholder small{max-width:140px;color:#64748B;font-size:12px;line-height:18px}.code-community-qr{display:block;width:180px;max-width:100%;border:1px solid #E2E8F0;border-radius:8px;background:#FFFFFF}.dark .code-community-panel{border-color:#334155;background:#0F172A}.dark .code-qr-placeholder{border-color:#475569;background:#111827;color:#CBD5E1}.dark .code-qr-placeholder small{color:#94A3B8}@media (max-width: 640px){.code-community-panel{grid-template-columns:1fr}.code-qr-placeholder{min-height:220px}}body:has(.question-standalone-marker) header,body:has(.question-standalone-marker) #navbar,body:has(.question-standalone-marker) #sidebar,body:has(.question-standalone-marker) #sidebar-content,body:has(.question-standalone-marker) footer,body:has(.question-standalone-marker) [class*=\"navbar\"],body:has(.question-standalone-marker) [class*=\"Navbar\"],body:has(.question-standalone-marker) [class*=\"sidebar\"],body:has(.question-standalone-marker) [class*=\"Sidebar\"],body:has(.question-standalone-marker) [class*=\"search\"],body:has(.question-standalone-marker) [class*=\"Search\"],body:has(.question-standalone-marker) button[aria-label*=\"Search\"],body:has(.question-standalone-marker) button[aria-label*=\"搜索\"],body:has(.question-standalone-marker) [role=\"search\"]{display:none!important}body:has(.question-standalone-marker) #table-of-contents-layout,body:has(.question-standalone-marker) [aria-label=\"目录\"],body:has(.question-standalone-marker) [aria-label=\"Contents\"]{display:none!important}body:has(.question-standalone-marker) main,body:has(.question-standalone-marker) article{padding-top:0!important}body:has(.question-standalone-marker) article{max-width:900px!important;margin-left:auto!important;margin-right:auto!important}"}]}
{"page":{"pagePath":"extension/reference","slug":"/extension/reference","pageMetadata":{"title":"Extensions reference","sidebarTitle":"Reference","description":"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.","href":"/extension/reference"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Badge,Card,CardGroup,CodeBlock,Heading,Note,Table}=_components;if(!Badge)_missingMdxReference(`Badge`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(`div`,{className:`code-docs`,children:[_jsxs(_components.p,{children:[`For the release status of each capability, see `,_jsx(_components.a,{href:`/extension/progress`,children:`Capabilities and progress`}),`.`]}),_jsxs(_components.p,{children:[`This page lists every extension interface in tables, and each item links to the page that explains it. The API version is `,_jsx(_components.code,{children:`0.1.0`}),`.`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`The type files are the full source of truth for the interface. `,_jsx(_components.code,{children:`init`}),` writes the type declarations into `,_jsx(_components.code,{children:`.minimax-plugin/types/`}),` in the development folder, and every `,_jsx(_components.code,{children:`preview`}),` refreshes them. If this page disagrees with the type files, trust the type files.`]})}),_jsx(Heading,{level:`2`,id:`package`,children:`Package layout`}),_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`\u003cdevelopment-folder>/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── .minimax-plugin/plugin.json # \"hooks\": [\"hooks/hooks.json\"]; name equals pluginId`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── .minimax-plugin/types/ # Editor types maintained by the host; not counted as package contents`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── hooks/hooks.json # { \"modules\": [\"./register.tsx\"] }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── hooks/register.tsx # export const register: Register = (on) => { … }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── hooks/state.ts # defineState({ … })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── hooks/*.test.tsx # Tests. The module doesn't import them`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── \u003cserver>.mcp.json # Optional: an MCP server bundled with the plugin`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── tsconfig.json # Yours. It only needs to extend ./.minimax-plugin/types/tsconfig.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└── icon.png`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`File`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Contents`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.minimax-plugin/plugin.json`})}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`The plugin manifest. An extension needs `,_jsx(_components.code,{children:`\"hooks\": [\"hooks/hooks.json\"]`}),`. `,_jsx(_components.code,{children:`name`}),` must equal `,_jsx(_components.code,{children:`pluginId`}),`, or you get `,_jsx(_components.code,{children:`EXTENSION_NAME_MISMATCH`}),`. Other required fields: `,_jsx(_components.code,{children:`schemaVersion: 1`}),`, `,_jsx(_components.code,{children:`version`}),`, `,_jsx(_components.code,{children:`description`}),`, `,_jsx(_components.code,{children:`author`}),`, `,_jsx(_components.code,{children:`icon`}),`, `,_jsx(_components.code,{children:`category`}),`, `,_jsx(_components.code,{children:`exampleQueries`}),`, `,_jsx(_components.code,{children:`apps`}),`, `,_jsx(_components.code,{children:`mcpServers`}),`, `,_jsx(_components.code,{children:`skills`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hooks/hooks.json`})}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Only the single entry `,_jsx(_components.code,{children:`{ \"modules\": [\"./register.tsx\"] }`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hooks/register.tsx`})}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`The extension module and only entry point. It exports `,_jsx(_components.code,{children:`register`}),`. See `,_jsx(_components.a,{href:`/extension/events#register`,children:`Register hooks`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hooks/state.ts`})}),_jsxs(_components.td,{children:[`When you use `,_jsx(_components.code,{children:`ctx.state`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`defineState({ … })`}),`, re-exported by the module with `,_jsx(_components.code,{children:`export { state } from './state'`}),`. See `,_jsx(_components.a,{href:`/extension/api#state`,children:`Save state`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`hooks/*.test.tsx`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Tests. See `,_jsx(_components.a,{href:`/extension/testing#write-tests`,children:`Write tests`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cserver>.mcp.json`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`An MCP server bundled with the plugin. List it in the manifest’s `,_jsx(_components.code,{children:`mcpServers`}),` and keep the server files in the package. See `,_jsx(_components.a,{href:`/extension/api#mcp-call`,children:`Call MCP tools`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.minimax-plugin/types/`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Type files written by `,_jsx(_components.code,{children:`init`}),` and refreshed by `,_jsx(_components.code,{children:`preview`}),`. The host maintains them, and they aren’t copied on install`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tsconfig.json`})}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Yours to manage. The host doesn’t read it`})]})]})]}),_jsxs(_components.p,{children:[`The package needs only the files above. Modules import only files inside the package and `,_jsx(_components.code,{children:`@minimax/mcode-plugin-extension`}),` (importing any other module reports `,_jsx(_components.code,{children:`EXTENSION_IMPORT_FORBIDDEN`}),`).`]}),_jsx(Heading,{level:`3`,id:`imports`,children:`Modules you can import`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Module specifier`}),_jsx(_components.th,{children:`Who can import it`}),_jsx(_components.th,{children:`Contents`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`@minimax/mcode-plugin-extension`})}),_jsx(_components.td,{children:`Modules and tests`}),_jsxs(_components.td,{children:[`Types and functions such as `,_jsx(_components.code,{children:`Register`}),` and `,_jsx(_components.code,{children:`defineState`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`@minimax/mcode-plugin-extension/ui`})}),_jsx(_components.td,{children:`Modules and tests`}),_jsxs(_components.td,{children:[`Elements: `,_jsx(_components.code,{children:`Box`}),`, `,_jsx(_components.code,{children:`Text`}),`, `,_jsx(_components.code,{children:`Markdown`}),`, `,_jsx(_components.code,{children:`Code`}),`, `,_jsx(_components.code,{children:`Tag`}),`, `,_jsx(_components.code,{children:`Button`}),`, `,_jsx(_components.code,{children:`Input`}),`, `,_jsx(_components.code,{children:`Select`}),`, `,_jsx(_components.code,{children:`Switch`}),`, `,_jsx(_components.code,{children:`Spinner`}),`, `,_jsx(_components.code,{children:`Progress`}),`, `,_jsx(_components.code,{children:`Link`}),`, `,_jsx(_components.code,{children:`Svg`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`@minimax/mcode-plugin-extension/jsx-runtime`}),`, `,_jsx(_components.code,{children:`/jsx-dev-runtime`})]}),_jsx(_components.td,{children:`Modules and tests`}),_jsxs(_components.td,{children:[`The JSX runtime. `,_jsx(_components.code,{children:`.tsx`}),` files use it automatically, so you rarely write it yourself`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`@minimax/mcode-plugin-extension/testing`})}),_jsx(_components.td,{children:`Tests only`}),_jsx(_components.td,{children:`Test utilities`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Relative paths inside the package`}),_jsx(_components.td,{children:`Modules and tests`}),_jsxs(_components.td,{children:[`For example `,_jsx(_components.code,{children:`./state`})]})]})]})]}),_jsxs(_components.p,{children:[`Any other import reports `,_jsx(_components.code,{children:`EXTENSION_IMPORT_FORBIDDEN`}),`: paths outside the package, bare module names, `,_jsx(_components.code,{children:`node:`}),`, `,_jsx(_components.code,{children:`data:`}),`, absolute paths, and value imports from `,_jsx(_components.code,{children:`.minimax-plugin/types/`}),`, the root `,_jsx(_components.code,{children:`tsconfig.json`}),`, `,_jsx(_components.code,{children:`dist/`}),`, or `,_jsx(_components.code,{children:`node_modules/`}),`. The host configures JSX, so files don’t carry a JSX pragma at the top.`]}),_jsx(Heading,{level:`2`,id:`tool`,children:`The extension tool`}),_jsxs(_components.p,{children:[`You develop extensions by having the Agent call the `,_jsx(_components.code,{children:`extension`}),` tool. See `,_jsx(_components.a,{href:`/extension/quickstart`,children:`Write your first extension`}),`.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Action`}),_jsx(_components.th,{children:`Parameters`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`init`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`pluginId`}),`, `,_jsx(_components.code,{children:`title?`})]}),_jsxs(_components.td,{children:[`Writes the template package and returns the development folder `,_jsx(_components.code,{children:`packagePath`}),`. If the package already exists, it only refreshes the editor types. Only `,_jsx(_components.code,{children:`init`}),` accepts `,_jsx(_components.code,{children:`title`}),`, which becomes the template button’s text and the draft prefix`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`test`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`pluginId`}),`, `,_jsx(_components.code,{children:`sourcePath?`})]}),_jsxs(_components.td,{children:[`Validates by the `,_jsx(_components.code,{children:`preview`}),` rules, then runs all tests in a real extension host. See `,_jsx(_components.a,{href:`/extension/testing#run-tests`,children:`Run tests`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`preview`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`pluginId`}),`, `,_jsx(_components.code,{children:`sourcePath?`})]}),_jsx(_components.td,{children:`Needs the user’s permission. Validates the package and loads it into the current session`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`inspect`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pluginId`})}),_jsxs(_components.td,{children:[`Returns `,_jsx(_components.code,{children:`source`}),` (validation summary), `,_jsx(_components.code,{children:`preview`}),` (the running version), and `,_jsx(_components.code,{children:`runtime`}),` (diagnostics, console output). See `,_jsx(_components.a,{href:`/extension/testing#inspect`,children:`Check state with inspect`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`withdraw`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`pluginId`})}),_jsx(_components.td,{children:`Withdraws the preview from this session. Files and stored data are kept`})]})]})]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`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 `,_jsx(_components.code,{children:`-`}),`, `,_jsx(_components.code,{children:`_`}),`, or `,_jsx(_components.code,{children:`.`}),` (such as `,_jsx(_components.code,{children:`sprint-board`}),`). It’s at most 80 characters.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sourcePath`}),` is an absolute path that makes `,_jsx(_components.code,{children:`test`}),` and `,_jsx(_components.code,{children:`preview`}),` read a package in another folder. By default they read the development folder returned by `,_jsx(_components.code,{children:`init`}),`. When `,_jsx(_components.code,{children:`sourcePath`}),` points outside the development folder, `,_jsx(_components.code,{children:`test`}),` also shows a permission card, as `,_jsx(_components.code,{children:`preview`}),` does.`]}),`\n`]}),_jsx(Heading,{level:`2`,id:`events`,children:`Events`}),_jsxs(_components.p,{children:[`You can call `,_jsx(_components.code,{children:`on(event, matcher?, hook)`}),` only at the top level of `,_jsx(_components.code,{children:`register`}),`, with a literal matcher. See `,_jsx(_components.a,{href:`/extension/events#register`,children:`Events (hooks)`}),` and `,_jsx(_components.a,{href:`/extension/events#static-rules`,children:`Static rules`}),`.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Event`}),_jsx(_components.th,{children:`When it fires`}),_jsx(_components.th,{children:`Matcher fields`}),_jsxs(_components.th,{children:[`Main fields of `,_jsx(_components.code,{children:`e`})]})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/interface#sites`,children:_jsx(_components.code,{children:`ui.render`})})}),_jsx(_components.td,{children:`When the host needs to draw a site`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`site`}),` (required): `,_jsx(_components.code,{children:`'above-prompt'`}),`, `,_jsx(_components.code,{children:`'pane'`}),`, or `,_jsx(_components.code,{children:`'backdrop'`}),`, plus `,_jsx(_components.code,{children:`'above-prompt-list'`}),` `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`}),`; `,_jsx(_components.code,{children:`id`}),` (only for `,_jsx(_components.code,{children:`pane`}),`, optional)`]}),_jsxs(_components.td,{children:[`Status band: `,_jsx(_components.code,{children:`{ site: 'above-prompt' }`}),`; panel: `,_jsx(_components.code,{children:`{ site: 'pane', id }`}),`; backdrop: `,_jsx(_components.code,{children:`{ site: 'backdrop', props: { plugin, scene, revision } }`}),`; arranging the status band’s rows `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`}),`: `,_jsx(_components.code,{children:`{ site: 'above-prompt-list', props: { rows } }`}),`. The hook also receives `,_jsx(_components.code,{children:`next`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#session-start`,children:_jsx(_components.code,{children:`session.start`})})}),_jsx(_components.td,{children:`When the plugin is activated in a session, including install mid-session, reloads, and Runtime restarts. Once per Activation`}),_jsx(_components.td,{children:`None`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cwd`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#turn-events`,children:_jsx(_components.code,{children:`turn.start`})})}),_jsx(_components.td,{children:`A turn starts`}),_jsx(_components.td,{children:`None`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`startedAt`}),`, `,_jsx(_components.code,{children:`prompt?: { text, attachments? }`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#turn-events`,children:_jsx(_components.code,{children:`turn.complete`})})}),_jsx(_components.td,{children:`A turn ends (main Agent or sub-agent)`}),_jsx(_components.td,{children:`None`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`status`}),` (`,_jsx(_components.code,{children:`completed`}),` / `,_jsx(_components.code,{children:`aborted`}),` / `,_jsx(_components.code,{children:`error`}),`), `,_jsx(_components.code,{children:`durationMs`}),`, `,_jsx(_components.code,{children:`usage?`}),`; sub-agents you started also have `,_jsx(_components.code,{children:`answer?`}),`, `,_jsx(_components.code,{children:`answerTruncated?`}),`, `,_jsx(_components.code,{children:`reason?`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#tool-events`,children:_jsx(_components.code,{children:`tool.call`})})}),_jsx(_components.td,{children:`When the Agent calls a tool`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`tool?`}),`, `,_jsx(_components.code,{children:`server?`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`toolCallId`}),`, `,_jsx(_components.code,{children:`toolName`}),`, `,_jsx(_components.code,{children:`server?`}),`, `,_jsx(_components.code,{children:`startedAt`}),`, `,_jsx(_components.code,{children:`input?`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#tool-events`,children:_jsx(_components.code,{children:`tool.result`})})}),_jsx(_components.td,{children:`When a tool call has a result`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`tool?`}),`, `,_jsx(_components.code,{children:`server?`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`toolCallId`}),`, `,_jsx(_components.code,{children:`toolName`}),`, `,_jsx(_components.code,{children:`status`}),` (`,_jsx(_components.code,{children:`ok`}),` / `,_jsx(_components.code,{children:`error`}),` / `,_jsx(_components.code,{children:`denied`}),`), `,_jsx(_components.code,{children:`durationMs`}),`, `,_jsx(_components.code,{children:`output?: { text?, result? }`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#session-measure`,children:_jsx(_components.code,{children:`session.measure`})})}),_jsx(_components.td,{children:`After a main Agent turn ends, when context usage differs from what was last sent`}),_jsx(_components.td,{children:`None`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sessionId`}),`, `,_jsx(_components.code,{children:`context`}),`, `,_jsx(_components.code,{children:`rateLimits`}),`, `,_jsx(_components.code,{children:`changed`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#ui-close`,children:_jsx(_components.code,{children:`ui.close`})})}),_jsx(_components.td,{children:`The user closed your pane tab`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`id?`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sessionId`}),`, `,_jsx(_components.code,{children:`id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/events#command-run`,children:_jsx(_components.code,{children:`command.run`})})}),_jsxs(_components.td,{children:[`The user ran a slash command (`,_jsx(_components.code,{children:`/`}),` command) you registered`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`command`}),` (required; a command name this module registers, case-insensitive)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sessionId`}),`, `,_jsx(_components.code,{children:`command`}),`, `,_jsx(_components.code,{children:`args`}),` (the text after the command name, with leading and trailing whitespace trimmed). The hook returns `,_jsx(_components.code,{children:`{ text }`}),` or nothing`]})]})]})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`turn.*`}),` and `,_jsx(_components.code,{children:`tool.*`}),` events carry `,_jsx(_components.code,{children:`sessionId`}),`, `,_jsx(_components.code,{children:`turnId`}),`, and `,_jsx(_components.code,{children:`agentId`}),` (the main Agent has no `,_jsx(_components.code,{children:`agentId`}),`). `,_jsx(_components.code,{children:`session.measure`}),`, `,_jsx(_components.code,{children:`ui.close`}),`, and `,_jsx(_components.code,{children:`command.run`}),` carry only `,_jsx(_components.code,{children:`sessionId`}),`, with no `,_jsx(_components.code,{children:`turnId`}),` or `,_jsx(_components.code,{children:`agentId`}),`. `,_jsx(_components.code,{children:`session.start`}),` carries only `,_jsx(_components.code,{children:`cwd`}),`. `,_jsx(_components.code,{children:`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 `,_jsx(_components.a,{href:`/extension/events#observe-events`,children:`Observe events`}),`.`]}),_jsx(Heading,{level:`2`,id:`ctx`,children:`ctx methods`}),_jsxs(_components.p,{children:[`Hooks receive `,_jsx(_components.code,{children:`ctx`}),`, and callbacks use the `,_jsx(_components.code,{children:`ctx`}),` of the enclosing hook. Write each call in the full `,_jsx(_components.code,{children:`ctx.\u003cdomain>.\u003cmethod>(…)`}),` form.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Method`}),_jsx(_components.th,{children:`What it does`}),_jsx(_components.th,{children:`Main parameters and return`}),_jsx(_components.th,{children:`Limits`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#state`,children:_jsx(_components.code,{children:`ctx.state.get(key)`})})}),_jsx(_components.td,{children:`Reads this session’s state`}),_jsx(_components.td,{children:`The value`}),_jsx(_components.td,{children:`Redraws automatically when a key read by the draw changes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsxs(_components.a,{href:`/extension/api#state`,children:[_jsx(_components.code,{children:`ctx.state.set(key, value)`}),`, `,_jsx(_components.code,{children:`update(key, fn)`})]})}),_jsx(_components.td,{children:`Writes this session’s state`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Promise\u003cvoid>`})}),_jsxs(_components.td,{children:[`Write from callbacks, `,_jsx(_components.code,{children:`ctx.clock`}),` callbacks, or observe events; a write during a draw reports `,_jsx(_components.code,{children:`STATE_WRITE_IN_RENDER`}),`; at most 256 keys; 64 KB per value, 1 MB total per session`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#store`,children:_jsx(_components.code,{children:`ctx.store.get / set / delete / keys`})})}),_jsx(_components.td,{children:`Reads and writes data saved across sessions`}),_jsx(_components.td,{children:`JSON values`}),_jsxs(_components.td,{children:[`Keys match `,_jsx(_components.code,{children:`^[A-Za-z0-9._-]{1,128}$`}),`; 256 KB per value, 8 MB total per plugin; needs `,_jsx(_components.code,{children:`ctx.ui.invalidate()`}),` after a write to redraw`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#store`,children:_jsx(_components.code,{children:`ctx.store.onDidChange(listener)`})})}),_jsx(_components.td,{children:`Listens for store changes`}),_jsxs(_components.td,{children:[`The callback receives `,_jsx(_components.code,{children:`{ key, value }`}),`; returns `,_jsx(_components.code,{children:`{ dispose() }`})]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#mcp-call`,children:_jsx(_components.code,{children:`ctx.mcp.call(server, tool, args?, { signal? })`})})}),_jsx(_components.td,{children:`Calls an MCP tool`}),_jsxs(_components.td,{children:[`Returns `,_jsx(_components.code,{children:`{ content, isError? }`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`server`}),` must be a literal; 60 calls per plugin per minute; may show a permission card`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#ui`,children:_jsx(_components.code,{children:`ctx.ui.toast(text, { tone? })`})})}),_jsx(_components.td,{children:`Shows a toast`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`tone`}),`: `,_jsx(_components.code,{children:`secondary`}),`, `,_jsx(_components.code,{children:`success`}),`, `,_jsx(_components.code,{children:`warning`}),`, `,_jsx(_components.code,{children:`danger`})]}),_jsx(_components.td,{children:`6 per plugin per minute; truncated past 500 characters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/interface#redraw`,children:_jsx(_components.code,{children:`ctx.ui.invalidate()`})})}),_jsx(_components.td,{children:`Requests a redraw`}),_jsx(_components.td,{children:`No return value`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#ui`,children:_jsx(_components.code,{children:`ctx.ui.open({ id, title, focus? })`})})}),_jsx(_components.td,{children:`Opens or updates a pane tab`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Promise\u003cvoid>`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`id`}),` up to 200 characters; at most 16 panels per plugin per session`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#ui`,children:_jsx(_components.code,{children:`ctx.ui.close(id)`})})}),_jsx(_components.td,{children:`Closes a panel`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Promise\u003cvoid>`})}),_jsx(_components.td,{children:`Closing a panel that isn’t open does nothing`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#prompt-fill`,children:_jsx(_components.code,{children:`ctx.prompt.fill({ text, mode? })`})})}),_jsx(_components.td,{children:`Writes a draft into the message box without sending`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{ written: true }`}),` or `,_jsx(_components.code,{children:`{ written: false, reason }`}),`; `,_jsx(_components.code,{children:`reason`}),`: `,_jsx(_components.code,{children:`draft`}),`, `,_jsx(_components.code,{children:`modal`}),`, `,_jsx(_components.code,{children:`no-composer`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`mode`}),`: `,_jsx(_components.code,{children:`replace`}),` (default, only writes an empty message box) or `,_jsx(_components.code,{children:`append`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#prompt-suggest`,children:_jsx(_components.code,{children:`ctx.prompt.suggest({ text })`})})}),_jsx(_components.td,{children:`Shows a gray suggestion in the message box`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{ isShown: true }`}),` or `,_jsx(_components.code,{children:`{ isShown: false, reason }`}),`; `,_jsx(_components.code,{children:`reason`}),`: `,_jsx(_components.code,{children:`draft-not-empty`}),`, `,_jsx(_components.code,{children:`turn-running`}),`, `,_jsx(_components.code,{children:`dismissed`}),`, `,_jsx(_components.code,{children:`no-turn`}),`, `,_jsx(_components.code,{children:`no-composer`})]}),_jsx(_components.td,{children:`One line of text, non-empty after trimming whitespace, at most 120 characters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#prompt-read`,children:_jsx(_components.code,{children:`ctx.prompt.read()`})})}),_jsx(_components.td,{children:`Reads the message box draft`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{ text }`})}),_jsxs(_components.td,{children:[`Must be in `,_jsx(_components.code,{children:`calls:`}),`; reports `,_jsx(_components.code,{children:`PROMPT_READ_UNAVAILABLE`}),` with no response within 2 seconds`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#model-complete`,children:_jsx(_components.code,{children:`ctx.model.complete({ model, prompt, system?, maxTokens?, timeoutMs?, signal? })`})})}),_jsx(_components.td,{children:`Calls a model once, without conversation history or tools`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{ isAnswered: true, text, usage? }`}),` or `,_jsx(_components.code,{children:`{ isAnswered: false, reason, usage? }`}),`; `,_jsx(_components.code,{children:`reason`}),`: `,_jsx(_components.code,{children:`empty-reply`}),`, `,_jsx(_components.code,{children:`timeout`}),`, `,_jsx(_components.code,{children:`aborted`}),`, `,_jsx(_components.code,{children:`model-unavailable`}),`, `,_jsx(_components.code,{children:`provider-error`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`model`}),` is required, in `,_jsx(_components.code,{children:`provider/model`}),` format; no confirmation prompt`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#agent-spawn`,children:_jsx(_components.code,{children:`ctx.agent.spawn({ prompt, description?, agentType?, model? })`})})}),_jsx(_components.td,{children:`Starts a background sub-agent`}),_jsxs(_components.td,{children:[`Returns `,_jsx(_components.code,{children:`{ agentId, model }`}),` right away`]}),_jsx(_components.td,{children:`No confirmation prompt; the number running at once is capped by the session’s sub-agent limit`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#agent-spawn`,children:_jsx(_components.code,{children:`ctx.agent.list()`})})}),_jsx(_components.td,{children:`Lists this session’s sub-agents`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`AgentInfo[]`}),`: `,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`description`}),`, `,_jsx(_components.code,{children:`type`}),`, `,_jsx(_components.code,{children:`status`}),`, and more`]}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#session`,children:_jsx(_components.code,{children:`ctx.session.id / cwd / root / model`})})}),_jsx(_components.td,{children:`Session info`}),_jsxs(_components.td,{children:[`Strings; `,_jsx(_components.code,{children:`root`}),` is absent outside a git repository`]}),_jsx(_components.td,{children:`A snapshot taken when the Invocation starts`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#session`,children:_jsx(_components.code,{children:`ctx.session.usage()`})})}),_jsx(_components.td,{children:`Reads context usage`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{ startedAt, context: { window, tokens?, percent?, breakdown? }, rateLimits }`})}),_jsx(_components.td,{children:`A missing field means not measured yet, not 0`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsxs(_components.a,{href:`/extension/api#clock`,children:[_jsx(_components.code,{children:`ctx.clock.after(ms, fn)`}),`, `,_jsx(_components.code,{children:`every(ms, fn)`})]})}),_jsx(_components.td,{children:`Timers`}),_jsxs(_components.td,{children:[`Returns `,_jsx(_components.code,{children:`{ dispose() }`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ms`}),` is at least 1000`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#clock`,children:_jsx(_components.code,{children:`ctx.clock.now()`})})}),_jsx(_components.td,{children:`The host’s current time`}),_jsx(_components.td,{children:`Unix ms`}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#session`,children:_jsx(_components.code,{children:`ctx.plugin`})})}),_jsx(_components.td,{children:`The running plugin`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{ id, version }`})}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#command`,children:_jsx(_components.code,{children:`ctx.command.register({ name, description, argumentHint? })`})})}),_jsxs(_components.td,{children:[`Adds a command to the `,_jsx(_components.code,{children:`/`}),` menu in the message box`]}),_jsxs(_components.td,{children:[`Returns `,_jsx(_components.code,{children:`{ command }`})]}),_jsxs(_components.td,{children:[`Call it in `,_jsx(_components.code,{children:`session.start`}),`, inside `,_jsx(_components.code,{children:`try/catch`}),`; write the argument as an object literal with a literal `,_jsx(_components.code,{children:`name`}),`; rejected when the name is taken (`,_jsx(_components.code,{children:`COMMAND_NAME_RESERVED`}),`, `,_jsx(_components.code,{children:`COMMAND_NAME_TAKEN`}),`). See the command rows of `,_jsx(_components.a,{href:`#limits`,children:`Limits`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#command`,children:_jsx(_components.code,{children:`ctx.command.list()`})})}),_jsx(_components.td,{children:`Lists this session’s plugin commands`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{ pluginId, displayName?, name, description, argumentHint? }[]`})}),_jsx(_components.td,{children:`Built-in commands aren’t included`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#theme`,children:_jsx(_components.code,{children:`ctx.theme.set({ backdrop?, colors? })`})})}),_jsx(_components.td,{children:`Sets this session’s plugin theme: the backdrop and the colors`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Promise\u003cvoid>`})}),_jsxs(_components.td,{children:[`Give at least one field; replaces the current theme as a whole, one theme per session; kept only in memory. Too little color contrast reports `,_jsx(_components.code,{children:`THEME_PALETTE_REJECTED`}),`, invalid arguments report `,_jsx(_components.code,{children:`ARGUMENT_INVALID`}),`. See the theme rows of `,_jsx(_components.a,{href:`#limits`,children:`Limits`}),` for values`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/api#theme`,children:_jsx(_components.code,{children:`ctx.theme.clear()`})})}),_jsx(_components.td,{children:`Removes this session’s plugin theme`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Promise\u003cvoid>`})}),_jsx(_components.td,{})]})]})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ctx.mcp.call`}),` and `,_jsx(_components.code,{children:`ctx.model.complete`}),` accept a `,_jsx(_components.code,{children:`signal`}),` for cancellation. See `,_jsx(_components.a,{href:`/extension/api#cancel`,children:`Cancel a call`}),`.`]}),_jsx(Heading,{level:`2`,id:`sites`,children:`Sites`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Site`}),_jsx(_components.th,{children:`Location`}),_jsx(_components.th,{children:`Accepted elements`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/interface#above-prompt`,children:_jsx(_components.code,{children:`above-prompt`})})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Status band`}),`: the strip above the message box, inside its border. All plugins share one band, and each draws a line or two in it`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Box`}),`, `,_jsx(_components.code,{children:`Text`}),`, `,_jsx(_components.code,{children:`Button`}),`, `,_jsx(_components.code,{children:`Tag`}),`, `,_jsx(_components.code,{children:`Spinner`}),`, plus `,_jsx(_components.code,{children:`Progress`}),`, `,_jsx(_components.code,{children:`Link`}),`, and `,_jsx(_components.code,{children:`Svg`}),` `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`})]}),_jsxs(_components.td,{children:[`One per session, drawn in layers by all plugins; about 12 lines tall, scrolls inside when taller. `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`}),` Once the band is drawn in two steps, each plugin draws only its own row, and returning `,_jsx(_components.code,{children:`undefined`}),` draws nothing`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/extension/interface#above-prompt-list`,children:_jsx(_components.code,{children:`above-prompt-list`})}),` `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`})]}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Arranging the status band’s rows`}),`: the same band, run after every plugin’s row is drawn`]}),_jsxs(_components.td,{children:[`Same as `,_jsx(_components.code,{children:`above-prompt`})]}),_jsxs(_components.td,{children:[`One per session, drawn in layers by all plugins. `,_jsx(_components.code,{children:`e.props.rows`}),` holds the rows the plugins drew (`,_jsx(_components.code,{children:`{ plugin, tree }[]`}),`); filter or reorder them and pass them unchanged to `,_jsx(_components.code,{children:`next(e)`}),`. Changing, making up, or repeating a row reports `,_jsx(_components.code,{children:`EXTENSION_ROWS_INVALID`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/interface#pane`,children:_jsx(_components.code,{children:`pane`})})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Panel`}),`: a tab in the conversation’s side panel on the right, next to tabs such as Files and Browser`]}),_jsxs(_components.td,{children:[`All 13 elements (`,_jsx(_components.code,{children:`Svg`}),` included)`]}),_jsxs(_components.td,{children:[`Opened by `,_jsx(_components.code,{children:`ctx.ui.open`}),`; each panel is identified by its `,_jsx(_components.code,{children:`id`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/interface#backdrop`,children:_jsx(_components.code,{children:`backdrop`})})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Backdrop`}),`: the backdrop behind the conversation, a layer in the main window under every panel. It replaces the wallpaper while a theme is active`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Box`}),`, `,_jsx(_components.code,{children:`Text`}),`, `,_jsx(_components.code,{children:`Svg`})]}),_jsxs(_components.td,{children:[`One per session, drawn in layers by all plugins; drawn only when the session has a plugin theme (`,_jsx(_components.code,{children:`ctx.theme.set({ backdrop })`}),`). Every layer runs, so draw only your own theme, checked by `,_jsx(_components.code,{children:`e.props.plugin`}),` and `,_jsx(_components.code,{children:`e.props.scene`}),`, and `,_jsx(_components.code,{children:`return next()`}),` otherwise; takes no presses or input`]})]})]})]}),_jsxs(_components.p,{children:[`All three sites draw through the `,_jsx(_components.a,{href:`/extension/interface#render-chain`,children:`render chain`}),`, so keep `,_jsx(_components.code,{children:`await next()`}),` in what you draw. `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`}),` Once the status band is drawn in two steps, `,_jsx(_components.code,{children:`above-prompt`}),` draws only your plugin’s own row and the render chain runs on `,_jsx(_components.code,{children:`above-prompt-list`}),` instead; drawings on `,_jsx(_components.code,{children:`above-prompt-list`}),`, `,_jsx(_components.code,{children:`pane`}),`, and `,_jsx(_components.code,{children:`backdrop`}),` still need `,_jsx(_components.code,{children:`next`}),`.`]}),_jsx(Heading,{level:`2`,id:`elements`,children:`Elements`}),_jsxs(_components.p,{children:[`Write elements in JSX, such as `,_jsx(_components.code,{children:`\u003cText size=\"lg\" weight=\"semibold\">Title\u003c/Text>`}),` or `,_jsx(_components.code,{children:`\u003cButton variant=\"plain\" icon=\"refresh\" label=\"Refresh\" onPress={…} />`}),`. Every element can take a `,_jsx(_components.code,{children:`key`}),` attribute (such as `,_jsx(_components.code,{children:`key=\"counter\"`}),`). See `,_jsx(_components.a,{href:`/extension/interface#keys`,children:`Key rules`}),`. For details, see `,_jsx(_components.a,{href:`/extension/interface#elements`,children:`Elements`}),`.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Element`}),_jsx(_components.th,{children:`Where it works`}),_jsx(_components.th,{children:`Main properties`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cBox>`})}),_jsx(_components.td,{children:`Status band, panel, backdrop`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`direction`}),` (`,_jsx(_components.code,{children:`row`}),` / `,_jsx(_components.code,{children:`column`}),`), `,_jsx(_components.code,{children:`gap`}),`, `,_jsx(_components.code,{children:`padding`}),`, `,_jsx(_components.code,{children:`paddingX`}),`, `,_jsx(_components.code,{children:`paddingY`}),`, `,_jsx(_components.code,{children:`align`}),`, `,_jsx(_components.code,{children:`justify`}),`, `,_jsx(_components.code,{children:`wrap`}),`, `,_jsx(_components.code,{children:`grow`}),`, `,_jsx(_components.code,{children:`shrink`}),`, `,_jsx(_components.code,{children:`width`}),`, `,_jsx(_components.code,{children:`scrollX`}),`, `,_jsx(_components.code,{children:`border`}),`, `,_jsx(_components.code,{children:`radius`}),`, `,_jsx(_components.code,{children:`background`}),`, `,_jsx(_components.code,{children:`hover: { background?, display?: 'show' | 'hide' }`}),`, `,_jsx(_components.code,{children:`scope`}),` (hover group name), child elements`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cText>`})}),_jsx(_components.td,{children:`Status band, panel, backdrop`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`size`}),`, `,_jsx(_components.code,{children:`weight`}),`, `,_jsx(_components.code,{children:`tone`}),`, `,_jsx(_components.code,{children:`background`}),`, `,_jsx(_components.code,{children:`truncate`}),`, `,_jsx(_components.code,{children:`maxLines`}),`, `,_jsx(_components.code,{children:`mono`}),`, `,_jsx(_components.code,{children:`tabular`}),`, children (text)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cTag>`})}),_jsx(_components.td,{children:`Status band, panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`tone`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cButton>`})}),_jsx(_components.td,{children:`Status band, panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`icon`}),`, `,_jsx(_components.code,{children:`tone`}),`, `,_jsx(_components.code,{children:`size`}),`, `,_jsx(_components.code,{children:`variant`}),` (`,_jsx(_components.code,{children:`default`}),` / `,_jsx(_components.code,{children:`plain`}),`), `,_jsx(_components.code,{children:`role`}),` (`,_jsx(_components.code,{children:`'dismiss'`}),`) `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`}),`, `,_jsx(_components.code,{children:`disabled`}),`, `,_jsx(_components.code,{children:`onPress={() => …}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cSpinner>`})}),_jsx(_components.td,{children:`Status band, panel`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`label`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cProgress>`})}),_jsx(_components.td,{children:`Status band, panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`label`}),` (required), `,_jsx(_components.code,{children:`value`}),`, `,_jsx(_components.code,{children:`max`}),`, `,_jsx(_components.code,{children:`valueText`}),`, `,_jsx(_components.code,{children:`tone`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cLink>`})}),_jsx(_components.td,{children:`Status band, panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`href`}),` (required), `,_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`size`}),`, children (text)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cMarkdown>`})}),_jsx(_components.td,{children:`Panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`dim`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cCode>`})}),_jsx(_components.td,{children:`Panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`source`}),`, `,_jsx(_components.code,{children:`language`}),`, `,_jsx(_components.code,{children:`wrap`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cInput>`})}),_jsx(_components.td,{children:`Panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`value`}),`, `,_jsx(_components.code,{children:`placeholder`}),`, `,_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`rows`}),`, `,_jsx(_components.code,{children:`submitLabel`}),`, `,_jsx(_components.code,{children:`onInput={(value) => …}`}),`, `,_jsx(_components.code,{children:`onSubmit={(value) => …}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cSelect>`})}),_jsx(_components.td,{children:`Panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`value`}),`, `,_jsx(_components.code,{children:`options: { value, label }[]`}),`, `,_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`onSelect={(value) => …}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cSwitch>`})}),_jsx(_components.td,{children:`Panel`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`checked`}),`, `,_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`onChange={(checked) => …}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cSvg>`})}),_jsxs(_components.td,{children:[`Backdrop, status band, panel `,_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`source`}),` (required, the SVG source), `,_jsx(_components.code,{children:`alt`}),`, `,_jsx(_components.code,{children:`width`}),`, `,_jsx(_components.code,{children:`height`}),`; no children`]})]})]})]}),_jsx(_components.p,{children:`What some properties do:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cBox width=\"50%\">`})}),_jsx(_components.td,{children:`Takes a percentage of the parent’s width`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cBox shrink={false}>`})}),_jsx(_components.td,{children:`Keeps its own size when a row runs out of room`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cBox scrollX>`})}),_jsx(_components.td,{children:`Scrolls horizontally when its content is wider than it is`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cBox paddingX=\"2\" paddingY=\"1\">`})}),_jsxs(_components.td,{children:[`Sets horizontal or vertical padding on its own, overriding `,_jsx(_components.code,{children:`padding`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cText mono>`})}),_jsx(_components.td,{children:`Monospace font at the same size`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cText tabular>`})}),_jsx(_components.td,{children:`Fixed-width digits, for numbers that line up or change in place`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cText maxLines={2}>`})}),_jsxs(_components.td,{children:[`Truncates after this many lines; takes precedence over `,_jsx(_components.code,{children:`truncate`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cMarkdown dim>`})}),_jsx(_components.td,{children:`Body text (including quotes, list markers, table headers, and inline code) uses the secondary tone; code blocks keep their colors`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cCode wrap>`})}),_jsx(_components.td,{children:`Fixes whether this code wraps and hides the wrap toggle; without it, the user’s own setting applies`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cInput rows={4}>`})}),_jsxs(_components.td,{children:[`2 or more is a fixed-height multi-line input that scrolls inside. With `,_jsx(_components.code,{children:`onSubmit`}),`, `,_jsx(_components.code,{children:`Enter`}),`, `,_jsx(_components.code,{children:`Cmd+Enter`}),`, and `,_jsx(_components.code,{children:`Ctrl+Enter`}),` submit, and `,_jsx(_components.code,{children:`Shift+Enter`}),` adds a new line`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cInput submitLabel=\"Send\">`})}),_jsxs(_components.td,{children:[`With `,_jsx(_components.code,{children:`onSubmit`}),`, shows a submit button that does the same as pressing `,_jsx(_components.code,{children:`Enter`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cProgress label=\"Sync\" value={0.4} />`})}),_jsxs(_components.td,{children:[`With `,_jsx(_components.code,{children:`value`}),`, draws a progress bar and a number; without `,_jsx(_components.code,{children:`value`}),`, draws a task in progress (a spinner with text)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cButton role=\"dismiss\" label=\"Close\">`})}),_jsxs(_components.td,{children:[_jsx(Badge,{color:`blue`,size:`sm`,children:`Coming soon`}),` Draws as a compact `,_jsx(_components.code,{children:`×`}),` button at the end of its row, with `,_jsx(_components.code,{children:`label`}),` as the name screen readers read. `,_jsx(_components.code,{children:`onPress`}),` runs as usual, so change `,_jsx(_components.code,{children:`ctx.state`}),` in it to hide the row`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cLink href=\"https://…\">Docs\u003c/Link>`})}),_jsxs(_components.td,{children:[`Shows the child text, or `,_jsx(_components.code,{children:`label`}),` when there’s none, or the address when there’s neither. A click follows the user’s link-opening setting, and `,_jsx(_components.code,{children:`Cmd`}),` / `,_jsx(_components.code,{children:`Ctrl`}),` click opens the system browser`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003cSvg source={…} alt=\"\" />`})}),_jsxs(_components.td,{children:[`Draws the SVG as an image. `,_jsx(_components.code,{children:`\u003cstyle>`}),`, CSS animations, and SMIL animations all work. On the backdrop, animations are removed when the user turns on reduced motion`]})]})]})]}),_jsx(_components.p,{children:`Property values:`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Allowed values`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Spacing (`,_jsx(_components.code,{children:`gap`}),`, `,_jsx(_components.code,{children:`padding`}),`)`]}),_jsxs(_components.td,{\"data-numeric\":`true`,children:[_jsx(_components.code,{children:`1`}),`, `,_jsx(_components.code,{children:`1.5`}),`, `,_jsx(_components.code,{children:`2`}),`, `,_jsx(_components.code,{children:`3`}),`, `,_jsx(_components.code,{children:`4`}),`, `,_jsx(_components.code,{children:`5`}),`, `,_jsx(_components.code,{children:`6`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Font size (`,_jsx(_components.code,{children:`size`}),`)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`xs`}),`, `,_jsx(_components.code,{children:`sm`}),`, `,_jsx(_components.code,{children:`base`}),`, `,_jsx(_components.code,{children:`lg`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Font weight (`,_jsx(_components.code,{children:`weight`}),`)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`default`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`semibold`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Tone (`,_jsx(_components.code,{children:`tone`}),`, `,_jsx(_components.code,{children:`background`}),`)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`primary`}),`, `,_jsx(_components.code,{children:`secondary`}),`, `,_jsx(_components.code,{children:`tertiary`}),`, `,_jsx(_components.code,{children:`accent`}),`, `,_jsx(_components.code,{children:`danger`}),`, `,_jsx(_components.code,{children:`success`}),`, `,_jsx(_components.code,{children:`warning`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Color (`,_jsx(_components.code,{children:`tone`}),` and `,_jsx(_components.code,{children:`background`}),` on `,_jsx(_components.code,{children:`\u003cText>`}),`, `,_jsx(_components.code,{children:`background`}),` on `,_jsx(_components.code,{children:`\u003cBox>`}),`, `,_jsx(_components.code,{children:`tone`}),` on `,_jsx(_components.code,{children:`\u003cProgress>`}),`)`]}),_jsxs(_components.td,{children:[`The tones above, or a hex color: `,_jsx(_components.code,{children:`#rgb`}),`, `,_jsx(_components.code,{children:`#rgba`}),`, `,_jsx(_components.code,{children:`#rrggbb`}),`, `,_jsx(_components.code,{children:`#rrggbbaa`}),`. Tones follow light and dark mode; hex colors draw as written in both modes. `,_jsx(_components.code,{children:`hover.background`}),` on `,_jsx(_components.code,{children:`\u003cBox>`}),` and `,_jsx(_components.code,{children:`tone`}),` on `,_jsx(_components.code,{children:`\u003cButton>`}),` and `,_jsx(_components.code,{children:`\u003cTag>`}),` accept only tones`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Width (`,_jsx(_components.code,{children:`width`}),` on `,_jsx(_components.code,{children:`\u003cBox>`}),`)`]}),_jsxs(_components.td,{children:[`An integer percentage, `,_jsx(_components.code,{children:`\"1%\"`}),` to `,_jsx(_components.code,{children:`\"100%\"`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Lines (`,_jsx(_components.code,{children:`maxLines`}),` on `,_jsx(_components.code,{children:`\u003cText>`}),`)`]}),_jsx(_components.td,{children:`An integer, 1 to 100`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Lines (`,_jsx(_components.code,{children:`rows`}),` on `,_jsx(_components.code,{children:`\u003cInput>`}),`)`]}),_jsx(_components.td,{children:`An integer, 1 to 12, default 1`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`submitLabel`}),` on `,_jsx(_components.code,{children:`\u003cInput>`})]}),_jsxs(_components.td,{children:[`Not blank, at most 64 characters; shown only with `,_jsx(_components.code,{children:`onSubmit`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`label`}),`, `,_jsx(_components.code,{children:`valueText`}),` on `,_jsx(_components.code,{children:`\u003cProgress>`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`label`}),` is not blank, at most 256 characters; `,_jsx(_components.code,{children:`valueText`}),` is at most 256 characters, such as `,_jsx(_components.code,{children:`\"412 / 900\"`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`value`}),`, `,_jsx(_components.code,{children:`max`}),` on `,_jsx(_components.code,{children:`\u003cProgress>`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`max`}),` defaults to 1, so `,_jsx(_components.code,{children:`value: 0.4`}),` is 40%. A progress bar is drawn when `,_jsx(_components.code,{children:`value`}),` and `,_jsx(_components.code,{children:`max`}),` are both finite and `,_jsx(_components.code,{children:`max`}),` is greater than 0. Without `,_jsx(_components.code,{children:`valueText`}),`, it shows an integer percentage, and shows 0% or 100% only exactly at the ends (below 0 shows 0%, above `,_jsx(_components.code,{children:`max`}),` shows 100%); values in between show 1% to 99%. When `,_jsx(_components.code,{children:`value`}),` is missing, `,_jsx(_components.code,{children:`NaN`}),`, or infinite, or `,_jsx(_components.code,{children:`max`}),` is 0 or less, it draws a task in progress`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`href`}),` on `,_jsx(_components.code,{children:`\u003cLink>`})]}),_jsxs(_components.td,{children:[`At most 2048 characters. It opens only for `,_jsx(_components.code,{children:`https:`}),` addresses, or `,_jsx(_components.code,{children:`http://localhost`}),` on any port, with no username or password; other addresses show as plain text, with no error. Links in `,_jsx(_components.code,{children:`\u003cMarkdown>`}),` follow the same rule`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Corner radius (`,_jsx(_components.code,{children:`radius`}),`)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sm`}),`, `,_jsx(_components.code,{children:`md`}),`, `,_jsx(_components.code,{children:`lg`}),`, `,_jsx(_components.code,{children:`full`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Alignment (`,_jsx(_components.code,{children:`align`}),`)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`start`}),`, `,_jsx(_components.code,{children:`center`}),`, `,_jsx(_components.code,{children:`end`}),`, `,_jsx(_components.code,{children:`stretch`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Distribution (`,_jsx(_components.code,{children:`justify`}),`)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`start`}),`, `,_jsx(_components.code,{children:`center`}),`, `,_jsx(_components.code,{children:`end`}),`, `,_jsx(_components.code,{children:`between`})]})]})]})]}),_jsxs(_components.p,{children:[`For which values combine well on screen, see `,_jsx(_components.a,{href:`/extension/interface#design-rules`,children:`Design rules`}),`. There are 33 button icons. See `,_jsx(_components.a,{href:`/extension/interface#icons`,children:`Icons`}),`. For how to write `,_jsx(_components.code,{children:`\u003cSvg>`}),` and its values, see `,_jsx(_components.a,{href:`/extension/interface#backdrop`,children:`Backdrop`}),` and `,_jsx(_components.a,{href:`#limits`,children:`Limits`}),` below.`]}),_jsx(Heading,{level:`2`,id:`testing`,children:`Testing API`}),_jsxs(_components.p,{children:[`Test files import these functions from `,_jsx(_components.code,{children:`@minimax/mcode-plugin-extension/testing`}),`. See `,_jsx(_components.a,{href:`/extension/testing#write-tests`,children:`Write tests`}),`.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`API`}),_jsx(_components.th,{children:`What it does`}),_jsx(_components.th,{children:`See`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`test(name, fn)`})}),_jsx(_components.td,{children:`Defines a test. A single test can run up to 10 seconds`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#write-tests`,children:`Write tests`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mount(options)`})}),_jsxs(_components.td,{children:[`Loads the module in the real extension host, draws one site, and returns `,_jsx(_components.code,{children:`site`})]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#mount`,children:`Load a site`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`find(site, query)`}),`, `,_jsx(_components.code,{children:`findAll(site, query)`})]}),_jsxs(_components.td,{children:[`Finds the first or every matching element; returns `,_jsx(_components.code,{children:`{ node, path }`})]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#find-press`,children:`Find elements and press buttons`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`press(site, target?, value?)`})}),_jsx(_components.td,{children:`Runs the element’s callback and returns after the redraw finishes`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#find-press`,children:`Find elements and press buttons`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`waitFor(assertion, { timeoutMs? })`})}),_jsx(_components.td,{children:`Runs the assertion repeatedly until it passes`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#find-press`,children:`Find elements and press buttons`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`unmount(site)`})}),_jsx(_components.td,{children:`Ends this load`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#find-press`,children:`Find elements and press buttons`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completeAgent(site, { agentId, answer, reason? })`})}),_jsxs(_components.td,{children:[`Simulates a sub-agent finishing and sends `,_jsx(_components.code,{children:`turn.complete`})]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#agent-test`,children:`Test sub-agents`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`runCommand(site, name, args?)`})}),_jsxs(_components.td,{children:[`Runs a command as if the user typed `,_jsx(_components.code,{children:`/\u003cname> \u003cargs>`}),`, and returns the answer `,_jsx(_components.code,{children:`{ text }`}),`; fails with codes such as `,_jsx(_components.code,{children:`COMMAND_UNHANDLED`}),`, `,_jsx(_components.code,{children:`COMMAND_FAILED`}),`, and `,_jsx(_components.code,{children:`COMMAND_UNKNOWN`})]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#command-test`,children:`Test commands`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`listCommands(site)`})}),_jsxs(_components.td,{children:[`Returns the list `,_jsx(_components.code,{children:`ctx.command.list()`}),` would return`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#command-test`,children:`Test commands`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`expect(actual)`})}),_jsxs(_components.td,{children:[`Assertions: `,_jsx(_components.code,{children:`toBe`}),`, `,_jsx(_components.code,{children:`toEqual`}),`, `,_jsx(_components.code,{children:`toBeTruthy`}),`, `,_jsx(_components.code,{children:`toBeDefined`}),`, `,_jsx(_components.code,{children:`toContain`}),`, `,_jsx(_components.code,{children:`toMatch`}),`; add `,_jsx(_components.code,{children:`.not`}),` to negate`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#results`,children:`Check the results`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`site.slot`}),`, `,_jsx(_components.code,{children:`site.key`})]}),_jsxs(_components.td,{children:[`The loaded site (`,_jsx(_components.code,{children:`slot`}),`) and its full key`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#mount`,children:`Load a site`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`site.tree()`})}),_jsx(_components.td,{children:`The element tree on the current screen`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#find-press`,children:`Find elements and press buttons`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`site.state()`}),`, `,_jsx(_components.code,{children:`site.effects`}),`, `,_jsx(_components.code,{children:`site.diagnostics`})]}),_jsxs(_components.td,{children:[`The current `,_jsx(_components.code,{children:`ctx.state`}),`, the effects sent to the UI (including `,_jsx(_components.code,{children:`theme.set`}),` and `,_jsx(_components.code,{children:`theme.clear`}),`), and diagnostics`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#results`,children:`Check the results`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`site.advance(ms)`})}),_jsx(_components.td,{children:`Advances the fake clock and fires due timers`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/extension/testing#fakes`,children:`Answer for the host: fakes`})})]})]})]}),_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Item`}),_jsx(_components.th,{children:`Limit`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Own time of one hook, press, or observe event Invocation`}),_jsxs(_components.td,{children:[`10 seconds (`,_jsx(_components.code,{children:`EXTENSION_HOOK_EXPIRED`}),`); synchronous code 2 seconds (`,_jsx(_components.code,{children:`timeout`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Total time of one draw`}),_jsxs(_components.td,{children:[`30 seconds (`,_jsx(_components.code,{children:`EXTENSION_RENDER_DEADLINE`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Consecutive failures before a pause`}),_jsxs(_components.td,{children:[`3 (`,_jsx(_components.code,{children:`EXTENSION_DISABLED`}),`), current session only`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ctx.clock`}),` interval`]}),_jsx(_components.td,{children:`At least 1000 ms`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.ui.toast`})}),_jsxs(_components.td,{children:[`6 per plugin per minute (`,_jsx(_components.code,{children:`toast.dropped`}),`); text truncated past 500 characters`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.mcp.call`})}),_jsxs(_components.td,{children:[`60 calls per plugin per minute (`,_jsx(_components.code,{children:`MCP_CALL_RATE_LIMITED`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Queued button actions and commands / observe events`}),_jsxs(_components.td,{children:[`One queue each per plugin in each session, 10 / 32 (including the one running). Button actions and commands share the first queue. While an earlier hook is still running, later ones queue. Past the limit, the newest button action is rejected (`,_jsx(_components.code,{children:`GESTURE_QUEUE_FULL`}),`, and the UI asks the user to try again later), the newest command is rejected with `,_jsx(_components.code,{children:`COMMAND_BUSY`}),`, and the newest observe event is dropped, with a `,_jsx(_components.code,{children:`GESTURE_QUEUE_FULL`}),` entry in `,_jsx(_components.code,{children:`inspect.runtime.diagnostics`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Panels one plugin opens in a session`}),_jsxs(_components.td,{children:[`16; opening more reports `,_jsx(_components.code,{children:`ARGUMENT_INVALID`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Panel `,_jsx(_components.code,{children:`id`}),` / title`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`id`}),` up to 200 characters; titles truncated past 200 characters`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Status band height`}),_jsx(_components.td,{children:`About 12 lines; scrolls vertically inside when taller`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Status band design budget (recommended)`}),_jsx(_components.td,{children:`1 line per plugin, 2 at most; at most 3 buttons; short lists at most 3 items`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Element tree`}),_jsx(_components.td,{children:`At most 5000 nodes, 24 levels deep, 200 KB, 10 000 characters per text run`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.prompt.suggest`})}),_jsxs(_components.td,{children:[`One line of text, non-empty after trimming whitespace, at most 120 characters (whitespace counts), or you get `,_jsx(_components.code,{children:`ARGUMENT_INVALID`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.prompt.fill`})}),_jsx(_components.td,{children:`Text up to 100 000 characters`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ctx.prompt.read`}),`, `,_jsx(_components.code,{children:`suggest`}),` waiting for the message box`]}),_jsx(_components.td,{children:`2 seconds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.model.complete`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`maxTokens`}),` defaults to 1024 and can’t exceed the model’s output limit (64000 at most); `,_jsx(_components.code,{children:`timeoutMs`}),` has no default, maximum 2147483647`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.agent.spawn`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`description`}),` up to 50 characters; running sub-agents can’t exceed the session’s sub-agent limit (`,_jsx(_components.code,{children:`AGENT_CONCURRENCY_LIMIT`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Sub-agent `,_jsx(_components.code,{children:`answer`})]}),_jsxs(_components.td,{children:[`Up to 32 KB, truncated past that with `,_jsx(_components.code,{children:`answerTruncated: true`}),`; `,_jsx(_components.code,{children:`turn.complete`}),` can arrive up to 10 seconds late`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.state`})}),_jsxs(_components.td,{children:[`At most 256 keys; keys use letters, digits, and `,_jsx(_components.code,{children:`_ $ . -`}),`, 1 to 128 characters; 64 KB per value, 1 MB total per session, or you get `,_jsx(_components.code,{children:`ARGUMENT_INVALID`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctx.store`})}),_jsxs(_components.td,{children:[`256 KB per value, 8 MB total per plugin. Past a limit, `,_jsx(_components.code,{children:`ctx.store.set`}),` throws `,_jsx(_components.code,{children:`EXTENSION_SERVICE_FAILED`}),`, and `,_jsx(_components.code,{children:`message`}),` names the limit`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ctx.store`}),` keys`]}),_jsxs(_components.td,{children:[`Must match `,_jsx(_components.code,{children:`^[A-Za-z0-9._-]{1,128}$`}),` and be something other than `,_jsx(_components.code,{children:`.`}),` or `,_jsx(_components.code,{children:`..`}),`. An invalid key gives the extension `,_jsx(_components.code,{children:`EXTENSION_SERVICE_FAILED`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`console`}),` output`]}),_jsxs(_components.td,{children:[`200 lines per plugin per minute (`,_jsx(_components.code,{children:`console.dropped`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Command name (`,_jsx(_components.code,{children:`name`}),` in `,_jsx(_components.code,{children:`ctx.command.register`}),`)`]}),_jsxs(_components.td,{children:[`A string literal matching `,_jsx(_components.code,{children:`^[A-Za-z0-9_-]{1,64}$`}),`, without `,_jsx(_components.code,{children:`/`}),`, compared case-insensitively. It can’t be a built-in command (`,_jsx(_components.code,{children:`advisor`}),`, `,_jsx(_components.code,{children:`btw`}),`, `,_jsx(_components.code,{children:`clear`}),`, `,_jsx(_components.code,{children:`cloud`}),`, `,_jsx(_components.code,{children:`compact`}),`, `,_jsx(_components.code,{children:`fork`}),`, `,_jsx(_components.code,{children:`goal`}),`, `,_jsx(_components.code,{children:`mcp`}),`, `,_jsx(_components.code,{children:`memory`}),`, `,_jsx(_components.code,{children:`new`}),`, `,_jsx(_components.code,{children:`new-bunny`}),`, `,_jsx(_components.code,{children:`plan`}),`, `,_jsx(_components.code,{children:`review`}),`, `,_jsx(_components.code,{children:`sidechat`}),`, `,_jsx(_components.code,{children:`turn-to-session`}),`), and can’t match a Skill or a plugin command registered earlier. When `,_jsx(_components.code,{children:`test`}),` and `,_jsx(_components.code,{children:`preview`}),` validate the package, a name that breaks the rule or is a built-in command gives `,_jsx(_components.code,{children:`EXTENSION_COMMAND_NAME_INVALID`}),`. At run time, `,_jsx(_components.code,{children:`register`}),` gives `,_jsx(_components.code,{children:`COMMAND_NAME_RESERVED`}),` for a name a built-in command or a Skill holds, and `,_jsx(_components.code,{children:`COMMAND_NAME_TAKEN`}),` for a name another plugin’s command holds`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Command `,_jsx(_components.code,{children:`description`}),` / `,_jsx(_components.code,{children:`argumentHint`})]}),_jsxs(_components.td,{children:[`1 to 200 characters / 1 to 64 characters; longer values are rejected (`,_jsx(_components.code,{children:`ARGUMENT_INVALID`}),`), not truncated`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Number of commands`}),_jsxs(_components.td,{children:[`At most 32 plugin commands per session; at most 64 `,_jsx(_components.code,{children:`register`}),` calls that change commands per Activation. Repeating an identical registration and rejected registrations don’t count. Past either limit, `,_jsx(_components.code,{children:`register`}),` gives `,_jsx(_components.code,{children:`COMMAND_LIMIT_REACHED`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Command `,_jsx(_components.code,{children:`args`}),` (`,_jsx(_components.code,{children:`e.args`}),`)`]}),_jsxs(_components.td,{children:[`At most 4096 characters after trimming leading and trailing whitespace, also in `,_jsx(_components.code,{children:`runCommand`}),` in tests (`,_jsx(_components.code,{children:`COMMAND_ARGS_TOO_LONG`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`text`}),` in a `,_jsx(_components.code,{children:`command.run`}),` answer`]}),_jsxs(_components.td,{children:[`At most 500 characters, truncated past that (`,_jsx(_components.code,{children:`COMMAND_TEXT_TRUNCATED`}),`); doesn’t count toward the `,_jsx(_components.code,{children:`ctx.ui.toast`}),` limit`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Wait time for one command`}),_jsxs(_components.td,{children:[`15 seconds, including time in the queue (`,_jsx(_components.code,{children:`COMMAND_TIMEOUT`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`source`}),` on `,_jsx(_components.code,{children:`\u003cSvg>`})]}),_jsxs(_components.td,{children:[`Not blank, at most 131 072 characters (measured by JS `,_jsx(_components.code,{children:`String.length`}),`); it also counts toward the 200 KB element tree limit`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`width`}),`, `,_jsx(_components.code,{children:`height`}),` on `,_jsx(_components.code,{children:`\u003cSvg>`})]}),_jsxs(_components.td,{children:[`CSS pixels, finite, greater than 0, at most 4096. When absent: on the backdrop, fills the area in that direction; in the status band and panels, the image shows at its own size, and without `,_jsx(_components.code,{children:`width`}),` its width fits the content`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`One `,_jsx(_components.code,{children:`\u003cSvg>`}),` image on the backdrop`]}),_jsxs(_components.td,{children:[`At most 5000 nodes (elements and text, plus the elements each `,_jsx(_components.code,{children:`\u003cuse>`}),` copies); at most 16 elements in one `,_jsx(_components.code,{children:`marker`}),`, and no `,_jsx(_components.code,{children:`marker`}),` inside a `,_jsx(_components.code,{children:`marker`}),`; a `,_jsx(_components.code,{children:`\u003cuse>`}),` can’t point to another `,_jsx(_components.code,{children:`\u003cuse>`}),` or to an element containing a `,_jsx(_components.code,{children:`\u003cuse>`}),` (`,_jsx(_components.code,{children:`EXTENSION_SVG_REFUSED`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Theme `,_jsx(_components.code,{children:`backdrop`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`scene`}),`: 1 to 64 characters, required; `,_jsx(_components.code,{children:`blur`}),`: 0 to 30, default 0; `,_jsx(_components.code,{children:`dim`}),`: 0 to 100, default 22`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Theme `,_jsx(_components.code,{children:`backdrop.glass`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{ blur?, tint?, opacity? }`}),` or `,_jsx(_components.code,{children:`false`}),` (no reading surface under the reply area). `,_jsx(_components.code,{children:`blur`}),`: 0 to 30 pixels, default 8; `,_jsx(_components.code,{children:`tint`}),`: a hex color, defaults to the panel color; `,_jsx(_components.code,{children:`opacity`}),`: 0 to 1, defaults to the color’s own alpha`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Theme `,_jsx(_components.code,{children:`colors`})]}),_jsxs(_components.td,{children:[`One set of anchor colors, or `,_jsx(_components.code,{children:`{ light?, dark? }`}),` split by mode (at least one). Each set has 2 to 7 anchors: `,_jsx(_components.code,{children:`surface-0`}),` and `,_jsx(_components.code,{children:`text-primary`}),` are required; `,_jsx(_components.code,{children:`surface-1`}),`, `,_jsx(_components.code,{children:`text-secondary`}),`, `,_jsx(_components.code,{children:`text-tertiary`}),`, `,_jsx(_components.code,{children:`accent`}),`, and `,_jsx(_components.code,{children:`border`}),` are optional. Colors are hex: `,_jsx(_components.code,{children:`#rgb`}),`, `,_jsx(_components.code,{children:`#rgba`}),`, `,_jsx(_components.code,{children:`#rrggbb`}),`, `,_jsx(_components.code,{children:`#rrggbbaa`}),`. Mixing anchors with modes, unknown keys, and empty objects all report `,_jsx(_components.code,{children:`ARGUMENT_INVALID`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Theme contrast`}),_jsxs(_components.td,{children:[`Computed from the colors you wrote. If a text anchor is below 3:1 against a surface anchor in the same set, the whole set is rejected (`,_jsx(_components.code,{children:`THEME_PALETTE_REJECTED`}),`). At 3:1 or more it’s accepted, and text colors below 4.5:1 are darkened or lightened to get as close to 4.5:1 as possible, with a `,_jsx(_components.code,{children:`THEME_PALETTE_ADJUSTED`}),` record`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A single test`}),_jsx(_components.td,{children:`10 seconds`})]})]})]}),_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Diagnostic codes`,icon:`triangle-exclamation`,href:`/extension/errors`,children:_jsx(_components.p,{children:`What each diagnostic code means and how to fix it.`})}),_jsx(Card,{title:`Write your first extension`,icon:`rocket`,href:`/extension/quickstart`,children:_jsx(_components.p,{children:`The full flow from init to install.`})}),_jsx(Card,{title:`Test and troubleshoot`,icon:`bug`,href:`/extension/testing`,children:_jsx(_components.p,{children:`Write tests, read inspect, troubleshoot by symptom.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Extensions reference","sidebarTitle":"Reference","description":"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.","href":"/extension/reference"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Package layout","slug":"package","depth":2,"children":[{"title":"Modules you can import","slug":"imports","depth":3,"children":[]}]},{"title":"The extension tool","slug":"tool","depth":2,"children":[]},{"title":"Events","slug":"events","depth":2,"children":[]},{"title":"ctx methods","slug":"ctx","depth":2,"children":[]},{"title":"Sites","slug":"sites","depth":2,"children":[]},{"title":"Elements","slug":"elements","depth":2,"children":[]},{"title":"Testing API","slug":"testing","depth":2,"children":[]},{"title":"Limits","slug":"limits","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/agent-en/771da42817f2844d/scripts/seo-schema.js"],"subdomain":"agent-en","siteName":"MiniMax Code Docs","title":"Extensions reference - MiniMax Code Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-30T08:27:26.213Z","originalFileLocation":"extension/reference.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.\">\u003cmeta data-mint-head name=\"keywords\" content=\"MiniMax Code, AI agent, AI coding assistant, full-stack AI, PPT generator, deep research AI, MCP integration, Supabase AI, AI web app builder, MiniMax changelog\">\u003cmeta data-mint-head name=\"application-name\" content=\"MiniMax Code Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Extensions reference - MiniMax Code Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MiniMax Code\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://code.minimax.io/docs/extension/reference\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://file.cdn.minimax.io/public/58eca777-e31f-448a-9823-e2220e49b426.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"MiniMax Code – AI Agent for Complex Tasks\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Build full-stack apps, presentations, and research reports with MiniMax Code. Powered by multi-agent AI.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://file.cdn.minimax.io/public/58eca777-e31f-448a-9823-e2220e49b426.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/agent-en/RrLMm1BmnhcYtr3S/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MiniMax Code Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#181E25\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"charset\" content=\"UTF-8\">\u003cmeta data-mint-head name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://code.minimax.io/docs/extension/reference\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/extension/reference.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://code.minimax.io/#organization\",\"name\":\"MiniMax Code Docs\",\"url\":\"https://code.minimax.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/agent-en/AWwAA_JD3rUWnMtN/logo/light.svg?fit=max\u0026auto=format\u0026n=AWwAA_JD3rUWnMtN\u0026q=85\u0026s=dd070cb1a0cc203f11cd45f588926f57\"}},{\"@type\":\"WebSite\",\"@id\":\"https://code.minimax.io/docs#website\",\"name\":\"MiniMax Code Docs\",\"url\":\"https://code.minimax.io/docs\",\"publisher\":{\"@id\":\"https://code.minimax.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://code.minimax.io/docs/extension/reference#webpage\",\"url\":\"https://code.minimax.io/docs/extension/reference\",\"name\":\"Extensions reference\",\"description\":\"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.\",\"dateModified\":\"2026-11-30T08:27:26.213Z\",\"isPartOf\":{\"@id\":\"https://code.minimax.io/docs#website\"},\"breadcrumb\":{\"@id\":\"https://code.minimax.io/docs/extension/reference#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://code.minimax.io/docs/extension/reference#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Extension Development\",\"item\":\"https://code.minimax.io/docs/extension/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extensions reference\",\"item\":\"https://code.minimax.io/docs/extension/reference\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://code.minimax.io/docs/extension/reference#article\",\"headline\":\"Extensions reference\",\"name\":\"Extensions reference\",\"description\":\"Quick reference for the extension package layout, the extension tool, events, ctx methods, sites, elements, and limits.\",\"url\":\"https://code.minimax.io/docs/extension/reference\",\"mainEntityOfPage\":{\"@id\":\"https://code.minimax.io/docs/extension/reference#webpage\"},\"image\":\"https://file.cdn.minimax.io/public/58eca777-e31f-448a-9823-e2220e49b426.png\",\"dateModified\":\"2026-11-30T08:27:26.213Z\",\"publisher\":{\"@id\":\"https://code.minimax.io/#organization\"},\"isPartOf\":{\"@id\":\"https://code.minimax.io/docs#website\"}}]}\u003c/script>","agentPointerHref":"/docs/extension/reference.md","siteName":"MiniMax Code Docs","nav":{"global":null,"tabs":[{"tab":"MiniMax Code","groups":[{"group":"Get Started","pages":[{"title":"Welcome to MiniMax Code","sidebarTitle":"Welcome","href":"/code/welcome"},{"title":"Download and Install","sidebarTitle":"Download and Install","href":"/code/get-started/download"},{"title":"Create Your First Task","sidebarTitle":"Create Your First Task","href":"/code/get-started/first-task"},{"title":"Tips","sidebarTitle":"Tips","href":"/code/get-started/tips"},{"title":"Model Pairing","sidebarTitle":"Model Pairing","href":"/code/get-started/model-pairing"}]},{"group":"Core Workflows","pages":[{"title":"Coding and Work Modes","sidebarTitle":"Coding and Work Modes","href":"/code/workflows/modes"},{"title":"Workspace and Project Context","sidebarTitle":"Workspace and Project Context","href":"/code/workflows/workspace"},{"title":"Tasks and History","sidebarTitle":"Tasks and History","href":"/code/workflows/tasks"},{"title":"Conversation Collaboration","sidebarTitle":"Conversation Collaboration","href":"/code/workflows/conversation-collaboration"},{"title":"Code Review","sidebarTitle":"Code Review","href":"/code/workflows/code-review"},{"title":"Permissions and Safety","sidebarTitle":"Permissions and Safety","href":"/code/workflows/permissions"}]},{"group":"Desktop Features","pages":[{"title":"Infinite Canvas","sidebarTitle":"Infinite Canvas","href":"/code/desktop/infinite-canvas"},{"title":"Goal","sidebarTitle":"Goal","href":"/code/desktop/goal"},{"title":"Built-in Browser","sidebarTitle":"Built-in Browser","href":"/code/desktop/browser"},{"title":"Chrome Browser Extension","sidebarTitle":"Chrome Browser Extension","href":"/code/desktop/chrome-extension"},{"title":"Computer Use","sidebarTitle":"Computer Use","href":"/code/desktop/computer-use"},{"title":"Files / Changes / Terminal Panels","sidebarTitle":"Developer Panels","href":"/code/desktop/panels"},{"title":"Appearance","sidebarTitle":"Appearance","href":"/code/desktop/appearance"},{"title":"Shortcuts and Mini Window","sidebarTitle":"Shortcuts and Mini Window","href":"/code/desktop/shortcuts"},{"title":"Updates and Feedback","sidebarTitle":"Updates and Feedback","href":"/code/desktop/updates-feedback"}]},{"group":"Agent Capabilities","pages":[{"title":"Agent Team","sidebarTitle":"Agent Team","href":"/code/agents/team"},{"title":"Advisor","sidebarTitle":"Advisor","href":"/code/agents/advisor"},{"title":"Custom Agents","sidebarTitle":"Custom Agents","href":"/code/agents/custom-agents"},{"title":"Mini Apps","sidebarTitle":"Mini Apps","href":"/code/agents/mini-apps"},{"title":"H3 Max Video Generation","sidebarTitle":"H3 Max Video Generation","href":"/code/agents/h3-max"},{"title":"Plugin Marketplace","sidebarTitle":"Plugin Marketplace","href":"/code/agents/plugins"},{"title":"Plugin Extensions","sidebarTitle":"Plugin Extensions","href":"/code/agents/extensions"},{"title":"Plugin Development and Submission Guide","sidebarTitle":"Plugin Submission","href":"/code/agents/plugin-submission"},{"title":"MCP Servers","sidebarTitle":"MCP Servers","href":"/code/agents/mcp"},{"title":"Memory","sidebarTitle":"Memory","href":"/code/agents/memory"}]},{"group":"Extension Development","pages":[{"title":"Extensions overview","sidebarTitle":"Overview","href":"/extension/overview"},{"title":"Capabilities and progress","sidebarTitle":"Capabilities and progress","href":"/extension/progress"},{"title":"Write your first extension","sidebarTitle":"Write one","href":"/extension/quickstart"},{"title":"Interface: sites and elements","sidebarTitle":"Interface","href":"/extension/interface"},{"title":"Events (hooks)","sidebarTitle":"Events","href":"/extension/events"},{"title":"Extension API","sidebarTitle":"API","href":"/extension/api"},{"title":"Test and troubleshoot","sidebarTitle":"Test and troubleshoot","description":"Write automated tests for an extension, have the Agent run tests and inspect, and track down why an extension isn't working by symptom.","href":"/extension/testing"},{"title":"Extensions reference","sidebarTitle":"Reference","href":"/extension/reference"},{"title":"Diagnostic codes","sidebarTitle":"Diagnostic codes","description":"The diagnostic codes extensions report during validation, preview, and runtime, what each one means and how to fix it, and the notices users may see in the UI.","href":"/extension/errors"}]},{"group":"Automation \u0026 Remote","pages":[{"title":"Scheduled Tasks","sidebarTitle":"Scheduled Tasks","href":"/code/automation/schedules"},{"title":"Remote Control","sidebarTitle":"Remote Control","href":"/code/automation/remote-control"},{"title":"Messaging Integrations","sidebarTitle":"Messaging Integrations","href":"/code/automation/im"}]},{"group":"Models \u0026 Account","pages":[{"title":"M Plan and Credits","sidebarTitle":"M Plan and Credits","href":"/code/account/usage"},{"title":"MiniMax API Key","sidebarTitle":"MiniMax API Key","href":"/code/account/minimax-api"},{"title":"Custom Models / BYOK","sidebarTitle":"Custom Models / BYOK","href":"/code/account/byok"},{"title":"Configure BYOK Models with an Agent","sidebarTitle":"Agent Setup Guide","href":"/code/account/byok-agent-setup"}]},{"group":"Help","pages":[{"title":"FAQ","sidebarTitle":"FAQ","href":"/code/help/faq"},{"title":"Feedback","sidebarTitle":"Feedback","href":"/code/help/feedback"}]}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/quick-start"}]},{"tab":"Mini App Development","pages":[{"title":"Mini App Development","href":"/miniapp/overview"}]},{"tab":"Community Picks","pages":[{"title":"Community Picks","href":"/community/webui"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"Research","pages":[{"title":"Research","href":"/techblog"}]}]},"basePath":"","title":"Extensions reference - MiniMax Code Docs","deploymentId":"dpl_hSqyvJ4yQMj8zFViHgqnZFPm1xMv","buildId":"dpl_hSqyvJ4yQMj8zFViHgqnZFPm1xMv","dynamics":[],"chunks":[]}