Skip to main content

Service Topology

bgng commands own orchestration. Services do the reusable work. Utilities handle paths, formatting, slugs, and YouTube URL parsing.

Important services

ModuleOwns
services/config.tsconfig.json, v1 to v2 migration, SupaData key resolution
services/index.tsqmd store singleton, indexing, search, document retrieval, contexts
services/queue.tsMarkdown queue parse, serialize, atomic write
services/supadata.tsSupaData REST client, rate limiting, retry, async transcript polling
services/transcript.tsMarkdown and plain-text transcript formatting
services/beginningdb/*HTTP helper, target resolution, path prefix rewriting
services/ide/*VSIX install, profiles, sessions, secrets, runtime metadata, auth refresh

Composition rules

  • Commands call services directly; there is no dependency-injection container.
  • The qmd store is lazy because embedding models load on first use.
  • SupaData rate limiting is per client instance and resets when the process exits.
  • BeginningDB HTTP helpers know HTTP mechanics; route-specific logic stays in DbCommands.ts.
  • Testable services accept fetch functions or clocks where needed.