Skip to main content

Module introspect

Module introspect 

Source
Expand description

Machine-readable introspection for Foundry CLIs.

This module implements the --introspect flag described in docs/agents/spec.md. It walks a clap::Command tree, merges in metadata from a per-binary CommandRegistry, and emits an IntrospectDocument suitable for agent consumption.

Modules§

build 🔒
Build an IntrospectDocument from a clap::Command tree.
document 🔒
Serializable types describing a Foundry binary’s command surface.
registry 🔒
Per-binary registry of stable command metadata.

Structs§

ArgInfo
Information about a single command argument.
BinaryInfo
Information about the binary itself.
Capabilities
Capability flags exposed for agent consumers.
CommandInfo
Information about a single command (or group) in the CLI tree.
CommandMeta
Per-leaf metadata that overlays the clap-derived defaults.
CommandRegistry
A binary’s command registry.
ExitCodeInfo
Documented exit code for a command, beyond the global table.
IntrospectDocument
Top-level introspection document.

Enums§

ArgKind
Argument shape.
OutputMode
Output mode under machine mode.
SideEffects
Coarse classification of a command’s side effects.
ValueType
Best-effort classification of an argument’s value type, for agent UI hints.

Constants§

INTROSPECT_SCHEMA_ID
Stable schema id for the introspect document.
INTROSPECT_SCHEMA_VERSION
Schema version for the introspect document.

Functions§

build_document
Build an IntrospectDocument for command overlaid with metadata from registry.
collect_command_ids
Collect every command_id (recursively) emitted by an IntrospectDocument.
duplicate_command_ids
Assert that every command_id in doc is unique.
render_introspect_document
Serialize an IntrospectDocument as compact JSON.