openadapt-ml 0.1.0__py3-none-any.whl → 0.2.1__py3-none-any.whl

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 (112) hide show
  1. openadapt_ml/baselines/__init__.py +121 -0
  2. openadapt_ml/baselines/adapter.py +185 -0
  3. openadapt_ml/baselines/cli.py +314 -0
  4. openadapt_ml/baselines/config.py +448 -0
  5. openadapt_ml/baselines/parser.py +922 -0
  6. openadapt_ml/baselines/prompts.py +787 -0
  7. openadapt_ml/benchmarks/__init__.py +13 -107
  8. openadapt_ml/benchmarks/agent.py +297 -374
  9. openadapt_ml/benchmarks/azure.py +62 -24
  10. openadapt_ml/benchmarks/azure_ops_tracker.py +521 -0
  11. openadapt_ml/benchmarks/cli.py +1874 -751
  12. openadapt_ml/benchmarks/trace_export.py +631 -0
  13. openadapt_ml/benchmarks/viewer.py +1236 -0
  14. openadapt_ml/benchmarks/vm_monitor.py +1111 -0
  15. openadapt_ml/benchmarks/waa_deploy/Dockerfile +216 -0
  16. openadapt_ml/benchmarks/waa_deploy/__init__.py +10 -0
  17. openadapt_ml/benchmarks/waa_deploy/api_agent.py +540 -0
  18. openadapt_ml/benchmarks/waa_deploy/start_waa_server.bat +53 -0
  19. openadapt_ml/cloud/azure_inference.py +3 -5
  20. openadapt_ml/cloud/lambda_labs.py +722 -307
  21. openadapt_ml/cloud/local.py +3194 -89
  22. openadapt_ml/cloud/ssh_tunnel.py +595 -0
  23. openadapt_ml/datasets/next_action.py +125 -96
  24. openadapt_ml/evals/grounding.py +32 -9
  25. openadapt_ml/evals/plot_eval_metrics.py +15 -13
  26. openadapt_ml/evals/trajectory_matching.py +120 -57
  27. openadapt_ml/experiments/demo_prompt/__init__.py +19 -0
  28. openadapt_ml/experiments/demo_prompt/format_demo.py +236 -0
  29. openadapt_ml/experiments/demo_prompt/results/experiment_20251231_002125.json +83 -0
  30. openadapt_ml/experiments/demo_prompt/results/experiment_n30_20251231_165958.json +1100 -0
  31. openadapt_ml/experiments/demo_prompt/results/multistep_20251231_025051.json +182 -0
  32. openadapt_ml/experiments/demo_prompt/run_experiment.py +541 -0
  33. openadapt_ml/experiments/representation_shootout/__init__.py +70 -0
  34. openadapt_ml/experiments/representation_shootout/conditions.py +708 -0
  35. openadapt_ml/experiments/representation_shootout/config.py +390 -0
  36. openadapt_ml/experiments/representation_shootout/evaluator.py +659 -0
  37. openadapt_ml/experiments/representation_shootout/runner.py +687 -0
  38. openadapt_ml/experiments/waa_demo/__init__.py +10 -0
  39. openadapt_ml/experiments/waa_demo/demos.py +357 -0
  40. openadapt_ml/experiments/waa_demo/runner.py +732 -0
  41. openadapt_ml/experiments/waa_demo/tasks.py +151 -0
  42. openadapt_ml/export/__init__.py +9 -0
  43. openadapt_ml/export/__main__.py +6 -0
  44. openadapt_ml/export/cli.py +89 -0
  45. openadapt_ml/export/parquet.py +277 -0
  46. openadapt_ml/grounding/detector.py +18 -14
  47. openadapt_ml/ingest/__init__.py +11 -10
  48. openadapt_ml/ingest/capture.py +97 -86
  49. openadapt_ml/ingest/loader.py +120 -69
  50. openadapt_ml/ingest/synthetic.py +344 -193
  51. openadapt_ml/models/api_adapter.py +14 -4
  52. openadapt_ml/models/base_adapter.py +10 -2
  53. openadapt_ml/models/providers/__init__.py +288 -0
  54. openadapt_ml/models/providers/anthropic.py +266 -0
  55. openadapt_ml/models/providers/base.py +299 -0
  56. openadapt_ml/models/providers/google.py +376 -0
  57. openadapt_ml/models/providers/openai.py +342 -0
  58. openadapt_ml/models/qwen_vl.py +46 -19
  59. openadapt_ml/perception/__init__.py +35 -0
  60. openadapt_ml/perception/integration.py +399 -0
  61. openadapt_ml/retrieval/README.md +226 -0
  62. openadapt_ml/retrieval/USAGE.md +391 -0
  63. openadapt_ml/retrieval/__init__.py +91 -0
  64. openadapt_ml/retrieval/demo_retriever.py +843 -0
  65. openadapt_ml/retrieval/embeddings.py +630 -0
  66. openadapt_ml/retrieval/index.py +194 -0
  67. openadapt_ml/retrieval/retriever.py +162 -0
  68. openadapt_ml/runtime/__init__.py +50 -0
  69. openadapt_ml/runtime/policy.py +27 -14
  70. openadapt_ml/runtime/safety_gate.py +471 -0
  71. openadapt_ml/schema/__init__.py +113 -0
  72. openadapt_ml/schema/converters.py +588 -0
  73. openadapt_ml/schema/episode.py +470 -0
  74. openadapt_ml/scripts/capture_screenshots.py +530 -0
  75. openadapt_ml/scripts/compare.py +102 -61
  76. openadapt_ml/scripts/demo_policy.py +4 -1
  77. openadapt_ml/scripts/eval_policy.py +19 -14
  78. openadapt_ml/scripts/make_gif.py +1 -1
  79. openadapt_ml/scripts/prepare_synthetic.py +16 -17
  80. openadapt_ml/scripts/train.py +98 -75
  81. openadapt_ml/segmentation/README.md +920 -0
  82. openadapt_ml/segmentation/__init__.py +97 -0
  83. openadapt_ml/segmentation/adapters/__init__.py +5 -0
  84. openadapt_ml/segmentation/adapters/capture_adapter.py +420 -0
  85. openadapt_ml/segmentation/annotator.py +610 -0
  86. openadapt_ml/segmentation/cache.py +290 -0
  87. openadapt_ml/segmentation/cli.py +674 -0
  88. openadapt_ml/segmentation/deduplicator.py +656 -0
  89. openadapt_ml/segmentation/frame_describer.py +788 -0
  90. openadapt_ml/segmentation/pipeline.py +340 -0
  91. openadapt_ml/segmentation/schemas.py +622 -0
  92. openadapt_ml/segmentation/segment_extractor.py +634 -0
  93. openadapt_ml/training/azure_ops_viewer.py +1097 -0
  94. openadapt_ml/training/benchmark_viewer.py +3255 -19
  95. openadapt_ml/training/shared_ui.py +7 -7
  96. openadapt_ml/training/stub_provider.py +57 -35
  97. openadapt_ml/training/trainer.py +255 -441
  98. openadapt_ml/training/trl_trainer.py +403 -0
  99. openadapt_ml/training/viewer.py +323 -108
  100. openadapt_ml/training/viewer_components.py +180 -0
  101. {openadapt_ml-0.1.0.dist-info → openadapt_ml-0.2.1.dist-info}/METADATA +312 -69
  102. openadapt_ml-0.2.1.dist-info/RECORD +116 -0
  103. openadapt_ml/benchmarks/base.py +0 -366
  104. openadapt_ml/benchmarks/data_collection.py +0 -432
  105. openadapt_ml/benchmarks/runner.py +0 -381
  106. openadapt_ml/benchmarks/waa.py +0 -704
  107. openadapt_ml/schemas/__init__.py +0 -53
  108. openadapt_ml/schemas/sessions.py +0 -122
  109. openadapt_ml/schemas/validation.py +0 -252
  110. openadapt_ml-0.1.0.dist-info/RECORD +0 -55
  111. {openadapt_ml-0.1.0.dist-info → openadapt_ml-0.2.1.dist-info}/WHEEL +0 -0
  112. {openadapt_ml-0.1.0.dist-info → openadapt_ml-0.2.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,357 @@
1
+ """Demonstrations for WAA tasks.
2
+
3
+ Each demo follows the format:
4
+ DEMONSTRATION:
5
+ Goal: [Task instruction]
6
+
7
+ Step N:
8
+ [Screen: UI description]
9
+ [Action: ACTION_TYPE(parameters)]
10
+ [Result: What changed]
11
+
12
+ 7 manual demos + 3 placeholder for recorded demos.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ from typing import Optional
18
+
19
+ # =============================================================================
20
+ # TASK 1: Enable Do Not Track in Edge
21
+ # =============================================================================
22
+ DEMO_1_DO_NOT_TRACK = """DEMONSTRATION:
23
+ Goal: Enable the 'Do Not Track' feature in Edge
24
+
25
+ Step 1:
26
+ [Screen: Microsoft Edge browser with a webpage open. Three-dot menu icon visible in top-right corner of toolbar.]
27
+ [Action: CLICK(three-dot menu icon "Settings and more" in top-right)]
28
+ [Result: Dropdown menu appears with options like New tab, New window, Settings, etc.]
29
+
30
+ Step 2:
31
+ [Screen: Edge dropdown menu open showing various options]
32
+ [Action: CLICK("Settings" option in the menu)]
33
+ [Result: Settings page opens in a new tab]
34
+
35
+ Step 3:
36
+ [Screen: Edge Settings page with left sidebar showing categories: Profiles, Privacy/security/services, Appearance, etc.]
37
+ [Action: CLICK("Privacy, search, and services" in left sidebar)]
38
+ [Result: Privacy settings panel displays on right side]
39
+
40
+ Step 4:
41
+ [Screen: Privacy settings panel with sections for Tracking prevention, Privacy, Security]
42
+ [Action: SCROLL(down) to find "Privacy" section with "Send 'Do Not Track' requests" toggle]
43
+ [Result: "Send 'Do Not Track' requests" toggle becomes visible]
44
+
45
+ Step 5:
46
+ [Screen: Privacy section visible with "Send 'Do Not Track' requests" toggle currently OFF]
47
+ [Action: CLICK(toggle switch next to "Send 'Do Not Track' requests")]
48
+ [Result: Toggle switches to ON position, Do Not Track is now enabled]
49
+ """
50
+
51
+ # =============================================================================
52
+ # TASK 2: Save Webpage to Bookmarks Bar
53
+ # =============================================================================
54
+ DEMO_2_BOOKMARK = """DEMONSTRATION:
55
+ Goal: Save this webpage to bookmarks bar
56
+
57
+ Step 1:
58
+ [Screen: Microsoft Edge browser with a webpage loaded. Star icon visible in the address bar on the right side.]
59
+ [Action: CLICK(star icon in address bar)]
60
+ [Result: "Favorite added" popup appears with name field and folder dropdown]
61
+
62
+ Step 2:
63
+ [Screen: Bookmark popup showing Name field (auto-filled with page title), Folder dropdown, and Done/Remove buttons]
64
+ [Action: CLICK(Folder dropdown to expand it)]
65
+ [Result: Dropdown shows folder options including "Favorites bar", "Other favorites", etc.]
66
+
67
+ Step 3:
68
+ [Screen: Folder dropdown expanded showing available bookmark folders]
69
+ [Action: CLICK("Favorites bar" option)]
70
+ [Result: "Favorites bar" is selected as the target folder]
71
+
72
+ Step 4:
73
+ [Screen: Bookmark popup with "Favorites bar" selected as folder]
74
+ [Action: CLICK("Done" button)]
75
+ [Result: Bookmark is saved to favorites bar, popup closes, page bookmark icon now filled]
76
+ """
77
+
78
+ # =============================================================================
79
+ # TASK 3: Set Font Size to Largest in Edge
80
+ # =============================================================================
81
+ DEMO_3_FONT_SIZE = """DEMONSTRATION:
82
+ Goal: Set default font size to largest for grandmother
83
+
84
+ Step 1:
85
+ [Screen: Microsoft Edge browser open. Three-dot menu icon in top-right corner.]
86
+ [Action: CLICK(three-dot menu icon "Settings and more")]
87
+ [Result: Dropdown menu appears]
88
+
89
+ Step 2:
90
+ [Screen: Edge dropdown menu visible]
91
+ [Action: CLICK("Settings" in the menu)]
92
+ [Result: Settings page opens]
93
+
94
+ Step 3:
95
+ [Screen: Edge Settings page with left sidebar showing categories]
96
+ [Action: CLICK("Appearance" in left sidebar)]
97
+ [Result: Appearance settings panel displays]
98
+
99
+ Step 4:
100
+ [Screen: Appearance settings showing Fonts section with "Font size" dropdown showing current size (e.g., "Medium")]
101
+ [Action: CLICK(Font size dropdown)]
102
+ [Result: Dropdown expands showing options: Very small, Small, Medium, Large, Very large]
103
+
104
+ Step 5:
105
+ [Screen: Font size dropdown expanded with size options visible]
106
+ [Action: CLICK("Very large" option)]
107
+ [Result: Font size is set to Very large, dropdown closes, text on pages will now appear larger]
108
+ """
109
+
110
+ # =============================================================================
111
+ # TASK 4: Fill Blank Cells - PLACEHOLDER (requires recorded demo)
112
+ # =============================================================================
113
+ DEMO_4_FILL_BLANKS = """DEMONSTRATION:
114
+ Goal: Fill all blank cells with value from cell above
115
+
116
+ [PLACEHOLDER - This demo requires recording on Windows]
117
+ [Complex task involving: Select range, Go To Special, Blanks, Formula, Ctrl+Enter]
118
+
119
+ Key steps outline:
120
+ 1. Select the data range containing blank cells
121
+ 2. Press Ctrl+G or go to Edit > Go To
122
+ 3. Click "Special" button
123
+ 4. Select "Empty cells" option
124
+ 5. Click OK to select all blank cells
125
+ 6. Type formula =A1 (or reference to cell above)
126
+ 7. Press Ctrl+Enter to fill all selected cells
127
+ """
128
+
129
+ # =============================================================================
130
+ # TASK 5: Calculate Totals and Create Chart - PLACEHOLDER (requires recorded demo)
131
+ # =============================================================================
132
+ DEMO_5_CHART = """DEMONSTRATION:
133
+ Goal: Calculate monthly totals and create line chart
134
+
135
+ [PLACEHOLDER - This demo requires recording on Windows]
136
+ [Complex task involving: SUM formulas, data selection, chart wizard, line chart type]
137
+
138
+ Key steps outline:
139
+ 1. Navigate to the row below the data
140
+ 2. Type "Total" in label column
141
+ 3. Enter =SUM() formula for first data column
142
+ 4. Copy formula across all columns
143
+ 5. Select entire data range including headers and totals
144
+ 6. Go to Insert > Chart
145
+ 7. Select "Line" chart type
146
+ 8. Configure chart options and finish
147
+ """
148
+
149
+ # =============================================================================
150
+ # TASK 6: Center Align Heading in LibreOffice Writer
151
+ # =============================================================================
152
+ DEMO_6_CENTER_ALIGN = """DEMONSTRATION:
153
+ Goal: Center align the heading in LibreOffice Writer
154
+
155
+ Step 1:
156
+ [Screen: LibreOffice Writer document open with text content. Heading text visible at top. Formatting toolbar shows alignment buttons (left, center, right, justify).]
157
+ [Action: CLICK(anywhere in the heading line to place cursor)]
158
+ [Result: Cursor is now in the heading paragraph]
159
+
160
+ Step 2:
161
+ [Screen: Cursor is in heading line. Center align button (lines centered icon) visible in toolbar.]
162
+ [Action: CLICK(Center align button in formatting toolbar)]
163
+ [Result: Heading text is now centered on the page]
164
+
165
+ Alternative using keyboard:
166
+ Step 1:
167
+ [Action: CLICK(in heading line)]
168
+ Step 2:
169
+ [Action: KEY(Ctrl+E)]
170
+ [Result: Heading is centered]
171
+ """
172
+
173
+ # =============================================================================
174
+ # TASK 7: Turn Off System Notifications
175
+ # =============================================================================
176
+ DEMO_7_NOTIFICATIONS = """DEMONSTRATION:
177
+ Goal: Turn off notifications for system
178
+
179
+ Step 1:
180
+ [Screen: Windows 11 desktop with taskbar at bottom. Start button visible on left side of taskbar.]
181
+ [Action: CLICK(Start button in taskbar)]
182
+ [Result: Start menu opens showing pinned apps and search bar]
183
+
184
+ Step 2:
185
+ [Screen: Start menu open with search bar at top, pinned apps below]
186
+ [Action: CLICK(Settings gear icon in pinned apps) OR TYPE("Settings") in search]
187
+ [Result: Settings app launches]
188
+
189
+ Step 3:
190
+ [Screen: Windows Settings app open showing main categories: System, Bluetooth, Network, etc.]
191
+ [Action: CLICK("System" category)]
192
+ [Result: System settings panel opens]
193
+
194
+ Step 4:
195
+ [Screen: System settings showing options: Display, Sound, Notifications, Focus, Power, etc.]
196
+ [Action: CLICK("Notifications" in the list)]
197
+ [Result: Notifications settings page opens]
198
+
199
+ Step 5:
200
+ [Screen: Notifications settings showing main toggle "Notifications" at top, followed by per-app settings]
201
+ [Action: CLICK(main "Notifications" toggle switch to turn it OFF)]
202
+ [Result: Toggle switches to Off, all system notifications are now disabled]
203
+ """
204
+
205
+ # =============================================================================
206
+ # TASK 8: Configure Night Light Schedule
207
+ # =============================================================================
208
+ DEMO_8_NIGHT_LIGHT = """DEMONSTRATION:
209
+ Goal: Enable the "Night light" feature and set it to turn on at 7:00 PM and off at 7:00 AM
210
+
211
+ Step 1:
212
+ [Screen: Windows 11 desktop with taskbar visible]
213
+ [Action: CLICK(Start button) OR press KEY(Windows key)]
214
+ [Result: Start menu opens]
215
+
216
+ Step 2:
217
+ [Screen: Start menu open]
218
+ [Action: CLICK(Settings gear icon)]
219
+ [Result: Settings app opens]
220
+
221
+ Step 3:
222
+ [Screen: Windows Settings main page with categories]
223
+ [Action: CLICK("System" on the left)]
224
+ [Result: System settings displayed]
225
+
226
+ Step 4:
227
+ [Screen: System settings with Display highlighted at top]
228
+ [Action: CLICK("Display" option)]
229
+ [Result: Display settings panel opens]
230
+
231
+ Step 5:
232
+ [Screen: Display settings showing Night light option with toggle and ">" arrow for more options]
233
+ [Action: CLICK("Night light" row or the arrow to expand settings)]
234
+ [Result: Night light settings panel opens]
235
+
236
+ Step 6:
237
+ [Screen: Night light settings showing: Turn on now button, Strength slider, Schedule night light toggle]
238
+ [Action: CLICK("Schedule night light" toggle to enable it)]
239
+ [Result: Schedule options appear with Turn on/Turn off time fields]
240
+
241
+ Step 7:
242
+ [Screen: Schedule section now visible with "Turn on" time field and "Turn off" time field]
243
+ [Action: CLICK("Turn on" time field)]
244
+ [Result: Time picker opens or field becomes editable]
245
+
246
+ Step 8:
247
+ [Screen: Time picker or editable time field for Turn on time]
248
+ [Action: TYPE("7:00 PM") or use time picker to set 7:00 PM]
249
+ [Result: Turn on time is set to 7:00 PM]
250
+
251
+ Step 9:
252
+ [Screen: Turn on time set to 7:00 PM, Turn off time field visible]
253
+ [Action: CLICK("Turn off" time field)]
254
+ [Result: Time picker opens for Turn off time]
255
+
256
+ Step 10:
257
+ [Screen: Time picker for Turn off time]
258
+ [Action: TYPE("7:00 AM") or use time picker to set 7:00 AM]
259
+ [Result: Turn off time is set to 7:00 AM, Night light schedule is fully configured]
260
+ """
261
+
262
+ # =============================================================================
263
+ # TASK 9: Create Archive Folder and Move Files - PLACEHOLDER (requires recorded demo)
264
+ # =============================================================================
265
+ DEMO_9_ARCHIVE = """DEMONSTRATION:
266
+ Goal: Create Archive folder and move all .docx files
267
+
268
+ [PLACEHOLDER - This demo requires recording on Windows]
269
+ [Medium complexity: right-click context menu, folder creation, file selection, drag/move]
270
+
271
+ Key steps outline:
272
+ 1. In File Explorer, right-click on empty space in the current folder
273
+ 2. Select "New" > "Folder" from context menu
274
+ 3. Type "Archive" as folder name, press Enter
275
+ 4. Click on a .docx file to start selection
276
+ 5. Hold Ctrl and click each .docx file to select all
277
+ OR use filter/search to show only .docx files then Ctrl+A
278
+ 6. Right-click on selection and choose "Cut" (or Ctrl+X)
279
+ 7. Double-click Archive folder to open it
280
+ 8. Right-click and "Paste" (or Ctrl+V)
281
+ """
282
+
283
+ # =============================================================================
284
+ # TASK 10: Change to Details View in File Explorer
285
+ # =============================================================================
286
+ DEMO_10_DETAILS_VIEW = """DEMONSTRATION:
287
+ Goal: Change view to Details view
288
+
289
+ Step 1:
290
+ [Screen: File Explorer window open showing files/folders. Toolbar at top with View button/dropdown visible.]
291
+ [Action: CLICK("View" button or dropdown in the toolbar)]
292
+ [Result: View options appear showing: Extra large icons, Large icons, Medium icons, Small icons, List, Details, Tiles, Content]
293
+
294
+ Step 2:
295
+ [Screen: View options dropdown/menu expanded showing all view choices]
296
+ [Action: CLICK("Details" option)]
297
+ [Result: File Explorer switches to Details view showing columns: Name, Date modified, Type, Size]
298
+
299
+ Alternative (Windows 11 compact view):
300
+ Step 1:
301
+ [Screen: File Explorer with Layout section in View menu]
302
+ [Action: CLICK(View dropdown arrow in toolbar)]
303
+ Step 2:
304
+ [Action: CLICK("Details" in the layout options)]
305
+ [Result: View changes to Details with file information columns]
306
+ """
307
+
308
+ # =============================================================================
309
+ # Demo Registry
310
+ # =============================================================================
311
+ DEMOS: dict[str, str] = {
312
+ "1": DEMO_1_DO_NOT_TRACK,
313
+ "2": DEMO_2_BOOKMARK,
314
+ "3": DEMO_3_FONT_SIZE,
315
+ "4": DEMO_4_FILL_BLANKS, # Placeholder
316
+ "5": DEMO_5_CHART, # Placeholder
317
+ "6": DEMO_6_CENTER_ALIGN,
318
+ "7": DEMO_7_NOTIFICATIONS,
319
+ "8": DEMO_8_NIGHT_LIGHT,
320
+ "9": DEMO_9_ARCHIVE, # Placeholder
321
+ "10": DEMO_10_DETAILS_VIEW,
322
+ }
323
+
324
+
325
+ def get_demo(task_num: str | int) -> Optional[str]:
326
+ """Get a demo by task number (1-10)."""
327
+ return DEMOS.get(str(task_num))
328
+
329
+
330
+ def get_complete_demos() -> dict[str, str]:
331
+ """Get only demos that are fully written (not placeholders)."""
332
+ return {k: v for k, v in DEMOS.items() if "[PLACEHOLDER" not in v}
333
+
334
+
335
+ def get_placeholder_demos() -> dict[str, str]:
336
+ """Get demos that need to be recorded."""
337
+ return {k: v for k, v in DEMOS.items() if "[PLACEHOLDER" in v}
338
+
339
+
340
+ def format_demo_for_prompt(demo: str, task_instruction: str) -> str:
341
+ """Format a demo for inclusion in an LLM prompt.
342
+
343
+ Args:
344
+ demo: The demo text
345
+ task_instruction: The current task instruction
346
+
347
+ Returns:
348
+ Formatted demo with context header
349
+ """
350
+ return f"""The following demonstration shows how to complete a similar task.
351
+ Use it as a reference for understanding the UI navigation pattern.
352
+
353
+ {demo}
354
+
355
+ ---
356
+ Now complete this task: {task_instruction}
357
+ """