Expand description
Binding Module - Data binding between tasks.
Handles with: block data binding:
entry: YAML types (BindingSpec/BindingEntry + WithSpec/WithEntry)resolve: Runtime resolution (ResolvedBindings) with lazy supporttemplate: Template substitution ({{with.alias}})jsonpath: RFC 9535 JSONPath via serde_json_pathtypes: Core types (BindingPath, BindingSource, PathSegment, BindingType)transform: 27 built-in transforms with pipe chains
Unified with: syntax (eager resolution):
with:
forecast: weather.summary # Simple path
temp: weather.data.temp ?? 20 # With numeric default
name: user.name ?? "Anonymous" # With string default (quoted)
cfg: settings ?? {"debug": false} # With object defaultExtended syntax for lazy bindings:
with:
lazy_val:
path: future.result
lazy: true # Deferred resolution
lazy_with_default:
path: optional.value
lazy: true
default: "fallback"Data flow:
YAML `with:` block → BindingSpec (entry)
↓
┌───────┴───────┐
▼ ▼
Eager (lazy=false) Lazy (lazy=true)
resolve now store Pending
│ │
▼ ▼
ResolvedBindings (Resolved | Pending)
↓
Template substitution
(resolves Pending on access)
↓
Resolved promptRe-exports§
pub use mention::has_parallel_marker;pub use mention::mentions_to_bindings;pub use mention::parse_mentions;pub use mention::resolve_mention;pub use mention::strip_parallel_marker;pub use mention::text_to_bindings;pub use mention::Mention;pub use mention::MentionResolutionError;pub use mention::ResolvedMention;
Modules§
- jsonpath
- JSONPath evaluation — RFC 9535 via
serde_json_path - mention
- Mention Module - @reference parsing for Chat-as-DAG
- transform
- Transform Engine
- types
- Core Binding Types
Structs§
- Binding
Entry - Unified with entry - supports both string and extended object syntax
- Binding
Path - Source path for a binding – parsed from “$task_id.field.path”
- Binding
Path Error - Error type for binding path parsing (NIKA-150)
- Resolved
Bindings - Resolved bindings from with: block (alias -> value or pending)
- Transform
Expr - A chain of transform operations:
sort | unique | first(3) - Transform
Parse Error - Error parsing a transform expression (NIKA-151)
- With
Entry - A single binding entry in the
with:block - With
Entry Parse Error - Error parsing a WithEntry string (NIKA-155)
Enums§
- Binding
Source - Where data originates
- Binding
Type - Type constraint on a binding value (optional, defaults to Any)
- Lazy
Binding - Lazy binding state - either resolved or pending
- Path
Segment - Single segment in a property path
- Template
Expr - Parsed template expression from inside
{{ ... }} - Transform
Error - Error applying a transform (NIKA-152 type mismatch, NIKA-153 null input)
- Transform
Op - A single transform operation
Functions§
- escape_
for_ shell - Escape a string for safe shell usage
- extract_
refs - Extract all alias references from a template (for static validation)
- extract_
with_ refs - Extract all alias references from a template
- parse_
binding_ entry - Parse a binding entry string into BindingEntry (eager resolution)
- parse_
template_ expr - Parse the content inside
{{ ... }}into a TemplateExpr. - parse_
with_ entry - Parse a with-entry from its string form
- template_
resolve - Resolve all {{with.alias}}, {{context.}}, and {{inputs.}} templates
- template_
resolve_ for_ shell - Resolve templates for shell context
- template_
resolve_ with - Resolve all template references in a string
- validate_
refs - Validate that all template references exist in declared aliases (static validation)
- validate_
task_ id - Validate a task ID without regex overhead
- validate_
with_ refs - Validate that all template alias references exist in declared aliases
Type Aliases§
- Binding
Spec - Binding spec - map of alias to entry (YAML
with:block) - With
Spec - Map of alias -> WithEntry (YAML
with:block)