autokap 1.0.2 → 1.0.4

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.
Files changed (83) hide show
  1. package/dist/cli-config.d.ts +13 -0
  2. package/dist/cli-config.js +42 -0
  3. package/dist/cli-utils.d.ts +0 -19
  4. package/dist/cli-utils.js +2 -65
  5. package/dist/cli.d.ts +0 -1
  6. package/dist/cli.js +266 -305
  7. package/package.json +26 -19
  8. package/assets/chrome/ios-statusbar-comparison-reference.jpg +0 -0
  9. package/assets/chrome/ios-statusbar-dark-reference.jpg +0 -0
  10. package/assets/chrome/ios-statusbar-light-reference.jpg +0 -0
  11. package/assets/devices/ipad-pro-11-m4.json +0 -52
  12. package/assets/devices/iphone-16-pro.json +0 -53
  13. package/assets/devices/macbook-air-13.json +0 -45
  14. package/assets/frames/MacBook Air 13.svg +0 -242
  15. package/assets/frames/Status bar - iPhone.png +0 -0
  16. package/assets/frames/Status bar and Menu bar- iPad.png +0 -0
  17. package/assets/frames/iPad Pro M4 11_.png +0 -0
  18. package/assets/frames/iPhone 16 Pro.png +0 -0
  19. package/assets/icons/Cellular Connection.svg +0 -3
  20. package/assets/icons/Union.svg +0 -6
  21. package/assets/icons/Wifi.svg +0 -3
  22. package/assets/icons/battery.svg +0 -5
  23. package/assets/icons/battery_charging.svg +0 -8
  24. package/dist/abort.d.ts +0 -5
  25. package/dist/abort.js +0 -44
  26. package/dist/agent.d.ts +0 -142
  27. package/dist/agent.js +0 -4504
  28. package/dist/browser-bar.d.ts +0 -40
  29. package/dist/browser-bar.js +0 -147
  30. package/dist/clip-orchestrator.d.ts +0 -148
  31. package/dist/clip-orchestrator.js +0 -950
  32. package/dist/clip-postprocess.d.ts +0 -42
  33. package/dist/clip-postprocess.js +0 -192
  34. package/dist/credential-templates.d.ts +0 -5
  35. package/dist/credential-templates.js +0 -60
  36. package/dist/element-capture.d.ts +0 -53
  37. package/dist/element-capture.js +0 -766
  38. package/dist/hybrid-navigator.d.ts +0 -138
  39. package/dist/hybrid-navigator.js +0 -468
  40. package/dist/index.d.ts +0 -15
  41. package/dist/index.js +0 -11
  42. package/dist/llm-usage.d.ts +0 -17
  43. package/dist/llm-usage.js +0 -45
  44. package/dist/mockup-html.d.ts +0 -119
  45. package/dist/mockup-html.js +0 -253
  46. package/dist/mockup.d.ts +0 -94
  47. package/dist/mockup.js +0 -604
  48. package/dist/mouse-animation.d.ts +0 -46
  49. package/dist/mouse-animation.js +0 -100
  50. package/dist/overlay-utils.d.ts +0 -14
  51. package/dist/overlay-utils.js +0 -13
  52. package/dist/posthog.d.ts +0 -4
  53. package/dist/posthog.js +0 -26
  54. package/dist/prompt-cache.d.ts +0 -10
  55. package/dist/prompt-cache.js +0 -24
  56. package/dist/prompts.d.ts +0 -167
  57. package/dist/prompts.js +0 -1165
  58. package/dist/security.d.ts +0 -20
  59. package/dist/security.js +0 -569
  60. package/dist/session-profile.d.ts +0 -86
  61. package/dist/session-profile.js +0 -1471
  62. package/dist/sf-pro-fonts.d.ts +0 -4
  63. package/dist/sf-pro-fonts.js +0 -7
  64. package/dist/status-bar-l10n.d.ts +0 -14
  65. package/dist/status-bar-l10n.js +0 -177
  66. package/dist/status-bar.d.ts +0 -44
  67. package/dist/status-bar.js +0 -336
  68. package/dist/tools.d.ts +0 -4
  69. package/dist/tools.js +0 -578
  70. package/dist/video-agent.d.ts +0 -143
  71. package/dist/video-agent.js +0 -4783
  72. package/dist/video-observation.d.ts +0 -36
  73. package/dist/video-observation.js +0 -192
  74. package/dist/video-planner.d.ts +0 -12
  75. package/dist/video-planner.js +0 -500
  76. package/dist/video-prompts.d.ts +0 -37
  77. package/dist/video-prompts.js +0 -554
  78. package/dist/video-tools.d.ts +0 -3
  79. package/dist/video-tools.js +0 -59
  80. package/dist/video-variant-state.d.ts +0 -29
  81. package/dist/video-variant-state.js +0 -80
  82. package/dist/vision-model.d.ts +0 -17
  83. package/dist/vision-model.js +0 -74
@@ -1,143 +0,0 @@
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 {};