adk_planning_runtime (erlang_adk v0.7.0)

View Source

Bounded, cancellable runtime for explicit plans and replanning.

Each planner and executor callback runs in a monitored lightweight process with an absolute deadline, per-callback timeout, and heap limit. Plans and callback values cross JSON-safe, secret-pruned boundaries. A plan action is opaque data: this module never evaluates source code or resolves a module named by model output.

Summary

Functions

Run synchronously. Terminal planner, executor, budget, deadline, and cancellation outcomes are returned as a checked result map, not exceptions.

Start an owner-bound planning process. await/3 is owner-facing; cancellation may be sent while a planner or executor worker is blocked.

Types

result/0

-type result() :: map().

run_ref/0

-type run_ref() :: reference().

Functions

await(Pid, Ref, Timeout)

-spec await(pid(), run_ref(), timeout()) -> {ok, result()} | {error, term()}.

cancel(Pid, Ref, Reason)

-spec cancel(pid(), run_ref(), term()) -> ok | {error, term()}.

decode_result(Result)

-spec decode_result(map()) -> {ok, result()} | {error, term()}.

encode_result(Result)

-spec encode_result(result()) -> {ok, result()} | {error, term()}.

result_schema_version()

-spec result_schema_version() -> pos_integer().

run(Planner, Executor, Goal, Context, Opts)

-spec run(map(), map(), term(), map(), map()) -> {ok, result()} | {error, term()}.

Run synchronously. Terminal planner, executor, budget, deadline, and cancellation outcomes are returned as a checked result map, not exceptions.

start(Planner0, Executor0, Goal0, Context0, Opts0)

-spec start(map(), map(), term(), map(), map()) -> {ok, pid(), run_ref()} | {error, term()}.

Start an owner-bound planning process. await/3 is owner-facing; cancellation may be sent while a planner or executor worker is blocked.