Repository navigation
Expand file tree
/
Copy pathworkflow-schema.json
More file actions
1745 lines (1745 loc) · 69.7 KB
/
Copy pathworkflow-schema.json
File metadata and controls
1745 lines (1745 loc) · 69.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "WorkflowFile",
"description": "A workflow script: ordered phases that automate a sequence of UI interactions.\n\n```\nlet yaml = r#\"\nname: my_workflow\nparams:\n - name: text\n default: \"Hello World\"\ndefaults:\n timeout: 5s\nlaunch:\n exe: notepad.exe\n timeout: 15s\nanchors:\n notepad: { type: Root, selector: \"[name~=Notepad]\" }\n editor: { type: Stable, parent: notepad, selector: \">> [role=edit][name='Text Editor']\" }\nrecovery_handlers:\n my_handler:\n trigger: { type: DialogPresent, scope: notepad }\n actions: [{ type: ClickForegroundButton, name: OK }]\n resume: retry_step\nphases:\n - name: do_something\n mount: [notepad, editor]\n unmount: [editor]\n recovery:\n handlers: [my_handler]\n steps:\n - intent: click OK\n action: { type: Click, scope: notepad, selector: \">> [role=button][name=OK]\" }\n expect: { type: DialogAbsent, scope: notepad }\n\"#;\nlet _: ui_automata::yaml::WorkflowFile = serde_yaml::from_str(yaml).unwrap();\n```",
"type": "object",
"properties": {
"anchors": {
"description": "Named anchor definitions. An anchor is a named, cached handle to a live UI element.\nAnchors are activated per-phase via `mount:` and referenced by name as `scope` in\nactions and conditions. Each anchor declares a `type` (root/stable/ephemeral),\na `selector` to find the element, and optional `process`/`pin_launch` filters.",
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/YamlAnchor"
}
},
"defaults": {
"description": "Default timeout and retry policy applied to every step that does not set its own.",
"$ref": "#/$defs/Defaults"
},
"description": {
"description": "Human-readable description of what this workflow does.",
"type": [
"string",
"null"
],
"default": null
},
"launch": {
"description": "Optional application to launch before running phases. The executor waits for a window\nbelonging to the launched PID to appear before proceeding.",
"anyOf": [
{
"$ref": "#/$defs/LaunchConfig"
},
{
"type": "null"
}
]
},
"name": {
"description": "Unique workflow identifier, used in logs and progress events.",
"type": "string"
},
"outputs": {
"description": "Keys that this workflow returns to its parent when used as a subflow.\n\nWhen present, only `Extract` actions whose `key` is listed here propagate their\nvalue to the parent workflow; all other extracted keys are workflow-local and are\ndiscarded when the subflow returns. When absent the old behaviour is preserved:\nevery extracted value is returned (equivalent to listing all keys).\n\n```yaml\noutputs:\n - name: saved_file\n description: The final output CSV file\n - name: export_path\n```",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/OutputDef"
}
},
"params": {
"description": "Declared parameters. Before deserialization, every `{param.<name>}` token in the\nraw YAML is replaced with the corresponding runtime value. This substitution applies\nto selectors, intent strings, text fields, and any other string value. Example: a\nparam named `folder` lets you write `[role=list item][name={param.folder}]` in a\nselector. Pass values via CLI (`--param folder=Downloads`) or the RunWorkflow `params` map.",
"type": "array",
"items": {
"$ref": "#/$defs/ParamDef"
}
},
"phases": {
"description": "Ordered list of phases. Phases run sequentially; the first failure stops the workflow.",
"type": "array",
"items": {
"$ref": "#/$defs/YamlPhase"
}
},
"recovery_handlers": {
"description": "Named recovery handler definitions. A handler fires when a step times out and the\nhandler's `trigger` condition is true. Phases opt in via their `recovery: handlers:` list.",
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/YamlRecoveryHandler"
}
}
},
"required": [
"name"
],
"$defs": {
"Action": {
"oneOf": [
{
"description": "Left-click the centre of the element found by `selector` under `scope`.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "Click"
}
},
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "Double-click the centre of the element found by `selector` under `scope`.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "DoubleClick"
}
},
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "Move the mouse cursor to the centre of the element without clicking.\nUseful for triggering hover menus or tooltips.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "Hover"
}
},
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "Scroll ancestor containers until the element is within their visible\nviewport. Hovers each scrollable ancestor and sends wheel events,\nstopping as soon as the element's bounding box is fully visible or\nit stops moving (meaning the container doesn't scroll further).",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "ScrollIntoView"
}
},
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "Click at a fractional position within the element's bounding box.",
"type": "object",
"properties": {
"kind": {
"$ref": "#/$defs/ClickType"
},
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "ClickAt"
},
"x_pct": {
"type": "number",
"format": "double"
},
"y_pct": {
"type": "number",
"format": "double"
}
},
"required": [
"type",
"scope",
"selector",
"x_pct",
"y_pct",
"kind"
]
},
{
"description": "Type `text` into the element found by `selector` under `scope`.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"type": "string",
"const": "TypeText"
}
},
"required": [
"type",
"scope",
"selector",
"text"
]
},
{
"description": "Send a key expression (e.g. `\"{ENTER}\"`, `\"{TAB}\"`) to the element.",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "PressKey"
}
},
"required": [
"type",
"scope",
"selector",
"key"
]
},
{
"description": "Give keyboard focus to the element found by `selector` under `scope`.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "Focus"
}
},
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "Activate an element via UIA `IInvokePattern::Invoke()`.\n\nUnlike `Click`, `Invoke` does not require a valid bounding rect, so it\nworks on elements that are scrolled out of view (bounds `(0,0,1,1)`).\nAlso tries `SelectionItemPattern` when `InvokePattern` is unavailable.\nReturns an error if neither pattern is supported — does not fall back to\n`Click`. Prefer this over `Click` + `ScrollIntoView` for items in\nWinUI/UWP scrollable lists where mouse-wheel scrolling causes snap-back.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "Invoke"
}
},
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "Bring the window for `scope` to the foreground and restore it if minimized.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"type": {
"type": "string",
"const": "ActivateWindow"
}
},
"required": [
"type",
"scope"
]
},
{
"description": "Minimize the window for `scope`.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"type": {
"type": "string",
"const": "MinimizeWindow"
}
},
"required": [
"type",
"scope"
]
},
{
"description": "Close the window for `scope` via its close button (sends WM_CLOSE).",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"type": {
"type": "string",
"const": "CloseWindow"
}
},
"required": [
"type",
"scope"
]
},
{
"description": "Set the value of an edit / combo-box directly via IValuePattern.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"selector": {
"description": "CSS-like path for navigating the UIA element tree.\n\nSyntax: [Combinator] Step [Combinator Step]*\n Step = [attr Op value]+ [:nth(n)] [:parent | :ancestor(n)]\n Combinator = \">\" (direct child) | \">>\" (any descendant)\n attr = role | name | title | id\n Op = \"=\" exact | \"~=\" contains | \"^=\" starts-with | \"$=\" ends-with\n :parent navigate to the matched element's parent\n :ancestor(n) navigate n levels up (1 = parent)\n\nNo leading combinator: first step matches the scope root element itself.\nLeading >> or >: searches inside the scope root without re-matching it (use when scope IS the container).\n\nExamples:\n \"[name~=Notepad]\" root match by title substring\n \">> [role=button][name=Close]\" any descendant button\n \">> [role=title bar] > [role=button]\" child of a descendant\n \">> [role=group]:nth(1)\" second group child (0-indexed)\n \">> [role=button][name^=Don][name$=Save]\" starts/ends-with for special chars\n \">> [role=button][name=Performance]:parent > *:nth(9)\" 9th sibling of Performance",
"type": "string"
},
"type": {
"type": "string",
"const": "SetValue"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"scope",
"selector",
"value"
]
},
{
"description": "Find the first dialog child of `scope` and close it.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"type": {
"type": "string",
"const": "DismissDialog"
}
},
"required": [
"type",
"scope"
]
},
{
"description": "Click a button named `name` inside the current foreground window.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"const": "ClickForegroundButton"
}
},
"required": [
"type",
"name"
]
},
{
"description": "Click any element named `name` in the foreground window tree.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"const": "ClickForeground"
}
},
"required": [
"type",
"name"
]
},
{
"description": "Do nothing. Used as a placeholder action when a step only waits.",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "NoOp"
}
},
"required": [
"type"
]
},
{
"description": "Pause for the given duration before the expect condition is evaluated.\nUseful after `Hover` to wait for a tooltip to appear before the next step.",
"type": "object",
"properties": {
"duration": {
"description": "Duration string, e.g. \"5s\", \"300ms\", \"2m\", \"1h\"",
"type": "string"
},
"type": {
"type": "string",
"const": "Sleep"
}
},
"required": [
"type",
"duration"
]
},
{
"description": "Write all values stored under `key` in the workflow output buffer to a\nfile. Each value is written as one CSV-quoted line. The file is created\nor truncated. `path` supports `{output.*}` substitution.",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"path": {
"type": "string"
},
"type": {
"type": "string",
"const": "WriteOutput"
}
},
"required": [
"type",
"key",
"path"
]
},
{
"description": "Read text from one or more elements and store the values in the workflow\noutput buffer under `key`. The value is accessible via `{output.<key>}`\nsubstitution in subsequent steps.\n\nExtracts a text value from a matched element and stores it under `key`.\nWhether the value is propagated to the parent workflow is controlled by\nthe workflow's `outputs` declaration (set at load time, not in YAML).",
"type": "object",
"properties": {
"attribute": {
"description": "Which text property to read from each matched element.",
"$ref": "#/$defs/ExtractAttribute"
},
"key": {
"description": "Output key. Accessible as `{output.<key>}` in later steps.",
"type": "string"
},
"multiple": {
"description": "If true, extract all matching elements. If false (default), extract only the first match.",
"type": "boolean",
"default": false
},
"scope": {
"description": "Anchor name that provides the search root.",
"type": "string"
},
"selector": {
"description": "Selector path. Matches the first element unless `multiple` is true.",
"type": "string"
},
"type": {
"type": "string",
"const": "Extract"
}
},
"required": [
"type",
"key",
"scope",
"selector"
]
},
{
"description": "Evaluate a simple expression and store the result under `key`.\n\nThe expression language supports arithmetic (`+`, `-`, `*`, `/`, `%`),\ncomparison operators (`==`, `<`, `<=`, `>`, `>=`), logical operators\n(`&&`, `||`, both requiring `Bool` operands), parenthesised grouping,\nsingle-quoted string literals, numeric literals, variable references\n(`local.key` / bare identifier for locals, `param.key` for immutable\nworkflow params, `output.key` for the output buffer), and built-in\nfunctions (`split_lines`, `round`, `floor`, `ceil`, `min`, `max`,\n`trim`, `len`).\n\nThe result is always stored as a **local variable** (overwrite semantics).\nBare identifiers resolve from locals first, falling back to the output buffer.",
"type": "object",
"properties": {
"expr": {
"description": "Expression to evaluate.",
"type": "string"
},
"key": {
"description": "Key under which the result is stored in local variables.",
"type": "string"
},
"output": {
"description": "If set, also appends the result to the output buffer under this key.",
"type": [
"string",
"null"
],
"default": null
},
"type": {
"type": "string",
"const": "Eval"
}
},
"required": [
"type",
"key",
"expr"
]
},
{
"description": "Spawn an external process and wait for it to exit.\nStores the exit code as a string in locals under `__exec_exit_code__`.\nFails if the exit code is non-zero — use `on_failure: continue` to suppress.\nUse `ExecSucceeded` as the `expect` condition to detect success without failing the step.\n`{output.*}` and `{param.*}` tokens in `command` and `args` are substituted before execution.",
"type": "object",
"properties": {
"args": {
"description": "Arguments to pass to the process.",
"type": "array",
"default": [],
"items": {
"type": "string"
}
},
"command": {
"description": "Executable path or command name (resolved via PATH).",
"type": "string"
},
"key": {
"description": "If set, stdout is captured and each line stored in the output buffer under this key.",
"type": [
"string",
"null"
],
"default": null
},
"type": {
"type": "string",
"const": "Exec"
}
},
"required": [
"type",
"command"
]
},
{
"description": "Move a file from `source` to `destination`.\nFails if the destination already exists.\nCreates the destination directory if it does not exist.\n`{output.*}` tokens in both fields are substituted before execution.",
"type": "object",
"properties": {
"destination": {
"type": "string"
},
"source": {
"type": "string"
},
"type": {
"type": "string",
"const": "MoveFile"
}
},
"required": [
"type",
"source",
"destination"
]
},
{
"description": "Navigate the browser tab anchored to `scope` to `url`.\nPolls `document.readyState` until `\"complete\"` with a hardcoded 30s deadline\n(independent of the step's `timeout:`). `scope` must name a `Tab` anchor.",
"type": "object",
"properties": {
"scope": {
"type": "string"
},
"type": {
"type": "string",
"const": "BrowserNavigate"
},
"url": {
"type": "string"
}
},
"required": [
"type",
"scope",
"url"
]
},
{
"description": "Evaluate a JavaScript expression in the browser tab anchored to `scope`.\nStores the string result in the output buffer under `key`.\n`scope` must name a `Tab` anchor.",
"type": "object",
"properties": {
"expr": {
"type": "string"
},
"key": {
"description": "Output key to store the result. If omitted the result is discarded.",
"type": [
"string",
"null"
]
},
"scope": {
"type": "string"
},
"type": {
"type": "string",
"const": "BrowserEval"
}
},
"required": [
"type",
"scope",
"expr"
]
}
]
},
"AnchorKind": {
"description": "Lifetime tier of an anchor, controlling how it is resolved and what happens when it goes stale.",
"oneOf": [
{
"description": "Resolved against desktop application windows. A stale root anchor is a fatal error.",
"type": "string",
"const": "Root"
},
{
"description": "A top-level window that can appear and disappear during the workflow.\nResolved lazily on first use; going stale is not fatal. Use for transient\nwindows such as progress dialogs that may or may not be present.",
"type": "string",
"const": "Session"
},
{
"description": "Resolved within a parent anchor's subtree. Re-queried automatically when the cached\nhandle goes stale (e.g. after a page navigation or panel reload).",
"type": "string",
"const": "Stable"
},
{
"description": "Short-lived anchor declared in a phase's `mount` list. Released when the phase exits.",
"type": "string",
"const": "Ephemeral"
},
{
"description": "A CDP browser session (Edge). Calls `browser.ensure()` on mount; stores the\nEdge window as a Root UIA anchor so UIA actions can target it normally.",
"type": "string",
"const": "Browser"
},
{
"description": "A specific browser tab. `parent` must name a `Browser` anchor.\nOmit `selector` (or use `\"*\"`) — open a new blank tab (or reuse an existing New Tab page);\nnavigate via a `BrowserNavigate` action. Closed on unmount.\nSet `selector` — attach to an existing tab matched by title/url. Left open on unmount.",
"type": "string",
"const": "Tab"
}
]
},
"ClickType": {
"description": "Type of mouse click to perform.",
"type": "string",
"enum": [
"left",
"double",
"triple",
"right",
"middle"
]
},
"Condition": {
"oneOf": [
{
"description": "True when the selector matches at least one live element under the scope anchor.",
"type": "object",
"properties": {
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"selector": {
"description": "Selector path within the scope anchor.",
"type": "string"
},
"type": {
"const": "ElementFound"
}
},
"additionalProperties": false,
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "True when the matched element is not greyed out (UIA IsEnabled).",
"type": "object",
"properties": {
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"selector": {
"description": "Selector path within the scope anchor.",
"type": "string"
},
"type": {
"const": "ElementEnabled"
}
},
"additionalProperties": false,
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "True when the matched element is visible on screen (UIA IsOffscreen=false).",
"type": "object",
"properties": {
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"selector": {
"description": "Selector path within the scope anchor.",
"type": "string"
},
"type": {
"const": "ElementVisible"
}
},
"additionalProperties": false,
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "True when the matched element has at least one child element.",
"type": "object",
"properties": {
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"selector": {
"description": "Selector path within the scope anchor.",
"type": "string"
},
"type": {
"const": "ElementHasChildren"
}
},
"additionalProperties": false,
"required": [
"type",
"scope",
"selector"
]
},
{
"description": "True when the matched element's text value satisfies the pattern.",
"type": "object",
"properties": {
"pattern": {
"$ref": "#/$defs/TextMatch"
},
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"selector": {
"description": "Selector path within the scope anchor.",
"type": "string"
},
"type": {
"const": "ElementHasText"
}
},
"additionalProperties": false,
"required": [
"type",
"scope",
"selector",
"pattern"
]
},
{
"description": "True when any open application window matches all specified attributes. Requires at least one of: title, automation_id, pid. `process` is an optional filter.",
"type": "object",
"properties": {
"automation_id": {
"description": "UIA AutomationId must match exactly.",
"type": "string"
},
"pid": {
"description": "Process ID to match exactly.",
"type": "integer",
"minimum": 0
},
"process": {
"description": "Optional: restrict to windows belonging to this process (name without .exe, case-insensitive).",
"type": "string"
},
"title": {
"$ref": "#/$defs/TitleMatch"
},
"type": {
"const": "WindowWithAttribute"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
{
"description": "True when any application window belongs to a process whose name (without .exe) matches, case-insensitive.",
"type": "object",
"properties": {
"process": {
"description": "Process name without .exe (e.g. \"notepad\").",
"type": "string"
},
"type": {
"const": "ProcessRunning"
}
},
"additionalProperties": false,
"required": [
"type",
"process"
]
},
{
"description": "True when the anchor's window is in the given state. Use after ActivateWindow (active) or to confirm a window is not minimized (visible).",
"type": "object",
"properties": {
"anchor": {
"description": "Name of the anchor whose window is tracked.",
"type": "string"
},
"state": {
"description": "active: a window belonging to the same process as the anchor is the OS foreground window. visible: the anchor's window is visible on screen (not minimized or hidden).",
"type": "string",
"enum": [
"active",
"visible"
]
},
"type": {
"const": "WindowWithState"
}
},
"additionalProperties": false,
"required": [
"type",
"anchor",
"state"
]
},
{
"description": "True when the anchor's window is no longer present. HWND-locked anchors check that specific window handle; PID-only anchors check for any window of that process; unresolved anchors treat re-resolution failure as closed.",
"type": "object",
"properties": {
"anchor": {
"description": "Name of the anchor whose window is tracked.",
"type": "string"
},
"type": {
"const": "WindowClosed"
}
},
"additionalProperties": false,
"required": [
"type",
"anchor"
]
},
{
"description": "True when a direct child of the scope anchor's window has role=\"dialog\".",
"type": "object",
"properties": {
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"type": {
"const": "DialogPresent"
}
},
"additionalProperties": false,
"required": [
"type",
"scope"
]
},
{
"description": "True when no direct child of the scope anchor's window has role=\"dialog\".",
"type": "object",
"properties": {
"scope": {
"description": "Anchor name to resolve the element tree from.",
"type": "string"
},
"type": {
"const": "DialogAbsent"
}
},
"additionalProperties": false,
"required": [
"type",
"scope"
]
},
{
"description": "True when the OS foreground window has role=dialog. Optionally also checks the dialog title.",
"type": "object",
"properties": {
"title": {
"$ref": "#/$defs/TitleMatch"
},
"type": {
"const": "ForegroundIsDialog"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
{
"description": "True when the most recent Exec action exited with code 0.",
"type": "object",
"properties": {
"type": {
"const": "ExecSucceeded"
}
},
"additionalProperties": false,
"required": [
"type"
]
},
{
"description": "Evaluates a boolean expression against the current outputs, locals, and params. The expression must return a Bool (use a comparison operator), e.g. \"output.count != '0'\".",
"type": "object",
"properties": {
"expr": {
"description": "Boolean expression to evaluate.",
"type": "string"
},
"type": {
"const": "EvalCondition"
}
},
"additionalProperties": false,
"required": [
"type",
"expr"
]
},
{
"description": "True when the file at `path` exists on disk. `path` supports `{output.*}` substitution.",
"type": "object",
"properties": {
"path": {
"description": "File path to check. Supports `{output.*}` substitution.",