@opengeni/db 3.2.2 → 3.3.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 (81) hide show
  1. package/dist/canonical-human-identities.js +3 -3
  2. package/dist/capability-reconciliation.js +2 -2
  3. package/dist/{chunk-V2X2NK7T.js → chunk-5MPQZI43.js} +2675 -2540
  4. package/dist/{chunk-V2X2NK7T.js.map → chunk-5MPQZI43.js.map} +1 -1
  5. package/dist/{chunk-L3NT43Z5.js → chunk-7K5AVQUZ.js} +3 -3
  6. package/dist/{chunk-JYPBOJ2Y.js → chunk-AAOKWNHE.js} +4 -4
  7. package/dist/{chunk-D7LTIG33.js → chunk-B4RMLA2X.js} +2 -2
  8. package/dist/{chunk-OXO32LTK.js → chunk-CEJ3NQ3B.js} +11 -1
  9. package/dist/chunk-CEJ3NQ3B.js.map +1 -0
  10. package/dist/{chunk-AYZC65QU.js → chunk-CGSINPLW.js} +2 -2
  11. package/dist/{chunk-VCJAYIPH.js → chunk-FX2PSMGH.js} +2 -2
  12. package/dist/{chunk-HMKUJ6NI.js → chunk-HQWXEF77.js} +57 -9
  13. package/dist/chunk-HQWXEF77.js.map +1 -0
  14. package/dist/{chunk-V22DUH4C.js → chunk-HWEHZKHA.js} +5 -5
  15. package/dist/{chunk-6UU7OVUN.js → chunk-JTBJGSUZ.js} +37 -7
  16. package/dist/chunk-JTBJGSUZ.js.map +1 -0
  17. package/dist/{chunk-YH4GWEDM.js → chunk-KPC7I5WG.js} +2 -2
  18. package/dist/{chunk-XQHABE23.js → chunk-OWM6XG55.js} +4 -4
  19. package/dist/{chunk-YWHG45TK.js → chunk-PNEJVKKV.js} +6 -6
  20. package/dist/{chunk-4BAKPTPG.js → chunk-S74WULCK.js} +3 -3
  21. package/dist/{chunk-K6NT66NP.js → chunk-SDKFRIAN.js} +4 -4
  22. package/dist/{chunk-RCDMYTLP.js → chunk-UWS5DJQ6.js} +2 -2
  23. package/dist/{chunk-LRRGVHAQ.js → chunk-VUR5U5B3.js} +2 -2
  24. package/dist/{chunk-IF63BST7.js → chunk-Y4ERASEM.js} +2 -2
  25. package/dist/{chunk-VBG4TW5C.js → chunk-ZZOEKHGU.js} +2 -2
  26. package/dist/connect-attempts.js +3 -3
  27. package/dist/database.d.ts +9 -0
  28. package/dist/editable-artifact-durable-export.js +2 -2
  29. package/dist/editable-artifacts.js +3 -3
  30. package/dist/index.d.ts +93 -22
  31. package/dist/index.js +31 -19
  32. package/dist/insights-site-usage.d.ts +10 -0
  33. package/dist/managed-auth-session-sets.js +3 -3
  34. package/dist/mcp-operations.js +2 -2
  35. package/dist/migrate.js +19 -19
  36. package/dist/organization-integration-policy.js +3 -3
  37. package/dist/provision-roles.js +1 -1
  38. package/dist/retained-provider-commands.js +6 -6
  39. package/dist/schema.d.ts +102 -0
  40. package/dist/schema.js +1 -1
  41. package/dist/session-background-commands.js +5 -5
  42. package/dist/session-command-output.js +5 -5
  43. package/dist/session-event-slices.js +3 -3
  44. package/dist/session-mcp-credential-rotation.js +6 -6
  45. package/dist/session-tenancy.js +6 -6
  46. package/dist/site-publishing.d.ts +11 -0
  47. package/dist/{subscription-core-codex-4G4CCOJU.js → subscription-core-codex-HIAP7CY2.js} +6 -6
  48. package/dist/{subscription-core-codex-compat-64ACIZVP.js → subscription-core-codex-compat-IBERN7DU.js} +8 -8
  49. package/dist/video-generation.js +3 -3
  50. package/dist/workspace-tool-defaults.js +5 -5
  51. package/drizzle/0793_private_site_sessions.sql +166 -0
  52. package/drizzle/0794_site_ai_insights.sql +175 -0
  53. package/drizzle/0795_site_lifecycle_cancellation.sql +121 -0
  54. package/package.json +9 -9
  55. package/src/database.ts +44 -3
  56. package/src/index.ts +142 -11
  57. package/src/insights-site-usage.ts +37 -0
  58. package/src/provision-roles.ts +15 -0
  59. package/src/runtime-posture.ts +76 -7
  60. package/src/schema.ts +10 -0
  61. package/src/site-publishing.ts +35 -0
  62. package/dist/chunk-6UU7OVUN.js.map +0 -1
  63. package/dist/chunk-HMKUJ6NI.js.map +0 -1
  64. package/dist/chunk-OXO32LTK.js.map +0 -1
  65. /package/dist/{chunk-L3NT43Z5.js.map → chunk-7K5AVQUZ.js.map} +0 -0
  66. /package/dist/{chunk-JYPBOJ2Y.js.map → chunk-AAOKWNHE.js.map} +0 -0
  67. /package/dist/{chunk-D7LTIG33.js.map → chunk-B4RMLA2X.js.map} +0 -0
  68. /package/dist/{chunk-AYZC65QU.js.map → chunk-CGSINPLW.js.map} +0 -0
  69. /package/dist/{chunk-VCJAYIPH.js.map → chunk-FX2PSMGH.js.map} +0 -0
  70. /package/dist/{chunk-V22DUH4C.js.map → chunk-HWEHZKHA.js.map} +0 -0
  71. /package/dist/{chunk-YH4GWEDM.js.map → chunk-KPC7I5WG.js.map} +0 -0
  72. /package/dist/{chunk-XQHABE23.js.map → chunk-OWM6XG55.js.map} +0 -0
  73. /package/dist/{chunk-YWHG45TK.js.map → chunk-PNEJVKKV.js.map} +0 -0
  74. /package/dist/{chunk-4BAKPTPG.js.map → chunk-S74WULCK.js.map} +0 -0
  75. /package/dist/{chunk-K6NT66NP.js.map → chunk-SDKFRIAN.js.map} +0 -0
  76. /package/dist/{chunk-RCDMYTLP.js.map → chunk-UWS5DJQ6.js.map} +0 -0
  77. /package/dist/{chunk-LRRGVHAQ.js.map → chunk-VUR5U5B3.js.map} +0 -0
  78. /package/dist/{chunk-IF63BST7.js.map → chunk-Y4ERASEM.js.map} +0 -0
  79. /package/dist/{chunk-VBG4TW5C.js.map → chunk-ZZOEKHGU.js.map} +0 -0
  80. /package/dist/{subscription-core-codex-4G4CCOJU.js.map → subscription-core-codex-HIAP7CY2.js.map} +0 -0
  81. /package/dist/{subscription-core-codex-compat-64ACIZVP.js.map → subscription-core-codex-compat-IBERN7DU.js.map} +0 -0
