# Lilith — Systems Deep Dive

> The `apps/lilith/` area: ~75 Nx projects that make up **Lilith**, the
> consciousness / AI-wisdom product — its clients (web, mobile, desktop, CLI),
> its BFF edge, ~70 backend microservices, and the on-chain Solidity contract
> suite — wired together around meditation, content, voice, and a Web3 token
> economy.

## What this area is

Lilith is a full vertical product, not a library: a meditation- and
wisdom-focused "consciousness experience platform" delivered through several
clients and backed by a fleet of independently-deployable services. Unlike the
`libs/` areas (which ship reusable packages), everything under `apps/lilith/` is
a runnable artifact — a Next.js PWA, a React Native app, an Electron/Vite
desktop capture tool, a CLI, a Backend-for-Frontend gateway, a Hardhat/Foundry
contract project, and roughly seventy Fastify/Node microservices each owning one
domain slice.

The shape is a classic edge-plus-microservices topology. Clients (`@lilith/web`,
`@lilith/mobile`, `@lilith/desktop`, `@lilith/cli`) never call domain services
directly; they go through `@lilith/bff`, the Backend-for-Frontend that fronts
all client traffic and orchestrates fan-out to the domain services. The domain
services themselves cluster into recognizable sub-systems: identity & consent,
AI & conversation, voice & realtime audio, the meditation/practice core, content
& learning, the Web3 token/payments stack, and the platform/observability
plumbing. Most services follow an identical internal layout — an `app.ts`
Fastify app, a `server.ts` entrypoint, `types.ts`, and (where they persist) Knex
`db/migrations/` against Postgres or a Mongo/Redis store — so once you have read
one the rest navigate the same way.

Sizes vary enormously and honestly: a handful of services are very large bodies
of real domain logic (`@lilith/ai` ~570K LOC, `@lilith/web` ~231K,
`@lilith/metaverse` ~183K, `@lilith/mobile` ~160K, `@lilith/daily-content` ~84K,
`@lilith/content` ~64K, `@lilith/tts` ~35K, `@lilith/bff` ~35K), while many of
the token/payments and platform services are compact single-pipeline services in
the 1–5K-LOC range. None of the 75 projects is an empty scaffold — every one has
real source under `src/` — but the depth ranges from sprawling subsystems down
to focused two-file services, and the blurbs below say which is which.

A few projects are explicitly **shared primitive libraries** rather than running
services — `@lilith/token-core`, `@lilith/transaction-core`, and
`@lilith/meditation-core` exist so the many tokenized / transactional /
meditation services can stay thin and share types and guards.
`@lilith/contracts` is the odd one out: a Solidity contract project (Hardhat
config + Foundry `forge-std`), not a TypeScript service.

## How it fits the wider system

The dependency arrows point inward to the BFF. Clients depend on `@lilith/bff`;
the BFF depends on the domain services' HTTP surfaces; domain services depend on
the shared `core` libraries and on platform services (notification, analytics,
observability) and, for the Web3 cluster, on `@lilith/contracts` (the on-chain
ABI) plus the indexer/IPFS/bridge plumbing. Cross-domain wire types come from
the `@lilith/contracts`-adjacent contract packages in `libs/contracts/`
(documented in the Contracts systems page), keeping payload shapes validated at
the edge. Within this area, the boundary that matters most is the BFF: it is the
single front door, so the catalog below is best read as "the edge, then the
domains the edge talks to."

## Entity reference

### @lilith/bff

The Backend-for-Frontend gateway (`apps/lilith/bff/src`) that fronts all client
traffic and orchestrates fan-out to domain services. Substantial (~135 files): a
`routes/` + `api/` surface, a large `utils/` layer, plus response-shaping,
`synthesis-engine.ts`, streaming/compression transforms, and
`performance-optimizations.ts` — the edge aggregation/streaming tier for web,
mobile, and desktop.

### @lilith/cli

