@mastra/lance 0.0.0-new-scorer-api-20250801075530 → 0.0.0-new-button-export-20251219133013
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.
- package/CHANGELOG.md +1111 -3
- package/README.md +64 -7
- package/dist/index.cjs +1525 -1403
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1526 -1404
- package/dist/index.js.map +1 -1
- package/dist/storage/{domains/operations → db}/index.d.ts +21 -2
- package/dist/storage/db/index.d.ts.map +1 -0
- package/dist/storage/db/utils.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +23 -39
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +29 -9
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +28 -14
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +88 -109
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/filter.d.ts +5 -5
- package/dist/vector/index.d.ts +8 -5
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +29 -11
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -25
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/operations/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -34
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
- package/dist/storage/domains/utils.d.ts.map +0 -1
- package/eslint.config.js +0 -6
- package/src/index.ts +0 -2
- package/src/storage/domains/legacy-evals/index.ts +0 -156
- package/src/storage/domains/memory/index.ts +0 -947
- package/src/storage/domains/operations/index.ts +0 -489
- package/src/storage/domains/scores/index.ts +0 -221
- package/src/storage/domains/traces/index.ts +0 -212
- package/src/storage/domains/utils.ts +0 -158
- package/src/storage/domains/workflows/index.ts +0 -207
- package/src/storage/index.test.ts +0 -10
- package/src/storage/index.ts +0 -442
- package/src/vector/filter.test.ts +0 -295
- package/src/vector/filter.ts +0 -443
- package/src/vector/index.test.ts +0 -1493
- package/src/vector/index.ts +0 -941
- package/src/vector/types.ts +0 -16
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -5
- package/tsup.config.ts +0 -22
- package/vitest.config.ts +0 -11
- /package/dist/storage/{domains → db}/utils.d.ts +0 -0
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import {
|
|
2
|
+
import { MastraBase } from '@mastra/core/base';
|
|
3
3
|
import type { TABLE_NAMES, StorageColumn } from '@mastra/core/storage';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for standalone domain usage.
|
|
6
|
+
* Accepts an existing LanceDB Connection.
|
|
7
|
+
*
|
|
8
|
+
* Note: Creating a new LanceDB connection requires async `connect()`,
|
|
9
|
+
* so for standalone domain usage, you must create the connection first
|
|
10
|
+
* and pass it to the domain constructor.
|
|
11
|
+
*/
|
|
12
|
+
export type LanceDomainConfig = LanceDomainClientConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Pass an existing LanceDB connection
|
|
15
|
+
*/
|
|
16
|
+
export interface LanceDomainClientConfig {
|
|
17
|
+
client: Connection;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolves LanceDomainConfig to a LanceDB Connection.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveLanceConfig(config: LanceDomainConfig): Connection;
|
|
23
|
+
export declare class LanceDB extends MastraBase {
|
|
5
24
|
client: Connection;
|
|
6
25
|
constructor({ client }: {
|
|
7
26
|
client: Connection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,C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C,EAAE,CAqD7C;AAED,wBAAsB,cAAc,CAAC,EACnC,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,OAAO,CAAC,UAAU,CAAC,CA6CtB"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import type { Connection } from '@lancedb/lancedb';
|
|
2
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
|
-
import type {
|
|
2
|
+
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
4
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput } from '@mastra/core/storage';
|
|
5
|
+
import type { LanceDomainConfig } from '../../db/index.js';
|
|
7
6
|
export declare class StoreMemoryLance extends MemoryStorage {
|
|
7
|
+
#private;
|
|
8
8
|
private client;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
constructor(config: LanceDomainConfig);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
dangerouslyClearAll(): Promise<void>;
|
|
12
|
+
deleteMessages(messageIds: string[]): Promise<void>;
|
|
13
|
+
private escapeSql;
|
|
14
14
|
getThreadById({ threadId }: {
|
|
15
15
|
threadId: string;
|
|
16
16
|
}): Promise<StorageThreadType | null>;
|
|
17
|
-
getThreadsByResourceId({ resourceId }: {
|
|
18
|
-
resourceId: string;
|
|
19
|
-
}): Promise<StorageThreadType[]>;
|
|
20
17
|
/**
|
|
21
18
|
* Saves a thread to the database. This function doesn't overwrite existing threads.
|
|
22
19
|
* @param thread - The thread to save
|
|
@@ -33,27 +30,19 @@ export declare class StoreMemoryLance extends MemoryStorage {
|
|
|
33
30
|
deleteThread({ threadId }: {
|
|
34
31
|
threadId: string;
|
|
35
32
|
}): Promise<void>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
messages: MastraMessageV1[];
|
|
44
|
-
format?: undefined | 'v1';
|
|
45
|
-
}): Promise<MastraMessageV1[]>;
|
|
33
|
+
private normalizeMessage;
|
|
34
|
+
listMessagesById({ messageIds }: {
|
|
35
|
+
messageIds: string[];
|
|
36
|
+
}): Promise<{
|
|
37
|
+
messages: MastraDBMessage[];
|
|
38
|
+
}>;
|
|
39
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
46
40
|
saveMessages(args: {
|
|
47
|
-
messages:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
getThreadsByResourceIdPaginated(args: {
|
|
51
|
-
resourceId: string;
|
|
52
|
-
page?: number;
|
|
53
|
-
perPage?: number;
|
|
54
|
-
}): Promise<PaginationInfo & {
|
|
55
|
-
threads: StorageThreadType[];
|
|
41
|
+
messages: MastraDBMessage[];
|
|
42
|
+
}): Promise<{
|
|
43
|
+
messages: MastraDBMessage[];
|
|
56
44
|
}>;
|
|
45
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
57
46
|
/**
|
|
58
47
|
* Processes messages to include context messages based on withPreviousMessages and withNextMessages
|
|
59
48
|
* @param records - The sorted array of records to process
|
|
@@ -61,24 +50,19 @@ export declare class StoreMemoryLance extends MemoryStorage {
|
|
|
61
50
|
* @returns The processed array with context messages included
|
|
62
51
|
*/
|
|
63
52
|
private processMessagesWithContext;
|
|
64
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
65
|
-
format?: 'v1' | 'v2';
|
|
66
|
-
}): Promise<PaginationInfo & {
|
|
67
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
68
|
-
}>;
|
|
69
53
|
/**
|
|
70
|
-
* Parse message data from LanceDB record format to
|
|
54
|
+
* Parse message data from LanceDB record format to MastraDBMessage format
|
|
71
55
|
*/
|
|
72
56
|
private parseMessageData;
|
|
73
57
|
updateMessages(args: {
|
|
74
|
-
messages: Partial<Omit<
|
|
58
|
+
messages: Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
75
59
|
id: string;
|
|
76
60
|
content?: {
|
|
77
61
|
metadata?: MastraMessageContentV2['metadata'];
|
|
78
62
|
content?: MastraMessageContentV2['content'];
|
|
79
63
|
};
|
|
80
64
|
}[];
|
|
81
|
-
}): Promise<
|
|
65
|
+
}): Promise<MastraDBMessage[]>;
|
|
82
66
|
getResourceById({ resourceId }: {
|
|
83
67
|
resourceId: string;
|
|
84
68
|
}): Promise<StorageResourceType | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAmB,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAEL,aAAa,EAOd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mCAAmC,EACnC,oCAAoC,EACrC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,OAAO,CAAC,MAAM,CAAa;gBAGf,MAAM,EAAE,iBAAiB;IAO/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAYrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMpC,cAAc,CAAC,UAAU,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B,cAAc,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,GACnD;YACE,EAAE,EAAE,MAAM,CAAC;YACX,OAAO,CAAC,EAAE;gBAAE,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;gBAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAA;aAAE,CAAC;SAC1G,EAAE,CAAC;KACP,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAgGxB,eAAe,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAiG5F,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyB3F,cAAc,CAAC,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA+DjC"}
|
|
@@ -1,33 +1,45 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
1
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
3
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
3
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
4
|
+
import type { LanceDomainConfig } from '../../db/index.js';
|
|
5
5
|
export declare class StoreScoresLance extends ScoresStorage {
|
|
6
|
+
#private;
|
|
6
7
|
private client;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
saveScore(score:
|
|
8
|
+
constructor(config: LanceDomainConfig);
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
dangerouslyClearAll(): Promise<void>;
|
|
11
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
11
12
|
score: ScoreRowData;
|
|
12
13
|
}>;
|
|
13
14
|
getScoreById({ id }: {
|
|
14
15
|
id: string;
|
|
15
16
|
}): Promise<ScoreRowData | null>;
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* LanceDB-specific score row transformation.
|
|
19
|
+
*
|
|
20
|
+
* Note: This implementation does NOT use coreTransformScoreRow because:
|
|
21
|
+
* 1. LanceDB stores schema information in the table itself (requires async fetch)
|
|
22
|
+
* 2. Uses processResultWithTypeConversion utility for LanceDB-specific type handling
|
|
23
|
+
*/
|
|
24
|
+
private transformScoreRow;
|
|
25
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
17
26
|
scorerId: string;
|
|
18
27
|
pagination: StoragePagination;
|
|
28
|
+
entityId?: string;
|
|
29
|
+
entityType?: string;
|
|
30
|
+
source?: ScoringSource;
|
|
19
31
|
}): Promise<{
|
|
20
32
|
pagination: PaginationInfo;
|
|
21
33
|
scores: ScoreRowData[];
|
|
22
34
|
}>;
|
|
23
|
-
|
|
35
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
24
36
|
runId: string;
|
|
25
37
|
pagination: StoragePagination;
|
|
26
38
|
}): Promise<{
|
|
27
39
|
pagination: PaginationInfo;
|
|
28
40
|
scores: ScoreRowData[];
|
|
29
41
|
}>;
|
|
30
|
-
|
|
42
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
31
43
|
pagination: StoragePagination;
|
|
32
44
|
entityId: string;
|
|
33
45
|
entityType: string;
|
|
@@ -35,5 +47,13 @@ export declare class StoreScoresLance extends ScoresStorage {
|
|
|
35
47
|
pagination: PaginationInfo;
|
|
36
48
|
scores: ScoreRowData[];
|
|
37
49
|
}>;
|
|
50
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
51
|
+
traceId: string;
|
|
52
|
+
spanId: string;
|
|
53
|
+
pagination: StoragePagination;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
pagination: PaginationInfo;
|
|
56
|
+
scores: ScoreRowData[];
|
|
57
|
+
}>;
|
|
38
58
|
}
|
|
39
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAEnH,OAAO,EAEL,aAAa,EAKd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,OAAO,CAAC,MAAM,CAAa;gBAEf,MAAM,EAAE,iBAAiB;IAO/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAoEpE,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAwBxE;;;;;;OAMG;YACW,iBAAiB;IAUzB,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAqE7D,iBAAiB,CAAC,EACtB,KAAK,EACL,UAAU,GACX,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAiD7D,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAoD7D,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CAgDpE"}
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type {
|
|
2
|
+
import type { StorageListWorkflowRunsInput, WorkflowRuns, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
3
3
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
4
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
5
|
+
import type { LanceDomainConfig } from '../../db/index.js';
|
|
4
6
|
export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
7
|
+
#private;
|
|
5
8
|
client: Connection;
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
constructor(config: LanceDomainConfig);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
dangerouslyClearAll(): Promise<void>;
|
|
12
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
10
13
|
workflowName: string;
|
|
11
14
|
runId: string;
|
|
15
|
+
stepId: string;
|
|
16
|
+
result: StepResult<any, any, any, any>;
|
|
17
|
+
requestContext: Record<string, any>;
|
|
18
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
19
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
20
|
+
workflowName: string;
|
|
21
|
+
runId: string;
|
|
22
|
+
opts: UpdateWorkflowStateOptions;
|
|
23
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
24
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, createdAt, updatedAt, }: {
|
|
25
|
+
workflowName: string;
|
|
26
|
+
runId: string;
|
|
27
|
+
resourceId?: string;
|
|
12
28
|
snapshot: WorkflowRunState;
|
|
29
|
+
createdAt?: Date;
|
|
30
|
+
updatedAt?: Date;
|
|
13
31
|
}): Promise<void>;
|
|
14
32
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
15
33
|
workflowName: string;
|
|
@@ -25,14 +43,10 @@ export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
|
25
43
|
createdAt: Date;
|
|
26
44
|
updatedAt: Date;
|
|
27
45
|
} | null>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
toDate?: Date;
|
|
34
|
-
limit?: number;
|
|
35
|
-
offset?: number;
|
|
36
|
-
}): Promise<WorkflowRuns>;
|
|
46
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
47
|
+
runId: string;
|
|
48
|
+
workflowName: string;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
37
51
|
}
|
|
38
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAEV,4BAA4B,EAC5B,YAAY,EACZ,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AA8BlD,qBAAa,mBAAoB,SAAQ,gBAAgB;;IACvD,MAAM,EAAE,UAAU,CAAC;gBAEP,MAAM,EAAE,iBAAiB;IAO/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAWrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,qBAAqB,CAAC,EAC1B,YAAY,EACZ,KAAK,EACL,MAAM,EACN,MAAM,EACN,cAAc,GACf,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QAC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EAAE,IAAI,CAAC;KACjB,GAAG,IAAI,CAAC;IAyBH,qBAAqB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtG,gBAAgB,CAAC,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC;CAmFnF"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import type { ConnectionOptions } from '@lancedb/lancedb';
|
|
2
2
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
4
|
+
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
5
5
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
|
|
6
|
+
import type { PaginationInfo, WorkflowRuns, StoragePagination, StorageDomains, StorageResourceType, StorageListWorkflowRunsInput, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
7
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
8
|
+
export interface LanceStorageOptions {
|
|
9
|
+
/**
|
|
10
|
+
* When true, automatic initialization (table creation/migrations) is disabled.
|
|
11
|
+
* This is useful for CI/CD pipelines where you want to:
|
|
12
|
+
* 1. Run migrations explicitly during deployment (not at runtime)
|
|
13
|
+
* 2. Use different credentials for schema changes vs runtime operations
|
|
14
|
+
*
|
|
15
|
+
* When disableInit is true:
|
|
16
|
+
* - The storage will not automatically create/alter tables on first use
|
|
17
|
+
* - You must call `storage.init()` explicitly in your CI/CD scripts
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // In CI/CD script:
|
|
21
|
+
* const storage = await LanceStorage.create('id', 'name', '/path/to/db', undefined, { disableInit: false });
|
|
22
|
+
* await storage.init(); // Explicitly run migrations
|
|
23
|
+
*
|
|
24
|
+
* // In runtime application:
|
|
25
|
+
* const storage = await LanceStorage.create('id', 'name', '/path/to/db', undefined, { disableInit: true });
|
|
26
|
+
* // No auto-init, tables must already exist
|
|
27
|
+
*/
|
|
28
|
+
disableInit?: boolean;
|
|
29
|
+
}
|
|
9
30
|
export declare class LanceStorage extends MastraStorage {
|
|
10
31
|
stores: StorageDomains;
|
|
11
32
|
private lanceClient;
|
|
12
33
|
/**
|
|
13
34
|
* Creates a new instance of LanceStorage
|
|
35
|
+
* @param id The unique identifier for this storage instance
|
|
36
|
+
* @param name The name for this storage instance
|
|
14
37
|
* @param uri The URI to connect to LanceDB
|
|
15
|
-
* @param
|
|
38
|
+
* @param connectionOptions connection options for LanceDB
|
|
39
|
+
* @param storageOptions storage options including disableInit
|
|
16
40
|
*
|
|
17
41
|
* Usage:
|
|
18
42
|
*
|
|
19
43
|
* Connect to a local database
|
|
20
44
|
* ```ts
|
|
21
|
-
* const store = await LanceStorage.create('/path/to/db');
|
|
45
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db');
|
|
22
46
|
* ```
|
|
23
47
|
*
|
|
24
48
|
* Connect to a LanceDB cloud database
|
|
25
49
|
* ```ts
|
|
26
|
-
* const store = await LanceStorage.create('db://host:port');
|
|
50
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 'db://host:port');
|
|
27
51
|
* ```
|
|
28
52
|
*
|
|
29
53
|
* Connect to a cloud database
|
|
30
54
|
* ```ts
|
|
31
|
-
* const store = await LanceStorage.create('s3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
55
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 's3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* Disable auto-init for runtime (after CI/CD has run migrations)
|
|
59
|
+
* ```ts
|
|
60
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db', undefined, { disableInit: true });
|
|
32
61
|
* ```
|
|
33
62
|
*/
|
|
34
|
-
static create(name: string, uri: string,
|
|
63
|
+
static create(id: string, name: string, uri: string, connectionOptions?: ConnectionOptions, storageOptions?: LanceStorageOptions): Promise<LanceStorage>;
|
|
35
64
|
/**
|
|
36
65
|
* @internal
|
|
37
|
-
* Private constructor to enforce using the create factory method
|
|
66
|
+
* Private constructor to enforce using the create factory method.
|
|
67
|
+
* Note: stores is initialized in create() after the lanceClient is connected.
|
|
38
68
|
*/
|
|
39
69
|
private constructor();
|
|
40
|
-
createTable({ tableName, schema, }: {
|
|
41
|
-
tableName: TABLE_NAMES;
|
|
42
|
-
schema: Record<string, StorageColumn>;
|
|
43
|
-
}): Promise<void>;
|
|
44
|
-
dropTable({ tableName }: {
|
|
45
|
-
tableName: TABLE_NAMES;
|
|
46
|
-
}): Promise<void>;
|
|
47
|
-
alterTable({ tableName, schema, ifNotExists, }: {
|
|
48
|
-
tableName: TABLE_NAMES;
|
|
49
|
-
schema: Record<string, StorageColumn>;
|
|
50
|
-
ifNotExists: string[];
|
|
51
|
-
}): Promise<void>;
|
|
52
|
-
clearTable({ tableName }: {
|
|
53
|
-
tableName: TABLE_NAMES;
|
|
54
|
-
}): Promise<void>;
|
|
55
|
-
insert({ tableName, record }: {
|
|
56
|
-
tableName: TABLE_NAMES;
|
|
57
|
-
record: Record<string, any>;
|
|
58
|
-
}): Promise<void>;
|
|
59
|
-
batchInsert({ tableName, records }: {
|
|
60
|
-
tableName: TABLE_NAMES;
|
|
61
|
-
records: Record<string, any>[];
|
|
62
|
-
}): Promise<void>;
|
|
63
|
-
load({ tableName, keys }: {
|
|
64
|
-
tableName: TABLE_NAMES;
|
|
65
|
-
keys: Record<string, any>;
|
|
66
|
-
}): Promise<any>;
|
|
67
70
|
getThreadById({ threadId }: {
|
|
68
71
|
threadId: string;
|
|
69
72
|
}): Promise<StorageThreadType | null>;
|
|
70
|
-
getThreadsByResourceId({ resourceId }: {
|
|
71
|
-
resourceId: string;
|
|
72
|
-
}): Promise<StorageThreadType[]>;
|
|
73
73
|
/**
|
|
74
74
|
* Saves a thread to the database. This function doesn't overwrite existing threads.
|
|
75
75
|
* @param thread - The thread to save
|
|
@@ -86,12 +86,14 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
86
86
|
deleteThread({ threadId }: {
|
|
87
87
|
threadId: string;
|
|
88
88
|
}): Promise<void>;
|
|
89
|
+
deleteMessages(messageIds: string[]): Promise<void>;
|
|
89
90
|
get supports(): {
|
|
90
91
|
selectByIncludeResourceScope: boolean;
|
|
91
92
|
resourceWorkingMemory: boolean;
|
|
92
93
|
hasColumn: boolean;
|
|
93
94
|
createTable: boolean;
|
|
94
95
|
deleteMessages: boolean;
|
|
96
|
+
listScoresBySpan: boolean;
|
|
95
97
|
};
|
|
96
98
|
getResourceById({ resourceId }: {
|
|
97
99
|
resourceId: string;
|
|
@@ -111,77 +113,26 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
111
113
|
* @returns The processed array with context messages included
|
|
112
114
|
*/
|
|
113
115
|
private processMessagesWithContext;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}): Promise<
|
|
117
|
-
|
|
118
|
-
format: 'v2';
|
|
119
|
-
}): Promise<MastraMessageV2[]>;
|
|
120
|
-
saveMessages(args: {
|
|
121
|
-
messages: MastraMessageV1[];
|
|
122
|
-
format?: undefined | 'v1';
|
|
123
|
-
}): Promise<MastraMessageV1[]>;
|
|
124
|
-
saveMessages(args: {
|
|
125
|
-
messages: MastraMessageV2[];
|
|
126
|
-
format: 'v2';
|
|
127
|
-
}): Promise<MastraMessageV2[]>;
|
|
128
|
-
getThreadsByResourceIdPaginated(args: {
|
|
129
|
-
resourceId: string;
|
|
130
|
-
page: number;
|
|
131
|
-
perPage: number;
|
|
132
|
-
}): Promise<PaginationInfo & {
|
|
133
|
-
threads: StorageThreadType[];
|
|
116
|
+
listMessagesById({ messageIds }: {
|
|
117
|
+
messageIds: string[];
|
|
118
|
+
}): Promise<{
|
|
119
|
+
messages: MastraDBMessage[];
|
|
134
120
|
}>;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}): Promise<
|
|
138
|
-
messages:
|
|
121
|
+
saveMessages(args: {
|
|
122
|
+
messages: MastraDBMessage[];
|
|
123
|
+
}): Promise<{
|
|
124
|
+
messages: MastraDBMessage[];
|
|
139
125
|
}>;
|
|
140
126
|
updateMessages(_args: {
|
|
141
|
-
messages: Partial<Omit<
|
|
127
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
142
128
|
id: string;
|
|
143
129
|
content?: {
|
|
144
130
|
metadata?: MastraMessageContentV2['metadata'];
|
|
145
131
|
content?: MastraMessageContentV2['content'];
|
|
146
132
|
};
|
|
147
|
-
}[];
|
|
148
|
-
}): Promise<
|
|
149
|
-
|
|
150
|
-
traceId: string;
|
|
151
|
-
}): Promise<TraceType>;
|
|
152
|
-
getTraces(args: {
|
|
153
|
-
name?: string;
|
|
154
|
-
scope?: string;
|
|
155
|
-
page: number;
|
|
156
|
-
perPage: number;
|
|
157
|
-
attributes?: Record<string, string>;
|
|
158
|
-
}): Promise<Trace[]>;
|
|
159
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
160
|
-
traces: Trace[];
|
|
161
|
-
}>;
|
|
162
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
163
|
-
getEvals(options: {
|
|
164
|
-
agentName?: string;
|
|
165
|
-
type?: 'test' | 'live';
|
|
166
|
-
page?: number;
|
|
167
|
-
perPage?: number;
|
|
168
|
-
fromDate?: Date;
|
|
169
|
-
toDate?: Date;
|
|
170
|
-
dateRange?: {
|
|
171
|
-
start?: Date;
|
|
172
|
-
end?: Date;
|
|
173
|
-
};
|
|
174
|
-
}): Promise<PaginationInfo & {
|
|
175
|
-
evals: EvalRow[];
|
|
176
|
-
}>;
|
|
177
|
-
getWorkflowRuns(args?: {
|
|
178
|
-
namespace?: string;
|
|
179
|
-
workflowName?: string;
|
|
180
|
-
fromDate?: Date;
|
|
181
|
-
toDate?: Date;
|
|
182
|
-
limit?: number;
|
|
183
|
-
offset?: number;
|
|
184
|
-
}): Promise<WorkflowRuns>;
|
|
133
|
+
})[];
|
|
134
|
+
}): Promise<MastraDBMessage[]>;
|
|
135
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
185
136
|
getWorkflowRunById(args: {
|
|
186
137
|
runId: string;
|
|
187
138
|
workflowName?: string;
|
|
@@ -192,9 +143,26 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
192
143
|
createdAt: Date;
|
|
193
144
|
updatedAt: Date;
|
|
194
145
|
} | null>;
|
|
195
|
-
|
|
146
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
147
|
+
runId: string;
|
|
148
|
+
workflowName: string;
|
|
149
|
+
}): Promise<void>;
|
|
150
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
196
151
|
workflowName: string;
|
|
197
152
|
runId: string;
|
|
153
|
+
stepId: string;
|
|
154
|
+
result: StepResult<any, any, any, any>;
|
|
155
|
+
requestContext: Record<string, any>;
|
|
156
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
157
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
158
|
+
workflowName: string;
|
|
159
|
+
runId: string;
|
|
160
|
+
opts: UpdateWorkflowStateOptions;
|
|
161
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
162
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
163
|
+
workflowName: string;
|
|
164
|
+
runId: string;
|
|
165
|
+
resourceId?: string;
|
|
198
166
|
snapshot: WorkflowRunState;
|
|
199
167
|
}): Promise<void>;
|
|
200
168
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
@@ -204,24 +172,27 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
204
172
|
getScoreById({ id: _id }: {
|
|
205
173
|
id: string;
|
|
206
174
|
}): Promise<ScoreRowData | null>;
|
|
207
|
-
|
|
175
|
+
listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
208
176
|
scorerId: string;
|
|
209
177
|
pagination: StoragePagination;
|
|
178
|
+
source?: ScoringSource;
|
|
179
|
+
entityId?: string;
|
|
180
|
+
entityType?: string;
|
|
210
181
|
}): Promise<{
|
|
211
182
|
pagination: PaginationInfo;
|
|
212
183
|
scores: ScoreRowData[];
|
|
213
184
|
}>;
|
|
214
|
-
saveScore(
|
|
185
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
215
186
|
score: ScoreRowData;
|
|
216
187
|
}>;
|
|
217
|
-
|
|
188
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
218
189
|
runId: string;
|
|
219
190
|
pagination: StoragePagination;
|
|
220
191
|
}): Promise<{
|
|
221
192
|
pagination: PaginationInfo;
|
|
222
193
|
scores: ScoreRowData[];
|
|
223
194
|
}>;
|
|
224
|
-
|
|
195
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
225
196
|
pagination: StoragePagination;
|
|
226
197
|
entityId: string;
|
|
227
198
|
entityType: string;
|
|
@@ -229,5 +200,13 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
229
200
|
pagination: PaginationInfo;
|
|
230
201
|
scores: ScoreRowData[];
|
|
231
202
|
}>;
|
|
203
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
204
|
+
traceId: string;
|
|
205
|
+
spanId: string;
|
|
206
|
+
pagination: StoragePagination;
|
|
207
|
+
}): Promise<{
|
|
208
|
+
pagination: PaginationInfo;
|
|
209
|
+
scores: ScoreRowData[];
|
|
210
|
+
}>;
|
|
232
211
|
}
|
|
233
212
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAwB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK3E,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,YAAa,SAAQ,aAAa;IAC7C,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,WAAW,CAAc;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;WACiB,MAAM,CACxB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,cAAc,CAAC,EAAE,mBAAmB,GACnC,OAAO,CAAC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