Skip to content
中文

Kit · Optional business libraries ​

Configuration, catalogs & policies ​

Open group

SymbolKindPurpose
AgentCatalogPortsinterfacePorts the catalog reads from the App's registries.
CatalogGoalinterfaceGoal as the catalog sees it: an id plus its declared delegates.
CatalogScopeinterfaceScope as the catalog sees it: an id plus the tools it may use.
CatalogTaskinterfaceThe goal currently accepted for the request, used to narrow the catalog.
CatalogToolinterfaceTool facts the catalog needs, independent of lifecycle details.
defineAgentCatalogfunctionCompile a catalog projection over the App's live registries. The actual registries determine availability and relationships. No parallel capability list exists: goalIds filters by tool support, modelCatalog narrows to the currently accepted task when restrictToTask is enabled, and scope tool ids are filtered to tools that exist.
definePolicySetfunctionCompile a policy set that reports every matching reason. Collect every matching reason; a configured mode cannot silently override a mandatory policy. assess returns the matched ids and deduplicated kinds rather than a single verdict, so callers keep the ordering information they need for messages and diagnostics.
defineRecoveryChainfunctionCompile an ordered recovery chain. A handler reports whether it handled the input; handled undefined values remain explicit. The first handler that reports handled ends the walk, so declaration order is the precedence, and { handled: false } is the only way to fall through.
DescribedToolinterfaceModel- or host-facing description of one tool.
Policiesconstant
PolicyAssessmentinterfaceResult of assessing every registered policy against one input.
PolicyDefinitioninterfaceOne declarative policy.
RecoveryDefinitioninterfaceOne recovery handler in an ordered chain.
RecoveryResulttypeOutcome of one recovery handler, or of the whole chain.

Branches & versioning ​

Open group

SymbolKindPurpose
AgentFamilyinterfaceCompiled family API. Every mutation returns the record after the write.
defineAgentFamilyfunctionCompile a versioned family backed by an App-owned compare-and-swap store. Every mutation reads the record, verifies the caller's expected revision, then commits with a compare-and-swap, so concurrent writers fail with a revision conflict rather than overwriting each other. Reads are also treated as policy checks because the App binds its read rules into the store it supplies.
Familyconstant
FamilyDefinitioninterfaceApp-owned hooks and limits for one family.
FamilyOperationtypeOne of the four family mutations.
familyOperationsconstant
FamilyRecordinterfaceA whole family: its versions and which version is currently active.
FamilyStoreinterfaceCAS must cover every writer and the active pointer in one real storage commit.
FamilyVersioninterfaceImmutable snapshot of App state at one point on a branch.

Observation & diagnostics ​

Open group

SymbolKindPurpose
AgentOutputEventtypeOne output event of a delivered reply.
publishReplyEventsfunctionStream one reply as paced text chunks and bubble separators. Publish a validated reply without exposing its internal boundary to consumers. The pacing options are upper bounds, not exact timings: the pause and interval are clamped against maxDurationMs, so added delay never exceeds the budget while every chunk is still emitted.
REPLY_BUBBLE_BOUNDARYconstant
ReplyBubbleInputinterfaceReply pieces accepted by the bubble helpers; non-string entries are ignored.
replyBubbleTextsfunctionCollect the non-empty-text parts of a reply.
ReplyDeliveryOptionsinterfaceHost-controlled delivery of already validated text; not upstream model generation.
serializeOutputEventsfunctionSerialize the event protocol for callers using a text stream. preview events are dropped because they are not final text; bubbles become the boundary character again, so a consumer can re-split the stream.
textOutputEventsfunctionWrap already-chunked text as text events.

Shared contracts & helpers ​

Open group

