@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.
- package/CHANGELOG.md +39 -0
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +3 -2
- package/dist/builtin/intercom/broker/broker.ts +90 -14
- package/dist/builtin/intercom/broker/paths.ts +4 -0
- package/dist/builtin/intercom/broker/socket-liveness.ts +32 -0
- package/dist/builtin/intercom/broker/socket-replacement-lock.ts +104 -0
- package/dist/builtin/intercom/broker/spawn.ts +108 -63
- package/dist/builtin/intercom/index.bundle.mjs +114 -61
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/skills/agent-browser/SKILL.md +1 -1
- package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +60 -39
- package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +119 -36
- package/dist/builtin/subagents/skills/cua-driver/LINUX.md +225 -183
- package/dist/builtin/subagents/skills/cua-driver/MACOS.md +120 -89
- package/dist/builtin/subagents/skills/cua-driver/README.md +16 -7
- package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +85 -115
- package/dist/builtin/subagents/skills/cua-driver/RUNTIME.md +113 -0
- package/dist/builtin/subagents/skills/cua-driver/SKILL.md +55 -1071
- package/dist/builtin/subagents/skills/cua-driver/VISUAL.md +125 -0
- package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +145 -185
- package/dist/builtin/subagents/skills/cua-driver/WORKFLOW.md +173 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +16 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/builtin/{chunk-aqv8ny38.js → chunk-9ywkdsa9.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-p6jagvyf.js → chunk-bnz4knhy.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-br4ac9a3.js → chunk-dx5sjaxe.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-p3xmajmj.js → chunk-v4scsq3y.js} +41 -13
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +8 -2
- package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +6 -0
- package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -1
- package/dist/builtin/workflows/skills/impeccable/reference/component-review.md +63 -0
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +5 -0
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/generate.md +101 -0
- package/dist/builtin/workflows/skills/impeccable/reference/harden.md +9 -0
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +3 -1
- package/dist/builtin/workflows/skills/impeccable/reference/mode-operate.md +21 -0
- package/dist/builtin/workflows/skills/impeccable/reference/mode-persuade.md +19 -0
- package/dist/builtin/workflows/skills/impeccable/reference/mode-read.md +21 -0
- package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +19 -12
- package/dist/builtin/workflows/skills/impeccable/reference/region-map.md +26 -0
- package/dist/builtin/workflows/skills/impeccable/reference/routing.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +5 -5
- package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +4 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +2 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +5 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +524 -4
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +1 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +81 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +38 -14
- package/dist/builtin/workflows/src/index.js +38 -14
- package/dist/cli/startup-ui.d.ts +3 -2
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +19 -4
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/codemode-worker.js +2 -2
- package/dist/core/agent-session-compaction.d.ts +3 -3
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +5 -1
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +1 -0
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +4 -0
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +6 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +3 -2
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +5 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +13 -9
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +1 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/agent-events.d.ts +2 -0
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +2 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/mcp-server-registry.d.ts +4 -1
- package/dist/core/extensions/mcp-server-registry.d.ts.map +1 -1
- package/dist/core/extensions/mcp-server-registry.js +7 -4
- package/dist/core/extensions/mcp-server-registry.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +19 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/session-events.d.ts +2 -0
- package/dist/core/extensions/session-events.d.ts.map +1 -1
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/extensions/tool-types.d.ts +2 -0
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/fast-model-variants.d.ts.map +1 -1
- package/dist/core/fast-model-variants.js +3 -2
- package/dist/core/fast-model-variants.js.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts.map +1 -1
- package/dist/core/model-resolver-defaults.js +2 -0
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +1 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/dist/core/nested-tool-calls.js +1 -0
- package/dist/core/nested-tool-calls.js.map +1 -1
- package/dist/core/provider-alias.d.ts.map +1 -1
- package/dist/core/provider-alias.js +8 -0
- package/dist/core/provider-alias.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +6 -3
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +1 -0
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +1 -0
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +7 -3
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.js +1 -1
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +55 -7
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/index.d.ts.map +1 -1
- package/dist/extensions/codemode/index.js +7 -0
- package/dist/extensions/codemode/index.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +2 -0
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +20 -2
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/extensions/herdr/pane-owner.d.ts +7 -0
- package/dist/extensions/herdr/pane-owner.d.ts.map +1 -1
- package/dist/extensions/herdr/pane-owner.js +53 -11
- package/dist/extensions/herdr/pane-owner.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main-deferred-startup.d.ts +8 -0
- package/dist/main-deferred-startup.d.ts.map +1 -1
- package/dist/main-deferred-startup.js +6 -0
- package/dist/main-deferred-startup.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +11 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +17 -14
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +5 -2
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -0
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +19 -8
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts +3 -2
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +7 -4
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +8 -2
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +4 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +10 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +3 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +6 -0
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +2 -2
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +2 -2
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +19 -2
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +7 -0
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +7 -5
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +8 -1
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-startup-trust.d.ts +6 -0
- package/dist/modes/interactive/interactive-startup-trust.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-startup-trust.js +15 -0
- package/dist/modes/interactive/interactive-startup-trust.js.map +1 -0
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +4 -0
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +24 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/dist/modes/interactive/program-status-reporter.js +96 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/dist/modes/interactive-engine/engine-child-liveness.d.ts +1 -0
- package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-child-liveness.js +15 -1
- package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.d.ts +4 -0
- package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-monitor.js +17 -0
- package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts +16 -0
- package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-quit-intent.js +27 -0
- package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -0
- package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-render-service.js +3 -1
- package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +1 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +5 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +19 -2
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +19 -1
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +7 -0
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.d.ts +3 -0
- package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js +7 -0
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +11 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +42 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.js +2 -2
- package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +23 -6
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/docs/codemode.md +10 -6
- package/docs/compaction.md +1 -1
- package/docs/computer-use.md +9 -9
- package/docs/custom-provider/streaming.md +4 -0
- package/docs/environment-variables.md +2 -0
- package/docs/extensions/api-reference.md +1 -1
- package/docs/extensions/authoring.md +2 -0
- package/docs/extensions/events.md +8 -1
- package/docs/getting-started/first-session.md +1 -1
- package/docs/herdr.md +11 -2
- package/docs/json.md +6 -1
- package/docs/models/evals.md +34 -3
- package/docs/models.md +1 -1
- package/docs/providers.md +10 -0
- package/docs/sdk.md +8 -2
- package/docs/settings.md +2 -2
- package/docs/skills.md +1 -1
- package/docs/terminal-setup.md +14 -0
- package/docs/workflows/authoring.md +3 -3
- package/examples/extensions/sandbox/package-lock.json +3 -3
- package/npm-shrinkwrap.json +67 -67
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
297
|
+
| Overlay, background input, capture, all tools | full | full, identical |
|
|
215
298
|
|
|
216
|
-
Everything else
|
|
217
|
-
clicking and typing, AX tree reads, per-window screenshots
|
|
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
|
|
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
|
|
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
|
|
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
|
|
376
|
+
- `host`: embedded mode; booleans reflect the host's grant. What you
|
|
294
377
|
should always see when embedding.
|
|
295
|
-
- `driver-daemon
|
|
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
|
|
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
|
|
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
|
|
407
|
+
// ExampleAgentHarness: minimal reference host for embedding cua-driver.
|
|
325
408
|
// Mirrored verbatim in Skills/cua-driver/EMBEDDING.md ("Minimal host
|
|
326
|
-
// example")
|
|
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
|
|
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
|
|
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
|
|
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
|
|
358
|
-
// in the Screen Recording pane after a real ScreenCaptureKit attempt
|
|
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))
|
|
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
|
|
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
|
|
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
|
|
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)
|
|
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)
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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).
|