Documentation/Session Management
v2.0.0-beta.1Snapshot bebdcd1Markdown ↗

Session Management

Session Management

Persist and resume agent conversations

ConnectorConfigStore class

📍 src/connectors/storage/ConnectorConfigStore.ts:39

ConnectorConfigStore - manages connector configs with automatic encryption

Usage:

typescript
const storage = new MemoryConnectorStorage();
const store = new ConnectorConfigStore(storage, process.env.ENCRYPTION_KEY!);

await store.save('openai', { auth: { type: 'api_key', apiKey: 'sk-xxx' } });
const config = await store.get('openai'); // apiKey is decrypted
Constructor

constructor

typescript
constructor(
    private storage: IConnectorConfigStorage,
    private encryptionKey: string
  )

Parameters:

  • storage: IConnectorConfigStorage
  • encryptionKey: string
Static Methods

static create()

Factory that resolves storage from StorageRegistry when no explicit storage is provided.

typescript
static create(encryptionKey: string, storage?: IConnectorConfigStorage): ConnectorConfigStore

Parameters:

  • encryptionKey: string
  • storage: IConnectorConfigStorage | undefined (optional)

Returns: ConnectorConfigStore

Methods

save()

Save a connector configuration (secrets are encrypted automatically)

typescript
async save(name: string, config: ConnectorConfig): Promise<void>

Parameters:

  • name: string
  • config: ConnectorConfig

Returns: Promise<void>

get()

Retrieve a connector configuration (secrets are decrypted automatically)

typescript
async get(name: string): Promise<ConnectorConfig | null>

Parameters:

  • name: string

Returns: Promise<ConnectorConfig | null>

delete()

Delete a connector configuration

typescript
async delete(name: string): Promise<boolean>

Parameters:

  • name: string

Returns: Promise<boolean>

has()

Check if a connector configuration exists

typescript
async has(name: string): Promise<boolean>

Parameters:

  • name: string

Returns: Promise<boolean>

list()

List all connector names

typescript
async list(): Promise<string[]>

Returns: Promise<string[]>

listAll()

Get all connector configurations (secrets are decrypted automatically)

typescript
async listAll(): Promise<ConnectorConfig[]>

Returns: Promise<ConnectorConfig[]>

getMetadata()

Get stored metadata for a connector

typescript
async getMetadata(
    name: string
  ): Promise<{ createdAt: number; updatedAt: number; version: number } | null>

Parameters:

  • name: string

Returns: Promise<{ createdAt: number; updatedAt: number; version: number; } | null>

saveFromTemplate()

Save a connector created from a vendor template. Handles the full lifecycle: validates, builds auth, encrypts secrets, stores config AND preserves non-secret credentials for round-trip editing.

typescript
async saveFromTemplate(
    name: string,
    vendorId: string,
    authTemplateId: string,
    credentials: TemplateCredentials,
    options?: {
      baseURL?: string;
      displayName?: string;
      description?: string;
      defaultModel?: string;
      vendor?: string;
      serviceType?: string;
    },
  ): Promise<ConnectorConfig>

Parameters:

  • name: string
  • vendorId: string
  • authTemplateId: string
  • credentials: TemplateCredentials
  • options: { baseURL?: string | undefined; displayName?: string | undefined; description?: string | undefined; defaultModel?: string | undefined; vendor?: string | undefined; serviceType?: string | undefined; } | undefined (optional)

Returns: Promise<ConnectorConfig>

updateFromTemplate()

Update a connector that was created from a vendor template. Merges new credentials with existing: non-empty values override, empty values preserve the existing decrypted value ("leave empty to keep"). Same-method authorization-code updates also preserve saved scopes, prompts, token namespaces, PKCE, refresh settings and custom endpoints. Method changes require the new method's own credentials; legacy ambiguity requires replacement.

typescript
async updateFromTemplate(
    name: string,
    vendorId: string,
    authTemplateId: string,
    credentials: TemplateCredentials,
    options?: {
      baseURL?: string;
      displayName?: string;
      description?: string;
      defaultModel?: string;
      vendor?: string;
      serviceType?: string;
    },
  ): Promise<ConnectorConfig>

Parameters:

  • name: string
  • vendorId: string
  • authTemplateId: string
  • credentials: TemplateCredentials
  • options: { baseURL?: string | undefined; displayName?: string | undefined; description?: string | undefined; defaultModel?: string | undefined; vendor?: string | undefined; serviceType?: string | undefined; } | undefined (optional)

Returns: Promise<ConnectorConfig>

Properties
Property Type Description
TemplateOptions TemplateOptions: undefined Options for saveFromTemplate / updateFromTemplate

FileAgentDefinitionStorage class

📍 src/infrastructure/storage/FileAgentDefinitionStorage.ts:86

File-based storage for agent definitions

Constructor

constructor

typescript
constructor(config: FileAgentDefinitionStorageConfig = {})

Parameters:

  • config: FileAgentDefinitionStorageConfig (optional) (default: {})
Methods

save()

Save an agent definition

typescript
async save(definition: StoredAgentDefinition): Promise<void>

Parameters:

  • definition: StoredAgentDefinition

Returns: Promise<void>

load()

Load an agent definition

typescript
async load(agentId: string): Promise<StoredAgentDefinition | null>

Parameters:

  • agentId: string

Returns: Promise<StoredAgentDefinition | null>

delete()

Delete an agent definition

typescript
async delete(agentId: string): Promise<void>

Parameters:

  • agentId: string

Returns: Promise<void>

exists()

Check if an agent definition exists

typescript
async exists(agentId: string): Promise<boolean>

Parameters:

  • agentId: string

Returns: Promise<boolean>

list()

List all agent definitions

typescript
async list(options?: AgentDefinitionListOptions): Promise<AgentDefinitionSummary[]>

Parameters:

  • options: AgentDefinitionListOptions | undefined (optional)

Returns: Promise<AgentDefinitionSummary[]>

updateMetadata()

Update metadata without loading full definition

typescript
async updateMetadata(
    agentId: string,
    metadata: Partial<AgentDefinitionMetadata>
  ): Promise<void>

Parameters:

  • agentId: string
  • metadata: Partial<AgentDefinitionMetadata>

Returns: Promise<void>

getPath()

Get storage path

typescript
getPath(): string

Returns: string

rebuildIndex()

Rebuild the index by scanning all agent directories

typescript
async rebuildIndex(): Promise<void>

Returns: Promise<void>


FileConnectorStorage class

📍 src/connectors/storage/FileConnectorStorage.ts:30

Constructor

constructor

typescript
constructor(config: FileConnectorStorageConfig)

Parameters:

  • config: FileConnectorStorageConfig
Methods

save()

typescript
async save(name: string, stored: StoredConnectorConfig): Promise<void>

Parameters:

  • name: string
  • stored: StoredConnectorConfig

Returns: Promise<void>

get()

typescript
async get(name: string): Promise<StoredConnectorConfig | null>

Parameters:

  • name: string

Returns: Promise<StoredConnectorConfig | null>

delete()

typescript
async delete(name: string): Promise<boolean>

Parameters:

  • name: string

Returns: Promise<boolean>

has()

typescript
async has(name: string): Promise<boolean>

Parameters:

  • name: string

Returns: Promise<boolean>

list()

typescript
async list(): Promise<string[]>

Returns: Promise<string[]>

listAll()

typescript
async listAll(): Promise<StoredConnectorConfig[]>

Returns: Promise<StoredConnectorConfig[]>

clear()

Clear all stored configs (useful for testing)

typescript
async clear(): Promise<void>

Returns: Promise<void>


FileContextStorage class

📍 src/infrastructure/storage/FileContextStorage.ts:100

File-based storage for AgentContext session persistence

Constructor

constructor

typescript
constructor(config: FileContextStorageConfig)

Parameters:

  • config: FileContextStorageConfig
Methods

save()

Save context state to a session file

typescript
async save(
    sessionId: string,
    state: SerializedContextState,
    metadata?: ContextSessionMetadata
  ): Promise<void>

Parameters:

  • sessionId: string
  • state: SerializedContextState
  • metadata: ContextSessionMetadata | undefined (optional)

Returns: Promise<void>

load()

Load context state from a session file

typescript
async load(sessionId: string): Promise<StoredContextSession | null>

Parameters:

  • sessionId: string

Returns: Promise<StoredContextSession | null>

delete()

Delete a session

typescript
async delete(sessionId: string): Promise<void>

Parameters:

  • sessionId: string

Returns: Promise<void>

exists()

Check if a session exists

typescript
async exists(sessionId: string): Promise<boolean>

Parameters:

  • sessionId: string

Returns: Promise<boolean>

list()

List all sessions (summaries only)

typescript
async list(options?: ContextStorageListOptions): Promise<ContextSessionSummary[]>

Parameters:

  • options: ContextStorageListOptions | undefined (optional)

Returns: Promise<ContextSessionSummary[]>

updateMetadata()

Update session metadata without loading full state

typescript
async updateMetadata(
    sessionId: string,
    metadata: Partial<ContextSessionMetadata>
  ): Promise<void>

Parameters:

  • sessionId: string
  • metadata: Partial<ContextSessionMetadata>

Returns: Promise<void>

getPath()

Get the storage path (for display/debugging)

typescript
getPath(): string

Returns: string

getLocation()

Get a human-readable storage location string (for display/debugging)

typescript
getLocation(): string

Returns: string

getAgentId()

Get the agent ID

typescript
getAgentId(): string

Returns: string

rebuildIndex()

Rebuild the index by scanning all session files Useful for recovery or migration

typescript
async rebuildIndex(): Promise<void>

Returns: Promise<void>

