autokap 1.0.7 → 1.0.10
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 +635 -0
- package/assets/skill/README.md +39 -0
- package/assets/skill/SKILL.md +454 -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 +197 -0
- package/dist/benchmark.d.ts +59 -0
- package/dist/benchmark.js +135 -0
- package/dist/billing-operation-logging.d.ts +3 -1
- package/dist/billing-operation-logging.js +4 -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 +61 -11
- package/dist/browser.js +1513 -59
- package/dist/capture-alt-text.js +2 -1
- package/dist/capture-encryption.d.ts +3 -1
- package/dist/capture-encryption.js +21 -6
- 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 +96 -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 +9 -1
- package/dist/cli-config.js +112 -7
- package/dist/cli-contract.d.ts +19 -0
- package/dist/cli-contract.js +173 -0
- package/dist/cli-runner-local.d.ts +12 -0
- package/dist/cli-runner-local.js +115 -0
- package/dist/cli-runner.d.ts +34 -0
- package/dist/cli-runner.js +580 -0
- package/dist/cli-utils.d.ts +0 -1
- package/dist/cli-utils.js +2 -5
- package/dist/cli.js +1011 -267
- package/dist/clip-begin-frame-recorder.d.ts +44 -0
- package/dist/clip-begin-frame-recorder.js +250 -0
- package/dist/clip-capture-backend.d.ts +25 -0
- package/dist/clip-capture-backend.js +189 -0
- package/dist/clip-capture-loop.d.ts +61 -0
- package/dist/clip-capture-loop.js +111 -0
- package/dist/clip-frame-recorder.d.ts +63 -0
- package/dist/clip-frame-recorder.js +305 -0
- package/dist/clip-orchestrator.js +9 -2
- package/dist/clip-postprocess.d.ts +31 -2
- package/dist/clip-postprocess.js +194 -68
- package/dist/clip-runtime.d.ts +18 -0
- package/dist/clip-runtime.js +67 -0
- package/dist/clip-scale.d.ts +10 -0
- package/dist/clip-scale.js +21 -0
- package/dist/clip-screencast-recorder.d.ts +42 -0
- package/dist/clip-screencast-recorder.js +242 -0
- package/dist/clip-sidecar.d.ts +54 -0
- package/dist/clip-sidecar.js +208 -0
- 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 +63 -0
- package/dist/execution-schema.d.ts +4753 -0
- package/dist/execution-schema.js +563 -0
- package/dist/execution-types.d.ts +936 -0
- package/dist/execution-types.js +66 -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 +11 -6
- package/dist/index.js +11 -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 +55 -0
- package/dist/llm-healer.js +213 -0
- package/dist/llm-provider.d.ts +29 -0
- package/dist/llm-provider.js +83 -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 +524 -0
- package/dist/opcode-runner.d.ts +51 -0
- package/dist/opcode-runner.js +779 -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/program-signing.d.ts +1094 -0
- package/dist/program-signing.js +140 -0
- package/dist/prompts.d.ts +13 -5
- package/dist/prompts.js +224 -351
- package/dist/provider-config.d.ts +17 -0
- package/dist/provider-config.js +42 -0
- package/dist/recovery-chain.d.ts +37 -0
- package/dist/recovery-chain.js +374 -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 +248 -7
- 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 +156 -0
- package/dist/web-playwright-local.js +989 -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 +62 -35
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ExecutionProgramSchema } from './execution-schema.js';
|
|
4
|
+
const MAX_SIGNATURE_AGE_MS = 15 * 60 * 1000;
|
|
5
|
+
const FUTURE_SKEW_MS = 60 * 1000;
|
|
6
|
+
function isHttpOrigin(value) {
|
|
7
|
+
try {
|
|
8
|
+
const parsed = new URL(value);
|
|
9
|
+
return ((parsed.protocol === 'http:' || parsed.protocol === 'https:')
|
|
10
|
+
&& parsed.origin === value
|
|
11
|
+
&& Boolean(parsed.host));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const HttpOriginSchema = z.string().refine(isHttpOrigin, {
|
|
18
|
+
message: 'Expected an exact http/https origin',
|
|
19
|
+
});
|
|
20
|
+
export const ProgramSecurityMetadataSchema = z.object({
|
|
21
|
+
expectedApiOrigin: HttpOriginSchema,
|
|
22
|
+
allowedNavigationOrigins: z.array(HttpOriginSchema).min(1),
|
|
23
|
+
runtimeLlmAllowed: z.boolean().default(false),
|
|
24
|
+
}).strict();
|
|
25
|
+
export const SignedExecutionProgramEnvelopeSchema = z.object({
|
|
26
|
+
kind: z.literal('signed_execution_program'),
|
|
27
|
+
signedAt: z.string().datetime(),
|
|
28
|
+
security: ProgramSecurityMetadataSchema,
|
|
29
|
+
program: ExecutionProgramSchema,
|
|
30
|
+
signature: z.string().regex(/^[a-f0-9]{64}$/i),
|
|
31
|
+
meta: z.object({
|
|
32
|
+
stale: z.boolean().optional(),
|
|
33
|
+
}).strict().optional(),
|
|
34
|
+
}).strict();
|
|
35
|
+
function stableNormalize(value) {
|
|
36
|
+
if (Array.isArray(value)) {
|
|
37
|
+
return value.map((entry) => stableNormalize(entry));
|
|
38
|
+
}
|
|
39
|
+
if (value && typeof value === 'object') {
|
|
40
|
+
const entries = Object.entries(value)
|
|
41
|
+
.filter(([, entry]) => entry !== undefined)
|
|
42
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
43
|
+
.map(([key, entry]) => [key, stableNormalize(entry)]);
|
|
44
|
+
return Object.fromEntries(entries);
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
function stableStringify(value) {
|
|
49
|
+
return JSON.stringify(stableNormalize(value));
|
|
50
|
+
}
|
|
51
|
+
function signPayload(payload, apiKey) {
|
|
52
|
+
return crypto
|
|
53
|
+
.createHmac('sha256', apiKey)
|
|
54
|
+
.update(stableStringify(payload))
|
|
55
|
+
.digest('hex');
|
|
56
|
+
}
|
|
57
|
+
export function normalizeAllowedOrigins(origins) {
|
|
58
|
+
const unique = new Set();
|
|
59
|
+
for (const origin of origins) {
|
|
60
|
+
if (!origin)
|
|
61
|
+
continue;
|
|
62
|
+
const normalized = normalizeHttpOrigin(origin);
|
|
63
|
+
if (normalized)
|
|
64
|
+
unique.add(normalized);
|
|
65
|
+
}
|
|
66
|
+
return Array.from(unique).sort();
|
|
67
|
+
}
|
|
68
|
+
export function normalizeHttpOrigin(value) {
|
|
69
|
+
const trimmed = value?.trim();
|
|
70
|
+
if (!trimmed)
|
|
71
|
+
return null;
|
|
72
|
+
try {
|
|
73
|
+
const parsed = new URL(trimmed);
|
|
74
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
if (!parsed.host)
|
|
78
|
+
return null;
|
|
79
|
+
return parsed.origin;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export function signExecutionProgramEnvelope(params) {
|
|
86
|
+
const signedAt = params.signedAt ?? new Date().toISOString();
|
|
87
|
+
const payload = {
|
|
88
|
+
signedAt,
|
|
89
|
+
security: {
|
|
90
|
+
...params.security,
|
|
91
|
+
allowedNavigationOrigins: normalizeAllowedOrigins(params.security.allowedNavigationOrigins),
|
|
92
|
+
},
|
|
93
|
+
program: params.program,
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
kind: 'signed_execution_program',
|
|
97
|
+
signedAt,
|
|
98
|
+
security: payload.security,
|
|
99
|
+
program: payload.program,
|
|
100
|
+
signature: signPayload(payload, params.apiKey),
|
|
101
|
+
...(params.meta ? { meta: params.meta } : {}),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function verifySignedExecutionProgramEnvelope(params) {
|
|
105
|
+
const envelope = SignedExecutionProgramEnvelopeSchema.parse(params.envelope);
|
|
106
|
+
const payload = {
|
|
107
|
+
signedAt: envelope.signedAt,
|
|
108
|
+
security: {
|
|
109
|
+
...envelope.security,
|
|
110
|
+
allowedNavigationOrigins: normalizeAllowedOrigins(envelope.security.allowedNavigationOrigins),
|
|
111
|
+
},
|
|
112
|
+
program: envelope.program,
|
|
113
|
+
};
|
|
114
|
+
const expectedSignature = signPayload(payload, params.apiKey);
|
|
115
|
+
const received = Buffer.from(envelope.signature, 'hex');
|
|
116
|
+
const expected = Buffer.from(expectedSignature, 'hex');
|
|
117
|
+
if (received.length !== expected.length || !crypto.timingSafeEqual(received, expected)) {
|
|
118
|
+
throw new Error('program signature verification failed');
|
|
119
|
+
}
|
|
120
|
+
const expectedOrigin = normalizeHttpOrigin(params.expectedApiOrigin);
|
|
121
|
+
if (expectedOrigin && payload.security.expectedApiOrigin !== expectedOrigin) {
|
|
122
|
+
throw new Error(`program expected API origin ${payload.security.expectedApiOrigin}, received via ${expectedOrigin}`);
|
|
123
|
+
}
|
|
124
|
+
const now = params.now ?? new Date();
|
|
125
|
+
const signedAt = Date.parse(envelope.signedAt);
|
|
126
|
+
if (!Number.isFinite(signedAt)) {
|
|
127
|
+
throw new Error('program signature timestamp is invalid');
|
|
128
|
+
}
|
|
129
|
+
if (signedAt - now.getTime() > FUTURE_SKEW_MS) {
|
|
130
|
+
throw new Error('program signature timestamp is in the future');
|
|
131
|
+
}
|
|
132
|
+
if (now.getTime() - signedAt > MAX_SIGNATURE_AGE_MS) {
|
|
133
|
+
throw new Error('program signature has expired');
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
...envelope,
|
|
137
|
+
security: payload.security,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=program-signing.js.map
|
package/dist/prompts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChatCompletionContentPart } from 'openai/resources/chat/completions';
|
|
2
|
-
import type { AgentConfig, AgentRunHint, CaptureCursor, CaptureObjective, CaptureHandoffContext, ExecutedAction, InteractiveElement, LoginCredentials, RepairTicket, VariantCaptureManifest, ValidatedSessionProfile, WorkflowScreenshot } from './types.js';
|
|
2
|
+
import type { AgentConfig, AgentRunHint, CaptureCursor, CaptureObjective, CaptureHandoffContext, ExecutedAction, InteractiveElement, LoginCredentials, OverlayScopeSummary, RepairTicket, VariantCaptureManifest, ValidatedSessionProfile, WorkflowScreenshot } from './types.js';
|
|
3
3
|
interface SystemPromptOptions {
|
|
4
4
|
reasoningLocale?: string;
|
|
5
5
|
}
|
|
@@ -29,6 +29,7 @@ export interface StableAnchorUserMessageParams {
|
|
|
29
29
|
}
|
|
30
30
|
export interface IterationUserMessageParams {
|
|
31
31
|
userPrompt: string;
|
|
32
|
+
serializedAKTree: string;
|
|
32
33
|
cleanScreenshotUrl?: string;
|
|
33
34
|
screenshotUrl: string;
|
|
34
35
|
/** In dual-model mode, the vision model's text observation replaces images. */
|
|
@@ -107,6 +108,10 @@ export interface IterationUserMessageParams {
|
|
|
107
108
|
};
|
|
108
109
|
/** Compact summary of recent failed actions — prevents the agent from repeating dead-end strategies. */
|
|
109
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;
|
|
110
115
|
}
|
|
111
116
|
export declare function buildStableAnchorUserMessage(params: StableAnchorUserMessageParams): {
|
|
112
117
|
content: ChatCompletionContentPart[];
|
|
@@ -140,6 +145,7 @@ export declare function buildVisionObserverPrompt(params: {
|
|
|
140
145
|
currentUrl: string;
|
|
141
146
|
interactiveElements: InteractiveElement[];
|
|
142
147
|
userGoal: string;
|
|
148
|
+
question?: string;
|
|
143
149
|
currentLang?: string;
|
|
144
150
|
currentTheme?: 'light' | 'dark';
|
|
145
151
|
currentPageId?: string;
|
|
@@ -150,9 +156,7 @@ export declare function buildElementSystemPrompt(description: string): string;
|
|
|
150
156
|
export declare function buildElementIterationMessage(params: {
|
|
151
157
|
elementName: string;
|
|
152
158
|
elementDescription: string;
|
|
153
|
-
|
|
154
|
-
interactiveElements: InteractiveElement[];
|
|
155
|
-
simplifiedDOM?: string;
|
|
159
|
+
serializedAKTree: string;
|
|
156
160
|
currentUrl: string;
|
|
157
161
|
iteration: number;
|
|
158
162
|
maxIterations: number;
|
|
@@ -161,7 +165,11 @@ export declare function buildElementIterationMessage(params: {
|
|
|
161
165
|
width: number;
|
|
162
166
|
height: number;
|
|
163
167
|
};
|
|
164
|
-
|
|
168
|
+
scrollInfo?: {
|
|
169
|
+
scrollY: number;
|
|
170
|
+
scrollHeight: number;
|
|
171
|
+
viewportHeight: number;
|
|
172
|
+
};
|
|
165
173
|
screenshotUrl?: string;
|
|
166
174
|
}): ChatCompletionContentPart[];
|
|
167
175
|
export {};
|