Packages

Domscribe is organized as a monorepo with 12 published packages. Each package has a well-defined scope and strict dependency boundaries enforced at lint time.

Overview

PackageDescription
@domscribe/coreZod schemas, RFC 7807 error system, ID generation, PII redaction, constants
@domscribe/manifestAppend-only JSONL manifest, IDStabilizer (xxhash64), BatchWriter, ManifestCompactor
@domscribe/relayFastify HTTP/WS server, MCP stdio adapter, annotation lifecycle
@domscribe/transformParser-agnostic AST injection (Acorn, Babel, VueSFC), bundler plugins
@domscribe/runtimeBrowser-side ElementTracker, ContextCapturer, BridgeDispatch
@domscribe/overlayLit web components (shadow DOM), element picker, annotation UI
@domscribe/reactReact fiber walking, props/state extraction, Vite + Webpack plugins
@domscribe/vueVue 3 VNode resolution, Composition + Options API support, Vite + Webpack plugins
@domscribe/nextwithDomscribe() config wrapper for Next.js 15 + 16
@domscribe/nuxtNuxt 3+ module with auto-relay and runtime plugin
domscribeCLI binary (domscribe serve, status, stop, init, mcp)
@domscribe/mcpStandalone MCP server binary (domscribe-mcp)

Architecture Tiers

Packages are organized into four dependency tiers. Each tier can only depend on tiers above it.

Tier 1: Core
  @domscribe/core

Tier 2: Infrastructure
  @domscribe/manifest
  @domscribe/relay
  @domscribe/runtime

Tier 3: Build
  @domscribe/transform

Tier 4: Adapters
  @domscribe/react
  @domscribe/vue
  @domscribe/next
  @domscribe/nuxt
  @domscribe/overlay
  domscribe (CLI)
  @domscribe/mcp

Dependency Graph

@domscribe/core ─────────────────────────────────────────── Foundation
    |
    +-- @domscribe/manifest ─────────────────────────────── Index Management
    |       |
    |       +-- @domscribe/transform ────────────────────── AST Injection
    |       |       |
    |       |       +-- @domscribe/next ─────────────────── Next.js Integration
    |       |       +-- @domscribe/nuxt ─────────────────── Nuxt 3 Module
    |       |
    |       +-- @domscribe/relay ────────────────────────── Dev Server + MCP
    |
    +-- @domscribe/runtime ──────────────────────────────── Browser Context Capture
    |       |
    |       +-- @domscribe/react ────────────────────────── React Adapter
    |       +-- @domscribe/vue ──────────────────────────── Vue 3 Adapter
    |       +-- @domscribe/overlay ──────────────────────── Lit UI Components
    |
    +-- (shared types, schemas, constants, errors)

Package Details

@domscribe/core

The foundation package. All other packages depend on it.

Dependencies: nanoid, zod

Key exports:

@domscribe/manifest

Manages the append-only JSONL manifest that maps DOM elements to source code locations.

Dependencies: @domscribe/core, xxhash-wasm, zod

Components:

Storage format:

{"id":"A1B2C3D4","file":"src/App.tsx","start":{"line":5,"column":4},"end":{"line":5,"column":30},"tagName":"div","fileHash":"a1b2c3d4e5f6"}

@domscribe/relay

Local development server bridging the browser overlay and coding agents.

Dependencies: @domscribe/core, @domscribe/manifest, fastify, @fastify/cors, @fastify/websocket, @modelcontextprotocol/sdk, commander, zod

Provides:

@domscribe/transform

AST-level injection of stable data-ds attributes into JSX and Vue templates, plus bundler plugins.

Dependencies: @domscribe/core, @domscribe/manifest, @domscribe/relay, acorn, acorn-jsx, acorn-walk, @babel/parser, @babel/types, magic-string, source-map

Parsers:

ParserUse CaseNotes
AcornParserJavaScript/JSX (default)Fastest
BabelParserTypeScript/TSXFull TypeScript support
VueSFCParserVue 3 SFCsHandles <script setup> and templates

Bundler plugins:

Subpath ExportPlugin
@domscribe/transform/plugins/viteVite plugin
@domscribe/transform/plugins/webpackWebpack plugin
@domscribe/transform/webpack-loaderWebpack loader
@domscribe/transform/plugins/turbopackTurbopack exports
@domscribe/transform/turbopack-loaderTurbopack loader

@domscribe/runtime

Browser-side context capture system.

Dependencies: @domscribe/core

Key components:

@domscribe/overlay

In-browser UI built with Lit web components using shadow DOM isolation.

Dependencies: @domscribe/core, @domscribe/runtime, @domscribe/relay, lit

Web components: ds-overlay, ds-tab, ds-sidebar, ds-header, ds-annotation-list, ds-annotation-item, ds-annotation-input, ds-context-panel, ds-element-preview, ds-highlight-box, ds-picker-overlay, ds-tooltip

OverlayStore manages reactive state including mode (collapsed, expanded, picker), relay connection status, selected element, runtime context, manifest entry, and annotations.

@domscribe/react

React framework adapter for runtime context capture.

Dependencies: @domscribe/core, @domscribe/runtime Peer dependencies: react >=16.8.0

Capabilities:

Subpath exports: @domscribe/react/vite, @domscribe/react/webpack, @domscribe/react/auto-init

@domscribe/vue

Vue 3 framework adapter for runtime context capture.

Dependencies: @domscribe/core, @domscribe/runtime Peer dependencies: vue >=3.3.0

Capabilities:

Subpath exports: @domscribe/vue/vite, @domscribe/vue/webpack, @domscribe/vue/auto-init

@domscribe/next

Next.js integration via config wrapping.

Dependencies: @domscribe/transform, @domscribe/runtime, @domscribe/react Peer dependencies: next >=15.0.0, react ^18.0.0 || ^19.0.0

Provides withDomscribe(options)(nextConfig) which applies the transform plugin in dev mode, injects relay globals and overlay scripts, aliases the overlay to a no-op stub in production, and supports both Webpack (Next.js 15) and Turbopack (Next.js 16+).

Subpath exports: @domscribe/next/runtime (DomscribeDevProvider component), @domscribe/next/noop/overlay (production no-op stub)

@domscribe/nuxt

Nuxt 3+ module for zero-config integration.

Dependencies: @domscribe/relay, @domscribe/transform, @domscribe/runtime, @domscribe/vue Peer dependencies: nuxt >=3.0.0

Auto-starts the relay daemon in dev mode, injects relay globals via app.head, applies Vite and Webpack plugins, and registers a client-only runtime plugin for RuntimeManager and VueAdapter initialization.

domscribe (CLI)

The command-line binary providing domscribe serve, domscribe status, domscribe stop, domscribe init, and domscribe mcp. See the CLI Reference for full documentation.

@domscribe/mcp

Standalone MCP server binary (domscribe-mcp). Runs over stdio and connects to the relay daemon to expose all 12 Domscribe tools and 4 prompts. See the MCP Tools Reference for full tool documentation.