@capagents/forgeqe 3.1.2 → 3.1.3

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 (170) hide show
  1. package/HOW_TO_USE.md +5003 -2077
  2. package/README.md +155 -449
  3. package/dist/docs-site/docs/app-theme.css +30 -9
  4. package/dist/docs-site/docs/architecture/index.html +45 -515
  5. package/dist/docs-site/docs/architecture-reference/index.html +1781 -0
  6. package/dist/docs-site/docs/area-api/index.html +257 -116
  7. package/dist/docs-site/docs/area-automated-tests/index.html +1229 -419
  8. package/dist/docs-site/docs/area-browser/index.html +167 -125
  9. package/dist/docs-site/docs/area-data/index.html +178 -188
  10. package/dist/docs-site/docs/area-desktop/index.html +329 -282
  11. package/dist/docs-site/docs/area-mobile/index.html +138 -86
  12. package/dist/docs-site/docs/area-operations/index.html +567 -393
  13. package/dist/docs-site/docs/area-pull-requests/index.html +114 -32
  14. package/dist/docs-site/docs/area-quality/index.html +111 -49
  15. package/dist/docs-site/docs/area-release/index.html +180 -65
  16. package/dist/docs-site/docs/area-setup/index.html +742 -339
  17. package/dist/docs-site/docs/area-systems/index.html +32 -48
  18. package/dist/docs-site/docs/area-test-cases/index.html +387 -154
  19. package/dist/docs-site/docs/containers/index.html +87 -101
  20. package/dist/docs-site/docs/cost-architecture/index.html +4 -3
  21. package/dist/docs-site/docs/custom-agents-first-run/index.html +108 -50
  22. package/dist/docs-site/docs/desktop/index.html +277 -297
  23. package/dist/docs-site/docs/desktop-ci/index.html +15 -5
  24. package/dist/docs-site/docs/docs-tabs.js +56 -0
  25. package/dist/docs-site/docs/evidence/index.html +50 -49
  26. package/dist/docs-site/docs/feature-test-prompts/index.html +34 -24
  27. package/dist/docs-site/docs/get-started/index.html +464 -168
  28. package/dist/docs-site/docs/graphify/index.html +8 -7
  29. package/dist/docs-site/docs/guardrails/index.html +20 -4
  30. package/dist/docs-site/docs/index.html +4 -3
  31. package/dist/docs-site/docs/mobile/index.html +96 -76
  32. package/dist/docs-site/docs/model-routing/index.html +44 -18
  33. package/dist/docs-site/docs/overview/index.html +23 -7
  34. package/dist/docs-site/docs/product-graph/index.html +13 -12
  35. package/dist/docs-site/docs/product-knowledge/index.html +16 -5
  36. package/dist/docs-site/docs/product-views/index.html +7 -6
  37. package/dist/docs-site/docs/reference/index.html +95 -65
  38. package/dist/docs-site/docs/search.js +1 -1
  39. package/dist/docs-site/docs/using/index.html +444 -126
  40. package/dist/docs-site/docs/web-app/index.html +54 -51
  41. package/dist/forgeqe.js +1822 -1822
  42. package/dist/web/assets/Agent-3pV8Rwap.js +8 -0
  43. package/dist/web/assets/AgentWork-DAnmH0My.js +2 -0
  44. package/dist/web/assets/ApiTests-DW4MRFzG.js +10 -0
  45. package/dist/web/assets/Browse-Bd0ZZfc2.js +1 -0
  46. package/dist/web/assets/Chat-DnBUm_97.js +3 -0
  47. package/dist/web/assets/CommandPalette-B1O9aDTk.js +1 -0
  48. package/dist/web/assets/Compare-1v7_ca7z.js +1 -0
  49. package/dist/web/assets/Cost-CWrc4McH.js +1 -0
  50. package/dist/web/assets/Data-rWSiG4Cq.js +6 -0
  51. package/dist/web/assets/Desktop-3x6EQqos.js +1 -0
  52. package/dist/web/assets/DesktopReview-cSA10Rm3.js +1 -0
  53. package/dist/web/assets/Evidence-CKy3o7cw.js +1 -0
  54. package/dist/web/assets/{Explore-ObkEpUyS.js → Explore-CMAxWE_8.js} +2 -2
  55. package/dist/web/assets/Features-haQchkhA.js +1 -0
  56. package/dist/web/assets/{Flags-0-RniPJm.js → Flags-BaQjYi_t.js} +2 -2
  57. package/dist/web/assets/Flaky-DUuC0qTn.js +1 -0
  58. package/dist/web/assets/Impact-CP0H8ygo.js +3 -0
  59. package/dist/web/assets/Jobs-cYxoYd3i.js +5 -0
  60. package/dist/web/assets/KindPage-DWW8gN5_.js +6 -0
  61. package/dist/web/assets/Migration-Bsm7WU1d.js +2 -0
  62. package/dist/web/assets/PageAgent-c95zT2PJ.js +1 -0
  63. package/dist/web/assets/Product-BQSiR28a.js +7 -0
  64. package/dist/web/assets/Production-CAv0Vtoy.js +1 -0
  65. package/dist/web/assets/Quality-aQPaPYQc.js +1 -0
  66. package/dist/web/assets/Readiness-CkknP87n.js +1 -0
  67. package/dist/web/assets/Record-09IsC9U-.js +1 -0
  68. package/dist/web/assets/Regression-BL4MfN47.js +5 -0
  69. package/dist/web/assets/RelationGraph-Dg4fqt7l.js +1 -0
  70. package/dist/web/assets/Reports-CMV1l-iS.js +2 -0
  71. package/dist/web/assets/Response-DTBFBeKB.js +9 -0
  72. package/dist/web/assets/Responsive-DBRQ9FUO.js +3 -0
  73. package/dist/web/assets/RunDiff-CMDrnsA3.js +1 -0
  74. package/dist/web/assets/Runs-Dkeu6_vZ.js +2 -0
  75. package/dist/web/assets/Settings-KjKm8h-_.js +21 -0
  76. package/dist/web/assets/{Steps-D-YG0eJy.js → Steps-HYHK9psI.js} +1 -1
  77. package/dist/web/assets/TestCases-Cv6-OSv0.js +1 -0
  78. package/dist/web/assets/TestData-DbEfNlUE.js +2 -0
  79. package/dist/web/assets/TestDebt-DzHQIU4X.js +1 -0
  80. package/dist/web/assets/TestManagement-BgRTGHMT.js +1 -0
  81. package/dist/web/assets/Tosca-DZpHAtnH.js +3 -0
  82. package/dist/web/assets/WhatsNew-jp0c4WSV.js +1 -0
  83. package/dist/web/assets/coverage-BB9BLjGz.js +5 -0
  84. package/dist/web/assets/{dataParts-DbeCj9ga.js → dataParts-DEPK4eQE.js} +2 -2
  85. package/dist/web/assets/{diff-BStuTmsN.js → diff-CcNwLCX6.js} +1 -1
  86. package/dist/web/assets/{families-BBFFrUlo.js → families-gkpkloLT.js} +1 -1
  87. package/dist/web/assets/filters-C7phIFfd.js +1 -0
  88. package/dist/web/assets/fold-i73P-EDV.js +1 -0
  89. package/dist/web/assets/head-BtTqyLlj.js +1 -0
  90. package/dist/web/assets/{highlight-BcFZIf59.js → highlight-DZI39CzZ.js} +1 -1
  91. package/dist/web/assets/index-ClFOh63x.css +2 -0
  92. package/dist/web/assets/index-YGWJEkAT.js +64 -0
  93. package/dist/web/assets/input-C2vQ9O3a.js +1 -0
  94. package/dist/web/assets/logos-BmbNTDu2.js +1 -0
  95. package/dist/web/assets/palette-XFlqvgZl.js +1 -0
  96. package/dist/web/assets/{paletteCommands-Co-RlQ8q.js → paletteCommands-DsbD2ASU.js} +1 -1
  97. package/dist/web/assets/parts-DEVx2Sea.js +1 -0
  98. package/dist/web/assets/productParts-Bi-XjszL.js +1 -0
  99. package/dist/web/assets/qualityParts-Dbu01g7G.js +1 -0
  100. package/dist/web/assets/{recordTest-Cez2sDJO.js → recordTest--Wr40QdN.js} +1 -1
  101. package/dist/web/assets/route-Dg53WdFu.js +1 -0
  102. package/dist/web/index.html +6 -7
  103. package/docs/ARCHITECTURE.md +50 -563
  104. package/docs/ARCHITECTURE_REFERENCE.md +1484 -0
  105. package/docs/CONTAINERS.md +87 -87
  106. package/docs/CUSTOM_AGENTS_FIRST_RUN.md +125 -43
  107. package/docs/DESKTOP-CI.md +18 -3
  108. package/docs/DESKTOP.md +298 -297
  109. package/docs/MOBILE.md +103 -71
  110. package/docs/MODEL_ROUTING.md +48 -15
  111. package/docs/WEB_APP.md +49 -44
  112. package/docs/feature-test-prompts.md +29 -16
  113. package/docs/user-guide.html +5263 -2453
  114. package/guardrails/README.md +22 -2
  115. package/knowledge/README.md +15 -2
  116. package/package.json +1 -1
  117. package/prompts/brain.md +1 -0
  118. package/py/forgeqe_engine/recordsession.py +100 -24
  119. package/dist/web/assets/Agent-CPhmZdFX.js +0 -8
  120. package/dist/web/assets/AgentWork-BXdN9xgi.js +0 -2
  121. package/dist/web/assets/ApiTests-Do3xLjfB.js +0 -10
  122. package/dist/web/assets/Browse-WVkJT6Bs.js +0 -2
  123. package/dist/web/assets/Chat-CDc9UcQX.js +0 -3
  124. package/dist/web/assets/CommandPalette-BAZm62lV.js +0 -1
  125. package/dist/web/assets/Compare-Br6n9T9L.js +0 -1
  126. package/dist/web/assets/Cost-BBUyBu3Y.js +0 -1
  127. package/dist/web/assets/Data-Ch2DPEWp.js +0 -6
  128. package/dist/web/assets/Desktop-Qzoq-cQv.js +0 -1
  129. package/dist/web/assets/DesktopReview-CF_jQYAM.js +0 -1
  130. package/dist/web/assets/Evidence-C72Lj5_Q.js +0 -1
  131. package/dist/web/assets/Features-CQzNo_WP.js +0 -1
  132. package/dist/web/assets/Flaky-BPJvNLCA.js +0 -1
  133. package/dist/web/assets/Impact-CfccsL_k.js +0 -3
  134. package/dist/web/assets/Jobs-T6m4zhDy.js +0 -5
  135. package/dist/web/assets/KindPage-BDUvWe2p.js +0 -6
  136. package/dist/web/assets/Migration-Dqeh4x5u.js +0 -2
  137. package/dist/web/assets/PageAgent-DNjzIgeY.js +0 -1
  138. package/dist/web/assets/Product-nYV_scOV.js +0 -7
  139. package/dist/web/assets/Production-CGSbEWVa.js +0 -1
  140. package/dist/web/assets/Quality-BIypojZm.js +0 -1
  141. package/dist/web/assets/Readiness-BlRjwJRg.js +0 -1
  142. package/dist/web/assets/Record-v2KLI-_Z.js +0 -1
  143. package/dist/web/assets/Regression-B-jSt4Jz.js +0 -5
  144. package/dist/web/assets/RelationGraph-8J98lOVG.js +0 -1
  145. package/dist/web/assets/Reports-GI4u6SyW.js +0 -2
  146. package/dist/web/assets/Response-mhBThq2b.js +0 -9
  147. package/dist/web/assets/Responsive-DXu7Ra7K.js +0 -3
  148. package/dist/web/assets/RunDiff-D0SHDNp0.js +0 -1
  149. package/dist/web/assets/Runs-C1Gjdi9M.js +0 -2
  150. package/dist/web/assets/Settings-BGGeuvyF.js +0 -21
  151. package/dist/web/assets/TestCases-DC4w77eQ.js +0 -1
  152. package/dist/web/assets/TestData-CvKWRVVV.js +0 -2
  153. package/dist/web/assets/TestDebt-D8YzN29_.js +0 -1
  154. package/dist/web/assets/TestManagement-C5cDCqrD.js +0 -1
  155. package/dist/web/assets/Tosca-BGUv3RiJ.js +0 -3
  156. package/dist/web/assets/WhatsNew-B_Gyuv8O.js +0 -1
  157. package/dist/web/assets/coverage-BMP6ELFJ.js +0 -5
  158. package/dist/web/assets/filters-CnAMr286.js +0 -1
  159. package/dist/web/assets/fold-D_O_VZui.js +0 -1
  160. package/dist/web/assets/head-CRo48rPt.js +0 -1
  161. package/dist/web/assets/index-B3JsM7tv.js +0 -64
  162. package/dist/web/assets/index-CafApcbZ.css +0 -2
  163. package/dist/web/assets/input-CtzK50ZF.js +0 -1
  164. package/dist/web/assets/line-icons-rdF8DYDJ.js +0 -1
  165. package/dist/web/assets/logos-D4oVWzqa.js +0 -1
  166. package/dist/web/assets/palette-DAaGSao7.js +0 -1
  167. package/dist/web/assets/parts-D357Wolo.js +0 -1
  168. package/dist/web/assets/productParts-B8oHRCJF.js +0 -1
  169. package/dist/web/assets/qualityParts-BLkmIfDY.js +0 -1
  170. package/dist/web/assets/route-BloYJWgw.js +0 -1
