@mastra/lance 0.0.0-iterate-traces-ui-again-20250912091900 → 0.0.0-main-test-20251105183450
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 +348 -3
- package/README.md +61 -4
- package/dist/index.cjs +314 -609
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +315 -610
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +15 -39
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +12 -4
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +6 -12
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +30 -83
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +11 -8
- 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/traces/index.d.ts +0 -34
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
2
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
|
-
import type {
|
|
3
|
+
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
4
4
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
5
|
-
import type {
|
|
5
|
+
import type { StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput } from '@mastra/core/storage';
|
|
6
6
|
import type { StoreOperationsLance } from '../operations/index.js';
|
|
7
7
|
export declare class StoreMemoryLance extends MemoryStorage {
|
|
8
8
|
private client;
|
|
@@ -11,12 +11,10 @@ export declare class StoreMemoryLance extends MemoryStorage {
|
|
|
11
11
|
client: Connection;
|
|
12
12
|
operations: StoreOperationsLance;
|
|
13
13
|
});
|
|
14
|
+
private escapeSql;
|
|
14
15
|
getThreadById({ threadId }: {
|
|
15
16
|
threadId: string;
|
|
16
17
|
}): Promise<StorageThreadType | null>;
|
|
17
|
-
getThreadsByResourceId({ resourceId }: {
|
|
18
|
-
resourceId: string;
|
|
19
|
-
}): Promise<StorageThreadType[]>;
|
|
20
18
|
/**
|
|
21
19
|
* Saves a thread to the database. This function doesn't overwrite existing threads.
|
|
22
20
|
* @param thread - The thread to save
|
|
@@ -34,35 +32,18 @@ export declare class StoreMemoryLance extends MemoryStorage {
|
|
|
34
32
|
threadId: string;
|
|
35
33
|
}): Promise<void>;
|
|
36
34
|
private normalizeMessage;
|
|
37
|
-
|
|
38
|
-
format?: 'v1';
|
|
39
|
-
}): Promise<MastraMessageV1[]>;
|
|
40
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
41
|
-
format: 'v2';
|
|
42
|
-
}): Promise<MastraMessageV2[]>;
|
|
43
|
-
getMessagesById({ messageIds, format, }: {
|
|
44
|
-
messageIds: string[];
|
|
45
|
-
format: 'v1';
|
|
46
|
-
}): Promise<MastraMessageV1[]>;
|
|
47
|
-
getMessagesById({ messageIds, format, }: {
|
|
35
|
+
listMessagesById({ messageIds }: {
|
|
48
36
|
messageIds: string[];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
format?: undefined | 'v1';
|
|
54
|
-
}): Promise<MastraMessageV1[]>;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
messages: MastraDBMessage[];
|
|
39
|
+
}>;
|
|
40
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
55
41
|
saveMessages(args: {
|
|
56
|
-
messages:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
getThreadsByResourceIdPaginated(args: {
|
|
60
|
-
resourceId: string;
|
|
61
|
-
page?: number;
|
|
62
|
-
perPage?: number;
|
|
63
|
-
}): Promise<PaginationInfo & {
|
|
64
|
-
threads: StorageThreadType[];
|
|
42
|
+
messages: MastraDBMessage[];
|
|
43
|
+
}): Promise<{
|
|
44
|
+
messages: MastraDBMessage[];
|
|
65
45
|
}>;
|
|
46
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
66
47
|
/**
|
|
67
48
|
* Processes messages to include context messages based on withPreviousMessages and withNextMessages
|
|
68
49
|
* @param records - The sorted array of records to process
|
|
@@ -70,24 +51,19 @@ export declare class StoreMemoryLance extends MemoryStorage {
|
|
|
70
51
|
* @returns The processed array with context messages included
|
|
71
52
|
*/
|
|
72
53
|
private processMessagesWithContext;
|
|
73
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
74
|
-
format?: 'v1' | 'v2';
|
|
75
|
-
}): Promise<PaginationInfo & {
|
|
76
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
77
|
-
}>;
|
|
78
54
|
/**
|
|
79
|
-
* Parse message data from LanceDB record format to
|
|
55
|
+
* Parse message data from LanceDB record format to MastraDBMessage format
|
|
80
56
|
*/
|
|
81
57
|
private parseMessageData;
|
|
82
58
|
updateMessages(args: {
|
|
83
|
-
messages: Partial<Omit<
|
|
59
|
+
messages: Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
84
60
|
id: string;
|
|
85
61
|
content?: {
|
|
86
62
|
metadata?: MastraMessageContentV2['metadata'];
|
|
87
63
|
content?: MastraMessageContentV2['content'];
|
|
88
64
|
};
|
|
89
65
|
}[];
|
|
90
|
-
}): Promise<
|
|
66
|
+
}): Promise<MastraDBMessage[]>;
|
|
91
67
|
getResourceById({ resourceId }: {
|
|
92
68
|
resourceId: string;
|
|
93
69
|
}): Promise<StorageResourceType | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"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AAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CA8ErG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/
|
|
2
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
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,7 +13,7 @@ export declare class StoreScoresLance extends ScoresStorage {
|
|
|
13
13
|
getScoreById({ id }: {
|
|
14
14
|
id: string;
|
|
15
15
|
}): Promise<ScoreRowData | null>;
|
|
16
|
-
|
|
16
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
17
17
|
scorerId: string;
|
|
18
18
|
pagination: StoragePagination;
|
|
19
19
|
entityId?: string;
|
|
@@ -23,14 +23,14 @@ export declare class StoreScoresLance extends ScoresStorage {
|
|
|
23
23
|
pagination: PaginationInfo;
|
|
24
24
|
scores: ScoreRowData[];
|
|
25
25
|
}>;
|
|
26
|
-
|
|
26
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
27
27
|
runId: string;
|
|
28
28
|
pagination: StoragePagination;
|
|
29
29
|
}): Promise<{
|
|
30
30
|
pagination: PaginationInfo;
|
|
31
31
|
scores: ScoreRowData[];
|
|
32
32
|
}>;
|
|
33
|
-
|
|
33
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
34
34
|
pagination: StoragePagination;
|
|
35
35
|
entityId: string;
|
|
36
36
|
entityType: string;
|
|
@@ -38,5 +38,13 @@ export declare class StoreScoresLance extends ScoresStorage {
|
|
|
38
38
|
pagination: PaginationInfo;
|
|
39
39
|
scores: ScoreRowData[];
|
|
40
40
|
}>;
|
|
41
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
42
|
+
traceId: string;
|
|
43
|
+
spanId: string;
|
|
44
|
+
pagination: StoragePagination;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
pagination: PaginationInfo;
|
|
47
|
+
scores: ScoreRowData[];
|
|
48
|
+
}>;
|
|
41
49
|
}
|
|
42
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,aAAa,
|
|
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,EAA6B,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,aAAa,EAAwD,MAAM,sBAAsB,CAAC;AAC3G,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;IAwDhE,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAyBlE,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,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1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,CAO/D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,UAAU,GAAG,IAAI,CA4BzF;AAED,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACtD,WAAW,EAAE,UAAU,GACtB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,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,6 +1,7 @@
|
|
|
1
1
|
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type {
|
|
2
|
+
import type { StorageListWorkflowRunsInput, WorkflowRuns } from '@mastra/core/storage';
|
|
3
3
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
4
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
5
|
export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
5
6
|
client: Connection;
|
|
6
7
|
constructor({ client }: {
|
|
@@ -11,7 +12,7 @@ export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
|
11
12
|
runId: string;
|
|
12
13
|
stepId: string;
|
|
13
14
|
result: StepResult<any, any, any, any>;
|
|
14
|
-
|
|
15
|
+
requestContext: Record<string, any>;
|
|
15
16
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
16
17
|
updateWorkflowState({}: {
|
|
17
18
|
workflowName: string;
|
|
@@ -24,9 +25,10 @@ export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
|
24
25
|
waitingPaths?: Record<string, number[]>;
|
|
25
26
|
};
|
|
26
27
|
}): Promise<WorkflowRunState | undefined>;
|
|
27
|
-
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
28
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
28
29
|
workflowName: string;
|
|
29
30
|
runId: string;
|
|
31
|
+
resourceId?: string;
|
|
30
32
|
snapshot: WorkflowRunState;
|
|
31
33
|
}): Promise<void>;
|
|
32
34
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
@@ -43,14 +45,6 @@ export declare class StoreWorkflowsLance extends WorkflowsStorage {
|
|
|
43
45
|
createdAt: Date;
|
|
44
46
|
updatedAt: Date;
|
|
45
47
|
} | null>;
|
|
46
|
-
|
|
47
|
-
namespace?: string;
|
|
48
|
-
resourceId?: string;
|
|
49
|
-
workflowName?: string;
|
|
50
|
-
fromDate?: Date;
|
|
51
|
-
toDate?: Date;
|
|
52
|
-
limit?: number;
|
|
53
|
-
offset?: number;
|
|
54
|
-
}): Promise<WorkflowRuns>;
|
|
48
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
55
49
|
}
|
|
56
50
|
//# 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,EAAe,4BAA4B,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAyD,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC/G,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAuB3E,qBAAa,mBAAoB,SAAQ,gBAAgB;IACvD,MAAM,EAAE,UAAU,CAAC;gBACP,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,UAAU,CAAA;KAAE;IAK9C,qBAAqB,CACnB,EAMC,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACvC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACrC,GACA,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAG1D,mBAAmB,CACjB,EAIC,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACxC,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAC1C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;SACzC,CAAC;KACH,GACA,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAIlC,uBAAuB,CAAC,EAC5B,YAAY,EACZ,KAAK,EACL,UAAU,EACV,QAAQ,GACT,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CX,oBAAoB,CAAC,EACzB,YAAY,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,gBAAgB,CAAC,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC;CAuEnF"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
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 { 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 { TABLE_NAMES, PaginationInfo,
|
|
7
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
6
|
+
import type { TABLE_NAMES, PaginationInfo, StorageColumn, WorkflowRuns, StoragePagination, StorageDomains, StorageResourceType, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
8
7
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
9
8
|
export declare class LanceStorage extends MastraStorage {
|
|
10
9
|
stores: StorageDomains;
|
|
@@ -67,9 +66,6 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
67
66
|
getThreadById({ threadId }: {
|
|
68
67
|
threadId: string;
|
|
69
68
|
}): Promise<StorageThreadType | null>;
|
|
70
|
-
getThreadsByResourceId({ resourceId }: {
|
|
71
|
-
resourceId: string;
|
|
72
|
-
}): Promise<StorageThreadType[]>;
|
|
73
69
|
/**
|
|
74
70
|
* Saves a thread to the database. This function doesn't overwrite existing threads.
|
|
75
71
|
* @param thread - The thread to save
|
|
@@ -92,6 +88,7 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
92
88
|
hasColumn: boolean;
|
|
93
89
|
createTable: boolean;
|
|
94
90
|
deleteMessages: boolean;
|
|
91
|
+
listScoresBySpan: boolean;
|
|
95
92
|
};
|
|
96
93
|
getResourceById({ resourceId }: {
|
|
97
94
|
resourceId: string;
|
|
@@ -111,85 +108,26 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
111
108
|
* @returns The processed array with context messages included
|
|
112
109
|
*/
|
|
113
110
|
private processMessagesWithContext;
|
|
114
|
-
|
|
115
|
-
format?: 'v1';
|
|
116
|
-
}): Promise<MastraMessageV1[]>;
|
|
117
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
118
|
-
format: 'v2';
|
|
119
|
-
}): Promise<MastraMessageV2[]>;
|
|
120
|
-
getMessagesById({ messageIds, format }: {
|
|
121
|
-
messageIds: string[];
|
|
122
|
-
format: 'v1';
|
|
123
|
-
}): Promise<MastraMessageV1[]>;
|
|
124
|
-
getMessagesById({ messageIds, format }: {
|
|
111
|
+
listMessagesById({ messageIds }: {
|
|
125
112
|
messageIds: string[];
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
saveMessages(args: {
|
|
129
|
-
messages: MastraMessageV1[];
|
|
130
|
-
format?: undefined | 'v1';
|
|
131
|
-
}): Promise<MastraMessageV1[]>;
|
|
132
|
-
saveMessages(args: {
|
|
133
|
-
messages: MastraMessageV2[];
|
|
134
|
-
format: 'v2';
|
|
135
|
-
}): Promise<MastraMessageV2[]>;
|
|
136
|
-
getThreadsByResourceIdPaginated(args: {
|
|
137
|
-
resourceId: string;
|
|
138
|
-
page: number;
|
|
139
|
-
perPage: number;
|
|
140
|
-
}): Promise<PaginationInfo & {
|
|
141
|
-
threads: StorageThreadType[];
|
|
113
|
+
}): Promise<{
|
|
114
|
+
messages: MastraDBMessage[];
|
|
142
115
|
}>;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}): Promise<
|
|
146
|
-
messages:
|
|
116
|
+
saveMessages(args: {
|
|
117
|
+
messages: MastraDBMessage[];
|
|
118
|
+
}): Promise<{
|
|
119
|
+
messages: MastraDBMessage[];
|
|
147
120
|
}>;
|
|
148
121
|
updateMessages(_args: {
|
|
149
|
-
messages: Partial<Omit<
|
|
122
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
150
123
|
id: string;
|
|
151
124
|
content?: {
|
|
152
125
|
metadata?: MastraMessageContentV2['metadata'];
|
|
153
126
|
content?: MastraMessageContentV2['content'];
|
|
154
127
|
};
|
|
155
|
-
}[];
|
|
156
|
-
}): Promise<
|
|
157
|
-
|
|
158
|
-
traceId: string;
|
|
159
|
-
}): Promise<TraceType>;
|
|
160
|
-
getTraces(args: {
|
|
161
|
-
name?: string;
|
|
162
|
-
scope?: string;
|
|
163
|
-
page: number;
|
|
164
|
-
perPage: number;
|
|
165
|
-
attributes?: Record<string, string>;
|
|
166
|
-
}): Promise<Trace[]>;
|
|
167
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
168
|
-
traces: Trace[];
|
|
169
|
-
}>;
|
|
170
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
171
|
-
getEvals(options: {
|
|
172
|
-
agentName?: string;
|
|
173
|
-
type?: 'test' | 'live';
|
|
174
|
-
page?: number;
|
|
175
|
-
perPage?: number;
|
|
176
|
-
fromDate?: Date;
|
|
177
|
-
toDate?: Date;
|
|
178
|
-
dateRange?: {
|
|
179
|
-
start?: Date;
|
|
180
|
-
end?: Date;
|
|
181
|
-
};
|
|
182
|
-
}): Promise<PaginationInfo & {
|
|
183
|
-
evals: EvalRow[];
|
|
184
|
-
}>;
|
|
185
|
-
getWorkflowRuns(args?: {
|
|
186
|
-
namespace?: string;
|
|
187
|
-
workflowName?: string;
|
|
188
|
-
fromDate?: Date;
|
|
189
|
-
toDate?: Date;
|
|
190
|
-
limit?: number;
|
|
191
|
-
offset?: number;
|
|
192
|
-
}): Promise<WorkflowRuns>;
|
|
128
|
+
})[];
|
|
129
|
+
}): Promise<MastraDBMessage[]>;
|
|
130
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
193
131
|
getWorkflowRunById(args: {
|
|
194
132
|
runId: string;
|
|
195
133
|
workflowName?: string;
|
|
@@ -200,12 +138,12 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
200
138
|
createdAt: Date;
|
|
201
139
|
updatedAt: Date;
|
|
202
140
|
} | null>;
|
|
203
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
141
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
204
142
|
workflowName: string;
|
|
205
143
|
runId: string;
|
|
206
144
|
stepId: string;
|
|
207
145
|
result: StepResult<any, any, any, any>;
|
|
208
|
-
|
|
146
|
+
requestContext: Record<string, any>;
|
|
209
147
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
210
148
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
211
149
|
workflowName: string;
|
|
@@ -218,9 +156,10 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
218
156
|
waitingPaths?: Record<string, number[]>;
|
|
219
157
|
};
|
|
220
158
|
}): Promise<WorkflowRunState | undefined>;
|
|
221
|
-
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
159
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
222
160
|
workflowName: string;
|
|
223
161
|
runId: string;
|
|
162
|
+
resourceId?: string;
|
|
224
163
|
snapshot: WorkflowRunState;
|
|
225
164
|
}): Promise<void>;
|
|
226
165
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
@@ -230,7 +169,7 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
230
169
|
getScoreById({ id: _id }: {
|
|
231
170
|
id: string;
|
|
232
171
|
}): Promise<ScoreRowData | null>;
|
|
233
|
-
|
|
172
|
+
listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
|
|
234
173
|
scorerId: string;
|
|
235
174
|
pagination: StoragePagination;
|
|
236
175
|
source?: ScoringSource;
|
|
@@ -243,14 +182,14 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
243
182
|
saveScore(_score: ScoreRowData): Promise<{
|
|
244
183
|
score: ScoreRowData;
|
|
245
184
|
}>;
|
|
246
|
-
|
|
185
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
247
186
|
runId: string;
|
|
248
187
|
pagination: StoragePagination;
|
|
249
188
|
}): Promise<{
|
|
250
189
|
pagination: PaginationInfo;
|
|
251
190
|
scores: ScoreRowData[];
|
|
252
191
|
}>;
|
|
253
|
-
|
|
192
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
254
193
|
pagination: StoragePagination;
|
|
255
194
|
entityId: string;
|
|
256
195
|
entityType: string;
|
|
@@ -258,5 +197,13 @@ export declare class LanceStorage extends MastraStorage {
|
|
|
258
197
|
pagination: PaginationInfo;
|
|
259
198
|
scores: ScoreRowData[];
|
|
260
199
|
}>;
|
|
200
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
201
|
+
traceId: string;
|
|
202
|
+
spanId: string;
|
|
203
|
+
pagination: StoragePagination;
|
|
204
|
+
}): Promise<{
|
|
205
|
+
pagination: PaginationInfo;
|
|
206
|
+
scores: ScoreRowData[];
|
|
207
|
+
}>;
|
|
261
208
|
}
|
|
262
209
|
//# 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,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAA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,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;CAGpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/lance",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-main-test-20251105183450",
|
|
4
4
|
"description": "Lance provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@lancedb/lancedb": "^0.
|
|
22
|
+
"@lancedb/lancedb": "^0.22.2",
|
|
23
23
|
"apache-arrow": "^18.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@microsoft/api-extractor": "^7.52.8",
|
|
27
27
|
"@types/node": "^20.19.0",
|
|
28
|
-
"eslint": "^9.
|
|
28
|
+
"eslint": "^9.37.0",
|
|
29
29
|
"tsup": "^8.5.0",
|
|
30
30
|
"typescript": "^5.8.3",
|
|
31
31
|
"vitest": "^3.2.4",
|
|
32
|
-
"@internal/
|
|
33
|
-
"@internal/
|
|
34
|
-
"@mastra/core": "0.0.0-
|
|
35
|
-
"@internal/types-builder": "0.0.0-
|
|
32
|
+
"@internal/storage-test-utils": "0.0.49",
|
|
33
|
+
"@internal/lint": "0.0.0-main-test-20251105183450",
|
|
34
|
+
"@mastra/core": "0.0.0-main-test-20251105183450",
|
|
35
|
+
"@internal/types-builder": "0.0.0-main-test-20251105183450"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@mastra/core": "0.0.0-
|
|
38
|
+
"@mastra/core": "0.0.0-main-test-20251105183450"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
"bugs": {
|
|
51
51
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
52
52
|
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.13.0"
|
|
55
|
+
},
|
|
53
56
|
"scripts": {
|
|
54
57
|
"build": "tsup --silent --config tsup.config.ts",
|
|
55
58
|
"build:watch": "tsup --watch --silent --config tsup.config.ts",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { EvalRow, PaginationInfo } from '@mastra/core/storage';
|
|
4
|
-
export declare class StoreLegacyEvalsLance extends LegacyEvalsStorage {
|
|
5
|
-
private client;
|
|
6
|
-
constructor({ client }: {
|
|
7
|
-
client: Connection;
|
|
8
|
-
});
|
|
9
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
10
|
-
getEvals(options: {
|
|
11
|
-
agentName?: string;
|
|
12
|
-
type?: 'test' | 'live';
|
|
13
|
-
page?: number;
|
|
14
|
-
perPage?: number;
|
|
15
|
-
fromDate?: Date;
|
|
16
|
-
toDate?: Date;
|
|
17
|
-
dateRange?: {
|
|
18
|
-
start?: Date;
|
|
19
|
-
end?: Date;
|
|
20
|
-
};
|
|
21
|
-
}): Promise<PaginationInfo & {
|
|
22
|
-
evals: EvalRow[];
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/legacy-evals/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEpE,qBAAa,qBAAsB,SAAQ,kBAAkB;IAC3D,OAAO,CAAC,MAAM,CAAa;gBACf,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,UAAU,CAAA;KAAE;IAKxC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA4ClF,QAAQ,CAAC,OAAO,EAAE;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,MAAM,CAAC,EAAE,IAAI,CAAC;QACd,SAAS,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,IAAI,CAAC;YAAC,GAAG,CAAC,EAAE,IAAI,CAAA;SAAE,CAAC;KAC1C,GAAG,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CA2FnD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
-
import type { TraceType } from '@mastra/core/memory';
|
|
3
|
-
import { TracesStorage } from '@mastra/core/storage';
|
|
4
|
-
import type { PaginationInfo, StorageGetTracesPaginatedArg } from '@mastra/core/storage';
|
|
5
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
6
|
-
import type { StoreOperationsLance } from '../operations/index.js';
|
|
7
|
-
export declare class StoreTracesLance extends TracesStorage {
|
|
8
|
-
private client;
|
|
9
|
-
private operations;
|
|
10
|
-
constructor({ client, operations }: {
|
|
11
|
-
client: Connection;
|
|
12
|
-
operations: StoreOperationsLance;
|
|
13
|
-
});
|
|
14
|
-
saveTrace({ trace }: {
|
|
15
|
-
trace: TraceType;
|
|
16
|
-
}): Promise<TraceType>;
|
|
17
|
-
getTraceById({ traceId }: {
|
|
18
|
-
traceId: string;
|
|
19
|
-
}): Promise<TraceType>;
|
|
20
|
-
getTraces({ name, scope, page, perPage, attributes, }: {
|
|
21
|
-
name?: string;
|
|
22
|
-
scope?: string;
|
|
23
|
-
page: number;
|
|
24
|
-
perPage: number;
|
|
25
|
-
attributes?: Record<string, string>;
|
|
26
|
-
}): Promise<Trace[]>;
|
|
27
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
28
|
-
traces: Trace[];
|
|
29
|
-
}>;
|
|
30
|
-
batchTraceInsert({ records }: {
|
|
31
|
-
records: Record<string, any>[];
|
|
32
|
-
}): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/traces/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,UAAU,CAAuB;gBAC7B,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,UAAU,C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