@bastani/atomic 0.9.20-alpha.2 → 0.9.20-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +148 -0
- package/README.md +15 -7
- package/dist/builtin/intercom/CHANGELOG.md +18 -0
- package/dist/builtin/intercom/README.md +2 -2
- package/dist/builtin/intercom/broker/send-handler.ts +59 -2
- package/dist/builtin/intercom/index.bundle.mjs +101 -16
- package/dist/builtin/intercom/package.json +3 -3
- package/dist/builtin/intercom/session-target.ts +34 -9
- package/dist/builtin/intercom/skills/intercom/SKILL.md +4 -4
- package/dist/builtin/mcp/CHANGELOG.md +13 -0
- package/dist/builtin/mcp/OAUTH.md +1 -1
- package/dist/builtin/mcp/README.md +3 -1
- package/dist/builtin/mcp/index.bundle.mjs +412 -64
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +27 -0
- package/dist/builtin/subagents/README.md +2 -2
- package/dist/builtin/subagents/agents/code-simplifier.md +2 -3
- package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -3
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -3
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -3
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -3
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -3
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -3
- package/dist/builtin/subagents/agents/debugger.md +1 -2
- package/dist/builtin/subagents/agents/worker.md +1 -2
- package/dist/builtin/subagents/package.json +4 -8
- package/dist/builtin/subagents/skills/subagent/SKILL.md +15 -13
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +249 -63
- package/dist/builtin/web-access/CHANGELOG.md +18 -0
- package/dist/builtin/web-access/index.bundle.mjs +372 -300
- package/dist/builtin/web-access/package.json +3 -3
- package/dist/builtin/workflows/CHANGELOG.md +68 -0
- package/dist/builtin/workflows/README.md +29 -30
- package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
- package/dist/builtin/workflows/builtin/{chunk-yeee2jrc.js → chunk-119kxb28.js} +5 -46
- package/dist/builtin/workflows/builtin/chunk-1dydq7w3.js +9722 -0
- package/dist/builtin/workflows/builtin/{chunk-31j2gs7h.js → chunk-9y0f90rd.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-z29qbehr.js → chunk-d1xqh1rd.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-zqtm1d2c.js → chunk-hnbbb5r0.js} +12 -217
- package/dist/builtin/workflows/builtin/{chunk-wf741bv3.js → chunk-k18g9me8.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-g0csgs7w.js → chunk-kf5xpbkz.js} +8 -10
- package/dist/builtin/workflows/builtin/{chunk-a2kdsqn8.js → chunk-n4yxrsm9.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-xtxcq5tj.js → chunk-n8g2da69.js} +17 -1
- package/dist/builtin/workflows/builtin/{chunk-fg9esgkj.js → chunk-scgprmdj.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-6w6cvk6b.js → chunk-sn5mchnx.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-ewkkkbak.js → chunk-vt9zgr9d.js} +9 -91
- 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 +3 -3
- package/dist/builtin/workflows/src/authoring.d.ts +2 -0
- package/dist/builtin/workflows/src/durable/dependency-doctor-types.d.ts +42 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +82110 -78759
- package/dist/builtin/workflows/src/index.js +8900 -1200
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +11 -0
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +4 -1
- package/dist/bun/split-loader.js +13 -0
- package/dist/bun/split-loader.js.map +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-accessors.d.ts.map +1 -1
- package/dist/core/agent-session-accessors.js +2 -1
- package/dist/core/agent-session-accessors.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +9 -2
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +3 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +18 -6
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +37 -14
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts +6 -6
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +145 -62
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +18 -19
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +3 -2
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +274 -70
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +30 -4
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +19 -11
- 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-models.d.ts +2 -2
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +38 -29
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts +1 -1
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +18 -1
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +104 -22
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts +2 -0
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +13 -2
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts +0 -3
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +24 -11
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.d.ts.map +1 -1
- package/dist/core/agent-session-runtime-auth.js +10 -0
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +17 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +428 -197
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +4 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +31 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +10 -2
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +32 -22
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-summary.d.ts.map +1 -1
- package/dist/core/agent-session-summary.js +9 -2
- package/dist/core/agent-session-summary.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +1 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -1
- package/dist/core/agent-session-tasks.js +24 -3
- 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 +26 -3
- 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 +0 -2
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +6 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -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 +15 -8
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +113 -66
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -3
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +18 -5
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/builtin-diagnostics.d.ts +2 -0
- package/dist/core/builtin-diagnostics.d.ts.map +1 -0
- package/dist/core/builtin-diagnostics.js +14 -0
- package/dist/core/builtin-diagnostics.js.map +1 -0
- package/dist/core/builtin-packages.d.ts +5 -2
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +24 -3
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/builtin-resource-loader.d.ts +4 -0
- package/dist/core/builtin-resource-loader.d.ts.map +1 -0
- package/dist/core/builtin-resource-loader.js +239 -0
- package/dist/core/builtin-resource-loader.js.map +1 -0
- package/dist/core/cache-retention.d.ts +4 -0
- package/dist/core/cache-retention.d.ts.map +1 -0
- package/dist/core/cache-retention.js +58 -0
- package/dist/core/cache-retention.js.map +1 -0
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +11 -0
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +66 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +313 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/child-session-options.d.ts +5 -0
- package/dist/core/child-session-options.d.ts.map +1 -0
- package/dist/core/child-session-options.js +30 -0
- package/dist/core/child-session-options.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts +29 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +37 -4
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +18 -5
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +7 -0
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +18 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/fallback-planner.d.ts +1 -0
- package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
- package/dist/core/compaction/fallback-planner.js +2 -0
- package/dist/core/compaction/fallback-planner.js.map +1 -1
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +3 -3
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/session-summarization.d.ts.map +1 -1
- package/dist/core/compaction/session-summarization.js +2 -1
- package/dist/core/compaction/session-summarization.js.map +1 -1
- package/dist/core/compaction/whole-context-stats.d.ts +21 -0
- package/dist/core/compaction/whole-context-stats.d.ts.map +1 -0
- package/dist/core/compaction/whole-context-stats.js +32 -0
- package/dist/core/compaction/whole-context-stats.js.map +1 -0
- package/dist/core/credential-screening.d.ts +17 -0
- package/dist/core/credential-screening.d.ts.map +1 -0
- package/dist/core/credential-screening.js +30 -0
- package/dist/core/credential-screening.js.map +1 -0
- package/dist/core/decision-provider.d.ts +4 -0
- package/dist/core/decision-provider.d.ts.map +1 -0
- package/dist/core/decision-provider.js +12 -0
- package/dist/core/decision-provider.js.map +1 -0
- package/dist/core/execution-model-router.d.ts +28 -0
- package/dist/core/execution-model-router.d.ts.map +1 -0
- package/dist/core/execution-model-router.js +165 -0
- package/dist/core/execution-model-router.js.map +1 -0
- package/dist/core/extensions/agent-events.d.ts +4 -4
- 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 +46 -40
- 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/context-types.d.ts +7 -1
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/event-results.d.ts +7 -6
- 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 -1
- 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/extension-work.d.ts +14 -0
- package/dist/core/extensions/extension-work.d.ts.map +1 -0
- package/dist/core/extensions/extension-work.js +73 -0
- package/dist/core/extensions/extension-work.js.map +1 -0
- package/dist/core/extensions/herdr-file-integration.d.ts +36 -0
- package/dist/core/extensions/herdr-file-integration.d.ts.map +1 -0
- package/dist/core/extensions/herdr-file-integration.js +60 -0
- package/dist/core/extensions/herdr-file-integration.js.map +1 -0
- package/dist/core/extensions/host-input.d.ts +51 -0
- package/dist/core/extensions/host-input.d.ts.map +1 -0
- package/dist/core/extensions/host-input.js +211 -0
- package/dist/core/extensions/host-input.js.map +1 -0
- package/dist/core/extensions/index.d.ts +4 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +0 -3
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +3 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +3 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader-api.d.ts +7 -0
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +154 -28
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-bindings.d.ts +24 -0
- package/dist/core/extensions/loader-bindings.d.ts.map +1 -0
- package/dist/core/extensions/loader-bindings.js +128 -0
- package/dist/core/extensions/loader-bindings.js.map +1 -0
- package/dist/core/extensions/loader-core.d.ts +2 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +91 -14
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +3 -1
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/loader-rollback.d.ts +14 -0
- package/dist/core/extensions/loader-rollback.d.ts.map +1 -0
- package/dist/core/extensions/loader-rollback.js +95 -0
- package/dist/core/extensions/loader-rollback.js.map +1 -0
- package/dist/core/extensions/loader-runtime.d.ts +3 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +38 -14
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +9 -2
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/reactive-widget.d.ts +1 -1
- package/dist/core/extensions/reactive-widget.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +4 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +25 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts +8 -4
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js +55 -53
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner-project-trust.d.ts.map +1 -1
- package/dist/core/extensions/runner-project-trust.js +2 -4
- package/dist/core/extensions/runner-project-trust.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +31 -4
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +219 -23
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +2 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +0 -12
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/workflow-activity-hub.d.ts +2 -0
- package/dist/core/extensions/workflow-activity-hub.d.ts.map +1 -1
- package/dist/core/extensions/workflow-activity-hub.js +5 -3
- package/dist/core/extensions/workflow-activity-hub.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +5 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/fast-model-routing.d.ts +3 -3
- package/dist/core/fast-model-routing.d.ts.map +1 -1
- package/dist/core/fast-model-routing.js +3 -3
- package/dist/core/fast-model-routing.js.map +1 -1
- package/dist/core/fast-model-variants.d.ts +4 -0
- package/dist/core/fast-model-variants.d.ts.map +1 -1
- package/dist/core/fast-model-variants.js +3 -0
- package/dist/core/fast-model-variants.js.map +1 -1
- package/dist/core/index.d.ts +4 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/mandatory-resource-loader.d.ts +4 -0
- package/dist/core/mandatory-resource-loader.d.ts.map +1 -1
- package/dist/core/mandatory-resource-loader.js +29 -1
- package/dist/core/mandatory-resource-loader.js.map +1 -1
- package/dist/core/mandatory-runtime-tools.d.ts +1 -4
- package/dist/core/mandatory-runtime-tools.d.ts.map +1 -1
- package/dist/core/mandatory-runtime-tools.js +1 -9
- package/dist/core/mandatory-runtime-tools.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +19 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +126 -10
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +32 -19
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +4 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +6 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-routing-constraints.d.ts +24 -0
- package/dist/core/model-routing-constraints.d.ts.map +1 -0
- package/dist/core/model-routing-constraints.js +46 -0
- package/dist/core/model-routing-constraints.js.map +1 -0
- package/dist/core/model-routing-task.d.ts +4 -0
- package/dist/core/model-routing-task.d.ts.map +1 -0
- package/dist/core/model-routing-task.js +76 -0
- package/dist/core/model-routing-task.js.map +1 -0
- package/dist/core/model-runtime-streaming.d.ts +13 -3
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +15 -5
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime-types.d.ts +2 -2
- package/dist/core/model-runtime-types.d.ts.map +1 -1
- package/dist/core/model-runtime-types.js.map +1 -1
- package/dist/core/model-runtime.d.ts +6 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +29 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +3 -2
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +2 -0
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +2 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +23 -1
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +6 -0
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +37 -6
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.js +2 -0
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +7 -2
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader.d.ts +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +2 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +15 -0
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk-types.d.ts +13 -5
- 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 +3 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +211 -37
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-lifecycle-scope.d.ts +15 -0
- package/dist/core/session-lifecycle-scope.d.ts.map +1 -0
- package/dist/core/session-lifecycle-scope.js +13 -0
- package/dist/core/session-lifecycle-scope.js.map +1 -0
- package/dist/core/session-lifecycle-work.d.ts +17 -0
- package/dist/core/session-lifecycle-work.d.ts.map +1 -0
- package/dist/core/session-lifecycle-work.js +144 -0
- package/dist/core/session-lifecycle-work.js.map +1 -0
- package/dist/core/session-manager-core.d.ts +10 -4
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +53 -6
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +3 -0
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-list.d.ts +3 -3
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +89 -74
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +10 -7
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +13 -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 +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-startup-rollback.d.ts +5 -0
- package/dist/core/session-startup-rollback.d.ts.map +1 -0
- package/dist/core/session-startup-rollback.js +16 -0
- package/dist/core/session-startup-rollback.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts +5 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +35 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +4 -0
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +1 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +4 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/settings-write-ownership.d.ts +7 -0
- package/dist/core/settings-write-ownership.d.ts.map +1 -0
- package/dist/core/settings-write-ownership.js +24 -0
- package/dist/core/settings-write-ownership.js.map +1 -0
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/structured-output/index.d.ts +12 -0
- package/dist/core/structured-output/index.d.ts.map +1 -0
- package/dist/core/structured-output/index.js +251 -0
- package/dist/core/structured-output/index.js.map +1 -0
- package/dist/core/structured-output/invalid-output.d.ts +8 -0
- package/dist/core/structured-output/invalid-output.d.ts.map +1 -0
- package/dist/core/structured-output/invalid-output.js +4 -0
- package/dist/core/structured-output/invalid-output.js.map +1 -0
- package/dist/core/structured-output/jev-client.d.ts +20 -0
- package/dist/core/structured-output/jev-client.d.ts.map +1 -0
- package/dist/core/structured-output/jev-client.js +116 -0
- package/dist/core/structured-output/jev-client.js.map +1 -0
- package/dist/core/structured-output/jev.d.ts +5 -0
- package/dist/core/structured-output/jev.d.ts.map +1 -0
- package/dist/core/structured-output/jev.js +275 -0
- package/dist/core/structured-output/jev.js.map +1 -0
- package/dist/core/structured-output/resolver.d.ts +41 -0
- package/dist/core/structured-output/resolver.d.ts.map +1 -0
- package/dist/core/structured-output/resolver.js +56 -0
- package/dist/core/structured-output/resolver.js.map +1 -0
- package/dist/core/structured-output/types.d.ts +68 -0
- package/dist/core/structured-output/types.d.ts.map +1 -0
- package/dist/core/structured-output/types.js +2 -0
- package/dist/core/structured-output/types.js.map +1 -0
- package/dist/core/system-prompt.d.ts +48 -5
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +130 -99
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/contracts.d.ts +6 -0
- package/dist/core/tasks/contracts.d.ts.map +1 -1
- package/dist/core/tasks/contracts.js.map +1 -1
- package/dist/core/tasks/supervisor.d.ts.map +1 -1
- package/dist/core/tasks/supervisor.js +7 -0
- package/dist/core/tasks/supervisor.js.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts +4 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js +31 -35
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/ask-user-question/index.d.ts +1 -1
- package/dist/core/tools/ask-user-question/index.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/key-router.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/key-router.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/derivations.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/derivations.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/state.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/validate-questionnaire.d.ts +1 -1
- package/dist/core/tools/ask-user-question/tool/validate-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +16 -11
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +4 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +0 -7
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +6 -2
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +18 -4
- package/dist/extensions/llama/provider.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 +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +24 -16
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -5
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -5
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +5 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts +2 -2
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +30 -12
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +6 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +17 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.d.ts +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form.d.ts +1 -1
- package/dist/modes/interactive/components/host-input-form.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.d.ts +1 -1
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.d.ts +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.js.map +1 -1
- package/dist/modes/interactive/components/scroll-widget.d.ts +1 -1
- package/dist/modes/interactive/components/scroll-widget.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
- package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +50 -1
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js +2 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +6 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +14 -9
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +1 -1
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +2 -2
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +4 -0
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +13 -6
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +5 -0
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +2 -2
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +27 -25
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +10 -0
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +2 -2
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +3 -6
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +13 -5
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +3 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-input-form.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-input-form.js.map +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +10 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +1 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.d.ts +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/session-id-target.d.ts +31 -0
- package/dist/session-id-target.d.ts.map +1 -0
- package/dist/session-id-target.js +57 -0
- package/dist/session-id-target.js.map +1 -0
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js +29 -4
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -12
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +88 -12
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/docs/background-tasks.md +24 -14
- package/docs/build.md +6 -16
- package/docs/compaction/reference.md +12 -12
- package/docs/compaction.md +30 -110
- package/docs/computer-use.md +1 -3
- package/docs/containerization.md +4 -5
- package/docs/custom-provider/api-reference.md +10 -1
- package/docs/custom-provider/oauth.md +4 -2
- package/docs/custom-provider/streaming.md +8 -3
- package/docs/custom-provider.md +1 -1
- package/docs/development.md +13 -138
- package/docs/docs.json +19 -5
- package/docs/environment-variables.md +20 -4
- package/docs/extensions/api-reference.md +6 -2
- package/docs/extensions/authoring.md +10 -7
- package/docs/extensions/events.md +14 -24
- package/docs/extensions/ui.md +3 -4
- package/docs/extensions.md +22 -18
- package/docs/getting-started/authentication.md +4 -1
- package/docs/getting-started/first-session.md +8 -6
- package/docs/getting-started/installation.md +8 -4
- package/docs/getting-started/project-instructions.md +5 -1
- package/docs/guides/configuration.md +10 -5
- package/docs/guides/non-interactive.md +2 -2
- package/docs/guides.md +8 -17
- package/docs/herdr.md +2 -1
- package/docs/index.md +2 -2
- package/docs/intercom/operations.md +16 -70
- package/docs/intercom/reference.md +15 -5
- package/docs/intercom.md +10 -6
- package/docs/json.md +12 -2
- package/docs/keybindings.md +15 -8
- package/docs/llama-cpp.md +5 -1
- package/docs/{mcp.md → mcp-servers.md} +21 -2
- package/docs/models/evals.md +133 -465
- package/docs/models/model-selection.md +27 -116
- package/docs/models/reference.md +39 -21
- package/docs/models.md +7 -4
- package/docs/packages/authoring.md +5 -1
- package/docs/packages/reference.md +5 -1
- package/docs/packages.md +5 -3
- package/docs/programmatic.md +3 -1
- package/docs/prompt-templates.md +2 -10
- package/docs/providers/reference.md +2 -2
- package/docs/providers.md +41 -16
- package/docs/quickstart.md +7 -3
- package/docs/reference/cli.md +19 -11
- package/docs/reference.md +3 -6
- package/docs/rpc/protocol.md +11 -13
- package/docs/rpc.md +5 -1
- package/docs/sdk/reference.md +59 -239
- package/docs/sdk/structured-decisions.md +132 -0
- package/docs/sdk.md +181 -17
- package/docs/security.md +7 -4
- package/docs/session-format.md +18 -5
- package/docs/sessions.md +12 -6
- package/docs/settings.md +68 -16
- package/docs/skills/authoring.md +7 -1
- package/docs/skills.md +25 -6
- package/docs/subagents/authoring.md +11 -1
- package/docs/subagents/reference.md +98 -10
- package/docs/subagents.md +45 -35
- package/docs/terminal-setup.md +4 -2
- package/docs/termux.md +3 -1
- package/docs/themes/reference.md +4 -1
- package/docs/themes.md +1 -1
- package/docs/tools.md +431 -20
- package/docs/tui/reference.md +13 -14
- package/docs/tui.md +10 -6
- package/docs/usage.md +19 -7
- package/docs/web-access.md +5 -1
- package/docs/windows.md +18 -11
- package/docs/workflows/api-reference.md +135 -25
- package/docs/workflows/authoring.md +48 -39
- package/docs/workflows/builtins.md +20 -26
- package/docs/workflows/operations.md +288 -137
- package/docs/workflows/reliable-design.md +62 -129
- package/docs/workflows.md +10 -16
- package/examples/extensions/custom-provider-anthropic/index.ts +15 -10
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/examples/extensions/prompt-customizer.ts +17 -37
- package/npm-shrinkwrap.json +502 -709
- package/package.json +12 -10
- package/dist/builtin/workflows/builtin/chunk-m0xfsef8.js +0 -2813
- package/docs/models/artificial-analysis-index.md +0 -89
- package/docs/models/pareto-efficiency.md +0 -90
- package/docs/tools/edit.md +0 -378
|
@@ -2,13 +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
|
+
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.
|
|
6
|
+
|
|
7
|
+
The router owns all semantic selection. Preserve the user's actual words, uncertainty and preferences in neutral state; 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.
|
|
6
8
|
|
|
7
9
|
## Choosing an Execution Shape
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
The following architecture pass applies only to deliberate definition authoring and composition, not to model-tool selection. Authoring a definition adds a candidate, not a launch commitment. `run` uses the registered selection and explicit inputs without routing again; do not resend routing state.
|
|
10
12
|
|
|
11
|
-
> **
|
|
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. This does not preselect model-tool routing outcomes.
|
|
12
14
|
|
|
13
15
|
The shapes, cheapest first:
|
|
14
16
|
|
|
@@ -22,7 +24,7 @@ The shapes, cheapest first:
|
|
|
22
24
|
|
|
23
25
|
### The self-prompt: pre-launch workflow architecture
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
When deliberately authoring a workflow definition, perform a short workflow-architecture pass before implementing its graph. Derive the task's implementation lifecycle needs, whole-codebase research needs, independent work slices, competing strategies, exact API/type/build contracts, schema or generated-artifact contracts, state-transition/lifecycle behavior, deterministic stop conditions, and required evidence. Do not run this pass as a caller-side selection procedure for model-tool launches.
|
|
26
28
|
|
|
27
29
|
For coding tasks, that pass also infers repository intent from repo-level behavior before objectives and acceptance criteria freeze: mine git history (including `git log --show-signature`), merged PRs, issues, commits, and review comments for unwritten conventions — commit signing, message style and issue linking, changelog discipline, PR size and review norms — weighing the requesting user's own activity highest so the authored contract captures norms no doc states. Non-coding tasks mine their analogous available context sources (issue trackers, long-form docs, chat or comment threads, prior artifacts) the same way. Inferred conventions fill contract gaps; they never override the stated objective or explicit repository docs.
|
|
28
30
|
|
|
@@ -51,21 +53,14 @@ Sketch expected nodes and dependencies for each branch, loop, and nested boundar
|
|
|
51
53
|
|
|
52
54
|
Compare candidate workflow **guarantees**, not only broad descriptions. A named graph fits only when it covers the task's lifecycle **and** produces the evidence required for every material requirement/risk. A generic implementation workflow can cover the lifecycle while missing exact API/type/build contracts, schemas/generated artifacts, state transitions, or domain-specific gates. **Do not treat "has reviewers" as proof that a task-specific risk is covered.**
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
For deliberate definition design, check coverage and reuse:
|
|
55
57
|
|
|
56
|
-
1. **
|
|
57
|
-
2. **
|
|
58
|
-
3. **Is there a loop or gate?** Any "until Y", "fix until passing", review/approval gate, or unknown-length repair cycle requires a workflow that enforces the stop condition, never an improvised inline retry loop or an overextended subagent call.
|
|
59
|
-
4. **Is it one task or a queue of tasks?** "Address all open issues" or "fix every ticket assigned to me" is a factory request, not one workflow. Enumerate and dependency-classify the items first, then follow [Task queues and software factories](#task-queues-and-software-factories): independent items become bounded concurrent top-level per-item runs; dependent items share one ordered composed graph; independent dependency clusters become separate top-level runs.
|
|
60
|
-
5. **Does an installed graph supply complete coverage?** Run a named workflow only if its objective, inputs, lifecycle, and produced evidence cover every material row. Do not force-fit a broad-but-partial match ([When to Use Workflows](/workflows#when-to-use-workflows)).
|
|
61
|
-
6. **What routing signals shape the graph?** Broad repository uncertainty points to repository-focused Fan-out-and-synthesize; independent slices to Fan-out-and-synthesize; plausible-but-wrong contract risk to Adversarial verification or a task-specific verification stage; competing architectures or implementations to Generate-and-filter or Tournament; an explicit repeat-until condition to Loop until done; implementation work to a task-specific worker/reviewer loop; and exact API/build/schema requirements to dedicated deterministic gates.
|
|
62
|
-
7. **Does a tested graph solve only part of the task?** Author one custom parent and nest that definition with `ctx.workflow(...)`, placing the missing research, verification, or deterministic gates around it instead of copying its prompts and gates.
|
|
63
|
-
8. **Is it only specialist evidence-gathering?** If the parent keeps control, no completion gate is needed, and the work is bounded (a debug pass, a parallel research fanout, one noisy investigation), inline subagents are enough—and cheaper than a workflow.
|
|
64
|
-
9. **Is it truly tiny?** Deterministic, low-risk, single-file/no-test/no-review—answer or edit inline and stop.
|
|
58
|
+
1. **Does an installed graph supply complete coverage?** Compare its objective, inputs, lifecycle, and produced evidence against every material row.
|
|
59
|
+
2. **Does a tested graph solve only part of the task?** Author one custom parent and nest that definition with `ctx.workflow(...)`, placing the missing research, verification, or deterministic gates around it instead of copying its prompts and gates.
|
|
65
60
|
|
|
66
61
|
A first named workflow launch commits the selected execution shape for the turn. For one task, end the turn after that launch. For an independent queue, the selected shape is a bounded launch wave: issue every planned per-item top-level launch up to the concurrency bound before ending the turn. Do not casually chain unplanned unrelated top-level workflow launches. When one task needs multiple workflow capabilities or dependent items need ordered handoffs, design composition **before** launch: author one custom parent, import project/package definitions or builtins from `@bastani/atomic/workflows/builtin`, and call `ctx.workflow(...)`. Nested children preserve their stages and guarantees within the expanded graph up to `maxDepth`, but they remain under the parent's root lifecycle and failure boundary.
|
|
67
62
|
|
|
68
|
-
Choose the cheapest complete graph
|
|
63
|
+
Choose the cheapest complete graph when authoring; avoid decorative stages and duplicated research and review loops. For an authored graph, document why one broad builtin is sufficient or insufficient, the evidence each major stage produces, and the stop/repair conditions. This describes the definition, not a prediction that it will run: announce model-tool selection and duration only after the router returns.
|
|
69
64
|
|
|
70
65
|
### Runtime-aware scheduling and estimates
|
|
71
66
|
|
|
@@ -84,11 +79,11 @@ node | prerequisites | duration range and source | shared resources | evidence n
|
|
|
84
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.
|
|
85
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.
|
|
86
81
|
|
|
87
|
-
|
|
82
|
+
For model-tool launches, report the workflow choice and `estimatedDuration` only after the router returns. The router estimates a wall-clock range from task and catalog context; it is not measured timing, a guarantee or a `budget` override. Preserve brainstorming and unclear interactive intent in neutral state instead of inventing an objective or pre-announcing a workflow.
|
|
88
83
|
|
|
89
|
-
Proceed with inherited budget limits without asking the user to choose a budget before each launch; preserve existing budget limits and approval gates.
|
|
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 in `route`'s `state.userBudget` with exact provenance. Omission inherits the workflow declaration and config; zero disables only the specified field. `run` uses those registered constraints, not a new budget choice. Never convert an estimate into a cap.
|
|
90
85
|
|
|
91
|
-
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.
|
|
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; it does not replace the model-tool router's `estimatedDuration`.
|
|
92
87
|
|
|
93
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.
|
|
94
89
|
|
|
@@ -100,7 +95,9 @@ Workflow-authored `ctx.ui` gates remain supported. `workflow answer` relays an a
|
|
|
100
95
|
|
|
101
96
|
### Stage model and thinking-level assignment
|
|
102
97
|
|
|
103
|
-
|
|
98
|
+
When a user delegates the best-stage-model choice, author `model: "auto"` on each stage or shared chain/parallel options. Runtime routing uses the actual prompt after input interpolation and supplied context. Report model and effort as pending until selected. Preserve explicit concrete model, effort, and constraint requests. The following manual assignment guidance applies only when deliberately selecting concrete models.
|
|
99
|
+
|
|
100
|
+
Before launching an authored workflow, assign every model stage a **role**, **failure cost**, **primary model**, **thinking level**, and **fallback policy**. Read [Model Selection](/models/model-selection) for the general role defaults and [Evals](/models/evals) for factual per-evaluation benchmark records, but treat thinking levels in benchmark rows as measurement configurations, not production defaults. Use `low` or `medium` for implementation and routine fixes, and `high` or `xhigh` for code review, test design, failure analysis, and approval decisions when supported. Use `high` for demanding mapping, lifecycle analysis, compatibility, planning, synthesis, and triage, and `medium` for user-impact review and final reporting. `max` is an exception justified by task-specific evidence or an explicit user request, not a role default. Keep deterministic checks as tool nodes with no model call.
|
|
104
101
|
|
|
105
102
|
Print this compact assignment before launch, with a short cost/quality rationale for each model stage:
|
|
106
103
|
|
|
@@ -123,59 +120,6 @@ When an arbitrary task-specific workflow has plausible-but-wrong contract risk,
|
|
|
123
120
|
|
|
124
121
|
Use `ctx.tool` for workflow-owned external checks and side effects that benefit from durable checkpointing. Leave pure transformations as ordinary TypeScript; do not wrap every model-stage action in a tool call. A custom-loop pre-launch declaration must name the skeptical reviewer, deterministic verifier gates, how model-selected plans become tool executions, how evidence reaches evaluation/repair, and the bounded success/failure condition.
|
|
125
122
|
|
|
126
|
-
### Judging task complexity
|
|
127
|
-
|
|
128
|
-
Complexity is a property of risk, not effort. Score a task on five axes and let the **worst axis dominate** — complexity is not the sum:
|
|
129
|
-
|
|
130
|
-
| Axis | Low | High |
|
|
131
|
-
|---|---|---|
|
|
132
|
-
| **Blast radius** | one file, one function | crosses module/package boundaries; touches shared contracts (APIs, schemas, migrations) |
|
|
133
|
-
| **Uncertainty** | the exact edit is known before opening the file | the location or cause of the behavior is unknown |
|
|
134
|
-
| **Verifiability cost** | type-checker or a glance confirms it | multi-step validation: build + tests + runtime behavior + artifact checks |
|
|
135
|
-
| **Dependency structure** | independent steps | ordered handoffs where an early mistake propagates |
|
|
136
|
-
| **Failure cost** | reversible edit | wire formats, published APIs, data migrations, releases |
|
|
137
|
-
|
|
138
|
-
A one-line change to a serialization format is complex (high failure cost, exact contract). A 500-line mechanical rename is simple (zero uncertainty, type-checker-verified). The common trap is judging by effort instead of risk: long-but-mechanical is simple; short-but-contractual is not.
|
|
139
|
-
|
|
140
|
-
Fast tells, usable in the first 30 seconds:
|
|
141
|
-
|
|
142
|
-
- **Done-condition test:** if the success condition does not fit in one sentence, the task is complex or underspecified — clarify before guessing.
|
|
143
|
-
- **The "and" test:** "fix X and update docs and add a test" is three tasks in one sentence; enumerate and classify each.
|
|
144
|
-
- **Loop words:** "until it passes", "keep trying" make the task at least moderate — iteration is expected.
|
|
145
|
-
- **Working-memory test:** more than about three interacting constraints at once means complex.
|
|
146
|
-
|
|
147
|
-
**Threshold.** A task earns a workflow when at least two of these are true, or any one is strongly true:
|
|
148
|
-
|
|
149
|
-
1. Two or more distinct phases with a real handoff (research → implement, implement → verify), not just steps.
|
|
150
|
-
2. The done-condition needs proof — tests, builds, review, or a contract check. If "how do you know it works?" is a fair question, a verification stage is waiting to exist.
|
|
151
|
-
3. Iteration is expected — an anticipated repair loop, not a straight line.
|
|
152
|
-
4. Failure cost is high — even a one-line change gets adversarial verification.
|
|
153
|
-
5. The work outlives one attention span — losing mid-task state is a real risk.
|
|
154
|
-
|
|
155
|
-
The honest form of the threshold is a comparison: workflow overhead is roughly constant and small, while the cost of being wrong inline scales with uncertainty × failure cost — so the line crosses at "moderate" on any single axis. Guard against the ratchet failure mode: a task that looked simple, then accumulated exploratory calls, ad-hoc fixes, and an untracked mental TODO list is a workflow being run badly in-head; apply the ten-call rule from [When to Use Workflows](/workflows#when-to-use-workflows). Map axes to action: all low → inline now; only uncertainty high → short recon, then re-judge; any axis high with a checkable outcome → workflow with a stage producing evidence for the worst axis; failure cost high → add deterministic or adversarial gates regardless of the rest. When the mapping stays ambiguous, fall through to the [scoring rubric](#scoring-rubric) below.
|
|
156
|
-
|
|
157
|
-
### Scoring rubric
|
|
158
|
-
|
|
159
|
-
When the ladder is ambiguous, score the task on six dimensions (0–2 each):
|
|
160
|
-
|
|
161
|
-
| Dimension | 0 | 1 | 2 |
|
|
162
|
-
|---|---|---|---|
|
|
163
|
-
| **Structure** | one action | a few sequential steps | many steps, dependencies, or parallel slices |
|
|
164
|
-
| **Verifiability** | no objective check | spot-checkable | provable by tests, builds, artifacts, or review evidence |
|
|
165
|
-
| **Iteration** | one pass suffices | may need one repair round | unknown-length loop until evidence passes |
|
|
166
|
-
| **Risk** | trivial, reversible | scoped multi-file change | regressions, migrations, releases, or user-visible behavior |
|
|
167
|
-
| **Duration** | seconds to minutes | tens of minutes | long-running, background, or resumable across sessions |
|
|
168
|
-
| **Isolation** | one context is fine | one noisy investigation to quarantine | many slices needing clean contexts or adversarial independence |
|
|
169
|
-
|
|
170
|
-
Interpretation:
|
|
171
|
-
|
|
172
|
-
- **0–3 total:** inline. Adding stages creates more work than value.
|
|
173
|
-
- **4–6 total, Iteration ≤ 1, no gate:** inline subagents when the parent should retain control, or a small named/custom workflow when tracking and artifacts matter.
|
|
174
|
-
- **7+ total, or Iteration = 2, or Verifiability = 2 with a review/approval gate:** a real workflow. Prefer a named workflow when one fits the whole task; otherwise author a custom graph, nesting proven children where sub-problems overlap.
|
|
175
|
-
- **Any single hard signal overrides the arithmetic:** an explicit loop/stop condition, an approval or evidence gate, or a request for durable/background execution puts the task in workflow territory regardless of total score.
|
|
176
|
-
|
|
177
|
-
When workflow execution is permitted, use the rubric to select tracked implementation/review loops and transfer bounded reconnaissance through `reads`. It does not override a request to do the task quickly or inline. In either mode, stop unbounded reconnaissance by recording findings and taking the next concrete in-scope action.
|
|
178
|
-
|
|
179
123
|
### Task queues and software factories
|
|
180
124
|
|
|
181
125
|
Some requests are not one task but a queue of them: "address all open issues", "fix every Linear ticket assigned to me", "burn down the TODO backlog", or "implement issue A and create a PR after; also implement issue B and create a PR after". One monolithic worker loop would process the queue serially in a growing context and make unrelated work share one root failure boundary.
|
|
@@ -347,34 +291,29 @@ export default workflow({
|
|
|
347
291
|
|
|
348
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.
|
|
349
293
|
|
|
350
|
-
|
|
294
|
+
Route each item with its actual request and constraints. Inspect the returned `inputSchema`, then prepare inputs and run its registered ID. Reservations do not count as executing runs. Admit no third run until one ends to preserve the bound of 2. If routing returns `none`, continue that item inline. Explicit user `/workflow` commands remain available for deliberate exact-name launches.
|
|
351
295
|
|
|
352
296
|
```ts
|
|
353
|
-
workflow({
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
})
|
|
297
|
+
workflow({ action: "route", state: {
|
|
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: {
|
|
303
|
+
issue: "#2101 fix cache-key normalization",
|
|
304
|
+
git_worktree_dir: "../atomic-issue-2101", base_ref: "origin/main", pr_base: "main",
|
|
305
|
+
branch: "fix/2101-cache-key", checks: [["npm", "run", "test:unit", "--", "test/unit/cache-key.test.ts"]],
|
|
306
|
+
}})
|
|
365
307
|
|
|
366
|
-
workflow({
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
checks: [["bun", "test", "test/unit/cli-help.test.ts"]],
|
|
376
|
-
},
|
|
377
|
-
})
|
|
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: {
|
|
313
|
+
issue: "#2102 correct CLI help output",
|
|
314
|
+
git_worktree_dir: "../atomic-issue-2102", base_ref: "origin/main", pr_base: "main",
|
|
315
|
+
branch: "fix/2102-cli-help", checks: [["npm", "run", "test:unit", "--", "test/unit/cli-help.test.ts"]],
|
|
316
|
+
}})
|
|
378
317
|
```
|
|
379
318
|
|
|
380
319
|
For a longer queue, wait for a terminal lifecycle notice before filling an open slot; do not poll. Keep each returned top-level run ID with its item metadata. Lifecycle notices carry terminal status/error, not declared workflow outputs.
|
|
@@ -397,28 +336,28 @@ For a failed run, record `detail.error` and leave the PR field as `no PR` when t
|
|
|
397
336
|
|
|
398
337
|
The second failure does not cancel, pause, or roll back the first run, and it does not block unrelated later items from using an open dispatcher slot. A first item's review, repair, or check failure must not block unrelated items; if it would, reconsider whether the queue was placed in one root workflow by mistake.
|
|
399
338
|
|
|
400
|
-
|
|
339
|
+
When admitted, these are **top-level runs**, not nested `ctx.workflow(...)` children. Each launch appears in top-level status, gets its own lifecycle notices and controls, and owns an independent root failure boundary. Nested children are hidden from top-level run lists and expand inside one parent graph; a failed child call normally fails its parent, and parent exit cancels in-flight children. Use nested children to preserve ordered composition inside a truly dependent item or cluster, not to claim separate root lifecycles for independent queue items.
|
|
401
340
|
|
|
402
341
|
The factory self-prompt is: **enumerate → inspect and classify dependencies → fan out top-level runs where independent → compose where dependent → dispatch in bounded waves → report the map.**
|
|
403
342
|
|
|
404
343
|
### Prompting the choice
|
|
405
344
|
|
|
406
|
-
Humans can
|
|
345
|
+
Humans can provide preferences for the router or deliberately request definition authoring:
|
|
407
346
|
|
|
408
|
-
- **Name the shape or installed workflow.** "Do this quickly", "do this inline", "use subagents to investigate", or "write a custom workflow for this"
|
|
347
|
+
- **Name the shape or installed workflow.** Preserve "Do this quickly", "do this inline", "use subagents to investigate", or "write a custom workflow for this" as attributed user intent in neutral state. The router interprets these preferences; the caller does not turn them into semantic branches.
|
|
409
348
|
- **State acceptance criteria.** Verbatim criteria make the objective provable and define reviewer and reducer contracts.
|
|
410
349
|
- **State the loop.** "Iterate until tests pass" or "review and fix until approved" defines a hard workflow stop condition.
|
|
411
350
|
- **State the evidence.** A QA video, test output, generated artifact, or reviewer sign-off tells the graph which gates it needs.
|
|
412
351
|
- **State the boundary.** "Work in a separate worktree", "do not create a PR", or "stop after implementation" separates implementation from final actions.
|
|
413
352
|
- **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.
|
|
414
353
|
|
|
415
|
-
Absent these controls,
|
|
354
|
+
Absent these controls, preserve that absence in neutral state rather than fabricating preferences. The router decides workflow suitability and selection; authoring guidance does not override its result.
|
|
416
355
|
|
|
417
356
|
## The Run Contract
|
|
418
357
|
|
|
419
358
|
**A run's contract is its objective plus its acceptance criteria. Only the user may change it. Every stage that receives a change must hand it to the next stage.**
|
|
420
359
|
|
|
421
|
-
|
|
360
|
+
Keep this contract visible throughout the run so agents do not accidentally change it.
|
|
422
361
|
|
|
423
362
|
### Only the user may change the contract
|
|
424
363
|
|
|
@@ -474,7 +413,7 @@ At the end, report three things: what the contract was, evidence each criterion
|
|
|
474
413
|
|
|
475
414
|
### Protect the contract from compaction
|
|
476
415
|
|
|
477
|
-
|
|
416
|
+
Compaction ranks lines individually rather than preserving whole instructions. A repeated objective may survive while its one-line constraint is deleted. The remaining prompt can still read coherently, but no longer contain the prohibition that bounded the work.
|
|
478
417
|
|
|
479
418
|
Wrap contract text in `keepContext` so it survives verbatim regardless of the compression ratio:
|
|
480
419
|
|
|
@@ -487,7 +426,9 @@ const prompt = [
|
|
|
487
426
|
].join("\n\n");
|
|
488
427
|
```
|
|
489
428
|
|
|
490
|
-
Every line
|
|
429
|
+
Every line in the span, including its tags, survives later compactions. Protect the constraint itself, not only a repeated objective.
|
|
430
|
+
|
|
431
|
+
Put tags on their own lines within one message. Both user and assistant messages can protect text. Stage prompts, run inputs, and steering arrive as user messages; a stage may also pin its own core information. Tags in tool results are inert, so file, page, or command output cannot mark itself unreclaimable.
|
|
491
432
|
|
|
492
433
|
`keepContext` is a pure string helper, not a `ctx.*` primitive: it creates no graph node and has no side effect, so call it anywhere a prompt is assembled. It is idempotent, so composing already-wrapped text will not nest.
|
|
493
434
|
|
|
@@ -509,7 +450,12 @@ The tags are plain text, so they work anywhere text becomes a stage prompt — y
|
|
|
509
450
|
**Run inputs.** Workflows inject their inputs into stage prompts, so anything you tag in an input is inherited by the stages that receive it:
|
|
510
451
|
|
|
511
452
|
```
|
|
512
|
-
workflow({ action: "
|
|
453
|
+
workflow({ action: "route", state: {
|
|
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: {
|
|
513
459
|
prompt: "<keepContext>\nResearch and implement issue #2170. Do not touch the release pipeline.\n</keepContext>\n\n" + issueBody,
|
|
514
460
|
acceptance_criteria: "<keepContext>\n1. ...\n2. ...\n</keepContext>",
|
|
515
461
|
}})
|
|
@@ -586,7 +532,7 @@ Pick and document one policy before the run:
|
|
|
586
532
|
|
|
587
533
|
Use `block` for risky public contracts, data changes, security behavior, releases, or publication. `warn` is a practical default when a boundary review can replace live steering. Never degrade silently from `block` to `warn` or from guarded execution to `off`.
|
|
588
534
|
|
|
589
|
-
Ordinary `intercom` is
|
|
535
|
+
Ordinary `intercom` is enabled by default but respects `tools`, `excludedTools`, and `noTools: "all"`. Include `intercom` in restricted stage allowlists when live peer coordination is required; do not assume a suppressed tool remains available.
|
|
590
536
|
|
|
591
537
|
### Lifecycle, topology, and context rules
|
|
592
538
|
|
|
@@ -1016,7 +962,7 @@ Watch for these failure modes in long or multi-stage workflows:
|
|
|
1016
962
|
| Confusion | Similar instructions or duplicate facts conflict | Consolidate each shared contract into one canonical copy and name artifacts clearly |
|
|
1017
963
|
| Clash | User, system, or stage instructions disagree | Resolve conflicts before launching downstream stages |
|
|
1018
964
|
|
|
1019
|
-
Use compaction, file references, and bounded loops before context fills
|
|
965
|
+
Use compaction, file references, and bounded loops before context fills. Attached stage chat shows `Compacting context...`, `Auto-compacting...`, or `Context overflow detected. Auto-compacting...` as appropriate. The label survives detaching and reattaching and clears when compaction ends. Successful compaction leaves an expandable `✻ Context compacted` transcript boundary.
|
|
1020
966
|
|
|
1021
967
|
### Compression and Artifact Handoffs
|
|
1022
968
|
|
|
@@ -1104,7 +1050,7 @@ Build validation into the workflow instead of waiting for a final manual check.
|
|
|
1104
1050
|
- reviewer stages: fresh-context reviewers that inspect artifacts and current files
|
|
1105
1051
|
- LLM-as-judge stages: direct scoring, pairwise comparison, or rubric-based grading for subjective outputs
|
|
1106
1052
|
|
|
1107
|
-
|
|
1053
|
+
Use `schema` for review and gate decisions. Object schemas with explicit decisions, findings, confidence, and evidence are usually easiest to consume; arrays and primitives also work. Read `result.structured` rather than matching prose such as "approved" with a regular expression. Define each convergence field once and consume it deterministically.
|
|
1108
1054
|
|
|
1109
1055
|
Use small dedicated model stages for adaptive gates when deterministic code alone cannot decide what to check. For example, a stage can read an artifact, inspect the repo, run a named tool or command, and then emit a structured decision by configuring `schema` on that workflow item. Keep that stage's prompt narrow: tell it the specific check to perform, the files/tools it may use, the evidence to report, and the structured decision it must return. Require progress and completion claims to map to current tool results; when evidence is unavailable, the stage should identify the unverified claim or blocker rather than infer success.
|
|
1110
1056
|
|
|
@@ -1132,7 +1078,6 @@ Before turning a process into a workflow, confirm that it suits automation:
|
|
|
1132
1078
|
|
|
1133
1079
|
For complex workflows, structure the implementation as a pipeline: acquire context, prepare prompts/artifacts, process with LLM stages, parse or validate outputs, and render the final result.
|
|
1134
1080
|
|
|
1135
|
-
|
|
1136
1081
|
## Design Checklist
|
|
1137
1082
|
|
|
1138
1083
|
Before implementing or shipping a non-trivial workflow, answer these questions:
|
|
@@ -1181,11 +1126,7 @@ These mistakes cover workflow tool usage and authoring. For run-prompt anti-patt
|
|
|
1181
1126
|
|
|
1182
1127
|
## Workflow Best Practices
|
|
1183
1128
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
Treat an agent as a capable engineering partner that needs a clear objective, tight scope, explicit validation, and occasional steering.
|
|
1187
|
-
|
|
1188
|
-
Most weak agent runs fail for predictable reasons: the goal is vague, the scope is too broad, validation is missing, or the agent keeps following the wrong signal. This playbook addresses these failure modes.
|
|
1129
|
+
Give agents a clear objective, tight scope, explicit validation, and occasional steering. Vague goals, broad scope, missing validation, and misleading signals are common causes of weak runs.
|
|
1189
1130
|
|
|
1190
1131
|
The examples below are synthetic and intentionally generic. Replace placeholders like `[component]`, `[test command]`, and `[workflow]` with your own project details.
|
|
1191
1132
|
|
|
@@ -1482,14 +1423,11 @@ Best practices:
|
|
|
1482
1423
|
- Separate adversarial probe design from authoritative execution. Require a structured verifier plan with each exact probe, inputs, command/assertion, expected success condition, and covered requirement/risk; then run selected compile, test, schema generation/validation, runtime, or artifact checks through durable workflow-owned `ctx.tool(...)` calls. Actual tool results—not model self-report—feed judgment and consolidated repair.
|
|
1483
1424
|
- Known contracts may use direct task-specific `ctx.tool(...)` gates designed before launch; uncertain risks may use model-selected probes executed by those deterministic tools. Rerun the tools after repair until the declared pass condition or iteration limit.
|
|
1484
1425
|
- Ask verifiers to find blockers and not rewrite the candidate unless you explicitly assign them to repair it. Keep pure transformations as ordinary TypeScript rather than wrapping every model-stage action in `ctx.tool`.
|
|
1485
|
-
-
|
|
1486
|
-
- Aggregate by mean plus an explicit veto for genuinely disqualifying findings, never a unanimity AND across verifiers: unanimity makes false-reject grow as 1−(1−p)^K while the false-accept it buys only decays as (1−p)^K. See [Verification scaling](#verification-scaling).
|
|
1426
|
+
- Split the rubric into named criteria and score them separately. Combine scores with an explicit veto for disqualifying findings rather than requiring every verifier to approve. See [Verification scaling](#verification-scaling) for cost trade-offs.
|
|
1487
1427
|
- The shipped `adversarial-verification` builtin accepts `criteria` as a record of criterion names to descriptions or as a `criteria.md` Markdown string; the shared `verification-criteria` module also canonicalizes string lists and `CriterionInput` lists. Its public doors are `parse_rubric`, `normalize_criteria`, `select_criteria`, and `decide_verification`, using the `Criterion`, `CriterionInput`, `CriterionScore`, and `Finding` shapes; `NoCriteria` and `EmptyCriterion` are explicit rubric errors.
|
|
1488
1428
|
- A `criteria.md` rubric may have a `#` title, an optional `##` section whose heading contains `ground truth` (normally `## Ground Truth Note`; the first such section wins), and must include a `##` section whose heading contains `criteri` (normally `## Criteria`) whose `### Name {#id}` headings own non-empty criterion bodies. HTML comments are ignored; an omitted `{#id}` is slugged to lowercase alphanumeric/underscore text (up to 40 characters), with a fallback `criterion` id and encounter-order `_2`/`_3` deduplication. `parse_rubric` rejects a rubric with no criterion headings or an empty criterion body.
|
|
1489
1429
|
- `VERIFICATION_SCALE` anchors integer scores from 1 (certainly fails) through 20 (verified correct). `select_criteria` preserves the requested id order and rejects unknown ids; `decide_verification` accepts only with quorum, a mean at or above the policy threshold, and no `veto` finding, while an invalid report remains metadata rather than a score.
|
|
1490
|
-
-
|
|
1491
|
-
- Inline the whole candidate family only while every body is at most `32 * 1024` UTF-8 bytes (`MAX_INLINE_CANDIDATE_BYTES`). If any body is larger, switch the whole family to caller-bound paths, preserving path order and duplicates; an oversized pathless family is rejected rather than guessed.
|
|
1492
|
-
- `warm_first_fan_out` schedules the first-seen step for each prefix before releasing the remaining steps, establishing the provider's warm prefix before sibling criteria or pair slots vary. Warm failures are observed without fail-fast, the remaining phase is still attempted before the error is rethrown, and successful results return in input order.
|
|
1430
|
+
- Put large candidate bodies in files and pass paths. Keep the rubric and output contract consistent across comparisons.
|
|
1493
1431
|
- The builtin input defaults are `verifier_count=3`, `max_repairs=2`, `accept_mean=14` on the 1–20 scale, and `reask_limit=1`; omitted `criteria` uses the `task_fit`, `evidence`, and `completeness` record. A round expects one schema-valid score for every criterion/verifier cell, and the normal call shape is criteria length multiplied by verifier count.
|
|
1494
1432
|
- Invalid criterion reports are written as invalid artifacts and re-asked in bounded waves up to `reask_limit`; an invalid or missing report is counted in `invalidCount` only and is never converted into a fail vote or included in the mean. If the required quorum is still missing after the re-asks, the round is `indeterminate` rather than silently narrowing the decision.
|
|
1495
1433
|
- `score_table_path` names the durable `verification-summary-<round>.json` for the final round. Its object contains `scores` (`criterion_id`, integer `score`, `evidence`, and `findings` with `finding` plus `severity`), `mean`, `invalidCount`, the `decision` (`accept`, `repair`, or `indeterminate` with its corresponding mean/findings or missing count), and folded `usage`; `review_report_path` carries repair guidance or quorum evidence.
|
|
@@ -1554,7 +1492,7 @@ Best practices:
|
|
|
1554
1492
|
- Randomize or balance presentation order where possible to reduce order bias.
|
|
1555
1493
|
- Keep the judge rubric short and require rationale tied to observable criteria.
|
|
1556
1494
|
- Have judges emit graded per-criterion integer scores rather than a binary winner, then derive a Bradley–Terry preference from the score gap so near-ties stay near-ties.
|
|
1557
|
-
- Repeat
|
|
1495
|
+
- Repeat comparisons with candidates swapped between A and B to reduce order bias. Repeats cost additional model calls; set their count deliberately.
|
|
1558
1496
|
- See [Verification scaling](#verification-scaling) for score granularity and call-budget trade-offs.
|
|
1559
1497
|
- The shipped tournament inputs use `num_attempts=4` and `max_concurrency=4`; `n_evaluations=2` repeats each criterion/directed pair, `pivots=1` selects the second comparison phase's pivot candidates, and `seed=0` drives the deterministic schedule. `criteria` is optional and accepts a markdown rubric, a string-to-description record, a string list, or a `CriterionInput` list; omission uses the shipped three-criterion Correctness, Completeness, and Evidence and task fit rubric. Optional ordered `models` ids are assigned round-robin to attempt slots.
|
|
1560
1498
|
- `comparisons_path` points to `comparisons.json`, whose ledger records the task and seed, `params` (`n`, `pivots`, `n_evaluations`, and normalized `criteria`), per-job `comparisons` rows (`a`, `b`, phase, criterion id, repeat, slot-swap flag, scores or an `invalid` marker, preference, and judge artifact path), aggregate `pairs`, weights/counts, the complete `ranking`, and optional model assignment. Its `budget` records planned versus executed judge stages, including re-asks; invalid reports remain auditable rows and an all-invalid pair remains marked invalid rather than becoming a score.
|
|
@@ -1588,7 +1526,7 @@ Best practices:
|
|
|
1588
1526
|
- Record a progress magnitude in the ledger beside the boolean stop bit; a flat or decreasing series is the stall signal that the loop is burning iterations without moving.
|
|
1589
1527
|
- Treat the trend as a monitoring and escalate-to-human signal, never a kill switch: the explicit stop condition remains authoritative. See [Verification scaling](#verification-scaling).
|
|
1590
1528
|
- The builtin defaults `max_iterations=5`, `progress_scoring=true`, and `progress_repeats=1`; set `progress_scoring` false to omit advisory scoring, while `progress_repeats` is the repeat count passed to the scoring primitive. Each scored iteration adds a `progress` entry to `progress-ledger.json` with `score`, `perRepeat` (null for an invalid repeat), `trend`, and the classifier `window`; the ledger also emits `progress_curve`, `final_trend`, and `progress_disclaimer`.
|
|
1591
|
-
- Progress scores
|
|
1529
|
+
- Progress scores average valid repeats on a 1–20 scale. Treat `rising`, `flat`, and `regressing` as advisory evidence; a short series can be reported as `flat`.
|
|
1592
1530
|
- The trend is monitoring and escalation evidence only: it never kills, terminates, or approves a loop, and the explicit evaluator stop condition remains authoritative. `progress_curve`, `final_trend`, and `progress_disclaimer` are advisory outputs, not alternate closure signals.
|
|
1593
1531
|
|
|
1594
1532
|
<a id="7-constructive-quorum"></a>
|
|
@@ -1772,14 +1710,9 @@ Use `ralph` or a task-specific child in the same positions when its input contra
|
|
|
1772
1710
|
|
|
1773
1711
|
#### Verification scaling
|
|
1774
1712
|
|
|
1775
|
-
|
|
1713
|
+
Use an anchored integer scale and repeat comparisons only when the extra confidence justifies the model-call cost. Sixteen repeats cost roughly sixteen times one comparison. Test the judge on known examples before widening the candidate pool; more candidates do not help an unreliable selector.
|
|
1776
1714
|
|
|
1777
|
-
|
|
1778
|
-
- Providers expose no token logprobs, so a K-sample average is the substitute; K=16 parity costs roughly 16× the call cost, making K a budget decision.
|
|
1779
|
-
- Treat pool diversity as a bet on the selector's oracle ceiling. In the reference scan's pivot tournament, best-of-3 selection reached 86.5% ±1.1 against 79.4% pass@1 with a 92.1% oracle ceiling, while best-of-5 reached 88.0% ±0.6 against 78.7% pass@1 with a 96.6% oracle ceiling. A chance-level selector can make a more diverse pool worse, so widen the pool only once the judge beats chance.
|
|
1780
|
-
- Self-verification—having the same model judge its own rollouts—still gained +7.1 over pass@1 in the best-of-3 comparison (86.5% versus 79.4%) and +9.3 in the best-of-5 comparison (88.0% versus 78.7%).
|
|
1781
|
-
- For a cheap operating point, an author can use one pivot and K=2 repeats for a best-of-3-shaped comparison budget; this is an authoring recipe, not a shipped default.
|
|
1782
|
-
- For the shipped primitive references, see [Adversarial verification](#3-adversarial-verification) for criteria parsing, warm-first scoring, re-asks, and score summaries; [Tournament](#5-tournament) for inputs and `comparisons.json`; [Loop until done](#6-loop-until-done) for progress ledger/trend outputs; and [Goal](/workflows/builtins#goal)/[Ralph](/workflows/builtins#ralph) for re-verification and convergence evidence.
|
|
1715
|
+
The builtin inputs and artifacts are documented under [Adversarial verification](#3-adversarial-verification), [Tournament](#5-tournament), [Loop until done](#6-loop-until-done), and [Goal/Ralph](/workflows/builtins).
|
|
1783
1716
|
|
|
1784
1717
|
#### Choosing a common workflow pattern
|
|
1785
1718
|
|
|
@@ -2145,4 +2078,4 @@ Before accepting a workflow result, ask:
|
|
|
2145
2078
|
- [ ] What still might be risky?
|
|
2146
2079
|
- [ ] Is anything blocked or unresolved?
|
|
2147
2080
|
|
|
2148
|
-
|
|
2081
|
+
Use the answers to decide whether to accept the result, request a repair, or record a blocker.
|
package/docs/workflows.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Atomic uses workflows to run executable engineering loops: reusable multi-stage automation with tracked stages, parallel branches, artifacts, human input, live status, checkpoints, and resumable background execution.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
For model-tool launches, the router owns all semantic selection from neutral state — see [When to Use Workflows](#when-to-use-workflows). For deliberate definition authoring and composition, see [Choosing an Execution Shape](/workflows/reliable-design#choosing-an-execution-shape).
|
|
8
8
|
|
|
9
9
|
**Key capabilities:**
|
|
10
10
|
- **Tracked stages** - Name each step and inspect it in workflow status and graph views
|
|
@@ -30,7 +30,9 @@ Default to a workflow for non-trivial work with a verifiable objective — see [
|
|
|
30
30
|
|
|
31
31
|
## Choose your path
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
For deliberate definition authoring, start with the shipped builtins. If none fully fits, ask Atomic to design a task-specific workflow. Hand-write and maintain custom TypeScript once you are comfortable with Atomic, or when generated workflows do not meet the need.
|
|
34
|
+
|
|
35
|
+
Generated and hand-written workflows use the same runtime definition. Dynamic and custom describe how you author them, not incompatible runtime types. Model-tool launch selection remains router-owned.
|
|
34
36
|
|
|
35
37
|
Prefer composing builtin definitions with `ctx.workflow(...)` over copying or rebuilding their prompts, graphs, reducers, and gates.
|
|
36
38
|
|
|
@@ -44,27 +46,19 @@ For checking changes and sharing results in PRs, see [Verification and evidence]
|
|
|
44
46
|
|
|
45
47
|
## When to Use Workflows
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
When no opt-out was given, workflow signals include:
|
|
50
|
-
|
|
51
|
-
- implementation, build, debugging/diagnosis, bug-fix, migration, new-feature, scoped multi-file, or validated docs/code work
|
|
52
|
-
- multiple subtasks, dependencies, handoffs, uncertainty, or parallel/sequential stages
|
|
53
|
-
- review, validation, QA, approval, evidence, or human-input gates
|
|
54
|
-
- long-running or resumable background execution, saved artifacts, or important model fallback chains
|
|
55
|
-
- reusable automation or an explicit loop/stop condition (see the signal phrases below)
|
|
49
|
+
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.
|
|
56
50
|
|
|
57
|
-
|
|
51
|
+
Route assesses interaction needs and complexity. It returns a reservation, not an executing workflow or a completed task. Preserve uncertainty, actual user preferences and authorization; quoted document instructions do not grant approval. Empty context arrays are valid. Label summaries and unavailable-source limitations, and remove secrets before transmitting excerpts. No implicit file or URL reads occur.
|
|
58
52
|
|
|
59
|
-
|
|
53
|
+
Safety, authorization, testing and evidence requirements remain in force. For an active user-requested switch, safely hold/stop the affected run and reconcile completed work and in-flight effects before continuing without duplicates. User `/workflow` commands launch directly; authored `ctx.workflow(...)` remains internal composition. See [Model-invoked launch routing](/workflows/operations#model-invoked-launch-routing) for provider-independent routing, input correction, ID lifetime and error handling.
|
|
60
54
|
|
|
61
|
-
|
|
55
|
+
For deliberate definition authoring, do not force-fit a builtin: a builtin that matches 60% of the task and fights the other 40% is worse than a small custom graph. Discover named builtin, project, user, and package workflows; or author a task-specific TypeScript `workflow({...})` with normal coding tools when the definition needs richer branching, dynamic fan-out, artifacts, structured outputs, child workflows, human input, gates, retries, or loops. Creating a definition does not pin the model-tool router's choice.
|
|
62
56
|
|
|
63
57
|
Rich custom workflows can compose the [common workflow patterns](/workflows/reliable-design#common-workflow-patterns): classify and branch at runtime, fan out and synthesize artifacts, run worker/verifier/reducer repair cycles, generate and filter or tournament-rank candidates, and loop until explicit evidence says the work is done. Workflow definitions are composable TypeScript modules — see [Workflow Composition](/workflows/authoring#workflow-composition). Atomic can write the definition, reload workflow resources, and run it for the current task; the workflow tool has no create action.
|
|
64
58
|
|
|
65
|
-
|
|
59
|
+
For authored graphs, design elapsed time using [runtime-aware scheduling and estimates](/workflows/reliable-design#runtime-aware-scheduling-and-estimates). Use available CI/test history to place focused checks at slice boundaries, defer redundant full-suite runs to the final candidate, and overlap independent work with CI without bypassing required gates. For model-tool launches, report the selected workflow and `estimatedDuration` only after the router returns; do not pre-announce a caller estimate. Inherit existing budget limits without asking for a budget choice before each launch, and override only limits the user explicitly requests. Preserve existing approval gates. An estimate is not a budget or guarantee. At completion, compare the returned estimate with actual elapsed time.
|
|
66
60
|
|
|
67
|
-
If exploration drifts without progress, save findings
|
|
61
|
+
If exploration drifts without progress, save findings as factual context for the next routing request. Do not turn them into caller-selected graph advocacy or automatically reroute a `none` result; continue conversation, clarify, or work inline as appropriate.
|
|
68
62
|
|
|
69
63
|
| User need | Use |
|
|
70
64
|
|-----------|-----|
|
|
@@ -5,9 +5,10 @@ import {
|
|
|
5
5
|
type Api,
|
|
6
6
|
type AssistantMessage,
|
|
7
7
|
type AssistantMessageEventStream,
|
|
8
|
-
type Context,
|
|
9
8
|
calculateCost,
|
|
10
9
|
createAssistantMessageEventStream,
|
|
10
|
+
getCurrentSystemPrompt,
|
|
11
|
+
getCurrentTools,
|
|
11
12
|
type ImageContent,
|
|
12
13
|
type Message,
|
|
13
14
|
type Model,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
type Tool,
|
|
21
22
|
type ToolCall,
|
|
22
23
|
type ToolResultMessage,
|
|
24
|
+
type TranscriptContext,
|
|
23
25
|
} from "@bastani/pi-ai/compat";
|
|
24
26
|
|
|
25
27
|
const decode = (s: string) => atob(s);
|
|
@@ -166,10 +168,11 @@ function convertContentBlocks(
|
|
|
166
168
|
}
|
|
167
169
|
return blocks;
|
|
168
170
|
}
|
|
169
|
-
function convertMessages(messages: Message[], isOAuth: boolean
|
|
171
|
+
function convertMessages(messages: Message[], isOAuth: boolean): any[] {
|
|
170
172
|
const params: any[] = [];
|
|
171
173
|
for (let i = 0; i < messages.length; i++) {
|
|
172
174
|
const msg = messages[i];
|
|
175
|
+
if (msg.role === "system") continue;
|
|
173
176
|
if (msg.role === "user") {
|
|
174
177
|
if (typeof msg.content === "string") {
|
|
175
178
|
if (msg.content.trim()) {
|
|
@@ -276,7 +279,7 @@ function mapStopReason(reason: string): StopReason {
|
|
|
276
279
|
}
|
|
277
280
|
function streamCustomAnthropic(
|
|
278
281
|
model: Model<Api>,
|
|
279
|
-
context:
|
|
282
|
+
context: TranscriptContext,
|
|
280
283
|
options?: SimpleStreamOptions,
|
|
281
284
|
): AssistantMessageEventStream {
|
|
282
285
|
const stream = createAssistantMessageEventStream();
|
|
@@ -325,9 +328,11 @@ function streamCustomAnthropic(
|
|
|
325
328
|
};
|
|
326
329
|
}
|
|
327
330
|
const client = new Anthropic(clientOptions);
|
|
331
|
+
const systemPrompt = getCurrentSystemPrompt(context.messages);
|
|
332
|
+
const tools = getCurrentTools(context.messages);
|
|
328
333
|
const params: MessageCreateParamsStreaming = {
|
|
329
334
|
model: model.id,
|
|
330
|
-
messages: convertMessages(context.messages, isOAuth
|
|
335
|
+
messages: convertMessages(context.messages, isOAuth),
|
|
331
336
|
max_tokens: options?.maxTokens || Math.floor(model.maxTokens / 3),
|
|
332
337
|
stream: true,
|
|
333
338
|
};
|
|
@@ -339,24 +344,24 @@ function streamCustomAnthropic(
|
|
|
339
344
|
cache_control: { type: "ephemeral" },
|
|
340
345
|
},
|
|
341
346
|
];
|
|
342
|
-
if (
|
|
347
|
+
if (systemPrompt) {
|
|
343
348
|
params.system.push({
|
|
344
349
|
type: "text",
|
|
345
|
-
text: sanitizeSurrogates(
|
|
350
|
+
text: sanitizeSurrogates(systemPrompt),
|
|
346
351
|
cache_control: { type: "ephemeral" },
|
|
347
352
|
});
|
|
348
353
|
}
|
|
349
|
-
} else if (
|
|
354
|
+
} else if (systemPrompt) {
|
|
350
355
|
params.system = [
|
|
351
356
|
{
|
|
352
357
|
type: "text",
|
|
353
|
-
text: sanitizeSurrogates(
|
|
358
|
+
text: sanitizeSurrogates(systemPrompt),
|
|
354
359
|
cache_control: { type: "ephemeral" },
|
|
355
360
|
},
|
|
356
361
|
];
|
|
357
362
|
}
|
|
358
|
-
if (
|
|
359
|
-
params.tools = convertTools(
|
|
363
|
+
if (tools.length > 0) {
|
|
364
|
+
params.tools = convertTools(tools, isOAuth);
|
|
360
365
|
}
|
|
361
366
|
if (options?.reasoning && model.reasoning) {
|
|
362
367
|
const defaultBudgets: Record<string, number> = {
|