@opengeni/db 6.5.0 → 6.6.0-canary.37090756480001
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/browser-sessions.d.ts +1 -0
- package/dist/canonical-human-identities.js +4 -4
- package/dist/capability-integrations.d.ts +6 -0
- package/dist/capability-reconciliation.js +3 -3
- package/dist/{chunk-7PFJLY2U.js → chunk-43JGJFVU.js} +3 -3
- package/dist/{chunk-VWGYBPX4.js → chunk-5C2HMAVM.js} +2 -2
- package/dist/{chunk-LQ4IB3NH.js → chunk-7WTXQQCJ.js} +5 -5
- package/dist/{chunk-VTVNNCYZ.js → chunk-DBCRRNH4.js} +47 -17
- package/dist/chunk-DBCRRNH4.js.map +1 -0
- package/dist/{chunk-3MP2V2GC.js → chunk-HHCFFZ5K.js} +5 -5
- package/dist/{chunk-RP7EQP36.js → chunk-MFZQLJTT.js} +2 -2
- package/dist/{chunk-7ORQCNBA.js → chunk-MMRJMY2J.js} +46 -1
- package/dist/chunk-MMRJMY2J.js.map +1 -0
- package/dist/{chunk-YHIBDQ7N.js → chunk-OFI3UY3J.js} +2 -2
- package/dist/{chunk-S2TZ3F4L.js → chunk-P7YDM2RI.js} +3 -11
- package/dist/{chunk-S2TZ3F4L.js.map → chunk-P7YDM2RI.js.map} +1 -1
- package/dist/{chunk-NJIWKMV3.js → chunk-PGSWZSF3.js} +2 -2
- package/dist/{chunk-M3TGZ7B4.js → chunk-RU5WRVQA.js} +2 -2
- package/dist/{chunk-3ZYFTK7X.js → chunk-RWTOTE5Q.js} +4 -4
- package/dist/{chunk-JPYN5XKV.js → chunk-S2YPINYO.js} +2 -2
- package/dist/{chunk-25DAVPRJ.js → chunk-SG4QFBDY.js} +2 -2
- package/dist/{chunk-2X2GKAC4.js → chunk-V26GG56Q.js} +22 -7
- package/dist/chunk-V26GG56Q.js.map +1 -0
- package/dist/{chunk-3UKWSD43.js → chunk-VAEPQMM6.js} +2 -2
- package/dist/{chunk-UAR7ZDNG.js → chunk-Y77F3U76.js} +8058 -8024
- package/dist/chunk-Y77F3U76.js.map +1 -0
- package/dist/claude-subscription-tokens.d.ts +21 -0
- package/dist/claude-subscription-usage.d.ts +63 -0
- package/dist/computer-sessions.d.ts +1 -0
- package/dist/connect-attempts.js +4 -4
- package/dist/editable-artifact-durable-export.js +3 -3
- package/dist/editable-artifacts.js +4 -4
- package/dist/index.d.ts +193 -12
- package/dist/index.js +11798 -10858
- package/dist/index.js.map +1 -1
- package/dist/insights-model-bundle.d.ts +41 -4
- package/dist/insights-usage-bundle.d.ts +3 -4
- package/dist/insights.d.ts +28 -0
- package/dist/interaction-schema.d.ts +2 -0
- package/dist/managed-auth-session-sets.js +4 -4
- package/dist/mcp-operations.js +3 -3
- package/dist/migrate.js +2 -2
- package/dist/model-catalog.d.ts +6 -0
- package/dist/organization-integration-policy.js +4 -4
- package/dist/organization-model-providers.d.ts +9 -0
- package/dist/organization-usage.d.ts +9 -0
- package/dist/organization-xai-subscriptions.d.ts +48 -2
- package/dist/provision-roles.js +1 -1
- package/dist/retained-provider-commands.js +7 -7
- package/dist/runtime-posture.d.ts +3 -1
- package/dist/schema.d.ts +1640 -1509
- package/dist/schema.js +2 -2
- package/dist/session-attempt-writers.d.ts +1 -1
- package/dist/session-background-commands.d.ts +6 -0
- package/dist/session-background-commands.js +11 -7
- package/dist/session-command-output.js +6 -6
- package/dist/session-event-slices.js +4 -4
- package/dist/session-mcp-credential-rotation.js +6 -6
- package/dist/session-tenancy.js +4 -4
- package/dist/subscription-account-repository.d.ts +604 -0
- package/dist/subscription-credential-leases.d.ts +10 -0
- package/dist/subscription-pool-schema.d.ts +1642 -0
- package/dist/video-generation.js +4 -4
- package/dist/workspace-tool-defaults.js +5 -5
- package/dist/xai-subscription.d.ts +973 -572
- package/drizzle/0547_idle_command_containment.sql +218 -0
- package/drizzle/0583_session_tenancy_operator_permission.sql +103 -0
- package/drizzle/0584_agent_instruction_size_parity.sql +220 -0
- package/drizzle/0585_session_attention_cursor.sql +180 -0
- package/drizzle/0586_private_sessions_fleet_activation.sql +7 -0
- package/drizzle/0587_workflow_wake_session_lock_order.sql +119 -0
- package/drizzle/0588_insights_scoped_fact_projection.sql +318 -0
- package/drizzle/0589_organization_model_usage.sql +296 -0
- package/drizzle/0590_complete_insights_usage_amounts.sql +345 -0
- package/drizzle/0591_insights_aggregate_query_plans.sql +132 -0
- package/drizzle/0592_insights_claude_subscription_payers.sql +29 -0
- package/drizzle/0593_insights_private_ledger_filter.sql +56 -0
- package/drizzle/0594_organization_usage_hash_join.sql +9 -0
- package/package.json +7 -7
- package/src/browser-sessions.ts +6 -1
- package/src/capability-integrations.ts +46 -7
- package/src/company-brain-governed-writes.ts +4 -3
- package/src/computer-sessions.ts +8 -1
- package/src/database.ts +39 -4
- package/src/index.ts +1053 -307
- package/src/insights-model-bundle.ts +381 -331
- package/src/insights-usage-bundle.ts +49 -43
- package/src/insights.ts +301 -136
- package/src/lossless-json.ts +4 -10
- package/src/model-catalog.ts +64 -16
- package/src/organization-model-providers.ts +56 -1
- package/src/organization-usage.ts +36 -0
- package/src/provision-roles.ts +12 -0
- package/src/runtime-posture.ts +44 -0
- package/src/schema.ts +25 -314
- package/src/session-attempt-writers.ts +29 -1
- package/src/session-background-commands.ts +64 -13
- package/src/subscription-account-repository.ts +2155 -0
- package/src/subscription-credential-leases.ts +41 -0
- package/src/subscription-pool-schema.ts +341 -0
- package/src/workspace-model-connection-access.ts +48 -1
- package/src/xai-subscription.ts +78 -2021
- package/dist/chunk-2X2GKAC4.js.map +0 -1
- package/dist/chunk-7ORQCNBA.js.map +0 -1
- package/dist/chunk-UAR7ZDNG.js.map +0 -1
- package/dist/chunk-VTVNNCYZ.js.map +0 -1
- /package/dist/{chunk-7PFJLY2U.js.map → chunk-43JGJFVU.js.map} +0 -0
- /package/dist/{chunk-VWGYBPX4.js.map → chunk-5C2HMAVM.js.map} +0 -0
- /package/dist/{chunk-LQ4IB3NH.js.map → chunk-7WTXQQCJ.js.map} +0 -0
- /package/dist/{chunk-3MP2V2GC.js.map → chunk-HHCFFZ5K.js.map} +0 -0
- /package/dist/{chunk-RP7EQP36.js.map → chunk-MFZQLJTT.js.map} +0 -0
- /package/dist/{chunk-YHIBDQ7N.js.map → chunk-OFI3UY3J.js.map} +0 -0
- /package/dist/{chunk-NJIWKMV3.js.map → chunk-PGSWZSF3.js.map} +0 -0
- /package/dist/{chunk-M3TGZ7B4.js.map → chunk-RU5WRVQA.js.map} +0 -0
- /package/dist/{chunk-3ZYFTK7X.js.map → chunk-RWTOTE5Q.js.map} +0 -0
- /package/dist/{chunk-JPYN5XKV.js.map → chunk-S2YPINYO.js.map} +0 -0
- /package/dist/{chunk-25DAVPRJ.js.map → chunk-SG4QFBDY.js.map} +0 -0
- /package/dist/{chunk-3UKWSD43.js.map → chunk-VAEPQMM6.js.map} +0 -0
|
@@ -335,6 +335,7 @@ export declare function failBrowserSessionOperation(db: Database, input: {
|
|
|
335
335
|
operationId: string;
|
|
336
336
|
browserSessionId: string;
|
|
337
337
|
state?: "failed" | "outcome_unknown";
|
|
338
|
+
onlyIfPreparedCreate?: boolean;
|
|
338
339
|
error: InteractionErrorValue;
|
|
339
340
|
}): Promise<BrowserSessionMutationResponseValue>;
|
|
340
341
|
export declare function prepareBrowserSessionSuspend(db: Database, input: PrepareBrowserSessionLifecycleInput): Promise<BrowserSessionMutationResponseValue>;
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
getCanonicalHumanIdentityProjection,
|
|
12
12
|
synchronizeCanonicalHumanLoginBindings,
|
|
13
13
|
validateCanonicalHumanSession
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-RU5WRVQA.js";
|
|
15
|
+
import "./chunk-V26GG56Q.js";
|
|
16
|
+
import "./chunk-Y77F3U76.js";
|
|
17
|
+
import "./chunk-P7YDM2RI.js";
|
|
18
18
|
import "./chunk-PZ5AY32C.js";
|
|
19
19
|
export {
|
|
20
20
|
CanonicalHumanIdentityAuthorityError,
|
|
@@ -180,6 +180,12 @@ export declare class ApiIntegrationInstallationVersionConflictError extends Erro
|
|
|
180
180
|
readonly name = "ApiIntegrationInstallationVersionConflictError";
|
|
181
181
|
constructor(capabilityId: string, expectedVersion: number, actualVersion: number);
|
|
182
182
|
}
|
|
183
|
+
/** A known rejection of the selected credential, not an internal install failure. */
|
|
184
|
+
export declare class ApiIntegrationConnectionReferenceError extends Error {
|
|
185
|
+
readonly reason: "not_found" | "inactive" | "provider_mismatch" | "kind_mismatch" | "scope_mismatch";
|
|
186
|
+
readonly name = "ApiIntegrationConnectionReferenceError";
|
|
187
|
+
constructor(reason: "not_found" | "inactive" | "provider_mismatch" | "kind_mismatch" | "scope_mismatch", message: string);
|
|
188
|
+
}
|
|
183
189
|
export declare function installApiIntegration(db: Database, input: InstallApiIntegrationInput): Promise<InstalledApiIntegration>;
|
|
184
190
|
export declare function listInstalledApiIntegrations(db: Database, workspaceId: string, subjectId?: string): Promise<ApiIntegrationRuntime[]>;
|
|
185
191
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withWorkspaceRls
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-V26GG56Q.js";
|
|
4
|
+
import "./chunk-Y77F3U76.js";
|
|
5
|
+
import "./chunk-P7YDM2RI.js";
|
|
6
6
|
import "./chunk-PZ5AY32C.js";
|
|
7
7
|
|
|
8
8
|
// src/capability-reconciliation.ts
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
setSubjectRlsContext,
|
|
7
7
|
withRlsContext,
|
|
8
8
|
withWorkspaceRls
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V26GG56Q.js";
|
|
10
10
|
import {
|
|
11
11
|
connections,
|
|
12
12
|
creditLedgerEntries,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
workspaceVideoGenerationPolicies,
|
|
19
19
|
workspaceVideoGenerationQuotas,
|
|
20
20
|
workspaces
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-Y77F3U76.js";
|
|
22
22
|
|
|
23
23
|
// src/video-generation.ts
|
|
24
24
|
import {
|
|
@@ -1332,4 +1332,4 @@ export {
|
|
|
1332
1332
|
mediaGenerationResultForStoredOperation,
|
|
1333
1333
|
getVideoGenerationOperationSummary
|
|
1334
1334
|
};
|
|
1335
|
-
//# sourceMappingURL=chunk-
|
|
1335
|
+
//# sourceMappingURL=chunk-43JGJFVU.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
withWorkspaceRls,
|
|
6
6
|
withWorkspaceSubjectRls,
|
|
7
7
|
withWorkspaceSubjectSessionActivityRls
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-V26GG56Q.js";
|
|
9
9
|
|
|
10
10
|
// src/session-tenancy.ts
|
|
11
11
|
import { createHash } from "crypto";
|
|
@@ -502,4 +502,4 @@ export {
|
|
|
502
502
|
forkSessionContent,
|
|
503
503
|
replayAppliedSessionFork
|
|
504
504
|
};
|
|
505
|
-
//# sourceMappingURL=chunk-
|
|
505
|
+
//# sourceMappingURL=chunk-5C2HMAVM.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appendSessionCommandOutput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HHCFFZ5K.js";
|
|
4
4
|
import {
|
|
5
5
|
lockSessionEventWriteRows
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DBCRRNH4.js";
|
|
7
7
|
import {
|
|
8
8
|
withRlsContext,
|
|
9
9
|
withSessionActivityRlsContext
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-V26GG56Q.js";
|
|
11
11
|
import {
|
|
12
12
|
sandboxRetainedProcesses
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Y77F3U76.js";
|
|
14
14
|
|
|
15
15
|
// src/retained-provider-commands.ts
|
|
16
16
|
import { and, eq, sql } from "drizzle-orm";
|
|
@@ -299,4 +299,4 @@ export {
|
|
|
299
299
|
retainedProcessCancellationRequested,
|
|
300
300
|
requestRetainedProcessDeadlineCancellation
|
|
301
301
|
};
|
|
302
|
-
//# sourceMappingURL=chunk-
|
|
302
|
+
//# sourceMappingURL=chunk-7WTXQQCJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cancelUnacceptedVideoGenerationsForToolCallsInTransaction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-43JGJFVU.js";
|
|
4
4
|
import {
|
|
5
5
|
external_exports
|
|
6
6
|
} from "./chunk-4UJCXBR2.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
withSessionActivityRlsContext,
|
|
15
15
|
withWorkspaceRls,
|
|
16
16
|
withWorkspaceSubjectRls
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-V26GG56Q.js";
|
|
18
18
|
import {
|
|
19
19
|
auditEvents,
|
|
20
20
|
codexCapacityWaiters,
|
|
@@ -39,12 +39,12 @@ import {
|
|
|
39
39
|
workspaceInferenceControls,
|
|
40
40
|
workspaceMemberships,
|
|
41
41
|
workspaces
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-Y77F3U76.js";
|
|
43
43
|
import {
|
|
44
44
|
LOSSLESS_CONTENT_CODEC_VERSION,
|
|
45
45
|
fromPostgresLosslessJson,
|
|
46
46
|
withLosslessContentWriteVersion
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-P7YDM2RI.js";
|
|
48
48
|
|
|
49
49
|
// src/session-background-commands.ts
|
|
50
50
|
import { SessionCommandFailure } from "@opengeni/contracts";
|
|
@@ -4976,22 +4976,49 @@ function commandPreview(value) {
|
|
|
4976
4976
|
if (/[\uD800-\uDBFF]$/.test(preview)) preview = preview.slice(0, -1);
|
|
4977
4977
|
return `${preview}\u2026`;
|
|
4978
4978
|
}
|
|
4979
|
+
var UNOBSERVABLE_RETAINED_PROCESS_OUTCOMES = [
|
|
4980
|
+
"process_observation_unavailable",
|
|
4981
|
+
"quarantined_process_observation_unavailable",
|
|
4982
|
+
"provider_binding_missing",
|
|
4983
|
+
"quarantined_provider_binding_missing",
|
|
4984
|
+
"provider_binding_mismatch",
|
|
4985
|
+
"quarantined_provider_binding_mismatch"
|
|
4986
|
+
];
|
|
4987
|
+
function unobservableRetainedProcessOutcomeSql(outcome) {
|
|
4988
|
+
return sql9`${outcome} in (${sql9.join(
|
|
4989
|
+
UNOBSERVABLE_RETAINED_PROCESS_OUTCOMES.map((value) => sql9`${value}`),
|
|
4990
|
+
sql9`, `
|
|
4991
|
+
)})`;
|
|
4992
|
+
}
|
|
4979
4993
|
var commandObservationUnavailable = sql9`
|
|
4980
|
-
${sessionBackgroundCommands.state} in ('running','stopping') and
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
'
|
|
4994
|
+
${sessionBackgroundCommands.state} in ('running','stopping') and (
|
|
4995
|
+
(${sessionBackgroundCommands.provider} = 'connected_machine'
|
|
4996
|
+
and coalesce(${sessionBackgroundCommands.lastReconcileOutcome}
|
|
4997
|
+
in ('provider_offline', 'provider_error'), false))
|
|
4998
|
+
or exists (
|
|
4999
|
+
select 1 from sandbox_retained_processes process
|
|
5000
|
+
where process.id = ${sessionBackgroundCommands.retainedProcessId}
|
|
5001
|
+
and process.account_id = ${sessionBackgroundCommands.accountId}
|
|
5002
|
+
and process.workspace_id = ${sessionBackgroundCommands.workspaceId}
|
|
5003
|
+
and process.session_id = ${sessionBackgroundCommands.sessionId}
|
|
5004
|
+
and process.state = 'active'
|
|
5005
|
+
and ${unobservableRetainedProcessOutcomeSql(sql9`process.last_reconcile_outcome`)}))`;
|
|
4991
5006
|
var commandReadColumns = {
|
|
4992
5007
|
...getTableColumns(sessionBackgroundCommands),
|
|
4993
5008
|
observationUnavailable: commandObservationUnavailable
|
|
4994
5009
|
};
|
|
5010
|
+
function connectedCommandReconciliation(row) {
|
|
5011
|
+
const outcome = row.lastReconcileOutcome;
|
|
5012
|
+
const observedAt = row.reconcileProofObservedAt?.toISOString();
|
|
5013
|
+
return {
|
|
5014
|
+
// Legacy diagnostic text is not a public message or a routing locator.
|
|
5015
|
+
lastOutcome: outcome === null ? null : /^[a-z][a-z0-9_]{0,63}$/.test(outcome) ? outcome : "unknown",
|
|
5016
|
+
attempts: row.reconcileAttempts,
|
|
5017
|
+
dueAt: row.reconcileAfter.toISOString(),
|
|
5018
|
+
claimedAt: row.reconcileClaimedAt?.toISOString() ?? null,
|
|
5019
|
+
terminalProof: observedAt && row.reconcileProofOutcome === "exited" && row.reconcileProofExitCode !== null ? { outcome: "exited", exitCode: row.reconcileProofExitCode, observedAt } : observedAt && row.reconcileProofOutcome === "lost" ? { outcome: "lost", exitCode: null, observedAt } : null
|
|
5020
|
+
};
|
|
5021
|
+
}
|
|
4995
5022
|
function mapCommand(row) {
|
|
4996
5023
|
const terminal = row.state === "exited" || row.state === "lost";
|
|
4997
5024
|
const legacyFailureCode = row.provider === "connected_machine" ? /^op_failure_([A-Za-z0-9_-]{1,128})$/.exec(row.settlementReason ?? "")?.[1] : void 0;
|
|
@@ -5010,6 +5037,7 @@ function mapCommand(row) {
|
|
|
5010
5037
|
provider: row.provider,
|
|
5011
5038
|
state: row.state,
|
|
5012
5039
|
...!terminal && row.observationUnavailable ? { observationStatus: "unavailable" } : {},
|
|
5040
|
+
...row.provider === "connected_machine" ? { reconciliation: connectedCommandReconciliation(row) } : {},
|
|
5013
5041
|
commandPreview: row.commandPreview,
|
|
5014
5042
|
...row.commandText !== null ? { commandText: row.commandText } : {},
|
|
5015
5043
|
cancelRequestedAt: row.cancelRequestedAt?.toISOString() ?? null,
|
|
@@ -5711,7 +5739,7 @@ async function readSessionBackgroundCommandOutput(db, input) {
|
|
|
5711
5739
|
);
|
|
5712
5740
|
const page = projectCommandOutputPage({ ...input, rows });
|
|
5713
5741
|
const terminal = command.state === "exited" || command.state === "lost";
|
|
5714
|
-
const observed = terminal ? await observeSessionBackgroundCommandCompletion(db, input) : command;
|
|
5742
|
+
const observed = terminal && command.completionObservedAt === null ? await observeSessionBackgroundCommandCompletion(db, input) : command;
|
|
5715
5743
|
return {
|
|
5716
5744
|
commandId: command.id,
|
|
5717
5745
|
state: command.state,
|
|
@@ -5813,6 +5841,8 @@ export {
|
|
|
5813
5841
|
renderRealtimeHumanInputResponseContext,
|
|
5814
5842
|
SESSION_BACKGROUND_COMMAND_REASON_MAX_BYTES,
|
|
5815
5843
|
boundedSessionBackgroundCommandReason,
|
|
5844
|
+
UNOBSERVABLE_RETAINED_PROCESS_OUTCOMES,
|
|
5845
|
+
unobservableRetainedProcessOutcomeSql,
|
|
5816
5846
|
backgroundCommandActivityForSessions,
|
|
5817
5847
|
listSessionBackgroundCommands,
|
|
5818
5848
|
insertManagedSessionBackgroundCommandInTransaction,
|
|
@@ -5876,4 +5906,4 @@ export {
|
|
|
5876
5906
|
setWorkspacePauseTimerInTransaction,
|
|
5877
5907
|
fireWorkspacePauseTimerInTransaction
|
|
5878
5908
|
};
|
|
5879
|
-
//# sourceMappingURL=chunk-
|
|
5909
|
+
//# sourceMappingURL=chunk-DBCRRNH4.js.map
|