Documentation/Interfaces
v2.0.0-beta.1Snapshot bebdcd1Markdown ↗

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&lt;string, string&gt;; -
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&lt;string, unknown&gt;; 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&lt;string, unknown&gt;; -

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

typescript
save(definition: StoredAgentDefinition): Promise&lt;void&gt;;

Parameters:

  • definition: StoredAgentDefinition

Returns: Promise&lt;void&gt;

load()

Load an agent definition

typescript
load(agentId: string): Promise&lt;StoredAgentDefinition | null&gt;;

Parameters:

  • agentId: string

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

delete()

Delete an agent definition

typescript
delete(agentId: string): Promise&lt;void&gt;;

Parameters:

  • agentId: string

Returns: Promise&lt;void&gt;

exists()

Check if an agent definition exists

typescript
exists(agentId: string): Promise&lt;boolean&gt;;

Parameters:

  • agentId: string

Returns: Promise&lt;boolean&gt;

list()

List all agent definitions (summaries only)

typescript
list(options?: AgentDefinitionListOptions): Promise&lt;AgentDefinitionSummary[]&gt;;

Parameters:

  • options: AgentDefinitionListOptions | undefined (optional)

Returns: Promise&lt;AgentDefinitionSummary[]&gt;

updateMetadata()?

Update agent definition metadata without loading full definition

typescript
updateMetadata?(
    agentId: string,
    metadata: Partial&lt;AgentDefinitionMetadata&gt;
  ): Promise&lt;void&gt;;

Parameters:

  • agentId: string
  • metadata: Partial&lt;AgentDefinitionMetadata&gt;

Returns: Promise&lt;void&gt;

getPath()

Get the storage path/location (for display/debugging)

typescript
getPath(): string;

Returns: string


IAgentStateStorage interface

📍 src/domain/interfaces/IAgentStateStorage.ts:8

Methods

save()

Save agent state

typescript
save(state: AgentState): Promise&lt;void&gt;;

Parameters:

  • state: AgentState

Returns: Promise&lt;void&gt;

load()

Load agent state

typescript
load(agentId: string): Promise&lt;AgentState | undefined&gt;;

Parameters:

  • agentId: string

Returns: Promise&lt;AgentState | undefined&gt;

delete()

Delete agent state

typescript
delete(agentId: string): Promise&lt;void&gt;;

Parameters:

  • agentId: string

Returns: Promise&lt;void&gt;

list()

List agents by status

typescript
list(filter?: { status?: AgentStatus[] }): Promise&lt;AgentState[]&gt;;

Parameters:

  • filter: { status?: AgentStatus[] | undefined; } | undefined (optional)

Returns: Promise&lt;AgentState[]&gt;

patch()

Update specific fields (partial update for efficiency)

typescript
patch(agentId: string, updates: Partial&lt;AgentState&gt;): Promise&lt;void&gt;;

Parameters:

  • agentId: string
  • updates: Partial&lt;AgentState&gt;

Returns: Promise&lt;void&gt;


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.

