@opengeni/db 0.19.0 → 0.22.1
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-XOXEQ7HG.js → chunk-BNGEN5QZ.js} +85 -1
- package/dist/chunk-BNGEN5QZ.js.map +1 -0
- package/dist/{chunk-SZP6KRLC.js → chunk-CYGFLLMN.js} +2698 -1918
- package/dist/chunk-CYGFLLMN.js.map +1 -0
- package/dist/index.d.ts +108 -1
- package/dist/index.js +5940 -2907
- package/dist/index.js.map +1 -1
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +4 -4
- package/dist/schema.d.ts +1147 -101
- package/dist/schema.js +37 -1
- package/dist/scoped-knowledge-schema.d.ts +5341 -0
- package/dist/scoped-knowledge.d.ts +208 -0
- package/dist/session-control.d.ts +1 -0
- package/dist/session-queue-commands.d.ts +2 -1
- package/drizzle/0153_mcp_personal_connection_delegations.sql +181 -0
- package/drizzle/0154_scoped_knowledge_foundation.sql +2292 -0
- package/drizzle/0155_connector_action_policies.sql +218 -0
- package/package.json +3 -3
- package/src/connection-token-resolver.ts +3 -0
- package/src/index.ts +1211 -7
- package/src/provision-roles.ts +48 -0
- package/src/runtime-posture.ts +36 -0
- package/src/schema.ts +228 -2
- package/src/scoped-knowledge-schema.ts +603 -0
- package/src/scoped-knowledge.ts +2891 -0
- package/src/session-control.ts +3 -0
- package/src/session-queue-commands.ts +48 -0
- package/dist/chunk-SZP6KRLC.js.map +0 -1
- package/dist/chunk-XOXEQ7HG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessContext, AccessGrant, AccessPrincipalKind, ApiKey, BillingBalance, CapabilityCatalogItem, CapabilityInstallation, CapabilityKind, CapabilityPack, CapabilitySource, ConnectionKind, ConnectionMetadata, ConnectionStatus, McpServerConnectionRef, FileAsset, FileUploadStatus, FirstPartyMcpToolName, HumanInputQuestion, HumanInputResponse, KnowledgeMemory, KnowledgeMemoryKind, KnowledgeMemoryStatus, KnowledgeSourceRef, GitHubInstallationAuthorityKind, GitHubRepositoryScope, HostEventExportBatch, HostUsageExportBatch, ManagedAccount, Permission, PackInstallation, PackInstallationStatus, ResourceRef, SandboxBackend, SandboxOs, ScheduledTask, ScheduledTaskAgentConfig, ScheduledTaskOverlapPolicy, ScheduledTaskRun, ScheduledTaskRunMode, ScheduledTaskRunStatus, ScheduledTaskScheduleSpec, ScheduledTaskStatus, ScheduledTaskTriggerType, Session, SessionAuthorizationListScope, SessionListResponse, SessionEvent, SessionEventPayloadMode, SessionEventReadDirection, SessionEventSemanticClass, SessionEventType, SessionGoal, SessionGoalCreatedBy, SessionGoalStatus, SessionHumanInputRequest, LineageNode, SessionMcpApprovalPolicy, SessionSkill, SessionMcpServerMetadata, SessionStatus, SessionToolPolicy, SessionTurn, SessionQueueSnapshot, SessionSystemUpdate, SessionSystemUpdateKind, SystemUpdateClassification, SessionTurnSource, SessionTurnStatus, TurnInitiator, TurnInitiatorContext, SocialConnection, SocialConnectionStatus, SocialPost, SocialProvider, ToolRef, ReasoningEffort, UsageEvent, Workspace, WorkspaceControlEvent, VariableSet, VariableSetVariableMetadata, WorkspaceMember, WorkspaceRegisteredPack, Rig, RigVersion, RigChange, RigChangeKind, RigChangeStatus, RigCheck, NativeSnapshotDescriptor, TarWorkspaceArchiveDescriptor, WorkspaceArchiveDescriptor, ModalCheckpointProviderBinding } from "@opengeni/contracts";
|
|
1
|
+
import type { AccessContext, AccessGrant, AccessPrincipalKind, ApiKey, BillingBalance, CapabilityCatalogItem, CapabilityInstallation, CapabilityKind, CapabilityPack, CapabilitySource, ConnectionKind, ConnectionMetadata, ConnectionStatus, McpServerConnectionRef, FileAsset, FileUploadStatus, FirstPartyMcpToolName, HumanInputQuestion, HumanInputResponse, KnowledgeMemory, KnowledgeMemoryKind, KnowledgeMemoryStatus, KnowledgeSourceRef, GitHubInstallationAuthorityKind, GitHubRepositoryScope, HostEventExportBatch, HostUsageExportBatch, ManagedAccount, McpPersonalConnectionDelegation, Permission, PackInstallation, PackInstallationStatus, ResourceRef, SandboxBackend, SandboxOs, ScheduledTask, ScheduledTaskAgentConfig, ScheduledTaskOverlapPolicy, ScheduledTaskRun, ScheduledTaskRunMode, ScheduledTaskRunStatus, ScheduledTaskScheduleSpec, ScheduledTaskStatus, ScheduledTaskTriggerType, Session, SessionAuthorizationListScope, SessionListResponse, SessionEvent, SessionEventPayloadMode, SessionEventReadDirection, SessionEventSemanticClass, SessionEventType, SessionGoal, SessionGoalCreatedBy, SessionGoalStatus, SessionHumanInputRequest, LineageNode, SessionMcpApprovalPolicy, SessionSkill, SessionMcpServerMetadata, SessionStatus, SessionToolPolicy, SessionTurn, SessionQueueSnapshot, SessionSystemUpdate, SessionSystemUpdateKind, SystemUpdateClassification, SessionTurnSource, SessionTurnStatus, TurnInitiator, TurnInitiatorContext, SocialConnection, SocialConnectionStatus, SocialPost, SocialProvider, ToolRef, ReasoningEffort, UsageEvent, Workspace, WorkspaceControlEvent, VariableSet, VariableSetVariableMetadata, WorkspaceMember, WorkspaceRegisteredPack, Rig, RigVersion, RigChange, RigChangeKind, RigChangeStatus, RigCheck, NativeSnapshotDescriptor, TarWorkspaceArchiveDescriptor, WorkspaceArchiveDescriptor, ModalCheckpointProviderBinding } from "@opengeni/contracts";
|
|
2
2
|
import { type LatencyMode, SessionSystemUpdatePayload, TurnExecutionPolicyV1 } from "@opengeni/contracts";
|
|
3
3
|
import { type Settings } from "@opengeni/config";
|
|
4
4
|
export { isCodexBilledModel } from "@opengeni/codex";
|
|
@@ -15,6 +15,7 @@ export * from "./new-session-drafts";
|
|
|
15
15
|
export * from "./workspace-instruction-policies";
|
|
16
16
|
export * from "./preference-registry";
|
|
17
17
|
export * from "./memory-governance";
|
|
18
|
+
export * from "./scoped-knowledge";
|
|
18
19
|
export { interruptedToolCallResult } from "./session-tool-call-settlement";
|
|
19
20
|
export { decryptEnvironmentValue, encryptEnvironmentValue } from "./environment-crypto";
|
|
20
21
|
export { decryptEnvironmentValue as decryptVariableSetValue, encryptEnvironmentValue as encryptVariableSetValue, } from "./environment-crypto";
|
|
@@ -603,6 +604,10 @@ export type CreateScheduledTaskInput = {
|
|
|
603
604
|
runMode: ScheduledTaskRunMode;
|
|
604
605
|
overlapPolicy: ScheduledTaskOverlapPolicy;
|
|
605
606
|
agentConfig: ScheduledTaskAgentConfig;
|
|
607
|
+
createdBy?: TurnInitiator;
|
|
608
|
+
createdByContext?: TurnInitiatorContext;
|
|
609
|
+
createdByActor?: AgentSessionCreationActor | null;
|
|
610
|
+
personalConnectionDelegations?: McpPersonalConnectionDelegation[];
|
|
606
611
|
variableSetId?: string | null;
|
|
607
612
|
rigId?: string | null;
|
|
608
613
|
metadata: Record<string, unknown>;
|
|
@@ -614,6 +619,7 @@ export type UpdateScheduledTaskInput = Partial<{
|
|
|
614
619
|
runMode: ScheduledTaskRunMode;
|
|
615
620
|
overlapPolicy: ScheduledTaskOverlapPolicy;
|
|
616
621
|
agentConfig: ScheduledTaskAgentConfig;
|
|
622
|
+
personalConnectionDelegations: McpPersonalConnectionDelegation[];
|
|
617
623
|
reusableSessionId: string | null;
|
|
618
624
|
variableSetId: string | null;
|
|
619
625
|
rigId: string | null;
|
|
@@ -1002,6 +1008,7 @@ export type EnqueueSessionTurnInput = {
|
|
|
1002
1008
|
lineage?: Record<string, unknown>;
|
|
1003
1009
|
initiator: TurnInitiator;
|
|
1004
1010
|
initiatorContext?: TurnInitiatorContext;
|
|
1011
|
+
personalConnectionDelegations?: McpPersonalConnectionDelegation[];
|
|
1005
1012
|
/** Steer inserts before all waiting prompts; Send appends after them. */
|
|
1006
1013
|
placement?: "head" | "tail";
|
|
1007
1014
|
};
|
|
@@ -1011,6 +1018,7 @@ export type EnqueueSessionTurnInput = {
|
|
|
1011
1018
|
*/
|
|
1012
1019
|
export type SessionTurnForExecution = SessionTurn & {
|
|
1013
1020
|
turnInstructions: string | null;
|
|
1021
|
+
personalConnectionDelegations: McpPersonalConnectionDelegation[];
|
|
1014
1022
|
};
|
|
1015
1023
|
export declare function createFileUpload(db: Database, input: {
|
|
1016
1024
|
accountId: string;
|
|
@@ -1608,6 +1616,7 @@ export declare function listSocialPosts(db: Database, options: {
|
|
|
1608
1616
|
export declare function createScheduledTask(db: Database, input: CreateScheduledTaskInput): Promise<ScheduledTask>;
|
|
1609
1617
|
export declare function updateScheduledTask(db: Database, workspaceId: string, taskId: string, input: UpdateScheduledTaskInput): Promise<ScheduledTask>;
|
|
1610
1618
|
export declare function getScheduledTask(db: Database, workspaceId: string, taskId: string): Promise<ScheduledTask | null>;
|
|
1619
|
+
export declare function getScheduledTaskPersonalConnectionDelegations(db: Database, workspaceId: string, taskId: string): Promise<McpPersonalConnectionDelegation[]>;
|
|
1611
1620
|
export declare function requireScheduledTask(db: Database, workspaceId: string, taskId: string): Promise<ScheduledTask>;
|
|
1612
1621
|
export declare function listScheduledTasks(db: Database, workspaceId: string, limit?: number): Promise<ScheduledTask[]>;
|
|
1613
1622
|
export declare function deleteScheduledTask(db: Database, workspaceId: string, taskId: string): Promise<void>;
|
|
@@ -2750,6 +2759,89 @@ export declare function updateSessionMcpApprovalPolicy(db: Database, input: {
|
|
|
2750
2759
|
requireApproval: SessionMcpApprovalPolicy;
|
|
2751
2760
|
}): Promise<UpdateSessionMcpApprovalPolicyResult>;
|
|
2752
2761
|
export declare function listSessionMcpServersForRun(db: Database, workspaceId: string, sessionId: string, attemptId: string, encryptionKey: Uint8Array | null): Promise<SessionMcpServerForRun[]>;
|
|
2762
|
+
export type ConnectorActionPolicyDecision = schema.ConnectorActionPolicyDecision;
|
|
2763
|
+
export type ConnectorActionPolicySnapshotEntry = schema.ConnectorActionPolicySnapshotEntry;
|
|
2764
|
+
export type ConnectorActionAttemptIdentity = {
|
|
2765
|
+
accountId: string;
|
|
2766
|
+
workspaceId: string;
|
|
2767
|
+
sessionId: string;
|
|
2768
|
+
turnId: string;
|
|
2769
|
+
attemptId: string;
|
|
2770
|
+
executionGeneration: number;
|
|
2771
|
+
initiator: Pick<TurnInitiator, "kind" | "subjectId">;
|
|
2772
|
+
};
|
|
2773
|
+
export type ConnectorActionInvocation = {
|
|
2774
|
+
approvalId: string;
|
|
2775
|
+
connectionId?: string | null;
|
|
2776
|
+
serverId: string;
|
|
2777
|
+
toolName: string;
|
|
2778
|
+
arguments: unknown;
|
|
2779
|
+
};
|
|
2780
|
+
export type PrepareConnectorActionApprovalResult = {
|
|
2781
|
+
managed: false;
|
|
2782
|
+
decision: "unmanaged";
|
|
2783
|
+
} | {
|
|
2784
|
+
managed: true;
|
|
2785
|
+
decision: ConnectorActionPolicyDecision;
|
|
2786
|
+
requestId?: string;
|
|
2787
|
+
actionFingerprint: string;
|
|
2788
|
+
};
|
|
2789
|
+
export type BeginConnectorActionExecutionResult = {
|
|
2790
|
+
allowed: true;
|
|
2791
|
+
managed: false;
|
|
2792
|
+
} | {
|
|
2793
|
+
allowed: true;
|
|
2794
|
+
managed: true;
|
|
2795
|
+
requestId: string;
|
|
2796
|
+
actionFingerprint: string;
|
|
2797
|
+
} | {
|
|
2798
|
+
allowed: false;
|
|
2799
|
+
managed: true;
|
|
2800
|
+
reason: "approval_required" | "blocked" | "rejected" | "already_executed" | "uncertain_retry";
|
|
2801
|
+
requestId: string;
|
|
2802
|
+
actionFingerprint: string;
|
|
2803
|
+
};
|
|
2804
|
+
type ResolvedConnectorActionPolicy = {
|
|
2805
|
+
managed: false;
|
|
2806
|
+
} | {
|
|
2807
|
+
managed: true;
|
|
2808
|
+
source: "explicit";
|
|
2809
|
+
entry: ConnectorActionPolicySnapshotEntry;
|
|
2810
|
+
} | {
|
|
2811
|
+
managed: true;
|
|
2812
|
+
source: "ambiguous";
|
|
2813
|
+
entry: null;
|
|
2814
|
+
decision: "block";
|
|
2815
|
+
};
|
|
2816
|
+
/** Resolve one immutable attempt snapshot with exact-over-wildcard precedence. */
|
|
2817
|
+
export declare function resolveConnectorActionPolicy(snapshot: readonly ConnectorActionPolicySnapshotEntry[], input: {
|
|
2818
|
+
connectionId: string;
|
|
2819
|
+
serverId: string;
|
|
2820
|
+
toolName: string;
|
|
2821
|
+
actionName: string;
|
|
2822
|
+
}): ResolvedConnectorActionPolicy;
|
|
2823
|
+
export declare function upsertConnectorActionPolicy(db: Database, input: {
|
|
2824
|
+
accountId: string;
|
|
2825
|
+
workspaceId: string;
|
|
2826
|
+
subjectId: string;
|
|
2827
|
+
connectionId: string;
|
|
2828
|
+
serverId: string;
|
|
2829
|
+
toolName: string;
|
|
2830
|
+
actionName: string;
|
|
2831
|
+
policy: ConnectorActionPolicyDecision;
|
|
2832
|
+
}): Promise<{
|
|
2833
|
+
policy: typeof schema.connectorActionPolicies.$inferSelect;
|
|
2834
|
+
changed: boolean;
|
|
2835
|
+
}>;
|
|
2836
|
+
export declare function prepareConnectorActionApproval(db: Database, identity: ConnectorActionAttemptIdentity, invocation: ConnectorActionInvocation): Promise<PrepareConnectorActionApprovalResult>;
|
|
2837
|
+
export declare function beginConnectorActionExecution(db: Database, identity: ConnectorActionAttemptIdentity, invocation: ConnectorActionInvocation): Promise<BeginConnectorActionExecutionResult>;
|
|
2838
|
+
export declare function completeConnectorActionExecution(db: Database, input: {
|
|
2839
|
+
accountId: string;
|
|
2840
|
+
workspaceId: string;
|
|
2841
|
+
requestId: string;
|
|
2842
|
+
attemptId: string;
|
|
2843
|
+
outcome: "completed" | "uncertain";
|
|
2844
|
+
}): Promise<void>;
|
|
2753
2845
|
/** Read the persisted deployment fallback; process configuration is not policy authority. */
|
|
2754
2846
|
export declare function getNestedAgentDepthDeploymentPolicy(db: Database): Promise<NestedAgentDepthDeploymentPolicy>;
|
|
2755
2847
|
type AgentSessionCreationActor = Extract<SessionCommandActor, {
|
|
@@ -2787,6 +2879,7 @@ export type SessionCreateInput = {
|
|
|
2787
2879
|
sandboxGroupId?: string | null;
|
|
2788
2880
|
sandboxOs?: SandboxOs;
|
|
2789
2881
|
mcpServers?: CreateSessionMcpServerInput[];
|
|
2882
|
+
personalConnectionDelegations?: McpPersonalConnectionDelegation[];
|
|
2790
2883
|
maxNestedAgentDepthOverride?: number | null;
|
|
2791
2884
|
allowNestedAgentDepthIncrease?: boolean;
|
|
2792
2885
|
subjectId?: string | null;
|
|
@@ -2815,6 +2908,8 @@ export declare function createSessionWithIdempotencyKey(db: Database, input: Ses
|
|
|
2815
2908
|
}): Promise<SessionCreateSuccessResult>;
|
|
2816
2909
|
export declare function getSessionByCreateIdempotencyKey(db: Database, workspaceId: string, createIdempotencyKey: string): Promise<Session | null>;
|
|
2817
2910
|
export declare function getSession(db: Database, workspaceId: string, sessionId: string): Promise<Session | null>;
|
|
2911
|
+
export declare function getSessionTurnPersonalConnectionDelegations(db: Database, workspaceId: string, sessionId: string, turnId: string): Promise<McpPersonalConnectionDelegation[]>;
|
|
2912
|
+
export declare function getSessionParentPersonalConnectionDelegations(db: Database, workspaceId: string, childSessionId: string): Promise<McpPersonalConnectionDelegation[]>;
|
|
2818
2913
|
export declare function getSessionSpawnDenial(db: Database, workspaceId: string, denialId: string): Promise<SessionSpawnDenial | null>;
|
|
2819
2914
|
export declare function getSessionSpawnDenialByIdempotencyKey(db: Database, workspaceId: string, createIdempotencyKey: string): Promise<SessionSpawnDenial | null>;
|
|
2820
2915
|
export declare function listSessionSpawnDenials(db: Database, workspaceId: string, options?: {
|
|
@@ -2943,6 +3038,15 @@ export declare function setSessionPin(db: Database, input: {
|
|
|
2943
3038
|
}): Promise<Session | null>;
|
|
2944
3039
|
export declare function listSessions(db: Database, workspaceId: string, limit?: number): Promise<Session[]>;
|
|
2945
3040
|
export declare function listSessions(db: Database, workspaceId: string, options?: ListSessionsOptions): Promise<Session[]>;
|
|
3041
|
+
/**
|
|
3042
|
+
* Return the model most recently chosen by one human subject in their own
|
|
3043
|
+
* workspace sessions. A later subject-initiated turn supersedes the session's
|
|
3044
|
+
* creation-time default; sessions with no such turn fall back to sessions.model.
|
|
3045
|
+
* Turn timestamp ties use queue position then UUID, and session ties use the
|
|
3046
|
+
* immutable session timestamp/UUID. Other subjects' turns never influence the
|
|
3047
|
+
* result. The workspace filter remains authoritative under FORCE RLS.
|
|
3048
|
+
*/
|
|
3049
|
+
export declare function getLatestSessionModelForSubject(db: Database, workspaceId: string, subjectId: string): Promise<string | null>;
|
|
2946
3050
|
export type SessionDiscoveryOrderBy = "createdAt" | "updatedAt";
|
|
2947
3051
|
export type SessionDiscoveryCursor = {
|
|
2948
3052
|
orderBy: SessionDiscoveryOrderBy;
|
|
@@ -6247,6 +6351,7 @@ export type SessionSystemUpdateOutboxDelivery = {
|
|
|
6247
6351
|
summary: string;
|
|
6248
6352
|
payload: ChildTerminalResultPayload;
|
|
6249
6353
|
lineage: Record<string, unknown>;
|
|
6354
|
+
personalConnectionDelegations: McpPersonalConnectionDelegation[];
|
|
6250
6355
|
};
|
|
6251
6356
|
/**
|
|
6252
6357
|
* Read the exact durable parent-update row created by terminal turn settlement.
|
|
@@ -6349,6 +6454,7 @@ export type AddSessionSystemUpdateInput = {
|
|
|
6349
6454
|
dedupeKey: string;
|
|
6350
6455
|
summary: string;
|
|
6351
6456
|
lineage?: Record<string, unknown>;
|
|
6457
|
+
personalConnectionDelegations?: McpPersonalConnectionDelegation[];
|
|
6352
6458
|
} & SessionSystemUpdateInputVariant;
|
|
6353
6459
|
export type AddSessionSystemUpdateResult = {
|
|
6354
6460
|
added: false;
|
|
@@ -6391,6 +6497,7 @@ export declare function acceptSessionApprovalDecision(db: Database, input: {
|
|
|
6391
6497
|
accountId: string;
|
|
6392
6498
|
workspaceId: string;
|
|
6393
6499
|
sessionId: string;
|
|
6500
|
+
subjectId: string;
|
|
6394
6501
|
payload: Record<string, unknown>;
|
|
6395
6502
|
clientEventId?: string | null;
|
|
6396
6503
|
}): Promise<AcceptSessionApprovalDecisionResult>;
|