export type TaskStatus = 'Pending' | 'Scheduled' | 'Running' | 'Completed' | 'Failed' | 'Skipped';
export type TaskType = 'DataFetch' | 'DataProcessing' | 'Analysis';

export interface TaskNode {
  id: string;
  type: TaskType;
  label?: string;
  dependencies: string[];
  initial_status: TaskStatus;
}

export interface WorkflowDag {
  nodes: TaskNode[];
}

export interface TaskState {
    status: TaskStatus;
    message?: string; // Last log message
    progress?: number; // 0-100
    logs: string[];   // Full log history
    content?: string; // Streaming content (Markdown)
    result?: any;     // Structured result
}

export interface WorkflowEvent {
    type: 'WorkflowStarted' | 'TaskStateChanged' | 'TaskStreamUpdate' | 'WorkflowCompleted' | 'WorkflowFailed' | 'WorkflowStateSnapshot';
    payload: any;
}
