@mastra/core
Version:
The core foundation of the Mastra framework, providing essential components and interfaces for building AI-powered applications.
104 lines (101 loc) • 3.44 kB
TypeScript
import { Config } from '@libsql/client';
import { b as MastraStorage, T as TABLE_NAMES, S as StorageColumn, c as StorageThreadType, d as MessageType, e as StorageGetMessagesArg, E as EvalRow, W as WorkflowRuns, f as WorkflowRun } from '../../base-BCnFhShR.js';
import 'ai';
import '../../base-CeEVvwRi.js';
import '@opentelemetry/api';
import '../../index-CquI0inB.js';
import 'stream';
import 'pino';
import '@opentelemetry/sdk-trace-base';
import '../../types-BtMyV38I.js';
import 'sift';
import 'zod';
import 'json-schema';
import '../../runtime-context/index.js';
import 'xstate';
import 'node:events';
import '../../vector/index.js';
import '../../vector/filter/index.js';
import '../../tts/index.js';
import 'events';
import '../../deployer/index.js';
import '../../bundler/index.js';
import 'hono';
import 'hono/cors';
import 'hono-openapi';
import 'ai/test';
declare class LibSQLStore extends MastraStorage {
private client;
constructor({ config }: {
config: Config;
});
protected rewriteDbUrl(url: string): string;
private getCreateTableSQL;
createTable({ tableName, schema, }: {
tableName: TABLE_NAMES;
schema: Record<string, StorageColumn>;
}): Promise<void>;
clearTable({ tableName }: {
tableName: TABLE_NAMES;
}): Promise<void>;
private prepareStatement;
insert({ tableName, record }: {
tableName: TABLE_NAMES;
record: Record<string, any>;
}): Promise<void>;
batchInsert({ tableName, records }: {
tableName: TABLE_NAMES;
records: Record<string, any>[];
}): Promise<void>;
load<R>({ tableName, keys }: {
tableName: TABLE_NAMES;
keys: Record<string, string>;
}): Promise<R | null>;
getThreadById({ threadId }: {
threadId: string;
}): Promise<StorageThreadType | null>;
getThreadsByResourceId({ resourceId }: {
resourceId: string;
}): Promise<StorageThreadType[]>;
saveThread({ thread }: {
thread: StorageThreadType;
}): Promise<StorageThreadType>;
updateThread({ id, title, metadata, }: {
id: string;
title: string;
metadata: Record<string, unknown>;
}): Promise<StorageThreadType>;
deleteThread({ threadId }: {
threadId: string;
}): Promise<void>;
private parseRow;
getMessages<T extends MessageType[]>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
saveMessages({ messages }: {
messages: MessageType[];
}): Promise<MessageType[]>;
private transformEvalRow;
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
name?: string;
scope?: string;
page: number;
perPage: number;
attributes?: Record<string, string>;
filters?: Record<string, any>;
fromDate?: Date;
toDate?: Date;
}): Promise<any[]>;
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, }?: {
workflowName?: string;
fromDate?: Date;
toDate?: Date;
limit?: number;
offset?: number;
}): Promise<WorkflowRuns>;
getWorkflowRunById({ runId, workflowName, }: {
runId: string;
workflowName?: string;
}): Promise<WorkflowRun | null>;
private parseWorkflowRun;
}
export { LibSQLStore as DefaultStorage, LibSQLStore };