Persistence contract for the MCP Tasks extension.
A store must make create/3 durable before returning success and must apply
ownership checks to every operation. Implementations should make lifecycle
operations atomic across every node that can serve the same task ID.
ExMCP ships ExMCP.Tasks.Store.ETS as a bounded, node-local reference
implementation. Deployments that require task survival across server or
node restarts should configure a database-backed implementation.
Summary
Types
@type store_error() :: :already_exists | :invalid_task | :invalid_input_responses | :invalid_transition | :not_found_or_unauthorized | :store_full | :ttl_out_of_range | term()
Callbacks
@callback cancellation_requested?(String.t(), owner(), keyword()) :: {:ok, boolean()} | {:error, store_error()}
@callback create(ExMCP.Tasks.Task.t(), owner(), keyword()) :: {:ok, ExMCP.Tasks.Task.t()} | {:error, store_error()}
@callback fetch(String.t(), owner(), keyword()) :: {:ok, ExMCP.Tasks.Task.t()} | {:error, store_error()}
@callback request_cancel(String.t(), owner(), keyword()) :: :ok | {:error, store_error()}
@callback submit_input(String.t(), map(), owner(), keyword()) :: :ok | {:error, store_error()}
@callback take_input_responses(String.t(), owner(), keyword()) :: {:ok, map()} | {:error, store_error()}
@callback transition(String.t(), transition(), owner(), keyword()) :: {:ok, ExMCP.Tasks.Task.t()} | {:error, store_error()}