The platform CLI (`apps/lilith/cli/src`) — Commander-style subcommands
(`admin.ts`, `agent.ts`, `auth.ts`, `chat.ts`, `config.ts`, `health.ts`) over a
shared `client.ts`/`output.ts`/`progress.ts` runtime. A real operator/dev client
for talking to the BFF and services, not a stub.

### @lilith/contracts

The on-chain Solidity contract suite (`apps/lilith/contracts/contracts`), built
with Hardhat (`hardhat.config.ts`) and Foundry (`lib/forge-std`). Real
contracts: `AccessToken`, `ContentLicenseNFT`, `CreatorRoyalties`,
`IdentityReputation`, `RoyaltyLicenseManager`, `ContentProvenance`, a
`security/FlashLoanGuard`, and UUPS-`upgradeable/` variants, plus mocks for
tests. This is the Web3 root the blockchain/token services integrate against.

### @lilith/desktop

A Vite/React desktop capture client (`apps/lilith/desktop/src`) — `App.tsx` with
`CapturePanel`, `LibraryView`, `SettingsPanel`, `SyncStatus` views and
`useCaptures`/`useHotkeys` hooks. A focused capture-and-library companion app
(~2K LOC), not the full reader.

### @lilith/mobile

The React Native client (`apps/lilith/mobile/src`) and the largest client by
file count (~745 source files, ~160K LOC): a deep `services/` layer (~857
files), `screens/`, `components/`, `hooks/`, offline `storage/`, theming, and a
`mobile-cold-start-optimizer.ts`. The AI-wisdom app surface — chat, meditation,
learning — for iOS/Android.

### @lilith/web

The Next.js PWA (`apps/lilith/web/src`) — the flagship web client (~609 files,
~231K LOC). App-router `app/[locale]/` routes, a `design-system/`, an
`accessibility/` layer, `pwa/` plumbing, and `features/` for `reader`,
`zettelkasten`, `annotations`, `publishing`, `collaboration`, `community`,
`references`, `workspace`, and `veilborn`. A knowledge/reader-centric
consciousness platform, not a thin shell.

### @lilith/ai

The AI orchestration service (`apps/lilith/svc-ai/src`) and by far the largest
project here (~573 files, ~570K LOC). Real multi-agent machinery
(`agent-coordination.ts`, `agent-executor.ts`, `multi-agent-system.ts`,
`llm-orchestration.ts`, `model-routing-fallback-manager.ts`), a `providers/`
layer (OpenRouter, ElevenLabs, RunPod serverless, ComfyUI, Civitai),
`personality-engine`/`personalization-engine`, an `evals` harness, and large
content/asset-generation and instructional sub-systems (`world-generation`,
`asset-generation`, and many `*-instruction` fitness/training domains). Far
broader than the README's "multi-agent / RAG" one-liner.

### @lilith/analytics

Analytics service (`apps/lilith/svc-analytics/src`) for event tracking, metrics,
funnels, and sessions — `events.ts`, `funnels.ts`, `metrics.ts`, `sessions.ts`
over a Postgres schema (Knex `db/migrations/`). Compact but real.

### @lilith/anonymization

Privacy-preserving / anonymization service (`apps/lilith/svc-anonymization/src`,
~3K LOC) for de-identifying user data on the Lilith platform. A real service (13
files) following the standard `app`/`server`/`types` layout.

### @lilith/audio-handoff

Cross-device audio-handoff service (`apps/lilith/svc-audio-handoff/src`) for
seamless meditation continuity across devices. Small (`app.ts`, `server.ts`,
`types.ts`; ~1.1K LOC) but a real Fastify service.

### @lilith/auth-orchestrator

Cross-platform authentication-orchestration service
(`apps/lilith/svc-auth-orchestrator/src`) coordinating seamless auth flows
across clients. Compact (3 files, ~1.3K LOC) `app`/`server`/`types` service; the
heavy identity logic lives in `@lilith/auth`.

### @lilith/auth

The core authentication & JWT-issuance service (`apps/lilith/svc-auth/src`) and
a substantial one (~117 files, ~28K LOC): WebAuthn, TOTP, SMS-OTP (Twilio),
session management, RSA key handling, WAF rules/middleware, user-profile routes,
and `repositories/` over a Postgres schema. The platform's identity backbone.

