API Reference AgentSessionManager v#0.8.0

Copy Markdown View Source

Modules

A comprehensive Elixir library for managing AI agent sessions, state persistence, conversation context, and multi-agent orchestration workflows.

Provider adapter for Amp (Sourcegraph) AI agent integration.

Provider adapter for Claude (Anthropic) AI models.

Provider adapter for Codex (Claude Code CLI) integration.

Combines a SessionStore and an ArtifactStore into a single unified interface.

Ecto-based implementation of the Maintenance port.

Ecto-based implementation of the QueryAPI port.

An Ecto-based implementation of the SessionStore port.

Provides migration functions for the EctoSessionStore adapter.

Ecto schemas for the EctoSessionStore adapter.

File-backed artifact store for local/dev usage.

In-memory implementation of the SessionStore behaviour.

An S3-backed implementation of the ArtifactStore port.

Default S3 client implementation using ExAws.

Provider adapter for shell command execution.

Ash-based implementation of the Maintenance port.

Ash-based implementation of the QueryAPI port.

Ash-based implementation of the SessionStore port.

Ash domain for AgentSessionManager persistence resources.

Audit log persistence for observability and compliance.

Enforces concurrency limits for sessions and runs.

Manages control operations (interrupt, cancel, pause, resume) for runs.

Centralized configuration with process-local overrides.

Represents a capability that can be assigned to an agent.

Negotiates capabilities between required/optional sets and available provider capabilities.

Represents the result of a capability negotiation.

Normalized error taxonomy for Agent Session Manager.

Represents an event in the agent session lifecycle.

Event normalization pipeline for transforming provider events into normalized events.

Manages incremental consumption of normalized event streams.

Represents an agent manifest that defines the agent's configuration and capabilities.

Represents a normalized event in the event stream.

Shared normalization for provider-specific errors.

A thread-safe registry for storing and retrieving provider manifests.

Represents a single execution run within a session.

Represents an AI agent session.

Provider-agnostic transcript reconstructed from persisted session events.

Builds provider-agnostic transcripts from events and store-backed histories.

Converts token usage counts into USD cost estimates using configurable per-model pricing tables.

Central registry of model identifiers, default models, and pricing data.

Normalized permission modes for agent session execution.

Tracks artifact metadata in the asm_artifacts table.

Normalizes and validates adapter events without persisting them.

Validates, enriches, and persists events from provider adapters.

Scans event data for secret patterns and replaces matches with redacted placeholders before persistence.

Validates event structure and data shapes.

In-memory execution state used while a run is in progress.

Configurable rules for session and event lifecycle management.

Compiles an effective policy into adapter-specific options.

Pure policy checks for event-driven runtime enforcement.

Declarative policy definition for runtime enforcement.

Preflight policy checks that run before execution begins.

Mutable per-run policy state for real-time enforcement decisions.

Port (interface) for storing large blobs (patches, snapshot manifests).

Port for database maintenance operations.

Port (interface) for AI provider adapters.

Read-only query interface for historical session data.

Port (interface) for session storage operations.

Convenience functions for PubSub integration with AgentSessionManager.

Topic naming conventions for ASM PubSub integration.

Renders agent session event streams through a pluggable renderer and sink pipeline.

Behaviour for rendering agent session events into human-readable output.

Compact single-line token renderer for agent session events.

A no-op renderer that passes events through without formatting.

CLI-grade interactive renderer for agent session events.

Verbose line-by-line renderer for agent session events.

Behaviour for output destinations that receive rendered text from a renderer.

A sink that forwards events to a callback function.

A sink that writes rendered output to a log file with ANSI codes stripped.

A sink that writes events as JSON Lines (one JSON object per line).

A sink that broadcasts events via Phoenix PubSub.

A sink that writes rendered output to a terminal device.

ANSI terminal utilities for the StudioRenderer pipeline.

Generates human-readable spinner text and summary lines for tool calls.

Matches provider capabilities against routing requirements.

Pure-functional circuit breaker for provider health tracking.

Provider router that implements the ProviderAdapter behaviour.

Routing policy for provider selection and failover attempts.

Pure FIFO run queue with a configurable maximum size.

Thin wrapper around Elixir Registry for locating per-session runtimes.

Per-session runtime server (GenServer) providing

Supervisor for the session runtime.

Orchestrates session lifecycle, run execution, and event handling.

One-shot streaming session lifecycle.

Convenience supervisor for StreamSession infrastructure.

Telemetry event emission for observability.

Thin integration layer for calling ASM from workflow/DAG engines.

Classification of an ASM error for workflow routing decisions.

Normalized result from a workflow step execution.

Represents a diff between two workspace snapshots.

Low-level shell command execution with timeout, output capture, and cancellation.

Git-backed workspace snapshots, diffs, and rollback support.

Hash-based workspace backend for non-git directories.

Represents a captured workspace state at a point in time.

Public workspace service that delegates to git/hash backends.