Properties
Property Type Description
journal journal: IHistoryJournal History journal companion — appends full conversation history as JSONL

FileCorrelationStorage class

📍 src/infrastructure/storage/FileCorrelationStorage.ts:52

File-based implementation of ICorrelationStorage

Constructor

constructor

typescript
constructor(config?: FileCorrelationStorageConfig)

Parameters:

  • config: FileCorrelationStorageConfig | undefined (optional)
Methods

save()

typescript
async save(correlationId: string, ref: SessionRef): Promise<void>

Parameters:

  • correlationId: string
  • ref: SessionRef

Returns: Promise<void>

resolve()

typescript
async resolve(correlationId: string): Promise<SessionRef | null>

Parameters:

  • correlationId: string

Returns: Promise<SessionRef | null>

delete()

typescript
async delete(correlationId: string): Promise<void>

Parameters:

  • correlationId: string

Returns: Promise<void>

exists()

typescript
async exists(correlationId: string): Promise<boolean>

Parameters:

  • correlationId: string

Returns: Promise<boolean>

listBySession()

typescript
async listBySession(sessionId: string): Promise<string[]>

Parameters:

  • sessionId: string

Returns: Promise<string[]>

listByAgent()

typescript
async listByAgent(agentId: string): Promise<CorrelationSummary[]>

Parameters:

  • agentId: string

Returns: Promise<CorrelationSummary[]>

pruneExpired()

typescript
async pruneExpired(): Promise<number>

Returns: Promise<number>

getPath()

typescript
getPath(): string

Returns: string


FileCustomToolStorage class

📍 src/infrastructure/storage/FileCustomToolStorage.ts:80

File-based storage for custom tool definitions

Single instance handles all users. UserId is passed to each method.

Constructor

constructor

typescript
constructor(config: FileCustomToolStorageConfig = {})

Parameters:

  • config: FileCustomToolStorageConfig (optional) (default: {})
Methods

save()

Save a custom tool definition

typescript
async save(userId: string | undefined, definition: CustomToolDefinition): Promise<void>

Parameters:

  • userId: string | undefined
  • definition: CustomToolDefinition

Returns: Promise<void>

load()

Load a custom tool definition by name

typescript
async load(userId: string | undefined, name: string): Promise<CustomToolDefinition | null>

Parameters:

  • userId: string | undefined
  • name: string

Returns: Promise<CustomToolDefinition | null>

delete()

Delete a custom tool definition

typescript
async delete(userId: string | undefined, name: string): Promise<void>

Parameters:

  • userId: string | undefined
  • name: string

Returns: Promise<void>

exists()

Check if a custom tool exists

typescript
async exists(userId: string | undefined, name: string): Promise<boolean>

Parameters:

  • userId: string | undefined
  • name: string

Returns: Promise<boolean>

list()

List custom tools (summaries only)

typescript
async list(userId: string | undefined, options?: CustomToolListOptions): Promise<CustomToolSummary[]>

Parameters:

  • userId: string | undefined
  • options: CustomToolListOptions | undefined (optional)

Returns: Promise<CustomToolSummary[]>

updateMetadata()

Update metadata without loading full definition

typescript
async updateMetadata(userId: string | undefined, name: string, metadata: Record<string, unknown>): Promise<void>

Parameters:

  • userId: string | undefined
  • name: string
  • metadata: Record<string, unknown>

Returns: Promise<void>

getPath()

Get storage path for a specific user

typescript
getPath(userId: string | undefined): string

Parameters:

  • userId: string | undefined

Returns: string


FileEvidenceStorage class

📍 src/infrastructure/storage/EvidenceStorage.ts:213

Immutable atomic files, hashed scope directories (no sanitization collisions).

Constructor

constructor

typescript
constructor(options: FileEvidenceStorageOptions)

Parameters:

  • options: FileEvidenceStorageOptions
Methods

inventory()

typescript
protected async inventory(): Promise<Array<{ id: string; bytes: number }>>

Returns: Promise<{ id: string; bytes: number; }[]>

writeBlob()

typescript
protected async writeBlob(id: string, bytes: Buffer): Promise<void>

Parameters:

  • id: string
  • bytes: Buffer<ArrayBufferLike>

Returns: Promise<void>

readBlob()

typescript
protected async readBlob(id: string): Promise<Buffer | null>

Parameters:

  • id: string

Returns: Promise<Buffer<ArrayBufferLike> | null>

removeBlob()

typescript
protected async removeBlob(id: string): Promise<boolean>

Parameters:

  • id: string

Returns: Promise<boolean>

Properties
Property Type Description
durability `durability: "restart" "fsync"`
queueKey queueKey: string -

FileHistoryJournal class

📍 src/infrastructure/storage/FileHistoryJournal.ts:55

Sanitize ID for use as a filename. Same logic as FileContextStorage to ensure matching paths.

Constructor

constructor

typescript
constructor(sessionsDirectory: string)

Parameters:

  • sessionsDirectory: string
Methods

append()

Append entries to the journal file.

Uses fs.appendFile which is atomic for small writes on most filesystems. Each entry is serialized as a single JSON line.

typescript
async append(sessionId: string, entries: HistoryEntry[]): Promise<void>

Parameters:

  • sessionId: string
  • entries: HistoryEntry[]

Returns: Promise<void>

replaceLast()

Replace the most recent entry with the same type + turn index.

JSONL is append-friendly rather than update-friendly, so this rewrites the session journal file only for the narrow correction path used by structured-output post-processing.

typescript
async replaceLast(
    sessionId: string,
    type: HistoryEntryType,
    turnIndex: number,
    entry: HistoryEntry,
  ): Promise<boolean>

Parameters:

  • sessionId: string
  • type: HistoryEntryType
  • turnIndex: number
  • entry: HistoryEntry

Returns: Promise<boolean>

read()

Read history entries with optional filtering and pagination.

For large files, prefer stream() with pagination.

typescript
async read(sessionId: string, options?: HistoryReadOptions): Promise<HistoryEntry[]>

Parameters:

  • sessionId: string
  • options: HistoryReadOptions | undefined (optional)

Returns: Promise<HistoryEntry[]>

count()

Count entries without fully parsing the file.

Counts non-empty lines in the JSONL file.

typescript
async count(sessionId: string): Promise<number>

Parameters:

  • sessionId: string

Returns: Promise<number>

clear()

Delete the journal file for a session.

typescript
async clear(sessionId: string): Promise<void>

Parameters:

  • sessionId: string

Returns: Promise<void>

stream()

Stream history entries line-by-line using readline.

Memory-efficient for large histories — only one entry in memory at a time.

typescript
async *stream(sessionId: string, options?: HistoryReadOptions): AsyncIterable<HistoryEntry>

Parameters:

  • sessionId: string
  • options: HistoryReadOptions | undefined (optional)

Returns: AsyncIterable<HistoryEntry>

getLocation()

Get the file path for a session's journal (for debugging).

typescript
getLocation(sessionId: string): string

Parameters:

  • sessionId: string

Returns: string


FileMediaStorage class

📍 src/infrastructure/storage/FileMediaStorage.ts:47

Constructor

constructor

typescript
constructor(config?: FileMediaStorageConfig)

Parameters:

  • config: FileMediaStorageConfig | undefined (optional)
Methods

save()

typescript
async save(data: Buffer, metadata: MediaStorageMetadata): Promise<MediaStorageResult>

Parameters:

  • data: Buffer<ArrayBufferLike>
  • metadata: MediaStorageMetadata

Returns: Promise<MediaStorageResult>

read()

typescript
async read(location: string): Promise<Buffer | null>

Parameters:

  • location: string

Returns: Promise<Buffer<ArrayBufferLike> | null>

delete()

typescript
async delete(location: string): Promise<void>

Parameters:

  • location: string

Returns: Promise<void>

exists()

typescript
async exists(location: string): Promise<boolean>

Parameters:

  • location: string

Returns: Promise<boolean>

list()

typescript
async list(options?: MediaStorageListOptions): Promise<MediaStorageEntry[]>

Parameters:

  • options: MediaStorageListOptions | undefined (optional)

Returns: Promise<MediaStorageEntry[]>

getPath()

typescript
getPath(): string

Returns: string


FilePersistentInstructionsStorage class

📍 src/infrastructure/storage/FilePersistentInstructionsStorage.ts:68

File-based storage for persistent agent instructions

Constructor

constructor

typescript
constructor(config: FilePersistentInstructionsStorageConfig)

Parameters:

  • config: FilePersistentInstructionsStorageConfig
Methods

load()

Load instruction entries from file. Falls back to legacy .md file migration if JSON not found.

typescript
async load(): Promise<InstructionEntry[] | null>

Returns: Promise<InstructionEntry[] | null>

save()

Save instruction entries to file as JSON. Creates directory if it doesn't exist. Cleans up legacy .md file if present.

typescript
async save(entries: InstructionEntry[]): Promise<void>

Parameters:

  • entries: InstructionEntry[]

Returns: Promise<void>

delete()

Delete instructions file (and legacy .md if exists)

typescript
async delete(): Promise<void>

Returns: Promise<void>

exists()

Check if instructions file exists (JSON or legacy .md)

typescript
async exists(): Promise<boolean>

Returns: Promise<boolean>

getPath()

Get the file path (for display/debugging)

typescript
getPath(): string

Returns: string

getAgentId()

Get the agent ID

typescript
getAgentId(): string

Returns: string


FileRoutineDefinitionStorage class

📍 src/infrastructure/storage/FileRoutineDefinitionStorage.ts:91

File-based storage for routine definitions.

Single instance handles all users. UserId is passed to each method.

Constructor

