@mastra/lance 0.0.0-update-stores-peerDeps-20250723031338 → 0.0.0-vector-query-tool-provider-options-20250828222356

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +201 -2
  2. package/README.md +3 -3
  3. package/dist/index.cjs +113 -21
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.ts +3 -2
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +113 -21
  8. package/dist/index.js.map +1 -0
  9. package/dist/storage/domains/legacy-evals/index.d.ts +25 -0
  10. package/dist/storage/domains/legacy-evals/index.d.ts.map +1 -0
  11. package/dist/storage/domains/memory/index.d.ts +103 -0
  12. package/dist/storage/domains/memory/index.d.ts.map +1 -0
  13. package/dist/storage/domains/operations/index.d.ts +40 -0
  14. package/dist/storage/domains/operations/index.d.ts.map +1 -0
  15. package/dist/storage/domains/scores/index.d.ts +42 -0
  16. package/dist/storage/domains/scores/index.d.ts.map +1 -0
  17. package/dist/storage/domains/traces/index.d.ts +34 -0
  18. package/dist/storage/domains/traces/index.d.ts.map +1 -0
  19. package/dist/storage/domains/utils.d.ts +10 -0
  20. package/dist/storage/domains/utils.d.ts.map +1 -0
  21. package/dist/storage/domains/workflows/index.d.ts +56 -0
  22. package/dist/storage/domains/workflows/index.d.ts.map +1 -0
  23. package/dist/storage/index.d.ts +262 -0
  24. package/dist/storage/index.d.ts.map +1 -0
  25. package/dist/vector/filter.d.ts +41 -0
  26. package/dist/vector/filter.d.ts.map +1 -0
  27. package/dist/vector/index.d.ts +85 -0
  28. package/dist/vector/index.d.ts.map +1 -0
  29. package/dist/vector/types.d.ts +15 -0
  30. package/dist/vector/types.d.ts.map +1 -0
  31. package/package.json +10 -9
  32. package/src/storage/domains/memory/index.ts +71 -18
  33. package/src/storage/domains/scores/index.ts +29 -7
  34. package/src/storage/domains/workflows/index.ts +39 -1
  35. package/src/storage/index.ts +56 -3
  36. package/src/vector/index.ts +2 -2
  37. package/tsconfig.build.json +9 -0
  38. package/tsconfig.json +1 -1
  39. package/tsup.config.ts +17 -0
  40. package/dist/_tsup-dts-rollup.d.cts +0 -680
  41. package/dist/_tsup-dts-rollup.d.ts +0 -680
  42. package/dist/index.d.cts +0 -2
