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:
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
constructor(
private storage: IConnectorConfigStorage,
private encryptionKey: string
)
Parameters:
storage:IConnectorConfigStorageencryptionKey:string
Static Methods
static create()
Factory that resolves storage from StorageRegistry when no explicit storage is provided.
static create(encryptionKey: string, storage?: IConnectorConfigStorage): ConnectorConfigStore
Parameters:
encryptionKey:stringstorage:IConnectorConfigStorage | undefined(optional)
Returns: ConnectorConfigStore
Methods
save()
Save a connector configuration (secrets are encrypted automatically)
async save(name: string, config: ConnectorConfig): Promise<void>
Parameters:
name:stringconfig:ConnectorConfig
Returns: Promise<void>
get()
Retrieve a connector configuration (secrets are decrypted automatically)
async get(name: string): Promise<ConnectorConfig | null>
Parameters:
name:string
Returns: Promise<ConnectorConfig | null>
delete()
Delete a connector configuration
async delete(name: string): Promise<boolean>
Parameters:
name:string
Returns: Promise<boolean>
has()
Check if a connector configuration exists
async has(name: string): Promise<boolean>
Parameters:
name:string
Returns: Promise<boolean>
list()
List all connector names
async list(): Promise<string[]>
Returns: Promise<string[]>
listAll()
Get all connector configurations (secrets are decrypted automatically)
async listAll(): Promise<ConnectorConfig[]>
Returns: Promise<ConnectorConfig[]>
getMetadata()
Get stored metadata for a connector
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.
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:stringvendorId:stringauthTemplateId:stringcredentials:TemplateCredentialsoptions:{ 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.
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:stringvendorId:stringauthTemplateId:stringcredentials:TemplateCredentialsoptions:{ 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
constructor(config: FileAgentDefinitionStorageConfig = {})
Parameters:
config:FileAgentDefinitionStorageConfig(optional) (default:{})
Methods
save()
Save an agent definition
async save(definition: StoredAgentDefinition): Promise<void>
Parameters:
definition:StoredAgentDefinition
Returns: Promise<void>
load()
Load an agent definition
async load(agentId: string): Promise<StoredAgentDefinition | null>
Parameters:
agentId:string
Returns: Promise<StoredAgentDefinition | null>
delete()
Delete an agent definition
async delete(agentId: string): Promise<void>
Parameters:
agentId:string
Returns: Promise<void>
exists()
Check if an agent definition exists
async exists(agentId: string): Promise<boolean>
Parameters:
agentId:string
Returns: Promise<boolean>
list()
List all agent definitions
async list(options?: AgentDefinitionListOptions): Promise<AgentDefinitionSummary[]>
Parameters:
options:AgentDefinitionListOptions | undefined(optional)
Returns: Promise<AgentDefinitionSummary[]>
updateMetadata()
Update metadata without loading full definition
async updateMetadata(
agentId: string,
metadata: Partial<AgentDefinitionMetadata>
): Promise<void>
Parameters:
agentId:stringmetadata:Partial<AgentDefinitionMetadata>
Returns: Promise<void>
getPath()
Get storage path
getPath(): string
Returns: string
rebuildIndex()
Rebuild the index by scanning all agent directories
async rebuildIndex(): Promise<void>
Returns: Promise<void>
FileConnectorStorage class
📍 src/connectors/storage/FileConnectorStorage.ts:30
Constructor
constructor
constructor(config: FileConnectorStorageConfig)
Parameters:
config:FileConnectorStorageConfig
Methods
save()
async save(name: string, stored: StoredConnectorConfig): Promise<void>
Parameters:
name:stringstored:StoredConnectorConfig
Returns: Promise<void>
get()
async get(name: string): Promise<StoredConnectorConfig | null>
Parameters:
name:string
Returns: Promise<StoredConnectorConfig | null>
delete()
async delete(name: string): Promise<boolean>
Parameters:
name:string
Returns: Promise<boolean>
has()
async has(name: string): Promise<boolean>
Parameters:
name:string
Returns: Promise<boolean>
list()
async list(): Promise<string[]>
Returns: Promise<string[]>
listAll()
async listAll(): Promise<StoredConnectorConfig[]>
Returns: Promise<StoredConnectorConfig[]>
clear()
Clear all stored configs (useful for testing)
async clear(): Promise<void>
Returns: Promise<void>
FileContextStorage class
📍 src/infrastructure/storage/FileContextStorage.ts:100
File-based storage for AgentContext session persistence
Constructor
constructor
constructor(config: FileContextStorageConfig)
Parameters:
config:FileContextStorageConfig
Methods
save()
Save context state to a session file
async save(
sessionId: string,
state: SerializedContextState,
metadata?: ContextSessionMetadata
): Promise<void>
Parameters:
sessionId:stringstate:SerializedContextStatemetadata:ContextSessionMetadata | undefined(optional)
Returns: Promise<void>
load()
Load context state from a session file
async load(sessionId: string): Promise<StoredContextSession | null>
Parameters:
sessionId:string
Returns: Promise<StoredContextSession | null>
delete()
Delete a session
async delete(sessionId: string): Promise<void>
Parameters:
sessionId:string
Returns: Promise<void>
exists()
Check if a session exists
async exists(sessionId: string): Promise<boolean>
Parameters:
sessionId:string
Returns: Promise<boolean>
list()
List all sessions (summaries only)
async list(options?: ContextStorageListOptions): Promise<ContextSessionSummary[]>
Parameters:
options:ContextStorageListOptions | undefined(optional)
Returns: Promise<ContextSessionSummary[]>
updateMetadata()
Update session metadata without loading full state
async updateMetadata(
sessionId: string,
metadata: Partial<ContextSessionMetadata>
): Promise<void>
Parameters:
sessionId:stringmetadata:Partial<ContextSessionMetadata>
Returns: Promise<void>
getPath()
Get the storage path (for display/debugging)
getPath(): string
Returns: string
getLocation()
Get a human-readable storage location string (for display/debugging)
getLocation(): string
Returns: string
getAgentId()
Get the agent ID
getAgentId(): string
Returns: string
rebuildIndex()
Rebuild the index by scanning all session files Useful for recovery or migration
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
constructor(config?: FileCorrelationStorageConfig)
Parameters:
config:FileCorrelationStorageConfig | undefined(optional)
Methods
save()
async save(correlationId: string, ref: SessionRef): Promise<void>
Parameters:
correlationId:stringref:SessionRef
Returns: Promise<void>
resolve()
async resolve(correlationId: string): Promise<SessionRef | null>
Parameters:
correlationId:string
Returns: Promise<SessionRef | null>
delete()
async delete(correlationId: string): Promise<void>
Parameters:
correlationId:string
Returns: Promise<void>
exists()
async exists(correlationId: string): Promise<boolean>
Parameters:
correlationId:string
Returns: Promise<boolean>
listBySession()
async listBySession(sessionId: string): Promise<string[]>
Parameters:
sessionId:string
Returns: Promise<string[]>
listByAgent()
async listByAgent(agentId: string): Promise<CorrelationSummary[]>
Parameters:
agentId:string
Returns: Promise<CorrelationSummary[]>
pruneExpired()
async pruneExpired(): Promise<number>
Returns: Promise<number>
getPath()
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
constructor(config: FileCustomToolStorageConfig = {})
Parameters:
config:FileCustomToolStorageConfig(optional) (default:{})
Methods
save()
Save a custom tool definition
async save(userId: string | undefined, definition: CustomToolDefinition): Promise<void>
Parameters:
userId:string | undefineddefinition:CustomToolDefinition
Returns: Promise<void>
load()
Load a custom tool definition by name
async load(userId: string | undefined, name: string): Promise<CustomToolDefinition | null>
Parameters:
userId:string | undefinedname:string
Returns: Promise<CustomToolDefinition | null>
delete()
Delete a custom tool definition
async delete(userId: string | undefined, name: string): Promise<void>
Parameters:
userId:string | undefinedname:string
Returns: Promise<void>
exists()
Check if a custom tool exists
async exists(userId: string | undefined, name: string): Promise<boolean>
Parameters:
userId:string | undefinedname:string
Returns: Promise<boolean>
list()
List custom tools (summaries only)
async list(userId: string | undefined, options?: CustomToolListOptions): Promise<CustomToolSummary[]>
Parameters:
userId:string | undefinedoptions:CustomToolListOptions | undefined(optional)
Returns: Promise<CustomToolSummary[]>
updateMetadata()
Update metadata without loading full definition
async updateMetadata(userId: string | undefined, name: string, metadata: Record<string, unknown>): Promise<void>
Parameters:
userId:string | undefinedname:stringmetadata:Record<string, unknown>
Returns: Promise<void>
getPath()
Get storage path for a specific user
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
constructor(options: FileEvidenceStorageOptions)
Parameters:
options:FileEvidenceStorageOptions
Methods
inventory()
protected async inventory(): Promise<Array<{ id: string; bytes: number }>>
Returns: Promise<{ id: string; bytes: number; }[]>
writeBlob()
protected async writeBlob(id: string, bytes: Buffer): Promise<void>
Parameters:
id:stringbytes:Buffer<ArrayBufferLike>
Returns: Promise<void>
readBlob()
protected async readBlob(id: string): Promise<Buffer | null>
Parameters:
id:string
Returns: Promise<Buffer<ArrayBufferLike> | null>
removeBlob()
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
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.
async append(sessionId: string, entries: HistoryEntry[]): Promise<void>
Parameters:
sessionId:stringentries: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.
async replaceLast(
sessionId: string,
type: HistoryEntryType,
turnIndex: number,
entry: HistoryEntry,
): Promise<boolean>
Parameters:
sessionId:stringtype:HistoryEntryTypeturnIndex:numberentry:HistoryEntry
Returns: Promise<boolean>
read()
Read history entries with optional filtering and pagination.
For large files, prefer stream() with pagination.
async read(sessionId: string, options?: HistoryReadOptions): Promise<HistoryEntry[]>
Parameters:
sessionId:stringoptions:HistoryReadOptions | undefined(optional)
Returns: Promise<HistoryEntry[]>
count()
Count entries without fully parsing the file.
Counts non-empty lines in the JSONL file.
async count(sessionId: string): Promise<number>
Parameters:
sessionId:string
Returns: Promise<number>
clear()
Delete the journal file for a session.
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.
async *stream(sessionId: string, options?: HistoryReadOptions): AsyncIterable<HistoryEntry>
Parameters:
sessionId:stringoptions:HistoryReadOptions | undefined(optional)
Returns: AsyncIterable<HistoryEntry>
getLocation()
Get the file path for a session's journal (for debugging).
getLocation(sessionId: string): string
Parameters:
sessionId:string
Returns: string
FileMediaStorage class
📍 src/infrastructure/storage/FileMediaStorage.ts:47
Constructor
constructor
constructor(config?: FileMediaStorageConfig)
Parameters:
config:FileMediaStorageConfig | undefined(optional)
Methods
save()
async save(data: Buffer, metadata: MediaStorageMetadata): Promise<MediaStorageResult>
Parameters:
data:Buffer<ArrayBufferLike>metadata:MediaStorageMetadata
Returns: Promise<MediaStorageResult>
read()
async read(location: string): Promise<Buffer | null>
Parameters:
location:string
Returns: Promise<Buffer<ArrayBufferLike> | null>
delete()
async delete(location: string): Promise<void>
Parameters:
location:string
Returns: Promise<void>
exists()
async exists(location: string): Promise<boolean>
Parameters:
location:string
Returns: Promise<boolean>
list()
async list(options?: MediaStorageListOptions): Promise<MediaStorageEntry[]>
Parameters:
options:MediaStorageListOptions | undefined(optional)
Returns: Promise<MediaStorageEntry[]>
getPath()
getPath(): string
Returns: string
FilePersistentInstructionsStorage class
📍 src/infrastructure/storage/FilePersistentInstructionsStorage.ts:68
File-based storage for persistent agent instructions
Constructor
constructor
constructor(config: FilePersistentInstructionsStorageConfig)
Parameters:
config:FilePersistentInstructionsStorageConfig
Methods
load()
Load instruction entries from file. Falls back to legacy .md file migration if JSON not found.
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.
async save(entries: InstructionEntry[]): Promise<void>
Parameters:
entries:InstructionEntry[]
Returns: Promise<void>
delete()
Delete instructions file (and legacy .md if exists)
async delete(): Promise<void>
Returns: Promise<void>
exists()
Check if instructions file exists (JSON or legacy .md)
async exists(): Promise<boolean>
Returns: Promise<boolean>
getPath()
Get the file path (for display/debugging)
getPath(): string
Returns: string
getAgentId()
Get the agent ID
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
constructor(config: FileRoutineDefinitionStorageConfig = {})
Parameters:
config:FileRoutineDefinitionStorageConfig(optional) (default:{})
Methods
save()
async save(context: StorageUserContextInput, definition: RoutineDefinition): Promise<void>
Parameters:
context:StorageUserContextInputdefinition:RoutineDefinition
Returns: Promise<void>
load()
async load(context: StorageUserContextInput, id: string): Promise<RoutineDefinition | null>
Parameters:
context:StorageUserContextInputid:string
Returns: Promise<RoutineDefinition | null>
delete()
async delete(context: StorageUserContextInput, id: string): Promise<void>
Parameters:
context:StorageUserContextInputid:string
Returns: Promise<void>
exists()
async exists(context: StorageUserContextInput, id: string): Promise<boolean>
Parameters:
context:StorageUserContextInputid:string
Returns: Promise<boolean>
list()
async list(context: StorageUserContextInput, options?: {
tags?: string[];
search?: string;
limit?: number;
offset?: number;
}): Promise<RoutineSummary[]>
Parameters:
context:StorageUserContextInputoptions:{ tags?: string[] | undefined; search?: string | undefined; limit?: number | undefined; offset?: number | undefined; } | undefined(optional)
Returns: Promise<RoutineSummary[]>
getPath()
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
constructor(config: FileRoutineExecutionStorageConfig = {})
Parameters:
config:FileRoutineExecutionStorageConfig(optional) (default:{})
Methods
insert()
async insert(context: StorageUserContextInput, record: RoutineExecutionRecord): Promise<string>
Parameters:
context:StorageUserContextInputrecord:RoutineExecutionRecord
Returns: Promise<string>
update()
async update(
id: string,
updates: Partial<
Pick<RoutineExecutionRecord, 'status' | 'progress' | 'error' | 'completedAt' | 'lastActivityAt'>
>,
): Promise<void>
Parameters:
id:stringupdates:Partial<Pick<RoutineExecutionRecord, "error" | "status" | "progress" | "completedAt" | "lastActivityAt">>
Returns: Promise<void>
pushStep()
async pushStep(id: string, step: RoutineExecutionStep): Promise<void>
Parameters:
id:stringstep:RoutineExecutionStep
Returns: Promise<void>
updateTask()
async updateTask(id: string, taskName: string, updates: Partial<RoutineTaskSnapshot>): Promise<void>
Parameters:
id:stringtaskName:stringupdates:Partial<RoutineTaskSnapshot>
Returns: Promise<void>
load()
async load(id: string): Promise<RoutineExecutionRecord | null>
Parameters:
id:string
Returns: Promise<RoutineExecutionRecord | null>
list()
async list(
context: StorageUserContextInput,
options?: {
routineId?: string;
status?: RoutineExecutionStatus;
limit?: number;
offset?: number;
},
): Promise<RoutineExecutionRecord[]>
Parameters:
context:StorageUserContextInputoptions:{ routineId?: string | undefined; status?: RoutineExecutionStatus | undefined; limit?: number | undefined; offset?: number | undefined; } | undefined(optional)
Returns: Promise<RoutineExecutionRecord[]>
hasRunning()
async hasRunning(context: StorageUserContextInput, routineId: string): Promise<boolean>
Parameters:
context:StorageUserContextInputroutineId:string
Returns: Promise<boolean>
getPath()
getPath(context: StorageUserContextInput): string
Parameters:
context:StorageUserContextInput
Returns: string
FileStorage class
📍 src/connectors/oauth/infrastructure/storage/FileStorage.ts:22
Constructor
constructor
constructor(config: FileStorageConfig)
Parameters:
config:FileStorageConfig
Methods
storeToken()
async storeToken(key: string, token: StoredToken): Promise<void>
Parameters:
key:stringtoken:StoredToken
Returns: Promise<void>
getToken()
async getToken(key: string): Promise<StoredToken | null>
Parameters:
key:string
Returns: Promise<StoredToken | null>
deleteToken()
async deleteToken(key: string): Promise<void>
Parameters:
key:string
Returns: Promise<void>
hasToken()
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.
async listKeys(): Promise<string[]>
Returns: Promise<string[]>
listTokens()
List all token keys (for debugging)
async listTokens(): Promise<string[]>
Returns: Promise<string[]>
clearAll()
Clear all tokens
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
constructor(config?: FileUserInfoStorageConfig)
Parameters:
config:FileUserInfoStorageConfig | undefined(optional)
Methods
load()
Load user info entries from file for a specific user
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.
async save(userId: string | undefined, entries: UserInfoEntry[]): Promise<void>
Parameters:
userId:string | undefinedentries:UserInfoEntry[]
Returns: Promise<void>
delete()
Delete user info file for a specific user
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
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)
getPath(userId: string | undefined): string
Parameters:
userId:string | undefined
Returns: string
FileUserPermissionRulesStorage class
📍 src/infrastructure/storage/FileUserPermissionRulesStorage.ts:40
Constructor
constructor
constructor(config?: FileUserPermissionRulesStorageConfig)
Parameters:
config:FileUserPermissionRulesStorageConfig | undefined(optional)
Methods
load()
async load(userId: string | undefined): Promise<UserPermissionRule[] | null>
Parameters:
userId:string | undefined
Returns: Promise<UserPermissionRule[] | null>
save()
async save(userId: string | undefined, rules: UserPermissionRule[]): Promise<void>
Parameters:
userId:string | undefinedrules:UserPermissionRule[]
Returns: Promise<void>
delete()
async delete(userId: string | undefined): Promise<void>
Parameters:
userId:string | undefined
Returns: Promise<void>
exists()
async exists(userId: string | undefined): Promise<boolean>
Parameters:
userId:string | undefined
Returns: Promise<boolean>
getPath()
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
constructor(options: GoogleLiveSessionOptions)
Parameters:
options:GoogleLiveSessionOptions
Methods
connect()
async connect(): Promise<void>
Returns: Promise<void>
sendClientContent()
sendClientContent(params: Parameters<Session['sendClientContent']>[0]): void
Parameters:
params:LiveSendClientContentParameters
Returns: void
sendRealtimeInput()
sendRealtimeInput(params: Parameters<Session['sendRealtimeInput']>[0]): void
Parameters:
params:LiveSendRealtimeInputParameters
Returns: void
sendToolResponse()
sendToolResponse(params: Parameters<Session['sendToolResponse']>[0]): void
Parameters:
params:LiveSendToolResponseParameters
Returns: void
close()
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
constructor(options: GrokRealtimeSessionOptions)
Parameters:
options:GrokRealtimeSessionOptions
Methods
updateSession()
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
constructor(options: OpenAILiveSessionOptions)
Parameters:
options:OpenAILiveSessionOptions
Methods
connect()
async connect(session: LiveAPI.SessionConfig): Promise<LiveAPI.SessionResource>
Parameters:
session:SessionConfig
Returns: Promise<SessionResource>
appendAudio()
appendAudio(audio: Buffer | string, eventId?: string): void
Parameters:
audio:string | Buffer<ArrayBufferLike>eventId:string | undefined(optional)
Returns: void
send()
send(event: LiveAPI.ClientEvent): void
Parameters:
event:ClientEvent
Returns: void
events()
events(): AsyncIterableIterator<LiveStreamMessage>
Returns: AsyncIterableIterator<LiveStreamMessage>
close()
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
constructor(options: OpenAIRealtimeAgentSessionOptions)
Parameters:
options:OpenAIRealtimeAgentSessionOptions
Methods
connect()
async connect(options: { signal?: AbortSignal } = {}): Promise<OpenAIRealtimeServerEvent | undefined>
Parameters:
options:{ signal?: AbortSignal | undefined; }(optional) (default:{})
Returns: Promise<OpenAIRealtimeServerEvent | undefined>
appendAudio()
appendAudio(audio: Buffer | string): boolean
Parameters:
audio:string | Buffer<ArrayBufferLike>
Returns: boolean
commitAudio()
commitAudio(): void
Returns: void
clearAudio()
clearAudio(): void
Returns: void
cancelResponse()
cancelResponse(): void
Returns: void
createResponse()
createResponse(response: Record<string, unknown> = {}): void
Parameters:
response:Record<string, unknown>(optional) (default:{})
Returns: void
truncateItem()
truncateItem(itemId: string, audioEndMs: number, contentIndex = 0): void
Parameters:
itemId:stringaudioEndMs:numbercontentIndex:number(optional) (default:0)
Returns: void
sendText()
async sendText(text: string, response: Record<string, unknown> = {}): Promise<void>
Parameters:
text:stringresponse:Record<string, unknown>(optional) (default:{})
Returns: Promise<void>
sendImage()
async sendImage(imageUrl: string, response: Record<string, unknown> = {}): Promise<void>
Parameters:
imageUrl:stringresponse:Record<string, unknown>(optional) (default:{})
Returns: Promise<void>
getUsage()
getUsage(): OpenAIRealtimeAgentUsage
Returns: OpenAIRealtimeAgentUsage
handleServerEvent()
Public for custom transports that cannot expose EventEmitter-style events.
async handleServerEvent(event: OpenAIRealtimeServerEvent): Promise<void>
Parameters:
event:OpenAIRealtimeServerEvent
Returns: Promise<void>
close()
async close(code = 1000, reason = 'OK'): Promise<void>
Parameters:
code:number(optional) (default:1000)reason:string(optional) (default:'OK')
Returns: Promise<void>
on()
on<K extends keyof OpenAIRealtimeAgentSessionEvents>(
event: K,
handler: OpenAIRealtimeAgentSessionEvents[K],
): this
Parameters:
event:Khandler:OpenAIRealtimeAgentSessionEvents[K]
Returns: this
updateSession()
Apply a partial/complete Realtime session update.
updateSession(session: OpenAIRealtimeSessionConfig): void
Parameters:
session:OpenAIRealtimeSessionConfig
Returns: void
send()
Send an advanced Realtime client event through the configured transport.
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
constructor(options: OpenAIRealtimeSessionOptions)
Parameters:
options:OpenAIRealtimeSessionOptions
Methods
connect()
async connect(options: OpenAIRealtimeConnectOptions = {}): Promise<OpenAIRealtimeServerEvent>
Parameters:
options:OpenAIRealtimeConnectOptions(optional) (default:{})
Returns: Promise<OpenAIRealtimeServerEvent>
updateSession()
updateSession(session: NonNullable<OpenAIRealtimeSessionOptions['session']>): void
Parameters:
session:NonNullable<OpenAIRealtimeSessionConfig | OpenAIRealtimeTranscriptionSessionConfig | OpenAIRealtimeTranslationSessionConfig | undefined>
Returns: void
appendAudio()
appendAudio(audio: Buffer | string): boolean
Parameters:
audio:string | Buffer<ArrayBufferLike>
Returns: boolean
commitAudio()
commitAudio(): void
Returns: void
clearAudio()
clearAudio(): void
Returns: void
createResponse()
createResponse(response: Record<string, unknown> = {}): void
Parameters:
response:Record<string, unknown>(optional) (default:{})
Returns: void
cancelResponse()
cancelResponse(): void
Returns: void
closeTranslation()
Flush and close a translation stream after handling session.closed.
closeTranslation(): void
Returns: void
sendText()
sendText(text: string): void
Parameters:
text:string
Returns: void
sendImage()
sendImage(imageUrl: string): void
Parameters:
imageUrl:string
Returns: void
truncateItem()
truncateItem(itemId: string, audioEndMs: number, contentIndex = 0): void
Parameters:
itemId:stringaudioEndMs:numbercontentIndex:number(optional) (default:0)
Returns: void
send()
send(event: OpenAIRealtimeClientEvent): void
Parameters:
event:OpenAIRealtimeClientEvent
Returns: void
close()
close(code = 1000, reason = 'OK'): void
Parameters:
code:number(optional) (default:1000)reason:string(optional) (default:'OK')
Returns: void
on()
on<K extends keyof OpenAIRealtimeSessionEvents>(event: K, handler: OpenAIRealtimeSessionEvents[K]): this
Parameters:
event:Khandler: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
constructor(options: OpenAIResponsesWebSocketSessionOptions)
Parameters:
options:OpenAIResponsesWebSocketSessionOptions
Methods
connect()
async connect(): Promise<void>
Returns: Promise<void>
createResponse()
createResponse(options: OpenAIResponsesCreateEventOptions): void
Parameters:
options:OpenAIResponsesCreateEventOptions
Returns: void
steer()
Queue additional user input for an active Astra response.
steer(previousResponseId: string, input: ResponseSteerInput): void
Parameters:
previousResponseId:stringinput:ResponseSteerInput
Returns: void
send()
Send an advanced SDK-typed Responses WebSocket event.
send(event: ResponsesAPI.ResponsesClientEvent): void
Parameters:
event:ResponsesClientEvent
Returns: void
events()
events(): AsyncIterableIterator<ResponsesStreamMessage>
Returns: AsyncIterableIterator<ResponsesStreamMessage>
close()
close(code = 1000, reason = 'OK'): void
Parameters:
code:number(optional) (default:1000)reason:string(optional) (default:'OK')
Returns: void
on()
override on<K extends keyof OpenAIResponsesWebSocketSessionEvents>(
event: K,
listener: OpenAIResponsesWebSocketSessionEvents[K],
): this
Parameters:
event:Klistener:OpenAIResponsesWebSocketSessionEvents[K]
Returns: this
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
SessionIngestorPluginNextGen class
📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:136
Constructor
constructor
constructor(config: SessionIngestorPluginConfig)
Parameters:
config:SessionIngestorPluginConfig
Methods
getInstructions()
getInstructions(): string | null
Returns: string | null
getContent()
async getContent(): Promise<string | null>
Returns: Promise<string | null>
getContents()
getContents(): unknown
Returns: unknown
getTokenSize()
getTokenSize(): number
Returns: number
getInstructionsTokenSize()
getInstructionsTokenSize(): number
Returns: number
isCompactable()
isCompactable(): boolean
Returns: boolean
compact()
async compact(_targetTokensToFree: number): Promise<number>
Parameters:
_targetTokensToFree:number
Returns: Promise<number>
getTools()
getTools(): ToolFunction[]
Returns: ToolFunction<any, any>[]
destroy()
destroy(): void
Returns: void
getState()
getState(): unknown
Returns: unknown
restoreState()
restoreState(state: unknown): void
Parameters:
state:unknown
Returns: void
onBeforePrepare()
onBeforePrepare(snapshot: PluginPrepareSnapshot): void
Parameters:
snapshot:PluginPrepareSnapshot
Returns: void
waitForIngest()
Await the current in-flight ingestion, if any. Used by tests to deterministically wait.
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.
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.
getLastIngestedMessageId(): string | null
Returns: string | null
isDisabled()
Whether bootstrap encountered a foreign-owned entity and disabled the plugin.
isDisabled(): boolean
Returns: boolean
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "session_ingestor" |
- |
VoiceSession class
📍 src/capabilities/voice/VoiceSession.ts:55
Constructor
constructor
constructor(
callInfo: IncomingCallInfo,
direction: CallDirection = 'inbound',
)
Parameters:
callInfo:IncomingCallInfodirection:CallDirection(optional) (default:'inbound')
Methods
transition()
Transition to a new state. Throws if the transition is invalid.
transition(newState: SessionState): void
Parameters:
newState:SessionState
Returns: void
incrementTurns()
Increment the turn counter (called after each agent response completes)
incrementTurns(): void
Returns: void
addSttTime()
addSttTime(ms: number): void
Parameters:
ms:number
Returns: void
addTtsTime()
addTtsTime(ms: number): void
Parameters:
ms:number
Returns: void
addAgentTime()
addAgentTime(ms: number): void
Parameters:
ms:number
Returns: void
createAgent()
Create and assign the agent for this call session.
createAgent(config: AgentConfig): Agent
Parameters:
config:AgentConfig
Returns: Agent
assignAgent()
Assign a factory-created Agent. VoiceSession assumes ownership and destroys it on end.
assignAgent(agent: Agent): Agent
Parameters:
agent:Agent
Returns: Agent
setPipeline()
Assign the voice pipeline for this call session.
setPipeline(pipeline: IVoicePipeline): void
Parameters:
pipeline:IVoicePipeline
Returns: void
setMaxDuration()
Set a maximum call duration timer. When it fires, the session transitions to 'ending'.
setMaxDuration(seconds: number): void
Parameters:
seconds:number
Returns: void
getInfo()
Get a read-only snapshot of the session state.
getInfo(): VoiceSessionInfo
Returns: VoiceSessionInfo
setEndReason()
Set the reason the call ended (before calling end()).
setEndReason(reason: CallEndReason): void
Parameters:
reason:CallEndReason
Returns: void
getSummary()
Get the call summary. Only meaningful after the session has ended.
getSummary(): CallSummary
Returns: CallSummary
end()
End the session and clean up all resources.
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<typeof OpenAIRealtimeSession>[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()?
connect?(options?: { signal?: AbortSignal }): Promise<OpenAIRealtimeServerEvent>;
Parameters:
options:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<OpenAIRealtimeServerEvent>
updateSession()?
updateSession?(session: OpenAIRealtimeSessionConfig): void;
Parameters:
session:OpenAIRealtimeSessionConfig
Returns: void
appendAudio()?
appendAudio?(audio: Buffer | string): boolean;
Parameters:
audio:string | Buffer<ArrayBufferLike>
Returns: boolean
send()
send(event: OpenAIRealtimeClientEvent): void;
Parameters:
event:OpenAIRealtimeClientEvent
Returns: void
close()
close(code?: number, reason?: string): void;
Parameters:
code:number | undefined(optional)reason:string | undefined(optional)
Returns: void
on()
on(event: 'event', handler: (event: OpenAIRealtimeServerEvent) => void): unknown;
Parameters:
event:"event"handler:(event: OpenAIRealtimeServerEvent) => void
Returns: unknown
on()
on(event: 'audio', handler: (audio: Buffer) => void): unknown;
Parameters:
event:"audio"handler:(audio: Buffer<ArrayBufferLike>) => void
Returns: unknown
on()
on(event: 'error', handler: (error: Error) => void): unknown;
Parameters:
event:"error"handler:(error: Error) => void
Returns: unknown
on()
on(event: 'close', handler: (code: number, reason: string) => void): unknown;
Parameters:
event:"close"handler:(code: number, reason: string) => void
Returns: unknown
on()
on(event: 'backpressure', handler: (info: { bufferedAmount: number; limit: number }) => void): unknown;
Parameters:
event:"backpressure"handler:(info: { bufferedAmount: number; limit: number; }) => void
Returns: unknown
off()?
off?(event: string, handler: (...args: any[]) => void): unknown;
Parameters:
event:stringhandler:(...args: any[]) => 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<'item.input_audio_transcription.logprobs'>; |
- |
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) => void; |
- |
audio |
audio: (audio: Buffer) => void; |
Raw assistant audio when xAI binary output transport is enabled. |
error |
error: (error: Error) => void; |
- |
close |
close: (code: number, reason: string) => void; |
- |
backpressure |
backpressure: (info: { bufferedAmount: number; limit: number }) => 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<string, string>; | - |
| 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<string, string>; signal: AbortSignal }, ) => Promise<WebSocketLike> | 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) => void; |
- |
error |
error: (error: Error) => void; |
- |
close |
close: (code: number, reason: string, unsent: ResponsesUnsentMessage[]) => void; |
- |
reconnecting |
reconnecting: (event: ResponsesReconnectingEvent) => void; |
- |
reconnected |
reconnected: () => void; |
- |
OpenAIResponsesWebSocketSessionOptions interface
📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:32
Properties
| Property | Type | Description |
|---|---|---|
connector |
`connector: string | Connector;` |
headers? |
headers?: Record<string, string>; |
- |
connectTimeoutMs? |
connectTimeoutMs?: number; |
- |
reconnect? |
`reconnect?: ResponsesWSReconnectOptions | null;` |
maxQueueSize? |
maxQueueSize?: number; |
- |
transportFactory? |
`transportFactory?: ( |
client: OpenAI,
options: {
headers?: Record<string, string>;
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()
on(event: string, listener: (...args: any[]) => void): unknown;
Parameters:
event:stringlistener:(...args: any[]) => void
Returns: unknown
send()
send(event: ResponsesAPI.ResponsesClientEvent): void;
Parameters:
event:ResponsesClientEvent
Returns: void
stream()
stream(): AsyncIterableIterator<ResponsesStreamMessage>;
Returns: AsyncIterableIterator<ResponsesStreamMessage>
close()
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.
inspect(operationId?: string): ReadonlyArray<Readonly<RemoteOutcomeReport>>;
Parameters:
operationId:string | undefined(optional)
Returns: readonly Readonly<RemoteOutcomeReport>[]
getReceipt()
getReceipt(operationId: string, options?: { signal?: AbortSignal }): Promise<RemoteOutcomeReport>;
Parameters:
operationId:stringoptions:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<RemoteOutcomeReport>
cancel()
cancel(operationId: string, options?: { signal?: AbortSignal; reason?: string }): Promise<RemoteOutcomeReport>;
Parameters:
operationId:stringoptions:{ signal?: AbortSignal | undefined; reason?: string | undefined; } | undefined(optional)
Returns: Promise<RemoteOutcomeReport>
readEvidence()
readEvidence(reference: EvidenceReference, options?: { offset?: number; limit?: number; signal?: AbortSignal }): Promise<EvidenceChunk | null>;
Parameters:
reference:EvidenceReferenceoptions:{ offset?: number | undefined; limit?: number | undefined; signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<EvidenceChunk | null>
checkpoint()
New envelope; does not serialize callbacks, live task authority or a workflow cursor.
checkpoint(options?: ExportAgentPackageOptions): OutcomeAgentPackage;
Parameters:
options:ExportAgentPackageOptions | undefined(optional)
Returns: OutcomeAgentPackage
checkpoint()
Tools-first construction supplies its owning Agent explicitly.
checkpoint(agent: Agent, options?: ExportAgentPackageOptions): OutcomeAgentPackage;
Parameters:
agent:Agentoptions:ExportAgentPackageOptions | undefined(optional)
Returns: OutcomeAgentPackage
close()
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<string>; | 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:
// 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<string, unknown>;| 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) => void; |
- |
'ended' |
'ended': (summary: CallSummary) => void; |
- |
'error' |
'error': (error: Error) => 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<string, unknown>; |
Adapter-specific metadata (e.g., Twilio AccountSid, geographic info) |
OpenAIResponsesCreateEventOptions type
📍 src/capabilities/openai/OpenAIResponsesWebSocketSession.ts:49
type OpenAIResponsesCreateEventOptions = Omit<
ResponsesAPI.ResponsesClientEvent.ResponseCreate,
'type' | 'model' | 'input' | 'tools' | 'stream' | 'background'
> & {
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.
type ResponseSteerInput = | string
| [OpenAIResponseSteerMessage, ...OpenAIResponseSteerMessage[]]
SessionIngestorDiligence type
📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:49
type SessionIngestorDiligence = 'minimal' | 'normal' | 'thorough'
SessionState type
📍 src/capabilities/voice/types.ts:89
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
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
export function createFileAgentDefinitionStorage(
config?: FileAgentDefinitionStorageConfig
): FileAgentDefinitionStorage
createFileContextStorage function
📍 src/infrastructure/storage/FileContextStorage.ts:536
Create a FileContextStorage for the given agent
export function createFileContextStorage(
agentId: string,
options?: Omit<FileContextStorageConfig, 'agentId'>
): FileContextStorage
Example:
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
export function createFileCorrelationStorage(config?: FileCorrelationStorageConfig): FileCorrelationStorage
createFileCustomToolStorage function
📍 src/infrastructure/storage/FileCustomToolStorage.ts:357
Create a FileCustomToolStorage with default configuration
export function createFileCustomToolStorage(
config?: FileCustomToolStorageConfig
): FileCustomToolStorage
createFileMediaStorage function
📍 src/infrastructure/storage/FileMediaStorage.ts:178
Factory function for creating FileMediaStorage instances
export function createFileMediaStorage(config?: FileMediaStorageConfig): FileMediaStorage
createFileRoutineDefinitionStorage function
📍 src/infrastructure/storage/FileRoutineDefinitionStorage.ts:370
Create a FileRoutineDefinitionStorage with default configuration
export function createFileRoutineDefinitionStorage(
config?: FileRoutineDefinitionStorageConfig
): FileRoutineDefinitionStorage
createFileRoutineExecutionStorage function
📍 src/infrastructure/storage/FileRoutineExecutionStorage.ts:506
Create a FileRoutineExecutionStorage with default configuration
export function createFileRoutineExecutionStorage(
config?: FileRoutineExecutionStorageConfig
): FileRoutineExecutionStorage
toDate function
📍 src/core/context-nextgen/plugins/SessionIngestorPluginNextGen.ts:888
function toDate(v: string | Date | undefined): Date | undefined