constructor

typescript
constructor(config: FileRoutineDefinitionStorageConfig = {})

Parameters:

  • config: FileRoutineDefinitionStorageConfig (optional) (default: {})
Methods

save()

typescript
async save(context: StorageUserContextInput, definition: RoutineDefinition): Promise<void>

Parameters:

  • context: StorageUserContextInput
  • definition: RoutineDefinition

Returns: Promise<void>

load()

typescript
async load(context: StorageUserContextInput, id: string): Promise<RoutineDefinition | null>

Parameters:

  • context: StorageUserContextInput
  • id: string

Returns: Promise<RoutineDefinition | null>

delete()

typescript
async delete(context: StorageUserContextInput, id: string): Promise<void>

Parameters:

  • context: StorageUserContextInput
  • id: string

Returns: Promise<void>

exists()

typescript
async exists(context: StorageUserContextInput, id: string): Promise<boolean>

Parameters:

  • context: StorageUserContextInput
  • id: string

Returns: Promise<boolean>

list()

typescript
async list(context: StorageUserContextInput, options?: {
    tags?: string[];
    search?: string;
    limit?: number;
    offset?: number;
  }): Promise<RoutineSummary[]>

Parameters:

  • context: StorageUserContextInput
  • options: { tags?: string[] | undefined; search?: string | undefined; limit?: number | undefined; offset?: number | undefined; } | undefined (optional)

Returns: Promise<RoutineSummary[]>

getPath()

typescript
getPath(context: StorageUserContextInput): string

Parameters:

  • context: StorageUserContextInput

Returns: string


FileRoutineExecutionStorage class

📍 src/infrastructure/storage/FileRoutineExecutionStorage.ts:97

File-based storage for routine execution records.

Single instance handles all users. UserId is passed to each method.

Constructor

constructor

typescript
constructor(config: FileRoutineExecutionStorageConfig = {})

Parameters:

  • config: FileRoutineExecutionStorageConfig (optional) (default: {})
Methods

insert()

typescript
async insert(context: StorageUserContextInput, record: RoutineExecutionRecord): Promise<string>

Parameters:

  • context: StorageUserContextInput
  • record: RoutineExecutionRecord

Returns: Promise<string>

update()

typescript
async update(
    id: string,
    updates: Partial<
      Pick<RoutineExecutionRecord, 'status' | 'progress' | 'error' | 'completedAt' | 'lastActivityAt'>
    >,
  ): Promise<void>

Parameters:

  • id: string
  • updates: Partial<Pick<RoutineExecutionRecord, "error" | "status" | "progress" | "completedAt" | "lastActivityAt">>

Returns: Promise<void>

pushStep()

typescript
async pushStep(id: string, step: RoutineExecutionStep): Promise<void>

Parameters:

  • id: string
  • step: RoutineExecutionStep

Returns: Promise<void>

updateTask()

typescript
async updateTask(id: string, taskName: string, updates: Partial<RoutineTaskSnapshot>): Promise<void>

Parameters:

  • id: string
  • taskName: string
  • updates: Partial<RoutineTaskSnapshot>

Returns: Promise<void>

load()

typescript
async load(id: string): Promise<RoutineExecutionRecord | null>

Parameters:

  • id: string

Returns: Promise<RoutineExecutionRecord | null>

list()

typescript
async list(
    context: StorageUserContextInput,
    options?: {
      routineId?: string;
      status?: RoutineExecutionStatus;
      limit?: number;
      offset?: number;
    },
  ): Promise<RoutineExecutionRecord[]>

Parameters:

  • context: StorageUserContextInput
  • options: { routineId?: string | undefined; status?: RoutineExecutionStatus | undefined; limit?: number | undefined; offset?: number | undefined; } | undefined (optional)

Returns: Promise<RoutineExecutionRecord[]>

hasRunning()

typescript
async hasRunning(context: StorageUserContextInput, routineId: string): Promise<boolean>

Parameters:

  • context: StorageUserContextInput
  • routineId: string

Returns: Promise<boolean>

getPath()

typescript
getPath(context: StorageUserContextInput): string

Parameters:

  • context: StorageUserContextInput

Returns: string


FileStorage class

📍 src/connectors/oauth/infrastructure/storage/FileStorage.ts:22

Constructor

constructor

typescript
constructor(config: FileStorageConfig)

Parameters:

  • config: FileStorageConfig
Methods

storeToken()

typescript
async storeToken(key: string, token: StoredToken): Promise<void>

Parameters:

  • key: string
  • token: StoredToken

Returns: Promise<void>

getToken()

typescript
async getToken(key: string): Promise<StoredToken | null>

Parameters:

  • key: string

Returns: Promise<StoredToken | null>

deleteToken()

typescript
async deleteToken(key: string): Promise<void>

Parameters:

  • key: string

Returns: Promise<void>

hasToken()

typescript
async hasToken(key: string): Promise<boolean>

Parameters:

  • key: string

Returns: Promise<boolean>

listKeys()

List all storage keys by decrypting each token file and reading _storageKey. Falls back to returning hashed filenames for tokens stored before multi-account support.

typescript
async listKeys(): Promise<string[]>

Returns: Promise<string[]>

listTokens()

List all token keys (for debugging)

typescript
async listTokens(): Promise<string[]>

Returns: Promise<string[]>

clearAll()

Clear all tokens

typescript
async clearAll(): Promise<void>

Returns: Promise<void>


FileUserInfoStorage class

📍 src/infrastructure/storage/FileUserInfoStorage.ts:74

Sanitize user ID for use as a directory name Removes or replaces characters that are not safe for filenames

Constructor

constructor

typescript
constructor(config?: FileUserInfoStorageConfig)

Parameters:

  • config: FileUserInfoStorageConfig | undefined (optional)
Methods

load()

Load user info entries from file for a specific user

typescript
async load(userId: string | undefined): Promise<UserInfoEntry[] | null>

Parameters:

  • userId: string | undefined

Returns: Promise<UserInfoEntry[] | null>

save()

Save user info entries to file for a specific user Creates directory if it doesn't exist.

typescript
async save(userId: string | undefined, entries: UserInfoEntry[]): Promise<void>

Parameters:

  • userId: string | undefined
  • entries: UserInfoEntry[]

Returns: Promise<void>

delete()

Delete user info file for a specific user

typescript
async delete(userId: string | undefined): Promise<void>

Parameters:

  • userId: string | undefined

Returns: Promise<void>

exists()

Check if user info file exists for a specific user

typescript
async exists(userId: string | undefined): Promise<boolean>

Parameters:

  • userId: string | undefined

Returns: Promise<boolean>

getPath()

Get the file path for a specific user (for display/debugging)

typescript
getPath(userId: string | undefined): string

Parameters:

  • userId: string | undefined

Returns: string


FileUserPermissionRulesStorage class

📍 src/infrastructure/storage/FileUserPermissionRulesStorage.ts:40

Constructor

constructor

typescript
constructor(config?: FileUserPermissionRulesStorageConfig)

Parameters:

  • config: FileUserPermissionRulesStorageConfig | undefined (optional)
Methods

load()

typescript
async load(userId: string | undefined): Promise<UserPermissionRule[] | null>

Parameters:

  • userId: string | undefined

Returns: Promise<UserPermissionRule[] | null>

save()

typescript
async save(userId: string | undefined, rules: UserPermissionRule[]): Promise<void>

Parameters:

  • userId: string | undefined
  • rules: UserPermissionRule[]

Returns: Promise<void>

delete()

typescript
async delete(userId: string | undefined): Promise<void>

Parameters:

  • userId: string | undefined

Returns: Promise<void>

exists()

typescript
async exists(userId: string | undefined): Promise<boolean>

Parameters:

  • userId: string | undefined

Returns: Promise<boolean>

getPath()

typescript
getPath(userId: string | undefined): string

Parameters:

  • userId: string | undefined

Returns: string


GoogleLiveSession class

📍 src/capabilities/google/GoogleLiveSession.ts:17

Connector-first Gemini Live session, including 3.8 background-reasoning status.

Constructor

constructor

typescript
constructor(options: GoogleLiveSessionOptions)

Parameters:

  • options: GoogleLiveSessionOptions
Methods

connect()

typescript
async connect(): Promise<void>

Returns: Promise<void>

sendClientContent()

typescript
sendClientContent(params: Parameters<Session['sendClientContent']>[0]): void

Parameters:

  • params: LiveSendClientContentParameters

Returns: void

sendRealtimeInput()

typescript
sendRealtimeInput(params: Parameters<Session['sendRealtimeInput']>[0]): void

Parameters:

  • params: LiveSendRealtimeInputParameters

Returns: void

sendToolResponse()

typescript
sendToolResponse(params: Parameters<Session['sendToolResponse']>[0]): void

Parameters:

  • params: LiveSendToolResponseParameters

Returns: void

close()

typescript
close(): void

Returns: void

Properties
Property Type Description
connector connector: Connector -
model model: string -
config? `config: LiveConnectConfig undefined`

GrokRealtimeSession class

📍 src/capabilities/voice/grok/GrokRealtimeSession.ts:17

xAI-typed facade over the connector-aware Realtime WebSocket transport. OpenAIRealtimeSession deliberately retains OpenAI's stricter 24 kHz type.

Constructor

constructor

typescript
constructor(options: GrokRealtimeSessionOptions)

Parameters:

  • options: GrokRealtimeSessionOptions
Methods

updateSession()

typescript
override updateSession(
    session: NonNullable<OpenAIRealtimeSessionOptions['session']> | GrokRealtimeSessionConfig,
  ): void

