입력 — 회장 → 서버Intake — Chairman → Server
회장 모바일/웹에서 지시 → Supabase Realtime → 서버 수신 + H2 직렬화 큐Chairman from mobile/web → Supabase Realtime → server pickup + H2 serialized queue
컴포넌트Components
핵심 메소드 / 함수Key methods / functions
subscribeToMessages()supabase.ts회장 메시지 Realtime 구독Realtime subscribe to chairman msgsprocessMessage()index.tsagent_id=chairman 만 파이프라인 트리거Only chairman triggers pipelineworkQueue / setImmediate drainindex.ts실행 중 신규 메시지 → 큐, 끝나면 자동 dequeueIn-flight → enqueue, auto-drain on doneinsertMessage() insertMessageWithFullContent()supabase.tsgeneratePairingCode()pairing.ts모바일↔서버 TOTP 발급Mobile↔server TOTPworkflow-watchdog (20분)workflow-watchdog.ts큐 hang 강제 리셋Force reset on queue hang
파일Files
server/src/index.ts server/src/orchestrator/supabase.ts server/src/orchestrator/pairing.ts server/src/orchestrator/workflow-watchdog.ts