@bastani/atomic 0.9.28-alpha.2 → 0.9.28-alpha.4

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 (327) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/builtin/intercom/package.json +2 -2
  3. package/dist/builtin/mcp/native-client-licenses/NOTICE +2 -0
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  6. package/dist/builtin/subagents/package.json +3 -3
  7. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +1 -1
  8. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +60 -39
  9. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +119 -36
  10. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +225 -183
  11. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +120 -89
  12. package/dist/builtin/subagents/skills/cua-driver/README.md +16 -7
  13. package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +85 -115
  14. package/dist/builtin/subagents/skills/cua-driver/RUNTIME.md +113 -0
  15. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +55 -1071
  16. package/dist/builtin/subagents/skills/cua-driver/VISUAL.md +125 -0
  17. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +145 -185
  18. package/dist/builtin/subagents/skills/cua-driver/WORKFLOW.md +173 -0
  19. package/dist/builtin/web-access/package.json +2 -2
  20. package/dist/builtin/workflows/CHANGELOG.md +21 -0
  21. package/dist/builtin/workflows/README.md +1 -1
  22. package/dist/builtin/workflows/package.json +2 -2
  23. package/dist/builtin/workflows/skills/impeccable/SKILL.md +8 -2
  24. package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +6 -0
  25. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -1
  26. package/dist/builtin/workflows/skills/impeccable/reference/component-review.md +63 -0
  27. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +5 -0
  28. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +1 -1
  29. package/dist/builtin/workflows/skills/impeccable/reference/generate.md +101 -0
  30. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +9 -0
  31. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +3 -1
  32. package/dist/builtin/workflows/skills/impeccable/reference/mode-operate.md +21 -0
  33. package/dist/builtin/workflows/skills/impeccable/reference/mode-persuade.md +19 -0
  34. package/dist/builtin/workflows/skills/impeccable/reference/mode-read.md +21 -0
  35. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +19 -12
  36. package/dist/builtin/workflows/skills/impeccable/reference/region-map.md +26 -0
  37. package/dist/builtin/workflows/skills/impeccable/reference/routing.md +1 -1
  38. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +5 -5
  39. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
  40. package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +4 -0
  41. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +2 -2
  42. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +5 -1
  43. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +524 -4
  44. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +1 -0
  45. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +81 -0
  46. package/dist/builtin/workflows/src/extension/index.bundle.mjs +14733 -14704
  47. package/dist/cli/args.d.ts.map +1 -1
  48. package/dist/cli/args.js +8 -1
  49. package/dist/cli/args.js.map +1 -1
  50. package/dist/codemode-worker.js +2 -2
  51. package/dist/config.d.ts +2 -1
  52. package/dist/config.d.ts.map +1 -1
  53. package/dist/config.js +4 -2
  54. package/dist/config.js.map +1 -1
  55. package/dist/core/agent-session-compaction.d.ts +3 -3
  56. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  57. package/dist/core/agent-session-compaction.js +5 -1
  58. package/dist/core/agent-session-compaction.js.map +1 -1
  59. package/dist/core/agent-session-events.d.ts.map +1 -1
  60. package/dist/core/agent-session-events.js +1 -0
  61. package/dist/core/agent-session-events.js.map +1 -1
  62. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  63. package/dist/core/agent-session-extension-bindings.js +7 -2
  64. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  65. package/dist/core/agent-session-methods.d.ts +7 -1
  66. package/dist/core/agent-session-methods.d.ts.map +1 -1
  67. package/dist/core/agent-session-methods.js.map +1 -1
  68. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  69. package/dist/core/agent-session-prompt.js +3 -2
  70. package/dist/core/agent-session-prompt.js.map +1 -1
  71. package/dist/core/agent-session-tool-registry.js.map +1 -1
  72. package/dist/core/agent-session-types.d.ts +2 -0
  73. package/dist/core/agent-session-types.d.ts.map +1 -1
  74. package/dist/core/agent-session-types.js.map +1 -1
  75. package/dist/core/agent-session.d.ts +2 -0
  76. package/dist/core/agent-session.d.ts.map +1 -1
  77. package/dist/core/agent-session.js +6 -1
  78. package/dist/core/agent-session.js.map +1 -1
  79. package/dist/core/bash-executor.d.ts.map +1 -1
  80. package/dist/core/bash-executor.js +22 -4
  81. package/dist/core/bash-executor.js.map +1 -1
  82. package/dist/core/child-session-options.d.ts.map +1 -1
  83. package/dist/core/child-session-options.js +17 -2
  84. package/dist/core/child-session-options.js.map +1 -1
  85. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  86. package/dist/core/export-html/tool-renderer.js +2 -0
  87. package/dist/core/export-html/tool-renderer.js.map +1 -1
  88. package/dist/core/extensions/agent-events.d.ts +2 -0
  89. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  90. package/dist/core/extensions/agent-events.js.map +1 -1
  91. package/dist/core/extensions/context-types.d.ts +2 -0
  92. package/dist/core/extensions/context-types.d.ts.map +1 -1
  93. package/dist/core/extensions/context-types.js.map +1 -1
  94. package/dist/core/extensions/loader-virtual-modules.d.ts +3 -4
  95. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  96. package/dist/core/extensions/loader-virtual-modules.js +14 -9
  97. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  98. package/dist/core/extensions/mcp-server-registry.d.ts +4 -1
  99. package/dist/core/extensions/mcp-server-registry.d.ts.map +1 -1
  100. package/dist/core/extensions/mcp-server-registry.js +7 -4
  101. package/dist/core/extensions/mcp-server-registry.js.map +1 -1
  102. package/dist/core/extensions/runner.d.ts +3 -0
  103. package/dist/core/extensions/runner.d.ts.map +1 -1
  104. package/dist/core/extensions/runner.js +19 -0
  105. package/dist/core/extensions/runner.js.map +1 -1
  106. package/dist/core/extensions/tool-events.d.ts +1 -1
  107. package/dist/core/extensions/tool-events.js.map +1 -1
  108. package/dist/core/extensions/tool-types.d.ts +2 -0
  109. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  110. package/dist/core/extensions/tool-types.js.map +1 -1
  111. package/dist/core/extensions/ts-source-specifiers.d.ts +18 -0
  112. package/dist/core/extensions/ts-source-specifiers.d.ts.map +1 -0
  113. package/dist/core/extensions/ts-source-specifiers.js +142 -0
  114. package/dist/core/extensions/ts-source-specifiers.js.map +1 -0
  115. package/dist/core/fast-model-variants.d.ts.map +1 -1
  116. package/dist/core/fast-model-variants.js +3 -2
  117. package/dist/core/fast-model-variants.js.map +1 -1
  118. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  119. package/dist/core/model-resolver-defaults.js +2 -0
  120. package/dist/core/model-resolver-defaults.js.map +1 -1
  121. package/dist/core/nested-tool-calls.d.ts +1 -0
  122. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  123. package/dist/core/nested-tool-calls.js +1 -0
  124. package/dist/core/nested-tool-calls.js.map +1 -1
  125. package/dist/core/sdk-exports.d.ts +2 -2
  126. package/dist/core/sdk-exports.js.map +1 -1
  127. package/dist/core/sdk-types.d.ts +3 -0
  128. package/dist/core/sdk-types.d.ts.map +1 -1
  129. package/dist/core/sdk-types.js.map +1 -1
  130. package/dist/core/sdk.d.ts.map +1 -1
  131. package/dist/core/sdk.js +17 -8
  132. package/dist/core/sdk.js.map +1 -1
  133. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  134. package/dist/core/settings-manager-core.js.map +1 -1
  135. package/dist/core/settings-merge.d.ts +3 -0
  136. package/dist/core/settings-merge.d.ts.map +1 -1
  137. package/dist/core/settings-merge.js +18 -4
  138. package/dist/core/settings-merge.js.map +1 -1
  139. package/dist/core/settings-storage.js.map +1 -1
  140. package/dist/core/settings-types.js.map +1 -1
  141. package/dist/core/tools/bash.d.ts.map +1 -1
  142. package/dist/core/tools/bash.js +7 -3
  143. package/dist/core/tools/bash.js.map +1 -1
  144. package/dist/core/tools/edit.js +1 -1
  145. package/dist/core/tools/edit.js.map +1 -1
  146. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  147. package/dist/extensions/codemode/execute.js +69 -8
  148. package/dist/extensions/codemode/execute.js.map +1 -1
  149. package/dist/extensions/codemode/index.d.ts.map +1 -1
  150. package/dist/extensions/codemode/index.js +7 -0
  151. package/dist/extensions/codemode/index.js.map +1 -1
  152. package/dist/extensions/codemode/tool.d.ts +2 -0
  153. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  154. package/dist/extensions/codemode/tool.js +4 -2
  155. package/dist/extensions/codemode/tool.js.map +1 -1
  156. package/dist/extensions/llama/provider.d.ts.map +1 -1
  157. package/dist/extensions/llama/provider.js +19 -8
  158. package/dist/extensions/llama/provider.js.map +1 -1
  159. package/dist/extensions/mcp/cli.js +18 -24
  160. package/dist/extensions/mcp/cli.js.map +1 -1
  161. package/dist/extensions/mcp/client/auth-provider.d.ts +4 -0
  162. package/dist/extensions/mcp/client/auth-provider.d.ts.map +1 -1
  163. package/dist/extensions/mcp/client/auth-provider.js.map +1 -1
  164. package/dist/extensions/mcp/client/oauth/discovery.d.ts +3 -0
  165. package/dist/extensions/mcp/client/oauth/discovery.d.ts.map +1 -1
  166. package/dist/extensions/mcp/client/oauth/discovery.js +8 -5
  167. package/dist/extensions/mcp/client/oauth/discovery.js.map +1 -1
  168. package/dist/extensions/mcp/client/oauth/flow.d.ts +4 -0
  169. package/dist/extensions/mcp/client/oauth/flow.d.ts.map +1 -1
  170. package/dist/extensions/mcp/client/oauth/flow.js +12 -2
  171. package/dist/extensions/mcp/client/oauth/flow.js.map +1 -1
  172. package/dist/extensions/mcp/client/transports/streamable-http.d.ts +3 -0
  173. package/dist/extensions/mcp/client/transports/streamable-http.d.ts.map +1 -1
  174. package/dist/extensions/mcp/client/transports/streamable-http.js +17 -14
  175. package/dist/extensions/mcp/client/transports/streamable-http.js.map +1 -1
  176. package/dist/extensions/mcp/index.d.ts.map +1 -1
  177. package/dist/extensions/mcp/index.js +150 -72
  178. package/dist/extensions/mcp/index.js.map +1 -1
  179. package/dist/extensions/mcp/oauth.d.ts +5 -3
  180. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  181. package/dist/extensions/mcp/oauth.js +36 -10
  182. package/dist/extensions/mcp/oauth.js.map +1 -1
  183. package/dist/extensions/mcp/ui.d.ts +3 -3
  184. package/dist/extensions/mcp/ui.d.ts.map +1 -1
  185. package/dist/extensions/mcp/ui.js +10 -2
  186. package/dist/extensions/mcp/ui.js.map +1 -1
  187. package/dist/index.d.ts +2 -2
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js.map +1 -1
  190. package/dist/main-deferred-startup.d.ts +1 -0
  191. package/dist/main-deferred-startup.d.ts.map +1 -1
  192. package/dist/main-deferred-startup.js +9 -21
  193. package/dist/main-deferred-startup.js.map +1 -1
  194. package/dist/main.d.ts.map +1 -1
  195. package/dist/main.js +8 -6
  196. package/dist/main.js.map +1 -1
  197. package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
  198. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  199. package/dist/modes/interactive/components/bash-execution.js +17 -14
  200. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  201. package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
  202. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  203. package/dist/modes/interactive/components/branch-summary-message.js +5 -2
  204. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  205. package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -0
  206. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  207. package/dist/modes/interactive/components/chat-message-renderer.js +19 -8
  208. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  209. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +3 -2
  210. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  211. package/dist/modes/interactive/components/compaction-boundary-message.js +7 -4
  212. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  213. package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
  214. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  215. package/dist/modes/interactive/components/custom-entry.js +8 -2
  216. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  217. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  218. package/dist/modes/interactive/components/custom-message.js +1 -0
  219. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  220. package/dist/modes/interactive/components/settings-selector-items.js +1 -1
  221. package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
  222. package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
  223. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  224. package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
  225. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  226. package/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  227. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  228. package/dist/modes/interactive/components/tool-execution.js +10 -0
  229. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  230. package/dist/modes/interactive/interactive-agent-events.js +3 -1
  231. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  232. package/dist/modes/interactive/interactive-auth-login.js +6 -0
  233. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  234. package/dist/modes/interactive/interactive-bash-compact.js +2 -2
  235. package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
  236. package/dist/modes/interactive/interactive-extension-dialogs.js +11 -2
  237. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  238. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  239. package/dist/modes/interactive/interactive-input-handling.js +1 -47
  240. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  241. package/dist/modes/interactive/interactive-mode-base.d.ts +3 -1
  242. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  243. package/dist/modes/interactive/interactive-mode-base.js +6 -1
  244. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  245. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -2
  246. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  247. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  248. package/dist/modes/interactive/interactive-prompt-restore.d.ts.map +1 -1
  249. package/dist/modes/interactive/interactive-prompt-restore.js +0 -5
  250. package/dist/modes/interactive/interactive-prompt-restore.js.map +1 -1
  251. package/dist/modes/interactive/interactive-render-chat.js +7 -10
  252. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  253. package/dist/modes/interactive/interactive-selectors.js +8 -1
  254. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  255. package/dist/modes/interactive/interactive-session-runtime.js +1 -0
  256. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  257. package/dist/modes/interactive/interactive-startup.js +1 -0
  258. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  259. package/dist/modes/interactive/program-status-reporter.d.ts +24 -0
  260. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
  261. package/dist/modes/interactive/program-status-reporter.js +96 -0
  262. package/dist/modes/interactive/program-status-reporter.js.map +1 -0
  263. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  264. package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
  265. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  266. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  267. package/dist/modes/interactive-engine/engine-render-service.js +3 -1
  268. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  269. package/dist/modes/interactive-engine/protocol.d.ts +1 -0
  270. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  271. package/dist/modes/interactive-engine/protocol.js +1 -0
  272. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  273. package/dist/modes/interactive-engine/remote-renderer.d.ts +3 -0
  274. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  275. package/dist/modes/interactive-engine/remote-renderer.js +7 -0
  276. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  277. package/dist/modes/rpc/rpc-client-process.d.ts +7 -0
  278. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  279. package/dist/modes/rpc/rpc-client-process.js +20 -3
  280. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  281. package/dist/modes/rpc/rpc-command-timeouts.d.ts.map +1 -1
  282. package/dist/modes/rpc/rpc-command-timeouts.js +1 -0
  283. package/dist/modes/rpc/rpc-command-timeouts.js.map +1 -1
  284. package/dist/utils/ansi.d.ts +8 -0
  285. package/dist/utils/ansi.d.ts.map +1 -1
  286. package/dist/utils/ansi.js +29 -10
  287. package/dist/utils/ansi.js.map +1 -1
  288. package/dist/utils/clipboard.d.ts.map +1 -1
  289. package/dist/utils/clipboard.js +13 -3
  290. package/dist/utils/clipboard.js.map +1 -1
  291. package/dist/utils/image-resize-core.d.ts +8 -0
  292. package/dist/utils/image-resize-core.d.ts.map +1 -1
  293. package/dist/utils/image-resize-core.js +1 -0
  294. package/dist/utils/image-resize-core.js.map +1 -1
  295. package/dist/utils/image-resize-worker.js +3 -2
  296. package/dist/utils/image-resize-worker.js.map +1 -1
  297. package/dist/utils/image-resize.d.ts +2 -2
  298. package/dist/utils/image-resize.d.ts.map +1 -1
  299. package/dist/utils/image-resize.js +7 -10
  300. package/dist/utils/image-resize.js.map +1 -1
  301. package/docs/codemode.md +30 -6
  302. package/docs/compaction.md +1 -1
  303. package/docs/computer-use.md +9 -9
  304. package/docs/custom-provider/streaming.md +4 -0
  305. package/docs/environment-variables.md +2 -0
  306. package/docs/extensions/api-reference.md +1 -1
  307. package/docs/extensions/authoring.md +2 -0
  308. package/docs/extensions/events.md +5 -1
  309. package/docs/getting-started/first-session.md +1 -1
  310. package/docs/json.md +6 -1
  311. package/docs/llama-cpp.md +9 -2
  312. package/docs/mcp-servers.md +3 -3
  313. package/docs/models/evals.md +34 -3
  314. package/docs/models.md +10 -0
  315. package/docs/providers.md +35 -4
  316. package/docs/reference/cli.md +2 -2
  317. package/docs/sdk/reference.md +3 -3
  318. package/docs/sdk.md +7 -1
  319. package/docs/settings.md +3 -3
  320. package/docs/skills.md +1 -1
  321. package/docs/terminal-setup.md +14 -0
  322. package/docs/tools.md +1 -1
  323. package/docs/workflows/authoring.md +3 -3
  324. package/docs/workflows/operations.md +2 -2
  325. package/examples/extensions/sandbox/package-lock.json +3 -3
  326. package/npm-shrinkwrap.json +67 -67
  327. package/package.json +8 -8
