@opengeni/db 3.7.4 → 4.0.0-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 (113) hide show
  1. package/dist/automations.d.ts +4 -0
  2. package/dist/canonical-human-identities.js +3 -3
  3. package/dist/capability-integrations.d.ts +2 -0
  4. package/dist/{chunk-6DPJA36C.js → chunk-2XEZK4LF.js} +7 -1
  5. package/dist/chunk-2XEZK4LF.js.map +1 -0
  6. package/dist/{chunk-4NAR7FBA.js → chunk-3RI33YQN.js} +67 -1
  7. package/dist/chunk-3RI33YQN.js.map +1 -0
  8. package/dist/{chunk-SZAWDXQC.js → chunk-CJROYHSC.js} +3 -3
  9. package/dist/{chunk-DZCYW2WT.js → chunk-MX6V5F65.js} +2 -2
  10. package/dist/{chunk-S3TDDCS2.js → chunk-N5VXJ4I2.js} +151 -78
  11. package/dist/chunk-N5VXJ4I2.js.map +1 -0
  12. package/dist/{chunk-U4WPPEBH.js → chunk-NLFHMPUB.js} +2 -2
  13. package/dist/{chunk-5NNCGFQY.js → chunk-P6NSEG2S.js} +2 -2
  14. package/dist/{chunk-O56DM5GZ.js → chunk-QM6YOWHZ.js} +624 -57
  15. package/dist/chunk-QM6YOWHZ.js.map +1 -0
  16. package/dist/{chunk-US4IS6IV.js → chunk-RZNOSEMC.js} +2 -2
  17. package/dist/{chunk-F6PBS6WE.js → chunk-UFAMOUWL.js} +2 -2
  18. package/dist/codemode-operations.d.ts +5 -0
  19. package/dist/codex-token-resolver.d.ts +6 -2
  20. package/dist/connection-token-resolver.d.ts +8 -0
  21. package/dist/editable-artifact-durable-export.js +2 -2
  22. package/dist/editable-artifacts.js +3 -3
  23. package/dist/generated-images.d.ts +15 -0
  24. package/dist/index.d.ts +393 -91
  25. package/dist/index.js +9992 -6069
  26. package/dist/index.js.map +1 -1
  27. package/dist/insights.d.ts +9 -0
  28. package/dist/managed-auth-session-sets.js +3 -3
  29. package/dist/managed-user-setup.d.ts +3 -0
  30. package/dist/mcp-oauth.d.ts +80 -0
  31. package/dist/migrate.d.ts +1 -0
  32. package/dist/migrate.js +3 -1
  33. package/dist/model-catalog.d.ts +153 -0
  34. package/dist/model-context-snapshots.d.ts +20 -0
  35. package/dist/new-session-drafts.d.ts +12 -0
  36. package/dist/organization-membership-lifecycle.d.ts +8 -1
  37. package/dist/organization-model-providers.d.ts +101 -0
  38. package/dist/pack-components.d.ts +1 -0
  39. package/dist/pr-review.d.ts +9 -0
  40. package/dist/provision-roles.js +1 -1
  41. package/dist/runtime-posture.d.ts +8 -8
  42. package/dist/schema.d.ts +7708 -5050
  43. package/dist/schema.js +25 -1
  44. package/dist/session-background-commands.d.ts +18 -6
  45. package/dist/session-background-commands.js +15 -9
  46. package/dist/session-control.d.ts +37 -2
  47. package/dist/session-goal-pacing.d.ts +3 -6
  48. package/dist/session-queue-commands.d.ts +17 -0
  49. package/dist/session-tenancy.js +3 -3
  50. package/dist/tool-gateway-approvals.d.ts +31 -0
  51. package/dist/video-generation.js +3 -3
  52. package/dist/workspace-artifacts.d.ts +17 -3
  53. package/dist/xai-subscription.d.ts +8 -0
  54. package/drizzle/0387_bound_host_export_session_payloads.sql +165 -0
  55. package/drizzle/0388_sandbox_provider_deadline_interactions.sql +491 -0
  56. package/drizzle/0389_model_catalog_and_gateway_custom_models.sql +241 -0
  57. package/drizzle/0390_organization_model_provider_connections.sql +197 -0
  58. package/drizzle/0391_sandbox_provider_deadline_interaction_followup.sql +295 -0
  59. package/drizzle/0392_context_compaction_pending_observability.sql +198 -0
  60. package/drizzle/0393_workspace_memory_and_learning_defaults.sql +102 -0
  61. package/drizzle/0394_session_selected_skill_activation.sql +20 -0
  62. package/drizzle/0395_scheduled_task_unclaimed_occurrence_invalidation.sql +154 -0
  63. package/drizzle/0396_model_call_equivalent_credit_cost.sql +28 -0
  64. package/drizzle/0397_sandbox_deadline_rotation_preemption.sql +113 -0
  65. package/drizzle/0398_organization_workspace_management_entry.sql +206 -0
  66. package/drizzle/0399_additional_managed_organization_creation.sql +691 -0
  67. package/drizzle/0400_session_attempt_model_context_snapshots.sql +65 -0
  68. package/drizzle/0401_organization_user_setup_token_transport.sql +178 -0
  69. package/drizzle/0402_session_input_wait_and_background_command_results.sql +1023 -0
  70. package/drizzle/0403_codex_unconditional_credential_leasing.sql +181 -0
  71. package/drizzle/0404_mcp_oauth_authorization_server.sql +471 -0
  72. package/drizzle/0405_tool_gateway_approval_capabilities.sql +184 -0
  73. package/drizzle/0406_workspace_html_site_sources.sql +71 -0
  74. package/package.json +6 -6
  75. package/src/automations.ts +9 -1
  76. package/src/capability-integrations.ts +8 -0
  77. package/src/codemode-operations.ts +31 -21
  78. package/src/codex-token-resolver.ts +16 -6
  79. package/src/connection-token-resolver.ts +52 -3
  80. package/src/generated-images.ts +70 -6
  81. package/src/index.ts +3894 -994
  82. package/src/insights-model-bundle.ts +54 -5
  83. package/src/insights.ts +53 -7
  84. package/src/managed-user-setup.ts +14 -3
  85. package/src/mcp-oauth.ts +488 -0
  86. package/src/migrate.ts +9 -1
  87. package/src/model-catalog.ts +682 -0
  88. package/src/model-context-snapshots.ts +151 -0
  89. package/src/new-session-drafts.ts +66 -21
  90. package/src/organization-membership-lifecycle.ts +47 -5
  91. package/src/organization-model-providers.ts +614 -0
  92. package/src/pack-components.ts +15 -2
  93. package/src/pr-review.ts +19 -0
  94. package/src/provision-roles.ts +4 -0
  95. package/src/runtime-posture.ts +64 -0
  96. package/src/schema.ts +666 -61
  97. package/src/session-background-commands.ts +180 -78
  98. package/src/session-control.ts +181 -12
  99. package/src/session-goal-pacing.ts +4 -8
  100. package/src/session-queue-commands.ts +157 -82
  101. package/src/tool-gateway-approvals.ts +168 -0
  102. package/src/workspace-artifacts.ts +633 -178
  103. package/src/xai-subscription.ts +66 -14
  104. package/dist/chunk-4NAR7FBA.js.map +0 -1
  105. package/dist/chunk-6DPJA36C.js.map +0 -1
  106. package/dist/chunk-O56DM5GZ.js.map +0 -1
  107. package/dist/chunk-S3TDDCS2.js.map +0 -1
  108. /package/dist/{chunk-SZAWDXQC.js.map → chunk-CJROYHSC.js.map} +0 -0
  109. /package/dist/{chunk-DZCYW2WT.js.map → chunk-MX6V5F65.js.map} +0 -0
  110. /package/dist/{chunk-U4WPPEBH.js.map → chunk-NLFHMPUB.js.map} +0 -0
  111. /package/dist/{chunk-5NNCGFQY.js.map → chunk-P6NSEG2S.js.map} +0 -0
  112. /package/dist/{chunk-US4IS6IV.js.map → chunk-RZNOSEMC.js.map} +0 -0
  113. /package/dist/{chunk-F6PBS6WE.js.map → chunk-UFAMOUWL.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  rawRows,
3
3
  withRlsContext
4
- } from "./chunk-F6PBS6WE.js";
4
+ } from "./chunk-UFAMOUWL.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-US4IS6IV.js.map
3543
+ //# sourceMappingURL=chunk-RZNOSEMC.js.map
@@ -4,7 +4,7 @@ import {
4
4
  sessions,
5
5
  workspaceSessionActivityRevisions,
6
6
  workspaces
7
- } from "./chunk-O56DM5GZ.js";
7
+ } from "./chunk-QM6YOWHZ.js";
8
8
 
