Phantom.Session (phantom v0.1.0)

View Source

Represents the state of the MCP session. This is the state across the conversation and is the bridge between the various transports (HTTP, stdio) to persistence, even if stateless.

Summary

Types

t()

@type t() :: %Phantom.Session{
  assigns: map(),
  id: binary(),
  meta: map(),
  prompts: [Phantom.Prompt.t()],
  resource_templates: [Phantom.ResourceTemplate.t()],
  router: module(),
  tools: [Phantom.Tool.t()],
  transport_pid: pid() | nil
}

Functions

assign(session, map)

@spec assign(t(), map()) :: t()

assign(session, key, value)

@spec assign(t(), atom(), any()) :: t()

new(session_id, conn, opts \\ [])

@spec new(String.t() | nil, Plug.Conn.t(), Keyword.t() | map()) :: t()