import type { BackgroundTask } from '../../background-tasks/types.js'; import type { StorageThreadType } from '../../memory/types.js'; import type { StorageAgentType, StorageMCPClientType, StorageMCPServerType, StorageMessageType, StoragePromptBlockType, StorageResourceType, StorageScorerDefinitionType, StorageFavoriteType, StorageWorkspaceType, StorageSkillType, StorageToolProviderConnection, StorageWorkflowRun, ObservationalMemoryRecord, DatasetRecord, DatasetItemRow, DatasetVersion, Experiment, ExperimentResult } from '../types.js'; import type { AgentVersion } from './agents/index.js'; import type { MCPClientVersion } from './mcp-clients/index.js'; import type { MCPServerVersion } from './mcp-servers/index.js'; import type { TraceEntry } from './observability/index.js'; import type { FeedbackRecord } from './observability/feedback.js'; import type { LogRecord } from './observability/logs.js'; import type { MetricRecord } from './observability/metrics.js'; import type { ScoreRecord } from './observability/scores.js'; import type { PromptBlockVersion } from './prompt-blocks/index.js'; import type { Schedule, ScheduleTrigger } from './schedules/base.js'; import type { ScorerDefinitionVersion } from './scorer-definitions/index.js'; import type { SkillVersion } from './skills/index.js'; import type { WorkspaceVersion } from './workspaces/index.js'; /** * InMemoryDB is a thin database layer for in-memory storage. * It holds all the Maps that store data, similar to how a real database * connection (pg-promise client, libsql client) is shared across domains. * * Each domain receives a reference to this db and operates on the relevant Maps. */ export declare class InMemoryDB { readonly threads: Map; readonly messages: Map; readonly resources: Map; readonly workflows: Map; readonly scores: Map; source: "LIVE" | "TEST"; entity: Record; input?: unknown; additionalContext?: Record | undefined; requestContext?: Record | undefined; extractStepResult?: Record | undefined; extractPrompt?: string | undefined; analyzeStepResult?: Record | undefined; analyzePrompt?: string | undefined; reason?: string | undefined; reasonPrompt?: string | undefined; metadata?: Record | undefined; entityType?: string | undefined; structuredOutput?: boolean | undefined; traceId?: string | undefined; spanId?: string | undefined; resourceId?: string | undefined; threadId?: string | undefined; preprocessStepResult?: Record | undefined; preprocessPrompt?: string | undefined; generateScorePrompt?: string | undefined; generateReasonPrompt?: string | undefined; }>; readonly traces: Map; readonly metricRecords: MetricRecord[]; readonly logRecords: LogRecord[]; readonly scoreRecords: ScoreRecord[]; readonly feedbackRecords: FeedbackRecord[]; observabilityNextCursorId: number; readonly traceCursorIds: Map; readonly branchCursorIds: Map; readonly metricCursorIds: Map<{ labels: Record; timestamp: Date; name: string; value: number; source?: string | null | undefined; provider?: string | null | undefined; model?: string | null | undefined; estimatedCost?: number | null | undefined; costUnit?: string | null | undefined; costMetadata?: Record | null | undefined; metadata?: Record | null | undefined; executionSource?: string | null | undefined; tags?: string[] | null | undefined; entityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; entityId?: string | null | undefined; entityName?: string | null | undefined; parentEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; parentEntityId?: string | null | undefined; parentEntityName?: string | null | undefined; rootEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; rootEntityId?: string | null | undefined; rootEntityName?: string | null | undefined; userId?: string | null | undefined; organizationId?: string | null | undefined; resourceId?: string | null | undefined; runId?: string | null | undefined; sessionId?: string | null | undefined; threadId?: string | null | undefined; requestId?: string | null | undefined; environment?: string | null | undefined; serviceName?: string | null | undefined; scope?: Record | null | undefined; entityVersionId?: string | null | undefined; parentEntityVersionId?: string | null | undefined; rootEntityVersionId?: string | null | undefined; experimentId?: string | null | undefined; metricId?: string | null | undefined; traceId?: string | null | undefined; spanId?: string | null | undefined; }, number>; readonly logCursorIds: Map<{ timestamp: Date; level: "debug" | "info" | "warn" | "error" | "fatal"; message: string; source?: string | null | undefined; metadata?: Record | null | undefined; executionSource?: string | null | undefined; tags?: string[] | null | undefined; entityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; entityId?: string | null | undefined; entityName?: string | null | undefined; parentEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; parentEntityId?: string | null | undefined; parentEntityName?: string | null | undefined; rootEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; rootEntityId?: string | null | undefined; rootEntityName?: string | null | undefined; userId?: string | null | undefined; organizationId?: string | null | undefined; resourceId?: string | null | undefined; runId?: string | null | undefined; sessionId?: string | null | undefined; threadId?: string | null | undefined; requestId?: string | null | undefined; environment?: string | null | undefined; serviceName?: string | null | undefined; scope?: Record | null | undefined; entityVersionId?: string | null | undefined; parentEntityVersionId?: string | null | undefined; rootEntityVersionId?: string | null | undefined; experimentId?: string | null | undefined; logId?: string | null | undefined; data?: Record | null | undefined; traceId?: string | null | undefined; spanId?: string | null | undefined; }, number>; readonly scoreCursorIds: Map<{ timestamp: Date; scorerId: string; score: number; scoreTraceId?: string | null | undefined; metadata?: Record | null | undefined; executionSource?: string | null | undefined; tags?: string[] | null | undefined; entityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; entityId?: string | null | undefined; entityName?: string | null | undefined; parentEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; parentEntityId?: string | null | undefined; parentEntityName?: string | null | undefined; rootEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; rootEntityId?: string | null | undefined; rootEntityName?: string | null | undefined; userId?: string | null | undefined; organizationId?: string | null | undefined; resourceId?: string | null | undefined; runId?: string | null | undefined; sessionId?: string | null | undefined; threadId?: string | null | undefined; requestId?: string | null | undefined; environment?: string | null | undefined; serviceName?: string | null | undefined; scope?: Record | null | undefined; entityVersionId?: string | null | undefined; parentEntityVersionId?: string | null | undefined; rootEntityVersionId?: string | null | undefined; experimentId?: string | null | undefined; scoreId?: string | null | undefined; traceId?: string | null | undefined; spanId?: string | null | undefined; scorerName?: string | null | undefined; scorerVersion?: string | null | undefined; scoreSource?: string | null | undefined; source?: string | null | undefined; reason?: string | null | undefined; }, number>; readonly feedbackCursorIds: Map<{ timestamp: Date; feedbackType: string; value: string | number; sourceId?: string | null | undefined; metadata?: Record | null | undefined; executionSource?: string | null | undefined; tags?: string[] | null | undefined; entityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; entityId?: string | null | undefined; entityName?: string | null | undefined; parentEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; parentEntityId?: string | null | undefined; parentEntityName?: string | null | undefined; rootEntityType?: import("../../_types/@internal_core/dist/storage/index.d.ts").EntityType | null | undefined; rootEntityId?: string | null | undefined; rootEntityName?: string | null | undefined; userId?: string | null | undefined; organizationId?: string | null | undefined; resourceId?: string | null | undefined; runId?: string | null | undefined; sessionId?: string | null | undefined; threadId?: string | null | undefined; requestId?: string | null | undefined; environment?: string | null | undefined; serviceName?: string | null | undefined; scope?: Record | null | undefined; entityVersionId?: string | null | undefined; parentEntityVersionId?: string | null | undefined; rootEntityVersionId?: string | null | undefined; experimentId?: string | null | undefined; feedbackId?: string | null | undefined; traceId?: string | null | undefined; spanId?: string | null | undefined; feedbackSource?: string | null | undefined; source?: string | null | undefined; comment?: string | null | undefined; feedbackUserId?: string | null | undefined; }, number>; readonly agents: Map; readonly agentVersions: Map; readonly promptBlocks: Map; readonly promptBlockVersions: Map; readonly scorerDefinitions: Map; readonly scorerDefinitionVersions: Map; readonly mcpClients: Map; readonly mcpClientVersions: Map; readonly mcpServers: Map; readonly mcpServerVersions: Map; readonly workspaces: Map; readonly workspaceVersions: Map; readonly skills: Map; readonly skillVersions: Map; /** * Favorites keyed by `${userId}\u0000${entityType}\u0000${entityId}`. The * favorites domain owns reads/writes; this Map lives on InMemoryDB so the * favorites domain can also mutate `agents` / `skills` `favoriteCount` atomically * within the same synchronous block. */ readonly favorites: Map; /** Observational memory records, keyed by resourceId, each holding array of records (generations) */ readonly observationalMemory: Map; readonly datasets: Map; readonly datasetItems: Map; readonly datasetVersions: Map; readonly experiments: Map; readonly experimentResults: Map; readonly backgroundTasks: Map; readonly schedules: Map; readonly scheduleTriggers: ScheduleTrigger[]; /** * Tool provider connections keyed by `${authorId}\u0000${providerId}\u0000${connectionId}`. */ readonly toolProviderConnections: Map; /** * Clears all data from all collections. * Useful for testing. */ clear(): void; } //# sourceMappingURL=inmemory-db.d.ts.map