import type { CreateAutomationInput } from '../domain/validation.js'; import type { AutomationRepairDraftResponse, AutomationSimulation } from './automation-draft.types.js'; interface GeneratedAutomationDraft { automation: CreateAutomationInput; explanation: string; assumptions: string[]; risks: string[]; } export declare function parseGeneratedAutomationDraft(raw: string): GeneratedAutomationDraft; export declare function buildAutomationDraftResponse(draft: GeneratedAutomationDraft, repairAttempts: number): { draftId: `${string}-${string}-${string}-${string}-${string}`; automation: { name: string; conversationMode: "new_session" | "continuous"; notificationPolicy: "attention" | "none" | "all"; projectId?: string; action?: { kind: "agent"; instruction: string; agentId?: string; workingDirectory?: string; model?: string; timeoutSeconds?: number; } | { kind: "workflow"; workflowId: string; agentId?: string; input?: unknown; inputEnvelope?: { payload: unknown; goal?: string; variables?: Record; context?: Record; }; goal?: string; concurrency?: number; maxSubagents?: number; timeoutSeconds?: number; } | { kind: "browser_automation"; automationId: string; inputs?: Record; timeoutSeconds?: number; } | { kind: "task_command"; taskId: string; command?: { type: "move"; phase: "backlog" | "ready" | "active" | "review"; } | { type: "mark_ready"; } | { type: "start"; executor?: { kind: "agent"; agentId: string; } | { kind: "workflow"; workflowId: string; workflowVersion?: string; input?: unknown; } | { kind: "human"; actorId: string; } | { kind: "external"; provider: string; config: unknown; }; scheduleAt?: number; } | { type: "request_review"; } | { type: "close"; resolution: "cancelled" | "done" | "duplicate" | "wont_do"; } | { type: "reopen"; phase: "backlog" | "ready" | "active" | "review"; } | { type: "add_wait"; wait: { kind: "approval" | "dependency" | "user_input" | "external_event" | "scheduled_time" | "retry_backoff" | "paused"; reason: string; condition: Record; resumeAt?: number; }; } | { type: "resolve_wait"; waitId: string; resolution?: unknown; } | { type: "revise_contract"; contract: { objective: string; expectedOutputs: string[]; acceptanceCriteria: string[]; constraints: string[]; approvalRequired: string[]; assumptions: string[]; risks: string[]; acceptancePolicy: "verified_auto" | "verified_then_review" | "manual"; outputDestinations: Record[]; }; }; }; trigger?: { kind: "manual"; } | { kind: "schedule"; schedule?: { kind: "once"; at: string; } | { kind: "interval"; everyMs: number; anchorMs?: number; } | { kind: "cron"; expr: string; tz?: string; }; } | { kind: "webhook"; secretId?: string; } | { kind: "event"; eventType: string; source?: string; payloadMatch?: Record; }; description?: string; safety?: { mode: "suggest_only" | "ask_before_apply" | "auto_apply"; }; reliability?: { executionTimeoutSeconds?: number; timeoutSeconds?: number; retryCount?: number; maxConcurrentRuns?: number; disableAfterConsecutiveFailures?: number; }; completionWebhookUrl?: string; id?: string; enabled?: boolean; state?: { nextRunAtMs?: number; runningRunId?: string; lastRunAtMs?: number; lastRunStatus?: "failed" | "succeeded" | "cancelled" | "queued" | "running" | "cancelling" | "timeout"; lastError?: string; consecutiveFailures?: number; }; }; explanation: string; assumptions: string[]; risks: string[]; simulation: AutomationSimulation; repairAttempts: number; }; export declare function parseGeneratedAutomationRepairDraft(raw: string, repairAttempts: number): AutomationRepairDraftResponse; export declare function simulateAutomation(input: CreateAutomationInput): AutomationSimulation; export {};