@bastani/atomic 0.9.28-alpha.3 → 0.9.28-alpha.5

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 (311) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  3. package/dist/builtin/intercom/README.md +3 -2
  4. package/dist/builtin/intercom/broker/broker.ts +90 -14
  5. package/dist/builtin/intercom/broker/paths.ts +4 -0
  6. package/dist/builtin/intercom/broker/socket-liveness.ts +32 -0
  7. package/dist/builtin/intercom/broker/socket-replacement-lock.ts +104 -0
  8. package/dist/builtin/intercom/broker/spawn.ts +108 -63
  9. package/dist/builtin/intercom/index.bundle.mjs +114 -61
  10. package/dist/builtin/intercom/package.json +2 -2
  11. package/dist/builtin/mcp/package.json +1 -1
  12. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  13. package/dist/builtin/subagents/package.json +3 -3
  14. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +1 -1
  15. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +60 -39
  16. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +119 -36
  17. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +225 -183
  18. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +120 -89
  19. package/dist/builtin/subagents/skills/cua-driver/README.md +16 -7
  20. package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +85 -115
  21. package/dist/builtin/subagents/skills/cua-driver/RUNTIME.md +113 -0
  22. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +55 -1071
  23. package/dist/builtin/subagents/skills/cua-driver/VISUAL.md +125 -0
  24. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +145 -185
  25. package/dist/builtin/subagents/skills/cua-driver/WORKFLOW.md +173 -0
  26. package/dist/builtin/web-access/package.json +2 -2
  27. package/dist/builtin/workflows/CHANGELOG.md +16 -0
  28. package/dist/builtin/workflows/README.md +1 -1
  29. package/dist/builtin/workflows/builtin/{chunk-aqv8ny38.js → chunk-9ywkdsa9.js} +1 -1
  30. package/dist/builtin/workflows/builtin/{chunk-p6jagvyf.js → chunk-bnz4knhy.js} +1 -1
  31. package/dist/builtin/workflows/builtin/{chunk-br4ac9a3.js → chunk-dx5sjaxe.js} +1 -1
  32. package/dist/builtin/workflows/builtin/{chunk-p3xmajmj.js → chunk-v4scsq3y.js} +41 -13
  33. package/dist/builtin/workflows/builtin/goal.js +2 -2
  34. package/dist/builtin/workflows/builtin/index.js +3 -3
  35. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  36. package/dist/builtin/workflows/package.json +2 -2
  37. package/dist/builtin/workflows/skills/impeccable/SKILL.md +8 -2
  38. package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +6 -0
  39. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -1
  40. package/dist/builtin/workflows/skills/impeccable/reference/component-review.md +63 -0
  41. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +5 -0
  42. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +1 -1
  43. package/dist/builtin/workflows/skills/impeccable/reference/generate.md +101 -0
  44. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +9 -0
  45. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +3 -1
  46. package/dist/builtin/workflows/skills/impeccable/reference/mode-operate.md +21 -0
  47. package/dist/builtin/workflows/skills/impeccable/reference/mode-persuade.md +19 -0
  48. package/dist/builtin/workflows/skills/impeccable/reference/mode-read.md +21 -0
  49. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +19 -12
  50. package/dist/builtin/workflows/skills/impeccable/reference/region-map.md +26 -0
  51. package/dist/builtin/workflows/skills/impeccable/reference/routing.md +1 -1
  52. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +5 -5
  53. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
  54. package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +4 -0
  55. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +2 -2
  56. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +5 -1
  57. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +524 -4
  58. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +1 -0
  59. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +81 -0
  60. package/dist/builtin/workflows/src/extension/index.bundle.mjs +38 -14
  61. package/dist/builtin/workflows/src/index.js +38 -14
  62. package/dist/cli/startup-ui.d.ts +3 -2
  63. package/dist/cli/startup-ui.d.ts.map +1 -1
  64. package/dist/cli/startup-ui.js +19 -4
  65. package/dist/cli/startup-ui.js.map +1 -1
  66. package/dist/codemode-worker.js +2 -2
  67. package/dist/core/agent-session-compaction.d.ts +3 -3
  68. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  69. package/dist/core/agent-session-compaction.js +5 -1
  70. package/dist/core/agent-session-compaction.js.map +1 -1
  71. package/dist/core/agent-session-events.d.ts.map +1 -1
  72. package/dist/core/agent-session-events.js +1 -0
  73. package/dist/core/agent-session-events.js.map +1 -1
  74. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  75. package/dist/core/agent-session-extension-bindings.js +4 -0
  76. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  77. package/dist/core/agent-session-methods.d.ts +6 -1
  78. package/dist/core/agent-session-methods.d.ts.map +1 -1
  79. package/dist/core/agent-session-methods.js.map +1 -1
  80. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  81. package/dist/core/agent-session-prompt.js +3 -2
  82. package/dist/core/agent-session-prompt.js.map +1 -1
  83. package/dist/core/agent-session-runtime.d.ts +5 -1
  84. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  85. package/dist/core/agent-session-runtime.js +13 -9
  86. package/dist/core/agent-session-runtime.js.map +1 -1
  87. package/dist/core/agent-session-types.d.ts +1 -0
  88. package/dist/core/agent-session-types.d.ts.map +1 -1
  89. package/dist/core/agent-session-types.js.map +1 -1
  90. package/dist/core/agent-session.d.ts +1 -0
  91. package/dist/core/agent-session.d.ts.map +1 -1
  92. package/dist/core/agent-session.js.map +1 -1
  93. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  94. package/dist/core/export-html/tool-renderer.js +2 -0
  95. package/dist/core/export-html/tool-renderer.js.map +1 -1
  96. package/dist/core/extensions/agent-events.d.ts +2 -0
  97. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  98. package/dist/core/extensions/agent-events.js.map +1 -1
  99. package/dist/core/extensions/context-types.d.ts +2 -0
  100. package/dist/core/extensions/context-types.d.ts.map +1 -1
  101. package/dist/core/extensions/context-types.js.map +1 -1
  102. package/dist/core/extensions/mcp-server-registry.d.ts +4 -1
  103. package/dist/core/extensions/mcp-server-registry.d.ts.map +1 -1
  104. package/dist/core/extensions/mcp-server-registry.js +7 -4
  105. package/dist/core/extensions/mcp-server-registry.js.map +1 -1
  106. package/dist/core/extensions/runner.d.ts +3 -0
  107. package/dist/core/extensions/runner.d.ts.map +1 -1
  108. package/dist/core/extensions/runner.js +19 -0
  109. package/dist/core/extensions/runner.js.map +1 -1
  110. package/dist/core/extensions/session-events.d.ts +2 -0
  111. package/dist/core/extensions/session-events.d.ts.map +1 -1
  112. package/dist/core/extensions/session-events.js.map +1 -1
  113. package/dist/core/extensions/tool-types.d.ts +2 -0
  114. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  115. package/dist/core/extensions/tool-types.js.map +1 -1
  116. package/dist/core/fast-model-variants.d.ts.map +1 -1
  117. package/dist/core/fast-model-variants.js +3 -2
  118. package/dist/core/fast-model-variants.js.map +1 -1
  119. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  120. package/dist/core/model-resolver-defaults.js +2 -0
  121. package/dist/core/model-resolver-defaults.js.map +1 -1
  122. package/dist/core/nested-tool-calls.d.ts +1 -0
  123. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  124. package/dist/core/nested-tool-calls.js +1 -0
  125. package/dist/core/nested-tool-calls.js.map +1 -1
  126. package/dist/core/provider-alias.d.ts.map +1 -1
  127. package/dist/core/provider-alias.js +8 -0
  128. package/dist/core/provider-alias.js.map +1 -1
  129. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  130. package/dist/core/provider-composer-internal.js +6 -3
  131. package/dist/core/provider-composer-internal.js.map +1 -1
  132. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  133. package/dist/core/resource-loader-reload.js +1 -0
  134. package/dist/core/resource-loader-reload.js.map +1 -1
  135. package/dist/core/resource-loader-types.d.ts +1 -0
  136. package/dist/core/resource-loader-types.d.ts.map +1 -1
  137. package/dist/core/resource-loader-types.js.map +1 -1
  138. package/dist/core/settings-types.js.map +1 -1
  139. package/dist/core/tools/bash.d.ts.map +1 -1
  140. package/dist/core/tools/bash.js +7 -3
  141. package/dist/core/tools/bash.js.map +1 -1
  142. package/dist/core/tools/edit.js +1 -1
  143. package/dist/core/tools/edit.js.map +1 -1
  144. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  145. package/dist/extensions/codemode/execute.js +55 -7
  146. package/dist/extensions/codemode/execute.js.map +1 -1
  147. package/dist/extensions/codemode/index.d.ts.map +1 -1
  148. package/dist/extensions/codemode/index.js +7 -0
  149. package/dist/extensions/codemode/index.js.map +1 -1
  150. package/dist/extensions/codemode/tool.d.ts +2 -0
  151. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  152. package/dist/extensions/codemode/tool.js +2 -0
  153. package/dist/extensions/codemode/tool.js.map +1 -1
  154. package/dist/extensions/herdr/index.d.ts.map +1 -1
  155. package/dist/extensions/herdr/index.js +20 -2
  156. package/dist/extensions/herdr/index.js.map +1 -1
  157. package/dist/extensions/herdr/pane-owner.d.ts +7 -0
  158. package/dist/extensions/herdr/pane-owner.d.ts.map +1 -1
  159. package/dist/extensions/herdr/pane-owner.js +53 -11
  160. package/dist/extensions/herdr/pane-owner.js.map +1 -1
  161. package/dist/index.d.ts +1 -1
  162. package/dist/index.d.ts.map +1 -1
  163. package/dist/index.js.map +1 -1
  164. package/dist/main-deferred-startup.d.ts +8 -0
  165. package/dist/main-deferred-startup.d.ts.map +1 -1
  166. package/dist/main-deferred-startup.js +6 -0
  167. package/dist/main-deferred-startup.js.map +1 -1
  168. package/dist/main.d.ts.map +1 -1
  169. package/dist/main.js +11 -3
  170. package/dist/main.js.map +1 -1
  171. package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  172. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  173. package/dist/modes/interactive/components/bash-execution.js +17 -14
  174. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  175. package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  176. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  177. package/dist/modes/interactive/components/branch-summary-message.js +5 -2
  178. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  179. package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -0
  180. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  181. package/dist/modes/interactive/components/chat-message-renderer.js +19 -8
  182. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  183. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +3 -2
  184. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  185. package/dist/modes/interactive/components/compaction-boundary-message.js +7 -4
  186. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  187. package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  188. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  189. package/dist/modes/interactive/components/custom-entry.js +8 -2
  190. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  191. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  192. package/dist/modes/interactive/components/custom-message.js +1 -0
  193. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  194. package/dist/modes/interactive/components/settings-selector-items.js +1 -1
  195. package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
  196. package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  197. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  198. package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  199. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  200. package/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  201. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  202. package/dist/modes/interactive/components/tool-execution.js +10 -0
  203. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  204. package/dist/modes/interactive/interactive-agent-events.js +3 -1
  205. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  206. package/dist/modes/interactive/interactive-auth-login.js +6 -0
  207. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  208. package/dist/modes/interactive/interactive-auth-routing.js +2 -2
  209. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  210. package/dist/modes/interactive/interactive-bash-compact.js +2 -2
  211. package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
  212. package/dist/modes/interactive/interactive-extension-dialogs.js +19 -2
  213. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  214. package/dist/modes/interactive/interactive-mode-base.d.ts +4 -0
  215. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  216. package/dist/modes/interactive/interactive-mode-base.js +7 -0
  217. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  218. package/dist/modes/interactive/interactive-mode-helpers.js +1 -1
  219. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  220. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -1
  221. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  222. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  223. package/dist/modes/interactive/interactive-mode-types.d.ts +1 -0
  224. package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
  225. package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
  226. package/dist/modes/interactive/interactive-process-lifecycle.js +1 -1
  227. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  228. package/dist/modes/interactive/interactive-render-chat.js +7 -5
  229. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  230. package/dist/modes/interactive/interactive-selectors.js +8 -1
  231. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  232. package/dist/modes/interactive/interactive-session-runtime.js +1 -0
  233. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  234. package/dist/modes/interactive/interactive-startup-trust.d.ts +6 -0
  235. package/dist/modes/interactive/interactive-startup-trust.d.ts.map +1 -0
  236. package/dist/modes/interactive/interactive-startup-trust.js +15 -0
  237. package/dist/modes/interactive/interactive-startup-trust.js.map +1 -0
  238. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  239. package/dist/modes/interactive/interactive-startup.js +4 -0
  240. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  241. package/dist/modes/interactive/program-status-reporter.d.ts +24 -0
  242. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  243. package/dist/modes/interactive/program-status-reporter.js +96 -0
  244. package/dist/modes/interactive/program-status-reporter.js.map +1 -0
  245. package/dist/modes/interactive-engine/engine-child-liveness.d.ts +1 -0
  246. package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -1
  247. package/dist/modes/interactive-engine/engine-child-liveness.js +15 -1
  248. package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -1
  249. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  250. package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
  251. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  252. package/dist/modes/interactive-engine/engine-monitor.d.ts +4 -0
  253. package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -1
  254. package/dist/modes/interactive-engine/engine-monitor.js +17 -0
  255. package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
  256. package/dist/modes/interactive-engine/engine-quit-intent.d.ts +16 -0
  257. package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -0
  258. package/dist/modes/interactive-engine/engine-quit-intent.js +27 -0
  259. package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -0
  260. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  261. package/dist/modes/interactive-engine/engine-render-service.js +3 -1
  262. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  263. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +1 -0
  264. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  265. package/dist/modes/interactive-engine/extension-ui-bridge.js +5 -0
  266. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  267. package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -1
  268. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  269. package/dist/modes/interactive-engine/isolated-runtime.js +19 -2
  270. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  271. package/dist/modes/interactive-engine/protocol.d.ts +19 -1
  272. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  273. package/dist/modes/interactive-engine/protocol.js +7 -0
  274. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  275. package/dist/modes/interactive-engine/remote-renderer.d.ts +3 -0
  276. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  277. package/dist/modes/interactive-engine/remote-renderer.js +7 -0
  278. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  279. package/dist/modes/rpc/rpc-client.d.ts +11 -0
  280. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  281. package/dist/modes/rpc/rpc-client.js +42 -0
  282. package/dist/modes/rpc/rpc-client.js.map +1 -1
  283. package/dist/modes/rpc/rpc-input-scheduler.js +2 -2
  284. package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
  285. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  286. package/dist/modes/rpc/rpc-mode.js +23 -6
  287. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  288. package/dist/modes/rpc/rpc-provider-auth.js +1 -1
  289. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
  290. package/docs/codemode.md +10 -6
  291. package/docs/compaction.md +1 -1
  292. package/docs/computer-use.md +9 -9
  293. package/docs/custom-provider/streaming.md +4 -0
  294. package/docs/environment-variables.md +2 -0
  295. package/docs/extensions/api-reference.md +1 -1
  296. package/docs/extensions/authoring.md +2 -0
  297. package/docs/extensions/events.md +8 -1
  298. package/docs/getting-started/first-session.md +1 -1
  299. package/docs/herdr.md +11 -2
  300. package/docs/json.md +6 -1
  301. package/docs/models/evals.md +34 -3
  302. package/docs/models.md +1 -1
  303. package/docs/providers.md +10 -0
  304. package/docs/sdk.md +8 -2
  305. package/docs/settings.md +2 -2
  306. package/docs/skills.md +1 -1
  307. package/docs/terminal-setup.md +14 -0
  308. package/docs/workflows/authoring.md +3 -3
  309. package/examples/extensions/sandbox/package-lock.json +3 -3
  310. package/npm-shrinkwrap.json +67 -67
  311. package/package.json +8 -8
