@mastra/dynamodb 1.0.0-beta.4 → 1.0.0-beta.6
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 +51 -0
- package/dist/index.cjs +25 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +6 -8
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +6 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @mastra/dynamodb
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
|
|
8
|
+
|
|
9
|
+
Workflow errors now retain custom properties like `statusCode`, `responseHeaders`, and `cause` chains. This enables error-specific recovery logic in your applications.
|
|
10
|
+
|
|
11
|
+
**Before:**
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
const result = await workflow.execute({ input });
|
|
15
|
+
if (result.status === 'failed') {
|
|
16
|
+
// Custom error properties were lost
|
|
17
|
+
console.log(result.error); // "Step execution failed" (just a string)
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**After:**
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
const result = await workflow.execute({ input });
|
|
25
|
+
if (result.status === 'failed') {
|
|
26
|
+
// Custom properties are preserved
|
|
27
|
+
console.log(result.error.message); // "Step execution failed"
|
|
28
|
+
console.log(result.error.statusCode); // 429
|
|
29
|
+
console.log(result.error.cause?.name); // "RateLimitError"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Type change:** `WorkflowState.error` and `WorkflowRunState.error` types changed from `string | Error` to `SerializedError`.
|
|
34
|
+
|
|
35
|
+
Other changes:
|
|
36
|
+
- Added `UpdateWorkflowStateOptions` type for workflow state updates
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [[`d5ed981`](https://github.com/mastra-ai/mastra/commit/d5ed981c8701c1b8a27a5f35a9a2f7d9244e695f), [`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd), [`b760b73`](https://github.com/mastra-ai/mastra/commit/b760b731aca7c8a3f041f61d57a7f125ae9cb215), [`695a621`](https://github.com/mastra-ai/mastra/commit/695a621528bdabeb87f83c2277cf2bb084c7f2b4), [`2b459f4`](https://github.com/mastra-ai/mastra/commit/2b459f466fd91688eeb2a44801dc23f7f8a887ab), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`09e4bae`](https://github.com/mastra-ai/mastra/commit/09e4bae18dd5357d2ae078a4a95a2af32168ab08), [`24b76d8`](https://github.com/mastra-ai/mastra/commit/24b76d8e17656269c8ed09a0c038adb9cc2ae95a), [`243a823`](https://github.com/mastra-ai/mastra/commit/243a8239c5906f5c94e4f78b54676793f7510ae3), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`c61fac3`](https://github.com/mastra-ai/mastra/commit/c61fac3add96f0dcce0208c07415279e2537eb62), [`6f14f70`](https://github.com/mastra-ai/mastra/commit/6f14f706ccaaf81b69544b6c1b75ab66a41e5317), [`09e4bae`](https://github.com/mastra-ai/mastra/commit/09e4bae18dd5357d2ae078a4a95a2af32168ab08), [`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f), [`2a53598`](https://github.com/mastra-ai/mastra/commit/2a53598c6d8cfeb904a7fc74e57e526d751c8fa6), [`c7cd3c7`](https://github.com/mastra-ai/mastra/commit/c7cd3c7a187d7aaf79e2ca139de328bf609a14b4), [`847c212`](https://github.com/mastra-ai/mastra/commit/847c212caba7df0d6f2fc756b494ac3c75c3720d), [`6f941c4`](https://github.com/mastra-ai/mastra/commit/6f941c438ca5f578619788acc7608fc2e23bd176)]:
|
|
39
|
+
- @mastra/core@1.0.0-beta.12
|
|
40
|
+
|
|
41
|
+
## 1.0.0-beta.5
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
await workflow.deleteWorkflowRunById(runId);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`edb07e4`](https://github.com/mastra-ai/mastra/commit/edb07e49283e0c28bd094a60e03439bf6ecf0221), [`b7e17d3`](https://github.com/mastra-ai/mastra/commit/b7e17d3f5390bb5a71efc112204413656fcdc18d), [`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d), [`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932), [`4f0331a`](https://github.com/mastra-ai/mastra/commit/4f0331a79bf6eb5ee598a5086e55de4b5a0ada03), [`8a000da`](https://github.com/mastra-ai/mastra/commit/8a000da0c09c679a2312f6b3aa05b2ca78ca7393)]:
|
|
52
|
+
- @mastra/core@1.0.0-beta.10
|
|
53
|
+
|
|
3
54
|
## 1.0.0-beta.4
|
|
4
55
|
|
|
5
56
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1665,7 +1665,8 @@ var StoreOperationsDynamoDB = class extends storage.StoreOperations {
|
|
|
1665
1665
|
[storage.TABLE_SCORERS]: "score",
|
|
1666
1666
|
[storage.TABLE_TRACES]: "trace",
|
|
1667
1667
|
[storage.TABLE_RESOURCES]: "resource",
|
|
1668
|
-
[storage.TABLE_SPANS]: "ai_span"
|
|
1668
|
+
[storage.TABLE_SPANS]: "ai_span",
|
|
1669
|
+
mastra_agents: "agent"
|
|
1669
1670
|
};
|
|
1670
1671
|
return mapping[tableName] || null;
|
|
1671
1672
|
}
|
|
@@ -2485,6 +2486,26 @@ var WorkflowStorageDynamoDB = class extends storage.WorkflowsStorage {
|
|
|
2485
2486
|
);
|
|
2486
2487
|
}
|
|
2487
2488
|
}
|
|
2489
|
+
async deleteWorkflowRunById({ runId, workflowName }) {
|
|
2490
|
+
this.logger.debug("Deleting workflow run by ID", { runId, workflowName });
|
|
2491
|
+
try {
|
|
2492
|
+
await this.service.entities.workflow_snapshot.delete({
|
|
2493
|
+
entity: "workflow_snapshot",
|
|
2494
|
+
workflow_name: workflowName,
|
|
2495
|
+
run_id: runId
|
|
2496
|
+
}).go();
|
|
2497
|
+
} catch (error$1) {
|
|
2498
|
+
throw new error.MastraError(
|
|
2499
|
+
{
|
|
2500
|
+
id: storage.createStorageErrorId("DYNAMODB", "DELETE_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
2501
|
+
domain: error.ErrorDomain.STORAGE,
|
|
2502
|
+
category: error.ErrorCategory.THIRD_PARTY,
|
|
2503
|
+
details: { runId, workflowName }
|
|
2504
|
+
},
|
|
2505
|
+
error$1
|
|
2506
|
+
);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2488
2509
|
};
|
|
2489
2510
|
|
|
2490
2511
|
// src/storage/index.ts
|
|
@@ -2699,6 +2720,9 @@ var DynamoDBStore = class extends storage.MastraStorage {
|
|
|
2699
2720
|
async getWorkflowRunById(args) {
|
|
2700
2721
|
return this.stores.workflows.getWorkflowRunById(args);
|
|
2701
2722
|
}
|
|
2723
|
+
async deleteWorkflowRunById({ runId, workflowName }) {
|
|
2724
|
+
return this.stores.workflows.deleteWorkflowRunById({ runId, workflowName });
|
|
2725
|
+
}
|
|
2702
2726
|
async getResourceById({ resourceId }) {
|
|
2703
2727
|
return this.stores.memory.getResourceById({ resourceId });
|
|
2704
2728
|
}
|