export type AutomationTaskType =
  | "scan"
  | "generate"
  | "outreach"
  | "engagement"
  | "publish";

export type AutomationMode = "manual" | "auto";

export const AUTOMATION_TASK_TYPES: AutomationTaskType[] = [
  "scan",
  "generate",
  "outreach",
  "engagement",
  "publish",
];

export const AUTOMATION_TASK_META: Record<
  AutomationTaskType,
  { label: string; description: string; flow: "A" | "B" | "both" }
> = {
  scan: {
    label: "自動海巡",
    description: "依主題關鍵字定時搜尋 Threads 熱門/相關貼文與留言",
    flow: "both",
  },
  generate: {
    label: "自動生成草稿",
    description: "海巡後用 AI 分析爆文風格並生成你的貼文草稿（流程 A）",
    flow: "A",
  },
  publish: {
    label: "自動發文",
    description: "auto 模式會直接發布待審貼文草稿；manual 僅留待人工審核（流程 A）",
    flow: "A",
  },
  outreach: {
    label: "自動獲客留言",
    description: "找到產品相關客群貼文後生成留言；auto 模式直接留言推廣（流程 B）",
    flow: "B",
  },
  engagement: {
    label: "自動回覆留言",
    description: "同步自己貼文底下的新留言並生成回覆；auto 模式直接回覆（流程 B）",
    flow: "B",
  },
};

export const DEFAULT_DAILY_CAP: Record<AutomationTaskType, number> = {
  scan: 24,
  generate: 12,
  publish: 5,
  outreach: 20,
  engagement: 30,
};

/** 哪些任務在 auto 模式下會「真的對外發出動作」（需要更嚴格的配額與風險控管） */
export const OUTBOUND_TASKS: AutomationTaskType[] = ["publish", "outreach", "engagement"];
