adk_a2a_v1_server (erlang_adk v0.10.0)

View Source

Bounded, supervised A2A 1.0 task store and execution coordinator.

Protocol tasks are durable for a configured retention window while their work runs as independent adk_task children. The store retains only a hash of the authenticated principal id. Raw headers, credentials, and principal terms are captured only by the short-lived execution closure and are redacted before any result enters task history, artifacts, or events.

Summary

Functions

cancel_task(Server, Scope, Params)

-spec cancel_task(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

card(Server)

-spec card(gen_server:server_ref()) -> {ok, map()}.

card_representation(Server)

-spec card_representation(gen_server:server_ref()) -> {ok, map(), non_neg_integer()}.

Return the public card together with the time this server instance installed the immutable representation. HTTP bindings use the timestamp for a stable Last-Modified validator while the card body supplies the ETag.

child_spec(Options)

-spec child_spec(map()) -> supervisor:child_spec().

code_change(OldVersion, State, Extra)

create_push_config(Server, Scope, Params)

-spec create_push_config(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

delete_push_config(Server, Scope, Params)

-spec delete_push_config(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

extended_card(Server, Scope)

-spec extended_card(gen_server:server_ref(), binary()) -> {ok, map()} | {error, term()}.

get_push_config(Server, Scope, Params)

-spec get_push_config(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

get_task(Server, Scope, Params)

-spec get_task(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

handle_call(Request, From, State)

handle_cast(Message, State)

handle_info(Info, State0)

init(Options)

inspect_task(Server, TaskId)

-spec inspect_task(gen_server:server_ref(), binary()) -> {ok, map()} | {error, not_found}.

Test/diagnostic view. It intentionally exposes only the public Task.

list_push_configs(Server, Scope, Params)

-spec list_push_configs(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

list_tasks(Server, Scope, Params)

-spec list_tasks(gen_server:server_ref(), binary(), map()) -> {ok, map()} | {error, term()}.

progress(Server, TaskId, Scope, Event)

-spec progress(gen_server:server_ref(), binary(), binary(), term()) -> ok | {error, term()}.

send_message(Server, AuthContext, Params)

-spec send_message(gen_server:server_ref(), map(), map()) -> {ok, map()} | {error, term()}.

send_message(Server, AuthContext, Params, Subscriber)

-spec send_message(gen_server:server_ref(), map(), map(), undefined | pid()) ->
                      {ok, map()} | {error, term()}.

send_result(Server, Scope, TaskId, HistoryLength)

-spec send_result(gen_server:server_ref(), binary(), binary(), undefined | non_neg_integer()) ->
                     {ok, {task, map()} | {message, map()}} | {error, term()}.

Resolve the response oneof for a blocking SendMessage call. A direct Message returned by the executor is intentionally transient; durable task snapshots continue to contain only the protocol Task representation.

start_link()

-spec start_link() -> gen_server:start_ret().

start_link(Options)

-spec start_link(map()) -> gen_server:start_ret().

subscribe(Server, Scope, Params, Subscriber)

-spec subscribe(gen_server:server_ref(), binary(), map(), pid()) ->
                   {ok, binary(), [{non_neg_integer(), map()}]} | {error, term()}.

terminate(Reason, State)

unsubscribe(Server, TaskId, Subscriber)

-spec unsubscribe(gen_server:server_ref(), binary(), pid()) -> ok.