export type AgentStatus = "NONE" | "QUEUED" | "RUNNING" | "DONE" | "ERROR" | "STALE" | "CANCELLED";

export interface RunRecord {
  sessionId: string;
  runId: string;
  status: AgentStatus;
  initiator: string;
  source: string;
  createdAt: string;
  updatedAt: string;
  metadata?: Record<string, unknown>;
}

export interface TaskRecord {
  taskId: string;
  runId: string;
  status: AgentStatus;
  payload: Record<string, unknown>;
  result?: Record<string, unknown>;
  error?: {
    code: string;
    message: string;
    details?: unknown;
  };
  source: string;
  createdAt: string;
  updatedAt: string;
}

export interface TraceEvent {
  timestamp: string;
  level: "info" | "warn" | "error";
  service: string;
  sessionId: string;
  runId: string;
  taskId: string | null;
  eventType: string;
  payload?: Record<string, unknown>;
}
