@opengeni/db 0.2.2 → 0.4.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/{chunk-PSX56ZTL.js → chunk-T2U4H4Z2.js} +31 -1
- package/dist/chunk-T2U4H4Z2.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +293 -15
- package/dist/index.js.map +1 -1
- package/dist/provision-roles.d.ts +91 -9
- package/dist/{schema-fwrPBw5T.d.ts → schema-DuRsrmzD.d.ts} +269 -2
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +3 -1
- package/drizzle/0035_session_mcp_servers.sql +50 -0
- package/drizzle/0036_modal_lease_orphan_reaper.sql +92 -0
- package/drizzle/0037_session_instructions.sql +18 -0
- package/package.json +3 -3
- package/src/event-payload-sanitizer.ts +58 -1
- package/src/index.ts +392 -21
- package/src/schema.ts +29 -0
- package/dist/chunk-PSX56ZTL.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SessionEventType, Permission, CapabilityKind, CapabilitySource, ScheduledTaskStatus, ScheduledTaskScheduleSpec, ScheduledTaskRunMode, ScheduledTaskOverlapPolicy, ScheduledTaskAgentConfig, SessionGoalCreatedBy, SocialProvider, SocialConnectionStatus, SessionTurnSource, ResourceRef, ToolRef, ReasoningEffort, SandboxBackend, SessionGoal, CapabilityPack, SessionTurn, SessionEvent, SessionStatus, Session, BillingBalance, AccessContext, FileAsset, ApiKey, ScheduledTask, ScheduledTaskTriggerType, ScheduledTaskRun, SandboxOs, SocialConnection, SocialPost, Workspace, WorkspaceEnvironment, CapabilityInstallation, PackInstallation, SessionTurnStatus, CapabilityCatalogItem, FileUploadStatus, ManagedAccount, AccessGrant, WorkspaceRegisteredPack, UsageEvent, WorkspaceMember, SessionGoalStatus, WorkspaceEnvironmentVariableMetadata, PackInstallationStatus, ScheduledTaskRunStatus } from '@opengeni/contracts';
|
|
1
|
+
import { SessionEventType, Permission, CapabilityKind, CapabilitySource, ScheduledTaskStatus, ScheduledTaskScheduleSpec, ScheduledTaskRunMode, ScheduledTaskOverlapPolicy, ScheduledTaskAgentConfig, SessionGoalCreatedBy, SocialProvider, SocialConnectionStatus, SessionTurnSource, ResourceRef, ToolRef, ReasoningEffort, SandboxBackend, SessionGoal, CapabilityPack, SessionMcpServerMetadata, SessionTurn, SessionEvent, SessionStatus, Session, BillingBalance, AccessContext, FileAsset, ApiKey, ScheduledTask, ScheduledTaskTriggerType, ScheduledTaskRun, SandboxOs, SocialConnection, SocialPost, Workspace, WorkspaceEnvironment, CapabilityInstallation, PackInstallation, SessionTurnStatus, CapabilityCatalogItem, FileUploadStatus, ManagedAccount, AccessGrant, WorkspaceRegisteredPack, UsageEvent, WorkspaceMember, SessionGoalStatus, WorkspaceEnvironmentVariableMetadata, PackInstallationStatus, ScheduledTaskRunStatus } from '@opengeni/contracts';
|
|
2
2
|
import { environmentsEncryptionKeyBytes, Settings } from '@opengeni/config';
|
|
3
3
|
import { refreshCodexToken, CodexTokenSnapshot, CodexUsagePayload } from '@opengeni/codex';
|
|
4
4
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
5
|
-
import { s as schema, e as enrollmentOsValues, a as enrollmentExposureValues, d as deviceEnrollmentStatusValues, b as enrollmentStatusValues, c as sandboxKindValues, f as sessionRecordingCodecValues, g as sessionRecordingModeValues, h as sessionRecordingStateValues } from './schema-
|
|
5
|
+
import { s as schema, e as enrollmentOsValues, a as enrollmentExposureValues, d as deviceEnrollmentStatusValues, b as enrollmentStatusValues, c as sandboxKindValues, f as sessionRecordingCodecValues, g as sessionRecordingModeValues, h as sessionRecordingStateValues } from './schema-DuRsrmzD.js';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import './migrate.js';
|
|
8
8
|
|
|
@@ -483,6 +483,29 @@ type EnabledMcpCapabilityServer = {
|
|
|
483
483
|
*/
|
|
484
484
|
headersEncrypted?: Record<string, string>;
|
|
485
485
|
};
|
|
486
|
+
type CreateSessionMcpServerInput = {
|
|
487
|
+
id: string;
|
|
488
|
+
name?: string | null;
|
|
489
|
+
url: string;
|
|
490
|
+
allowedTools?: string[] | null;
|
|
491
|
+
timeoutMs?: number | null;
|
|
492
|
+
cacheToolsList?: boolean | null;
|
|
493
|
+
headersEncrypted?: Record<string, string>;
|
|
494
|
+
};
|
|
495
|
+
type UpdateSessionMcpServerCredentialsInput = {
|
|
496
|
+
id: string;
|
|
497
|
+
headersEncrypted: Record<string, string>;
|
|
498
|
+
};
|
|
499
|
+
type UpdateSessionMcpServerCredentialsResult = {
|
|
500
|
+
servers: SessionMcpServerMetadata[];
|
|
501
|
+
missingIds: string[];
|
|
502
|
+
};
|
|
503
|
+
type SessionMcpServerForRun = SessionMcpServerMetadata & {
|
|
504
|
+
allowedTools?: string[];
|
|
505
|
+
timeoutMs?: number;
|
|
506
|
+
cacheToolsList?: boolean;
|
|
507
|
+
headers: Record<string, string>;
|
|
508
|
+
};
|
|
486
509
|
type EnqueueSessionTurnInput = {
|
|
487
510
|
accountId: string;
|
|
488
511
|
workspaceId: string;
|
|
@@ -951,6 +974,19 @@ declare function recordAuditEvent(db: Database, input: {
|
|
|
951
974
|
targetId?: string | null;
|
|
952
975
|
metadata?: Record<string, unknown>;
|
|
953
976
|
}): Promise<void>;
|
|
977
|
+
declare function createSessionMcpServers(db: Database, input: {
|
|
978
|
+
accountId: string;
|
|
979
|
+
workspaceId: string;
|
|
980
|
+
sessionId: string;
|
|
981
|
+
servers: CreateSessionMcpServerInput[];
|
|
982
|
+
}): Promise<SessionMcpServerMetadata[]>;
|
|
983
|
+
declare function listSessionMcpServerMetadata(db: Database, workspaceId: string, sessionId: string): Promise<SessionMcpServerMetadata[]>;
|
|
984
|
+
declare function updateSessionMcpServerCredentials(db: Database, input: {
|
|
985
|
+
workspaceId: string;
|
|
986
|
+
sessionId: string;
|
|
987
|
+
updates: UpdateSessionMcpServerCredentialsInput[];
|
|
988
|
+
}): Promise<UpdateSessionMcpServerCredentialsResult>;
|
|
989
|
+
declare function listSessionMcpServersForRun(db: Database, workspaceId: string, sessionId: string, encryptionKey: Uint8Array): Promise<SessionMcpServerForRun[]>;
|
|
954
990
|
declare function createSession(db: Database, input: {
|
|
955
991
|
accountId: string;
|
|
956
992
|
workspaceId: string;
|
|
@@ -962,10 +998,12 @@ declare function createSession(db: Database, input: {
|
|
|
962
998
|
sandboxBackend: SandboxBackend;
|
|
963
999
|
environmentId?: string | null;
|
|
964
1000
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
1001
|
+
instructions?: string | null;
|
|
965
1002
|
parentSessionId?: string | null;
|
|
966
1003
|
createIdempotencyKey?: string | null;
|
|
967
1004
|
sandboxGroupId?: string | null;
|
|
968
1005
|
sandboxOs?: SandboxOs;
|
|
1006
|
+
mcpServers?: CreateSessionMcpServerInput[];
|
|
969
1007
|
}): Promise<Session>;
|
|
970
1008
|
/**
|
|
971
1009
|
* Inserts a session under a workspace-scoped CREATE idempotency key, collapsing
|
|
@@ -988,10 +1026,12 @@ declare function createSessionWithIdempotencyKey(db: Database, input: {
|
|
|
988
1026
|
sandboxBackend: SandboxBackend;
|
|
989
1027
|
environmentId?: string | null;
|
|
990
1028
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
1029
|
+
instructions?: string | null;
|
|
991
1030
|
parentSessionId?: string | null;
|
|
992
1031
|
createIdempotencyKey: string;
|
|
993
1032
|
sandboxGroupId?: string | null;
|
|
994
1033
|
sandboxOs?: SandboxOs;
|
|
1034
|
+
mcpServers?: CreateSessionMcpServerInput[];
|
|
995
1035
|
}): Promise<{
|
|
996
1036
|
session: Session;
|
|
997
1037
|
created: boolean;
|
|
@@ -1029,7 +1069,14 @@ declare function listSessions(db: Database, workspaceId: string, limit?: number)
|
|
|
1029
1069
|
*/
|
|
1030
1070
|
declare function countActiveSessionsForWorkspace(db: Database, workspaceId: string): Promise<number>;
|
|
1031
1071
|
declare function requireSession(db: Database, workspaceId: string, sessionId: string): Promise<Session>;
|
|
1032
|
-
|
|
1072
|
+
type ListSessionEventsOptions = {
|
|
1073
|
+
after?: number;
|
|
1074
|
+
before?: number;
|
|
1075
|
+
limit?: number;
|
|
1076
|
+
};
|
|
1077
|
+
declare function listSessionEvents(db: Database, workspaceId: string, sessionId: string): Promise<SessionEvent[]>;
|
|
1078
|
+
declare function listSessionEvents(db: Database, workspaceId: string, sessionId: string, after: number, limit?: number): Promise<SessionEvent[]>;
|
|
1079
|
+
declare function listSessionEvents(db: Database, workspaceId: string, sessionId: string, options: ListSessionEventsOptions): Promise<SessionEvent[]>;
|
|
1033
1080
|
declare function getSessionEvent(db: Database, workspaceId: string, eventId: string): Promise<SessionEvent | null>;
|
|
1034
1081
|
declare function getLatestRunState(db: Database, workspaceId: string, sessionId: string): Promise<{
|
|
1035
1082
|
id: string;
|
|
@@ -1060,8 +1107,8 @@ declare function getSessionHistoryItems(db: Database, workspaceId: string, sessi
|
|
|
1060
1107
|
}>>;
|
|
1061
1108
|
/**
|
|
1062
1109
|
* The LIVE conversation-truth read path: only active rows, position-ordered.
|
|
1063
|
-
* After a client-side context compaction this returns [
|
|
1064
|
-
*
|
|
1110
|
+
* After a client-side context compaction this returns [retained user messages,
|
|
1111
|
+
* active summary]; with no compaction yet it equals
|
|
1065
1112
|
* getSessionHistoryItems. The model-facing read path uses this so superseded
|
|
1066
1113
|
* (summarized-away) prefix rows are excluded while the full transcript stays in
|
|
1067
1114
|
* the table as an audit trail.
|
|
@@ -1137,8 +1184,18 @@ declare function applyContextCompaction(db: Database, input: {
|
|
|
1137
1184
|
turnId?: string | null;
|
|
1138
1185
|
/** Active prefix rows with position < boundaryPosition get superseded. */
|
|
1139
1186
|
boundaryPosition: number;
|
|
1140
|
-
/**
|
|
1187
|
+
/** Position for the new summary row. Old boundary mode uses a fractional half-step before the kept tail. */
|
|
1141
1188
|
summaryPosition: number;
|
|
1189
|
+
/**
|
|
1190
|
+
* Optional replacement rows inserted after superseding the old active set.
|
|
1191
|
+
* Used by Codex-parity client compaction to rebuild active history as retained
|
|
1192
|
+
* user messages plus one summary. These rows are synthetic replay rows, so
|
|
1193
|
+
* they intentionally do not inherit the current compaction turn id.
|
|
1194
|
+
*/
|
|
1195
|
+
replacementItems?: Array<{
|
|
1196
|
+
position: number;
|
|
1197
|
+
item: Record<string, unknown>;
|
|
1198
|
+
}>;
|
|
1142
1199
|
summaryItem: Record<string, unknown>;
|
|
1143
1200
|
}): Promise<void>;
|
|
1144
1201
|
/**
|
|
@@ -1377,6 +1434,13 @@ interface LeaseSnapshot {
|
|
|
1377
1434
|
resumeState: Record<string, unknown> | null;
|
|
1378
1435
|
expiresAt: Date;
|
|
1379
1436
|
}
|
|
1437
|
+
interface LiveModalSandboxLeaseAttribution {
|
|
1438
|
+
leaseId: string;
|
|
1439
|
+
workspaceId: string;
|
|
1440
|
+
sandboxGroupId: string;
|
|
1441
|
+
instanceId: string | null;
|
|
1442
|
+
liveness: SandboxLeaseLiveness;
|
|
1443
|
+
}
|
|
1380
1444
|
interface AcquireLeaseInput {
|
|
1381
1445
|
accountId: string;
|
|
1382
1446
|
workspaceId: string;
|
|
@@ -1429,6 +1493,19 @@ declare function commitWarmingToWarm(db: Database, input: {
|
|
|
1429
1493
|
committed: boolean;
|
|
1430
1494
|
lease: LeaseSnapshot | null;
|
|
1431
1495
|
}>;
|
|
1496
|
+
declare function recordWarmingSandboxCreated(db: Database, input: {
|
|
1497
|
+
accountId: string;
|
|
1498
|
+
workspaceId: string;
|
|
1499
|
+
sandboxGroupId: string;
|
|
1500
|
+
expectedEpoch: number;
|
|
1501
|
+
instanceId: string;
|
|
1502
|
+
resumeBackendId?: string | null;
|
|
1503
|
+
resumeState?: Record<string, unknown> | null;
|
|
1504
|
+
leaseTtlMs: number;
|
|
1505
|
+
}): Promise<{
|
|
1506
|
+
recorded: boolean;
|
|
1507
|
+
lease: LeaseSnapshot | null;
|
|
1508
|
+
}>;
|
|
1432
1509
|
declare function failWarmingToCold(db: Database, input: {
|
|
1433
1510
|
accountId: string;
|
|
1434
1511
|
workspaceId: string;
|
|
@@ -1482,6 +1559,7 @@ interface MeterableWarmLease {
|
|
|
1482
1559
|
backend: string;
|
|
1483
1560
|
}
|
|
1484
1561
|
declare function listMeterableWarmLeases(db: Database): Promise<MeterableWarmLease[]>;
|
|
1562
|
+
declare function listLiveModalSandboxLeaseAttributions(db: Database): Promise<LiveModalSandboxLeaseAttribution[]>;
|
|
1485
1563
|
declare function reArmDrainingLease(db: Database, input: {
|
|
1486
1564
|
accountId: string;
|
|
1487
1565
|
workspaceId: string;
|
|
@@ -2047,7 +2125,10 @@ declare function appendSessionEventsAndUpdateSession(db: Database, workspaceId:
|
|
|
2047
2125
|
status?: SessionStatus;
|
|
2048
2126
|
activeTurnId?: string | null;
|
|
2049
2127
|
}): Promise<SessionEvent[]>;
|
|
2050
|
-
|
|
2128
|
+
type LockedSessionUpdateContext = {
|
|
2129
|
+
updateSessionMcpServerCredentials: (updates: UpdateSessionMcpServerCredentialsInput[]) => Promise<UpdateSessionMcpServerCredentialsResult>;
|
|
2130
|
+
};
|
|
2131
|
+
type LockedSessionUpdateResult = {
|
|
2051
2132
|
events: AppendEventInput[];
|
|
2052
2133
|
update?: {
|
|
2053
2134
|
resources?: ResourceRef[];
|
|
@@ -2057,7 +2138,8 @@ declare function appendSessionEventsWithLockedSessionUpdate(db: Database, worksp
|
|
|
2057
2138
|
status?: SessionStatus;
|
|
2058
2139
|
activeTurnId?: string | null;
|
|
2059
2140
|
};
|
|
2060
|
-
}
|
|
2141
|
+
};
|
|
2142
|
+
declare function appendSessionEventsWithLockedSessionUpdate(db: Database, workspaceId: string, sessionId: string, build: (session: Session, context: LockedSessionUpdateContext) => LockedSessionUpdateResult | Promise<LockedSessionUpdateResult>): Promise<SessionEvent[]>;
|
|
2061
2143
|
declare function sessionSubject(workspaceId: string, sessionId: string): string;
|
|
2062
2144
|
|
|
2063
|
-
export {
|
|
2145
|
+
export { SandboxLeaseSupersededError as $, type AccrueWarmSecondsResult as A, type BootstrapWorkspaceInput as B, CLEARED_RUN_STATE as C, type Database as D, type EnableCapabilityInstallationInput as E, type EnrollmentExposure as F, type EnrollmentOs as G, type EnrollmentRecord as H, type EnrollmentStatus as I, type ForceDrainResult as J, type GitHubInstallation as K, type GoalContinuationDecision as L, type LeaseHolderKind as M, type LeaseSnapshot as N, type ListSessionEventsOptions as O, type LiveModalSandboxLeaseAttribution as P, type ProvisionResult, type ProvisionRolesOptions, MACHINE_METRICS_SERIES_INTERVAL_MS as Q, type MachineMetricsRow as R, type MachineMetricsSample as S, type MeterableWarmLease as T, type ReapDrainable as U, type RegisterWorkspacePackInput as V, type RlsContext as W, type RlsStrategy as X, SandboxImageConflictError as Y, type SandboxKind as Z, type SandboxLeaseLiveness as _, type AcquireLeaseInput as a, createSessionWithIdempotencyKey as a$, type SandboxPtySessionRow as a0, type SandboxRecord as a1, type SessionCodexState as a2, type SessionMcpServerForRun as a3, type SessionRecordingCodec as a4, type SessionRecordingMode as a5, type SessionRecordingRow as a6, type SessionRecordingState as a7, type StreamAcknowledgment as a8, type UpdateQueuedSessionTurnInput as a9, commitWarmingToWarm as aA, completeFileUpload as aB, confirmDrainCold as aC, consumeDeviceEnrollmentRequest as aD, consumeSessionCompactionRequest as aE, countActiveApiKeysForWorkspace as aF, countActiveSessionHistoryItems as aG, countActiveSessionsForWorkspace as aH, countActiveSessionsUsingEnvironment as aI, countConsecutiveReactiveRotations as aJ, countScheduledTasksForWorkspace as aK, countScheduledTasksUsingEnvironment as aL, countSessionHistoryItems as aM, countTurnSessionHistoryItems as aN, countWorkspaceEnvironments as aO, countWorkspacesForAccount as aP, createApiKey as aQ, createDb as aR, createDeviceEnrollmentRequest as aS, createEnrollment as aT, createFileUpload as aU, createSandbox as aV, createScheduledTask as aW, createScheduledTaskRun as aX, createSession as aY, createSessionGoal as aZ, createSessionMcpServers as a_, type UpdateScheduledTaskInput as aa, type UpdateSessionMcpServerCredentialsInput as ab, type UpdateSessionMcpServerCredentialsResult as ac, type UserLookup as ad, type WakeParentForChildCompletionInput as ae, type WakeParentForChildCompletionResult as af, type WorkspaceEnvironmentForRun as ag, accrueWarmSeconds as ah, acquireLease as ai, allAccountPermissions as aj, allWorkspacePermissions as ak, appendSessionEvents as al, appendSessionEventsAndUpdateSession as am, appendSessionEventsWithLockedSessionUpdate as an, appendSessionHistoryItems as ao, applyContextCompaction as ap, applyCreditDebitUpToBalance as aq, applyCreditLedgerEntry as ar, approveDeviceEnrollmentRequest as as, bootstrapWorkspace as at, buildCodexTokenResolver as au, cancelQueuedSessionTurn as av, claimNextQueuedTurn as aw, clearSessionContext as ax, clearedContextMarkerItem as ay, closePtySession as az, type AcquireLeaseResult as b, getWorkspace as b$, createSocialConnection as b0, createSocialPost as b1, createTurn as b2, createWorkspace as b3, createWorkspaceEnvironment as b4, decryptEnvironmentValue as b5, decryptedCapabilityHeaders as b6, deleteRecording as b7, deleteScheduledTask as b8, deleteWorkspace as b9, getCodexCredentialStatus as bA, getCodexRotationSettings as bB, getDeviceEnrollmentRequestByDeviceCode as bC, getEnrollment as bD, getFile as bE, getFileUpload as bF, getLatestRunState as bG, getManagedAccount as bH, getManagedUserByEmail as bI, getOpenPtySession as bJ, getPackInstallation as bK, getPendingDeviceEnrollmentRequestByUserCode as bL, getPendingDeviceEnrollmentRequestByUserCodeGlobal as bM, getRecording as bN, getSandbox as bO, getSandboxSessionEnvelope as bP, getScheduledTask as bQ, getSession as bR, getSessionByCreateIdempotencyKey as bS, getSessionCodexState as bT, getSessionEvent as bU, getSessionGoal as bV, getSessionHistoryItems as bW, getSessionTurn as bX, getSocialConnection as bY, getStoredCapabilityHeaderCiphertext as bZ, getStreamAcknowledgment as b_, deleteWorkspaceEnvironment as ba, deleteWorkspaceEnvironmentVariable as bb, deleteWorkspacePack as bc, denyDeviceEnrollmentRequest as bd, disableCapabilityInstallation as be, disconnectAllCodexAccounts as bf, disconnectCodexAccount as bg, enableCapabilityInstallation as bh, enablePackInstallation as bi, encryptEnvironmentValue as bj, enqueueSessionTurn as bk, ensureCodexRotationSettings as bl, ensureManagedAccessForUser as bm, evaluateGoalContinuation as bn, failWarmingToCold as bo, fetchCodexUsageForAccount as bp, finalizeEnrollmentByToken as bq, findActiveApiKeyByHash as br, finishTurn as bs, forceDrainOverLimitViewerOnlyBoxes as bt, getActiveSessionHistoryItems as bu, getAnySessionInGroup as bv, getBillingBalance as bw, getBillingCustomer as bx, getCapabilityCatalogItem as by, getCapabilityInstallation as bz, type ActiveSandboxPointer as c, recordCodexAccountUsage as c$, getWorkspaceEnvironment as c0, getWorkspaceEnvironmentByName as c1, getWorkspaceEnvironmentValuesForRun as c2, getWorkspaceGrant as c3, getWorkspacePack as c4, grantWorkspaceAccess as c5, hasCreditLedgerEntry as c6, heartbeatLeaseHolder as c7, incrementTurnWorkerDeathRedispatches as c8, ingestMachineMetricsSample as c9, listSessionTurns as cA, listSessions as cB, listSocialConnections as cC, listSocialPosts as cD, listUsageEvents as cE, listWorkspaceEnvironments as cF, listWorkspaceMembers as cG, listWorkspacePacks as cH, listWorkspacesForSubject as cI, loadCodexCredentialForRun as cJ, loadWorkspaceEnvironmentForRun as cK, markFileUploadFailed as cL, markStripeWebhookProcessed as cM, mcpServerIdForCapability as cN, nextSessionHistoryPosition as cO, orphanedResultRowIndicesForRepair as cP, persistDrainSnapshot as cQ, reArmDrainingLease as cR, readActiveSandbox as cS, readLease as cT, readMachineMetricsLatest as cU, readMachineMetricsLatestForWorkspace as cV, readMachineMetricsSeries as cW, reapStaleLeaseHolders as cX, reapStaleLeaseHoldersGlobal as cY, recordAuditEvent as cZ, recordCodexAccountConnectors as c_, insertMachineMetricsSeries as ca, insertPtySession as cb, insertRecording as cc, isCodexBilledTurn as cd, isStripeWebhookProcessed as ce, listApiKeys as cf, listCapabilityCatalogItems as cg, listCapabilityInstallations as ch, listCodexAccountStatuses as ci, listDistinctEnvironmentIdsInGroup as cj, listEnabledMcpCapabilityServers as ck, listEnrollments as cl, listGitHubInstallationIdsForWorkspace as cm, listGitHubInstallationsForWorkspace as cn, listLiveModalSandboxLeaseAttributions as co, listMeterableWarmLeases as cp, listOpenPtySessions as cq, listPackInstallations as cr, listRecordings as cs, listSandboxes as ct, listScheduledTaskRuns as cu, listScheduledTasks as cv, listSessionEvents as cw, listSessionIdsInGroup as cx, listSessionMcpServerMetadata as cy, listSessionMcpServersForRun as cz, type AppendEventInput as d, upsertSandboxSessionEnvelope as d$, recordCodexTokenRefresh as d0, recordLeaseDataPlaneUrl as d1, recordLeaseTerminalDataPlaneUrl as d2, recordSessionActiveCodexCredential as d3, recordStreamAcknowledgment as d4, recordStripeWebhookEvent as d5, recordUsageEvent as d6, recordWarmingSandboxCreated as d7, registerDbBinding as d8, registerWorkspacePack as d9, setRlsContext as dA, setSessionCodexPin as dB, setSessionGoalLastContinuationTurn as dC, setSessionGoalStatus as dD, setSessionLastInputTokens as dE, setSessionStatus as dF, setTemporalWorkflowId as dG, setWorkspaceEnvironmentVariable as dH, sumUsageQuantity as dI, touchEnrollmentLastSeen as dJ, updateCodexRotationSettings as dK, updatePackInstallationStatus as dL, updatePtySessionActivity as dM, updateQueuedSessionTurn as dN, updateRecording as dO, updateScheduledTask as dP, updateScheduledTaskRun as dQ, updateSessionGoal as dR, updateSessionMcpServerCredentials as dS, updateSessionTitle as dT, updateWorkspace as dU, updateWorkspaceEnvironment as dV, upsertBillingCustomer as dW, upsertCapabilityCatalogItem as dX, upsertCodexSubscriptionCredential as dY, upsertGitHubInstallation as dZ, upsertMachineMetricsLatest as d_, releaseLeaseHolder as da, removeWorkspaceMember as db, renameCodexAccount as dc, reorderQueuedSessionTurns as dd, requestSessionCompaction as de, requeuePreemptedTurn as df, requireFile as dg, requireScheduledTask as dh, requireSession as di, requireSocialConnection as dj, requireWorkspace as dk, revokeApiKey as dl, revokeEnrollment as dm, revokeViewer as dn, rlsContextForWorkspace as dp, rlsStrategyFor as dq, sanitizeEventPayload as dr, sanitizeEventString as ds, saveRunState as dt, sessionSubject as du, setActiveCodexCredential as dv, setActiveSandbox as dw, setCodexCredentialExhausted as dx, setCodexCredentialStatus as dy, setEnrollmentHasDisplay as dz, CODEX_ROTATION_STRATEGIES as e, upsertSessionGoal as e0, wakeParentSessionForChildCompletion as e1, withAccountRls as e2, withRlsContext as e3, withWorkspaceRls as e4, withWorkspaceUsageLock as e5, workspaceCodexSubscriptionActive as e6, type ClearSessionContextResult as f, type CodexAccountStatus as g, type CodexAccountUsageSnapshot as h, type CodexAuthDeps as i, type CodexCredentialForRun as j, type CodexCredentialTokens as k, type CodexRotationSettings as l, type CodexRotationStrategy as m, type CreateCapabilityCatalogItemInput as n, type CreateDbOptions as o, type CreatePackInstallationInput as p, provisionRoles, type CreateScheduledTaskInput as q, type CreateSessionGoalInput as r, type CreateSessionMcpServerInput as s, type CreateSocialConnectionInput as t, type CreateSocialPostInput as u, type DbClient as v, type DeviceEnrollmentRequestRecord as w, type DeviceEnrollmentStatus as x, type EnabledMcpCapabilityServer as y, type EnqueueSessionTurnInput as z };
|
|
@@ -1655,6 +1655,23 @@ declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1655
1655
|
identity: undefined;
|
|
1656
1656
|
generated: undefined;
|
|
1657
1657
|
}, {}, {}>;
|
|
1658
|
+
instructions: drizzle_orm_pg_core.PgColumn<{
|
|
1659
|
+
name: "instructions";
|
|
1660
|
+
tableName: "sessions";
|
|
1661
|
+
dataType: "string";
|
|
1662
|
+
columnType: "PgText";
|
|
1663
|
+
data: string;
|
|
1664
|
+
driverParam: string;
|
|
1665
|
+
notNull: false;
|
|
1666
|
+
hasDefault: false;
|
|
1667
|
+
isPrimaryKey: false;
|
|
1668
|
+
isAutoincrement: false;
|
|
1669
|
+
hasRuntimeDefault: false;
|
|
1670
|
+
enumValues: [string, ...string[]];
|
|
1671
|
+
baseColumn: never;
|
|
1672
|
+
identity: undefined;
|
|
1673
|
+
generated: undefined;
|
|
1674
|
+
}, {}, {}>;
|
|
1658
1675
|
resources: drizzle_orm_pg_core.PgColumn<{
|
|
1659
1676
|
name: "resources";
|
|
1660
1677
|
tableName: "sessions";
|
|
@@ -2057,6 +2074,255 @@ declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2057
2074
|
};
|
|
2058
2075
|
dialect: "pg";
|
|
2059
2076
|
}>;
|
|
2077
|
+
declare const sessionMcpServers: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2078
|
+
name: "session_mcp_servers";
|
|
2079
|
+
schema: undefined;
|
|
2080
|
+
columns: {
|
|
2081
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
2082
|
+
name: "id";
|
|
2083
|
+
tableName: "session_mcp_servers";
|
|
2084
|
+
dataType: "string";
|
|
2085
|
+
columnType: "PgUUID";
|
|
2086
|
+
data: string;
|
|
2087
|
+
driverParam: string;
|
|
2088
|
+
notNull: true;
|
|
2089
|
+
hasDefault: true;
|
|
2090
|
+
isPrimaryKey: true;
|
|
2091
|
+
isAutoincrement: false;
|
|
2092
|
+
hasRuntimeDefault: false;
|
|
2093
|
+
enumValues: undefined;
|
|
2094
|
+
baseColumn: never;
|
|
2095
|
+
identity: undefined;
|
|
2096
|
+
generated: undefined;
|
|
2097
|
+
}, {}, {}>;
|
|
2098
|
+
accountId: drizzle_orm_pg_core.PgColumn<{
|
|
2099
|
+
name: "account_id";
|
|
2100
|
+
tableName: "session_mcp_servers";
|
|
2101
|
+
dataType: "string";
|
|
2102
|
+
columnType: "PgUUID";
|
|
2103
|
+
data: string;
|
|
2104
|
+
driverParam: string;
|
|
2105
|
+
notNull: true;
|
|
2106
|
+
hasDefault: false;
|
|
2107
|
+
isPrimaryKey: false;
|
|
2108
|
+
isAutoincrement: false;
|
|
2109
|
+
hasRuntimeDefault: false;
|
|
2110
|
+
enumValues: undefined;
|
|
2111
|
+
baseColumn: never;
|
|
2112
|
+
identity: undefined;
|
|
2113
|
+
generated: undefined;
|
|
2114
|
+
}, {}, {}>;
|
|
2115
|
+
workspaceId: drizzle_orm_pg_core.PgColumn<{
|
|
2116
|
+
name: "workspace_id";
|
|
2117
|
+
tableName: "session_mcp_servers";
|
|
2118
|
+
dataType: "string";
|
|
2119
|
+
columnType: "PgUUID";
|
|
2120
|
+
data: string;
|
|
2121
|
+
driverParam: string;
|
|
2122
|
+
notNull: true;
|
|
2123
|
+
hasDefault: false;
|
|
2124
|
+
isPrimaryKey: false;
|
|
2125
|
+
isAutoincrement: false;
|
|
2126
|
+
hasRuntimeDefault: false;
|
|
2127
|
+
enumValues: undefined;
|
|
2128
|
+
baseColumn: never;
|
|
2129
|
+
identity: undefined;
|
|
2130
|
+
generated: undefined;
|
|
2131
|
+
}, {}, {}>;
|
|
2132
|
+
sessionId: drizzle_orm_pg_core.PgColumn<{
|
|
2133
|
+
name: "session_id";
|
|
2134
|
+
tableName: "session_mcp_servers";
|
|
2135
|
+
dataType: "string";
|
|
2136
|
+
columnType: "PgUUID";
|
|
2137
|
+
data: string;
|
|
2138
|
+
driverParam: string;
|
|
2139
|
+
notNull: true;
|
|
2140
|
+
hasDefault: false;
|
|
2141
|
+
isPrimaryKey: false;
|
|
2142
|
+
isAutoincrement: false;
|
|
2143
|
+
hasRuntimeDefault: false;
|
|
2144
|
+
enumValues: undefined;
|
|
2145
|
+
baseColumn: never;
|
|
2146
|
+
identity: undefined;
|
|
2147
|
+
generated: undefined;
|
|
2148
|
+
}, {}, {}>;
|
|
2149
|
+
serverId: drizzle_orm_pg_core.PgColumn<{
|
|
2150
|
+
name: "server_id";
|
|
2151
|
+
tableName: "session_mcp_servers";
|
|
2152
|
+
dataType: "string";
|
|
2153
|
+
columnType: "PgText";
|
|
2154
|
+
data: string;
|
|
2155
|
+
driverParam: string;
|
|
2156
|
+
notNull: true;
|
|
2157
|
+
hasDefault: false;
|
|
2158
|
+
isPrimaryKey: false;
|
|
2159
|
+
isAutoincrement: false;
|
|
2160
|
+
hasRuntimeDefault: false;
|
|
2161
|
+
enumValues: [string, ...string[]];
|
|
2162
|
+
baseColumn: never;
|
|
2163
|
+
identity: undefined;
|
|
2164
|
+
generated: undefined;
|
|
2165
|
+
}, {}, {}>;
|
|
2166
|
+
name: drizzle_orm_pg_core.PgColumn<{
|
|
2167
|
+
name: "name";
|
|
2168
|
+
tableName: "session_mcp_servers";
|
|
2169
|
+
dataType: "string";
|
|
2170
|
+
columnType: "PgText";
|
|
2171
|
+
data: string;
|
|
2172
|
+
driverParam: string;
|
|
2173
|
+
notNull: false;
|
|
2174
|
+
hasDefault: false;
|
|
2175
|
+
isPrimaryKey: false;
|
|
2176
|
+
isAutoincrement: false;
|
|
2177
|
+
hasRuntimeDefault: false;
|
|
2178
|
+
enumValues: [string, ...string[]];
|
|
2179
|
+
baseColumn: never;
|
|
2180
|
+
identity: undefined;
|
|
2181
|
+
generated: undefined;
|
|
2182
|
+
}, {}, {}>;
|
|
2183
|
+
url: drizzle_orm_pg_core.PgColumn<{
|
|
2184
|
+
name: "url";
|
|
2185
|
+
tableName: "session_mcp_servers";
|
|
2186
|
+
dataType: "string";
|
|
2187
|
+
columnType: "PgText";
|
|
2188
|
+
data: string;
|
|
2189
|
+
driverParam: string;
|
|
2190
|
+
notNull: true;
|
|
2191
|
+
hasDefault: false;
|
|
2192
|
+
isPrimaryKey: false;
|
|
2193
|
+
isAutoincrement: false;
|
|
2194
|
+
hasRuntimeDefault: false;
|
|
2195
|
+
enumValues: [string, ...string[]];
|
|
2196
|
+
baseColumn: never;
|
|
2197
|
+
identity: undefined;
|
|
2198
|
+
generated: undefined;
|
|
2199
|
+
}, {}, {}>;
|
|
2200
|
+
allowedTools: drizzle_orm_pg_core.PgColumn<{
|
|
2201
|
+
name: "allowed_tools";
|
|
2202
|
+
tableName: "session_mcp_servers";
|
|
2203
|
+
dataType: "json";
|
|
2204
|
+
columnType: "PgJsonb";
|
|
2205
|
+
data: string[];
|
|
2206
|
+
driverParam: unknown;
|
|
2207
|
+
notNull: false;
|
|
2208
|
+
hasDefault: false;
|
|
2209
|
+
isPrimaryKey: false;
|
|
2210
|
+
isAutoincrement: false;
|
|
2211
|
+
hasRuntimeDefault: false;
|
|
2212
|
+
enumValues: undefined;
|
|
2213
|
+
baseColumn: never;
|
|
2214
|
+
identity: undefined;
|
|
2215
|
+
generated: undefined;
|
|
2216
|
+
}, {}, {
|
|
2217
|
+
$type: string[];
|
|
2218
|
+
}>;
|
|
2219
|
+
timeoutMs: drizzle_orm_pg_core.PgColumn<{
|
|
2220
|
+
name: "timeout_ms";
|
|
2221
|
+
tableName: "session_mcp_servers";
|
|
2222
|
+
dataType: "number";
|
|
2223
|
+
columnType: "PgInteger";
|
|
2224
|
+
data: number;
|
|
2225
|
+
driverParam: string | number;
|
|
2226
|
+
notNull: false;
|
|
2227
|
+
hasDefault: false;
|
|
2228
|
+
isPrimaryKey: false;
|
|
2229
|
+
isAutoincrement: false;
|
|
2230
|
+
hasRuntimeDefault: false;
|
|
2231
|
+
enumValues: undefined;
|
|
2232
|
+
baseColumn: never;
|
|
2233
|
+
identity: undefined;
|
|
2234
|
+
generated: undefined;
|
|
2235
|
+
}, {}, {}>;
|
|
2236
|
+
cacheToolsList: drizzle_orm_pg_core.PgColumn<{
|
|
2237
|
+
name: "cache_tools_list";
|
|
2238
|
+
tableName: "session_mcp_servers";
|
|
2239
|
+
dataType: "boolean";
|
|
2240
|
+
columnType: "PgBoolean";
|
|
2241
|
+
data: boolean;
|
|
2242
|
+
driverParam: boolean;
|
|
2243
|
+
notNull: true;
|
|
2244
|
+
hasDefault: true;
|
|
2245
|
+
isPrimaryKey: false;
|
|
2246
|
+
isAutoincrement: false;
|
|
2247
|
+
hasRuntimeDefault: false;
|
|
2248
|
+
enumValues: undefined;
|
|
2249
|
+
baseColumn: never;
|
|
2250
|
+
identity: undefined;
|
|
2251
|
+
generated: undefined;
|
|
2252
|
+
}, {}, {}>;
|
|
2253
|
+
headersEncrypted: drizzle_orm_pg_core.PgColumn<{
|
|
2254
|
+
name: "headers_encrypted";
|
|
2255
|
+
tableName: "session_mcp_servers";
|
|
2256
|
+
dataType: "json";
|
|
2257
|
+
columnType: "PgJsonb";
|
|
2258
|
+
data: Record<string, string>;
|
|
2259
|
+
driverParam: unknown;
|
|
2260
|
+
notNull: true;
|
|
2261
|
+
hasDefault: true;
|
|
2262
|
+
isPrimaryKey: false;
|
|
2263
|
+
isAutoincrement: false;
|
|
2264
|
+
hasRuntimeDefault: false;
|
|
2265
|
+
enumValues: undefined;
|
|
2266
|
+
baseColumn: never;
|
|
2267
|
+
identity: undefined;
|
|
2268
|
+
generated: undefined;
|
|
2269
|
+
}, {}, {
|
|
2270
|
+
$type: Record<string, string>;
|
|
2271
|
+
}>;
|
|
2272
|
+
credentialVersion: drizzle_orm_pg_core.PgColumn<{
|
|
2273
|
+
name: "credential_version";
|
|
2274
|
+
tableName: "session_mcp_servers";
|
|
2275
|
+
dataType: "number";
|
|
2276
|
+
columnType: "PgInteger";
|
|
2277
|
+
data: number;
|
|
2278
|
+
driverParam: string | number;
|
|
2279
|
+
notNull: true;
|
|
2280
|
+
hasDefault: true;
|
|
2281
|
+
isPrimaryKey: false;
|
|
2282
|
+
isAutoincrement: false;
|
|
2283
|
+
hasRuntimeDefault: false;
|
|
2284
|
+
enumValues: undefined;
|
|
2285
|
+
baseColumn: never;
|
|
2286
|
+
identity: undefined;
|
|
2287
|
+
generated: undefined;
|
|
2288
|
+
}, {}, {}>;
|
|
2289
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
2290
|
+
name: "created_at";
|
|
2291
|
+
tableName: "session_mcp_servers";
|
|
2292
|
+
dataType: "date";
|
|
2293
|
+
columnType: "PgTimestamp";
|
|
2294
|
+
data: Date;
|
|
2295
|
+
driverParam: string;
|
|
2296
|
+
notNull: true;
|
|
2297
|
+
hasDefault: true;
|
|
2298
|
+
isPrimaryKey: false;
|
|
2299
|
+
isAutoincrement: false;
|
|
2300
|
+
hasRuntimeDefault: false;
|
|
2301
|
+
enumValues: undefined;
|
|
2302
|
+
baseColumn: never;
|
|
2303
|
+
identity: undefined;
|
|
2304
|
+
generated: undefined;
|
|
2305
|
+
}, {}, {}>;
|
|
2306
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
2307
|
+
name: "updated_at";
|
|
2308
|
+
tableName: "session_mcp_servers";
|
|
2309
|
+
dataType: "date";
|
|
2310
|
+
columnType: "PgTimestamp";
|
|
2311
|
+
data: Date;
|
|
2312
|
+
driverParam: string;
|
|
2313
|
+
notNull: true;
|
|
2314
|
+
hasDefault: true;
|
|
2315
|
+
isPrimaryKey: false;
|
|
2316
|
+
isAutoincrement: false;
|
|
2317
|
+
hasRuntimeDefault: false;
|
|
2318
|
+
enumValues: undefined;
|
|
2319
|
+
baseColumn: never;
|
|
2320
|
+
identity: undefined;
|
|
2321
|
+
generated: undefined;
|
|
2322
|
+
}, {}, {}>;
|
|
2323
|
+
};
|
|
2324
|
+
dialect: "pg";
|
|
2325
|
+
}>;
|
|
2060
2326
|
declare const files: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2061
2327
|
name: "files";
|
|
2062
2328
|
schema: undefined;
|
|
@@ -9683,6 +9949,7 @@ declare const schema_scheduledTasks: typeof scheduledTasks;
|
|
|
9683
9949
|
declare const schema_sessionEvents: typeof sessionEvents;
|
|
9684
9950
|
declare const schema_sessionGoals: typeof sessionGoals;
|
|
9685
9951
|
declare const schema_sessionHistoryItems: typeof sessionHistoryItems;
|
|
9952
|
+
declare const schema_sessionMcpServers: typeof sessionMcpServers;
|
|
9686
9953
|
declare const schema_sessionRecordingCodecValues: typeof sessionRecordingCodecValues;
|
|
9687
9954
|
declare const schema_sessionRecordingModeValues: typeof sessionRecordingModeValues;
|
|
9688
9955
|
declare const schema_sessionRecordingStateValues: typeof sessionRecordingStateValues;
|
|
@@ -9699,7 +9966,7 @@ declare const schema_workspaceMemberships: typeof workspaceMemberships;
|
|
|
9699
9966
|
declare const schema_workspacePacks: typeof workspacePacks;
|
|
9700
9967
|
declare const schema_workspaces: typeof workspaces;
|
|
9701
9968
|
declare namespace schema {
|
|
9702
|
-
export { schema_agentRunStates as agentRunStates, schema_apiKeys as apiKeys, schema_auditEvents as auditEvents, schema_billingCustomers as billingCustomers, schema_capabilityCatalogItems as capabilityCatalogItems, schema_capabilityInstallations as capabilityInstallations, schema_codexRotationSettings as codexRotationSettings, schema_codexSubscriptionCredentials as codexSubscriptionCredentials, schema_creditLedgerEntries as creditLedgerEntries, schema_deviceEnrollmentRequests as deviceEnrollmentRequests, schema_deviceEnrollmentStatusValues as deviceEnrollmentStatusValues, schema_documentBases as documentBases, schema_documentChunks as documentChunks, schema_documents as documents, schema_enrollmentExposureValues as enrollmentExposureValues, schema_enrollmentOsValues as enrollmentOsValues, schema_enrollmentStatusValues as enrollmentStatusValues, schema_enrollments as enrollments, schema_fileUploads as fileUploads, schema_files as files, schema_githubInstallations as githubInstallations, schema_machineMetricsLatest as machineMetricsLatest, schema_machineMetricsSeries as machineMetricsSeries, schema_managedAccounts as managedAccounts, schema_packInstallations as packInstallations, schema_sandboxKindValues as sandboxKindValues, schema_sandboxLeaseHolders as sandboxLeaseHolders, schema_sandboxLeaseLivenessValues as sandboxLeaseLivenessValues, schema_sandboxLeases as sandboxLeases, schema_sandboxPtySessions as sandboxPtySessions, schema_sandboxSessionEnvelopes as sandboxSessionEnvelopes, schema_sandboxes as sandboxes, schema_scheduledTaskRuns as scheduledTaskRuns, schema_scheduledTasks as scheduledTasks, schema_sessionEvents as sessionEvents, schema_sessionGoals as sessionGoals, schema_sessionHistoryItems as sessionHistoryItems, schema_sessionRecordingCodecValues as sessionRecordingCodecValues, schema_sessionRecordingModeValues as sessionRecordingModeValues, schema_sessionRecordingStateValues as sessionRecordingStateValues, schema_sessionRecordings as sessionRecordings, schema_sessionTurns as sessionTurns, schema_sessions as sessions, schema_socialConnections as socialConnections, schema_socialPosts as socialPosts, schema_stripeWebhookEvents as stripeWebhookEvents, schema_usageEvents as usageEvents, schema_workspaceEnvironmentVariables as workspaceEnvironmentVariables, schema_workspaceEnvironments as workspaceEnvironments, schema_workspaceMemberships as workspaceMemberships, schema_workspacePacks as workspacePacks, schema_workspaces as workspaces };
|
|
9969
|
+
export { schema_agentRunStates as agentRunStates, schema_apiKeys as apiKeys, schema_auditEvents as auditEvents, schema_billingCustomers as billingCustomers, schema_capabilityCatalogItems as capabilityCatalogItems, schema_capabilityInstallations as capabilityInstallations, schema_codexRotationSettings as codexRotationSettings, schema_codexSubscriptionCredentials as codexSubscriptionCredentials, schema_creditLedgerEntries as creditLedgerEntries, schema_deviceEnrollmentRequests as deviceEnrollmentRequests, schema_deviceEnrollmentStatusValues as deviceEnrollmentStatusValues, schema_documentBases as documentBases, schema_documentChunks as documentChunks, schema_documents as documents, schema_enrollmentExposureValues as enrollmentExposureValues, schema_enrollmentOsValues as enrollmentOsValues, schema_enrollmentStatusValues as enrollmentStatusValues, schema_enrollments as enrollments, schema_fileUploads as fileUploads, schema_files as files, schema_githubInstallations as githubInstallations, schema_machineMetricsLatest as machineMetricsLatest, schema_machineMetricsSeries as machineMetricsSeries, schema_managedAccounts as managedAccounts, schema_packInstallations as packInstallations, schema_sandboxKindValues as sandboxKindValues, schema_sandboxLeaseHolders as sandboxLeaseHolders, schema_sandboxLeaseLivenessValues as sandboxLeaseLivenessValues, schema_sandboxLeases as sandboxLeases, schema_sandboxPtySessions as sandboxPtySessions, schema_sandboxSessionEnvelopes as sandboxSessionEnvelopes, schema_sandboxes as sandboxes, schema_scheduledTaskRuns as scheduledTaskRuns, schema_scheduledTasks as scheduledTasks, schema_sessionEvents as sessionEvents, schema_sessionGoals as sessionGoals, schema_sessionHistoryItems as sessionHistoryItems, schema_sessionMcpServers as sessionMcpServers, schema_sessionRecordingCodecValues as sessionRecordingCodecValues, schema_sessionRecordingModeValues as sessionRecordingModeValues, schema_sessionRecordingStateValues as sessionRecordingStateValues, schema_sessionRecordings as sessionRecordings, schema_sessionTurns as sessionTurns, schema_sessions as sessions, schema_socialConnections as socialConnections, schema_socialPosts as socialPosts, schema_stripeWebhookEvents as stripeWebhookEvents, schema_usageEvents as usageEvents, schema_workspaceEnvironmentVariables as workspaceEnvironmentVariables, schema_workspaceEnvironments as workspaceEnvironments, schema_workspaceMemberships as workspaceMemberships, schema_workspacePacks as workspacePacks, schema_workspaces as workspaces };
|
|
9703
9970
|
}
|
|
9704
9971
|
|
|
9705
|
-
export { machineMetricsLatest as A, machineMetricsSeries as B, managedAccounts as C, packInstallations as D, sandboxLeaseHolders as E, sandboxLeaseLivenessValues as F, sandboxLeases as G, sandboxPtySessions as H, sandboxSessionEnvelopes as I, sandboxes as J, scheduledTaskRuns as K, scheduledTasks as L, sessionEvents as M, sessionGoals as N, sessionHistoryItems as O,
|
|
9972
|
+
export { workspaces as $, machineMetricsLatest as A, machineMetricsSeries as B, managedAccounts as C, packInstallations as D, sandboxLeaseHolders as E, sandboxLeaseLivenessValues as F, sandboxLeases as G, sandboxPtySessions as H, sandboxSessionEnvelopes as I, sandboxes as J, scheduledTaskRuns as K, scheduledTasks as L, sessionEvents as M, sessionGoals as N, sessionHistoryItems as O, sessionMcpServers as P, sessionRecordings as Q, sessionTurns as R, sessions as S, socialConnections as T, socialPosts as U, stripeWebhookEvents as V, usageEvents as W, workspaceEnvironmentVariables as X, workspaceEnvironments as Y, workspaceMemberships as Z, workspacePacks as _, enrollmentExposureValues as a, enrollmentStatusValues as b, sandboxKindValues as c, deviceEnrollmentStatusValues as d, enrollmentOsValues as e, sessionRecordingCodecValues as f, sessionRecordingModeValues as g, sessionRecordingStateValues as h, agentRunStates as i, apiKeys as j, auditEvents as k, billingCustomers as l, capabilityCatalogItems as m, capabilityInstallations as n, codexRotationSettings as o, codexSubscriptionCredentials as p, creditLedgerEntries as q, deviceEnrollmentRequests as r, schema as s, documentBases as t, documentChunks as u, documents as v, enrollments as w, fileUploads as x, files as y, githubInstallations as z };
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/pg-core';
|
|
3
|
-
export { i as agentRunStates, j as apiKeys, k as auditEvents, l as billingCustomers, m as capabilityCatalogItems, n as capabilityInstallations, o as codexRotationSettings, p as codexSubscriptionCredentials, q as creditLedgerEntries, r as deviceEnrollmentRequests, d as deviceEnrollmentStatusValues, t as documentBases, u as documentChunks, v as documents, a as enrollmentExposureValues, e as enrollmentOsValues, b as enrollmentStatusValues, w as enrollments, x as fileUploads, y as files, z as githubInstallations, A as machineMetricsLatest, B as machineMetricsSeries, C as managedAccounts, D as packInstallations, c as sandboxKindValues, E as sandboxLeaseHolders, F as sandboxLeaseLivenessValues, G as sandboxLeases, H as sandboxPtySessions, I as sandboxSessionEnvelopes, J as sandboxes, K as scheduledTaskRuns, L as scheduledTasks, M as sessionEvents, N as sessionGoals, O as sessionHistoryItems, f as sessionRecordingCodecValues, g as sessionRecordingModeValues, h as sessionRecordingStateValues,
|
|
3
|
+
export { i as agentRunStates, j as apiKeys, k as auditEvents, l as billingCustomers, m as capabilityCatalogItems, n as capabilityInstallations, o as codexRotationSettings, p as codexSubscriptionCredentials, q as creditLedgerEntries, r as deviceEnrollmentRequests, d as deviceEnrollmentStatusValues, t as documentBases, u as documentChunks, v as documents, a as enrollmentExposureValues, e as enrollmentOsValues, b as enrollmentStatusValues, w as enrollments, x as fileUploads, y as files, z as githubInstallations, A as machineMetricsLatest, B as machineMetricsSeries, C as managedAccounts, D as packInstallations, c as sandboxKindValues, E as sandboxLeaseHolders, F as sandboxLeaseLivenessValues, G as sandboxLeases, H as sandboxPtySessions, I as sandboxSessionEnvelopes, J as sandboxes, K as scheduledTaskRuns, L as scheduledTasks, M as sessionEvents, N as sessionGoals, O as sessionHistoryItems, P as sessionMcpServers, f as sessionRecordingCodecValues, g as sessionRecordingModeValues, h as sessionRecordingStateValues, Q as sessionRecordings, R as sessionTurns, S as sessions, T as socialConnections, U as socialPosts, V as stripeWebhookEvents, W as usageEvents, X as workspaceEnvironmentVariables, Y as workspaceEnvironments, Z as workspaceMemberships, _ as workspacePacks, $ as workspaces } from './schema-DuRsrmzD.js';
|
package/dist/schema.js
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
sessionEvents,
|
|
37
37
|
sessionGoals,
|
|
38
38
|
sessionHistoryItems,
|
|
39
|
+
sessionMcpServers,
|
|
39
40
|
sessionRecordingCodecValues,
|
|
40
41
|
sessionRecordingModeValues,
|
|
41
42
|
sessionRecordingStateValues,
|
|
@@ -51,7 +52,7 @@ import {
|
|
|
51
52
|
workspaceMemberships,
|
|
52
53
|
workspacePacks,
|
|
53
54
|
workspaces
|
|
54
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-T2U4H4Z2.js";
|
|
55
56
|
import "./chunk-PZ5AY32C.js";
|
|
56
57
|
export {
|
|
57
58
|
agentRunStates,
|
|
@@ -91,6 +92,7 @@ export {
|
|
|
91
92
|
sessionEvents,
|
|
92
93
|
sessionGoals,
|
|
93
94
|
sessionHistoryItems,
|
|
95
|
+
sessionMcpServers,
|
|
94
96
|
sessionRecordingCodecValues,
|
|
95
97
|
sessionRecordingModeValues,
|
|
96
98
|
sessionRecordingStateValues,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS "session_mcp_servers" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"account_id" uuid NOT NULL REFERENCES "managed_accounts"("id") ON DELETE CASCADE,
|
|
4
|
+
"workspace_id" uuid NOT NULL REFERENCES "workspaces"("id") ON DELETE CASCADE,
|
|
5
|
+
"session_id" uuid NOT NULL REFERENCES "sessions"("id") ON DELETE CASCADE,
|
|
6
|
+
"server_id" text NOT NULL,
|
|
7
|
+
"name" text,
|
|
8
|
+
"url" text NOT NULL,
|
|
9
|
+
"allowed_tools" jsonb,
|
|
10
|
+
"timeout_ms" integer,
|
|
11
|
+
"cache_tools_list" boolean NOT NULL DEFAULT false,
|
|
12
|
+
"headers_encrypted" jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
13
|
+
"credential_version" integer NOT NULL DEFAULT 1,
|
|
14
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
|
15
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
|
16
|
+
CONSTRAINT "session_mcp_servers_allowed_tools_array_chk"
|
|
17
|
+
CHECK ("allowed_tools" IS NULL OR jsonb_typeof("allowed_tools") = 'array'),
|
|
18
|
+
CONSTRAINT "session_mcp_servers_headers_object_chk"
|
|
19
|
+
CHECK (jsonb_typeof("headers_encrypted") = 'object'),
|
|
20
|
+
CONSTRAINT "session_mcp_servers_timeout_positive_chk"
|
|
21
|
+
CHECK ("timeout_ms" IS NULL OR "timeout_ms" > 0),
|
|
22
|
+
CONSTRAINT "session_mcp_servers_credential_version_positive_chk"
|
|
23
|
+
CHECK ("credential_version" > 0)
|
|
24
|
+
);
|
|
25
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "session_mcp_servers_session_server_idx"
|
|
26
|
+
ON "session_mcp_servers" ("workspace_id", "session_id", "server_id");
|
|
27
|
+
CREATE INDEX IF NOT EXISTS "session_mcp_servers_session_idx"
|
|
28
|
+
ON "session_mcp_servers" ("workspace_id", "session_id");
|
|
29
|
+
|
|
30
|
+
ALTER TABLE "session_mcp_servers" ENABLE ROW LEVEL SECURITY;
|
|
31
|
+
ALTER TABLE "session_mcp_servers" FORCE ROW LEVEL SECURITY;
|
|
32
|
+
DO $$
|
|
33
|
+
BEGIN
|
|
34
|
+
IF EXISTS (
|
|
35
|
+
SELECT 1 FROM pg_policies
|
|
36
|
+
WHERE schemaname = current_schema() AND tablename = 'session_mcp_servers' AND policyname = 'workspace_isolation'
|
|
37
|
+
) THEN
|
|
38
|
+
DROP POLICY workspace_isolation ON "session_mcp_servers";
|
|
39
|
+
END IF;
|
|
40
|
+
END $$;
|
|
41
|
+
CREATE POLICY workspace_isolation ON "session_mcp_servers"
|
|
42
|
+
USING (opengeni_private.workspace_rls_visible(account_id, workspace_id))
|
|
43
|
+
WITH CHECK (opengeni_private.workspace_rls_visible(account_id, workspace_id));
|
|
44
|
+
|
|
45
|
+
DO $$
|
|
46
|
+
BEGIN
|
|
47
|
+
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'opengeni_app') THEN
|
|
48
|
+
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO opengeni_app;
|
|
49
|
+
END IF;
|
|
50
|
+
END $$;
|