@tempo-ai/mcp 0.0.108 → 0.0.109-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
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __tempoCreateRequire } from 'node:module'; const require = __tempoCreateRequire(import.meta.url);
3
3
  import {
4
4
  run
5
- } from "./chunk-TLB5CTFV.js";
5
+ } from "./chunk-GEUUKPVI.js";
6
6
  import "./chunk-KFUOQZBJ.js";
7
7
 
8
8
  // src/bin.ts
@@ -8,7 +8,7 @@ import {
8
8
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
9
9
  import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
10
10
  async function connectAggregate(options) {
11
- const { createTempoAggregate } = await import("./serve-C7D3CKVT.js");
11
+ const { createTempoAggregate } = await import("./serve-6RLR4FDL.js");
12
12
  const handle = await createTempoAggregate(options);
13
13
  const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
14
14
  const client = new Client({ name: "tempo-mcp-cli", version: "0" });
@@ -127,4 +127,4 @@ export {
127
127
  runCall,
128
128
  runTools
129
129
  };
130
- //# sourceMappingURL=call-VWBUQAPD.js.map
130
+ //# sourceMappingURL=call-CJHHSY7T.js.map
@@ -157,7 +157,7 @@ async function run(argv) {
157
157
  process.stderr.write(USAGE);
158
158
  return 1;
159
159
  }
160
- const { runServe } = await import("./serve-C7D3CKVT.js");
160
+ const { runServe } = await import("./serve-6RLR4FDL.js");
161
161
  return await runServe(options);
162
162
  }
163
163
  switch (subcommand) {
@@ -172,11 +172,11 @@ async function run(argv) {
172
172
  return await runToken(rest);
173
173
  }
174
174
  case "tools": {
175
- const { runTools } = await import("./call-VWBUQAPD.js");
175
+ const { runTools } = await import("./call-CJHHSY7T.js");
176
176
  return await runTools(rest);
177
177
  }
178
178
  case "call": {
179
- const { runCall } = await import("./call-VWBUQAPD.js");
179
+ const { runCall } = await import("./call-CJHHSY7T.js");
180
180
  return await runCall(rest);
181
181
  }
182
182
  default:
@@ -195,4 +195,4 @@ async function run(argv) {
195
195
  export {
196
196
  run
197
197
  };
198
- //# sourceMappingURL=chunk-TLB5CTFV.js.map
198
+ //# sourceMappingURL=chunk-GEUUKPVI.js.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __tempoCreateRequire } from 'node:module'; const require = __tempoCreateRequire(import.meta.url);
2
2
  import {
3
3
  run
4
- } from "./chunk-TLB5CTFV.js";
4
+ } from "./chunk-GEUUKPVI.js";
5
5
  import "./chunk-KFUOQZBJ.js";
6
6
  export {
7
7
  run
@@ -28017,7 +28017,7 @@ async function parcelEventToFileEvent(event, rootInfo) {
28017
28017
  // ../tempo-sdk/package.json
28018
28018
  var package_default = {
28019
28019
  name: "tempo-sdk",
28020
- version: "0.0.42",
28020
+ version: "0.0.44",
28021
28021
  type: "module",
28022
28022
  description: "Tempo SDK \u2014 Vite, Next.js, and Expo plugins for JSX annotation and shared page/storyboard types",
28023
28023
  repository: {
@@ -28098,7 +28098,7 @@ var package_default = {
28098
28098
  demo: "TEMPO=true pnpm --filter @tempo-modules/vite-annotate-plugin-demo dev",
28099
28099
  "demo:nextjs": "TEMPO=true pnpm --filter @tempo-modules/tempo-sdk-nextjs-demo dev",
28100
28100
  test: "vitest run",
28101
- "test:browser": "vitest run canvas-host-vite-e2e.test.ts canvas-host-packed-sdk-e2e.test.ts error-tracking-e2e.test.ts",
28101
+ "test:browser": "vitest run canvas-capture-determinism-browser.test.ts canvas-host-vite-e2e.test.ts canvas-host-packed-sdk-e2e.test.ts error-tracking-e2e.test.ts",
28102
28102
  "test:watch": "vitest",
28103
28103
  "test:nextjs:unit": "vitest run nextjs-loader.test.ts nextjs-wrapper.test.ts nextjs-fixtures.test.ts nextjs-published.test.ts",
28104
28104
  "test:nextjs:integration": "vitest run nextjs-e2e-correctness.test.ts",
@@ -30198,8 +30198,9 @@ Hint: ${current.hint}` : "";
30198
30198
  if (!publicUrl) {
30199
30199
  const crashed = this.lastExitCrashed;
30200
30200
  const probeBlocked = !crashed && !this.stopped && !probeResult.sawResponder;
30201
- const wrongResponder = !crashed && !this.stopped && probeResult.sawResponder && !probeResult.identityFailure;
30202
- const identityFailure = !crashed && !this.stopped && probeResult.identityFailure;
30201
+ const canClassifyResponder = !crashed && this.hasLivenessAuthority();
30202
+ const wrongResponder = canClassifyResponder && probeResult.sawResponder && !probeResult.identityFailure;
30203
+ const identityFailure = canClassifyResponder && probeResult.identityFailure;
30203
30204
  let message = crashed ? "Dev server exited before its URL became reachable" : "Tempo host URL did not become reachable in time";
30204
30205
  if (wrongResponder) {
30205
30206
  const target = publicUrlCandidates[0] ?? "";
@@ -47063,7 +47064,7 @@ async function installChromium(log, spawnImpl = spawn7) {
47063
47064
  }
47064
47065
 
47065
47066
  // ../canvas-capture-headless/src/fingerprint.ts
47066
- var KIT_VERSION = "3";
47067
+ var KIT_VERSION = "5";
47067
47068
  var FONTS_BUNDLE_VERSION = "system-1";
47068
47069
  var DEVICE_SCALE_FACTOR = 2;
47069
47070
  function buildEnvFingerprint(input) {
@@ -47499,8 +47500,7 @@ function readNavigatedMark(error) {
47499
47500
  return error !== null && typeof error === "object" && navigatedErrors.has(error);
47500
47501
  }
47501
47502
  function documentReplaced(start, now, expectedNavigations) {
47502
- const ownSameDocument = now.sameDocumentIssued - start.sameDocumentIssued;
47503
- return now.navigationRequests > start.navigationRequests + expectedNavigations || now.frameNavigations > start.frameNavigations + expectedNavigations + ownSameDocument;
47503
+ return now.navigationRequests > start.navigationRequests + expectedNavigations || now.documentCommits > start.documentCommits + expectedNavigations;
47504
47504
  }
47505
47505
  var BOARD_ATTEMPT_LIMIT = 3;
47506
47506
  function decideBoardRetry(attempt, attemptIndex, attemptLimit = BOARD_ATTEMPT_LIMIT) {
@@ -47554,7 +47554,7 @@ function describeRetryReason(attempt) {
47554
47554
  }
47555
47555
  return "document reloaded mid-capture";
47556
47556
  }
47557
- var DEFAULT_VIEWPORT = { width: 1600, height: 1200 };
47557
+ var INITIAL_VIEWPORT = { width: 1600, height: 1200 };
47558
47558
  async function startCaptureSession(options) {
47559
47559
  const log = options.log ?? (() => {
47560
47560
  });
@@ -47580,7 +47580,7 @@ async function startCaptureSession(options) {
47580
47580
  const contextStart = Date.now();
47581
47581
  const context = await browser.newContext({
47582
47582
  deviceScaleFactor: capture.deviceScaleFactor ?? DEVICE_SCALE_FACTOR,
47583
- viewport: capture.viewport ?? DEFAULT_VIEWPORT,
47583
+ viewport: capture.viewport ?? INITIAL_VIEWPORT,
47584
47584
  reducedMotion: "reduce",
47585
47585
  colorScheme: "light",
47586
47586
  timezoneId: "UTC",
@@ -47590,6 +47590,7 @@ async function startCaptureSession(options) {
47590
47590
  await context.addInitScript(buildFreezeInitScript());
47591
47591
  await context.addInitScript(installRenderProfileInPage);
47592
47592
  const page = await context.newPage();
47593
+ const documentEvents = await context.newCDPSession(page);
47593
47594
  const worker = {
47594
47595
  context,
47595
47596
  page,
@@ -47598,12 +47599,13 @@ async function startCaptureSession(options) {
47598
47599
  hasNavigated: false,
47599
47600
  counters: {
47600
47601
  navigationRequests: 0,
47601
- frameNavigations: 0,
47602
- sameDocumentIssued: 0
47602
+ documentCommits: 0
47603
47603
  },
47604
47604
  documentsLoaded: 0,
47605
47605
  navigationsInFlight: 0,
47606
47606
  async dispose() {
47607
+ await documentEvents.detach().catch(() => {
47608
+ });
47607
47609
  await page.close().catch(() => {
47608
47610
  });
47609
47611
  await context.close().catch(() => {
@@ -47627,9 +47629,10 @@ async function startCaptureSession(options) {
47627
47629
  if (!isMainFrameNavigation(request)) return;
47628
47630
  worker.navigationsInFlight = Math.max(0, worker.navigationsInFlight - 1);
47629
47631
  });
47630
- page.on("framenavigated", (frame) => {
47631
- if (frame === page.mainFrame()) worker.counters.frameNavigations += 1;
47632
+ documentEvents.on("Page.frameNavigated", ({ frame }) => {
47633
+ if (!frame.parentId) worker.counters.documentCommits += 1;
47632
47634
  });
47635
+ await documentEvents.send("Page.enable");
47633
47636
  page.on("domcontentloaded", () => {
47634
47637
  worker.documentsLoaded += 1;
47635
47638
  worker.navigationsInFlight = 0;
@@ -47674,8 +47677,12 @@ async function startCaptureSession(options) {
47674
47677
  target.storyboardId
47675
47678
  );
47676
47679
  const selector = buildStoryboardRenderSelector(renderId);
47680
+ const viewport = capture.viewport ?? {
47681
+ width: Math.ceil(target.width),
47682
+ height: Math.ceil(target.height)
47683
+ };
47677
47684
  const ownsWorker = reusableWorker === void 0;
47678
- const worker = reusableWorker ?? await createCaptureWorker(capture);
47685
+ const worker = reusableWorker ?? await createCaptureWorker({ ...capture, viewport });
47679
47686
  const { page } = worker;
47680
47687
  if (!worker.contextClaimed) {
47681
47688
  timings.contextMs = worker.contextMs;
@@ -47687,6 +47694,10 @@ async function startCaptureSession(options) {
47687
47694
  try {
47688
47695
  const navStart = Date.now();
47689
47696
  try {
47697
+ const currentViewport = page.viewportSize();
47698
+ if (currentViewport?.width !== viewport.width || currentViewport?.height !== viewport.height) {
47699
+ await page.setViewportSize(viewport);
47700
+ }
47690
47701
  const targetUrl = buildDirectRenderUrl2(options.hostUrl, target);
47691
47702
  if (!worker.hasNavigated) {
47692
47703
  await page.goto(targetUrl, { waitUntil: "domcontentloaded" });
@@ -47695,10 +47706,11 @@ async function startCaptureSession(options) {
47695
47706
  } else {
47696
47707
  if (worker.currentSelector === selector) {
47697
47708
  await page.evaluate((url) => {
47698
- history.replaceState(null, "", url);
47699
- window.dispatchEvent(new PopStateEvent("popstate"));
47709
+ history.replaceState(history.state, "", url);
47710
+ window.dispatchEvent(
47711
+ new PopStateEvent("popstate", { state: history.state })
47712
+ );
47700
47713
  }, buildDirectRenderIdleUrl(options.hostUrl));
47701
- worker.counters.sameDocumentIssued += 1;
47702
47714
  await page.waitForSelector(worker.currentSelector, {
47703
47715
  state: "detached",
47704
47716
  timeout: capture.settleTimeoutMs ?? options.settleTimeoutMs ?? 3e4
@@ -47709,12 +47721,13 @@ async function startCaptureSession(options) {
47709
47721
  const captureWindow = window;
47710
47722
  captureWindow.__tempoResetCaptureDeterminism?.();
47711
47723
  captureWindow.__tempoCaptureRenderProfile?.begin(nextSelector);
47712
- history.replaceState(null, "", url);
47713
- window.dispatchEvent(new PopStateEvent("popstate"));
47724
+ history.replaceState(history.state, "", url);
47725
+ window.dispatchEvent(
47726
+ new PopStateEvent("popstate", { state: history.state })
47727
+ );
47714
47728
  },
47715
47729
  { url: targetUrl, nextSelector: selector }
47716
47730
  );
47717
- worker.counters.sameDocumentIssued += 1;
47718
47731
  }
47719
47732
  worker.currentSelector = selector;
47720
47733
  } finally {
@@ -48035,7 +48048,7 @@ async function startCaptureSession(options) {
48035
48048
  if (isReloadStorm(recentReloadRetries, stormWindow)) {
48036
48049
  aborted = true;
48037
48050
  throw new CaptureReloadStormError(
48038
- `capture aborted: the devserver reloaded during the last ${stormWindow} storyboards in a row (${reloadRetriesTotal} re-captures so far) \u2014 it is re-optimizing or restarting continuously; see the "devserver:" lines above`
48051
+ `capture aborted: the document reloaded during the last ${stormWindow} storyboards in a row (${reloadRetriesTotal} re-captures so far) \u2014 check the devserver output and storyboard navigation for repeated reloads`
48039
48052
  );
48040
48053
  }
48041
48054
  if (result.status === "render-error") {
@@ -51334,7 +51347,7 @@ function buildBackends(runtime, toolsets, workspace) {
51334
51347
  }
51335
51348
 
51336
51349
  // src/version.ts
51337
- var CLI_VERSION = "0.0.108";
51350
+ var CLI_VERSION = "0.0.109-staging.2";
51338
51351
 
51339
51352
  // src/canvas-hooks.ts
51340
51353
  var import_pngjs4 = __toESM(require_png(), 1);
@@ -52271,4 +52284,4 @@ export {
52271
52284
  runServe,
52272
52285
  scopeParamsFor
52273
52286
  };
52274
- //# sourceMappingURL=serve-C7D3CKVT.js.map
52287
+ //# sourceMappingURL=serve-6RLR4FDL.js.map