ASM.SessionControl (ASM v0.9.2)

Copy Markdown View Source

Provider-native session control helpers for historical resume and interrupt-then-intervene flows.

Summary

Types

provider_or_session()

@type provider_or_session() :: ASM.Provider.provider_name() | pid()

resume_target()

@type resume_target() :: :checkpoint | :latest | String.t()

Functions

checkpoint(session)

@spec checkpoint(pid()) :: {:ok, map() | nil} | {:error, ASM.Error.t()}

continuation_from_checkpoint(checkpoint, opts \\ [])

@spec continuation_from_checkpoint(
  map() | nil,
  keyword()
) :: {:ok, map()} | {:error, ASM.Error.t()}

intervene(session, run_id, prompt, opts \\ [])

@spec intervene(pid(), String.t(), String.t(), keyword()) ::
  {:ok, String.t(), pid() | :queued} | {:error, ASM.Error.t()}

list_provider_sessions(provider_or_session, opts \\ [])

@spec list_provider_sessions(
  provider_or_session(),
  keyword()
) :: {:ok, [ASM.SessionControl.Entry.t()]} | {:error, ASM.Error.t()}

pause(session, run_id)

@spec pause(pid(), String.t()) :: :ok | {:error, ASM.Error.t()}

resume_run(session, prompt, opts \\ [])

@spec resume_run(pid(), String.t(), keyword()) ::
  {:ok, String.t(), pid() | :queued} | {:error, ASM.Error.t()}