export type { TaskStatus, TaskPriority, Note as Task } from "./note";

export interface TaskListResponse {
  tasks: import("./note").Note[];
  total: number;
}

// start_planning now creates a MILESTONE (the plan container), not a kind=plan
// task. The milestone's `body` holds the design; steps live as child tasks.
export interface StartPlanningResult {
  milestone: {
    id: number;
    project_id: number;
    title: string;
    description: string | null;
    body: string | null;
    status: string;
    order_index: number;
  };
  applicable_rules: {
    id: number;
    title: string;
    statement: string;
    topic_title: string;
    rulebook_title: string;
  }[];
  subscribed_rulebooks: { id: number; title: string }[];
  applicable_rules_truncated: boolean;
  project_goal: string;
  open_task_count: number;
}

export interface TaskLog {
  id: number;
  task_id: number;
  content: string;
  duration_minutes: number | null;
  created_at: string;
  updated_at: string;
}

export interface NoteDraft {
  id: number;
  note_id: number;
  proposed_body: string;
  original_body: string;
  instruction: string;
  scope: string;
  created_at: string;
  updated_at: string;
}

export interface NoteVersion {
  id: number;
  note_id: number;
  title: string;
  tags: string[];
  body?: string;
  pin_kind: "auto" | "manual" | null;
  pin_label: string | null;
  created_at: string;
}
