@opengeni/db 0.21.0 → 0.22.2

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
@@ -1476,6 +1476,9 @@ export declare function loadConnectionCredentialForBroker(db: Database, settings
1476
1476
  subjectId?: string | null;
1477
1477
  allowSubjectOwned?: boolean;
1478
1478
  }): Promise<ConnectionCredentialForBroker | null>;
1479
+ export declare function workspaceVercelAiGatewayConnectionActive(db: Database, workspaceId: string): Promise<boolean>;
1480
+ /** Resolve only the reviewed workspace-shared AI Gateway credential shape. */
1481
+ export declare function loadWorkspaceVercelAiGatewayApiKey(db: Database, settings: Settings, workspaceId: string): Promise<string | null>;
1479
1482
  export declare function recordConnectionTokenRefresh(db: Database, input: {
1480
1483
  id: string;
1481
1484
  version: number;
@@ -2759,6 +2762,89 @@ export declare function updateSessionMcpApprovalPolicy(db: Database, input: {
2759
2762
  requireApproval: SessionMcpApprovalPolicy;
2760
2763
  }): Promise<UpdateSessionMcpApprovalPolicyResult>;
2761
2764
  export declare function listSessionMcpServersForRun(db: Database, workspaceId: string, sessionId: string, attemptId: string, encryptionKey: Uint8Array | null): Promise<SessionMcpServerForRun[]>;
2765
+ export type ConnectorActionPolicyDecision = schema.ConnectorActionPolicyDecision;
2766
+ export type ConnectorActionPolicySnapshotEntry = schema.ConnectorActionPolicySnapshotEntry;
2767
+ export type ConnectorActionAttemptIdentity = {
2768
+ accountId: string;
2769
+ workspaceId: string;
2770
+ sessionId: string;
2771
+ turnId: string;
2772
+ attemptId: string;
2773
+ executionGeneration: number;
2774
+ initiator: Pick<TurnInitiator, "kind" | "subjectId">;
2775
+ };
2776
+ export type ConnectorActionInvocation = {
2777
+ approvalId: string;
2778
+ connectionId?: string | null;
2779
+ serverId: string;
2780
+ toolName: string;
2781
+ arguments: unknown;
2782
+ };
2783
+ export type PrepareConnectorActionApprovalResult = {
2784
+ managed: false;
2785
+ decision: "unmanaged";
2786
+ } | {
2787
+ managed: true;
2788
+ decision: ConnectorActionPolicyDecision;
2789
+ requestId?: string;
2790
+ actionFingerprint: string;
2791
+ };
2792
+ export type BeginConnectorActionExecutionResult = {
2793
+ allowed: true;
2794
+ managed: false;
2795
+ } | {
2796
+ allowed: true;
2797
+ managed: true;
2798
+ requestId: string;
2799
+ actionFingerprint: string;
2800
+ } | {
2801
+ allowed: false;
2802
+ managed: true;
2803
+ reason: "approval_required" | "blocked" | "rejected" | "already_executed" | "uncertain_retry";
2804
+ requestId: string;
2805
+ actionFingerprint: string;
2806
+ };
2807
+ type ResolvedConnectorActionPolicy = {
2808
+ managed: false;
2809
+ } | {
2810
+ managed: true;
2811
+ source: "explicit";
2812
+ entry: ConnectorActionPolicySnapshotEntry;
2813
+ } | {
2814
+ managed: true;
2815
+ source: "ambiguous";
2816
+ entry: null;
2817
+ decision: "block";
2818
+ };
2819
+ /** Resolve one immutable attempt snapshot with exact-over-wildcard precedence. */
2820
+ export declare function resolveConnectorActionPolicy(snapshot: readonly ConnectorActionPolicySnapshotEntry[], input: {
2821
+ connectionId: string;
2822
+ serverId: string;
2823
+ toolName: string;
2824
+ actionName: string;
2825
+ }): ResolvedConnectorActionPolicy;
2826
+ export declare function upsertConnectorActionPolicy(db: Database, input: {
2827
+ accountId: string;
2828
+ workspaceId: string;
2829
+ subjectId: string;
2830
+ connectionId: string;
2831
+ serverId: string;
2832
+ toolName: string;
2833
+ actionName: string;
2834
+ policy: ConnectorActionPolicyDecision;
2835
+ }): Promise<{
2836
+ policy: typeof schema.connectorActionPolicies.$inferSelect;
2837
+ changed: boolean;
2838
+ }>;
2839
+ export declare function prepareConnectorActionApproval(db: Database, identity: ConnectorActionAttemptIdentity, invocation: ConnectorActionInvocation): Promise<PrepareConnectorActionApprovalResult>;
2840
+ export declare function beginConnectorActionExecution(db: Database, identity: ConnectorActionAttemptIdentity, invocation: ConnectorActionInvocation): Promise<BeginConnectorActionExecutionResult>;
2841
+ export declare function completeConnectorActionExecution(db: Database, input: {
2842
+ accountId: string;
2843
+ workspaceId: string;
2844
+ requestId: string;
2845
+ attemptId: string;
2846
+ outcome: "completed" | "uncertain";
2847
+ }): Promise<void>;
2762
2848
  /** Read the persisted deployment fallback; process configuration is not policy authority. */
2763
2849
  export declare function getNestedAgentDepthDeploymentPolicy(db: Database): Promise<NestedAgentDepthDeploymentPolicy>;
2764
2850
  type AgentSessionCreationActor = Extract<SessionCommandActor, {
@@ -6414,6 +6500,7 @@ export declare function acceptSessionApprovalDecision(db: Database, input: {
6414
6500
  accountId: string;
6415
6501
  workspaceId: string;
6416
6502
  sessionId: string;
6503
+ subjectId: string;
6417
6504
  payload: Record<string, unknown>;
6418
6505
  clientEventId?: string | null;
6419
6506
  }): Promise<AcceptSessionApprovalDecisionResult>;