import { AgentScopeConfig } from "../../db/manage/scope-definitions.js";
import { PaginationConfig } from "../../types/utility.js";
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
import { TriggerInvocationInsert, TriggerInvocationSelect, TriggerInvocationUpdate } from "../../types/entities.js";

//#region src/data-access/runtime/triggerInvocations.d.ts
/**
 * Get a trigger invocation by ID (agent-scoped)
 */
declare const getTriggerInvocationById: (db: AgentsRunDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  triggerId: string;
  invocationId: string;
}) => Promise<TriggerInvocationSelect | undefined>;
/**
 * List trigger invocations with optional filtering (agent-scoped)
 */
declare const listTriggerInvocationsPaginated: (db: AgentsRunDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  triggerId: string;
  pagination?: PaginationConfig;
  filters?: {
    status?: "pending" | "success" | "failed";
    from?: string;
    to?: string;
  };
}) => Promise<{
  data: {
    triggerId: string;
    conversationId: string | null;
    runAsUserId: string | null;
    batchId: string | null;
    ref: {
      type: "commit" | "tag" | "branch";
      name: string;
      hash: string;
    } | null;
    status: string;
    requestPayload: unknown;
    transformedPayload: unknown;
    errorMessage: string | null;
    createdAt: string;
    agentId: string;
    projectId: string;
    tenantId: string;
    id: string;
  }[];
  pagination: {
    page: number;
    limit: number;
    total: number;
    pages: number;
  };
}>;
/**
 * Create a new trigger invocation (agent-scoped)
 */
declare const createTriggerInvocation: (db: AgentsRunDatabaseClient) => (params: TriggerInvocationInsert) => Promise<TriggerInvocationSelect>;
/**
 * Update trigger invocation status (agent-scoped)
 */
declare const updateTriggerInvocationStatus: (db: AgentsRunDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  triggerId: string;
  invocationId: string;
  data: TriggerInvocationUpdate;
}) => Promise<TriggerInvocationSelect>;
//#endregion
export { createTriggerInvocation, getTriggerInvocationById, listTriggerInvocationsPaginated, updateTriggerInvocationStatus };