Skip to content
中文

Models & interaction ​

Kit · Optional business libraries · Back to layer index

SymbolKindPurpose
bindInteractionfunctionBind every registered transfer command to a local handler. Models cannot add handlers.
CommandinterfaceCompiled command.
CommandCatalogclassMode and cross-protocol field ownership checks are shared by all receiving hosts. The catalog seals itself as soon as construction finishes, so a run cannot register a new command later; set remains available only for the superclass installation pass.
CommandCatalogOptionsinterfaceEnvelope-level options for a command catalog.
CommandDefinitioninterfaceDeclarative command shape before compilation.
commandSchemafunctionBuild a JSON schema for one command id. Prefer compiled schemas; retain the existing open-schema contract for dynamic host protocols. A protocol without fieldSchemas falls back to an open object that only pins the discriminator, which keeps legacy hosts working without weakening compiled ones.
compileCommandsfunctionCompile a whole catalog with shared envelope fields. Applications declare only their own data and handlers. Defaults are merged in this order: unrelated default keys, then the command's own keys, with fields, checks and tags concatenated so shared envelope checks always run before per-command checks.
defineCommandfunctionCompile declarations once. Parsing is synchronous and never executes a registered tool. Two schemas are produced from one declaration: modelJsonSchema marks only fields the model must fill, while inputJsonSchema marks every required field. A discriminator, when present, is prepended as a required constant field.
defineCommandCatalogfunctionCompile definitions and wrap them in a sealed catalog.
defineInteractionProtocolfunctionConstruct a protocol from one definition.
INTERACTION_CATEGORIESconstant
InteractionCategorytypeInteraction purpose, never an authorization level or an assertion of execution success.
InteractionDescriptorinterfaceCatalog metadata for one command, independent of its field shape.
InteractionHandlerstypeHandler map keyed by command id; each handler receives the parsed value and App context.
InteractionProtocolclassWeb/AI payload family. HTTP/SSE framing and actual command execution remain separate ports. Every command registered here gets the envelope's discriminator forced to its own id, so a payload cannot claim one command while carrying another command's data.
InteractionProtocolDefinitiontypeTransfer envelope plus its registered command family; no change to HTTP or SSE framing.
ProtocolCheckinterfaceOne declarative rejection rule.
ProtocolFieldinterfaceField presence, schema and ownership are declared together; schemas describe model input.
ProtocolPredicatetypePredicate evaluated during validation; any truthy result counts as a failure.
ProtocolReasontypeLazy rejection wording: a fixed message, a pre-built error, or a factory bound to the value.
ProtocolShapeinterfaceCustom protocols may derive dynamic keys without supplying a compiled schema.
RegisteredProtocolinterfaceRuntime extension contract; hosts retain their own version values and validation context.

API reference, usage examples and developer guides.