@@ -18,7 +18,7 @@ does not attribute Accessibility or Screen Recording to an executable path.
18
18
  It attributes them to the **responsible process**: the app at the top of the
19
19
  process's launch chain, as tracked by the kernel/LaunchServices. When your
20
20
  signed app spawns a child with `posix_spawn`, `NSTask`/`Process`, or plain
21
- `fork`/`exec`, that child stays inside _your_ responsibility chain — TCC
21
+ `fork`/`exec`, that child stays inside _your_ responsibility chain: TCC
22
22
  checks made by the child are answered with **your app's** grants, and any
23
23
  prompt it triggered would name **your app**. This is exactly the behavior
24
24
  embedding relies on: grant once to the host, and every well-behaved child
@@ -30,11 +30,11 @@ _not_ do (and, in embedded mode, does not do). First, launching via
30
30
  LaunchServices (`open -a …`, `NSWorkspace.open`) makes the launched app its
31
31
  own responsible process. Second, a process can explicitly _disclaim_
32
32
  responsibility for a child (`responsibility_spawnattrs_setdisclaim`), making
33
- the child its own responsible process — standalone cua-driver does this on
33
+ the child its own responsible process: standalone cua-driver does this on
34
34
  purpose so its permissions attach to a stable `com.trycua.driver` identity
