@opengeni/db 5.0.1 → 6.0.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 (212) hide show
  1. package/dist/automations.d.ts +0 -2
  2. package/dist/canonical-human-identities.d.ts +4 -0
  3. package/dist/canonical-human-identities.js +3 -3
  4. package/dist/capability-components.d.ts +5 -13
  5. package/dist/capability-integrations.d.ts +23 -8
  6. package/dist/capability-reconciliation.d.ts +5 -0
  7. package/dist/capability-reconciliation.js +21 -0
  8. package/dist/capability-reconciliation.js.map +1 -0
  9. package/dist/{chunk-6T2GGYWE.js → chunk-4UJCXBR2.js} +4 -5800
  10. package/dist/chunk-4UJCXBR2.js.map +1 -0
  11. package/dist/{chunk-MWMXWHJD.js → chunk-7JCDSMX2.js} +2 -2
  12. package/dist/chunk-AJA2ZIUW.js +219 -0
  13. package/dist/chunk-AJA2ZIUW.js.map +1 -0
  14. package/dist/chunk-CDAT6EKW.js +247 -0
  15. package/dist/chunk-CDAT6EKW.js.map +1 -0
  16. package/dist/{chunk-DPONPYJD.js → chunk-CJI6G254.js} +70 -18
  17. package/dist/chunk-CJI6G254.js.map +1 -0
  18. package/dist/chunk-G32NVMRJ.js +276 -0
  19. package/dist/chunk-G32NVMRJ.js.map +1 -0
  20. package/dist/chunk-GABXCG3N.js +5811 -0
  21. package/dist/chunk-GABXCG3N.js.map +1 -0
  22. package/dist/{chunk-ERKVSPDX.js → chunk-LVY33EWL.js} +3 -3
  23. package/dist/{chunk-45CP2YKY.js → chunk-MAMBI2HR.js} +9 -3
  24. package/dist/{chunk-45CP2YKY.js.map → chunk-MAMBI2HR.js.map} +1 -1
  25. package/dist/{chunk-F73UKJY6.js → chunk-MN5PZMEK.js} +91 -108
  26. package/dist/chunk-MN5PZMEK.js.map +1 -0
  27. package/dist/chunk-PJI4MUZ7.js +131 -0
  28. package/dist/chunk-PJI4MUZ7.js.map +1 -0
  29. package/dist/{chunk-T6BWIGWJ.js → chunk-RIYHP2WU.js} +2 -2
  30. package/dist/{chunk-7HMK3B45.js → chunk-RL2MUXM3.js} +16 -7
  31. package/dist/chunk-RL2MUXM3.js.map +1 -0
  32. package/dist/{chunk-HQDVI2DB.js → chunk-SYKHLPTK.js} +4 -3
  33. package/dist/{chunk-HQDVI2DB.js.map → chunk-SYKHLPTK.js.map} +1 -1
  34. package/dist/{chunk-T6YLHJLS.js → chunk-XIXVVBW2.js} +198 -51
  35. package/dist/chunk-XIXVVBW2.js.map +1 -0
  36. package/dist/chunk-ZPJ6V2VG.js +156 -0
  37. package/dist/chunk-ZPJ6V2VG.js.map +1 -0
  38. package/dist/codex-capacity-recovery.d.ts +12 -0
  39. package/dist/codex-failure-eligibility.d.ts +9 -0
  40. package/dist/company-profile-schema.d.ts +4 -2
  41. package/dist/connect-attempts.d.ts +15 -0
  42. package/dist/connect-attempts.js +25 -0
  43. package/dist/connect-attempts.js.map +1 -0
  44. package/dist/connection-authority.d.ts +7 -63
  45. package/dist/connection-refresh-lock.d.ts +4 -0
  46. package/dist/connection-token-resolver.d.ts +8 -43
  47. package/dist/database-timing.d.ts +10 -0
  48. package/dist/database.d.ts +4 -0
  49. package/dist/editable-artifact-durable-export.js +2 -2
  50. package/dist/editable-artifacts.d.ts +9 -0
  51. package/dist/editable-artifacts.js +7 -5
  52. package/dist/index.d.ts +447 -78
  53. package/dist/index.js +12705 -12872
  54. package/dist/index.js.map +1 -1
  55. package/dist/insights-usage-bundle.d.ts +3 -0
  56. package/dist/integration-bindings.d.ts +1 -1
  57. package/dist/integration-facets.d.ts +18 -1
  58. package/dist/knowledge-entries-schema.d.ts +2 -0
  59. package/dist/knowledge-entries.d.ts +1 -0
  60. package/dist/knowledge-indexing.d.ts +1 -0
  61. package/dist/live-session-attempt.d.ts +35 -137
  62. package/dist/managed-auth-session-sets.js +3 -3
  63. package/dist/mcp-account-bindings.d.ts +4 -0
  64. package/dist/mcp-oauth.d.ts +11 -0
  65. package/dist/mcp-operations.js +2 -2
  66. package/dist/migrate.js +1 -1
  67. package/dist/organization-integration-policy.d.ts +51 -0
  68. package/dist/organization-integration-policy.js +18 -0
  69. package/dist/organization-integration-policy.js.map +1 -0
  70. package/dist/organization-usage.d.ts +20 -0
  71. package/dist/plugin-packages.d.ts +9 -12
  72. package/dist/pr-review.d.ts +0 -11
  73. package/dist/preference-registry-schema.d.ts +17 -0
  74. package/dist/provision-roles.js +1 -1
  75. package/dist/retained-provider-commands.d.ts +124 -6
  76. package/dist/retained-provider-commands.js +29 -97
  77. package/dist/retained-provider-commands.js.map +1 -1
  78. package/dist/retired-session-create-metadata.d.ts +4 -0
  79. package/dist/runtime-posture.d.ts +7 -5
  80. package/dist/schema.d.ts +876 -656
  81. package/dist/schema.js +5 -7
  82. package/dist/session-admission-block.d.ts +32 -0
  83. package/dist/session-attempt-writers.d.ts +4 -0
  84. package/dist/session-background-commands.js +5 -4
  85. package/dist/session-command-output.js +8 -126
  86. package/dist/session-command-output.js.map +1 -1
  87. package/dist/session-control.d.ts +5 -1
  88. package/dist/session-event-slices.d.ts +10 -0
  89. package/dist/session-event-slices.js +8 -222
  90. package/dist/session-event-slices.js.map +1 -1
  91. package/dist/session-file-attachments.d.ts +28 -0
  92. package/dist/session-goal-reports.d.ts +43 -0
  93. package/dist/session-mcp-approval.d.ts +4 -0
  94. package/dist/session-mcp-credential-rotation.js +5 -4
  95. package/dist/session-mcp-credential-rotation.js.map +1 -1
  96. package/dist/session-message-search.d.ts +22 -0
  97. package/dist/session-queue-commands.d.ts +2 -6
  98. package/dist/session-retry.d.ts +36 -0
  99. package/dist/session-tenancy.js +3 -3
  100. package/dist/skill-source-release-impact.d.ts +18 -0
  101. package/dist/skill-source-release.d.ts +9 -0
  102. package/dist/skills.d.ts +7 -1
  103. package/dist/user-resource-authority.d.ts +0 -8
  104. package/dist/video-generation.js +3 -3
  105. package/dist/workspace-tool-defaults.js +5 -4
  106. package/dist/workspace-tool-defaults.js.map +1 -1
  107. package/drizzle/0468_knowledge_relationship_projection.sql +30 -0
  108. package/drizzle/0469_knowledge_source_discovery.sql +85 -0
  109. package/drizzle/0470_organization_integration_policy.sql +151 -0
  110. package/drizzle/0471_usage_events_account_recent_index.sql +4 -0
  111. package/drizzle/0472_usage_events_workspace_recent_index.sql +4 -0
  112. package/drizzle/0473_organization_usage_analytical_capability.sql +237 -0
  113. package/drizzle/0474_goal_report_requirements.sql +156 -0
  114. package/drizzle/0475_session_event_history_statistics.sql +15 -0
  115. package/drizzle/0476_session_event_history_policy_planning.sql +29 -0
  116. package/drizzle/0477_managed_sign_in_methods.sql +303 -0
  117. package/drizzle/0478_sender_owned_connections.sql +2772 -0
  118. package/drizzle/0479_connection_create_idempotency.sql +16 -0
  119. package/drizzle/0480_private_session_organization_key_administration.sql +154 -0
  120. package/drizzle/0481_personal_connection_visibility_cleanup.sql +45 -0
  121. package/drizzle/0482_remove_packs.sql +417 -0
  122. package/drizzle/0483_preclaim_admission_block.sql +85 -0
  123. package/drizzle/0484_insights_usage_projection.sql +211 -0
  124. package/drizzle/0485_inherited_mcp_approval_policies.sql +6 -0
  125. package/drizzle/0486_reasoning_configuration_message_forks.sql +35 -0
  126. package/drizzle/0487_skill_catalog_message_forks.sql +26 -0
  127. package/drizzle/0488_permanent_skill_removal.sql +207 -0
  128. package/drizzle/0489_modal_command_byte_offsets.sql +17 -0
  129. package/drizzle/0490_periodic_capture_attempt_cadence.sql +6 -0
  130. package/drizzle/0491_warm_capture_holder_reclamation.sql +57 -0
  131. package/drizzle/0492_codex_accepted_source_authority.sql +249 -0
  132. package/drizzle/0493_stopping_command_error_containment.sql +58 -0
  133. package/drizzle/0494_mcp_account_bindings.sql +334 -0
  134. package/drizzle/0495_consented_sandbox_recovery.sql +220 -0
  135. package/drizzle/0496_supervised_command_settlement.sql +386 -0
  136. package/drizzle/0497_modal_inventory_owner_read_capability.sql +112 -0
  137. package/drizzle/0498_enrollment_membership_fence.sql +87 -0
  138. package/drizzle/0499_session_attachment_access.sql +224 -0
  139. package/drizzle/0500_session_execution_epoch.sql +37 -0
  140. package/drizzle/0501_session_sharing_execution.sql +591 -0
  141. package/drizzle/0502_active_message_boundary_forks.sql +30 -0
  142. package/package.json +17 -5
  143. package/src/automations.ts +17 -73
  144. package/src/canonical-human-identities.ts +17 -5
  145. package/src/capability-components.ts +7 -24
  146. package/src/capability-integrations.ts +301 -21
  147. package/src/capability-reconciliation.ts +19 -0
  148. package/src/codex-capacity-recovery.ts +47 -0
  149. package/src/codex-failure-eligibility.ts +93 -0
  150. package/src/connect-attempts.ts +49 -18
  151. package/src/connection-authority.ts +12 -158
  152. package/src/connection-refresh-lock.ts +22 -0
  153. package/src/connection-token-resolver.ts +58 -530
  154. package/src/database-timing.ts +43 -0
  155. package/src/database.ts +61 -26
  156. package/src/editable-artifacts.ts +1 -1
  157. package/src/index.ts +3578 -1273
  158. package/src/insights-model-bundle.ts +19 -7
  159. package/src/insights-usage-bundle.ts +16 -19
  160. package/src/integration-bindings.ts +2 -7
  161. package/src/integration-facets.ts +73 -6
  162. package/src/knowledge-entries.ts +8 -1
  163. package/src/live-session-attempt.ts +0 -22
  164. package/src/mcp-account-bindings.ts +12 -0
  165. package/src/mcp-oauth.ts +26 -0
  166. package/src/organization-integration-policy.ts +235 -0
  167. package/src/organization-usage.ts +83 -0
  168. package/src/plugin-packages.ts +226 -42
  169. package/src/pr-review.ts +7 -69
  170. package/src/preference-registry-schema.ts +1 -0
  171. package/src/provision-roles.ts +50 -37
  172. package/src/retained-provider-commands.ts +286 -9
  173. package/src/retired-session-create-metadata.ts +16 -0
  174. package/src/runtime-posture.ts +217 -13
  175. package/src/schema.ts +104 -120
  176. package/src/session-admission-block.ts +29 -0
  177. package/src/session-attempt-writers.ts +48 -0
  178. package/src/session-control.ts +21 -5
  179. package/src/session-event-slices.ts +76 -26
  180. package/src/session-file-attachments.ts +66 -0
  181. package/src/session-goal-reports.ts +255 -0
  182. package/src/session-mcp-approval.ts +30 -0
  183. package/src/session-message-search.ts +348 -0
  184. package/src/session-queue-commands.ts +60 -36
  185. package/src/session-retry.ts +319 -0
  186. package/src/skill-config-migration.ts +11 -2
  187. package/src/skill-source-release-impact.ts +33 -0
  188. package/src/skill-source-release.ts +67 -26
  189. package/src/skills.ts +44 -6
  190. package/src/user-resource-authority.ts +0 -56
  191. package/dist/chunk-6T2GGYWE.js.map +0 -1
  192. package/dist/chunk-7HMK3B45.js.map +0 -1
  193. package/dist/chunk-DPONPYJD.js.map +0 -1
  194. package/dist/chunk-F73UKJY6.js.map +0 -1
  195. package/dist/chunk-T6YLHJLS.js.map +0 -1
  196. package/dist/host-mcp-binding-match.d.ts +0 -5
  197. package/dist/host-mcp-bindings.d.ts +0 -79
  198. package/dist/host-mcp-resolvers.d.ts +0 -47
  199. package/dist/host-mcp-task-authority.d.ts +0 -43
  200. package/dist/host-selection-identity.d.ts +0 -6
  201. package/dist/pack-components.d.ts +0 -83
  202. package/dist/pack-installations.d.ts +0 -86
  203. package/src/host-mcp-binding-match.ts +0 -34
  204. package/src/host-mcp-bindings.ts +0 -777
  205. package/src/host-mcp-resolvers.ts +0 -266
  206. package/src/host-mcp-task-authority.ts +0 -384
  207. package/src/host-selection-identity.ts +0 -29
  208. package/src/pack-components.ts +0 -980
  209. package/src/pack-installations.ts +0 -950
  210. /package/dist/{chunk-MWMXWHJD.js.map → chunk-7JCDSMX2.js.map} +0 -0
  211. /package/dist/{chunk-ERKVSPDX.js.map → chunk-LVY33EWL.js.map} +0 -0
  212. /package/dist/{chunk-T6BWIGWJ.js.map → chunk-RIYHP2WU.js.map} +0 -0