SymbolKindPurpose
Aggregationconstant
Candidatesconstant
CandidateSelectionDefinitioninterfaceDeclares the alternative-proposal envelope. A value without the declared field is treated as a single implicit candidate.
ContentProjectioninterfaceProjection output.
ContentProjectionOptionsinterfaceCandidate strategy for content projection.
createIntentRegistryfunctionCreate and seal a complete catalog; use the constructor for incremental installation.
defineCandidateSelectionfunctionCompile an alternative-proposal envelope contract. Alternative proposals are bounded and shallow; accepting a task closes this capability. A value that is not an object, or that does not carry the candidate field, is treated as a single implicit candidate and returned as-is. Once the envelope is present it must contain only that field, and its array must hold between minCandidates (default 1) and maxCandidates distinct candidate objects that do not themselves repeat the field.
defineContentProjectionfunctionCompile a JSON-preserving projector. Keep valid JSON while reducing prose before dropping records; budgets are caller policy. The candidate list is tried in order (outer counts, inner lengths), so callers control whether trimming text or dropping items is preferred, and the configured fallback is used only when no candidate fits.
defineDeliveryfunctionCompile a delivery pipeline from its declared stages. Stages are registered once, in declaration order, and must have unique non-blank ids. A stage without a handle is a named hook only, so beforeStage can observe it.
defineNormalizationfunctionCompile an ordered normalization pipeline. Steps run in declaration order. Each step may be skipped by its when predicate, receives the value produced by the previous step, and isComplete can stop the walk early, so the usual contract is "first completion wins" rather than "always run everything".
defineQueryAggregationfunctionCompile one ordered read plan over a list of inputs. Ordered synchronous queries with optional stable-key merging; each real read stays host-owned. Inputs run sequentially in the given order, so a host can rely on a deterministic visit sequence. Without key every item is kept; with key the last write wins per key but the position of the first occurrence is retained.
defineTextSkillLoaderfunctionCompile a loader that validates registrations and reads their documents. The default contract is narrow by design: ids are lower-case words joined by hyphens (up to maxIdChars, default 64), each entry lives at <id>/SKILL.md, the kind is text-workflow, and the document starts with name/description front matter.
defineTreeProjectionfunctionCompile a depth-limited tree transform. Traverse synchronously in property/array order; only undefined omits a result. Because a visitor returns a new value instead of mutating, an omitted branch disappears from arrays and objects the same way, and maxDepth bounds both cycles and cost.
Deliveryconstant
DeliveryOptionsinterfacePipeline construction options.
DeliveryStageinterfaceOne pipeline stage, identified for reporting and optional observation.
IntentDescriptiontypeRegistered domain Tool with its delegates widened to the definition's delegate literals.
IntentIdtypeUnion of the ids of a definition set, or string when it cannot be narrowed.
IntentPolicyinterfaceRegistration rules for one intent registry.
IntentRegistryclassGoal semantics and allowed values are configuration; the registry owns their common lifecycle. Registration order is preserved by ids, definitions, values and entries; once seal() is called the set is final and further registration is rejected.
IntentToolinterfaceOne domain Tool.
IntentToolRegistrationtypeConfiguration form; object arguments and a Tool proposal are the registration defaults.
mergeByKeyfunctionMerge duplicates without moving their first position; selection policy remains host-owned. The first occurrence of a key fixes the output position; select decides which item that position finally holds, so callers can prefer the newest or the most complete duplicate.
ModelBindinginterfaceApp-defined I/O. Registered literal IDs determine input and output types.
ModelCallsclassFrozen catalog of model bindings plus a checked invocation entry point. Registration happens once in the constructor; the catalog is never mutated afterwards, so a caller cannot swap a provider in the middle of a run.
ModelInvocationContextinterfaceOne take consumes one binding invocation attempt, independent of batch size or chat tokens.
ModelInvocationRequestinterfaceOne model call: registered binding id, the input to hand over and its timeout.
Normalizationconstant
NormalizationOptionsinterfacePipeline options.
NormalizationStepinterfaceOne ordered transformation.
projectContinuousExcerptfunctionProject a continuous excerpt of a body by binary-searching the longest prefix that fits. Binary-search a continuous prefix and keep an existing surrogate pair intact. render receives the prefix length, not the text, so the caller decides how the excerpt is framed.
Projectionconstant
QueryAggregationOptionsinterfaceQuery aggregation contract: several ordered reads collapsed into one item list. Place in the package: an optional App-side helper for merging results of the same query shape run against several inputs. The Kit owns ordering and optional stable-key merging; every real read, the merge policy and the meaning of an item stay with the App. Exports: QueryAggregationOptions.
RegisteredIntenttypeFrozen registration view: list fields are frozen copies, helper methods are dropped.
splitTextBlocksfunctionSplit long plain text on structural boundaries. Headings and horizontal rules start a new block, blank lines end the current one, and all other lines break only when the target size would be exceeded. A single line longer than the target becomes its own block so that paging can cut it into fragments later without splitting the line into unrelated sections. Concatenating every block reproduces the input exactly: no truncation, padding or dropped whitespace. The input must be plain text; binaries and rich documents are read elsewhere.
TextBlockinterfaceOne structure-aware block of a long text.
TextBlockOptionsinterfaceSplitting options.
TextBlocksconstant
TextSkillinterfaceLoaded skill: registration plus the parsed document text.
TextSkillHeaderinterfaceHeader every skill document must carry.
TextSkillLoaderinterfaceCompiled loader.
TextSkillLoaderDefinitioninterfaceLoader limits, parsing hooks and rejection wording.
TextSkillReadPortsinterfaceHost port that reads one skill document by path.
TextSkillRegistrationinterfaceCatalog entry of one text skill, before its document is read.
TextSkillsconstant
TreeProjectionOptionsinterfaceDepth- and record-level traversal options for tree projection.
uniqueByfunctionStable deduplication preserves the original values; the host chooses equivalence. The first occurrence of each key wins and the input order is kept, so callers can rely on deduplication never reordering their list.

