Expand description
Round-trip conversion between the recursive in-memory tool metadata model in
super and the flat, index-based golem:tool/common@0.1.0 wire bindings
re-exported here as wire.
Mirrors crate::schema::wit: a tool’s defs plus every type
embedded in its command tree are folded into one shared
wire::SchemaGraph via
GraphEncoder / GraphDecoder. Embedded SchemaTypes become
type-node-index values into that graph, and embedded SchemaValue
defaults / value-is literals become bare
wire::SchemaValueTrees via
encode_value / [decode_value].
Top-level fallible conversions are expressed as TryFrom impls, while
conversions that need neither the shared graph nor fallible value decoding
use From (see the “infallible, context-free conversions” section).
Internal conversions that thread a shared GraphEncoder or
GraphDecoder remain functions.
Modules§
- wire
- Generated
golem:tool/common@0.1.0types used as the wire shape.
Enums§
- Tool
WitError - Error raised when converting between the native tool model and its wire form.
Functions§
- decode_
tool - Decode a flat WIT tool representation into the recursive native model.
- encode_
tool - Encode a
Toolinto its flat WIT representation. - tool_
middleware_ from_ wit - Decode tool middleware metadata from its WIT representation.
- tool_
middleware_ to_ wit - Encode tool middleware metadata into its WIT representation.