@tempo-ai/mcp 0.0.139 → 0.0.140

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.
@@ -88519,7 +88519,7 @@ var MissingRootDepsError = class extends TempoDevServerError {
88519
88519
  // ../tempo-sdk/package.json
88520
88520
  var package_default = {
88521
88521
  name: "tempo-sdk",
88522
- version: "0.0.92",
88522
+ version: "0.0.93",
88523
88523
  publishConfig: {
88524
88524
  tag: "sdk-v2-latest"
88525
88525
  },
@@ -100221,7 +100221,7 @@ var TempoDevServer = class _TempoDevServer {
100221
100221
  sdkUpgradeResult = preparedSdkUpgrade ?? await ensureTempoSdkChannelSpec(this.commandCwd, options2?.signal, {
100222
100222
  updateCommand: this.config.scripts.updateSdk,
100223
100223
  runCommand: async (command, cwd, signal) => {
100224
- options2?.onInstallStart?.();
100224
+ options2?.onInstallStart?.("sdk-update");
100225
100225
  const affectedRoots = this.config.scripts.updateSdk?.trim() || (await resolveTempoSdkUpgradePlan(cwd)).governedByAncestorWorkspace ? installRoots : [this.tempoRoot];
100226
100226
  sdkInstallReceipts = /* @__PURE__ */ new Map();
100227
100227
  this.state.dependenciesInstalled = false;
@@ -100578,14 +100578,17 @@ var TempoDevServer = class _TempoDevServer {
100578
100578
  options2.signal,
100579
100579
  {
100580
100580
  updateCommand: this.config.scripts.updateSdk,
100581
- runCommand: async (command, cwd, signal) => runShellCommand(
100582
- command,
100583
- cwd,
100584
- signal,
100585
- options2.onOutput,
100586
- this.projectRoot,
100587
- await this.nuxtSidecarNodePathEnv()
100588
- )
100581
+ runCommand: async (command, cwd, signal) => {
100582
+ options2.onInstallStart?.("sdk-update");
100583
+ return runShellCommand(
100584
+ command,
100585
+ cwd,
100586
+ signal,
100587
+ options2.onOutput,
100588
+ this.projectRoot,
100589
+ await this.nuxtSidecarNodePathEnv()
100590
+ );
100591
+ }
100589
100592
  }
100590
100593
  );
100591
100594
  if (result2.error)
@@ -100595,6 +100598,7 @@ var TempoDevServer = class _TempoDevServer {
100595
100598
  result2.error
100596
100599
  );
100597
100600
  if (!result2.attempted) {
100601
+ options2.onInstallStart?.();
100598
100602
  await runShellCommand(
100599
100603
  this.config.scripts.updateSdk,
100600
100604
  this.commandCwd,
@@ -123289,6 +123293,7 @@ function buildSettleWaitScript(options2) {
123289
123293
  return `
123290
123294
  (function() {
123291
123295
  var selector = ${JSON.stringify(options2.selector)};
123296
+ var waitForMedia = ${options2.waitForMedia !== false};
123292
123297
  var pendingSelector = ${JSON.stringify(options2.pendingSelector ?? null)};
123293
123298
  var quietMs = ${quietMs};
123294
123299
  var stepTimeoutMs = ${stepTimeoutMs};
@@ -123530,7 +123535,7 @@ function buildSettleWaitScript(options2) {
123530
123535
  releaseVideoFrames();
123531
123536
  return false;
123532
123537
  }
123533
- var videos = renderedMatches(target, 'video');
123538
+ var videos = waitForMedia ? renderedMatches(target, 'video') : [];
123534
123539
  if (strictVideoFrames) {
123535
123540
  videoFrames.forEach(function(entry) {
123536
123541
  if (videos.indexOf(entry.video) === -1) releaseVideoFrame(entry);
@@ -123548,7 +123553,7 @@ function buildSettleWaitScript(options2) {
123548
123553
  return false;
123549
123554
  }
123550
123555
  }
123551
- var images = renderedImages(target);
123556
+ var images = waitForMedia ? renderedImages(target) : [];
123552
123557
  for (var i = 0; i < images.length; i++) {
123553
123558
  if (images[i].loading === 'lazy') images[i].loading = 'eager';
123554
123559
  }
@@ -132048,9 +132053,9 @@ async function settleAstroDocument(page, target, timeout) {
132048
132053
  });
132049
132054
  }
132050
132055
 
132051
- // ../../modules/iframe-projection/visual-readiness.ts
132052
- var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132053
- return new Promise(function(resolve) {
132056
+ // ../../modules/iframe-projection/visual-readiness-source.ts
132057
+ var DOCUMENT_VISUAL_READINESS_SOURCE = `return (function documentVisualReadiness(doc, options) {
132058
+ return new Promise(function (resolve) {
132054
132059
  var view = doc.defaultView;
132055
132060
  var failures = [];
132056
132061
  var failedLinks = new WeakMap();
@@ -132059,7 +132064,15 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132059
132064
  var stopped = false;
132060
132065
  var timer;
132061
132066
  var observer;
132062
- var remaining = Math.max(0, Math.min(options.timeoutMs, options.resourceBudget ? options.resourceBudget.remainingMs : options.timeoutMs));
132067
+ var remaining = Math.max(
132068
+ 0,
132069
+ Math.min(
132070
+ options.timeoutMs,
132071
+ options.resourceBudget
132072
+ ? options.resourceBudget.remainingMs
132073
+ : options.timeoutMs,
132074
+ ),
132075
+ );
132063
132076
  var timerAt;
132064
132077
  var queued = 0;
132065
132078
  var admittedSlice;
@@ -132067,34 +132080,56 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132067
132080
  var checksDirty = false;
132068
132081
  var revision = 0;
132069
132082
  var terminalResolve;
132070
- var terminal = new Promise(function(done) { terminalResolve = done; });
132083
+ var terminal = new Promise(function (done) {
132084
+ terminalResolve = done;
132085
+ });
132071
132086
  function failure(kind, url) {
132072
- if (!failures.some(function(item) { return item.kind === kind && item.url === url; }))
132087
+ if (
132088
+ !failures.some(function (item) {
132089
+ return item.kind === kind && item.url === url;
132090
+ })
132091
+ )
132073
132092
  failures.push(url ? { kind: kind, url: url } : { kind: kind });
132074
132093
  }
132075
132094
  function finish(status) {
132076
132095
  if (stopped) return;
132077
- if (status === 'ready' && options.onReadyProof) options.onReadyProof();
132096
+ if (status === "ready" && options.onReadyProof) options.onReadyProof();
132078
132097
  if (stopped) return;
132079
132098
  stopped = true;
132080
- if (options.resourceBudget) options.resourceBudget.remainingMs = queued ? remaining :
132081
- Math.max(0, remaining - (timerAt === undefined ? 0 : Date.now() - timerAt));
132099
+ if (options.resourceBudget)
132100
+ options.resourceBudget.remainingMs = queued
132101
+ ? remaining
132102
+ : Math.max(
132103
+ 0,
132104
+ remaining - (timerAt === undefined ? 0 : Date.now() - timerAt),
132105
+ );
132082
132106
  clearTimeout(timer);
132083
132107
  if (observer) observer.disconnect();
132084
132108
  for (var cleanup of cleanups) cleanup();
132085
132109
  cleanups.clear();
132086
132110
  checks.clear();
132087
- if (options.signal) options.signal.removeEventListener('abort', cancel);
132111
+ if (options.signal) options.signal.removeEventListener("abort", cancel);
132088
132112
  terminalResolve();
132089
132113
  resolve({ status: status, failures: failures });
132090
132114
  }
132091
- function cancel() { finish('cancelled'); }
132092
- if (options.signal && options.signal.aborted) { cancel(); return; }
132093
- if (!view) { cancel(); return; }
132094
- if (options.signal) options.signal.addEventListener('abort', cancel, { once: true });
132115
+ function cancel() {
132116
+ finish("cancelled");
132117
+ }
132118
+ if (options.signal && options.signal.aborted) {
132119
+ cancel();
132120
+ return;
132121
+ }
132122
+ if (!view) {
132123
+ cancel();
132124
+ return;
132125
+ }
132126
+ if (options.signal)
132127
+ options.signal.addEventListener("abort", cancel, { once: true });
132095
132128
  function startTimer() {
132096
132129
  timerAt = Date.now();
132097
- timer = setTimeout(function() { finish('timeout'); }, remaining);
132130
+ timer = setTimeout(function () {
132131
+ finish("timeout");
132132
+ }, remaining);
132098
132133
  }
132099
132134
  startTimer();
132100
132135
  async function work(callback) {
@@ -132105,12 +132140,19 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132105
132140
  remaining = Math.max(0, remaining - (Date.now() - timerAt));
132106
132141
  }
132107
132142
  try {
132108
- if (admittedSlice && admittedSlice.canContinue && admittedSlice.canContinue())
132143
+ if (
132144
+ admittedSlice &&
132145
+ admittedSlice.canContinue &&
132146
+ admittedSlice.canContinue()
132147
+ )
132109
132148
  return callback(admittedSlice);
132110
- return await Promise.race([terminal, options.scheduleWork(function(slice) {
132111
- admittedSlice = slice;
132112
- if (!stopped) return callback(slice);
132113
- }, options.signal)]);
132149
+ return await Promise.race([
132150
+ terminal,
132151
+ options.scheduleWork(function (slice) {
132152
+ admittedSlice = slice;
132153
+ if (!stopped) return callback(slice);
132154
+ }, options.signal),
132155
+ ]);
132114
132156
  } finally {
132115
132157
  if (--queued === 0 && !stopped) startTimer();
132116
132158
  }
@@ -132119,7 +132161,7 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132119
132161
  var rows = [];
132120
132162
  var offset = 0;
132121
132163
  while (offset < items.length && !stopped) {
132122
- await work(function(slice) {
132164
+ await work(function (slice) {
132123
132165
  var limit = Math.min(offset + 32, items.length);
132124
132166
  do {
132125
132167
  var value = callback(items[offset++]);
@@ -132129,19 +132171,34 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132129
132171
  }
132130
132172
  return rows;
132131
132173
  }
132132
- if (remaining <= 0) { finish('timeout'); return; }
132174
+ if (remaining <= 0) {
132175
+ finish("timeout");
132176
+ return;
132177
+ }
132133
132178
  function changed() {
132134
132179
  if (stopped) return;
132135
- if (!options.scheduleWork) { for (var check of checks) check(); return; }
132136
- if (checksPending) { checksDirty = true; return; }
132180
+ if (!options.scheduleWork) {
132181
+ for (var check of checks) check();
132182
+ return;
132183
+ }
132184
+ if (checksPending) {
132185
+ checksDirty = true;
132186
+ return;
132187
+ }
132137
132188
  checksPending = true;
132138
132189
  checksDirty = false;
132139
- mapWork(Array.from(checks), function(check) { check(); }).finally(function() {
132140
- checksPending = false;
132141
- if (checksDirty) changed();
132142
- }).catch(function() { finish('cancelled'); });
132190
+ mapWork(Array.from(checks), function (check) {
132191
+ check();
132192
+ })
132193
+ .finally(function () {
132194
+ checksPending = false;
132195
+ if (checksDirty) changed();
132196
+ })
132197
+ .catch(function () {
132198
+ finish("cancelled");
132199
+ });
132143
132200
  }
132144
- observer = new view.MutationObserver(function() {
132201
+ observer = new view.MutationObserver(function () {
132145
132202
  revision++;
132146
132203
  changed();
132147
132204
  });
@@ -132149,41 +132206,62 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132149
132206
  // Opt-in admission may begin after a resource's terminal event. Preserve
132150
132207
  // its URL-scoped failure evidence while the initial inventory is queued.
132151
132208
  if (options.scheduleWork) {
132152
- var captureError = function(event) {
132209
+ var captureError = function (event) {
132153
132210
  var link = event.target;
132154
- if (link && link.tagName === 'LINK' && link.relList.contains('stylesheet') && applicable(link)) {
132211
+ if (
132212
+ link &&
132213
+ link.tagName === "LINK" &&
132214
+ link.relList.contains("stylesheet") &&
132215
+ applicable(link)
132216
+ ) {
132155
132217
  failedLinks.set(link, link.href);
132156
- failure('stylesheet', link.href);
132218
+ failure("stylesheet", link.href);
132157
132219
  changed();
132158
132220
  }
132159
132221
  };
132160
- doc.addEventListener('error', captureError, true);
132161
- cleanups.add(function() { doc.removeEventListener('error', captureError, true); });
132222
+ doc.addEventListener("error", captureError, true);
132223
+ cleanups.add(function () {
132224
+ doc.removeEventListener("error", captureError, true);
132225
+ });
132162
132226
  }
132163
132227
 
132164
132228
  function applicable(link) {
132165
- return link.isConnected && !link.disabled &&
132166
- (!link.media || !view.matchMedia || view.matchMedia(link.media).matches);
132229
+ return (
132230
+ link.isConnected &&
132231
+ !link.disabled &&
132232
+ (!link.media || !view.matchMedia || view.matchMedia(link.media).matches)
132233
+ );
132167
132234
  }
132168
132235
  function links() {
132169
- return Array.from(doc.querySelectorAll('link[rel~="stylesheet"]')).filter(applicable);
132236
+ return Array.from(doc.querySelectorAll('link[rel~="stylesheet"]')).filter(
132237
+ applicable,
132238
+ );
132170
132239
  }
132171
132240
  function visibleImage(img) {
132172
132241
  if (!img.isConnected) return false;
132173
132242
  var rect = img.getBoundingClientRect();
132174
132243
  var style = view.getComputedStyle(img);
132175
- return rect.width > 0 && rect.height > 0 && rect.bottom > 0 && rect.right > 0 &&
132176
- rect.top < view.innerHeight && rect.left < view.innerWidth &&
132177
- style.visibility !== 'hidden' && style.visibility !== 'collapse';
132244
+ return (
132245
+ rect.width > 0 &&
132246
+ rect.height > 0 &&
132247
+ rect.bottom > 0 &&
132248
+ rect.right > 0 &&
132249
+ rect.top < view.innerHeight &&
132250
+ rect.left < view.innerWidth &&
132251
+ style.visibility !== "hidden" &&
132252
+ style.visibility !== "collapse"
132253
+ );
132178
132254
  }
132179
132255
  function images() {
132180
- return Array.from(doc.querySelectorAll('img')).filter(visibleImage);
132256
+ return Array.from(doc.querySelectorAll("img")).filter(visibleImage);
132181
132257
  }
132182
132258
  async function scheduledImages() {
132183
- var candidates, selected = [], offset = 0;
132259
+ var candidates,
132260
+ selected = [],
132261
+ offset = 0;
132184
132262
  do {
132185
- await work(function(slice) {
132186
- if (!candidates) candidates = Array.from(doc.querySelectorAll('img'));
132263
+ await work(function (slice) {
132264
+ if (!candidates) candidates = Array.from(doc.querySelectorAll("img"));
132187
132265
  var limit = Math.min(offset + 32, candidates.length);
132188
132266
  while (offset < limit) {
132189
132267
  var img = candidates[offset++];
@@ -132196,70 +132274,107 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132196
132274
  }
132197
132275
  function decodeImage(img) {
132198
132276
  if (!img.isConnected || !visibleImage(img)) return {};
132199
- if (!img.naturalWidth) { failure('image', img.currentSrc || img.src); return {}; }
132277
+ if (!img.naturalWidth) {
132278
+ failure("image", img.currentSrc || img.src);
132279
+ return {};
132280
+ }
132200
132281
  // A holder keeps a resource decode promise outside CPU admission.
132201
- return { decode: img.decode && img.decode().catch(function() {
132202
- failure('image', img.currentSrc || img.src);
132203
- }) };
132282
+ return {
132283
+ decode:
132284
+ img.decode &&
132285
+ img.decode().catch(function () {
132286
+ failure("image", img.currentSrc || img.src);
132287
+ }),
132288
+ };
132204
132289
  }
132205
132290
  function waitElement(element, ready, kind, url) {
132206
132291
  if (ready()) return Promise.resolve();
132207
- return new Promise(function(done) {
132292
+ return new Promise(function (done) {
132208
132293
  function requestCheck() {
132209
132294
  if (options.scheduleWork) changed();
132210
132295
  else check();
132211
132296
  }
132212
132297
  function cleanup() {
132213
- element.removeEventListener('load', requestCheck);
132214
- element.removeEventListener('error', error);
132298
+ element.removeEventListener("load", requestCheck);
132299
+ element.removeEventListener("error", error);
132215
132300
  checks.delete(check);
132216
132301
  cleanups.delete(cleanup);
132217
132302
  }
132218
- function check() { if (ready()) { cleanup(); done(); } }
132303
+ function check() {
132304
+ if (ready()) {
132305
+ cleanup();
132306
+ done();
132307
+ }
132308
+ }
132219
132309
  function error() {
132220
132310
  failure(kind, url);
132221
- if (kind === 'stylesheet') failedLinks.set(element, url);
132222
- cleanup(); done();
132311
+ if (kind === "stylesheet") failedLinks.set(element, url);
132312
+ cleanup();
132313
+ done();
132223
132314
  }
132224
132315
  cleanups.add(cleanup);
132225
132316
  checks.add(check);
132226
- element.addEventListener('load', requestCheck);
132227
- element.addEventListener('error', error);
132317
+ element.addEventListener("load", requestCheck);
132318
+ element.addEventListener("error", error);
132228
132319
  check();
132229
132320
  });
132230
132321
  }
132231
132322
  function inventory() {
132232
132323
  return {
132233
- links: links().map(function(link) {
132324
+ links: links().map(function (link) {
132234
132325
  // Resource evidence can change during a font/image await without
132235
132326
  // changing this node's URL or media. Revalidate the same readiness
132236
132327
  // facts, not CSSStyleSheet object identities or a content hash.
132237
- return [link, link.href, link.media, !!link.sheet,
132238
- link.getAttribute('data-tempo-stylesheet-pending') === link.href,
132239
- link.getAttribute('data-tempo-stylesheet-error') === link.href];
132328
+ return [
132329
+ link,
132330
+ link.href,
132331
+ link.media,
132332
+ !!link.sheet,
132333
+ link.getAttribute("data-tempo-stylesheet-pending") === link.href,
132334
+ link.getAttribute("data-tempo-stylesheet-error") === link.href,
132335
+ ];
132336
+ }),
132337
+ images: images().map(function (img) {
132338
+ return [img, img.currentSrc, img.src, img.srcset];
132339
+ }),
132340
+ styles: Array.from(doc.querySelectorAll("style")).map(function (style) {
132341
+ return [style, style.textContent];
132240
132342
  }),
132241
- images: images().map(function(img) { return [img, img.currentSrc, img.src, img.srcset]; }),
132242
- styles: Array.from(doc.querySelectorAll('style')).map(function(style) { return [style, style.textContent]; })
132243
132343
  };
132244
132344
  }
132245
132345
  async function scheduledInventory() {
132246
- var candidates, offset = 0;
132346
+ var candidates,
132347
+ offset = 0;
132247
132348
  var result = { revision: revision, links: [], images: [], styles: [] };
132248
132349
  // Small inventories finish in one admission. Large ones retain the
132249
132350
  // same 32-node/time bound, without paying a task per resource category.
132250
132351
  do {
132251
- await work(function(slice) {
132252
- if (!candidates) candidates = Array.from(doc.querySelectorAll('link[rel~="stylesheet"],img,style'));
132352
+ await work(function (slice) {
132353
+ if (!candidates)
132354
+ candidates = Array.from(
132355
+ doc.querySelectorAll('link[rel~="stylesheet"],img,style'),
132356
+ );
132253
132357
  var limit = Math.min(offset + 32, candidates.length);
132254
132358
  while (offset < limit) {
132255
132359
  var node = candidates[offset++];
132256
- if (node.localName === 'link' && applicable(node)) {
132257
- result.links.push([node, node.href, node.media, !!node.sheet,
132258
- node.getAttribute('data-tempo-stylesheet-pending') === node.href,
132259
- node.getAttribute('data-tempo-stylesheet-error') === node.href]);
132260
- } else if (node.localName === 'img' && visibleImage(node)) {
132261
- result.images.push([node, node.currentSrc, node.src, node.srcset]);
132262
- } else if (node.localName === 'style') {
132360
+ if (node.localName === "link" && applicable(node)) {
132361
+ result.links.push([
132362
+ node,
132363
+ node.href,
132364
+ node.media,
132365
+ !!node.sheet,
132366
+ node.getAttribute("data-tempo-stylesheet-pending") ===
132367
+ node.href,
132368
+ node.getAttribute("data-tempo-stylesheet-error") === node.href,
132369
+ ]);
132370
+ } else if (node.localName === "img" && visibleImage(node)) {
132371
+ result.images.push([
132372
+ node,
132373
+ node.currentSrc,
132374
+ node.src,
132375
+ node.srcset,
132376
+ ]);
132377
+ } else if (node.localName === "style") {
132263
132378
  result.styles.push([node, node.textContent]);
132264
132379
  }
132265
132380
  if (slice && !slice.hasTime()) break;
@@ -132269,48 +132384,86 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132269
132384
  return result;
132270
132385
  }
132271
132386
  function same(a, b) {
132272
- return ['links', 'images', 'styles'].every(function(key) {
132273
- return a[key].length === b[key].length && a[key].every(function(row, i) {
132274
- return row.every(function(value, j) { return value === b[key][i][j]; });
132275
- });
132387
+ return ["links", "images", "styles"].every(function (key) {
132388
+ return (
132389
+ a[key].length === b[key].length &&
132390
+ a[key].every(function (row, i) {
132391
+ return row.every(function (value, j) {
132392
+ return value === b[key][i][j];
132393
+ });
132394
+ })
132395
+ );
132276
132396
  });
132277
132397
  }
132278
132398
  async function run() {
132279
132399
  while (!stopped) {
132280
- var before = options.scheduleWork ? await scheduledInventory() : inventory();
132400
+ var before = options.scheduleWork
132401
+ ? await scheduledInventory()
132402
+ : inventory();
132281
132403
  if (stopped) return;
132282
- await Promise.race([terminal, Promise.all(before.links.map(function(row) { return row[0]; }).map(function(link) {
132283
- if ((!link.sheet && (options.failedStylesheetUrls || []).includes(link.href)) ||
132284
- link.getAttribute('data-tempo-stylesheet-error') === link.href) {
132285
- failedLinks.set(link, link.href); failure('stylesheet', link.href);
132286
- }
132287
- return waitElement(link, function() {
132288
- return !applicable(link) || (link.getAttribute('data-tempo-stylesheet-pending') !== link.href &&
132289
- (!!link.sheet || failedLinks.get(link) === link.href));
132290
- }, 'stylesheet', link.href);
132291
- }))]);
132404
+ await Promise.race([
132405
+ terminal,
132406
+ Promise.all(
132407
+ before.links
132408
+ .map(function (row) {
132409
+ return row[0];
132410
+ })
132411
+ .map(function (link) {
132412
+ if (
132413
+ (!link.sheet &&
132414
+ (options.failedStylesheetUrls || []).includes(link.href)) ||
132415
+ link.getAttribute("data-tempo-stylesheet-error") === link.href
132416
+ ) {
132417
+ failedLinks.set(link, link.href);
132418
+ failure("stylesheet", link.href);
132419
+ }
132420
+ return waitElement(
132421
+ link,
132422
+ function () {
132423
+ return (
132424
+ !applicable(link) ||
132425
+ (link.getAttribute("data-tempo-stylesheet-pending") !==
132426
+ link.href &&
132427
+ (!!link.sheet || failedLinks.get(link) === link.href))
132428
+ );
132429
+ },
132430
+ "stylesheet",
132431
+ link.href,
132432
+ );
132433
+ }),
132434
+ ),
132435
+ ]);
132292
132436
  if (stopped) return;
132293
132437
  // Force stylesheet application/layout BEFORE reading the current font
132294
132438
  // promise. A previously fulfilled promise cannot certify newly used fonts.
132295
- var readFontPromise = function() {
132439
+ var readFontPromise = function () {
132296
132440
  if (doc.documentElement) doc.documentElement.getBoundingClientRect();
132297
132441
  // Read the CURRENT promise in the same admitted layout callback.
132298
132442
  return { promise: doc.fonts && doc.fonts.ready };
132299
132443
  };
132300
- var currentFonts = options.scheduleWork ? await work(readFontPromise) : readFontPromise();
132444
+ var currentFonts = options.scheduleWork
132445
+ ? await work(readFontPromise)
132446
+ : readFontPromise();
132301
132447
  if (stopped) return;
132302
132448
  var fontPromise = currentFonts.promise;
132303
132449
  var fontRejected = false;
132304
- await Promise.race([terminal, Promise.resolve(fontPromise).catch(function() {
132305
- fontRejected = true; failure('font');
132306
- })]);
132450
+ await Promise.race([
132451
+ terminal,
132452
+ Promise.resolve(fontPromise).catch(function () {
132453
+ fontRejected = true;
132454
+ failure("font");
132455
+ }),
132456
+ ]);
132307
132457
  if (stopped) return;
132308
- var selected = options.scheduleWork ? await scheduledImages() : images();
132458
+ var selected = options.scheduleWork
132459
+ ? await scheduledImages()
132460
+ : images();
132309
132461
  if (stopped) return;
132310
132462
  if (options.scheduleWork) {
132311
- var pendingImages = [], pendingLoads = [];
132312
- var imageWaits = await mapWork(selected, function(img) {
132313
- if (img.loading === 'lazy') img.loading = 'eager';
132463
+ var pendingImages = [],
132464
+ pendingLoads = [];
132465
+ var imageWaits = await mapWork(selected, function (img) {
132466
+ if (img.loading === "lazy") img.loading = "eager";
132314
132467
  // Warm images need no load-event continuation. Prepare their
132315
132468
  // decodes in this bounded batch rather than one new task per image.
132316
132469
  if (img.complete) {
@@ -132318,60 +132471,116 @@ var DOCUMENT_VISUAL_READINESS_SOURCE = String.raw`
132318
132471
  return Promise.race([terminal, Promise.resolve(proof.decode)]);
132319
132472
  }
132320
132473
  pendingImages.push(img);
132321
- pendingLoads.push(Promise.race([terminal, waitElement(img, function() {
132322
- return !img.isConnected || !visibleImage(img) || img.complete;
132323
- }, 'image', img.currentSrc || img.src)]));
132474
+ pendingLoads.push(
132475
+ Promise.race([
132476
+ terminal,
132477
+ waitElement(
132478
+ img,
132479
+ function () {
132480
+ return (
132481
+ !img.isConnected || !visibleImage(img) || img.complete
132482
+ );
132483
+ },
132484
+ "image",
132485
+ img.currentSrc || img.src,
132486
+ ),
132487
+ ]),
132488
+ );
132324
132489
  });
132325
132490
  await Promise.race([terminal, Promise.all(pendingLoads)]);
132326
132491
  if (stopped) return;
132327
132492
  // Load events often arrive together from the browser cache. Decode
132328
132493
  // their now-ready images in bounded batches, rather than granting
132329
132494
  // each event its own renderer task. Warm decodes above stay in flight.
132330
- var loadedDecodes = await mapWork(pendingImages, function(img) {
132495
+ var loadedDecodes = await mapWork(pendingImages, function (img) {
132331
132496
  var proof = decodeImage(img);
132332
132497
  return Promise.race([terminal, Promise.resolve(proof.decode)]);
132333
132498
  });
132334
- await Promise.race([terminal, Promise.all(imageWaits.concat(loadedDecodes))]);
132499
+ await Promise.race([
132500
+ terminal,
132501
+ Promise.all(imageWaits.concat(loadedDecodes)),
132502
+ ]);
132335
132503
  } else {
132336
- await Promise.race([terminal, Promise.all(selected.map(async function(img) {
132337
- if (img.loading === 'lazy') img.loading = 'eager';
132338
- await Promise.race([terminal, waitElement(img, function() {
132339
- return !img.isConnected || !visibleImage(img) || img.complete;
132340
- }, 'image', img.currentSrc || img.src)]);
132341
- if (stopped || !img.isConnected || !visibleImage(img)) return;
132342
- if (!img.naturalWidth) { failure('image', img.currentSrc || img.src); return; }
132343
- if (img.decode) await img.decode().catch(function() {
132344
- failure('image', img.currentSrc || img.src);
132345
- });
132346
- }))]);
132504
+ await Promise.race([
132505
+ terminal,
132506
+ Promise.all(
132507
+ selected.map(async function (img) {
132508
+ if (img.loading === "lazy") img.loading = "eager";
132509
+ await Promise.race([
132510
+ terminal,
132511
+ waitElement(
132512
+ img,
132513
+ function () {
132514
+ return (
132515
+ !img.isConnected || !visibleImage(img) || img.complete
132516
+ );
132517
+ },
132518
+ "image",
132519
+ img.currentSrc || img.src,
132520
+ ),
132521
+ ]);
132522
+ if (stopped || !img.isConnected || !visibleImage(img)) return;
132523
+ if (!img.naturalWidth) {
132524
+ failure("image", img.currentSrc || img.src);
132525
+ return;
132526
+ }
132527
+ if (img.decode)
132528
+ await img.decode().catch(function () {
132529
+ failure("image", img.currentSrc || img.src);
132530
+ });
132531
+ }),
132532
+ ),
132533
+ ]);
132347
132534
  }
132348
132535
  if (stopped) return;
132349
- if (doc.fonts) doc.fonts.forEach(function(face) {
132350
- if (face.status === 'error') failure('font', face.family);
132351
- });
132352
- var after = options.scheduleWork ? await scheduledInventory() : inventory();
132536
+ if (doc.fonts)
132537
+ doc.fonts.forEach(function (face) {
132538
+ if (face.status === "error") failure("font", face.family);
132539
+ });
132540
+ var after = options.scheduleWork
132541
+ ? await scheduledInventory()
132542
+ : inventory();
132353
132543
  if (stopped) return;
132354
132544
  // A scheduled inventory can span multiple tasks. A mutation during
132355
132545
  // its geometry reads cannot certify a mixed document observation.
132356
132546
  if (options.scheduleWork && observer.takeRecords().length) revision++;
132357
- if ((!options.scheduleWork || options.requireStableDom === false || (before.revision === after.revision && after.revision === revision)) &&
132358
- same(before, after) && (!doc.fonts || fontRejected ||
132359
- (doc.fonts.status !== 'loading' && doc.fonts.ready === fontPromise))) {
132360
- finish('ready'); return;
132547
+ if (
132548
+ (!options.scheduleWork ||
132549
+ options.requireStableDom === false ||
132550
+ (before.revision === after.revision &&
132551
+ after.revision === revision)) &&
132552
+ same(before, after) &&
132553
+ (!doc.fonts ||
132554
+ fontRejected ||
132555
+ (doc.fonts.status !== "loading" && doc.fonts.ready === fontPromise))
132556
+ ) {
132557
+ finish("ready");
132558
+ return;
132361
132559
  }
132362
132560
  // Let resource events and the deadline run if this document keeps
132363
132561
  // discovering assets; never monopolize the microtask queue.
132364
- await Promise.race([terminal, new Promise(function(done) {
132365
- var retry = setTimeout(function() { cleanups.delete(cleanup); done(); }, 0);
132366
- function cleanup() { clearTimeout(retry); done(); }
132367
- cleanups.add(cleanup);
132368
- })]);
132562
+ await Promise.race([
132563
+ terminal,
132564
+ new Promise(function (done) {
132565
+ var retry = setTimeout(function () {
132566
+ cleanups.delete(cleanup);
132567
+ done();
132568
+ }, 0);
132569
+ function cleanup() {
132570
+ clearTimeout(retry);
132571
+ done();
132572
+ }
132573
+ cleanups.add(cleanup);
132574
+ }),
132575
+ ]);
132369
132576
  }
132370
132577
  }
132371
132578
  // Unexpected browser/document loss is not a successful fallback rendering.
132372
- run().catch(function() { finish('cancelled'); });
132579
+ run().catch(function () {
132580
+ finish("cancelled");
132581
+ });
132373
132582
  });
132374
- `;
132583
+ })(doc, options);`;
132375
132584
 
132376
132585
  // ../../modules/frame-pool/visual-ready-script.ts
132377
132586
  function buildVisualReadyWaitScript(timeoutMs, failedStylesheetUrls = []) {
@@ -135133,6 +135342,9 @@ ${hasPackageManagerField2 ? "" : ` with:
135133
135342
  ${nodeSetup(null)}`;
135134
135343
  }
135135
135344
  }
135345
+ function skipRootInstall(options2, tempoDir) {
135346
+ return options2.hasRootPackage === false && tempoDir !== ".";
135347
+ }
135136
135348
  function hostDirComment(tempoDir) {
135137
135349
  return tempoDir === "." ? "" : ` # The canvas host under \`${tempoDir}/\` is its own package. Capture never
135138
135350
  # mutates this checkout (TEMPO_DEVSERVER_PROTECTED_ROOTS below), so the
@@ -135181,8 +135393,8 @@ ${runBlockStep(
135181
135393
  customLines.map(
135182
135394
  (line, index) => index === 0 && tempoDir !== "." ? `cd ${tempoDir} && ${line}` : line
135183
135395
  )
135184
- )}` : ` - run: ${rootInstallCommand(pm, hasLockfile)}
135185
- ${hostDirComment(tempoDir)}${tempoDir === "." ? "" : ` - run: cd ${tempoDir} && ${hostInstallCommand(pm)}
135396
+ )}` : `${skipRootInstall(options2, tempoDir) ? "" : ` - run: ${rootInstallCommand(pm, hasLockfile)}
135397
+ `}${hostDirComment(tempoDir)}${tempoDir === "." ? "" : ` - run: cd ${tempoDir} && ${hostInstallCommand(pm)}
135186
135398
  `}`;
135187
135399
  const installBlock = `${setupSteps(pm, hasLockfile, hasPackageManagerField2, options2.nodeVersionFile)}${installLines}`;
135188
135400
  const cachePath = tempoDir === "." ? "node_modules/.vite" : `${tempoDir}/node_modules/.vite`;
@@ -135626,8 +135838,8 @@ function renderBitbucketPipelines(options2) {
135626
135838
  ${ITEM}# Tempo's own canvas host runs it, in a subshell so the directory change
135627
135839
  ${ITEM}# stays out of the lines below. It must install BOTH the project root and
135628
135840
  ${ITEM}# the canvas host.
135629
- ${customInstallItem(customLines, tempoDir)}` : `${ITEM}- ${rootInstallCommand(pm, hasLockfile)}
135630
- ${tempoDir === "." ? "" : `${ITEM}# The canvas host under \`${tempoDir}/\` is its own package. Capture never
135841
+ ${customInstallItem(customLines, tempoDir)}` : `${skipRootInstall(options2, tempoDir) ? "" : `${ITEM}- ${rootInstallCommand(pm, hasLockfile)}
135842
+ `}${tempoDir === "." ? "" : `${ITEM}# The canvas host under \`${tempoDir}/\` is its own package. Capture never
135631
135843
  ${ITEM}# mutates this checkout (TEMPO_DEVSERVER_PROTECTED_ROOTS below), so
135632
135844
  ${ITEM}# the host's dependencies are installed here, explicitly.
135633
135845
  ${ITEM}- (cd ${tempoDir} && ${hostInstallCommand(pm)})
@@ -136974,6 +137186,7 @@ async function runVisualReviewInit(context, args = {}) {
136974
137186
  defaultBranch: identity2.defaultBranch,
136975
137187
  tempoDir,
136976
137188
  hasLockfile: lockfile !== null,
137189
+ hasRootPackage: await exists3(path80.join(repoRoot, "package.json")),
136977
137190
  lockfile,
136978
137191
  hasPackageManagerField: await hasPackageManagerField(repoRoot),
136979
137192
  nodeVersionFile: await findNodeVersionFile(repoRoot),
@@ -137213,6 +137426,7 @@ async function runBitbucketInit(context, repoRoot, hostConfig, identity2, args)
137213
137426
  defaultBranch: identity2.defaultBranch,
137214
137427
  tempoDir,
137215
137428
  hasLockfile: lockfile !== null,
137429
+ hasRootPackage: await exists3(path80.join(repoRoot, "package.json")),
137216
137430
  customInstall: install.customInstall
137217
137431
  };
137218
137432
  let existing = await findBitbucketPipelines(repoRoot);
@@ -138739,7 +138953,7 @@ function buildBackends(runtime, toolsets, workspace) {
138739
138953
  }
138740
138954
 
138741
138955
  // src/version.ts
138742
- var CLI_VERSION = "0.0.139";
138956
+ var CLI_VERSION = "0.0.140";
138743
138957
 
138744
138958
  // src/canvas-hooks.ts
138745
138959
  var import_pngjs4 = __toESM(require_png(), 1);
@@ -140005,4 +140219,4 @@ unpdf/dist/index.mjs:
140005
140219
  * @license Apache-2.0
140006
140220
  *)
140007
140221
  */
140008
- //# sourceMappingURL=serve-DNTO22FT.js.map
140222
+ //# sourceMappingURL=serve-ET2RUR3U.js.map