UNPKG

@mastra/core

Version:
213 lines • 15.7 kB
import type { StorageColumn, StorageTableConfig } from './types.js'; export declare const TABLE_WORKFLOW_SNAPSHOT = "mastra_workflow_snapshot"; export declare const TABLE_MESSAGES = "mastra_messages"; export declare const TABLE_THREADS = "mastra_threads"; export declare const TABLE_TRACES = "mastra_traces"; export declare const TABLE_RESOURCES = "mastra_resources"; export declare const TABLE_SCORERS = "mastra_scorers"; export declare const TABLE_SPANS = "mastra_ai_spans"; export declare const TABLE_AGENTS = "mastra_agents"; export declare const TABLE_AGENT_VERSIONS = "mastra_agent_versions"; export declare const TABLE_OBSERVATIONAL_MEMORY = "mastra_observational_memory"; export declare const TABLE_PROMPT_BLOCKS = "mastra_prompt_blocks"; export declare const TABLE_PROMPT_BLOCK_VERSIONS = "mastra_prompt_block_versions"; export declare const TABLE_SCORER_DEFINITIONS = "mastra_scorer_definitions"; export declare const TABLE_SCORER_DEFINITION_VERSIONS = "mastra_scorer_definition_versions"; export declare const TABLE_MCP_CLIENTS = "mastra_mcp_clients"; export declare const TABLE_MCP_CLIENT_VERSIONS = "mastra_mcp_client_versions"; export declare const TABLE_MCP_SERVERS = "mastra_mcp_servers"; export declare const TABLE_MCP_SERVER_VERSIONS = "mastra_mcp_server_versions"; export declare const TABLE_WORKSPACES = "mastra_workspaces"; export declare const TABLE_WORKSPACE_VERSIONS = "mastra_workspace_versions"; export declare const TABLE_SKILLS = "mastra_skills"; export declare const TABLE_SKILL_VERSIONS = "mastra_skill_versions"; export declare const TABLE_SKILL_BLOBS = "mastra_skill_blobs"; export declare const TABLE_FAVORITES = "mastra_favorites"; export declare const TABLE_DATASETS = "mastra_datasets"; export declare const TABLE_DATASET_ITEMS = "mastra_dataset_items"; export declare const TABLE_DATASET_VERSIONS = "mastra_dataset_versions"; export declare const TABLE_EXPERIMENTS = "mastra_experiments"; export declare const TABLE_EXPERIMENT_RESULTS = "mastra_experiment_results"; export declare const TABLE_BACKGROUND_TASKS = "mastra_background_tasks"; export declare const TABLE_SCHEDULES = "mastra_schedules"; export declare const TABLE_SCHEDULE_TRIGGERS = "mastra_schedule_triggers"; export declare const TABLE_WORKFLOW_DEFINITIONS = "mastra_workflow_definitions"; export declare const TABLE_CHANNEL_INSTALLATIONS = "mastra_channel_installations"; export declare const TABLE_CHANNEL_CONFIG = "mastra_channel_config"; export declare const TABLE_TOOL_PROVIDER_CONNECTIONS = "mastra_tool_provider_connections"; export declare const TABLE_NOTIFICATIONS = "mastra_notifications"; export declare const TABLE_HARNESS_SESSIONS = "mastra_harness_sessions"; export declare const TABLE_THREAD_STATE = "mastra_thread_state"; export declare const TABLE_KNOWLEDGE_NODES = "mastra_knowledge_nodes"; export declare const TABLE_KNOWLEDGE_RECORDS = "mastra_knowledge_records"; export declare const TABLE_KNOWLEDGE_MENTIONS = "mastra_knowledge_mentions"; /** * @deprecated Curation cursors were removed and Knowledge no longer creates this table. Kept so adapters built * against earlier Core versions still resolve the export. */ export declare const TABLE_KNOWLEDGE_CURSORS = "mastra_knowledge_cursors"; export declare const TABLE_KNOWLEDGE_ACTIVITY = "mastra_knowledge_activity"; export declare const TABLE_KNOWLEDGE_SEMANTIC_OUTBOX = "mastra_knowledge_semantic_outbox"; export declare const TABLE_KNOWLEDGE_NODE_SCOPES = "mastra_knowledge_node_scopes"; export declare const TABLE_KNOWLEDGE_RECORD_SCOPES = "mastra_knowledge_record_scopes"; export declare const TABLE_KNOWLEDGE_SCOPE_GRANTS = "mastra_knowledge_scope_grants"; export declare const TABLE_KNOWLEDGE_ACCESS_STATE = "mastra_knowledge_access_state"; export declare const TABLE_KNOWLEDGE_SCOPE_ADDRESSES = "mastra_knowledge_scope_addresses"; export declare const TABLE_KNOWLEDGE_NODE_ADDRESSES = "mastra_knowledge_node_addresses"; export declare const TABLE_KNOWLEDGE_IMPORT_STATE = "mastra_knowledge_import_state"; export declare const TABLE_KNOWLEDGE_IMPORT_RUNS = "mastra_knowledge_import_runs"; export declare const TABLE_KNOWLEDGE_PROPOSALS = "mastra_knowledge_proposals"; /** Physical tables owned by one Knowledge domain. Explicit reset may target only this list. */ export declare const KNOWLEDGE_TABLE_NAMES: readonly ["mastra_knowledge_nodes", "mastra_knowledge_records", "mastra_knowledge_mentions", "mastra_knowledge_activity", "mastra_knowledge_semantic_outbox", "mastra_knowledge_node_scopes", "mastra_knowledge_record_scopes", "mastra_knowledge_scope_grants", "mastra_knowledge_access_state", "mastra_knowledge_scope_addresses", "mastra_knowledge_node_addresses", "mastra_knowledge_import_state", "mastra_knowledge_import_runs", "mastra_knowledge_proposals"]; export type KNOWLEDGE_TABLE_NAME = (typeof KNOWLEDGE_TABLE_NAMES)[number]; /** Union of all core table name constants. */ export type TABLE_NAMES = typeof TABLE_WORKFLOW_SNAPSHOT | typeof TABLE_MESSAGES | typeof TABLE_THREADS | typeof TABLE_TRACES | typeof TABLE_RESOURCES | typeof TABLE_SCORERS | typeof TABLE_SPANS | typeof TABLE_AGENTS | typeof TABLE_AGENT_VERSIONS | typeof TABLE_PROMPT_BLOCKS | typeof TABLE_PROMPT_BLOCK_VERSIONS | typeof TABLE_SCORER_DEFINITIONS | typeof TABLE_SCORER_DEFINITION_VERSIONS | typeof TABLE_MCP_CLIENTS | typeof TABLE_MCP_CLIENT_VERSIONS | typeof TABLE_MCP_SERVERS | typeof TABLE_MCP_SERVER_VERSIONS | typeof TABLE_WORKSPACES | typeof TABLE_WORKSPACE_VERSIONS | typeof TABLE_SKILLS | typeof TABLE_SKILL_VERSIONS | typeof TABLE_SKILL_BLOBS | typeof TABLE_DATASETS | typeof TABLE_DATASET_ITEMS | typeof TABLE_DATASET_VERSIONS | typeof TABLE_EXPERIMENTS | typeof TABLE_EXPERIMENT_RESULTS | typeof TABLE_BACKGROUND_TASKS | typeof TABLE_FAVORITES | typeof TABLE_SCHEDULES | typeof TABLE_SCHEDULE_TRIGGERS | typeof TABLE_CHANNEL_INSTALLATIONS | typeof TABLE_CHANNEL_CONFIG | typeof TABLE_TOOL_PROVIDER_CONNECTIONS | typeof TABLE_NOTIFICATIONS | typeof TABLE_HARNESS_SESSIONS | typeof TABLE_THREAD_STATE | typeof TABLE_WORKFLOW_DEFINITIONS | typeof TABLE_KNOWLEDGE_NODES | typeof TABLE_KNOWLEDGE_RECORDS | typeof TABLE_KNOWLEDGE_MENTIONS | typeof TABLE_KNOWLEDGE_ACTIVITY | typeof TABLE_KNOWLEDGE_SEMANTIC_OUTBOX; export declare const SCORERS_SCHEMA: Record<string, StorageColumn>; export declare const SPAN_SCHEMA: Record<"attributes" | "createdAt" | "endedAt" | "entityId" | "entityName" | "entityType" | "entityVersionId" | "environment" | "error" | "errorCount" | "errorPreview" | "experimentId" | "externalParentSpanId" | "input" | "inputPreview" | "isEvent" | "links" | "metadata" | "model" | "name" | "organizationId" | "outcome" | "output" | "outputPreview" | "parentEntityId" | "parentEntityName" | "parentEntityType" | "parentEntityVersionId" | "parentSpanId" | "provider" | "requestContext" | "requestId" | "resourceId" | "resumedFromSpanId" | "rootEntityId" | "rootEntityName" | "rootEntityType" | "rootEntityVersionId" | "runId" | "scope" | "serviceName" | "sessionId" | "source" | "spanId" | "spanType" | "startedAt" | "stopReason" | "stopReasonContext" | "tags" | "threadId" | "timeToFirstChunkMs" | "timeToFirstTokenMs" | "traceId" | "updatedAt" | "userId", StorageColumn>; /** * @deprecated Use SPAN_SCHEMA instead. This legacy schema is retained only for migration purposes. * @internal */ export declare const OLD_SPAN_SCHEMA: Record<string, StorageColumn>; export declare const AGENTS_SCHEMA: Record<string, StorageColumn>; export declare const AGENT_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const PROMPT_BLOCKS_SCHEMA: Record<string, StorageColumn>; export declare const PROMPT_BLOCK_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const SCORER_DEFINITIONS_SCHEMA: Record<string, StorageColumn>; export declare const SCORER_DEFINITION_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const MCP_CLIENTS_SCHEMA: Record<string, StorageColumn>; export declare const MCP_CLIENT_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const MCP_SERVERS_SCHEMA: Record<string, StorageColumn>; export declare const MCP_SERVER_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const WORKFLOW_DEFINITIONS_SCHEMA: Record<string, StorageColumn>; export declare const WORKSPACES_SCHEMA: Record<string, StorageColumn>; export declare const WORKSPACE_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const SKILLS_SCHEMA: Record<string, StorageColumn>; export declare const FAVORITES_SCHEMA: Record<string, StorageColumn>; /** * Per-author registry of authorized tool provider connections. Stores a stable * user-supplied label across agents. Composite primary key on * (authorId, providerId, connectionId). `scope` buckets identity: * 'per-author' (default), 'shared' (visible to all callers), or * 'caller-supplied' (authorId is a host-app end-user id forwarded via request * context). */ export declare const TOOL_PROVIDER_CONNECTIONS_SCHEMA: Record<string, StorageColumn>; export declare const NOTIFICATIONS_SCHEMA: Record<string, StorageColumn>; export declare const HARNESS_SESSIONS_SCHEMA: Record<string, StorageColumn>; export declare const THREAD_STATE_SCHEMA: Record<string, StorageColumn>; export declare const SKILL_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const SKILL_BLOBS_SCHEMA: Record<string, StorageColumn>; export declare const OBSERVATIONAL_MEMORY_SCHEMA: Record<string, StorageColumn>; export declare const DATASETS_SCHEMA: Record<string, StorageColumn>; export declare const DATASET_ITEMS_SCHEMA: Record<string, StorageColumn>; export declare const DATASET_VERSIONS_SCHEMA: Record<string, StorageColumn>; export declare const EXPERIMENTS_SCHEMA: Record<string, StorageColumn>; export declare const EXPERIMENT_RESULTS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_NODES_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_RECORDS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_MENTIONS_SCHEMA: Record<string, StorageColumn>; /** * @deprecated Curation cursors were removed and Knowledge no longer creates this table. Kept so adapters built * against earlier Core versions still resolve the export. */ export declare const KNOWLEDGE_CURSORS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_ACTIVITY_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_SEMANTIC_OUTBOX_SCHEMA: Record<string, StorageColumn>; /** Normalized Knowledge v2 node schema plus nullable v1 facade columns. */ export declare const KNOWLEDGE_V2_NODES_SCHEMA: Record<string, StorageColumn>; /** Knowledge v2 record schema. Scope rules live in `mastra_knowledge_record_scopes`. */ export declare const KNOWLEDGE_V2_RECORDS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_V2_MENTIONS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_NODE_SCOPES_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_RECORD_SCOPES_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_SCOPE_GRANTS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_ACCESS_STATE_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_SCOPE_ADDRESSES_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_NODE_ADDRESSES_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_IMPORT_STATE_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_IMPORT_RUNS_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_V2_ACTIVITY_SCHEMA: Record<string, StorageColumn>; export declare const KNOWLEDGE_PROPOSALS_SCHEMA: Record<string, StorageColumn>; /** * Schema definitions for all core tables. */ export declare const TABLE_SCHEMAS: Record<TABLE_NAMES, Record<string, StorageColumn>>; /** * Table-level config for tables that need composite primary keys or other table-level settings. * Keyed by table name. Tables not listed here use single-column PKs from their schema. */ export declare const TABLE_CONFIGS: Partial<Record<TABLE_NAMES, StorageTableConfig>>; /** * Schema for the observational memory table. * Exported separately as OM is optional and not part of TABLE_NAMES. */ export declare const OBSERVATIONAL_MEMORY_TABLE_SCHEMA: { mastra_observational_memory: Record<string, StorageColumn>; }; export declare const TABLE_WORKFLOW_RUN_OWNERS = "mastra_workflow_run_owners"; export declare const TABLE_MEMORY_RUN_FENCES = "mastra_memory_run_fences"; /** * Run ownership records for workflows stores that support run fencing. * `leaseExpiresAt` and `updatedAt` are epoch milliseconds on the database * clock; `leaseExpiresAt` is null once released. `updatedAt` is refreshed by * every claim, renewal and release and anchors `workflows.runOwnership` * retention. A run's first generation is the store clock in epoch * milliseconds, so a run claimed again after its record was pruned still gets * a higher generation. */ export declare const WORKFLOW_RUN_OWNERS_SCHEMA: Record<string, StorageColumn>; /** * The claim each run's memory writes must carry, for memory stores that support run fencing. * `retiredAt` is epoch milliseconds on the database clock, set once the * execution holding the fence settles and cleared when the fence is raised * again. It anchors `memory.runFences` retention; NULL rows are never pruned. */ export declare const MEMORY_RUN_FENCES_SCHEMA: Record<string, StorageColumn>; /** * Schemas for the run fencing tables. * Exported separately because only adapters that support run fencing create them, * so they are not part of TABLE_NAMES. */ export declare const RUN_FENCING_TABLE_SCHEMAS: { mastra_workflow_run_owners: Record<string, StorageColumn>; mastra_memory_run_fences: Record<string, StorageColumn>; }; export declare const TABLE_WORKFLOW_RUNS = "mastra_workflow_runs"; export declare const TABLE_WORKFLOW_RUN_ENTRIES = "mastra_workflow_run_entries"; /** * Storage v2 run headers: the run's `WorkflowRunHeader` (its `WorkflowRunState` without * `context` and `value`). `status` and `threadId` are copied out of the snapshot so they * can be filtered and indexed. `lastSeq` is the highest `seq` the run's entries have used; * it only increases, across checkpoints too. `startStateSeq` is the state version the run's * current drive started from (see `StoredWorkflowRunHeader`). `stateShared` is set once another * run's state builds on this run's state, so a checkpoint keeps the earlier state entries and a * delete knows to detach the runs built on it. `stateSeq`, `statePatchCount`, `statePatchBytes` * and `stateBytes` track where the run's state chain stands (see `StoredStateColumns`). * @experimental */ export declare const WORKFLOW_RUNS_SCHEMA: Record<string, StorageColumn>; /** * Storage v2 run entries: one step result (`kind: 'step'`) or one state entry (`kind` `state`, * `state-patch`, `state-base` or `state-draft`, `step_id` null; see `WorkflowRunEntry`) per row, * ordered by `seq` within a run. * @experimental */ export declare const WORKFLOW_RUN_ENTRIES_SCHEMA: Record<string, StorageColumn>; /** * Table configs for the storage v2 run tables (`storageVersion: 2`). * Exported separately because only adapters that support run journals create them, * so they are not part of TABLE_NAMES. * @experimental */ export declare const WORKFLOW_RUN_JOURNAL_TABLE_CONFIGS: { mastra_workflow_runs: { columns: Record<string, StorageColumn>; compositePrimaryKey: string[]; }; mastra_workflow_run_entries: { columns: Record<string, StorageColumn>; compositePrimaryKey: string[]; }; }; //# sourceMappingURL=constants.d.ts.map