Parameters:

  • session: NonNullable<OpenAIRealtimeSessionConfig | OpenAIRealtimeTranscriptionSessionConfig | OpenAIRealtimeTranslationSessionConfig | undefined> | GrokRealtimeSessionConfig

Returns: void


OpenAILiveSession class

📍 src/capabilities/openai/OpenAILiveSession.ts:17

Connector-first primary WebSocket session for GPT-Live.

Constructor

constructor

typescript
constructor(options: OpenAILiveSessionOptions)

Parameters:

  • options: OpenAILiveSessionOptions
Methods

connect()

typescript
async connect(session: LiveAPI.SessionConfig): Promise<LiveAPI.SessionResource>

Parameters:

  • session: SessionConfig

Returns: Promise<SessionResource>

appendAudio()

typescript
appendAudio(audio: Buffer | string, eventId?: string): void

Parameters:

  • audio: string | Buffer<ArrayBufferLike>
  • eventId: string | undefined (optional)

Returns: void

send()

typescript
send(event: LiveAPI.ClientEvent): void

Parameters:

  • event: ClientEvent

Returns: void

events()

typescript
events(): AsyncIterableIterator<LiveStreamMessage>

Returns: AsyncIterableIterator<LiveStreamMessage>

close()

typescript
close(code = 1000, reason = 'OK'): void

Parameters:

  • code: number (optional) (default: 1000)
  • reason: string (optional) (default: 'OK')

Returns: void

Properties
Property Type Description
connector connector: Connector -

OpenAIRealtimeAgentSession class

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:143

Agent-aware controller for OpenAI Realtime voice sessions.

It is deliberately transport-neutral: the default transport is the server WebSocket client, while browsers can provide a WebRTC data-channel adapter. Local functions execute through Agent (not ToolManager directly), remote MCP approvals fail closed, AgentContext is synchronized per turn, and usage is accumulated into both this session and Agent metrics.

Constructor

constructor

typescript
constructor(options: OpenAIRealtimeAgentSessionOptions)

Parameters:

  • options: OpenAIRealtimeAgentSessionOptions
Methods

connect()

typescript
async connect(options: { signal?: AbortSignal } = {}): Promise<OpenAIRealtimeServerEvent | undefined>

Parameters:

  • options: { signal?: AbortSignal | undefined; } (optional) (default: {})

Returns: Promise<OpenAIRealtimeServerEvent | undefined>

appendAudio()

typescript
appendAudio(audio: Buffer | string): boolean

Parameters:

  • audio: string | Buffer<ArrayBufferLike>

Returns: boolean

commitAudio()

typescript
commitAudio(): void

Returns: void

clearAudio()

typescript
clearAudio(): void

Returns: void

cancelResponse()

typescript
cancelResponse(): void

Returns: void

createResponse()

typescript
createResponse(response: Record<string, unknown> = {}): void

Parameters:

  • response: Record<string, unknown> (optional) (default: {})

Returns: void

truncateItem()

typescript
truncateItem(itemId: string, audioEndMs: number, contentIndex = 0): void

Parameters:

  • itemId: string
  • audioEndMs: number
  • contentIndex: number (optional) (default: 0)

Returns: void

sendText()

typescript
async sendText(text: string, response: Record<string, unknown> = {}): Promise<void>

Parameters:

  • text: string
  • response: Record<string, unknown> (optional) (default: {})

Returns: Promise<void>

sendImage()

typescript
async sendImage(imageUrl: string, response: Record<string, unknown> = {}): Promise<void>

Parameters:

  • imageUrl: string
  • response: Record<string, unknown> (optional) (default: {})

Returns: Promise<void>

getUsage()

typescript
getUsage(): OpenAIRealtimeAgentUsage

Returns: OpenAIRealtimeAgentUsage

handleServerEvent()

Public for custom transports that cannot expose EventEmitter-style events.

typescript
async handleServerEvent(event: OpenAIRealtimeServerEvent): Promise<void>

Parameters:

  • event: OpenAIRealtimeServerEvent

Returns: Promise<void>

close()

typescript
async close(code = 1000, reason = 'OK'): Promise<void>

Parameters:

  • code: number (optional) (default: 1000)
  • reason: string (optional) (default: 'OK')

Returns: Promise<void>

on()

typescript
on<K extends keyof OpenAIRealtimeAgentSessionEvents>(
    event: K,
    handler: OpenAIRealtimeAgentSessionEvents[K],
  ): this

Parameters:

  • event: K
  • handler: OpenAIRealtimeAgentSessionEvents[K]

Returns: this

updateSession()

Apply a partial/complete Realtime session update.

typescript
updateSession(session: OpenAIRealtimeSessionConfig): void

Parameters:

  • session: OpenAIRealtimeSessionConfig

Returns: void

send()

Send an advanced Realtime client event through the configured transport.

typescript
send(event: OpenAIRealtimeClientEvent): void

Parameters:

  • event: OpenAIRealtimeClientEvent

Returns: void

Properties
Property Type Description
agent agent: Agent -
transport transport: OpenAIRealtimeAgentTransport -

OpenAIRealtimeSession class

📍 src/capabilities/voice/openai/OpenAIRealtimeSession.ts:69

Connector-first, server-side WebSocket client for OpenAI's GA Realtime API. It intentionally exposes the raw event stream while providing helpers for the common conversation, audio, and response events.

Constructor

constructor

typescript
constructor(options: OpenAIRealtimeSessionOptions)

Parameters:

  • options: OpenAIRealtimeSessionOptions
Methods

connect()

typescript
async connect(options: OpenAIRealtimeConnectOptions = {}): Promise<OpenAIRealtimeServerEvent>

Parameters:

  • options: OpenAIRealtimeConnectOptions (optional) (default: {})

Returns: Promise<OpenAIRealtimeServerEvent>

updateSession()

typescript
updateSession(session: NonNullable<OpenAIRealtimeSessionOptions['session']>): void

Parameters:

  • session: NonNullable<OpenAIRealtimeSessionConfig | OpenAIRealtimeTranscriptionSessionConfig | OpenAIRealtimeTranslationSessionConfig | undefined>

Returns: void

appendAudio()

typescript
appendAudio(audio: Buffer | string): boolean

Parameters:

  • audio: string | Buffer<ArrayBufferLike>

Returns: boolean

commitAudio()

typescript
commitAudio(): void

Returns: void

clearAudio()

typescript
clearAudio(): void

Returns: void

createResponse()

typescript
createResponse(response: Record<string, unknown> = {}): void

Parameters:

  • response: Record<string, unknown> (optional) (default: {})

Returns: void

cancelResponse()

typescript
cancelResponse(): void

Returns: void

closeTranslation()

Flush and close a translation stream after handling session.closed.

typescript
closeTranslation(): void

Returns: void

sendText()

typescript
sendText(text: string): void

Parameters:

  • text: string

Returns: void

sendImage()

typescript
sendImage(imageUrl: string): void

Parameters:

  • imageUrl: string

Returns: void

truncateItem()

typescript
truncateItem(itemId: string, audioEndMs: number, contentIndex = 0): void

Parameters:

  • itemId: string
  • audioEndMs: number
  • contentIndex: number (optional) (default: 0)

Returns: void

send()

typescript
send(event: OpenAIRealtimeClientEvent): void

Parameters:

  • event: OpenAIRealtimeClientEvent

Returns: void

close()

typescript
close(code = 1000, reason = 'OK'): void

Parameters:

  • code: number (optional) (default: 1000)
  • reason: string (optional) (default: 'OK')

Returns: void

on()

typescript
on<K extends keyof OpenAIRealtimeSessionEvents>(event: K, handler: OpenAIRealtimeSessionEvents[K]): this

Parameters:

  • event: K
  • handler: OpenAIRealtimeSessionEvents[K]

Returns: this

