#!/usr/bin/env tsx
/** 从 form-logic-map.ts + demo-input.ts 生成完整 Markdown 参考 */
import { writeFileSync } from "node:fs";
import { join } from "node:path";
import { PRIORITY1_CANONICAL_PATHS } from "@/workers/rpa/priority1/demo-input";
import { formatCompleteFormLogicReference } from "@/workers/rpa/priority1/form-logic-map";

const out = join(process.cwd(), "workers/rpa/priority1/FORM-LOGIC-REFERENCE.md");

const body = formatCompleteFormLogicReference(PRIORITY1_CANONICAL_PATHS);

writeFileSync(out, `${body}\n`, "utf8");
console.log(
  `[export] 已写入 ${out}（${PRIORITY1_CANONICAL_PATHS.length} 条 canonical 路径）`,
);
