@opengeni/db 0.4.1 → 0.6.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.
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Cloudgeni-ai
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -13,6 +13,7 @@ __export(schema_exports, {
13
13
  capabilityInstallations: () => capabilityInstallations,
14
14
  codexRotationSettings: () => codexRotationSettings,
15
15
  codexSubscriptionCredentials: () => codexSubscriptionCredentials,
16
+ connections: () => connections,
16
17
  creditLedgerEntries: () => creditLedgerEntries,
17
18
  deviceEnrollmentRequests: () => deviceEnrollmentRequests,
18
19
  deviceEnrollmentStatusValues: () => deviceEnrollmentStatusValues,
@@ -26,6 +27,10 @@ __export(schema_exports, {
26
27
  fileUploads: () => fileUploads,
27
28
  files: () => files,
28
29
  githubInstallations: () => githubInstallations,
30
+ importBatches: () => importBatches,
31
+ integrationOauthClients: () => integrationOauthClients,
32
+ integrationOauthStateNonces: () => integrationOauthStateNonces,
33
+ knowledgeMemories: () => knowledgeMemories,
29
34
  machineMetricsLatest: () => machineMetricsLatest,
30
35
  machineMetricsSeries: () => machineMetricsSeries,
31
36
  managedAccounts: () => managedAccounts,
@@ -211,6 +216,58 @@ var codexSubscriptionCredentials = pgTable("codex_subscription_credentials", {
211
216
  wsAccount: uniqueIndex("codex_subscription_credentials_ws_account_idx").on(table.workspaceId, table.chatgptAccountId).where(sql`${table.chatgptAccountId} is not null`),
212
217
  workspace: index("codex_subscription_credentials_workspace_lookup_idx").on(table.workspaceId)
213
218
  }));
219
+ var connections = pgTable("connections", {
220
+ id: uuid("id").primaryKey().defaultRandom(),
221
+ accountId: uuid("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
222
+ workspaceId: uuid("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
223
+ subjectId: text("subject_id"),
224
+ providerDomain: text("provider_domain").notNull(),
225
+ kind: text("kind").notNull(),
226
+ status: text("status").notNull().default("active"),
227
+ credentialEncrypted: text("credential_encrypted").notNull(),
228
+ grantedScopes: jsonb("granted_scopes").$type().notNull().default([]),
229
+ expiresAt: timestamp("expires_at", { withTimezone: true }),
230
+ lastRefreshAt: timestamp("last_refresh_at", { withTimezone: true }),
231
+ lastUsedAt: timestamp("last_used_at", { withTimezone: true }),
232
+ lastError: text("last_error"),
233
+ version: integer("version").notNull().default(1),
234
+ metadata: jsonb("metadata").$type().notNull().default({}),
235
+ createdBySubjectId: text("created_by_subject_id"),
236
+ updatedBySubjectId: text("updated_by_subject_id"),
237
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
238
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
239
+ }, (table) => ({
240
+ workspaceProviderStatus: index("connections_workspace_provider_status_idx").on(table.workspaceId, table.providerDomain, table.status),
241
+ workspaceSubjectProvider: index("connections_workspace_subject_provider_idx").on(table.workspaceId, table.subjectId, table.providerDomain),
242
+ workspaceKind: index("connections_workspace_kind_idx").on(table.workspaceId, table.kind),
243
+ workspaceExpires: index("connections_workspace_expires_idx").on(table.workspaceId, table.expiresAt)
244
+ }));
245
+ var integrationOauthClients = pgTable("integration_oauth_clients", {
246
+ id: uuid("id").primaryKey().defaultRandom(),
247
+ issuer: text("issuer").notNull(),
248
+ authorizationServer: text("authorization_server").notNull(),
249
+ clientId: text("client_id").notNull(),
250
+ clientSecretEncrypted: text("client_secret_encrypted"),
251
+ tokenEndpointAuthMethod: text("token_endpoint_auth_method").notNull().default("none"),
252
+ metadata: jsonb("metadata").$type().notNull().default({}),
253
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
254
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
255
+ }, (table) => ({
256
+ issuer: uniqueIndex("integration_oauth_clients_issuer_idx").on(table.issuer),
257
+ authorizationServer: index("integration_oauth_clients_as_idx").on(table.authorizationServer)
258
+ }));
259
+ var integrationOauthStateNonces = pgTable("integration_oauth_state_nonces", {
260
+ nonce: text("nonce").primaryKey(),
261
+ accountId: uuid("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
262
+ workspaceId: uuid("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
263
+ subjectId: text("subject_id").notNull(),
264
+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
265
+ usedAt: timestamp("used_at", { withTimezone: true }).notNull().defaultNow(),
266
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
267
+ }, (table) => ({
268
+ workspace: index("integration_oauth_state_nonces_workspace_idx").on(table.workspaceId),
269
+ expires: index("integration_oauth_state_nonces_expires_idx").on(table.expiresAt)
270
+ }));
214
271
  var codexRotationSettings = pgTable("codex_rotation_settings", {
215
272
  id: uuid("id").primaryKey().defaultRandom(),
216
273
  accountId: uuid("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
@@ -346,6 +403,9 @@ var sessionMcpServers = pgTable("session_mcp_servers", {
346
403
  allowedTools: jsonb("allowed_tools").$type(),
347
404
  timeoutMs: integer("timeout_ms"),
348
405
  cacheToolsList: boolean("cache_tools_list").notNull().default(false),
406
+ // Human-approval policy: `true` = every tool requires approval, a string[] of
407
+ // UNPREFIXED tool names = only those require it, null/absent = auto-run.
408
+ requireApproval: jsonb("require_approval").$type(),
349
409
  // Map of header name -> AES-GCM ciphertext. Values are decrypted only by the
350
410
  // worker's run-preparation path and never returned by API helpers.
351
411
  headersEncrypted: jsonb("headers_encrypted").$type().notNull().default({}),
@@ -412,11 +472,22 @@ var documents = pgTable("documents", {
412
472
  parser: text("parser").notNull().default("liteparse"),
413
473
  chunkCount: integer("chunk_count").notNull().default(0),
414
474
  error: text("error"),
475
+ sourceKind: text("source_kind").notNull().default("manual_upload"),
476
+ sourceUri: text("source_uri"),
477
+ sourceExternalId: text("source_external_id"),
478
+ sourceTitle: text("source_title"),
479
+ sourceAuthor: text("source_author"),
480
+ sourceCreatedAt: timestamp("source_created_at", { withTimezone: true }),
481
+ sourceUpdatedAt: timestamp("source_updated_at", { withTimezone: true }),
482
+ sourceVersion: text("source_version"),
483
+ aclTags: jsonb("acl_tags").$type().notNull().default([]),
415
484
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
416
485
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
417
486
  }, (table) => ({
418
487
  baseFile: uniqueIndex("documents_workspace_base_file_idx").on(table.workspaceId, table.baseId, table.fileId),
419
- baseStatus: index("documents_workspace_base_status_idx").on(table.workspaceId, table.baseId, table.status)
488
+ baseStatus: index("documents_workspace_base_status_idx").on(table.workspaceId, table.baseId, table.status),
489
+ sourceKind: index("documents_workspace_source_kind_idx").on(table.workspaceId, table.sourceKind),
490
+ sourceExternalId: index("documents_workspace_source_external_id_idx").on(table.workspaceId, table.sourceExternalId)
420
491
  }));
421
492
  var documentChunks = pgTable("document_chunks", {
422
493
  id: uuid("id").primaryKey().defaultRandom(),
@@ -435,6 +506,28 @@ var documentChunks = pgTable("document_chunks", {
435
506
  documentIndex: uniqueIndex("document_chunks_workspace_document_index_idx").on(table.workspaceId, table.documentId, table.chunkIndex),
436
507
  base: index("document_chunks_workspace_base_idx").on(table.workspaceId, table.baseId)
437
508
  }));
509
+ var knowledgeMemories = pgTable("knowledge_memories", {
510
+ id: uuid("id").primaryKey().defaultRandom(),
511
+ accountId: uuid("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
512
+ workspaceId: uuid("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
513
+ status: text("status").notNull().default("proposed"),
514
+ kind: text("kind").notNull().default("semantic"),
515
+ scope: text("scope").notNull().default("workspace"),
516
+ text: text("text").notNull(),
517
+ sourceRefs: jsonb("source_refs").$type().notNull().default([]),
518
+ confidence: integer("confidence").notNull().default(50),
519
+ metadata: jsonb("metadata").$type().notNull().default({}),
520
+ createdBySessionId: uuid("created_by_session_id").references(() => sessions.id, { onDelete: "set null" }),
521
+ reviewedBy: text("reviewed_by"),
522
+ reviewedAt: timestamp("reviewed_at", { withTimezone: true }),
523
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
524
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
525
+ }, (table) => ({
526
+ workspaceStatus: index("knowledge_memories_workspace_status_idx").on(table.workspaceId, table.status, table.updatedAt),
527
+ workspaceKind: index("knowledge_memories_workspace_kind_idx").on(table.workspaceId, table.kind),
528
+ workspaceScope: index("knowledge_memories_workspace_scope_idx").on(table.workspaceId, table.scope),
529
+ createdBySession: index("knowledge_memories_workspace_created_by_session_idx").on(table.workspaceId, table.createdBySessionId)
530
+ }));
438
531
  var sessionTurns = pgTable("session_turns", {
439
532
  id: uuid("id").primaryKey().defaultRandom(),
440
533
  accountId: uuid("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
@@ -455,6 +548,10 @@ var sessionTurns = pgTable("session_turns", {
455
548
  // constrained to the SandboxOs enum (or NULL) in migration 0018.
456
549
  sandboxOs: text("sandbox_os"),
457
550
  metadata: jsonb("metadata").$type().notNull().default({}),
551
+ // Atomic per-turn toolspace call budget counter (migration 0043). Incremented
552
+ // by a single conditional UPDATE at tools/call time; the row lock serializes
553
+ // concurrent reservations so exactly `toolspaceMaxCallsPerTurn` succeed.
554
+ toolspaceCallCount: integer("toolspace_call_count").notNull().default(0),
458
555
  startedAt: timestamp("started_at", { withTimezone: true }),
459
556
  finishedAt: timestamp("finished_at", { withTimezone: true }),
460
557
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
@@ -712,6 +809,14 @@ var enrollments = pgTable("enrollments", {
712
809
  pubkey: text("pubkey").notNull(),
713
810
  exposure: text("exposure", { enum: enrollmentExposureValues }).notNull().default("whole-machine"),
714
811
  hasDisplay: boolean("has_display").notNull().default(false),
812
+ // When the machine has a display it CANNOT capture (macOS Screen Recording / TCC
813
+ // not granted), the agent reports has_display=false AND a human, actionable reason
814
+ // here (e.g. "grant Screen Recording in System Settings"). NULL means capture is
815
+ // permitted (has_display=true) or the machine is genuinely headless — the reason
816
+ // distinguishes "display present but capture not granted" from plain "no display"
817
+ // so the Machines dashboard / VM picker can surface the specific hint. Refreshed
818
+ // from every connect Hello alongside has_display.
819
+ desktopUnavailableReason: text("desktop_unavailable_reason"),
715
820
  allowScreenControl: boolean("allow_screen_control").notNull().default(false),
716
821
  status: text("status", { enum: enrollmentStatusValues }).notNull().default("active"),
717
822
  os: text("os", { enum: enrollmentOsValues }).notNull().default("linux"),
@@ -986,10 +1091,28 @@ var workspacePacks = pgTable("workspace_packs", {
986
1091
  }, (table) => ({
987
1092
  workspacePack: uniqueIndex("workspace_packs_workspace_pack_idx").on(table.workspaceId, table.packId)
988
1093
  }));
1094
+ var importBatches = pgTable("import_batches", {
1095
+ id: uuid("id").primaryKey().defaultRandom(),
1096
+ source: text("source").notNull(),
1097
+ snapshotDate: timestamp("snapshot_date", { withTimezone: true }).notNull(),
1098
+ snapshotRef: text("snapshot_ref"),
1099
+ attributionNote: text("attribution_note").notNull(),
1100
+ importedCount: integer("imported_count").notNull().default(0),
1101
+ skippedCount: integer("skipped_count").notNull().default(0),
1102
+ quarantinedCount: integer("quarantined_count").notNull().default(0),
1103
+ logoFailureCount: integer("logo_failure_count").notNull().default(0),
1104
+ staleCount: integer("stale_count").notNull().default(0),
1105
+ details: jsonb("details").$type().notNull().default({}),
1106
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
1107
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
1108
+ }, (table) => ({
1109
+ sourceSnapshot: index("import_batches_source_snapshot_idx").on(table.source, table.snapshotDate),
1110
+ createdAt: index("import_batches_created_at_idx").on(table.createdAt)
1111
+ }));
989
1112
  var capabilityCatalogItems = pgTable("capability_catalog_items", {
990
1113
  id: text("id").notNull(),
991
- accountId: uuid("account_id").notNull().references(() => managedAccounts.id, { onDelete: "cascade" }),
992
- workspaceId: uuid("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
1114
+ accountId: uuid("account_id").references(() => managedAccounts.id, { onDelete: "cascade" }),
1115
+ workspaceId: uuid("workspace_id").references(() => workspaces.id, { onDelete: "cascade" }),
993
1116
  kind: text("kind").notNull(),
994
1117
  source: text("source").notNull().default("manual"),
995
1118
  name: text("name").notNull(),
@@ -1000,14 +1123,31 @@ var capabilityCatalogItems = pgTable("capability_catalog_items", {
1000
1123
  endpointUrl: text("endpoint_url"),
1001
1124
  installUrl: text("install_url"),
1002
1125
  authModel: text("auth_model"),
1126
+ providerDomain: text("provider_domain"),
1127
+ surfaceType: text("surface_type"),
1128
+ transport: text("transport"),
1129
+ mcpUrl: text("mcp_url"),
1130
+ authKind: text("auth_kind"),
1131
+ credentialFacts: jsonb("credential_facts").$type().notNull().default([]),
1132
+ tier: text("tier"),
1133
+ provenance: text("provenance"),
1134
+ logoAssetPath: text("logo_asset_path"),
1135
+ importBatchId: uuid("import_batch_id").references(() => importBatches.id, { onDelete: "set null" }),
1136
+ stale: boolean("stale").notNull().default(false),
1137
+ staleAt: timestamp("stale_at", { withTimezone: true }),
1003
1138
  metadata: jsonb("metadata").$type().notNull().default({}),
1004
1139
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
1005
1140
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
1006
1141
  }, (table) => ({
1007
1142
  workspaceCapability: uniqueIndex("capability_catalog_items_workspace_capability_idx").on(table.workspaceId, table.id),
1143
+ registrySurface: uniqueIndex("capability_catalog_items_registry_surface_idx").on(table.source, table.providerDomain, table.mcpUrl),
1144
+ globalCapability: uniqueIndex("capability_catalog_items_global_capability_idx").on(table.id).where(sql`${table.workspaceId} is null`),
1008
1145
  kind: index("capability_catalog_items_workspace_kind_idx").on(table.workspaceId, table.kind),
1009
1146
  category: index("capability_catalog_items_workspace_category_idx").on(table.workspaceId, table.category),
1010
- source: index("capability_catalog_items_workspace_source_idx").on(table.workspaceId, table.source)
1147
+ source: index("capability_catalog_items_workspace_source_idx").on(table.workspaceId, table.source),
1148
+ providerDomain: index("capability_catalog_items_provider_domain_idx").on(table.providerDomain),
1149
+ importBatch: index("capability_catalog_items_import_batch_idx").on(table.importBatchId),
1150
+ stale: index("capability_catalog_items_source_stale_idx").on(table.source, table.stale)
1011
1151
  }));
1012
1152
  var capabilityInstallations = pgTable("capability_installations", {
1013
1153
  id: uuid("id").primaryKey().defaultRandom(),
@@ -1072,6 +1212,9 @@ export {
1072
1212
  workspaceEnvironments,
1073
1213
  workspaceEnvironmentVariables,
1074
1214
  codexSubscriptionCredentials,
1215
+ connections,
1216
+ integrationOauthClients,
1217
+ integrationOauthStateNonces,
1075
1218
  codexRotationSettings,
1076
1219
  sessions,
1077
1220
  sessionMcpServers,
@@ -1080,6 +1223,7 @@ export {
1080
1223
  documentBases,
1081
1224
  documents,
1082
1225
  documentChunks,
1226
+ knowledgeMemories,
1083
1227
  sessionTurns,
1084
1228
  sessionGoals,
1085
1229
  sessionEvents,
@@ -1114,10 +1258,11 @@ export {
1114
1258
  auditEvents,
1115
1259
  packInstallations,
1116
1260
  workspacePacks,
1261
+ importBatches,
1117
1262
  capabilityCatalogItems,
1118
1263
  capabilityInstallations,
1119
1264
  socialConnections,
1120
1265
  socialPosts,
1121
1266
  schema_exports
1122
1267
  };
1123
- //# sourceMappingURL=chunk-T2U4H4Z2.js.map
1268
+ //# sourceMappingURL=chunk-ZIUCA2IO.js.map