#!/usr/bin/env tsx
/**
 * Priority1 可视全链回放 — CLI 入口（实现见 workers/rpa/priority1/visual-chain.ts）
 *
 * 用法:
 *   npm run visual:priority1-full-chain
 */
export {
  runPriority1HumanAssistChain,
  runPriority1FtlPathRecording,
  runPriority1P08AccessorialRecording,
  runPriority1VisualChain,
  type RunPriority1VisualChainOptions,
  type Priority1VisualChainResult,
} from "@/workers/rpa/priority1/visual-chain";

import { runPriority1VisualChain } from "@/workers/rpa/priority1/visual-chain";

async function main(): Promise<void> {
  const result = await runPriority1VisualChain();
  process.exit(result.ok && result.allObservedOk ? 0 : 1);
}

const isDirectCli =
  process.argv[1]?.replace(/\\/g, "/").includes("visual-priority1-full-chain") ??
  false;

if (isDirectCli) {
  main().catch((e) => {
    console.error(e);
    process.exit(1);
  });
}
