@12ui/design 0.2.93 → 0.2.94
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 +25 -4
- package/dist/slate-site-references-capture.d.ts.map +1 -1
- package/dist/slate-site-references-capture.js +66 -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.d.ts +24 -4
- package/dist/slate-site-references.d.ts.map +1 -1
- package/dist/slate-site-references.js +104 -20
- 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,uBAAuB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO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AC,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,sBAAsB,CAAC;AAS9B,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,CACpD,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,C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,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,EACtB,yBAAyB,GAE1B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,gBA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AK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,CAC/C,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE,CAAC,GAAG,oBAAoB,EAAE,GAAG,sBAAsB,CAAC;KAC5D,CAAC,CAAC,CAAC;IACJ,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE;QACzF,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,IAAI,WAAW,CAAC,IAAI,CAAC;YAAE,OAAO,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrD,OAAO,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,iBAAiB,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAChE,SAAS,EAAE,kBAAkB,EAAE;KAChC,CAAC,CAAC,CAAC;IACJ,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CACrE,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CACtC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAyB;IAC5D,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -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,38 @@
|
|
|
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 and the pop-ups already showing are
|
|
8
|
+
* cleared, and handed over at once (`onEarly`), so the tab shows the site without waiting out the pop-up settle. The
|
|
9
|
+
* settled frame is taken once the settle time has passed (marketing pop-ups arrive on a timer), and it replaces the
|
|
10
|
+
* early one (`replacesEarly`) only when the page changed after it: a pop-up was cleared or hidden after the early frame,
|
|
11
|
+
* or the two pictures differ materially. That policy lives here and nowhere else.
|
|
6
12
|
*/
|
|
7
13
|
export declare const CAPTURE_VIEWPORT: {
|
|
8
14
|
readonly width: 1440;
|
|
9
15
|
readonly height: 900;
|
|
10
16
|
};
|
|
11
|
-
/**
|
|
17
|
+
/** Below this mean difference (0-1, grey levels at 64x40) the settled frame shows the same page as the early one. */
|
|
18
|
+
export declare const MATERIAL_DIFFERENCE = 0.02;
|
|
19
|
+
/**
|
|
20
|
+
* `lastOverlayMs`: when, after navigation, the last banner or pop-up was cleared (null when none was). On the settled
|
|
21
|
+
* frame of a page whose early frame was handed over: `replacesEarly` says it should replace that frame, `difference` is
|
|
22
|
+
* how far the two pictures are apart, and `overlaysAfterEarly` how many pop-ups were cleared or hidden after it.
|
|
23
|
+
*/
|
|
12
24
|
export type CapturedSite = {
|
|
13
25
|
image: Buffer;
|
|
14
26
|
thumb: Buffer;
|
|
15
27
|
title: string;
|
|
16
28
|
finalUrl: string;
|
|
17
29
|
lastOverlayMs?: number | null;
|
|
30
|
+
replacesEarly?: boolean;
|
|
31
|
+
difference?: number;
|
|
32
|
+
overlaysAfterEarly?: number;
|
|
18
33
|
};
|
|
34
|
+
/** Called with the early frame while the capture goes on to settle; the capture never waits for it. */
|
|
35
|
+
export type EarlyFrame = (frame: CapturedSite) => void;
|
|
19
36
|
type PageLike = {
|
|
20
37
|
goto(url: string, options: Record<string, unknown>): Promise<{
|
|
21
38
|
status(): number;
|
|
@@ -42,7 +59,11 @@ export type CaptureBrowserDependencies = {
|
|
|
42
59
|
provisioning?: () => Promise<PrototypeBrowserProvisioning>;
|
|
43
60
|
launch?: () => Promise<BrowserLike>;
|
|
44
61
|
install?: (provisioning: PrototypeBrowserProvisioning) => Promise<void>;
|
|
62
|
+
/** The settle clock (tests advance it from the page's waits). */
|
|
63
|
+
now?: () => number;
|
|
45
64
|
};
|
|
65
|
+
/** How far apart two frames are: the mean difference of their grey levels at 64x40, from 0 (same) to 1. */
|
|
66
|
+
export declare const frameDifference: (a: Buffer, b: Buffer) => Promise<number>;
|
|
46
67
|
/**
|
|
47
68
|
* The managed Chromium, installed first when this home has none: a fresh home (a new person's first `npx`) has no
|
|
48
69
|
* browser, and its References tab stayed empty (seen on design.12ui.com with 0.2.81, 2026-10-02). Any other launch
|
|
@@ -50,7 +71,7 @@ export type CaptureBrowserDependencies = {
|
|
|
50
71
|
*/
|
|
51
72
|
export declare const launchCaptureBrowser: (deps?: CaptureBrowserDependencies) => Promise<BrowserLike>;
|
|
52
73
|
export declare const openSiteCapture: (deps?: CaptureBrowserDependencies) => Promise<{
|
|
53
|
-
capture: (url: string) => Promise<CapturedSite | null>;
|
|
74
|
+
capture: (url: string, onEarly?: EarlyFrame) => Promise<CapturedSite | null>;
|
|
54
75
|
close: () => Promise<void>;
|
|
55
76
|
}>;
|
|
56
77
|
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;;;;;;;;;;GAUG;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,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AACF,uGAAuG;AACvG,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,IAAI,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAC1F,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,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,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,CA4DjM,CAAC"}
|
|
@@ -2,8 +2,14 @@ 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 and the pop-ups already showing are
|
|
9
|
+
* cleared, 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.
|
|
7
13
|
*/
|
|
8
14
|
export const CAPTURE_VIEWPORT = { width: 1440, height: 900 };
|
|
9
15
|
const THUMB_WIDTH = 640;
|
|
@@ -12,8 +18,13 @@ const LOAD_WAIT_MS = 10_000;
|
|
|
12
18
|
const IDLE_WAIT_MS = 4_000;
|
|
13
19
|
/** Marketing pop-ups arrive on a timer (atlascoffeeclub.com's email form shows about 11 s after navigation): keep looking until then. */
|
|
14
20
|
const POPUP_SETTLE_MS = 13_000;
|
|
21
|
+
/** Looks for showing pop-ups before the early frame, at most. */
|
|
22
|
+
const EARLY_PASSES = 3;
|
|
15
23
|
/** A real desktop Chrome's user agent: some sites turn a "HeadlessChrome" one away. */
|
|
16
24
|
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';
|
|
25
|
+
/** Below this mean difference (0-1, grey levels at 64x40) the settled frame shows the same page as the early one. */
|
|
26
|
+
export const MATERIAL_DIFFERENCE = 0.02;
|
|
27
|
+
const DIFFERENCE_SIZE = { width: 64, height: 40 };
|
|
17
28
|
/**
|
|
18
29
|
* Page scripts, as plain source so no transpiler helper leaks into the page. CLEAR_OVERLAYS accepts a cookie banner and
|
|
19
30
|
* closes an overlay (a newsletter or region pop-up) when either is plainly marked and sits in fixed chrome or a dialog,
|
|
@@ -73,6 +84,15 @@ const HIDE_OVERLAYS = String.raw `(() => {
|
|
|
73
84
|
})()`;
|
|
74
85
|
const HAS_CONTENT = '((document.body && document.body.innerText || "").trim().length > 40 || document.images.length > 2)';
|
|
75
86
|
const quietly = async (work) => { await work.catch(() => undefined); };
|
|
87
|
+
/** How far apart two frames are: the mean difference of their grey levels at 64x40, from 0 (same) to 1. */
|
|
88
|
+
export const frameDifference = async (a, b) => {
|
|
89
|
+
const grey = async (image) => await sharp(image).resize({ ...DIFFERENCE_SIZE, fit: 'fill' }).greyscale().raw().toBuffer();
|
|
90
|
+
const [left, right] = await Promise.all([grey(a), grey(b)]);
|
|
91
|
+
let total = 0;
|
|
92
|
+
for (let i = 0; i < left.length; i += 1)
|
|
93
|
+
total += Math.abs(left[i] - right[i]);
|
|
94
|
+
return total / left.length / 255;
|
|
95
|
+
};
|
|
76
96
|
/**
|
|
77
97
|
* The managed Chromium, installed first when this home has none: a fresh home (a new person's first `npx`) has no
|
|
78
98
|
* browser, and its References tab stayed empty (seen on design.12ui.com with 0.2.81, 2026-10-02). Any other launch
|
|
@@ -94,36 +114,60 @@ export const launchCaptureBrowser = async (deps = {}) => {
|
|
|
94
114
|
};
|
|
95
115
|
export const openSiteCapture = async (deps = {}) => {
|
|
96
116
|
const browser = await launchCaptureBrowser(deps);
|
|
97
|
-
const
|
|
117
|
+
const now = deps.now ?? Date.now;
|
|
118
|
+
const capture = async (url, onEarly) => {
|
|
98
119
|
const context = await browser.newContext({ viewport: CAPTURE_VIEWPORT, deviceScaleFactor: 1, userAgent: USER_AGENT, locale: 'en-US', colorScheme: 'light' });
|
|
99
120
|
try {
|
|
100
121
|
const page = await context.newPage();
|
|
101
|
-
const startedAt =
|
|
122
|
+
const startedAt = now();
|
|
102
123
|
const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: GOTO_TIMEOUT_MS });
|
|
103
124
|
if (!response || response.status() >= 400)
|
|
104
125
|
return null;
|
|
105
126
|
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
127
|
let lastOverlayMs = null;
|
|
110
|
-
for
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
/** One look for banners and pop-ups: clears what it finds (answering how many), then Escape for one that listens. */
|
|
129
|
+
const clearPass = async (waitMs) => {
|
|
130
|
+
await page.waitForTimeout(waitMs);
|
|
131
|
+
const cleared = await page.evaluate(CLEAR_OVERLAYS).catch(() => 0);
|
|
132
|
+
if (cleared > 0)
|
|
133
|
+
lastOverlayMs = now() - startedAt;
|
|
115
134
|
await quietly(page.keyboard.press('Escape'));
|
|
135
|
+
return cleared;
|
|
136
|
+
};
|
|
137
|
+
/** A dialog that survived every click is hidden rather than photographed; above the fold, as a click may scroll. */
|
|
138
|
+
const photograph = async () => {
|
|
139
|
+
const hidden = await page.evaluate(HIDE_OVERLAYS).catch(() => 0);
|
|
140
|
+
await quietly(page.evaluate('window.scrollTo(0, 0)'));
|
|
141
|
+
await page.waitForTimeout(500);
|
|
142
|
+
if (!(await page.evaluate(HAS_CONTENT).catch(() => false)))
|
|
143
|
+
return { frame: null, hidden };
|
|
144
|
+
const image = await page.screenshot({ type: 'jpeg', quality: 82, clip: { x: 0, y: 0, ...CAPTURE_VIEWPORT } });
|
|
145
|
+
const thumb = await sharp(image).resize({ width: THUMB_WIDTH }).jpeg({ quality: 78, mozjpeg: true }).toBuffer();
|
|
146
|
+
return { frame: { image, thumb, title: (await page.title().catch(() => '')).trim(), finalUrl: page.url(), lastOverlayMs }, hidden };
|
|
147
|
+
};
|
|
148
|
+
// The early frame, once the page has loaded: the pop-ups already showing are cleared, looking again (a few times
|
|
149
|
+
// at most: some pages answer every look with a click) while a look still finds one.
|
|
150
|
+
let early = null;
|
|
151
|
+
if (onEarly) {
|
|
152
|
+
for (let pass = 0; (await clearPass(pass === 0 ? 800 : 500)) > 0 && pass < EARLY_PASSES - 1; pass += 1)
|
|
153
|
+
;
|
|
154
|
+
early = (await photograph()).frame;
|
|
155
|
+
if (early)
|
|
156
|
+
onEarly(early);
|
|
116
157
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
158
|
+
await quietly(page.waitForLoadState('networkidle', { timeout: IDLE_WAIT_MS }));
|
|
159
|
+
// The settled frame: banners and pop-ups often arrive a moment after load, some on a timer, so keep looking until
|
|
160
|
+
// the settle time has passed.
|
|
161
|
+
let overlaysAfterEarly = 0;
|
|
162
|
+
for (let pass = 0; (pass === 0 && !early) || now() - startedAt < POPUP_SETTLE_MS; pass += 1) {
|
|
163
|
+
overlaysAfterEarly += await clearPass(pass === 0 && !onEarly ? 800 : 1_000);
|
|
164
|
+
}
|
|
165
|
+
const settled = await photograph();
|
|
166
|
+
if (!settled.frame || !early)
|
|
167
|
+
return settled.frame;
|
|
168
|
+
overlaysAfterEarly += settled.hidden;
|
|
169
|
+
const difference = await frameDifference(early.image, settled.frame.image);
|
|
170
|
+
return { ...settled.frame, overlaysAfterEarly, difference, replacesEarly: overlaysAfterEarly > 0 || difference >= MATERIAL_DIFFERENCE };
|
|
127
171
|
}
|
|
128
172
|
catch {
|
|
129
173
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slate-site-references-capture.js","sourceRoot":"","sources":["../src/slate-site-references-capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"slate-site-references-capture.js","sourceRoot":"","sources":["../src/slate-site-references-capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAW,CAAC;AACtE,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,YAAY,GAAG,MAAM,CAAC;AAC5B,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,yIAAyI;AACzI,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,iEAAiE;AACjE,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,uFAAuF;AACvF,MAAM,UAAU,GAAG,uHAAuH,CAAC;AAE3I,qHAAqH;AACrH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC,MAAM,eAAe,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE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AAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7E,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type DrawFetch } from './workspace-draw-client.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* The References tab's two calls on design.12ui.com, authenticated by the workspace's upload token like the draw
|
|
4
4
|
* command's: what to look for (the brief, and the sites already added), the sites still being captured (the plan), and
|
|
5
|
-
* one captured site.
|
|
5
|
+
* one captured site (or its settled frame, replacing the early one).
|
|
6
6
|
*
|
|
7
7
|
* A refusal the server marks retryable (a `409 workspace_busy` while another write holds the workspace, a `429`) is
|
|
8
8
|
* tried again after a short backoff, up to `SITES_ATTEMPTS` in all: both calls are idempotent (the same page pushed
|
|
@@ -17,12 +17,14 @@ export type SitesBrief = {
|
|
|
17
17
|
}[];
|
|
18
18
|
max: number;
|
|
19
19
|
};
|
|
20
|
+
/** `replace`: the page's settled frame, replacing the early one pushed before it in the same site (an older server keeps the first). */
|
|
20
21
|
export type SitePush = {
|
|
21
22
|
url: string;
|
|
22
23
|
title: string;
|
|
23
24
|
why: string;
|
|
24
25
|
image: Buffer;
|
|
25
26
|
thumb: Buffer;
|
|
27
|
+
replace?: boolean;
|
|
26
28
|
};
|
|
27
29
|
export declare const SITES_ATTEMPTS = 4;
|
|
28
30
|
export declare const createSitesClient: (args: {
|