/** * useAgentTrigger Hook * * Orchestrates the full agent edit workflow for human-triggered actions. * Manages permission checking, session lifecycle, and action state. */ import type { RegisteredAgent } from '@pantheon-systems/css-client'; /** * Describes an agent action to be triggered. */ export interface AgentAction { /** Agent ID to trigger */ agentId: string; /** Intent description */ intent: string; /** Target regions to edit */ targetRegions: string[]; /** Operation type (optional) */ operationType?: string; } /** * Result of triggering an agent action. */ export interface AgentTriggerResult { /** Whether the action was successful */ success: boolean; /** Checkpoint ID if successful */ checkpointId?: string; /** Error message if failed */ error?: string; } /** * Status of the agent trigger workflow. */ export type AgentTriggerStatus = 'idle' | 'checking' | 'starting' | 'editing' | 'completing' | 'error'; /** * Options for useAgentTrigger hook. */ export interface UseAgentTriggerOptions { /** List of available agents */ agents: RegisteredAgent[]; } /** * Return value of useAgentTrigger hook. */ export interface UseAgentTriggerReturn { /** Trigger a human-requested agent action */ triggerAgent: (action: AgentAction) => Promise; /** Currently running agent action */ activeAction: AgentAction | null; /** Progress/status of current action */ status: AgentTriggerStatus; /** Cancel the current agent action */ cancelAction: () => Promise; } /** * Hook for orchestrating agent edit workflows. * * Handles the full lifecycle of human-triggered agent actions: * 1. Check permission with canEdit * 2. Start session with startEdit * 3. Monitor for completion * 4. Complete or abort based on outcome * * @param options - Hook options including available agents * @returns Methods and state for triggering agent actions */ export declare function useAgentTrigger(_options: UseAgentTriggerOptions): UseAgentTriggerReturn;