模型与交互
Kit · 可选业务库 · 返回本层目录
| 符号 | 类别 | 用途 |
|---|---|---|
bindInteraction | function | Bind every registered transfer command to a local handler. Models cannot add handlers. |
Command | interface | Compiled command. |
CommandCatalog | class | Mode 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. |
CommandCatalogOptions | interface | Envelope-level options for a command catalog. |
CommandDefinition | interface | Declarative command shape before compilation. |
commandSchema | function | Build 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. |
compileCommands | function | Compile 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. |
defineCommand | function | Compile 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. |
defineCommandCatalog | function | Compile definitions and wrap them in a sealed catalog. |
defineInteractionProtocol | function | Construct a protocol from one definition. |
INTERACTION_CATEGORIES | constant | |
InteractionCategory | type | Interaction purpose, never an authorization level or an assertion of execution success. |
InteractionDescriptor | interface | Catalog metadata for one command, independent of its field shape. |
InteractionHandlers | type | Handler map keyed by command id; each handler receives the parsed value and App context. |
InteractionProtocol | class | Web/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. |
InteractionProtocolDefinition | type | Transfer envelope plus its registered command family; no change to HTTP or SSE framing. |
ProtocolCheck | interface | One declarative rejection rule. |
ProtocolField | interface | Field presence, schema and ownership are declared together; schemas describe model input. |
ProtocolPredicate | type | Predicate evaluated during validation; any truthy result counts as a failure. |
ProtocolReason | type | Lazy rejection wording: a fixed message, a pre-built error, or a factory bound to the value. |
ProtocolShape | interface | Custom protocols may derive dynamic keys without supplying a compiled schema. |
RegisteredProtocol | interface | Runtime extension contract; hosts retain their own version values and validation context. |