@opengeni/db 5.0.0-canary.0 → 5.0.1-canary.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 (89) hide show
  1. package/dist/canonical-human-identities.js +3 -3
  2. package/dist/capability-integrations.d.ts +22 -1
  3. package/dist/capability-reconciliation.d.ts +5 -0
  4. package/dist/capability-reconciliation.js +21 -0
  5. package/dist/capability-reconciliation.js.map +1 -0
  6. package/dist/{chunk-HQDVI2DB.js → chunk-26BQCKRE.js} +2 -2
  7. package/dist/{chunk-MWMXWHJD.js → chunk-3LMHK5AL.js} +2 -2
  8. package/dist/{chunk-6T2GGYWE.js → chunk-4UJCXBR2.js} +4 -5800
  9. package/dist/chunk-4UJCXBR2.js.map +1 -0
  10. package/dist/{chunk-F73UKJY6.js → chunk-BGMK3XV6.js} +50 -1
  11. package/dist/chunk-BGMK3XV6.js.map +1 -0
  12. package/dist/chunk-DLYLKTD6.js +156 -0
  13. package/dist/chunk-DLYLKTD6.js.map +1 -0
  14. package/dist/{chunk-7HMK3B45.js → chunk-E4X5HQ5P.js} +2 -2
  15. package/dist/chunk-JIISMOTH.js +5801 -0
  16. package/dist/chunk-JIISMOTH.js.map +1 -0
  17. package/dist/{chunk-T6BWIGWJ.js → chunk-LQDNDCQ5.js} +2 -2
  18. package/dist/{chunk-DPONPYJD.js → chunk-TDXX22IZ.js} +2 -2
  19. package/dist/chunk-TW43DRG3.js +219 -0
  20. package/dist/chunk-TW43DRG3.js.map +1 -0
  21. package/dist/{chunk-T6YLHJLS.js → chunk-VRS7M7FP.js} +50 -1
  22. package/dist/chunk-VRS7M7FP.js.map +1 -0
  23. package/dist/{chunk-ERKVSPDX.js → chunk-XTQWEJLJ.js} +3 -3
  24. package/dist/connect-attempts.d.ts +15 -0
  25. package/dist/connect-attempts.js +25 -0
  26. package/dist/connect-attempts.js.map +1 -0
  27. package/dist/editable-artifact-durable-export.js +2 -2
  28. package/dist/editable-artifacts.js +3 -3
  29. package/dist/index.d.ts +31 -0
  30. package/dist/index.js +2254 -1945
  31. package/dist/index.js.map +1 -1
  32. package/dist/insights-usage-bundle.d.ts +3 -0
  33. package/dist/integration-facets.d.ts +17 -0
  34. package/dist/knowledge-entries-schema.d.ts +2 -0
  35. package/dist/knowledge-entries.d.ts +1 -0
  36. package/dist/knowledge-indexing.d.ts +1 -0
  37. package/dist/managed-auth-session-sets.js +3 -3
  38. package/dist/mcp-operations.js +2 -2
  39. package/dist/organization-integration-policy.d.ts +51 -0
  40. package/dist/organization-integration-policy.js +18 -0
  41. package/dist/organization-integration-policy.js.map +1 -0
  42. package/dist/organization-usage.d.ts +20 -0
  43. package/dist/provision-roles.js +1 -1
  44. package/dist/retained-provider-commands.js +2 -2
  45. package/dist/runtime-posture.d.ts +2 -2
  46. package/dist/schema.d.ts +185 -12
  47. package/dist/schema.js +5 -1
  48. package/dist/session-attempt-writers.d.ts +4 -0
  49. package/dist/session-background-commands.js +5 -4
  50. package/dist/session-command-output.js +5 -4
  51. package/dist/session-command-output.js.map +1 -1
  52. package/dist/session-event-slices.js +2 -2
  53. package/dist/session-mcp-credential-rotation.js +5 -4
  54. package/dist/session-mcp-credential-rotation.js.map +1 -1
  55. package/dist/session-tenancy.js +3 -3
  56. package/dist/video-generation.js +3 -3
  57. package/dist/workspace-tool-defaults.js +5 -4
  58. package/dist/workspace-tool-defaults.js.map +1 -1
  59. package/drizzle/0468_knowledge_relationship_projection.sql +30 -0
  60. package/drizzle/0469_knowledge_source_discovery.sql +85 -0
  61. package/drizzle/0470_organization_integration_policy.sql +151 -0
  62. package/drizzle/0471_usage_events_account_recent_index.sql +4 -0
  63. package/drizzle/0472_usage_events_workspace_recent_index.sql +4 -0
  64. package/drizzle/0473_organization_usage_analytical_capability.sql +237 -0
  65. package/package.json +18 -6
  66. package/src/capability-integrations.ts +299 -8
  67. package/src/capability-reconciliation.ts +19 -0
  68. package/src/connect-attempts.ts +49 -18
  69. package/src/index.ts +365 -117
  70. package/src/insights-model-bundle.ts +19 -7
  71. package/src/insights-usage-bundle.ts +15 -18
  72. package/src/integration-facets.ts +71 -1
  73. package/src/knowledge-entries.ts +8 -1
  74. package/src/organization-integration-policy.ts +235 -0
  75. package/src/organization-usage.ts +83 -0
  76. package/src/plugin-packages.ts +11 -0
  77. package/src/provision-roles.ts +5 -0
  78. package/src/runtime-posture.ts +67 -0
  79. package/src/schema.ts +51 -0
  80. package/src/session-attempt-writers.ts +48 -0
  81. package/dist/chunk-6T2GGYWE.js.map +0 -1
  82. package/dist/chunk-F73UKJY6.js.map +0 -1
  83. package/dist/chunk-T6YLHJLS.js.map +0 -1
  84. /package/dist/{chunk-HQDVI2DB.js.map → chunk-26BQCKRE.js.map} +0 -0
  85. /package/dist/{chunk-MWMXWHJD.js.map → chunk-3LMHK5AL.js.map} +0 -0
  86. /package/dist/{chunk-7HMK3B45.js.map → chunk-E4X5HQ5P.js.map} +0 -0
  87. /package/dist/{chunk-T6BWIGWJ.js.map → chunk-LQDNDCQ5.js.map} +0 -0
  88. /package/dist/{chunk-DPONPYJD.js.map → chunk-TDXX22IZ.js.map} +0 -0
  89. /package/dist/{chunk-ERKVSPDX.js.map → chunk-XTQWEJLJ.js.map} +0 -0
