@opengeni/db 0.28.9 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/attached-browser-devices.d.ts +42 -0
  2. package/dist/attempt-tool-catalogs.d.ts +16 -0
  3. package/dist/browser-auth.d.ts +91 -0
  4. package/dist/browser-identities.d.ts +128 -0
  5. package/dist/browser-sessions.d.ts +272 -0
  6. package/dist/browser-state-artifacts.d.ts +17 -0
  7. package/dist/capability-components.d.ts +37 -0
  8. package/dist/capability-integrations.d.ts +192 -0
  9. package/dist/chunk-F5FT7BEZ.js +3535 -0
  10. package/dist/chunk-F5FT7BEZ.js.map +1 -0
  11. package/dist/chunk-ISI2TIUG.js +639 -0
  12. package/dist/chunk-ISI2TIUG.js.map +1 -0
  13. package/dist/chunk-MWDVXQOL.js +11639 -0
  14. package/dist/chunk-MWDVXQOL.js.map +1 -0
  15. package/dist/chunk-NBE6CHRI.js +955 -0
  16. package/dist/chunk-NBE6CHRI.js.map +1 -0
  17. package/dist/{chunk-VHBFHMPC.js → chunk-YHZXQ7HP.js} +754 -11
  18. package/dist/chunk-YHZXQ7HP.js.map +1 -0
  19. package/dist/codemode-operations.d.ts +117 -0
  20. package/dist/codex-token-resolver.d.ts +2 -2
  21. package/dist/company-profile-schema.d.ts +798 -0
  22. package/dist/company-profile.d.ts +268 -0
  23. package/dist/computer-sessions.d.ts +109 -0
  24. package/dist/connection-token-resolver.d.ts +9 -4
  25. package/dist/database.d.ts +52 -3
  26. package/dist/editable-artifact-durable-export.d.ts +153 -0
  27. package/dist/editable-artifact-durable-export.js +788 -0
  28. package/dist/editable-artifact-durable-export.js.map +1 -0
  29. package/dist/editable-artifact-materialization.d.ts +123 -0
  30. package/dist/editable-artifacts-schema.d.ts +4152 -0
  31. package/dist/editable-artifacts.d.ts +610 -0
  32. package/dist/editable-artifacts.js +26 -0
  33. package/dist/editable-artifacts.js.map +1 -0
  34. package/dist/generated-images.d.ts +139 -0
  35. package/dist/index.d.ts +698 -111
  36. package/dist/index.js +27573 -10322
  37. package/dist/index.js.map +1 -1
  38. package/dist/insights.d.ts +51 -4
  39. package/dist/integration-bindings.d.ts +70 -0
  40. package/dist/integration-features.d.ts +99 -0
  41. package/dist/interaction-revisions.d.ts +3 -0
  42. package/dist/interaction-schema.d.ts +5372 -0
  43. package/dist/knowledge-source-sync-schema.d.ts +1679 -0
  44. package/dist/knowledge-source-sync.d.ts +274 -0
  45. package/dist/memory-governance.d.ts +2 -2
  46. package/dist/memory-slack-delivery.d.ts +101 -0
  47. package/dist/new-session-drafts.d.ts +2 -2
  48. package/dist/pack-components.d.ts +76 -0
  49. package/dist/pack-installations.d.ts +86 -0
  50. package/dist/persistence-errors.d.ts +3 -3
  51. package/dist/plugin-packages.d.ts +126 -0
  52. package/dist/preference-registry.d.ts +1 -1
  53. package/dist/provision-roles.d.ts +9 -1
  54. package/dist/provision-roles.js +1 -1
  55. package/dist/runtime-posture.d.ts +18 -6
  56. package/dist/schema.d.ts +18342 -9099
  57. package/dist/schema.js +165 -1
  58. package/dist/scoped-knowledge.d.ts +97 -1
  59. package/dist/session-control.d.ts +4 -4
  60. package/dist/session-queue-commands.d.ts +19 -11
  61. package/dist/session-realtime-context.d.ts +2 -2
  62. package/dist/session-realtime-ledger.d.ts +4 -4
  63. package/dist/session-realtime-mirror.d.ts +2 -2
  64. package/dist/session-realtime-state.d.ts +1 -1
  65. package/dist/session-realtime-terminal.d.ts +1 -1
  66. package/dist/session-realtime.d.ts +7 -7
  67. package/dist/session-tool-call-settlement.d.ts +1 -1
  68. package/dist/slack-user-link-access.d.ts +54 -0
  69. package/dist/transcription-recordings.d.ts +2 -2
  70. package/dist/turn-initiator.d.ts +2 -2
  71. package/dist/video-generation.d.ts +216 -0
  72. package/dist/video-generation.js +66 -0
  73. package/dist/video-generation.js.map +1 -0
  74. package/dist/workspace-artifacts.d.ts +1 -1
  75. package/dist/workspace-instruction-policies.d.ts +1 -1
  76. package/dist/workspace-learning-policy-schema.d.ts +932 -0
  77. package/dist/workspace-learning-policy.d.ts +161 -0
  78. package/drizzle/0183_model_call_provider_cost_estimates.sql +39 -0
  79. package/drizzle/0184_sandbox_drain_teardown_fence.sql +682 -0
  80. package/drizzle/0185_temporal_schedule_cleanup_outbox.sql +168 -0
  81. package/drizzle/0186_sandbox_capture_provider_contract.sql +400 -0
  82. package/drizzle/0187_generated_image_artifacts.sql +173 -0
  83. package/drizzle/0188_image_generation_retention_failure.sql +25 -0
  84. package/drizzle/0189_retained_session_image_formats.sql +13 -0
  85. package/drizzle/0190_timeline_annotations.sql +31 -0
  86. package/drizzle/0191_editable_artifact_engine.sql +3853 -0
  87. package/drizzle/0192_editable_artifact_live_tickets.sql +338 -0
  88. package/drizzle/0193_editable_artifact_authorization.sql +190 -0
  89. package/drizzle/0194_editable_artifact_durable_exports.sql +160 -0
  90. package/drizzle/0195_editable_artifact_import_authorization.sql +203 -0
  91. package/drizzle/0196_rig_provider_images.sql +152 -0
  92. package/drizzle/0197_knowledge_source_sync_schedules.sql +523 -0
  93. package/drizzle/0198_memory_slack_publication_delivery.sql +393 -0
  94. package/drizzle/0199_workspace_learning_policy.sql +980 -0
  95. package/drizzle/0201_company_profile_authority.sql +849 -0
  96. package/drizzle/0202_document_index_checkpoints.sql +85 -0
  97. package/drizzle/0203_durable_video_generation.sql +353 -0
  98. package/drizzle/0204_video_generation_funding.sql +44 -0
  99. package/drizzle/0205_attempt_tool_catalogs.sql +230 -0
  100. package/drizzle/0206_browser_sessions.sql +646 -0
  101. package/drizzle/0207_browser_identities.sql +379 -0
  102. package/drizzle/0208_attached_browser_devices.sql +165 -0
  103. package/drizzle/0209_computer_sessions.sql +575 -0
  104. package/drizzle/0210_browser_auth_network_interventions.sql +441 -0
  105. package/drizzle/0211_editable_artifact_session_links.sql +58 -0
  106. package/drizzle/0212_slack_installation_bindings.sql +348 -0
  107. package/drizzle/0213_slack_user_link_access_requests.sql +177 -0
  108. package/drizzle/0214_session_activity_commit_gate.sql +262 -0
  109. package/drizzle/0215_capabilities_platform.sql +980 -0
  110. package/drizzle/0216_pack_component_ownership.sql +235 -0
  111. package/drizzle/0217_capability_definition_delete_authority.sql +32 -0
  112. package/package.json +18 -5
  113. package/src/attached-browser-devices.ts +371 -0
  114. package/src/attempt-tool-catalogs.ts +131 -0
  115. package/src/browser-auth.ts +1896 -0
  116. package/src/browser-identities.ts +1168 -0
  117. package/src/browser-sessions.ts +2005 -0
  118. package/src/browser-state-artifacts.ts +59 -0
  119. package/src/capability-components.ts +166 -0
  120. package/src/capability-integrations.ts +1663 -0
  121. package/src/codemode-operations.ts +674 -0
  122. package/src/company-profile-schema.ts +143 -0
  123. package/src/company-profile.ts +968 -0
  124. package/src/computer-sessions.ts +1130 -0
  125. package/src/connection-token-resolver.ts +270 -25
  126. package/src/database.ts +427 -23
  127. package/src/editable-artifact-durable-export.ts +1201 -0
  128. package/src/editable-artifact-materialization.ts +893 -0
  129. package/src/editable-artifacts-schema.ts +879 -0
  130. package/src/editable-artifacts.ts +5404 -0
  131. package/src/generated-images.ts +740 -0
  132. package/src/index.ts +5917 -1182
  133. package/src/insights.ts +160 -13
  134. package/src/integration-bindings.ts +455 -0
  135. package/src/integration-features.ts +859 -0
  136. package/src/interaction-revisions.ts +40 -0
  137. package/src/interaction-schema.ts +1303 -0
  138. package/src/knowledge-source-sync-schema.ts +192 -0
  139. package/src/knowledge-source-sync.ts +1922 -0
  140. package/src/memory-slack-delivery.ts +801 -0
  141. package/src/pack-components.ts +954 -0
  142. package/src/pack-installations.ts +929 -0
  143. package/src/persistence-errors.ts +4 -7
  144. package/src/plugin-packages.ts +1186 -0
  145. package/src/provision-roles.ts +302 -1
  146. package/src/runtime-posture-cli.ts +9 -0
  147. package/src/runtime-posture.ts +508 -5
  148. package/src/schema.ts +5117 -3119
  149. package/src/scoped-knowledge-schema.ts +1 -1
  150. package/src/scoped-knowledge.ts +655 -3
  151. package/src/session-control.ts +8 -5
  152. package/src/session-queue-commands.ts +187 -14
  153. package/src/session-realtime-context.ts +2 -2
  154. package/src/session-realtime-ledger.ts +3 -3
  155. package/src/session-realtime.ts +7 -7
  156. package/src/session-tool-call-settlement.ts +9 -0
  157. package/src/slack-user-link-access.ts +702 -0
  158. package/src/video-generation.ts +1452 -0
  159. package/src/workspace-learning-policy-schema.ts +139 -0
  160. package/src/workspace-learning-policy.ts +595 -0
  161. package/dist/chunk-P6CUHXQZ.js +0 -7248
  162. package/dist/chunk-P6CUHXQZ.js.map +0 -1
  163. package/dist/chunk-VHBFHMPC.js.map +0 -1