### @lilith/avatar-cosmetic

Avatar & cosmetic-NFT service (`apps/lilith/svc-avatar-cosmetic/src`) that
builds layered avatars and mints them as NFTs — integrating asset libraries,
generative color harmonization, and storage providers (per its README). ~3K LOC.

### @lilith/biometric

EEG / biometric service (`apps/lilith/svc-biometric/src`, ~33K LOC)
orchestrating brainwave monitoring for meditation: device calibration, real-time
EEG analysis, neurofeedback, and session summaries, plus a broad sensor suite
under `implementations/` and a `fitness/` subsystem (HRV,
temperature/scent/light-sound modulation, haptics, posture, lucid-dream,
magnetic-field, quantum-RNG). One of the more substantial domain services.

### @lilith/blockchain

Web3 integration service (`apps/lilith/svc-blockchain/src`, ~14.5K LOC) for
NFTs, crypto payments, and the token economy: `wallet-service`, `nft-service`,
`token-service`, `ipfs-service`, `sacred-assets`/`sacred-asset-registrar`, a
`royalty-license-manager-contract-client`, pluggable `backends/`/`providers/`,
and an `in-memory-transaction-runtime` for tests. Bridges services to
`@lilith/contracts`.

### @lilith/breathwork

Breathwork service (`apps/lilith/svc-breathwork/src`) exposing
`pattern.service`, `session.service`, and `guidance.service` for guided
breathing patterns. Small, focused, real (6 files, ~3.4K LOC).

### @lilith/catalog

Metadata catalog & data-lineage service (`apps/lilith/svc-catalog/src`) — a
compact (4 files, ~1.5K LOC) `app`/`server`/`types`/`utils` service cataloguing
platform data assets and lineage.

### @lilith/community-translation

Community-translation service (`apps/lilith/svc-community-translation/src`) with
review workflows and an open-research program; includes a `journaled-storage.ts`
append-log store. Compact (4 files, ~3.5K LOC) but real.

### @lilith/consent-management

Consent-management service (`apps/lilith/svc-consent-management/src`) for
research, analytics, and voice-cloning consent with granular UX flows; ships an
`i18n.ts` and `locales/` (de/en/es/fr/pt) for localized consent copy. ~1.8K LOC.

### @lilith/content-licensing

NFT-backed content-licensing & attribution service
(`apps/lilith/svc-content-licensing/src`) — `licensing.ts` + `service.ts` +
`api.ts` orchestrating policy composition, compliance validation, metadata
assembly, storage, NFT minting, and royalty/attribution telemetry (per README).
~2.8K LOC.

### @lilith/content-verification

Content-provenance / verification service
(`apps/lilith/svc-content-verification/src`) providing decentralized provenance,
notarization, and dispute tracking: `ContentProvenanceService.ts` +
`verification.ts` orchestrating hashing, signature collection, multi-chain
anchoring, and IPFS manifest storage. ~3.5K LOC.

### @lilith/content

Content & course service with cultural localization
(`apps/lilith/svc-content/src`, ~64K LOC) — a large domain: `courses/`,
`lessons/`, `encyclopedia/`, `knowledge-domains/`, `recommendations/`,
`search/`, `personas/`, `delivery/`, a `cultural-context-manager`, lecture
pre-gen engines, plus speculative content modules (`collective-unconscious`,
`noosphere-connection`, `ego-death-simulations`, `simulation-theory-testing`,
`oracle-systems`). The learning/knowledge backbone.

### @lilith/conversation

Conversation service (`apps/lilith/svc-conversation/src`, ~8.5K LOC) modelling
threads, messages, citations, feedback, summaries, participants, and sharing
(with `conversation-permissions`), over a Postgres schema (Knex migrations for
each table). The persisted chat-history domain behind the AI clients.

### @lilith/creator-royalty

