Interfaces
Interfaces
TypeScript interfaces for extensibility
AdvancedTextCapabilities interface
📍 src/domain/interfaces/IAdvancedInference.ts:91
Properties
| Property | Type | Description |
|---|---|---|
nativeCompaction? |
`nativeCompaction?: { |
onDemand: 'supported' | 'unsupported' | 'unverified';
inputTokenCounting: 'provider' | 'unavailable' | 'unverified';
};| - | |reasoningHistory?|reasoningHistory?: 'discard' | 'always' | 'when_tools_configured';| Whether normalized reasoning must be replayed in stateless conversation history. | |promptCaching|promptCaching: {
mode: PromptCachingMode;
ttlModes: Array<'short' | 'extended'>;
reportsCacheUsage: boolean;
/** Supports explicit per-content cache breakpoints. /
explicitBreakpoints?: boolean;
};| - | |batch|batch: {
supported: boolean;
cancellable: boolean;
maxRequests?: number;
completionWindow?: string;
};| - | |structuredOutput|structuredOutput: {
jsonObject: 'native' | 'prompt';
jsonSchema: 'native' | 'prompt';
nativeWithTools: boolean;
};| - | |nativeTools|nativeTools: NativeToolCapability[];| - | |nativeToolOptions|nativeToolOptions: {
/* Whether the adapter can surface and resume a host-managed MCP approval. */
remoteMcpApproval: boolean;
};| - | |responsesExtensions?|responsesExtensions?: {
asyncToolCalling: boolean;
midTurnSteering: boolean;
configurationUpdates: boolean;
misalignmentMonitoring: boolean;
};| Responses-protocol extensions exposed through this provider/library integration. | |dataHandling|dataHandling: {
promptCaching: 'none' | 'provider_managed';
batch: 'none' | 'provider_retained';
remoteMcp: 'none' | 'third_party';
};` | - |
AgentDefinitionListOptions interface
📍 src/domain/interfaces/IAgentDefinitionStorage.ts:177
Options for listing agent definitions
Properties
| Property | Type | Description |
|---|---|---|
agentType? |
agentType?: StoredAgentType; |
Filter by agent type |
tags? |
tags?: string[]; |
Filter by tags (any match) |
limit? |
limit?: number; |
Maximum number of results |
offset? |
offset?: number; |
Offset for pagination |
AgentDefinitionMetadata interface
📍 src/domain/interfaces/IAgentDefinitionStorage.ts:67
Agent definition metadata
Properties
| Property | Type | Description |
|---|---|---|
description? |
description?: string; |
Description of what this agent does |
tags? |
tags?: string[]; |
Tags for categorization |
author? |
author?: string; |
Author/creator |
AgentDefinitionSummary interface
📍 src/domain/interfaces/IAgentDefinitionStorage.ts:84
Agent definition summary for listing
Properties
| Property | Type | Description |
|---|---|---|
agentId |
agentId: string; |
Agent identifier |
name |
name: string; |
Agent name |
agentType |
agentType: StoredAgentType; |
Agent type |
model |
model: string; |
Model being used |
createdAt |
createdAt: Date; |
When created |
updatedAt |
updatedAt: Date; |
When last updated |
metadata? |
metadata?: AgentDefinitionMetadata; |
Optional metadata |
BatchHandle interface
📍 src/domain/interfaces/IAdvancedInference.ts:156
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
provider |
provider: string; |
- |
state |
state: BatchProcessingState; |
- |
createdAt? |
createdAt?: Date; |
- |
expiresAt? |
expiresAt?: Date; |
- |
requestCounts? |
`requestCounts?: { |
total: number;
processing?: number;
succeeded?: number;
failed?: number;
cancelled?: number;
expired?: number;
};| - | |rawStatus?|rawStatus?: string;| - | |metadata?|metadata?: Record<string, string>;` | - |
BatchSubmitOptions interface
📍 src/domain/interfaces/IAdvancedInference.ts:150
Properties
| Property | Type | Description |
|---|---|---|
metadata? |
metadata?: Record<string, string>; |
- |
completionWindow? |
completionWindow?: string; |
- |
dataHandling? |
dataHandling?: DataHandlingPolicy; |
- |
BatchTextRequest interface
📍 src/domain/interfaces/IAdvancedInference.ts:144
Properties
| Property | Type | Description |
|---|---|---|
customId |
customId: string; |
Stable host correlation key. Must be unique within one submission. |
options |
options: TOptions; |
- |
BatchTextResult interface
📍 src/domain/interfaces/IAdvancedInference.ts:174
Properties
| Property | Type | Description |
|---|---|---|
customId |
customId: string; |
- |
response? |
response?: TResponse; |
- |
error? |
`error?: { |
code?: string;
message: string;
statusCode?: number;
/** Provider-native item error for diagnostics/recovery. */
details?: unknown;
};| - | |providerRequestId?|providerRequestId?: string;` | - |
ContextStorageListOptions interface
📍 src/domain/interfaces/IContextStorage.ts:204
Options for listing sessions
Properties
| Property | Type | Description |
|---|---|---|
tags? |
tags?: string[]; |
Filter by tags (any match) |
createdAfter? |
createdAfter?: Date; |
Filter by creation date range |
createdBefore? |
createdBefore?: Date; |
- |
savedAfter? |
savedAfter?: Date; |
Filter by last saved date range |
savedBefore? |
savedBefore?: Date; |
- |
limit? |
limit?: number; |
Maximum number of results |
offset? |
offset?: number; |
Offset for pagination |
CorrelationListOptions interface
📍 src/domain/interfaces/ICorrelationStorage.ts:61
Options for listing correlations
Properties
| Property | Type | Description |
|---|---|---|
activeOnly? |
activeOnly?: boolean; |
Only return non-expired correlations |
limit? |
limit?: number; |
Limit results |
CorrelationSummary interface
📍 src/domain/interfaces/ICorrelationStorage.ts:72
Summary of a stored correlation
Properties
| Property | Type | Description |
|---|---|---|
correlationId |
correlationId: string; |
- |
agentId |
agentId: string; |
- |
sessionId |
sessionId: string; |
- |
suspendedAt |
suspendedAt: string; |
- |
expiresAt |
expiresAt: string; |
- |
isExpired |
isExpired: boolean; |
- |
DataHandlingPolicy interface
📍 src/domain/interfaces/IAdvancedInference.ts:58
Properties
| Property | Type | Description |
|---|---|---|
allowProviderCaching? |
allowProviderCaching?: boolean; |
Permit OneRingAI to request/configure provider-managed prompt cache state. |
| This is not a guarantee that an implicitly-caching provider stores nothing | ||
| when the option is false or omitted. | ||
allowBatchRetention? |
allowBatchRetention?: boolean; |
Permit provider-retained asynchronous batch inputs/results. |
allowProviderTools? |
allowProviderTools?: boolean; |
Permit tools executed and retained within the selected LLM provider. |
allowThirdPartyTools? |
allowThirdPartyTools?: boolean; |
Permit data to be sent to a configured third-party remote MCP server. |
EmbeddingOptions interface
📍 src/domain/interfaces/IEmbeddingProvider.ts:14
Options for generating embeddings
Properties
| Property | Type | Description |
|---|---|---|
model |
model: string; |
Model to use for embedding |
input |
`input: string | string[];` |
content? |
content?: EmbeddingContentPart[]; |
Optional multimodal content for models such as Gemini Embedding 2. |
dimensions? |
dimensions?: number; |
Output dimensions (for models that support MRL / dimension reduction) |
encodingFormat? |
`encodingFormat?: 'float' | 'base64';` |
vendorOptions? |
vendorOptions?: Record<string, unknown>; |
Provider-specific controls. Google supports taskType, title, and |
mediaDownloadTimeoutMs (30 seconds by default for external media). |
EmbeddingResponse interface
📍 src/domain/interfaces/IEmbeddingProvider.ts:35
Response from an embedding request
Properties
| Property | Type | Description |
|---|---|---|
embeddings |
embeddings: number[][]; |
Embedding vectors — always array of arrays, even for single input |
model |
model: string; |
Model used |
usage |
`usage: { |
promptTokens: number;
totalTokens: number;
};` | Token usage |
EvidenceChunk interface
📍 src/domain/interfaces/IEvidenceStorage.ts:53
Properties
| Property | Type | Description |
|---|---|---|
reference |
reference: EvidenceReference; |
- |
text |
text: string; |
- |
nextOffset? |
nextOffset?: number; |
- |
totalChars |
totalChars: number; |
- |
EvidenceEntry interface
📍 src/domain/interfaces/IEvidenceStorage.ts:59
Properties
| Property | Type | Description |
|---|---|---|
reference |
reference: EvidenceReference; |
- |
recordedAt |
recordedAt: number; |
- |
expiresAt? |
expiresAt?: number; |
- |
toolName |
toolName: string; |
- |
callId? |
callId?: string; |
- |
status |
status: EvidenceRecord['source']['status']; |
- |
completion |
completion: EvidenceRecord['source']['completion']; |
- |
effect |
effect: EvidenceRecord['source']['effect']; |
- |
EvidenceReadOptions interface
📍 src/domain/interfaces/IEvidenceStorage.ts:46
Properties
| Property | Type | Description |
|---|---|---|
offset? |
offset?: number; |
UTF-16 character offset in serialized JSON. |
limit? |
limit?: number; |
Maximum characters, capped at the store's maxReadChars (default 8192). |
signal? |
signal?: AbortSignal; |
- |
EvidenceRecord interface
📍 src/domain/interfaces/IEvidenceStorage.ts:20
Immutable JSON observation, including receipts with unknown completion.
Properties
| Property | Type | Description |
|---|---|---|
version |
version: 1; |
- |
recordedAt |
recordedAt: number; |
- |
expiresAt? |
expiresAt?: number; |
- |
source |
`source: { |
toolName: string;
executionId: string;
connectorName?: string;
callId?: string;
runId?: string;
arguments: unknown;
principal: { userId?: string; accountId?: string; agentId?: string };
effect: 'read' | 'write' | 'unknown';
status: 'succeeded' | 'failed' | 'denied' | 'cancelled' | 'timed_out';
completion: 'settled' | 'unknown' | 'not_started';
startedAt: number;
durationMs: number;
executionStarted?: boolean;
cancellation?: 'none' | 'requested' | 'acknowledged';
timeoutMs?: number;
late?: boolean;
};| - | |result?|result?: unknown;` | Absent for unresolved/error receipts. Exact JSON result after host redaction. |
EvidenceReference interface
📍 src/domain/interfaces/IEvidenceStorage.ts:11
Properties
| Property | Type | Description |
|---|---|---|
version |
version: 1; |
- |
id |
id: string; |
- |
sha256 |
sha256: string; |
- |
bytes |
bytes: number; |
- |
durability |
durability: EvidenceDurability; |
- |
EvidenceScope interface
📍 src/domain/interfaces/IEvidenceStorage.ts:2
Host-bound evidence ownership. Never accept this scope from a model tool argument.
Properties
| Property | Type | Description |
|---|---|---|
ownerId |
ownerId: string; |
- |
namespace |
namespace: string; |
- |
tenantId? |
tenantId?: string; |
- |
FileSearchOptions interface
📍 src/domain/interfaces/IAdvancedInference.ts:73
Properties
| Property | Type | Description |
|---|---|---|
vectorStoreIds |
vectorStoreIds: string[]; |
Provider vector stores to search. Required by the normalized file-search contract. |
HistoryEntry interface
📍 src/domain/interfaces/IHistoryJournal.ts:52
A single entry in the history journal.
Wraps an InputItem with metadata for ordering and filtering.
The item field is the exact InputItem as it was added to the conversation,
preserving full fidelity (including __images, tool_use_id, etc.).
Properties
| Property | Type | Description |
|---|---|---|
timestamp |
timestamp: number; |
When this entry was recorded (epoch ms) |
type |
type: HistoryEntryType; |
Entry type for filtering |
item |
item: InputItem; |
The actual conversation item (Message or CompactionItem) |
turnIndex |
turnIndex: number; |
Monotonically increasing turn counter. |
| A "turn" is one user message + one assistant response (+ any tool calls in between). | ||
| Useful for grouping related messages and pagination. |
HistoryManagerEvents interface
📍 src/domain/interfaces/IHistoryManager.ts:24
Events emitted by IHistoryManager implementations
Properties
| Property | Type | Description |
|---|---|---|
'message:added' |
'message:added': { message: HistoryMessage }; |
- |
'message:removed' |
'message:removed': { messageId: string }; |
- |
'history:cleared' |
'history:cleared': { reason?: string }; |
- |
'history:compacted' |
'history:compacted': { removedCount: number; strategy: string }; |
- |
'history:restored' |
'history:restored': { messageCount: number }; |
- |
HistoryMessage interface
📍 src/domain/interfaces/IHistoryManager.ts:13
A single message in conversation history
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
role |
`role: 'user' | 'assistant' |
content |
content: string; |
- |
timestamp |
timestamp: number; |
- |
metadata? |
metadata?: Record<string, unknown>; |
- |
HistoryReadOptions interface
📍 src/domain/interfaces/IHistoryJournal.ts:77
Options for reading history entries.
Properties
| Property | Type | Description |
|---|---|---|
offset? |
offset?: number; |
Skip this many entries from the start |
limit? |
limit?: number; |
Maximum number of entries to return |
types? |
types?: HistoryEntryType[]; |
Filter by entry type(s) |
after? |
after?: number; |
Only entries after this timestamp (epoch ms, inclusive) |
before? |
before?: number; |
Only entries before this timestamp (epoch ms, inclusive) |
fromTurn? |
fromTurn?: number; |
Only entries from this turn index onwards (inclusive) |
toTurn? |
toTurn?: number; |
Only entries up to this turn index (inclusive) |
IAgentDefinitionStorage interface
📍 src/domain/interfaces/IAgentDefinitionStorage.ts:119
Storage interface for agent definitions
Implementations:
- FileAgentDefinitionStorage: File-based storage at ~/.oneringai/agents//
- (Future) DatabaseAgentDefinitionStorage, etc.
Methods
save()
Save an agent definition
save(definition: StoredAgentDefinition): Promise<void>;
Parameters:
definition:StoredAgentDefinition
Returns: Promise<void>
load()
Load an agent definition
load(agentId: string): Promise<StoredAgentDefinition | null>;
Parameters:
agentId:string
Returns: Promise<StoredAgentDefinition | null>
delete()
Delete an agent definition
delete(agentId: string): Promise<void>;
Parameters:
agentId:string
Returns: Promise<void>
exists()
Check if an agent definition exists
exists(agentId: string): Promise<boolean>;
Parameters:
agentId:string
Returns: Promise<boolean>
list()
List all agent definitions (summaries only)
list(options?: AgentDefinitionListOptions): Promise<AgentDefinitionSummary[]>;
Parameters:
options:AgentDefinitionListOptions | undefined(optional)
Returns: Promise<AgentDefinitionSummary[]>
updateMetadata()?
Update agent definition metadata without loading full definition
updateMetadata?(
agentId: string,
metadata: Partial<AgentDefinitionMetadata>
): Promise<void>;
Parameters:
agentId:stringmetadata:Partial<AgentDefinitionMetadata>
Returns: Promise<void>
getPath()
Get the storage path/location (for display/debugging)
getPath(): string;
Returns: string
IAgentStateStorage interface
📍 src/domain/interfaces/IAgentStateStorage.ts:8
Methods
save()
Save agent state
save(state: AgentState): Promise<void>;
Parameters:
state:AgentState
Returns: Promise<void>
load()
Load agent state
load(agentId: string): Promise<AgentState | undefined>;
Parameters:
agentId:string
Returns: Promise<AgentState | undefined>
delete()
Delete agent state
delete(agentId: string): Promise<void>;
Parameters:
agentId:string
Returns: Promise<void>
list()
List agents by status
list(filter?: { status?: AgentStatus[] }): Promise<AgentState[]>;
Parameters:
filter:{ status?: AgentStatus[] | undefined; } | undefined(optional)
Returns: Promise<AgentState[]>
patch()
Update specific fields (partial update for efficiency)
patch(agentId: string, updates: Partial<AgentState>): Promise<void>;
Parameters:
agentId:stringupdates:Partial<AgentState>
Returns: Promise<void>
IAsyncDisposable interface
📍 src/domain/interfaces/IDisposable.ts:33
Async version of IDisposable for resources requiring async cleanup.
Methods
destroy()
Asynchronously releases all resources held by this instance.
destroy(): Promise<void>;
Returns: Promise<void>
Properties
| Property | Type | Description |
|---|---|---|
isDestroyed |
readonly isDestroyed: boolean; |
Returns true if destroy() has been called. |
IAsyncTextBatchProvider interface
📍 src/domain/interfaces/IAdvancedInference.ts:187
Methods
submitBatch()
submitBatch(
requests: Array<BatchTextRequest<TOptions>>,
options?: BatchSubmitOptions,
): Promise<BatchHandle>;
Parameters:
requests:BatchTextRequest<TOptions>[]options:BatchSubmitOptions | undefined(optional)
Returns: Promise<BatchHandle>
getBatch()
getBatch(id: string): Promise<BatchHandle>;
Parameters:
id:string
Returns: Promise<BatchHandle>
cancelBatch()
cancelBatch(id: string): Promise<BatchHandle>;
Parameters:
id:string
Returns: Promise<BatchHandle>
getBatchResults()
getBatchResults(id: string): AsyncIterable<BatchTextResult<TResponse>>;
Parameters:
id:string
Returns: AsyncIterable<BatchTextResult<TResponse>>
IConnectorAccessPolicy interface
📍 src/domain/interfaces/IConnectorAccessPolicy.ts:17
Methods
canAccess()
Check if a connector is accessible in the given context. Receives the full Connector instance so it can inspect config.tags, vendor, serviceType, etc.
canAccess(connector: Connector, context: ConnectorAccessContext): boolean;
Parameters:
connector:Connectorcontext:ConnectorAccessContext
Returns: boolean
IConnectorConfigStorage interface
📍 src/domain/interfaces/IConnectorConfigStorage.ts:50
Storage interface for ConnectorConfig persistence
Implementations should:
- Store data as-is (encryption is handled by ConnectorConfigStore)
- Use appropriate file permissions for file-based storage
- Hash names for filenames to prevent enumeration attacks
Methods
save()
Save a connector configuration
save(name: string, stored: StoredConnectorConfig): Promise<void>;
Parameters:
name:stringstored:StoredConnectorConfig
Returns: Promise<void>
get()
Retrieve a connector configuration by name
get(name: string): Promise<StoredConnectorConfig | null>;
Parameters:
name:string
Returns: Promise<StoredConnectorConfig | null>
delete()
Delete a connector configuration
delete(name: string): Promise<boolean>;
Parameters:
name:string
Returns: Promise<boolean>
has()
Check if a connector configuration exists
has(name: string): Promise<boolean>;
Parameters:
name:string
Returns: Promise<boolean>
list()
List all connector names
list(): Promise<string[]>;
Returns: Promise<string[]>
listAll()
Get all stored connector configurations
listAll(): Promise<StoredConnectorConfig[]>;
Returns: Promise<StoredConnectorConfig[]>
IConnectorRegistry interface
📍 src/domain/interfaces/IConnectorRegistry.ts:11
Methods
get()
Get a connector by name. Throw ConnectorNotFoundError when missing or hidden in this scope, with no disclosure of inaccessible connectors. Propagate authentication, configuration and storage failures without reclassifying them as absence. Connector.get() preserves custom-registry errors unchanged.
get(name: string): Connector;
Parameters:
name:string
Returns: Connector
has()
Check if a connector exists (and is accessible)
has(name: string): boolean;
Parameters:
name:string
Returns: boolean
list()
List all accessible connector names
list(): string[];
Returns: string[]
listAll()
List all accessible connector instances
listAll(): Connector[];
Returns: Connector[]
size()
Get number of accessible connectors
size(): number;
Returns: number
getDescriptionsForTools()
Get connector descriptions formatted for tool parameters
getDescriptionsForTools(): string;
Returns: string
getInfo()
Get connector info map
getInfo(): Record<string, { displayName: string; description: string; baseURL: string }>;
Returns: Record<string, { displayName: string; description: string; baseURL: string; }>
getById()?
Get a connector by ID. Optional — not all registries support ID-based lookup. Uses the same ConnectorNotFoundError contract as get().
getById?(id: string): Connector;
Parameters:
id:string
Returns: Connector
warmup()?
Optional async warmup — called before sync reads to ensure connectors are loaded.
Multi-tenant registries can implement this to lazily load connectors for the current request context (e.g., tenant/group). Entry points call Connector.warmup() which delegates here. After warmup completes, all sync read methods (get, has, list, listAll) must return correct results without further async work.
warmup?(): Promise<void>;
Returns: Promise<void>
IContextStorage interface
📍 src/domain/interfaces/IContextStorage.ts:116
Storage interface for AgentContext persistence
Implementations:
- FileContextStorage: File-based storage at ~/.oneringai/agents//sessions/
- (Future) RedisContextStorage, PostgresContextStorage, S3ContextStorage, etc.
Methods
save()
Save context state to a session
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
load(sessionId: string): Promise<StoredContextSession | null>;
Parameters:
sessionId:string
Returns: Promise<StoredContextSession | null>
delete()
Delete a session
delete(sessionId: string): Promise<void>;
Parameters:
sessionId:string
Returns: Promise<void>
exists()
Check if a session exists
exists(sessionId: string): Promise<boolean>;
Parameters:
sessionId:string
Returns: Promise<boolean>
list()
List all sessions (summaries only, not full state)
list(options?: ContextStorageListOptions): Promise<ContextSessionSummary[]>;
Parameters:
options:ContextStorageListOptions | undefined(optional)
Returns: Promise<ContextSessionSummary[]>
updateMetadata()?
Update session metadata without loading full state
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). Examples: file path, MongoDB URI, Redis key prefix, S3 bucket, etc. Falls back to getPath() if not implemented.
getLocation?(): string;
Returns: string
Properties
| Property | Type | Description |
|---|---|---|
journal? |
readonly journal?: IHistoryJournal; |
History journal companion for full conversation logging. |
When present, AgentContextNextGen automatically appends every message to the journal (append-oriented, fire-and-forget). The journal is never affected by compaction, preserving full conversation history.
Storage implementations create the appropriate journal for their backend:
- FileContextStorage → FileHistoryJournal (JSONL files)
- MongoContextStorage → MongoHistoryJournal (collection)
Consumers never configure the journal separately — it comes for free with the storage backend. |
ICorrelationStorage interface
📍 src/domain/interfaces/ICorrelationStorage.ts:84
Storage interface for correlation mappings between external events and sessions
Methods
save()
Save a correlation mapping. If a correlation with the same ID already exists, it is overwritten.
save(correlationId: string, ref: SessionRef): Promise<void>;
Parameters:
correlationId:stringref:SessionRef
Returns: Promise<void>
resolve()
Resolve a correlation ID to a session reference. Returns null if not found or expired.
resolve(correlationId: string): Promise<SessionRef | null>;
Parameters:
correlationId:string
Returns: Promise<SessionRef | null>
delete()
Delete a correlation mapping.
delete(correlationId: string): Promise<void>;
Parameters:
correlationId:string
Returns: Promise<void>
exists()
Check if a correlation exists and is not expired.
exists(correlationId: string): Promise<boolean>;
Parameters:
correlationId:string
Returns: Promise<boolean>
listBySession()
List all correlations for a given session. Useful for cleanup when a session is resumed or deleted.
listBySession(sessionId: string): Promise<string[]>;
Parameters:
sessionId:string
Returns: Promise<string[]>
listByAgent()
List all correlations for a given agent.
listByAgent(agentId: string): Promise<CorrelationSummary[]>;
Parameters:
agentId:string
Returns: Promise<CorrelationSummary[]>
pruneExpired()
Remove all expired correlations.
pruneExpired(): Promise<number>;
Returns: Promise<number>
getPath()
Get the storage path (for debugging/logging).
getPath(): string;
Returns: string
IDisposable interface
📍 src/domain/interfaces/IDisposable.ts:9
Interface for objects that manage resources and need explicit cleanup.
Implementing classes should release all resources (event listeners, timers, connections, etc.) when destroy() is called. After destruction, the instance should not be used.
Methods
destroy()
Releases all resources held by this instance.
After calling destroy():
- All event listeners should be removed
- All timers/intervals should be cleared
- All internal state should be cleaned up
- The instance should not be reused
Multiple calls to destroy() should be safe (idempotent).
destroy(): void;
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
isDestroyed |
readonly isDestroyed: boolean; |
Returns true if destroy() has been called. |
| Methods should check this before performing operations. |
IEmbeddingProvider interface
📍 src/domain/interfaces/IEmbeddingProvider.ts:50
Embedding provider interface
Methods
embed()
Generate embeddings for one or more inputs
embed(options: EmbeddingOptions): Promise<EmbeddingResponse>;
Parameters:
options:EmbeddingOptions
Returns: Promise<EmbeddingResponse>
listModels()?
List available embedding models (optional)
listModels?(): Promise<string[]>;
Returns: Promise<string[]>
IEvidenceStorage interface
📍 src/domain/interfaces/IEvidenceStorage.ts:71
Scoped immutable records. Missing/expired references return null; corruption throws.
Methods
put()
put(record: EvidenceRecord): Promise<EvidenceReference>;
Parameters:
record:EvidenceRecord
Returns: Promise<EvidenceReference>
getReference()?
Optional efficient scoped ID lookup; implementations verify stored integrity before returning metadata.
getReference?(id: string, signal?: AbortSignal): Promise<EvidenceReference | null>;
Parameters:
id:stringsignal:AbortSignal | undefined(optional)
Returns: Promise<EvidenceReference | null>
read()
Integrity checks cover the entire bounded blob even when reading a chunk.
read(reference: EvidenceReference, options?: EvidenceReadOptions): Promise<EvidenceChunk | null>;
Parameters:
reference:EvidenceReferenceoptions:EvidenceReadOptions | undefined(optional)
Returns: Promise<EvidenceChunk | null>
readRecord()
Host-only full read, still bounded by maxRecordBytes (default 4 MiB).
readRecord(reference: EvidenceReference): Promise<EvidenceRecord | null>;
Parameters:
reference:EvidenceReference
Returns: Promise<EvidenceRecord | null>
list()
list(options?: { after?: string; limit?: number; signal?: AbortSignal }): Promise<{ entries: EvidenceEntry[]; next?: string }>;
Parameters:
options:{ after?: string | undefined; limit?: number | undefined; signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<{ entries: EvidenceEntry[]; next?: string | undefined; }>
delete()
delete(reference: EvidenceReference): Promise<boolean>;
Parameters:
reference:EvidenceReference
Returns: Promise<boolean>
pruneExpired()
Explicit host maintenance; no scratch eviction or compaction deletes evidence.
pruneExpired(now?: number): Promise<number>;
Parameters:
now:number | undefined(optional)
Returns: Promise<number>
Properties
| Property | Type | Description |
|---|---|---|
scope |
readonly scope: Readonly<EvidenceScope>; |
- |
durability |
readonly durability: EvidenceDurability; |
- |
serializationLimitBytes? |
readonly serializationLimitBytes?: number; |
Optional middleware serialization budget. Bundled stores expose their effective record/scope byte cap. |
IHistoryJournal interface
📍 src/domain/interfaces/IHistoryJournal.ts:112
History journal for conversation persistence.
Implementations:
- FileHistoryJournal: JSONL files at ~/.oneringai/agents//sessions/.history.jsonl
- (Future) MongoHistoryJournal: MongoDB collection
- (Future) RedisHistoryJournal: Redis Streams
Methods
append()
Append entries to the journal.
This is the primary write operation, called on every addUserMessage(), addAssistantResponse(), and addToolResults(). Should be fast and append-oriented.
append(sessionId: string, entries: HistoryEntry[]): Promise<void>;
Parameters:
sessionId:stringentries:HistoryEntry[]
Returns: Promise<void>
replaceLast()?
Replace the most recent entry matching type + turnIndex.
Normal history writes remain append-oriented, but post-processing may need
to correct the assistant message that was just committed (for example,
structured-output reformatting). Returning false lets callers fall back to
append() if they still want to preserve the corrected entry.
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.
Entries are returned in chronological order (oldest first).
read(sessionId: string, options?: HistoryReadOptions): Promise<HistoryEntry[]>;
Parameters:
sessionId:stringoptions:HistoryReadOptions | undefined(optional)
Returns: Promise<HistoryEntry[]>
count()
Get the total number of entries in the journal.
count(sessionId: string): Promise<number>;
Parameters:
sessionId:string
Returns: Promise<number>
clear()
Delete all history for a session.
Called when a session is deleted via IContextStorage.delete().
clear(sessionId: string): Promise<void>;
Parameters:
sessionId:string
Returns: Promise<void>
stream()?
Stream history entries for large histories.
Optional — implementations may omit this if streaming isn't practical (e.g., in-memory storage). Callers should fall back to read() with pagination if stream() is not available.
stream?(sessionId: string, options?: HistoryReadOptions): AsyncIterable<HistoryEntry>;
Parameters:
sessionId:stringoptions:HistoryReadOptions | undefined(optional)
Returns: AsyncIterable<HistoryEntry>
getLocation()?
Get a human-readable location string for debugging/display.
getLocation?(sessionId: string): string;
Parameters:
sessionId:string
Returns: string
IHistoryManager interface
📍 src/domain/interfaces/IHistoryManager.ts:114
Interface for history manager Manages conversation history with compaction and persistence support
Methods
addMessage()
Add a message to history
addMessage(role: 'user' | 'assistant' | 'system', content: string, metadata?: Record<string, unknown>): Promise<HistoryMessage>;
Parameters:
role:"user" | "assistant" | "system"content:stringmetadata:Record<string, unknown> | undefined(optional)
Returns: Promise<HistoryMessage>
getMessages()
Get all messages (may include summaries as system messages)
getMessages(): Promise<HistoryMessage[]>;
Returns: Promise<HistoryMessage[]>
getRecentMessages()
Get recent messages only
getRecentMessages(count?: number): Promise<HistoryMessage[]>;
Parameters:
count:number | undefined(optional)
Returns: Promise<HistoryMessage[]>
formatForContext()
Get formatted history for LLM context
formatForContext(options?: { maxTokens?: number; includeMetadata?: boolean }): Promise<string>;
Parameters:
options:{ maxTokens?: number | undefined; includeMetadata?: boolean | undefined; } | undefined(optional)
Returns: Promise<string>
compact()
Compact history (apply compaction strategy)
compact(): Promise<void>;
Returns: Promise<void>
clear()
Clear all history
clear(): Promise<void>;
Returns: Promise<void>
getMessageCount()
Get message count
getMessageCount(): Promise<number>;
Returns: Promise<number>
getState()
Get state for session persistence
getState(): Promise<SerializedHistoryState>;
Returns: Promise<SerializedHistoryState>
restoreState()
Restore from saved state
restoreState(state: SerializedHistoryState): Promise<void>;
Parameters:
state:SerializedHistoryState
Returns: Promise<void>
getConfig()
Get current configuration
getConfig(): IHistoryManagerConfig;
Returns: IHistoryManagerConfig
IHistoryManagerConfig interface
📍 src/domain/interfaces/IHistoryManager.ts:35
Configuration for history management
Properties
| Property | Type | Description |
|---|---|---|
maxMessages? |
maxMessages?: number; |
Maximum messages to keep (for sliding window) |
maxTokens? |
maxTokens?: number; |
Maximum tokens to keep (estimated) |
compactionStrategy? |
`compactionStrategy?: 'truncate' | 'summarize' |
preserveRecentCount? |
preserveRecentCount?: number; |
Number of recent messages to always preserve |
IHistoryStorage interface
📍 src/domain/interfaces/IHistoryManager.ts:63
Interface for history storage backends Implement this to use custom storage (Redis, PostgreSQL, file, etc.)
Methods
addMessage()
Store a message
addMessage(message: HistoryMessage): Promise<void>;
Parameters:
message:HistoryMessage
Returns: Promise<void>
getMessages()
Get all messages
getMessages(): Promise<HistoryMessage[]>;
Returns: Promise<HistoryMessage[]>
getRecentMessages()
Get recent N messages
getRecentMessages(count: number): Promise<HistoryMessage[]>;
Parameters:
count:number
Returns: Promise<HistoryMessage[]>
removeMessage()
Remove a message by ID
removeMessage(id: string): Promise<void>;
Parameters:
id:string
Returns: Promise<void>
removeOlderThan()
Remove messages older than timestamp
removeOlderThan(timestamp: number): Promise<number>;
Parameters:
timestamp:number
Returns: Promise<number>
clear()
Clear all messages
clear(): Promise<void>;
Returns: Promise<void>
getCount()
Get message count
getCount(): Promise<number>;
Returns: Promise<number>
getState()
Get serialized state for session persistence
getState(): Promise<SerializedHistoryState>;
Returns: Promise<SerializedHistoryState>
restoreState()
Restore from serialized state
restoreState(state: SerializedHistoryState): Promise<void>;
Parameters:
state:SerializedHistoryState
Returns: Promise<void>
IMCPClient interface
📍 src/domain/interfaces/IMCPClient.ts:34
MCP Client interface
Methods
connect()
Connect to the MCP server
connect(): Promise<void>;
Returns: Promise<void>
disconnect()
Disconnect from the MCP server
disconnect(): Promise<void>;
Returns: Promise<void>
reconnect()
Reconnect to the MCP server
reconnect(): Promise<void>;
Returns: Promise<void>
isConnected()
Check if connected
isConnected(): boolean;
Returns: boolean
ping()
Ping the server to check health
ping(): Promise<boolean>;
Returns: Promise<boolean>
listTools()
List available tools from the server
listTools(): Promise<MCPTool[]>;
Returns: Promise<MCPTool[]>
callTool()
Call a tool on the server
callTool(name: string, args: Record<string, unknown>): Promise<MCPToolResult>;
Parameters:
name:stringargs:Record<string, unknown>
Returns: Promise<MCPToolResult>
registerTools()
Register all tools with a ToolManager
registerTools(toolManager: ToolManager): void;
Parameters:
toolManager:ToolManager
Returns: void
registerToolsSelective()
Register specific tools with a ToolManager (selective registration)
registerToolsSelective(toolManager: ToolManager, toolNames?: string[]): void;
Parameters:
toolManager:ToolManagertoolNames:string[] | undefined(optional)
Returns: void
unregisterTools()
Unregister all tools from a ToolManager
unregisterTools(toolManager: ToolManager): void;
Parameters:
toolManager:ToolManager
Returns: void
listResources()
List available resources from the server
listResources(): Promise<MCPResource[]>;
Returns: Promise<MCPResource[]>
readResource()
Read a resource from the server
readResource(uri: string): Promise<MCPResourceContent>;
Parameters:
uri:string
Returns: Promise<MCPResourceContent>
subscribeResource()
Subscribe to resource updates
subscribeResource(uri: string): Promise<void>;
Parameters:
uri:string
Returns: Promise<void>
unsubscribeResource()
Unsubscribe from resource updates
unsubscribeResource(uri: string): Promise<void>;
Parameters:
uri:string
Returns: Promise<void>
listPrompts()
List available prompts from the server
listPrompts(): Promise<MCPPrompt[]>;
Returns: Promise<MCPPrompt[]>
getPrompt()
Get a prompt from the server
getPrompt(name: string, args?: Record<string, unknown>): Promise<MCPPromptResult>;
Parameters:
name:stringargs:Record<string, unknown> | undefined(optional)
Returns: Promise<MCPPromptResult>
getState()
Get current state for serialization
getState(): MCPClientState;
Returns: MCPClientState
loadState()
Load state from serialization
loadState(state: MCPClientState): void;
Parameters:
state:MCPClientState
Returns: void
destroy()
Destroy the client and clean up resources
destroy(): void;
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Server name |
state |
readonly state: MCPClientConnectionState; |
Current connection state |
capabilities? |
readonly capabilities?: MCPServerCapabilities; |
Server capabilities (available after connection) |
tools |
readonly tools: MCPTool[]; |
Currently available tools |
IMediaStorage interface
📍 src/domain/interfaces/IMediaStorage.ts:86
Storage interface for multimedia outputs
Implementations:
- FileMediaStorage: File-based storage (default, uses local filesystem)
- (Custom) S3MediaStorage, GCSMediaStorage, etc.
Methods
save()
Save media data to storage
save(data: Buffer, metadata: MediaStorageMetadata): Promise<MediaStorageResult>;
Parameters:
data:Buffer<ArrayBufferLike>metadata:MediaStorageMetadata
Returns: Promise<MediaStorageResult>
read()
Read media data from storage
read(location: string): Promise<Buffer | null>;
Parameters:
location:string
Returns: Promise<Buffer<ArrayBufferLike> | null>
delete()
Delete media from storage
delete(location: string): Promise<void>;
Parameters:
location:string
Returns: Promise<void>
exists()
Check if media exists in storage
exists(location: string): Promise<boolean>;
Parameters:
location:string
Returns: Promise<boolean>
list()?
List media files in storage (optional)
list?(options?: MediaStorageListOptions): Promise<MediaStorageEntry[]>;
Parameters:
options:MediaStorageListOptions | undefined(optional)
Returns: Promise<MediaStorageEntry[]>
getPath()
Get the storage path/location (for display/debugging)
getPath(): string;
Returns: string
InstructionEntry interface
📍 src/domain/interfaces/IPersistentInstructionsStorage.ts:15
IPersistentInstructionsStorage - Storage interface for persistent instructions
Abstracted storage interface following Clean Architecture principles. Implementations can use file system, database, or any other storage backend.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
User-supplied key (e.g., "style", "code_rules") |
content |
content: string; |
Instruction text (markdown) |
createdAt |
createdAt: number; |
Timestamp when entry was first created |
updatedAt |
updatedAt: number; |
Timestamp when entry was last updated |
IPersistentInstructionsStorage interface
📍 src/domain/interfaces/IPersistentInstructionsStorage.ts:36
Storage interface for persistent agent instructions
Implementations handle the actual storage mechanism while the plugin handles the business logic.
Methods
load()
Load instruction entries from storage
load(): Promise<InstructionEntry[] | null>;
Returns: Promise<InstructionEntry[] | null>
save()
Save instruction entries to storage
save(entries: InstructionEntry[]): Promise<void>;
Parameters:
entries:InstructionEntry[]
Returns: Promise<void>
delete()
Delete instructions from storage
delete(): Promise<void>;
Returns: Promise<void>
exists()
Check if instructions exist in storage
exists(): Promise<boolean>;
Returns: Promise<boolean>
getPath()
Get the storage path (for display/debugging)
getPath(): string;
Returns: string
IProvider interface
📍 src/domain/interfaces/IProvider.ts:15
Methods
validateConfig()
Validate that the provider configuration is correct
validateConfig(): Promise<boolean>;
Returns: Promise<boolean>
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
- |
vendor? |
readonly vendor?: string; |
- |
capabilities |
readonly capabilities: ProviderCapabilities; |
- |
IRoutineDefinitionStorage interface
📍 src/domain/interfaces/IRoutineDefinitionStorage.ts:15
Methods
save()
save(context: StorageUserContextInput, definition: RoutineDefinition): Promise<void>;
Parameters:
context:StorageUserContextInputdefinition:RoutineDefinition
Returns: Promise<void>
load()
load(context: StorageUserContextInput, id: string): Promise<RoutineDefinition | null>;
Parameters:
context:StorageUserContextInputid:string
Returns: Promise<RoutineDefinition | null>
delete()
delete(context: StorageUserContextInput, id: string): Promise<void>;
Parameters:
context:StorageUserContextInputid:string
Returns: Promise<void>
exists()
exists(context: StorageUserContextInput, id: string): Promise<boolean>;
Parameters:
context:StorageUserContextInputid:string
Returns: Promise<boolean>
list()
List routine summaries (slim projection). Use load(id) to fetch the full definition for any returned entry.
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
IRoutineExecutionStorage interface
📍 src/domain/interfaces/IRoutineExecutionStorage.ts:20
Methods
insert()
Insert a new execution record. Returns the record ID.
insert(context: StorageUserContextInput, record: RoutineExecutionRecord): Promise<string>;
Parameters:
context:StorageUserContextInputrecord:RoutineExecutionRecord
Returns: Promise<string>
update()
Update top-level fields on an execution record.
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()
Append a step to the execution's steps array.
pushStep(id: string, step: RoutineExecutionStep): Promise<void>;
Parameters:
id:stringstep:RoutineExecutionStep
Returns: Promise<void>
updateTask()
Update a specific task snapshot within the execution record.
updateTask(id: string, taskName: string, updates: Partial<RoutineTaskSnapshot>): Promise<void>;
Parameters:
id:stringtaskName:stringupdates:Partial<RoutineTaskSnapshot>
Returns: Promise<void>
load()
Load a single execution record by ID.
load(id: string): Promise<RoutineExecutionRecord | null>;
Parameters:
id:string
Returns: Promise<RoutineExecutionRecord | null>
list()
List execution records with optional filters.
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()
Check if a routine has a currently running execution.
hasRunning(context: StorageUserContextInput, routineId: string): Promise<boolean>;
Parameters:
context:StorageUserContextInputroutineId:string
Returns: Promise<boolean>
IScheduler interface
📍 src/domain/interfaces/IScheduler.ts:26
Methods
schedule()
Schedule a callback. Returns a handle to cancel it.
schedule(id: string, spec: ScheduleSpec, callback: () => void | Promise<void>): ScheduleHandle;
Parameters:
id:stringspec:ScheduleSpeccallback:() => void | Promise<void>
Returns: ScheduleHandle
cancel()
Cancel a scheduled callback by ID.
cancel(id: string): void;
Parameters:
id:string
Returns: void
cancelAll()
Cancel all scheduled callbacks.
cancelAll(): void;
Returns: void
has()
Check if a schedule exists by ID.
has(id: string): boolean;
Parameters:
id:string
Returns: boolean
ISpeechToTextProvider interface
📍 src/domain/interfaces/IAudioProvider.ts:197
Speech-to-Text provider interface
Methods
transcribe()
Transcribe audio to text
transcribe(options: STTOptions): Promise<STTResponse>;
Parameters:
options:STTOptions
Returns: Promise<STTResponse>
translate()?
Translate audio to English text (optional, Whisper-specific)
translate?(options: STTOptions): Promise<STTResponse>;
Parameters:
options:STTOptions
Returns: Promise<STTResponse>
ITextCompactionProvider interface
📍 src/domain/interfaces/ITextProvider.ts:129
Methods
compact()
compact(options: TextGenerateOptions): Promise<TextCompactionResponse>;
Parameters:
options:TextGenerateOptions
Returns: Promise<TextCompactionResponse>
countInput()
countInput(options: TextGenerateOptions): Promise<number | null>;
Parameters:
options:TextGenerateOptions
Returns: Promise<number | null>
ITextProvider interface
📍 src/domain/interfaces/ITextProvider.ts:98
Methods
generate()
Generate text response
generate(options: TextGenerateOptions): Promise<LLMResponse>;
Parameters:
options:TextGenerateOptions
Returns: Promise<LLMResponse>
streamGenerate()
Stream text response with real-time events Returns an async iterator of streaming events
streamGenerate(options: TextGenerateOptions): AsyncIterableIterator<StreamEvent>;
Parameters:
options:TextGenerateOptions
Returns: AsyncIterableIterator<StreamEvent>
getModelCapabilities()
Get model capabilities
getModelCapabilities(model: string): ModelCapabilities;
Parameters:
model:string
Returns: ModelCapabilities
getAdvancedCapabilities()?
Executable advanced capabilities for a concrete model/provider pair.
getAdvancedCapabilities?(model: string): AdvancedTextCapabilities;
Parameters:
model:string
Returns: AdvancedTextCapabilities
listModels()
List available models from the provider's API
listModels(): Promise<string[]>;
Returns: Promise<string[]>
Properties
| Property | Type | Description |
|---|---|---|
compaction? |
readonly compaction?: ITextCompactionProvider; |
Optional standalone native context operations; existing providers need no changes. |
batch? |
readonly batch?: IAsyncTextBatchProvider<TextGenerateOptions, LLMResponse>; |
Optional asynchronous batch surface. Present only when implemented by the provider. |
ITextToSpeechProvider interface
📍 src/domain/interfaces/IAudioProvider.ts:65
Text-to-Speech provider interface
Methods
synthesize()
Synthesize speech from text
synthesize(options: TTSOptions): Promise<TTSResponse>;
Parameters:
options:TTSOptions
Returns: Promise<TTSResponse>
listVoices()?
List available voices (optional - some providers return static list)
listVoices?(): Promise<IVoiceInfo[]>;
Returns: Promise<IVoiceInfo[]>
IUserInfoStorage interface
📍 src/domain/interfaces/IUserInfoStorage.ts:46
Storage interface for user information
Implementations handle the actual storage mechanism while the plugin handles the business logic.
Design: Single storage instance handles ALL users. UserId is passed to each method, allowing efficient multi-tenant storage. When userId is undefined, defaults to 'default' user.
Methods
load()
Load user info entries from storage for a specific user
load(userId: string | undefined): Promise<UserInfoEntry[] | null>;
Parameters:
userId:string | undefined
Returns: Promise<UserInfoEntry[] | null>
save()
Save user info entries to storage for a specific user
save(userId: string | undefined, entries: UserInfoEntry[]): Promise<void>;
Parameters:
userId:string | undefinedentries:UserInfoEntry[]
Returns: Promise<void>
delete()
Delete user info from storage for a specific user
delete(userId: string | undefined): Promise<void>;
Parameters:
userId:string | undefined
Returns: Promise<void>
exists()
Check if user info exists in storage for a specific user
exists(userId: string | undefined): Promise<boolean>;
Parameters:
userId:string | undefined
Returns: Promise<boolean>
getPath()
Get the storage path for a specific user (for display/debugging)
getPath(userId: string | undefined): string;
Parameters:
userId:string | undefined
Returns: string
IUserPermissionRulesStorage interface
📍 src/domain/interfaces/IUserPermissionRulesStorage.ts:14
Methods
load()
Load all rules for a user. Returns null if no rules exist.
load(userId: string | undefined): Promise<UserPermissionRule[] | null>;
Parameters:
userId:string | undefined
Returns: Promise<UserPermissionRule[] | null>
save()
Save all rules for a user (full replacement).
save(userId: string | undefined, rules: UserPermissionRule[]): Promise<void>;
Parameters:
userId:string | undefinedrules:UserPermissionRule[]
Returns: Promise<void>
delete()
Delete all rules for a user.
delete(userId: string | undefined): Promise<void>;
Parameters:
userId:string | undefined
Returns: Promise<void>
exists()
Check if rules exist for a user.
exists(userId: string | undefined): Promise<boolean>;
Parameters:
userId:string | undefined
Returns: Promise<boolean>
getPath()
Get storage path (for debugging/display).
getPath(userId: string | undefined): string;
Parameters:
userId:string | undefined
Returns: string
MediaStorageEntry interface
📍 src/domain/interfaces/IMediaStorage.ts:50
Entry returned by list()
Properties
| Property | Type | Description |
|---|---|---|
location |
location: string; |
Location of the file |
mimeType |
mimeType: string; |
MIME type |
size |
size: number; |
File size in bytes |
type? |
`type?: 'image' | 'video' |
createdAt |
createdAt: Date; |
When the file was created |
MediaStorageListOptions interface
📍 src/domain/interfaces/IMediaStorage.ts:66
Options for listing media files
Properties
| Property | Type | Description |
|---|---|---|
type? |
`type?: 'image' | 'video' |
limit? |
limit?: number; |
Maximum number of results |
offset? |
offset?: number; |
Offset for pagination |
MediaStorageMetadata interface
📍 src/domain/interfaces/IMediaStorage.ts:18
IMediaStorage - Storage interface for multimedia outputs (images, video, audio)
Provides CRUD operations for media files produced by generation tools. Implementations can use filesystem, S3, GCS, or any other storage backend.
This follows Clean Architecture - the interface is in domain layer, implementations are in infrastructure layer.
Properties
| Property | Type | Description |
|---|---|---|
type |
`type: 'image' | 'video' |
format |
format: string; |
File format (png, mp4, mp3, etc.) |
model |
model: string; |
Model used for generation |
vendor |
vendor: string; |
Vendor that produced the output |
index? |
index?: number; |
Index for multi-image results |
suggestedFilename? |
suggestedFilename?: string; |
Suggested filename (without path) |
userId? |
userId?: string; |
User ID — set by tool when userId is known, for per-user storage organization |
MediaStorageResult interface
📍 src/domain/interfaces/IMediaStorage.ts:38
Result of a save operation
Properties
| Property | Type | Description |
|---|---|---|
location |
location: string; |
Location of the saved file (file path, URL, S3 key - depends on implementation) |
mimeType |
mimeType: string; |
MIME type of the saved file |
size |
size: number; |
File size in bytes |
NativeContinuationBinding interface
📍 src/domain/interfaces/INativeContinuation.ts:4
Secret-free configured identity; metadata does not authenticate an account.
Properties
| Property | Type | Description |
|---|---|---|
provider |
provider: string; |
- |
connector |
connector: string; |
- |
endpoint |
endpoint: string; |
- |
model |
model: string; |
- |
userId? |
userId?: string; |
- |
accountId? |
accountId?: string; |
- |
authority? |
authority?: string; |
Secret-free host principal/account selection fingerprint. |
scope |
scope: EvidenceScope; |
- |
NativeContinuationSnapshot interface
📍 src/domain/interfaces/INativeContinuation.ts:17
Optional checkpoint envelope. Never restores policy, credentials or a ModelTask.
Properties
| Property | Type | Description |
|---|---|---|
version |
version: 1; |
- |
binding |
binding: NativeContinuationBinding; |
- |
protocol |
protocol: string; |
- |
prefixLength |
prefixLength: number; |
- |
prefixHash |
prefixHash: string; |
- |
sourceReferences |
sourceReferences: EvidenceReference[]; |
- |
state? |
state?: Record<string, unknown>; |
- |
ProviderCapabilities interface
📍 src/domain/interfaces/IProvider.ts:5
Base provider interface
Properties
| Property | Type | Description |
|---|---|---|
text |
text: boolean; |
- |
images |
images: boolean; |
- |
videos |
videos: boolean; |
- |
audio |
audio: boolean; |
- |
embeddings? |
embeddings?: boolean; |
- |
features? |
features?: Record<string, boolean>; |
Optional feature flags for specific capabilities |
RemoteMcpDescriptor interface
📍 src/domain/interfaces/IAdvancedInference.ts:44
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
- |
url |
url: string; |
- |
authorization? |
authorization?: { connector: string; accountId?: string }; |
Named OneRingAI Connector used as the single source of authentication. |
allowedTools? |
allowedTools?: string[]; |
- |
requireApproval? |
`requireApproval?: 'always' | 'never';` |
host-managed approval continuation; never disables provider approval. |
||
Omitted uses the adapter's executable default (OpenAI normalizes to never). |
ScheduleHandle interface
📍 src/domain/interfaces/IScheduler.ts:10
Methods
cancel()
cancel(): void;
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
ScheduleSpec interface
📍 src/domain/interfaces/IScheduler.ts:15
Properties
| Property | Type | Description |
|---|---|---|
cron? |
cron?: string; |
Cron expression (e.g. '0 9 * * 1-5'). Not all implementations support this. |
intervalMs? |
intervalMs?: number; |
Repeat every N milliseconds. |
once? |
once?: number; |
Fire once at this Unix timestamp (ms). |
timezone? |
timezone?: string; |
IANA timezone for cron expressions (e.g. 'America/New_York'). |
SegmentTimestamp interface
📍 src/domain/interfaces/IAudioProvider.ts:166
Segment-level timestamp
Properties
| Property | Type | Description |
|---|---|---|
id |
id: number; |
- |
text |
text: string; |
- |
start |
start: number; |
- |
end |
end: number; |
- |
tokens? |
tokens?: number[]; |
- |
SerializedContextState interface
📍 src/domain/interfaces/IContextStorage.ts:18
Serialized context state for persistence. This is the canonical definition - core layer re-exports this type.
Properties
| Property | Type | Description |
|---|---|---|
providerStateBinding? |
providerStateBinding?: Omit<import('./INativeContinuation.js').NativeContinuationBinding, 'scope'>; |
Optional opaque-state origin; never restores routing policy or authentication. |
nativeContinuation? |
nativeContinuation?: import('./INativeContinuation.js').NativeContinuationSnapshot; |
Optional native continuation; host policy and credentials must be supplied again. |
conversation |
conversation: InputItem[]; |
Conversation history |
pluginStates |
pluginStates: Record<string, unknown>; |
Plugin states (keyed by plugin name) |
systemPrompt? |
systemPrompt?: string; |
System prompt |
metadata |
`metadata: { |
savedAt: number;
agentId?: string;
userId?: string;
model: string;
};| Metadata | |agentState?|agentState?: Record<string, unknown>;` | Agent-specific state (for TaskAgent, UniversalAgent, etc.) |
SerializedHistoryState interface
📍 src/domain/interfaces/IHistoryManager.ts:52
Serialized history state for persistence
Properties
| Property | Type | Description |
|---|---|---|
version |
version: number; |
- |
messages |
messages: HistoryMessage[]; |
- |
summaries? |
summaries?: Array<{ content: string; coversCount: number; timestamp: number }>; |
- |
metadata? |
metadata?: Record<string, unknown>; |
- |
StorageUserContext interface
📍 src/domain/interfaces/StorageContext.ts:18
StorageUserContext — Shared context type for all storage interfaces.
Replaces the bare userId: string | undefined first parameter pattern.
Backward compatible: callers can still pass a plain string or undefined.
Multi-tenant support:
bypassOwnerScope: trueallows admin operations on documents owned by other users (e.g., system routines, shared resources).- The calling application (V25, Hosea) decides when to set this flag after its own authorization checks — the library never makes policy decisions about who is an admin.
Properties
| Property | Type | Description |
|---|---|---|
userId |
userId: string; |
The acting user's ID |
bypassOwnerScope? |
bypassOwnerScope?: boolean; |
When true, storage operations match documents by ID only — not scoped |
| by ownerId. Use for admin/superadmin operations where the caller has | ||
| already verified authorization. |
Default: false (normal user-scoped behavior) |
StoredAgentDefinition interface
📍 src/domain/interfaces/IAgentDefinitionStorage.ts:21
Stored agent definition - everything needed to recreate an agent
Properties
| Property | Type | Description |
|---|---|---|
version |
version: number; |
Format version for migration support |
agentId |
agentId: string; |
Unique agent identifier |
name |
name: string; |
Human-readable agent name |
agentType |
agentType: StoredAgentType; |
Agent type |
createdAt |
createdAt: string; |
When the definition was created |
updatedAt |
updatedAt: string; |
When the definition was last updated |
connector |
`connector: { |
/** Connector name (must be registered at runtime) */
name: string;
/** Model to use */
model: string;
};| Connector configuration | |systemPrompt?|systemPrompt?: string;| System prompt | |instructions?|instructions?: string;| Instructions | |features?|features?: ContextFeatures;| Feature configuration | |metadata?|metadata?: AgentDefinitionMetadata;| Agent metadata | |typeConfig?|typeConfig?: Record<string, unknown>;` | Agent-type-specific configuration |
StoredConnectorConfig interface
📍 src/domain/interfaces/IConnectorConfigStorage.ts:13
Wrapper for stored connector configuration with metadata
Properties
| Property | Type | Description |
|---|---|---|
config |
config: ConnectorConfig; |
The connector configuration (may contain encrypted fields) |
createdAt |
createdAt: number; |
Timestamp when the config was first stored |
updatedAt |
updatedAt: number; |
Timestamp when the config was last updated |
version |
version: number; |
Schema version for future migrations |
templateCredentials? |
templateCredentials?: Record<string, string>; |
Raw non-secret template credentials for round-trip editing. |
| Populated by saveFromTemplate() / updateFromTemplate(). | ||
| Contains only non-secret fields (clientId, tenantId, scope, redirectUri, etc.). | ||
| Secret fields (apiKey, clientSecret, privateKey, etc.) are NEVER stored here. | ||
| Used by edit UIs to re-populate form fields without needing to decrypt config.auth. | ||
vendorId? |
vendorId?: string; |
Vendor ID used to create this connector (e.g., 'microsoft', 'slack') |
authTemplateId? |
authTemplateId?: string; |
Auth template ID used (e.g., 'oauth-user', 'pat', 'bot-token') |
TextCompactionResponse interface
📍 src/domain/interfaces/ITextProvider.ts:134
Properties
| Property | Type | Description |
|---|---|---|
input |
input: InputItem[]; |
Complete canonical next prefix, including retained items and opaque state. |
usage |
`usage: TokenUsage | null;` |
protocol |
protocol: string; |
- |
providerResponseId? |
providerResponseId?: string; |
- |
state? |
state?: Record<string, unknown>; |
Optional persisted diagnostics. All state needed for provider replay belongs in input. |
TextGenerateOptions interface
📍 src/domain/interfaces/ITextProvider.ts:40
Properties
| Property | Type | Description |
|---|---|---|
nativeCompactionSource? |
nativeCompactionSource?: boolean; |
- |
nativeContext? |
nativeContext?: boolean; |
- |
managedDispatch? |
managedDispatch?: { prepare(): Promise<void>; assertCurrent(): void; onDispatch?(): void }; |
- |
signal? |
signal?: AbortSignal; |
Optional cooperative cancellation for this provider call. |
model |
model: string; |
- |
input |
`input: string | InputItem[];` |
instructions? |
instructions?: string; |
- |
tools? |
tools?: Tool[]; |
- |
tool_choice? |
`tool_choice?: 'auto' | 'required' |
temperature? |
temperature?: number; |
- |
parameterPolicy? |
parameterPolicy?: import('../../capabilities/metadata/parameters.js').ModelParameterPolicy; |
Explicit request policy; absence preserves legacy validation/count behavior. |
max_output_tokens? |
max_output_tokens?: number; |
- |
response_format? |
`response_format?: { |
type: 'text' | 'json_object' | 'json_schema';
json_schema?: any;
};| - | |parallel_tool_calls?|parallel_tool_calls?: boolean;| - | |previous_response_id?|previous_response_id?: string;| - | |continuation_token?|continuation_token?: string;| Opaque provider token used to resume an incomplete long decode. | |metadata?|metadata?: Record<string, string>;| - | |prompt_cache?|prompt_cache?: PromptCachePolicy;| Provider-neutral prompt-cache policy. Unsupported strict requests fail before execution.mode: 'off'suppresses library-requested cache controls but cannot disable provider-implicit caching. | |native_tools?|native_tools?: NativeToolRequest[];| Provider-hosted tools. These are not executed by ToolManager. | |data_handling?|data_handling?: DataHandlingPolicy;| Host policy for retention-sensitive provider features. | |credential_context?|credential_context?: { userId?: string; connectorRegistry?: IConnectorRegistry };| - | |thinking?|thinking?: ThinkingConfig;| Vendor-agnostic thinking/reasoning configuration | |vendorOptions?|vendorOptions?: Record<string, any>;| Vendor-specific options (e.g., Google's thinkingLevel, OpenAI's reasoning_effort) | |skipContextLimitCheck?|skipContextLimitCheck?: boolean;` | Skip pre-flight context limit check. Default: false (check is ON) |
ThinkingConfig interface
📍 src/domain/interfaces/ITextProvider.ts:30
Properties
| Property | Type | Description |
|---|---|---|
enabled |
enabled: boolean; |
- |
mode? |
`mode?: 'adaptive' | 'enabled' |
budgetTokens? |
budgetTokens?: number; |
Fixed reasoning-token budget for models that still expose budget-based thinking. |
effort? |
effort?: ReasoningEffort; |
Model-selected reasoning depth for OpenAI, Anthropic, and Gemini models. |
UserInfoEntry interface
📍 src/domain/interfaces/IUserInfoStorage.ts:17
IUserInfoStorage - Storage interface for user information
Abstracted storage interface following Clean Architecture principles. Implementations can use file system, database, or any other storage backend.
User information is stored per userId - each user has their own isolated data.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
User-supplied key (e.g., "theme", "language") |
value |
value: unknown; |
Value (any JSON-serializable data) |
valueType |
`valueType: 'string' | 'number' |
description? |
description?: string; |
Optional description for self-documentation |
createdAt |
createdAt: number; |
Timestamp when entry was first created |
updatedAt |
updatedAt: number; |
Timestamp when entry was last updated |
WordTimestamp interface
📍 src/domain/interfaces/IAudioProvider.ts:153
Word-level timestamp
Properties
| Property | Type | Description |
|---|---|---|
word |
word: string; |
- |
start |
start: number; |
- |
end |
end: number; |
- |
speaker? |
`speaker?: string | number;` |
channel? |
channel?: number; |
Source channel for multichannel transcription. |
BatchProcessingState type
📍 src/domain/interfaces/IAdvancedInference.ts:135
type BatchProcessingState = | 'queued'
| 'in_progress'
| 'completed'
| 'cancelling'
| 'cancelled'
| 'expired'
| 'failed'
ConnectorAccessContext type
📍 src/domain/interfaces/IConnectorAccessPolicy.ts:15
Opaque context passed to access policy checks. Library imposes no structure — consumers define their own shape (e.g., { userId, tenantId, roles }).
type ConnectorAccessContext = Record<string, unknown>
EmbeddingContentPart type
📍 src/domain/interfaces/IEmbeddingProvider.ts:7
type EmbeddingContentPart = | { type: 'text'; text: string }
| { type: 'image' | 'audio' | 'video' | 'document'; data: Buffer | string; mimeType?: string }
EvidenceDurability type
📍 src/domain/interfaces/IEvidenceStorage.ts:9
Acknowledgement strength; fsync is local filesystem durability, not replication.
type EvidenceDurability = 'process' | 'restart' | 'fsync'
HistoryEntryType type
📍 src/domain/interfaces/IHistoryJournal.ts:43
Type of history entry, derived from the message's role/purpose.
type HistoryEntryType = 'user' | 'assistant' | 'tool_result' | 'system'
MCPClientConnectionState type
📍 src/domain/interfaces/IMCPClient.ts:24
MCP Client connection states
type MCPClientConnectionState = | 'disconnected'
| 'connecting'
| 'connected'
| 'reconnecting'
| 'failed'
PromptCachePolicy type
📍 src/domain/interfaces/IAdvancedInference.ts:7
Provider-neutral contracts for advanced text-inference capabilities.
These types deliberately contain no host persistence or product semantics.
type PromptCachePolicy = | {
/**
* Do not request or configure provider caching through OneRingAI.
* This cannot disable caching that a provider applies implicitly to all
* eligible requests; consult getAdvancedCapabilities().promptCaching.
*/
mode: 'off';
}
| {
mode: 'auto';
ttl?: 'short' | 'extended';
key?: string;
/**
* OpenAI GPT-5.6+ cache-breakpoint selection. `implicit` keeps the
* provider-selected breakpoint; `explicit` only uses content blocks
* marked with `promptCacheBreakpoint`.
*/
breakpointMode?: 'implicit' | 'explicit';
strict?: boolean;
}
PromptCachingMode type
📍 src/domain/interfaces/IAdvancedInference.ts:29
type PromptCachingMode = 'unsupported' | 'implicit' | 'request_controlled' | 'explicit_resource'
ReasoningEffort type
📍 src/domain/interfaces/ITextProvider.ts:21
Cross-vendor reasoning-depth controls. Individual models may support a subset.
type ReasoningEffort = | 'none'
| 'minimal'
| 'low'
| 'medium'
| 'high'
| 'xhigh'
| 'max'
StorageUserContextInput type
📍 src/domain/interfaces/StorageContext.ts:36
Accepted input type for storage methods. Maintains backward compatibility: bare string, undefined, or full context.
type StorageUserContextInput = string | undefined | StorageUserContext
StoredAgentType type
📍 src/domain/interfaces/IAgentDefinitionStorage.ts:16
Agent type identifier
type StoredAgentType = 'agent' | 'task-agent' | 'universal-agent' | 'research-agent' | string
assertNotDestroyed function
📍 src/domain/interfaces/IDisposable.ts:50
Helper to check if an object is destroyed and throw if so.
export function assertNotDestroyed(obj: IDisposable | IAsyncDisposable, operation: string): void
resolveStorageUserContext function
📍 src/domain/interfaces/StorageContext.ts:45
Resolve any accepted input to a normalized StorageUserContext.
undefined→{ userId: 'default' }'user-123'→{ userId: 'user-123' }{ userId: 'user-123', bypassOwnerScope: true }→ passed through
export function resolveStorageUserContext(ctx: StorageUserContextInput): StorageUserContext
DEFAULT_HISTORY_MANAGER_CONFIG const
📍 src/domain/interfaces/IHistoryManager.ts:169
Default configuration
Properties
| Property | Type | Description |
|---|---|---|
maxMessages |
50 |
- |
maxTokens |
32000 |
- |
compactionStrategy |
'sliding-window' |
- |
preserveRecentCount |
10 |
- |