@tempo-ai/visual-review 0.0.125 → 0.0.126-staging.2

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 CHANGED
@@ -7,11 +7,11 @@ async function main(argv = process.argv.slice(2)) {
7
7
  const [command, ...commandArgs] = argv;
8
8
  switch (command) {
9
9
  case "capture":
10
- return await (await import("./cli-XCXFIBBF.js")).main(commandArgs);
10
+ return await (await import("./cli-ZHNSPGSE.js")).main(commandArgs);
11
11
  case "claim":
12
- return await (await import("./claim-47UEXY7A.js")).main(commandArgs);
12
+ return await (await import("./claim-C5UVLSMX.js")).main(commandArgs);
13
13
  case "report":
14
- return await (await import("./report-TEA7R5RI.js")).main(commandArgs);
14
+ return await (await import("./report-PERKWEX4.js")).main(commandArgs);
15
15
  case "install-browsers":
16
16
  return await (await import("./install-browsers-VPIMDVB6.js")).main(commandArgs);
17
17
  default:
@@ -3,7 +3,7 @@ import {
3
3
  DEFAULT_VISUAL_REVIEW_INGEST_URL,
4
4
  githubPullRequestContext,
5
5
  resolveIngestCredential
6
- } from "./chunk-HVWIRSNY.js";
6
+ } from "./chunk-WZN4UX2B.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require,
@@ -29354,6 +29354,28 @@ var VisualReviewIngestClient = class {
29354
29354
  );
29355
29355
  }
29356
29356
  }
29357
+ /** Upload latency is independent of the render workers' CPU budget. Keep
29358
+ * eight requests in flight, refilling each slot as it completes. On error,
29359
+ * stop admitting work and drain the other requests before rejecting: the
29360
+ * caller must not finalize or release its capture lease mid-upload. */
29361
+ async uploadBlobs(blobs) {
29362
+ let next = 0;
29363
+ let failure;
29364
+ await Promise.all(
29365
+ Array.from({ length: Math.min(8, blobs.length) }, async () => {
29366
+ while (!failure) {
29367
+ const blob = blobs[next++];
29368
+ if (!blob) return;
29369
+ try {
29370
+ await this.uploadBlob(blob.hash, blob.bytes, blob);
29371
+ } catch (error) {
29372
+ failure ??= { error };
29373
+ }
29374
+ }
29375
+ })
29376
+ );
29377
+ if (failure) throw failure.error;
29378
+ }
29357
29379
  async claimBaseline(input) {
29358
29380
  try {
29359
29381
  const response = await this.request("/visual-review/baseline/claim", {
@@ -30181,11 +30203,14 @@ async function main(argv = process.argv.slice(2)) {
30181
30203
  );
30182
30204
  log(`uploading ${missing.length} of ${blobsByHash.size} blob(s)`);
30183
30205
  await timing.phase("upload", async () => {
30184
- for (const hash of missing) {
30185
- const blob = blobsByHash.get(hash);
30186
- if (!blob) throw new Error(`negotiate returned unknown hash ${hash}`);
30187
- await ingest.uploadBlob(hash, blob.bytes, blob);
30188
- }
30206
+ await ingest.uploadBlobs(
30207
+ missing.map((hash) => {
30208
+ const blob = blobsByHash.get(hash);
30209
+ if (!blob)
30210
+ throw new Error(`negotiate returned unknown hash ${hash}`);
30211
+ return { hash, ...blob };
30212
+ })
30213
+ );
30189
30214
  });
30190
30215
  finalizeResult = await timing.phase(
30191
30216
  "finalize",
@@ -30265,4 +30290,4 @@ export {
30265
30290
  buildBaselineCaptureArgs,
30266
30291
  main
30267
30292
  };
30268
- //# sourceMappingURL=chunk-ZBXLSXRH.js.map
30293
+ //# sourceMappingURL=chunk-5WAJ4KGX.js.map