Properties
Property Type Description
connector connector: Connector -
model model: OpenAIRealtimeModel -
initialSession? `initialSession: OpenAIRealtimeSessionConfig OpenAIRealtimeTranscriptionSessionConfig

OpenAIResponsesWebSocketSession class

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:82

Connector-first Responses WebSocket session with GPT-6 Astra steering support.

Constructor

constructor

typescript
constructor(options: OpenAIResponsesWebSocketSessionOptions)

Parameters:

  • options: OpenAIResponsesWebSocketSessionOptions
Methods

connect()

typescript
async connect(): Promise<void>

Returns: Promise<void>

createResponse()

typescript
createResponse(options: OpenAIResponsesCreateEventOptions): void

Parameters:

  • options: OpenAIResponsesCreateEventOptions

Returns: void

steer()

Queue additional user input for an active Astra response.

typescript
steer(previousResponseId: string, input: ResponseSteerInput): void

Parameters:

  • previousResponseId: string
  • input: ResponseSteerInput

Returns: void

send()

Send an advanced SDK-typed Responses WebSocket event.

typescript
send(event: ResponsesAPI.ResponsesClientEvent): void

Parameters:

  • event: ResponsesClientEvent

Returns: void

events()

typescript
events(): AsyncIterableIterator<ResponsesStreamMessage>

Returns: AsyncIterableIterator<ResponsesStreamMessage>

close()

typescript
close(code = 1000, reason = 'OK'): void

Parameters:

  • code: number (optional) (default: 1000)
  • reason: string (optional) (default: 'OK')

Returns: void

on()

typescript
override on<K extends keyof OpenAIResponsesWebSocketSessionEvents>(
    event: K,
    listener: OpenAIResponsesWebSocketSessionEvents[K],
  ): this

Parameters:

  • event: K
  • listener: OpenAIResponsesWebSocketSessionEvents[K]

Returns: this

Properties
Property Type Description
connector connector: Connector -

SessionIngestorPluginNextGen class

📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:136

Constructor

constructor

typescript
constructor(config: SessionIngestorPluginConfig)

Parameters:

  • config: SessionIngestorPluginConfig
Methods

getInstructions()

typescript
getInstructions(): string | null

Returns: string | null

getContent()

typescript
async getContent(): Promise<string | null>

Returns: Promise<string | null>

getContents()

typescript
getContents(): unknown

Returns: unknown

getTokenSize()

typescript
getTokenSize(): number

Returns: number

getInstructionsTokenSize()

typescript
getInstructionsTokenSize(): number

Returns: number

isCompactable()

typescript
isCompactable(): boolean

Returns: boolean

compact()

typescript
async compact(_targetTokensToFree: number): Promise<number>

Parameters:

  • _targetTokensToFree: number

Returns: Promise<number>

getTools()

typescript
getTools(): ToolFunction[]

Returns: ToolFunction<any, any>[]

destroy()

typescript
destroy(): void

Returns: void

getState()

typescript
getState(): unknown

Returns: unknown

restoreState()

typescript
restoreState(state: unknown): void

Parameters:

  • state: unknown

Returns: void

onBeforePrepare()

typescript
onBeforePrepare(snapshot: PluginPrepareSnapshot): void

Parameters:

  • snapshot: PluginPrepareSnapshot

Returns: void

waitForIngest()

Await the current in-flight ingestion, if any. Used by tests to deterministically wait.

typescript
async waitForIngest(): Promise<void>

Returns: Promise<void>

flush()

Force-ingest any pending messages and await completion — the graceful- shutdown escape hatch. Bypasses minBatchMessages; uses the most recent onBeforePrepare snapshot as the source (so callers should ensure AgentContextNextGen.prepare() has fired at least once after the last message was added — typically that happens naturally during the last agent turn).

Contract: hosts should call await plugin.flush() before disposing of the plugin (on DDP disconnect, /back, SIGINT, etc.) to guarantee the final batch is persisted. destroy() does NOT await — it only flips the destroyed flag and releases the LLM agent.

Safe to call multiple times; on a destroyed plugin, this awaits any in-flight ingest but does not start a new one.

Optional snapshot override: callers that have already built a fresh PluginPrepareSnapshot (e.g. via another plugin's hook) can pass it in directly and skip the stored-snapshot path.

typescript
async flush(snapshot?: PluginPrepareSnapshot): Promise<void>

Parameters:

  • snapshot: PluginPrepareSnapshot | undefined (optional)

Returns: Promise<void>

getLastIngestedMessageId()

Id of the last message we've ingested. null before any ingest.

typescript
getLastIngestedMessageId(): string | null

Returns: string | null

isDisabled()

Whether bootstrap encountered a foreign-owned entity and disabled the plugin.

typescript
isDisabled(): boolean

Returns: boolean

Properties
Property Type Description
name name: "session_ingestor" -

VoiceSession class

📍 src/capabilities/voice/VoiceSession.ts:55

Constructor

constructor

typescript
constructor(
    callInfo: IncomingCallInfo,
    direction: CallDirection = 'inbound',
  )

Parameters:

  • callInfo: IncomingCallInfo
  • direction: CallDirection (optional) (default: 'inbound')
Methods

transition()

Transition to a new state. Throws if the transition is invalid.

typescript
transition(newState: SessionState): void

Parameters:

  • newState: SessionState

Returns: void

incrementTurns()

Increment the turn counter (called after each agent response completes)

typescript
incrementTurns(): void

Returns: void

addSttTime()

typescript
addSttTime(ms: number): void

Parameters:

  • ms: number

Returns: void

addTtsTime()

typescript
addTtsTime(ms: number): void

Parameters:

  • ms: number

Returns: void

addAgentTime()

typescript
addAgentTime(ms: number): void

Parameters:

  • ms: number

Returns: void

createAgent()

Create and assign the agent for this call session.

typescript
createAgent(config: AgentConfig): Agent

Parameters:

  • config: AgentConfig

Returns: Agent

assignAgent()

Assign a factory-created Agent. VoiceSession assumes ownership and destroys it on end.

typescript
assignAgent(agent: Agent): Agent

Parameters:

  • agent: Agent

Returns: Agent

setPipeline()

Assign the voice pipeline for this call session.

typescript
setPipeline(pipeline: IVoicePipeline): void

Parameters:

  • pipeline: IVoicePipeline

Returns: void

setMaxDuration()

Set a maximum call duration timer. When it fires, the session transitions to 'ending'.

typescript
setMaxDuration(seconds: number): void

Parameters:

  • seconds: number

Returns: void

getInfo()

Get a read-only snapshot of the session state.

typescript
getInfo(): VoiceSessionInfo

Returns: VoiceSessionInfo

setEndReason()

Set the reason the call ended (before calling end()).

typescript
setEndReason(reason: CallEndReason): void

Parameters:

  • reason: CallEndReason

Returns: void

getSummary()

Get the call summary. Only meaningful after the session has ended.

typescript
getSummary(): CallSummary

Returns: CallSummary

end()

End the session and clean up all resources.

typescript
async end(reason?: CallEndReason): Promise<CallSummary>

Parameters:

  • reason: CallEndReason | undefined (optional)

Returns: Promise<CallSummary>

Properties
Property Type Description
sessionId sessionId: string -
direction direction: CallDirection -
callId callId: string -
from from: string -
to to: string -
startedAt startedAt: Date -
metadata metadata: Record<string, unknown> -

ContextSessionMetadata interface

📍 src/domain/interfaces/IContextStorage.ts:67

Session metadata (stored with session)

Properties
Property Type Description
title? title?: string; Human-readable title
description? description?: string; Auto-generated or user-provided description
tags? tags?: string[]; Tags for filtering

ContextSessionSummary interface

📍 src/domain/interfaces/IContextStorage.ts:44

Session summary for listing (lightweight, no full state)

Properties
Property Type Description
sessionId sessionId: string; Session identifier
createdAt createdAt: Date; When the session was created
lastSavedAt lastSavedAt: Date; When the session was last saved
messageCount messageCount: number; Number of messages in history
memoryEntryCount memoryEntryCount: number; Number of memory entries
metadata? metadata?: ContextSessionMetadata; Optional metadata

EvidenceStorageOptions interface

📍 src/infrastructure/storage/EvidenceStorage.ts:7

Properties
Property Type Description
scope scope: EvidenceScope; -
maxRecordBytes? maxRecordBytes?: number; Defaults: record 4 MiB, scope 64 MiB / 1000 records; writes fail at capacity.
maxTotalBytes? maxTotalBytes?: number; -
maxRecords? maxRecords?: number; -
maxReadChars? maxReadChars?: number; Defaults: 8192 characters per chunk, 8 simultaneous reads. Busy reads fail.
maxConcurrentReads? maxConcurrentReads?: number; -
maxPendingWrites? maxPendingWrites?: number; Bound queued mutations in this process, default 32.

FileAgentDefinitionStorageConfig interface

📍 src/infrastructure/storage/FileAgentDefinitionStorage.ts:32

Configuration for FileAgentDefinitionStorage

Properties
Property Type Description
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/agents)
prettyPrint? prettyPrint?: boolean; Pretty-print JSON (default: true)

FileConnectorStorageConfig interface

📍 src/connectors/storage/FileConnectorStorage.ts:20

Properties
Property Type Description
directory directory: string; Directory to store connector files

FileContextStorageConfig interface

📍 src/infrastructure/storage/FileContextStorage.ts:35

Configuration for FileContextStorage

Properties
Property Type Description
agentId agentId: string; Agent ID (used to create unique storage path)
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/agents)
prettyPrint? prettyPrint?: boolean; Pretty-print JSON (default: true for debugging, false in production)

FileCorrelationStorageConfig interface

📍 src/infrastructure/storage/FileCorrelationStorage.ts:27

Configuration for FileCorrelationStorage

Properties
Property Type Description
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/correlations)

FileCustomToolStorageConfig interface

📍 src/infrastructure/storage/FileCustomToolStorage.ts:26

Configuration for FileCustomToolStorage

Properties
Property Type Description
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/users)
prettyPrint? prettyPrint?: boolean; Pretty-print JSON (default: true)

FileEvidenceStorageOptions interface

📍 src/infrastructure/storage/EvidenceStorage.ts:19

Properties
Property Type Description
directory directory: string; -
durability? `durability?: 'restart' 'fsync';`

FileMediaStorageConfig interface

📍 src/infrastructure/storage/FileMediaStorage.ts:42

Properties
Property Type Description
outputDir? outputDir?: string; Directory to store media files. Defaults to os.tmpdir()/oneringai-media/

FilePersistentInstructionsStorageConfig interface

📍 src/infrastructure/storage/FilePersistentInstructionsStorage.ts:25

Configuration for FilePersistentInstructionsStorage

Properties
Property Type Description
agentId agentId: string; Agent ID (used to create unique storage path)
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/agents)
filename? filename?: string; Override the filename (default: custom_instructions.json)

FileRoutineDefinitionStorageConfig interface

📍 src/infrastructure/storage/FileRoutineDefinitionStorage.ts:27

Configuration for FileRoutineDefinitionStorage

Properties
Property Type Description
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/users)
prettyPrint? prettyPrint?: boolean; Pretty-print JSON (default: true)

FileRoutineExecutionStorageConfig interface

📍 src/infrastructure/storage/FileRoutineExecutionStorage.ts:33

Configuration for FileRoutineExecutionStorage

Properties
Property Type Description
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/users)
prettyPrint? prettyPrint?: boolean; Pretty-print JSON (default: true)
maxRecords? maxRecords?: number; Maximum number of execution records per user (default: 100). Oldest completed/failed are pruned on insert.

FileStorageConfig interface

📍 src/connectors/oauth/infrastructure/storage/FileStorage.ts:17

Properties
Property Type Description
directory directory: string; -
encryptionKey encryptionKey: string; -

FileUserInfoStorageConfig interface

📍 src/infrastructure/storage/FileUserInfoStorage.ts:25

Configuration for FileUserInfoStorage

Properties
Property Type Description
baseDirectory? baseDirectory?: string; Override the base directory (default: ~/.oneringai/users)
filename? filename?: string; Override the filename (default: user_info.json)

GoogleLiveSessionOptions interface

📍 src/capabilities/google/GoogleLiveSession.ts:10

Properties
Property Type Description
connector `connector: string Connector;`
model model: string; -
config? config?: LiveConnectConfig; -

GrokRealtimeSessionConfig interface

📍 src/capabilities/voice/openai/RealtimeTypes.ts:150

xAI-specific session type used by GrokRealtimeSession.

Properties
Property Type Description
audio? `audio?: {
input?: Omit<RealtimeAudioInput, 'format'> & { format?: GrokRealtimeAudioFormat };
output?: Omit<RealtimeAudioOutput, 'format'> & { format?: GrokRealtimeAudioFormat };

};` | - |


GrokRealtimeSessionOptions interface

📍 src/capabilities/voice/grok/GrokRealtimeSession.ts:8

xAI Voice Agent WebSocket options with xAI's provider-specific audio rates.

Properties
Property Type Description
session? session?: GrokRealtimeSessionConfig; -

IAgentStorage interface

📍 src/infrastructure/storage/InMemoryStorage.ts:182

Unified agent storage interface

Properties
Property Type Description
memory memory: IMemoryStorage; -
plan plan: IPlanStorage; -
agent agent: IAgentStateStorage; -

OpenAILiveSessionOptions interface

📍 src/capabilities/openai/OpenAILiveSession.ts:9

Properties
Property Type Description
connector `connector: string Connector;`
reconnect? `reconnect?: LiveWSReconnectOptions null;`
maxQueueSize? maxQueueSize?: number; -
connectTimeoutMs? connectTimeoutMs?: number; -

OpenAIRealtimeAgentSessionEvents interface

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:86

Properties
Property Type Description
event event: (event: OpenAIRealtimeServerEvent) => void; -
audio audio: (audio: Buffer) => void; -
'transcript:input' 'transcript:input': (transcript: string) => void; -
'transcript:output' 'transcript:output': (transcript: string) => void; -
'tool:start' 'tool:start': (call: { callId: string; name: string }) => void; -
'tool:complete' 'tool:complete': (result: ToolResult) => void; -
'mcp:approval' `'mcp:approval': (
request: OpenAIRealtimeMCPApprovalRequest,
decision: OpenAIRealtimeMCPApprovalDecision,

) => void;| - | |'mcp:tools'|'mcp:tools': (event: OpenAIRealtimeServerEvent) => void;| - | |'mcp:call'|'mcp:call': (event: OpenAIRealtimeServerEvent) => void;| - | |usage|usage: (usage: OpenAIRealtimeAgentUsage) => void;| - | |'rate_limits'|'rate_limits': (rateLimits: unknown) => void;| - | |'session:expiring'|'session:expiring': () => void;| - | |backpressure|backpressure: (info: { bufferedAmount: number; limit: number }) => void;| - | |error|error: (error: Error) => void;| - | |close|close: (code: number, reason: string) => void;` | - |


OpenAIRealtimeAgentSessionOptions interface

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:48

Properties
Property Type Description
agent agent: Agent; -
callId? callId?: string; Existing WebRTC/SIP call to join through the default server-side WebSocket transport.
session? `session?: Omit<OpenAIRealtimeSessionConfig, 'type' 'model'>;`
transport? transport?: OpenAIRealtimeAgentTransport; Custom transport for WebRTC/SIP bridges and tests. Defaults to the connector-first WebSocket transport.
realtimeSessionFactory? `realtimeSessionFactory?: (
options: ConstructorParameters&lt;typeof OpenAIRealtimeSession&gt;[0],

) => OpenAIRealtimeSession;| Factory used when a custom WebSocket implementation is required. | |safetyIdentifier?|safetyIdentifier?: string;| - | |contextSync?|contextSync?: 'per_turn' | 'initial';|per_turnrefreshes plugin/memory instructions before every model response and therefore manages response.create itself.initialkeeps server VAD's automatic response behavior. Default:per_turn. | | approveMCP?|approveMCP?: ( request: OpenAIRealtimeMCPApprovalRequest, ) => Promise<OpenAIRealtimeMCPApprovalDecision> | OpenAIRealtimeMCPApprovalDecision;| Called for provider-hosted MCP tools. Missing handlers reject approval requests. | |sessionExpiryWarningMs?|sessionExpiryWarningMs?: number;| Emit session:expiring before OpenAI's hard 60-minute limit. Default: 55 minutes. | |sessionUpdateTimeoutMs?|sessionUpdateTimeoutMs?: number;| Maximum time to wait for OpenAI to acknowledge a session update. Default: 10 seconds. | |toolDrainTimeoutMs?|toolDrainTimeoutMs?: number;` | Maximum time to drain active local tools during shutdown. Default: 5 seconds. |


OpenAIRealtimeAgentTransport interface

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:19

Transport contract implemented by WebSocket, WebRTC data-channel, and SIP control adapters.

Methods

connect()?

typescript
connect?(options?: { signal?: AbortSignal }): Promise&lt;OpenAIRealtimeServerEvent&gt;;

Parameters:

  • options: { signal?: AbortSignal | undefined; } | undefined (optional)

Returns: Promise&lt;OpenAIRealtimeServerEvent&gt;

updateSession()?

typescript
updateSession?(session: OpenAIRealtimeSessionConfig): void;

Parameters:

  • session: OpenAIRealtimeSessionConfig

Returns: void

appendAudio()?

typescript
appendAudio?(audio: Buffer | string): boolean;

Parameters:

  • audio: string | Buffer&lt;ArrayBufferLike&gt;

Returns: boolean

send()

typescript
send(event: OpenAIRealtimeClientEvent): void;

Parameters:

  • event: OpenAIRealtimeClientEvent

Returns: void

close()

typescript
close(code?: number, reason?: string): void;

Parameters:

  • code: number | undefined (optional)
  • reason: string | undefined (optional)

Returns: void

on()

typescript
on(event: 'event', handler: (event: OpenAIRealtimeServerEvent) =&gt; void): unknown;

Parameters:

  • event: "event"
  • handler: (event: OpenAIRealtimeServerEvent) =&gt; void

Returns: unknown

on()

typescript
on(event: 'audio', handler: (audio: Buffer) =&gt; void): unknown;

Parameters:

  • event: "audio"
  • handler: (audio: Buffer&lt;ArrayBufferLike&gt;) =&gt; void

Returns: unknown

on()

typescript
on(event: 'error', handler: (error: Error) =&gt; void): unknown;

Parameters:

  • event: "error"
  • handler: (error: Error) =&gt; void

Returns: unknown

on()

typescript
on(event: 'close', handler: (code: number, reason: string) =&gt; void): unknown;

Parameters:

  • event: "close"
  • handler: (code: number, reason: string) =&gt; void

Returns: unknown

on()

typescript
on(event: 'backpressure', handler: (info: { bufferedAmount: number; limit: number }) =&gt; void): unknown;

Parameters:

  • event: "backpressure"
  • handler: (info: { bufferedAmount: number; limit: number; }) =&gt; void

Returns: unknown

off()?

typescript
off?(event: string, handler: (...args: any[]) =&gt; void): unknown;

Parameters:

  • event: string
  • handler: (...args: any[]) =&gt; void

Returns: unknown

Properties
Property Type Description
isConnected readonly isConnected: boolean; -
emitsOutputAudioFromEvents? readonly emitsOutputAudioFromEvents?: boolean; Set when the transport already converts JSON output-audio events to audio.

OpenAIRealtimeAgentUsage interface

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:79

Properties
Property Type Description
input_audio_tokens input_audio_tokens: number; -
output_audio_tokens output_audio_tokens: number; -
input_text_tokens input_text_tokens: number; -
output_text_tokens output_text_tokens: number; -

OpenAIRealtimeConnectOptions interface

📍 src/capabilities/voice/openai/OpenAIRealtimeSession.ts:51

Properties
Property Type Description
signal? signal?: AbortSignal; -

OpenAIRealtimeMCPApprovalDecision interface

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:43

Properties
Property Type Description
approve approve: boolean; -
reason? reason?: string; -

OpenAIRealtimeMCPApprovalRequest interface

📍 src/capabilities/voice/openai/OpenAIRealtimeAgentSession.ts:36

Properties
Property Type Description
id id: string; -
serverLabel? serverLabel?: string; -
name name: string; -
arguments arguments: string; -

OpenAIRealtimeSessionConfig interface

📍 src/capabilities/voice/openai/RealtimeTypes.ts:101

Properties
Property Type Description
type? type?: 'realtime'; -
model? model?: OpenAIRealtimeModel; -
instructions? instructions?: string; -
output_modalities? `output_modalities?: Array<'audio' 'text'>;`
max_output_tokens? `max_output_tokens?: number 'inf';`
parallel_tool_calls? parallel_tool_calls?: boolean; -
reasoning? `reasoning?: { effort?: 'none' 'minimal'
voice? `voice?: OpenAIRealtimeVoice { id: string };`
turn_detection? turn_detection?: OpenAIRealtimeTurnDetection; xAI-compatible top-level turn detection selector.
resumption? resumption?: { enabled: boolean }; xAI conversation resumption (30-minute inactivity window).
include? include?: Array&lt;'item.input_audio_transcription.logprobs'&gt;; -
prompt? `prompt?: { id: string; version?: string; variables?: Record<string, string> } null;`
tool_choice? `tool_choice?: 'none' 'auto'
tools? tools?: OpenAIRealtimeTool[]; -
tracing? `tracing?: 'auto' OpenAIRealtimeTracing
truncation? `truncation?: 'auto' 'disabled'
audio? `audio?: {
input?: {
  format?: OpenAIRealtimeAudioFormat;
  transport?: 'json' | 'binary';
  noise_reduction?: { type: 'near_field' | 'far_field' } | null;
  transcription?: {
    model?: string;
    language?: string;
    /** xAI speech-to-speech transcription language hint. */
    language_hint?: string;
    /** xAI speech-to-speech transcription vocabulary hints. */
    keyterms?: string[];
    prompt?: string;
  } | null;
  turn_detection?: OpenAIRealtimeTurnDetection;
};
output?: {
  format?: OpenAIRealtimeAudioFormat;
  transport?: 'json' | 'binary';
  voice?: OpenAIRealtimeVoice | { id: string };
  speed?: number;
};

};` | - |


OpenAIRealtimeSessionEvents interface

📍 src/capabilities/voice/openai/OpenAIRealtimeSession.ts:55

Properties
Property Type Description
event event: (event: OpenAIRealtimeServerEvent) =&gt; void; -
audio audio: (audio: Buffer) =&gt; void; Raw assistant audio when xAI binary output transport is enabled.
error error: (error: Error) =&gt; void; -
close close: (code: number, reason: string) =&gt; void; -
backpressure backpressure: (info: { bufferedAmount: number; limit: number }) =&gt; void; -

OpenAIRealtimeSessionOptions interface

📍 src/capabilities/voice/openai/OpenAIRealtimeSession.ts:24

Properties
Property Type Description
connector `connector: string Connector;`
model? model?: OpenAIRealtimeModel; -
endpoint? `endpoint?: 'realtime' 'realtime/translations';`
callId? callId?: string; Existing OpenAI/xAI Realtime call to join over a server sideband connection.
conversationId? conversationId?: string; xAI conversation ID to resume after reconnecting.
reasoningEffort? `reasoningEffort?: 'none' 'high';`
session? `session?: OpenAIRealtimeSessionConfig
| OpenAIRealtimeTranscriptionSessionConfig
| OpenAIRealtimeTranslationSessionConfig;` | - |

| safetyIdentifier? | safetyIdentifier?: string; | Stable, privacy-preserving end-user identifier sent as a header. | | headers? | headers?: Record&lt;string, string&gt;; | - | | connectTimeoutMs? | connectTimeoutMs?: number; | - | | maxBufferedAmountBytes? | maxBufferedAmountBytes?: number; | Stop accepting audio frames when WebSocket buffering exceeds this size. Default: 1 MiB. Set 0 to disable. | | webSocketFactory? | webSocketFactory?: ( url: string, options: { headers: Record&lt;string, string&gt;; signal: AbortSignal }, ) =&gt; Promise&lt;WebSocketLike&gt; | WebSocketLike; | Test/custom-runtime hook. Normal callers should leave this unset. |


OpenAIRealtimeTranscriptionSessionConfig interface

📍 src/capabilities/voice/openai/RealtimeTypes.ts:178

Properties
Property Type Description
type type: 'transcription'; -
audio? `audio?: {
input?: {
  format?: OpenAIRealtimeAudioFormat;
  noise_reduction?: { type: 'near_field' | 'far_field' } | null;
  transcription?: {
    model?: 'gpt-live-transcribe' | 'gpt-transcribe' | (string & {});
    language?: string;
    languages?: string[];
    prompt?: string;
    keywords?: string[];
    delay?: 'low' | 'medium' | 'high' | (string & {});
  };
  turn_detection?: OpenAIRealtimeTurnDetection;
};

};| - | |include?|include?: Array<'item.input_audio_transcription.logprobs'>;` | - |


OpenAIRealtimeTranslationClientSessionConfig interface

📍 src/capabilities/voice/openai/RealtimeTypes.ts:207

Translation configuration accepted when minting a WebRTC client secret.

Properties
Property Type Description
model `model: 'gpt-realtime-translate' (string & {});`

OpenAIRealtimeTranslationSessionConfig interface

📍 src/capabilities/voice/openai/RealtimeTypes.ts:198

Properties
Property Type Description
audio `audio: {
output: {
  language: string;
};

};` | - |


OpenAIResponseSteerMessage interface

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:59

One user message accepted by the Responses mid-turn steering protocol.

Properties
Property Type Description
type? type?: 'message'; -
role role: 'user'; -
content `content: string ResponsesAPI.ResponseSteerInputContent[];`

OpenAIResponsesWebSocketSessionEvents interface

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:73

Properties
Property Type Description
event event: (event: ResponsesAPI.ResponsesServerEvent) =&gt; void; -
error error: (error: Error) =&gt; void; -
close close: (code: number, reason: string, unsent: ResponsesUnsentMessage[]) =&gt; void; -
reconnecting reconnecting: (event: ResponsesReconnectingEvent) =&gt; void; -
reconnected reconnected: () =&gt; void; -

OpenAIResponsesWebSocketSessionOptions interface

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:32

Properties
Property Type Description
connector `connector: string Connector;`
headers? headers?: Record&lt;string, string&gt;; -
connectTimeoutMs? connectTimeoutMs?: number; -
reconnect? `reconnect?: ResponsesWSReconnectOptions null;`
maxQueueSize? maxQueueSize?: number; -
transportFactory? `transportFactory?: (
client: OpenAI,
options: {
  headers?: Record&lt;string, string&gt;;
  reconnect?: ResponsesWSReconnectOptions | null;
  maxQueueSize?: number;
},

) => OpenAIResponsesWebSocketTransport;` | Test/custom-runtime hook. Normal Node callers should leave this unset. |


OpenAIResponsesWebSocketTransport interface

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:24

Methods

on()

typescript
on(event: string, listener: (...args: any[]) =&gt; void): unknown;

Parameters:

  • event: string
  • listener: (...args: any[]) =&gt; void

Returns: unknown

send()

typescript
send(event: ResponsesAPI.ResponsesClientEvent): void;

Parameters:

  • event: ResponsesClientEvent

Returns: void

stream()

typescript
stream(): AsyncIterableIterator&lt;ResponsesStreamMessage&gt;;

Returns: AsyncIterableIterator&lt;ResponsesStreamMessage&gt;

close()

typescript
close(props?: { code: number; reason: string }): void;

Parameters:

  • props: { code: number; reason: string; } | undefined (optional)

Returns: void

Properties
Property Type Description
socket readonly socket: WebSocketLike; -

RemoteOutcomeSession interface

📍 src/portable/outcomeTypes.ts:121

Methods

inspect()

Pure bounded detached metadata. No model, service, backend or receipt lookup.

typescript
inspect(operationId?: string): ReadonlyArray&lt;Readonly&lt;RemoteOutcomeReport&gt;&gt;;

Parameters:

  • operationId: string | undefined (optional)

Returns: readonly Readonly&lt;RemoteOutcomeReport&gt;[]

getReceipt()

typescript
getReceipt(operationId: string, options?: { signal?: AbortSignal }): Promise&lt;RemoteOutcomeReport&gt;;

Parameters:

  • operationId: string
  • options: { signal?: AbortSignal | undefined; } | undefined (optional)

Returns: Promise&lt;RemoteOutcomeReport&gt;

cancel()

typescript
cancel(operationId: string, options?: { signal?: AbortSignal; reason?: string }): Promise&lt;RemoteOutcomeReport&gt;;

Parameters:

  • operationId: string
  • options: { signal?: AbortSignal | undefined; reason?: string | undefined; } | undefined (optional)

Returns: Promise&lt;RemoteOutcomeReport&gt;

readEvidence()

typescript
readEvidence(reference: EvidenceReference, options?: { offset?: number; limit?: number; signal?: AbortSignal }): Promise&lt;EvidenceChunk | null&gt;;

Parameters:

  • reference: EvidenceReference
  • options: { offset?: number | undefined; limit?: number | undefined; signal?: AbortSignal | undefined; } | undefined (optional)

Returns: Promise&lt;EvidenceChunk | null&gt;

checkpoint()

New envelope; does not serialize callbacks, live task authority or a workflow cursor.

typescript
checkpoint(options?: ExportAgentPackageOptions): OutcomeAgentPackage;

Parameters:

  • options: ExportAgentPackageOptions | undefined (optional)

Returns: OutcomeAgentPackage

checkpoint()

Tools-first construction supplies its owning Agent explicitly.

typescript
checkpoint(agent: Agent, options?: ExportAgentPackageOptions): OutcomeAgentPackage;

Parameters:

  • agent: Agent
  • options: ExportAgentPackageOptions | undefined (optional)

Returns: OutcomeAgentPackage

close()

typescript
close(): void;

Returns: void


SessionIngestorPluginConfig interface

📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:51

Properties
Property Type Description
memory memory: MemorySystem; Live memory system. REQUIRED.
agentId agentId: string; Agent id. REQUIRED.
userId userId: string; Current user id. REQUIRED (owner invariant).
groupId? groupId?: string; Optional trusted group id from host auth. Stamped on written facts.
connectorName connectorName: string; Connector name used for BOTH the extraction call and the details-merge
call. REQUIRED — no default. The host typically wires a cheaper model
(Haiku / gpt-5-mini) here rather than reusing the main agent's connector.
model model: string; Model id on the connector. REQUIRED — no default.
diligence? diligence?: SessionIngestorDiligence; Extraction thoroughness. Default 'normal'.
  • 'minimal' — only facts the user stated EXPLICITLY. No inference.
  • 'normal' — standard guidelines (skip greetings, tool plumbing).
  • 'thorough' — capture tentative inferences too (with confidence < 0.7). | | temperature? | temperature?: number; | Sampling temp for the extractor/merger agent. Default 0.2. | | maxOutputTokens? | maxOutputTokens?: number; | Max output tokens per LLM call. Default: undefined — the provider uses the model's own ceiling, which is always the maximum the model can emit. Set explicitly only when cost control on ambient extraction matters more than extraction completeness. See feedback_no_output_limits.md. | | maxTranscriptChars? | maxTranscriptChars?: number; | Maximum characters of transcript sent to the extractor per run. When the backlog exceeds this, older messages are deferred to subsequent hook invocations (not lost — the watermark stays at the last message that fit). Default 1_000_000 (≈ 250 K tokens at 4 chars/token) — fits every current cheap-tier extractor model (Haiku 4.5 / gpt-5-mini / Gemini 2.5 Flash) with substantial headroom. The default is deliberately high so the "defer to next turn" path is a safety net, not a daily occurrence. | | minBatchMessages? | minBatchMessages?: number; | Minimum number of conversation messages (flat count, not user/assistant pairs) that must have accumulated since the last successful ingest for a natural `onBeforePrepare` trigger to fire. Below this threshold the hook short-circuits and defers to the next turn.

Default: 6 (≈ 3 user/assistant pairs). Set to 1 for per-turn ingest.

For guaranteed final ingest at session end, call `await plugin.flush()` before `plugin.destroy()` — `flush` ignores this threshold. | | forbiddenEntityTypes? | forbiddenEntityTypes?: ReadonlyArray&lt;string&gt;; | Entity types this ambient extractor must NEVER mint. When set, the extraction prompt marks those types as host-managed, and mentions of those types are resolved read-only at write time. If no existing entity resolves, the mention stays unresolved and no entity is created. For host- deterministic types — e.g. ICOS populates event exclusively from the calendar pipeline, so chat extraction may reference existing events but must not create them. Omit for no restriction. |


SessionRef interface

📍 src/domain/interfaces/ICorrelationStorage.ts:34

ICorrelationStorage - Maps external event IDs to suspended agent sessions

When an agent suspends (via SuspendSignal), a correlation entry is saved linking the external event identifier (e.g., email message ID, ticket ID) to the agent session. When the external event arrives (webhook, reply, etc.), the app resolves the correlation to find which session to resume.

Default implementation: FileCorrelationStorage (~/.oneringai/correlations/)

Example:

typescript
// Save correlation when agent suspends
await correlationStorage.save('email:msg_123', {
  agentId: 'my-agent',
  sessionId: 'session-456',
  suspendedAt: new Date().toISOString(),
  expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
  resumeAs: 'user_message',
});

// Resolve when external event arrives
const ref = await correlationStorage.resolve('email:msg_123');
if (ref) {
  const agent = await Agent.hydrate(ref.sessionId, { agentId: ref.agentId });
  await agent.run(userReply);
}
Properties
Property Type Description
agentId agentId: string; Agent identifier (used to load agent definition)
sessionId sessionId: string; Session identifier (used to load conversation + plugin state)
suspendedAt suspendedAt: string; ISO timestamp when the session was suspended
expiresAt expiresAt: string; ISO timestamp when this correlation expires
resumeAs `resumeAs: 'user_message' 'tool_result';`
  • 'user_message': as a new user message (default)
  • 'tool_result': as a tool result | | metadata? | metadata?: Record&lt;string, unknown&gt;; | Application-specific metadata from the SuspendSignal |

StoredContextSession interface

📍 src/domain/interfaces/IContextStorage.ts:84

Full session state wrapper (includes metadata)

Properties
Property Type Description
version version: number; Format version for migration support
sessionId sessionId: string; Session identifier
createdAt createdAt: string; When the session was created
lastSavedAt lastSavedAt: string; When the session was last saved
state state: SerializedContextState; The serialized AgentContext state
metadata metadata: ContextSessionMetadata; Session metadata

VoiceSessionEvents interface

📍 src/capabilities/voice/VoiceSession.ts:30

Properties
Property Type Description
'state:change' 'state:change': (prev: SessionState, next: SessionState, info: VoiceSessionInfo) =&gt; void; -
'ended' 'ended': (summary: CallSummary) =&gt; void; -
'error' 'error': (error: Error) =&gt; void; -

VoiceSessionInfo interface

📍 src/capabilities/voice/types.ts:107

Read-only snapshot of a voice session's state. Exposed to lifecycle hooks and event handlers.

Properties
Property Type Description
sessionId sessionId: string; Unique session identifier
callId callId: string; Adapter-specific call identifier (e.g., Twilio CallSid)
direction direction: CallDirection; Whether this is an inbound or outbound call
from from: string; Caller identifier (phone number, SIP URI, etc.)
to to: string; Called identifier
state state: SessionState; Current session state
startedAt startedAt: Date; When the call was initiated
endedAt? endedAt?: Date; When the call ended (undefined if still active)
turns turns: number; Number of conversation turns completed
metadata metadata: Record&lt;string, unknown&gt;; Adapter-specific metadata (e.g., Twilio AccountSid, geographic info)

OpenAIResponsesCreateEventOptions type

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:49

typescript
type OpenAIResponsesCreateEventOptions = Omit&lt;
  ResponsesAPI.ResponsesClientEvent.ResponseCreate,
  'type' | 'model' | 'input' | 'tools' | 'stream' | 'background'
&gt; & {
  model: string;
  input: string | InputItem[];
  tools?: Tool[];
}

ResponseSteerInput type

📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:69

Mid-turn steering accepts a string or a non-empty list of user messages. Tool results and general Responses input items are intentionally excluded.

typescript
type ResponseSteerInput = | string
  | [OpenAIResponseSteerMessage, ...OpenAIResponseSteerMessage[]]

SessionIngestorDiligence type

📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:49

typescript
type SessionIngestorDiligence = 'minimal' | 'normal' | 'thorough'

SessionState type

📍 src/capabilities/voice/types.ts:89

typescript
type SessionState = | 'idle'        // Created, not yet connected
  | 'ringing'     // Inbound call received, not yet answered
  | 'connected'   // Call active, initial state
  | 'listening'   // Agent waiting for caller to speak
  | 'processing'  // STT complete, agent thinking
  | 'speaking'    // Agent TTS playing to caller
  | 'ending'      // Hangup initiated
  | 'ended'

createAgentStorage function

📍 src/infrastructure/storage/InMemoryStorage.ts:191

Create agent storage with defaults

typescript
export function createAgentStorage(options: {
  memory?: IMemoryStorage;
  plan?: IPlanStorage;
  agent?: IAgentStateStorage;
} = {}): IAgentStorage

createFileAgentDefinitionStorage function

📍 src/infrastructure/storage/FileAgentDefinitionStorage.ts:384

Create a FileAgentDefinitionStorage with default configuration

typescript
export function createFileAgentDefinitionStorage(
  config?: FileAgentDefinitionStorageConfig
): FileAgentDefinitionStorage

createFileContextStorage function

📍 src/infrastructure/storage/FileContextStorage.ts:536

Create a FileContextStorage for the given agent

typescript
export function createFileContextStorage(
  agentId: string,
  options?: Omit&lt;FileContextStorageConfig, 'agentId'&gt;
): FileContextStorage

Example:

typescript
const storage = createFileContextStorage('my-agent');
const ctx = AgentContext.create({
  model: 'gpt-4',
  storage,
});

// Save session
await ctx.save('session-001', { title: 'My Session' });

// Load session
await ctx.load('session-001');

createFileCorrelationStorage function

📍 src/infrastructure/storage/FileCorrelationStorage.ts:195

Create a FileCorrelationStorage with default settings

typescript
export function createFileCorrelationStorage(config?: FileCorrelationStorageConfig): FileCorrelationStorage

createFileCustomToolStorage function

📍 src/infrastructure/storage/FileCustomToolStorage.ts:357

Create a FileCustomToolStorage with default configuration

typescript
export function createFileCustomToolStorage(
  config?: FileCustomToolStorageConfig
): FileCustomToolStorage

createFileMediaStorage function

📍 src/infrastructure/storage/FileMediaStorage.ts:178

Factory function for creating FileMediaStorage instances

typescript
export function createFileMediaStorage(config?: FileMediaStorageConfig): FileMediaStorage

createFileRoutineDefinitionStorage function

📍 src/infrastructure/storage/FileRoutineDefinitionStorage.ts:370

Create a FileRoutineDefinitionStorage with default configuration

typescript
export function createFileRoutineDefinitionStorage(
  config?: FileRoutineDefinitionStorageConfig
): FileRoutineDefinitionStorage

createFileRoutineExecutionStorage function

📍 src/infrastructure/storage/FileRoutineExecutionStorage.ts:506

Create a FileRoutineExecutionStorage with default configuration

typescript
export function createFileRoutineExecutionStorage(
  config?: FileRoutineExecutionStorageConfig
): FileRoutineExecutionStorage

toDate function

📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:888

typescript
function toDate(v: string | Date | undefined): Date | undefined

Documentation snapshot · 2026-11-02Suggest a correction ↗

Search documentation

Type to search the v2 documentation.