@tempo-ai/mcp 0.0.107-staging.2 → 0.0.108-staging.1
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 +1 -1
- package/dist/{call-E2GGFNEQ.js → call-ZMSUWCQM.js} +2 -2
- package/dist/{chunk-DIHGIFJY.js → chunk-ZCZBV667.js} +4 -4
- package/dist/index.js +1 -1
- package/dist/{serve-T6OLREL7.js → serve-GFI2SFGS.js} +305 -111
- package/dist/serve-GFI2SFGS.js.map +1 -0
- package/package.json +1 -1
- package/dist/serve-T6OLREL7.js.map +0 -1
- /package/dist/{call-E2GGFNEQ.js.map → call-ZMSUWCQM.js.map} +0 -0
- /package/dist/{chunk-DIHGIFJY.js.map → chunk-ZCZBV667.js.map} +0 -0
package/dist/bin.js
CHANGED
|
@@ -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-
|
|
11
|
+
const { createTempoAggregate } = await import("./serve-GFI2SFGS.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-
|
|
130
|
+
//# sourceMappingURL=call-ZMSUWCQM.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-
|
|
160
|
+
const { runServe } = await import("./serve-GFI2SFGS.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-
|
|
175
|
+
const { runTools } = await import("./call-ZMSUWCQM.js");
|
|
176
176
|
return await runTools(rest);
|
|
177
177
|
}
|
|
178
178
|
case "call": {
|
|
179
|
-
const { runCall } = await import("./call-
|
|
179
|
+
const { runCall } = await import("./call-ZMSUWCQM.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-
|
|
198
|
+
//# sourceMappingURL=chunk-ZCZBV667.js.map
|
package/dist/index.js
CHANGED
|
@@ -24812,6 +24812,7 @@ function abortableWait(cancelledMessage) {
|
|
|
24812
24812
|
import { spawn as spawn2 } from "child_process";
|
|
24813
24813
|
import path10 from "path";
|
|
24814
24814
|
var BUNDLED_NODE_BIN_DIR_ENV = "TEMPO_NODE_TOOLCHAIN_BIN_DIR";
|
|
24815
|
+
var BUNDLED_NODE_RUNTIME_ENV = "TEMPO_NODE_TOOLCHAIN_RUNTIME";
|
|
24815
24816
|
function getBundledNodeBinDir() {
|
|
24816
24817
|
const dir = process.env[BUNDLED_NODE_BIN_DIR_ENV];
|
|
24817
24818
|
return dir && dir.trim().length > 0 ? dir : null;
|
|
@@ -24830,10 +24831,13 @@ function shouldUseBundledNode(args) {
|
|
|
24830
24831
|
}
|
|
24831
24832
|
function applyBundledNodeEnv(env, binDir) {
|
|
24832
24833
|
if (!binDir) return env;
|
|
24833
|
-
|
|
24834
|
-
|
|
24835
|
-
ELECTRON_RUN_AS_NODE
|
|
24836
|
-
}
|
|
24834
|
+
const next = prependDirToPathEnv(env, binDir);
|
|
24835
|
+
if (env[BUNDLED_NODE_RUNTIME_ENV] === "native") {
|
|
24836
|
+
delete next.ELECTRON_RUN_AS_NODE;
|
|
24837
|
+
} else {
|
|
24838
|
+
next.ELECTRON_RUN_AS_NODE = "1";
|
|
24839
|
+
}
|
|
24840
|
+
return next;
|
|
24837
24841
|
}
|
|
24838
24842
|
function prependDirToPathEnv(env, dir) {
|
|
24839
24843
|
const pathKey = Object.keys(env).find((key) => key.toLowerCase() === "path");
|
|
@@ -27978,7 +27982,7 @@ async function parcelEventToFileEvent(event, rootInfo) {
|
|
|
27978
27982
|
// ../tempo-sdk/package.json
|
|
27979
27983
|
var package_default = {
|
|
27980
27984
|
name: "tempo-sdk",
|
|
27981
|
-
version: "0.0.
|
|
27985
|
+
version: "0.0.42",
|
|
27982
27986
|
type: "module",
|
|
27983
27987
|
description: "Tempo SDK \u2014 Vite, Next.js, and Expo plugins for JSX annotation and shared page/storyboard types",
|
|
27984
27988
|
repository: {
|
|
@@ -46547,9 +46551,66 @@ import path58 from "path";
|
|
|
46547
46551
|
import { promisify as promisify4 } from "util";
|
|
46548
46552
|
|
|
46549
46553
|
// ../canvas-capture-headless/src/capture.ts
|
|
46550
|
-
var import_pngjs2 = __toESM(require_png(), 1);
|
|
46551
46554
|
import { createHash as createHash4 } from "crypto";
|
|
46552
46555
|
|
|
46556
|
+
// ../../modules/iframe-projection/combined/projection-pending.ts
|
|
46557
|
+
var PROJECTION_PENDING_ATTRIBUTE = "data-tempo-projection-pending";
|
|
46558
|
+
|
|
46559
|
+
// ../../modules/component-render-pool/direct-render.ts
|
|
46560
|
+
var DIRECT_RENDER_PARAMS = {
|
|
46561
|
+
canvasPath: "canvasPath",
|
|
46562
|
+
storyboardId: "storyboardId",
|
|
46563
|
+
width: "width",
|
|
46564
|
+
height: "height",
|
|
46565
|
+
intrinsicSize: "intrinsicSize",
|
|
46566
|
+
idle: "tempoCaptureIdle"
|
|
46567
|
+
};
|
|
46568
|
+
var STORYBOARD_RENDER_ID_ATTRIBUTE = "data-tempo-storyboard-render-id";
|
|
46569
|
+
var STORYBOARD_PENDING_SELECTOR = `[${PROJECTION_PENDING_ATTRIBUTE}]`;
|
|
46570
|
+
function buildCanvasStoryboardRenderId(canvasPath, storyboardId) {
|
|
46571
|
+
return `canvas:${encodeURIComponent(canvasPath.trim())}#storyboard:${encodeURIComponent(
|
|
46572
|
+
storyboardId.trim()
|
|
46573
|
+
)}`;
|
|
46574
|
+
}
|
|
46575
|
+
function buildStoryboardRenderSelector(renderId) {
|
|
46576
|
+
return `[${STORYBOARD_RENDER_ID_ATTRIBUTE}=${JSON.stringify(renderId)}]`;
|
|
46577
|
+
}
|
|
46578
|
+
function buildDirectRenderUrl(hostUrl, target) {
|
|
46579
|
+
const hasWidth = target.width !== void 0;
|
|
46580
|
+
const hasHeight = target.height !== void 0;
|
|
46581
|
+
if (hasWidth !== hasHeight) {
|
|
46582
|
+
throw new Error("Direct render width and height must be provided together");
|
|
46583
|
+
}
|
|
46584
|
+
const url = new URL(hostUrl);
|
|
46585
|
+
url.searchParams.delete(DIRECT_RENDER_PARAMS.idle);
|
|
46586
|
+
url.searchParams.set(DIRECT_RENDER_PARAMS.canvasPath, target.canvasPath);
|
|
46587
|
+
url.searchParams.set(DIRECT_RENDER_PARAMS.storyboardId, target.storyboardId);
|
|
46588
|
+
if (hasWidth && hasHeight) {
|
|
46589
|
+
url.searchParams.set(DIRECT_RENDER_PARAMS.width, String(target.width));
|
|
46590
|
+
url.searchParams.set(DIRECT_RENDER_PARAMS.height, String(target.height));
|
|
46591
|
+
} else {
|
|
46592
|
+
url.searchParams.delete(DIRECT_RENDER_PARAMS.width);
|
|
46593
|
+
url.searchParams.delete(DIRECT_RENDER_PARAMS.height);
|
|
46594
|
+
}
|
|
46595
|
+
if (target.intrinsicSize) {
|
|
46596
|
+
url.searchParams.set(DIRECT_RENDER_PARAMS.intrinsicSize, "1");
|
|
46597
|
+
} else {
|
|
46598
|
+
url.searchParams.delete(DIRECT_RENDER_PARAMS.intrinsicSize);
|
|
46599
|
+
}
|
|
46600
|
+
return url.toString();
|
|
46601
|
+
}
|
|
46602
|
+
function buildDirectRenderIdleUrl(hostUrl) {
|
|
46603
|
+
const url = new URL(hostUrl);
|
|
46604
|
+
for (const param of Object.values(DIRECT_RENDER_PARAMS)) {
|
|
46605
|
+
url.searchParams.delete(param);
|
|
46606
|
+
}
|
|
46607
|
+
url.searchParams.set(DIRECT_RENDER_PARAMS.idle, "1");
|
|
46608
|
+
return url.toString();
|
|
46609
|
+
}
|
|
46610
|
+
|
|
46611
|
+
// ../canvas-capture-headless/src/capture.ts
|
|
46612
|
+
var import_pngjs2 = __toESM(require_png(), 1);
|
|
46613
|
+
|
|
46553
46614
|
// ../../modules/frame-pool/capture-determinism.ts
|
|
46554
46615
|
var FROZEN_EPOCH_MS = Date.UTC(2026, 0, 1, 12, 0, 0);
|
|
46555
46616
|
function buildFreezeInitScript() {
|
|
@@ -46603,100 +46664,240 @@ var FREEZE_MOTION_CSS = `
|
|
|
46603
46664
|
}
|
|
46604
46665
|
`;
|
|
46605
46666
|
|
|
46606
|
-
//
|
|
46607
|
-
var
|
|
46608
|
-
"
|
|
46609
|
-
"
|
|
46610
|
-
"
|
|
46611
|
-
"
|
|
46667
|
+
// ../../modules/frame-pool/settle-script.ts
|
|
46668
|
+
var SETTLE_STEPS = [
|
|
46669
|
+
"target",
|
|
46670
|
+
"fonts",
|
|
46671
|
+
"suspense",
|
|
46672
|
+
"content-quiet",
|
|
46673
|
+
"paint"
|
|
46612
46674
|
];
|
|
46613
|
-
|
|
46614
|
-
|
|
46615
|
-
|
|
46616
|
-
|
|
46617
|
-
|
|
46618
|
-
|
|
46619
|
-
|
|
46620
|
-
|
|
46621
|
-
onStep?.(name, Date.now() - startedAt);
|
|
46622
|
-
}
|
|
46623
|
-
}
|
|
46624
|
-
async function settlePage(page, targetSelector, options = {}) {
|
|
46625
|
-
const quietMs = options.quietMs ?? 300;
|
|
46626
|
-
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
46627
|
-
await runSettleStep(
|
|
46628
|
-
"target",
|
|
46629
|
-
() => page.waitForSelector(targetSelector, {
|
|
46630
|
-
state: "attached",
|
|
46631
|
-
timeout: timeoutMs
|
|
46632
|
-
}),
|
|
46633
|
-
options.onStep
|
|
46634
|
-
);
|
|
46635
|
-
await runSettleStep(
|
|
46636
|
-
"fonts",
|
|
46637
|
-
() => page.waitForFunction(() => document.fonts.status === "loaded", {
|
|
46638
|
-
timeout: timeoutMs
|
|
46639
|
-
}),
|
|
46640
|
-
options.onStep
|
|
46675
|
+
var DEFAULT_SETTLE_QUIET_MS = 300;
|
|
46676
|
+
var DEFAULT_SETTLE_STEP_TIMEOUT_MS = 15e3;
|
|
46677
|
+
var DEFAULT_SETTLE_POLL_MS = 50;
|
|
46678
|
+
function buildSettleWaitScript(options) {
|
|
46679
|
+
const quietMs = Math.max(0, Math.round(options.quietMs ?? DEFAULT_SETTLE_QUIET_MS));
|
|
46680
|
+
const stepTimeoutMs = Math.max(
|
|
46681
|
+
1,
|
|
46682
|
+
Math.round(options.stepTimeoutMs ?? DEFAULT_SETTLE_STEP_TIMEOUT_MS)
|
|
46641
46683
|
);
|
|
46642
|
-
|
|
46643
|
-
|
|
46644
|
-
(
|
|
46645
|
-
(selector) => {
|
|
46646
|
-
const target = document.querySelector(selector);
|
|
46647
|
-
if (!target) return false;
|
|
46648
|
-
return !target.querySelector("[data-tempo-projection-pending]");
|
|
46649
|
-
},
|
|
46650
|
-
targetSelector,
|
|
46651
|
-
{ timeout: timeoutMs }
|
|
46652
|
-
),
|
|
46653
|
-
options.onStep
|
|
46684
|
+
const quietTimeoutMs = Math.max(
|
|
46685
|
+
1,
|
|
46686
|
+
Math.round(options.quietTimeoutMs ?? stepTimeoutMs)
|
|
46654
46687
|
);
|
|
46655
|
-
|
|
46656
|
-
|
|
46657
|
-
()
|
|
46658
|
-
|
|
46659
|
-
|
|
46688
|
+
const pollMs = Math.max(1, Math.round(options.pollMs ?? DEFAULT_SETTLE_POLL_MS));
|
|
46689
|
+
return `
|
|
46690
|
+
(function() {
|
|
46691
|
+
var selector = ${JSON.stringify(options.selector)};
|
|
46692
|
+
var pendingSelector = ${JSON.stringify(options.pendingSelector ?? null)};
|
|
46693
|
+
var quietMs = ${quietMs};
|
|
46694
|
+
var stepTimeoutMs = ${stepTimeoutMs};
|
|
46695
|
+
var quietTimeoutMs = ${quietTimeoutMs};
|
|
46696
|
+
var quietBestEffort = ${options.quietBestEffort === true ? "true" : "false"};
|
|
46697
|
+
var pollMs = ${pollMs};
|
|
46698
|
+
var runPaint = ${options.paint === false ? "false" : "true"};
|
|
46699
|
+
var steps = {};
|
|
46700
|
+
// Cleared when the content-quiet step gives up under best effort.
|
|
46701
|
+
var quiet = true;
|
|
46702
|
+
// Monotonic and immune to the determinism kit's frozen Date.
|
|
46703
|
+
var now = typeof performance !== 'undefined' && performance && typeof performance.now === 'function'
|
|
46704
|
+
? function() { return performance.now(); }
|
|
46705
|
+
: function() { return Date.now(); };
|
|
46706
|
+
|
|
46707
|
+
function failure(step, message) {
|
|
46708
|
+
return { ok: false, step: step, message: message, steps: steps };
|
|
46709
|
+
}
|
|
46710
|
+
|
|
46711
|
+
// Polls \`check\` until it answers true, or \`budgetMs\` elapses. The
|
|
46712
|
+
// first check runs synchronously so an already-settled step costs no
|
|
46713
|
+
// poll interval. A step run with \`giveUp\` resolves at its budget
|
|
46714
|
+
// instead of failing, recording that the content never held still.
|
|
46715
|
+
function until(step, check, budgetMs, giveUp) {
|
|
46716
|
+
var started = now();
|
|
46717
|
+
return new Promise(function(resolve, reject) {
|
|
46718
|
+
function tick() {
|
|
46719
|
+
var done;
|
|
46720
|
+
try {
|
|
46721
|
+
done = check();
|
|
46722
|
+
} catch (error) {
|
|
46723
|
+
steps[step] = Math.round(now() - started);
|
|
46724
|
+
reject(failure(step, String((error && error.message) || error)));
|
|
46725
|
+
return;
|
|
46726
|
+
}
|
|
46727
|
+
if (done) {
|
|
46728
|
+
steps[step] = Math.round(now() - started);
|
|
46729
|
+
resolve();
|
|
46730
|
+
return;
|
|
46731
|
+
}
|
|
46732
|
+
if (now() - started >= budgetMs) {
|
|
46733
|
+
steps[step] = Math.round(now() - started);
|
|
46734
|
+
if (giveUp) {
|
|
46735
|
+
quiet = false;
|
|
46736
|
+
resolve();
|
|
46737
|
+
return;
|
|
46738
|
+
}
|
|
46739
|
+
reject(failure(step, 'Timeout ' + budgetMs + 'ms exceeded'));
|
|
46740
|
+
return;
|
|
46741
|
+
}
|
|
46742
|
+
setTimeout(tick, pollMs);
|
|
46743
|
+
}
|
|
46744
|
+
tick();
|
|
46745
|
+
});
|
|
46746
|
+
}
|
|
46747
|
+
|
|
46748
|
+
var quietKey = null;
|
|
46749
|
+
var quietSince = 0;
|
|
46750
|
+
// Images that take part in the capture: laid out and not hidden. A
|
|
46751
|
+
// hidden responsive variant never starts native lazy loading and must
|
|
46752
|
+
// not hold the window; a rendered lazy image never starts either,
|
|
46753
|
+
// because a capture does not scroll, so it is asked for eagerly.
|
|
46754
|
+
function renderedImages(target) {
|
|
46755
|
+
var all = Array.prototype.slice.call(target.querySelectorAll('img'));
|
|
46756
|
+
var rendered = [];
|
|
46757
|
+
for (var i = 0; i < all.length; i++) {
|
|
46758
|
+
var img = all[i];
|
|
46759
|
+
if (img.getClientRects().length === 0) continue;
|
|
46760
|
+
var visibility = getComputedStyle(img).visibility;
|
|
46761
|
+
if (visibility === 'hidden' || visibility === 'collapse') continue;
|
|
46762
|
+
rendered.push(img);
|
|
46763
|
+
}
|
|
46764
|
+
return rendered;
|
|
46765
|
+
}
|
|
46766
|
+
function contentQuiet() {
|
|
46767
|
+
var target = document.querySelector(selector);
|
|
46660
46768
|
if (!target) return false;
|
|
46661
|
-
|
|
46662
|
-
|
|
46663
|
-
|
|
46664
|
-
|
|
46665
|
-
|
|
46769
|
+
var images = renderedImages(target);
|
|
46770
|
+
for (var i = 0; i < images.length; i++) {
|
|
46771
|
+
if (images[i].loading === 'lazy') images[i].loading = 'eager';
|
|
46772
|
+
}
|
|
46773
|
+
for (var j = 0; j < images.length; j++) {
|
|
46774
|
+
if (!images[j].complete) {
|
|
46775
|
+
// Load/error handlers can replace content without moving its
|
|
46776
|
+
// geometry: start a fresh quiet window once they have run.
|
|
46777
|
+
quietKey = null;
|
|
46778
|
+
return false;
|
|
46779
|
+
}
|
|
46780
|
+
}
|
|
46781
|
+
var rect = target.getBoundingClientRect();
|
|
46782
|
+
var text = target.innerText || '';
|
|
46783
|
+
var key = [
|
|
46666
46784
|
rect.x,
|
|
46667
46785
|
rect.y,
|
|
46668
46786
|
rect.width,
|
|
46669
46787
|
rect.height,
|
|
46670
|
-
target.querySelectorAll(
|
|
46788
|
+
target.querySelectorAll('*').length,
|
|
46671
46789
|
text.length,
|
|
46672
46790
|
images.length
|
|
46673
|
-
].join(
|
|
46674
|
-
|
|
46675
|
-
|
|
46676
|
-
|
|
46677
|
-
|
|
46678
|
-
state.key = key;
|
|
46679
|
-
state.since = now;
|
|
46791
|
+
].join(',');
|
|
46792
|
+
var at = now();
|
|
46793
|
+
if (quietKey !== key) {
|
|
46794
|
+
quietKey = key;
|
|
46795
|
+
quietSince = at;
|
|
46680
46796
|
return false;
|
|
46681
46797
|
}
|
|
46682
|
-
return
|
|
46683
|
-
}
|
|
46684
|
-
|
|
46685
|
-
|
|
46686
|
-
|
|
46687
|
-
|
|
46688
|
-
|
|
46689
|
-
|
|
46690
|
-
|
|
46691
|
-
|
|
46692
|
-
|
|
46693
|
-
|
|
46694
|
-
|
|
46695
|
-
|
|
46696
|
-
|
|
46798
|
+
return at - quietSince >= quietMs;
|
|
46799
|
+
}
|
|
46800
|
+
|
|
46801
|
+
function paint() {
|
|
46802
|
+
if (!runPaint) return Promise.resolve();
|
|
46803
|
+
var started = now();
|
|
46804
|
+
return new Promise(function(resolve) {
|
|
46805
|
+
requestAnimationFrame(function() {
|
|
46806
|
+
requestAnimationFrame(function() {
|
|
46807
|
+
steps.paint = Math.round(now() - started);
|
|
46808
|
+
resolve();
|
|
46809
|
+
});
|
|
46810
|
+
});
|
|
46811
|
+
});
|
|
46812
|
+
}
|
|
46813
|
+
|
|
46814
|
+
return until('target', function() {
|
|
46815
|
+
return document.querySelector(selector) !== null;
|
|
46816
|
+
}, stepTimeoutMs, false)
|
|
46817
|
+
.then(function() {
|
|
46818
|
+
return until('fonts', function() {
|
|
46819
|
+
var fonts = document.fonts;
|
|
46820
|
+
return !fonts || fonts.status === 'loaded';
|
|
46821
|
+
}, stepTimeoutMs, false);
|
|
46822
|
+
})
|
|
46823
|
+
.then(function() {
|
|
46824
|
+
return until('suspense', function() {
|
|
46825
|
+
if (!pendingSelector) return true;
|
|
46826
|
+
var target = document.querySelector(selector);
|
|
46827
|
+
if (!target) return false;
|
|
46828
|
+
return !target.querySelector(pendingSelector);
|
|
46829
|
+
}, stepTimeoutMs, false);
|
|
46830
|
+
})
|
|
46831
|
+
.then(function() {
|
|
46832
|
+
return until('content-quiet', contentQuiet, quietTimeoutMs, quietBestEffort);
|
|
46833
|
+
})
|
|
46834
|
+
.then(paint)
|
|
46835
|
+
.then(
|
|
46836
|
+
function() {
|
|
46837
|
+
return { ok: true, steps: steps, quiet: quiet };
|
|
46838
|
+
},
|
|
46839
|
+
function(caught) {
|
|
46840
|
+
if (caught && caught.ok === false) return caught;
|
|
46841
|
+
return failure('paint', String((caught && caught.message) || caught));
|
|
46842
|
+
}
|
|
46843
|
+
);
|
|
46844
|
+
})()
|
|
46845
|
+
`;
|
|
46846
|
+
}
|
|
46847
|
+
|
|
46848
|
+
// ../canvas-capture-headless/src/navigation-errors.ts
|
|
46849
|
+
function isNavigationInterruptedError(message) {
|
|
46850
|
+
return /Execution context was destroyed|most likely because of a navigation|Cannot find context with specified id|[Ff]rame was detached|Navigation interrupted|is interrupted by another navigation|Inspected target navigated or closed|Cannot find object with id|context was destroyed/.test(
|
|
46851
|
+
message
|
|
46697
46852
|
);
|
|
46698
46853
|
}
|
|
46699
46854
|
|
|
46855
|
+
// ../canvas-capture-headless/src/determinism.ts
|
|
46856
|
+
var CHROMIUM_LAUNCH_ARGS = [
|
|
46857
|
+
"--force-color-profile=srgb",
|
|
46858
|
+
"--force-device-scale-factor=2",
|
|
46859
|
+
"--hide-scrollbars",
|
|
46860
|
+
"--disable-lcd-text"
|
|
46861
|
+
];
|
|
46862
|
+
async function settlePage(page, targetSelector, options = {}) {
|
|
46863
|
+
const quietMs = options.quietMs ?? 300;
|
|
46864
|
+
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
46865
|
+
const budgetMs = timeoutMs * SETTLE_STEPS.length;
|
|
46866
|
+
const deadline = Date.now() + budgetMs;
|
|
46867
|
+
let resumes = 0;
|
|
46868
|
+
for (; ; ) {
|
|
46869
|
+
let report;
|
|
46870
|
+
try {
|
|
46871
|
+
report = await page.evaluate(
|
|
46872
|
+
buildSettleWaitScript({
|
|
46873
|
+
selector: targetSelector,
|
|
46874
|
+
pendingSelector: STORYBOARD_PENDING_SELECTOR,
|
|
46875
|
+
quietMs,
|
|
46876
|
+
stepTimeoutMs: Math.max(1, Math.min(timeoutMs, deadline - Date.now()))
|
|
46877
|
+
})
|
|
46878
|
+
);
|
|
46879
|
+
} catch (error) {
|
|
46880
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
46881
|
+
if (!isNavigationInterruptedError(message)) throw error;
|
|
46882
|
+
resumes += 1;
|
|
46883
|
+
if (Date.now() >= deadline) {
|
|
46884
|
+
throw new Error(
|
|
46885
|
+
`settle: Timeout ${budgetMs}ms exceeded; the document was replaced ${resumes} times while waiting`
|
|
46886
|
+
);
|
|
46887
|
+
}
|
|
46888
|
+
continue;
|
|
46889
|
+
}
|
|
46890
|
+
for (const step of SETTLE_STEPS) {
|
|
46891
|
+
const ms = report.steps[step];
|
|
46892
|
+
if (ms !== void 0) options.onStep?.(step, ms);
|
|
46893
|
+
}
|
|
46894
|
+
if (!report.ok) {
|
|
46895
|
+
throw new Error(`settle.${report.step}: ${report.message}`);
|
|
46896
|
+
}
|
|
46897
|
+
return;
|
|
46898
|
+
}
|
|
46899
|
+
}
|
|
46900
|
+
|
|
46700
46901
|
// ../canvas-capture-headless/src/ensure-chromium.ts
|
|
46701
46902
|
import { spawn as spawn7 } from "child_process";
|
|
46702
46903
|
import { createRequire as createRequire5 } from "module";
|
|
@@ -46756,7 +46957,7 @@ async function installChromium(log, spawnImpl = spawn7) {
|
|
|
46756
46957
|
}
|
|
46757
46958
|
|
|
46758
46959
|
// ../canvas-capture-headless/src/fingerprint.ts
|
|
46759
|
-
var KIT_VERSION = "
|
|
46960
|
+
var KIT_VERSION = "3";
|
|
46760
46961
|
var FONTS_BUNDLE_VERSION = "system-1";
|
|
46761
46962
|
var DEVICE_SCALE_FACTOR = 2;
|
|
46762
46963
|
function buildEnvFingerprint(input) {
|
|
@@ -47143,15 +47344,15 @@ function readRenderProfileInPage(targetCanvasPath) {
|
|
|
47143
47344
|
|
|
47144
47345
|
// ../canvas-capture-headless/src/capture.ts
|
|
47145
47346
|
function storyboardRenderId(hostCanvasPath, storyboardId) {
|
|
47146
|
-
return
|
|
47147
|
-
}
|
|
47148
|
-
function
|
|
47149
|
-
|
|
47150
|
-
|
|
47151
|
-
|
|
47152
|
-
|
|
47153
|
-
|
|
47154
|
-
|
|
47347
|
+
return buildCanvasStoryboardRenderId(hostCanvasPath, storyboardId);
|
|
47348
|
+
}
|
|
47349
|
+
function buildDirectRenderUrl2(hostUrl, target) {
|
|
47350
|
+
return buildDirectRenderUrl(hostUrl, {
|
|
47351
|
+
canvasPath: target.hostCanvasPath,
|
|
47352
|
+
storyboardId: target.storyboardId,
|
|
47353
|
+
width: target.width,
|
|
47354
|
+
height: target.height
|
|
47355
|
+
});
|
|
47155
47356
|
}
|
|
47156
47357
|
function sha256Hex(bytes) {
|
|
47157
47358
|
return createHash4("sha256").update(bytes).digest("hex");
|
|
@@ -47172,11 +47373,6 @@ function looksBlank(pngBytes) {
|
|
|
47172
47373
|
}
|
|
47173
47374
|
return true;
|
|
47174
47375
|
}
|
|
47175
|
-
function isNavigationInterruptedError(message) {
|
|
47176
|
-
return /Execution context was destroyed|most likely because of a navigation|Cannot find context with specified id|[Ff]rame was detached|Navigation interrupted|is interrupted by another navigation|Inspected target navigated or closed|Cannot find object with id|context was destroyed/.test(
|
|
47177
|
-
message
|
|
47178
|
-
);
|
|
47179
|
-
}
|
|
47180
47376
|
function isPageGoneError(message) {
|
|
47181
47377
|
return /Target closed|Target page, context or browser has been closed|Page closed|Target crashed/.test(
|
|
47182
47378
|
message
|
|
@@ -47371,7 +47567,7 @@ async function startCaptureSession(options) {
|
|
|
47371
47567
|
target.hostCanvasPath,
|
|
47372
47568
|
target.storyboardId
|
|
47373
47569
|
);
|
|
47374
|
-
const selector =
|
|
47570
|
+
const selector = buildStoryboardRenderSelector(renderId);
|
|
47375
47571
|
const ownsWorker = reusableWorker === void 0;
|
|
47376
47572
|
const worker = reusableWorker ?? await createCaptureWorker(capture);
|
|
47377
47573
|
const { page } = worker;
|
|
@@ -47385,19 +47581,17 @@ async function startCaptureSession(options) {
|
|
|
47385
47581
|
try {
|
|
47386
47582
|
const navStart = Date.now();
|
|
47387
47583
|
try {
|
|
47388
|
-
const targetUrl =
|
|
47584
|
+
const targetUrl = buildDirectRenderUrl2(options.hostUrl, target);
|
|
47389
47585
|
if (!worker.hasNavigated) {
|
|
47390
47586
|
await page.goto(targetUrl, { waitUntil: "domcontentloaded" });
|
|
47391
47587
|
await page.addStyleTag({ content: FREEZE_MOTION_CSS });
|
|
47392
47588
|
worker.hasNavigated = true;
|
|
47393
47589
|
} else {
|
|
47394
47590
|
if (worker.currentSelector === selector) {
|
|
47395
|
-
const idleUrl = new URL(options.hostUrl);
|
|
47396
|
-
idleUrl.searchParams.set("tempoCaptureIdle", "1");
|
|
47397
47591
|
await page.evaluate((url) => {
|
|
47398
47592
|
history.replaceState(null, "", url);
|
|
47399
47593
|
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
47400
|
-
},
|
|
47594
|
+
}, buildDirectRenderIdleUrl(options.hostUrl));
|
|
47401
47595
|
worker.counters.sameDocumentIssued += 1;
|
|
47402
47596
|
await page.waitForSelector(worker.currentSelector, {
|
|
47403
47597
|
state: "detached",
|
|
@@ -47408,7 +47602,6 @@ async function startCaptureSession(options) {
|
|
|
47408
47602
|
({ url, nextSelector }) => {
|
|
47409
47603
|
const captureWindow = window;
|
|
47410
47604
|
captureWindow.__tempoResetCaptureDeterminism?.();
|
|
47411
|
-
delete captureWindow.__tempoVisualReviewQuiet;
|
|
47412
47605
|
captureWindow.__tempoCaptureRenderProfile?.begin(nextSelector);
|
|
47413
47606
|
history.replaceState(null, "", url);
|
|
47414
47607
|
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
@@ -51027,7 +51220,7 @@ function buildBackends(runtime, toolsets, workspace) {
|
|
|
51027
51220
|
}
|
|
51028
51221
|
|
|
51029
51222
|
// src/version.ts
|
|
51030
|
-
var CLI_VERSION = "0.0.
|
|
51223
|
+
var CLI_VERSION = "0.0.108-staging.1";
|
|
51031
51224
|
|
|
51032
51225
|
// src/canvas-hooks.ts
|
|
51033
51226
|
var import_pngjs4 = __toESM(require_png(), 1);
|
|
@@ -51059,9 +51252,9 @@ function nonInteractiveGitEnv(base = process.env) {
|
|
|
51059
51252
|
}
|
|
51060
51253
|
|
|
51061
51254
|
// ../workspaces/git-worktree/worktree.ts
|
|
51062
|
-
var
|
|
51255
|
+
var GIT_BINARY = ["git", "--no-optional-locks"];
|
|
51063
51256
|
function simpleGit2(repoPath) {
|
|
51064
|
-
return repoPath ? simpleGit({ baseDir: repoPath,
|
|
51257
|
+
return repoPath ? simpleGit({ baseDir: repoPath, binary: GIT_BINARY }) : simpleGit({ binary: GIT_BINARY });
|
|
51065
51258
|
}
|
|
51066
51259
|
async function getRemoteUrl2(repoPath, remoteName = "origin") {
|
|
51067
51260
|
const git = simpleGit2(repoPath);
|
|
@@ -51148,7 +51341,8 @@ async function computeShareStatus(repoPath) {
|
|
|
51148
51341
|
async function checkBranchOnRemote(repoPath, branch) {
|
|
51149
51342
|
const git = simpleGit({
|
|
51150
51343
|
baseDir: repoPath,
|
|
51151
|
-
|
|
51344
|
+
binary: GIT_BINARY,
|
|
51345
|
+
config: [...NON_INTERACTIVE_GIT_CONFIG],
|
|
51152
51346
|
timeout: { block: 15e3 }
|
|
51153
51347
|
}).env(nonInteractiveGitEnv());
|
|
51154
51348
|
try {
|
|
@@ -51963,4 +52157,4 @@ export {
|
|
|
51963
52157
|
runServe,
|
|
51964
52158
|
scopeParamsFor
|
|
51965
52159
|
};
|
|
51966
|
-
//# sourceMappingURL=serve-
|
|
52160
|
+
//# sourceMappingURL=serve-GFI2SFGS.js.map
|