@mastra/cloudflare 0.0.0-vnext-inngest-20250508131921 → 0.0.0-vnext-20251119160359
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 +1874 -0
- package/LICENSE.md +12 -4
- package/README.md +37 -15
- package/dist/index.cjs +1936 -819
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1923 -806
- package/dist/index.js.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +89 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -0
- package/dist/storage/domains/operations/index.d.ts +82 -0
- package/dist/storage/domains/operations/index.d.ts.map +1 -0
- package/dist/storage/domains/scores/index.d.ts +50 -0
- package/dist/storage/domains/scores/index.d.ts.map +1 -0
- package/dist/storage/domains/workflows/index.d.ts +47 -0
- package/dist/storage/domains/workflows/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +172 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/test-utils.d.ts +25 -0
- package/dist/storage/test-utils.d.ts.map +1 -0
- package/dist/storage/types.d.ts +70 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/package.json +38 -18
- package/dist/_tsup-dts-rollup.d.cts +0 -276
- package/dist/_tsup-dts-rollup.d.ts +0 -276
- package/dist/index.d.cts +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
# Apache License 2.0
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copyright (c) 2025 Kepler Software, Inc.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -25,7 +25,6 @@ const store = new CloudflareStore({
|
|
|
25
25
|
threads: THREADS_KV_NAMESPACE,
|
|
26
26
|
messages: MESSAGES_KV_NAMESPACE,
|
|
27
27
|
workflow_snapshot: WORKFLOW_KV_NAMESPACE,
|
|
28
|
-
evals: EVALS_KV_NAMESPACE,
|
|
29
28
|
traces: TRACES_KV_NAMESPACE,
|
|
30
29
|
},
|
|
31
30
|
keyPrefix: 'myapp_', // Optional
|
|
@@ -40,12 +39,13 @@ const store = new CloudflareStore({
|
|
|
40
39
|
|
|
41
40
|
// Save a thread
|
|
42
41
|
await store.saveThread({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
thread: {
|
|
43
|
+
id: 'thread-123',
|
|
44
|
+
resourceId: 'resource-456',
|
|
45
|
+
title: 'My Thread',
|
|
46
|
+
metadata: { key: 'value' },
|
|
47
|
+
createdAt: new Date(),
|
|
48
|
+
},
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
// Add messages
|
|
@@ -62,7 +62,7 @@ await store.saveMessages({
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
// Query messages
|
|
65
|
-
const messages = await store.
|
|
65
|
+
const messages = await store.listMessages({ threadId: 'thread-123' });
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
## Configuration
|
|
@@ -95,25 +95,47 @@ const messages = await store.getMessages({ threadId: 'thread-123' });
|
|
|
95
95
|
|
|
96
96
|
### Thread Operations
|
|
97
97
|
|
|
98
|
-
- `saveThread(thread)`: Create or update a thread
|
|
98
|
+
- `saveThread({ thread })`: Create or update a thread
|
|
99
99
|
- `getThreadById({ threadId })`: Get a thread by ID
|
|
100
|
-
- `
|
|
100
|
+
- `listThreadsByResourceId({ resourceId, offset, limit, orderBy? })`: List paginated threads for a resource
|
|
101
101
|
- `updateThread({ id, title, metadata })`: Update thread title and metadata
|
|
102
102
|
- `deleteThread({ threadId })`: Delete a thread and its messages
|
|
103
103
|
|
|
104
104
|
### Message Operations
|
|
105
105
|
|
|
106
106
|
- `saveMessages({ messages })`: Save multiple messages
|
|
107
|
-
- `
|
|
107
|
+
- `listMessages({ threadId, perPage?, page? })`: Get messages for a thread with pagination
|
|
108
|
+
- `listMessagesById({ messageIds })`: Get specific messages by their IDs
|
|
109
|
+
- `updateMessages({ messages })`: Update existing messages
|
|
110
|
+
|
|
111
|
+
### Resource Operations
|
|
112
|
+
|
|
113
|
+
- `getResourceById({ resourceId })`: Get a resource by ID
|
|
114
|
+
- `saveResource({ resource })`: Create or save a resource
|
|
115
|
+
- `updateResource({ resourceId, workingMemory })`: Update resource working memory
|
|
108
116
|
|
|
109
117
|
### Workflow Operations
|
|
110
118
|
|
|
111
|
-
- `persistWorkflowSnapshot({ workflowName, runId, snapshot })`: Save workflow state
|
|
112
|
-
- `loadWorkflowSnapshot({ workflowName, runId })`: Load
|
|
119
|
+
- `persistWorkflowSnapshot({ workflowName, runId, snapshot })`: Save workflow state
|
|
120
|
+
- `loadWorkflowSnapshot({ workflowName, runId })`: Load workflow state
|
|
121
|
+
- `listWorkflowRuns({ workflowName, pagination })`: List workflow runs with pagination
|
|
122
|
+
- `getWorkflowRunById({ workflowName, runId })`: Get a specific workflow run
|
|
123
|
+
- `updateWorkflowState({ workflowName, runId, state })`: Update workflow state
|
|
124
|
+
- `updateWorkflowResults({ workflowName, runId, results })`: Update workflow results
|
|
125
|
+
|
|
126
|
+
### Evaluation/Scoring Operations
|
|
127
|
+
|
|
128
|
+
- `getScoreById({ id })`: Get a score by ID
|
|
129
|
+
- `saveScore(score)`: Save an evaluation score
|
|
130
|
+
- `listScoresByScorerId({ scorerId, pagination })`: List scores by scorer with pagination
|
|
131
|
+
- `listScoresByRunId({ runId, pagination })`: List scores by run with pagination
|
|
132
|
+
- `listScoresByEntityId({ entityId, entityType, pagination })`: List scores by entity with pagination
|
|
133
|
+
- `listScoresBySpan({ traceId, spanId, pagination })`: List scores by span with pagination
|
|
113
134
|
|
|
114
|
-
###
|
|
135
|
+
### Operations Not Currently Supported
|
|
115
136
|
|
|
116
|
-
- `
|
|
137
|
+
- `deleteMessages(messageIds)`: Message deletion is not currently supported
|
|
138
|
+
- AI Observability (traces/spans): Not currently supported
|
|
117
139
|
|
|
118
140
|
### Utility
|
|
119
141
|
|