autokap 1.0.6 → 1.0.7
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/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/dist/abort.d.ts +5 -0
- package/dist/abort.js +44 -0
- package/dist/agent.d.ts +142 -0
- package/dist/agent.js +4511 -0
- package/dist/billing-operation-logging.d.ts +38 -0
- package/dist/billing-operation-logging.js +248 -0
- package/dist/browser-bar.d.ts +40 -0
- package/dist/browser-bar.js +147 -0
- package/dist/browser.d.ts +25 -0
- package/dist/browser.js +177 -9
- package/dist/capture-alt-text.d.ts +12 -0
- package/dist/capture-alt-text.js +51 -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 +286 -0
- package/dist/capture-llm-page-identity.d.ts +15 -0
- package/dist/capture-llm-page-identity.js +116 -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 +9 -0
- package/dist/capture-page-identity.js +219 -0
- package/dist/capture-preset-credentials.d.ts +12 -0
- package/dist/capture-preset-credentials.js +57 -0
- package/dist/capture-request-plan.d.ts +58 -0
- package/dist/capture-request-plan.js +216 -0
- package/dist/capture-run-optimizer.d.ts +139 -0
- package/dist/capture-run-optimizer.js +848 -0
- package/dist/capture-selector-memory.d.ts +26 -0
- package/dist/capture-selector-memory.js +327 -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-studio-sync.d.ts +22 -0
- package/dist/capture-studio-sync.js +166 -0
- package/dist/capture-variant-state.d.ts +54 -0
- package/dist/capture-variant-state.js +156 -0
- package/dist/cli.js +15 -0
- package/dist/clip-orchestrator.d.ts +148 -0
- package/dist/clip-orchestrator.js +950 -0
- package/dist/clip-postprocess.d.ts +42 -0
- package/dist/clip-postprocess.js +192 -0
- package/dist/cost-logging.d.ts +27 -0
- package/dist/cost-logging.js +128 -0
- package/dist/credential-templates.d.ts +5 -0
- package/dist/credential-templates.js +60 -0
- package/dist/element-capture.d.ts +53 -0
- package/dist/element-capture.js +766 -0
- package/dist/hybrid-navigator.d.ts +138 -0
- package/dist/hybrid-navigator.js +468 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +11 -0
- package/dist/llm-usage.d.ts +17 -0
- package/dist/llm-usage.js +45 -0
- package/dist/mockup-html.d.ts +119 -0
- package/dist/mockup-html.js +253 -0
- package/dist/mockup.d.ts +94 -0
- package/dist/mockup.js +608 -0
- package/dist/mouse-animation.d.ts +46 -0
- package/dist/mouse-animation.js +100 -0
- package/dist/overlay-utils.d.ts +14 -0
- package/dist/overlay-utils.js +13 -0
- package/dist/posthog.d.ts +4 -0
- package/dist/posthog.js +26 -0
- package/dist/prompt-cache.d.ts +10 -0
- package/dist/prompt-cache.js +24 -0
- package/dist/prompts.d.ts +167 -0
- package/dist/prompts.js +1165 -0
- package/dist/remote-browser.d.ts +191 -0
- package/dist/remote-browser.js +305 -0
- package/dist/security.d.ts +20 -0
- package/dist/security.js +569 -0
- package/dist/server-capture-runtime.d.ts +123 -0
- package/dist/server-capture-runtime.js +638 -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 +45 -0
- package/dist/server-project-webhooks.js +97 -0
- package/dist/server-screenshot-watermark.d.ts +7 -0
- package/dist/server-screenshot-watermark.js +38 -0
- package/dist/session-profile.d.ts +86 -0
- package/dist/session-profile.js +1373 -0
- package/dist/sf-pro-fonts.d.ts +4 -0
- package/dist/sf-pro-fonts.js +7 -0
- package/dist/status-bar-l10n.d.ts +14 -0
- package/dist/status-bar-l10n.js +177 -0
- package/dist/status-bar.d.ts +44 -0
- package/dist/status-bar.js +336 -0
- package/dist/tools.d.ts +4 -0
- package/dist/tools.js +578 -0
- package/dist/video-agent.d.ts +143 -0
- package/dist/video-agent.js +4783 -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 +500 -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/ws-auth.d.ts +20 -0
- package/dist/ws-auth.js +67 -0
- package/dist/ws-handler.d.ts +10 -0
- package/dist/ws-handler.js +1663 -0
- package/dist/ws-server.d.ts +9 -0
- package/dist/ws-server.js +52 -0
- package/package.json +93 -39
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { ChatCompletionMessageParam } from 'openai/resources/chat/completions';
|
|
2
|
+
import { Browser } from './browser.js';
|
|
3
|
+
import type { BrowserObservation, BrowserVerificationBundle } from './browser.js';
|
|
4
|
+
import type { AgentConfig, AgentResult, ExecutedAction, ActionType, InteractiveElement, PageState, VariantCaptureManifest, VerificationResult } from './types.js';
|
|
5
|
+
export declare function inferVariantIdentityFailure(params: {
|
|
6
|
+
pageId?: string | null;
|
|
7
|
+
prompt: string;
|
|
8
|
+
currentUrl: string;
|
|
9
|
+
visibleText: string;
|
|
10
|
+
dialogCount: number;
|
|
11
|
+
pageIdentity?: VariantCaptureManifest["currentPageIdentity"];
|
|
12
|
+
}): string | null;
|
|
13
|
+
export declare function inferDeterministicReadyDecision(params: {
|
|
14
|
+
observation: BrowserObservation;
|
|
15
|
+
assessment: string;
|
|
16
|
+
targetUrl: string;
|
|
17
|
+
skipDialogCheck?: boolean;
|
|
18
|
+
allowSuccess?: boolean;
|
|
19
|
+
}): {
|
|
20
|
+
verified: boolean;
|
|
21
|
+
reason?: string;
|
|
22
|
+
} | null;
|
|
23
|
+
export declare function inferManifestReadyDecision(params: {
|
|
24
|
+
observation: BrowserObservation;
|
|
25
|
+
assessment: string;
|
|
26
|
+
config: AgentConfig;
|
|
27
|
+
bundle: BrowserVerificationBundle;
|
|
28
|
+
}): {
|
|
29
|
+
verified: boolean;
|
|
30
|
+
reason?: string;
|
|
31
|
+
} | null;
|
|
32
|
+
/**
|
|
33
|
+
* Page-signal deterministic verification: accepts when ALL of the following hold:
|
|
34
|
+
* 1. Assessment text parses as positive (caller already believes ready)
|
|
35
|
+
* 2. inferVariantIdentityFailure finds no identity mismatch
|
|
36
|
+
* 3. No loading indicators, readyState === 'complete'
|
|
37
|
+
* 4. No hard variant (lang/theme) mismatch
|
|
38
|
+
* 5. No unexpected dialog blocking the page (unless dialog is the target)
|
|
39
|
+
*
|
|
40
|
+
* Returns { verified: true } when confident, null when inconclusive (→ LLM).
|
|
41
|
+
* NEVER returns { verified: false } — absence of evidence is not evidence of absence.
|
|
42
|
+
*/
|
|
43
|
+
export declare function inferPageSignalReadyDecision(params: {
|
|
44
|
+
observation: BrowserObservation;
|
|
45
|
+
assessment: string;
|
|
46
|
+
config: AgentConfig;
|
|
47
|
+
bundle: BrowserVerificationBundle;
|
|
48
|
+
identityFailure: string | null;
|
|
49
|
+
}): {
|
|
50
|
+
verified: boolean;
|
|
51
|
+
} | null;
|
|
52
|
+
/**
|
|
53
|
+
* Fast-path optimization: extract a PASS/FAIL verdict from LLM text output
|
|
54
|
+
* using keyword matching, avoiding a separate LLM call when the signal is clear.
|
|
55
|
+
*
|
|
56
|
+
* Returns null when uncertain — the caller MUST fall back to an LLM vision call.
|
|
57
|
+
* Do not add more patterns here; expand LLM fallback coverage instead.
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseVerificationDecisionText(content: string): {
|
|
60
|
+
verified: boolean;
|
|
61
|
+
reason?: string;
|
|
62
|
+
} | null;
|
|
63
|
+
export declare function inferActionFromAssistantText(content: string): {
|
|
64
|
+
name: ActionType;
|
|
65
|
+
args: Record<string, unknown>;
|
|
66
|
+
} | null;
|
|
67
|
+
export declare function executeAction(browser: Browser, action: ActionType, args: Record<string, unknown>): Promise<{
|
|
68
|
+
success: boolean;
|
|
69
|
+
error?: string;
|
|
70
|
+
outcome?: string;
|
|
71
|
+
stateChanged?: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
export declare function verifyCaptureReadiness(browser: Browser, config: AgentConfig, apiKey: string, options?: {
|
|
74
|
+
assessment?: string;
|
|
75
|
+
stepNumber?: number;
|
|
76
|
+
}): Promise<VerificationResult>;
|
|
77
|
+
export declare function getLivePreviewScreenshot(pageState: Pick<PageState, 'cleanScreenshot' | 'screenshot'>): Buffer;
|
|
78
|
+
export declare function analyzeReplayCandidate(recordedActions: ExecutedAction[], params?: {
|
|
79
|
+
currentUrl?: string;
|
|
80
|
+
targetUrl?: string;
|
|
81
|
+
currentViewport?: {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
} | null;
|
|
85
|
+
isAuthenticated?: boolean;
|
|
86
|
+
currentDialogCount?: number | null;
|
|
87
|
+
pageIdentity?: VariantCaptureManifest['currentPageIdentity'] | null;
|
|
88
|
+
}): {
|
|
89
|
+
replayableActions: ExecutedAction[];
|
|
90
|
+
skipReason: string | null;
|
|
91
|
+
};
|
|
92
|
+
export declare function matchRecordedActionToElement(action: Pick<ExecutedAction, 'params'>, interactiveElements: InteractiveElement[]): InteractiveElement | null;
|
|
93
|
+
export declare function resolveReplayActionArgs(action: ExecutedAction, interactiveElements: InteractiveElement[]): {
|
|
94
|
+
args: Record<string, unknown> | null;
|
|
95
|
+
reason: string | null;
|
|
96
|
+
};
|
|
97
|
+
export declare function compactReplayActions(recordedActions: ExecutedAction[], params?: {
|
|
98
|
+
currentUrl?: string;
|
|
99
|
+
targetUrl?: string;
|
|
100
|
+
currentViewport?: {
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
} | null;
|
|
104
|
+
/** When true, filter out login/auth actions (session already active). */
|
|
105
|
+
isAuthenticated?: boolean;
|
|
106
|
+
}): ExecutedAction[];
|
|
107
|
+
export declare function countRecentNoEffectActions(actionHistory: ExecutedAction[]): number;
|
|
108
|
+
export declare function shouldTriggerRecovery(actionHistory: ExecutedAction[]): boolean;
|
|
109
|
+
export declare function inferPrematureGiveUpCorrection(params: {
|
|
110
|
+
reason: string;
|
|
111
|
+
actionHistory: ExecutedAction[];
|
|
112
|
+
lastVerificationFailure?: string;
|
|
113
|
+
iteration: number;
|
|
114
|
+
maxIterations: number;
|
|
115
|
+
}): string | null;
|
|
116
|
+
export declare function inferRepeatedActionGuard(params: {
|
|
117
|
+
actionHistory: ExecutedAction[];
|
|
118
|
+
action: ActionType;
|
|
119
|
+
args: Record<string, unknown>;
|
|
120
|
+
currentUrl?: string;
|
|
121
|
+
}): string | null;
|
|
122
|
+
export interface WorkflowCacheEntry {
|
|
123
|
+
subgoalName: string;
|
|
124
|
+
actionSummary: string;
|
|
125
|
+
selectors: string[];
|
|
126
|
+
}
|
|
127
|
+
export declare function findReusableWorkflow(workflowCache: WorkflowCacheEntry[], subgoalName: string): WorkflowCacheEntry | null;
|
|
128
|
+
/**
|
|
129
|
+
* Trim the conversation thread to avoid context window overflow.
|
|
130
|
+
* Always preserves the first `preservedPrefixMessages` entries, then the last maxMessages messages.
|
|
131
|
+
* Also compresses old screenshots and DOM blocks to save tokens.
|
|
132
|
+
*/
|
|
133
|
+
export declare function trimConversationHistory(messages: ChatCompletionMessageParam[], maxMessages?: number, preservedPrefixMessages?: number): void;
|
|
134
|
+
export declare function runAgent(browser: Browser, config: AgentConfig, apiKey: string): Promise<AgentResult>;
|
|
135
|
+
/**
|
|
136
|
+
* Replay a previous successful capture's recorded actions instead of running the full AI agent.
|
|
137
|
+
* Falls back to a full runAgent if replay fails or verification doesn't pass.
|
|
138
|
+
* Much cheaper than a full agent run: only 1 verification call vs. N agent iterations.
|
|
139
|
+
*/
|
|
140
|
+
export declare function replayAgent(browser: Browser, config: AgentConfig, apiKey: string, recordedActions: ExecutedAction[], options?: {
|
|
141
|
+
allowFullAgentFallback?: boolean;
|
|
142
|
+
}): Promise<AgentResult>;
|