latent.registry.flows¶
Flow registry with caching for CLI discovery and execution.
Provides auto-discovery of @flow-decorated functions from the project's flows/ directory, an in-memory registry with disk caching, and smart type resolution for CLI argument parsing.
Classes¶
FlowEntry¶
FlowEntry(name: str, module_path: str, function_name: str, description: str = '', tags: list[str] = list(), version: str | None = None, parameters: list[ParameterInfo] = list(), has_catalog: bool = False, has_parameters_yaml: bool = False, _flow_fn: Callable | None = None)
Metadata for a registered flow.
FlowRegistry¶
In-memory registry of discovered @flow-decorated functions.
ParameterInfo¶
ParameterInfo(name: str, type_annotation: str, default: Any | None = None, has_default: bool = False, is_optional: bool = False, description: str = '', raw_type: type | None = None)
Metadata for a single flow parameter.
Functions¶
discover_and_register_flows¶
Discover all flows from the user's flows/ directory.
Uses cached registry when possible. Set force_import=True for commands
that need the actual _flow_fn references (like latent run).
load_cached_registry¶
Load registry from cache if content hash matches.
parse_extra_args¶
Parse CLI --flags and resolve types based on FlowEntry metadata.
resolve_cli_value¶
Convert a CLI string value to the appropriate Python type.
save_registry_cache¶
Write registry to cache with content hash.