@@ -7,7 +7,7 @@ import {
7
7
  withAccountRls,
8
8
  withRlsContext,
9
9
  withWorkspaceRls
10
- } from "./chunk-6UU7OVUN.js";
10
+ } from "./chunk-JTBJGSUZ.js";
11
11
  import {
12
12
  connections,
13
13
  creditDebitAllocations,
@@ -20,7 +20,7 @@ import {
20
20
  workspaceVideoGenerationPolicies,
21
21
  workspaceVideoGenerationQuotas,
22
22
  workspaces
23
- } from "./chunk-OXO32LTK.js";
23
+ } from "./chunk-CEJ3NQ3B.js";
24
24
 
25
25
  // src/video-generation.ts
26
26
  import {
@@ -1412,4 +1412,4 @@ export {
1412
1412
  mediaGenerationResultForStoredOperation,
1413
1413
  getVideoGenerationOperationSummary
1414
1414
  };
1415
- //# sourceMappingURL=chunk-L3NT43Z5.js.map
1415
+ //# sourceMappingURL=chunk-7K5AVQUZ.js.map
@@ -2,7 +2,7 @@ import {
2
2
  memoByProvider,
3
3
  subscriptionCoreConnectionKind,
4
4
  subscriptionCoreProviderId
5
- } from "./chunk-VBG4TW5C.js";
5
+ } from "./chunk-ZZOEKHGU.js";
6
6
  import {
7
7
  SUBSCRIPTION_CORE_CODEX,
8
8
  SubscriptionCoreCodexAccessLostError,
@@ -20,12 +20,12 @@ import {
20
20
  releaseSubscriptionTurnLease,
21
21
  subscriptionCoreCodexProvider,
22
22
  writeSubscriptionSessionBinding
23
- } from "./chunk-IF63BST7.js";
23
+ } from "./chunk-Y4ERASEM.js";
24
24
  import {
25
25
  rawRows,
26
26
  withRlsContext,
27
27
  withSessionRlsActorContext
28
- } from "./chunk-6UU7OVUN.js";
28
+ } from "./chunk-JTBJGSUZ.js";
29
29
 