35
35
  instead of whatever terminal launched it. Embedded mode turns that off.
36
36
 
37
- Note this is TCC **responsibility** inheritance — it is unrelated to App
37
+ Note this is TCC **responsibility** inheritance: it is unrelated to App
38
38
  Sandbox inheritance (`com.apple.security.inherit`). This guide assumes a
39
39
  non-sandboxed host, which is typical for agent harnesses; a sandboxed host
40
40
  spawning a non-sandboxed helper raises separate App Sandbox questions that
@@ -77,7 +77,7 @@ the automation runtime isolated from the application process.
77
77
  ## Launching the daemon-backed host
78
78
 
79
79
  ```sh
80
- # env var form — set by the host on the child process
80
+ # env var form: set by the host on the child process
81
81
  CUA_DRIVER_EMBEDDED=1 CUA_DRIVER_HOST_BUNDLE_ID=com.yourco.yourapp \
82
82
  cua-driver serve --socket /tmp/yourapp-cua.sock
83
83
 
@@ -89,20 +89,20 @@ Requirements on the host side:
89
89
 
90
90
  - **Spawn `cua-driver serve --embedded` directly** as a child process
91
91
  (`Process`/`NSTask`, `posix_spawn`, `exec` from your own code). Do
92
- **not** launch the daemon via `open(1)` or `NSWorkspace` — that hands it
92
+ **not** launch the daemon via `open(1)` or `NSWorkspace`: that hands it
93
93
  to LaunchServices and breaks inheritance.
94
94
  - Give the daemon a private socket and wait until it is accepting connections.
95
95
  - Spawn `cua-driver mcp --embedded --socket <path>` and speak MCP over that
96
96
  proxy's stdin/stdout (line-delimited JSON-RPC). The proxy never executes
97
97
  tools; the host-owned daemon does.
98
98
  - Request Accessibility and Screen Recording **from your app** before (or
99
- after — the driver just reports "not granted" until then) starting the
99
+ after: the driver just reports "not granted" until then) starting the
100
100
  driver, using `AXIsProcessTrustedWithOptions([kAXTrustedCheckOptionPrompt: true])`
101
101
  and `CGRequestScreenCaptureAccess()`.
102
102
 
103
103
  Only the exact value `CUA_DRIVER_EMBEDDED=1` enables embedded mode; anything
104
104
  else is ignored (fail-safe). `--host-bundle-id` is an advisory label echoed
105
- in `check_permissions` output and logs — it is **not** a trust signal; trust
105
+ in `check_permissions` output and logs: it is **not** a trust signal; trust
106
106
  comes from the OS responsibility chain, so there is nothing to spoof by
107
107
  setting it.
108
108
 
@@ -200,6 +200,89 @@ daemon child.
200
200
  - Permission changes require destroying clients, restarting the daemon, and
201
201
  reconnecting. A connection from the old generation is never reusable.
202
202
 
203
+ ## Bounding the post-action window observation
204
+
205
+ After an input action, the driver watches the window list for a short time so
206
+ it can report a menu, dialog, or new window that the action opened. On macOS,
207
+ that watch lasts up to 1000 ms for an action that opens nothing, which makes it
208
+ the largest part of a background click's latency. A host that already observes
209
+ its target continuously can shorten it through two variables set at trusted
210
+ launch, in the environment of the `serve --embedded` child (or of the host
211
+ process when you use the same-process runtime). `EmbeddedCuaDriverHost` starts
212
+ that child from an allowlisted environment that admits both variables, so pass
213
+ them in its `environment` option or set them in the host process:
214
+
215
+ | Variable | Meaning | Default | Accepted range |
216
+ | ------------------------------------- | ---------------------------------------------------- | ------------------------------- | ----------------------------------------- |
217
+ | `CUA_DRIVER_WINDOW_CHANGE_TIMEOUT_MS` | Longest wait for a window change after each action. | 1000 on macOS, 800 on Linux X11 | 0 to 10000; larger values are clamped |
218
+ | `CUA_DRIVER_WINDOW_CHANGE_POLL_MS` | Interval between window-list reads during that wait. | 50 | 5 to 1000, and never longer than the wait |
219
+
220
+ Unset, empty, or unparsable values, such as `-1`, `1.5`, or `100ms`, keep the
221
+ default, so a daemon launched without these variables behaves exactly as
222
+ before. No tool argument can change the bound. Every ingress strips
223
+ underscore-prefixed arguments, so an agent cannot shorten its own focus
224
+ protection.
225
+
226
+ ```sh
227
+ CUA_DRIVER_EMBEDDED=1 \
228
+ CUA_DRIVER_WINDOW_CHANGE_TIMEOUT_MS=200 \
229
+ cua-driver serve --embedded --socket /tmp/yourapp-cua.sock
230
+ ```
231
+
232
+ A shorter wait costs something on each platform. Choose a value knowingly.
233
+
234
+ - **macOS: less focus protection.** The watch also holds a focus-steal lease:
235
+ while it runs, the driver reactivates the app that was frontmost before the
236
+ action if any other app activates, such as a browser opened by a link. The
237
+ lease ends when the watch ends. With a nonzero value, cross-app activations
238
+ are reverted only for that long after the action returns. With `0`, the lease
239
+ is released as soon as the action returns. The separate target-pid guard
240
+ remains, and it still covers the action plus a 50 ms settle when the target
241
+ was not frontmost. An app that activates later stays frontmost, so the host
242
+ must detect and correct that itself.
243
+ - **macOS: missing result suffixes.** A window that appears after the wait
244
+ ends is not reported. With `0`, results never carry
245
+ `Action opened new window(s): …` or
246
+ `Action caused a different app to become frontmost.`
247
+ - **Linux X11 foreground delivery: weaker evidence.** A foreground-delivery
248
+ action (`"delivery_mode": "foreground"`) reports `effect: "confirmed"` when
249
+ the target opened or closed a window during the wait. A dialog that maps after a shorter wait
250
+ leaves the action `unverifiable`. Qt file dialogs can take 300 to 600 ms to
251
+ map. With `0`, foreground actions never report window-change evidence. Focus
252
+ checks and `suspected_noop` detection are unchanged.
253
+ - **Windows: no effect.** The Windows adapter does not wait for window changes
254
+ after an action, so it ignores both variables.
255
+
256
+ Measured on macOS with Calculator in the background and Terminal frontmost, a
257
+ background AX click took 1153 ms with the default, 325 ms with `200`, and 78 ms
258
+ with `0`.
259
+
260
+ ## Pacing synthesized keystrokes (macOS)
261
+
262
+ The macOS keyboard adapter waits a fixed gap between each key down and up and
263
+ between consecutive keys. For `type_text`, `press_key`, and `hotkey`, that gap
264
+ is most of the call's latency. A host whose targets accept faster input can
265
+ shorten it at trusted launch with one variable, in the same environment as the
266
+ window-observation variables above. `EmbeddedCuaDriverHost` admits it too:
267
+
268
+ | Variable | Meaning | Default | Accepted range |
269
+ | ----------------------- | ----------------------------------------------- | ------- | ----------------------------------------------------- |
270
+ | `CUA_DRIVER_KEY_GAP_MS` | Gap between synthesized key events, per event. | 8 | 2 to 100; smaller values are raised, larger clamped |
271
+
272
+ Unset, empty, or unparsable values keep the default. No tool argument can
273
+ change the gap. An explicit `type_text` `delay_ms` still applies on top of it.
274
+
275
+ - **macOS only.** Linux keeps its fixed 10 ms key delay and Windows its own
276
+ pacing; neither reads this variable.
277
+ - **What a shorter gap costs.** Some targets coalesce or drop key events that
278
+ arrive back to back, most often remote-input forwarders and apps under heavy
279
+ load. Read the field back after typing before relying on a low value for a
280
+ new target. The 2 ms floor exists because `0` posts events with no gap at all.
281
+
282
+ Measured on macOS 27 with TextEdit in the background, typing a 185-character
283
+ ASCII sentence through the PID-routed key path took about 3650 ms at the default
284
+ and about 980 ms at `2`. All ten read-backs (five per value) matched exactly.
285
+
203
286
  ## What embedded mode changes (and what it doesn't)
204
287
 
205
288
  | | Standalone | Embedded (`CUA_DRIVER_EMBEDDED=1`) |
@@ -211,10 +294,10 @@ daemon child.
211
294
  | Permission prompts / startup gate | May prompt once | **Never prompts** |
212
295
  | Settings → Privacy & Security entries | CuaDriver | your app only |
213
296
  | `check_permissions` `source.attribution` | `driver-daemon` (or `caller`) | `host` |
214
- | Overlay, background input, capture, all tools | full | full — identical |
297
+ | Overlay, background input, capture, all tools | full | full, identical |
215
298
 
216
- Everything else — the agent-cursor overlay, background (no-focus-steal)
217
- clicking and typing, AX tree reads, per-window screenshots — is unchanged.
299
+ Everything else is unchanged: the agent-cursor overlay, background (no-focus-steal)
300
+ clicking and typing, AX tree reads, and per-window screenshots.
218
301
  When embedded mode is off, nothing in this feature is active: standalone
219
302
  behavior is byte-for-byte what it was.
220
303
 
@@ -225,7 +308,7 @@ automatically when you spawn the `serve` daemon directly and embedded mode
225
308
  is on. If the daemon were allowed to disclaim (standalone behavior), macOS
226
309
  would treat it as its own responsible process: your user would get a _second_ prompt
227
310
  attributed to the driver binary, a second Settings entry, and capture/AX
228
- would fail until that second grant — the exact experience embedding exists
311
+ would fail until that second grant. That is the exact experience embedding exists
229
312
  to eliminate. Embedded mode short-circuits the disclaim re-exec
230
313
  (`responsibility.rs`) and the `open -a CuaDriver` daemon relaunch. MCP is
231
314
  always a proxy, so the embedded daemon remains the single process that checks
@@ -281,20 +364,20 @@ a dialog (the `prompt` argument is ignored) and returns:
281
364
  }
282
365
  ```
