@domscribe/relay

中文文档
0.7.0发布于 2026/10/28TypeScriptES Module构建来源已验证近 30 天下载 14.1万

Local relay server and MCP adapter for Domscribe

原始使用文档
文档目录6 节
  1. Install
  2. CLI Commands
  3. Annotation Lifecycle
  4. WebSocket Events
  5. Links
  6. License

@domscribe/relay

Local relay server and MCP adapter for Domscribe.

@domscribe/relay runs on the developer's machine and bridges the in-browser overlay with coding agents. It provides an HTTP API for annotation management, a WebSocket server for real-time overlay updates, and an MCP server for agent tool access.

Install

npm install @domscribe/relay

CLI Commands

The relay ships with a CLI that manages the server process and workspace initialization.

domscribe serve     # Start relay server (foreground or --daemon)
domscribe status    # Check relay daemon status
domscribe stop      # Stop relay daemon
domscribe init      # Setup wizard (agent + framework configuration)
domscribe mcp       # Run as MCP server via stdio

For use in agent MCP configuration, the standalone domscribe-mcp binary runs the MCP server directly over stdio without the HTTP/WebSocket relay.

Monorepo support: All commands automatically resolve the app root from a domscribe.config.json file when run from a monorepo root. Run domscribe init --app-root <path> to generate the config, or let the interactive wizard detect it.

Annotation Lifecycle

A developer clicks an element in the running app, types an instruction, and submits it. The annotation moves through the following states:

FromToTrigger
QUEUEDPROCESSINGAgent calls domscribe.annotation.process
PROCESSINGPROCESSEDAgent calls domscribe.annotation.respond
PROCESSINGFAILEDAgent error or timeout
PROCESSEDARCHIVEDDeveloper archives via overlay

The agent claims an annotation atomically (preventing double-processing), edits the relevant source files, then responds with a summary. The overlay receives the state change via WebSocket and updates in real time.

WebSocket Events

The relay broadcasts events over WebSocket to keep connected overlay instances in sync.

EventDescription
CONNECT / CONNECTED / DISCONNECTEDConnection lifecycle
ERRORConnection error
ANNOTATION_CREATED / ANNOTATION_UPDATEDAnnotation changes
MANIFEST_UPDATEDManifest file changes
CONTEXT_REQUEST / CONTEXT_RESPONSEBidirectional runtime context queries

CONTEXT_REQUEST / CONTEXT_RESPONSE are used when an agent requests live component props or state from the browser — the relay forwards the request to the overlay, which queries the runtime and sends the response back through the same WebSocket connection.

Part of Domscribe.

License

MIT

版本与发布记录

@domscribe/relay 共发布 16 个版本,首次发布于 2026/03/18;过去 12 个月发布了 16 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.7.0latest2026/10/2816 天前
0.6.12026/10/2519 天前
0.5.22026/04/017 个月前
0.5.12026/04/017 个月前
0.5.02026/03/277 个月前
0.4.02026/03/277 个月前

关于 @domscribe/relay 的常见问题

@domscribe/relay 是什么?

Local relay server and MCP adapter for Domscribe

如何安装 @domscribe/relay?

在项目目录运行 npm install @domscribe/relay,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 domscribe、domscribe-mcp,可以用 npx domscribe 直接运行。

@domscribe/relay 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@domscribe/relay 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@domscribe/relay 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@domscribe/relay 可以商用吗?

@domscribe/relay 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@domscribe/relay 的下载量有多少?

根据 npm 官方下载统计,@domscribe/relay 在 2026/10/13 – 2026/11/11 这 30 天内被下载 141,201 次,日均约 4,707 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@domscribe/relay 还在维护吗?

最新版本 0.7.0 发布于 2026/10/28(16 天前);至今共发布 16 个版本,其中过去 12 个月发布了 16 个;首次发布于 2026/03/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。