package/docs/DESKTOP.md CHANGED
@@ -1,41 +1,63 @@
1
1
  # ForgeQE desktop: thick-client automation
2
2
 
3
- Status: runs on Windows. The live tests there install the engine and the pinned UFO², replay Notepad with the
4
- pywinauto driver and through `forgeqe desktop replay`, heal a moved control from the live window, and run a whole
5
- explore: UFO² drives Notepad with a scripted model behind an OpenAI-compatible server, the action is recorded with the
6
- control's AutomationId, and the recording replays. Not yet run: explore with a real model, and your own apps. See
3
+ ForgeQE tests web apps in Chrome. It tests desktop thick clients the same way: Win32, WinForms, WPF, and the native parts
4
+ of Electron and WebView2 apps. Say what you want in plain language, ForgeQE's agent does it in the live app, and the run
5
+ is saved as a YAML workflow that replays later with no model.
6
+
7
+ | Task | Windows | macOS | Linux |
8
+ |---|---|---|---|
9
+ | Explore a goal with the agent | yes | no | no |
10
+ | Record your own steps | yes | no | no |
11
+ | Replay a workflow | yes (also headless) | yes, macOS 13+ | yes, Ubuntu 24.04+ (X11 or Wayland) |
12
+ | Check a workflow without running it | yes | yes | yes |
13
+
14
+ Status: the Windows runs are tested end to end (setup, replay, healing a moved control, and a whole explore with a
15
+ scripted model). Not yet run by the ForgeQE team: explore with a real model, and your own apps. See
7
16
  [Before first use on Windows](#before-first-use-on-windows).
8
17
 
9
- ForgeQE drives web apps through Chrome. The desktop engine does the same for Windows thick clients (Win32, WinForms,
10
- WPF, and the native parts of Electron and WebView2 apps): say what you want in plain language, UFO² does it on the live
11
- app, and the run is saved as a YAML workflow that replays later without a model.
18
+ ## Use
12
19
 
13
- Workflows also replay on **macOS and Linux**, and headless on Windows, on Vercel Labs' agent-desktop. See
14
- [Replay on agent-desktop](#replay-on-agent-desktop-macos-linux-and-headless-windows). Exploring and recording by hand
15
- still need Windows.
20
+ **Setting up.** Once per computer, ForgeQE downloads and sets up what desktop testing needs. On Windows, include the
21
+ part for exploring a goal. Off Windows, setup always includes the replay part for macOS and Linux.
16
22
 
17
- ## Use
23
+ **Web app**
24
+
25
+ 1. Open **Desktop apps** and the **Machine and apps** tab.
26
+ 2. Press **Set up**.
27
+ 3. On Windows, turn on the switch for exploring a goal if you will explore. Turn on **Set it up again from scratch** to
28
+ start over.
29
+ 4. Press **Set up**.
30
+
31
+ **Terminal**
18
32
 
19
33
  ```bash
20
- forgeqe desktop setup --ufo # once, on Windows: the engine, pywinauto, and the pinned UFO²
21
- forgeqe desktop apps # what forgeqe.yaml allows
22
- forgeqe desktop explore "Create an invoice for Contoso, net 30" --app billing
23
- forgeqe desktop record --app billing # or do the steps yourself: no model, no UFO
24
- forgeqe desktop replay .forgeqe/reports/desktop-explore-…/workflow.yaml customer=Fabrikam
25
- forgeqe desktop replay workflow.yaml --data customers.csv # once per row; the header names the variables
26
- forgeqe desktop replay desktop-tests/ --junit results.xml # every workflow in a folder, results for CI
27
- forgeqe desktop replay workflow.yaml --update-baselines # save new baselines for its expect_image steps
28
- forgeqe desktop doctor # can this machine run replay unattended?
29
- forgeqe desktop validate workflow.yaml # any OS
34
+ forgeqe desktop setup --ufo # on Windows: replay, recording, and exploring a goal
35
+ forgeqe desktop setup # off Windows: replay for macOS and Linux
36
+ forgeqe desktop setup --agent-desktop # on Windows, to also replay headless (no mouse)
37
+ forgeqe desktop setup --force # set it up again from scratch
30
38
  ```
31
39
 
32
- Or ask ForgeQE's agent in the shell or `forgeqe run`: "create an invoice for Contoso in Billing and save it as a test",
33
- or "I'll show you the steps in Billing, record them". Its tools are `test_apps`, `desktop_explore`, `desktop_record`,
34
- `desktop_replay` and `desktop_edit_workflow`. It asks before it starts the app or takes over the desktop, and before it
35
- changes a workflow. Where it cannot ask (an MCP client), the call answers `needs_confirmation` until the user agrees.
40
+ **Adding an app.** Desktop apps come from the active environment in `env.yaml` (see HOW_TO_USE.md, "Environments and
41
+ apps"), or from `desktop.apps` in `forgeqe.yaml`, which works without environments. A workflow names an app only by its
42
+ name, never by a path or a command.
43
+
44
+ **Web app**
36
45
 
37
- Desktop apps come from the active environment in `env.yaml` (see HOW_TO_USE.md, "Environments and apps"), or from
38
- `desktop.apps` in `forgeqe.yaml`, which works without environments:
46
+ 1. Open **Desktop apps** and the **Machine and apps** tab.
47
+ 2. Press **Add an app**.
48
+ 3. Fill in **Program** (type its path, or press **Browse…**), **Arguments** (optional), **Name**, and **What it is for**
49
+ (optional: one line the agent reads to pick the app).
50
+ 4. Press **Add the app**.
51
+
52
+ Each app in the list has **Change** and **Remove** buttons. You can also add apps in **Settings › Environments**.
53
+
54
+ **Terminal**
55
+
56
+ ```bash
57
+ forgeqe desktop apps # the apps and secrets of the active environment and desktop:
58
+ ```
59
+
60
+ Edit `forgeqe.yaml` (or `env.yaml`) to add one:
39
61
 
40
62
  ```yaml
41
63
  desktop:
@@ -49,123 +71,177 @@ desktop:
49
71
  screenshots: true # one screenshot per replayed step (default on)
50
72
  ```
51
73
 
52
- Each run writes a folder under the reports folder (`desktop-explore-…` or `desktop-replay-…`): `run.json`,
53
- `report.html`, `steps/NNN.png`, and for explore `workflow.yaml`, `trace.json` and UFO's own logs in `ufo/`. A replay
54
- whose steps were healed also writes `heals.json` and asks whether to write the new locators into the workflow
55
- (`--accept-heals` writes them without asking; with no terminal they are never written).
74
+ An app is an absolute `.exe` on Windows, an `.app` bundle on macOS (`/Applications/Notes.app`), or an executable on
75
+ Linux (`/usr/bin/gnome-calculator`, with `kind: desktop`).
56
76
 
57
- ## Decisions
77
+ **Exploring a goal.** ForgeQE's agent does the goal in the app with the real mouse and keyboard, and saves the run as a
78
+ workflow with checks of the outcome. Windows only. Use a test machine or VM and a test account.
58
79
 
59
- | Question | Decision | Why |
60
- |---|---|---|
61
- | Agent that explores an app | Microsoft UFO² (`microsoft/UFO`, MIT), pinned to commit `eae3c0a8d168` and never edited, behind one adapter (`ufo_runner.py`) | It already solves UI Automation (UIA) control detection, merging it with vision, and the per-app agent loop. Behind the adapter it can be swapped for our own engine without touching the CLI, the YAML or replay. |
62
- | Saved scripts | ForgeQE's own YAML (`forgeqe-desktop-v1`), replayed on pywinauto (UIA backend) | UFO calls a model at every step. Replay must be fast, free, repeatable and fit for CI, so no model runs unless a step needs healing. |
63
- | Models | `llms.json`, the same profiles as the browser engine. UFO never gets its own model config | One place to configure models, keys and Microsoft Entra ID. |
64
- | Python environment | Its own (`~/.forgeqe/desktop/.venv`, Python 3.10), not the browser engine's | UFO pins `openai==1.66.2` and `pydantic`, which the browser engine's library does not run with, and `pandas==1.4.3`, which has Windows wheels up to Python 3.10. Replay's packages use UFO's pins, so one environment runs both. |
65
- | Replay off Windows, and headless | Vercel Labs' agent-desktop (Apache-2.0), pinned to 1.2.0, as a second replay driver (`desktop.driver`) behind the same workflow, heal and memory | It reads the OS accessibility tree on macOS, Windows and Linux, acts without the mouse, and re-identifies every element before it acts, refusing a stale or ambiguous one. It has no model and no tests of its own, so ForgeQE keeps the workflow, the locator, healing and the reports. |
66
- | Not chosen: `windowsagent` | Reference only | Very early (v0.1.0), replay not built, and it exposes a model-driven `/shell` endpoint. |
80
+ **Web app**
67
81
 
68
- ## How a run flows
82
+ 1. Open **Desktop apps** and the **Workflows** tab.
83
+ 2. Press **Explore a goal**.
84
+ 3. Pick the **App**, type the **Goal** (one line, as you would ask a tester) and, optionally, a **Name**.
85
+ 4. Press **Start exploring**.
69
86
 
87
+ **Terminal**
88
+
89
+ ```bash
90
+ forgeqe desktop explore "Create an invoice for Contoso, net 30" --app billing
91
+ forgeqe desktop explore "…" --app billing --name "Create an invoice" --yes # --yes: start without asking
70
92
  ```
71
- forgeqe desktop explore ──► src/desktop/bridge.ts ──JSON lines──► python -m forgeqe_desktop serve
72
- │ start the app from desktop.apps (no shell)
73
- │ UFO² in-process: model = llms.json profile,
74
- │ UI tools only, every action traced with its
75
- ▼ control's UIA properties
76
- record.py ──► workflow.yaml
77
- forgeqe desktop replay ───► bridge ──► serve (replay.py on pywinauto, no model)
78
- │ a control is not found
79
- ▼
80
- heal.py: the model picks one of the window's real controls, by number
81
- ▼
82
- proposed locator → heals.json, written into the workflow only when accepted
93
+
94
+ **Recording your own steps.** When you know the steps, do them yourself: no model is used, so it costs nothing and does
95
+ exactly what you did. Windows only. See [Recording by hand](#recording-by-hand).
96
+
97
+ **Web app**
98
+
99
+ 1. Open **Desktop apps** and the **Workflows** tab.
100
+ 2. Pick the app (when there are several) and press **Record by hand**.
101
+
102
+ Or open **Record**, pick **Desktop app**, pick the app and press **Record**. Press **Stop** when done.
103
+
104
+ **Terminal**
105
+
106
+ ```bash
107
+ forgeqe desktop record --app billing --name "Create an invoice"
83
108
  ```
84
109
 
85
- ## Replay on agent-desktop (macOS, Linux, and headless Windows)
110
+ **Replaying a workflow.** Replay runs the steps with no model and checks its `expect` steps. On Windows it takes over the
111
+ mouse and keyboard while it runs.
86
112
 
87
- `desktop.driver` picks what a workflow replays on:
113
+ **Web app**
88
114
 
89
- | `desktop.driver` | Replays on | Where |
90
- |---|---|---|
91
- | `auto` (default) | pywinauto on Windows, agent-desktop elsewhere | any |
92
- | `pywinauto` | pywinauto, with the UIA backend: the mouse and keyboard, like a person | Windows |
93
- | `agent-desktop` | [agent-desktop](https://github.com/vercel-labs/agent-desktop) 1.2.0: accessibility calls, no mouse and no focus | macOS 13+, Windows 10 1809+, Ubuntu 24.04+ (X11 or Wayland) |
115
+ 1. Open **Desktop apps** and the **Workflows** tab.
116
+ 2. Press the replay button on the workflow's row.
117
+ 3. Fill in its **Values**, or pick **Rows** under **Test data** to replay once per row of a data file or kept request.
118
+ 4. Under **While it runs**, choose **Heal a step whose control moved** and **Take new image baselines**.
119
+ 5. Press **Replay**.
120
+
121
+ The **Runs** tab lists each run with its **Report**. Its **Failed** filter shows failed runs, and a button on each asks
122
+ the agent why it failed.
123
+
124
+ **Terminal**
125
+
126
+ ```bash
127
+ forgeqe desktop replay .forgeqe/reports/desktop-explore-…/workflow.yaml customer=Fabrikam
128
+ forgeqe desktop replay workflow.yaml --data customers.csv # once per row; the header names the variables
129
+ forgeqe desktop replay desktop-tests/ --junit results.xml # every workflow in a folder, results for CI
130
+ forgeqe desktop replay workflow.yaml --update-baselines # save new baselines for its expect_image steps
131
+ forgeqe desktop replay workflow.yaml --no-heal # do not heal a moved control
132
+ ```
133
+
134
+ `--data` takes a `.csv`, `.xlsx` or `.json` file; `--each-query q.sql --each-db NAME` takes the rows from a database
135
+ read instead.
136
+
137
+ **Accepting heals.** When a control moved and replay found it again, the replay asks whether to write the new locator
138
+ into the workflow. Heals are offered only from a replay that passed.
139
+
140
+ **Web app**
141
+
142
+ 1. Open **Desktop apps** and the **Runs** tab (the **Heals to accept** filter lists them).
143
+ 2. Press **Accept** on the run.
144
+
145
+ **Terminal**
146
+
147
+ At the end of the replay, answer the question. `--accept-heals` writes them without asking. With no terminal they are
148
+ never written.
149
+
150
+ **Checking a workflow or a machine.** A workflow can be checked without running it, on any system. The machine check
151
+ says whether replay can run here unattended.
152
+
153
+ **Web app**
154
+
155
+ 1. To check a workflow: on the **Workflows** tab, press the check button on its row.
156
+ 2. To check the machine: on the **Machine and apps** tab, press **Check**.
157
+
158
+ **Terminal**
94
159
 
95
160
  ```bash
96
- forgeqe desktop setup # off Windows: the engine and agent-desktop 1.2.0
97
- forgeqe desktop setup --agent-desktop # on Windows, to replay on agent-desktop too
98
- forgeqe desktop doctor # off Windows: agent-desktop's platform and permissions
99
- forgeqe desktop replay workflow.yaml
161
+ forgeqe desktop validate workflow.yaml # any system
162
+ forgeqe desktop doctor # can this machine replay unattended?
100
163
  ```
101
164
 
102
- The workflow, its variables, secrets, checks, healing, app memory, reports and `--junit` are the same on either driver.
103
- A workflow recorded on Windows replays on agent-desktop as it is: its `control_type` (UI Automation's) is matched to the
104
- roles agent-desktop gives that control (a `Button` with a toggle is a `switch`), and `automation_id` to the control's
105
- developer id (AutomationId, AXIdentifier, or the DOM id). A workflow written for macOS or Linux can name agent-desktop's
106
- roles (`textfield`, `checkbox`) as its `control_type`.
165
+ **Asking the agent.** In a chat (the web app's **New chat**, `forgeqe start` or `forgeqe run`), ask: "create an invoice
166
+ for Contoso in Billing and save it as a test", or "I'll show you the steps in Billing, record them". The agent asks
167
+ before it starts the app or takes over the desktop, and before it changes a workflow. Where it cannot ask (an MCP
168
+ client), the call answers `needs_confirmation` until you agree.
169
+
170
+ **What a run keeps.** Each run writes a folder under the reports folder (`desktop-explore-…` or `desktop-replay-…`):
171
+ `run.json`, `report.html`, `steps/NNN.png`, and for an explore `workflow.yaml` and `trace.json`. A replay whose steps
172
+ were healed also writes `heals.json`.
173
+
174
+ ## How a run flows
175
+
176
+ 1. **Explore:** ForgeQE starts the app from its entry in your settings (never through a shell). The agent does the goal
177
+ with the app's controls only, and every action is kept with the control's properties. The result is `workflow.yaml`.
178
+ 2. **Replay:** ForgeQE plays the workflow's steps with no model.
179
+ 3. **Healing:** when a step's control is not found, one model call picks one of the window's real controls, by number.
180
+ The proposed locator goes to `heals.json` and is written into the workflow only when you accept it.
181
+
182
+ ## Replay on macOS, Linux, and headless Windows
183
+
184
+ `desktop.driver` sets how a workflow replays. In the web app it is **Replay on**, in **Settings › Desktop**.
185
+
186
+ | `desktop.driver` | How it replays | Where |
187
+ |---|---|---|
188
+ | `auto` (default) | the mouse and keyboard on Windows, accessibility calls elsewhere | any |
189
+ | `pywinauto` | the mouse and keyboard, like a person | Windows |
190
+ | `agent-desktop` | accessibility calls, with no mouse and no focus | macOS 13+, Windows 10 1809+, Ubuntu 24.04+ (X11 or Wayland) |
191
+
192
+ In **Settings › Desktop** › **Replay on** the same choices read **Automatic**, **The mouse and keyboard** and
193
+ **Accessibility calls, no mouse**.
194
+
195
+ Set up and check the machine as in [Use](#use) (`forgeqe desktop setup`, then `forgeqe desktop doctor`, or **Set up**
196
+ and **Check** in the web app). Off Windows, the check also shows the platform and its permissions.
107
197
 
108
- How a step runs: ForgeQE's locator finds the control in a fresh snapshot of the launched app's own windows, and refuses
109
- when several match. agent-desktop then acts on that snapshot's ref, and re-identifies it against the live window first:
110
- an element that changed in between is refused, never guessed. A ref refused with nothing delivered is found again once.
111
- An action that may have landed (a click whose result agent-desktop could not confirm) is never sent again, so a replay
112
- never submits twice.
198
+ The workflow, its variables, secrets, checks, healing, app memory, reports and `--junit` are the same either way. A
199
+ workflow recorded on Windows replays with accessibility calls as it is: its `control_type` is matched to the roles the
200
+ system gives that control (a `Button` with a toggle is a `switch`), and `automation_id` to the control's developer id
201
+ (AutomationId, AXIdentifier, or the DOM id). A workflow written for macOS or Linux can name those roles (`textfield`,
202
+ `checkbox`) as its `control_type`.
203
+
204
+ How a step runs with accessibility calls: the locator finds the control in a fresh snapshot of the app's own windows,
205
+ and refuses when several match. The control is checked again against the live window before the action: one that
206
+ changed in between is refused, never guessed. An action that may have landed (a click whose result could not be
207
+ confirmed) is never sent again, so a replay never submits twice.
113
208
 
114
209
  What it does not do:
115
210
 
116
- - `double_click` moves the mouse: it replays only with `desktop.headed: true`.
117
- - `keys` are real key presses sent to the app's window (agent-desktop's `press`). A workflow recorded on Windows says
118
- `ctrl+s`; on macOS write `cmd+s` instead.
119
- - Identical controls (two buttons named OK in one window) have no ref on Windows and Linux. Give the step a control
120
- that is unique in its window.
121
- - On macOS, grant Accessibility to the app that runs forgeqe (Terminal, iTerm2, VS Code): `forgeqe desktop doctor`
122
- shows the state. On Linux, Chromium and Qt apps need their accessibility switched on to be seen (agent-desktop's
123
- Linux guide).
124
-
125
- Apps in env.yaml or `desktop.apps`: an absolute `.exe` on Windows, an `.app` bundle on macOS (`/Applications/Notes.app`;
126
- its `CFBundleExecutable` is started, and only when it is a file inside the bundle), or an executable on Linux
127
- (`/usr/bin/gnome-calculator`, with `kind: desktop`).
128
-
129
- What reaches agent-desktop (`py/forgeqe_desktop/agentdesktop_driver.py`):
130
-
131
- - Only its own native executable, set up by ForgeQE at exactly 1.2.0 from npm (whose install step checks the release's
132
- SHA-256), started with an argument array: never its Node launcher, never a shell. The driver checks the version and
133
- refuses another.
134
- - Its environment is system settings only: no model key, no `desktop.secrets`, no ForgeQE variable.
135
- - Typed text, secrets included, goes on stdin (`set-value --stdin`), never in the command line other programs can see.
136
- - Refs and window ids only in their own shapes; a `select` value after `--`, so it is never read as a flag.
137
- - Its state (snapshots hold the app's text) is in a private folder for the run (mode 0700), removed when the run ends.
138
- - Its replies are read as untrusted: anything but its JSON envelope, or over 64 MB, is refused, and its error text is
139
- cut to one plain line before it reaches a report or the heal prompt.
140
-
141
- ## One model config: `llms.json` → UFO
142
-
143
- UFO picks its model client by `API_TYPE` through `ufo.llm.base.BaseService.get_service`, which every model call goes
144
- through (`ufo/llm/llm_call.py`). The adapter adds the type `forgeqe`:
145
-
146
- - `write_ufo_config` writes UFO's `config/ufo/agents.yaml` from its template, with `API_TYPE: forgeqe`, the model's name,
147
- and no endpoint and no key, for `HOST_AGENT`, `APP_AGENT`, `BACKUP_AGENT` and `EVALUATION_AGENT`.
148
- - `ufo_bridge.install` makes `get_service("forgeqe", …)` return `ForgeQEService`, which calls the profile through the
149
- `openai` SDK (`models.py`): `azure` (key or `auth: entra`), `openai`, `openai_compatible` (key or Entra), and `ollama`
150
- through its OpenAI-compatible `/v1`. Keys, Azure endpoints and Entra use the browser engine's own helpers
151
- (`forgeqe_engine.llm`), so a profile means the same thing in both. Keys stay in environment variables.
152
- - Each call's time and tokens go to ForgeQE's usage ledger as the "desktop agent" (counts only, never the prompt).
211
+ - `double_click` moves the mouse: it replays only with `desktop.headed: true` (**Let replay use the mouse and
212
+ keyboard** in **Settings › Desktop**).
213
+ - `keys` are real key presses sent to the app's window. A workflow recorded on Windows says `ctrl+s`; on macOS write
214
+ `cmd+s` instead.
215
+ - Identical controls (two buttons named OK in one window) cannot be told apart on Windows and Linux. Give the step a
216
+ control that is unique in its window.
217
+ - On macOS, grant Accessibility (System Settings › Privacy & Security › Accessibility) to the app that runs forgeqe
218
+ (Terminal, iTerm2, VS Code). `forgeqe desktop doctor` shows the state. On Linux, Chromium and Qt apps need their
219
+ accessibility switched on to be seen.
220
+
221
+ What ForgeQE keeps safe: typed text, secrets included, never appears on a command line other programs can see; no
222
+ model key or secret reaches the replay's helper; the app's text from each run is kept in a private folder that is
223
+ removed when the run ends.
224
+
225
+ ## The model explore and healing use
226
+
227
+ Explore and healing use the same model profiles as the browser agent, from `llms.json` (Settings › Models): Azure
228
+ OpenAI (key or Microsoft Entra ID), OpenAI, an OpenAI-compatible server, or Ollama. There is no separate model setting
229
+ for desktop. Keys stay in environment variables. Each call's time and tokens are counted in ForgeQE's usage (counts
230
+ only, never the prompt).
153
231
 
154
232
  Explore sends screenshots, so its profile must take images: `"vision": true` or `false` on the profile says so; without
155
233
  it, `ollama` profiles are refused and others accepted. Healing sends a screenshot only to a profile that takes images.
156
234
 
157
- The request parameters suit the model by themselves: a reasoning model (o1, o3, o4, gpt-5, by the profile's `model` or
158
- `deployment` name, or `"reasoning": true` on the profile) gets `max_completion_tokens` and no temperature from the first
159
- call, and when the API refuses a parameter (`max_tokens`, `temperature`, `frequency_penalty`, `response_format`, …) the
160
- call is sent again without it, and later calls to that model leave it out (`py/forgeqe_engine/model_params.py`). The
161
- browser agent does the same.
235
+ Request parameters suit the model by themselves: a reasoning model (o1, o3, o4, gpt-5, by the profile's `model` or
236
+ `deployment` name, or `"reasoning": true` on the profile) gets no temperature from the first call, and when the API
237
+ refuses a parameter the call is sent again without it, and later calls to that model leave it out.
162
238
 
163
239
  ## Workflow YAML (`forgeqe-desktop-v1`)
164
240
 
165
241
  ```yaml
166
242
  format: forgeqe-desktop-v1
167
243
  name: Create an invoice
168
- app: billing # a name from forgeqe.yaml desktop.apps, never a path or a command
244
+ app: billing # a name from desktop.apps, never a path or a command
169
245
  variables:
170
246
  customer: Contoso
171
247
  steps:
@@ -191,39 +267,36 @@ steps:
191
267
 
192
268
  - **Ops:** `launch`, `click`, `double_click`, `type`, `select`, `keys`, `expect`, `expect_image`, `wait` (at most
193
269
  60 s), `wait_for`, `close`.
194
- - **Locators** use UIA properties, never screen coordinates: `automation_id`, `name`, `control_type`, `class_name`,
195
- `index` (when several match), and `path` (the ancestors' `control_type` and `name`). A target needs an
270
+ - **Locators** use the control's properties, never screen coordinates: `automation_id`, `name`, `control_type`,
271
+ `class_name`, `index` (when several match), and `path` (the ancestors' `control_type` and `name`). A target needs an
196
272
  `automation_id` or a `name`. Replay looks in the launched app's own windows only.
197
273
  - **Variables:** `{{name}}` from the workflow's `variables` or `name=value` on the command line; `{{secret:NAME}}` from
198
274
  the environment, only for names in `desktop.secrets`. A secret ForgeQE itself uses (a model key, a tracker token) is
199
- refused there. Values are substituted once and never expanded again. Targets take `{{name}}` too (a CSV row's
275
+ refused there. Values are filled in once and never expanded again. Targets take `{{name}}` too (a CSV row's
200
276
  `{{customer}}` as the control to click), never a secret.
201
277
  - **Keys:** `ctrl`, `shift` and `alt` with one named key or character (`ctrl+s`, `alt+f4`, `enter`, `f5`). The Windows
202
278
  and context-menu keys are refused: Win+R followed by typing runs any command.
203
- - **Typing** is literal: pywinauto's key syntax (`^`, `%`, `+`, `~`, `{ENTER}`) in the text is escaped. On Windows a
204
- `type` step clears the field and types the text key by key, like a person: some controls show text set through UI
205
- Automation but act only on typed input (the Windows Save and Open dialogs keep their default file name). Text with
206
- line breaks or tabs is set instead, so a line break never presses Enter in a form.
207
- - **Only the app gets the input.** pywinauto clicks at screen coordinates and keys go to the window in front, so before
208
- a click, `type` or `keys` the app's window is brought forward, and nothing is sent while another program's window
209
- covers the point or keeps the keyboard: the step fails and says so. `keys` go to the app's open dialog, not its main
210
- window behind it. A `dismiss` control that could not be clicked is named in the step's error.
279
+ - **Typing** is literal: special key characters in the text are typed as they are. On Windows a `type` step clears the
280
+ field and types the text key by key, like a person: some controls show text set directly but act only on typed input
281
+ (the Windows Save and Open dialogs keep their default file name). Text with line breaks or tabs is set instead, so a
282
+ line break never presses Enter in a form.
283
+ - **Only the app gets the input.** Before a click, `type` or `keys`, the app's window is brought forward, and nothing is
284
+ sent while another program's window covers the point or keeps the keyboard: the step fails and says so. `keys` go to
285
+ the app's open dialog, not its main window behind it. A `dismiss` control that could not be clicked is named in the
286
+ step's error.
211
287
 
212
288
  ## Recording by hand
213
289
 
214
- When you know the steps, do them yourself instead of describing a goal: no model and no UFO are involved, so it costs
215
- nothing and does exactly what you did.
216
-
217
- ```bash
218
- forgeqe desktop record --app billing --name "Create an invoice"
219
- ```
290
+ When you know the steps, do them yourself instead of describing a goal: no model is involved, so it costs nothing and
291
+ does exactly what you did. Start it as in [Use](#use) ("Recording your own steps").
220
292
 
221
- ForgeQE starts the app and watches the mouse and keyboard (low-level Windows hooks), asking UI Automation which control
222
- each click and key went to. Do the steps, then:
293
+ ForgeQE starts the app and watches the mouse and keyboard, asking Windows which control each click and key went to. Do
294
+ the steps, then:
223
295
 
224
296
  - **Ctrl+Shift+F11** with the mouse over a control adds a check: an `expect` step with the text it shows now (a
225
297
  status message, a saved total). Add one at the end, so the replay tests the outcome, not only the steps.
226
- - **Ctrl+Shift+F12**, or closing the app, finishes. The console shows each step as it is recorded.
298
+ - **Ctrl+Shift+F12**, or closing the app, finishes (in the web app, **Stop** too). The terminal shows each step as it
299
+ is recorded.
227
300
 
228
301
  What becomes a step:
229
302
 
@@ -238,41 +311,42 @@ What becomes a step:
238
311
  - **Passwords:** a password field is never read; its step types `{{secret:NAME}}` (the one name in `desktop.secrets`,
239
312
  or `<APP>_PASSWORD`, which the result tells you to set). Text equal to a `desktop.secrets` value is written as its
240
313
  placeholder. The typed characters themselves are never kept, only the field's text when you move on.
241
- - **Only the app:** clicks and keys outside the app's own process are not recorded; nor are the Windows and menu keys,
242
- or controls with neither an AutomationId nor a name. The result lists what was left out.
243
- - **A click that closes a dialog** (OK after typing a password) is held for up to 0.2 s while ForgeQE finds the control
244
- under it and reads the field you typed in, so neither is lost when the dialog goes. Typed characters are looked up
245
- once per run of typing, not once per key.
314
+ - **Only the app:** clicks and keys outside the app are not recorded; nor are the Windows and menu keys, or controls
315
+ with neither an AutomationId nor a name. The result lists what was left out.
316
+ - **A click that closes a dialog** (OK after typing a password) is still recorded, with the field you typed in.
246
317
  - **A cell in a list or grid row** is recorded inside its row (`path`: the row's type and name), since every row has a
247
318
  cell like it (a password column's `********`).
248
319
  - The run folder has `workflow.yaml`, `run.json`, `report.html`, a picture of each step with the controls it shows
249
- (`steps/NNN.png` and `.json`), and `video.mp4` with `desktop.video: true`. Replay it with
250
- `forgeqe desktop replay`.
320
+ (`steps/NNN.png` and `.json`), and `video.mp4` with `desktop.video: true`.
251
321
 
252
322
  ## Reviewing a recording (web app)
253
323
 
254
- Record → **Desktop app** in `forgeqe web` (Windows) records the same way, and when you stop, the workflow opens in a
255
- review:
324
+ In the web app only: a recording made from **Record › Desktop app** (Windows) opens in a review when you stop. Any other
325
+ workflow opens in the same review from the **Workflows** tab of **Desktop apps** (the open button on its row). It has
326
+ three tabs:
256
327
 
257
328
  - **Steps**: each step with its picture, as recorded or on the last replay. Click a control on a picture to add a
258
329
  check that it shows its text (or that it is there). **Change step N** changes a step's control, text or seconds,
259
- or removes it (never the first, which starts the app). **+** after a step adds: a check that a control shows a
260
- text or is there, a wait for a control or until it is gone, a wait of some seconds, or keys. Each change is shown
261
- first and written at the version shown.
262
- - **Test data**: where each typed or chosen value comes from: as typed, test data (a variable of the workflow), or a
263
- secret of `desktop.secrets` (what was typed then leaves the workflow).
264
- - **Last run**: **Replay** with the values above or once for each row of a data file or kept request, with
265
- **Heal a moved control** and **New image baselines**; its result, report and heals to accept.
266
-
267
- **Improve** asks DeskPilot what to fix or add; it changes the workflow only after showing you the change. A mobile
330
+ or removes it (never the first, which starts the app). **+** after a step adds: **Check a control shows a text**,
331
+ **Check a control is there**, **Wait for a control**, **Wait until a control is gone**, **Wait some seconds**, or
332
+ **Press keys**. Each change is shown first and written at the version shown.
333
+ - **Test data**: where each typed or chosen value comes from: **As typed**, **Test data** (a variable of the workflow),
334
+ or **Secret** (one of `desktop.secrets`; what was typed then leaves the workflow). Press **Save**.
335
+ - **Last run**: **Replay** with the values above or once for each row of a data file or kept request, with **Heal a
336
+ step whose control moved** and **Take new image baselines**; its result, report and heals to **Accept**.
337
+
338
+ **Improve** asks the agent what to fix or add; it changes the workflow only after showing you the change. A mobile
268
339
  recording opens in the same review.
269
340
 
341
+ At a terminal, the same changes are made by editing the workflow file, or by asking the agent in a chat (see the next
342
+ section).
343
+
270
344
  ## Fixing a workflow from chat
271
345
 
272
- When a replayed step fails because the app was slow or a dialog was in the way, ForgeQE's agent fixes the workflow
273
- with `desktop_edit_workflow`: it proposes the change (a longer `timeout` or `retries` on the step, a `wait_for` before
274
- it, a dialog button in `dismiss`, a healed locator, a corrected text), shows you the diff, and writes the file only
275
- when you agree. For example, after "step 4 timed out while the invoice list loaded":
346
+ When a replayed step fails because the app was slow or a dialog was in the way, ask ForgeQE's agent to fix it, in a web
347
+ chat (or **Improve** on the workflow) or in `forgeqe start`. It proposes the change (a longer `timeout` or `retries` on
348
+ the step, a `wait_for` before it, a dialog button in `dismiss`, a healed locator, a corrected text), shows you the diff,
349
+ and writes the file only when you agree. For example, after "step 4 timed out while the invoice list loaded":
276
350
 
277
351
  ```text
278
352
  Change invoice.yaml?
@@ -283,10 +357,10 @@ Change invoice.yaml?
283
357
  + retries: 2
284
358
  ```
285
359
 
286
- - Each change has a fixed shape (`set`, `unset`, `set_step`, `add_dismiss`, `insert_step`, `remove_step`,
287
- `set_variable`); step numbers are the replay report's. Anything else is refused.
288
- - The changed workflow is checked by the engine's own validator before it is shown; one that would not run is not
289
- offered. Comments and layout are kept.
360
+ - Each change has a fixed shape (set or unset a setting, change, insert or remove a step, add a dialog to `dismiss`,
361
+ set a variable); step numbers are the replay report's. Anything else is refused.
362
+ - The changed workflow is checked before it is shown; one that would not run is not offered. Comments and layout are
363
+ kept.
290
364
  - The old text is kept in the reports folder (`desktop-edits/`), and a file that changed since the edit was proposed is
291
365
  not overwritten.
292
366
  - The workflow must be a `.yaml` inside the working folder or the reports folder.
@@ -326,7 +400,10 @@ steps:
326
400
  missing variable) is not retried.
327
401
  - **`dismiss`** lists at most 10 targets, checked like any target. When a control is not found, or something waits to
328
402
  go away, replay clicks the `dismiss` controls that are on screen and looks again, up to 3 times per lookup. The
329
- report and the console name every dialog closed, and how many tries a step took.
403
+ report and the terminal name every dialog closed, and how many tries a step took.
404
+
405
+ In the web app, the review's **+** adds the waits; `timeout`, `retries` and `dismiss` are edited in the file or through
406
+ the agent.
330
407
 
331
408
  ## Visual checks (`expect_image`)
332
409
 
@@ -342,7 +419,8 @@ compares pixels with a baseline image:
342
419
  ```
343
420
 
344
421
  - **The first run** with no baseline saves what it captured and passes; the report says so. Commit the baselines
345
- folder with the workflow. `--update-baselines` replaces them after an intended change.
422
+ folder with the workflow. After an intended change, replace them with **Take new image baselines** (web app) or
423
+ `--update-baselines` (terminal).
346
424
  - **A pixel counts as different** when a colour channel differs by more than 32 of 255, so anti-aliasing and ClearType
347
425
  do not fail a check. A different size (another screen scale or window size) fails with both sizes named.
348
426
  - **The report** shows the baseline, what was captured, and the differences in red, with the share of pixels that
@@ -353,161 +431,84 @@ compares pixels with a baseline image:
353
431
 
354
432
  ## Unattended runs
355
433
 
356
- Replay needs a signed-in, unlocked Windows session. Before it starts the app, it checks the session and fails at once
357
- with the reason if it is a Windows service (session 0), a locked screen, or a disconnected Remote Desktop session.
358
- `forgeqe desktop doctor` runs the same check. To run the suite every night on a machine of your own, see
359
- [DESKTOP-CI.md](DESKTOP-CI.md): a runner set up in the user's session (`ci/desktop-runner/prepare-runner.ps1`), a
360
- nightly workflow (`ci/desktop-runner/desktop-nightly.example.yml`), and `--junit` results.
361
-
362
- ## Updating UFO²
363
-
364
- UFO² is pinned to one commit. Moving it is checked before it is pinned:
365
-
366
- 1. Set up that UFO on Windows (`FORGEQE_UFO_COMMIT`, which takes a full 40-character commit id only), then run the
367
- adapter tests against its real code and a scripted explore of Notepad.
368
- 2. When it passed: `bun scripts/ufo-bump.ts <commit>` writes the new pin into `src/desktop/setup.ts`,
369
- `py/forgeqe_desktop/ufo_runner.py` and this page. Run the tests on Windows again before pushing.
370
-
371
- When it fails, the failing step names what changed in UFO (usually the action executor or the config layout that the
372
- adapter wraps). Keep the pin until the adapter is updated for it.
434
+ Replay on Windows with the mouse and keyboard needs a signed-in, unlocked Windows session. Before it starts the app, it
435
+ checks the session and fails at once with the reason if it is a Windows service (session 0), a locked screen, or a
436
+ disconnected Remote Desktop session. The machine check (**Check** on **Machine and apps**, or `forgeqe desktop doctor`)
437
+ runs the same check. To run the suite every night on a machine of your own, see [DESKTOP-CI.md](DESKTOP-CI.md): a
438
+ runner set up in the user's session (`ci/desktop-runner/prepare-runner.ps1`), a nightly workflow
439
+ (`ci/desktop-runner/desktop-nightly.example.yml`), and `--junit` results.
373
440
 
374
441
  ## Checks of the outcome
375
442
 
376
- A recording of actions only proves the steps run. When UFO has finished, and before the app closes, explore shows the
377
- model the goal and the app's controls with the text each shows now, and the model picks up to three whose text proves
378
- the goal (a status message, a saved value), by number, with the part of the text to expect. A check is kept only when
379
- that text really is in that control, so the model can choose among what is on screen but never invent it; text holding
380
- a `desktop.secrets` value is never offered. The checks are saved as `expect` steps at the end of the workflow, and the
381
- report says how many there are. With none, the report and the agent say so: add `expect` steps by hand.
443
+ A recording of actions only proves the steps run. When the agent has finished exploring, and before the app closes,
444
+ ForgeQE shows the model the goal and the app's controls with the text each shows now, and the model picks up to three
445
+ whose text proves the goal (a status message, a saved value), with the part of the text to expect. A check is kept only
446
+ when that text really is in that control, so the model can choose among what is on screen but never invent it; text
447
+ holding a `desktop.secrets` value is never offered. The checks are saved as `expect` steps at the end of the workflow,
448
+ and the report says how many there are. With none, the report and the agent say so, and the web app marks the workflow
449
+ as having no checks of the outcome: add `expect` steps (in the review, or by hand).
382
450
 
383
- ## Recording
451
+ ## What an explore records
384
452
 
385
- UFO's own step log names the control and a per-step id, not its AutomationId, so the adapter wraps UFO's
386
- `ActionExecutor.execute` and records each action with the UIA properties of the control it acted on. `record.py` turns
387
- that trace into steps: `click_input` → `click`/`double_click`, `set_edit_text` → `type`, `keyboard_input` → `keys` (one
388
- allowed chord) or `type`, `select` → `select`. Coordinate clicks, scrolls and anything else are listed as not recorded
389
- in the report. A typed value equal to a `desktop.secrets` value is written as its placeholder; typed text that only
390
- looks like `{{…}}` is kept literal, so a model told to type `{{secret:X}}` cannot make replay type the secret.
453
+ Each action of the agent is recorded with the properties of the control it acted on, and becomes a step: a click (or
454
+ double-click), typing into a field, a key chord (`keys`, when it is one allowed chord, else `type`), and picking an
455
+ item (`select`). Clicks at screen positions, scrolls and anything else are listed as not recorded in the report. A
456
+ typed value equal to a `desktop.secrets` value is written as its placeholder; typed text that only looks like `{{…}}`
457
+ is kept literal, so a model told to type `{{secret:X}}` cannot make replay type the secret.
391
458
 
392
459
  ## Security
393
460
 
394
- The YAML, the trace, the app's screen text and the model's replies can all be written by someone else. The rules in the
395
- repository's `CLAUDE.md` apply; for this engine:
396
-
397
- - **No command in the workflow.** `app:` names a `desktop.apps` entry: an absolute `.exe` (a `.bat` or `.cmd` would run
398
- through `cmd.exe`, which reparses its arguments) and an argument list, started with `subprocess.Popen([path, *args])`.
399
- - **UFO gets UI tools only.** Each explore writes UFO's `mcp.yaml` with `UICollector`, `HostUIExecutor` and
400
- `AppUIExecutor`. UFO's default `CommandLineExecutor`, which runs shell commands, and its Word, Excel, PowerPoint and
401
- PDF executors are left out. The adapter starts the app, so UFO never launches a program.
402
- - **Keys:** during explore the adapter refuses UFO's Windows and menu keys too, and the report lists what it refused.
403
- - **No one at the console:** UFO's safe guard asks before sensitive actions; explore answers no, since nobody is there.
404
- - **Environment:** the engine process gets system settings, the profile's key variable (or Entra's) and
405
- `desktop.secrets`, nothing else (`desktopEnvNames`).
461
+ The YAML, the app's screen text and the model's replies can all be written by someone else. ForgeQE treats them as
462
+ untrusted:
463
+
464
+ - **No command in the workflow.** `app:` names an app of your settings: an absolute `.exe` (never a `.bat` or `.cmd`)
465
+ and an argument list, started without a shell.
466
+ - **The agent gets UI actions only.** While exploring it can click, type and read controls in the app. It cannot run
467
+ shell commands or start programs; ForgeQE starts the app.
468
+ - **Keys:** the Windows and menu keys are refused during explore too, and the report lists what was refused.
469
+ - **No one at the console:** when the agent would ask before a sensitive action, explore answers no.
470
+ - **Environment:** the desktop process gets system settings, the model profile's key and `desktop.secrets`, nothing
471
+ else.
406
472
  - **Explore controls the real mouse and keyboard.** It asks before starting (`--yes` to skip; required with no
407
473
  terminal). Use a test machine or VM and a test account.
408
- - **Agent tools:** a workflow path the agent gives must be a `.yaml` inside the working folder or the reports folder (real
409
- path, so a link out is refused); variables are names and text only; heals are reported, never written.
474
+ - **Agent tools:** a workflow path the agent gives must be a `.yaml` inside the working folder or the reports folder
475
+ (links out are refused); variables are names and text only; heals are reported, never written by the agent.
410
476
  - **Healing:** the model picks one of the window's real controls by number; control text is passed as data, and any
411
477
  other answer heals nothing. Heals are written into the workflow only when accepted.
412
- - **Report:** every value is escaped; images are only the engine's own `steps/NNN.png` and
413
- `images/NNN-baseline|actual|diff.png`.
414
- - **Baselines:** `expect_image` names are file names, and their real path must be inside the workflow's baselines
415
- folder, so a workflow cannot read or overwrite another file.
478
+ - **Report:** every value is escaped; images are only the run's own step pictures and image comparisons.
479
+ - **Baselines:** `expect_image` names are file names inside the workflow's baselines folder, so a workflow cannot read
480
+ or overwrite another file.
416
481
  - **Unattended machines:** `prepare-runner.ps1` never handles a password; automatic sign-in uses Sysinternals
417
482
  Autologon, which stores it encrypted.
418
- - **Install:** UFO is cloned and checked out at the pinned commit (or `FORGEQE_UFO_COMMIT`, a full commit id only),
419
- and the checkout's `HEAD` is verified; replay's packages are pinned to exact versions.
420
-
421
- ## Code
422
-
423
- | File | Contents |
424
- |---|---|
425
- | `src/desktop/command.ts` | `forgeqe desktop`: setup, apps, doctor, validate, explore, record, replay (folders, `--data`, `--junit`, `--update-baselines`); heal acceptance |
426
- | `src/desktop/junit.ts` | JUnit XML for a suite |
427
- | `src/desktop/edit.ts` | Changes to a workflow from chat: shapes, applied with comments kept, validated, diff, backup |
428
- | `src/desktop/run.ts` | Explore and replay as the CLI and the agent's tools run them; variables, CSV rows, workflow paths |
429
- | `src/mcp/desktoptools.ts` | ForgeQE's agent's `test_apps`, `desktop_explore`, `desktop_record`, `desktop_replay`, `desktop_edit_workflow` |
430
- | `src/desktop/bridge.ts` | Starts `python -m forgeqe_desktop serve`, passes events on, records model calls in the usage ledger |
431
- | `src/desktop/setup.ts` | The desktop environment, the pinned UFO checkout (`ufoCommit`), `desktopDoctor` |
432
- | `scripts/ufo-bump.ts` | Pins a new UFO commit in every place that names it |
433
- | `ci/desktop-runner/` | `prepare-runner.ps1` and the nightly workflow example for unattended runs |
434
- | `src/desktop/report.ts` | `report.html` for a run |
435
- | `py/forgeqe_desktop/service.py` | `serve`: the JSON-lines protocol, replay and explore runs, `run.json` |
436
- | `py/forgeqe_desktop/workflow.py` | Load, validate and save workflows; variables and secrets; the key-chord grammar |
437
- | `py/forgeqe_desktop/apps.py` | `desktop.apps`: the app allowlist and the argument array a launch uses |
438
- | `py/forgeqe_desktop/models.py` | The profile through the `openai` SDK; image checks |
439
- | `py/forgeqe_desktop/ufo_bridge.py` | UFO's model blocks, and the `forgeqe` model service |
440
- | `py/forgeqe_desktop/ufo_runner.py` | UFO's config, the action trace and key guard, running UFO in-process |
441
- | `py/forgeqe_desktop/record.py` | Trace to workflow steps |
442
- | `py/forgeqe_desktop/replay.py` | Runs a workflow on a `Driver`: timeouts, retries, `wait_for`, dismissing dialogs, heal and stop |
443
- | `py/forgeqe_desktop/handrecord.py` | Recording by hand: clicks, typing, chords and checks as steps; secrets |
444
- | `py/forgeqe_desktop/handhooks.py` | The Windows hooks and UI Automation lookups that feed it |
445
- | `py/forgeqe_desktop/visual.py` | `expect_image`: baselines, pixel comparison, diff images |
446
- | `py/forgeqe_desktop/session.py` | Whether this Windows session can be driven (service, locked, no screen) |
447
- | `py/forgeqe_desktop/heal.py` | One model call to re-find a moved control |
448
- | `py/forgeqe_desktop/memory.py` | App memory: an explore replays what earlier ones did before calling the model, and a heal found once is reused (mobile too) |
449
- | `py/forgeqe_desktop/checks.py` | One model call for checks of the outcome, kept only when on screen |
450
- | `py/forgeqe_desktop/pywinauto_driver.py` | The Windows `Driver` |
451
-
452
- Tests: `bun test tests/desktop.test.ts`, and `<engine-python> -m pytest tests/desktop -q` (needs `openai==1.66.2`
453
- and PyYAML; they use a fake driver and a fake UFO, so they run on any OS).
483
+ - **Install:** what setup downloads is pinned to exact versions and checked.
454
484
 
455
485
  ## Before first use on Windows
456
486
 
457
- Verified in CI: setup with and without `--ufo`, replay, healing, the CLI, and UFO's own code with the adapter (its
458
- config, its model calls routed to the profile, the action trace, UI tools only). Still to check, on a Windows test
459
- machine with your apps:
487
+ Tested by the ForgeQE team: setup with and without the explore part, replay, healing, and recording. Still to check, on
488
+ a Windows test machine with your apps:
460
489
 
461
- 1. **UIA coverage:** `Inspect.exe` shows the controls that matter with stable `AutomationId`s. Custom grids, Java
462
- (needs Java Access Bridge), Delphi, SAP GUI and Citrix (vision only) are where UIA falls short.
490
+ 1. **Control coverage:** Windows' `Inspect.exe` shows the controls that matter with stable `AutomationId`s. Custom
491
+ grids, Java (needs Java Access Bridge), Delphi, SAP GUI and Citrix are where Windows' control information falls
492
+ short.
463
493
  2. **Explore with your model:** one goal with an Azure profile and one with `auth: entra`; `trace.json` has the
464
- controls' AutomationIds, and `ufo/` has UFO's logs.
494
+ controls' AutomationIds.
465
495
  3. **Replay:** the recorded workflow passes 10 runs out of 10; a renamed control is healed.
466
- 4. **Cost and time** of one explore, from `forgeqe` usage.
467
-
468
- Found by the Windows runs and fixed: UFO's pins need Python 3.10 (pandas 1.4.3); UFO prints emoji panels to stdout, which
469
- is the engine's event stream and crashed on the cp1252 console (now sent to stderr, characters replaced); an error in
470
- UFO's own evaluation lost the recorded actions (the trace is now kept and saved).
471
-
472
- Found by replaying KeePass 2 on Windows 11 ARM64 (a Parallels VM, runs started from a scheduled task) and fixed: text
473
- set through UI Automation was shown by the Save dialog but not used, so the database was saved under the default name
474
- while every step passed (now typed); with the app behind another window, clicks went to that window, `dismiss`
475
- reported nothing, and `keys` went to the main window instead of the dialog (now the app is brought forward, the click
476
- point and the keyboard are checked, and keys go to the open dialog); a dialog closing while its window was searched
477
- failed the next step with a COM error (now searched again). On that VM a synthetic double-click did not register;
478
- check `double_click` on real hardware. The x64 Python the engine runs in needs the x64 Visual C++ runtime (`win32ui`).
479
- On agent-desktop there: npm 11.20 refuses `--allow-scripts` with `--prefix` (the install script is now allowed for the
480
- pinned version in the folder's `package.json`); the state folder's Windows ACL (Administrators, OWNER RIGHTS) was
481
- refused by agent-desktop (now this user and SYSTEM only); and a dialog listed as its own window and inside its main
482
- window's snapshot matched twice (now one control). Still open: a button whose click opens a modal message box times out
483
- in UI Automation's Invoke, and the step fails without sending it again, so such steps need the pywinauto driver.
484
-
485
- Found by exploring and healing KeePass there with Azure OpenAI gpt-5.4 and fixed: a drop-down menu's items are listed
486
- twice by UI Automation, so a recorded menu click was "several controls match" and could not replay (now one control
487
- seen twice, the same runtime id, is that control); a check of the app's main window could never be found, as replay
488
- searched only inside windows (now a target equal to the window is the window); the heal model, given only the old
489
- target, replaced a renamed menu item by the menu itself (that step passed and the next one failed), and the heal was
490
- remembered and offered for the workflow (now the model is told the step and the one before it, and a heal is
491
- remembered, written or offered only from a replay that passed; a remembered heal used in a failed replay is
492
- forgotten); and the offer to write heals waited for an answer with no terminal (now never asked without one). Explore
493
- ran 4 steps for $0.12 when the app opened at its main window.
494
-
495
- Also found there and fixed: an app that opens with a start-up dialog (KeePass's update question) left UFO on that
496
- dialog's window after it closed, so every later click went to (0, 0) until the step limit ($1.22 for nothing); now a
497
- closed window UFO chose is replaced by the app's live window (`follow_live_window`, `ufo_runner.py`), and the same
498
- explore passes for $0.18. In recording by hand, the OK that closed a dialog right after typing was lost, since the
499
- control under the click was looked up after a lookup per typed key (now the click is held while it is looked up, and
500
- typing is one lookup). A click on a list row's `********` cell was recorded as that cell alone, which every row has (now
501
- inside its row). App memory borrowed another goal's whole flow as a "shared start"; that flow ended where it began (a
502
- dialog opened and closed again), so UFO, seeing the screen it started from, did it all again and the workflow held it
503
- twice. Now the note lists the replayed steps and says to finish if they do the goal (UFO then made no click, $0.02),
504
- and steps that exactly repeat the replayed block are kept once. A replay with `--no-heal`, or with a model whose key
505
- is not set, stopped at "No model in llms.json can …" (now healing is off for that replay, and it runs).
496
+ 4. **Cost and time** of one explore, from ForgeQE's usage.
497
+
498
+ Known limits:
499
+
500
+ - In a virtual machine, a synthetic double-click may not register; check `double_click` on real hardware.
501
+ - On Windows on ARM, the x64 Visual C++ runtime must be installed.
502
+ - With `desktop.driver: agent-desktop`, a button whose click opens a modal message box times out, and the step fails
503
+ without sending the click again. Replay such workflows with the mouse and keyboard (`pywinauto` or `auto` on
504
+ Windows).
505
+ - An explore makes model calls, so it costs what your model charges; a replay makes none. Each run's report and Cost
506
+ show what it used.
506
507
 
507
508
  ## Next steps
508
509
 
509
510
  1. The checks above.
510
511
  2. `forgeqe suite` and test cases from Azure DevOps, Jira and Xray for desktop workflows, with results written back.
511
- 3. Quill: export a workflow as pywinauto code (or C# with FlaUI) in the user's repo.
512
- 4. App adapters where UIA falls short: Java Access Bridge, SAP GUI scripting, vision-only for Citrix.
512
+ 3. Quill: export a workflow as code in the user's repository.
513
+ 4. Better support where Windows' control information falls short: Java, SAP GUI, and vision only for Citrix.
513
514
  5. A pipeline template for a self-hosted Windows runner signed in to a desktop session.