Expand description
Recursive in-memory mirror of the golem:core@2.0.0 schema model.
Modules§
- canonical
- Canonical text and JSON encodings for the rich scalar and capability
payloads of
super::SchemaValue. - conversion
- Runtime trait surface for converting Rust values to and from the recursive schema model.
- derive
- Private re-exports used by code emitted by the
IntoSchema/FromSchemaderive macros in thegolem-schema-derivecrate. - fingerprint
- graph
- host_
managed - Closed classification of host-managed capability nodes and the shared redaction helpers that observability surfaces consult.
- metadata
- multimodal
- Detectors for the canonical multimodal schema shape
list<variant<… Role::Multimodal>>. - render
- Guest-safe canonical schema and value rendering.
- schema_
type - schema_
value - stream
- Affine native streams carried recursively by
super::SchemaValue. - tool
- Native, serializable data model for
golem:tool/common@0.1.0tool metadata. - unstructured
- Canonical “unstructured” text/binary carriers.
- validation
- Validation utilities for the in-memory schema model.
- wit
- Round-trip conversion between the recursive in-memory schema model in
superand the flat, index-based wire types from thegolem:core@2.0.0WIT package.
Structs§
- Binary
Restrictions - Binary
Value Payload - Duration
Value Payload - Signed duration as total nanoseconds.
- Field
Discriminator - Host
Managed Occurrence - The first host-managed capability reached while traversing a schema type or value tree.
- Metadata
Envelope - Typed metadata envelope. Holds non-validation, non-rendering-critical information (docs, aliases, examples, deprecation, role). Per-scalar validation constraints live on the relevant scalar’s typed substructure, not here.
- Named
Field Type - Path
Spec - Permission
Card Spec - Spec for a
SchemaType::PermissionCardcapability node. - Permission
Card Value Payload - Capability value: the trusted internal/persistent representation of a
permission-card, held only inside
SchemaValue::PermissionCard. Across a WIT boundary the card travels as an opaque, unforgeable owned handle (permission-card-handle(own<permission-card>)); the host converts between this snapshot and a handle through a resolver and the receiver re-acquires the live card againstcard_idon demand. This snapshot is never exposed to or constructible by a guest. - Quantity
- A fixed-point decimal value with a unit, constrained by the
QuantityUnitmarkerU. Encodes to the richSchemaValue::Quantity. - Quantity
Spec - Quantity
Value - Fixed-point decimal value with unit: numeric value =
mantissa * 10^(-scale).unitis a free-form string at the value level; the schema’sQuantitySpecconstrains the accepted set. - Quota
Token Spec - Quota
Token Value Payload - Capability value: the trusted internal/persistent representation of a
quota-token, held only inside
SchemaValue::QuotaToken. Across a WIT boundary the token travels as an opaque, unforgeable owned handle (quota-token-handle(own<quota-token>)); the host converts between this snapshot and a handle through a resolver and the receiver re-acquires a live lease against(environment_id, resource_name)on demand. This snapshot is never exposed to or constructible by a guest. - Redacted
Schema Value - Wraps a
SchemaValueso itsDebugoutput redacts every host-managed capability node (seeHostManagedKind). - Result
Spec - Schema
Builder - Mutable working set used while a graph is being built up.
- Schema
Fingerprint V1 - BLAKE3-256 digest of the v1 deterministic-CBOR encoding of a stream element schema closure.
- Schema
Graph - A self-contained schema graph in the recursive in-memory form.
- Schema
Type Def - A named type definition inside a
SchemaGraph. - Schema
Value Stream - Guest-side stream leaf. A leaf can hold the recursive WIT resource or the native reader obtained from it. Clones share one take-once state.
- Secret
Spec - Secret
Value Payload - Capability value: the trusted host snapshot of a secret handle.
- Text
Restrictions - Text
Value Payload - TypeId
- Stable, language-independent identifier for a named type definition. Must
be unique within the enclosing
super::SchemaGraph. Conventional format is a dot-separated namespace path (e.g.,"myapp.users.user"). Each SDK provides a default derivation rule (typically based on the local language’s type name); cross-language interop requires the sameTypeIdon every side, which users can pin via the SDK’snamedattribute. - Typed
Schema Value - A typed value: a self-contained
SchemaGraphpaired with a value tree built against that schema. - Union
Branch - Union
Spec - An inferred-tag sum governed by the canonical portable pair-classification contract.
- Union
Value Payload - UrlRestrictions
- Variant
Case Type - Variant
Value Payload
Enums§
- Discriminator
Rule - How the decoder identifies that a value belongs to a given union branch.
- From
Schema Error - Errors produced by
FromSchema::from_value. - Host
Managed Kind - A closed set of “host-managed” capability kinds.
- Host
Managed Traversal Error - Merge
Error - Errors produced by
merge_agent_graphs. - Path
Direction - Path
Kind - Result
Value Payload - Result payload: exactly one of
Ok/Erris set. Each inner option allowsresult<_, _>cases whose ok/err type is unit (no payload). - Role
- Open registry of consumer-facing roles a type may carry. Unknown roles are
preserved as
Role::Otherso the producer’s intent is not lost when a receiver does not understand the role. - Schema
Fingerprint Error - Schema
Type - One schema type in the recursive in-memory representation.
- Schema
Value - One node in the recursive in-memory schema-value tree.
Traits§
- From
Schema - Decode a
SchemaValueback into a Rust value. - Into
Schema - Convert a Rust type into a self-contained schema graph and a
SchemaValuetree. - Into
Typed Schema Value - Ergonomic
value.into_typed_schema_value()?form oftry_into_typed_schema_value, mirroring the legacyIntoValueAndType::into_value_and_typemethod shape. - Quantity
Unit - Marker trait describing the unit constraints of a
Quantity.
Functions§
- find_
host_ managed_ type - Finds the first host-managed capability type reachable from
tythroughgraph. Only definitions reachable fromtyare considered. Recursive references are followed once per active path, so recursive schemas terminate without suppressing occurrences reached through sibling paths. - find_
host_ managed_ value - Finds the first host-managed capability in
value, including nested occurrences in every structural container. - merge_
agent_ graphs - Merge the named definitions from any number of per-root
SchemaGraphs into a single agent-level graph. - redacted_
schema_ value_ debug - Wraps
valuefor redactedDebugrendering. SeeRedactedSchemaValue. - resolve_
stream_ element_ schema_ v1 - Resolves a stream element fingerprint against a pinned multi-root schema registry.
- schema_
fingerprint_ v1 - Computes the v1 stream element schema fingerprint.
- try_
into_ schema_ graph - Build a self-contained graph for
Tand run well-formedness validation on the result. Returns the first reportedSchemaErrorif the graph is malformed. - try_
into_ typed_ schema_ value - Build a
TypedSchemaValue— a self-containedSchemaGraphpaired with the encodedSchemaValuetree — from a value whose type implementsIntoSchema.
Type Aliases§
- Decode
Error - Backwards-compatible alias kept for codegen and consumers.
Derive Macros§
- From
Schema - From
Wire - Decodes canonical wire nodes directly into a concrete guest type.
- Into
Schema - Into
Wire - Converts a guest value directly to canonical wire nodes, including affine resource preflight. Does not construct or validate a schema model.
- Schema
- Derives
IntoSchema,FromSchema,IntoWire,FromWire, andWireSchema. Requires the schema crate’sguestfeature for the direct wire traits. - Wire
Schema - Appends a concrete type definition directly to the flat WIT schema arena.