@mastra/lance 0.0.0-update-scorers-api-20250801170445 → 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.
- package/CHANGELOG.md +157 -3
- package/README.md +3 -3
- package/dist/index.cjs +109 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +109 -20
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +10 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +5 -2
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/traces/index.d.ts +1 -1
- package/dist/storage/domains/workflows/index.d.ts +19 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +32 -3
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +3 -3
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/storage/domains/memory/index.ts +71 -18
- package/src/storage/domains/scores/index.ts +29 -7
- package/src/storage/domains/workflows/index.ts +39 -1
- package/src/storage/index.ts +55 -3
- package/src/vector/index.ts +2 -2
- package/tsup.config.ts +2 -7
|
@@ -3,7 +3,7 @@ import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
|
3
3
|
import type { MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastra/core/memory';
|
|
4
4
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
5
5
|
import type { PaginationInfo, StorageGetMessagesArg, StorageResourceType } from '@mastra/core/storage';
|
|
6
|
-
import type { StoreOperationsLance } from '../operations';
|
|
6
|
+
import type { StoreOperationsLance } from '../operations/index.js';
|
|
7
7
|
export declare class StoreMemoryLance extends MemoryStorage {
|
|
8
8
|
private client;
|
|
9
9
|
private operations;
|
|
@@ -33,12 +33,21 @@ export declare class StoreMemoryLance extends MemoryStorage {
|
|
|
33
33
|
deleteThread({ threadId }: {
|
|
34
34
|
threadId: string;
|
|
35
35
|
}): Promise<void>;
|
|
36
|
+
private normalizeMessage;
|
|
36
37
|
getMessages(args: StorageGetMessagesArg & {
|
|
37
38
|
format?: 'v1';
|
|
38
39
|
}): Promise<MastraMessageV1[]>;
|
|
39
40
|
getMessages(args: StorageGetMessagesArg & {
|
|
40
41
|
format: 'v2';
|
|
41
42
|
}): Promise<MastraMessageV2[]>;
|
|
43
|
+
getMessagesById({ messageIds, format, }: {
|
|
44
|
+
messageIds: string[];
|
|
45
|
+
format: 'v1';
|
|
46
|
+
}): Promise<MastraMessageV1[]>;
|
|
47
|
+
getMessagesById({ messageIds, format, }: {
|
|
48
|
+
messageIds: string[];
|
|
49
|
+
format?: 'v2';
|
|
50
|
+
}): Promise<MastraMessageV2[]>;
|
|
42
51
|
saveMessages(args: {
|
|
43
52
|
messages: MastraMessageV1[];
|
|
44
53
|
format?: undefined | 'v1';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EACL,aAAa,EAKd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACvG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,UAAU,CAAuB;gBAC7B,EAAE,MAAM,EAAE,UAAU,EA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AW,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,5 +1,5 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
2
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
3
3
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
5
5
|
export declare class StoreScoresLance extends ScoresStorage {
|
|
@@ -13,9 +13,12 @@ export declare class StoreScoresLance extends ScoresStorage {
|
|
|
13
13
|
getScoreById({ id }: {
|
|
14
14
|
id: string;
|
|
15
15
|
}): Promise<ScoreRowData | null>;
|
|
16
|
-
getScoresByScorerId({ scorerId, pagination, }: {
|
|
16
|
+
getScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
17
17
|
scorerId: string;
|
|
18
18
|
pagination: StoragePagination;
|
|
19
|
+
entityId?: string;
|
|
20
|
+
entityType?: string;
|
|
21
|
+
source?: ScoringSource;
|
|
19
22
|
}): Promise<{
|
|
20
23
|
pagination: PaginationInfo;
|
|
21
24
|
scores: ScoreRowData[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAiB,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9E,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,OAAO,CAAC,MAAM,CAAa;gBACf,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,UAAU,CAAA;KAAE;IAKxC,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IA0ChE,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAyBlE,mBAAmB,CAAC,EACxB,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;IAwD7D,gBAAgB,CAAC,EACrB,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;IAqC7D,mBAAmB,CAAC,EACxB,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;CA0CpE"}
|
|
@@ -3,7 +3,7 @@ import type { TraceType } from '@mastra/core/memory';
|
|
|
3
3
|
import { TracesStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { PaginationInfo, StorageGetTracesPaginatedArg } from '@mastra/core/storage';
|
|
5
5
|
import type { Trace } from '@mastra/core/telemetry';
|
|
6
|
-
import type { StoreOperationsLance } from '../operations';
|
|
6
|
+
import type { StoreOperationsLance } from '../operations/index.js';
|
|
7
7
|
export declare class StoreTracesLance extends TracesStorage {
|
|
8
8
|
private client;
|
|
9
9
|
private operations;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type { WorkflowRunState, WorkflowRuns } from '@mastra/core';
|
|
2
|
+
import type { StepResult, WorkflowRunState, WorkflowRuns } from '@mastra/core';
|
|
3
3
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
4
4
|
export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
5
5
|
client: Connection;
|
|
6
6
|
constructor({ client }: {
|
|
7
7
|
client: Connection;
|
|
8
8
|
});
|
|
9
|
+
updateWorkflowResults({}: {
|
|
10
|
+
workflowName: string;
|
|
11
|
+
runId: string;
|
|
12
|
+
stepId: string;
|
|
13
|
+
result: StepResult<any, any, any, any>;
|
|
14
|
+
runtimeContext: Record<string, any>;
|
|
15
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
16
|
+
updateWorkflowState({}: {
|
|
17
|
+
workflowName: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
opts: {
|
|
20
|
+
status: string;
|
|
21
|
+
result?: StepResult<any, any, any, any>;
|
|
22
|
+
error?: string;
|
|
23
|
+
suspendedPaths?: Record<string, number[]>;
|
|
24
|
+
waitingPaths?: Record<string, number[]>;
|
|
25
|
+
};
|
|
26
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
9
27
|
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
10
28
|
workflowName: string;
|
|
11
29
|
runId: string;
|
|
@@ -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;AACnD,OAAO,KAAK,
|
|
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;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,EAAuC,gBAAgB,EAAE,MAAM,s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Y,EACZ,KAAK,GACN,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAmB9B,kBAAkB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAChF,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,GAAG,CAAC;QACd,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;KACjB,GAAG,IAAI,CAAC;IAyBH,eAAe,CAAC,IAAI,CAAC,EAAE;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,MAAM,CAAC,EAAE,IAAI,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,YAAY,CAAC;CA4D1B"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ConnectionOptions } from '@lancedb/lancedb';
|
|
2
2
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
3
|
import type { MastraMessageV1, MastraMessageV2, StorageThreadType, TraceType } from '@mastra/core/memory';
|
|
4
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
4
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
5
5
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
6
|
import type { TABLE_NAMES, PaginationInfo, StorageGetMessagesArg, StorageColumn, EvalRow, WorkflowRuns, StoragePagination, StorageDomains, StorageGetTracesPaginatedArg, StorageResourceType } from '@mastra/core/storage';
|
|
7
7
|
import type { Trace } from '@mastra/core/telemetry';
|
|
8
|
-
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
8
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
9
9
|
export declare class LanceStorage extends MastraStorage {
|
|
10
10
|
stores: StorageDomains;
|
|
11
11
|
private lanceClient;
|
|
@@ -117,6 +117,14 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
117
117
|
getMessages(args: StorageGetMessagesArg & {
|
|
118
118
|
format: 'v2';
|
|
119
119
|
}): Promise<MastraMessageV2[]>;
|
|
120
|
+
getMessagesById({ messageIds, format }: {
|
|
121
|
+
messageIds: string[];
|
|
122
|
+
format: 'v1';
|
|
123
|
+
}): Promise<MastraMessageV1[]>;
|
|
124
|
+
getMessagesById({ messageIds, format }: {
|
|
125
|
+
messageIds: string[];
|
|
126
|
+
format?: 'v2';
|
|
127
|
+
}): Promise<MastraMessageV2[]>;
|
|
120
128
|
saveMessages(args: {
|
|
121
129
|
messages: MastraMessageV1[];
|
|
122
130
|
format?: undefined | 'v1';
|
|
@@ -192,6 +200,24 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
192
200
|
createdAt: Date;
|
|
193
201
|
updatedAt: Date;
|
|
194
202
|
} | null>;
|
|
203
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext, }: {
|
|
204
|
+
workflowName: string;
|
|
205
|
+
runId: string;
|
|
206
|
+
stepId: string;
|
|
207
|
+
result: StepResult<any, any, any, any>;
|
|
208
|
+
runtimeContext: Record<string, any>;
|
|
209
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
210
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
211
|
+
workflowName: string;
|
|
212
|
+
runId: string;
|
|
213
|
+
opts: {
|
|
214
|
+
status: string;
|
|
215
|
+
result?: StepResult<any, any, any, any>;
|
|
216
|
+
error?: string;
|
|
217
|
+
suspendedPaths?: Record<string, number[]>;
|
|
218
|
+
waitingPaths?: Record<string, number[]>;
|
|
219
|
+
};
|
|
220
|
+
}): Promise<WorkflowRunState | undefined>;
|
|
195
221
|
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
196
222
|
workflowName: string;
|
|
197
223
|
runId: string;
|
|
@@ -204,9 +230,12 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
204
230
|
getScoreById({ id: _id }: {
|
|
205
231
|
id: string;
|
|
206
232
|
}): Promise<ScoreRowData | null>;
|
|
207
|
-
getScoresByScorerId({ scorerId, pagination, }: {
|
|
233
|
+
getScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
208
234
|
scorerId: string;
|
|
209
235
|
pagination: StoragePagination;
|
|
236
|
+
source?: ScoringSource;
|
|
237
|
+
entityId?: string;
|
|
238
|
+
entityType?: string;
|
|
210
239
|
}): Promise<{
|
|
211
240
|
pagination: PaginationInfo;
|
|
212
241
|
scores: ScoreRowData[];
|
|
@@ -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,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
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,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,E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D,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;CAGpE"}
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ConnectionOptions, CreateTableOptions, Table, TableLike } from '@lancedb/lancedb';
|
|
2
|
-
import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult, QueryVectorParams, UpdateVectorParams, UpsertVectorParams } from '@mastra/core';
|
|
2
|
+
import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult, QueryVectorParams, UpdateVectorParams, UpsertVectorParams } from '@mastra/core/vector';
|
|
3
3
|
import { MastraVector } from '@mastra/core/vector';
|
|
4
|
-
import type { LanceVectorFilter } from './filter';
|
|
5
|
-
import type { IndexConfig } from './types';
|
|
4
|
+
import type { LanceVectorFilter } from './filter.js';
|
|
5
|
+
import type { IndexConfig } from './types.js';
|
|
6
6
|
interface LanceCreateIndexParams extends CreateIndexParams {
|
|
7
7
|
indexConfig?: LanceIndexConfig;
|
|
8
8
|
tableName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG5G,OAAO,KAAK,EACV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-1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/lance",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-vector-query-tool-provider-options-20250828222356",
|
|
4
4
|
"description": "Lance provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"require": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.cjs"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@lancedb/lancedb": "^0.
|
|
22
|
+
"@lancedb/lancedb": "^0.21.2",
|
|
23
23
|
"apache-arrow": "^18.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
"tsup": "^8.5.0",
|
|
30
30
|
"typescript": "^5.8.3",
|
|
31
31
|
"vitest": "^3.2.4",
|
|
32
|
-
"@internal/storage-test-utils": "0.0.
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
32
|
+
"@internal/storage-test-utils": "0.0.30",
|
|
33
|
+
"@internal/lint": "0.0.0-vector-query-tool-provider-options-20250828222356",
|
|
34
|
+
"@mastra/core": "0.0.0-vector-query-tool-provider-options-20250828222356",
|
|
35
|
+
"@internal/types-builder": "0.0.0-vector-query-tool-provider-options-20250828222356"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
|
-
"@mastra/core": "0.0.0-
|
|
38
|
+
"@mastra/core": "0.0.0-vector-query-tool-provider-options-20250828222356"
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"build": "tsup --silent --config tsup.config.ts",
|
|
@@ -185,6 +185,24 @@ export class StoreMemoryLance extends MemoryStorage {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
private normalizeMessage(message: any): MastraMessageV1 | MastraMessageV2 {
|
|
189
|
+
const { thread_id, ...rest } = message;
|
|
190
|
+
return {
|
|
191
|
+
...rest,
|
|
192
|
+
threadId: thread_id,
|
|
193
|
+
content:
|
|
194
|
+
typeof message.content === 'string'
|
|
195
|
+
? (() => {
|
|
196
|
+
try {
|
|
197
|
+
return JSON.parse(message.content);
|
|
198
|
+
} catch {
|
|
199
|
+
return message.content;
|
|
200
|
+
}
|
|
201
|
+
})()
|
|
202
|
+
: message.content,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
188
206
|
public async getMessages(args: StorageGetMessagesArg & { format?: 'v1' }): Promise<MastraMessageV1[]>;
|
|
189
207
|
public async getMessages(args: StorageGetMessagesArg & { format: 'v2' }): Promise<MastraMessageV2[]>;
|
|
190
208
|
public async getMessages({
|
|
@@ -241,24 +259,8 @@ export class StoreMemoryLance extends MemoryStorage {
|
|
|
241
259
|
allRecords,
|
|
242
260
|
await getTableSchema({ tableName: TABLE_MESSAGES, client: this.client }),
|
|
243
261
|
);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return {
|
|
247
|
-
...rest,
|
|
248
|
-
threadId: thread_id,
|
|
249
|
-
content:
|
|
250
|
-
typeof msg.content === 'string'
|
|
251
|
-
? (() => {
|
|
252
|
-
try {
|
|
253
|
-
return JSON.parse(msg.content);
|
|
254
|
-
} catch {
|
|
255
|
-
return msg.content;
|
|
256
|
-
}
|
|
257
|
-
})()
|
|
258
|
-
: msg.content,
|
|
259
|
-
};
|
|
260
|
-
});
|
|
261
|
-
const list = new MessageList({ threadId, resourceId }).add(normalized, 'memory');
|
|
262
|
+
|
|
263
|
+
const list = new MessageList({ threadId, resourceId }).add(messages.map(this.normalizeMessage), 'memory');
|
|
262
264
|
if (format === 'v2') return list.get.all.v2();
|
|
263
265
|
return list.get.all.v1();
|
|
264
266
|
} catch (error: any) {
|
|
@@ -273,6 +275,57 @@ export class StoreMemoryLance extends MemoryStorage {
|
|
|
273
275
|
}
|
|
274
276
|
}
|
|
275
277
|
|
|
278
|
+
public async getMessagesById({
|
|
279
|
+
messageIds,
|
|
280
|
+
format,
|
|
281
|
+
}: {
|
|
282
|
+
messageIds: string[];
|
|
283
|
+
format: 'v1';
|
|
284
|
+
}): Promise<MastraMessageV1[]>;
|
|
285
|
+
public async getMessagesById({
|
|
286
|
+
messageIds,
|
|
287
|
+
format,
|
|
288
|
+
}: {
|
|
289
|
+
messageIds: string[];
|
|
290
|
+
format?: 'v2';
|
|
291
|
+
}): Promise<MastraMessageV2[]>;
|
|
292
|
+
public async getMessagesById({
|
|
293
|
+
messageIds,
|
|
294
|
+
format,
|
|
295
|
+
}: {
|
|
296
|
+
messageIds: string[];
|
|
297
|
+
format?: 'v1' | 'v2';
|
|
298
|
+
}): Promise<MastraMessageV1[] | MastraMessageV2[]> {
|
|
299
|
+
if (messageIds.length === 0) return [];
|
|
300
|
+
try {
|
|
301
|
+
const table = await this.client.openTable(TABLE_MESSAGES);
|
|
302
|
+
|
|
303
|
+
const quotedIds = messageIds.map(id => `'${id}'`).join(', ');
|
|
304
|
+
const allRecords = await table.query().where(`id IN (${quotedIds})`).toArray();
|
|
305
|
+
|
|
306
|
+
const messages = processResultWithTypeConversion(
|
|
307
|
+
allRecords,
|
|
308
|
+
await getTableSchema({ tableName: TABLE_MESSAGES, client: this.client }),
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
const list = new MessageList().add(messages.map(this.normalizeMessage), 'memory');
|
|
312
|
+
if (format === `v1`) return list.get.all.v1();
|
|
313
|
+
return list.get.all.v2();
|
|
314
|
+
} catch (error: any) {
|
|
315
|
+
throw new MastraError(
|
|
316
|
+
{
|
|
317
|
+
id: 'LANCE_STORE_GET_MESSAGES_BY_ID_FAILED',
|
|
318
|
+
domain: ErrorDomain.STORAGE,
|
|
319
|
+
category: ErrorCategory.THIRD_PARTY,
|
|
320
|
+
details: {
|
|
321
|
+
messageIds: JSON.stringify(messageIds),
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
error,
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
276
329
|
async saveMessages(args: { messages: MastraMessageV1[]; format?: undefined | 'v1' }): Promise<MastraMessageV1[]>;
|
|
277
330
|
async saveMessages(args: { messages: MastraMessageV2[]; format: 'v2' }): Promise<MastraMessageV2[]>;
|
|
278
331
|
async saveMessages(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
2
|
import { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';
|
|
3
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
3
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
4
4
|
import { ScoresStorage, TABLE_SCORERS } from '@mastra/core/storage';
|
|
5
5
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
6
6
|
import { getTableSchema, processResultWithTypeConversion } from '../utils';
|
|
@@ -14,6 +14,7 @@ export class StoreScoresLance extends ScoresStorage {
|
|
|
14
14
|
|
|
15
15
|
async saveScore(score: ScoreRowData): Promise<{ score: ScoreRowData }> {
|
|
16
16
|
try {
|
|
17
|
+
const id = crypto.randomUUID();
|
|
17
18
|
const table = await this.client.openTable(TABLE_SCORERS);
|
|
18
19
|
// Fetch schema fields for mastra_scorers
|
|
19
20
|
const schema = await getTableSchema({ tableName: TABLE_SCORERS, client: this.client });
|
|
@@ -36,8 +37,7 @@ export class StoreScoresLance extends ScoresStorage {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
filteredScore.id = id;
|
|
41
41
|
await table.add([filteredScore], { mode: 'append' });
|
|
42
42
|
return { score };
|
|
43
43
|
} catch (error: any) {
|
|
@@ -82,24 +82,46 @@ export class StoreScoresLance extends ScoresStorage {
|
|
|
82
82
|
async getScoresByScorerId({
|
|
83
83
|
scorerId,
|
|
84
84
|
pagination,
|
|
85
|
+
entityId,
|
|
86
|
+
entityType,
|
|
87
|
+
source,
|
|
85
88
|
}: {
|
|
86
89
|
scorerId: string;
|
|
87
90
|
pagination: StoragePagination;
|
|
91
|
+
entityId?: string;
|
|
92
|
+
entityType?: string;
|
|
93
|
+
source?: ScoringSource;
|
|
88
94
|
}): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }> {
|
|
89
95
|
try {
|
|
90
96
|
const table = await this.client.openTable(TABLE_SCORERS);
|
|
91
97
|
// Use zero-based pagination (default page = 0)
|
|
92
98
|
const { page = 0, perPage = 10 } = pagination || {};
|
|
93
99
|
const offset = page * perPage;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
|
|
101
|
+
let query = table.query().where(`\`scorerId\` = '${scorerId}'`);
|
|
102
|
+
|
|
103
|
+
if (source) {
|
|
104
|
+
query = query.where(`\`source\` = '${source}'`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (entityId) {
|
|
108
|
+
query = query.where(`\`entityId\` = '${entityId}'`);
|
|
109
|
+
}
|
|
110
|
+
if (entityType) {
|
|
111
|
+
query = query.where(`\`entityType\` = '${entityType}'`);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
query = query.limit(perPage);
|
|
97
115
|
if (offset > 0) query.offset(offset);
|
|
98
116
|
const records = await query.toArray();
|
|
99
117
|
const schema = await getTableSchema({ tableName: TABLE_SCORERS, client: this.client });
|
|
100
118
|
const scores = processResultWithTypeConversion(records, schema) as ScoreRowData[];
|
|
101
119
|
|
|
102
|
-
|
|
120
|
+
let totalQuery = table.query().where(`\`scorerId\` = '${scorerId}'`);
|
|
121
|
+
if (source) {
|
|
122
|
+
totalQuery = totalQuery.where(`\`source\` = '${source}'`);
|
|
123
|
+
}
|
|
124
|
+
const allRecords = await totalQuery.toArray();
|
|
103
125
|
const total = allRecords.length;
|
|
104
126
|
|
|
105
127
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type {
|
|
2
|
+
import type { StepResult, WorkflowRunState, WorkflowRuns } from '@mastra/core';
|
|
3
3
|
import { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';
|
|
4
|
+
import type { WorkflowRun } from '@mastra/core/storage';
|
|
4
5
|
import { ensureDate, TABLE_WORKFLOW_SNAPSHOT, WorkflowsStorage } from '@mastra/core/storage';
|
|
5
6
|
|
|
6
7
|
function parseWorkflowRun(row: any): WorkflowRun {
|
|
@@ -31,6 +32,43 @@ export class StoreWorkflowsLance extends WorkflowsStorage {
|
|
|
31
32
|
this.client = client;
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
updateWorkflowResults(
|
|
36
|
+
{
|
|
37
|
+
// workflowName,
|
|
38
|
+
// runId,
|
|
39
|
+
// stepId,
|
|
40
|
+
// result,
|
|
41
|
+
// runtimeContext,
|
|
42
|
+
}: {
|
|
43
|
+
workflowName: string;
|
|
44
|
+
runId: string;
|
|
45
|
+
stepId: string;
|
|
46
|
+
result: StepResult<any, any, any, any>;
|
|
47
|
+
runtimeContext: Record<string, any>;
|
|
48
|
+
},
|
|
49
|
+
): Promise<Record<string, StepResult<any, any, any, any>>> {
|
|
50
|
+
throw new Error('Method not implemented.');
|
|
51
|
+
}
|
|
52
|
+
updateWorkflowState(
|
|
53
|
+
{
|
|
54
|
+
// workflowName,
|
|
55
|
+
// runId,
|
|
56
|
+
// opts,
|
|
57
|
+
}: {
|
|
58
|
+
workflowName: string;
|
|
59
|
+
runId: string;
|
|
60
|
+
opts: {
|
|
61
|
+
status: string;
|
|
62
|
+
result?: StepResult<any, any, any, any>;
|
|
63
|
+
error?: string;
|
|
64
|
+
suspendedPaths?: Record<string, number[]>;
|
|
65
|
+
waitingPaths?: Record<string, number[]>;
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
): Promise<WorkflowRunState | undefined> {
|
|
69
|
+
throw new Error('Method not implemented.');
|
|
70
|
+
}
|
|
71
|
+
|
|
34
72
|
async persistWorkflowSnapshot({
|
|
35
73
|
workflowName,
|
|
36
74
|
runId,
|
package/src/storage/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Connection, ConnectionOptions } from '@lancedb/lancedb';
|
|
|
3
3
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
4
4
|
import { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';
|
|
5
5
|
import type { MastraMessageV1, MastraMessageV2, StorageThreadType, TraceType } from '@mastra/core/memory';
|
|
6
|
-
import type { ScoreRowData } from '@mastra/core/scores';
|
|
6
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
7
7
|
import { MastraStorage } from '@mastra/core/storage';
|
|
8
8
|
import type {
|
|
9
9
|
TABLE_NAMES,
|
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
StorageResourceType,
|
|
19
19
|
} from '@mastra/core/storage';
|
|
20
20
|
import type { Trace } from '@mastra/core/telemetry';
|
|
21
|
-
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
21
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
22
22
|
import { StoreLegacyEvalsLance } from './domains/legacy-evals';
|
|
23
23
|
import { StoreMemoryLance } from './domains/memory';
|
|
24
24
|
import { StoreOperationsLance } from './domains/operations';
|
|
@@ -291,6 +291,18 @@ export class LanceStorage extends MastraStorage {
|
|
|
291
291
|
return this.stores.memory.getMessages({ threadId, resourceId, selectBy, format, threadConfig });
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
+
async getMessagesById({ messageIds, format }: { messageIds: string[]; format: 'v1' }): Promise<MastraMessageV1[]>;
|
|
295
|
+
async getMessagesById({ messageIds, format }: { messageIds: string[]; format?: 'v2' }): Promise<MastraMessageV2[]>;
|
|
296
|
+
async getMessagesById({
|
|
297
|
+
messageIds,
|
|
298
|
+
format,
|
|
299
|
+
}: {
|
|
300
|
+
messageIds: string[];
|
|
301
|
+
format?: 'v1' | 'v2';
|
|
302
|
+
}): Promise<MastraMessageV1[] | MastraMessageV2[]> {
|
|
303
|
+
return this.stores.memory.getMessagesById({ messageIds, format });
|
|
304
|
+
}
|
|
305
|
+
|
|
294
306
|
async saveMessages(args: { messages: MastraMessageV1[]; format?: undefined | 'v1' }): Promise<MastraMessageV1[]>;
|
|
295
307
|
async saveMessages(args: { messages: MastraMessageV2[]; format: 'v2' }): Promise<MastraMessageV2[]>;
|
|
296
308
|
async saveMessages(
|
|
@@ -378,6 +390,40 @@ export class LanceStorage extends MastraStorage {
|
|
|
378
390
|
return this.stores.workflows.getWorkflowRunById(args);
|
|
379
391
|
}
|
|
380
392
|
|
|
393
|
+
async updateWorkflowResults({
|
|
394
|
+
workflowName,
|
|
395
|
+
runId,
|
|
396
|
+
stepId,
|
|
397
|
+
result,
|
|
398
|
+
runtimeContext,
|
|
399
|
+
}: {
|
|
400
|
+
workflowName: string;
|
|
401
|
+
runId: string;
|
|
402
|
+
stepId: string;
|
|
403
|
+
result: StepResult<any, any, any, any>;
|
|
404
|
+
runtimeContext: Record<string, any>;
|
|
405
|
+
}): Promise<Record<string, StepResult<any, any, any, any>>> {
|
|
406
|
+
return this.stores.workflows.updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext });
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
async updateWorkflowState({
|
|
410
|
+
workflowName,
|
|
411
|
+
runId,
|
|
412
|
+
opts,
|
|
413
|
+
}: {
|
|
414
|
+
workflowName: string;
|
|
415
|
+
runId: string;
|
|
416
|
+
opts: {
|
|
417
|
+
status: string;
|
|
418
|
+
result?: StepResult<any, any, any, any>;
|
|
419
|
+
error?: string;
|
|
420
|
+
suspendedPaths?: Record<string, number[]>;
|
|
421
|
+
waitingPaths?: Record<string, number[]>;
|
|
422
|
+
};
|
|
423
|
+
}): Promise<WorkflowRunState | undefined> {
|
|
424
|
+
return this.stores.workflows.updateWorkflowState({ workflowName, runId, opts });
|
|
425
|
+
}
|
|
426
|
+
|
|
381
427
|
async persistWorkflowSnapshot({
|
|
382
428
|
workflowName,
|
|
383
429
|
runId,
|
|
@@ -406,12 +452,18 @@ export class LanceStorage extends MastraStorage {
|
|
|
406
452
|
|
|
407
453
|
async getScoresByScorerId({
|
|
408
454
|
scorerId,
|
|
455
|
+
source,
|
|
456
|
+
entityId,
|
|
457
|
+
entityType,
|
|
409
458
|
pagination,
|
|
410
459
|
}: {
|
|
411
460
|
scorerId: string;
|
|
412
461
|
pagination: StoragePagination;
|
|
462
|
+
source?: ScoringSource;
|
|
463
|
+
entityId?: string;
|
|
464
|
+
entityType?: string;
|
|
413
465
|
}): Promise<{ pagination: PaginationInfo; scores: ScoreRowData[] }> {
|
|
414
|
-
return this.stores.scores.getScoresByScorerId({ scorerId, pagination });
|
|
466
|
+
return this.stores.scores.getScoresByScorerId({ scorerId, source, pagination, entityId, entityType });
|
|
415
467
|
}
|
|
416
468
|
|
|
417
469
|
async saveScore(_score: ScoreRowData): Promise<{ score: ScoreRowData }> {
|