@@ -1,86 +1,89 @@
1
- # Recording & replaying trajectories
2
-
3
- > **Cross-platform.** Recording is available on macOS (native
4
- > ScreenCaptureKit), Windows (ffmpeg + `gdigrab`), and Linux (ffmpeg +
5
- > `x11grab`). Replay is cross-platform as long as the recorded artifacts
6
- > are present.
7
-
8
- Session-scoped capture of action sequences + pre/post state, suitable
9
- for demos, regression diffs, and training data. Invoked only when the
10
- user explicitly asks to record — the skill does not auto-enable this.
11
-
12
- `start_recording` turns on a session-scoped trajectory recorder. While
13
- enabled, every action-tool call (`click`, `right_click`, `scroll`,
14
- `type_text`, `press_key`, `hotkey`, `set_value`) writes a numbered
15
- turn folder under a caller-chosen output directory. Read-only tools
16
- (`get_window_state`, `list_windows`, `screenshot`, `list_apps`,
17
- permission probes, agent-cursor getters / setters, and the recording
18
- controls themselves) are not recorded.
19
-
20
- **Video on by default.** `start_recording` also captures the main
21
- display to `<output_dir>/recording.mp4` (H.264 / 30 fps) for the
22
- lifetime of the session. The mp4 is finalized on `stop_recording`. Opt
23
- out with `record_video: false` when you don't want video.
24
-
25
- **macOS — native ScreenCaptureKit, zero-config.** On macOS the daemon's
26
- recorder uses `SCStream` + `SCRecordingOutput`, so it inherits the daemon's
27
- Screen Recording grant — no separate
28
- subprocess prompt, no fast-fail, no second TCC dance. Requires macOS
29
- 15.0+ (SCRecordingOutput introduced in macOS 15). No ffmpeg needed.
30
-
31
- **Windows / Linux — ffmpeg subprocess.** Outside macOS the recorder
32
- shells to ffmpeg with `gdigrab` (Windows) or `x11grab` (Linux). The
33
- binary needs to be on PATH (`winget install Gyan.FFmpeg` /
34
- `apt install ffmpeg`); when missing, the per-turn capture continues
35
- without video and `last_error` carries the install hint. ffmpeg
36
- startup failures fast-fail with a stderr tail in the error.
37
-
38
- ## Start / stop
39
-
40
- Two equivalent surfaces: the `start_recording` / `stop_recording` MCP
41
- tools, or the friendlier `cua-driver recording` subcommand group
42
- (wraps both with human-readable output).
1
+ # Recording and replay
43
2
 
