@intx/db 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/README.md +13 -2
  2. package/dist/approval-store.d.ts +59 -0
  3. package/dist/approval-store.js +92 -0
  4. package/dist/asset-resolution.d.ts +2 -2
  5. package/dist/backfill-principal-keys.d.ts +9 -0
  6. package/dist/backfill-principal-keys.js +51 -0
  7. package/dist/client.d.ts +37 -2
  8. package/dist/client.js +6 -0
  9. package/dist/config.d.ts +1 -0
  10. package/dist/config.js +2 -0
  11. package/dist/connection.js +12 -8
  12. package/dist/credential-resolution.d.ts +181 -20
  13. package/dist/credential-resolution.js +251 -3
  14. package/dist/grant-store.js +35 -13
  15. package/dist/index.d.ts +20 -5
  16. package/dist/index.js +19 -5
  17. package/dist/model-source-resolution.d.ts +54 -7
  18. package/dist/model-source-resolution.js +177 -22
  19. package/dist/parse-row.d.ts +245 -34
  20. package/dist/parse-row.js +117 -18
  21. package/dist/principal-key-store.d.ts +51 -0
  22. package/dist/principal-key-store.js +82 -0
  23. package/dist/principal-store.d.ts +44 -0
  24. package/dist/principal-store.js +67 -0
  25. package/dist/rekey-credential-secrets.d.ts +13 -0
  26. package/dist/rekey-credential-secrets.js +61 -0
  27. package/dist/schema/approvals.d.ts +245 -0
  28. package/dist/schema/approvals.js +57 -0
  29. package/dist/schema/catalog.d.ts +17 -0
  30. package/dist/schema/catalog.js +7 -1
  31. package/dist/schema/credentials.d.ts +1 -1
  32. package/dist/schema/git-tokens.js +1 -1
  33. package/dist/schema/grants.js +8 -2
  34. package/dist/schema/index.d.ts +10 -4
  35. package/dist/schema/index.js +10 -4
  36. package/dist/schema/messages.d.ts +5 -5
  37. package/dist/schema/messages.js +20 -9
  38. package/dist/schema/offerings.js +8 -2
  39. package/dist/schema/{workflow-deployments.d.ts → principal-keys.d.ts} +29 -32
  40. package/dist/schema/principal-keys.js +28 -0
  41. package/dist/schema/principals.d.ts +2 -2
  42. package/dist/schema/principals.js +7 -5
  43. package/dist/schema/providers.d.ts +17 -0
  44. package/dist/schema/providers.js +5 -0
  45. package/dist/schema/roles.js +6 -2
  46. package/dist/schema/session-assets.d.ts +1 -38
  47. package/dist/schema/session-assets.js +36 -19
  48. package/dist/schema/sessions.js +7 -2
  49. package/dist/schema/sidecar-allocation.d.ts +385 -0
  50. package/dist/schema/sidecar-allocation.js +53 -0
  51. package/dist/schema/sidecar.d.ts +2 -2
  52. package/dist/schema/sidecar.js +3 -1
  53. package/dist/schema/signal-correlations.d.ts +177 -0
  54. package/dist/schema/signal-correlations.js +31 -0
  55. package/dist/schema/tenants.js +13 -3
  56. package/dist/schema/wallets.d.ts +3 -3
  57. package/dist/schema/wallets.js +4 -2
  58. package/dist/schema/{agents.d.ts → workflow-definitions.d.ts} +79 -113
  59. package/dist/schema/workflow-definitions.js +97 -0
  60. package/dist/schema/workflow-probe.d.ts +358 -0
  61. package/dist/schema/workflow-probe.js +51 -0
  62. package/dist/schema/workflow-run-dispatch.d.ts +345 -0
  63. package/dist/schema/workflow-run-dispatch.js +63 -0
  64. package/dist/schema/{agent-assets.d.ts → workflow-run-execution.d.ts} +44 -27
  65. package/dist/schema/workflow-run-execution.js +48 -0
  66. package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
  67. package/dist/schema/workflow-run-launch-spec.js +26 -0
  68. package/dist/schema/{instances.d.ts → workflow-run.d.ts} +61 -66
  69. package/dist/schema/workflow-run.js +110 -0
  70. package/dist/sender-key-resolver.d.ts +91 -0
  71. package/dist/sender-key-resolver.js +184 -0
  72. package/dist/sidecar-allocation-store.d.ts +206 -0
  73. package/dist/sidecar-allocation-store.js +714 -0
  74. package/dist/signal-correlation-store.d.ts +36 -0
  75. package/dist/signal-correlation-store.js +63 -0
  76. package/dist/signer-identity.d.ts +12 -0
  77. package/dist/signer-identity.js +15 -0
  78. package/dist/tenant-hierarchy.d.ts +4 -1
  79. package/dist/tenant-hierarchy.js +37 -5
  80. package/dist/workflow-definition-store.d.ts +55 -0
  81. package/dist/workflow-definition-store.js +93 -0
  82. package/dist/workflow-probe-store.d.ts +47 -0
  83. package/dist/workflow-probe-store.js +124 -0
  84. package/dist/workflow-run-dispatch-store.d.ts +83 -0
  85. package/dist/workflow-run-dispatch-store.js +308 -0
  86. package/dist/workflow-run-launch-spec-store.d.ts +13 -0
  87. package/dist/workflow-run-launch-spec-store.js +30 -0
  88. package/dist/workflow-run-store.d.ts +54 -0
  89. package/dist/workflow-run-store.js +85 -0
  90. package/migrations/0037_credential_use_backfill.sql +39 -0
  91. package/migrations/0038_chilly_blacklash.sql +37 -0
  92. package/migrations/0039_quick_carnage.sql +2 -0
  93. package/migrations/0040_reshape_approval_origin.sql +24 -0
  94. package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
  95. package/migrations/0042_youthful_mantis.sql +2 -0
  96. package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
  97. package/migrations/0044_model_offering_quirks.sql +1 -0
  98. package/migrations/0045_create_workflow_run.sql +13 -0
  99. package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
  100. package/migrations/0047_create_workflow_definition.sql +30 -0
  101. package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
  102. package/migrations/0049_curly_omega_flight.sql +2 -0
  103. package/migrations/0050_late_crystal.sql +10 -0
  104. package/migrations/0051_funny_madelyne_pryor.sql +1 -0
  105. package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
  106. package/migrations/0053_session_mail_session_id_index.sql +1 -0
  107. package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
  108. package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
  109. package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
  110. package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
  111. package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
  112. package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
  113. package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
  114. package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
  115. package/migrations/0062_drop_agent_asset_table.sql +11 -0
  116. package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
  117. package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
  118. package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
  119. package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
  120. package/migrations/0067_add_workflow_definition_kind.sql +10 -0
  121. package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
  122. package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
  123. package/migrations/0070_flashy_proteus.sql +13 -0
  124. package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
  125. package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
  126. package/migrations/0074_add_provider_api_base_url.sql +1 -0
  127. package/migrations/0075_workflow_run_launch_spec.sql +17 -0
  128. package/migrations/0076_sidecar_allocation.sql +40 -0
  129. package/migrations/0077_workflow_run_dispatch.sql +29 -0
  130. package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
  131. package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
  132. package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
  133. package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
  134. package/migrations/0082_blue_black_queen.sql +1 -0
  135. package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
  136. package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
  137. package/migrations/0085_add_approval_run_idx.sql +1 -0
  138. package/migrations/0086_cool_human_cannonball.sql +1 -0
  139. package/migrations/0087_drop_sidecar_placement.sql +3 -0
  140. package/migrations/0088_thick_sprite.sql +32 -0
  141. package/migrations/0089_tense_selene.sql +13 -0
  142. package/migrations/0090_tenant_domain_lower_unique.sql +2 -0
  143. package/migrations/0091_workflow_run_dispatch_sender_address.sql +21 -0
  144. package/migrations/0092_sidecar_destroy_failed.sql +4 -0
  145. package/migrations/0093_sidecar_initialization.sql +2 -0
  146. package/migrations/meta/0037_snapshot.json +3237 -0
  147. package/migrations/meta/0038_snapshot.json +3470 -0
  148. package/migrations/meta/0039_snapshot.json +3470 -0
  149. package/migrations/meta/0040_snapshot.json +3489 -0
  150. package/migrations/meta/0041_snapshot.json +3489 -0
  151. package/migrations/meta/0042_snapshot.json +3489 -0
  152. package/migrations/meta/0043_snapshot.json +3498 -0
  153. package/migrations/meta/0044_snapshot.json +3504 -0
  154. package/migrations/meta/0045_snapshot.json +3589 -0
  155. package/migrations/meta/0046_snapshot.json +3607 -0
  156. package/migrations/meta/0047_snapshot.json +3832 -0
  157. package/migrations/meta/0048_snapshot.json +3853 -0
  158. package/migrations/meta/0049_snapshot.json +3854 -0
  159. package/migrations/meta/0050_snapshot.json +3924 -0
  160. package/migrations/meta/0051_snapshot.json +3940 -0
  161. package/migrations/meta/0052_snapshot.json +3931 -0
  162. package/migrations/meta/0053_snapshot.json +3952 -0
  163. package/migrations/meta/0054_snapshot.json +3952 -0
  164. package/migrations/meta/0055_snapshot.json +3952 -0
  165. package/migrations/meta/0056_snapshot.json +3952 -0
  166. package/migrations/meta/0057_snapshot.json +3839 -0
  167. package/migrations/meta/0058_snapshot.json +3839 -0
  168. package/migrations/meta/0059_snapshot.json +3839 -0
  169. package/migrations/meta/0060_snapshot.json +3830 -0
  170. package/migrations/meta/0061_snapshot.json +3821 -0
  171. package/migrations/meta/0062_snapshot.json +3723 -0
  172. package/migrations/meta/0063_snapshot.json +3723 -0
  173. package/migrations/meta/0064_snapshot.json +3723 -0
  174. package/migrations/meta/0065_snapshot.json +3729 -0
  175. package/migrations/meta/0066_snapshot.json +3729 -0
  176. package/migrations/meta/0067_snapshot.json +3736 -0
  177. package/migrations/meta/0068_snapshot.json +3347 -0
  178. package/migrations/meta/0069_snapshot.json +3340 -0
  179. package/migrations/meta/0070_snapshot.json +3444 -0
  180. package/migrations/meta/0072_snapshot.json +3450 -0
  181. package/migrations/meta/0073_snapshot.json +3455 -0
  182. package/migrations/meta/0074_snapshot.json +3461 -0
  183. package/migrations/meta/0075_snapshot.json +3567 -0
  184. package/migrations/meta/0076_snapshot.json +3851 -0
  185. package/migrations/meta/0077_snapshot.json +4067 -0
  186. package/migrations/meta/0078_snapshot.json +4078 -0
  187. package/migrations/meta/0079_snapshot.json +4078 -0
  188. package/migrations/meta/0080_snapshot.json +4078 -0
  189. package/migrations/meta/0081_snapshot.json +4096 -0
  190. package/migrations/meta/0082_snapshot.json +4102 -0
  191. package/migrations/meta/0083_snapshot.json +4096 -0
  192. package/migrations/meta/0084_snapshot.json +4096 -0
  193. package/migrations/meta/0085_snapshot.json +4111 -0
  194. package/migrations/meta/0086_snapshot.json +4117 -0
  195. package/migrations/meta/0087_snapshot.json +4100 -0
  196. package/migrations/meta/0088_snapshot.json +4286 -0
  197. package/migrations/meta/0089_snapshot.json +4376 -0
  198. package/migrations/meta/0090_snapshot.json +4387 -0
  199. package/migrations/meta/0091_snapshot.json +4397 -0
  200. package/migrations/meta/0092_snapshot.json +4397 -0
  201. package/migrations/meta/0093_snapshot.json +4407 -0
  202. package/migrations/meta/_journal.json +392 -0
  203. package/package.json +7 -3
  204. package/dist/schema/agent-assets.js +0 -15
  205. package/dist/schema/agents.js +0 -57
  206. package/dist/schema/instances.js +0 -39
  207. package/dist/schema/workflow-deployments.js +0 -37
