/** * Types for agent schedule UI components */ import type { Snippet } from 'svelte'; export type ScheduleStatus = 'active' | 'paused' | 'disabled' | 'error'; export type RunStatus = 'success' | 'failed'; /** * Agent schedule data structure for display */ export interface AgentScheduleData { id: string; agentType: string; agentId: string | null; agentConfig: Record; cron: string; timezone: string; enabled: boolean; status: ScheduleStatus; lastRun: Date | string | null; nextRun: Date | string | null; lastStatus: RunStatus | null; lastError: string | null; runCount: number; successCount: number; failureCount: number; maxConcurrent: number; runningCount: number; timeout: number; method: string; methodArgs: Record; createdAt: Date | string; updatedAt: Date | string; } /** * Agent run history entry */ export interface AgentRunHistoryEntry { id: string; scheduleId: string; agentType: string; status: RunStatus; startedAt: Date | string; completedAt: Date | string | null; duration: number | null; error: string | null; } /** * Schedule form data for create/edit */ export interface ScheduleFormData { agentType: string; agentId?: string; agentConfig?: Record; cron: string; timezone?: string; enabled?: boolean; maxConcurrent?: number; timeout?: number; method?: string; methodArgs?: Record; } /** * AgentScheduleList component props */ export interface AgentScheduleListProps { /** Schedules to display */ schedules: AgentScheduleData[]; /** Loading state */ loading?: boolean; /** Callback when schedule is clicked */ onScheduleClick?: (schedule: AgentScheduleData) => void; /** Callback when enable is clicked */ onEnable?: (schedule: AgentScheduleData) => void; /** Callback when disable is clicked */ onDisable?: (schedule: AgentScheduleData) => void; /** Callback when delete is clicked */ onDelete?: (schedule: AgentScheduleData) => void; /** Callback when run now is clicked */ onRunNow?: (schedule: AgentScheduleData) => void; /** Empty state snippet */ empty?: Snippet; } /** * AgentScheduleForm component props */ export interface AgentScheduleFormProps { /** Initial form data (for editing) */ initialData?: Partial; /** Available agent types */ agentTypes?: string[]; /** Submit callback */ onSubmit?: (data: ScheduleFormData) => void; /** Cancel callback */ onCancel?: () => void; /** Loading state */ loading?: boolean; /** Edit mode */ editMode?: boolean; } /** * AgentRunHistory component props */ export interface AgentRunHistoryProps { /** Run history entries */ history: AgentRunHistoryEntry[]; /** Loading state */ loading?: boolean; /** Callback when entry is clicked */ onEntryClick?: (entry: AgentRunHistoryEntry) => void; /** Empty state snippet */ empty?: Snippet; } /** * AgentDashboard component props */ export interface AgentDashboardProps { /** All schedules */ schedules: AgentScheduleData[]; /** Recent run history */ recentHistory?: AgentRunHistoryEntry[]; /** Loading state */ loading?: boolean; /** Callbacks */ onScheduleClick?: (schedule: AgentScheduleData) => void; onEnable?: (schedule: AgentScheduleData) => void; onDisable?: (schedule: AgentScheduleData) => void; onDelete?: (schedule: AgentScheduleData) => void; onRunNow?: (schedule: AgentScheduleData) => void; onCreateSchedule?: () => void; } /** * Helper function to get status variant for Badge */ export declare function getScheduleStatusVariant(status: ScheduleStatus): 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info'; /** * Helper function to get run status variant */ export declare function getRunStatusVariant(status: RunStatus | null): 'default' | 'success' | 'error'; /** * Helper function to format cron expression for display */ export declare function formatCronExpression(cron: string): string; /** * Helper function to format relative time */ export declare function formatRelativeTime(date: Date | string | null): string; /** * Helper function to format duration */ export declare function formatDuration(ms: number | null): string; /** * Calculate success rate */ export declare function calculateSuccessRate(schedule: AgentScheduleData): number | null; //# sourceMappingURL=types.d.ts.map