Worker
apps/worker/ is the background worker process. It runs alongside the webapp and WebSocket sidecar when you start pnpm dev.
Source Files
| File | Purpose |
|---|---|
src/index.ts | Worker entry point |
src/inbox-watcher.ts | 30-second tick inbox scanner |
src/autopilot-scheduler.ts | Autopilot schedule runner |
src/run-queue.ts | Run queue processor |
src/log.ts | Structured logging |
src/runtimes/ | Runtime adapters |
src/obsidian-sync/ | Obsidian vault sync utilities |
Inbox Watcher
The inbox watcher (src/inbox-watcher.ts) polls ~/FundAdmin-AI-Vault/Inbox/ every 30 seconds. For each LPA file not yet reviewed, it:
- POSTs to
/api/review/triggeron the webapp (localhost:3000) - The webapp runs the Anthropic SDK pipeline (
apps/web/src/lib/review-pipeline.ts) - Review output is written to the Obsidian vault
- Queue entry status flips from
pendingtoreviewed
The queue is deduplicated by filename — the same file will not trigger multiple reviews.
Autopilot Scheduler
src/autopilot-scheduler.ts runs scheduled autopilot tasks configured in the webapp's /w/[slug]/autopilot page.
Run Queue
src/run-queue.ts processes queued agent runs, enabling the webapp to fire long-running tasks asynchronously.
Starting the Worker
The worker starts automatically with pnpm dev. To run it standalone:
bash
pnpm --filter @fundadmin/worker dev