Creator-royalty service (`apps/lilith/svc-creator-royalty/src`) automating
revenue sharing: royalty schedules, sale-based distributions, scheduled payouts,
and compliance logging (per README). Compact (`app.ts` + `service.ts`, ~1.5K
LOC).

### @lilith/cross-chain-bridge

Cross-chain bridge service (`apps/lilith/svc-cross-chain-bridge/src`, ~4K LOC) —
a deterministic orchestration layer for multi-chain bridging across EVM networks
and Solana:
`route`/`relayer`/`validator-set`/`event-watcher`/`attestation-requester`
modules, a Postgres `repository`, and a `migrations/` schema. Real,
deterministic bridging logic.

### @lilith/curricula

Structured-curricula service (`apps/lilith/svc-curricula/src`) for learning
paths and progress tracking — a compact (3 files, ~1.1K LOC)
`app`/`server`/`types` service.

### @lilith/daily-content

Daily-content delivery service (`apps/lilith/svc-daily-content/src`) and one of
the larger services (~62 files, ~84K LOC): a deep `services/` layer plus a
`data/` corpus for scheduled, personalized daily meditation delivery.
Substantial real domain logic, not a thin scheduler.

### @lilith/dao-governance

DAO governance service (`apps/lilith/svc-dao-governance/src`) coordinating
proposal lifecycles — creation, voting, timelock queueing, and execution with
compliance and notifications (per README). Compact (`app.ts` + `governance.ts`,
~2K LOC).

### @lilith/data-governance

Data-governance & compliance service (`apps/lilith/svc-data-governance/src`,
~2.7K LOC) — standard `app`/`server`/`types` service for governance/compliance
policy enforcement across the platform's data.

### @lilith/defi-integration

DeFi integration service (`apps/lilith/svc-defi-integration/src`) bridging
treasury and yield strategies into DeFi protocols with compliance validation,
risk monitoring, and analytics (`defi.ts` + `types.ts`, ~2K LOC).

### @lilith/error-handler

Centralized error-handling & offline-fallback service
(`apps/lilith/svc-error-handler/src`) — a compact (3 files, ~1.1K LOC)
`app`/`server`/`types` service providing consistent error semantics and offline
fallbacks across clients.

### @lilith/fiat-ramp

Fiat on/off-ramp service (`apps/lilith/svc-fiat-ramp/src`, ~3.7K LOC)
orchestrating compliant movement between banking rails and digital assets: KYC,
risk evaluation, banking/payment-processor integration, treasury bookkeeping,
and ledgering (`fiat-ramp.ts` + `types.ts`).

### @lilith/group-meditation

Collaborative group-meditation service (`apps/lilith/svc-group-meditation/src`,
~174 files, ~24K LOC) on Fastify over MongoDB + Redis: live-session
orchestration plus a rich community layer — `virtual-temple` presence/runtime,
`wisdom-board`, `wisdom-digest`/`contribution`/`highlight`/`insights`, and
user-generated ritual tooling. Substantial.

### @lilith/indexer-service

Graph-protocol indexer (`apps/lilith/svc-indexer/src`) — a thin client around
The Graph for querying on-chain events emitted by the Lilith contracts, with a
`postgres-repo`, a `subscription` flow, and a `migrations/` schema. Honestly
scoped to the high-value marketplace query flows (~3.1K LOC).

### @lilith/ipfs-integration

IPFS integration service (`apps/lilith/svc-ipfs-integration/src`) managing
decentralized storage: pinning JSON/file payloads, multi-provider replication,
cache-aware retrieval with gateway fallbacks, and analytics (`ipfs.ts` +
`types.ts`, ~1.7K LOC).

### @lilith/journal

Journaling service (`apps/lilith/svc-journal/src`) exposing `entry.service`,
`analysis.service`, and `insights.service` for user journals with derived
insights. Compact, real (6 files, ~4K LOC).

### @lilith/language-detection-service

Language-detection & auto-switching service
(`apps/lilith/svc-language-detection/src`) — the smallest content service here
(3 files, ~807 LOC): an `app`/`server`/`types` service that detects request
language and drives locale auto-switching.

