@12ui/design 0.2.93 → 0.2.95
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/SKILL.md +1 -1
- package/dist/cli-workspace-command.d.ts.map +1 -1
- package/dist/cli-workspace-command.js +3 -0
- package/dist/cli-workspace-command.js.map +1 -1
- package/dist/mcp-slate-tools.d.ts +8 -1
- package/dist/mcp-slate-tools.d.ts.map +1 -1
- package/dist/mcp-slate-tools.js +67 -35
- package/dist/mcp-slate-tools.js.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration-gallery.d.ts +4 -2
- package/dist/mcp-slate-ui-script-inspiration-gallery.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration-gallery.js +21 -3
- package/dist/mcp-slate-ui-script-inspiration-gallery.js.map +1 -1
- package/dist/mcp-slate-ui-script-loading.d.ts +11 -0
- package/dist/mcp-slate-ui-script-loading.d.ts.map +1 -0
- package/dist/mcp-slate-ui-script-loading.js +19 -0
- package/dist/mcp-slate-ui-script-loading.js.map +1 -0
- package/dist/mcp-slate-ui-script-references.d.ts +7 -2
- package/dist/mcp-slate-ui-script-references.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-references.js +16 -5
- package/dist/mcp-slate-ui-script-references.js.map +1 -1
- package/dist/mcp-slate-ui-script-state.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-state.js +3 -1
- package/dist/mcp-slate-ui-script-state.js.map +1 -1
- package/dist/mcp-slate-ui-script.d.ts +1 -1
- package/dist/mcp-slate-ui-script.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script.js +2 -0
- package/dist/mcp-slate-ui-script.js.map +1 -1
- package/dist/mcp-slate-ui-styles-loading-effects.d.ts +14 -0
- package/dist/mcp-slate-ui-styles-loading-effects.d.ts.map +1 -0
- package/dist/mcp-slate-ui-styles-loading-effects.js +67 -0
- package/dist/mcp-slate-ui-styles-loading-effects.js.map +1 -0
- package/dist/mcp-slate-ui-styles-loading.d.ts +11 -4
- package/dist/mcp-slate-ui-styles-loading.d.ts.map +1 -1
- package/dist/mcp-slate-ui-styles-loading.js +17 -14
- package/dist/mcp-slate-ui-styles-loading.js.map +1 -1
- package/dist/mcp-slate-workspace-tools.js +2 -2
- package/dist/mcp-slate-workspace-tools.js.map +1 -1
- package/dist/prototype-browsers.d.ts +8 -2
- package/dist/prototype-browsers.d.ts.map +1 -1
- package/dist/prototype-browsers.js +11 -5
- package/dist/prototype-browsers.js.map +1 -1
- package/dist/server.js +3 -3
- package/dist/server.js.map +1 -1
- package/dist/slate-site-gathering.d.ts +13 -0
- package/dist/slate-site-gathering.d.ts.map +1 -0
- package/dist/slate-site-gathering.js +21 -0
- package/dist/slate-site-gathering.js.map +1 -0
- package/dist/slate-site-references-capture.d.ts +30 -4
- package/dist/slate-site-references-capture.d.ts.map +1 -1
- package/dist/slate-site-references-capture.js +107 -22
- package/dist/slate-site-references-capture.js.map +1 -1
- package/dist/slate-site-references-client.d.ts +3 -1
- package/dist/slate-site-references-client.d.ts.map +1 -1
- package/dist/slate-site-references-client.js +2 -0
- package/dist/slate-site-references-client.js.map +1 -1
- package/dist/slate-site-references-local.d.ts +9 -3
- package/dist/slate-site-references-local.d.ts.map +1 -1
- package/dist/slate-site-references-local.js +42 -17
- package/dist/slate-site-references-local.js.map +1 -1
- package/dist/slate-site-references-suggest.d.ts +4 -1
- package/dist/slate-site-references-suggest.d.ts.map +1 -1
- package/dist/slate-site-references-suggest.js +18 -9
- package/dist/slate-site-references-suggest.js.map +1 -1
- package/dist/slate-site-references.d.ts +47 -5
- package/dist/slate-site-references.d.ts.map +1 -1
- package/dist/slate-site-references.js +182 -34
- package/dist/slate-site-references.js.map +1 -1
- package/dist/slate-view-contract.d.ts +11 -0
- package/dist/slate-view-contract.d.ts.map +1 -1
- package/dist/slate-view.d.ts +7 -0
- package/dist/slate-view.d.ts.map +1 -1
- package/dist/slate-view.js +18 -2
- package/dist/slate-view.js.map +1 -1
- package/dist/slate-workspace-parse.d.ts.map +1 -1
- package/dist/slate-workspace-parse.js +1 -0
- package/dist/slate-workspace-parse.js.map +1 -1
- package/dist/slate-workspace-types.d.ts +2 -0
- package/dist/slate-workspace-types.d.ts.map +1 -1
- package/open-design.json +2 -2
- package/package.json +1 -1
|
@@ -1,18 +1,25 @@
|
|
|
1
|
+
import { type LoadingEffect } from './mcp-slate-ui-styles-loading-effects.js';
|
|
1
2
|
/**
|
|
2
3
|
* The loading surface, everywhere a picture is on its way (`.shimmer`): an Inspiration or References tile until its
|
|
3
4
|
* picture lands, the skeleton tiles of a first search, a reference site whose screenshot is still being captured, and a
|
|
4
5
|
* design slot while it is drawn.
|
|
5
6
|
*
|
|
6
|
-
* A field of fine dots in the host's ink
|
|
7
|
-
* travelling diagonally. The
|
|
8
|
-
*
|
|
7
|
+
* A field of fine, dim dots in the host's ink with an effect playing across them (mcp-slate-ui-styles-loading-effects.ts;
|
|
8
|
+
* the shimmer: one soft crest with a faint echo, travelling diagonally). The effect is fixed to the frame
|
|
9
|
+
* (`background-attachment: fixed`) and kept on the frame's clock (mcp-slate-ui-script-loading.ts), so every loading tile
|
|
10
|
+
* on screen is a window onto the same wave and a grid of them reads as one calm surface rather than many blinking boxes.
|
|
9
11
|
*
|
|
10
12
|
* - On a picture (`img.shimmer`, no pixels yet) the dots are the picture's own mask, so its tile's ground shows between
|
|
11
13
|
* them; on anything else they are an overlay (`::before`) over the element's own ground, under its content.
|
|
12
|
-
* - The colours are the host's ink (`--text`) mixed into transparency, so Codex's light and dark themes drive it
|
|
14
|
+
* - The colours are the host's ink (`--text`) mixed into transparency, so Codex's light and dark themes drive it; at rest
|
|
15
|
+
* the dots stay dim (9%) so the crest carries the motion.
|
|
13
16
|
* - Reduced motion: still dots, no wave.
|
|
14
17
|
* - Chosen over the web's light band (apps/web generatedDesignPromptEdit.css) side by side in light and dark (evidence
|
|
15
18
|
* 12ui/slate-ui-polish/loading): the band must stay faint not to glare in light, and then all but vanishes on dark.
|
|
19
|
+
* The other effects sit side by side in evidence 12ui/loading-dots.
|
|
16
20
|
*/
|
|
21
|
+
/** The one switch: which effect plays across the dots. */
|
|
22
|
+
export declare const LOADING_EFFECT: LoadingEffect;
|
|
23
|
+
export declare const loadingStyles: (effect: LoadingEffect) => string;
|
|
17
24
|
export declare const SLATE_UI_LOADING_STYLES: string;
|
|
18
25
|
//# sourceMappingURL=mcp-slate-ui-styles-loading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-styles-loading.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-loading.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-styles-loading.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAE/F;;;;;;;;;;;;;;;;;;GAkBG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,cAAc,EAAE,aAAyB,CAAC;AAEvD,eAAO,MAAM,aAAa,GAAI,QAAQ,aAAa,KAAG,MAerD,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAgC,CAAC"}
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
+
import { LOADING_EFFECTS } from './mcp-slate-ui-styles-loading-effects.js';
|
|
1
2
|
/**
|
|
2
3
|
* The loading surface, everywhere a picture is on its way (`.shimmer`): an Inspiration or References tile until its
|
|
3
4
|
* picture lands, the skeleton tiles of a first search, a reference site whose screenshot is still being captured, and a
|
|
4
5
|
* design slot while it is drawn.
|
|
5
6
|
*
|
|
6
|
-
* A field of fine dots in the host's ink
|
|
7
|
-
* travelling diagonally. The
|
|
8
|
-
*
|
|
7
|
+
* A field of fine, dim dots in the host's ink with an effect playing across them (mcp-slate-ui-styles-loading-effects.ts;
|
|
8
|
+
* the shimmer: one soft crest with a faint echo, travelling diagonally). The effect is fixed to the frame
|
|
9
|
+
* (`background-attachment: fixed`) and kept on the frame's clock (mcp-slate-ui-script-loading.ts), so every loading tile
|
|
10
|
+
* on screen is a window onto the same wave and a grid of them reads as one calm surface rather than many blinking boxes.
|
|
9
11
|
*
|
|
10
12
|
* - On a picture (`img.shimmer`, no pixels yet) the dots are the picture's own mask, so its tile's ground shows between
|
|
11
13
|
* them; on anything else they are an overlay (`::before`) over the element's own ground, under its content.
|
|
12
|
-
* - The colours are the host's ink (`--text`) mixed into transparency, so Codex's light and dark themes drive it
|
|
14
|
+
* - The colours are the host's ink (`--text`) mixed into transparency, so Codex's light and dark themes drive it; at rest
|
|
15
|
+
* the dots stay dim (9%) so the crest carries the motion.
|
|
13
16
|
* - Reduced motion: still dots, no wave.
|
|
14
17
|
* - Chosen over the web's light band (apps/web generatedDesignPromptEdit.css) side by side in light and dark (evidence
|
|
15
18
|
* 12ui/slate-ui-polish/loading): the band must stay faint not to glare in light, and then all but vanishes on dark.
|
|
19
|
+
* The other effects sit side by side in evidence 12ui/loading-dots.
|
|
16
20
|
*/
|
|
17
|
-
|
|
21
|
+
/** The one switch: which effect plays across the dots. */
|
|
22
|
+
export const LOADING_EFFECT = 'shimmer';
|
|
23
|
+
export const loadingStyles = (effect) => String.raw `
|
|
18
24
|
.shimmer, .shimmer:not(img)::before {
|
|
19
|
-
--dot: color-mix(in srgb, var(--text)
|
|
20
|
-
--dot-mid: color-mix(in srgb, var(--text)
|
|
21
|
-
--dot-hi: color-mix(in srgb, var(--text)
|
|
25
|
+
--dot: color-mix(in srgb, var(--text) 9%, transparent);
|
|
26
|
+
--dot-mid: color-mix(in srgb, var(--text) 22%, transparent);
|
|
27
|
+
--dot-hi: color-mix(in srgb, var(--text) 50%, transparent);
|
|
22
28
|
}
|
|
23
29
|
img.shimmer, .shimmer:not(img)::before {
|
|
24
30
|
background-color: transparent;
|
|
25
|
-
background-image: linear-gradient(118deg, var(--dot) 34%, var(--dot-mid) 39%, var(--dot) 42.5%, var(--dot-mid) 45.5%, var(--dot-hi) 50%, var(--dot-mid) 54%, var(--dot) 59%);
|
|
26
|
-
background-size: 200vw 200vh;
|
|
27
31
|
background-attachment: fixed;
|
|
28
32
|
-webkit-mask: radial-gradient(circle, #000 1.15px, transparent 1.75px) 0 0 / 9px 9px;
|
|
29
33
|
mask: radial-gradient(circle, #000 1.15px, transparent 1.75px) 0 0 / 9px 9px;
|
|
30
|
-
animation: dotwave 2.4s cubic-bezier(.45, .05, .55, .95) infinite;
|
|
31
34
|
}
|
|
32
35
|
.shimmer:not(img)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
|
|
33
|
-
.skelgrid > .skeleton { position: relative; overflow: hidden; background: var(--fill); }
|
|
34
|
-
@
|
|
35
|
-
@media (prefers-reduced-motion: reduce) { .shimmer { animation: none; } .shimmer:not(img)::before { animation: none; background-image: none; background-color: var(--dot-mid); } img.shimmer { background-image: none; background-color: var(--dot-mid); } }
|
|
36
|
+
.skelgrid > .skeleton { position: relative; overflow: hidden; background: var(--fill); }${LOADING_EFFECTS[effect]}
|
|
37
|
+
@media (prefers-reduced-motion: reduce) { .shimmer { animation: none; } .shimmer:not(img)::before { animation: none; background-image: none; background-color: var(--dot-mid); } img.shimmer { animation: none; background-image: none; background-color: var(--dot-mid); } }
|
|
36
38
|
`;
|
|
39
|
+
export const SLATE_UI_LOADING_STYLES = loadingStyles(LOADING_EFFECT);
|
|
37
40
|
//# sourceMappingURL=mcp-slate-ui-styles-loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-styles-loading.js","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-loading.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-styles-loading.js","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsB,MAAM,0CAA0C,CAAC;AAE/F;;;;;;;;;;;;;;;;;;GAkBG;AAEH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAkB,SAAS,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAU,EAAE,CAAC,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;4FAakB,eAAe,CAAC,MAAM,CAAC;;CAElH,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { copyAdoptedPick, recordPick } from './slate-pick.js';
|
|
|
11
11
|
import { namedReferenceIds } from './slate-reference-ids.js';
|
|
12
12
|
import { ensureReferenceImage } from './slate-reference-store.js';
|
|
13
13
|
import { resumeAction, runAction } from './slate-run-action.js';
|
|
14
|
-
import { buildView, emptyView } from './slate-view.js';
|
|
14
|
+
import { buildView, emptyView, viewStamp } from './slate-view.js';
|
|
15
15
|
import { readVersionBytes } from './slate-versions.js';
|
|
16
16
|
import { findVersion, loadWorkspaceAt } from './slate-workspace-store.js';
|
|
17
17
|
/**
|
|
@@ -128,7 +128,7 @@ export const statusResult = async (input, runtime) => {
|
|
|
128
128
|
const root = await resolveSlateRunDir(input.runDir);
|
|
129
129
|
const { workspace } = await loadWorkspaceAt(root, runtime.now);
|
|
130
130
|
const liveness = await readLiveness(root, workspace, runtime.now().getTime());
|
|
131
|
-
const stamp =
|
|
131
|
+
const stamp = viewStamp(root, workspace.rev, liveness.digest);
|
|
132
132
|
if (typeof input.since === 'string' && input.since === stamp) {
|
|
133
133
|
return { content: [{ type: 'text', text: 'unchanged' }], structuredContent: { unchanged: true, stamp } };
|
|
134
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-workspace-tools.js","sourceRoot":"","sources":["../src/mcp-slate-workspace-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAu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EAAE,CAAC,CAAC;IAC3F,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,0CAA0C,CAAC,CAAC;AACxG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,KAA8B,EAAE,OAAqB,EAA2B,EAAE;IACnH,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACnE,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,mCAAmC,CAAC,CAAC;AACjG,CAAC,CAAC"}
|
|
@@ -4,6 +4,12 @@ export type PrototypeBrowserProvisioning = {
|
|
|
4
4
|
environment: NodeJS.ProcessEnv;
|
|
5
5
|
installCommand: string;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* What every Chromium user in this CLI launches: `chromium.launch()` headless, which Playwright runs on its headless
|
|
9
|
+
* shell (prototype stages, redesign capture, scene capture, the References capture). The full Chromium download (a
|
|
10
|
+
* headed browser, about 340 MB more) is never used, so neither the install nor its named command fetches it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BROWSER_INSTALL_ARGS: readonly ["install", "--only-shell", "chromium"];
|
|
7
13
|
/**
|
|
8
14
|
* Keeps Playwright beside the managed CLI instead of letting Playwright derive
|
|
9
15
|
* a second cache root from HOME. An existing managed launcher identifies the
|
|
@@ -18,8 +24,8 @@ export declare const resolvePrototypeBrowserProvisioning: (args?: {
|
|
|
18
24
|
}) => Promise<PrototypeBrowserProvisioning>;
|
|
19
25
|
export declare const isMissingPrototypeBrowserOutput: (output: string) => boolean;
|
|
20
26
|
/**
|
|
21
|
-
* Installs Chromium into the managed browsers path, the same
|
|
22
|
-
* above names. Only the References tab's capture calls it: that capture runs
|
|
27
|
+
* Installs Chromium's headless shell into the managed browsers path, the same
|
|
28
|
+
* install the command above names. Only the References tab's capture calls it: that capture runs
|
|
23
29
|
* unattended (the workspace runner, or the draw command while the person
|
|
24
30
|
* chooses), so nobody would read the command, and a fresh home has no browser.
|
|
25
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prototype-browsers.d.ts","sourceRoot":"","sources":["../src/prototype-browsers.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,4BAA4B,GAAG;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"prototype-browsers.d.ts","sourceRoot":"","sources":["../src/prototype-browsers.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,4BAA4B,GAAG;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAoBF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kDAAmD,CAAC;AAiBrF;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,GAAU,OAAM;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACnB,KAAG,OAAO,CAAC,4BAA4B,CAmB5C,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,QAAQ,MAAM,KAAG,OAGhE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,cAAc,IAAI,CAAC,4BAA4B,EAAE,aAAa,CAAC,EAC/D,gBAAe,MAAiC,KAC/C,OAAO,CAAC,IAAI,CAcd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,GAAI,MAAM;IACnD,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,MAMH,CAAC"}
|
|
@@ -11,11 +11,17 @@ const installedPlaywrightCli = () => {
|
|
|
11
11
|
const playwrightRequire = createRequire(testManifest);
|
|
12
12
|
return path.join(path.dirname(playwrightRequire.resolve('playwright/package.json')), 'cli.js');
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* What every Chromium user in this CLI launches: `chromium.launch()` headless, which Playwright runs on its headless
|
|
16
|
+
* shell (prototype stages, redesign capture, scene capture, the References capture). The full Chromium download (a
|
|
17
|
+
* headed browser, about 340 MB more) is never used, so neither the install nor its named command fetches it.
|
|
18
|
+
*/
|
|
19
|
+
export const BROWSER_INSTALL_ARGS = ['install', '--only-shell', 'chromium'];
|
|
14
20
|
const browserInstallCommand = (args) => {
|
|
15
21
|
if (args.platform === 'win32') {
|
|
16
|
-
return `set "PLAYWRIGHT_BROWSERS_PATH=${args.browsersPath}" && ${quoteWindowsArgument(process.execPath)} ${quoteWindowsArgument(args.playwrightCli)}
|
|
22
|
+
return `set "PLAYWRIGHT_BROWSERS_PATH=${args.browsersPath}" && ${quoteWindowsArgument(process.execPath)} ${quoteWindowsArgument(args.playwrightCli)} ${BROWSER_INSTALL_ARGS.join(' ')}`;
|
|
17
23
|
}
|
|
18
|
-
return `PLAYWRIGHT_BROWSERS_PATH=${quotePosixArgument(args.browsersPath)} ${quotePosixArgument(process.execPath)} ${quotePosixArgument(args.playwrightCli)}
|
|
24
|
+
return `PLAYWRIGHT_BROWSERS_PATH=${quotePosixArgument(args.browsersPath)} ${quotePosixArgument(process.execPath)} ${quotePosixArgument(args.playwrightCli)} ${BROWSER_INSTALL_ARGS.join(' ')}`;
|
|
19
25
|
};
|
|
20
26
|
/**
|
|
21
27
|
* Keeps Playwright beside the managed CLI instead of letting Playwright derive
|
|
@@ -46,14 +52,14 @@ export const resolvePrototypeBrowserProvisioning = async (args = {}) => {
|
|
|
46
52
|
export const isMissingPrototypeBrowserOutput = (output) => (/Executable doesn't exist at/u.test(output)
|
|
47
53
|
&& /playwright install/u.test(output));
|
|
48
54
|
/**
|
|
49
|
-
* Installs Chromium into the managed browsers path, the same
|
|
50
|
-
* above names. Only the References tab's capture calls it: that capture runs
|
|
55
|
+
* Installs Chromium's headless shell into the managed browsers path, the same
|
|
56
|
+
* install the command above names. Only the References tab's capture calls it: that capture runs
|
|
51
57
|
* unattended (the workspace runner, or the draw command while the person
|
|
52
58
|
* chooses), so nobody would read the command, and a fresh home has no browser.
|
|
53
59
|
*/
|
|
54
60
|
export const installPrototypeBrowser = async (provisioning, playwrightCli = installedPlaywrightCli()) => {
|
|
55
61
|
await new Promise((resolve, reject) => {
|
|
56
|
-
const child = spawn(process.execPath, [playwrightCli,
|
|
62
|
+
const child = spawn(process.execPath, [playwrightCli, ...BROWSER_INSTALL_ARGS], {
|
|
57
63
|
env: provisioning.environment,
|
|
58
64
|
stdio: ['ignore', 'ignore', 'pipe'],
|
|
59
65
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prototype-browsers.js","sourceRoot":"","sources":["../src/prototype-browsers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,+BAA+B,GAChC,MAAM,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CAAC,cAAc,EAAE;MACvC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,4CAA4C,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACpF,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -6,8 +6,8 @@ import { readCorpusConfig } from './config.js';
|
|
|
6
6
|
import { MCP_TOOL_DEFINITIONS } from './mcp-tool-definitions.js';
|
|
7
7
|
import { callMcpTool, createMcpCorpusDependencies, createMcpToolDependencies, } from './mcp-tool-handler.js';
|
|
8
8
|
import { lazyCorpus } from './slate-corpus.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { startRoundCaption } from './slate-captions-local.js';
|
|
10
|
+
import { startLocalTabs } from './slate-site-references-local.js';
|
|
11
11
|
import { listSlateResources, readSlateResource } from './mcp-slate-resource.js';
|
|
12
12
|
import { SLATE_TOOL_DEFINITIONS, createSlateToolHandler, isSlateTool, } from './mcp-slate-tools.js';
|
|
13
13
|
/** Construct the transport without reading credentials; local workflow and slate tools need none. */
|
|
@@ -30,7 +30,7 @@ export const createMcpServer = (options) => {
|
|
|
30
30
|
const slateTools = createSlateToolHandler({
|
|
31
31
|
// The workspace's free reference search reads the same optional-auth corpus configuration, lazily.
|
|
32
32
|
corpus: lazyCorpus(resolveCorpusConfig),
|
|
33
|
-
gatherReferences:
|
|
33
|
+
gatherReferences: startLocalTabs,
|
|
34
34
|
captionRound: (root, roundId) => { startRoundCaption(root, roundId); },
|
|
35
35
|
...options.slate,
|
|
36
36
|
});
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,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-0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which workspaces this process is gathering website references for right now (the local plugin's References tab,
|
|
3
|
+
* `slate-site-references-local.ts`). The gather runs in the screen's own host (`12ui mcp`, or `12ui workspace open`'s
|
|
4
|
+
* page), the same process that builds that screen's view, so the view can say a gather is running (`gatheringSites`)
|
|
5
|
+
* and the tab says it is finding sites instead of "No websites" until the gather ends. A process that stops takes its
|
|
6
|
+
* gathers with it, so nothing here can outlive the work it describes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const startedGathering: (root: string) => void;
|
|
9
|
+
export declare const endedGathering: (root: string) => void;
|
|
10
|
+
export declare const isGathering: (root: string | null) => boolean;
|
|
11
|
+
/** Appended to a view's stamp while its workspace gathers, so a screen polling with `since` sees the gather end. */
|
|
12
|
+
export declare const GATHERING_STAMP = ":gathering";
|
|
13
|
+
//# sourceMappingURL=slate-site-gathering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slate-site-gathering.d.ts","sourceRoot":"","sources":["../src/slate-site-gathering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAAgE,CAAC;AACjH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,IAI7C,CAAC;AACF,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,GAAG,IAAI,KAAG,OAA+C,CAAC;AAElG,oHAAoH;AACpH,eAAO,MAAM,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which workspaces this process is gathering website references for right now (the local plugin's References tab,
|
|
3
|
+
* `slate-site-references-local.ts`). The gather runs in the screen's own host (`12ui mcp`, or `12ui workspace open`'s
|
|
4
|
+
* page), the same process that builds that screen's view, so the view can say a gather is running (`gatheringSites`)
|
|
5
|
+
* and the tab says it is finding sites instead of "No websites" until the gather ends. A process that stops takes its
|
|
6
|
+
* gathers with it, so nothing here can outlive the work it describes.
|
|
7
|
+
*/
|
|
8
|
+
/** Gathers running per workspace root (two screen hosts in one process may each gather the same workspace). */
|
|
9
|
+
const gathering = new Map();
|
|
10
|
+
export const startedGathering = (root) => { gathering.set(root, (gathering.get(root) ?? 0) + 1); };
|
|
11
|
+
export const endedGathering = (root) => {
|
|
12
|
+
const left = (gathering.get(root) ?? 1) - 1;
|
|
13
|
+
if (left > 0)
|
|
14
|
+
gathering.set(root, left);
|
|
15
|
+
else
|
|
16
|
+
gathering.delete(root);
|
|
17
|
+
};
|
|
18
|
+
export const isGathering = (root) => root !== null && gathering.has(root);
|
|
19
|
+
/** Appended to a view's stamp while its workspace gathers, so a screen polling with `since` sees the gather end. */
|
|
20
|
+
export const GATHERING_STAMP = ':gathering';
|
|
21
|
+
//# sourceMappingURL=slate-site-gathering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slate-site-gathering.js","sourceRoot":"","sources":["../src/slate-site-gathering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+GAA+G;AAC/G,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAQ,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;IACnD,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,IAAI,GAAG,CAAC;QAAE,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;QACnC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAmB,EAAW,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAElG,oHAAoH;AACpH,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC"}
|
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
import { type PrototypeBrowserProvisioning } from './prototype-browsers.js';
|
|
2
2
|
/**
|
|
3
3
|
* The capture step of the References tab: each suggested site opened headless in the Playwright Chromium the CLI
|
|
4
|
-
* already ships, at a desktop viewport, and photographed above the fold
|
|
5
|
-
*
|
|
4
|
+
* already ships, at a desktop viewport, and photographed above the fold, with a trivial cookie banner accepted first.
|
|
5
|
+
* A page that does not open, answers an error, or stays blank is skipped (null).
|
|
6
|
+
*
|
|
7
|
+
* Two frames per page. The early frame is taken as soon as the page has loaded, the pop-ups already showing are
|
|
8
|
+
* cleared and its finite entrance animations have finished (at most `ANIMATION_WAIT_MS`; infinite ones are not waited
|
|
9
|
+
* for), and handed over at once (`onEarly`), so the tab shows the site without waiting out the pop-up settle. The
|
|
10
|
+
* settled frame is taken once the settle time has passed (marketing pop-ups arrive on a timer), and it replaces the
|
|
11
|
+
* early one (`replacesEarly`) only when the page changed after it: a pop-up was cleared or hidden after the early frame,
|
|
12
|
+
* or the two pictures differ materially. That policy lives here and nowhere else.
|
|
6
13
|
*/
|
|
7
14
|
export declare const CAPTURE_VIEWPORT: {
|
|
8
15
|
readonly width: 1440;
|
|
9
16
|
readonly height: 900;
|
|
10
17
|
};
|
|
11
|
-
/**
|
|
18
|
+
/** Below this mean difference (0-1, grey levels at 64x40) the settled frame shows the same page as the early one. */
|
|
19
|
+
export declare const MATERIAL_DIFFERENCE = 0.02;
|
|
20
|
+
/**
|
|
21
|
+
* `lastOverlayMs`: when, after navigation, the last banner or pop-up was cleared (null when none was). On the settled
|
|
22
|
+
* frame of a page whose early frame was handed over: `replacesEarly` says it should replace that frame, `difference` is
|
|
23
|
+
* how far the two pictures are apart, and `overlaysAfterEarly` how many pop-ups were cleared or hidden after it.
|
|
24
|
+
*/
|
|
12
25
|
export type CapturedSite = {
|
|
13
26
|
image: Buffer;
|
|
14
27
|
thumb: Buffer;
|
|
15
28
|
title: string;
|
|
16
29
|
finalUrl: string;
|
|
17
30
|
lastOverlayMs?: number | null;
|
|
31
|
+
/** On an early frame: how long it waited for the page's entrance animations to finish (at most `ANIMATION_WAIT_MS`). */
|
|
32
|
+
animationWaitMs?: number;
|
|
33
|
+
replacesEarly?: boolean;
|
|
34
|
+
difference?: number;
|
|
35
|
+
overlaysAfterEarly?: number;
|
|
18
36
|
};
|
|
37
|
+
/** Called with the early frame while the capture goes on to settle; the capture never waits for it. */
|
|
38
|
+
export type EarlyFrame = (frame: CapturedSite) => void;
|
|
19
39
|
type PageLike = {
|
|
20
40
|
goto(url: string, options: Record<string, unknown>): Promise<{
|
|
21
41
|
status(): number;
|
|
@@ -38,11 +58,17 @@ export type BrowserLike = {
|
|
|
38
58
|
newContext(options: Record<string, unknown>): Promise<ContextLike>;
|
|
39
59
|
close(): Promise<void>;
|
|
40
60
|
};
|
|
61
|
+
/** The longest the early frame waits for entrance animations (a hero fading in caught half-way looked washed out). */
|
|
62
|
+
export declare const ANIMATION_WAIT_MS = 2000;
|
|
41
63
|
export type CaptureBrowserDependencies = {
|
|
42
64
|
provisioning?: () => Promise<PrototypeBrowserProvisioning>;
|
|
43
65
|
launch?: () => Promise<BrowserLike>;
|
|
44
66
|
install?: (provisioning: PrototypeBrowserProvisioning) => Promise<void>;
|
|
67
|
+
/** The settle clock (tests advance it from the page's waits). */
|
|
68
|
+
now?: () => number;
|
|
45
69
|
};
|
|
70
|
+
/** How far apart two frames are: the mean difference of their grey levels at 64x40, from 0 (same) to 1. */
|
|
71
|
+
export declare const frameDifference: (a: Buffer, b: Buffer) => Promise<number>;
|
|
46
72
|
/**
|
|
47
73
|
* The managed Chromium, installed first when this home has none: a fresh home (a new person's first `npx`) has no
|
|
48
74
|
* browser, and its References tab stayed empty (seen on design.12ui.com with 0.2.81, 2026-10-02). Any other launch
|
|
@@ -50,7 +76,7 @@ export type CaptureBrowserDependencies = {
|
|
|
50
76
|
*/
|
|
51
77
|
export declare const launchCaptureBrowser: (deps?: CaptureBrowserDependencies) => Promise<BrowserLike>;
|
|
52
78
|
export declare const openSiteCapture: (deps?: CaptureBrowserDependencies) => Promise<{
|
|
53
|
-
capture: (url: string) => Promise<CapturedSite | null>;
|
|
79
|
+
capture: (url: string, onEarly?: EarlyFrame) => Promise<CapturedSite | null>;
|
|
54
80
|
close: () => Promise<void>;
|
|
55
81
|
}>;
|
|
56
82
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate-site-references-capture.d.ts","sourceRoot":"","sources":["../src/slate-site-references-capture.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"slate-site-references-capture.d.ts","sourceRoot":"","sources":["../src/slate-site-references-capture.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB;;;CAAwC,CAAC;AAYtE,qHAAqH;AACrH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAGxC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,wHAAwH;IACxH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM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AAA;CAAE,CAAC;AA4DzH,sHAAsH;AACtH,eAAO,MAAM,iBAAiB,OAAQ,CAAC;AA+BvC,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC3D,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,CAAC;AAEF,2GAA2G;AAC3G,eAAO,MAAM,eAAe,GAAU,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,OAAO,CAAC,MAAM,CAM1E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAU,OAAM,0BAA+B,KAAG,OAAO,CAAC,WAAW,CAWrG,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,OAAM,0BAA+B,KAAG,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAuEjM,CAAC"}
|
|
@@ -2,8 +2,15 @@ import sharp from 'sharp';
|
|
|
2
2
|
import { installPrototypeBrowser, isMissingPrototypeBrowserOutput, resolvePrototypeBrowserProvisioning, } from './prototype-browsers.js';
|
|
3
3
|
/**
|
|
4
4
|
* The capture step of the References tab: each suggested site opened headless in the Playwright Chromium the CLI
|
|
5
|
-
* already ships, at a desktop viewport, and photographed above the fold
|
|
6
|
-
*
|
|
5
|
+
* already ships, at a desktop viewport, and photographed above the fold, with a trivial cookie banner accepted first.
|
|
6
|
+
* A page that does not open, answers an error, or stays blank is skipped (null).
|
|
7
|
+
*
|
|
8
|
+
* Two frames per page. The early frame is taken as soon as the page has loaded, the pop-ups already showing are
|
|
9
|
+
* cleared and its finite entrance animations have finished (at most `ANIMATION_WAIT_MS`; infinite ones are not waited
|
|
10
|
+
* for), and handed over at once (`onEarly`), so the tab shows the site without waiting out the pop-up settle. The
|
|
11
|
+
* settled frame is taken once the settle time has passed (marketing pop-ups arrive on a timer), and it replaces the
|
|
12
|
+
* early one (`replacesEarly`) only when the page changed after it: a pop-up was cleared or hidden after the early frame,
|
|
13
|
+
* or the two pictures differ materially. That policy lives here and nowhere else.
|
|
7
14
|
*/
|
|
8
15
|
export const CAPTURE_VIEWPORT = { width: 1440, height: 900 };
|
|
9
16
|
const THUMB_WIDTH = 640;
|
|
@@ -12,8 +19,13 @@ const LOAD_WAIT_MS = 10_000;
|
|
|
12
19
|
const IDLE_WAIT_MS = 4_000;
|
|
13
20
|
/** Marketing pop-ups arrive on a timer (atlascoffeeclub.com's email form shows about 11 s after navigation): keep looking until then. */
|
|
14
21
|
const POPUP_SETTLE_MS = 13_000;
|
|
22
|
+
/** Looks for showing pop-ups before the early frame, at most. */
|
|
23
|
+
const EARLY_PASSES = 3;
|
|
15
24
|
/** A real desktop Chrome's user agent: some sites turn a "HeadlessChrome" one away. */
|
|
16
25
|
const USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36';
|
|
26
|
+
/** Below this mean difference (0-1, grey levels at 64x40) the settled frame shows the same page as the early one. */
|
|
27
|
+
export const MATERIAL_DIFFERENCE = 0.02;
|
|
28
|
+
const DIFFERENCE_SIZE = { width: 64, height: 40 };
|
|
17
29
|
/**
|
|
18
30
|
* Page scripts, as plain source so no transpiler helper leaks into the page. CLEAR_OVERLAYS accepts a cookie banner and
|
|
19
31
|
* closes an overlay (a newsletter or region pop-up) when either is plainly marked and sits in fixed chrome or a dialog,
|
|
@@ -72,7 +84,45 @@ const HIDE_OVERLAYS = String.raw `(() => {
|
|
|
72
84
|
return hidden;
|
|
73
85
|
})()`;
|
|
74
86
|
const HAS_CONTENT = '((document.body && document.body.innerText || "").trim().length > 40 || document.images.length > 2)';
|
|
87
|
+
/** The longest the early frame waits for entrance animations (a hero fading in caught half-way looked washed out). */
|
|
88
|
+
export const ANIMATION_WAIT_MS = 2_000;
|
|
89
|
+
/**
|
|
90
|
+
* Waits while a finite animation or transition is running (or about to, in its delay) and will end within the bound,
|
|
91
|
+
* looking again as each ends so a staggered entrance is waited out too; infinite or looping ones, and any that would
|
|
92
|
+
* run past the bound, are not waited for. Answers how long it waited, in milliseconds.
|
|
93
|
+
*/
|
|
94
|
+
const SETTLE_ANIMATIONS = String.raw `(() => new Promise(function (resolve) {
|
|
95
|
+
var limit = ${ANIMATION_WAIT_MS};
|
|
96
|
+
var start = performance.now();
|
|
97
|
+
if (typeof document.getAnimations !== "function") { resolve(0); return; }
|
|
98
|
+
function longestLeft() {
|
|
99
|
+
var longest = 0;
|
|
100
|
+
document.getAnimations().forEach(function (animation) {
|
|
101
|
+
if (animation.playState !== "running" || !animation.effect || typeof animation.effect.getComputedTiming !== "function") return;
|
|
102
|
+
var timing = animation.effect.getComputedTiming();
|
|
103
|
+
if (!isFinite(timing.endTime) || timing.localTime === null) return;
|
|
104
|
+
var left = (timing.endTime - timing.localTime) / Math.abs(animation.playbackRate || 1);
|
|
105
|
+
if (left > 0 && left <= limit) longest = Math.max(longest, left);
|
|
106
|
+
});
|
|
107
|
+
return longest;
|
|
108
|
+
}
|
|
109
|
+
(function look() {
|
|
110
|
+
var spent = performance.now() - start;
|
|
111
|
+
var left = longestLeft();
|
|
112
|
+
if (left <= 0 || spent >= limit) { resolve(Math.round(spent)); return; }
|
|
113
|
+
setTimeout(look, Math.min(left, limit - spent) + 20);
|
|
114
|
+
})();
|
|
115
|
+
}))()`;
|
|
75
116
|
const quietly = async (work) => { await work.catch(() => undefined); };
|
|
117
|
+
/** How far apart two frames are: the mean difference of their grey levels at 64x40, from 0 (same) to 1. */
|
|
118
|
+
export const frameDifference = async (a, b) => {
|
|
119
|
+
const grey = async (image) => await sharp(image).resize({ ...DIFFERENCE_SIZE, fit: 'fill' }).greyscale().raw().toBuffer();
|
|
120
|
+
const [left, right] = await Promise.all([grey(a), grey(b)]);
|
|
121
|
+
let total = 0;
|
|
122
|
+
for (let i = 0; i < left.length; i += 1)
|
|
123
|
+
total += Math.abs(left[i] - right[i]);
|
|
124
|
+
return total / left.length / 255;
|
|
125
|
+
};
|
|
76
126
|
/**
|
|
77
127
|
* The managed Chromium, installed first when this home has none: a fresh home (a new person's first `npx`) has no
|
|
78
128
|
* browser, and its References tab stayed empty (seen on design.12ui.com with 0.2.81, 2026-10-02). Any other launch
|
|
@@ -94,36 +144,71 @@ export const launchCaptureBrowser = async (deps = {}) => {
|
|
|
94
144
|
};
|
|
95
145
|
export const openSiteCapture = async (deps = {}) => {
|
|
96
146
|
const browser = await launchCaptureBrowser(deps);
|
|
97
|
-
const
|
|
147
|
+
const now = deps.now ?? Date.now;
|
|
148
|
+
const capture = async (url, onEarly) => {
|
|
98
149
|
const context = await browser.newContext({ viewport: CAPTURE_VIEWPORT, deviceScaleFactor: 1, userAgent: USER_AGENT, locale: 'en-US', colorScheme: 'light' });
|
|
99
150
|
try {
|
|
100
151
|
const page = await context.newPage();
|
|
101
|
-
const startedAt =
|
|
152
|
+
const startedAt = now();
|
|
102
153
|
const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: GOTO_TIMEOUT_MS });
|
|
103
154
|
if (!response || response.status() >= 400)
|
|
104
155
|
return null;
|
|
105
156
|
await quietly(page.waitForLoadState('load', { timeout: LOAD_WAIT_MS }));
|
|
106
|
-
await quietly(page.waitForLoadState('networkidle', { timeout: IDLE_WAIT_MS }));
|
|
107
|
-
// Banners and pop-ups often arrive a moment after load, some on a timer: clear them, then look again until the
|
|
108
|
-
// settle time has passed.
|
|
109
157
|
let lastOverlayMs = null;
|
|
110
|
-
for
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
158
|
+
/** One look for banners and pop-ups: clears what it finds (answering how many), then Escape for one that listens. */
|
|
159
|
+
const clearPass = async (waitMs) => {
|
|
160
|
+
await page.waitForTimeout(waitMs);
|
|
161
|
+
const cleared = await page.evaluate(CLEAR_OVERLAYS).catch(() => 0);
|
|
162
|
+
if (cleared > 0)
|
|
163
|
+
lastOverlayMs = now() - startedAt;
|
|
115
164
|
await quietly(page.keyboard.press('Escape'));
|
|
165
|
+
return cleared;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* A dialog that survived every click is hidden rather than photographed; above the fold, as a click may scroll.
|
|
169
|
+
* The early frame first lets the entrance animations finish (`SETTLE_ANIMATIONS`), and says how long that took.
|
|
170
|
+
*/
|
|
171
|
+
const photograph = async (settleAnimations = false) => {
|
|
172
|
+
const hidden = await page.evaluate(HIDE_OVERLAYS).catch(() => 0);
|
|
173
|
+
await quietly(page.evaluate('window.scrollTo(0, 0)'));
|
|
174
|
+
await page.waitForTimeout(500);
|
|
175
|
+
// Bounded here too, so a page that holds its own timers back cannot hold the capture.
|
|
176
|
+
const animationWaitMs = settleAnimations
|
|
177
|
+
? await Promise.race([
|
|
178
|
+
page.evaluate(SETTLE_ANIMATIONS).then((waited) => waited ?? 0, () => 0),
|
|
179
|
+
new Promise((resolve) => { setTimeout(() => { resolve(ANIMATION_WAIT_MS); }, ANIMATION_WAIT_MS + 1_000).unref(); }),
|
|
180
|
+
])
|
|
181
|
+
: undefined;
|
|
182
|
+
if (!(await page.evaluate(HAS_CONTENT).catch(() => false)))
|
|
183
|
+
return { frame: null, hidden };
|
|
184
|
+
const image = await page.screenshot({ type: 'jpeg', quality: 82, clip: { x: 0, y: 0, ...CAPTURE_VIEWPORT } });
|
|
185
|
+
const thumb = await sharp(image).resize({ width: THUMB_WIDTH }).jpeg({ quality: 78, mozjpeg: true }).toBuffer();
|
|
186
|
+
const frame = { image, thumb, title: (await page.title().catch(() => '')).trim(), finalUrl: page.url(), lastOverlayMs };
|
|
187
|
+
return { frame: animationWaitMs === undefined ? frame : { ...frame, animationWaitMs }, hidden };
|
|
188
|
+
};
|
|
189
|
+
// The early frame, once the page has loaded: the pop-ups already showing are cleared, looking again (a few times
|
|
190
|
+
// at most: some pages answer every look with a click) while a look still finds one.
|
|
191
|
+
let early = null;
|
|
192
|
+
if (onEarly) {
|
|
193
|
+
for (let pass = 0; (await clearPass(pass === 0 ? 800 : 500)) > 0 && pass < EARLY_PASSES - 1; pass += 1)
|
|
194
|
+
;
|
|
195
|
+
early = (await photograph(true)).frame;
|
|
196
|
+
if (early)
|
|
197
|
+
onEarly(early);
|
|
116
198
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
199
|
+
await quietly(page.waitForLoadState('networkidle', { timeout: IDLE_WAIT_MS }));
|
|
200
|
+
// The settled frame: banners and pop-ups often arrive a moment after load, some on a timer, so keep looking until
|
|
201
|
+
// the settle time has passed.
|
|
202
|
+
let overlaysAfterEarly = 0;
|
|
203
|
+
for (let pass = 0; (pass === 0 && !early) || now() - startedAt < POPUP_SETTLE_MS; pass += 1) {
|
|
204
|
+
overlaysAfterEarly += await clearPass(pass === 0 && !onEarly ? 800 : 1_000);
|
|
205
|
+
}
|
|
206
|
+
const settled = await photograph();
|
|
207
|
+
if (!settled.frame || !early)
|
|
208
|
+
return settled.frame;
|
|
209
|
+
overlaysAfterEarly += settled.hidden;
|
|
210
|
+
const difference = await frameDifference(early.image, settled.frame.image);
|
|
211
|
+
return { ...settled.frame, overlaysAfterEarly, difference, replacesEarly: overlaysAfterEarly > 0 || difference >= MATERIAL_DIFFERENCE };
|
|
127
212
|
}
|
|
128
213
|
catch {
|
|
129
214
|
return null;
|