@mastra/dynamodb 1.0.6 → 1.0.7-alpha.0
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 +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/entities/background-task.d.ts +10 -0
- package/dist/entities/background-task.d.ts.map +1 -1
- package/dist/entities/index.d.ts +10 -0
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/dynamodb
|
|
2
2
|
|
|
3
|
+
## 1.0.7-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Track `suspendedAt` and `suspendPayload` on background tasks. SQL adapters auto-migrate the new columns via `alterTable`. ([#16260](https://github.com/mastra-ai/mastra/pull/16260))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`9f17410`](https://github.com/mastra-ai/mastra/commit/9f1741080def23d42ee50b39887a385ae316a3c6), [`c6eb39e`](https://github.com/mastra-ai/mastra/commit/c6eb39ea6dca381c6563cb240237fbe608e02f93), [`900d086`](https://github.com/mastra-ai/mastra/commit/900d086bb737b9cf2fcf68f11b0389b801a2738c), [`4c0e286`](https://github.com/mastra-ai/mastra/commit/4c0e28637c9cfb4f416549b55e97ebfa13319dfc), [`25184ff`](https://github.com/mastra-ai/mastra/commit/25184ffaf1293ec95119426eb1a1f8d38831b96c), [`aebde9c`](https://github.com/mastra-ai/mastra/commit/aebde9cfacf56592c6b6350cae721740fe090b8a)]:
|
|
10
|
+
- @mastra/core@1.33.0-alpha.4
|
|
11
|
+
|
|
3
12
|
## 1.0.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -56,6 +56,12 @@ export declare const backgroundTaskEntity: Entity<string, string, string, {
|
|
|
56
56
|
type: "string";
|
|
57
57
|
required: false;
|
|
58
58
|
};
|
|
59
|
+
suspendPayload: {
|
|
60
|
+
set: (value?: unknown) => string | undefined;
|
|
61
|
+
get: (value?: string) => any;
|
|
62
|
+
type: "string";
|
|
63
|
+
required: false;
|
|
64
|
+
};
|
|
59
65
|
retryCount: {
|
|
60
66
|
type: "number";
|
|
61
67
|
required: true;
|
|
@@ -72,6 +78,10 @@ export declare const backgroundTaskEntity: Entity<string, string, string, {
|
|
|
72
78
|
type: "string";
|
|
73
79
|
required: false;
|
|
74
80
|
};
|
|
81
|
+
suspendedAtIso: {
|
|
82
|
+
type: "string";
|
|
83
|
+
required: false;
|
|
84
|
+
};
|
|
75
85
|
completedAtIso: {
|
|
76
86
|
type: "string";
|
|
77
87
|
required: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-task.d.ts","sourceRoot":"","sources":["../../src/entities/background-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AA2BnC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAnBjB,OAAO;0BAKP,MAAM;;;;;0BALN,OAAO;0BAKP,MAAM;;;;;0BALN,OAAO;0BAKP,MAAM
|
|
1
|
+
{"version":3,"file":"background-task.d.ts","sourceRoot":"","sources":["../../src/entities/background-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AA2BnC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAnBjB,OAAO;0BAKP,MAAM;;;;;0BALN,OAAO;0BAKP,MAAM;;;;;0BALN,OAAO;0BAKP,MAAM;;;;;0BALN,OAAO;0BAKP,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6HpB,CAAC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -875,6 +875,12 @@ export declare function getElectroDbService(client: DynamoDBDocumentClient, tabl
|
|
|
875
875
|
type: "string";
|
|
876
876
|
required: false;
|
|
877
877
|
};
|
|
878
|
+
suspendPayload: {
|
|
879
|
+
set: (value?: unknown) => string | undefined;
|
|
880
|
+
get: (value?: string) => any;
|
|
881
|
+
type: "string";
|
|
882
|
+
required: false;
|
|
883
|
+
};
|
|
878
884
|
retryCount: {
|
|
879
885
|
type: "number";
|
|
880
886
|
required: true;
|
|
@@ -891,6 +897,10 @@ export declare function getElectroDbService(client: DynamoDBDocumentClient, tabl
|
|
|
891
897
|
type: "string";
|
|
892
898
|
required: false;
|
|
893
899
|
};
|
|
900
|
+
suspendedAtIso: {
|
|
901
|
+
type: "string";
|
|
902
|
+
required: false;
|
|
903
|
+
};
|
|
894
904
|
completedAtIso: {
|
|
895
905
|
type: "string";
|
|
896
906
|
required: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,mBAAmB,CAAC,M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}
|
package/dist/index.cjs
CHANGED
|
@@ -160,6 +160,11 @@ var backgroundTaskEntity = new electrodb.Entity({
|
|
|
160
160
|
required: false,
|
|
161
161
|
...jsonSetGet
|
|
162
162
|
},
|
|
163
|
+
suspendPayload: {
|
|
164
|
+
type: "string",
|
|
165
|
+
required: false,
|
|
166
|
+
...jsonSetGet
|
|
167
|
+
},
|
|
163
168
|
retryCount: {
|
|
164
169
|
type: "number",
|
|
165
170
|
required: true
|
|
@@ -177,6 +182,10 @@ var backgroundTaskEntity = new electrodb.Entity({
|
|
|
177
182
|
type: "string",
|
|
178
183
|
required: false
|
|
179
184
|
},
|
|
185
|
+
suspendedAtIso: {
|
|
186
|
+
type: "string",
|
|
187
|
+
required: false
|
|
188
|
+
},
|
|
180
189
|
completedAtIso: {
|
|
181
190
|
type: "string",
|
|
182
191
|
required: false
|
|
@@ -1182,11 +1191,13 @@ function toElectroRecord(task) {
|
|
|
1182
1191
|
args: serializeJson(task.args),
|
|
1183
1192
|
result: serializeJson(task.result),
|
|
1184
1193
|
error: serializeJson(task.error),
|
|
1194
|
+
suspendPayload: serializeJson(task.suspendPayload),
|
|
1185
1195
|
retryCount: task.retryCount,
|
|
1186
1196
|
maxRetries: task.maxRetries,
|
|
1187
1197
|
timeoutMs: task.timeoutMs,
|
|
1188
1198
|
createdAt: task.createdAt.toISOString(),
|
|
1189
1199
|
startedAtIso: task.startedAt?.toISOString(),
|
|
1200
|
+
suspendedAtIso: task.suspendedAt?.toISOString(),
|
|
1190
1201
|
completedAtIso: task.completedAt?.toISOString()
|
|
1191
1202
|
};
|
|
1192
1203
|
}
|
|
@@ -1215,11 +1226,13 @@ function fromElectroRecord(data) {
|
|
|
1215
1226
|
runId: String(data.runId),
|
|
1216
1227
|
result: parseJson(data.result),
|
|
1217
1228
|
error: parseJson(data.error),
|
|
1229
|
+
suspendPayload: parseJson(data.suspendPayload),
|
|
1218
1230
|
retryCount: Number(data.retryCount ?? 0),
|
|
1219
1231
|
maxRetries: Number(data.maxRetries ?? 0),
|
|
1220
1232
|
timeoutMs: Number(data.timeoutMs ?? 3e5),
|
|
1221
1233
|
createdAt: asDate(data.createdAt) ?? /* @__PURE__ */ new Date(),
|
|
1222
1234
|
startedAt: asDate(data.startedAtIso),
|
|
1235
|
+
suspendedAt: asDate(data.suspendedAtIso),
|
|
1223
1236
|
completedAt: asDate(data.completedAtIso)
|
|
1224
1237
|
};
|
|
1225
1238
|
}
|
|
@@ -1272,6 +1285,13 @@ var BackgroundTasksStorageDynamoDB = class extends storage.BackgroundTasksStorag
|
|
|
1272
1285
|
setFields.error = serializeJson(update.error);
|
|
1273
1286
|
}
|
|
1274
1287
|
}
|
|
1288
|
+
if ("suspendPayload" in update) {
|
|
1289
|
+
if (update.suspendPayload === void 0 || update.suspendPayload === null) {
|
|
1290
|
+
removeFields.push("suspendPayload");
|
|
1291
|
+
} else {
|
|
1292
|
+
setFields.suspendPayload = serializeJson(update.suspendPayload);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1275
1295
|
if ("startedAt" in update) {
|
|
1276
1296
|
if (update.startedAt === void 0 || update.startedAt === null) {
|
|
1277
1297
|
removeFields.push("startedAtIso");
|
|
@@ -1279,6 +1299,13 @@ var BackgroundTasksStorageDynamoDB = class extends storage.BackgroundTasksStorag
|
|
|
1279
1299
|
setFields.startedAtIso = update.startedAt.toISOString();
|
|
1280
1300
|
}
|
|
1281
1301
|
}
|
|
1302
|
+
if ("suspendedAt" in update) {
|
|
1303
|
+
if (update.suspendedAt === void 0 || update.suspendedAt === null) {
|
|
1304
|
+
removeFields.push("suspendedAtIso");
|
|
1305
|
+
} else {
|
|
1306
|
+
setFields.suspendedAtIso = update.suspendedAt.toISOString();
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1282
1309
|
if ("completedAt" in update) {
|
|
1283
1310
|
if (update.completedAt === void 0 || update.completedAt === null) {
|
|
1284
1311
|
removeFields.push("completedAtIso");
|
|
@@ -1345,6 +1372,7 @@ var BackgroundTasksStorageDynamoDB = class extends storage.BackgroundTasksStorag
|
|
|
1345
1372
|
if (filter.threadId) tasks = tasks.filter((t) => t.threadId === filter.threadId);
|
|
1346
1373
|
if (filter.resourceId) tasks = tasks.filter((t) => t.resourceId === filter.resourceId);
|
|
1347
1374
|
if (filter.toolName) tasks = tasks.filter((t) => t.toolName === filter.toolName);
|
|
1375
|
+
if (filter.toolCallId) tasks = tasks.filter((t) => t.toolCallId === filter.toolCallId);
|
|
1348
1376
|
if (filter.runId) tasks = tasks.filter((t) => t.runId === filter.runId);
|
|
1349
1377
|
const dateCol = filter.dateFilterBy ?? "createdAt";
|
|
1350
1378
|
if (filter.fromDate) {
|