autokap 1.0.7 → 1.0.8
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/assets/cursors/macos.svg +4 -0
- package/assets/cursors/windows.svg +15 -0
- package/assets/skill/OPCODE-REFERENCE.md +607 -0
- package/assets/skill/README.md +39 -0
- package/assets/skill/SKILL.md +453 -468
- package/assets/skill/STUDIO-SKILL.md +476 -0
- package/assets/skill/references/examples.md +104 -0
- package/assets/skill/references/interactive-demo.md +225 -0
- package/assets/skill/references/mock-data.md +178 -0
- package/dist/action-verifier.d.ts +29 -0
- package/dist/action-verifier.js +133 -0
- package/dist/agent-action-recovery.d.ts +45 -0
- package/dist/agent-action-recovery.js +370 -0
- package/dist/agent-message-utils.d.ts +21 -0
- package/dist/agent-message-utils.js +77 -0
- package/dist/agent-url-utils.d.ts +30 -0
- package/dist/agent-url-utils.js +138 -0
- package/dist/agent.d.ts +92 -8
- package/dist/agent.js +2936 -781
- package/dist/ak-tree.d.ts +39 -0
- package/dist/ak-tree.js +368 -0
- package/dist/alt-text.d.ts +26 -0
- package/dist/alt-text.js +55 -0
- package/dist/auth-capture.d.ts +17 -0
- package/dist/auth-capture.js +164 -0
- package/dist/benchmark.d.ts +59 -0
- package/dist/benchmark.js +135 -0
- package/dist/browser-bar.d.ts +14 -6
- package/dist/browser-bar.js +145 -8
- package/dist/browser-pool.d.ts +7 -0
- package/dist/browser-pool.js +15 -5
- package/dist/browser-utils.d.ts +31 -0
- package/dist/browser-utils.js +97 -0
- package/dist/browser.d.ts +51 -1
- package/dist/browser.js +1481 -31
- package/dist/capture-alt-text.js +2 -1
- package/dist/capture-language-preflight.js +14 -0
- package/dist/capture-llm-page-identity.js +22 -10
- package/dist/capture-page-identity.d.ts +5 -7
- package/dist/capture-page-identity.js +211 -78
- package/dist/capture-preset-credentials.d.ts +50 -0
- package/dist/capture-preset-credentials.js +127 -0
- package/dist/capture-request-plan.d.ts +2 -2
- package/dist/capture-request-plan.js +64 -16
- package/dist/capture-run-optimizer.js +48 -33
- package/dist/capture-selector-memory.d.ts +5 -0
- package/dist/capture-selector-memory.js +18 -0
- package/dist/capture-strategy.d.ts +36 -0
- package/dist/capture-strategy.js +95 -0
- package/dist/capture-studio-sync.d.ts +1 -0
- package/dist/capture-studio-sync.js +9 -3
- package/dist/capture-surface-contract.d.ts +36 -0
- package/dist/capture-surface-contract.js +299 -0
- package/dist/capture-transition-engine.d.ts +28 -0
- package/dist/capture-transition-engine.js +292 -0
- package/dist/capture-variant-state.d.ts +2 -0
- package/dist/capture-variant-state.js +26 -0
- package/dist/capture-verification.d.ts +35 -0
- package/dist/capture-verification.js +95 -0
- package/dist/capture-viewport-lock.d.ts +48 -0
- package/dist/capture-viewport-lock.js +74 -0
- package/dist/circuit-breaker.d.ts +42 -0
- package/dist/circuit-breaker.js +119 -0
- package/dist/cli-config.d.ts +8 -1
- package/dist/cli-config.js +62 -6
- package/dist/cli-contract.d.ts +15 -0
- package/dist/cli-contract.js +167 -0
- package/dist/cli-runner-local.d.ts +12 -0
- package/dist/cli-runner-local.js +102 -0
- package/dist/cli-runner.d.ts +34 -0
- package/dist/cli-runner.js +433 -0
- package/dist/cli-utils.d.ts +0 -1
- package/dist/cli-utils.js +2 -5
- package/dist/cli.js +1005 -267
- package/dist/clip-orchestrator.js +9 -2
- package/dist/clip-postprocess.js +25 -16
- package/dist/cookie-dismiss.d.ts +2 -0
- package/dist/cookie-dismiss.js +48 -13
- package/dist/cost-logging.d.ts +8 -0
- package/dist/cost-logging.js +160 -46
- package/dist/cost-resolution-monitor.d.ts +16 -0
- package/dist/cost-resolution-monitor.js +34 -0
- package/dist/credential-templates.js +2 -2
- package/dist/cursor-overlay-script.d.ts +6 -0
- package/dist/cursor-overlay-script.js +169 -0
- package/dist/dom-css-purger.d.ts +65 -0
- package/dist/dom-css-purger.js +333 -0
- package/dist/dom-font-inliner.d.ts +45 -0
- package/dist/dom-font-inliner.js +148 -0
- package/dist/dom-patch-resolver.d.ts +52 -0
- package/dist/dom-patch-resolver.js +242 -0
- package/dist/dom-serializer.d.ts +82 -0
- package/dist/dom-serializer.js +378 -0
- package/dist/element-capture.d.ts +1 -41
- package/dist/element-capture.js +202 -446
- package/dist/env-validation.d.ts +5 -0
- package/dist/env-validation.js +29 -0
- package/dist/execution-schema.d.ts +4423 -0
- package/dist/execution-schema.js +507 -0
- package/dist/execution-types.d.ts +886 -0
- package/dist/execution-types.js +65 -0
- package/dist/fonts-loader.d.ts +14 -0
- package/dist/fonts-loader.js +55 -0
- package/dist/hybrid-navigator.js +12 -12
- package/dist/index.d.ts +9 -6
- package/dist/index.js +10 -4
- package/dist/legacy/agent-action-recovery.d.ts +45 -0
- package/dist/legacy/agent-action-recovery.js +370 -0
- package/dist/legacy/agent-message-utils.d.ts +21 -0
- package/dist/legacy/agent-message-utils.js +77 -0
- package/dist/legacy/agent-url-utils.d.ts +30 -0
- package/dist/legacy/agent-url-utils.js +138 -0
- package/dist/legacy/agent.d.ts +226 -0
- package/dist/legacy/agent.js +6666 -0
- package/dist/legacy/clip-orchestrator.d.ts +148 -0
- package/dist/legacy/clip-orchestrator.js +957 -0
- package/dist/legacy/credential-templates.d.ts +5 -0
- package/dist/legacy/credential-templates.js +60 -0
- package/dist/legacy/hybrid-navigator.d.ts +138 -0
- package/dist/legacy/hybrid-navigator.js +468 -0
- package/dist/legacy/llm-usage.d.ts +17 -0
- package/dist/legacy/llm-usage.js +45 -0
- package/dist/legacy/prompt-cache.d.ts +10 -0
- package/dist/legacy/prompt-cache.js +24 -0
- package/dist/legacy/prompts.d.ts +175 -0
- package/dist/legacy/prompts.js +1038 -0
- package/dist/legacy/tools.d.ts +4 -0
- package/dist/legacy/tools.js +216 -0
- package/dist/legacy/video-agent.d.ts +143 -0
- package/dist/legacy/video-agent.js +4788 -0
- package/dist/legacy/video-observation.d.ts +36 -0
- package/dist/legacy/video-observation.js +192 -0
- package/dist/legacy/video-planner.d.ts +12 -0
- package/dist/legacy/video-planner.js +501 -0
- package/dist/legacy/video-prompts.d.ts +37 -0
- package/dist/legacy/video-prompts.js +569 -0
- package/dist/legacy/video-tools.d.ts +3 -0
- package/dist/legacy/video-tools.js +59 -0
- package/dist/legacy/video-variant-state.d.ts +29 -0
- package/dist/legacy/video-variant-state.js +80 -0
- package/dist/legacy/vision-model.d.ts +17 -0
- package/dist/legacy/vision-model.js +74 -0
- package/dist/llm-healer.d.ts +63 -0
- package/dist/llm-healer.js +166 -0
- package/dist/llm-provider.d.ts +29 -0
- package/dist/llm-provider.js +80 -0
- package/dist/logger.d.ts +6 -2
- package/dist/logger.js +15 -1
- package/dist/mockup-html.js +35 -25
- package/dist/mockup.d.ts +95 -2
- package/dist/mockup.js +427 -166
- package/dist/mouse-animation.d.ts +2 -2
- package/dist/mouse-animation.js +34 -20
- package/dist/opcode-actions.d.ts +42 -0
- package/dist/opcode-actions.js +511 -0
- package/dist/opcode-runner.d.ts +51 -0
- package/dist/opcode-runner.js +770 -0
- package/dist/openrouter-client.d.ts +40 -0
- package/dist/openrouter-client.js +16 -0
- package/dist/overlay-engine.d.ts +24 -0
- package/dist/overlay-engine.js +176 -0
- package/dist/postcondition.d.ts +16 -0
- package/dist/postcondition.js +269 -0
- package/dist/program-patcher.d.ts +25 -0
- package/dist/program-patcher.js +44 -0
- package/dist/prompts.d.ts +13 -5
- package/dist/prompts.js +224 -351
- package/dist/provider-config.d.ts +12 -0
- package/dist/provider-config.js +15 -0
- package/dist/recovery-chain.d.ts +37 -0
- package/dist/recovery-chain.js +350 -0
- package/dist/remote-browser.d.ts +28 -4
- package/dist/remote-browser.js +60 -5
- package/dist/safari-browser-bar.d.ts +15 -0
- package/dist/safari-browser-bar.js +95 -0
- package/dist/safari-toolbar-asset.d.ts +15 -0
- package/dist/safari-toolbar-asset.js +12 -0
- package/dist/security.d.ts +2 -1
- package/dist/security.js +49 -10
- package/dist/selector-resolver.d.ts +34 -0
- package/dist/selector-resolver.js +181 -0
- package/dist/semantic-resolver.d.ts +35 -0
- package/dist/semantic-resolver.js +161 -0
- package/dist/server-capture-runtime.d.ts +5 -3
- package/dist/server-capture-runtime.js +42 -95
- package/dist/server-credit-usage.d.ts +2 -2
- package/dist/server-project-webhooks.d.ts +15 -1
- package/dist/server-project-webhooks.js +34 -8
- package/dist/server-screenshot-watermark.js +27 -5
- package/dist/session-profile.js +164 -1
- package/dist/sf-pro-symbols.d.ts +1 -0
- package/dist/sf-pro-symbols.js +55 -0
- package/dist/skill-packaging.d.ts +28 -0
- package/dist/skill-packaging.js +169 -0
- package/dist/smart-wait.d.ts +27 -0
- package/dist/smart-wait.js +81 -0
- package/dist/status-bar-render.d.ts +20 -0
- package/dist/status-bar-render.js +410 -0
- package/dist/status-bar.d.ts +9 -0
- package/dist/status-bar.js +298 -14
- package/dist/svg-browser-bar.d.ts +33 -0
- package/dist/svg-browser-bar.js +206 -0
- package/dist/svg-status-bar.d.ts +36 -0
- package/dist/svg-status-bar.js +597 -0
- package/dist/svg-text.d.ts +61 -0
- package/dist/svg-text.js +118 -0
- package/dist/tools.js +89 -451
- package/dist/types.d.ts +240 -5
- package/dist/types.js +23 -1
- package/dist/v2/action-verifier.d.ts +29 -0
- package/dist/v2/action-verifier.js +133 -0
- package/dist/v2/alt-text.d.ts +26 -0
- package/dist/v2/alt-text.js +55 -0
- package/dist/v2/benchmark.d.ts +59 -0
- package/dist/v2/benchmark.js +135 -0
- package/dist/v2/capture-strategy.d.ts +30 -0
- package/dist/v2/capture-strategy.js +67 -0
- package/dist/v2/capture-verification.d.ts +35 -0
- package/dist/v2/capture-verification.js +95 -0
- package/dist/v2/circuit-breaker.d.ts +42 -0
- package/dist/v2/circuit-breaker.js +119 -0
- package/dist/v2/cli-runner-local.d.ts +11 -0
- package/dist/v2/cli-runner-local.js +91 -0
- package/dist/v2/cli-runner.d.ts +34 -0
- package/dist/v2/cli-runner.js +300 -0
- package/dist/v2/compiler-prompts.d.ts +27 -0
- package/dist/v2/compiler-prompts.js +123 -0
- package/dist/v2/compiler.d.ts +37 -0
- package/dist/v2/compiler.js +147 -0
- package/dist/v2/explorer.d.ts +41 -0
- package/dist/v2/explorer.js +56 -0
- package/dist/v2/index.d.ts +37 -0
- package/dist/v2/index.js +31 -0
- package/dist/v2/llm-healer.d.ts +62 -0
- package/dist/v2/llm-healer.js +166 -0
- package/dist/v2/llm-provider.d.ts +29 -0
- package/dist/v2/llm-provider.js +80 -0
- package/dist/v2/opcode-runner.d.ts +47 -0
- package/dist/v2/opcode-runner.js +634 -0
- package/dist/v2/overlay-engine.d.ts +24 -0
- package/dist/v2/overlay-engine.js +150 -0
- package/dist/v2/postcondition.d.ts +16 -0
- package/dist/v2/postcondition.js +249 -0
- package/dist/v2/program-patcher.d.ts +25 -0
- package/dist/v2/program-patcher.js +44 -0
- package/dist/v2/recovery-chain.d.ts +30 -0
- package/dist/v2/recovery-chain.js +368 -0
- package/dist/v2/schema.d.ts +2580 -0
- package/dist/v2/schema.js +295 -0
- package/dist/v2/selector-resolver.d.ts +34 -0
- package/dist/v2/selector-resolver.js +181 -0
- package/dist/v2/semantic-resolver.d.ts +35 -0
- package/dist/v2/semantic-resolver.js +161 -0
- package/dist/v2/smart-wait.d.ts +27 -0
- package/dist/v2/smart-wait.js +81 -0
- package/dist/v2/types.d.ts +444 -0
- package/dist/v2/types.js +19 -0
- package/dist/v2/web-playwright-local.d.ts +69 -0
- package/dist/v2/web-playwright-local.js +392 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/video-agent.js +18 -13
- package/dist/video-planner.js +2 -1
- package/dist/video-prompts.js +3 -3
- package/dist/web-playwright-local.d.ts +126 -0
- package/dist/web-playwright-local.js +819 -0
- package/dist/ws-auth.js +4 -1
- package/dist/ws-broadcast.d.ts +34 -0
- package/dist/ws-broadcast.js +85 -0
- package/dist/ws-connection-limits.d.ts +12 -0
- package/dist/ws-connection-limits.js +44 -0
- package/dist/ws-handler-utils.d.ts +32 -0
- package/dist/ws-handler-utils.js +139 -0
- package/dist/ws-handler.js +294 -164
- package/dist/ws-metrics-server.d.ts +9 -0
- package/dist/ws-metrics-server.js +31 -0
- package/dist/ws-server.js +41 -1
- package/package.json +51 -34
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safari macOS browser bar — uses the Figma-exported asset directly.
|
|
3
|
+
*
|
|
4
|
+
* Reference SVG: assets/frames/Safari tool bar.svg (1299×88, single-row toolbar).
|
|
5
|
+
* The asset is embedded as a string constant via `safari-toolbar-asset.ts`
|
|
6
|
+
* (auto-generated). All icons are baked as paths — only the URL inside
|
|
7
|
+
* the address pill is dynamic.
|
|
8
|
+
*
|
|
9
|
+
* Two outputs:
|
|
10
|
+
* - HTML (Playwright preview / React) — inline SVG inside a scaled wrapper
|
|
11
|
+
* - SVG (sharp / resvg server compositing)
|
|
12
|
+
*/
|
|
13
|
+
import { SF_PRO_TEXT_REGULAR, SF_PRO_TEXT_SEMIBOLD, } from './sf-pro-fonts.js';
|
|
14
|
+
import { SAFARI_TOOLBAR_SVG, SAFARI_TOOLBAR_VIEWBOX, SAFARI_URL_PILL, } from './safari-toolbar-asset.js';
|
|
15
|
+
// ── Fonts ────────────────────────────────────────────────────────────────
|
|
16
|
+
const FONT_CSS_HTML = `<style>
|
|
17
|
+
@font-face{font-family:'SF Pro Text';src:local('SF Pro Text'),local('.SFNSText'),url('${SF_PRO_TEXT_REGULAR}') format('woff2');font-weight:400;font-style:normal}
|
|
18
|
+
@font-face{font-family:'SF Pro Text';src:local('SF Pro Text Semibold'),local('.SFNSText-Semibold'),url('${SF_PRO_TEXT_SEMIBOLD}') format('woff2');font-weight:600;font-style:normal}
|
|
19
|
+
</style>`;
|
|
20
|
+
const FONT_CSS_SVG = `
|
|
21
|
+
@font-face{font-family:'SF Pro Text';src:url('${SF_PRO_TEXT_REGULAR}') format('woff2');font-weight:400;font-style:normal}
|
|
22
|
+
@font-face{font-family:'SF Pro Text';src:url('${SF_PRO_TEXT_SEMIBOLD}') format('woff2');font-weight:600;font-style:normal}
|
|
23
|
+
`;
|
|
24
|
+
const FF = "'SF Pro Text',-apple-system,BlinkMacSystemFont,system-ui,sans-serif";
|
|
25
|
+
// ── Helpers ──────────────────────────────────────────────────────────────
|
|
26
|
+
function escText(s) {
|
|
27
|
+
return s
|
|
28
|
+
.replace(/&/g, '&')
|
|
29
|
+
.replace(/</g, '<')
|
|
30
|
+
.replace(/>/g, '>')
|
|
31
|
+
.replace(/"/g, '"');
|
|
32
|
+
}
|
|
33
|
+
function cleanUrl(raw) {
|
|
34
|
+
return (raw || 'apple.com').replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
35
|
+
}
|
|
36
|
+
/** Build the URL <text> overlay placed inside the address pill. */
|
|
37
|
+
function urlTextSvg(url, color) {
|
|
38
|
+
const cx = SAFARI_URL_PILL.x + SAFARI_URL_PILL.width / 2;
|
|
39
|
+
const cy = SAFARI_URL_PILL.y + SAFARI_URL_PILL.height / 2;
|
|
40
|
+
return `<text x="${cx}" y="${cy}" font-family="${FF}" font-size="14" font-weight="510" fill="${color}" text-anchor="middle" dominant-baseline="central">${escText(url)}</text>`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Strip the asset's outer `<svg ...>` opening tag so we can re-emit it with
|
|
44
|
+
* our own width/height/viewBox, then append a URL text element before `</svg>`.
|
|
45
|
+
*/
|
|
46
|
+
function buildSafariSvgInner(url, isDark) {
|
|
47
|
+
// Asset begins with `<svg width="1299" height="88" viewBox="0 0 1299 88" fill="none" xmlns="...">`
|
|
48
|
+
// Drop everything up to the end of that opening tag.
|
|
49
|
+
const openEnd = SAFARI_TOOLBAR_SVG.indexOf('>');
|
|
50
|
+
const closeStart = SAFARI_TOOLBAR_SVG.lastIndexOf('</svg>');
|
|
51
|
+
let inner = SAFARI_TOOLBAR_SVG.slice(openEnd + 1, closeStart);
|
|
52
|
+
if (isDark) {
|
|
53
|
+
// Minimal dark-mode token swap — keeps the asset usable until a dedicated
|
|
54
|
+
// dark variant ships. Hardcoded colors map to Safari's dark palette.
|
|
55
|
+
inner = inner
|
|
56
|
+
.replace(/fill="white"/g, 'fill="#2C2C2E"')
|
|
57
|
+
.replace(/fill="#FFFFFF"/gi, 'fill="#2C2C2E"')
|
|
58
|
+
.replace(/fill="#F7F7F7"/gi, 'fill="#3A3A3C"')
|
|
59
|
+
.replace(/fill="#4C4C4C"/gi, 'fill="#E4E4E4"')
|
|
60
|
+
.replace(/fill="#808080"/gi, 'fill="#8E8E93"')
|
|
61
|
+
.replace(/fill="#C6C6C6"/gi, 'fill="#6E6E73"')
|
|
62
|
+
.replace(/fill="#E6E6E6"/gi, 'fill="#4A4A4C"');
|
|
63
|
+
}
|
|
64
|
+
const urlColor = isDark ? '#E4E4E4' : '#4C4C4C';
|
|
65
|
+
return inner + urlTextSvg(url, urlColor);
|
|
66
|
+
}
|
|
67
|
+
// ── Generator (HTML, for Playwright client preview) ──────────────────────
|
|
68
|
+
export function generateSafariBrowserBarHtml(options) {
|
|
69
|
+
const { config, width, height, pixelScale = 1 } = options;
|
|
70
|
+
const url = cleanUrl(config.url);
|
|
71
|
+
const isDark = config.colorScheme === 'dark';
|
|
72
|
+
const inner = buildSafariSvgInner(url, isDark);
|
|
73
|
+
// The asset's reference is 1299×88. We render it at the target width×height
|
|
74
|
+
// by setting the SVG width/height directly — viewBox handles the scaling.
|
|
75
|
+
// pixelScale lets the server multiply for high-DPI raster output.
|
|
76
|
+
const w = width * pixelScale;
|
|
77
|
+
const h = height * pixelScale;
|
|
78
|
+
const vb = SAFARI_TOOLBAR_VIEWBOX;
|
|
79
|
+
return `${FONT_CSS_HTML}<div style="width:${w}px;height:${h}px;position:relative;overflow:hidden;line-height:0;font-size:0">
|
|
80
|
+
<svg width="${w}" height="${h}" viewBox="${vb.x} ${vb.y} ${vb.width} ${vb.height}" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" fill="none" style="display:block">${inner}</svg>
|
|
81
|
+
</div>`;
|
|
82
|
+
}
|
|
83
|
+
// ── Generator (SVG, for sharp / resvg server compositing) ────────────────
|
|
84
|
+
export function generateSafariBrowserBarSvg(options) {
|
|
85
|
+
const { config, width, height } = options;
|
|
86
|
+
const url = cleanUrl(config.url);
|
|
87
|
+
const isDark = config.colorScheme === 'dark';
|
|
88
|
+
const inner = buildSafariSvgInner(url, isDark);
|
|
89
|
+
const vb = SAFARI_TOOLBAR_VIEWBOX;
|
|
90
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${width}" height="${height}" viewBox="${vb.x} ${vb.y} ${vb.width} ${vb.height}" preserveAspectRatio="none" fill="none">
|
|
91
|
+
<defs><style>${FONT_CSS_SVG}</style></defs>
|
|
92
|
+
${inner}
|
|
93
|
+
</svg>`;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=safari-browser-bar.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const SAFARI_TOOLBAR_SVG: string;
|
|
2
|
+
export declare const SAFARI_TOOLBAR_VIEWBOX: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const SAFARI_TOOLBAR_REF_W: number;
|
|
9
|
+
export declare const SAFARI_TOOLBAR_REF_H: number;
|
|
10
|
+
export declare const SAFARI_URL_PILL: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Auto-generated from assets/frames/Safari tool bar.svg — do not edit by hand.
|
|
2
|
+
// Static "apple.com" URL text path stripped; renderer overlays the URL dynamically.
|
|
3
|
+
// The visible toolbar occupies x=0..1280 and y=18..70 in the original 1299x88 viewBox;
|
|
4
|
+
// we expose a cropped viewBox so callers render the toolbar without surrounding empty padding.
|
|
5
|
+
export const SAFARI_TOOLBAR_SVG = "<svg width=\"1299\" height=\"88\" viewBox=\"0 0 1299 88\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M0 66C0 49.1984 0 40.7976 3.2698 34.3803C6.14601 28.7354 10.7354 24.146 16.3803 21.2698C22.7976 18 31.1984 18 48 18H1232C1248.8 18 1257.2 18 1263.62 21.2698C1269.26 24.146 1273.85 28.7354 1276.73 34.3803C1280 40.7976 1280 49.1984 1280 66V70H0V66Z\" fill=\"white\"/>\n<path d=\"M0 66C0 49.1984 0 40.7976 3.2698 34.3803C6.14601 28.7354 10.7354 24.146 16.3803 21.2698C22.7976 18 31.1984 18 48 18H1232C1248.8 18 1257.2 18 1263.62 21.2698C1269.26 24.146 1273.85 28.7354 1276.73 34.3803C1280 40.7976 1280 49.1984 1280 66V70H0V66Z\" fill=\"black\" fill-opacity=\"0.01\"/>\n<rect x=\"17\" y=\"37\" width=\"14\" height=\"14\" rx=\"7\" fill=\"#FF736A\"/>\n<rect x=\"17.25\" y=\"37.25\" width=\"13.5\" height=\"13.5\" rx=\"6.75\" stroke=\"black\" stroke-opacity=\"0.1\" stroke-width=\"0.5\"/>\n<rect x=\"40\" y=\"37\" width=\"14\" height=\"14\" rx=\"7\" fill=\"#FEBC2E\"/>\n<rect x=\"40.25\" y=\"37.25\" width=\"13.5\" height=\"13.5\" rx=\"6.75\" stroke=\"black\" stroke-opacity=\"0.1\" stroke-width=\"0.5\"/>\n<rect x=\"63\" y=\"37\" width=\"14\" height=\"14\" rx=\"7\" fill=\"#19C332\"/>\n<rect x=\"63.25\" y=\"37.25\" width=\"13.5\" height=\"13.5\" rx=\"6.75\" stroke=\"black\" stroke-opacity=\"0.1\" stroke-width=\"0.5\"/>\n<g opacity=\"0.67\">\n<mask id=\"mask0_782_423\" style=\"mask-type:luminance\" maskUnits=\"userSpaceOnUse\" x=\"1058\" y=\"-50\" width=\"291\" height=\"188\">\n<rect width=\"291\" height=\"188\" transform=\"translate(1058 -50)\" fill=\"white\"/>\n<rect x=\"1134\" y=\"26\" width=\"139\" height=\"36\" rx=\"18\" fill=\"black\"/>\n</mask>\n<g mask=\"url(#mask0_782_423)\">\n<foreignObject x=\"1094\" y=\"-12\" width=\"219\" height=\"116\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"backdrop-filter:blur(20px);clip-path:url(#bgblur_0_782_423_clip_path);height:100%;width:100%\"></div></foreignObject><g filter=\"url(#filter1_f_782_423)\" data-figma-bg-blur-radius=\"40\">\n<path d=\"M1134 46C1134 36.0589 1142.06 28 1152 28H1255C1264.94 28 1273 36.0589 1273 46V46C1273 55.9411 1264.94 64 1255 64H1152C1142.06 64 1134 55.9411 1134 46V46Z\" fill=\"black\" fill-opacity=\"0.1\" style=\"mix-blend-mode:hard-light\"/>\n</g>\n</g>\n</g>\n<path d=\"M1134 44C1134 34.0589 1142.06 26 1152 26H1255C1264.94 26 1273 34.0589 1273 44V44C1273 53.9411 1264.94 62 1255 62H1152C1142.06 62 1134 53.9411 1134 44V44Z\" fill=\"#333333\" style=\"mix-blend-mode:color-dodge\"/>\n<path d=\"M1134 44C1134 34.0589 1142.06 26 1152 26H1255C1264.94 26 1273 34.0589 1273 44V44C1273 53.9411 1264.94 62 1255 62H1152C1142.06 62 1134 53.9411 1134 44V44Z\" fill=\"white\" fill-opacity=\"0.5\"/>\n<path d=\"M1134 44C1134 34.0589 1142.06 26 1152 26H1255C1264.94 26 1273 34.0589 1273 44V44C1273 53.9411 1264.94 62 1255 62H1152C1142.06 62 1134 53.9411 1134 44V44Z\" fill=\"#F7F7F7\" style=\"mix-blend-mode:plus-darker\"/>\n<rect x=\"1134\" y=\"26\" width=\"139\" height=\"36\" rx=\"18\" fill=\"black\" fill-opacity=\"0.01\"/>\n<g style=\"mix-blend-mode:plus-darker\">\n<path d=\"M1152.99 52.7896C1152.07 52.7896 1151.19 52.6478 1150.35 52.3643C1149.52 52.085 1148.75 51.6872 1148.05 51.1709C1147.35 50.6589 1146.75 50.0537 1146.23 49.3555C1145.72 48.6615 1145.32 47.8955 1145.04 47.0576C1144.76 46.2197 1144.62 45.3395 1144.62 44.417C1144.62 43.4902 1144.76 42.61 1145.04 41.7764C1145.32 40.9385 1145.72 40.1704 1146.23 39.4722C1146.75 38.7739 1147.35 38.1688 1148.05 37.6567C1148.75 37.1447 1149.52 36.7469 1150.35 36.4634C1151.19 36.1799 1152.07 36.0381 1152.99 36.0381C1153.92 36.0381 1154.8 36.1799 1155.63 36.4634C1156.47 36.7469 1157.24 37.1447 1157.94 37.6567C1158.64 38.1688 1159.24 38.7739 1159.75 39.4722C1160.27 40.1704 1160.66 40.9385 1160.95 41.7764C1161.23 42.61 1161.37 43.4902 1161.37 44.417C1161.37 45.3395 1161.23 46.2197 1160.95 47.0576C1160.66 47.8955 1160.27 48.6615 1159.75 49.3555C1159.24 50.0537 1158.64 50.6589 1157.94 51.1709C1157.24 51.6872 1156.47 52.085 1155.63 52.3643C1154.8 52.6478 1153.92 52.7896 1152.99 52.7896ZM1152.99 51.3359C1153.76 51.3359 1154.49 51.2196 1155.18 50.9868C1155.87 50.7541 1156.51 50.4261 1157.08 50.0029C1157.66 49.5798 1158.16 49.0804 1158.58 48.5049C1159.01 47.9251 1159.33 47.2904 1159.56 46.6006C1159.8 45.9108 1159.91 45.1829 1159.91 44.417C1159.91 43.651 1159.8 42.9232 1159.56 42.2334C1159.33 41.5394 1159.01 40.9046 1158.58 40.3291C1158.16 39.7536 1157.66 39.2542 1157.08 38.8311C1156.51 38.4036 1155.87 38.0757 1155.18 37.8472C1154.49 37.6144 1153.76 37.498 1152.99 37.498C1152.23 37.498 1151.5 37.6144 1150.81 37.8472C1150.12 38.0757 1149.49 38.4036 1148.91 38.8311C1148.33 39.2542 1147.83 39.7536 1147.41 40.3291C1146.98 40.9046 1146.66 41.5394 1146.42 42.2334C1146.19 42.9232 1146.07 43.651 1146.07 44.417C1146.07 45.1829 1146.19 45.9108 1146.42 46.6006C1146.66 47.2904 1146.98 47.9251 1147.41 48.5049C1147.83 49.0804 1148.33 49.5798 1148.91 50.0029C1149.49 50.4261 1150.12 50.7541 1150.81 50.9868C1151.5 51.2196 1152.23 51.3359 1152.99 51.3359ZM1152.99 40.2656C1153.17 40.2656 1153.33 40.3312 1153.46 40.4624C1153.59 40.5936 1153.66 40.748 1153.66 40.9258V45.5786L1153.6 47.2417C1153.59 47.4237 1153.52 47.5675 1153.4 47.6733C1153.28 47.7791 1153.14 47.832 1152.99 47.832C1152.83 47.832 1152.7 47.7791 1152.57 47.6733C1152.46 47.5675 1152.39 47.4237 1152.38 47.2417L1152.32 45.5786V40.9258C1152.32 40.748 1152.39 40.5936 1152.52 40.4624C1152.65 40.3312 1152.81 40.2656 1152.99 40.2656ZM1152.99 48.562C1152.9 48.562 1152.82 48.5472 1152.73 48.5176C1152.65 48.4837 1152.57 48.4224 1152.49 48.3335L1149.76 45.7056C1149.71 45.6421 1149.66 45.5765 1149.62 45.5088C1149.59 45.4411 1149.57 45.3628 1149.57 45.2739C1149.57 45.1047 1149.63 44.9671 1149.74 44.8613C1149.86 44.7513 1150 44.6963 1150.17 44.6963C1150.35 44.6963 1150.5 44.7619 1150.62 44.8931L1151.88 46.2134L1152.84 47.2925H1153.14L1154.1 46.2134L1155.35 44.8931C1155.48 44.7619 1155.63 44.6963 1155.81 44.6963C1155.97 44.6963 1156.11 44.7513 1156.22 44.8613C1156.34 44.9671 1156.4 45.1047 1156.4 45.2739C1156.4 45.3628 1156.39 45.4411 1156.35 45.5088C1156.32 45.5765 1156.27 45.6421 1156.21 45.7056L1153.5 48.3335C1153.41 48.4224 1153.32 48.4837 1153.24 48.5176C1153.16 48.5472 1153.08 48.562 1152.99 48.562Z\" fill=\"#4C4C4C\"/>\n</g>\n<g style=\"mix-blend-mode:plus-darker\">\n<path d=\"M1183.69 38.3296C1183.53 38.3296 1183.39 38.2767 1183.28 38.1709C1183.16 38.0609 1183.1 37.9212 1183.1 37.752C1183.1 37.6673 1183.12 37.5911 1183.15 37.5234C1183.18 37.4557 1183.23 37.3901 1183.29 37.3267L1186 34.6987C1186.08 34.6183 1186.17 34.5612 1186.25 34.5273C1186.33 34.4935 1186.42 34.4766 1186.5 34.4766C1186.59 34.4766 1186.67 34.4935 1186.75 34.5273C1186.83 34.5612 1186.92 34.6183 1187 34.6987L1189.71 37.3267C1189.77 37.3901 1189.82 37.4557 1189.85 37.5234C1189.89 37.5911 1189.9 37.6673 1189.9 37.752C1189.9 37.9212 1189.84 38.0609 1189.72 38.1709C1189.61 38.2767 1189.46 38.3296 1189.3 38.3296C1189.12 38.3296 1188.97 38.2619 1188.85 38.1265L1187.58 36.7871L1186.5 35.5176L1185.42 36.7871L1184.14 38.1265C1184.02 38.2619 1183.87 38.3296 1183.69 38.3296ZM1186.5 46.4546C1186.32 46.4546 1186.16 46.3911 1186.03 46.2642C1185.9 46.133 1185.83 45.9806 1185.83 45.8071V37.4473L1185.95 35.2573C1185.96 35.105 1186.02 34.9759 1186.12 34.8701C1186.22 34.7601 1186.35 34.7051 1186.5 34.7051C1186.65 34.7051 1186.78 34.7601 1186.88 34.8701C1186.99 34.9759 1187.04 35.105 1187.05 35.2573L1187.17 37.4473V45.8071C1187.17 45.9806 1187.1 46.133 1186.97 46.2642C1186.84 46.3911 1186.69 46.4546 1186.5 46.4546ZM1182.66 52.9609C1181.55 52.9609 1180.69 52.6605 1180.09 52.0596C1179.49 51.4629 1179.19 50.6102 1179.19 49.5015V43.2173C1179.19 42.1086 1179.49 41.2559 1180.09 40.6592C1180.69 40.0583 1181.55 39.7578 1182.66 39.7578H1184.37V41.1606H1182.69C1182.02 41.1606 1181.5 41.3426 1181.14 41.7065C1180.78 42.0662 1180.6 42.5804 1180.6 43.249V49.4697C1180.6 50.1383 1180.78 50.6546 1181.14 51.0186C1181.5 51.3825 1182.02 51.5645 1182.69 51.5645H1190.31C1190.98 51.5645 1191.5 51.3825 1191.86 51.0186C1192.23 50.6546 1192.41 50.1383 1192.41 49.4697V43.249C1192.41 42.5804 1192.23 42.0662 1191.86 41.7065C1191.5 41.3426 1190.98 41.1606 1190.31 41.1606H1188.63V39.7578H1190.35C1191.46 39.7578 1192.31 40.0583 1192.9 40.6592C1193.51 41.2559 1193.81 42.1086 1193.81 43.2173V49.5015C1193.81 50.6102 1193.51 51.4629 1192.9 52.0596C1192.31 52.6605 1191.46 52.9609 1190.35 52.9609H1182.66Z\" fill=\"#4C4C4C\"/>\n</g>\n<g style=\"mix-blend-mode:plus-darker\">\n<path d=\"M1219.79 50.3965C1219.79 50.5446 1219.76 50.6779 1219.69 50.7964C1219.61 50.9149 1219.52 51.0101 1219.39 51.082C1219.28 51.154 1219.14 51.1899 1218.99 51.1899C1218.85 51.1899 1218.72 51.154 1218.6 51.082C1218.48 51.0101 1218.38 50.9149 1218.31 50.7964C1218.24 50.6779 1218.21 50.5446 1218.21 50.3965V38.4312C1218.21 38.2915 1218.24 38.1603 1218.31 38.0376C1218.38 37.9149 1218.48 37.8175 1218.6 37.7456C1218.72 37.6737 1218.85 37.6377 1218.99 37.6377C1219.14 37.6377 1219.28 37.6737 1219.39 37.7456C1219.52 37.8175 1219.61 37.9149 1219.69 38.0376C1219.76 38.1603 1219.79 38.2915 1219.79 38.4312V50.3965ZM1213.01 45.2104C1212.87 45.2104 1212.74 45.1745 1212.61 45.1025C1212.5 45.0306 1212.4 44.9354 1212.33 44.8169C1212.26 44.6942 1212.22 44.5609 1212.22 44.417C1212.22 44.2689 1212.26 44.1356 1212.33 44.0171C1212.4 43.8986 1212.5 43.8034 1212.61 43.7314C1212.74 43.6595 1212.87 43.6235 1213.01 43.6235H1224.98C1225.13 43.6235 1225.26 43.6595 1225.38 43.7314C1225.5 43.8034 1225.59 43.8986 1225.67 44.0171C1225.74 44.1356 1225.77 44.2689 1225.77 44.417C1225.77 44.5609 1225.74 44.6942 1225.67 44.8169C1225.59 44.9354 1225.5 45.0306 1225.38 45.1025C1225.26 45.1745 1225.13 45.2104 1224.98 45.2104H1213.01Z\" fill=\"#4C4C4C\"/>\n</g>\n<g style=\"mix-blend-mode:plus-darker\">\n<path d=\"M1246.83 49.2793C1245.98 49.2793 1245.33 49.0635 1244.89 48.6318C1244.46 48.196 1244.24 47.5549 1244.24 46.7085V38.3804C1244.24 37.5382 1244.46 36.9014 1244.89 36.4697C1245.33 36.0339 1245.98 35.8159 1246.83 35.8159H1255.11C1255.96 35.8159 1256.61 36.0339 1257.04 36.4697C1257.48 36.9056 1257.7 37.5425 1257.7 38.3804V40.1831H1256.29V38.501C1256.29 38.0736 1256.18 37.7541 1255.96 37.5425C1255.75 37.3267 1255.44 37.2188 1255.03 37.2188H1246.91C1246.5 37.2188 1246.18 37.3267 1245.97 37.5425C1245.75 37.7541 1245.64 38.0736 1245.64 38.501V46.5942C1245.64 47.0216 1245.75 47.3433 1245.97 47.5591C1246.18 47.7707 1246.5 47.8765 1246.91 47.8765H1248.98V49.2793H1246.83ZM1250.89 53.0435C1250.03 53.0435 1249.39 52.8255 1248.95 52.3896C1248.51 51.958 1248.3 51.319 1248.3 50.4727V42.1509C1248.3 41.3045 1248.51 40.6655 1248.95 40.2339C1249.39 39.798 1250.03 39.5801 1250.89 39.5801H1259.17C1260.02 39.5801 1260.66 39.798 1261.09 40.2339C1261.53 40.6698 1261.75 41.3088 1261.75 42.1509V50.4727C1261.75 51.3148 1261.53 51.9538 1261.09 52.3896C1260.66 52.8255 1260.02 53.0435 1259.17 53.0435H1250.89ZM1250.97 51.6406H1259.09C1259.49 51.6406 1259.8 51.5327 1260.02 51.3169C1260.24 51.1053 1260.35 50.7858 1260.35 50.3584V42.2651C1260.35 41.8377 1260.24 41.5182 1260.02 41.3066C1259.8 41.0908 1259.49 40.9829 1259.09 40.9829H1250.97C1250.55 40.9829 1250.24 41.0908 1250.02 41.3066C1249.81 41.5182 1249.7 41.8377 1249.7 42.2651V50.3584C1249.7 50.7858 1249.81 51.1053 1250.02 51.3169C1250.24 51.5327 1250.55 51.6406 1250.97 51.6406Z\" fill=\"#4C4C4C\"/>\n</g>\n<g opacity=\"0.67\">\n<mask id=\"mask1_782_423\" style=\"mask-type:luminance\" maskUnits=\"userSpaceOnUse\" x=\"371\" y=\"-50\" width=\"537\" height=\"188\">\n<rect width=\"537\" height=\"188\" transform=\"translate(371 -50)\" fill=\"white\"/>\n<rect x=\"447\" y=\"26\" width=\"385\" height=\"36\" rx=\"18\" fill=\"black\"/>\n</mask>\n<g mask=\"url(#mask1_782_423)\">\n<foreignObject x=\"407\" y=\"-12\" width=\"465\" height=\"116\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"backdrop-filter:blur(20px);clip-path:url(#bgblur_1_782_423_clip_path);height:100%;width:100%\"></div></foreignObject><g filter=\"url(#filter3_f_782_423)\" data-figma-bg-blur-radius=\"40\">\n<path d=\"M447 46C447 36.0589 455.059 28 465 28H814C823.941 28 832 36.0589 832 46V46C832 55.9411 823.941 64 814 64H465C455.059 64 447 55.9411 447 46V46Z\" fill=\"black\" fill-opacity=\"0.1\" style=\"mix-blend-mode:hard-light\"/>\n</g>\n</g>\n</g>\n<path d=\"M447 44C447 34.0589 455.059 26 465 26H814C823.941 26 832 34.0589 832 44V44C832 53.9411 823.941 62 814 62H465C455.059 62 447 53.9411 447 44V44Z\" fill=\"#333333\" style=\"mix-blend-mode:color-dodge\"/>\n<path d=\"M447 44C447 34.0589 455.059 26 465 26H814C823.941 26 832 34.0589 832 44V44C832 53.9411 823.941 62 814 62H465C455.059 62 447 53.9411 447 44V44Z\" fill=\"white\" fill-opacity=\"0.5\"/>\n<path d=\"M447 44C447 34.0589 455.059 26 465 26H814C823.941 26 832 34.0589 832 44V44C832 53.9411 823.941 62 814 62H465C455.059 62 447 53.9411 447 44V44Z\" fill=\"#F7F7F7\" style=\"mix-blend-mode:plus-darker\"/>\n<rect x=\"447\" y=\"26\" width=\"385\" height=\"36\" rx=\"18\" fill=\"black\" fill-opacity=\"0.01\"/>\n<path d=\"M471.103 47.1719C471.103 47.3285 471.044 47.4618 470.925 47.5718C470.811 47.6776 470.669 47.7305 470.5 47.7305H459.5C459.326 47.7305 459.183 47.6776 459.068 47.5718C458.954 47.4618 458.897 47.3285 458.897 47.1719C458.897 47.0111 458.954 46.8778 459.068 46.772C459.183 46.6662 459.326 46.6133 459.5 46.6133H470.5C470.669 46.6133 470.811 46.6662 470.925 46.772C471.044 46.8778 471.103 47.0111 471.103 47.1719ZM467.603 49.6792C467.603 49.8358 467.544 49.967 467.425 50.0728C467.311 50.1828 467.169 50.2378 467 50.2378H459.5C459.326 50.2378 459.183 50.1828 459.068 50.0728C458.954 49.967 458.897 49.8358 458.897 49.6792C458.897 49.5184 458.954 49.3851 459.068 49.2793C459.183 49.1735 459.326 49.1206 459.5 49.1206H467C467.169 49.1206 467.311 49.1735 467.425 49.2793C467.544 49.3851 467.603 49.5184 467.603 49.6792ZM460.69 38.5708H469.297C469.97 38.5708 470.446 38.7253 470.726 39.0342C471.009 39.3431 471.151 39.8213 471.151 40.4688V43.3188C471.151 43.9663 471.009 44.4445 470.726 44.7534C470.446 45.0581 469.97 45.2104 469.297 45.2104H460.69C460.017 45.2104 459.541 45.0581 459.262 44.7534C458.982 44.4445 458.843 43.9663 458.843 43.3188V40.4688C458.843 39.8213 458.982 39.3431 459.262 39.0342C459.541 38.7253 460.017 38.5708 460.69 38.5708ZM460.093 43.3506C460.093 43.6087 460.142 43.797 460.239 43.9155C460.341 44.0298 460.516 44.0869 460.766 44.0869H469.228C469.477 44.0869 469.651 44.0298 469.748 43.9155C469.85 43.797 469.9 43.6087 469.9 43.3506V40.4307C469.9 40.181 469.85 39.9969 469.748 39.8784C469.651 39.7599 469.477 39.7007 469.228 39.7007H460.766C460.516 39.7007 460.341 39.7599 460.239 39.8784C460.142 39.9969 460.093 40.181 460.093 40.4307V43.3506Z\" fill=\"#808080\"/>\n\n<path d=\"M814 50.5425C813.217 50.5425 812.483 50.3965 811.797 50.1045C811.112 49.8125 810.509 49.4062 809.988 48.8857C809.472 48.3652 809.066 47.7643 808.77 47.083C808.478 46.3975 808.332 45.6632 808.332 44.8804C808.332 44.0975 808.478 43.3633 808.77 42.6777C809.066 41.9922 809.472 41.3892 809.988 40.8687C810.509 40.3481 811.112 39.9419 811.797 39.6499C812.483 39.3579 813.217 39.2119 814 39.2119C814.33 39.2119 814.652 39.2394 814.965 39.2944C815.278 39.3494 815.578 39.4299 815.866 39.5356C815.98 39.5737 816.088 39.6414 816.19 39.7388C816.296 39.8319 816.347 39.9673 816.342 40.145C816.342 40.3058 816.298 40.437 816.209 40.5386C816.12 40.6401 816.01 40.7057 815.879 40.7354C815.748 40.765 815.619 40.7565 815.492 40.71C815.255 40.6253 815.011 40.5618 814.762 40.5195C814.516 40.473 814.262 40.4497 814 40.4497C813.391 40.4497 812.817 40.564 812.28 40.7925C811.747 41.021 811.277 41.3384 810.871 41.7446C810.469 42.1509 810.151 42.6227 809.918 43.1602C809.69 43.6934 809.576 44.2646 809.576 44.874C809.576 45.4834 809.69 46.0568 809.918 46.5942C810.151 47.1274 810.469 47.5972 810.871 48.0034C811.277 48.4054 811.747 48.7207 812.28 48.9492C812.817 49.1777 813.391 49.292 814 49.292C814.609 49.292 815.181 49.1777 815.714 48.9492C816.251 48.7207 816.721 48.4054 817.123 48.0034C817.529 47.5972 817.847 47.1274 818.075 46.5942C818.304 46.0568 818.418 45.4834 818.418 44.874C818.418 44.7005 818.479 44.5545 818.602 44.436C818.729 44.3133 818.877 44.252 819.046 44.252C819.216 44.252 819.362 44.3133 819.484 44.436C819.607 44.5545 819.668 44.7005 819.668 44.874C819.668 45.6611 819.52 46.3975 819.224 47.083C818.932 47.7643 818.526 48.3652 818.005 48.8857C817.485 49.4062 816.882 49.8125 816.196 50.1045C815.515 50.3965 814.783 50.5425 814 50.5425ZM815.644 40.0371L813.378 37.8154C813.319 37.7604 813.274 37.6969 813.245 37.625C813.219 37.5531 813.207 37.4748 813.207 37.3901C813.207 37.2166 813.264 37.0685 813.378 36.9458C813.496 36.8231 813.64 36.7617 813.81 36.7617C813.983 36.7617 814.131 36.8231 814.254 36.9458L816.856 39.5928C816.988 39.724 817.053 39.8784 817.053 40.0562C817.053 40.1408 817.036 40.2212 817.002 40.2974C816.973 40.3735 816.924 40.4455 816.856 40.5132L814.248 43.1411C814.129 43.2554 813.983 43.3125 813.81 43.3125C813.64 43.3125 813.496 43.2533 813.378 43.1348C813.264 43.0163 813.207 42.8703 813.207 42.6968C813.207 42.6164 813.219 42.5402 813.245 42.4683C813.274 42.3963 813.321 42.3328 813.384 42.2778L815.644 40.0371Z\" fill=\"#808080\"/>\n<g opacity=\"0.67\">\n<mask id=\"mask2_782_423\" style=\"mask-type:luminance\" maskUnits=\"userSpaceOnUse\" x=\"87\" y=\"-50\" width=\"219\" height=\"188\">\n<rect width=\"219\" height=\"188\" transform=\"translate(87 -50)\" fill=\"white\"/>\n<rect x=\"163\" y=\"26\" width=\"67\" height=\"36\" rx=\"18\" fill=\"black\"/>\n</mask>\n<g mask=\"url(#mask2_782_423)\">\n<foreignObject x=\"123\" y=\"-12\" width=\"147\" height=\"116\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"backdrop-filter:blur(20px);clip-path:url(#bgblur_2_782_423_clip_path);height:100%;width:100%\"></div></foreignObject><g filter=\"url(#filter5_f_782_423)\" data-figma-bg-blur-radius=\"40\">\n<path d=\"M163 46C163 36.0589 171.059 28 181 28H212C221.941 28 230 36.0589 230 46V46C230 55.9411 221.941 64 212 64H181C171.059 64 163 55.9411 163 46V46Z\" fill=\"black\" fill-opacity=\"0.1\" style=\"mix-blend-mode:hard-light\"/>\n</g>\n</g>\n</g>\n<path d=\"M163 44C163 34.0589 171.059 26 181 26H212C221.941 26 230 34.0589 230 44V44C230 53.9411 221.941 62 212 62H181C171.059 62 163 53.9411 163 44V44Z\" fill=\"#333333\" style=\"mix-blend-mode:color-dodge\"/>\n<path d=\"M163 44C163 34.0589 171.059 26 181 26H212C221.941 26 230 34.0589 230 44V44C230 53.9411 221.941 62 212 62H181C171.059 62 163 53.9411 163 44V44Z\" fill=\"white\" fill-opacity=\"0.5\"/>\n<path d=\"M163 44C163 34.0589 171.059 26 181 26H212C221.941 26 230 34.0589 230 44V44C230 53.9411 221.941 62 212 62H181C171.059 62 163 53.9411 163 44V44Z\" fill=\"#F7F7F7\" style=\"mix-blend-mode:plus-darker\"/>\n<rect x=\"163\" y=\"26\" width=\"67\" height=\"36\" rx=\"18\" fill=\"black\" fill-opacity=\"0.01\"/>\n<g style=\"mix-blend-mode:plus-darker\">\n<path d=\"M175.871 44.417C175.871 44.29 175.892 44.1758 175.935 44.0742C175.981 43.9727 176.053 43.8753 176.15 43.7822L182.581 37.5679C182.737 37.4113 182.93 37.333 183.158 37.333C183.311 37.333 183.448 37.3711 183.571 37.4473C183.698 37.5192 183.797 37.6165 183.869 37.7393C183.945 37.862 183.983 37.9995 183.983 38.1519C183.983 38.3761 183.901 38.5729 183.736 38.7422L177.845 44.417L183.736 50.0854C183.901 50.2547 183.983 50.4515 183.983 50.6758C183.983 50.8324 183.945 50.972 183.869 51.0947C183.797 51.2217 183.698 51.3211 183.571 51.3931C183.448 51.465 183.311 51.501 183.158 51.501C182.93 51.501 182.737 51.4227 182.581 51.2661L176.15 45.0518C176.053 44.9587 175.981 44.8613 175.935 44.7598C175.892 44.654 175.871 44.5397 175.871 44.417Z\" fill=\"#4C4C4C\"/>\n</g>\n<path d=\"M196 34H197V54H196V34Z\" fill=\"#E6E6E6\"/>\n<g style=\"mix-blend-mode:plus-darker\">\n<path d=\"M217.129 44.417C217.129 44.5397 217.106 44.654 217.059 44.7598C217.017 44.8613 216.947 44.9587 216.85 45.0518L210.419 51.2661C210.263 51.4227 210.07 51.501 209.842 51.501C209.685 51.501 209.546 51.465 209.423 51.3931C209.3 51.3211 209.201 51.2217 209.125 51.0947C209.048 50.972 209.01 50.8324 209.01 50.6758C209.01 50.4515 209.095 50.2547 209.264 50.0854L215.155 44.417L209.264 38.7422C209.095 38.5729 209.01 38.3761 209.01 38.1519C209.01 37.9995 209.048 37.862 209.125 37.7393C209.201 37.6165 209.3 37.5192 209.423 37.4473C209.546 37.3711 209.685 37.333 209.842 37.333C210.07 37.333 210.263 37.4113 210.419 37.5679L216.85 43.7822C216.947 43.8753 217.017 43.9727 217.059 44.0742C217.106 44.1758 217.129 44.29 217.129 44.417Z\" fill=\"#C6C6C6\"/>\n</g>\n<g opacity=\"0.67\">\n<mask id=\"mask3_782_423\" style=\"mask-type:luminance\" maskUnits=\"userSpaceOnUse\" x=\"19\" y=\"-50\" width=\"206\" height=\"188\">\n<rect width=\"206\" height=\"188\" transform=\"translate(19 -50)\" fill=\"white\"/>\n<rect x=\"95\" y=\"26\" width=\"54\" height=\"36\" rx=\"18\" fill=\"black\"/>\n</mask>\n<g mask=\"url(#mask3_782_423)\">\n<foreignObject x=\"55\" y=\"-12\" width=\"134\" height=\"116\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"backdrop-filter:blur(20px);clip-path:url(#bgblur_3_782_423_clip_path);height:100%;width:100%\"></div></foreignObject><g filter=\"url(#filter7_f_782_423)\" data-figma-bg-blur-radius=\"40\">\n<path d=\"M95 46C95 36.0589 103.059 28 113 28H131C140.941 28 149 36.0589 149 46V46C149 55.9411 140.941 64 131 64H113C103.059 64 95 55.9411 95 46V46Z\" fill=\"black\" fill-opacity=\"0.1\" style=\"mix-blend-mode:hard-light\"/>\n</g>\n</g>\n</g>\n<path d=\"M95 44C95 34.0589 103.059 26 113 26H131C140.941 26 149 34.0589 149 44V44C149 53.9411 140.941 62 131 62H113C103.059 62 95 53.9411 95 44V44Z\" fill=\"#333333\" style=\"mix-blend-mode:color-dodge\"/>\n<path d=\"M95 44C95 34.0589 103.059 26 113 26H131C140.941 26 149 34.0589 149 44V44C149 53.9411 140.941 62 131 62H113C103.059 62 95 53.9411 95 44V44Z\" fill=\"white\" fill-opacity=\"0.5\"/>\n<path d=\"M95 44C95 34.0589 103.059 26 113 26H131C140.941 26 149 34.0589 149 44V44C149 53.9411 140.941 62 131 62H113C103.059 62 95 53.9411 95 44V44Z\" fill=\"#F7F7F7\" style=\"mix-blend-mode:plus-darker\"/>\n<rect x=\"95\" y=\"26\" width=\"54\" height=\"36\" rx=\"18\" fill=\"black\" fill-opacity=\"0.01\"/>\n<path d=\"M111.725 50.8281V37.9995H113.058V50.8281H111.725ZM108.741 51.9834C108.026 51.9834 107.415 51.848 106.907 51.5771C106.399 51.3105 106.01 50.9233 105.739 50.4155C105.472 49.9119 105.339 49.3026 105.339 48.5874V40.2593C105.339 39.5441 105.472 38.9326 105.739 38.4248C106.01 37.917 106.399 37.5298 106.907 37.2632C107.415 36.9924 108.026 36.8569 108.741 36.8569H121.398C122.084 36.8569 122.668 36.9924 123.15 37.2632C123.637 37.5298 124.009 37.917 124.268 38.4248C124.53 38.9326 124.661 39.5441 124.661 40.2593V48.5874C124.661 49.3026 124.53 49.9119 124.268 50.4155C124.009 50.9233 123.637 51.3105 123.15 51.5771C122.668 51.848 122.084 51.9834 121.398 51.9834H108.741ZM108.811 50.5869H121.189C121.841 50.5869 122.346 50.4028 122.706 50.0347C123.07 49.6707 123.252 49.1629 123.252 48.5112V40.3291C123.252 39.6774 123.07 39.1696 122.706 38.8057C122.346 38.4417 121.841 38.2598 121.189 38.2598H108.811C108.159 38.2598 107.652 38.4417 107.288 38.8057C106.924 39.1696 106.742 39.6774 106.742 40.3291V48.5112C106.742 49.1629 106.924 49.6707 107.288 50.0347C107.652 50.4028 108.159 50.5869 108.811 50.5869ZM110.125 41.2812H108.348C108.212 41.2812 108.098 41.2347 108.005 41.1416C107.912 41.0443 107.865 40.9342 107.865 40.8115C107.865 40.6846 107.912 40.5745 108.005 40.4814C108.098 40.3883 108.212 40.3418 108.348 40.3418H110.125C110.256 40.3418 110.368 40.3883 110.461 40.4814C110.559 40.5745 110.607 40.6846 110.607 40.8115C110.607 40.9342 110.559 41.0443 110.461 41.1416C110.368 41.2347 110.256 41.2812 110.125 41.2812ZM110.125 43.4775H108.348C108.212 43.4775 108.098 43.431 108.005 43.3379C107.912 43.2448 107.865 43.1348 107.865 43.0078C107.865 42.8809 107.912 42.7729 108.005 42.6841C108.098 42.591 108.212 42.5444 108.348 42.5444H110.125C110.256 42.5444 110.368 42.591 110.461 42.6841C110.559 42.7729 110.607 42.8809 110.607 43.0078C110.607 43.1348 110.559 43.2448 110.461 43.3379C110.368 43.431 110.256 43.4775 110.125 43.4775ZM110.125 45.6802H108.348C108.212 45.6802 108.098 45.6336 108.005 45.5405C107.912 45.4474 107.865 45.3374 107.865 45.2104C107.865 45.0835 107.912 44.9756 108.005 44.8867C108.098 44.7979 108.212 44.7534 108.348 44.7534H110.125C110.256 44.7534 110.368 44.7979 110.461 44.8867C110.559 44.9756 110.607 45.0835 110.607 45.2104C110.607 45.3374 110.559 45.4474 110.461 45.5405C110.368 45.6336 110.256 45.6802 110.125 45.6802Z\" fill=\"#4C4C4C\"/>\n<path d=\"M135.006 47.2734C134.791 47.2734 134.596 47.1867 134.422 47.0132L130.658 43.2109C130.519 43.0671 130.449 42.8957 130.449 42.6968C130.449 42.4894 130.519 42.3159 130.658 42.1763C130.802 42.0324 130.978 41.9604 131.185 41.9604C131.384 41.9604 131.562 42.0366 131.718 42.189L135.248 45.769H134.765L138.288 42.189C138.445 42.0366 138.622 41.9604 138.821 41.9604C139.024 41.9604 139.196 42.0324 139.335 42.1763C139.479 42.3159 139.551 42.4894 139.551 42.6968C139.551 42.8999 139.481 43.0713 139.342 43.2109L135.584 47.0132C135.419 47.1825 135.226 47.2692 135.006 47.2734Z\" fill=\"#4C4C4C\"/>\n<defs>\n<filter id=\"filter1_f_782_423\" x=\"1094\" y=\"-12\" width=\"219\" height=\"116\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"10\" result=\"effect1_foregroundBlur_782_423\"/>\n</filter>\n<clipPath id=\"bgblur_0_782_423_clip_path\" transform=\"translate(-1094 12)\"><path d=\"M1134 46C1134 36.0589 1142.06 28 1152 28H1255C1264.94 28 1273 36.0589 1273 46V46C1273 55.9411 1264.94 64 1255 64H1152C1142.06 64 1134 55.9411 1134 46V46Z\"/>\n</clipPath><filter id=\"filter3_f_782_423\" x=\"407\" y=\"-12\" width=\"465\" height=\"116\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"10\" result=\"effect1_foregroundBlur_782_423\"/>\n</filter>\n<clipPath id=\"bgblur_1_782_423_clip_path\" transform=\"translate(-407 12)\"><path d=\"M447 46C447 36.0589 455.059 28 465 28H814C823.941 28 832 36.0589 832 46V46C832 55.9411 823.941 64 814 64H465C455.059 64 447 55.9411 447 46V46Z\"/>\n</clipPath><filter id=\"filter5_f_782_423\" x=\"123\" y=\"-12\" width=\"147\" height=\"116\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"10\" result=\"effect1_foregroundBlur_782_423\"/>\n</filter>\n<clipPath id=\"bgblur_2_782_423_clip_path\" transform=\"translate(-123 12)\"><path d=\"M163 46C163 36.0589 171.059 28 181 28H212C221.941 28 230 36.0589 230 46V46C230 55.9411 221.941 64 212 64H181C171.059 64 163 55.9411 163 46V46Z\"/>\n</clipPath><filter id=\"filter7_f_782_423\" x=\"55\" y=\"-12\" width=\"134\" height=\"116\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"10\" result=\"effect1_foregroundBlur_782_423\"/>\n</filter>\n<clipPath id=\"bgblur_3_782_423_clip_path\" transform=\"translate(-55 12)\"><path d=\"M95 46C95 36.0589 103.059 28 113 28H131C140.941 28 149 36.0589 149 46V46C149 55.9411 140.941 64 131 64H113C103.059 64 95 55.9411 95 46V46Z\"/>\n</clipPath></defs>\n</svg>\n";
|
|
6
|
+
// Cropped viewBox covering only the visible toolbar area.
|
|
7
|
+
export const SAFARI_TOOLBAR_VIEWBOX = { x: 0, y: 18, width: 1280, height: 52 };
|
|
8
|
+
export const SAFARI_TOOLBAR_REF_W = SAFARI_TOOLBAR_VIEWBOX.width;
|
|
9
|
+
export const SAFARI_TOOLBAR_REF_H = SAFARI_TOOLBAR_VIEWBOX.height;
|
|
10
|
+
// URL pill bounds in viewBox coordinates (y is in the original 88-tall space).
|
|
11
|
+
export const SAFARI_URL_PILL = { x: 447, y: 26, width: 385, height: 36 };
|
|
12
|
+
//# sourceMappingURL=safari-toolbar-asset.js.map
|
package/dist/security.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { ActionType, AgentConfig, CaptureObjective, CaptureRepairCause, InteractiveElement } from './types.js';
|
|
1
|
+
import type { AKTree, ActionType, AgentConfig, CaptureObjective, CaptureRepairCause, InteractiveElement } from './types.js';
|
|
2
2
|
export interface SecurityContext {
|
|
3
3
|
rootUrl?: string;
|
|
4
4
|
currentUrl?: string;
|
|
5
5
|
credentials?: AgentConfig['credentials'];
|
|
6
6
|
interactiveElements: InteractiveElement[];
|
|
7
|
+
akTree?: AKTree;
|
|
7
8
|
currentLang?: string;
|
|
8
9
|
currentTheme?: 'light' | 'dark';
|
|
9
10
|
runMode?: AgentConfig['runMode'];
|
package/dist/security.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findAKNodeById } from './ak-tree.js';
|
|
1
2
|
const AUTH_URL_RE = /\b(login|log-in|signin|sign-in|auth|session|password|otp|verify|2fa|connexion|connect|identif|acceder|anmeldung|beta|invite|access|early-access|waitlist)\b/i;
|
|
2
3
|
const AUTH_ACTION_RE = /\b(log ?in|sign ?in|se connecter|connexion|continue|continuer|next|suivant|verify|verifier|submit|soumettre|use email|email|e-mail|password|mot de passe|otp|code|enter|entrer|unlock|access|acceder)\b/i;
|
|
3
4
|
const AUTH_ENTRY_RE = /\b(log ?in|sign ?in|se connecter|connexion|continue with email|continuer avec l[‘’]?e-?mail|sign ?in with email|log ?in with email|connexion par email|use email|use password)\b/i;
|
|
@@ -245,7 +246,13 @@ function isAllowedNavigation(candidateUrl, context) {
|
|
|
245
246
|
return false;
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
|
-
function resolveTargetFromAction(args,
|
|
249
|
+
function resolveTargetFromAction(args, context) {
|
|
250
|
+
if (typeof args.nodeId === 'string' && context.akTree) {
|
|
251
|
+
const node = findAKNodeById(context.akTree.root, args.nodeId);
|
|
252
|
+
if (node)
|
|
253
|
+
return akNodeToInteractiveElement(node, context);
|
|
254
|
+
}
|
|
255
|
+
const interactiveElements = context.interactiveElements;
|
|
249
256
|
if (args.index !== undefined) {
|
|
250
257
|
return interactiveElements.find(el => el.index === args.index) || null;
|
|
251
258
|
}
|
|
@@ -262,6 +269,38 @@ function resolveTargetFromAction(args, interactiveElements) {
|
|
|
262
269
|
}
|
|
263
270
|
return null;
|
|
264
271
|
}
|
|
272
|
+
function akNodeToInteractiveElement(node, context) {
|
|
273
|
+
const viewportHeight = context.akTree?.page.viewport.height ?? Number.MAX_SAFE_INTEGER;
|
|
274
|
+
const visibilityState = !node.visible
|
|
275
|
+
? 'offscreen'
|
|
276
|
+
: node.bounds.y >= 0 && node.bounds.y + node.bounds.h <= viewportHeight
|
|
277
|
+
? 'full'
|
|
278
|
+
: node.bounds.y > viewportHeight || node.bounds.y + node.bounds.h < 0
|
|
279
|
+
? 'offscreen'
|
|
280
|
+
: 'partial';
|
|
281
|
+
return {
|
|
282
|
+
index: -1,
|
|
283
|
+
tag: node.attributes.tagName?.toLowerCase() || node.type,
|
|
284
|
+
role: node.attributes.role || node.type,
|
|
285
|
+
text: node.label,
|
|
286
|
+
ariaLabel: node.attributes['aria-label'] || null,
|
|
287
|
+
title: node.attributes.title || null,
|
|
288
|
+
ariaControls: node.attributes['aria-controls'] || null,
|
|
289
|
+
ariaExpanded: node.state.expanded !== undefined ? String(node.state.expanded) : (node.attributes['aria-expanded'] || null),
|
|
290
|
+
ariaHasPopup: node.attributes['aria-haspopup'] || null,
|
|
291
|
+
href: node.attributes.href || null,
|
|
292
|
+
inputType: node.attributes.type || null,
|
|
293
|
+
boundingBox: {
|
|
294
|
+
x: node.bounds.x,
|
|
295
|
+
y: node.bounds.y,
|
|
296
|
+
width: node.bounds.w,
|
|
297
|
+
height: node.bounds.h,
|
|
298
|
+
},
|
|
299
|
+
selector: node.sourceRef,
|
|
300
|
+
visible: node.visible,
|
|
301
|
+
visibilityState,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
265
304
|
function isButtonLike(target) {
|
|
266
305
|
return target.tag === 'button'
|
|
267
306
|
|| BUTTON_ROLE_RE.test(target.role)
|
|
@@ -373,12 +412,12 @@ function evaluateTypingTarget(target, typedText, context) {
|
|
|
373
412
|
return { allowed: true, target };
|
|
374
413
|
}
|
|
375
414
|
export function evaluateResolvedActionSecurity(action, args, context, target) {
|
|
376
|
-
if (action === 'click' || action === 'hover') {
|
|
415
|
+
if (action === 'click' || action === 'hover' || action === 'tap') {
|
|
377
416
|
if (!target)
|
|
378
417
|
return { allowed: false, reason: 'Blocked by security policy: unresolved target.' };
|
|
379
418
|
return evaluateClickTarget(target, context);
|
|
380
419
|
}
|
|
381
|
-
if (action === 'type_text') {
|
|
420
|
+
if (action === 'type_text' || action === 'type') {
|
|
382
421
|
if (!target) {
|
|
383
422
|
return {
|
|
384
423
|
allowed: false,
|
|
@@ -523,8 +562,8 @@ export function evaluateActionSecurity(action, args, context) {
|
|
|
523
562
|
return { allowed: true };
|
|
524
563
|
return { allowed: false, reason: `Blocked by security policy: keyboard key "${key}" is not allowed.` };
|
|
525
564
|
}
|
|
526
|
-
if (action === 'click') {
|
|
527
|
-
const target = resolveTargetFromAction(args, context
|
|
565
|
+
if (action === 'click' || action === 'tap') {
|
|
566
|
+
const target = resolveTargetFromAction(args, context);
|
|
528
567
|
if ((args.selector || (args.x !== undefined && args.y !== undefined)) && !target) {
|
|
529
568
|
return {
|
|
530
569
|
allowed: false,
|
|
@@ -536,7 +575,7 @@ export function evaluateActionSecurity(action, args, context) {
|
|
|
536
575
|
return evaluateResolvedActionSecurity(action, args, context, target);
|
|
537
576
|
}
|
|
538
577
|
if (action === 'hover') {
|
|
539
|
-
const target = resolveTargetFromAction(args, context
|
|
578
|
+
const target = resolveTargetFromAction(args, context);
|
|
540
579
|
if ((args.selector || (args.x !== undefined && args.y !== undefined)) && !target) {
|
|
541
580
|
return {
|
|
542
581
|
allowed: false,
|
|
@@ -547,16 +586,16 @@ export function evaluateActionSecurity(action, args, context) {
|
|
|
547
586
|
return { allowed: true };
|
|
548
587
|
return evaluateResolvedActionSecurity(action, args, context, target);
|
|
549
588
|
}
|
|
550
|
-
if (action === 'type_text') {
|
|
551
|
-
const target = resolveTargetFromAction(args, context
|
|
589
|
+
if (action === 'type_text' || action === 'type') {
|
|
590
|
+
const target = resolveTargetFromAction(args, context);
|
|
552
591
|
return evaluateResolvedActionSecurity(action, args, context, target);
|
|
553
592
|
}
|
|
554
593
|
if (action === 'select_option') {
|
|
555
|
-
const target = resolveTargetFromAction(args, context
|
|
594
|
+
const target = resolveTargetFromAction(args, context);
|
|
556
595
|
return evaluateResolvedActionSecurity(action, args, context, target);
|
|
557
596
|
}
|
|
558
597
|
if (action === 'safe_expand') {
|
|
559
|
-
const target = resolveTargetFromAction(args, context
|
|
598
|
+
const target = resolveTargetFromAction(args, context);
|
|
560
599
|
return evaluateResolvedActionSecurity(action, args, context, target);
|
|
561
600
|
}
|
|
562
601
|
return { allowed: true };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture Agent — Selector Resolver
|
|
3
|
+
*
|
|
4
|
+
* Progressive selector resolution for opcodes that target elements:
|
|
5
|
+
* 1. Primary selector from compiled program
|
|
6
|
+
* 2. AKTree fingerprint match
|
|
7
|
+
* 3. Selector memory candidates (from Supabase)
|
|
8
|
+
* 4. Fuzzy text match on AKTree nodes
|
|
9
|
+
*/
|
|
10
|
+
import type { RuntimeAdapter } from './execution-types.js';
|
|
11
|
+
export interface ResolvedSelector {
|
|
12
|
+
selector: string;
|
|
13
|
+
strategy: 'primary' | 'fingerprint' | 'memory' | 'fuzzy_text' | 'alternate';
|
|
14
|
+
confidence: 'high' | 'medium' | 'low';
|
|
15
|
+
}
|
|
16
|
+
export interface SelectorResolverOptions {
|
|
17
|
+
/** Primary selector from the compiled opcode */
|
|
18
|
+
primary: string;
|
|
19
|
+
/** AKTree fingerprint for fuzzy matching */
|
|
20
|
+
fingerprint?: string;
|
|
21
|
+
/** Alternative selectors from the compiled opcode */
|
|
22
|
+
alternates?: string[];
|
|
23
|
+
/** Selector memory map: stepSignature -> known-good selectors */
|
|
24
|
+
selectorMemory?: Record<string, string[]>;
|
|
25
|
+
/** Step signature for memory lookup */
|
|
26
|
+
stepSignature?: string;
|
|
27
|
+
/** Human-readable description of the target element (for fuzzy matching) */
|
|
28
|
+
description?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolves a selector by trying multiple strategies in order.
|
|
32
|
+
* Returns the first working selector, or null if nothing matches.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveSelector(adapter: RuntimeAdapter, options: SelectorResolverOptions): Promise<ResolvedSelector | null>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture Agent — Selector Resolver
|
|
3
|
+
*
|
|
4
|
+
* Progressive selector resolution for opcodes that target elements:
|
|
5
|
+
* 1. Primary selector from compiled program
|
|
6
|
+
* 2. AKTree fingerprint match
|
|
7
|
+
* 3. Selector memory candidates (from Supabase)
|
|
8
|
+
* 4. Fuzzy text match on AKTree nodes
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Resolves a selector by trying multiple strategies in order.
|
|
12
|
+
* Returns the first working selector, or null if nothing matches.
|
|
13
|
+
*/
|
|
14
|
+
export async function resolveSelector(adapter, options) {
|
|
15
|
+
const tree = await adapter.getAKTree();
|
|
16
|
+
// 1. Try primary selector
|
|
17
|
+
if (await selectorExists(adapter, options.primary)) {
|
|
18
|
+
return { selector: options.primary, strategy: 'primary', confidence: 'high' };
|
|
19
|
+
}
|
|
20
|
+
// 2. Try alternate selectors
|
|
21
|
+
if (options.alternates) {
|
|
22
|
+
for (const alt of options.alternates) {
|
|
23
|
+
if (await selectorExists(adapter, alt)) {
|
|
24
|
+
return { selector: alt, strategy: 'alternate', confidence: 'high' };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// 3. Try fingerprint match in AKTree
|
|
29
|
+
if (options.fingerprint) {
|
|
30
|
+
const match = findNodeByFingerprint(tree, options.fingerprint);
|
|
31
|
+
if (match) {
|
|
32
|
+
return { selector: match, strategy: 'fingerprint', confidence: 'medium' };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// 4. Try selector memory
|
|
36
|
+
if (options.selectorMemory && options.stepSignature) {
|
|
37
|
+
const candidates = options.selectorMemory[options.stepSignature];
|
|
38
|
+
if (candidates) {
|
|
39
|
+
for (const candidate of candidates) {
|
|
40
|
+
if (await selectorExists(adapter, candidate)) {
|
|
41
|
+
return { selector: candidate, strategy: 'memory', confidence: 'medium' };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// 5. Try fuzzy text match
|
|
47
|
+
if (options.description) {
|
|
48
|
+
const match = findNodeByFuzzyText(tree, options.description);
|
|
49
|
+
if (match) {
|
|
50
|
+
return { selector: match, strategy: 'fuzzy_text', confidence: 'low' };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
// ── Helpers ─────────────────────────────────────────────────────────
|
|
56
|
+
async function selectorExists(adapter, selector) {
|
|
57
|
+
try {
|
|
58
|
+
const found = await adapter.waitFor({
|
|
59
|
+
selector,
|
|
60
|
+
state: 'attached',
|
|
61
|
+
timeoutMs: 2000,
|
|
62
|
+
});
|
|
63
|
+
return found;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Finds an AKTree node whose sourceRef/attributes match a fingerprint string.
|
|
71
|
+
* Returns a CSS selector that can be used to interact with the element.
|
|
72
|
+
*/
|
|
73
|
+
function findNodeByFingerprint(tree, fingerprint) {
|
|
74
|
+
const parts = fingerprint.split(':');
|
|
75
|
+
// Fingerprint format: "type:label:context" e.g. "button:submit:login-form"
|
|
76
|
+
const [expectedType, expectedLabel, expectedContext] = parts;
|
|
77
|
+
let bestMatch = null;
|
|
78
|
+
let bestScore = 0;
|
|
79
|
+
function walk(node) {
|
|
80
|
+
if (!node.visible || !node.interactive) {
|
|
81
|
+
node.children.forEach(walk);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let score = 0;
|
|
85
|
+
// Match type
|
|
86
|
+
if (expectedType && node.type === expectedType)
|
|
87
|
+
score += 3;
|
|
88
|
+
// Match label (fuzzy)
|
|
89
|
+
if (expectedLabel) {
|
|
90
|
+
const nodeLabelLower = node.label.toLowerCase();
|
|
91
|
+
const expectedLabelLower = expectedLabel.toLowerCase();
|
|
92
|
+
if (nodeLabelLower === expectedLabelLower)
|
|
93
|
+
score += 5;
|
|
94
|
+
else if (nodeLabelLower.includes(expectedLabelLower))
|
|
95
|
+
score += 3;
|
|
96
|
+
else if (expectedLabelLower.includes(nodeLabelLower))
|
|
97
|
+
score += 1;
|
|
98
|
+
}
|
|
99
|
+
// Match context (check sourceRef)
|
|
100
|
+
if (expectedContext && node.sourceRef.toLowerCase().includes(expectedContext.toLowerCase())) {
|
|
101
|
+
score += 2;
|
|
102
|
+
}
|
|
103
|
+
if (score > bestScore) {
|
|
104
|
+
bestScore = score;
|
|
105
|
+
bestMatch = node;
|
|
106
|
+
}
|
|
107
|
+
node.children.forEach(walk);
|
|
108
|
+
}
|
|
109
|
+
walk(tree.root);
|
|
110
|
+
if (bestMatch && bestScore >= 4) {
|
|
111
|
+
return buildSelectorFromNode(bestMatch);
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Finds a visible interactive node by fuzzy text matching against the description.
|
|
117
|
+
*/
|
|
118
|
+
function findNodeByFuzzyText(tree, description) {
|
|
119
|
+
const descTokens = tokenize(description);
|
|
120
|
+
if (descTokens.length === 0)
|
|
121
|
+
return null;
|
|
122
|
+
let bestMatch = null;
|
|
123
|
+
let bestOverlap = 0;
|
|
124
|
+
function walk(node) {
|
|
125
|
+
if (!node.visible || !node.interactive) {
|
|
126
|
+
node.children.forEach(walk);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const nodeTokens = tokenize(node.label);
|
|
130
|
+
const overlap = countOverlap(descTokens, nodeTokens);
|
|
131
|
+
if (overlap > bestOverlap) {
|
|
132
|
+
bestOverlap = overlap;
|
|
133
|
+
bestMatch = node;
|
|
134
|
+
}
|
|
135
|
+
node.children.forEach(walk);
|
|
136
|
+
}
|
|
137
|
+
walk(tree.root);
|
|
138
|
+
// Require at least 2 token overlap or >50% match
|
|
139
|
+
if (bestMatch && (bestOverlap >= 2 || bestOverlap / descTokens.length > 0.5)) {
|
|
140
|
+
return buildSelectorFromNode(bestMatch);
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
function buildSelectorFromNode(node) {
|
|
145
|
+
// Try to build the most specific selector from node attributes
|
|
146
|
+
const ref = node.sourceRef;
|
|
147
|
+
// Extract data-testid
|
|
148
|
+
const testIdMatch = ref.match(/data-testid="([^"]+)"/);
|
|
149
|
+
if (testIdMatch)
|
|
150
|
+
return `[data-testid="${testIdMatch[1]}"]`;
|
|
151
|
+
// Extract id
|
|
152
|
+
const idMatch = ref.match(/ id="([^"]+)"/);
|
|
153
|
+
if (idMatch)
|
|
154
|
+
return `#${idMatch[1]}`;
|
|
155
|
+
// Extract tag + role + text
|
|
156
|
+
const tagMatch = ref.match(/^<(\w+)/);
|
|
157
|
+
const tag = tagMatch?.[1] ?? '*';
|
|
158
|
+
const role = node.attributes['role'];
|
|
159
|
+
if (role) {
|
|
160
|
+
return `${tag}[role="${role}"]`;
|
|
161
|
+
}
|
|
162
|
+
// Fallback: use AKNode id as a CSS selector via data attribute
|
|
163
|
+
if (node.id) {
|
|
164
|
+
return `[data-ak-id="${node.id}"]`;
|
|
165
|
+
}
|
|
166
|
+
return `${tag}:has-text("${escapeText(node.label.slice(0, 50))}")`;
|
|
167
|
+
}
|
|
168
|
+
function tokenize(text) {
|
|
169
|
+
return text
|
|
170
|
+
.toLowerCase()
|
|
171
|
+
.split(/[^a-z0-9]+/)
|
|
172
|
+
.filter(t => t.length >= 2);
|
|
173
|
+
}
|
|
174
|
+
function countOverlap(a, b) {
|
|
175
|
+
const setB = new Set(b);
|
|
176
|
+
return a.filter(t => setB.has(t)).length;
|
|
177
|
+
}
|
|
178
|
+
function escapeText(text) {
|
|
179
|
+
return text.replace(/"/g, '\\"').replace(/\n/g, ' ');
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=selector-resolver.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture Agent — Semantic Target Resolver
|
|
3
|
+
*
|
|
4
|
+
* Resolves a SemanticTarget to a concrete Playwright locator.
|
|
5
|
+
* This is the core mechanism that allows opcodes to work WITHOUT CSS selectors.
|
|
6
|
+
*
|
|
7
|
+
* Resolution cascade:
|
|
8
|
+
* 1. CSS selector (if provided, fast path)
|
|
9
|
+
* 2. Playwright semantic locators (getByRole, getByText, getByLabel, getByPlaceholder)
|
|
10
|
+
* 3. Selector alternates
|
|
11
|
+
* 4. Composite: role + name + near (for disambiguation)
|
|
12
|
+
*
|
|
13
|
+
* All resolution happens via Playwright's built-in locator API — no AKTree needed.
|
|
14
|
+
*/
|
|
15
|
+
import type { Page, Locator } from 'playwright';
|
|
16
|
+
import type { SemanticTarget } from './execution-types.js';
|
|
17
|
+
export interface ResolvedTarget {
|
|
18
|
+
locator: Locator;
|
|
19
|
+
method: 'selector' | 'role' | 'text' | 'label' | 'placeholder' | 'alternate' | 'composite';
|
|
20
|
+
}
|
|
21
|
+
export interface ResolveOptions {
|
|
22
|
+
/** Primary CSS selector */
|
|
23
|
+
selector?: string;
|
|
24
|
+
/** Semantic target description */
|
|
25
|
+
target?: SemanticTarget;
|
|
26
|
+
/** Fallback selectors */
|
|
27
|
+
selectorAlternates?: string[];
|
|
28
|
+
/** Timeout for visibility check (ms). Default: 3000 */
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolves an element on the page using the best available method.
|
|
33
|
+
* Returns the first visible locator found, or null if nothing matches.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveTarget(page: Page, options: ResolveOptions): Promise<ResolvedTarget | null>;
|