@tempo-ai/visual-review 0.0.140 → 0.0.141
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/bin.js +2 -2
- package/dist/{chunk-TEVWNWZ6.js → chunk-Q6FW7NII.js} +1 -1
- package/dist/chunk-Q6FW7NII.js.map +1 -0
- package/dist/{chunk-GH43HSTJ.js → chunk-QZQGESF4.js} +232 -45
- package/dist/chunk-QZQGESF4.js.map +1 -0
- package/dist/{chunk-PI6TS733.js → chunk-WQOUTFK5.js} +2 -2
- package/dist/{cli-VA6YGDST.js → cli-FXYAIPTD.js} +3 -3
- package/dist/index.js +3 -3
- package/dist/{report-XRYE2D5O.js → report-5LJCK3JT.js} +3 -3
- package/package.json +3 -2
- package/dist/chunk-GH43HSTJ.js.map +0 -1
- package/dist/chunk-TEVWNWZ6.js.map +0 -1
- /package/dist/{chunk-PI6TS733.js.map → chunk-WQOUTFK5.js.map} +0 -0
- /package/dist/{cli-VA6YGDST.js.map → cli-FXYAIPTD.js.map} +0 -0
- /package/dist/{report-XRYE2D5O.js.map → report-5LJCK3JT.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __tempoCreateRequire } from 'node:module'; const requi
|
|
|
2
2
|
import {
|
|
3
3
|
buildBitbucketNoVisualChangeComment,
|
|
4
4
|
upsertBitbucketStickyComment
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q6FW7NII.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_VISUAL_REVIEW_INGEST_URL,
|
|
8
8
|
declareNoVisualChangeIfPresent,
|
|
@@ -29419,7 +29419,7 @@ function buildDirectRenderIdleUrl(hostUrl) {
|
|
|
29419
29419
|
}
|
|
29420
29420
|
|
|
29421
29421
|
// ../canvas-capture-headless/src/capture.ts
|
|
29422
|
-
import { createHash } from "crypto";
|
|
29422
|
+
import { createHash as createHash2 } from "crypto";
|
|
29423
29423
|
import { PNG } from "pngjs";
|
|
29424
29424
|
|
|
29425
29425
|
// ../../modules/frame-pool/capture-determinism.ts
|
|
@@ -29895,7 +29895,7 @@ function buildSettleWaitScript(options) {
|
|
|
29895
29895
|
}
|
|
29896
29896
|
|
|
29897
29897
|
// ../canvas-capture-headless/src/fingerprint.ts
|
|
29898
|
-
var KIT_VERSION = "
|
|
29898
|
+
var KIT_VERSION = "9";
|
|
29899
29899
|
var FONTS_BUNDLE_VERSION = "system-1";
|
|
29900
29900
|
var DEVICE_SCALE_FACTOR = 1;
|
|
29901
29901
|
function buildEnvFingerprint(input) {
|
|
@@ -30119,6 +30119,166 @@ import { randomBytes } from "crypto";
|
|
|
30119
30119
|
import { readFile, stat as stat2 } from "fs/promises";
|
|
30120
30120
|
import path3 from "path";
|
|
30121
30121
|
|
|
30122
|
+
// ../canvas-capture-headless/src/capture-images.ts
|
|
30123
|
+
import { createHash } from "crypto";
|
|
30124
|
+
import { createRequire as createRequire2 } from "module";
|
|
30125
|
+
var MAX_IMAGE_BYTES = 24 * 1024 * 1024;
|
|
30126
|
+
var MAX_IMAGE_PIXELS = 64 * 1024 * 1024;
|
|
30127
|
+
var CACHE_BYTES = 32 * 1024 * 1024;
|
|
30128
|
+
var requireModule = createRequire2(import.meta.url);
|
|
30129
|
+
var codec;
|
|
30130
|
+
var loadSharp = () => codec ??= requireModule("sharp");
|
|
30131
|
+
function createCaptureImageNormalizer() {
|
|
30132
|
+
const cache2 = /* @__PURE__ */ new Map();
|
|
30133
|
+
let retainedBytes = 0;
|
|
30134
|
+
return async (bytes) => {
|
|
30135
|
+
if (bytes[0] !== 255 || bytes[1] !== 216 || bytes[2] !== 255)
|
|
30136
|
+
return bytes;
|
|
30137
|
+
if (bytes.length > MAX_IMAGE_BYTES)
|
|
30138
|
+
throw new Error("capture JPEG exceeds the 24 MiB input limit");
|
|
30139
|
+
const key2 = createHash("sha256").update(bytes).digest("hex");
|
|
30140
|
+
const cached = cache2.get(key2);
|
|
30141
|
+
if (cached) {
|
|
30142
|
+
cache2.delete(key2);
|
|
30143
|
+
cache2.set(key2, cached);
|
|
30144
|
+
return cached;
|
|
30145
|
+
}
|
|
30146
|
+
const sharp = loadSharp();
|
|
30147
|
+
const png = await sharp(bytes, { limitInputPixels: MAX_IMAGE_PIXELS }).keepExif().png().toBuffer();
|
|
30148
|
+
if (cache2.has(key2)) return cache2.get(key2);
|
|
30149
|
+
if (png.length <= CACHE_BYTES) {
|
|
30150
|
+
while (retainedBytes + png.length > CACHE_BYTES) {
|
|
30151
|
+
const oldest = cache2.keys().next().value;
|
|
30152
|
+
retainedBytes -= cache2.get(oldest).length;
|
|
30153
|
+
cache2.delete(oldest);
|
|
30154
|
+
}
|
|
30155
|
+
cache2.set(key2, png);
|
|
30156
|
+
retainedBytes += png.length;
|
|
30157
|
+
}
|
|
30158
|
+
return png;
|
|
30159
|
+
};
|
|
30160
|
+
}
|
|
30161
|
+
async function installCaptureImages(page, normalize3) {
|
|
30162
|
+
const session = await page.context().newCDPSession(page);
|
|
30163
|
+
const failures = /* @__PURE__ */ new Map();
|
|
30164
|
+
const pending = /* @__PURE__ */ new Set();
|
|
30165
|
+
const requests = /* @__PURE__ */ new Map();
|
|
30166
|
+
let disposing = false;
|
|
30167
|
+
const handle = async (event) => {
|
|
30168
|
+
const {
|
|
30169
|
+
requestId,
|
|
30170
|
+
networkId,
|
|
30171
|
+
request,
|
|
30172
|
+
responseStatusCode,
|
|
30173
|
+
responseHeaders = []
|
|
30174
|
+
} = event;
|
|
30175
|
+
const requestState = {
|
|
30176
|
+
canceled: false
|
|
30177
|
+
};
|
|
30178
|
+
if (networkId) requests.set(networkId, requestState);
|
|
30179
|
+
try {
|
|
30180
|
+
const mime = responseHeaders.find((h) => h.name.toLowerCase() === "content-type")?.value.split(";", 1)[0].trim().toLowerCase();
|
|
30181
|
+
const mayBeJpeg = mime === "image/jpeg" || mime === "image/jpg" || mime === "application/octet-stream" || !mime;
|
|
30182
|
+
if (responseStatusCode !== 200 || !mayBeJpeg) {
|
|
30183
|
+
await session.send("Fetch.continueRequest", { requestId });
|
|
30184
|
+
return;
|
|
30185
|
+
}
|
|
30186
|
+
const declaredLength = Number(
|
|
30187
|
+
responseHeaders.find((h) => h.name.toLowerCase() === "content-length")?.value
|
|
30188
|
+
);
|
|
30189
|
+
if (declaredLength > MAX_IMAGE_BYTES)
|
|
30190
|
+
throw new Error("capture image exceeds the 24 MiB input limit");
|
|
30191
|
+
let timer;
|
|
30192
|
+
const response = await Promise.race([
|
|
30193
|
+
session.send("Fetch.getResponseBody", { requestId }),
|
|
30194
|
+
new Promise((_, reject) => {
|
|
30195
|
+
timer = setTimeout(
|
|
30196
|
+
() => reject(new Error("capture image download exceeded 30 seconds")),
|
|
30197
|
+
3e4
|
|
30198
|
+
);
|
|
30199
|
+
}),
|
|
30200
|
+
new Promise((_, reject) => {
|
|
30201
|
+
requestState.cancelBody = () => reject(new Error("capture image request was canceled"));
|
|
30202
|
+
if (requestState.canceled) requestState.cancelBody();
|
|
30203
|
+
})
|
|
30204
|
+
]).finally(() => {
|
|
30205
|
+
clearTimeout(timer);
|
|
30206
|
+
requestState.cancelBody = void 0;
|
|
30207
|
+
});
|
|
30208
|
+
const body = Buffer.from(
|
|
30209
|
+
response.body,
|
|
30210
|
+
response.base64Encoded ? "base64" : "utf8"
|
|
30211
|
+
);
|
|
30212
|
+
const normalized = await normalize3(body);
|
|
30213
|
+
if (normalized === body) {
|
|
30214
|
+
await session.send("Fetch.continueRequest", { requestId });
|
|
30215
|
+
return;
|
|
30216
|
+
}
|
|
30217
|
+
const replaced = /* @__PURE__ */ new Set([
|
|
30218
|
+
"content-type",
|
|
30219
|
+
"content-encoding",
|
|
30220
|
+
"content-length",
|
|
30221
|
+
"etag",
|
|
30222
|
+
"content-md5",
|
|
30223
|
+
"digest",
|
|
30224
|
+
"content-digest",
|
|
30225
|
+
"repr-digest"
|
|
30226
|
+
]);
|
|
30227
|
+
const headers = responseHeaders.filter(
|
|
30228
|
+
(h) => !replaced.has(h.name.toLowerCase())
|
|
30229
|
+
);
|
|
30230
|
+
headers.push({ name: "Content-Type", value: "image/png" });
|
|
30231
|
+
await session.send("Fetch.fulfillRequest", {
|
|
30232
|
+
requestId,
|
|
30233
|
+
responseCode: responseStatusCode,
|
|
30234
|
+
responseHeaders: headers,
|
|
30235
|
+
body: normalized.toString("base64")
|
|
30236
|
+
});
|
|
30237
|
+
} catch (error) {
|
|
30238
|
+
if (!disposing && !requestState.canceled)
|
|
30239
|
+
failures.set(request.url, String(error));
|
|
30240
|
+
await session.send("Fetch.failRequest", { requestId, errorReason: "Failed" }).catch(() => {
|
|
30241
|
+
});
|
|
30242
|
+
} finally {
|
|
30243
|
+
if (networkId && requests.get(networkId) === requestState)
|
|
30244
|
+
requests.delete(networkId);
|
|
30245
|
+
}
|
|
30246
|
+
};
|
|
30247
|
+
session.on("Network.loadingFailed", (event) => {
|
|
30248
|
+
if (!event.canceled) return;
|
|
30249
|
+
const request = requests.get(event.requestId);
|
|
30250
|
+
if (!request) return;
|
|
30251
|
+
request.canceled = true;
|
|
30252
|
+
request.cancelBody?.();
|
|
30253
|
+
});
|
|
30254
|
+
session.on("Fetch.requestPaused", (event) => {
|
|
30255
|
+
const task = handle(event);
|
|
30256
|
+
pending.add(task);
|
|
30257
|
+
void task.finally(() => pending.delete(task)).catch(() => {
|
|
30258
|
+
});
|
|
30259
|
+
});
|
|
30260
|
+
await session.send("Network.enable");
|
|
30261
|
+
await session.send("Fetch.enable", {
|
|
30262
|
+
patterns: [{ resourceType: "Image", requestStage: "Response" }]
|
|
30263
|
+
});
|
|
30264
|
+
return {
|
|
30265
|
+
assertHealthy() {
|
|
30266
|
+
if (failures.size)
|
|
30267
|
+
throw new Error(
|
|
30268
|
+
`capture image normalization failed: ${[...failures].map(([url, error]) => `${url}: ${error}`).join("; ")}`
|
|
30269
|
+
);
|
|
30270
|
+
},
|
|
30271
|
+
async dispose() {
|
|
30272
|
+
disposing = true;
|
|
30273
|
+
await session.send("Fetch.disable").catch(() => {
|
|
30274
|
+
});
|
|
30275
|
+
await session.detach().catch(() => {
|
|
30276
|
+
});
|
|
30277
|
+
await Promise.allSettled([...pending]);
|
|
30278
|
+
}
|
|
30279
|
+
};
|
|
30280
|
+
}
|
|
30281
|
+
|
|
30122
30282
|
// ../canvas/html-storyboard-resources.ts
|
|
30123
30283
|
import path2 from "path";
|
|
30124
30284
|
import { realpath, stat } from "fs/promises";
|
|
@@ -38206,7 +38366,7 @@ var contentTypes = {
|
|
|
38206
38366
|
".wav": "audio/wav",
|
|
38207
38367
|
".webm": "video/webm"
|
|
38208
38368
|
};
|
|
38209
|
-
async function openHeadlessHtmlSource(context, filepath) {
|
|
38369
|
+
async function openHeadlessHtmlSource(context, filepath, normalizeImage = createCaptureImageNormalizer()) {
|
|
38210
38370
|
const accepted = await authorizeHtmlStoryboardResource(filepath);
|
|
38211
38371
|
const content = await readFile(accepted.filepath, "utf8");
|
|
38212
38372
|
const annotated = annotateHtmlStoryboardRevision(content, {
|
|
@@ -38222,7 +38382,7 @@ async function openHeadlessHtmlSource(context, filepath) {
|
|
|
38222
38382
|
if (requested.origin !== origin) {
|
|
38223
38383
|
if (requested.protocol === "file:" || request.isNavigationRequest())
|
|
38224
38384
|
return route.abort("blockedbyclient");
|
|
38225
|
-
return route.
|
|
38385
|
+
return route.fallback();
|
|
38226
38386
|
}
|
|
38227
38387
|
const resource = await resolveHtmlStoryboardResource(
|
|
38228
38388
|
accepted.authorization,
|
|
@@ -38233,14 +38393,16 @@ async function openHeadlessHtmlSource(context, filepath) {
|
|
|
38233
38393
|
return route.fulfill({ status: resource.status, body: "" });
|
|
38234
38394
|
}
|
|
38235
38395
|
try {
|
|
38396
|
+
const body = resource.filepath === accepted.filepath ? annotated : await readFile(resource.filepath);
|
|
38397
|
+
const normalized = request.resourceType() === "image" && Buffer.isBuffer(body) ? await normalizeImage(body) : body;
|
|
38236
38398
|
await route.fulfill({
|
|
38237
38399
|
status: 200,
|
|
38238
|
-
contentType: contentTypes[path3.extname(resource.filepath).toLowerCase()],
|
|
38400
|
+
contentType: normalized !== body ? "image/png" : contentTypes[path3.extname(resource.filepath).toLowerCase()],
|
|
38239
38401
|
headers: {
|
|
38240
38402
|
"cache-control": "no-store",
|
|
38241
38403
|
"content-security-policy": "sandbox allow-scripts allow-same-origin"
|
|
38242
38404
|
},
|
|
38243
|
-
body:
|
|
38405
|
+
body: normalized
|
|
38244
38406
|
});
|
|
38245
38407
|
} catch (error) {
|
|
38246
38408
|
failures.add(`${requested.pathname}: ${String(error)}`);
|
|
@@ -38489,7 +38651,11 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38489
38651
|
);
|
|
38490
38652
|
}
|
|
38491
38653
|
function images() {
|
|
38492
|
-
return Array.from(doc.querySelectorAll("img"))
|
|
38654
|
+
return Array.from(doc.querySelectorAll("img"))
|
|
38655
|
+
.filter(visibleImage)
|
|
38656
|
+
.map(function (img) {
|
|
38657
|
+
return [img, img.currentSrc, img.src, img.srcset];
|
|
38658
|
+
});
|
|
38493
38659
|
}
|
|
38494
38660
|
async function scheduledImages() {
|
|
38495
38661
|
var candidates,
|
|
@@ -38501,7 +38667,8 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38501
38667
|
var limit = Math.min(offset + 32, candidates.length);
|
|
38502
38668
|
while (offset < limit) {
|
|
38503
38669
|
var img = candidates[offset++];
|
|
38504
|
-
if (visibleImage(img))
|
|
38670
|
+
if (visibleImage(img))
|
|
38671
|
+
selected.push([img, img.currentSrc, img.src, img.srcset]);
|
|
38505
38672
|
if (slice && !slice.hasTime()) break;
|
|
38506
38673
|
}
|
|
38507
38674
|
});
|
|
@@ -38555,7 +38722,7 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38555
38722
|
check();
|
|
38556
38723
|
});
|
|
38557
38724
|
}
|
|
38558
|
-
function inventory() {
|
|
38725
|
+
function inventory(includeImages) {
|
|
38559
38726
|
return {
|
|
38560
38727
|
links: links().map(function (link) {
|
|
38561
38728
|
// Resource evidence can change during a font/image await without
|
|
@@ -38570,15 +38737,13 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38570
38737
|
link.getAttribute("data-tempo-stylesheet-error") === link.href,
|
|
38571
38738
|
];
|
|
38572
38739
|
}),
|
|
38573
|
-
images: images()
|
|
38574
|
-
return [img, img.currentSrc, img.src, img.srcset];
|
|
38575
|
-
}),
|
|
38740
|
+
images: includeImages ? images() : [],
|
|
38576
38741
|
styles: Array.from(doc.querySelectorAll("style")).map(function (style) {
|
|
38577
38742
|
return [style, style.textContent];
|
|
38578
38743
|
}),
|
|
38579
38744
|
};
|
|
38580
38745
|
}
|
|
38581
|
-
async function scheduledInventory() {
|
|
38746
|
+
async function scheduledInventory(includeImages) {
|
|
38582
38747
|
var candidates,
|
|
38583
38748
|
offset = 0;
|
|
38584
38749
|
var result = { revision: revision, links: [], images: [], styles: [] };
|
|
@@ -38588,7 +38753,11 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38588
38753
|
await work(function (slice) {
|
|
38589
38754
|
if (!candidates)
|
|
38590
38755
|
candidates = Array.from(
|
|
38591
|
-
doc.querySelectorAll(
|
|
38756
|
+
doc.querySelectorAll(
|
|
38757
|
+
includeImages
|
|
38758
|
+
? 'link[rel~="stylesheet"],img,style'
|
|
38759
|
+
: 'link[rel~="stylesheet"],style',
|
|
38760
|
+
),
|
|
38592
38761
|
);
|
|
38593
38762
|
var limit = Math.min(offset + 32, candidates.length);
|
|
38594
38763
|
while (offset < limit) {
|
|
@@ -38634,8 +38803,8 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38634
38803
|
async function run() {
|
|
38635
38804
|
while (!stopped) {
|
|
38636
38805
|
var before = options.scheduleWork
|
|
38637
|
-
? await scheduledInventory()
|
|
38638
|
-
: inventory();
|
|
38806
|
+
? await scheduledInventory(false)
|
|
38807
|
+
: inventory(false);
|
|
38639
38808
|
if (stopped) return;
|
|
38640
38809
|
await Promise.race([
|
|
38641
38810
|
terminal,
|
|
@@ -38691,14 +38860,18 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38691
38860
|
}),
|
|
38692
38861
|
]);
|
|
38693
38862
|
if (stopped) return;
|
|
38863
|
+
// Fonts can change which images are visible. Capture the image evidence
|
|
38864
|
+
// only after their layout settles, before awaiting any selected decode.
|
|
38694
38865
|
var selected = options.scheduleWork
|
|
38695
38866
|
? await scheduledImages()
|
|
38696
38867
|
: images();
|
|
38697
38868
|
if (stopped) return;
|
|
38869
|
+
before.images = selected;
|
|
38698
38870
|
if (options.scheduleWork) {
|
|
38699
38871
|
var pendingImages = [],
|
|
38700
38872
|
pendingLoads = [];
|
|
38701
|
-
var imageWaits = await mapWork(selected, function (
|
|
38873
|
+
var imageWaits = await mapWork(selected, function (row) {
|
|
38874
|
+
var img = row[0];
|
|
38702
38875
|
if (img.loading === "lazy") img.loading = "eager";
|
|
38703
38876
|
// Warm images need no load-event continuation. Prepare their
|
|
38704
38877
|
// decodes in this bounded batch rather than one new task per image.
|
|
@@ -38740,7 +38913,8 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38740
38913
|
await Promise.race([
|
|
38741
38914
|
terminal,
|
|
38742
38915
|
Promise.all(
|
|
38743
|
-
selected.map(async function (
|
|
38916
|
+
selected.map(async function (row) {
|
|
38917
|
+
var img = row[0];
|
|
38744
38918
|
if (img.loading === "lazy") img.loading = "eager";
|
|
38745
38919
|
await Promise.race([
|
|
38746
38920
|
terminal,
|
|
@@ -38774,8 +38948,8 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness
|
|
|
38774
38948
|
if (face.status === "error") failure("font", face.family);
|
|
38775
38949
|
});
|
|
38776
38950
|
var after = options.scheduleWork
|
|
38777
|
-
? await scheduledInventory()
|
|
38778
|
-
: inventory();
|
|
38951
|
+
? await scheduledInventory(true)
|
|
38952
|
+
: inventory(true);
|
|
38779
38953
|
if (stopped) return;
|
|
38780
38954
|
// A scheduled inventory can span multiple tasks. A mutation during
|
|
38781
38955
|
// its geometry reads cannot certify a mixed document observation.
|
|
@@ -39272,7 +39446,7 @@ function buildDirectRenderUrl2(hostUrl, target) {
|
|
|
39272
39446
|
});
|
|
39273
39447
|
}
|
|
39274
39448
|
function sha256Hex(bytes) {
|
|
39275
|
-
return
|
|
39449
|
+
return createHash2("sha256").update(bytes).digest("hex");
|
|
39276
39450
|
}
|
|
39277
39451
|
function looksBlank(pngBytes) {
|
|
39278
39452
|
let png;
|
|
@@ -39375,6 +39549,7 @@ async function startCaptureSession(options) {
|
|
|
39375
39549
|
const log = options.log ?? (() => {
|
|
39376
39550
|
});
|
|
39377
39551
|
const parallelPages = options.parallelPages ?? 1;
|
|
39552
|
+
const normalizeImage = createCaptureImageNormalizer();
|
|
39378
39553
|
const { chromium } = await import("playwright");
|
|
39379
39554
|
let browser;
|
|
39380
39555
|
try {
|
|
@@ -39406,10 +39581,12 @@ async function startCaptureSession(options) {
|
|
|
39406
39581
|
await context.addInitScript(buildFreezeInitScript());
|
|
39407
39582
|
await context.addInitScript(installRenderProfileInPage);
|
|
39408
39583
|
const page = await context.newPage();
|
|
39584
|
+
const images = await installCaptureImages(page, normalizeImage);
|
|
39409
39585
|
const documentEvents = await context.newCDPSession(page);
|
|
39410
39586
|
const worker = {
|
|
39411
39587
|
context,
|
|
39412
39588
|
page,
|
|
39589
|
+
images,
|
|
39413
39590
|
contextMs: Date.now() - contextStart,
|
|
39414
39591
|
contextClaimed: false,
|
|
39415
39592
|
hasNavigated: false,
|
|
@@ -39420,6 +39597,7 @@ async function startCaptureSession(options) {
|
|
|
39420
39597
|
documentsLoaded: 0,
|
|
39421
39598
|
navigationsInFlight: 0,
|
|
39422
39599
|
async dispose() {
|
|
39600
|
+
await images.dispose();
|
|
39423
39601
|
await documentEvents.detach().catch(() => {
|
|
39424
39602
|
});
|
|
39425
39603
|
await page.close().catch(() => {
|
|
@@ -39496,7 +39674,8 @@ async function startCaptureSession(options) {
|
|
|
39496
39674
|
try {
|
|
39497
39675
|
const source = target.source.kind === "html" ? await openHeadlessHtmlSource(
|
|
39498
39676
|
worker2.context,
|
|
39499
|
-
target.source.filepath
|
|
39677
|
+
target.source.filepath,
|
|
39678
|
+
normalizeImage
|
|
39500
39679
|
) : {
|
|
39501
39680
|
url: astroCaptureUrl(
|
|
39502
39681
|
await (options.getAppUrl?.() ?? Promise.reject(
|
|
@@ -39558,7 +39737,9 @@ async function startCaptureSession(options) {
|
|
|
39558
39737
|
`Astro storyboard failed: ${[...failures].join("; ")}`
|
|
39559
39738
|
);
|
|
39560
39739
|
timings.settleMs = Date.now() - settling;
|
|
39740
|
+
worker2.images.assertHealthy();
|
|
39561
39741
|
const value = await work(worker2.page, "body");
|
|
39742
|
+
worker2.images.assertHealthy();
|
|
39562
39743
|
source.assertResources();
|
|
39563
39744
|
if (target.source.kind === "astro" && failures.size)
|
|
39564
39745
|
throw new Error(
|
|
@@ -39723,7 +39904,9 @@ async function startCaptureSession(options) {
|
|
|
39723
39904
|
errorSelector: STORYBOARD_RENDER_ERROR_SELECTOR,
|
|
39724
39905
|
messageAttribute: STORYBOARD_RENDER_ERROR_MESSAGE_ATTRIBUTE
|
|
39725
39906
|
});
|
|
39907
|
+
worker.images.assertHealthy();
|
|
39726
39908
|
const value = await work(page, selector);
|
|
39909
|
+
worker.images.assertHealthy();
|
|
39727
39910
|
const renderErrors = await page.evaluate(readRenderErrorsInPage);
|
|
39728
39911
|
if (renderErrors.length > 0) {
|
|
39729
39912
|
throw new Error(
|
|
@@ -42492,7 +42675,7 @@ import {
|
|
|
42492
42675
|
writeFile as writeFile3
|
|
42493
42676
|
} from "fs/promises";
|
|
42494
42677
|
import path10 from "path";
|
|
42495
|
-
import { createHash as
|
|
42678
|
+
import { createHash as createHash3 } from "crypto";
|
|
42496
42679
|
var TEMPO_SDK_SOURCE_ENV = "TEMPO_MONOREPO_SDK_SOURCE";
|
|
42497
42680
|
var LOCAL_SDK_MARKER_FILE = "local-tempo-sdk.json";
|
|
42498
42681
|
var preparations2 = /* @__PURE__ */ new Map();
|
|
@@ -42546,7 +42729,7 @@ async function assertLocalSdkPrebuilt(localSdkRoot) {
|
|
|
42546
42729
|
}
|
|
42547
42730
|
var SNAPSHOT_MARKER = ".tempo-prebuilt-source.json";
|
|
42548
42731
|
async function snapshotRevision(root2, manifest, files) {
|
|
42549
|
-
const hash =
|
|
42732
|
+
const hash = createHash3("sha256").update(manifest);
|
|
42550
42733
|
async function visit(directory) {
|
|
42551
42734
|
for (const entry of (await readdir2(directory, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
42552
42735
|
const file = path10.join(directory, entry.name);
|
|
@@ -42640,7 +42823,7 @@ async function materializeSdk(localSdkRoot, installedSdkRoot) {
|
|
|
42640
42823
|
}
|
|
42641
42824
|
}
|
|
42642
42825
|
async function sdkBuildFingerprint(root2) {
|
|
42643
|
-
const hash =
|
|
42826
|
+
const hash = createHash3("sha256").update("snapshot-format-2");
|
|
42644
42827
|
const manifest = await readFile5(path10.join(root2, "package.json"), "utf8");
|
|
42645
42828
|
hash.update(manifest);
|
|
42646
42829
|
const pkg = JSON.parse(manifest);
|
|
@@ -44302,7 +44485,7 @@ import path12 from "path";
|
|
|
44302
44485
|
var DEFAULT_IDLE_TTL_MS = 60 * 60 * 1e3;
|
|
44303
44486
|
|
|
44304
44487
|
// ../tempo-devserver/dev-server-ownership-registry.ts
|
|
44305
|
-
import { createHash as
|
|
44488
|
+
import { createHash as createHash4 } from "crypto";
|
|
44306
44489
|
import { readFile as readFile7 } from "fs/promises";
|
|
44307
44490
|
import os from "os";
|
|
44308
44491
|
import path13 from "path";
|
|
@@ -45702,8 +45885,12 @@ var CanvasRegistry = class {
|
|
|
45702
45885
|
);
|
|
45703
45886
|
}
|
|
45704
45887
|
async pruneDeletedRequestedPaths(requestedPaths) {
|
|
45888
|
+
const candidates = /* @__PURE__ */ new Set([
|
|
45889
|
+
...requestedPaths,
|
|
45890
|
+
...this.requestedThisSession
|
|
45891
|
+
]);
|
|
45705
45892
|
const existingPaths = [];
|
|
45706
|
-
for (const requestedPath of
|
|
45893
|
+
for (const requestedPath of candidates) {
|
|
45707
45894
|
const absolutePath = this.requestedPathToAbsolutePath(requestedPath);
|
|
45708
45895
|
if (!absolutePath) continue;
|
|
45709
45896
|
if (await this.canvasFileExistsWithRecheck(absolutePath)) {
|
|
@@ -45712,17 +45899,17 @@ var CanvasRegistry = class {
|
|
|
45712
45899
|
}
|
|
45713
45900
|
return {
|
|
45714
45901
|
requestedPaths: existingPaths,
|
|
45715
|
-
changed: existingPaths.length !== requestedPaths.length
|
|
45902
|
+
changed: existingPaths.length !== requestedPaths.length || existingPaths.some((value, index) => value !== requestedPaths[index])
|
|
45716
45903
|
};
|
|
45717
45904
|
}
|
|
45718
|
-
//
|
|
45719
|
-
// explicit canvas open — so a single ENOENT must not be trusted. Editors and
|
|
45905
|
+
// Avoid dropping an import for a brief ENOENT. Editors and
|
|
45720
45906
|
// AI tools rewrite canvas files via write-temp + rename, and git operations
|
|
45721
45907
|
// (checkout, stash) briefly remove them; a prune racing that window used to
|
|
45722
45908
|
// silently unregister the canvas, leaving the generated tempo-host.tsx
|
|
45723
45909
|
// serving without it and every storyboard stuck "waiting for iframe content"
|
|
45724
45910
|
// until the 180s watchdog (TEM-919). Re-check once after a short delay and
|
|
45725
|
-
// only drop when the file is still gone.
|
|
45911
|
+
// only drop when the file is still gone. Session demand survives the drop
|
|
45912
|
+
// and restores registration on reconciliation when the file returns.
|
|
45726
45913
|
async canvasFileExistsWithRecheck(absolutePath) {
|
|
45727
45914
|
for (let attempt = 0; ; attempt += 1) {
|
|
45728
45915
|
try {
|
|
@@ -47943,7 +48130,7 @@ async function readOptional3(file) {
|
|
|
47943
48130
|
|
|
47944
48131
|
// ../tempo-devserver/tempo-devserver.ts
|
|
47945
48132
|
import { spawn as spawn6 } from "child_process";
|
|
47946
|
-
import { createHash as
|
|
48133
|
+
import { createHash as createHash6, randomUUID as randomUUID2 } from "crypto";
|
|
47947
48134
|
import fs from "fs";
|
|
47948
48135
|
import {
|
|
47949
48136
|
access as access5,
|
|
@@ -48261,7 +48448,7 @@ var pollingScanPool = createPollingScanPool();
|
|
|
48261
48448
|
|
|
48262
48449
|
// ../../modules/file-watcher/watcher.ts
|
|
48263
48450
|
import { lstat as lstat3, realpath as realpath5, stat as stat7 } from "fs/promises";
|
|
48264
|
-
import { createRequire as
|
|
48451
|
+
import { createRequire as createRequire3 } from "module";
|
|
48265
48452
|
import { relative } from "path";
|
|
48266
48453
|
var DEFAULT_DEBOUNCE_MS = 100;
|
|
48267
48454
|
var DEFAULT_MAX_BATCH_SIZE = 1e3;
|
|
@@ -48271,13 +48458,13 @@ var DEFAULT_IDLE_POLLING_INTERVAL_MS = 5e3;
|
|
|
48271
48458
|
var MIN_POLLING_INTERVAL_MS = 10;
|
|
48272
48459
|
var EINTR_RESTART_DELAY_MS = 100;
|
|
48273
48460
|
var MAX_RECOVERY_RESTARTS = 50;
|
|
48274
|
-
var
|
|
48461
|
+
var requireModule2 = createRequire3(
|
|
48275
48462
|
typeof __filename !== "undefined" ? __filename : import.meta.url
|
|
48276
48463
|
);
|
|
48277
48464
|
var nativeWatcherPromise = null;
|
|
48278
48465
|
function loadNativeWatcher() {
|
|
48279
48466
|
nativeWatcherPromise ??= Promise.resolve().then(() => {
|
|
48280
|
-
const loaded =
|
|
48467
|
+
const loaded = requireModule2(
|
|
48281
48468
|
"@parcel/watcher"
|
|
48282
48469
|
);
|
|
48283
48470
|
return loaded.default ?? loaded;
|
|
@@ -49649,7 +49836,7 @@ function installListenerRecorders(): () => void {
|
|
|
49649
49836
|
// ../tempo-devserver/flutter-devserver.ts
|
|
49650
49837
|
import { fileURLToPath, pathToFileURL as pathToFileURL2 } from "url";
|
|
49651
49838
|
import { spawn as spawn5 } from "child_process";
|
|
49652
|
-
import { createHash as
|
|
49839
|
+
import { createHash as createHash5 } from "crypto";
|
|
49653
49840
|
import { constants as fsConstants } from "fs";
|
|
49654
49841
|
import { access as access3, readdir as readdir7, readFile as readFile13, realpath as realpath6, stat as stat8 } from "fs/promises";
|
|
49655
49842
|
import {
|
|
@@ -50502,7 +50689,7 @@ function chooseSourceChangeAction(change) {
|
|
|
50502
50689
|
return "hot";
|
|
50503
50690
|
}
|
|
50504
50691
|
async function readPackageGraphFingerprint(packageDirs, projectRoot) {
|
|
50505
|
-
const hash =
|
|
50692
|
+
const hash = createHash5("sha256");
|
|
50506
50693
|
const dirs = /* @__PURE__ */ new Set();
|
|
50507
50694
|
for (const packageDir of [
|
|
50508
50695
|
...packageDirs,
|
|
@@ -55479,7 +55666,7 @@ async function computeInstallCompletionKey(packageRoot) {
|
|
|
55479
55666
|
if (parent === current) break;
|
|
55480
55667
|
current = parent;
|
|
55481
55668
|
}
|
|
55482
|
-
const hash =
|
|
55669
|
+
const hash = createHash6("sha256");
|
|
55483
55670
|
hash.update(JSON.stringify(dependencyInput));
|
|
55484
55671
|
hash.update("\0");
|
|
55485
55672
|
hash.update(lockfile?.path ?? "no-lockfile");
|
|
@@ -61829,7 +62016,7 @@ import {
|
|
|
61829
62016
|
unlink as unlink3,
|
|
61830
62017
|
writeFile as writeFile10
|
|
61831
62018
|
} from "fs/promises";
|
|
61832
|
-
import { createRequire as
|
|
62019
|
+
import { createRequire as createRequire5 } from "module";
|
|
61833
62020
|
import path34 from "path";
|
|
61834
62021
|
|
|
61835
62022
|
// ../../node_modules/.pnpm/postcss@8.5.28/node_modules/postcss/lib/postcss.mjs
|
|
@@ -61861,7 +62048,7 @@ var Node2 = import_postcss.default.Node;
|
|
|
61861
62048
|
|
|
61862
62049
|
// ../tempo-project/stylesheet-plan.ts
|
|
61863
62050
|
import { readFile as readFile19, realpath as realpath8 } from "fs/promises";
|
|
61864
|
-
import { createRequire as
|
|
62051
|
+
import { createRequire as createRequire4 } from "module";
|
|
61865
62052
|
import path32 from "path";
|
|
61866
62053
|
var import_postcss_value_parser = __toESM(require_lib(), 1);
|
|
61867
62054
|
|
|
@@ -62400,7 +62587,7 @@ import path36 from "path";
|
|
|
62400
62587
|
|
|
62401
62588
|
// ../tempo-project/mirror-user-canvas-deps.ts
|
|
62402
62589
|
import { readFile as readFile23, realpath as realpath10 } from "fs/promises";
|
|
62403
|
-
import { createRequire as
|
|
62590
|
+
import { createRequire as createRequire6 } from "module";
|
|
62404
62591
|
import path37 from "path";
|
|
62405
62592
|
|
|
62406
62593
|
// ../tempo-project/install-app-dep-roots.ts
|
|
@@ -62834,7 +63021,7 @@ async function startDevserverSession(options) {
|
|
|
62834
63021
|
// ../canvas-capture-headless/src/enumerate.ts
|
|
62835
63022
|
import { access as access16, readFile as readFile29 } from "fs/promises";
|
|
62836
63023
|
import path42 from "path";
|
|
62837
|
-
import { createHash as
|
|
63024
|
+
import { createHash as createHash7 } from "crypto";
|
|
62838
63025
|
|
|
62839
63026
|
// ../canvas-capture-headless/src/ignore-mask.ts
|
|
62840
63027
|
function ignoredStoryboardArea(regions, width, height) {
|
|
@@ -62939,7 +63126,7 @@ async function enumerateCanvasStoryboards(options) {
|
|
|
62939
63126
|
canvasPath: parsed.canvasPath ?? toPosixPath3(
|
|
62940
63127
|
path42.relative(projectRoot, path42.dirname(filePath))
|
|
62941
63128
|
),
|
|
62942
|
-
revision:
|
|
63129
|
+
revision: createHash7("sha256").update(source).digest("hex")
|
|
62943
63130
|
}
|
|
62944
63131
|
} : storyboard.kind === "html" ? {
|
|
62945
63132
|
source: {
|
|
@@ -64223,4 +64410,4 @@ export {
|
|
|
64223
64410
|
buildBaselineCaptureArgs,
|
|
64224
64411
|
main
|
|
64225
64412
|
};
|
|
64226
|
-
//# sourceMappingURL=chunk-
|
|
64413
|
+
//# sourceMappingURL=chunk-QZQGESF4.js.map
|