@inkeep/agents-core 0.40.0 → 0.41.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 (43) hide show
  1. package/dist/_virtual/rolldown_runtime.js +2 -2
  2. package/dist/auth/auth-schema.d.ts +104 -104
  3. package/dist/auth/auth-validation-schemas.d.ts +146 -146
  4. package/dist/auth/auth.d.ts +67 -58
  5. package/dist/auth/permissions.d.ts +15 -14
  6. package/dist/auth/permissions.js +2 -1
  7. package/dist/client-exports.d.ts +14 -1
  8. package/dist/constants/otel-attributes.d.ts +1 -3
  9. package/dist/constants/otel-attributes.js +2 -4
  10. package/dist/constants/signoz-queries.d.ts +0 -1
  11. package/dist/constants/signoz-queries.js +0 -1
  12. package/dist/credential-stores/index.d.ts +2 -1
  13. package/dist/credential-stores/index.js +2 -1
  14. package/dist/data-access/agents.d.ts +21 -21
  15. package/dist/data-access/apiKeys.d.ts +16 -16
  16. package/dist/data-access/artifactComponents.d.ts +30 -10
  17. package/dist/data-access/artifactComponents.js +22 -1
  18. package/dist/data-access/contextConfigs.d.ts +12 -12
  19. package/dist/data-access/conversations.d.ts +16 -16
  20. package/dist/data-access/dataComponents.d.ts +4 -4
  21. package/dist/data-access/functionTools.d.ts +8 -8
  22. package/dist/data-access/messages.d.ts +12 -12
  23. package/dist/data-access/subAgentExternalAgentRelations.d.ts +24 -24
  24. package/dist/data-access/subAgentRelations.d.ts +28 -28
  25. package/dist/data-access/subAgentTeamAgentRelations.d.ts +24 -24
  26. package/dist/data-access/subAgents.d.ts +15 -15
  27. package/dist/data-access/tasks.d.ts +4 -4
  28. package/dist/data-access/tools.d.ts +33 -33
  29. package/dist/db/schema.d.ts +429 -404
  30. package/dist/db/schema.js +3 -2
  31. package/dist/index.d.ts +2 -1
  32. package/dist/index.js +3 -2
  33. package/dist/utils/logger.js +19 -3
  34. package/dist/utils/mcp-client.js +19 -5
  35. package/dist/utils/model-factory.js +13 -1
  36. package/dist/utils/schema-conversion.d.ts +1 -1
  37. package/dist/utils/schema-conversion.js +1 -1
  38. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  39. package/dist/validation/schemas.d.ts +1738 -1338
  40. package/drizzle/0007_slim_karma.sql +1 -0
  41. package/drizzle/meta/0007_snapshot.json +3772 -0
  42. package/drizzle/meta/_journal.json +7 -0
  43. package/package.json +10 -9
