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,10 @@
|
|
|
1
|
+
export type PromptCacheStrategy = 'implicit_only' | 'explicit_breakpoints' | 'disabled';
|
|
2
|
+
export interface ProviderRoutingPreference {
|
|
3
|
+
order?: string[];
|
|
4
|
+
require?: string[];
|
|
5
|
+
disallow?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function resolvePromptCacheStrategy(model: string, options?: {
|
|
8
|
+
enableGeminiExplicitBreakpoints?: boolean;
|
|
9
|
+
}): PromptCacheStrategy;
|
|
10
|
+
export declare function hasManualMultiProviderOrder(prefs?: ProviderRoutingPreference | null): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function resolvePromptCacheStrategy(model, options = {}) {
|
|
2
|
+
const normalized = model.trim().toLowerCase();
|
|
3
|
+
if (!normalized)
|
|
4
|
+
return 'disabled';
|
|
5
|
+
if (normalized.startsWith('anthropic/'))
|
|
6
|
+
return 'explicit_breakpoints';
|
|
7
|
+
if (normalized.startsWith('google/') || normalized.includes('gemini')) {
|
|
8
|
+
return options.enableGeminiExplicitBreakpoints ? 'explicit_breakpoints' : 'implicit_only';
|
|
9
|
+
}
|
|
10
|
+
if (normalized.startsWith('x-ai/')
|
|
11
|
+
|| normalized.includes('grok')
|
|
12
|
+
|| normalized.startsWith('openai/')
|
|
13
|
+
|| normalized.startsWith('deepseek/')
|
|
14
|
+
|| normalized.startsWith('moonshot/')
|
|
15
|
+
|| normalized.startsWith('moonshotai/')) {
|
|
16
|
+
return 'implicit_only';
|
|
17
|
+
}
|
|
18
|
+
return 'disabled';
|
|
19
|
+
}
|
|
20
|
+
export function hasManualMultiProviderOrder(prefs) {
|
|
21
|
+
const providers = prefs?.order?.map((provider) => provider.trim()).filter(Boolean) ?? [];
|
|
22
|
+
return providers.length > 1;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=prompt-cache.js.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { ChatCompletionContentPart } from 'openai/resources/chat/completions';
|
|
2
|
+
import type { AgentConfig, AgentRunHint, CaptureCursor, CaptureObjective, CaptureHandoffContext, ExecutedAction, InteractiveElement, LoginCredentials, OverlayScopeSummary, RepairTicket, VariantCaptureManifest, ValidatedSessionProfile, WorkflowScreenshot } from './types.js';
|
|
3
|
+
interface SystemPromptOptions {
|
|
4
|
+
reasoningLocale?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildSystemPrompt(opts?: SystemPromptOptions): string;
|
|
7
|
+
interface IterationPromptMetrics {
|
|
8
|
+
elementsChars: number;
|
|
9
|
+
sessionSummaryChars: number;
|
|
10
|
+
selectorMemoryChars: number;
|
|
11
|
+
agentContextChars: number;
|
|
12
|
+
}
|
|
13
|
+
export interface StableAnchorUserMessageParams {
|
|
14
|
+
userPrompt: string;
|
|
15
|
+
credentials?: LoginCredentials;
|
|
16
|
+
currentLang?: string;
|
|
17
|
+
currentTheme?: 'light' | 'dark';
|
|
18
|
+
langInstructions?: string;
|
|
19
|
+
themeInstructions?: string;
|
|
20
|
+
viewports?: Array<{
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}>;
|
|
24
|
+
runHints?: AgentRunHint[];
|
|
25
|
+
selectorMemory?: Record<string, string[]>;
|
|
26
|
+
sessionProfile?: ValidatedSessionProfile;
|
|
27
|
+
handoffContext?: CaptureHandoffContext;
|
|
28
|
+
variantManifest?: VariantCaptureManifest;
|
|
29
|
+
}
|
|
30
|
+
export interface IterationUserMessageParams {
|
|
31
|
+
userPrompt: string;
|
|
32
|
+
serializedAKTree: string;
|
|
33
|
+
cleanScreenshotUrl?: string;
|
|
34
|
+
screenshotUrl: string;
|
|
35
|
+
/** In dual-model mode, the vision model's text observation replaces images. */
|
|
36
|
+
visionObservation?: string;
|
|
37
|
+
/** Simplified DOM structure — primary page context in DOM-first mode. */
|
|
38
|
+
simplifiedDOM?: string;
|
|
39
|
+
/** When true, the DOM has not changed since the previous iteration (fingerprint match).
|
|
40
|
+
* The prompt emits a compact placeholder instead of the full DOM. */
|
|
41
|
+
domUnchanged?: boolean;
|
|
42
|
+
accessibilityTree: string;
|
|
43
|
+
interactiveElements: InteractiveElement[];
|
|
44
|
+
actionHistory?: ExecutedAction[];
|
|
45
|
+
screenshotsTaken: WorkflowScreenshot[];
|
|
46
|
+
iteration: number;
|
|
47
|
+
maxIterations: number;
|
|
48
|
+
credentials?: LoginCredentials;
|
|
49
|
+
currentLang?: string;
|
|
50
|
+
currentTheme?: 'light' | 'dark';
|
|
51
|
+
langInstructions?: string;
|
|
52
|
+
themeInstructions?: string;
|
|
53
|
+
viewports?: Array<{
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
}>;
|
|
57
|
+
runHints?: AgentRunHint[];
|
|
58
|
+
selectorMemory?: Record<string, string[]>;
|
|
59
|
+
sessionProfile?: ValidatedSessionProfile;
|
|
60
|
+
hasCredentials?: boolean;
|
|
61
|
+
salienceCompressionEnabled?: boolean;
|
|
62
|
+
viewport?: {
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
66
|
+
currentUrl?: string;
|
|
67
|
+
stuckLoopWarning?: string;
|
|
68
|
+
lastVerificationFailure?: string;
|
|
69
|
+
userGuidance?: string[];
|
|
70
|
+
scrollInfo?: {
|
|
71
|
+
scrollY: number;
|
|
72
|
+
scrollHeight: number;
|
|
73
|
+
viewportHeight: number;
|
|
74
|
+
};
|
|
75
|
+
expansionLevel?: number;
|
|
76
|
+
/** When true, includes the full task context (prompt, session, memory, instructions).
|
|
77
|
+
* When false (subsequent iterations), sends only the compact page observation. */
|
|
78
|
+
isFirstIteration?: boolean;
|
|
79
|
+
/** Pre-generated action plan from the planning call. Included in first iteration and on stuck loops. */
|
|
80
|
+
taskPlan?: string;
|
|
81
|
+
/** Persistent notes stored by the agent via the `note` tool. Re-injected every iteration. */
|
|
82
|
+
agentNotes?: string[];
|
|
83
|
+
/** Current active subgoal name (set by `begin_subgoal` tool). */
|
|
84
|
+
currentSubgoal?: string;
|
|
85
|
+
/** Completed subgoals with compressed summaries (HiAgent hierarchical memory). */
|
|
86
|
+
completedSubgoals?: Array<{
|
|
87
|
+
name: string;
|
|
88
|
+
summary: string;
|
|
89
|
+
}>;
|
|
90
|
+
/** Compact deterministic log of all actions taken so far (survives conversation trimming). */
|
|
91
|
+
trajectoryLog?: string;
|
|
92
|
+
/** Live browser state handed off from the previous capture in the same run. */
|
|
93
|
+
handoffContext?: CaptureHandoffContext;
|
|
94
|
+
/** Explicit multi-page manifest for the current variant/page. */
|
|
95
|
+
variantManifest?: VariantCaptureManifest;
|
|
96
|
+
currentObjective?: CaptureObjective;
|
|
97
|
+
captureCursor?: CaptureCursor;
|
|
98
|
+
activeRepairTicket?: RepairTicket | null;
|
|
99
|
+
remainingCaptureQueue?: string[];
|
|
100
|
+
cacheLayoutV2?: boolean;
|
|
101
|
+
/** Reference from variant 1 — what state was achieved for this page in the first variant. */
|
|
102
|
+
variantReference?: {
|
|
103
|
+
finalUrl: string;
|
|
104
|
+
assessment: string;
|
|
105
|
+
pageTitle: string;
|
|
106
|
+
/** Full action sequence from variant 1 — helps the LLM retrace the path. */
|
|
107
|
+
actions?: ExecutedAction[];
|
|
108
|
+
};
|
|
109
|
+
/** Compact summary of recent failed actions — prevents the agent from repeating dead-end strategies. */
|
|
110
|
+
failedAttemptsSummary?: string;
|
|
111
|
+
/** When true, the browser is already on the target URL — the agent should check and capture, not navigate. */
|
|
112
|
+
alreadyOnTarget?: boolean;
|
|
113
|
+
promptFingerprint?: string;
|
|
114
|
+
overlayScope?: OverlayScopeSummary | null;
|
|
115
|
+
}
|
|
116
|
+
export declare function buildStableAnchorUserMessage(params: StableAnchorUserMessageParams): {
|
|
117
|
+
content: ChatCompletionContentPart[];
|
|
118
|
+
metrics: IterationPromptMetrics;
|
|
119
|
+
};
|
|
120
|
+
export declare function buildIterationUserMessage(params: IterationUserMessageParams): {
|
|
121
|
+
content: ChatCompletionContentPart[];
|
|
122
|
+
metrics: IterationPromptMetrics;
|
|
123
|
+
};
|
|
124
|
+
export declare function buildVerificationMessage(params: {
|
|
125
|
+
userPrompt: string;
|
|
126
|
+
screenshotUrl: string;
|
|
127
|
+
previousAssessment: string;
|
|
128
|
+
runMode?: AgentConfig['runMode'];
|
|
129
|
+
currentLang?: string;
|
|
130
|
+
currentTheme?: 'light' | 'dark';
|
|
131
|
+
pageContext?: {
|
|
132
|
+
currentUrl?: string;
|
|
133
|
+
pageTitle?: string;
|
|
134
|
+
};
|
|
135
|
+
runHints?: AgentRunHint[];
|
|
136
|
+
variantManifest?: VariantCaptureManifest;
|
|
137
|
+
verificationDiagnostics?: {
|
|
138
|
+
lang?: string;
|
|
139
|
+
theme?: string;
|
|
140
|
+
};
|
|
141
|
+
identityHints?: string[];
|
|
142
|
+
}): ChatCompletionContentPart[];
|
|
143
|
+
export declare function buildVisionObserverPrompt(params: {
|
|
144
|
+
screenshotUrl: string;
|
|
145
|
+
currentUrl: string;
|
|
146
|
+
interactiveElements: InteractiveElement[];
|
|
147
|
+
userGoal: string;
|
|
148
|
+
question?: string;
|
|
149
|
+
currentLang?: string;
|
|
150
|
+
currentTheme?: 'light' | 'dark';
|
|
151
|
+
currentPageId?: string;
|
|
152
|
+
pageIdentitySummary?: string;
|
|
153
|
+
currentObjective?: string;
|
|
154
|
+
}): ChatCompletionContentPart[];
|
|
155
|
+
export declare function buildElementSystemPrompt(description: string): string;
|
|
156
|
+
export declare function buildElementIterationMessage(params: {
|
|
157
|
+
elementName: string;
|
|
158
|
+
elementDescription: string;
|
|
159
|
+
serializedAKTree: string;
|
|
160
|
+
currentUrl: string;
|
|
161
|
+
iteration: number;
|
|
162
|
+
maxIterations: number;
|
|
163
|
+
actionHistory?: string[];
|
|
164
|
+
viewport?: {
|
|
165
|
+
width: number;
|
|
166
|
+
height: number;
|
|
167
|
+
};
|
|
168
|
+
scrollInfo?: {
|
|
169
|
+
scrollY: number;
|
|
170
|
+
scrollHeight: number;
|
|
171
|
+
viewportHeight: number;
|
|
172
|
+
};
|
|
173
|
+
screenshotUrl?: string;
|
|
174
|
+
}): ChatCompletionContentPart[];
|
|
175
|
+
export {};
|