@@ -11,9 +11,9 @@ import {
11
11
  getCanonicalHumanIdentityProjection,
12
12
  synchronizeCanonicalHumanLoginBindings,
13
13
  validateCanonicalHumanSession
14
- } from "./chunk-7HMK3B45.js";
15
- import "./chunk-DPONPYJD.js";
16
- import "./chunk-F73UKJY6.js";
14
+ } from "./chunk-E4X5HQ5P.js";
15
+ import "./chunk-TDXX22IZ.js";
16
+ import "./chunk-BGMK3XV6.js";
17
17
  import "./chunk-S2TZ3F4L.js";
18
18
  import "./chunk-PZ5AY32C.js";
19
19
  export {
@@ -1,4 +1,4 @@
1
- import { type McpServerConnectionRef } from "@opengeni/contracts";
1
+ import { type IntegrationSource, type McpServerConnectionRef } from "@opengeni/contracts";
2
2
  import { type Database } from "./database.js";
3
3
  export type ApiIntegrationProtocol = "openapi" | "graphql";
4
4
  export type ApiIntegrationToolSafety = "read" | "write" | "destructive";
@@ -197,6 +197,27 @@ export declare function listInstalledApiIntegrationServerIdsForDelegations(db: D
197
197
  */
198
198
  export declare function listInstalledApiIntegrationsInRlsContext(scopedDb: Database, workspaceId: string, subjectId?: string): Promise<ApiIntegrationRuntime[]>;
199
199
  export declare function getApiIntegrationUninstallPreview(db: Database, workspaceId: string, subjectId: string, capabilityId: string, instanceKey: string): Promise<ApiIntegrationUninstallPreview>;
200
+ /** No discovery or new authority: recover only an exact, currently visible and
201
+ * directly owned installed source. The installer must still lock and recheck
202
+ * the snapshot before committing; this read is not installation admission.
203
+ */
204
+ export declare function getApiIntegrationReconciliationSnapshot(db: Database, input: {
205
+ accountId: string;
206
+ workspaceId: string;
207
+ subjectId: string;
208
+ source: IntegrationSource;
209
+ connectionId?: string;
210
+ instanceKey?: string;
211
+ expectedRevisionId: string;
212
+ expectedContentSha256: string;
213
+ allowedTools?: string[];
214
+ }): Promise<{
215
+ runtime: ApiIntegrationRuntime;
216
+ baseServerId: string;
217
+ name: string;
218
+ provider: string | null;
219
+ requiredScopes: string[];
220
+ } | null>;
200
221
  export declare function uninstallApiIntegration(db: Database, input: {
201
222
  accountId: string;
202
223
  workspaceId: string;
@@ -0,0 +1,5 @@
1
+ import { type Database } from "./database.js";
2
+ /** Retain the installation row through the caller's outer transaction. This is
3
+ * a no-write reconciliation read; it never activates or alters an installation.
4
+ * Acquisition callers must already hold the organization policy fence. */
5
+ export declare function withLockedCapabilityInstallation<T>(db: Database, workspaceId: string, capabilityId: string, read: (tx: Database) => Promise<T>): Promise<T>;
@@ -0,0 +1,21 @@
1
+ import {
2
+ withWorkspaceRls
3
+ } from "./chunk-TDXX22IZ.js";
4
+ import "./chunk-BGMK3XV6.js";
5
+ import "./chunk-S2TZ3F4L.js";
6
+ import "./chunk-PZ5AY32C.js";
7
+
8
+ // src/capability-reconciliation.ts
9
+ import { sql } from "drizzle-orm";
10
+ async function withLockedCapabilityInstallation(db, workspaceId, capabilityId, read) {
11
+ return withWorkspaceRls(db, workspaceId, async (tx) => {
12
+ await tx.execute(sql`select id from capability_installations
13
+ where workspace_id = ${workspaceId}::uuid and capability_id = ${capabilityId}
14
+ for update`);
15
+ return read(tx);
16
+ });
17
+ }
18
+ export {
19
+ withLockedCapabilityInstallation
20
+ };
21
+ //# sourceMappingURL=capability-reconciliation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/capability-reconciliation.ts"],"sourcesContent":["import { sql } from \"drizzle-orm\";\nimport { withWorkspaceRls, type Database } from \"./database\";\n\n/** Retain the installation row through the caller's outer transaction. This is\n * a no-write reconciliation read; it never activates or alters an installation.\n * Acquisition callers must already hold the organization policy fence. */\nexport async function withLockedCapabilityInstallation<T>(\n db: Database,\n workspaceId: string,\n capabilityId: string,\n read: (tx: Database) => Promise<T>,\n) {\n return withWorkspaceRls(db, workspaceId, async (tx) => {\n await tx.execute(sql`select id from capability_installations\n where workspace_id = ${workspaceId}::uuid and capability_id = ${capabilityId}\n for update`);\n return read(tx);\n });\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,WAAW;AAMpB,eAAsB,iCACpB,IACA,aACA,cACA,MACA;AACA,SAAO,iBAAiB,IAAI,aAAa,OAAO,OAAO;AACrD,UAAM,GAAG,QAAQ;AAAA,6BACQ,WAAW,8BAA8B,YAAY;AAAA,iBACjE;AACb,WAAO,KAAK,EAAE;AAAA,EAChB,CAAC;AACH;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  rawRows,
3
3
  withRlsContext
4
- } from "./chunk-DPONPYJD.js";
4
+ } from "./chunk-TDXX22IZ.js";
5
5
 
6
6
  // src/editable-artifacts.ts
7
7
  import { createHash } from "crypto";
@@ -3540,4 +3540,4 @@ export {
3540
3540
  PostgresEditableArtifactStore,
3541
3541
  PostgresEditableArtifactLiveReadStore
3542
3542
  };
3543
- //# sourceMappingURL=chunk-HQDVI2DB.js.map
3543
+ //# sourceMappingURL=chunk-26BQCKRE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  nestedPostgresSqlState,
3
3
  rawRows
4
- } from "./chunk-DPONPYJD.js";
4
+ } from "./chunk-TDXX22IZ.js";
5
5
 
6
6
  // src/managed-auth-session-sets.ts
7
7
  import {
@@ -296,4 +296,4 @@ export {
296
296
  reapManagedAuthIsolatedSessions,
297
297
  reapExpiredManagedAuthSessionSets
298
298
  };
299
- //# sourceMappingURL=chunk-MWMXWHJD.js.map
299
+ //# sourceMappingURL=chunk-3LMHK5AL.js.map