autokap 1.0.6 → 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/chrome/ios-statusbar-comparison-reference.jpg +0 -0
- package/assets/chrome/ios-statusbar-dark-reference.jpg +0 -0
- package/assets/chrome/ios-statusbar-light-reference.jpg +0 -0
- package/assets/cursors/macos.svg +4 -0
- package/assets/cursors/windows.svg +15 -0
- package/assets/devices/ipad-pro-11-m4.json +52 -0
- package/assets/devices/iphone-16-pro.json +53 -0
- package/assets/devices/macbook-air-13.json +45 -0
- package/assets/frames/MacBook Air 13.svg +242 -0
- package/assets/frames/Status bar - iPhone.png +0 -0
- Menu bar- iPad.png +0 -0
- package/assets/frames/iPad Pro M4 11_.png +0 -0
- package/assets/frames/iPhone 16 Pro.png +0 -0
- package/assets/icons/Cellular Connection.svg +3 -0
- package/assets/icons/Union.svg +6 -0
- package/assets/icons/Wifi.svg +3 -0
- package/assets/icons/battery.svg +5 -0
- package/assets/icons/battery_charging.svg +8 -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/abort.d.ts +5 -0
- package/dist/abort.js +44 -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 +226 -0
- package/dist/agent.js +6666 -0
- 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/billing-operation-logging.d.ts +38 -0
- package/dist/billing-operation-logging.js +248 -0
- package/dist/browser-bar.d.ts +48 -0
- package/dist/browser-bar.js +284 -0
- 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 +76 -1
- package/dist/browser.js +1657 -39
- package/dist/capture-alt-text.d.ts +12 -0
- package/dist/capture-alt-text.js +52 -0
- package/dist/capture-encryption.d.ts +10 -0
- package/dist/capture-encryption.js +41 -0
- package/dist/capture-language-preflight.d.ts +41 -0
- package/dist/capture-language-preflight.js +300 -0
- package/dist/capture-llm-page-identity.d.ts +15 -0
- package/dist/capture-llm-page-identity.js +128 -0
- package/dist/capture-model-resolution.d.ts +9 -0
- package/dist/capture-model-resolution.js +21 -0
- package/dist/capture-page-identity.d.ts +7 -0
- package/dist/capture-page-identity.js +352 -0
- package/dist/capture-preset-credentials.d.ts +62 -0
- package/dist/capture-preset-credentials.js +184 -0
- package/dist/capture-request-plan.d.ts +58 -0
- package/dist/capture-request-plan.js +264 -0
- package/dist/capture-run-optimizer.d.ts +139 -0
- package/dist/capture-run-optimizer.js +863 -0
- package/dist/capture-selector-memory.d.ts +31 -0
- package/dist/capture-selector-memory.js +345 -0
- package/dist/capture-session-profile-encryption.d.ts +2 -0
- package/dist/capture-session-profile-encryption.js +22 -0
- package/dist/capture-step-timeout.d.ts +10 -0
- package/dist/capture-step-timeout.js +30 -0
- package/dist/capture-strategy.d.ts +36 -0
- package/dist/capture-strategy.js +95 -0
- package/dist/capture-studio-sync.d.ts +23 -0
- package/dist/capture-studio-sync.js +172 -0
- 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 +56 -0
- package/dist/capture-variant-state.js +182 -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 -252
- package/dist/clip-orchestrator.d.ts +148 -0
- package/dist/clip-orchestrator.js +957 -0
- package/dist/clip-postprocess.d.ts +42 -0
- package/dist/clip-postprocess.js +201 -0
- package/dist/cookie-dismiss.d.ts +2 -0
- package/dist/cookie-dismiss.js +48 -13
- package/dist/cost-logging.d.ts +35 -0
- package/dist/cost-logging.js +242 -0
- package/dist/cost-resolution-monitor.d.ts +16 -0
- package/dist/cost-resolution-monitor.js +34 -0
- package/dist/credential-templates.d.ts +5 -0
- package/dist/credential-templates.js +60 -0
- 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 +13 -0
- package/dist/element-capture.js +522 -0
- 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.d.ts +138 -0
- package/dist/hybrid-navigator.js +468 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +17 -0
- 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/llm-usage.d.ts +17 -0
- package/dist/llm-usage.js +45 -0
- package/dist/logger.d.ts +6 -2
- package/dist/logger.js +15 -1
- package/dist/mockup-html.d.ts +119 -0
- package/dist/mockup-html.js +263 -0
- package/dist/mockup.d.ts +187 -0
- package/dist/mockup.js +869 -0
- package/dist/mouse-animation.d.ts +46 -0
- package/dist/mouse-animation.js +114 -0
- 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/overlay-utils.d.ts +14 -0
- package/dist/overlay-utils.js +13 -0
- package/dist/postcondition.d.ts +16 -0
- package/dist/postcondition.js +269 -0
- package/dist/posthog.d.ts +4 -0
- package/dist/posthog.js +26 -0
- package/dist/program-patcher.d.ts +25 -0
- package/dist/program-patcher.js +44 -0
- package/dist/prompt-cache.d.ts +10 -0
- package/dist/prompt-cache.js +24 -0
- package/dist/prompts.d.ts +175 -0
- package/dist/prompts.js +1038 -0
- 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 +215 -0
- package/dist/remote-browser.js +360 -0
- 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 +21 -0
- package/dist/security.js +608 -0
- 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 +125 -0
- package/dist/server-capture-runtime.js +585 -0
- package/dist/server-credit-usage.d.ts +12 -0
- package/dist/server-credit-usage.js +41 -0
- package/dist/server-posthog.d.ts +2 -0
- package/dist/server-posthog.js +16 -0
- package/dist/server-project-webhooks.d.ts +59 -0
- package/dist/server-project-webhooks.js +123 -0
- package/dist/server-screenshot-watermark.d.ts +7 -0
- package/dist/server-screenshot-watermark.js +60 -0
- package/dist/session-profile.d.ts +86 -0
- package/dist/session-profile.js +1536 -0
- package/dist/sf-pro-fonts.d.ts +4 -0
- package/dist/sf-pro-fonts.js +7 -0
- 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-l10n.d.ts +14 -0
- package/dist/status-bar-l10n.js +177 -0
- package/dist/status-bar-render.d.ts +20 -0
- package/dist/status-bar-render.js +410 -0
- package/dist/status-bar.d.ts +53 -0
- package/dist/status-bar.js +620 -0
- 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.d.ts +4 -0
- package/dist/tools.js +216 -0
- 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.d.ts +143 -0
- package/dist/video-agent.js +4788 -0
- package/dist/video-observation.d.ts +36 -0
- package/dist/video-observation.js +192 -0
- package/dist/video-planner.d.ts +12 -0
- package/dist/video-planner.js +501 -0
- package/dist/video-prompts.d.ts +37 -0
- package/dist/video-prompts.js +554 -0
- package/dist/video-tools.d.ts +3 -0
- package/dist/video-tools.js +59 -0
- package/dist/video-variant-state.d.ts +29 -0
- package/dist/video-variant-state.js +80 -0
- package/dist/vision-model.d.ts +17 -0
- package/dist/vision-model.js +74 -0
- package/dist/web-playwright-local.d.ts +126 -0
- package/dist/web-playwright-local.js +819 -0
- package/dist/ws-auth.d.ts +20 -0
- package/dist/ws-auth.js +70 -0
- 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.d.ts +10 -0
- package/dist/ws-handler.js +1793 -0
- package/dist/ws-metrics-server.d.ts +9 -0
- package/dist/ws-metrics-server.js +31 -0
- package/dist/ws-server.d.ts +9 -0
- package/dist/ws-server.js +92 -0
- package/package.json +142 -71
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture Agent — WebPlaywrightLocal RuntimeAdapter
|
|
3
|
+
*
|
|
4
|
+
* Thin adapter delegating to the existing Browser class from src/browser.ts.
|
|
5
|
+
* This is the first (and for now only) RuntimeAdapter implementation.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import os from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { humanType, moveMouse } from '../mouse-animation.js';
|
|
11
|
+
import { resolveTarget } from './semantic-resolver.js';
|
|
12
|
+
export class WebPlaywrightLocal {
|
|
13
|
+
browser;
|
|
14
|
+
recordingDir;
|
|
15
|
+
sessionStartedAt = Date.now();
|
|
16
|
+
recording = null;
|
|
17
|
+
clipCursor = null;
|
|
18
|
+
constructor(browser, recordingDir) {
|
|
19
|
+
this.browser = browser;
|
|
20
|
+
this.recordingDir = recordingDir;
|
|
21
|
+
}
|
|
22
|
+
async navigate(url) {
|
|
23
|
+
await this.browser.navigateTo(url);
|
|
24
|
+
}
|
|
25
|
+
async getCurrentUrl() {
|
|
26
|
+
const page = await this.browser.currentPage;
|
|
27
|
+
return page.url();
|
|
28
|
+
}
|
|
29
|
+
async getAKTree() {
|
|
30
|
+
return this.browser.getAKTree();
|
|
31
|
+
}
|
|
32
|
+
async getPageSignals() {
|
|
33
|
+
return this.browser.capturePageSignals();
|
|
34
|
+
}
|
|
35
|
+
async click(selector, options) {
|
|
36
|
+
const page = await this.browser.currentPage;
|
|
37
|
+
if (options?.coordinates) {
|
|
38
|
+
await this.moveClipCursorToPoint(options.coordinates);
|
|
39
|
+
await this.browser.clickByCoordinates(options.coordinates.x, options.coordinates.y);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const locator = page.locator(selector).first();
|
|
43
|
+
await this.moveClipCursorToLocator(locator);
|
|
44
|
+
if (options?.useKeyboard) {
|
|
45
|
+
await locator.focus();
|
|
46
|
+
await page.keyboard.press('Enter');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (options?.useJsDispatch) {
|
|
50
|
+
await locator.dispatchEvent('click');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
await this.browser.clickBySelector(selector, { force: options?.force });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Click an element using semantic target resolution.
|
|
57
|
+
* Tries CSS selector first, falls back to Playwright semantic locators.
|
|
58
|
+
*/
|
|
59
|
+
async clickByTarget(opts) {
|
|
60
|
+
const page = await this.browser.currentPage;
|
|
61
|
+
const resolved = await resolveTarget(page, opts);
|
|
62
|
+
if (!resolved) {
|
|
63
|
+
throw new Error(`cannot find target: ${describeResolveOptions(opts)}`);
|
|
64
|
+
}
|
|
65
|
+
await this.moveClipCursorToLocator(resolved.locator);
|
|
66
|
+
await resolved.locator.click({ timeout: 5000 });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Type into an element using semantic target resolution.
|
|
70
|
+
*/
|
|
71
|
+
async typeByTarget(opts, text, clearFirst = true) {
|
|
72
|
+
const page = await this.browser.currentPage;
|
|
73
|
+
const resolved = await resolveTarget(page, opts);
|
|
74
|
+
if (!resolved) {
|
|
75
|
+
throw new Error(`cannot find target for typing: ${describeResolveOptions(opts)}`);
|
|
76
|
+
}
|
|
77
|
+
if (this.clipCursor) {
|
|
78
|
+
await this.typeIntoLocator(resolved.locator, text, clearFirst);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (clearFirst) {
|
|
82
|
+
await resolved.locator.fill(text);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
await resolved.locator.click();
|
|
86
|
+
await resolved.locator.pressSequentially(text);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Wait for an element using semantic target resolution.
|
|
90
|
+
*/
|
|
91
|
+
async waitForTarget(opts, timeoutMs = 10000) {
|
|
92
|
+
const page = await this.browser.currentPage;
|
|
93
|
+
const resolved = await resolveTarget(page, { ...opts, timeoutMs });
|
|
94
|
+
return resolved !== null;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Scroll an element into view using semantic target resolution.
|
|
98
|
+
*/
|
|
99
|
+
async scrollIntoViewByTarget(opts) {
|
|
100
|
+
const page = await this.browser.currentPage;
|
|
101
|
+
const resolved = await resolveTarget(page, opts);
|
|
102
|
+
if (!resolved) {
|
|
103
|
+
throw new Error(`cannot find target to scroll into view: ${describeResolveOptions(opts)}`);
|
|
104
|
+
}
|
|
105
|
+
if (this.clipCursor) {
|
|
106
|
+
await this.moveClipCursorToViewportCenter();
|
|
107
|
+
await resolved.locator.evaluate((node) => {
|
|
108
|
+
node.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
109
|
+
});
|
|
110
|
+
await page.waitForTimeout(350);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
await resolved.locator.scrollIntoViewIfNeeded({ timeout: 5000 });
|
|
114
|
+
}
|
|
115
|
+
async type(selector, text, clearFirst = true) {
|
|
116
|
+
if (this.clipCursor) {
|
|
117
|
+
const page = await this.browser.currentPage;
|
|
118
|
+
await this.typeIntoLocator(page.locator(selector).first(), text, clearFirst);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
await this.browser.typeText(text, { selector, clearFirst });
|
|
122
|
+
}
|
|
123
|
+
async pressKey(key) {
|
|
124
|
+
const page = await this.browser.currentPage;
|
|
125
|
+
if (this.clipCursor) {
|
|
126
|
+
await page.waitForTimeout(90);
|
|
127
|
+
await page.keyboard.press(key);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
await this.browser.pressKey(key);
|
|
131
|
+
}
|
|
132
|
+
async scroll(direction, amount) {
|
|
133
|
+
if (this.clipCursor) {
|
|
134
|
+
const page = await this.browser.currentPage;
|
|
135
|
+
await this.moveClipCursorToViewportCenter();
|
|
136
|
+
const dx = direction === 'right' ? (amount ?? 500) : direction === 'left' ? -(amount ?? 500) : 0;
|
|
137
|
+
const dy = direction === 'down' ? (amount ?? 500) : direction === 'up' ? -(amount ?? 500) : 0;
|
|
138
|
+
await page.evaluate(({ deltaX, deltaY }) => {
|
|
139
|
+
window.scrollBy({ left: deltaX, top: deltaY, behavior: 'smooth' });
|
|
140
|
+
}, { deltaX: dx, deltaY: dy });
|
|
141
|
+
await page.waitForTimeout(420);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
await this.browser.scroll(direction, amount);
|
|
145
|
+
}
|
|
146
|
+
async scrollIntoView(selector) {
|
|
147
|
+
const page = await this.browser.currentPage;
|
|
148
|
+
if (this.clipCursor) {
|
|
149
|
+
await this.moveClipCursorToViewportCenter();
|
|
150
|
+
await page.locator(selector).first().evaluate((node) => {
|
|
151
|
+
node.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
152
|
+
});
|
|
153
|
+
await page.waitForTimeout(350);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
await page.locator(selector).first().scrollIntoViewIfNeeded({ timeout: 5000 });
|
|
157
|
+
}
|
|
158
|
+
async waitFor(condition) {
|
|
159
|
+
try {
|
|
160
|
+
const page = await this.browser.currentPage;
|
|
161
|
+
const stateMap = { visible: 'visible', attached: 'attached' };
|
|
162
|
+
await page.locator(condition.selector).waitFor({
|
|
163
|
+
state: stateMap[condition.state],
|
|
164
|
+
timeout: condition.timeoutMs,
|
|
165
|
+
});
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async dismissOverlays() {
|
|
173
|
+
// Pass 1: Built-in cookie/widget dismissal (cookie-dismiss.ts)
|
|
174
|
+
const result = await this.browser.dismissOverlays();
|
|
175
|
+
if (result.dismissed)
|
|
176
|
+
return result;
|
|
177
|
+
// Pass 2: Playwright-level sweep for common accept/close buttons
|
|
178
|
+
// in cookie-like containers that the built-in module might miss
|
|
179
|
+
const page = await this.browser.currentPage;
|
|
180
|
+
const acceptPatterns = [
|
|
181
|
+
'button:has-text("Accept")',
|
|
182
|
+
'button:has-text("Accept all")',
|
|
183
|
+
'button:has-text("Accepter")',
|
|
184
|
+
'button:has-text("Tout accepter")',
|
|
185
|
+
'button:has-text("Got it")',
|
|
186
|
+
'button:has-text("I agree")',
|
|
187
|
+
'button:has-text("OK")',
|
|
188
|
+
'[role="button"]:has-text("Accept")',
|
|
189
|
+
'[role="button"]:has-text("Accept all")',
|
|
190
|
+
];
|
|
191
|
+
for (const pattern of acceptPatterns) {
|
|
192
|
+
try {
|
|
193
|
+
const btn = page.locator(pattern).first();
|
|
194
|
+
if (await btn.isVisible({ timeout: 500 })) {
|
|
195
|
+
// Check if the button is near the bottom of the viewport (likely a banner)
|
|
196
|
+
const box = await btn.boundingBox();
|
|
197
|
+
const viewport = page.viewportSize();
|
|
198
|
+
if (box && viewport && box.y > viewport.height * 0.6) {
|
|
199
|
+
await btn.click({ timeout: 2000 });
|
|
200
|
+
await page.waitForTimeout(500);
|
|
201
|
+
return { dismissed: true, method: `v2-sweep:${pattern}` };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
// Try next pattern
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Pass 3: Try Escape key for modal overlays
|
|
210
|
+
try {
|
|
211
|
+
await page.keyboard.press('Escape');
|
|
212
|
+
await page.waitForTimeout(300);
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
// Non-fatal
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
async takeScreenshot() {
|
|
220
|
+
return this.browser.takeScreenshot();
|
|
221
|
+
}
|
|
222
|
+
async takeElementScreenshot(selector) {
|
|
223
|
+
const { buffer } = await this.browser.screenshotBySelector(selector);
|
|
224
|
+
return buffer;
|
|
225
|
+
}
|
|
226
|
+
async takeCleanScreenshot() {
|
|
227
|
+
return this.browser.takeScreenshot();
|
|
228
|
+
}
|
|
229
|
+
async beginRecording(options) {
|
|
230
|
+
const page = await this.browser.currentPage;
|
|
231
|
+
if (!page.video()) {
|
|
232
|
+
throw new Error(`recording is not enabled for ${options.mediaMode} mode`);
|
|
233
|
+
}
|
|
234
|
+
const recordingDir = this.recordingDir
|
|
235
|
+
?? await fs.mkdtemp(path.join(os.tmpdir(), 'autokap-v2-recording-'));
|
|
236
|
+
this.recording = {
|
|
237
|
+
mediaMode: options.mediaMode,
|
|
238
|
+
startedAt: Date.now(),
|
|
239
|
+
trimStartMs: Math.max(0, Date.now() - this.sessionStartedAt),
|
|
240
|
+
outputPath: path.join(recordingDir, `${options.mediaMode}.webm`),
|
|
241
|
+
finalized: false,
|
|
242
|
+
};
|
|
243
|
+
this.clipCursor = { currentPosition: null };
|
|
244
|
+
await this.seedClipCursor();
|
|
245
|
+
}
|
|
246
|
+
async endRecording() {
|
|
247
|
+
if (!this.recording) {
|
|
248
|
+
throw new Error('recording was not started');
|
|
249
|
+
}
|
|
250
|
+
if (this.recording.finalized) {
|
|
251
|
+
const buffer = await fs.readFile(this.recording.outputPath);
|
|
252
|
+
return {
|
|
253
|
+
buffer,
|
|
254
|
+
durationMs: Date.now() - this.recording.startedAt,
|
|
255
|
+
mimeType: 'video/webm',
|
|
256
|
+
trimStartMs: this.recording.trimStartMs,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
const videoRef = this.browser.currentPage.video();
|
|
260
|
+
if (!videoRef) {
|
|
261
|
+
throw new Error('recording finalization failed: no Playwright video handle found');
|
|
262
|
+
}
|
|
263
|
+
await this.browser.closeContext();
|
|
264
|
+
await videoRef.saveAs(this.recording.outputPath);
|
|
265
|
+
this.recording.finalized = true;
|
|
266
|
+
this.clipCursor = null;
|
|
267
|
+
const buffer = await fs.readFile(this.recording.outputPath);
|
|
268
|
+
return {
|
|
269
|
+
buffer,
|
|
270
|
+
durationMs: Date.now() - this.recording.startedAt,
|
|
271
|
+
mimeType: 'video/webm',
|
|
272
|
+
trimStartMs: this.recording.trimStartMs,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
async setLocale(locale) {
|
|
276
|
+
await this.browser.setLanguage(locale);
|
|
277
|
+
}
|
|
278
|
+
async setColorScheme(scheme) {
|
|
279
|
+
await this.browser.setColorScheme(scheme);
|
|
280
|
+
}
|
|
281
|
+
async reloadPage() {
|
|
282
|
+
await this.browser.reloadCurrentPage();
|
|
283
|
+
}
|
|
284
|
+
async writeStorageHint(params) {
|
|
285
|
+
return this.browser.writeStorageHintCandidate({
|
|
286
|
+
storageName: params.storage,
|
|
287
|
+
key: params.key,
|
|
288
|
+
candidate: params.value,
|
|
289
|
+
kind: params.kind,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
async close() {
|
|
293
|
+
await this.browser.close();
|
|
294
|
+
}
|
|
295
|
+
async typeIntoLocator(locator, text, clearFirst) {
|
|
296
|
+
const page = await this.browser.currentPage;
|
|
297
|
+
await locator.waitFor({ state: 'visible', timeout: 5000 });
|
|
298
|
+
await locator.scrollIntoViewIfNeeded({ timeout: 5000 }).catch(() => undefined);
|
|
299
|
+
await this.moveClipCursorToLocator(locator);
|
|
300
|
+
await locator.click({ timeout: 5000 });
|
|
301
|
+
if (clearFirst) {
|
|
302
|
+
await page.keyboard.press('Control+A');
|
|
303
|
+
}
|
|
304
|
+
await page.waitForTimeout(70);
|
|
305
|
+
await humanType(page, text);
|
|
306
|
+
}
|
|
307
|
+
async seedClipCursor() {
|
|
308
|
+
if (!this.clipCursor)
|
|
309
|
+
return;
|
|
310
|
+
const page = await this.browser.currentPage;
|
|
311
|
+
const viewport = page.viewportSize();
|
|
312
|
+
if (!viewport)
|
|
313
|
+
return;
|
|
314
|
+
const startX = Math.round(viewport.width * (0.3 + Math.random() * 0.4));
|
|
315
|
+
const startY = Math.round(viewport.height * (0.3 + Math.random() * 0.4));
|
|
316
|
+
await page.mouse.move(startX, startY);
|
|
317
|
+
this.clipCursor.currentPosition = { x: startX, y: startY };
|
|
318
|
+
await page.waitForTimeout(60);
|
|
319
|
+
}
|
|
320
|
+
async moveClipCursorToViewportCenter() {
|
|
321
|
+
if (!this.clipCursor)
|
|
322
|
+
return;
|
|
323
|
+
const page = await this.browser.currentPage;
|
|
324
|
+
const viewport = page.viewportSize();
|
|
325
|
+
if (!viewport)
|
|
326
|
+
return;
|
|
327
|
+
await this.moveClipCursorToPoint({
|
|
328
|
+
x: Math.round(viewport.width / 2),
|
|
329
|
+
y: Math.round(viewport.height / 2),
|
|
330
|
+
}, { durationMs: 280, steps: 18 });
|
|
331
|
+
}
|
|
332
|
+
async moveClipCursorToLocator(locator) {
|
|
333
|
+
if (!this.clipCursor)
|
|
334
|
+
return;
|
|
335
|
+
await locator.waitFor({ state: 'visible', timeout: 5000 });
|
|
336
|
+
await locator.scrollIntoViewIfNeeded({ timeout: 5000 }).catch(() => undefined);
|
|
337
|
+
const page = await this.browser.currentPage;
|
|
338
|
+
const viewport = page.viewportSize();
|
|
339
|
+
const box = await locator.boundingBox();
|
|
340
|
+
if (!box || !viewport)
|
|
341
|
+
return;
|
|
342
|
+
await this.moveClipCursorToPoint(getHumanPointInBox(box, viewport));
|
|
343
|
+
}
|
|
344
|
+
async moveClipCursorToPoint(point, options) {
|
|
345
|
+
if (!this.clipCursor)
|
|
346
|
+
return;
|
|
347
|
+
const page = await this.browser.currentPage;
|
|
348
|
+
const from = this.clipCursor.currentPosition;
|
|
349
|
+
if (from) {
|
|
350
|
+
await moveMouse(page, from, point, options);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
await page.mouse.move(point.x, point.y);
|
|
354
|
+
}
|
|
355
|
+
this.clipCursor.currentPosition = point;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function describeResolveOptions(opts) {
|
|
359
|
+
const parts = [];
|
|
360
|
+
if (opts.selector)
|
|
361
|
+
parts.push(`selector="${opts.selector}"`);
|
|
362
|
+
if (opts.target?.text)
|
|
363
|
+
parts.push(`text="${opts.target.text}"`);
|
|
364
|
+
if (opts.target?.role)
|
|
365
|
+
parts.push(`role="${opts.target.role}"`);
|
|
366
|
+
if (opts.target?.label)
|
|
367
|
+
parts.push(`label="${opts.target.label}"`);
|
|
368
|
+
if (opts.target?.placeholder)
|
|
369
|
+
parts.push(`placeholder="${opts.target.placeholder}"`);
|
|
370
|
+
return parts.join(', ') || 'no target specified';
|
|
371
|
+
}
|
|
372
|
+
function getHumanPointInBox(box, viewport) {
|
|
373
|
+
const insetX = Math.min(Math.max(box.width * 0.2, 6), Math.max(6, box.width / 2));
|
|
374
|
+
const insetY = Math.min(Math.max(box.height * 0.2, 6), Math.max(6, box.height / 2));
|
|
375
|
+
const minX = box.x + insetX;
|
|
376
|
+
const maxX = box.x + Math.max(insetX, box.width - insetX);
|
|
377
|
+
const minY = box.y + insetY;
|
|
378
|
+
const maxY = box.y + Math.max(insetY, box.height - insetY);
|
|
379
|
+
const targetX = maxX <= minX ? box.x + box.width / 2 : randomBetween(minX, maxX);
|
|
380
|
+
const targetY = maxY <= minY ? box.y + box.height / 2 : randomBetween(minY, maxY);
|
|
381
|
+
return {
|
|
382
|
+
x: clampPoint(targetX, 4, viewport.width - 4),
|
|
383
|
+
y: clampPoint(targetY, 4, viewport.height - 4),
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function randomBetween(min, max) {
|
|
387
|
+
return min + Math.random() * Math.max(0, max - min);
|
|
388
|
+
}
|
|
389
|
+
function clampPoint(value, min, max) {
|
|
390
|
+
return Math.round(Math.max(min, Math.min(max, value)));
|
|
391
|
+
}
|
|
392
|
+
//# sourceMappingURL=web-playwright-local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const APP_VERSION: string;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Browser } from './browser.js';
|
|
2
|
+
import type { VideoAgentConfig, VideoAgentResult, VideoPhase, InteractiveElement, VideoStep, VideoPlan, StepUsage, VideoStepAttemptTrace, VideoStepArtifact, VideoSelectorMemoryUpdate, VideoPageSignals, VideoObservationSnapshot, BrowserSessionStorageState, BrowserStorageState } from './types.js';
|
|
3
|
+
export type VideoLogCallback = (entry: {
|
|
4
|
+
level: 'info' | 'success' | 'error' | 'ai';
|
|
5
|
+
message: string;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
}) => void;
|
|
8
|
+
export type VideoPhaseCallback = (phase: VideoPhase) => void;
|
|
9
|
+
export type VideoStepCallback = (stepIndex: number, total: number, description: string, phase: 'dry_run' | 'recording') => void;
|
|
10
|
+
export type VideoStepResultCallback = (stepIndex: number, ok: boolean, reason?: string) => void;
|
|
11
|
+
export type VideoVariantPhase = 'preflight' | 'planning' | 'dry_run' | 'recording' | 'done' | 'failed';
|
|
12
|
+
export interface VideoPreflightResult {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
reason?: string;
|
|
15
|
+
code?: string;
|
|
16
|
+
detectedLang?: string | null;
|
|
17
|
+
detectedTheme?: 'light' | 'dark' | null;
|
|
18
|
+
finalUrl?: string;
|
|
19
|
+
storageState?: BrowserStorageState;
|
|
20
|
+
sessionStorage?: BrowserSessionStorageState;
|
|
21
|
+
pageSignals?: VideoPageSignals;
|
|
22
|
+
observationSummary?: string;
|
|
23
|
+
observationSnapshot?: VideoObservationSnapshot;
|
|
24
|
+
usage?: StepUsage[];
|
|
25
|
+
}
|
|
26
|
+
export type VideoPreflightCallback = (result: VideoPreflightResult) => void;
|
|
27
|
+
export type VideoVariantPhaseCallback = (phase: VideoVariantPhase) => void;
|
|
28
|
+
export type VideoStepAttemptCallback = (attempt: VideoStepAttemptTrace) => void;
|
|
29
|
+
export type VideoStepArtifactCallback = (artifact: VideoStepArtifact) => void;
|
|
30
|
+
export interface VideoRunCallbacks {
|
|
31
|
+
onLog?: VideoLogCallback;
|
|
32
|
+
onPhaseChange?: VideoPhaseCallback;
|
|
33
|
+
onVariantPhase?: VideoVariantPhaseCallback;
|
|
34
|
+
onStep?: VideoStepCallback;
|
|
35
|
+
onStepResult?: VideoStepResultCallback;
|
|
36
|
+
onStepAttempt?: VideoStepAttemptCallback;
|
|
37
|
+
onStepArtifact?: VideoStepArtifactCallback;
|
|
38
|
+
onPreflightResult?: VideoPreflightCallback;
|
|
39
|
+
/** Emit a live Playwright screenshot (base64 JPEG) for real-time preview in the UI. */
|
|
40
|
+
onScreenshot?: (base64: string) => void;
|
|
41
|
+
}
|
|
42
|
+
type VideoDryRunFailureSubphase = 'prepared_variant' | 'deterministic_exec' | 'verification_snapshot' | 'verification_llm' | 'repair_lane' | 'llm_fixer' | 'checkpoint_restore' | 'budget';
|
|
43
|
+
export interface VideoDryRunFailure {
|
|
44
|
+
stepIndex: number;
|
|
45
|
+
subphase: VideoDryRunFailureSubphase;
|
|
46
|
+
reason: string;
|
|
47
|
+
resolvedTargetSummary?: string;
|
|
48
|
+
}
|
|
49
|
+
interface VideoStepCheckpoint {
|
|
50
|
+
url: string;
|
|
51
|
+
scrollX: number;
|
|
52
|
+
scrollY: number;
|
|
53
|
+
}
|
|
54
|
+
interface ViewportRectSnapshot {
|
|
55
|
+
top: number;
|
|
56
|
+
bottom: number;
|
|
57
|
+
left: number;
|
|
58
|
+
right: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
}
|
|
62
|
+
export declare function restoreVideoStepCheckpoint(browser: Browser, checkpoint: VideoStepCheckpoint): Promise<void>;
|
|
63
|
+
export declare function isRectMeaningfullyVisibleInViewport(params: {
|
|
64
|
+
rect: ViewportRectSnapshot;
|
|
65
|
+
viewportWidth: number;
|
|
66
|
+
viewportHeight: number;
|
|
67
|
+
topInset?: number;
|
|
68
|
+
bottomInset?: number;
|
|
69
|
+
}): boolean;
|
|
70
|
+
export declare function sanitizeVariantPrefixSteps(steps: VideoStep[], requestedLang?: string, requestedTheme?: 'light' | 'dark'): VideoStep[];
|
|
71
|
+
export declare function evaluateVideoStepSafety(step: VideoStep, config: VideoAgentConfig, page: import('playwright').Page, currentUrl: string, interactiveElements: InteractiveElement[]): Promise<{
|
|
72
|
+
allowed: boolean;
|
|
73
|
+
reason?: string;
|
|
74
|
+
}>;
|
|
75
|
+
export declare function extractNamedScrollTarget(description?: string): string | null;
|
|
76
|
+
export declare function inspectVideoTarget(page: import('playwright').Page, selector?: string, coordinates?: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
}): Promise<InteractiveElement | null>;
|
|
80
|
+
interface VerifyStepResult {
|
|
81
|
+
ok: boolean;
|
|
82
|
+
reason?: string;
|
|
83
|
+
suggestion?: string;
|
|
84
|
+
giveUp?: boolean;
|
|
85
|
+
usage: Partial<StepUsage>;
|
|
86
|
+
}
|
|
87
|
+
export declare function verifyVideoStepDeterministically(browser: Browser, step: VideoStep): Promise<VerifyStepResult | null>;
|
|
88
|
+
export declare function runVariantPreflight(config: VideoAgentConfig, prefixPlan: VideoPlan | null, callbacks?: VideoRunCallbacks): Promise<VideoPreflightResult>;
|
|
89
|
+
export declare function composeHybridPlan(basePlan: VideoPlan, variantPrefixPlan: VideoPlan | null): VideoPlan;
|
|
90
|
+
export declare function createBasePlan(config: VideoAgentConfig): Promise<{
|
|
91
|
+
plan: VideoPlan;
|
|
92
|
+
usage: StepUsage;
|
|
93
|
+
}>;
|
|
94
|
+
export declare function createVariantPrefixPlan(config: VideoAgentConfig): Promise<{
|
|
95
|
+
plan: VideoPlan;
|
|
96
|
+
usage: StepUsage;
|
|
97
|
+
}>;
|
|
98
|
+
export declare function verifyAndPatchPlan(plan: VideoPlan, config: VideoAgentConfig, callbacks?: VideoRunCallbacks): Promise<{
|
|
99
|
+
success: true;
|
|
100
|
+
plan: VideoPlan;
|
|
101
|
+
usage: StepUsage[];
|
|
102
|
+
memoryUpdates: VideoSelectorMemoryUpdate[];
|
|
103
|
+
} | {
|
|
104
|
+
success: false;
|
|
105
|
+
error: string;
|
|
106
|
+
usage: StepUsage[];
|
|
107
|
+
memoryUpdates: VideoSelectorMemoryUpdate[];
|
|
108
|
+
failedStepIndex?: number;
|
|
109
|
+
failedSubphase?: VideoDryRunFailureSubphase;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Backward-compatible helper: full planning + verify in one call.
|
|
113
|
+
*/
|
|
114
|
+
export declare function planAndVerify(config: VideoAgentConfig, callbacks?: VideoRunCallbacks): Promise<{
|
|
115
|
+
success: true;
|
|
116
|
+
plan: VideoPlan;
|
|
117
|
+
usage: StepUsage[];
|
|
118
|
+
memoryUpdates: VideoSelectorMemoryUpdate[];
|
|
119
|
+
} | {
|
|
120
|
+
success: false;
|
|
121
|
+
error: string;
|
|
122
|
+
usage: StepUsage[];
|
|
123
|
+
memoryUpdates: VideoSelectorMemoryUpdate[];
|
|
124
|
+
}>;
|
|
125
|
+
/**
|
|
126
|
+
* Run phase 3 (recording only) using a pre-verified plan.
|
|
127
|
+
* Call after `planAndVerify()` to record across multiple lang/theme combinations.
|
|
128
|
+
*/
|
|
129
|
+
export declare function recordPlan(plan: VideoPlan, config: VideoAgentConfig, callbacks?: VideoRunCallbacks): Promise<{
|
|
130
|
+
videoPath: string | null;
|
|
131
|
+
durationMs: number;
|
|
132
|
+
stepsExecuted: number;
|
|
133
|
+
setupDurationSec: number;
|
|
134
|
+
usage: StepUsage[];
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* Run the full 3-phase video capture pipeline:
|
|
138
|
+
* 1. Planning: script → structured plan (LLM)
|
|
139
|
+
* 2. Dry-run: verify all steps work
|
|
140
|
+
* 3. Recording: execute with Bezier mouse + cursor overlay
|
|
141
|
+
*/
|
|
142
|
+
export declare function runVideoAgent(config: VideoAgentConfig, callbacks?: VideoRunCallbacks): Promise<VideoAgentResult>;
|
|
143
|
+
export {};
|