@bastani/atomic 0.9.11-alpha.1 → 0.9.11-alpha.3
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 +52 -0
- package/dist/builtin/cursor/package.json +3 -3
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/src/runs/background/notify.ts +3 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +5 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +2 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +5 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +34 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +6 -0
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/durable/child-primitive.ts +3 -0
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +182 -33
- package/dist/builtin/workflows/src/durable/completed-inspection.ts +9 -4
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +31 -8
- package/dist/builtin/workflows/src/durable/resume-runtime.ts +6 -2
- package/dist/builtin/workflows/src/durable/stage-primitive.ts +48 -10
- package/dist/builtin/workflows/src/durable/types.ts +11 -0
- package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +9 -9
- package/dist/builtin/workflows/src/engine/run-durable-topology.ts +89 -0
- package/dist/builtin/workflows/src/engine/run.ts +18 -16
- package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +3 -0
- package/dist/builtin/workflows/src/extension/ui-surface.ts +4 -0
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +3 -0
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +6 -3
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +2 -2
- package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +4 -1
- package/dist/builtin/workflows/src/tui/host-input-form.ts +1 -1
- package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +2 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts +4 -2
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +3 -0
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +50 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config-command-parser.d.ts +9 -0
- package/dist/config-command-parser.d.ts.map +1 -0
- package/dist/config-command-parser.js +22 -0
- package/dist/config-command-parser.js.map +1 -0
- package/dist/config-self-update.d.ts +6 -2
- package/dist/config-self-update.d.ts.map +1 -1
- package/dist/config-self-update.js +17 -10
- package/dist/config-self-update.js.map +1 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +7 -1
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +32 -25
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +9 -3
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +5 -0
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +11 -5
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +7 -2
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +20 -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/auth-storage.d.ts +6 -2
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +5 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/cache-stats.d.ts +25 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +68 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +7 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +8 -8
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +3 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +6 -1
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts +3 -0
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +2 -1
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/extensions/agent-events.d.ts +10 -0
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +8 -2
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/event-types.d.ts +2 -2
- package/dist/core/extensions/event-types.d.ts.map +1 -1
- package/dist/core/extensions/event-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +13 -2
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +1 -0
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +15 -7
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/message-types.d.ts +5 -0
- package/dist/core/extensions/message-types.d.ts.map +1 -1
- package/dist/core/extensions/message-types.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +46 -0
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-registries.d.ts +2 -1
- package/dist/core/extensions/runner-registries.d.ts.map +1 -1
- package/dist/core/extensions/runner-registries.js +8 -0
- package/dist/core/extensions/runner-registries.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +35 -13
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +8 -2
- 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/ui-types.d.ts +4 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +1 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +16 -2
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +6 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +3 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry-auth.d.ts +2 -0
- package/dist/core/model-registry-auth.d.ts.map +1 -1
- package/dist/core/model-registry-auth.js +18 -1
- package/dist/core/model-registry-auth.js.map +1 -1
- package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
- package/dist/core/model-registry-custom-loader.js +14 -2
- package/dist/core/model-registry-custom-loader.js.map +1 -1
- package/dist/core/model-registry-dynamic.js +2 -2
- package/dist/core/model-registry-dynamic.js.map +1 -1
- package/dist/core/model-registry-loader.d.ts.map +1 -1
- package/dist/core/model-registry-loader.js +2 -1
- package/dist/core/model-registry-loader.js.map +1 -1
- package/dist/core/model-registry-schemas.d.ts +17 -0
- package/dist/core/model-registry-schemas.d.ts.map +1 -1
- package/dist/core/model-registry-schemas.js +2 -0
- package/dist/core/model-registry-schemas.js.map +1 -1
- package/dist/core/model-registry-types.d.ts +10 -1
- package/dist/core/model-registry-types.d.ts.map +1 -1
- package/dist/core/model-registry-types.js.map +1 -1
- package/dist/core/model-registry.d.ts +26 -36
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +73 -68
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts.map +1 -1
- package/dist/core/model-resolver-defaults.js +5 -0
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-runtime.d.ts +52 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +120 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/oauth-provider-bridge.d.ts +3 -1
- package/dist/core/oauth-provider-bridge.d.ts.map +1 -1
- package/dist/core/oauth-provider-bridge.js +6 -4
- package/dist/core/oauth-provider-bridge.js.map +1 -1
- package/dist/core/package-manager-resolver.js +22 -11
- package/dist/core/package-manager-resolver.js.map +1 -1
- package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
- package/dist/core/package-manager-resource-collector.js +8 -2
- package/dist/core/package-manager-resource-collector.js.map +1 -1
- package/dist/core/package-manager-resource-patterns.d.ts +1 -0
- package/dist/core/package-manager-resource-patterns.d.ts.map +1 -1
- package/dist/core/package-manager-resource-patterns.js +15 -0
- package/dist/core/package-manager-resource-patterns.js.map +1 -1
- package/dist/core/package-manager-source.d.ts.map +1 -1
- package/dist/core/package-manager-source.js +15 -8
- package/dist/core/package-manager-source.js.map +1 -1
- package/dist/core/package-manager-types.d.ts +1 -0
- package/dist/core/package-manager-types.d.ts.map +1 -1
- package/dist/core/package-manager-types.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +6 -4
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +4 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +25 -6
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- 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 +5 -2
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-helpers.d.ts.map +1 -1
- package/dist/core/resource-loader-helpers.js +1 -0
- package/dist/core/resource-loader-helpers.js.map +1 -1
- package/dist/core/resource-loader-internals.d.ts +2 -2
- package/dist/core/resource-loader-internals.d.ts.map +1 -1
- package/dist/core/resource-loader-internals.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +3 -3
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/sdk-exports.d.ts +1 -1
- package/dist/core/sdk-exports.d.ts.map +1 -1
- package/dist/core/sdk-exports.js.map +1 -1
- package/dist/core/sdk-types.d.ts +3 -0
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +10 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +2 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +9 -6
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +2 -2
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +2 -1
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +5 -0
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +33 -0
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +4 -2
- 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-validation.d.ts.map +1 -1
- package/dist/core/session-manager-validation.js +3 -16
- package/dist/core/session-manager-validation.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 +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +7 -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-resource-accessors.d.ts +3 -0
- package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-resource-accessors.js +16 -0
- package/dist/core/settings-manager-resource-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +8 -2
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/summarization-retry.d.ts +11 -0
- package/dist/core/summarization-retry.d.ts.map +1 -0
- package/dist/core/summarization-retry.js +21 -0
- package/dist/core/summarization-retry.js.map +1 -0
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/usage-totals.d.ts +18 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +40 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +5 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +300 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface-ui.d.ts +33 -0
- package/dist/extensions/llama/huggingface-ui.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface-ui.js +166 -0
- package/dist/extensions/llama/huggingface-ui.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +139 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +208 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +11 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +93 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +237 -0
- package/dist/extensions/llama/ui.js.map +1 -0
- 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 +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/main-first-time-setup.d.ts +6 -0
- package/dist/main-first-time-setup.d.ts.map +1 -0
- package/dist/main-first-time-setup.js +10 -0
- package/dist/main-first-time-setup.js.map +1 -0
- package/dist/main-types.d.ts +2 -2
- package/dist/main-types.d.ts.map +1 -1
- package/dist/main-types.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +19 -7
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
- package/dist/modes/interactive/chat-input-actions.js +14 -2
- package/dist/modes/interactive/chat-input-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +16 -0
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.d.ts +6 -6
- package/dist/modes/interactive/components/config-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.js +64 -125
- package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-project-scope.d.ts +4 -0
- package/dist/modes/interactive/components/config-selector-project-scope.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector-project-scope.js +61 -0
- package/dist/modes/interactive/components/config-selector-project-scope.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +8 -5
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +46 -22
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +16 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +45 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +24 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +69 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +48 -26
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form.d.ts +2 -0
- package/dist/modes/interactive/components/host-input-form.d.ts.map +1 -1
- package/dist/modes/interactive/components/host-input-form.js +6 -3
- package/dist/modes/interactive/components/host-input-form.js.map +1 -1
- package/dist/modes/interactive/components/idle-status.d.ts +8 -0
- package/dist/modes/interactive/components/idle-status.d.ts.map +1 -0
- package/dist/modes/interactive/components/idle-status.js +13 -0
- package/dist/modes/interactive/components/idle-status.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +3 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +3 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -5
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +14 -6
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +10 -6
- package/dist/modes/interactive/components/oauth-selector.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 +6 -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 +14 -0
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +4 -0
- 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/interactive-agent-events.js +27 -0
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +17 -8
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.d.ts +2 -0
- package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +88 -40
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +6 -0
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +4 -0
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-global-clear.d.ts +10 -2
- package/dist/modes/interactive/interactive-global-clear.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-global-clear.js +3 -1
- package/dist/modes/interactive/interactive-global-clear.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +6 -4
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +6 -10
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +11 -2
- 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-model-catalog-startup.d.ts +13 -0
- package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-model-catalog-startup.js +24 -0
- package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -0
- package/dist/modes/interactive/interactive-model-routing.js +4 -3
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +3 -2
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +69 -12
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.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-session-routing.js +3 -0
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +14 -0
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +4 -7
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-summarization-retry-events.d.ts +8 -0
- package/dist/modes/interactive/interactive-summarization-retry-events.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-summarization-retry-events.js +40 -0
- package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -0
- package/dist/modes/interactive/login-provider-options.d.ts +21 -0
- package/dist/modes/interactive/login-provider-options.d.ts.map +1 -0
- package/dist/modes/interactive/login-provider-options.js +51 -0
- package/dist/modes/interactive/login-provider-options.js.map +1 -0
- package/dist/modes/interactive-engine/engine-input-form.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-input-form.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-input-form.js +10 -2
- package/dist/modes/interactive-engine/engine-input-form.js.map +1 -1
- package/dist/modes/interactive-engine/input-form-host.d.ts.map +1 -1
- package/dist/modes/interactive-engine/input-form-host.js +7 -2
- package/dist/modes/interactive-engine/input-form-host.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +5 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +9 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +2 -0
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +33 -0
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +4 -1
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +18 -0
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +1 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts +5 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +67 -2
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.js +1 -0
- package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +42 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +3 -3
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +55 -51
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/self-update-plan.d.ts +12 -0
- package/dist/self-update-plan.d.ts.map +1 -0
- package/dist/self-update-plan.js +42 -0
- package/dist/self-update-plan.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +3 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +10 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/version-check.d.ts +1 -0
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -3
- package/dist/utils/version-check.js.map +1 -1
- package/docs/docs.json +2 -1
- package/docs/extensions.md +59 -7
- package/docs/json.md +7 -1
- package/docs/keybindings.md +3 -0
- package/docs/llama-cpp.md +70 -0
- package/docs/models.md +8 -3
- package/docs/packages.md +4 -2
- package/docs/prompt-templates.md +1 -0
- package/docs/providers.md +41 -3
- package/docs/rpc.md +49 -0
- package/docs/sdk.md +21 -0
- package/docs/settings.md +19 -3
- package/docs/tui.md +2 -2
- package/docs/workflows.md +6 -6
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/sandbox/package-lock.json +3 -3
- package/npm-shrinkwrap.json +36 -36
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.11-alpha.3] - 2026-07-21
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added a built-in, hidden llama.cpp router provider with `/login llama.cpp`, `LLAMA_BASE_URL`/`LLAMA_API_KEY` configuration, loaded-model discovery, and the `/llama` manager for load, unload, cancellation, reconnect, and Hugging Face GGUF download workflows.
|
|
10
|
+
- Added provider-metadata-driven `/login` choices, direct `/login <provider>` routing and autocomplete, provider-owned login information links, API-key login for Qwen Token Plan, Radius, and GitHub Copilot, plus preferred defaults for Radius, NVIDIA, and ZAI Coding Plan China.
|
|
11
|
+
- Added global `httpProxy`, duration-string and `"disabled"` HTTP idle timeouts, package `autoload: false` project deltas, Kimi deferred-tool compatibility, `oauth: "radius"` custom gateways, and global/project scope switching in `atomic config` (`-l` starts in project scope).
|
|
12
|
+
- Added extension lifecycle hooks `before_provider_headers` and `agent_settled`, durable `entry_appended` events and `registerEntryRenderer()`, complete native `Provider` registration, and named/hidden `InlineExtension` descriptors.
|
|
13
|
+
- Added the public `ModelRuntime` facade and associated option types, `readStoredCredential`, `InlineExtension`, entry-renderer/event types, and session context conversion helpers to the SDK/package-root surface. Atomic intentionally continues to expose Search rather than adding obsolete grep compatibility aliases.
|
|
14
|
+
- Added Ctrl+X copy-last-message, clipboard text fallback when image paste finds no image, restored footer branch/session/experimental/extension-status segments, Output padding and Cache miss notices settings, and clear-on-shrink idle placeholders.
|
|
15
|
+
- Added durable cache-miss attribution and waste totals, complete per-model session usage/cost breakdowns including tool and summary work, and optional live/resumed cache-miss transcript notices.
|
|
16
|
+
- Added Atomic's first-run theme preview and explicit analytics opt-in. Analytics settings and a local tracking identifier are persisted only when selected; this change does not transmit analytics data.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Login provider discovery now follows registered provider authentication capabilities instead of using display names as an allowlist, so newly installed native providers automatically expose their supported OAuth and API-key methods.
|
|
21
|
+
- Dynamic provider catalogs, including Radius `pi-messages`, are restored and refreshed through the provider-owned model store; documentation now distinguishes generic custom-provider APIs from the broader installed native API surface.
|
|
22
|
+
- Package self-update now honors advisory release notes, pins the exact advertised package and version, reports version transitions, and cleans stale Windows native-dependency quarantine data during ordinary startup.
|
|
23
|
+
- Interactive session diagnostics now show cache hit rate, wasted cache cost, and provider/model usage costs; the footer includes usage spent by tool results and summaries.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Fixed Qwen Token Plan global/China, Radius API-key, and GitHub Copilot token methods being hidden from first-time `/login`, which kept otherwise installed models out of `/model` and `--list-models`.
|
|
28
|
+
- Fixed package-manager self-update helpers rejecting the legacy string target form while retaining exact-version install targets.
|
|
29
|
+
- Fixed `/login` omitting extension-registered custom-auth providers in isolated interactive mode. Provider metadata now synchronizes from the engine child, and provider-owned login prompts, credential persistence, cancellation, and post-login model refresh execute across the existing isolated-engine bridge.
|
|
30
|
+
- Fixed project package overrides being unable to selectively subtract or include resources from a matching global package without replacing the complete declaration.
|
|
31
|
+
- Fixed Ctrl+V reporting an image error when the clipboard contained usable text, and made Ctrl+X invoke the same copy-last-assistant behavior as `/copy`.
|
|
32
|
+
- Fixed a single Ctrl+C not dismissing the `/login` popups (auth-method selector, provider selector, and login dialogs), even though Escape worked and the on-screen hint promised `esc/ctrl+c cancel`. The global Ctrl+C clear/exit handler consumed the key before the focused popup could see it, so the first press silently cleared the hidden editor and a second press within the double-press window exited the entire CLI. The global handler now defers whenever an inline popup owns input (and its overlay/custom-UI guards are evaluated live instead of once at startup), so Ctrl+C reaches the focused component and cancels exactly like Escape while editor clearing and double-press exit continue to work when the editor has focus.
|
|
33
|
+
|
|
34
|
+
## [0.9.11-alpha.2] - 2026-07-21
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- Added Qwen Token Plan and Qwen Token Plan China to Atomic's built-in provider defaults and credential guidance, inherited from `pi-ai` 0.81.1 ([#6858](https://github.com/earendil-works/pi/pull/6858)).
|
|
39
|
+
- Added the `get_available_thinking_levels` RPC command and `RpcClient.getAvailableThinkingLevels()` so headless clients can discover the active model's exact supported cycle order ([#6865](https://github.com/earendil-works/pi/pull/6865)).
|
|
40
|
+
- Exported message and tool-execution lifecycle event types from the Atomic package root for extension and SDK consumers ([#6772](https://github.com/earendil-works/pi/pull/6772)).
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- Updated `@earendil-works/pi-agent-core`, `pi-ai`, and `pi-tui` to 0.81.1, inheriting provider, transport, model-catalog, Kimi K3 thinking, OpenAI Responses retry, Codex request-ID, terminal rendering, and queue fixes from Pi 0.81.0–0.81.1 while retaining Atomic's branding, bundled packages, Verbatim Compaction, and versionless release flow.
|
|
45
|
+
- Restored persisted model catalogs without network access during service creation, then moved automatic network refresh into running interactive and RPC modes. Interactive startup computes its first footer provider count from the restored snapshot and starts network refresh only after TUI initialization.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- Fixed transient provider failures aborting Verbatim Compaction planning or branch summarization. Both now honor the configured retry policy and publish `summarization_retry_scheduled`, `summarization_retry_attempt_start`, and `summarization_retry_finished` lifecycle events to interactive, JSON, RPC, and SDK consumers ([#6901](https://github.com/earendil-works/pi/pull/6901)).
|
|
50
|
+
- Fixed persisted remote model catalogs overriding newer bundled catalogs after an upgrade by comparing catalog modification times and treating legacy undated overlays as stale ([upstream commit](https://github.com/earendil-works/pi/commit/54fad505b9d8cbc8922ff55d7e2938f70cbf6a3d)).
|
|
51
|
+
- Fixed steering and follow-up delivery modes being lost when queued messages were flushed as compaction finished ([#6730](https://github.com/earendil-works/pi/pull/6730)).
|
|
52
|
+
- Fixed read-tool errors being syntax-highlighted as though they were successful file contents ([#6731](https://github.com/earendil-works/pi/pull/6731)).
|
|
53
|
+
- Fixed `${@:-default}` and `${ARGUMENTS:-default}` prompt-template defaults, while retaining Atomic's bounded default-value parser ([#6695](https://github.com/earendil-works/pi/issues/6695)).
|
|
54
|
+
- Fixed persisted sessions being read and parsed twice when opened, and adopted the shared UUIDv7 generator for new session IDs ([#6793](https://github.com/earendil-works/pi/pull/6793), [#6834](https://github.com/earendil-works/pi/pull/6834)).
|
|
55
|
+
- Fixed Kimi Coding usage costs being shown without the subscription estimate indicator.
|
|
56
|
+
|
|
5
57
|
## [0.9.11-alpha.1] - 2026-07-20
|
|
6
58
|
|
|
7
59
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/cursor",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Experimental first-party Atomic extension for Cursor OAuth, model discovery, and streaming provider registration.",
|
|
6
6
|
"contributors": [
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@bastani/atomic-natives": "0.9.11-alpha.
|
|
43
|
+
"@bastani/atomic-natives": "0.9.11-alpha.3",
|
|
44
44
|
"@bufbuild/protobuf": "^2.12.1",
|
|
45
|
-
"@earendil-works/pi-ai": "^0.
|
|
45
|
+
"@earendil-works/pi-ai": "^0.81.1"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
|
|
6
6
|
"contributors": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@bastani/atomic": "*",
|
|
47
|
-
"@earendil-works/pi-tui": "^0.
|
|
47
|
+
"@earendil-works/pi-tui": "^0.81.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@bastani/atomic": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/mcp",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
|
|
6
6
|
"contributors": [
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@bastani/atomic": "*",
|
|
35
|
-
"@earendil-works/pi-ai": "^0.
|
|
36
|
-
"@earendil-works/pi-tui": "^0.
|
|
35
|
+
"@earendil-works/pi-ai": "^0.81.1",
|
|
36
|
+
"@earendil-works/pi-tui": "^0.81.1",
|
|
37
37
|
"zod": "^3.25.0 || ^4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.11-alpha.3] - 2026-07-21
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed foreground subagent runs that detached for intercom coordination completing silently. When a foreground single, chain, or parallel child detaches (for example after asking its supervisor a question) and later exits, the parent session now receives a "Detached subagent task" completion/failure/paused notice through the same deduplicated, turn-triggering delivery pipeline used for background completion notifications, including per-child `(n/m)` attribution for parallel groups. Previously the detached child's final result was only recorded in remembered run state, so the orchestrating session had to poll `subagent status` to discover that a detached run had finished.
|
|
10
|
+
|
|
5
11
|
## [0.9.11-alpha.1] - 2026-07-20
|
|
6
12
|
|
|
7
13
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and background runs. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@bastani/atomic": "*",
|
|
41
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
42
|
-
"@earendil-works/pi-ai": "^0.
|
|
43
|
-
"@earendil-works/pi-tui": "^0.
|
|
41
|
+
"@earendil-works/pi-agent-core": "^0.81.1",
|
|
42
|
+
"@earendil-works/pi-ai": "^0.81.1",
|
|
43
|
+
"@earendil-works/pi-tui": "^0.81.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"@bastani/atomic": {
|
|
@@ -44,6 +44,7 @@ interface SubagentResult {
|
|
|
44
44
|
results?: ChainStepResult[];
|
|
45
45
|
taskIndex?: number;
|
|
46
46
|
totalTasks?: number;
|
|
47
|
+
noticeLabel?: string;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
interface TerminalPreludeMessage {
|
|
@@ -194,8 +195,9 @@ export default function registerSubagentNotify(pi: ExtensionAPI): () => void {
|
|
|
194
195
|
: undefined;
|
|
195
196
|
|
|
196
197
|
const displaySummary = summary.trim() ? summary : "(no output)";
|
|
198
|
+
const noticeLabel = typeof result.noticeLabel === "string" && result.noticeLabel.trim() ? result.noticeLabel.trim() : "Background task";
|
|
197
199
|
const content = [
|
|
198
|
-
|
|
200
|
+
`${noticeLabel} ${status}: **${agent}**${taskInfo}`,
|
|
199
201
|
"",
|
|
200
202
|
displaySummary,
|
|
201
203
|
sessionLine ? "" : undefined,
|
|
@@ -7,7 +7,7 @@ import { resolveSubagentDepthPolicy } from "../../shared/types.ts";
|
|
|
7
7
|
import type { ChainStep } from "../../shared/settings.ts";
|
|
8
8
|
import type { ExecutionContextData, ResolvedExecutorDeps } from "./subagent-executor-types.ts";
|
|
9
9
|
import { wrapChainTasksForFork } from "./subagent-executor-input.ts";
|
|
10
|
-
import { createForegroundControlNotifier, maybeBuildForegroundIntercomReceipt, rememberForegroundRun, replaceForegroundRunChild } from "./subagent-executor-status.ts";
|
|
10
|
+
import { createForegroundControlNotifier, maybeBuildForegroundIntercomReceipt, notifyDetachedForegroundChildExit, rememberForegroundRun, replaceForegroundRunChild } from "./subagent-executor-status.ts";
|
|
11
11
|
|
|
12
12
|
export async function runChainPath(data: ExecutionContextData, deps: ResolvedExecutorDeps): Promise<import("../../shared/types.ts").SubagentToolResult> {
|
|
13
13
|
const {
|
|
@@ -64,7 +64,10 @@ export async function runChainPath(data: ExecutionContextData, deps: ResolvedExe
|
|
|
64
64
|
worktreeSetupHook: deps.config.worktreeSetupHook,
|
|
65
65
|
worktreeSetupHookTimeoutMs: deps.config.worktreeSetupHookTimeoutMs,
|
|
66
66
|
runSync: deps.runtime.runSync,
|
|
67
|
-
onDetachedExit: (index, result) =>
|
|
67
|
+
onDetachedExit: (index, result) => {
|
|
68
|
+
replaceForegroundRunChild(deps.state, runId, index, result);
|
|
69
|
+
notifyDetachedForegroundChildExit({ pi: deps.pi, runId, mode: "chain", index, result });
|
|
70
|
+
},
|
|
68
71
|
});
|
|
69
72
|
|
|
70
73
|
const chainDetails = chainResult.details ? compactForegroundDetails({ ...chainResult.details, runId }) : undefined;
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
findDuplicateParallelOutputPath,
|
|
44
44
|
resolveParallelTaskCwd,
|
|
45
45
|
} from "./subagent-executor-worktree.ts";
|
|
46
|
-
import { createForegroundControlNotifier, maybeBuildForegroundIntercomReceipt, rememberForegroundRun, replaceForegroundRunChild } from "./subagent-executor-status.ts";
|
|
46
|
+
import { createForegroundControlNotifier, maybeBuildForegroundIntercomReceipt, notifyDetachedForegroundChildExit, rememberForegroundRun, replaceForegroundRunChild } from "./subagent-executor-status.ts";
|
|
47
47
|
import { createDetachedCleanupBarrier } from "./detached-cleanup-barrier.ts";
|
|
48
48
|
|
|
49
49
|
export async function runParallelPath(data: ExecutionContextData, deps: ResolvedExecutorDeps): Promise<SubagentToolResult> {
|
|
@@ -171,6 +171,7 @@ export async function runParallelPath(data: ExecutionContextData, deps: Resolved
|
|
|
171
171
|
onDetachedExit: (index, result) => {
|
|
172
172
|
try {
|
|
173
173
|
replaceForegroundRunChild(deps.state, runId, index, result);
|
|
174
|
+
notifyDetachedForegroundChildExit({ pi: deps.pi, runId, mode: "parallel", index, totalTasks: tasks.length, result });
|
|
174
175
|
} finally {
|
|
175
176
|
detachedCleanup.recover(index);
|
|
176
177
|
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
type SubagentToolResult,
|
|
31
31
|
} from "../../shared/types.ts";
|
|
32
32
|
import type { ExecutionContextData, ResolvedExecutorDeps } from "./subagent-executor-types.ts";
|
|
33
|
-
import { createForegroundControlNotifier, maybeBuildForegroundIntercomReceipt, rememberForegroundRun, replaceForegroundRunChild } from "./subagent-executor-status.ts";
|
|
33
|
+
import { createForegroundControlNotifier, maybeBuildForegroundIntercomReceipt, notifyDetachedForegroundChildExit, rememberForegroundRun, replaceForegroundRunChild } from "./subagent-executor-status.ts";
|
|
34
34
|
|
|
35
35
|
function formatFailedSingleRunOutput(result: SingleResult, displayOutput: string): string {
|
|
36
36
|
const error = result.error || "Failed";
|
|
@@ -191,7 +191,10 @@ export async function runSinglePath(data: ExecutionContextData, deps: ResolvedEx
|
|
|
191
191
|
nestedRoute: foregroundControl?.nestedRoute,
|
|
192
192
|
onDetachedExit: (result) => {
|
|
193
193
|
cleanupTransientProgress(progressDir, artifactConfig.enabled);
|
|
194
|
-
if (result)
|
|
194
|
+
if (result) {
|
|
195
|
+
replaceForegroundRunChild(deps.state, runId, 0, result);
|
|
196
|
+
notifyDetachedForegroundChildExit({ pi: deps.pi, runId, mode: "single", index: 0, result });
|
|
197
|
+
}
|
|
195
198
|
},
|
|
196
199
|
index: 0,
|
|
197
200
|
modelOverride,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "../../intercom/result-intercom.ts";
|
|
11
11
|
import { formatNestedRunStatusLines } from "../shared/nested-render.ts";
|
|
12
12
|
import { formatControlIntercomMessage, formatControlNoticeMessage, shouldNotifyControlEvent } from "../shared/subagent-control.ts";
|
|
13
|
+
import { deliverLocalCompletionNotification } from "../background/completion-notification.ts";
|
|
13
14
|
import { updateForegroundNestedProjection } from "../shared/nested-events.ts";
|
|
14
15
|
import {
|
|
15
16
|
SUBAGENT_CONTROL_EVENT,
|
|
@@ -215,6 +216,39 @@ function resultSummaryForIntercom(result: SingleResult): string {
|
|
|
215
216
|
return output || result.error || "(no output)";
|
|
216
217
|
}
|
|
217
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Deliver a completion notice to the parent session for a foreground child
|
|
221
|
+
* that detached for intercom coordination and later exited. Foreground runs
|
|
222
|
+
* normally return their results inline in the tool result, but a detached
|
|
223
|
+
* child outlives that tool call, so without this the parent never learns the
|
|
224
|
+
* child finished (see run history: detached parallel runs completed silently).
|
|
225
|
+
* Reuses the async completion pipeline (dedupe, ordering barrier, triggerTurn).
|
|
226
|
+
*/
|
|
227
|
+
export function notifyDetachedForegroundChildExit(input: {
|
|
228
|
+
pi: ExtensionAPI;
|
|
229
|
+
runId: string;
|
|
230
|
+
mode: SubagentRunMode;
|
|
231
|
+
index: number;
|
|
232
|
+
totalTasks?: number;
|
|
233
|
+
result: SingleResult;
|
|
234
|
+
}): void {
|
|
235
|
+
const { pi, runId, index, result } = input;
|
|
236
|
+
void deliverLocalCompletionNotification(pi.events, {
|
|
237
|
+
id: runId,
|
|
238
|
+
runId,
|
|
239
|
+
agent: result.agent,
|
|
240
|
+
success: result.exitCode === 0 && !result.interrupted && !result.error,
|
|
241
|
+
summary: resultSummaryForIntercom(result),
|
|
242
|
+
exitCode: result.exitCode,
|
|
243
|
+
...(result.interrupted ? { state: "paused" } : {}),
|
|
244
|
+
timestamp: Date.now(),
|
|
245
|
+
...(result.progressSummary?.durationMs !== undefined ? { durationMs: result.progressSummary.durationMs } : {}),
|
|
246
|
+
...(result.sessionFile ? { sessionFile: result.sessionFile } : {}),
|
|
247
|
+
...(input.totalTasks !== undefined && input.totalTasks > 1 ? { taskIndex: index, totalTasks: input.totalTasks } : {}),
|
|
248
|
+
noticeLabel: "Detached subagent task",
|
|
249
|
+
}, `foreground-detach-${runId}-${index}`);
|
|
250
|
+
}
|
|
251
|
+
|
|
218
252
|
async function emitForegroundResultIntercom(input: {
|
|
219
253
|
pi: ExtensionAPI;
|
|
220
254
|
intercomBridge: IntercomBridgeState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
|
|
6
6
|
"contributors": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@bastani/atomic": "*",
|
|
34
|
-
"@earendil-works/pi-tui": "^0.
|
|
34
|
+
"@earendil-works/pi-tui": "^0.81.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@bastani/atomic": {
|
|
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.9.11-alpha.2] - 2026-07-21
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Fixed fresh-process workflow resume and completed-run inspection losing nested child-workflow and parallel stage hierarchy. DBOS stage checkpoints now retain owning-run and boundary topology, replay restores source parentage and child runs, graceful quit persists exact sub-30-second stage timing, completed runs persist and display accumulated run duration, and project-local workflows reloaded during a chat are rediscovered from their original invocation directory. The `/workflow resume` and `/workflows` picker rows also no longer display the redundant `N prompts` segment.
|
|
14
|
+
|
|
9
15
|
## [0.9.11-alpha.1] - 2026-07-20
|
|
10
16
|
|
|
11
17
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/workflows",
|
|
3
|
-
"version": "0.9.11-alpha.
|
|
3
|
+
"version": "0.9.11-alpha.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for multi-stage workflow authoring and execution.",
|
|
6
6
|
"contributors": [
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@bastani/atomic": "*",
|
|
86
|
-
"@earendil-works/pi-tui": "^0.
|
|
86
|
+
"@earendil-works/pi-tui": "^0.81.1"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@bastani/atomic": {
|
|
@@ -11,6 +11,7 @@ import type { DurableWorkflowBackend } from "./backend.js";
|
|
|
11
11
|
import type { DurableScope } from "./scoped-backend.js";
|
|
12
12
|
import { recordCheckpointDurably } from "./tool-primitive.js";
|
|
13
13
|
import { stageCheckpointWithOutput, type DurableCompletedStageCheckpoint } from "./stage-primitive.js";
|
|
14
|
+
import type { DurableStageCheckpoint } from "./types.js";
|
|
14
15
|
|
|
15
16
|
export function createDurableChildWorkflowPrimitive(input: {
|
|
16
17
|
readonly workflowId: string;
|
|
@@ -18,6 +19,7 @@ export function createDurableChildWorkflowPrimitive(input: {
|
|
|
18
19
|
readonly backend: DurableWorkflowBackend;
|
|
19
20
|
readonly nextReplayKey: (name: string) => string;
|
|
20
21
|
readonly recordCachedStage: (name: string, replayKey: string, checkpoint: DurableCompletedStageCheckpoint) => void;
|
|
22
|
+
readonly checkpointMetadata: (replayKey: string) => Partial<DurableStageCheckpoint>;
|
|
21
23
|
/**
|
|
22
24
|
* Publish the durable scope computed for the next child invocation so the
|
|
23
25
|
* child runner can consume it and route its internal side-effect checkpoints
|
|
@@ -66,6 +68,7 @@ export function createDurableChildWorkflowPrimitive(input: {
|
|
|
66
68
|
output: result as WorkflowSerializableValue,
|
|
67
69
|
completedAt: Date.now(),
|
|
68
70
|
result: result.status,
|
|
71
|
+
...input.checkpointMetadata(replayKey),
|
|
69
72
|
});
|
|
70
73
|
return result as WorkflowChildResult<TChildOutputs>;
|
|
71
74
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RunSnapshot, StageSnapshot } from "../shared/store-types.js";
|
|
2
|
-
import type { WorkflowInputValues } from "../shared/types.js";
|
|
2
|
+
import type { WorkflowChildResult, WorkflowInputValues, WorkflowOutputValues, WorkflowSerializableValue } from "../shared/types.js";
|
|
3
3
|
import { isReopenableSessionTranscript } from "../shared/session-transcript.js";
|
|
4
4
|
import type { DurableWorkflowBackend } from "./backend.js";
|
|
5
5
|
import {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type ResumableWorkflowEntry,
|
|
10
10
|
} from "./types.js";
|
|
11
11
|
import { resolveDurableEntry } from "./resume-runtime.js";
|
|
12
|
+
import { priorRunElapsedMs } from "./run-timing.js";
|
|
12
13
|
|
|
13
14
|
export type CompletedWorkflowResolution =
|
|
14
15
|
| { readonly kind: "found"; readonly entry: ResumableWorkflowEntry; readonly snapshot: RunSnapshot }
|
|
@@ -76,24 +77,52 @@ export function completedWorkflowSnapshot(
|
|
|
76
77
|
backend: DurableWorkflowBackend,
|
|
77
78
|
entry: ResumableWorkflowEntry,
|
|
78
79
|
): RunSnapshot | undefined {
|
|
80
|
+
const runs = completedWorkflowRunSnapshots(backend, entry);
|
|
81
|
+
const root = runs.find((run) => run.id === entry.workflowId);
|
|
82
|
+
if (root === undefined || !runs.some((run) => run.stages.some((stage) => stage.sessionFile !== undefined))) return undefined;
|
|
83
|
+
return root;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Rebuild the root plus every nested child run required by graph expansion. */
|
|
87
|
+
export function completedWorkflowRunSnapshots(
|
|
88
|
+
backend: DurableWorkflowBackend,
|
|
89
|
+
entry: ResumableWorkflowEntry,
|
|
90
|
+
): readonly RunSnapshot[] {
|
|
79
91
|
const handle = backend.getWorkflow(entry.workflowId);
|
|
80
|
-
if (handle === undefined || handle.status !== "completed") return
|
|
92
|
+
if (handle === undefined || handle.status !== "completed") return [];
|
|
81
93
|
const checkpoints = backend.listCheckpoints(entry.workflowId);
|
|
82
|
-
if (checkpoints.length === 0) return
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
if (checkpoints.length === 0) return [];
|
|
95
|
+
const runs = runSnapshotsFromCheckpoints(checkpoints, handle.workflowId, handle.name, handle.updatedAt)
|
|
96
|
+
.map((run) => ({ ...run, stages: run.stages.map(validatedStageTranscript) }));
|
|
97
|
+
const rootIndex = runs.findIndex((run) => run.id === handle.workflowId);
|
|
98
|
+
if (rootIndex < 0) return [];
|
|
99
|
+
const rootDuration = priorRunElapsedMs(backend, handle.workflowId)
|
|
100
|
+
?? Math.max(0, handle.updatedAt - handle.createdAt);
|
|
101
|
+
const root: RunSnapshot = {
|
|
102
|
+
...runs[rootIndex]!,
|
|
89
103
|
inputs: { ...handle.inputs } as WorkflowInputValues,
|
|
90
|
-
status: "completed",
|
|
91
|
-
stages,
|
|
92
104
|
startedAt: handle.createdAt,
|
|
93
105
|
endedAt: handle.updatedAt,
|
|
94
|
-
durationMs:
|
|
106
|
+
durationMs: rootDuration,
|
|
95
107
|
resumable: false,
|
|
96
108
|
};
|
|
109
|
+
return [root, ...runs.filter((_, index) => index !== rootIndex)];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Rebuild completed nested runs while a paused root is replaying cached boundaries. */
|
|
113
|
+
export function durableNestedRunSnapshots(
|
|
114
|
+
backend: DurableWorkflowBackend,
|
|
115
|
+
rootWorkflowId: string,
|
|
116
|
+
): readonly RunSnapshot[] {
|
|
117
|
+
const handle = backend.getWorkflow(rootWorkflowId);
|
|
118
|
+
if (handle === undefined) return [];
|
|
119
|
+
return runSnapshotsFromCheckpoints(
|
|
120
|
+
backend.listCheckpoints(rootWorkflowId),
|
|
121
|
+
rootWorkflowId,
|
|
122
|
+
handle.name,
|
|
123
|
+
handle.updatedAt,
|
|
124
|
+
false,
|
|
125
|
+
).filter((run) => run.id !== rootWorkflowId);
|
|
97
126
|
}
|
|
98
127
|
|
|
99
128
|
function validatedStageTranscript(stage: StageSnapshot): StageSnapshot {
|
|
@@ -104,19 +133,109 @@ function validatedStageTranscript(stage: StageSnapshot): StageSnapshot {
|
|
|
104
133
|
}
|
|
105
134
|
|
|
106
135
|
|
|
107
|
-
function
|
|
136
|
+
function runSnapshotsFromCheckpoints(
|
|
108
137
|
checkpoints: readonly DurableCheckpoint[],
|
|
138
|
+
rootRunId: string,
|
|
139
|
+
rootRunName: string,
|
|
109
140
|
fallbackCompletedAt: number,
|
|
110
|
-
|
|
141
|
+
strict = true,
|
|
142
|
+
): RunSnapshot[] {
|
|
111
143
|
const drafts = new Map<string, StageDraft>();
|
|
112
144
|
for (const checkpoint of checkpoints) {
|
|
113
145
|
if (checkpoint.kind !== "stage") continue;
|
|
114
146
|
const existing = drafts.get(checkpoint.replayKey);
|
|
115
147
|
drafts.set(checkpoint.replayKey, mergeStageDraft(existing, checkpoint));
|
|
116
148
|
}
|
|
117
|
-
const ordered = [...drafts.values()]
|
|
118
|
-
|
|
119
|
-
|
|
149
|
+
const ordered = [...drafts.values()]
|
|
150
|
+
.filter((draft) => !strict || draft.topology?.run === undefined || draft.endedAt !== undefined || draft.output !== undefined)
|
|
151
|
+
.sort((a, b) => a.firstCompletedAt - b.firstCompletedAt);
|
|
152
|
+
if (ordered.length === 0) return [syntheticRun(rootRunId, rootRunName, checkpoints.length, fallbackCompletedAt)];
|
|
153
|
+
|
|
154
|
+
const grouped = new Map<string, StageDraft[]>();
|
|
155
|
+
for (const draft of ordered) {
|
|
156
|
+
if (draft.topology?.version !== DURABLE_STAGE_TOPOLOGY_VERSION) {
|
|
157
|
+
if (strict) return [];
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const runId = draft.topology.run?.runId ?? rootRunId;
|
|
161
|
+
const group = grouped.get(runId) ?? [];
|
|
162
|
+
group.push(draft);
|
|
163
|
+
grouped.set(runId, group);
|
|
164
|
+
}
|
|
165
|
+
retainReachableRunGroups(grouped, rootRunId);
|
|
166
|
+
const idMaps = new Map<string, Map<string, string>>();
|
|
167
|
+
for (const [runId, runDrafts] of grouped) {
|
|
168
|
+
const ids = new Map<string, string>();
|
|
169
|
+
runDrafts.forEach((draft, index) => {
|
|
170
|
+
const sourceId = draft.topology!.stageId;
|
|
171
|
+
if (!ids.has(sourceId)) ids.set(sourceId, `completed-stage-${index + 1}`);
|
|
172
|
+
});
|
|
173
|
+
if (ids.size !== runDrafts.length) {
|
|
174
|
+
if (strict) return [];
|
|
175
|
+
grouped.delete(runId);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
idMaps.set(runId, ids);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const runs: RunSnapshot[] = [];
|
|
182
|
+
for (const [runId, runDrafts] of grouped) {
|
|
183
|
+
const ids = idMaps.get(runId)!;
|
|
184
|
+
if (runDrafts.some((draft) => draft.topology!.parentIds.some((parentId) => !ids.has(parentId)))) {
|
|
185
|
+
if (strict) return [];
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
const stages = runDrafts.map((draft) => stageSnapshotFromDraft(
|
|
189
|
+
draft,
|
|
190
|
+
ids.get(draft.topology!.stageId)!,
|
|
191
|
+
draft.topology!.parentIds.map((parentId) => ids.get(parentId)!),
|
|
192
|
+
));
|
|
193
|
+
const run = runDrafts.find((draft) => draft.topology?.run !== undefined)?.topology?.run;
|
|
194
|
+
const startedAt = Math.min(...stages.map((stage) => stage.startedAt ?? fallbackCompletedAt));
|
|
195
|
+
const endedAt = Math.max(...stages.map((stage) => stage.endedAt ?? fallbackCompletedAt));
|
|
196
|
+
const parentRunId = run?.parentRunId ?? rootRunId;
|
|
197
|
+
const boundarySourceId = grouped.get(parentRunId)?.find((draft) =>
|
|
198
|
+
workflowChildFromOutput(draft.output)?.runId === runId
|
|
199
|
+
)?.topology?.stageId;
|
|
200
|
+
const declaredParentStageId = run?.parentStageId === undefined
|
|
201
|
+
? undefined
|
|
202
|
+
: idMaps.get(parentRunId)?.get(run.parentStageId);
|
|
203
|
+
const parentStageId = declaredParentStageId
|
|
204
|
+
?? (boundarySourceId === undefined ? undefined : idMaps.get(parentRunId)?.get(boundarySourceId));
|
|
205
|
+
runs.push({
|
|
206
|
+
id: runId,
|
|
207
|
+
name: run?.runName ?? rootRunName,
|
|
208
|
+
inputs: {},
|
|
209
|
+
status: "completed",
|
|
210
|
+
stages,
|
|
211
|
+
startedAt,
|
|
212
|
+
endedAt,
|
|
213
|
+
durationMs: Math.max(0, endedAt - startedAt),
|
|
214
|
+
...(run?.parentRunId !== undefined ? { parentRunId: run.parentRunId } : {}),
|
|
215
|
+
...(parentStageId !== undefined ? { parentStageId } : {}),
|
|
216
|
+
...(run?.rootRunId !== undefined ? { rootRunId: run.rootRunId } : {}),
|
|
217
|
+
resumable: false,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return runs;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function retainReachableRunGroups(grouped: Map<string, StageDraft[]>, rootRunId: string): void {
|
|
224
|
+
const reachable = new Set([rootRunId]);
|
|
225
|
+
const pending = [rootRunId];
|
|
226
|
+
while (pending.length > 0) {
|
|
227
|
+
const drafts = grouped.get(pending.pop()!);
|
|
228
|
+
if (drafts === undefined) continue;
|
|
229
|
+
for (const draft of drafts) {
|
|
230
|
+
const childRunId = workflowChildFromOutput(draft.output)?.runId;
|
|
231
|
+
if (childRunId === undefined || reachable.has(childRunId) || !grouped.has(childRunId)) continue;
|
|
232
|
+
reachable.add(childRunId);
|
|
233
|
+
pending.push(childRunId);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
for (const runId of grouped.keys()) {
|
|
237
|
+
if (!reachable.has(runId)) grouped.delete(runId);
|
|
238
|
+
}
|
|
120
239
|
}
|
|
121
240
|
|
|
122
241
|
function mergeStageDraft(
|
|
@@ -138,10 +257,21 @@ function mergeStageDraft(
|
|
|
138
257
|
...valueOrExisting("fastMode", checkpoint, existing),
|
|
139
258
|
...valueOrExisting("attemptedModels", checkpoint, existing),
|
|
140
259
|
...valueOrExisting("modelAttempts", checkpoint, existing),
|
|
141
|
-
...
|
|
260
|
+
...preferredTopology(checkpoint, existing),
|
|
142
261
|
};
|
|
143
262
|
}
|
|
144
263
|
|
|
264
|
+
function preferredTopology(
|
|
265
|
+
checkpoint: DurableStageCheckpoint,
|
|
266
|
+
existing: StageDraft | undefined,
|
|
267
|
+
): Pick<StageDraft, "topology"> | object {
|
|
268
|
+
const current = checkpoint.topology;
|
|
269
|
+
const prior = existing?.topology;
|
|
270
|
+
if (current?.run !== undefined) return { topology: current };
|
|
271
|
+
if (prior?.run !== undefined) return { topology: prior };
|
|
272
|
+
return current !== undefined ? { topology: current } : prior !== undefined ? { topology: prior } : {};
|
|
273
|
+
}
|
|
274
|
+
|
|
145
275
|
function valueOrExisting<
|
|
146
276
|
K extends keyof Omit<StageDraft, "replayKey" | "name" | "firstCompletedAt">
|
|
147
277
|
>(key: K, checkpoint: DurableStageCheckpoint, existing: StageDraft | undefined): Pick<StageDraft, K> | object {
|
|
@@ -151,21 +281,25 @@ function valueOrExisting<
|
|
|
151
281
|
return existingValue === undefined ? {} : { [key]: existingValue } as Pick<StageDraft, K>;
|
|
152
282
|
}
|
|
153
283
|
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
));
|
|
284
|
+
function workflowChildFromOutput(output: WorkflowSerializableValue | undefined): StageSnapshot["workflowChild"] | undefined {
|
|
285
|
+
if (!isWorkflowChildResult(output)) return undefined;
|
|
286
|
+
return {
|
|
287
|
+
alias: output.workflow,
|
|
288
|
+
workflow: output.workflow,
|
|
289
|
+
runId: output.runId,
|
|
290
|
+
status: output.status,
|
|
291
|
+
...(output.exited !== undefined ? { exited: output.exited } : {}),
|
|
292
|
+
outputs: output.outputs,
|
|
293
|
+
...(typeof output.exitReason === "string" ? { exitReason: output.exitReason } : {}),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function isWorkflowChildResult(value: WorkflowSerializableValue | undefined): value is WorkflowChildResult<WorkflowOutputValues> {
|
|
298
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
299
|
+
const item = value as Record<string, WorkflowSerializableValue | undefined>;
|
|
300
|
+
return typeof item["workflow"] === "string" && typeof item["runId"] === "string"
|
|
301
|
+
&& typeof item["status"] === "string" && typeof item["outputs"] === "object"
|
|
302
|
+
&& item["outputs"] !== null && !Array.isArray(item["outputs"]);
|
|
169
303
|
}
|
|
170
304
|
|
|
171
305
|
function stageSnapshotFromDraft(
|
|
@@ -187,6 +321,7 @@ function stageSnapshotFromDraft(
|
|
|
187
321
|
replayKey: draft.replayKey,
|
|
188
322
|
toolEvents: [],
|
|
189
323
|
attachable: false,
|
|
324
|
+
...(workflowChildFromOutput(draft.output) !== undefined ? { workflowChild: workflowChildFromOutput(draft.output) } : {}),
|
|
190
325
|
...(draft.sessionId !== undefined ? { sessionId: draft.sessionId } : {}),
|
|
191
326
|
...(draft.sessionFile !== undefined ? { sessionFile: draft.sessionFile } : {}),
|
|
192
327
|
...(draft.model !== undefined ? { model: draft.model } : {}),
|
|
@@ -202,6 +337,20 @@ function stageResult(draft: StageDraft): string | undefined {
|
|
|
202
337
|
return typeof draft.output === "string" ? draft.output : JSON.stringify(draft.output);
|
|
203
338
|
}
|
|
204
339
|
|
|
340
|
+
function syntheticRun(runId: string, runName: string, checkpointCount: number, completedAt: number): RunSnapshot {
|
|
341
|
+
return {
|
|
342
|
+
id: runId,
|
|
343
|
+
name: runName,
|
|
344
|
+
inputs: {},
|
|
345
|
+
status: "completed",
|
|
346
|
+
stages: [syntheticCheckpointStage(checkpointCount, completedAt)],
|
|
347
|
+
startedAt: completedAt,
|
|
348
|
+
endedAt: completedAt,
|
|
349
|
+
durationMs: 0,
|
|
350
|
+
resumable: false,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
205
354
|
function syntheticCheckpointStage(checkpointCount: number, completedAt: number): StageSnapshot {
|
|
206
355
|
return {
|
|
207
356
|
id: "completed-checkpoints",
|