@opengeni/db 0.21.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/index.d.ts CHANGED
@@ -2759,6 +2759,89 @@ export declare function updateSessionMcpApprovalPolicy(db: Database, input: {
2759
2759
  requireApproval: SessionMcpApprovalPolicy;
2760
2760
  }): Promise<UpdateSessionMcpApprovalPolicyResult>;
2761
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>;
2762
2845
  /** Read the persisted deployment fallback; process configuration is not policy authority. */
2763
2846
  export declare function getNestedAgentDepthDeploymentPolicy(db: Database): Promise<NestedAgentDepthDeploymentPolicy>;
2764
2847
  type AgentSessionCreationActor = Extract<SessionCommandActor, {
@@ -6414,6 +6497,7 @@ export declare function acceptSessionApprovalDecision(db: Database, input: {
6414
6497
  accountId: string;
6415
6498
  workspaceId: string;
6416
6499
  sessionId: string;
6500
+ subjectId: string;
6417
6501
  payload: Record<string, unknown>;
6418
6502
  clientEventId?: string | null;
6419
6503
  }): Promise<AcceptSessionApprovalDecisionResult>;