@bastani/atomic 0.9.20-alpha.5 → 0.9.20-alpha.7
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 +73 -0
- package/README.md +37 -0
- package/dist/builtin/intercom/CHANGELOG.md +10 -0
- package/dist/builtin/intercom/broker/broker.ts +110 -39
- package/dist/builtin/intercom/broker/client.ts +8 -1
- package/dist/builtin/intercom/index.bundle.mjs +61 -2
- package/dist/builtin/intercom/live-route-refusal.ts +69 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/recoverable-disconnect.ts +16 -4
- package/dist/builtin/intercom/skills/intercom/SKILL.md +11 -11
- package/dist/builtin/intercom/types.ts +3 -1
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +12 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +494 -0
- package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +578 -0
- package/dist/builtin/subagents/skills/cua-driver/LINUX.md +364 -0
- package/dist/builtin/subagents/skills/cua-driver/MACOS.md +509 -0
- package/dist/builtin/subagents/skills/cua-driver/README.md +113 -0
- package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +162 -0
- package/dist/builtin/subagents/skills/cua-driver/SKILL.md +1105 -0
- package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +866 -0
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +18 -8
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +34 -0
- package/dist/builtin/workflows/README.md +5 -19
- package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
- package/dist/builtin/workflows/builtin/{chunk-7f381xnq.js → chunk-2hzrv5y8.js} +140 -21
- package/dist/builtin/workflows/builtin/{chunk-e83tc6nr.js → chunk-3tx8ry44.js} +3 -2
- package/dist/builtin/workflows/builtin/{chunk-00ywx588.js → chunk-5724b0cf.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-zj5162bh.js → chunk-7bzcersz.js} +33 -22
- package/dist/builtin/workflows/builtin/{chunk-ne6vh5ct.js → chunk-7n51c5gh.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-x2nftpgj.js → chunk-9z3ztr2a.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-7h7s5xdj.js → chunk-dxjxtgmp.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-tvcydq13.js → chunk-ffdrv23t.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-pfm1kgqz.js → chunk-hmt5w62g.js} +12 -4
- package/dist/builtin/workflows/builtin/{chunk-tdqvdrg1.js → chunk-jngsbbpm.js} +3 -3
- package/dist/builtin/workflows/builtin/{chunk-55p5dxjk.js → chunk-njmf5ze7.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-evfb0312.js → chunk-vn0wb31x.js} +1 -1
- package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
- package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
- package/dist/builtin/workflows/builtin/goal.js +4 -4
- package/dist/builtin/workflows/builtin/index.js +12 -12
- package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
- package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +4 -4
- package/dist/builtin/workflows/builtin/steering-context.js +1 -1
- package/dist/builtin/workflows/builtin/tournament.js +3 -3
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +10 -9
- package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +4 -4
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +96 -23
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +75 -27
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +72 -26
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +58 -22
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +118 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +70 -29
- package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +1 -1
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +95 -32
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +79 -30
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +139 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -4
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +446 -639
- package/dist/builtin/workflows/src/index.js +1434 -1277
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +15 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +40 -12
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +9 -8
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-boundaries.d.ts +68 -0
- package/dist/core/agent-session-boundaries.d.ts.map +1 -0
- package/dist/core/agent-session-boundaries.js +334 -0
- package/dist/core/agent-session-boundaries.js.map +1 -0
- package/dist/core/agent-session-compaction.js +1 -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 +27 -13
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +16 -20
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +6 -3
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +33 -4
- 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-persistent-custom-messages.d.ts.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.js +2 -1
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +93 -25
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +4 -9
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +4 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +7 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +9 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -1
- package/dist/core/agent-session-tasks.js +68 -16
- package/dist/core/agent-session-tasks.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +15 -5
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +9 -21
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +2 -3
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +8 -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 +18 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +22 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +11 -6
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +3 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +37 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/crash-log.d.ts +6 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +69 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/execution-model-router.d.ts +15 -0
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +82 -33
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
- package/dist/core/export-html/template.js +6 -1
- package/dist/core/extensions/agent-events.d.ts +69 -3
- 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/api-types.d.ts +5 -3
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/event-results.d.ts +3 -0
- package/dist/core/extensions/event-results.d.ts.map +1 -1
- package/dist/core/extensions/event-results.js.map +1 -1
- package/dist/core/extensions/event-types.d.ts +2 -2
- package/dist/core/extensions/event-types.d.ts.map +1 -1
- package/dist/core/extensions/event-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -0
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts +16 -2
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js +98 -5
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/fast-model-variants.d.ts +16 -0
- package/dist/core/fast-model-variants.d.ts.map +1 -1
- package/dist/core/fast-model-variants.js +27 -0
- package/dist/core/fast-model-variants.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/messages.d.ts +10 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +57 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +52 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +16 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts.map +1 -1
- package/dist/core/model-resolver-defaults.js +2 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-runtime.d.ts +13 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +16 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/prompt-templates-async.d.ts +2 -2
- package/dist/core/prompt-templates-async.d.ts.map +1 -1
- package/dist/core/prompt-templates-async.js +57 -29
- package/dist/core/prompt-templates-async.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +6 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +61 -35
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +1 -0
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +19 -0
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +6 -6
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/sdk-types.d.ts +5 -0
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +10 -3
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +65 -7
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +4 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +8 -0
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +16 -1
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +105 -42
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +30 -3
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/structured-output/index.d.ts +1 -1
- package/dist/core/structured-output/index.d.ts.map +1 -1
- package/dist/core/structured-output/index.js +37 -41
- package/dist/core/structured-output/index.js.map +1 -1
- package/dist/core/structured-output/jev-client.d.ts +13 -8
- package/dist/core/structured-output/jev-client.d.ts.map +1 -1
- package/dist/core/structured-output/jev-client.js +90 -32
- package/dist/core/structured-output/jev-client.js.map +1 -1
- package/dist/core/structured-output/jev.d.ts.map +1 -1
- package/dist/core/structured-output/jev.js +38 -64
- package/dist/core/structured-output/jev.js.map +1 -1
- package/dist/core/structured-output/resolver.d.ts +32 -24
- package/dist/core/structured-output/resolver.d.ts.map +1 -1
- package/dist/core/structured-output/resolver.js +57 -9
- package/dist/core/structured-output/resolver.js.map +1 -1
- package/dist/core/structured-output/types.d.ts +8 -6
- package/dist/core/structured-output/types.d.ts.map +1 -1
- package/dist/core/structured-output/types.js.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/child-command-owner.d.ts +34 -0
- package/dist/core/tasks/child-command-owner.d.ts.map +1 -0
- package/dist/core/tasks/child-command-owner.js +70 -0
- package/dist/core/tasks/child-command-owner.js.map +1 -0
- package/dist/core/tools/bash-pty-native.d.ts +5 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +15 -7
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/kill.d.ts +2 -2
- package/dist/core/tools/kill.d.ts.map +1 -1
- package/dist/core/tools/kill.js +3 -4
- package/dist/core/tools/kill.js.map +1 -1
- package/dist/core/tools/read.d.ts +4 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +5 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/main-app-mode.d.ts +1 -1
- package/dist/main-app-mode.d.ts.map +1 -1
- package/dist/main-app-mode.js +3 -2
- package/dist/main-app-mode.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +6 -0
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.js +1 -0
- package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +17 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +2 -4
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
- 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-process-lifecycle.js +13 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +5 -1
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +16 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +27 -0
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +7 -2
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +3 -1
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +2 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +2 -2
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/mime.js +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts +3 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js +4 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/docs/background-tasks.md +11 -2
- package/docs/compaction.md +5 -1
- package/docs/computer-use.md +105 -56
- package/docs/environment-variables.md +1 -1
- package/docs/extensions/events.md +75 -7
- package/docs/extensions.md +6 -2
- package/docs/getting-started/first-session.md +3 -2
- package/docs/intercom/operations.md +13 -1
- package/docs/intercom.md +1 -1
- package/docs/llama-cpp.md +2 -2
- package/docs/models/evals.md +108 -118
- package/docs/models/reference.md +31 -3
- package/docs/packages.md +2 -0
- package/docs/prompt-templates.md +1 -0
- package/docs/providers.md +19 -6
- package/docs/reference/cli.md +2 -2
- package/docs/rpc/examples.md +2 -0
- package/docs/sdk/reference.md +2 -3
- package/docs/sdk/structured-decisions.md +25 -18
- package/docs/sdk.md +13 -2
- package/docs/session-format.md +17 -2
- package/docs/settings.md +8 -8
- package/docs/skills.md +8 -2
- package/docs/subagents/reference.md +4 -4
- package/docs/subagents.md +2 -2
- package/docs/workflows/api-reference.md +7 -34
- package/docs/workflows/authoring.md +191 -0
- package/docs/workflows/builtins.md +1 -1
- package/docs/workflows/operations.md +18 -78
- package/docs/workflows/reliable-design.md +14 -29
- package/docs/workflows/verification.md +21 -8
- package/docs/workflows.md +8 -7
- package/examples/rpc-client.ts +38 -0
- package/examples/rpc-extension-ui.ts +19 -5
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +69 -69
- package/package.json +8 -8
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_astra.md +0 -58
package/docs/computer-use.md
CHANGED
|
@@ -9,7 +9,7 @@ Atomic can work in applications, not just edit code. Computer-use automation, or
|
|
|
9
9
|
|
|
10
10
|
This guide explains tool selection, setup, and safe operation. To test a software change and attach the results to a PR, see [Verification and evidence](/workflows/verification).
|
|
11
11
|
|
|
12
|
-
Jump to [application scripting](#application-scripting-and-apis), [desktop CUA](#desktop-automation-with-
|
|
12
|
+
Jump to [application scripting](#application-scripting-and-apis), [desktop CUA](#desktop-automation-with-cua-driver), [browser automation](#browser-automation-with-agent-browser), [terminal automation](#terminal-automation-with-herdr), or [creative workflows](#creative-work-and-cua-workflows). Platform setup: [macOS](#macos), [Linux](#linux), [Windows](#windows).
|
|
13
13
|
|
|
14
14
|
## Choose the right tool
|
|
15
15
|
|
|
@@ -19,12 +19,12 @@ Start with the result you need, not the application you could click through. If
|
|
|
19
19
|
| --- | --- | --- |
|
|
20
20
|
| Create or edit files, such as presentations, documents, spreadsheets, or media | **A file library or CLI** | Use an app API or UI when the library cannot preserve required features, or when you need rendering or visual adjustments. |
|
|
21
21
|
| Interactive terminal or TUI | **Herdr** | Use tmux on macOS/Linux or native Windows psmux when Herdr cannot be used. Ordinary shell commands need no multiplexer. |
|
|
22
|
-
|
|
|
23
|
-
|
|
|
22
|
+
| Website or web app in Chrome/Chromium, Electron desktop app (VS Code, Slack, Discord, Figma, Notion, Spotify), Slack workspace, or cloud browser | **agent-browser** | This is the scope the `agent-browser` skill covers. Use Cua Driver for browser chrome, OS dialogs and permission prompts, non-Chromium browsers, or anything else agent-browser cannot reach. Keep existing browser test suites for repeatable tests. |
|
|
23
|
+
| Native desktop application, iOS simulator, Android emulator, work across apps, or any agent-browser limitation | **Cua Driver**: the `cua-driver` CLI through the bundled `cua-driver` skill when a model chooses each action; the `@trycua/cua-driver` TypeScript SDK inside `ctx.tool` when workflow code owns the scenario | Use application scripting or a CLI when they make the task easier, safer, or more reliable. |
|
|
24
24
|
|
|
25
|
-
You can combine tools without driving the whole task through a desktop. Generate a presentation with `python-pptx`, then inspect rendered slides for layout problems. Use Blender's Python API to generate repeated objects, then
|
|
25
|
+
You can combine tools without driving the whole task through a desktop. Generate a presentation with `python-pptx`, then inspect rendered slides for layout problems. Use Blender's Python API to generate repeated objects, then Cua Driver for adjustments in the visible editor. Use browser DOM controls rather than desktop clicks for a web form. For a supported web-service operation that does not require browser interaction, an authorized API request may be enough.
|
|
26
26
|
|
|
27
|
-
Atomic's skills supply operating instructions, not an installed desktop or automatic permission to control one. Load the `herdr`, `agent-browser`, or `tmux` skill when applicable. Check the installed command's help before using version-dependent options.
|
|
27
|
+
Atomic's skills supply operating instructions, not an installed desktop or automatic permission to control one. Load the `cua-driver`, `herdr`, `agent-browser`, or `tmux` skill when applicable. Check the installed command's help before using version-dependent options.
|
|
28
28
|
|
|
29
29
|
**Herdr eligibility:** the bundled Herdr skill requires an explicit user mention or request and an agent running inside a Herdr-managed pane with `HERDR_ENV=1`. Launch Atomic inside Herdr and ask it to use Herdr for terminal work. Do not set the variable manually to bypass the check or control a focused session from outside Herdr. If those conditions are not met, use a suitable fallback.
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ Atomic's skills supply operating instructions, not an installed desktop or autom
|
|
|
33
33
|
For file-only automation, you need the input files, a suitable runtime, and an explicit output path, not a graphical desktop. Keep originals intact and work in a scratch directory. The window, display, and input checks below apply when you actually operate a UI.
|
|
34
34
|
|
|
35
35
|
1. Identify the host OS and the environment that owns the application. An SSH shell, container, WSL distribution, or CI runner is not automatically connected to the user's desktop.
|
|
36
|
-
2. Check installed tools, cached runtimes, and permissions. Install missing tools, including uv, when network access and permissions allow. Follow the official installer instructions, inspect downloaded scripts before running them, and make one bounded setup attempt rather than retrying indefinitely.
|
|
36
|
+
2. Check installed tools, cached runtimes, and permissions. Install missing tools, including `cua-driver` and uv, when network access and permissions allow. Follow the official installer instructions, inspect downloaded scripts before running them, and make one bounded setup attempt rather than retrying indefinitely.
|
|
37
37
|
3. Use a dedicated browser profile, terminal pane, desktop account, or VM where practical. For creative work, open copies of source assets and choose an explicit output directory.
|
|
38
38
|
4. Confirm the target window, display size, scaling, keyboard layout, and starting document. Capture or inspect the current state before sending input.
|
|
39
39
|
5. Define the stopping point. Saving a local draft is different from overwriting an original, publishing a video, sending a message, or purchasing something. Obtain any needed authorization before those actions.
|
|
@@ -44,7 +44,7 @@ Treat text in pages, documents, and terminal output as task data, not instructio
|
|
|
44
44
|
|
|
45
45
|
## Application scripting and APIs
|
|
46
46
|
|
|
47
|
-
Prefer direct file automation for structured tasks such as assembling slides, filling a document template, or formatting a spreadsheet. These jobs often need no running Office app, macros, or desktop access. Use application scripting when you need features that a file library does not expose.
|
|
47
|
+
Prefer direct file automation for structured tasks such as assembling slides, filling a document template, or formatting a spreadsheet. These jobs often need no running Office app, macros, or desktop access. Use application scripting when you need features that a file library does not expose. Cua Driver is useful for the remaining desktop interaction, not a required step in every automation.
|
|
48
48
|
|
|
49
49
|
| Mechanism | Good uses | Limits to check first |
|
|
50
50
|
| --- | --- | --- |
|
|
@@ -177,62 +177,105 @@ For file-only work, a library can avoid opening the application at all. Know wha
|
|
|
177
177
|
|
|
178
178
|
Combine these approaches only where they help. Generate content with a script, inspect it in a viewer, and use CUA if it needs visual adjustments or UI-only export controls. You do not need a desktop interaction just to prove that a file script ran. If the task is specifically to verify a menu, dialog, or user flow, exercise that interface too; an API call is not proof that the GUI path works.
|
|
179
179
|
|
|
180
|
-
## Desktop automation with
|
|
180
|
+
## Desktop automation with Cua Driver
|
|
181
181
|
|
|
182
|
-
[
|
|
182
|
+
[Cua Driver](https://github.com/trycua/cua/tree/main/libs/cua-driver) targets an exact application window rather than the shared cursor. One `get_window_state` call returns the window's accessibility tree and a screenshot; actions are delivered through snapshot-bound element tokens in the background by default, and the result reports `degraded` or `truncated` state so a scenario can refuse to act on a bad observation. Verification is snapshot, act, fresh snapshot, then a postcondition check, not a picture of a click.
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
The bundled `cua-driver` skill carries the driving loop and the per-platform notes. For anything it does not cover, such as the full tool reference, SDK API, permissions model, or process model, read the upstream documentation: the [Cua docs index](https://cua.ai/docs/llms.txt) lists every page as a plain-text URL, so an agent can fetch the one it needs, for example the [process model](https://cua.ai/docs/reference/cua-driver/process-model.md), [macOS permissions](https://cua.ai/docs/reference/cua-driver/macos-permissions.md), [telemetry](https://cua.ai/docs/reference/cua-driver/telemetry.md), and [SDK reference](https://cua.ai/docs/reference/cua-driver/sdk-reference.md).
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
Atomic uses Cua Driver through two faces of one typed surface. Choose by who decides the next action:
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
| Situation | Face | Why |
|
|
189
|
+
| --- | --- | --- |
|
|
190
|
+
| A language model chooses each action: an interactive session driving, inspecting, or automating a desktop app, simulator, or emulator window, or any workflow stage acting outside `ctx.tool` | `cua-driver` CLI through the bundled `cua-driver` skill | The model decides turn by turn; the skill's loop is written for one-shot `cua-driver call <tool>` commands, and the evidence is the JSON results and `screenshot_out_file` images it saves. |
|
|
191
|
+
| A custom workflow's TypeScript owns the scenario and its postcondition, run inside `ctx.tool(name, args, fn, { timeoutMs })` | `@trycua/cua-driver` TypeScript SDK | Code owns the sequence; the result is durably checkpointed and replayed on resume. |
|
|
189
192
|
|
|
190
|
-
|
|
191
|
-
|
|
193
|
+
The rule of thumb: **when a model chooses the next action, use the CLI; when TypeScript code owns the sequence and the postcondition, use the SDK.** Prefer [agent-browser](#browser-automation-with-agent-browser) for what its skill covers: websites and web apps in Chrome/Chromium, Electron desktop apps, Slack, and cloud browsers. Use Cua Driver for everything else, including iOS simulators, Android emulators, OS dialogs, and non-Chromium browsers, and whenever agent-browser hits a limitation. Terminals stay with [Herdr](#terminal-automation-with-herdr), falling back to tmux or psmux. Both faces share tool names (`list_apps`, `list_windows`, `get_window_state`, `click`, `type_text`, and the rest), so a scenario worked out interactively translates directly into code.
|
|
194
|
+
|
|
195
|
+
The bundled `cua-driver` skill is the upstream skill, vendored verbatim, and is the only place the driving loop is described. Do not run `cua-driver skills install`: it links the skill into `~/.agents/skills`, `~/.claude/skills`, and similar directories that Atomic does not own. The bundled copy is the skill.
|
|
196
|
+
|
|
197
|
+
### Install if missing
|
|
192
198
|
|
|
193
|
-
|
|
199
|
+
Check `cua-driver --version`. If the executable is missing, make **one bounded attempt** with upstream's one-line installer for the host. It needs no administrator access:
|
|
194
200
|
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
```sh
|
|
202
|
+
# macOS (14 Sonoma or later) and Linux
|
|
203
|
+
/bin/bash -c "$(curl -fsSL https://cua.ai/driver/install.sh)"
|
|
204
|
+
```
|
|
197
205
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
gui.screenshot().save(output / "desktop-before.png")
|
|
206
|
+
```powershell
|
|
207
|
+
# Windows PowerShell
|
|
208
|
+
irm https://cua.ai/driver/install.ps1 | iex
|
|
202
209
|
```
|
|
203
210
|
|
|
204
|
-
|
|
211
|
+
Report what the installer did. On macOS it places `CuaDriver.app` in `/Applications`, creates the `~/.local/bin/cua-driver` symlink, and appends an `export PATH=…` line to your `zsh`, `bash`, or `fish` rc file when `~/.local/bin` is not already on `PATH`; open a new shell or source the rc file before retrying `cua-driver --version`. On Linux it downloads into `~/.cua-driver/packages/releases/` and creates the same symlink; a minimal image may first need `sudo apt install libxi6 at-spi2-core`. On Windows it installs under `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin`, appends that directory to the user `Path`, and registers a `cua-driver-serve` autostart task when the session is interactive.
|
|
212
|
+
|
|
213
|
+
Never loop on the installer. In a workflow stage, a refused or failed install is reported as `blocked`/`needs_human` together with the exact installer command above, not worked around with an alternative tool.
|
|
214
|
+
|
|
215
|
+
If the installed driver is older than the bundled skill's `version` (`0.28.2`), run `cua-driver update --apply` once and restart the daemon with the platform's startup command below. If it is newer, proceed and note the skew in the report. `cua-driver check-update` only checks; it changes nothing.
|
|
216
|
+
|
|
217
|
+
### Turn telemetry off
|
|
218
|
+
|
|
219
|
+
Cua Driver sends content-free, pseudonymous product telemetry to PostHog **by default, from every face**: the CLI, the daemon, the MCP server, and the Python and TypeScript SDKs. It is keyed by a persisted installation UUID, so it is pseudonymous rather than anonymous. Atomic's guidance turns it off before the first driver call on every path; it does not claim the driver is telemetry-free.
|
|
220
|
+
|
|
221
|
+
- **Every invocation.** Run every `cua-driver` command, every SDK scenario, and every `ctx.tool` child process with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` in the environment. The environment override takes precedence over any saved preference and needs no executable, so it is the control Atomic standardizes on.
|
|
222
|
+
- **After an executable install.** Additionally run `cua-driver telemetry disable` once, so the preference persists for daemon-owned sessions Atomic does not spawn (on macOS the daemon is launched through `open`, which does not inherit the agent's shell environment). Confirm with `cua-driver telemetry status --json`.
|
|
223
|
+
- Never post the installation UUID from `telemetry status` in an issue, an evidence artifact, or a transcript.
|
|
224
|
+
|
|
225
|
+
The startup update check is separate from telemetry. It carries no installation ID or usage data, fires only on `mcp`, `serve`, and `doctor` with a 20-hour cache, and is how you learn that `cua-driver update --apply` is warranted. Atomic leaves it at the upstream default. If you want the GitHub request gone, set `CUA_DRIVER_RS_UPDATE_CHECK=false` for one invocation, or run `cua-driver config set update_check_enabled false` to persist it.
|
|
226
|
+
|
|
227
|
+
### Check readiness
|
|
228
|
+
|
|
229
|
+
A version string verifies the binary, not desktop access. Before the first action:
|
|
205
230
|
|
|
206
231
|
```sh
|
|
207
|
-
|
|
232
|
+
export CUA_DRIVER_RS_TELEMETRY_ENABLED=false
|
|
233
|
+
cua-driver status # the daemon is running
|
|
234
|
+
cua-driver doctor # session, display, accessibility bus, telemetry setup
|
|
235
|
+
cua-driver call list_apps # a GUI app you recognize appears
|
|
208
236
|
```
|
|
209
237
|
|
|
210
|
-
|
|
238
|
+
`cua-driver call <tool>` is call-owned: it connects to the running daemon, prints one result, and exits. When no daemon is reachable it fails rather than executing in the CLI process, so a stopped daemon looks like a failed call. `list-tools`, `describe <tool>`, and `dump-docs` read the tool inventory without a runtime.
|
|
211
239
|
|
|
212
|
-
|
|
240
|
+
- **macOS.** Start a stopped daemon with `open -n -g -a CuaDriver --args serve`, never with a bare `cua-driver serve` from a terminal: LaunchServices attributes the process to `CuaDriver.app` (`com.trycua.driver`), so the Accessibility and Screen Recording grants attach to the app and survive upgrades, while a terminal-launched daemon is attributed to the terminal app. Then run `cua-driver permissions status`; it reads the daemon's grants and reports `unknown` when no daemon is running. To grant, run `cua-driver permissions grant`, then toggle CuaDriver on under System Settings → Privacy & Security → Accessibility and under Screen & System Audio Recording. The prompt only registers the app; the toggle grants. macOS does not always raise both prompts in one pass, so rerun the pair and relaunch the daemon afterwards.
|
|
241
|
+
- **Windows.** The daemon must run in the interactive user session; Session 0 cannot see the desktop. If the autostart task was not registered, run `cua-driver serve` in an interactive desktop terminal and use a second terminal for the checks. Standard-user automation cannot drive elevated apps or the UAC secure desktop.
|
|
242
|
+
- **Linux.** Require a graphical X11 or XWayland session with `DISPLAY` set and AT-SPI available, and run `cua-driver serve` in the foreground inside that session. Native Wayland is opt-in with `CUA_DRIVER_RS_ENABLE_WAYLAND=1` and has compositor-specific limits; do not claim full Wayland support.
|
|
213
243
|
|
|
214
|
-
|
|
244
|
+
A missing macOS Accessibility or Screen Recording grant, a non-interactive Windows session, or no graphical Linux session is a `blocked`/`needs_human` finding in a workflow stage. Report the exact fix from the list above and re-run the readiness check on resume. Let the user grant permissions; do not script around consent dialogs.
|
|
245
|
+
|
|
246
|
+
### Drive a window from the shell
|
|
247
|
+
|
|
248
|
+
Load the `cua-driver` skill and follow its loop. The shape, with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` exported as above, is:
|
|
249
|
+
|
|
250
|
+
```sh
|
|
251
|
+
cua-driver call list_apps
|
|
252
|
+
cua-driver call list_windows '{"pid":844}'
|
|
253
|
+
cua-driver call get_window_state '{"pid":844,"window_id":10725,"screenshot_out_file":"artifacts/before.png"}' > artifacts/before.json
|
|
254
|
+
# Pick one element_token from before.json, then act on it in the background.
|
|
255
|
+
cua-driver call click '{"pid":844,"element_token":"s0000002a:14"}'
|
|
256
|
+
cua-driver call get_window_state '{"pid":844,"window_id":10725,"screenshot_out_file":"artifacts/after.png"}' > artifacts/after.json
|
|
257
|
+
```
|
|
215
258
|
|
|
216
|
-
-
|
|
217
|
-
- Prefer named accessibility controls or application APIs where available. If using coordinates, derive them from the current screen rather than an old screenshot.
|
|
218
|
-
- Keep the target on the primary monitor. PyAutoGUI's multi-monitor support is limited. Retina and DPI scaling can make screenshot pixels differ from input coordinates; compare screenshot dimensions with `gui.size()` before clicking.
|
|
219
|
-
- `gui.write()` sends keystrokes to the focused window and is not a general Unicode text-insertion API. For non-ASCII content, prefer app scripting or a controlled clipboard paste. Clipboard contents may be sensitive, so preserve and restore them when appropriate.
|
|
220
|
-
- For image matching, crop to the relevant region and use fixtures from the same theme and scaling. Handle a missing image as a failed observation, not a reason to click a default location. PyAutoGUI's `confidence` option requires OpenCV in the Python environment.
|
|
221
|
-
- Wait for an observable result with a deadline. A fixed sleep alone does not prove a render, export, or save has finished.
|
|
259
|
+
Replace the pid, window id, and token with values read from your own output; tokens are bound to the snapshot that produced them and must be re-read after any UI change. Check the postcondition in `after.json` with a bounded poll deadline, never a fixed sleep and never a repeated click. A `degraded` or `truncated` snapshot is a reason to stop and re-observe, and a refused background action is an escalation signal, not something to retry. Foreground delivery is an explicit escalation. Keep the JSON results and the `screenshot_out_file` images as evidence. When the work ends in a PR, attach the before/after PNGs to the PR body (`gh pr create --body-file body.md --attach 'before.png#Before' --attach 'after.png#After'` on supported GitHub) next to the scenario they prove, and cite the JSON by name as a local artifact; see [Verification and evidence](/workflows/verification#native-github-media).
|
|
222
260
|
|
|
223
|
-
|
|
261
|
+
### Run a scenario from workflow code
|
|
224
262
|
|
|
225
|
-
|
|
263
|
+
When a custom workflow owns the scenario, use the `@trycua/cua-driver` TypeScript SDK inside `ctx.tool` so the observe → act → re-observe → assert loop is a durable, replayable node. The [workflow authoring guide](/workflows/authoring#desktop-verification-with-cua-driver-in-ctx-tool) has the runnable example; the summary is:
|
|
226
264
|
|
|
227
|
-
|
|
265
|
+
- **Prerequisite.** `node` (preferred) or `bun` on the host. If neither is present, install one in a bounded attempt (Node via [fnm](https://github.com/Schniz/fnm) with `fnm install --lts` or the host's package manager, Bun via `curl -fsSL https://bun.sh/install | bash`) and report what the installer did; if the install is refused or fails, report that as the limitation rather than retrying.
|
|
266
|
+
- **Install.** `npm install @trycua/cua-driver@<exact pin matching cua-driver --version>` into a scratch directory outside the user's repository, one bounded attempt. The package ships per-platform native optional dependencies, so it is self-contained. Pin the exact driver version: daemon-backed clients verify contract, tool-schema, capability, and protocol versions before each action and refuse on mismatch.
|
|
267
|
+
- **Acquire the driver.** When `cua-driver status` reports a running daemon, use `CuaDriver.connect()` so the scenario reuses the daemon's permission identity (on macOS, `CuaDriver.app`'s grants) and the persisted telemetry-off preference; upstream describes `connect()` as a compatibility and app-hosting path, and that is exactly the role it plays here. Only when no daemon is reachable, fall back to `CuaDriver.create()`, which loads the runtime into the node process. On macOS that in-process fallback attributes Accessibility and Screen Recording to the node host, normally the terminal app, as a **separate grant**; `checkPermissions` is then read-only, and the host must fully quit and relaunch after granting.
|
|
268
|
+
- **Telemetry.** Set `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` in the child environment before constructing the driver.
|
|
269
|
+
- **Loop.** `listApps` → `listWindows` → `getWindowState` (refuse `degraded`/`truncated`) → resolve exactly one element → act by `elementToken` with `InputDeliveryMode.Background` → `getWindowState` again → bounded-poll the postcondition. `shutdown()` in `finally`, then `uniffiDestroy()` when present.
|
|
270
|
+
- **Result.** Machine-readable `verified` / `refuted` / `blocked` / `unknown`; the wrapper maps anything but `verified` to a nonzero outcome. An action that times out before its response is `unknown`, resolved by the postcondition, never by replaying the mutation.
|
|
228
271
|
|
|
229
|
-
|
|
272
|
+
### Stay safe
|
|
230
273
|
|
|
231
|
-
After a timeout or interruption, inspect the current document and any output files
|
|
274
|
+
One controller owns a desktop at a time. Use a dedicated session or account where practical, keep unrelated windows out of captures, and define an explicit stopping point before destructive or publishing actions such as overwriting an original, sending a message, or purchasing. After a timeout or interruption, inspect the current document and any output files before acting again; a save or export may have completed even if its acknowledgement was lost. Never disable OS security controls to make automation work.
|
|
232
275
|
|
|
233
276
|
## Browser automation with agent-browser
|
|
234
277
|
|
|
235
|
-
|
|
278
|
+
Prefer [agent-browser](https://github.com/vercel-labs/agent-browser) for what its skill covers: websites and web apps in Chrome/Chromium on all three desktop platforms, Electron desktop apps (`agent-browser skills get electron`), Slack workspaces, and cloud browsers. Anything outside that scope, or a limitation you hit inside it, goes to [Cua Driver](#desktop-automation-with-cua-driver). Its accessibility-tree snapshots expose page structure and element references, so automation can use actual controls rather than screen coordinates. For data retrieval or batch operations, consider a supported API first when it meets the request and you have permission to use it.
|
|
236
279
|
|
|
237
280
|
### Setup and first session
|
|
238
281
|
|
|
@@ -265,6 +308,7 @@ For a real task, act between the snapshot and final capture. Read element refere
|
|
|
265
308
|
- Inspect visible results and relevant console/network output (`agent-browser console`, `agent-browser errors`, `agent-browser network requests`). Keep semantic locators and assertions in a maintained browser test suite for repeatable regression coverage.
|
|
266
309
|
- Use the CLI's file-upload support for supported file inputs rather than driving an OS file picker. Switch to CUA or native tooling only for UI outside the page, and then recheck focus before returning to browser control.
|
|
267
310
|
- Treat cookies, saved authentication state, and network logs as sensitive. Do not commit or attach a browser profile as evidence.
|
|
311
|
+
- Keep `screenshot` PNGs and `record` recordings from the verified flow; when the work ends in a PR, attach them to the PR body with `gh pr create --attach` on supported GitHub, each next to the scenario it proves. See [Verification and evidence](/workflows/verification#native-github-media).
|
|
268
312
|
- Browser mobile emulation tests a web viewport, not a native Android or iOS application.
|
|
269
313
|
|
|
270
314
|
For verification captures and recordings, see [browser evidence](/workflows/verification#browser-changes).
|
|
@@ -326,11 +370,12 @@ For modified-key setup in Atomic, see [tmux setup](/tmux). For behavioral checks
|
|
|
326
370
|
|
|
327
371
|
### Desktop and native tools
|
|
328
372
|
|
|
329
|
-
- Install missing uv with `brew install uv` when Homebrew is available, or use the reviewed macOS installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/).
|
|
330
|
-
-
|
|
373
|
+
- Install a missing `cua-driver` with the [one-line installer](#install-if-missing) (macOS 14 Sonoma or later), run `cua-driver telemetry disable` once, and open a new shell so `~/.local/bin` is on `PATH`. Install missing uv with `brew install uv` when Homebrew is available, or use the reviewed macOS installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/).
|
|
374
|
+
- The daemon is `CuaDriver.app`. Start it with `open -n -g -a CuaDriver --args serve` so macOS attributes the process, and its Accessibility and Screen Recording grants, to `com.trycua.driver` rather than to Terminal or your IDE. A daemon started from a terminal is the right binary with the wrong privacy identity.
|
|
375
|
+
- Grant with `cua-driver permissions grant`, then toggle CuaDriver on under System Settings > Privacy & Security > Accessibility and under Screen & System Audio Recording, and relaunch the daemon. Confirm with `cua-driver permissions status`. If CuaDriver is missing from either list, click **+** and add `/Applications/CuaDriver.app`.
|
|
376
|
+
- An in-process `CuaDriver.create()` runtime is attributed to the node host that imported it, normally the terminal app. That is a separate grant from the app's, `checkPermissions` is read-only there, and the host must fully quit and relaunch after a change.
|
|
331
377
|
- AppleScript automation may also prompt for Automation permission to control another app. Let the user grant permissions; do not script around consent dialogs.
|
|
332
|
-
-
|
|
333
|
-
- Check Retina scaling and keep the target on the primary display. A black or incomplete capture usually needs permission or display troubleshooting, not more clicks.
|
|
378
|
+
- Window screenshots use the window's own coordinate space and report their scale factor; act by element token where possible and read dimensions from the same snapshot before any pixel action. A black or incomplete capture usually needs permission or display troubleshooting, not more clicks.
|
|
334
379
|
|
|
335
380
|
Use `osascript` for AppleScript or JavaScript for Automation when an app's scripting dictionary exposes the operation you need. See [application scripting and recipes](#application-scripting-and-apis) for a runnable example and Office automation choices. `System Events` UI scripting and native accessibility APIs can address menus and controls more reliably than coordinates; consult Apple's [UI scripting guide](https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/AutomatetheUserInterface.html).
|
|
336
381
|
|
|
@@ -346,11 +391,10 @@ Herdr is the first choice for interactive terminals when eligible. Homebrew prov
|
|
|
346
391
|
|
|
347
392
|
### Desktop and native tools
|
|
348
393
|
|
|
349
|
-
- Install missing uv through the [official Linux installer](https://docs.astral.sh/uv/getting-started/installation/) or an available distribution package.
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
- For unattended X11 work, a dedicated virtual display such as Xvfb can be useful. It does not prove behavior on a real Wayland desktop, GPU configuration, or physical display. Creative applications may require working graphics acceleration.
|
|
394
|
+
- Install a missing `cua-driver` with the [one-line installer](#install-if-missing); a minimal image may first need `sudo apt install libxi6 at-spi2-core`. Run `cua-driver telemetry disable` once and open a new shell so `~/.local/bin` is on `PATH`. Install missing uv through the [official Linux installer](https://docs.astral.sh/uv/getting-started/installation/) or an available distribution package.
|
|
395
|
+
- Installing the binary does not start the daemon or create a desktop session. Run `cua-driver serve` in the foreground in a terminal inside the graphical session that owns the apps, with the same `DISPLAY` and AT-SPI session bus, and run `cua-driver doctor` from a second terminal in that session.
|
|
396
|
+
- X11 and XWayland are the supported routes by default; toolkit-specific limits apply. Native Wayland is opt-in with `CUA_DRIVER_RS_ENABLE_WAYLAND=1` and depends on the compositor. Do not weaken session security or claim full Wayland support.
|
|
397
|
+
- For unattended X11 work, a dedicated virtual display such as Xvfb with a desktop session (for example `xfce4`) can be useful. It does not prove behavior on a real Wayland desktop, GPU configuration, or physical display. Creative applications may require working graphics acceleration.
|
|
354
398
|
|
|
355
399
|
[AT-SPI](https://gnome.pages.gitlab.gnome.org/at-spi2-core/) can expose named controls in accessible applications. `xdotool` and `wmctrl` can help with focus and window placement on X11; they are not general Wayland replacements. On Wayland, choose tools for the actual compositor and inspect their permission requirements. Use app APIs where custom canvases do not expose useful accessibility controls.
|
|
356
400
|
|
|
@@ -366,13 +410,14 @@ Herdr is preferred when eligible; tmux is a practical fallback on local or remot
|
|
|
366
410
|
|
|
367
411
|
### Desktop and native tools
|
|
368
412
|
|
|
369
|
-
- Install missing uv with `winget install --id=astral-sh.uv -e` or use the reviewed PowerShell installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/).
|
|
370
|
-
-
|
|
413
|
+
- Install a missing `cua-driver` with the [PowerShell one-liner](#install-if-missing) and run `cua-driver telemetry disable` once. Open a new shell if `Path` changed, then run `cua-driver --version`. Install missing uv with `winget install --id=astral-sh.uv -e` or use the reviewed PowerShell installer from [uv installation](https://docs.astral.sh/uv/getting-started/installation/).
|
|
414
|
+
- The daemon must run in the interactive user session (Session 1 or later); Session 0 services cannot see the desktop. The installer registers a `cua-driver-serve` autostart task when the session is interactive; otherwise run `cua-driver serve` in an interactive desktop terminal and use a second terminal for the checks.
|
|
415
|
+
- Run `cua-driver` in the Windows graphical session that owns the app. Running it inside WSL does not control native Windows windows.
|
|
371
416
|
- Keep the session unlocked and available during automation. A disconnected or minimized Remote Desktop session can change rendering or input behavior; verify the actual remote-session setup before relying on it.
|
|
372
417
|
- Use a consistent display scale and primary monitor. Check coordinates again after moving a window between displays with different DPI settings.
|
|
373
418
|
- Standard-user automation cannot reliably drive elevated apps or the UAC secure desktop. Stop for the user or choose an authorized non-elevated path rather than escalating just to force input through.
|
|
374
419
|
|
|
375
|
-
[Windows UI Automation](https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview) exposes controls by name and automation ID.
|
|
420
|
+
[Windows UI Automation](https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview) exposes controls by name and automation ID. Cua Driver reads that UIA tree in `get_window_state` and acts on it in the background, so prefer element tokens over pixel matching for accessible Windows apps. For structured document operations, start with [file libraries and app scripting](#application-scripting-and-apis). Use Cua Driver for the remaining visual interactions.
|
|
376
421
|
|
|
377
422
|
Snipping Tool or OBS can capture desktop evidence. Check the selected window and saved recording before sharing it.
|
|
378
423
|
|
|
@@ -390,22 +435,22 @@ Choose the deliverable first. A library or application API may produce it withou
|
|
|
390
435
|
|
|
391
436
|
| Task | Practical approach | Useful deliverables |
|
|
392
437
|
| --- | --- | --- |
|
|
393
|
-
| Blender 3D modeling | Use Blender Python for repeatable geometry or scene setup; use
|
|
438
|
+
| Blender 3D modeling | Use Blender Python for repeatable geometry or scene setup; use Cua Driver for visible editor operations and visual inspection. | Editable `.blend` file, exported model if requested, preview render. |
|
|
394
439
|
| Presentations | Generate structured slides with `python-pptx`, inspect them in a compatible viewer, and use CUA for visual refinements or slideshow interaction when needed. | Editable deck plus PDF or slide previews exported through a compatible application. |
|
|
395
440
|
| Video editing | Use the editor's scripting API or media CLI for repetitive operations; use CUA to adjust the timeline, inspect transitions, and review playback. | Editable project, required source references, final export. |
|
|
396
|
-
| Work across applications | Use native scripting for named windows and file operations; use
|
|
441
|
+
| Work across applications | Use native scripting for named windows and file operations; use Cua Driver where the task needs visual interaction, addressing each window by pid and window id. | Saved documents and a concise record of completed steps. |
|
|
397
442
|
|
|
398
443
|
Do not substitute a screenshot for the editable project or final export the user requested. Reopen saved files, check missing assets and fonts, and inspect the actual export. For video, check audio and timing as well as a still frame. Keep originals intact and use explicit save paths. Rendering, uploading, or exporting through a paid service may need separate authorization.
|
|
399
444
|
|
|
400
|
-
When the user specifically wants a CUA workflow,
|
|
445
|
+
When the user specifically wants a CUA workflow, give the stage that operates the desktop the `cua-driver` skill, or put a code-owned scenario in `ctx.tool` with the SDK. For artifact-only requests, keep script-based work outside the desktop session and omit UI stages that add no useful operation or check. A desktop sequence is:
|
|
401
446
|
|
|
402
447
|
1. Prepare assets and confirm the intended application, output formats, and permissions.
|
|
403
448
|
2. Open the dedicated desktop and inspect its starting state.
|
|
404
|
-
3. Create or edit with
|
|
449
|
+
3. Create or edit with Cua Driver and suitable native/app APIs, saving checkpoints.
|
|
405
450
|
4. Reopen and inspect the deliverables, then make bounded corrections if needed.
|
|
406
451
|
5. Hand off local files. Publish or upload only to an authorized target.
|
|
407
452
|
|
|
408
|
-
Pass scripts, project files, and artifact paths between stages rather than long click transcripts. Give one stage exclusive desktop ownership and use finite deadlines for renders and exports. Stop on unexpected dialogs,
|
|
453
|
+
Pass scripts, project files, and artifact paths between stages rather than long click transcripts. Give one stage exclusive desktop ownership and use finite deadlines for renders and exports. Stop on unexpected dialogs, degraded or truncated snapshots, missing permissions, or failed observations. On resume, inspect the app and files before repeating an action.
|
|
409
454
|
|
|
410
455
|
See [workflow authoring](/workflows/authoring) for stages and human-input gates. Use durable `ctx.tool` calls for workflow-owned external operations, with finite timeouts and cancellation; model stages can use the appropriate automation tools to operate the app. If the user asks to work inline, keep the same safety and deliverable checks without creating a workflow.
|
|
411
456
|
|
|
@@ -413,7 +458,11 @@ See [workflow authoring](/workflows/authoring) for stages and human-input gates.
|
|
|
413
458
|
|
|
414
459
|
| Symptom | What to check |
|
|
415
460
|
| --- | --- |
|
|
416
|
-
| uv or another command is missing | Install it when permitted, refresh PATH, and check its version in the same shell that will launch automation. |
|
|
461
|
+
| `cua-driver`, uv, or another command is missing | Install it when permitted with one bounded attempt, refresh PATH, and check its version in the same shell that will launch automation. |
|
|
462
|
+
| `cua-driver call` fails or `permissions status` reports `unknown` | The daemon is not running. Start it with `open -n -g -a CuaDriver --args serve` on macOS, an interactive-session `cua-driver serve` on Windows, or a foreground `cua-driver serve` inside the graphical session on Linux, then rerun `cua-driver status`. |
|
|
463
|
+
| Grants look correct but actions or captures are refused | Stale TCC grants. Toggle CuaDriver off and on under Accessibility and Screen & System Audio Recording, or click **+** and re-add `/Applications/CuaDriver.app`, then fully relaunch the daemon. An in-process SDK runtime needs the node host relaunched instead. |
|
|
464
|
+
| Contract, schema, or protocol mismatch | Version skew between the bundled skill (`0.28.2`), the `@trycua/cua-driver` pin, and `cua-driver --version`. Run `cua-driver update --apply` once, restart the daemon, and reinstall the SDK at the exact driver version. |
|
|
465
|
+
| Snapshot reports `degraded` or `truncated` | Do not act on it. Re-observe, narrow the query, or fall back to a pixel action from the same snapshot only where the skill allows it. |
|
|
417
466
|
| Black screenshot or no desktop | Check screen permissions, display/session ownership, X11 versus Wayland, and remote-session state. |
|
|
418
467
|
| Input reaches the wrong app | Stop. Confirm focus, window identity, scaling, and that no other controller shares the desktop. |
|
|
419
468
|
| Browser element reference no longer works | Take a fresh snapshot and locate the current control. |
|
|
@@ -9,7 +9,7 @@ Atomic accepts environment variables for configuration, provider credentials, an
|
|
|
9
9
|
| `ATOMIC_CODING_AGENT_DIR` | `PI_CODING_AGENT_DIR` | Agent/config directory; default `~/.atomic/agent` |
|
|
10
10
|
| `ATOMIC_CODING_AGENT_SESSION_DIR` | `PI_CODING_AGENT_SESSION_DIR` | Session directory; `--session-dir` takes precedence |
|
|
11
11
|
| `ATOMIC_PACKAGE_DIR` | `PI_PACKAGE_DIR` | Package directory override |
|
|
12
|
-
| `ATOMIC_OFFLINE` | `PI_OFFLINE` | Disable
|
|
12
|
+
| `ATOMIC_OFFLINE` | `PI_OFFLINE` | Disable automatic network activity, including update checks, package updates, telemetry, and model catalog refreshes |
|
|
13
13
|
| `ATOMIC_SKIP_VERSION_CHECK` | `PI_SKIP_VERSION_CHECK` | Skip automatic startup version checks; explicit self-update still checks |
|
|
14
14
|
| `ATOMIC_TELEMETRY` | `PI_TELEMETRY` | Override version-adoption / first-interactive-launch pings (`1`/`true`/`yes` or `0`/`false`/`no`). Does not disable update checks. The Atomic-prefixed value wins when both are set |
|
|
15
15
|
| `ATOMIC_REDUCED_MOTION` | `PI_REDUCED_MOTION` | Use static reduced-motion presentation |
|
|
@@ -32,7 +32,8 @@ user sends prompt ────────────────────
|
|
|
32
32
|
│ ┌─── turn (repeats while LLM calls tools) ───┐ │
|
|
33
33
|
│ │ │ │
|
|
34
34
|
│ ├─► turn_start │ │
|
|
35
|
-
│ ├─► context (can modify messages)
|
|
35
|
+
│ ├─► context (can modify conversation messages) │
|
|
36
|
+
│ ├─► context_with_system (can modify the full transcript)
|
|
36
37
|
│ ├─► before_provider_request (can inspect or replace payload)
|
|
37
38
|
│ ├─► after_provider_response (status + headers, before stream consume)
|
|
38
39
|
│ │ │ │
|
|
@@ -43,10 +44,14 @@ user sends prompt ────────────────────
|
|
|
43
44
|
│ │ ├─► tool_result (can modify) │ │
|
|
44
45
|
│ │ └─► tool_execution_end │ │
|
|
45
46
|
│ │ │ │
|
|
46
|
-
│ ├─► turn_end
|
|
47
|
+
│ ├─► turn_end (can append entries and continue) │
|
|
47
48
|
│ └─► post-tool threshold preflight │ │
|
|
48
49
|
│ (may compact before the next provider request) │
|
|
49
|
-
|
|
50
|
+
├─► agent_end │
|
|
51
|
+
├─► retry backoff or final-attempt recovery (when selected)
|
|
52
|
+
│ └─► fresh agent_start on successful recovery │
|
|
53
|
+
├─► agent_before_settle (can append entries and continue)│
|
|
54
|
+
└─► agent_settled (final, notification only) │
|
|
50
55
|
│
|
|
51
56
|
user sends another prompt ◄────────────────────────────────┘
|
|
52
57
|
|
|
@@ -302,20 +307,40 @@ Returning `systemPrompt`, or setting `forceSystemPrompt`, replaces the complete
|
|
|
302
307
|
|
|
303
308
|
Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
|
|
304
309
|
|
|
305
|
-
#### agent_start / agent_end / agent_settled
|
|
310
|
+
#### agent_start / agent_end / agent_before_settle / agent_settled
|
|
306
311
|
|
|
307
|
-
`agent_start` begins a low-level run. `agent_end` fires when that run ends, but Atomic may still retry, compact and retry, or deliver queued follow-ups.
|
|
312
|
+
`agent_start` begins a low-level run. `agent_end` fires when that run ends, but Atomic may still retry, compact and retry, or deliver queued follow-ups. `agent_before_settle` is the final actionable boundary: it can append session entries and request one continuation. `agent_settled` is final and notification-only; use it when a status integration needs to know Atomic has no automatic continuation left, including a chain of repeated output-cap continuations. Silence during a provider request or between these runs is not settlement.
|
|
308
313
|
|
|
309
314
|
```typescript
|
|
310
315
|
pi.on("agent_start", async (_event, ctx) => {});
|
|
311
316
|
pi.on("agent_end", async (event, ctx) => {
|
|
312
317
|
// event.messages - messages from this low-level run
|
|
313
318
|
});
|
|
319
|
+
|
|
320
|
+
let addedReviewReminder = false;
|
|
321
|
+
pi.on("agent_before_settle", async (event, ctx) => {
|
|
322
|
+
if (addedReviewReminder) return;
|
|
323
|
+
addedReviewReminder = true;
|
|
324
|
+
return {
|
|
325
|
+
entries: [...event.entries, {
|
|
326
|
+
type: "custom_message",
|
|
327
|
+
customType: "review-reminder",
|
|
328
|
+
content: "Review the final diff before replying.",
|
|
329
|
+
display: false,
|
|
330
|
+
}],
|
|
331
|
+
continue: true,
|
|
332
|
+
};
|
|
333
|
+
});
|
|
334
|
+
|
|
314
335
|
pi.on("agent_settled", async (_event, ctx) => {
|
|
315
|
-
// ctx.isIdle() is true
|
|
336
|
+
// ctx.isIdle() is true; runs requested here start after all settled handlers finish.
|
|
316
337
|
});
|
|
317
338
|
```
|
|
318
339
|
|
|
340
|
+
If the run is aborted while `agent_before_settle` handlers are running, valid returned entries are still committed, but requested continuation is suppressed. Work requested from `agent_settled` is deferred until every settled handler completes, so notification dispatch is non-reentrant. Input sent from an `agent_before_settle` handler with `deliverAs: "steer"` or `"followUp"` queues for the requested continuation instead of starting a second run.
|
|
341
|
+
|
|
342
|
+
Each provider request is built from the persisted session after every queued handler for the events before it (`agent_start`, `turn_start`, `message_start`, `message_end`, `tool_execution_*`) has finished, because a `message_end` handler may replace the message that gets persisted. Handlers run without blocking the event that triggered them, but a handler that waits for something later in the same run, such as the provider's response, stalls that run; wait in `agent_end` or `agent_settled` instead.
|
|
343
|
+
|
|
319
344
|
#### ui_prompt_start / ui_prompt_end
|
|
320
345
|
|
|
321
346
|
These notification-only events wrap blocking user-facing prompts. Each event has `reason: "ui_prompt" | "project_trust"`, the prompt `kind`, and the prompt `title` when available. Host and status integrations can use the pair to distinguish waiting for the user from active work.
|
|
@@ -349,11 +374,35 @@ pi.on("turn_start", async (event, ctx) => {
|
|
|
349
374
|
// event.turnIndex, event.timestamp
|
|
350
375
|
});
|
|
351
376
|
|
|
377
|
+
let replacedResponse = false;
|
|
352
378
|
pi.on("turn_end", async (event, ctx) => {
|
|
353
379
|
// event.turnIndex, event.message, event.toolResults
|
|
380
|
+
// event.messageEntryId, event.toolResultEntryIds, event.outcome
|
|
381
|
+
// event.entries contains the structural entries proposed so far.
|
|
382
|
+
if (replacedResponse || event.outcome !== "completed" || event.toolResults.length > 0) return;
|
|
383
|
+
replacedResponse = true;
|
|
384
|
+
return {
|
|
385
|
+
entries: [
|
|
386
|
+
...event.entries,
|
|
387
|
+
{ type: "context_edit", targetId: event.messageEntryId, replacement: null },
|
|
388
|
+
{
|
|
389
|
+
type: "custom_message",
|
|
390
|
+
customType: "replacement-instruction",
|
|
391
|
+
content: "Answer again using the persisted user request.",
|
|
392
|
+
display: false,
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
continue: true,
|
|
396
|
+
};
|
|
354
397
|
});
|
|
355
398
|
```
|
|
356
399
|
|
|
400
|
+
`turn_end` runs after the assistant and tool-result messages have been persisted and before the low-level `turn_end` event. Retry backoff and final-attempt recovery still happen after `agent_end`, preserving their existing lifecycle and queue ordering; `agent_before_settle` sees the repaired projection after that work completes. Boundary handlers run in extension load and registration order. Each handler sees prior proposals in `event.entries` and sees `event.context` rebuilt from them (`contextEntries`, `contextMessages`, `llmMessages`, `pendingMessages`, `canContinue`). Returning `entries` or `continue` replaces only that field; omitted fields preserve the current proposal. Allowed draft entry types are `custom`, `custom_message`, `context_edit`, and `compaction` (`summary` is the compacted transcript text; `firstKeptEntryId: null` keeps no preceding entries). The complete proposal is validated before it is appended in list order after all handlers finish; a handler error is reported and later handlers still run. Validation prevents partially applied semantic errors, but persistence is not transactional.
|
|
401
|
+
|
|
402
|
+
`continue: true` ensures one next provider request for that boundary invocation. If tool results, steering, or a follow-up already cause that request, they satisfy the decision and no additional request is made; otherwise Atomic makes one context-only request. Error and aborted responses remain hard exits. `continue: false` never suppresses natural work. Guard continuation conditions: an unconditional `continue: true` is evaluated again after the next response and can create an endless loop. A `custom_message` draft contributes a user-role model message but is extension-authored: it does not run human input hooks, slash commands, skills, or prompt templates.
|
|
403
|
+
|
|
404
|
+
Host integrations that construct `TurnEndEvent` values must provide `messageEntryId`, `toolResultEntryIds`, `outcome`, `entries`, `continue`, and `context`. `ExtensionEvent` exhaustive switches must also handle `agent_before_settle`. `ExtensionRunner.emit()` excludes actionable turn boundaries; dispatch `turn_end` and `agent_before_settle` through `emitBoundary(baseEvent, buildContext)` so handlers receive chained previews.
|
|
405
|
+
|
|
357
406
|
#### message_start / message_update / message_end
|
|
358
407
|
|
|
359
408
|
Fired for message lifecycle updates.
|
|
@@ -419,12 +468,31 @@ Fired before each LLM call. Modify messages non-destructively. See [Session Form
|
|
|
419
468
|
|
|
420
469
|
```typescript
|
|
421
470
|
pi.on("context", async (event, ctx) => {
|
|
422
|
-
// event.messages - deep copy, safe to modify
|
|
471
|
+
// event.messages - deep copy without system messages, safe to modify
|
|
423
472
|
const filtered = event.messages.filter(m => !shouldPrune(m));
|
|
424
473
|
return { messages: filtered };
|
|
425
474
|
});
|
|
426
475
|
```
|
|
427
476
|
|
|
477
|
+
`event.messages` holds the conversation without system messages. The prompt and tool declarations belong to Atomic and are not part of this hook: when the handler returns a changed list (or edits `event.messages` in place), Atomic replays the current prompt sections and tool declarations into one leading system message ahead of the returned messages. Filtering, windowing, or slicing from a compaction boundary therefore cannot drop the prompt or the tools. An unchanged list keeps mid-conversation system messages in place, so models that accept them retain their cached prefix. System messages a handler adds are kept after Atomic's head. To change the prompt or the tool set durably, use [`before_agent_start`](#before_agent_start) or `pi.setActiveTools()`; to edit system messages for one request, use [`context_with_system`](#context_with_system).
|
|
478
|
+
|
|
479
|
+
#### context_with_system
|
|
480
|
+
|
|
481
|
+
Fired before each LLM call, after every `context` handler has run and Atomic has restored the prompt and tool state. `event.messages` is the full transcript, including the leading system message and any mid-conversation prompt or tool patches (see [Session Format](/session-format)). The returned messages are sent as they are: this hook owns the prompt and tool declarations for the request.
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
import { getCurrentSystemMessage } from "@bastani/pi-ai";
|
|
485
|
+
|
|
486
|
+
pi.on("context_with_system", async (event, ctx) => {
|
|
487
|
+
const cut = findCutIndex(event.messages);
|
|
488
|
+
// Fold the dropped prefix so its prompt and tool state survives as the new head.
|
|
489
|
+
const head = getCurrentSystemMessage(event.messages.slice(0, cut));
|
|
490
|
+
return { messages: head ? [head, ...event.messages.slice(cut)] : event.messages.slice(cut) };
|
|
491
|
+
});
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
Rules: keep a system message at index 0 (providers read the prompt and initial tool declarations there; Atomic reports an extension error if a handler drops it). Removing a system message removes the tool declarations and section patches it carries. Check your output with `getCurrentSystemPrompt()` and `getCurrentTools()` from `@bastani/pi-ai`. Handlers run in extension load order; a `systemPrompt` forced from `before_agent_start` is still projected onto the request afterwards.
|
|
495
|
+
|
|
428
496
|
#### before_provider_headers
|
|
429
497
|
|
|
430
498
|
Fires after outgoing HTTP headers are assembled. Mutate `event.headers` to add, override, or remove headers. The event also identifies the provider and model.
|
package/docs/extensions.md
CHANGED
|
@@ -318,9 +318,9 @@ Moved to [Extension events](/extensions/events#agent-events).
|
|
|
318
318
|
|
|
319
319
|
Moved to [Extension events](/extensions/events#before_agent_start).
|
|
320
320
|
|
|
321
|
-
#### agent_start / agent_end / agent_settled
|
|
321
|
+
#### agent_start / agent_end / agent_before_settle / agent_settled
|
|
322
322
|
|
|
323
|
-
Moved to [Extension events](/extensions/events#agent_start-/-agent_end-/-agent_settled).
|
|
323
|
+
Moved to [Extension events](/extensions/events#agent_start-/-agent_end-/-agent_before_settle-/-agent_settled).
|
|
324
324
|
|
|
325
325
|
#### ui_prompt_start / ui_prompt_end
|
|
326
326
|
|
|
@@ -342,6 +342,10 @@ Moved to [Extension events](/extensions/events#tool_execution_start-/-tool_execu
|
|
|
342
342
|
|
|
343
343
|
Moved to [Extension events](/extensions/events#context).
|
|
344
344
|
|
|
345
|
+
#### context_with_system
|
|
346
|
+
|
|
347
|
+
Moved to [Extension events](/extensions/events#context_with_system).
|
|
348
|
+
|
|
345
349
|
#### before_provider_headers
|
|
346
350
|
|
|
347
351
|
Moved to [Extension events](/extensions/events#before_provider_headers).
|
|
@@ -15,7 +15,7 @@ On a fresh install with no prior startup state, Atomic shows a one-time explanat
|
|
|
15
15
|
|
|
16
16
|
The normal Atomic input is ready from the start. Type a message, run `/login` if no provider is connected, or launch a workflow command. No separate onboarding step is required.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
The agent decides whether a workflow fits. Well-defined, authorized work that benefits from durable stages, checkpoints, dependencies, recovery, review loops or approval gates runs as a workflow; brainstorming, discussion, unclear goals, simple bounded work, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
|
|
19
19
|
|
|
20
20
|
Atomic can discover and run named builtin, project, user, and package workflows; author a rich custom TypeScript `workflow({...})` inline; and compositionally import reusable workflow definitions—including builtins from `@bastani/atomic/workflows/builtin`—into parent workflows with `ctx.workflow(...)`. Nested children can nest again within `maxDepth`, so custom graphs can combine proven research, implementation, design, verification, and approval workflows instead of copying them. They can also classify and branch, dynamically fan out and synthesize artifacts, run adversarial repair cycles, tournament-rank candidates, and loop until checks pass with explicit bounds.
|
|
21
21
|
|
|
@@ -81,7 +81,7 @@ Use goal to update the CLI docs, include one example, run the docs build, and fi
|
|
|
81
81
|
Use ralph to research and implement specs/rate-limit.md, then review and repair it within three loops.
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
For natural-language launches, Atomic
|
|
84
|
+
For natural-language launches, Atomic decides between inline work and a workflow as described above and preserves your explicit approval gates. Direct user `/workflow <name>` commands launch the named workflow. Goal provides a durable ledger and receipt-backed reviewer gate; Ralph provides a research-first implementation/review loop. Custom graphs can add domain-specific deterministic checks and bounded repairs.
|
|
85
85
|
|
|
86
86
|
### Monitor and steer a run
|
|
87
87
|
|
|
@@ -115,6 +115,7 @@ Skills are reusable expert instructions. Trigger one with `/skill:<name>` follow
|
|
|
115
115
|
| `tdd` | Test-first feature or bug work. | `/skill:tdd` |
|
|
116
116
|
| `impeccable` | Critique or refine web/native frontend and product UI; includes detector hooks, framework-aware live review, and mount-failure recovery. | `/skill:impeccable` |
|
|
117
117
|
| `agent-browser` | Drive a real browser for end-to-end UI checks, screenshots, and reviewable proof videos. | `/skill:agent-browser` |
|
|
118
|
+
| `cua-driver` | Drive a native desktop app, simulator, or emulator window through Cua Driver: accessibility snapshot, element-token actions, and a fresh snapshot to verify. | `/skill:cua-driver` |
|
|
118
119
|
| `qlty` | Lint, auto-format, and measure code quality — complexity, duplication, and code smells — through one CLI across the repository's languages. | `/skill:qlty check this branch before I hand it off` |
|
|
119
120
|
| `liteparse` | Pull text, tables, or values out of PDF, DOCX, PPTX, XLSX, and image files locally. | `/skill:liteparse` |
|
|
120
121
|
| `show-me` | Explain a topic visually with concise diagrams, code-shape sketches, or focused HTML artifacts. HumanLayer, MIT licensed. | `/skill:show-me` |
|
|
@@ -23,7 +23,7 @@ Start with the state you can observe. The existing sections below explain the co
|
|
|
23
23
|
|
|
24
24
|
## How Connection Works
|
|
25
25
|
|
|
26
|
-
Intercom connects when you use its tool, `/intercom`, or ALT+M. Launching an Intercom-enabled subagent may also connect the parent to authorize supervisor communication
|
|
26
|
+
Intercom connects when you use its tool, `/intercom`, or ALT+M. Launching an Intercom-enabled subagent may also connect the parent to authorize supervisor communication. An admitted subagent child connects as soon as its session starts, so it appears in its supervisor's and peers' `intercom list` and can receive `send`/`ask` before it ever uses Intercom itself; if the broker is unavailable at that moment, the child falls back to connecting on its next Intercom use. Connections are cleaned up when the session closes or is replaced.
|
|
27
27
|
|
|
28
28
|
A session becomes intercom-connected when all of these are true:
|
|
29
29
|
|
|
@@ -41,6 +41,18 @@ Name sessions with `/name` so they can target each other (for example `/name pla
|
|
|
41
41
|
|
|
42
42
|
If initialization keeps failing, check the reported cause and `~/.atomic/agent/intercom/broker.log` (or the Intercom directory under `ATOMIC_CODING_AGENT_DIR`). Do not automatically resend an operation reported with an unknown delivery outcome; check with the recipient first.
|
|
43
43
|
|
|
44
|
+
### Workflow-stage route refusals
|
|
45
|
+
|
|
46
|
+
When a workflow stage starts, its session registers a live Intercom route with the broker. A refusal names the condition that failed:
|
|
47
|
+
|
|
48
|
+
| Reason | Meaning | Behavior |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| `Live workflow-stage route has no registered workflow owner` | The workflow owner's own broker connection is re-registering (for example after a reconnect). | Transient. The stage's bounded warm-up retry re-registers once the owner is back; the stage fails only if every attempt is refused. |
|
|
51
|
+
| `Live workflow-stage route is owned by another active session` | Another connected session already owns this exact stage. | Transient when the previous attempt's session is still being torn down; a genuinely live duplicate owner is refused on every attempt and the stage fails after the bounded retries. |
|
|
52
|
+
| `… capability does not match the workflow owner` / `… registrant is outside the workflow invocation group` / `… name a non-agent workflow node` | Authority or configuration mismatch. | Terminal for that stage startup; it repeats identically on retry. |
|
|
53
|
+
|
|
54
|
+
A stage name reused by a later occurrence in the same run (for example `reviewer-a` in a second review round while the first round's completed session is still connected) is not a duplicate owner. The later stage registers under its stage id, and the reused name is ambiguous: neither occurrence keeps a live name alias, so a send to that name is routed through the workflow owner rather than delivered to whichever occurrence registered first. Address such stages by the id-form target that `intercom list` shows.
|
|
55
|
+
|
|
44
56
|
## How It Works
|
|
45
57
|
|
|
46
58
|
The local broker starts on first use and exits after five seconds without registered sessions. Clients reconnect automatically using delays of 1, 2, 5, 10, then 30 seconds. Explicit connection failures remain visible while background recovery continues.
|
package/docs/intercom.md
CHANGED
|
@@ -9,7 +9,7 @@ description: "Direct messaging between Atomic sessions on the same machine"
|
|
|
9
9
|
|
|
10
10
|
Atomic bundles `@bastani/intercom` for direct 1:1 messaging between sessions on the same machine. Send context, findings, or requests yourself, or let agents coordinate. No separate install is needed.
|
|
11
11
|
|
|
12
|
-
The extension registers commands and tools at startup. Connections are lazy: a session connects when you or the model invoke Intercom.
|
|
12
|
+
The extension registers commands and tools at startup. Connections are lazy: a session connects when you or the model invoke Intercom. Workflow stages and admitted subagent children connect at session start so they are listable and steerable immediately.
|
|
13
13
|
|
|
14
14
|
**Key capabilities:**
|
|
15
15
|
- **Session messaging** - `send`, `ask` (blocking, 10-minute timeout), `reply`, `pending`, `list`, `groups`, and `status` via the `intercom` tool
|