adk_context_capability (erlang_adk v0.7.0)

View Source

Owner-bound, scope-bound authority used by invocation contexts.

The service handles remain in this process. Tools receive only a random token granting a validated subset of operations. Effects are correlated by call ID and may be drained only by the invocation owner for event commit.

Summary

Types

capability/0

-type capability() :: {pid(), reference()}.

Functions

abort_effects(_, Receipt)

-spec abort_effects(capability(), reference()) -> ok | {error, term()}.

call(_, Operation, Request, Timeout)

-spec call(capability(), atom(), term(), pos_integer()) -> term().

code_change(OldVersion, State, Extra)

commit_effects(_, Receipt)

-spec commit_effects(capability(), reference()) -> ok | {error, term()}.

delegate(_, Ops, CallId, Timeout)

-spec delegate(capability(), [atom()], term(), pos_integer()) -> {ok, capability()} | {error, term()}.

handle_call(Request, From, State)

handle_cast(Message, State)

handle_info(Message, State)

init(_)

prepare_effects(_, CallId)

-spec prepare_effects(capability(), term()) -> {ok, none | reference(), [map()]} | {error, term()}.

resolve_attachment(_, Name, Version, Timeout)

-spec resolve_attachment(capability(), binary(), pos_integer(), pos_integer()) ->
                            {ok, map()} | {error, term()}.

root(Pid)

-spec root(pid()) -> {ok, capability()} | {error, term()}.

start(Owner, Spec)

-spec start(pid(), map()) -> gen_server:start_ret().

start_link(Owner, Spec)

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

stop(Pid)

-spec stop(pid()) -> ok.

take_effects(_, CallId)

-spec take_effects(capability(), term()) -> {ok, [map()]} | {error, term()}.

terminate(Reason, State)