@mastra/dynamodb 0.13.3 → 0.14.0-alpha.1

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.
Files changed (46) hide show
  1. package/dist/entities/eval.d.ts +102 -0
  2. package/dist/entities/eval.d.ts.map +1 -0
  3. package/dist/entities/index.d.ts +746 -0
  4. package/dist/entities/index.d.ts.map +1 -0
  5. package/dist/entities/message.d.ts +100 -0
  6. package/dist/entities/message.d.ts.map +1 -0
  7. package/dist/entities/resource.d.ts +54 -0
  8. package/dist/entities/resource.d.ts.map +1 -0
  9. package/dist/entities/score.d.ts +229 -0
  10. package/dist/entities/score.d.ts.map +1 -0
  11. package/dist/entities/thread.d.ts +69 -0
  12. package/dist/entities/thread.d.ts.map +1 -0
  13. package/dist/entities/trace.d.ts +127 -0
  14. package/dist/entities/trace.d.ts.map +1 -0
  15. package/dist/entities/utils.d.ts +21 -0
  16. package/dist/entities/utils.d.ts.map +1 -0
  17. package/dist/entities/workflow-snapshot.d.ts +74 -0
  18. package/dist/entities/workflow-snapshot.d.ts.map +1 -0
  19. package/dist/index.cjs +71 -16
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +71 -16
  24. package/dist/index.js.map +1 -0
  25. package/dist/storage/domains/legacy-evals/index.d.ts +19 -0
  26. package/dist/storage/domains/legacy-evals/index.d.ts.map +1 -0
  27. package/dist/storage/domains/memory/index.d.ts +81 -0
  28. package/dist/storage/domains/memory/index.d.ts.map +1 -0
  29. package/dist/storage/domains/operations/index.d.ts +69 -0
  30. package/dist/storage/domains/operations/index.d.ts.map +1 -0
  31. package/dist/storage/domains/score/index.d.ts +42 -0
  32. package/dist/storage/domains/score/index.d.ts.map +1 -0
  33. package/dist/storage/domains/traces/index.d.ts +28 -0
  34. package/dist/storage/domains/traces/index.d.ts.map +1 -0
  35. package/dist/storage/domains/workflows/index.d.ts +32 -0
  36. package/dist/storage/domains/workflows/index.d.ts.map +1 -0
  37. package/dist/storage/index.d.ts +220 -0
  38. package/dist/storage/index.d.ts.map +1 -0
  39. package/package.json +9 -8
  40. package/src/entities/score.ts +32 -0
  41. package/src/storage/domains/memory/index.ts +56 -19
  42. package/src/storage/domains/score/index.ts +6 -3
  43. package/src/storage/index.ts +10 -7
  44. package/dist/_tsup-dts-rollup.d.cts +0 -1977
  45. package/dist/_tsup-dts-rollup.d.ts +0 -1977
  46. package/dist/index.d.cts +0 -2
