adk_plan (erlang_adk v0.7.0)

View Source

Versioned, provider-neutral, JSON-safe planning contract.

A plan is data only. Step actions are opaque JSON maps and are never evaluated as Erlang code. A trusted adk_plan_executor adapter decides how to interpret an action at execution time.

Summary

Types

plan/0

-type plan() :: map().

step/0

-type step() :: map().

Functions

decode(Plan)

-spec decode(map()) -> {ok, plan()} | {error, term()}.

encode(Plan)

-spec encode(plan()) -> {ok, plan()} | {error, term()}.

new(Id, Revision, Goal, Steps)

-spec new(binary(), non_neg_integer(), term(), [map()]) -> {ok, plan()} | {error, term()}.

new(Id, Revision, Goal, Steps, Metadata)

-spec new(binary(), non_neg_integer(), term(), [map()], map()) -> {ok, plan()} | {error, term()}.

schema_version()

-spec schema_version() -> pos_integer().

step(Id, Description, Action)

-spec step(binary(), binary(), map()) -> {ok, step()} | {error, term()}.

step(Id, Description, Action, Metadata)

-spec step(binary(), binary(), map(), map()) -> {ok, step()} | {error, term()}.

steps(_)

-spec steps(plan()) -> [step()].

validate(Plan)

-spec validate(map()) -> {ok, plan()} | {error, term()}.