9
9
  // src/persistence-errors.ts
10
10
  var SQLSTATE_KEYS = ["sqlState", "sqlstate", "code"];
@@ -755,4 +755,4 @@ export {
755
755
  withAccountRls,
756
756
  dbBindingFor
757
757
  };
758
- //# sourceMappingURL=chunk-F6PBS6WE.js.map
758
+ //# sourceMappingURL=chunk-UFAMOUWL.js.map
@@ -48,6 +48,11 @@ export type ClaimCodemodeOperationResult = {
48
48
  status: "claimed";
49
49
  operation: CodemodeOperationValue;
50
50
  claimId: string;
51
+ reclaimed: boolean;
52
+ } | {
53
+ status: "execution_owner_lost";
54
+ operation: CodemodeOperationValue;
55
+ claimId: string;
51
56
  } | {
52
57
  status: "already_running" | "terminal";
53
58
  operation: CodemodeOperationValue;
@@ -52,6 +52,10 @@ type CodexCredentialStatusTarget = {
52
52
  id: string;
53
53
  version: number;
54
54
  };
55
+ export type CodexCredentialTokenSnapshot = CodexTokenSnapshot & {
56
+ /** Exact credential-row version whose bearer is about to reach the provider. */
57
+ credentialVersion: number;
58
+ };
55
59
  export type CodexTokenDeadlineClock = {
56
60
  setTimeout: (callback: () => void, delayMs: number) => ReturnType<typeof globalThis.setTimeout>;
57
61
  clearTimeout: (handle: ReturnType<typeof globalThis.setTimeout>) => void;
@@ -79,8 +83,8 @@ export type CodexAuthDeps = {
79
83
  recordUsage?: (db: Database, workspaceId: string, credentialId: string, snapshot: CodexAccountUsageSnapshot) => Promise<boolean>;
80
84
  };
81
85
  export declare function buildCodexTokenResolver(db: Database, settings: Settings, workspaceId: string, credentialId: string, deps: CodexAuthDeps): {
82
- getToken: () => Promise<CodexTokenSnapshot>;
83
- refresh: () => Promise<CodexTokenSnapshot>;
86
+ getToken: () => Promise<CodexCredentialTokenSnapshot>;
87
+ refresh: () => Promise<CodexCredentialTokenSnapshot>;
84
88
  };
85
89
  /**
86
90
  * THE single per-account usage path both the api route and an (optional) worker
@@ -51,6 +51,8 @@ export type ConnectionStatusGuard = {
51
51
  export type ResolveConnectionCredentialResult = {
52
52
  status: "ok";
53
53
  headers: Record<string, string>;
54
+ /** Credential authority is owned by the embedding host, not the native connection store. */
55
+ authoritySource?: "host";
54
56
  /** Present when the credential bundle or embedding host supplied explicit placements. */
55
57
  placements?: ConnectionCredentialPlacement[];
56
58
  connectionId: string;
@@ -69,6 +71,8 @@ export type ResolveConnectionCredentialResult = {
69
71
  status: "auth_needed";
70
72
  reason: McpCredentialAuthNeededReason;
71
73
  providerDomain: string;
74
+ /** Credential authority is owned by the embedding host, not the native connection store. */
75
+ authoritySource?: "host";
72
76
  provider?: string;
73
77
  connectionId?: string;
74
78
  scopes?: string[];
@@ -89,6 +93,10 @@ export type ResolveConnectionCredentialInput = {
89
93
  /** Defaults to header-only MCP transport. */
90
94
  credentialTarget?: "mcp" | "http_api";
91
95
  forceRefresh?: boolean;
96
+ /** Internal lookup mode. Preflight must not refresh credentials or record provider usage. */
97
+ credentialResolutionMode?: "execution" | "preflight";
98
+ /** Frozen provider authority generation captured by the calling integration/catalog. */
99
+ expectedAuthorityGeneration?: number;
92
100
  /** Exact immutable accepted-work authority; never credential-bearing. */
93
101
  connectionUseAuthority?: unknown;
94
102
  /** Exact accepted attempt plus one stable physical-provider request id. */
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  rawRows,
3
3
  withRlsContext
4
- } from "./chunk-F6PBS6WE.js";
5
- import "./chunk-O56DM5GZ.js";
4
+ } from "./chunk-UFAMOUWL.js";
5
+ import "./chunk-QM6YOWHZ.js";
6
6
  import "./chunk-PZ5AY32C.js";
7
7
 
8
8
  // src/editable-artifact-durable-export.ts
@@ -8,9 +8,9 @@ import {
8
8
  PostgresEditableArtifactStore,
9
9
  listEditableArtifactIdsForSession,
10
10
  touchEditableArtifactSessionLink
11
- } from "./chunk-US4IS6IV.js";
12
- import "./chunk-F6PBS6WE.js";
13
- import "./chunk-O56DM5GZ.js";
11
+ } from "./chunk-RZNOSEMC.js";
12
+ import "./chunk-UFAMOUWL.js";
13
+ import "./chunk-QM6YOWHZ.js";
14
14
  import "./chunk-PZ5AY32C.js";
15
15
  export {
16
16
  EDITABLE_ARTIFACT_INTENT_MAX_BYTES,
@@ -89,10 +89,25 @@ export declare function beginImageGenerationOperation(db: Database, input: {
89
89
  workspaceId: string;
90
90
  operationId: string;
91
91
  operationKey: string;
92
+ providerBindingHash: string;
93
+ expectedArtifactId: string;
92
94
  }): Promise<{
93
95
  operation: ImageGenerationOperation;
94
96
  started: boolean;
95
97
  }>;
98
+ /**
99
+ * Return a paid-operation row to its retryable prepared state when a durable
100
+ * provider-dispatch fence rejected before any provider request was admitted.
101
+ * This is intentionally narrower than outcome reconciliation: a caller must
102
+ * prove the provider boundary was never crossed before using this transition.
103
+ */
104
+ export declare function resetImageGenerationOperationBeforeProviderDispatch(db: Database, input: {
105
+ accountId: string;
106
+ workspaceId: string;
107
+ operationId: string;
108
+ operationKey: string;
109
+ error: string;
110
+ }): Promise<ImageGenerationOperation>;
96
111
  export declare function markImageGenerationOperationOutcomeUnknown(db: Database, input: {
97
112
  accountId: string;
98
113
  workspaceId: string;