Skip to content

Worker

apps/worker/ is the background worker process. It runs alongside the webapp and WebSocket sidecar when you start pnpm dev.

Source Files

FilePurpose
src/index.tsWorker entry point
src/inbox-watcher.ts30-second tick inbox scanner
src/autopilot-scheduler.tsAutopilot schedule runner
src/run-queue.tsRun queue processor
src/log.tsStructured 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:

  1. POSTs to /api/review/trigger on the webapp (localhost:3000)
  2. The webapp runs the Anthropic SDK pipeline (apps/web/src/lib/review-pipeline.ts)
  3. Review output is written to the Obsidian vault
  4. Queue entry status flips from pending to reviewed

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

T1 (skills + CLI) and T2 (vault template) are MIT licensed.