44
- ```
45
- cua-driver recording start ~/cua-trajectories/run-1
46
- # … run the workflow …
47
- cua-driver recording status # -> enabled / disabled, next_turn, output_dir
48
- cua-driver recording stop # -> "Recording stopped. (video → recording.mp4)"
49
- ```
3
+ Record only when the user requests it. Keep the recording controls and actions
4
+ on one persistent MCP connection; see [RUNTIME.md](RUNTIME.md). When the actions
5
+ pass a `session` label, you may pass the same label to `start_recording`.
6
+ `stop_recording` and `get_recording_state` do not accept `session`.
50
7
 
51
- Raw-tool equivalent:
8
+ ## Start, observe, stop
52
9
 
53
- ```
54
- cua-driver start_recording '{"output_dir":"~/cua-trajectories/run-1"}'
55
- cua-driver get_recording_state
56
- cua-driver stop_recording '{}'
10
+ These are tool calls on that connection, not separate CLI invocations:
11
+
12
+ ```text
13
+ get_recording_state({})
14
+ start_recording({"output_dir":"/absolute/run-dir/trajectory","record_video":true})
15
+ get_recording_state({})
16
+ # Run the authorized workflow and verify every action.
17
+ stop_recording({})
18
+ get_recording_state({})
57
19
  ```
58
20
 
59
- The `recording` subcommands require a running daemon (`cua-driver
60
- serve &`) because recording state is per-process. `output_dir` expands
61
- `~` and is created (with intermediates) if missing. Turn numbering
62
- starts at `1` every time recording is (re-)enabled, regardless of any
63
- existing contents in the directory. State lives in memory only — a
64
- daemon restart resets to disabled.
21
+ Choose an unused output directory: turn numbering restarts at 1. Video is
22
+ off by default; explicitly set `record_video:true` when requested. Inspect
23
+ `video_active` and `last_error`, not just the successful tool status. Per-turn
24
+ capture may continue even when video initialization failed.
25
+
26
+ A recording keeps only its owner's actions. With a `session` label, it keeps
27
+ that session's calls. Without one, it keeps every call on the connection that
28
+ started it, including calls that pass a `session` label. Calls from other
29
+ connections, including one-shot `cua-driver <tool>` processes, and
30
+ `start_session` / `end_session` write no turns. A recording started with CLI
31
+ `cua-driver recording start` has no owning session and records every
32
+ session's actions.
33
+
34
+ There is still one recorder per runtime. Manual `stop_recording` stops
35
+ whichever recording is active, regardless of its starting session. Do not
36
+ start over or stop another run's recording. If a recorder is already active,
37
+ coordinate with its owner rather than taking it over.
38
+
39
+ Stop and inspect `last_video_path` before ending the connection. A disconnect
40
+ can tear down owned recording; a runtime restart loses in-memory state.
41
+ Confirm the expected files exist, inspect images, and decode the finalized
42
+ video before claiming success. A file path alone does not prove a playable
43
+ or correctly scoped recording.
44
+
45
+ CLI `recording start|status|stop` commands also exist, but do not form a
46
+ session-preserving action loop by themselves. Inspect their help rather than
47
+ assuming the convenience command supports every raw-tool argument.
48
+
49
+ ## Platform boundaries
50
+
51
+ - macOS video uses ScreenCaptureKit/SCRecordingOutput (macOS 15+), under the
52
+ responsible runtime's grant. Permission status is not proof of live capture.
53
+ - Windows video uses ffmpeg `gdigrab`; the runtime must be in the interactive
54
+ desktop session.
55
+ - Linux X11 video uses ffmpeg `x11grab`. Native Wayland needs a supported
56
+ compositor-specific recorder and any portal grant; see [LINUX.md](LINUX.md).
57
+ A successful desktop PNG does not establish video availability.
65
58
 
66
59
  ## What each turn folder contains
67
60
 
68
61
  Each action writes to `turn-NNNNN/` (five-digit zero-padded counter):
69
62
 
70
- - `before_state.json` and `after_state.json` — application accessibility
63
+ - `before_state.json` and `after_state.json`: application accessibility
71
64
  state immediately before and after the action. They carry the same
72
- `tree_markdown` and `element_count` shape as `get_window_state`.
73
- - `before.png` and `after.png` — target-window images immediately before
65
+ `tree_markdown` and `element_count` shape as `get_window_state`. Each walk
66
+ is bounded by `start_recording`'s `state_timeout_ms` (default 1000, like
67
+ `get_window_state`'s `timeout_ms`). A walk that runs out of time keeps the
68
+ partial tree, and `evidence.json` marks that phase `truncated` with
69
+ `truncation_reason`, `nodes_visited`, `nodes_pending`, and `timeout_ms`. If
70
+ an accessibility provider stops answering, the turn continues without
71
+ state and records `state_capture_timeout`. For an action refused before
72
+ dispatch, such as a click with an unknown or expired `capture_id`, the
73
+ state walk is skipped and the state is recorded as `not_applicable` with
74
+ the classification `action_refused_before_dispatch`. Pass
75
+ `include_accessibility_tree: false` to record without state.
76
+ - `before.png` and `after.png`: target-window images immediately before
74
77
  and after the action. Window capture remains scoped to the target when
75
78
  another window covers it.
76
- - `evidence.json` — capture status for each phase. Missing expected capture
79
+ - `evidence.json`: capture status for each phase. Missing expected capture
77
80
  has an explicit classification instead of disappearing from the turn.
78
- - `app_state.json` and `screenshot.png` — compatibility aliases for
81
+ - `app_state.json` and `screenshot.png`: compatibility aliases for
79
82
  `after_state.json` and `after.png`.
80
- - `action.json` — the tool name, full input arguments, result
83
+ - `action.json`: the tool name, full input arguments, result
81
84
  summary, result-error flag, pid, click point (when applicable), ISO-8601
82
85
  timestamp.
83
- - `click.png` — for click-family actions (`click`, `double_click`,
86
+ - `click.png`: for click-family actions (`click`, `double_click`,
84
87
  `right_click`): a copy of the pre-input image with a red marker drawn at
85
88
  the click point. Usually that source is `before.png`. When Windows scrolls
86
89
  an element into view during an action, it retains an additional
@@ -90,7 +93,7 @@ Each action writes to `turn-NNNNN/` (five-digit zero-padded counter):
90
93
  status. The original before/after images and state remain intact.
91
94
  **Both addressing modes are covered:** explicit
92
95
  `x, y` clicks use the platform's recording-coordinate mapping, and
93
- `element_index`-addressed clicks resolve to the element's center
96
+ `element_token`-addressed clicks resolve to the element's center
94
97
  via the live AX/UIA cache, then convert to the retained image's coordinate
95
98
  space. Native Hyprland recording retains the output image, so both kinds of
96
99
  marker use output coordinates. Pixel markers also account for the target
@@ -109,54 +112,21 @@ Each action writes to `turn-NNNNN/` (five-digit zero-padded counter):
109
112
  Out-of-image points are rejected, never moved to an image edge. Other dispatched clicks whose markers
110
113
  cannot be resolved or rendered remain evidence failures.
111
114
 
112
- ## When to use it
113
-
114
- - Demos and screen recordings — play the turn folder back to show
115
- exactly what the agent saw and what it did.
116
- - Replay for regression — re-run the same sequence against a future
117
- build and diff the new trajectory against the saved one.
118
- - Training data collection — each turn is a
119
- `(state, action, next_state)` triple ready for offline learning.
115
+ ## Replay is a new action sequence
120
116
 
121
- ## When to invoke it
117
+ `replay_trajectory` invokes recorded arguments in turn order; it is not a
118
+ semantic task planner. It accepts `dir`, `delay_ms`, and `stop_on_error`.
119
+ Read its live schema before use, and obtain authorization for the actions
120
+ being replayed.
122
121
 
123
- This skill does **not** auto-enable recording. The client invokes
124
- `start_recording` explicitly when the user asks to capture a session.
125
- If the user says "record this session" or similar, call
126
- `start_recording({output_dir:…})` before the first action (video on
127
- by default; pass `record_video: false` to opt out), and
128
- `stop_recording({})` when done.
129
-
130
- ## Replaying a recorded trajectory
131
-
132
- `replay_trajectory({dir})` walks `<dir>/turn-NNNNN/` folders in
133
- lexical order, reads each `action.json`, and re-invokes the recorded
134
- tool with its recorded `arguments`. Optional knobs: `delay_ms`
135
- (pacing between turns, default 500) and `stop_on_error` (halt on
136
- first failure, default true).
137
-
138
- ```
139
- cua-driver recording start ~/cua-trajectories/demo1
140
- # … run the workflow …
141
- cua-driver recording stop
142
- # Later: replay against a new build.
143
- cua-driver replay_trajectory '{"dir":"~/cua-trajectories/demo1","delay_ms":500}'
144
- ```
122
+ Recorded PIDs, window IDs, element tokens, browser refs, and geometry can all
123
+ be stale. Read-only snapshots are not part of the action sequence, so replay
124
+ does not automatically refresh element handles. Pixel/key actions also need
125
+ the original target identity, layout, and focus; they are not portable merely
126
+ because they lack an element token.
145
127
 
146
- Important caveat: **element_index doesn't survive across sessions**.
147
- Indices are assigned fresh on every `get_window_state` snapshot,
148
- keyed on `(pid, window_id)`, so a recorded
149
- `click({pid, window_id, element_index: 14})` from yesterday won't
150
- resolve today — the pid is usually different, the window_id always
151
- is. The call returns `Invalid element_index` or `No cached AX
152
- state`. Pixel clicks (`click({pid, x, y})`) and keyboard tools
153
- (`press_key`, `hotkey`, `type_text` without element_index) replay cleanly; element-indexed actions require a
154
- live snapshot that replay doesn't currently re-emit (read-only tools
155
- like `get_window_state` aren't recorded). For a reliable replay, either
156
- compose the trajectory from pixel + keyboard primitives, or capture
157
- it as a regression artifact (compare the failure/success pattern
158
- across builds) rather than a re-driving script.
159
-
160
- If recording is still enabled while replay runs, the replay is
161
- itself recorded into the current output directory — that's the
162
- intended regression-diff workflow.
128
+ Use trajectories as evidence unless current targets and preconditions are
129
+ independently established. Never replay canceled, partial, or unknown actions
130
+ to discover whether they originally landed. If recording remains enabled
131
+ during replay, the replay itself may produce new turns; keep source and output
132
+ directories distinct.
@@ -0,0 +1,113 @@
1
+ # Runtime, ownership, and authorization
2
+
3
+ ## Preflight and transport
4
+
5
+ ```bash
6
+ cua-driver --version
7
+ cua-driver status
8
+ cua-driver doctor
9
+ cua-driver list-tools
10
+ cua-driver describe get_window_state
11
+ cua-driver describe click
12
+ ```
13
+
14
+ Check the resolved executable as well as the version; an installation may have intentional wrappers or multiple products. Preserve them. The client's version alone does not identify an already-running daemon. If the service is mismatched or missing, inspect its existing owner before starting or restarting anything.
15
+
16
+ Use the advertised `tools/list` contract over MCP. Tool names are `snake_case`; CLI management commands are `kebab-case`. Inspect only unfamiliar tools instead of loading every schema. Descriptions may lag implementation: capability discovery proves advertised shape, while fresh application state proves behavior.
17
+
18
+ | Client | State ownership |
19
+ | ------------------------------------------ | ------------------------------------------------------------------------------------ |
20
+ | CLI with an explicit non-default `session` | Calls to the same daemon share the named CLI lifecycle until `end_session` or expiry |
21
+ | CLI without a named session | Disposable implicit lease, cleaned up after the response |
22
+ | Persistent MCP/SDK connection | One private transport lifecycle; implicit or explicitly named runs live within it |
23
+
24
+ Use the CLI by default when a shell is available, or the existing MCP connection when the caller provides one. A multi-call CLI workflow must pass the same nonempty, non-`default` label on every call that accepts it. Tools without a public session parameter, particularly recording controls, need one persistent MCP connection for a coherent lifecycle.
25
+
26
+ Bare MCP owns a runtime on Windows/Linux and uses the signed service identity on macOS. `cua-driver mcp --socket <endpoint>` explicitly selects a service. One-shot CLI calls are service-backed. Starting a process that serves MCP is not the same as connecting a client: use the harness's MCP integration, not independent shell writes to a dead stdin.
27
+
28
+ For missing software, use the installation instructions in [README.md](README.md) with user approval. `check-update` is read-only; `update --apply` installs software. After an approved update, check both the executable and daemon. Do not interpret a nonzero updater exit as proof that nothing changed.
29
+
30
+ `skills update` replaces the installed pack. Back up personal edits before refreshing. `skills install --from main` is for source validation, not proof of compatibility with a release binary. Other platform guides are installed only with `--all-platforms`.
31
+
32
+ The old computer-use compatibility flag does not add a screenshot tool. Use `get_window_state` or explicitly authorized `get_desktop_state`.
33
+
34
+ ## Session lifecycle
35
+
36
+ For multi-call work, prefer a short public label and pass the same label on every call that accepts it. Passing it once is not sticky: omission uses the transport's implicit session. Named CLI state is shared only within the daemon's CLI namespace, not with arbitrary MCP connections or a new daemon generation.
37
+
38
+ `start_session` is optional: actions can establish the run. Use it to configure the initial cursor theme or revive a name after `end_session`. The default idle TTL is five minutes; do not assume a long human permission wait preserves handles.
39
+
40
+ ```bash
41
+ cua-driver start_session '{"session":"run-1"}'
42
+ # Discover, observe, act, and verify; repeat session:"run-1".
43
+ cua-driver end_session '{"session":"run-1"}'
44
+ ```
45
+
46
+ Explicit targets own observation/input modality, not session configuration. There is no `deescalate_session`. Do not use retired `capture_scope` settings or legacy escalation-session tools in new workflows. Reserved fields such as `_session_id` belong to the transport, never to an agent.
47
+
48
+ Keep one controller per shared desktop. Separate sessions/cursors do not isolate global keyboard focus, physical input, a single-instance application, or another observer's snapshot cache. `creates_new_application_instance:true` requests a separate instance where supported; verify distinct processes/windows before concurrent work. For independent MCP work, use independent connections as well.
49
+
50
+ ## Foreground boundary
51
+
52
+ `delivery_mode:"foreground"` is a user-visible takeover boundary, not an automatic retry. Use it only when the user already authorized visible control for this workflow or after asking. It can change focus, workspace, or the physical cursor; restoration is best-effort and adapter-dependent.
53
+
54
+ If foreground control is not authorized, stop with the driver's refusal instead of silently escalating. Refresh state and do not retry automatically. An authorized desktop target intentionally uses system input, but it still requires the exact display resource to be admitted. A failed window capture is not desktop permission.
55
+
56
+ Use Cua's tools rather than shell activation/input shims. `bring_to_front` is reserved for requested persistent foreground state or a focus-proxy surface that must remain active across calls. A native menu operation can also activate temporarily; prefer an in-window control when background posture matters.
57
+
58
+ ## Keep authorization separate from sessions
59
+
60
+ The trusted host selects one permission profile at startup. `standard` keeps
61
+ the normal profile behavior and residual approval requirements, `bounded`
62
+ requires a reviewed capability manifest and has no runtime approval path, and
63
+ `unrestricted` bypasses Cua approval prompts after explicit risk acceptance.
64
+ Hard invariants plus managed and user policy remain binding in every profile.
65
+
66
+ An optional capability manifest is a deny-by-default ceiling in `standard` and
67
+ `unrestricted`; `bounded` requires one. It can remove tools or typed resources
68
+ from the selected profile, but it cannot grant a tool, resource, or approval
69
+ bypass that another authorization layer denies. Approval is considered only
70
+ after the tool and every adapter-attested resource are inside manifest scope.
71
+
72
+ Use the canonical startup pair together:
73
+
74
+ ```bash
75
+ cua-driver mcp \
76
+ --permission-mode standard \
77
+ --capability-manifest ./capabilities.yaml \
78
+ --approve-capability-manifest
79
+ ```
80
+
81
+ Capability manifest v3 omits file-level `mode` and `ask.tools`. Its
82
+ `allow.tools` list is nonempty. Lifetime fields are optional in `standard` and
83
+ `unrestricted`; `bounded` requires both `expires_after` and `idle_timeout`.
84
+ The older `--session-policy` names remain compatibility aliases and must not be
85
+ used in new configurations.
86
+
87
+ Starting, ending, naming, reconnecting, or omitting a session never changes
88
+ permission authority. A public session label is lifecycle metadata, never a
89
+ grant, caller identity, or bearer credential.
90
+
91
+ ## Cursor feedback
92
+
93
+ Keep the agent overlay visible while controlling pointer or keyboard input. Cursor-bearing and keyboard actions re-show it automatically. The overlay indicates activity, not proof that input landed.
94
+
95
+ On Linux, ordinary `move_cursor({x,y})` moves only this synthetic cursor. The explicit desktop-pointer escape hatch must not be used unless the user asked for real-pointer control; inspect `describe move_cursor` for that tool's supported target form.
96
+
97
+ Pixel `click` already animates the cursor. Do not precede it with `move_cursor` at the same point: that adds a second glide. Use `move_cursor` to indicate a location without clicking or seed the cursor before accessibility actions.
98
+
99
+ The default theme provides session-colored pointer/glow, action marks, and activity animations. Named sessions have stable palette colors. Native hosts own delivery/target badges separately from theme artwork; cursor state is scoped to the private lifecycle.
100
+
101
+ `set_agent_cursor_enabled` controls idle visibility. `set_agent_cursor_motion` takes `style` (`signature_arc` default, `spring_settle`, `magnetic`, `comet_swoop`, `adaptive`, `classic`), `timing` (`native`, `fitts`, `fixed`), `effects` (`trail`, `glow`, `magnet`, `ripple`, `squish` booleans; null restores the style default), and the arc knobs `start_handle`, `end_handle`, `arc_size`, `arc_flow` (bezier styles) plus `spring` and `turn_radius` (`classic`) where advertised. Choose preinstalled artwork with `set_agent_cursor_theme`; `cursor_id` on input tools is not a theme selector. Never supply inline theme code or arbitrary source paths through agent tools. The trusted local `cursor-theme` workflow owns validation, compilation, preview, installation, and removal.
102
+
103
+ Overlay operations need a suitable UI event loop. macOS direct SDK/MCP runtimes without a certified host main-thread adapter can return `facility_unavailable`; do not report that as a successful move. See [EMBEDDING.md](EMBEDDING.md).
104
+
105
+ ## Cleanup and evidence
106
+
107
+ Finish the owned recording, inspect its result, then end the run. Existing-profile browser cleanup can restore settings Cua enabled; check `end_session` errors and follow [BROWSER.md](BROWSER.md) rather than abandoning cleanup silently.
108
+
109
+ Do not stop a shared daemon or close the user's app merely because the task ended. Close an application only when requested, using its normal UI and handling unsaved-work prompts without discarding data.
110
+
111
+ Preserve raw screenshots and action results in a run-specific directory. Report the observed postcondition, relevant version/platform, and any remaining limitation. Review captures for private content before attaching them to a public issue or PR.
112
+
113
+ For a local MCP HTTP endpoint, the trusted host owns `CUA_DRIVER_RS_MCP_HTTP_PORT` and a host-generated token of at least 32 characters in `CUA_DRIVER_RS_MCP_HTTP_TOKEN`. The client authenticates with the bearer header. Never print credentials or treat a public session label as authentication.