JSON/YAML import runtime for data-authored Jidoka agents.
Imports compile into the same Jidoka.Agent.Spec contract as the Spark DSL.
JSON/YAML cannot safely encode executable Elixir values, so action modules and
context schemas are resolved through caller-provided registries.
Summary
Functions
Imports a JSON or YAML agent document string.
Imports a JSON or YAML agent document string and raises on failure.
Compiles decoded import data into Jidoka.Agent.Spec.
Compiles decoded import data and raises on failure.
Types
@type format() :: :json | :yaml
@type option() :: {:format, format()} | {:registries, registry()} | {:actions, registry()} | {:action_registry, registry()} | {:ash_resources, registry()} | {:ash_resource_registry, registry()} | {:controls, registry()} | {:control_registry, registry()} | {:context_schemas, registry()} | {:context_schema_registry, registry()} | {:result_schemas, registry()} | {:result_schema_registry, registry()}
Functions
@spec import(String.t(), [option()]) :: {:ok, Jidoka.Agent.Spec.t()} | {:error, term()}
Imports a JSON or YAML agent document string.
Pass format: :json or format: :yaml to force a parser. Without a format,
strings beginning with { or [ are treated as JSON; all others are treated
as YAML.
@spec import!(String.t(), [option()]) :: Jidoka.Agent.Spec.t()
Imports a JSON or YAML agent document string and raises on failure.
@spec load(map(), [option()]) :: {:ok, Jidoka.Agent.Spec.t()} | {:error, term()}
Compiles decoded import data into Jidoka.Agent.Spec.
@spec load!(map(), [option()]) :: Jidoka.Agent.Spec.t()
Compiles decoded import data and raises on failure.