@bastani/atomic 0.9.38-alpha.1 → 0.9.38-alpha.11
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 +141 -0
- package/README.md +8 -6
- package/dist/builtin/intercom/CHANGELOG.md +15 -0
- package/dist/builtin/intercom/broker/broker.ts +6 -4
- package/dist/builtin/intercom/broker/delivered-message-cache.ts +50 -4
- package/dist/builtin/intercom/broker/send-handler.ts +6 -4
- package/dist/builtin/intercom/index.bundle.mjs +89 -40
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +12 -0
- package/dist/builtin/subagents/README.md +9 -4
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +163 -158
- package/dist/builtin/web-access/CHANGELOG.md +7 -0
- package/dist/builtin/web-access/index.bundle.mjs +53 -15
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +91 -0
- package/dist/builtin/workflows/README.md +5 -10
- package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
- package/dist/builtin/workflows/builtin/{chunk-94f8zfz1.js → chunk-454hz1qt.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-wf876n16.js → chunk-4bwtzyjq.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-kb7s3gx2.js → chunk-5eh0brtd.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-nkj4qhj6.js → chunk-85mx6wcf.js} +7 -7
- package/dist/builtin/workflows/builtin/{chunk-3n2bnz64.js → chunk-8kkv04hz.js} +16 -16
- package/dist/builtin/workflows/builtin/chunk-8x61e0s7.js +3148 -0
- package/dist/builtin/workflows/builtin/{chunk-r97ndfvt.js → chunk-bjva9j5k.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-a1ar035d.js → chunk-qdd897wm.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-gyjck9z8.js → chunk-qjqn389g.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-632fxeb8.js → chunk-x0vvjyzg.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-ad83gc5p.js → chunk-y45tkftg.js} +11 -18
- package/dist/builtin/workflows/builtin/classify-and-act.js +2 -2
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +2 -2
- package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
- package/dist/builtin/workflows/builtin/goal.js +3 -3
- package/dist/builtin/workflows/builtin/index.js +11 -11
- package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
- package/dist/builtin/workflows/builtin/open-claude-design.js +2 -2
- package/dist/builtin/workflows/builtin/ralph.js +3 -3
- package/dist/builtin/workflows/builtin/tournament.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/authoring.d.ts +9 -12
- package/dist/builtin/workflows/src/durable/journal/conformance.d.ts +12 -0
- package/dist/builtin/workflows/src/durable/journal/internal.d.ts +1 -0
- package/dist/builtin/workflows/src/durable/journal/lease-expiry.d.ts +2 -0
- package/dist/builtin/workflows/src/durable/journal/legacy-journal-tables.d.ts +42 -0
- package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +35 -0
- package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +32 -0
- package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +48 -0
- package/dist/builtin/workflows/src/durable/journal/sqlite-run-journal.d.ts +7 -0
- package/dist/builtin/workflows/src/durable/journal/types.d.ts +95 -0
- package/dist/builtin/workflows/src/durable/journal/values.d.ts +5 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +29515 -64826
- package/dist/builtin/workflows/src/index.js +10767 -45885
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +8 -14
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +4 -20
- package/dist/bun/split-loader.js +0 -13
- package/dist/bun/split-loader.js.map +1 -1
- package/dist/cli/args.d.ts +3 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +35 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/session-picker.d.ts +2 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +5 -5
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +2 -2
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +2 -3
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +18 -10
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-boundaries.d.ts +6 -6
- package/dist/core/agent-session-boundaries.d.ts.map +1 -1
- package/dist/core/agent-session-boundaries.js +22 -22
- package/dist/core/agent-session-boundaries.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +3 -2
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
- package/dist/core/agent-session-custom-message-commit.js +10 -12
- package/dist/core/agent-session-custom-message-commit.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +26 -14
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.js +1 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +2 -2
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +79 -59
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +2 -2
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +17 -8
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +15 -15
- 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 +59 -42
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts +4 -4
- package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.js +16 -17
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +63 -23
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +17 -15
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +7 -8
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +88 -100
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +2 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-summary.js +1 -1
- package/dist/core/agent-session-summary.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +8 -7
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -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-backends.d.ts +2 -0
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.js +12 -0
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +46 -12
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/cache-warmer.js +1 -1
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +3 -5
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +6 -10
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +1 -0
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +4 -1
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.d.ts +2 -1
- package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.js +6 -8
- package/dist/core/compaction/pi-summary-fallback.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +32 -7
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/export-html/index.js +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template-js/entries-navigation.js +1 -1
- package/dist/core/export-html/template.js +1 -1
- package/dist/core/extensions/api-types.d.ts +12 -12
- 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 +4 -2
- 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/extension-work.d.ts +1 -0
- package/dist/core/extensions/extension-work.d.ts.map +1 -1
- package/dist/core/extensions/extension-work.js +5 -1
- package/dist/core/extensions/extension-work.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 +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 +40 -42
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +6 -2
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/loader-rollback.d.ts.map +1 -1
- package/dist/core/extensions/loader-rollback.js +1 -0
- package/dist/core/extensions/loader-rollback.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +1 -0
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +1 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +10 -3
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner-handlers.d.ts +1 -1
- package/dist/core/extensions/runner-handlers.d.ts.map +1 -1
- package/dist/core/extensions/runner-handlers.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 +28 -12
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +7 -7
- 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/session-events.d.ts +5 -5
- package/dist/core/extensions/session-events.d.ts.map +1 -1
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/extensions/workflow-events.d.ts +2 -0
- package/dist/core/extensions/workflow-events.d.ts.map +1 -1
- package/dist/core/extensions/workflow-events.js.map +1 -1
- package/dist/core/extensions/workflow-run-control.d.ts +3 -3
- package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control.js +4 -4
- package/dist/core/extensions/workflow-run-control.js.map +1 -1
- package/dist/core/fast-model-routing.d.ts.map +1 -1
- package/dist/core/fast-model-routing.js +1 -0
- package/dist/core/fast-model-routing.js.map +1 -1
- package/dist/core/intercom-runtime-group.js +1 -1
- package/dist/core/intercom-runtime-group.js.map +1 -1
- package/dist/core/model-config.d.ts +765 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +46 -24
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +5 -5
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts +9 -2
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +121 -10
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime.d.ts +6 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +103 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-attribution.js +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/queued-input-admission.d.ts +20 -0
- package/dist/core/queued-input-admission.d.ts.map +1 -0
- package/dist/core/queued-input-admission.js +55 -0
- package/dist/core/queued-input-admission.js.map +1 -0
- package/dist/core/resource-loader-reload.js +1 -1
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +1 -1
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +1 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +3 -0
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk-types.d.ts +4 -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 +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +145 -94
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-lifecycle-work.d.ts +3 -0
- package/dist/core/session-lifecycle-work.d.ts.map +1 -1
- package/dist/core/session-lifecycle-work.js +2 -0
- package/dist/core/session-lifecycle-work.js.map +1 -1
- package/dist/core/session-manager-archive.d.ts +2 -16
- package/dist/core/session-manager-archive.d.ts.map +1 -1
- package/dist/core/session-manager-archive.js +8 -109
- package/dist/core/session-manager-archive.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +53 -51
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +549 -315
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +5 -10
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-errors.d.ts +10 -0
- package/dist/core/session-manager-errors.d.ts.map +1 -0
- package/dist/core/session-manager-errors.js +27 -0
- package/dist/core/session-manager-errors.js.map +1 -0
- package/dist/core/session-manager-list.d.ts +1 -0
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +23 -25
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts +3 -12
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +60 -77
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +4 -12
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js +2 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager-validation.d.ts +3 -0
- package/dist/core/session-manager-validation.d.ts.map +1 -1
- package/dist/core/session-manager-validation.js +18 -1
- package/dist/core/session-manager-validation.js.map +1 -1
- package/dist/core/session-manager.d.ts +3 -3
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-mutation-queue.d.ts +3 -0
- package/dist/core/session-mutation-queue.d.ts.map +1 -0
- package/dist/core/session-mutation-queue.js +14 -0
- package/dist/core/session-mutation-queue.js.map +1 -0
- package/dist/core/session-resume-args.d.ts +4 -0
- package/dist/core/session-resume-args.d.ts.map +1 -0
- package/dist/core/session-resume-args.js +9 -0
- package/dist/core/session-resume-args.js.map +1 -0
- package/dist/core/session-storage.d.ts +26 -0
- package/dist/core/session-storage.d.ts.map +1 -0
- package/dist/core/session-storage.js +171 -0
- package/dist/core/session-storage.js.map +1 -0
- package/dist/core/session-store-list.d.ts +4 -0
- package/dist/core/session-store-list.d.ts.map +1 -0
- package/dist/core/session-store-list.js +28 -0
- package/dist/core/session-store-list.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts +0 -1
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +0 -5
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-merge.d.ts.map +1 -1
- package/dist/core/settings-merge.js +8 -2
- package/dist/core/settings-merge.js.map +1 -1
- package/dist/core/settings-schema.d.ts +76 -6
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +29 -20
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/storage/database.d.ts +21 -0
- package/dist/core/storage/database.d.ts.map +1 -0
- package/dist/core/storage/database.js +2 -0
- package/dist/core/storage/database.js.map +1 -0
- package/dist/core/storage/errors.d.ts +64 -0
- package/dist/core/storage/errors.d.ts.map +1 -0
- package/dist/core/storage/errors.js +103 -0
- package/dist/core/storage/errors.js.map +1 -0
- package/dist/core/storage/index.d.ts +10 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +8 -0
- package/dist/core/storage/index.js.map +1 -0
- package/dist/core/storage/node-sqlite.d.ts +7 -0
- package/dist/core/storage/node-sqlite.d.ts.map +1 -0
- package/dist/core/storage/node-sqlite.js +202 -0
- package/dist/core/storage/node-sqlite.js.map +1 -0
- package/dist/core/storage/prefix.d.ts +5 -0
- package/dist/core/storage/prefix.d.ts.map +1 -0
- package/dist/core/storage/prefix.js +15 -0
- package/dist/core/storage/prefix.js.map +1 -0
- package/dist/core/storage/provider.d.ts +58 -0
- package/dist/core/storage/provider.d.ts.map +1 -0
- package/dist/core/storage/provider.js +243 -0
- package/dist/core/storage/provider.js.map +1 -0
- package/dist/core/storage/run-journal.d.ts +93 -0
- package/dist/core/storage/run-journal.d.ts.map +1 -0
- package/dist/core/storage/run-journal.js +15 -0
- package/dist/core/storage/run-journal.js.map +1 -0
- package/dist/core/storage/schema.d.ts +3 -0
- package/dist/core/storage/schema.d.ts.map +1 -0
- package/dist/core/storage/schema.js +6 -0
- package/dist/core/storage/schema.js.map +1 -0
- package/dist/core/storage/selection.d.ts +16 -0
- package/dist/core/storage/selection.d.ts.map +1 -0
- package/dist/core/storage/selection.js +87 -0
- package/dist/core/storage/selection.js.map +1 -0
- package/dist/core/storage/session/conformance.d.ts +12 -0
- package/dist/core/storage/session/conformance.d.ts.map +1 -0
- package/dist/core/storage/session/conformance.js +674 -0
- package/dist/core/storage/session/conformance.js.map +1 -0
- package/dist/core/storage/session/entry-structure.d.ts +4 -0
- package/dist/core/storage/session/entry-structure.d.ts.map +1 -0
- package/dist/core/storage/session/entry-structure.js +83 -0
- package/dist/core/storage/session/entry-structure.js.map +1 -0
- package/dist/core/storage/session/errors.d.ts +54 -0
- package/dist/core/storage/session/errors.d.ts.map +1 -0
- package/dist/core/storage/session/errors.js +95 -0
- package/dist/core/storage/session/errors.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts +72 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.js +564 -0
- package/dist/core/storage/session/jsonl-session-store.js.map +1 -0
- package/dist/core/storage/session/legacy-format.d.ts +20 -0
- package/dist/core/storage/session/legacy-format.d.ts.map +1 -0
- package/dist/core/storage/session/legacy-format.js +89 -0
- package/dist/core/storage/session/legacy-format.js.map +1 -0
- package/dist/core/storage/session/legacy-session-store.d.ts +63 -0
- package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/legacy-session-store.js +239 -0
- package/dist/core/storage/session/legacy-session-store.js.map +1 -0
- package/dist/core/storage/session/legacy-session-summary.d.ts +11 -0
- package/dist/core/storage/session/legacy-session-summary.d.ts.map +1 -0
- package/dist/core/storage/session/legacy-session-summary.js +103 -0
- package/dist/core/storage/session/legacy-session-summary.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.d.ts +33 -0
- package/dist/core/storage/session/memory-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/memory-session-store.js +120 -0
- package/dist/core/storage/session/memory-session-store.js.map +1 -0
- package/dist/core/storage/session/scratch-directory.d.ts +2 -0
- package/dist/core/storage/session/scratch-directory.d.ts.map +1 -0
- package/dist/core/storage/session/scratch-directory.js +5 -0
- package/dist/core/storage/session/scratch-directory.js.map +1 -0
- package/dist/core/storage/session/session-summary.d.ts +24 -0
- package/dist/core/storage/session/session-summary.d.ts.map +1 -0
- package/dist/core/storage/session/session-summary.js +79 -0
- package/dist/core/storage/session/session-summary.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.d.ts +49 -0
- package/dist/core/storage/session/sql-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/sql-session-store.js +246 -0
- package/dist/core/storage/session/sql-session-store.js.map +1 -0
- package/dist/core/storage/session/types.d.ts +72 -0
- package/dist/core/storage/session/types.d.ts.map +1 -0
- package/dist/core/storage/session/types.js +2 -0
- package/dist/core/storage/session/types.js.map +1 -0
- package/dist/core/storage/session/validation.d.ts +7 -0
- package/dist/core/storage/session/validation.d.ts.map +1 -0
- package/dist/core/storage/session/validation.js +47 -0
- package/dist/core/storage/session/validation.js.map +1 -0
- package/dist/core/storage/testing.d.ts +15 -0
- package/dist/core/storage/testing.d.ts.map +1 -0
- package/dist/core/storage/testing.js +309 -0
- package/dist/core/storage/testing.js.map +1 -0
- package/dist/core/tasks/completion.d.ts.map +1 -1
- package/dist/core/tasks/completion.js +2 -4
- package/dist/core/tasks/completion.js.map +1 -1
- package/dist/core/tools/bash-session-environment.d.ts.map +1 -1
- package/dist/core/tools/bash-session-environment.js +0 -2
- package/dist/core/tools/bash-session-environment.js.map +1 -1
- package/dist/core/tools/read-url.d.ts.map +1 -1
- package/dist/core/tools/read-url.js +6 -1
- package/dist/core/tools/read-url.js.map +1 -1
- package/dist/core/tools/todos-model.js +3 -3
- package/dist/core/tools/todos-model.js.map +1 -1
- package/dist/core/tools/todos-mutations.js +2 -2
- package/dist/core/tools/todos-mutations.js.map +1 -1
- package/dist/core/tools/todos-render.js +1 -1
- package/dist/core/tools/todos-render.js.map +1 -1
- package/dist/core/tools/todos-storage.js +2 -2
- package/dist/core/tools/todos-storage.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +14 -1
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +6 -8
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/extensions/mcp/client/transports/streamable-http.js +9 -8
- package/dist/extensions/mcp/client/transports/streamable-http.js.map +1 -1
- package/dist/extensions/mcp/index.js +1 -1
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +6 -1
- package/dist/extensions/mcp/tools.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 +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/main-session.d.ts +12 -2
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +151 -53
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +97 -42
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts +4 -0
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +104 -30
- package/dist/modes/interactive/components/chat-session-host-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 +1 -0
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +4 -0
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +4 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +3 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +18 -5
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +2 -2
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.js +1 -1
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +9 -5
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-delete.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector-delete.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-delete.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts +12 -9
- package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js +27 -25
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +8 -4
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +31 -21
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-component.d.ts +5 -1
- package/dist/modes/interactive/components/tree-selector-component.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-component.js +20 -3
- package/dist/modes/interactive/components/tree-selector-component.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +2 -2
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.js +2 -2
- package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +2 -0
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +14 -6
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +6 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +7 -3
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +5 -5
- 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-routing.js +12 -7
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +8 -2
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +94 -70
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +2 -2
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +38 -14
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +7 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +5 -3
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +1 -0
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +9 -2
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +4 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +45 -6
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js +8 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-args.js +11 -4
- package/dist/modes/interactive-engine/engine-args.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +2 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +9 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +99 -74
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +4 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +39 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/rpc/rpc-bash-request-owners.js +1 -1
- package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +2 -2
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +2 -2
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +20 -7
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +4 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +6 -2
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +12 -9
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +2 -2
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +10 -0
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/modes/rpc/rpc-terminal-drain.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-terminal-drain.js +11 -2
- package/dist/modes/rpc/rpc-terminal-drain.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +6 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/canonical-path.d.ts +5 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +26 -0
- package/dist/utils/canonical-path.js.map +1 -0
- package/dist/utils/paths.d.ts +1 -7
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +1 -15
- package/dist/utils/paths.js.map +1 -1
- package/docs/codemode.md +2 -0
- package/docs/compaction.md +2 -2
- package/docs/custom-provider/oauth.md +2 -2
- package/docs/custom-provider/override.md +3 -3
- package/docs/custom-provider/registration.md +7 -7
- package/docs/custom-provider/streaming.md +1 -1
- package/docs/custom-provider.md +5 -5
- package/docs/docs.json +7 -2
- package/docs/environment-variables.md +10 -2
- package/docs/extensions/api-reference.md +40 -19
- package/docs/extensions/authoring.md +1 -1
- package/docs/extensions/events.md +12 -8
- package/docs/extensions.md +2 -2
- package/docs/getting-started/installation.md +2 -4
- package/docs/json.md +1 -1
- package/docs/llama-cpp.md +94 -1
- package/docs/models/reference.md +2 -0
- package/docs/models-configuration.md +206 -0
- package/docs/models.md +11 -1
- package/docs/packages/authoring.md +1 -1
- package/docs/providers.md +9 -5
- package/docs/quickstart.md +2 -1
- package/docs/reference/cli.md +7 -3
- package/docs/rpc/protocol.md +10 -4
- package/docs/sdk/reference.md +16 -14
- package/docs/sdk/web-server.md +6 -7
- package/docs/sdk.md +67 -27
- package/docs/session-format.md +35 -34
- package/docs/sessions.md +52 -17
- package/docs/settings.md +35 -22
- package/docs/storage.md +387 -0
- package/docs/subagents.md +19 -6
- package/docs/usage.md +5 -2
- package/docs/workflows/api-reference.md +88 -62
- package/docs/workflows/authoring.md +2 -1
- package/docs/workflows/operations.md +32 -174
- package/docs/workflows/reliable-design.md +17 -17
- package/examples/extensions/bookmark.ts +2 -2
- package/examples/extensions/handoff.ts +2 -2
- package/examples/extensions/plan-mode/index.ts +15 -13
- package/examples/extensions/preset.ts +8 -8
- package/examples/extensions/session-name.ts +1 -1
- package/examples/extensions/snake.ts +3 -1
- package/examples/extensions/space-invaders.ts +3 -1
- package/examples/extensions/tic-tac-toe.ts +80 -80
- package/examples/sdk/11-sessions.ts +5 -5
- package/examples/sdk/13-session-runtime.ts +7 -7
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +53 -469
- package/package.json +17 -9
- package/schemas/models.schema.json +62 -29
- package/schemas/settings.schema.json +138 -27
- package/dist/builtin/workflows/builtin/chunk-x6az1sxp.js +0 -8
- package/dist/builtin/workflows/builtin/chunk-ymwq372z.js +0 -11609
- package/dist/core/session-manager-migrations.d.ts +0 -11
- package/dist/core/session-manager-migrations.d.ts.map +0 -1
- package/dist/core/session-manager-migrations.js +0 -80
- package/dist/core/session-manager-migrations.js.map +0 -1
- package/docs/nvidia-rtx-llama-cpp.md +0 -101
|
@@ -108,7 +108,7 @@ The workflow tool action surface is:
|
|
|
108
108
|
- prompt response: `answer`; run control: `pause`, `quit`, `resume`; free-form stage communication: ordinary Intercom `send`/live `ask` to `workflow:<rootRunId>/<segment>[/<segment>...]` path targets, including `*` and `**` globs
|
|
109
109
|
- rediscovery: `reload`
|
|
110
110
|
|
|
111
|
-
Every registered `workflow` tool call has
|
|
111
|
+
Every registered `workflow` tool call has a hard 150-second wall-clock deadline at the public tool boundary. It covers request handling through the returned result; for background `run` and `resume`, it covers startup and acknowledgement, not the workflow execution that continues afterward. A deadline returns one structured result:
|
|
112
112
|
|
|
113
113
|
```json
|
|
114
114
|
{
|
|
@@ -125,9 +125,9 @@ Expiry aborts the request operation signal so work that supports cancellation ca
|
|
|
125
125
|
|
|
126
126
|
Explicit user interruption is different from the request deadline. Before startup acknowledgement, interrupting a `run` tool call cancels its initialization owner, records an allocated root as locally `killed`, and prevents delayed setup from starting workflow code. An already-aborted request starts no action. Interrupted resume preparation releases a claim it has acquired instead of dispatching later. After startup acknowledgement, the workflow is detached: aborting the original caller does not stop it; use run-level controls.
|
|
127
127
|
|
|
128
|
-
Cancellation does not undo
|
|
128
|
+
Cancellation does not undo committed journal writes or external effects. Inspect status and external effects before retrying an interrupted mutation. A request timeout does not cancel an already accepted detached launch.
|
|
129
129
|
|
|
130
|
-
Run-level `quit`
|
|
130
|
+
Run-level `quit` preserves eligible checkpointed work as a paused run instead of cancelling its durable record. Inspect `/workflow status <run-id>` if it reports a storage error; local suspension alone is not proof that the journal saved the pause.
|
|
131
131
|
|
|
132
132
|
From interactive chat, named workflow launches run in the background so the parent chat stays available. Run `/workflow connect <run>` to see agents working and chat with and steer each stage. Inspection, prompt-response, and control calls (`status`, `stages`, `stage`, `transcript`, `answer`, `pause`, `resume`, `quit`) remain available while work runs.
|
|
133
133
|
|
|
@@ -288,7 +288,7 @@ workflow({ action: "reload", reason: "added team workflow" })
|
|
|
288
288
|
Control behavior:
|
|
289
289
|
|
|
290
290
|
- `runId` accepts the full UUID or a unique 8-character hexadecimal prefix for lifecycle and inspection actions, including `status`. Status lists and run pickers show top-level user-launched workflows; nested child runs remain part of the expanded parent graph.
|
|
291
|
-
- `status`, `stages`, `stage`, and `transcript` with
|
|
291
|
+
- `status`, `stages`, `stage`, and `transcript` with a full `runId` use the session store, then read the journal if the run is absent locally. Inspection never claims ownership or executes workflow code. A running root with an expired lease appears as `crashed`; a live foreign lease remains protected.
|
|
292
292
|
- `status` without `runId` lists every top-level run in the session with a concise per-run summary: the full run id, workflow name, run status, started/ended timing with pause-adjusted elapsed time, currently active stages, and awaiting-input details (count plus the stage, prompt id, kind, and message for each pending human prompt). In-flight runs are listed first. The summaries carry the exact identifiers that `answer`, `pause`, `resume`, and `quit` accept, so an orchestrating agent can list runs and act on them directly.
|
|
293
293
|
- `statusFilter` narrows the `status` run listing: run statuses (`pending`, `running`, `paused`, `blocked`, `completed`, `failed`, `skipped`, `cancelled`, `killed`) match runs directly, `awaiting_input` selects runs with at least one stage awaiting input or pending human prompt, and `all` (the default) includes everything.
|
|
294
294
|
- `format: "json"` on data-bearing inspection actions (`status`, `stages`, `stage`, `transcript`) returns the full structured result; the default text output for `status` is the concise per-run summary list.
|
|
@@ -311,7 +311,7 @@ Control behavior:
|
|
|
311
311
|
- A whole-run executor-only pause also holds already-live owned child workflows, including children with no tracked node yet. Resume persists the root's running transition before releasing those child executors; a child-scoped control leaves sibling workflows alone.
|
|
312
312
|
- Live executor resume does not require a checkpoint. Cross-process resume still requires durable checkpoint or pending-prompt progress: losing a zero-progress live owner cannot reconstruct its JavaScript continuation. Cancelling the original startup request before acknowledgement remains terminal cancellation, not this live pause.
|
|
313
313
|
- `resume` can target a live paused stage with `stageId`; the target may be an exact stage id or an exact stage name. `message` is forwarded to paused work. Durable/cross-process resume is whole-run only and refuses a stage selector before dispatch rather than resuming the entire root. For a live interrupted streaming prompt, Atomic preserves the existing prompt loop without duplicating the user message and injects `Continue where you left off. If you believe you are finished with your original task (or a redefined task if the user told you), stop.` when required before normal readiness-gate completion. For a paused stage that was idle waiting for a new stage-chat turn, a non-empty message resumes the stage and starts exactly one fresh prompt containing that message; an empty resume releases the pause without creating a prompt.
|
|
314
|
-
- An explicit workflow-tool `resume` target absent locally triggers
|
|
314
|
+
- An explicit workflow-tool `resume` target absent locally triggers journal discovery. Prefixes require successful discovery before selecting a unique UUID; discovery failure cannot select a local prefix match. Malformed targets are rejected before lookup. Ordinary `status` listing remains session-local.
|
|
315
315
|
- Exact-id durable inspection is separate from resume. `status`, `stages`, `stage`, and `transcript` may hydrate one missing-local root for read-only inspection, but they never claim it or execute replay. Only an explicit `resume` action enters the claim-and-dispatch path.
|
|
316
316
|
- Run-level `quit` gracefully pauses in-flight work and preserves eligible checkpointed runs for `/workflow resume`. Runs waiting during initialization or between nodes are also controllable, even with no active stage or tool. An executor-only quit retires the owner (including one already paused); without usable durable progress it is nonresumable and offers no resume hint.
|
|
317
317
|
- `reload` refreshes discovered workflow resources in-process; the optional `reason` is echoed in the result.
|
|
@@ -338,7 +338,7 @@ Pause holds the live executor, while quit retires it at a durability boundary. N
|
|
|
338
338
|
|
|
339
339
|
Quit stops admitting tool calls, cancels owned in-flight calls, and waits a bounded time for cleanup. The result lists `cancelledTools` and any `abandonedTools` with their owning `{runId, nodeId}`. An abandoned callback may still have external effects. Inspect those effects before resuming; unfinished callbacks run again, while completed checkpoints replay.
|
|
340
340
|
|
|
341
|
-
If the
|
|
341
|
+
If the journal pause cannot be saved, the run remains locally paused. Preserve the run ID, restore storage access, and inspect status. Retrying quit can save the pause; resume retries the running transition before releasing the executor. Existing checkpoints remain available, but a failed write does not create durable progress.
|
|
342
342
|
|
|
343
343
|
Catching a tool cancellation cannot turn whole-run quit into completion. To abort one tool and continue the workflow, target the tool node instead.
|
|
344
344
|
|
|
@@ -458,145 +458,33 @@ The readiness prompt can be answered in the attached stage UI or with `workflow(
|
|
|
458
458
|
|
|
459
459
|
## Durable Workflows and Cross-Session Resume
|
|
460
460
|
|
|
461
|
-
Atomic workflows
|
|
461
|
+
Atomic workflows persist runs in a SQLite journal. It opens on the first workflow action and commits registrations, checkpoints, and control transitions before reporting them as durable. The default file is `~/.atomic/workflows/journal.sqlite`; set `ATOMIC_WORKFLOW_JOURNAL_PATH` before starting Atomic to select another file. Keep a journal file on durable local storage. To share runs across machines, select a remote SQLite-compatible database through a [storage adapter](/storage#sharing-storage-across-hosts) rather than placing the file on a network filesystem. Storage failures stop the action rather than selecting another store.
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
Select process-local memory explicitly with `workflows.journal.memory: true` or SDK `RunOpts.journal: { memory: true }`. It supports checkpoint replay within the process but not recovery after exit. See [Choosing the durable backend](/workflows/api-reference#choosing-the-durable-backend).
|
|
464
464
|
|
|
465
|
-
|
|
465
|
+
### Storage failures and recovery
|
|
466
466
|
|
|
467
|
-
|
|
467
|
+
Preserve the journal and full run ID when storage fails. Check the reported file, directory permissions, available space, and filesystem health. Restore access, inspect `/workflow status <full-run-uuid>`, and explicitly resume an eligible run. Do not delete the journal to bypass an error. A failed pause leaves the local executor paused; resume retries the durable running transition before releasing it. If that write also fails, the executor stays paused and the error is reported.
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
If recovery reports `Workflow definition not found`, restore the matching definition, run `/workflow reload`, and retry with the same full run ID. Changing a definition or its call order can invalidate checkpoint replay.
|
|
470
470
|
|
|
471
|
-
|
|
471
|
+
### Multiple sessions
|
|
472
472
|
|
|
473
|
-
|
|
473
|
+
A run with a live journal lease cannot be claimed by another executor, even when a long-running tool has not updated its progress. After a process crashes and its lease expires (about two minutes without renewal), inspection reports `crashed`. Concurrent resume attempts admit one executor. The same rules apply across machines that share a journal database; see [Sharing storage across hosts](/storage#sharing-storage-across-hosts).
|
|
474
474
|
|
|
475
|
-
|
|
475
|
+
SDK recovery requires the original working directory and journal. `session.workflows.getRun(runId)` and `getStages(runId)` inspect saved state without taking ownership; `resume(runId)` explicitly claims eligible work. Save the full UUID. An owning session can also release checkpointed paused runs through `await session.dispose()` or a session switch, allowing another authorized session to adopt them. See [SDK run control](/sdk#workflow-run-control).
|
|
476
476
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
If registration times out or reports an unavailable database while the run is paused, restore the existing database without resetting data, then resume that same run in the same Atomic process. Resume retries registration with the original identity and releases the existing executor once; repeated concurrent resume requests share the retry and do not start another executor. If the run was not paused, admission failure ends the attempt. A non-retryable admission rejection, such as a permission error, is reported on resume instead of retrying the live executor. Retain the full run ID and inspect it before retrying. Completed checkpoints remain reusable, but an external side effect whose checkpoint was never confirmed can still repeat after a crash; make such operations idempotent.
|
|
480
|
-
|
|
481
|
-
Cancellation or the deadline can leave a stored run identity without valid admission metadata, even when PostgreSQL is healthy but slow. After an unavailable-database failure, keep the original Atomic process open, restore PostgreSQL, and explicitly resume the same full run ID. Atomic can reconcile its retained pre-execution identity with the database before admission, without running workflow code during reconciliation. Missing records are repaired only for that known failed admission; conflicting, deleted, or malformed records are refused. A fresh process without valid admission metadata still cannot safely reconstruct the invocation. Keep the ID and report that failure rather than deleting or resetting records. Cancelled and explicitly nonresumable runs are not revived.
|
|
482
|
-
|
|
483
|
-
A repeated registration timeout can mean the original registration never finished. Atomic waits within the database admission deadline and does not start workflow code or publish resumable state while that registration remains unresolved. Restoring PostgreSQL alone may not complete a registration abandoned by its original request. Keep the run ID and report the repeated timeout; do not delete database records to force admission. An identity without saved admission metadata is omitted from durable history and cannot be resumed from a fresh process.
|
|
484
|
-
|
|
485
|
-
Awaited checkpoint writes also have a two-minute database deadline, including time waiting behind earlier writes for the same run. If a checkpoint fails because PostgreSQL is unavailable, the run keeps its local failure without waiting on another database write to finalize it. Restore PostgreSQL and explicitly resume the same ID; Atomic reads saved receipts before executing unfinished work. A committed checkpoint is reused even if its acknowledgement was lost. If no receipt was saved, the external operation's outcome remains unknown and its callback may run again. Reconcile external outcomes or use idempotency keys before resuming operations that must not repeat. Inspection alone never repairs records or starts execution.
|
|
486
|
-
|
|
487
|
-
If recovery reports `Workflow definition not found`, restore the matching workflow definition and run `/workflow reload`, then retry resume with the same full run ID. A failed resume preparation does not discard the recovery target or saved receipts. Do not start a new run to bypass the missing definition.
|
|
488
|
-
|
|
489
|
-
**Zero-configuration local database.** Without an explicit database URL from the environment or settings, Atomic uses its own embedded Postgres for DBOS. It requires no Docker daemon, system Postgres install, install lifecycle script, or first-run download.
|
|
490
|
-
|
|
491
|
-
Supported targets are Linux x64/ARM64 with glibc or musl, macOS x64/ARM64, and Windows x64/ARM64 using x64 emulation. Linux musl uses PostgreSQL 18.6; other targets use 18.4. Both use the compatible major-version-18 cluster at `~/.atomic/postgres/v18`, with preferred port `5439`.
|
|
492
|
-
|
|
493
|
-
The first workflow action initializes and starts the database. Concurrent Atomic sessions share it. Once ready, it stays running after Atomic exits, including after the last client closes.
|
|
494
|
-
|
|
495
|
-
Cluster ownership records live beside the data in `~/.atomic/postgres/v18.shared`, outside Atomic installation/version directories. On Linux root installs, use `/var/lib/atomic-postgres/v18.shared`. Preserve these records and the existing data if Atomic reports an identity mismatch or missing `PG_VERSION`; do not delete either to force initialization. An identity mismatch names the fields that differ, for example `(inode)` or `(systemIdentifier)`. A data directory whose filesystem device number changed after a reboot, as can happen on macOS APFS volumes, is not a mismatch: Atomic attaches the cluster and updates the record when the directory inode, path, and PostgreSQL system identifier still match. Closing or reloading an updated Atomic client does not stop a ready shared server. Older clients without this lifetime behavior can still stop servers they started, so finish and close those sessions before relying on the updated behavior for long-running work. An explicit `DBOS_SYSTEM_DATABASE_URL` remains outside managed-cluster lifecycle operations.
|
|
496
|
-
|
|
497
|
-
New managed PostgreSQL servers start from a complete, immutable runtime under
|
|
498
|
-
`~/.atomic/postgres/pg-runtime` (or `/var/lib/atomic-postgres/pg-runtime` when
|
|
499
|
-
running as root on Linux), separate from data and project checkouts. Removing
|
|
500
|
-
the original worktree or reinstalling packages does not remove files needed by
|
|
501
|
-
a server already using that runtime. Do not delete a runtime generation,
|
|
502
|
-
including a damaged one, while a managed server may still use it.
|
|
503
|
-
Set `ATOMIC_POSTGRES_RUNTIME_CACHE_DIR` before starting Atomic to share retained runtime generations across separate cluster homes; only the runtime cache moves, not cluster data or ownership records. Keep this directory private to a trusted account and do not remove generations while a server may use them.
|
|
504
|
-
|
|
505
|
-
Atomic only uses a runtime cache whose parent folders other accounts can't write to. A folder that only its group can write to is accepted when that group is your own private group: no other account in `/etc/passwd` uses that group as its primary group, and `/etc/group` lists no member other than you. That's the default on Ubuntu and Debian, where umask 002 makes `~/.atomic` group-writable. If Atomic reports an **Untrusted embedded Postgres runtime cache directory ancestor** and falls back to in-memory workflows, run `chmod go-w` on the folder named in the message and restart Atomic.
|
|
506
|
-
|
|
507
|
-
**Running as root on Linux.** Atomic needs an available unprivileged account, `postgres`, `nobody`, or `daemon`, because PostgreSQL cannot run as root. The cluster is stored under `/var/lib/atomic-postgres`. If privilege or runtime preparation fails, inspect the diagnostic rather than changing data ownership blindly.
|
|
508
|
-
|
|
509
|
-
**Administrator accounts (Windows).** Atomic can start embedded Postgres from an elevated terminal or an administrative account without changing your account or system permissions. The server runs with reduced privileges, as it does under PostgreSQL's own launcher. Regular Windows accounts remain supported.
|
|
510
|
-
|
|
511
|
-
Managed PostgreSQL writes startup output to `~/.atomic/postgres/v18.log` and, after startup, server logs to `~/.atomic/postgres/v18/log/postgresql-<Day>.log`, rotating daily through seven weekday files. If Postgres exits during startup, Atomic reports recent output from both logs. Check these logs for configuration or cluster errors; do not delete the cluster while a server may still be using it.
|
|
512
|
-
|
|
513
|
-
Set `ATOMIC_POSTGRES_PORT` before starting Atomic to choose a preferred loopback port, for example `ATOMIC_POSTGRES_PORT=15439 atomic`. The default is `5439`; valid values are integers from 1 through 65535. An occupied port causes Atomic to choose another loopback port without changing or stopping the listener. Concurrent sessions use one elected starter and discover the verified actual port from `v18.shared/cluster.json`. A persisted port takes precedence over a changed preference. Startup bind races have at most three attempts; inspect `v18.log` if they fail.
|
|
514
|
-
|
|
515
|
-
Atomic checks PostgreSQL readiness and matches the server to the managed data and process identity before attachment. A listening TCP port alone is not sufficient. If an existing cluster has no trusted ownership records, Atomic registers it only when it is the embedded cluster an older Atomic (0.9.10–0.9.19) provisioned, recognized by PostgreSQL major version 18 and the loopback launch of that exact data directory recorded in `postmaster.opts`; registration never reinitializes or modifies the data. Any other unregistered data is refused, and recovery never registers a cluster. Preserve refused data and use an explicit `DBOS_SYSTEM_DATABASE_URL` for that database instead. An explicit URL uses only that endpoint, never alternate managed ports.
|
|
516
|
-
|
|
517
|
-
After attachment, Atomic checks the managed server's SQL and process identity before borrowing database connections and every five seconds while idle. Lost health discards old connections. One elected process may restart the existing managed cluster under the shared setup lock; other sessions reconnect to its verified, persisted port. Recovery never initializes missing data, signals an unrelated listener, switches to Docker, or restarts the DBOS executor.
|
|
518
|
-
|
|
519
|
-
If the managed server has stopped, the next workflow database action can restart the existing cluster even when `postmaster.opts` is missing. Atomic still requires trusted ownership records, the original cluster identity, and a verified runtime. A hard identity, ownership, or filesystem failure refuses recovery rather than guessing which server or data to use.
|
|
520
|
-
|
|
521
|
-
Each process makes at most three recovery attempts per check, with short
|
|
522
|
-
backoffs. Later health checks retry after a cooldown if the problem persists.
|
|
523
|
-
If the retained PostgreSQL runtime is damaged or missing, reinstall a complete
|
|
524
|
-
healthy Atomic package or repair your `ATOMIC_POSTGRES_RUNTIME_DIR` override,
|
|
525
|
-
then inspect `v18.log`. Atomic can select a verified replacement, including
|
|
526
|
-
after a same-version reinstall, even when the damaged runtime prevents new
|
|
527
|
-
database connections. A running server must pass process-identity verification
|
|
528
|
-
before Atomic stops it; if the server has already exited, Atomic starts from
|
|
529
|
-
the replacement without stopping anything. If a present server's identity
|
|
530
|
-
cannot be verified, automatic restart is refused; preserve the data,
|
|
531
|
-
`v18.shared`, and damaged runtime, and report the diagnostic for help instead
|
|
532
|
-
of deleting files or starting another server. Identity mismatches and database
|
|
533
|
-
corruption require investigation, not a package reinstall.
|
|
534
|
-
New admission keeps its
|
|
535
|
-
two-minute deadline even if shared recovery takes longer. Restoring the
|
|
536
|
-
connection does not automatically resume a paused run or prove that an
|
|
537
|
-
interrupted write or external side effect committed. Inspect the original run
|
|
538
|
-
before retrying. External database URLs receive no managed recovery; restore
|
|
539
|
-
that exact endpoint yourself.
|
|
540
|
-
|
|
541
|
-
Restart Atomic after upgrading to enable health supervision in a session whose database executor was already initialized by an older version.
|
|
542
|
-
|
|
543
|
-
Custom Windows launchers can still use executable names resolved through `PATH` or relative executable paths. `.cmd` and `.bat` launchers accept arguments on administrative accounts, including when the launcher path contains spaces. Explicit `cmd.exe` invocations retain their usual argument handling. Working directories with a `\\?\` prefix are supported when removing the prefix preserves the exact path; if `cmd.exe` reports an unsupported UNC working directory, use an ordinary local directory path. If startup reports that batch file arguments are invalid, remove carriage returns and line breaks from those arguments. If it reports that a string contains NUL characters, check the supplied paths, arguments, and environment entries. Remove the embedded NUL rather than retrying with a truncated value; no server is started for that request.
|
|
544
|
-
|
|
545
|
-
If embedded provisioning fails without leaving retained-process cleanup pending, Atomic tries DBOS's reusable `dbos-db` Docker container. A published TCP port is not enough: Atomic waits until PostgreSQL on that container's selected endpoint answers a query before initializing DBOS. Transient startup resets and connection refusals are retried until that bounded wait expires. If DBOS still cannot become ready, workflows **degrade to a process-local in-memory backend with a loud warning** instead of refusing to run: the run executes normally, but its state does not survive the process and `/workflow resume` after exit has nothing to restore. Fix the configured database or set `DBOS_SYSTEM_DATABASE_URL` to a working Postgres to restore durability.
|
|
546
|
-
|
|
547
|
-
The Docker readiness query uses the same `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, and `PGSSLMODE` settings as DBOS. If startup reports an invalid `PGPORT`, supply an integer from 1 through 65535. Authentication, TLS, schema and statement-timeout failures are not retried as database startup delays; correct the reported configuration or database problem.
|
|
548
|
-
|
|
549
|
-
New Docker fallback containers publish PostgreSQL on `127.0.0.1` at `PGPORT`, or port 5432 when unset. Atomic does not change an existing container's port mapping. When reusing `dbos-db`, keep `PGPORT` consistent with its published port, or set `DBOS_SYSTEM_DATABASE_URL` to the intended database endpoint.
|
|
550
|
-
|
|
551
|
-
Fallback starts only after failed DBOS initialization has been cleaned up. If Atomic reports `Workflow backend cleanup failed`, workflow startup stops rather than starting another backend alongside an unconfirmed executor. Correct the reported shutdown problem and restart Atomic; do not delete database data to bypass it.
|
|
552
|
-
|
|
553
|
-
**Multiple concurrent Atomic sessions.** A workflow with a healthy connected owner is not a resume target. Fresh progress and database ownership are checked independently, so a quiet long-running tool stays protected. After the owning connection is lost and progress becomes stale in about two minutes, inspection reports `crashed`. Concurrent attempts to resume the same run admit one executor; a stale request reports that the run changed.
|
|
554
|
-
|
|
555
|
-
For SDK crash recovery, save the full run UUID and create a fresh authorized session with the original working directory and workflow database configuration. `session.workflows.getRun(runId)` and `getStages(runId)` inspect its durable state without taking ownership. Once `getRun()` reports `crashed`, `session.workflows.resume(runId)` can adopt the root after the database excludes its previous owner and unfinished database writes. A healthy connected owner stays protected despite stale tool progress or copied VM boot/PID identity. This works with `SessionManager.inMemory()` without reopening a session file. Competing adopters cannot both claim the same generation. Missing ownership metadata, another working directory, or unavailable ownership verification keeps the run read-only; older unfenced runs cannot use distributed adoption.
|
|
556
|
-
|
|
557
|
-
A paused run launched by the model-facing `workflow` tool is also adoptable once its owning session has left it: the session was disposed, or the host switched to another session with `/new`, `/fork`, or `/resume`. Leaving quits the session's in-flight runs at their last checkpoint and records in the workflow database that the session released its checkpointed paused runs, so `session.workflows.resume(runId)` from another authorized session, or the `workflow` tool's `resume` action in the new session, can adopt them, in the same process or after the owning process exits. The `/workflow resume <id>` command the new session prints does the same and makes the resuming session the owner. Before adopting, the new session's model can inspect a released run with the `workflow` tool's `status` and `stages` actions; pausing, quitting, or answering it still requires owning it. The first adopter becomes the owner; a later attempt is refused, and in the process that released the run the message says the run is now owned by another session (another process sharing the database gets the generic ownership error). A run whose owner crashed without leaving, or whose owning session is still open, stays owned by that session. See [SDK run control](/sdk#workflow-run-control).
|
|
558
|
-
|
|
559
|
-
For live-cloned SDK hosts, configure one shared authoritative PostgreSQL server/database. A copied managed PostgreSQL directory in another VM is a separate coordinator, not a shared database, even when its `localhost` connection URL is identical. Independent database copies cannot coordinate ownership across VMs.
|
|
560
|
-
|
|
561
|
-
The workflow database endpoint must preserve database sessions. Use direct PostgreSQL connections or session-mode pooling, not transaction-mode or statement-mode pooling. Ownership locks and write authorization depend on that session affinity.
|
|
562
|
-
|
|
563
|
-
Ownership fencing prevents a disconnected executor from saving later checkpoints or workflow metadata. It does not stop arbitrary external code already running in that executor. After connection loss, the replacement may retry an unfinished `ctx.tool` while the old callback is still active. Use idempotent external effects and stable operation keys; do not assume exactly-once callback execution. Completed durable checkpoints still replay without executing those callbacks again.
|
|
564
|
-
|
|
565
|
-
If Atomic reports that its database ownership connection was lost, restore database availability, inspect the retained run UUID, and resume explicitly. Recovery uses a fresh execution generation; it does not restore the disconnected executor's mutation authority. Preserve the workflow database and completed checkpoints.
|
|
566
|
-
|
|
567
|
-
Older unfenced runs require controlled enrollment rather than automatic foreign-owner adoption. Stop all older Atomic workers using that workflow database, upgrade the recovery host, and keep the original database and workflow definition. In an authorized SDK session with the original working directory, use the full UUID with `session.workflows.resume(runId, { legacyRecovery: { olderWorkersStopped: true } })`. This explicit assertion enrolls the legacy root and preserves its completed checkpoints; it does not stop workers itself. Do not use it while an older worker may still be running. Reads and existing owner-scoped controls do not require enrollment. See [SDK run control](/sdk#workflow-run-control) for the recovery example.
|
|
568
|
-
|
|
569
|
-
If the recovery host crashes between enrollment and execution, inspect the full UUID and retry that explicit SDK option from a fresh session after its database ownership connection is gone. Only an interrupted enrollment is eligible for this retry; healthy owners and other fenced paused or blocked runs remain protected.
|
|
570
|
-
|
|
571
|
-
Independent root workflows persist independently. Nested workflows share their root's ordering.
|
|
572
|
-
|
|
573
|
-
### Workflow database recovery
|
|
574
|
-
|
|
575
|
-
Atomic monitors the managed PostgreSQL server and coordinates recovery when it
|
|
576
|
-
loses health. The shared cluster keeps its data and ownership records; database
|
|
577
|
-
recovery neither starts a replacement workflow nor proves an unfinished external
|
|
578
|
-
effect succeeded. Inspect `/workflow status <full-run-uuid>` for the original run
|
|
579
|
-
and explicitly resume it when eligible. Do not start a duplicate run or delete
|
|
580
|
-
`v18` or `v18.shared` to bypass an identity or availability error.
|
|
581
|
-
|
|
582
|
-
Database-unavailable admission errors and status `dependencyError` include the selected database provider, its endpoint without credentials or URL options, and the last retained health-probe or recovery failure. A cooldown error keeps the recovery failure visible. Use that reason to repair a missing runtime or configuration; preserve data and ownership records when identity or filesystem checks fail. After repair, inspect and explicitly resume the original run ID.
|
|
583
|
-
|
|
584
|
-
For an explicit `DBOS_SYSTEM_DATABASE_URL`, Atomic does not manage the external
|
|
585
|
-
database. Restore that endpoint or correct its credentials and TLS settings,
|
|
586
|
-
then inspect and resume the original workflow. If the Docker fallback is in use,
|
|
587
|
-
inspect `dbos-db` and correct its service configuration. A database repair does
|
|
588
|
-
not automatically resume a paused workflow or establish whether an interrupted
|
|
589
|
-
write committed.
|
|
477
|
+
Fencing prevents a displaced executor from saving new checkpoints, not from finishing arbitrary external effects already underway. Use idempotent effects and stable operation keys. Completed checkpoints replay; an unfinished callback may run again.
|
|
590
478
|
|
|
591
479
|
### How it works
|
|
592
480
|
|
|
593
481
|
- Only `ctx.*` work is checkpointed. Plain TypeScript outside those calls is not durable.
|
|
594
|
-
- Completed tool, stage, prompt, and child-workflow checkpoints replay without repeating
|
|
595
|
-
- Resume and inspection
|
|
482
|
+
- Completed tool, stage, prompt, and child-workflow checkpoints replay without repeating completed work. Unfinished work may run again.
|
|
483
|
+
- Resume and inspection read the journal, not chat transcripts, as the recovery catalog.
|
|
596
484
|
- Unsupported or inconsistent saved topology is refused rather than repaired by guessing. Preserve the run ID and diagnostic.
|
|
597
|
-
-
|
|
485
|
+
- Independent roots persist independently; nested workflows share their root's ordering.
|
|
598
486
|
|
|
599
|
-
**Privacy and retention.**
|
|
487
|
+
**Privacy and retention.** The journal contains workflow inputs, completed tool outputs, UI responses, stage outputs, message delivery receipts, and chat-session paths. Treat the file and its SQLite sidecar files as sensitive. History does not automatically delete runs by age or count. Confirmed picker deletion removes inactive workflow records while preserving independent chat transcripts.
|
|
600
488
|
|
|
601
489
|
Sticky receipts suppress repeat delivery to the same recipient session, whether the message arrived as pre-start context or through live Intercom forwarding. This also holds after a failed stage retries or a cold resume. Repeated confirmations do not increase the delivery count. Delivery without an explicit recipient uses the stage's previous receipts; delivery to a new recipient session remains eligible.
|
|
602
490
|
|
|
@@ -685,7 +573,7 @@ Changing `iteration` makes each loop pass a distinct durable call. Reusing the s
|
|
|
685
573
|
|
|
686
574
|
### `/workflow resume` — cross-session resume selector
|
|
687
575
|
|
|
688
|
-
The `/workflow resume` command mirrors `/resume` ergonomics and `/workflows` is its alias. With no
|
|
576
|
+
The `/workflow resume` command mirrors `/resume` ergonomics and `/workflows` is its alias. With no ID, it builds a newest-first picker from eligible live runs and journal records. Selected records are revalidated before resume or inspection. Runs with live leases are excluded; expired running leases appear as `crashed`.
|
|
689
577
|
|
|
690
578
|
Picker rows use the run label when set, otherwise a one-line objective or prompt input, falling back to the workflow ID. When a generated progress summary is available, it has its own column; status and workflow name precede the identity in the other column. Live rows also show completed/total stages. Without a generated summary, the adjacent column shows those status details instead. Search matches the identity, summary, and full run ID.
|
|
691
579
|
|
|
@@ -699,9 +587,9 @@ Only runs with usable durable checkpoints or pending prompts can resume. Deleted
|
|
|
699
587
|
|
|
700
588
|
Rows carry semantic colors — completed green, paused yellow, failed/blocked/crashed red. The open picker live-updates on local run changes plus a bounded cross-session poll, so state transitions appear (and freshly running workflows disappear) without reopening it.
|
|
701
589
|
|
|
702
|
-
Ctrl+D deletes a highlighted inactive durable or completed row after confirmation. Deletion rechecks same-process activity and
|
|
590
|
+
Ctrl+D deletes a highlighted inactive durable or completed row after confirmation. Deletion rechecks same-process activity and journal ownership, refuses running workflows, and leaves chat transcripts untouched. Eligible runs remain searchable regardless of age or count.
|
|
703
591
|
|
|
704
|
-
Only current-format
|
|
592
|
+
Only valid current-format journal records are selectable. Unsupported or malformed records are not reinterpreted.
|
|
705
593
|
|
|
706
594
|
Selecting a paused, resumable failed, blocked, or crash-recovery target from the current project re-dispatches the workflow with its cached inputs and the **original workflow id**. Every nested invocation validates and reuses its durable boundary and child identity before dispatch. Previously completed `ctx.tool`, `ctx.ui`, stage/task/chain/parallel items, and child boundaries replay from checkpoints instead of executing again; only incomplete work continues.
|
|
707
595
|
|
|
@@ -728,7 +616,7 @@ Fresh completed inspection does not currently persist the workflow's declared ro
|
|
|
728
616
|
|
|
729
617
|
Targets resolve across top-level live, resumable durable, and completed entries as one namespace using full UUIDs or unique 8-hex prefixes. Exact loadable paused live targets retain direct in-session precedence. Prefixes require successful catalog discovery and reject collisions. A root appearing in both resumable and read-only history remains resumable. Nested child runs remain excluded from this top-level resume namespace.
|
|
730
618
|
|
|
731
|
-
The non-interactive `workflow` surface
|
|
619
|
+
The non-interactive `workflow` surface reads the journal for explicit IDs. `resume` loads the definition, revalidates eligibility, then claims and dispatches the run. `status`, `stages`, `stage`, and `transcript` read a missing-local root without dispatching it. `status` without a run ID remains session-local.
|
|
732
620
|
|
|
733
621
|
Targets other than full UUIDs or 8-hex prefixes are rejected before catalog lookup. Durable read-only prefix inspection includes actively running roots owned by other sessions, without claiming or resuming them. Once resolved, subsequent stage and transcript inspection uses the canonical root UUID, even when a nested child shares its prefix. Completed or failed roots with valid checkpoints remain inspectable when retained conversations are unavailable; invalid transcript paths are stripped while the graph remains visible.
|
|
734
622
|
|
|
@@ -742,7 +630,7 @@ Recovery requires saved checkpoints proving one unfinished tool and its complete
|
|
|
742
630
|
|
|
743
631
|
A tool-frontier continuation must reach and consume the exact unfinished tool before reporting `completed`, whether the body returns normally or calls `ctx.exit({ status: "completed" })`. Omitting the call, including by changing control flow, fails with `insufficient_state: replay topology mismatch` and the pending tool's exact ID. A substituted tool is rejected before its callback runs. While that frontier is pending, completed model and child-workflow predecessors can replay, but new model stages, tasks, and child workflows cannot execute in its place. Stage and task worktree setup also waits for live admission. Replaying completed predecessors alone is not proof of completion. Failed replay publishes no successful result; inspect the same ID and restore the matching flow before another supported resume. Quit, kill, caught targeted cancellation, and intentional non-completed exits retain their existing behavior.
|
|
744
632
|
|
|
745
|
-
After upgrading Atomic itself or applying a code fix, start a new Atomic process; `/workflow reload` refreshes definitions, not loaded code.
|
|
633
|
+
After upgrading Atomic itself or applying a code fix, start a new Atomic process; `/workflow reload` refreshes definitions, not loaded code.
|
|
746
634
|
|
|
747
635
|
If saved state cannot prove safe replay, reconcile the original run and external effects before choosing recovery. Do not restart the original workflow from the beginning to bypass the error. A separately authorized recovery-only workflow may perform verified remaining operations, but must not repeat completed side effects or fabricate checkpoints.
|
|
748
636
|
|
|
@@ -763,47 +651,15 @@ That history does not authorize any live release action.
|
|
|
763
651
|
| **Abandoned `ctx.tool` callback** | Quit reports callbacks that ignored cancellation by `{runId, nodeId}`. They may still cause external effects but cannot save a late checkpoint. Reconcile effects before same-ID resume retries unfinished work. |
|
|
764
652
|
| **`ctx.ui` pending prompt** | If a UI prompt was not answered before interruption, resume leaves off on that prompt — the user must answer it to continue. |
|
|
765
653
|
|
|
766
|
-
### Configuring
|
|
767
|
-
|
|
768
|
-
Choose a hosted or separately managed database persistently in `~/.atomic/agent/settings.json` or trusted project `.atomic/settings.json`:
|
|
769
|
-
|
|
770
|
-
```json
|
|
771
|
-
{
|
|
772
|
-
"workflows": {
|
|
773
|
-
"durability": {
|
|
774
|
-
"systemDatabaseUrlFile": "~/.atomic/neon/direct.url"
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
```
|
|
779
|
-
|
|
780
|
-
The file contains only the PostgreSQL connection URL; surrounding whitespace and a trailing newline are trimmed. Use `systemDatabaseUrl` instead for an inline URL, but do not set both. Relative file paths resolve beside the settings file that declares them, such as the global agent directory or project `.atomic` directory. Protect the file from other accounts and keep credentials out of version control. Existing workflow path arrays remain supported; when using the object form, put resource paths in `workflows.paths`.
|
|
781
|
-
|
|
782
|
-
`DBOS_SYSTEM_DATABASE_URL` overrides settings. A trusted project `durability` object replaces the global selection. Without either, Atomic provisions managed PostgreSQL, then tries Docker if provisioning fails. An explicit URL uses only its chosen endpoint, even on connection failure. Invalid settings, including unrecognized `durability` keys, and unreadable or empty credential files stop initialization rather than choosing another database. Restart Atomic to change the selection; existing runs stay in their original database and are not migrated.
|
|
783
|
-
|
|
784
|
-
On first database initialization, interactive and RPC sessions display the selected provider and host without credentials or URL options. A Docker selection is labelled `Docker fallback`. Headless sessions, including SDK hosts without a UI, write only the Docker fallback notice to stderr; managed and configured selections stay silent there. In-memory degradation retains its existing warning. See [Workflow database settings](/settings#workflow-database).
|
|
785
|
-
|
|
786
|
-
**Linux musl and Windows ARM64.** Musl installations include Alpine/musl PostgreSQL 18.6. Windows ARM64 runs PostgreSQL 18.4 x64 through emulation and requires Windows 11 plus the Microsoft Visual C++ x64 v14 Redistributable. This is not native PostgreSQL ARM64; Windows 10 on ARM is unsupported.
|
|
787
|
-
|
|
788
|
-
Set `ATOMIC_POSTGRES_RUNTIME_DIR` to a complete extracted runtime containing `bin/initdb`, `bin/pg_ctl`, and `bin/postgres` to override packaged runtime discovery, including in air-gapped deployments. Otherwise DBOS/Postgres durability requires no setup on supported local platforms. To use an existing Postgres database, set `DBOS_SYSTEM_DATABASE_URL` before starting Atomic; that explicit URL retains precedence over embedded provisioning. Atomic provisions embedded Postgres next (with drop-privilege support when running as root on Linux), then Docker as a platform fallback. The DBOS SDK ships with `@bastani/atomic`. If no durable backend can be provisioned, workflows run on a process-local in-memory backend with a loud non-durable warning — never on the legacy per-workflow file store under `~/.atomic/workflow-durable` — and cross-process resume is unavailable until Postgres provisioning is fixed. Interactive and RPC actions show the warning as a display-only notification that is not added to agent/model context. Print and other headless actions, where no usable UI exists, write the actionable diagnostic to the console instead.
|
|
654
|
+
### Configuring journal storage
|
|
789
655
|
|
|
790
|
-
|
|
656
|
+
Set `workflows.journal.path` in `settings.json` or set `ATOMIC_WORKFLOW_JOURNAL_PATH` before starting Atomic to select a local SQLite file. The non-empty environment value overrides settings; SDK `RunOpts.journal` overrides both. Relative settings paths resolve against the Atomic home directory, normally `~/.atomic`. With no override, Atomic uses `~/.atomic/workflows/journal.sqlite`. To use a remote database, select an [adapter module](/storage#selecting-an-adapter) in `workflows.journal` or shared `storage`.
|
|
791
657
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
To check an archive runtime, set `runtime` to its `node_modules/@bastani/atomic-natives/postgres-runtime`, then run `"$runtime/bin/postgres" --version` and `"$runtime/bin/pg_ctl" --version`. On Windows use the corresponding `.exe` files in PowerShell. Both must succeed. If a library-link or copy error is reported, repair the complete installation instead of mixing libraries from different releases.
|
|
795
|
-
|
|
796
|
-
Optional PostgreSQL OAuth and procedural-language modules may have upstream dependency gaps. Atomic does not bundle supplemental libcurl or Perl/Python/Tcl runtimes for those modules. They are not needed for normal workflow database operation; use a separately managed PostgreSQL server if you require them.
|
|
658
|
+
For process-local storage, use `workflows.journal.memory: true` without a non-empty settings path, or pass `journal: { memory: true }` to SDK `run()`. Memory is never selected after a storage failure. Preserve a SQLite journal and its sidecar files; use the same journal and working directory to resume an existing run. See [Workflow storage settings](/settings#workflow-storage).
|
|
797
659
|
|
|
798
660
|
Pending-stage Intercom cleanup checks durable ownership only for runs with messages that need settlement. Repeated failures with the same message produce one warning per extension instance. Interactive hosts receive a display-only notification, never a console stack trace, even if notification delivery fails; headless hosts retain a console diagnostic. Pending messages are not discarded when cleanup fails.
|
|
799
661
|
|
|
800
|
-
|
|
801
|
-
export DBOS_SYSTEM_DATABASE_URL="postgresql://user:password@localhost:5432/atomic_dbos_sys"
|
|
802
|
-
```
|
|
803
|
-
|
|
804
|
-
Fresh-process resume and inspection read authoritative checkpoints from DBOS. Unsupported records are not treated as successful cached work. Keep the original diagnostic and run ID if decoding fails.
|
|
805
|
-
|
|
806
|
-
Atomic does not use the legacy file backend under `~/.atomic/workflow-durable`; cross-session `/workflow resume` reads DBOS only.
|
|
662
|
+
Fresh-process resume and inspection read authoritative checkpoints from the journal. Unsupported records are not treated as successful cached work. Keep the original diagnostic and run ID if decoding fails.
|
|
807
663
|
|
|
808
664
|
## Workflow Locations
|
|
809
665
|
|
|
@@ -812,12 +668,14 @@ Atomic discovers workflow definitions in this order:
|
|
|
812
668
|
| Location | Scope | Notes |
|
|
813
669
|
|----------|-------|-------|
|
|
814
670
|
| `.atomic/extensions/workflow/config.json` | Project | `workflows.<name>.path`; project entries override global entries |
|
|
815
|
-
| `.atomic/workflows/*.{ts,js,mjs,cjs}` | Project |
|
|
671
|
+
| `.atomic/workflows/*.{ts,js,mjs,cjs}` | Project | Current project workflow directory |
|
|
816
672
|
| `~/.atomic/agent/extensions/workflow/config.json` | Global | `workflows.<name>.path` for user-wide configured paths |
|
|
817
|
-
| `~/.atomic/agent/workflows/*.{ts,js,mjs,cjs}` | Global |
|
|
673
|
+
| `~/.atomic/agent/workflows/*.{ts,js,mjs,cjs}` | Global | Current user workflow directory |
|
|
818
674
|
| Installed Atomic packages | Package | Uses package metadata or conventional `workflows/` directories |
|
|
819
675
|
| Bundled workflows | Built-in | Shipped with `@bastani/atomic/workflows` |
|
|
820
676
|
|
|
677
|
+
Workflow configuration and discovery use only the current `.atomic` roots by default. `ATOMIC_CODING_AGENT_DIR` overrides the user agent directory. Import workflow APIs from `@bastani/atomic/workflows` and schemas from `typebox`.
|
|
678
|
+
|
|
821
679
|
A workflow module may export one default workflow definition and/or named workflow definitions. Discovery checks the default export first, then named exports.
|
|
822
680
|
|
|
823
681
|
Discovery validates every runtime export of a discovered workflow file as a workflow definition. Discovery rejects a named export that is not a workflow definition — a widget factory, shared constant, or utility function — with an `INVALID_DEFINITION` discovery diagnostic (`export is not an object`), even when the module also has a valid default export (the valid workflow still loads; the diagnostic flags the extra export as skipped). TypeScript erases type-only exports (`export type` / `export interface`) at runtime, so discovery never flags them.
|
|
@@ -529,7 +529,7 @@ Ordinary `intercom` is enabled by default but respects `tools`, `excludedTools`,
|
|
|
529
529
|
- Persist decisions under stable keys. Pause/resume, model fallback, durable replay, and nested workflows then reread the artifact instead of sending duplicate interventions.
|
|
530
530
|
- Omit `group` for ordinary use. The worker, guard, nested workflows, and delegated subagents inherit the top-level workflow invocation's stable Intercom group. Set an explicit group only for intentional isolation; an override isolates that stage from ordinary same-group peers while leaving it steerable from the invocation context, which retains directional list/send/live-ask control over the subgroups it owns.
|
|
531
531
|
- Use `context: "fresh"` for guards, reviewers, and judges. They should see only the contract, candidate, decision artifacts, and current files.
|
|
532
|
-
- Use `context: "fork"` plus `
|
|
532
|
+
- Use `context: "fork"` plus `forkFromSessionId` for implementation, debugging, and repair roles that need continuity with an owned earlier session. `context: "fork"` alone does not name a fork source; an initial worker with no prior lineage may start fresh. A later continuation should use the earlier worker's `sessionId` in the selected session store when available. Do not fork an independent guard from the worker it judges.
|
|
533
533
|
- Send a forked continuation only the delta after the fork point: new evidence, the decision artifact, any human answer, and the next action. Keep the full shared contract in its canonical file.
|
|
534
534
|
|
|
535
535
|
Expected lifecycle state is not a defect. If the contract says `candidate → validation → approval → push/publish`, a guard at the candidate or validation boundary must not reject the patch merely because it is unpushed or unpublished. Only the later publication stage owns that action.
|
|
@@ -568,10 +568,10 @@ const decisionLogSchema = Type.Object(
|
|
|
568
568
|
|
|
569
569
|
type DecisionLog = Static<typeof decisionLogSchema>;
|
|
570
570
|
|
|
571
|
-
function continueWorker(
|
|
572
|
-
return
|
|
571
|
+
function continueWorker(sessionId: string | undefined) {
|
|
572
|
+
return sessionId === undefined
|
|
573
573
|
? { context: "fork" as const }
|
|
574
|
-
: { context: "fork" as const,
|
|
574
|
+
: { context: "fork" as const, forkFromSessionId: sessionId };
|
|
575
575
|
}
|
|
576
576
|
|
|
577
577
|
export default workflow({
|
|
@@ -627,7 +627,7 @@ export default workflow({
|
|
|
627
627
|
].join("\n"));
|
|
628
628
|
|
|
629
629
|
await ctx.task("continue worker", {
|
|
630
|
-
...continueWorker(worker.
|
|
630
|
+
...continueWorker(worker.sessionId),
|
|
631
631
|
reads: [contract, decisionLog],
|
|
632
632
|
prompt: [
|
|
633
633
|
`Read the decision log at ${decisionLog}.`,
|
|
@@ -653,10 +653,10 @@ Use `ctx.stage(...)` when one independent checker needs a retained conversation.
|
|
|
653
653
|
import { workflow } from "@bastani/atomic/workflows";
|
|
654
654
|
import { Type } from "typebox";
|
|
655
655
|
|
|
656
|
-
function continueWorker(
|
|
657
|
-
return
|
|
656
|
+
function continueWorker(sessionId: string | undefined) {
|
|
657
|
+
return sessionId === undefined
|
|
658
658
|
? { context: "fork" as const }
|
|
659
|
-
: { context: "fork" as const,
|
|
659
|
+
: { context: "fork" as const, forkFromSessionId: sessionId };
|
|
660
660
|
}
|
|
661
661
|
|
|
662
662
|
export default workflow({
|
|
@@ -703,7 +703,7 @@ export default workflow({
|
|
|
703
703
|
);
|
|
704
704
|
|
|
705
705
|
await ctx.task("apply retained decision", {
|
|
706
|
-
...continueWorker(worker.
|
|
706
|
+
...continueWorker(worker.sessionId),
|
|
707
707
|
reads: [contract, decisionLog],
|
|
708
708
|
prompt: [
|
|
709
709
|
`Read ${decisionLog}.`,
|
|
@@ -742,10 +742,10 @@ const coordinationSchema = Type.Object(
|
|
|
742
742
|
|
|
743
743
|
type Coordination = Static<typeof coordinationSchema>;
|
|
744
744
|
|
|
745
|
-
function workerContext(
|
|
746
|
-
return
|
|
745
|
+
function workerContext(sessionId: string | undefined) {
|
|
746
|
+
return sessionId === undefined
|
|
747
747
|
? { context: "fresh" as const }
|
|
748
|
-
: { context: "fork" as const,
|
|
748
|
+
: { context: "fork" as const, forkFromSessionId: sessionId };
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
export default workflow({
|
|
@@ -753,7 +753,7 @@ export default workflow({
|
|
|
753
753
|
description: "Run a worker with a live same-group scope peer.",
|
|
754
754
|
inputs: {
|
|
755
755
|
scope_contract: Type.String(),
|
|
756
|
-
|
|
756
|
+
worker_session_id: Type.Optional(Type.String({
|
|
757
757
|
description: "Earlier worker session to continue; omit when no worker lineage exists.",
|
|
758
758
|
})),
|
|
759
759
|
fallback_policy: Type.Union([
|
|
@@ -778,7 +778,7 @@ export default workflow({
|
|
|
778
778
|
[
|
|
779
779
|
{
|
|
780
780
|
name: "worker",
|
|
781
|
-
...workerContext(ctx.inputs.
|
|
781
|
+
...workerContext(ctx.inputs.worker_session_id),
|
|
782
782
|
reads: [contract],
|
|
783
783
|
prompt: [
|
|
784
784
|
`Read the immutable scope contract at ${contract}.`,
|
|
@@ -910,11 +910,11 @@ State important constraints once. Reserve absolute wording for safety, required
|
|
|
910
910
|
|
|
911
911
|
Avoid unrelated workflow internals such as reducer algorithms, future PR stages, sibling reviewer names, loop implementation details, or project-specific nicknames unless they are explicitly part of the current stage contract. If a term such as a gate name, ledger field, or workflow nickname is necessary, define it in the prompt before using it.
|
|
912
912
|
|
|
913
|
-
Choose context mode deliberately. Use `context: "fork"` or `
|
|
913
|
+
Choose context mode deliberately. Use `context: "fork"` or `forkFromSessionId` for coherent long-running implementation stages that need continuity from their own earlier work. Use `context: "fresh"` for unbiased reviewer, evaluator, and gate stages so they inspect the current files and explicit artifacts rather than inheriting the implementer's assumptions. When continuity is needed across fresh stages, pass it explicitly through files, declared outputs, and `reads`.
|
|
914
914
|
|
|
915
915
|
### Context-Mode-Aware Prompt Text
|
|
916
916
|
|
|
917
|
-
Context mode is an execution property configured with `context`/`
|
|
917
|
+
Context mode is an execution property configured with `context`/`forkFromSessionId`; the model cannot act on context mode, so keep it out of prompt text:
|
|
918
918
|
|
|
919
919
|
- **Never describe the stage's own context mode.** Sentences like "you are running in a fresh context window", "your context is clean/non-forked", or "this is a forked session" add tokens without changing behavior. State the concrete action, inputs, and success criteria instead.
|
|
920
920
|
- **Fresh stages must not reference invisible context.** A fresh stage has no "previous conversation", cannot see sibling stages' transcripts, and does not know the surrounding graph, so instructions like "compare against previous workflow reasoning" or "this runs in parallel with the locator pass" do not help and may confuse the model. Phrase the same intent stage-locally ("compare the working tree against the baseline branch"; "do your own scan; do not assume any other stage's output is available") and pass any state the stage needs through files, declared outputs, and `reads`. If a stage should talk to a live peer, say so explicitly and tell it how to find that peer with `intercom list`; see [peer coordination between stages](#peer-coordination-between-stages).
|
|
@@ -1096,7 +1096,7 @@ Good workflows are information-flow systems, not just prompt sequences. Keep sta
|
|
|
1096
1096
|
- Do not pass strings or path objects to `ctx.workflow(...)`; import the workflow definition from `@bastani/atomic/workflows/builtin` or another TypeScript module first.
|
|
1097
1097
|
- Do not create a self-edge or a dependency edge from the current frontier to an existing ancestor. Cyclic workflow graphs are unsupported; redesign or stop before launch when a cycle cannot be removed.
|
|
1098
1098
|
- Do not model a bounded loop by reopening an earlier node beneath its downstream work. Create distinct tracked work per iteration and keep retained-session follow-up as non-topological activity when it adds no dependency work.
|
|
1099
|
-
- Do not claim TypeScript or workflow discovery proves a dynamic workflow acyclic. Discovery diagnoses imports and definition shape; execution, replay, and
|
|
1099
|
+
- Do not claim TypeScript or workflow discovery proves a dynamic workflow acyclic. Discovery diagnoses imports and definition shape; execution, replay, and journal hydration are the runtime topology boundary.
|
|
1100
1100
|
- Do not rely on undeclared child outputs; returning a key that is not declared in `outputs` fails the run. Declare every child-workflow field you expose in `outputs` — including `result` — and return values matching those schemas from `run` (see [Outputs](/workflows/authoring#outputs)).
|
|
1101
1101
|
- Do not expect to select or rename child outputs at the call site; parent workflows receive the child's declared output contract as `child.outputs` after checking `child.exited === false`, and a partial declared-output map when `child.exited === true`.
|
|
1102
1102
|
- Do not expect named workflow runs to block the chat turn; they are background tasks.
|
|
@@ -20,7 +20,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
20
20
|
for (let i = entries.length - 1; i >= 0; i--) {
|
|
21
21
|
const entry = entries[i];
|
|
22
22
|
if (entry.type === "message" && entry.message.role === "assistant") {
|
|
23
|
-
pi.setLabel(entry.id, label);
|
|
23
|
+
await pi.setLabel(entry.id, label);
|
|
24
24
|
ctx.ui.notify(`Bookmarked as: ${label}`, "info");
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -39,7 +39,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
39
39
|
const entry = entries[i];
|
|
40
40
|
const label = ctx.sessionManager.getLabel(entry.id);
|
|
41
41
|
if (label) {
|
|
42
|
-
pi.setLabel(entry.id, undefined);
|
|
42
|
+
await pi.setLabel(entry.id, undefined);
|
|
43
43
|
ctx.ui.notify(`Removed bookmark: ${label}`, "info");
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -71,7 +71,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
71
71
|
// Convert to LLM format and serialize
|
|
72
72
|
const llmMessages = convertToLlm(messages);
|
|
73
73
|
const conversationText = serializeConversation(llmMessages);
|
|
74
|
-
const
|
|
74
|
+
const currentSessionId = ctx.sessionManager.getSessionId();
|
|
75
75
|
|
|
76
76
|
// Generate the handoff prompt with loader UI
|
|
77
77
|
const result = await ctx.ui.custom<string | null>((tui, theme, _kb, done) => {
|
|
@@ -144,7 +144,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
144
144
|
// context for post-switch UI work; the original ctx is stale after a
|
|
145
145
|
// successful session replacement.
|
|
146
146
|
const newSessionResult = await ctx.newSession({
|
|
147
|
-
parentSession:
|
|
147
|
+
parentSession: currentSessionId,
|
|
148
148
|
withSession: async (replacementCtx) => {
|
|
149
149
|
replacementCtx.ui.setEditorText(editedPrompt);
|
|
150
150
|
replacementCtx.ui.notify("Handoff ready. Submit when ready.", "info");
|
|
@@ -88,11 +88,11 @@ export default function planModeExtension(pi: ExtensionAPI): void {
|
|
|
88
88
|
updateStatus(ctx);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function persistState(): void {
|
|
92
|
-
pi.appendEntry("plan-mode", {
|
|
91
|
+
async function persistState(todos: TodoItem[], executing = executionMode): Promise<void> {
|
|
92
|
+
await pi.appendEntry("plan-mode", {
|
|
93
93
|
enabled: planModeEnabled,
|
|
94
|
-
todos
|
|
95
|
-
executing
|
|
94
|
+
todos,
|
|
95
|
+
executing,
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -210,10 +210,11 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
210
210
|
if (!isAssistantMessage(event.message)) return;
|
|
211
211
|
|
|
212
212
|
const text = getTextContent(event.message);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
const nextTodos = todoItems.map((item) => ({ ...item }));
|
|
214
|
+
const changed = markCompletedSteps(text, nextTodos);
|
|
215
|
+
await persistState(nextTodos);
|
|
216
|
+
todoItems = nextTodos;
|
|
217
|
+
if (changed > 0) updateStatus(ctx);
|
|
217
218
|
});
|
|
218
219
|
|
|
219
220
|
// Handle plan completion and plan mode UI
|
|
@@ -222,15 +223,16 @@ After completing a step, include a [DONE:n] tag in your response.`,
|
|
|
222
223
|
if (executionMode && todoItems.length > 0) {
|
|
223
224
|
if (todoItems.every((t) => t.completed)) {
|
|
224
225
|
const completedList = todoItems.map((t) => `~~${t.text}~~`).join("\n");
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
{ triggerTurn: false },
|
|
228
|
-
);
|
|
226
|
+
// Commit the cleared state before publishing completion, so a failure can be retried.
|
|
227
|
+
await persistState([], false);
|
|
229
228
|
executionMode = false;
|
|
230
229
|
todoItems = [];
|
|
231
230
|
pi.setActiveTools(NORMAL_MODE_TOOLS);
|
|
232
231
|
updateStatus(ctx);
|
|
233
|
-
|
|
232
|
+
await pi.sendMessage(
|
|
233
|
+
{ customType: "plan-complete", content: `**Plan Complete!** ✓\n\n${completedList}`, display: true },
|
|
234
|
+
{ triggerTurn: false },
|
|
235
|
+
);
|
|
234
236
|
}
|
|
235
237
|
return;
|
|
236
238
|
}
|