@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
|
@@ -511,6 +511,197 @@ After exit is selected, new tracked work and retained stage operations are refus
|
|
|
511
511
|
|
|
512
512
|
On resume of an unfinished tool, a successful exit cannot skip that tool. Restore its matching call before new tracked work; otherwise Atomic reports `insufficient_state: replay topology mismatch`. Intentional failed, blocked, cancelled, or skipped exits remain available.
|
|
513
513
|
|
|
514
|
+
<a id="desktop-verification-with-cua-driver-in-ctx-tool" />
|
|
515
|
+
|
|
516
|
+
### Desktop verification with Cua Driver in `ctx.tool`
|
|
517
|
+
|
|
518
|
+
When a model chooses each desktop action, an authored model stage loads the bundled `cua-driver` skill and runs one-shot `cua-driver call <tool>` commands; see [Computer use](/computer-use#desktop-automation-with-cua-driver) for the face rule, installation, telemetry, and readiness. When your workflow's TypeScript owns the sequence and the postcondition, run the scenario with the [`@trycua/cua-driver`](https://www.npmjs.com/package/@trycua/cua-driver) TypeScript SDK inside `ctx.tool(name, args, fn, { timeoutMs })` so the observe → act → re-observe → assert loop is a durable, replayable node rather than a transcript.
|
|
519
|
+
|
|
520
|
+
Prerequisites and setup, each as one bounded attempt:
|
|
521
|
+
|
|
522
|
+
- `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.
|
|
523
|
+
- The `cua-driver` executable (`cua-driver --version`), installed with upstream's one-line installer if missing, followed by `cua-driver telemetry disable` once.
|
|
524
|
+
- The SDK installed at the exact driver version into a scratch directory outside the user's repository, for example `npm install @trycua/cua-driver@0.28.2 --prefix ~/.cache/atomic-cua`. The package ships per-platform native optional dependencies. Daemon-backed clients verify contract, tool-schema, capability, and protocol versions before each action and refuse on mismatch, so the pin must match `cua-driver --version`.
|
|
525
|
+
|
|
526
|
+
The scenario itself is a small script in that scratch directory. It acquires the driver with `CuaDriver.connect()` when a daemon is running, so it reuses the daemon's permission identity (on macOS, `CuaDriver.app`'s Accessibility and Screen Recording grants) and the persisted telemetry-off preference; upstream describes `connect()` as a compatibility and app-hosting path, which is exactly the role it plays here. Only when no daemon is reachable does it fall back to `CuaDriver.create()`, which loads the runtime into the node process. On macOS that in-process fallback attributes permissions to the node host, normally the terminal app, as a **separate grant** from the app's; `checkPermissions` is then read-only, and the host must fully quit and relaunch after granting. Save it as `~/.cache/atomic-cua/verify-counter.mjs`:
|
|
527
|
+
|
|
528
|
+
```js
|
|
529
|
+
// Reads {"daemon":true|false,"artifactsDir":"..."} from argv[2]; prints one JSON result line.
|
|
530
|
+
// Replace the app name, window title, element labels, and postcondition with ones you control.
|
|
531
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
532
|
+
import { join } from "node:path";
|
|
533
|
+
import {
|
|
534
|
+
ActionTarget, ClickButton, ClickInput, ClickPosition, CuaDriver,
|
|
535
|
+
GetWindowStateInput, InputDeliveryMode, ListAppsInput, ListWindowsInput,
|
|
536
|
+
} from "@trycua/cua-driver";
|
|
537
|
+
|
|
538
|
+
const { daemon, artifactsDir } = JSON.parse(process.argv[2]);
|
|
539
|
+
mkdirSync(artifactsDir, { recursive: true });
|
|
540
|
+
const unique = (items, what) => {
|
|
541
|
+
if (items.length !== 1) throw new Error(`Expected one ${what}, found ${items.length}`);
|
|
542
|
+
return items[0];
|
|
543
|
+
};
|
|
544
|
+
const finish = (result, detail) => {
|
|
545
|
+
process.stdout.write(`${JSON.stringify({ result, detail })}\n`);
|
|
546
|
+
process.exitCode = result === "verified" ? 0 : 1;
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
// The wrapper already set CUA_DRIVER_RS_TELEMETRY_ENABLED=false in this process's environment
|
|
550
|
+
// before the driver was constructed; the SDK is one of the faces that reports telemetry by default.
|
|
551
|
+
const driver = daemon ? await CuaDriver.connect() : CuaDriver.create(undefined);
|
|
552
|
+
try {
|
|
553
|
+
const apps = await driver.listApps(ListAppsInput.new({}));
|
|
554
|
+
const app = unique(apps.apps.filter((a) => a.name === "Window Demo" && a.running), "app");
|
|
555
|
+
const windows = await driver.listWindows(ListWindowsInput.new({ pid: app.pid, onScreenOnly: true }));
|
|
556
|
+
const window = unique(windows.windows.filter((w) => w.title === "Counter"), "window");
|
|
557
|
+
const target = new ActionTarget.Window({ pid: app.pid, windowId: window.windowId });
|
|
558
|
+
const snapshot = async (label) => {
|
|
559
|
+
const state = await driver.getWindowState(
|
|
560
|
+
GetWindowStateInput.new({
|
|
561
|
+
pid: app.pid, windowId: window.windowId,
|
|
562
|
+
includeAccessibilityTree: true, includeScreenshot: true,
|
|
563
|
+
screenshotOutFile: join(artifactsDir, `${label}.png`),
|
|
564
|
+
}),
|
|
565
|
+
);
|
|
566
|
+
if (state.degraded || state.truncated) throw new Error(`${label} snapshot is degraded or truncated`);
|
|
567
|
+
// Keep the whole result (snapshot id, screenshot reference, degraded/truncated flags), not just
|
|
568
|
+
// the elements, so the retained tree is provably from a complete snapshot. Ids are bigint.
|
|
569
|
+
const json = JSON.stringify(state, (_key, value) => (typeof value === "bigint" ? value.toString() : value), 2);
|
|
570
|
+
writeFileSync(join(artifactsDir, `${label}.json`), json);
|
|
571
|
+
return state;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
const before = await snapshot("before");
|
|
575
|
+
const button = unique((before.elements ?? []).filter((e) => e.label === "Increment"), "button");
|
|
576
|
+
const counter = unique((before.elements ?? []).filter((e) => e.label === "Count"), "counter");
|
|
577
|
+
if (!button.elementToken || counter.value === undefined) throw new Error("Snapshot lacks the button token or counter value");
|
|
578
|
+
|
|
579
|
+
let clicked = false;
|
|
580
|
+
try {
|
|
581
|
+
await driver.click(ClickInput.new({
|
|
582
|
+
target,
|
|
583
|
+
position: new ClickPosition.Element({ elementToken: button.elementToken }),
|
|
584
|
+
deliveryMode: InputDeliveryMode.Background,
|
|
585
|
+
button: ClickButton.Left, count: 1,
|
|
586
|
+
}));
|
|
587
|
+
clicked = true;
|
|
588
|
+
} catch (error) {
|
|
589
|
+
// A timeout or interrupted action before its response is "unknown": the postcondition below
|
|
590
|
+
// decides, and the click is never replayed.
|
|
591
|
+
if (!/timed out|ActionInterrupted/u.test(String(error))) throw error;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// Bounded poll on fresh snapshots; never a fixed sleep, never a second click.
|
|
595
|
+
const deadline = Date.now() + 10_000;
|
|
596
|
+
let after = await snapshot("after");
|
|
597
|
+
let updated = unique((after.elements ?? []).filter((e) => e.label === "Count"), "counter");
|
|
598
|
+
while (updated.value === counter.value && Date.now() < deadline) {
|
|
599
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
600
|
+
after = await snapshot("after");
|
|
601
|
+
updated = unique((after.elements ?? []).filter((e) => e.label === "Count"), "counter");
|
|
602
|
+
}
|
|
603
|
+
if (updated.value !== undefined && updated.value !== counter.value) {
|
|
604
|
+
finish("verified", `Count ${counter.value} -> ${updated.value}`);
|
|
605
|
+
} else {
|
|
606
|
+
finish(clicked ? "refuted" : "unknown", `Count stayed ${counter.value}`);
|
|
607
|
+
}
|
|
608
|
+
} catch (error) {
|
|
609
|
+
finish("unknown", String(error));
|
|
610
|
+
} finally {
|
|
611
|
+
try {
|
|
612
|
+
await driver.shutdown();
|
|
613
|
+
} finally {
|
|
614
|
+
if ("uniffiDestroy" in driver && typeof driver.uniffiDestroy === "function") driver.uniffiDestroy();
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
The workflow runs a readiness preflight as its own `ctx.tool` first, so a missing permission or session ends the run with `ctx.exit({ status: "blocked", reason })`. A blocked author exit is terminal and not resumable (see [Early exit with `ctx.exit()`](#early-exit-with-ctx-exit)), and the preflight's `{ ready: false }` result is a completed, cached checkpoint, so after the user grants the permission start a new run: its fresh preflight checks again instead of replaying the cached result. The scenario tool spawns `node` with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false` in the child environment, forwards `signal` so a quit or targeted abort kills the child, and maps anything but `verified` to a nonzero outcome:
|
|
620
|
+
|
|
621
|
+
```ts
|
|
622
|
+
import { spawn } from "node:child_process";
|
|
623
|
+
import { homedir } from "node:os";
|
|
624
|
+
import { join } from "node:path";
|
|
625
|
+
import { Type, workflow } from "@bastani/workflows";
|
|
626
|
+
|
|
627
|
+
const sdkDir = join(homedir(), ".cache", "atomic-cua");
|
|
628
|
+
const cuaEnv = { ...process.env, CUA_DRIVER_RS_TELEMETRY_ENABLED: "false" };
|
|
629
|
+
|
|
630
|
+
function run(command: string, args: string[], signal: AbortSignal, cwd?: string) {
|
|
631
|
+
return new Promise<{ code: number | null; stdout: string; stderr: string }>((resolve) => {
|
|
632
|
+
const child = spawn(command, args, { cwd, env: cuaEnv, signal, stdio: ["ignore", "pipe", "pipe"] });
|
|
633
|
+
let stdout = "";
|
|
634
|
+
let stderr = "";
|
|
635
|
+
child.stdout.on("data", (chunk: Buffer) => { stdout += chunk.toString(); });
|
|
636
|
+
child.stderr.on("data", (chunk: Buffer) => { stderr += chunk.toString(); });
|
|
637
|
+
// A missing executable (ENOENT) or an abort arrives here rather than on "close"; treat it as a
|
|
638
|
+
// failed command so the preflight can return its remediation instead of throwing.
|
|
639
|
+
child.on("error", (error) => resolve({ code: null, stdout, stderr: `${stderr}${error.message}` }));
|
|
640
|
+
child.on("close", (code) => resolve({ code, stdout, stderr }));
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export default workflow({
|
|
645
|
+
name: "verify-counter",
|
|
646
|
+
description: "Prove the Increment button changes the Count field in the Counter window.",
|
|
647
|
+
inputs: { artifactsDir: Type.String({ description: "Directory for before/after state JSON and screenshots" }) },
|
|
648
|
+
outputs: { result: Type.String(), detail: Type.String() },
|
|
649
|
+
run: async (ctx) => {
|
|
650
|
+
const preflight = await ctx.tool(
|
|
651
|
+
"cua-preflight",
|
|
652
|
+
{ platform: process.platform },
|
|
653
|
+
async ({ signal }) => {
|
|
654
|
+
const version = await run("cua-driver", ["--version"], signal);
|
|
655
|
+
if (version.code !== 0) {
|
|
656
|
+
return { ready: false, reason: "cua-driver is not installed; run /bin/bash -c \"$(curl -fsSL https://cua.ai/driver/install.sh)\" (Windows: irm https://cua.ai/driver/install.ps1 | iex), then cua-driver telemetry disable" };
|
|
657
|
+
}
|
|
658
|
+
const status = await run("cua-driver", ["status"], signal);
|
|
659
|
+
const daemon = status.code === 0;
|
|
660
|
+
if (process.platform === "darwin" && daemon) {
|
|
661
|
+
const permissions = await run("cua-driver", ["permissions", "status", "--json"], signal);
|
|
662
|
+
const grants = permissions.code === 0
|
|
663
|
+
? (JSON.parse(permissions.stdout) as { accessibility?: boolean; screen_recording?: boolean })
|
|
664
|
+
: {};
|
|
665
|
+
if (grants.accessibility !== true || grants.screen_recording !== true) {
|
|
666
|
+
return { ready: false, reason: "Missing macOS grant: run `cua-driver permissions grant`, toggle CuaDriver on under System Settings → Privacy & Security → Accessibility and Screen & System Audio Recording, then relaunch the daemon with `open -n -g -a CuaDriver --args serve`" };
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
const apps = await run("cua-driver", ["call", "list_apps"], signal);
|
|
670
|
+
if (apps.code !== 0) {
|
|
671
|
+
return { ready: false, reason: `cua-driver call list_apps failed; start the daemon (macOS: open -n -g -a CuaDriver --args serve; Windows: cua-driver serve in the interactive session; Linux: cua-driver serve inside the graphical session): ${apps.stderr.trim()}` };
|
|
672
|
+
}
|
|
673
|
+
return { ready: true, daemon };
|
|
674
|
+
},
|
|
675
|
+
{ timeoutMs: 60_000 },
|
|
676
|
+
);
|
|
677
|
+
if (!preflight.ready) {
|
|
678
|
+
return ctx.exit({ status: "blocked", reason: preflight.reason });
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
const scenario = await ctx.tool(
|
|
682
|
+
"verify-counter-scenario",
|
|
683
|
+
{ artifactsDir: ctx.inputs.artifactsDir, daemon: preflight.daemon },
|
|
684
|
+
async ({ signal }) => {
|
|
685
|
+
const args = JSON.stringify({ daemon: preflight.daemon, artifactsDir: ctx.inputs.artifactsDir });
|
|
686
|
+
const child = await run("node", ["verify-counter.mjs", args], signal, sdkDir);
|
|
687
|
+
const line = child.stdout.trim().split("\n").at(-1) ?? "";
|
|
688
|
+
const parsed = line.startsWith("{") ? (JSON.parse(line) as { result: string; detail: string }) : undefined;
|
|
689
|
+
const result = parsed?.result ?? "unknown";
|
|
690
|
+
if (result !== "verified") {
|
|
691
|
+
throw new Error(`desktop verification ${result}: ${parsed?.detail ?? child.stderr.trim()}`);
|
|
692
|
+
}
|
|
693
|
+
return { result, detail: parsed?.detail ?? "" };
|
|
694
|
+
},
|
|
695
|
+
{ timeoutMs: 5 * 60_000 },
|
|
696
|
+
);
|
|
697
|
+
|
|
698
|
+
return scenario;
|
|
699
|
+
},
|
|
700
|
+
});
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
A `verified` result is cached durably, so a resumed run does not click again. A thrown `refuted`, `blocked`, or `unknown` result fails the node and is not replayed from cache; a new run executes the preflight and the scenario again from a fresh snapshot, and a durable retry of a resumable failure replays the completed preflight checkpoint and re-runs only the scenario. Keep the artifacts directory outside the repository unless the evidence belongs in the deliverable, and never post the installation UUID from `cua-driver telemetry status` in a result or reason. Safety is the same on both faces: one controller per desktop, a dedicated session or account where practical, and an explicit stopping point before destructive or publishing actions.
|
|
704
|
+
|
|
514
705
|
### Workflow Composition
|
|
515
706
|
|
|
516
707
|
Use workflow composition when a workflow calls a reusable user-defined workflow from the project or package, or a bundled builtin workflow, and consumes its outputs as a tracked boundary stage. Import the child definition with a normal TypeScript import, then pass it directly to `ctx.workflow(workflowDefinition, options)`. `ctx.workflow(...)` does not accept registry names, path objects, or string aliases.
|
|
@@ -58,7 +58,7 @@ List and run it like any other workflow:
|
|
|
58
58
|
|
|
59
59
|
Named workflow runs execute in the background. By default, after launch expect a full run id and monitor it with `/workflow status <run-id>`, F2, or `/workflow connect <run-id>`. A definition with `autoAttach: true` instead opens the graph overlay as soon as an interactive top-level named launch through `/workflow <name>` or the registered `workflow` tool is accepted. This option does not affect headless launches or nested `ctx.workflow(...)` calls, and existing input-form launch behavior is unchanged.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
For deliberately authored multi-item graphs, see [Task queues and software factories](/workflows/reliable-design#task-queues-and-software-factories). To start a workflow, use `workflow({ action: "run", workflow: "<name>", inputs: {...} })` after inspecting its required inputs with `workflow({ action: "inputs", workflow: "<name>" })`.
|
|
62
62
|
|
|
63
63
|
The below-editor `BACKGROUND` panel shows top-level runs, elapsed time, stage progress, and live tools. A blue `?` marks human-input waits; a single question may show a preview and connect command. Narrow terminals show counts only. Use `/workflow status` or `/workflow connect` for full details, including resumable quit runs that have left the panel. See [panel controls](/workflows/operations#reading-and-scrolling-the-panel).
|
|
64
64
|
|
|
@@ -8,7 +8,7 @@ For stages authored with `model: "auto"`, Atomic ranks up to three distinct elig
|
|
|
8
8
|
|
|
9
9
|
Model selection uses the actual stage prompt, stage name, hard constraints, eligible model catalog, and compact dated evaluation records, not full human guides. Stage system and appended system prompts are not sent to the model router. Put requirements that should influence model selection in the stage prompt; the execution session still receives its configured system prompts.
|
|
10
10
|
|
|
11
|
-
Malformed or schema-invalid routing answers receive up to three corrective retries after the initial attempt, independently for Jev and any current-chat fallback,
|
|
11
|
+
Malformed or schema-invalid routing answers receive up to three corrective retries after the initial attempt, independently for Jev and any current-chat fallback, and transient provider failures (connection errors, HTTP 408, 429 and 5xx) are retried up to three times with backoff. Model selection has no built-in wall-clock deadline; cancellation and independent provider limits still apply. Any Jev failure triggers a reported switch to the current chat model, whether the router was selected automatically or pinned. If routing inference fails completely — Jev and the chat structured-output fallback both — the stage runs on the current chat model instead of failing, with a recorded warning, but only when that model is available and satisfies every routing constraint (such as `allowedModels` and effort, cost, context and input limits). Otherwise the stage fails. An empty eligible catalog, stale decisions, credential-bearing routing context and cancellation still prevent stage execution without fallback. Choose router and chat providers permitted to receive the stage task and reference context.
|
|
12
12
|
|
|
13
13
|
Replay reuses recorded results without routing. Resume of a saved auto stage retains its verified selection and revalidates it against the current catalog and restrictions before fresh session admission, without a hidden new decision. If it is no longer eligible, resume fails rather than choosing another model. See [authoring automatic stages](/workflows/authoring#automatic-stage-model-selection).
|
|
14
14
|
|
|
@@ -101,7 +101,7 @@ workflow({ action: "models" })
|
|
|
101
101
|
The workflow tool action surface is:
|
|
102
102
|
|
|
103
103
|
- discovery: `list`, `get`, `inputs`, plus `models` for the configured model catalog
|
|
104
|
-
- execution: `
|
|
104
|
+
- execution: `run` with the workflow name and validated `inputs`
|
|
105
105
|
- inspection: `status`, `stages`, `stage`, `transcript`
|
|
106
106
|
- prompt response: `answer`; run control: `pause`, `quit`, `resume`; free-form stage communication: ordinary Intercom `send`/live `ask` to `workflow:<rootRunId>/<segment>[/<segment>...]` path targets, including `*` and `**` globs
|
|
107
107
|
- rediscovery: `reload`
|
|
@@ -138,22 +138,14 @@ Named launches wait only for **startup admission**, not for workflow completion.
|
|
|
138
138
|
|
|
139
139
|
A model may launch in the foreground only when the user explicitly requests it or foreground execution is technically required, and it must tell the user before launching.
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
Inspect the workflow's input contract, then launch it by name:
|
|
142
142
|
|
|
143
143
|
```ts
|
|
144
|
-
workflow({
|
|
145
|
-
|
|
146
|
-
state: {
|
|
147
|
-
task: "Map the workflow runtime by subsystem, with parallel research and a synthesis.",
|
|
148
|
-
conversation: [{ role: "user", text: "Read-only research; do not edit files." }],
|
|
149
|
-
documents: [{ source: "Approved research brief", content: "Compare discovery, dispatch, execution and persistence." }],
|
|
150
|
-
},
|
|
151
|
-
})
|
|
152
|
-
// Inspect the returned inputSchema, then use the returned workflowId:
|
|
153
|
-
workflow({ action: "run", workflowId: "returned-execution-id", inputs: { prompt: "map workflow runtime by subsystem" } })
|
|
144
|
+
workflow({ action: "inputs", workflow: "fan-out-and-synthesize" })
|
|
145
|
+
workflow({ action: "run", workflow: "fan-out-and-synthesize", inputs: { prompt: "Map the workflow runtime by subsystem" } })
|
|
154
146
|
```
|
|
155
147
|
|
|
156
|
-
|
|
148
|
+
You can also use the command line with key=value arguments:
|
|
157
149
|
|
|
158
150
|
```text
|
|
159
151
|
/workflow fan-out-and-synthesize prompt="map workflow runtime by subsystem" max_concurrency=4
|
|
@@ -175,66 +167,6 @@ Withdrawing an SDK adapter cancels its current presentation, not the durable app
|
|
|
175
167
|
|
|
176
168
|
Graph node cards show each model stage's effective model and thinking level above its status, including after fallback and durable resume. Long model names are truncated first, preserving the complete thinking level and a canonical `-fast` model suffix. This suffix is model identity, not a separate fast-mode switch or proof of service tier. Thinking `off` is omitted; stages without a model show no model placeholder. Tool nodes retain their `durable tool` body, and the `BACKGROUND` summary is unchanged.
|
|
177
169
|
|
|
178
|
-
## Model-invoked launch routing
|
|
179
|
-
|
|
180
|
-
Call `workflow route` with the actual request, relevant message text/document excerpts, and explicit constraints in `state`, not file paths in place of content. If it returns `none`, continue inline. Otherwise use its input contract to prepare inputs, then call `workflow run` with the registered workflow ID. Ask only for genuinely missing information.
|
|
181
|
-
|
|
182
|
-
`state.task` is the actual request. Optional `conversation` contains attributed `{ role, text }` messages; optional `documents` contains `{ source, content }` excerpts or clearly labeled faithful summaries. Preserve uncertainty and explicit constraints. Empty arrays are valid. Paths/URLs are provenance metadata, not implicit reads. Read authorized sources before routing when needed; if unavailable, state that limitation in the content. Remove secrets before transmission. Document quotations do not become user authorization.
|
|
183
|
-
|
|
184
|
-
Only route performs inference. Run rejects omitted/empty/unknown/foreign/stale IDs and name overrides. It accepts the selected schema's explicit inputs without resending state, rerouting or calling an extraction model. Invalid inputs do not consume a valid reservation. User `/workflow` commands and authored `ctx.workflow(...)` remain direct and internal execution paths respectively, with their existing safety contracts.
|
|
185
|
-
|
|
186
|
-
If the user specified budget limits, preserve exact values in `state.userBudget.limits` and quote the instruction in `provenance`. Omission inherits limits and zero disables only its field. A reservation is permission to attempt validated admission, not blanket approval for side effects.
|
|
187
|
-
|
|
188
|
-
### Choose the inference model
|
|
189
|
-
|
|
190
|
-
Set `routerModel` in [settings.json](/settings#routermodel), not workflow extension config:
|
|
191
|
-
|
|
192
|
-
```json
|
|
193
|
-
{ "routerModel": "" }
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
A nonempty exact concrete `provider/model` selection wins. Choose `openrouter/~typesafe/jev-latest` explicitly to use Jev with your existing OpenRouter login or `OPENROUTER_API_KEY`, without TypeSafe credentials. Otherwise configured direct Jev credentials, saved through `/login typesafe-ai` or supplied by `TYPESAFE_API_KEY`, select `typesafe-ai/jev-latest`; without direct Jev credentials, Atomic uses the current chat model at invocation time. `"auto"`, unknown explicit selections, and malformed settings fail rather than silently selecting another provider. This setting selects only routing inference: it does not change the chat model, workflow stage models, or the `structured_output` tool. Configured credentials do not prove service access.
|
|
197
|
-
|
|
198
|
-
The router has one 30-second deadline. By default, each provider gets an initial attempt plus three corrective retries for malformed or schema-invalid answers. A valid decision stops repairs; a valid `none` is never rerouted. With an empty `routerModel`, oversized Jev context, a Jev HTTP or connection failure, or exhausted output repairs triggers a reported switch to the current chat model, which gets its own repair allowance within the remaining deadline. Explicit router selections remain pinned. Invalid inputs, cancellation, timeout and stale-catalog rejection do not trigger fallback. Neither repairs nor fallback can launch a duplicate workflow.
|
|
199
|
-
|
|
200
|
-
Jev asks independent questions about workflow fit, authorization, lifecycle benefit, the user's stated execution preference and duration. Code composes the answers: an explicit user request to work inline yields `none`, an explicit request for a workflow bypasses the lifecycle-benefit gate, and otherwise the fit, authorization and benefit judgments decide. Preference is judged from the user's own words in `state`, never supplied by the calling assistant. Atomic preserves exact user budgets in code rather than asking Jev to choose numbers. Workflow contracts appear only with their candidate, not as a second complete catalog repeated in every batch.
|
|
201
|
-
|
|
202
|
-
Catalogs above 255 choices, or verbose comparisons that exceed the context budget, use tournament requests. Every workflow participates, three candidates survive each batch, and finalists receive a shared comparison. `none` remains available in the final comparison even if eliminated earlier, so overflow never forces a launch.
|
|
203
|
-
|
|
204
|
-
Large catalogs and repairs can increase latency and usage, and grouping can affect selection. State is never trimmed, and no partial decision can launch a workflow. If task context or a comparison cannot fit, automatic routing reports a switch to chat; pinned Jev fails before sending an oversized request. Supply only relevant messages and document excerpts, preserving requirements and uncertainty. See [structured decision limits](/sdk/structured-decisions#provider-behavior-and-limits).
|
|
205
|
-
|
|
206
|
-
### Read the decision
|
|
207
|
-
|
|
208
|
-
Route results appear as structured JSON inside a `WORKFLOW ROUTE` box. They expose `workflowId`, `routerDecision`, and the named selection's actual `inputSchema` with defaults.
|
|
209
|
-
|
|
210
|
-
Read `routerDecision.workflowType` and `routerDecision.estimatedDuration`, not top-level fields. The nested decision also contains the preserved `maxBudget` override declaration; omitted budget fields inherit their limits at execution. Routing failures have no `routerDecision`; inspect the error instead.
|
|
211
|
-
|
|
212
|
-
Reservations are not executing runs and do not appear in run listings. They expire with the owning tool/session and invalidate when the registry or selected schema changes. Route again rather than reusing a stale ID.
|
|
213
|
-
|
|
214
|
-
Admitted instances retain caller/session ownership across tool recreation, reload, and restart. Model-tool inspection and control authorize the resolved target, including implicit active-run targets. Bulk controls reject mixed ownership before changing any run. Explicit user `/workflow` commands retain their direct-access exception.
|
|
215
|
-
|
|
216
|
-
Duration labels are quarter-hour increments from `15min` through `1d`, plus `>1d`. Report the labels directly, for example `1hr15min`. Positive estimates round up, including work under 15 minutes; exactly 24 elapsed hours is `1d`, anything greater is `>1d`. The router gives its best estimate from available context. Wall-clock estimates include overhead, critical path and estimable human waits, including inline work. Granularity does not imply accuracy; estimates are neither guarantees nor execution budgets.
|
|
217
|
-
|
|
218
|
-
| Decision | Result and next step |
|
|
219
|
-
| --- | --- |
|
|
220
|
-
| `workflowType: "none"` | `workflowId: ""`, `status: "not_launched"`. Continue inline; the task has not been completed. |
|
|
221
|
-
| Named selection | `status: "reserved"`, unique `workflowId`, actual `inputSchema`. Prepare inputs, then run that ID. |
|
|
222
|
-
| Missing/invalid run inputs | `status: "needs_input"`, same ID, exact `inputContract` and validation feedback. Correct inputs and retry without rerouting. |
|
|
223
|
-
| Successful run admission | The reserved ID becomes the run ID. Inspect/control that instance; duplicates cannot create another executor. |
|
|
224
|
-
|
|
225
|
-
Keep the same ID for status, inspection, pause/resume, pending-prompt answers and cancellation. Concurrent run/resume requests cannot own two executors. Resume preserves completed checkpoints. A terminal ID supports inspection, not relaunch; a new execution requires a new route. Different IDs may execute independently in parallel.
|
|
226
|
-
|
|
227
|
-
Routing, provider and launch failures remain errors, never `none` or successful execution. If a response is lost, inspect the reserved ID; retrying cannot launch a second instance.
|
|
228
|
-
|
|
229
|
-
`maxBudget` preserves exact explicit user limits, including zero and omitted fields, even when no workflow launches. An empty object means inherit for a selected workflow, not unlimited execution. No workflow budget is installed for inline work, but the user's limits and authorization still apply. Run does not accept top-level budget overrides; route again to change constraints. Estimates never authorize adding or expanding limits.
|
|
230
|
-
|
|
231
|
-
Missing context, invalid output after the repair allowance, unrecovered provider errors, timeout and cancellation are failures, not `none` decisions. They prevent launch and expose no fabricated `routerDecision`. Correct the reported problem and retry explicitly when authorized. Cancellation or a late response cannot start a workflow after the routing attempt ends. The separate two-minute workflow-tool request deadline still covers the whole request, including subsequent startup admission.
|
|
232
|
-
|
|
233
|
-
### Reload and authored workflows
|
|
234
|
-
|
|
235
|
-
Creating a workflow is an ordinary file-authoring operation. After a successful `/workflow reload` or `/reload`, its actual registered name becomes a routing candidate automatically. Removed and renamed workflows disappear; replacements use their new contracts. There is no special authoring category in router output.
|
|
236
|
-
|
|
237
|
-
If a reload changes the registry while a decision is pending, Atomic refuses the stale approval before launch, including a definition replaced under the same name. Inspect the current contract and retry with fresh state; Atomic does not make a second inference automatically. A fatal refresh failure retains the previous catalog and its matching routing choices/context. A workflow registered as `none` collides with the inline sentinel and blocks model-tool routing: rename it and reload. Explicit user `/workflow` commands remain available.
|
|
238
170
|
|
|
239
171
|
## Workflow Commands
|
|
240
172
|
|
|
@@ -572,7 +504,13 @@ Restart Atomic after upgrading to enable health supervision in a session whose d
|
|
|
572
504
|
|
|
573
505
|
Custom Windows launchers can still use executable names resolved through `PATH` or relative executable paths. `.cmd` and `.bat` launchers accept arguments on administrative accounts, including when the launcher path contains spaces. Explicit `cmd.exe` invocations retain their usual argument handling. Working directories with a `\\?\` prefix are supported when removing the prefix preserves the exact path; if `cmd.exe` reports an unsupported UNC working directory, use an ordinary local directory path. If startup reports that batch file arguments are invalid, remove carriage returns and line breaks from those arguments. If it reports that a string contains NUL characters, check the supplied paths, arguments, and environment entries. Remove the embedded NUL rather than retrying with a truncated value; no server is started for that request.
|
|
574
506
|
|
|
575
|
-
If embedded provisioning fails without leaving retained-process cleanup pending, Atomic tries DBOS's reusable `dbos-db` Docker container. If DBOS still cannot become ready, workflows **degrade to a process-local in-memory backend with a loud warning** instead of refusing to run: the run executes normally, but its state does not survive the process and `/workflow resume` after exit has nothing to restore. Fix the configured database or set `DBOS_SYSTEM_DATABASE_URL` to a working Postgres to restore durability.
|
|
507
|
+
If embedded provisioning fails without leaving retained-process cleanup pending, Atomic tries DBOS's reusable `dbos-db` Docker container. A published TCP port is not enough: Atomic waits until PostgreSQL on that container's selected endpoint answers a query before initializing DBOS. Transient startup resets and connection refusals are retried until that bounded wait expires. If DBOS still cannot become ready, workflows **degrade to a process-local in-memory backend with a loud warning** instead of refusing to run: the run executes normally, but its state does not survive the process and `/workflow resume` after exit has nothing to restore. Fix the configured database or set `DBOS_SYSTEM_DATABASE_URL` to a working Postgres to restore durability.
|
|
508
|
+
|
|
509
|
+
The Docker readiness query uses the same `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, and `PGSSLMODE` settings as DBOS. If startup reports an invalid `PGPORT`, supply an integer from 1 through 65535. Authentication, TLS, schema and statement-timeout failures are not retried as database startup delays; correct the reported configuration or database problem.
|
|
510
|
+
|
|
511
|
+
New Docker fallback containers publish PostgreSQL on `127.0.0.1` at `PGPORT`, or port 5432 when unset. Atomic does not change an existing container's port mapping. When reusing `dbos-db`, keep `PGPORT` consistent with its published port, or set `DBOS_SYSTEM_DATABASE_URL` to the intended database endpoint.
|
|
512
|
+
|
|
513
|
+
Fallback starts only after failed DBOS initialization has been cleaned up. If Atomic reports `Workflow backend cleanup failed`, workflow startup stops rather than starting another backend alongside an unconfirmed executor. Correct the reported shutdown problem and restart Atomic; do not delete database data to bypass it.
|
|
576
514
|
|
|
577
515
|
**Multiple concurrent Atomic sessions.** A workflow running in another process is not a resume target. Fresh-heartbeat rows are hidden from resume pickers and refused by direct resume. After a crash, the heartbeat becomes stale in about two minutes and inspection reports `crashed`. Concurrent attempts to resume the same run admit one executor; a stale request reports that the run changed.
|
|
578
516
|
|
|
@@ -638,7 +576,7 @@ Set `failureMode: "return"` when a failed check is expected data for a later rep
|
|
|
638
576
|
|
|
639
577
|
On resume, completed top-level `ctx.tool` nodes retain their graph identity and cached outcomes, including concurrent `Promise.all` fan-out. A `failureMode: "return"` checkpoint, success or `return_failure`, is reused rather than running the callback again. All continuation attempts use the same run identity and checkpoint history.
|
|
640
578
|
|
|
641
|
-
|
|
579
|
+
Resume must match the retained workflow/checkpoint contract; do not change tool names or arguments to replay completed side effects. Inspection-only throwing records are not success checkpoints, so unfinished calls may execute again. Topology mismatches fail closed before unmatched live work is admitted; retained prompt answers and the prior resumable snapshot remain available for a corrected retry. An effect without a saved checkpoint is not guaranteed exactly once.
|
|
642
580
|
|
|
643
581
|
Recoverable output is explicit data flow. Atomic does not add a failed tool outcome to a later stage prompt. The workflow author must place the needed fields in `prompt`, `previous`, an output, or an artifact. Each persisted error text field is best-effort secret-redacted with the workflow persistence rules and limited to 16 KiB of UTF-8; truncated fields keep the final bytes with a marker. Keep the database sensitive even with this filter.
|
|
644
582
|
|
|
@@ -852,15 +790,17 @@ Run `/workflow reload` after adding, editing, renaming, or deleting workflow mod
|
|
|
852
790
|
|
|
853
791
|
Reload is safe while workflows run: existing runs keep their starting definitions and controls, and new launches use the refreshed registry. A fatal refresh failure retains the previous registry. Top-level `/reload` also replaces extensions but preserves live runs in the same process. After a process exit, use explicit resume to replay checkpoints and retry only unfinished work.
|
|
854
792
|
|
|
793
|
+
`/new`, `/fork`, and `/resume` are different: they leave the current session, so they quit running workflows. When any are running, Atomic asks first ("Quit N running workflows and start a new session?"). Confirming quits each run immediately at its last checkpoint; declining, or a confirmation prompt that fails, cancels the command and the runs keep going. Without an interactive UI (RPC, or an extension that switches sessions), the switch proceeds and the runs are quit the same way. Resume a quit run later with `/workflow resume`.
|
|
794
|
+
|
|
855
795
|
The `/workflow` argument-completion popup reads that same live registry. Project, user, package-provided, and built-in workflow names therefore appear immediately after reload both after `/workflow ` and after `/workflow inputs `; restarting Atomic is not required.
|
|
856
796
|
|
|
857
797
|
A successful rescan may still contain per-resource diagnostics. Both reload surfaces show `CONFIG_INVALID`, `IMPORT_FAILED`, `INVALID_DEFINITION`, `PATH_NOT_FOUND`, and duplicate-name diagnostics instead of reporting bare success while silently skipping a resource. Valid sibling workflows remain available. Fix the reported source/path and reload again; no process restart is required.
|
|
858
798
|
|
|
859
799
|
## Run budgets
|
|
860
800
|
|
|
861
|
-
Set an optional `budget` on workflow extension config or an authored definition.
|
|
801
|
+
Set an optional `budget` on workflow extension config or an authored definition. Direct workflow `run` calls use the registered workflow's declared budget and an optional user-provided `budget` override. Approved `resume` calls may supply `budget`. Each field resolves independently: run override, then definition, then config default. Omission inherits; `0` disables only its dimension.
|
|
862
802
|
|
|
863
|
-
Budgets are operator-selected. Never invent a cap or convert an estimate into one.
|
|
803
|
+
Budgets are operator-selected. Never invent a cap or convert an estimate into one. Pass only the fields and values the user requested. Raising an exhausted budget requires approval.
|
|
864
804
|
|
|
865
805
|
```ts
|
|
866
806
|
export default workflow({
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Use this guide to turn an objective into an acyclic, evidence-producing workflow with explicit contracts, context boundaries, verification, and stop conditions. Read [Custom Workflow Authoring](/workflows/authoring) first if you have not built a workflow definition yet.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
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.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Preserve the user's actual words, uncertainty and preferences; do not turn discussion into an implementation objective. User-issued `/workflow` commands launch directly and authored `ctx.workflow(...)` remains internal composition. For workflow authoring, carry the [domain/environment verification and media evidence contract](/workflows/verification) into worker, reviewer and final handoff prompts.
|
|
8
8
|
|
|
9
9
|
## Choosing an Execution Shape
|
|
10
10
|
|
|
11
|
-
The following architecture pass applies only to deliberate definition authoring and composition
|
|
11
|
+
The following architecture pass applies only to deliberate definition authoring and composition. Authoring a definition adds a candidate, not a launch commitment.
|
|
12
12
|
|
|
13
|
-
> **Authored multi-item orchestration:** Enumerate requested implementation items and prove their dependencies. For deliberately composed execution, keep independent items in bounded concurrent top-level runs with explicit worktrees and root failure boundaries; preserve ordered composition only for real code, artifact, contract, decision, approval, or merged-result dependencies.
|
|
13
|
+
> **Authored multi-item orchestration:** Enumerate requested implementation items and prove their dependencies. For deliberately composed execution, keep independent items in bounded concurrent top-level runs with explicit worktrees and root failure boundaries; preserve ordered composition only for real code, artifact, contract, decision, approval, or merged-result dependencies.
|
|
14
14
|
|
|
15
15
|
The shapes, cheapest first:
|
|
16
16
|
|
|
@@ -79,11 +79,11 @@ node | prerequisites | duration range and source | shared resources | evidence n
|
|
|
79
79
|
- Start long CI/check waits when their candidate is ready and overlap independent review, documentation, or handoff preparation that neither mutates that candidate nor needs its check results. Use supported concurrency, keep workflow-owned CI launch/wait/result checks in durable `ctx.tool` nodes with finite timeouts and cancellation, and join required results before acceptance, merge, or publication. Background admission is not check completion.
|
|
80
80
|
- Record the checked commit or artifact identity. Later edits invalidate affected results, so rerun those checks for the new candidate. Never reuse a green check from an older commit as proof for a changed head. Do not alter repository protections, required checks, or concurrency limits to shorten the estimate.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
When you decide to run a workflow, give a brief wall-clock estimate from available project evidence such as CI timings, test history and prior workflow runs. Say which inputs are unknown. An estimate is not measured timing, a guarantee or a `budget` override. Preserve brainstorming and unclear interactive intent instead of inventing an objective or pre-announcing a workflow.
|
|
83
83
|
|
|
84
|
-
Proceed with inherited budget limits without asking the user to choose a budget before each launch; preserve existing budget limits and approval gates. When the user does state a limit, pass only the fields they named
|
|
84
|
+
Proceed with inherited budget limits without asking the user to choose a budget before each launch; preserve existing budget limits and approval gates. When the user does state a limit, pass only the fields they named as the `run` call's `budget`. Omission inherits the workflow declaration and config; zero disables only the specified field. Never convert an estimate into a cap.
|
|
85
85
|
|
|
86
|
-
For example, with hypothetical timings, 6 minutes of implementation followed by independent 12-minute CI and 4-minute read-only review branches, then a 1-minute handoff, has a 19-minute critical path, not a 23-minute sum. Queue delays, repairs, and human approval can extend that. Authored scheduling analysis must cite actual project evidence rather than reuse these illustrative numbers
|
|
86
|
+
For example, with hypothetical timings, 6 minutes of implementation followed by independent 12-minute CI and 4-minute read-only review branches, then a 1-minute handoff, has a 19-minute critical path, not a 23-minute sum. Queue delays, repairs, and human approval can extend that. Authored scheduling analysis must cite actual project evidence rather than reuse these illustrative numbers.
|
|
87
87
|
|
|
88
88
|
Revise the remaining-time estimate at lifecycle updates only when new evidence materially changes the path. Keep the normal heartbeat cadence and end-turn/no-polling rules. At completion, report actual elapsed time against the estimate and identify the main bottleneck to improve the next schedule. These are agent design/reporting instructions, not an automatic scheduler or ETA feature.
|
|
89
89
|
|
|
@@ -291,25 +291,15 @@ export default workflow({
|
|
|
291
291
|
|
|
292
292
|
The workflow binding creates or validates the reusable worktree before `run` starts. The first durable tool then creates or checks out the requested feature branch, so worktree setup's detached checkout never becomes the implementation branch. The item run owns branch setup → implementation → bounded review/repair → deterministic checks → push → PR creation. A failed review or check fails that item before push/PR.
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
For each item, inspect the workflow's inputs with `workflow({ action: "inputs", workflow: "<name>" })`, then prepare inputs and launch with `workflow({ action: "run", workflow: "<name>", inputs: {...} })`. Item runs are top-level and independent. Admit no third run until one ends to preserve the bound of 2. Explicit user `/workflow` commands remain available for deliberate exact-name launches.
|
|
295
295
|
|
|
296
296
|
```ts
|
|
297
|
-
workflow({ action: "
|
|
298
|
-
task: "Fix cache-key normalization for issue #2101 and create its PR after validation.",
|
|
299
|
-
constraints: ["Use ../atomic-issue-2101 and branch fix/2101-cache-key; at most two concurrent item runs."],
|
|
300
|
-
}})
|
|
301
|
-
// If the returned inputSchema declares these inputs:
|
|
302
|
-
workflow({ action: "run", workflowId: "returned-id-for-2101", inputs: {
|
|
297
|
+
workflow({ action: "run", workflow: "issue-to-pr", inputs: {
|
|
303
298
|
issue: "#2101 fix cache-key normalization",
|
|
304
299
|
git_worktree_dir: "../atomic-issue-2101", base_ref: "origin/main", pr_base: "main",
|
|
305
300
|
branch: "fix/2101-cache-key", checks: [["npm", "run", "test:unit", "--", "test/unit/cache-key.test.ts"]],
|
|
306
301
|
}})
|
|
307
|
-
|
|
308
|
-
workflow({ action: "route", state: {
|
|
309
|
-
task: "Correct CLI help output for issue #2102 and create its PR after validation.",
|
|
310
|
-
constraints: ["Use ../atomic-issue-2102 and branch fix/2102-cli-help; at most two concurrent item runs."],
|
|
311
|
-
}})
|
|
312
|
-
workflow({ action: "run", workflowId: "returned-id-for-2102", inputs: {
|
|
302
|
+
workflow({ action: "run", workflow: "issue-to-pr", inputs: {
|
|
313
303
|
issue: "#2102 correct CLI help output",
|
|
314
304
|
git_worktree_dir: "../atomic-issue-2102", base_ref: "origin/main", pr_base: "main",
|
|
315
305
|
branch: "fix/2102-cli-help", checks: [["npm", "run", "test:unit", "--", "test/unit/cli-help.test.ts"]],
|
|
@@ -342,16 +332,16 @@ The factory self-prompt is: **enumerate → inspect and classify dependencies
|
|
|
342
332
|
|
|
343
333
|
### Prompting the choice
|
|
344
334
|
|
|
345
|
-
Humans can
|
|
335
|
+
Humans can steer the agent's choice or deliberately request definition authoring:
|
|
346
336
|
|
|
347
|
-
- **Name the shape or installed workflow.**
|
|
337
|
+
- **Name the shape or installed workflow.** "Do this quickly", "do this inline", "use subagents to investigate", "run ralph", or "write a custom workflow for this" tell the agent how to run the work. The agent honors them.
|
|
348
338
|
- **State acceptance criteria.** Verbatim criteria make the objective provable and define reviewer and reducer contracts.
|
|
349
339
|
- **State the loop.** "Iterate until tests pass" or "review and fix until approved" defines a hard workflow stop condition.
|
|
350
340
|
- **State the evidence.** A QA video, test output, generated artifact, or reviewer sign-off tells the graph which gates it needs.
|
|
351
341
|
- **State the boundary.** "Work in a separate worktree", "do not create a PR", or "stop after implementation" separates implementation from final actions.
|
|
352
342
|
- **State the queue policy.** Say how to split, order, isolate, and bound queued items; otherwise Atomic runs the [dependency-triage and bounded-dispatch playbook](/workflows/reliable-design#task-queues-and-software-factories) before implementation. Ordinary list order and per-item "create a PR after" wording do not create a cross-item dependency.
|
|
353
343
|
|
|
354
|
-
Absent these controls,
|
|
344
|
+
Absent these controls, the agent decides workflow suitability and selection from the task and the user's words, without fabricating preferences.
|
|
355
345
|
|
|
356
346
|
## The Run Contract
|
|
357
347
|
|
|
@@ -450,12 +440,7 @@ The tags are plain text, so they work anywhere text becomes a stage prompt — y
|
|
|
450
440
|
**Run inputs.** Workflows inject their inputs into stage prompts, so anything you tag in an input is inherited by the stages that receive it:
|
|
451
441
|
|
|
452
442
|
```
|
|
453
|
-
workflow({ action: "
|
|
454
|
-
task: "Research and implement issue #2170. Do not touch the release pipeline.",
|
|
455
|
-
documents: [{ source: "issue #2170", content: issueBody }],
|
|
456
|
-
}})
|
|
457
|
-
// Inspect inputSchema before preparing these inputs:
|
|
458
|
-
workflow({ action: "run", workflowId: "returned-execution-id", inputs: {
|
|
443
|
+
workflow({ action: "run", workflow: "ralph", inputs: {
|
|
459
444
|
prompt: "<keepContext>\nResearch and implement issue #2170. Do not touch the release pipeline.\n</keepContext>\n\n" + issueBody,
|
|
460
445
|
acceptance_criteria: "<keepContext>\n1. ...\n2. ...\n</keepContext>",
|
|
461
446
|
}})
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Verify the behavior that changed, then give the reviewer enough evidence to understand the result. A small fix may need a focused test and a short explanation. An interactive change usually needs a real user scenario as well. A video is useful when it shows something a test log or screenshot cannot; it is not required for every PR.
|
|
4
4
|
|
|
5
|
-
For tool installation, automation techniques, platform permissions, and general work in applications, read [Computer use](/computer-use). That guide covers Herdr for terminals, agent-browser for browsers, and
|
|
5
|
+
For tool installation, automation techniques, platform permissions, and general work in applications, read [Computer use](/computer-use). That guide covers Herdr for terminals, agent-browser for browsers, and Cua Driver for desktop, simulator, and emulator CUA on macOS, Linux, and Windows. It also covers native accessibility and application tools when they are easier or more reliable.
|
|
6
6
|
|
|
7
7
|
<a id="select-the-verification-environment" />
|
|
8
8
|
|
|
@@ -13,8 +13,8 @@ Start with the project's existing tests, build, typecheck, and lint commands. Ad
|
|
|
13
13
|
| Changed behavior | Preferred mechanism | What to check |
|
|
14
14
|
| --- | --- | --- |
|
|
15
15
|
| Interactive terminal or TUI | **Herdr**, under its explicit-request and managed-pane requirements; tmux or native Windows psmux as fallbacks | Actual input, rendered output, navigation, resizing, and exit behavior relevant to the change. |
|
|
16
|
-
| Browser/frontend | **agent-browser
|
|
17
|
-
|
|
|
16
|
+
| Browser/frontend, Electron desktop app, Slack, or cloud browser | **agent-browser**, for the scope its skill covers; Cua Driver when agent-browser hits a limitation | The user flow and its visible result, with DOM or network assertions where useful. |
|
|
17
|
+
| Native desktop app, iOS simulator, or Android emulator | **Cua Driver**: the `cua-driver` CLI through the bundled skill when a model chooses actions, or the `@trycua/cua-driver` SDK inside `ctx.tool` when workflow code owns the scenario; supplemented by native/app APIs | The exact window's before/after accessibility state and screenshots, a checked postcondition, and the saved or exported result. |
|
|
18
18
|
| API, library, script, or other non-UI behavior | Existing test runner and shell commands | Inputs, outputs, error handling, and relevant build/type contracts. |
|
|
19
19
|
| Documentation | Documentation checks and example review | Links, navigation, command accuracy, and whether a reader can follow the instructions. |
|
|
20
20
|
|
|
@@ -72,11 +72,15 @@ See [terminal setup and capture commands](/computer-use#terminal-automation-with
|
|
|
72
72
|
|
|
73
73
|
### Desktop, simulator, and emulator changes
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Use Cua Driver in a dedicated graphical session, following [the desktop guide](/computer-use#desktop-automation-with-cua-driver). When a language model chooses each action, whether in an interactive session or in any workflow stage acting outside `ctx.tool`, load the bundled `cua-driver` skill and drive the exact window with one-shot `cua-driver call <tool>` commands, running every command with `CUA_DRIVER_RS_TELEMETRY_ENABLED=false`. When a custom workflow's TypeScript owns the scenario and its postcondition, run it with the `@trycua/cua-driver` SDK inside `ctx.tool` as shown in [workflow authoring](/workflows/authoring#desktop-verification-with-cua-driver-in-ctx-tool). Either way the loop is the same: snapshot the window with `get_window_state`, act through a snapshot-bound element token, take a fresh snapshot, and check a postcondition with a bounded poll deadline. Application APIs can still give the strongest assertion, for example checking a saved document through the app API after exercising the visible Save flow.
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Evidence is the structured window state plus screenshots, not a screenshot alone. Save each `get_window_state` JSON result and its `screenshot_out_file` image (before and after the action) to the artifacts directory, and state the postcondition that was checked. A `degraded` or `truncated` snapshot is a failed observation, not a reason to act.
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Capture the actual application or simulator. A browser recording is not desktop or iOS evidence. Cua Driver can interact with a visible simulator/emulator window, but does not directly control an arbitrary physical phone. Use supported native tooling where needed, and name the device or emulator actually exercised.
|
|
80
|
+
|
|
81
|
+
Missing readiness is a blocked finding, not a failure to work around. Before the first action the stage checks `cua-driver --version` (one bounded install attempt with upstream's one-line installer if it is missing, then `cua-driver telemetry disable`), `cua-driver status`, `cua-driver doctor`, and `cua-driver call list_apps`, plus `cua-driver permissions status` on macOS. A builtin Goal or Ralph stage reports a missing macOS Accessibility or Screen Recording grant, a non-interactive Windows session, no graphical Linux session, or a refused or failed install as `blocked`/`needs_human` with the exact remediation (for macOS: `cua-driver permissions grant`, toggle CuaDriver on under System Settings → Privacy & Security → Accessibility and Screen & System Audio Recording, then relaunch the daemon with `open -n -g -a CuaDriver --args serve`), and re-runs the readiness check when the run resumes. A custom workflow does the same from a preflight `ctx.tool` that calls `ctx.exit({ status: "blocked", reason })`. Unlike a builtin stage, a blocked author exit is terminal and not resumable: after the user grants the permission, start a new run, whose fresh preflight checks again rather than replaying a cached result.
|
|
82
|
+
|
|
83
|
+
Inspect saved files and exports rather than assuming a returned action means a completed operation. An action that times out before its response is `unknown`; resolve it with a fresh snapshot and the postcondition, never by replaying the action.
|
|
80
84
|
|
|
81
85
|
## Use evidence in a workflow
|
|
82
86
|
|
|
@@ -121,7 +125,7 @@ Give the reviewer a short summary before linking logs or media. For example, rep
|
|
|
121
125
|
- Limits: <checks/platforms not exercised>
|
|
122
126
|
```
|
|
123
127
|
|
|
124
|
-
Attach a screenshot for a visual state, a short recording for an interaction, or logs for command behavior. Include reproduction steps even when media is available. Label local-only paths as local; reviewers cannot open a file on your machine. CI artifact links are useful when readers have access, but note retention limits where relevant.
|
|
128
|
+
Attach a screenshot for a visual state, a short recording for an interaction, or logs for command behavior. When a run used Cua Driver, the evidence is the before/after `screenshot_out_file` PNGs from `get_window_state`, one pair per verified postcondition, with the window-state JSON kept locally and cited by name; when it used agent-browser, the evidence is its `screenshot` PNGs and `record` recordings. Put them in the PR body next to the scenario they prove. Include reproduction steps even when media is available. Label local-only paths as local; reviewers cannot open a file on your machine. CI artifact links are useful when readers have access, but note retention limits where relevant.
|
|
125
129
|
|
|
126
130
|
Only upload to an authorized repository or destination. Inspect and redact secrets, personal information, private source content, and unrelated windows before attaching files. Permission to collect local evidence is not permission to publish it.
|
|
127
131
|
|
|
@@ -129,7 +133,16 @@ Only upload to an authorized repository or destination. Inspect and redact secre
|
|
|
129
133
|
|
|
130
134
|
[GitHub CLI 2.99.0 and newer](https://github.blog/changelog/2026-09-01-github-cli-media-in-issues-pull-requests-and-comments/) supports repeatable `--attach` on issue and PR `create`, `edit`, and `comment` commands. Check `gh --version`, the specific command's `--help`, and the host's [attachment support and limits](https://docs.github.com/en/github-cli/github-cli/attaching-files-with-github-cli).
|
|
131
135
|
|
|
132
|
-
|
|
136
|
+
Attach evidence when the PR is created so the body carries it from the first review; replace the file paths:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
gh pr create --title "Fix settings save" --body-file body.md \
|
|
140
|
+
--attach 'before.png#Settings panel before saving' \
|
|
141
|
+
--attach 'after.png#Settings panel after saving' \
|
|
142
|
+
--attach flow.webm
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
For evidence produced after the PR exists, use `gh pr edit` or an authorized PR comment the same way:
|
|
133
146
|
|
|
134
147
|
```sh
|
|
135
148
|
gh pr comment 123 --repo owner/repo --body-file evidence.md \
|