@alwaysmeticulous/debug-workspace

中文文档
3.6.0发布于 2026/11/06ISCTypeScriptCommonJS构建来源已验证近 30 天下载 35.4万

Shared debug workspace pipeline for investigating Meticulous diffs and replays

原始使用文档
文档目录5 节
  1. What it does
  2. Overlay templates
  3. Usage
  4. Key exports
  5. Part of the Meticulous SDK

@alwaysmeticulous/debug-workspace

Shared package that provides the debug workspace pipeline used by the Meticulous CLI (meticulous debug) to investigate visual diffs and replay issues.

What it does

Given a replay diff ID or replay ID(s), this package:

  1. Resolves context -- Fetches metadata about the test run and its replay diffs from the Meticulous API, producing a DebugContext with all related IDs.

  2. Downloads debug data -- Downloads replay data (logs, timeline, params, assets), session recordings, replay diffs, and test run metadata into a local workspace directory. Downloads run in parallel with configurable concurrency.

  3. Generates a workspace -- Scaffolds a structured directory with:

    • Templates -- CLAUDE.md and settings copied into .claude/ for use with Claude Code.
    • Derived analysis files -- Pre-computed artifacts that make large replay data greppable and manageable:
      • Filtered logs (noise-stripped deterministic logs)
      • Diff summaries (compact screenshot diff results)
      • Events index (one-line-per-event timeline summary)
      • Network log (compact request log)
      • VT progression (virtual time values for diffing)
      • Logs index (one-line-per-entry log summary)
      • Screenshot timeline context (events surrounding each screenshot)
      • Errors diffs (errors only one replay hit) and coverage diffs (head vs base JS coverage)
      • Session summaries, assets diffs
      • Formatted assets (pretty-printed JS/CSS)
      • Screenshot DOM snapshots (per-screenshot <name>.html files extracted from <name>.metadata.json, written alongside each replay's screenshots/ directory)
      • DOM diffs (per-screenshot unified diffs of HEAD vs BASE pretty-printed HTML, fetched from the Meticulous backend and written to dom-diffs/ as .diff files, sibling .full.diff files with full-file context, and a per-pair .summary.txt. The diffs are identical to those shown in the Meticulous product. Only generated on the replay-diff path.)
      • PR diff (source code changes between base and head commits)
    • Context JSON -- Machine-readable metadata with all IDs, paths, file sizes, screenshot map, and replay comparison stats.

Overlay templates

generateDebugWorkspace accepts an optional additionalTemplatesDir parameter. Files in this overlay directory take precedence over the base templates bundled with this package. For subdirectories (agents, skills), base files are copied first, then overlay files are copied on top -- so overlays can add new files or replace specific ones by name.

This is used by met_debug (in the internal Meticulous repo) to provide admin-specific templates, skills, and a custom CLAUDE.md without forking the base package.

Usage

This package is consumed by @alwaysmeticulous/cli via the meticulous debug command.

import { runDebugPipeline } from "@alwaysmeticulous/debug-workspace";

await runDebugPipeline({
  client,
  replayDiffId: "some-replay-diff-id",
  screenshot: "screenshot-after-event-00042.png",
  createWorktree: (ctx, workspaceDir) =>
    createProjectWorktree({ debugContext: ctx, workspaceDir }),
  onWorkspaceReady: (workspaceDir, projectRepoDir) =>
    presentWorkspace({ workspaceDir, projectRepoDir }),
});

Or use individual steps for more control:

import {
  resolveDebugContext,
  downloadDebugData,
  generateDebugWorkspace,
} from "@alwaysmeticulous/debug-workspace";

const debugContext = await resolveDebugContext({ client, replayDiffId });
await downloadDebugData({ client, debugContext, workspaceDir });
await generateDebugWorkspace({
  client,
  debugContext,
  workspaceDir,
  projectRepoDir,
});

Key exports

  • runDebugPipeline -- Runs the full pipeline (resolve, download, generate workspace).
  • resolveDebugContext -- Resolves a DebugContext from a replay diff ID or replay ID(s).
  • downloadDebugData -- Downloads replay data and artifacts into a workspace directory.
  • generateDebugWorkspace -- Scaffolds the workspace directory from templates and generates all derived analysis files.
  • DebugContext, ReplayDiffInfo -- Types describing the resolved debug context.
  • DEBUG_DATA_DIRECTORY, getDebugSessionsDir -- Path constants.

Part of the Meticulous SDK

This package is part of the meticulous-sdk monorepo.

版本与发布记录

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

版本发布日期距今
3.6.0latest2026/11/06今天
3.5.02026/11/051 天前
3.4.12026/10/297 天前
3.2.02026/10/2214 天前
3.1.02026/10/2215 天前
3.0.02026/10/1620 天前

关于 @alwaysmeticulous/debug-workspace 的常见问题

@alwaysmeticulous/debug-workspace 是什么?

Shared debug workspace pipeline for investigating Meticulous diffs and replays

如何安装 @alwaysmeticulous/debug-workspace?

在项目目录运行 npm install @alwaysmeticulous/debug-workspace,或使用 pnpm add / yarn add / bun add。

@alwaysmeticulous/debug-workspace 支持 TypeScript 吗?

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

@alwaysmeticulous/debug-workspace 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@alwaysmeticulous/debug-workspace 需要什么版本的 Node.js?

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

@alwaysmeticulous/debug-workspace 可以商用吗?

@alwaysmeticulous/debug-workspace 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@alwaysmeticulous/debug-workspace 的下载量有多少?

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

@alwaysmeticulous/debug-workspace 还在维护吗?

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