### @lilith/media

Media service (`apps/lilith/svc-media/src`, ~22K LOC) for asset ingest,
transcode, and delivery: a `processing/` pipeline, `metadata/`, `transcripts/`,
`cdn/`, an `s3-client`, and Postgres
`asset-version`/`processing-job`/`transcript` repositories. A substantial media
backbone.

### @lilith/meditation-core

A **shared library** (`apps/lilith/svc-meditation-core/src`), not a running
service: shared safety, mode-selection, progress/streak/schedule/session
helpers, a `biometric` helper, a `tts` helper, and Postgres storage adapters +
migrations that the other meditation services build on. Re-exported from
`src/index.ts`.

### @lilith/meditation-experience

Meditation-experience NFT service (`apps/lilith/svc-meditation-experience/src`)
that bundles guided meditations into mint-ready NFT artifacts — session
composition, script generation, audio rendering, storage, metadata, and minting
(`service.ts`, ~1.7K LOC).

### @lilith/meditation-generation

Meditation-generation service (`apps/lilith/svc-meditation-generation/src`, ~7K
LOC): a `script-generator`, `ssml-builder`, `tts-builder`, `llm-adapter`,
`quality-assurance` + A/B-test repos, `audio-library` with Postgres storage, and
a `time-optimizer`. Generates and QA-checks meditation scripts/audio.

### @lilith/metaverse

3D virtual-world engine (`apps/lilith/svc-metaverse/src`) for immersive VR/AR
meditation/learning spaces and the second-largest project (~368 files, ~183K
LOC): `geometry/`, `environments/`, `multiplayer/`, `creator/`, `engine/`,
`physics/`, `avatars/`, `audio/`, and a very large `ai/` subsystem (~316 files).
A real, deep engine codebase.

### @lilith/micro-transaction

Micro-transaction service (`apps/lilith/svc-micro-transaction/src`) for
pay-per-use purchases (meditations, teachings, live experiences) with
token-backed authorization, settlement, ledgering, and refunds (`micro.ts` +
`service.ts`, ~2.1K LOC).

### @lilith/moderation

Content-moderation & safety service (`apps/lilith/svc-moderation/src`, ~14.7K
LOC): `pii-detection`, `prompt-injection-detection`, `perspective-api`,
`semantic-safety`, `trust-safety`, a `review-workflow`, persona policies, and
stream moderation with a `quality/` subsystem. A real guardrails service.

### @lilith/multi-region-resilience

Multi-region active/active resilience service
(`apps/lilith/svc-multi-region-resilience/src`, ~2.2K LOC) for failover
automation and high-availability management — standard `app`/`server`/`types`
layout.

### @lilith/native-token

Native `$LILITH` token service (`apps/lilith/svc-native-token/src`) coordinating
the governance/utility token launch: supply planning, contract deployment,
cross-network minting, treasury allocation, emission scheduling, and governance
enforcement (`token.ts` + `service.ts`, ~2.4K LOC).

### @lilith/notes

Scholar-notes service (`apps/lilith/svc-notes/src`) for notes, highlights, and
learning journals, including a daily-reflections sub-feature (`reflections-app`,
`reflections-pdf` export, `export-storage`). ~3.8K LOC, real.

### @lilith/notification

Notification service (`apps/lilith/svc-notification/src`, ~7.9K LOC) with a
`dispatcher` and real channel adapters (`apns`, `fcm`, `sendgrid`, `ses`,
`twilio`, plus a `mock`), templates, frequency-limits, quiet-hours, unsubscribe,
and a websocket channel over a Postgres schema. The platform's fan-out hub.

### @lilith/observability-service

Observability service (`apps/lilith/svc-observability/src`, ~8K LOC) for SLOs,
error budgets, and alerting: SLO/error-budget routes, tracing routes,
`rag-quality`/`rag-performance` and `stt-wer`/`stt-test-sets` dashboards,
resilience/runbook/security routes, and a unified dashboard. Reporting/alerting,
broad coverage.