@@ -260,6 +260,398 @@
260
260
  "when": 1783998502613,
261
261
  "tag": "0036_sharp_the_executioner",
262
262
  "breakpoints": true
263
+ },
264
+ {
265
+ "idx": 37,
266
+ "version": "7",
267
+ "when": 1784193583232,
268
+ "tag": "0037_credential_use_backfill",
269
+ "breakpoints": true
270
+ },
271
+ {
272
+ "idx": 38,
273
+ "version": "7",
274
+ "when": 1784229989017,
275
+ "tag": "0038_chilly_blacklash",
276
+ "breakpoints": true
277
+ },
278
+ {
279
+ "idx": 39,
280
+ "version": "7",
281
+ "when": 1784262044343,
282
+ "tag": "0039_quick_carnage",
283
+ "breakpoints": true
284
+ },
285
+ {
286
+ "idx": 40,
287
+ "version": "7",
288
+ "when": 1784290369159,
289
+ "tag": "0040_reshape_approval_origin",
290
+ "breakpoints": true
291
+ },
292
+ {
293
+ "idx": 41,
294
+ "version": "7",
295
+ "when": 1784291992954,
296
+ "tag": "0041_make_approval_timeout_at_nullable",
297
+ "breakpoints": true
298
+ },
299
+ {
300
+ "idx": 42,
301
+ "version": "7",
302
+ "when": 1784385053475,
303
+ "tag": "0042_youthful_mantis",
304
+ "breakpoints": true
305
+ },
306
+ {
307
+ "idx": 43,
308
+ "version": "7",
309
+ "when": 1784574028729,
310
+ "tag": "0043_signal_correlation_deployment_fk",
311
+ "breakpoints": true
312
+ },
313
+ {
314
+ "idx": 44,
315
+ "version": "7",
316
+ "when": 1784647908094,
317
+ "tag": "0044_model_offering_quirks",
318
+ "breakpoints": true
319
+ },
320
+ {
321
+ "idx": 45,
322
+ "version": "7",
323
+ "when": 1784683821134,
324
+ "tag": "0045_create_workflow_run",
325
+ "breakpoints": true
326
+ },
327
+ {
328
+ "idx": 46,
329
+ "version": "7",
330
+ "when": 1784685004809,
331
+ "tag": "0046_approval_signal_correlation_run_fk",
332
+ "breakpoints": true
333
+ },
334
+ {
335
+ "idx": 47,
336
+ "version": "7",
337
+ "when": 1784837465838,
338
+ "tag": "0047_create_workflow_definition",
339
+ "breakpoints": true
340
+ },
341
+ {
342
+ "idx": 48,
343
+ "version": "7",
344
+ "when": 1784843439588,
345
+ "tag": "0048_workflow_definition_origin_agent_id",
346
+ "breakpoints": true
347
+ },
348
+ {
349
+ "idx": 49,
350
+ "version": "7",
351
+ "when": 1784874344480,
352
+ "tag": "0049_curly_omega_flight",
353
+ "breakpoints": true
354
+ },
355
+ {
356
+ "idx": 50,
357
+ "version": "7",
358
+ "when": 1784900369564,
359
+ "tag": "0050_late_crystal",
360
+ "breakpoints": true
361
+ },
362
+ {
363
+ "idx": 51,
364
+ "version": "7",
365
+ "when": 1784904262816,
366
+ "tag": "0051_funny_madelyne_pryor",
367
+ "breakpoints": true
368
+ },
369
+ {
370
+ "idx": 52,
371
+ "version": "7",
372
+ "when": 1784930942498,
373
+ "tag": "0052_drop_inference_turn_instance_fk",
374
+ "breakpoints": true
375
+ },
376
+ {
377
+ "idx": 53,
378
+ "version": "7",
379
+ "when": 1784937859340,
380
+ "tag": "0053_session_mail_session_id_index",
381
+ "breakpoints": true
382
+ },
383
+ {
384
+ "idx": 54,
385
+ "version": "7",
386
+ "when": 1784954863099,
387
+ "tag": "0054_rekey_instance_grants_to_workflow_run",
388
+ "breakpoints": true
389
+ },
390
+ {
391
+ "idx": 55,
392
+ "version": "7",
393
+ "when": 1785022747684,
394
+ "tag": "0055_backfill_anchor_workflow_runs",
395
+ "breakpoints": true
396
+ },
397
+ {
398
+ "idx": 56,
399
+ "version": "7",
400
+ "when": 1785077765166,
401
+ "tag": "0056_repoint_deployment_fks_to_anchor_run",
402
+ "breakpoints": true
403
+ },
404
+ {
405
+ "idx": 57,
406
+ "version": "7",
407
+ "when": 1785081029417,
408
+ "tag": "0057_drop_workflow_deployment_projection",
409
+ "breakpoints": true
410
+ },
411
+ {
412
+ "idx": 58,
413
+ "version": "7",
414
+ "when": 1785085643398,
415
+ "tag": "0058_repoint_offering_fk_to_definition",
416
+ "breakpoints": true
417
+ },
418
+ {
419
+ "idx": 59,
420
+ "version": "7",
421
+ "when": 1785087256544,
422
+ "tag": "0059_repoint_transaction_fk_to_run",
423
+ "breakpoints": true
424
+ },
425
+ {
426
+ "idx": 60,
427
+ "version": "7",
428
+ "when": 1785089581427,
429
+ "tag": "0060_drop_session_mail_instance_fk",
430
+ "breakpoints": true
431
+ },
432
+ {
433
+ "idx": 61,
434
+ "version": "7",
435
+ "when": 1785089702623,
436
+ "tag": "0061_drop_session_asset_instance_fk",
437
+ "breakpoints": true
438
+ },
439
+ {
440
+ "idx": 62,
441
+ "version": "7",
442
+ "when": 1785165557463,
443
+ "tag": "0062_drop_agent_asset_table",
444
+ "breakpoints": true
445
+ },
446
+ {
447
+ "idx": 63,
448
+ "version": "7",
449
+ "when": 1785167954461,
450
+ "tag": "0063_repoint_agent_role_fk_to_definition",
451
+ "breakpoints": true
452
+ },
453
+ {
454
+ "idx": 64,
455
+ "version": "7",
456
+ "when": 1785169484868,
457
+ "tag": "0064_repoint_agent_session_fk_to_definition",
458
+ "breakpoints": true
459
+ },
460
+ {
461
+ "idx": 65,
462
+ "version": "7",
463
+ "when": 1785179839765,
464
+ "tag": "0065_add_workflow_definition_model_requirements",
465
+ "breakpoints": true
466
+ },
467
+ {
468
+ "idx": 66,
469
+ "version": "7",
470
+ "when": 1785280000000,
471
+ "tag": "0066_rekey_agent_definition_principals_to_workflow",
472
+ "breakpoints": true
473
+ },
474
+ {
475
+ "idx": 67,
476
+ "version": "7",
477
+ "when": 1785400000000,
478
+ "tag": "0067_add_workflow_definition_kind",
479
+ "breakpoints": true
480
+ },
481
+ {
482
+ "idx": 68,
483
+ "version": "7",
484
+ "when": 1785500000000,
485
+ "tag": "0068_drop_agent_tables_and_origin_agent_id",
486
+ "breakpoints": true
487
+ },
488
+ {
489
+ "idx": 69,
490
+ "version": "7",
491
+ "when": 1785337102704,
492
+ "tag": "0069_drop_workflow_definition_kind",
493
+ "breakpoints": true
494
+ },
495
+ {
496
+ "idx": 70,
497
+ "version": "7",
498
+ "when": 1785519721882,
499
+ "tag": "0070_flashy_proteus",
500
+ "breakpoints": true
501
+ },
502
+ {
503
+ "idx": 72,
504
+ "version": "7",
505
+ "when": 1785788422511,
506
+ "tag": "0072_add_workflow_definition_credential_bindings",
507
+ "breakpoints": true
508
+ },
509
+ {
510
+ "idx": 73,
511
+ "version": "7",
512
+ "when": 1785791424774,
513
+ "tag": "0073_grant_target_exactly_one_check",
514
+ "breakpoints": true
515
+ },
516
+ {
517
+ "idx": 74,
518
+ "version": "7",
519
+ "when": 1785884353793,
520
+ "tag": "0074_add_provider_api_base_url",
521
+ "breakpoints": true
522
+ },
523
+ {
524
+ "idx": 75,
525
+ "version": "7",
526
+ "when": 1786055554289,
527
+ "tag": "0075_workflow_run_launch_spec",
528
+ "breakpoints": true
529
+ },
530
+ {
531
+ "idx": 76,
532
+ "version": "7",
533
+ "when": 1786055582673,
534
+ "tag": "0076_sidecar_allocation",
535
+ "breakpoints": true
536
+ },
537
+ {
538
+ "idx": 77,
539
+ "version": "7",
540
+ "when": 1786055601046,
541
+ "tag": "0077_workflow_run_dispatch",
542
+ "breakpoints": true
543
+ },
544
+ {
545
+ "idx": 78,
546
+ "version": "7",
547
+ "when": 1786055642946,
548
+ "tag": "0078_workflow_run_dispatch_kind",
549
+ "breakpoints": true
550
+ },
551
+ {
552
+ "idx": 79,
553
+ "version": "7",
554
+ "when": 1786480852752,
555
+ "tag": "0079_rename_workflow_run_deployment_id_to_anchor_run_id",
556
+ "breakpoints": true
557
+ },
558
+ {
559
+ "idx": 80,
560
+ "version": "7",
561
+ "when": 1786481000000,
562
+ "tag": "0080_rename_correlation_approval_deployment_id_to_anchor_run_id",
563
+ "breakpoints": true
564
+ },
565
+ {
566
+ "idx": 81,
567
+ "version": "7",
568
+ "when": 1786665226312,
569
+ "tag": "0081_workflow_definition_content_hash_and_approved_wire_hash",
570
+ "breakpoints": true
571
+ },
572
+ {
573
+ "idx": 82,
574
+ "version": "7",
575
+ "when": 1787066175571,
576
+ "tag": "0082_blue_black_queen",
577
+ "breakpoints": true
578
+ },
579
+ {
580
+ "idx": 83,
581
+ "version": "7",
582
+ "when": 1787096121244,
583
+ "tag": "0083_replace_launch_spec_snapshot_with_frozen_bundle",
584
+ "breakpoints": true
585
+ },
586
+ {
587
+ "idx": 84,
588
+ "version": "7",
589
+ "when": 1787169492000,
590
+ "tag": "0084_delete_orphaned_credential_grants",
591
+ "breakpoints": true
592
+ },
593
+ {
594
+ "idx": 85,
595
+ "version": "7",
596
+ "when": 1787528583748,
597
+ "tag": "0085_add_approval_run_idx",
598
+ "breakpoints": true
599
+ },
600
+ {
601
+ "idx": 86,
602
+ "version": "7",
603
+ "when": 1788412751293,
604
+ "tag": "0086_cool_human_cannonball",
605
+ "breakpoints": true
606
+ },
607
+ {
608
+ "idx": 87,
609
+ "version": "7",
610
+ "when": 1787862143742,
611
+ "tag": "0087_drop_sidecar_placement",
612
+ "breakpoints": true
613
+ },
614
+ {
615
+ "idx": 88,
616
+ "version": "7",
617
+ "when": 1788200236163,
618
+ "tag": "0088_thick_sprite",
619
+ "breakpoints": true
620
+ },
621
+ {
622
+ "idx": 89,
623
+ "version": "7",
624
+ "when": 1788617577404,
625
+ "tag": "0089_tense_selene",
626
+ "breakpoints": true
627
+ },
628
+ {
629
+ "idx": 90,
630
+ "version": "7",
631
+ "when": 1788736070428,
632
+ "tag": "0090_tenant_domain_lower_unique",
633
+ "breakpoints": true
634
+ },
635
+ {
636
+ "idx": 91,
637
+ "version": "7",
638
+ "when": 1788849155396,
639
+ "tag": "0091_workflow_run_dispatch_sender_address",
640
+ "breakpoints": true
641
+ },
642
+ {
643
+ "idx": 92,
644
+ "version": "7",
645
+ "when": 1788967084060,
646
+ "tag": "0092_sidecar_destroy_failed",
647
+ "breakpoints": true
648
+ },
649
+ {
650
+ "idx": 93,
651
+ "version": "7",
652
+ "when": 1789466440782,
653
+ "tag": "0093_sidecar_initialization",
654
+ "breakpoints": true
263
655
  }
