Expand description
Native, serializable data model for golem:tool/common@0.1.0 tool metadata.
A tool is a callable unit described by a single metadata record. The model is CLI-native (commands, subcommands, options, flags, positionals).
Types and values are not modeled here: every input/output type and every
metadata-time value is expressed with the shared golem:core/types@2.0.0
schema model, exactly as the agent model does. A Tool owns a single
SchemaGraph — the named-type registry shared by all of its commands —
and each typed position embeds a recursive SchemaType; metadata-time
defaults and value-is literals embed a recursive SchemaValue. The
flattening into the WIT schema-graph / type-node-index /
schema-value-tree wire form happens in wit.
The only tool-specific recursion site is the command tree: a flattened
command hierarchy with the root at index 0 and children referenced by
CommandIndex.
Producer-side construction invariants are checked by validation. The
deterministic per-command input record shape shared by tool clients and
tool implementations is defined by canonical.
Modules§
- argv
- Shared command-line parsing and help for schema-described tools.
- canonical
- Canonical input model for tool commands.
- compatibility
- Pure compiler for the directional value projections at a monomorphic middleware edge. Applying these plans, including disposal and stream relay, is a runtime responsibility.
- constraints
- validation
- Producer-side construction invariants for the tool metadata model.
- wit
- Round-trip conversion between the recursive in-memory tool metadata model in
superand the flat, index-basedgolem:tool/common@0.1.0wire bindings re-exported here aswire.
Structs§
- Bool
Flag Shape - Command
Annotations - Behavioral hints surfaced to MCP and other LLM-facing surfaces, following the MCP convention.
- Command
Body - Command
Index - Index into
CommandTree::nodes. - Command
Node - A node in the command tree. May dispatch to subcommands, run its own body, or both. Globals declared here apply to this command’s own body and to every descendant subcommand body.
- Command
Tree - Flattened command hierarchy. Always non-empty; the root command is at index 0.
- Doc
- Error
Case - Example
- Flag
Spec - ForbidsC
- Formatter
- Globals
- ImpliesC
- Monomorphic
Tool Middleware Scope - Option
Spec - Positional
- Positionals
- Process
Exit Status - A completed command’s shell-visible status, distinct from a failure to execute the tool.
- RefGroup
- Repeatable
List Shape - Repeatable
MapShape - Result
Spec - Stream
Spec - Tail
Positional - Tool
- Top-level tool metadata record.
- Tool
Middleware - Metadata describing a tool middleware component.
- Value
IsRef
Enums§
- Constraint
- Duplicate
KeyPolicy - Resolution policy for a repeated key in a
OptionShape::RepeatableMap. - Error
Kind - Flag
Shape - Option
Shape - Quantifier
- Ref
- Repetition
- Tool
Middleware Scope