30
30
  // src/subscription-core-codex.ts
31
31
  import { CodexReloginRequired } from "@opengeni/codex";
@@ -1538,4 +1538,4 @@ export {
1538
1538
  refreshSubscriptionCoreCodexCredential,
1539
1539
  buildSubscriptionCoreCodexTokenResolver
1540
1540
  };
1541
- //# sourceMappingURL=chunk-JYPBOJ2Y.js.map
1541
+ //# sourceMappingURL=chunk-AAOKWNHE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  nestedPostgresSqlState,
3
3
  rawRows
4
- } from "./chunk-6UU7OVUN.js";
4
+ } from "./chunk-JTBJGSUZ.js";
5
5
 
6
6
  // src/canonical-human-identities.ts
7
7
  import { createHash } from "crypto";
@@ -318,4 +318,4 @@ export {
318
318
  getCanonicalHumanIdentityProjection,
319
319
  applyCanonicalHumanIdentityOperation
320
320
  };
321
- //# sourceMappingURL=chunk-D7LTIG33.js.map
321
+ //# sourceMappingURL=chunk-B4RMLA2X.js.map
@@ -12021,6 +12021,12 @@ var sessions = pgTable25(
12021
12021
  ownerOrganizationMembershipId: uuid24("owner_organization_membership_id"),
12022
12022
  ownerSubjectId: text25("owner_subject_id"),
12023
12023
  visibility: text25("visibility").notNull().default("workspace_shared"),
12024
+ // Immutable server-derived Site audience. Independent of mutable metadata,
12025
+ // reservations, and native member ownership; descendants inherit the binding.
12026
+ siteId: uuid24("site_id"),
12027
+ siteAccessRootId: uuid24("site_access_root_id"),
12028
+ siteViewerPrincipal: text25("site_viewer_principal"),
12029
+ siteOwnerSubjectId: text25("site_owner_subject_id"),
12024
12030
  createRequestedVisibility: text25("create_requested_visibility").notNull().default("workspace_shared"),
12025
12031
  authorityEpoch: integer22("authority_epoch").notNull().default(1),
12026
12032
  // Old accepted epochs remain valid across sharing, never across revocation.
@@ -18902,6 +18908,8 @@ var modelCallFacts = pgTable25(
18902
18908
  initiatorKind: text25("initiator_kind"),
18903
18909
  initiatorSubjectId: text25("initiator_subject_id"),
18904
18910
  scheduledTaskId: uuid24("scheduled_task_id"),
18911
+ // Source-stamped attribution survives session/Site deletion. Not a foreign key.
18912
+ siteId: uuid24("site_id"),
18905
18913
  inputTokens: bigint17("input_tokens", { mode: "number" }),
18906
18914
  outputTokens: bigint17("output_tokens", { mode: "number" }),
18907
18915
  cachedTokens: bigint17("cached_tokens", { mode: "number" }),
@@ -19236,6 +19244,8 @@ var creditLedgerEntries = pgTable25(
19236
19244
  currency: text25("currency").notNull().default("usd"),
19237
19245
  sourceType: text25("source_type"),
19238
19246
  sourceId: text25("source_id"),
19247
+ // Immutable execution-origin attribution, not an allocated platform charge.
19248
+ siteId: uuid24("site_id"),
19239
19249
  idempotencyKey: text25("idempotency_key").notNull(),
19240
19250
  metadata: jsonb19("metadata").$type().notNull().default({}),
19241
19251
  occurredAt: timestamp25("occurred_at", { withTimezone: true }).notNull().defaultNow(),
@@ -21326,4 +21336,4 @@ export {
21326
21336
  feedbackSubmissions,
21327
21337
  schema_exports
21328
21338
  };
21329
- //# sourceMappingURL=chunk-OXO32LTK.js.map
21339
+ //# sourceMappingURL=chunk-CEJ3NQ3B.js.map