@mastra/cloudflare-d1 0.0.0-toolOptionTypes-20250917085558 → 0.0.0-top-level-fix-20251211111608
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 +675 -3
- package/README.md +10 -5
- package/dist/index.cjs +355 -624
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +356 -625
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +13 -44
- 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 +13 -5
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +7 -10
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +61 -96
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +16 -11
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -20
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -18
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
|
-
import type {
|
|
4
|
+
import type { StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput } from '@mastra/core/storage';
|
|
5
5
|
import type { StoreOperationsD1 } from '../operations/index.js';
|
|
6
6
|
export declare class MemoryStorageD1 extends MemoryStorage {
|
|
7
7
|
private operations;
|
|
@@ -22,19 +22,7 @@ export declare class MemoryStorageD1 extends MemoryStorage {
|
|
|
22
22
|
getThreadById({ threadId }: {
|
|
23
23
|
threadId: string;
|
|
24
24
|
}): Promise<StorageThreadType | null>;
|
|
25
|
-
|
|
26
|
-
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
27
|
-
*/
|
|
28
|
-
getThreadsByResourceId({ resourceId }: {
|
|
29
|
-
resourceId: string;
|
|
30
|
-
}): Promise<StorageThreadType[]>;
|
|
31
|
-
getThreadsByResourceIdPaginated(args: {
|
|
32
|
-
resourceId: string;
|
|
33
|
-
page: number;
|
|
34
|
-
perPage: number;
|
|
35
|
-
}): Promise<PaginationInfo & {
|
|
36
|
-
threads: StorageThreadType[];
|
|
37
|
-
}>;
|
|
25
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
38
26
|
saveThread({ thread }: {
|
|
39
27
|
thread: StorageThreadType;
|
|
40
28
|
}): Promise<StorageThreadType>;
|
|
@@ -47,44 +35,25 @@ export declare class MemoryStorageD1 extends MemoryStorage {
|
|
|
47
35
|
threadId: string;
|
|
48
36
|
}): Promise<void>;
|
|
49
37
|
saveMessages(args: {
|
|
50
|
-
messages:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
messages: MastraMessageV2[];
|
|
55
|
-
format: 'v2';
|
|
56
|
-
}): Promise<MastraMessageV2[]>;
|
|
38
|
+
messages: MastraDBMessage[];
|
|
39
|
+
}): Promise<{
|
|
40
|
+
messages: MastraDBMessage[];
|
|
41
|
+
}>;
|
|
57
42
|
private _getIncludedMessages;
|
|
58
|
-
|
|
59
|
-
* @deprecated use getMessagesPaginated instead
|
|
60
|
-
*/
|
|
61
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
62
|
-
format?: 'v1';
|
|
63
|
-
}): Promise<MastraMessageV1[]>;
|
|
64
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
65
|
-
format: 'v2';
|
|
66
|
-
}): Promise<MastraMessageV2[]>;
|
|
67
|
-
getMessagesById({ messageIds, format, }: {
|
|
68
|
-
messageIds: string[];
|
|
69
|
-
format: 'v1';
|
|
70
|
-
}): Promise<MastraMessageV1[]>;
|
|
71
|
-
getMessagesById({ messageIds, format, }: {
|
|
43
|
+
listMessagesById({ messageIds }: {
|
|
72
44
|
messageIds: string[];
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
getMessagesPaginated({ threadId, resourceId, selectBy, format, }: StorageGetMessagesArg & {
|
|
76
|
-
format?: 'v1' | 'v2';
|
|
77
|
-
}): Promise<PaginationInfo & {
|
|
78
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
45
|
+
}): Promise<{
|
|
46
|
+
messages: MastraDBMessage[];
|
|
79
47
|
}>;
|
|
48
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
80
49
|
updateMessages(args: {
|
|
81
|
-
messages: Partial<Omit<
|
|
50
|
+
messages: Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
82
51
|
id: string;
|
|
83
52
|
content?: {
|
|
84
53
|
metadata?: MastraMessageContentV2['metadata'];
|
|
85
54
|
content?: MastraMessageContentV2['content'];
|
|
86
55
|
};
|
|
87
56
|
}[];
|
|
88
|
-
}): Promise<
|
|
57
|
+
}): Promise<MastraDBMessage[]>;
|
|
89
58
|
}
|
|
90
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAmB,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAGL,aAAa,EAO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KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA8CxB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B/D,YAAY,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;YAwErF,oBAAoB;IAwErB,gBAAgB,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;IAkDpG,YAAY,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAsNvF,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;gBACR,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;gBAC9C,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;aAC7C,CAAC;SACH,EAAE,CAAC;KACP,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAwI/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index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E;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IA+CzG,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAQ9E;;;;OAIG;IACG,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAgErH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/
|
|
1
|
+
import type { SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { StoragePagination, PaginationInfo } from '@mastra/core/storage';
|
|
4
4
|
import type Cloudflare from 'cloudflare';
|
|
@@ -20,10 +20,10 @@ export declare class ScoresStorageD1 extends ScoresStorage {
|
|
|
20
20
|
getScoreById({ id }: {
|
|
21
21
|
id: string;
|
|
22
22
|
}): Promise<ScoreRowData | null>;
|
|
23
|
-
saveScore(score:
|
|
23
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
24
24
|
score: ScoreRowData;
|
|
25
25
|
}>;
|
|
26
|
-
|
|
26
|
+
listScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
|
|
27
27
|
scorerId: string;
|
|
28
28
|
entityId?: string;
|
|
29
29
|
entityType?: string;
|
|
@@ -33,14 +33,14 @@ export declare class ScoresStorageD1 extends ScoresStorage {
|
|
|
33
33
|
pagination: PaginationInfo;
|
|
34
34
|
scores: ScoreRowData[];
|
|
35
35
|
}>;
|
|
36
|
-
|
|
36
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
37
37
|
runId: string;
|
|
38
38
|
pagination: StoragePagination;
|
|
39
39
|
}): Promise<{
|
|
40
40
|
pagination: PaginationInfo;
|
|
41
41
|
scores: ScoreRowData[];
|
|
42
42
|
}>;
|
|
43
|
-
|
|
43
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
44
44
|
pagination: StoragePagination;
|
|
45
45
|
entityId: string;
|
|
46
46
|
entityType: string;
|
|
@@ -48,5 +48,13 @@ export declare class ScoresStorageD1 extends ScoresStorage {
|
|
|
48
48
|
pagination: PaginationInfo;
|
|
49
49
|
scores: ScoreRowData[];
|
|
50
50
|
}>;
|
|
51
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
52
|
+
traceId: string;
|
|
53
|
+
spanId: string;
|
|
54
|
+
pagination: StoragePagination;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
pagination: PaginationInfo;
|
|
57
|
+
scores: ScoreRowData[];
|
|
58
|
+
}>;
|
|
51
59
|
}
|
|
52
60
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAEnH,OAAO,EAEL,aAAa,EAKd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,e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QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IA8D7D,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;IAmE7D,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;CAkEpE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
1
|
+
import type { WorkflowRun, WorkflowRuns, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
2
2
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
3
3
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
4
|
import type { StoreOperationsD1 } from '../operations/index.js';
|
|
@@ -12,7 +12,7 @@ export declare class WorkflowsStorageD1 extends WorkflowsStorage {
|
|
|
12
12
|
runId: string;
|
|
13
13
|
stepId: string;
|
|
14
14
|
result: StepResult<any, any, any, any>;
|
|
15
|
-
|
|
15
|
+
requestContext: Record<string, any>;
|
|
16
16
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
17
17
|
updateWorkflowState({}: {
|
|
18
18
|
workflowName: string;
|
|
@@ -36,17 +36,14 @@ export declare class WorkflowsStorageD1 extends WorkflowsStorage {
|
|
|
36
36
|
runId: string;
|
|
37
37
|
}): Promise<WorkflowRunState | null>;
|
|
38
38
|
private parseWorkflowRun;
|
|
39
|
-
|
|
40
|
-
workflowName?: string;
|
|
41
|
-
fromDate?: Date;
|
|
42
|
-
toDate?: Date;
|
|
43
|
-
limit?: number;
|
|
44
|
-
offset?: number;
|
|
45
|
-
resourceId?: string;
|
|
46
|
-
}): Promise<WorkflowRuns>;
|
|
39
|
+
listWorkflowRuns({ workflowName, fromDate, toDate, page, perPage, resourceId, status, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
47
40
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
48
41
|
runId: string;
|
|
49
42
|
workflowName?: string;
|
|
50
43
|
}): Promise<WorkflowRun | null>;
|
|
44
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
45
|
+
runId: string;
|
|
46
|
+
workflowName: string;
|
|
47
|
+
}): Promise<void>;
|
|
51
48
|
}
|
|
52
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAA6D,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,OAAO,CAAC,UAAU,CAAoB;gBAE1B,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AAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA6B7G,OAAO,CAAC,gBAAgB;IAqBlB,gBAAgB,CAAC,EACrB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,GACP,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;IAsEtD,kBAAkB,CAAC,EACvB,KAAK,EACL,YAAY,GACb,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAgCzB,qBAAqB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAmB7G"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,39 +1,61 @@
|
|
|
1
1
|
import type { D1Database } from '@cloudflare/workers-types';
|
|
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 { StorageThreadType, MastraDBMessage } from '@mastra/core/memory';
|
|
5
5
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
|
-
import type {
|
|
7
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
6
|
+
import type { PaginationInfo, StorageColumn, StorageResourceType, TABLE_NAMES, WorkflowRun, StoragePagination, WorkflowRuns, StorageDomains, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
8
7
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
9
8
|
import Cloudflare from 'cloudflare';
|
|
9
|
+
/**
|
|
10
|
+
* Base configuration options shared across D1 configurations
|
|
11
|
+
*/
|
|
12
|
+
export interface D1BaseConfig {
|
|
13
|
+
/** Storage instance ID */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Optional prefix for table names */
|
|
16
|
+
tablePrefix?: string;
|
|
17
|
+
/**
|
|
18
|
+
* When true, automatic initialization (table creation/migrations) is disabled.
|
|
19
|
+
* This is useful for CI/CD pipelines where you want to:
|
|
20
|
+
* 1. Run migrations explicitly during deployment (not at runtime)
|
|
21
|
+
* 2. Use different credentials for schema changes vs runtime operations
|
|
22
|
+
*
|
|
23
|
+
* When disableInit is true:
|
|
24
|
+
* - The storage will not automatically create/alter tables on first use
|
|
25
|
+
* - You must call `storage.init()` explicitly in your CI/CD scripts
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // In CI/CD script:
|
|
29
|
+
* const storage = new D1Store({ ...config, disableInit: false });
|
|
30
|
+
* await storage.init(); // Explicitly run migrations
|
|
31
|
+
*
|
|
32
|
+
* // In runtime application:
|
|
33
|
+
* const storage = new D1Store({ ...config, disableInit: true });
|
|
34
|
+
* // No auto-init, tables must already exist
|
|
35
|
+
*/
|
|
36
|
+
disableInit?: boolean;
|
|
37
|
+
}
|
|
10
38
|
/**
|
|
11
39
|
* Configuration for D1 using the REST API
|
|
12
40
|
*/
|
|
13
|
-
export interface D1Config {
|
|
41
|
+
export interface D1Config extends D1BaseConfig {
|
|
14
42
|
/** Cloudflare account ID */
|
|
15
43
|
accountId: string;
|
|
16
44
|
/** Cloudflare API token with D1 access */
|
|
17
45
|
apiToken: string;
|
|
18
46
|
/** D1 database ID */
|
|
19
47
|
databaseId: string;
|
|
20
|
-
/** Optional prefix for table names */
|
|
21
|
-
tablePrefix?: string;
|
|
22
48
|
}
|
|
23
|
-
export interface D1ClientConfig {
|
|
24
|
-
/** Optional prefix for table names */
|
|
25
|
-
tablePrefix?: string;
|
|
49
|
+
export interface D1ClientConfig extends D1BaseConfig {
|
|
26
50
|
/** D1 Client */
|
|
27
51
|
client: D1Client;
|
|
28
52
|
}
|
|
29
53
|
/**
|
|
30
54
|
* Configuration for D1 using the Workers Binding API
|
|
31
55
|
*/
|
|
32
|
-
export interface D1WorkersConfig {
|
|
56
|
+
export interface D1WorkersConfig extends D1BaseConfig {
|
|
33
57
|
/** D1 database binding from Workers environment */
|
|
34
58
|
binding: D1Database;
|
|
35
|
-
/** Optional prefix for table names */
|
|
36
|
-
tablePrefix?: string;
|
|
37
59
|
}
|
|
38
60
|
/**
|
|
39
61
|
* Combined configuration type supporting both REST API and Workers Binding API
|
|
@@ -64,6 +86,7 @@ export declare class D1Store extends MastraStorage {
|
|
|
64
86
|
hasColumn: boolean;
|
|
65
87
|
createTable: boolean;
|
|
66
88
|
deleteMessages: boolean;
|
|
89
|
+
listScoresBySpan: boolean;
|
|
67
90
|
};
|
|
68
91
|
createTable({ tableName, schema, }: {
|
|
69
92
|
tableName: TABLE_NAMES;
|
|
@@ -98,19 +121,6 @@ export declare class D1Store extends MastraStorage {
|
|
|
98
121
|
getThreadById({ threadId }: {
|
|
99
122
|
threadId: string;
|
|
100
123
|
}): Promise<StorageThreadType | null>;
|
|
101
|
-
/**
|
|
102
|
-
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
103
|
-
*/
|
|
104
|
-
getThreadsByResourceId({ resourceId }: {
|
|
105
|
-
resourceId: string;
|
|
106
|
-
}): Promise<StorageThreadType[]>;
|
|
107
|
-
getThreadsByResourceIdPaginated(args: {
|
|
108
|
-
resourceId: string;
|
|
109
|
-
page: number;
|
|
110
|
-
perPage: number;
|
|
111
|
-
}): Promise<PaginationInfo & {
|
|
112
|
-
threads: StorageThreadType[];
|
|
113
|
-
}>;
|
|
114
124
|
saveThread({ thread }: {
|
|
115
125
|
thread: StorageThreadType;
|
|
116
126
|
}): Promise<StorageThreadType>;
|
|
@@ -123,41 +133,16 @@ export declare class D1Store extends MastraStorage {
|
|
|
123
133
|
threadId: string;
|
|
124
134
|
}): Promise<void>;
|
|
125
135
|
saveMessages(args: {
|
|
126
|
-
messages:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
saveMessages(args: {
|
|
130
|
-
messages: MastraMessageV2[];
|
|
131
|
-
format: 'v2';
|
|
132
|
-
}): Promise<MastraMessageV2[]>;
|
|
133
|
-
/**
|
|
134
|
-
* @deprecated use getMessagesPaginated instead
|
|
135
|
-
*/
|
|
136
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
137
|
-
format?: 'v1';
|
|
138
|
-
}): Promise<MastraMessageV1[]>;
|
|
139
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
140
|
-
format: 'v2';
|
|
141
|
-
}): Promise<MastraMessageV2[]>;
|
|
142
|
-
getMessagesById({ messageIds, format }: {
|
|
143
|
-
messageIds: string[];
|
|
144
|
-
format: 'v1';
|
|
145
|
-
}): Promise<MastraMessageV1[]>;
|
|
146
|
-
getMessagesById({ messageIds, format }: {
|
|
147
|
-
messageIds: string[];
|
|
148
|
-
format?: 'v2';
|
|
149
|
-
}): Promise<MastraMessageV2[]>;
|
|
150
|
-
getMessagesPaginated({ threadId, selectBy, format, }: StorageGetMessagesArg & {
|
|
151
|
-
format?: 'v1' | 'v2';
|
|
152
|
-
}): Promise<PaginationInfo & {
|
|
153
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
136
|
+
messages: MastraDBMessage[];
|
|
137
|
+
}): Promise<{
|
|
138
|
+
messages: MastraDBMessage[];
|
|
154
139
|
}>;
|
|
155
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
140
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
156
141
|
workflowName: string;
|
|
157
142
|
runId: string;
|
|
158
143
|
stepId: string;
|
|
159
144
|
result: StepResult<any, any, any, any>;
|
|
160
|
-
|
|
145
|
+
requestContext: Record<string, any>;
|
|
161
146
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
162
147
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
163
148
|
workflowName: string;
|
|
@@ -180,18 +165,15 @@ export declare class D1Store extends MastraStorage {
|
|
|
180
165
|
workflowName: string;
|
|
181
166
|
runId: string;
|
|
182
167
|
}): Promise<WorkflowRunState | null>;
|
|
183
|
-
|
|
184
|
-
workflowName?: string;
|
|
185
|
-
fromDate?: Date;
|
|
186
|
-
toDate?: Date;
|
|
187
|
-
limit?: number;
|
|
188
|
-
offset?: number;
|
|
189
|
-
resourceId?: string;
|
|
190
|
-
}): Promise<WorkflowRuns>;
|
|
168
|
+
listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
191
169
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
192
170
|
runId: string;
|
|
193
171
|
workflowName?: string;
|
|
194
172
|
}): Promise<WorkflowRun | null>;
|
|
173
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
174
|
+
runId: string;
|
|
175
|
+
workflowName: string;
|
|
176
|
+
}): Promise<void>;
|
|
195
177
|
/**
|
|
196
178
|
* Insert multiple records in a batch operation
|
|
197
179
|
* @param tableName The table to insert into
|
|
@@ -201,40 +183,15 @@ export declare class D1Store extends MastraStorage {
|
|
|
201
183
|
tableName: TABLE_NAMES;
|
|
202
184
|
records: Record<string, any>[];
|
|
203
185
|
}): Promise<void>;
|
|
204
|
-
/**
|
|
205
|
-
* @deprecated use getTracesPaginated instead
|
|
206
|
-
*/
|
|
207
|
-
getTraces(args: {
|
|
208
|
-
name?: string;
|
|
209
|
-
scope?: string;
|
|
210
|
-
page: number;
|
|
211
|
-
perPage: number;
|
|
212
|
-
attributes?: Record<string, string>;
|
|
213
|
-
fromDate?: Date;
|
|
214
|
-
toDate?: Date;
|
|
215
|
-
}): Promise<Trace[]>;
|
|
216
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
217
|
-
traces: Trace[];
|
|
218
|
-
}>;
|
|
219
|
-
/**
|
|
220
|
-
* @deprecated use getEvals instead
|
|
221
|
-
*/
|
|
222
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
223
|
-
getEvals(options: {
|
|
224
|
-
agentName?: string;
|
|
225
|
-
type?: 'test' | 'live';
|
|
226
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
227
|
-
evals: EvalRow[];
|
|
228
|
-
}>;
|
|
229
186
|
updateMessages(_args: {
|
|
230
|
-
messages: Partial<Omit<
|
|
187
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
231
188
|
id: string;
|
|
232
189
|
content?: {
|
|
233
190
|
metadata?: MastraMessageContentV2['metadata'];
|
|
234
191
|
content?: MastraMessageContentV2['content'];
|
|
235
192
|
};
|
|
236
|
-
}[];
|
|
237
|
-
}): Promise<
|
|
193
|
+
})[];
|
|
194
|
+
}): Promise<MastraDBMessage[]>;
|
|
238
195
|
getResourceById({ resourceId }: {
|
|
239
196
|
resourceId: string;
|
|
240
197
|
}): Promise<StorageResourceType | null>;
|
|
@@ -249,17 +206,17 @@ export declare class D1Store extends MastraStorage {
|
|
|
249
206
|
getScoreById({ id: _id }: {
|
|
250
207
|
id: string;
|
|
251
208
|
}): Promise<ScoreRowData | null>;
|
|
252
|
-
saveScore(
|
|
209
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
253
210
|
score: ScoreRowData;
|
|
254
211
|
}>;
|
|
255
|
-
|
|
212
|
+
listScoresByRunId({ runId: _runId, pagination: _pagination, }: {
|
|
256
213
|
runId: string;
|
|
257
214
|
pagination: StoragePagination;
|
|
258
215
|
}): Promise<{
|
|
259
216
|
pagination: PaginationInfo;
|
|
260
217
|
scores: ScoreRowData[];
|
|
261
218
|
}>;
|
|
262
|
-
|
|
219
|
+
listScoresByEntityId({ entityId: _entityId, entityType: _entityType, pagination: _pagination, }: {
|
|
263
220
|
pagination: StoragePagination;
|
|
264
221
|
entityId: string;
|
|
265
222
|
entityType: string;
|
|
@@ -267,7 +224,7 @@ export declare class D1Store extends MastraStorage {
|
|
|
267
224
|
pagination: PaginationInfo;
|
|
268
225
|
scores: ScoreRowData[];
|
|
269
226
|
}>;
|
|
270
|
-
|
|
227
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
271
228
|
scorerId: string;
|
|
272
229
|
pagination: StoragePagination;
|
|
273
230
|
entityId?: string;
|
|
@@ -277,6 +234,14 @@ export declare class D1Store extends MastraStorage {
|
|
|
277
234
|
pagination: PaginationInfo;
|
|
278
235
|
scores: ScoreRowData[];
|
|
279
236
|
}>;
|
|
237
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
238
|
+
traceId: string;
|
|
239
|
+
spanId: string;
|
|
240
|
+
pagination: StoragePagination;
|
|
241
|
+
}): Promise<{
|
|
242
|
+
pagination: PaginationInfo;
|
|
243
|
+
scores: ScoreRowData[];
|
|
244
|
+
}>;
|
|
280
245
|
/**
|
|
281
246
|
* Close the database connection
|
|
282
247
|
* No explicit cleanup needed for D1 in either REST or Workers Binding mode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,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":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,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,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAwB,aAAa,EAAE,MAAM,sBAAsB,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AM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAInE;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/cloudflare-d1",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-top-level-fix-20251211111608",
|
|
4
4
|
"description": "D1 provider for Mastra - includes db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -26,22 +26,24 @@
|
|
|
26
26
|
"cloudflare": "^4.5.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudflare/workers-types": "^4.
|
|
29
|
+
"@cloudflare/workers-types": "^4.20251111.0",
|
|
30
30
|
"@microsoft/api-extractor": "^7.52.8",
|
|
31
|
-
"@types/node": "
|
|
31
|
+
"@types/node": "22.13.17",
|
|
32
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
33
|
+
"@vitest/ui": "4.0.12",
|
|
32
34
|
"dotenv": "^17.0.0",
|
|
33
|
-
"eslint": "^9.
|
|
34
|
-
"miniflare": "^4.
|
|
35
|
+
"eslint": "^9.37.0",
|
|
36
|
+
"miniflare": "^4.20251109.0",
|
|
35
37
|
"tsup": "^8.5.0",
|
|
36
38
|
"typescript": "^5.8.3",
|
|
37
|
-
"vitest": "
|
|
38
|
-
"@internal/
|
|
39
|
-
"@internal/lint": "0.0.0-
|
|
40
|
-
"@mastra/core": "0.0.0-
|
|
41
|
-
"@internal/
|
|
39
|
+
"vitest": "4.0.12",
|
|
40
|
+
"@internal/types-builder": "0.0.0-top-level-fix-20251211111608",
|
|
41
|
+
"@internal/lint": "0.0.0-top-level-fix-20251211111608",
|
|
42
|
+
"@mastra/core": "0.0.0-top-level-fix-20251211111608",
|
|
43
|
+
"@internal/storage-test-utils": "0.0.49"
|
|
42
44
|
},
|
|
43
45
|
"peerDependencies": {
|
|
44
|
-
"@mastra/core": "0.0.0-
|
|
46
|
+
"@mastra/core": "0.0.0-top-level-fix-20251211111608"
|
|
45
47
|
},
|
|
46
48
|
"homepage": "https://mastra.ai",
|
|
47
49
|
"repository": {
|
|
@@ -52,6 +54,9 @@
|
|
|
52
54
|
"bugs": {
|
|
53
55
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
54
56
|
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=22.13.0"
|
|
59
|
+
},
|
|
55
60
|
"scripts": {
|
|
56
61
|
"build": "tsup --silent --config tsup.config.ts",
|
|
57
62
|
"build:watch": "tsup --watch --silent --config tsup.config.ts",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
2
|
-
import type { EvalRow, PaginationArgs, PaginationInfo } from '@mastra/core/storage';
|
|
3
|
-
import type { StoreOperationsD1 } from '../operations/index.js';
|
|
4
|
-
export declare class LegacyEvalsStorageD1 extends LegacyEvalsStorage {
|
|
5
|
-
private operations;
|
|
6
|
-
constructor({ operations }: {
|
|
7
|
-
operations: StoreOperationsD1;
|
|
8
|
-
});
|
|
9
|
-
getEvals(options: {
|
|
10
|
-
agentName?: string;
|
|
11
|
-
type?: 'test' | 'live';
|
|
12
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
13
|
-
evals: EvalRow[];
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated use getEvals instead
|
|
17
|
-
*/
|
|
18
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
19
|
-
}
|
|
20
|
-
//# 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":"AAEA,OAAO,EAAE,kBAAkB,EAA8B,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,OAAO,CAAC,UAAU,CAAoB;gBAC1B,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,iBAAiB,CAAA;KAAE;IAKvD,QAAQ,CACZ,OAAO,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,GAAG,cAAc,GACjB,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;IAoHjD;;OAEG;IACG,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA0DzF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { PaginationInfo, StorageGetTracesArg, StorageGetTracesPaginatedArg } from '@mastra/core/storage';
|
|
2
|
-
import { TracesStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
4
|
-
import type { StoreOperationsD1 } from '../operations/index.js';
|
|
5
|
-
export declare class TracesStorageD1 extends TracesStorage {
|
|
6
|
-
private operations;
|
|
7
|
-
constructor({ operations }: {
|
|
8
|
-
operations: StoreOperationsD1;
|
|
9
|
-
});
|
|
10
|
-
getTraces(args: StorageGetTracesArg): Promise<Trace[]>;
|
|
11
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
12
|
-
traces: Trace[];
|
|
13
|
-
}>;
|
|
14
|
-
batchTraceInsert({ records }: {
|
|
15
|
-
records: Record<string, any>[];
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
//# 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":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAOvD,qBAAa,eAAgB,SAAQ,aAAa;IAChD,OAAO,CAAC,UAAU,CAAoB;gBAE1B,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,iBAAiB,CAAA;KAAE;IAKvD,SAAS,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAsCtD,kBAAkB,CAAC,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,cAAc,GAAG;QAAE,MAAM,EAAE,KAAK,EAAE,CAAA;KAAE,CAAC;IA+FrG,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAOvF"}
|