### @lilith/offline

Offline-downloads service (`apps/lilith/svc-offline/src`, ~7K LOC) assembling
encrypted content bundles and managing licenses + multi-device sync:
`bundle-manager`, `cache-manager`, `encryption`, a `license-*` family
(manager/usage/users/analytics/maintenance), and a `sync-manager`. Real offline
DRM/bundle logic.

### @lilith/operational-excellence

Operational-excellence service (`apps/lilith/svc-operational-excellence/src`,
~7.3K LOC): `capacity-planning`, `health-monitor`, `incident-manager`, and
`runbook-automation` modules — an ops/SRE automation service (paired with
observability for run/health).

### @lilith/partner-api

Partner API service (`apps/lilith/svc-partner-api/src`) exposing programmatic
third-party access to Lilith capabilities, shipped with an `openapi.yaml` spec.
Compact app/server surface (~1.2K LOC) over the documented contract.

### @lilith/payment-orchestrator

Cryptocurrency payment orchestrator (`apps/lilith/svc-payment-orchestrator/src`,
~55 files, ~32K LOC) — but much broader than crypto: `stripe/`, `iap/`, `tax/`,
`promotions/`, `entitlements/`, `dunning/`, `fraud/`, `funnel/`, `analytics/`,
and `internationalization/` subsystems over a Postgres `db/`. The platform's
billing brain.

### @lilith/progress-sync

Cross-device progress & bookmark sync service
(`apps/lilith/svc-progress-sync/src`, ~1.7K LOC): progress/bookmark/analytics
routes, `conflict-resolution`, a `realtime-manager`, `health-metrics`, and
`validation-schemas`. Real conflict-aware sync.

### @lilith/real-time-sync

Real-time chat-sync service (`apps/lilith/svc-real-time-sync/src`, ~4.4K LOC)
for cross-platform messaging, built around a `webrtc-sfu` and a
`duplex-voice-pipeline` module. Realtime transport for chat/voice.

### @lilith/review-service

Human-in-the-loop content-review service (`apps/lilith/svc-review/src`, ~2K LOC)
— an `app`/`server`/`storage`/`types` service queueing content for human review.
Compact but real.

### @lilith/rights-management

Rights-management service (`apps/lilith/svc-rights-management/src`, ~5K LOC)
with automated license gates and content-source validation, including a
`voice-similarity-engine.ts` for voice-rights checks. `rights.ts` + `api.ts` +
routes.

### @lilith/safety-automation

Safety-evaluation automation & red-team program
(`apps/lilith/svc-safety-automation/src`, ~3.8K LOC): an `evals-orchestrator`
and `evals-integration` plus a `notification-client`, automating safety evals
and alerting. Real orchestration over the evals harness.

### @lilith/settlement

Settlement-orchestration service (`apps/lilith/svc-settlement/src`, ~3.5K LOC)
for Web3 payments, with pluggable persistence (`memory-store`, `mongo-store`,
`postgres-store`). Sits on the shared `@lilith/transaction-core` primitives.

### @lilith/spiritual-guidance

Spiritual-guidance service (`apps/lilith/svc-spiritual-guidance/src`, ~4.8K
LOC): a `guidance-generator`, persona definitions (`personas.ts`), a `safety`
layer, and a `conversation-memory` store — the persona-driven guidance
conversation domain.

### @lilith/staking-mechanism

Staking service (`apps/lilith/svc-staking-mechanism/src`) that rewards
meditation practice — tracking stake deposits, meditation contributions, reward
accrual, withdrawals, and governance tiering (`staking.ts` + `service.ts`, ~2.1K
LOC).

### @lilith/stt

Speech-to-text service (`apps/lilith/svc-stt/src`) — a compact service whose
in-repo logic centers on `app`/`server` plus a `profanity-matcher` and
`profanity-wordlists` for transcript filtering (~5.5K LOC, much of it wordlist
data).

### @lilith/sync

