Other
Other
AgentContextNextGen class
📍 src/core/context-nextgen/AgentContextNextGen.ts:167
Next-generation context manager for AI agents.
Usage:
const ctx = AgentContextNextGen.create({
model: 'gpt-4',
systemPrompt: 'You are a helpful assistant.',
features: { workingMemory: true },
});
// Add user message
ctx.addUserMessage('Hello!');
// Prepare for LLM call (handles compaction if needed)
const { input, budget } = await ctx.prepare();
// Call LLM with input...
// Add assistant response
ctx.addAssistantResponse(response.output);
Static Methods
static create()
Create a new AgentContextNextGen instance.
static create(config: AgentContextNextGenConfig): AgentContextNextGen
Parameters:
config:AgentContextNextGenConfig
Returns: AgentContextNextGen
Methods
setModel()
Keep managed-context model metadata synchronized with the owning Agent. Explicit maxContextTokens overrides remain fixed across model changes.
setModel(model: string): void
Parameters:
model:string
Returns: void
setCompactionStrategy()
Set the compaction strategy. Can be changed at runtime to switch compaction behavior.
setCompactionStrategy(strategy: ICompactionStrategy): void
Parameters:
strategy:ICompactionStrategy
Returns: void
setBeforeCompactionCallback()
Set the beforeCompaction callback. Called by Agent to wire up lifecycle hooks.
setBeforeCompactionCallback(callback: BeforeCompactionCallback | null): void
Parameters:
callback:BeforeCompactionCallback | null
Returns: void
getLastUserMessage()
Get the last message (most recent user message or tool results). Used for compatibility with old code that expected a single item.
getLastUserMessage(): InputItem | null
Returns: InputItem | null
setCurrentInput()
Set current input (user message). Adds a user message to the conversation and sets it as the current input for prepare().
setCurrentInput(content: string | Content[]): void
Parameters:
content:string | Content[]
Returns: void
addInputItems()
Add multiple input items to conversation (legacy compatibility).
addInputItems(items: InputItem[]): void
Parameters:
items:InputItem[]
Returns: void
prepareConversation()
Legacy alias for prepare() - returns prepared context.
async prepareConversation(): Promise<PreparedContext>
Returns: Promise<PreparedContext>
addMessage()
Add a message (legacy compatibility). For user messages, use addUserMessage instead. For assistant messages, use addAssistantResponse instead.
addMessage(role: 'user' | 'assistant', content: string | Content[]): string
Parameters:
role:"user" | "assistant"content:string | Content[]
Returns: string
registerContextContributor()
Explicit opt-in companion; leaves the legacy plugin interface unchanged.
registerContextContributor(pluginName: string, contributor: ContextContributor): void
Parameters:
pluginName:stringcontributor:ContextContributor
Returns: void
unregisterContextContributor()
Return this source to its existing legacy prompt view.
unregisterContextContributor(pluginName: string): boolean
Parameters:
pluginName:string
Returns: boolean
recordProviderUsage()
Observe one actual managed call; absent provider/cache counters remain unknown.
recordProviderUsage(usage?: Partial<TokenUsage>): void
Parameters:
usage:Partial<TokenUsage> | undefined(optional)
Returns: void
formattingContextInput()
formattingContextInput(input: string): InputItem[] | string
Parameters:
input:string
Returns: string | InputItem[]
registerPlugin()
Register a plugin. Plugin's tools are automatically registered with ToolManager.
registerPlugin(plugin: IContextPluginNextGen, options?: { skipDestroyOnContextDestroy?: boolean }): void
Parameters:
plugin:IContextPluginNextGenoptions:{ skipDestroyOnContextDestroy?: boolean | undefined; } | undefined(optional)
Returns: void
getPlugin()
Get a plugin by name.
getPlugin<T extends IContextPluginNextGen>(name: string): T | null
Parameters:
name:string
Returns: T | null
hasPlugin()
Check if a plugin is registered.
hasPlugin(name: string): boolean
Parameters:
name:string
Returns: boolean
getPlugins()
Get all registered plugins.
getPlugins(): IContextPluginNextGen[]
Returns: IContextPluginNextGen[]
getContextToolNames()
Return executable tool names recreated by this context's plugin set. Portable runtimes use this to avoid replacing restored plugin tools with remote proxies that would operate on a different context instance.
getContextToolNames(): string[]
Returns: string[]
addUserMessage()
Add a user message. Returns the message ID.
addUserMessage(content: string | Content[]): string
Parameters:
content:string | Content[]
Returns: string
addAssistantResponse()
Add assistant response (from LLM output). Also moves current input to conversation history. Returns the message ID.
addAssistantResponse(output: OutputItem[]): string
Parameters:
output:OutputItem[]
Returns: string
replaceLastAssistantResponse()
Replace the content of the most recent assistant message in the conversation
with the message content from output. Preserves this legacy content-only
helper's behavior; top-level replay items are not replaced here. Managed
structured finalization uses a captured response boundary instead.
replaceLastAssistantResponse(output: OutputItem[]): boolean
Parameters:
output:OutputItem[]
Returns: boolean
addToolResults()
Add tool results. Returns the message ID.
addToolResults(results: ToolResult[]): string
Parameters:
results:ToolResult[]
Returns: string
acknowledgeToolEvidence()
Host-only recovery after a failed evidence write. Persist the retained result without rerunning its tool, then acknowledge the matching invocation here. Raw content remains unchanged; compaction may subsequently remove its group.
async acknowledgeToolEvidence(callId: string, reference: EvidenceReference): Promise<number>
Parameters:
callId:stringreference:EvidenceReference
Returns: Promise<number>
getConversation()
Get conversation history (read-only).
getConversation(): ReadonlyArray<InputItem>
Returns: readonly InputItem[]
getCurrentInput()
Get current input (read-only). NOTE: This changes during the agentic loop — after tool execution it contains tool results, not the original user message.
getCurrentInput(): ReadonlyArray<InputItem>
Returns: readonly InputItem[]
getOriginalUserInput()
Get the original user input from the start of execution. Unlike getCurrentInput() which changes during the agentic loop (tool results replace user message), this always returns the input that started the current execution.
getOriginalUserInput(): ReadonlyArray<InputItem>
Returns: readonly InputItem[]
getConversationLength()
Get conversation length.
getConversationLength(): number
Returns: number
clearConversation()
Clear conversation history.
clearConversation(reason?: string): void
Parameters:
reason:string | undefined(optional)
Returns: void
prepare()
Prepare context for LLM call.
This method:
- Calculates tool definition tokens (never compacted)
- Builds the system message from all components
- Calculates token budget
- Handles oversized current input if needed
- Runs compaction if needed
- Returns final InputItem[] ready for LLM
IMPORTANT: Call this ONCE right before each LLM call!
async prepare(options: ContextPrepareOptions = {}): Promise<PreparedContext>
Parameters:
options:ContextPrepareOptions(optional) (default:{})
Returns: Promise<PreparedContext>
validateRequestBudget()
Recount the final managed dispatch after host hooks and synchronous request listeners. No hooks or compaction run here. Auxiliary formatting/repair calls use recordPreparation:false to check fit without replacing context diagnostics. Model/schema/native-tool fields are optional for existing callers.
validateRequestBudget(
request: Pick<TextGenerateOptions, 'input' | 'tools' | 'instructions'> &
Partial<Pick<TextGenerateOptions, 'model' | 'response_format' | 'native_tools'>>,
options: { modelMaxContextTokens?: number; recordPreparation?: boolean; providerCountedInputTokens?: number } = {},
): ContextBudget
Parameters:
request:Pick<TextGenerateOptions, "instructions" | "tools" | "input"> & Partial<Pick<TextGenerateOptions, "model" | "response_format" | "native_tools">>options:{ modelMaxContextTokens?: number | undefined; recordPreparation?: boolean | undefined; providerCountedInputTokens?: number | undefined; }(optional) (default:{})
Returns: ContextBudget
consolidate()
Run post-cycle consolidation. Called by Agent after agentic cycle completes (before session save).
Delegates to the current compaction strategy's consolidate() method. Use for more expensive operations like summarization.
async consolidate(): Promise<ConsolidationResult>
Returns: Promise<ConsolidationResult>
rollover()
Force a semantic context rollover, independently of token thresholds.
The older conversation prefix is summarized by the caller, while recent user turns and provider-opaque compaction items remain exact. Plugin state is never compacted by this operation, and the append-only history journal is untouched. The live conversation changes only after the summarizer has returned a non-empty result and only if no concurrent context mutation was observed.
This is intended for provider-session boundaries (for example, a Realtime session approaching its hard lifetime), not emergency token compaction. Call it only between agent executions, when there is no pending input.
async rollover(options: ContextRolloverOptions): Promise<ContextRolloverResult>
Parameters:
options:ContextRolloverOptions
Returns: Promise<ContextRolloverResult>
save()
Save context state to storage.
async save(
sessionId?: string,
metadata?: Record<string, unknown>,
stateOverride?: SerializedContextState | (() => SerializedContextState | Promise<SerializedContextState>)
): Promise<void>
Parameters:
sessionId:string | undefined(optional)metadata:Record<string, unknown> | undefined(optional)stateOverride:SerializedContextState | (() => SerializedContextState | Promise<SerializedContextState>) | undefined(optional)
Returns: Promise<void>
load()
Load context state from storage.
async load(sessionId: string): Promise<boolean>
Parameters:
sessionId:string
Returns: Promise<boolean>
restoreSession()
async restoreSession(
sessionId: string,
restore: (state: SerializedContextState) => void | Promise<void>,
restoreJournal = false,
admit?: (loaded: boolean) => void,
): Promise<boolean>
Parameters:
sessionId:stringrestore:(state: SerializedContextState) => void | Promise<void>restoreJournal:boolean(optional) (default:false)admit:((loaded: boolean) => void) | undefined(optional)
Returns: Promise<boolean>
loadRaw()
Load raw state from storage without restoring. Retains the legacy active-session-ID side effect; does not validate/restore. Managed Agent loads use transactional restoration instead.
async loadRaw(sessionId: string): Promise<{ state: SerializedContextState; stored: StoredContextSession } | null>
Parameters:
sessionId:string
Returns: Promise<{ state: SerializedContextState; stored: StoredContextSession; } | null>
sessionExists()
Check if session exists in storage.
async sessionExists(sessionId: string): Promise<boolean>
Parameters:
sessionId:string
Returns: Promise<boolean>
deleteSession()
Delete a session from storage.
async deleteSession(sessionId?: string): Promise<void>
Parameters:
sessionId:string | undefined(optional)
Returns: Promise<void>
getState()
Get serialized state for persistence. Used by BaseAgent to inject agent-level state.
getState(): SerializedContextState
Returns: SerializedContextState
restoreState()
Restore state from serialized form. Used by BaseAgent for custom state restoration.
restoreState(state: SerializedContextState): void
Parameters:
state:SerializedContextState
Returns: void
calculateBudget()
Get the current token budget.
Returns the cached budget from the last prepare() call if available. If prepare() hasn't been called yet, calculates a fresh budget.
For monitoring purposes, prefer using the lastBudget getter or
subscribing to the budget:updated event for reactive updates.
async calculateBudget(): Promise<ContextBudget>
Returns: Promise<ContextBudget>
getSnapshot()
Get a complete, serializable snapshot of the context state.
Returns all data needed by UI "Look Inside" panels without reaching into plugin internals. Plugin data is auto-discovered from the plugin registry — new/custom plugins appear automatically.
async getSnapshot(toolStats?: { mostUsed?: Array<{ name: string; count: number }> }): Promise<IContextSnapshot>
Parameters:
toolStats:{ mostUsed?: { name: string; count: number; }[] | undefined; } | undefined(optional)
Returns: Promise<IContextSnapshot>
getViewContext()
Get a human-readable breakdown of the prepared context.
Calls prepare() internally, then maps each InputItem to a named
component with content text and token estimate. Used by "View Full Context" UIs.
async getViewContext(): Promise<IViewContextData>
Returns: Promise<IViewContextData>
destroy()
Destroy context and release resources.
destroy(): void
Returns: void
AgentPackageOutcomeServer class
📍 src/portable/OutcomeServer.ts:25
Explicit authenticated facade over the ordinary Agent tool lifecycle. No HTTP server or credentials are supplied by a package.
Constructor
constructor
constructor(private readonly agent: Agent, pkg: SerializedAgentPackage, private readonly options: AgentPackageOutcomeServerOptions<TContext>)
Parameters:
agent:Agentpkg:SerializedAgentPackageoptions:AgentPackageOutcomeServerOptions<TContext>
Methods
package()
package(): OutcomeAgentPackage
Returns: OutcomeAgentPackage
negotiate()
async negotiate(input: unknown, host: TContext): Promise<OutcomeNegotiation>
Parameters:
input:unknownhost:TContext
Returns: Promise<OutcomeNegotiation>
execute()
async execute(input: unknown, host: TContext): Promise<OutcomeExecuteResponse>
Parameters:
input:unknownhost:TContext
Returns: Promise<OutcomeExecuteResponse>
getReceipt()
async getReceipt(input: unknown, host: TContext): Promise<RemoteOutcomeReceipt>
Parameters:
input:unknownhost:TContext
Returns: Promise<RemoteOutcomeReceipt>
cancel()
async cancel(input: unknown, host: TContext): Promise<OutcomeCancelResponse>
Parameters:
input:unknownhost:TContext
Returns: Promise<OutcomeCancelResponse>
readEvidence()
async readEvidence(input: unknown, host: TContext): Promise<OutcomeEvidenceResponse>
Parameters:
input:unknownhost:TContext
Returns: Promise<OutcomeEvidenceResponse>
readRetainedSource()
Host-only exact retained record. No action is resubmitted.
readRetainedSource(requestId: string): EvidenceRecord | undefined
Parameters:
requestId:string
Returns: EvidenceRecord | undefined
acknowledgeSource()
async acknowledgeSource(requestId: string, reference: EvidenceReference): Promise<void>
Parameters:
requestId:stringreference:EvidenceReference
Returns: Promise<void>
close()
close(): Promise<void>
Returns: Promise<void>
AudioPlaybackQueue class
📍 src/capabilities/speech/AudioPlaybackQueue.ts:26
Constructor
constructor
constructor(onReady: AudioChunkPlaybackCallback)
Parameters:
onReady:AudioChunkPlaybackCallback
Methods
enqueue()
Enqueue an audio chunk event. If it's the next expected chunk, it (and any subsequent buffered chunks) are immediately delivered to the callback in order.
enqueue(event: AudioChunkReadyEvent): void
Parameters:
event:AudioChunkReadyEvent
Returns: void
reset()
Reset the queue (e.g., on interruption or new stream).
reset(): void
Returns: void
BasePluginNextGen class
📍 src/core/context-nextgen/BasePluginNextGen.ts:150
Base class for NextGen context plugins.
Provides:
- Token cache management -
invalidateTokenCache(),updateTokenCache(),recalculateTokenCache() - Simple token estimator -
this.estimator(can be overridden) - Default implementations - for optional interface methods
Implementing a Plugin
class MyPlugin extends BasePluginNextGen {
readonly name = 'my_plugin';
private _data = new Map<string, string>();
// 1. Return static instructions (cached automatically)
getInstructions(): string {
return '## My Plugin\n\nUse my_plugin_set to store data...';
}
// 2. Return formatted content (update token cache!)
async getContent(): Promise<string | null> {
if (this._data.size === 0) return null;
const content = this.formatEntries();
this.updateTokenCache(this.estimator.estimateTokens(content));
return content;
}
// 3. Return raw data for inspection
getContents(): unknown {
return Object.fromEntries(this._data);
}
// 4. Invalidate cache when data changes
set(key: string, value: string): void {
this._data.set(key, value);
this.invalidateTokenCache(); // <-- Important!
}
}
Token Cache Lifecycle
The token cache is used for budget calculation. Follow this pattern:
- When state changes → Call
invalidateTokenCache()to clear the cache - In getContent() → Call
updateTokenCache(tokens)before returning - For async recalc → Use
recalculateTokenCache()helper
// Pattern 1: Invalidate on change, update in getContent
store(key: string, value: unknown): void {
this._entries.set(key, value);
this.invalidateTokenCache(); // Clear cache
}
async getContent(): Promise<string | null> {
const content = this.formatContent();
this.updateTokenCache(this.estimator.estimateTokens(content)); // Update cache
return content;
}
// Pattern 2: Recalculate immediately after change
async store(key: string, value: unknown): Promise<void> {
this._entries.set(key, value);
await this.recalculateTokenCache(); // Recalc and cache
}
Compaction Support
To make your plugin compactable:
isCompactable(): boolean {
return this._entries.size > 0;
}
async compact(targetTokensToFree: number): Promise<number> {
// Remove low-priority entries
let freed = 0;
for (const [key, entry] of this._entries) {
if (entry.priority !== 'critical' && freed < targetTokensToFree) {
freed += entry.tokens;
this._entries.delete(key);
}
}
this.invalidateTokenCache();
return freed;
}
Methods
getInstructions()
abstract getInstructions(): string | null;
Returns: string | null
getContent()
abstract getContent(): Promise<string | null>;
Returns: Promise<string | null>
getContents()
abstract getContents(): unknown;
Returns: unknown
getTokenSize()
Get current token size of content.
Returns the cached value from the last updateTokenCache() call.
Returns 0 if cache is null (content hasn't been calculated yet).
Note: This is synchronous but getContent() is async. Plugins
should call updateTokenCache() in their getContent() implementation
to keep the cache accurate.
getTokenSize(): number
Returns: number
getInstructionsTokenSize()
Get token size of instructions (cached after first call).
Instructions are static, so this is computed once and cached permanently. The cache is never invalidated since instructions don't change.
getInstructionsTokenSize(): number
Returns: number
invalidateTokenCache()
Invalidate the content token cache.
Call this when plugin state changes in a way that affects content size.
The next call to getTokenSize() will return 0 until updateTokenCache()
is called (typically in getContent()).
protected invalidateTokenCache(): void
Returns: void
updateTokenCache()
Update the content token cache with a new value.
Call this in getContent() after formatting content, passing the
estimated token count. This keeps budget calculations accurate.
protected updateTokenCache(tokens: number): void
Parameters:
tokens:number
Returns: void
recalculateTokenCache()
Recalculate and cache token size from current content.
Convenience method that calls getContent(), estimates tokens,
and updates the cache. Use this when you need to immediately
refresh the cache after a state change.
protected async recalculateTokenCache(): Promise<number>
Returns: Promise<number>
isCompactable()
Default: not compactable.
Override to return true if your plugin can reduce its content size
when context is tight. Also implement compact() to handle the actual
compaction logic.
isCompactable(): boolean
Returns: boolean
compact()
Default: no compaction (returns 0).
Override to implement compaction logic. Should attempt to free
approximately targetTokensToFree tokens. Remember to call
invalidateTokenCache() after modifying content.
async compact(_targetTokensToFree: number): Promise<number>
Parameters:
_targetTokensToFree:number
Returns: Promise<number>
getTools()
Default: no tools (returns empty array).
Override to provide plugin-specific tools. Tools are auto-registered with ToolManager when the plugin is added to the context.
Use a consistent naming convention: <prefix>_<action>
memory_store,memory_retrieve,memory_deletecontext_set,context_delete,context_list
getTools(): ToolFunction[]
Returns: ToolFunction<any, any>[]
destroy()
Default: no-op cleanup.
Override if your plugin has resources to release (file handles, timers, connections, etc.). Called when context is destroyed.
destroy(): void
Returns: void
getState()
Default: returns empty object.
Override to serialize plugin state for session persistence. Return a JSON-serializable object. Consider including a version number for future migration support.
getState(): unknown
Returns: unknown
restoreState()
Default: no-op (ignores state).
Override to restore plugin state from saved session. The state
comes from a previous getState() call.
IMPORTANT: Call invalidateTokenCache() after restoring state
to ensure token counts are recalculated on next getContent() call.
restoreState(_state: unknown): void
Parameters:
_state:unknown
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string |
- |
estimator |
estimator: ITokenEstimator |
Token estimator instance. |
| Override this in subclass to use a custom estimator (e.g., tiktoken). |
BraveProvider class
📍 src/capabilities/search/providers/BraveProvider.ts:15
Constructor
constructor
constructor(readonly connector: Connector)
Parameters:
connector:Connector
Methods
search()
async search(query: string, options: SearchOptions = {}): Promise<SearchResponse>
Parameters:
query:stringoptions:SearchOptions(optional) (default:{})
Returns: Promise<SearchResponse>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "brave" |
- |
CalendarSignalAdapter class
📍 src/memory/integration/signals/adapters/CalendarSignalAdapter.ts:62
Constructor
constructor
constructor(opts: CalendarSignalAdapterOptions = {})
Parameters:
opts:CalendarSignalAdapterOptions(optional) (default:{})
Methods
extract()
extract(raw: CalendarSignal): ExtractedSignal
Parameters:
raw:CalendarSignal
Returns: ExtractedSignal
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: "calendar" |
- |
ConnectorEmbedder class
📍 src/memory/integration/ConnectorEmbedder.ts:53
Constructor
constructor
constructor(config: ConnectorEmbedderConfig)
Parameters:
config:ConnectorEmbedderConfig
Static Methods
static withProvider()
Construct a ConnectorEmbedder from a pre-built provider instead of resolving one from the Connector registry. Intended for callers that already have an IEmbeddingProvider (testing, unusual plumbing).
static withProvider(args: {
provider: IEmbeddingProvider;
model: string;
dimensions: number;
requestedDimensions?: number;
maxInputTokens?: number;
oversizeInputReducer?: OversizeEmbeddingReducer;
}): ConnectorEmbedder
Parameters:
args:{ provider: IEmbeddingProvider; model: string; dimensions: number; requestedDimensions?: number | undefined; maxInputTokens?: number | undefined; oversizeInputReducer?: OversizeEmbeddingReducer | undefined; }
Returns: ConnectorEmbedder
Methods
embed()
async embed(text: string): Promise<number[]>
Parameters:
text:string
Returns: Promise<number[]>
embedBatch()
async embedBatch(texts: string[]): Promise<number[][]>
Parameters:
texts:string[]
Returns: Promise<number[][]>
Properties
| Property | Type | Description |
|---|---|---|
dimensions |
dimensions: number |
- |
ConnectorExtractor class
📍 src/memory/integration/signals/ConnectorExtractor.ts:35
Constructor
constructor
constructor(config: ConnectorExtractorConfig)
Parameters:
config:ConnectorExtractorConfig
Static Methods
static withAgent()
Construct from a pre-built agent-like object. Intended for testing and
callers with their own LLM plumbing. The object must expose runDirect
(returning { output_text }) and destroy.
static withAgent(args: {
agent: { runDirect: Agent['runDirect']; destroy: Agent['destroy'] };
temperature?: number;
maxOutputTokens?: number;
}): ConnectorExtractor
Parameters:
args:{ agent: { runDirect: (input: string | InputItem[], options?: DirectCallOptions) => Promise<LLMResponse>; destroy: () => void; }; temperature?: number | undefined; maxOutputTokens?: number | undefined; }
Returns: ConnectorExtractor
Methods
extract()
async extract(prompt: string): Promise<ExtractionOutput>
Parameters:
prompt:string
Returns: Promise<ExtractionOutput>
destroy()
destroy(): void
Returns: void
ConnectorProfileGenerator class
📍 src/memory/integration/ConnectorProfileGenerator.ts:34
Constructor
constructor
constructor(config: ConnectorProfileGeneratorConfig)
Parameters:
config:ConnectorProfileGeneratorConfig
Static Methods
static withAgent()
Construct from a pre-built agent-like object. Intended for testing and unusual callers that already have their own LLM plumbing.
static withAgent(args: {
agent: { runDirect: Agent['runDirect']; destroy: Agent['destroy'] };
promptTemplate?: (ctx: PromptContext) => string;
temperature?: number;
maxOutputTokens?: number;
}): ConnectorProfileGenerator
Parameters:
args:{ agent: { runDirect: (input: string | InputItem[], options?: DirectCallOptions) => Promise<LLMResponse>; destroy: () => void; }; promptTemplate?: ((ctx: ProfileGeneratorInput) => string) | undefined; temperature?: number | undefined; maxOutputTokens?: number | undefined; }
Returns: ConnectorProfileGenerator
Methods
generate()
async generate(
input: ProfileGeneratorInput,
): Promise<{ details: string; summaryForEmbedding: string }>
Parameters:
input:ProfileGeneratorInput
Returns: Promise<{ details: string; summaryForEmbedding: string; }>
destroy()
Release the internal agent.
destroy(): void
Returns: void
ContextCompactionStrategy class
📍 src/core/context-nextgen/strategies/ContextCompactionStrategy.ts:14
Explicit plugin-content reduction and native history through the existing strategy API.
Constructor
constructor
constructor(config: ContextCompactionStrategyConfig)
Parameters:
config:ContextCompactionStrategyConfig
Methods
compact()
async compact(context: CompactionContext, _targetToFree: number): Promise<CompactionResult>
Parameters:
context:CompactionContext_targetToFree:number
Returns: Promise<CompactionResult>
consolidate()
async consolidate(_context: CompactionContext): Promise<ConsolidationResult>
Parameters:
_context:CompactionContext
Returns: Promise<ConsolidationResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "context-compaction" |
- |
displayName |
displayName: "Plugin and history compaction" |
- |
description |
description: "Compose plugin-owned reductions and provider-native history without replacing context plugins." |
- |
threshold |
threshold: 0.75 |
- |
requiredPlugins |
requiredPlugins: readonly string[] |
- |
config |
config: Readonly<ContextCompactionStrategyConfig> |
- |
DeepSeekAPI class
📍 src/infrastructure/providers/deepseek/DeepSeekAPI.ts:15
Connector-backed access to DeepSeek account and completion APIs.
Static Methods
static for()
Resolve credentials and endpoint configuration from a named connector.
static for(connectorName: string): DeepSeekAPI
Parameters:
connectorName:string
Returns: DeepSeekAPI
Methods
listModels()
listModels(): Promise<string[]>
Returns: Promise<string[]>
createFimCompletion()
createFimCompletion(request: DeepSeekFimRequest): Promise<DeepSeekFimResponse>
Parameters:
request:DeepSeekFimRequest
Returns: Promise<DeepSeekFimResponse>
getBalance()
getBalance(): Promise<DeepSeekBalance>
Returns: Promise<DeepSeekBalance>
destroy()
destroy(): void
Returns: void
DefaultCompactionStrategy class
📍 src/core/context-nextgen/strategies/DefaultCompactionStrategy.ts:43
Default compaction strategy.
Behavior:
- compact(): First compacts plugins (in_context_memory first, then working_memory), then removes oldest messages from conversation while preserving tool pairs.
- consolidate(): No-op - returns performed: false
This strategy is fast and suitable for most use cases. Default threshold is 70%.
Constructor
constructor
constructor(config?: DefaultCompactionStrategyConfig)
Parameters:
config:DefaultCompactionStrategyConfig | undefined(optional)
Methods
compact()
Emergency compaction when thresholds exceeded.
Strategy:
- Compact plugins first (in_context_memory, then working_memory)
- If still needed, remove oldest conversation messages (preserving tool pairs)
async compact(context: CompactionContext, targetToFree: number): Promise<CompactionResult>
Parameters:
context:CompactionContexttargetToFree:number
Returns: Promise<CompactionResult>
consolidate()
Post-cycle consolidation.
Default strategy does nothing - override in subclasses for:
- Conversation summarization
- Memory deduplication
- Data promotion to persistent storage
async consolidate(_context: CompactionContext): Promise<ConsolidationResult>
Parameters:
_context:CompactionContext
Returns: Promise<ConsolidationResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "default" |
- |
displayName |
displayName: "Dumb" |
- |
description |
description: "Do not use" |
- |
threshold |
threshold: number |
- |
DocumentReader class
📍 src/capabilities/documents/DocumentReader.ts:37
Main document reader class.
Example:
const reader = DocumentReader.create();
const result = await reader.read('/path/to/doc.pdf');
console.log(result.pieces); // DocumentPiece[]
Static Methods
static create()
Create a new DocumentReader instance
static create(config: DocumentReaderConfig = {}): DocumentReader
Parameters:
config:DocumentReaderConfig(optional) (default:{})
Returns: DocumentReader
Methods
registerHandler()
Register a custom format handler
registerHandler(family: DocumentFamily, handler: IFormatHandler): void
Parameters:
family:DocumentFamilyhandler:IFormatHandler
Returns: void
read()
Read a document from any source
async read(
source: DocumentSource | string,
options: DocumentReadOptions = {}
): Promise<DocumentResult>
Parameters:
source:string | DocumentSourceoptions:DocumentReadOptions(optional) (default:{})
Returns: Promise<DocumentResult>
EmailSignalAdapter class
📍 src/memory/integration/signals/adapters/EmailSignalAdapter.ts:73
Constructor
constructor
constructor(opts: EmailSignalAdapterOptions = {})
Parameters:
opts:EmailSignalAdapterOptions(optional) (default:{})
Methods
extract()
extract(raw: EmailSignal): ExtractedSignal
Parameters:
raw:EmailSignal
Returns: ExtractedSignal
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: "email" |
- |
Embeddings class
📍 src/capabilities/embeddings/Embeddings.ts:57
Embeddings capability class
Static Methods
static create()
Create an Embeddings instance
static create(options: EmbeddingsCreateOptions): Embeddings
Parameters:
options:EmbeddingsCreateOptions
Returns: Embeddings
Methods
embed()
Generate embeddings for one or more inputs
async embed(
input: string | string[],
options?: {
model?: string;
dimensions?: number;
encodingFormat?: 'float' | 'base64';
vendorOptions?: Record<string, unknown>;
}
): Promise<EmbeddingResponse>
Parameters:
input:string | string[]options:{ model?: string | undefined; dimensions?: number | undefined; encodingFormat?: "float" | "base64" | undefined; vendorOptions?: Record<string, unknown> | undefined; } | undefined(optional)
Returns: Promise<EmbeddingResponse>
embedMultimodal()
Embed mixed text, image, audio, video, or document content. Currently supported by Google's Gemini Embedding 2 model.
async embedMultimodal(
content: EmbeddingContentPart[],
options?: {
model?: string;
dimensions?: number;
vendorOptions?: Record<string, unknown>;
}
): Promise<EmbeddingResponse>
Parameters:
content:EmbeddingContentPart[]options:{ model?: string | undefined; dimensions?: number | undefined; vendorOptions?: Record<string, unknown> | undefined; } | undefined(optional)
Returns: Promise<EmbeddingResponse>
listModels()
List available embedding models for this provider
async listModels(): Promise<string[]>
Returns: Promise<string[]>
getModelInfo()
Get information about a specific embedding model
getModelInfo(modelName: string): IEmbeddingModelDescription | undefined
Parameters:
modelName:string
Returns: IEmbeddingModelDescription | undefined
getProvider()
Get the underlying provider
getProvider(): IEmbeddingProvider
Returns: IEmbeddingProvider
getConnector()
Get the current connector
getConnector(): Connector
Returns: Connector
EnergyVAD class
📍 src/capabilities/voice/EnergyVAD.ts:21
Constructor
constructor
constructor(config?: EnergyVADConfig)
Parameters:
config:EnergyVADConfig | undefined(optional)
Methods
process()
process(frame: AudioFrame): VADEvent
Parameters:
frame:AudioFrame
Returns: VADEvent
reset()
reset(): void
Returns: void
EntityResolver class
📍 src/memory/resolution/EntityResolver.ts:148
Constructor
constructor
constructor(
private readonly hooks: ResolverMemoryHooks,
config?: EntityResolutionConfig,
)
Parameters:
hooks:ResolverMemoryHooksconfig:EntityResolutionConfig | undefined(optional)
Methods
resolve()
Find candidate entities for a surface form. Returns ranked by confidence.
Empty array if nothing clears opts.threshold (default 0.5).
async resolve(
query: ResolveEntityQuery,
scope: ScopeFilter,
opts?: ResolveEntityOptions,
): Promise<EntityCandidate[]>
Parameters:
query:ResolveEntityQueryscope:ScopeFilteropts:ResolveEntityOptions | undefined(optional)
Returns: Promise<EntityCandidate[]>
upsertBySurface()
Upsert-or-resolve: resolves the surface to an existing entity if top candidate clears autoResolveThreshold, else creates a new entity. Accumulates aliases + identifiers on matches — the system gets better at recognizing the same entity across variant surface forms over time.
async upsertBySurface(
input: UpsertBySurfaceInput,
scope: ScopeFilter,
opts?: UpsertBySurfaceOptions,
): Promise<UpsertBySurfaceResult>
Parameters:
input:UpsertBySurfaceInputscope:ScopeFilteropts:UpsertBySurfaceOptions | undefined(optional)
Returns: Promise<UpsertBySurfaceResult>
EventEmitterTrigger class
📍 src/infrastructure/triggers/EventEmitterTrigger.ts:10
Methods
on()
Register a listener for an event. Returns an unsubscribe function.
on(event: string, callback: (payload: unknown) => void | Promise<void>): () => void
Parameters:
event:stringcallback:(payload: unknown) => void | Promise<void>
Returns: () => void
emit()
Emit an event to all registered listeners.
emit(event: string, payload?: unknown): void
Parameters:
event:stringpayload:unknown(optional)
Returns: void
destroy()
destroy(): void
Returns: void
EvidencePluginNextGen class
📍 src/core/context-nextgen/plugins/EvidencePluginNextGen.ts:57
Evidence outlives scratch and history compaction; configuration/scope remain host-owned.
Constructor
constructor
constructor(config: EvidencePluginConfig & { storage: IEvidenceStorage })
Parameters:
config:EvidencePluginConfig & { storage: IEvidenceStorage; }
Methods
attach()
Bind to the context's existing ToolManager; never creates a second tool pipeline.
attach(manager: ToolManager): void
Parameters:
manager:ToolManager
Returns: void
getInstructions()
getInstructions(): string
Returns: string
getContent()
async getContent(): Promise<string | null>
Returns: Promise<string | null>
getContents()
getContents(): unknown
Returns: unknown
isCompactable()
isCompactable(): boolean
Returns: boolean
compact()
async compact(_target: number): Promise<number>
Parameters:
_target:number
Returns: Promise<number>
getTools()
getTools(): ToolFunction[]
Returns: ToolFunction<any, any>[]
getState()
getState(): unknown
Returns: unknown
restoreState()
restoreState(state: unknown): void
Parameters:
state:unknown
Returns: void
destroy()
destroy(): void
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "evidence" |
- |
storage |
storage: IEvidenceStorage |
- |
ExecutionContext class
📍 src/capabilities/agents/ExecutionContext.ts:84
Constructor
constructor
constructor(
executionId: string,
config: ExecutionContextConfig = {}
)
Parameters:
executionId:stringconfig:ExecutionContextConfig(optional) (default:{})
Methods
addIteration()
Add iteration to history (memory-safe)
addIteration(record: IterationRecord): void
Parameters:
record:IterationRecord
Returns: void
getHistory()
Get iteration history
getHistory(): IterationRecord[] | IterationSummary[]
Returns: IterationRecord[] | IterationSummary[]
audit()
Add audit entry
audit(type: AuditEntry['type'], details: any, hookName?: string, toolName?: string): void
Parameters:
type:"hook_executed" | "tool_modified" | "tool_skipped" | "execution_paused" | "execution_resumed" | "tool_approved" | "tool_rejected" | "tool_blocked" | "tool_permission_approved"details:anyhookName:string | undefined(optional)toolName:string | undefined(optional)
Returns: void
getAuditTrail()
Get audit trail
getAuditTrail(): readonly AuditEntry[]
Returns: readonly AuditEntry[]
updateMetrics()
Update metrics
updateMetrics(update: Partial<ExecutionMetrics>): void
Parameters:
update:Partial<ExecutionMetrics>
Returns: void
addToolCall()
Add tool call to tracking
addToolCall(toolCall: ToolCall): void
Parameters:
toolCall:ToolCall
Returns: void
addToolResult()
Add tool result to tracking
addToolResult(result: ToolResult): void
Parameters:
result:ToolResult
Returns: void
checkLimits()
Check resource limits
checkLimits(limits?: {
maxExecutionTime?: number;
maxToolCalls?: number;
maxContextSize?: number;
}): void
Parameters:
limits:{ maxExecutionTime?: number | undefined; maxToolCalls?: number | undefined; maxContextSize?: number | undefined; } | undefined(optional)
Returns: void
cleanup()
Cleanup resources and release memory Clears all internal arrays and maps to allow garbage collection
cleanup(): void
Returns: void
getSummary()
Get execution summary
getSummary()
Returns: { executionId: string; startTime: Date; currentIteration: number; paused: boolean; cancelled: boolean; metrics: { totalDuration: number; llmDuration: number; toolDuration: number; hookDuration: number; iterationCount: number; toolCallCount: number; toolSuccessCount: number; toolFailureCount: number; toolTimeoutCount: number; inputTokens: number; outputTokens: number; totalTokens: number; cachedInputTokens?: number | undefined; cacheCreationInputTokens?: number | undefined; reasoningTokens?: number | undefined; nativeToolCalls?: Record<string, number> | undefined; errors: { type: string; message: string; timestamp: Date; }[]; }; totalDuration: number; }
Properties
| Property | Type | Description |
|---|---|---|
executionId |
executionId: string |
- |
startTime |
startTime: Date |
- |
iteration |
iteration: number |
- |
toolCalls |
toolCalls: Map<string, ToolCall> |
- |
toolResults |
toolResults: Map<string, ToolResult> |
- |
paused |
paused: boolean |
- |
pauseReason? |
`pauseReason: string | undefined` |
cancelled |
cancelled: boolean |
- |
cancelReason? |
`cancelReason: string | undefined` |
metadata |
metadata: Map<string, any> |
- |
metrics |
metrics: ExecutionMetrics |
- |
ExtractionResolver class
📍 src/memory/integration/ExtractionResolver.ts:400
Constructor
constructor
constructor(private readonly memory: MemorySystem)
Parameters:
memory:MemorySystem
Methods
resolveAndIngest()
Ingest a raw LLM extraction output. Resolves mentions to entities (upsert
if missing), translates facts from label-space to id-space, writes them.
Attaches sourceSignalId to every written fact.
async resolveAndIngest(
output: ExtractionOutput,
sourceSignalId: string,
scope: ScopeFilter,
opts?: ExtractionResolverOptions,
): Promise<IngestionResult>
Parameters:
output:ExtractionOutputsourceSignalId:stringscope:ScopeFilteropts:ExtractionResolverOptions | undefined(optional)
Returns: Promise<IngestionResult>
FormatDetector class
📍 src/capabilities/documents/FormatDetector.ts:68
Static utility for detecting document formats
Static Methods
static detect()
Detect format from filename and optional buffer
static detect(filename: string, _buffer?: Buffer | Uint8Array): FormatDetectionResult
Parameters:
filename:string_buffer:Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike> | undefined(optional)
Returns: FormatDetectionResult
static isDocumentFormat()
Check if an extension is a supported document format Used by readFile to detect when to use DocumentReader
static isDocumentFormat(ext: string): boolean
Parameters:
ext:string
Returns: boolean
static isBinaryDocumentFormat()
Check if an extension is a binary document format (i.e., cannot be read as UTF-8)
static isBinaryDocumentFormat(ext: string): boolean
Parameters:
ext:string
Returns: boolean
static isDocumentMimeType()
Check if a Content-Type header indicates a document format Used by webFetch to detect downloadable documents
static isDocumentMimeType(contentType: string): boolean
Parameters:
contentType:string
Returns: boolean
static detectFromMimeType()
Detect format from Content-Type header
static detectFromMimeType(contentType: string): FormatDetectionResult | null
Parameters:
contentType:string
Returns: FormatDetectionResult | null
static getSupportedExtensions()
Get all supported document extensions
static getSupportedExtensions(): string[]
Returns: string[]
static getExtension()
Get the normalized extension from a filename
static getExtension(filename: string): string
Parameters:
filename:string
Returns: string
GoogleVoices class
📍 src/capabilities/google/GoogleVoices.ts:14
Connector-first access to Google's prebuilt, designed, and replicated voices.
Constructor
constructor
constructor(connector: string | Connector)
Parameters:
connector:string | Connector
Methods
create()
async create(params: GoogleVoiceCreateParams): Promise<GoogleVoice>
Parameters:
params:CreateVoiceRequest_2 & { api_version?: string | undefined; }
Returns: Promise<VoiceOutput>
list()
async list(params?: GoogleVoiceListParams): Promise<GoogleVoiceListResponse>
Parameters:
params:ListVoicesRequest | null | undefined(optional)
Returns: Promise<ListVoicesResponse>
get()
async get(id: string, params?: GoogleVoiceGetParams): Promise<GoogleVoice>
Parameters:
id:stringparams:GetVoiceParams | null | undefined(optional)
Returns: Promise<VoiceOutput>
delete()
async delete(id: string, params?: GoogleVoiceDeleteParams): Promise<unknown>
Parameters:
id:stringparams:DeleteVoiceParams | null | undefined(optional)
Returns: Promise<unknown>
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
GrokRealtimeAPI class
📍 src/capabilities/voice/grok/GrokRealtimeAPI.ts:9
REST helpers for xAI browser credentials and SIP call control.
Constructor
constructor
constructor(connector: string | Connector)
Parameters:
connector:string | Connector
Methods
createClientSecret()
async createClientSecret(expiresAfterSeconds = 300): Promise<GrokRealtimeClientSecret>
Parameters:
expiresAfterSeconds:number(optional) (default:300)
Returns: Promise<GrokRealtimeClientSecret>
hangupCall()
async hangupCall(callId: string): Promise<void>
Parameters:
callId:string
Returns: Promise<void>
referCall()
async referCall(callId: string, targetUri: string): Promise<void>
Parameters:
callId:stringtargetUri:string
Returns: Promise<void>
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
HookManager class
📍 src/capabilities/agents/HookManager.ts:15
Constructor
constructor
constructor(
config: HookConfig = {},
emitter: EventEmitter,
errorHandling?: { maxConsecutiveErrors?: number }
)
Parameters:
config:HookConfig(optional) (default:{})emitter:EventEmitter<string | symbol, any>errorHandling:{ maxConsecutiveErrors?: number | undefined; } | undefined(optional)
Methods
register()
Register a hook
register(name: HookName, hook: Hook<any, any>): void
Parameters:
name:"before:execution" | "after:execution" | "before:llm" | "after:llm" | "before:tool" | "after:tool" | "approve:tool" | "pause:check"hook:Hook<any, any>
Returns: void
unregister()
Unregister a specific hook function by reference. Returns true if the hook was found and removed.
unregister(name: HookName, hook: Hook<any, any>): boolean
Parameters:
name:"before:execution" | "after:execution" | "before:llm" | "after:llm" | "before:tool" | "after:tool" | "approve:tool" | "pause:check"hook:Hook<any, any>
Returns: boolean
executeHooks()
Execute hooks for a given name
async executeHooks<K extends HookName>(
name: K,
context: HookSignatures[K]['context'],
defaultResult: HookSignatures[K]['result']
): Promise<HookSignatures[K]['result']>
Parameters:
name:Kcontext:HookSignatures[K]["context"]defaultResult:HookSignatures[K]["result"]
Returns: Promise<HookSignatures[K]["result"]>
hasHooks()
Check if there are any hooks registered
hasHooks(name: HookName): boolean
Parameters:
name:"before:execution" | "after:execution" | "before:llm" | "after:llm" | "before:tool" | "after:tool" | "approve:tool" | "pause:check"
Returns: boolean
getHookCount()
Get hook count
getHookCount(name?: HookName): number
Parameters:
name:"before:execution" | "after:execution" | "before:llm" | "after:llm" | "before:tool" | "after:tool" | "approve:tool" | "pause:check" | undefined(optional)
Returns: number
clear()
Clear all hooks and reset error tracking
clear(): void
Returns: void
destroy()
Destroy the hook manager and release all references
destroy(): void
Returns: void
enableHook()
Re-enable a disabled hook
enableHook(hookKey: string): void
Parameters:
hookKey:string
Returns: void
getDisabledHooks()
Get list of disabled hooks
getDisabledHooks(): string[]
Returns: string[]
IntegrationTestRunner class
📍 src/testing/integration/runner.ts:74
Static Methods
static runSuite()
Run a single test suite with real tools.
static async runSuite(
suite: IntegrationTestSuite,
tools: ToolFunction[],
params: Record<string, string>,
options?: RunSuiteOptions
): Promise<TestSuiteResult>
Parameters:
suite:IntegrationTestSuitetools:ToolFunction<any, any>[]params:Record<string, string>options:RunSuiteOptions | undefined(optional)
Returns: Promise<TestSuiteResult>
static validateParams()
Validate that required params are present.
static validateParams(
suite: IntegrationTestSuite,
params: Record<string, string>
): string[]
Parameters:
suite:IntegrationTestSuiteparams:Record<string, string>
Returns: string[]
static getAllSuites()
Get all registered test suites.
static getAllSuites(): IntegrationTestSuite[]
Returns: IntegrationTestSuite[]
static getSuitesForService()
Get test suites matching a service type.
static getSuitesForService(serviceType: string): IntegrationTestSuite[]
Parameters:
serviceType:string
Returns: IntegrationTestSuite[]
LoggingPlugin class
📍 src/core/tool-execution/plugins/LoggingPlugin.ts:78
LoggingPlugin - Logs tool execution lifecycle events.
Example:
const pipeline = new ToolExecutionPipeline();
pipeline.use(new LoggingPlugin());
// Or with custom options:
pipeline.use(new LoggingPlugin({
level: 'info',
logArgs: false, // Don't log potentially sensitive args
}));
Constructor
constructor
constructor(options: LoggingPluginOptions = {})
Parameters:
options:LoggingPluginOptions(optional) (default:{})
Methods
beforeExecute()
async beforeExecute(ctx: PluginExecutionContext): Promise<BeforeExecuteResult>
Parameters:
ctx:PluginExecutionContext
Returns: Promise<BeforeExecuteResult>
afterExecute()
async afterExecute(ctx: PluginExecutionContext, result: unknown): Promise<unknown>
Parameters:
ctx:PluginExecutionContextresult:unknown
Returns: Promise<unknown>
onError()
async onError(ctx: PluginExecutionContext, error: Error): Promise<unknown>
Parameters:
ctx:PluginExecutionContexterror:Error
Returns: Promise<unknown>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "logging" |
- |
priority |
priority: 5 |
- |
MCPClient class
📍 src/core/mcp/MCPClient.ts:52
MCP Client class
Constructor
constructor
constructor(config: MCPServerConfig, defaults?: MCPConfiguration['defaults'])
Parameters:
config:MCPServerConfigdefaults:{ autoConnect?: boolean | undefined; autoReconnect?: boolean | undefined; reconnectIntervalMs?: number | undefined; maxReconnectAttempts?: number | undefined; requestTimeoutMs?: number | undefined; healthCheckIntervalMs?: number | undefined; } | undefined(optional)
Methods
connect()
async connect(): Promise<void>
Returns: Promise<void>
disconnect()
async disconnect(): Promise<void>
Returns: Promise<void>
reconnect()
async reconnect(): Promise<void>
Returns: Promise<void>
isConnected()
isConnected(): boolean
Returns: boolean
ping()
async ping(): Promise<boolean>
Returns: Promise<boolean>
listTools()
async listTools(): Promise<MCPTool[]>
Returns: Promise<MCPTool[]>
callTool()
async callTool(name: string, args: Record<string, unknown>): Promise<MCPToolResult>
Parameters:
name:stringargs:Record<string, unknown>
Returns: Promise<MCPToolResult>
registerTools()
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()
unregisterTools(toolManager: ToolManager): void
Parameters:
toolManager:ToolManager
Returns: void
listResources()
async listResources(): Promise<MCPResource[]>
Returns: Promise<MCPResource[]>
readResource()
async readResource(uri: string): Promise<MCPResourceContent>
Parameters:
uri:string
Returns: Promise<MCPResourceContent>
subscribeResource()
async subscribeResource(uri: string): Promise<void>
Parameters:
uri:string
Returns: Promise<void>
unsubscribeResource()
async unsubscribeResource(uri: string): Promise<void>
Parameters:
uri:string
Returns: Promise<void>
listPrompts()
async listPrompts(): Promise<MCPPrompt[]>
Returns: Promise<MCPPrompt[]>
getPrompt()
async getPrompt(name: string, args?: Record<string, unknown>): Promise<MCPPromptResult>
Parameters:
name:stringargs:Record<string, unknown> | undefined(optional)
Returns: Promise<MCPPromptResult>
getState()
getState(): MCPClientState
Returns: MCPClientState
loadState()
loadState(state: MCPClientState): void
Parameters:
state:MCPClientState
Returns: void
destroy()
destroy(): void
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string |
- |
MCPRegistry class
📍 src/core/mcp/MCPRegistry.ts:18
MCP Registry - static registry for MCP clients
Static Methods
static create()
Create and register an MCP client
static create(config: MCPServerConfig, defaults?: MCPConfiguration['defaults']): IMCPClient
Parameters:
config:MCPServerConfigdefaults:{ autoConnect?: boolean | undefined; autoReconnect?: boolean | undefined; reconnectIntervalMs?: number | undefined; maxReconnectAttempts?: number | undefined; requestTimeoutMs?: number | undefined; healthCheckIntervalMs?: number | undefined; } | undefined(optional)
Returns: IMCPClient
static get()
Get a registered MCP client
static get(name: string): IMCPClient
Parameters:
name:string
Returns: IMCPClient
static has()
Check if an MCP client is registered
static has(name: string): boolean
Parameters:
name:string
Returns: boolean
static list()
List all registered MCP client names
static list(): string[]
Returns: string[]
static getInfo()
Get info about a registered MCP client
static getInfo(name: string): {
name: string;
state: string;
connected: boolean;
toolCount: number;
}
Parameters:
name:string
Returns: { name: string; state: string; connected: boolean; toolCount: number; }
static getAllInfo()
Get info about all registered MCP clients
static getAllInfo(): Array<{
name: string;
state: string;
connected: boolean;
toolCount: number;
}>
Returns: { name: string; state: string; connected: boolean; toolCount: number; }[]
static createFromConfig()
Create multiple clients from MCP configuration
static createFromConfig(config: MCPConfiguration): IMCPClient[]
Parameters:
config:MCPConfiguration
Returns: IMCPClient[]
static loadFromConfigFile()
Load MCP configuration from file and create clients
static async loadFromConfigFile(path: string): Promise<IMCPClient[]>
Parameters:
path:string
Returns: Promise<IMCPClient[]>
static connectAll()
Connect all servers with autoConnect enabled
static async connectAll(): Promise<void>
Returns: Promise<void>
static disconnectAll()
Disconnect all servers
static async disconnectAll(): Promise<void>
Returns: Promise<void>
static remove()
Remove and destroy a specific client from the registry
static remove(name: string): boolean
Parameters:
name:string
Returns: boolean
static destroyAll()
Destroy all clients and clear registry
static destroyAll(): void
Returns: void
static clear()
Clear the registry (for testing)
static clear(): void
Returns: void
MeteorMongoCollection class
📍 src/memory/adapters/mongo/MeteorMongoCollection.ts:63
Constructor
constructor
constructor(private col: MeteorCollectionLike<T>)
Parameters:
col:MeteorCollectionLike<T>
Methods
insertOne()
async insertOne(doc: T): Promise<string>
Parameters:
doc:T
Returns: Promise<string>
insertMany()
async insertMany(docs: T[]): Promise<string[]>
Parameters:
docs:T[]
Returns: Promise<string[]>
updateOne()
async updateOne(
filter: MongoFilter,
update: MongoUpdate,
opts?: MongoUpdateOptions,
): Promise<MongoUpdateResult>
Parameters:
filter:MongoFilterupdate:MongoUpdateopts:MongoUpdateOptions | undefined(optional)
Returns: Promise<MongoUpdateResult>
deleteOne()
async deleteOne(filter: MongoFilter): Promise<void>
Parameters:
filter:MongoFilter
Returns: Promise<void>
deleteMany()
async deleteMany(filter: MongoFilter): Promise<void>
Parameters:
filter:MongoFilter
Returns: Promise<void>
findOne()
async findOne(filter: MongoFilter, opts?: MongoFindOptions): Promise<T | null>
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T | null>
find()
async find(filter: MongoFilter, opts?: MongoFindOptions): Promise<T[]>
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T[]>
countDocuments()
async countDocuments(filter: MongoFilter): Promise<number>
Parameters:
filter:MongoFilter
Returns: Promise<number>
aggregate()
async aggregate(pipeline: unknown[]): Promise<unknown[]>
Parameters:
pipeline:unknown[]
Returns: Promise<unknown[]>
createIndex()
async createIndex(
spec: Record<string, 1 | -1>,
opts?: {
unique?: boolean;
name?: string;
background?: boolean;
sparse?: boolean;
partialFilterExpression?: Record<string, unknown>;
},
): Promise<void>
Parameters:
spec:Record<string, 1 | -1>opts:{ unique?: boolean | undefined; name?: string | undefined; background?: boolean | undefined; sparse?: boolean | undefined; partialFilterExpression?: Record<string, unknown> | undefined; } | undefined(optional)
Returns: Promise<void>
createSearchIndex()
async createSearchIndex(definition: SearchIndexDefinition): Promise<string>
Parameters:
definition:SearchIndexDefinition
Returns: Promise<string>
listSearchIndexes()
async listSearchIndexes(name?: string): Promise<SearchIndexInfo[]>
Parameters:
name:string | undefined(optional)
Returns: Promise<SearchIndexInfo[]>
dropSearchIndex()
async dropSearchIndex(name: string): Promise<void>
Parameters:
name:string
Returns: Promise<void>
NutTreeDriver class
📍 src/tools/desktop/driver/NutTreeDriver.ts:219
Constructor
constructor
constructor(opts?: NutTreeDriverOptions)
Parameters:
opts:NutTreeDriverOptions | undefined(optional)
Methods
initialize()
async initialize(): Promise<void>
Returns: Promise<void>
screenshot()
async screenshot(region?: { x: number; y: number; width: number; height: number }): Promise<DesktopScreenshot>
Parameters:
region:{ x: number; y: number; width: number; height: number; } | undefined(optional)
Returns: Promise<DesktopScreenshot>
getScreenSize()
async getScreenSize(): Promise<DesktopScreenSize>
Returns: Promise<DesktopScreenSize>
mouseMove()
async mouseMove(x: number, y: number): Promise<void>
Parameters:
x:numbery:number
Returns: Promise<void>
mouseClick()
async mouseClick(x: number, y: number, button: MouseButton, clickCount: number): Promise<void>
Parameters:
x:numbery:numberbutton:MouseButtonclickCount:number
Returns: Promise<void>
mouseDrag()
async mouseDrag(startX: number, startY: number, endX: number, endY: number, button: MouseButton): Promise<void>
Parameters:
startX:numberstartY:numberendX:numberendY:numberbutton:MouseButton
Returns: Promise<void>
mouseScroll()
async mouseScroll(deltaX: number, deltaY: number, x?: number, y?: number): Promise<void>
Parameters:
deltaX:numberdeltaY:numberx:number | undefined(optional)y:number | undefined(optional)
Returns: Promise<void>
getCursorPosition()
async getCursorPosition(): Promise<DesktopPoint>
Returns: Promise<DesktopPoint>
keyboardType()
async keyboardType(text: string, delay?: number): Promise<void>
Parameters:
text:stringdelay:number | undefined(optional)
Returns: Promise<void>
keyboardKey()
async keyboardKey(keys: string): Promise<void>
Parameters:
keys:string
Returns: Promise<void>
getWindowList()
async getWindowList(): Promise<DesktopWindow[]>
Returns: Promise<DesktopWindow[]>
focusWindow()
async focusWindow(windowId: number): Promise<void>
Parameters:
windowId:number
Returns: Promise<void>
ObservationMaskingStrategy class
📍 src/core/context-nextgen/strategies/ObservationMaskingStrategy.ts:7
Opt-in observation masking; retains exact calls, receipts and recoverable sources.
Constructor
constructor
constructor(config: ObservationMaskingStrategyConfig = {})
Parameters:
config:ObservationMaskingStrategyConfig(optional) (default:{})
Methods
compact()
async compact(context: CompactionContext, _targetToFree: number): Promise<CompactionResult>
Parameters:
context:CompactionContext_targetToFree:number
Returns: Promise<CompactionResult>
consolidate()
async consolidate(_context: CompactionContext): Promise<ConsolidationResult>
Parameters:
_context:CompactionContext
Returns: Promise<ConsolidationResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "observation-masking" |
- |
displayName |
displayName: "Observation masking" |
- |
description |
description: "Retain exact actions and user messages; replace older observation bodies with evidence references. No helper model." |
- |
requiredPlugins |
requiredPlugins: readonly ["evidence"] |
- |
threshold |
threshold: number |
- |
OpenAIDecisions class
📍 src/capabilities/openai/OpenAIDecisions.ts:10
Connector-first access to OpenAI's ordered classification/scoring API.
Constructor
constructor
constructor(connector: string | Connector)
Parameters:
connector:string | Connector
Methods
create()
async create(params: DecisionCreateParams): Promise<Decision>
Parameters:
params:DecisionCreateParams
Returns: Promise<Decision>
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
OpenAIRealtimeAPI class
📍 src/capabilities/voice/openai/OpenAIRealtimeAPI.ts:31
REST helpers for browser/WebRTC credentials and server-side SIP call control.
Constructor
constructor
constructor(connector: string | Connector)
Parameters:
connector:string | Connector
Methods
createClientSecret()
async createClientSecret(options: CreateRealtimeClientSecretOptions): Promise<OpenAIRealtimeClientSecret>
Parameters:
options:CreateRealtimeClientSecretOptions
Returns: Promise<OpenAIRealtimeClientSecret>
createTranslationClientSecret()
async createTranslationClientSecret(
options: CreateRealtimeTranslationClientSecretOptions,
): Promise<OpenAIRealtimeClientSecret>
Parameters:
options:CreateRealtimeTranslationClientSecretOptions
Returns: Promise<OpenAIRealtimeClientSecret>
createWebRTCCall()
Exchange a WebRTC SDP offer for the SDP answer (backward-compatible API).
async createWebRTCCall(options: CreateRealtimeWebRTCCallOptions): Promise<string>
Parameters:
options:CreateRealtimeWebRTCCallOptions
Returns: Promise<string>
createWebRTCCallWithMetadata()
Exchange a WebRTC SDP offer for the SDP answer and sideband call ID.
async createWebRTCCallWithMetadata(
options: CreateRealtimeWebRTCCallOptions,
): Promise<OpenAIRealtimeWebRTCCall>
Parameters:
options:CreateRealtimeWebRTCCallOptions
Returns: Promise<OpenAIRealtimeWebRTCCall>
acceptCall()
async acceptCall(callId: string, session: OpenAIRealtimeSessionConfig): Promise<void>
Parameters:
callId:stringsession:OpenAIRealtimeSessionConfig
Returns: Promise<void>
rejectCall()
async rejectCall(callId: string, statusCode?: number): Promise<void>
Parameters:
callId:stringstatusCode:number | undefined(optional)
Returns: Promise<void>
hangupCall()
async hangupCall(callId: string): Promise<void>
Parameters:
callId:string
Returns: Promise<void>
referCall()
async referCall(callId: string, targetUri: string): Promise<void>
Parameters:
callId:stringtargetUri:string
Returns: Promise<void>
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
OpenAIRealtimeChannelTransport class
📍 src/capabilities/voice/openai/OpenAIRealtimeChannelTransport.ts:25
Adapts a browser data channel or cross-process text bridge to the transport consumed by OpenAIRealtimeAgentSession. Audio may remain on WebRTC media tracks.
Constructor
constructor
constructor(options: OpenAIRealtimeChannelTransportOptions)
Parameters:
options:OpenAIRealtimeChannelTransportOptions
Methods
connect()
async connect(options: { signal?: AbortSignal } = {}): Promise<OpenAIRealtimeServerEvent>
Parameters:
options:{ signal?: AbortSignal | undefined; }(optional) (default:{})
Returns: Promise<OpenAIRealtimeServerEvent>
updateSession()
updateSession(session: OpenAIRealtimeSessionConfig): void
Parameters:
session:OpenAIRealtimeSessionConfig
Returns: void
appendAudio()
appendAudio(audio: Buffer | string): boolean
Parameters:
audio:string | Buffer<ArrayBufferLike>
Returns: boolean
send()
send(event: OpenAIRealtimeClientEvent): void
Parameters:
event:OpenAIRealtimeClientEvent
Returns: void
close()
close(code = 1000, reason = 'Client closed'): void
Parameters:
code:number(optional) (default:1000)reason:string(optional) (default:'Client closed')
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
emitsOutputAudioFromEvents |
emitsOutputAudioFromEvents: false |
- |
OpenAISafetyAPI class
📍 src/capabilities/openai/OpenAISafetyAPI.ts:7
Connector-first access to OpenAI safety-alert records.
Constructor
constructor
constructor(connector: string | Connector)
Parameters:
connector:string | Connector
Methods
retrieveAlert()
async retrieveAlert(id: string): Promise<SafetyAlert>
Parameters:
id:string
Returns: Promise<SafetyAlert>
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
OpenAIVoices class
📍 src/capabilities/openai/OpenAIVoices.ts:9
Connector-first creation of prompt-designed and consent-based OpenAI voices.
Constructor
constructor
constructor(connector: string | Connector)
Parameters:
connector:string | Connector
Methods
create()
async create(params: OpenAIVoiceCreateParams): Promise<OpenAIVoice>
Parameters:
params:VoiceCreateParams
Returns: Promise<Voice & { _request_id?: string | null | undefined; }>
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: Connector |
- |
PermissionPolicyManager class
📍 src/core/permissions/PermissionPolicyManager.ts:96
Constructor
constructor
constructor(config: PermissionPolicyManagerConfig = {})
Parameters:
config:PermissionPolicyManagerConfig(optional) (default:{})
Static Methods
static fromLegacyConfig()
Create a PermissionPolicyManager from legacy AgentPermissionsConfig.
Translates:
- blocklist → BlocklistPolicy
- allowlist → AllowlistPolicy (merged with DEFAULT_ALLOWLIST)
- defaultScope → SessionApprovalPolicy
- onApprovalRequired → passed through
static fromLegacyConfig(config: AgentPermissionsConfig): PermissionPolicyManager
Parameters:
config:AgentPermissionsConfig
Returns: PermissionPolicyManager
static fromConfig()
Create from the new AgentPolicyConfig (extends legacy config).
static fromConfig(config: AgentPolicyConfig): PermissionPolicyManager
Parameters:
config:AgentPolicyConfig
Returns: PermissionPolicyManager
Methods
addPolicy()
addPolicy(policy: IPermissionPolicy): void
Parameters:
policy:IPermissionPolicy
Returns: void
removePolicy()
removePolicy(name: string): boolean
Parameters:
name:string
Returns: boolean
hasPolicy()
hasPolicy(name: string): boolean
Parameters:
name:string
Returns: boolean
listPolicies()
listPolicies(): IPermissionPolicy[]
Returns: IPermissionPolicy[]
setParentEvaluator()
Set a read-only parent evaluator for orchestrator delegation.
- Parent deny is FINAL — worker cannot override
- Parent allow does NOT skip worker restrictions
- Parent approval callback is NOT invoked during delegation check
setParentEvaluator(parent: PermissionPolicyManager): void
Parameters:
parent:PermissionPolicyManager
Returns: void
getParentEvaluator()
Get the parent evaluator (if set).
getParentEvaluator(): PermissionPolicyManager | undefined
Returns: PermissionPolicyManager | undefined
check()
Check if a tool call is permitted.
Evaluation order:
- USER RULES PRE-CHECK (highest priority, FINAL when matched)
- Parent delegation pre-check (orchestrator workers)
- Normal policy chain (built-in policies)
- Approval flow (if deny + needsApproval)
- Approval→rule creation (if user wants to remember)
async check(context: PolicyContext): Promise<PolicyCheckResult>
Parameters:
context:PolicyContext
Returns: Promise<PolicyCheckResult>
approve()
Record an approval in the session cache.
approve(approvalKey: string, options?: {
scope?: PermissionScope;
approvedBy?: string;
ttlMs?: number;
}): void
Parameters:
approvalKey:stringoptions:{ scope?: PermissionScope | undefined; approvedBy?: string | undefined; ttlMs?: number | undefined; } | undefined(optional)
Returns: void
revoke()
Revoke an approval from the session cache.
revoke(approvalKey: string): void
Parameters:
approvalKey:string
Returns: void
isApproved()
Check if an approval key is cached.
isApproved(approvalKey: string): boolean
Parameters:
approvalKey:string
Returns: boolean
clearSession()
Clear all session approvals.
clearSession(): void
Returns: void
allowlistAdd()
allowlistAdd(toolName: string): void
Parameters:
toolName:string
Returns: void
allowlistRemove()
allowlistRemove(toolName: string): void
Parameters:
toolName:string
Returns: void
blocklistAdd()
blocklistAdd(toolName: string): void
Parameters:
toolName:string
Returns: void
blocklistRemove()
blocklistRemove(toolName: string): void
Parameters:
toolName:string
Returns: void
getState()
Serialize approval state for session persistence.
getState(): SerializedPolicyState
Returns: SerializedPolicyState
loadState()
Load approval state from persistence.
loadState(state: SerializedPolicyState): void
Parameters:
state:SerializedPolicyState
Returns: void
destroy()
destroy(): void
Returns: void
PersistentInstructionsPluginNextGen class
📍 src/core/context-nextgen/plugins/PersistentInstructionsPluginNextGen.ts:88
Constructor
constructor
constructor(config: PersistentInstructionsConfig)
Parameters:
config:PersistentInstructionsConfig
Methods
getInstructions()
getInstructions(): string
Returns: string
getContent()
async getContent(): Promise<string | null>
Returns: Promise<string | null>
getContents()
getContents(): Map<string, InstructionEntry>
Returns: Map<string, InstructionEntry>
getTokenSize()
getTokenSize(): number
Returns: number
getInstructionsTokenSize()
getInstructionsTokenSize(): number
Returns: number
isCompactable()
isCompactable(): boolean
Returns: boolean
compact()
async compact(_targetTokensToFree: number): Promise<number>
Parameters:
_targetTokensToFree:number
Returns: Promise<number>
getTools()
getTools(): ToolFunction[]
Returns: ToolFunction<any, any>[]
destroy()
destroy(): void
Returns: void
getState()
getState(): SerializedPersistentInstructionsState
Returns: SerializedPersistentInstructionsState
restoreState()
restoreState(state: unknown): void
Parameters:
state:unknown
Returns: void
initialize()
Initialize by loading from storage (called lazily)
async initialize(): Promise<void>
Returns: Promise<void>
set()
Add or update an instruction entry by key
async set(key: string, content: string): Promise<boolean>
Parameters:
key:stringcontent:string
Returns: Promise<boolean>
remove()
Remove an instruction entry by key
async remove(key: string): Promise<boolean>
Parameters:
key:string
Returns: Promise<boolean>
get()
Get one entry by key, or all entries if no key provided
async get(key?: string): Promise<InstructionEntry | InstructionEntry[] | null>
Parameters:
key:string | undefined(optional)
Returns: Promise<InstructionEntry | InstructionEntry[] | null>
list()
List metadata for all entries
async list(): Promise<{ key: string; contentLength: number; createdAt: number; updatedAt: number }[]>
Returns: Promise<{ key: string; contentLength: number; createdAt: number; updatedAt: number; }[]>
clear()
Clear all instruction entries
async clear(): Promise<void>
Returns: Promise<void>
getStoreSchema()
getStoreSchema(): StoreEntrySchema
Returns: StoreEntrySchema
storeGet()
async storeGet(key?: string, _context?: ToolContext): Promise<StoreGetResult>
Parameters:
key:string | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreGetResult>
storeSet()
async storeSet(key: string, data: Record<string, unknown>, _context?: ToolContext): Promise<StoreSetResult>
Parameters:
key:stringdata:Record<string, unknown>_context:ToolContext | undefined(optional)
Returns: Promise<StoreSetResult>
storeDelete()
async storeDelete(key: string, _context?: ToolContext): Promise<StoreDeleteResult>
Parameters:
key:string_context:ToolContext | undefined(optional)
Returns: Promise<StoreDeleteResult>
storeList()
async storeList(_filter?: Record<string, unknown>, _context?: ToolContext): Promise<StoreListResult>
Parameters:
_filter:Record<string, unknown> | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreListResult>
storeAction()
async storeAction(action: string, params?: Record<string, unknown>, _context?: ToolContext): Promise<StoreActionResult>
Parameters:
action:stringparams:Record<string, unknown> | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreActionResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "persistent_instructions" |
- |
PlainTextAdapter class
📍 src/memory/integration/signals/adapters/PlainTextAdapter.ts:18
Methods
extract()
extract(raw: PlainTextRaw): ExtractedSignal
Parameters:
raw:PlainTextRaw
Returns: ExtractedSignal
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: "text" |
- |
PluginRegistry class
📍 src/core/context-nextgen/PluginRegistry.ts:115
Static Methods
static register()
Register an external plugin factory.
static register(
pluginName: string,
factory: PluginFactory,
options?: PluginRegisterOptions,
): void
Parameters:
pluginName:stringfactory:PluginFactoryoptions:PluginRegisterOptions | undefined(optional)
Returns: void
static has()
Check if a feature key has a registered factory
static has(featureKey: string): boolean
Parameters:
featureKey:string
Returns: boolean
static get()
Get a registry entry by feature key
static get(featureKey: string): PluginRegistryEntry | undefined
Parameters:
featureKey:string
Returns: PluginRegistryEntry | undefined
static list()
List all registered feature keys
static list(): string[]
Returns: string[]
static getInfo()
Get serializable info for all registered plugins (no factory references)
static getInfo(): PluginRegistryInfo[]
Returns: PluginRegistryInfo[]
static remove()
Remove a registered plugin by feature key
static remove(featureKey: string): boolean
Parameters:
featureKey:string
Returns: boolean
static getAll()
Get all entries as ReadonlyMap (internal use by AgentContextNextGen)
static getAll(): ReadonlyMap<string, PluginRegistryEntry>
Returns: ReadonlyMap<string, PluginRegistryEntry>
PredicateRegistry class
📍 src/memory/predicates/PredicateRegistry.ts:23
Static Methods
static standard()
Returns a fresh registry seeded with the standard 44-predicate set
(10 categories). Called as a factory — each invocation produces an
independent instance, so mutations never leak between MemorySystems
or tests. The authoritative count lives in standard.ts's header.
static standard(): PredicateRegistry
Returns: PredicateRegistry
static empty()
Returns an empty registry. Use for fully custom vocabularies.
static empty(): PredicateRegistry
Returns: PredicateRegistry
Methods
register()
register(def: PredicateDefinition): this
Parameters:
def:PredicateDefinition
Returns: this
registerAll()
registerAll(defs: PredicateDefinition[]): this
Parameters:
defs:PredicateDefinition[]
Returns: this
unregister()
unregister(name: string): this
Parameters:
name:string
Returns: this
get()
Resolve an input name (already-canonical, alias, camelCase, or dashed form) to the canonical definition, or null.
get(nameOrAlias: string): PredicateDefinition | null
Parameters:
nameOrAlias:string
Returns: PredicateDefinition | null
has()
has(nameOrAlias: string): boolean
Parameters:
nameOrAlias:string
Returns: boolean
canonicalize()
Normalize an input string to the canonical predicate name.
- 'worksAt' → 'works_at' (camelCase → snake)
- 'works-at' → 'works_at' (dash → snake)
- 'Works At' → 'works_at' (whitespace → snake)
- 'employed_by' → 'works_at' (alias lookup)
- 'unknown_thing' → 'unknown_thing' (unchanged — registry is permissive)
canonicalize(input: string): string
Parameters:
input:string
Returns: string
findClosest()
Best-effort near-match for an unknown predicate. Returns the canonical
name of the closest known predicate within a length-aware edit-distance
budget, or null if nothing is close enough.
Used by ExtractionResolver's H5 drift policy to snap LLM typos like
"work_at" onto the registered "works_at". Does NOT help with pure
semantic mismatches ("discussed_topic" ↛ "mentioned") — those need
human-in-the-loop review of the newPredicates report.
F3 — length-aware distance budget. A flat distance-2 threshold is too
loose for long predicates where 2-char swaps flip meaning
(talks_at ↔ works_at). The effective budget is:
effectiveMax = min(maxDistance, max(1, floor(min(lenA, lenB) / 4)))
So short predicates allow distance 1, 8-char predicates allow 2, 12+ char
predicates allow 3 — matching how typos scale with word length. Callers
can tighten with opts.maxDistance (absolute cap) or override entirely
by passing a very low value.
findClosest(
input: string,
opts?: { maxDistance?: number },
): { name: string; distance: number } | null
Parameters:
input:stringopts:{ maxDistance?: number | undefined; } | undefined(optional)
Returns: { name: string; distance: number; } | null
list()
List definitions, optionally filtered by category or subject-type hint.
This is the general enumeration API — it returns every registered
definition. To get the LLM-facing subset (excluding noise predicates
tagged excludeFromExtractionPrompt), use renderForPrompt or filter
the result yourself on excludeFromExtractionPrompt.
list(filter?: { categories?: string[]; subjectType?: string }): PredicateDefinition[]
Parameters:
filter:{ categories?: string[] | undefined; subjectType?: string | undefined; } | undefined(optional)
Returns: PredicateDefinition[]
categories()
categories(): string[]
Returns: string[]
renderForPrompt()
Render the registry as a markdown block suitable for injection into an
LLM extraction prompt. Chunked by category; capped by maxPerCategory
to keep the prompt token budget bounded.
⚠️ Default-filter behavior change (lifecycle rollout). Predicates
flagged excludeFromExtractionPrompt: true are omitted by default. In
the standard registry that hides per-message communication noise from
the LLM vocabulary: emailed, called, messaged, cc_ed,
mentioned, responded_to, acknowledged, noted,
interaction_count. These predicates remain fully valid for direct
callers (calendar adapters, comms aggregators, extractors that emit
them programmatically) — only the LLM's view of the vocabulary
narrows.
If your host previously embedded the full renderForPrompt() output
into a custom prompt and relied on those names being present, pass
includeExcluded: true to preserve the prior surface. Default-mode
callers that just want a cleaner extraction prompt need do nothing.
Use list() (or filter on excludeFromExtractionPrompt yourself) when
you need the full registered set for non-prompt purposes.
renderForPrompt(opts?: {
categories?: string[];
subjectType?: string;
maxPerCategory?: number;
/** When true, include `excludeFromExtractionPrompt` predicates. */
includeExcluded?: boolean;
/**
* Bucketing dimension for the rendered vocabulary.
*
* - `'category'` (default) — groups by `def.category`. Original behavior.
* - `'subjectType'` — groups by the `subjectTypes` hint, with predicates
* appearing under EACH of their listed types. Predicates without
* `subjectTypes` land in a `### generic` bucket. Used by hosts that
* want the LLM to extract subject-of facts for non-person subjects
* (projects, organizations, events) without a person being the actor.
* Pair with `ExtractionPromptContext.subjectOfHintsEnabled` to render
* the matching narrative section in `defaultExtractionPrompt`.
*/
groupBy?: 'category' | 'subjectType';
}): string
Parameters:
opts:{ categories?: string[] | undefined; subjectType?: string | undefined; maxPerCategory?: number | undefined; includeExcluded?: boolean | undefined; groupBy?: "category" | "subjectType" | undefined; } | undefined(optional)
Returns: string
toRankingWeights()
Produce a new RankingConfig.predicateWeights map merging the registry's
weights with the caller-supplied base. base wins on collision so
user configuration always trumps the registry default. Returns a NEW
object; never mutates inputs.
toRankingWeights(base?: Record<string, number>): Record<string, number>
Parameters:
base:Record<string, number> | undefined(optional)
Returns: Record<string, number>
ProviderConfigAgent class
📍 src/agents/ProviderConfigAgent.ts:19
Built-in agent for generating OAuth provider configurations
Constructor
constructor
Create a provider config agent
constructor(connectorName: string = 'openai')
Parameters:
connectorName:string(optional) (default:'openai')
Methods
run()
Start interactive configuration session AI will ask questions and generate the connector config
async run(initialInput?: string): Promise<string | ConnectorConfigResult>
Parameters:
initialInput:string | undefined(optional)
Returns: Promise<string | ConnectorConfigResult>
continue()
Continue conversation (for multi-turn interaction)
async continue(userMessage: string): Promise<string | ConnectorConfigResult>
Parameters:
userMessage:string
Returns: Promise<string | ConnectorConfigResult>
reset()
Reset conversation
reset(): void
Returns: void
destroy()
Release the underlying agent and clear the current conversation.
destroy(): void
Returns: void
RapidAPIProvider class
📍 src/capabilities/search/providers/RapidAPIProvider.ts:18
Constructor
constructor
constructor(readonly connector: Connector)
Parameters:
connector:Connector
Methods
search()
async search(query: string, options: SearchOptions = {}): Promise<SearchResponse>
Parameters:
query:stringoptions:SearchOptions(optional) (default:{})
Returns: Promise<SearchResponse>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "rapidapi" |
- |
RawMongoCollection class
📍 src/memory/adapters/mongo/RawMongoCollection.ts:77
Constructor
constructor
constructor(
private col: RawMongoDriverCollection<T>,
/** ObjectId constructor from the `mongodb` package (e.g. `ObjectId` imported from 'mongodb'). */
private ObjectId: ObjectIdCtor,
private client?: RawMongoClientLike,
)
Parameters:
col:RawMongoDriverCollection<T>ObjectId:ObjectIdCtorclient:RawMongoClientLike | undefined(optional)
Methods
insertOne()
async insertOne(doc: T): Promise<string>
Parameters:
doc:T
Returns: Promise<string>
insertMany()
async insertMany(docs: T[]): Promise<string[]>
Parameters:
docs:T[]
Returns: Promise<string[]>
updateOne()
async updateOne(
filter: MongoFilter,
update: MongoUpdate,
opts?: MongoUpdateOptions,
): Promise<MongoUpdateResult>
Parameters:
filter:MongoFilterupdate:MongoUpdateopts:MongoUpdateOptions | undefined(optional)
Returns: Promise<MongoUpdateResult>
deleteOne()
async deleteOne(filter: MongoFilter): Promise<void>
Parameters:
filter:MongoFilter
Returns: Promise<void>
deleteMany()
async deleteMany(filter: MongoFilter): Promise<void>
Parameters:
filter:MongoFilter
Returns: Promise<void>
findOne()
async findOne(filter: MongoFilter, opts?: MongoFindOptions): Promise<T | null>
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T | null>
find()
async find(filter: MongoFilter, opts?: MongoFindOptions): Promise<T[]>
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T[]>
countDocuments()
countDocuments(filter: MongoFilter): Promise<number>
Parameters:
filter:MongoFilter
Returns: Promise<number>
aggregate()
async aggregate(pipeline: unknown[]): Promise<unknown[]>
Parameters:
pipeline:unknown[]
Returns: Promise<unknown[]>
createIndex()
async createIndex(
spec: Record<string, 1 | -1>,
opts?: {
unique?: boolean;
name?: string;
background?: boolean;
sparse?: boolean;
partialFilterExpression?: Record<string, unknown>;
},
): Promise<void>
Parameters:
spec:Record<string, 1 | -1>opts:{ unique?: boolean | undefined; name?: string | undefined; background?: boolean | undefined; sparse?: boolean | undefined; partialFilterExpression?: Record<string, unknown> | undefined; } | undefined(optional)
Returns: Promise<void>
createSearchIndex()
async createSearchIndex(definition: SearchIndexDefinition): Promise<string>
Parameters:
definition:SearchIndexDefinition
Returns: Promise<string>
listSearchIndexes()
async listSearchIndexes(name?: string): Promise<SearchIndexInfo[]>
Parameters:
name:string | undefined(optional)
Returns: Promise<SearchIndexInfo[]>
dropSearchIndex()
async dropSearchIndex(name: string): Promise<void>
Parameters:
name:string
Returns: Promise<void>
withTransaction()
async withTransaction<R>(fn: () => Promise<R>): Promise<R>
Parameters:
fn:() => Promise<R>
Returns: Promise<R>
RealtimePipeline class
📍 src/capabilities/voice/pipelines/RealtimePipeline.ts:91
Constructor
constructor
constructor(config: RealtimePipelineInitConfig)
Parameters:
config:RealtimePipelineInitConfig
Methods
init()
async init(sessionInfo: VoiceSessionInfo): Promise<void>
Parameters:
sessionInfo:VoiceSessionInfo
Returns: Promise<void>
processAudio()
processAudio(frame: AudioFrame): void
Parameters:
frame:AudioFrame
Returns: void
onSpeechEnd()
async onSpeechEnd(): Promise<void>
Returns: Promise<void>
onSpeechStart()
onSpeechStart(): void
Returns: void
interrupt()
interrupt(): void
Returns: void
onPlaybackAck()
onPlaybackAck(_ack: { name: string; playedMs: number }): void
Parameters:
_ack:{ name: string; playedMs: number; }
Returns: void
onTelephonyTimestamp()
onTelephonyTimestamp(timestamp: number): void
Parameters:
timestamp:number
Returns: void
getState()
getState(): SessionState
Returns: SessionState
on()
on<K extends keyof VoicePipelineEvents>(event: K, handler: VoicePipelineEvents[K]): this
Parameters:
event:Khandler:VoicePipelineEvents[K]
Returns: this
off()
off<K extends keyof VoicePipelineEvents>(event: K, handler: VoicePipelineEvents[K]): this
Parameters:
event:Khandler:VoicePipelineEvents[K]
Returns: this
getTranscript()
Get the full conversation transcript for this session.
getTranscript(): TranscriptMessage[]
Returns: TranscriptMessage[]
destroy()
async destroy(): Promise<void>
Returns: Promise<void>
ScopedConnectorRegistry class
📍 src/core/ScopedConnectorRegistry.ts:16
Constructor
constructor
constructor(
private readonly policy: IConnectorAccessPolicy,
private readonly context: ConnectorAccessContext
)
Parameters:
policy:IConnectorAccessPolicycontext:ConnectorAccessContext
Methods
get()
get(name: string): Connector
Parameters:
name:string
Returns: Connector
has()
has(name: string): boolean
Parameters:
name:string
Returns: boolean
list()
list(): string[]
Returns: string[]
listAll()
listAll(): Connector[]
Returns: Connector[]
size()
size(): number
Returns: number
getDescriptionsForTools()
getDescriptionsForTools(): string
Returns: string
getInfo()
getInfo(): Record<string, { displayName: string; description: string; baseURL: string }>
Returns: Record<string, { displayName: string; description: string; baseURL: string; }>
getById()
getById(id: string): Connector
Parameters:
id:string
Returns: Connector
ScrapeProvider class
📍 src/capabilities/scrape/ScrapeProvider.ts:204
ScrapeProvider factory
Creates the appropriate provider based on Connector's serviceType. Use createWithFallback() for automatic fallback on failure.
Static Methods
static create()
Create a scrape provider from a connector
static create(config: ScrapeProviderConfig): IScrapeProvider
Parameters:
config:ScrapeProviderConfig
Returns: IScrapeProvider
static hasProvider()
Check if a service type has a registered provider
static hasProvider(serviceType: string): boolean
Parameters:
serviceType:string
Returns: boolean
static listProviders()
List all registered provider service types
static listProviders(): string[]
Returns: string[]
static createWithFallback()
Create a scrape provider with fallback chain
Returns a provider that will try each connector in order until one succeeds.
static createWithFallback(config: ScrapeProviderFallbackConfig): IScrapeProvider
Parameters:
config:ScrapeProviderFallbackConfig
Returns: IScrapeProvider
SearchProvider class
📍 src/capabilities/search/SearchProvider.ts:91
SearchProvider factory
Static Methods
static create()
Create a search provider from a connector
static create(config: SearchProviderConfig): ISearchProvider
Parameters:
config:SearchProviderConfig
Returns: ISearchProvider
SentenceChunkingStrategy class
📍 src/capabilities/speech/SentenceSplitter.ts:43
Default chunking strategy that splits text at sentence boundaries.
Handles:
- Sentence terminators (. ? !) followed by whitespace
- Abbreviation exclusion (Dr., Mr., U.S., e.g., etc.)
- Numeric decimals (3.14, $1.50)
- Paragraph breaks (\n\n)
- Fenced code block tracking (
...) - Markdown stripping
- Min/max chunk length enforcement
Constructor
constructor
constructor(options?: ChunkingOptions)
Parameters:
options:ChunkingOptions | undefined(optional)
Methods
feed()
feed(delta: string): string[]
Parameters:
delta:string
Returns: string[]
flush()
flush(): string | null
Returns: string | null
reset()
reset(): void
Returns: void
SerperProvider class
📍 src/capabilities/search/providers/SerperProvider.ts:15
Constructor
constructor
constructor(readonly connector: Connector)
Parameters:
connector:Connector
Methods
search()
async search(query: string, options: SearchOptions = {}): Promise<SearchResponse>
Parameters:
query:stringoptions:SearchOptions(optional) (default:{})
Returns: Promise<SearchResponse>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "serper" |
- |
SharedWorkspacePluginNextGen class
📍 src/core/context-nextgen/plugins/SharedWorkspacePluginNextGen.ts:101
Constructor
constructor
constructor(config?: Partial<SharedWorkspaceConfig>)
Parameters:
config:Partial<SharedWorkspaceConfig> | undefined(optional)
Methods
getInstructions()
getInstructions(): string
Returns: string
getContent()
async getContent(): Promise<string | null>
Returns: Promise<string | null>
getContents()
getContents(): { entries: SharedWorkspaceEntry[]; log: WorkspaceLogEntry[] }
Returns: { entries: SharedWorkspaceEntry[]; log: WorkspaceLogEntry[]; }
getTokenSize()
getTokenSize(): number
Returns: number
getInstructionsTokenSize()
getInstructionsTokenSize(): number
Returns: number
isCompactable()
isCompactable(): boolean
Returns: boolean
compact()
async compact(targetTokensToFree: number): Promise<number>
Parameters:
targetTokensToFree:number
Returns: Promise<number>
getTools()
getTools(): ToolFunction[]
Returns: ToolFunction<any, any>[]
destroy()
destroy(): void
Returns: void
getState()
getState(): SerializedSharedWorkspaceState
Returns: SerializedSharedWorkspaceState
restoreState()
restoreState(state: unknown): void
Parameters:
state:unknown
Returns: void
getStoreSchema()
getStoreSchema(): StoreEntrySchema
Returns: StoreEntrySchema
storeGet()
async storeGet(key?: string, _context?: ToolContext): Promise<StoreGetResult>
Parameters:
key:string | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreGetResult>
storeSet()
async storeSet(key: string, data: Record<string, unknown>, _context?: ToolContext): Promise<StoreSetResult>
Parameters:
key:stringdata:Record<string, unknown>_context:ToolContext | undefined(optional)
Returns: Promise<StoreSetResult>
storeDelete()
async storeDelete(key: string, _context?: ToolContext): Promise<StoreDeleteResult>
Parameters:
key:string_context:ToolContext | undefined(optional)
Returns: Promise<StoreDeleteResult>
storeList()
async storeList(filter?: Record<string, unknown>, _context?: ToolContext): Promise<StoreListResult>
Parameters:
filter:Record<string, unknown> | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreListResult>
storeAction()
async storeAction(action: string, params?: Record<string, unknown>, _context?: ToolContext): Promise<StoreActionResult>
Parameters:
action:stringparams:Record<string, unknown> | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreActionResult>
getEntry()
Get an entry by key
getEntry(key: string): SharedWorkspaceEntry | undefined
Parameters:
key:string
Returns: SharedWorkspaceEntry | undefined
getAllEntries()
Get all entries
getAllEntries(): SharedWorkspaceEntry[]
Returns: SharedWorkspaceEntry[]
getLog()
Get the conversation log
getLog(): WorkspaceLogEntry[]
Returns: WorkspaceLogEntry[]
appendLog()
Append to the conversation log
appendLog(author: string, message: string): void
Parameters:
author:stringmessage:string
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "shared_workspace" |
- |
SignalIngestor class
📍 src/memory/integration/signals/SignalIngestor.ts:133
Constructor
constructor
constructor(config: SignalIngestorConfig)
Parameters:
config:SignalIngestorConfig
Methods
registerAdapter()
Register (or replace) an adapter for a given kind.
registerAdapter(adapter: SignalSourceAdapter<unknown>): this
Parameters:
adapter:SignalSourceAdapter<unknown>
Returns: this
hasAdapter()
hasAdapter(kind: string): boolean
Parameters:
kind:string
Returns: boolean
ingest()
Typed ingest by adapter kind.
async ingest<TRaw>(input: IngestSignalInput<TRaw>): Promise<IngestionResult>
Parameters:
input:IngestSignalInput<TRaw>
Returns: Promise<IngestionResult>
ingestText()
Bypass adapters — caller provides raw text + optional participant seeds directly.
async ingestText(input: IngestTextInput): Promise<IngestionResult>
Parameters:
input:IngestTextInput
Returns: Promise<IngestionResult>
ingestExtracted()
Lowest-level entry point — for callers with their own adapter logic.
async ingestExtracted(input: IngestExtractedInput): Promise<IngestionResult>
Parameters:
input:IngestExtractedInput
Returns: Promise<IngestionResult>
SimpleScheduler class
📍 src/infrastructure/scheduling/SimpleScheduler.ts:10
Methods
schedule()
schedule(id: string, spec: ScheduleSpec, callback: () => void | Promise<void>): ScheduleHandle
Parameters:
id:stringspec:ScheduleSpeccallback:() => void | Promise<void>
Returns: ScheduleHandle
cancel()
cancel(id: string): void
Parameters:
id:string
Returns: void
cancelAll()
cancelAll(): void
Returns: void
has()
has(id: string): boolean
Parameters:
id:string
Returns: boolean
destroy()
destroy(): void
Returns: void
SkepticPass class
📍 src/memory/integration/SkepticPass.ts:89
Constructor
constructor
constructor(config: SkepticPassConfig)
Parameters:
config:SkepticPassConfig
Static Methods
static withAgent()
Construct from a pre-built agent-like object. Intended for testing — same
pattern as ConnectorProfileGenerator.withAgent.
static withAgent(args: {
agent: AgentLike;
connector?: string;
model?: string;
promptTemplate?: (ctx: SkepticPromptContext) => string;
temperature?: number;
onDecision?: RestraintEventListener;
maxOutputTokens?: number;
}): SkepticPass
Parameters:
args:{ agent: AgentLike; connector?: string | undefined; model?: string | undefined; promptTemplate?: ((ctx: SkepticPromptContext) => string) | undefined; temperature?: number | undefined; onDecision?: RestraintEventListener | undefined; maxOutputTokens?: number | undefined; }
Returns: SkepticPass
Methods
review()
Review a list of items and return the kept/dropped split. Always emits one event per item (and pass-level events on parse / model errors). On any failure the pass falls open (all items kept) and the failure is logged — never silently swallowed.
async review(
items: SkepticReviewItem[],
ctx: SkepticReviewContext = {},
): Promise<SkepticReviewResult>
Parameters:
items:SkepticReviewItem[]ctx:SkepticReviewContext(optional) (default:{})
Returns: Promise<SkepticReviewResult>
destroy()
Idempotent. Calling twice is a no-op rather than a double-destroy of the underlying Agent.
destroy(): void
Returns: void
StaticAnchorRegistry class
📍 src/memory/integration/AnchorRegistry.ts:66
Static-data convenience — wraps a fixed Anchor[] as an AnchorRegistry.
Useful for tests, demos, and scripts where the active set is hand-rolled.
getAnchorsForUser returns the same list regardless of userId — this is
intentional for testing. Real impls should branch on userId.
Constructor
constructor
constructor(private readonly anchors: readonly Anchor[])
Parameters:
anchors:readonly Anchor[]
Methods
getAnchorsForUser()
async getAnchorsForUser(_userId: string): Promise<Anchor[]>
Parameters:
_userId:string
Returns: Promise<Anchor[]>
validateBinding()
async validateBinding(_userId: string, anchorId: string): Promise<boolean>
Parameters:
_userId:stringanchorId:string
Returns: Promise<boolean>
StorageRegistry class
📍 src/core/StorageRegistry.ts:101
Static Methods
static configure()
Configure multiple storage backends at once.
static configure(config: Partial<StorageConfig>): void
Parameters:
config:Partial<StorageConfig>
Returns: void
static setContext()
Set the default StorageContext.
This context is automatically passed to all per-agent factory calls (sessions, persistentInstructions, workingMemory) when no explicit context is provided. Typically set once at app startup with global tenant/environment info, or per-request in multi-tenant servers.
static setContext(context: StorageContext | undefined): void
Parameters:
context:StorageContext | undefined
Returns: void
static getContext()
Get the current default StorageContext.
static getContext(): StorageContext | undefined
Returns: StorageContext | undefined
static set()
Set a single storage backend.
static set<K extends keyof StorageConfig>(key: K, value: StorageConfig[K]): void
Parameters:
key:Kvalue:StorageConfig[K]
Returns: void
static get()
Get a storage backend (or undefined if not configured).
static get<K extends keyof StorageConfig>(key: K): StorageConfig[K] | undefined
Parameters:
key:K
Returns: StorageConfig[K] | undefined
static resolve()
Resolve a storage backend, lazily creating and caching a default if needed.
If a value has been configured via set() or configure(), returns that.
Otherwise, calls defaultFactory(), caches the result, and returns it.
static resolve<K extends keyof StorageConfig>(key: K, defaultFactory: () => StorageConfig[K]): StorageConfig[K]
Parameters:
key:KdefaultFactory:() => StorageConfig[K]
Returns: StorageConfig[K]
static remove()
Remove a single storage backend.
static remove(key: keyof StorageConfig): boolean
Parameters:
key:keyof StorageConfig
Returns: boolean
static has()
Check if a storage backend has been configured.
static has(key: keyof StorageConfig): boolean
Parameters:
key:keyof StorageConfig
Returns: boolean
static reset()
Clear all configured storage backends and context. Useful for testing.
static reset(): void
Returns: void
StrategyRegistry class
📍 src/core/context-nextgen/strategies/StrategyRegistry.ts:87
Strategy Registry - manages compaction strategy registration and creation.
Features:
- Static registry pattern (like Connector)
- Auto-registers built-in strategy classes on first access
- Supports custom strategy class registration
- Provides UI-safe getInfo() for serialization
- Metadata (displayName, description) comes from strategy class
Static Methods
static register()
Register a new strategy class.
Metadata (name, displayName, description, threshold) is read from the strategy class itself.
static register(strategyClass: StrategyClass, options?: StrategyRegisterOptions): void
Parameters:
strategyClass:StrategyClassoptions:StrategyRegisterOptions | undefined(optional)
Returns: void
static get()
Get a strategy entry by name.
static get(name: string): StrategyRegistryEntry
Parameters:
name:string
Returns: StrategyRegistryEntry
static has()
Check if a strategy exists.
static has(name: string): boolean
Parameters:
name:string
Returns: boolean
static list()
List all registered strategy names.
static list(): string[]
Returns: string[]
static create()
Create a strategy instance by name.
static create(name: string, config?: unknown): ICompactionStrategy
Parameters:
name:stringconfig:unknown(optional)
Returns: ICompactionStrategy
static getInfo()
Get strategy information for UI display (serializable, no class refs).
Returns array of StrategyInfo objects that can be safely serialized and sent over IPC.
static getInfo(): StrategyInfo[]
Returns: StrategyInfo[]
static remove()
Remove a strategy from the registry.
static remove(name: string): boolean
Parameters:
name:string
Returns: boolean
static getIfExists()
Get a strategy entry without throwing. Returns undefined if not found.
static getIfExists(name: string): StrategyRegistryEntry | undefined
Parameters:
name:string
Returns: StrategyRegistryEntry | undefined
StructuredSummaryStrategy class
📍 src/core/context-nextgen/strategies/StructuredSummaryStrategy.ts:7
Opt-in bounded summaries with exact user/action retention and one masking fallback.
Constructor
constructor
constructor(config: StructuredSummaryStrategyConfig = {})
Parameters:
config:StructuredSummaryStrategyConfig(optional) (default:{})
Methods
compact()
async compact(context: CompactionContext, _targetToFree: number): Promise<CompactionResult>
Parameters:
context:CompactionContext_targetToFree:number
Returns: Promise<CompactionResult>
consolidate()
async consolidate(_context: CompactionContext): Promise<ConsolidationResult>
Parameters:
_context:CompactionContext
Returns: Promise<ConsolidationResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "structured-summary" |
- |
displayName |
displayName: "Structured summary" |
- |
description |
description: "Summarize older assistant narrative and observations with a bounded compactor; retain exact user messages and action receipts." |
- |
requiredPlugins |
requiredPlugins: readonly ["evidence"] |
- |
threshold |
threshold: number |
- |
SuspendSignal class
📍 src/core/SuspendSignal.ts:64
Signal that a tool has initiated an external operation and the agent loop should suspend until an external event resumes it.
Static Methods
static create()
Create a new SuspendSignal.
static create(options: SuspendSignalOptions): SuspendSignal
Parameters:
options:SuspendSignalOptions
Returns: SuspendSignal
static is()
Type guard to check if a value is a SuspendSignal.
static is(value: unknown): value is SuspendSignal
Parameters:
value:unknown
Returns: boolean
Properties
| Property | Type | Description |
|---|---|---|
result |
result: unknown |
The tool result visible to the LLM |
correlationId |
correlationId: string |
Correlation identifier for routing external events back |
resumeAs |
`resumeAs: "user_message" | "tool_result"` |
ttl |
ttl: number |
Time-to-live in milliseconds |
metadata? |
`metadata: Record<string, unknown> | undefined` |
TavilyProvider class
📍 src/capabilities/search/providers/TavilyProvider.ts:15
Constructor
constructor
constructor(readonly connector: Connector)
Parameters:
connector:Connector
Methods
search()
async search(query: string, options: SearchOptions = {}): Promise<SearchResponse>
Parameters:
query:stringoptions:SearchOptions(optional) (default:{})
Returns: Promise<SearchResponse>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "tavily" |
- |
TemplateEngine class
📍 src/core/TemplateEngine.ts:150
Static, extensible template engine for agent instruction strings.
Follows the project's registry pattern (like Connector, StorageRegistry). Built-in handlers are lazily initialized on first use.
Static Methods
static register()
Register a template handler. Overrides any existing handler with the same name, including built-ins — so client apps can replace DATE, TIME, etc. with custom logic.
static register(name: string, handler: TemplateHandler, options?: TemplateHandlerOptions): void
Parameters:
name:stringhandler:TemplateHandleroptions:TemplateHandlerOptions | undefined(optional)
Returns: void
static unregister()
Unregister a template handler (including built-ins).
static unregister(name: string): void
Parameters:
name:string
Returns: void
static has()
Check if a handler is registered.
static has(name: string): boolean
Parameters:
name:string
Returns: boolean
static getRegisteredHandlers()
Get all registered handler names (uppercase).
static getRegisteredHandlers(): string[]
Returns: string[]
static process()
Process a template string asynchronously.
Resolves {{COMMAND}} and {{COMMAND:arg}} patterns.
static async process(text: string, context?: TemplateContext, options?: ProcessOptions): Promise<string>
Parameters:
text:stringcontext:TemplateContext | undefined(optional)options:ProcessOptions | undefined(optional)
Returns: Promise<string>
static processSync()
Process a template string synchronously. Throws if any matched handler returns a Promise.
static processSync(text: string, context?: TemplateContext, options?: ProcessOptions): string
Parameters:
text:stringcontext:TemplateContext | undefined(optional)options:ProcessOptions | undefined(optional)
Returns: string
static reset()
Reset all handlers (including built-ins). Primarily for testing.
static reset(): void
Returns: void
TextPipeline class
📍 src/capabilities/voice/pipelines/TextPipeline.ts:70
Constructor
constructor
constructor(config: TextPipelineInitConfig)
Parameters:
config:TextPipelineInitConfig
Methods
init()
async init(_sessionInfo: VoiceSessionInfo): Promise<void>
Parameters:
_sessionInfo:VoiceSessionInfo
Returns: Promise<void>
processAudio()
processAudio(frame: AudioFrame): void
Parameters:
frame:AudioFrame
Returns: void
onSpeechStart()
onSpeechStart(): void
Returns: void
onSpeechEnd()
async onSpeechEnd(): Promise<void>
Returns: Promise<void>
interrupt()
interrupt(): void
Returns: void
getState()
getState(): SessionState
Returns: SessionState
on()
on<K extends keyof VoicePipelineEvents>(event: K, handler: VoicePipelineEvents[K]): this
Parameters:
event:Khandler:VoicePipelineEvents[K]
Returns: this
off()
off<K extends keyof VoicePipelineEvents>(event: K, handler: VoicePipelineEvents[K]): this
Parameters:
event:Khandler:VoicePipelineEvents[K]
Returns: this
destroy()
async destroy(): Promise<void>
Returns: Promise<void>
TwilioAdapter class
📍 src/capabilities/voice/adapters/twilio/TwilioAdapter.ts:124
Static Methods
static create()
static create(config: TwilioAdapterConfig): TwilioAdapter
Parameters:
config:TwilioAdapterConfig
Returns: TwilioAdapter
static createStandalone()
static createStandalone(config: TwilioAdapterConfig & { publicUrl: string; port?: number }): TwilioAdapter
Parameters:
config:TwilioAdapterConfig & { publicUrl: string; port?: number | undefined; }
Returns: TwilioAdapter
Methods
start()
async start(): Promise<void>
Returns: Promise<void>
stop()
async stop(): Promise<void>
Returns: Promise<void>
webhookHandler()
webhookHandler(): (req: any, res: any) => void
Returns: (req: any, res: any) => void
handleMediaSocket()
handleMediaSocket(ws: any): void
Parameters:
ws:any
Returns: void
sendAudio()
sendAudio(callId: string, frame: AudioFrame): void
Parameters:
callId:stringframe:AudioFrame
Returns: void
clearAudio()
clearAudio(callId: string): void
Parameters:
callId:string
Returns: void
hangup()
async hangup(callId: string): Promise<void>
Parameters:
callId:string
Returns: Promise<void>
getActiveCalls()
getActiveCalls(): string[]
Returns: string[]
on()
on<K extends keyof TelephonyAdapterEvents>(event: K, handler: TelephonyAdapterEvents[K]): this
Parameters:
event:Khandler:TelephonyAdapterEvents[K]
Returns: this
off()
off<K extends keyof TelephonyAdapterEvents>(event: K, handler: TelephonyAdapterEvents[K]): this
Parameters:
event:Khandler:TelephonyAdapterEvents[K]
Returns: this
destroy()
async destroy(): Promise<void>
Returns: Promise<void>
makeCall()
Initiate an outbound call via Twilio REST API. When the callee answers, Twilio hits /voice-outbound which returns TwiML to connect a media stream (same pipeline as inbound).
async makeCall(config: OutboundCallConfig): Promise<string>
Parameters:
config:OutboundCallConfig
Returns: Promise<string>
outboundWebhookHandler()
Returns a webhook handler for outbound calls (external mode). When callee answers, Twilio POSTs to this endpoint.
outboundWebhookHandler(): (req: any, res: any) => void
Returns: (req: any, res: any) => void
UserInfoPluginNextGen class
📍 src/core/context-nextgen/plugins/UserInfoPluginNextGen.ts:323
Constructor
constructor
constructor(config?: UserInfoPluginConfig)
Parameters:
config:UserInfoPluginConfig | undefined(optional)
Methods
getInstructions()
getInstructions(): string
Returns: string
getContent()
async getContent(): Promise<string | null>
Returns: Promise<string | null>
getContents()
getContents(): Map<string, UserInfoEntry>
Returns: Map<string, UserInfoEntry>
getTokenSize()
getTokenSize(): number
Returns: number
getInstructionsTokenSize()
getInstructionsTokenSize(): number
Returns: number
isCompactable()
isCompactable(): boolean
Returns: boolean
compact()
async compact(_targetTokensToFree: number): Promise<number>
Parameters:
_targetTokensToFree:number
Returns: Promise<number>
getTools()
getTools(): ToolFunction[]
Returns: ToolFunction<any, any>[]
destroy()
destroy(): void
Returns: void
getState()
getState(): SerializedUserInfoState
Returns: SerializedUserInfoState
restoreState()
restoreState(state: unknown): void
Parameters:
state:unknown
Returns: void
getStoreSchema()
getStoreSchema(): StoreEntrySchema
Returns: StoreEntrySchema
storeGet()
async storeGet(key?: string, _context?: ToolContext): Promise<StoreGetResult>
Parameters:
key:string | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreGetResult>
storeSet()
async storeSet(key: string, data: Record<string, unknown>, context?: ToolContext): Promise<StoreSetResult>
Parameters:
key:stringdata:Record<string, unknown>context:ToolContext | undefined(optional)
Returns: Promise<StoreSetResult>
storeDelete()
async storeDelete(key: string, context?: ToolContext): Promise<StoreDeleteResult>
Parameters:
key:stringcontext:ToolContext | undefined(optional)
Returns: Promise<StoreDeleteResult>
storeList()
async storeList(_filter?: Record<string, unknown>, _context?: ToolContext): Promise<StoreListResult>
Parameters:
_filter:Record<string, unknown> | undefined(optional)_context:ToolContext | undefined(optional)
Returns: Promise<StoreListResult>
storeAction()
async storeAction(action: string, params?: Record<string, unknown>, context?: ToolContext): Promise<StoreActionResult>
Parameters:
action:stringparams:Record<string, unknown> | undefined(optional)context:ToolContext | undefined(optional)
Returns: Promise<StoreActionResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
name: "user_info" |
- |
userId |
`userId: string | undefined` |
UserPermissionRulesEngine class
📍 src/core/permissions/UserPermissionRulesEngine.ts:35
Constructor
constructor
constructor(storage?: IUserPermissionRulesStorage)
Parameters:
storage:IUserPermissionRulesStorage | undefined(optional)
Methods
evaluate()
Evaluate user rules against a tool call.
Returns the matching result, or null if no rule matches (fall through to chain).
evaluate(context: PolicyContext): UserRuleEvalResult | null
Parameters:
context:PolicyContext
Returns: UserRuleEvalResult | null
addRule()
Add a new rule. Auto-saves if storage is configured.
async addRule(rule: UserPermissionRule, userId?: string): Promise<void>
Parameters:
rule:UserPermissionRuleuserId:string | undefined(optional)
Returns: Promise<void>
updateRule()
Update an existing rule. Auto-saves if storage is configured.
async updateRule(ruleId: string, updates: Partial<UserPermissionRule>, userId?: string): Promise<boolean>
Parameters:
ruleId:stringupdates:Partial<UserPermissionRule>userId:string | undefined(optional)
Returns: Promise<boolean>
removeRule()
Remove a rule by ID. Auto-saves if storage is configured.
async removeRule(ruleId: string, userId?: string): Promise<boolean>
Parameters:
ruleId:stringuserId:string | undefined(optional)
Returns: Promise<boolean>
getRule()
Get a rule by ID.
getRule(ruleId: string): UserPermissionRule | null
Parameters:
ruleId:string
Returns: UserPermissionRule | null
getRules()
Get all rules.
getRules(): UserPermissionRule[]
Returns: UserPermissionRule[]
getRulesForTool()
Get all rules for a specific tool.
getRulesForTool(toolName: string): UserPermissionRule[]
Parameters:
toolName:string
Returns: UserPermissionRule[]
enableRule()
Enable a rule.
async enableRule(ruleId: string, userId?: string): Promise<boolean>
Parameters:
ruleId:stringuserId:string | undefined(optional)
Returns: Promise<boolean>
disableRule()
Disable a rule.
async disableRule(ruleId: string, userId?: string): Promise<boolean>
Parameters:
ruleId:stringuserId:string | undefined(optional)
Returns: Promise<boolean>
load()
Load rules from storage.
async load(userId?: string): Promise<void>
Parameters:
userId:string | undefined(optional)
Returns: Promise<void>
save()
Save current rules to storage.
async save(userId?: string): Promise<void>
Parameters:
userId:string | undefined(optional)
Returns: Promise<void>
setStorage()
Set the storage backend.
setStorage(storage: IUserPermissionRulesStorage): void
Parameters:
storage:IUserPermissionRulesStorage
Returns: void
destroy()
Destroy the engine, clearing all rules and releasing storage reference.
destroy(): void
Returns: void
VoiceBridge class
📍 src/capabilities/voice/VoiceBridge.ts:69
Static Methods
static create()
static create(config: VoiceBridgeConfig): VoiceBridge
Parameters:
config:VoiceBridgeConfig
Returns: VoiceBridge
Methods
attach()
attach(adapter: ITelephonyAdapter): void
Parameters:
adapter:ITelephonyAdapter
Returns: void
detach()
detach(): void
Returns: void
getActiveSessions()
getActiveSessions(): VoiceSessionInfo[]
Returns: VoiceSessionInfo[]
getSession()
getSession(sessionId: string): VoiceSessionInfo | null
Parameters:
sessionId:string
Returns: VoiceSessionInfo | null
hangup()
async hangup(sessionId: string): Promise<void>
Parameters:
sessionId:string
Returns: Promise<void>
makeCall()
Initiate an outbound call. The adapter places the call via the telephony provider. When the callee answers and the media stream connects, the normal session lifecycle (agent creation, pipeline, hooks) kicks in automatically.
async makeCall(to: string, from: string): Promise<string>
Parameters:
to:stringfrom:string
Returns: Promise<string>
destroy()
async destroy(): Promise<void>
Returns: Promise<void>
AccessControlled interface
📍 src/memory/AccessControl.ts:76
Minimal record shape for access control. Any persisted entity or fact satisfies this (both extend ScopeFields and optionally carry permissions).
Properties
| Property | Type | Description |
|---|---|---|
id? |
id?: string; |
- |
ownerId? |
ownerId?: string; |
- |
groupId? |
groupId?: string; |
- |
permissions? |
permissions?: Permissions; |
- |
readPrincipals? |
readPrincipals?: string[]; |
Materialized principal token sets (see access/principals.ts). When the |
caller supplies ScopeFilter.principals AND the record carries these, the |
||
| principal model decides access; otherwise the legacy owner/group/world | ||
| path runs. | ||
writePrincipals? |
writePrincipals?: string[]; |
- |
AccessInput interface
Normalized, storage-agnostic input to materializePrincipals. Both the
library (fromLibraryPermissions) and host code (fromNimbleAudit) project
their native shapes into this so a single materializer serves every caller.
Properties
| Property | Type | Description |
|---|---|---|
ownerId? |
ownerId?: string; |
- |
groupId? |
groupId?: string; |
- |
groupRead? |
groupRead?: boolean; |
- |
groupWrite? |
groupWrite?: boolean; |
- |
worldRead? |
worldRead?: boolean; |
- |
worldWrite? |
worldWrite?: boolean; |
- |
acl? |
acl?: ACLEntry[]; |
- |
ACLEntry interface
Explicit grant beyond owner/group/world. actions aligns with Permission.
Properties
| Property | Type | Description |
|---|---|---|
principal |
principal: Principal; |
- |
actions |
`actions: Array<'read' | 'write'>;` |
AgentCapabilityInspection interface
Metadata only: no credentials, instructions, tool arguments or stored content.
Properties
| Property | Type | Description |
|---|---|---|
runtime |
runtime: 'managed-agent'; |
- |
connector |
connector: string; |
- |
model |
model: string; |
- |
registry |
`registry: { known: boolean; vendorMatches: boolean | null; active: boolean |
provider |
provider: ModelCapabilities; |
- |
advanced? |
advanced?: AdvancedTextCapabilities; |
- |
context |
`context: { |
features: ResolvedContextFeatures;
plugins: string[];
strategy: string;
composition?: { config: Readonly<import('./context-nextgen/compaction/types.js').ContextCompactionStrategyConfig>;
last?: import('./context-nextgen/compaction/types.js').ContextCompactionReport; activeNative: boolean };
maxContextTokens: number;
responseReserve: number;
evidenceDurability?: EvidenceDurability;
};| - | |loop|loop: { enabled: boolean; hostCompletionCheck: boolean; maxIterations: number };| - | |helpers|helpers: Partial<Record<HelperRole, { connector: string; model: string; allowContextTransfer: boolean }>>;| - | |notices|notices: string[];` | This is configuration inspection, not authentication, semantic quality or host-completion validation. |
AgentConfig interface
📍 src/domain/entities/AgentState.ts:23
Agent configuration (needed for resume)
Properties
| Property | Type | Description |
|---|---|---|
connectorName |
connectorName: string; |
- |
model |
model: string; |
- |
temperature? |
temperature?: number; |
- |
maxIterations? |
maxIterations?: number; |
- |
toolNames |
toolNames: string[]; |
- |
AgentContextNextGenConfig interface
📍 src/core/context-nextgen/types.ts:882
AgentContextNextGen configuration
Properties
| Property | Type | Description |
|---|---|---|
assembly? |
assembly?: import('./assembly.js').ContextAssemblyConfig; |
Optional budgeted data contributions and explicit stable-prefix layout; host-owned, never restored from sessions. |
model |
model: string; |
Model name (used for context window lookup) |
maxContextTokens? |
maxContextTokens?: number; |
Maximum context tokens (auto-detected from model if not provided) |
responseReserve? |
responseReserve?: number; |
Tokens to reserve for response (default: 4096) |
criticalCompactionThreshold? |
criticalCompactionThreshold?: number; |
Utilization ratio (of available content budget) at which compaction is |
| allowed to run. Below this, NO compaction happens — every message, | ||
| including all tool results, stays verbatim in the input array for the | ||
| duration of the agentic loop. Compaction (and any strategy-driven spill of | ||
| tool results to working memory) only kicks in once utilization crosses | ||
| this "critical" line. Default: 0.9 (CONTEXT_DEFAULTS.HARD_LIMIT). |
This is intentionally decoupled from the compaction strategy's own
threshold (which now only governs how far DOWN to reclaim once critical
is hit), so tool-heavy agents keep their reads inline until the context is
genuinely close to full. The emergency oversized-input path
(handleOversizedInput) remains the true last-resort safety valve for a
single batch that alone exceeds the window. |
| systemPrompt? | systemPrompt?: string; | System prompt provided by user |
| strategy? | strategy?: string; | Compaction strategy name (default: 'default').
Used to create strategy from StrategyRegistry if compactionStrategy not provided. |
| compactionStrategy? | compactionStrategy?: ICompactionStrategy; | Custom compaction strategy instance.
If provided, overrides the strategy option. |
| features? | features?: ContextFeatures; | Feature flags |
| agentId? | agentId?: string; | Agent ID (required for PersistentInstructions) |
| userId? | userId?: string; | User ID for multi-user scenarios. Automatically flows to ToolContext for all tool executions. |
| timezone? | timezone?: string; | Viewer's IANA timezone (e.g. 'America/New_York'). Flows to ToolContext
(timeZone) and to the memory plugin, so tools and injected memory
content render instants as wall-clock time in this zone instead of UTC —
the model never converts. Display-only; stored instants are unchanged.
The library is otherwise timezone-agnostic: the host supplies this
explicitly; the library never reads entity metadata to discover it. When
omitted, times are rendered/returned as stored (UTC). |
| identities? | identities?: AuthIdentity[]; | Restrict this agent to specific auth identities (connector + optional account alias).
When set, only these identities are visible in ToolContext and tool descriptions.
Each identity produces its own tool set (e.g., microsoft_work_api, microsoft_personal_api).
When not set, all connectors visible to the current userId are available. |
| tools? | tools?: ToolFunction[]; | Initial tools to register |
| storage? | storage?: IContextStorageFromDomain; | Storage for session persistence |
| toolCategories? | toolCategories?: ToolCategoryScope; | Restrict tool catalog to specific categories |
| plugins? | plugins?: PluginConfigs; | Plugin-specific configurations (used with features flags) |
| toolExecutionTimeout? | toolExecutionTimeout?: number; | Hard timeout in milliseconds for any single tool execution.
Acts as a safety net: if a tool's own timeout mechanism fails
(e.g. a child process doesn't exit), this will force-resolve with an error.
Default: 0 (disabled - relies on each tool's own timeout) |
| journalFilter? | journalFilter?: import('../../domain/interfaces/IHistoryJournal.js').HistoryEntryType[]; | Filter which message types are written to the history journal.
When set, only entries matching these types are appended.
Default: undefined (all types journaled).
Example: ['user', 'assistant'] to exclude tool_result entries. |
AgenticLoopEvents interface
📍 src/capabilities/agents/types/EventTypes.ts:235
Map of all event names to their payload types
Properties
| Property | Type | Description |
|---|---|---|
'execution:start' |
'execution:start': ExecutionStartEvent; |
- |
'execution:complete' |
'execution:complete': ExecutionCompleteEvent; |
- |
'execution:error' |
'execution:error': ExecutionErrorEvent; |
- |
'execution:paused' |
'execution:paused': ExecutionPausedEvent; |
- |
'execution:resumed' |
'execution:resumed': ExecutionResumedEvent; |
- |
'execution:cancelled' |
'execution:cancelled': ExecutionCancelledEvent; |
- |
'execution:maxIterations' |
'execution:maxIterations': ExecutionMaxIterationsEvent; |
- |
'iteration:start' |
'iteration:start': IterationStartEvent; |
- |
'iteration:complete' |
'iteration:complete': IterationCompleteEvent; |
- |
'llm:request' |
'llm:request': LLMRequestEvent; |
- |
'llm:response' |
'llm:response': LLMResponseEvent; |
- |
'llm:error' |
'llm:error': LLMErrorEvent; |
- |
'tool:detected' |
'tool:detected': ToolDetectedEvent; |
- |
'tool:start' |
'tool:start': ToolStartEvent; |
- |
'tool:complete' |
'tool:complete': ToolCompleteEvent; |
- |
'tool:error' |
'tool:error': ToolErrorEvent; |
- |
'tool:timeout' |
'tool:timeout': ToolTimeoutEvent; |
- |
'hook:error' |
'hook:error': HookErrorEvent; |
- |
'execution:empty_output' |
'execution:empty_output': ExecutionEmptyOutputEvent; |
- |
'execution:retry' |
'execution:retry': ExecutionRetryEvent; |
- |
'circuit:opened' |
'circuit:opened': CircuitOpenedEvent; |
- |
'circuit:half-open' |
'circuit:half-open': CircuitHalfOpenEvent; |
- |
'circuit:closed' |
'circuit:closed': CircuitClosedEvent; |
- |
'async:tool:started' |
'async:tool:started': AsyncToolStartedEvent; |
- |
'async:tool:complete' |
'async:tool:complete': AsyncToolCompleteEvent; |
- |
'async:tool:error' |
'async:tool:error': AsyncToolErrorEvent; |
- |
'async:tool:timeout' |
'async:tool:timeout': AsyncToolTimeoutEvent; |
- |
'async:results:injected' |
'async:results:injected': AsyncResultsInjectedEvent; |
- |
'async:continuation:start' |
'async:continuation:start': AsyncContinuationStartEvent; |
- |
AgentLoopCheckContext interface
📍 src/core/agent-loop/types.ts:7
Properties
| Property | Type | Description |
|---|---|---|
executionId |
executionId: string; |
- |
iteration |
iteration: number; |
- |
outputText |
outputText: string; |
Bounded candidate text, not proof that any action completed. |
outputTruncated |
outputTruncated: boolean; |
- |
observations |
observations: readonly ReadonlyData<AgentLoopObservation>[]; |
Last 100 observed executions, as detached metadata. |
observedToolCalls |
observedToolCalls: number; |
- |
observationsTruncated |
observationsTruncated: boolean; |
- |
taskState? |
taskState?: ReadonlyData<TaskStateSnapshot>; |
- |
signal |
signal: AbortSignal; |
- |
AgentLoopCompletionResult interface
📍 src/core/agent-loop/types.ts:21
Properties
| Property | Type | Description |
|---|---|---|
complete |
complete: boolean; |
- |
reason? |
reason?: string; |
Human-readable host verdict; maximum 400 characters. |
feedback? |
feedback?: string; |
Explicit host feedback for another bounded model turn; maximum 2000 characters. |
AgentLoopDiagnostics interface
📍 src/domain/entities/AgentLoop.ts:10
Detached execution diagnostics, independent of provider generation status.
Properties
| Property | Type | Description |
|---|---|---|
version |
version: 1; |
- |
executionId |
executionId: string; |
- |
phase |
`phase: 'running' | 'recovering' |
status? |
status?: TaskStatus; |
Existing task vocabulary. Ordinary unchecked answers have no completion status. |
reason? |
reason?: AgentLoopReason; |
- |
detail? |
detail?: string; |
- |
iterations |
iterations: number; |
- |
recoveryAttempts |
recoveryAttempts: number; |
- |
observedToolCalls |
observedToolCalls: number; |
- |
consecutiveToolFailures |
consecutiveToolFailures: number; |
- |
repeatedResults |
repeatedResults: number; |
- |
stalledIterations |
stalledIterations: number; |
- |
completion? |
completion?: { complete: boolean; reason?: string }; |
- |
uncertainEffects |
uncertainEffects: Array<{ toolName: string; callId?: string; executionId?: string }>; |
- |
AgentLoopObservation interface
📍 src/domain/entities/AgentLoop.ts:29
Metadata only; raw arguments/results stay in existing tool/evidence surfaces.
Properties
| Property | Type | Description |
|---|---|---|
toolName |
toolName: string; |
- |
callId? |
callId?: string; |
- |
effect |
`effect: 'read' | 'write' |
outcome? |
outcome?: Omit<ToolExecutionOutcome, 'error'>; |
- |
AgentLoopPolicy interface
📍 src/core/agent-loop/types.ts:30
Opt-in managed text-loop policy. Host callbacks are never restored from sessions.
Properties
| Property | Type | Description |
|---|---|---|
maxRecoveryAttempts? |
maxRecoveryAttempts?: number; |
Shared allowance for failure/progress/completion recovery; default 2. |
maxRepeatedResults? |
maxRepeatedResults?: number; |
Identical normalized read call/results before intervention; default 3. |
maxConsecutiveToolFailures? |
maxConsecutiveToolFailures?: number; |
Consecutive failed tool observations before stopping; default 3. |
maxStalledIterations? |
maxStalledIterations?: number; |
Unchanged host progress keys before intervention; default 3. Requires progressKey. |
repeatableReadTools? |
repeatableReadTools?: readonly string[]; |
Explicitly permit repeated results for these host-declared read tools. |
progressKey? |
`progressKey?: (context: Readonly<AgentLoopCheckContext>) => string | Promise<string>;` |
completion? |
`completion?: (context: Readonly<AgentLoopCheckContext>) => AgentLoopCompletionResult | Promise<AgentLoopCompletionResult>;` |
callbackTimeoutMs? |
callbackTimeoutMs?: number; |
Deadline for each host callback; default 10000 ms, at most 60000 ms. |
AgentPackageConnectorResolution interface
Trusted connector and model selected by the receiving application host.
Properties
| Property | Type | Description |
|---|---|---|
connector |
`connector: string | Connector;` |
model |
model: string; |
- |
AgentPackageContextFactoryInput interface
Properties
| Property | Type | Description |
|---|---|---|
package |
package: SerializedAgentPackage; |
- |
connector |
`connector: string | Connector;` |
model |
model: string; |
- |
userId? |
userId?: string; |
- |
identities? |
identities?: AuthIdentity[]; |
- |
AgentPackageOutcomeServerOptions interface
📍 src/portable/outcomeTypes.ts:74
Methods
authorize()
Rechecked before every operation/cache result. Context comes from the trusted transport host.
authorize(access: Readonly<RemoteOutcomeAccess>, context: TContext): boolean | Promise<boolean>;
Parameters:
access:Readonly<RemoteOutcomeAccess>context:TContext
Returns: boolean | Promise<boolean>
Properties
| Property | Type | Description |
|---|---|---|
storage |
storage: IEvidenceStorage; |
- |
maxRequests? |
maxRequests?: number; |
- |
maxInlineBytes? |
maxInlineBytes?: number; |
- |
maxReadChars? |
maxReadChars?: number; |
- |
AgentPermissionsConfig interface
📍 src/core/permissions/types.ts:234
Permission configuration for any agent type.
Used in:
- Agent.create({ permissions: {...} })
- TaskAgent.create({ permissions: {...} })
- UniversalAgent.create({ permissions: {...} })
Properties
| Property | Type | Description |
|---|---|---|
autoApproveAll? |
autoApproveAll?: boolean; |
When true, ALL tools are auto-approved without any permission checks. |
| Use for autonomous/scheduled execution where no interactive approval UI exists. | ||
| Blocklist is still respected for safety. | ||
defaultScope? |
defaultScope?: PermissionScope; |
Default permission scope for tools without explicit config. |
defaultRiskLevel? |
defaultRiskLevel?: RiskLevel; |
Default risk level for tools without explicit config. |
allowlist? |
allowlist?: string[]; |
Tools that are always allowed (never prompt). |
| Array of tool names. | ||
blocklist? |
blocklist?: string[]; |
Tools that are always blocked (cannot execute). |
| Array of tool names. | ||
tools? |
tools?: Record<string, ToolPermissionConfig>; |
Per-tool permission overrides. |
| Keys are tool names, values are permission configs. | ||
onApprovalRequired? |
onApprovalRequired?: (context: ApprovalRequestContext) => Promise<ApprovalDecision>; |
Callback invoked when a tool needs approval. |
| Receives full ApprovalRequestContext with tool info, risk level, args. | ||
| Return an ApprovalDecision to approve/deny. | ||
inheritFromSession? |
inheritFromSession?: boolean; |
Whether to inherit permission state from parent session. |
| Only applies when resuming from a session. |
AgentPolicyConfig interface
📍 src/core/permissions/types.ts:569
Extended agent permissions config with policy support.
Properties
| Property | Type | Description |
|---|---|---|
policies? |
policies?: IPermissionPolicy[]; |
Custom policies (evaluated after legacy-derived policies). |
| Policies from tool self-declarations and registration overrides | ||
| are handled automatically via SessionApprovalPolicy reading | ||
| PolicyContext.toolPermissionConfig. | ||
policyChain? |
policyChain?: PolicyChainConfig; |
Policy chain configuration |
userRulesStorage? |
userRulesStorage?: import('../../domain/interfaces/IUserPermissionRulesStorage.js').IUserPermissionRulesStorage; |
Per-user permission rules storage |
AgentState interface
📍 src/domain/entities/AgentState.ts:53
Full agent state - everything needed to resume
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
status |
status: AgentStatus; |
- |
config |
config: AgentConfig; |
Configuration |
plan |
plan: Plan; |
Current plan |
memoryId |
memoryId: string; |
Working memory reference |
conversationHistory |
conversationHistory: ConversationMessage[]; |
Conversation history (for context continuity) |
createdAt |
createdAt: number; |
Timestamps |
startedAt? |
startedAt?: number; |
- |
suspendedAt? |
suspendedAt?: number; |
- |
completedAt? |
completedAt?: number; |
- |
lastActivityAt |
lastActivityAt: number; |
- |
metrics |
metrics: AgentMetrics; |
Metrics |
AgentTypeConfig interface
📍 src/core/orchestrator/createOrchestrator.ts:44
Configuration for an agent type that the orchestrator can spawn.
Properties
| Property | Type | Description |
|---|---|---|
systemPrompt |
systemPrompt: string; |
System prompt defining this agent's role and behavior |
tools? |
tools?: ToolFunction[]; |
Additional tools specific to this agent type |
model? |
model?: string; |
Model override (defaults to orchestrator's model) |
connector? |
connector?: string; |
Connector override (defaults to orchestrator's connector) |
features? |
features?: Partial<ContextFeatures>; |
Context features for this agent type |
plugins? |
plugins?: PluginConfigs; |
Plugin configurations for this agent type |
description? |
description?: string; |
One-liner describing the agent's role (e.g., "Senior developer who writes and tests code") |
scenarios? |
scenarios?: string[]; |
Typical scenarios when this agent should be used (e.g., ["implementing features", "fixing bugs"]) |
capabilities? |
capabilities?: string[]; |
What this agent can do / what tools it has (e.g., ["read/write files", "run shell commands"]) |
AIResolutionProvenance interface
📍 src/memory/integration/ExtractionResolver.ts:184
AI-resolution provenance stamped on a task's metadata when a reconciliation
task_update op moves the task into a terminal state. Lets the host surface
"marked done by AI — " and audit auto-resolutions. aiResolved === true
with the task's terminal state === 'done' is the "was marked done by AI" flag.
Properties
| Property | Type | Description |
|---|---|---|
aiResolved |
aiResolved: true; |
True when AI reconciliation moved this task into a terminal state. |
aiResolutionReason |
aiResolutionReason: string; |
Brief reasoning for the auto-resolution (from the op's reason). |
aiResolutionEvidenceQuote? |
aiResolutionEvidenceQuote?: string; |
Verbatim evidence quote from the signal, when the op supplied one. |
aiResolvedAt |
aiResolvedAt: Date; |
When the AI resolution happened. |
Anchor interface
📍 src/memory/integration/AnchorRegistry.ts:21
AnchorRegistry — pluggable interface for binding extracted items to stated anchors (e.g. a user's priorities, a project's OKRs, a team's focus areas).
The library ships the interface only. Hosts provide the implementation —
for ICOS the impl walks the memory graph from the user entity outward via
tracks_priority facts and returns the active priority entities.
Used by defaultExtractionPrompt (when EagernessProfile.requirePriorityBinding
is on, the prompt renders the active anchors and asks the LLM to bind each
extracted task to one) and by RestrainedExtractionContract (for strict-mode
binding validation).
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Stable id the LLM echoes back as servesAnchorId. Opaque string. |
label |
label: string; |
Short human-readable label. Surfaces in the prompt. |
kind? |
kind?: string; |
Optional category — e.g. priority, okr, focus_area. |
metadata? |
metadata?: Record<string, unknown>; |
Optional details for prompt rendering — e.g. { horizon: 'quarter' }. |
AnchorRegistry interface
📍 src/memory/integration/AnchorRegistry.ts:41
Pluggable lookup. Implementations decide where anchors come from (memory graph traversal, settings collection, external service) and how "active" is defined (current quarter, current week, etc.).
getAnchorsForUser is invoked at most once per extraction call; small
latencies are fine, but implementations should NOT hit a cold cache from
inside a tight loop — cache at the application layer if needed.
Methods
getAnchorsForUser()
Return active anchors for the supplied user or host-defined scope. Empty
array means "no active
anchors" — under strict priority binding, callers should treat this as
a hard signal that nothing should be emitted.
getAnchorsForUser(userId: string): Promise<Anchor[]>;
Parameters:
userId:string
Returns: Promise<Anchor[]>
validateBinding()
Validate a host-emitted binding. Returns true if anchorId is one of
the currently active anchors for the supplied user or host-defined scope.
Implementations may apply
additional rules (recency, scope, etc.).
validateBinding(userId: string, anchorId: string): Promise<boolean>;
Parameters:
userId:stringanchorId:string
Returns: Promise<boolean>
APIKeyConnectorAuth interface
📍 src/domain/entities/Connector.ts:95
Static API key authentication For services like OpenAI, Anthropic, many SaaS APIs
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'api_key'; |
- |
apiKey |
apiKey: string; |
- |
headerName? |
headerName?: string; |
- |
headerPrefix? |
headerPrefix?: string; |
- |
queryParamName? |
queryParamName?: string; |
Send the API key as a URL query parameter instead of an HTTP header. |
When set, connector.fetch() injects ?<queryParamName>=<apiKey> into |
||
the request URL and does NOT add an auth header. headerName and |
||
headerPrefix are ignored in that case. Used by vendors like ipapi.co |
||
that authenticate via ?key=.... |
||
extra? |
extra?: Record<string, string>; |
Vendor-specific extra credentials beyond the primary API key. |
| E.g., Slack Socket Mode needs { appToken: 'xapp-...', signingSecret: '...' } |
APIKeyProviderConnectorAuth interface
📍 src/domain/entities/Connector.ts:121
Host-local rotating API key authentication. This runtime-only form is not serializable and ConnectorConfigStore deliberately refuses to persist it.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'api_key_provider'; |
- |
getApiKey |
getApiKey: () => Promise<string>; |
- |
ApplyPatchCallOutputItem interface
📍 src/domain/entities/Message.ts:110
Result returned after applying an OpenAI apply-patch operation.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'apply_patch_call_output'; |
- |
call_id |
call_id: string; |
- |
status |
`status: 'completed' | 'failed';` |
output? |
`output?: string | null;` |
ApprovalCacheEntry interface
📍 src/core/permissions/types.ts:114
Entry in the approval cache representing an approved tool
Properties
| Property | Type | Description |
|---|---|---|
toolName |
toolName: string; |
Name of the approved tool |
scope |
scope: PermissionScope; |
The scope that was approved |
approvedAt |
approvedAt: Date; |
When the approval was granted |
approvedBy? |
approvedBy?: string; |
Optional identifier of who approved (for audit) |
expiresAt? |
expiresAt?: Date; |
When this approval expires (for session/TTL approvals) |
argsHash? |
argsHash?: string; |
Arguments hash if approval was for specific arguments |
ApprovalDecision interface
📍 src/core/permissions/types.ts:190
Result from approval UI/hook
Properties
| Property | Type | Description |
|---|---|---|
approved |
approved: boolean; |
Whether the tool was approved |
scope? |
scope?: PermissionScope; |
Scope of the approval (may differ from requested) |
reason? |
reason?: string; |
Reason for denial (if not approved) |
approvedBy? |
approvedBy?: string; |
Optional identifier of who approved |
remember? |
remember?: boolean; |
Whether to remember this decision for future calls |
createRule? |
`createRule?: { |
/** Rule description (shown in settings UI) */
description?: string;
/** Argument conditions for the rule */
conditions?: ArgumentCondition[];
/** ISO expiry timestamp (null = never) */
expiresAt?: string | null;
/** If true, rule cannot be overridden by more specific rules */
unconditional?: boolean;
};` | If set, creates a persistent user permission rule from this decision. The approval UI can pre-populate this based on the tool call context. |
ApprovalRequestContext interface
📍 src/core/permissions/types.ts:546
Context passed to the onApprovalRequired callback. Extends PolicyContext with the deny decision and UI-relevant info.
Properties
| Property | Type | Description |
|---|---|---|
decision |
decision: PolicyDecision; |
The deny decision that triggered this approval request |
riskLevel |
riskLevel: RiskLevel; |
Tool's risk level (from tool permission config or default) |
approvalMessage? |
approvalMessage?: string; |
Custom approval message (from tool permission config) |
sensitiveArgs? |
sensitiveArgs?: string[]; |
Argument names to highlight as sensitive in approval UI |
approvalKey? |
approvalKey?: string; |
Policy-provided approval scope key |
approvalScope? |
`approvalScope?: 'once' | 'session' |
ApprovalResult interface
📍 src/capabilities/agents/types/HookTypes.ts:114
Properties
| Property | Type | Description |
|---|---|---|
approved |
approved: boolean; |
- |
reason? |
reason?: string; |
- |
modifiedArgs? |
modifiedArgs?: any; |
- |
AudioFrame interface
📍 src/capabilities/voice/types.ts:38
A single frame of audio data exchanged between adapter and pipeline. All voice processing operates on these frames.
Properties
| Property | Type | Description |
|---|---|---|
audio |
audio: Buffer; |
Raw audio bytes |
sampleRate |
sampleRate: number; |
Sample rate in Hz (e.g., 8000 for Twilio, 16000/24000 for STT/TTS) |
encoding |
encoding: AudioEncoding; |
Encoding format |
channels |
channels: 1; |
Always mono |
timestamp |
timestamp: number; |
Milliseconds from call start |
AuditEntry interface
📍 src/capabilities/agents/ExecutionContext.ts:67
Properties
| Property | Type | Description |
|---|---|---|
timestamp |
timestamp: Date; |
- |
type |
`type: |
| 'hook_executed'
| 'tool_modified'
| 'tool_skipped'
| 'execution_paused'
| 'execution_resumed'
| 'tool_approved'
| 'tool_rejected'
| 'tool_blocked'
| 'tool_permission_approved';` | - |
| hookName? | hookName?: string; | - |
| toolName? | toolName?: string; | - |
| details | details: any; | - |
AuthIdentity interface
📍 src/core/context-nextgen/types.ts:25
A single auth identity: connector + optional account alias.
Used to scope agents to specific OAuth accounts. When accountId is set,
the identity represents a specific multi-account OAuth session (e.g., 'work'
or 'personal' Microsoft account). When omitted, uses the connector's default account.
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Name of the registered connector |
accountId? |
accountId?: string; |
Optional account alias for multi-account OAuth (e.g., 'work', 'personal') |
toolFilter? |
toolFilter?: string[]; |
Optional: restrict which tools are generated for this identity. |
| Each entry is matched against the tool's base name (the part after the | ||
| connector prefix, e.g., 'send_email' from 'microsoft_work_send_email'). |
When set, only tools whose name ends with _<suffix> or equals <suffix> are generated.
When absent, ALL tools for this connector are generated. |
| actAs? | actAs?: string; | Lock the on-behalf-of user identity for this identity's tool instances
(Microsoft Graph /users/{id}, Google API userId). Set ONCE here and
the LLM cannot override it at call time.
- When set: the per-tool
targetUserschema parameter is OMITTED and this value is always used. - When unset: existing behavior (LLM supplies
targetUserfor app-only auth). - Silently ignored for delegated connectors (identity already bound by token). |
BaseProviderConfig interface
📍 src/capabilities/shared/types.ts:16
Base configuration for all capability providers
Properties
| Property | Type | Description |
|---|---|---|
connector |
`connector: string | Connector;` |
BaseProviderConfig interface
📍 src/domain/types/ProviderConfig.ts:19
Properties
| Property | Type | Description |
|---|---|---|
apiKey |
apiKey: string; |
- |
baseURL? |
baseURL?: string; |
- |
organization? |
organization?: string; |
- |
timeout? |
timeout?: number; |
- |
maxRetries? |
maxRetries?: number; |
- |
BaseProviderResponse interface
📍 src/capabilities/shared/types.ts:24
Base response for all capability providers
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
Whether the operation succeeded |
provider |
provider: string; |
Provider name |
error? |
error?: string; |
Error message if failed |
BashResult interface
📍 src/tools/shell/types.ts:101
Result of a bash command execution
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
stdout? |
stdout?: string; |
- |
stderr? |
stderr?: string; |
- |
exitCode? |
exitCode?: number; |
- |
signal? |
signal?: string; |
- |
duration? |
duration?: number; |
- |
truncated? |
truncated?: boolean; |
- |
error? |
error?: string; |
- |
backgroundId? |
backgroundId?: string; |
- |
CalendarAttendee interface
📍 src/memory/integration/signals/adapters/CalendarSignalAdapter.ts:25
Properties
| Property | Type | Description |
|---|---|---|
email |
email: string; |
- |
name? |
name?: string; |
- |
rsvpStatus? |
`rsvpStatus?: 'accepted' | 'declined' |
CalendarSignal interface
📍 src/memory/integration/signals/adapters/CalendarSignalAdapter.ts:31
Properties
| Property | Type | Description |
|---|---|---|
id? |
id?: string; |
External calendar event id. Preferred source of canonical identifier stability. |
source? |
source?: string; |
Calendar source, e.g. 'gcal', 'outlook', 'ical'. Default 'calendar'. |
title |
title: string; |
- |
description? |
description?: string; |
- |
location? |
location?: string; |
- |
startTime |
startTime: Date; |
- |
endTime? |
endTime?: Date; |
- |
organizer? |
organizer?: CalendarAttendee; |
- |
attendees? |
attendees?: CalendarAttendee[]; |
Attendee list. Organizer MAY also appear here — deduped by email. |
kind? |
`kind?: 'meeting' | 'focus' |
CalendarSignalAdapterOptions interface
📍 src/memory/integration/signals/adapters/CalendarSignalAdapter.ts:48
Properties
| Property | Type | Description |
|---|---|---|
skipDeclinedAttendance? |
skipDeclinedAttendance?: boolean; |
When true, attendees with rsvpStatus: 'declined' are omitted entirely — |
no person seed, no attended seed fact, and they are not listed in |
||
signalText. Default true: we don't want the declined attendee's name |
||
| showing up in the prompt, because the LLM can (and does) infer | ||
| attendance from the presence alone, defeating the skip intent. |
Set false to preserve prior behavior (declined attendees seeded + listed
in signalText; only the deterministic attended seed fact is skipped). |
CallSummary interface
📍 src/capabilities/voice/types.ts:136
Properties
| Property | Type | Description |
|---|---|---|
duration |
duration: number; |
Call duration in seconds |
turns |
turns: number; |
Number of conversation turns |
endReason |
endReason: CallEndReason; |
Why the call ended |
totalSttMs |
totalSttMs: number; |
Total STT processing time in ms |
totalTtsMs |
totalTtsMs: number; |
Total TTS processing time in ms |
totalAgentMs |
totalAgentMs: number; |
Total agent processing time in ms |
CanonicalIdentifierOptions interface
📍 src/memory/identifiers.ts:121
Properties
| Property | Type | Description |
|---|---|---|
slugMaxLength? |
slugMaxLength?: number; |
Max length of the final slug portion (default 40). |
CapabilityProvenance interface
📍 src/capabilities/metadata/realtime.ts:7
Properties
| Property | Type | Description |
|---|---|---|
kind |
`readonly kind: 'documentation' | 'registry';` |
url? |
readonly url?: string; |
- |
verifiedAt? |
readonly verifiedAt?: string |
- |
ChildObservation interface
📍 src/core/orchestrator/factoryTypes.ts:21
Properties
| Property | Type | Description |
|---|---|---|
parentExecutionId |
readonly parentExecutionId: string; |
- |
childExecutionId |
readonly childExecutionId: string; |
- |
childName |
readonly childName: string; |
- |
state |
`readonly state: 'settled' | 'timed_out' |
reason? |
readonly reason?: string; |
- |
response? |
readonly response?: Readonly<AgentResponse>; |
- |
accounting |
`readonly accounting: 'shared' | 'independent';` |
modelTaskId? |
readonly modelTaskId?: string; |
- |
invocationIds |
readonly invocationIds: readonly string[]; |
- |
references |
readonly references: readonly EvidenceReference[]; |
- |
toolOutcomes? |
readonly toolOutcomes?: readonly ToolExecutionOutcome[]; |
Actual tool diagnostics, including late outcomes; business completion remains host-owned. |
late |
readonly late: boolean; |
- |
ChunkingOptions interface
📍 src/capabilities/speech/types.ts:39
Options for the default SentenceChunkingStrategy
Properties
| Property | Type | Description |
|---|---|---|
minChunkLength? |
minChunkLength?: number; |
Minimum characters before emitting a chunk. Default: 20 |
maxChunkLength? |
maxChunkLength?: number; |
Maximum characters per chunk. Forces split at clause boundary. Default: 500 |
skipCodeBlocks? |
skipCodeBlocks?: boolean; |
Skip text inside fenced code blocks. Default: true |
stripMarkdown? |
stripMarkdown?: boolean; |
Strip markdown formatting (bold, italic, links, headings). Default: true |
additionalAbbreviations? |
additionalAbbreviations?: string[]; |
Additional abbreviations to recognize (e.g., ['Corp.', 'Ltd.']) |
CompactionContext interface
📍 src/core/context-nextgen/types.ts:1178
Read-only context passed to compaction strategies. Provides access to data needed for compaction decisions and controlled methods to modify state.
Methods
compactConversation()?
Optional transactional capability supplied by NextGen preparation. Legacy contexts remain valid.
compactConversation?(options: import('./strategies/conversation-compaction.js').ConversationCompactionOptions): Promise<CompactionResult>;
Parameters:
options:ConversationCompactionOptions
Returns: Promise<CompactionResult>
describeToolCall()?
Describe a tool call using the tool's describeCall function. Returns a human-readable summary of the tool call args (e.g., "src/core/Agent.ts [lines 100-200]"). Returns undefined if the tool is not found or has no describeCall.
describeToolCall?(toolName: string, toolArgs: unknown): string | undefined;
Parameters:
toolName:stringtoolArgs:unknown
Returns: string | undefined
removeMessages()
Remove messages by indices. Handles tool pair preservation internally.
removeMessages(indices: number[]): Promise<number>;
Parameters:
indices:number[]
Returns: Promise<number>
compactPlugin()
Compact a specific plugin.
compactPlugin(pluginName: string, targetTokens: number): Promise<number>;
Parameters:
pluginName:stringtargetTokens:number
Returns: Promise<number>
estimateTokens()
Estimate tokens for an item.
estimateTokens(item: InputItem): number;
Parameters:
item:InputItem
Returns: number
Properties
| Property | Type | Description |
|---|---|---|
budget |
readonly budget: ContextBudget; |
Current budget (from prepare) |
conversation |
readonly conversation: ReadonlyArray<InputItem>; |
Current conversation history (read-only) |
currentInput |
readonly currentInput: ReadonlyArray<InputItem>; |
Current input (read-only) |
plugins |
readonly plugins: ReadonlyArray<IContextPluginNextGen>; |
Registered plugins (for querying state) |
strategyName |
readonly strategyName: string; |
Strategy name for logging |
CompactionItem interface
📍 src/domain/entities/Message.ts:24
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'compaction'; |
- |
id |
id: string; |
- |
encrypted_content |
encrypted_content: string; |
- |
content? |
`content?: string | null;` |
signature? |
`signature?: string | null;` |
providerMetadata? |
providerMetadata?: Record<string, unknown>; |
Opaque provider fields that must be replayed verbatim. |
CompactionResult interface
📍 src/core/context-nextgen/types.ts:1072
Result of compact() operation.
Properties
| Property | Type | Description |
|---|---|---|
report? |
report?: import('./strategies/conversation-compaction.js').ConversationCompactionReport; |
Additive opt-in strategy diagnostic; legacy result shapes remain valid. |
tokensFreed |
tokensFreed: number; |
Tokens actually freed by compaction |
messagesRemoved |
messagesRemoved: number; |
Number of messages removed from conversation |
pluginsCompacted |
pluginsCompacted: string[]; |
Names of plugins that were compacted |
log |
log: string[]; |
Log of actions taken during compaction |
CompactionTriggerItem interface
📍 src/domain/entities/Message.ts:54
Explicit in-band compaction request. Must be the final input item.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'compaction_trigger'; |
- |
ComposeContext interface
📍 src/memory/composers/types.ts:78
Read-only resolver passed to every compose call. Wraps the underlying store
with a per-call cache so repeated lookups (e.g. a task that references the
same project in both metadata.projectId and contextIds) collapse into
one round-trip.
Missing / scope-invisible ids resolve to null — composers should treat
this as "reference is dangling; omit from the composed text".
Methods
resolveEntity()
Resolve a single entity to its full IEntity. null for missing / invisible.
resolveEntity(id: EntityId): Promise<IEntity | null>;
Parameters:
id:string
Returns: Promise<IEntity | null>
resolveEntities()
Batched fetch. Returned array aligns with ids positionally; missing /
invisible entries become null. Prefer this over a loop of resolveEntity
when a composer has many ids to resolve up-front.
resolveEntities(ids: EntityId[]): Promise<Array<IEntity | null>>;
Parameters:
ids:string[]
Returns: Promise<(IEntity | null)[]>
resolveDisplayName()
Convenience: resolve to displayName. null for missing / invisible.
resolveDisplayName(id: EntityId): Promise<string | null>;
Parameters:
id:string
Returns: Promise<string | null>
resolveDisplayNames()
Convenience: batched displayName resolution.
resolveDisplayNames(ids: EntityId[]): Promise<Array<string | null>>;
Parameters:
ids:string[]
Returns: Promise<(string | null)[]>
ComputerCallOutputItem interface
📍 src/domain/entities/Message.ts:75
Screenshot result returned after executing an OpenAI computer-use call.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'computer_call_output'; |
- |
call_id |
call_id: string; |
- |
output |
`output: ({ |
type: 'computer_screenshot';
} & (
| { image_url: string; file_id?: string }
| { file_id: string; image_url?: string }
));| - | |acknowledged_safety_checks?|acknowledged_safety_checks?: Array<{
id: string;
code?: string | null;
message?: string | null;
}>;| - | |status?|status?: 'in_progress' | 'completed' | 'incomplete';` | - |
ConfigurationUpdateItem interface
📍 src/domain/entities/Message.ts:45
GPT-6 Astra conversation-scoped reasoning-effort update.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'configuration_update'; |
- |
id? |
id?: string; |
- |
reasoning |
`reasoning: { |
effort: ReasoningEffort;
};` | - |
ConnectorAcceptedResource interface
📍 src/tools/connector/enhancedInvocation.ts:4
Properties
| Property | Type | Description |
|---|---|---|
kind |
readonly kind: 'reply_draft'; |
- |
id |
readonly id: string; |
- |
state |
readonly state: 'accepted' |
- |
ConnectorConfig interface
📍 src/domain/entities/Connector.ts:149
Complete connector configuration Used for BOTH AI providers AND external APIs
Properties
| Property | Type | Description |
|---|---|---|
id? |
id?: string; |
- |
name? |
name?: string; |
- |
vendor? |
vendor?: Vendor; |
- |
serviceType? |
serviceType?: string; |
- |
auth |
auth: ConnectorAuth; |
- |
displayName? |
displayName?: string; |
- |
description? |
description?: string; |
- |
baseURL? |
baseURL?: string; |
- |
defaultModel? |
defaultModel?: string; |
- |
apiVersion? |
apiVersion?: string; |
- |
rateLimit? |
`rateLimit?: { |
requestsPerMinute?: number;
requestsPerDay?: number;
};| - | |documentation?|documentation?: string;| - | |tags?|tags?: string[];| - | |options?|options?: {
organization?: string; // OpenAI
project?: string; // OpenAI
anthropicVersion?: string;
location?: string; // Google Vertex
projectId?: string; // Google Vertex
/** Built-in DeepSeek host preset; defaults to the first-party API. /
deepseekHost?: 'official' | 'openrouter' | 'together' | 'fireworks' | 'deepinfra' | 'nvidia-nim' | 'azure-foundry' | 'custom';
/* DeepSeek API transport; auto routes first-party Flash to Responses and Pro to Chat. /
deepseekTransport?: 'auto' | 'responses' | 'chat_completions';
[key: string]: unknown;
};| - | |timeout?|timeout?: number;| Request timeout in milliseconds | |retry?|retry?: {
/* Maximum number of retry attempts @default 3 /
maxRetries?: number;
/* HTTP status codes that trigger retry @default [429, 500, 502, 503, 504] /
retryableStatuses?: number[];
/* Base delay in ms for exponential backoff @default 1000 /
baseDelayMs?: number;
/* Maximum delay in ms @default 30000 /
maxDelayMs?: number;
};| Retry configuration for transient failures | |circuitBreaker?|circuitBreaker?: {
/* Enable circuit breaker @default true /
enabled?: boolean;
/* Number of failures before opening circuit @default 5 /
failureThreshold?: number;
/* Number of successes to close circuit @default 2 /
successThreshold?: number;
/* Time in ms before attempting to close circuit @default 30000 /
resetTimeoutMs?: number;
};| Circuit breaker configuration for failing services | |logging?|logging?: {
/* Enable request/response logging @default false /
enabled?: boolean;
/* Log request/response bodies (security risk) @default false /
logBody?: boolean;
/* Log request/response headers (security risk) @default false */
logHeaders?: boolean;
};` | Logging configuration for requests/responses |
ConnectorConfigResult interface
📍 src/domain/entities/Connector.ts:253
Result from ProviderConfigAgent Includes setup instructions and environment variables
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
- |
config |
config: ConnectorConfig; |
- |
setupInstructions |
setupInstructions: string; |
- |
envVariables |
envVariables: string[]; |
- |
setupUrl? |
setupUrl?: string; |
- |
ConnectorEmbedderConfig interface
📍 src/memory/integration/ConnectorEmbedder.ts:33
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Connector name — must already be registered via Connector.create(). |
model |
model: string; |
Embedding model id, e.g. 'text-embedding-3-small' or 'text-embedding-3-large'. |
dimensions |
dimensions: number; |
Output dimensions. Must match the model's output (or MRL-reduced target). |
requestedDimensions? |
requestedDimensions?: number; |
Optional dimension override passed to the provider (for MRL models). |
maxInputTokens? |
maxInputTokens?: number; |
Optional model input-token override for custom/unknown embedding models. |
oversizeInputReducer? |
oversizeInputReducer?: OversizeEmbeddingReducer; |
Optional host-provided reducer for inputs that exceed the embedding model's |
| declared token limit. Hosts can summarize or otherwise compress text using | ||
| their own connector/model choices; ConnectorEmbedder validates the reduced | ||
| text before sending it to the embedding provider. |
ConnectorExtractorConfig interface
📍 src/memory/integration/signals/ConnectorExtractor.ts:20
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Connector name — must already be registered with Connector.create(). |
model |
model: string; |
Chat/LLM model id, e.g. 'claude-sonnet-4-6' or 'gpt-5-mini'. |
temperature? |
temperature?: number; |
Default 0.2 — tighter sampling keeps JSON well-formed. |
maxOutputTokens? |
maxOutputTokens?: number; |
Max output tokens per LLM call. Default: undefined — use the model's own |
| ceiling, which is always the maximum it can emit. Hardcoded defaults | ||
| silently truncate long extractions. See feedback_no_output_limits.md. |
ConnectorPage interface
📍 src/tools/connector/pages/types.ts:7
Properties
| Property | Type | Description |
|---|---|---|
items |
items: T[]; |
- |
returnedCount |
returnedCount: number; |
- |
reportedTotal? |
reportedTotal?: number; |
- |
searchCoverage |
`searchCoverage: 'complete' | 'incomplete' |
position |
position: PagePosition; |
- |
ConnectorProfileGeneratorConfig interface
📍 src/memory/integration/ConnectorProfileGenerator.ts:17
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Connector name — must already be registered. |
model |
model: string; |
Chat/LLM model id, e.g. 'claude-sonnet-4-6' or 'gpt-5-mini'. |
promptTemplate? |
promptTemplate?: (ctx: PromptContext) => string; |
Override the default prompt. Must still return {details, summaryForEmbedding}. |
temperature? |
temperature?: number; |
Temperature for generation. Default 0.3 (tighter, more factual). |
maxOutputTokens? |
maxOutputTokens?: number; |
Max output tokens. Default: undefined — use the model's own ceiling, |
| which is always the maximum it can emit. Hardcoded defaults silently | ||
| truncate profile generation. See feedback_no_output_limits.md. |
ConsolidationResult interface
📍 src/core/context-nextgen/types.ts:1091
Result of consolidate() operation.
Properties
| Property | Type | Description |
|---|---|---|
performed |
performed: boolean; |
Whether any consolidation was performed |
tokensChanged |
tokensChanged: number; |
Net token change (negative = freed, positive = added, e.g., summaries) |
actions |
actions: string[]; |
Description of actions taken |
ContextAssemblyConfig interface
📍 src/core/context-nextgen/assembly.ts:36
Properties
| Property | Type | Description |
|---|---|---|
tokenEstimator? |
tokenEstimator?: ITokenEstimator; |
Optional deterministic host estimator for the selected model/provider; no automatic tokenizer/network lookup. |
maxDataTokens? |
maxDataTokens?: number; |
Default 2048 estimated tokens, including data-message wrappers. |
sourceTokenLimits? |
sourceTokenLimits?: Record<string, number>; |
- |
timeoutMs? |
timeoutMs?: number; |
Total awaited contributor time across one preparation and its optional final input refresh; default 1000ms, maximum 30s. |
maxBlocks? |
maxBlocks?: number; |
Default 128 blocks and 64KiB characters per block/projection. |
maxBlockCharacters? |
maxBlockCharacters?: number; |
- |
layout? |
`layout?: 'legacy' | 'stable-prefix';` |
reasoningReserveTokens? |
reasoningReserveTokens?: number; |
Additional headroom; does not turn provider thinking on or change output parameters. |
contributors? |
contributors?: Record<string, ContextContributor>; |
- |
ContextBlock interface
📍 src/core/context-nextgen/assembly.ts:9
A host-selected data view. This never grants instruction or authorization authority.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique within the source plugin. Manifest/dependency IDs are plugin/id. |
text |
text: string; |
- |
priority? |
priority?: number; |
- |
protected? |
protected?: boolean; |
- |
dependencies? |
dependencies?: string[]; |
Fully qualified IDs; selected dependents require their complete dependency closure. |
expiresAt? |
expiresAt?: number; |
Absolute host timestamp. Expired required data fails instead of disappearing. |
projection? |
projection?: string; |
Host-supplied smaller data view, used only for optional blocks. |
ContextBudget interface
📍 src/core/context-nextgen/types.ts:634
Token budget breakdown - clear and simple
Properties
| Property | Type | Description |
|---|---|---|
providerCountedInputTokens? |
providerCountedInputTokens?: number; |
Optional provider preflight count for a native frame; not response/billing usage. |
maxTokens |
maxTokens: number; |
Maximum context tokens for the model |
responseReserve |
responseReserve: number; |
Tokens reserved for LLM response |
systemMessageTokens |
systemMessageTokens: number; |
Tokens used by system message (prompt + instructions + plugin content) |
toolsTokens |
toolsTokens: number; |
Tokens used by tool definitions (NEVER compacted) |
conversationTokens |
conversationTokens: number; |
Tokens used by conversation history |
currentInputTokens |
currentInputTokens: number; |
Tokens used by current input (user message or tool results) |
totalUsed |
totalUsed: number; |
Total tokens used |
available |
available: number; |
Available tokens (maxTokens - responseReserve - totalUsed) |
utilizationPercent |
utilizationPercent: number; |
Usage percentage (totalUsed / (maxTokens - responseReserve)) |
breakdown |
`breakdown: { |
systemPrompt: number;
persistentInstructions: number;
pluginInstructions: number;
pluginContents: Record<string, number>;
tools: number;
conversation: number;
currentInput: number;
};` | Breakdown by component for debugging |
ContextCompactionReport interface
📍 src/core/context-nextgen/compaction/types.ts:27
Properties
| Property | Type | Description |
|---|---|---|
status |
`status: 'compacted' | 'skipped';` |
trigger |
`trigger: 'manual' | 'pre-call';` |
inputTokensBefore |
`inputTokensBefore: number | null;` |
inputTokensAfter |
`inputTokensAfter: number | null;` |
accounting |
`accounting: 'provider' | 'local' |
plugins |
`plugins: { |
status: 'compacted' | 'skipped';
reason?: 'disabled' | 'not_selected' | 'not_needed' | 'no_reduction';
compacted: readonly string[];
};| - | |history|history: {
mode: 'native' | 'off';
status: 'compacted' | 'skipped';
reason?: 'disabled' | 'not_selected' | 'not_needed' | 'empty' | 'protected' | 'no_reduction';
provider?: string;
sourceReferences: readonly EvidenceReference[];
invocationId?: string;
};| - | |checkpointed|checkpointed: boolean;` | - |
ContextCompactionStrategyConfig interface
📍 src/core/context-nextgen/compaction/types.ts:17
Properties
| Property | Type | Description |
|---|---|---|
plugins |
`plugins: 'auto' | 'off';` |
history |
`history: 'native' | 'off' |
automatic? |
automatic?: boolean; |
Default true; explicit host operations remain available when false. |
ContextContributionRequest interface
📍 src/core/context-nextgen/assembly.ts:22
Properties
| Property | Type | Description |
|---|---|---|
input |
readonly input: ReadonlyArray<InputItem>; |
- |
model |
readonly model: string; |
- |
maxDataTokens |
readonly maxDataTokens: number; |
- |
signal |
readonly signal: AbortSignal; |
- |
ContextContributor interface
📍 src/core/context-nextgen/assembly.ts:29
Explicit companion registration; no similarly named plugin method is auto-detected.
Methods
getRevision()
Must change whenever source content, host selection policy, permissions or scope changes; packet input is tracked separately.
getRevision(): string | number;
Returns: string | number
contribute()
contribute(request: ContextContributionRequest): ContextBlock[] | Promise<ContextBlock[]>;
Parameters:
request:ContextContributionRequest
Returns: ContextBlock[] | Promise<ContextBlock[]>
Properties
| Property | Type | Description |
|---|---|---|
instructions? |
`instructions?: string | null;` |
ContextEvents interface
📍 src/core/context-nextgen/types.ts:1019
Events emitted by AgentContextNextGen
Properties
| Property | Type | Description |
|---|---|---|
'context:prepared' |
'context:prepared': { budget: ContextBudget; compacted: boolean }; |
Emitted when context is prepared |
'context:compacted' |
'context:compacted': { tokensFreed: number; log: string[] }; |
Emitted when compaction is performed |
'budget:updated' |
'budget:updated': { budget: ContextBudget; timestamp: number }; |
Emitted right after budget is calculated in prepare() - for reactive monitoring |
'budget:warning' |
'budget:warning': { budget: ContextBudget }; |
Emitted when budget reaches warning threshold (>70%) |
'budget:critical' |
'budget:critical': { budget: ContextBudget }; |
Emitted when budget reaches critical threshold (>90%) |
'compaction:starting' |
`'compaction:starting': { |
budget: ContextBudget;
targetTokensToFree: number;
timestamp: number;
};| Emitted when compaction is about to start | |'input:oversized'|'input:oversized': { result: OversizedInputResult };| Emitted when current input is too large | |'message:added'|'message:added': { role: string; index: number };| Emitted when a message is added | |'conversation:cleared'|'conversation:cleared': { reason?: string };| Emitted when conversation is cleared | |'context:rolled_over'|'context:rolled_over': { result: ContextRolloverResult; timestamp: number };` | Emitted after an explicit context rollover commits atomically. |
ContextHintsConfig interface
📍 src/memory/integration/signals/SignalIngestor.ts:37
Properties
| Property | Type | Description |
|---|---|---|
openTasks? |
`openTasks?: boolean | { limit?: number };` |
Opt-in — costs a listOpenTasks call + prompt tokens per extraction. |
||
true → default limit 20 |
||
{ limit } → caller-controlled limit (clamped by listOpenTasks to ≤ 200) |
||
recentTopics? |
`recentTopics?: boolean | { days?: number; limit?: number };` |
Same opt-in semantics as openTasks. |
ContextOptions interface
Properties
| Property | Type | Description |
|---|---|---|
topFactsLimit? |
topFactsLimit?: number; |
- |
include? |
include?: ContextTier[]; |
Opt-in tiers. Tasks + events are on by default; semantic/neighbors/documents |
are opt-in. Pass tiers: 'minimal' to suppress tasks + events for perf. |
||
tiers? |
`tiers?: 'full' | 'minimal';` |
| 'minimal': skip those tiers. | ||
documentPredicates? |
documentPredicates?: string[]; |
- |
semanticQuery? |
semanticQuery?: string; |
- |
semanticTopK? |
semanticTopK?: number; |
- |
neighborPredicates? |
neighborPredicates?: string[]; |
- |
neighborDepth? |
neighborDepth?: number; |
- |
asOf? |
asOf?: Date; |
- |
relatedTasksLimit? |
relatedTasksLimit?: number; |
Limits on the task/event tiers. Defaults: 15 each. |
relatedEventsLimit? |
relatedEventsLimit?: number; |
- |
recentEventsWindowDays? |
recentEventsWindowDays?: number; |
How far back to look for "recent" events. Default 90 days. |
ContextPreparation interface
📍 src/core/context-nextgen/types.ts:700
Diagnostic snapshot of the last successful prepare; token counts are estimates.
Properties
| Property | Type | Description |
|---|---|---|
model? |
model?: string; |
Effective model for an opt-in routed managed preparation. |
compactionDetails? |
compactionDetails?: import('./compaction/types.js').ContextCompactionReport; |
Optional independent plugin/history outcomes for an explicitly selected composition. |
selection? |
selection?: import('./assembly.js').ContextSelectionManifest; |
Diagnostic for the opt-in transactional built-ins in this preparation. |
compaction? |
compaction?: import('./strategies/conversation-compaction.js').ConversationCompactionReport; |
- |
revision |
revision: number; |
Monotonic, process-local successful preparation number. |
preparedAt |
preparedAt: number; |
Millisecond timestamp at selection; later context mutations do not refresh it. |
budget |
budget: ContextBudget; |
Estimated budget for that selected request, including final host-hook adjustments. |
ContextPrepareOptions interface
📍 src/core/context-nextgen/types.ts:681
Optional request contributions, resolved again after compaction.
Properties
| Property | Type | Description |
|---|---|---|
nativeCompaction? |
nativeCompaction?: import('./compaction/types.js').NativeCompactionDriver; |
- |
signal? |
signal?: AbortSignal; |
Optional bounded pre-call compaction cancellation. |
summarize? |
summarize?: import('./strategies/conversation-compaction.js').ContextSummaryGenerator; |
Host-owned structured-summary generator; Agent binds its configured compactor. |
getTools? |
getTools?: () => FunctionToolDefinition[]; |
Obtain the exact visible definitions, including dynamic descriptions and identity filtering. |
instructions? |
instructions?: string; |
Additional top-level instructions sent separately from the context input. |
getRequestOptions? |
`getRequestOptions?: (tools: FunctionToolDefinition[]) => |
Pick<TextGenerateOptions, 'instructions' | 'response_format' | 'native_tools'>;` | Resolve known request contributions from the selected tools; synchronous, without context mutation. |
| modelMaxContextTokens? | modelMaxContextTokens?: number; | Usable capacity advertised by the initially selected provider/model; explicit host limits remain an upper bound. |
ContextRolloverOptions interface
📍 src/core/context-nextgen/types.ts:1129
Options for an explicit context rollover.
Properties
| Property | Type | Description |
|---|---|---|
preserveRecentTurns? |
preserveRecentTurns?: number; |
Number of most-recent user turns to keep byte-for-byte. Tool calls and |
| their results stay with their containing turn. Default: 8. | ||
summarize |
summarize: ContextRolloverSummarizer; |
Summarize the older prefix. The live context changes only after success. |
reason? |
reason?: string; |
Optional reason included in the result and rollover event. |
ContextRolloverResult interface
📍 src/core/context-nextgen/types.ts:1144
Result of an explicit context rollover.
Properties
| Property | Type | Description |
|---|---|---|
performed |
performed: boolean; |
Whether an older prefix existed and was replaced by a summary capsule. |
beforeTokens |
beforeTokens: number; |
Estimated conversation tokens before rollover. |
afterTokens |
afterTokens: number; |
Estimated conversation tokens after rollover. |
tokensFreed |
tokensFreed: number; |
Net estimated tokens freed (may be negative for an unusually long summary). |
itemsSummarized |
itemsSummarized: number; |
Number of older message items represented by the summary. |
itemsRetained |
itemsRetained: number; |
Number of exact recent/opaque items retained alongside the summary. |
retainedTurns |
retainedTurns: number; |
Number of recent user turns retained verbatim. |
summaryTokens |
summaryTokens: number; |
Estimated token size of the generated summary capsule. |
reason? |
reason?: string; |
Optional host-provided reason. |
ContextRolloverSummaryInput interface
📍 src/core/context-nextgen/types.ts:1109
Input passed to a context-rollover summarizer.
items is a detached clone of the older conversation prefix. Mutating it
cannot mutate the live context. Recent turns are intentionally excluded
because they remain verbatim after rollover.
Properties
| Property | Type | Description |
|---|---|---|
items |
readonly items: ReadonlyArray<InputItem>; |
Older conversation items that must be represented by the summary. |
estimatedTokens |
readonly estimatedTokens: number; |
Estimated size of items, using the context's configured estimator. |
preservedRecentTurns |
readonly preservedRecentTurns: number; |
Number of recent user turns that will remain verbatim. |
reason? |
readonly reason?: string; |
Optional host-provided reason for observability or prompt selection. |
ContextSelectionEntry interface
📍 src/core/context-nextgen/assembly.ts:53
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
source |
source: string; |
- |
status |
`status: 'selected' | 'projected' |
reason |
`reason: 'protected' | 'priority' |
estimatedTokens |
estimatedTokens: number; |
- |
dependencies |
dependencies: string[]; |
- |
protected |
protected: boolean; |
- |
ContextSelectionManifest interface
📍 src/core/context-nextgen/assembly.ts:62
Properties
| Property | Type | Description |
|---|---|---|
layout |
`layout: 'legacy' | 'stable-prefix';` |
entries |
entries: ContextSelectionEntry[]; |
- |
maxDataTokens |
maxDataTokens: number; |
- |
selectedDataTokens |
selectedDataTokens: number; |
- |
reasoningReserveTokens |
reasoningReserveTokens: number; |
- |
requestFingerprint? |
requestFingerprint?: string; |
Hashes include host identity, current authority, model, tools, schemas and submitted input. Not provider cache keys. |
accounting |
`accounting: { estimate: 'local'; opaqueOrMultimodal: boolean; providerInputTokens: number | null; |
estimatedInputTokens: number; capacitySource: 'host' | 'provider' | 'registry' | 'fallback'; inputTokenDelta: number | null; cachedInputTokens: number | null; cacheCreationInputTokens: number | null };` | - |
ContextSummaryEntry interface
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:33
Properties
| Property | Type | Description |
|---|---|---|
text |
text: string; |
- |
sourceIds |
sourceIds: string[] |
- |
ContextSummaryRequest interface
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:44
Properties
| Property | Type | Description |
|---|---|---|
items |
readonly items: ReadonlyArray<InputItem>; |
- |
reference |
readonly reference: EvidenceReference; |
- |
schema |
readonly schema: Record<string, unknown>; |
- |
maxOutputTokens |
readonly maxOutputTokens: number; |
- |
signal |
readonly signal: AbortSignal; |
- |
ControlFlowResult interface
📍 src/core/routineControlFlow.ts:36
Properties
| Property | Type | Description |
|---|---|---|
completed |
completed: boolean; |
- |
result? |
result?: unknown; |
- |
error? |
error?: string; |
- |
ConversationCompactionReport interface
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:59
Properties
| Property | Type | Description |
|---|---|---|
strategy |
`strategy: 'observation-masking' | 'structured-summary';` |
trigger |
trigger: 'pre-call'; |
- |
beforeTokens |
beforeTokens: number; |
- |
afterTokens |
afterTokens: number; |
- |
tokensFreed |
tokensFreed: number; |
- |
sourceReferences |
sourceReferences: EvidenceReference[]; |
- |
helperInvoked |
helperInvoked: boolean; |
Summary callback requested; consult ModelTask for actual dispatched model calls. |
helperInvocationId? |
helperInvocationId?: string; |
- |
helperModel? |
helperModel?: string; |
Actual model identifier returned by the helper provider, when available. |
taskId? |
taskId?: string; |
- |
fallback? |
fallback?: 'mask'; |
- |
fallbackReason? |
fallbackReason?: string; |
- |
applied |
applied: boolean; |
- |
ConversationMessage interface
📍 src/domain/entities/AgentState.ts:34
Conversation message in history
Properties
| Property | Type | Description |
|---|---|---|
role |
`role: 'user' | 'assistant' |
content |
content: string; |
- |
timestamp |
timestamp: number; |
- |
CreateRealtimeClientSecretOptions interface
📍 src/capabilities/voice/openai/OpenAIRealtimeAPI.ts:11
Properties
| Property | Type | Description |
|---|---|---|
session |
`session: OpenAIRealtimeSessionConfig | OpenAIRealtimeTranscriptionSessionConfig;` |
expiresAfterSeconds? |
expiresAfterSeconds?: number; |
- |
safetyIdentifier? |
safetyIdentifier?: string; |
- |
CreateRealtimeTranslationClientSecretOptions interface
📍 src/capabilities/voice/openai/OpenAIRealtimeAPI.ts:17
Properties
| Property | Type | Description |
|---|---|---|
session |
session: OpenAIRealtimeTranslationClientSessionConfig; |
- |
safetyIdentifier? |
safetyIdentifier?: string; |
- |
CreateRealtimeWebRTCCallOptions interface
📍 src/capabilities/voice/openai/OpenAIRealtimeAPI.ts:22
Properties
| Property | Type | Description |
|---|---|---|
sdp |
sdp: string; |
SDP offer generated by RTCPeerConnection.createOffer(). |
session? |
session?: OpenAIRealtimeSessionConfig; |
Optional initial session configuration sent atomically with the offer. |
safetyIdentifier? |
safetyIdentifier?: string; |
- |
DedupDecision interface
Properties
| Property | Type | Description |
|---|---|---|
action |
`action: 'auto-merge' | 'review' |
score |
score: number; |
0..1 — final composite score after weighted sum + guards. |
signals |
signals: SignalBreakdown; |
- |
suggestedWinnerId |
suggestedWinnerId: EntityId; |
The id the scorer recommends keeping. |
suggestedLoserId |
suggestedLoserId: EntityId; |
The id the scorer recommends archiving. |
reason |
reason: string; |
One-sentence human-readable rationale. |
DeepSeekBalance interface
📍 src/infrastructure/providers/deepseek/DeepSeekTextProvider.ts:43
Properties
| Property | Type | Description |
|---|---|---|
is_available |
is_available: boolean; |
- |
balance_infos |
`balance_infos: Array<{ |
currency: string;
total_balance: string;
granted_balance: string;
topped_up_balance: string;
}>;` | - |
DeepSeekFimRequest interface
📍 src/infrastructure/providers/deepseek/DeepSeekTextProvider.ts:34
Properties
| Property | Type | Description |
|---|---|---|
model |
model: string; |
- |
prompt |
prompt: string; |
- |
suffix? |
suffix?: string; |
- |
maxTokens? |
maxTokens?: number; |
- |
temperature? |
temperature?: number; |
- |
stop? |
`stop?: string | string[];` |
DeepSeekFimResponse interface
📍 src/infrastructure/providers/deepseek/DeepSeekTextProvider.ts:53
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
object |
object: string; |
- |
created |
created: number; |
- |
model |
model: string; |
- |
choices |
`choices: Array<{ |
index: number;
text: string;
finish_reason: string | null;
logprobs?: unknown;
}>;| - | |usage?|usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};` | - |
DeepSeekHostProfile interface
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:18
Properties
| Property | Type | Description |
|---|---|---|
id |
id: DeepSeekHost; |
- |
displayName |
displayName: string; |
- |
baseURL? |
baseURL?: string; |
- |
requiresBaseURL? |
requiresBaseURL?: boolean; |
Azure and custom deployments must provide a connector baseURL. |
defaultTransport |
defaultTransport: Exclude<DeepSeekTransport, 'auto'>; |
- |
promptCaching |
`promptCaching: { mode: 'implicit' | 'unsupported'; reportsCacheUsage: boolean };` |
modelIds |
modelIds: Readonly<Record<string, string>>; |
- |
modelLimits? |
modelLimits?: Readonly<Record<string, { inputTokens?: number; outputTokens?: number }>>; |
Host-specific limits take precedence over the first-party model registry. |
documentation |
documentation: string; |
- |
DefaultCompactionStrategyConfig interface
📍 src/core/context-nextgen/strategies/DefaultCompactionStrategy.ts:27
Configuration for DefaultCompactionStrategy
Properties
| Property | Type | Description |
|---|---|---|
threshold? |
threshold?: number; |
Custom threshold (default: 0.70 = 70%) |
DelegationDefaults interface
📍 src/core/orchestrator/createOrchestrator.ts:72
Delegation defaults that apply when delegate_interactive is called without explicit monitoring/reclaimOn parameters.
Properties
| Property | Type | Description |
|---|---|---|
monitoring? |
`monitoring?: 'passive' | 'active' |
reclaimOn? |
`reclaimOn?: { |
keyword?: string;
maxTurns?: number;
workspaceKey?: string;
};` | Default reclaim conditions |
DelegationReclaimConfig interface
📍 src/core/orchestrator/tools.ts:54
Properties
| Property | Type | Description |
|---|---|---|
keyword? |
keyword?: string; |
User keyword that triggers reclaim (e.g., "done", "back") |
maxTurns? |
maxTurns?: number; |
Auto-reclaim after N delegation turns |
workspaceKey? |
workspaceKey?: string; |
Reclaim when this workspace key appears |
DelegationState interface
📍 src/core/orchestrator/tools.ts:46
Delegation state — tracks whether the orchestrator has handed the user-facing session to a sub-agent.
Properties
| Property | Type | Description |
|---|---|---|
active |
active: boolean; |
- |
agentName |
agentName: string; |
- |
monitoring |
`monitoring: 'passive' | 'active' |
reclaimOn |
reclaimOn: DelegationReclaimConfig; |
- |
turnCount |
turnCount: number; |
- |
DesktopGetCursorResult interface
📍 src/tools/desktop/types.ts:207
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
x? |
x?: number; |
- |
y? |
y?: number; |
- |
error? |
error?: string; |
- |
DesktopGetScreenSizeResult interface
📍 src/tools/desktop/types.ts:236
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
physicalWidth? |
physicalWidth?: number; |
- |
physicalHeight? |
physicalHeight?: number; |
- |
logicalWidth? |
logicalWidth?: number; |
- |
logicalHeight? |
logicalHeight?: number; |
- |
scaleFactor? |
scaleFactor?: number; |
- |
error? |
error?: string; |
- |
DesktopKeyboardKeyArgs interface
📍 src/tools/desktop/types.ts:226
Properties
| Property | Type | Description |
|---|---|---|
keys |
keys: string; |
- |
DesktopKeyboardKeyResult interface
📍 src/tools/desktop/types.ts:230
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
DesktopKeyboardTypeArgs interface
📍 src/tools/desktop/types.ts:215
Properties
| Property | Type | Description |
|---|---|---|
text |
text: string; |
- |
delay? |
delay?: number; |
- |
DesktopKeyboardTypeResult interface
📍 src/tools/desktop/types.ts:220
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
DesktopMouseClickArgs interface
📍 src/tools/desktop/types.ts:163
Properties
| Property | Type | Description |
|---|---|---|
x? |
x?: number; |
- |
y? |
y?: number; |
- |
button? |
button?: MouseButton; |
- |
clickCount? |
clickCount?: number; |
- |
DesktopMouseClickResult interface
📍 src/tools/desktop/types.ts:170
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
x? |
x?: number; |
- |
y? |
y?: number; |
- |
button? |
button?: MouseButton; |
- |
clickCount? |
clickCount?: number; |
- |
error? |
error?: string; |
- |
DesktopMouseDragArgs interface
📍 src/tools/desktop/types.ts:180
Properties
| Property | Type | Description |
|---|---|---|
startX |
startX: number; |
- |
startY |
startY: number; |
- |
endX |
endX: number; |
- |
endY |
endY: number; |
- |
button? |
button?: MouseButton; |
- |
DesktopMouseDragResult interface
📍 src/tools/desktop/types.ts:188
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
DesktopMouseMoveArgs interface
📍 src/tools/desktop/types.ts:150
Properties
| Property | Type | Description |
|---|---|---|
x |
x: number; |
- |
y |
y: number; |
- |
DesktopMouseMoveResult interface
📍 src/tools/desktop/types.ts:155
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
x? |
x?: number; |
- |
y? |
y?: number; |
- |
error? |
error?: string; |
- |
DesktopMouseScrollArgs interface
📍 src/tools/desktop/types.ts:194
Properties
| Property | Type | Description |
|---|---|---|
deltaX? |
deltaX?: number; |
- |
deltaY? |
deltaY?: number; |
- |
x? |
x?: number; |
- |
y? |
y?: number; |
- |
DesktopMouseScrollResult interface
📍 src/tools/desktop/types.ts:201
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
DesktopPoint interface
📍 src/tools/desktop/types.ts:19
Properties
| Property | Type | Description |
|---|---|---|
x |
x: number; |
- |
y |
y: number; |
- |
DesktopScreenshot interface
📍 src/tools/desktop/types.ts:37
Properties
| Property | Type | Description |
|---|---|---|
base64 |
base64: string; |
Base64-encoded PNG image data (dimensions in logical pixels) |
width |
width: number; |
Width in logical pixels — matches mouseClick/mouseMove coordinate space |
height |
height: number; |
Height in logical pixels — matches mouseClick/mouseMove coordinate space |
DesktopScreenshotArgs interface
📍 src/tools/desktop/types.ts:134
Properties
| Property | Type | Description |
|---|---|---|
region? |
region?: { x: number; y: number; width: number; height: number }; |
- |
DesktopScreenshotResult interface
📍 src/tools/desktop/types.ts:138
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
width? |
width?: number; |
- |
height? |
height?: number; |
- |
base64? |
base64?: string; |
Base64 PNG for text summary |
__images? |
__images?: Array<{ base64: string; mediaType: string }>; |
Image array for multimodal provider handling |
error? |
error?: string; |
- |
DesktopScreenSize interface
📍 src/tools/desktop/types.ts:24
Properties
| Property | Type | Description |
|---|---|---|
physicalWidth |
physicalWidth: number; |
Raw physical pixel width. Diagnostic only — not the coordinate space used by the APIs. |
physicalHeight |
physicalHeight: number; |
Raw physical pixel height. Diagnostic only — not the coordinate space used by the APIs. |
logicalWidth |
logicalWidth: number; |
Logical OS width. This is the coordinate space for all mouse/screenshot APIs. |
logicalHeight |
logicalHeight: number; |
Logical OS height. This is the coordinate space for all mouse/screenshot APIs. |
scaleFactor |
scaleFactor: number; |
Scale factor (physical / logical), e.g. 2.0 on Retina. For diagnostics only. |
DesktopWindow interface
📍 src/tools/desktop/types.ts:46
Properties
| Property | Type | Description |
|---|---|---|
id |
id: number; |
Window identifier (platform-specific) |
title |
title: string; |
Window title |
appName? |
appName?: string; |
Application name |
bounds? |
bounds?: { x: number; y: number; width: number; height: number }; |
Window bounds in logical pixel coords |
DesktopWindowFocusArgs interface
📍 src/tools/desktop/types.ts:254
Properties
| Property | Type | Description |
|---|---|---|
windowId |
windowId: number; |
- |
DesktopWindowFocusResult interface
📍 src/tools/desktop/types.ts:258
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
DesktopWindowListResult interface
📍 src/tools/desktop/types.ts:247
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
windows? |
windows?: DesktopWindow[]; |
- |
error? |
error?: string; |
- |
DeterministicStep interface
📍 src/domain/entities/Routine.ts:50
A deterministic tool call that runs without LLM involvement.
Arguments support template placeholders:
- {{param.NAME}} — resolved from routine input parameters
- {{result.TASK_NAME}} — resolved from task output (postSteps only)
- {{step.STEP_NAME}} — resolved from a previous step's result
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Human-readable name for this step (used in recording and logging) |
toolName |
toolName: string; |
Tool name to invoke (must be registered on the agent) |
args |
args: Record<string, unknown>; |
Arguments to pass to the tool. Values can contain {{...}} templates. |
resultKey? |
resultKey?: string; |
ICM/WM key where the step result is stored. |
| For preSteps: makes result available to tasks via this key. | ||
| For postSteps: makes result available to subsequent postSteps. | ||
If omitted, result is stored as __prestep_{name} or __poststep_{name}. |
||
onError? |
onError?: StepErrorStrategy; |
Error handling strategy. Default: 'fail' for preSteps, 'continue' for postSteps. |
timeoutMs? |
timeoutMs?: number; |
Timeout in ms for this step. Default: 30000 (30s). |
DirectCallOptions interface
Options for direct LLM calls (bypassing AgentContext).
Properties
| Property | Type | Description |
|---|---|---|
modelTask? |
modelTask?: ModelTask; |
- |
signal? |
signal?: AbortSignal; |
- |
purpose? |
purpose?: string; |
Host-supplied accounting label; does not select a model or grant authority. |
instructions? |
instructions?: string; |
System instructions (optional) |
includeTools? |
includeTools?: boolean; |
Include registered tools in the call. Default: false |
tools? |
tools?: Tool[]; |
Explicit provider tool definitions for this direct call. This is useful for |
| protocol-managed function/custom tools whose outputs the caller will return | ||
manually. When set, it takes precedence over includeTools. |
||
toolChoice? |
toolChoice?: TextGenerateOptions['tool_choice']; |
Tool selection for explicit direct-call tools. |
temperature? |
temperature?: number; |
Temperature for generation |
parameterPolicy? |
parameterPolicy?: TextGenerateOptions['parameterPolicy']; |
- |
maxOutputTokens? |
maxOutputTokens?: number; |
Maximum output tokens |
previousResponseId? |
previousResponseId?: string; |
Continue a provider-stored response/interaction without resending its history. |
continuationToken? |
continuationToken?: string; |
Resume an incomplete provider decode using the token returned by the prior call. |
responseFormat? |
responseFormat?: ResponseFormat; |
Vendor-agnostic structured (JSON) output. When set, the response is |
| constrained to JSON — via the vendor's native mechanism where supported, | ||
| otherwise a strict prompt instruction — and parsed into | ||
response.output_parsed. See src/core/StructuredOutput.ts. |
||
thinking? |
thinking?: ThinkingConfig; |
Vendor-agnostic thinking/reasoning configuration |
vendorOptions? |
vendorOptions?: Record<string, unknown>; |
Vendor-specific options |
promptCache? |
promptCache?: PromptCachePolicy; |
Provider-neutral prompt caching policy. |
nativeTools? |
nativeTools?: NativeToolRequest[]; |
Provider-hosted tools, separate from client-executed ToolFunctions. |
dataHandling? |
dataHandling?: DataHandlingPolicy; |
- |
skipContextLimitCheck? |
skipContextLimitCheck?: boolean; |
Skip pre-flight context limit check. Default: false (check is ON) |
DocumentMetadata interface
📍 src/capabilities/documents/types.ts:56
Properties
| Property | Type | Description |
|---|---|---|
filename |
filename: string; |
- |
format |
format: DocumentFormat; |
- |
family |
family: DocumentFamily; |
- |
mimeType |
mimeType: string; |
- |
totalPieces |
totalPieces: number; |
- |
totalTextPieces |
totalTextPieces: number; |
- |
totalImagePieces |
totalImagePieces: number; |
- |
totalSizeBytes |
totalSizeBytes: number; |
- |
estimatedTokens |
estimatedTokens: number; |
- |
processingTimeMs |
processingTimeMs: number; |
- |
formatSpecific? |
formatSpecific?: Record<string, unknown>; |
- |
DocumentReaderConfig interface
📍 src/capabilities/documents/types.ts:184
Properties
| Property | Type | Description |
|---|---|---|
defaults? |
defaults?: DocumentReadOptions; |
Default options for all read() calls |
handlers? |
handlers?: Map<DocumentFamily, IFormatHandler>; |
Custom format handlers (override built-in) |
maxDownloadSizeBytes? |
maxDownloadSizeBytes?: number; |
Maximum download size for URL sources (default: 50MB) |
downloadTimeoutMs? |
downloadTimeoutMs?: number; |
Download timeout for URL sources (default: 60000ms) |
DocumentReadOptions interface
📍 src/capabilities/documents/types.ts:156
Properties
| Property | Type | Description |
|---|---|---|
maxTokens? |
maxTokens?: number; |
Maximum estimated tokens in output (default: 100000) |
maxOutputBytes? |
maxOutputBytes?: number; |
Maximum output size in bytes (default: 5MB) |
extractImages? |
extractImages?: boolean; |
Extract images from documents (default: true) |
imageDetail? |
`imageDetail?: 'auto' | 'low' |
imageFilter? |
imageFilter?: ImageFilterOptions; |
Image filtering options |
pages? |
`pages?: number[] | string[];` |
transformers? |
transformers?: IDocumentTransformer[]; |
Additional transformers to apply |
skipDefaultTransformers? |
skipDefaultTransformers?: boolean; |
Skip built-in transformers (default: false) |
formatOptions? |
`formatOptions?: { |
excel?: ExcelFormatOptions;
pdf?: PDFFormatOptions;
html?: HTMLFormatOptions;
office?: OfficeFormatOptions;
};` | Format-specific options |
DocumentResult interface
📍 src/capabilities/documents/types.ts:70
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
pieces |
pieces: DocumentPiece[]; |
- |
metadata |
metadata: DocumentMetadata; |
- |
error? |
error?: string; |
- |
warnings |
warnings: string[]; |
- |
DocumentTextPiece interface
📍 src/capabilities/documents/types.ts:37
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'text'; |
- |
content |
content: string; |
- |
metadata |
metadata: PieceMetadata; |
- |
DocumentToContentOptions interface
📍 src/capabilities/documents/types.ts:233
Properties
| Property | Type | Description |
|---|---|---|
imageDetail? |
`imageDetail?: 'auto' | 'low' |
imageFilter? |
imageFilter?: ImageFilterOptions; |
Additional image filtering at content conversion time |
maxImages? |
maxImages?: number; |
Maximum images in content output (default: 20) |
mergeAdjacentText? |
mergeAdjacentText?: boolean; |
Merge adjacent text pieces into one (default: true) |
DuplicateCluster interface
Properties
| Property | Type | Description |
|---|---|---|
type |
type: string; |
- |
normalizedDisplayName |
normalizedDisplayName: string; |
- |
entities |
entities: IEntity[]; |
- |
EagernessProfile interface
📍 src/memory/integration/EagernessProfile.ts:34
Properties
| Property | Type | Description |
|---|---|---|
preset |
preset: EagernessPreset; |
Preset name, recorded for telemetry. Resolved values may differ if the |
| host applied per-stage or per-knob overrides. | ||
requireEvidenceQuote |
requireEvidenceQuote: EagernessLevel; |
Force every emitted task / signal / fact to carry a verbatim quote from |
source. strict rejects items missing the quote; soft keeps the field |
||
| optional but prompts the model to prefer it. | ||
requireJustification |
requireJustification: boolean; |
When non-empty output is produced, require a one-sentence justification |
(whyActionable). false keeps the prompt and parser silent on this. |
||
requirePriorityBinding |
requirePriorityBinding: EagernessLevel; |
Bind each emitted Task to a stated priority anchor. Strict |
| drops items whose binding doesn't match an active anchor; soft renders | ||
| anchors in the prompt but doesn't enforce. | ||
skepticPass |
skepticPass: SkepticPassMode; |
Run the skeptic pass after the primary call. Mode is a label; the host |
| resolves it to a concrete connector/model. | ||
negativeExamplesCount |
negativeExamplesCount: number; |
Number of recent dismissals to inject as negative examples. 0 disables. |
perStage? |
perStage?: Partial<Record<EagernessStage, Partial<EagernessProfile>>>; |
Per-stage overrides applied on top of the top-level fields. |
EditFileResult interface
📍 src/tools/filesystem/types.ts:119
Result of a file edit operation
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
path? |
path?: string; |
- |
replacements? |
replacements?: number; |
- |
error? |
error?: string; |
- |
diff? |
diff?: string; |
- |
EmailAddress interface
📍 src/memory/integration/signals/adapters/EmailSignalAdapter.ts:18
Properties
| Property | Type | Description |
|---|---|---|
email |
email: string; |
- |
name? |
name?: string; |
- |
EmailSignal interface
📍 src/memory/integration/signals/adapters/EmailSignalAdapter.ts:23
Properties
| Property | Type | Description |
|---|---|---|
from |
from: EmailAddress; |
- |
to? |
to?: EmailAddress[]; |
- |
cc? |
cc?: EmailAddress[]; |
- |
bcc? |
bcc?: EmailAddress[]; |
BCC is NOT forwarded to the extractor for privacy reasons. |
subject? |
subject?: string; |
- |
body |
body: string; |
Plain-text body. Caller is responsible for stripping HTML / quoted replies as needed. |
date? |
date?: Date; |
- |
messageId? |
messageId?: string; |
- |
threadId? |
threadId?: string; |
- |
EmailSignalAdapterOptions interface
📍 src/memory/integration/signals/adapters/EmailSignalAdapter.ts:37
Properties
| Property | Type | Description |
|---|---|---|
seedOrganizations? |
seedOrganizations?: boolean; |
Seed sender/recipient email domains as organization entities. Default true. |
freeEmailProviders? |
freeEmailProviders?: string[]; |
Domains skipped when seeding organizations. Defaults to a common-providers |
| list; pass a custom list to override entirely (not extend). Case-insensitive. |
EmbeddingQueueConfig interface
Properties
| Property | Type | Description |
|---|---|---|
concurrency? |
concurrency?: number; |
- |
retries? |
retries?: number; |
- |
EmbeddingsCreateOptions interface
📍 src/capabilities/embeddings/Embeddings.ts:45
Options for creating an Embeddings instance
Properties
| Property | Type | Description |
|---|---|---|
connector |
`connector: string | Connector;` |
model? |
model?: string; |
Default model to use (if not specified, uses vendor's default) |
dimensions? |
dimensions?: number; |
Default dimensions (for MRL models) |
EnergyVADConfig interface
📍 src/capabilities/voice/types.ts:72
Configuration for the default energy-based VAD
Properties
| Property | Type | Description |
|---|---|---|
energyThreshold? |
energyThreshold?: number; |
RMS energy threshold to consider as speech (0-1 scale). Default: 0.01 |
speechFramesThreshold? |
speechFramesThreshold?: number; |
Consecutive speech frames needed to trigger speech_start. Default: 3 |
silenceTimeout? |
silenceTimeout?: number; |
Silence duration in ms to trigger speech_end. Default: 1500 |
minSpeechDuration? |
minSpeechDuration?: number; |
Minimum speech duration in ms to be considered valid. Default: 250 |
EnhancedConnectorAttempt interface
📍 src/tools/connector/enhancedProfiles.ts:18
Properties
| Property | Type | Description |
|---|---|---|
connector |
readonly connector: string; |
- |
toolName |
readonly toolName: string; |
- |
accountId? |
readonly accountId?: string; |
- |
invocationId |
readonly invocationId: string; |
- |
requestId |
readonly requestId: string; |
- |
EnhancedConnectorOptions interface
📍 src/tools/connector/enhancedProfiles.ts:25
Methods
onAttempt()?
Counts physical transport attempts, distinct from logical pages/model calls.
onAttempt?(attempt: EnhancedConnectorAttempt): void;
Parameters:
attempt:EnhancedConnectorAttempt
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
profile |
profile: string; |
- |
userId? |
userId?: string; |
- |
timeoutMs? |
timeoutMs?: number; |
Whole invocation deadline, default connector timeout or 30s; zero disables it. |
EnsureIndexesArgs interface
📍 src/memory/adapters/mongo/indexes.ts:41
Properties
| Property | Type | Description |
|---|---|---|
entities |
entities: IMongoCollectionLike<IEntity>; |
- |
facts |
facts: IMongoCollectionLike<IFact>; |
- |
factsArchive? |
factsArchive?: IMongoCollectionLike<IFact>; |
Optional archive collection (move-on-archive deployments). When provided, |
| the same subject/object/context/predicate-led indexes are built on the | ||
archive so findFacts({archived: true}), countFacts({archived: true}), |
||
and the getFact(id) archive-fallback don't degrade to collection scans |
||
as the archive grows. Legacy groupId+ownerId-led compounds are NOT |
||
| mirrored — the archive isn't on the hot path for admin tooling. |
EntityCandidate interface
Properties
| Property | Type | Description |
|---|---|---|
entity |
entity: IEntity; |
- |
confidence |
confidence: number; |
0..1 — 1.0 is an identifier-exact match; decreases through fuzzy/semantic. |
matchedOn |
`matchedOn: 'identifier' | 'displayName' |
rawSemanticScore? |
rawSemanticScore?: number; |
Raw cosine score from Tier 4 (semantic) — set ONLY when `matchedOn === |
'embedding'. Differs from confidence` because semantic candidates have |
||
| the cosine capped per type (default 0.95 for auto-merge-eligible types, | ||
| 0.89 for advisory types like person). Hosts auditing semantic decisions | ||
| want the raw cosine; ranking against other tiers wants the capped value. |
EntityContentComposer interface
📍 src/memory/composers/types.ts:51
Compose the semantic content text for an entity. Return '' to opt out of
semantic search for this entity (no embedding queued).
Async because composers commonly resolve referenced entity ids (assigneeId,
projectId, contextIds, ...) to displayNames. The provided ComposeContext
batches + caches these lookups within a single compose call.
Methods
compose()
compose(entity: IEntity, ctx: ComposeContext): Promise<string>;
Parameters:
entity:IEntityctx:ComposeContext
Returns: Promise<string>
EntityListFilter interface
Properties
| Property | Type | Description |
|---|---|---|
type? |
type?: string; |
- |
ids? |
ids?: EntityId[]; |
- |
archived? |
archived?: boolean; |
- |
contextId? |
contextId?: EntityId; |
Match entities whose top-level contextIds array includes this entity id. |
Symmetric to FactFilter.contextId. Adapter maps directly to |
||
{contextIds: filter.contextId} — does NOT use metadataFilter (which |
||
would query the wrong path: metadata.contextIds). |
||
metadataFilter? |
metadataFilter?: Record<string, unknown>; |
Filter on entity.metadata fields. Keys may use dot-notation to reach |
nested paths (e.g. 'jarvis.importance' → metadata.jarvis.importance). |
||
Keys whose path segments begin with $ are rejected — no operator |
||
| injection. Supported value shapes per key: |
- literal scalar:
state: 'pending' - literal Date
- array of primitives/Dates (equality against array field)
{ $in: [...] }— membership- one or more range operators (may combine):
{ $gte: 10, $lt: 20 }— operators allowed:$lt,$lte,$gt,$gte. RHS must be scalar or Date. Example: { 'state': { $in: ['pending', 'in_progress'] }, 'dueAt': { $lt: new Date('2026-05-01') }, 'jarvis.importance': { $gte: 70 }, } |
EntityReconciliationPromptContext interface
📍 src/memory/integration/entityReconciliationPrompt.ts:19
Properties
| Property | Type | Description |
|---|---|---|
entity |
entity: IEntity; |
The entity whose facts we are reconciling. |
facts |
`facts: Array< |
IFact & {
/** Human-readable source description (e.g. "email from anton on 2026-05-15"). */
sourceSignalDescription?: string;
}
>;` | All non-archived facts on this entity for the calling user. No truncation, no cap — the caller is responsible for scope.
Each fact MUST carry an id that the LLM can reference in op
factId. Caller should pre-decorate evidenceQuote and any
sourceSignalDescription it wants the LLM to see for ranking. |
| referenceDate? | referenceDate?: Date; | Reference date for interpreting "most recent". Defaults to today. |
EntityResolutionConfig interface
Properties
| Property | Type | Description |
|---|---|---|
autoResolveThreshold? |
autoResolveThreshold?: number; |
Default threshold for auto-resolve in upsertEntityBySurface. Default 0.90 (conservative). |
enableIdentityEmbedding? |
enableIdentityEmbedding?: boolean; |
When true AND an embedder is configured, entities get an identity |
| embedding (over displayName + aliases + primary identifier values). | ||
| Default true. |
Consumed by Tier 4 of EntityResolver when enableSemanticResolution
is on. Set to false to skip the embedder cost if you neither use
semantic resolution nor plan to enable it later. |
| enableSemanticResolution? | enableSemanticResolution?: boolean; | Enable the semantic tier in EntityResolver — matches surface forms
against identityEmbedding via IMemoryStore.semanticSearchEntities.
Requires an embedder AND an adapter that implements
semanticSearchEntities (currently InMemoryAdapter and
MongoMemoryAdapter).
Default changed to true in 0.9.1. Calibrated against production
data showing a clean separation between within-cluster cosines (median
0.95-1.00 for known dups) and cross-cluster cosines (max 0.86 for the
noisiest type). Semantic auto-resolve now catches the structural dup
pattern that exact-tier matching misses on pre-0.8.0 data (rows without
normalizedDisplayName) — without it, every LLM re-mention of an
existing entity creates a new row.
Auto-resolve eligibility is type-scoped via semanticAutoResolveTypes.
Persons are EXCLUDED by default — same-first-name collisions in a tenant
make semantic-alone unsafe. Persons fall back to Tier 1 (identifier) /
Tier 2-3 (multi-token name equality) only. |
| semanticAutoResolveTypes? | semanticAutoResolveTypes?: string[]; | Entity types where Tier 4 (semantic match) can drive auto-resolve.
Default: ['organization', 'project', 'event', 'topic', 'task', 'cluster'].
Types in this list get the full semanticConfidenceCap (default 0.95)
so a strong semantic match clears the auto-resolve threshold (default
0.90). Types NOT in the list have their semantic confidence capped at
0.89 — the candidate appears in mergeCandidates for operator review
but never auto-merges.
Persons are intentionally excluded. "Pavel" matching another "Pavel" with cosine 1.0 is NOT a same-person signal in a multi-Pavel tenant — persons require either an identifier match or multi-token name equality (first + last). Tier 2-3 enforce the multi-token rule for type=person.
Set to an empty array to disable semantic auto-resolve entirely (every
type goes through the operator review queue). |
| semanticConfidenceCap? | semanticConfidenceCap?: number; | Maximum confidence assigned to a Tier-4 (semantic) match for types in
semanticAutoResolveTypes. Default 0.95. The capped value lets cosine
matches clear the default autoResolveThreshold (0.90) so dup-extraction
actually converges at write time.
Picked to leave headroom below identifier-match confidence (1.0) so a
Tier-1 hit still wins ranking ties against semantic candidates. Lower
this if you want stricter auto-resolve gating; raise toward 1.0 only if
you've validated your embedder produces clean cross-entity separation. |
| semanticMinScore? | semanticMinScore?: number; | Minimum cosine score for a semantic candidate to be considered at all.
Default 0.75. Calibrated against production data: cross-entity-cluster
cosines top out around 0.86; within-cluster cosines have a long tail to
0.59-0.70 for loose clusters. Lowering this floor surfaces more
candidates (some real dups, some noise); raising it filters more
aggressively. Most callers should leave it at the default. |
| displayNameMatchConfidence? | displayNameMatchConfidence?: number; | Confidence assigned to a Tier-2 exact normalized-displayName match.
Default 0.90 — equal to the default autoResolveThreshold, so a Tier-2
match auto-resolves on upsertEntityBySurface. Lower this to make
displayName matches advisory rather than authoritative. |
| aliasMatchConfidence? | aliasMatchConfidence?: number; | Confidence assigned to a Tier-3 exact normalized-alias match.
Default changed to 0.90 in 0.8.0 (previously hardcoded 0.85). Rationale:
with normalizedAliases now indexed (Commit 1) + scoped via the
type-aware findEntitiesByNormalizedName (Commit 2), an exact alias
match is structurally as strong as a displayName match — both come from
a single O(1) lookup against deduped storage. Keeping it at 0.85 meant
alias-only matches fell below the default autoResolveThreshold (0.90)
and the resolver created a new entity on every hit (R2 from Step 0).
Hosts that want the old "alias = advisory" behavior can set this to
0.85 — the resolver returns the candidate but upsertBySurface will
create a new entity unless autoResolveThreshold is also lowered. |
EntitySearchOptions interface
Properties
| Property | Type | Description |
|---|---|---|
types? |
types?: string[]; |
- |
limit? |
limit?: number; |
- |
cursor? |
cursor?: string; |
- |
EntitySemanticSearchFilter interface
Narrow filter for IMemoryStore.semanticSearchEntities. Type narrowing is
the primary pre-filter — resolver tier-4 always knows (or guesses) the type.
contextId is the second narrow, pushed into the underlying vector-search
pipeline as a filter: {contextIds: …} clause so the search returns only
entities whose top-level contextIds contains the given anchor.
Scope still flows through scope: ScopeFilter separately.
Properties
| Property | Type | Description |
|---|---|---|
type? |
type?: string; |
Single-type narrow — preferred when known. |
types? |
types?: string[]; |
Multi-type narrow — union. Ignored when type is set. |
contextId? |
contextId?: EntityId; |
Narrow to entities whose top-level contextIds array includes this id. |
| On Mongo Atlas, the filter must be declared on the entities vector index | ||
('contextIds' in ENTITIES_FILTER_PATHS — see MongoMemoryAdapter). |
||
| Adapters that lack the filter path declaration would silently drop the | ||
| clause; the library shipped path declares it so this works out of the box. | ||
states? |
states?: string[]; |
Narrow by task-state vocabulary (metadata.state ∈ {states}). Atlas |
filter path: metadata.state. Use with type: 'task' to constrain |
||
| semantic search to active tasks at the vector pipeline level rather than | ||
| post-filtering client-side. Empty array → no constraint. | ||
assigneeId? |
assigneeId?: EntityId; |
Narrow by assignee entity id (metadata.assigneeId === id). Atlas filter |
path: metadata.assigneeId. Use with type: 'task'. |
||
reporterId? |
reporterId?: EntityId; |
Narrow by reporter entity id (metadata.reporterId === id). Atlas filter |
path: metadata.reporterId. Use with type: 'task'. |
||
projectId? |
projectId?: EntityId; |
Narrow by project entity id (metadata.projectId === id). Atlas filter |
path: metadata.projectId. Use with type: 'task'. |
||
dueAtRange? |
dueAtRange?: { from?: Date; to?: Date }; |
Narrow by due-date range (metadata.dueAt within window). At least one |
of from/to must be set. Atlas filter path: metadata.dueAt. |
||
Use with type: 'task'. |
||
touchesEntity? |
touchesEntity?: EntityId; |
OR-wildcard role match — returns entities where this id appears in any |
| relational role for the filter's entity type. The entity-side analog of | ||
FactFilter.touchesEntity. |
Expansion is keyed by filter.type:
'task'→$orovermetadata.assigneeId,metadata.reporterId,metadata.projectId, and top-levelcontextIds.- Any other type, or when
typeis unset →$orovercontextIdsonly (the one relational anchor universal across all entity types).
Pushed into the Atlas $vectorSearch.filter clause. All referenced paths
are declared in ENTITIES_FILTER_PATHS, so the union is honoured rather
than silently dropped.
When combined with a per-role narrow (e.g. assigneeId), both clauses
apply and are ANDed — the per-role narrow further filters within the
touched set. |
| touchesAnyOf? | touchesAnyOf?: EntityId[]; | Multi-anchor OR-wildcard match — returns entities touched by ANY id in
this array. The set-valued analog of touchesEntity: where the single
form fans out across one entity's relational roles, this fans out across
MANY anchors in a single ranked vector query.
Expansion mirrors touchesEntity, keyed by filter.type:
'task'→ entity matches if any anchor appears inmetadata.assigneeId,metadata.reporterId,metadata.projectId, or top-levelcontextIds.- Any other type / unset → match on
contextIdsmembership only.
Pushed into the Atlas $vectorSearch.filter as one compound $or over
$in clauses, so the vector ranker sees every anchor-touching candidate
together rather than competing across N separate per-anchor top-K cuts
(the inferior client-side-union pattern this field exists to replace).
ANDs with touchesEntity when both are set, and with any per-role narrow.
Empty array is treated as "no constraint" (the clause is dropped). |
EntityView interface
Properties
| Property | Type | Description |
|---|---|---|
entity |
entity: IEntity; |
- |
profile |
`profile: IFact | null;` |
topFacts |
topFacts: IFact[]; |
Atomic facts where the subject is the target entity OR the target appears |
| as object OR in contextIds, ranked by confidence × recency × predicateWeight | ||
| × importance. Duplicates dropped. | ||
relatedTasks? |
relatedTasks?: RelatedTask[]; |
Tasks linked to this entity via metadata or fact relationships. Non-terminal state by default. |
relatedEvents? |
relatedEvents?: RelatedEvent[]; |
Events linked to this entity (attendance, subject/object, context). Recent by default. |
documents? |
documents?: IFact[]; |
- |
semantic? |
semantic?: Array<{ fact: IFact; score: number }>; |
- |
neighbors? |
neighbors?: Neighborhood; |
- |
EvidencePluginConfig interface
📍 src/core/context-nextgen/plugins/EvidencePluginNextGen.ts:11
Properties
| Property | Type | Description |
|---|---|---|
storage? |
storage?: IEvidenceStorage; |
- |
scope? |
scope?: EvidenceScope; |
- |
maxRecentReceipts? |
maxRecentReceipts?: number; |
Bounded recent diagnostics in prompt/snapshot. Full records are discovered with evidence_list. Default 20. |
ExcelToMarkdownKVOptions interface
📍 src/capabilities/documents/handlers/ExcelHandler.ts:307
Properties
| Property | Type | Description |
|---|---|---|
maxRows? |
maxRows?: number; |
- |
maxColumns? |
maxColumns?: number; |
- |
includeFormulas? |
includeFormulas?: boolean; |
- |
ExecuteRoutineOptions interface
📍 src/core/routineRunner.ts:98
Options for executing a routine.
Two modes:
- New agent: Pass
connector+model(+ optionaltools,hooks). An agent is created internally and destroyed after execution. - Existing agent: Pass
agent(a pre-created Agent instance). The agent is NOT destroyed after execution — caller owns its lifecycle. The agent's existing connector, model, tools, and hooks are used.
Tool scoping (Mode 2 + definition.requiredTools): when the caller
passes an agent AND the routine declares requiredTools, the runner
builds a scoped executor via existingAgent.scopedTo(requiredTools) and
runs the routine on that. The caller's superagent stays untouched; the
scoped executor is destroyed at end of run. The scoped executor uses
default context features (working memory, in-context memory) and does NOT
inherit the caller's plugins — routines that need plugins must declare
them in requiredPlugins.
Properties
| Property | Type | Description |
|---|---|---|
definition |
definition: RoutineDefinition; |
Routine definition to execute |
agent? |
agent?: Agent; |
Pre-created Agent instance. When provided, connector/model/tools are ignored. |
| The agent is NOT destroyed after execution — caller manages its lifecycle. | ||
connector? |
connector?: string; |
Connector name — required when agent is not provided |
model? |
model?: string; |
Model ID — required when agent is not provided |
tools? |
tools?: ToolFunction[]; |
Additional tools — only used when creating a new agent (no agent provided) |
inputs? |
inputs?: Record<string, unknown>; |
Input parameter values for parameterized routines |
disableToolScoping? |
disableToolScoping?: boolean; |
When true, skip the scopedTo(requiredTools) step in Mode 2. |
| The agent keeps its full tool surface during the routine, so preSteps / | ||
| postSteps may use any tool registered on the agent — not only those | ||
listed in definition.requiredTools. |
requiredTools is still validated as a "must be present" gate; this
flag only disables the restriction of the agent's runtime toolset.
Use when the routine's preSteps invoke tools the LLM tasks don't need,
and listing every such tool in requiredTools would be misleading
(e.g. internal context-loading tools the LLM should not see directly).
Defaults to false — scoping ON is the safer default. |
| initialUserMessage? | initialUserMessage?: string; | Optional verbatim user message used in place of the FIRST executable
task's prompt. Subsequent tasks still go through the normal
prompts.task (or default) builder.
Use for caller-driven kickoff — e.g. "execute the selected action" — where the routine's first step shouldn't follow the routine's own templating. Retries of the first task re-use this message; only when the routine advances to the next task does the default builder kick in.
For pre-loading context into the system prompt, callers should bake it
into agent.instructions themselves at agent-creation time (Mode 2) or
into prompts.system (Mode 1) — the library does not own that surface. |
| hooks? | hooks?: HookConfig; | Hooks — applied to agent for the duration of routine execution.
For new agents: baked in at creation. For existing agents: registered before
execution and unregistered after. |
| onTaskStarted? | onTaskStarted?: (task: Task, execution: RoutineExecution) => void; | Called when a task starts executing (set to in_progress) |
| onTaskComplete? | onTaskComplete?: (task: Task, execution: RoutineExecution) => void; | Called when a task completes successfully |
| onTaskFailed? | onTaskFailed?: (task: Task, execution: RoutineExecution) => void; | Called when a task fails |
| onTaskValidation? | onTaskValidation?: (task: Task, result: TaskValidationResult, execution: RoutineExecution) => void; | Called after each validation attempt (whether pass or fail) |
| onStepStarted? | onStepStarted?: (step: DeterministicStep, phase: 'pre' | 'post', index: number, execution: RoutineExecution) => void; | Called when a deterministic step starts executing |
| onStepComplete? | onStepComplete?: (step: DeterministicStep, phase: 'pre' | 'post', index: number, result: unknown, execution: RoutineExecution) => void; | Called when a deterministic step completes successfully |
| onStepFailed? | onStepFailed?: (step: DeterministicStep, phase: 'pre' | 'post', index: number, error: Error, execution: RoutineExecution) => void; | Called when a deterministic step fails |
| prompts? | prompts?: { /** Override system prompt builder. Receives definition, should return full system prompt. */ system?: (definition: RoutineDefinition) => string; /** Override task prompt builder. Receives task and optional execution context, should return the user message for that task. */ task?: (task: Task, execution?: RoutineExecution) => string; /** Override validation prompt builder. Receives task + validation context (response, memory state, tool calls). */ validation?: (task: Task, context: ValidationContext) => string; }; | Configurable prompts (all have sensible defaults) |
ExecutionBinding interface
📍 src/core/execution/composition.ts:11
Private until the complete verified facade is delivered. Never serialized.
Properties
| Property | Type | Description |
|---|---|---|
modelTask? |
modelTask?: ModelTask; |
- |
signal? |
signal?: AbortSignal |
- |
ExecutionConfig interface
📍 src/capabilities/agents/types/EventTypes.ts:14
Minimal config type for execution start events. This captures the essential info without importing full AgentConfig.
Properties
| Property | Type | Description |
|---|---|---|
model |
model: string; |
- |
instructions? |
instructions?: string; |
- |
temperature? |
temperature?: number; |
- |
maxIterations? |
maxIterations?: number; |
- |
ExecutionRecorder interface
📍 src/core/createExecutionRecorder.ts:51
Properties
| Property | Type | Description |
|---|---|---|
hooks |
hooks: HookConfig; |
Hook config to pass to executeRoutine(). |
onTaskStarted |
onTaskStarted: (task: Task, execution: RoutineExecution) => void; |
Callback for onTaskStarted. |
onTaskComplete |
onTaskComplete: (task: Task, execution: RoutineExecution) => void; |
Callback for onTaskComplete. |
onTaskFailed |
onTaskFailed: (task: Task, execution: RoutineExecution) => void; |
Callback for onTaskFailed. |
onTaskValidation |
onTaskValidation: (task: Task, result: TaskValidationResult, execution: RoutineExecution) => void; |
Callback for onTaskValidation. |
onStepStarted |
`onStepStarted: (step: DeterministicStep, phase: 'pre' | 'post', index: number, execution: RoutineExecution) => void;` |
onStepComplete |
`onStepComplete: (step: DeterministicStep, phase: 'pre' | 'post', index: number, result: unknown, execution: RoutineExecution) => void;` |
onStepFailed |
`onStepFailed: (step: DeterministicStep, phase: 'pre' | 'post', index: number, error: Error, execution: RoutineExecution) => void;` |
finalize |
`finalize: (execution: RoutineExecution | null, error?: Error) => Promise<void>;` |
ExecutionRecorderOptions interface
📍 src/core/createExecutionRecorder.ts:40
Properties
| Property | Type | Description |
|---|---|---|
storage |
storage: IRoutineExecutionStorage; |
Storage backend for persisting execution state. |
executionId |
executionId: string; |
ID of the execution record (must already be inserted). |
logPrefix? |
logPrefix?: string; |
Optional prefix for log messages. |
maxTruncateLength? |
maxTruncateLength?: number; |
Max length for truncated tool args/results in steps. Default: 500. |
ExportAgentPackageOptions interface
Properties
| Property | Type | Description |
|---|---|---|
packageId? |
packageId?: string; |
- |
expiresAt? |
`expiresAt?: string | Date;` |
revision? |
`revision?: string | number;` |
metadata? |
metadata?: Record<string, unknown>; |
- |
realtime? |
realtime?: PortableRealtimeProfile; |
- |
instructionTemplate? |
instructionTemplate?: string; |
Explicit unrendered instruction template. Required when the Agent's |
| instructions were installed by mutating its context after construction. | ||
toolPlacement? |
toolPlacement?: PortableToolPlacementResolver; |
Tools default to remote because executable functions cannot cross a wire. |
toolImplementationFingerprint? |
`toolImplementationFingerprint?: ( |
toolName: string,
definition: FunctionToolDefinition,
) => string | undefined;| Supply the authoritative implementation fingerprint for custom local tools. Generated built-ins are fingerprinted automatically; remote tools do not require an implementation-specific value. | |pluginNames?|pluginNames?: string[];` | Override the plugin set that the receiving context must provide. |
ExtendedFetchOptions interface
📍 src/capabilities/shared/types.ts:49
Extended fetch options with JSON body and query params support Usable by any capability that makes HTTP requests via Connector
Properties
| Property | Type | Description |
|---|---|---|
body? |
body?: Record<string, any>; |
JSON body (will be stringified automatically) |
queryParams? |
`queryParams?: Record<string, string | number |
ExtractedSignal interface
📍 src/memory/integration/signals/types.ts:98
Normalized signal shape — adapters reduce every source format to this.
Properties
| Property | Type | Description |
|---|---|---|
signalText |
signalText: string; |
Body text handed to the LLM. Strip out headers / noise if they don't carry knowledge. |
signalSourceDescription? |
signalSourceDescription?: string; |
Short human description, e.g. "Email from anton@everworker.ai to sarah@everworker.ai". |
participants |
participants: ParticipantSeed[]; |
Deterministic entity seeds derived from metadata. May be empty. |
seedFacts? |
seedFacts?: SeedFact[]; |
Deterministic facts derived from signal metadata, written after seed |
| entities are resolved. Useful when the relationship is guaranteed by the | ||
| source (e.g. calendar organizer/attendee) and shouldn't depend on the | ||
LLM extracting it. Unresolved role references produce IngestionError |
||
| entries; the rest still write. Optional. | ||
observedAt? |
observedAt?: Date; |
Authoritative source timestamp for THIS signal's content — the email |
Date header, the transcript createdDateTime, the calendar event's |
||
startTime, the doc's createdAt. NOT the time the adapter ran. |
When set, the SignalIngestor propagates it to the extraction prompt as
referenceDate (so the LLM resolves "Wednesday" against the right week)
and to the resolver as sourceObservedAt (so every written fact's
observedAt and validUntil anchor on the content date, not extraction
time). Strongly recommended for any adapter whose source has a date. |
ExtractionFactSpec interface
📍 src/memory/integration/ExtractionResolver.ts:70
Properties
| Property | Type | Description |
|---|---|---|
subject |
subject: string; |
- |
predicate |
predicate: string; |
- |
object? |
object?: string; |
- |
value? |
value?: unknown; |
- |
details? |
details?: string; |
- |
summaryForEmbedding? |
summaryForEmbedding?: string; |
- |
confidence? |
confidence?: number; |
- |
importance? |
importance?: number; |
- |
contextIds? |
contextIds?: string[]; |
- |
kind? |
kind?: FactKind; |
- |
validFrom? |
`validFrom?: string | Date;` |
validUntil? |
`validUntil?: string | Date;` |
observedAt? |
`observedAt?: string | Date;` |
evidenceQuote? |
evidenceQuote?: string; |
Verbatim quote from the source signal supporting this fact. Required |
under EagernessProfile.requireEvidenceQuote = 'strict' (filtered by |
||
RestrainedExtractionContract); pass-through otherwise. Stored on the |
||
written fact as IFact.evidenceQuote. |
ExtractionMention interface
📍 src/memory/integration/ExtractionResolver.ts:39
Properties
| Property | Type | Description |
|---|---|---|
surface |
surface: string; |
- |
type |
type: string; |
- |
identifiers? |
identifiers?: Identifier[]; |
- |
aliases? |
aliases?: string[]; |
- |
metadata? |
metadata?: Record<string, unknown>; |
Type-specific fields the LLM extracted alongside the mention (e.g. |
{ state: 'proposed', dueAt: '2026-04-30', assigneeId: 'm1' } for a task). |
||
Flows through upsertEntityBySurface.metadata — on create, set verbatim; |
||
on resolve, conservative fillMissing merge (never overwrites existing). |
||
contextIds? |
contextIds?: string[]; |
Multi-entity binding labels — local mention labels (e.g. `["m_acme", |
| "t_q3_meeting"]`) the entity "lives within". Translated to entity ids in | ||
Pass 1.6 of resolveAndIngest (after all mentions have been resolved so |
||
| forward references work) and unioned into the entity's | ||
IEntity.contextIds field via MemorySystem.addEntityContextIds. |
Conventional consumers: task/event/topic mentions. The LLM emits at the
top level of the mention object, NOT inside metadata (which would
collide with the metadata.contextIds path the older prompt suggested
and persist label placeholders).
Unresolved labels are silently dropped (logged in unresolved[]).
Self-references and duplicates are filtered. Visibility is enforced
downstream by addEntityContextIds. |
ExtractionOutput interface
📍 src/memory/integration/ExtractionResolver.ts:203
Properties
| Property | Type | Description |
|---|---|---|
mentions |
mentions: Record<string, ExtractionMention>; |
- |
facts |
facts: ExtractionFactSpec[]; |
- |
operations? |
operations?: ReconciliationOp[]; |
Reconciliation ops — populated when LLM ran in reconciliation mode. |
ExtractionPromptContext interface
📍 src/memory/integration/defaultExtractionPrompt.ts:170
Properties
| Property | Type | Description |
|---|---|---|
signalText? |
signalText?: string; |
Raw text of the signal (email body, transcript, doc content, …). |
Required when signalThread is not provided. When signalThread is set
(per-conversation reconciliation mode), this field is ignored — the
thread rendering replaces the single-signal block. |
| signalThread? | signalThread?: SignalThreadMessage[]; | Multi-signal conversation input. When set, the prompt renders these
messages chronologically in place of signalText. Use this for
per-conversation reconciliation; leave undefined for single-signal
extraction (current behavior, unchanged for backward compat). |
| signalSourceDescription? | signalSourceDescription?: string; | Optional hint describing where this came from, e.g. "email from john@acme.com". |
| targetScope? | targetScope?: ScopeFields; | Scope the extractor should treat as target — guides the LLM's privacy judgment. |
| knownEntities? | knownEntities?: IEntity[]; | Optional pre-loaded entity candidates the extractor can reference by name. |
| referenceDate? | referenceDate?: Date; | Reference date for interpreting relative dates ("next Friday"). Defaults to today. |
| predicateRegistry? | predicateRegistry?: PredicateRegistry; | When present, the registry's vocabulary is rendered into the prompt so the
LLM learns the canonical predicate names + aliases + examples. The LLM may
still invent new predicates; unknowns canonicalize at write time and land
in IngestionResult.newPredicates for review. |
| maxPredicatesPerCategory? | maxPredicatesPerCategory?: number; | Cap on predicates shown per category (keeps prompt token budget bounded). Default 5. |
| preResolvedBindings? | preResolvedBindings?: PreResolvedBinding[]; | Labels already bound to entities upstream (typically by signal metadata
extraction). The prompt renders them as a locked vocabulary and instructs
the LLM to reference them directly in facts without redeclaring them. |
| eagerness? | eagerness?: EagernessProfile; | Restraint posture. When present, the prompt renders the corresponding
"Restraint" section that turns silence into the easy answer:
requireJustification→ adds a top-levelwhyActionablefield that is required only when output is non-empty.requireEvidenceQuote→ addsevidenceQuoteto each fact (soft: advised; strict: required).requirePriorityBinding→ renders the active anchors and asks forservesAnchorIdper task mention.negativeExamplesCount→ controls how many entries fromnegativeExamplesare rendered as "do NOT do this" patterns.
Omit eagerness to keep the v4 behavior (no Restraint section). |
| anchors? | anchors?: Anchor[]; | Active anchors (priorities, OKRs, focus areas) for the current extraction
context. Hosts may pass one user's anchors, a project/team anchor set, or
a merged participant-priority set for shared source processing. Surfaced
in the prompt only when eagerness.requirePriorityBinding !== 'off'. Each
anchor's id is what the LLM should echo back as servesAnchorId. |
| anchorContextDescription? | anchorContextDescription?: string; | Human-readable description of what anchors represent. Defaults to a
source-neutral phrase so shared-source processors do not have to pretend
the anchors belong to a single claimant user.
Example: "The active priorities for ICOS users participating in this email". |
| negativeExamples? | negativeExamples?: Array<{ snippet: string; reason?: string }>; | Recent dismissals to inject as negative examples. Rendered up to
eagerness.negativeExamplesCount. Each entry is a short snippet the user
already chose to ignore — strong calibration signal. |
| priorThreadContext? | priorThreadContext?: Array<{ header: string; body: string }>; | Prior conversation context (e.g. earlier emails in the same thread,
earlier turns in a transcript) that has ALREADY been extracted in
previous pipeline runs. Rendered as a clearly-labeled "DO NOT extract"
background block — the LLM must use it for grounding (resolving "she",
binding follow-up commitments to the original task) but MUST NOT emit
facts or mentions whose source is exclusively this prior content.
Each entry is a short header (e.g. From Anton at 2026-05-06T08:44Z)
plus the message body, ideally already de-quoted by the host so the
same sentence doesn't appear repeatedly across nested replies.
Pair with the existing canonical-id rule for tasks: a commitment seen in the delta that was already extracted from a prior message MUST yield the SAME canonical id, so the resolver merges into the existing entity instead of creating a duplicate.
Superseded by signalThread + priorFacts (reconciliation mode); kept
for backward compat with callers that still use single-signal extraction
with thread background. |
| priorFacts? | priorFacts?: IFact[]; | Facts already extracted from PRIOR signals on this same conversation/thread,
surfaced so the LLM can RECONCILE them against new content. When non-empty,
the prompt renders a "Prior facts to reconcile" block and instructs the
LLM to emit operations (create / update / archive) in addition to the
usual facts array.
Use this for per-conversation reconciliation: the LLM sees what's already known and decides what the new messages imply (status changed → update, reply needed → archive, brand-new commitment → create) without leaving tombstone-chain churn behind.
Each fact MUST be referenceable by id — the output operations array
cites these ids. Hallucinated ids are rejected at resolve time. |
| extractableEntityTypes? | extractableEntityTypes?: readonly string[]; | Allowlist of entity types the LLM may emit as mentions. Renders into the
mention-schema's type field AND the prompt intro's "entities of (…)"
list, so the LLM never sees types its host has dropped. Default keeps the
v12 surface (DEFAULT_EXTRACTABLE_ENTITY_TYPES).
Coverage notes — what is and isn't gated:
- Type-specific BULLETS in the entity-metadata example block (
task: {...},event: {...}) and Rule 4'sTask/Event/Topicbullet rows ARE gated. Dropeventand the event bullets disappear; droptopicand its bullet disappears. - Type-specific RELATIONAL hints like
prepares_for(task↔event)are gated oneventmembership. - Subject-of section + project-as-subject example ARE gated: removed
entirely when no non-person subject is allowed; the example falls
through
project → organization → topicbased on what's allowed.
CONTRACT — this prompt template assumes task is in the allowlist.
Task-specific guidance — "Tasks ARE the commitment record," the canonical-id
requirement, reporterId / state / assigneeId rules, the
committed_to-suppression instruction, and the over-decomposition negative
example — is rendered UNCONDITIONALLY. Hosts wanting an extraction surface
without Tasks should fork this template (the Decision-Queue product
posture is baked in too deeply for a runtime gate to clean up).
Pruning here is necessary but not sufficient — the host must also remove
the same types from its predicate registry's subjectTypes / objectTypes
so the predicate vocabulary stays coherent (a partners_with predicate
with subjectTypes:['organization'] is fine even if project is dropped,
but a hypothetical funded_by with subjectTypes:['project'] would be
dead weight). |
| subjectOfHintsEnabled? | subjectOfHintsEnabled?: boolean; | Opt into non-person-subject extraction guidance. Default false.
Production data shows the default extraction style is heavily
person-biased: most facts emerge as (person, predicate, otherEntity),
which starves projects, organizations, and events of descriptive content
about themselves. With ~zero atomic facts per organization in a real
tenant, the profile-regen threshold can never fire — extraction is the
structural bottleneck, not the threshold.
When true:
- The predicate registry renders grouped by
subjectTypes(so the LLM sees a "When the subject is aproject" bucket). - A "Subjects beyond persons" guidance section appears explaining when to emit a subject-of fact, with restraint still mandatory.
- A positive example shows project-as-subject extraction.
The registry MUST tag its predicates with subjectTypes for the grouping
to be useful — predicates without subjectTypes fall into a generic
bucket. Hosts that haven't tagged their registry yet should leave this
flag off; turning it on with a flat registry costs prompt tokens for
no extraction-quality gain. |
ExtractionResolverOptions interface
📍 src/memory/integration/ExtractionResolver.ts:245
Properties
| Property | Type | Description |
|---|---|---|
autoResolveThreshold? |
autoResolveThreshold?: number; |
Override per-upsert threshold (default: memory system's config). |
preResolved? |
preResolved?: Record<string, EntityId>; |
Pre-bound label → entityId map. When the LLM output references any of |
| these labels (as subject/object/contextId/mention), the resolver skips | ||
| upsert and uses the provided entity id directly. Intended for signal-level | ||
| metadata (email headers, calendar attendees) where identities are already | ||
| resolved upstream via strong identifiers — no need to round-trip through | ||
| the LLM. |
If the LLM output also contains a mention with the same label (e.g. it
ignored the prompt instruction not to redeclare), the pre-resolved binding
wins and the mention is skipped silently. |
| priorFacts? | priorFacts?: IFact[]; | Prior facts that were rendered into the prompt for reconciliation. When
set, the resolver:
- validates every
update/archiveop'sfactIdagainst this set (rejecting hallucinated ids); - dispatches the surviving ops through
memory.updateFact; - passes
dedup: trueto everycreateop so retries don't duplicate.
Leave undefined when calling extraction in fresh (non-reconciliation)
mode — the resolver then ignores any operations the LLM may have
emitted erroneously. |
| skepticFilter? | skepticFilter?: (op: ReconciliationOp) => boolean; | Optional skeptic-pass hook. When set, the resolver passes every
reconciliation op through this callback before dispatch. Return true
to accept, false to drop (counted as rejectedSkeptic). The host
normally implements skeptic-pass at a higher level — this hook lets the
library route ops through the same gate. |
| sourceObservedAt? | sourceObservedAt?: Date; | Authoritative observation timestamp for every fact written from this
extraction. Set to the SIGNAL'S source date — email Date header,
calendar event startTime, meeting transcript createdDateTime, doc
createdAt. NOT Date.now().
When set, this wins over any observedAt the LLM may emit and over the
MemorySystem.addFact ?? now fallback. It's also used to anchor
validUntil for ephemeral predicates (committed_to, expressed_concern,
etc.) so commitments observed in historical content expire on the right
schedule instead of looking fresh for 90 more days.
Strongly recommended whenever extracting from a signal that has a known
source timestamp. When undefined, the resolver logs a warning (once per
resolver instance) and falls back to the legacy behavior (LLM-emitted
observedAt, then Date.now()). For reconciliation update ops the
fallback is Date.now() only — ReconciliationOp of kind update
doesn't carry an observedAt field, so there's nothing to honor. |
| anchorIds? | anchorIds?: string[]; | Allowlist of raw entity ids the LLM may reference directly inside facts'
contextIds (and inside task metadata's servesAnchorId) without going
through the mention/pre-resolved label vocabulary. Designed for ANCHORS
(priorities, OKRs, focus areas) that the prompt's "Active priorities"
block exposes by raw id — the LLM is told to echo those ids verbatim,
so the resolver must accept them as legitimate.
Behavior:
- Fact
contextIdstranslation: when an entry is NOT in the local label map AND IS in this allowlist, the entry passes through as a raw entity id (no upsert, no resolve). Entries not in the label map AND not in this allowlist are dropped tounresolved(current behavior). - Mention
metadata.servesAnchorId(task): same fallback — fixes the pre-v13 silent-drop bug where the LLM emitted raw anchor ids per the prompt's<anchor_id>placeholder but the translator only looked up label-bound ids.
The caller is responsible for membership integrity — typically this is
anchors.map(a => a.id) from ExtractionPromptContext.anchors[], kept
in lock-step so the LLM sees the same ids the resolver accepts.
Empty or omitted → pre-v13 behavior (label translation only). |
| defaultAcl? | defaultAcl?: ACLEntry[]; | Default acl stamped on every newly-created fact AND every newly-created
entity produced by this extraction. The library passes it through verbatim
to memory.addFact and memory.upsertEntityBySurface — both write paths
already accept acl; materializePrincipals unions it with owner/group/
world so adding ACL grants never narrows existing visibility.
Designed for the host's "grant by signal participants" policy: an email extracted by user A creates Task/Topic entities AND facts visible to every tenant participant (sender + recipients + cc), letting other ICOS users on the same thread read the same content without re-extracting.
Semantics:
- Facts: applied uniformly to every fact newly written by this
extraction (Pass 2 creates + reconciliation
createops). There is no per-factaclchannel today —ExtractionFactSpechas noaclfield and the LLM never emits one. If per-fact granularity is needed later, addacl?: ACLEntry[]toExtractionFactSpecand switch the write site tospec.acl ?? opts.defaultAcl; until then this option is the sole source of fact-level ACL stamping. - Entities — new only: applied to each entity that the resolver
creates this extraction (
resolved: false). Existing-entity matches are NOT modified — pre-existingaclon a re-resolved entity stays intact (resolver never clobbers cross-signal access state). - Reconciliation
update/archive: unaffected. Those ops patch value/details/archived without touchingacl/readPrincipals, so facts retain their creation-time ACL across the lifetime.
Pass undefined (or omit) to keep pre-0.x behavior — facts and entities
inherit only the legacy owner/group/world principals from their scope.
The host is responsible for building the ACL — typically via a helper like
v25's buildParticipantReadAcl(participantPersonIds) which produces
{ principal: entity:<personId>, actions: ['read'] } entries. |
FactContentComposer interface
📍 src/memory/composers/types.ts:65
Compose the semantic content text for a fact. Same conventions as
EntityContentComposer. Receives the full IFact and can resolve
subjectId / objectId / contextIds to displayNames so even short
triples become semantically meaningful (e.g. "Sarah works_at Acme" instead
of "ent-abc works_at ent-xyz").
Return '' to skip embedding entirely — used by registries that don't want
to embed every atomic fact (cost guardrail).
Methods
compose()
compose(fact: IFact, ctx: ComposeContext): Promise<string>;
Parameters:
fact:IFactctx:ComposeContext
Returns: Promise<string>
FactFilter interface
Properties
| Property | Type | Description |
|---|---|---|
subjectId? |
subjectId?: EntityId; |
- |
objectId? |
objectId?: EntityId; |
- |
contextId? |
contextId?: EntityId; |
Matches facts where contextIds array includes this entity id. |
touchesEntity? |
touchesEntity?: EntityId; |
OR-wildcard entity match — returns facts where this id appears as |
subject, object, OR in contextIds. Used by getContext for the |
||
| "everything about X" query. | ||
predicate? |
predicate?: string; |
- |
predicates? |
predicates?: string[]; |
- |
kind? |
kind?: FactKind; |
- |
sourceSignalId? |
sourceSignalId?: string; |
Match facts whose sourceSignalId equals this id — i.e. all facts that |
| were extracted from one specific source signal (an email, a calendar | ||
| event, a meeting transcript, etc.). The signal id is opaque from the | ||
| library's point of view; the embedding application is responsible for | ||
| resolving "this meeting" / "this email" → signal id. | ||
archived? |
archived?: boolean; |
Defaults to false (archived rows hidden). Pass true to include only archived, or undefined for default. |
minConfidence? |
minConfidence?: number; |
- |
observedAfter? |
observedAfter?: Date; |
- |
observedBefore? |
observedBefore?: Date; |
- |
asOf? |
asOf?: Date; |
Temporal filter: validFrom ≤ asOf ≤ (validUntil ?? ∞) AND createdAt ≤ asOf. |
validUntilBefore? |
validUntilBefore?: Date; |
Match facts whose validUntil is set AND strictly less than this date. |
Used by MemorySystem.expireFacts to find facts past their validity |
||
window. Facts with no validUntil are NEVER matched by this filter — |
||
| they are valid forever by design. | ||
supersedes? |
supersedes?: FactId; |
Match facts whose supersedes field equals this fact id. Used by |
restoreFact to detect an existing non-archived successor before |
||
un-archiving a previously superseded predecessor. Pass null to match |
||
facts with no supersedes (not currently supported — implement only if |
||
| needed). |
FactOrderBy interface
Properties
| Property | Type | Description |
|---|---|---|
field |
`field: 'observedAt' | 'createdAt' |
| adapter's unique, immutable primary key — a TOTAL order with no ties. Use it | ||
| when a caller must iterate every fact exactly once under offset pagination | ||
(e.g. backfillAccessPrincipals): createdAt can tie for bulk-ingested |
||
| facts, and Mongo's order among ties isn't stable across paged queries, so a | ||
boundary row can be skipped or double-read. _id removes that hazard. |
||
direction |
`direction: 'asc' | 'desc';` |
FactQueryOptions interface
Properties
| Property | Type | Description |
|---|---|---|
orderBy? |
orderBy?: FactOrderBy; |
- |
limit? |
limit?: number; |
- |
cursor? |
cursor?: string; |
- |
FetchedContent interface
📍 src/capabilities/researchAgent/types.ts:51
Fetched content from a source
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
Whether fetch succeeded |
reference |
reference: string; |
Reference that was fetched |
content |
content: unknown; |
The actual content |
contentType? |
contentType?: string; |
Content type hint (text, html, json, binary, etc.) |
sizeBytes? |
sizeBytes?: number; |
Size in bytes |
error? |
error?: string; |
Error message if failed |
metadata? |
metadata?: Record<string, unknown>; |
Source-specific metadata |
FetchOptions interface
📍 src/capabilities/researchAgent/types.ts:83
Options for fetch operations
Properties
| Property | Type | Description |
|---|---|---|
maxSize? |
maxSize?: number; |
Maximum content size to fetch (bytes) |
timeoutMs? |
timeoutMs?: number; |
Timeout in milliseconds |
sourceOptions? |
sourceOptions?: Record<string, unknown>; |
Source-specific options |
FindCandidatesOptions interface
Properties
| Property | Type | Description |
|---|---|---|
k? |
k?: number; |
Maximum candidates per source. Default 20. |
includeSemantic? |
includeSemantic?: boolean; |
Include semantic-tier matches via identityEmbedding. Default true. |
minSemanticScore? |
minSemanticScore?: number; |
Minimum cosine for a semantic-tier match. Default 0.70. |
FindClustersOptions interface
Properties
| Property | Type | Description |
|---|---|---|
type? |
type?: string; |
Only return clusters for this entity.type. Default: all types. |
minClusterSize? |
minClusterSize?: number; |
Minimum cluster size to return. Default 2 (anything with a duplicate). |
limit? |
limit?: number; |
Maximum number of clusters to return. Default 100. |
pageSize? |
pageSize?: number; |
Pagination through listEntities. Default 500. |
FindIdentifierClustersOptions interface
Properties
| Property | Type | Description |
|---|---|---|
kinds? |
kinds?: string[]; |
Restrict to specific identifier kinds. Default: all kinds. |
type? |
type?: string; |
Only return clusters of this entity type. Default: all types. |
minClusterSize? |
minClusterSize?: number; |
Minimum cluster size to return. Default 2. |
limit? |
limit?: number; |
Maximum clusters returned. Default 100. |
pageSize? |
pageSize?: number; |
Pagination through listEntities. Default 500. |
FormatDetectionResult interface
📍 src/capabilities/documents/types.ts:224
Properties
| Property | Type | Description |
|---|---|---|
format |
format: DocumentFormat; |
- |
family |
family: DocumentFamily; |
- |
mimeType |
mimeType: string; |
- |
confidence |
`confidence: 'high' | 'medium' |
FunctionCallOutputItem interface
📍 src/domain/entities/Message.ts:61
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'function_call_output'; |
- |
call_id |
call_id: string; |
- |
output |
`output: string | ToolCallOutputContent[];` |
GitHubBranchEntry interface
📍 src/tools/github/types.ts:316
A branch entry
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
- |
sha |
sha: string; |
- |
protected |
protected: boolean; |
- |
GitHubCreatePRResult interface
📍 src/tools/github/types.ts:335
Result from create_pr tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
data? |
`data?: { |
number: number;
url: string;
state: string;
title: string;
};| - | |error?|error?: string;` | - |
GitHubGetPRResult interface
📍 src/tools/github/types.ts:248
Result from get_pr tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
data? |
`data?: { |
number: number;
title: string;
body: string | null;
state: string;
author: string;
labels: string[];
reviewers: string[];
mergeable: boolean | null;
head: string;
base: string;
url: string;
created_at: string;
updated_at: string;
additions: number;
deletions: number;
changed_files: number;
draft: boolean;
};| - | |error?|error?: string;` | - |
GitHubListBranchesResult interface
📍 src/tools/github/types.ts:325
Result from list_branches tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
branches? |
branches?: GitHubBranchEntry[]; |
- |
count? |
count?: number; |
- |
error? |
error?: string; |
- |
GitHubPRCommentEntry interface
📍 src/tools/github/types.ts:292
A unified comment/review entry
Properties
| Property | Type | Description |
|---|---|---|
id |
id: number; |
- |
type |
`type: 'review' | 'comment' |
author |
author: string; |
- |
body |
body: string; |
- |
created_at |
created_at: string; |
- |
path? |
path?: string; |
- |
line? |
line?: number; |
- |
state? |
state?: string; |
- |
GitHubPRCommentsResult interface
📍 src/tools/github/types.ts:306
Result from pr_comments tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
comments? |
comments?: GitHubPRCommentEntry[]; |
- |
count? |
count?: number; |
- |
error? |
error?: string; |
- |
GitHubPRFilesResult interface
📍 src/tools/github/types.ts:275
Result from pr_files tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
files? |
`files?: { |
filename: string;
status: string;
additions: number;
deletions: number;
changes: number;
patch?: string;
}[];| - | |count?|count?: number;| - | |error?|error?: string;` | - |
GitHubReadFileResult interface
📍 src/tools/github/types.ts:234
Result from read_file tool (GitHub variant)
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
content? |
content?: string; |
- |
path? |
path?: string; |
- |
size? |
size?: number; |
- |
lines? |
lines?: number; |
- |
truncated? |
truncated?: boolean; |
- |
sha? |
sha?: string; |
- |
error? |
error?: string; |
- |
GitHubRepository interface
📍 src/tools/github/types.ts:17
Parsed GitHub repository reference
Properties
| Property | Type | Description |
|---|---|---|
owner |
owner: string; |
- |
repo |
repo: string; |
- |
GitHubSearchCodeResult interface
📍 src/tools/github/types.ts:223
Result from search_code tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
matches? |
matches?: { file: string; fragment?: string }[]; |
- |
count? |
count?: number; |
- |
truncated? |
truncated?: boolean; |
- |
error? |
error?: string; |
- |
GitHubSearchFilesResult interface
📍 src/tools/github/types.ts:212
Result from search_files tool
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
files? |
files?: { path: string; size: number; type: string }[]; |
- |
count? |
count?: number; |
- |
truncated? |
truncated?: boolean; |
- |
error? |
error?: string; |
- |
GlobResult interface
📍 src/tools/filesystem/types.ts:130
Result of a glob operation
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
files? |
files?: string[]; |
- |
count? |
count?: number; |
- |
truncated? |
truncated?: boolean; |
- |
error? |
error?: string; |
- |
GrepMatch interface
📍 src/tools/filesystem/types.ts:141
A single grep match
Properties
| Property | Type | Description |
|---|---|---|
file |
file: string; |
- |
line |
line: number; |
- |
column? |
column?: number; |
- |
content |
content: string; |
- |
context? |
`context?: { |
before: string[];
after: string[];
};` | - |
GrepResult interface
📍 src/tools/filesystem/types.ts:155
Result of a grep operation
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
matches? |
matches?: GrepMatch[]; |
- |
filesSearched? |
filesSearched?: number; |
- |
filesMatched? |
filesMatched?: number; |
- |
totalMatches? |
totalMatches?: number; |
- |
truncated? |
truncated?: boolean; |
- |
error? |
error?: string; |
- |
GrokRealtimeClientSecret interface
📍 src/capabilities/voice/grok/GrokRealtimeAPI.ts:3
Properties
| Property | Type | Description |
|---|---|---|
value |
value: string; |
- |
expires_at |
expires_at: number; |
- |
HelperCallOptions interface
📍 src/core/model-execution/types.ts:63
Properties
| Property | Type | Description |
|---|---|---|
maxOutputTokens? |
maxOutputTokens?: number; |
Optional tighter output cap; cannot increase the configured role limit. |
contextTransfer? |
contextTransfer?: boolean; |
- |
schema |
schema: Record<string, unknown>; |
Host-supplied JSON schema, validated locally after generation. |
validationSchema? |
validationSchema?: Record<string, unknown>; |
Additional local JSON-schema constraints supplied as prompt guidance; both schemas must pass within the same repair allowance. |
modelTask? |
modelTask?: ModelTask; |
Explicit sharing only; omission creates an independent owned helper task. |
parentInvocationId? |
parentInvocationId?: string; |
- |
signal? |
signal?: AbortSignal; |
- |
maxRepairAttempts? |
`maxRepairAttempts?: 0 | 1;` |
HelperInputContext interface
📍 src/core/model-execution/types.ts:56
Properties
| Property | Type | Description |
|---|---|---|
connector |
readonly connector: string; |
- |
model |
readonly model: string; |
- |
maxInputTokens |
readonly maxInputTokens: number; |
- |
maxOutputTokens |
readonly maxOutputTokens: number; |
- |
HelperResult interface
📍 src/core/model-execution/types.ts:80
Properties
| Property | Type | Description |
|---|---|---|
value |
value: T; |
- |
response |
response: LLMResponse; |
- |
invocationId |
invocationId: string; |
- |
taskId |
taskId: string; |
- |
HookConfig interface
📍 src/capabilities/agents/types/HookTypes.ts:127
Properties
| Property | Type | Description |
|---|---|---|
'before:execution'? |
'before:execution'?: Hook<BeforeExecutionContext, void>; |
- |
'after:execution'? |
'after:execution'?: Hook<AfterExecutionContext, void>; |
- |
'before:llm'? |
'before:llm'?: ModifyingHook<BeforeLLMContext, LLMModification>; |
- |
'after:llm'? |
'after:llm'?: ModifyingHook<AfterLLMContext, {}>; |
- |
'before:tool'? |
'before:tool'?: ModifyingHook<BeforeToolContext, ToolModification>; |
- |
'after:tool'? |
'after:tool'?: ModifyingHook<AfterToolContext, ToolResultModification>; |
- |
'approve:tool'? |
'approve:tool'?: Hook<ApproveToolContext, ApprovalResult>; |
- |
'pause:check'? |
'pause:check'?: Hook<PauseCheckContext, PauseDecision>; |
- |
hookTimeout? |
hookTimeout?: number; |
- |
parallelHooks? |
parallelHooks?: boolean; |
- |
HTTPTransportConfig interface
📍 src/domain/entities/MCPConfig.ts:29
HTTP/HTTPS transport configuration (StreamableHTTP)
Properties
| Property | Type | Description |
|---|---|---|
url |
url: string; |
HTTP(S) endpoint URL |
token? |
token?: string; |
Authentication token (supports ${ENV_VAR} interpolation) |
headers? |
headers?: Record<string, string>; |
Additional HTTP headers |
timeoutMs? |
timeoutMs?: number; |
Request timeout in milliseconds |
sessionId? |
sessionId?: string; |
Session ID for reconnection |
reconnection? |
`reconnection?: { |
/** Max reconnection delay in ms (default: 30000) */
maxReconnectionDelay?: number;
/** Initial reconnection delay in ms (default: 1000) */
initialReconnectionDelay?: number;
/** Reconnection delay growth factor (default: 1.5) */
reconnectionDelayGrowFactor?: number;
/** Max retry attempts (default: 2) */
maxRetries?: number;
};` | Reconnection options |
HydrateOptions interface
📍 src/tools/custom-tools/hydrate.ts:16
Properties
| Property | Type | Description |
|---|---|---|
defaultTimeout? |
defaultTimeout?: number; |
Default execution timeout in ms. Default: 10000 |
maxTimeout? |
maxTimeout?: number; |
Maximum execution timeout in ms. Default: 30000 |
ICapabilityProvider interface
📍 src/capabilities/shared/types.ts:36
Base interface for all capability providers
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Provider name |
connector |
readonly connector: Connector; |
Connector used for authentication |
IChunkingStrategy interface
📍 src/capabilities/speech/types.ts:18
Interface for text chunking strategies used by VoiceStream. Implementations accumulate streaming text deltas and emit complete chunks suitable for TTS synthesis.
Methods
feed()
Feed a text delta from the stream. Returns any completed chunks (sentences/phrases). Keeps partial text in an internal buffer.
feed(delta: string): string[];
Parameters:
delta:string
Returns: string[]
flush()
Flush remaining buffered text as a final chunk. Called when the text stream ends.
flush(): string | null;
Returns: string | null
reset()
Reset internal state for reuse
reset(): void;
Returns: void
ICompactionStrategy interface
📍 src/core/context-nextgen/types.ts:1242
Compaction strategy interface.
Strategies implement two methods:
compact(): Emergency compaction when thresholds exceeded (called from prepare())consolidate(): Post-cycle cleanup and optimization (called after agentic loop)
Use compact() for quick, threshold-based token reduction.
Use consolidate() for more expensive operations like summarization.
Methods
compact()
Emergency compaction - triggered when content usage exceeds the context critical gate. The strategy threshold controls how far to reclaim, not when preparation triggers.
Should be fast and focus on freeing tokens quickly.
compact(context: CompactionContext, targetToFree: number): Promise<CompactionResult>;
Parameters:
context:CompactionContexttargetToFree:number
Returns: Promise<CompactionResult>
consolidate()
Post-cycle consolidation - run after agentic cycle completes. Called from Agent after run()/stream() finishes (before session save).
Use for more expensive operations:
- Summarizing long conversations
- Memory optimization and deduplication
- Promoting important data to persistent storage
consolidate(context: CompactionContext): Promise<ConsolidationResult>;
Parameters:
context:CompactionContext
Returns: Promise<ConsolidationResult>
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Strategy name (unique identifier) for identification and logging |
displayName |
readonly displayName: string; |
Human-readable display name for UI |
description |
readonly description: string; |
Description explaining the strategy behavior |
threshold |
readonly threshold: number; |
Reclaim threshold (0-1); the context critical gate decides when compact() runs. |
requiredPlugins? |
readonly requiredPlugins?: readonly string[]; |
Plugin names this strategy requires to function. |
| Validation is performed when strategy is assigned to context. | ||
| Missing recommendations produce a warning; strategies own missing-plugin behavior. | ||
| Transactional built-ins require source retention; legacy built-ins may degrade. |
IContextPluginNextGen interface
📍 src/core/context-nextgen/types.ts:187
Context plugin interface for NextGen context management.
Implementing a Custom Plugin
- Extend BasePluginNextGen - provides token caching helpers
- Implement getInstructions() - return LLM usage guide (static, cached)
- Implement getContent() - return formatted content (Markdown with
##header) - Call updateTokenCache() - after any state change that affects content
- Implement getTools() - return tools with
<plugin_prefix>_*naming
Plugin Contributions
Plugins provide three types of content to the system message:
- Instructions - static usage guide for the LLM (NEVER compacted)
- Content - dynamic plugin data/state (may be compacted)
- Tools - registered with ToolManager (NEVER compacted)
Token Cache Lifecycle
Plugins must track their own token size for budget calculation. The pattern:
// When state changes:
this._entries.set(key, value);
this.invalidateTokenCache(); // Clear cached size
// In getContent():
const content = this.formatContent();
this.updateTokenCache(this.estimator.estimateTokens(content)); // Update cache
return content;
Content Format
getContent() should return Markdown with a descriptive header:
## Plugin Display Name (optional stats)
Formatted content here...
- Entry 1: value
- Entry 2: value
Built-in plugins use these headers:
- WorkingMemory:
## Notes (N entries) - InContextMemory:
## Whiteboard (N entries) - PersistentInstructions: No header (user's raw instructions)
Tool Naming Convention
Use a consistent prefix based on plugin name:
Plugins implementing IStoreHandler share the unified store_* tools, routed
by store ID: notes, whiteboard, or instructions. Other plugins use their
own consistent tool prefix.
State Serialization
getState() and restoreState() are synchronous for simplicity.
If your plugin has async data, consider:
- Storing only references/keys in state
- Using a separate async initialization method
Example:
class MyPlugin extends BasePluginNextGen {
readonly name = 'my_plugin';
private _data = new Map<string, string>();
getInstructions(): string {
return '## My Plugin\n\nUse my_plugin_set to store data...';
}
async getContent(): Promise<string | null> {
if (this._data.size === 0) return null;
const lines = [...this._data].map(([k, v]) => `- ${k}: ${v}`);
const content = `## My Plugin (${this._data.size} entries)\n\n${lines.join('\n')}`;
this.updateTokenCache(this.estimator.estimateTokens(content));
return content;
}
getTools(): ToolFunction[] {
return [myPluginSetTool, myPluginGetTool];
}
getState(): unknown {
return { data: Object.fromEntries(this._data) };
}
restoreState(state: unknown): void {
const s = state as { data: Record<string, string> };
this._data = new Map(Object.entries(s.data || {}));
this.invalidateTokenCache();
}
}
Methods
getInstructions()
Get usage instructions for the LLM.
Returns static text explaining how to use this plugin's tools and data. This is placed in the system message and is NEVER compacted - it persists throughout the conversation.
Instructions should include:
- What the plugin does
- How to use available tools
- Best practices and conventions
getInstructions(): string | null;
Returns: string | null
getContent()
Get formatted content to include in system message.
Returns the plugin's current state formatted for LLM consumption.
Should be Markdown with a ## Header. This content CAN be compacted
if isCompactable() returns true.
IMPORTANT: Call updateTokenCache() with the content's token size
before returning to keep budget calculations accurate.
getContent(): Promise<string | null>;
Returns: Promise<string | null>
getContents()
Get the full raw contents of this plugin for inspection.
Used by library clients to programmatically inspect plugin state. Returns the actual data structure, not the formatted string.
getContents(): unknown;
Returns: unknown
getTokenSize()
Get current token size of plugin content.
Returns the cached token count from the last updateTokenCache() call.
This is used for budget calculation in prepare().
The cache should be updated via updateTokenCache() whenever content
changes. If cache is null, returns 0.
getTokenSize(): number;
Returns: number
getInstructionsTokenSize()
Get token size of instructions (cached after first call).
Instructions are static, so this is computed once and cached. Used for budget calculation.
getInstructionsTokenSize(): number;
Returns: number
isCompactable()
Whether this plugin's content can be compacted when context is tight.
Return true if the plugin can reduce its content size when requested. Examples: evicting low-priority entries, summarizing, removing old data.
Return false if content cannot be reduced (e.g., critical state).
isCompactable(): boolean;
Returns: boolean
compact()
Compact plugin content to free tokens.
Called by compaction strategies when context is too full.
Should attempt to free approximately targetTokensToFree tokens.
This is a best effort operation:
- May free more or less than requested
- May return 0 if nothing can be compacted (e.g., all entries are critical)
- Should prioritize removing lowest-priority/oldest data first
Strategies may include:
- Evicting low-priority entries
- Summarizing verbose content
- Removing oldest data
- Truncating large values
IMPORTANT: Call invalidateTokenCache() or updateTokenCache()
after modifying content.
compact(targetTokensToFree: number): Promise<number>;
Parameters:
targetTokensToFree:number
Returns: Promise<number>
prepare()?
Force any lazy initialization to complete.
Called by the routine runner before deterministic pre-steps execute, so
tools the plugin contributes can rely on the plugin's bootstrapped state
(e.g. MemoryPluginNextGen.userEntityId, which resolves the me subject
token). Without this, pre-steps that invoke a plugin's tools BEFORE the
first getContent() call would see uninitialised state.
Implementations must be idempotent — prepare() may be called multiple
times across an agent's lifetime; each call after the first should be a
no-op (or return the same in-flight promise).
Optional: plugins with no lazy state need not implement it.
prepare?(): Promise<void>;
Returns: Promise<void>
getTools()
Get tools provided by this plugin.
Tools are automatically registered with ToolManager when the plugin
is added to the context. Use a consistent naming convention:
<prefix>_<action> (e.g., memory_store, context_set).
getTools(): ToolFunction[];
Returns: ToolFunction<any, any>[]
destroy()
Cleanup resources when context is destroyed.
Called when AgentContextNextGen.destroy() is invoked. Use for releasing resources, closing connections, etc.
destroy(): void;
Returns: void
getState()
Serialize plugin state for session persistence.
MUST be synchronous. Return a JSON-serializable object representing the plugin's current state. This is called when saving a session.
For plugins with async data (e.g., external storage), return only references/keys here and handle async restoration separately.
getState(): unknown;
Returns: unknown
restoreState()
Restore plugin state from serialized data.
Called when loading a saved session. The state comes from a previous
getState() call on the same plugin type.
IMPORTANT: Call invalidateTokenCache() after restoring state
to ensure token counts are recalculated.
restoreState(state: unknown): void;
Parameters:
state:unknown
Returns: void
onBeforePrepare()?
Called at the top of AgentContextNextGen.prepare() — BEFORE system
message assembly, token budgeting, and compaction. Purpose: give
side-effect plugins (e.g. session-learning ingestors) a chance to
observe the accumulated conversation before compaction potentially
evicts messages.
The plugin receives a SNAPSHOT of the conversation messages and current
input at the time prepare() fires. Implementers should synchronously
capture what they need from the snapshot and kick off any async work —
this method is NOT awaited by prepare(), and the caller of prepare()
will proceed regardless. Throwing from this method is swallowed (logged)
so a failing side-effect plugin cannot break context preparation.
Default: no-op (most plugins don't need this).
onBeforePrepare?(snapshot: PluginPrepareSnapshot): void;
Parameters:
snapshot:PluginPrepareSnapshot
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Unique plugin name (used for lookup and tool prefixing) |
IContextSnapshot interface
📍 src/core/context-nextgen/snapshot.ts:21
Complete snapshot of an agent's context state.
Returned by AgentContextNextGen.getSnapshot() and BaseAgent.getSnapshot().
Properties
| Property | Type | Description |
|---|---|---|
available |
available: boolean; |
Whether the context is available (not destroyed) |
agentId |
agentId: string; |
Agent ID |
model |
model: string; |
Model name |
features |
features: ResolvedContextFeatures; |
Feature flags |
budget |
budget: ContextBudget; |
Token budget breakdown |
strategy |
strategy: string; |
Compaction strategy name |
messagesCount |
messagesCount: number; |
Number of messages in conversation history |
toolCallsCount |
toolCallsCount: number; |
Number of tool calls in conversation |
systemPrompt |
`systemPrompt: string | null;` |
plugins |
plugins: IPluginSnapshot[]; |
All registered plugins with their current state |
tools |
tools: IToolSnapshot[]; |
All registered tools |
Identifier interface
A strong, uniqueness-bearing identifier for an entity. Aliases (on IEntity) are display hints — NOT identifiers.
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: string; |
e.g. 'email' |
value |
value: string; |
- |
isPrimary? |
isPrimary?: boolean; |
- |
verified? |
verified?: boolean; |
- |
source? |
source?: string; |
Which signal/source added this identifier. |
addedAt? |
addedAt?: Date; |
- |
IdentifierCluster interface
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: string; |
- |
value |
value: string; |
- |
entities |
entities: IEntity[]; |
- |
IDesktopDriver interface
📍 src/tools/desktop/types.ts:61
Methods
initialize()
Initialize the driver (dynamic import, permission checks, scale detection)
initialize(): Promise<void>;
Returns: Promise<void>
screenshot()
screenshot(region?: { x: number; y: number; width: number; height: number }): Promise<DesktopScreenshot>;
Parameters:
region:{ x: number; y: number; width: number; height: number; } | undefined(optional)
Returns: Promise<DesktopScreenshot>
getScreenSize()
getScreenSize(): Promise<DesktopScreenSize>;
Returns: Promise<DesktopScreenSize>
mouseMove()
mouseMove(x: number, y: number): Promise<void>;
Parameters:
x:numbery:number
Returns: Promise<void>
mouseClick()
mouseClick(x: number, y: number, button: MouseButton, clickCount: number): Promise<void>;
Parameters:
x:numbery:numberbutton:MouseButtonclickCount:number
Returns: Promise<void>
mouseDrag()
mouseDrag(startX: number, startY: number, endX: number, endY: number, button: MouseButton): Promise<void>;
Parameters:
startX:numberstartY:numberendX:numberendY:numberbutton:MouseButton
Returns: Promise<void>
mouseScroll()
mouseScroll(deltaX: number, deltaY: number, x?: number, y?: number): Promise<void>;
Parameters:
deltaX:numberdeltaY:numberx:number | undefined(optional)y:number | undefined(optional)
Returns: Promise<void>
getCursorPosition()
getCursorPosition(): Promise<DesktopPoint>;
Returns: Promise<DesktopPoint>
keyboardType()
keyboardType(text: string, delay?: number): Promise<void>;
Parameters:
text:stringdelay:number | undefined(optional)
Returns: Promise<void>
keyboardKey()
keyboardKey(keys: string): Promise<void>;
Parameters:
keys:string
Returns: Promise<void>
getWindowList()
getWindowList(): Promise<DesktopWindow[]>;
Returns: Promise<DesktopWindow[]>
focusWindow()
focusWindow(windowId: number): Promise<void>;
Parameters:
windowId:number
Returns: Promise<void>
Properties
| Property | Type | Description |
|---|---|---|
isInitialized |
readonly isInitialized: boolean; |
Whether the driver is initialized |
scaleFactor |
readonly scaleFactor: number; |
Current scale factor (physical / logical) |
IDocumentTransformer interface
📍 src/capabilities/documents/types.ts:204
Methods
transform()
transform(pieces: DocumentPiece[], context: TransformerContext): Promise<DocumentPiece[]>;
Parameters:
pieces:DocumentPiece[]context:TransformerContext
Returns: Promise<DocumentPiece[]>
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
- |
appliesTo |
readonly appliesTo: DocumentFormat[]; |
- |
priority? |
readonly priority?: number; |
- |
IEmbedder interface
Methods
embed()
embed(text: string): Promise<number[]>;
Parameters:
text:string
Returns: Promise<number[]>
embedBatch()?
embedBatch?(texts: string[]): Promise<number[][]>;
Parameters:
texts:string[]
Returns: Promise<number[][]>
Properties
| Property | Type | Description |
|---|---|---|
dimensions |
dimensions: number; |
- |
IEntity interface
Properties
| Property | Type | Description |
|---|---|---|
id |
id: EntityId; |
- |
type |
type: string; |
Open string. See well-known conventions in file header. |
displayName |
displayName: string; |
- |
aliases? |
aliases?: string[]; |
- |
normalizedDisplayName? |
normalizedDisplayName?: string; |
Indexed normalized form of displayName (lowercase, corp-suffix-stripped, |
punctuation-stripped — see resolution/fuzzy.ts/normalizeSurface). |
||
| Populated automatically by adapters on every create/update from v0.8.0+. | ||
Drives IMemoryStore.findEntitiesByNormalizedName — the O(1) lookup used |
||
by EntityResolver Tier 2 and the atomic-upsert path. |
Optional on the interface because pre-0.8.0 entities don't carry it;
findEntitiesByNormalizedName skips entities where it is absent (treated
as "needs backfill"). Run MemorySystem.backfillNormalizedFields to
populate. |
| normalizedAliases? | normalizedAliases?: string[]; | Indexed normalized form of each entry in aliases. Same normalization as
normalizedDisplayName; empties dropped; deduped (first-seen wins).
Populated automatically alongside normalizedDisplayName. |
| identifiers | identifiers: Identifier[]; | - |
| metadata? | metadata?: Record<string, unknown>; | Type-specific fields. See file header for conventional fields per type
(tasks carry state/dueAt/assigneeId, events carry startTime/attendeeIds, etc.).
Free-form — adapters support equality filtering via EntityListFilter.metadataFilter. |
| contextIds? | contextIds?: EntityId[]; | Multi-valued "lives within" edge — other entities this one is about or
contained within. Mirrors IFact.contextIds semantically: a task in
[projectA, dealQ3] surfaces when querying either anchor.
Conventional consumers: task, event, topic (entities that exist
within larger contexts). project, organization, person, document,
cluster typically do NOT carry contextIds — they ARE contexts, not
in-context things. The type is open: callers may use it for any type.
Surfaced via EntityListFilter.contextId, the tier-1.5 path in
resolveRelatedTasks / resolveRelatedEvents, and the opts.contextId
filter on findSimilarOpenTasks. NOT participated in by traverse
(predicate-keyed graph walks).
Merge semantics on resolve: union — re-extracting the same canonical
task with new contextIds adds them to the existing set rather than
filling-missing or overwriting. See MemorySystem.addEntityContextIds. |
| archived? | archived?: boolean; | - |
| permissions? | permissions?: Permissions; | Access-control block governing non-owner reads/writes. Undefined → library
defaults (group: 'read' when groupId set, world: 'read' always).
See AccessControl.ts for semantics. Owner always has full access. |
| acl? | acl?: ACLEntry[]; | Explicit access grants beyond owner/group/world — principal tokens with
read/write actions. Unioned with the owner/group/world projection when
materializing readPrincipals/writePrincipals. The seam hosts use to
grant participant (entity:<id>) or service access. See
access/principals.ts. |
| readPrincipals? | readPrincipals?: string[]; | Materialized read-principal token set, derived at the storage boundary from
ownerId + groupId + permissions + acl. Queried via $in against
the caller's principal set. Library-owned — never set this by hand; it is
recomputed on every write. Absent on pre-migration rows (access falls back
to the legacy owner/group/world check). |
| writePrincipals? | writePrincipals?: string[]; | Materialized write-principal token set (⊆ readPrincipals). |
| identityEmbedding? | identityEmbedding?: number[]; | Lightweight embedding over displayName + top aliases + primary identifier values, used by EntityResolver for semantic fallback when string matching
fails. Populated async by the embedding queue when enabled. |
| contentEmbedding? | contentEmbedding?: number[]; | Embedding over the entity's semantic content — produced by a per-type
EntityContentComposer (see composers/). Used by findSimilarOpenTasks,
searchDocuments, and any caller of
semanticSearchEntities({ embeddingField: 'content' }). Distinct from
identityEmbedding so semantic matching on content never bleeds into
EntityResolver's identity resolution tier.
Populated async by the embedding queue on every entity mutation that
meaningfully changes the composed text (compared via
contentEmbeddingText). Entity types without a registered composer never
get this populated — they fall back to identity-only matching. |
| contentEmbeddingText? | contentEmbeddingText?: string; | Verbatim text that produced contentEmbedding. Stored so call sites can
cheaply diff "did the composed text change?" without re-running the
composer twice (once for the prior, once for the new). Whenever
contentEmbedding is written, this is written alongside; whenever the
composer produces a string identical to this, the embed is skipped.
Operators inspecting why did this entity match the query? can read the
field directly — composers produce deterministic, human-readable text. |
| version | version: number; | Optimistic concurrency token — incremented on every write. |
| createdAt | createdAt: Date; | - |
| updatedAt | updatedAt: Date; | - |
IExtractor interface
📍 src/memory/integration/signals/types.ts:144
LLM extractor contract. prompt is the fully-rendered extraction prompt;
returns the parsed JSON output. Implementations are responsible for calling
the LLM, requesting JSON response format, parsing, and fallback handling.
Methods
extract()
extract(prompt: string): Promise<ExtractionOutput>;
Parameters:
prompt:string
Returns: Promise<ExtractionOutput>
IFact interface
Properties
| Property | Type | Description |
|---|---|---|
id |
id: FactId; |
- |
subjectId |
subjectId: EntityId; |
- |
predicate |
predicate: string; |
- |
kind |
kind: FactKind; |
- |
objectId? |
objectId?: EntityId; |
- |
value? |
value?: unknown; |
- |
details? |
details?: string; |
- |
summaryForEmbedding? |
summaryForEmbedding?: string; |
Caller-supplied short gist. Document facts use it as the embedding input |
(preferred over details); atomic facts use it as an OPTIONAL caller |
||
| override of the composed text (when set + non-empty, the atomic-fact | ||
| composer returns it verbatim instead of composing | ||
subject predicate object from the surface forms). |
Caller-owned: the library never overwrites this field. To track what
the embedder actually saw on the last embed, see embeddingText below. |
| embedding? | embedding?: number[]; | - |
| embeddingText? | embeddingText?: string; | Verbatim text that produced the current embedding. Library-owned —
the embedding queue writes this alongside the vector on every embed so
queueFactContentEmbeddingIfChanged can cheaply skip re-embeds when the
composed text hasn't changed. Distinct from summaryForEmbedding
(which is caller-owned and used as an override of the composer).
Operators inspecting "why did this fact match my query?" can read this
field directly — it's the exact string the embedder consumed. |
| isSemantic? | isSemantic?: boolean; | Computed at write-time. Gates embedding eligibility. |
| confidence? | confidence?: number; | - |
| evidenceQuote? | evidenceQuote?: string; | Verbatim quote from the source signal that justifies this fact.
When EagernessProfile.requireEvidenceQuote is 'strict', the extraction
pipeline rejects facts missing this field — that single rule eliminates
the "LLM invented a description" failure mode in restraint-first
deployments (ICOS Chief of Staff and similar).
Library-side: optional. Existing callers and chatty deployments can
write facts without it; downstream consumers that care can read it
to render "why this card is here" in UI. |
| sourceSignalId? | sourceSignalId?: string; | Opaque identifier of the signal/source this fact was derived from.
Memory layer makes no assumptions about the id's format — library users
own the signal store. Each observation is one fact with one source;
reinforcement creates a new (possibly superseding) fact. |
| derivedBy? | derivedBy?: string; | Rule id if the fact was inferred by the rule engine. |
| importance? | importance?: number; | 0..1 importance. Drives ranking (multiplies recency × confidence × predicateWeight)
and controls effective decay (more-important facts decay slower).
Default 0.5. Identity-level facts → 1.0. Trivial observations → 0.1. |
| contextIds? | contextIds?: EntityId[]; | Additional entities this fact is "about" beyond subject/object.
Example: (John, committed_to, "Build deck") with contextIds=[AcmeDeal]
lets the deal view surface this commitment without the deal being subject
or object. getContext queries subject OR object OR contextIds. |
| supersedes? | supersedes?: FactId; | - |
| archived? | archived?: boolean; | - |
| isAggregate? | isAggregate?: boolean; | Numeric aggregates update in place; never supersede. |
| observedAt? | observedAt?: Date; | - |
| validFrom? | validFrom?: Date; | - |
| validUntil? | validUntil?: Date; | - |
| metadata? | metadata?: Record<string, unknown>; | - |
| permissions? | permissions?: Permissions; | Access-control block governing non-owner reads/writes. Undefined → library
defaults (group: 'read' when groupId set, world: 'read' always).
See AccessControl.ts for semantics. Owner always has full access. |
| acl? | acl?: ACLEntry[]; | Explicit access grants beyond owner/group/world — principal tokens with
read/write actions. Unioned into readPrincipals/writePrincipals at
write time. For a fact about shared participants, the host passes e.g.
[{ principal: 'entity:alice', actions: ['read'] }, …] so every
participant can read it (overriding the user-private default). See
access/principals.ts. |
| readPrincipals? | readPrincipals?: string[]; | Materialized read-principal token set, derived at the storage boundary from
ownerId + groupId + permissions + acl. Queried via $in.
Library-owned — recomputed on every write. Absent on pre-migration rows. |
| writePrincipals? | writePrincipals?: string[]; | Materialized write-principal token set (⊆ readPrincipals). |
| createdAt | createdAt: Date; | - |
IFormatHandler interface
📍 src/capabilities/documents/types.ts:211
Methods
handle()
handle(
buffer: Buffer,
filename: string,
format: DocumentFormat,
options: DocumentReadOptions
): Promise<DocumentPiece[]>;
Parameters:
buffer:Buffer<ArrayBufferLike>filename:stringformat:DocumentFormatoptions:DocumentReadOptions
Returns: Promise<DocumentPiece[]>
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
- |
supportedFormats |
readonly supportedFormats: DocumentFormat[]; |
- |
IMongoCollectionLike interface
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:39
Methods
insertOne()
Insert a document. Any id field on the input is IGNORED — the collection
assigns the primary key (Mongo: ObjectId → hex string; Meteor: Random.id()).
Returns the assigned id as a string.
insertOne(doc: T): Promise<string>;
Parameters:
doc:T
Returns: Promise<string>
insertMany()
Batch insert. Returned ids are in the same order as input.
insertMany(docs: T[]): Promise<string[]>;
Parameters:
docs:T[]
Returns: Promise<string[]>
updateOne()
Update. filter may contain id: <string> — wrappers translate to the
native primary-key form (Mongo: _id: ObjectId(...); Meteor: _id: <string>).
Any id field in the update payload is stripped (ids are immutable).
updateOne(
filter: MongoFilter,
update: MongoUpdate,
opts?: MongoUpdateOptions,
): Promise<MongoUpdateResult>;
Parameters:
filter:MongoFilterupdate:MongoUpdateopts:MongoUpdateOptions | undefined(optional)
Returns: Promise<MongoUpdateResult>
deleteOne()
deleteOne(filter: MongoFilter): Promise<void>;
Parameters:
filter:MongoFilter
Returns: Promise<void>
deleteMany()
deleteMany(filter: MongoFilter): Promise<void>;
Parameters:
filter:MongoFilter
Returns: Promise<void>
findOne()
Returned documents always have id populated (mapped from the native
primary key — _id.toHexString() for Mongo ObjectId, or the string form
for Meteor). _id is not present on returned documents.
findOne(filter: MongoFilter, opts?: MongoFindOptions): Promise<T | null>;
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T | null>
find()
find(filter: MongoFilter, opts?: MongoFindOptions): Promise<T[]>;
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T[]>
countDocuments()
countDocuments(filter: MongoFilter): Promise<number>;
Parameters:
filter:MongoFilter
Returns: Promise<number>
aggregate()?
Aggregation pipeline. Optional — adapters gate $graphLookup and
$vectorSearch fast paths on its presence.
aggregate?(pipeline: unknown[]): Promise<unknown[]>;
Parameters:
pipeline:unknown[]
Returns: Promise<unknown[]>
createIndex()?
Index management hook. Optional — the adapter's ensureIndexes() helper
calls this when available; otherwise users must create indexes themselves.
createIndex?(
spec: Record<string, 1 | -1>,
opts?: {
unique?: boolean;
name?: string;
/**
* Build the index in the background. Honored by `mongodb` driver +
* Meteor's `rawCollection().createIndex` wrappers. Important on
* production collections where a foreground build would lock writes.
*/
background?: boolean;
/**
* Sparse index — entries are only indexed for documents that have the
* indexed field. Useful for fields populated on a subset of records
* (e.g. `normalizedAliases`, present only on entities with aliases).
*/
sparse?: boolean;
/**
* Partial filter expression — restrict the index to documents matching
* the expression. Used for the normalized-name uniqueness index, which
* filters out archived rows and entities lacking the normalized field
* (legacy data pre-backfill).
*/
partialFilterExpression?: Record<string, unknown>;
},
): Promise<void>;
Parameters:
spec:Record<string, 1 | -1>opts:{ unique?: boolean | undefined; name?: string | undefined; background?: boolean | undefined; sparse?: boolean | undefined; partialFilterExpression?: Record<string, unknown> | undefined; } | undefined(optional)
Returns: Promise<void>
createSearchIndex()?
Atlas Search / Vector Search index management. Optional — available on
Atlas Server 6.0.11+ via the node driver's createSearchIndex() +
listSearchIndexes(). Meteor wrappers delegate to rawCollection().
When absent, callers must create vector-search indexes via the Atlas UI
or admin API out-of-band.
createSearchIndex is idempotent only in the "already exists" sense —
Atlas returns an error if the name clashes. Callers should listSearchIndexes
first to skip creation when the index is present.
createSearchIndex?(definition: SearchIndexDefinition): Promise<string>;
Parameters:
definition:SearchIndexDefinition
Returns: Promise<string>
listSearchIndexes()?
Returns all search indexes (or one named index) with lifecycle status.
listSearchIndexes?(name?: string): Promise<SearchIndexInfo[]>;
Parameters:
name:string | undefined(optional)
Returns: Promise<SearchIndexInfo[]>
dropSearchIndex()?
Drop a search index by name. Atlas processes the drop asynchronously —
listSearchIndexes may still return the index for some seconds after
the call resolves, with status: 'DELETING' or similar. Callers that
recreate immediately should be tolerant of that lag (re-list until
absent or use a different index name).
Required by ensureVectorSearchIndexes's drift-recreate path: when a
stored index's latestDefinition.fields don't match the desired filter
paths (e.g. after a library upgrade adds a new filter path), the only
way to apply the new definition is drop + recreate. Atlas does not
support in-place edits to vector-search index definitions.
dropSearchIndex?(name: string): Promise<void>;
Parameters:
name:string
Returns: Promise<void>
withTransaction()?
Transaction hook — present on raw-driver wrappers when a client is available, absent on Meteor wrappers. When present, MongoMemoryAdapter wraps supersession in a transaction; when absent, it relies on the crash-safe ordering that MemorySystem already enforces.
withTransaction?<R>(fn: () => Promise<R>): Promise<R>;
Parameters:
fn:() => Promise<R>
Returns: Promise<R>
IncomingCallInfo interface
📍 src/capabilities/voice/types.ts:454
Metadata for an incoming call from the telephony provider. The adapter maps provider-specific data to this structure.
Properties
| Property | Type | Description |
|---|---|---|
callId |
callId: string; |
Provider-specific call ID (e.g., Twilio CallSid) |
from |
from: string; |
Caller identifier (phone number, SIP URI) |
to |
to: string; |
Called identifier |
metadata |
metadata: Record<string, unknown>; |
Adapter-specific metadata |
InContextEntry interface
📍 src/core/context-nextgen/plugins/InContextMemoryPluginNextGen.ts:28
Properties
| Property | Type | Description |
|---|---|---|
key |
key: string; |
- |
description |
description: string; |
- |
value |
value: unknown; |
- |
updatedAt |
updatedAt: number; |
- |
priority |
priority: InContextPriority; |
- |
showInUI? |
showInUI?: boolean; |
If true, this entry is displayed in the user's side panel UI |
IngestExtractedInput interface
📍 src/memory/integration/signals/SignalIngestor.ts:118
Properties
| Property | Type | Description |
|---|---|---|
extracted |
extracted: ExtractedSignal; |
- |
sourceSignalId |
sourceSignalId: string; |
- |
scope |
scope: ScopeFilter; |
- |
autoResolveThreshold? |
autoResolveThreshold?: number; |
- |
knownEntities? |
knownEntities?: IEntity[]; |
- |
sourceObservedAt? |
sourceObservedAt?: Date; |
Overrides {@link ExtractedSignal.observedAt} when both are present. |
| Useful when the caller has a more authoritative timestamp than the | ||
| adapter (e.g. a pipeline-level signal-receipt time vs. the adapter's | ||
| parse of a body-embedded date). |
IngestionResolvedEntity interface
📍 src/memory/integration/ExtractionResolver.ts:210
Properties
| Property | Type | Description |
|---|---|---|
label |
label: string; |
- |
entity |
entity: IEntity; |
- |
resolved |
resolved: boolean; |
- |
mergeCandidates |
mergeCandidates: EntityCandidate[]; |
- |
IngestionResult interface
📍 src/memory/integration/ExtractionResolver.ts:223
Properties
| Property | Type | Description |
|---|---|---|
entities |
entities: IngestionResolvedEntity[]; |
- |
facts |
facts: IFact[]; |
- |
mergeCandidates |
mergeCandidates: Array<{ label: string; surface: string; candidates: EntityCandidate[] }>; |
Entities that matched existing records with mid-confidence candidates. |
unresolved |
unresolved: IngestionError[]; |
Mention labels or facts that couldn't be resolved/written. |
newPredicates |
newPredicates: string[]; |
Canonicalized predicates in the LLM output that are NOT in the memory |
| system's predicate registry. Useful for detecting vocabulary drift — | ||
| periodically review and either promote to the registry or refine the | ||
| prompt. Empty when no registry is configured. | ||
| Deduped. | ||
operationsApplied? |
operationsApplied?: OperationOutcome; |
Op-level counts from reconciliation dispatch. Populated when the caller |
passed priorFacts AND the LLM emitted operations. Undefined otherwise. |
IngestSignalInput interface
📍 src/memory/integration/signals/SignalIngestor.ts:79
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: string; |
Kind matching a registered adapter, e.g. 'email', 'text'. |
raw |
raw: TRaw; |
Raw source-specific payload. |
sourceSignalId |
sourceSignalId: string; |
Opaque id for the originating signal — attached to every written fact. |
scope |
scope: ScopeFilter; |
- |
autoResolveThreshold? |
autoResolveThreshold?: number; |
Optional override of the auto-resolve threshold for this ingest only. |
knownEntities? |
knownEntities?: IEntity[]; |
Known entities to hint to the LLM (appears as "Known entities" block). |
| Useful when the caller has pre-fetched likely candidates (e.g. by thread | ||
| participants) but doesn't want to seed them as hard bindings. | ||
sourceObservedAt? |
sourceObservedAt?: Date; |
Authoritative source timestamp for this signal. Used as |
referenceDate in the extraction prompt (so the LLM resolves relative |
||
dates against the right week) and as sourceObservedAt on the resolver |
||
| (so facts inherit the source date, not extraction time). If undefined, | ||
the adapter's ExtractedSignal.observedAt is consulted next, then the |
||
| resolver falls back to legacy behavior. |
IngestTextInput interface
📍 src/memory/integration/signals/SignalIngestor.ts:106
Properties
| Property | Type | Description |
|---|---|---|
text |
text: string; |
- |
signalSourceDescription? |
signalSourceDescription?: string; |
- |
participants? |
participants?: ParticipantSeed[]; |
- |
sourceSignalId |
sourceSignalId: string; |
- |
scope |
scope: ScopeFilter; |
- |
autoResolveThreshold? |
autoResolveThreshold?: number; |
- |
knownEntities? |
knownEntities?: IEntity[]; |
- |
sourceObservedAt? |
sourceObservedAt?: Date; |
See {@link IngestSignalInput.sourceObservedAt}. |
InputTextContent interface
📍 src/domain/entities/Content.ts:25
Properties
| Property | Type | Description |
|---|---|---|
type |
type: ContentType.INPUT_TEXT; |
- |
text |
text: string; |
- |
IntegrationTestCase interface
📍 src/testing/integration/types.ts:97
A single test case within a suite.
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Descriptive test name (e.g., 'Create a calendar meeting') |
toolName |
toolName: string; |
Tool name this exercises (without connector prefix, e.g., 'create_meeting') |
description |
description: string; |
Short description of what this test verifies |
critical? |
critical?: boolean; |
If true, failure here skips all remaining tests in the suite. |
| Use for setup tests whose output is needed by later tests | ||
| (e.g., create_meeting must succeed for get_meeting to run). | ||
requiredParams? |
requiredParams?: string[]; |
Param keys this test requires. If any are missing from TestContext.params, |
| the test is automatically skipped. | ||
execute |
`execute: ( |
tools: Map<string, ToolFunction>,
context: TestContext
) => Promise<{ success: boolean; message?: string; data?: unknown }>;| Execute the test. | |cleanup?|cleanup?: (
tools: Map<string, ToolFunction>,
context: TestContext
) => Promise<void>;` | Optional cleanup that runs even if the test failed.
Use to delete resources created during the test. |
IntegrationTestSuite interface
📍 src/testing/integration/types.ts:138
Definition of a complete integration test suite for a service type.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique suite ID (e.g., 'google-workspace') |
serviceType |
serviceType: string; |
Service type this suite tests (must match ConnectorTools.detectService output) |
name |
name: string; |
Human-readable name (e.g., 'Google Workspace') |
description |
description: string; |
Description of what this suite covers |
requiredParams |
requiredParams: TestParam[]; |
Params that must be provided for any tests to run |
optionalParams |
optionalParams: TestParam[]; |
Params that enable additional tests if provided |
tests |
tests: IntegrationTestCase[]; |
Ordered list of test cases (execution order matters) |
IPermissionPolicy interface
📍 src/core/permissions/types.ts:482
A composable permission policy that evaluates tool execution requests.
Policies return:
allowto explicitly permit (does NOT short-circuit — later policies can still deny)denyto block immediately (short-circuits the chain)abstainto defer to other policies
Tool authors declare defaults via ToolFunction.permission. App developers
can override at registration time. Policies read the merged result from
PolicyContext.toolPermissionConfig.
Methods
evaluate()
Evaluate the policy for a given tool call. May be sync or async.
evaluate(context: PolicyContext): Promise<PolicyDecision> | PolicyDecision;
Parameters:
context:PolicyContext
Returns: PolicyDecision | Promise<PolicyDecision>
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Unique policy name |
priority? |
readonly priority?: number; |
Priority — lower runs first. Default: 100 |
description? |
readonly description?: string; |
Human-readable description for display/audit |
IPluginSnapshot interface
📍 src/core/context-nextgen/snapshot.ts:65
Snapshot of a single plugin's state.
contents is the raw data from plugin.getContents() (plugin-specific shape).
formattedContent is the human-readable string from plugin.getContent().
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Plugin identifier (e.g., 'working_memory') |
displayName |
displayName: string; |
Human-readable display name (e.g., 'Working Memory') |
enabled |
enabled: boolean; |
Whether this plugin is active |
tokenSize |
tokenSize: number; |
Current token size of plugin content |
instructionsTokenSize |
instructionsTokenSize: number; |
Token size of plugin instructions |
compactable |
compactable: boolean; |
Whether this plugin supports compaction |
contents |
contents: unknown; |
Raw plugin data (entries, state, etc.) |
formattedContent |
`formattedContent: string | null;` |
IProfileGenerator interface
Methods
generate()
generate(
input: ProfileGeneratorInput,
): Promise<{ details: string; summaryForEmbedding: string }>;
Parameters:
input:ProfileGeneratorInput
Returns: Promise<{ details: string; summaryForEmbedding: string; }>
IResearchSource interface
📍 src/capabilities/researchAgent/types.ts:101
Generic research source interface
Implement this interface to add any data source to ResearchAgent:
- Web: search queries, fetch URLs
- Vector DB: similarity search, fetch documents
- File system: glob patterns, read files
- API: query endpoints, fetch resources
Methods
search()
Search this source for relevant results
search(query: string, options?: SearchOptions): Promise<SearchResponse>;
Parameters:
query:stringoptions:SearchOptions | undefined(optional)
Returns: Promise<SearchResponse>
fetch()
Fetch full content for a result
fetch(reference: string, options?: FetchOptions): Promise<FetchedContent>;
Parameters:
reference:stringoptions:FetchOptions | undefined(optional)
Returns: Promise<FetchedContent>
isAvailable()?
Optional: Check if source is available/configured
isAvailable?(): Promise<boolean>;
Returns: Promise<boolean>
getCapabilities()?
Optional: Get source capabilities
getCapabilities?(): SourceCapabilities;
Returns: SourceCapabilities
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Unique name for this source |
description |
readonly description: string; |
Human-readable description |
type |
`readonly type: 'web' | 'vector' |
IRuleEngine interface
Methods
deriveFor()
deriveFor(
entityId: EntityId,
view: IScopedMemoryView,
scope: ScopeFilter,
): Promise<Array<Partial<IFact>>>;
Parameters:
entityId:stringview:IScopedMemoryViewscope:ScopeFilter
Returns: Promise<Partial<IFact>[]>
IScrapeProvider interface
📍 src/capabilities/scrape/ScrapeProvider.ts:104
Base ScrapeProvider interface All scraping providers must implement this interface
Methods
scrape()
Scrape a URL and extract content
scrape(url: string, options?: ScrapeOptions): Promise<ScrapeResponse>;
Parameters:
url:stringoptions:ScrapeOptions | undefined(optional)
Returns: Promise<ScrapeResponse>
supportsFeature()?
Check if this provider supports a specific feature
supportsFeature?(feature: ScrapeFeature): boolean;
Parameters:
feature:ScrapeFeature
Returns: boolean
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Provider name (e.g., 'jina', 'firecrawl', 'scrapingbee') |
connector |
readonly connector: Connector; |
Connector used for authentication |
ISearchProvider interface
📍 src/capabilities/search/SearchProvider.ts:65
Base SearchProvider interface
Methods
search()
Search the web
search(query: string, options?: SearchOptions): Promise<SearchResponse>;
Parameters:
query:stringoptions:SearchOptions | undefined(optional)
Returns: Promise<SearchResponse>
Properties
| Property | Type | Description |
|---|---|---|
name |
readonly name: string; |
Provider name |
connector |
readonly connector: Connector; |
Connector used for authentication |
ISourceLinks interface
📍 src/domain/types/SharedTypes.ts:80
Source links for model documentation and maintenance Used to track where information came from and when it was last verified
Properties
| Property | Type | Description |
|---|---|---|
documentation |
documentation: string; |
Official documentation URL |
pricing? |
pricing?: string; |
Pricing page URL |
apiReference? |
apiReference?: string; |
API reference URL |
additional? |
additional?: string; |
Additional reference (e.g., blog post, announcement) |
lastVerified |
lastVerified: string; |
Last verified date (YYYY-MM-DD) |
IStoreHandler interface
📍 src/core/context-nextgen/types.ts:589
Interface for plugins that provide CRUD storage.
When a plugin implements both IContextPluginNextGen and IStoreHandler,
it automatically gets the 5 generic store_* tools — no tool creation needed.
How to implement a custom CRUD plugin
- Create a class that extends
BasePluginNextGenand implementsIStoreHandler - Implement
getStoreSchema()— describes your store for tool descriptions - Implement the 5 handler methods (storeGet, storeSet, storeDelete, storeList)
- Optionally implement
storeAction()for non-CRUD operations - Write
getInstructions()— explains when to use YOUR store vs others - Register with
ctx.registerPlugin(yourPlugin)— store tools auto-include it
Your plugin does NOT need to define any tools via getTools().
The StoreToolsManager creates the 5 store_* tools once and routes
calls to the correct handler based on the store parameter.
Example:
class NotesPlugin extends BasePluginNextGen implements IStoreHandler {
readonly name = 'notes';
private notes = new Map<string, { text: string; tag?: string }>();
getStoreSchema(): StoreEntrySchema {
return {
storeId: 'notes',
displayName: 'Notes',
description: 'Simple text notes with optional tags',
usageHint: 'Use for: quick notes. NOT for structured data (use "memory").',
setDataFields: 'text (required): Note content\ntag?: Optional category tag',
};
}
async storeGet(key?: string) { ... }
async storeSet(key: string, data: Record<string, unknown>) { ... }
async storeDelete(key: string) { ... }
async storeList(filter?: Record<string, unknown>) { ... }
getInstructions() {
return 'Store name: "notes". Use store_set("notes", key, { text, tag? }).';
}
async getContent() { ... }
getContents() { return Object.fromEntries(this.notes); }
}
Methods
getStoreSchema()
Return the store's schema for dynamic tool descriptions
getStoreSchema(): StoreEntrySchema;
Returns: StoreEntrySchema
storeGet()
Get one entry by key, or all entries if key is undefined
storeGet(key?: string, context?: ToolContext): Promise<StoreGetResult>;
Parameters:
key:string | undefined(optional)context:ToolContext | undefined(optional)
Returns: Promise<StoreGetResult>
storeSet()
Create or update an entry
storeSet(key: string, data: Record<string, unknown>, context?: ToolContext): Promise<StoreSetResult>;
Parameters:
key:stringdata:Record<string, unknown>context:ToolContext | undefined(optional)
Returns: Promise<StoreSetResult>
storeDelete()
Delete an entry by key
storeDelete(key: string, context?: ToolContext): Promise<StoreDeleteResult>;
Parameters:
key:stringcontext:ToolContext | undefined(optional)
Returns: Promise<StoreDeleteResult>
storeList()
List entries with optional filter
storeList(filter?: Record<string, unknown>, context?: ToolContext): Promise<StoreListResult>;
Parameters:
filter:Record<string, unknown> | undefined(optional)context:ToolContext | undefined(optional)
Returns: Promise<StoreListResult>
storeAction()?
Execute a store-specific action (optional — only needed if store has actions)
storeAction?(action: string, params?: Record<string, unknown>, context?: ToolContext): Promise<StoreActionResult>;
Parameters:
action:stringparams:Record<string, unknown> | undefined(optional)context:ToolContext | undefined(optional)
Returns: Promise<StoreActionResult>
ITelephonyAdapter interface
📍 src/capabilities/voice/types.ts:491
Abstraction over telephony providers (Twilio, Vonage, etc.). The adapter handles the provider-specific protocol and exposes a uniform audio frame interface to the VoiceBridge.
Methods
sendAudio()
Send an audio frame to the caller
sendAudio(callId: string, frame: AudioFrame): void;
Parameters:
callId:stringframe:AudioFrame
Returns: void
clearAudio()?
Clear all buffered outbound audio for a call (barge-in/interrupt)
clearAudio?(callId: string): void;
Parameters:
callId:string
Returns: void
hangup()
End a specific call
hangup(callId: string): Promise<void>;
Parameters:
callId:string
Returns: Promise<void>
makeCall()?
Initiate an outbound call. Returns the provider-specific call ID.
makeCall?(config: OutboundCallConfig): Promise<string>;
Parameters:
config:OutboundCallConfig
Returns: Promise<string>
getActiveCalls()
Get all active call IDs
getActiveCalls(): string[];
Returns: string[]
on()
Subscribe to adapter events
on<K extends keyof TelephonyAdapterEvents>(event: K, handler: TelephonyAdapterEvents[K]): void;
Parameters:
event:Khandler:TelephonyAdapterEvents[K]
Returns: void
off()
off<K extends keyof TelephonyAdapterEvents>(event: K, handler: TelephonyAdapterEvents[K]): void;
Parameters:
event:Khandler:TelephonyAdapterEvents[K]
Returns: void
destroy()
Clean up all connections
destroy(): Promise<void>;
Returns: Promise<void>
IterationCompleteEvent interface
📍 src/capabilities/agents/types/EventTypes.ts:86
Properties
| Property | Type | Description |
|---|---|---|
executionId |
executionId: string; |
- |
iteration |
iteration: number; |
- |
response |
response: AgentResponse; |
- |
timestamp |
timestamp: Date; |
- |
duration |
duration: number; |
- |
ITokenEstimator interface
📍 src/core/context-nextgen/types.ts:63
Token estimator interface - used for conversation and input estimation Plugins handle their own token estimation internally.
Methods
estimateTokens()
Estimate tokens for a string
estimateTokens(text: string): number;
Parameters:
text:string
Returns: number
estimateDataTokens()
Estimate tokens for arbitrary data (will be JSON stringified)
estimateDataTokens(data: unknown): number;
Parameters:
data:unknown
Returns: number
estimateImageTokens()?
Estimate tokens for an image. Provider-specific implementations can override.
Default heuristic (matches OpenAI's image token pricing):
- detail='low': 85 tokens
- detail='high' with known dimensions: 85 + 170 * ceil(w/512) * ceil(h/512)
- Unknown dimensions: ~1000 tokens (conservative default)
estimateImageTokens?(width?: number, height?: number, detail?: string): number;
Parameters:
width:number | undefined(optional)height:number | undefined(optional)detail:string | undefined(optional)
Returns: number
IUserInteractionDelivery interface
📍 src/tools/interaction/types.ts:126
App-implemented delivery contract.
Implementations are responsible for:
- Delivering the prompt over their channel.
- Embedding (or otherwise persisting)
correlationIdso an inbound reply can be tied back to the suspended session. - Wiring the inbound listener that, on reply, resolves the correlation
via
ICorrelationStorage, callsAgent.hydrate(...), and runsagent.run(reply)to continue execution.
The library never invokes step 3 — that's the app's responsibility.
Methods
send()
Deliver the prompt and return a correlation handle.
Errors thrown here propagate out of the tool call — the agent will treat the call as failed (no suspension). Apps should throw with descriptive messages; the library logs them with full context.
send(
request: UserInteractionRequest,
ctx: UserInteractionDeliveryContext,
): Promise<UserInteractionDeliveryResult>;
Parameters:
request:UserInteractionRequestctx:UserInteractionDeliveryContext
Returns: Promise<UserInteractionDeliveryResult>
Properties
| Property | Type | Description |
|---|---|---|
id? |
readonly id?: string; |
Channel identifier — used for logging only; the actual channel name |
surfaced in tool results comes from UserInteractionDeliveryResult.channel. |
||
| Optional: implementations may omit this if they expose a single channel. |
IViewContextComponent interface
📍 src/core/context-nextgen/snapshot.ts:140
A single component of the prepared context.
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Component name (e.g., 'System Message', 'User Message', 'Tool Call: search') |
content |
content: string; |
Human-readable text content |
tokenEstimate |
tokenEstimate: number; |
Estimated token count for this component |
IViewContextData interface
📍 src/core/context-nextgen/snapshot.ts:123
Human-readable breakdown of the prepared context. Used by "View Full Context" UI panels.
Properties
| Property | Type | Description |
|---|---|---|
available |
available: boolean; |
Whether the data is available |
components |
components: IViewContextComponent[]; |
Ordered list of context components |
totalTokens |
totalTokens: number; |
Total estimated tokens across all components |
rawContext |
rawContext: string; |
All components concatenated (for "Copy All" functionality) |
IVoiceActivityDetector interface
📍 src/capabilities/voice/types.ts:62
Voice Activity Detector interface. Implementations detect when the caller starts and stops speaking.
Methods
process()
Feed an audio frame, returns speech state change (if any)
process(frame: AudioFrame): VADEvent;
Parameters:
frame:AudioFrame
Returns: VADEvent
reset()
Reset internal state (e.g., between utterances)
reset(): void;
Returns: void
IVoiceInfo interface
📍 src/domain/entities/SharedVoices.ts:10
Shared voice definitions and language constants Eliminates duplication across TTS model registries
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
name |
name: string; |
- |
language |
language: string; |
- |
gender |
`gender: 'male' | 'female' |
style? |
style?: string; |
- |
previewUrl? |
previewUrl?: string; |
- |
isDefault? |
isDefault?: boolean; |
- |
recommended? |
recommended?: boolean; |
Recommended choice for this model family. More than one voice may be recommended. |
accent? |
accent?: string; |
- |
age? |
`age?: 'child' | 'young' |
IVoicePipeline interface
📍 src/capabilities/voice/types.ts:416
Voice pipeline strategy interface. TextPipeline and RealtimePipeline both implement this.
Methods
init()
Initialize pipeline for a new call session
init(sessionInfo: VoiceSessionInfo): Promise<void>;
Parameters:
sessionInfo:VoiceSessionInfo
Returns: Promise<void>
processAudio()
Process an incoming audio frame from the caller
processAudio(frame: AudioFrame): void;
Parameters:
frame:AudioFrame
Returns: void
onSpeechEnd()
Signal that the caller stopped speaking (silence detected by VAD)
onSpeechEnd(): Promise<void>;
Returns: Promise<void>
onSpeechStart()
Signal that the caller started speaking (interrupt if agent is speaking)
onSpeechStart(): void;
Returns: void
interrupt()
Interrupt current agent response (e.g., caller spoke during TTS)
interrupt(): void;
Returns: void
onPlaybackAck()?
Notify pipeline of telephony playback progress
onPlaybackAck?(ack: VoicePipelinePlaybackAck): void;
Parameters:
ack:VoicePipelinePlaybackAck
Returns: void
getState()
Get current pipeline state
getState(): SessionState;
Returns: SessionState
on()
Subscribe to pipeline events
on<K extends keyof VoicePipelineEvents>(event: K, handler: VoicePipelineEvents[K]): void;
Parameters:
event:Khandler:VoicePipelineEvents[K]
Returns: void
off()
off<K extends keyof VoicePipelineEvents>(event: K, handler: VoicePipelineEvents[K]): void;
Parameters:
event:Khandler:VoicePipelineEvents[K]
Returns: void
destroy()
Clean up all resources (agent, TTS, STT)
destroy(): Promise<void>;
Returns: Promise<void>
JWTConnectorAuth interface
📍 src/domain/entities/Connector.ts:130
JWT Bearer token authentication For service accounts (Google, Salesforce)
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'jwt'; |
- |
privateKey |
privateKey: string; |
- |
privateKeyPath? |
privateKeyPath?: string; |
- |
tokenUrl |
tokenUrl: string; |
- |
clientId |
clientId: string; |
- |
scope? |
scope?: string; |
- |
issuer? |
issuer?: string; |
- |
subject? |
subject?: string; |
- |
audience? |
audience?: string; |
- |
extra? |
extra?: Record<string, string>; |
Vendor-specific extra credentials |
KnownContextFeatures interface
📍 src/core/context-nextgen/types.ts:771
Feature flags for enabling/disabling plugins
Properties
| Property | Type | Description |
|---|---|---|
taskState? |
taskState?: boolean; |
Host-controlled protected task view; disabled by default. Requires plugins.taskState. |
workingMemory? |
workingMemory?: boolean; |
Enable WorkingMemory plugin (default: true) |
inContextMemory? |
inContextMemory?: boolean; |
Enable InContextMemory plugin (default: true) |
persistentInstructions? |
persistentInstructions?: boolean; |
Enable PersistentInstructions plugin (default: false). |
userInfo? |
userInfo?: boolean; |
Enable UserInfo plugin (default: false). |
toolCatalog? |
toolCatalog?: boolean; |
Enable ToolCatalog plugin for dynamic tool loading/unloading (default: false) |
sharedWorkspace? |
sharedWorkspace?: boolean; |
Enable SharedWorkspace plugin for multi-agent coordination (default: false) |
memory? |
memory?: boolean; |
Enable Memory plugin for self-learning knowledge store (default: false, READ-ONLY tools). Requires plugins.memory.memory: MemorySystem in config. |
memoryWrite? |
memoryWrite?: boolean; |
Enable Memory-write sidecar (default: false). Adds the 6 write tools (remember/link/forget/restore/upsert_entity/set_agent_rule). Requires memory: true. |
KnownPluginConfigs interface
📍 src/core/context-nextgen/types.ts:845
Plugin configurations for auto-initialization. When features are enabled, plugins are created with these configs. The config shapes match each plugin's constructor parameter.
Properties
| Property | Type | Description |
|---|---|---|
taskState? |
`taskState?: import('./plugins/TaskStatePluginNextGen.js').TaskStatePluginConfig | Record<string, unknown>;` |
| Use TaskStatePluginConfig for strict built-in validation; runtime validates the | ||
| built-in when no external factory owns this feature key. | ||
evidence? |
evidence?: Record<string, unknown>; |
Opt-in durable evidence. Enable features.evidence; scope and policy are host-owned. |
workingMemory? |
workingMemory?: Record<string, unknown>; |
Working memory plugin config. See WorkingMemoryPluginConfig. |
inContextMemory? |
inContextMemory?: Record<string, unknown>; |
In-context memory plugin config. See InContextMemoryConfig. |
persistentInstructions? |
persistentInstructions?: Record<string, unknown>; |
Persistent instructions plugin config. See PersistentInstructionsConfig. Note: agentId auto-filled. |
userInfo? |
userInfo?: Record<string, unknown>; |
User info plugin config. See UserInfoPluginConfig. |
toolCatalog? |
toolCatalog?: Record<string, unknown>; |
Tool catalog plugin config. See ToolCatalogPluginConfig. |
sharedWorkspace? |
sharedWorkspace?: Record<string, unknown>; |
Shared workspace plugin config. See SharedWorkspaceConfig. |
memory? |
memory?: Record<string, unknown>; |
Memory plugin config. See MemoryPluginConfig. agentId auto-filled from context. userId auto-filled from context if unset. Requires memory: MemorySystem. |
memoryWrite? |
memoryWrite?: Record<string, unknown>; |
Memory-write plugin config. See MemoryWritePluginConfig. Shares memory / agentId / userId with the memory plugin when unset. |
ListOptions interface
Properties
| Property | Type | Description |
|---|---|---|
limit? |
limit?: number; |
- |
cursor? |
cursor?: string; |
- |
orderBy? |
`orderBy?: EntityOrderBy | EntityOrderBy[];` |
| dominant). Nested metadata paths allowed. When omitted the adapter's | ||
| natural order is used (Mongo: _id asc; InMemory: insertion order). | ||
select? |
select?: string[]; |
Field projection (dot-paths allowed). When omitted, full entity is |
| returned. When provided, the response always includes a required minimum | ||
(id, type, displayName, version, createdAt, updatedAt, |
||
ownerId, groupId, archived) plus the requested paths. Unrequested |
||
optional fields (identifiers, aliases, metadata, permissions, |
||
identityEmbedding) are absent from returned objects. |
LLMResponse interface
📍 src/domain/entities/Response.ts:66
Properties
| Property | Type | Description |
|---|---|---|
routing? |
routing?: import('../../core/model-execution/types.js').ModelRoutingDiagnostics; |
Optional managed routing decision; model/usage retain provider meanings. |
loop? |
loop?: import('./AgentLoop.js').AgentLoopDiagnostics; |
Opt-in managed-loop diagnostics; separate from provider generation status. |
id |
id: string; |
- |
object |
object: 'response'; |
- |
created_at |
created_at: number; |
- |
status |
`status: 'completed' | 'failed' |
completed— Generation finished successfullyfailed— Generation failed with an errorincomplete— Generation stopped early (e.g. max tokens reached)cancelled— Generation was cancelled by the callerin_progress— Async/streaming generation still running (used by StreamState, video generation)queued— Queued for processing (used by async video generation via Sora)suspended— Agent loop suspended waiting for external input (via SuspendSignal) | |model|model: string;| - | |output|output: OutputItem[];| - | |output_text?|output_text?: string;| - | |thinking?|thinking?: string;| - | |output_parsed?|output_parsed?: unknown;| Parsed structured output — populated when the request specified aresponseFormat(JSON). The library parses/repairsoutput_textinto a JSON value and attaches it here. Undefined when no format was requested. Seesrc/core/StructuredOutput.ts. | |usage|usage: TokenUsage;| - | |error?|error?: { type: string; message: string; };| - | |metadata?|metadata?: Record<string, string>;| - | |structured_output_enforcement?|structured_output_enforcement?: 'native' | 'prompt' | 'repair';| How a requested structured response was enforced. | |native_tool_events?|native_tool_events?: NativeToolEvent[];| Provider-hosted tool lifecycle/error details, when the provider returns them. | |stop_reason?|stop_reason?: string;| Raw provider stop reason (e.g. 'end_turn', 'max_tokens', 'refusal'), when known. | |continuation_token?|continuation_token?: string;| Opaque provider token used to resume an incomplete long decode. | |stop_details?|stop_details?: ProviderStopDetails;| Structured stop detail accompanying a terminal stop reason. Anthropic populates this for refusals — names which safety classifier fired. Undefined for ordinary completions. | |pendingAsyncTools?|pendingAsyncTools?: Array<{ toolCallId: string; toolName: string; startTime: number; status: import('./Tool.js').PendingAsyncToolStatus }>;| Non-empty when async tools are still executing in the background | |suspension?|suspension?: { /** Correlation ID for routing external events back to this session */ correlationId: string; /** Session ID where the agent state is persisted */ sessionId: string; /** Agent ID for reconstructing the agent via Agent.hydrate() */ agentId: string; /** How the external response should be injected on resume */ resumeAs: 'user_message' | 'tool_result'; /** ISO timestamp when this suspension expires */ expiresAt: string; /** Application-specific metadata from the SuspendSignal */ metadata?: Record<string, unknown>; };| Present when status is 'suspended' — contains info needed to resume the session |
LoggingPluginOptions interface
📍 src/core/tool-execution/plugins/LoggingPlugin.ts:20
Configuration options for LoggingPlugin
Properties
| Property | Type | Description |
|---|---|---|
level? |
`level?: 'trace' | 'debug' |
| Default: 'debug' | ||
errorLevel? |
`errorLevel?: 'warn' | 'error';` |
| Default: 'error' | ||
logArgs? |
logArgs?: boolean; |
Whether to include tool arguments in logs. |
| Set to false for tools with sensitive data. | ||
| Default: true | ||
logResult? |
logResult?: boolean; |
Whether to include result summary in completion logs. |
| Default: true | ||
maxLogLength? |
maxLogLength?: number; |
Maximum length for argument/result strings in logs. |
| Default: 200 | ||
logger? |
logger?: FrameworkLogger; |
Custom logger instance. If not provided, uses framework logger. |
component? |
component?: string; |
Component name for the logger. |
| Default: 'ToolExecution' |
MarkdownKVSheet interface
📍 src/capabilities/documents/handlers/ExcelHandler.ts:302
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
- |
content |
content: string; |
- |
MaterializedPrincipals interface
Properties
| Property | Type | Description |
|---|---|---|
readPrincipals |
readPrincipals: string[]; |
- |
writePrincipals |
writePrincipals: string[]; |
- |
MCPClientState interface
📍 src/domain/entities/MCPTypes.ts:126
MCP Client state (for serialization)
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Server name |
state |
`state: 'disconnected' | 'connecting' |
capabilities? |
capabilities?: MCPServerCapabilities; |
Server capabilities |
subscribedResources |
subscribedResources: string[]; |
Subscribed resource URIs |
lastConnectedAt? |
lastConnectedAt?: number; |
Last connected timestamp |
connectionAttempts |
connectionAttempts: number; |
Connection attempt count |
MCPConfiguration interface
📍 src/domain/entities/MCPConfig.ts:104
MCP global configuration
Properties
| Property | Type | Description |
|---|---|---|
servers |
servers: MCPServerConfig[]; |
List of MCP servers |
defaults? |
`defaults?: { |
/** Default auto-connect (default: false) */
autoConnect?: boolean;
/** Default auto-reconnect (default: true) */
autoReconnect?: boolean;
/** Default reconnect interval in milliseconds (default: 5000) */
reconnectIntervalMs?: number;
/** Default maximum reconnect attempts (default: 10) */
maxReconnectAttempts?: number;
/** Default request timeout in milliseconds (default: 30000) */
requestTimeoutMs?: number;
/** Default health check interval in milliseconds (default: 60000) */
healthCheckIntervalMs?: number;
};` | Default settings for all servers |
MCPPrompt interface
📍 src/domain/entities/MCPTypes.ts:72
MCP Prompt definition
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Prompt name |
description? |
description?: string; |
Prompt description |
arguments? |
`arguments?: Array<{ |
name: string;
description?: string;
required?: boolean;
}>;` | Prompt arguments schema |
MCPPromptResult interface
📍 src/domain/entities/MCPTypes.ts:88
MCP Prompt result
Properties
| Property | Type | Description |
|---|---|---|
description? |
description?: string; |
Prompt description |
messages |
`messages: Array<{ |
role: 'user' | 'assistant';
content: {
type: 'text' | 'image' | 'resource';
text?: string;
data?: string;
mimeType?: string;
uri?: string;
};
}>;` | Prompt messages |
MCPResource interface
📍 src/domain/entities/MCPTypes.ts:44
MCP Resource definition
Properties
| Property | Type | Description |
|---|---|---|
uri |
uri: string; |
Resource URI |
name |
name: string; |
Resource name |
description? |
description?: string; |
Resource description |
mimeType? |
mimeType?: string; |
MIME type |
MCPResourceContent interface
📍 src/domain/entities/MCPTypes.ts:58
MCP Resource content
Properties
| Property | Type | Description |
|---|---|---|
uri |
uri: string; |
Resource URI |
mimeType? |
mimeType?: string; |
MIME type |
text? |
text?: string; |
Text content |
blob? |
blob?: string; |
Binary content (base64) |
MCPServerCapabilities interface
📍 src/domain/entities/MCPTypes.ts:107
MCP Server capabilities
Properties
| Property | Type | Description |
|---|---|---|
tools? |
tools?: Record<string, unknown>; |
Tools capability |
resources? |
`resources?: { |
subscribe?: boolean;
listChanged?: boolean;
};| Resources capability | |prompts?|prompts?: {
listChanged?: boolean;
};| Prompts capability | |logging?|logging?: Record<string, unknown>;` | Logging capability |
MCPServerConfig interface
📍 src/domain/entities/MCPConfig.ts:61
MCP server configuration
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Unique identifier for the server |
displayName? |
displayName?: string; |
Human-readable display name |
description? |
description?: string; |
Server description |
transport |
transport: MCPTransportType; |
Transport type |
transportConfig |
transportConfig: TransportConfig; |
Transport-specific configuration |
autoConnect? |
autoConnect?: boolean; |
Auto-connect on startup (default: false) |
autoReconnect? |
autoReconnect?: boolean; |
Auto-reconnect on failure (default: true) |
reconnectIntervalMs? |
reconnectIntervalMs?: number; |
Reconnect interval in milliseconds (default: 5000) |
maxReconnectAttempts? |
maxReconnectAttempts?: number; |
Maximum reconnect attempts (default: 10) |
requestTimeoutMs? |
requestTimeoutMs?: number; |
Request timeout in milliseconds (default: 30000) |
healthCheckIntervalMs? |
healthCheckIntervalMs?: number; |
Health check interval in milliseconds (default: 60000) |
toolNamespace? |
toolNamespace?: string; |
Tool namespace prefix (default: 'mcp:{name}') |
permissions? |
`permissions?: { |
/** Default permission scope */
defaultScope?: 'once' | 'session' | 'always' | 'never';
/** Default risk level */
defaultRiskLevel?: 'low' | 'medium' | 'high' | 'critical';
};| Permission configuration for tools from this server | |connectorBindings?|connectorBindings?: Record<string, string>;` | Map environment variable keys to connector names for runtime auth resolution.
When connecting, the connector's token will be injected into the env var.
Example: { 'GITHUB_PERSONAL_ACCESS_TOKEN': 'my-github-connector' } |
MeetingSlotSuggestion interface
📍 src/tools/calendar/types.ts:91
A single slot suggestion with per-attendee availability. Identical to MeetingSlotSuggestion in both google and microsoft types.
Properties
| Property | Type | Description |
|---|---|---|
start |
start: string; |
- |
end |
end: string; |
- |
timeZone? |
timeZone?: string; |
- |
confidence |
confidence: string; |
- |
attendeeAvailability |
attendeeAvailability: { attendee: string; availability: string }[]; |
- |
MeetingSlotSuggestion interface
📍 src/tools/google/types.ts:527
Properties
| Property | Type | Description |
|---|---|---|
start |
start: string; |
- |
end |
end: string; |
- |
confidence |
confidence: string; |
- |
attendeeAvailability |
attendeeAvailability: { attendee: string; availability: string }[]; |
- |
MeetingSlotSuggestion interface
📍 src/tools/microsoft/types.ts:504
Properties
| Property | Type | Description |
|---|---|---|
start |
start: string; |
- |
end |
end: string; |
- |
timeZone? |
timeZone?: string; |
- |
confidence |
confidence: string; |
- |
attendeeAvailability |
attendeeAvailability: { attendee: string; availability: string }[]; |
- |
Message interface
📍 src/domain/entities/Message.ts:15
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'message'; |
- |
id? |
id?: string; |
- |
role |
role: MessageRole; |
- |
content |
content: Content[]; |
- |
providerMetadata? |
providerMetadata?: Record<string, unknown>; |
Opaque replay metadata for an explicitly selected provider continuation. |
MetadataChange interface
📍 src/memory/metadataDiff.ts:12
Pure helper used by callers (e.g. v25 calendar pipeline) to detect when
specific top-level metadata keys have changed between successive snapshots
of an entity. Lets the caller emit predicate facts (cancelled,
rescheduled) without re-implementing diff logic per call site.
Intentionally minimal: only top-level keys, deep equality on values, no smart shape-aware comparison. Callers are expected to pass canonical values (Dates, primitives, plain JSON) — the helper does not normalise.
Properties
| Property | Type | Description |
|---|---|---|
key |
key: string; |
- |
before |
before: unknown; |
- |
after |
after: unknown; |
- |
kind |
`kind: 'added' | 'removed' |
MeteorCollectionLike interface
📍 src/memory/adapters/mongo/MeteorMongoCollection.ts:36
Structural shape of a Meteor Mongo.Collection. The real Meteor class adds many more methods, but this is what the adapter uses.
Methods
insertAsync()
insertAsync(doc: T): Promise<string>;
Parameters:
doc:T
Returns: Promise<string>
updateAsync()
updateAsync(
selector: MongoFilter,
modifier: MongoUpdate,
opts?: { multi?: boolean; upsert?: boolean },
): Promise<number>;
Parameters:
selector:MongoFiltermodifier:MongoUpdateopts:{ multi?: boolean | undefined; upsert?: boolean | undefined; } | undefined(optional)
Returns: Promise<number>
removeAsync()
removeAsync(selector: MongoFilter): Promise<number>;
Parameters:
selector:MongoFilter
Returns: Promise<number>
findOneAsync()
findOneAsync(selector: MongoFilter, opts?: MongoFindOptions): Promise<T | null>;
Parameters:
selector:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T | null>
find()
find(
selector: MongoFilter,
opts?: MongoFindOptions,
): { fetchAsync(): Promise<T[]>; countAsync(): Promise<number> };
Parameters:
selector:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: { fetchAsync(): Promise<T[]>; countAsync(): Promise<number>; }
rawCollection()
rawCollection(): {
aggregate(pipeline: unknown[]): { toArray(): Promise<unknown[]> };
createIndex(spec: Record<string, 1 | -1>, opts?: unknown): Promise<string>;
/** Atlas Search / Vector Search hooks — present on node driver v6.6+. */
createSearchIndex?(definition: {
name: string;
type?: 'search' | 'vectorSearch';
definition: Record<string, unknown>;
}): Promise<string>;
listSearchIndexes?(name?: string): { toArray(): Promise<Array<Record<string, unknown>>> };
dropSearchIndex?(name: string): Promise<void>;
};
Returns: { aggregate(pipeline: unknown[]): { toArray(): Promise<unknown[]>; }; createIndex(spec: Record<string, 1 | -1>, opts?: unknown): Promise<string>; createSearchIndex?(definition: { name: string; type?: "search" | "vectorSearch" | undefined; definition: Record<string, unknown>; }): Promise<string>; listSearchIndexes?(name?: string | undefined): { toArray(): Promise<Record<string, unknown>[]>; }; dropSearchIndex?(name: string): Promise<void>; }
MicrosoftCreateMeetingResult interface
📍 src/tools/microsoft/types.ts:425
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
eventId? |
eventId?: string; |
- |
webLink? |
webLink?: string; |
- |
onlineMeetingUrl? |
onlineMeetingUrl?: string; |
- |
error? |
error?: string; |
- |
MicrosoftDraftEmailResult interface
📍 src/tools/microsoft/types.ts:413
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
draftId? |
draftId?: string; |
- |
webLink? |
webLink?: string; |
- |
error? |
error?: string; |
- |
MicrosoftEditMeetingResult interface
📍 src/tools/microsoft/types.ts:433
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
eventId? |
eventId?: string; |
- |
webLink? |
webLink?: string; |
- |
error? |
error?: string; |
- |
MicrosoftFindSlotsResult interface
📍 src/tools/microsoft/types.ts:497
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
slots? |
slots?: MeetingSlotSuggestion[]; |
- |
emptySuggestionsReason? |
emptySuggestionsReason?: string; |
- |
error? |
error?: string; |
- |
MicrosoftGetTranscriptResult interface
📍 src/tools/microsoft/types.ts:440
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
transcript? |
transcript?: string; |
- |
meetingSubject? |
meetingSubject?: string; |
- |
error? |
error?: string; |
- |
MicrosoftListFilesResult interface
📍 src/tools/microsoft/types.ts:642
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
items? |
`items?: { |
name: string;
type: 'file' | 'folder';
size: number;
sizeFormatted: string;
mimeType?: string;
lastModified?: string;
webUrl?: string;
id: string;
childCount?: number;
}[];| - | |totalCount?|totalCount?: number;| - | |hasMore?|hasMore?: boolean;| - | |error?|error?: string;` | - |
MicrosoftReadFileResult interface
📍 src/tools/microsoft/types.ts:632
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
filename? |
filename?: string; |
- |
sizeBytes? |
sizeBytes?: number; |
- |
mimeType? |
mimeType?: string; |
- |
markdown? |
markdown?: string; |
- |
webUrl? |
webUrl?: string; |
- |
error? |
error?: string; |
- |
MicrosoftSearchFilesResult interface
📍 src/tools/microsoft/types.ts:660
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
results? |
`results?: { |
name: string;
path?: string;
site?: string;
snippet?: string;
size: number;
sizeFormatted: string;
webUrl?: string;
id: string;
lastModified?: string;
}[];| - | |totalCount?|totalCount?: number;| - | |hasMore?|hasMore?: boolean;| - | |error?|error?: string;` | - |
MicrosoftSendEmailResult interface
📍 src/tools/microsoft/types.ts:420
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
MongoFindOptions interface
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:22
Properties
| Property | Type | Description |
|---|---|---|
sort? |
sort?: MongoSort; |
- |
limit? |
limit?: number; |
- |
skip? |
skip?: number; |
- |
projection? |
`projection?: Record<string, 0 | 1>;` |
MongoUpdateOptions interface
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:29
Properties
| Property | Type | Description |
|---|---|---|
upsert? |
upsert?: boolean; |
- |
MongoUpdateResult interface
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:33
Properties
| Property | Type | Description |
|---|---|---|
matchedCount |
matchedCount: number; |
- |
modifiedCount |
modifiedCount: number; |
- |
upsertedCount |
upsertedCount: number; |
- |
NativeHistoryCompactionConfig interface
📍 src/core/context-nextgen/compaction/types.ts:11
Properties
| Property | Type | Description |
|---|---|---|
mode |
mode: 'native'; |
- |
preserveRecentTurns? |
preserveRecentTurns?: number; |
Keep this many completed user turns exact. Default 2. |
Neighborhood interface
Properties
| Property | Type | Description |
|---|---|---|
nodes |
nodes: Array<{ entity: IEntity; depth: number }>; |
- |
edges |
edges: Array<{ fact: IFact; from: EntityId; to: EntityId; depth: number }>; |
- |
NewFactSummary interface
📍 src/memory/integration/signalReconciliationPrompt.ts:39
A newly-observed fact rendered as context (no id — it already exists).
Properties
| Property | Type | Description |
|---|---|---|
predicate |
predicate: string; |
- |
value? |
value?: unknown; |
- |
details? |
details?: string; |
- |
subjectLabel? |
subjectLabel?: string; |
Human label/surface for the subject (for the LLM to read; not an id). |
objectLabel? |
objectLabel?: string; |
- |
evidenceQuote? |
evidenceQuote?: string; |
- |
ObjectIdLike interface
📍 src/memory/adapters/mongo/RawMongoCollection.ts:32
Minimal structural shape of a mongodb-driver ObjectId. Just enough to
construct and read back. We never import from mongodb at runtime — callers
pass their Collection object.
Methods
toHexString()
toHexString(): string;
Returns: string
ObservationMaskingStrategyConfig interface
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:12
Shared opt-in retention and transaction bounds.
Properties
| Property | Type | Description |
|---|---|---|
threshold? |
threshold?: number; |
- |
preserveRecentTurns? |
preserveRecentTurns?: number; |
Exact recent user turns. Default 2; tool-result messages are not user turns. |
preserveRecentMessages? |
preserveRecentMessages?: number; |
Also keep this many trailing history items exact. Default 4. |
minObservationTokens? |
minObservationTokens?: number; |
Only larger observation bodies are masked. Default 256 estimated tokens. |
maxSourceTokens? |
maxSourceTokens?: number; |
Maximum source packet, without truncating individual items. Default 8192. |
minTokensSaved? |
minTokensSaved?: number; |
Reject a proposal saving less than this many estimated tokens. Default 32. |
timeoutMs? |
timeoutMs?: number; |
Whole transaction deadline, including storage/helper reads. Default 30000ms. |
OpenAIRealtimeChannelTransportOptions interface
📍 src/capabilities/voice/openai/OpenAIRealtimeChannelTransport.ts:10
Properties
| Property | Type | Description |
|---|---|---|
channel |
channel: RealtimeMessageChannel; |
- |
connectTimeoutMs? |
connectTimeoutMs?: number; |
- |
maxBufferedAmountBytes? |
maxBufferedAmountBytes?: number; |
Stop accepting sends when channel buffering reaches this size. Default: 1 MiB. |
maxPendingEvents? |
maxPendingEvents?: number; |
Maximum event count retained until connect() begins. Default: 256. |
maxPendingEventBytes? |
maxPendingEventBytes?: number; |
Maximum UTF-8 bytes retained until connect() begins. Default: 1 MiB. |
OpenAIRealtimeClientEvent interface
📍 src/capabilities/voice/openai/RealtimeTypes.ts:228
Properties
| Property | Type | Description |
|---|---|---|
type |
type: string; |
- |
event_id? |
event_id?: string; |
- |
OpenAIRealtimeClientSecret interface
📍 src/capabilities/voice/openai/RealtimeTypes.ts:212
Properties
| Property | Type | Description |
|---|---|---|
value |
value: string; |
- |
expires_at |
expires_at: number; |
- |
session |
`session: OpenAIRealtimeSessionConfig |
| OpenAIRealtimeTranscriptionSessionConfig
| OpenAIRealtimeTranslationClientSessionConfig;` | - |
OpenAIRealtimeServerEvent interface
📍 src/capabilities/voice/openai/RealtimeTypes.ts:220
Properties
| Property | Type | Description |
|---|---|---|
type |
type: string; |
- |
event_id? |
event_id?: string; |
- |
OpenAIRealtimeWebRTCCall interface
📍 src/capabilities/voice/openai/RealtimeChannel.ts:2
SDP answer returned by a server-created OpenAI Realtime WebRTC call.
Properties
| Property | Type | Description |
|---|---|---|
sdp |
sdp: string; |
- |
callId |
callId: string; |
- |
OpenAISemanticVAD interface
📍 src/capabilities/voice/openai/RealtimeTypes.ts:55
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'semantic_vad'; |
- |
eagerness? |
`eagerness?: 'low' | 'medium' |
create_response? |
create_response?: boolean; |
- |
interrupt_response? |
interrupt_response?: boolean; |
- |
OpenAIServerVAD interface
📍 src/capabilities/voice/openai/RealtimeTypes.ts:45
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'server_vad'; |
- |
threshold? |
threshold?: number; |
- |
prefix_padding_ms? |
prefix_padding_ms?: number; |
- |
silence_duration_ms? |
silence_duration_ms?: number; |
- |
idle_timeout_ms? |
idle_timeout_ms?: number; |
- |
create_response? |
create_response?: boolean; |
- |
interrupt_response? |
interrupt_response?: boolean; |
- |
OperationOutcome interface
📍 src/memory/integration/ExtractionResolver.ts:131
Counts of operations applied/rejected by the resolver.
Properties
| Property | Type | Description |
|---|---|---|
creates |
creates: number; |
- |
updates |
updates: number; |
- |
archives |
archives: number; |
- |
rejectedHallucinated |
rejectedHallucinated: number; |
- |
rejectedSkeptic |
rejectedSkeptic: number; |
- |
OrchestratorConfig interface
📍 src/core/orchestrator/createOrchestrator.ts:86
Configuration for the orchestrator.
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Connector name for LLM access |
model |
model: string; |
Model to use for the orchestrator (also default for workers) |
systemPrompt? |
systemPrompt?: string; |
Custom system prompt (overrides the auto-generated one) |
agentTypes |
agentTypes: Record<string, AgentTypeConfig>; |
Available agent types that can be spawned |
workspace? |
workspace?: Partial<SharedWorkspaceConfig>; |
SharedWorkspace configuration |
features? |
features?: Partial<ContextFeatures>; |
Additional context features for the orchestrator |
pluginConfigs? |
pluginConfigs?: PluginConfigs; |
Plugin configurations for the orchestrator |
name? |
name?: string; |
Agent name for the orchestrator (default: 'orchestrator') |
agentId? |
agentId?: string; |
Agent ID for session persistence |
maxIterations? |
maxIterations?: number; |
Max iterations for the orchestrator's agentic loop (default: 100) |
maxAgents? |
maxAgents?: number; |
Maximum number of worker agents (default: 20) |
skipPlanning? |
skipPlanning?: boolean; |
Skip the planning workflow (UNDERSTAND/PLAN/APPROVE phases) and execute directly (default: false) |
tools? |
tools?: ToolFunction[]; |
Additional tools available to the orchestrator itself (for DIRECT route tasks) |
delegationDefaults? |
delegationDefaults?: DelegationDefaults; |
Default delegation settings |
autoDescribe? |
autoDescribe?: boolean; |
Auto-generate rich descriptions for agent types that lack explicit description/scenarios/capabilities. |
| Runs a single LLM call at creation time. Makes createOrchestrator return a Promise. | ||
| Default: false |
OrchestratorFactoryOptions interface
📍 src/core/orchestrator/factoryTypes.ts:36
Methods
configureAgent()
configureAgent(request: AgentConstructionRequest): OrchestratedAgentConfig | Promise<OrchestratedAgentConfig>;
Parameters:
request:AgentConstructionRequest
Returns: OrchestratedAgentConfig | Promise<OrchestratedAgentConfig>
onChildOutcome()?
onChildOutcome?(observation: ChildObservation): void;
Parameters:
observation:ChildObservation
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
descriptionExecution? |
descriptionExecution?: ExecutionBinding; |
- |
OutboundCallConfig interface
📍 src/capabilities/voice/types.ts:522
Configuration for initiating an outbound call.
Properties
| Property | Type | Description |
|---|---|---|
to |
to: string; |
Destination phone number (E.164 format, e.g., '+15558675310') |
from |
from: string; |
Caller ID / from phone number (must be a verified Twilio number) |
timeout? |
timeout?: number; |
Ring timeout in seconds before giving up. Default: 30 |
machineDetection? |
machineDetection?: boolean; |
Enable answering machine detection. Default: false |
OutcomeAgentPackage interface
📍 src/portable/outcomeTypes.ts:109
Separate outer envelope prevents an old loader from silently dropping required observations.
Properties
| Property | Type | Description |
|---|---|---|
protocol |
protocol: AgentPackageOutcomeProtocol; |
- |
package |
package: SerializedAgentPackage; |
- |
checkpoint? |
checkpoint?: RemoteOutcomeCheckpoint; |
- |
OutcomeCancelRequest interface
📍 src/portable/outcomeTypes.ts:26
Properties
| Property | Type | Description |
|---|---|---|
reason? |
reason?: string |
- |
OutcomeCancelResponse interface
📍 src/portable/outcomeTypes.ts:52
Properties
| Property | Type | Description |
|---|---|---|
receipt |
receipt: RemoteOutcomeReceipt; |
- |
cancellationRequested |
cancellationRequested: boolean |
- |
OutcomeEvidenceRequest interface
📍 src/portable/outcomeTypes.ts:20
Properties
| Property | Type | Description |
|---|---|---|
sessionId |
sessionId: string; |
- |
reference |
reference: EvidenceReference; |
- |
offset? |
offset?: number; |
- |
limit? |
limit?: number; |
- |
OutcomeEvidenceResponse interface
📍 src/portable/outcomeTypes.ts:53
Properties
| Property | Type | Description |
|---|---|---|
chunk |
`chunk: EvidenceChunk | null;` |
contentSha256? |
contentSha256?: string; |
- |
contentBytes? |
contentBytes?: number |
- |
OutcomeExecuteRequest interface
📍 src/portable/outcomeTypes.ts:13
Properties
| Property | Type | Description |
|---|---|---|
toolName |
toolName: string; |
- |
toolFingerprint |
toolFingerprint: string; |
Expected negotiated callable/effect contract, never a grant of permission. |
arguments |
arguments: Record<string, unknown>; |
- |
argumentsFingerprint |
argumentsFingerprint: string; |
- |
OutcomeExecuteResponse interface
📍 src/portable/outcomeTypes.ts:46
Properties
| Property | Type | Description |
|---|---|---|
receipt |
receipt: RemoteOutcomeReceipt; |
- |
hasResult |
hasResult: boolean; |
True means a complete JSON result is present, including null/false/zero. |
result? |
result?: unknown; |
- |
OutcomeHydratedAgent interface
📍 src/portable/outcomeTypes.ts:133
Properties
| Property | Type | Description |
|---|---|---|
agent |
agent: Agent; |
- |
session |
session: RemoteOutcomeSession |
- |
OutcomeNegotiation interface
📍 src/portable/outcomeTypes.ts:27
Properties
| Property | Type | Description |
|---|---|---|
sessionId |
sessionId: string; |
Server-instance epoch. A restart does not restore process-local request authority. |
tools |
tools: Array<{ name: string; definitionFingerprint: string; effect: RemoteOutcomeEffect }>; |
- |
limits |
limits: { maxRequests: number; maxInlineBytes: number; maxReadChars: number }; |
- |
OutcomePackageRequest interface
📍 src/portable/outcomeTypes.ts:11
Properties
| Property | Type | Description |
|---|---|---|
protocol |
protocol: AgentPackageOutcomeProtocol; |
- |
packageId |
packageId: string |
- |
OutcomeRequestIdentity interface
📍 src/portable/outcomeTypes.ts:12
Properties
| Property | Type | Description |
|---|---|---|
sessionId |
sessionId: string; |
- |
requestId |
requestId: string |
- |
OutputTextContent interface
📍 src/domain/entities/Content.ts:43
Properties
| Property | Type | Description |
|---|---|---|
type |
type: ContentType.OUTPUT_TEXT; |
- |
text |
text: string; |
- |
annotations? |
annotations?: any[]; |
- |
OversizedInputResult interface
📍 src/core/context-nextgen/types.ts:740
Result of handling oversized current input
Properties
| Property | Type | Description |
|---|---|---|
accepted |
accepted: boolean; |
Whether the input was accepted (possibly truncated) |
content |
content: string; |
Processed content (truncated if needed) |
error? |
error?: string; |
Error message if rejected |
warning? |
warning?: string; |
Warning message if truncated |
originalSize |
originalSize: number; |
Original size in bytes |
finalSize |
finalSize: number; |
Final size in bytes |
OversizeEmbeddingInput interface
📍 src/memory/integration/ConnectorEmbedder.ts:24
Properties
| Property | Type | Description |
|---|---|---|
text |
text: string; |
- |
model |
model: string; |
- |
maxTokens |
maxTokens: number; |
- |
estimatedTokens |
estimatedTokens: number; |
- |
Page interface
Properties
| Property | Type | Description |
|---|---|---|
items |
items: T[]; |
- |
nextCursor? |
nextCursor?: string; |
- |
ParsedPrincipal interface
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: PrincipalKind; |
- |
id? |
id?: string; |
Undefined for world and unknown. |
ParseExtractionResult interface
📍 src/memory/integration/parseExtraction.ts:37
Rich parse result. rawExcerpt is the first ~500 chars of the raw input
— useful for logs without bloating them.
Properties
| Property | Type | Description |
|---|---|---|
status |
status: ParseStatus; |
- |
mentions |
mentions: ExtractionOutput['mentions']; |
- |
facts |
facts: ExtractionOutput['facts']; |
- |
operations? |
operations?: ReconciliationOp[]; |
Reconciliation operations emitted against priorFacts (per-conversation |
| reconciliation mode). Captured opportunistically — always populated when | ||
the LLM output contained an operations array, regardless of whether the |
||
| prompt was in reconciliation mode. The resolver decides what to do with | ||
| it (apply if reconciliation mode, log+ignore otherwise). | ||
whyActionable? |
whyActionable?: string; |
One-sentence justification for emitting non-empty output, when the prompt |
required it (EagernessProfile.requireJustification = true). Always |
||
| captured when present in the LLM output, even under chatty profiles — | ||
| existence is harmless, absence is what restraint enforces upstream. | ||
reason? |
reason?: string; |
Short human-readable reason when status !== 'ok'. |
rawExcerpt? |
rawExcerpt?: string; |
Truncated sample of the raw input for logging. |
ParseReconciliationOpsResult interface
📍 src/memory/integration/parseExtraction.ts:326
Outcome of a reconciliation-ops parse. Mirrors ParseExtractionResult
but only validates the operations field — mentions/facts are not
expected from reconciliation prompts.
Properties
| Property | Type | Description |
|---|---|---|
status |
status: ParseStatus; |
- |
operations |
operations: ReconciliationOp[]; |
- |
reason? |
reason?: string; |
- |
rawExcerpt? |
rawExcerpt?: string; |
- |
ParseSignalReconciliationOpsResult interface
📍 src/memory/integration/parseExtraction.ts:388
Outcome of a signal-reconciliation parse — fact ops + task_update ops.
Properties
| Property | Type | Description |
|---|---|---|
status |
status: ParseStatus; |
- |
operations |
operations: SignalReconciliationOp[]; |
- |
reason? |
reason?: string; |
- |
rawExcerpt? |
rawExcerpt?: string; |
- |
ParticipantSeed interface
📍 src/memory/integration/signals/types.ts:40
Metadata-derived entity seed. The adapter emits these from deterministic fields (email headers, calendar attendee lists, DB joins) — no LLM required.
Seeds MUST carry at least one strong identifier. Seeding on weak names would
bind ambiguously — SignalIngestor rejects seeds with empty identifiers
rather than silently skip them. If you only have a display name, don't seed:
let the LLM surface the mention and resolve via surface form.
Despite the historical name "participant", seeds can be ANY entity type —
events, tasks, projects. The role field is a free-form hint used by
seedFacts (below) for deterministic relational-fact writes.
Properties
| Property | Type | Description |
|---|---|---|
role |
role: string; |
Free-form role hint, e.g. from, to, cc, author, attendee, organizer, event. |
identifiers |
identifiers: Identifier[]; |
Strong identifiers. MUST be non-empty. |
displayName? |
displayName?: string; |
Display name hint (falls back to the first identifier value). |
aliases? |
aliases?: string[]; |
Additional surface forms spotted in the metadata. |
type? |
type?: string; |
Entity type. Default 'person'. |
metadata? |
metadata?: Record<string, unknown>; |
Type-specific fields to set on the entity (e.g. event startTime/endTime, |
task state/dueAt). Merge semantics follow upsertEntityBySurface.metadata: |
||
verbatim on create, fillMissing on resolve (by default). |
||
metadataMerge? |
`metadataMerge?: 'fillMissing' | 'overwrite';` |
Defaults to 'fillMissing' — the conservative policy that never overwrites |
||
a value already on the entity. Set to 'overwrite' ONLY when the signal |
||
| is an authoritative refresh of structural state (e.g. a calendar pull | ||
| rescheduling an event, a CRM sync updating a deal's stage). LLM-extracted | ||
| mentions should leave this unset — re-extractions can be wrong and | ||
fillMissing protects against clobbering good data. |
Applies per-seed: a calendar adapter can set 'overwrite' on the event
seed while leaving person seeds at the default so a rogue signal can't
rename a person. |
PermissionAuditEntry interface
📍 src/core/permissions/types.ts:610
Audit entry for permission decisions.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique entry ID |
timestamp |
timestamp: string; |
ISO timestamp |
toolName |
toolName: string; |
Tool that was checked |
decision |
`decision: 'allow' | 'deny';` |
finalOutcome |
`finalOutcome: 'executed' | 'blocked' |
reason |
reason: string; |
Human-readable reason |
policyName? |
policyName?: string; |
Policy that made the deciding verdict |
userId? |
userId?: string; |
User who triggered the check |
agentId? |
agentId?: string; |
Agent that triggered the check |
args? |
args?: Record<string, unknown>; |
Redacted arguments (sensitive values replaced) |
executionId? |
executionId?: string; |
Execution ID for correlation |
approvalRequired? |
approvalRequired?: boolean; |
Whether approval was required |
approvalKey? |
approvalKey?: string; |
Approval key used |
metadata? |
metadata?: Record<string, unknown>; |
Additional metadata |
PermissionCheckContext interface
📍 src/core/permissions/types.ts:84
Context passed to approval callbacks/hooks
Properties
| Property | Type | Description |
|---|---|---|
toolCall |
toolCall: ToolCall; |
The tool call being checked |
parsedArgs |
parsedArgs: Record<string, unknown>; |
Parsed arguments (for display/inspection) |
config |
config: ToolPermissionConfig; |
The tool's permission config |
executionId |
executionId: string; |
Current execution context ID |
iteration |
iteration: number; |
Current iteration (if in agentic loop) |
agentType |
`agentType: 'agent' | 'task-agent' |
taskName? |
taskName?: string; |
Optional task name (for TaskAgent/UniversalAgent) |
PermissionCheckResult interface
📍 src/core/permissions/types.ts:170
Result of checking if a tool needs approval
Properties
| Property | Type | Description |
|---|---|---|
allowed |
allowed: boolean; |
Whether the tool can execute without prompting |
needsApproval |
needsApproval: boolean; |
Whether approval is needed (user should be prompted) |
blocked |
blocked: boolean; |
Whether the tool is blocked (cannot execute at all) |
reason |
reason: string; |
Reason for the decision |
config? |
config?: ToolPermissionConfig; |
The tool's permission config (for UI display) |
PermissionPolicyManagerConfig interface
📍 src/core/permissions/PermissionPolicyManager.ts:60
Properties
| Property | Type | Description |
|---|---|---|
policies? |
policies?: IPermissionPolicy[]; |
Policies to register at construction |
chain? |
chain?: PolicyChainConfig; |
Policy chain configuration |
onApprovalRequired? |
onApprovalRequired?: (context: ApprovalRequestContext) => Promise<ApprovalDecision>; |
Callback invoked when a tool needs user approval |
userRulesStorage? |
userRulesStorage?: IUserPermissionRulesStorage; |
Per-user permission rules storage (optional) |
autoApproveAll? |
autoApproveAll?: boolean; |
When true, ALL tools are auto-approved without any permission checks. |
| Blocklist is still respected for safety. |
Permissions interface
📍 src/memory/AccessControl.ts:59
Permissions block attached to entities and facts. Both fields optional; unset fields fall back to library defaults.
Properties
| Property | Type | Description |
|---|---|---|
group? |
group?: AccessLevel; |
What members of record.groupId (other than the owner) can do. Meaningful |
only when record.groupId is set. Default 'read'. |
||
world? |
world?: AccessLevel; |
What everyone outside record.groupId can do — or everyone, when the |
record has no groupId. Default 'read'. |
PersistentInstructionsConfig interface
📍 src/core/context-nextgen/plugins/PersistentInstructionsPluginNextGen.ts:35
Properties
| Property | Type | Description |
|---|---|---|
agentId |
agentId: string; |
Agent ID - used to determine storage path (REQUIRED) |
storage? |
storage?: IPersistentInstructionsStorage; |
Custom storage implementation (default: FilePersistentInstructionsStorage) |
maxTotalLength? |
maxTotalLength?: number; |
Maximum total content length across all entries in characters (default: 50000) |
maxEntries? |
maxEntries?: number; |
Maximum number of entries (default: 50) |
PieceMetadata interface
📍 src/capabilities/documents/types.ts:27
Properties
| Property | Type | Description |
|---|---|---|
sourceFilename |
sourceFilename: string; |
- |
format |
format: DocumentFormat; |
- |
index |
index: number; |
- |
section? |
section?: string; |
- |
sizeBytes |
sizeBytes: number; |
- |
estimatedTokens |
estimatedTokens: number; |
- |
label? |
label?: string; |
- |
PipelineExecutionOptions interface
📍 src/core/tool-execution/types.ts:15
Properties
| Property | Type | Description |
|---|---|---|
executionId? |
executionId?: string; |
- |
toolContext? |
toolContext?: ToolContext; |
- |
registration? |
registration?: ToolRegistrationInfo; |
Admission-time registration metadata; later registrations apply to future calls. |
onOutcome? |
onOutcome?: (outcome: PipelineOutcome) => void; |
- |
PlainTextRaw interface
📍 src/memory/integration/signals/adapters/PlainTextAdapter.ts:12
Properties
| Property | Type | Description |
|---|---|---|
text |
text: string; |
- |
source? |
source?: string; |
Optional short description, e.g. "note-attached-to-ticket-123". |
PluginExecutionContext interface
📍 src/core/tool-execution/types.ts:27
Context passed through the execution pipeline. Contains all information about the current tool execution.
Properties
| Property | Type | Description |
|---|---|---|
toolName |
toolName: string; |
Name of the tool being executed |
args |
readonly args: unknown; |
Original arguments passed to the tool (immutable) |
mutableArgs |
mutableArgs: unknown; |
Mutable arguments that plugins can modify |
metadata |
metadata: Map<string, unknown>; |
Metadata for passing data between plugins |
startTime |
startTime: number; |
Timestamp when execution started (ms since epoch) |
tool |
tool: ToolFunction; |
The tool function being executed |
executionId |
executionId: string; |
Unique execution ID for tracing |
toolContext? |
toolContext?: ToolContext; |
Snapshot belonging to this invocation, including its composed signal. |
registration? |
registration?: ToolRegistrationInfo; |
Admission-time registration metadata; later registrations apply to future calls. |
PluginFactoryContext interface
📍 src/core/context-nextgen/PluginRegistry.ts:41
Context passed to plugin factories during auto-initialization
Properties
| Property | Type | Description |
|---|---|---|
agentId |
agentId: string; |
- |
userId? |
userId?: string; |
- |
features |
`features: Record<string, boolean | undefined>;` |
PluginRegisterOptions interface
📍 src/core/context-nextgen/PluginRegistry.ts:54
Options for registering a plugin
Properties
| Property | Type | Description |
|---|---|---|
featureKey? |
featureKey?: string; |
Feature flag key in camelCase (e.g., 'dynamicUI'). |
| If omitted, derived from pluginName via snake_case → camelCase conversion. | ||
description? |
description?: string; |
Human-readable description |
dependencies? |
dependencies?: string[]; |
Feature keys (camelCase) that must also be enabled for this plugin to work |
PluginRegistryEntry interface
📍 src/core/context-nextgen/PluginRegistry.ts:67
Registry entry for an external plugin
Properties
| Property | Type | Description |
|---|---|---|
featureKey |
featureKey: string; |
Feature flag key in ContextFeatures (camelCase, e.g., 'dynamicUI') |
pluginName |
pluginName: string; |
Plugin name (snake_case, e.g., 'dynamic_ui') — must match plugin.name |
factory |
factory: PluginFactory; |
Factory to create plugin instances |
description? |
description?: string; |
Human-readable description |
dependencies? |
dependencies?: string[]; |
Feature keys that must be enabled for this plugin to work |
PluginRegistryInfo interface
📍 src/core/context-nextgen/PluginRegistry.ts:81
Serializable plugin info (no factory reference)
Properties
| Property | Type | Description |
|---|---|---|
featureKey |
featureKey: string; |
- |
pluginName |
pluginName: string; |
- |
description? |
description?: string; |
- |
dependencies? |
dependencies?: string[]; |
- |
PolicyChainConfig interface
📍 src/core/permissions/types.ts:502
Configuration for the PolicyChain evaluator.
Properties
| Property | Type | Description |
|---|---|---|
defaultVerdict? |
`defaultVerdict?: 'allow' | 'deny';` |
PolicyCheckResult interface
📍 src/core/permissions/types.ts:513
Rich result from PermissionPolicyManager.check()
Properties
| Property | Type | Description |
|---|---|---|
allowed |
allowed: boolean; |
Whether the tool is allowed to execute |
blocked |
blocked: boolean; |
Whether the tool is hard-blocked (no approval possible) |
reason |
reason: string; |
Human-readable reason |
policyName? |
policyName?: string; |
Policy that made the deciding verdict |
approvalRequired? |
approvalRequired?: boolean; |
Whether user approval was requested (and possibly granted) |
approvalKey? |
approvalKey?: string; |
Argument-scoped approval key |
approvalScope? |
`approvalScope?: 'once' | 'session' |
auditEntryId? |
auditEntryId?: string; |
ID of audit entry written (if audit storage configured) |
metadata? |
metadata?: Record<string, unknown>; |
Additional metadata from the deciding policy |
PolicyContext interface
📍 src/core/permissions/types.ts:420
Rich context passed to policies for evaluation.
Contains tool identity, arguments, user identity, and tool registration metadata.
Properties
| Property | Type | Description |
|---|---|---|
toolName |
toolName: string; |
Tool being invoked |
args |
args: Record<string, unknown>; |
Parsed arguments for the tool call |
userId? |
userId?: string; |
User identity (from ToolContext.userId) |
roles? |
roles?: string[]; |
User roles (from agent config userRoles) |
agentId? |
agentId?: string; |
Agent ID |
parentAgentId? |
parentAgentId?: string; |
Parent agent ID (for orchestrator workers) |
sessionId? |
sessionId?: string; |
Session ID |
iteration? |
iteration?: number; |
Execution iteration in agentic loop |
executionId? |
executionId?: string; |
Execution ID for tracing |
toolSource? |
toolSource?: string; |
Source identifier (built-in, connector:xxx, mcp, custom) |
toolCategory? |
toolCategory?: string; |
Category grouping (filesystem, web, shell, etc.) |
toolNamespace? |
toolNamespace?: string; |
Registration namespace |
toolTags? |
toolTags?: string[]; |
Registration tags |
toolPermissionConfig? |
toolPermissionConfig?: ToolPermissionConfig; |
Merged permission config from tool definition + registration override. |
| This is the tool author's declaration of risk/scope, possibly overridden | ||
| by the application developer at registration time. |
PolicyDecision interface
📍 src/core/permissions/types.ts:392
Decision returned by a permission policy.
Properties
| Property | Type | Description |
|---|---|---|
verdict |
verdict: PolicyVerdict; |
The verdict |
reason |
reason: string; |
Human-readable reason for the decision |
policyName |
policyName: string; |
Name of the policy that made this decision |
metadata? |
`metadata?: { |
/** If true, this deny can be overridden by user approval */
needsApproval?: boolean;
/** Scoped cache key for argument-aware approval (e.g., "write_file:/workspace/**") */
approvalKey?: string;
/** How long this approval should be cached */
approvalScope?: 'once' | 'session' | 'persistent';
/** Additional policy-specific data */
[key: string]: unknown;
};` | Optional metadata for downstream processing |
PolicyManagerEvents interface
📍 src/core/permissions/PermissionPolicyManager.ts:45
Properties
| Property | Type | Description |
|---|---|---|
'permission:allow' |
'permission:allow': PermissionAuditEntry; |
- |
'permission:deny' |
'permission:deny': PermissionAuditEntry; |
- |
'permission:approval_granted' |
'permission:approval_granted': PermissionAuditEntry; |
- |
'permission:approval_denied' |
'permission:approval_denied': PermissionAuditEntry; |
- |
'permission:audit' |
'permission:audit': PermissionAuditEntry; |
- |
'policy:added' |
'policy:added': { name: string }; |
- |
'policy:removed' |
'policy:removed': { name: string }; |
- |
'session:cleared' |
'session:cleared': {}; |
- |
PortableAgentContext interface
Properties
| Property | Type | Description |
|---|---|---|
features |
features: ResolvedContextFeatures; |
- |
pluginNames |
pluginNames: string[]; |
- |
state |
state: SerializedContextState; |
- |
PortableRealtimeProfile interface
Provider-neutral Realtime profile. Provider credentials are deliberately excluded.
Properties
| Property | Type | Description |
|---|---|---|
provider |
provider: string; |
- |
connectorName |
connectorName: string; |
- |
model |
model: string; |
- |
voice? |
voice?: string; |
- |
PredicateDefinition interface
📍 src/memory/predicates/types.ts:42
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Canonical snake_case name — the id. |
description |
description: string; |
One-line description shown in the LLM prompt + docs. |
category |
category: string; |
Grouping used for prompt chunking (e.g. 'identity', 'task', 'communication'). |
payloadKind? |
`payloadKind?: 'relational' | 'attribute' |
| layer does not enforce it (permissive by design). | ||
subjectTypes? |
subjectTypes?: string[]; |
Typing hint surfaced in the LLM prompt. Not enforced at write time. |
objectTypes? |
objectTypes?: string[]; |
- |
inverse? |
inverse?: string; |
Reverse predicate (e.g. 'reports_to' ↔ 'manages'). Informational only. |
aliases? |
aliases?: string[]; |
Other surface forms that canonicalize to this predicate. Lowercased at |
| register time; lookup is case-insensitive. | ||
defaultImportance? |
defaultImportance?: number; |
0..1. Applied to IFact.importance when the writer omits it. |
rankingWeight? |
rankingWeight?: number; |
Multiplier in Ranking.scoreFact. Folded into RankingConfig.predicateWeights |
| by PredicateRegistry.toRankingWeights. User-supplied weights always win. | ||
isAggregate? |
isAggregate?: boolean; |
Aggregate predicates (counters, sums) — update in place, never supersede. |
| Mutually exclusive with singleValued. | ||
singleValued? |
singleValued?: boolean; |
Single-valued predicates (e.g. current_title). Writing a new fact |
| auto-supersedes the prior visible one for (subject, predicate). Can be | ||
| disabled globally via MemorySystemConfig.predicateAutoSupersede:false. | ||
| Mutually exclusive with isAggregate. | ||
examples? |
examples?: string[]; |
Shown to the LLM in the prompt to disambiguate. Keep ≤ 2 per predicate. |
lifecycle? |
lifecycle?: PredicateLifecycle; |
Temporal/relevance class. Drives addFact's validUntil auto-stamping |
and extraction-prompt rendering. See PredicateLifecycle for semantics. |
||
| Optional — undefined means "no automatic lifecycle behavior." | ||
defaultValidityDays? |
defaultValidityDays?: number; |
When set, addFact stamps validUntil = (observedAt ?? now) + days |
on facts of this predicate that the caller did not provide a validUntil |
||
for. Callers can always override by passing validUntil explicitly. |
Use with care: a too-short window silently archives facts that callers
may still want surfaced. Pair with lifecycle: 'ephemeral' | 'episodic'. |
| excludeFromExtractionPrompt? | excludeFromExtractionPrompt?: boolean; | When true, PredicateRegistry.renderForPrompt omits this predicate
from the LLM-facing vocabulary by default. The predicate remains valid
for direct callers (extractors that already know the name, code paths
that emit it programmatically); only the LLM's view of the vocabulary
narrows. Pass { includeExcluded: true } to render everything.
Use for predicates the library considers extraction noise (per-message communication metadata, vague observations) that should be derived from source metadata aggregation rather than re-extracted into facts. |
PreparedContext interface
📍 src/core/context-nextgen/types.ts:717
Result of prepare() - ready for a model call.
Properties
| Property | Type | Description |
|---|---|---|
tools? |
tools?: FunctionToolDefinition[]; |
Snapshot of tool definitions counted for this request (additive). |
input |
input: InputItem[]; |
Final input items array for LLM |
budget |
budget: ContextBudget; |
Token budget breakdown |
compacted |
compacted: boolean; |
Whether compaction was performed |
compactionLog |
compactionLog: string[]; |
Log of compaction actions taken |
PreResolvedBinding interface
📍 src/memory/integration/defaultExtractionPrompt.ts:143
A label already bound to an entity before the LLM runs. Typically produced
from signal metadata (email headers, calendar attendees, Slack user list) —
strong identifiers let us resolve deterministically and hand the LLM a
pre-bound vocabulary so it can reference m1, m2 directly in its output
without re-declaring them as mentions.
Properties
| Property | Type | Description |
|---|---|---|
label |
label: string; |
Stable local label (e.g. m1). The LLM must use this verbatim in facts. |
entity |
entity: IEntity; |
Resolved entity — surfaced in the prompt as a human-readable hint. |
role? |
role?: string; |
Source role (e.g. from, to, cc, author, attendee). Free-form. |
ProcessOptions interface
📍 src/core/TemplateEngine.ts:57
Options for process/processSync.
Properties
| Property | Type | Description |
|---|---|---|
phase? |
`phase?: 'static' | 'dynamic' |
ProfileGeneratorInput interface
Input passed to IProfileGenerator.generate. Regeneration is incremental:
the generator receives the prior profile (if any) as its starting point and
only the deltas since then — new facts plus IDs of facts whose claims should
be dropped because they've been archived or superseded.
First regen (no prior): priorProfile is undefined, newFacts is the
full set of atomic facts visible to the target scope, and invalidatedFactIds
is empty. Generator should synthesize from scratch.
Subsequent regens: priorProfile.details is the authoritative starting
text; the generator should evolve it by folding in newFacts and removing
any claims backed only by facts whose IDs appear in invalidatedFactIds.
Properties
| Property | Type | Description |
|---|---|---|
entity |
entity: IEntity; |
- |
newFacts |
newFacts: IFact[]; |
Atomic facts added since the prior profile was generated (observedAt > |
| prior.createdAt, archived=false). On first regen: all atomic facts. | ||
| Capped at 500 by MemorySystem. | ||
priorProfile |
`priorProfile: IFact | undefined;` |
invalidatedFactIds |
invalidatedFactIds: FactId[]; |
IDs of facts the generator should drop from the profile: |
- Facts superseded by new ones (
supersedes→ predecessor id). - Facts archived directly (via
archiveFact) that were visible at prior regen time. The generator never sees these facts' contents — only their IDs — so it cannot reference them in the updated profile, only remove existing mentions. | |targetScope|targetScope: ScopeFields;| - |
ProviderStateContent interface
📍 src/domain/entities/Content.ts:118
Opaque provider-owned content that must be replayed verbatim. This is used for protocol state such as Anthropic server-tool calls/results; applications should persist it but must not interpret or manufacture it.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: ContentType.PROVIDER_STATE; |
- |
provider |
provider: string; |
- |
data |
data: Record<string, unknown>; |
- |
ProviderStopDetails interface
📍 src/domain/entities/Response.ts:57
Structured stop detail from a provider. Currently populated for Anthropic
refusals ({ type: 'refusal', category, explanation }) — category names
which safety classifier fired (e.g. 'cyber', 'bio'). Surfaced so a refusal is
diagnosable rather than an opaque empty/failed response.
Properties
| Property | Type | Description |
|---|---|---|
type? |
type?: string; |
Discriminator, e.g. 'refusal'. |
category? |
`category?: string | null;` |
explanation? |
`explanation?: string | null;` |
RankingConfig interface
Properties
| Property | Type | Description |
|---|---|---|
predicateWeights? |
predicateWeights?: Record<string, number>; |
- |
recencyHalfLifeDays? |
recencyHalfLifeDays?: number; |
- |
minConfidence? |
minConfidence?: number; |
- |
RawMongoClientLike interface
📍 src/memory/adapters/mongo/RawMongoCollection.ts:70
Optional client surface for sessions/transactions.
Methods
startSession()
startSession(): {
withTransaction<R>(fn: () => Promise<R>): Promise<R>;
endSession(): Promise<void> | void;
};
Returns: { withTransaction<R>(fn: () => Promise<R>): Promise<R>; endSession(): void | Promise<void>; }
RawMongoDriverCollection interface
📍 src/memory/adapters/mongo/RawMongoCollection.ts:41
Structural shape of the subset of mongodb-driver's Collection we use. Matches mongodb@5+ and mongodb@6+ Collection surface.
Methods
insertOne()
insertOne(doc: T): Promise<{ insertedId: ObjectIdLike | string }>;
Parameters:
doc:T
Returns: Promise<{ insertedId: string | ObjectIdLike; }>
insertMany()
insertMany(docs: T[]): Promise<{ insertedIds: Record<number, ObjectIdLike | string> }>;
Parameters:
docs:T[]
Returns: Promise<{ insertedIds: Record<number, string | ObjectIdLike>; }>
updateOne()
updateOne(
filter: MongoFilter,
update: MongoUpdate,
opts?: { upsert?: boolean },
): Promise<MongoUpdateResult>;
Parameters:
filter:MongoFilterupdate:MongoUpdateopts:{ upsert?: boolean | undefined; } | undefined(optional)
Returns: Promise<MongoUpdateResult>
deleteOne()
deleteOne(filter: MongoFilter): Promise<unknown>;
Parameters:
filter:MongoFilter
Returns: Promise<unknown>
deleteMany()
deleteMany(filter: MongoFilter): Promise<unknown>;
Parameters:
filter:MongoFilter
Returns: Promise<unknown>
findOne()
findOne(filter: MongoFilter, opts?: MongoFindOptions): Promise<T | null>;
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: Promise<T | null>
find()
find(filter: MongoFilter, opts?: MongoFindOptions): {
toArray(): Promise<T[]>;
};
Parameters:
filter:MongoFilteropts:MongoFindOptions | undefined(optional)
Returns: { toArray(): Promise<T[]>; }
countDocuments()
countDocuments(filter: MongoFilter): Promise<number>;
Parameters:
filter:MongoFilter
Returns: Promise<number>
aggregate()
aggregate(pipeline: unknown[]): { toArray(): Promise<unknown[]> };
Parameters:
pipeline:unknown[]
Returns: { toArray(): Promise<unknown[]>; }
createIndex()
createIndex(spec: Record<string, 1 | -1>, opts?: unknown): Promise<string>;
Parameters:
spec:Record<string, 1 | -1>opts:unknown(optional)
Returns: Promise<string>
createSearchIndex()?
Atlas Search / Vector Search creation (node driver v6+). Optional on the underlying driver so structural typing stays permissive.
createSearchIndex?(definition: {
name: string;
type?: 'search' | 'vectorSearch';
definition: Record<string, unknown>;
}): Promise<string>;
Parameters:
definition:{ name: string; type?: "search" | "vectorSearch" | undefined; definition: Record<string, unknown>; }
Returns: Promise<string>
listSearchIndexes()?
listSearchIndexes?(name?: string): { toArray(): Promise<Array<Record<string, unknown>>> };
Parameters:
name:string | undefined(optional)
Returns: { toArray(): Promise<Record<string, unknown>[]>; }
dropSearchIndex()?
dropSearchIndex?(name: string): Promise<void>;
Parameters:
name:string
Returns: Promise<void>
ReadFileResult interface
📍 src/tools/filesystem/types.ts:94
Result of a file read operation
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
content? |
content?: string; |
- |
lines? |
lines?: number; |
- |
truncated? |
truncated?: boolean; |
- |
encoding? |
encoding?: string; |
- |
size? |
size?: number; |
- |
error? |
error?: string; |
- |
path? |
path?: string; |
- |
RealtimeMessageChannel interface
📍 src/capabilities/voice/openai/RealtimeChannel.ts:11
Minimal text channel shared by WebRTC data channels, Electron MessagePorts, workers, and other host bridges. Authentication and routing stay with the host.
Methods
open()?
open?(options?: { signal?: AbortSignal }): Promise<void>;
Parameters:
options:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<void>
getSessionCreatedMessage()?
Compatibility replay hook for a channel attached after session.created.
getSessionCreatedMessage?(): string | undefined;
Returns: string | undefined
send()
send(message: string): void;
Parameters:
message:string
Returns: void
close()
close(code?: number, reason?: string): void;
Parameters:
code:number | undefined(optional)reason:string | undefined(optional)
Returns: void
onMessage()
onMessage(handler: (message: string) => void): () => void;
Parameters:
handler:(message: string) => void
Returns: () => void
onClose()
onClose(handler: (code: number, reason: string) => void): () => void;
Parameters:
handler:(code: number, reason: string) => void
Returns: () => void
onError()
onError(handler: (error: Error) => void): () => void;
Parameters:
handler:(error: Error) => void
Returns: () => void
Properties
| Property | Type | Description |
|---|---|---|
isOpen |
readonly isOpen: boolean; |
- |
bufferedAmount? |
readonly bufferedAmount?: number; |
- |
RealtimePipelineConfig interface
📍 src/capabilities/voice/types.ts:238
Realtime pipeline configuration — direct voice-to-voice via OpenAI Realtime API. No separate STT/TTS needed — the model handles audio natively.
Properties
| Property | Type | Description |
|---|---|---|
pipeline |
pipeline: 'realtime'; |
- |
voice? |
voice?: OpenAIRealtimeVoice; |
Voice for the realtime model. OpenAI recommends marin or cedar. Default: marin. |
speed? |
speed?: number; |
Audio playback speed from 0.25 to 1.5. Default: 1.0. |
turnDetection? |
`turnDetection?: 'server_vad' | 'semantic_vad' |
- 'server_vad': silence-based server VAD (default)
- 'semantic_vad': model-based end-of-turn detection (OpenAI only)
- 'none': local EnergyVAD commits each turn manually |
|
vadThreshold?|vadThreshold?: number;| VAD threshold (0.0-1.0) for server_vad mode. Default: 0.5 | |silenceDurationMs?|silenceDurationMs?: number;| Silence duration in ms before end-of-turn. Default: 500 | |prefixPaddingMs?|prefixPaddingMs?: number;| Audio retained before server VAD speech start. Default: 400ms. | |idleTimeoutMs?|idleTimeoutMs?: number;| Optional server VAD idle timeout that prompts the model after silence. | |semanticVADEagerness?|semanticVADEagerness?: 'low' | 'medium' | 'high' | 'auto';| Semantic VAD response eagerness. Default: auto. | |noiseReduction?|noiseReduction?: 'near_field' | 'far_field' | 'none';| Input noise reduction profile. Default: near_field. | |inputTranscription?|inputTranscription?: boolean;| Enable input audio transcription for hooks/logging. Default: true | |transcriptionModel?|transcriptionModel?: string;| Transcription model for input audio. Default: 'gpt-4o-transcribe' | |transcriptionLanguage?|transcriptionLanguage?: string;| Language hint for input transcription. | |realtime?|realtime?: Omit<OpenAIRealtimeSessionConfig, 'type' | 'model'>;| Advanced GA options including reasoning, tracing, truncation, stored prompts, remote MCP tools, parallel tool calls, and safety identifier. Agent instructions and local tools are merged automatically. | |safetyIdentifier?|safetyIdentifier?: string;| Stable, privacy-preserving end-user identifier sent in the OpenAI header. | |approveMCP?|approveMCP?: ( request: OpenAIRealtimeMCPApprovalRequest, session: VoiceSessionInfo, ) => Promise<OpenAIRealtimeMCPApprovalDecision> | OpenAIRealtimeMCPApprovalDecision;| Approval handler for provider-hosted OpenAI MCP tools. Requests fail closed when this callback is omitted. |
ReasoningItem interface
📍 src/domain/entities/Message.ts:36
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'reasoning'; |
- |
id |
id: string; |
- |
effort? |
effort?: ReasoningEffort; |
- |
summary? |
summary?: string; |
- |
encrypted_content? |
encrypted_content?: string; |
- |
RecaseIdentifierOptions interface
📍 src/memory/identifierMigration.ts:42
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: string; |
Restrict to entities whose identifiers include this kind. Required. |
scope |
scope: ScopeFilter; |
Adapter-level scope filter. The migration walks one scope at a time — |
| callers iterate scopes themselves to match their tenant model. | ||
recover |
recover: IdentifierRecoveryFn; |
Recovery function. See IdentifierRecoveryFn. |
batchSize? |
batchSize?: number; |
Page size for the initial entity listing. Default 200. |
dryRun? |
dryRun?: boolean; |
When true, log diagnostic counts but do not write. Default false. |
logger? |
logger?: { info: (msg: string) => void; warn: (msg: string) => void }; |
Optional logger — defaults to console. |
RecaseIdentifierResult interface
📍 src/memory/identifierMigration.ts:66
Properties
| Property | Type | Description |
|---|---|---|
scanned |
scanned: number; |
- |
recased |
recased: number; |
- |
skipped |
skipped: number; |
- |
unchanged |
unchanged: number; |
- |
errors |
errors: Array<{ entityId: string; reason: string }>; |
- |
RelatedEvent interface
Properties
| Property | Type | Description |
|---|---|---|
event |
event: IEntity; |
- |
role |
role: string; |
- |
when? |
when?: Date; |
Start time pulled from event.metadata, if present. |
RelatedItemsResult interface
Properties
| Property | Type | Description |
|---|---|---|
tasks |
tasks: RelatedItemHit<RelatedTask>[]; |
- |
events |
events: RelatedItemHit<RelatedEvent>[]; |
- |
RemoteOutcomeAccess interface
📍 src/portable/outcomeTypes.ts:63
Properties
| Property | Type | Description |
|---|---|---|
operation |
operation: keyof RemoteOutcomeTransport; |
- |
packageId |
packageId: string; |
- |
sessionId? |
sessionId?: string; |
- |
requestId? |
requestId?: string; |
- |
toolName? |
toolName?: string; |
- |
effect? |
effect?: RemoteOutcomeEffect; |
Actual current registration effect; supplied by the server, never wire hints. |
arguments? |
arguments?: Readonly<Record<string, unknown>>; |
- |
reference? |
reference?: Readonly<EvidenceReference>; |
- |
RemoteOutcomeCheckpoint interface
📍 src/portable/outcomeTypes.ts:98
Properties
| Property | Type | Description |
|---|---|---|
version |
version: 1; |
- |
operations |
`operations: Array<{ |
operationId: string; sessionId: string; toolName: string; argumentsFingerprint: string;
admission: EvidenceReference;
proxyReceipt?: EvidenceReference;
reference?: EvidenceReference;
}>;` | Metadata is a recovery hint; the owning scoped backend must establish observation proof. |
RemoteOutcomeReceipt interface
📍 src/portable/outcomeTypes.ts:33
Properties
| Property | Type | Description |
|---|---|---|
observedSessionId |
observedSessionId: string; |
Actual server instance answering this lookup; may differ after restart. |
state |
`state: 'pending' | 'settled' |
admission |
`admission: 'not_started' | 'started' |
toolName? |
toolName?: string; |
- |
effect? |
effect?: RemoteOutcomeEffect; |
Actual current server registration metadata, selected independently of the request hint. |
argumentsFingerprint? |
argumentsFingerprint?: string; |
- |
serverOutcome? |
serverOutcome?: ToolExecutionOutcome; |
- |
source? |
source?: EvidenceReference; |
- |
error? |
error?: { code: string; message: string }; |
- |
RemoteOutcomeReport interface
📍 src/portable/outcomeTypes.ts:82
Properties
| Property | Type | Description |
|---|---|---|
operationId |
operationId: string; |
- |
sessionId |
sessionId: string; |
- |
toolName |
toolName: string; |
- |
argumentsFingerprint |
argumentsFingerprint: string; |
- |
state |
`state: 'pending' | 'settled' |
receipt? |
receipt?: Readonly<RemoteOutcomeReceipt>; |
- |
proxyOutcome? |
proxyOutcome?: Readonly<ToolExecutionOutcome>; |
Actual proxy observation; never overwritten with server IDs/time/completion. |
admission? |
admission?: Readonly<EvidenceReference>; |
Immutable scoped binding of proxy invocation, remote request and argument fingerprint. |
reference? |
reference?: Readonly<EvidenceReference>; |
- |
pendingSource |
pendingSource: boolean; |
- |
accounting |
accounting: 'external_unknown'; |
Tool/service charges and nested remote models are not silently charged as local LLM calls. |
RemoteOutcomeTransport interface
📍 src/portable/outcomeTypes.ts:56
Host-supplied authenticated transport; none of these fields supply tenant authority.
Methods
negotiate()
negotiate(request: OutcomePackageRequest, options?: { signal?: AbortSignal }): Promise<OutcomeNegotiation>;
Parameters:
request:OutcomePackageRequestoptions:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<OutcomeNegotiation>
execute()
execute(request: OutcomeExecuteRequest, options?: { signal?: AbortSignal }): Promise<OutcomeExecuteResponse>;
Parameters:
request:OutcomeExecuteRequestoptions:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<OutcomeExecuteResponse>
getReceipt()
getReceipt(request: OutcomeRequestIdentity, options?: { signal?: AbortSignal }): Promise<RemoteOutcomeReceipt>;
Parameters:
request:OutcomeRequestIdentityoptions:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<RemoteOutcomeReceipt>
cancel()
cancel(request: OutcomeCancelRequest, options?: { signal?: AbortSignal }): Promise<OutcomeCancelResponse>;
Parameters:
request:OutcomeCancelRequestoptions:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<OutcomeCancelResponse>
readEvidence()
readEvidence(request: OutcomeEvidenceRequest, options?: { signal?: AbortSignal }): Promise<OutcomeEvidenceResponse>;
Parameters:
request:OutcomeEvidenceRequestoptions:{ signal?: AbortSignal | undefined; } | undefined(optional)
Returns: Promise<OutcomeEvidenceResponse>
ResearchFinding interface
📍 src/capabilities/researchAgent/types.ts:159
Research finding stored in memory
Properties
| Property | Type | Description |
|---|---|---|
source |
source: string; |
Source that provided this finding |
query |
query: string; |
Original query that found this |
summary |
summary: string; |
Key insight or summary |
details? |
details?: string; |
Supporting details |
references |
references: string[]; |
References used |
confidence? |
confidence?: number; |
Confidence level (0-1) |
timestamp |
timestamp: number; |
When this was found |
ResearchProgress interface
📍 src/capabilities/researchAgent/types.ts:236
Research progress event
Properties
| Property | Type | Description |
|---|---|---|
phase |
`phase: 'searching' | 'processing' |
currentQuery? |
currentQuery?: string; |
- |
currentSource? |
currentSource?: string; |
- |
queriesCompleted |
queriesCompleted: number; |
- |
totalQueries |
totalQueries: number; |
- |
resultsProcessed |
resultsProcessed: number; |
- |
totalResults |
totalResults: number; |
- |
findingsGenerated |
findingsGenerated: number; |
- |
ResearchQuery interface
📍 src/capabilities/researchAgent/types.ts:195
A query in the research plan
Properties
| Property | Type | Description |
|---|---|---|
query |
query: string; |
Query string |
sources? |
sources?: string[]; |
Specific sources for this query (empty = all) |
priority? |
priority?: number; |
Priority (higher = more important) |
ResearchResult interface
📍 src/capabilities/researchAgent/types.ts:207
Research execution result
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
Whether research completed successfully |
goal |
goal: string; |
Original goal |
queriesExecuted |
queriesExecuted: number; |
Queries executed |
resultsFound |
resultsFound: number; |
Results found |
resultsProcessed |
resultsProcessed: number; |
Results processed |
findingsCount |
findingsCount: number; |
Findings generated |
synthesis? |
synthesis?: string; |
Final synthesis (if generated) |
error? |
error?: string; |
Error if failed |
metrics? |
`metrics?: { |
totalDurationMs: number;
searchDurationMs: number;
processDurationMs: number;
synthesizeDurationMs: number;
};` | Execution metrics |
ResolvedDeepSeekHost interface
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:147
Properties
| Property | Type | Description |
|---|---|---|
profile |
profile: DeepSeekHostProfile; |
- |
baseURL |
baseURL: string; |
- |
transport |
transport: DeepSeekTransport; |
- |
ResolveDeepSeekHostOptions interface
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:141
Properties
| Property | Type | Description |
|---|---|---|
host? |
host?: DeepSeekHost; |
- |
baseURL? |
baseURL?: string; |
- |
transport? |
transport?: DeepSeekTransport; |
- |
ResolveEntityOptions interface
Properties
| Property | Type | Description |
|---|---|---|
limit? |
limit?: number; |
- |
threshold? |
threshold?: number; |
Minimum confidence for a candidate to be returned. Default: 0.5. |
ResolveEntityQuery interface
Properties
| Property | Type | Description |
|---|---|---|
surface |
surface: string; |
The raw text the LLM extracted — e.g. "Microsoft", "Q3 Planning", "John". |
type? |
type?: string; |
Hint — 'person', 'organization', 'task', 'event', etc. |
identifiers? |
identifiers?: Identifier[]; |
Strong identifiers parsed from the signal, if any. |
disambiguationEntityIds? |
disambiguationEntityIds?: EntityId[]; |
Other entities already resolved in the same extraction — used to |
| disambiguate among multiple fuzzy candidates by shared context. | ||
| Resolution-time hint only; does NOT persist on the resolved entity. | ||
(For the persistent multi-entity binding, see IEntity.contextIds.) |
||
contextEntityIds? |
contextEntityIds?: EntityId[]; |
- |
RestrainedExtractionInput interface
📍 src/memory/integration/RestrainedExtractionContract.ts:48
Properties
| Property | Type | Description |
|---|---|---|
mentions |
mentions: Record<string, ExtractionMention>; |
Mention map keyed by local label, as produced by the parser. |
facts |
facts: ExtractionFactSpec[]; |
Fact spec list, as produced by the parser. |
whyActionable? |
whyActionable?: string; |
Top-level justification, as parsed (undefined if absent). |
RestrainedExtractionOptions interface
📍 src/memory/integration/RestrainedExtractionContract.ts:57
Properties
| Property | Type | Description |
|---|---|---|
profile |
profile: EagernessProfile; |
- |
stage? |
stage?: RestraintStage; |
Stage label for emitted events. Default signalExtraction. |
anchors? |
anchors?: Anchor[]; |
Active anchors to validate servesAnchorId against. Empty / undefined ⇒ |
| no active anchors (matters under strict priority binding). | ||
onDecision? |
onDecision?: RestraintEventListener; |
Live event listener — fires once per decision (kept and dropped). |
RestrainedExtractionResult interface
📍 src/memory/integration/RestrainedExtractionContract.ts:68
Properties
| Property | Type | Description |
|---|---|---|
whyActionable? |
whyActionable?: string; |
Justification preserved when present. |
events |
events: RestraintEvent[]; |
The full decision log, including kept items. |
summary |
`summary: { |
factsKept: number;
factsDropped: number;
mentionsKept: number;
mentionsDropped: number;
/** Set when output was suppressed wholesale (e.g. `whyActionable` missing). */
suppressed: boolean;
};| Counts derived fromevents` for quick assertions. |
RestraintEvent interface
📍 src/memory/integration/RestraintEvent.ts:57
Properties
| Property | Type | Description |
|---|---|---|
kind |
kind: RestraintEventKind; |
- |
stage |
stage: RestraintStage; |
- |
itemRef |
itemRef: string; |
Reference to the item this event is about — fact index, mention label, task id, etc. |
reasonCode |
reasonCode: string; |
Stable code for filtering / dashboards (e.g. evidence_missing). |
reasonText |
reasonText: string; |
Human-readable reason. Suitable for surfacing to operators. |
modelInfo? |
modelInfo?: RestraintModelInfo; |
Set when the decision involved a model call. |
meta? |
meta?: Record<string, unknown>; |
Free-form additional context — e.g. anchor ids tried, snippet of the bad quote. |
at? |
at?: Date; |
Wall-clock at emission. Defaults to new Date() at construction time. |
RoutineContinuation interface
📍 src/core/routines/types.ts:66
Same-process capability issued by one runner; JSON cannot restore it.
Properties
| Property | Type | Description |
|---|---|---|
[continuationBrand] |
readonly [continuationBrand]: true |
- |
RoutineDefinition interface
📍 src/domain/entities/Routine.ts:85
A reusable routine definition (template).
Defines what to do but has no runtime state. Multiple RoutineExecutions can be created from one RoutineDefinition.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique routine identifier |
name |
name: string; |
Human-readable name |
description |
description: string; |
Description of what this routine accomplishes |
version? |
version?: string; |
Version string for tracking routine evolution |
tasks |
tasks: TaskInput[]; |
Task templates in execution order (dependencies may override order) |
requiredTools? |
requiredTools?: string[]; |
Tool names that must be available before starting |
requiredPlugins? |
requiredPlugins?: string[]; |
Plugin names that must be enabled before starting (e.g. 'working_memory') |
instructions? |
instructions?: string; |
Additional instructions injected into system prompt when routine is active |
concurrency? |
concurrency?: PlanConcurrency; |
Concurrency settings for task execution |
allowDynamicTasks? |
allowDynamicTasks?: boolean; |
Whether the LLM can dynamically add/modify tasks during execution. Default: false |
parameters? |
parameters?: RoutineParameter[]; |
Input parameters this routine accepts (templates use {{param.name}}) |
preSteps? |
preSteps?: DeterministicStep[]; |
Deterministic steps to execute BEFORE the agent-based task loop. |
| Results are injected into agent context for use by tasks. | ||
postSteps? |
postSteps?: DeterministicStep[]; |
Deterministic steps to execute AFTER the agent-based task loop completes. |
| Can reference task results via {{result.TASK_NAME}} templates. | ||
postStepsTrigger? |
`postStepsTrigger?: 'on-success' | 'always';` |
timeoutMs? |
timeoutMs?: number; |
Max wall-clock time for entire execution (preSteps + tasks + postSteps) in ms. |
| Default: 3600000 (1 hour). Set to 0 to disable. | ||
tags? |
tags?: string[]; |
Tags for categorization and filtering |
author? |
author?: string; |
Author/creator |
createdAt |
createdAt: string; |
When the definition was created (ISO string) |
updatedAt |
updatedAt: string; |
When the definition was last updated (ISO string) |
metadata? |
metadata?: Record<string, unknown>; |
Metadata for extensions |
RoutineDefinitionInput interface
📍 src/domain/entities/Routine.ts:172
Input for creating a RoutineDefinition. id, createdAt, updatedAt are auto-generated if not provided.
Properties
| Property | Type | Description |
|---|---|---|
id? |
id?: string; |
- |
name |
name: string; |
- |
description |
description: string; |
- |
version? |
version?: string; |
- |
tasks |
tasks: TaskInput[]; |
- |
requiredTools? |
requiredTools?: string[]; |
- |
requiredPlugins? |
requiredPlugins?: string[]; |
- |
instructions? |
instructions?: string; |
- |
concurrency? |
concurrency?: PlanConcurrency; |
- |
allowDynamicTasks? |
allowDynamicTasks?: boolean; |
- |
parameters? |
parameters?: RoutineParameter[]; |
- |
preSteps? |
preSteps?: DeterministicStep[]; |
- |
postSteps? |
postSteps?: DeterministicStep[]; |
- |
postStepsTrigger? |
`postStepsTrigger?: 'on-success' | 'always';` |
timeoutMs? |
timeoutMs?: number; |
- |
tags? |
tags?: string[]; |
- |
author? |
author?: string; |
- |
createdAt? |
createdAt?: string; |
Preserve original creation timestamp on updates. Defaults to now if omitted. |
metadata? |
metadata?: Record<string, unknown>; |
- |
RoutineExecution interface
📍 src/domain/entities/Routine.ts:214
Runtime state when executing a routine. Created from a RoutineDefinition, delegates task management to Plan.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique execution ID |
routineId |
routineId: string; |
Reference to the routine definition ID |
plan |
plan: Plan; |
The live plan managing task execution (created via createPlan) |
status |
status: RoutineExecutionStatus; |
Current execution status |
progress |
progress: number; |
Overall progress (0-100) based on completed tasks |
startedAt? |
startedAt?: number; |
Timestamps |
completedAt? |
completedAt?: number; |
- |
lastUpdatedAt |
lastUpdatedAt: number; |
- |
error? |
error?: string; |
Error message if failed |
metadata? |
metadata?: Record<string, unknown>; |
Metadata |
RoutineExecutionRecord interface
📍 src/domain/entities/RoutineExecutionRecord.ts:71
Properties
| Property | Type | Description |
|---|---|---|
executionId |
executionId: string; |
- |
routineId |
routineId: string; |
- |
routineName |
routineName: string; |
- |
status |
status: RoutineExecutionStatus; |
- |
progress |
progress: number; |
- |
tasks |
tasks: RoutineTaskSnapshot[]; |
- |
steps |
steps: RoutineExecutionStep[]; |
- |
taskCount |
taskCount: number; |
- |
connectorName |
connectorName: string; |
- |
model |
model: string; |
- |
error? |
error?: string; |
- |
startedAt? |
startedAt?: number; |
- |
completedAt? |
completedAt?: number; |
- |
lastActivityAt? |
lastActivityAt?: number; |
- |
trigger? |
`trigger?: { |
type: 'schedule' | 'event' | 'manual';
source?: string;
event?: string;
payload?: unknown;
};| - | |metadata?|metadata?: Record<string, unknown>;` | - |
RoutineExecutionStep interface
📍 src/domain/entities/RoutineExecutionRecord.ts:35
Properties
| Property | Type | Description |
|---|---|---|
timestamp |
timestamp: number; |
- |
taskName |
taskName: string; |
- |
type |
type: RoutineStepType; |
- |
data? |
data?: Record<string, unknown>; |
- |
RoutineInspection interface
📍 src/core/routines/types.ts:97
Properties
| Property | Type | Description |
|---|---|---|
operationId |
readonly operationId: string; |
- |
lifecycle |
`readonly lifecycle: 'running' | 'paused' |
lastResult? |
readonly lastResult?: RoutineRunResult; |
- |
accounting |
`readonly accounting: 'shared' | 'independent';` |
closed |
readonly closed: boolean; |
- |
cleanupError? |
readonly cleanupError?: string; |
- |
sources |
readonly sources: readonly RoutineSource[]; |
- |
omittedSources |
readonly omittedSources: number; |
- |
sourceIndexId |
readonly sourceIndexId: string; |
- |
RoutineParameter interface
📍 src/domain/entities/Routine.ts:19
A parameter that a routine accepts as input. Enables parameterized, reusable routines.
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Parameter name (used as {{param.name}} in templates) |
description |
description: string; |
Human-readable description |
required? |
required?: boolean; |
Whether this parameter must be provided (default: false) |
default? |
default?: unknown; |
Default value when not provided |
RoutineReport interface
📍 src/core/routines/types.ts:67
Properties
| Property | Type | Description |
|---|---|---|
operationId |
readonly operationId: string; |
- |
observations |
readonly observations: readonly RoutineObservation[]; |
- |
usage? |
readonly usage?: Readonly<ModelTaskSnapshot>; |
- |
usageOmitted? |
`readonly usageOmitted?: 'observation_capacity' | 'unavailable';` |
accounting |
`readonly accounting: 'shared' | 'independent';` |
RoutineRunner interface
📍 src/core/routines/types.ts:120
Methods
run()
run(request: RoutineRunRequest): Promise<RoutineRunResult>;
Parameters:
request:RoutineRunRequest
Returns: Promise<RoutineRunResult>
resume()
resume(continuation: RoutineContinuation, options: {
authorize(): boolean | Promise<boolean>;
execution?: ExecutionBinding;
}): Promise<RoutineRunResult>;
Parameters:
continuation:RoutineContinuationoptions:{ authorize(): boolean | Promise<boolean>; execution?: ExecutionBinding | undefined; }
Returns: Promise<RoutineRunResult>
asTool()
asTool(options: RoutineToolOptions): ToolFunction<Record<string, unknown>, RoutineToolResult>;
Parameters:
options:RoutineToolOptions
Returns: ToolFunction<Record<string, unknown>, RoutineToolResult>
inspect()
inspect(operationId: string): RoutineInspection | null;
Parameters:
operationId:string
Returns: RoutineInspection | null
readSource()
Host-only source recovery remains available for retained data after close.
readSource(operationId: string, sourceId: string, options?: { maxBytes?: number }): Promise<unknown>;
Parameters:
operationId:stringsourceId:stringoptions:{ maxBytes?: number | undefined; } | undefined(optional)
Returns: Promise<unknown>
acknowledgeSource()
Host assertion of archival through existing evidence/storage; never resumes actions.
acknowledgeSource(operationId: string, sourceId: string, reference: EvidenceReference): void;
Parameters:
operationId:stringsourceId:stringreference:EvidenceReference
Returns: void
close()
Invalidates execution handles and requests cancellation; does not assert work stopped.
close(): void;
Returns: void
RoutineRunnerOptions interface
📍 src/core/routines/types.ts:112
Methods
verify()
verify(observation: RoutineObservation, context: VerificationContext): VerificationDecision | Promise<VerificationDecision>;
Parameters:
observation:RoutineObservationcontext:VerificationContext
Returns: VerificationDecision | Promise<VerificationDecision>
onProgress()?
onProgress?(event: RoutineProgress): void;
Parameters:
event:RoutineProgress
Returns: void
Properties
| Property | Type | Description |
|---|---|---|
maxObservationBytes? |
maxObservationBytes?: number; |
Aggregate observation view allowance; default 1 MiB. Unstored sources are retained. |
maxActiveOperations? |
maxActiveOperations?: number; |
Includes paused and still-settling operations; default 32. |
RoutineSource interface
📍 src/core/routines/types.ts:15
Properties
| Property | Type | Description |
|---|---|---|
id |
readonly id: string; |
- |
kind |
`readonly kind: 'response' | 'step' |
retained |
`readonly retained: 'operation' | 'evidence';` |
reference? |
readonly reference?: Readonly<EvidenceReference>; |
- |
data? |
readonly data?: unknown; |
Small tool sources can be inline; other bodies use the phase/step fields or a reference. |
RoutineStepObservation interface
📍 src/core/routines/types.ts:31
Properties
| Property | Type | Description |
|---|---|---|
id |
readonly id: string; |
- |
name |
readonly name: string; |
- |
phase |
`readonly phase: 'pre' | 'post';` |
state |
`readonly state: 'succeeded' | 'failed' |
result? |
readonly result?: unknown; |
- |
sourceId? |
readonly sourceId?: string; |
- |
references? |
readonly references?: readonly EvidenceReference[]; |
- |
RoutineSummary interface
📍 src/domain/entities/Routine.ts:156
Slim projection of a RoutineDefinition for listing.
Returned by IRoutineDefinitionStorage.list(). Use load() to fetch the full definition (tasks, pre/postSteps, instructions, etc.).
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
name |
name: string; |
- |
description |
description: string; |
- |
version? |
version?: string; |
- |
author? |
author?: string; |
- |
tags? |
tags?: string[]; |
- |
taskCount |
taskCount: number; |
- |
parameterNames? |
parameterNames?: string[]; |
- |
updatedAt |
updatedAt: string; |
- |
RunSuiteOptions interface
📍 src/testing/integration/types.ts:158
Options for running a test suite.
Properties
| Property | Type | Description |
|---|---|---|
userId? |
userId?: string; |
User ID passed to ToolContext |
connectorName? |
connectorName?: string; |
Connector name (for result tracking) |
onProgress? |
onProgress?: (result: TestCaseResult) => void; |
Called after each test case completes (for real-time UI updates) |
signal? |
signal?: AbortSignal; |
Abort signal for cancellation |
ScopeFields interface
Visibility scope on an entity or fact.
- (none, none) → global (visible to all)
- (groupId, none) → group-wide
- (none, ownerId) → user-private across all groups
- (groupId, ownerId) → user-private within a specific group
Properties
| Property | Type | Description |
|---|---|---|
groupId? |
groupId?: string; |
- |
ownerId? |
ownerId?: string; |
- |
ScopeFilter interface
Caller's scope context. A record is visible iff: (!record.groupId || record.groupId === filter.groupId) AND (!record.ownerId || record.ownerId === filter.userId)
Properties
| Property | Type | Description |
|---|---|---|
groupId? |
groupId?: string; |
- |
userId? |
userId?: string; |
- |
principals? |
principals?: string[]; |
Caller's principal token set (user:<id>, entity:<id>, group:<id>, |
world, …). Its PRESENCE (not its length) is AUTHORITATIVE: read/write |
||
filtering and canAccess use the principal model |
||
(readPrincipals/writePrincipals intersect this set) and ignore |
||
userId/groupId for the access decision — those identities are expected |
||
| to already be encoded as tokens here. An empty array means "principal mode, | ||
| no grants" → matches/authorizes nothing. When the field is ABSENT, the | ||
| legacy owner/group/world path runs unchanged (backward compatible for | ||
| consumers that don't supply principals). |
MIGRATION: there is NO legacy fallback for principal callers in EITHER
path. Query-time, a principal $in won't match rows lacking
readPrincipals; in-process, canAccess denies them. So an un-materialized
row is invisible to a principal caller everywhere. Every entity/fact row
MUST be backfilled (see MemorySystem.backfillAccessPrincipals) BEFORE a
host starts passing principals. See access/principals.ts. |
ScoreThresholds interface
Properties
| Property | Type | Description |
|---|---|---|
auto? |
auto?: number; |
Score ≥ this → action 'auto-merge'. Default 0.92. |
review? |
review?: number; |
Score ≥ this (and < auto) → action 'review'. Default 0.75. |
weights? |
weights?: Partial<SignalWeights>; |
Partial weight overrides. |
eventStartTimeDeltaMinutes? |
eventStartTimeDeltaMinutes?: number; |
Threshold for the event-time hard-zero rule (metadataStartTimeConflict). |
Default 60 minutes. Both entities must carry metadata.startTime for the |
||
| rule to fire — missing on either side → not a conflict, signal N/A. | ||
embeddingCosineFloor? |
embeddingCosineFloor?: number; |
Below this cosine value, embedding contribution is 0. Default 0.70. |
embeddingCosineCeiling? |
embeddingCosineCeiling?: number; |
At this cosine value, embedding contribution is full weight. Default 0.95. |
singleTokenGuardTypes? |
singleTokenGuardTypes?: string[]; |
Entity types where the single-token-short-name guard applies. Default |
['person']. The guard caps a pair's final score at 0.85 (below the |
||
| 0.92 auto-merge threshold) when BOTH entities have a single-token | ||
| normalized name of length < 5 — reflecting that "John" / "Pavel" / "Vlad" | ||
| alone do not uniquely identify a person inside a tenant. |
Why type-scoped (0.9.2): persons need the guard (multiple humans
can share a first name). Projects / organizations / events with names
like "ICOS" / "EW" / "Prep" are tenant-unique by convention — the guard
was blocking 41 ICOS-project dups from auto-merging in production. Types
NOT in this list bypass the guard, letting name + alias + embedding
signals reach auto-merge on identical short names.
Pass [] to disable the guard entirely. |
ScrapeOptions interface
📍 src/capabilities/scrape/ScrapeProvider.ts:57
Scrape options
Properties
| Property | Type | Description |
|---|---|---|
timeout? |
timeout?: number; |
Timeout in milliseconds (default: 30000) |
waitForJS? |
waitForJS?: boolean; |
Whether to wait for JavaScript to render (if supported) |
waitForSelector? |
waitForSelector?: string; |
CSS selector to wait for before scraping |
includeHtml? |
includeHtml?: boolean; |
Whether to include raw HTML in response |
includeMarkdown? |
includeMarkdown?: boolean; |
Whether to convert to markdown (if supported) |
includeLinks? |
includeLinks?: boolean; |
Whether to extract links |
includeScreenshot? |
includeScreenshot?: boolean; |
Whether to take a screenshot (if supported) |
headers? |
headers?: Record<string, string>; |
Custom headers to send |
vendorOptions? |
vendorOptions?: Record<string, any>; |
Vendor-specific options |
ScrapeProviderConfig interface
📍 src/capabilities/scrape/ScrapeProvider.ts:179
ScrapeProvider factory configuration
Properties
| Property | Type | Description |
|---|---|---|
connector |
`connector: string | Connector;` |
ScrapeProviderFallbackConfig interface
📍 src/capabilities/scrape/ScrapeProvider.ts:187
Fallback chain configuration
Properties
| Property | Type | Description |
|---|---|---|
primary |
`primary: string | Connector;` |
fallbacks? |
`fallbacks?: Array<string | Connector>;` |
tryNativeFirst? |
tryNativeFirst?: boolean; |
Whether to try native fetch before API providers |
ScrapeResponse interface
📍 src/capabilities/scrape/ScrapeProvider.ts:81
Scrape response
Properties
| Property | Type | Description |
|---|---|---|
url |
url: string; |
The URL that was scraped |
finalUrl? |
finalUrl?: string; |
Final URL after redirects |
result? |
result?: ScrapeResult; |
Scraped content |
statusCode? |
statusCode?: number; |
HTTP status code |
durationMs? |
durationMs?: number; |
Time taken in milliseconds |
requiredJS? |
requiredJS?: boolean; |
Whether the content required JavaScript rendering |
suggestedFallback? |
suggestedFallback?: string; |
Suggested fallback if this provider failed |
ScrapeResult interface
📍 src/capabilities/scrape/ScrapeProvider.ts:29
Scraped content result
Properties
| Property | Type | Description |
|---|---|---|
title |
title: string; |
Page title |
content |
content: string; |
Extracted text content (cleaned) |
html? |
html?: string; |
Raw HTML (if available) |
markdown? |
markdown?: string; |
Markdown version (if provider supports it) |
metadata? |
`metadata?: { |
description?: string;
author?: string;
publishedDate?: string;
siteName?: string;
favicon?: string;
ogImage?: string;
[key: string]: any;
};| Metadata extracted from the page | |screenshot?|screenshot?: string;| Screenshot as base64 (if requested and supported) | |links?|links?: Array<{ url: string; text: string }>;` | Links found on the page |
SearchOptions interface
📍 src/capabilities/researchAgent/types.ts:71
Options for search operations
Properties
| Property | Type | Description |
|---|---|---|
maxResults? |
maxResults?: number; |
Maximum results to return |
minRelevance? |
minRelevance?: number; |
Minimum relevance score (0-1) |
sourceOptions? |
sourceOptions?: Record<string, unknown>; |
Source-specific options |
SearchOptions interface
📍 src/capabilities/search/SearchProvider.ts:31
Search options
Properties
| Property | Type | Description |
|---|---|---|
numResults? |
numResults?: number; |
Number of results to return (default: 10, max provider-specific) |
language? |
language?: string; |
Language code (e.g., 'en', 'fr') |
country? |
country?: string; |
Country/region code (e.g., 'us', 'gb') |
timeRange? |
timeRange?: string; |
Time range filter (e.g., 'day', 'week', 'month', 'year') |
vendorOptions? |
vendorOptions?: Record<string, any>; |
Vendor-specific options |
SearchProviderConfig interface
📍 src/capabilities/search/SearchProvider.ts:83
SearchProvider factory configuration
Properties
| Property | Type | Description |
|---|---|---|
connector |
`connector: string | Connector;` |
SearchResponse interface
📍 src/capabilities/researchAgent/types.ts:33
Response from a search operation
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
Whether the search succeeded |
query |
query: string; |
Original query |
results |
results: SourceResult[]; |
Results found |
totalResults? |
totalResults?: number; |
Total results available (may be more than returned) |
error? |
error?: string; |
Error message if failed |
metadata? |
metadata?: Record<string, unknown>; |
Source-specific metadata |
SearchResponse interface
📍 src/capabilities/search/SearchProvider.ts:47
Search response
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
Whether the search succeeded |
query |
query: string; |
Search query |
provider |
provider: string; |
Provider name |
results |
results: SearchResult[]; |
Search results |
count |
count: number; |
Number of results |
error? |
error?: string; |
Error message if failed |
SearchResult interface
📍 src/capabilities/search/SearchProvider.ts:17
Search result interface
Properties
| Property | Type | Description |
|---|---|---|
title |
title: string; |
Page title |
url |
url: string; |
Direct URL to the page |
snippet |
snippet: string; |
Short description/excerpt |
position |
position: number; |
Search ranking position |
SeedFact interface
📍 src/memory/integration/signals/types.ts:82
Deterministic relational fact the adapter wants written after seed entities
are resolved. Roles refer to ParticipantSeed.role values; SignalIngestor
resolves them to entity ids and calls memory.addFact.
When the referenced role appears multiple times among seeds (e.g. many
attendees), one fact is written per matching seed. Unresolved roles produce
an IngestionError entry rather than silently failing.
Properties
| Property | Type | Description |
|---|---|---|
subjectRole |
subjectRole: string; |
Role of the subject entity among participants. |
predicate |
predicate: string; |
Canonical predicate (snake_case). |
objectRole |
objectRole: string; |
Role of the object entity among participants. |
importance? |
importance?: number; |
Optional salience. Defaults to predicate registry / addFact defaults. |
confidence? |
confidence?: number; |
Optional per-fact confidence override. |
SemanticSearchOptions interface
Properties
| Property | Type | Description |
|---|---|---|
topK |
topK: number; |
- |
SerializedAgentPackage interface
Data-only snapshot used to recreate one effective agent in another trusted application process. It is an execution package, not an authorization token, credential store, or authoritative agent catalog.
Properties
| Property | Type | Description |
|---|---|---|
protocolVersion |
protocolVersion: AgentPackageProtocolVersion; |
- |
packageId |
packageId: string; |
- |
createdAt |
createdAt: string; |
- |
expiresAt? |
expiresAt?: string; |
- |
revision? |
`revision?: string | number;` |
agent |
`agent: { |
id: string;
name: string;
connector: {
name: string;
model: string;
};
instructions?: string;
runtime: PortableAgentRuntimeConfig;
context: PortableAgentContext;
tools: PortableToolDescriptor[];
realtime?: PortableRealtimeProfile;
};| - | |metadata?|metadata?: Record<string, unknown>;` | - |
SerializedApprovalEntry interface
📍 src/core/permissions/types.ts:154
Serialized version of ApprovalCacheEntry (with ISO date strings)
Properties
| Property | Type | Description |
|---|---|---|
toolName |
toolName: string; |
- |
scope |
scope: PermissionScope; |
- |
approvedAt |
approvedAt: string; |
- |
approvedBy? |
approvedBy?: string; |
- |
expiresAt? |
expiresAt?: string; |
- |
argsHash? |
argsHash?: string; |
- |
SerializedApprovalState interface
📍 src/core/permissions/types.ts:137
Serialized approval state for session persistence
Properties
| Property | Type | Description |
|---|---|---|
version |
version: number; |
Version for future migrations |
approvals |
approvals: Record<string, SerializedApprovalEntry>; |
Map of tool name to approval entry |
blocklist |
blocklist: string[]; |
Tools that are always blocked (persisted blocklist) |
allowlist |
allowlist: string[]; |
Tools that are always allowed (persisted allowlist) |
SerializedPersistentInstructionsState interface
📍 src/core/context-nextgen/plugins/PersistentInstructionsPluginNextGen.ts:46
Properties
| Property | Type | Description |
|---|---|---|
entries |
entries: InstructionEntry[]; |
- |
agentId |
agentId: string; |
- |
version |
version: 2; |
- |
SerializedSharedWorkspaceState interface
📍 src/core/context-nextgen/plugins/SharedWorkspacePluginNextGen.ts:67
Properties
| Property | Type | Description |
|---|---|---|
entries |
entries: SharedWorkspaceEntry[]; |
- |
log |
log: WorkspaceLogEntry[]; |
- |
SerializedUserInfoState interface
📍 src/core/context-nextgen/plugins/UserInfoPluginNextGen.ts:55
Properties
| Property | Type | Description |
|---|---|---|
version |
version: 1; |
- |
entries |
entries: UserInfoEntry[]; |
- |
userId? |
userId?: string; |
- |
ServiceDefinition interface
📍 src/domain/entities/Services.ts:29
Complete service definition - single source of truth
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique identifier (e.g., 'slack', 'github') |
name |
name: string; |
Human-readable name (e.g., 'Slack', 'GitHub') |
category |
category: ServiceCategory; |
Service category |
urlPattern |
urlPattern: RegExp; |
URL pattern for auto-detection from baseURL |
baseURL |
baseURL: string; |
Default base URL for API calls |
docsURL? |
docsURL?: string; |
Documentation URL |
commonScopes? |
commonScopes?: string[]; |
Common OAuth scopes |
ServiceInfo interface
📍 src/domain/entities/Services.ts:539
Service info lookup (derived from SERVICE_DEFINITIONS)
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
name |
name: string; |
- |
category |
category: ServiceCategory; |
- |
baseURL |
baseURL: string; |
- |
docsURL? |
docsURL?: string; |
- |
commonScopes? |
commonScopes?: string[]; |
- |
SharedWorkspaceConfig interface
📍 src/core/context-nextgen/plugins/SharedWorkspacePluginNextGen.ts:56
Properties
| Property | Type | Description |
|---|---|---|
maxEntries? |
maxEntries?: number; |
Maximum number of entries (default: 50) |
maxTotalTokens? |
maxTotalTokens?: number; |
Maximum total tokens for context rendering (default: 8000) |
maxLogEntries? |
maxLogEntries?: number; |
Maximum log entries to keep (default: 100) |
onEntriesChanged? |
onEntriesChanged?: (entries: SharedWorkspaceEntry[]) => void; |
Callback when entries change |
SharedWorkspaceEntry interface
📍 src/core/context-nextgen/plugins/SharedWorkspacePluginNextGen.ts:30
Properties
| Property | Type | Description |
|---|---|---|
key |
key: string; |
- |
content? |
content?: string; |
Inline content (optional — for collaborative documents) |
references? |
references?: string[]; |
External references: file paths, DB IDs, URLs, etc. (optional) |
summary |
summary: string; |
Required brief summary — always cheap to show in context |
status |
status: string; |
Free-form status |
author |
author: string; |
Agent name or ID that last updated this entry |
version |
version: number; |
Auto-incremented on each update |
tags? |
tags?: string[]; |
Optional tags for filtering |
createdAt |
createdAt: number; |
- |
updatedAt |
updatedAt: number; |
- |
ShellCallOutputContent interface
📍 src/domain/entities/Message.ts:92
Properties
| Property | Type | Description |
|---|---|---|
stdout |
stdout: string; |
- |
stderr |
stderr: string; |
- |
outcome |
`outcome: |
| { type: 'exit'; exit_code: number }
| { type: 'timeout' };` | - |
ShellCallOutputItem interface
📍 src/domain/entities/Message.ts:101
Result returned after executing an OpenAI client shell call.
Properties
| Property | Type | Description |
|---|---|---|
type |
type: 'shell_call_output'; |
- |
call_id |
call_id: string; |
- |
output |
output: ShellCallOutputContent[]; |
- |
max_output_length? |
`max_output_length?: number | null;` |
status? |
`status?: 'in_progress' | 'completed' |
SignalBreakdown interface
Properties
| Property | Type | Description |
|---|---|---|
identifierExactMatch |
identifierExactMatch: boolean; |
True if any (kind, value) identifier matched. |
identifierConflict |
identifierConflict: boolean; |
True if same identifier kind exists on both with different values. |
typeMismatch |
typeMismatch: boolean; |
True if both entities have different type. |
metadataStartTimeConflict |
metadataStartTimeConflict: boolean; |
True if both have metadata.startTime and the delta exceeds threshold. |
displayNameNormalizedEqual |
displayNameNormalizedEqual: boolean; |
Both normalizedDisplayName strings non-empty and equal. |
aliasOverlap |
aliasOverlap: number; |
Jaccard overlap of normalized alias-pool (alias ∪ displayName) (0..1). |
embeddingCosine |
embeddingCosine: number; |
Raw cosine in [-1, 1]. NaN if either entity lacks identityEmbedding. |
tokenSetJaccard |
tokenSetJaccard: number; |
Jaccard over whitespace-tokenized normalizedDisplayName (0..1). |
contextIdsOverlap |
contextIdsOverlap: number; |
Count of distinct contextIds appearing on both sides, capped at 10. |
sameSignalWithin |
`sameSignalWithin: number | null;` |
singleTokenNameTooShort |
singleTokenNameTooShort: boolean; |
Both names are a single token < 5 chars — too weak to auto-merge alone. |
SignalIngestorConfig interface
📍 src/memory/integration/signals/SignalIngestor.ts:52
Properties
| Property | Type | Description |
|---|---|---|
memory |
memory: MemorySystem; |
- |
extractor |
extractor: IExtractor; |
- |
adapters? |
adapters?: SignalSourceAdapter<unknown>[]; |
Adapters registered at construction time. More can be added via registerAdapter. |
promptTemplate? |
promptTemplate?: (ctx: ExtractionPromptContext) => string; |
Optional override of the extraction prompt builder. When omitted the |
library's defaultExtractionPrompt is used. |
||
maxPredicatesPerCategory? |
maxPredicatesPerCategory?: number; |
Cap on predicates rendered per category in the prompt. Default 5. |
predicateRegistry? |
predicateRegistry?: PredicateRegistry; |
When present, the registry is handed to the prompt builder so the LLM |
sees canonical predicate names. Defaults to memory's registry if one |
||
| was configured, otherwise undefined. | ||
contextHints? |
contextHints?: ContextHintsConfig; |
Opt-in: inject prior context (open tasks, recent topics) into the |
| extraction prompt so re-mentions of existing entities resolve to the | ||
| same row instead of creating duplicates. Off by default — token-budget | ||
| guardrail. Enable per-scope when ingesting a stream of related signals. |
SignalReconciliationOutcome interface
📍 src/memory/integration/ExtractionResolver.ts:196
Outcome of MemorySystem.applyReconciliationOps — fact counts + task counts.
Properties
| Property | Type | Description |
|---|---|---|
taskUpdates |
taskUpdates: number; |
task_update ops applied (any field changed). |
taskResolves |
taskResolves: number; |
Subset of taskUpdates that moved a task into a terminal (AI-resolved) state. |
SignalReconciliationPromptContext interface
📍 src/memory/integration/signalReconciliationPrompt.ts:57
Properties
| Property | Type | Description |
|---|---|---|
newFacts? |
newFacts?: NewFactSummary[]; |
Newly observed facts from this signal (pass 1 output) — context only. |
newTasks? |
newTasks?: NewTaskSummary[]; |
Newly observed/created tasks from this signal (pass 1 output) — context only. |
priorFacts |
priorFacts: Array<IFact & { sourceSignalDescription?: string }>; |
Prior facts that MAY be superseded. Each MUST carry an id the LLM can put |
in an archive/update op's factId. No truncation — caller controls scope. |
||
Pre-decorate evidenceQuote / sourceSignalDescription for ranking. |
||
priorTasks |
priorTasks: IEntity[]; |
Prior OPEN tasks that MAY need updating / closing. Each MUST carry an id |
the LLM can put in a task_update op's taskId. Reads displayName, |
||
metadata.state, metadata.narrative, metadata.dueAt. |
||
referenceDate? |
referenceDate?: Date; |
Reference date for interpreting "most recent". Defaults to today. |
SignalSourceAdapter interface
📍 src/memory/integration/signals/types.ts:133
Adapter contract. Implementations are pure: raw → ExtractedSignal with no
I/O. Side effects (fetching attachments, querying a thread index) should be
done by the caller and the results passed into raw so the adapter stays
deterministic + testable.
Methods
extract()
extract(raw: TRaw): ExtractedSignal;
Parameters:
raw:TRaw
Returns: ExtractedSignal
Properties
| Property | Type | Description |
|---|---|---|
kind |
readonly kind: string; |
Unique kind string, e.g. 'email', 'text', 'slack'. |
SignalThreadMessage interface
📍 src/memory/integration/defaultExtractionPrompt.ts:159
One message inside a multi-signal conversation thread. When the caller passes
a signalThread, the prompt renders the messages chronologically in a single
nonce-wrapped block — replacing the single signalText path entirely for
that call. Used by per-conversation reconciliation (V25 Jarvis pipeline) so
the LLM sees the whole conversation, not one message at a time.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Stable signal id — referenced back in evidenceQuote/op reason fields. |
observedAt |
observedAt: Date; |
When this message was observed (rendered as the per-message header). |
sender? |
sender?: string; |
Optional sender label ("From: ..."). |
body |
body: string; |
Message body. Caller is expected to have already stripped quoted replies. |
SignalWeights interface
Properties
| Property | Type | Description |
|---|---|---|
displayNameNormalizedEqual |
displayNameNormalizedEqual: number; |
- |
aliasOverlap |
aliasOverlap: number; |
- |
embeddingCosine |
embeddingCosine: number; |
- |
tokenSetJaccard |
tokenSetJaccard: number; |
- |
contextIdsOverlap |
contextIdsOverlap: number; |
- |
sameSignalBoost |
sameSignalBoost: number; |
- |
SkepticPassConfig interface
📍 src/memory/integration/SkepticPass.ts:33
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Connector name — must already be registered. |
model |
model: string; |
Model identifier passed to the connector. |
promptTemplate? |
promptTemplate?: (ctx: SkepticPromptContext) => string; |
Optional override for the system prompt. Receives the rendered review |
context and must instruct the LLM to return { keep: [...], drop: [{ index, reason }] }. |
||
temperature? |
temperature?: number; |
Sampling temperature. Default 0.1 — low to keep veto deterministic. |
onDecision? |
onDecision?: RestraintEventListener; |
Default decision listener — fires for every event in every review() call. |
maxOutputTokens? |
maxOutputTokens?: number; |
Cap on output tokens. Default undefined (model's own ceiling). |
SkepticPromptContext interface
📍 src/memory/integration/SkepticPass.ts:78
Properties
| Property | Type | Description |
|---|---|---|
items |
items: SkepticReviewItem[]; |
- |
contextHint? |
contextHint?: string; |
- |
SkepticReviewContext interface
📍 src/memory/integration/SkepticPass.ts:58
Properties
| Property | Type | Description |
|---|---|---|
stage? |
stage?: RestraintStage; |
Stage label for emitted events. Defaults to caller stage. |
contextHint? |
contextHint?: string; |
Optional preamble appended to the prompt — e.g. "review tasks against priorities X/Y/Z". |
onDecision? |
onDecision?: RestraintEventListener; |
Per-call decision listener (in addition to the constructor-level one). |
SkepticReviewItem interface
📍 src/memory/integration/SkepticPass.ts:49
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Stable id surfaced in the prompt and echoed back in events. |
summary |
summary: string; |
Compact summary the skeptic reasons over. Keep ≤ ~200 chars per item. |
meta? |
meta?: Record<string, unknown>; |
Optional per-item meta surfaced in events; not shown to the LLM. |
SkepticReviewResult interface
📍 src/memory/integration/SkepticPass.ts:67
Properties
| Property | Type | Description |
|---|---|---|
kept |
kept: SkepticReviewItem[]; |
Items the skeptic voted to keep. |
dropped |
dropped: Array<{ item: SkepticReviewItem; reason: string }>; |
Items the skeptic voted to drop, with reasons. |
events |
events: RestraintEvent[]; |
Full decision log: one event per item plus pass-level events on errors. |
failedOpen |
failedOpen: boolean; |
Set when the LLM call itself failed and items were passed through. |
SlackAddReactionResult interface
📍 src/tools/slack/types.ts:312
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
SlackChannel interface
📍 src/tools/slack/types.ts:232
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
name |
name: string; |
- |
topic? |
topic?: string; |
- |
purpose? |
purpose?: string; |
- |
memberCount? |
memberCount?: number; |
- |
isArchived |
isArchived: boolean; |
- |
isPrivate |
isPrivate: boolean; |
- |
isIM |
isIM: boolean; |
- |
SlackGetChannelInfoResult interface
📍 src/tools/slack/types.ts:336
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
channel? |
`channel?: SlackChannel & { |
created?: string;
creator?: string;
memberCount?: number;
};| - | |error?|error?: string;` | - |
SlackGetMentionsResult interface
📍 src/tools/slack/types.ts:285
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
messages? |
messages?: SlackMentionMessage[]; |
- |
count? |
count?: number; |
- |
hasMore? |
hasMore?: boolean; |
- |
error? |
error?: string; |
- |
SlackGetMessagesResult interface
📍 src/tools/slack/types.ts:261
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
messages? |
messages?: SlackMessage[]; |
- |
count? |
count?: number; |
- |
hasMore? |
hasMore?: boolean; |
- |
channel? |
channel?: string; |
- |
error? |
error?: string; |
- |
SlackGetThreadResult interface
📍 src/tools/slack/types.ts:277
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
messages? |
messages?: SlackMessage[]; |
- |
count? |
count?: number; |
- |
parentMessage? |
parentMessage?: SlackMessage; |
- |
error? |
error?: string; |
- |
SlackGetUsersResult interface
📍 src/tools/slack/types.ts:328
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
users? |
users?: SlackUser[]; |
- |
count? |
count?: number; |
- |
hasMore? |
hasMore?: boolean; |
- |
error? |
error?: string; |
- |
SlackListChannelsResult interface
📍 src/tools/slack/types.ts:243
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
channels? |
channels?: SlackChannel[]; |
- |
count? |
count?: number; |
- |
hasMore? |
hasMore?: boolean; |
- |
error? |
error?: string; |
- |
SlackMentionMessage interface
📍 src/tools/slack/types.ts:293
Properties
| Property | Type | Description |
|---|---|---|
ts |
ts: string; |
- |
date |
date: string; |
- |
text |
text: string; |
- |
user? |
user?: string; |
- |
channel? |
channel?: { id: string; name?: string }; |
- |
threadTs? |
threadTs?: string; |
- |
permalink? |
permalink?: string; |
- |
SlackMessage interface
📍 src/tools/slack/types.ts:251
Properties
| Property | Type | Description |
|---|---|---|
ts |
ts: string; |
- |
date |
date: string; |
- |
user? |
user?: string; |
- |
text |
text: string; |
- |
threadTs? |
threadTs?: string; |
- |
replyCount? |
replyCount?: number; |
- |
reactions? |
reactions?: { name: string; count: number }[]; |
- |
SlackPostMessageResult interface
📍 src/tools/slack/types.ts:270
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
ts? |
ts?: string; |
- |
channel? |
channel?: string; |
- |
error? |
error?: string; |
- |
SlackSearchMessagesResult interface
📍 src/tools/slack/types.ts:303
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
messages? |
messages?: SlackMentionMessage[]; |
- |
count? |
count?: number; |
- |
total? |
total?: number; |
- |
hasMore? |
hasMore?: boolean; |
- |
error? |
error?: string; |
- |
SlackSetChannelTopicResult interface
📍 src/tools/slack/types.ts:346
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
topic? |
topic?: string; |
- |
error? |
error?: string; |
- |
SlackUser interface
📍 src/tools/slack/types.ts:317
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
- |
name |
name: string; |
- |
realName? |
realName?: string; |
- |
displayName? |
displayName?: string; |
- |
email? |
email?: string; |
- |
isBot |
isBot: boolean; |
- |
isAdmin? |
isAdmin?: boolean; |
- |
timezone? |
timezone?: string; |
- |
SlugifyOptions interface
📍 src/memory/identifiers.ts:89
Properties
| Property | Type | Description |
|---|---|---|
maxLength? |
maxLength?: number; |
Max length of the slug (default 40). Truncation drops whole words where possible. |
SourceCapabilities interface
📍 src/capabilities/researchAgent/types.ts:143
Source capabilities for discovery
Properties
| Property | Type | Description |
|---|---|---|
canSearch |
canSearch: boolean; |
Whether source supports search |
canFetch |
canFetch: boolean; |
Whether source supports fetch |
hasRelevanceScores |
hasRelevanceScores: boolean; |
Whether results include relevance scores |
maxResultsPerSearch? |
maxResultsPerSearch?: number; |
Maximum results per search |
contentTypes? |
contentTypes?: string[]; |
Supported content types |
SourceResult interface
📍 src/capabilities/researchAgent/types.ts:15
ResearchAgent Types
Generic interfaces for research sources that work with any data provider:
- Web search (Serper, Brave, Tavily)
- Vector databases (Pinecone, Weaviate, Qdrant)
- File systems (local, S3, GCS)
- APIs (REST, GraphQL)
- Databases (SQL, MongoDB)
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique identifier for this result |
title |
title: string; |
Human-readable title |
snippet |
snippet: string; |
Brief description or snippet |
reference |
reference: string; |
Reference for fetching full content (URL, path, ID, etc.) |
relevance? |
relevance?: number; |
Relevance score (0-1, higher is better) |
metadata? |
metadata?: Record<string, unknown>; |
Source-specific metadata |
StdioTransportConfig interface
📍 src/domain/entities/MCPConfig.ts:15
Stdio transport configuration
Properties
| Property | Type | Description |
|---|---|---|
command |
command: string; |
Command to execute (e.g., 'npx', 'node') |
args? |
args?: string[]; |
Command arguments |
env? |
env?: Record<string, string>; |
Environment variables |
cwd? |
cwd?: string; |
Working directory for the process |
StepResolveContext interface
📍 src/core/routineControlFlow.ts:152
Context for resolving templates in deterministic step arguments.
Properties
| Property | Type | Description |
|---|---|---|
inputs |
inputs: Record<string, unknown>; |
Routine input parameters ({{param.NAME}}) |
taskResults? |
taskResults?: Map<string, unknown>; |
Task results map: task id OR name → output ({{result.}}, post-steps only) |
stepResults? |
stepResults?: Map<string, unknown>; |
Prior step results map: step name → output ({{step.STEP_NAME}}) |
StorageConfig interface
📍 src/core/StorageRegistry.ts:72
Storage configuration map.
Global singletons are stored directly. Per-agent factories are functions that accept an agentId (and optional StorageContext for multi-tenant scenarios) and return a storage instance.
Properties
| Property | Type | Description |
|---|---|---|
runtimeSessions? |
runtimeSessions?: (context: import('../agent-runtime/types.js').TrustedRuntimeContext) => import('../agent-runtime/RuntimeSessionStorage.js').IRuntimeSessionStorage; |
Optional scoped runtime control storage; independent of native sessions/evidence. |
evidence? |
evidence?: (scope: EvidenceScope, context?: StorageContext) => IEvidenceStorage; |
Optional scoped evidence factory; disabled context features never resolve it. |
media |
media: IMediaStorage; |
- |
agentDefinitions |
agentDefinitions: IAgentDefinitionStorage; |
- |
connectorConfig |
connectorConfig: IConnectorConfigStorage; |
- |
oauthTokens |
oauthTokens: ITokenStorage; |
- |
customTools |
customTools: (context?: StorageContext) => ICustomToolStorage; |
- |
sessions |
sessions: (agentId: string, context?: StorageContext) => IContextStorage; |
- |
persistentInstructions |
persistentInstructions: (agentId: string, context?: StorageContext) => IPersistentInstructionsStorage; |
- |
workingMemory |
workingMemory: (context?: StorageContext) => IMemoryStorage; |
- |
userInfo |
userInfo: (context?: StorageContext) => IUserInfoStorage; |
- |
routineDefinitions |
routineDefinitions: (context?: StorageContext) => IRoutineDefinitionStorage; |
- |
routineExecutions |
routineExecutions: (context?: StorageContext) => IRoutineExecutionStorage; |
- |
correlations |
correlations: ICorrelationStorage; |
- |
permissionRules |
permissionRules: IUserPermissionRulesStorage; |
- |
StoreActionResult interface
📍 src/core/context-nextgen/types.ts:535
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
action |
action: string; |
- |
StoreDeleteResult interface
📍 src/core/context-nextgen/types.ts:525
Properties
| Property | Type | Description |
|---|---|---|
deleted |
deleted: boolean; |
- |
key |
key: string; |
- |
StoreEntrySchema interface
📍 src/core/context-nextgen/types.ts:467
Describes a store's schema for dynamic tool description generation.
The descriptionFactory on each store tool uses this to build
a comparison table so the LLM knows which store to use.
Properties
| Property | Type | Description |
|---|---|---|
storeId |
storeId: string; |
Short identifier used as the store parameter value (e.g., "notes", "whiteboard") |
displayName |
displayName: string; |
Human-readable store name (e.g., "Notes", "Whiteboard") |
description |
description: string; |
Description of the store and its retrieval behavior, included in store_get guidance. |
usageHint |
usageHint: string; |
"Use for:" guidance — tells the LLM when to pick this store. |
| Should include explicit "NOT for:" guidance referencing other stores. | ||
setDataFields |
setDataFields: string; |
Human-readable description of the data fields accepted by storeSet. |
| Shown in the store_set tool description. One line per field. | ||
| Example: "description (required): Brief description of the data" | ||
actions? |
`actions?: Record<string, { |
/** What this action does */
description: string;
/** Human-readable params description */
paramsDescription?: string;
/** If true, requires confirm: true parameter */
destructive?: boolean;
}>;` | Available actions for store_action, keyed by action name. If undefined or empty, this store has no actions. |
StoreGetResult interface
📍 src/core/context-nextgen/types.ts:509
Result types for store operations. These are intentionally loose (Record-based) to accommodate store-specific fields in responses.
Properties
| Property | Type | Description |
|---|---|---|
found |
found: boolean; |
- |
key? |
key?: string; |
- |
entry? |
entry?: Record<string, unknown>; |
Single entry data (when key provided) |
entries? |
entries?: Array<Record<string, unknown>>; |
Store-specific default view without a key; may contain only index metadata. |
StoreListResult interface
📍 src/core/context-nextgen/types.ts:530
Properties
| Property | Type | Description |
|---|---|---|
entries |
entries: Array<Record<string, unknown>>; |
- |
total? |
total?: number; |
- |
StoreSetResult interface
📍 src/core/context-nextgen/types.ts:518
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
key |
key: string; |
- |
message? |
message?: string; |
- |
StrategyInfo interface
📍 src/core/context-nextgen/strategies/StrategyRegistry.ts:44
Strategy information for UI display (serializable, no class reference)
Properties
| Property | Type | Description |
|---|---|---|
name |
name: string; |
Strategy name (unique identifier) |
displayName |
displayName: string; |
Human-readable name for UI |
description |
description: string; |
Description explaining the strategy behavior |
threshold |
threshold: number; |
Compaction threshold (0-1, e.g., 0.70 = 70%) |
isBuiltIn |
isBuiltIn: boolean; |
Whether this is a built-in strategy |
StrategyRegistryEntry interface
📍 src/core/context-nextgen/strategies/StrategyRegistry.ts:64
Full strategy registry entry (includes class reference)
Properties
| Property | Type | Description |
|---|---|---|
strategyClass |
strategyClass: StrategyClass; |
Strategy constructor class |
StructuredContextSummary interface
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:35
Model-generated data; this object never gains host-instruction authority.
Properties
| Property | Type | Description |
|---|---|---|
completedWork |
completedWork: ContextSummaryEntry[]; |
- |
activeWork |
activeWork: ContextSummaryEntry[]; |
- |
constraints |
constraints: ContextSummaryEntry[]; |
- |
decisions |
decisions: ContextSummaryEntry[]; |
- |
uncertainties |
uncertainties: ContextSummaryEntry[]; |
- |
artifacts |
artifacts: ContextSummaryEntry[]; |
- |
actionReceipts |
actionReceipts: ContextSummaryEntry[]; |
- |
StructuredSummaryStrategyConfig interface
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:27
Properties
| Property | Type | Description |
|---|---|---|
maxSummaryTokens? |
maxSummaryTokens?: number; |
Tighter cap for the configured helper. Default 1024; role cap still applies. |
fallback? |
`fallback?: 'mask' | 'error';` |
SuspendSignalOptions interface
📍 src/core/SuspendSignal.ts:36
Options for creating a SuspendSignal
Properties
| Property | Type | Description |
|---|---|---|
result |
result: unknown; |
The tool result visible to the LLM (e.g., "Email sent to user@example.com") |
correlationId |
correlationId: string; |
Unique identifier for routing external events back to this session. |
| Typically prefixed by channel (e.g., "email:msg_123", "ticket:T-456") | ||
resumeAs? |
`resumeAs?: 'user_message' | 'tool_result';` |
'user_message'(default): added as a new user message'tool_result': added as a tool result | |ttl?|ttl?: number;| Time-to-live in milliseconds before the suspended session expires. Default: 7 days | |metadata?|metadata?: Record<string, unknown>;| Application-specific metadata (email ID, ticket ID, webhook URL, etc.) |
SweepOptions interface
Properties
| Property | Type | Description |
|---|---|---|
type? |
type?: string; |
Narrow to one entity type. Default: all. |
maxClusters? |
maxClusters?: number; |
Cap on clusters processed. Default: no cap (caller bounds via consumer). |
maxPairsPerCluster? |
maxPairsPerCluster?: number; |
Pair cap inside a single cluster (cluster.length choose 2 can explode). Default 50. |
thresholds? |
thresholds?: ScoreThresholds; |
Per-pair scorer thresholds + weights. |
includeSemantic? |
includeSemantic?: boolean; |
Include semantic-tier signals (skipped by default to avoid LLM-grade ops). |
pageSize? |
pageSize?: number; |
listEntities page size when enumerating clusters. |
TelegramChat interface
📍 src/tools/telegram/types.ts:187
Telegram Chat object
Properties
| Property | Type | Description |
|---|---|---|
id |
id: number; |
- |
type |
`type: 'private' | 'group' |
title? |
title?: string; |
- |
username? |
username?: string; |
- |
first_name? |
first_name?: string; |
- |
last_name? |
last_name?: string; |
- |
description? |
description?: string; |
- |
invite_link? |
invite_link?: string; |
- |
TelegramGetChatResult interface
📍 src/tools/telegram/types.ts:244
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
chat? |
chat?: TelegramChat; |
- |
error? |
error?: string; |
- |
TelegramGetMeResult interface
📍 src/tools/telegram/types.ts:238
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
bot? |
bot?: TelegramUser; |
- |
error? |
error?: string; |
- |
TelegramGetUpdatesResult interface
📍 src/tools/telegram/types.ts:250
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
updates? |
updates?: TelegramUpdate[]; |
- |
count? |
count?: number; |
- |
error? |
error?: string; |
- |
TelegramMessage interface
📍 src/tools/telegram/types.ts:199
Telegram Message object
Properties
| Property | Type | Description |
|---|---|---|
message_id |
message_id: number; |
- |
from? |
from?: TelegramUser; |
- |
chat |
chat: TelegramChat; |
- |
date |
date: number; |
- |
text? |
text?: string; |
- |
caption? |
caption?: string; |
- |
photo? |
photo?: TelegramPhotoSize[]; |
- |
reply_to_message? |
reply_to_message?: TelegramMessage; |
- |
TelegramPhotoSize interface
📍 src/tools/telegram/types.ts:211
Telegram PhotoSize object
Properties
| Property | Type | Description |
|---|---|---|
file_id |
file_id: string; |
- |
file_unique_id |
file_unique_id: string; |
- |
width |
width: number; |
- |
height |
height: number; |
- |
file_size? |
file_size?: number; |
- |
TelegramSendResult interface
📍 src/tools/telegram/types.ts:232
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
message? |
message?: TelegramMessage; |
- |
error? |
error?: string; |
- |
TelegramSetWebhookResult interface
📍 src/tools/telegram/types.ts:257
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
error? |
error?: string; |
- |
TelegramUpdate interface
📍 src/tools/telegram/types.ts:220
Telegram Update object (from getUpdates)
Properties
| Property | Type | Description |
|---|---|---|
update_id |
update_id: number; |
- |
message? |
message?: TelegramMessage; |
- |
edited_message? |
edited_message?: TelegramMessage; |
- |
channel_post? |
channel_post?: TelegramMessage; |
- |
edited_channel_post? |
edited_channel_post?: TelegramMessage; |
- |
TelegramUser interface
📍 src/tools/telegram/types.ts:177
Telegram User object
Properties
| Property | Type | Description |
|---|---|---|
id |
id: number; |
- |
is_bot |
is_bot: boolean; |
- |
first_name |
first_name: string; |
- |
last_name? |
last_name?: string; |
- |
username? |
username?: string; |
- |
language_code? |
language_code?: string; |
- |
TelephonyAdapterEvents interface
📍 src/capabilities/voice/types.ts:473
Properties
| Property | Type | Description |
|---|---|---|
'call:connected' |
'call:connected': (callId: string, info: IncomingCallInfo) => void; |
A new call has been established and audio is flowing |
'call:audio' |
'call:audio': (callId: string, frame: AudioFrame) => void; |
Audio frame received from caller |
'call:media_timestamp' |
'call:media_timestamp': (callId: string, info: TelephonyMediaTimestamp) => void; |
Latest inbound media timestamp from telephony |
'call:ended' |
'call:ended': (callId: string, reason: string) => void; |
Call has ended |
'error' |
'error': (error: Error, callId?: string) => void; |
Adapter-level error |
TemplateContext interface
📍 src/core/TemplateEngine.ts:41
Context passed to template handlers. Built-in fields are optional; custom handlers can read any extra properties.
Properties
| Property | Type | Description |
|---|---|---|
agentId? |
agentId?: string; |
- |
agentName? |
agentName?: string; |
- |
model? |
model?: string; |
- |
vendor? |
vendor?: string; |
- |
userId? |
userId?: string; |
- |
TemplateHandlerOptions interface
📍 src/core/TemplateEngine.ts:51
Options for handler registration.
Properties
| Property | Type | Description |
|---|---|---|
dynamic? |
dynamic?: boolean; |
If true, handler runs at prepare() time (every LLM call). Default: false (static, runs once at creation). |
TestCaseResult interface
📍 src/testing/integration/types.ts:33
Result of a single test case execution.
Properties
| Property | Type | Description |
|---|---|---|
testName |
testName: string; |
Test case name |
toolName |
toolName: string; |
Tool name this test exercises (without connector prefix) |
status |
`status: 'passed' | 'failed' |
duration |
duration: number; |
Execution time in ms |
message? |
message?: string; |
Human-readable summary |
error? |
error?: string; |
Error details (stack trace, API error, etc.) |
request? |
request?: unknown; |
Arguments sent to the tool (for debugging) |
response? |
response?: unknown; |
Tool response (for debugging) |
TestContext interface
📍 src/testing/integration/types.ts:81
Shared context passed to all test cases in a suite run.
Properties
| Property | Type | Description |
|---|---|---|
params |
params: Record<string, string>; |
User-provided params (emails, channels, repos, etc.) |
state |
state: Record<string, unknown>; |
Shared mutable state between test cases (e.g., created event ID for later get/delete) |
userId? |
userId?: string; |
User ID for ToolContext (from the authenticated user running the tests) |
connectorName? |
connectorName?: string; |
Connector name being tested |
log |
log: (message: string) => void; |
Real-time log callback |
TestParam interface
📍 src/testing/integration/types.ts:15
Parameter definition for a test suite. Host app presents these as input fields to the user before running tests.
Properties
| Property | Type | Description |
|---|---|---|
key |
key: string; |
Unique key used to look up this param in TestContext.params |
label |
label: string; |
Human-readable label for UI |
description |
description: string; |
Description / help text |
type |
`type: 'string' | 'email' |
required |
required: boolean; |
Whether the param must be provided (tests using it are skipped if missing) |
default? |
default?: string; |
Default value (pre-filled in UI) |
TestSuiteResult interface
📍 src/testing/integration/types.ts:55
Result of running a full test suite against a connector.
Properties
| Property | Type | Description |
|---|---|---|
suiteId |
suiteId: string; |
Suite ID (e.g., 'google-workspace') |
connectorName |
connectorName: string; |
Connector name that was tested |
serviceType |
serviceType: string; |
Detected service type |
startedAt |
startedAt: string; |
ISO timestamp when suite started |
completedAt |
completedAt: string; |
ISO timestamp when suite completed |
results |
results: TestCaseResult[]; |
Per-test results in execution order |
summary |
`summary: { |
passed: number;
failed: number;
skipped: number;
error: number;
total: number;
};` | Aggregated counts |
TextPipelineConfig interface
📍 src/capabilities/voice/types.ts:208
Text pipeline configuration — STT → Agent → TTS
Properties
| Property | Type | Description |
|---|---|---|
pipeline |
pipeline: 'text'; |
- |
stt |
`stt: { |
/** Connector name for the STT provider */
connector: string;
/** STT model (e.g., 'whisper-1'). Default: provider's default */
model?: string;
/** BCP-47 language hint (e.g., 'en'). Default: auto-detect */
language?: string;
};| STT configuration | |tts|tts: {
/** Connector name for the TTS provider /
connector: string;
/* TTS model (e.g., 'tts-1', 'tts-1-hd'). Default: 'tts-1' /
model?: string;
/* Voice ID (e.g., 'nova', 'alloy'). Default: 'nova' /
voice?: string;
/* Speech speed (0.25 to 4.0). Default: 1.0 */
speed?: number;
};` | TTS configuration |
ThinkingContent interface
📍 src/domain/entities/Content.ts:99
Properties
| Property | Type | Description |
|---|---|---|
type |
type: ContentType.THINKING; |
- |
thinking |
thinking: string; |
- |
providerItemId? |
providerItemId?: string; |
Provider item identifier used when a stateless API requires reasoning replay. |
providerMetadata? |
providerMetadata?: Record<string, unknown>; |
Opaque provider replay data; applications should not interpret its contents. |
signature? |
signature?: string; |
Anthropic's opaque signature for round-tripping thinking blocks |
persistInHistory |
persistInHistory: boolean; |
Whether this thinking block should be persisted in conversation history. |
| Anthropic requires it (true), OpenAI/Google do not (false). |
TokenUsage interface
📍 src/domain/entities/Response.ts:13
Token usage statistics
Properties
| Property | Type | Description |
|---|---|---|
input_tokens |
input_tokens: number; |
- |
output_tokens |
output_tokens: number; |
- |
total_tokens |
total_tokens: number; |
- |
output_tokens_details? |
`output_tokens_details?: { |
reasoning_tokens: number;
};| - | |cached_input_tokens?|cached_input_tokens?: number;| Input tokens served from a provider prompt/context cache. | |cache_creation_input_tokens?|cache_creation_input_tokens?: number;| Input tokens written into a provider prompt/context cache. | |cache_creation_details?|cache_creation_details?: {
short_ttl_input_tokens?: number;
extended_ttl_input_tokens?: number;
};| - | |native_tool_calls?|native_tool_calls?: Record<string, number | undefined>;| Provider-hosted tool usage that may be billed separately. | |processing_mode?|processing_mode?: import('./Model.js').ProcessingMode;| - | |service_tier?|service_tier?: string;| - | |speed?|speed?: string;| Provider-reported inference speed, currently Anthropicstandard/fast. | | cost_usd_ticks?|cost_usd_ticks?: number;` | xAI provider-reported total cost in one-billionth USD ticks. |
TranscriptionCapabilities interface
📍 src/capabilities/metadata/realtime.ts:42
Properties
| Property | Type | Description |
|---|---|---|
support |
readonly support: EndpointCapabilitySupport; |
- |
constraints |
readonly constraints: { readonly requiredTransport?: 'websocket'; readonly turnDetection?: 'off' }; |
- |
reason |
readonly reason: string; |
- |
provenance? |
readonly provenance?: CapabilityProvenance; |
- |
TranscriptionCapabilityQuery interface
📍 src/capabilities/metadata/realtime.ts:35
Properties
| Property | Type | Description |
|---|---|---|
vendor |
vendor: Vendor; |
- |
model |
model: string; |
- |
mode |
`mode: 'file' | 'transcription-session' |
transport? |
transport?: RealtimeTransport; |
- |
conversationModel? |
conversationModel?: string; |
- |
endpoint? |
`endpoint?: 'openai' | 'custom';` |
turnDetection? |
`turnDetection?: 'off' | 'server_vad' |
TranscriptMessage interface
📍 src/capabilities/voice/types.ts:312
A single entry in the voice call transcript. Emitted by pipelines for UI display and logging.
Properties
| Property | Type | Description |
|---|---|---|
role |
`role: 'caller' | 'agent' |
text |
text: string; |
Text content (transcript, tool args JSON, or tool result) |
timestamp |
timestamp: number; |
Unix timestamp in ms |
toolName? |
toolName?: string; |
Tool name (for tool_use / tool_result) |
toolCallId? |
toolCallId?: string; |
Tool call ID for correlating use/result pairs |
TraversalOptions interface
Properties
| Property | Type | Description |
|---|---|---|
predicates? |
predicates?: string[]; |
- |
direction |
`direction: 'out' | 'in' |
maxDepth |
maxDepth: number; |
Required hard bound — no unbounded traversals. |
limit? |
limit?: number; |
- |
asOf? |
asOf?: Date; |
- |
TwilioAdapterConfig interface
📍 src/capabilities/voice/types.ts:537
Properties
| Property | Type | Description |
|---|---|---|
connector |
connector: string; |
Twilio connector name (for REST API auth) |
accountSid? |
accountSid?: string; |
Twilio Account SID. Required for outbound calls. |
| For inbound-only, this is extracted from the media stream event. | ||
mode? |
`mode?: 'standalone' | 'external';` |
- 'standalone': adapter creates its own HTTP/WS server
- 'external': you provide handlers for your existing server |
|
port?|port?: number;| Port for standalone mode. Default: 3000 | |webhookPath?|webhookPath?: string;| Path for voice webhook. Default: '/voice' | |mediaStreamPath?|mediaStreamPath?: string;| Path for media stream WebSocket. Default: '/media-stream' | |publicUrl?|publicUrl?: string;| Public URL where Twilio can reach this server. Required for standalone mode and outbound calls. Example: 'https://myserver.com' or 'https://abc123.ngrok.io' |
TwilioGetMessageResult interface
📍 src/tools/twilio/types.ts:228
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
message? |
message?: TwilioMessage; |
- |
error? |
error?: string; |
- |
TwilioListMessagesResult interface
📍 src/tools/twilio/types.ts:220
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
messages? |
messages?: TwilioMessage[]; |
- |
count? |
count?: number; |
- |
hasMore? |
hasMore?: boolean; |
- |
error? |
error?: string; |
- |
TwilioMessage interface
📍 src/tools/twilio/types.ts:197
Properties
| Property | Type | Description |
|---|---|---|
sid |
sid: string; |
- |
from |
from: string; |
- |
to |
to: string; |
- |
body |
body: string; |
- |
status |
status: string; |
- |
direction |
direction: string; |
- |
dateSent |
`dateSent: string | null;` |
dateCreated |
dateCreated: string; |
- |
price |
`price: string | null;` |
priceUnit |
`priceUnit: string | null;` |
numSegments |
`numSegments: string | null;` |
errorCode |
`errorCode: number | null;` |
errorMessage |
`errorMessage: string | null;` |
channel |
`channel: 'sms' | 'whatsapp';` |
TwilioSendResult interface
📍 src/tools/twilio/types.ts:214
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
message? |
message?: TwilioMessage; |
- |
error? |
error?: string; |
- |
UpsertBySurfaceInput interface
Properties
| Property | Type | Description |
|---|---|---|
surface |
surface: string; |
- |
type |
type: string; |
- |
identifiers? |
identifiers?: Identifier[]; |
- |
aliases? |
aliases?: string[]; |
Alternate forms spotted alongside the primary surface (e.g. "MSFT" next to "Microsoft"). |
disambiguationEntityIds? |
disambiguationEntityIds?: EntityId[]; |
Other entities resolved earlier in the same extraction — disambiguation |
hint for the resolver. Does NOT persist. See ResolveEntityQuery.disambiguationEntityIds. |
||
contextEntityIds? |
contextEntityIds?: EntityId[]; |
- |
contextIds? |
contextIds?: EntityId[]; |
Persistent multi-entity binding for the resolved entity — written to |
IEntity.contextIds. Re-extraction with new ids unions into the |
||
| existing set (never overwrites, never fills-missing). Self-references | ||
| and ids invisible to the caller are silently dropped. |
Convention: set on task, event, topic mentions to bind them to
the project/deal/meeting they live within. Empty / omitted means no
change to existing contextIds on resolve, no contextIds on create. |
| metadata? | metadata?: Record<string, unknown>; | Type-specific fields (task.state, event.startTime, etc.). See the file
header for conventional fields per entity type.
Merge semantics on resolve (existing entity): governed by
UpsertBySurfaceOptions.metadataMerge. Default 'fillMissing' — only
keys absent from the stored entity's metadata are set; existing values
are never overwritten. This is the guardrail for LLM-driven ingestion:
re-extracting a task should never silently flip state or dueAt.
To deliberately change existing metadata, use updateEntityMetadata (raw
patch) or transitionTaskState (state machine + audit). The upsert path
is for first observation of fields, not updates.
On create (no match), all keys are set verbatim. |
| acl? | acl?: ACLEntry[]; | Optional explicit acl to stamp on the entity at CREATE time. Used by the
extraction resolver (via ExtractionResolverOptions.defaultAcl) to grant
read access to signal participants for content-bearing entity types (e.g.
Task / Topic created from an email) so other ICOS users on the same thread
can read the entity without re-extracting.
Create-only. The match-existing branches (Tier 1 / Tier 4 dedup,
normalized-name find) IGNORE this field and leave any pre-existing entity
acl untouched — re-resolving across signals must never narrow or
clobber access state another signal's writer established. The host
grants additional access via MemorySystem.setAccess post-resolve when
a per-entity update is genuinely intended. |
UpsertBySurfaceOptions interface
Properties
| Property | Type | Description |
|---|---|---|
autoResolveThreshold? |
autoResolveThreshold?: number; |
Candidates must clear this confidence to auto-resolve to an existing |
| entity. Conservative default (0.90) — favors fewer false merges at the | ||
| cost of creating more duplicates that can be merged later. | ||
metadataMerge? |
`metadataMerge?: 'fillMissing' | 'overwrite';` |
'fillMissing'(default): only set keys absent from stored metadata. Never overwrites existing values. Safe default for LLM-driven ingestion.'overwrite': shallow-merge (incoming keys win). Use when the caller is authoritative (e.g. sync job from a system of record).
Irrelevant on create — all keys are set. |
UpsertBySurfaceResult interface
Properties
| Property | Type | Description |
|---|---|---|
entity |
entity: IEntity; |
- |
resolved |
resolved: boolean; |
True if we matched an existing entity; false if we created a new one. |
mergeCandidates |
mergeCandidates: EntityCandidate[]; |
Other near-matches that didn't win — surfaced for human review / deferred merges. |
matchedOn? |
`matchedOn?: 'identifier' | 'displayName' |
| is false (we created a new entity) OR when resolved via the | ||
| atomic-create-or-resolve race-loss path (the racer's tier is opaque). |
Hosts use this to audit semantic auto-merges specifically — the
entity.upsert.semantic_automerge ChangeEvent fires whenever
matchedOn === 'embedding' and resolved === true. |
| rawSemanticScore? | rawSemanticScore?: number; | Raw cosine that drove a Tier-4 auto-resolve. Set ONLY when matchedOn === 'embedding'. Useful for audit logs / activity feeds — confidence on
the winning candidate is the type-capped value, not the raw score. |
UpsertEntityResult interface
Properties
| Property | Type | Description |
|---|---|---|
entity |
entity: IEntity; |
- |
created |
created: boolean; |
- |
mergedIdentifiers |
mergedIdentifiers: number; |
How many new identifiers were added to an existing entity. |
mergeCandidates |
mergeCandidates: EntityId[]; |
Other entities that matched by some identifiers but were not chosen. |
UserInfoPluginConfig interface
📍 src/core/context-nextgen/plugins/UserInfoPluginNextGen.ts:44
Properties
| Property | Type | Description |
|---|---|---|
storage? |
storage?: IUserInfoStorage; |
Custom storage implementation (default: FileUserInfoStorage) |
maxTotalSize? |
maxTotalSize?: number; |
Maximum total size across all entries in bytes (default: 100000 / ~100KB) |
maxEntries? |
maxEntries?: number; |
Maximum number of entries (default: 100) |
userId? |
userId?: string; |
User ID for storage isolation (resolved from AgentContextNextGen._userId) |
UserInteractionDeliveryContext interface
📍 src/tools/interaction/types.ts:54
Per-call context the tool passes to the delivery so it can target the right user / agent / session and embed identifiers in the outbound message for later correlation.
Properties
| Property | Type | Description |
|---|---|---|
agentId? |
agentId?: string; |
Agent ID of the requesting agent. |
sessionId? |
sessionId?: string; |
Session ID of the suspending session. |
userId? |
userId?: string; |
End-user ID the agent is acting on behalf of. |
toolCallId? |
toolCallId?: string; |
Tool call ID of the request_user_input invocation. Useful for channels |
| that want to render a deterministic request marker. |
UserInteractionDeliveryResult interface
📍 src/tools/interaction/types.ts:74
Result the app's delivery returns after successfully delivering the prompt.
Properties
| Property | Type | Description |
|---|---|---|
correlationId |
correlationId: string; |
Stable identifier the app can reproduce when the user's reply arrives. |
Used as the correlationId for the resulting SuspendSignal and stored
in ICorrelationStorage so the inbound handler can resolve it back to
the suspended (agentId, sessionId).
Examples:
"slack-thread:C0123/1700000000.123456""email:<message-id@example.com>""inapp:6c7e..."
Format is entirely app-owned. Must be unique per outstanding request. |
| channel | channel: string; | Channel name for logs and tool-result display (e.g., "slack", "email",
"inapp"). Free-form. |
| description? | description?: string; | Human-readable description of what was delivered. Returned to the LLM as
the tool's visible result (e.g., "Slack DM sent to | | metadata?|metadata?: Record<string, unknown>;| Optional metadata to forward throughSuspendSignal.metadata→SessionRef.metadata`. Use this for anything the inbound listener needs
to look up the underlying delivery (e.g., Slack thread ts, email
Message-ID, in-app notification id). |
UserInteractionRequest interface
📍 src/tools/interaction/types.ts:21
Types for human-in-the-loop interaction tools.
These tools let an agent pause itself and ask the user a question via an arbitrary delivery channel (Slack, email, in-app notification, webhook, ...). The library defines the shape of the request and the delivery contract; the app implements the channel-specific delivery + the inbound listener that resumes the agent when the user replies.
The full pause/resume cycle is built on SuspendSignal + ICorrelationStorage
already provided by the library. See createRequestUserInputTool for how the
pieces fit together.
Properties
| Property | Type | Description |
|---|---|---|
prompt |
prompt: string; |
The question or message to deliver to the user. Required. |
context? |
context?: string; |
Optional human-readable context shown alongside the prompt |
| (e.g., why we're asking, what triggered this). Channels can render | ||
| this as a header / preamble / subject. | ||
schema? |
schema?: Record<string, unknown>; |
Optional JSON Schema describing the expected reply shape. Channels that |
| render forms (in-app notifications, web webhooks) can use this to build | ||
| structured input. Free-text channels (Slack, email) typically ignore it. |
Treated as opaque by the library — pass-through to the delivery + metadata. |
| metadata? | metadata?: Record<string, unknown>; | App-specific extras the LLM (or the surrounding agent code) wants to
forward to the delivery channel — e.g., recipient hint, priority,
channel preference. Treated as opaque. |
UserPermissionRule interface
📍 src/core/permissions/types.ts:736
A persistent, per-user permission rule.
User rules have the HIGHEST priority — they override ALL built-in policies. Resolution uses specificity (conditions > no conditions), not numeric priorities.
Properties
| Property | Type | Description |
|---|---|---|
id |
id: string; |
Unique rule ID (UUID) |
toolName |
toolName: string; |
Tool name this rule applies to. '*' for all tools. |
action |
`action: 'allow' | 'deny' |
conditions? |
conditions?: ArgumentCondition[]; |
Argument conditions (optional). |
| ALL conditions must match (AND logic). | ||
| If empty/omitted, rule applies to ALL calls of this tool (blanket rule). | ||
unconditional? |
unconditional?: boolean; |
If true, this rule is absolute — more specific rules CANNOT override it. |
| "Allow bash unconditionally" means even a "bash + rm -rf → ask" rule is ignored. | ||
enabled |
enabled: boolean; |
Whether this rule is active |
description? |
description?: string; |
Human-readable description (shown in UI) |
createdBy |
`createdBy: 'user' | 'approval_dialog' |
createdAt |
createdAt: string; |
ISO timestamp |
updatedAt |
updatedAt: string; |
ISO timestamp |
expiresAt? |
`expiresAt?: string | null;` |
ValidationContext interface
📍 src/core/routineRunner.ts:195
Context snapshot passed to the validation prompt builder. Contains everything the validator needs to evaluate task completion WITHOUT conversation history.
Properties
| Property | Type | Description |
|---|---|---|
responseText |
responseText: string; |
Agent's final text output |
inContextMemory |
`inContextMemory: string | null;` |
workingMemoryIndex |
`workingMemoryIndex: string | null;` |
toolCallLog |
toolCallLog: string; |
Formatted log of all tool calls made during this task execution |
VendorOptionSchema interface
📍 src/domain/types/SharedTypes.ts:97
Vendor-specific option schema for validation and documentation Used to describe vendor-specific options that fall outside semantic options
Properties
| Property | Type | Description |
|---|---|---|
type |
`type: 'string' | 'number' |
description |
description: string; |
Description of the option |
required? |
required?: boolean; |
Whether the option is required |
label? |
label?: string; |
UI display label |
enum? |
enum?: string[]; |
Valid values for enum/string types |
default? |
default?: unknown; |
Default value |
min? |
min?: number; |
Minimum value for numbers |
max? |
max?: number; |
Maximum value for numbers |
step? |
step?: number; |
Step value for number sliders |
controlType? |
`controlType?: 'select' | 'radio' |
VendorPresentation interface
📍 src/capabilities/metadata/vendorPresentation.ts:2
Properties
| Property | Type | Description |
|---|---|---|
id |
readonly id: Vendor; |
- |
displayName |
readonly displayName: string; |
- |
color |
readonly color: string |
- |
VerificationContext interface
📍 src/core/routines/types.ts:60
Properties
| Property | Type | Description |
|---|---|---|
execution |
readonly execution: Readonly<ExecutionBinding>; |
- |
signal |
readonly signal: AbortSignal; |
- |
VisibilityContext interface
📍 src/memory/AccessControl.ts:102
Context the policy sees when asked for defaults on a write. Fields are set
according to kind:
- kind === 'entity' ⇒
entityTypeset,predicate/factKindabsent. - kind === 'fact' ⇒
predicateset (post-canonicalization),factKindset,entityTypeabsent.
Properties
| Property | Type | Description |
|---|---|---|
kind |
`kind: 'entity' | 'fact';` |
entityType? |
entityType?: string; |
- |
predicate? |
predicate?: string; |
- |
factKind? |
`factKind?: 'atomic' | 'document';` |
VoiceBridgeEvents interface
📍 src/capabilities/voice/VoiceBridge.ts:50
Properties
| Property | Type | Description |
|---|---|---|
'session:created' |
'session:created': (info: VoiceSessionInfo) => void; |
- |
'session:ended' |
'session:ended': (info: VoiceSessionInfo, summary: CallSummary) => void; |
- |
'transcript' |
'transcript': (info: VoiceSessionInfo, entry: TranscriptMessage) => void; |
- |
'error' |
'error': (error: Error, sessionId?: string) => void; |
- |
VoiceHooks interface
📍 src/capabilities/voice/types.ts:162
Lifecycle hooks for voice sessions. All hooks are async and called in order. Errors in hooks are logged but do not terminate the call (except onCallStart returning false).
Properties
| Property | Type | Description |
|---|---|---|
onCallStart? |
`onCallStart?: (session: VoiceSessionInfo) => Promise<boolean | void>;` |
Return false to reject the call. Return void or true to accept. |
||
beforeAgentResponse? |
beforeAgentResponse?: (text: string, session: VoiceSessionInfo) => Promise<string>; |
Called after STT produces text, before sending to agent. |
| Return modified text to alter what the agent sees. | ||
| In the native realtime pipeline this hook is observational because the | ||
| model has already consumed the audio; its return value is ignored. | ||
afterAgentResponse? |
afterAgentResponse?: (text: string, session: VoiceSessionInfo) => Promise<string>; |
Called after agent produces text, before TTS. |
| Return modified text to alter what the caller hears. | ||
| In the native realtime pipeline this hook is observational because audio | ||
| is generated concurrently; its return value is ignored. | ||
onInterrupt? |
onInterrupt?: (session: VoiceSessionInfo) => Promise<void>; |
Called when the caller interrupts agent speech. |
onError? |
onError?: (error: Error, session: VoiceSessionInfo) => Promise<void>; |
Called when any error occurs during the call. |
onCallEnd? |
onCallEnd?: (session: VoiceSessionInfo, summary: CallSummary) => Promise<void>; |
Called when the call ends for any reason. |
VoicePipelineEvents interface
📍 src/capabilities/voice/types.ts:395
Properties
| Property | Type | Description |
|---|---|---|
'audio:out' |
'audio:out': (frame: AudioFrame) => void; |
Audio ready to send to the caller |
'state:change' |
'state:change': (state: SessionState) => void; |
Session state changed |
'interrupt' |
'interrupt': () => void; |
Caller interrupted agent speech (barge-in) |
'playback:ack' |
'playback:ack': (ack: VoicePipelinePlaybackAck) => void; |
Telephony playback progress acknowledgement |
'transcript' |
'transcript': (entry: TranscriptMessage) => void; |
Transcript entry for UI display (caller text, agent text, tool calls) |
'error' |
'error': (error: Error) => void; |
Error during processing |
'usage' |
'usage': (usage: OpenAIRealtimeAgentUsage) => void; |
Cumulative provider usage for native OpenAI Realtime sessions. |
WorkspaceLogEntry interface
📍 src/core/context-nextgen/plugins/SharedWorkspacePluginNextGen.ts:50
Properties
| Property | Type | Description |
|---|---|---|
author |
author: string; |
- |
message |
message: string; |
- |
timestamp |
timestamp: number; |
- |
WriteFileResult interface
📍 src/tools/filesystem/types.ts:108
Result of a file write operation
Properties
| Property | Type | Description |
|---|---|---|
success |
success: boolean; |
- |
path? |
path?: string; |
- |
bytesWritten? |
bytesWritten?: number; |
- |
created? |
created?: boolean; |
- |
error? |
error?: string; |
- |
ContentType enum
📍 src/domain/entities/Content.ts:6
Content types based on OpenAI Responses API format
Properties
| Property | Type | Description |
|---|---|---|
INPUT_TEXT |
input_text |
- |
INPUT_IMAGE_URL |
input_image_url |
- |
INPUT_FILE |
input_file |
- |
OUTPUT_TEXT |
output_text |
- |
TOOL_USE |
tool_use |
- |
TOOL_RESULT |
tool_result |
- |
CUSTOM_TOOL_USE |
custom_tool_use |
- |
CUSTOM_TOOL_RESULT |
custom_tool_result |
- |
THINKING |
thinking |
- |
PROVIDER_STATE |
provider_state |
- |
MessageRole enum
📍 src/domain/entities/Message.ts:9
Properties
| Property | Type | Description |
|---|---|---|
USER |
user |
- |
ASSISTANT |
assistant |
- |
DEVELOPER |
developer |
- |
AccessLevel type
📍 src/memory/AccessControl.ts:47
Access level granted to a non-owner principal. Hierarchy: 'write' implies
'read'. The owner (record.ownerId === caller.userId) always has full
access regardless of these fields.
type AccessLevel = 'none' | 'read' | 'write'
AgentConstructionRequest type
📍 src/core/orchestrator/factoryTypes.ts:14
type AgentConstructionRequest = {
readonly name: string;
readonly baseline: Readonly<OrchestratedAgentConfig>;
} & (
| { readonly role: 'parent'; readonly type?: never }
| { readonly role: 'worker'; readonly type: string }
)
AgentEventName type
📍 src/capabilities/agents/types/EventTypes.ts:281
type AgentEventName = AgenticLoopEventName
AgentEvents type
📍 src/capabilities/agents/types/EventTypes.ts:280
Agent events - alias for AgenticLoopEvents for cleaner API This is the preferred export name going forward.
type AgentEvents = AgenticLoopEvents
AgenticLoopEventName type
📍 src/capabilities/agents/types/EventTypes.ts:274
type AgenticLoopEventName = keyof AgenticLoopEvents
AgentLoopReason type
📍 src/domain/entities/AgentLoop.ts:4
type AgentLoopReason = 'answer_returned' | 'completed' | 'predicate_unmet'
| 'recovery_exhausted' | 'repeated_results' | 'repeated_action' | 'tool_failures'
| 'no_progress' | 'uncertain_effect' | 'pending_async' | 'refusal' | 'provider_failed' | 'provider_incomplete'
| 'iteration_limit' | 'budget_exhausted' | 'checker_error' | 'state_changed' | 'cancelled' | 'suspended'
AgentPackageContextFactory type
type AgentPackageContextFactory = (
input: AgentPackageContextFactoryInput,
) => AgentContextNextGen | AgentContextNextGenConfig | Promise<AgentContextNextGen | AgentContextNextGenConfig>
AgentPackageOutcomeProtocol type
📍 src/portable/outcomeTypes.ts:9
type AgentPackageOutcomeProtocol = typeof AGENT_PACKAGE_OUTCOME_PROTOCOL
AgentPackageProtocolVersion type
type AgentPackageProtocolVersion = typeof AGENT_PACKAGE_PROTOCOL_VERSION
AgentPresetConfig type
Existing Agent options; the factory supplies context.model from the main model.
type AgentPresetConfig = Omit<AgentConfig, 'context'> & {
context?: Partial<AgentContextNextGenConfig>;
}
AgentPresetName type
Explicit compositions of delivered managed-Agent features. Plain Agent remains unchanged.
type AgentPresetName = 'research' | 'workflow'
AgentResponse type
📍 src/domain/entities/Response.ts:136
type AgentResponse = LLMResponse
AgentStatus type
📍 src/domain/entities/AgentState.ts:12
Agent execution status
type AgentStatus = | 'idle' // Created but not started
| 'running' // Actively executing
| 'suspended' // Paused, can be resumed
| 'completed' // Plan finished successfully
| 'failed' // Plan failed
| 'cancelled'
AspectRatio type
📍 src/domain/types/SharedTypes.ts:54
Aspect ratios - normalized across all visual modalities (images, video)
type AspectRatio = '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '21:9' | '3:2' | '2:3'
AudioChunkPlaybackCallback type
📍 src/capabilities/speech/types.ts:127
Callback invoked when the next in-order audio chunk is ready for playback
type AudioChunkPlaybackCallback = (event: AudioChunkReadyEvent) => void
AudioEncoding type
📍 src/capabilities/voice/types.ts:32
Audio encoding formats used in voice pipelines.
- pcm_s16le: 16-bit signed little-endian PCM (standard for STT/TTS)
- mulaw: μ-law companded 8-bit (Twilio telephony)
- alaw: A-law companded 8-bit (European telephony)
type AudioEncoding = 'pcm_s16le' | 'mulaw' | 'alaw'
AudioFormat type
📍 src/domain/types/SharedTypes.ts:65
Audio output formats
type AudioFormat = 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm' | 'ogg' | 'mulaw' | 'alaw'
BeforeExecuteResult type
📍 src/core/tool-execution/types.ts:61
Result of a plugin's beforeExecute hook.
voidorundefined: Continue execution with original args{ abort: true, result: ... }: Abort and return this result immediately{ modifiedArgs: ... }: Continue with modified arguments
type BeforeExecuteResult = | void
| undefined
| { abort: true; result: unknown }
| { modifiedArgs: unknown }
CallDirection type
📍 src/capabilities/voice/types.ts:87
type CallDirection = 'inbound' | 'outbound'
CallEndReason type
📍 src/capabilities/voice/types.ts:134
type CallEndReason = 'caller_hangup' | 'agent_hangup' | 'timeout' | 'error' | 'rejected'
ChangeEvent type
type ChangeEvent = | { type: 'entity.upsert'; entity: IEntity; created: boolean }
| { type: 'entity.archive'; entityId: EntityId }
| { type: 'entity.merge'; winnerId: EntityId; loserId: EntityId }
| { type: 'fact.add'; fact: IFact }
| { type: 'fact.archive'; factId: FactId }
| { type: 'fact.restore'; factId: FactId }
| { type: 'fact.supersede'; oldId: FactId; newId: FactId }
/**
* Emitted by `MemorySystem.expireFacts` during a scheduled lifecycle sweep,
* in addition to (not instead of) the generic `fact.archive` event for the
* same fact. The dual emit means existing `fact.archive` subscribers (cache
* invalidators, audit log appenders) keep receiving every archival, while
* observability that wants to break out automatic expiry vs. operator/agent
* archives can subscribe to `fact.expire` and read predicate + validUntil.
*/
| { type: 'fact.expire'; factId: FactId; predicate: string; validUntil: Date }
/**
* H3: emitted when a singleValued predicate's auto-supersede couldn't see a
* prior fact in the caller's scope, but a prior DOES exist in an outer scope
* (group-shared or global). The new fact lands in the caller's scope as a
* new "current" coexisting with the invisible outer one. Intentional — the
* event lets operators observe the drift without changing isolation.
*/
| {
type: 'fact.supersede_skipped_outer_scope';
subjectId: EntityId;
predicate: string;
outerFactId: FactId;
callerScope: ScopeFields;
}
| { type: 'profile.regenerate'; entityId: EntityId; scope: ScopeFields; factId: FactId }
/**
* Emitted once per embedding job that exhausted all retries. Lets operators
* surface a dead-letter signal (metrics, alerts) rather than silently
* dropping the embedding. Applies to both fact and entity-identity jobs.
*/
| {
type: 'fact.embedding.failed';
/** Populated for fact-level embeddings; null for entity-identity jobs. */
factId: FactId | null;
/** Populated for entity-identity embeddings; null for fact jobs. */
entityId: EntityId | null;
attempts: number;
reason: string;
}
/**
* Emitted when a reconciliation op (Pillar 1 thread or Pillar 2 entity-anchored)
* is rejected — either because the LLM hallucinated a factId not in priorFacts,
* or because Pillar 2 emitted a `create` op (it only resolves). Lets observers
* surface LLM-drift in the audit log without grepping logger output.
*/
| {
type: 'fact.reconcile.rejected';
/** Null when the op had no factId (e.g. a stray create in Pillar 2). */
factId: FactId | null;
reason: string;
}
/**
* Emitted when bare `MemorySystem.upsertEntity` (no identifier match) hits
* multiple entities sharing the incoming `normalizedDisplayName` in the
* caller's scope. The library cannot pick one safely — typically the
* legacy-data signature where prior dups exist — so it falls through to
* creating a NEW entity to avoid arbitrarily merging into a wrong row.
* Hosts should subscribe and run a dedup pass to consolidate.
*/
| {
type: 'entity.upsert.ambiguous';
type_: string;
normalizedDisplayName: string;
candidates: EntityId[];
createdId: EntityId;
}
/**
* Emitted when `EntityResolver.upsertBySurface` auto-resolves to an existing
* entity via the semantic tier (Tier 4) — i.e. no identifier or exact-name
* hit, but cosine similarity over `identityEmbedding` cleared the
* type-scoped auto-resolve threshold. Lets hosts write to an activity log
* without parsing console warnings, and lets observability count silent
* merges happening at write time.
*
* `cosine` is the raw similarity (BEFORE the confidence cap). `mergeCandidateIds`
* lists OTHER candidates that also scored above the semantic threshold but
* lost the top-ranked spot — useful for surfacing "maybe this should have
* merged into B instead" cases for review.
*/
| {
type: 'entity.upsert.semantic_automerge';
entityId: EntityId;
mergedSurface: string;
cosine: number;
mergeCandidateIds: EntityId[];
}
ConnectorAuth type
📍 src/domain/entities/Connector.ts:24
Connector authentication configuration Supports OAuth 2.0, API keys, JWT bearer tokens, and none (for testing)
type ConnectorAuth = | OAuthConnectorAuth
| APIKeyConnectorAuth
| APIKeyProviderConnectorAuth
| JWTConnectorAuth
| NoneConnectorAuth
Content type
📍 src/domain/entities/Content.ts:124
type Content = | InputTextContent
| InputImageContent
| InputFileContent
| OutputTextContent
| ToolUseContent
| ToolResultContent
| CustomToolUseContent
| CustomToolResultContent
| ThinkingContent
| ProviderStateContent
ContextCompactionTarget type
📍 src/core/context-nextgen/compaction/types.ts:25
type ContextCompactionTarget = 'all' | 'plugins' | 'history'
ContextFeatures type
📍 src/core/context-nextgen/types.ts:805
Feature flags for enabling/disabling plugins. Known keys provide autocomplete; arbitrary string keys are also accepted for externally registered plugins (via PluginRegistry).
type ContextFeatures = KnownContextFeatures & { [key: string]: boolean | undefined }
ContextRolloverSummarizer type
📍 src/core/context-nextgen/types.ts:1124
Host-supplied summarizer used by an explicit context rollover.
type ContextRolloverSummarizer = (
input: ContextRolloverSummaryInput,
) => Promise<string> | string
ContextSummaryGenerator type
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:52
Standalone contexts may supply a host-owned callback; Agent binds its compactor role.
type ContextSummaryGenerator = (request: ContextSummaryRequest) => Promise<{
summary: StructuredContextSummary;
helperInvocationId?: string;
/** Actual model identifier returned by the helper provider, when available. */
helperModel?: string;
taskId?: string;
}>
ContextTier type
Tiers that callers can explicitly include; relatedTasks + relatedEvents are included BY DEFAULT unless the caller passes { tiers: 'minimal' }.
type ContextTier = 'documents' | 'semantic' | 'neighbors'
ConversationCompactionOptions type
📍 src/core/context-nextgen/strategies/conversation-compaction.ts:76
type ConversationCompactionOptions = StructuredSummaryStrategyConfig & {
mode: ConversationCompactionReport['strategy'];
}
DeepSeekHost type
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:15
type DeepSeekHost = (typeof DEEPSEEK_HOSTS)[keyof typeof DEEPSEEK_HOSTS]
DeepSeekTransport type
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:16
type DeepSeekTransport = 'auto' | 'responses' | 'chat_completions'
DocumentFamily type
📍 src/capabilities/documents/types.ts:17
type DocumentFamily = | 'office'
| 'spreadsheet'
| 'pdf'
| 'html'
| 'text'
| 'image'
DocumentFormat type
📍 src/capabilities/documents/types.ts:9
Document Reader Types
Core types for the universal file-to-LLM-content converter.
type DocumentFormat = | 'docx' | 'pptx' | 'odt' | 'odp' | 'ods' | 'rtf'
| 'xlsx' | 'csv'
| 'pdf'
| 'html'
| 'txt' | 'md' | 'json' | 'xml' | 'yaml' | 'yml'
| 'png' | 'jpg' | 'jpeg' | 'gif' | 'webp' | 'svg'
DocumentFormat type
📍 src/memory/documents/types.ts:93
Suggested format values stored under metadata.format. Default is 'markdown'.
type DocumentFormat = 'markdown' | 'plain' | 'json' | (string & {})
DocumentPiece type
📍 src/capabilities/documents/types.ts:52
type DocumentPiece = DocumentTextPiece | DocumentImagePiece
DocumentSource type
📍 src/capabilities/documents/types.ts:104
type DocumentSource = FileSource | URLSource | BufferSource | BlobSource
EagernessLevel type
📍 src/memory/integration/EagernessProfile.ts:21
Three-state knob: feature off, advisory in prompt, schema-enforced.
type EagernessLevel = 'off' | 'soft' | 'strict'
EagernessPreset type
📍 src/memory/integration/EagernessProfile.ts:18
EagernessProfile — tunable restraint posture for extraction / scoring stages.
Host applications (e.g. an exec-facing Chief-of-Staff product) frequently need to suppress LLM eagerness: stop surfacing every issue, stop inventing detail when the source is thin, prefer silence over output. This profile makes that posture configurable per call (and per stage within a call) so the same library can serve both chatty and disciplined deployments.
The profile is descriptive, not executive — it records preferences;
downstream prompt builders, parsers, and the optional SkepticPass consult
it. The library ships no opinionated defaults beyond chatty (the most
permissive preset) so existing callers keep their current behavior unless
they opt in.
type EagernessPreset = 'chatty' | 'balanced' | 'strict' | 'minimal'
EagernessStage type
📍 src/memory/integration/EagernessProfile.ts:32
Stage identifier for per-stage overrides.
type EagernessStage = 'signalExtraction' | 'taskNarrative' | 'priorityScoring'
EndpointCapabilitySupport type
📍 src/capabilities/metadata/realtime.ts:4
type EndpointCapabilitySupport = 'supported' | 'unsupported' | 'unknown'
EntityEmbeddingField type
Which entity embedding to search against in
IMemoryStore.semanticSearchEntities. 'identity' (default) targets
IEntity.identityEmbedding — name/alias/identifier embedding consumed by
EntityResolver's semantic tier. 'content' targets IEntity.contentEmbedding
— long-form-content embedding currently used for document search.
Adapters that don't implement the requested field SHOULD return an empty array (they will be skipped); they MUST NOT silently fall back to the other field or callers risk leaking identity matches into content searches.
type EntityEmbeddingField = 'identity' | 'content'
EntityId type
type EntityId = string
EvictionStrategy type
📍 src/core/context-nextgen/plugins/WorkingMemoryPluginNextGen.ts:63
type EvictionStrategy = 'lru' | 'size'
FactId type
type FactId = string
FactKind type
- 'atomic' → short triple: (subject, predicate, objectId | value), optional short
details. - 'document' → long-form narrative in
details(profiles, memos, notes, bios).
type FactKind = 'atomic' | 'document'
GoogleVoice type
📍 src/capabilities/google/GoogleVoices.ts:10
type GoogleVoice = Awaited<ReturnType<VoicesClient['create']>>
GoogleVoiceCreateParams type
📍 src/capabilities/google/GoogleVoices.ts:6
type GoogleVoiceCreateParams = Parameters<VoicesClient['create']>[0]
GoogleVoiceDeleteParams type
📍 src/capabilities/google/GoogleVoices.ts:9
type GoogleVoiceDeleteParams = Parameters<VoicesClient['delete']>[1]
GoogleVoiceGetParams type
📍 src/capabilities/google/GoogleVoices.ts:8
type GoogleVoiceGetParams = Parameters<VoicesClient['get']>[1]
GoogleVoiceListParams type
📍 src/capabilities/google/GoogleVoices.ts:7
type GoogleVoiceListParams = Parameters<VoicesClient['list']>[0]
GoogleVoiceListResponse type
📍 src/capabilities/google/GoogleVoices.ts:11
type GoogleVoiceListResponse = Awaited<ReturnType<VoicesClient['list']>>
GrokRealtimeAudioFormat type
📍 src/capabilities/voice/openai/RealtimeTypes.ts:39
xAI Voice Agent audio formats, including its full documented PCM rate set.
type GrokRealtimeAudioFormat = | { type: 'audio/pcm'; rate: RealtimePCMSampleRate }
| { type: 'audio/opus'; rate?: 24000 }
| { type: 'audio/pcmu' }
| { type: 'audio/pcma' }
HelperRole type
📍 src/core/model-execution/types.ts:6
type HelperRole = 'compactor' | 'extractor' | 'verifier'
HistoryMode type
📍 src/capabilities/agents/ExecutionContext.ts:10
type HistoryMode = 'none' | 'summary' | 'full'
Hook type
📍 src/capabilities/agents/types/HookTypes.ts:15
Base hook function type
type Hook = (
context: TContext
) => TResult | Promise<TResult>
HookName type
📍 src/capabilities/agents/types/HookTypes.ts:149
type HookName = keyof Omit<HookConfig, 'hookTimeout' | 'parallelHooks'>
HydrateAgentPackageOptions type
Hydration always requires the trusted host to select both connector and model. Package values are hints for the resolver, never authorization.
type HydrateAgentPackageOptions = HydrateAgentPackageBaseOptions & (
| {
connector: string | Connector;
model: string;
connectorResolver?: never;
}
| {
connector?: never;
model?: never;
connectorResolver: (
reference: SerializedAgentPackage['agent']['connector'],
profile: 'text' | 'realtime',
) => AgentPackageConnectorResolution | Promise<AgentPackageConnectorResolution>;
}
)
HydrateAgentPackageWithOutcomesOptions type
📍 src/portable/outcomeTypes.ts:115
type HydrateAgentPackageWithOutcomesOptions = WithoutLegacyTransport<HydrateAgentPackageOptions> & {
transport: RemoteOutcomeTransport;
remoteToolTransport?: never;
maxRequests?: number;
onObservation?(report: Readonly<RemoteOutcomeReport>): void;
}
IdentifierRecoveryFn type
📍 src/memory/identifierMigration.ts:36
Recover the original-case identifier value, or null to leave the entity
untouched (no recovery available — the migration logs and skips).
Called once per (entity, identifier) the migration encounters.
type IdentifierRecoveryFn = (args: {
entity: IEntity;
identifierKind: string;
storedValue: string;
}) => Promise<string | null>
InContextPriority type
📍 src/core/context-nextgen/plugins/InContextMemoryPluginNextGen.ts:26
type InContextPriority = 'low' | 'normal' | 'high' | 'critical'
InputItem type
📍 src/domain/entities/Message.ts:126
type InputItem = | Message
| CompactionItem
| ReasoningItem
| ConfigurationUpdateItem
| CompactionTriggerItem
| FunctionCallOutputItem
| CustomToolCallOutputItem
| ComputerCallOutputItem
| ShellCallOutputItem
| ApplyPatchCallOutputItem
| ToolSearchOutputItem
JSONSchema type
📍 src/core/StructuredOutput.ts:38
A JSON Schema object (draft-07 subset — see per-vendor limitations).
type JSONSchema = Record<string, unknown>
LogLevel type
📍 src/domain/types/CommonTypes.ts:5
Common shared types
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'
MCPTransportType type
📍 src/domain/entities/MCPConfig.ts:10
MCP Configuration Types
Defines configuration structures for MCP servers and global library configuration.
type MCPTransportType = 'stdio' | 'http' | 'https'
ModifyingHook type
📍 src/capabilities/agents/types/HookTypes.ts:22
Hook that can modify data
type ModifyingHook = Hook<TContext, TModification>
MongoFilter type
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:18
Narrow collection contract the MongoMemoryAdapter depends on.
Two implementations ship in-tree: RawMongoCollection (wraps a mongodb-driver Collection) and MeteorMongoCollection (wraps a Meteor Mongo.Collection). Users with different plumbing can implement this interface themselves.
Writes are expected to trigger whatever reactivity mechanism the underlying collection provides (Meteor publications, change streams) — the adapter deliberately routes material updates through these methods so memory writes propagate to subscribers.
Reads are expected to run on the raw driver when complex pipelines are
needed (aggregate), which is why aggregate is optional — implementations
that can't support it gracefully disable the fast paths that depend on it.
type MongoFilter = Record<string, unknown>
MongoSort type
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:20
type MongoSort = Record<string, 1 | -1>
MongoUpdate type
📍 src/memory/adapters/mongo/IMongoCollectionLike.ts:19
type MongoUpdate = Record<string, unknown>
MouseButton type
📍 src/tools/desktop/types.ts:17
Desktop Automation Tools - Types
Interfaces and types for OS-level desktop automation (screenshot, mouse, keyboard, windows).
Coordinate system: LOGICAL pixels throughout. On HiDPI/Retina displays the
screenshot PNG is downsampled to logical dimensions before being returned,
so the pixel coordinates visible to a vision-LLM match the coordinate space
used by mouseMove/mouseClick/etc. scaleFactor is exposed on
DesktopScreenSize for diagnostics but is NOT applied to caller coordinates.
type MouseButton = 'left' | 'right' | 'middle'
NewEntity type
Input type for creating a new entity. id, version, createdAt, and
updatedAt are assigned by the storage layer (adapter) — callers never
set them.
type NewEntity = Omit<IEntity, 'id' | 'version' | 'createdAt' | 'updatedAt'>
NewFact type
Input type for creating a new fact. id and createdAt are assigned by
the storage layer.
type NewFact = Omit<IFact, 'id' | 'createdAt'>
ObjectIdCtor type
📍 src/memory/adapters/mongo/RawMongoCollection.ts:35
type ObjectIdCtor = (hex: string) => ObjectIdLike
OpenAIRealtimeAudioFormat type
📍 src/capabilities/voice/openai/RealtimeTypes.ts:32
type OpenAIRealtimeAudioFormat = | { type: 'audio/pcm'; rate: OpenAIRealtimePCMSampleRate }
| { type: 'audio/opus'; rate?: 24000 }
| { type: 'audio/pcmu' }
| { type: 'audio/pcma' }
OpenAIRealtimePCMSampleRate type
📍 src/capabilities/voice/openai/RealtimeTypes.ts:30
OpenAI Realtime PCM is fixed at 24 kHz.
type OpenAIRealtimePCMSampleRate = 24000
OpenAIRealtimeTurnDetection type
📍 src/capabilities/voice/openai/RealtimeTypes.ts:62
type OpenAIRealtimeTurnDetection = OpenAIServerVAD | OpenAISemanticVAD | null
OpenAIRealtimeVoice type
📍 src/capabilities/voice/openai/RealtimeTypes.ts:13
type OpenAIRealtimeVoice = | 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'marin'
| 'sage'
| 'shimmer'
| 'verse'
| 'cedar'
| (string & {})
OpenAISafetyAlert type
📍 src/capabilities/openai/OpenAISafetyAPI.ts:31
type OpenAISafetyAlert = SafetyAlert
OpenAIVoice type
📍 src/capabilities/openai/OpenAIVoices.ts:5
type OpenAIVoice = Awaited<ReturnType<OpenAI['audio']['voices']['create']>>
OpenAIVoiceCreateParams type
📍 src/capabilities/openai/OpenAIVoices.ts:6
type OpenAIVoiceCreateParams = Parameters<OpenAI['audio']['voices']['create']>[0]
OrchestratedAgentConfig type
📍 src/core/orchestrator/factoryTypes.ts:8
type OrchestratedAgentConfig = Omit<AgentConfig, 'context' | 'toolManager' | 'name' | 'parentAgentId'> & {
context?: AgentContextNextGenConfig;
toolManager?: never;
name?: never;
parentAgentId?: never;
}
OutputFormat type
📍 src/domain/types/SharedTypes.ts:70
Output format preference for media
type OutputFormat = 'url' | 'base64' | 'buffer'
OutputItem type
📍 src/domain/entities/Message.ts:138
type OutputItem = Message | CompactionItem | ReasoningItem
OversizeEmbeddingReducer type
📍 src/memory/integration/ConnectorEmbedder.ts:31
type OversizeEmbeddingReducer = (input: OversizeEmbeddingInput) => Promise<string>
PagePosition type
📍 src/tools/connector/pages/types.ts:2
Position in a provider collection, independent of search coverage.
type PagePosition = | { state: 'more'; continuation: string; positionId: string }
| { state: 'end' }
| { state: 'unknown'; reason: string }
ParseStatus type
📍 src/memory/integration/parseExtraction.ts:33
Outcome of a parse attempt. ok is the only shape callers can trust the
mentions/facts fields on (though they may still be empty).
type ParseStatus = 'ok' | 'parse_error' | 'shape_error'
Permission type
📍 src/memory/AccessControl.ts:53
A specific permission being requested. 'write' subsumes 'read' — a
write-granted caller can always read too.
type Permission = 'read' | 'write'
PermissionManagerEvent type
📍 src/core/permissions/types.ts:295
Events emitted by ToolPermissionManager
type PermissionManagerEvent = | 'tool:approved'
| 'tool:denied'
| 'tool:blocked'
| 'tool:revoked'
| 'allowlist:added'
| 'allowlist:removed'
| 'blocklist:added'
| 'blocklist:removed'
| 'session:cleared'
PermissionScope type
📍 src/core/permissions/types.ts:26
Permission scope defines when approval is required for a tool
once- Require approval for each tool call (most restrictive)session- Approve once, valid for entire sessionalways- Auto-approve (allowlisted, no prompts)never- Always blocked (blocklisted, tool cannot execute)
type PermissionScope = 'once' | 'session' | 'always' | 'never'
PipelineConfig type
📍 src/capabilities/voice/types.ts:302
type PipelineConfig = TextPipelineConfig | RealtimePipelineConfig
PluginConfigs type
📍 src/core/context-nextgen/types.ts:877
Plugin configurations for auto-initialization. Known keys provide autocomplete; arbitrary string keys accepted for externally registered plugins (via PluginRegistry).
type PluginConfigs = KnownPluginConfigs & { [key: string]: Record<string, unknown> | undefined }
PluginFactory type
📍 src/core/context-nextgen/PluginRegistry.ts:48
Plugin factory function — creates a plugin instance from optional config
type PluginFactory = (
config?: Record<string, unknown>,
context?: PluginFactoryContext
) => IContextPluginNextGen
PortableAgentRuntimeConfig type
Runtime options that are safe to carry across an application boundary.
Arbitrary vendor options, provider-hosted tools, and data-governance policy
are omitted. The receiving trusted host must reconstruct them through
HydrateAgentPackageOptions.agentConfig.
type PortableAgentRuntimeConfig = Omit<
AgentRuntimeConfigSnapshot,
'vendorOptions' | 'nativeTools' | 'promptCache' | 'dataHandling' | 'parameterPolicy'
>
Principal type
Principal-based access primitives — the storage-agnostic kit.
A principal is an opaque canonical token describing an access identity:
user:<id> entity:<id> group:<id> service:<name> world
Records (entities, facts, or host-owned documents) carry two materialized
arrays — readPrincipals / writePrincipals — derived deterministically
from their owner/group/world permissions plus an optional explicit acl.
A caller is authorized iff their principal set intersects the record's.
This module is the LOWEST layer in the access dependency graph:
- It imports nothing from
AccessControl/typesat runtime (the'read' | 'write'action union is inlined to avoid any coupling). AccessControl.canAccessand the MongoscopeToFilterimport from here (one-directional).
It is exported from the package root so a host can authorize its OWN collections with the same grammar and the same materializer — no further library change required to extend coverage to new collections.
type Principal = string
PrincipalKind type
type PrincipalKind = 'user' | 'entity' | 'group' | 'service' | 'world' | 'unknown'
PromptContext type
📍 src/memory/integration/defaultPrompt.ts:22
Context passed to a prompt template function. This is the same shape as
ProfileGeneratorInput — alias kept for backward compatibility of custom
prompt authors.
type PromptContext = ProfileGeneratorInput
QualityLevel type
📍 src/domain/types/SharedTypes.ts:60
Quality levels - normalized across vendors Providers map these to vendor-specific quality settings
type QualityLevel = 'draft' | 'standard' | 'high' | 'ultra'
RealtimePCMSampleRate type
📍 src/capabilities/voice/openai/RealtimeTypes.ts:27
PCM rates accepted by connector-shared Realtime sessions (xAI supports the full set).
type RealtimePCMSampleRate = 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000
RealtimeReasoningEffort type
📍 src/capabilities/metadata/realtime.ts:6
type RealtimeReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'
RealtimeTransport type
📍 src/capabilities/metadata/realtime.ts:5
type RealtimeTransport = 'websocket' | 'webrtc' | 'sip'
ReconciliationOp type
📍 src/memory/integration/ExtractionResolver.ts:100
Reconciliation operations emitted by the LLM in per-conversation
reconciliation mode (when priorFacts is passed to the prompt). Each op is
dispatched against the existing fact graph: create adds, update mutates
in place, archive flips archived: true. The factId on update/archive
MUST be one of the priorFact ids; hallucinated ids are rejected.
type ReconciliationOp = | {
op: 'create';
subject: string;
predicate: string;
kind: FactKind;
object?: string;
objectId?: string;
value?: unknown;
details?: string;
contextIds?: string[];
evidenceQuote?: string;
importance?: number;
confidence?: number;
}
| {
op: 'update';
factId: FactId;
newValue?: unknown;
details?: string;
evidenceQuote?: string;
reason?: string;
}
| {
op: 'archive';
factId: FactId;
evidenceQuote?: string;
reason?: string;
}
RelatedItemHit type
A related-task / related-event hit augmented with the input entity that produced the match.
type RelatedItemHit = T & { matchedEntityId: EntityId }
RemoteOutcomeEffect type
📍 src/portable/outcomeTypes.ts:10
type RemoteOutcomeEffect = 'read' | 'write' | 'unknown'
ResolvedContextFeatures type
📍 src/core/context-nextgen/types.ts:813
Resolved features retain the original required keys, plus optional additions and arbitrary external flags. Keep the required set stable so adding an opt-in feature does not break existing snapshot/configuration consumers. Live contexts still merge every known default; older constructed snapshots can omit additions.
type ResolvedContextFeatures = KnownContextFeatures & Required<Pick<KnownContextFeatures,
| 'workingMemory' | 'inContextMemory' | 'persistentInstructions' | 'userInfo'
| 'toolCatalog' | 'sharedWorkspace' | 'memory' | 'memoryWrite'
>> & Record<string, boolean>
ResponseFormat type
📍 src/core/StructuredOutput.ts:43
Vendor-agnostic structured-output request. Identical across all vendors.
type ResponseFormat = | { type: 'json_object' }
| {
type: 'json_schema';
/** The JSON Schema the response must conform to. */
schema: JSONSchema;
/** Schema name (some vendors require one). Default: `'response'`. */
name?: string;
/** Human-readable description of the schema (passed through where supported). */
description?: string;
/** Request strict schema adherence where the vendor supports it. Default: `true`. */
strict?: boolean;
}
RestraintEventKind type
📍 src/memory/integration/RestraintEvent.ts:22
RestraintEvent — one shared shape for every decision a restraint primitive
makes (kept, dropped, vetoed, parse-failed). Used by RestrainedExtractionContract
and SkepticPass.
The library does NOT write logs anywhere — it emits events. Hosts wire the
onDecision callback to their own log store (ICOS writes them to
jarvis_activity_log so admin dashboards can render emitted-vs-vetoed
counters and operators can tune presets against real data).
Standing rule: no silent disappearance. Every drop, every veto, every
parse failure on the restraint path produces a RestraintEvent. If you
find yourself dropping an item without emitting one — stop and add the
event.
type RestraintEventKind = | 'skeptic_kept'
/** SkepticPass voted to drop this item. */
| 'skeptic_veto'
/** SkepticPass output couldn't be parsed — pass treated as no-op for safety. */
| 'skeptic_parse_failure'
/** SkepticPass connector/model errored. Items pass through. */
| 'skeptic_error'
/** Item dropped because evidenceQuote was missing under strict mode. */
| 'evidence_missing'
/** Output non-empty but `whyActionable` missing under requireJustification. */
| 'justification_missing'
/** Item kept by RestrainedExtractionContract (passed all refinements). */
| 'kept'
| (string & {})
RestraintEventListener type
📍 src/memory/integration/RestraintEvent.ts:75
Convenience callback type used by every restraint primitive.
type RestraintEventListener = (event: RestraintEvent) => void
RestraintStage type
📍 src/memory/integration/RestraintEvent.ts:40
Stage label — extraction, narrative, scoring, etc. Open-string for host stages.
type RestraintStage = | 'signalExtraction'
| 'taskNarrative'
| 'priorityScoring'
| (string & {})
RiskLevel type
📍 src/core/permissions/types.ts:34
Risk level classification for tools
Used to help users understand the potential impact of approving a tool. Can be used by UI to show different approval dialogs.
type RiskLevel = 'low' | 'medium' | 'high' | 'critical'
RoutineExecutionStatus type
📍 src/domain/entities/Routine.ts:202
Execution status for a routine run
type RoutineExecutionStatus = | 'pending' // Created but not started
| 'running' // Currently executing
| 'paused' // Manually paused
| 'completed' // All tasks completed successfully
| 'failed' // Failed (unrecoverable)
| 'cancelled'
RoutineObservation type
📍 src/core/routines/types.ts:56
type RoutineObservation = RoutineObservationBase & (
| { readonly phase: 'task'; readonly taskId: string; readonly response?: Readonly<AgentResponse> }
| { readonly phase: 'routine'; readonly taskId?: never; readonly response?: never }
)
RoutineProgress type
📍 src/core/routines/types.ts:108
type RoutineProgress = | { kind: 'started'; operationId: string }
| { kind: 'observation'; observation: RoutineObservation }
| { kind: 'result'; result: RoutineRunResult }
RoutineRunRequest type
📍 src/core/routines/types.ts:79
type RoutineRunRequest = Pick<ExecuteRoutineOptions,
'definition' | 'inputs' | 'initialUserMessage' | 'disableToolScoping' | 'hooks' | 'prompts'> & {
agent: Agent;
execution?: ExecutionBinding;
}
RoutineRunResult type
📍 src/core/routines/types.ts:74
type RoutineRunResult = RoutineReport & (
| { state: 'completed'; verification: Extract<VerificationDecision, { kind: 'verified' }> }
| { state: 'waiting' | 'blocked' | 'uncertain'; reason: string; continuation: RoutineContinuation }
| { state: 'failed' | 'cancelled'; reason: string }
)
RoutineStepType type
📍 src/domain/entities/RoutineExecutionRecord.ts:15
type RoutineStepType = | 'task.started'
| 'task.completed'
| 'task.failed'
| 'task.validation'
| 'tool.call'
| 'tool.start'
| 'llm.start'
| 'llm.complete'
| 'iteration.complete'
| 'execution.error'
| 'control_flow.started'
| 'control_flow.completed'
| 'prestep.started'
| 'prestep.completed'
| 'prestep.failed'
| 'poststep.started'
| 'poststep.completed'
| 'poststep.failed'
ScrapeFeature type
📍 src/capabilities/scrape/ScrapeProvider.ts:129
Features that scrape providers may support
type ScrapeFeature = | 'javascript' // Can render JavaScript
| 'markdown' // Can convert to markdown
| 'screenshot' // Can take screenshots
| 'links' // Can extract links
| 'metadata' // Can extract metadata
| 'proxy' // Uses proxy rotation
| 'stealth' // Has anti-bot detection bypass
| 'pdf' // Can scrape PDFs
| 'dynamic'
ServiceCategory type
📍 src/domain/entities/Services.ts:11
Services - Single source of truth for external service definitions
All service metadata is defined in one place (SERVICE_DEFINITIONS). Other exports are derived from this to maintain DRY principles.
type ServiceCategory = | 'major-vendors'
| 'communication'
| 'development'
| 'productivity'
| 'crm'
| 'payments'
| 'cloud'
| 'storage'
| 'email'
| 'monitoring'
| 'search'
| 'scrape'
| 'other'
ServiceType type
📍 src/domain/entities/Services.ts:510
Service type - union of all service IDs
type ServiceType = (typeof SERVICE_DEFINITIONS)[number]['id']
SignalReconciliationOp type
📍 src/memory/integration/ExtractionResolver.ts:176
Combined op type emitted by the signal-reconciliation pass: fact ops (reusing
the existing ReconciliationOp shapes — create is rejected at dispatch, the
pass only supersedes) plus task ops.
type SignalReconciliationOp = ReconciliationOp | TaskReconciliationOp
SkepticPassMode type
📍 src/memory/integration/EagernessProfile.ts:29
Skeptic-pass mode label. The library does NOT define a connector/model for
each mode — that's the host's choice (e.g. ICOS picks Haiku for cheap,
Sonnet at low temp for strong). Code that runs the pass takes the mode
label and looks up its concrete config out of band.
type SkepticPassMode = 'off' | 'cheap' | 'strong'
StorageContext type
📍 src/core/StorageRegistry.ts:63
Opaque context passed to per-agent storage factories.
The library imposes no structure — consumers define their own shape
(e.g., { userId: 'alice', tenantId: 'acme' }).
Mirrors the ConnectorAccessContext pattern used by Connector.scoped().
type StorageContext = Record<string, unknown>
StructuredParseResult type
📍 src/core/StructuredOutput.ts:213
type StructuredParseResult = | { ok: true; value: unknown }
| { ok: false; error: Error }
TemplateHandler type
📍 src/core/TemplateEngine.ts:35
A template handler function.
type TemplateHandler = (arg: string | undefined, context: TemplateContext) => string | Promise<string>
TransportConfig type
📍 src/domain/entities/MCPConfig.ts:56
Transport configuration union type
type TransportConfig = StdioTransportConfig | HTTPTransportConfig
VADEvent type
📍 src/capabilities/voice/types.ts:56
Result of VAD processing a single audio frame
type VADEvent = 'speech_start' | 'speech_end' | null
VerificationDecision type
📍 src/core/routines/types.ts:11
type VerificationDecision = | { kind: 'verified'; references?: readonly EvidenceReference[] }
| { kind: 'waiting' | 'blocked' | 'uncertain'; reason: string; references?: readonly EvidenceReference[] }
VisibilityPolicy type
📍 src/memory/AccessControl.ts:123
Host-supplied function that returns default Permissions for a write when
the caller didn't specify permissions explicitly. Lets hosts encode
policies like "entities are group-readable, facts are owner-private by
default" without touching every call site.
Rules:
- Caller-supplied
permissionson the write input always wins — this policy only fills the blanks. - Return
undefinedto fall through to the library defaults (DEFAULT_GROUP_LEVEL/DEFAULT_WORLD_LEVEL— both'read'). - The policy is invoked synchronously on every entity/fact create path
inside
MemorySystem; keep it cheap (pure lookup, no I/O).
type VisibilityPolicy = (ctx: VisibilityContext) => Permissions | undefined
VoiceAgentFactory type
📍 src/capabilities/voice/types.ts:356
Create one fully configured Agent for a single call. VoiceSession owns and destroys it.
type VoiceAgentFactory = (
session: VoiceSessionInfo,
) => Agent | Promise<Agent>
VoiceBridgeConfig type
📍 src/capabilities/voice/types.ts:375
VoiceBridge configuration — discriminated union by pipeline type.
type VoiceBridgeConfig = VoiceAgentSource & (
| (VoiceBridgeBaseConfig & TextPipelineConfig)
| (VoiceBridgeBaseConfig & RealtimePipelineConfig)
)
applyRestrainedExtractionContract function
📍 src/memory/integration/RestrainedExtractionContract.ts:95
Apply restraint refinements to a parsed extraction output. Pure — no I/O.
Returns a NEW ExtractionOutput plus the decision log. The input is not
mutated. Mentions that were referenced only by dropped facts ARE retained —
the LLM may have introduced them for entity resolution alone, and dropping
them here would lose entity merge candidates. Tasks are never dropped by
this contract for priority reasons (v10+) — binding state is surfaced via
reasonCode on emitted kept events so downstream scoring can demote
unbound tasks without losing them from the graph.
export function applyRestrainedExtractionContract(
input: RestrainedExtractionInput,
opts: RestrainedExtractionOptions,
): RestrainedExtractionResult
assertAgentPackageCompatible function
📍 src/portable/AgentPackage.ts:321
Validate the public protocol version and the bounded fields used for routing.
export function assertAgentPackageCompatible(packageValue: SerializedAgentPackage): void
assertCanAccess function
📍 src/memory/AccessControl.ts:228
Throw PermissionDeniedError if caller lacks need on record.
export function assertCanAccess(
record: AccessControlled,
caller: ScopeFilter,
need: Permission,
recordKind: 'entity' | 'fact',
): void
buildEagernessProfile function
📍 src/memory/integration/EagernessProfile.ts:159
Build a profile from a preset name with optional top-level overrides.
Convenience for hosts that want "preset X but with requireJustification
always on" without hand-rolling the merge.
export function buildEagernessProfile(
preset: EagernessPreset,
overrides?: Partial<Omit<EagernessProfile, 'preset'>>,
): EagernessProfile
buildEndpointWithQuery function
📍 src/capabilities/shared/types.ts:106
Build endpoint URL with query parameters
export function buildEndpointWithQuery(
endpoint: string,
queryParams?: Record<string, string | number | boolean>
): string
buildIdentityString function
📍 src/memory/resolution/EntityResolver.ts:576
Short string embedded for identity matching. Composed of displayName, top aliases, and primary identifier values. Populated on every entity write when an embedder is configured; consumed by the future entity-level semantic search tier (not yet wired — see file header).
export function buildIdentityString(args: {
type: string;
displayName: string;
aliases: string[];
identifiers: Identifier[];
}): string
buildQueryString function
📍 src/capabilities/shared/types.ts:63
Build query string from params
export function buildQueryString(params: Record<string, string | number | boolean>): string
buildWorkspaceDelta function
📍 src/core/orchestrator/tools.ts:81
export function buildWorkspaceDelta(
agentName: string,
workspace: SharedWorkspacePluginNextGen,
lastSeen: Map<string, number>,
): string
canAccess function
📍 src/memory/AccessControl.ts:199
Returns true iff caller has the requested permission on record.
Evaluation order:
- Owner match → true (full access, unconditionally).
- Group match →
levelGrants(permissions.group, need). - Otherwise →
levelGrants(permissions.world, need).
export function canAccess(
record: AccessControlled,
caller: ScopeFilter,
need: Permission,
): boolean
canByPrincipals function
📍 src/access/principals.ts:232
In-process access check. Returns false when the record carries no
materialized arrays — callers (e.g. AccessControl.canAccess) decide whether
to fall back to the legacy owner/group/world check in that case.
export function canByPrincipals(
record: { readPrincipals?: string[]; writePrincipals?: string[] },
principals: string[],
need: 'read' | 'write',
): boolean
canonicalIdentifier function
📍 src/memory/identifiers.ts:146
Build a canonical identifier for an entity that lacks a natural external key.
The resulting value is <type>:<part>:<part>:... where undefined/empty
parts are dropped. The last part is slugified; earlier parts are used as-is
(they're typically entity ids or identifier kinds, already safe). If you
want all parts slugified, slugify them before calling.
export function canonicalIdentifier(
type: string,
parts: Record<string, string | undefined>,
opts: CanonicalIdentifierOptions = {},
): Identifier
Example:
canonicalIdentifier('task', {
assignee: 'user_123',
context: 'topic_erp_renewal',
title: 'Send budget by Friday',
})
// → { kind: 'canonical', value: 'task:user_123:topic_erp_renewal:send-budget-by-friday' }
Calendar event
canonicalIdentifier('event', { source: 'gcal', id: '3k9f...abc' })
// → { kind: 'canonical', value: 'event:gcal:3k9f-abc' }
coerceFactTemporalFields function
📍 src/memory/dateCoercion.ts:175
Coerce the temporal fields on an IFact write input or patch. Operates on
a copy when changes are made, original ref when not. Also coerces nested
metadata AND value — callers that stash dates inside value (e.g.
adapter-emitted facts with {at: '<iso>'}) would otherwise reintroduce the
BSON range-query bug we exist to prevent. value recursion uses the same
conservative ISO-regex guard as metadata, so business strings like
'never' or 'soon' stay strings.
export function coerceFactTemporalFields<T extends Record<string, unknown>>(input: T): T
coerceMetadataDates function
📍 src/memory/dateCoercion.ts:116
Walk a metadata object recursively, coercing every ISO-date-looking string
to a Date. Returns the same reference when nothing changes (lets callers'
deep-equality + dirty checks short-circuit).
Recurses into plain objects and array elements. Skips Date / RegExp / Buffer / TypedArray (anything that's not a plain object literal).
No depth cap: metadata in this library is JSON-shaped (round-trips through BSON, which itself rejects cycles and caps at 100 levels). A silent depth cap here would leave deeply-nested ISO strings uncoerced and reintroduce the BSON cross-type range-query bug this helper exists to prevent.
Cycle-safe: app code that accidentally constructs a cyclic metadata
structure (e.g. obj.self = obj) is handled by a WeakSet visited-check.
The cycle node is returned as-is rather than crashing the process with a
stack overflow — wrong failure mode for a library safety net.
export function coerceMetadataDates<T extends Record<string, unknown> | undefined>(
metadata: T,
): T
createAgentPreset function
Compose an ordinary AgentConfig without creating an Agent, accessing credentials, doing storage IO or calling a model. Explicit values override preset defaults; nested feature/plugin maps merge by key. Opaque host objects remain host-owned. Evidence requires a host-selected scope, backend and matching userId. Workflow also requires host-selected task state. No helper, permission or verifier is invented.
export function createAgentPreset(name: AgentPresetName, config: AgentPresetConfig): AgentConfig
createDelegationState function
📍 src/core/orchestrator/tools.ts:63
export function createDelegationState(): DelegationState
createEmbeddingProvider function
📍 src/core/createEmbeddingProvider.ts:16
Create an Embedding provider from a connector
export function createEmbeddingProvider(connector: Connector): IEmbeddingProvider
createExecutionRecorder function
📍 src/core/createExecutionRecorder.ts:103
Create an ExecutionRecorder that wires hooks + callbacks to persist execution state via the provided storage backend.
export function createExecutionRecorder(options: ExecutionRecorderOptions): ExecutionRecorder
createOrchestrator function
📍 src/core/orchestrator/createOrchestrator.ts:582
Create an orchestrator Agent that can coordinate a team of worker agents.
The orchestrator serves as the single point of contact for the user and supports 3 routing modes: DIRECT (answer or silently delegate), DELEGATE (interactive session with a specialist), and ORCHESTRATE (complex multi-agent plans).
All agent execution is async — the orchestrator never blocks waiting for sub-agents.
export async function createOrchestrator(config: OrchestratorConfig): Promise<Agent>
Example:
const orchestrator = await createOrchestrator({
connector: 'openai',
model: 'gpt-4',
agentTypes: {
developer: {
systemPrompt: 'You are a senior developer...',
description: 'Senior developer who writes clean, tested code.',
scenarios: ['implementing features', 'fixing bugs', 'writing tests'],
capabilities: ['read/write files', 'run shell commands', 'search code'],
tools: [readFile, writeFile, bash],
},
researcher: {
systemPrompt: 'You are a research specialist...',
description: 'Research specialist with web access.',
scenarios: ['finding documentation', 'comparing libraries'],
capabilities: ['web search', 'web scrape', 'summarize findings'],
tools: [webSearch, webScrape],
},
},
});
// Simple question → DIRECT
const result = await orchestrator.run('What is JWT?');
// Tool-heavy task → DIRECT (silently delegates)
const result = await orchestrator.run('Research the top 3 auth libraries for Node.js');
// Interactive session → DELEGATE
const result = await orchestrator.run('Help me debug this auth flow step by step');
// Complex task → ORCHESTRATE
const result = await orchestrator.run('Build an auth module with JWT, tests, and docs');
createOrchestratorWithFactory function
📍 src/core/orchestrator/createOrchestrator.ts:587
Complete host configuration before one owned construction. Existing factories remain unchanged.
export async function createOrchestratorWithFactory(config: OrchestratorConfig, options: OrchestratorFactoryOptions): Promise<Agent>
createRoutineDefinition function
📍 src/domain/entities/Routine.ts:250
Create a RoutineDefinition with defaults. Validates task dependency references and detects cycles.
export function createRoutineDefinition(input: RoutineDefinitionInput): RoutineDefinition
createRoutineExecution function
📍 src/domain/entities/Routine.ts:305
Create a RoutineExecution from a RoutineDefinition. Instantiates all tasks into a Plan via createPlan().
export function createRoutineExecution(definition: RoutineDefinition): RoutineExecution
createRoutineExecutionRecord function
📍 src/domain/entities/RoutineExecutionRecord.ts:118
Create an initial RoutineExecutionRecord from a definition. Status is set to 'running' with empty steps.
export function createRoutineExecutionRecord(
definition: RoutineDefinition,
connectorName: string,
model: string,
trigger?: RoutineExecutionRecord['trigger'],
): RoutineExecutionRecord
createRoutineRunner function
📍 src/core/routines/createRoutineRunner.ts:50
Opt-in verified, same-process routines. Legacy executeRoutine/createRoutineTool are unchanged.
export function createRoutineRunner(options: RoutineRunnerOptions): RoutineRunner
defaultExtractionPrompt function
📍 src/memory/integration/defaultExtractionPrompt.ts:351
export function defaultExtractionPrompt(ctx: ExtractionPromptContext): string
defaultProfilePrompt function
📍 src/memory/integration/defaultPrompt.ts:24
export function defaultProfilePrompt(ctx: PromptContext): string
defaultSkepticPrompt function
📍 src/memory/integration/SkepticPass.ts:291
export function defaultSkepticPrompt(ctx: SkepticPromptContext): string
detectServiceFromURL function
📍 src/domain/entities/Services.ts:588
Detect service type from a URL
export function detectServiceFromURL(url: string): string | undefined
diffEntityMetadata function
📍 src/memory/metadataDiff.ts:27
Compare prev and next over watchedKeys, returning a change record per
key that differs. Equal keys (deep-equal) are omitted. Order of the input
watchedKeys is preserved in the output.
prev and next can be undefined — treated as empty objects.
export function diffEntityMetadata(
prev: Record<string, unknown> | undefined,
next: Record<string, unknown> | undefined,
watchedKeys: readonly string[],
): MetadataChange[]
effectivePermissions function
📍 src/memory/AccessControl.ts:181
Resolve a record's effective group+world levels after applying library
defaults. The group level is 'none' when the record has no groupId
(no group principal exists).
export function effectivePermissions(
record: AccessControlled,
): { group: AccessLevel; world: AccessLevel }
emitRestraintEvent function
📍 src/memory/integration/RestraintEvent.ts:88
Helper: emit one event to a listener while also pushing it onto an array
(so the caller's result can include the full events: RestraintEvent[]).
Listener errors do NOT propagate — a logging failure must not break the
pipeline (otherwise we'd silently drop items because we couldn't log
dropping them, defeating the rule). But the failure IS logged via
console.error with the offending event attached, so a buggy listener
doesn't blackhole every decision invisibly. The "no silent error" rule
applies even to error-handling code.
export function emitRestraintEvent(
collector: RestraintEvent[],
listener: RestraintEventListener | undefined,
event: RestraintEvent,
): void
encodeSharingUrl function
📍 src/tools/microsoft/types.ts:724
Encode a sharing URL into the Graph API sharing token format.
Microsoft Graph's /shares/{token} endpoint accepts base64url-encoded URLs
prefixed with u!. This is the documented way to access files via sharing links
or direct web URLs without knowing the driveId/itemId.
export function encodeSharingUrl(webUrl: string): string
ensureIndexes function
📍 src/memory/adapters/mongo/indexes.ts:55
export async function ensureIndexes(args: EnsureIndexesArgs): Promise<void>
ensureNormalizedNameUniqueIndex function
📍 src/memory/adapters/mongo/indexes.ts:298
Install the unique partial index on {groupId, ownerId, type, normalizedDisplayName} that makes IMemoryStore.atomicCreateOrFindByNormalizedName
cross-process-safe. Host-controlled, never auto-installed.
Why host-controlled: adding a unique index to a collection that already contains duplicates fails immediately with E11000. The library cannot safely do this for you. The correct sequence on a live deployment:
- Bump library to >=0.8.0; ship Commit 1 (adds the normalized fields to every new/updated row).
- Run
MemorySystem.backfillNormalizedFields(...)(Commit 6) so every existing entity has the field populated. - Run a deduplication pass (your tooling —
findDuplicateClusterslands separately in Phase C). - Call this helper from a migration to enforce uniqueness going forward.
Why partial: archived entities don't participate in the dedup contract;
neither do legacy entities lacking normalizedDisplayName. The
partialFilterExpression restricts the index to documents where the field
matters, keeping the index small and avoiding spurious E11000s on archived
rows that share a normalized name with a live row.
Idempotent — createIndex with the same {spec, opts} is a no-op.
export async function ensureNormalizedNameUniqueIndex(
entities: IMongoCollectionLike<IEntity>,
opts?: { name?: string },
): Promise<void>
entityReconciliationPrompt function
📍 src/memory/integration/entityReconciliationPrompt.ts:40
export function entityReconciliationPrompt(ctx: EntityReconciliationPromptContext): string
excelToMarkdownKV function
📍 src/capabilities/documents/handlers/ExcelHandler.ts:325
Convert an Excel (.xlsx) or CSV file buffer to Markdown-KV format.
Each row becomes a record block:
### Record 1
- **Name**: Alice
- **Age**: 30
export async function excelToMarkdownKV(
buffer: Buffer,
format: 'xlsx' | 'csv',
options?: ExcelToMarkdownKVOptions,
): Promise<string | MarkdownKVSheet[]>
executeRoutine function
📍 src/core/routineRunner.ts:909
Execute a routine definition.
Creates an Agent with working memory + in-context memory enabled, then runs each task in dependency order. Between tasks, conversation history is cleared but memory plugins persist, allowing tasks to share data via memory.
export async function executeRoutine(options: ExecuteRoutineOptions): Promise<RoutineExecution>
Example:
const execution = await executeRoutine({
definition: myRoutine,
connector: 'openai',
model: 'gpt-4',
tools: [myCustomTool],
onTaskComplete: (task) => console.log(`✓ ${task.name}`),
});
console.log(execution.status); // 'completed' | 'failed'
Caller-driven kickoff (caller bakes pre-loaded context into the agent's instructions, library injects the first user message):
const agent = Agent.create({
connector: 'openai',
model: 'gpt-4',
instructions: agentDef.instructions + '\n\n## Pre-loaded task\nFacts:\n- ...',
tools,
});
const execution = await executeRoutine({
definition: actionExecutorRoutine,
agent,
initialUserMessage: 'Execute the selected action: Send reply.',
});
exportAgentPackage function
📍 src/portable/AgentPackage.ts:78
Export one already-resolved Agent as a data-only package for another runtime.
export function exportAgentPackage(
agent: Agent,
options: ExportAgentPackageOptions = {},
): SerializedAgentPackage
factFilterToMongo function
📍 src/memory/adapters/mongo/queries.ts:17
Build a Mongo filter from a FactFilter + ScopeFilter. Pushes archived and asOf into the DB so the app never scans hidden docs.
scopeOpts propagates to scopeToFilter — used by the adapter to honor
its disableWorldVisibility option uniformly across read paths.
export function factFilterToMongo(
filter: FactFilter,
scope: ScopeFilter,
scopeOpts: ScopeToFilterOptions = {},
): MongoFilter
findConnectorByServiceTypes function
📍 src/capabilities/shared/types.ts:162
Find a connector by supported service types Used by tools to auto-detect available external API connectors
This is the GENERIC utility for all external API-dependent tools. Tools define which service types they support, this function finds the first available connector matching any of those types.
export function findConnectorByServiceTypes(serviceTypes: string[]): Connector | null
Example:
// In web_search tool
const SEARCH_SERVICE_TYPES = ['serper', 'brave-search', 'tavily', 'rapidapi-search'];
const connector = findConnectorByServiceTypes(SEARCH_SERVICE_TYPES);
// In web_scrape tool
const SCRAPE_SERVICE_TYPES = ['zenrows', 'jina-reader', 'firecrawl', 'scrapingbee'];
const connector = findConnectorByServiceTypes(SCRAPE_SERVICE_TYPES);
findDuplicateCandidates function
For one entity, return the small set of in-scope entities that are plausible duplicate candidates. Combines three lookup sources:
- Identifier matches (per identifier).
findEntitiesByNormalizedName(matchAliases: true).- Optional:
semanticSearchEntitiesvia identityEmbedding.
Returns deduped, archived-excluded, self-excluded entities.
export async function findDuplicateCandidates(
memory: MemorySystem,
entity: IEntity,
scope: ScopeFilter,
opts: FindCandidatesOptions = {},
): Promise<IEntity[]>
findDuplicateClusters function
Enumerate (type, normalizedDisplayName) clusters with count >= minClusterSize
in the given scope. Pure snapshot — no scoring. The "where are the dups?"
admin primitive; pair with scoreEntityPair to decide what to do about each.
Implementation note: paginates through listEntities and groups
client-side. For tenants up to ~10k entities this is fast on either adapter.
Adapters wanting a native aggregation can override.
export async function findDuplicateClusters(
memory: MemorySystem,
scope: ScopeFilter,
opts: FindClustersOptions = {},
): Promise<DuplicateCluster[]>
findIdentifierClusters function
Enumerate (identifier.kind, identifier.value) clusters where ≥
minClusterSize entities share an identifier. Complements
findDuplicateClusters (which pivots on name) — catches the dup pattern
where two entities share an email/slack_id/github handle but have
different displayNames ("Pavel" + "Pavel Khasanov" sharing
email: pavel@everworker.ai).
Implementation: paginates listEntities, groups by (kind, normalizedValue) using identifierValuesEqual's case-folding contract
(email/domain/phone/url_host fold to lowercase; everything else exact).
Same client-side scale envelope as findDuplicateClusters — fast under
~10k entities, slower beyond.
export async function findIdentifierClusters(
memory: MemorySystem,
scope: ScopeFilter,
opts: FindIdentifierClustersOptions = {},
): Promise<IdentifierCluster[]>
formatAttendees function
📍 src/tools/microsoft/types.ts:324
Convert an array of email addresses (any format) to Microsoft Graph attendee format. Normalizes input first, so it's safe to pass LLM output directly.
export function formatAttendees(emails: unknown[]): { emailAddress: { address: string }; type: string }[]
formatFileSize function
📍 src/tools/google/types.ts:372
Format a file size in bytes to a human-readable string.
export function formatFileSize(bytes: number): string
formatFileSize function
📍 src/tools/microsoft/types.ts:828
Format a file size in bytes to a human-readable string.
export function formatFileSize(bytes: number): string
formatPluginDisplayName function
📍 src/core/context-nextgen/snapshot.ts:159
Convert a plugin name to a human-readable display name. e.g., 'working_memory' → 'Working Memory'
export function formatPluginDisplayName(name: string): string
formatRecipients function
📍 src/tools/microsoft/types.ts:316
Convert an array of email addresses (any format) to Microsoft Graph recipient format. Normalizes input first, so it's safe to pass LLM output directly.
export function formatRecipients(emails: unknown[]): { emailAddress: { address: string } }[]
fromLibraryPermissions function
📍 src/access/principals.ts:151
Map the library's Permissions {group, world} (+ owner/group ids) into an
AccessInput. Mirrors AccessControl.effectivePermissions: group defaults
to 'read' when a groupId is present, world defaults to 'read'.
acl is NOT taken here — call sites union it in explicitly (see
principalsForLibraryRecord) so this mapper stays a pure permissions→input
projection.
export function fromLibraryPermissions(
perms: { group?: 'none' | 'read' | 'write'; world?: 'none' | 'read' | 'write' } | undefined,
ownerId: string | undefined,
groupId: string | undefined,
): AccessInput
fromNimbleAudit function
📍 src/access/principals.ts:180
Map a NimbleAudit-style {isPublic, ownerId, groupId} (+ host-translated
acl) into an AccessInput. Exported for hosts authorizing their OWN
collections; the library itself never calls this.
isPublic && groupId → group-readable isPublic && !groupId → world-readable (platform-level) !isPublic → private (owner + acl only)
NimbleAudit groups are read-level only (group writes go through owner/acl),
so groupWrite/worldWrite are always false here.
export function fromNimbleAudit(
isPublic: boolean | undefined,
ownerId: string | undefined,
groupId: string | undefined,
acl?: ACLEntry[],
): AccessInput
fromSlackTimestamp function
📍 src/tools/slack/types.ts:164
Convert a Slack timestamp to an ISO 8601 string.
export function fromSlackTimestamp(ts: string): string
genericTraverse function
📍 src/memory/GenericTraversal.ts:15
export async function genericTraverse(
store: IMemoryStore,
startId: EntityId,
opts: TraversalOptions,
scope: ScopeFilter,
): Promise<Neighborhood>
getAccountSid function
📍 src/tools/twilio/types.ts:31
Get the Twilio Account SID from the connector's auth extra fields.
The Account SID is stored in auth.extra.accountId when the connector
is created via the Twilio vendor template.
export function getAccountSid(connector: Connector): string
getAllServiceIds function
📍 src/domain/entities/Services.ts:624
Get all service IDs
export function getAllServiceIds(): string[]
getAuthenticatedUserId function
📍 src/tools/slack/types.ts:544
Get the authenticated bot/user's Slack user ID.
Uses auth.test — works for both bot and user tokens.
export async function getAuthenticatedUserId(
connector: Connector,
userId?: string,
accountId?: string
): Promise<string>
getBackgroundOutput function
Get output from a background process
export function getBackgroundOutput(bgId: string): { found: boolean; output?: string; running?: boolean }
getBotToken function
📍 src/tools/telegram/types.ts:28
Get the Bot API token from the connector's auth config.
export function getBotToken(connector: Connector): string
getDesktopDriver function
📍 src/tools/desktop/getDriver.ts:18
Get (or create) the desktop driver instance. If config.driver is provided, uses that instead of the default.
export async function getDesktopDriver(config?: DesktopToolConfig): Promise<IDesktopDriver>
getDrivePrefix function
📍 src/tools/microsoft/types.ts:772
Determine the drive prefix for Graph API calls.
Priority:
- siteId →
/sites/{siteId}/drive - driveId →
/drives/{driveId} - fallback →
{userPrefix}/drive(e.g.,/me/drive)
export function getDrivePrefix(
userPrefix: string,
options?: { siteId?: string; driveId?: string }
): string
getEagernessPreset function
📍 src/memory/integration/EagernessProfile.ts:109
Look up a preset by name. Returns a fresh shallow copy so callers can mutate without poisoning the canonical table.
export function getEagernessPreset(preset: EagernessPreset): EagernessProfile
getMediaStorage function
📍 src/tools/multimedia/config.ts:23
Get the global media storage (creates default FileMediaStorage on first access)
export function getMediaStorage(): IMediaStorage
getRegisteredScrapeProviders function
📍 src/capabilities/scrape/ScrapeProvider.ts:170
Get registered service types
export function getRegisteredScrapeProviders(): string[]
getRoutineProgress function
📍 src/domain/entities/Routine.ts:334
Compute routine progress (0-100) from plan task statuses.
export function getRoutineProgress(execution: RoutineExecution): number
getServiceDefinition function
📍 src/domain/entities/Services.ts:610
Get service definition by service type
export function getServiceDefinition(serviceType: string): ServiceDefinition | undefined
getServiceInfo function
📍 src/domain/entities/Services.ts:603
Get service info by service type
export function getServiceInfo(serviceType: string): ServiceInfo | undefined
getServicesByCategory function
📍 src/domain/entities/Services.ts:617
Get all services in a category
export function getServicesByCategory(category: ServiceCategory): ServiceDefinition[]
getTranscriptionCapabilities function
📍 src/capabilities/metadata/realtime.ts:49
Endpoint/session constraints only. This does not modify legacy STT flags or validate a live session.
export function getTranscriptionCapabilities(query: TranscriptionCapabilityQuery): TranscriptionCapabilities
getUserPathPrefix function
📍 src/tools/microsoft/types.ts:84
Get the user path prefix for Microsoft Graph API requests.
Resolution order for app-permission flows:
actAs(lock set at tool instantiation) — ALWAYS wins, LLM can't overridetargetUser(LLM-supplied per-call argument)- throws if neither is provided
- App-permission flows (client_credentials, jwt_bearer, jwt): returns
/users/${effective} - Delegated flow (authorization_code): returns
/me(ignores targetUser AND actAs — the OAuth token already binds identity) - API key / other: returns
/me
export function getUserPathPrefix(
connector: Connector,
targetUser?: string,
actAs?: string,
): string
getVendorPresentation function
📍 src/capabilities/metadata/vendorPresentation.ts:20
Pure bounded lookup. Unknown IDs have no implicit vendor/auth fallback.
export function getVendorPresentation(id: string): VendorPresentation | undefined
hydrateAgentPackage function
📍 src/portable/AgentPackage.ts:211
Recreate an Agent from a portable package using trusted host connector and tool resolvers.
export async function hydrateAgentPackage(
packageValue: SerializedAgentPackage,
options: HydrateAgentPackageOptions,
): Promise<Agent>
hydrateAgentPackageWithOutcomes function
📍 src/portable/OutcomeClient.ts:250
export async function hydrateAgentPackageWithOutcomes(input: OutcomeAgentPackage, options: HydrateAgentPackageWithOutcomesOptions): Promise<OutcomeHydratedAgent>
identifierValuesEqual function
📍 src/memory/identifiers.ts:79
Compare two identifier values under their kind-specific normalization rule. Used by dedup comparators (does this entity already have an identifier matching the one we're about to add?) and by exact-match lookups.
export function identifierValuesEqual(
kindA: string,
valueA: string,
kindB: string,
valueB: string,
): boolean
isAppPermissionAuth function
📍 src/tools/microsoft/types.ts:45
Check whether a connector uses app-level (non-delegated) authentication.
App-level connectors access resources on behalf of the application, not a
specific signed-in user, so Microsoft Graph calls must use /users/{id}
instead of /me.
Detection logic:
authorization_code→ delegated (user signed in)client_credentials/jwt_bearer→ app-onlyjwtauth type → app-only- Missing flow or
api_key→ assume delegated (safest default)
export function isAppPermissionAuth(connector: Connector): boolean
isBlockedCommand function
📍 src/tools/shell/types.ts:116
Check if a command should be blocked
export function isBlockedCommand(
command: string,
config: ShellToolConfig = {}
): { blocked: boolean; reason?: string }
isExcludedExtension function
📍 src/tools/filesystem/types.ts:265
Check if a file extension should be excluded
export function isExcludedExtension(
filePath: string,
excludeExtensions: string[] = DEFAULT_FILESYSTEM_CONFIG.excludeExtensions
): boolean
isKnownService function
📍 src/domain/entities/Services.ts:631
Check if a service ID is known
export function isKnownService(serviceId: string): boolean
isMicrosoftFileUrl function
📍 src/tools/microsoft/types.ts:749
Check if a string looks like a OneDrive/SharePoint web URL.
Matches:
*.sharepoint.com/*onedrive.live.com/*1drv.ms/**.sharepoint-df.com/*(dogfood/test)
export function isMicrosoftFileUrl(source: string): boolean
isStoreHandler function
📍 src/core/context-nextgen/types.ts:612
Type guard to check if a plugin implements IStoreHandler.
export function isStoreHandler(plugin: IContextPluginNextGen): plugin is IContextPluginNextGen & IStoreHandler
isTeamsMeetingUrl function
📍 src/tools/microsoft/types.ts:342
Check if a meeting ID input is a Teams join URL.
Teams join URLs look like:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_...https://teams.live.com/l/meetup-join/...
IMPORTANT: A Teams join URL does NOT contain the Graph API meeting ID.
To resolve a URL to a meeting ID, use resolveMeetingId() which calls
GET /me/onlineMeetings?$filter=JoinWebUrl eq '{url}'.
export function isTeamsMeetingUrl(input: string): boolean
isWebUrl function
📍 src/tools/microsoft/types.ts:736
Check if a string looks like a web URL (http/https).
export function isWebUrl(source: string): boolean
killBackgroundProcess function
Kill a background process
export function killBackgroundProcess(bgId: string): boolean
levelGrants function
📍 src/memory/AccessControl.ts:243
Given an access level and a requested permission, does the level grant the
permission? 'write' implies 'read'.
export function levelGrants(level: AccessLevel, need: Permission): boolean
listConnectorsByServiceTypes function
📍 src/capabilities/shared/types.ts:192
List all available connectors for given service types Useful for tools that want to show what's available or support fallback chains
export function listConnectorsByServiceTypes(serviceTypes: string[]): string[]
looksLikeIsoDate function
📍 src/memory/dateCoercion.ts:53
Conservative ISO-string detection — returns true only for unambiguous date literals.
export function looksLikeIsoDate(value: unknown): value is string
materializePrincipals function
📍 src/access/principals.ts:101
Deterministically project an AccessInput into the two principal arrays.
Invariant: writePrincipals ⊆ readPrincipals (write implies read). Output
arrays are sorted so identical inputs yield byte-identical arrays (stable
diffs, idempotent backfills).
export function materializePrincipals(input: AccessInput): MaterializedPrincipals
maybeCoerceToDate function
📍 src/memory/dateCoercion.ts:62
Coerce a single value to Date if it's an unambiguous date string. Otherwise
returns the value unchanged. Date instances pass through. null /
undefined / non-date strings / numbers / objects are returned as-is.
export function maybeCoerceToDate(value: unknown): unknown
mergeFilters function
📍 src/memory/adapters/mongo/scopeFilter.ts:108
export function mergeFilters(...filters: Array<MongoFilter | null | undefined>): MongoFilter
mergeTextPieces function
📍 src/capabilities/documents/DocumentReader.ts:390
Merge text pieces into a single markdown string
export function mergeTextPieces(pieces: DocumentPiece[]): string
microsoftFetch function
📍 src/tools/microsoft/types.ts:217
Make an authenticated Microsoft Graph API request through the connector.
Adds standard headers and parses JSON response. Handles empty response bodies (e.g., sendMail returns 202 with no body). Throws MicrosoftAPIError on non-ok responses.
export async function microsoftFetch<T = unknown>(
connector: Connector,
endpoint: string,
options?: MicrosoftFetchOptions
): Promise<T>
mulawToPcm function
📍 src/capabilities/voice/adapters/twilio/codecs.ts:90
Decode μ-law audio buffer to PCM 16-bit signed little-endian.
export function mulawToPcm(mulaw: Buffer): Buffer
normalizeEmails function
📍 src/tools/google/types.ts:279
Normalize an email array from any format the LLM might send into plain strings. Same logic as Microsoft tools for consistency.
export function normalizeEmails(input: unknown[]): string[]
normalizeEmails function
📍 src/tools/microsoft/types.ts:292
Normalize an email array from any format the LLM might send into plain strings.
Accepts:
- Plain strings:
["alice@contoso.com"] - Graph recipient objects:
[{ emailAddress: { address: "alice@contoso.com" } }] - Graph attendee objects:
[{ emailAddress: { address: "alice@contoso.com", name: "Alice" }, type: "required" }] - Bare email objects:
[{ address: "alice@contoso.com" }]or[{ email: "alice@contoso.com" }]
Always returns string[] of email addresses.
export function normalizeEmails(input: unknown[]): string[]
normalizeIdentifierValue function
📍 src/memory/identifiers.ts:69
Apply the kind's case-normalization rule to a raw identifier value. This is the SINGLE source of truth used by both the storage write path (so all persisted values are normalized identically) and the lookup path (so query keys match the stored shape). Adding a new case-insensitive kind without updating this function is a bug — it'll write one shape and look up another.
export function normalizeIdentifierValue(kind: string, value: string): string
normalizePhoneNumber function
📍 src/tools/twilio/types.ts:176
Normalize a phone number to E.164 format. Ensures the number starts with '+'.
export function normalizePhoneNumber(phone: string): string
normalizeSurface function
📍 src/memory/resolution/fuzzy.ts:22
Normalize a surface form for comparison:
- lowercase
- strip non-alphanumeric except whitespace (apostrophes, commas, dashes, etc.)
- strip common corporate suffixes (Inc, Corp, LLC, etc.)
- collapse whitespace
- trim
export function normalizeSurface(s: string): string
orderByToSort function
📍 src/memory/adapters/mongo/queries.ts:108
export function orderByToSort(orderBy?: FactOrderBy): MongoSort | undefined
parseExtractionResponse function
📍 src/memory/integration/parseExtraction.ts:318
Resilient to code fences + leading/trailing prose. Returns an empty shape rather than throwing so ingest pipelines can continue.
Prefer parseExtractionWithStatus for new code — this wrapper cannot
distinguish "no extractable content" from "parse failure".
export function parseExtractionResponse(raw: string): ExtractionOutput
parseExtractionWithStatus function
📍 src/memory/integration/parseExtraction.ts:76
Rich parser. Never throws — failures surface as non-ok status.
status: 'parse_error'— input didn't contain any valid JSON object.status: 'shape_error'— JSON parsed, butmentionswas not an object (e.g. LLM emitted an array) orfactswas not an array. Whichever fields did match the expected shape are still returned; the other is filled with the empty default so the caller can partial-commit if it wants to.status: 'ok'— parse succeeded;mentions+factsmay still be empty if the LLM genuinely had nothing to extract.
export function parseExtractionWithStatus(raw: string): ParseExtractionResult
parseKeyCombo function
📍 src/tools/desktop/driver/NutTreeDriver.ts:89
Parse a key combo string like "ctrl+c", "cmd+shift+s", "enter" Returns nut-tree Key enum values.
export function parseKeyCombo(keys: string, KeyEnum: Record<string, any>): any[]
parsePrincipal function
Split a token into kind + id. An unrecognized prefix parses as
kind: 'unknown' — NEVER world. world is the BROADEST read token, so
silently mapping a malformed or future-prefixed token to it would treat it
as public; a host validating tokens via this helper must be able to tell
"unknown/invalid" apart from "public". Does not throw (forward-compatible
with tokens a newer host might write).
export function parsePrincipal(p: Principal): ParsedPrincipal
parseProfileResponse function
📍 src/memory/integration/ConnectorProfileGenerator.ts:102
export function parseProfileResponse(
raw: string,
entity: IEntity,
priorProfile: IFact | undefined,
): { details: string; summaryForEmbedding: string }
parseReconciliationOpsWithStatus function
📍 src/memory/integration/parseExtraction.ts:343
Parser for entity-reconciliation prompt output. The reconciliation prompt
(entityReconciliationPrompt) returns ONLY {"operations": [...]} — no
mentions, no facts. Using parseExtractionWithStatus here trips a
spurious mentions is not an object shape_error on every call.
status: 'parse_error'— input wasn't valid JSON.status: 'shape_error'— JSON parsed butoperationswasn't an array.status: 'ok'—operationsparsed; may be empty (silence is valid).
export function parseReconciliationOpsWithStatus(raw: string): ParseReconciliationOpsResult
parseRepository function
📍 src/tools/github/types.ts:31
Parse a repository string into owner and repo.
Accepts:
- "owner/repo" format
- Full GitHub URLs: "https://github.com/owner/repo", "https://github.com/owner/repo/..."
export function parseRepository(input: string): GitHubRepository
parseSignalReconciliationOpsWithStatus function
📍 src/memory/integration/parseExtraction.ts:404
Parser for the signal-reconciliation pass (signalReconciliationPrompt). The
pass returns ONLY {"operations": [...]} — no mentions, no facts — but
the ops may be fact ops (archive/update/create) AND task_update ops.
status: 'parse_error'— input wasn't valid JSON.status: 'shape_error'— JSON parsed butoperationswasn't an array.status: 'ok'—operationsparsed; may be empty (silence is valid).
export function parseSignalReconciliationOpsWithStatus(
raw: string,
): ParseSignalReconciliationOpsResult
parseSkepticOutput function
📍 src/memory/integration/SkepticPass.ts:346
export function parseSkepticOutput(
raw: string,
_itemCount: number,
): SkepticParseOk | SkepticParseErr
parseStructuredOutput function
📍 src/core/StructuredOutput.ts:226
Parse an LLM response into a JSON value, reusing the library's permissive repair strategies (markdown-fence stripping, trailing commas, etc.). Never throws — returns a discriminated result.
Validates parseability only, not schema conformance (see the module-level
validation contract). _format is accepted for symmetry / future use but is
intentionally not consulted.
export function parseStructuredOutput(rawText: string, _format: ResponseFormat): StructuredParseResult
patchTouchesAccessFields function
📍 src/access/principals.ts:249
Does a partial-record patch touch any field that feeds principal
materialization (acl, permissions, ownerId, groupId)? Adapters call
this on updateFact/updateEntity patches to decide whether the
materialized arrays must be recomputed (keeps the "recomputed on every write"
invariant true even for direct partial updates).
export function patchTouchesAccessFields(patch: object): boolean
pcmToMulaw function
📍 src/capabilities/voice/adapters/twilio/codecs.ts:106
Encode PCM 16-bit signed little-endian to μ-law.
export function pcmToMulaw(pcm: Buffer): Buffer
principalsForLibraryRecord function
📍 src/access/principals.ts:201
Convenience used at the storage boundary: compute the principal arrays for a
library record (entity or fact) from its permissions + owner/group + acl.
export function principalsForLibraryRecord(rec: {
ownerId?: string;
groupId?: string;
permissions?: { group?: 'none' | 'read' | 'write'; world?: 'none' | 'read' | 'write' };
acl?: ACLEntry[];
}): MaterializedPrincipals
rankFacts function
export function rankFacts(facts: IFact[], config: RankingConfig, now: Date): IFact[]
readFilterForPrincipals function
📍 src/access/principals.ts:214
Mongo read filter for a caller's principal set.
export function readFilterForPrincipals(principals: string[]): {
readPrincipals: { $in: string[] };
}
recaseIdentifierValues function
📍 src/memory/identifierMigration.ts:86
Walk entities under scope whose identifiers include kind, ask the caller
to recover the original-case value for each, and write back. Idempotent
(re-running a completed migration is a no-op because already-correct values
make recover return the same value as stored).
The migration uses the adapter's findEntitiesByIdentifier to list candidates
efficiently. For each entity, every identifier with the given kind is
processed independently — a single entity can carry multiple identifiers of
the same kind (e.g. a Person with multiple emails) and the migration touches
each one.
export async function recaseIdentifierValues(
store: IMemoryStore,
options: RecaseIdentifierOptions,
): Promise<RecaseIdentifierResult>
registerScrapeProvider function
📍 src/capabilities/scrape/ScrapeProvider.ts:160
Register a scrape provider for a service type Called by provider implementations to register themselves
export function registerScrapeProvider(
serviceType: string,
providerClass: ProviderConstructor
): void
registerSuite function
📍 src/testing/integration/runner.ts:25
Register a test suite. Called by each suite module.
export function registerSuite(suite: IntegrationTestSuite): void
resamplePcm function
📍 src/capabilities/voice/adapters/twilio/codecs.ts:128
Resample PCM 16-bit audio. Downsampling uses box filter (averaging) for anti-aliasing. Upsampling uses linear interpolation.
export function resamplePcm(pcm: Buffer, fromRate: number, toRate: number): Buffer
resetDefaultDriver function
📍 src/tools/desktop/getDriver.ts:42
Reset the default driver (for testing).
export function resetDefaultDriver(): void
resolveConnector function
📍 src/capabilities/shared/types.ts:128
Resolve connector from config (name or instance) Shared logic for all provider factories
export function resolveConnector(connectorOrName: string | Connector): Connector
resolveDeepSeekHost function
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:153
export function resolveDeepSeekHost(options: ResolveDeepSeekHostOptions = {}): ResolvedDeepSeekHost
resolveEagerness function
📍 src/memory/integration/EagernessProfile.ts:124
Resolve the effective profile for a given stage.
Resolution order: profile.perStage[stage] → profile (top-level) →
getEagernessPreset(profile.preset) (canonical preset).
Returns a NEW object — never aliases the inputs. The returned profile's
perStage field is omitted (resolution is one-way; downstream code should
not re-resolve).
export function resolveEagerness(
profile: EagernessProfile,
stage: EagernessStage,
): EagernessProfile
resolveFileEndpoints function
📍 src/tools/microsoft/types.ts:791
Build the Graph API endpoint and metadata endpoint for a file source.
Handles three input types:
- Web URL (SharePoint/OneDrive link) → uses
/shares/{token}/driveItem - Path (starts with
/) → uses/drive/root:{path}: - Item ID → uses
/drive/items/{id}
export function resolveFileEndpoints(
source: string,
drivePrefix: string
): { metadataEndpoint: string; contentEndpoint: string; isSharedUrl: boolean }
resolveFlowSource function
📍 src/core/routineControlFlow.ts:548
Resolve the source array for a map/fold control flow using layered resolution:
- Determine lookup key(s) from source config
- Read from ICM/WM with fallback chain
- Apply JSON path extraction if specified
- Coerce to array algorithmically (JSON parse, common field names)
- LLM extraction fallback if still not an array
export async function resolveFlowSource(
flow: { source: ControlFlowSource; maxIterations?: number },
flowType: string,
agent: Agent,
execution: RoutineExecution | undefined,
icmPlugin: InContextMemoryPluginNextGen | null,
wmPlugin: WorkingMemoryPluginNextGen | null
): Promise<{ array: unknown[]; maxIter: number } | ControlFlowResult>
resolveMaxContextTokens function
📍 src/infrastructure/providers/base/ModelCapabilityResolver.ts:56
Resolve the max context token limit for a specific model. Used primarily for accurate error messages.
export function resolveMaxContextTokens(
model: string | undefined,
fallback: number
): number
resolveMeetingId function
📍 src/tools/microsoft/types.ts:368
Resolve a meeting input (ID or Teams URL) to a Graph API online meeting ID.
- Raw meeting IDs are passed through as-is
- Teams join URLs are resolved via
GET /me/onlineMeetings?$filter=JoinWebUrl eq '{url}'
export async function resolveMeetingId(
connector: Connector,
input: string,
prefix: string,
effectiveUserId?: string,
effectiveAccountId?: string
): Promise<{ meetingId: string; subject?: string }>
resolveRepository function
📍 src/tools/github/types.ts:71
Resolve a repository from tool args or connector default.
Priority:
- Explicit
repositoryparameter connector.getOptions().defaultRepository
export function resolveRepository(
repository: string | undefined,
connector: Connector
): { success: true; repo: GitHubRepository } | { success: false; error: string }
resolveStepArgs function
📍 src/core/routineControlFlow.ts:173
Resolve template placeholders in deterministic step arguments (deep).
Walks the argument object recursively. For string values, resolves:
- {{param.NAME}} — from inputs
- {{result.TASK_ID_OR_NAME}} — from task outputs (post-steps); accepts
either the task's canonical
idor itsname(both are indexed intaskResults, lookup is a literal key match) - {{step.STEP_NAME}} — from prior step results
Non-string values pass through unchanged. Unresolved templates are left as-is.
export function resolveStepArgs(
args: Record<string, unknown>,
context: StepResolveContext
): Record<string, unknown>
resolveTemplates function
📍 src/core/routineControlFlow.ts:56
Resolve template placeholders in text.
Supported namespaces:
- {{param.name}} → inputs[name]
- {{map.item}} / {{map.index}} / {{map.total}} → ICM keys
- {{fold.accumulator}} → ICM key
Non-string values are JSON.stringify'd. Unresolved templates are left as-is.
export function resolveTemplates(
text: string,
inputs: Record<string, unknown>,
icmPlugin: InContextMemoryPluginNextGen | null
): string
rewriteAclPrincipalReferences function
📍 src/access/principals.ts:279
Rewrite entity:<from> → entity:<to> across an acl[], merging actions
when the target principal is already granted. Returns the SAME reference when
from is absent.
export function rewriteAclPrincipalReferences(
acl: ACLEntry[] | undefined,
fromEntityId: string,
toEntityId: string,
): ACLEntry[] | undefined
rewritePrincipalReferences function
📍 src/access/principals.ts:260
Rewrite entity:<from> → entity:<to> in a principal array, dedup, drop
nothing else. Returns the SAME array reference when from is absent (cheap
no-op for the common case). Used by entity-merge identity convergence.
export function rewritePrincipalReferences(
arr: string[] | undefined,
fromEntityId: string,
toEntityId: string,
): string[] | undefined
scopeToFilter function
📍 src/memory/adapters/mongo/scopeFilter.ts:51
export function scopeToFilter(
scope: ScopeFilter,
opts: ScopeToFilterOptions = {},
): MongoFilter
scoreEntityPair function
Score a pair of entities for likely duplication. Hard-zero rules short-circuit the weighted sum and yield action='skip' with score=0. Identifier exact match short-circuits to action='auto-merge' with score=1.0.
Pass factsA/factsB (caller's choice — atomic-only for performance) to
enable the contextIds-overlap and same-signal-boost signals; omit for a
cheaper structural-only score.
export function scoreEntityPair(
inputs: { a: IEntity; b: IEntity; factsA?: IFact[]; factsB?: IFact[] },
thresholds?: ScoreThresholds,
): DedupDecision
scoreFact function
Score formula: confidence × recency × predicateWeight × importanceMultiplier
importanceMultiplier = 0.3 + importance × 1.4 → importance 0.5 (default) → 1.0 (no-op, back-compat with v1 data) → importance 1.0 → 1.7× (identity-level facts) → importance 0.0 → 0.3× (trivial observations)
export function scoreFact(fact: IFact, config: RankingConfig, now: Date): number
setMediaStorage function
📍 src/tools/multimedia/config.ts:32
Set a custom global media storage
Call this before agent creation to use custom storage (S3, GCS, etc.)
export function setMediaStorage(storage: IMediaStorage): void
signalReconciliationPrompt function
📍 src/memory/integration/signalReconciliationPrompt.ts:78
export function signalReconciliationPrompt(ctx: SignalReconciliationPromptContext): string
slackFetch function
Make an authenticated Slack Web API request through the connector.
Handles Slack's unique response format where HTTP 200 can still indicate failure
via the ok field. Throws SlackAPIError on ok: false.
export async function slackFetch<T extends SlackBaseResponse = SlackBaseResponse>(
connector: Connector,
method: string,
options?: SlackFetchOptions
): Promise<T>
slackPaginate function
📍 src/tools/slack/types.ts:179
Collect paginated results from a Slack API method.
Slack uses cursor-based pagination. This helper calls the method repeatedly until there are no more pages or maxPages is reached.
export async function slackPaginate<TResponse extends SlackBaseResponse, TItem>(
connector: Connector,
method: string,
params: Record<string, unknown>,
extractItems: (response: TResponse) => TItem[],
options?: {
maxPages?: number;
limit?: number;
userId?: string;
accountId?: string;
}
): Promise<{ items: TItem[]; hasMore: boolean }>
slugify function
📍 src/memory/identifiers.ts:99
Deterministic URL-safe slug. Lowercase, ASCII alphanumerics + dashes, no leading/trailing dashes, collapsed dash runs. Stable across calls for the same input — that's the whole point.
export function slugify(text: string, opts: SlugifyOptions = {}): string
sttToTwilio function
📍 src/capabilities/voice/adapters/twilio/codecs.ts:188
Convert PCM 16-bit audio to Twilio μ-law 8kHz format.
export function sttToTwilio(pcm: Buffer, sourceRate: number = 24000): Buffer
sweepDuplicates function
Async iterator yielding DedupDecisions across the scope. Wraps
findDuplicateClusters + scoreEntityPair. Caller routes each yielded
decision (auto-merge / queue / skip) per their policy.
The sweeper deliberately does NOT call mergeEntities — separation of
concerns. v25's dedup engine consumes decisions; this library produces them.
Decisions are yielded largest-cluster first, and within a cluster highest-score first — so hosts processing the stream see the most impactful merges first and can stop early.
export async function* sweepDuplicates(
memory: MemorySystem,
scope: ScopeFilter,
opts: SweepOptions = {},
): AsyncIterable<DedupDecision>
telegramFetch function
📍 src/tools/telegram/types.ts:117
Make an authenticated Telegram Bot API request.
Builds the URL as: /bot/ All calls are POST with JSON body (Telegram supports both GET and POST, but POST with JSON is the most flexible and consistent).
Token resolution: Uses connector.getToken(userId, accountId) which supports both api_key connectors (returns static bot token) and OAuth connectors (returns account-specific token). Backward compatible — api_key connectors ignore userId/accountId.
export async function telegramFetch<T = unknown>(
connector: Connector,
method: string,
options?: TelegramFetchOptions
): Promise<T>
toConnectorOptions function
📍 src/capabilities/shared/types.ts:80
Convert ExtendedFetchOptions to standard ConnectorFetchOptions Handles body stringification and query param building
export function toConnectorOptions(options: ExtendedFetchOptions): ConnectorFetchOptions
toDate function
📍 src/memory/dateCoercion.ts:83
Strict variant of maybeCoerceToDate for callers that want a Date | undefined
back. Returns:
- the same
Dateif input is aDate - a parsed
Dateif input is an ISO-shaped string AND parses to a valid moment - a parsed
Dateif input is a finite number (treated as epoch ms) undefinedotherwise
Use at write boundaries inside the library AND in app code that bridges signal payloads (where calendar/email adapters may legitimately ship Date OR ISO string) into typed domain fields.
export function toDate(value: unknown): Date | undefined
toDate function
📍 src/memory/integration/ExtractionResolver.ts:1151
function toDate(v: string | Date | undefined): Date | undefined
toDate function
📍 src/memory/adapters/mongo/MongoMemoryAdapter.ts:1479
function toDate(v: unknown): Date
toSlackTimestamp function
📍 src/tools/slack/types.ts:147
Convert an ISO 8601 date string to a Slack timestamp (Unix epoch string).
Slack uses Unix epoch seconds as strings (e.g., "1234567890.000000"). Accepts ISO 8601 strings or Unix epoch numbers/strings.
export function toSlackTimestamp(input: string): string
toWhatsAppNumber function
📍 src/tools/twilio/types.ts:187
Add the WhatsApp prefix to a phone number. If already prefixed, returns as-is.
export function toWhatsAppNumber(phone: string): string
twilioFetch function
📍 src/tools/twilio/types.ts:108
Make an authenticated Twilio API request through the connector.
Automatically resolves the Account SID and builds the correct URL path. Twilio endpoints follow: /Accounts/{AccountSid}/{resource}.json
export async function twilioFetch<T = unknown>(
connector: Connector,
resource: string,
options?: TwilioFetchOptions
): Promise<T>
twilioToStt function
📍 src/capabilities/voice/adapters/twilio/codecs.ts:180
Convert Twilio μ-law 8kHz audio to PCM 16-bit at target sample rate.
export function twilioToStt(mulaw: Buffer, targetRate: number = 16000): Buffer
validatePath function
📍 src/tools/filesystem/types.ts:177
Validate and resolve a path within allowed boundaries
export function validatePath(
inputPath: string,
config: FilesystemToolConfig = {}
): { valid: boolean; resolvedPath: string; error?: string }
validatePath function
📍 src/tools/json/pathUtils.ts:177
Validate path format
export function validatePath(path: string): boolean
writeFilterForPrincipals function
📍 src/access/principals.ts:221
Mongo write filter for a caller's principal set.
export function writeFilterForPrincipals(principals: string[]): {
writePrincipals: { $in: string[] };
}
clusterContentComposer const
📍 src/memory/composers/defaults.ts:374
Composer for cluster entities — type-specific anchor metadata. Embeds
name + aliases + anchor entity displayNames + first/last-seen timestamps.
DEEPSEEK_HOST_REGISTRY const
📍 src/infrastructure/providers/deepseek/DeepSeekHostRegistry.ts:41
Provider presets intentionally describe only bearer-token, OpenAI-compatible endpoints. Bedrock and Vertex require their own signed/authenticated transports and are not represented as misleading URL aliases here.
Properties
| Property | Type | Description |
|---|---|---|
official |
`{ |
id: 'official',
displayName: 'DeepSeek Platform',
baseURL: 'https://api.deepseek.com/v1',
defaultTransport: 'responses',
promptCaching: { mode: 'implicit', reportsCacheUsage: true },
modelIds: { [FLASH]: FLASH, [PRO]: PRO, [FLASH_VISION_EXP]: FLASH_VISION_EXP },
documentation: 'https://api-docs.deepseek.com/',
}| - | |openrouter|{
id: 'openrouter',
displayName: 'OpenRouter',
baseURL: 'https://openrouter.ai/api/v1',
defaultTransport: 'chat_completions',
promptCaching: { mode: 'implicit', reportsCacheUsage: true },
modelIds: {
[FLASH]: 'deepseek/deepseek-v4-flash',
[PRO]: 'deepseek/deepseek-v4-pro',
},
documentation: 'https://openrouter.ai/deepseek',
}| - | |together|{
id: 'together',
displayName: 'Together AI',
baseURL: 'https://api.together.xyz/v1',
defaultTransport: 'chat_completions',
promptCaching: { mode: 'implicit', reportsCacheUsage: true },
modelIds: { [PRO]: 'deepseek-ai/DeepSeek-V4-Pro' },
modelLimits: { [PRO]: { inputTokens: 512_000 } },
documentation: 'https://docs.together.ai/docs/deepseek-v4-quickstart',
}| - | |fireworks|{
id: 'fireworks',
displayName: 'Fireworks AI',
baseURL: 'https://api.fireworks.ai/inference/v1',
defaultTransport: 'chat_completions',
promptCaching: { mode: 'implicit', reportsCacheUsage: true },
modelIds: {
[FLASH]: 'accounts/fireworks/models/deepseek-v4-flash',
[PRO]: 'accounts/fireworks/models/deepseek-v4-pro',
},
modelLimits: {
[FLASH]: { inputTokens: 1_048_576 },
[PRO]: { inputTokens: 1_048_576 },
},
documentation: 'https://fireworks.ai/models',
}| - | |deepinfra|{
id: 'deepinfra',
displayName: 'DeepInfra',
baseURL: 'https://api.deepinfra.com/v1/openai',
defaultTransport: 'chat_completions',
promptCaching: { mode: 'implicit', reportsCacheUsage: true },
modelIds: {
[FLASH]: 'deepseek-ai/DeepSeek-V4-Flash',
[PRO]: 'deepseek-ai/DeepSeek-V4-Pro',
},
modelLimits: {
[FLASH]: { inputTokens: 1_024_000 },
[PRO]: { inputTokens: 1_024_000 },
},
documentation: 'https://docs.deepinfra.com/api-reference/introduction',
}| - | |'nvidia-nim'|{
id: 'nvidia-nim',
displayName: 'NVIDIA NIM',
baseURL: 'https://integrate.api.nvidia.com/v1',
defaultTransport: 'chat_completions',
promptCaching: { mode: 'unsupported', reportsCacheUsage: false },
modelIds: {
[FLASH]: 'deepseek-ai/deepseek-v4-flash',
[PRO]: 'deepseek-ai/deepseek-v4-pro',
},
modelLimits: {
[FLASH]: { outputTokens: 16_384 },
[PRO]: { outputTokens: 16_384 },
},
documentation: 'https://docs.api.nvidia.com/nim/reference/llm-apis',
}| - | |'azure-foundry'|{
id: 'azure-foundry',
displayName: 'Azure AI Foundry',
requiresBaseURL: true,
defaultTransport: 'chat_completions',
promptCaching: { mode: 'unsupported', reportsCacheUsage: false },
modelIds: {},
documentation: 'https://learn.microsoft.com/azure/foundry/foundry-models/concepts/endpoints',
}| - | |custom|{
id: 'custom',
displayName: 'Custom OpenAI-compatible DeepSeek host',
requiresBaseURL: true,
defaultTransport: 'chat_completions',
promptCaching: { mode: 'unsupported', reportsCacheUsage: false },
modelIds: {},
documentation: 'https://api-docs.deepseek.com/',
}` | - |
DEFAULT_CONFIG const
📍 src/core/context-nextgen/types.ts:986
Default configuration values
Properties
| Property | Type | Description |
|---|---|---|
responseReserve |
4096 |
- |
strategy |
'algorithmic' |
- |
criticalCompactionThreshold |
0.9 |
- |
DEFAULT_CONFIG const
📍 src/core/context-nextgen/plugins/InContextMemoryPluginNextGen.ts:66
Properties
| Property | Type | Description |
|---|---|---|
maxEntries |
20 |
- |
maxTotalTokens |
40000 |
- |
defaultPriority |
'normal' as InContextPriority |
- |
showTimestamps |
false |
- |
DEFAULT_CONFIG const
📍 src/core/context-nextgen/plugins/SharedWorkspacePluginNextGen.ts:76
Properties
| Property | Type | Description |
|---|---|---|
maxEntries |
50 |
- |
maxTotalTokens |
8000 |
- |
maxLogEntries |
100 |
- |
DEFAULT_DESKTOP_CONFIG const
📍 src/tools/desktop/types.ts:113
Properties
| Property | Type | Description |
|---|---|---|
driver |
null as unknown as IDesktopDriver |
- |
humanDelay |
[50, 150] |
- |
humanizeMovement |
false |
- |
DEFAULT_FEATURES const
📍 src/core/context-nextgen/types.ts:821
Default feature configuration for built-in plugins.
Properties
| Property | Type | Description |
|---|---|---|
taskState |
false |
- |
workingMemory |
true |
- |
inContextMemory |
true |
- |
persistentInstructions |
false |
- |
userInfo |
false |
- |
toolCatalog |
false |
- |
sharedWorkspace |
false |
- |
memory |
false |
- |
memoryWrite |
false |
- |
DEFAULT_FILESYSTEM_CONFIG const
📍 src/tools/filesystem/types.ts:73
Properties
| Property | Type | Description |
|---|---|---|
workingDirectory |
process.cwd() |
- |
allowedDirectories |
[] |
- |
blockedDirectories |
['node_modules', '.git', '.svn', '.hg', '__pycache__', '.cache'] |
- |
maxFileSize |
10 * 1024 * 1024 |
- |
maxResults |
1000 |
- |
followSymlinks |
false |
- |
excludeExtensions |
`[ |
'.exe', '.dll', '.so', '.dylib', '.bin', '.obj', '.o', '.a',
'.zip', '.tar', '.gz', '.bz2', '.7z', '.rar',
'.png', '.jpg', '.jpeg', '.gif', '.bmp', '.ico', '.svg', '.webp',
'.mp3', '.mp4', '.wav', '.avi', '.mov', '.mkv',
// Note: .pdf, .docx, .xlsx, .pptx are NOT excluded — DocumentReader handles them
'.doc', '.xls', '.ppt', // Legacy Office formats not yet supported
'.woff', '.woff2', '.ttf', '.eot', '.otf',
]` | - |
DEFAULT_PERMISSION_CONFIG const
📍 src/core/permissions/types.ts:318
Default permission config applied when no config is specified
Properties
| Property | Type | Description |
|---|---|---|
scope |
'once' |
- |
riskLevel |
'low' |
- |
DEFAULT_SHELL_CONFIG const
Default configuration
Properties
| Property | Type | Description |
|---|---|---|
workingDirectory |
process.cwd() |
- |
defaultTimeout |
120000 |
- |
maxTimeout |
600000 |
- |
shell |
process.platform === 'win32' ? 'cmd.exe' : '/bin/bash' |
- |
env |
{} |
- |
blockedCommands |
`[ |
'rm -rf /',
'rm -rf /*',
'rm -rf ~',
'rm -rf ~/*',
'mkfs',
'dd if=/dev/zero',
':(){:|:&};:', // Fork bomb
]| - | |blockedPatterns|[
/rm\s+(-rf?|--recursive)\s+/(?!\S)/i, // rm -rf / variations
/>\s*/dev/sd[a-z]/i, // Writing to disk devices
/mkfs/i,
/dd\s+.*of=/dev//i, // dd to devices
]| - | |maxOutputSize|10_000_000| - | |allowBackground|true` | - |
DEFAULT_WEIGHTS const
Properties
| Property | Type | Description |
|---|---|---|
displayNameNormalizedEqual |
0.55 |
- |
aliasOverlap |
0.3 |
- |
embeddingCosine |
0.3 |
- |
tokenSetJaccard |
0.2 |
- |
contextIdsOverlap |
0.15 |
- |
sameSignalBoost |
0.1 |
- |
defaultFactContentComposer const
📍 src/memory/composers/defaults.ts:431
Default fact composer. Composes:
- atomic facts →
"<subject.displayName> <predicate> <object.displayName | value>"plus details/summary lines when present. Replaces the legacy 80-char threshold gate — every atomic fact gets a meaningful surface form once subject/object are resolved. - document facts → details (or summaryForEmbedding) verbatim, matching
the legacy embedding text for backwards compatibility with existing
semanticSearchFactsconsumers.
Returns '' only when:
- The fact's subject can't be resolved AND no details exist (truly empty).
- A document-kind fact has neither details nor summaryForEmbedding.
documentContentComposer const
📍 src/memory/composers/defaults.ts:358
Composer for document entities. Preserves the legacy document embedding
shape: title\n\n(summary OR body[:limit]). Body is truncated at
DEFAULT_EMBED_SOURCE_CHAR_LIMIT to fit the embedder's context window —
this is a necessary trade-off (embedder input has a fixed token limit) and
NOT a lossy transformation of stored data. Pass a metadata.summary for
long documents to get a richer embedding.
EAGERNESS_PRESETS const
📍 src/memory/integration/EagernessProfile.ts:70
Canonical preset table. chatty is the no-restraint baseline (matches the
library's pre-EagernessProfile behavior). strict is the recommended ICOS
default. minimal is the strongest discipline — for pre-launch tuning or
very high-bar exec deployments.
Properties
| Property | Type | Description |
|---|---|---|
chatty |
`{ |
preset: 'chatty',
requireEvidenceQuote: 'off',
requireJustification: false,
requirePriorityBinding: 'off',
skepticPass: 'off',
negativeExamplesCount: 0,
}| - | |balanced|{
preset: 'balanced',
requireEvidenceQuote: 'soft',
requireJustification: true,
requirePriorityBinding: 'soft',
skepticPass: 'cheap',
negativeExamplesCount: 2,
}| - | |strict|{
preset: 'strict',
requireEvidenceQuote: 'strict',
requireJustification: true,
requirePriorityBinding: 'strict',
skepticPass: 'cheap',
negativeExamplesCount: 3,
}| - | |minimal|{
preset: 'minimal',
requireEvidenceQuote: 'strict',
requireJustification: true,
requirePriorityBinding: 'strict',
skepticPass: 'strong',
negativeExamplesCount: 5,
}` | - |
eventContentComposer const
📍 src/memory/composers/defaults.ts:194
Composer for event entities (calendar events, meetings). Embeds time
window, location, kind, attendee displayNames, and contextIds so a query
like "weekly Q3 planning sync with Alice and Bob next Tuesday" matches the
right calendar event.
organizationContentComposer const
📍 src/memory/composers/defaults.ts:271
Composer for organization entities. Embeds name, aliases, domain
(extracted from identifiers), industry, description, and identifiers.
personContentComposer const
📍 src/memory/composers/defaults.ts:243
Composer for person entities. Embeds name + aliases + role/title + org
(if metadata.organizationId resolves) + bio + identifiers (email,
slack_id, github, ...) so a query like "the senior engineer at Acme who
works on payments" can match. Note: relationships to other entities
expressed as facts (e.g. (Sarah, works_at, Acme)) are NOT auto-included
here — fact embeddings cover that. Composer only sees the entity itself.
projectContentComposer const
📍 src/memory/composers/defaults.ts:328
Composer for project entities. Embeds name, aliases, status, description,
and stakeholder displayNames.
simpleTokenEstimator const
📍 src/core/context-nextgen/BasePluginNextGen.ts:31
Simple token estimator used by plugins.
Uses character-based approximation (~3.5 chars/token) which is
accurate enough for budget management purposes. For precise
tokenization, you can provide a custom estimator via the
estimator protected property.
taskContentComposer const
📍 src/memory/composers/defaults.ts:147
Composer for task entities. Embeds the full operational surface — state,
due date, priority, assignee/reporter/project displayNames, contextIds,
narrative description — so semantic queries like "urgent backend work due
this week assigned to Bob" match the right task even when 50 tasks share
the same generic title (e.g. "Follow up").
topicContentComposer const
📍 src/memory/composers/defaults.ts:301
Composer for topic entities — free-form topical anchors. Embeds name,
aliases, narrative, and parent contextIds.