@mastra/dynamodb 0.10.1-alpha.2 → 0.10.2
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/dist/_tsup-dts-rollup.d.cts +1120 -0
- package/dist/_tsup-dts-rollup.d.ts +1120 -0
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -2
- package/package.json +18 -5
- package/src/storage/index.test.ts +55 -0
- package/src/storage/index.ts +4 -4
|
@@ -0,0 +1,1120 @@
|
|
|
1
|
+
import type { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
|
|
2
|
+
import { Entity } from 'electrodb';
|
|
3
|
+
import type { EvalRow } from '@mastra/core/storage';
|
|
4
|
+
import type { MastraMessageV1 } from '@mastra/core';
|
|
5
|
+
import type { MastraMessageV2 } from '@mastra/core';
|
|
6
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
7
|
+
import { Service } from 'electrodb';
|
|
8
|
+
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
9
|
+
import type { StorageThreadType } from '@mastra/core';
|
|
10
|
+
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
11
|
+
import type { WorkflowRun } from '@mastra/core/storage';
|
|
12
|
+
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
13
|
+
import type { WorkflowRunState } from '@mastra/core';
|
|
14
|
+
|
|
15
|
+
export declare const baseAttributes: {
|
|
16
|
+
readonly createdAt: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly required: true;
|
|
19
|
+
readonly readOnly: true;
|
|
20
|
+
readonly set: (value?: Date | string) => string;
|
|
21
|
+
readonly default: () => string;
|
|
22
|
+
};
|
|
23
|
+
readonly updatedAt: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly required: true;
|
|
26
|
+
readonly set: (value?: Date | string) => string;
|
|
27
|
+
readonly default: () => string;
|
|
28
|
+
};
|
|
29
|
+
readonly metadata: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
32
|
+
readonly get: (value?: string) => any;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare class DynamoDBStore extends MastraStorage {
|
|
37
|
+
private tableName;
|
|
38
|
+
private client;
|
|
39
|
+
private service;
|
|
40
|
+
protected hasInitialized: Promise<boolean> | null;
|
|
41
|
+
constructor({ name, config }: {
|
|
42
|
+
name: string;
|
|
43
|
+
config: DynamoDBStoreConfig;
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* This method is modified for DynamoDB with ElectroDB single-table design.
|
|
47
|
+
* It assumes the table is created and managed externally via CDK/CloudFormation.
|
|
48
|
+
*
|
|
49
|
+
* This implementation only validates that the required table exists and is accessible.
|
|
50
|
+
* No table creation is attempted - we simply check if we can access the table.
|
|
51
|
+
*/
|
|
52
|
+
createTable({ tableName }: {
|
|
53
|
+
tableName: TABLE_NAMES;
|
|
54
|
+
schema: Record<string, any>;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Validates that the required DynamoDB table exists and is accessible.
|
|
58
|
+
* This does not check the table structure - it assumes the table
|
|
59
|
+
* was created with the correct structure via CDK/CloudFormation.
|
|
60
|
+
*/
|
|
61
|
+
private validateTableExists;
|
|
62
|
+
/**
|
|
63
|
+
* Initialize storage, validating the externally managed table is accessible.
|
|
64
|
+
* For the single-table design, we only validate once that we can access
|
|
65
|
+
* the table that was created via CDK/CloudFormation.
|
|
66
|
+
*/
|
|
67
|
+
init(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Performs the actual table validation and stores the promise.
|
|
70
|
+
* Handles resetting the stored promise on failure to allow retries.
|
|
71
|
+
*/
|
|
72
|
+
private _performInitializationAndStore;
|
|
73
|
+
/**
|
|
74
|
+
* Clear all items from a logical "table" (entity type)
|
|
75
|
+
*/
|
|
76
|
+
clearTable({ tableName }: {
|
|
77
|
+
tableName: TABLE_NAMES;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Insert a record into the specified "table" (entity)
|
|
81
|
+
*/
|
|
82
|
+
insert({ tableName, record }: {
|
|
83
|
+
tableName: TABLE_NAMES;
|
|
84
|
+
record: Record<string, any>;
|
|
85
|
+
}): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Insert multiple records as a batch
|
|
88
|
+
*/
|
|
89
|
+
batchInsert({ tableName, records }: {
|
|
90
|
+
tableName: TABLE_NAMES;
|
|
91
|
+
records: Record<string, any>[];
|
|
92
|
+
}): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Load a record by its keys
|
|
95
|
+
*/
|
|
96
|
+
load<R>({ tableName, keys }: {
|
|
97
|
+
tableName: TABLE_NAMES;
|
|
98
|
+
keys: Record<string, string>;
|
|
99
|
+
}): Promise<R | null>;
|
|
100
|
+
getThreadById({ threadId }: {
|
|
101
|
+
threadId: string;
|
|
102
|
+
}): Promise<StorageThreadType | null>;
|
|
103
|
+
getThreadsByResourceId({ resourceId }: {
|
|
104
|
+
resourceId: string;
|
|
105
|
+
}): Promise<StorageThreadType[]>;
|
|
106
|
+
saveThread({ thread }: {
|
|
107
|
+
thread: StorageThreadType;
|
|
108
|
+
}): Promise<StorageThreadType>;
|
|
109
|
+
updateThread({ id, title, metadata, }: {
|
|
110
|
+
id: string;
|
|
111
|
+
title: string;
|
|
112
|
+
metadata: Record<string, unknown>;
|
|
113
|
+
}): Promise<StorageThreadType>;
|
|
114
|
+
deleteThread({ threadId }: {
|
|
115
|
+
threadId: string;
|
|
116
|
+
}): Promise<void>;
|
|
117
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
118
|
+
format?: 'v1';
|
|
119
|
+
}): Promise<MastraMessageV1[]>;
|
|
120
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
121
|
+
format: 'v2';
|
|
122
|
+
}): Promise<MastraMessageV2[]>;
|
|
123
|
+
saveMessages(args: {
|
|
124
|
+
messages: MastraMessageV1[];
|
|
125
|
+
format?: undefined | 'v1';
|
|
126
|
+
}): Promise<MastraMessageV1[]>;
|
|
127
|
+
saveMessages(args: {
|
|
128
|
+
messages: MastraMessageV2[];
|
|
129
|
+
format: 'v2';
|
|
130
|
+
}): Promise<MastraMessageV2[]>;
|
|
131
|
+
private parseMessageData;
|
|
132
|
+
getTraces(args: {
|
|
133
|
+
name?: string;
|
|
134
|
+
scope?: string;
|
|
135
|
+
page: number;
|
|
136
|
+
perPage: number;
|
|
137
|
+
attributes?: Record<string, string>;
|
|
138
|
+
filters?: Record<string, any>;
|
|
139
|
+
}): Promise<any[]>;
|
|
140
|
+
batchTraceInsert({ records }: {
|
|
141
|
+
records: Record<string, any>[];
|
|
142
|
+
}): Promise<void>;
|
|
143
|
+
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
144
|
+
workflowName: string;
|
|
145
|
+
runId: string;
|
|
146
|
+
snapshot: WorkflowRunState;
|
|
147
|
+
}): Promise<void>;
|
|
148
|
+
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
149
|
+
workflowName: string;
|
|
150
|
+
runId: string;
|
|
151
|
+
}): Promise<WorkflowRunState | null>;
|
|
152
|
+
getWorkflowRuns(args?: {
|
|
153
|
+
workflowName?: string;
|
|
154
|
+
fromDate?: Date;
|
|
155
|
+
toDate?: Date;
|
|
156
|
+
limit?: number;
|
|
157
|
+
offset?: number;
|
|
158
|
+
resourceId?: string;
|
|
159
|
+
}): Promise<WorkflowRuns>;
|
|
160
|
+
getWorkflowRunById(args: {
|
|
161
|
+
runId: string;
|
|
162
|
+
workflowName?: string;
|
|
163
|
+
}): Promise<WorkflowRun | null>;
|
|
164
|
+
private formatWorkflowRun;
|
|
165
|
+
private getEntityNameForTable;
|
|
166
|
+
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
167
|
+
/**
|
|
168
|
+
* Closes the DynamoDB client connection and cleans up resources.
|
|
169
|
+
* Should be called when the store is no longer needed, e.g., at the end of tests or application shutdown.
|
|
170
|
+
*/
|
|
171
|
+
close(): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
export { DynamoDBStore }
|
|
174
|
+
export { DynamoDBStore as DynamoDBStore_alias_1 }
|
|
175
|
+
|
|
176
|
+
declare interface DynamoDBStoreConfig {
|
|
177
|
+
region?: string;
|
|
178
|
+
tableName: string;
|
|
179
|
+
endpoint?: string;
|
|
180
|
+
credentials?: {
|
|
181
|
+
accessKeyId: string;
|
|
182
|
+
secretAccessKey: string;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export { DynamoDBStoreConfig }
|
|
186
|
+
export { DynamoDBStoreConfig as DynamoDBStoreConfig_alias_1 }
|
|
187
|
+
|
|
188
|
+
export declare const evalEntity: Entity<string, string, string, {
|
|
189
|
+
model: {
|
|
190
|
+
entity: string;
|
|
191
|
+
version: string;
|
|
192
|
+
service: string;
|
|
193
|
+
};
|
|
194
|
+
attributes: {
|
|
195
|
+
input: {
|
|
196
|
+
type: "string";
|
|
197
|
+
required: true;
|
|
198
|
+
};
|
|
199
|
+
output: {
|
|
200
|
+
type: "string";
|
|
201
|
+
required: true;
|
|
202
|
+
};
|
|
203
|
+
result: {
|
|
204
|
+
type: "string";
|
|
205
|
+
required: true;
|
|
206
|
+
set: (value?: any) => any;
|
|
207
|
+
get: (value?: string) => any;
|
|
208
|
+
};
|
|
209
|
+
agent_name: {
|
|
210
|
+
type: "string";
|
|
211
|
+
required: true;
|
|
212
|
+
};
|
|
213
|
+
metric_name: {
|
|
214
|
+
type: "string";
|
|
215
|
+
required: true;
|
|
216
|
+
};
|
|
217
|
+
instructions: {
|
|
218
|
+
type: "string";
|
|
219
|
+
required: true;
|
|
220
|
+
};
|
|
221
|
+
test_info: {
|
|
222
|
+
type: "string";
|
|
223
|
+
required: false;
|
|
224
|
+
set: (value?: any) => any;
|
|
225
|
+
get: (value?: string) => string | undefined;
|
|
226
|
+
};
|
|
227
|
+
global_run_id: {
|
|
228
|
+
type: "string";
|
|
229
|
+
required: true;
|
|
230
|
+
};
|
|
231
|
+
run_id: {
|
|
232
|
+
type: "string";
|
|
233
|
+
required: true;
|
|
234
|
+
};
|
|
235
|
+
created_at: {
|
|
236
|
+
type: "string";
|
|
237
|
+
required: true;
|
|
238
|
+
default: () => string;
|
|
239
|
+
set: (value?: Date | string) => string;
|
|
240
|
+
};
|
|
241
|
+
createdAt: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
readonly required: true;
|
|
244
|
+
readonly readOnly: true;
|
|
245
|
+
readonly set: (value?: Date | string) => string;
|
|
246
|
+
readonly default: () => string;
|
|
247
|
+
};
|
|
248
|
+
updatedAt: {
|
|
249
|
+
readonly type: "string";
|
|
250
|
+
readonly required: true;
|
|
251
|
+
readonly set: (value?: Date | string) => string;
|
|
252
|
+
readonly default: () => string;
|
|
253
|
+
};
|
|
254
|
+
metadata: {
|
|
255
|
+
readonly type: "string";
|
|
256
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
257
|
+
readonly get: (value?: string) => any;
|
|
258
|
+
};
|
|
259
|
+
entity: {
|
|
260
|
+
type: "string";
|
|
261
|
+
required: true;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
indexes: {
|
|
265
|
+
primary: {
|
|
266
|
+
pk: {
|
|
267
|
+
field: string;
|
|
268
|
+
composite: ("entity" | "run_id")[];
|
|
269
|
+
};
|
|
270
|
+
sk: {
|
|
271
|
+
field: string;
|
|
272
|
+
composite: never[];
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
byAgent: {
|
|
276
|
+
index: string;
|
|
277
|
+
pk: {
|
|
278
|
+
field: string;
|
|
279
|
+
composite: ("entity" | "agent_name")[];
|
|
280
|
+
};
|
|
281
|
+
sk: {
|
|
282
|
+
field: string;
|
|
283
|
+
composite: "created_at"[];
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
}>;
|
|
288
|
+
|
|
289
|
+
export declare function getElectroDbService(client: DynamoDBDocumentClient, tableName: string): Service<{
|
|
290
|
+
thread: Entity<string, string, string, {
|
|
291
|
+
model: {
|
|
292
|
+
entity: string;
|
|
293
|
+
version: string;
|
|
294
|
+
service: string;
|
|
295
|
+
};
|
|
296
|
+
attributes: {
|
|
297
|
+
id: {
|
|
298
|
+
type: "string";
|
|
299
|
+
required: true;
|
|
300
|
+
};
|
|
301
|
+
resourceId: {
|
|
302
|
+
type: "string";
|
|
303
|
+
required: true;
|
|
304
|
+
};
|
|
305
|
+
title: {
|
|
306
|
+
type: "string";
|
|
307
|
+
required: true;
|
|
308
|
+
};
|
|
309
|
+
metadata: {
|
|
310
|
+
type: "string";
|
|
311
|
+
required: false;
|
|
312
|
+
set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
313
|
+
get: (value?: string) => any;
|
|
314
|
+
};
|
|
315
|
+
createdAt: {
|
|
316
|
+
readonly type: "string";
|
|
317
|
+
readonly required: true;
|
|
318
|
+
readonly readOnly: true;
|
|
319
|
+
readonly set: (value?: Date | string) => string;
|
|
320
|
+
readonly default: () => string;
|
|
321
|
+
};
|
|
322
|
+
updatedAt: {
|
|
323
|
+
readonly type: "string";
|
|
324
|
+
readonly required: true;
|
|
325
|
+
readonly set: (value?: Date | string) => string;
|
|
326
|
+
readonly default: () => string;
|
|
327
|
+
};
|
|
328
|
+
entity: {
|
|
329
|
+
type: "string";
|
|
330
|
+
required: true;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
indexes: {
|
|
334
|
+
primary: {
|
|
335
|
+
pk: {
|
|
336
|
+
field: string;
|
|
337
|
+
composite: ("entity" | "id")[];
|
|
338
|
+
};
|
|
339
|
+
sk: {
|
|
340
|
+
field: string;
|
|
341
|
+
composite: "id"[];
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
byResource: {
|
|
345
|
+
index: string;
|
|
346
|
+
pk: {
|
|
347
|
+
field: string;
|
|
348
|
+
composite: ("entity" | "resourceId")[];
|
|
349
|
+
};
|
|
350
|
+
sk: {
|
|
351
|
+
field: string;
|
|
352
|
+
composite: "createdAt"[];
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
}>;
|
|
357
|
+
message: Entity<string, string, string, {
|
|
358
|
+
model: {
|
|
359
|
+
entity: string;
|
|
360
|
+
version: string;
|
|
361
|
+
service: string;
|
|
362
|
+
};
|
|
363
|
+
attributes: {
|
|
364
|
+
id: {
|
|
365
|
+
type: "string";
|
|
366
|
+
required: true;
|
|
367
|
+
};
|
|
368
|
+
threadId: {
|
|
369
|
+
type: "string";
|
|
370
|
+
required: true;
|
|
371
|
+
};
|
|
372
|
+
content: {
|
|
373
|
+
type: "string";
|
|
374
|
+
required: true;
|
|
375
|
+
set: (value?: string | void | undefined) => string | void;
|
|
376
|
+
get: (value?: string) => any;
|
|
377
|
+
};
|
|
378
|
+
role: {
|
|
379
|
+
type: "string";
|
|
380
|
+
required: true;
|
|
381
|
+
};
|
|
382
|
+
type: {
|
|
383
|
+
type: "string";
|
|
384
|
+
default: string;
|
|
385
|
+
};
|
|
386
|
+
resourceId: {
|
|
387
|
+
type: "string";
|
|
388
|
+
required: false;
|
|
389
|
+
};
|
|
390
|
+
toolCallIds: {
|
|
391
|
+
type: "string";
|
|
392
|
+
required: false;
|
|
393
|
+
set: (value?: string[] | string) => string | undefined;
|
|
394
|
+
get: (value?: string) => any;
|
|
395
|
+
};
|
|
396
|
+
toolCallArgs: {
|
|
397
|
+
type: "string";
|
|
398
|
+
required: false;
|
|
399
|
+
set: (value?: Record<string, unknown>[] | string) => string | undefined;
|
|
400
|
+
get: (value?: string) => any;
|
|
401
|
+
};
|
|
402
|
+
toolNames: {
|
|
403
|
+
type: "string";
|
|
404
|
+
required: false;
|
|
405
|
+
set: (value?: string[] | string) => string | undefined;
|
|
406
|
+
get: (value?: string) => any;
|
|
407
|
+
};
|
|
408
|
+
createdAt: {
|
|
409
|
+
readonly type: "string";
|
|
410
|
+
readonly required: true;
|
|
411
|
+
readonly readOnly: true;
|
|
412
|
+
readonly set: (value?: Date | string) => string;
|
|
413
|
+
readonly default: () => string;
|
|
414
|
+
};
|
|
415
|
+
updatedAt: {
|
|
416
|
+
readonly type: "string";
|
|
417
|
+
readonly required: true;
|
|
418
|
+
readonly set: (value?: Date | string) => string;
|
|
419
|
+
readonly default: () => string;
|
|
420
|
+
};
|
|
421
|
+
metadata: {
|
|
422
|
+
readonly type: "string";
|
|
423
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
424
|
+
readonly get: (value?: string) => any;
|
|
425
|
+
};
|
|
426
|
+
entity: {
|
|
427
|
+
type: "string";
|
|
428
|
+
required: true;
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
indexes: {
|
|
432
|
+
primary: {
|
|
433
|
+
pk: {
|
|
434
|
+
field: string;
|
|
435
|
+
composite: ("entity" | "id")[];
|
|
436
|
+
};
|
|
437
|
+
sk: {
|
|
438
|
+
field: string;
|
|
439
|
+
composite: "entity"[];
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
byThread: {
|
|
443
|
+
index: string;
|
|
444
|
+
pk: {
|
|
445
|
+
field: string;
|
|
446
|
+
composite: ("entity" | "threadId")[];
|
|
447
|
+
};
|
|
448
|
+
sk: {
|
|
449
|
+
field: string;
|
|
450
|
+
composite: "createdAt"[];
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
}>;
|
|
455
|
+
eval: Entity<string, string, string, {
|
|
456
|
+
model: {
|
|
457
|
+
entity: string;
|
|
458
|
+
version: string;
|
|
459
|
+
service: string;
|
|
460
|
+
};
|
|
461
|
+
attributes: {
|
|
462
|
+
input: {
|
|
463
|
+
type: "string";
|
|
464
|
+
required: true;
|
|
465
|
+
};
|
|
466
|
+
output: {
|
|
467
|
+
type: "string";
|
|
468
|
+
required: true;
|
|
469
|
+
};
|
|
470
|
+
result: {
|
|
471
|
+
type: "string";
|
|
472
|
+
required: true;
|
|
473
|
+
set: (value?: any) => any;
|
|
474
|
+
get: (value?: string) => any;
|
|
475
|
+
};
|
|
476
|
+
agent_name: {
|
|
477
|
+
type: "string";
|
|
478
|
+
required: true;
|
|
479
|
+
};
|
|
480
|
+
metric_name: {
|
|
481
|
+
type: "string";
|
|
482
|
+
required: true;
|
|
483
|
+
};
|
|
484
|
+
instructions: {
|
|
485
|
+
type: "string";
|
|
486
|
+
required: true;
|
|
487
|
+
};
|
|
488
|
+
test_info: {
|
|
489
|
+
type: "string";
|
|
490
|
+
required: false;
|
|
491
|
+
set: (value?: any) => any;
|
|
492
|
+
get: (value?: string) => string | undefined;
|
|
493
|
+
};
|
|
494
|
+
global_run_id: {
|
|
495
|
+
type: "string";
|
|
496
|
+
required: true;
|
|
497
|
+
};
|
|
498
|
+
run_id: {
|
|
499
|
+
type: "string";
|
|
500
|
+
required: true;
|
|
501
|
+
};
|
|
502
|
+
created_at: {
|
|
503
|
+
type: "string";
|
|
504
|
+
required: true;
|
|
505
|
+
default: () => string;
|
|
506
|
+
set: (value?: Date | string) => string;
|
|
507
|
+
};
|
|
508
|
+
createdAt: {
|
|
509
|
+
readonly type: "string";
|
|
510
|
+
readonly required: true;
|
|
511
|
+
readonly readOnly: true;
|
|
512
|
+
readonly set: (value?: Date | string) => string;
|
|
513
|
+
readonly default: () => string;
|
|
514
|
+
};
|
|
515
|
+
updatedAt: {
|
|
516
|
+
readonly type: "string";
|
|
517
|
+
readonly required: true;
|
|
518
|
+
readonly set: (value?: Date | string) => string;
|
|
519
|
+
readonly default: () => string;
|
|
520
|
+
};
|
|
521
|
+
metadata: {
|
|
522
|
+
readonly type: "string";
|
|
523
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
524
|
+
readonly get: (value?: string) => any;
|
|
525
|
+
};
|
|
526
|
+
entity: {
|
|
527
|
+
type: "string";
|
|
528
|
+
required: true;
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
indexes: {
|
|
532
|
+
primary: {
|
|
533
|
+
pk: {
|
|
534
|
+
field: string;
|
|
535
|
+
composite: ("entity" | "run_id")[];
|
|
536
|
+
};
|
|
537
|
+
sk: {
|
|
538
|
+
field: string;
|
|
539
|
+
composite: never[];
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
byAgent: {
|
|
543
|
+
index: string;
|
|
544
|
+
pk: {
|
|
545
|
+
field: string;
|
|
546
|
+
composite: ("entity" | "agent_name")[];
|
|
547
|
+
};
|
|
548
|
+
sk: {
|
|
549
|
+
field: string;
|
|
550
|
+
composite: "created_at"[];
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
}>;
|
|
555
|
+
trace: Entity<string, string, string, {
|
|
556
|
+
model: {
|
|
557
|
+
entity: string;
|
|
558
|
+
version: string;
|
|
559
|
+
service: string;
|
|
560
|
+
};
|
|
561
|
+
attributes: {
|
|
562
|
+
id: {
|
|
563
|
+
type: "string";
|
|
564
|
+
required: true;
|
|
565
|
+
};
|
|
566
|
+
parentSpanId: {
|
|
567
|
+
type: "string";
|
|
568
|
+
required: false;
|
|
569
|
+
};
|
|
570
|
+
name: {
|
|
571
|
+
type: "string";
|
|
572
|
+
required: true;
|
|
573
|
+
};
|
|
574
|
+
traceId: {
|
|
575
|
+
type: "string";
|
|
576
|
+
required: true;
|
|
577
|
+
};
|
|
578
|
+
scope: {
|
|
579
|
+
type: "string";
|
|
580
|
+
required: true;
|
|
581
|
+
};
|
|
582
|
+
kind: {
|
|
583
|
+
type: "number";
|
|
584
|
+
required: true;
|
|
585
|
+
};
|
|
586
|
+
attributes: {
|
|
587
|
+
type: "string";
|
|
588
|
+
required: false;
|
|
589
|
+
set: (value?: any) => any;
|
|
590
|
+
get: (value?: string) => any;
|
|
591
|
+
};
|
|
592
|
+
status: {
|
|
593
|
+
type: "string";
|
|
594
|
+
required: false;
|
|
595
|
+
set: (value?: any) => any;
|
|
596
|
+
get: (value?: string) => string | undefined;
|
|
597
|
+
};
|
|
598
|
+
events: {
|
|
599
|
+
type: "string";
|
|
600
|
+
required: false;
|
|
601
|
+
set: (value?: any) => any;
|
|
602
|
+
get: (value?: string) => string | undefined;
|
|
603
|
+
};
|
|
604
|
+
links: {
|
|
605
|
+
type: "string";
|
|
606
|
+
required: false;
|
|
607
|
+
set: (value?: any) => any;
|
|
608
|
+
get: (value?: string) => string | undefined;
|
|
609
|
+
};
|
|
610
|
+
other: {
|
|
611
|
+
type: "string";
|
|
612
|
+
required: false;
|
|
613
|
+
};
|
|
614
|
+
startTime: {
|
|
615
|
+
type: "number";
|
|
616
|
+
required: true;
|
|
617
|
+
};
|
|
618
|
+
endTime: {
|
|
619
|
+
type: "number";
|
|
620
|
+
required: true;
|
|
621
|
+
};
|
|
622
|
+
createdAt: {
|
|
623
|
+
readonly type: "string";
|
|
624
|
+
readonly required: true;
|
|
625
|
+
readonly readOnly: true;
|
|
626
|
+
readonly set: (value?: Date | string) => string;
|
|
627
|
+
readonly default: () => string;
|
|
628
|
+
};
|
|
629
|
+
updatedAt: {
|
|
630
|
+
readonly type: "string";
|
|
631
|
+
readonly required: true;
|
|
632
|
+
readonly set: (value?: Date | string) => string;
|
|
633
|
+
readonly default: () => string;
|
|
634
|
+
};
|
|
635
|
+
metadata: {
|
|
636
|
+
readonly type: "string";
|
|
637
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
638
|
+
readonly get: (value?: string) => any;
|
|
639
|
+
};
|
|
640
|
+
entity: {
|
|
641
|
+
type: "string";
|
|
642
|
+
required: true;
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
indexes: {
|
|
646
|
+
primary: {
|
|
647
|
+
pk: {
|
|
648
|
+
field: string;
|
|
649
|
+
composite: ("entity" | "id")[];
|
|
650
|
+
};
|
|
651
|
+
sk: {
|
|
652
|
+
field: string;
|
|
653
|
+
composite: never[];
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
byName: {
|
|
657
|
+
index: string;
|
|
658
|
+
pk: {
|
|
659
|
+
field: string;
|
|
660
|
+
composite: ("entity" | "name")[];
|
|
661
|
+
};
|
|
662
|
+
sk: {
|
|
663
|
+
field: string;
|
|
664
|
+
composite: "startTime"[];
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
byScope: {
|
|
668
|
+
index: string;
|
|
669
|
+
pk: {
|
|
670
|
+
field: string;
|
|
671
|
+
composite: ("entity" | "scope")[];
|
|
672
|
+
};
|
|
673
|
+
sk: {
|
|
674
|
+
field: string;
|
|
675
|
+
composite: "startTime"[];
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
};
|
|
679
|
+
}>;
|
|
680
|
+
workflowSnapshot: Entity<string, string, string, {
|
|
681
|
+
model: {
|
|
682
|
+
entity: string;
|
|
683
|
+
version: string;
|
|
684
|
+
service: string;
|
|
685
|
+
};
|
|
686
|
+
attributes: {
|
|
687
|
+
workflow_name: {
|
|
688
|
+
type: "string";
|
|
689
|
+
required: true;
|
|
690
|
+
};
|
|
691
|
+
run_id: {
|
|
692
|
+
type: "string";
|
|
693
|
+
required: true;
|
|
694
|
+
};
|
|
695
|
+
snapshot: {
|
|
696
|
+
type: "string";
|
|
697
|
+
required: true;
|
|
698
|
+
set: (value?: any) => any;
|
|
699
|
+
get: (value?: string) => any;
|
|
700
|
+
};
|
|
701
|
+
resourceId: {
|
|
702
|
+
type: "string";
|
|
703
|
+
required: false;
|
|
704
|
+
};
|
|
705
|
+
createdAt: {
|
|
706
|
+
readonly type: "string";
|
|
707
|
+
readonly required: true;
|
|
708
|
+
readonly readOnly: true;
|
|
709
|
+
readonly set: (value?: Date | string) => string;
|
|
710
|
+
readonly default: () => string;
|
|
711
|
+
};
|
|
712
|
+
updatedAt: {
|
|
713
|
+
readonly type: "string";
|
|
714
|
+
readonly required: true;
|
|
715
|
+
readonly set: (value?: Date | string) => string;
|
|
716
|
+
readonly default: () => string;
|
|
717
|
+
};
|
|
718
|
+
metadata: {
|
|
719
|
+
readonly type: "string";
|
|
720
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
721
|
+
readonly get: (value?: string) => any;
|
|
722
|
+
};
|
|
723
|
+
entity: {
|
|
724
|
+
type: "string";
|
|
725
|
+
required: true;
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
indexes: {
|
|
729
|
+
primary: {
|
|
730
|
+
pk: {
|
|
731
|
+
field: string;
|
|
732
|
+
composite: ("entity" | "workflow_name")[];
|
|
733
|
+
};
|
|
734
|
+
sk: {
|
|
735
|
+
field: string;
|
|
736
|
+
composite: "run_id"[];
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
gsi2: {
|
|
740
|
+
index: string;
|
|
741
|
+
pk: {
|
|
742
|
+
field: string;
|
|
743
|
+
composite: ("entity" | "run_id")[];
|
|
744
|
+
};
|
|
745
|
+
sk: {
|
|
746
|
+
field: string;
|
|
747
|
+
composite: "workflow_name"[];
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
}>;
|
|
752
|
+
}>;
|
|
753
|
+
|
|
754
|
+
export declare const messageEntity: Entity<string, string, string, {
|
|
755
|
+
model: {
|
|
756
|
+
entity: string;
|
|
757
|
+
version: string;
|
|
758
|
+
service: string;
|
|
759
|
+
};
|
|
760
|
+
attributes: {
|
|
761
|
+
id: {
|
|
762
|
+
type: "string";
|
|
763
|
+
required: true;
|
|
764
|
+
};
|
|
765
|
+
threadId: {
|
|
766
|
+
type: "string";
|
|
767
|
+
required: true;
|
|
768
|
+
};
|
|
769
|
+
content: {
|
|
770
|
+
type: "string";
|
|
771
|
+
required: true;
|
|
772
|
+
set: (value?: string | void | undefined) => string | void;
|
|
773
|
+
get: (value?: string) => any;
|
|
774
|
+
};
|
|
775
|
+
role: {
|
|
776
|
+
type: "string";
|
|
777
|
+
required: true;
|
|
778
|
+
};
|
|
779
|
+
type: {
|
|
780
|
+
type: "string";
|
|
781
|
+
default: string;
|
|
782
|
+
};
|
|
783
|
+
resourceId: {
|
|
784
|
+
type: "string";
|
|
785
|
+
required: false;
|
|
786
|
+
};
|
|
787
|
+
toolCallIds: {
|
|
788
|
+
type: "string";
|
|
789
|
+
required: false;
|
|
790
|
+
set: (value?: string[] | string) => string | undefined;
|
|
791
|
+
get: (value?: string) => any;
|
|
792
|
+
};
|
|
793
|
+
toolCallArgs: {
|
|
794
|
+
type: "string";
|
|
795
|
+
required: false;
|
|
796
|
+
set: (value?: Record<string, unknown>[] | string) => string | undefined;
|
|
797
|
+
get: (value?: string) => any;
|
|
798
|
+
};
|
|
799
|
+
toolNames: {
|
|
800
|
+
type: "string";
|
|
801
|
+
required: false;
|
|
802
|
+
set: (value?: string[] | string) => string | undefined;
|
|
803
|
+
get: (value?: string) => any;
|
|
804
|
+
};
|
|
805
|
+
createdAt: {
|
|
806
|
+
readonly type: "string";
|
|
807
|
+
readonly required: true;
|
|
808
|
+
readonly readOnly: true;
|
|
809
|
+
readonly set: (value?: Date | string) => string;
|
|
810
|
+
readonly default: () => string;
|
|
811
|
+
};
|
|
812
|
+
updatedAt: {
|
|
813
|
+
readonly type: "string";
|
|
814
|
+
readonly required: true;
|
|
815
|
+
readonly set: (value?: Date | string) => string;
|
|
816
|
+
readonly default: () => string;
|
|
817
|
+
};
|
|
818
|
+
metadata: {
|
|
819
|
+
readonly type: "string";
|
|
820
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
821
|
+
readonly get: (value?: string) => any;
|
|
822
|
+
};
|
|
823
|
+
entity: {
|
|
824
|
+
type: "string";
|
|
825
|
+
required: true;
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
indexes: {
|
|
829
|
+
primary: {
|
|
830
|
+
pk: {
|
|
831
|
+
field: string;
|
|
832
|
+
composite: ("entity" | "id")[];
|
|
833
|
+
};
|
|
834
|
+
sk: {
|
|
835
|
+
field: string;
|
|
836
|
+
composite: "entity"[];
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
byThread: {
|
|
840
|
+
index: string;
|
|
841
|
+
pk: {
|
|
842
|
+
field: string;
|
|
843
|
+
composite: ("entity" | "threadId")[];
|
|
844
|
+
};
|
|
845
|
+
sk: {
|
|
846
|
+
field: string;
|
|
847
|
+
composite: "createdAt"[];
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
}>;
|
|
852
|
+
|
|
853
|
+
export declare const threadEntity: Entity<string, string, string, {
|
|
854
|
+
model: {
|
|
855
|
+
entity: string;
|
|
856
|
+
version: string;
|
|
857
|
+
service: string;
|
|
858
|
+
};
|
|
859
|
+
attributes: {
|
|
860
|
+
id: {
|
|
861
|
+
type: "string";
|
|
862
|
+
required: true;
|
|
863
|
+
};
|
|
864
|
+
resourceId: {
|
|
865
|
+
type: "string";
|
|
866
|
+
required: true;
|
|
867
|
+
};
|
|
868
|
+
title: {
|
|
869
|
+
type: "string";
|
|
870
|
+
required: true;
|
|
871
|
+
};
|
|
872
|
+
metadata: {
|
|
873
|
+
type: "string";
|
|
874
|
+
required: false;
|
|
875
|
+
set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
876
|
+
get: (value?: string) => any;
|
|
877
|
+
};
|
|
878
|
+
createdAt: {
|
|
879
|
+
readonly type: "string";
|
|
880
|
+
readonly required: true;
|
|
881
|
+
readonly readOnly: true;
|
|
882
|
+
readonly set: (value?: Date | string) => string;
|
|
883
|
+
readonly default: () => string;
|
|
884
|
+
};
|
|
885
|
+
updatedAt: {
|
|
886
|
+
readonly type: "string";
|
|
887
|
+
readonly required: true;
|
|
888
|
+
readonly set: (value?: Date | string) => string;
|
|
889
|
+
readonly default: () => string;
|
|
890
|
+
};
|
|
891
|
+
entity: {
|
|
892
|
+
type: "string";
|
|
893
|
+
required: true;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
indexes: {
|
|
897
|
+
primary: {
|
|
898
|
+
pk: {
|
|
899
|
+
field: string;
|
|
900
|
+
composite: ("entity" | "id")[];
|
|
901
|
+
};
|
|
902
|
+
sk: {
|
|
903
|
+
field: string;
|
|
904
|
+
composite: "id"[];
|
|
905
|
+
};
|
|
906
|
+
};
|
|
907
|
+
byResource: {
|
|
908
|
+
index: string;
|
|
909
|
+
pk: {
|
|
910
|
+
field: string;
|
|
911
|
+
composite: ("entity" | "resourceId")[];
|
|
912
|
+
};
|
|
913
|
+
sk: {
|
|
914
|
+
field: string;
|
|
915
|
+
composite: "createdAt"[];
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
}>;
|
|
920
|
+
|
|
921
|
+
export declare const traceEntity: Entity<string, string, string, {
|
|
922
|
+
model: {
|
|
923
|
+
entity: string;
|
|
924
|
+
version: string;
|
|
925
|
+
service: string;
|
|
926
|
+
};
|
|
927
|
+
attributes: {
|
|
928
|
+
id: {
|
|
929
|
+
type: "string";
|
|
930
|
+
required: true;
|
|
931
|
+
};
|
|
932
|
+
parentSpanId: {
|
|
933
|
+
type: "string";
|
|
934
|
+
required: false;
|
|
935
|
+
};
|
|
936
|
+
name: {
|
|
937
|
+
type: "string";
|
|
938
|
+
required: true;
|
|
939
|
+
};
|
|
940
|
+
traceId: {
|
|
941
|
+
type: "string";
|
|
942
|
+
required: true;
|
|
943
|
+
};
|
|
944
|
+
scope: {
|
|
945
|
+
type: "string";
|
|
946
|
+
required: true;
|
|
947
|
+
};
|
|
948
|
+
kind: {
|
|
949
|
+
type: "number";
|
|
950
|
+
required: true;
|
|
951
|
+
};
|
|
952
|
+
attributes: {
|
|
953
|
+
type: "string";
|
|
954
|
+
required: false;
|
|
955
|
+
set: (value?: any) => any;
|
|
956
|
+
get: (value?: string) => any;
|
|
957
|
+
};
|
|
958
|
+
status: {
|
|
959
|
+
type: "string";
|
|
960
|
+
required: false;
|
|
961
|
+
set: (value?: any) => any;
|
|
962
|
+
get: (value?: string) => string | undefined;
|
|
963
|
+
};
|
|
964
|
+
events: {
|
|
965
|
+
type: "string";
|
|
966
|
+
required: false;
|
|
967
|
+
set: (value?: any) => any;
|
|
968
|
+
get: (value?: string) => string | undefined;
|
|
969
|
+
};
|
|
970
|
+
links: {
|
|
971
|
+
type: "string";
|
|
972
|
+
required: false;
|
|
973
|
+
set: (value?: any) => any;
|
|
974
|
+
get: (value?: string) => string | undefined;
|
|
975
|
+
};
|
|
976
|
+
other: {
|
|
977
|
+
type: "string";
|
|
978
|
+
required: false;
|
|
979
|
+
};
|
|
980
|
+
startTime: {
|
|
981
|
+
type: "number";
|
|
982
|
+
required: true;
|
|
983
|
+
};
|
|
984
|
+
endTime: {
|
|
985
|
+
type: "number";
|
|
986
|
+
required: true;
|
|
987
|
+
};
|
|
988
|
+
createdAt: {
|
|
989
|
+
readonly type: "string";
|
|
990
|
+
readonly required: true;
|
|
991
|
+
readonly readOnly: true;
|
|
992
|
+
readonly set: (value?: Date | string) => string;
|
|
993
|
+
readonly default: () => string;
|
|
994
|
+
};
|
|
995
|
+
updatedAt: {
|
|
996
|
+
readonly type: "string";
|
|
997
|
+
readonly required: true;
|
|
998
|
+
readonly set: (value?: Date | string) => string;
|
|
999
|
+
readonly default: () => string;
|
|
1000
|
+
};
|
|
1001
|
+
metadata: {
|
|
1002
|
+
readonly type: "string";
|
|
1003
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
1004
|
+
readonly get: (value?: string) => any;
|
|
1005
|
+
};
|
|
1006
|
+
entity: {
|
|
1007
|
+
type: "string";
|
|
1008
|
+
required: true;
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
indexes: {
|
|
1012
|
+
primary: {
|
|
1013
|
+
pk: {
|
|
1014
|
+
field: string;
|
|
1015
|
+
composite: ("entity" | "id")[];
|
|
1016
|
+
};
|
|
1017
|
+
sk: {
|
|
1018
|
+
field: string;
|
|
1019
|
+
composite: never[];
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
1022
|
+
byName: {
|
|
1023
|
+
index: string;
|
|
1024
|
+
pk: {
|
|
1025
|
+
field: string;
|
|
1026
|
+
composite: ("entity" | "name")[];
|
|
1027
|
+
};
|
|
1028
|
+
sk: {
|
|
1029
|
+
field: string;
|
|
1030
|
+
composite: "startTime"[];
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
byScope: {
|
|
1034
|
+
index: string;
|
|
1035
|
+
pk: {
|
|
1036
|
+
field: string;
|
|
1037
|
+
composite: ("entity" | "scope")[];
|
|
1038
|
+
};
|
|
1039
|
+
sk: {
|
|
1040
|
+
field: string;
|
|
1041
|
+
composite: "startTime"[];
|
|
1042
|
+
};
|
|
1043
|
+
};
|
|
1044
|
+
};
|
|
1045
|
+
}>;
|
|
1046
|
+
|
|
1047
|
+
export declare const workflowSnapshotEntity: Entity<string, string, string, {
|
|
1048
|
+
model: {
|
|
1049
|
+
entity: string;
|
|
1050
|
+
version: string;
|
|
1051
|
+
service: string;
|
|
1052
|
+
};
|
|
1053
|
+
attributes: {
|
|
1054
|
+
workflow_name: {
|
|
1055
|
+
type: "string";
|
|
1056
|
+
required: true;
|
|
1057
|
+
};
|
|
1058
|
+
run_id: {
|
|
1059
|
+
type: "string";
|
|
1060
|
+
required: true;
|
|
1061
|
+
};
|
|
1062
|
+
snapshot: {
|
|
1063
|
+
type: "string";
|
|
1064
|
+
required: true;
|
|
1065
|
+
set: (value?: any) => any;
|
|
1066
|
+
get: (value?: string) => any;
|
|
1067
|
+
};
|
|
1068
|
+
resourceId: {
|
|
1069
|
+
type: "string";
|
|
1070
|
+
required: false;
|
|
1071
|
+
};
|
|
1072
|
+
createdAt: {
|
|
1073
|
+
readonly type: "string";
|
|
1074
|
+
readonly required: true;
|
|
1075
|
+
readonly readOnly: true;
|
|
1076
|
+
readonly set: (value?: Date | string) => string;
|
|
1077
|
+
readonly default: () => string;
|
|
1078
|
+
};
|
|
1079
|
+
updatedAt: {
|
|
1080
|
+
readonly type: "string";
|
|
1081
|
+
readonly required: true;
|
|
1082
|
+
readonly set: (value?: Date | string) => string;
|
|
1083
|
+
readonly default: () => string;
|
|
1084
|
+
};
|
|
1085
|
+
metadata: {
|
|
1086
|
+
readonly type: "string";
|
|
1087
|
+
readonly set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
1088
|
+
readonly get: (value?: string) => any;
|
|
1089
|
+
};
|
|
1090
|
+
entity: {
|
|
1091
|
+
type: "string";
|
|
1092
|
+
required: true;
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
indexes: {
|
|
1096
|
+
primary: {
|
|
1097
|
+
pk: {
|
|
1098
|
+
field: string;
|
|
1099
|
+
composite: ("entity" | "workflow_name")[];
|
|
1100
|
+
};
|
|
1101
|
+
sk: {
|
|
1102
|
+
field: string;
|
|
1103
|
+
composite: "run_id"[];
|
|
1104
|
+
};
|
|
1105
|
+
};
|
|
1106
|
+
gsi2: {
|
|
1107
|
+
index: string;
|
|
1108
|
+
pk: {
|
|
1109
|
+
field: string;
|
|
1110
|
+
composite: ("entity" | "run_id")[];
|
|
1111
|
+
};
|
|
1112
|
+
sk: {
|
|
1113
|
+
field: string;
|
|
1114
|
+
composite: "workflow_name"[];
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
};
|
|
1118
|
+
}>;
|
|
1119
|
+
|
|
1120
|
+
export { }
|