@@ -0,0 +1,192 @@
1
+ import {
2
+ bigint,
3
+ boolean,
4
+ index,
5
+ integer,
6
+ jsonb,
7
+ pgTable,
8
+ text,
9
+ timestamp,
10
+ uniqueIndex,
11
+ uuid,
12
+ } from "drizzle-orm/pg-core";
13
+
14
+ export const knowledgeSourceSyncStates = pgTable(
15
+ "knowledge_source_sync_states",
16
+ {
17
+ sourceId: uuid("source_id").primaryKey(),
18
+ accountId: uuid("account_id").notNull(),
19
+ workspaceId: uuid("workspace_id").notNull(),
20
+ scheduledTaskId: uuid("scheduled_task_id").notNull(),
21
+ sourceSyncGeneration: bigint("source_sync_generation", { mode: "number" }).notNull(),
22
+ sourceLifecycleGeneration: bigint("source_lifecycle_generation", { mode: "number" }).notNull(),
23
+ sourceConfigGeneration: bigint("source_config_generation", { mode: "number" }).notNull(),
24
+ controlWorkspaceId: uuid("control_workspace_id").notNull(),
25
+ providerCoordinationKey: text("provider_coordination_key").notNull(),
26
+ connectionId: uuid("connection_id").notNull(),
27
+ connectionVersion: bigint("connection_version", { mode: "number" }).notNull(),
28
+ connectionProviderDomain: text("connection_provider_domain").notNull(),
29
+ connectionKind: text("connection_kind").notNull(),
30
+ connectionOwnerSubjectId: text("connection_owner_subject_id").notNull(),
31
+ initiatingSubjectId: text("initiating_subject_id").notNull(),
32
+ destination: jsonb("destination").$type<Record<string, unknown>>().notNull(),
33
+ executionCheckpoint: jsonb("execution_checkpoint").$type<Record<string, unknown>>(),
34
+ executionCheckpointGeneration: bigint("execution_checkpoint_generation", {
35
+ mode: "number",
36
+ })
37
+ .notNull()
38
+ .default(0),
39
+ activeScanGeneration: bigint("active_scan_generation", { mode: "number" }).notNull().default(0),
40
+ providerCursor: jsonb("provider_cursor").$type<Record<string, unknown>>(),
41
+ wakeRevision: bigint("wake_revision", { mode: "number" }).notNull().default(0),
42
+ pendingWakeCount: integer("pending_wake_count").notNull().default(0),
43
+ leaseId: uuid("lease_id"),
44
+ leaseUntil: timestamp("lease_until", { withTimezone: true }),
45
+ bufferedWake: boolean("buffered_wake").notNull().default(false),
46
+ bufferedScheduledTaskRunId: uuid("buffered_scheduled_task_run_id"),
47
+ reconnectRequired: boolean("reconnect_required").notNull().default(false),
48
+ lastSuccessAt: timestamp("last_success_at", { withTimezone: true }),
49
+ lastCompletedAt: timestamp("last_completed_at", { withTimezone: true }),
50
+ lastSummary: jsonb("last_summary").$type<Record<string, unknown>>(),
51
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
52
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
53
+ },
54
+ (table) => ({
55
+ task: uniqueIndex("knowledge_source_sync_states_task_uq").on(table.scheduledTaskId),
56
+ due: index("knowledge_source_sync_states_due_idx").on(
57
+ table.workspaceId,
58
+ table.bufferedWake,
59
+ table.leaseUntil,
60
+ table.updatedAt,
61
+ ),
62
+ }),
63
+ );
64
+
65
+ export const knowledgeSourceSyncObjectObservations = pgTable(
66
+ "knowledge_source_sync_object_observations",
67
+ {
68
+ sourceId: uuid("source_id").notNull(),
69
+ externalObjectId: text("external_object_id").notNull(),
70
+ accountId: uuid("account_id").notNull(),
71
+ workspaceId: uuid("workspace_id").notNull(),
72
+ scheduledTaskRunId: uuid("scheduled_task_run_id"),
73
+ scanGeneration: bigint("scan_generation", { mode: "number" }).notNull(),
74
+ providerRevision: text("provider_revision"),
75
+ metadataHash: text("metadata_hash"),
76
+ observedAt: timestamp("observed_at", { withTimezone: true }).notNull().defaultNow(),
77
+ },
78
+ (table) => ({
79
+ identity: uniqueIndex("knowledge_source_sync_object_observations_identity_uq").on(
80
+ table.sourceId,
81
+ table.externalObjectId,
82
+ ),
83
+ scan: index("knowledge_source_sync_object_observations_scan_idx").on(
84
+ table.workspaceId,
85
+ table.sourceId,
86
+ table.scanGeneration,
87
+ ),
88
+ }),
89
+ );
90
+
91
+ export const knowledgeSourceSyncItemOutcomes = pgTable(
92
+ "knowledge_source_sync_item_outcomes",
93
+ {
94
+ id: uuid("id").primaryKey().defaultRandom(),
95
+ accountId: uuid("account_id").notNull(),
96
+ workspaceId: uuid("workspace_id").notNull(),
97
+ scheduledTaskRunId: uuid("scheduled_task_run_id").notNull(),
98
+ knowledgeSyncRunId: uuid("knowledge_sync_run_id"),
99
+ sourceId: uuid("source_id").notNull(),
100
+ sourceConfigGeneration: bigint("source_config_generation", { mode: "number" }).notNull(),
101
+ sourceLifecycleGeneration: bigint("source_lifecycle_generation", { mode: "number" }).notNull(),
102
+ externalObjectId: text("external_object_id").notNull(),
103
+ providerRevision: text("provider_revision"),
104
+ metadataHash: text("metadata_hash"),
105
+ aclEligibility: text("acl_eligibility").notNull().default("pending"),
106
+ aclEvidence: jsonb("acl_evidence").$type<Record<string, unknown>>(),
107
+ indexObligationId: uuid("index_obligation_id"),
108
+ outcome: text("outcome").notNull(),
109
+ reasonCode: text("reason_code"),
110
+ detail: text("detail"),
111
+ contentSha256: text("content_sha256"),
112
+ sizeBytes: bigint("size_bytes", { mode: "number" }),
113
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
114
+ },
115
+ (table) => ({
116
+ identity: uniqueIndex("knowledge_source_sync_item_outcomes_identity_uq").on(
117
+ table.scheduledTaskRunId,
118
+ table.externalObjectId,
119
+ ),
120
+ run: index("knowledge_source_sync_item_outcomes_run_idx").on(
121
+ table.workspaceId,
122
+ table.scheduledTaskRunId,
123
+ table.createdAt,
124
+ ),
125
+ }),
126
+ );
127
+
128
+ export const knowledgeSourceSyncWakes = pgTable(
129
+ "knowledge_source_sync_wakes",
130
+ {
131
+ id: uuid("id").primaryKey().defaultRandom(),
132
+ accountId: uuid("account_id").notNull(),
133
+ workspaceId: uuid("workspace_id").notNull(),
134
+ sourceId: uuid("source_id").notNull(),
135
+ scheduledTaskId: uuid("scheduled_task_id").notNull(),
136
+ scheduledTaskRunId: uuid("scheduled_task_run_id").notNull(),
137
+ cause: text("cause").notNull(),
138
+ producerKey: text("producer_key").notNull(),
139
+ sourceConfigGeneration: bigint("source_config_generation", { mode: "number" }).notNull(),
140
+ sourceLifecycleGeneration: bigint("source_lifecycle_generation", { mode: "number" }).notNull(),
141
+ coalesced: boolean("coalesced").notNull().default(false),
142
+ claimedAt: timestamp("claimed_at", { withTimezone: true }),
143
+ completedAt: timestamp("completed_at", { withTimezone: true }),
144
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
145
+ },
146
+ (table) => ({
147
+ run: uniqueIndex("knowledge_source_sync_wakes_run_uq").on(table.scheduledTaskRunId),
148
+ pending: index("knowledge_source_sync_wakes_pending_idx").on(
149
+ table.workspaceId,
150
+ table.sourceId,
151
+ table.completedAt,
152
+ table.createdAt,
153
+ ),
154
+ }),
155
+ );
156
+
157
+ export const knowledgeSourceSyncIndexObligations = pgTable(
158
+ "knowledge_source_sync_index_obligations",
159
+ {
160
+ id: uuid("id").primaryKey().defaultRandom(),
161
+ accountId: uuid("account_id").notNull(),
162
+ workspaceId: uuid("workspace_id").notNull(),
163
+ scheduledTaskRunId: uuid("scheduled_task_run_id"),
164
+ sourceId: uuid("source_id").notNull(),
165
+ sourceSyncGeneration: bigint("source_sync_generation", { mode: "number" }).notNull(),
166
+ initiatingSubjectId: text("initiating_subject_id").notNull(),
167
+ externalObjectId: text("external_object_id").notNull(),
168
+ knowledgeSourceObjectId: uuid("knowledge_source_object_id").notNull(),
169
+ knowledgeDocumentVersionId: uuid("knowledge_document_version_id").notNull(),
170
+ documentId: uuid("document_id").notNull(),
171
+ sourceConfigGeneration: bigint("source_config_generation", { mode: "number" }).notNull(),
172
+ sourceLifecycleGeneration: bigint("source_lifecycle_generation", { mode: "number" }).notNull(),
173
+ objectLifecycleGeneration: bigint("object_lifecycle_generation", { mode: "number" }).notNull(),
174
+ objectVersionGeneration: bigint("object_version_generation", { mode: "number" }).notNull(),
175
+ citationLocator: jsonb("citation_locator").$type<Record<string, unknown>>().notNull(),
176
+ aclEligibility: text("acl_eligibility").notNull().default("pending"),
177
+ status: text("status").notNull().default("pending"),
178
+ failureCode: text("failure_code"),
179
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
180
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
181
+ },
182
+ (table) => ({
183
+ version: uniqueIndex("knowledge_source_sync_index_obligations_version_uq").on(
184
+ table.knowledgeDocumentVersionId,
185
+ ),
186
+ pending: index("knowledge_source_sync_index_obligations_pending_idx").on(
187
+ table.workspaceId,
188
+ table.status,
189
+ table.createdAt,
190
+ ),
191
+ }),
192
+ );