@@ -0,0 +1,746 @@
1
+ import type { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
2
+ import { Service } from 'electrodb';
3
+ export declare function getElectroDbService(client: DynamoDBDocumentClient, tableName: string): Service<{
4
+ thread: import("electrodb").Entity<string, string, string, {
5
+ model: {
6
+ entity: string;
7
+ version: string;
8
+ service: string;
9
+ };
10
+ attributes: {
11
+ id: {
12
+ type: "string";
13
+ required: true;
14
+ };
15
+ resourceId: {
16
+ type: "string";
17
+ required: true;
18
+ };
19
+ title: {
20
+ type: "string";
21
+ required: true;
22
+ };
23
+ metadata: {
24
+ type: "string";
25
+ required: false;
26
+ set: (value?: Record<string, unknown> | string) => string | undefined;
27
+ get: (value?: string) => any;
28
+ };
29
+ createdAt: {
30
+ readonly type: "string";
31
+ readonly required: true;
32
+ readonly readOnly: true;
33
+ readonly set: (value?: Date | string) => string;
34
+ readonly default: () => string;
35
+ };
36
+ updatedAt: {
37
+ readonly type: "string";
38
+ readonly required: true;
39
+ readonly set: (value?: Date | string) => string;
40
+ readonly default: () => string;
41
+ };
42
+ entity: {
43
+ type: "string";
44
+ required: true;
45
+ };
46
+ };
47
+ indexes: {
48
+ primary: {
49
+ pk: {
50
+ field: string;
51
+ composite: ("entity" | "id")[];
52
+ };
53
+ sk: {
54
+ field: string;
55
+ composite: "id"[];
56
+ };
57
+ };
58
+ byResource: {
59
+ index: string;
60
+ pk: {
61
+ field: string;
62
+ composite: ("entity" | "resourceId")[];
63
+ };
64
+ sk: {
65
+ field: string;
66
+ composite: "createdAt"[];
67
+ };
68
+ };
69
+ };
70
+ }>;
71
+ message: import("electrodb").Entity<string, string, string, {
72
+ model: {
73
+ entity: string;
74
+ version: string;
75
+ service: string;
76
+ };
77
+ attributes: {
78
+ id: {
79
+ type: "string";
80
+ required: true;
81
+ };
82
+ threadId: {
83
+ type: "string";
84
+ required: true;
85
+ };
86
+ content: {
87
+ type: "string";
88
+ required: true;
89
+ set: (value?: string | void | undefined) => string | void;
90
+ get: (value?: string) => any;
91
+ };
92
+ role: {
93
+ type: "string";
94
+ required: true;
95
+ };
96
+ type: {
97
+ type: "string";
98
+ default: string;
99
+ };
100
+ resourceId: {
101
+ type: "string";
102
+ required: false;
103
+ };
104
+ toolCallIds: {
105
+ type: "string";
106
+ required: false;
107
+ set: (value?: string[] | string) => string | undefined;
108
+ get: (value?: string) => any;
109
+ };
110
+ toolCallArgs: {
111
+ type: "string";
112
+ required: false;
113
+ set: (value?: Record<string, unknown>[] | string) => string | undefined;
114
+ get: (value?: string) => any;
115
+ };
116
+ toolNames: {
117
+ type: "string";
118
+ required: false;
119
+ set: (value?: string[] | string) => string | undefined;
120
+ get: (value?: string) => any;
121
+ };
122
+ createdAt: {
123
+ readonly type: "string";
124
+ readonly required: true;
125
+ readonly readOnly: true;
126
+ readonly set: (value?: Date | string) => string;
127
+ readonly default: () => string;
128
+ };
129
+ updatedAt: {
130
+ readonly type: "string";
131
+ readonly required: true;
132
+ readonly set: (value?: Date | string) => string;
133
+ readonly default: () => string;
134
+ };
135
+ metadata: {
136
+ readonly type: "string";
137
+ readonly set: (value?: Record<string, unknown> | string) => string | undefined;
138
+ readonly get: (value?: string) => any;
139
+ };
140
+ entity: {
141
+ type: "string";
142
+ required: true;
143
+ };
144
+ };
145
+ indexes: {
146
+ primary: {
147
+ pk: {
148
+ field: string;
149
+ composite: ("entity" | "id")[];
150
+ };
151
+ sk: {
152
+ field: string;
153
+ composite: "entity"[];
154
+ };
155
+ };
156
+ byThread: {
157
+ index: string;
158
+ pk: {
159
+ field: string;
160
+ composite: ("entity" | "threadId")[];
161
+ };
162
+ sk: {
163
+ field: string;
164
+ composite: "createdAt"[];
165
+ };
166
+ };
167
+ };
168
+ }>;
169
+ eval: import("electrodb").Entity<string, string, string, {
170
+ model: {
171
+ entity: string;
172
+ version: string;
173
+ service: string;
174
+ };
175
+ attributes: {
176
+ input: {
177
+ type: "string";
178
+ required: true;
179
+ };
180
+ output: {
181
+ type: "string";
182
+ required: true;
183
+ };
184
+ result: {
185
+ type: "string";
186
+ required: true;
187
+ set: (value?: any) => any;
188
+ get: (value?: string) => any;
189
+ };
190
+ agent_name: {
191
+ type: "string";
192
+ required: true;
193
+ };
194
+ metric_name: {
195
+ type: "string";
196
+ required: true;
197
+ };
198
+ instructions: {
199
+ type: "string";
200
+ required: true;
201
+ };
202
+ test_info: {
203
+ type: "string";
204
+ required: false;
205
+ set: (value?: any) => any;
206
+ get: (value?: string) => string | undefined;
207
+ };
208
+ global_run_id: {
209
+ type: "string";
210
+ required: true;
211
+ };
212
+ run_id: {
213
+ type: "string";
214
+ required: true;
215
+ };
216
+ created_at: {
217
+ type: "string";
218
+ required: true;
219
+ default: () => string;
220
+ set: (value?: Date | string) => string;
221
+ };
222
+ createdAt: {
223
+ readonly type: "string";
224
+ readonly required: true;
225
+ readonly readOnly: true;
226
+ readonly set: (value?: Date | string) => string;
227
+ readonly default: () => string;
228
+ };
229
+ updatedAt: {
230
+ readonly type: "string";
231
+ readonly required: true;
232
+ readonly set: (value?: Date | string) => string;
233
+ readonly default: () => string;
234
+ };
235
+ metadata: {
236
+ readonly type: "string";
237
+ readonly set: (value?: Record<string, unknown> | string) => string | undefined;
238
+ readonly get: (value?: string) => any;
239
+ };
240
+ entity: {
241
+ type: "string";
242
+ required: true;
243
+ };
244
+ };
245
+ indexes: {
246
+ primary: {
247
+ pk: {
248
+ field: string;
249
+ composite: ("entity" | "run_id")[];
250
+ };
251
+ sk: {
252
+ field: string;
253
+ composite: never[];
254
+ };
255
+ };
256
+ byAgent: {
257
+ index: string;
258
+ pk: {
259
+ field: string;
260
+ composite: ("entity" | "agent_name")[];
261
+ };
262
+ sk: {
263
+ field: string;
264
+ composite: "created_at"[];
265
+ };
266
+ };
267
+ };
268
+ }>;
269
+ trace: import("electrodb").Entity<string, string, string, {
270
+ model: {
271
+ entity: string;
272
+ version: string;
273
+ service: string;
274
+ };
275
+ attributes: {
276
+ id: {
277
+ type: "string";
278
+ required: true;
279
+ };
280
+ parentSpanId: {
281
+ type: "string";
282
+ required: false;
283
+ };
284
+ name: {
285
+ type: "string";
286
+ required: true;
287
+ };
288
+ traceId: {
289
+ type: "string";
290
+ required: true;
291
+ };
292
+ scope: {
293
+ type: "string";
294
+ required: true;
295
+ };
296
+ kind: {
297
+ type: "number";
298
+ required: true;
299
+ };
300
+ attributes: {
301
+ type: "string";
302
+ required: false;
303
+ set: (value?: any) => any;
304
+ get: (value?: string) => any;
305
+ };
306
+ status: {
307
+ type: "string";
308
+ required: false;
309
+ set: (value?: any) => any;
310
+ get: (value?: string) => string | undefined;
311
+ };
312
+ events: {
313
+ type: "string";
314
+ required: false;
315
+ set: (value?: any) => any;
316
+ get: (value?: string) => string | undefined;
317
+ };
318
+ links: {
319
+ type: "string";
320
+ required: false;
321
+ set: (value?: any) => any;
322
+ get: (value?: string) => string | undefined;
323
+ };
324
+ other: {
325
+ type: "string";
326
+ required: false;
327
+ };
328
+ startTime: {
329
+ type: "number";
330
+ required: true;
331
+ };
332
+ endTime: {
333
+ type: "number";
334
+ required: true;
335
+ };
336
+ createdAt: {
337
+ readonly type: "string";
338
+ readonly required: true;
339
+ readonly readOnly: true;
340
+ readonly set: (value?: Date | string) => string;
341
+ readonly default: () => string;
342
+ };
343
+ updatedAt: {
344
+ readonly type: "string";
345
+ readonly required: true;
346
+ readonly set: (value?: Date | string) => string;
347
+ readonly default: () => string;
348
+ };
349
+ metadata: {
350
+ readonly type: "string";
351
+ readonly set: (value?: Record<string, unknown> | string) => string | undefined;
352
+ readonly get: (value?: string) => any;
353
+ };
354
+ entity: {
355
+ type: "string";
356
+ required: true;
357
+ };
358
+ };
359
+ indexes: {
360
+ primary: {
361
+ pk: {
362
+ field: string;
363
+ composite: ("entity" | "id")[];
364
+ };
365
+ sk: {
366
+ field: string;
367
+ composite: never[];
368
+ };
369
+ };
370
+ byName: {
371
+ index: string;
372
+ pk: {
373
+ field: string;
374
+ composite: ("entity" | "name")[];
375
+ };
376
+ sk: {
377
+ field: string;
378
+ composite: "startTime"[];
379
+ };
380
+ };
381
+ byScope: {
382
+ index: string;
383
+ pk: {
384
+ field: string;
385
+ composite: ("entity" | "scope")[];
386
+ };
387
+ sk: {
388
+ field: string;
389
+ composite: "startTime"[];
390
+ };
391
+ };
392
+ };
393
+ }>;
394
+ workflow_snapshot: import("electrodb").Entity<string, string, string, {
395
+ model: {
396
+ entity: string;
397
+ version: string;
398
+ service: string;
399
+ };
400
+ attributes: {
401
+ workflow_name: {
402
+ type: "string";
403
+ required: true;
404
+ };
405
+ run_id: {
406
+ type: "string";
407
+ required: true;
408
+ };
409
+ snapshot: {
410
+ type: "string";
411
+ required: true;
412
+ set: (value?: any) => any;
413
+ get: (value?: string) => any;
414
+ };
415
+ resourceId: {
416
+ type: "string";
417
+ required: false;
418
+ };
419
+ createdAt: {
420
+ readonly type: "string";
421
+ readonly required: true;
422
+ readonly readOnly: true;
423
+ readonly set: (value?: Date | string) => string;
424
+ readonly default: () => string;
425
+ };
426
+ updatedAt: {
427
+ readonly type: "string";
428
+ readonly required: true;
429
+ readonly set: (value?: Date | string) => string;
430
+ readonly default: () => string;
431
+ };
432
+ metadata: {
433
+ readonly type: "string";
434
+ readonly set: (value?: Record<string, unknown> | string) => string | undefined;
435
+ readonly get: (value?: string) => any;
436
+ };
437
+ entity: {
438
+ type: "string";
439
+ required: true;
440
+ };
441
+ };
442
+ indexes: {
443
+ primary: {
444
+ pk: {
445
+ field: string;
446
+ composite: ("entity" | "workflow_name")[];
447
+ };
448
+ sk: {
449
+ field: string;
450
+ composite: "run_id"[];
451
+ };
452
+ };
453
+ gsi2: {
454
+ index: string;
455
+ pk: {
456
+ field: string;
457
+ composite: ("entity" | "run_id")[];
458
+ };
459
+ sk: {
460
+ field: string;
461
+ composite: "workflow_name"[];
462
+ };
463
+ };
464
+ };
465
+ }>;
466
+ resource: import("electrodb").Entity<string, string, string, {
467
+ model: {
468
+ entity: string;
469
+ version: string;
470
+ service: string;
471
+ };
472
+ attributes: {
473
+ id: {
474
+ type: "string";
475
+ required: true;
476
+ };
477
+ workingMemory: {
478
+ type: "string";
479
+ required: false;
480
+ };
481
+ metadata: {
482
+ type: "string";
483
+ required: false;
484
+ set: (value?: string | void | undefined) => string | void;
485
+ get: (value?: string) => any;
486
+ };
487
+ createdAt: {
488
+ readonly type: "string";
489
+ readonly required: true;
490
+ readonly readOnly: true;
491
+ readonly set: (value?: Date | string) => string;
492
+ readonly default: () => string;
493
+ };
494
+ updatedAt: {
495
+ readonly type: "string";
496
+ readonly required: true;
497
+ readonly set: (value?: Date | string) => string;
498
+ readonly default: () => string;
499
+ };
500
+ entity: {
501
+ type: "string";
502
+ required: true;
503
+ };
504
+ };
505
+ indexes: {
506
+ primary: {
507
+ pk: {
508
+ field: string;
509
+ composite: ("entity" | "id")[];
510
+ };
511
+ sk: {
512
+ field: string;
513
+ composite: "entity"[];
514
+ };
515
+ };
516
+ };
517
+ }>;
518
+ score: import("electrodb").Entity<string, string, string, {
519
+ model: {
520
+ entity: string;
521
+ version: string;
522
+ service: string;
523
+ };
524
+ attributes: {
525
+ id: {
526
+ type: "string";
527
+ required: true;
528
+ };
529
+ scorerId: {
530
+ type: "string";
531
+ required: true;
532
+ };
533
+ traceId: {
534
+ type: "string";
535
+ required: false;
536
+ };
537
+ runId: {
538
+ type: "string";
539
+ required: true;
540
+ };
541
+ scorer: {
542
+ type: "string";
543
+ required: true;
544
+ set: (value?: Record<string, unknown> | string) => string | undefined;
545
+ get: (value?: string) => any;
546
+ };
547
+ extractStepResult: {
548
+ type: "string";
549
+ required: false;
550
+ set: (value?: Record<string, unknown> | string) => string | undefined;
551
+ get: (value?: string) => any;
552
+ };
553
+ preprocessStepResult: {
554
+ type: "string";
555
+ required: false;
556
+ set: (value?: Record<string, unknown> | string) => string | undefined;
557
+ get: (value?: string) => any;
558
+ };
559
+ analyzeStepResult: {
560
+ type: "string";
561
+ required: false;
562
+ set: (value?: Record<string, unknown> | string) => string | undefined;
563
+ get: (value?: string) => any;
564
+ };
565
+ score: {
566
+ type: "number";
567
+ required: true;
568
+ };
569
+ reason: {
570
+ type: "string";
571
+ required: false;
572
+ };
573
+ extractPrompt: {
574
+ type: "string";
575
+ required: false;
576
+ };
577
+ analyzePrompt: {
578
+ type: "string";
579
+ required: false;
580
+ };
581
+ reasonPrompt: {
582
+ type: "string";
583
+ required: false;
584
+ };
585
+ generateScorePrompt: {
586
+ type: "string";
587
+ required: false;
588
+ };
589
+ generateReasonPrompt: {
590
+ type: "string";
591
+ required: false;
592
+ };
593
+ input: {
594
+ type: "string";
595
+ required: true;
596
+ set: (value?: Record<string, unknown> | string) => string | undefined;
597
+ get: (value?: string) => any;
598
+ };
599
+ output: {
600
+ type: "string";
601
+ required: true;
602
+ set: (value?: Record<string, unknown> | string) => string | undefined;
603
+ get: (value?: string) => any;
604
+ };
605
+ additionalContext: {
606
+ type: "string";
607
+ required: false;
608
+ set: (value?: Record<string, unknown> | string) => string | undefined;
609
+ get: (value?: string) => any;
610
+ };
611
+ runtimeContext: {
612
+ type: "string";
613
+ required: false;
614
+ set: (value?: Record<string, unknown> | string) => string | undefined;
615
+ get: (value?: string) => any;
616
+ };
617
+ entityType: {
618
+ type: "string";
619
+ required: false;
620
+ };
621
+ entityData: {
622
+ type: "string";
623
+ required: false;
624
+ set: (value?: Record<string, unknown> | string) => string | undefined;
625
+ get: (value?: string) => any;
626
+ };
627
+ entityId: {
628
+ type: "string";
629
+ required: false;
630
+ };
631
+ source: {
632
+ type: "string";
633
+ required: true;
634
+ };
635
+ resourceId: {
636
+ type: "string";
637
+ required: false;
638
+ };
639
+ threadId: {
640
+ type: "string";
641
+ required: false;
642
+ };
643
+ createdAt: {
644
+ readonly type: "string";
645
+ readonly required: true;
646
+ readonly readOnly: true;
647
+ readonly set: (value?: Date | string) => string;
648
+ readonly default: () => string;
649
+ };
650
+ updatedAt: {
651
+ readonly type: "string";
652
+ readonly required: true;
653
+ readonly set: (value?: Date | string) => string;
654
+ readonly default: () => string;
655
+ };
656
+ metadata: {
657
+ readonly type: "string";
658
+ readonly set: (value?: Record<string, unknown> | string) => string | undefined;
659
+ readonly get: (value?: string) => any;
660
+ };
661
+ entity: {
662
+ type: "string";
663
+ required: true;
664
+ };
665
+ };
666
+ indexes: {
667
+ primary: {
668
+ pk: {
669
+ field: string;
670
+ composite: ("entity" | "id")[];
671
+ };
672
+ sk: {
673
+ field: string;
674
+ composite: "entity"[];
675
+ };
676
+ };
677
+ byScorer: {
678
+ index: string;
679
+ pk: {
680
+ field: string;
681
+ composite: ("entity" | "scorerId")[];
682
+ };
683
+ sk: {
684
+ field: string;
685
+ composite: "createdAt"[];
686
+ };
687
+ };
688
+ byRun: {
689
+ index: string;
690
+ pk: {
691
+ field: string;
692
+ composite: ("entity" | "runId")[];
693
+ };
694
+ sk: {
695
+ field: string;
696
+ composite: "createdAt"[];
697
+ };
698
+ };
699
+ byTrace: {
700
+ index: string;
701
+ pk: {
702
+ field: string;
703
+ composite: ("entity" | "traceId")[];
704
+ };
705
+ sk: {
706
+ field: string;
707
+ composite: "createdAt"[];
708
+ };
709
+ };
710
+ byEntityData: {
711
+ index: string;
712
+ pk: {
713
+ field: string;
714
+ composite: ("entity" | "entityId")[];
715
+ };
716
+ sk: {
717
+ field: string;
718
+ composite: "createdAt"[];
719
+ };
720
+ };
721
+ byResource: {
722
+ index: string;
723
+ pk: {
724
+ field: string;
725
+ composite: ("entity" | "resourceId")[];
726
+ };
727
+ sk: {
728
+ field: string;
729
+ composite: "createdAt"[];
730
+ };
731
+ };
732
+ byThread: {
733
+ index: string;
734
+ pk: {
735
+ field: string;
736
+ composite: ("entity" | "threadId")[];
737
+ };
738
+ sk: {
739
+ field: string;
740
+ composite: "createdAt"[];
741
+ };
742
+ };
743
+ };
744
+ }>;
745
+ }>;
746
+ //# sourceMappingURL=index.d.ts.map