typescript
destroy(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

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()

typescript
submitBatch(
    requests: Array&lt;BatchTextRequest&lt;TOptions&gt;&gt;,
    options?: BatchSubmitOptions,
  ): Promise&lt;BatchHandle&gt;;

Parameters:

  • requests: BatchTextRequest&lt;TOptions&gt;[]
  • options: BatchSubmitOptions | undefined (optional)

Returns: Promise&lt;BatchHandle&gt;

getBatch()

typescript
getBatch(id: string): Promise&lt;BatchHandle&gt;;

Parameters:

  • id: string

Returns: Promise&lt;BatchHandle&gt;

cancelBatch()

typescript
cancelBatch(id: string): Promise&lt;BatchHandle&gt;;

Parameters:

  • id: string

Returns: Promise&lt;BatchHandle&gt;

getBatchResults()

typescript
getBatchResults(id: string): AsyncIterable&lt;BatchTextResult&lt;TResponse&gt;&gt;;

Parameters:

  • id: string

Returns: AsyncIterable&lt;BatchTextResult&lt;TResponse&gt;&gt;


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.

typescript
canAccess(connector: Connector, context: ConnectorAccessContext): boolean;

Parameters:

  • connector: Connector
  • context: 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

typescript
save(name: string, stored: StoredConnectorConfig): Promise&lt;void&gt;;

Parameters:

  • name: string
  • stored: StoredConnectorConfig

Returns: Promise&lt;void&gt;

get()

Retrieve a connector configuration by name

typescript
get(name: string): Promise&lt;StoredConnectorConfig | null&gt;;

Parameters:

  • name: string

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

delete()

Delete a connector configuration

typescript
delete(name: string): Promise&lt;boolean&gt;;

Parameters:

  • name: string

Returns: Promise&lt;boolean&gt;

has()

Check if a connector configuration exists

typescript
has(name: string): Promise&lt;boolean&gt;;

Parameters:

  • name: string

Returns: Promise&lt;boolean&gt;

list()

List all connector names

typescript
list(): Promise&lt;string[]&gt;;

Returns: Promise&lt;string[]&gt;

listAll()

Get all stored connector configurations

typescript
listAll(): Promise&lt;StoredConnectorConfig[]&gt;;

Returns: Promise&lt;StoredConnectorConfig[]&gt;


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.

typescript
get(name: string): Connector;

Parameters:

  • name: string

Returns: Connector

has()

Check if a connector exists (and is accessible)

typescript
has(name: string): boolean;

Parameters:

  • name: string

Returns: boolean

list()

List all accessible connector names

typescript
list(): string[];

Returns: string[]

listAll()

List all accessible connector instances

typescript
listAll(): Connector[];

Returns: Connector[]

size()

Get number of accessible connectors

typescript
size(): number;

Returns: number

getDescriptionsForTools()

Get connector descriptions formatted for tool parameters

typescript
getDescriptionsForTools(): string;

Returns: string

getInfo()

Get connector info map

typescript
getInfo(): Record&lt;string, { displayName: string; description: string; baseURL: string }&gt;;

Returns: Record&lt;string, { displayName: string; description: string; baseURL: string; }&gt;

getById()?

Get a connector by ID. Optional — not all registries support ID-based lookup. Uses the same ConnectorNotFoundError contract as get().

typescript
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.

typescript
warmup?(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;


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

typescript
save(
    sessionId: string,
    state: SerializedContextState,
    metadata?: ContextSessionMetadata
  ): Promise&lt;void&gt;;

Parameters:

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

Returns: Promise&lt;void&gt;

load()

Load context state from a session

typescript
load(sessionId: string): Promise&lt;StoredContextSession | null&gt;;

Parameters:

  • sessionId: string

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

delete()

Delete a session

typescript
delete(sessionId: string): Promise&lt;void&gt;;

Parameters:

  • sessionId: string

Returns: Promise&lt;void&gt;

exists()

Check if a session exists

typescript
exists(sessionId: string): Promise&lt;boolean&gt;;

Parameters:

  • sessionId: string

Returns: Promise&lt;boolean&gt;

list()

List all sessions (summaries only, not full state)

typescript
list(options?: ContextStorageListOptions): Promise&lt;ContextSessionSummary[]&gt;;

Parameters:

  • options: ContextStorageListOptions | undefined (optional)

Returns: Promise&lt;ContextSessionSummary[]&gt;

updateMetadata()?

Update session metadata without loading full state

typescript
updateMetadata?(
    sessionId: string,
    metadata: Partial&lt;ContextSessionMetadata&gt;
  ): Promise&lt;void&gt;;

Parameters:

  • sessionId: string
  • metadata: Partial&lt;ContextSessionMetadata&gt;

Returns: Promise&lt;void&gt;

getPath()

Get the storage path (for display/debugging)

typescript
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.

typescript
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.

typescript
save(correlationId: string, ref: SessionRef): Promise&lt;void&gt;;

Parameters:

  • correlationId: string
  • ref: SessionRef

Returns: Promise&lt;void&gt;

resolve()

Resolve a correlation ID to a session reference. Returns null if not found or expired.

typescript
resolve(correlationId: string): Promise&lt;SessionRef | null&gt;;

Parameters:

  • correlationId: string

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

delete()

Delete a correlation mapping.

typescript
delete(correlationId: string): Promise&lt;void&gt;;

Parameters:

  • correlationId: string

Returns: Promise&lt;void&gt;

exists()

Check if a correlation exists and is not expired.

typescript
exists(correlationId: string): Promise&lt;boolean&gt;;

Parameters:

  • correlationId: string

Returns: Promise&lt;boolean&gt;

listBySession()

List all correlations for a given session. Useful for cleanup when a session is resumed or deleted.

typescript
listBySession(sessionId: string): Promise&lt;string[]&gt;;

Parameters:

  • sessionId: string

Returns: Promise&lt;string[]&gt;

listByAgent()

List all correlations for a given agent.

typescript
listByAgent(agentId: string): Promise&lt;CorrelationSummary[]&gt;;

Parameters:

  • agentId: string

Returns: Promise&lt;CorrelationSummary[]&gt;

pruneExpired()

Remove all expired correlations.

typescript
pruneExpired(): Promise&lt;number&gt;;

Returns: Promise&lt;number&gt;

getPath()

Get the storage path (for debugging/logging).

typescript
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).

typescript
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

typescript
embed(options: EmbeddingOptions): Promise&lt;EmbeddingResponse&gt;;

Parameters:

  • options: EmbeddingOptions

Returns: Promise&lt;EmbeddingResponse&gt;

listModels()?

List available embedding models (optional)

typescript
listModels?(): Promise&lt;string[]&gt;;

Returns: Promise&lt;string[]&gt;


IEvidenceStorage interface

📍 src/domain/interfaces/IEvidenceStorage.ts:71

Scoped immutable records. Missing/expired references return null; corruption throws.

Methods

put()

typescript
put(record: EvidenceRecord): Promise&lt;EvidenceReference&gt;;

Parameters:

  • record: EvidenceRecord

Returns: Promise&lt;EvidenceReference&gt;

getReference()?

Optional efficient scoped ID lookup; implementations verify stored integrity before returning metadata.

typescript
getReference?(id: string, signal?: AbortSignal): Promise&lt;EvidenceReference | null&gt;;

Parameters:

  • id: string
  • signal: AbortSignal | undefined (optional)

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

read()

Integrity checks cover the entire bounded blob even when reading a chunk.

typescript
read(reference: EvidenceReference, options?: EvidenceReadOptions): Promise&lt;EvidenceChunk | null&gt;;

Parameters:

  • reference: EvidenceReference
  • options: EvidenceReadOptions | undefined (optional)

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

readRecord()

Host-only full read, still bounded by maxRecordBytes (default 4 MiB).

typescript
readRecord(reference: EvidenceReference): Promise&lt;EvidenceRecord | null&gt;;

Parameters:

  • reference: EvidenceReference

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

list()

typescript
list(options?: { after?: string; limit?: number; signal?: AbortSignal }): Promise&lt;{ entries: EvidenceEntry[]; next?: string }&gt;;

Parameters:

  • options: { after?: string | undefined; limit?: number | undefined; signal?: AbortSignal | undefined; } | undefined (optional)

Returns: Promise&lt;{ entries: EvidenceEntry[]; next?: string | undefined; }&gt;

delete()

typescript
delete(reference: EvidenceReference): Promise&lt;boolean&gt;;

Parameters:

  • reference: EvidenceReference

Returns: Promise&lt;boolean&gt;

pruneExpired()

Explicit host maintenance; no scratch eviction or compaction deletes evidence.

typescript
pruneExpired(now?: number): Promise&lt;number&gt;;

Parameters:

  • now: number | undefined (optional)

Returns: Promise&lt;number&gt;

Properties
Property Type Description
scope readonly scope: Readonly&lt;EvidenceScope&gt;; -
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.

typescript
append(sessionId: string, entries: HistoryEntry[]): Promise&lt;void&gt;;

Parameters:

  • sessionId: string
  • entries: HistoryEntry[]

Returns: Promise&lt;void&gt;

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.

typescript
replaceLast?(
    sessionId: string,
    type: HistoryEntryType,
    turnIndex: number,
    entry: HistoryEntry,
  ): Promise&lt;boolean&gt;;

Parameters:

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

Returns: Promise&lt;boolean&gt;

read()

Read history entries with optional filtering and pagination.

Entries are returned in chronological order (oldest first).

typescript
read(sessionId: string, options?: HistoryReadOptions): Promise&lt;HistoryEntry[]&gt;;

Parameters:

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

Returns: Promise&lt;HistoryEntry[]&gt;

count()

Get the total number of entries in the journal.

typescript
count(sessionId: string): Promise&lt;number&gt;;

Parameters:

  • sessionId: string

Returns: Promise&lt;number&gt;

clear()

Delete all history for a session.

Called when a session is deleted via IContextStorage.delete().

typescript
clear(sessionId: string): Promise&lt;void&gt;;

Parameters:

  • sessionId: string

Returns: Promise&lt;void&gt;

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.

typescript
stream?(sessionId: string, options?: HistoryReadOptions): AsyncIterable&lt;HistoryEntry&gt;;

Parameters:

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

Returns: AsyncIterable&lt;HistoryEntry&gt;

getLocation()?

Get a human-readable location string for debugging/display.

typescript
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

typescript
addMessage(role: 'user' | 'assistant' | 'system', content: string, metadata?: Record&lt;string, unknown&gt;): Promise&lt;HistoryMessage&gt;;

Parameters:

  • role: "user" | "assistant" | "system"
  • content: string
  • metadata: Record&lt;string, unknown&gt; | undefined (optional)

Returns: Promise&lt;HistoryMessage&gt;

getMessages()

Get all messages (may include summaries as system messages)

typescript
getMessages(): Promise&lt;HistoryMessage[]&gt;;

Returns: Promise&lt;HistoryMessage[]&gt;

getRecentMessages()

Get recent messages only

typescript
getRecentMessages(count?: number): Promise&lt;HistoryMessage[]&gt;;

Parameters:

  • count: number | undefined (optional)

Returns: Promise&lt;HistoryMessage[]&gt;

formatForContext()

Get formatted history for LLM context

typescript
formatForContext(options?: { maxTokens?: number; includeMetadata?: boolean }): Promise&lt;string&gt;;

Parameters:

  • options: { maxTokens?: number | undefined; includeMetadata?: boolean | undefined; } | undefined (optional)

Returns: Promise&lt;string&gt;

compact()

Compact history (apply compaction strategy)

typescript
compact(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

clear()

Clear all history

typescript
clear(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

getMessageCount()

Get message count

typescript
getMessageCount(): Promise&lt;number&gt;;

Returns: Promise&lt;number&gt;

getState()

Get state for session persistence

typescript
getState(): Promise&lt;SerializedHistoryState&gt;;

Returns: Promise&lt;SerializedHistoryState&gt;

restoreState()

Restore from saved state

typescript
restoreState(state: SerializedHistoryState): Promise&lt;void&gt;;

Parameters:

  • state: SerializedHistoryState

Returns: Promise&lt;void&gt;

getConfig()

Get current configuration

typescript
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

typescript
addMessage(message: HistoryMessage): Promise&lt;void&gt;;

Parameters:

  • message: HistoryMessage

Returns: Promise&lt;void&gt;

getMessages()

Get all messages

typescript
getMessages(): Promise&lt;HistoryMessage[]&gt;;

Returns: Promise&lt;HistoryMessage[]&gt;

getRecentMessages()

Get recent N messages

typescript
getRecentMessages(count: number): Promise&lt;HistoryMessage[]&gt;;

Parameters:

  • count: number

Returns: Promise&lt;HistoryMessage[]&gt;

removeMessage()

Remove a message by ID

typescript
removeMessage(id: string): Promise&lt;void&gt;;

Parameters:

  • id: string

Returns: Promise&lt;void&gt;

removeOlderThan()

Remove messages older than timestamp

typescript
removeOlderThan(timestamp: number): Promise&lt;number&gt;;

Parameters:

  • timestamp: number

Returns: Promise&lt;number&gt;

clear()

Clear all messages

typescript
clear(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

getCount()

Get message count

typescript
getCount(): Promise&lt;number&gt;;

Returns: Promise&lt;number&gt;

getState()

Get serialized state for session persistence

typescript
getState(): Promise&lt;SerializedHistoryState&gt;;

Returns: Promise&lt;SerializedHistoryState&gt;

restoreState()

Restore from serialized state

typescript
restoreState(state: SerializedHistoryState): Promise&lt;void&gt;;

Parameters:

  • state: SerializedHistoryState

Returns: Promise&lt;void&gt;


IMCPClient interface

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

MCP Client interface

Methods

connect()

Connect to the MCP server

typescript
connect(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

disconnect()

Disconnect from the MCP server

typescript
disconnect(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

reconnect()

Reconnect to the MCP server

typescript
reconnect(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

isConnected()

Check if connected

typescript
isConnected(): boolean;

Returns: boolean

ping()

Ping the server to check health

typescript
ping(): Promise&lt;boolean&gt;;

Returns: Promise&lt;boolean&gt;

listTools()

List available tools from the server

typescript
listTools(): Promise&lt;MCPTool[]&gt;;

Returns: Promise&lt;MCPTool[]&gt;

callTool()

Call a tool on the server

typescript
callTool(name: string, args: Record&lt;string, unknown&gt;): Promise&lt;MCPToolResult&gt;;

Parameters:

  • name: string
  • args: Record&lt;string, unknown&gt;

Returns: Promise&lt;MCPToolResult&gt;

registerTools()

Register all tools with a ToolManager

typescript
registerTools(toolManager: ToolManager): void;

Parameters:

  • toolManager: ToolManager

Returns: void

registerToolsSelective()

Register specific tools with a ToolManager (selective registration)

typescript
registerToolsSelective(toolManager: ToolManager, toolNames?: string[]): void;

Parameters:

  • toolManager: ToolManager
  • toolNames: string[] | undefined (optional)

Returns: void

unregisterTools()

Unregister all tools from a ToolManager

typescript
unregisterTools(toolManager: ToolManager): void;

Parameters:

  • toolManager: ToolManager

Returns: void

listResources()

List available resources from the server

typescript
listResources(): Promise&lt;MCPResource[]&gt;;

Returns: Promise&lt;MCPResource[]&gt;

readResource()

Read a resource from the server

typescript
readResource(uri: string): Promise&lt;MCPResourceContent&gt;;

Parameters:

  • uri: string

Returns: Promise&lt;MCPResourceContent&gt;

subscribeResource()

Subscribe to resource updates

typescript
subscribeResource(uri: string): Promise&lt;void&gt;;

Parameters:

  • uri: string

Returns: Promise&lt;void&gt;

unsubscribeResource()

Unsubscribe from resource updates

typescript
unsubscribeResource(uri: string): Promise&lt;void&gt;;

Parameters:

  • uri: string

Returns: Promise&lt;void&gt;

listPrompts()

List available prompts from the server

typescript
listPrompts(): Promise&lt;MCPPrompt[]&gt;;

Returns: Promise&lt;MCPPrompt[]&gt;

getPrompt()

Get a prompt from the server

typescript
getPrompt(name: string, args?: Record&lt;string, unknown&gt;): Promise&lt;MCPPromptResult&gt;;

Parameters:

  • name: string
  • args: Record&lt;string, unknown&gt; | undefined (optional)

Returns: Promise&lt;MCPPromptResult&gt;

getState()

Get current state for serialization

typescript
getState(): MCPClientState;

Returns: MCPClientState

loadState()

Load state from serialization

typescript
loadState(state: MCPClientState): void;

Parameters:

  • state: MCPClientState

Returns: void

destroy()

Destroy the client and clean up resources

typescript
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

typescript
save(data: Buffer, metadata: MediaStorageMetadata): Promise&lt;MediaStorageResult&gt;;

Parameters:

  • data: Buffer&lt;ArrayBufferLike&gt;
  • metadata: MediaStorageMetadata

Returns: Promise&lt;MediaStorageResult&gt;

read()

Read media data from storage

typescript
read(location: string): Promise&lt;Buffer | null&gt;;

Parameters:

  • location: string

Returns: Promise&lt;Buffer&lt;ArrayBufferLike&gt; | null&gt;

delete()

Delete media from storage

typescript
delete(location: string): Promise&lt;void&gt;;

Parameters:

  • location: string

Returns: Promise&lt;void&gt;

exists()

Check if media exists in storage

typescript
exists(location: string): Promise&lt;boolean&gt;;

Parameters:

  • location: string

Returns: Promise&lt;boolean&gt;

list()?

List media files in storage (optional)

typescript
list?(options?: MediaStorageListOptions): Promise&lt;MediaStorageEntry[]&gt;;

Parameters:

  • options: MediaStorageListOptions | undefined (optional)

Returns: Promise&lt;MediaStorageEntry[]&gt;

getPath()

Get the storage path/location (for display/debugging)

typescript
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

typescript
load(): Promise&lt;InstructionEntry[] | null&gt;;

Returns: Promise&lt;InstructionEntry[] | null&gt;

save()

Save instruction entries to storage

typescript
save(entries: InstructionEntry[]): Promise&lt;void&gt;;

Parameters:

  • entries: InstructionEntry[]

Returns: Promise&lt;void&gt;

delete()

Delete instructions from storage

typescript
delete(): Promise&lt;void&gt;;

Returns: Promise&lt;void&gt;

exists()

Check if instructions exist in storage

typescript
exists(): Promise&lt;boolean&gt;;

Returns: Promise&lt;boolean&gt;

getPath()

Get the storage path (for display/debugging)

typescript
getPath(): string;

Returns: string


IProvider interface

📍 src/domain/interfaces/IProvider.ts:15

Methods

validateConfig()

Validate that the provider configuration is correct

typescript
validateConfig(): Promise&lt;boolean&gt;;

Returns: Promise&lt;boolean&gt;

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()

typescript
save(context: StorageUserContextInput, definition: RoutineDefinition): Promise&lt;void&gt;;

Parameters:

  • context: StorageUserContextInput
  • definition: RoutineDefinition

Returns: Promise&lt;void&gt;

load()

typescript
load(context: StorageUserContextInput, id: string): Promise&lt;RoutineDefinition | null&gt;;

Parameters:

  • context: StorageUserContextInput
  • id: string

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

delete()

typescript
delete(context: StorageUserContextInput, id: string): Promise&lt;void&gt;;

Parameters:

  • context: StorageUserContextInput
  • id: string

Returns: Promise&lt;void&gt;

exists()

typescript
exists(context: StorageUserContextInput, id: string): Promise&lt;boolean&gt;;

Parameters:

  • context: StorageUserContextInput
  • id: string

Returns: Promise&lt;boolean&gt;

list()

List routine summaries (slim projection). Use load(id) to fetch the full definition for any returned entry.

typescript
list(context: StorageUserContextInput, options?: {
    tags?: string[];
    search?: string;
    limit?: number;
    offset?: number;
  }): Promise&lt;RoutineSummary[]&gt;;

Parameters:

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

Returns: Promise&lt;RoutineSummary[]&gt;

getPath()

typescript
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.

typescript
insert(context: StorageUserContextInput, record: RoutineExecutionRecord): Promise&lt;string&gt;;

Parameters:

  • context: StorageUserContextInput
  • record: RoutineExecutionRecord

Returns: Promise&lt;string&gt;

update()

Update top-level fields on an execution record.

typescript
update(
    id: string,
    updates: Partial&lt;
      Pick&lt;RoutineExecutionRecord, 'status' | 'progress' | 'error' | 'completedAt' | 'lastActivityAt'&gt;
    &gt;,
  ): Promise&lt;void&gt;;

Parameters:

  • id: string
  • updates: Partial&lt;Pick&lt;RoutineExecutionRecord, "error" | "status" | "progress" | "completedAt" | "lastActivityAt"&gt;&gt;

Returns: Promise&lt;void&gt;

pushStep()

Append a step to the execution's steps array.

typescript
pushStep(id: string, step: RoutineExecutionStep): Promise&lt;void&gt;;

Parameters:

  • id: string
  • step: RoutineExecutionStep

Returns: Promise&lt;void&gt;

updateTask()

Update a specific task snapshot within the execution record.

typescript
updateTask(id: string, taskName: string, updates: Partial&lt;RoutineTaskSnapshot&gt;): Promise&lt;void&gt;;

Parameters:

  • id: string
  • taskName: string
  • updates: Partial&lt;RoutineTaskSnapshot&gt;

Returns: Promise&lt;void&gt;

load()

Load a single execution record by ID.

typescript
load(id: string): Promise&lt;RoutineExecutionRecord | null&gt;;

Parameters:

  • id: string

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

list()

List execution records with optional filters.

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

Parameters:

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

Returns: Promise&lt;RoutineExecutionRecord[]&gt;

hasRunning()

Check if a routine has a currently running execution.

typescript
hasRunning(context: StorageUserContextInput, routineId: string): Promise&lt;boolean&gt;;

Parameters:

  • context: StorageUserContextInput
  • routineId: string

Returns: Promise&lt;boolean&gt;


IScheduler interface

📍 src/domain/interfaces/IScheduler.ts:26

Methods

schedule()

Schedule a callback. Returns a handle to cancel it.

typescript
schedule(id: string, spec: ScheduleSpec, callback: () =&gt; void | Promise&lt;void&gt;): ScheduleHandle;

Parameters:

  • id: string
  • spec: ScheduleSpec
  • callback: () =&gt; void | Promise&lt;void&gt;

Returns: ScheduleHandle

cancel()

Cancel a scheduled callback by ID.

typescript
cancel(id: string): void;

Parameters:

  • id: string

Returns: void

cancelAll()

Cancel all scheduled callbacks.

typescript
cancelAll(): void;

Returns: void

has()

Check if a schedule exists by ID.

typescript
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

typescript
transcribe(options: STTOptions): Promise&lt;STTResponse&gt;;

Parameters:

  • options: STTOptions

Returns: Promise&lt;STTResponse&gt;

translate()?

Translate audio to English text (optional, Whisper-specific)

typescript
translate?(options: STTOptions): Promise&lt;STTResponse&gt;;

Parameters:

  • options: STTOptions

Returns: Promise&lt;STTResponse&gt;


ITextCompactionProvider interface

📍 src/domain/interfaces/ITextProvider.ts:129

Methods

compact()

typescript
compact(options: TextGenerateOptions): Promise&lt;TextCompactionResponse&gt;;

Parameters:

  • options: TextGenerateOptions

Returns: Promise&lt;TextCompactionResponse&gt;

countInput()

typescript
countInput(options: TextGenerateOptions): Promise&lt;number | null&gt;;

Parameters:

  • options: TextGenerateOptions

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


ITextProvider interface

📍 src/domain/interfaces/ITextProvider.ts:98

Methods

generate()

Generate text response

typescript
generate(options: TextGenerateOptions): Promise&lt;LLMResponse&gt;;

Parameters:

  • options: TextGenerateOptions

Returns: Promise&lt;LLMResponse&gt;

streamGenerate()

Stream text response with real-time events Returns an async iterator of streaming events

typescript
streamGenerate(options: TextGenerateOptions): AsyncIterableIterator&lt;StreamEvent&gt;;

Parameters:

  • options: TextGenerateOptions

Returns: AsyncIterableIterator&lt;StreamEvent&gt;

getModelCapabilities()

Get model capabilities

typescript
getModelCapabilities(model: string): ModelCapabilities;

Parameters:

  • model: string

Returns: ModelCapabilities

getAdvancedCapabilities()?

Executable advanced capabilities for a concrete model/provider pair.

typescript
getAdvancedCapabilities?(model: string): AdvancedTextCapabilities;

Parameters:

  • model: string

Returns: AdvancedTextCapabilities

listModels()

List available models from the provider's API

typescript
listModels(): Promise&lt;string[]&gt;;

Returns: Promise&lt;string[]&gt;

Properties
Property Type Description
compaction? readonly compaction?: ITextCompactionProvider; Optional standalone native context operations; existing providers need no changes.
batch? readonly batch?: IAsyncTextBatchProvider&lt;TextGenerateOptions, LLMResponse&gt;; 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

typescript
synthesize(options: TTSOptions): Promise&lt;TTSResponse&gt;;

Parameters:

  • options: TTSOptions

Returns: Promise&lt;TTSResponse&gt;

listVoices()?

List available voices (optional - some providers return static list)

typescript
listVoices?(): Promise&lt;IVoiceInfo[]&gt;;

Returns: Promise&lt;IVoiceInfo[]&gt;


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

typescript
load(userId: string | undefined): Promise&lt;UserInfoEntry[] | null&gt;;

Parameters:

  • userId: string | undefined

Returns: Promise&lt;UserInfoEntry[] | null&gt;

save()

Save user info entries to storage for a specific user

typescript
save(userId: string | undefined, entries: UserInfoEntry[]): Promise&lt;void&gt;;

Parameters:

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

Returns: Promise&lt;void&gt;

delete()

Delete user info from storage for a specific user

typescript
delete(userId: string | undefined): Promise&lt;void&gt;;

Parameters:

  • userId: string | undefined

Returns: Promise&lt;void&gt;

exists()

Check if user info exists in storage for a specific user

typescript
exists(userId: string | undefined): Promise&lt;boolean&gt;;

Parameters:

  • userId: string | undefined

Returns: Promise&lt;boolean&gt;

getPath()

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

typescript
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.

typescript
load(userId: string | undefined): Promise&lt;UserPermissionRule[] | null&gt;;

Parameters:

  • userId: string | undefined

Returns: Promise&lt;UserPermissionRule[] | null&gt;

save()

Save all rules for a user (full replacement).

typescript
save(userId: string | undefined, rules: UserPermissionRule[]): Promise&lt;void&gt;;

Parameters:

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

Returns: Promise&lt;void&gt;

delete()

Delete all rules for a user.

typescript
delete(userId: string | undefined): Promise&lt;void&gt;;

Parameters:

  • userId: string | undefined

Returns: Promise&lt;void&gt;

exists()

Check if rules exist for a user.

typescript
exists(userId: string | undefined): Promise&lt;boolean&gt;;

Parameters:

  • userId: string | undefined

Returns: Promise&lt;boolean&gt;

getPath()

Get storage path (for debugging/display).

typescript
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&lt;string, unknown&gt;; -

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&lt;string, boolean&gt;; 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()

typescript
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&lt;import('./INativeContinuation.js').NativeContinuationBinding, 'scope'&gt;; 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&lt;string, unknown&gt;; 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&lt;{ content: string; coversCount: number; timestamp: number }&gt;; -
metadata? metadata?: Record&lt;string, unknown&gt;; -

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: true allows 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&lt;string, string&gt;; 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&lt;string, unknown&gt;; 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&lt;void&gt;; 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

typescript
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 }).

typescript
type ConnectorAccessContext = Record&lt;string, unknown&gt;

EmbeddingContentPart type

📍 src/domain/interfaces/IEmbeddingProvider.ts:7

typescript
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.

typescript
type EvidenceDurability = 'process' | 'restart' | 'fsync'

HistoryEntryType type

📍 src/domain/interfaces/IHistoryJournal.ts:43

Type of history entry, derived from the message's role/purpose.

typescript
type HistoryEntryType = 'user' | 'assistant' | 'tool_result' | 'system'

MCPClientConnectionState type

📍 src/domain/interfaces/IMCPClient.ts:24

MCP Client connection states

typescript
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.

typescript
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

typescript
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.

typescript
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.

typescript
type StorageUserContextInput = string | undefined | StorageUserContext

StoredAgentType type

📍 src/domain/interfaces/IAgentDefinitionStorage.ts:16

Agent type identifier

typescript
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.

typescript
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
typescript
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 -

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

Search documentation

Type to search the v2 documentation.