@@ -0,0 +1,3772 @@
1
+ {
2
+ "id": "2726323b-dcd2-4252-b7e1-41eb1d157858",
3
+ "prevId": "192a53a3-5b1b-4793-878e-e836404db1bf",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "provider_id": {
24
+ "name": "provider_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "user_id": {
30
+ "name": "user_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "id_token": {
48
+ "name": "id_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "access_token_expires_at": {
54
+ "name": "access_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "scope": {
66
+ "name": "scope",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true
89
+ }
90
+ },
91
+ "indexes": {
92
+ "account_userId_idx": {
93
+ "name": "account_userId_idx",
94
+ "columns": [
95
+ {
96
+ "expression": "user_id",
97
+ "isExpression": false,
98
+ "asc": true,
99
+ "nulls": "last"
100
+ }
101
+ ],
102
+ "isUnique": false,
103
+ "concurrently": false,
104
+ "method": "btree",
105
+ "with": {}
106
+ }
107
+ },
108
+ "foreignKeys": {
109
+ "account_user_id_user_id_fk": {
110
+ "name": "account_user_id_user_id_fk",
111
+ "tableFrom": "account",
112
+ "tableTo": "user",
113
+ "columnsFrom": [
114
+ "user_id"
115
+ ],
116
+ "columnsTo": [
117
+ "id"
118
+ ],
119
+ "onDelete": "cascade",
120
+ "onUpdate": "no action"
121
+ }
122
+ },
123
+ "compositePrimaryKeys": {},
124
+ "uniqueConstraints": {},
125
+ "policies": {},
126
+ "checkConstraints": {},
127
+ "isRLSEnabled": false
128
+ },
129
+ "public.agent": {
130
+ "name": "agent",
131
+ "schema": "",
132
+ "columns": {
133
+ "tenant_id": {
134
+ "name": "tenant_id",
135
+ "type": "varchar(256)",
136
+ "primaryKey": false,
137
+ "notNull": true
138
+ },
139
+ "id": {
140
+ "name": "id",
141
+ "type": "varchar(256)",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "project_id": {
146
+ "name": "project_id",
147
+ "type": "varchar(256)",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ },
151
+ "name": {
152
+ "name": "name",
153
+ "type": "varchar(256)",
154
+ "primaryKey": false,
155
+ "notNull": true
156
+ },
157
+ "description": {
158
+ "name": "description",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": false
162
+ },
163
+ "default_sub_agent_id": {
164
+ "name": "default_sub_agent_id",
165
+ "type": "varchar(256)",
166
+ "primaryKey": false,
167
+ "notNull": false
168
+ },
169
+ "context_config_id": {
170
+ "name": "context_config_id",
171
+ "type": "varchar(256)",
172
+ "primaryKey": false,
173
+ "notNull": false
174
+ },
175
+ "models": {
176
+ "name": "models",
177
+ "type": "jsonb",
178
+ "primaryKey": false,
179
+ "notNull": false
180
+ },
181
+ "status_updates": {
182
+ "name": "status_updates",
183
+ "type": "jsonb",
184
+ "primaryKey": false,
185
+ "notNull": false
186
+ },
187
+ "prompt": {
188
+ "name": "prompt",
189
+ "type": "text",
190
+ "primaryKey": false,
191
+ "notNull": false
192
+ },
193
+ "stop_when": {
194
+ "name": "stop_when",
195
+ "type": "jsonb",
196
+ "primaryKey": false,
197
+ "notNull": false
198
+ },
199
+ "created_at": {
200
+ "name": "created_at",
201
+ "type": "timestamp",
202
+ "primaryKey": false,
203
+ "notNull": true,
204
+ "default": "now()"
205
+ },
206
+ "updated_at": {
207
+ "name": "updated_at",
208
+ "type": "timestamp",
209
+ "primaryKey": false,
210
+ "notNull": true,
211
+ "default": "now()"
212
+ }
213
+ },
214
+ "indexes": {},
215
+ "foreignKeys": {
216
+ "agent_project_fk": {
217
+ "name": "agent_project_fk",
218
+ "tableFrom": "agent",
219
+ "tableTo": "projects",
220
+ "columnsFrom": [
221
+ "tenant_id",
222
+ "project_id"
223
+ ],
224
+ "columnsTo": [
225
+ "tenant_id",
226
+ "id"
227
+ ],
228
+ "onDelete": "cascade",
229
+ "onUpdate": "no action"
230
+ }
231
+ },
232
+ "compositePrimaryKeys": {
233
+ "agent_tenant_id_project_id_id_pk": {
234
+ "name": "agent_tenant_id_project_id_id_pk",
235
+ "columns": [
236
+ "tenant_id",
237
+ "project_id",
238
+ "id"
239
+ ]
240
+ }
241
+ },
242
+ "uniqueConstraints": {},
243
+ "policies": {},
244
+ "checkConstraints": {},
245
+ "isRLSEnabled": false
246
+ },
247
+ "public.api_keys": {
248
+ "name": "api_keys",
249
+ "schema": "",
250
+ "columns": {
251
+ "tenant_id": {
252
+ "name": "tenant_id",
253
+ "type": "varchar(256)",
254
+ "primaryKey": false,
255
+ "notNull": true
256
+ },
257
+ "id": {
258
+ "name": "id",
259
+ "type": "varchar(256)",
260
+ "primaryKey": false,
261
+ "notNull": true
262
+ },
263
+ "project_id": {
264
+ "name": "project_id",
265
+ "type": "varchar(256)",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "agent_id": {
270
+ "name": "agent_id",
271
+ "type": "varchar(256)",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "public_id": {
276
+ "name": "public_id",
277
+ "type": "varchar(256)",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "key_hash": {
282
+ "name": "key_hash",
283
+ "type": "varchar(256)",
284
+ "primaryKey": false,
285
+ "notNull": true
286
+ },
287
+ "key_prefix": {
288
+ "name": "key_prefix",
289
+ "type": "varchar(256)",
290
+ "primaryKey": false,
291
+ "notNull": true
292
+ },
293
+ "name": {
294
+ "name": "name",
295
+ "type": "varchar(256)",
296
+ "primaryKey": false,
297
+ "notNull": false
298
+ },
299
+ "last_used_at": {
300
+ "name": "last_used_at",
301
+ "type": "timestamp",
302
+ "primaryKey": false,
303
+ "notNull": false
304
+ },
305
+ "expires_at": {
306
+ "name": "expires_at",
307
+ "type": "timestamp",
308
+ "primaryKey": false,
309
+ "notNull": false
310
+ },
311
+ "created_at": {
312
+ "name": "created_at",
313
+ "type": "timestamp",
314
+ "primaryKey": false,
315
+ "notNull": true,
316
+ "default": "now()"
317
+ },
318
+ "updated_at": {
319
+ "name": "updated_at",
320
+ "type": "timestamp",
321
+ "primaryKey": false,
322
+ "notNull": true,
323
+ "default": "now()"
324
+ }
325
+ },
326
+ "indexes": {
327
+ "api_keys_tenant_agent_idx": {
328
+ "name": "api_keys_tenant_agent_idx",
329
+ "columns": [
330
+ {
331
+ "expression": "tenant_id",
332
+ "isExpression": false,
333
+ "asc": true,
334
+ "nulls": "last"
335
+ },
336
+ {
337
+ "expression": "agent_id",
338
+ "isExpression": false,
339
+ "asc": true,
340
+ "nulls": "last"
341
+ }
342
+ ],
343
+ "isUnique": false,
344
+ "concurrently": false,
345
+ "method": "btree",
346
+ "with": {}
347
+ },
348
+ "api_keys_prefix_idx": {
349
+ "name": "api_keys_prefix_idx",
350
+ "columns": [
351
+ {
352
+ "expression": "key_prefix",
353
+ "isExpression": false,
354
+ "asc": true,
355
+ "nulls": "last"
356
+ }
357
+ ],
358
+ "isUnique": false,
359
+ "concurrently": false,
360
+ "method": "btree",
361
+ "with": {}
362
+ },
363
+ "api_keys_public_id_idx": {
364
+ "name": "api_keys_public_id_idx",
365
+ "columns": [
366
+ {
367
+ "expression": "public_id",
368
+ "isExpression": false,
369
+ "asc": true,
370
+ "nulls": "last"
371
+ }
372
+ ],
373
+ "isUnique": false,
374
+ "concurrently": false,
375
+ "method": "btree",
376
+ "with": {}
377
+ }
378
+ },
379
+ "foreignKeys": {
380
+ "api_keys_organization_fk": {
381
+ "name": "api_keys_organization_fk",
382
+ "tableFrom": "api_keys",
383
+ "tableTo": "organization",
384
+ "columnsFrom": [
385
+ "tenant_id"
386
+ ],
387
+ "columnsTo": [
388
+ "id"
389
+ ],
390
+ "onDelete": "cascade",
391
+ "onUpdate": "no action"
392
+ },
393
+ "api_keys_project_fk": {
394
+ "name": "api_keys_project_fk",
395
+ "tableFrom": "api_keys",
396
+ "tableTo": "projects",
397
+ "columnsFrom": [
398
+ "tenant_id",
399
+ "project_id"
400
+ ],
401
+ "columnsTo": [
402
+ "tenant_id",
403
+ "id"
404
+ ],
405
+ "onDelete": "cascade",
406
+ "onUpdate": "no action"
407
+ },
408
+ "api_keys_agent_fk": {
409
+ "name": "api_keys_agent_fk",
410
+ "tableFrom": "api_keys",
411
+ "tableTo": "agent",
412
+ "columnsFrom": [
413
+ "tenant_id",
414
+ "project_id",
415
+ "agent_id"
416
+ ],
417
+ "columnsTo": [
418
+ "tenant_id",
419
+ "project_id",
420
+ "id"
421
+ ],
422
+ "onDelete": "cascade",
423
+ "onUpdate": "no action"
424
+ }
425
+ },
426
+ "compositePrimaryKeys": {},
427
+ "uniqueConstraints": {
428
+ "api_keys_public_id_unique": {
429
+ "name": "api_keys_public_id_unique",
430
+ "nullsNotDistinct": false,
431
+ "columns": [
432
+ "public_id"
433
+ ]
434
+ }
435
+ },
436
+ "policies": {},
437
+ "checkConstraints": {},
438
+ "isRLSEnabled": false
439
+ },
440
+ "public.artifact_components": {
441
+ "name": "artifact_components",
442
+ "schema": "",
443
+ "columns": {
444
+ "tenant_id": {
445
+ "name": "tenant_id",
446
+ "type": "varchar(256)",
447
+ "primaryKey": false,
448
+ "notNull": true
449
+ },
450
+ "id": {
451
+ "name": "id",
452
+ "type": "varchar(256)",
453
+ "primaryKey": false,
454
+ "notNull": true
455
+ },
456
+ "project_id": {
457
+ "name": "project_id",
458
+ "type": "varchar(256)",
459
+ "primaryKey": false,
460
+ "notNull": true
461
+ },
462
+ "name": {
463
+ "name": "name",
464
+ "type": "varchar(256)",
465
+ "primaryKey": false,
466
+ "notNull": true
467
+ },
468
+ "description": {
469
+ "name": "description",
470
+ "type": "text",
471
+ "primaryKey": false,
472
+ "notNull": false
473
+ },
474
+ "props": {
475
+ "name": "props",
476
+ "type": "jsonb",
477
+ "primaryKey": false,
478
+ "notNull": false
479
+ },
480
+ "render": {
481
+ "name": "render",
482
+ "type": "jsonb",
483
+ "primaryKey": false,
484
+ "notNull": false
485
+ },
486
+ "created_at": {
487
+ "name": "created_at",
488
+ "type": "timestamp",
489
+ "primaryKey": false,
490
+ "notNull": true,
491
+ "default": "now()"
492
+ },
493
+ "updated_at": {
494
+ "name": "updated_at",
495
+ "type": "timestamp",
496
+ "primaryKey": false,
497
+ "notNull": true,
498
+ "default": "now()"
499
+ }
500
+ },
501
+ "indexes": {},
502
+ "foreignKeys": {
503
+ "artifact_components_project_fk": {
504
+ "name": "artifact_components_project_fk",
505
+ "tableFrom": "artifact_components",
506
+ "tableTo": "projects",
507
+ "columnsFrom": [
508
+ "tenant_id",
509
+ "project_id"
510
+ ],
511
+ "columnsTo": [
512
+ "tenant_id",
513
+ "id"
514
+ ],
515
+ "onDelete": "cascade",
516
+ "onUpdate": "no action"
517
+ }
518
+ },
519
+ "compositePrimaryKeys": {
520
+ "artifact_components_tenant_id_project_id_id_pk": {
521
+ "name": "artifact_components_tenant_id_project_id_id_pk",
522
+ "columns": [
523
+ "tenant_id",
524
+ "project_id",
525
+ "id"
526
+ ]
527
+ }
528
+ },
529
+ "uniqueConstraints": {},
530
+ "policies": {},
531
+ "checkConstraints": {},
532
+ "isRLSEnabled": false
533
+ },
534
+ "public.context_cache": {
535
+ "name": "context_cache",
536
+ "schema": "",
537
+ "columns": {
538
+ "tenant_id": {
539
+ "name": "tenant_id",
540
+ "type": "varchar(256)",
541
+ "primaryKey": false,
542
+ "notNull": true
543
+ },
544
+ "id": {
545
+ "name": "id",
546
+ "type": "varchar(256)",
547
+ "primaryKey": false,
548
+ "notNull": true
549
+ },
550
+ "project_id": {
551
+ "name": "project_id",
552
+ "type": "varchar(256)",
553
+ "primaryKey": false,
554
+ "notNull": true
555
+ },
556
+ "conversation_id": {
557
+ "name": "conversation_id",
558
+ "type": "varchar(256)",
559
+ "primaryKey": false,
560
+ "notNull": true
561
+ },
562
+ "context_config_id": {
563
+ "name": "context_config_id",
564
+ "type": "varchar(256)",
565
+ "primaryKey": false,
566
+ "notNull": true
567
+ },
568
+ "context_variable_key": {
569
+ "name": "context_variable_key",
570
+ "type": "varchar(256)",
571
+ "primaryKey": false,
572
+ "notNull": true
573
+ },
574
+ "value": {
575
+ "name": "value",
576
+ "type": "jsonb",
577
+ "primaryKey": false,
578
+ "notNull": true
579
+ },
580
+ "request_hash": {
581
+ "name": "request_hash",
582
+ "type": "varchar(256)",
583
+ "primaryKey": false,
584
+ "notNull": false
585
+ },
586
+ "fetched_at": {
587
+ "name": "fetched_at",
588
+ "type": "timestamp",
589
+ "primaryKey": false,
590
+ "notNull": true,
591
+ "default": "now()"
592
+ },
593
+ "fetch_source": {
594
+ "name": "fetch_source",
595
+ "type": "varchar(256)",
596
+ "primaryKey": false,
597
+ "notNull": false
598
+ },
599
+ "fetch_duration_ms": {
600
+ "name": "fetch_duration_ms",
601
+ "type": "integer",
602
+ "primaryKey": false,
603
+ "notNull": false
604
+ },
605
+ "created_at": {
606
+ "name": "created_at",
607
+ "type": "timestamp",
608
+ "primaryKey": false,
609
+ "notNull": true,
610
+ "default": "now()"
611
+ },
612
+ "updated_at": {
613
+ "name": "updated_at",
614
+ "type": "timestamp",
615
+ "primaryKey": false,
616
+ "notNull": true,
617
+ "default": "now()"
618
+ }
619
+ },
620
+ "indexes": {
621
+ "context_cache_lookup_idx": {
622
+ "name": "context_cache_lookup_idx",
623
+ "columns": [
624
+ {
625
+ "expression": "conversation_id",
626
+ "isExpression": false,
627
+ "asc": true,
628
+ "nulls": "last"
629
+ },
630
+ {
631
+ "expression": "context_config_id",
632
+ "isExpression": false,
633
+ "asc": true,
634
+ "nulls": "last"
635
+ },
636
+ {
637
+ "expression": "context_variable_key",
638
+ "isExpression": false,
639
+ "asc": true,
640
+ "nulls": "last"
641
+ }
642
+ ],
643
+ "isUnique": false,
644
+ "concurrently": false,
645
+ "method": "btree",
646
+ "with": {}
647
+ }
648
+ },
649
+ "foreignKeys": {
650
+ "context_cache_project_fk": {
651
+ "name": "context_cache_project_fk",
652
+ "tableFrom": "context_cache",
653
+ "tableTo": "projects",
654
+ "columnsFrom": [
655
+ "tenant_id",
656
+ "project_id"
657
+ ],
658
+ "columnsTo": [
659
+ "tenant_id",
660
+ "id"
661
+ ],
662
+ "onDelete": "cascade",
663
+ "onUpdate": "no action"
664
+ }
665
+ },
666
+ "compositePrimaryKeys": {
667
+ "context_cache_tenant_id_project_id_id_pk": {
668
+ "name": "context_cache_tenant_id_project_id_id_pk",
669
+ "columns": [
670
+ "tenant_id",
671
+ "project_id",
672
+ "id"
673
+ ]
674
+ }
675
+ },
676
+ "uniqueConstraints": {},
677
+ "policies": {},
678
+ "checkConstraints": {},
679
+ "isRLSEnabled": false
680
+ },
681
+ "public.context_configs": {
682
+ "name": "context_configs",
683
+ "schema": "",
684
+ "columns": {
685
+ "tenant_id": {
686
+ "name": "tenant_id",
687
+ "type": "varchar(256)",
688
+ "primaryKey": false,
689
+ "notNull": true
690
+ },
691
+ "id": {
692
+ "name": "id",
693
+ "type": "varchar(256)",
694
+ "primaryKey": false,
695
+ "notNull": true
696
+ },
697
+ "project_id": {
698
+ "name": "project_id",
699
+ "type": "varchar(256)",
700
+ "primaryKey": false,
701
+ "notNull": true
702
+ },
703
+ "agent_id": {
704
+ "name": "agent_id",
705
+ "type": "varchar(256)",
706
+ "primaryKey": false,
707
+ "notNull": true
708
+ },
709
+ "headers_schema": {
710
+ "name": "headers_schema",
711
+ "type": "jsonb",
712
+ "primaryKey": false,
713
+ "notNull": false
714
+ },
715
+ "context_variables": {
716
+ "name": "context_variables",
717
+ "type": "jsonb",
718
+ "primaryKey": false,
719
+ "notNull": false
720
+ },
721
+ "created_at": {
722
+ "name": "created_at",
723
+ "type": "timestamp",
724
+ "primaryKey": false,
725
+ "notNull": true,
726
+ "default": "now()"
727
+ },
728
+ "updated_at": {
729
+ "name": "updated_at",
730
+ "type": "timestamp",
731
+ "primaryKey": false,
732
+ "notNull": true,
733
+ "default": "now()"
734
+ }
735
+ },
736
+ "indexes": {},
737
+ "foreignKeys": {
738
+ "context_configs_agent_fk": {
739
+ "name": "context_configs_agent_fk",
740
+ "tableFrom": "context_configs",
741
+ "tableTo": "agent",
742
+ "columnsFrom": [
743
+ "tenant_id",
744
+ "project_id",
745
+ "agent_id"
746
+ ],
747
+ "columnsTo": [
748
+ "tenant_id",
749
+ "project_id",
750
+ "id"
751
+ ],
752
+ "onDelete": "cascade",
753
+ "onUpdate": "no action"
754
+ }
755
+ },
756
+ "compositePrimaryKeys": {
757
+ "context_configs_tenant_id_project_id_agent_id_id_pk": {
758
+ "name": "context_configs_tenant_id_project_id_agent_id_id_pk",
759
+ "columns": [
760
+ "tenant_id",
761
+ "project_id",
762
+ "agent_id",
763
+ "id"
764
+ ]
765
+ }
766
+ },
767
+ "uniqueConstraints": {},
768
+ "policies": {},
769
+ "checkConstraints": {},
770
+ "isRLSEnabled": false
771
+ },
772
+ "public.conversations": {
773
+ "name": "conversations",
774
+ "schema": "",
775
+ "columns": {
776
+ "tenant_id": {
777
+ "name": "tenant_id",
778
+ "type": "varchar(256)",
779
+ "primaryKey": false,
780
+ "notNull": true
781
+ },
782
+ "id": {
783
+ "name": "id",
784
+ "type": "varchar(256)",
785
+ "primaryKey": false,
786
+ "notNull": true
787
+ },
788
+ "project_id": {
789
+ "name": "project_id",
790
+ "type": "varchar(256)",
791
+ "primaryKey": false,
792
+ "notNull": true
793
+ },
794
+ "user_id": {
795
+ "name": "user_id",
796
+ "type": "varchar(256)",
797
+ "primaryKey": false,
798
+ "notNull": false
799
+ },
800
+ "active_sub_agent_id": {
801
+ "name": "active_sub_agent_id",
802
+ "type": "varchar(256)",
803
+ "primaryKey": false,
804
+ "notNull": true
805
+ },
806
+ "title": {
807
+ "name": "title",
808
+ "type": "text",
809
+ "primaryKey": false,
810
+ "notNull": false
811
+ },
812
+ "last_context_resolution": {
813
+ "name": "last_context_resolution",
814
+ "type": "timestamp",
815
+ "primaryKey": false,
816
+ "notNull": false
817
+ },
818
+ "metadata": {
819
+ "name": "metadata",
820
+ "type": "jsonb",
821
+ "primaryKey": false,
822
+ "notNull": false
823
+ },
824
+ "created_at": {
825
+ "name": "created_at",
826
+ "type": "timestamp",
827
+ "primaryKey": false,
828
+ "notNull": true,
829
+ "default": "now()"
830
+ },
831
+ "updated_at": {
832
+ "name": "updated_at",
833
+ "type": "timestamp",
834
+ "primaryKey": false,
835
+ "notNull": true,
836
+ "default": "now()"
837
+ }
838
+ },
839
+ "indexes": {},
840
+ "foreignKeys": {
841
+ "conversations_project_fk": {
842
+ "name": "conversations_project_fk",
843
+ "tableFrom": "conversations",
844
+ "tableTo": "projects",
845
+ "columnsFrom": [
846
+ "tenant_id",
847
+ "project_id"
848
+ ],
849
+ "columnsTo": [
850
+ "tenant_id",
851
+ "id"
852
+ ],
853
+ "onDelete": "cascade",
854
+ "onUpdate": "no action"
855
+ }
856
+ },
857
+ "compositePrimaryKeys": {
858
+ "conversations_tenant_id_project_id_id_pk": {
859
+ "name": "conversations_tenant_id_project_id_id_pk",
860
+ "columns": [
861
+ "tenant_id",
862
+ "project_id",
863
+ "id"
864
+ ]
865
+ }
866
+ },
867
+ "uniqueConstraints": {},
868
+ "policies": {},
869
+ "checkConstraints": {},
870
+ "isRLSEnabled": false
871
+ },
872
+ "public.credential_references": {
873
+ "name": "credential_references",
874
+ "schema": "",
875
+ "columns": {
876
+ "tenant_id": {
877
+ "name": "tenant_id",
878
+ "type": "varchar(256)",
879
+ "primaryKey": false,
880
+ "notNull": true
881
+ },
882
+ "id": {
883
+ "name": "id",
884
+ "type": "varchar(256)",
885
+ "primaryKey": false,
886
+ "notNull": true
887
+ },
888
+ "project_id": {
889
+ "name": "project_id",
890
+ "type": "varchar(256)",
891
+ "primaryKey": false,
892
+ "notNull": true
893
+ },
894
+ "name": {
895
+ "name": "name",
896
+ "type": "varchar(256)",
897
+ "primaryKey": false,
898
+ "notNull": true
899
+ },
900
+ "type": {
901
+ "name": "type",
902
+ "type": "varchar(256)",
903
+ "primaryKey": false,
904
+ "notNull": true
905
+ },
906
+ "credential_store_id": {
907
+ "name": "credential_store_id",
908
+ "type": "varchar(256)",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ },
912
+ "retrieval_params": {
913
+ "name": "retrieval_params",
914
+ "type": "jsonb",
915
+ "primaryKey": false,
916
+ "notNull": false
917
+ },
918
+ "tool_id": {
919
+ "name": "tool_id",
920
+ "type": "varchar(256)",
921
+ "primaryKey": false,
922
+ "notNull": false
923
+ },
924
+ "user_id": {
925
+ "name": "user_id",
926
+ "type": "varchar(256)",
927
+ "primaryKey": false,
928
+ "notNull": false
929
+ },
930
+ "created_by": {
931
+ "name": "created_by",
932
+ "type": "varchar(256)",
933
+ "primaryKey": false,
934
+ "notNull": false
935
+ },
936
+ "created_at": {
937
+ "name": "created_at",
938
+ "type": "timestamp",
939
+ "primaryKey": false,
940
+ "notNull": true,
941
+ "default": "now()"
942
+ },
943
+ "updated_at": {
944
+ "name": "updated_at",
945
+ "type": "timestamp",
946
+ "primaryKey": false,
947
+ "notNull": true,
948
+ "default": "now()"
949
+ }
950
+ },
951
+ "indexes": {},
952
+ "foreignKeys": {
953
+ "credential_references_project_fk": {
954
+ "name": "credential_references_project_fk",
955
+ "tableFrom": "credential_references",
956
+ "tableTo": "projects",
957
+ "columnsFrom": [
958
+ "tenant_id",
959
+ "project_id"
960
+ ],
961
+ "columnsTo": [
962
+ "tenant_id",
963
+ "id"
964
+ ],
965
+ "onDelete": "cascade",
966
+ "onUpdate": "no action"
967
+ }
968
+ },
969
+ "compositePrimaryKeys": {
970
+ "credential_references_tenant_id_project_id_id_pk": {
971
+ "name": "credential_references_tenant_id_project_id_id_pk",
972
+ "columns": [
973
+ "tenant_id",
974
+ "project_id",
975
+ "id"
976
+ ]
977
+ }
978
+ },
979
+ "uniqueConstraints": {
980
+ "credential_references_id_unique": {
981
+ "name": "credential_references_id_unique",
982
+ "nullsNotDistinct": false,
983
+ "columns": [
984
+ "id"
985
+ ]
986
+ },
987
+ "credential_references_tool_user_unique": {
988
+ "name": "credential_references_tool_user_unique",
989
+ "nullsNotDistinct": false,
990
+ "columns": [
991
+ "tool_id",
992
+ "user_id"
993
+ ]
994
+ }
995
+ },
996
+ "policies": {},
997
+ "checkConstraints": {},
998
+ "isRLSEnabled": false
999
+ },
1000
+ "public.data_components": {
1001
+ "name": "data_components",
1002
+ "schema": "",
1003
+ "columns": {
1004
+ "tenant_id": {
1005
+ "name": "tenant_id",
1006
+ "type": "varchar(256)",
1007
+ "primaryKey": false,
1008
+ "notNull": true
1009
+ },
1010
+ "id": {
1011
+ "name": "id",
1012
+ "type": "varchar(256)",
1013
+ "primaryKey": false,
1014
+ "notNull": true
1015
+ },
1016
+ "project_id": {
1017
+ "name": "project_id",
1018
+ "type": "varchar(256)",
1019
+ "primaryKey": false,
1020
+ "notNull": true
1021
+ },
1022
+ "name": {
1023
+ "name": "name",
1024
+ "type": "varchar(256)",
1025
+ "primaryKey": false,
1026
+ "notNull": true
1027
+ },
1028
+ "description": {
1029
+ "name": "description",
1030
+ "type": "text",
1031
+ "primaryKey": false,
1032
+ "notNull": false
1033
+ },
1034
+ "props": {
1035
+ "name": "props",
1036
+ "type": "jsonb",
1037
+ "primaryKey": false,
1038
+ "notNull": false
1039
+ },
1040
+ "render": {
1041
+ "name": "render",
1042
+ "type": "jsonb",
1043
+ "primaryKey": false,
1044
+ "notNull": false
1045
+ },
1046
+ "created_at": {
1047
+ "name": "created_at",
1048
+ "type": "timestamp",
1049
+ "primaryKey": false,
1050
+ "notNull": true,
1051
+ "default": "now()"
1052
+ },
1053
+ "updated_at": {
1054
+ "name": "updated_at",
1055
+ "type": "timestamp",
1056
+ "primaryKey": false,
1057
+ "notNull": true,
1058
+ "default": "now()"
1059
+ }
1060
+ },
1061
+ "indexes": {},
1062
+ "foreignKeys": {
1063
+ "data_components_project_fk": {
1064
+ "name": "data_components_project_fk",
1065
+ "tableFrom": "data_components",
1066
+ "tableTo": "projects",
1067
+ "columnsFrom": [
1068
+ "tenant_id",
1069
+ "project_id"
1070
+ ],
1071
+ "columnsTo": [
1072
+ "tenant_id",
1073
+ "id"
1074
+ ],
1075
+ "onDelete": "cascade",
1076
+ "onUpdate": "no action"
1077
+ }
1078
+ },
1079
+ "compositePrimaryKeys": {
1080
+ "data_components_tenant_id_project_id_id_pk": {
1081
+ "name": "data_components_tenant_id_project_id_id_pk",
1082
+ "columns": [
1083
+ "tenant_id",
1084
+ "project_id",
1085
+ "id"
1086
+ ]
1087
+ }
1088
+ },
1089
+ "uniqueConstraints": {},
1090
+ "policies": {},
1091
+ "checkConstraints": {},
1092
+ "isRLSEnabled": false
1093
+ },
1094
+ "public.device_code": {
1095
+ "name": "device_code",
1096
+ "schema": "",
1097
+ "columns": {
1098
+ "id": {
1099
+ "name": "id",
1100
+ "type": "text",
1101
+ "primaryKey": true,
1102
+ "notNull": true
1103
+ },
1104
+ "device_code": {
1105
+ "name": "device_code",
1106
+ "type": "text",
1107
+ "primaryKey": false,
1108
+ "notNull": true
1109
+ },
1110
+ "user_code": {
1111
+ "name": "user_code",
1112
+ "type": "text",
1113
+ "primaryKey": false,
1114
+ "notNull": true
1115
+ },
1116
+ "user_id": {
1117
+ "name": "user_id",
1118
+ "type": "text",
1119
+ "primaryKey": false,
1120
+ "notNull": false
1121
+ },
1122
+ "expires_at": {
1123
+ "name": "expires_at",
1124
+ "type": "timestamp",
1125
+ "primaryKey": false,
1126
+ "notNull": true
1127
+ },
1128
+ "status": {
1129
+ "name": "status",
1130
+ "type": "text",
1131
+ "primaryKey": false,
1132
+ "notNull": true
1133
+ },
1134
+ "last_polled_at": {
1135
+ "name": "last_polled_at",
1136
+ "type": "timestamp",
1137
+ "primaryKey": false,
1138
+ "notNull": false
1139
+ },
1140
+ "polling_interval": {
1141
+ "name": "polling_interval",
1142
+ "type": "integer",
1143
+ "primaryKey": false,
1144
+ "notNull": false
1145
+ },
1146
+ "client_id": {
1147
+ "name": "client_id",
1148
+ "type": "text",
1149
+ "primaryKey": false,
1150
+ "notNull": false
1151
+ },
1152
+ "scope": {
1153
+ "name": "scope",
1154
+ "type": "text",
1155
+ "primaryKey": false,
1156
+ "notNull": false
1157
+ }
1158
+ },
1159
+ "indexes": {},
1160
+ "foreignKeys": {},
1161
+ "compositePrimaryKeys": {},
1162
+ "uniqueConstraints": {},
1163
+ "policies": {},
1164
+ "checkConstraints": {},
1165
+ "isRLSEnabled": false
1166
+ },
1167
+ "public.external_agents": {
1168
+ "name": "external_agents",
1169
+ "schema": "",
1170
+ "columns": {
1171
+ "tenant_id": {
1172
+ "name": "tenant_id",
1173
+ "type": "varchar(256)",
1174
+ "primaryKey": false,
1175
+ "notNull": true
1176
+ },
1177
+ "id": {
1178
+ "name": "id",
1179
+ "type": "varchar(256)",
1180
+ "primaryKey": false,
1181
+ "notNull": true
1182
+ },
1183
+ "project_id": {
1184
+ "name": "project_id",
1185
+ "type": "varchar(256)",
1186
+ "primaryKey": false,
1187
+ "notNull": true
1188
+ },
1189
+ "name": {
1190
+ "name": "name",
1191
+ "type": "varchar(256)",
1192
+ "primaryKey": false,
1193
+ "notNull": true
1194
+ },
1195
+ "description": {
1196
+ "name": "description",
1197
+ "type": "text",
1198
+ "primaryKey": false,
1199
+ "notNull": false
1200
+ },
1201
+ "base_url": {
1202
+ "name": "base_url",
1203
+ "type": "text",
1204
+ "primaryKey": false,
1205
+ "notNull": true
1206
+ },
1207
+ "credential_reference_id": {
1208
+ "name": "credential_reference_id",
1209
+ "type": "varchar(256)",
1210
+ "primaryKey": false,
1211
+ "notNull": false
1212
+ },
1213
+ "created_at": {
1214
+ "name": "created_at",
1215
+ "type": "timestamp",
1216
+ "primaryKey": false,
1217
+ "notNull": true,
1218
+ "default": "now()"
1219
+ },
1220
+ "updated_at": {
1221
+ "name": "updated_at",
1222
+ "type": "timestamp",
1223
+ "primaryKey": false,
1224
+ "notNull": true,
1225
+ "default": "now()"
1226
+ }
1227
+ },
1228
+ "indexes": {},
1229
+ "foreignKeys": {
1230
+ "external_agents_project_fk": {
1231
+ "name": "external_agents_project_fk",
1232
+ "tableFrom": "external_agents",
1233
+ "tableTo": "projects",
1234
+ "columnsFrom": [
1235
+ "tenant_id",
1236
+ "project_id"
1237
+ ],
1238
+ "columnsTo": [
1239
+ "tenant_id",
1240
+ "id"
1241
+ ],
1242
+ "onDelete": "cascade",
1243
+ "onUpdate": "no action"
1244
+ },
1245
+ "external_agents_credential_reference_fk": {
1246
+ "name": "external_agents_credential_reference_fk",
1247
+ "tableFrom": "external_agents",
1248
+ "tableTo": "credential_references",
1249
+ "columnsFrom": [
1250
+ "credential_reference_id"
1251
+ ],
1252
+ "columnsTo": [
1253
+ "id"
1254
+ ],
1255
+ "onDelete": "set null",
1256
+ "onUpdate": "no action"
1257
+ }
1258
+ },
1259
+ "compositePrimaryKeys": {
1260
+ "external_agents_tenant_id_project_id_id_pk": {
1261
+ "name": "external_agents_tenant_id_project_id_id_pk",
1262
+ "columns": [
1263
+ "tenant_id",
1264
+ "project_id",
1265
+ "id"
1266
+ ]
1267
+ }
1268
+ },
1269
+ "uniqueConstraints": {},
1270
+ "policies": {},
1271
+ "checkConstraints": {},
1272
+ "isRLSEnabled": false
1273
+ },
1274
+ "public.function_tools": {
1275
+ "name": "function_tools",
1276
+ "schema": "",
1277
+ "columns": {
1278
+ "tenant_id": {
1279
+ "name": "tenant_id",
1280
+ "type": "varchar(256)",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "id": {
1285
+ "name": "id",
1286
+ "type": "varchar(256)",
1287
+ "primaryKey": false,
1288
+ "notNull": true
1289
+ },
1290
+ "project_id": {
1291
+ "name": "project_id",
1292
+ "type": "varchar(256)",
1293
+ "primaryKey": false,
1294
+ "notNull": true
1295
+ },
1296
+ "agent_id": {
1297
+ "name": "agent_id",
1298
+ "type": "varchar(256)",
1299
+ "primaryKey": false,
1300
+ "notNull": true
1301
+ },
1302
+ "name": {
1303
+ "name": "name",
1304
+ "type": "varchar(256)",
1305
+ "primaryKey": false,
1306
+ "notNull": true
1307
+ },
1308
+ "description": {
1309
+ "name": "description",
1310
+ "type": "text",
1311
+ "primaryKey": false,
1312
+ "notNull": false
1313
+ },
1314
+ "function_id": {
1315
+ "name": "function_id",
1316
+ "type": "varchar(256)",
1317
+ "primaryKey": false,
1318
+ "notNull": true
1319
+ },
1320
+ "created_at": {
1321
+ "name": "created_at",
1322
+ "type": "timestamp",
1323
+ "primaryKey": false,
1324
+ "notNull": true,
1325
+ "default": "now()"
1326
+ },
1327
+ "updated_at": {
1328
+ "name": "updated_at",
1329
+ "type": "timestamp",
1330
+ "primaryKey": false,
1331
+ "notNull": true,
1332
+ "default": "now()"
1333
+ }
1334
+ },
1335
+ "indexes": {},
1336
+ "foreignKeys": {
1337
+ "function_tools_agent_fk": {
1338
+ "name": "function_tools_agent_fk",
1339
+ "tableFrom": "function_tools",
1340
+ "tableTo": "agent",
1341
+ "columnsFrom": [
1342
+ "tenant_id",
1343
+ "project_id",
1344
+ "agent_id"
1345
+ ],
1346
+ "columnsTo": [
1347
+ "tenant_id",
1348
+ "project_id",
1349
+ "id"
1350
+ ],
1351
+ "onDelete": "cascade",
1352
+ "onUpdate": "no action"
1353
+ },
1354
+ "function_tools_function_fk": {
1355
+ "name": "function_tools_function_fk",
1356
+ "tableFrom": "function_tools",
1357
+ "tableTo": "functions",
1358
+ "columnsFrom": [
1359
+ "tenant_id",
1360
+ "project_id",
1361
+ "function_id"
1362
+ ],
1363
+ "columnsTo": [
1364
+ "tenant_id",
1365
+ "project_id",
1366
+ "id"
1367
+ ],
1368
+ "onDelete": "cascade",
1369
+ "onUpdate": "no action"
1370
+ }
1371
+ },
1372
+ "compositePrimaryKeys": {
1373
+ "function_tools_tenant_id_project_id_agent_id_id_pk": {
1374
+ "name": "function_tools_tenant_id_project_id_agent_id_id_pk",
1375
+ "columns": [
1376
+ "tenant_id",
1377
+ "project_id",
1378
+ "agent_id",
1379
+ "id"
1380
+ ]
1381
+ }
1382
+ },
1383
+ "uniqueConstraints": {},
1384
+ "policies": {},
1385
+ "checkConstraints": {},
1386
+ "isRLSEnabled": false
1387
+ },
1388
+ "public.functions": {
1389
+ "name": "functions",
1390
+ "schema": "",
1391
+ "columns": {
1392
+ "tenant_id": {
1393
+ "name": "tenant_id",
1394
+ "type": "varchar(256)",
1395
+ "primaryKey": false,
1396
+ "notNull": true
1397
+ },
1398
+ "id": {
1399
+ "name": "id",
1400
+ "type": "varchar(256)",
1401
+ "primaryKey": false,
1402
+ "notNull": true
1403
+ },
1404
+ "project_id": {
1405
+ "name": "project_id",
1406
+ "type": "varchar(256)",
1407
+ "primaryKey": false,
1408
+ "notNull": true
1409
+ },
1410
+ "input_schema": {
1411
+ "name": "input_schema",
1412
+ "type": "jsonb",
1413
+ "primaryKey": false,
1414
+ "notNull": false
1415
+ },
1416
+ "execute_code": {
1417
+ "name": "execute_code",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": true
1421
+ },
1422
+ "dependencies": {
1423
+ "name": "dependencies",
1424
+ "type": "jsonb",
1425
+ "primaryKey": false,
1426
+ "notNull": false
1427
+ },
1428
+ "created_at": {
1429
+ "name": "created_at",
1430
+ "type": "timestamp",
1431
+ "primaryKey": false,
1432
+ "notNull": true,
1433
+ "default": "now()"
1434
+ },
1435
+ "updated_at": {
1436
+ "name": "updated_at",
1437
+ "type": "timestamp",
1438
+ "primaryKey": false,
1439
+ "notNull": true,
1440
+ "default": "now()"
1441
+ }
1442
+ },
1443
+ "indexes": {},
1444
+ "foreignKeys": {
1445
+ "functions_project_fk": {
1446
+ "name": "functions_project_fk",
1447
+ "tableFrom": "functions",
1448
+ "tableTo": "projects",
1449
+ "columnsFrom": [
1450
+ "tenant_id",
1451
+ "project_id"
1452
+ ],
1453
+ "columnsTo": [
1454
+ "tenant_id",
1455
+ "id"
1456
+ ],
1457
+ "onDelete": "cascade",
1458
+ "onUpdate": "no action"
1459
+ }
1460
+ },
1461
+ "compositePrimaryKeys": {
1462
+ "functions_tenant_id_project_id_id_pk": {
1463
+ "name": "functions_tenant_id_project_id_id_pk",
1464
+ "columns": [
1465
+ "tenant_id",
1466
+ "project_id",
1467
+ "id"
1468
+ ]
1469
+ }
1470
+ },
1471
+ "uniqueConstraints": {},
1472
+ "policies": {},
1473
+ "checkConstraints": {},
1474
+ "isRLSEnabled": false
1475
+ },
1476
+ "public.invitation": {
1477
+ "name": "invitation",
1478
+ "schema": "",
1479
+ "columns": {
1480
+ "id": {
1481
+ "name": "id",
1482
+ "type": "text",
1483
+ "primaryKey": true,
1484
+ "notNull": true
1485
+ },
1486
+ "organization_id": {
1487
+ "name": "organization_id",
1488
+ "type": "text",
1489
+ "primaryKey": false,
1490
+ "notNull": true
1491
+ },
1492
+ "email": {
1493
+ "name": "email",
1494
+ "type": "text",
1495
+ "primaryKey": false,
1496
+ "notNull": true
1497
+ },
1498
+ "role": {
1499
+ "name": "role",
1500
+ "type": "text",
1501
+ "primaryKey": false,
1502
+ "notNull": false
1503
+ },
1504
+ "status": {
1505
+ "name": "status",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "default": "'pending'"
1510
+ },
1511
+ "expires_at": {
1512
+ "name": "expires_at",
1513
+ "type": "timestamp",
1514
+ "primaryKey": false,
1515
+ "notNull": true
1516
+ },
1517
+ "created_at": {
1518
+ "name": "created_at",
1519
+ "type": "timestamp",
1520
+ "primaryKey": false,
1521
+ "notNull": true,
1522
+ "default": "now()"
1523
+ },
1524
+ "inviter_id": {
1525
+ "name": "inviter_id",
1526
+ "type": "text",
1527
+ "primaryKey": false,
1528
+ "notNull": true
1529
+ }
1530
+ },
1531
+ "indexes": {
1532
+ "invitation_organizationId_idx": {
1533
+ "name": "invitation_organizationId_idx",
1534
+ "columns": [
1535
+ {
1536
+ "expression": "organization_id",
1537
+ "isExpression": false,
1538
+ "asc": true,
1539
+ "nulls": "last"
1540
+ }
1541
+ ],
1542
+ "isUnique": false,
1543
+ "concurrently": false,
1544
+ "method": "btree",
1545
+ "with": {}
1546
+ },
1547
+ "invitation_email_idx": {
1548
+ "name": "invitation_email_idx",
1549
+ "columns": [
1550
+ {
1551
+ "expression": "email",
1552
+ "isExpression": false,
1553
+ "asc": true,
1554
+ "nulls": "last"
1555
+ }
1556
+ ],
1557
+ "isUnique": false,
1558
+ "concurrently": false,
1559
+ "method": "btree",
1560
+ "with": {}
1561
+ }
1562
+ },
1563
+ "foreignKeys": {
1564
+ "invitation_organization_id_organization_id_fk": {
1565
+ "name": "invitation_organization_id_organization_id_fk",
1566
+ "tableFrom": "invitation",
1567
+ "tableTo": "organization",
1568
+ "columnsFrom": [
1569
+ "organization_id"
1570
+ ],
1571
+ "columnsTo": [
1572
+ "id"
1573
+ ],
1574
+ "onDelete": "cascade",
1575
+ "onUpdate": "no action"
1576
+ },
1577
+ "invitation_inviter_id_user_id_fk": {
1578
+ "name": "invitation_inviter_id_user_id_fk",
1579
+ "tableFrom": "invitation",
1580
+ "tableTo": "user",
1581
+ "columnsFrom": [
1582
+ "inviter_id"
1583
+ ],
1584
+ "columnsTo": [
1585
+ "id"
1586
+ ],
1587
+ "onDelete": "cascade",
1588
+ "onUpdate": "no action"
1589
+ }
1590
+ },
1591
+ "compositePrimaryKeys": {},
1592
+ "uniqueConstraints": {},
1593
+ "policies": {},
1594
+ "checkConstraints": {},
1595
+ "isRLSEnabled": false
1596
+ },
1597
+ "public.ledger_artifacts": {
1598
+ "name": "ledger_artifacts",
1599
+ "schema": "",
1600
+ "columns": {
1601
+ "tenant_id": {
1602
+ "name": "tenant_id",
1603
+ "type": "varchar(256)",
1604
+ "primaryKey": false,
1605
+ "notNull": true
1606
+ },
1607
+ "id": {
1608
+ "name": "id",
1609
+ "type": "varchar(256)",
1610
+ "primaryKey": false,
1611
+ "notNull": true
1612
+ },
1613
+ "project_id": {
1614
+ "name": "project_id",
1615
+ "type": "varchar(256)",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "task_id": {
1620
+ "name": "task_id",
1621
+ "type": "varchar(256)",
1622
+ "primaryKey": false,
1623
+ "notNull": true
1624
+ },
1625
+ "tool_call_id": {
1626
+ "name": "tool_call_id",
1627
+ "type": "varchar(256)",
1628
+ "primaryKey": false,
1629
+ "notNull": false
1630
+ },
1631
+ "context_id": {
1632
+ "name": "context_id",
1633
+ "type": "varchar(256)",
1634
+ "primaryKey": false,
1635
+ "notNull": true
1636
+ },
1637
+ "type": {
1638
+ "name": "type",
1639
+ "type": "varchar(256)",
1640
+ "primaryKey": false,
1641
+ "notNull": true,
1642
+ "default": "'source'"
1643
+ },
1644
+ "name": {
1645
+ "name": "name",
1646
+ "type": "varchar(256)",
1647
+ "primaryKey": false,
1648
+ "notNull": false
1649
+ },
1650
+ "description": {
1651
+ "name": "description",
1652
+ "type": "text",
1653
+ "primaryKey": false,
1654
+ "notNull": false
1655
+ },
1656
+ "parts": {
1657
+ "name": "parts",
1658
+ "type": "jsonb",
1659
+ "primaryKey": false,
1660
+ "notNull": false
1661
+ },
1662
+ "metadata": {
1663
+ "name": "metadata",
1664
+ "type": "jsonb",
1665
+ "primaryKey": false,
1666
+ "notNull": false
1667
+ },
1668
+ "summary": {
1669
+ "name": "summary",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": false
1673
+ },
1674
+ "mime": {
1675
+ "name": "mime",
1676
+ "type": "jsonb",
1677
+ "primaryKey": false,
1678
+ "notNull": false
1679
+ },
1680
+ "visibility": {
1681
+ "name": "visibility",
1682
+ "type": "varchar(256)",
1683
+ "primaryKey": false,
1684
+ "notNull": false,
1685
+ "default": "'context'"
1686
+ },
1687
+ "allowed_agents": {
1688
+ "name": "allowed_agents",
1689
+ "type": "jsonb",
1690
+ "primaryKey": false,
1691
+ "notNull": false
1692
+ },
1693
+ "derived_from": {
1694
+ "name": "derived_from",
1695
+ "type": "varchar(256)",
1696
+ "primaryKey": false,
1697
+ "notNull": false
1698
+ },
1699
+ "created_at": {
1700
+ "name": "created_at",
1701
+ "type": "timestamp",
1702
+ "primaryKey": false,
1703
+ "notNull": true,
1704
+ "default": "now()"
1705
+ },
1706
+ "updated_at": {
1707
+ "name": "updated_at",
1708
+ "type": "timestamp",
1709
+ "primaryKey": false,
1710
+ "notNull": true,
1711
+ "default": "now()"
1712
+ }
1713
+ },
1714
+ "indexes": {
1715
+ "ledger_artifacts_task_id_idx": {
1716
+ "name": "ledger_artifacts_task_id_idx",
1717
+ "columns": [
1718
+ {
1719
+ "expression": "task_id",
1720
+ "isExpression": false,
1721
+ "asc": true,
1722
+ "nulls": "last"
1723
+ }
1724
+ ],
1725
+ "isUnique": false,
1726
+ "concurrently": false,
1727
+ "method": "btree",
1728
+ "with": {}
1729
+ },
1730
+ "ledger_artifacts_tool_call_id_idx": {
1731
+ "name": "ledger_artifacts_tool_call_id_idx",
1732
+ "columns": [
1733
+ {
1734
+ "expression": "tool_call_id",
1735
+ "isExpression": false,
1736
+ "asc": true,
1737
+ "nulls": "last"
1738
+ }
1739
+ ],
1740
+ "isUnique": false,
1741
+ "concurrently": false,
1742
+ "method": "btree",
1743
+ "with": {}
1744
+ },
1745
+ "ledger_artifacts_context_id_idx": {
1746
+ "name": "ledger_artifacts_context_id_idx",
1747
+ "columns": [
1748
+ {
1749
+ "expression": "context_id",
1750
+ "isExpression": false,
1751
+ "asc": true,
1752
+ "nulls": "last"
1753
+ }
1754
+ ],
1755
+ "isUnique": false,
1756
+ "concurrently": false,
1757
+ "method": "btree",
1758
+ "with": {}
1759
+ }
1760
+ },
1761
+ "foreignKeys": {
1762
+ "ledger_artifacts_project_fk": {
1763
+ "name": "ledger_artifacts_project_fk",
1764
+ "tableFrom": "ledger_artifacts",
1765
+ "tableTo": "projects",
1766
+ "columnsFrom": [
1767
+ "tenant_id",
1768
+ "project_id"
1769
+ ],
1770
+ "columnsTo": [
1771
+ "tenant_id",
1772
+ "id"
1773
+ ],
1774
+ "onDelete": "cascade",
1775
+ "onUpdate": "no action"
1776
+ }
1777
+ },
1778
+ "compositePrimaryKeys": {
1779
+ "ledger_artifacts_tenant_id_project_id_id_task_id_pk": {
1780
+ "name": "ledger_artifacts_tenant_id_project_id_id_task_id_pk",
1781
+ "columns": [
1782
+ "tenant_id",
1783
+ "project_id",
1784
+ "id",
1785
+ "task_id"
1786
+ ]
1787
+ }
1788
+ },
1789
+ "uniqueConstraints": {
1790
+ "ledger_artifacts_task_context_name_unique": {
1791
+ "name": "ledger_artifacts_task_context_name_unique",
1792
+ "nullsNotDistinct": false,
1793
+ "columns": [
1794
+ "task_id",
1795
+ "context_id",
1796
+ "name"
1797
+ ]
1798
+ }
1799
+ },
1800
+ "policies": {},
1801
+ "checkConstraints": {},
1802
+ "isRLSEnabled": false
1803
+ },
1804
+ "public.member": {
1805
+ "name": "member",
1806
+ "schema": "",
1807
+ "columns": {
1808
+ "id": {
1809
+ "name": "id",
1810
+ "type": "text",
1811
+ "primaryKey": true,
1812
+ "notNull": true
1813
+ },
1814
+ "organization_id": {
1815
+ "name": "organization_id",
1816
+ "type": "text",
1817
+ "primaryKey": false,
1818
+ "notNull": true
1819
+ },
1820
+ "user_id": {
1821
+ "name": "user_id",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": true
1825
+ },
1826
+ "role": {
1827
+ "name": "role",
1828
+ "type": "text",
1829
+ "primaryKey": false,
1830
+ "notNull": true,
1831
+ "default": "'member'"
1832
+ },
1833
+ "created_at": {
1834
+ "name": "created_at",
1835
+ "type": "timestamp",
1836
+ "primaryKey": false,
1837
+ "notNull": true
1838
+ }
1839
+ },
1840
+ "indexes": {
1841
+ "member_organizationId_idx": {
1842
+ "name": "member_organizationId_idx",
1843
+ "columns": [
1844
+ {
1845
+ "expression": "organization_id",
1846
+ "isExpression": false,
1847
+ "asc": true,
1848
+ "nulls": "last"
1849
+ }
1850
+ ],
1851
+ "isUnique": false,
1852
+ "concurrently": false,
1853
+ "method": "btree",
1854
+ "with": {}
1855
+ },
1856
+ "member_userId_idx": {
1857
+ "name": "member_userId_idx",
1858
+ "columns": [
1859
+ {
1860
+ "expression": "user_id",
1861
+ "isExpression": false,
1862
+ "asc": true,
1863
+ "nulls": "last"
1864
+ }
1865
+ ],
1866
+ "isUnique": false,
1867
+ "concurrently": false,
1868
+ "method": "btree",
1869
+ "with": {}
1870
+ }
1871
+ },
1872
+ "foreignKeys": {
1873
+ "member_organization_id_organization_id_fk": {
1874
+ "name": "member_organization_id_organization_id_fk",
1875
+ "tableFrom": "member",
1876
+ "tableTo": "organization",
1877
+ "columnsFrom": [
1878
+ "organization_id"
1879
+ ],
1880
+ "columnsTo": [
1881
+ "id"
1882
+ ],
1883
+ "onDelete": "cascade",
1884
+ "onUpdate": "no action"
1885
+ },
1886
+ "member_user_id_user_id_fk": {
1887
+ "name": "member_user_id_user_id_fk",
1888
+ "tableFrom": "member",
1889
+ "tableTo": "user",
1890
+ "columnsFrom": [
1891
+ "user_id"
1892
+ ],
1893
+ "columnsTo": [
1894
+ "id"
1895
+ ],
1896
+ "onDelete": "cascade",
1897
+ "onUpdate": "no action"
1898
+ }
1899
+ },
1900
+ "compositePrimaryKeys": {},
1901
+ "uniqueConstraints": {},
1902
+ "policies": {},
1903
+ "checkConstraints": {},
1904
+ "isRLSEnabled": false
1905
+ },
1906
+ "public.messages": {
1907
+ "name": "messages",
1908
+ "schema": "",
1909
+ "columns": {
1910
+ "tenant_id": {
1911
+ "name": "tenant_id",
1912
+ "type": "varchar(256)",
1913
+ "primaryKey": false,
1914
+ "notNull": true
1915
+ },
1916
+ "id": {
1917
+ "name": "id",
1918
+ "type": "varchar(256)",
1919
+ "primaryKey": false,
1920
+ "notNull": true
1921
+ },
1922
+ "project_id": {
1923
+ "name": "project_id",
1924
+ "type": "varchar(256)",
1925
+ "primaryKey": false,
1926
+ "notNull": true
1927
+ },
1928
+ "conversation_id": {
1929
+ "name": "conversation_id",
1930
+ "type": "varchar(256)",
1931
+ "primaryKey": false,
1932
+ "notNull": true
1933
+ },
1934
+ "role": {
1935
+ "name": "role",
1936
+ "type": "varchar(256)",
1937
+ "primaryKey": false,
1938
+ "notNull": true
1939
+ },
1940
+ "from_sub_agent_id": {
1941
+ "name": "from_sub_agent_id",
1942
+ "type": "varchar(256)",
1943
+ "primaryKey": false,
1944
+ "notNull": false
1945
+ },
1946
+ "to_sub_agent_id": {
1947
+ "name": "to_sub_agent_id",
1948
+ "type": "varchar(256)",
1949
+ "primaryKey": false,
1950
+ "notNull": false
1951
+ },
1952
+ "from_external_sub_agent_id": {
1953
+ "name": "from_external_sub_agent_id",
1954
+ "type": "varchar(256)",
1955
+ "primaryKey": false,
1956
+ "notNull": false
1957
+ },
1958
+ "to_external_sub_agent_id": {
1959
+ "name": "to_external_sub_agent_id",
1960
+ "type": "varchar(256)",
1961
+ "primaryKey": false,
1962
+ "notNull": false
1963
+ },
1964
+ "from_team_agent_id": {
1965
+ "name": "from_team_agent_id",
1966
+ "type": "varchar(256)",
1967
+ "primaryKey": false,
1968
+ "notNull": false
1969
+ },
1970
+ "to_team_agent_id": {
1971
+ "name": "to_team_agent_id",
1972
+ "type": "varchar(256)",
1973
+ "primaryKey": false,
1974
+ "notNull": false
1975
+ },
1976
+ "content": {
1977
+ "name": "content",
1978
+ "type": "jsonb",
1979
+ "primaryKey": false,
1980
+ "notNull": true
1981
+ },
1982
+ "visibility": {
1983
+ "name": "visibility",
1984
+ "type": "varchar(256)",
1985
+ "primaryKey": false,
1986
+ "notNull": true,
1987
+ "default": "'user-facing'"
1988
+ },
1989
+ "message_type": {
1990
+ "name": "message_type",
1991
+ "type": "varchar(256)",
1992
+ "primaryKey": false,
1993
+ "notNull": true,
1994
+ "default": "'chat'"
1995
+ },
1996
+ "task_id": {
1997
+ "name": "task_id",
1998
+ "type": "varchar(256)",
1999
+ "primaryKey": false,
2000
+ "notNull": false
2001
+ },
2002
+ "parent_message_id": {
2003
+ "name": "parent_message_id",
2004
+ "type": "varchar(256)",
2005
+ "primaryKey": false,
2006
+ "notNull": false
2007
+ },
2008
+ "a2a_task_id": {
2009
+ "name": "a2a_task_id",
2010
+ "type": "varchar(256)",
2011
+ "primaryKey": false,
2012
+ "notNull": false
2013
+ },
2014
+ "a2a_session_id": {
2015
+ "name": "a2a_session_id",
2016
+ "type": "varchar(256)",
2017
+ "primaryKey": false,
2018
+ "notNull": false
2019
+ },
2020
+ "metadata": {
2021
+ "name": "metadata",
2022
+ "type": "jsonb",
2023
+ "primaryKey": false,
2024
+ "notNull": false
2025
+ },
2026
+ "created_at": {
2027
+ "name": "created_at",
2028
+ "type": "timestamp",
2029
+ "primaryKey": false,
2030
+ "notNull": true,
2031
+ "default": "now()"
2032
+ },
2033
+ "updated_at": {
2034
+ "name": "updated_at",
2035
+ "type": "timestamp",
2036
+ "primaryKey": false,
2037
+ "notNull": true,
2038
+ "default": "now()"
2039
+ }
2040
+ },
2041
+ "indexes": {},
2042
+ "foreignKeys": {
2043
+ "messages_project_fk": {
2044
+ "name": "messages_project_fk",
2045
+ "tableFrom": "messages",
2046
+ "tableTo": "projects",
2047
+ "columnsFrom": [
2048
+ "tenant_id",
2049
+ "project_id"
2050
+ ],
2051
+ "columnsTo": [
2052
+ "tenant_id",
2053
+ "id"
2054
+ ],
2055
+ "onDelete": "cascade",
2056
+ "onUpdate": "no action"
2057
+ }
2058
+ },
2059
+ "compositePrimaryKeys": {
2060
+ "messages_tenant_id_project_id_id_pk": {
2061
+ "name": "messages_tenant_id_project_id_id_pk",
2062
+ "columns": [
2063
+ "tenant_id",
2064
+ "project_id",
2065
+ "id"
2066
+ ]
2067
+ }
2068
+ },
2069
+ "uniqueConstraints": {},
2070
+ "policies": {},
2071
+ "checkConstraints": {},
2072
+ "isRLSEnabled": false
2073
+ },
2074
+ "public.organization": {
2075
+ "name": "organization",
2076
+ "schema": "",
2077
+ "columns": {
2078
+ "id": {
2079
+ "name": "id",
2080
+ "type": "text",
2081
+ "primaryKey": true,
2082
+ "notNull": true
2083
+ },
2084
+ "name": {
2085
+ "name": "name",
2086
+ "type": "text",
2087
+ "primaryKey": false,
2088
+ "notNull": true
2089
+ },
2090
+ "slug": {
2091
+ "name": "slug",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": true
2095
+ },
2096
+ "logo": {
2097
+ "name": "logo",
2098
+ "type": "text",
2099
+ "primaryKey": false,
2100
+ "notNull": false
2101
+ },
2102
+ "created_at": {
2103
+ "name": "created_at",
2104
+ "type": "timestamp",
2105
+ "primaryKey": false,
2106
+ "notNull": true
2107
+ },
2108
+ "metadata": {
2109
+ "name": "metadata",
2110
+ "type": "text",
2111
+ "primaryKey": false,
2112
+ "notNull": false
2113
+ }
2114
+ },
2115
+ "indexes": {},
2116
+ "foreignKeys": {},
2117
+ "compositePrimaryKeys": {},
2118
+ "uniqueConstraints": {
2119
+ "organization_slug_unique": {
2120
+ "name": "organization_slug_unique",
2121
+ "nullsNotDistinct": false,
2122
+ "columns": [
2123
+ "slug"
2124
+ ]
2125
+ }
2126
+ },
2127
+ "policies": {},
2128
+ "checkConstraints": {},
2129
+ "isRLSEnabled": false
2130
+ },
2131
+ "public.projects": {
2132
+ "name": "projects",
2133
+ "schema": "",
2134
+ "columns": {
2135
+ "tenant_id": {
2136
+ "name": "tenant_id",
2137
+ "type": "varchar(256)",
2138
+ "primaryKey": false,
2139
+ "notNull": true
2140
+ },
2141
+ "id": {
2142
+ "name": "id",
2143
+ "type": "varchar(256)",
2144
+ "primaryKey": false,
2145
+ "notNull": true
2146
+ },
2147
+ "name": {
2148
+ "name": "name",
2149
+ "type": "varchar(256)",
2150
+ "primaryKey": false,
2151
+ "notNull": true
2152
+ },
2153
+ "description": {
2154
+ "name": "description",
2155
+ "type": "text",
2156
+ "primaryKey": false,
2157
+ "notNull": false
2158
+ },
2159
+ "models": {
2160
+ "name": "models",
2161
+ "type": "jsonb",
2162
+ "primaryKey": false,
2163
+ "notNull": false
2164
+ },
2165
+ "stop_when": {
2166
+ "name": "stop_when",
2167
+ "type": "jsonb",
2168
+ "primaryKey": false,
2169
+ "notNull": false
2170
+ },
2171
+ "created_at": {
2172
+ "name": "created_at",
2173
+ "type": "timestamp",
2174
+ "primaryKey": false,
2175
+ "notNull": true,
2176
+ "default": "now()"
2177
+ },
2178
+ "updated_at": {
2179
+ "name": "updated_at",
2180
+ "type": "timestamp",
2181
+ "primaryKey": false,
2182
+ "notNull": true,
2183
+ "default": "now()"
2184
+ }
2185
+ },
2186
+ "indexes": {},
2187
+ "foreignKeys": {
2188
+ "projects_tenant_id_fk": {
2189
+ "name": "projects_tenant_id_fk",
2190
+ "tableFrom": "projects",
2191
+ "tableTo": "organization",
2192
+ "columnsFrom": [
2193
+ "tenant_id"
2194
+ ],
2195
+ "columnsTo": [
2196
+ "id"
2197
+ ],
2198
+ "onDelete": "cascade",
2199
+ "onUpdate": "no action"
2200
+ }
2201
+ },
2202
+ "compositePrimaryKeys": {
2203
+ "projects_tenant_id_id_pk": {
2204
+ "name": "projects_tenant_id_id_pk",
2205
+ "columns": [
2206
+ "tenant_id",
2207
+ "id"
2208
+ ]
2209
+ }
2210
+ },
2211
+ "uniqueConstraints": {},
2212
+ "policies": {},
2213
+ "checkConstraints": {},
2214
+ "isRLSEnabled": false
2215
+ },
2216
+ "public.session": {
2217
+ "name": "session",
2218
+ "schema": "",
2219
+ "columns": {
2220
+ "id": {
2221
+ "name": "id",
2222
+ "type": "text",
2223
+ "primaryKey": true,
2224
+ "notNull": true
2225
+ },
2226
+ "expires_at": {
2227
+ "name": "expires_at",
2228
+ "type": "timestamp",
2229
+ "primaryKey": false,
2230
+ "notNull": true
2231
+ },
2232
+ "token": {
2233
+ "name": "token",
2234
+ "type": "text",
2235
+ "primaryKey": false,
2236
+ "notNull": true
2237
+ },
2238
+ "created_at": {
2239
+ "name": "created_at",
2240
+ "type": "timestamp",
2241
+ "primaryKey": false,
2242
+ "notNull": true,
2243
+ "default": "now()"
2244
+ },
2245
+ "updated_at": {
2246
+ "name": "updated_at",
2247
+ "type": "timestamp",
2248
+ "primaryKey": false,
2249
+ "notNull": true
2250
+ },
2251
+ "ip_address": {
2252
+ "name": "ip_address",
2253
+ "type": "text",
2254
+ "primaryKey": false,
2255
+ "notNull": false
2256
+ },
2257
+ "user_agent": {
2258
+ "name": "user_agent",
2259
+ "type": "text",
2260
+ "primaryKey": false,
2261
+ "notNull": false
2262
+ },
2263
+ "user_id": {
2264
+ "name": "user_id",
2265
+ "type": "text",
2266
+ "primaryKey": false,
2267
+ "notNull": true
2268
+ },
2269
+ "active_organization_id": {
2270
+ "name": "active_organization_id",
2271
+ "type": "text",
2272
+ "primaryKey": false,
2273
+ "notNull": false
2274
+ }
2275
+ },
2276
+ "indexes": {
2277
+ "session_userId_idx": {
2278
+ "name": "session_userId_idx",
2279
+ "columns": [
2280
+ {
2281
+ "expression": "user_id",
2282
+ "isExpression": false,
2283
+ "asc": true,
2284
+ "nulls": "last"
2285
+ }
2286
+ ],
2287
+ "isUnique": false,
2288
+ "concurrently": false,
2289
+ "method": "btree",
2290
+ "with": {}
2291
+ }
2292
+ },
2293
+ "foreignKeys": {
2294
+ "session_user_id_user_id_fk": {
2295
+ "name": "session_user_id_user_id_fk",
2296
+ "tableFrom": "session",
2297
+ "tableTo": "user",
2298
+ "columnsFrom": [
2299
+ "user_id"
2300
+ ],
2301
+ "columnsTo": [
2302
+ "id"
2303
+ ],
2304
+ "onDelete": "cascade",
2305
+ "onUpdate": "no action"
2306
+ }
2307
+ },
2308
+ "compositePrimaryKeys": {},
2309
+ "uniqueConstraints": {
2310
+ "session_token_unique": {
2311
+ "name": "session_token_unique",
2312
+ "nullsNotDistinct": false,
2313
+ "columns": [
2314
+ "token"
2315
+ ]
2316
+ }
2317
+ },
2318
+ "policies": {},
2319
+ "checkConstraints": {},
2320
+ "isRLSEnabled": false
2321
+ },
2322
+ "public.sso_provider": {
2323
+ "name": "sso_provider",
2324
+ "schema": "",
2325
+ "columns": {
2326
+ "id": {
2327
+ "name": "id",
2328
+ "type": "text",
2329
+ "primaryKey": true,
2330
+ "notNull": true
2331
+ },
2332
+ "issuer": {
2333
+ "name": "issuer",
2334
+ "type": "text",
2335
+ "primaryKey": false,
2336
+ "notNull": true
2337
+ },
2338
+ "oidc_config": {
2339
+ "name": "oidc_config",
2340
+ "type": "text",
2341
+ "primaryKey": false,
2342
+ "notNull": false
2343
+ },
2344
+ "saml_config": {
2345
+ "name": "saml_config",
2346
+ "type": "text",
2347
+ "primaryKey": false,
2348
+ "notNull": false
2349
+ },
2350
+ "user_id": {
2351
+ "name": "user_id",
2352
+ "type": "text",
2353
+ "primaryKey": false,
2354
+ "notNull": false
2355
+ },
2356
+ "provider_id": {
2357
+ "name": "provider_id",
2358
+ "type": "text",
2359
+ "primaryKey": false,
2360
+ "notNull": true
2361
+ },
2362
+ "organization_id": {
2363
+ "name": "organization_id",
2364
+ "type": "text",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "domain": {
2369
+ "name": "domain",
2370
+ "type": "text",
2371
+ "primaryKey": false,
2372
+ "notNull": true
2373
+ }
2374
+ },
2375
+ "indexes": {},
2376
+ "foreignKeys": {
2377
+ "sso_provider_user_id_user_id_fk": {
2378
+ "name": "sso_provider_user_id_user_id_fk",
2379
+ "tableFrom": "sso_provider",
2380
+ "tableTo": "user",
2381
+ "columnsFrom": [
2382
+ "user_id"
2383
+ ],
2384
+ "columnsTo": [
2385
+ "id"
2386
+ ],
2387
+ "onDelete": "cascade",
2388
+ "onUpdate": "no action"
2389
+ }
2390
+ },
2391
+ "compositePrimaryKeys": {},
2392
+ "uniqueConstraints": {
2393
+ "sso_provider_provider_id_unique": {
2394
+ "name": "sso_provider_provider_id_unique",
2395
+ "nullsNotDistinct": false,
2396
+ "columns": [
2397
+ "provider_id"
2398
+ ]
2399
+ }
2400
+ },
2401
+ "policies": {},
2402
+ "checkConstraints": {},
2403
+ "isRLSEnabled": false
2404
+ },
2405
+ "public.sub_agent_artifact_components": {
2406
+ "name": "sub_agent_artifact_components",
2407
+ "schema": "",
2408
+ "columns": {
2409
+ "tenant_id": {
2410
+ "name": "tenant_id",
2411
+ "type": "varchar(256)",
2412
+ "primaryKey": false,
2413
+ "notNull": true
2414
+ },
2415
+ "id": {
2416
+ "name": "id",
2417
+ "type": "varchar(256)",
2418
+ "primaryKey": false,
2419
+ "notNull": true
2420
+ },
2421
+ "project_id": {
2422
+ "name": "project_id",
2423
+ "type": "varchar(256)",
2424
+ "primaryKey": false,
2425
+ "notNull": true
2426
+ },
2427
+ "agent_id": {
2428
+ "name": "agent_id",
2429
+ "type": "varchar(256)",
2430
+ "primaryKey": false,
2431
+ "notNull": true
2432
+ },
2433
+ "sub_agent_id": {
2434
+ "name": "sub_agent_id",
2435
+ "type": "varchar(256)",
2436
+ "primaryKey": false,
2437
+ "notNull": true
2438
+ },
2439
+ "artifact_component_id": {
2440
+ "name": "artifact_component_id",
2441
+ "type": "varchar(256)",
2442
+ "primaryKey": false,
2443
+ "notNull": true
2444
+ },
2445
+ "created_at": {
2446
+ "name": "created_at",
2447
+ "type": "timestamp",
2448
+ "primaryKey": false,
2449
+ "notNull": true,
2450
+ "default": "now()"
2451
+ }
2452
+ },
2453
+ "indexes": {},
2454
+ "foreignKeys": {
2455
+ "sub_agent_artifact_components_sub_agent_fk": {
2456
+ "name": "sub_agent_artifact_components_sub_agent_fk",
2457
+ "tableFrom": "sub_agent_artifact_components",
2458
+ "tableTo": "sub_agents",
2459
+ "columnsFrom": [
2460
+ "tenant_id",
2461
+ "project_id",
2462
+ "agent_id",
2463
+ "sub_agent_id"
2464
+ ],
2465
+ "columnsTo": [
2466
+ "tenant_id",
2467
+ "project_id",
2468
+ "agent_id",
2469
+ "id"
2470
+ ],
2471
+ "onDelete": "cascade",
2472
+ "onUpdate": "no action"
2473
+ },
2474
+ "sub_agent_artifact_components_artifact_component_fk": {
2475
+ "name": "sub_agent_artifact_components_artifact_component_fk",
2476
+ "tableFrom": "sub_agent_artifact_components",
2477
+ "tableTo": "artifact_components",
2478
+ "columnsFrom": [
2479
+ "tenant_id",
2480
+ "project_id",
2481
+ "artifact_component_id"
2482
+ ],
2483
+ "columnsTo": [
2484
+ "tenant_id",
2485
+ "project_id",
2486
+ "id"
2487
+ ],
2488
+ "onDelete": "cascade",
2489
+ "onUpdate": "no action"
2490
+ }
2491
+ },
2492
+ "compositePrimaryKeys": {
2493
+ "sub_agent_artifact_components_tenant_id_project_id_agent_id_sub_agent_id_id_pk": {
2494
+ "name": "sub_agent_artifact_components_tenant_id_project_id_agent_id_sub_agent_id_id_pk",
2495
+ "columns": [
2496
+ "tenant_id",
2497
+ "project_id",
2498
+ "agent_id",
2499
+ "sub_agent_id",
2500
+ "id"
2501
+ ]
2502
+ }
2503
+ },
2504
+ "uniqueConstraints": {},
2505
+ "policies": {},
2506
+ "checkConstraints": {},
2507
+ "isRLSEnabled": false
2508
+ },
2509
+ "public.sub_agent_data_components": {
2510
+ "name": "sub_agent_data_components",
2511
+ "schema": "",
2512
+ "columns": {
2513
+ "tenant_id": {
2514
+ "name": "tenant_id",
2515
+ "type": "varchar(256)",
2516
+ "primaryKey": false,
2517
+ "notNull": true
2518
+ },
2519
+ "id": {
2520
+ "name": "id",
2521
+ "type": "varchar(256)",
2522
+ "primaryKey": false,
2523
+ "notNull": true
2524
+ },
2525
+ "project_id": {
2526
+ "name": "project_id",
2527
+ "type": "varchar(256)",
2528
+ "primaryKey": false,
2529
+ "notNull": true
2530
+ },
2531
+ "agent_id": {
2532
+ "name": "agent_id",
2533
+ "type": "varchar(256)",
2534
+ "primaryKey": false,
2535
+ "notNull": true
2536
+ },
2537
+ "sub_agent_id": {
2538
+ "name": "sub_agent_id",
2539
+ "type": "varchar(256)",
2540
+ "primaryKey": false,
2541
+ "notNull": true
2542
+ },
2543
+ "data_component_id": {
2544
+ "name": "data_component_id",
2545
+ "type": "varchar(256)",
2546
+ "primaryKey": false,
2547
+ "notNull": true
2548
+ },
2549
+ "created_at": {
2550
+ "name": "created_at",
2551
+ "type": "timestamp",
2552
+ "primaryKey": false,
2553
+ "notNull": true,
2554
+ "default": "now()"
2555
+ }
2556
+ },
2557
+ "indexes": {},
2558
+ "foreignKeys": {
2559
+ "sub_agent_data_components_sub_agent_fk": {
2560
+ "name": "sub_agent_data_components_sub_agent_fk",
2561
+ "tableFrom": "sub_agent_data_components",
2562
+ "tableTo": "sub_agents",
2563
+ "columnsFrom": [
2564
+ "tenant_id",
2565
+ "project_id",
2566
+ "agent_id",
2567
+ "sub_agent_id"
2568
+ ],
2569
+ "columnsTo": [
2570
+ "tenant_id",
2571
+ "project_id",
2572
+ "agent_id",
2573
+ "id"
2574
+ ],
2575
+ "onDelete": "cascade",
2576
+ "onUpdate": "no action"
2577
+ },
2578
+ "sub_agent_data_components_data_component_fk": {
2579
+ "name": "sub_agent_data_components_data_component_fk",
2580
+ "tableFrom": "sub_agent_data_components",
2581
+ "tableTo": "data_components",
2582
+ "columnsFrom": [
2583
+ "tenant_id",
2584
+ "project_id",
2585
+ "data_component_id"
2586
+ ],
2587
+ "columnsTo": [
2588
+ "tenant_id",
2589
+ "project_id",
2590
+ "id"
2591
+ ],
2592
+ "onDelete": "cascade",
2593
+ "onUpdate": "no action"
2594
+ }
2595
+ },
2596
+ "compositePrimaryKeys": {
2597
+ "sub_agent_data_components_tenant_id_project_id_id_pk": {
2598
+ "name": "sub_agent_data_components_tenant_id_project_id_id_pk",
2599
+ "columns": [
2600
+ "tenant_id",
2601
+ "project_id",
2602
+ "id"
2603
+ ]
2604
+ }
2605
+ },
2606
+ "uniqueConstraints": {},
2607
+ "policies": {},
2608
+ "checkConstraints": {},
2609
+ "isRLSEnabled": false
2610
+ },
2611
+ "public.sub_agent_external_agent_relations": {
2612
+ "name": "sub_agent_external_agent_relations",
2613
+ "schema": "",
2614
+ "columns": {
2615
+ "tenant_id": {
2616
+ "name": "tenant_id",
2617
+ "type": "varchar(256)",
2618
+ "primaryKey": false,
2619
+ "notNull": true
2620
+ },
2621
+ "id": {
2622
+ "name": "id",
2623
+ "type": "varchar(256)",
2624
+ "primaryKey": false,
2625
+ "notNull": true
2626
+ },
2627
+ "project_id": {
2628
+ "name": "project_id",
2629
+ "type": "varchar(256)",
2630
+ "primaryKey": false,
2631
+ "notNull": true
2632
+ },
2633
+ "agent_id": {
2634
+ "name": "agent_id",
2635
+ "type": "varchar(256)",
2636
+ "primaryKey": false,
2637
+ "notNull": true
2638
+ },
2639
+ "sub_agent_id": {
2640
+ "name": "sub_agent_id",
2641
+ "type": "varchar(256)",
2642
+ "primaryKey": false,
2643
+ "notNull": true
2644
+ },
2645
+ "external_agent_id": {
2646
+ "name": "external_agent_id",
2647
+ "type": "varchar(256)",
2648
+ "primaryKey": false,
2649
+ "notNull": true
2650
+ },
2651
+ "headers": {
2652
+ "name": "headers",
2653
+ "type": "jsonb",
2654
+ "primaryKey": false,
2655
+ "notNull": false
2656
+ },
2657
+ "created_at": {
2658
+ "name": "created_at",
2659
+ "type": "timestamp",
2660
+ "primaryKey": false,
2661
+ "notNull": true,
2662
+ "default": "now()"
2663
+ },
2664
+ "updated_at": {
2665
+ "name": "updated_at",
2666
+ "type": "timestamp",
2667
+ "primaryKey": false,
2668
+ "notNull": true,
2669
+ "default": "now()"
2670
+ }
2671
+ },
2672
+ "indexes": {},
2673
+ "foreignKeys": {
2674
+ "sub_agent_external_agent_relations_sub_agent_fk": {
2675
+ "name": "sub_agent_external_agent_relations_sub_agent_fk",
2676
+ "tableFrom": "sub_agent_external_agent_relations",
2677
+ "tableTo": "sub_agents",
2678
+ "columnsFrom": [
2679
+ "tenant_id",
2680
+ "project_id",
2681
+ "agent_id",
2682
+ "sub_agent_id"
2683
+ ],
2684
+ "columnsTo": [
2685
+ "tenant_id",
2686
+ "project_id",
2687
+ "agent_id",
2688
+ "id"
2689
+ ],
2690
+ "onDelete": "cascade",
2691
+ "onUpdate": "no action"
2692
+ },
2693
+ "sub_agent_external_agent_relations_external_agent_fk": {
2694
+ "name": "sub_agent_external_agent_relations_external_agent_fk",
2695
+ "tableFrom": "sub_agent_external_agent_relations",
2696
+ "tableTo": "external_agents",
2697
+ "columnsFrom": [
2698
+ "tenant_id",
2699
+ "project_id",
2700
+ "external_agent_id"
2701
+ ],
2702
+ "columnsTo": [
2703
+ "tenant_id",
2704
+ "project_id",
2705
+ "id"
2706
+ ],
2707
+ "onDelete": "cascade",
2708
+ "onUpdate": "no action"
2709
+ }
2710
+ },
2711
+ "compositePrimaryKeys": {
2712
+ "sub_agent_external_agent_relations_tenant_id_project_id_agent_id_id_pk": {
2713
+ "name": "sub_agent_external_agent_relations_tenant_id_project_id_agent_id_id_pk",
2714
+ "columns": [
2715
+ "tenant_id",
2716
+ "project_id",
2717
+ "agent_id",
2718
+ "id"
2719
+ ]
2720
+ }
2721
+ },
2722
+ "uniqueConstraints": {},
2723
+ "policies": {},
2724
+ "checkConstraints": {},
2725
+ "isRLSEnabled": false
2726
+ },
2727
+ "public.sub_agent_function_tool_relations": {
2728
+ "name": "sub_agent_function_tool_relations",
2729
+ "schema": "",
2730
+ "columns": {
2731
+ "tenant_id": {
2732
+ "name": "tenant_id",
2733
+ "type": "varchar(256)",
2734
+ "primaryKey": false,
2735
+ "notNull": true
2736
+ },
2737
+ "id": {
2738
+ "name": "id",
2739
+ "type": "varchar(256)",
2740
+ "primaryKey": false,
2741
+ "notNull": true
2742
+ },
2743
+ "project_id": {
2744
+ "name": "project_id",
2745
+ "type": "varchar(256)",
2746
+ "primaryKey": false,
2747
+ "notNull": true
2748
+ },
2749
+ "agent_id": {
2750
+ "name": "agent_id",
2751
+ "type": "varchar(256)",
2752
+ "primaryKey": false,
2753
+ "notNull": true
2754
+ },
2755
+ "sub_agent_id": {
2756
+ "name": "sub_agent_id",
2757
+ "type": "varchar(256)",
2758
+ "primaryKey": false,
2759
+ "notNull": true
2760
+ },
2761
+ "function_tool_id": {
2762
+ "name": "function_tool_id",
2763
+ "type": "varchar(256)",
2764
+ "primaryKey": false,
2765
+ "notNull": true
2766
+ },
2767
+ "created_at": {
2768
+ "name": "created_at",
2769
+ "type": "timestamp",
2770
+ "primaryKey": false,
2771
+ "notNull": true,
2772
+ "default": "now()"
2773
+ },
2774
+ "updated_at": {
2775
+ "name": "updated_at",
2776
+ "type": "timestamp",
2777
+ "primaryKey": false,
2778
+ "notNull": true,
2779
+ "default": "now()"
2780
+ }
2781
+ },
2782
+ "indexes": {},
2783
+ "foreignKeys": {
2784
+ "sub_agent_function_tool_relations_sub_agent_fk": {
2785
+ "name": "sub_agent_function_tool_relations_sub_agent_fk",
2786
+ "tableFrom": "sub_agent_function_tool_relations",
2787
+ "tableTo": "sub_agents",
2788
+ "columnsFrom": [
2789
+ "tenant_id",
2790
+ "project_id",
2791
+ "agent_id",
2792
+ "sub_agent_id"
2793
+ ],
2794
+ "columnsTo": [
2795
+ "tenant_id",
2796
+ "project_id",
2797
+ "agent_id",
2798
+ "id"
2799
+ ],
2800
+ "onDelete": "cascade",
2801
+ "onUpdate": "no action"
2802
+ },
2803
+ "sub_agent_function_tool_relations_function_tool_fk": {
2804
+ "name": "sub_agent_function_tool_relations_function_tool_fk",
2805
+ "tableFrom": "sub_agent_function_tool_relations",
2806
+ "tableTo": "function_tools",
2807
+ "columnsFrom": [
2808
+ "tenant_id",
2809
+ "project_id",
2810
+ "agent_id",
2811
+ "function_tool_id"
2812
+ ],
2813
+ "columnsTo": [
2814
+ "tenant_id",
2815
+ "project_id",
2816
+ "agent_id",
2817
+ "id"
2818
+ ],
2819
+ "onDelete": "cascade",
2820
+ "onUpdate": "no action"
2821
+ }
2822
+ },
2823
+ "compositePrimaryKeys": {
2824
+ "sub_agent_function_tool_relations_tenant_id_project_id_agent_id_id_pk": {
2825
+ "name": "sub_agent_function_tool_relations_tenant_id_project_id_agent_id_id_pk",
2826
+ "columns": [
2827
+ "tenant_id",
2828
+ "project_id",
2829
+ "agent_id",
2830
+ "id"
2831
+ ]
2832
+ }
2833
+ },
2834
+ "uniqueConstraints": {},
2835
+ "policies": {},
2836
+ "checkConstraints": {},
2837
+ "isRLSEnabled": false
2838
+ },
2839
+ "public.sub_agent_relations": {
2840
+ "name": "sub_agent_relations",
2841
+ "schema": "",
2842
+ "columns": {
2843
+ "tenant_id": {
2844
+ "name": "tenant_id",
2845
+ "type": "varchar(256)",
2846
+ "primaryKey": false,
2847
+ "notNull": true
2848
+ },
2849
+ "id": {
2850
+ "name": "id",
2851
+ "type": "varchar(256)",
2852
+ "primaryKey": false,
2853
+ "notNull": true
2854
+ },
2855
+ "project_id": {
2856
+ "name": "project_id",
2857
+ "type": "varchar(256)",
2858
+ "primaryKey": false,
2859
+ "notNull": true
2860
+ },
2861
+ "agent_id": {
2862
+ "name": "agent_id",
2863
+ "type": "varchar(256)",
2864
+ "primaryKey": false,
2865
+ "notNull": true
2866
+ },
2867
+ "source_sub_agent_id": {
2868
+ "name": "source_sub_agent_id",
2869
+ "type": "varchar(256)",
2870
+ "primaryKey": false,
2871
+ "notNull": true
2872
+ },
2873
+ "target_sub_agent_id": {
2874
+ "name": "target_sub_agent_id",
2875
+ "type": "varchar(256)",
2876
+ "primaryKey": false,
2877
+ "notNull": false
2878
+ },
2879
+ "relation_type": {
2880
+ "name": "relation_type",
2881
+ "type": "varchar(256)",
2882
+ "primaryKey": false,
2883
+ "notNull": false
2884
+ },
2885
+ "created_at": {
2886
+ "name": "created_at",
2887
+ "type": "timestamp",
2888
+ "primaryKey": false,
2889
+ "notNull": true,
2890
+ "default": "now()"
2891
+ },
2892
+ "updated_at": {
2893
+ "name": "updated_at",
2894
+ "type": "timestamp",
2895
+ "primaryKey": false,
2896
+ "notNull": true,
2897
+ "default": "now()"
2898
+ }
2899
+ },
2900
+ "indexes": {},
2901
+ "foreignKeys": {
2902
+ "sub_agent_relations_agent_fk": {
2903
+ "name": "sub_agent_relations_agent_fk",
2904
+ "tableFrom": "sub_agent_relations",
2905
+ "tableTo": "agent",
2906
+ "columnsFrom": [
2907
+ "tenant_id",
2908
+ "project_id",
2909
+ "agent_id"
2910
+ ],
2911
+ "columnsTo": [
2912
+ "tenant_id",
2913
+ "project_id",
2914
+ "id"
2915
+ ],
2916
+ "onDelete": "cascade",
2917
+ "onUpdate": "no action"
2918
+ }
2919
+ },
2920
+ "compositePrimaryKeys": {
2921
+ "sub_agent_relations_tenant_id_project_id_agent_id_id_pk": {
2922
+ "name": "sub_agent_relations_tenant_id_project_id_agent_id_id_pk",
2923
+ "columns": [
2924
+ "tenant_id",
2925
+ "project_id",
2926
+ "agent_id",
2927
+ "id"
2928
+ ]
2929
+ }
2930
+ },
2931
+ "uniqueConstraints": {},
2932
+ "policies": {},
2933
+ "checkConstraints": {},
2934
+ "isRLSEnabled": false
2935
+ },
2936
+ "public.sub_agent_team_agent_relations": {
2937
+ "name": "sub_agent_team_agent_relations",
2938
+ "schema": "",
2939
+ "columns": {
2940
+ "tenant_id": {
2941
+ "name": "tenant_id",
2942
+ "type": "varchar(256)",
2943
+ "primaryKey": false,
2944
+ "notNull": true
2945
+ },
2946
+ "id": {
2947
+ "name": "id",
2948
+ "type": "varchar(256)",
2949
+ "primaryKey": false,
2950
+ "notNull": true
2951
+ },
2952
+ "project_id": {
2953
+ "name": "project_id",
2954
+ "type": "varchar(256)",
2955
+ "primaryKey": false,
2956
+ "notNull": true
2957
+ },
2958
+ "agent_id": {
2959
+ "name": "agent_id",
2960
+ "type": "varchar(256)",
2961
+ "primaryKey": false,
2962
+ "notNull": true
2963
+ },
2964
+ "sub_agent_id": {
2965
+ "name": "sub_agent_id",
2966
+ "type": "varchar(256)",
2967
+ "primaryKey": false,
2968
+ "notNull": true
2969
+ },
2970
+ "target_agent_id": {
2971
+ "name": "target_agent_id",
2972
+ "type": "varchar(256)",
2973
+ "primaryKey": false,
2974
+ "notNull": true
2975
+ },
2976
+ "headers": {
2977
+ "name": "headers",
2978
+ "type": "jsonb",
2979
+ "primaryKey": false,
2980
+ "notNull": false
2981
+ },
2982
+ "created_at": {
2983
+ "name": "created_at",
2984
+ "type": "timestamp",
2985
+ "primaryKey": false,
2986
+ "notNull": true,
2987
+ "default": "now()"
2988
+ },
2989
+ "updated_at": {
2990
+ "name": "updated_at",
2991
+ "type": "timestamp",
2992
+ "primaryKey": false,
2993
+ "notNull": true,
2994
+ "default": "now()"
2995
+ }
2996
+ },
2997
+ "indexes": {},
2998
+ "foreignKeys": {
2999
+ "sub_agent_team_agent_relations_sub_agent_fk": {
3000
+ "name": "sub_agent_team_agent_relations_sub_agent_fk",
3001
+ "tableFrom": "sub_agent_team_agent_relations",
3002
+ "tableTo": "sub_agents",
3003
+ "columnsFrom": [
3004
+ "tenant_id",
3005
+ "project_id",
3006
+ "agent_id",
3007
+ "sub_agent_id"
3008
+ ],
3009
+ "columnsTo": [
3010
+ "tenant_id",
3011
+ "project_id",
3012
+ "agent_id",
3013
+ "id"
3014
+ ],
3015
+ "onDelete": "cascade",
3016
+ "onUpdate": "no action"
3017
+ },
3018
+ "sub_agent_team_agent_relations_target_agent_fk": {
3019
+ "name": "sub_agent_team_agent_relations_target_agent_fk",
3020
+ "tableFrom": "sub_agent_team_agent_relations",
3021
+ "tableTo": "agent",
3022
+ "columnsFrom": [
3023
+ "tenant_id",
3024
+ "project_id",
3025
+ "target_agent_id"
3026
+ ],
3027
+ "columnsTo": [
3028
+ "tenant_id",
3029
+ "project_id",
3030
+ "id"
3031
+ ],
3032
+ "onDelete": "cascade",
3033
+ "onUpdate": "no action"
3034
+ }
3035
+ },
3036
+ "compositePrimaryKeys": {
3037
+ "sub_agent_team_agent_relations_tenant_id_project_id_agent_id_id_pk": {
3038
+ "name": "sub_agent_team_agent_relations_tenant_id_project_id_agent_id_id_pk",
3039
+ "columns": [
3040
+ "tenant_id",
3041
+ "project_id",
3042
+ "agent_id",
3043
+ "id"
3044
+ ]
3045
+ }
3046
+ },
3047
+ "uniqueConstraints": {},
3048
+ "policies": {},
3049
+ "checkConstraints": {},
3050
+ "isRLSEnabled": false
3051
+ },
3052
+ "public.sub_agent_tool_relations": {
3053
+ "name": "sub_agent_tool_relations",
3054
+ "schema": "",
3055
+ "columns": {
3056
+ "tenant_id": {
3057
+ "name": "tenant_id",
3058
+ "type": "varchar(256)",
3059
+ "primaryKey": false,
3060
+ "notNull": true
3061
+ },
3062
+ "id": {
3063
+ "name": "id",
3064
+ "type": "varchar(256)",
3065
+ "primaryKey": false,
3066
+ "notNull": true
3067
+ },
3068
+ "project_id": {
3069
+ "name": "project_id",
3070
+ "type": "varchar(256)",
3071
+ "primaryKey": false,
3072
+ "notNull": true
3073
+ },
3074
+ "agent_id": {
3075
+ "name": "agent_id",
3076
+ "type": "varchar(256)",
3077
+ "primaryKey": false,
3078
+ "notNull": true
3079
+ },
3080
+ "sub_agent_id": {
3081
+ "name": "sub_agent_id",
3082
+ "type": "varchar(256)",
3083
+ "primaryKey": false,
3084
+ "notNull": true
3085
+ },
3086
+ "tool_id": {
3087
+ "name": "tool_id",
3088
+ "type": "varchar(256)",
3089
+ "primaryKey": false,
3090
+ "notNull": true
3091
+ },
3092
+ "selected_tools": {
3093
+ "name": "selected_tools",
3094
+ "type": "jsonb",
3095
+ "primaryKey": false,
3096
+ "notNull": false
3097
+ },
3098
+ "headers": {
3099
+ "name": "headers",
3100
+ "type": "jsonb",
3101
+ "primaryKey": false,
3102
+ "notNull": false
3103
+ },
3104
+ "tool_policies": {
3105
+ "name": "tool_policies",
3106
+ "type": "jsonb",
3107
+ "primaryKey": false,
3108
+ "notNull": false
3109
+ },
3110
+ "created_at": {
3111
+ "name": "created_at",
3112
+ "type": "timestamp",
3113
+ "primaryKey": false,
3114
+ "notNull": true,
3115
+ "default": "now()"
3116
+ },
3117
+ "updated_at": {
3118
+ "name": "updated_at",
3119
+ "type": "timestamp",
3120
+ "primaryKey": false,
3121
+ "notNull": true,
3122
+ "default": "now()"
3123
+ }
3124
+ },
3125
+ "indexes": {},
3126
+ "foreignKeys": {
3127
+ "sub_agent_tool_relations_agent_fk": {
3128
+ "name": "sub_agent_tool_relations_agent_fk",
3129
+ "tableFrom": "sub_agent_tool_relations",
3130
+ "tableTo": "sub_agents",
3131
+ "columnsFrom": [
3132
+ "tenant_id",
3133
+ "project_id",
3134
+ "agent_id",
3135
+ "sub_agent_id"
3136
+ ],
3137
+ "columnsTo": [
3138
+ "tenant_id",
3139
+ "project_id",
3140
+ "agent_id",
3141
+ "id"
3142
+ ],
3143
+ "onDelete": "cascade",
3144
+ "onUpdate": "no action"
3145
+ },
3146
+ "sub_agent_tool_relations_tool_fk": {
3147
+ "name": "sub_agent_tool_relations_tool_fk",
3148
+ "tableFrom": "sub_agent_tool_relations",
3149
+ "tableTo": "tools",
3150
+ "columnsFrom": [
3151
+ "tenant_id",
3152
+ "project_id",
3153
+ "tool_id"
3154
+ ],
3155
+ "columnsTo": [
3156
+ "tenant_id",
3157
+ "project_id",
3158
+ "id"
3159
+ ],
3160
+ "onDelete": "cascade",
3161
+ "onUpdate": "no action"
3162
+ }
3163
+ },
3164
+ "compositePrimaryKeys": {
3165
+ "sub_agent_tool_relations_tenant_id_project_id_agent_id_id_pk": {
3166
+ "name": "sub_agent_tool_relations_tenant_id_project_id_agent_id_id_pk",
3167
+ "columns": [
3168
+ "tenant_id",
3169
+ "project_id",
3170
+ "agent_id",
3171
+ "id"
3172
+ ]
3173
+ }
3174
+ },
3175
+ "uniqueConstraints": {},
3176
+ "policies": {},
3177
+ "checkConstraints": {},
3178
+ "isRLSEnabled": false
3179
+ },
3180
+ "public.sub_agents": {
3181
+ "name": "sub_agents",
3182
+ "schema": "",
3183
+ "columns": {
3184
+ "tenant_id": {
3185
+ "name": "tenant_id",
3186
+ "type": "varchar(256)",
3187
+ "primaryKey": false,
3188
+ "notNull": true
3189
+ },
3190
+ "id": {
3191
+ "name": "id",
3192
+ "type": "varchar(256)",
3193
+ "primaryKey": false,
3194
+ "notNull": true
3195
+ },
3196
+ "project_id": {
3197
+ "name": "project_id",
3198
+ "type": "varchar(256)",
3199
+ "primaryKey": false,
3200
+ "notNull": true
3201
+ },
3202
+ "agent_id": {
3203
+ "name": "agent_id",
3204
+ "type": "varchar(256)",
3205
+ "primaryKey": false,
3206
+ "notNull": true
3207
+ },
3208
+ "name": {
3209
+ "name": "name",
3210
+ "type": "varchar(256)",
3211
+ "primaryKey": false,
3212
+ "notNull": true
3213
+ },
3214
+ "description": {
3215
+ "name": "description",
3216
+ "type": "text",
3217
+ "primaryKey": false,
3218
+ "notNull": false
3219
+ },
3220
+ "prompt": {
3221
+ "name": "prompt",
3222
+ "type": "text",
3223
+ "primaryKey": false,
3224
+ "notNull": false
3225
+ },
3226
+ "conversation_history_config": {
3227
+ "name": "conversation_history_config",
3228
+ "type": "jsonb",
3229
+ "primaryKey": false,
3230
+ "notNull": false,
3231
+ "default": "'{\"mode\":\"full\",\"limit\":50,\"maxOutputTokens\":4000,\"includeInternal\":false,\"messageTypes\":[\"chat\",\"tool-result\"]}'::jsonb"
3232
+ },
3233
+ "models": {
3234
+ "name": "models",
3235
+ "type": "jsonb",
3236
+ "primaryKey": false,
3237
+ "notNull": false
3238
+ },
3239
+ "stop_when": {
3240
+ "name": "stop_when",
3241
+ "type": "jsonb",
3242
+ "primaryKey": false,
3243
+ "notNull": false
3244
+ },
3245
+ "created_at": {
3246
+ "name": "created_at",
3247
+ "type": "timestamp",
3248
+ "primaryKey": false,
3249
+ "notNull": true,
3250
+ "default": "now()"
3251
+ },
3252
+ "updated_at": {
3253
+ "name": "updated_at",
3254
+ "type": "timestamp",
3255
+ "primaryKey": false,
3256
+ "notNull": true,
3257
+ "default": "now()"
3258
+ }
3259
+ },
3260
+ "indexes": {},
3261
+ "foreignKeys": {
3262
+ "sub_agents_agents_fk": {
3263
+ "name": "sub_agents_agents_fk",
3264
+ "tableFrom": "sub_agents",
3265
+ "tableTo": "agent",
3266
+ "columnsFrom": [
3267
+ "tenant_id",
3268
+ "project_id",
3269
+ "agent_id"
3270
+ ],
3271
+ "columnsTo": [
3272
+ "tenant_id",
3273
+ "project_id",
3274
+ "id"
3275
+ ],
3276
+ "onDelete": "cascade",
3277
+ "onUpdate": "no action"
3278
+ }
3279
+ },
3280
+ "compositePrimaryKeys": {
3281
+ "sub_agents_tenant_id_project_id_agent_id_id_pk": {
3282
+ "name": "sub_agents_tenant_id_project_id_agent_id_id_pk",
3283
+ "columns": [
3284
+ "tenant_id",
3285
+ "project_id",
3286
+ "agent_id",
3287
+ "id"
3288
+ ]
3289
+ }
3290
+ },
3291
+ "uniqueConstraints": {},
3292
+ "policies": {},
3293
+ "checkConstraints": {},
3294
+ "isRLSEnabled": false
3295
+ },
3296
+ "public.task_relations": {
3297
+ "name": "task_relations",
3298
+ "schema": "",
3299
+ "columns": {
3300
+ "tenant_id": {
3301
+ "name": "tenant_id",
3302
+ "type": "varchar(256)",
3303
+ "primaryKey": false,
3304
+ "notNull": true
3305
+ },
3306
+ "id": {
3307
+ "name": "id",
3308
+ "type": "varchar(256)",
3309
+ "primaryKey": false,
3310
+ "notNull": true
3311
+ },
3312
+ "project_id": {
3313
+ "name": "project_id",
3314
+ "type": "varchar(256)",
3315
+ "primaryKey": false,
3316
+ "notNull": true
3317
+ },
3318
+ "parent_task_id": {
3319
+ "name": "parent_task_id",
3320
+ "type": "varchar(256)",
3321
+ "primaryKey": false,
3322
+ "notNull": true
3323
+ },
3324
+ "child_task_id": {
3325
+ "name": "child_task_id",
3326
+ "type": "varchar(256)",
3327
+ "primaryKey": false,
3328
+ "notNull": true
3329
+ },
3330
+ "relation_type": {
3331
+ "name": "relation_type",
3332
+ "type": "varchar(256)",
3333
+ "primaryKey": false,
3334
+ "notNull": false,
3335
+ "default": "'parent_child'"
3336
+ },
3337
+ "created_at": {
3338
+ "name": "created_at",
3339
+ "type": "timestamp",
3340
+ "primaryKey": false,
3341
+ "notNull": true,
3342
+ "default": "now()"
3343
+ },
3344
+ "updated_at": {
3345
+ "name": "updated_at",
3346
+ "type": "timestamp",
3347
+ "primaryKey": false,
3348
+ "notNull": true,
3349
+ "default": "now()"
3350
+ }
3351
+ },
3352
+ "indexes": {},
3353
+ "foreignKeys": {
3354
+ "task_relations_project_fk": {
3355
+ "name": "task_relations_project_fk",
3356
+ "tableFrom": "task_relations",
3357
+ "tableTo": "projects",
3358
+ "columnsFrom": [
3359
+ "tenant_id",
3360
+ "project_id"
3361
+ ],
3362
+ "columnsTo": [
3363
+ "tenant_id",
3364
+ "id"
3365
+ ],
3366
+ "onDelete": "cascade",
3367
+ "onUpdate": "no action"
3368
+ }
3369
+ },
3370
+ "compositePrimaryKeys": {
3371
+ "task_relations_tenant_id_project_id_id_pk": {
3372
+ "name": "task_relations_tenant_id_project_id_id_pk",
3373
+ "columns": [
3374
+ "tenant_id",
3375
+ "project_id",
3376
+ "id"
3377
+ ]
3378
+ }
3379
+ },
3380
+ "uniqueConstraints": {},
3381
+ "policies": {},
3382
+ "checkConstraints": {},
3383
+ "isRLSEnabled": false
3384
+ },
3385
+ "public.tasks": {
3386
+ "name": "tasks",
3387
+ "schema": "",
3388
+ "columns": {
3389
+ "tenant_id": {
3390
+ "name": "tenant_id",
3391
+ "type": "varchar(256)",
3392
+ "primaryKey": false,
3393
+ "notNull": true
3394
+ },
3395
+ "id": {
3396
+ "name": "id",
3397
+ "type": "varchar(256)",
3398
+ "primaryKey": false,
3399
+ "notNull": true
3400
+ },
3401
+ "project_id": {
3402
+ "name": "project_id",
3403
+ "type": "varchar(256)",
3404
+ "primaryKey": false,
3405
+ "notNull": true
3406
+ },
3407
+ "agent_id": {
3408
+ "name": "agent_id",
3409
+ "type": "varchar(256)",
3410
+ "primaryKey": false,
3411
+ "notNull": true
3412
+ },
3413
+ "sub_agent_id": {
3414
+ "name": "sub_agent_id",
3415
+ "type": "varchar(256)",
3416
+ "primaryKey": false,
3417
+ "notNull": true
3418
+ },
3419
+ "context_id": {
3420
+ "name": "context_id",
3421
+ "type": "varchar(256)",
3422
+ "primaryKey": false,
3423
+ "notNull": true
3424
+ },
3425
+ "status": {
3426
+ "name": "status",
3427
+ "type": "varchar(256)",
3428
+ "primaryKey": false,
3429
+ "notNull": true
3430
+ },
3431
+ "metadata": {
3432
+ "name": "metadata",
3433
+ "type": "jsonb",
3434
+ "primaryKey": false,
3435
+ "notNull": false
3436
+ },
3437
+ "created_at": {
3438
+ "name": "created_at",
3439
+ "type": "timestamp",
3440
+ "primaryKey": false,
3441
+ "notNull": true,
3442
+ "default": "now()"
3443
+ },
3444
+ "updated_at": {
3445
+ "name": "updated_at",
3446
+ "type": "timestamp",
3447
+ "primaryKey": false,
3448
+ "notNull": true,
3449
+ "default": "now()"
3450
+ }
3451
+ },
3452
+ "indexes": {},
3453
+ "foreignKeys": {
3454
+ "tasks_sub_agent_fk": {
3455
+ "name": "tasks_sub_agent_fk",
3456
+ "tableFrom": "tasks",
3457
+ "tableTo": "sub_agents",
3458
+ "columnsFrom": [
3459
+ "tenant_id",
3460
+ "project_id",
3461
+ "agent_id",
3462
+ "sub_agent_id"
3463
+ ],
3464
+ "columnsTo": [
3465
+ "tenant_id",
3466
+ "project_id",
3467
+ "agent_id",
3468
+ "id"
3469
+ ],
3470
+ "onDelete": "cascade",
3471
+ "onUpdate": "no action"
3472
+ }
3473
+ },
3474
+ "compositePrimaryKeys": {
3475
+ "tasks_tenant_id_project_id_id_pk": {
3476
+ "name": "tasks_tenant_id_project_id_id_pk",
3477
+ "columns": [
3478
+ "tenant_id",
3479
+ "project_id",
3480
+ "id"
3481
+ ]
3482
+ }
3483
+ },
3484
+ "uniqueConstraints": {},
3485
+ "policies": {},
3486
+ "checkConstraints": {},
3487
+ "isRLSEnabled": false
3488
+ },
3489
+ "public.tools": {
3490
+ "name": "tools",
3491
+ "schema": "",
3492
+ "columns": {
3493
+ "tenant_id": {
3494
+ "name": "tenant_id",
3495
+ "type": "varchar(256)",
3496
+ "primaryKey": false,
3497
+ "notNull": true
3498
+ },
3499
+ "id": {
3500
+ "name": "id",
3501
+ "type": "varchar(256)",
3502
+ "primaryKey": false,
3503
+ "notNull": true
3504
+ },
3505
+ "project_id": {
3506
+ "name": "project_id",
3507
+ "type": "varchar(256)",
3508
+ "primaryKey": false,
3509
+ "notNull": true
3510
+ },
3511
+ "name": {
3512
+ "name": "name",
3513
+ "type": "varchar(256)",
3514
+ "primaryKey": false,
3515
+ "notNull": true
3516
+ },
3517
+ "description": {
3518
+ "name": "description",
3519
+ "type": "text",
3520
+ "primaryKey": false,
3521
+ "notNull": false
3522
+ },
3523
+ "config": {
3524
+ "name": "config",
3525
+ "type": "jsonb",
3526
+ "primaryKey": false,
3527
+ "notNull": true
3528
+ },
3529
+ "credential_reference_id": {
3530
+ "name": "credential_reference_id",
3531
+ "type": "varchar(256)",
3532
+ "primaryKey": false,
3533
+ "notNull": false
3534
+ },
3535
+ "credential_scope": {
3536
+ "name": "credential_scope",
3537
+ "type": "varchar(50)",
3538
+ "primaryKey": false,
3539
+ "notNull": true,
3540
+ "default": "'project'"
3541
+ },
3542
+ "headers": {
3543
+ "name": "headers",
3544
+ "type": "jsonb",
3545
+ "primaryKey": false,
3546
+ "notNull": false
3547
+ },
3548
+ "image_url": {
3549
+ "name": "image_url",
3550
+ "type": "text",
3551
+ "primaryKey": false,
3552
+ "notNull": false
3553
+ },
3554
+ "capabilities": {
3555
+ "name": "capabilities",
3556
+ "type": "jsonb",
3557
+ "primaryKey": false,
3558
+ "notNull": false
3559
+ },
3560
+ "last_error": {
3561
+ "name": "last_error",
3562
+ "type": "text",
3563
+ "primaryKey": false,
3564
+ "notNull": false
3565
+ },
3566
+ "created_at": {
3567
+ "name": "created_at",
3568
+ "type": "timestamp",
3569
+ "primaryKey": false,
3570
+ "notNull": true,
3571
+ "default": "now()"
3572
+ },
3573
+ "updated_at": {
3574
+ "name": "updated_at",
3575
+ "type": "timestamp",
3576
+ "primaryKey": false,
3577
+ "notNull": true,
3578
+ "default": "now()"
3579
+ }
3580
+ },
3581
+ "indexes": {},
3582
+ "foreignKeys": {
3583
+ "tools_project_fk": {
3584
+ "name": "tools_project_fk",
3585
+ "tableFrom": "tools",
3586
+ "tableTo": "projects",
3587
+ "columnsFrom": [
3588
+ "tenant_id",
3589
+ "project_id"
3590
+ ],
3591
+ "columnsTo": [
3592
+ "tenant_id",
3593
+ "id"
3594
+ ],
3595
+ "onDelete": "cascade",
3596
+ "onUpdate": "no action"
3597
+ },
3598
+ "tools_credential_reference_fk": {
3599
+ "name": "tools_credential_reference_fk",
3600
+ "tableFrom": "tools",
3601
+ "tableTo": "credential_references",
3602
+ "columnsFrom": [
3603
+ "credential_reference_id"
3604
+ ],
3605
+ "columnsTo": [
3606
+ "id"
3607
+ ],
3608
+ "onDelete": "set null",
3609
+ "onUpdate": "no action"
3610
+ }
3611
+ },
3612
+ "compositePrimaryKeys": {
3613
+ "tools_tenant_id_project_id_id_pk": {
3614
+ "name": "tools_tenant_id_project_id_id_pk",
3615
+ "columns": [
3616
+ "tenant_id",
3617
+ "project_id",
3618
+ "id"
3619
+ ]
3620
+ }
3621
+ },
3622
+ "uniqueConstraints": {},
3623
+ "policies": {},
3624
+ "checkConstraints": {},
3625
+ "isRLSEnabled": false
3626
+ },
3627
+ "public.user": {
3628
+ "name": "user",
3629
+ "schema": "",
3630
+ "columns": {
3631
+ "id": {
3632
+ "name": "id",
3633
+ "type": "text",
3634
+ "primaryKey": true,
3635
+ "notNull": true
3636
+ },
3637
+ "name": {
3638
+ "name": "name",
3639
+ "type": "text",
3640
+ "primaryKey": false,
3641
+ "notNull": true
3642
+ },
3643
+ "email": {
3644
+ "name": "email",
3645
+ "type": "text",
3646
+ "primaryKey": false,
3647
+ "notNull": true
3648
+ },
3649
+ "email_verified": {
3650
+ "name": "email_verified",
3651
+ "type": "boolean",
3652
+ "primaryKey": false,
3653
+ "notNull": true,
3654
+ "default": false
3655
+ },
3656
+ "image": {
3657
+ "name": "image",
3658
+ "type": "text",
3659
+ "primaryKey": false,
3660
+ "notNull": false
3661
+ },
3662
+ "created_at": {
3663
+ "name": "created_at",
3664
+ "type": "timestamp",
3665
+ "primaryKey": false,
3666
+ "notNull": true,
3667
+ "default": "now()"
3668
+ },
3669
+ "updated_at": {
3670
+ "name": "updated_at",
3671
+ "type": "timestamp",
3672
+ "primaryKey": false,
3673
+ "notNull": true,
3674
+ "default": "now()"
3675
+ }
3676
+ },
3677
+ "indexes": {},
3678
+ "foreignKeys": {},
3679
+ "compositePrimaryKeys": {},
3680
+ "uniqueConstraints": {
3681
+ "user_email_unique": {
3682
+ "name": "user_email_unique",
3683
+ "nullsNotDistinct": false,
3684
+ "columns": [
3685
+ "email"
3686
+ ]
3687
+ }
3688
+ },
3689
+ "policies": {},
3690
+ "checkConstraints": {},
3691
+ "isRLSEnabled": false
3692
+ },
3693
+ "public.verification": {
3694
+ "name": "verification",
3695
+ "schema": "",
3696
+ "columns": {
3697
+ "id": {
3698
+ "name": "id",
3699
+ "type": "text",
3700
+ "primaryKey": true,
3701
+ "notNull": true
3702
+ },
3703
+ "identifier": {
3704
+ "name": "identifier",
3705
+ "type": "text",
3706
+ "primaryKey": false,
3707
+ "notNull": true
3708
+ },
3709
+ "value": {
3710
+ "name": "value",
3711
+ "type": "text",
3712
+ "primaryKey": false,
3713
+ "notNull": true
3714
+ },
3715
+ "expires_at": {
3716
+ "name": "expires_at",
3717
+ "type": "timestamp",
3718
+ "primaryKey": false,
3719
+ "notNull": true
3720
+ },
3721
+ "created_at": {
3722
+ "name": "created_at",
3723
+ "type": "timestamp",
3724
+ "primaryKey": false,
3725
+ "notNull": true,
3726
+ "default": "now()"
3727
+ },
3728
+ "updated_at": {
3729
+ "name": "updated_at",
3730
+ "type": "timestamp",
3731
+ "primaryKey": false,
3732
+ "notNull": true,
3733
+ "default": "now()"
3734
+ }
3735
+ },
3736
+ "indexes": {
3737
+ "verification_identifier_idx": {
3738
+ "name": "verification_identifier_idx",
3739
+ "columns": [
3740
+ {
3741
+ "expression": "identifier",
3742
+ "isExpression": false,
3743
+ "asc": true,
3744
+ "nulls": "last"
3745
+ }
3746
+ ],
3747
+ "isUnique": false,
3748
+ "concurrently": false,
3749
+ "method": "btree",
3750
+ "with": {}
3751
+ }
3752
+ },
3753
+ "foreignKeys": {},
3754
+ "compositePrimaryKeys": {},
3755
+ "uniqueConstraints": {},
3756
+ "policies": {},
3757
+ "checkConstraints": {},
3758
+ "isRLSEnabled": false
3759
+ }
3760
+ },
3761
+ "enums": {},
3762
+ "schemas": {},
3763
+ "sequences": {},
3764
+ "roles": {},
3765
+ "policies": {},
3766
+ "views": {},
3767
+ "_meta": {
3768
+ "columns": {},
3769
+ "schemas": {},
3770
+ "tables": {}
3771
+ }
3772
+ }