The web, API, and background Workers share D1 and the Effect services in
packages/capabilities. HTTP contracts live in packages/api; request logging
lives in packages/logger.
The web Worker calls capabilities in-process. External clients use the API
Worker. Both enforce the shared permission rules in packages/authz.
Capabilities select D1-backed Live adapters when a DB binding exists and
in-memory Seed adapters otherwise. Local development uses persisted local D1;
Seed adapters let capability tests run without a Worker.
The background Worker consumes queues, handles Stripe webhooks, and runs scheduled reconciliation, email digests, and cleanup. Keeping this work outside page requests lets it retry independently. See Workers for the entry points.