@opengeni/db 0.14.0 → 0.14.3
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-PQKVUWQW.js → chunk-DW24CKCT.js} +7 -8
- package/dist/chunk-DW24CKCT.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +73 -31
- package/dist/index.js.map +1 -1
- package/dist/provision-roles.d.ts +20 -9
- package/dist/{schema-FoPub9yt.d.ts → schema-DhkRhcuQ.d.ts} +4 -4
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/drizzle/0136_unified_session_tool_policy.sql +109 -0
- package/package.json +3 -3
- package/src/index.ts +102 -11
- package/src/schema.ts +6 -7
- package/src/session-queue-commands.ts +8 -40
- package/dist/chunk-PQKVUWQW.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TurnInitiatorContext, SessionMcpApprovalPolicy, TurnInitiator, ResourceRef,
|
|
1
|
+
import { TurnInitiatorContext, SessionMcpApprovalPolicy, TurnInitiator, ResourceRef, ReasoningEffort, TurnExecutionPolicyV1, NewSessionDraftOptions, ToolRef, WorkspaceInstructionPolicyHead, WorkspaceInstructionPolicyActivationResponse, WorkspaceInstructionPolicyTarget, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyDraftProvenanceSource, WorkspaceInstructionPolicyRevision, WorkspaceInstructionPolicyDiffResponse, WorkspaceInstructionPolicyListQuery, WorkspaceInstructionPolicyListResponse, SecretForRedaction, KnowledgeMemoryKind, McpCredentialsRequest, McpCredentialAuthNeededReason, McpConnectionResourceScope, ConnectionCredentialsPort, SessionEvent, SessionStatus, SessionHumanInputRequest, SystemUpdateClassification, SessionSystemUpdateKind, SessionSystemUpdatePayload, SessionSystemUpdate, SessionEventType, SessionTurnStatus, HumanInputQuestion, Permission, SessionTurn, ConnectionKind, ConnectionStatus, ConnectionMetadata, KnowledgeMemory, CapabilityKind, CapabilitySource, KnowledgeMemoryStatus, KnowledgeSourceRef, ScheduledTaskStatus, ScheduledTaskScheduleSpec, ScheduledTaskRunMode, ScheduledTaskOverlapPolicy, ScheduledTaskAgentConfig, SessionGoalCreatedBy, McpServerConnectionRef as McpServerConnectionRef$1, SocialProvider, SocialConnectionStatus, Session, SessionTurnSource, SandboxBackend, SandboxOs, FileAsset, FileUploadStatus, GitHubRepositoryScope, GitHubInstallationAuthorityKind, SessionGoal, SessionEventReadDirection, SessionEventSemanticClass, SessionEventPayloadMode, SessionAuthorizationListScope, CapabilityPack, RigChangeKind, RigChangeStatus, RigCheck, SessionSkill, SessionToolPolicy, FirstPartyMcpToolName, SessionGoalStatus, LineageNode, SessionMcpServerMetadata, RigVersion, BillingBalance, RigChange, AccessContext, HostEventExportBatch, HostUsageExportBatch, ApiKey, Rig, ScheduledTask, ScheduledTaskTriggerType, ScheduledTaskRun, SocialConnection, SocialPost, VariableSet, Workspace, CapabilityInstallation, PackInstallation, CapabilityCatalogItem, HumanInputResponse, ManagedAccount, SessionQueueSnapshot, WorkspaceControlEvent, AccessGrant, WorkspaceRegisteredPack, SessionListResponse, UsageEvent, WorkspaceMember, VariableSetVariableMetadata, PackInstallationStatus, ScheduledTaskRunStatus } from '@opengeni/contracts';
|
|
2
2
|
import { environmentsEncryptionKeyBytes, Settings, McpServerConnectionRef } from '@opengeni/config';
|
|
3
3
|
import { refreshCodexToken, CodexRateLimitResetCreditsDetails, ResetCreditFetchFailureReason, CodexTokenSnapshot, CodexFetch, CodexUsagePayload } from '@opengeni/codex';
|
|
4
4
|
import { SQL } from 'drizzle-orm';
|
|
5
5
|
import { PgDatabase, PgTransactionConfig } from 'drizzle-orm/pg-core';
|
|
6
6
|
import postgres from 'postgres';
|
|
7
|
-
import { s as sessionCommandReceipts, w as workspaces, a as sessions, b as sessionTurns, c as sessionTurnAttempts, d as composerDrafts, n as newSessionDrafts, e as schema, f as enrollmentOsValues, g as enrollmentExposureValues, h as deviceEnrollmentStatusValues, i as enrollmentStatusValues, j as sandboxKindValues, k as sessionRecordingCodecValues, l as sessionRecordingModeValues, m as sessionRecordingStateValues } from './schema-
|
|
7
|
+
import { s as sessionCommandReceipts, w as workspaces, a as sessions, b as sessionTurns, c as sessionTurnAttempts, d as composerDrafts, n as newSessionDrafts, e as schema, f as enrollmentOsValues, g as enrollmentExposureValues, h as deviceEnrollmentStatusValues, i as enrollmentStatusValues, j as sandboxKindValues, k as sessionRecordingCodecValues, l as sessionRecordingModeValues, m as sessionRecordingStateValues } from './schema-DhkRhcuQ.js';
|
|
8
8
|
import './migrate.js';
|
|
9
9
|
import { FetchLike, DnsLookup } from '@opengeni/network';
|
|
10
10
|
|
|
@@ -432,8 +432,6 @@ declare function saveComposerDraftInTransaction(db: Database, input: {
|
|
|
432
432
|
expectedRevision: number;
|
|
433
433
|
text: string;
|
|
434
434
|
resources: ResourceRef[];
|
|
435
|
-
tools: ToolRef[];
|
|
436
|
-
toolsProvided: boolean;
|
|
437
435
|
model: string;
|
|
438
436
|
reasoningEffort: ReasoningEffort;
|
|
439
437
|
}): Promise<ComposerDraftRow>;
|
|
@@ -493,8 +491,6 @@ declare function submitHumanPromptInTransaction(db: Database, input: {
|
|
|
493
491
|
text: string;
|
|
494
492
|
turnInstructions?: string | null;
|
|
495
493
|
resources: ResourceRef[];
|
|
496
|
-
tools: ToolRef[];
|
|
497
|
-
toolsProvided?: boolean;
|
|
498
494
|
model?: string | null;
|
|
499
495
|
reasoningEffort?: ReasoningEffort | null;
|
|
500
496
|
reasoningEffortFallback: ReasoningEffort;
|
|
@@ -3471,7 +3467,7 @@ type SessionCreateInput = {
|
|
|
3471
3467
|
resources: ResourceRef[];
|
|
3472
3468
|
skills?: SessionSkill[];
|
|
3473
3469
|
tools?: ToolRef[];
|
|
3474
|
-
toolPolicy?: SessionToolPolicy
|
|
3470
|
+
toolPolicy?: SessionToolPolicy;
|
|
3475
3471
|
metadata: Record<string, unknown>;
|
|
3476
3472
|
createdBy?: TurnInitiator;
|
|
3477
3473
|
createdByContext?: TurnInitiatorContext;
|
|
@@ -3482,7 +3478,7 @@ type SessionCreateInput = {
|
|
|
3482
3478
|
rigId?: string | null;
|
|
3483
3479
|
rigVersionId?: string | null;
|
|
3484
3480
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
3485
|
-
firstPartyMcpTools?: FirstPartyMcpToolName[]
|
|
3481
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[];
|
|
3486
3482
|
instructions?: string | null;
|
|
3487
3483
|
parentSessionId?: string | null;
|
|
3488
3484
|
createIdempotencyKey?: string | null;
|
|
@@ -5242,6 +5238,20 @@ declare function insertFailedWorkspaceCapture(db: Database, input: {
|
|
|
5242
5238
|
}): Promise<WorkspaceCaptureCommitResult | null>;
|
|
5243
5239
|
/** The newest capture for a session (highest revision), or null if none. */
|
|
5244
5240
|
declare function latestWorkspaceCapture(db: Database, workspaceId: string, sessionId: string): Promise<WorkspaceCaptureRow | null>;
|
|
5241
|
+
type SessionWorkspaceCaptureLookup = {
|
|
5242
|
+
sessionExists: boolean;
|
|
5243
|
+
capture: WorkspaceCaptureRow | null;
|
|
5244
|
+
};
|
|
5245
|
+
/**
|
|
5246
|
+
* Resolve session existence and its newest capture in one RLS-scoped query.
|
|
5247
|
+
*
|
|
5248
|
+
* The capture metadata endpoint only needs existence for its 404 contract. Using
|
|
5249
|
+
* `getSession` there mapped the complete session, MCP metadata, and control
|
|
5250
|
+
* projection before issuing a second transaction for the capture. A lateral
|
|
5251
|
+
* lookup preserves the exact absent-session / absent-capture distinction without
|
|
5252
|
+
* loading unrelated session state or adding another database round trip.
|
|
5253
|
+
*/
|
|
5254
|
+
declare function sessionLatestWorkspaceCapture(db: Database, workspaceId: string, sessionId: string): Promise<SessionWorkspaceCaptureLookup>;
|
|
5245
5255
|
/** A specific capture revision for a session (the M2 file route with an explicit
|
|
5246
5256
|
* `?revision=`), or null if that revision was never captured / already GC'd. */
|
|
5247
5257
|
declare function workspaceCaptureAtRevision(db: Database, workspaceId: string, sessionId: string, revision: number): Promise<WorkspaceCaptureRow | null>;
|
|
@@ -6514,6 +6524,7 @@ type LockedSessionUpdateResult = {
|
|
|
6514
6524
|
update?: {
|
|
6515
6525
|
resources?: ResourceRef[];
|
|
6516
6526
|
tools?: ToolRef[];
|
|
6527
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[];
|
|
6517
6528
|
toolPolicy?: SessionToolPolicy;
|
|
6518
6529
|
toolPolicyVersion?: number;
|
|
6519
6530
|
expectedToolPolicyVersion?: number;
|
|
@@ -6528,4 +6539,4 @@ declare function appendSessionEventsWithLockedSessionUpdate(db: Database, worksp
|
|
|
6528
6539
|
}): Promise<SessionEvent[]>;
|
|
6529
6540
|
declare function sessionSubject(workspaceId: string, sessionId: string): string;
|
|
6530
6541
|
|
|
6531
|
-
export { type CodexRateLimitResetCreditsAccountResult as $, AGENT_VISIBLE_MEMORY_STATUSES as A, type BeginSandboxRematerializationResult as B, CODEX_CAPACITY_REFRESH_MAX_MS as C, type ClearSessionContextResult as D, type CodexAccountStatus as E, type CodexAccountUsageSnapshot as F, type CodexAllocatorUpdateResult as G, type CodexAuthDeps as H, type CodexCapacityAvailabilityDecision as I, type CodexCapacityMutationResult as J, type CodexCapacityResetKind as K, type CodexCapacitySelectionContext as L, type CodexCapacityWait as M, type CodexCapacityWaitStatus as N, type CodexCapacityWakeTarget as O, type CodexCredentialForRun as P, type ProvisionResult, type ProvisionRolesOptions, type CodexCredentialLeaseCandidateFilter as Q, type CodexCredentialLeaseCandidateFilterResult as R, type CodexCredentialLeasePolicyScopeResolver as S, type CodexCredentialLeaseQuarantine as T, type CodexCredentialLeaseResult as U, type CodexCredentialLeaseSelection as V, type CodexCredentialLeaseSelectionContext as W, type CodexCredentialStatus as X, type CodexCredentialTokens as Y, type CodexLeaseAccountStatus as Z, type CodexPinSource as _, type AcceptSessionApprovalDecisionResult as a, type HostMcpCredentialResolverContext as a$, type CodexResetRedemptionAttempt as a0, type CodexResetRedemptionOutcome as a1, type CodexResetRedemptionRecovery as a2, type CodexResetRedemptionSendNotReadyReason as a3, type CodexResetRedemptionStatus as a4, type CodexRotationSettings as a5, type CodexRotationStrategy as a6, type CodexTokenDeadlineClock as a7, type CodexTokenDeadlineOptions as a8, type CompleteSlackBotPostOperationResult as a9, type EditQueueCommandResult as aA, type EffectiveControlBlocker as aB, type EffectiveControlResumeOption as aC, type EffectiveControlState as aD, type EffectiveSessionControl as aE, type EnableCapabilityInstallationInput as aF, type EnabledMcpCapabilityServer as aG, type EnqueueSessionTurnInput as aH, type EnrollmentExposure as aI, type EnrollmentOs as aJ, type EnrollmentRecord as aK, type EnrollmentStatus as aL, type ExpiredDrainingSandboxLeaseCount as aM, type ExpiredFileUploadCleanupClaim as aN, FORCE_RLS_TABLES as aO, type FenceCodexResetRedemptionSendResult as aP, type FileUploadCleanupClaimResult as aQ, type ForceDrainResult as aR, type FrozenTurnInitiator as aS, type GitHubInstallation as aT, type GitHubInstallationAccess as aU, GitHubInstallationAuthorityCommitError as aV, type GoalContinuationDecision as aW, type HostExportConsumerStatus as aX, type HostExportKind as aY, HostExportPayloadError as aZ, HostMcpCredentialBindingError as a_, type ComposerDraftRow as aa, type ConnectionBrokerDeps as ab, type ConnectionCredentialForBroker as ac, type ConnectionMetadataWithVerification as ad, ConnectionRefreshHttpError as ae, type ConsumeOAuthStateNonceInput as af, type CorrectWorkspaceMemoryInput as ag, type CorrectWorkspaceMemoryResult as ah, type CreateCapabilityCatalogItemInput as ai, type CreateConnectionInput as aj, type CreateDbOptions as ak, type CreateImportBatchInput as al, type CreateKnowledgeMemoryInput as am, type CreatePackInstallationInput as an, type CreateScheduledTaskInput as ao, type CreateSessionGoalInput as ap, type CreateSessionMcpServerInput as aq, type CreateSocialConnectionInput as ar, type CreateSocialPostInput as as, type CreditBalanceByAccount as at, type Database as au, type DatabaseFailureCode as av, type DbClient as aw, type DbSession as ax, type DeviceEnrollmentRequestRecord as ay, type DeviceEnrollmentStatus as az, type AcceptSessionHumanInputResponseResult as b, type ReconcileColdLostLeaseInstanceBlockersResult as b$, HostMcpCredentialScopeError as b0, HumanInputResponseValidationError as b1, type IdempotentPersistenceTransactionOptions as b2, type ImportBatch as b3, type InitializeSessionStartInput as b4, type InitializeSessionStartResult as b5, type InstallOrReadTurnExecutionPolicyForAttemptResult as b6, type IntegrationOAuthClientForUse as b7, type LeaseHolderKind as b8, type LeaseSnapshot as b9, type MarkWarmLeaseInstanceLostResult as bA, type MaterializeGoalContinuationResult as bB, type MemoryBlockRecord as bC, type MemoryEmbedder as bD, type MemorySanitizeResult as bE, type MeterableWarmLease as bF, NON_RLS_RUNTIME_TABLES as bG, type NestedAgentDepthDeploymentPolicy as bH, type NestedAgentDepthPolicySource as bI, NewSessionDraftAccessError as bJ, NewSessionDraftConflictError as bK, type NewSessionDraftRow as bL, PROTECTED_NO_DIRECT_DML_TABLES as bM, type PendingSessionToolCallInput as bN, type PersistenceFailureDetails as bO, type PersistenceRetryOutcome as bP, type QueueCommandConflictCode as bQ, QueueCommandConflictError as bR, type QueueCommandResult as bS, type QueuedTurnRow as bT, RUNTIME_DML_TABLES as bU, RUNTIME_FULL_DML_TABLES as bV, RUNTIME_READ_INSERT_TABLES as bW, RUNTIME_READ_ONLY_TABLES as bX, RUNTIME_TABLE_PRIVILEGES as bY, type ReapDrainable as bZ, type ReconcileCodexCapacityWaitResult as b_, type ListKnowledgeMemoryOptions as ba, type ListSessionEventPageOptions as bb, type ListSessionEventsOptions as bc, type ListSessionsForSubjectOptions as bd, type ListSessionsOptions as be, type LiveModalSandboxLeaseAttribution as bf, type LostProviderWorkspaceSettlement as bg, MACHINE_METRICS_SERIES_INTERVAL_MS as bh, MAX_INTERNAL_UPDATE_BATCH_BYTES as bi, MAX_INTERNAL_UPDATE_BATCH_MEMBERS as bj, MAX_INTERNAL_UPDATE_BYTES as bk, MEMORY_ACTIVE_RECORD_CAP as bl, MEMORY_BLOCK_KIND_ORDER as bm, MEMORY_BLOCK_RECORD_LIMIT as bn, MEMORY_CORRECT_TOOL_DESCRIPTION as bo, MEMORY_KIND_SECTION_TITLES as bp, MEMORY_NEAR_DUP_COSINE_THRESHOLD as bq, MEMORY_NEAR_DUP_NEIGHBORS as br, MEMORY_SAVE_TOOL_DESCRIPTION as bs, MEMORY_SEARCH_DEFAULT_LIMIT as bt, MEMORY_SEARCH_MAX_LIMIT as bu, MEMORY_SEARCH_TOOL_DESCRIPTION as bv, MEMORY_TEXT_MAX_CHARS as bw, MEMORY_VISIBLE_RECORD_CAP as bx, type MachineMetricsRow as by, type MachineMetricsSample as bz, type AccrueWarmSecondsResult as c, type SandboxWorkspaceReadiness as c$, type ReconcileSessionAttemptQuiescenceResult as c0, type RecoverSessionDispatchInput as c1, type RecoverSessionDispatchResult as c2, type RefreshTransportOptions as c3, type RegisterWorkspacePackInput as c4, type RegistryCapabilityCatalogItemInput as c5, type RegistryCatalogSurfaceKey as c6, type ReplaceIntegrationOAuthClientInput as c7, type RequestSessionTurnRecoveryInput as c8, type RequestSessionTurnRecoveryResult as c9, SESSION_EVENT_DB_PAGE_MAX_BYTES as cA, SESSION_LIST_SNAPSHOT_MAX_ACTIVE_PER_SUBJECT as cB, SESSION_LIST_SNAPSHOT_MAX_IDS as cC, type SafeDatabaseErrorFacts as cD, type SandboxArchiveAvailability as cE, type SandboxArchiveRevision as cF, SandboxImageConflictError as cG, type SandboxKind as cH, type SandboxLeaseLiveness as cI, SandboxLeaseRecoveryBlockedError as cJ, SandboxLeaseSupersededError as cK, type SandboxOpenPtySessionRow as cL, type SandboxProviderExistence as cM, type SandboxPtyProcessIdentity as cN, type SandboxPtySessionRow as cO, type SandboxRecord as cP, type SandboxRecoveryState as cQ, type SandboxRestoreStatus as cR, type SandboxRetainedProcess as cS, type SandboxRetainedProcessIdentity as cT, SandboxRetainedProcessPromotionFencedError as cU, type SandboxRetainedProcessReconciliationClaim as cV, type SandboxRetainedProcessState as cW, SandboxRigConflictError as cX, type SandboxWorkspaceMutationAdmission as cY, SandboxWorkspaceMutationFencedError as cZ, type SandboxWorkspaceMutationProviderOutcome as c_, type ResolveConnectionCredentialInput as ca, type ResolveConnectionCredentialResult as cb, type RetainedFileArtifact as cc, type RetainedProcessProviderProof as cd, RigActiveVersionChangedError as ce, RigChangeAlreadyVerifyingError as cf, type RigChangeMonitoringSummary as cg, RigChangeTransitionError as ch, type RigVersionContentInput as ci, type RigVersionMonitoringSummary as cj, type RlsContext as ck, type RlsStrategy as cl, type RuntimeDatabaseIdentity as cm, type RuntimeDatabasePosture as cn, RuntimeDatabasePostureError as co, type RuntimeDatabasePostureOptions as cp, type RuntimeRoutinePosture as cq, type RuntimeSchemaPosture as cr, type RuntimeTableDmlPrivilege as cs, type RuntimeTablePosture as ct, type RuntimeTablePrivilegeContract as cu, SESSION_ANCESTRY_LIMIT as cv, SESSION_DISCOVERY_CONTROL_TARGET_LIMIT as cw, SESSION_DISCOVERY_CONTROL_TITLE_MAX_CHARS as cx, SESSION_DISCOVERY_GOAL_MAX_CHARS as cy, SESSION_DISCOVERY_MESSAGE_MAX_CHARS as cz, type AcquireLeaseInput as d, type StoreIntegrationOAuthClientInput as d$, SanitizedDatabasePersistenceCause as d0, type SaveWorkspaceMemoryInput as d1, type SaveWorkspaceMemoryResult as d2, type SessionAttemptActivityRef as d3, type SessionAttemptInterruptionSettlement as d4, type SessionCodexState as d5, type SessionCommandActor as d6, SessionCommandIdempotencyError as d7, type SessionCommandReceiptRow as d8, SessionContextBusyError as d9, SessionPinAccessError as dA, SessionPinVersionConflictError as dB, type SessionRecordingCodec as dC, type SessionRecordingMode as dD, type SessionRecordingRow as dE, type SessionRecordingState as dF, type SessionSpawnDenial as dG, type SessionSpawnDenialCode as dH, SessionSpawnDeniedDbError as dI, type SessionSystemUpdateOutboxDelivery as dJ, SessionToolPolicyVersionConflictError as dK, type SessionTurnAttemptOutcome as dL, type SessionTurnForExecution as dM, type SessionTurnRecordingSettlement as dN, type SessionWorkPeek as dO, type SessionWorkTrigger as dP, type SessionWorkflowWake as dQ, type SessionWorkflowWakeDeliveryResult as dR, type SetSessionCodexPinOptions as dS, type SetSessionGoalStatusEvent as dT, type SettleCodexCredentialFailoverResult as dU, type SettleCodexCredentialLeaseLossResult as dV, type SlackBotInstallCallbackFailureReason as dW, type SlackBotInstallCallbackFailureStage as dX, SlackBotLifecycleSuccessAuditError as dY, type SlackBotPostOperation as dZ, type SteerQueueCommandResult as d_, SessionControlConflictError as da, SessionControlInvariantError as db, type SessionControlMutationResult as dc, type SessionCreateDeniedResult as dd, type SessionCreateInput as de, type SessionCreateResult as df, type SessionCreateSuccessResult as dg, type SessionDepthPolicy as dh, type SessionDiscoveryControl as di, type SessionDiscoveryCursor as dj, type SessionDiscoveryOrderBy as dk, type SessionDiscoverySummary as dl, type SessionEventPage as dm, SessionEventPersistenceError as dn, type SessionEventWriteLockInput as dp, type SessionEventWriteLocks as dq, type SessionGoalContinuationProjection as dr, SessionIdConflictError as ds, type SessionLineage as dt, SessionListAccessError as du, type SessionListCursor as dv, SessionListCursorError as dw, SessionListCursorExpiredError as dx, SessionListSnapshotLimitError as dy, type SessionMcpServerForRun as dz, type AcquireLeaseResult as e, applyCreditLedgerEntry as e$, type StoredIntegrationOAuthClient as e0, type StreamAcknowledgment as e1, type SubmitHumanPromptResult as e2, type ToolspaceCallReservation as e3, type ToolspaceTurnAttemptClaims as e4, type TurnAttemptFenceRejectReason as e5, type UpdateConnectionInput as e6, type UpdateImportBatchCountsInput as e7, type UpdateKnowledgeMemoryInput as e8, type UpdateScheduledTaskInput as e9, abandonCodexResetRedemptionBeforeProvider as eA, abandonRecordingForTurnAttempt as eB, acceptSessionApprovalDecision as eC, acceptSessionHumanInputResponse as eD, accrueWarmSeconds as eE, acknowledgeHostExportBatch as eF, acquireCodexCredentialLease as eG, acquireLease as eH, activateRigVersion as eI, activateWorkspaceInstructionPolicyRevision as eJ, addSessionSystemUpdate as eK, addSessionSystemUpdateWithSourceMutation as eL, admitToolspaceTurnAttempt as eM, adoptCodexResetRedemptionAttempt as eN, advanceWorkspaceGeneration as eO, advanceWorkspaceGenerationForDirectRequest as eP, advanceWorkspaceGenerationForRetainedProcess as eQ, allAccountPermissions as eR, allWorkspacePermissions as eS, appendSessionEventToSandboxGroup as eT, appendSessionEvents as eU, appendSessionEventsAndUpdateSession as eV, appendSessionEventsForTurnAttempt as eW, appendSessionEventsWithLockedSessionUpdate as eX, appendSessionHistoryItems as eY, applyContextCompaction as eZ, applyCreditDebitUpToBalance as e_, type UpdateSessionMcpApprovalPolicyResult as ea, type UpdateSessionMcpServerCredentialsInput as eb, type UpdateSessionMcpServerCredentialsResult as ec, type UpsertCodexSubscriptionCredentialResult as ed, type UserLookup as ee, type VariableSetForRun as ef, WORKSPACE_MEMORY_BLOCK_EMPTY as eg, WORKSPACE_MEMORY_BLOCK_HEADER_POPULATED as eh, WORKSPACE_MEMORY_BLOCK_TOKEN_BUDGET as ei, type WorkspaceCaptureCommitResult as ej, type WorkspaceCaptureGcPlan as ek, type WorkspaceCaptureGcRow as el, type WorkspaceCaptureRow as em, type WorkspaceControlLockMode as en, type WorkspaceControlMutationResult as eo, type WorkspaceControlRow as ep, type WorkspaceEnvironmentForRun as eq, WorkspaceInstructionPolicyConflictError as er, WorkspaceInstructionPolicyInvalidOperationError as es, WorkspaceInstructionPolicyLegacyUnavailableError as et, WorkspaceInstructionPolicyNotFoundError as eu, type WorkspaceMemoryOrigin as ev, type WorkspaceMemorySearchInput as ew, type WorkspaceMemorySearchMode as ex, type WorkspaceMemorySearchResult as ey, type WorkspaceModelPolicy as ez, type ActiveRetainedProcessOwnerCount as f, countVariableSets as f$, applySessionTurnSettlement as f0, approveDeviceEnrollmentRequest as f1, areGitHubRepositoriesAllowedForWorkspace as f2, armCodexCapacityWait as f3, assertAgentCommandAuthorityInTransaction as f4, assertRuntimeDatabasePosture as f5, autoResumeSessionBranchInTransaction as f6, beginRigChangeVerificationAttempt as f7, beginSandboxRematerialization as f8, bindAuthorizedGitHubInstallationRepositories as f9, completeCodexResetRedemption as fA, completeExpiredFileUploadCleanup as fB, completeFileUpload as fC, completeFileUploadCleanup as fD, completeSlackBotPostOperation as fE, computeWorkspaceCaptureGcPlan as fF, confirmDrainCold as fG, consumeDeviceEnrollmentRequest as fH, consumeIntegrationOAuthStateNonce as fI, consumeNewSessionDraftInTransaction as fJ, correctWorkspaceMemory as fK, countActiveApiKeysForWorkspace as fL, countActiveRetainedProcessesByOwnerState as fM, countActiveSessionHistoryItems as fN, countActiveSessionsForWorkspace as fO, countActiveSessionsUsingEnvironment as fP, countActiveSessionsUsingVariableSet as fQ, countConsecutiveReactiveRotations as fR, countExpiredDrainingSandboxLeases as fS, countQueuedTurns as fT, countRigs as fU, countSandboxLeasesByLiveness as fV, countScheduledTasksForWorkspace as fW, countScheduledTasksUsingEnvironment as fX, countScheduledTasksUsingVariableSet as fY, countSessionHistoryItems as fZ, countSessionsUsingRig as f_, bindGitHubInstallationRepositories as fa, bootstrapWorkspace as fb, buildChildCompletionDigest as fc, buildCodexTokenResolver as fd, buildConnectionTokenResolver as fe, buildHostConnectionTokenResolver as ff, canonicalSessionCommandHash as fg, claimCodexResetRedemption as fh, claimExpiredFileUploadCleanup as fi, claimFileUploadCleanup as fj, claimHostExportBatch as fk, claimPendingSessionSystemUpdateOutbox as fl, claimPendingSessionWorkflowWakes as fm, claimSessionWorkForAttempt as fn, claimSlackBotPostOperation as fo, claimTerminalRetainedProcesses as fp, clearDurablePendingSessionToolCalls as fq, clearEnrollmentWentOffline as fr, clearPendingSessionToolspaceCall as fs, clearSessionContext as ft, clearSessionGoal as fu, clearedContextMarkerItem as fv, closePtySession as fw, closeSessionTurnAttemptInTransaction as fx, codexCapacityRefreshBackoffMs as fy, commitWarmingToWarm as fz, type ActiveSandboxPointer as g, enqueueSessionWorkflowWakeInTransaction as g$, countWorkspaceEnvironments as g0, countWorkspacesForAccount as g1, createApiKey as g2, createConnection as g3, createConnectionWithSlackBotSuccessAudit as g4, createDb as g5, createDeviceEnrollmentRequest as g6, createEnrollment as g7, createFileUpload as g8, createImportBatch as g9, deleteRecording as gA, deleteRig as gB, deleteRigIfNoActiveSessions as gC, deleteScheduledTask as gD, deleteSessionQueueItemInTransaction as gE, deleteVariableSet as gF, deleteVariableSetVariable as gG, deleteWorkspace as gH, deleteWorkspaceCaptureRows as gI, deleteWorkspaceEnvironment as gJ, deleteWorkspaceEnvironmentVariable as gK, deleteWorkspacePack as gL, denyDeviceEnrollmentRequest as gM, diffWorkspaceInstructionPolicyContent as gN, diffWorkspaceInstructionPolicyRevisions as gO, disableCapabilityInstallation as gP, disableHostExportConsumer as gQ, disconnectAllCodexAccounts as gR, disconnectCodexAccount as gS, editQueuedTurnInTransaction as gT, enableCapabilityInstallation as gU, enablePackInstallation as gV, encodeSessionListCursor as gW, encryptEnvironmentValue as gX, enqueueSessionTurn as gY, enqueueSessionWorkflowWake as gZ, enqueueSessionWorkflowWakeIfRunnable as g_, createKnowledgeMemory as ga, createRig as gb, createRigChange as gc, createRigVersion as gd, createRigVersionForChangePromotion as ge, createSandbox as gf, createScheduledTask as gg, createScheduledTaskRun as gh, createSession as gi, createSessionGoal as gj, createSessionMcpServers as gk, createSessionWithIdempotencyKey as gl, createSessionWithIdempotencyKeyResult as gm, createSocialConnection as gn, createSocialPost as go, createVariableSet as gp, createWorkspace as gq, createWorkspaceEnvironment as gr, createWorkspaceInstructionPolicyDraft as gs, databaseFailureCode as gt, deadLetterHostExportHead as gu, decodeSessionListCursor as gv, decryptEnvironmentValue as gw, decryptedCapabilityHeaders as gx, deferRetainedProcessReconciliation as gy, deleteGitHubInstallationBinding as gz, type AddSessionSystemUpdateInput as h, getSession as h$, ensureCodexRotationSettings as h0, ensureManagedAccessForUser as h1, estimateMemoryTokens as h2, evaluateGoalContinuation as h3, evaluateRuntimeDatabasePosture as h4, evaluateSessionControl as h5, evaluateSessionControls as h6, evaluateSessionDiscoveryControls as h7, expireSessionHumanInputRequest as h8, failHostExportBatch as h9, getHostExportConsumerStatus as hA, getHumanInputResumeForEvent as hB, getKnowledgeMemory as hC, getLatestRunState as hD, getLatestStartedSessionTurn as hE, getManagedAccount as hF, getManagedUserByEmail as hG, getMaterializedSandboxFileResources as hH, getNestedAgentDepthDeploymentPolicy as hI, getNewSessionDraftInTransaction as hJ, getOpenPtySession as hK, getOrCreateSessionSystemUpdateOutbox as hL, getPackInstallation as hM, getPendingDeviceEnrollmentRequestByUserCode as hN, getPendingDeviceEnrollmentRequestByUserCodeGlobal as hO, getRecording as hP, getRetainedFileArtifact as hQ, getRetainedProcess as hR, getRig as hS, getRigByName as hT, getRigChange as hU, getRigName as hV, getRigVersion as hW, getRigVersionById as hX, getSandbox as hY, getSandboxSessionEnvelope as hZ, getScheduledTask as h_, failSandboxRematerialization as ha, failWarmingToCold as hb, fenceCodexResetRedemptionSend as hc, fetchCodexRateLimitResetCreditsForAccount as hd, fetchCodexUsageForAccount as he, finalizeEnrollmentByToken as hf, findActiveApiKeyByHash as hg, forceDrainOverLimitViewerOnlyBoxes as hh, frozenInitiatorForCommandActor as hi, getActiveSessionHistoryItems as hj, getActiveSessionTurnForExecution as hk, getAnySessionInGroup as hl, getBillingBalance as hm, getBillingCustomer as hn, getCapabilityCatalogItem as ho, getCapabilityInstallation as hp, getCodexCapacityWaitForSession as hq, getCodexCredentialStatus as hr, getCodexResetRedemptionAttempt as hs, getCodexRotationSettings as ht, getComposerDraftInTransaction as hu, getConnectionMetadata as hv, getDeviceEnrollmentRequestByDeviceCode as hw, getEnrollment as hx, getFile as hy, getFileUpload as hz, type AddSessionSystemUpdateResult as i, listApiKeys as i$, getSessionAttemptActivityRef as i0, getSessionByCreateIdempotencyKey as i1, getSessionCodexState as i2, getSessionEvent as i3, getSessionEventByClientEventId as i4, getSessionForSubject as i5, getSessionGoal as i6, getSessionGoalWithContinuation as i7, getSessionHistoryItems as i8, getSessionHumanInputRequest as i9, getWorkspacePack as iA, grantWorkspaceAccess as iB, hasAuditableGitHubInstallationAuthority as iC, hasCreditLedgerEntry as iD, hashMemoryText as iE, heartbeatCodexCredentialLease as iF, heartbeatCodexCredentialLeaseUntil as iG, heartbeatLeaseHolder as iH, importLegacyWorkspaceInstructionPolicyDraft as iI, ingestMachineMetricsSample as iJ, initializeSessionStartAtomically as iK, insertFailedWorkspaceCapture as iL, insertMachineMetricsSeries as iM, insertPtySession as iN, insertRecording as iO, insertWorkspaceCapture as iP, inspectRuntimeDatabasePosture as iQ, installOrReadTurnExecutionPolicyForAttempt as iR, interruptedToolCallResult as iS, isCodexBilledTurn as iT, isDatabasePersistenceFailure as iU, isMemoryTextTooLong as iV, isRetryablePersistenceSqlState as iW, isSessionCompactionRequested as iX, isSessionEventPersistenceError as iY, isStripeWebhookProcessed as iZ, latestWorkspaceCapture as i_, getSessionLineage as ia, getSessionQueueSnapshot as ib, getSessionRootId as ic, getSessionSpawnDenial as id, getSessionSpawnDenialByIdempotencyKey as ie, getSessionSystemUpdateOutboxByDedupeKey as ig, getSessionTurn as ih, getSessionTurnForAttempt as ii, getSlackBotPostOperation as ij, getSocialConnection as ik, getStoredCapabilityHeaderCiphertext as il, getStreamAcknowledgment as im, getVariableSet as io, getVariableSetByName as ip, getVariableSetValuesForRun as iq, getWorkspace as ir, getWorkspaceControlEvent as is, getWorkspaceDefaultRigId as it, getWorkspaceEnvironment as iu, getWorkspaceEnvironmentByName as iv, getWorkspaceEnvironmentValuesForRun as iw, getWorkspaceGrant as ix, getWorkspaceInstructionPolicyRevision as iy, getWorkspaceModelPolicy as iz, type AdoptCodexResetRedemptionResult as j, markSandboxProviderReady as j$, listCapabilityCatalogItems as j0, listCapabilityInstallations as j1, listCodexAccountStatuses as j2, listCodexResetRedemptionRecoveries as j3, listConnectionsMetadata as j4, listCreditBalancesByAccount as j5, listDistinctRigVersionIdsInGroup as j6, listDistinctVariableSetIdsInGroup as j7, listEnabledMcpCapabilityServers as j8, listEnrollments as j9, listSessionMcpServerMetadata as jA, listSessionMcpServersForChildInheritance as jB, listSessionMcpServersForRun as jC, listSessionSpawnDenials as jD, listSessionSystemUpdatesForTurn as jE, listSessionTurns as jF, listSessions as jG, listSessionsForSubject as jH, listSocialConnections as jI, listSocialPosts as jJ, listUsageEvents as jK, listVariableSets as jL, listWorkspaceControlEvents as jM, listWorkspaceEnvironments as jN, listWorkspaceInstructionPolicyRevisions as jO, listWorkspaceMembers as jP, listWorkspacePacks as jQ, listWorkspacesForSubject as jR, loadCodexCredentialForRun as jS, loadConnectionCredentialForBroker as jT, loadIntegrationOAuthClient as jU, loadVariableSetForRun as jV, loadWorkspaceEnvironmentForRun as jW, lockSessionEventWriteRows as jX, lockWorkspaceInferenceControl as jY, markFileUploadFailed as jZ, markSandboxFileResourcesMaterialized as j_, listGitHubInstallationAccessForWorkspace as ja, listGitHubInstallationIdsForWorkspace as jb, listGitHubInstallationsForWorkspace as jc, listKnowledgeMemories as jd, listLiveModalSandboxLeaseAttributions as je, listMeterableWarmLeases as jf, listOpenPtySessions as jg, listOutstandingSessionSystemUpdates as jh, listPackInstallations as ji, listPendingCodexCapacityWakeTargets as jj, listPendingSessionTurns as jk, listRecordings as jl, listRegistryCatalogSurfaceKeys as jm, listRigChangeMonitoringSummaries as jn, listRigChanges as jo, listRigVersionMonitoringSummaries as jp, listRigVersions as jq, listRigs as jr, listSandboxes as js, listScheduledTaskRuns as jt, listScheduledTasks as ju, listSessionDiscoverySummaries as jv, listSessionEventPage as jw, listSessionEvents as jx, listSessionHumanInputRequests as jy, listSessionIdsInGroup as jz, AgentCommandAuthorityError as k, registerDbBinding as k$, markSandboxRestoreVerifying as k0, markScheduledTaskRunFailedIfQueued as k1, markSessionAttemptQuiesced as k2, markSessionSystemUpdateOutboxDeliveredInTransaction as k3, markSessionSystemUpdateOutboxFailed as k4, markSessionWorkflowWakeDelivered as k5, markSessionWorkflowWakeFailed as k6, markStaleRegistryCatalogItems as k7, markStripeWebhookProcessed as k8, markWarmLeaseInstanceLost as k9, readWorkspaceArchiveCapturePreflight as kA, reapExpiredSessionListSnapshots as kB, reapStaleLeaseHolders as kC, reapStaleLeaseHoldersGlobal as kD, reconcileCodexCapacityWait as kE, reconcileColdLostLeaseInstanceBlockers as kF, reconcileSessionAttemptQuiescence as kG, recordAuditEvent as kH, recordCodexAccountConnectors as kI, recordCodexAccountUsage as kJ, recordCodexAccountUsageWithWakeTargets as kK, recordCodexTokenRefresh as kL, recordConnectionTokenRefresh as kM, recordConnectionUsed as kN, recordLeaseDataPlaneUrl as kO, recordLeaseTerminalDataPlaneUrl as kP, recordPendingSessionToolCallResult as kQ, recordRetainedProcessReconciliationProof as kR, recordSessionActiveCodexCredential as kS, recordSkippedContextCompaction as kT, recordSlackBotInstallCallbackFailure as kU, recordStreamAcknowledgment as kV, recordStripeWebhookEvent as kW, recordUsageEvent as kX, recordWarmingSandboxCreated as kY, recoverSessionDispatch as kZ, refreshOAuthConnectionCredential as k_, materializeGoalContinuation as ka, mcpServerIdForCapability as kb, moveQueuedTurnInTransaction as kc, mutateSessionControlInTransaction as kd, mutateWorkspaceControlInTransaction as ke, nestedPostgresSqlState as kf, newSessionDraftToolsProvided as kg, nextSessionHistoryPosition as kh, normalizeBearerScheme as ki, normalizeMemoryText as kj, orphanedResultRowIndicesForRepair as kk, peekSessionWork as kl, persistDrainSnapshot as km, persistWarmSnapshot as kn, planWorkspaceCaptureGc as ko, projectEffectiveControlForRelatedAccess as kp, projectSessionForRelatedAccess as kq, pruneHostExportOutbox as kr, publicNewSessionDraftOptions as ks, quarantineCodexCredentialForLease as kt, reArmDrainingLease as ku, readActiveSandbox as kv, readLease as kw, readMachineMetricsLatest as kx, readMachineMetricsLatestForWorkspace as ky, readMachineMetricsSeries as kz, type AgentInternalUpdateCommandResult as l, setCodexCredentialStatusById as l$, registerHostExportConsumer as l0, registerInternalUpdateWakeInTransaction as l1, registerPendingSessionToolCall as l2, registerSessionTurnAttemptClaim as l3, registerSessionWorkflowWakeInTransaction as l4, registerWorkspacePack as l5, releaseCodexCredentialLease as l6, releaseCodexResetRedemptionClaim as l7, releaseLeaseHolder as l8, releaseSlackBotPostOperationClaim as l9, rlsStrategyFor as lA, rollbackWorkspaceInstructionPolicyRevision as lB, rotateWorkspaceArchives as lC, runIdempotentPersistenceTransaction as lD, runtimeDatabaseReadyCheck as lE, safeDatabaseErrorFacts as lF, sanitizeEventPayload as lG, sanitizeEventString as lH, sanitizeMemoryText as lI, sanitizeModelPayload as lJ, saveComposerDraftInTransaction as lK, saveNewSessionDraftInTransaction as lL, saveRunState as lM, saveWorkspaceMemory as lN, searchWorkspaceMemories as lO, seedNewSessionDraftInTransaction as lP, sendAgentMessageInTransaction as lQ, serializeEffectiveSessionControl as lR, sessionAuthorizationScopeFilter as lS, sessionSubject as lT, sessionTreeStatsForSessions as lU, sessionsWithActiveOpOnEnrollment as lV, setActiveCodexCredential as lW, setActiveSandbox as lX, setCodexCredentialExhausted as lY, setCodexCredentialExhaustedWithWakeTargets as lZ, setCodexCredentialStatus as l_, removeWorkspaceMember as la, renameCodexAccount as lb, renderWorkspaceMemoryBlock as lc, replaceIntegrationOAuthClient as ld, requestSessionCompaction as le, requestSessionTurnRecovery as lf, requireFile as lg, requireScheduledTask as lh, requireSession as li, requireSocialConnection as lj, requireWorkspace as lk, reserveSessionCommandReceipt as ll, reserveToolspaceCallForAttempt as lm, resolveWorkspaceMemoryBlock as ln, resumeHostExportConsumer as lo, retainWorkspaceMutationProcess as lp, retainedProcessReconciliationProof as lq, retainedProcessSettlementIdentity as lr, retireHostExportConsumer as ls, revokeApiKey as lt, revokeConnection as lu, revokeConnectionWithSlackBotSuccessAudit as lv, revokeEnrollment as lw, revokeViewer as lx, rewindHostExportConsumer as ly, rlsContextForWorkspace as lz, type AppendEventInput as m, upsertSessionGoalWithEvent as m$, setConnectionStatus as m0, setEnrollmentDisplayState as m1, setEnrollmentOpStreamState as m2, setEnrollmentWentOffline as m3, setInitialActiveCodexCredential as m4, setRlsContext as m5, setSessionCodexPin as m6, setSessionGoalLastContinuationTurn as m7, setSessionGoalStatus as m8, setSessionGoalStatusWithEvent as m9, updateImportBatchCounts as mA, updateKnowledgeMemory as mB, updatePackInstallationStatus as mC, updatePtySessionActivity as mD, updateRecording as mE, updateRig as mF, updateRigChangeStatus as mG, updateScheduledTask as mH, updateScheduledTaskRun as mI, updateSessionCommandReceiptResult as mJ, updateSessionGoal as mK, updateSessionGoalWithEvent as mL, updateSessionMcpApprovalPolicy as mM, updateSessionMcpServerCredentials as mN, updateSessionTitle as mO, updateVariableSet as mP, updateWorkspace as mQ, updateWorkspaceEnvironment as mR, updateWorkspaceSettings as mS, upsertBillingCustomer as mT, upsertCapabilityCatalogItem as mU, upsertCodexSubscriptionCredential as mV, upsertGitHubInstallation as mW, upsertMachineMetricsLatest as mX, upsertRegistryCapabilityCatalogItem as mY, upsertSandboxSessionEnvelope as mZ, upsertSessionGoal as m_, setSessionLastInputTokensForTurnAttempt as ma, setSessionPin as mb, setSubjectRlsContext as mc, setTemporalWorkflowId as md, setVariableSetVariable as me, setWorkspaceDefaultRig as mf, setWorkspaceEnvironmentVariable as mg, settleCodexCredentialFailover as mh, settleCodexCredentialLeaseLoss as mi, settleRetainedProcess as mj, settleScheduledTaskRunInTransaction as mk, settleSessionAttemptInterruptions as ml, settleSessionIdleWithParentOutbox as mm, shortMemoryId as mn, steerAgentSessionInTransaction as mo, steerQueuedTurnInTransaction as mp, storeIntegrationOAuthClient as mq, submitHumanPromptInTransaction as mr, sumUsageQuantity as ms, supersedeSessionCurrentDirectionInTransaction as mt, touchEnrollmentLastSeen as mu, touchLeaseHolder as mv, updateCodexAllocatorEligibility as mw, updateCodexRotationSettings as mx, updateConnection as my, updateConnectionWithSlackBotSuccessAudit as mz, type ApplyContextCompactionResult as n, upsertWorkspaceModelPolicy as n0, validateHumanInputResponse as n1, verifyDirectWorkspaceMutationSettlement as n2, verifyRetainedProcessMutationSettlement as n3, verifyWorkspaceMutationSettlement as n4, withAccountRls as n5, withCodexCapacityMutation as n6, withCodexCredentialRefreshLock as n7, withCodexTokenDeadline as n8, withRlsContext as n9, withWorkspaceRls as na, withWorkspaceSubjectRls as nb, withWorkspaceUsageLock as nc, workspaceCaptureAtRevision as nd, workspaceCodexSubscriptionActive as ne, type ApplySessionTurnSettlementInput as o, type ApplySessionTurnSettlementResult as p, provisionRoles, type ArmCodexCapacityWaitResult as q, type BootstrapWorkspaceInput as r, CODEX_CAPACITY_REFRESH_MIN_MS as s, CODEX_CREDENTIAL_LEASE_TTL_MS as t, CODEX_RESET_REDEMPTION_OUTCOMES as u, CODEX_ROTATION_STRATEGIES as v, type ClaimCodexResetRedemptionResult as w, type ClaimSessionWorkForAttemptInput as x, type ClaimSessionWorkForAttemptResult as y, type ClaimSlackBotPostOperationResult as z };
|
|
6542
|
+
export { type CodexRateLimitResetCreditsAccountResult as $, AGENT_VISIBLE_MEMORY_STATUSES as A, type BeginSandboxRematerializationResult as B, CODEX_CAPACITY_REFRESH_MAX_MS as C, type ClearSessionContextResult as D, type CodexAccountStatus as E, type CodexAccountUsageSnapshot as F, type CodexAllocatorUpdateResult as G, type CodexAuthDeps as H, type CodexCapacityAvailabilityDecision as I, type CodexCapacityMutationResult as J, type CodexCapacityResetKind as K, type CodexCapacitySelectionContext as L, type CodexCapacityWait as M, type CodexCapacityWaitStatus as N, type CodexCapacityWakeTarget as O, type CodexCredentialForRun as P, type ProvisionResult, type ProvisionRolesOptions, type CodexCredentialLeaseCandidateFilter as Q, type CodexCredentialLeaseCandidateFilterResult as R, type CodexCredentialLeasePolicyScopeResolver as S, type CodexCredentialLeaseQuarantine as T, type CodexCredentialLeaseResult as U, type CodexCredentialLeaseSelection as V, type CodexCredentialLeaseSelectionContext as W, type CodexCredentialStatus as X, type CodexCredentialTokens as Y, type CodexLeaseAccountStatus as Z, type CodexPinSource as _, type AcceptSessionApprovalDecisionResult as a, type HostMcpCredentialResolverContext as a$, type CodexResetRedemptionAttempt as a0, type CodexResetRedemptionOutcome as a1, type CodexResetRedemptionRecovery as a2, type CodexResetRedemptionSendNotReadyReason as a3, type CodexResetRedemptionStatus as a4, type CodexRotationSettings as a5, type CodexRotationStrategy as a6, type CodexTokenDeadlineClock as a7, type CodexTokenDeadlineOptions as a8, type CompleteSlackBotPostOperationResult as a9, type EditQueueCommandResult as aA, type EffectiveControlBlocker as aB, type EffectiveControlResumeOption as aC, type EffectiveControlState as aD, type EffectiveSessionControl as aE, type EnableCapabilityInstallationInput as aF, type EnabledMcpCapabilityServer as aG, type EnqueueSessionTurnInput as aH, type EnrollmentExposure as aI, type EnrollmentOs as aJ, type EnrollmentRecord as aK, type EnrollmentStatus as aL, type ExpiredDrainingSandboxLeaseCount as aM, type ExpiredFileUploadCleanupClaim as aN, FORCE_RLS_TABLES as aO, type FenceCodexResetRedemptionSendResult as aP, type FileUploadCleanupClaimResult as aQ, type ForceDrainResult as aR, type FrozenTurnInitiator as aS, type GitHubInstallation as aT, type GitHubInstallationAccess as aU, GitHubInstallationAuthorityCommitError as aV, type GoalContinuationDecision as aW, type HostExportConsumerStatus as aX, type HostExportKind as aY, HostExportPayloadError as aZ, HostMcpCredentialBindingError as a_, type ComposerDraftRow as aa, type ConnectionBrokerDeps as ab, type ConnectionCredentialForBroker as ac, type ConnectionMetadataWithVerification as ad, ConnectionRefreshHttpError as ae, type ConsumeOAuthStateNonceInput as af, type CorrectWorkspaceMemoryInput as ag, type CorrectWorkspaceMemoryResult as ah, type CreateCapabilityCatalogItemInput as ai, type CreateConnectionInput as aj, type CreateDbOptions as ak, type CreateImportBatchInput as al, type CreateKnowledgeMemoryInput as am, type CreatePackInstallationInput as an, type CreateScheduledTaskInput as ao, type CreateSessionGoalInput as ap, type CreateSessionMcpServerInput as aq, type CreateSocialConnectionInput as ar, type CreateSocialPostInput as as, type CreditBalanceByAccount as at, type Database as au, type DatabaseFailureCode as av, type DbClient as aw, type DbSession as ax, type DeviceEnrollmentRequestRecord as ay, type DeviceEnrollmentStatus as az, type AcceptSessionHumanInputResponseResult as b, type ReconcileColdLostLeaseInstanceBlockersResult as b$, HostMcpCredentialScopeError as b0, HumanInputResponseValidationError as b1, type IdempotentPersistenceTransactionOptions as b2, type ImportBatch as b3, type InitializeSessionStartInput as b4, type InitializeSessionStartResult as b5, type InstallOrReadTurnExecutionPolicyForAttemptResult as b6, type IntegrationOAuthClientForUse as b7, type LeaseHolderKind as b8, type LeaseSnapshot as b9, type MarkWarmLeaseInstanceLostResult as bA, type MaterializeGoalContinuationResult as bB, type MemoryBlockRecord as bC, type MemoryEmbedder as bD, type MemorySanitizeResult as bE, type MeterableWarmLease as bF, NON_RLS_RUNTIME_TABLES as bG, type NestedAgentDepthDeploymentPolicy as bH, type NestedAgentDepthPolicySource as bI, NewSessionDraftAccessError as bJ, NewSessionDraftConflictError as bK, type NewSessionDraftRow as bL, PROTECTED_NO_DIRECT_DML_TABLES as bM, type PendingSessionToolCallInput as bN, type PersistenceFailureDetails as bO, type PersistenceRetryOutcome as bP, type QueueCommandConflictCode as bQ, QueueCommandConflictError as bR, type QueueCommandResult as bS, type QueuedTurnRow as bT, RUNTIME_DML_TABLES as bU, RUNTIME_FULL_DML_TABLES as bV, RUNTIME_READ_INSERT_TABLES as bW, RUNTIME_READ_ONLY_TABLES as bX, RUNTIME_TABLE_PRIVILEGES as bY, type ReapDrainable as bZ, type ReconcileCodexCapacityWaitResult as b_, type ListKnowledgeMemoryOptions as ba, type ListSessionEventPageOptions as bb, type ListSessionEventsOptions as bc, type ListSessionsForSubjectOptions as bd, type ListSessionsOptions as be, type LiveModalSandboxLeaseAttribution as bf, type LostProviderWorkspaceSettlement as bg, MACHINE_METRICS_SERIES_INTERVAL_MS as bh, MAX_INTERNAL_UPDATE_BATCH_BYTES as bi, MAX_INTERNAL_UPDATE_BATCH_MEMBERS as bj, MAX_INTERNAL_UPDATE_BYTES as bk, MEMORY_ACTIVE_RECORD_CAP as bl, MEMORY_BLOCK_KIND_ORDER as bm, MEMORY_BLOCK_RECORD_LIMIT as bn, MEMORY_CORRECT_TOOL_DESCRIPTION as bo, MEMORY_KIND_SECTION_TITLES as bp, MEMORY_NEAR_DUP_COSINE_THRESHOLD as bq, MEMORY_NEAR_DUP_NEIGHBORS as br, MEMORY_SAVE_TOOL_DESCRIPTION as bs, MEMORY_SEARCH_DEFAULT_LIMIT as bt, MEMORY_SEARCH_MAX_LIMIT as bu, MEMORY_SEARCH_TOOL_DESCRIPTION as bv, MEMORY_TEXT_MAX_CHARS as bw, MEMORY_VISIBLE_RECORD_CAP as bx, type MachineMetricsRow as by, type MachineMetricsSample as bz, type AccrueWarmSecondsResult as c, type SandboxWorkspaceReadiness as c$, type ReconcileSessionAttemptQuiescenceResult as c0, type RecoverSessionDispatchInput as c1, type RecoverSessionDispatchResult as c2, type RefreshTransportOptions as c3, type RegisterWorkspacePackInput as c4, type RegistryCapabilityCatalogItemInput as c5, type RegistryCatalogSurfaceKey as c6, type ReplaceIntegrationOAuthClientInput as c7, type RequestSessionTurnRecoveryInput as c8, type RequestSessionTurnRecoveryResult as c9, SESSION_EVENT_DB_PAGE_MAX_BYTES as cA, SESSION_LIST_SNAPSHOT_MAX_ACTIVE_PER_SUBJECT as cB, SESSION_LIST_SNAPSHOT_MAX_IDS as cC, type SafeDatabaseErrorFacts as cD, type SandboxArchiveAvailability as cE, type SandboxArchiveRevision as cF, SandboxImageConflictError as cG, type SandboxKind as cH, type SandboxLeaseLiveness as cI, SandboxLeaseRecoveryBlockedError as cJ, SandboxLeaseSupersededError as cK, type SandboxOpenPtySessionRow as cL, type SandboxProviderExistence as cM, type SandboxPtyProcessIdentity as cN, type SandboxPtySessionRow as cO, type SandboxRecord as cP, type SandboxRecoveryState as cQ, type SandboxRestoreStatus as cR, type SandboxRetainedProcess as cS, type SandboxRetainedProcessIdentity as cT, SandboxRetainedProcessPromotionFencedError as cU, type SandboxRetainedProcessReconciliationClaim as cV, type SandboxRetainedProcessState as cW, SandboxRigConflictError as cX, type SandboxWorkspaceMutationAdmission as cY, SandboxWorkspaceMutationFencedError as cZ, type SandboxWorkspaceMutationProviderOutcome as c_, type ResolveConnectionCredentialInput as ca, type ResolveConnectionCredentialResult as cb, type RetainedFileArtifact as cc, type RetainedProcessProviderProof as cd, RigActiveVersionChangedError as ce, RigChangeAlreadyVerifyingError as cf, type RigChangeMonitoringSummary as cg, RigChangeTransitionError as ch, type RigVersionContentInput as ci, type RigVersionMonitoringSummary as cj, type RlsContext as ck, type RlsStrategy as cl, type RuntimeDatabaseIdentity as cm, type RuntimeDatabasePosture as cn, RuntimeDatabasePostureError as co, type RuntimeDatabasePostureOptions as cp, type RuntimeRoutinePosture as cq, type RuntimeSchemaPosture as cr, type RuntimeTableDmlPrivilege as cs, type RuntimeTablePosture as ct, type RuntimeTablePrivilegeContract as cu, SESSION_ANCESTRY_LIMIT as cv, SESSION_DISCOVERY_CONTROL_TARGET_LIMIT as cw, SESSION_DISCOVERY_CONTROL_TITLE_MAX_CHARS as cx, SESSION_DISCOVERY_GOAL_MAX_CHARS as cy, SESSION_DISCOVERY_MESSAGE_MAX_CHARS as cz, type AcquireLeaseInput as d, type SteerQueueCommandResult as d$, SanitizedDatabasePersistenceCause as d0, type SaveWorkspaceMemoryInput as d1, type SaveWorkspaceMemoryResult as d2, type SessionAttemptActivityRef as d3, type SessionAttemptInterruptionSettlement as d4, type SessionCodexState as d5, type SessionCommandActor as d6, SessionCommandIdempotencyError as d7, type SessionCommandReceiptRow as d8, SessionContextBusyError as d9, SessionPinAccessError as dA, SessionPinVersionConflictError as dB, type SessionRecordingCodec as dC, type SessionRecordingMode as dD, type SessionRecordingRow as dE, type SessionRecordingState as dF, type SessionSpawnDenial as dG, type SessionSpawnDenialCode as dH, SessionSpawnDeniedDbError as dI, type SessionSystemUpdateOutboxDelivery as dJ, SessionToolPolicyVersionConflictError as dK, type SessionTurnAttemptOutcome as dL, type SessionTurnForExecution as dM, type SessionTurnRecordingSettlement as dN, type SessionWorkPeek as dO, type SessionWorkTrigger as dP, type SessionWorkflowWake as dQ, type SessionWorkflowWakeDeliveryResult as dR, type SessionWorkspaceCaptureLookup as dS, type SetSessionCodexPinOptions as dT, type SetSessionGoalStatusEvent as dU, type SettleCodexCredentialFailoverResult as dV, type SettleCodexCredentialLeaseLossResult as dW, type SlackBotInstallCallbackFailureReason as dX, type SlackBotInstallCallbackFailureStage as dY, SlackBotLifecycleSuccessAuditError as dZ, type SlackBotPostOperation as d_, SessionControlConflictError as da, SessionControlInvariantError as db, type SessionControlMutationResult as dc, type SessionCreateDeniedResult as dd, type SessionCreateInput as de, type SessionCreateResult as df, type SessionCreateSuccessResult as dg, type SessionDepthPolicy as dh, type SessionDiscoveryControl as di, type SessionDiscoveryCursor as dj, type SessionDiscoveryOrderBy as dk, type SessionDiscoverySummary as dl, type SessionEventPage as dm, SessionEventPersistenceError as dn, type SessionEventWriteLockInput as dp, type SessionEventWriteLocks as dq, type SessionGoalContinuationProjection as dr, SessionIdConflictError as ds, type SessionLineage as dt, SessionListAccessError as du, type SessionListCursor as dv, SessionListCursorError as dw, SessionListCursorExpiredError as dx, SessionListSnapshotLimitError as dy, type SessionMcpServerForRun as dz, type AcquireLeaseResult as e, applyCreditDebitUpToBalance as e$, type StoreIntegrationOAuthClientInput as e0, type StoredIntegrationOAuthClient as e1, type StreamAcknowledgment as e2, type SubmitHumanPromptResult as e3, type ToolspaceCallReservation as e4, type ToolspaceTurnAttemptClaims as e5, type TurnAttemptFenceRejectReason as e6, type UpdateConnectionInput as e7, type UpdateImportBatchCountsInput as e8, type UpdateKnowledgeMemoryInput as e9, type WorkspaceModelPolicy as eA, abandonCodexResetRedemptionBeforeProvider as eB, abandonRecordingForTurnAttempt as eC, acceptSessionApprovalDecision as eD, acceptSessionHumanInputResponse as eE, accrueWarmSeconds as eF, acknowledgeHostExportBatch as eG, acquireCodexCredentialLease as eH, acquireLease as eI, activateRigVersion as eJ, activateWorkspaceInstructionPolicyRevision as eK, addSessionSystemUpdate as eL, addSessionSystemUpdateWithSourceMutation as eM, admitToolspaceTurnAttempt as eN, adoptCodexResetRedemptionAttempt as eO, advanceWorkspaceGeneration as eP, advanceWorkspaceGenerationForDirectRequest as eQ, advanceWorkspaceGenerationForRetainedProcess as eR, allAccountPermissions as eS, allWorkspacePermissions as eT, appendSessionEventToSandboxGroup as eU, appendSessionEvents as eV, appendSessionEventsAndUpdateSession as eW, appendSessionEventsForTurnAttempt as eX, appendSessionEventsWithLockedSessionUpdate as eY, appendSessionHistoryItems as eZ, applyContextCompaction as e_, type UpdateScheduledTaskInput as ea, type UpdateSessionMcpApprovalPolicyResult as eb, type UpdateSessionMcpServerCredentialsInput as ec, type UpdateSessionMcpServerCredentialsResult as ed, type UpsertCodexSubscriptionCredentialResult as ee, type UserLookup as ef, type VariableSetForRun as eg, WORKSPACE_MEMORY_BLOCK_EMPTY as eh, WORKSPACE_MEMORY_BLOCK_HEADER_POPULATED as ei, WORKSPACE_MEMORY_BLOCK_TOKEN_BUDGET as ej, type WorkspaceCaptureCommitResult as ek, type WorkspaceCaptureGcPlan as el, type WorkspaceCaptureGcRow as em, type WorkspaceCaptureRow as en, type WorkspaceControlLockMode as eo, type WorkspaceControlMutationResult as ep, type WorkspaceControlRow as eq, type WorkspaceEnvironmentForRun as er, WorkspaceInstructionPolicyConflictError as es, WorkspaceInstructionPolicyInvalidOperationError as et, WorkspaceInstructionPolicyLegacyUnavailableError as eu, WorkspaceInstructionPolicyNotFoundError as ev, type WorkspaceMemoryOrigin as ew, type WorkspaceMemorySearchInput as ex, type WorkspaceMemorySearchMode as ey, type WorkspaceMemorySearchResult as ez, type ActiveRetainedProcessOwnerCount as f, countSessionsUsingRig as f$, applyCreditLedgerEntry as f0, applySessionTurnSettlement as f1, approveDeviceEnrollmentRequest as f2, areGitHubRepositoriesAllowedForWorkspace as f3, armCodexCapacityWait as f4, assertAgentCommandAuthorityInTransaction as f5, assertRuntimeDatabasePosture as f6, autoResumeSessionBranchInTransaction as f7, beginRigChangeVerificationAttempt as f8, beginSandboxRematerialization as f9, commitWarmingToWarm as fA, completeCodexResetRedemption as fB, completeExpiredFileUploadCleanup as fC, completeFileUpload as fD, completeFileUploadCleanup as fE, completeSlackBotPostOperation as fF, computeWorkspaceCaptureGcPlan as fG, confirmDrainCold as fH, consumeDeviceEnrollmentRequest as fI, consumeIntegrationOAuthStateNonce as fJ, consumeNewSessionDraftInTransaction as fK, correctWorkspaceMemory as fL, countActiveApiKeysForWorkspace as fM, countActiveRetainedProcessesByOwnerState as fN, countActiveSessionHistoryItems as fO, countActiveSessionsForWorkspace as fP, countActiveSessionsUsingEnvironment as fQ, countActiveSessionsUsingVariableSet as fR, countConsecutiveReactiveRotations as fS, countExpiredDrainingSandboxLeases as fT, countQueuedTurns as fU, countRigs as fV, countSandboxLeasesByLiveness as fW, countScheduledTasksForWorkspace as fX, countScheduledTasksUsingEnvironment as fY, countScheduledTasksUsingVariableSet as fZ, countSessionHistoryItems as f_, bindAuthorizedGitHubInstallationRepositories as fa, bindGitHubInstallationRepositories as fb, bootstrapWorkspace as fc, buildChildCompletionDigest as fd, buildCodexTokenResolver as fe, buildConnectionTokenResolver as ff, buildHostConnectionTokenResolver as fg, canonicalSessionCommandHash as fh, claimCodexResetRedemption as fi, claimExpiredFileUploadCleanup as fj, claimFileUploadCleanup as fk, claimHostExportBatch as fl, claimPendingSessionSystemUpdateOutbox as fm, claimPendingSessionWorkflowWakes as fn, claimSessionWorkForAttempt as fo, claimSlackBotPostOperation as fp, claimTerminalRetainedProcesses as fq, clearDurablePendingSessionToolCalls as fr, clearEnrollmentWentOffline as fs, clearPendingSessionToolspaceCall as ft, clearSessionContext as fu, clearSessionGoal as fv, clearedContextMarkerItem as fw, closePtySession as fx, closeSessionTurnAttemptInTransaction as fy, codexCapacityRefreshBackoffMs as fz, type ActiveSandboxPointer as g, enqueueSessionWorkflowWakeIfRunnable as g$, countVariableSets as g0, countWorkspaceEnvironments as g1, countWorkspacesForAccount as g2, createApiKey as g3, createConnection as g4, createConnectionWithSlackBotSuccessAudit as g5, createDb as g6, createDeviceEnrollmentRequest as g7, createEnrollment as g8, createFileUpload as g9, deleteGitHubInstallationBinding as gA, deleteRecording as gB, deleteRig as gC, deleteRigIfNoActiveSessions as gD, deleteScheduledTask as gE, deleteSessionQueueItemInTransaction as gF, deleteVariableSet as gG, deleteVariableSetVariable as gH, deleteWorkspace as gI, deleteWorkspaceCaptureRows as gJ, deleteWorkspaceEnvironment as gK, deleteWorkspaceEnvironmentVariable as gL, deleteWorkspacePack as gM, denyDeviceEnrollmentRequest as gN, diffWorkspaceInstructionPolicyContent as gO, diffWorkspaceInstructionPolicyRevisions as gP, disableCapabilityInstallation as gQ, disableHostExportConsumer as gR, disconnectAllCodexAccounts as gS, disconnectCodexAccount as gT, editQueuedTurnInTransaction as gU, enableCapabilityInstallation as gV, enablePackInstallation as gW, encodeSessionListCursor as gX, encryptEnvironmentValue as gY, enqueueSessionTurn as gZ, enqueueSessionWorkflowWake as g_, createImportBatch as ga, createKnowledgeMemory as gb, createRig as gc, createRigChange as gd, createRigVersion as ge, createRigVersionForChangePromotion as gf, createSandbox as gg, createScheduledTask as gh, createScheduledTaskRun as gi, createSession as gj, createSessionGoal as gk, createSessionMcpServers as gl, createSessionWithIdempotencyKey as gm, createSessionWithIdempotencyKeyResult as gn, createSocialConnection as go, createSocialPost as gp, createVariableSet as gq, createWorkspace as gr, createWorkspaceEnvironment as gs, createWorkspaceInstructionPolicyDraft as gt, databaseFailureCode as gu, deadLetterHostExportHead as gv, decodeSessionListCursor as gw, decryptEnvironmentValue as gx, decryptedCapabilityHeaders as gy, deferRetainedProcessReconciliation as gz, type AddSessionSystemUpdateInput as h, getScheduledTask as h$, enqueueSessionWorkflowWakeInTransaction as h0, ensureCodexRotationSettings as h1, ensureManagedAccessForUser as h2, estimateMemoryTokens as h3, evaluateGoalContinuation as h4, evaluateRuntimeDatabasePosture as h5, evaluateSessionControl as h6, evaluateSessionControls as h7, evaluateSessionDiscoveryControls as h8, expireSessionHumanInputRequest as h9, getFileUpload as hA, getHostExportConsumerStatus as hB, getHumanInputResumeForEvent as hC, getKnowledgeMemory as hD, getLatestRunState as hE, getLatestStartedSessionTurn as hF, getManagedAccount as hG, getManagedUserByEmail as hH, getMaterializedSandboxFileResources as hI, getNestedAgentDepthDeploymentPolicy as hJ, getNewSessionDraftInTransaction as hK, getOpenPtySession as hL, getOrCreateSessionSystemUpdateOutbox as hM, getPackInstallation as hN, getPendingDeviceEnrollmentRequestByUserCode as hO, getPendingDeviceEnrollmentRequestByUserCodeGlobal as hP, getRecording as hQ, getRetainedFileArtifact as hR, getRetainedProcess as hS, getRig as hT, getRigByName as hU, getRigChange as hV, getRigName as hW, getRigVersion as hX, getRigVersionById as hY, getSandbox as hZ, getSandboxSessionEnvelope as h_, failHostExportBatch as ha, failSandboxRematerialization as hb, failWarmingToCold as hc, fenceCodexResetRedemptionSend as hd, fetchCodexRateLimitResetCreditsForAccount as he, fetchCodexUsageForAccount as hf, finalizeEnrollmentByToken as hg, findActiveApiKeyByHash as hh, forceDrainOverLimitViewerOnlyBoxes as hi, frozenInitiatorForCommandActor as hj, getActiveSessionHistoryItems as hk, getActiveSessionTurnForExecution as hl, getAnySessionInGroup as hm, getBillingBalance as hn, getBillingCustomer as ho, getCapabilityCatalogItem as hp, getCapabilityInstallation as hq, getCodexCapacityWaitForSession as hr, getCodexCredentialStatus as hs, getCodexResetRedemptionAttempt as ht, getCodexRotationSettings as hu, getComposerDraftInTransaction as hv, getConnectionMetadata as hw, getDeviceEnrollmentRequestByDeviceCode as hx, getEnrollment as hy, getFile as hz, type AddSessionSystemUpdateResult as i, latestWorkspaceCapture as i$, getSession as i0, getSessionAttemptActivityRef as i1, getSessionByCreateIdempotencyKey as i2, getSessionCodexState as i3, getSessionEvent as i4, getSessionEventByClientEventId as i5, getSessionForSubject as i6, getSessionGoal as i7, getSessionGoalWithContinuation as i8, getSessionHistoryItems as i9, getWorkspaceModelPolicy as iA, getWorkspacePack as iB, grantWorkspaceAccess as iC, hasAuditableGitHubInstallationAuthority as iD, hasCreditLedgerEntry as iE, hashMemoryText as iF, heartbeatCodexCredentialLease as iG, heartbeatCodexCredentialLeaseUntil as iH, heartbeatLeaseHolder as iI, importLegacyWorkspaceInstructionPolicyDraft as iJ, ingestMachineMetricsSample as iK, initializeSessionStartAtomically as iL, insertFailedWorkspaceCapture as iM, insertMachineMetricsSeries as iN, insertPtySession as iO, insertRecording as iP, insertWorkspaceCapture as iQ, inspectRuntimeDatabasePosture as iR, installOrReadTurnExecutionPolicyForAttempt as iS, interruptedToolCallResult as iT, isCodexBilledTurn as iU, isDatabasePersistenceFailure as iV, isMemoryTextTooLong as iW, isRetryablePersistenceSqlState as iX, isSessionCompactionRequested as iY, isSessionEventPersistenceError as iZ, isStripeWebhookProcessed as i_, getSessionHumanInputRequest as ia, getSessionLineage as ib, getSessionQueueSnapshot as ic, getSessionRootId as id, getSessionSpawnDenial as ie, getSessionSpawnDenialByIdempotencyKey as ig, getSessionSystemUpdateOutboxByDedupeKey as ih, getSessionTurn as ii, getSessionTurnForAttempt as ij, getSlackBotPostOperation as ik, getSocialConnection as il, getStoredCapabilityHeaderCiphertext as im, getStreamAcknowledgment as io, getVariableSet as ip, getVariableSetByName as iq, getVariableSetValuesForRun as ir, getWorkspace as is, getWorkspaceControlEvent as it, getWorkspaceDefaultRigId as iu, getWorkspaceEnvironment as iv, getWorkspaceEnvironmentByName as iw, getWorkspaceEnvironmentValuesForRun as ix, getWorkspaceGrant as iy, getWorkspaceInstructionPolicyRevision as iz, type AdoptCodexResetRedemptionResult as j, markSandboxFileResourcesMaterialized as j$, listApiKeys as j0, listCapabilityCatalogItems as j1, listCapabilityInstallations as j2, listCodexAccountStatuses as j3, listCodexResetRedemptionRecoveries as j4, listConnectionsMetadata as j5, listCreditBalancesByAccount as j6, listDistinctRigVersionIdsInGroup as j7, listDistinctVariableSetIdsInGroup as j8, listEnabledMcpCapabilityServers as j9, listSessionIdsInGroup as jA, listSessionMcpServerMetadata as jB, listSessionMcpServersForChildInheritance as jC, listSessionMcpServersForRun as jD, listSessionSpawnDenials as jE, listSessionSystemUpdatesForTurn as jF, listSessionTurns as jG, listSessions as jH, listSessionsForSubject as jI, listSocialConnections as jJ, listSocialPosts as jK, listUsageEvents as jL, listVariableSets as jM, listWorkspaceControlEvents as jN, listWorkspaceEnvironments as jO, listWorkspaceInstructionPolicyRevisions as jP, listWorkspaceMembers as jQ, listWorkspacePacks as jR, listWorkspacesForSubject as jS, loadCodexCredentialForRun as jT, loadConnectionCredentialForBroker as jU, loadIntegrationOAuthClient as jV, loadVariableSetForRun as jW, loadWorkspaceEnvironmentForRun as jX, lockSessionEventWriteRows as jY, lockWorkspaceInferenceControl as jZ, markFileUploadFailed as j_, listEnrollments as ja, listGitHubInstallationAccessForWorkspace as jb, listGitHubInstallationIdsForWorkspace as jc, listGitHubInstallationsForWorkspace as jd, listKnowledgeMemories as je, listLiveModalSandboxLeaseAttributions as jf, listMeterableWarmLeases as jg, listOpenPtySessions as jh, listOutstandingSessionSystemUpdates as ji, listPackInstallations as jj, listPendingCodexCapacityWakeTargets as jk, listPendingSessionTurns as jl, listRecordings as jm, listRegistryCatalogSurfaceKeys as jn, listRigChangeMonitoringSummaries as jo, listRigChanges as jp, listRigVersionMonitoringSummaries as jq, listRigVersions as jr, listRigs as js, listSandboxes as jt, listScheduledTaskRuns as ju, listScheduledTasks as jv, listSessionDiscoverySummaries as jw, listSessionEventPage as jx, listSessionEvents as jy, listSessionHumanInputRequests as jz, AgentCommandAuthorityError as k, refreshOAuthConnectionCredential as k$, markSandboxProviderReady as k0, markSandboxRestoreVerifying as k1, markScheduledTaskRunFailedIfQueued as k2, markSessionAttemptQuiesced as k3, markSessionSystemUpdateOutboxDeliveredInTransaction as k4, markSessionSystemUpdateOutboxFailed as k5, markSessionWorkflowWakeDelivered as k6, markSessionWorkflowWakeFailed as k7, markStaleRegistryCatalogItems as k8, markStripeWebhookProcessed as k9, readMachineMetricsSeries as kA, readWorkspaceArchiveCapturePreflight as kB, reapExpiredSessionListSnapshots as kC, reapStaleLeaseHolders as kD, reapStaleLeaseHoldersGlobal as kE, reconcileCodexCapacityWait as kF, reconcileColdLostLeaseInstanceBlockers as kG, reconcileSessionAttemptQuiescence as kH, recordAuditEvent as kI, recordCodexAccountConnectors as kJ, recordCodexAccountUsage as kK, recordCodexAccountUsageWithWakeTargets as kL, recordCodexTokenRefresh as kM, recordConnectionTokenRefresh as kN, recordConnectionUsed as kO, recordLeaseDataPlaneUrl as kP, recordLeaseTerminalDataPlaneUrl as kQ, recordPendingSessionToolCallResult as kR, recordRetainedProcessReconciliationProof as kS, recordSessionActiveCodexCredential as kT, recordSkippedContextCompaction as kU, recordSlackBotInstallCallbackFailure as kV, recordStreamAcknowledgment as kW, recordStripeWebhookEvent as kX, recordUsageEvent as kY, recordWarmingSandboxCreated as kZ, recoverSessionDispatch as k_, markWarmLeaseInstanceLost as ka, materializeGoalContinuation as kb, mcpServerIdForCapability as kc, moveQueuedTurnInTransaction as kd, mutateSessionControlInTransaction as ke, mutateWorkspaceControlInTransaction as kf, nestedPostgresSqlState as kg, newSessionDraftToolsProvided as kh, nextSessionHistoryPosition as ki, normalizeBearerScheme as kj, normalizeMemoryText as kk, orphanedResultRowIndicesForRepair as kl, peekSessionWork as km, persistDrainSnapshot as kn, persistWarmSnapshot as ko, planWorkspaceCaptureGc as kp, projectEffectiveControlForRelatedAccess as kq, projectSessionForRelatedAccess as kr, pruneHostExportOutbox as ks, publicNewSessionDraftOptions as kt, quarantineCodexCredentialForLease as ku, reArmDrainingLease as kv, readActiveSandbox as kw, readLease as kx, readMachineMetricsLatest as ky, readMachineMetricsLatestForWorkspace as kz, type AgentInternalUpdateCommandResult as l, setCodexCredentialExhaustedWithWakeTargets as l$, registerDbBinding as l0, registerHostExportConsumer as l1, registerInternalUpdateWakeInTransaction as l2, registerPendingSessionToolCall as l3, registerSessionTurnAttemptClaim as l4, registerSessionWorkflowWakeInTransaction as l5, registerWorkspacePack as l6, releaseCodexCredentialLease as l7, releaseCodexResetRedemptionClaim as l8, releaseLeaseHolder as l9, rlsContextForWorkspace as lA, rlsStrategyFor as lB, rollbackWorkspaceInstructionPolicyRevision as lC, rotateWorkspaceArchives as lD, runIdempotentPersistenceTransaction as lE, runtimeDatabaseReadyCheck as lF, safeDatabaseErrorFacts as lG, sanitizeEventPayload as lH, sanitizeEventString as lI, sanitizeMemoryText as lJ, sanitizeModelPayload as lK, saveComposerDraftInTransaction as lL, saveNewSessionDraftInTransaction as lM, saveRunState as lN, saveWorkspaceMemory as lO, searchWorkspaceMemories as lP, seedNewSessionDraftInTransaction as lQ, sendAgentMessageInTransaction as lR, serializeEffectiveSessionControl as lS, sessionAuthorizationScopeFilter as lT, sessionLatestWorkspaceCapture as lU, sessionSubject as lV, sessionTreeStatsForSessions as lW, sessionsWithActiveOpOnEnrollment as lX, setActiveCodexCredential as lY, setActiveSandbox as lZ, setCodexCredentialExhausted as l_, releaseSlackBotPostOperationClaim as la, removeWorkspaceMember as lb, renameCodexAccount as lc, renderWorkspaceMemoryBlock as ld, replaceIntegrationOAuthClient as le, requestSessionCompaction as lf, requestSessionTurnRecovery as lg, requireFile as lh, requireScheduledTask as li, requireSession as lj, requireSocialConnection as lk, requireWorkspace as ll, reserveSessionCommandReceipt as lm, reserveToolspaceCallForAttempt as ln, resolveWorkspaceMemoryBlock as lo, resumeHostExportConsumer as lp, retainWorkspaceMutationProcess as lq, retainedProcessReconciliationProof as lr, retainedProcessSettlementIdentity as ls, retireHostExportConsumer as lt, revokeApiKey as lu, revokeConnection as lv, revokeConnectionWithSlackBotSuccessAudit as lw, revokeEnrollment as lx, revokeViewer as ly, rewindHostExportConsumer as lz, type AppendEventInput as m, upsertSandboxSessionEnvelope as m$, setCodexCredentialStatus as m0, setCodexCredentialStatusById as m1, setConnectionStatus as m2, setEnrollmentDisplayState as m3, setEnrollmentOpStreamState as m4, setEnrollmentWentOffline as m5, setInitialActiveCodexCredential as m6, setRlsContext as m7, setSessionCodexPin as m8, setSessionGoalLastContinuationTurn as m9, updateConnection as mA, updateConnectionWithSlackBotSuccessAudit as mB, updateImportBatchCounts as mC, updateKnowledgeMemory as mD, updatePackInstallationStatus as mE, updatePtySessionActivity as mF, updateRecording as mG, updateRig as mH, updateRigChangeStatus as mI, updateScheduledTask as mJ, updateScheduledTaskRun as mK, updateSessionCommandReceiptResult as mL, updateSessionGoal as mM, updateSessionGoalWithEvent as mN, updateSessionMcpApprovalPolicy as mO, updateSessionMcpServerCredentials as mP, updateSessionTitle as mQ, updateVariableSet as mR, updateWorkspace as mS, updateWorkspaceEnvironment as mT, updateWorkspaceSettings as mU, upsertBillingCustomer as mV, upsertCapabilityCatalogItem as mW, upsertCodexSubscriptionCredential as mX, upsertGitHubInstallation as mY, upsertMachineMetricsLatest as mZ, upsertRegistryCapabilityCatalogItem as m_, setSessionGoalStatus as ma, setSessionGoalStatusWithEvent as mb, setSessionLastInputTokensForTurnAttempt as mc, setSessionPin as md, setSubjectRlsContext as me, setTemporalWorkflowId as mf, setVariableSetVariable as mg, setWorkspaceDefaultRig as mh, setWorkspaceEnvironmentVariable as mi, settleCodexCredentialFailover as mj, settleCodexCredentialLeaseLoss as mk, settleRetainedProcess as ml, settleScheduledTaskRunInTransaction as mm, settleSessionAttemptInterruptions as mn, settleSessionIdleWithParentOutbox as mo, shortMemoryId as mp, steerAgentSessionInTransaction as mq, steerQueuedTurnInTransaction as mr, storeIntegrationOAuthClient as ms, submitHumanPromptInTransaction as mt, sumUsageQuantity as mu, supersedeSessionCurrentDirectionInTransaction as mv, touchEnrollmentLastSeen as mw, touchLeaseHolder as mx, updateCodexAllocatorEligibility as my, updateCodexRotationSettings as mz, type ApplyContextCompactionResult as n, upsertSessionGoal as n0, upsertSessionGoalWithEvent as n1, upsertWorkspaceModelPolicy as n2, validateHumanInputResponse as n3, verifyDirectWorkspaceMutationSettlement as n4, verifyRetainedProcessMutationSettlement as n5, verifyWorkspaceMutationSettlement as n6, withAccountRls as n7, withCodexCapacityMutation as n8, withCodexCredentialRefreshLock as n9, withCodexTokenDeadline as na, withRlsContext as nb, withWorkspaceRls as nc, withWorkspaceSubjectRls as nd, withWorkspaceUsageLock as ne, workspaceCaptureAtRevision as nf, workspaceCodexSubscriptionActive as ng, type ApplySessionTurnSettlementInput as o, type ApplySessionTurnSettlementResult as p, provisionRoles, type ArmCodexCapacityWaitResult as q, type BootstrapWorkspaceInput as r, CODEX_CAPACITY_REFRESH_MIN_MS as s, CODEX_CREDENTIAL_LEASE_TTL_MS as t, CODEX_RESET_REDEMPTION_OUTCOMES as u, CODEX_ROTATION_STRATEGIES as v, type ClaimCodexResetRedemptionResult as w, type ClaimSessionWorkForAttemptInput as x, type ClaimSessionWorkForAttemptResult as y, type ClaimSlackBotPostOperationResult as z };
|
|
@@ -4943,7 +4943,7 @@ declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
4943
4943
|
columnType: "PgJsonb";
|
|
4944
4944
|
data: ("set_session_title" | "goal_set" | "goal_update" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "variable_set_list" | "environment_list" | "variable_set_set_variable" | "environment_set_variable" | "github_connect_link" | "github_token" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_list_users" | "slack_bot_post_message")[];
|
|
4945
4945
|
driverParam: unknown;
|
|
4946
|
-
notNull:
|
|
4946
|
+
notNull: true;
|
|
4947
4947
|
hasDefault: false;
|
|
4948
4948
|
isPrimaryKey: false;
|
|
4949
4949
|
isAutoincrement: false;
|
|
@@ -4961,11 +4961,11 @@ declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
4961
4961
|
dataType: "json";
|
|
4962
4962
|
columnType: "PgJsonb";
|
|
4963
4963
|
data: {
|
|
4964
|
-
mode: "explicit" | "workspace_default" | "inherited"
|
|
4964
|
+
mode: "explicit" | "workspace_default" | "inherited";
|
|
4965
4965
|
inheritedFromSessionId: string | null;
|
|
4966
4966
|
};
|
|
4967
4967
|
driverParam: unknown;
|
|
4968
|
-
notNull:
|
|
4968
|
+
notNull: true;
|
|
4969
4969
|
hasDefault: false;
|
|
4970
4970
|
isPrimaryKey: false;
|
|
4971
4971
|
isAutoincrement: false;
|
|
@@ -4976,7 +4976,7 @@ declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
4976
4976
|
generated: undefined;
|
|
4977
4977
|
}, {}, {
|
|
4978
4978
|
$type: {
|
|
4979
|
-
mode: "explicit" | "workspace_default" | "inherited"
|
|
4979
|
+
mode: "explicit" | "workspace_default" | "inherited";
|
|
4980
4980
|
inheritedFromSessionId: string | null;
|
|
4981
4981
|
};
|
|
4982
4982
|
}>;
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/pg-core';
|
|
3
|
-
export { o as agentRunStates, p as apiKeys, q as auditEvents, r as billingCustomers, t as capabilityCatalogItems, u as capabilityInstallations, v as codexCapacityWaiters, x as codexCredentialLeases, y as codexResetRedemptionAttempts, z as codexRotationSettings, A as codexSubscriptionCredentials, d as composerDrafts, B as connections, C as creditLedgerEntries, D as deviceEnrollmentRequests, h as deviceEnrollmentStatusValues, E as documentBases, F as documentChunks, G as documents, g as enrollmentExposureValues, f as enrollmentOsValues, i as enrollmentStatusValues, H as enrollments, I as fileUploads, J as files, K as githubInstallationRepositories, L as githubInstallations, M as hostExportConfig, N as hostExportConsumers, O as hostExportCursorState, P as hostExportDeadLetters, Q as hostExportOutbox, R as importBatches, S as integrationOauthClients, T as integrationOauthStateNonces, U as knowledgeMemories, V as machineMetricsLatest, W as machineMetricsSeries, X as managedAccounts, Y as nestedAgentDepthConfiguration, n as newSessionDrafts, Z as packInstallations, _ as rigChanges, $ as rigVersions, a0 as rigs, j as sandboxKindValues, a1 as sandboxLeaseHolders, a2 as sandboxLeaseLivenessValues, a3 as sandboxLeases, a4 as sandboxPtySessions, a5 as sandboxRetainedProcessStateValues, a6 as sandboxRetainedProcesses, a7 as sandboxSessionEnvelopes, a8 as sandboxWorkspaceMutationActorKindValues, a9 as sandboxWorkspaceMutationAdmissions, aa as sandboxWorkspaceMutationHolderKindValues, ab as sandboxes, ac as scheduledTaskRuns, ad as scheduledTasks, ae as sessionAttemptInterruptions, s as sessionCommandReceipts, af as sessionEvents, ag as sessionGoals, ah as sessionHistoryItems, ai as sessionHumanInputRequests, aj as sessionListSnapshots, ak as sessionMcpServers, al as sessionPendingToolCalls, am as sessionPins, k as sessionRecordingCodecValues, l as sessionRecordingModeValues, m as sessionRecordingStateValues, an as sessionRecordings, ao as sessionSpawnDenials, ap as sessionSystemUpdateOutbox, aq as sessionSystemUpdates, c as sessionTurnAttempts, b as sessionTurns, ar as sessionWorkflowWakeOutbox, a as sessions, as as slackBotPostOperations, at as socialConnections, au as socialPosts, av as stripeWebhookEvents, aw as usageEvents, ax as workspaceCaptures, ay as workspaceControlEvents, az as workspaceInferenceControls, aA as workspaceInstructionPolicyActivationEvents, aB as workspaceInstructionPolicyHeads, aC as workspaceInstructionPolicyRevisions, aD as workspaceMemberships, aE as workspaceModelPolicies, aF as workspacePacks, aG as workspaceSessionActivityRevisions, aH as workspaceVariableSetVariables, aI as workspaceVariableSets, w as workspaces } from './schema-
|
|
3
|
+
export { o as agentRunStates, p as apiKeys, q as auditEvents, r as billingCustomers, t as capabilityCatalogItems, u as capabilityInstallations, v as codexCapacityWaiters, x as codexCredentialLeases, y as codexResetRedemptionAttempts, z as codexRotationSettings, A as codexSubscriptionCredentials, d as composerDrafts, B as connections, C as creditLedgerEntries, D as deviceEnrollmentRequests, h as deviceEnrollmentStatusValues, E as documentBases, F as documentChunks, G as documents, g as enrollmentExposureValues, f as enrollmentOsValues, i as enrollmentStatusValues, H as enrollments, I as fileUploads, J as files, K as githubInstallationRepositories, L as githubInstallations, M as hostExportConfig, N as hostExportConsumers, O as hostExportCursorState, P as hostExportDeadLetters, Q as hostExportOutbox, R as importBatches, S as integrationOauthClients, T as integrationOauthStateNonces, U as knowledgeMemories, V as machineMetricsLatest, W as machineMetricsSeries, X as managedAccounts, Y as nestedAgentDepthConfiguration, n as newSessionDrafts, Z as packInstallations, _ as rigChanges, $ as rigVersions, a0 as rigs, j as sandboxKindValues, a1 as sandboxLeaseHolders, a2 as sandboxLeaseLivenessValues, a3 as sandboxLeases, a4 as sandboxPtySessions, a5 as sandboxRetainedProcessStateValues, a6 as sandboxRetainedProcesses, a7 as sandboxSessionEnvelopes, a8 as sandboxWorkspaceMutationActorKindValues, a9 as sandboxWorkspaceMutationAdmissions, aa as sandboxWorkspaceMutationHolderKindValues, ab as sandboxes, ac as scheduledTaskRuns, ad as scheduledTasks, ae as sessionAttemptInterruptions, s as sessionCommandReceipts, af as sessionEvents, ag as sessionGoals, ah as sessionHistoryItems, ai as sessionHumanInputRequests, aj as sessionListSnapshots, ak as sessionMcpServers, al as sessionPendingToolCalls, am as sessionPins, k as sessionRecordingCodecValues, l as sessionRecordingModeValues, m as sessionRecordingStateValues, an as sessionRecordings, ao as sessionSpawnDenials, ap as sessionSystemUpdateOutbox, aq as sessionSystemUpdates, c as sessionTurnAttempts, b as sessionTurns, ar as sessionWorkflowWakeOutbox, a as sessions, as as slackBotPostOperations, at as socialConnections, au as socialPosts, av as stripeWebhookEvents, aw as usageEvents, ax as workspaceCaptures, ay as workspaceControlEvents, az as workspaceInferenceControls, aA as workspaceInstructionPolicyActivationEvents, aB as workspaceInstructionPolicyHeads, aC as workspaceInstructionPolicyRevisions, aD as workspaceMemberships, aE as workspaceModelPolicies, aF as workspacePacks, aG as workspaceSessionActivityRevisions, aH as workspaceVariableSetVariables, aI as workspaceVariableSets, w as workspaces } from './schema-DhkRhcuQ.js';
|
package/dist/schema.js
CHANGED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
-- deployment-mode: downtime
|
|
2
|
+
-- One durable session-level tool policy. OpenGeni-native tools are selected by
|
|
3
|
+
-- default, and historical NULL/legacy shapes are eliminated before the new
|
|
4
|
+
-- API starts.
|
|
5
|
+
|
|
6
|
+
CREATE INDEX IF NOT EXISTS "session_history_items_turn_id_idx"
|
|
7
|
+
ON "session_history_items" ("turn_id")
|
|
8
|
+
WHERE "turn_id" IS NOT NULL;
|
|
9
|
+
|
|
10
|
+
ALTER TABLE "sessions"
|
|
11
|
+
ALTER COLUMN "first_party_mcp_tools"
|
|
12
|
+
SET DEFAULT '[
|
|
13
|
+
"set_session_title",
|
|
14
|
+
"goal_set",
|
|
15
|
+
"goal_update",
|
|
16
|
+
"goal_complete",
|
|
17
|
+
"goal_pause",
|
|
18
|
+
"memory_search",
|
|
19
|
+
"memory_save",
|
|
20
|
+
"memory_correct",
|
|
21
|
+
"sandboxes_list",
|
|
22
|
+
"sandbox_attach",
|
|
23
|
+
"sandbox_swap",
|
|
24
|
+
"run_on",
|
|
25
|
+
"sandbox_provision",
|
|
26
|
+
"rig_list",
|
|
27
|
+
"rig_get",
|
|
28
|
+
"rig_propose_change",
|
|
29
|
+
"rig_verify",
|
|
30
|
+
"rig_promote",
|
|
31
|
+
"sessions_list",
|
|
32
|
+
"session_get",
|
|
33
|
+
"session_events",
|
|
34
|
+
"session_create",
|
|
35
|
+
"session_send_message",
|
|
36
|
+
"session_pause",
|
|
37
|
+
"session_resume",
|
|
38
|
+
"session_steer",
|
|
39
|
+
"set_other_session_title",
|
|
40
|
+
"variable_set_list",
|
|
41
|
+
"environment_list",
|
|
42
|
+
"variable_set_set_variable",
|
|
43
|
+
"environment_set_variable",
|
|
44
|
+
"github_connect_link",
|
|
45
|
+
"github_token",
|
|
46
|
+
"github_repositories_list",
|
|
47
|
+
"social_connections_list",
|
|
48
|
+
"social_posts_recent",
|
|
49
|
+
"social_daily_analysis_context",
|
|
50
|
+
"scheduled_tasks_list",
|
|
51
|
+
"scheduled_tasks_get",
|
|
52
|
+
"scheduled_tasks_create",
|
|
53
|
+
"scheduled_tasks_update",
|
|
54
|
+
"scheduled_tasks_pause",
|
|
55
|
+
"scheduled_tasks_resume",
|
|
56
|
+
"scheduled_tasks_trigger",
|
|
57
|
+
"scheduled_tasks_delete",
|
|
58
|
+
"scheduled_task_runs_list",
|
|
59
|
+
"slack_bot_list_channels",
|
|
60
|
+
"slack_bot_channel_history",
|
|
61
|
+
"slack_bot_list_users",
|
|
62
|
+
"slack_bot_post_message"
|
|
63
|
+
]'::jsonb;
|
|
64
|
+
|
|
65
|
+
UPDATE "sessions"
|
|
66
|
+
SET "first_party_mcp_tools" = DEFAULT
|
|
67
|
+
WHERE "first_party_mcp_tools" IS NULL;
|
|
68
|
+
|
|
69
|
+
SET CONSTRAINTS ALL IMMEDIATE;
|
|
70
|
+
|
|
71
|
+
ALTER TABLE "sessions"
|
|
72
|
+
ALTER COLUMN "first_party_mcp_tools" SET NOT NULL;
|
|
73
|
+
|
|
74
|
+
UPDATE "sessions"
|
|
75
|
+
SET "tool_policy" = jsonb_build_object(
|
|
76
|
+
'mode', 'explicit',
|
|
77
|
+
'inheritedFromSessionId', "parent_session_id"
|
|
78
|
+
)
|
|
79
|
+
WHERE "tool_policy" IS NULL
|
|
80
|
+
OR "tool_policy" ->> 'mode' = 'legacy';
|
|
81
|
+
|
|
82
|
+
SET CONSTRAINTS ALL IMMEDIATE;
|
|
83
|
+
|
|
84
|
+
ALTER TABLE "sessions"
|
|
85
|
+
ALTER COLUMN "tool_policy" SET NOT NULL;
|
|
86
|
+
|
|
87
|
+
ALTER TABLE "sessions"
|
|
88
|
+
DROP CONSTRAINT IF EXISTS "sessions_tool_policy_shape_check";
|
|
89
|
+
|
|
90
|
+
ALTER TABLE "sessions"
|
|
91
|
+
ADD CONSTRAINT "sessions_tool_policy_shape_check"
|
|
92
|
+
CHECK (
|
|
93
|
+
jsonb_typeof("tool_policy") = 'object'
|
|
94
|
+
AND "tool_policy" ? 'mode'
|
|
95
|
+
AND ("tool_policy" ->> 'mode') IN ('workspace_default', 'explicit', 'inherited')
|
|
96
|
+
AND "tool_policy" ? 'inheritedFromSessionId'
|
|
97
|
+
AND (
|
|
98
|
+
("tool_policy" ->> 'inheritedFromSessionId') IS NULL
|
|
99
|
+
OR ("tool_policy" ->> 'inheritedFromSessionId') ~ '^[0-9a-fA-F-]{36}$'
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
-- Existing-session drafts no longer carry a one-turn tool policy. Keep only
|
|
104
|
+
-- the message, resources, model, and effort represented by the current API.
|
|
105
|
+
UPDATE "composer_drafts"
|
|
106
|
+
SET "tools" = '[]'::jsonb,
|
|
107
|
+
"tools_provided" = false
|
|
108
|
+
WHERE "tools" <> '[]'::jsonb
|
|
109
|
+
OR "tools_provided" = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/db",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3",
|
|
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": {
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@opengeni/codex": "^0.2.7",
|
|
54
|
-
"@opengeni/config": "^0.7.
|
|
55
|
-
"@opengeni/contracts": "^0.
|
|
54
|
+
"@opengeni/config": "^0.7.13",
|
|
55
|
+
"@opengeni/contracts": "^0.23.0",
|
|
56
56
|
"@opengeni/network": "^0.1.1",
|
|
57
57
|
"drizzle-orm": "^0.45.2",
|
|
58
58
|
"postgres": "^3.4.7"
|
package/src/index.ts
CHANGED
|
@@ -95,7 +95,10 @@ import type {
|
|
|
95
95
|
RigChangeStatus,
|
|
96
96
|
RigCheck,
|
|
97
97
|
} from "@opengeni/contracts";
|
|
98
|
-
import {
|
|
98
|
+
import {
|
|
99
|
+
DEFAULT_FIRST_PARTY_MCP_TOOLS,
|
|
100
|
+
SESSION_AUTHORIZATION_LIST_SCOPE_MAX_IDS,
|
|
101
|
+
} from "@opengeni/contracts";
|
|
99
102
|
import {
|
|
100
103
|
approvalIdentifier,
|
|
101
104
|
boundWorkspaceControlEvent,
|
|
@@ -13879,7 +13882,7 @@ export type SessionCreateInput = {
|
|
|
13879
13882
|
resources: ResourceRef[];
|
|
13880
13883
|
skills?: SessionSkill[];
|
|
13881
13884
|
tools?: ToolRef[];
|
|
13882
|
-
toolPolicy?: SessionToolPolicy
|
|
13885
|
+
toolPolicy?: SessionToolPolicy;
|
|
13883
13886
|
metadata: Record<string, unknown>;
|
|
13884
13887
|
createdBy?: TurnInitiator;
|
|
13885
13888
|
createdByContext?: TurnInitiatorContext;
|
|
@@ -13890,7 +13893,7 @@ export type SessionCreateInput = {
|
|
|
13890
13893
|
rigId?: string | null;
|
|
13891
13894
|
rigVersionId?: string | null;
|
|
13892
13895
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
13893
|
-
firstPartyMcpTools?: FirstPartyMcpToolName[]
|
|
13896
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[];
|
|
13894
13897
|
instructions?: string | null;
|
|
13895
13898
|
parentSessionId?: string | null;
|
|
13896
13899
|
createIdempotencyKey?: string | null;
|
|
@@ -14280,7 +14283,10 @@ async function createSessionInTransaction(
|
|
|
14280
14283
|
resources: input.resources,
|
|
14281
14284
|
skills: input.skills ?? [],
|
|
14282
14285
|
tools: input.tools ?? [],
|
|
14283
|
-
toolPolicy: input.toolPolicy ??
|
|
14286
|
+
toolPolicy: input.toolPolicy ?? {
|
|
14287
|
+
mode: "explicit",
|
|
14288
|
+
inheritedFromSessionId: input.parentSessionId ?? null,
|
|
14289
|
+
},
|
|
14284
14290
|
metadata: input.metadata,
|
|
14285
14291
|
...creatorColumns(frozenCreator),
|
|
14286
14292
|
model: input.model,
|
|
@@ -14291,7 +14297,7 @@ async function createSessionInTransaction(
|
|
|
14291
14297
|
rigId: input.rigId ?? null,
|
|
14292
14298
|
rigVersionId: input.rigVersionId ?? null,
|
|
14293
14299
|
firstPartyMcpPermissions: input.firstPartyMcpPermissions ?? null,
|
|
14294
|
-
firstPartyMcpTools: input.firstPartyMcpTools ??
|
|
14300
|
+
firstPartyMcpTools: input.firstPartyMcpTools ?? [...DEFAULT_FIRST_PARTY_MCP_TOOLS],
|
|
14295
14301
|
instructions: input.instructions ?? null,
|
|
14296
14302
|
parentSessionId: input.parentSessionId ?? null,
|
|
14297
14303
|
createIdempotencyKey,
|
|
@@ -25347,6 +25353,89 @@ export async function latestWorkspaceCapture(
|
|
|
25347
25353
|
});
|
|
25348
25354
|
}
|
|
25349
25355
|
|
|
25356
|
+
export type SessionWorkspaceCaptureLookup = {
|
|
25357
|
+
sessionExists: boolean;
|
|
25358
|
+
capture: WorkspaceCaptureRow | null;
|
|
25359
|
+
};
|
|
25360
|
+
|
|
25361
|
+
/**
|
|
25362
|
+
* Resolve session existence and its newest capture in one RLS-scoped query.
|
|
25363
|
+
*
|
|
25364
|
+
* The capture metadata endpoint only needs existence for its 404 contract. Using
|
|
25365
|
+
* `getSession` there mapped the complete session, MCP metadata, and control
|
|
25366
|
+
* projection before issuing a second transaction for the capture. A lateral
|
|
25367
|
+
* lookup preserves the exact absent-session / absent-capture distinction without
|
|
25368
|
+
* loading unrelated session state or adding another database round trip.
|
|
25369
|
+
*/
|
|
25370
|
+
export async function sessionLatestWorkspaceCapture(
|
|
25371
|
+
db: Database,
|
|
25372
|
+
workspaceId: string,
|
|
25373
|
+
sessionId: string,
|
|
25374
|
+
): Promise<SessionWorkspaceCaptureLookup> {
|
|
25375
|
+
return await withWorkspaceRls(db, workspaceId, async (scopedDb) => {
|
|
25376
|
+
const rows = await scopedDb.execute<{
|
|
25377
|
+
found_session_id: string;
|
|
25378
|
+
capture_id: string | null;
|
|
25379
|
+
capture_session_id: string | null;
|
|
25380
|
+
capture_turn_id: string | null;
|
|
25381
|
+
capture_revision: number | string | null;
|
|
25382
|
+
capture_lease_epoch: number | string | null;
|
|
25383
|
+
capture_state: string | null;
|
|
25384
|
+
capture_manifest_key: string | null;
|
|
25385
|
+
capture_tree_index_key: string | null;
|
|
25386
|
+
capture_blob_keys: unknown;
|
|
25387
|
+
capture_size_bytes: number | string | null;
|
|
25388
|
+
capture_stats: unknown;
|
|
25389
|
+
capture_captured_at: string | Date | null;
|
|
25390
|
+
}>(sql`
|
|
25391
|
+
select
|
|
25392
|
+
sessions.id as found_session_id,
|
|
25393
|
+
capture.id as capture_id,
|
|
25394
|
+
capture.session_id as capture_session_id,
|
|
25395
|
+
capture.turn_id as capture_turn_id,
|
|
25396
|
+
capture.revision as capture_revision,
|
|
25397
|
+
capture.lease_epoch as capture_lease_epoch,
|
|
25398
|
+
capture.state as capture_state,
|
|
25399
|
+
capture.manifest_key as capture_manifest_key,
|
|
25400
|
+
capture.tree_index_key as capture_tree_index_key,
|
|
25401
|
+
capture.blob_keys as capture_blob_keys,
|
|
25402
|
+
capture.size_bytes as capture_size_bytes,
|
|
25403
|
+
capture.stats as capture_stats,
|
|
25404
|
+
capture.captured_at as capture_captured_at
|
|
25405
|
+
from sessions
|
|
25406
|
+
left join lateral (
|
|
25407
|
+
select ${WORKSPACE_CAPTURE_COLUMNS}
|
|
25408
|
+
from workspace_captures
|
|
25409
|
+
where workspace_captures.session_id = sessions.id
|
|
25410
|
+
order by workspace_captures.revision desc
|
|
25411
|
+
limit 1
|
|
25412
|
+
) capture on true
|
|
25413
|
+
where sessions.workspace_id = ${workspaceId} and sessions.id = ${sessionId}
|
|
25414
|
+
limit 1
|
|
25415
|
+
`);
|
|
25416
|
+
const row = rows[0];
|
|
25417
|
+
if (!row) return { sessionExists: false, capture: null };
|
|
25418
|
+
if (!row.capture_id) return { sessionExists: true, capture: null };
|
|
25419
|
+
return {
|
|
25420
|
+
sessionExists: true,
|
|
25421
|
+
capture: mapWorkspaceCaptureRow({
|
|
25422
|
+
id: row.capture_id,
|
|
25423
|
+
session_id: row.capture_session_id!,
|
|
25424
|
+
turn_id: row.capture_turn_id,
|
|
25425
|
+
revision: row.capture_revision!,
|
|
25426
|
+
lease_epoch: row.capture_lease_epoch!,
|
|
25427
|
+
state: row.capture_state!,
|
|
25428
|
+
manifest_key: row.capture_manifest_key,
|
|
25429
|
+
tree_index_key: row.capture_tree_index_key,
|
|
25430
|
+
blob_keys: row.capture_blob_keys,
|
|
25431
|
+
size_bytes: row.capture_size_bytes,
|
|
25432
|
+
stats: row.capture_stats,
|
|
25433
|
+
captured_at: row.capture_captured_at!,
|
|
25434
|
+
}),
|
|
25435
|
+
};
|
|
25436
|
+
});
|
|
25437
|
+
}
|
|
25438
|
+
|
|
25350
25439
|
/** A specific capture revision for a session (the M2 file route with an explicit
|
|
25351
25440
|
* `?revision=`), or null if that revision was never captured / already GC'd. */
|
|
25352
25441
|
export async function workspaceCaptureAtRevision(
|
|
@@ -35129,6 +35218,7 @@ function sessionEventTypesAdvanceActivity(inputs: ReadonlyArray<{ type: string }
|
|
|
35129
35218
|
function sessionMutationAdvancesActivity(update: {
|
|
35130
35219
|
resources?: ResourceRef[];
|
|
35131
35220
|
tools?: ToolRef[];
|
|
35221
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[];
|
|
35132
35222
|
toolPolicy?: SessionToolPolicy;
|
|
35133
35223
|
toolPolicyVersion?: number;
|
|
35134
35224
|
expectedToolPolicyVersion?: number;
|
|
@@ -35728,6 +35818,7 @@ type LockedSessionUpdateResult = {
|
|
|
35728
35818
|
update?: {
|
|
35729
35819
|
resources?: ResourceRef[];
|
|
35730
35820
|
tools?: ToolRef[];
|
|
35821
|
+
firstPartyMcpTools?: FirstPartyMcpToolName[];
|
|
35731
35822
|
toolPolicy?: SessionToolPolicy;
|
|
35732
35823
|
toolPolicyVersion?: number;
|
|
35733
35824
|
expectedToolPolicyVersion?: number;
|
|
@@ -35872,6 +35963,9 @@ export async function appendSessionEventsWithLockedSessionUpdate(
|
|
|
35872
35963
|
lastSequence: sequence,
|
|
35873
35964
|
...(update.resources !== undefined ? { resources: update.resources } : {}),
|
|
35874
35965
|
...(update.tools !== undefined ? { tools: update.tools } : {}),
|
|
35966
|
+
...(update.firstPartyMcpTools !== undefined
|
|
35967
|
+
? { firstPartyMcpTools: update.firstPartyMcpTools }
|
|
35968
|
+
: {}),
|
|
35875
35969
|
...(update.toolPolicy !== undefined ? { toolPolicy: update.toolPolicy } : {}),
|
|
35876
35970
|
...(update.toolPolicyVersion !== undefined
|
|
35877
35971
|
? { toolPolicyVersion: update.toolPolicyVersion }
|
|
@@ -35961,11 +36055,8 @@ function mapSession(
|
|
|
35961
36055
|
resources: row.resources as ResourceRef[],
|
|
35962
36056
|
skills: (row.skills as SessionSkill[]) ?? [],
|
|
35963
36057
|
tools: row.tools as ToolRef[],
|
|
35964
|
-
toolPolicy:
|
|
35965
|
-
|
|
35966
|
-
inheritedFromSessionId: null,
|
|
35967
|
-
},
|
|
35968
|
-
toolPolicyVersion: Number(row.toolPolicyVersion ?? 1),
|
|
36058
|
+
toolPolicy: row.toolPolicy as SessionToolPolicy,
|
|
36059
|
+
toolPolicyVersion: Number(row.toolPolicyVersion),
|
|
35969
36060
|
metadata: row.metadata,
|
|
35970
36061
|
createdBy: initiatorFromStorage(
|
|
35971
36062
|
row.createdByKind,
|
|
@@ -35989,7 +36080,7 @@ function mapSession(
|
|
|
35989
36080
|
rigId: row.rigId ?? null,
|
|
35990
36081
|
rigVersionId: row.rigVersionId ?? null,
|
|
35991
36082
|
firstPartyMcpPermissions: (row.firstPartyMcpPermissions as Permission[] | null) ?? null,
|
|
35992
|
-
firstPartyMcpTools:
|
|
36083
|
+
firstPartyMcpTools: row.firstPartyMcpTools as FirstPartyMcpToolName[],
|
|
35993
36084
|
mcpServers,
|
|
35994
36085
|
parentSessionId: row.parentSessionId ?? null,
|
|
35995
36086
|
rootSessionId: row.rootSessionId,
|
package/src/schema.ts
CHANGED
|
@@ -842,13 +842,12 @@ export const sessions = pgTable(
|
|
|
842
842
|
// Non-default first-party MCP token permissions (manager-style sessions);
|
|
843
843
|
// null means the fixed worker default set in @opengeni/runtime.
|
|
844
844
|
firstPartyMcpPermissions: jsonb("first_party_mcp_permissions").$type<string[]>(),
|
|
845
|
-
// Exact model-visible first-party tool selection.
|
|
846
|
-
//
|
|
847
|
-
firstPartyMcpTools: jsonb("first_party_mcp_tools").$type<FirstPartyMcpToolName[]>(),
|
|
848
|
-
// Durable tool-policy origin.
|
|
849
|
-
//
|
|
850
|
-
|
|
851
|
-
toolPolicy: jsonb("tool_policy").$type<SessionToolPolicy>(),
|
|
845
|
+
// Exact model-visible first-party tool selection. All catalogued tools are
|
|
846
|
+
// selected by default; [] intentionally selects no broad-server tools.
|
|
847
|
+
firstPartyMcpTools: jsonb("first_party_mcp_tools").$type<FirstPartyMcpToolName[]>().notNull(),
|
|
848
|
+
// Durable tool-policy origin. Migration 0136 removes the old null/legacy
|
|
849
|
+
// representation so every session has one explicit policy mode.
|
|
850
|
+
toolPolicy: jsonb("tool_policy").$type<SessionToolPolicy>().notNull(),
|
|
852
851
|
// Optimistic-concurrency fence for durable session tool-policy writes.
|
|
853
852
|
toolPolicyVersion: integer("tool_policy_version").notNull().default(1),
|
|
854
853
|
// The manager session that spawned this one via session_create. Set only
|