@@ -1,680 +0,0 @@
1
- import { ArrayOperator } from '@mastra/core/vector/filter';
2
- import { BaseFilterTranslator } from '@mastra/core/vector/filter';
3
- import { BasicOperator } from '@mastra/core/vector/filter';
4
- import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
5
- import type { Connection } from '@lancedb/lancedb';
6
- import type { ConnectionOptions } from '@lancedb/lancedb';
7
- import type { CreateIndexParams } from '@mastra/core';
8
- import type { CreateTableOptions } from '@lancedb/lancedb';
9
- import type { DeleteIndexParams } from '@mastra/core';
10
- import type { DeleteVectorParams } from '@mastra/core';
11
- import type { DescribeIndexParams } from '@mastra/core';
12
- import type { EvalRow } from '@mastra/core/storage';
13
- import type { IndexStats } from '@mastra/core';
14
- import { LegacyEvalsStorage } from '@mastra/core/storage';
15
- import { LogicalOperator } from '@mastra/core/vector/filter';
16
- import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
17
- import type { MastraMessageContentV2 } from '@mastra/core/agent';
18
- import type { MastraMessageV1 } from '@mastra/core/memory';
19
- import type { MastraMessageV2 } from '@mastra/core/memory';
20
- import { MastraStorage } from '@mastra/core/storage';
21
- import { MastraVector } from '@mastra/core/vector';
22
- import { MemoryStorage } from '@mastra/core/storage';
23
- import { NumericOperator } from '@mastra/core/vector/filter';
24
- import type { OperatorValueMap } from '@mastra/core/vector/filter';
25
- import type { PaginationInfo } from '@mastra/core/storage';
26
- import type { QueryResult } from '@mastra/core';
27
- import type { QueryVectorParams } from '@mastra/core';
28
- import { RegexOperator } from '@mastra/core/vector/filter';
29
- import type { SchemaLike } from '@lancedb/lancedb';
30
- import type { ScoreRowData } from '@mastra/core/scores';
31
- import { ScoresStorage } from '@mastra/core/storage';
32
- import type { StorageColumn } from '@mastra/core/storage';
33
- import type { StorageDomains } from '@mastra/core/storage';
34
- import type { StorageGetMessagesArg } from '@mastra/core/storage';
35
- import type { StorageGetTracesPaginatedArg } from '@mastra/core/storage';
36
- import type { StoragePagination } from '@mastra/core/storage';
37
- import type { StorageResourceType } from '@mastra/core/storage';
38
- import type { StorageThreadType } from '@mastra/core/memory';
39
- import { StoreOperations } from '@mastra/core/storage';
40
- import type { Table } from '@lancedb/lancedb';
41
- import type { TABLE_NAMES } from '@mastra/core/storage';
42
- import type { TableLike } from '@lancedb/lancedb';
43
- import type { Trace } from '@mastra/core/telemetry';
44
- import { TracesStorage } from '@mastra/core/storage';
45
- import type { TraceType } from '@mastra/core/memory';
46
- import type { UpdateVectorParams } from '@mastra/core';
47
- import type { UpsertVectorParams } from '@mastra/core';
48
- import type { VectorFilter } from '@mastra/core/vector/filter';
49
- import type { WorkflowRuns } from '@mastra/core/storage';
50
- import type { WorkflowRuns as WorkflowRuns_2 } from '@mastra/core';
51
- import type { WorkflowRunState } from '@mastra/core/workflows';
52
- import type { WorkflowRunState as WorkflowRunState_2 } from '@mastra/core';
53
- import { WorkflowsStorage } from '@mastra/core/storage';
54
-
55
- export declare function getPrimaryKeys(tableName: TABLE_NAMES): string[];
56
-
57
- export declare function getTableSchema({ tableName, client, }: {
58
- tableName: TABLE_NAMES;
59
- client: Connection;
60
- }): Promise<SchemaLike>;
61
-
62
- declare interface HNSWConfig {
63
- m?: number;
64
- efConstruction?: number;
65
- }
66
-
67
- export declare interface IndexConfig {
68
- type?: IndexType;
69
- ivf?: IVFConfig;
70
- hnsw?: HNSWConfig;
71
- }
72
-
73
- export declare type IndexType = 'ivfflat' | 'hnsw';
74
-
75
- declare interface IVFConfig {
76
- lists?: number;
77
- }
78
-
79
- declare type LanceBlacklisted = BlacklistedRootOperators | '$like' | '$notLike' | '$contains';
80
-
81
- declare interface LanceCreateIndexParams extends CreateIndexParams {
82
- indexConfig?: LanceIndexConfig;
83
- tableName?: string;
84
- }
85
-
86
- export declare class LanceFilterTranslator extends BaseFilterTranslator<LanceVectorFilter, string> {
87
- translate(filter: LanceVectorFilter): string;
88
- private processFilter;
89
- private processLogicalOperator;
90
- private processNestedObject;
91
- private processField;
92
- private processOperators;
93
- private formatValue;
94
- private formatArrayValues;
95
- normalizeArrayValues(array: unknown[]): unknown[];
96
- normalizeComparisonValue(value: unknown): unknown;
97
- private isOperatorObject;
98
- private isNestedObject;
99
- private isNormalNestedField;
100
- private escapeFieldName;
101
- private isSqlKeyword;
102
- private isDateObject;
103
- /**
104
- * Override getSupportedOperators to add custom operators for LanceDB
105
- */
106
- protected getSupportedOperators(): {
107
- custom: string[];
108
- logical: LogicalOperator[];
109
- basic: BasicOperator[];
110
- numeric: NumericOperator[];
111
- array: ArrayOperator[];
112
- element: "$exists"[];
113
- regex: RegexOperator[];
114
- };
115
- }
116
-
117
- declare interface LanceIndexConfig extends IndexConfig {
118
- numPartitions?: number;
119
- numSubVectors?: number;
120
- }
121
-
122
- declare type LanceOperatorValueMap = OperatorValueMap & {
123
- $like: string;
124
- $notLike: string;
125
- $contains: string;
126
- };
127
-
128
- declare interface LanceQueryVectorParams extends QueryVectorParams<LanceVectorFilter> {
129
- tableName: string;
130
- columns?: string[];
131
- includeAllColumns?: boolean;
132
- }
133
-
134
- declare class LanceStorage extends MastraStorage {
135
- stores: StorageDomains;
136
- private lanceClient;
137
- /**
138
- * Creates a new instance of LanceStorage
139
- * @param uri The URI to connect to LanceDB
140
- * @param options connection options
141
- *
142
- * Usage:
143
- *
144
- * Connect to a local database
145
- * ```ts
146
- * const store = await LanceStorage.create('/path/to/db');
147
- * ```
148
- *
149
- * Connect to a LanceDB cloud database
150
- * ```ts
151
- * const store = await LanceStorage.create('db://host:port');
152
- * ```
153
- *
154
- * Connect to a cloud database
155
- * ```ts
156
- * const store = await LanceStorage.create('s3://bucket/db', { storageOptions: { timeout: '60s' } });
157
- * ```
158
- */
159
- static create(name: string, uri: string, options?: ConnectionOptions): Promise<LanceStorage>;
160
- /**
161
- * @internal
162
- * Private constructor to enforce using the create factory method
163
- */
164
- private constructor();
165
- createTable({ tableName, schema, }: {
166
- tableName: TABLE_NAMES;
167
- schema: Record<string, StorageColumn>;
168
- }): Promise<void>;
169
- dropTable({ tableName }: {
170
- tableName: TABLE_NAMES;
171
- }): Promise<void>;
172
- alterTable({ tableName, schema, ifNotExists, }: {
173
- tableName: TABLE_NAMES;
174
- schema: Record<string, StorageColumn>;
175
- ifNotExists: string[];
176
- }): Promise<void>;
177
- clearTable({ tableName }: {
178
- tableName: TABLE_NAMES;
179
- }): Promise<void>;
180
- insert({ tableName, record }: {
181
- tableName: TABLE_NAMES;
182
- record: Record<string, any>;
183
- }): Promise<void>;
184
- batchInsert({ tableName, records }: {
185
- tableName: TABLE_NAMES;
186
- records: Record<string, any>[];
187
- }): Promise<void>;
188
- load({ tableName, keys }: {
189
- tableName: TABLE_NAMES;
190
- keys: Record<string, any>;
191
- }): Promise<any>;
192
- getThreadById({ threadId }: {
193
- threadId: string;
194
- }): Promise<StorageThreadType | null>;
195
- getThreadsByResourceId({ resourceId }: {
196
- resourceId: string;
197
- }): Promise<StorageThreadType[]>;
198
- /**
199
- * Saves a thread to the database. This function doesn't overwrite existing threads.
200
- * @param thread - The thread to save
201
- * @returns The saved thread
202
- */
203
- saveThread({ thread }: {
204
- thread: StorageThreadType;
205
- }): Promise<StorageThreadType>;
206
- updateThread({ id, title, metadata, }: {
207
- id: string;
208
- title: string;
209
- metadata: Record<string, unknown>;
210
- }): Promise<StorageThreadType>;
211
- deleteThread({ threadId }: {
212
- threadId: string;
213
- }): Promise<void>;
214
- get supports(): {
215
- selectByIncludeResourceScope: boolean;
216
- resourceWorkingMemory: boolean;
217
- hasColumn: boolean;
218
- createTable: boolean;
219
- };
220
- getResourceById({ resourceId }: {
221
- resourceId: string;
222
- }): Promise<StorageResourceType | null>;
223
- saveResource({ resource }: {
224
- resource: StorageResourceType;
225
- }): Promise<StorageResourceType>;
226
- updateResource({ resourceId, workingMemory, metadata, }: {
227
- resourceId: string;
228
- workingMemory?: string;
229
- metadata?: Record<string, unknown>;
230
- }): Promise<StorageResourceType>;
231
- /**
232
- * Processes messages to include context messages based on withPreviousMessages and withNextMessages
233
- * @param records - The sorted array of records to process
234
- * @param include - The array of include specifications with context parameters
235
- * @returns The processed array with context messages included
236
- */
237
- private processMessagesWithContext;
238
- getMessages(args: StorageGetMessagesArg & {
239
- format?: 'v1';
240
- }): Promise<MastraMessageV1[]>;
241
- getMessages(args: StorageGetMessagesArg & {
242
- format: 'v2';
243
- }): Promise<MastraMessageV2[]>;
244
- saveMessages(args: {
245
- messages: MastraMessageV1[];
246
- format?: undefined | 'v1';
247
- }): Promise<MastraMessageV1[]>;
248
- saveMessages(args: {
249
- messages: MastraMessageV2[];
250
- format: 'v2';
251
- }): Promise<MastraMessageV2[]>;
252
- getThreadsByResourceIdPaginated(args: {
253
- resourceId: string;
254
- page: number;
255
- perPage: number;
256
- }): Promise<PaginationInfo & {
257
- threads: StorageThreadType[];
258
- }>;
259
- getMessagesPaginated(args: StorageGetMessagesArg & {
260
- format?: 'v1' | 'v2';
261
- }): Promise<PaginationInfo & {
262
- messages: MastraMessageV1[] | MastraMessageV2[];
263
- }>;
264
- updateMessages(_args: {
265
- messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
266
- id: string;
267
- content?: {
268
- metadata?: MastraMessageContentV2['metadata'];
269
- content?: MastraMessageContentV2['content'];
270
- };
271
- }[];
272
- }): Promise<MastraMessageV2[]>;
273
- getTraceById(args: {
274
- traceId: string;
275
- }): Promise<TraceType>;
276
- getTraces(args: {
277
- name?: string;
278
- scope?: string;
279
- page: number;
280
- perPage: number;
281
- attributes?: Record<string, string>;
282
- }): Promise<Trace[]>;
283
- getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
284
- traces: Trace[];
285
- }>;
286
- getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
287
- getEvals(options: {
288
- agentName?: string;
289
- type?: 'test' | 'live';
290
- page?: number;
291
- perPage?: number;
292
- fromDate?: Date;
293
- toDate?: Date;
294
- dateRange?: {
295
- start?: Date;
296
- end?: Date;
297
- };
298
- }): Promise<PaginationInfo & {
299
- evals: EvalRow[];
300
- }>;
301
- getWorkflowRuns(args?: {
302
- namespace?: string;
303
- workflowName?: string;
304
- fromDate?: Date;
305
- toDate?: Date;
306
- limit?: number;
307
- offset?: number;
308
- }): Promise<WorkflowRuns>;
309
- getWorkflowRunById(args: {
310
- runId: string;
311
- workflowName?: string;
312
- }): Promise<{
313
- workflowName: string;
314
- runId: string;
315
- snapshot: any;
316
- createdAt: Date;
317
- updatedAt: Date;
318
- } | null>;
319
- persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
320
- workflowName: string;
321
- runId: string;
322
- snapshot: WorkflowRunState;
323
- }): Promise<void>;
324
- loadWorkflowSnapshot({ workflowName, runId, }: {
325
- workflowName: string;
326
- runId: string;
327
- }): Promise<WorkflowRunState | null>;
328
- getScoreById({ id: _id }: {
329
- id: string;
330
- }): Promise<ScoreRowData | null>;
331
- getScoresByScorerId({ scorerId, pagination, }: {
332
- scorerId: string;
333
- pagination: StoragePagination;
334
- }): Promise<{
335
- pagination: PaginationInfo;
336
- scores: ScoreRowData[];
337
- }>;
338
- saveScore(_score: ScoreRowData): Promise<{
339
- score: ScoreRowData;
340
- }>;
341
- getScoresByRunId({ runId, pagination, }: {
342
- runId: string;
343
- pagination: StoragePagination;
344
- }): Promise<{
345
- pagination: PaginationInfo;
346
- scores: ScoreRowData[];
347
- }>;
348
- getScoresByEntityId({ entityId, entityType, pagination, }: {
349
- pagination: StoragePagination;
350
- entityId: string;
351
- entityType: string;
352
- }): Promise<{
353
- pagination: PaginationInfo;
354
- scores: ScoreRowData[];
355
- }>;
356
- }
357
- export { LanceStorage }
358
- export { LanceStorage as LanceStorage_alias_1 }
359
-
360
- declare interface LanceUpsertVectorParams extends UpsertVectorParams {
361
- tableName: string;
362
- }
363
-
364
- export declare type LanceVectorFilter = VectorFilter<keyof LanceOperatorValueMap, LanceOperatorValueMap, LogicalOperatorValueMap, LanceBlacklisted>;
365
-
366
- declare class LanceVectorStore extends MastraVector<LanceVectorFilter> {
367
- private lanceClient;
368
- /**
369
- * Creates a new instance of LanceVectorStore
370
- * @param uri The URI to connect to LanceDB
371
- * @param options connection options
372
- *
373
- * Usage:
374
- *
375
- * Connect to a local database
376
- * ```ts
377
- * const store = await LanceVectorStore.create('/path/to/db');
378
- * ```
379
- *
380
- * Connect to a LanceDB cloud database
381
- * ```ts
382
- * const store = await LanceVectorStore.create('db://host:port');
383
- * ```
384
- *
385
- * Connect to a cloud database
386
- * ```ts
387
- * const store = await LanceVectorStore.create('s3://bucket/db', { storageOptions: { timeout: '60s' } });
388
- * ```
389
- */
390
- static create(uri: string, options?: ConnectionOptions): Promise<LanceVectorStore>;
391
- /**
392
- * @internal
393
- * Private constructor to enforce using the create factory method
394
- */
395
- private constructor();
396
- close(): void;
397
- query({ tableName, queryVector, filter, includeVector, topK, columns, includeAllColumns, }: LanceQueryVectorParams): Promise<QueryResult[]>;
398
- private filterTranslator;
399
- upsert({ tableName, vectors, metadata, ids }: LanceUpsertVectorParams): Promise<string[]>;
400
- /**
401
- * Flattens a nested object, creating new keys with underscores for nested properties.
402
- * Example: { metadata: { text: 'test' } } → { metadata_text: 'test' }
403
- */
404
- private flattenObject;
405
- createTable(tableName: string, data: Record<string, unknown>[] | TableLike, options?: Partial<CreateTableOptions>): Promise<Table>;
406
- listTables(): Promise<string[]>;
407
- getTableSchema(tableName: string): Promise<any>;
408
- /**
409
- * indexName is actually a column name in a table in lanceDB
410
- */
411
- createIndex({ tableName, indexName, dimension, metric, indexConfig, }: LanceCreateIndexParams): Promise<void>;
412
- listIndexes(): Promise<string[]>;
413
- describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
414
- deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
415
- /**
416
- * Deletes all tables in the database
417
- */
418
- deleteAllTables(): Promise<void>;
419
- deleteTable(tableName: string): Promise<void>;
420
- updateVector({ indexName, id, update }: UpdateVectorParams): Promise<void>;
421
- deleteVector({ indexName, id }: DeleteVectorParams): Promise<void>;
422
- /**
423
- * Converts a flattened object with keys using underscore notation back to a nested object.
424
- * Example: { name: 'test', details_text: 'test' } → { name: 'test', details: { text: 'test' } }
425
- */
426
- private unflattenObject;
427
- }
428
- export { LanceVectorStore }
429
- export { LanceVectorStore as LanceVectorStore_alias_1 }
430
-
431
- export declare function processResultWithTypeConversion(rawResult: Record<string, any> | Record<string, any>[], tableSchema: SchemaLike): Record<string, any> | Record<string, any>[];
432
-
433
- export declare class StoreLegacyEvalsLance extends LegacyEvalsStorage {
434
- private client;
435
- constructor({ client }: {
436
- client: Connection;
437
- });
438
- getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
439
- getEvals(options: {
440
- agentName?: string;
441
- type?: 'test' | 'live';
442
- page?: number;
443
- perPage?: number;
444
- fromDate?: Date;
445
- toDate?: Date;
446
- dateRange?: {
447
- start?: Date;
448
- end?: Date;
449
- };
450
- }): Promise<PaginationInfo & {
451
- evals: EvalRow[];
452
- }>;
453
- }
454
-
455
- export declare class StoreMemoryLance extends MemoryStorage {
456
- private client;
457
- private operations;
458
- constructor({ client, operations }: {
459
- client: Connection;
460
- operations: StoreOperationsLance;
461
- });
462
- getThreadById({ threadId }: {
463
- threadId: string;
464
- }): Promise<StorageThreadType | null>;
465
- getThreadsByResourceId({ resourceId }: {
466
- resourceId: string;
467
- }): Promise<StorageThreadType[]>;
468
- /**
469
- * Saves a thread to the database. This function doesn't overwrite existing threads.
470
- * @param thread - The thread to save
471
- * @returns The saved thread
472
- */
473
- saveThread({ thread }: {
474
- thread: StorageThreadType;
475
- }): Promise<StorageThreadType>;
476
- updateThread({ id, title, metadata, }: {
477
- id: string;
478
- title: string;
479
- metadata: Record<string, unknown>;
480
- }): Promise<StorageThreadType>;
481
- deleteThread({ threadId }: {
482
- threadId: string;
483
- }): Promise<void>;
484
- getMessages(args: StorageGetMessagesArg & {
485
- format?: 'v1';
486
- }): Promise<MastraMessageV1[]>;
487
- getMessages(args: StorageGetMessagesArg & {
488
- format: 'v2';
489
- }): Promise<MastraMessageV2[]>;
490
- saveMessages(args: {
491
- messages: MastraMessageV1[];
492
- format?: undefined | 'v1';
493
- }): Promise<MastraMessageV1[]>;
494
- saveMessages(args: {
495
- messages: MastraMessageV2[];
496
- format: 'v2';
497
- }): Promise<MastraMessageV2[]>;
498
- getThreadsByResourceIdPaginated(args: {
499
- resourceId: string;
500
- page?: number;
501
- perPage?: number;
502
- }): Promise<PaginationInfo & {
503
- threads: StorageThreadType[];
504
- }>;
505
- /**
506
- * Processes messages to include context messages based on withPreviousMessages and withNextMessages
507
- * @param records - The sorted array of records to process
508
- * @param include - The array of include specifications with context parameters
509
- * @returns The processed array with context messages included
510
- */
511
- private processMessagesWithContext;
512
- getMessagesPaginated(args: StorageGetMessagesArg & {
513
- format?: 'v1' | 'v2';
514
- }): Promise<PaginationInfo & {
515
- messages: MastraMessageV1[] | MastraMessageV2[];
516
- }>;
517
- /**
518
- * Parse message data from LanceDB record format to MastraMessageV2 format
519
- */
520
- private parseMessageData;
521
- updateMessages(args: {
522
- messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
523
- id: string;
524
- content?: {
525
- metadata?: MastraMessageContentV2['metadata'];
526
- content?: MastraMessageContentV2['content'];
527
- };
528
- }[];
529
- }): Promise<MastraMessageV2[]>;
530
- getResourceById({ resourceId }: {
531
- resourceId: string;
532
- }): Promise<StorageResourceType | null>;
533
- saveResource({ resource }: {
534
- resource: StorageResourceType;
535
- }): Promise<StorageResourceType>;
536
- updateResource({ resourceId, workingMemory, metadata, }: {
537
- resourceId: string;
538
- workingMemory?: string;
539
- metadata?: Record<string, unknown>;
540
- }): Promise<StorageResourceType>;
541
- }
542
-
543
- export declare class StoreOperationsLance extends StoreOperations {
544
- client: Connection;
545
- constructor({ client }: {
546
- client: Connection;
547
- });
548
- protected getDefaultValue(type: StorageColumn['type']): string;
549
- hasColumn(tableName: TABLE_NAMES, columnName: string): Promise<boolean>;
550
- private translateSchema;
551
- createTable({ tableName, schema, }: {
552
- tableName: TABLE_NAMES;
553
- schema: Record<string, StorageColumn>;
554
- }): Promise<void>;
555
- dropTable({ tableName }: {
556
- tableName: TABLE_NAMES;
557
- }): Promise<void>;
558
- alterTable({ tableName, schema, ifNotExists, }: {
559
- tableName: string;
560
- schema: Record<string, StorageColumn>;
561
- ifNotExists: string[];
562
- }): Promise<void>;
563
- clearTable({ tableName }: {
564
- tableName: TABLE_NAMES;
565
- }): Promise<void>;
566
- insert({ tableName, record }: {
567
- tableName: string;
568
- record: Record<string, any>;
569
- }): Promise<void>;
570
- batchInsert({ tableName, records }: {
571
- tableName: string;
572
- records: Record<string, any>[];
573
- }): Promise<void>;
574
- load({ tableName, keys }: {
575
- tableName: TABLE_NAMES;
576
- keys: Record<string, any>;
577
- }): Promise<any>;
578
- }
579
-
580
- export declare class StoreScoresLance extends ScoresStorage {
581
- private client;
582
- constructor({ client }: {
583
- client: Connection;
584
- });
585
- saveScore(score: ScoreRowData): Promise<{
586
- score: ScoreRowData;
587
- }>;
588
- getScoreById({ id }: {
589
- id: string;
590
- }): Promise<ScoreRowData | null>;
591
- getScoresByScorerId({ scorerId, pagination, }: {
592
- scorerId: string;
593
- pagination: StoragePagination;
594
- }): Promise<{
595
- pagination: PaginationInfo;
596
- scores: ScoreRowData[];
597
- }>;
598
- getScoresByRunId({ runId, pagination, }: {
599
- runId: string;
600
- pagination: StoragePagination;
601
- }): Promise<{
602
- pagination: PaginationInfo;
603
- scores: ScoreRowData[];
604
- }>;
605
- getScoresByEntityId({ entityId, entityType, pagination, }: {
606
- pagination: StoragePagination;
607
- entityId: string;
608
- entityType: string;
609
- }): Promise<{
610
- pagination: PaginationInfo;
611
- scores: ScoreRowData[];
612
- }>;
613
- }
614
-
615
- export declare class StoreTracesLance extends TracesStorage {
616
- private client;
617
- private operations;
618
- constructor({ client, operations }: {
619
- client: Connection;
620
- operations: StoreOperationsLance;
621
- });
622
- saveTrace({ trace }: {
623
- trace: TraceType;
624
- }): Promise<TraceType>;
625
- getTraceById({ traceId }: {
626
- traceId: string;
627
- }): Promise<TraceType>;
628
- getTraces({ name, scope, page, perPage, attributes, }: {
629
- name?: string;
630
- scope?: string;
631
- page: number;
632
- perPage: number;
633
- attributes?: Record<string, string>;
634
- }): Promise<Trace[]>;
635
- getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
636
- traces: Trace[];
637
- }>;
638
- batchTraceInsert({ records }: {
639
- records: Record<string, any>[];
640
- }): Promise<void>;
641
- }
642
-
643
- export declare class StoreWorkflowsLance extends WorkflowsStorage {
644
- client: Connection;
645
- constructor({ client }: {
646
- client: Connection;
647
- });
648
- persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
649
- workflowName: string;
650
- runId: string;
651
- snapshot: WorkflowRunState_2;
652
- }): Promise<void>;
653
- loadWorkflowSnapshot({ workflowName, runId, }: {
654
- workflowName: string;
655
- runId: string;
656
- }): Promise<WorkflowRunState_2 | null>;
657
- getWorkflowRunById(args: {
658
- runId: string;
659
- workflowName?: string;
660
- }): Promise<{
661
- workflowName: string;
662
- runId: string;
663
- snapshot: any;
664
- createdAt: Date;
665
- updatedAt: Date;
666
- } | null>;
667
- getWorkflowRuns(args?: {
668
- namespace?: string;
669
- resourceId?: string;
670
- workflowName?: string;
671
- fromDate?: Date;
672
- toDate?: Date;
673
- limit?: number;
674
- offset?: number;
675
- }): Promise<WorkflowRuns_2>;
676
- }
677
-
678
- export declare function validateKeyTypes(keys: Record<string, any>, tableSchema: SchemaLike): void;
679
-
680
- export { }