264
656
  ]
265
657
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@intx/db",
3
- "version": "0.2.2",
3
+ "description": "Client, schema, migrations, and row parsers for the hub's PostgreSQL database",
4
+ "version": "0.4.0",
4
5
  "license": "LGPL-2.1-only",
5
6
  "type": "module",
6
7
  "exports": {
@@ -16,8 +17,11 @@
16
17
  }
17
18
  },
18
19
  "dependencies": {
19
- "@intx/log": "0.2.2",
20
- "@intx/types": "0.2.2",
20
+ "@intx/authz": "0.4.0",
21
+ "@intx/crypto": "0.4.0",
22
+ "@intx/hub-common": "0.4.0",
23
+ "@intx/log": "0.4.0",
24
+ "@intx/types": "0.4.0",
21
25
  "arktype": "^2.1.29",
22
26
  "drizzle-orm": "^0.45.1",
23
27
  "postgres": "^3.4.8"
@@ -1,15 +0,0 @@
1
- import { pgTable, text, timestamp, unique } from "drizzle-orm/pg-core";
2
- import { agent } from "./agents.js";
3
- import { asset } from "./assets.js";
4
- export const agentAsset = pgTable("agent_asset", {
5
- id: text("id").primaryKey(),
6
- agentId: text("agent_id")
7
- .notNull()
8
- .references(() => agent.id, { onDelete: "cascade" }),
9
- assetId: text("asset_id")
10
- .notNull()
11
- .references(() => asset.id, { onDelete: "cascade" }),
12
- ref: text("ref").notNull(),
13
- accessMode: text("access_mode").notNull().default("read-only"),
14
- createdAt: timestamp("created_at").notNull().defaultNow(),
15
- }, (t) => [unique("agent_asset_agent_asset").on(t.agentId, t.assetId)]);
@@ -1,57 +0,0 @@
1
- import { jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
2
- import { principal } from "./principals.js";
3
- import { tenant } from "./tenants.js";
4
- export const agent = pgTable("agent", {
5
- id: text("id").primaryKey(),
6
- tenantId: text("tenant_id")
7
- .notNull()
8
- .references(() => tenant.id, { onDelete: "cascade" }),
9
- // Tracks the definition author's principal for resolving source:"creator"
10
- // grant requirements at launch. See AUTH.md § Grant Requirements on Definitions.
11
- creatorPrincipalId: text("creator_principal_id")
12
- .notNull()
13
- .references(() => principal.id),
14
- name: text("name").notNull(),
15
- description: text("description"),
16
- systemPrompt: text("system_prompt"),
17
- contextConfig: jsonb("context_config"),
18
- initialState: jsonb("initial_state"),
19
- modelConfig: jsonb("model_config"),
20
- capabilities: jsonb("capabilities"),
21
- credentialRequirements: jsonb("credential_requirements"),
22
- // Model needs declared by canonical name with per-model provider
23
- // preferences, validated as ModelRequirements at parse time. The control
24
- // plane resolves these against the tenant catalog at launch to build the
25
- // ordered inference sources; credentialRequirements covers only
26
- // tool/integration credentials, not inference.
27
- modelRequirements: jsonb("model_requirements"),
28
- // Pinned tool packages, validated as ToolPackagePin[] at parse time.
29
- // Empty array (the default) means the agent has no NPM-distributed
30
- // tool packages wired to it; the loader receives an empty closure
31
- // and produces no tool factories for this agent.
32
- toolPackages: jsonb("tool_packages").notNull().default([]),
33
- // Grant requirements manifest — resolved at launch into materialized grants
34
- // on the instance principal. See AUTH.md § Grant Requirements on Definitions.
35
- grantRequirements: jsonb("grant_requirements"),
36
- currentVersion: text("current_version").notNull().default("1"),
37
- status: text("status", {
38
- enum: ["deployed", "stopped"],
39
- })
40
- .notNull()
41
- .default("deployed"),
42
- createdAt: timestamp("created_at").notNull().defaultNow(),
43
- updatedAt: timestamp("updated_at").notNull().defaultNow(),
44
- });
45
- export const agentVersion = pgTable("agent_version", {
46
- id: text("id").primaryKey(),
47
- agentId: text("agent_id")
48
- .notNull()
49
- .references(() => agent.id, { onDelete: "cascade" }),
50
- version: text("version").notNull(),
51
- status: text("status", {
52
- enum: ["active", "inactive", "failed"],
53
- })
54
- .notNull()
55
- .default("active"),
56
- createdAt: timestamp("created_at").notNull().defaultNow(),
57
- });
@@ -1,39 +0,0 @@
1
- import { jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
2
- import { agent, agentVersion } from "./agents.js";
3
- import { agentSession } from "./sessions.js";
4
- import { principal } from "./principals.js";
5
- import { sidecar } from "./sidecar.js";
6
- import { tenant } from "./tenants.js";
7
- export const agentInstance = pgTable("agent_instance", {
8
- id: text("id").primaryKey(),
9
- agentId: text("agent_id")
10
- .notNull()
11
- .references(() => agent.id, { onDelete: "cascade" }),
12
- tenantId: text("tenant_id")
13
- .notNull()
14
- .references(() => tenant.id, { onDelete: "cascade" }),
15
- principalId: text("principal_id")
16
- .notNull()
17
- .references(() => principal.id),
18
- address: text("address").notNull().unique(),
19
- versionId: text("version_id").references(() => agentVersion.id),
20
- sessionId: text("session_id").references(() => agentSession.id),
21
- status: text("status", {
22
- enum: ["deployed", "running", "updating", "error", "stopped"],
23
- })
24
- .notNull()
25
- .default("deployed"),
26
- sidecarId: text("sidecar_id").references(() => sidecar.id, {
27
- onDelete: "set null",
28
- }),
29
- publicKey: text("public_key"),
30
- kernelId: text("kernel_id"),
31
- // The invoker's launch-time per-model provider preferences, validated as
32
- // InvokerModelPreferences at parse time. Persisted here so re-resolving an
33
- // instance's sources (on credential rotation or sidecar reconnect) reuses
34
- // the invoker's reorder/restrict, not just the definition's preferences.
35
- modelPreferences: jsonb("model_preferences"),
36
- createdAt: timestamp("created_at").notNull().defaultNow(),
37
- updatedAt: timestamp("updated_at").notNull().defaultNow(),
38
- endedAt: timestamp("ended_at"),
39
- });
@@ -1,37 +0,0 @@
1
- import { index, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
2
- import { asset } from "./assets.js";
3
- import { tenant } from "./tenants.js";
4
- export const workflowDeployment = pgTable("workflow_deployment", {
5
- id: text("id").primaryKey(),
6
- tenantId: text("tenant_id")
7
- .notNull()
8
- .references(() => tenant.id, { onDelete: "cascade" }),
9
- definitionAssetId: text("definition_asset_id")
10
- .notNull()
11
- .references(() => asset.id, { onDelete: "cascade" }),
12
- // The deployment's routable address (`ins_<id>@<domain>`), stored rather
13
- // than re-derived at read time so the reconnect ownership challenge can
14
- // look up the deployment's public key by address, symmetrically with the
15
- // `agent_instance` path. Unique so a double-insert fails loud.
16
- //
17
- // Added NOT NULL with no default and no backfill. Like the repo's other
18
- // such adds (e.g. `credential.provider_id`), the migration relies on the
19
- // table being empty when it runs: this table and the `address` column
20
- // land one migration apart, both unreleased, so no populated row predates
21
- // the column and none needs a backfilled address.
22
- address: text("address").notNull(),
23
- // The Ed25519 public key the sidecar minted for this deployment address,
24
- // persisted at deploy-ack. Nullable by design: the row is written at
25
- // deploy-start and the key arrives at ack, so a not-yet-acked deployment
26
- // reads `null` and its reconnect challenge fails closed -- the address
27
- // stays unrouted rather than routing without ownership proof.
28
- publicKey: text("public_key"),
29
- status: text("status")
30
- .$type()
31
- .notNull()
32
- .default("deployed"),
33
- createdAt: timestamp("created_at").notNull().defaultNow(),
34
- }, (t) => [
35
- index("workflow_deployment_tenant_idx").on(t.tenantId, t.createdAt),
36
- uniqueIndex("workflow_deployment_address_idx").on(t.address),
37
- ]);