Jidoka.Export (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Portable JSON/YAML export for Jidoka.Agent.Spec.

Export intentionally writes data, not executable Elixir values. Runtime-only values such as raw Zoi schemas must be represented by caller-owned registry refs when they need to round-trip through Jidoka.import/2.

Summary

Functions

Builds the import-compatible document map without encoding it.

Exports an agent, spec, or plan into a portable JSON/YAML document string.

Types

format()

@type format() :: :json | :yaml

option()

@type option() ::
  {:format, format()}
  | {:context_schema_ref, String.t() | atom()}
  | {:result_schema_ref, String.t() | atom()}
  | {:pretty, boolean()}

Functions

document(agent_input, opts \\ [])

@spec document(
  module() | Jidoka.Agent.Spec.t() | Jidoka.Turn.Plan.t() | keyword() | map(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Builds the import-compatible document map without encoding it.

export(agent_input, opts \\ [])

@spec export(
  module() | Jidoka.Agent.Spec.t() | Jidoka.Turn.Plan.t() | keyword() | map(),
  [option()]
) ::
  {:ok, String.t()} | {:error, term()}

Exports an agent, spec, or plan into a portable JSON/YAML document string.