@@ -199,6 +199,8 @@ __export(schema_exports, {
199
199
  organizationCodexRotationSettings: () => organizationCodexRotationSettings,
200
200
  organizationCompanyProfileAgentPolicies: () => organizationCompanyProfileAgentPolicies,
201
201
  organizationCompanyProfileAgentPolicyEvents: () => organizationCompanyProfileAgentPolicyEvents,
202
+ organizationIntegrationPolicies: () => organizationIntegrationPolicies,
203
+ organizationIntegrationPolicyOperations: () => organizationIntegrationPolicyOperations,
202
204
  organizationInvitationBindingEvents: () => organizationInvitationBindingEvents,
203
205
  organizationMembershipInvitations: () => organizationMembershipInvitations,
204
206
  organizationMembershipLifecycleEvents: () => organizationMembershipLifecycleEvents,
@@ -227,8 +229,6 @@ __export(schema_exports, {
227
229
  organizationUserRetentionObjectDeletionReceipts: () => organizationUserRetentionObjectDeletionReceipts,
228
230
  organizationUserRetentionObjectObligations: () => organizationUserRetentionObjectObligations,
229
231
  organizationUserRetentionPolicies: () => organizationUserRetentionPolicies,
230
- packInstallationComponents: () => packInstallationComponents,
231
- packInstallations: () => packInstallations,
232
232
  personalGitHubRepositorySelectionHeads: () => personalGitHubRepositorySelectionHeads,
233
233
  personalGitHubRepositorySelectionOperations: () => personalGitHubRepositorySelectionOperations,
234
234
  personalGitHubRepositorySelections: () => personalGitHubRepositorySelections,
@@ -370,7 +370,6 @@ __export(schema_exports, {
370
370
  workspaceLearningPolicySnapshots: () => workspaceLearningPolicySnapshots,
371
371
  workspaceMemberships: () => workspaceMemberships,
372
372
  workspaceModelPolicies: () => workspaceModelPolicies,
373
- workspacePacks: () => workspacePacks,
374
373
  workspaceScreenshotQuotas: () => workspaceScreenshotQuotas,
375
374
  workspaceSessionActivityRevisions: () => workspaceSessionActivityRevisions,
376
375
  workspaceVariableSetVariables: () => workspaceVariableSetVariables,
@@ -2966,6 +2965,7 @@ var preferenceRegistryRevisions = pgTable9(
2966
2965
  contentHash: text9("content_hash").notNull(),
2967
2966
  skillFiles: jsonb9("skill_files").$type(),
2968
2967
  skillActivationMode: text9("skill_activation_mode"),
2968
+ skillRemovalOperationId: uuid9("skill_removal_operation_id"),
2969
2969
  precedenceRank: integer9("precedence_rank").notNull().default(0),
2970
2970
  conflictStrategy: text9("conflict_strategy").notNull(),
2971
2971
  conflictsWith: jsonb9("conflicts_with").$type().notNull().default([]),
@@ -6508,6 +6508,40 @@ var managedAccounts = pgTable21(
6508
6508
  )
6509
6509
  })
6510
6510
  );
6511
+ var organizationIntegrationPolicies = pgTable21(
6512
+ "organization_integration_policies",
6513
+ {
6514
+ accountId: uuid21("account_id").primaryKey().references(() => managedAccounts.id, { onDelete: "cascade" }),
6515
+ mode: text21("mode").$type().notNull(),
6516
+ allowedIntegrationKeys: jsonb17("allowed_integration_keys").$type().notNull(),
6517
+ revision: bigint14("revision", { mode: "number" }).notNull()
6518
+ },
6519
+ (table) => ({
6520
+ modeCheck: check11(
6521
+ "organization_integration_policies_mode_check",
6522
+ sql16`${table.mode} in ('unrestricted', 'restricted')`
6523
+ ),
6524
+ keysCheck: check11(
6525
+ "organization_integration_policies_allowed_integration_keys_check",
6526
+ sql16`jsonb_typeof(${table.allowedIntegrationKeys}) = 'array'`
6527
+ ),
6528
+ revisionCheck: check11(
6529
+ "organization_integration_policies_revision_check",
6530
+ sql16`${table.revision} between 1 and 9007199254740991`
6531
+ )
6532
+ })
6533
+ );
6534
+ var organizationIntegrationPolicyOperations = pgTable21(
6535
+ "organization_integration_policy_operations",
6536
+ {
6537
+ accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
6538
+ operationId: uuid21("operation_id").notNull(),
6539
+ actorSubjectId: text21("actor_subject_id").notNull(),
6540
+ request: jsonb17("request").notNull(),
6541
+ result: jsonb17("result").notNull()
6542
+ },
6543
+ (table) => ({ identity: primaryKey10({ columns: [table.accountId, table.operationId] }) })
6544
+ );
6511
6545
  var workspaces = pgTable21(
6512
6546
  "workspaces",
6513
6547
  {
@@ -7041,7 +7075,8 @@ var organizationPrivateSessionSettingEvents = pgTable21(
7041
7075
  {
7042
7076
  id: uuid21("id").primaryKey(),
7043
7077
  accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
7044
- actorMembershipId: uuid21("actor_membership_id").notNull(),
7078
+ actorMembershipId: uuid21("actor_membership_id"),
7079
+ actorSubjectId: text21("actor_subject_id"),
7045
7080
  requestedEnabled: boolean12("requested_enabled").notNull(),
7046
7081
  expectedVersion: bigint14("expected_version", { mode: "number" }).notNull(),
7047
7082
  resultEnabled: boolean12("result_enabled").notNull(),
@@ -7061,6 +7096,10 @@ var organizationPrivateSessionSettingEvents = pgTable21(
7061
7096
  versionsValid: check11(
7062
7097
  "organization_private_session_setting_events_versions_check",
7063
7098
  sql16`${table.expectedVersion} >= 0 and ${table.resultVersion} > 0`
7099
+ ),
7100
+ actorValid: check11(
7101
+ "organization_private_session_setting_events_actor_check",
7102
+ sql16`${table.actorMembershipId} is not null or (${table.actorSubjectId} is not null and ${table.actorSubjectId} like 'api_key:%')`
7064
7103
  )
7065
7104
  })
7066
7105
  );
@@ -7923,6 +7962,8 @@ var connections = pgTable21(
7923
7962
  kind: text21("kind").notNull(),
7924
7963
  status: text21("status").notNull().default("active"),
7925
7964
  credentialEncrypted: text21("credential_encrypted").notNull(),
7965
+ createOperationId: text21("create_operation_id"),
7966
+ createRequestDigest: text21("create_request_digest"),
7926
7967
  grantedScopes: jsonb17("granted_scopes").$type().notNull().default([]),
7927
7968
  expiresAt: timestamp21("expires_at", { withTimezone: true }),
7928
7969
  lastRefreshAt: timestamp21("last_refresh_at", { withTimezone: true }),
@@ -7962,6 +8003,13 @@ var connections = pgTable21(
7962
8003
  table.providerDomain,
7963
8004
  table.status
7964
8005
  ),
8006
+ createOperation: uniqueIndex21("connections_create_operation_uq").on(table.workspaceId, table.createdBySubjectId, table.createOperationId).where(sql16`${table.createOperationId} is not null`),
8007
+ createOperationPair: check11(
8008
+ "connections_create_operation_pair_check",
8009
+ sql16`(${table.createOperationId} is null and ${table.createRequestDigest} is null)
8010
+ or (${table.createOperationId} is not null and ${table.createRequestDigest} is not null
8011
+ and ${table.createdBySubjectId} is not null)`
8012
+ ),
7965
8013
  workspaceSubjectProvider: index20("connections_workspace_subject_provider_idx").on(
7966
8014
  table.workspaceId,
7967
8015
  table.subjectId,
@@ -10106,6 +10154,7 @@ var sessions = pgTable21(
10106
10154
  // NULL and use the bounded metadata.role compatibility fallback at the
10107
10155
  // attempt-snapshot boundary.
10108
10156
  policyRole: text21("policy_role"),
10157
+ admissionBlock: jsonb17("admission_block").$type(),
10109
10158
  resources: jsonb17("resources").$type().notNull().default([]),
10110
10159
  skills: jsonb17("skills").$type().notNull().default([]),
10111
10160
  tools: jsonb17("tools").$type().notNull().default([]),
@@ -10123,6 +10172,8 @@ var sessions = pgTable21(
10123
10172
  visibility: text21("visibility").notNull().default("workspace_shared"),
10124
10173
  createRequestedVisibility: text21("create_requested_visibility").notNull().default("workspace_shared"),
10125
10174
  authorityEpoch: integer19("authority_epoch").notNull().default(1),
10175
+ // Old accepted epochs remain valid across sharing, never across revocation.
10176
+ executionAuthorityEpoch: integer19("execution_authority_epoch").notNull().default(1),
10126
10177
  // Agent-access scope (migration 0427). Declares how far a live attempt on
10127
10178
  // this session may reach across the workspace and how far peers may reach
10128
10179
  // into it. 'workspace' is the pre-0426 behaviour; 'user' limits reach to
@@ -10218,6 +10269,7 @@ var sessions = pgTable21(
10218
10269
  // crash between the session insert and first-turn transaction. Runtime
10219
10270
  // credential authority must never read this session field.
10220
10271
  initialPersonalConnectionDelegations: jsonb17("initial_personal_connection_delegations").$type().notNull().default([]),
10272
+ initialMcpAccountBindings: jsonb17("initial_mcp_account_bindings").$type(),
10221
10273
  // Initial accepted-work staging only. The initializer consumes this inside
10222
10274
  // the same transaction that inserts the first logical turn and grant
10223
10275
  // snapshots; runtime never authorizes from the session field.
@@ -10232,6 +10284,7 @@ var sessions = pgTable21(
10232
10284
  toolPolicy: jsonb17("tool_policy").$type().notNull(),
10233
10285
  // Optimistic-concurrency fence for durable session tool-policy writes.
10234
10286
  toolPolicyVersion: integer19("tool_policy_version").notNull().default(1),
10287
+ mcpApprovalPolicies: jsonb17("mcp_approval_policies").$type().notNull().default({}),
10235
10288
  // The manager session that spawned this one via session_create. Set only
10236
10289
  // when the creating grant carried a worker-signed sessionId claim (a session
10237
10290
  // spawning a worker); null for direct API creates and scheduled-task runs.
@@ -12191,6 +12244,7 @@ var sessionTurns = pgTable21(
12191
12244
  // approval, retries, and Codemode reuse this row; no runtime may infer
12192
12245
  // broader authority from the session creator or mutable session state.
12193
12246
  personalConnectionDelegations: jsonb17("personal_connection_delegations").$type().notNull().default([]),
12247
+ mcpAccountBindings: jsonb17("mcp_account_bindings").$type(),
12194
12248
  // Credential-free public summary of a turn-bound personal Variable
12195
12249
  // Set/Rig attachment. Exact resource and grant identity lives only in the
12196
12250
  // immutable accepted-work snapshot tables.
@@ -13473,6 +13527,7 @@ var sessionSystemUpdates = pgTable21(
13473
13527
  // Private immutable authority frozen when this machine input is accepted.
13474
13528
  // Public projections intentionally omit connection ids and owner subjects.
13475
13529
  personalConnectionDelegations: jsonb17("personal_connection_delegations").$type().notNull().default([]),
13530
+ mcpAccountBindings: jsonb17("mcp_account_bindings").$type(),
13476
13531
  xaiProviderAccountAuthoritySnapshot: jsonb17("xai_provider_account_authority_snapshot").$type().notNull().default(WORKSPACE_XAI_PROVIDER_ACCOUNT_AUTHORITY_SNAPSHOT_V1),
13477
13532
  // Private scheduled-occurrence authority linkage. Public update/event
13478
13533
  // projections intentionally omit this producer identifier.
@@ -13547,6 +13602,7 @@ var sessionSystemUpdateOutbox = pgTable21(
13547
13602
  // Exact private authority copied from the causal parent turn in the source
13548
13603
  // terminal transaction. Delivery retries cannot replace this snapshot.
13549
13604
  personalConnectionDelegations: jsonb17("personal_connection_delegations").$type().notNull().default([]),
13605
+ mcpAccountBindings: jsonb17("mcp_account_bindings").$type(),
13550
13606
  xaiProviderAccountAuthoritySnapshot: jsonb17("xai_provider_account_authority_snapshot").$type().notNull().default(WORKSPACE_XAI_PROVIDER_ACCOUNT_AUTHORITY_SNAPSHOT_V1),
13551
13607
  status: text21("status").notNull().default("pending"),
13552
13608
  attempts: integer19("attempts").notNull().default(0),
@@ -14416,6 +14472,7 @@ var sandboxLeases = pgTable21(
14416
14472
  accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
14417
14473
  workspaceId: uuid21("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
14418
14474
  sandboxGroupId: uuid21("sandbox_group_id").notNull(),
14475
+ publicRecovery: jsonb17("public_recovery").$type(),
14419
14476
  unobservableCommandDrainIds: uuid21("unobservable_command_drain_ids").array(),
14420
14477
  unobservableCommandCheckedAt: timestamp21("unobservable_command_checked_at", {
14421
14478
  withTimezone: true
@@ -14486,6 +14543,11 @@ var sandboxLeases = pgTable21(
14486
14543
  // can recover immediately without pretending it resumes one provider RPC.
14487
14544
  archiveCaptureTakeoverSafe: boolean12("archive_capture_takeover_safe").notNull().default(false),
14488
14545
  archiveCaptureAttempt: integer19("archive_capture_attempt"),
14546
+ // Periodic capture cadence survives a failed claim's release and worker
14547
+ // restarts. This is not evidence that a recovery archive was published.
14548
+ archiveCaptureLastAttemptAt: timestamp21("archive_capture_last_attempt_at", {
14549
+ withTimezone: true
14550
+ }),
14489
14551
  archiveCaptureGeneration: integer19("archive_capture_generation"),
14490
14552
  archiveCaptureStartedAt: timestamp21("archive_capture_started_at", {
14491
14553
  withTimezone: true
@@ -14948,6 +15010,13 @@ var sandboxRetainedProcesses = pgTable21(
14948
15010
  routeEpoch: integer19("route_epoch").notNull(),
14949
15011
  providerSessionId: integer19("provider_session_id").notNull(),
14950
15012
  providerCommand: jsonb17("provider_command").$type(),
15013
+ supervisionRetentionXid: customType6({ dataType: () => "xid8" })(
15014
+ "supervision_retention_xid"
15015
+ ).default(sql16`pg_current_xact_id()`),
15016
+ supervisionReceipt: jsonb17("supervision_receipt").$type(),
15017
+ supervisionOutputCaptured: boolean12("supervision_output_captured").notNull().default(false),
15018
+ cancellationRequestedAt: timestamp21("cancellation_requested_at", { withTimezone: true }),
15019
+ cancellationReason: text21("cancellation_reason"),
14951
15020
  providerCommandInputIndex: bigint14("provider_command_input_index", { mode: "number" }).notNull().default(0),
14952
15021
  // Authority frozen when the process was retained (migration 0277). A
14953
15022
  // `legacy_unattributed` process keeps running; only its next workspace
@@ -15041,7 +15110,7 @@ var sandboxRetainedProcesses = pgTable21(
15041
15110
  sql16`${table.providerCommand} IS NULL OR ((
15042
15111
  ${table.providerBackend} = 'modal'
15043
15112
  AND jsonb_typeof(${table.providerCommand}) = 'object'
15044
- AND ${table.providerCommand}->>'kind' = 'modal-control-v1'
15113
+ AND ${table.providerCommand}->>'kind' IN ('modal-control-v1', 'modal-router-v1')
15045
15114
  AND ${table.providerCommand}->>'sandboxId' = ${table.providerInstanceId}
15046
15115
  AND length(${table.providerCommand}->>'taskId') > 0
15047
15116
  AND length(${table.providerCommand}->>'execId') > 0
@@ -15986,6 +16055,7 @@ var scheduledTasks = pgTable21(
15986
16055
  accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
15987
16056
  workspaceId: uuid21("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
15988
16057
  name: text21("name").notNull(),
16058
+ ownerSubjectId: text21("owner_subject_id"),
15989
16059
  status: text21("status").notNull().default("active"),
15990
16060
  schedule: jsonb17("schedule").$type().notNull(),
15991
16061
  temporalScheduleId: text21("temporal_schedule_id").notNull(),
@@ -16547,6 +16617,17 @@ var usageEvents = pgTable21(
16547
16617
  table.eventType,
16548
16618
  table.occurredAt
16549
16619
  ),
16620
+ accountRecent: index20("usage_events_account_recent_idx").on(
16621
+ table.accountId,
16622
+ table.occurredAt.desc(),
16623
+ table.recordedAt.desc()
16624
+ ),
16625
+ workspaceRecent: index20("usage_events_workspace_recent_idx").on(
16626
+ table.accountId,
16627
+ table.workspaceId,
16628
+ table.occurredAt.desc(),
16629
+ table.recordedAt.desc()
16630
+ ),
16550
16631
  workspaceSession: index20("usage_events_workspace_session_idx").on(
16551
16632
  table.workspaceId,
16552
16633
  table.sessionId,
@@ -16932,66 +17013,6 @@ var auditEvents = pgTable21(
16932
17013
  )
16933
17014
  })
16934
17015
  );
16935
- var packInstallations = pgTable21(
16936
- "pack_installations",
16937
- {
16938
- id: uuid21("id").primaryKey().defaultRandom(),
16939
- accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
16940
- workspaceId: uuid21("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
16941
- packId: text21("pack_id").notNull(),
16942
- status: text21("status").notNull().default("active"),
16943
- version: integer19("version").notNull().default(1),
16944
- manifestSnapshot: jsonb17("manifest_snapshot").$type(),
16945
- manifestDigest: text21("manifest_digest"),
16946
- selectedRigId: uuid21("selected_rig_id").references(() => rigs.id, {
16947
- onDelete: "set null"
16948
- }),
16949
- installedBySubjectId: text21("installed_by_subject_id"),
16950
- metadata: jsonb17("metadata").$type().notNull().default({}),
16951
- enabledAt: timestamp21("enabled_at", { withTimezone: true }).notNull().defaultNow(),
16952
- updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow()
16953
- },
16954
- (table) => ({
16955
- workspaceIdentity: uniqueIndex21("pack_installations_workspace_id_uq").on(
16956
- table.workspaceId,
16957
- table.id
16958
- ),
16959
- workspacePack: uniqueIndex21("pack_installations_workspace_pack_idx").on(
16960
- table.workspaceId,
16961
- table.packId
16962
- ),
16963
- status: index20("pack_installations_workspace_status_idx").on(table.workspaceId, table.status),
16964
- selectedRig: index20("pack_installations_workspace_rig_idx").on(table.workspaceId, table.selectedRigId).where(sql16`${table.selectedRigId} is not null`)
16965
- })
16966
- );
16967
- var packInstallationComponents = pgTable21(
16968
- "pack_installation_components",
16969
- {
16970
- id: uuid21("id").primaryKey().defaultRandom(),
16971
- accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
16972
- workspaceId: uuid21("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
16973
- packInstallationId: uuid21("pack_installation_id").notNull().references(() => packInstallations.id, { onDelete: "cascade" }),
16974
- componentKey: text21("component_key").notNull(),
16975
- kind: text21("kind").notNull(),
16976
- capabilityId: text21("capability_id").notNull(),
16977
- resolvedId: text21("resolved_id").notNull(),
16978
- digest: text21("digest").notNull(),
16979
- metadata: jsonb17("metadata").$type().notNull().default({}),
16980
- createdAt: timestamp21("created_at", { withTimezone: true }).notNull().defaultNow(),
16981
- updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow()
16982
- },
16983
- (table) => ({
16984
- installationKey: uniqueIndex21("pack_installation_components_pack_key_uq").on(
16985
- table.packInstallationId,
16986
- table.componentKey
16987
- ),
16988
- workspaceCapability: index20("pack_installation_components_workspace_capability_idx").on(
16989
- table.workspaceId,
16990
- table.kind,
16991
- table.capabilityId
16992
- )
16993
- })
16994
- );
16995
17016
  var automationSources = pgTable21(
16996
17017
  "automation_sources",
16997
17018
  {
@@ -17005,8 +17026,6 @@ var automationSources = pgTable21(
17005
17026
  webhookSecretEncrypted: text21("webhook_secret_encrypted").notNull(),
17006
17027
  status: text21("status").notNull().default("active"),
17007
17028
  version: integer19("version").notNull().default(1),
17008
- packInstallationId: uuid21("pack_installation_id"),
17009
- packConnectorId: text21("pack_connector_id"),
17010
17029
  createdBySubjectId: text21("created_by_subject_id").notNull(),
17011
17030
  createdAt: timestamp21("created_at", { withTimezone: true }).notNull().defaultNow(),
17012
17031
  updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow()
@@ -17028,20 +17047,12 @@ var automationSources = pgTable21(
17028
17047
  and octet_length(${table.name}) between 1 and 512
17029
17048
  and octet_length(${table.adapterId}) between 1 and 128
17030
17049
  and octet_length(${table.createdBySubjectId}) between 1 and 4096
17031
- and jsonb_typeof(${table.configuration}) = 'object'
17032
- and ((${table.packInstallationId} is null and ${table.packConnectorId} is null)
17033
- or (${table.packInstallationId} is not null
17034
- and octet_length(${table.packConnectorId}) between 1 and 128))`
17050
+ and jsonb_typeof(${table.configuration}) = 'object'`
17035
17051
  ),
17036
17052
  workspaceAccount: foreignKey({
17037
17053
  columns: [table.workspaceId, table.accountId],
17038
17054
  foreignColumns: [workspaces.id, workspaces.accountId],
17039
17055
  name: "automation_sources_workspace_account_fk"
17040
- }).onDelete("cascade"),
17041
- packInstallation: foreignKey({
17042
- columns: [table.workspaceId, table.packInstallationId],
17043
- foreignColumns: [packInstallations.workspaceId, packInstallations.id],
17044
- name: "automation_sources_pack_installation_fk"
17045
17056
  }).onDelete("cascade")
17046
17057
  })
17047
17058
  );
@@ -17073,8 +17084,6 @@ var automationTriggers = pgTable21(
17073
17084
  name: text21("name").notNull(),
17074
17085
  status: text21("status").notNull().default("active"),
17075
17086
  currentRevision: integer19("current_revision").notNull().default(1),
17076
- packInstallationId: uuid21("pack_installation_id"),
17077
- packTemplateId: text21("pack_template_id"),
17078
17087
  createdBySubjectId: text21("created_by_subject_id").notNull(),
17079
17088
  createdAt: timestamp21("created_at", { withTimezone: true }).notNull().defaultNow(),
17080
17089
  updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow()
@@ -17098,11 +17107,6 @@ var automationTriggers = pgTable21(
17098
17107
  foreignColumns: [automationSources.workspaceId, automationSources.id],
17099
17108
  name: "automation_triggers_source_fk"
17100
17109
  }).onDelete("cascade"),
17101
- packInstallation: foreignKey({
17102
- columns: [table.workspaceId, table.packInstallationId],
17103
- foreignColumns: [packInstallations.workspaceId, packInstallations.id],
17104
- name: "automation_triggers_pack_installation_fk"
17105
- }).onDelete("cascade"),
17106
17110
  workspaceAccount: foreignKey({
17107
17111
  columns: [table.workspaceId, table.accountId],
17108
17112
  foreignColumns: [workspaces.id, workspaces.accountId],
@@ -17113,9 +17117,7 @@ var automationTriggers = pgTable21(
17113
17117
  sql16`${table.status} in ('active', 'paused', 'disabled')
17114
17118
  and ${table.currentRevision} > 0
17115
17119
  and octet_length(${table.name}) between 1 and 512
17116
- and octet_length(${table.createdBySubjectId}) between 1 and 4096
17117
- and ((${table.packInstallationId} is null and ${table.packTemplateId} is null)
17118
- or (${table.packInstallationId} is not null and octet_length(${table.packTemplateId}) between 1 and 128))`
17120
+ and octet_length(${table.createdBySubjectId}) between 1 and 4096`
17119
17121
  )
17120
17122
  })
17121
17123
  );
@@ -17334,24 +17336,6 @@ var automationRunEventLinks = pgTable21(
17334
17336
  }).onDelete("cascade")
17335
17337
  })
17336
17338
  );
17337
- var workspacePacks = pgTable21(
17338
- "workspace_packs",
17339
- {
17340
- id: uuid21("id").primaryKey().defaultRandom(),
17341
- accountId: uuid21("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
17342
- workspaceId: uuid21("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
17343
- packId: text21("pack_id").notNull(),
17344
- manifest: jsonb17("manifest").$type().notNull(),
17345
- createdAt: timestamp21("created_at", { withTimezone: true }).notNull().defaultNow(),
17346
- updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow()
17347
- },
17348
- (table) => ({
17349
- workspacePack: uniqueIndex21("workspace_packs_workspace_pack_idx").on(
17350
- table.workspaceId,
17351
- table.packId
17352
- )
17353
- })
17354
- );
17355
17339
  var importBatches = pgTable21(
17356
17340
  "import_batches",
17357
17341
  {
@@ -18498,6 +18482,8 @@ export {
18498
18482
  interactionResourceOperations,
18499
18483
  interactionOperations,
18500
18484
  managedAccounts,
18485
+ organizationIntegrationPolicies,
18486
+ organizationIntegrationPolicyOperations,
18501
18487
  workspaces,
18502
18488
  workspaceArtifacts,
18503
18489
  workspaceArtifactUploads,
@@ -18688,8 +18674,6 @@ export {
18688
18674
  billingCustomers,
18689
18675
  stripeWebhookEvents,
18690
18676
  auditEvents,
18691
- packInstallations,
18692
- packInstallationComponents,
18693
18677
  automationSources,
18694
18678
  automationWebhookEndpoints,
18695
18679
  automationTriggers,
@@ -18697,7 +18681,6 @@ export {
18697
18681
  automationTriggerEvents,
18698
18682
  automationRuns,
18699
18683
  automationRunEventLinks,
18700
- workspacePacks,
18701
18684
  importBatches,
18702
18685
  capabilityCatalogItems,
18703
18686
  capabilityInstallations,
@@ -18731,4 +18714,4 @@ export {
18731
18714
  feedbackSubmissions,
18732
18715
  schema_exports
18733
18716
  };
18734
- //# sourceMappingURL=chunk-F73UKJY6.js.map
18717
+ //# sourceMappingURL=chunk-MN5PZMEK.js.map