@mastra/cloudflare 0.0.0-vnext-inngest-20250508131921 → 0.0.0-vnext-20251104230439

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.
@@ -0,0 +1,82 @@
1
+ import type { KVNamespace } from '@cloudflare/workers-types';
2
+ import { StoreOperations } from '@mastra/core/storage';
3
+ import type { StorageColumn, TABLE_NAMES } from '@mastra/core/storage';
4
+ import type Cloudflare from 'cloudflare';
5
+ import type { ListOptions, RecordTypes } from '../../types.js';
6
+ export declare class StoreOperationsCloudflare extends StoreOperations {
7
+ private bindings?;
8
+ client?: Cloudflare;
9
+ accountId?: string;
10
+ namespacePrefix: string;
11
+ constructor({ namespacePrefix, bindings, client, accountId, }: {
12
+ bindings?: Record<TABLE_NAMES, KVNamespace>;
13
+ namespacePrefix: string;
14
+ client?: Cloudflare;
15
+ accountId?: string;
16
+ });
17
+ hasColumn(): Promise<boolean>;
18
+ alterTable(_args: {
19
+ tableName: TABLE_NAMES;
20
+ schema: Record<string, StorageColumn>;
21
+ ifNotExists: string[];
22
+ }): Promise<void>;
23
+ clearTable({ tableName }: {
24
+ tableName: TABLE_NAMES;
25
+ }): Promise<void>;
26
+ dropTable({ tableName }: {
27
+ tableName: TABLE_NAMES;
28
+ }): Promise<void>;
29
+ private getBinding;
30
+ getKey<T extends TABLE_NAMES>(tableName: T, record: Record<string, string>): string;
31
+ private getSchemaKey;
32
+ /**
33
+ * Helper to safely parse data from KV storage
34
+ */
35
+ private safeParse;
36
+ private createNamespaceById;
37
+ private createNamespace;
38
+ private listNamespaces;
39
+ private getNamespaceIdByName;
40
+ private getOrCreateNamespaceId;
41
+ private getNamespaceId;
42
+ private getNamespaceValue;
43
+ getKV(tableName: TABLE_NAMES, key: string): Promise<any>;
44
+ private getTableSchema;
45
+ private validateColumnValue;
46
+ private validateAgainstSchema;
47
+ private validateRecord;
48
+ insert({ tableName, record }: {
49
+ tableName: TABLE_NAMES;
50
+ record: Record<string, any>;
51
+ }): Promise<void>;
52
+ load<R>({ tableName, keys }: {
53
+ tableName: TABLE_NAMES;
54
+ keys: Record<string, string>;
55
+ }): Promise<R | null>;
56
+ batchInsert<T extends TABLE_NAMES>(input: {
57
+ tableName: T;
58
+ records: Partial<RecordTypes[T]>[];
59
+ }): Promise<void>;
60
+ /**
61
+ * Helper to safely serialize data for KV storage
62
+ */
63
+ private safeSerialize;
64
+ private putNamespaceValue;
65
+ putKV({ tableName, key, value, metadata, }: {
66
+ tableName: TABLE_NAMES;
67
+ key: string;
68
+ value: any;
69
+ metadata?: any;
70
+ }): Promise<void>;
71
+ createTable({ tableName, schema, }: {
72
+ tableName: TABLE_NAMES;
73
+ schema: Record<string, StorageColumn>;
74
+ }): Promise<void>;
75
+ listNamespaceKeys(tableName: TABLE_NAMES, options?: ListOptions): Promise<import("@cloudflare/workers-types").KVNamespaceListKey<unknown, string>[]>;
76
+ private deleteNamespaceValue;
77
+ deleteKV(tableName: TABLE_NAMES, key: string): Promise<void>;
78
+ listKV(tableName: TABLE_NAMES, options?: ListOptions): Promise<Array<{
79
+ name: string;
80
+ }>>;
81
+ }
82
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EACL,eAAe,EAMhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,yBAA0B,SAAQ,eAAe;IAC5D,OAAO,CAAC,QAAQ,CAAC,CAAmC;IACpD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,S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,WAAW,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAQ9F"}
@@ -0,0 +1,50 @@
1
+ import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
2
+ import { ScoresStorage } from '@mastra/core/storage';
3
+ import type { StoragePagination, PaginationInfo } from '@mastra/core/storage';
4
+ import type { StoreOperationsCloudflare } from '../operations/index.js';
5
+ export declare class ScoresStorageCloudflare extends ScoresStorage {
6
+ private operations;
7
+ constructor({ operations }: {
8
+ operations: StoreOperationsCloudflare;
9
+ });
10
+ getScoreById({ id }: {
11
+ id: string;
12
+ }): Promise<ScoreRowData | null>;
13
+ saveScore(score: Omit<ScoreRowData, 'createdAt' | 'updatedAt'>): Promise<{
14
+ score: ScoreRowData;
15
+ }>;
16
+ listScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
17
+ scorerId: string;
18
+ entityId?: string;
19
+ entityType?: string;
20
+ source?: ScoringSource;
21
+ pagination: StoragePagination;
22
+ }): Promise<{
23
+ pagination: PaginationInfo;
24
+ scores: ScoreRowData[];
25
+ }>;
26
+ listScoresByRunId({ runId, pagination, }: {
27
+ runId: string;
28
+ pagination: StoragePagination;
29
+ }): Promise<{
30
+ pagination: PaginationInfo;
31
+ scores: ScoreRowData[];
32
+ }>;
33
+ listScoresByEntityId({ entityId, entityType, pagination, }: {
34
+ pagination: StoragePagination;
35
+ entityId: string;
36
+ entityType: string;
37
+ }): Promise<{
38
+ pagination: PaginationInfo;
39
+ scores: ScoreRowData[];
40
+ }>;
41
+ listScoresBySpan({ traceId, spanId, pagination, }: {
42
+ traceId: string;
43
+ spanId: string;
44
+ pagination: StoragePagination;
45
+ }): Promise<{
46
+ pagination: PaginationInfo;
47
+ scores: ScoreRowData[];
48
+ }>;
49
+ }
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sour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c,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAoD7D,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;CAmDpE"}
@@ -0,0 +1,47 @@
1
+ import { WorkflowsStorage } from '@mastra/core/storage';
2
+ import type { WorkflowRun, WorkflowRuns, StorageListWorkflowRunsInput } from '@mastra/core/storage';
3
+ import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
4
+ import type { StoreOperationsCloudflare } from '../operations/index.js';
5
+ export declare class WorkflowsStorageCloudflare extends WorkflowsStorage {
6
+ private operations;
7
+ constructor({ operations }: {
8
+ operations: StoreOperationsCloudflare;
9
+ });
10
+ private validateWorkflowParams;
11
+ updateWorkflowResults({}: {
12
+ workflowName: string;
13
+ runId: string;
14
+ stepId: string;
15
+ result: StepResult<any, any, any, any>;
16
+ requestContext: Record<string, any>;
17
+ }): Promise<Record<string, StepResult<any, any, any, any>>>;
18
+ updateWorkflowState({}: {
19
+ workflowName: string;
20
+ runId: string;
21
+ opts: {
22
+ status: string;
23
+ result?: StepResult<any, any, any, any>;
24
+ error?: string;
25
+ suspendedPaths?: Record<string, number[]>;
26
+ waitingPaths?: Record<string, number[]>;
27
+ };
28
+ }): Promise<WorkflowRunState | undefined>;
29
+ persistWorkflowSnapshot(params: {
30
+ workflowName: string;
31
+ runId: string;
32
+ resourceId?: string;
33
+ snapshot: WorkflowRunState;
34
+ }): Promise<void>;
35
+ loadWorkflowSnapshot(params: {
36
+ workflowName: string;
37
+ runId: string;
38
+ }): Promise<WorkflowRunState | null>;
39
+ private parseWorkflowRun;
40
+ private buildWorkflowSnapshotPrefix;
41
+ listWorkflowRuns({ workflowName, page, perPage, resourceId, fromDate, toDate, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
42
+ getWorkflowRunById({ runId, workflowName, }: {
43
+ runId: string;
44
+ workflowName: string;
45
+ }): Promise<WorkflowRun | null>;
46
+ }
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAuC,gBAAgB,EAAoB,MAAM,sBAAsB,CAAC;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC9D,OAAO,CAAC,UAAU,CAA4B;gBAElC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,yBAAyB,CAAA;KAAE;IAKrE,OAAO,CAAC,sBAAsB;IAO9B,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,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AAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CA4ChC"}
@@ -0,0 +1,175 @@
1
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
2
+ import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
3
+ import type { StorageThreadType, MastraDBMessage } from '@mastra/core/memory';
4
+ import { MastraStorage } from '@mastra/core/storage';
5
+ import type { TABLE_NAMES, StorageColumn, StorageGetMessagesArg, WorkflowRuns, WorkflowRun, PaginationInfo, StoragePagination, StorageDomains, StorageResourceType, StorageListWorkflowRunsInput } from '@mastra/core/storage';
6
+ import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
7
+ import type { CloudflareStoreConfig, RecordTypes } from './types.js';
8
+ export declare class CloudflareStore extends MastraStorage {
9
+ stores: StorageDomains;
10
+ private client?;
11
+ private accountId?;
12
+ private namespacePrefix;
13
+ private bindings?;
14
+ private validateWorkersConfig;
15
+ private validateRestConfig;
16
+ get supports(): {
17
+ selectByIncludeResourceScope: boolean;
18
+ resourceWorkingMemory: boolean;
19
+ hasColumn: boolean;
20
+ createTable: boolean;
21
+ deleteMessages: boolean;
22
+ aiTracing?: boolean;
23
+ indexManagement?: boolean;
24
+ listScoresBySpan?: boolean;
25
+ };
26
+ constructor(config: CloudflareStoreConfig);
27
+ createTable({ tableName, schema, }: {
28
+ tableName: TABLE_NAMES;
29
+ schema: Record<string, StorageColumn>;
30
+ }): Promise<void>;
31
+ alterTable(_args: {
32
+ tableName: TABLE_NAMES;
33
+ schema: Record<string, StorageColumn>;
34
+ ifNotExists: string[];
35
+ }): Promise<void>;
36
+ clearTable({ tableName }: {
37
+ tableName: TABLE_NAMES;
38
+ }): Promise<void>;
39
+ dropTable({ tableName }: {
40
+ tableName: TABLE_NAMES;
41
+ }): Promise<void>;
42
+ insert<T extends TABLE_NAMES>({ tableName, record, }: {
43
+ tableName: T;
44
+ record: Record<string, any>;
45
+ }): Promise<void>;
46
+ load<R>({ tableName, keys }: {
47
+ tableName: TABLE_NAMES;
48
+ keys: Record<string, string>;
49
+ }): Promise<R | null>;
50
+ getThreadById({ threadId }: {
51
+ threadId: string;
52
+ }): Promise<StorageThreadType | null>;
53
+ saveThread({ thread }: {
54
+ thread: StorageThreadType;
55
+ }): Promise<StorageThreadType>;
56
+ updateThread({ id, title, metadata, }: {
57
+ id: string;
58
+ title: string;
59
+ metadata: Record<string, unknown>;
60
+ }): Promise<StorageThreadType>;
61
+ deleteThread({ threadId }: {
62
+ threadId: string;
63
+ }): Promise<void>;
64
+ saveMessages(args: {
65
+ messages: MastraDBMessage[];
66
+ }): Promise<{
67
+ messages: MastraDBMessage[];
68
+ }>;
69
+ getMessages({ threadId, resourceId, selectBy, }: StorageGetMessagesArg): Promise<{
70
+ messages: MastraDBMessage[];
71
+ }>;
72
+ updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
73
+ workflowName: string;
74
+ runId: string;
75
+ stepId: string;
76
+ result: StepResult<any, any, any, any>;
77
+ requestContext: Record<string, any>;
78
+ }): Promise<Record<string, StepResult<any, any, any, any>>>;
79
+ updateWorkflowState({ workflowName, runId, opts, }: {
80
+ workflowName: string;
81
+ runId: string;
82
+ opts: {
83
+ status: string;
84
+ result?: StepResult<any, any, any, any>;
85
+ error?: string;
86
+ suspendedPaths?: Record<string, number[]>;
87
+ waitingPaths?: Record<string, number[]>;
88
+ };
89
+ }): Promise<WorkflowRunState | undefined>;
90
+ listMessagesById({ messageIds }: {
91
+ messageIds: string[];
92
+ }): Promise<{
93
+ messages: MastraDBMessage[];
94
+ }>;
95
+ persistWorkflowSnapshot(params: {
96
+ workflowName: string;
97
+ runId: string;
98
+ resourceId?: string;
99
+ snapshot: WorkflowRunState;
100
+ }): Promise<void>;
101
+ loadWorkflowSnapshot(params: {
102
+ workflowName: string;
103
+ runId: string;
104
+ }): Promise<WorkflowRunState | null>;
105
+ batchInsert<T extends TABLE_NAMES>(input: {
106
+ tableName: T;
107
+ records: Partial<RecordTypes[T]>[];
108
+ }): Promise<void>;
109
+ listWorkflowRuns({ workflowName, perPage, page, resourceId, fromDate, toDate, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
110
+ getWorkflowRunById({ runId, workflowName, }: {
111
+ runId: string;
112
+ workflowName: string;
113
+ }): Promise<WorkflowRun | null>;
114
+ updateMessages(args: {
115
+ messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
116
+ id: string;
117
+ content?: {
118
+ metadata?: MastraMessageContentV2['metadata'];
119
+ content?: MastraMessageContentV2['content'];
120
+ };
121
+ })[];
122
+ }): Promise<MastraDBMessage[]>;
123
+ getScoreById({ id }: {
124
+ id: string;
125
+ }): Promise<ScoreRowData | null>;
126
+ saveScore(score: ScoreRowData): Promise<{
127
+ score: ScoreRowData;
128
+ }>;
129
+ listScoresByRunId({ runId, pagination, }: {
130
+ runId: string;
131
+ pagination: StoragePagination;
132
+ }): Promise<{
133
+ pagination: PaginationInfo;
134
+ scores: ScoreRowData[];
135
+ }>;
136
+ listScoresByEntityId({ entityId, entityType, pagination, }: {
137
+ pagination: StoragePagination;
138
+ entityId: string;
139
+ entityType: string;
140
+ }): Promise<{
141
+ pagination: PaginationInfo;
142
+ scores: ScoreRowData[];
143
+ }>;
144
+ listScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
145
+ scorerId: string;
146
+ entityId?: string;
147
+ entityType?: string;
148
+ source?: ScoringSource;
149
+ pagination: StoragePagination;
150
+ }): Promise<{
151
+ pagination: PaginationInfo;
152
+ scores: ScoreRowData[];
153
+ }>;
154
+ listScoresBySpan({ traceId, spanId, pagination, }: {
155
+ traceId: string;
156
+ spanId: string;
157
+ pagination: StoragePagination;
158
+ }): Promise<{
159
+ pagination: PaginationInfo;
160
+ scores: ScoreRowData[];
161
+ }>;
162
+ getResourceById({ resourceId }: {
163
+ resourceId: string;
164
+ }): Promise<StorageResourceType | null>;
165
+ saveResource({ resource }: {
166
+ resource: StorageResourceType;
167
+ }): Promise<StorageResourceType>;
168
+ updateResource({ resourceId, workingMemory, metadata, }: {
169
+ resourceId: string;
170
+ workingMemory?: string;
171
+ metadata?: Record<string, unknown>;
172
+ }): Promise<StorageResourceType>;
173
+ close(): Promise<void>;
174
+ }
175
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,aAAa,EAKd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,eAAgB,SAAQ,aAAa;IAChD,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,MAAM,CAAC,CAAa;IAC5B,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,CAAmC;IAEpD,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,kBAAkB;IAc1B,IAAW,QAAQ;;;;;;;;;MAMlB;gBAEW,MAAM,EAAE,qBAAqB;IAwDnC,WAAW,CAAC,EAChB,SAAS,EACT,MAAM,GACP,E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QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAI7D,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;IAI7D,eAAe,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAI5F,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI3F,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;IAI1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
@@ -0,0 +1,25 @@
1
+ import type { WorkflowRunState } from '@mastra/core/workflows';
2
+ export declare const createSampleTrace: (name: string, scope?: string, attributes?: Record<string, string>) => {
3
+ id: string;
4
+ parentSpanId: string;
5
+ traceId: string;
6
+ name: string;
7
+ scope: string | undefined;
8
+ kind: string;
9
+ status: string;
10
+ events: string;
11
+ links: string;
12
+ attributes: string | undefined;
13
+ startTime: string;
14
+ endTime: string;
15
+ other: string;
16
+ createdAt: string;
17
+ };
18
+ export declare const createSampleWorkflowSnapshot: (threadId: string, status: string, createdAt?: Date) => {
19
+ snapshot: WorkflowRunState;
20
+ runId: string;
21
+ stepId: string;
22
+ };
23
+ export declare const retryUntil: <T>(fn: () => Promise<T>, condition: (result: T) => boolean, timeout?: number, // REST API needs longer timeout due to higher latency
24
+ interval?: number) => Promise<T>;
25
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../src/storage/test-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,aAAa,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;CAejG,CAAC;AAEH,eAAO,MAAM,4BAA4B,GAAI,UAAU,MAAM,EAAE,QAAQ,MAAM,EAAE,YAAY,IAAI;;;;CA2B9F,CAAC;AAGF,eAAO,MAAM,UAAU,GAAU,CAAC,EAChC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,WAAW,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,EACjC,gBAAe,EAAE,sDAAsD;AACvE,iBAAe,KACd,OAAO,CAAC,CAAC,CAYX,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { KVNamespace } from '@cloudflare/workers-types';
2
+ import type { ScoreRowData } from '@mastra/core/evals';
3
+ import type { StorageThreadType, MastraDBMessage } from '@mastra/core/memory';
4
+ import type { TABLE_MESSAGES, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, TABLE_TRACES, TABLE_RESOURCES, TABLE_NAMES, StorageResourceType, TABLE_SCORERS, TABLE_AI_SPANS, AISpanRecord } from '@mastra/core/storage';
5
+ import type { WorkflowRunState } from '@mastra/core/workflows';
6
+ /**
7
+ * Configuration for Cloudflare KV using REST API
8
+ */
9
+ export interface CloudflareRestConfig {
10
+ /** Cloudflare account ID */
11
+ accountId: string;
12
+ /** Cloudflare API token with KV access */
13
+ apiToken: string;
14
+ /**
15
+ * Prefix for KV namespace names.
16
+ * Recommended for production use to ensure data isolation between different instances.
17
+ * If not provided, no prefix will be used
18
+ */
19
+ namespacePrefix?: string;
20
+ }
21
+ /**
22
+ * Configuration for Cloudflare KV using Workers Binding API
23
+ */
24
+ export interface CloudflareWorkersConfig {
25
+ /** KV namespace bindings from Workers environment */
26
+ bindings: {
27
+ [key in TABLE_NAMES]: KVNamespace;
28
+ };
29
+ /** Optional prefix for keys within namespaces */
30
+ keyPrefix?: string;
31
+ }
32
+ /**
33
+ * Combined configuration type supporting both REST API and Workers Binding API
34
+ */
35
+ export type CloudflareStoreConfig = CloudflareRestConfig | CloudflareWorkersConfig;
36
+ /**
37
+ * Interface for KV operations with type support
38
+ */
39
+ export interface KVOperation {
40
+ /** Table/namespace to operate on */
41
+ tableName: TABLE_NAMES;
42
+ /** Key to read/write */
43
+ key: string;
44
+ /** Value to write (for put operations) */
45
+ value?: any;
46
+ /** Optional metadata to associate with the value */
47
+ metadata?: any;
48
+ }
49
+ /**
50
+ * Helper to determine if a config is using Workers bindings
51
+ */
52
+ export declare function isWorkersConfig(config: CloudflareStoreConfig): config is CloudflareWorkersConfig;
53
+ export type RecordTypes = {
54
+ [TABLE_THREADS]: StorageThreadType;
55
+ [TABLE_MESSAGES]: MastraDBMessage;
56
+ [TABLE_WORKFLOW_SNAPSHOT]: WorkflowRunState;
57
+ [TABLE_SCORERS]: ScoreRowData;
58
+ [TABLE_TRACES]: any;
59
+ [TABLE_RESOURCES]: StorageResourceType;
60
+ [TABLE_AI_SPANS]: AISpanRecord;
61
+ };
62
+ export type ListOptions = {
63
+ limit?: number;
64
+ prefix?: string;
65
+ };
66
+ //# sourceMappingURL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qB,GAAG,MAAM,IAAI,uBAAuB,CAEhG;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IACnC,CAAC,cAAc,CAAC,EAAE,eAAe,CAAC;IAClC,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IAC5C,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IAC9B,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC;IACpB,CAAC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACvC,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@mastra/cloudflare",
3
- "version": "0.0.0-vnext-inngest-20250508131921",
3
+ "version": "0.0.0-vnext-20251104230439",
4
4
  "description": "Cloudflare provider for Mastra - includes db storage capabilities",
