autokap 1.9.9 → 2.0.0

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.
@@ -296,13 +296,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
296
296
  stepId: z.ZodOptional<z.ZodString>;
297
297
  kind: z.ZodLiteral<"ASSERT_SURFACE">;
298
298
  }, z.core.$strict>, z.ZodObject<{
299
- selector: z.ZodString;
299
+ selector: z.ZodOptional<z.ZodString>;
300
300
  target: z.ZodOptional<z.ZodObject<{
301
301
  text: z.ZodOptional<z.ZodString>;
302
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
302
303
  role: z.ZodOptional<z.ZodString>;
303
304
  label: z.ZodOptional<z.ZodString>;
305
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
304
306
  near: z.ZodOptional<z.ZodString>;
307
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
305
308
  placeholder: z.ZodOptional<z.ZodString>;
309
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
306
310
  exact: z.ZodOptional<z.ZodBoolean>;
307
311
  }, z.core.$strict>>;
308
312
  button: z.ZodOptional<z.ZodEnum<{
@@ -341,13 +345,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
341
345
  stepId: z.ZodOptional<z.ZodString>;
342
346
  kind: z.ZodLiteral<"CLICK">;
343
347
  }, z.core.$strict>, z.ZodObject<{
344
- selector: z.ZodString;
348
+ selector: z.ZodOptional<z.ZodString>;
345
349
  target: z.ZodOptional<z.ZodObject<{
346
350
  text: z.ZodOptional<z.ZodString>;
351
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
347
352
  role: z.ZodOptional<z.ZodString>;
348
353
  label: z.ZodOptional<z.ZodString>;
354
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
349
355
  near: z.ZodOptional<z.ZodString>;
356
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
350
357
  placeholder: z.ZodOptional<z.ZodString>;
358
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
351
359
  exact: z.ZodOptional<z.ZodBoolean>;
352
360
  }, z.core.$strict>>;
353
361
  text: z.ZodString;
@@ -419,10 +427,14 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
419
427
  selector: z.ZodOptional<z.ZodString>;
420
428
  target: z.ZodOptional<z.ZodObject<{
421
429
  text: z.ZodOptional<z.ZodString>;
430
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
422
431
  role: z.ZodOptional<z.ZodString>;
423
432
  label: z.ZodOptional<z.ZodString>;
433
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
424
434
  near: z.ZodOptional<z.ZodString>;
435
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
425
436
  placeholder: z.ZodOptional<z.ZodString>;
437
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
426
438
  exact: z.ZodOptional<z.ZodBoolean>;
427
439
  }, z.core.$strict>>;
428
440
  state: z.ZodEnum<{
@@ -598,10 +610,14 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
598
610
  targetSelector: z.ZodOptional<z.ZodString>;
599
611
  target: z.ZodOptional<z.ZodObject<{
600
612
  text: z.ZodOptional<z.ZodString>;
613
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
601
614
  role: z.ZodOptional<z.ZodString>;
602
615
  label: z.ZodOptional<z.ZodString>;
616
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
603
617
  near: z.ZodOptional<z.ZodString>;
618
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
604
619
  placeholder: z.ZodOptional<z.ZodString>;
620
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
605
621
  exact: z.ZodOptional<z.ZodBoolean>;
606
622
  }, z.core.$strict>>;
607
623
  description: z.ZodString;
@@ -741,13 +757,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
741
757
  stepId: z.ZodOptional<z.ZodString>;
742
758
  kind: z.ZodLiteral<"END_CLIP">;
743
759
  }, z.core.$strict>, z.ZodObject<{
744
- selector: z.ZodString;
760
+ selector: z.ZodOptional<z.ZodString>;
745
761
  target: z.ZodOptional<z.ZodObject<{
746
762
  text: z.ZodOptional<z.ZodString>;
763
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
747
764
  role: z.ZodOptional<z.ZodString>;
748
765
  label: z.ZodOptional<z.ZodString>;
766
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
749
767
  near: z.ZodOptional<z.ZodString>;
768
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
750
769
  placeholder: z.ZodOptional<z.ZodString>;
770
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
751
771
  exact: z.ZodOptional<z.ZodBoolean>;
752
772
  }, z.core.$strict>>;
753
773
  fingerprint: z.ZodOptional<z.ZodString>;
@@ -782,13 +802,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
782
802
  stepId: z.ZodOptional<z.ZodString>;
783
803
  kind: z.ZodLiteral<"HOVER">;
784
804
  }, z.core.$strict>, z.ZodObject<{
785
- selector: z.ZodString;
805
+ selector: z.ZodOptional<z.ZodString>;
786
806
  target: z.ZodOptional<z.ZodObject<{
787
807
  text: z.ZodOptional<z.ZodString>;
808
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
788
809
  role: z.ZodOptional<z.ZodString>;
789
810
  label: z.ZodOptional<z.ZodString>;
811
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
790
812
  near: z.ZodOptional<z.ZodString>;
813
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
791
814
  placeholder: z.ZodOptional<z.ZodString>;
815
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
792
816
  exact: z.ZodOptional<z.ZodBoolean>;
793
817
  }, z.core.$strict>>;
794
818
  optionLabel: z.ZodOptional<z.ZodString>;
@@ -826,13 +850,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
826
850
  stepId: z.ZodOptional<z.ZodString>;
827
851
  kind: z.ZodLiteral<"SELECT_OPTION">;
828
852
  }, z.core.$strict>, z.ZodObject<{
829
- selector: z.ZodString;
853
+ selector: z.ZodOptional<z.ZodString>;
830
854
  target: z.ZodOptional<z.ZodObject<{
831
855
  text: z.ZodOptional<z.ZodString>;
856
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
832
857
  role: z.ZodOptional<z.ZodString>;
833
858
  label: z.ZodOptional<z.ZodString>;
859
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
834
860
  near: z.ZodOptional<z.ZodString>;
861
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
835
862
  placeholder: z.ZodOptional<z.ZodString>;
863
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
836
864
  exact: z.ZodOptional<z.ZodBoolean>;
837
865
  }, z.core.$strict>>;
838
866
  checked: z.ZodBoolean;
@@ -868,13 +896,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
868
896
  stepId: z.ZodOptional<z.ZodString>;
869
897
  kind: z.ZodLiteral<"CHECK">;
870
898
  }, z.core.$strict>, z.ZodObject<{
871
- selector: z.ZodString;
899
+ selector: z.ZodOptional<z.ZodString>;
872
900
  target: z.ZodOptional<z.ZodObject<{
873
901
  text: z.ZodOptional<z.ZodString>;
902
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
874
903
  role: z.ZodOptional<z.ZodString>;
875
904
  label: z.ZodOptional<z.ZodString>;
905
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
876
906
  near: z.ZodOptional<z.ZodString>;
907
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
877
908
  placeholder: z.ZodOptional<z.ZodString>;
909
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
878
910
  exact: z.ZodOptional<z.ZodBoolean>;
879
911
  }, z.core.$strict>>;
880
912
  fingerprint: z.ZodOptional<z.ZodString>;
@@ -909,13 +941,17 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
909
941
  stepId: z.ZodOptional<z.ZodString>;
910
942
  kind: z.ZodLiteral<"DOUBLE_CLICK">;
911
943
  }, z.core.$strict>, z.ZodObject<{
912
- selector: z.ZodString;
944
+ selector: z.ZodOptional<z.ZodString>;
913
945
  target: z.ZodOptional<z.ZodObject<{
914
946
  text: z.ZodOptional<z.ZodString>;
947
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
915
948
  role: z.ZodOptional<z.ZodString>;
916
949
  label: z.ZodOptional<z.ZodString>;
950
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
917
951
  near: z.ZodOptional<z.ZodString>;
952
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
918
953
  placeholder: z.ZodOptional<z.ZodString>;
954
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
919
955
  exact: z.ZodOptional<z.ZodBoolean>;
920
956
  }, z.core.$strict>>;
921
957
  fingerprint: z.ZodOptional<z.ZodString>;
@@ -923,10 +959,14 @@ export declare const VideoIngestPayloadSchema: z.ZodObject<{
923
959
  toSelector: z.ZodOptional<z.ZodString>;
924
960
  toTarget: z.ZodOptional<z.ZodObject<{
925
961
  text: z.ZodOptional<z.ZodString>;
962
+ textByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
926
963
  role: z.ZodOptional<z.ZodString>;
927
964
  label: z.ZodOptional<z.ZodString>;
965
+ labelByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
928
966
  near: z.ZodOptional<z.ZodString>;
967
+ nearByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
929
968
  placeholder: z.ZodOptional<z.ZodString>;
969
+ placeholderByLocale: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
930
970
  exact: z.ZodOptional<z.ZodBoolean>;
931
971
  }, z.core.$strict>>;
932
972
  toSelectorAlternates: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -23,7 +23,10 @@ export const WAIT_CONTRACT_VERSION = 1;
23
23
  * so it never shortens an intentionally-long opcode (`SLEEP`, `END_CLIP`).
24
24
  */
25
25
  export const GLOBAL_WAIT_CAP_MS = {
26
- screenshot: 30_000,
26
+ // Heavy high-res captures (5K device frames, retina, animated pages) can take
27
+ // 15-30s under cloud CPU load with software rasterization. 45s gives them room
28
+ // to complete (and to reserve a recovery slice) instead of failing prematurely.
29
+ screenshot: 45_000,
27
30
  clip: 45_000,
28
31
  video: 60_000,
29
32
  };
@@ -100,6 +100,17 @@ export declare class WebPlaywrightLocal implements RuntimeAdapter {
100
100
  value?: string;
101
101
  index?: number;
102
102
  }): Promise<void>;
103
+ selectOptionByTarget(opts: ResolveOptions, option: {
104
+ label?: string;
105
+ value?: string;
106
+ index?: number;
107
+ }): Promise<void>;
108
+ checkByTarget(opts: ResolveOptions, checked: boolean, actionOpts?: {
109
+ onClick?: (timestampMs: number) => void;
110
+ }): Promise<void>;
111
+ doubleClickByTarget(opts: ResolveOptions, actionOpts?: {
112
+ onClick?: (timestampMs: number) => void;
113
+ }): Promise<void>;
103
114
  check(selector: string, checked: boolean, actionOpts?: {
104
115
  onClick?: (timestampMs: number) => void;
105
116
  }): Promise<void>;
@@ -117,6 +128,7 @@ export declare class WebPlaywrightLocal implements RuntimeAdapter {
117
128
  dx: number;
118
129
  dy: number;
119
130
  };
131
+ locale?: string;
120
132
  }): Promise<void>;
121
133
  cloneElement(opts: {
122
134
  sourceSelector: string;
@@ -892,6 +892,57 @@ export class WebPlaywrightLocal {
892
892
  optionIndex: option.index,
893
893
  });
894
894
  }
895
+ async selectOptionByTarget(opts, option) {
896
+ const page = await this.browser.currentPage;
897
+ const resolved = await resolveTarget(page, opts);
898
+ if (!resolved) {
899
+ throw new Error(`cannot find target for select: ${describeResolveOptions(opts)}`);
900
+ }
901
+ await this.moveClipCursorToLocator(resolved.locator);
902
+ const values = option.label !== undefined
903
+ ? { label: option.label }
904
+ : option.value !== undefined
905
+ ? { value: option.value }
906
+ : { index: option.index ?? 0 };
907
+ await resolved.locator.selectOption(values, { timeout: 5000 });
908
+ }
909
+ async checkByTarget(opts, checked, actionOpts) {
910
+ const page = await this.browser.currentPage;
911
+ const resolved = await resolveTarget(page, opts);
912
+ if (!resolved) {
913
+ throw new Error(`cannot find target for check: ${describeResolveOptions(opts)}`);
914
+ }
915
+ const target = await this.moveClipCursorToLocator(resolved.locator);
916
+ const position = target
917
+ ? await this.relativeClickPosition(resolved.locator, target)
918
+ : null;
919
+ const checkOpts = { timeout: 5000, ...(position ? { position } : {}) };
920
+ const dispatchedAt = Date.now();
921
+ if (checked) {
922
+ await resolved.locator.check(checkOpts);
923
+ }
924
+ else {
925
+ await resolved.locator.uncheck(checkOpts);
926
+ }
927
+ await this.reportClickSfxTimestamps(page, dispatchedAt, actionOpts?.onClick);
928
+ }
929
+ async doubleClickByTarget(opts, actionOpts) {
930
+ const page = await this.browser.currentPage;
931
+ const resolved = await resolveTarget(page, opts);
932
+ if (!resolved) {
933
+ throw new Error(`cannot find target for double-click: ${describeResolveOptions(opts)}`);
934
+ }
935
+ const target = await this.moveClipCursorToLocator(resolved.locator);
936
+ const position = target
937
+ ? await this.relativeClickPosition(resolved.locator, target)
938
+ : null;
939
+ const dispatchedAt = Date.now();
940
+ await resolved.locator.dblclick({
941
+ timeout: 5000,
942
+ ...(position ? { position } : {}),
943
+ });
944
+ await this.reportClickSfxTimestamps(page, dispatchedAt, actionOpts?.onClick);
945
+ }
895
946
  async check(selector, checked, actionOpts) {
896
947
  const page = await this.browser.currentPage;
897
948
  const locator = page.locator(selector).first();
@@ -932,6 +983,7 @@ export class WebPlaywrightLocal {
932
983
  selector: opts.selector,
933
984
  target: opts.target,
934
985
  selectorAlternates: opts.selectorAlternates,
986
+ locale: opts.locale,
935
987
  });
936
988
  if (!sourceResolved) {
937
989
  throw new Error(`cannot find drag source: ${describeResolveOptions({ selector: opts.selector, target: opts.target })}`);
@@ -952,6 +1004,7 @@ export class WebPlaywrightLocal {
952
1004
  selector: opts.toSelector,
953
1005
  target: opts.toTarget,
954
1006
  selectorAlternates: opts.toSelectorAlternates,
1007
+ locale: opts.locale,
955
1008
  });
956
1009
  if (!destResolved) {
957
1010
  throw new Error(`cannot find drag destination: ${describeResolveOptions({ selector: opts.toSelector, target: opts.toTarget })}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autokap",
3
- "version": "1.9.9",
3
+ "version": "2.0.0",
4
4
  "description": "AI-powered CLI tool for capturing clean screenshots of websites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",