import { ScheduledTrigger } from "@inkeep/agents-core";

//#region src/domains/run/services/ScheduledTriggerService.d.ts

/**
 * Start a workflow runner for a scheduled trigger.
 * Returns the runner ID.
 */
declare function startScheduledTriggerWorkflow(params: {
  tenantId: string;
  projectId: string;
  agentId: string;
  scheduledTriggerId: string;
  triggerName: string;
}): Promise<string>;
/**
 * Signal a workflow runner to stop by clearing its runner ID.
 */
declare function signalStopScheduledTriggerWorkflow(params: {
  tenantId: string;
  projectId: string;
  agentId: string;
  scheduledTriggerId: string;
}): Promise<void>;
/**
 * Restart a workflow runner (signal old to stop and start new).
 * Used when trigger configuration changes.
 */
declare function restartScheduledTriggerWorkflow(params: {
  tenantId: string;
  projectId: string;
  agentId: string;
  scheduledTriggerId: string;
  triggerName: string;
}): Promise<string>;
/**
 * Handle trigger creation - start workflow if enabled.
 */
declare function onTriggerCreated(trigger: ScheduledTrigger): Promise<void>;
/**
 * Handle trigger update - restart workflow if needed.
 */
declare function onTriggerUpdated(params: {
  trigger: ScheduledTrigger;
  previousEnabled: boolean;
  scheduleChanged: boolean;
}): Promise<void>;
/**
 * Handle trigger deletion - signal workflow to stop.
 * The workflow will be automatically deleted via cascade when the trigger is deleted.
 */
declare function onTriggerDeleted(trigger: ScheduledTrigger): Promise<void>;
//#endregion
export { onTriggerCreated, onTriggerDeleted, onTriggerUpdated, restartScheduledTriggerWorkflow, signalStopScheduledTriggerWorkflow, startScheduledTriggerWorkflow };