283
366
 
284
- - `accessibility` / `screen_recording` — the live TCC state _of your app's
367
+ - `accessibility` / `screen_recording`: the live TCC state _of your app's
285
368
  grant_, answered from inside the driver process (which shares your
286
369
  identity). If both are true, it is safe to drive the desktop.
287
- - `screen_recording_capturable` / `direct_capture_status` — embedded
370
+ - `screen_recording_capturable` / `direct_capture_status`: embedded
288
371
  `check_permissions` is read-only and never runs Tahoe's prompt-capable
289
372
  ScreenCaptureKit probe, so these are `null` / `not_checked`. The host owns
290
373
  the permission UX and should verify pixels with an explicit screenshot or
291
374
  capture operation after explaining the prompt.
292
375
  - `source.attribution` values:
293
- - `host` — embedded mode; booleans reflect the host's grant. What you
376
+ - `host`: embedded mode; booleans reflect the host's grant. What you
294
377
  should always see when embedding.
295
- - `driver-daemon` — standalone daemon owning `com.trycua.driver`. If you
378
+ - `driver-daemon`: standalone daemon owning `com.trycua.driver`. If you
296
379
  see this while embedding, embedded mode is not actually set.
297
- - `caller` — a non-embedded, non-bundle launch (e.g. someone ran the
380
+ - `caller`: a non-embedded, non-bundle launch (e.g. someone ran the
298
381
  binary from a terminal); booleans reflect the terminal's grants.
299
382
 
300
383
  If a permission is missing, the correct reaction is: **the host requests
@@ -307,7 +390,7 @@ restart the driver child so it re-queries with a fresh cache.
307
390
 
308
391
  ## Minimal host example (copy-paste)
309
392
 
310
- The file below is the complete reference host — mirrored verbatim from
393
+ The file below is the complete reference host: mirrored verbatim from
311
394
  `libs/cua-driver/rust/examples/embedded-host-macos/ExampleAgentHarness.swift`
312
395
  in the cua repo (which also has a build-and-run `demo.sh` covering the
313
396
  TCC-reset flow).
@@ -321,9 +404,9 @@ background AX read, agent-cursor glide.
321
404
  // SPDX-License-Identifier: MIT
322
405
  // Copyright (c) 2026 Cua AI, Inc.
323
406
 
324
- // ExampleAgentHarness — minimal reference host for embedding cua-driver.
407
+ // ExampleAgentHarness: minimal reference host for embedding cua-driver.
325
408
  // Mirrored verbatim in Skills/cua-driver/EMBEDDING.md ("Minimal host
326
- // example") — keep the two in sync.
409
+ // example"): keep the two in sync.
327
410
  //
328
411
  // Runs the one-grant demo sequence from EMBEDDING.md end to end:
329
412
  // 1. Requests Accessibility + Screen Recording AS THE HOST (the only
@@ -331,7 +414,7 @@ background AX read, agent-cursor glide.
331
414
  // 2. spawns an embedded cua-driver daemon plus its stdio MCP proxy and
332
415
  // verifies attribution, takes a background screenshot,
333
416
  // reads a background app's window state, and glides the agent-cursor
334
- // overlay — with zero driver-side prompts.
417
+ // overlay, with zero driver-side prompts.
335
418
  //
336
419
  // Launched via `open` (see demo.sh) the app has no terminal, so all
337
420
  // output also goes to /tmp/cua-embedded-demo.log.
@@ -348,21 +431,21 @@ func log(_ line: String) {
348
431
  logFile.write((line + "\n").data(using: .utf8)!)
349
432
  }
350
433
 
351
- // 1. Request both grants AS THE HOST — the only prompts in the whole flow.
434
+ // 1. Request both grants AS THE HOST: the only prompts in the whole flow.
352
435
  let axOpts = ["AXTrustedCheckOptionPrompt": true] as CFDictionary
353
436
  let ax = AXIsProcessTrustedWithOptions(axOpts)
354
437
  let sr = CGRequestScreenCaptureAccess()
355
- log("host grants — accessibility: \(ax), screen recording: \(sr)")
438
+ log("host grants, accessibility: \(ax), screen recording: \(sr)")
356
439
  // Keep going even without grants: the run registers BOTH rows in one pass
357
- // (the AX request above, plus — on newer macOS, where the app only appears
358
- // in the Screen Recording pane after a real ScreenCaptureKit attempt — the
440
+ // (the AX request above, plus, on newer macOS, where the app only appears
441
+ // in the Screen Recording pane after a real ScreenCaptureKit attempt, the
359
442
  // embedded driver's live probe below, registered as THE HOST, which is the
360
443
  // point of embedding). Grant both in one Settings visit, then re-run.
361
444
  if !ax || !sr {
362
445
  log("after this run: grant the missing item(s) in System Settings, then re-run")
363
446
  }
364
447
 
365
- // 2. Spawn the daemon as a DIRECT child (never via `open`/NSWorkspace —
448
+ // 2. Spawn the daemon as a DIRECT child (never via `open`/NSWorkspace:
366
449
  // that breaks responsibility inheritance), then attach an MCP proxy.
367
450
  let driverPath = ProcessInfo.processInfo.environment["CUA_DRIVER_PATH"]
368
451
  ?? "/usr/local/bin/cua-driver"
@@ -440,7 +523,7 @@ send(["jsonrpc": "2.0", "id": nextId, "method": "initialize", "params": [
440
523
  "clientInfo": ["name": "ExampleAgentHarness", "version": "0.1"]]])
441
524
  _ = readMessage()
442
525
  send(["jsonrpc": "2.0", "method": "notifications/initialized"])
443
- log("embedded cua-driver daemon + proxy started (\(driverPath)) — no driver prompt should have appeared")
526
+ log("embedded cua-driver daemon + proxy started (\(driverPath)): no driver prompt should have appeared")
444
527
 
445
528
  // 4. health_report must observe this actual parent app, and
446
529
  // check_permissions must report host attribution and matching TCC results.
@@ -454,7 +537,7 @@ let identityOk = identity["status"] as? String == "pass" &&
454
537
  identityData["bundle_identifier"] as? String == hostBundleId &&
455
538
  identityData["identity_source"] as? String == "parent_application" &&
456
539
  (identityData["parent_process_id"] as? Int) == Int(ProcessInfo.processInfo.processIdentifier)
457
- log("health_report — bundle_identity: \(identity["status"] ?? "?"), " +
540
+ log("health_report: bundle_identity: \(identity["status"] ?? "?"), " +
458
541
  "observed host: \(identityData["bundle_identifier"] ?? "?") (want: \(hostBundleId))")
459
542
 
460
543
  let perms = call("check_permissions")
@@ -463,11 +546,11 @@ let source = structured["source"] as? [String: Any] ?? [:]
463
546
  let attribution = source["attribution"] as? String ?? "?"
464
547
  let permissionsMatchHost = structured["accessibility"] as? Bool == ax &&
465
548
  structured["screen_recording"] as? Bool == sr
466
- log("check_permissions — attribution: \(attribution) (want: host), " +
549
+ log("check_permissions: attribution: \(attribution) (want: host), " +
467
550
  "TCC matches host: \(permissionsMatchHost), " +
468
551
  "capturable: \(structured["screen_recording_capturable"] ?? "?")")
469
552
 
470
- // 5. Background AX read + window screenshot — proves both grants
553
+ // 5. Background AX read + window screenshot: proves both grants
471
554
  // inherited without focusing anything. launch_app resolves pid +
472
555
  // windows without foregrounding; get_window_state returns the AX
473
556
  // element tree AND a screenshot of the (background) window.
@@ -476,16 +559,16 @@ let launched = launch["structuredContent"] as? [String: Any] ?? [:]
476
559
  let pid = launched["pid"] as? Int ?? 0
477
560
  let windows = launched["windows"] as? [[String: Any]] ?? []
478
561
  let windowId = windows.first?["window_id"] as? Int ?? 0
479
- log("launch_app(Finder) — pid: \(pid), windows: \(windows.count)")
562
+ log("launch_app(Finder): pid: \(pid), windows: \(windows.count)")
480
563
 
481
564
  let state = call("get_window_state", ["pid": pid, "window_id": windowId])
482
565
  let images = (state["content"] as? [[String: Any]] ?? [])
483
566
  .filter { $0["type"] as? String == "image" }
484
567
  let hasTree = (state["structuredContent"] as? [String: Any])?["elements"] != nil
485
- log("get_window_state(Finder) — tree: \(hasTree ? "ok" : "EMPTY"), " +
568
+ log("get_window_state(Finder): tree: \(hasTree ? "ok" : "EMPTY"), " +
486
569
  "screenshot: \(images.count) image(s) (want: ≥1)")
487
570
 
488
- // 6. Agent-cursor glide — shows the overlay, no real-pointer move.
571
+ // 6. Agent-cursor glide: shows the overlay, no real-pointer move.
489
572
  log("watch the agent cursor glide now (no real-pointer move)…")
490
573
  let cursor1 = call("move_cursor", ["x": 200, "y": 200])
491
574
  Thread.sleep(forTimeInterval: 2)
@@ -493,7 +576,7 @@ let cursor2 = call("move_cursor", ["x": 900, "y": 500])
493
576
  Thread.sleep(forTimeInterval: 2)
494
577
  let cursorOk = (cursor1["isError"] as? Bool) != true &&
495
578
  (cursor2["isError"] as? Bool) != true
496
- log("move_cursor — \(cursorOk ? "ok" : "FAILED")")
579
+ log("move_cursor: \(cursorOk ? "ok" : "FAILED")")
497
580
 
498
581
  let pass = identityOk && attribution == "host" && permissionsMatchHost &&
499
582
  !images.isEmpty && hasTree && cursorOk
@@ -530,7 +613,7 @@ Embedded mode is not in effect for the process doing the TCC check. Causes,
530
613
  in order of likelihood: (a) `CUA_DRIVER_EMBEDDED` is not exactly `1`, or was
531
614
  set on your app but not passed into the daemon child's environment; (b) the daemon
532
615
  was launched via `open(1)` / `NSWorkspace` instead of spawned directly, so
533
- it is its own responsible process; (c) the MCP proxy connected to an old standalone `CuaDriver.app` daemon — check
616
+ it is its own responsible process; (c) the MCP proxy connected to an old standalone `CuaDriver.app` daemon. Check
534
617
  `check_permissions` → `source.attribution` (must be `host`) and verify
535
618
  that the proxy uses the host's private socket. To see exactly which identity macOS is charging,
536
619
  run: `log stream --debug --predicate 'subsystem == "com.apple.TCC" AND
@@ -542,12 +625,12 @@ without risking a system dialog. Exercise an explicit screenshot only after
542
625
  the host has explained the OS permission. If that fails, the grant may not
543
626
  belong to the driver's current responsible identity, may have been reset, or
544
627
  the driver may have escaped the host's chain (see the previous item). Restart
545
- the driver child after any grant change — TCC answers are cached per process.
628
+ the driver child after any grant change: TCC answers are cached per process.
546
629
 
547
630
  **"The AX tree comes back empty / clicks do nothing."**
548
631
  `AXIsProcessTrusted()` is false for the effective identity. The host hasn't
549
632
  been granted Accessibility, or was granted it _after_ the driver child
550
- started (per-process cache again — restart the child), or the app was
633
+ started (per-process cache again: restart the child), or the app was
551
634
  re-signed/moved so the existing grant row no longer matches it (remove and
552
635
  re-add it in System Settings, or `tccutil reset Accessibility <your-bundle-id>`
553
636
  and re-grant).