Knowledge, answering & presentation ​

Open group

SymbolKindPurpose
AnswerCheckinterfaceResult of one local or review check over a generated answer.
AnswerCheckerinterfaceOne named check applied to a generated answer value.
AnswerFlowDefinitioninterfaceStatic handlers and limits; signal, diagnostics and App dependencies arrive at run.
Answeringconstant
AnswerIssueinterfaceValidation problem produced while checking a generated answer.
AnswerIteminterfaceOne unit an answer batch must produce.
AnswerReaderinterfaceApp-owned reader that gathers evidence for one task.
AnswerResultinterfaceFinal outcome for one item.
AnswerTaskDefinitioninterfaceStatic binding of one answerable task.
AnswerTaskPortsinterfaceRegistries a task catalog validates its references against.
CompiledReplyFormatinterfaceA resolved format with its checks bound; callers only inspect replies using it.
defineAnswerCheckCatalogfunctionCompile a checker catalog. A checker may return a replacement value; it is threaded into the next checker, so the selected ids behave like an ordered chain rather than independent assertions.
defineAnswerFlowfunctionCompile a reusable answer workflow. Reusable answer workflow. Requests own cells and repair budgets; models remain caller-owned. The flow runs at most maxRepairs + 1 rounds: one generation pass, then one repair round per failing item set, and finally an explicit accepted/fallback/blocked result per item.
defineAnswerReaderCatalogfunctionCompile a reader catalog.
defineAnswerTaskCatalogfunctionCompile the answer task catalog from its declarations and shared ports. Task ids, schemas, readers, outputs and checks have one compiled authority: a task can only reference a reader or check that the ports actually registered, and metadata is cloned and frozen so later mutation by the caller cannot change a registered task.
defineKnowledgeCatalogfunctionCompile a knowledge catalog from document declarations. Reads are declarative: document returns the whole text, self returns exactly the named sections and subtree includes their nested sections. Section ids are validated up front, so a typo fails at read time instead of silently returning partial content.
defineKnowledgePublicationfunctionCompile a publication lifecycle over one App-owned atomic record. Candidate preparation and publication share the same compiler and an App-owned atomic revision. propose compiles and validates a candidate but leaves published documents alone; publish re-verifies sources and the base revision before swapping, so a stale candidate can never overwrite newer content.
defineOutputCatalogfunctionCompile output definitions into one catalog. Compilation is where most mistakes surface: group membership is checked for cycles, master templates must have exactly one slot per field, and every bound/semantic field must name a registered provider. Composition then trusts the compiled catalog.
defineReplyFormatsfunctionCompile reply formats so that checks run only for templates the current turn uses.
defineSemanticSlotsfunctionModels select public semantic keys; hosts retain private values and selection policy. A text is valid when it uses at most maxOccurrences namespaced slots, every name is a declared key, and no malformed {{namespace remnant is left behind — the last check stops partial or misspelled placeholders from reaching the template engine.
defineTextTemplatefunctionThe program owns the master; inserted model text is a value and is substituted once only. Substitution is single-pass String.replace: a value that itself contains {{slot}} is left as literal text, so a slot value cannot inject further substitutions.
Knowledgeconstant
KnowledgeCandidateinterfaceA proposed document awaiting publish or reject.
KnowledgeCataloginterfaceCompiled catalog of knowledge documents.
KnowledgeCatalogOptionsinterfaceCatalog construction options.
KnowledgeDocumentinterfaceOne versioned document as supplied by the App.
KnowledgeParttypeDocument content: a text leaf or a nested section.
KnowledgePublicationinterfaceCompiled publication workflow.
knowledgePublicationOperationsconstant
KnowledgePublicationOptionsinterfaceApp-owned guards, store and limits for a publication workflow.
KnowledgePublicationRecordinterfaceStored publication state: one published revision plus pending candidates.
KnowledgePublicationStoreinterfaceSingle-writer store for the publication record.
KnowledgeReadinterfaceA request for one document selection.
KnowledgeSectioninterfaceA named section that may contain text and further sections.
KnowledgeSnapshotinterfaceMaterialized read result.
KnowledgeSourceReferenceinterfaceCitation of the material a candidate was derived from.
mergeReplyBubblesfunctionNormalize a reply that has no declared format: drop blank bubbles and merge overflow into the last allowed one. Text content is preserved.
OutputCatalogOptionsinterfaceCatalog construction options.
OutputComposeInputinterfaceInput for composing one output: model values plus program-assigned group members.
OutputDefinitioninterfaceOne output shape.
OutputFieldinterfaceOne field of an output definition.
OutputIssueinterfaceOutput problem with a guaranteed field path.
OutputProviderinterfaceApp-owned value provider for bound and semantic fields.
OutputResultinterfaceComposed output value.
parseKnowledgeDocumentfunctionPaired, nestable anchors are one text adapter. Other sources supply the same document contract directly.
Presentationconstant
ReplyFormatCheckinterfaceOne check a template declares, evaluated against the rendered bubbles.
replyFormatChecksconstant
ReplyFormatDefinitioninterfaceA template-bound reply format, matched against per-turn facts.
ReplyFormatOptionsinterfaceDeclaration input for defineReplyFormats.
resolvePreferencefunctionResolve the preferred candidate. Highest priority wins; order breaks ties with the later entry first, so recency can be encoded without touching priority. The input array is copied before sorting.
SectionSelectiontypeWhich part of a document a read returns.
selectVariantfunctionPick one variant, avoiding an immediate repeat when alternatives exist. When every candidate equals previous, the full list is used again, so a single-value set still yields a result instead of failing.
SemanticSlotDefinitioninterfaceDeclares the {{namespace:key}} slots a model may use, and how often.
TextTemplateOptionsinterfaceText template construction options.
validateAnswerBatchfunctionValidate that one batch is well formed and fully covered.

Artifacts & recovery ​

Open group

SymbolKindPurpose
ArtifactReferenceinterfaceReferences locate artifacts; only the App resolver establishes access and current validity.
ArtifactResolverinterfaceApp-registered resolver that turns a reference into an App value.
Artifactsconstant
defineArtifactCatalogfunctionCompile a catalog of artifact resolvers plus a checked resolve entry point.
defineDurableTaskfunctionCompile a durable task definition into a resumable runner. Each run call locks the task id in the store, loads the checkpoint and resumes at nextStepIndex. A checkpoint from another definition id or revision, or one that fails the predicates below, is rejected instead of being repaired, because silently accepting it would replay App side effects under a different contract.
Durableconstant
DurableCheckpointinterfacePersisted task progress; the only state a resume reads back.
durableReplayPoliciesconstant
durableStatusesconstant
DurableStepinterfaceOne step of a durable task.
DurableStepContextinterfaceExecution facts handed to a durable step.
DurableStoreinterfaceApp implements an exclusive lock across every writer and validates/serializes stored state.
DurableTaskinterfaceCompiled task: resumes from the store and returns the final state.
DurableTaskDefinitioninterfaceTask definition, including the App hooks that guard every resume.
DurableTaskOptionsinterfaceRuntime options for a compiled durable task.

Models & interaction ​

Open group

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.

MockGPT · Mock models & debugging ​

Open group

SymbolKindPurpose
CallRecordinterfaceDetached snapshot of one accepted call, exposed through MockGPT.records.
createMockHandlerfunctionCreate a bare Node request listener backed by the mock.
createMockServerfunctionCreate a self-contained mock HTTP server with explicit listen/close control. No UI or static assets are served: only the model routes answer, everything else is a 404.
encodeModelResponsefunctionOptional app-owned codec; validation and encoding consume the same snapshots. Thin public wrapper over encodeModel: re-validates identity arguments and re-snapshots both the request and the model output, so callers that build replies themselves get identical validation and cannot mutate the mock's state afterwards.
GeneratedtypeWhat a rule may produce: plain data, or a descriptor that changes transport behaviour.
GenerationContextinterfaceEverything a rule or generator may read for one accepted call. The context is frozen; the only mutable side channel is report, and only while the call is still pending.
GenerationInputinterfaceInput of MockGPT.generate. Normalized exactly like an HTTP request body, so a rule matches identically through both entry points; only model and messages are required.
GenerationOptionsinterfacePer-call options of MockGPT.generate.
GeneratortypeA rule's output: either a fixed value (deep-copied and frozen when the instance is built) or a function evaluated per call. A function may be async and is awaited under cancellation.
generatorNamesconstant
generatorsconstant
HandlerOptionsinterfaceOptions shared by the standalone server and the bare request handler.
HttpFaultinterfaceA simulated HTTP-level failure returned instead of a model reply.
isPublicAddressfunctionDecide whether an address is an acceptable public destination.
JsonValuetypeAny value accepted by the package's JSON snapshot rules: strings, finite numbers, booleans, null, arrays and plain objects.
LoadedPageinterfaceA fetched page body plus the metadata needed for decoding and diagnostics.
MessagetypeOne entry of an OpenAI chat conversation. The runtime validates role against the OpenAI role set and validates the outer shape of content; every other field is retained verbatim so vendor extensions flow through.
MockGPTclassConfigurable mock model instance. Create one per test or per mock server.
MockGPTErrorclassError type carrying a stable machine-readable code plus optional HTTP status and details. The HTTP adapter maps status onto the response and serializes code/details into the OpenAI-style error body, so codes are part of the public contract.
MockGPTOptionsinterfaceConstruction options of a MockGPT instance.
ModelOutputinterfaceThe model-authored part of a reply, before it becomes JSON or SSE frames.
ModelRequestinterfaceA normalized /chat/completions request, produced by snapshotRequest. Optional undefined fields have already been dropped and stream is already defaulted, so rules always observe the same shape regardless of whether the caller used generate or the injected fetch.
OutputOptionsinterfaceTransport-level knobs of a generated response. All values are simulated: they affect framing and timing of the mock reply, not real model behaviour.
ResponseDescriptionclassWrapper that distinguishes a transport instruction from ordinary generator data. kind: 'model' carries a ModelOutput, 'http' an HttpFault response, and 'reject' a message used to simulate a network failure. Instances are recognized by brand rather than by instanceof alone, so descriptors survive crossing the ESM/CJS boundary.
responsesconstant
routesconstant
RuleinterfaceOne ordered matching rule of a MockGPT instance.
ServerOptionsinterfaceOptions of createMockServer, adding shutdown behaviour.
sourcesconstant
TextOptionsinterfaceCommon options of the text generators.
TextSourcetypeText supplied to a text generator. A function may be async; it receives the per-call context so a source can depend on the prompt or on the call index.
ToolCallinterfaceA tool call the mocked assistant emits instead of executing.
UsageinterfaceToken accounting reported by the OpenAI API; validated for internal consistency.
WebOptionsinterfaceConfiguration of sources.web.
WebProfiletypeName of an entry in webHeaderProfiles.

Intents & scopes ​

Open group

SymbolKindPurpose
createScopeRegistryfunctionCreate and seal a complete catalog; use the constructor for incremental installation.
RegisteredScopetypeFrozen registration view: every list is a frozen copy, evidence entries are projected.
RegisteredScopeEvidencetypeRegistered evidence entry: public data only, frozen by the registry.
ScopeDefinitioninterfaceOne declarable scope. Ids and aliases share one namespace and must be unique.
ScopeDescriptiontypePlain description with mutable arrays, for documentation and model-facing catalogs.
ScopeRegistryclassGeneric scope relationships; categories, intent policy and extra fields belong to the host. A scope is addressable by its id or by any of its aliases; aliases resolve to the declaring scope, and a name may be claimed only once across both namespaces.
ScopeRegistryPolicyinterfaceRegistration rules for one scope registry.

Retrieval & evidence ​

Open group

SymbolKindPurpose
defineEvidenceChecklistfunctionCompile a reusable completion checklist over actual observations. A requirement is satisfied when at least one observation satisfies the provider registered for its kind; isComplete requires every requirement to be satisfied, and missing returns those that are not. Hosts define evidence semantics.
defineEvidenceProjectionfunctionCompile a projection that keeps only the sources a caller asked to see. No selection retains the complete evidence; a selection narrows registered source-bearing results. Observations whose tool has no provider pass through untouched, so the projection can only ever remove sources it knows how to name.
defineRetrievalfunctionCompile a retrieval runner from its declared ports and effects. Rejected queries stay in the caller's seen set, so a retry is reported as a duplicate instead of silently repeating the adapter call; only successful results increment the query count.
Evidenceconstant
EvidenceProjectionDefinitioninterfaceProjection configuration, keyed by the tool that produced an observation.
EvidenceProjectionProviderinterfaceDescribes which sources an observation can cite, and how to narrow it to cited ones.
EvidenceProviderinterfaceAdjudicates one evidence kind against real observations.
EvidenceRequirementinterfaceRequirements describe evidence that must already exist, never a model's assertion of success.
FusedRankinterfaceOne fused result with the per-source ranks that produced its score.
RankedListinterfaceOne retriever's ordered result, optionally weighted.
reciprocalRankFusionfunctionFuse ranked lists with one-based reciprocal rank fusion. Raw retriever scores are intentionally not mixed. Ties break on id, so the output is deterministic for a given input.
Retrievalconstant
RetrievalDefinitiontypeRetrieval ports specialized to an App operation context.
RetrievalEffectinterfaceOne effect applied after a successful query, in declaration order.
RetrievalPortsinterfaceHost ports and policy for one retrieval kind.
RetrievalReasontypeLazy rejection wording: a fixed message, a pre-built error, or a factory bound to the query.
RetrievalReceiptinterfaceFacts of one accepted query.
RetrievalResultinterfaceAdapter output for one accepted query; the Kit renames each source before returning it.
RetrievalRunnerinterfaceCompiled retrieval runner.
RetrievalSourceinterfaceRequest-local citation reference; the App may separately carry its content entity id.
RetrievalStateinterfaceRequest-owned state. Clearing current evidence must not replenish spent budgets or seen keys.
TextSearchclassOptional App-side full-text index. No storage, identity, model calls or Core dependencies. Only declared fields are indexed and only storedFields come back with a hit, so a document never leaks extra properties into search results.
TextSearchHitinterfaceOne ranked match; terms are post-tokenization and only stored fields are returned.
TextSearchOptionsinterfaceApp supplies fields, tokenizer and its own schema/tokenizer revision.
TextSearchQueryinterfaceSearch input: a hard result limit and an App-owned filter, both required on every query.
TextSearchSnapshotinterfaceSerialized index; the revision pair proves the snapshot matches the current configuration.
VectorSearchclassExact cosine search for a bounded embedded corpus. Identity and metadata are App-owned. Vectors arrive as plain arrays and are stored normalized in Float32Array form, so query time only needs a dot product per candidate.
VectorSearchHitinterfaceOne search hit; the document is a cloned snapshot, not the indexed instance.
VectorSearchQueryinterfaceSearch options excluding the query vector, which search takes alongside them.
VectorSearchSpaceinterfaceEmbedding space identity and width; vectors from another space must never be mixed in.

Log review & evidence reports ​

Open group

SymbolKindPurpose
defineReflectionfunctionCompile a reflection task. Model-driven investigation through ordinary registered tools and the existing Core loop. The task always reports persisted: false: storing a report is the App's decision. Observed findings must cite evidence ids that were actually returned in this run, which is what keeps the report tied to real observations instead of model recall.
defineReflectionLogSourcefunctionBuild a reflection source over a log reader. Coverage is reported as best-effort: a page is only complete when the reader exhausted the run without capture gaps or omitted issues, and every gap or issue code is surfaced instead of being silently dropped.
Reflectionconstant
ReflectionDefinitioninterfaceConfiguration for compiling a reflection task.
ReflectionEvidenceinterfaceExplicit metadata projection, not an arbitrary original event/payload.
ReflectionFindinginterfaceOne finding, always tied to the evidence it rests on.
reflectionFindingKindsconstant
reflectionIdentityFieldsconstant
ReflectionLogReaderinterfaceStructural port: the App supplies its own FileLogReader, trusted scope and current authorization.
ReflectionPageinterfaceOne page of evidence plus an honest statement of its coverage.
ReflectionQueryinterfaceOne evidence query.
ReflectionReportinterfaceRequest-local reflection result.
ReflectionSourceinterfaceApp-owned evidence source, including its own authorization.
ReflectionTaskinterfaceCompiled reflection task.

Tools & capabilities ​

Open group

SymbolKindPurpose
LifecycleHooksinterfaceEverything one tool declares for a request. Declaring id turns the tool into an invocation owner, so protocol and call become required in practice; the registry rejects a partial declaration. Every other hook is optional and returning nothing expresses "no opinion".
LifecycleProtocolinterfaceOutput protocol carried by a tool lifecycle.
PolicyinterfaceRegistration policy shared by every tool in the registry.
RegisteredToolDefinitiontypeRegistered snapshot with frozen goal ids and projected hooks.
ToolinterfaceA registered tool: model metadata plus one optional lifecycle block.
ToolFinalizertypeConverts an executed decision into the tool result; must be synchronous.
ToolLifecycleRegistryclassRegistry of tools whose lifecycle, protocols and context contributions the App declares. Registration is only possible before seal(); afterwards the catalog is read-only, so a run cannot change which tools exist. Every hook is optional and is applied in registration order, which is why registerAll preserves iteration order.
ToolModelFieldinterfaceOne model-context field contributed by a tool.
ToolNormalizertypeConverts untrusted input into a decision; must be synchronous.
ToolProtocoltypeProtocol type of a tool's lifecycle invocation.
ToolRegistrationtypeDeclaration form; the registry derives the ModelTool projection from existing handlers.
ToolRuntimeTypesinterfaceOne schema binds lifecycle handler types without introducing platform fields into core.
ToolsOptionsinterfaceConstruction options for a tool registry.

API reference, usage examples and developer guides.