@bastani/atomic 0.9.38-alpha.5 → 0.9.38-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +8 -6
- package/dist/builtin/intercom/CHANGELOG.md +9 -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 +78 -33
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +140 -145
- 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 +48 -0
- package/dist/builtin/workflows/builtin/{chunk-q7dx7kh7.js → chunk-85mx6wcf.js} +6 -6
- package/dist/builtin/workflows/builtin/{chunk-xg7kkgf8.js → chunk-8kkv04hz.js} +15 -15
- package/dist/builtin/workflows/builtin/{chunk-na3wpwzh.js → chunk-8x61e0s7.js} +396 -363
- package/dist/builtin/workflows/builtin/{chunk-qrrkfg9v.js → chunk-y45tkftg.js} +7 -7
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +4 -4
- package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/authoring.d.ts +3 -8
- package/dist/builtin/workflows/src/durable/journal/conformance.d.ts +9 -1
- 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/memory-run-journal.d.ts +9 -1
- package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +19 -8
- package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +45 -0
- package/dist/builtin/workflows/src/durable/journal/sqlite-run-journal.d.ts +5 -47
- package/dist/builtin/workflows/src/durable/journal/types.d.ts +9 -114
- package/dist/builtin/workflows/src/durable/journal/values.d.ts +2 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +6963 -6181
- package/dist/builtin/workflows/src/index.js +9078 -8395
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +8 -8
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +0 -14
- 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.js +2 -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 +75 -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 +6 -8
- 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 +7 -7
- package/dist/core/agent-session-tree.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 +1 -4
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +0 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.js +1 -3
- package/dist/core/compaction/pi-summary-fallback.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/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 +3 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +20 -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/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 +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/provider-attribution.js +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- 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/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 +50 -20
- 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 -104
- 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 +547 -307
- 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 +21 -14
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts +3 -13
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +28 -69
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +3 -11
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager-validation.d.ts.map +1 -1
- package/dist/core/session-manager-validation.js +3 -2
- package/dist/core/session-manager-validation.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +2 -1
- 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 +155 -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 +74 -8
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +29 -29
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/storage/errors.d.ts +1 -0
- package/dist/core/storage/errors.d.ts.map +1 -1
- package/dist/core/storage/errors.js.map +1 -1
- package/dist/core/storage/index.d.ts +5 -1
- package/dist/core/storage/index.d.ts.map +1 -1
- package/dist/core/storage/index.js +4 -1
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/node-sqlite.d.ts +2 -0
- package/dist/core/storage/node-sqlite.d.ts.map +1 -1
- package/dist/core/storage/node-sqlite.js +47 -6
- package/dist/core/storage/node-sqlite.js.map +1 -1
- 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/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/jsonl-session-store.d.ts +11 -2
- package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/jsonl-session-store.js +127 -54
- package/dist/core/storage/session/jsonl-session-store.js.map +1 -1
- package/dist/core/storage/session/legacy-format.d.ts +18 -0
- package/dist/core/storage/session/legacy-format.d.ts.map +1 -0
- package/dist/core/storage/session/legacy-format.js +63 -0
- package/dist/core/storage/session/legacy-format.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.d.ts +3 -1
- package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/memory-session-store.js +9 -2
- package/dist/core/storage/session/memory-session-store.js.map +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +4 -1
- package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/sql-session-store.js +25 -6
- package/dist/core/storage/session/sql-session-store.js.map +1 -1
- package/dist/core/storage/session/types.d.ts +4 -0
- package/dist/core/storage/session/types.d.ts.map +1 -1
- package/dist/core/storage/session/types.js.map +1 -1
- package/dist/core/storage/session/validation.js +1 -1
- package/dist/core/storage/session/validation.js.map +1 -1
- package/dist/core/storage/testing.d.ts +2 -0
- package/dist/core/storage/testing.d.ts.map +1 -1
- package/dist/core/storage/testing.js +45 -0
- package/dist/core/storage/testing.js.map +1 -1
- 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/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.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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 +148 -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.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 +16 -7
- 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 +4 -1
- 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 +27 -18
- 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 +6 -4
- package/dist/modes/interactive/interactive-input-handling.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-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-slash-commands.js +5 -3
- package/dist/modes/interactive/interactive-slash-commands.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/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/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-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 +1 -0
- 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 +8 -8
- package/docs/extensions.md +2 -2
- package/docs/getting-started/installation.md +1 -2
- package/docs/models/reference.md +2 -0
- package/docs/models-configuration.md +206 -0
- package/docs/models.md +11 -1
- package/docs/providers.md +4 -4
- 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 +15 -13
- package/docs/sdk/web-server.md +5 -6
- package/docs/sdk.md +56 -2
- package/docs/session-format.md +35 -28
- package/docs/sessions.md +50 -17
- package/docs/settings.md +44 -7
- package/docs/storage.md +346 -2
- package/docs/usage.md +3 -2
- package/docs/workflows/api-reference.md +80 -16
- package/docs/workflows/operations.md +6 -4
- package/docs/workflows/reliable-design.md +16 -16
- 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 -53
- package/package.json +7 -6
- package/schemas/models.schema.json +62 -29
- package/schemas/settings.schema.json +137 -53
- package/dist/builtin/workflows/builtin/chunk-h5fn47y5.js +0 -8
- package/dist/builtin/workflows/src/durable/journal/node-sqlite.d.ts +0 -20
|
@@ -6944,7 +6944,7 @@ var require_public_api = __commonJS(function(exports) {
|
|
|
6944
6944
|
});
|
|
6945
6945
|
|
|
6946
6946
|
// dist/builtin/subagents/src/extension/index.ts
|
|
6947
|
-
import * as
|
|
6947
|
+
import * as fs21 from "node:fs";
|
|
6948
6948
|
import * as os8 from "node:os";
|
|
6949
6949
|
import * as path23 from "node:path";
|
|
6950
6950
|
import {
|
|
@@ -10594,21 +10594,12 @@ function createTestSession(sessionManager, spec) {
|
|
|
10594
10594
|
let aborted = false;
|
|
10595
10595
|
let settlePromptAbort;
|
|
10596
10596
|
const messages = [];
|
|
10597
|
-
const promptAbort = new Promise((resolve, reject) => {
|
|
10598
|
-
settlePromptAbort = () => {
|
|
10599
|
-
if (testOptions.abortResolvesPrompt)
|
|
10600
|
-
resolve("aborted");
|
|
10601
|
-
else
|
|
10602
|
-
reject(new Error("aborted"));
|
|
10603
|
-
};
|
|
10604
|
-
});
|
|
10605
10597
|
let userMessages = 0;
|
|
10606
10598
|
let assistantMessages = 0;
|
|
10607
10599
|
const zeroTokens = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 };
|
|
10608
10600
|
const zeroCost = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 };
|
|
10609
|
-
const appendAssistant = (content, stopReason) => {
|
|
10610
|
-
|
|
10611
|
-
sessionManager.appendMessage({
|
|
10601
|
+
const appendAssistant = async (content, stopReason) => {
|
|
10602
|
+
await sessionManager.appendMessage({
|
|
10612
10603
|
role: "assistant",
|
|
10613
10604
|
content,
|
|
10614
10605
|
api: "openai-responses",
|
|
@@ -10625,6 +10616,7 @@ function createTestSession(sessionManager, spec) {
|
|
|
10625
10616
|
stopReason,
|
|
10626
10617
|
timestamp: Date.now()
|
|
10627
10618
|
});
|
|
10619
|
+
messages.push({ role: "assistant", content, stopReason });
|
|
10628
10620
|
assistantMessages += 1;
|
|
10629
10621
|
};
|
|
10630
10622
|
return {
|
|
@@ -10674,11 +10666,11 @@ function createTestSession(sessionManager, spec) {
|
|
|
10674
10666
|
appendFileSync2(testOptions.promptLogPath, `${text}
|
|
10675
10667
|
---PROMPT---
|
|
10676
10668
|
`, "utf8");
|
|
10677
|
-
sessionManager.appendMessage({ role: "user", content: text, timestamp: Date.now() });
|
|
10669
|
+
await sessionManager.appendMessage({ role: "user", content: text, timestamp: Date.now() });
|
|
10678
10670
|
userMessages += 1;
|
|
10679
10671
|
if (testOptions.seededAssistantText) {
|
|
10680
10672
|
lastAssistantText = testOptions.seededAssistantText;
|
|
10681
|
-
appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10673
|
+
await appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10682
10674
|
}
|
|
10683
10675
|
if (testOptions.fallbackBeforeGate)
|
|
10684
10676
|
emitFallback();
|
|
@@ -10688,12 +10680,21 @@ function createTestSession(sessionManager, spec) {
|
|
|
10688
10680
|
if (testOptions.promptGate) {
|
|
10689
10681
|
const gateResult = await Promise.race([
|
|
10690
10682
|
testOptions.promptGate.then(() => "released"),
|
|
10691
|
-
|
|
10683
|
+
new Promise((resolve, reject) => {
|
|
10684
|
+
settlePromptAbort = () => {
|
|
10685
|
+
if (testOptions.abortResolvesPrompt)
|
|
10686
|
+
resolve("aborted");
|
|
10687
|
+
else
|
|
10688
|
+
reject(new DOMException("aborted", "AbortError"));
|
|
10689
|
+
};
|
|
10690
|
+
if (aborted)
|
|
10691
|
+
settlePromptAbort();
|
|
10692
|
+
})
|
|
10692
10693
|
]);
|
|
10693
10694
|
if (gateResult === "aborted") {
|
|
10694
10695
|
if (testOptions.thinkingOnlyOnAbort) {
|
|
10695
10696
|
lastAssistantText = "";
|
|
10696
|
-
appendAssistant([{ type: "thinking", thinking: "aborted mid-thought" }], "aborted");
|
|
10697
|
+
await appendAssistant([{ type: "thinking", thinking: "aborted mid-thought" }], "aborted");
|
|
10697
10698
|
}
|
|
10698
10699
|
for (const event of testOptions.events ?? [])
|
|
10699
10700
|
for (const listener of listeners)
|
|
@@ -10708,7 +10709,7 @@ function createTestSession(sessionManager, spec) {
|
|
|
10708
10709
|
if (!testOptions.fallbackBeforeGate)
|
|
10709
10710
|
emitFallback();
|
|
10710
10711
|
lastAssistantText = testOptions.output ?? "done";
|
|
10711
|
-
appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10712
|
+
await appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10712
10713
|
return lastAssistantText;
|
|
10713
10714
|
},
|
|
10714
10715
|
getLastAssistantText: () => {
|
|
@@ -10780,7 +10781,7 @@ function cancelledEnvelope(session, spec, stats) {
|
|
|
10780
10781
|
progressPath: spec.progressPath,
|
|
10781
10782
|
assistantText: lastNonEmptyAssistantText(session?.messages, outputFor(session)),
|
|
10782
10783
|
toolCount: stats.toolCalls,
|
|
10783
|
-
sessionPath: session?.sessionFile ?? spec.
|
|
10784
|
+
sessionPath: session?.sessionFile ?? spec.sessionManager?.getSessionFile(),
|
|
10784
10785
|
...spec.progressArtifactPath ? { progressArtifactPath: spec.progressArtifactPath } : {},
|
|
10785
10786
|
...spec.outputArtifactPath ? { outputArtifactPath: spec.outputArtifactPath } : {}
|
|
10786
10787
|
}).text;
|
|
@@ -10873,14 +10874,14 @@ class AdmittedChild {
|
|
|
10873
10874
|
spec;
|
|
10874
10875
|
policy;
|
|
10875
10876
|
sessionDir;
|
|
10876
|
-
|
|
10877
|
+
sessionManager;
|
|
10877
10878
|
control;
|
|
10878
10879
|
constructor(input) {
|
|
10879
10880
|
this.identity = input.identity;
|
|
10880
10881
|
this.spec = input.spec;
|
|
10881
10882
|
this.policy = input.policy;
|
|
10882
10883
|
this.sessionDir = input.sessionDir;
|
|
10883
|
-
this.
|
|
10884
|
+
this.sessionManager = input.sessionManager;
|
|
10884
10885
|
this.control = input.control;
|
|
10885
10886
|
}
|
|
10886
10887
|
static create(input) {
|
|
@@ -10925,7 +10926,7 @@ class SubagentControlRuntime {
|
|
|
10925
10926
|
return refusal(native);
|
|
10926
10927
|
const identity = native.child;
|
|
10927
10928
|
const childModePolicy = resolveChildModePolicy(spec);
|
|
10928
|
-
const sessionDir = spec.
|
|
10929
|
+
const sessionDir = spec.sessionManager?.getSessionDir() || sessionDirectory(this.sessionRoot, identity.path);
|
|
10929
10930
|
mkdirSync4(sessionDir, { recursive: true });
|
|
10930
10931
|
return {
|
|
10931
10932
|
admitted: AdmittedChild.create({
|
|
@@ -10946,7 +10947,7 @@ class SubagentControlRuntime {
|
|
|
10946
10947
|
depth: identity.depth
|
|
10947
10948
|
},
|
|
10948
10949
|
sessionDir,
|
|
10949
|
-
|
|
10950
|
+
sessionManager: spec.sessionManager,
|
|
10950
10951
|
control: this
|
|
10951
10952
|
})
|
|
10952
10953
|
};
|
|
@@ -11026,7 +11027,6 @@ class SubagentControlRuntime {
|
|
|
11026
11027
|
this.attemptTokens.set(admitted.identity.path, token);
|
|
11027
11028
|
let session;
|
|
11028
11029
|
const executionEnded = new AbortController;
|
|
11029
|
-
let activeSessionManager;
|
|
11030
11030
|
let termination;
|
|
11031
11031
|
let terminating;
|
|
11032
11032
|
let terminationWasKill = false;
|
|
@@ -11044,7 +11044,6 @@ class SubagentControlRuntime {
|
|
|
11044
11044
|
termination = cause;
|
|
11045
11045
|
terminating = (async () => {
|
|
11046
11046
|
try {
|
|
11047
|
-
activeSessionManager?.flush();
|
|
11048
11047
|
await session?.abort();
|
|
11049
11048
|
} finally {
|
|
11050
11049
|
try {
|
|
@@ -11063,13 +11062,10 @@ class SubagentControlRuntime {
|
|
|
11063
11062
|
});
|
|
11064
11063
|
try {
|
|
11065
11064
|
const workflow = workflowMetadataFromContext(admitted.spec.parent?.orchestrationContext);
|
|
11066
|
-
|
|
11067
|
-
mkdirSync4(dirname7(admitted.sessionFile), { recursive: true });
|
|
11068
|
-
const sessionManager = admitted.sessionFile ? SessionManager.open(admitted.sessionFile, admitted.sessionDir, admitted.policy.cwd) : SessionManager.create(admitted.policy.cwd, admitted.sessionDir, workflow ? { internal: true, workflow } : { internal: true });
|
|
11069
|
-
activeSessionManager = sessionManager;
|
|
11065
|
+
const sessionManager = admitted.sessionManager ? await SessionManager.open(admitted.sessionManager.getSessionStore(), admitted.sessionManager.getSessionId(), admitted.policy.cwd) : await SessionManager.create(admitted.policy.cwd, admitted.sessionDir, workflow ? { internal: true, workflow } : { internal: true });
|
|
11070
11066
|
taskHooks?.bindTranscript?.(sessionManager);
|
|
11071
11067
|
if (workflow)
|
|
11072
|
-
sessionManager.markSessionInternal(workflow);
|
|
11068
|
+
await sessionManager.markSessionInternal(workflow);
|
|
11073
11069
|
let created;
|
|
11074
11070
|
if (admitted.spec.testSession) {
|
|
11075
11071
|
created = { session: createTestSession(sessionManager, admitted.spec) };
|
|
@@ -11249,7 +11245,8 @@ class SubagentControlRuntime {
|
|
|
11249
11245
|
await terminate("abort");
|
|
11250
11246
|
if (signals.interrupt.aborted)
|
|
11251
11247
|
await terminate("interrupt");
|
|
11252
|
-
|
|
11248
|
+
if (!termination)
|
|
11249
|
+
await session.prompt(admitted.spec.task);
|
|
11253
11250
|
await terminating;
|
|
11254
11251
|
const stats = statsFor(session, admitted.identity.path);
|
|
11255
11252
|
const sessionFile = session.sessionFile;
|
|
@@ -11336,9 +11333,6 @@ class SubagentControlRuntime {
|
|
|
11336
11333
|
try {
|
|
11337
11334
|
unsubscribe?.();
|
|
11338
11335
|
} catch {}
|
|
11339
|
-
try {
|
|
11340
|
-
activeSessionManager?.flush();
|
|
11341
|
-
} catch {}
|
|
11342
11336
|
if (onCleanup) {
|
|
11343
11337
|
onCleanup((async () => {
|
|
11344
11338
|
try {
|
|
@@ -12526,7 +12520,7 @@ function createExecutionBurstDispatcher(input) {
|
|
|
12526
12520
|
|
|
12527
12521
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts
|
|
12528
12522
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
12529
|
-
import * as
|
|
12523
|
+
import * as fs12 from "node:fs";
|
|
12530
12524
|
import * as path13 from "node:path";
|
|
12531
12525
|
|
|
12532
12526
|
// dist/builtin/subagents/src/agents/agent-scope.ts
|
|
@@ -12537,67 +12531,71 @@ function resolveExecutionAgentScope(scope) {
|
|
|
12537
12531
|
}
|
|
12538
12532
|
|
|
12539
12533
|
// dist/builtin/subagents/src/shared/fork-context.ts
|
|
12540
|
-
import * as fs11 from "node:fs";
|
|
12541
12534
|
import { SessionManager as SessionManager2 } from "@bastani/atomic";
|
|
12535
|
+
|
|
12536
|
+
class SubagentForkContextError extends Error {
|
|
12537
|
+
parentSessionId;
|
|
12538
|
+
reason;
|
|
12539
|
+
constructor(parentSessionId, reason, options) {
|
|
12540
|
+
super(`Cannot fork subagent session ${JSON.stringify(parentSessionId)}: ${reason}`, options);
|
|
12541
|
+
this.parentSessionId = parentSessionId;
|
|
12542
|
+
this.reason = reason;
|
|
12543
|
+
this.name = "SubagentForkContextError";
|
|
12544
|
+
}
|
|
12545
|
+
}
|
|
12542
12546
|
function resolveSubagentContext(value) {
|
|
12543
12547
|
return value === "fork" ? "fork" : "fresh";
|
|
12544
12548
|
}
|
|
12545
|
-
function createForkContextResolver(sessionManager, requestedContext
|
|
12549
|
+
function createForkContextResolver(sessionManager, requestedContext) {
|
|
12546
12550
|
if (resolveSubagentContext(requestedContext) !== "fork") {
|
|
12547
|
-
return {
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
}
|
|
12551
|
-
};
|
|
12552
|
-
}
|
|
12553
|
-
const parentSessionFile = sessionManager.getSessionFile();
|
|
12554
|
-
if (!parentSessionFile) {
|
|
12555
|
-
throw new Error("Forked subagent context requires a persisted parent session.");
|
|
12551
|
+
return { sessionManagerForIndex: async () => {
|
|
12552
|
+
return;
|
|
12553
|
+
} };
|
|
12556
12554
|
}
|
|
12555
|
+
const parentSessionId = sessionManager.getSessionId();
|
|
12556
|
+
const store = sessionManager.getSessionStore();
|
|
12557
|
+
const cwd = sessionManager.getCwd();
|
|
12557
12558
|
const leafId = sessionManager.getLeafId();
|
|
12558
|
-
if (
|
|
12559
|
-
throw new
|
|
12560
|
-
|
|
12561
|
-
const openSession = options.openSession ?? sessionManager.openSession ?? ((file, dir) => SessionManager2.open(file, dir));
|
|
12562
|
-
const sessionDir = sessionManager.getSessionDir?.();
|
|
12563
|
-
const cachedSessionFiles = new Map;
|
|
12559
|
+
if (leafId === null)
|
|
12560
|
+
throw new SubagentForkContextError(parentSessionId, "no_leaf");
|
|
12561
|
+
const children = new Map;
|
|
12564
12562
|
return {
|
|
12565
|
-
|
|
12566
|
-
const cached =
|
|
12567
|
-
if (cached)
|
|
12563
|
+
sessionManagerForIndex(index = 0) {
|
|
12564
|
+
const cached = children.get(index);
|
|
12565
|
+
if (cached !== undefined)
|
|
12568
12566
|
return cached;
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
throw new
|
|
12577
|
-
}
|
|
12578
|
-
if (!fs11.existsSync(sessionFile)) {
|
|
12579
|
-
throw new Error(`Session manager returned a forked session file that does not exist: ${sessionFile}`);
|
|
12567
|
+
const child = (async () => {
|
|
12568
|
+
try {
|
|
12569
|
+
const source = await SessionManager2.open(store, parentSessionId, cwd);
|
|
12570
|
+
await source.createBranchedSession(leafId);
|
|
12571
|
+
return source;
|
|
12572
|
+
} catch (cause) {
|
|
12573
|
+
children.delete(index);
|
|
12574
|
+
throw new SubagentForkContextError(parentSessionId, "fork_failed", { cause });
|
|
12580
12575
|
}
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
const cause = error instanceof Error ? error : new Error(String(error));
|
|
12585
|
-
throw new Error(`Failed to create forked subagent session: ${cause.message}`, { cause });
|
|
12586
|
-
}
|
|
12576
|
+
})();
|
|
12577
|
+
children.set(index, child);
|
|
12578
|
+
return child;
|
|
12587
12579
|
}
|
|
12588
12580
|
};
|
|
12589
12581
|
}
|
|
12590
12582
|
|
|
12591
12583
|
// dist/builtin/subagents/src/shared/session-identity.ts
|
|
12584
|
+
class SubagentSessionIdentityError extends Error {
|
|
12585
|
+
constructor() {
|
|
12586
|
+
super("Current session identity is unavailable.");
|
|
12587
|
+
this.name = "SubagentSessionIdentityError";
|
|
12588
|
+
}
|
|
12589
|
+
}
|
|
12592
12590
|
function resolveCurrentSessionId(sessionManager) {
|
|
12593
|
-
const sessionId = sessionManager.
|
|
12594
|
-
if (
|
|
12595
|
-
throw new
|
|
12591
|
+
const sessionId = sessionManager.getSessionId();
|
|
12592
|
+
if (sessionId === undefined || sessionId === null)
|
|
12593
|
+
throw new SubagentSessionIdentityError;
|
|
12596
12594
|
return sessionId;
|
|
12597
12595
|
}
|
|
12598
12596
|
|
|
12599
12597
|
// dist/builtin/subagents/src/shared/settings.ts
|
|
12600
|
-
import * as
|
|
12598
|
+
import * as fs11 from "node:fs";
|
|
12601
12599
|
import * as path12 from "node:path";
|
|
12602
12600
|
function normalizeOutputOverride(output) {
|
|
12603
12601
|
return output === "false" ? false : output;
|
|
@@ -12637,8 +12635,8 @@ function buildReadInstruction(reads, cwd) {
|
|
|
12637
12635
|
return `[Read from: ${files.join(", ")}]`;
|
|
12638
12636
|
}
|
|
12639
12637
|
function writeInitialProgressFile(progressDir) {
|
|
12640
|
-
|
|
12641
|
-
|
|
12638
|
+
fs11.mkdirSync(progressDir, { recursive: true });
|
|
12639
|
+
fs11.writeFileSync(path12.join(progressDir, "progress.md"), INITIAL_PROGRESS_CONTENT);
|
|
12642
12640
|
}
|
|
12643
12641
|
function injectSingleProgressInstruction(task, progressDir) {
|
|
12644
12642
|
return `${task}
|
|
@@ -12754,11 +12752,9 @@ function prepareExecutionContext(input) {
|
|
|
12754
12752
|
|
|
12755
12753
|
${effectiveParams.task ?? ""}` };
|
|
12756
12754
|
}
|
|
12757
|
-
let
|
|
12758
|
-
return;
|
|
12759
|
-
};
|
|
12755
|
+
let sessionManagerForIndex;
|
|
12760
12756
|
try {
|
|
12761
|
-
|
|
12757
|
+
sessionManagerForIndex = createForkContextResolver(ctx.sessionManager, effectiveParams.context).sessionManagerForIndex;
|
|
12762
12758
|
} catch (error) {
|
|
12763
12759
|
return { error: toExecutionErrorResult(effectiveParams, error) };
|
|
12764
12760
|
}
|
|
@@ -12776,7 +12772,7 @@ ${effectiveParams.task ?? ""}` };
|
|
|
12776
12772
|
sessionRoot = path13.join(baseSessionRoot, runId);
|
|
12777
12773
|
}
|
|
12778
12774
|
try {
|
|
12779
|
-
|
|
12775
|
+
fs12.mkdirSync(sessionRoot, { recursive: true });
|
|
12780
12776
|
} catch (error) {
|
|
12781
12777
|
const message = error instanceof Error ? error.message : String(error);
|
|
12782
12778
|
return {
|
|
@@ -12784,7 +12780,6 @@ ${effectiveParams.task ?? ""}` };
|
|
|
12784
12780
|
};
|
|
12785
12781
|
}
|
|
12786
12782
|
const sessionDirForIndex = (idx) => path13.join(sessionRoot, `run-${idx ?? 0}`);
|
|
12787
|
-
const childSessionFileForIndex = (idx) => sessionFileForIndex(idx) ?? path13.join(sessionDirForIndex(idx), "session.jsonl");
|
|
12788
12783
|
const onUpdateWithContext = onUpdate ? (r) => onUpdate(withForkContext(r, effectiveParams.context)) : undefined;
|
|
12789
12784
|
const execData = {
|
|
12790
12785
|
params: effectiveParams,
|
|
@@ -12798,7 +12793,7 @@ ${effectiveParams.task ?? ""}` };
|
|
|
12798
12793
|
shareEnabled,
|
|
12799
12794
|
sessionRoot,
|
|
12800
12795
|
sessionDirForIndex,
|
|
12801
|
-
|
|
12796
|
+
sessionManagerForIndex,
|
|
12802
12797
|
artifactConfig,
|
|
12803
12798
|
artifactsDir,
|
|
12804
12799
|
parentDepth: depth,
|
|
@@ -13001,7 +12996,7 @@ async function routeSubagentModel(input) {
|
|
|
13001
12996
|
}
|
|
13002
12997
|
|
|
13003
12998
|
// dist/builtin/subagents/src/runs/shared/run-history.ts
|
|
13004
|
-
import * as
|
|
12999
|
+
import * as fs13 from "node:fs";
|
|
13005
13000
|
import * as os6 from "node:os";
|
|
13006
13001
|
import * as path14 from "node:path";
|
|
13007
13002
|
import { getAgentConfigPaths as getAgentConfigPaths4 } from "@bastani/atomic";
|
|
@@ -13016,14 +13011,14 @@ function recordRun(agent, task, status, durationMs) {
|
|
|
13016
13011
|
status,
|
|
13017
13012
|
duration: durationMs
|
|
13018
13013
|
};
|
|
13019
|
-
|
|
13020
|
-
|
|
13014
|
+
fs13.mkdirSync(path14.dirname(HISTORY_PATH), { recursive: true });
|
|
13015
|
+
fs13.appendFileSync(HISTORY_PATH, `${JSON.stringify(entry)}
|
|
13021
13016
|
`);
|
|
13022
13017
|
} catch {}
|
|
13023
13018
|
}
|
|
13024
13019
|
|
|
13025
13020
|
// dist/builtin/subagents/src/runs/shared/single-output.ts
|
|
13026
|
-
import * as
|
|
13021
|
+
import * as fs14 from "node:fs";
|
|
13027
13022
|
import * as path15 from "node:path";
|
|
13028
13023
|
function normalizeSingleOutputOverride(output, defaultOutput) {
|
|
13029
13024
|
if (output === false || output === "false")
|
|
@@ -13089,7 +13084,7 @@ function captureSingleOutputSnapshot(outputPath) {
|
|
|
13089
13084
|
if (!outputPath)
|
|
13090
13085
|
return;
|
|
13091
13086
|
try {
|
|
13092
|
-
const stat =
|
|
13087
|
+
const stat = fs14.statSync(outputPath);
|
|
13093
13088
|
return { exists: true, mtimeMs: stat.mtimeMs, size: stat.size };
|
|
13094
13089
|
} catch {
|
|
13095
13090
|
return { exists: false };
|
|
@@ -13099,8 +13094,8 @@ function persistSingleOutput(outputPath, fullOutput) {
|
|
|
13099
13094
|
if (!outputPath)
|
|
13100
13095
|
return {};
|
|
13101
13096
|
try {
|
|
13102
|
-
|
|
13103
|
-
|
|
13097
|
+
fs14.mkdirSync(path15.dirname(outputPath), { recursive: true });
|
|
13098
|
+
fs14.writeFileSync(outputPath, fullOutput, "utf-8");
|
|
13104
13099
|
return { savedPath: outputPath };
|
|
13105
13100
|
} catch (err) {
|
|
13106
13101
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
@@ -13111,7 +13106,7 @@ function resolveSingleOutput(outputPath, fallbackOutput, beforeRun) {
|
|
|
13111
13106
|
return { fullOutput: fallbackOutput };
|
|
13112
13107
|
let changedSinceStart = false;
|
|
13113
13108
|
try {
|
|
13114
|
-
const stat =
|
|
13109
|
+
const stat = fs14.statSync(outputPath);
|
|
13115
13110
|
changedSinceStart = !beforeRun?.exists || stat.mtimeMs !== beforeRun.mtimeMs || stat.size !== beforeRun.size;
|
|
13116
13111
|
} catch (error) {
|
|
13117
13112
|
const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
|
|
@@ -13124,7 +13119,7 @@ function resolveSingleOutput(outputPath, fallbackOutput, beforeRun) {
|
|
|
13124
13119
|
}
|
|
13125
13120
|
if (changedSinceStart) {
|
|
13126
13121
|
try {
|
|
13127
|
-
return { fullOutput:
|
|
13122
|
+
return { fullOutput: fs14.readFileSync(outputPath, "utf-8"), savedPath: outputPath };
|
|
13128
13123
|
} catch (error) {
|
|
13129
13124
|
return {
|
|
13130
13125
|
fullOutput: fallbackOutput,
|
|
@@ -13161,13 +13156,13 @@ ${params.saveError}`;
|
|
|
13161
13156
|
|
|
13162
13157
|
// dist/builtin/subagents/src/runs/shared/worktree.ts
|
|
13163
13158
|
import { spawnSync } from "node:child_process";
|
|
13164
|
-
import * as
|
|
13159
|
+
import * as fs17 from "node:fs";
|
|
13165
13160
|
import * as os7 from "node:os";
|
|
13166
13161
|
import * as path18 from "node:path";
|
|
13167
13162
|
import { createChildProcessEnvironment as createChildProcessEnvironment3, createGitEnvironment } from "@bastani/atomic";
|
|
13168
13163
|
|
|
13169
13164
|
// dist/builtin/subagents/src/runs/shared/worktree-post-create.ts
|
|
13170
|
-
import * as
|
|
13165
|
+
import * as fs15 from "node:fs";
|
|
13171
13166
|
import * as path16 from "node:path";
|
|
13172
13167
|
function tracked(runGit, repo, relativePath) {
|
|
13173
13168
|
return runGit(repo, ["ls-files", "--error-unmatch", "--", relativePath]).status === 0;
|
|
@@ -13186,10 +13181,10 @@ function hasTrackedPathComponent(runGit, repo, relativePath) {
|
|
|
13186
13181
|
function copySettings(runGit, mainRoot, worktreeRoot, relativePath) {
|
|
13187
13182
|
const source = path16.join(mainRoot, relativePath);
|
|
13188
13183
|
const destination = path16.join(worktreeRoot, relativePath);
|
|
13189
|
-
if (!
|
|
13184
|
+
if (!fs15.existsSync(source) || fs15.existsSync(destination) || hasTrackedPathComponent(runGit, worktreeRoot, relativePath))
|
|
13190
13185
|
return false;
|
|
13191
|
-
|
|
13192
|
-
|
|
13186
|
+
fs15.mkdirSync(path16.dirname(destination), { recursive: true });
|
|
13187
|
+
fs15.copyFileSync(source, destination);
|
|
13193
13188
|
return true;
|
|
13194
13189
|
}
|
|
13195
13190
|
function configureHooks(runGit, mainRoot) {
|
|
@@ -13197,12 +13192,12 @@ function configureHooks(runGit, mainRoot) {
|
|
|
13197
13192
|
const ordinary = path16.join(mainRoot, ".git", "hooks");
|
|
13198
13193
|
let desired;
|
|
13199
13194
|
try {
|
|
13200
|
-
if (
|
|
13195
|
+
if (fs15.statSync(husky).isDirectory())
|
|
13201
13196
|
desired = husky;
|
|
13202
13197
|
} catch {}
|
|
13203
13198
|
if (!desired) {
|
|
13204
13199
|
try {
|
|
13205
|
-
if (
|
|
13200
|
+
if (fs15.readdirSync(ordinary, { withFileTypes: true }).some((entry) => entry.isFile() && !entry.name.endsWith(".sample")))
|
|
13206
13201
|
desired = ordinary;
|
|
13207
13202
|
} catch {}
|
|
13208
13203
|
}
|
|
@@ -13216,7 +13211,7 @@ function configureHooks(runGit, mainRoot) {
|
|
|
13216
13211
|
throw new Error(result.stderr.trim() || "failed to configure shared core.hooksPath");
|
|
13217
13212
|
}
|
|
13218
13213
|
function copyIncludes(runGit, mainRoot, worktreeRoot) {
|
|
13219
|
-
if (!
|
|
13214
|
+
if (!fs15.existsSync(path16.join(mainRoot, ".worktreeinclude")))
|
|
13220
13215
|
return;
|
|
13221
13216
|
const ignored = runGit(mainRoot, ["ls-files", "--others", "--ignored", "--exclude-standard"]);
|
|
13222
13217
|
const included = runGit(mainRoot, ["ls-files", "--others", "--ignored", "--exclude-from=.worktreeinclude"]);
|
|
@@ -13229,10 +13224,10 @@ function copyIncludes(runGit, mainRoot, worktreeRoot) {
|
|
|
13229
13224
|
const source = path16.join(mainRoot, relativePath);
|
|
13230
13225
|
const destination = path16.join(worktreeRoot, relativePath);
|
|
13231
13226
|
try {
|
|
13232
|
-
if (!
|
|
13227
|
+
if (!fs15.statSync(source).isFile() || fs15.existsSync(destination))
|
|
13233
13228
|
continue;
|
|
13234
|
-
|
|
13235
|
-
|
|
13229
|
+
fs15.mkdirSync(path16.dirname(destination), { recursive: true });
|
|
13230
|
+
fs15.copyFileSync(source, destination);
|
|
13236
13231
|
} catch {}
|
|
13237
13232
|
}
|
|
13238
13233
|
}
|
|
@@ -13246,9 +13241,9 @@ function performPostCreationSetup(runGit, mainRoot, worktreeRoot) {
|
|
|
13246
13241
|
configureHooks(runGit, mainRoot);
|
|
13247
13242
|
const source = path16.join(mainRoot, "node_modules");
|
|
13248
13243
|
const destination = path16.join(worktreeRoot, "node_modules");
|
|
13249
|
-
if (
|
|
13244
|
+
if (fs15.existsSync(source) && !fs15.existsSync(destination) && !tracked(runGit, worktreeRoot, "node_modules")) {
|
|
13250
13245
|
try {
|
|
13251
|
-
|
|
13246
|
+
fs15.symlinkSync(source, destination, process.platform === "win32" ? "junction" : undefined);
|
|
13252
13247
|
synthetic.push("node_modules");
|
|
13253
13248
|
} catch {}
|
|
13254
13249
|
}
|
|
@@ -13257,19 +13252,19 @@ function performPostCreationSetup(runGit, mainRoot, worktreeRoot) {
|
|
|
13257
13252
|
}
|
|
13258
13253
|
|
|
13259
13254
|
// dist/builtin/subagents/src/runs/shared/worktree-root.ts
|
|
13260
|
-
import * as
|
|
13255
|
+
import * as fs16 from "node:fs";
|
|
13261
13256
|
import * as path17 from "node:path";
|
|
13262
13257
|
function readText(file) {
|
|
13263
13258
|
try {
|
|
13264
|
-
return
|
|
13259
|
+
return fs16.readFileSync(file, "utf8");
|
|
13265
13260
|
} catch {
|
|
13266
13261
|
return;
|
|
13267
13262
|
}
|
|
13268
13263
|
}
|
|
13269
13264
|
function samePath(left, right) {
|
|
13270
13265
|
try {
|
|
13271
|
-
const a =
|
|
13272
|
-
const b =
|
|
13266
|
+
const a = fs16.realpathSync.native(left);
|
|
13267
|
+
const b = fs16.realpathSync.native(right);
|
|
13273
13268
|
return process.platform === "win32" ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
13274
13269
|
} catch {
|
|
13275
13270
|
return false;
|
|
@@ -13278,14 +13273,14 @@ function samePath(left, right) {
|
|
|
13278
13273
|
function findGitRoot(cwd) {
|
|
13279
13274
|
let current = path17.resolve(cwd);
|
|
13280
13275
|
try {
|
|
13281
|
-
if (!
|
|
13276
|
+
if (!fs16.statSync(current).isDirectory())
|
|
13282
13277
|
current = path17.dirname(current);
|
|
13283
13278
|
} catch {
|
|
13284
13279
|
return;
|
|
13285
13280
|
}
|
|
13286
13281
|
while (true) {
|
|
13287
13282
|
try {
|
|
13288
|
-
const entry =
|
|
13283
|
+
const entry = fs16.statSync(path17.join(current, ".git"));
|
|
13289
13284
|
if (entry.isDirectory() || entry.isFile())
|
|
13290
13285
|
return current;
|
|
13291
13286
|
} catch {}
|
|
@@ -13299,7 +13294,7 @@ function resolveMainRepoRoot(repoRoot) {
|
|
|
13299
13294
|
const gitEntry = path17.join(repoRoot, ".git");
|
|
13300
13295
|
let stats;
|
|
13301
13296
|
try {
|
|
13302
|
-
stats =
|
|
13297
|
+
stats = fs16.statSync(gitEntry);
|
|
13303
13298
|
} catch {
|
|
13304
13299
|
return;
|
|
13305
13300
|
}
|
|
@@ -13386,7 +13381,7 @@ function resolveRepoState(cwd) {
|
|
|
13386
13381
|
function normalizeComparableCwd(cwd) {
|
|
13387
13382
|
const resolved = path18.resolve(cwd);
|
|
13388
13383
|
try {
|
|
13389
|
-
return
|
|
13384
|
+
return fs17.realpathSync(resolved);
|
|
13390
13385
|
} catch {
|
|
13391
13386
|
return resolved;
|
|
13392
13387
|
}
|
|
@@ -13421,8 +13416,8 @@ function buildWorktreePath(mainRoot, runId, index) {
|
|
|
13421
13416
|
}
|
|
13422
13417
|
function ensureWorktreeIgnore(mainRoot) {
|
|
13423
13418
|
const root = path18.join(mainRoot, ".atomic", "worktrees");
|
|
13424
|
-
|
|
13425
|
-
|
|
13419
|
+
fs17.mkdirSync(root, { recursive: true });
|
|
13420
|
+
fs17.writeFileSync(path18.join(root, ".gitignore"), `*
|
|
13426
13421
|
`, "utf8");
|
|
13427
13422
|
}
|
|
13428
13423
|
function resolveRepoCwdRelative(cwd) {
|
|
@@ -13458,10 +13453,10 @@ function resolveWorktreeSetupHook(repoRoot, config) {
|
|
|
13458
13453
|
} else {
|
|
13459
13454
|
throw new Error("worktree setup hook must be an absolute path or a repo-relative path");
|
|
13460
13455
|
}
|
|
13461
|
-
if (!
|
|
13456
|
+
if (!fs17.existsSync(resolvedPath)) {
|
|
13462
13457
|
throw new Error(`worktree setup hook not found: ${resolvedPath}`);
|
|
13463
13458
|
}
|
|
13464
|
-
if (
|
|
13459
|
+
if (fs17.statSync(resolvedPath).isDirectory()) {
|
|
13465
13460
|
throw new Error(`worktree setup hook must be a file, got directory: ${resolvedPath}`);
|
|
13466
13461
|
}
|
|
13467
13462
|
return {
|
|
@@ -13608,7 +13603,7 @@ function removeSyntheticPath(worktree, syntheticPath) {
|
|
|
13608
13603
|
}
|
|
13609
13604
|
let stat;
|
|
13610
13605
|
try {
|
|
13611
|
-
stat =
|
|
13606
|
+
stat = fs17.lstatSync(resolved);
|
|
13612
13607
|
} catch (error) {
|
|
13613
13608
|
const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
|
|
13614
13609
|
if (code === "ENOENT")
|
|
@@ -13616,14 +13611,14 @@ function removeSyntheticPath(worktree, syntheticPath) {
|
|
|
13616
13611
|
throw error;
|
|
13617
13612
|
}
|
|
13618
13613
|
if (stat.isSymbolicLink()) {
|
|
13619
|
-
|
|
13614
|
+
fs17.unlinkSync(resolved);
|
|
13620
13615
|
return;
|
|
13621
13616
|
}
|
|
13622
13617
|
if (stat.isDirectory()) {
|
|
13623
|
-
|
|
13618
|
+
fs17.rmSync(resolved, { recursive: true, force: true });
|
|
13624
13619
|
return;
|
|
13625
13620
|
}
|
|
13626
|
-
|
|
13621
|
+
fs17.rmSync(resolved, { force: true });
|
|
13627
13622
|
}
|
|
13628
13623
|
function removeSyntheticPathsBeforeDiff(worktree) {
|
|
13629
13624
|
if (worktree.syntheticPaths.length === 0)
|
|
@@ -13672,7 +13667,7 @@ function captureWorktreeDiff(setup, worktree, agent, patchPath) {
|
|
|
13672
13667
|
const diffStat = runGitChecked(worktree.path, ["diff", "--cached", "--stat", setup.baseCommit]).trim();
|
|
13673
13668
|
const patch = runGitChecked(worktree.path, ["diff", "--cached", setup.baseCommit]);
|
|
13674
13669
|
const numstat = runGitChecked(worktree.path, ["diff", "--cached", "--numstat", setup.baseCommit]);
|
|
13675
|
-
|
|
13670
|
+
fs17.writeFileSync(patchPath, patch, "utf-8");
|
|
13676
13671
|
if (!patch.trim()) {
|
|
13677
13672
|
return emptyDiff(worktree.index, agent, worktree.branch, patchPath);
|
|
13678
13673
|
}
|
|
@@ -13690,7 +13685,7 @@ function captureWorktreeDiff(setup, worktree, agent, patchPath) {
|
|
|
13690
13685
|
}
|
|
13691
13686
|
function writeEmptyPatch(patchPath) {
|
|
13692
13687
|
try {
|
|
13693
|
-
|
|
13688
|
+
fs17.writeFileSync(patchPath, "", "utf-8");
|
|
13694
13689
|
} catch {}
|
|
13695
13690
|
}
|
|
13696
13691
|
function hasWorktreeChanges(diff) {
|
|
@@ -13713,7 +13708,7 @@ function createWorktrees(cwd, runId, count, options) {
|
|
|
13713
13708
|
}
|
|
13714
13709
|
function diffWorktrees(setup, agents, diffsDir) {
|
|
13715
13710
|
try {
|
|
13716
|
-
|
|
13711
|
+
fs17.mkdirSync(diffsDir, { recursive: true });
|
|
13717
13712
|
} catch {
|
|
13718
13713
|
return [];
|
|
13719
13714
|
}
|
|
@@ -13940,7 +13935,7 @@ async function runForegroundParallelTasks(input) {
|
|
|
13940
13935
|
runId: input.runId,
|
|
13941
13936
|
index,
|
|
13942
13937
|
sessionDir: input.sessionDirForIndex(index),
|
|
13943
|
-
|
|
13938
|
+
sessionManager: await input.sessionManagerForIndex(index),
|
|
13944
13939
|
share: input.shareEnabled,
|
|
13945
13940
|
artifactsDir: input.artifactConfig.enabled ? input.artifactsDir : undefined,
|
|
13946
13941
|
artifactConfig: input.artifactConfig,
|
|
@@ -14513,7 +14508,7 @@ async function runParallelPath(data, deps) {
|
|
|
14513
14508
|
signal,
|
|
14514
14509
|
runId,
|
|
14515
14510
|
sessionDirForIndex,
|
|
14516
|
-
|
|
14511
|
+
sessionManagerForIndex,
|
|
14517
14512
|
shareEnabled,
|
|
14518
14513
|
artifactConfig,
|
|
14519
14514
|
artifactsDir,
|
|
@@ -14665,7 +14660,7 @@ async function runParallelPath(data, deps) {
|
|
|
14665
14660
|
signal,
|
|
14666
14661
|
runId,
|
|
14667
14662
|
sessionDirForIndex,
|
|
14668
|
-
|
|
14663
|
+
sessionManagerForIndex,
|
|
14669
14664
|
shareEnabled,
|
|
14670
14665
|
artifactConfig,
|
|
14671
14666
|
artifactsDir,
|
|
@@ -14787,7 +14782,7 @@ ${worktreeSuffix}` : childContent;
|
|
|
14787
14782
|
}
|
|
14788
14783
|
|
|
14789
14784
|
// dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts
|
|
14790
|
-
import { existsSync as
|
|
14785
|
+
import { existsSync as existsSync14, statSync as statSync9 } from "node:fs";
|
|
14791
14786
|
import { join as join20 } from "node:path";
|
|
14792
14787
|
|
|
14793
14788
|
// dist/builtin/subagents/src/runs/shared/model-candidate-filter.ts
|
|
@@ -15096,7 +15091,7 @@ function noSpawnableCandidatesResult(agent, task, skippedAttempts) {
|
|
|
15096
15091
|
}
|
|
15097
15092
|
async function runSingleInProcess(runtimeCwd, agent, task, options) {
|
|
15098
15093
|
const cwd = options.cwd ?? runtimeCwd;
|
|
15099
|
-
if (!
|
|
15094
|
+
if (!existsSync14(cwd))
|
|
15100
15095
|
return refusedResult(agent, task, `cwd does not exist: ${cwd}`);
|
|
15101
15096
|
if (!statSync9(cwd).isDirectory())
|
|
15102
15097
|
return refusedResult(agent, task, `cwd is not a directory: ${cwd}`);
|
|
@@ -15157,7 +15152,7 @@ ${task}`);
|
|
|
15157
15152
|
agent,
|
|
15158
15153
|
cwd,
|
|
15159
15154
|
testSession,
|
|
15160
|
-
|
|
15155
|
+
sessionManager: options.sessionManager,
|
|
15161
15156
|
...options.progressPath ? { progressPath: options.progressPath } : {},
|
|
15162
15157
|
...options.progressArtifactPath ? { progressArtifactPath: options.progressArtifactPath } : options.progressPath && artifactsDir ? { progressArtifactPath: options.progressPath } : {},
|
|
15163
15158
|
...artifactPaths?.outputPath ? { outputArtifactPath: artifactPaths.outputPath } : {},
|
|
@@ -15402,7 +15397,7 @@ function resolveSubagentExecutorRuntimeDeps(overrides) {
|
|
|
15402
15397
|
}
|
|
15403
15398
|
|
|
15404
15399
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts
|
|
15405
|
-
import * as
|
|
15400
|
+
import * as fs18 from "node:fs";
|
|
15406
15401
|
import * as path20 from "node:path";
|
|
15407
15402
|
function formatFailedSingleRunOutput(result, displayOutput) {
|
|
15408
15403
|
const error = result.error || "Failed";
|
|
@@ -15421,7 +15416,7 @@ function cleanupTransientProgress(progressDir, artifactsEnabled) {
|
|
|
15421
15416
|
if (!progressDir || artifactsEnabled)
|
|
15422
15417
|
return;
|
|
15423
15418
|
try {
|
|
15424
|
-
|
|
15419
|
+
fs18.rmSync(progressDir, { recursive: true, force: true });
|
|
15425
15420
|
} catch {}
|
|
15426
15421
|
}
|
|
15427
15422
|
function createForwardSingleUpdate(onUpdate, foregroundControl, agent, index) {
|
|
@@ -15454,7 +15449,7 @@ async function runSinglePath(data, deps) {
|
|
|
15454
15449
|
signal,
|
|
15455
15450
|
runId,
|
|
15456
15451
|
sessionDirForIndex,
|
|
15457
|
-
|
|
15452
|
+
sessionManagerForIndex,
|
|
15458
15453
|
shareEnabled,
|
|
15459
15454
|
artifactConfig,
|
|
15460
15455
|
artifactsDir,
|
|
@@ -15551,7 +15546,7 @@ async function runSinglePath(data, deps) {
|
|
|
15551
15546
|
intercomEvents: deps.pi.events,
|
|
15552
15547
|
runId,
|
|
15553
15548
|
sessionDir: sessionDirForIndex(0),
|
|
15554
|
-
|
|
15549
|
+
sessionManager: await sessionManagerForIndex(0),
|
|
15555
15550
|
share: shareEnabled,
|
|
15556
15551
|
artifactsDir: artifactConfig.enabled ? artifactsDir : undefined,
|
|
15557
15552
|
artifactConfig,
|
|
@@ -17519,13 +17514,13 @@ function renderSubagentResult(result, options, theme) {
|
|
|
17519
17514
|
return appendParentAskOutput(c, handoffOutput, theme);
|
|
17520
17515
|
}
|
|
17521
17516
|
// dist/builtin/subagents/src/extension/config.ts
|
|
17522
|
-
import * as
|
|
17517
|
+
import * as fs19 from "node:fs";
|
|
17523
17518
|
import { getAgentConfigPaths as getAgentConfigPaths5 } from "@bastani/atomic";
|
|
17524
17519
|
function loadConfig() {
|
|
17525
17520
|
for (const configPath of getAgentConfigPaths5("extensions", "subagent", "config.json")) {
|
|
17526
17521
|
try {
|
|
17527
|
-
if (
|
|
17528
|
-
return JSON.parse(
|
|
17522
|
+
if (fs19.existsSync(configPath)) {
|
|
17523
|
+
return JSON.parse(fs19.readFileSync(configPath, "utf-8"));
|
|
17529
17524
|
}
|
|
17530
17525
|
} catch (error) {
|
|
17531
17526
|
console.error(`Failed to load subagent config from '${configPath}':`, error);
|
|
@@ -17957,11 +17952,11 @@ function getApiScopedSet(pi, key) {
|
|
|
17957
17952
|
import * as path22 from "node:path";
|
|
17958
17953
|
|
|
17959
17954
|
// dist/builtin/subagents/src/runs/inprocess/runtime-support/temp-cleanup.ts
|
|
17960
|
-
import * as
|
|
17955
|
+
import * as fs20 from "node:fs";
|
|
17961
17956
|
import * as path21 from "node:path";
|
|
17962
17957
|
var SUBAGENT_RUNTIME_TEMP_DIR = path21.join(TEMP_ROOT_DIR, "nested-subagent-events");
|
|
17963
17958
|
function hasEntryNewerThan(filePath, cutoff) {
|
|
17964
|
-
const stat =
|
|
17959
|
+
const stat = fs20.statSync(filePath);
|
|
17965
17960
|
if (stat.mtimeMs >= cutoff)
|
|
17966
17961
|
return true;
|
|
17967
17962
|
if (!stat.isDirectory())
|
|
@@ -17971,14 +17966,14 @@ function hasEntryNewerThan(filePath, cutoff) {
|
|
|
17971
17966
|
function directoryHasEntryNewerThan(dirPath, cutoff) {
|
|
17972
17967
|
let entries;
|
|
17973
17968
|
try {
|
|
17974
|
-
entries =
|
|
17969
|
+
entries = fs20.readdirSync(dirPath);
|
|
17975
17970
|
} catch {
|
|
17976
17971
|
return false;
|
|
17977
17972
|
}
|
|
17978
17973
|
for (const entry of entries) {
|
|
17979
17974
|
const childPath = path21.join(dirPath, entry);
|
|
17980
17975
|
try {
|
|
17981
|
-
const stat =
|
|
17976
|
+
const stat = fs20.statSync(childPath);
|
|
17982
17977
|
if (stat.mtimeMs >= cutoff)
|
|
17983
17978
|
return true;
|
|
17984
17979
|
if (stat.isDirectory() && directoryHasEntryNewerThan(childPath, cutoff))
|
|
@@ -17990,7 +17985,7 @@ function directoryHasEntryNewerThan(dirPath, cutoff) {
|
|
|
17990
17985
|
function cleanupOldSubdirectories(root, maxAgeDays) {
|
|
17991
17986
|
let entries;
|
|
17992
17987
|
try {
|
|
17993
|
-
entries =
|
|
17988
|
+
entries = fs20.readdirSync(root);
|
|
17994
17989
|
} catch (error) {
|
|
17995
17990
|
if (error.code === "ENOENT")
|
|
17996
17991
|
return;
|
|
@@ -18001,7 +17996,7 @@ function cleanupOldSubdirectories(root, maxAgeDays) {
|
|
|
18001
17996
|
const entryPath = path21.join(root, entry);
|
|
18002
17997
|
try {
|
|
18003
17998
|
if (!hasEntryNewerThan(entryPath, cutoff))
|
|
18004
|
-
|
|
17999
|
+
fs20.rmSync(entryPath, { recursive: true, force: true });
|
|
18005
18000
|
} catch {}
|
|
18006
18001
|
}
|
|
18007
18002
|
}
|
|
@@ -18106,7 +18101,7 @@ function getSubagentSessionRoot(parentSessionFile) {
|
|
|
18106
18101
|
const sessionsDir = path23.dirname(parentSessionFile);
|
|
18107
18102
|
return path23.join(sessionsDir, baseName);
|
|
18108
18103
|
}
|
|
18109
|
-
return
|
|
18104
|
+
return fs21.mkdtempSync(path23.join(os8.tmpdir(), `${APP_NAME3}-subagent-session-`));
|
|
18110
18105
|
}
|
|
18111
18106
|
function expandTilde2(p) {
|
|
18112
18107
|
return p.startsWith("~/") ? path23.join(os8.homedir(), p.slice(2)) : p;
|