ClaudeAgentSDK.SessionStore.InMemory (claude_agent_sdk v0.18.0)

Copy Markdown View Source

In-memory SessionStore reference adapter.

This adapter is intended for tests, local development, and examples. It keeps opaque transcript entries in append order and maintains summary sidecars via ClaudeAgentSDK.SessionStore.Summary.fold_session_summary/3.

Summary

Types

t()

@type t() :: %ClaudeAgentSDK.SessionStore.InMemory{server: pid()}

Functions

append(in_memory, key, entries)

@spec append(t(), ClaudeAgentSDK.SessionStore.Key.input(), [map()]) :: :ok

delete(in_memory, key)

@spec delete(t(), ClaudeAgentSDK.SessionStore.Key.input()) :: :ok

list_session_summaries(in_memory, project_key)

@spec list_session_summaries(t(), String.t()) :: [map()]

list_sessions(in_memory, project_key)

@spec list_sessions(t(), String.t()) :: [%{session_id: String.t(), mtime: integer()}]

list_subkeys(in_memory, key)

@spec list_subkeys(t(), ClaudeAgentSDK.SessionStore.Key.input()) :: [String.t()]

load(in_memory, key)

@spec load(t(), ClaudeAgentSDK.SessionStore.Key.input()) :: [map()] | nil

new()

@spec new() :: {:ok, t()} | {:error, term()}

Starts a new in-memory store and returns the adapter struct.

new!()

@spec new!() :: t()

Starts a new in-memory store and raises on failure.