@opengeni/db 3.7.4 → 3.8.2-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.
- package/dist/automations.d.ts +4 -0
- package/dist/canonical-human-identities.js +3 -3
- package/dist/{chunk-O56DM5GZ.js → chunk-53A2PEHT.js} +328 -31
- package/dist/chunk-53A2PEHT.js.map +1 -0
- package/dist/{chunk-SZAWDXQC.js → chunk-5S4BQAHX.js} +3 -3
- package/dist/{chunk-S3TDDCS2.js → chunk-CITYUGMW.js} +3 -3
- package/dist/{chunk-4NAR7FBA.js → chunk-F5YOZEYQ.js} +49 -1
- package/dist/chunk-F5YOZEYQ.js.map +1 -0
- package/dist/{chunk-F6PBS6WE.js → chunk-HZV7O6JR.js} +2 -2
- package/dist/{chunk-5NNCGFQY.js → chunk-RLQVPOVR.js} +2 -2
- package/dist/{chunk-DZCYW2WT.js → chunk-UKOGHUGC.js} +2 -2
- package/dist/{chunk-US4IS6IV.js → chunk-X6TO5HII.js} +2 -2
- package/dist/{chunk-U4WPPEBH.js → chunk-Y53WEFYB.js} +2 -2
- package/dist/connection-token-resolver.d.ts +4 -0
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +164 -14
- package/dist/index.js +7327 -5442
- package/dist/index.js.map +1 -1
- package/dist/insights.d.ts +9 -0
- package/dist/managed-auth-session-sets.js +3 -3
- package/dist/model-catalog.d.ts +153 -0
- package/dist/new-session-drafts.d.ts +12 -0
- package/dist/organization-membership-lifecycle.d.ts +8 -1
- package/dist/organization-model-providers.d.ts +101 -0
- package/dist/pack-components.d.ts +1 -0
- package/dist/pr-review.d.ts +9 -0
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +7 -7
- package/dist/schema.d.ts +989 -2
- package/dist/schema.js +11 -1
- package/dist/session-background-commands.js +3 -3
- package/dist/session-control.d.ts +35 -0
- package/dist/session-queue-commands.d.ts +17 -0
- package/dist/session-tenancy.js +3 -3
- package/dist/video-generation.js +3 -3
- package/dist/xai-subscription.d.ts +8 -0
- package/drizzle/0387_bound_host_export_session_payloads.sql +165 -0
- package/drizzle/0388_sandbox_provider_deadline_interactions.sql +491 -0
- package/drizzle/0389_model_catalog_and_gateway_custom_models.sql +241 -0
- package/drizzle/0390_organization_model_provider_connections.sql +197 -0
- package/drizzle/0391_sandbox_provider_deadline_interaction_followup.sql +295 -0
- package/drizzle/0392_context_compaction_pending_observability.sql +198 -0
- package/drizzle/0393_workspace_memory_and_learning_defaults.sql +102 -0
- package/drizzle/0394_session_selected_skill_activation.sql +20 -0
- package/drizzle/0395_scheduled_task_unclaimed_occurrence_invalidation.sql +154 -0
- package/drizzle/0396_model_call_equivalent_credit_cost.sql +28 -0
- package/drizzle/0397_sandbox_deadline_rotation_preemption.sql +113 -0
- package/drizzle/0398_organization_workspace_management_entry.sql +206 -0
- package/drizzle/0399_additional_managed_organization_creation.sql +691 -0
- package/package.json +6 -6
- package/src/automations.ts +9 -1
- package/src/connection-token-resolver.ts +12 -0
- package/src/index.ts +1551 -272
- package/src/insights-model-bundle.ts +54 -5
- package/src/insights.ts +53 -7
- package/src/model-catalog.ts +682 -0
- package/src/new-session-drafts.ts +66 -21
- package/src/organization-membership-lifecycle.ts +47 -5
- package/src/organization-model-providers.ts +614 -0
- package/src/pack-components.ts +15 -2
- package/src/pr-review.ts +19 -0
- package/src/provision-roles.ts +2 -0
- package/src/runtime-posture.ts +48 -0
- package/src/schema.ts +348 -32
- package/src/session-control.ts +170 -0
- package/src/session-queue-commands.ts +157 -82
- package/src/xai-subscription.ts +66 -14
- package/dist/chunk-4NAR7FBA.js.map +0 -1
- package/dist/chunk-O56DM5GZ.js.map +0 -1
- /package/dist/{chunk-SZAWDXQC.js.map → chunk-5S4BQAHX.js.map} +0 -0
- /package/dist/{chunk-S3TDDCS2.js.map → chunk-CITYUGMW.js.map} +0 -0
- /package/dist/{chunk-F6PBS6WE.js.map → chunk-HZV7O6JR.js.map} +0 -0
- /package/dist/{chunk-5NNCGFQY.js.map → chunk-RLQVPOVR.js.map} +0 -0
- /package/dist/{chunk-DZCYW2WT.js.map → chunk-UKOGHUGC.js.map} +0 -0
- /package/dist/{chunk-US4IS6IV.js.map → chunk-X6TO5HII.js.map} +0 -0
- /package/dist/{chunk-U4WPPEBH.js.map → chunk-Y53WEFYB.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/db",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.2-canary.0",
|
|
4
4
|
"description": "OpenGeni persistence: Drizzle schema, RLS-scoped query layer, the SQL migration runner, and role provisioning.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@opengeni/codemode": "^0.4.
|
|
82
|
-
"@opengeni/codex": "^0.2.20",
|
|
83
|
-
"@opengeni/config": "^0.
|
|
84
|
-
"@opengeni/contracts": "^2.
|
|
85
|
-
"@opengeni/network": "^0.2.3",
|
|
81
|
+
"@opengeni/codemode": "^0.4.25-canary.0",
|
|
82
|
+
"@opengeni/codex": "^0.2.20-canary.2",
|
|
83
|
+
"@opengeni/config": "^0.23.2-canary.0",
|
|
84
|
+
"@opengeni/contracts": "^2.11.1-canary.0",
|
|
85
|
+
"@opengeni/network": "^0.2.3-canary.7",
|
|
86
86
|
"drizzle-orm": "^0.45.2",
|
|
87
87
|
"postgres": "^3.4.7"
|
|
88
88
|
},
|
package/src/automations.ts
CHANGED
|
@@ -223,6 +223,8 @@ export async function createAutomationTrigger(
|
|
|
223
223
|
createdBySubjectId: string;
|
|
224
224
|
request: CreateAutomationTriggerRequest;
|
|
225
225
|
adapterId: string;
|
|
226
|
+
/** Trusted database-only admission seam. Throwing rolls creation back. */
|
|
227
|
+
beforeCreateCommit?: (tx: Database) => Promise<void>;
|
|
226
228
|
},
|
|
227
229
|
): Promise<AutomationTrigger> {
|
|
228
230
|
return await withWorkspaceRls(
|
|
@@ -289,6 +291,7 @@ export async function createAutomationTrigger(
|
|
|
289
291
|
throw new Error("Automation Pack trigger must use its frozen manifest template");
|
|
290
292
|
}
|
|
291
293
|
}
|
|
294
|
+
await input.beforeCreateCommit?.(tx);
|
|
292
295
|
const [head] = await tx
|
|
293
296
|
.insert(schema.automationTriggers)
|
|
294
297
|
.values({
|
|
@@ -438,6 +441,8 @@ export async function updateAutomationTrigger(
|
|
|
438
441
|
triggerId: string;
|
|
439
442
|
subjectId: string;
|
|
440
443
|
request: UpdateAutomationTriggerRequest;
|
|
444
|
+
/** Trusted database-only admission seam. Throwing rolls the revision back. */
|
|
445
|
+
beforeUpdateCommit?: (tx: Database) => Promise<void>;
|
|
441
446
|
},
|
|
442
447
|
): Promise<AutomationTrigger | null> {
|
|
443
448
|
return await withWorkspaceRls(
|
|
@@ -478,6 +483,7 @@ export async function updateAutomationTrigger(
|
|
|
478
483
|
"Pack-owned automation triggers must be managed through their Pack setup API",
|
|
479
484
|
);
|
|
480
485
|
}
|
|
486
|
+
await input.beforeUpdateCommit?.(tx);
|
|
481
487
|
const revisionNumber = existing.head.currentRevision + 1;
|
|
482
488
|
const [head] = await tx
|
|
483
489
|
.update(schema.automationTriggers)
|
|
@@ -696,7 +702,9 @@ export async function claimAutomationRun(
|
|
|
696
702
|
.for("update")
|
|
697
703
|
.limit(1);
|
|
698
704
|
if (!row) return null;
|
|
699
|
-
if (row.status === "dispatched" || row.status === "skipped"
|
|
705
|
+
if (row.status === "dispatched" || row.status === "skipped" || row.status === "failed") {
|
|
706
|
+
return mapRunExecution(row);
|
|
707
|
+
}
|
|
700
708
|
const [updated] = await tx
|
|
701
709
|
.update(schema.automationRuns)
|
|
702
710
|
.set({
|
|
@@ -114,6 +114,8 @@ export type ResolveConnectionCredentialResult =
|
|
|
114
114
|
| {
|
|
115
115
|
status: "ok";
|
|
116
116
|
headers: Record<string, string>;
|
|
117
|
+
/** Credential authority is owned by the embedding host, not the native connection store. */
|
|
118
|
+
authoritySource?: "host";
|
|
117
119
|
/** Present when the credential bundle or embedding host supplied explicit placements. */
|
|
118
120
|
placements?: ConnectionCredentialPlacement[];
|
|
119
121
|
connectionId: string;
|
|
@@ -133,6 +135,8 @@ export type ResolveConnectionCredentialResult =
|
|
|
133
135
|
status: "auth_needed";
|
|
134
136
|
reason: McpCredentialAuthNeededReason;
|
|
135
137
|
providerDomain: string;
|
|
138
|
+
/** Credential authority is owned by the embedding host, not the native connection store. */
|
|
139
|
+
authoritySource?: "host";
|
|
136
140
|
provider?: string;
|
|
137
141
|
connectionId?: string;
|
|
138
142
|
scopes?: string[];
|
|
@@ -270,6 +274,9 @@ export function buildHostConnectionTokenResolver(
|
|
|
270
274
|
serverId: input.serverId,
|
|
271
275
|
connectionRef: {
|
|
272
276
|
providerDomain: input.connectionRef.providerDomain,
|
|
277
|
+
...(input.connectionRef.authoritySource
|
|
278
|
+
? { authoritySource: input.connectionRef.authoritySource }
|
|
279
|
+
: {}),
|
|
273
280
|
...(input.connectionRef.provider ? { provider: input.connectionRef.provider } : {}),
|
|
274
281
|
...(input.connectionRef.connectionId
|
|
275
282
|
? { connectionId: input.connectionRef.connectionId }
|
|
@@ -303,6 +310,7 @@ export function buildHostConnectionTokenResolver(
|
|
|
303
310
|
status: "auth_needed",
|
|
304
311
|
reason: result.reason,
|
|
305
312
|
providerDomain: result.providerDomain,
|
|
313
|
+
authoritySource: "host",
|
|
306
314
|
...(result.provider ? { provider: result.provider } : {}),
|
|
307
315
|
...(result.connectionId ? { connectionId: result.connectionId } : {}),
|
|
308
316
|
...(result.scopes ? { scopes: [...result.scopes] } : {}),
|
|
@@ -339,6 +347,7 @@ export function buildHostConnectionTokenResolver(
|
|
|
339
347
|
return {
|
|
340
348
|
status: "ok",
|
|
341
349
|
headers,
|
|
350
|
+
authoritySource: "host",
|
|
342
351
|
...(explicitPlacements ? { placements: explicitPlacements } : {}),
|
|
343
352
|
connectionId: result.connectionId,
|
|
344
353
|
...(expiresAt !== undefined ? { expiresAt } : {}),
|
|
@@ -835,6 +844,9 @@ export function buildConnectionTokenResolver(
|
|
|
835
844
|
let credentialWorkspaceId = input.workspaceId;
|
|
836
845
|
let expectedAuthorityGeneration: number | undefined;
|
|
837
846
|
let connectionUseAttribution: ConnectionUseAttribution | undefined;
|
|
847
|
+
if (ref.authoritySource === "host") {
|
|
848
|
+
return authNeeded(ref, "unsupported_auth", ref.connectionId);
|
|
849
|
+
}
|
|
838
850
|
// Repository-scoped provider bindings require a broker that can prove the
|
|
839
851
|
// selected-resource boundary. The generic standalone credential store has
|
|
840
852
|
// no provider-specific containment adapter, so it must fail closed instead
|