@testrelic/core 2.4.10 → 2.4.11-next.9
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.
- package/dist/index.cjs +301 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +777 -0
- package/dist/index.d.ts +777 -0
- package/dist/index.js +257 -0
- package/dist/index.js.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ATTACHMENT_CONTENT_TYPE: () => ATTACHMENT_CONTENT_TYPE,
|
|
24
|
+
ATTACHMENT_NAME: () => ATTACHMENT_NAME,
|
|
25
|
+
ErrorCode: () => ErrorCode,
|
|
26
|
+
PAYLOAD_VERSION: () => PAYLOAD_VERSION,
|
|
27
|
+
PAYLOAD_VERSION_LEGACY: () => PAYLOAD_VERSION_LEGACY,
|
|
28
|
+
TestRelicError: () => TestRelicError,
|
|
29
|
+
createError: () => createError,
|
|
30
|
+
createLogger: () => createLogger,
|
|
31
|
+
isTestRelicDataPayload: () => isTestRelicDataPayload,
|
|
32
|
+
isTestRelicFilePayload: () => isTestRelicFilePayload,
|
|
33
|
+
isValidApiKeyFormat: () => isValidApiKeyFormat,
|
|
34
|
+
isValidCloudConfig: () => isValidCloudConfig,
|
|
35
|
+
isValidConfig: () => isValidConfig,
|
|
36
|
+
isValidEndpointUrl: () => isValidEndpointUrl,
|
|
37
|
+
isValidNavigationType: () => isValidNavigationType,
|
|
38
|
+
isValidQueueEntry: () => isValidQueueEntry,
|
|
39
|
+
isValidTestRunReport: () => isValidTestRunReport,
|
|
40
|
+
isValidUploadStrategy: () => isValidUploadStrategy
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(index_exports);
|
|
43
|
+
|
|
44
|
+
// src/types.ts
|
|
45
|
+
var PAYLOAD_VERSION = "2.0.0";
|
|
46
|
+
var PAYLOAD_VERSION_LEGACY = "1.0.0";
|
|
47
|
+
var ATTACHMENT_NAME = "testrelic-data";
|
|
48
|
+
var ATTACHMENT_CONTENT_TYPE = "application/json";
|
|
49
|
+
function isTestRelicFilePayload(obj) {
|
|
50
|
+
if (typeof obj !== "object" || obj === null) return false;
|
|
51
|
+
const record = obj;
|
|
52
|
+
return record.testRelicData === true && record.version === "2.0.0" && Array.isArray(record.navigations) && Array.isArray(record.apiAssertions);
|
|
53
|
+
}
|
|
54
|
+
function isTestRelicDataPayload(obj) {
|
|
55
|
+
if (typeof obj !== "object" || obj === null) return false;
|
|
56
|
+
const record = obj;
|
|
57
|
+
return record.testRelicData === true && typeof record.version === "string" && record.version.length > 0 && Array.isArray(record.navigations) && Array.isArray(record.networkRequests) && Array.isArray(record.apiCalls) && Array.isArray(record.apiAssertions);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/logger.ts
|
|
61
|
+
var noopHandler = () => {
|
|
62
|
+
};
|
|
63
|
+
function createLogger(options) {
|
|
64
|
+
const handler = options?.handler ?? noopHandler;
|
|
65
|
+
return {
|
|
66
|
+
info(message, ...args) {
|
|
67
|
+
handler("info", message, args);
|
|
68
|
+
},
|
|
69
|
+
warn(message, ...args) {
|
|
70
|
+
handler("warn", message, args);
|
|
71
|
+
},
|
|
72
|
+
error(message, ...args) {
|
|
73
|
+
handler("error", message, args);
|
|
74
|
+
},
|
|
75
|
+
debug(message, ...args) {
|
|
76
|
+
handler("debug", message, args);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/errors.ts
|
|
82
|
+
var ErrorCode = {
|
|
83
|
+
CONFIG_INVALID: "TESTRELIC_CONFIG_INVALID",
|
|
84
|
+
OUTPUT_WRITE_FAILED: "TESTRELIC_OUTPUT_WRITE_FAILED",
|
|
85
|
+
MERGE_INVALID_SCHEMA: "TESTRELIC_MERGE_INVALID_SCHEMA",
|
|
86
|
+
MERGE_READ_FAILED: "TESTRELIC_MERGE_READ_FAILED",
|
|
87
|
+
NAVIGATION_FLUSH_FAILED: "TESTRELIC_NAVIGATION_FLUSH_FAILED",
|
|
88
|
+
CODE_EXTRACT_FAILED: "TESTRELIC_CODE_EXTRACT_FAILED",
|
|
89
|
+
HTML_REPORT_FAILED: "TESTRELIC_HTML_REPORT_FAILED",
|
|
90
|
+
CLOUD_AUTH_FAILED: "TESTRELIC_CLOUD_AUTH_FAILED",
|
|
91
|
+
CLOUD_UPLOAD_FAILED: "TESTRELIC_CLOUD_UPLOAD_FAILED",
|
|
92
|
+
CLOUD_CONFIG_INVALID: "TESTRELIC_CLOUD_CONFIG_INVALID",
|
|
93
|
+
CLOUD_QUEUE_FAILED: "TESTRELIC_CLOUD_QUEUE_FAILED"
|
|
94
|
+
};
|
|
95
|
+
var TestRelicError = class extends Error {
|
|
96
|
+
constructor(code, message, cause) {
|
|
97
|
+
super(message);
|
|
98
|
+
this.name = "TestRelicError";
|
|
99
|
+
this.code = code;
|
|
100
|
+
if (cause !== void 0) {
|
|
101
|
+
Object.defineProperty(this, "cause", { value: cause, writable: false, enumerable: false });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
function createError(code, message, cause) {
|
|
106
|
+
return new TestRelicError(code, message, cause);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/validation.ts
|
|
110
|
+
var NAVIGATION_TYPES = /* @__PURE__ */ new Set([
|
|
111
|
+
"goto",
|
|
112
|
+
"navigation",
|
|
113
|
+
"back",
|
|
114
|
+
"forward",
|
|
115
|
+
"refresh",
|
|
116
|
+
"spa_route",
|
|
117
|
+
"spa_replace",
|
|
118
|
+
"hash_change",
|
|
119
|
+
"link_click",
|
|
120
|
+
"form_submit",
|
|
121
|
+
"redirect",
|
|
122
|
+
"popstate",
|
|
123
|
+
"page_load",
|
|
124
|
+
"manual_record",
|
|
125
|
+
"fallback",
|
|
126
|
+
"dummy"
|
|
127
|
+
]);
|
|
128
|
+
var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
129
|
+
function isValidNavigationType(value) {
|
|
130
|
+
return typeof value === "string" && NAVIGATION_TYPES.has(value);
|
|
131
|
+
}
|
|
132
|
+
function hasNoPrototypePollution(obj) {
|
|
133
|
+
if (typeof obj !== "object" || obj === null) return true;
|
|
134
|
+
for (const key of Object.keys(obj)) {
|
|
135
|
+
if (DANGEROUS_KEYS.has(key)) return false;
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
function isValidConfig(input) {
|
|
140
|
+
if (typeof input !== "object" || input === null) return false;
|
|
141
|
+
if (!hasNoPrototypePollution(input)) return false;
|
|
142
|
+
const obj = input;
|
|
143
|
+
if (obj.outputPath !== void 0 && typeof obj.outputPath !== "string") return false;
|
|
144
|
+
if (obj.includeStackTrace !== void 0 && typeof obj.includeStackTrace !== "boolean") return false;
|
|
145
|
+
if (obj.includeCodeSnippets !== void 0 && typeof obj.includeCodeSnippets !== "boolean") return false;
|
|
146
|
+
if (obj.codeContextLines !== void 0 && typeof obj.codeContextLines !== "number") return false;
|
|
147
|
+
if (obj.includeNetworkStats !== void 0 && typeof obj.includeNetworkStats !== "boolean") return false;
|
|
148
|
+
if (obj.navigationTypes !== void 0 && obj.navigationTypes !== null) {
|
|
149
|
+
if (!Array.isArray(obj.navigationTypes)) return false;
|
|
150
|
+
for (const t of obj.navigationTypes) {
|
|
151
|
+
if (!isValidNavigationType(t)) return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (obj.redactPatterns !== void 0) {
|
|
155
|
+
if (!Array.isArray(obj.redactPatterns)) return false;
|
|
156
|
+
for (const p of obj.redactPatterns) {
|
|
157
|
+
if (typeof p !== "string" && !(p instanceof RegExp)) return false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (obj.testRunId !== void 0 && obj.testRunId !== null && typeof obj.testRunId !== "string") return false;
|
|
161
|
+
if (obj.metadata !== void 0 && obj.metadata !== null) {
|
|
162
|
+
if (typeof obj.metadata !== "object") return false;
|
|
163
|
+
if (!hasNoPrototypePollution(obj.metadata)) return false;
|
|
164
|
+
}
|
|
165
|
+
if (obj.openReport !== void 0 && typeof obj.openReport !== "boolean") return false;
|
|
166
|
+
if (obj.htmlReportPath !== void 0 && (typeof obj.htmlReportPath !== "string" || obj.htmlReportPath === "")) return false;
|
|
167
|
+
if (obj.includeArtifacts !== void 0 && typeof obj.includeArtifacts !== "boolean") return false;
|
|
168
|
+
if (obj.trackApiCalls !== void 0 && typeof obj.trackApiCalls !== "boolean") return false;
|
|
169
|
+
if (obj.captureRequestHeaders !== void 0 && typeof obj.captureRequestHeaders !== "boolean") return false;
|
|
170
|
+
if (obj.captureResponseHeaders !== void 0 && typeof obj.captureResponseHeaders !== "boolean") return false;
|
|
171
|
+
if (obj.captureRequestBody !== void 0 && typeof obj.captureRequestBody !== "boolean") return false;
|
|
172
|
+
if (obj.captureResponseBody !== void 0 && typeof obj.captureResponseBody !== "boolean") return false;
|
|
173
|
+
if (obj.captureAssertions !== void 0 && typeof obj.captureAssertions !== "boolean") return false;
|
|
174
|
+
if (obj.redactHeaders !== void 0) {
|
|
175
|
+
if (!Array.isArray(obj.redactHeaders)) return false;
|
|
176
|
+
for (const h of obj.redactHeaders) {
|
|
177
|
+
if (typeof h !== "string") return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (obj.redactBodyFields !== void 0) {
|
|
181
|
+
if (!Array.isArray(obj.redactBodyFields)) return false;
|
|
182
|
+
for (const f of obj.redactBodyFields) {
|
|
183
|
+
if (typeof f !== "string") return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (obj.apiIncludeUrls !== void 0) {
|
|
187
|
+
if (!Array.isArray(obj.apiIncludeUrls)) return false;
|
|
188
|
+
for (const p of obj.apiIncludeUrls) {
|
|
189
|
+
if (typeof p !== "string" && !(p instanceof RegExp)) return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (obj.apiExcludeUrls !== void 0) {
|
|
193
|
+
if (!Array.isArray(obj.apiExcludeUrls)) return false;
|
|
194
|
+
for (const p of obj.apiExcludeUrls) {
|
|
195
|
+
if (typeof p !== "string" && !(p instanceof RegExp)) return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
var API_KEY_PATTERN = /^tr[a-z]*_[a-z]+_[a-zA-Z0-9]+$/;
|
|
201
|
+
var UPLOAD_STRATEGIES = /* @__PURE__ */ new Set(["batch", "realtime", "both"]);
|
|
202
|
+
var LOCALHOST_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "0.0.0.0"]);
|
|
203
|
+
function isValidApiKeyFormat(value) {
|
|
204
|
+
return typeof value === "string" && API_KEY_PATTERN.test(value);
|
|
205
|
+
}
|
|
206
|
+
function isValidUploadStrategy(value) {
|
|
207
|
+
return typeof value === "string" && UPLOAD_STRATEGIES.has(value);
|
|
208
|
+
}
|
|
209
|
+
function isValidEndpointUrl(value) {
|
|
210
|
+
if (typeof value !== "string") return false;
|
|
211
|
+
try {
|
|
212
|
+
const url = new URL(value);
|
|
213
|
+
if (url.protocol === "https:") return true;
|
|
214
|
+
if (url.protocol === "http:" && LOCALHOST_HOSTS.has(url.hostname)) return true;
|
|
215
|
+
return false;
|
|
216
|
+
} catch {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function isValidCloudConfig(input) {
|
|
221
|
+
if (typeof input !== "object" || input === null) return false;
|
|
222
|
+
if (!hasNoPrototypePollution(input)) return false;
|
|
223
|
+
const obj = input;
|
|
224
|
+
if (obj.apiKey !== void 0 && obj.apiKey !== null) {
|
|
225
|
+
if (typeof obj.apiKey !== "string") return false;
|
|
226
|
+
if (obj.apiKey.length > 0 && !isValidApiKeyFormat(obj.apiKey)) return false;
|
|
227
|
+
}
|
|
228
|
+
if (obj.endpoint !== void 0) {
|
|
229
|
+
if (!isValidEndpointUrl(obj.endpoint)) return false;
|
|
230
|
+
}
|
|
231
|
+
if (obj.uploadStrategy !== void 0) {
|
|
232
|
+
if (!isValidUploadStrategy(obj.uploadStrategy)) return false;
|
|
233
|
+
}
|
|
234
|
+
if (obj.timeout !== void 0) {
|
|
235
|
+
if (typeof obj.timeout !== "number" || obj.timeout < 1e3 || obj.timeout > 12e4) return false;
|
|
236
|
+
}
|
|
237
|
+
if (obj.projectName !== void 0 && obj.projectName !== null && typeof obj.projectName !== "string") return false;
|
|
238
|
+
if (obj.queueMaxAge !== void 0) {
|
|
239
|
+
if (typeof obj.queueMaxAge !== "number" || obj.queueMaxAge < 36e5 || obj.queueMaxAge > 2592e6) return false;
|
|
240
|
+
}
|
|
241
|
+
if (obj.queueDirectory !== void 0) {
|
|
242
|
+
if (typeof obj.queueDirectory !== "string") return false;
|
|
243
|
+
if (obj.queueDirectory.startsWith("/") || obj.queueDirectory.includes("..")) return false;
|
|
244
|
+
}
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
function isValidQueueEntry(input) {
|
|
248
|
+
if (typeof input !== "object" || input === null) return false;
|
|
249
|
+
if (!hasNoPrototypePollution(input)) return false;
|
|
250
|
+
const obj = input;
|
|
251
|
+
if (typeof obj.version !== "string") return false;
|
|
252
|
+
if (typeof obj.queuedAt !== "string") return false;
|
|
253
|
+
if (typeof obj.reason !== "string") return false;
|
|
254
|
+
if (typeof obj.retryCount !== "number") return false;
|
|
255
|
+
if (typeof obj.targetEndpoint !== "string") return false;
|
|
256
|
+
if (typeof obj.method !== "string") return false;
|
|
257
|
+
if (typeof obj.payload !== "object" || obj.payload === null) return false;
|
|
258
|
+
if (typeof obj.headers !== "object" || obj.headers === null) return false;
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
function isValidTestRunReport(value) {
|
|
262
|
+
if (typeof value !== "object" || value === null) return false;
|
|
263
|
+
const obj = value;
|
|
264
|
+
if (typeof obj.schemaVersion !== "string") return false;
|
|
265
|
+
if (typeof obj.testRunId !== "string") return false;
|
|
266
|
+
if (typeof obj.startedAt !== "string") return false;
|
|
267
|
+
if (typeof obj.completedAt !== "string") return false;
|
|
268
|
+
if (typeof obj.totalDuration !== "number") return false;
|
|
269
|
+
if (typeof obj.summary !== "object" || obj.summary === null) return false;
|
|
270
|
+
if (!Array.isArray(obj.timeline)) return false;
|
|
271
|
+
const summary = obj.summary;
|
|
272
|
+
if (typeof summary.total !== "number") return false;
|
|
273
|
+
if (typeof summary.passed !== "number") return false;
|
|
274
|
+
if (typeof summary.failed !== "number") return false;
|
|
275
|
+
if (typeof summary.flaky !== "number") return false;
|
|
276
|
+
if (typeof summary.skipped !== "number") return false;
|
|
277
|
+
if (summary.timedout !== void 0 && typeof summary.timedout !== "number") return false;
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
281
|
+
0 && (module.exports = {
|
|
282
|
+
ATTACHMENT_CONTENT_TYPE,
|
|
283
|
+
ATTACHMENT_NAME,
|
|
284
|
+
ErrorCode,
|
|
285
|
+
PAYLOAD_VERSION,
|
|
286
|
+
PAYLOAD_VERSION_LEGACY,
|
|
287
|
+
TestRelicError,
|
|
288
|
+
createError,
|
|
289
|
+
createLogger,
|
|
290
|
+
isTestRelicDataPayload,
|
|
291
|
+
isTestRelicFilePayload,
|
|
292
|
+
isValidApiKeyFormat,
|
|
293
|
+
isValidCloudConfig,
|
|
294
|
+
isValidConfig,
|
|
295
|
+
isValidEndpointUrl,
|
|
296
|
+
isValidNavigationType,
|
|
297
|
+
isValidQueueEntry,
|
|
298
|
+
isValidTestRunReport,
|
|
299
|
+
isValidUploadStrategy
|
|
300
|
+
});
|
|
301
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/logger.ts","../src/errors.ts","../src/validation.ts"],"sourcesContent":["// @testrelic/core — barrel export\n// Re-exports only, no implementation (Constitution II)\n\nexport type {\n NavigationType,\n TestRunReport,\n Summary,\n CIMetadata,\n CIProvider,\n TimelineEntry,\n TestResult,\n TestStatus,\n TestType,\n FailureDiagnostic,\n NetworkStats,\n ResourceBreakdown,\n ResourceType,\n CapturedNetworkRequest,\n ApiCallRecord,\n ApiAssertion,\n AssertionType,\n AssertionLocation,\n ReporterConfig,\n TestArtifacts,\n NavigationAnnotation,\n MergeOptions,\n StepTestIdentity,\n ApiCallStepRequest,\n ApiCallStepResponse,\n StepAssertion,\n NavigationStep,\n ApiCallStep,\n TimelineStep,\n ActionStep,\n ActionCategory,\n ConsoleLogEntry,\n ConsoleLogLevel,\n TestRelicDataPayload,\n TestRelicFilePayload,\n CloudConfig,\n AuthState,\n AuthMode,\n GitMetadata,\n RepoResolution,\n QueueEntry,\n UploadStrategy,\n CloudReporterOptions,\n ArtifactFile,\n ArtifactTestEntry,\n ArtifactRunEntry,\n ArtifactRunManifest,\n ReportMode,\n TestIndexEntry,\n TestDetailData,\n StreamingReportSummary,\n StreamingFileStats,\n StreamingValidation,\n StreamingWriteError,\n StreamingReportManifest,\n} from './types.js';\n\nexport {\n PAYLOAD_VERSION,\n PAYLOAD_VERSION_LEGACY,\n ATTACHMENT_NAME,\n ATTACHMENT_CONTENT_TYPE,\n isTestRelicDataPayload,\n isTestRelicFilePayload,\n} from './types.js';\n\nexport type { Logger, LoggerOptions, LogLevel } from './logger.js';\nexport { createLogger } from './logger.js';\n\nexport { ErrorCode, TestRelicError, createError } from './errors.js';\n\nexport {\n isValidConfig,\n isValidNavigationType,\n isValidTestRunReport,\n isValidCloudConfig,\n isValidApiKeyFormat,\n isValidEndpointUrl,\n isValidUploadStrategy,\n isValidQueueEntry,\n} from './validation.js';\n","/**\n * @testrelic/core — Shared type definitions\n *\n * All interfaces for the JSON output schema, reporter configuration,\n * and internal fixture-to-reporter communication.\n *\n * Schema Version: 1.0.0\n */\n\n// ---------------------------------------------------------------------------\n// Navigation Types\n// ---------------------------------------------------------------------------\n\nexport type NavigationType =\n | 'goto'\n | 'navigation'\n | 'back'\n | 'forward'\n | 'refresh'\n | 'spa_route'\n | 'spa_replace'\n | 'hash_change'\n | 'link_click'\n | 'form_submit'\n | 'redirect'\n | 'popstate'\n | 'page_load'\n | 'manual_record'\n | 'fallback'\n | 'dummy';\n\n// ---------------------------------------------------------------------------\n// Output Schema Types (JSON report structure)\n// ---------------------------------------------------------------------------\n\nexport interface TestRunReport {\n readonly schemaVersion: string;\n readonly testRunId: string;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly totalDuration: number;\n readonly summary: Summary;\n readonly ci: CIMetadata | null;\n readonly metadata: Record<string, unknown> | null;\n readonly timeline: readonly (TimelineEntry | TimelineStep)[];\n readonly shardRunIds: string[] | null;\n}\n\n/** Breakdown of API calls by HTTP response status range. */\nexport interface ApiCallsByStatusRange {\n readonly '2xx': number;\n readonly '3xx': number;\n readonly '4xx': number;\n readonly '5xx': number;\n readonly error: number;\n}\n\n/** Statistical distribution of API call response times in milliseconds. */\nexport interface ApiResponseTimeStats {\n readonly avg: number;\n readonly min: number;\n readonly max: number;\n readonly p50: number;\n readonly p95: number;\n readonly p99: number;\n}\n\nexport interface Summary {\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly flaky: number;\n readonly skipped: number;\n readonly timedout: number;\n readonly totalApiCalls: number;\n readonly uniqueApiUrls: number;\n readonly apiCallsByMethod: Record<string, number>;\n readonly apiCallsByStatusRange: ApiCallsByStatusRange;\n readonly apiResponseTime: ApiResponseTimeStats | null;\n readonly totalAssertions: number;\n readonly passedAssertions: number;\n readonly failedAssertions: number;\n readonly totalNavigations: number;\n readonly uniqueNavigationUrls: number;\n readonly totalTimelineSteps: number;\n readonly totalActionSteps: number;\n readonly actionStepsByCategory: Record<string, number>;\n}\n\nexport interface CIMetadata {\n readonly provider: CIProvider;\n readonly buildId: string | null;\n readonly commitSha: string | null;\n readonly branch: string | null;\n readonly runUrl: string | null;\n}\n\nexport type CIProvider =\n | 'github-actions'\n | 'gitlab-ci'\n | 'jenkins'\n | 'circleci'\n | 'bitbucket-pipelines'\n | 'unknown';\n\nexport interface TimelineEntry {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly visitedAt: string;\n readonly duration: number;\n readonly specFile: string;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly tests: TestResult[];\n}\n\nexport interface TestResult {\n readonly title: string;\n readonly status: TestStatus;\n readonly duration: number;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly retryCount: number;\n readonly tags: string[];\n readonly failure: FailureDiagnostic | null;\n readonly testId: string;\n readonly filePath: string;\n readonly suiteName: string;\n readonly testType: TestType;\n readonly isFlaky: boolean;\n readonly retryStatus: string | null;\n readonly expectedStatus: TestStatus;\n readonly actualStatus: TestStatus;\n readonly artifacts: TestArtifacts | null;\n readonly networkRequests: CapturedNetworkRequest[] | null;\n readonly apiCalls: readonly ApiCallRecord[] | null;\n readonly apiAssertions: readonly ApiAssertion[] | null;\n readonly actions: readonly ActionStep[] | null;\n readonly consoleLogs: readonly ConsoleLogEntry[] | null;\n}\n\nexport type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';\n\nexport interface CapturedNetworkRequest {\n readonly url: string;\n readonly method: string;\n readonly resourceType: ResourceType;\n readonly statusCode: number;\n readonly responseTimeMs: number;\n readonly startedAt: string;\n readonly requestHeaders: Record<string, string> | null;\n readonly requestBody: string | null;\n readonly responseBody: string | null;\n readonly responseHeaders: Record<string, string> | null;\n readonly contentType: string | null;\n readonly responseSize: number;\n readonly requestBodyTruncated: boolean;\n readonly responseBodyTruncated: boolean;\n readonly isBinary: boolean;\n readonly error: string | null;\n}\n\nexport interface TestArtifacts {\n readonly screenshot?: string;\n readonly video?: string;\n readonly screenshotKey?: string;\n readonly videoKey?: string;\n}\n\nexport type TestStatus = 'passed' | 'failed' | 'skipped' | 'flaky' | 'timedout';\n\nexport type TestType = 'e2e' | 'api' | 'unit' | 'mobile' | 'unknown';\n\nexport interface FailureDiagnostic {\n readonly message: string;\n readonly line: number | null;\n readonly code: string | null;\n readonly stack: string | null;\n}\n\nexport interface NetworkStats {\n readonly totalRequests: number;\n readonly failedRequests: number;\n readonly failedRequestUrls: string[];\n readonly totalBytes: number;\n readonly byType: ResourceBreakdown;\n}\n\nexport interface ResourceBreakdown {\n readonly xhr: number;\n readonly document: number;\n readonly script: number;\n readonly stylesheet: number;\n readonly image: number;\n readonly font: number;\n readonly other: number;\n}\n\n// ---------------------------------------------------------------------------\n// API Call Record (captured from Playwright APIRequestContext proxy)\n// ---------------------------------------------------------------------------\n\nexport interface ApiCallRecord {\n /** Unique call identifier within the test (e.g., \"api-call-0\") */\n readonly id: string;\n /** ISO 8601 timestamp when the call was initiated */\n readonly timestamp: string;\n /** HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, or custom via fetch() */\n readonly method: string;\n /** Full resolved URL (after baseURL resolution by Playwright) */\n readonly url: string;\n /** All request headers sent, or null if unavailable */\n readonly requestHeaders: Record<string, string> | null;\n /** Request payload as string (JSON-serialized for objects). Null for bodiless methods */\n readonly requestBody: string | null;\n /** HTTP response status code, or null if request errored before response */\n readonly responseStatusCode: number | null;\n /** HTTP response status text, or null if request errored before response */\n readonly responseStatusText: string | null;\n /** All response headers received, or null if request errored before response */\n readonly responseHeaders: Record<string, string> | null;\n /** Response body: string for text/JSON, base64 for binary. Null on error */\n readonly responseBody: string | null;\n /** Duration in milliseconds from request initiation to response received */\n readonly responseTimeMs: number;\n /** Whether the response body is stored as a base64-encoded binary string */\n readonly isBinary: boolean;\n /** Error message if the call failed (network error, timeout), null on success */\n readonly error: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// API Assertion Types (captured from assertion tracking)\n// ---------------------------------------------------------------------------\n\n/** Categorization of the assertion being made. */\nexport type AssertionType =\n | 'status'\n | 'statusOk'\n | 'header'\n | 'bodyField'\n | 'bodyMatch'\n | 'bodyContains'\n | 'custom';\n\n/** Source location where an assertion was made in the test file. */\nexport interface AssertionLocation {\n /** Absolute or relative file path to the test file */\n readonly file: string;\n /** Line number (1-based) */\n readonly line: number;\n /** Column number (1-based), if available */\n readonly column?: number;\n}\n\n/** A single captured assertion on API response data. */\nexport interface ApiAssertion {\n /** Links to ApiCallRecord.id from the API proxy */\n readonly callId: string;\n /** Category of assertion */\n readonly type: AssertionType;\n /** What the test expected */\n readonly expected: unknown;\n /** What was actually received */\n readonly actual: unknown;\n /** Whether the assertion passed or failed */\n readonly status: 'passed' | 'failed';\n /** Source location of the assertion in the test file */\n readonly location: AssertionLocation;\n /** String representation of the assertion expression (best-effort) */\n readonly expression?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Unified Timeline Types (navigation + API call steps)\n// ---------------------------------------------------------------------------\n\n/** Test identity block attached to every timeline step. */\nexport interface StepTestIdentity {\n readonly title: string;\n readonly fullTitle: readonly string[];\n readonly status: TestStatus;\n readonly duration: number;\n readonly retries: number;\n readonly retry: number;\n readonly tags: readonly string[];\n readonly failure: FailureDiagnostic | null;\n}\n\n/** Request details within an API call step. */\nexport interface ApiCallStepRequest {\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** Response details within an API call step. */\nexport interface ApiCallStepResponse {\n readonly statusCode: number;\n readonly statusText: string;\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** An assertion linked to an API call step (callId omitted — implicit from parent). */\nexport interface StepAssertion {\n readonly type: AssertionType;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly status: 'passed' | 'failed';\n readonly location: AssertionLocation;\n readonly expression?: string;\n}\n\n/** A browser navigation event in the unified timeline. */\nexport interface NavigationStep {\n readonly index: number;\n readonly type: 'navigation';\n readonly url: string;\n readonly timestamp: string;\n readonly durationOnUrl: number;\n readonly navigationType: NavigationType;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** An API request event in the unified timeline. */\nexport interface ApiCallStep {\n readonly index: number;\n readonly type: 'api_call';\n readonly callId: string;\n readonly method: string;\n readonly url: string;\n readonly timestamp: string;\n readonly responseTime: number | null;\n readonly request: ApiCallStepRequest;\n readonly response: ApiCallStepResponse | null;\n readonly error?: string | null;\n readonly assertions: readonly StepAssertion[];\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** Discriminated union of all timeline step types. */\nexport type TimelineStep = NavigationStep | ApiCallStep;\n\n// ---------------------------------------------------------------------------\n// Action Step Types (Playwright test step capture)\n// ---------------------------------------------------------------------------\n\n/** Categorized type of a captured test action. */\nexport type ActionCategory = 'ui_action' | 'assertion' | 'custom_step';\n\n/** A single captured test action step. */\nexport interface ActionStep {\n readonly title: string;\n readonly category: ActionCategory;\n readonly timestamp: string;\n readonly duration: number;\n readonly videoOffset: number | null;\n readonly status: 'passed' | 'failed';\n readonly error: string | null;\n readonly children: readonly ActionStep[];\n}\n\n// ---------------------------------------------------------------------------\n// Console Log Types (browser console + terminal stdout/stderr)\n// ---------------------------------------------------------------------------\n\n/** Level of a captured console/terminal log message. */\nexport type ConsoleLogLevel = 'log' | 'warn' | 'error' | 'info' | 'debug' | 'stdout' | 'stderr';\n\n/** A single captured console or terminal log entry. */\nexport interface ConsoleLogEntry {\n /** Log level or stream type */\n readonly level: ConsoleLogLevel;\n /** Text content of the log message */\n readonly text: string;\n /** ISO 8601 timestamp when the log was captured */\n readonly timestamp: string;\n /** Source file location (browser console only, best-effort) */\n readonly location: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// Configuration Types (reporter tuple options)\n// ---------------------------------------------------------------------------\n\n/** Report generation mode. */\nexport type ReportMode = 'streaming' | 'embedded' | 'auto';\n\nexport interface ReporterConfig {\n readonly outputPath?: string;\n readonly includeStackTrace?: boolean;\n readonly includeCodeSnippets?: boolean;\n readonly codeContextLines?: number;\n readonly includeNetworkStats?: boolean;\n readonly navigationTypes?: NavigationType[] | null;\n readonly redactPatterns?: (string | RegExp)[];\n readonly testRunId?: string | null;\n readonly metadata?: Record<string, unknown> | null;\n readonly openReport?: boolean;\n readonly htmlReportPath?: string;\n readonly includeArtifacts?: boolean;\n /** When false, disables API call interception in the unified fixture. Default: true */\n readonly trackApiCalls?: boolean;\n /** When true, suppresses console summary output. Default: false */\n readonly quiet?: boolean;\n /** When true, captures Playwright test steps (actions). Default: true */\n readonly includeActionSteps?: boolean;\n /** Capture request headers for API calls. Default: true */\n readonly captureRequestHeaders?: boolean;\n /** Capture response headers for API calls. Default: true */\n readonly captureResponseHeaders?: boolean;\n /** Capture request body for API calls. Default: true */\n readonly captureRequestBody?: boolean;\n /** Capture response body for API calls. Default: true */\n readonly captureResponseBody?: boolean;\n /** Capture API assertions (both pass and fail). Default: true */\n readonly captureAssertions?: boolean;\n /**\n * Header names whose values are replaced with \"[REDACTED]\".\n * Case-insensitive matching. Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key']\n */\n readonly redactHeaders?: string[];\n /**\n * Body field names whose values are replaced with \"[REDACTED]\" at any depth.\n * Default: ['password', 'secret', 'token', 'apiKey', 'api_key']\n */\n readonly redactBodyFields?: string[];\n /**\n * Only track API calls matching these URL patterns.\n * Default: undefined (track all)\n */\n readonly apiIncludeUrls?: (string | RegExp)[];\n /**\n * Exclude API calls matching these URL patterns. Takes precedence over include.\n * Default: undefined (exclude none)\n */\n readonly apiExcludeUrls?: (string | RegExp)[];\n /** Capture browser console logs (E2E) and terminal output (API). Default: true */\n readonly captureConsoleLogs?: boolean;\n /** Cloud integration configuration. Default: undefined (local mode) */\n readonly cloud?: CloudReporterOptions;\n /**\n * Report generation mode.\n * - `'embedded'`: All data embedded in a single HTML file (current behavior)\n * - `'streaming'`: Data streamed to disk per-test, served via local server\n * - `'auto'`: Use embedded for < streamingThreshold tests, streaming otherwise\n * Default: `'auto'`\n */\n readonly reportMode?: ReportMode;\n /**\n * Test count threshold for auto mode. When the suite has >= this many tests,\n * streaming mode is used. Default: 500\n */\n readonly streamingThreshold?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Internal Types (fixture → reporter communication)\n// ---------------------------------------------------------------------------\n\nexport interface NavigationAnnotation {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly timestamp: string;\n readonly domContentLoadedAt?: string;\n readonly networkIdleAt?: string;\n readonly networkStats?: NetworkStats;\n}\n\n// ---------------------------------------------------------------------------\n// Worker-Safe Data Payload (worker → reporter communication)\n// ---------------------------------------------------------------------------\n\n/** Consolidated data payload sent from a worker fixture to the reporter. */\nexport interface TestRelicDataPayload {\n /** Marker to identify TestRelic attachments. Always `true`. */\n readonly testRelicData: true;\n /** Payload format version (semver). */\n readonly version: string;\n /** Navigation events collected during the test. */\n readonly navigations: readonly NavigationAnnotation[];\n /** Captured network requests during the test. */\n readonly networkRequests: readonly CapturedNetworkRequest[];\n /** API calls made via APIRequestContext proxy. */\n readonly apiCalls: readonly ApiCallRecord[];\n /** Assertions captured on API responses. */\n readonly apiAssertions: readonly ApiAssertion[];\n /** Console/terminal logs captured during the test. Optional for backward compat. */\n readonly consoleLogs?: readonly ConsoleLogEntry[];\n}\n\n/** Current payload format version. */\nexport const PAYLOAD_VERSION = '2.0.0';\n\n/** Legacy payload version (pre-streaming). */\nexport const PAYLOAD_VERSION_LEGACY = '1.0.0';\n\n/** Attachment name used for the consolidated payload. */\nexport const ATTACHMENT_NAME = 'testrelic-data';\n\n/** Attachment content type. */\nexport const ATTACHMENT_CONTENT_TYPE = 'application/json';\n\n/**\n * File-based data payload (v2.0.0).\n *\n * Heavy data (network requests, console logs, API calls) is written to\n * JSONL files on disk and referenced by path. Only lightweight data\n * (navigations, assertions) is kept inline.\n */\nexport interface TestRelicFilePayload {\n /** Marker to identify TestRelic attachments. Always `true`. */\n readonly testRelicData: true;\n /** Payload format version — `\"2.0.0\"` for file-based payloads. */\n readonly version: '2.0.0';\n /** Navigation events (small, kept inline). */\n readonly navigations: readonly NavigationAnnotation[];\n /** API assertions (small, kept inline). */\n readonly apiAssertions: readonly ApiAssertion[];\n /** Absolute path to JSONL file containing CapturedNetworkRequest items. */\n readonly networkRequestsFile: string | null;\n /** Number of network request items in the file. */\n readonly networkRequestsCount: number;\n /** Absolute path to JSONL file containing ConsoleLogEntry items. */\n readonly consoleLogsFile: string | null;\n /** Number of console log items in the file. */\n readonly consoleLogsCount: number;\n /** Absolute path to JSONL file containing ApiCallRecord items. */\n readonly apiCallsFile: string | null;\n /** Number of API call items in the file. */\n readonly apiCallsCount: number;\n}\n\n/** Type guard: validates that a parsed object is a v2 file-based payload. */\nexport function isTestRelicFilePayload(obj: unknown): obj is TestRelicFilePayload {\n if (typeof obj !== 'object' || obj === null) return false;\n const record = obj as Record<string, unknown>;\n return (\n record.testRelicData === true &&\n record.version === '2.0.0' &&\n Array.isArray(record.navigations) &&\n Array.isArray(record.apiAssertions)\n );\n}\n\n/** Type guard: validates that a parsed object is a v1 inline data payload. */\nexport function isTestRelicDataPayload(obj: unknown): obj is TestRelicDataPayload {\n if (typeof obj !== 'object' || obj === null) return false;\n const record = obj as Record<string, unknown>;\n return (\n record.testRelicData === true &&\n typeof record.version === 'string' &&\n record.version.length > 0 &&\n Array.isArray(record.navigations) &&\n Array.isArray(record.networkRequests) &&\n Array.isArray(record.apiCalls) &&\n Array.isArray(record.apiAssertions)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Cloud Integration Types\n// ---------------------------------------------------------------------------\n\n/** Upload strategy for cloud timeline data. */\nexport type UploadStrategy = 'batch' | 'realtime' | 'both';\n\n/** Current cloud/local operating mode. */\nexport type AuthMode = 'cloud' | 'local' | 'pending';\n\n/** Resolved cloud configuration, immutable after initialization. */\nexport interface CloudConfig {\n readonly apiKey: string | null;\n readonly endpoint: string;\n readonly uploadStrategy: UploadStrategy;\n readonly timeout: number;\n readonly projectName: string | null;\n readonly queueMaxAge: number;\n readonly queueDirectory: string;\n readonly uploadArtifacts: boolean;\n readonly artifactMaxSizeMb: number;\n}\n\n/** Mutable auth state tracked by the cloud client. */\nexport interface AuthState {\n mode: AuthMode;\n accessToken: string | null;\n refreshToken: string | null;\n expiresAt: number | null;\n orgId: string | null;\n orgName: string | null;\n userId: string | null;\n userName: string | null;\n}\n\n/** Auto-collected git information. All fields nullable. */\nexport interface GitMetadata {\n readonly branch: string | null;\n readonly commitSha: string | null;\n readonly commitMessage: string | null;\n readonly commitAuthor: string | null;\n readonly remoteUrl: string | null;\n}\n\n/** Cached repo identity. */\nexport interface RepoResolution {\n readonly repoId: string;\n readonly gitId: string;\n readonly displayName: string;\n readonly resolvedAt: number;\n readonly apiKeyHash: string;\n}\n\n/** A single queued upload payload. */\nexport interface QueueEntry {\n readonly version: string;\n readonly queuedAt: string;\n readonly reason: string;\n readonly retryCount: number;\n readonly targetEndpoint: string;\n readonly method: string;\n readonly payload: Record<string, unknown>;\n readonly headers: Record<string, string>;\n}\n\n/** Inline cloud configuration accepted via reporter options. */\nexport interface CloudReporterOptions {\n readonly apiKey?: string;\n readonly endpoint?: string;\n readonly upload?: UploadStrategy;\n readonly timeout?: number;\n readonly projectName?: string;\n readonly queueMaxAge?: string;\n readonly queueDirectory?: string;\n readonly uploadArtifacts?: boolean;\n readonly artifactMaxSizeMb?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Merge CLI Types\n// ---------------------------------------------------------------------------\n\nexport interface MergeOptions {\n readonly output: string;\n readonly testRunId?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Artifact Management Types\n// ---------------------------------------------------------------------------\n\n/** A single artifact file within a test's artifact folder. */\nexport interface ArtifactFile {\n /** File name (e.g., `screenshot.png`, `video.webm`) */\n readonly name: string;\n /** Artifact type for rendering */\n readonly type: 'screenshot' | 'video' | 'other';\n /** Path relative to the report output directory */\n readonly relativePath: string;\n /** File size in bytes */\n readonly sizeBytes: number;\n}\n\n/** A single test's artifacts within a run folder. */\nexport interface ArtifactTestEntry {\n /** Sanitized test folder name */\n readonly testName: string;\n /** List of artifact files for this test */\n readonly files: readonly ArtifactFile[];\n}\n\n/** A single test run's artifact folder in the manifest. */\nexport interface ArtifactRunEntry {\n /** Timestamp-based folder name (e.g., `2026-03-02T14-30-00`) */\n readonly folderName: string;\n /** ISO 8601 timestamp parsed from folder name */\n readonly timestamp: string;\n /** Sum of all file sizes in this run folder */\n readonly totalSizeBytes: number;\n /** Number of test artifact subdirectories */\n readonly testCount: number;\n /** Per-test artifact details */\n readonly tests: readonly ArtifactTestEntry[];\n /** Whether this folder belongs to the current report's run */\n readonly isCurrentRun: boolean;\n}\n\n/** Top-level manifest structure written as `artifact-manifest.json`. */\nexport interface ArtifactRunManifest {\n /** Manifest schema version (starts at `\"1.0\"`) */\n readonly schemaVersion: string;\n /** ISO 8601 timestamp of manifest generation */\n readonly generatedAt: string;\n /** Relative path to artifacts directory from report (e.g., `\"artifacts\"`) */\n readonly artifactBaseDir: string;\n /** Sum of all run folder sizes */\n readonly totalSizeBytes: number;\n /** All discovered run folders, sorted newest first */\n readonly runs: readonly ArtifactRunEntry[];\n /** Port of the artifact management server, or null if not running */\n readonly serverPort: number | null;\n}\n\n// ---------------------------------------------------------------------------\n// Streaming Report Types (server-backed reporter)\n// ---------------------------------------------------------------------------\n\n/** Compact index entry for a single test — kept in memory during run. */\nexport interface TestIndexEntry {\n /** Deterministic hash ID (first 12 chars of SHA-256) */\n readonly id: string;\n /** Test title (leaf name) */\n readonly title: string;\n /** Full title path (describe blocks + test name) */\n readonly titlePath: readonly string[];\n /** Relative path to test file */\n readonly filePath: string;\n /** Test outcome */\n readonly status: TestStatus;\n /** Test duration in milliseconds */\n readonly duration: number;\n /** Playwright project name */\n readonly project: string;\n /** Retry attempt number (0 = first run) */\n readonly retryIndex: number;\n /** Test tags */\n readonly tags: readonly string[];\n /** Whether this test has network request data */\n readonly hasNetworkData: boolean;\n /** Whether this test has console log data */\n readonly hasConsoleData: boolean;\n /** Whether this test has screenshot/video artifacts */\n readonly hasArtifacts: boolean;\n /** Whether this test has action step data */\n readonly hasActionSteps: boolean;\n /** First line of error message (failed/flaky tests only) */\n readonly errorMessage: string | null;\n /** Number of network requests captured */\n readonly networkCount: number;\n /** Number of console log entries captured */\n readonly consoleCount: number;\n /** Number of action steps captured */\n readonly actionCount: number;\n /** Whether this is a retry attempt (not the final attempt) */\n readonly isRetry: boolean;\n}\n\n/**\n * Full detail data for a single test, stored on disk.\n *\n * In v3 (stream-to-disk), heavy data (network requests, console logs,\n * API calls) is stored in separate JSONL files alongside meta.json.\n * The `has*` and `*Count` fields indicate availability without loading.\n */\nexport interface TestDetailData {\n /** Same as TestIndexEntry.id */\n readonly id: string;\n /** Page navigation events (inline — typically small) */\n readonly navigations: readonly NavigationAnnotation[];\n /** API assertion results (inline — typically small) */\n readonly apiAssertions: readonly ApiAssertion[];\n /** Nested action step tree (inline — typically small) */\n readonly actions: readonly ActionStep[];\n /** References to screenshot/video files */\n readonly artifacts: TestArtifacts | null;\n /** Error details for failed/flaky tests */\n readonly failureDiagnostic: FailureDiagnostic | null;\n /** Whether network.jsonl exists for this test */\n readonly hasNetworkFile: boolean;\n /** Number of items in network.jsonl */\n readonly networkRequestsCount: number;\n /** Whether console.jsonl exists for this test */\n readonly hasConsoleFile: boolean;\n /** Number of items in console.jsonl */\n readonly consoleLogsCount: number;\n /** Whether api-calls.jsonl exists for this test */\n readonly hasApiCallsFile: boolean;\n /** Number of items in api-calls.jsonl */\n readonly apiCallsCount: number;\n /** Test start time (ISO 8601) — used for video sync */\n readonly startedAt?: string;\n}\n\n/** Streaming report summary — running counters written to summary.json. */\nexport interface StreamingReportSummary {\n /** Unique run identifier */\n readonly testRunId: string;\n /** ISO 8601 start timestamp */\n readonly startedAt: string;\n /** ISO 8601 completion timestamp */\n readonly completedAt: string;\n /** Wall-clock duration in ms */\n readonly totalDuration: number;\n /** Total number of test results */\n readonly total: number;\n /** Tests that passed */\n readonly passed: number;\n /** Tests that failed */\n readonly failed: number;\n /** Tests that passed on retry */\n readonly flaky: number;\n /** Tests that were skipped */\n readonly skipped: number;\n /** Tests that timed out */\n readonly timedOut: number;\n /** Tests that were interrupted */\n readonly interrupted: number;\n /** Total API calls across all tests */\n readonly totalApiCalls: number;\n /** Total assertions across all tests */\n readonly totalAssertions: number;\n /** Total page navigations */\n readonly totalNavigations: number;\n /** Total network requests captured */\n readonly totalNetworkRequests: number;\n /** Total console log entries captured */\n readonly totalConsoleLogs: number;\n /** Total action steps captured */\n readonly totalActionSteps: number;\n /** User-provided metadata */\n readonly metadata: Record<string, unknown> | null;\n /** Report generation mode */\n readonly reportMode: ReportMode;\n /** Per-file aggregation */\n readonly files: readonly StreamingFileStats[];\n /** Enriched summary (matches existing Summary interface) */\n readonly enrichedSummary: Summary | null;\n /** Validation cross-check data */\n readonly validation: StreamingValidation | null;\n /** Write errors encountered during streaming */\n readonly writeErrors: readonly StreamingWriteError[];\n}\n\n/** Per-file test aggregation for streaming reports. */\nexport interface StreamingFileStats {\n readonly filePath: string;\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly flaky: number;\n readonly skipped: number;\n readonly timedOut: number;\n}\n\n/** Validation cross-check between reporter counts and Playwright. */\nexport interface StreamingValidation {\n readonly reporterTotal: number;\n readonly indexTotal: number;\n readonly playwrightStatus: string;\n readonly isValid: boolean;\n}\n\n/** A write error that occurred during streaming. */\nexport interface StreamingWriteError {\n readonly testId: string;\n readonly error: string;\n readonly timestamp: string;\n}\n\n/** Top-level manifest for a streaming report directory. */\nexport interface StreamingReportManifest {\n /** Schema version (`\"2.0\"` for streaming format) */\n readonly schemaVersion: string;\n /** ISO 8601 generation timestamp */\n readonly generatedAt: string;\n /** Report generation mode */\n readonly reportMode: ReportMode;\n /** Relative path to summary.json */\n readonly summaryFile: string;\n /** Relative path to index.json */\n readonly indexFile: string;\n /** Relative path to tests/ directory */\n readonly testsDir: string;\n /** Relative path to artifacts/ directory */\n readonly artifactsDir: string;\n /** Total number of test detail files */\n readonly testCount: number;\n /** Total size of all report data on disk */\n readonly totalSizeBytes: number;\n}\n","/**\n * @testrelic/core — Configurable logger\n *\n * Provides a Logger interface with a no-op default.\n * Never uses console.* directly (Constitution SDK Constraint).\n */\n\nexport interface Logger {\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n debug(message: string, ...args: unknown[]): void;\n}\n\nexport interface LoggerOptions {\n readonly handler?: (level: LogLevel, message: string, args: unknown[]) => void;\n}\n\nexport type LogLevel = 'info' | 'warn' | 'error' | 'debug';\n\ntype LogHandler = (level: LogLevel, message: string, args: unknown[]) => void;\n\nconst noopHandler: LogHandler = () => {};\n\nexport function createLogger(options?: LoggerOptions): Logger {\n const handler = options?.handler ?? noopHandler;\n\n return {\n info(message: string, ...args: unknown[]) {\n handler('info', message, args);\n },\n warn(message: string, ...args: unknown[]) {\n handler('warn', message, args);\n },\n error(message: string, ...args: unknown[]) {\n handler('error', message, args);\n },\n debug(message: string, ...args: unknown[]) {\n handler('debug', message, args);\n },\n };\n}\n","/**\n * @testrelic/core — Structured error factory\n *\n * Machine-readable error codes for programmatic handling.\n */\n\nexport const ErrorCode = {\n CONFIG_INVALID: 'TESTRELIC_CONFIG_INVALID',\n OUTPUT_WRITE_FAILED: 'TESTRELIC_OUTPUT_WRITE_FAILED',\n MERGE_INVALID_SCHEMA: 'TESTRELIC_MERGE_INVALID_SCHEMA',\n MERGE_READ_FAILED: 'TESTRELIC_MERGE_READ_FAILED',\n NAVIGATION_FLUSH_FAILED: 'TESTRELIC_NAVIGATION_FLUSH_FAILED',\n CODE_EXTRACT_FAILED: 'TESTRELIC_CODE_EXTRACT_FAILED',\n HTML_REPORT_FAILED: 'TESTRELIC_HTML_REPORT_FAILED',\n CLOUD_AUTH_FAILED: 'TESTRELIC_CLOUD_AUTH_FAILED',\n CLOUD_UPLOAD_FAILED: 'TESTRELIC_CLOUD_UPLOAD_FAILED',\n CLOUD_CONFIG_INVALID: 'TESTRELIC_CLOUD_CONFIG_INVALID',\n CLOUD_QUEUE_FAILED: 'TESTRELIC_CLOUD_QUEUE_FAILED',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\nexport class TestRelicError extends Error {\n readonly code: ErrorCode;\n\n constructor(code: ErrorCode, message: string, cause?: unknown) {\n super(message);\n this.name = 'TestRelicError';\n this.code = code;\n if (cause !== undefined) {\n Object.defineProperty(this, 'cause', { value: cause, writable: false, enumerable: false });\n }\n }\n}\n\nexport function createError(\n code: ErrorCode,\n message: string,\n cause?: unknown,\n): TestRelicError {\n return new TestRelicError(code, message, cause);\n}\n","/**\n * @testrelic/core — Lightweight runtime type guards\n *\n * Hand-written guards, no runtime schema libraries (Constitution SDK Constraint).\n */\n\nimport type {\n ReporterConfig,\n NavigationType,\n TestRunReport,\n CloudConfig,\n QueueEntry,\n UploadStrategy,\n} from './types.js';\n\nconst NAVIGATION_TYPES = new Set<string>([\n 'goto', 'navigation', 'back', 'forward', 'refresh',\n 'spa_route', 'spa_replace', 'hash_change', 'link_click',\n 'form_submit', 'redirect', 'popstate', 'page_load',\n 'manual_record', 'fallback', 'dummy',\n]);\n\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nexport function isValidNavigationType(value: unknown): value is NavigationType {\n return typeof value === 'string' && NAVIGATION_TYPES.has(value);\n}\n\nfunction hasNoPrototypePollution(obj: unknown): boolean {\n if (typeof obj !== 'object' || obj === null) return true;\n for (const key of Object.keys(obj)) {\n if (DANGEROUS_KEYS.has(key)) return false;\n }\n return true;\n}\n\nexport function isValidConfig(input: unknown): input is ReporterConfig {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (obj.outputPath !== undefined && typeof obj.outputPath !== 'string') return false;\n if (obj.includeStackTrace !== undefined && typeof obj.includeStackTrace !== 'boolean') return false;\n if (obj.includeCodeSnippets !== undefined && typeof obj.includeCodeSnippets !== 'boolean') return false;\n if (obj.codeContextLines !== undefined && typeof obj.codeContextLines !== 'number') return false;\n if (obj.includeNetworkStats !== undefined && typeof obj.includeNetworkStats !== 'boolean') return false;\n\n if (obj.navigationTypes !== undefined && obj.navigationTypes !== null) {\n if (!Array.isArray(obj.navigationTypes)) return false;\n for (const t of obj.navigationTypes) {\n if (!isValidNavigationType(t)) return false;\n }\n }\n\n if (obj.redactPatterns !== undefined) {\n if (!Array.isArray(obj.redactPatterns)) return false;\n for (const p of obj.redactPatterns) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.testRunId !== undefined && obj.testRunId !== null && typeof obj.testRunId !== 'string') return false;\n\n if (obj.metadata !== undefined && obj.metadata !== null) {\n if (typeof obj.metadata !== 'object') return false;\n if (!hasNoPrototypePollution(obj.metadata)) return false;\n }\n\n if (obj.openReport !== undefined && typeof obj.openReport !== 'boolean') return false;\n if (obj.htmlReportPath !== undefined && (typeof obj.htmlReportPath !== 'string' || obj.htmlReportPath === '')) return false;\n if (obj.includeArtifacts !== undefined && typeof obj.includeArtifacts !== 'boolean') return false;\n\n // API tracking configuration\n if (obj.trackApiCalls !== undefined && typeof obj.trackApiCalls !== 'boolean') return false;\n if (obj.captureRequestHeaders !== undefined && typeof obj.captureRequestHeaders !== 'boolean') return false;\n if (obj.captureResponseHeaders !== undefined && typeof obj.captureResponseHeaders !== 'boolean') return false;\n if (obj.captureRequestBody !== undefined && typeof obj.captureRequestBody !== 'boolean') return false;\n if (obj.captureResponseBody !== undefined && typeof obj.captureResponseBody !== 'boolean') return false;\n if (obj.captureAssertions !== undefined && typeof obj.captureAssertions !== 'boolean') return false;\n\n if (obj.redactHeaders !== undefined) {\n if (!Array.isArray(obj.redactHeaders)) return false;\n for (const h of obj.redactHeaders) {\n if (typeof h !== 'string') return false;\n }\n }\n\n if (obj.redactBodyFields !== undefined) {\n if (!Array.isArray(obj.redactBodyFields)) return false;\n for (const f of obj.redactBodyFields) {\n if (typeof f !== 'string') return false;\n }\n }\n\n if (obj.apiIncludeUrls !== undefined) {\n if (!Array.isArray(obj.apiIncludeUrls)) return false;\n for (const p of obj.apiIncludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.apiExcludeUrls !== undefined) {\n if (!Array.isArray(obj.apiExcludeUrls)) return false;\n for (const p of obj.apiExcludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n return true;\n}\n\n// ---------------------------------------------------------------------------\n// Cloud Config Validation\n// ---------------------------------------------------------------------------\n\nconst API_KEY_PATTERN = /^tr[a-z]*_[a-z]+_[a-zA-Z0-9]+$/;\n\nconst UPLOAD_STRATEGIES = new Set<string>(['batch', 'realtime', 'both']);\n\nconst LOCALHOST_HOSTS = new Set(['localhost', '127.0.0.1', '0.0.0.0']);\n\nexport function isValidApiKeyFormat(value: unknown): value is string {\n return typeof value === 'string' && API_KEY_PATTERN.test(value);\n}\n\nexport function isValidUploadStrategy(value: unknown): value is UploadStrategy {\n return typeof value === 'string' && UPLOAD_STRATEGIES.has(value);\n}\n\nexport function isValidEndpointUrl(value: unknown): boolean {\n if (typeof value !== 'string') return false;\n try {\n const url = new URL(value);\n if (url.protocol === 'https:') return true;\n if (url.protocol === 'http:' && LOCALHOST_HOSTS.has(url.hostname)) return true;\n return false;\n } catch {\n return false;\n }\n}\n\nexport function isValidCloudConfig(input: unknown): input is CloudConfig {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (obj.apiKey !== undefined && obj.apiKey !== null) {\n if (typeof obj.apiKey !== 'string') return false;\n if (obj.apiKey.length > 0 && !isValidApiKeyFormat(obj.apiKey)) return false;\n }\n\n if (obj.endpoint !== undefined) {\n if (!isValidEndpointUrl(obj.endpoint)) return false;\n }\n\n if (obj.uploadStrategy !== undefined) {\n if (!isValidUploadStrategy(obj.uploadStrategy)) return false;\n }\n\n if (obj.timeout !== undefined) {\n if (typeof obj.timeout !== 'number' || obj.timeout < 1000 || obj.timeout > 120000) return false;\n }\n\n if (obj.projectName !== undefined && obj.projectName !== null && typeof obj.projectName !== 'string') return false;\n\n if (obj.queueMaxAge !== undefined) {\n if (typeof obj.queueMaxAge !== 'number' || obj.queueMaxAge < 3600000 || obj.queueMaxAge > 2592000000) return false;\n }\n\n if (obj.queueDirectory !== undefined) {\n if (typeof obj.queueDirectory !== 'string') return false;\n if (obj.queueDirectory.startsWith('/') || obj.queueDirectory.includes('..')) return false;\n }\n\n return true;\n}\n\nexport function isValidQueueEntry(input: unknown): input is QueueEntry {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (typeof obj.version !== 'string') return false;\n if (typeof obj.queuedAt !== 'string') return false;\n if (typeof obj.reason !== 'string') return false;\n if (typeof obj.retryCount !== 'number') return false;\n if (typeof obj.targetEndpoint !== 'string') return false;\n if (typeof obj.method !== 'string') return false;\n if (typeof obj.payload !== 'object' || obj.payload === null) return false;\n if (typeof obj.headers !== 'object' || obj.headers === null) return false;\n\n return true;\n}\n\nexport function isValidTestRunReport(value: unknown): value is TestRunReport {\n if (typeof value !== 'object' || value === null) return false;\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.schemaVersion !== 'string') return false;\n if (typeof obj.testRunId !== 'string') return false;\n if (typeof obj.startedAt !== 'string') return false;\n if (typeof obj.completedAt !== 'string') return false;\n if (typeof obj.totalDuration !== 'number') return false;\n if (typeof obj.summary !== 'object' || obj.summary === null) return false;\n if (!Array.isArray(obj.timeline)) return false;\n\n const summary = obj.summary as Record<string, unknown>;\n if (typeof summary.total !== 'number') return false;\n if (typeof summary.passed !== 'number') return false;\n if (typeof summary.failed !== 'number') return false;\n if (typeof summary.flaky !== 'number') return false;\n if (typeof summary.skipped !== 'number') return false;\n // timedout is optional for backward compat with schema 1.0.0\n if (summary.timedout !== undefined && typeof summary.timedout !== 'number') return false;\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkfO,IAAM,kBAAkB;AAGxB,IAAM,yBAAyB;AAG/B,IAAM,kBAAkB;AAGxB,IAAM,0BAA0B;AAiChC,SAAS,uBAAuB,KAA2C;AAChF,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,SAAS;AACf,SACE,OAAO,kBAAkB,QACzB,OAAO,YAAY,WACnB,MAAM,QAAQ,OAAO,WAAW,KAChC,MAAM,QAAQ,OAAO,aAAa;AAEtC;AAGO,SAAS,uBAAuB,KAA2C;AAChF,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,SAAS;AACf,SACE,OAAO,kBAAkB,QACzB,OAAO,OAAO,YAA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