General-purpose CRDT sync service (`apps/lilith/svc-sync/src`, ~6.4K LOC) for
offline-first document sync: a real CRDT toolkit (`counters`, `registers`,
`rga`, `sets`, `vector-clock`, `merge-strategies`) plus
handoff/clipboard/universal-links and notification-sync, over a Postgres
`sync_documents` schema. Yjs-style offline-first sync (per README).

### @lilith/teacher-blessing

Teacher-blessing NFT service (`apps/lilith/svc-teacher-blessing/src`) composing
ceremonial blessing NFTs — invocations, audio rendering, relic imagery, and
metadata minting (`service.ts`, ~1.2K LOC). Compact, single-pipeline.

### @lilith/tiered-subscription

Tiered-subscription service (`apps/lilith/svc-tiered-subscription/src`) managing
token-backed subscription tiers, billing, renewals, and entitlements
(`service.ts`, ~1.8K LOC). Compact.

### @lilith/token-access

Token-gated access service (`apps/lilith/svc-token-access/src`) evaluating token
holdings across chains, persisting entitlements, anchoring policy decisions, and
emitting analytics (`service.ts`, ~1.5K LOC). Compact gate.

### @lilith/token-core

A **shared library** (`apps/lilith/svc-token-core/src`), intentionally small, of
cross-domain token/NFT primitives — metadata envelopes, mint receipts, storage
URIs, chain/network info, royalty recipients, allocation buckets, access-policy
pieces, and launch config — so the tokenized services stay focused. Types +
helpers, ~3.1K LOC.

### @lilith/token-verification

Token-verification service (`apps/lilith/svc-token-verification/src`, ~5K LOC)
combining a `blockchain-token-verifier`, a `jwt-verifier`, a `revocation-store`,
and a `cache` — verifies both on-chain token holdings and signed access tokens.

### @lilith/transaction-core

A **shared library** (`apps/lilith/svc-transaction-core/src`) of transaction
primitives and flow helpers for the transaction-oriented services
(`transaction-manager`, `payment-orchestrator`, `settlement`):
`TransactionStatus` constants with a `nextState` guard, a `processor`, `retry`,
and `settlement` helpers. ~1.9K LOC.

### @lilith/transaction-manager

Transaction-manager service (`apps/lilith/svc-transaction-manager/src`)
coordinating queued blockchain submissions with retry and confirmation handling
— sits between product flows and RPC providers handling intermittent failures
and nonce management (`transaction-manager.ts`, ~1.4K LOC).

### @lilith/tts

Text-to-Speech (Chatterbox) service (`apps/lilith/svc-tts/src`, ~100 files, ~35K
LOC) — far more than basic TTS: a `providers/` layer plus full `voice-design`,
`voice-cloning`, `speech-to-text`, `sound-effects`, `music-generation`,
`dubbing`, `audio-tags`, `audio-isolation`, and `conversational-ai` subsystems
with a voice-library management/search surface. A deep audio-generation
platform.

### @lilith/user-preferences

User-preference management & sync service
(`apps/lilith/svc-user-preferences/src`, ~2.1K LOC) — a compact service storing
and synchronizing per-user preferences across devices.

### @lilith/voice-pipeline

Duplex voice-pipeline service (`apps/lilith/svc-voice-pipeline/src`, ~3.5K LOC)
for real-time audio processing; includes a `simulation-routes.ts` for exercising
the pipeline. Small (4 source files) but real.

### @lilith/webrtc

WebRTC SFU service (`apps/lilith/svc-webrtc/src`, ~9K LOC) for real-time voice
chat: a `config-builder`, `ice-utils`, `turn-credentials`, a
`sfu-tuning-plc-enhancement` (packet-loss-concealment tuning), and a
`conversation-starter-service`. Real SFU signaling/config logic.

### @lilith/yoga-practice

Yoga-practice service (`apps/lilith/svc-yoga-practice/src`, ~4.5K LOC): a
`pose-library`, `posture-analyzer`, `sequence-generator`, `adaptive-difficulty`,
`progress-tracker`, `session-manager`, and `voice-guidance` — a full guided-yoga
domain, not a stub.
