@alwaysmeticulous/debug-workspace 2.261.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +15 -0
  2. package/dist/debug-constants.d.ts +3 -0
  3. package/dist/debug-constants.js +10 -0
  4. package/dist/debug-constants.js.map +1 -0
  5. package/dist/debug.types.d.ts +21 -0
  6. package/dist/debug.types.js +3 -0
  7. package/dist/debug.types.js.map +1 -0
  8. package/dist/download-debug-data.d.ts +10 -0
  9. package/dist/download-debug-data.js +141 -0
  10. package/dist/download-debug-data.js.map +1 -0
  11. package/dist/generate-debug-workspace.d.ts +31 -0
  12. package/dist/generate-debug-workspace.js +1302 -0
  13. package/dist/generate-debug-workspace.js.map +1 -0
  14. package/dist/index.d.ts +6 -0
  15. package/dist/index.js +16 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/pipeline.d.ts +21 -0
  18. package/dist/pipeline.js +63 -0
  19. package/dist/pipeline.js.map +1 -0
  20. package/dist/resolve-debug-context.d.ts +12 -0
  21. package/dist/resolve-debug-context.js +187 -0
  22. package/dist/resolve-debug-context.js.map +1 -0
  23. package/dist/templates/CLAUDE.md +206 -0
  24. package/dist/templates/agents/planner.md +65 -0
  25. package/dist/templates/agents/summarizer.md +75 -0
  26. package/dist/templates/hooks/check-file-size.sh +36 -0
  27. package/dist/templates/hooks/load-context.sh +20 -0
  28. package/dist/templates/rules/feedback.md +37 -0
  29. package/dist/templates/settings.json +82 -0
  30. package/dist/templates/skills/debugging-diffs/SKILL.md +57 -0
  31. package/dist/templates/skills/debugging-flakes/SKILL.md +52 -0
  32. package/dist/templates/skills/debugging-network/SKILL.md +45 -0
  33. package/dist/templates/skills/debugging-sessions/SKILL.md +47 -0
  34. package/dist/templates/skills/debugging-timelines/SKILL.md +51 -0
  35. package/dist/templates/skills/pr-analysis/SKILL.md +20 -0
  36. package/dist/templates/templates/CLAUDE.md +206 -0
  37. package/dist/templates/templates/agents/planner.md +65 -0
  38. package/dist/templates/templates/agents/summarizer.md +75 -0
  39. package/dist/templates/templates/hooks/check-file-size.sh +36 -0
  40. package/dist/templates/templates/hooks/load-context.sh +20 -0
  41. package/dist/templates/templates/rules/feedback.md +37 -0
  42. package/dist/templates/templates/settings.json +82 -0
  43. package/dist/templates/templates/skills/debugging-diffs/SKILL.md +57 -0
  44. package/dist/templates/templates/skills/debugging-flakes/SKILL.md +52 -0
  45. package/dist/templates/templates/skills/debugging-network/SKILL.md +45 -0
  46. package/dist/templates/templates/skills/debugging-sessions/SKILL.md +47 -0
  47. package/dist/templates/templates/skills/debugging-timelines/SKILL.md +51 -0
  48. package/dist/templates/templates/skills/pr-analysis/SKILL.md +20 -0
  49. package/package.json +49 -0
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2022, Meticulous Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,3 @@
1
+ export declare const DEBUG_DATA_DIRECTORY = "debug-data";
2
+ export declare const DEBUG_SESSIONS_DIR_NAME = "debug-sessions";
3
+ export declare const getDebugSessionsDir: () => string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDebugSessionsDir = exports.DEBUG_SESSIONS_DIR_NAME = exports.DEBUG_DATA_DIRECTORY = void 0;
4
+ const path_1 = require("path");
5
+ const common_1 = require("@alwaysmeticulous/common");
6
+ exports.DEBUG_DATA_DIRECTORY = "debug-data";
7
+ exports.DEBUG_SESSIONS_DIR_NAME = "debug-sessions";
8
+ const getDebugSessionsDir = () => (0, path_1.join)((0, common_1.getMeticulousLocalDataDir)(), exports.DEBUG_SESSIONS_DIR_NAME);
9
+ exports.getDebugSessionsDir = getDebugSessionsDir;
10
+ //# sourceMappingURL=debug-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-constants.js","sourceRoot":"","sources":["../src/debug-constants.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,qDAAqE;AAExD,QAAA,oBAAoB,GAAG,YAAY,CAAC;AAEpC,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAEjD,MAAM,mBAAmB,GAAG,GAAW,EAAE,CAC9C,IAAA,WAAI,EAAC,IAAA,kCAAyB,GAAE,EAAE,+BAAuB,CAAC,CAAC;AADhD,QAAA,mBAAmB,uBAC6B"}
@@ -0,0 +1,21 @@
1
+ export interface ReplayDiffInfo {
2
+ id: string;
3
+ headReplayId: string;
4
+ baseReplayId: string;
5
+ sessionId: string | undefined;
6
+ numScreenshotDiffs: number;
7
+ }
8
+ export interface DebugContext {
9
+ testRunId: string | undefined;
10
+ replayDiffs: ReplayDiffInfo[];
11
+ replayIds: string[];
12
+ sessionIds: string[];
13
+ projectId: string | undefined;
14
+ orgAndProject: string;
15
+ commitSha: string | undefined;
16
+ baseCommitSha: string | undefined;
17
+ testRunStatus: string | undefined;
18
+ screenshot: string | undefined;
19
+ meticulousSha: string | undefined;
20
+ executionSha: string | undefined;
21
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=debug.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.types.js","sourceRoot":"","sources":["../src/debug.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { MeticulousClient } from "@alwaysmeticulous/client";
2
+ import { DebugContext } from "./debug.types";
3
+ export interface DownloadDebugDataOptions {
4
+ client: MeticulousClient;
5
+ debugContext: DebugContext;
6
+ workspaceDir: string;
7
+ maxReplayDownloads?: number | undefined;
8
+ additionalDownloads?: ((debugContext: DebugContext, debugDataDir: string) => void | Promise<void>) | undefined;
9
+ }
10
+ export declare const downloadDebugData: (options: DownloadDebugDataOptions) => Promise<void>;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.downloadDebugData = void 0;
7
+ const fs_1 = require("fs");
8
+ const path_1 = require("path");
9
+ const client_1 = require("@alwaysmeticulous/client");
10
+ const downloading_helpers_1 = require("@alwaysmeticulous/downloading-helpers");
11
+ const chalk_1 = __importDefault(require("chalk"));
12
+ const debug_constants_1 = require("./debug-constants");
13
+ const REPLAY_SKIP_DIRS = new Set(["screenshots"]);
14
+ const DEFAULT_MAX_REPLAY_DOWNLOADS = 8;
15
+ const downloadDebugData = async (options) => {
16
+ var _a;
17
+ const { client, debugContext, workspaceDir } = options;
18
+ const maxConcurrency = (_a = options.maxReplayDownloads) !== null && _a !== void 0 ? _a : DEFAULT_MAX_REPLAY_DOWNLOADS;
19
+ const debugDataDir = (0, path_1.join)(workspaceDir, debug_constants_1.DEBUG_DATA_DIRECTORY);
20
+ (0, fs_1.mkdirSync)(debugDataDir, { recursive: true });
21
+ await downloadReplays(client, debugContext, debugDataDir, maxConcurrency);
22
+ await downloadSessionData(client, debugContext, debugDataDir);
23
+ await downloadReplayDiffs(client, debugContext, debugDataDir);
24
+ await downloadTestRunMetadata(client, debugContext, debugDataDir);
25
+ await downloadPrDiffFromApi(client, debugContext, debugDataDir);
26
+ if (options.additionalDownloads) {
27
+ await options.additionalDownloads(debugContext, debugDataDir);
28
+ }
29
+ };
30
+ exports.downloadDebugData = downloadDebugData;
31
+ const downloadReplays = async (client, debugContext, debugDataDir, maxConcurrency) => {
32
+ const headReplayIds = new Set(debugContext.replayDiffs.map((d) => d.headReplayId));
33
+ const baseReplayIds = new Set(debugContext.replayDiffs.map((d) => d.baseReplayId));
34
+ console.log(chalk_1.default.cyan(` Downloading ${debugContext.replayIds.length} replays...`));
35
+ const results = await inParallel(debugContext.replayIds.map((replayId) => async () => {
36
+ const { fileName: cachedPath } = await (0, downloading_helpers_1.getOrFetchReplayArchive)(client, replayId, "everything", true);
37
+ console.log(chalk_1.default.cyan(` Downloaded replay ${replayId}`));
38
+ return { replayId, cachedPath };
39
+ }), maxConcurrency);
40
+ for (const { replayId, cachedPath } of results) {
41
+ const isHead = headReplayIds.has(replayId);
42
+ const isBase = baseReplayIds.has(replayId);
43
+ const subDir = isHead ? "head" : isBase ? "base" : "other";
44
+ const destDir = (0, path_1.join)(debugDataDir, "replays", subDir, replayId);
45
+ if (!(0, fs_1.existsSync)(destDir)) {
46
+ copyReplayDir(cachedPath, destDir);
47
+ }
48
+ }
49
+ };
50
+ const copyReplayDir = (src, dest) => {
51
+ (0, fs_1.mkdirSync)(dest, { recursive: true });
52
+ for (const entry of (0, fs_1.readdirSync)(src, { withFileTypes: true })) {
53
+ const srcPath = (0, path_1.join)(src, entry.name);
54
+ const destPath = (0, path_1.join)(dest, entry.name);
55
+ if (entry.isDirectory()) {
56
+ if (!REPLAY_SKIP_DIRS.has(entry.name)) {
57
+ (0, fs_1.cpSync)(srcPath, destPath, { recursive: true });
58
+ }
59
+ }
60
+ else {
61
+ (0, fs_1.cpSync)(srcPath, destPath);
62
+ }
63
+ }
64
+ };
65
+ const downloadSessionData = async (client, debugContext, debugDataDir) => {
66
+ if (debugContext.sessionIds.length === 0) {
67
+ return;
68
+ }
69
+ for (const sessionId of debugContext.sessionIds) {
70
+ console.log(chalk_1.default.cyan(` Downloading session ${sessionId}...`));
71
+ const { data: sessionData } = await (0, downloading_helpers_1.getOrFetchRecordedSessionData)(client, sessionId);
72
+ const sessionDir = (0, path_1.join)(debugDataDir, "sessions", sessionId);
73
+ (0, fs_1.mkdirSync)(sessionDir, { recursive: true });
74
+ (0, fs_1.writeFileSync)((0, path_1.join)(sessionDir, "data.json"), JSON.stringify(sessionData, null, 2));
75
+ }
76
+ };
77
+ const downloadReplayDiffs = async (client, debugContext, debugDataDir) => {
78
+ if (debugContext.replayDiffs.length === 0) {
79
+ return;
80
+ }
81
+ const diffsDir = (0, path_1.join)(debugDataDir, "diffs");
82
+ (0, fs_1.mkdirSync)(diffsDir, { recursive: true });
83
+ for (const diff of debugContext.replayDiffs) {
84
+ console.log(chalk_1.default.cyan(` Downloading replay diff ${diff.id}...`));
85
+ const diffData = await (0, client_1.getReplayDiff)(client, diff.id);
86
+ (0, fs_1.writeFileSync)((0, path_1.join)(diffsDir, `${diff.id}.json`), JSON.stringify(diffData, null, 2));
87
+ }
88
+ };
89
+ const downloadTestRunMetadata = async (client, debugContext, debugDataDir) => {
90
+ if (!debugContext.testRunId) {
91
+ return;
92
+ }
93
+ const testRunDir = (0, path_1.join)(debugDataDir, "test-run");
94
+ (0, fs_1.mkdirSync)(testRunDir, { recursive: true });
95
+ console.log(chalk_1.default.cyan(` Downloading test run ${debugContext.testRunId}...`));
96
+ const testRun = await (0, client_1.getTestRun)({
97
+ client,
98
+ testRunId: debugContext.testRunId,
99
+ });
100
+ (0, fs_1.writeFileSync)((0, path_1.join)(testRunDir, `${debugContext.testRunId}.json`), JSON.stringify(testRun, null, 2));
101
+ };
102
+ const downloadPrDiffFromApi = async (client, debugContext, debugDataDir) => {
103
+ var _a, _b, _c;
104
+ if (!debugContext.testRunId) {
105
+ return;
106
+ }
107
+ console.log(chalk_1.default.cyan(` Downloading PR diff...`));
108
+ try {
109
+ const response = await (0, client_1.getPrDiff)({
110
+ client,
111
+ testRunId: debugContext.testRunId,
112
+ });
113
+ if (response.content && response.content.trim()) {
114
+ (0, fs_1.writeFileSync)((0, path_1.join)(debugDataDir, "pr-diff.txt"), response.content);
115
+ }
116
+ }
117
+ catch (error) {
118
+ const status = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status;
119
+ const serverMessage = (_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message;
120
+ const detail = serverMessage
121
+ ? `${status !== null && status !== void 0 ? status : "unknown"}: ${serverMessage}`
122
+ : error instanceof Error
123
+ ? error.message
124
+ : String(error);
125
+ console.warn(chalk_1.default.yellow(` Warning: Could not download PR diff (${detail}).`));
126
+ }
127
+ };
128
+ const inParallel = async (tasks, concurrency) => {
129
+ const results = [];
130
+ let index = 0;
131
+ const runNext = async () => {
132
+ while (index < tasks.length) {
133
+ const currentIndex = index++;
134
+ results[currentIndex] = await tasks[currentIndex]();
135
+ }
136
+ };
137
+ const workers = Array.from({ length: Math.min(concurrency, tasks.length) }, () => runNext());
138
+ await Promise.all(workers);
139
+ return results;
140
+ };
141
+ //# sourceMappingURL=download-debug-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-debug-data.js","sourceRoot":"","sources":["../src/download-debug-data.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA+E;AAC/E,+BAA4B;AAC5B,qDAKkC;AAClC,+EAG+C;AAC/C,kDAA0B;AAC1B,uDAAyD;AAGzD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAClD,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAehC,MAAM,iBAAiB,GAAG,KAAK,EACpC,OAAiC,EAClB,EAAE;;IACjB,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,OAAO,CAA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AM,MAAM,GAAG,aAAa;YAC1B,CAAC,CAAC,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,SAAS,KAAK,aAAa,EAAE;YAC5C,CAAC,CAAC,KAAK,YAAY,KAAK;gBACtB,CAAC,CAAC,KAAK,CAAC,OAAO;gBACf,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,CACV,eAAK,CAAC,MAAM,CAAC,0CAA0C,MAAM,IAAI,CAAC,CACnE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,KAAK,EACtB,KAA8B,EAC9B,WAAmB,EACL,EAAE;IAChB,MAAM,OAAO,GAAQ,EAAE,CAAC;IACxB,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,MAAM,OAAO,GAAG,KAAK,IAAmB,EAAE;QACxC,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,YAAY,GAAG,KAAK,EAAE,CAAC;YAC7B,OAAO,CAAC,YAAY,CAAC,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QACtD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACxB,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAC/C,GAAG,EAAE,CAAC,OAAO,EAAE,CAChB,CAAC;IACF,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { DebugContext } from "./debug.types";
2
+ export interface FileMetadataEntry {
3
+ path: string;
4
+ bytes: number;
5
+ lines: number;
6
+ }
7
+ export interface ScreenshotMapEntry {
8
+ replayId: string;
9
+ replayRole: string;
10
+ filename: string;
11
+ virtualTimeStart: number | null;
12
+ virtualTimeEnd: number | null;
13
+ eventNumber: number | null;
14
+ }
15
+ export interface ReplayComparisonEntry {
16
+ replayId: string;
17
+ role: string;
18
+ totalEvents: number | null;
19
+ totalNetworkRequests: number | null;
20
+ totalAnimationFrames: number | null;
21
+ totalVirtualTimeMs: number | null;
22
+ screenshotCount: number | null;
23
+ }
24
+ export interface GenerateDebugWorkspaceOptions {
25
+ debugContext: DebugContext;
26
+ workspaceDir: string;
27
+ projectRepoDir: string | undefined;
28
+ additionalTemplatesDir?: string | undefined;
29
+ writeContextJson?: ((debugContext: DebugContext, workspaceDir: string, fileMetadata: FileMetadataEntry[], projectRepoDir: string | undefined, screenshotMap: Record<string, ScreenshotMapEntry>, replayComparison: ReplayComparisonEntry[]) => void) | undefined;
30
+ }
31
+ export declare const generateDebugWorkspace: (options: GenerateDebugWorkspaceOptions) => void;