Skip to main content

Module contract

Module contract 

Source
Expand description

The host API contract (catalog/host.json) as constants, plus the client messages every platform host sends (tests/host_fixtures.rs gates the constants against the JSON).

Constants§

A2UI_MESSAGE_KINDS
The four A2UI v0.9 server messages.
DEFAULT_FUNCTION_DECISION
The default function policy’s default.
DEFAULT_MEDIA_SCHEMES
The media loader’s schemes when the host lists none (no file).
DEFAULT_URL_SCHEMES
EXTENSION_MESSAGE_KINDS
The two Exponential UI extensions.
FUNCTION_DECISIONS
FUNCTION_DENIED
FUNCTION_NOT_FOUND
HOST_CONTRACT_VERSION
HOST_ERROR_CODES
INVALID_MESSAGE
MCP_ACTION_TOOL
MCP_MIME_TYPES
MEDIA_MAX_BYTES
media.limits: what every image loader enforces.
MEDIA_MAX_PIXELS
MEDIA_OPTION_KEYS
MEDIA_RULE_KEYS
MEDIA_TIMEOUT_MS
MESSAGE_KINDS
Every message kind the router takes, A2UI first.
OP_KINDS
What the router turns a message into.
PACKAGE_REQUIRED
PAINT_ERROR_HOOK
The renderer → host hook a failed painter calls (paint.hook).
PRIVATE_HOSTS
VAPP-107: the hosts decide_url denies by default (urls.privateHosts, the rule itself is super::is_private_host).
RECORD_KIND_PATTERN
VAPP-122: a record kind’s name (package.records.kindPattern).
RENDER_FAILED
A component’s painter failed (paint.errorCode).
SOURCE_DENIED
VAPP-107: a bindDataModel outside a package surface’s sources.
SOURCE_PARAMS_ENCODING
VAPP-122: how the bind action appends its params (sources.paramsEncoding).
SOURCE_PATTERN
A binding source URI (<scheme>:<name>[?k=v&…]).
SSE_EVENTS
SURFACE_COMMANDS
SURFACE_FORMATTER
SURFACE_NOT_FOUND
SURFACE_SETTINGS
Round 2: what a host hands each surface besides messages — the SurfaceSettings keys, the host formatter’s methods, the commands.
TEMPLATE_NOT_FOUND
UNSUPPORTED_CATALOG
URL_REASONS
VALIDATION_FAILED

Functions§

action_message
A client action message (A2UI v0.9 action). context null = {}; payload only when it has keys (JS Object.keys(payload).length).
error_message
A client error message (A2UI v0.9 error); path only when given.
host_contract
catalog/host.json without its $comments, rebuilt from the constants.