Public facade for the ASM session runtime.
Summary
Functions
Closes a governed managed session materialization by opaque session id.
Revokes a governed managed session by opaque session id.
Hands more input to a run that is still going, without ending its turn.
Types
@type session_ref() :: GenServer.server()
Functions
@spec approve(session_ref(), String.t(), :allow | :deny) :: :ok | {:error, ASM.Error.t()}
@spec checkpoint(session_ref()) :: {:ok, map() | nil} | {:error, ASM.Error.t()}
@spec cleanup_managed_session(String.t(), atom()) :: :ok | {:error, ASM.Error.t() | :not_found}
Closes a governed managed session materialization by opaque session id.
@spec cost(session_ref()) :: map()
@spec health(session_ref()) :: :healthy | :degraded | {:unhealthy, term()}
@spec interrupt(session_ref(), String.t()) :: :ok | {:error, ASM.Error.t()}
@spec intervene(session_ref(), String.t(), String.t(), keyword()) :: {:ok, String.t(), pid() | :queued} | {:error, ASM.Error.t()}
@spec list_provider_sessions( session_ref() | atom(), keyword() ) :: {:ok, [ASM.SessionControl.Entry.t()]} | {:error, ASM.Error.t()}
@spec pause(session_ref(), String.t()) :: :ok | {:error, ASM.Error.t()}
@spec query(session_ref() | atom(), String.t(), keyword()) :: {:ok, ASM.Result.t()} | {:error, ASM.Error.t()}
@spec resume_run(session_ref(), String.t(), keyword()) :: {:ok, String.t(), pid() | :queued} | {:error, ASM.Error.t()}
@spec revoke_managed_session(String.t(), map() | keyword()) :: :ok | {:error, ASM.Error.t() | :not_found}
Revokes a governed managed session by opaque session id.
@spec send_input(session_ref(), String.t(), iodata()) :: :ok | {:error, ASM.Error.t()}
Hands more input to a run that is still going, without ending its turn.
The resolved lane must explicitly declare :incremental_input. An open stdin
descriptor is not enough: a CLI may leave it open without reading it after
startup. Unsupported lanes fail closed; use intervene/4 to interrupt and
resume the same provider thread.
@spec session_id(session_ref()) :: String.t() | nil
@spec session_info(session_ref()) :: {:ok, session_info()} | {:error, ASM.Error.t()}
@spec start_link(keyword()) :: {:ok, session_ref()} | {:error, ASM.Error.t() | term()}
@spec start_session(keyword()) :: {:ok, session_ref()} | {:error, ASM.Error.t() | term()}
@spec stream(session_ref(), String.t(), keyword()) :: Enumerable.t()