5
5
  "type": "module",
6
6
  "files": [
7
- "dist"
7
+ "dist",
8
+ "CHANGELOG.md"
8
9
  ],
9
10
  "main": "dist/index.js",
10
11
  "types": "dist/index.d.ts",
@@ -15,32 +16,46 @@
15
16
  "default": "./dist/index.js"
16
17
  },
17
18
  "require": {
18
- "types": "./dist/index.d.cts",
19
+ "types": "./dist/index.d.ts",
19
20
  "default": "./dist/index.cjs"
20
21
  }
21
22
  },
22
23
  "./package.json": "./package.json"
23
24
  },
24
- "license": "MIT",
25
+ "license": "Apache-2.0",
25
26
  "dependencies": {
26
- "cloudflare": "^4.1.0",
27
- "@mastra/core": "0.0.0-vnext-inngest-20250508131921"
27
+ "cloudflare": "^4.5.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@cloudflare/workers-types": "^4.20250313.0",
31
- "@microsoft/api-extractor": "^7.52.5",
32
- "@types/node": "^20.17.27",
33
- "dotenv": "^16.4.7",
34
- "eslint": "^9.23.0",
35
- "miniflare": "^4.20250310.0",
36
- "tsup": "^8.4.0",
37
- "typescript": "^5.8.2",
38
- "vitest": "^3.1.2",
39
- "@internal/lint": "0.0.0-vnext-inngest-20250508131921"
30
+ "@cloudflare/workers-types": "^4.20251008.0",
31
+ "@microsoft/api-extractor": "^7.52.8",
32
+ "@types/node": "^20.19.0",
33
+ "dotenv": "^17.0.0",
34
+ "eslint": "^9.37.0",
35
+ "miniflare": "^4.20251008.0",
36
+ "tsup": "^8.5.0",
37
+ "typescript": "^5.8.3",
38
+ "vitest": "^3.2.4",
39
+ "@internal/lint": "0.0.0-vnext-20251104230439",
40
+ "@internal/storage-test-utils": "0.0.49",
41
+ "@mastra/core": "0.0.0-vnext-20251104230439",
42
+ "@internal/types-builder": "0.0.0-vnext-20251104230439"
43
+ },
44
+ "peerDependencies": {
45
+ "@mastra/core": "0.0.0-vnext-20251104230439"
46
+ },
47
+ "homepage": "https://mastra.ai",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/mastra-ai/mastra.git",
51
+ "directory": "stores/cloudflare"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/mastra-ai/mastra/issues"
40
55
  },
41
56
  "scripts": {
42
- "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
43
- "build:watch": "pnpm build --watch",
57
+ "build": "tsup --silent --config tsup.config.ts",
58
+ "build:watch": "tsup --watch --silent --config tsup.config.ts",
44
59
  "test": "vitest run",
45
60
  "lint": "eslint ."
46
61
  }