Skip to content
English

工具与能力 ​

Support · 推荐实现与策略 · 返回本层目录

符号类别用途
CapabilityCatalogOptionsinterfaceCatalog construction options.
CapabilityModuleinterfaceMinimal composition contract; lifecycle and domain fields remain application-owned.
CapabilityToolReferencesinterfaceTool references declared by one owner module.
CompiledTooltypeTool definition type derived from a declaration literal, preserving input/output/id.
defineCapabilityCatalogfunctionBuild a frozen capability catalog from application module declarations. Each module must carry a non-empty description, and every contributed tool ID must be unique across modules. Reference projections run during construction and must be synchronous.
defineToolfunctionValidate one tool declaration and freeze a detached copy of it. authorize must settle with void; a rejection has to be thrown, so a returned false cannot silently pass. Handlers are bound to the declaration object, and the input schema is re-snapshotted so later mutation cannot widen the accepted input.
defineToolCatalogfunctionInfer the host context from existing executable definitions, without widening it to unknown. Explicit host typing remains available for contextually typed declaration lists.
SelectedToolstypeCatalog narrowed to the given ids: each kept tool's id literal is intersected with Id.
ToolCataloginterfaceFrozen tool catalog with model tools and per-request binding.
ToolCatalogEntrytypePublic declaration surface of one tool, without registry internals.
ToolModelViewinterfaceModel capability view of a tool catalog, retaining the host context type.
ToolOutputtypeOutput type of the tool whose id matches Id; never for any other id.
ToolRuntimeinterfaceCatalog bound to one App request.
validateToolReferencesfunctionValidate tool references against the complete registered set. Checking against every registered tool (not only the ones available in the current request) keeps the declaration honest: a module may reference a tool that this request filters out, but never one that does not exist.

接口参考、使用示例与开发指南。