@bastani/atomic 0.9.37 → 0.9.38-alpha.10
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 +151 -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-rhkg3d8e.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-3xffzzbg.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 +29510 -64819
- package/dist/builtin/workflows/src/index.js +10767 -45878
- 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/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +4 -4
- package/dist/cli/credential-print.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 +3 -3
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +98 -64
- 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 +17 -17
- 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 +18 -16
- 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-state.d.ts +4 -6
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +13 -8
- package/dist/core/agent-session-state.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-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +3 -1
- package/dist/core/agent-session-tool-registry.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/agent-session.js +1 -1
- package/dist/core/agent-session.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/message-tools.js +20 -7
- package/dist/core/export-html/template-js/tree-filter-render.js +1 -9
- package/dist/core/export-html/template.js +22 -17
- 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 +774 -9
- 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-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +3 -1
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/model-resolver-cli.d.ts +2 -0
- package/dist/core/model-resolver-cli.d.ts.map +1 -1
- package/dist/core/model-resolver-cli.js +47 -143
- package/dist/core/model-resolver-cli.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-resolver-patterns.d.ts +48 -22
- package/dist/core/model-resolver-patterns.d.ts.map +1 -1
- package/dist/core/model-resolver-patterns.js +154 -105
- package/dist/core/model-resolver-patterns.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +6 -9
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.js +51 -53
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-resolver-types.d.ts +0 -6
- package/dist/core/model-resolver-types.d.ts.map +1 -1
- package/dist/core/model-resolver-types.js.map +1 -1
- package/dist/core/model-resolver.d.ts +3 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.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/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +6 -2
- package/dist/core/prompt-templates.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/retry-policy.d.ts +5 -2
- package/dist/core/retry-policy.d.ts.map +1 -1
- package/dist/core/retry-policy.js +4 -3
- package/dist/core/retry-policy.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 +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +1 -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/malformed-tool-arguments.d.ts +3 -0
- package/dist/core/tools/malformed-tool-arguments.d.ts.map +1 -0
- package/dist/core/tools/malformed-tool-arguments.js +23 -0
- package/dist/core/tools/malformed-tool-arguments.js.map +1 -0
- 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/render-utils.d.ts +2 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +19 -0
- package/dist/core/tools/render-utils.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-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 +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/main-session-options.d.ts.map +1 -1
- package/dist/main-session-options.js +1 -0
- package/dist/main-session-options.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.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/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +2 -9
- package/dist/modes/interactive/components/tree-selector-content.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-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +2 -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-queueing.js +8 -5
- 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 +6 -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 +6 -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 +12 -8
- package/docs/extensions/ui.md +10 -0
- 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 +95 -0
- package/docs/models/reference.md +9 -0
- package/docs/models-configuration.md +206 -0
- package/docs/models.md +11 -1
- package/docs/packages/authoring.md +1 -1
- package/docs/prompt-templates.md +2 -0
- package/docs/providers.md +13 -5
- package/docs/quickstart.md +2 -1
- package/docs/reference/cli.md +10 -6
- 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 +56 -17
- package/docs/settings.md +38 -25
- package/docs/storage.md +387 -0
- package/docs/subagents.md +19 -6
- package/docs/tools.md +2 -0
- package/docs/usage.md +3 -2
- package/docs/workflows/api-reference.md +88 -60
- 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/minimal-mode.ts +1 -8
- 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/subagent/display.ts +4 -6
- 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 +67 -34
- package/schemas/settings.schema.json +138 -27
- package/dist/builtin/workflows/builtin/chunk-7fvrnzhb.js +0 -8
- package/dist/builtin/workflows/builtin/chunk-8c3ae7tt.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
|
@@ -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 {
|
|
@@ -8539,6 +8539,7 @@ function resolveTempScopeId(options) {
|
|
|
8539
8539
|
}
|
|
8540
8540
|
var MAX_PARALLEL_TASKS = 50;
|
|
8541
8541
|
var MAX_CONCURRENCY = 3;
|
|
8542
|
+
var DEFAULT_RUNNING_CAPACITY = 4;
|
|
8542
8543
|
var TEMP_ROOT_DIR = path6.join(os4.tmpdir(), `${APP_NAME2}-subagents-${resolveTempScopeId()}`);
|
|
8543
8544
|
var TEMP_ARTIFACTS_DIR = path6.join(TEMP_ROOT_DIR, "artifacts");
|
|
8544
8545
|
var SLASH_RESULT_TYPE = "subagent-slash-result";
|
|
@@ -8556,12 +8557,14 @@ function normalizeTopLevelParallelValue(value) {
|
|
|
8556
8557
|
return parsed;
|
|
8557
8558
|
}
|
|
8558
8559
|
function resolveTopLevelParallelMaxTasks(value) {
|
|
8559
|
-
|
|
8560
|
-
return configuredMax === undefined ? MAX_PARALLEL_TASKS : Math.min(configuredMax, MAX_PARALLEL_TASKS);
|
|
8560
|
+
return normalizeTopLevelParallelValue(value) ?? MAX_PARALLEL_TASKS;
|
|
8561
8561
|
}
|
|
8562
8562
|
function resolveTopLevelParallelConcurrency(override, configValue) {
|
|
8563
8563
|
return normalizeTopLevelParallelValue(override) ?? normalizeTopLevelParallelValue(configValue) ?? MAX_CONCURRENCY;
|
|
8564
8564
|
}
|
|
8565
|
+
function resolveTopLevelParallelRunningCapacity(value) {
|
|
8566
|
+
return normalizeTopLevelParallelValue(value) ?? DEFAULT_RUNNING_CAPACITY;
|
|
8567
|
+
}
|
|
8565
8568
|
function wrapForkTask(task, preamble) {
|
|
8566
8569
|
if (preamble === false)
|
|
8567
8570
|
return task;
|
|
@@ -10594,21 +10597,12 @@ function createTestSession(sessionManager, spec) {
|
|
|
10594
10597
|
let aborted = false;
|
|
10595
10598
|
let settlePromptAbort;
|
|
10596
10599
|
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
10600
|
let userMessages = 0;
|
|
10606
10601
|
let assistantMessages = 0;
|
|
10607
10602
|
const zeroTokens = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 };
|
|
10608
10603
|
const zeroCost = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 };
|
|
10609
|
-
const appendAssistant = (content, stopReason) => {
|
|
10610
|
-
|
|
10611
|
-
sessionManager.appendMessage({
|
|
10604
|
+
const appendAssistant = async (content, stopReason) => {
|
|
10605
|
+
await sessionManager.appendMessage({
|
|
10612
10606
|
role: "assistant",
|
|
10613
10607
|
content,
|
|
10614
10608
|
api: "openai-responses",
|
|
@@ -10625,6 +10619,7 @@ function createTestSession(sessionManager, spec) {
|
|
|
10625
10619
|
stopReason,
|
|
10626
10620
|
timestamp: Date.now()
|
|
10627
10621
|
});
|
|
10622
|
+
messages.push({ role: "assistant", content, stopReason });
|
|
10628
10623
|
assistantMessages += 1;
|
|
10629
10624
|
};
|
|
10630
10625
|
return {
|
|
@@ -10674,11 +10669,11 @@ function createTestSession(sessionManager, spec) {
|
|
|
10674
10669
|
appendFileSync2(testOptions.promptLogPath, `${text}
|
|
10675
10670
|
---PROMPT---
|
|
10676
10671
|
`, "utf8");
|
|
10677
|
-
sessionManager.appendMessage({ role: "user", content: text, timestamp: Date.now() });
|
|
10672
|
+
await sessionManager.appendMessage({ role: "user", content: text, timestamp: Date.now() });
|
|
10678
10673
|
userMessages += 1;
|
|
10679
10674
|
if (testOptions.seededAssistantText) {
|
|
10680
10675
|
lastAssistantText = testOptions.seededAssistantText;
|
|
10681
|
-
appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10676
|
+
await appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10682
10677
|
}
|
|
10683
10678
|
if (testOptions.fallbackBeforeGate)
|
|
10684
10679
|
emitFallback();
|
|
@@ -10688,12 +10683,21 @@ function createTestSession(sessionManager, spec) {
|
|
|
10688
10683
|
if (testOptions.promptGate) {
|
|
10689
10684
|
const gateResult = await Promise.race([
|
|
10690
10685
|
testOptions.promptGate.then(() => "released"),
|
|
10691
|
-
|
|
10686
|
+
new Promise((resolve, reject) => {
|
|
10687
|
+
settlePromptAbort = () => {
|
|
10688
|
+
if (testOptions.abortResolvesPrompt)
|
|
10689
|
+
resolve("aborted");
|
|
10690
|
+
else
|
|
10691
|
+
reject(new DOMException("aborted", "AbortError"));
|
|
10692
|
+
};
|
|
10693
|
+
if (aborted)
|
|
10694
|
+
settlePromptAbort();
|
|
10695
|
+
})
|
|
10692
10696
|
]);
|
|
10693
10697
|
if (gateResult === "aborted") {
|
|
10694
10698
|
if (testOptions.thinkingOnlyOnAbort) {
|
|
10695
10699
|
lastAssistantText = "";
|
|
10696
|
-
appendAssistant([{ type: "thinking", thinking: "aborted mid-thought" }], "aborted");
|
|
10700
|
+
await appendAssistant([{ type: "thinking", thinking: "aborted mid-thought" }], "aborted");
|
|
10697
10701
|
}
|
|
10698
10702
|
for (const event of testOptions.events ?? [])
|
|
10699
10703
|
for (const listener of listeners)
|
|
@@ -10708,7 +10712,7 @@ function createTestSession(sessionManager, spec) {
|
|
|
10708
10712
|
if (!testOptions.fallbackBeforeGate)
|
|
10709
10713
|
emitFallback();
|
|
10710
10714
|
lastAssistantText = testOptions.output ?? "done";
|
|
10711
|
-
appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10715
|
+
await appendAssistant([{ type: "text", text: lastAssistantText }], "stop");
|
|
10712
10716
|
return lastAssistantText;
|
|
10713
10717
|
},
|
|
10714
10718
|
getLastAssistantText: () => {
|
|
@@ -10780,7 +10784,7 @@ function cancelledEnvelope(session, spec, stats) {
|
|
|
10780
10784
|
progressPath: spec.progressPath,
|
|
10781
10785
|
assistantText: lastNonEmptyAssistantText(session?.messages, outputFor(session)),
|
|
10782
10786
|
toolCount: stats.toolCalls,
|
|
10783
|
-
sessionPath: session?.sessionFile ?? spec.
|
|
10787
|
+
sessionPath: session?.sessionFile ?? spec.sessionManager?.getSessionFile(),
|
|
10784
10788
|
...spec.progressArtifactPath ? { progressArtifactPath: spec.progressArtifactPath } : {},
|
|
10785
10789
|
...spec.outputArtifactPath ? { outputArtifactPath: spec.outputArtifactPath } : {}
|
|
10786
10790
|
}).text;
|
|
@@ -10873,14 +10877,14 @@ class AdmittedChild {
|
|
|
10873
10877
|
spec;
|
|
10874
10878
|
policy;
|
|
10875
10879
|
sessionDir;
|
|
10876
|
-
|
|
10880
|
+
sessionManager;
|
|
10877
10881
|
control;
|
|
10878
10882
|
constructor(input) {
|
|
10879
10883
|
this.identity = input.identity;
|
|
10880
10884
|
this.spec = input.spec;
|
|
10881
10885
|
this.policy = input.policy;
|
|
10882
10886
|
this.sessionDir = input.sessionDir;
|
|
10883
|
-
this.
|
|
10887
|
+
this.sessionManager = input.sessionManager;
|
|
10884
10888
|
this.control = input.control;
|
|
10885
10889
|
}
|
|
10886
10890
|
static create(input) {
|
|
@@ -10902,10 +10906,10 @@ class SubagentControlRuntime {
|
|
|
10902
10906
|
deliveredEnvelopes = new Map;
|
|
10903
10907
|
killedChildren = new Set;
|
|
10904
10908
|
nextAttemptId = 1;
|
|
10905
|
-
constructor(parent, sessionRoot) {
|
|
10909
|
+
constructor(parent, sessionRoot, runningCapacity) {
|
|
10906
10910
|
this.parent = { ...parent };
|
|
10907
10911
|
this.sessionRoot = trustedSessionRoot(this.parent, sessionRoot);
|
|
10908
|
-
this.native = new SubagentControl(this.parent.path);
|
|
10912
|
+
this.native = new SubagentControl(this.parent.path, runningCapacity);
|
|
10909
10913
|
}
|
|
10910
10914
|
registerAgents(agents) {
|
|
10911
10915
|
for (const agent of agents)
|
|
@@ -10925,7 +10929,7 @@ class SubagentControlRuntime {
|
|
|
10925
10929
|
return refusal(native);
|
|
10926
10930
|
const identity = native.child;
|
|
10927
10931
|
const childModePolicy = resolveChildModePolicy(spec);
|
|
10928
|
-
const sessionDir = spec.
|
|
10932
|
+
const sessionDir = spec.sessionManager?.getSessionDir() || sessionDirectory(this.sessionRoot, identity.path);
|
|
10929
10933
|
mkdirSync4(sessionDir, { recursive: true });
|
|
10930
10934
|
return {
|
|
10931
10935
|
admitted: AdmittedChild.create({
|
|
@@ -10946,7 +10950,7 @@ class SubagentControlRuntime {
|
|
|
10946
10950
|
depth: identity.depth
|
|
10947
10951
|
},
|
|
10948
10952
|
sessionDir,
|
|
10949
|
-
|
|
10953
|
+
sessionManager: spec.sessionManager,
|
|
10950
10954
|
control: this
|
|
10951
10955
|
})
|
|
10952
10956
|
};
|
|
@@ -11026,7 +11030,6 @@ class SubagentControlRuntime {
|
|
|
11026
11030
|
this.attemptTokens.set(admitted.identity.path, token);
|
|
11027
11031
|
let session;
|
|
11028
11032
|
const executionEnded = new AbortController;
|
|
11029
|
-
let activeSessionManager;
|
|
11030
11033
|
let termination;
|
|
11031
11034
|
let terminating;
|
|
11032
11035
|
let terminationWasKill = false;
|
|
@@ -11044,7 +11047,6 @@ class SubagentControlRuntime {
|
|
|
11044
11047
|
termination = cause;
|
|
11045
11048
|
terminating = (async () => {
|
|
11046
11049
|
try {
|
|
11047
|
-
activeSessionManager?.flush();
|
|
11048
11050
|
await session?.abort();
|
|
11049
11051
|
} finally {
|
|
11050
11052
|
try {
|
|
@@ -11063,13 +11065,10 @@ class SubagentControlRuntime {
|
|
|
11063
11065
|
});
|
|
11064
11066
|
try {
|
|
11065
11067
|
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;
|
|
11068
|
+
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
11069
|
taskHooks?.bindTranscript?.(sessionManager);
|
|
11071
11070
|
if (workflow)
|
|
11072
|
-
sessionManager.markSessionInternal(workflow);
|
|
11071
|
+
await sessionManager.markSessionInternal(workflow);
|
|
11073
11072
|
let created;
|
|
11074
11073
|
if (admitted.spec.testSession) {
|
|
11075
11074
|
created = { session: createTestSession(sessionManager, admitted.spec) };
|
|
@@ -11249,7 +11248,8 @@ class SubagentControlRuntime {
|
|
|
11249
11248
|
await terminate("abort");
|
|
11250
11249
|
if (signals.interrupt.aborted)
|
|
11251
11250
|
await terminate("interrupt");
|
|
11252
|
-
|
|
11251
|
+
if (!termination)
|
|
11252
|
+
await session.prompt(admitted.spec.task);
|
|
11253
11253
|
await terminating;
|
|
11254
11254
|
const stats = statsFor(session, admitted.identity.path);
|
|
11255
11255
|
const sessionFile = session.sessionFile;
|
|
@@ -11336,9 +11336,6 @@ class SubagentControlRuntime {
|
|
|
11336
11336
|
try {
|
|
11337
11337
|
unsubscribe?.();
|
|
11338
11338
|
} catch {}
|
|
11339
|
-
try {
|
|
11340
|
-
activeSessionManager?.flush();
|
|
11341
|
-
} catch {}
|
|
11342
11339
|
if (onCleanup) {
|
|
11343
11340
|
onCleanup((async () => {
|
|
11344
11341
|
try {
|
|
@@ -11500,17 +11497,17 @@ class SubagentControlRuntime {
|
|
|
11500
11497
|
} catch {}
|
|
11501
11498
|
}
|
|
11502
11499
|
}
|
|
11503
|
-
function createSubagentControl(parent, sessionRoot) {
|
|
11504
|
-
return new SubagentControlRuntime(parent, sessionRoot);
|
|
11500
|
+
function createSubagentControl(parent, sessionRoot, runningCapacity) {
|
|
11501
|
+
return new SubagentControlRuntime(parent, sessionRoot, runningCapacity);
|
|
11505
11502
|
}
|
|
11506
11503
|
|
|
11507
11504
|
// dist/builtin/subagents/src/runs/inprocess/control-registry.ts
|
|
11508
11505
|
var controls = new Map;
|
|
11509
|
-
function getOrCreateSubagentControl(parent, sessionRoot) {
|
|
11506
|
+
function getOrCreateSubagentControl(parent, sessionRoot, runningCapacity) {
|
|
11510
11507
|
const existing = controls.get(parent.path);
|
|
11511
11508
|
if (existing)
|
|
11512
11509
|
return existing;
|
|
11513
|
-
const control = createSubagentControl(parent, sessionRoot);
|
|
11510
|
+
const control = createSubagentControl(parent, sessionRoot, runningCapacity);
|
|
11514
11511
|
controls.set(parent.path, control);
|
|
11515
11512
|
return control;
|
|
11516
11513
|
}
|
|
@@ -12526,7 +12523,7 @@ function createExecutionBurstDispatcher(input) {
|
|
|
12526
12523
|
|
|
12527
12524
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts
|
|
12528
12525
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
12529
|
-
import * as
|
|
12526
|
+
import * as fs12 from "node:fs";
|
|
12530
12527
|
import * as path13 from "node:path";
|
|
12531
12528
|
|
|
12532
12529
|
// dist/builtin/subagents/src/agents/agent-scope.ts
|
|
@@ -12537,67 +12534,71 @@ function resolveExecutionAgentScope(scope) {
|
|
|
12537
12534
|
}
|
|
12538
12535
|
|
|
12539
12536
|
// dist/builtin/subagents/src/shared/fork-context.ts
|
|
12540
|
-
import * as fs11 from "node:fs";
|
|
12541
12537
|
import { SessionManager as SessionManager2 } from "@bastani/atomic";
|
|
12538
|
+
|
|
12539
|
+
class SubagentForkContextError extends Error {
|
|
12540
|
+
parentSessionId;
|
|
12541
|
+
reason;
|
|
12542
|
+
constructor(parentSessionId, reason, options) {
|
|
12543
|
+
super(`Cannot fork subagent session ${JSON.stringify(parentSessionId)}: ${reason}`, options);
|
|
12544
|
+
this.parentSessionId = parentSessionId;
|
|
12545
|
+
this.reason = reason;
|
|
12546
|
+
this.name = "SubagentForkContextError";
|
|
12547
|
+
}
|
|
12548
|
+
}
|
|
12542
12549
|
function resolveSubagentContext(value) {
|
|
12543
12550
|
return value === "fork" ? "fork" : "fresh";
|
|
12544
12551
|
}
|
|
12545
|
-
function createForkContextResolver(sessionManager, requestedContext
|
|
12552
|
+
function createForkContextResolver(sessionManager, requestedContext) {
|
|
12546
12553
|
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.");
|
|
12554
|
+
return { sessionManagerForIndex: async () => {
|
|
12555
|
+
return;
|
|
12556
|
+
} };
|
|
12556
12557
|
}
|
|
12558
|
+
const parentSessionId = sessionManager.getSessionId();
|
|
12559
|
+
const store = sessionManager.getSessionStore();
|
|
12560
|
+
const cwd = sessionManager.getCwd();
|
|
12557
12561
|
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;
|
|
12562
|
+
if (leafId === null)
|
|
12563
|
+
throw new SubagentForkContextError(parentSessionId, "no_leaf");
|
|
12564
|
+
const children = new Map;
|
|
12564
12565
|
return {
|
|
12565
|
-
|
|
12566
|
-
const cached =
|
|
12567
|
-
if (cached)
|
|
12566
|
+
sessionManagerForIndex(index = 0) {
|
|
12567
|
+
const cached = children.get(index);
|
|
12568
|
+
if (cached !== undefined)
|
|
12568
12569
|
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}`);
|
|
12570
|
+
const child = (async () => {
|
|
12571
|
+
try {
|
|
12572
|
+
const source = await SessionManager2.open(store, parentSessionId, cwd);
|
|
12573
|
+
await source.createBranchedSession(leafId);
|
|
12574
|
+
return source;
|
|
12575
|
+
} catch (cause) {
|
|
12576
|
+
children.delete(index);
|
|
12577
|
+
throw new SubagentForkContextError(parentSessionId, "fork_failed", { cause });
|
|
12580
12578
|
}
|
|
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
|
-
}
|
|
12579
|
+
})();
|
|
12580
|
+
children.set(index, child);
|
|
12581
|
+
return child;
|
|
12587
12582
|
}
|
|
12588
12583
|
};
|
|
12589
12584
|
}
|
|
12590
12585
|
|
|
12591
12586
|
// dist/builtin/subagents/src/shared/session-identity.ts
|
|
12587
|
+
class SubagentSessionIdentityError extends Error {
|
|
12588
|
+
constructor() {
|
|
12589
|
+
super("Current session identity is unavailable.");
|
|
12590
|
+
this.name = "SubagentSessionIdentityError";
|
|
12591
|
+
}
|
|
12592
|
+
}
|
|
12592
12593
|
function resolveCurrentSessionId(sessionManager) {
|
|
12593
|
-
const sessionId = sessionManager.
|
|
12594
|
-
if (
|
|
12595
|
-
throw new
|
|
12594
|
+
const sessionId = sessionManager.getSessionId();
|
|
12595
|
+
if (sessionId === undefined || sessionId === null)
|
|
12596
|
+
throw new SubagentSessionIdentityError;
|
|
12596
12597
|
return sessionId;
|
|
12597
12598
|
}
|
|
12598
12599
|
|
|
12599
12600
|
// dist/builtin/subagents/src/shared/settings.ts
|
|
12600
|
-
import * as
|
|
12601
|
+
import * as fs11 from "node:fs";
|
|
12601
12602
|
import * as path12 from "node:path";
|
|
12602
12603
|
function normalizeOutputOverride(output) {
|
|
12603
12604
|
return output === "false" ? false : output;
|
|
@@ -12637,8 +12638,8 @@ function buildReadInstruction(reads, cwd) {
|
|
|
12637
12638
|
return `[Read from: ${files.join(", ")}]`;
|
|
12638
12639
|
}
|
|
12639
12640
|
function writeInitialProgressFile(progressDir) {
|
|
12640
|
-
|
|
12641
|
-
|
|
12641
|
+
fs11.mkdirSync(progressDir, { recursive: true });
|
|
12642
|
+
fs11.writeFileSync(path12.join(progressDir, "progress.md"), INITIAL_PROGRESS_CONTENT);
|
|
12642
12643
|
}
|
|
12643
12644
|
function injectSingleProgressInstruction(task, progressDir) {
|
|
12644
12645
|
return `${task}
|
|
@@ -12754,11 +12755,9 @@ function prepareExecutionContext(input) {
|
|
|
12754
12755
|
|
|
12755
12756
|
${effectiveParams.task ?? ""}` };
|
|
12756
12757
|
}
|
|
12757
|
-
let
|
|
12758
|
-
return;
|
|
12759
|
-
};
|
|
12758
|
+
let sessionManagerForIndex;
|
|
12760
12759
|
try {
|
|
12761
|
-
|
|
12760
|
+
sessionManagerForIndex = createForkContextResolver(ctx.sessionManager, effectiveParams.context).sessionManagerForIndex;
|
|
12762
12761
|
} catch (error) {
|
|
12763
12762
|
return { error: toExecutionErrorResult(effectiveParams, error) };
|
|
12764
12763
|
}
|
|
@@ -12776,7 +12775,7 @@ ${effectiveParams.task ?? ""}` };
|
|
|
12776
12775
|
sessionRoot = path13.join(baseSessionRoot, runId);
|
|
12777
12776
|
}
|
|
12778
12777
|
try {
|
|
12779
|
-
|
|
12778
|
+
fs12.mkdirSync(sessionRoot, { recursive: true });
|
|
12780
12779
|
} catch (error) {
|
|
12781
12780
|
const message = error instanceof Error ? error.message : String(error);
|
|
12782
12781
|
return {
|
|
@@ -12784,7 +12783,6 @@ ${effectiveParams.task ?? ""}` };
|
|
|
12784
12783
|
};
|
|
12785
12784
|
}
|
|
12786
12785
|
const sessionDirForIndex = (idx) => path13.join(sessionRoot, `run-${idx ?? 0}`);
|
|
12787
|
-
const childSessionFileForIndex = (idx) => sessionFileForIndex(idx) ?? path13.join(sessionDirForIndex(idx), "session.jsonl");
|
|
12788
12786
|
const onUpdateWithContext = onUpdate ? (r) => onUpdate(withForkContext(r, effectiveParams.context)) : undefined;
|
|
12789
12787
|
const execData = {
|
|
12790
12788
|
params: effectiveParams,
|
|
@@ -12798,7 +12796,7 @@ ${effectiveParams.task ?? ""}` };
|
|
|
12798
12796
|
shareEnabled,
|
|
12799
12797
|
sessionRoot,
|
|
12800
12798
|
sessionDirForIndex,
|
|
12801
|
-
|
|
12799
|
+
sessionManagerForIndex,
|
|
12802
12800
|
artifactConfig,
|
|
12803
12801
|
artifactsDir,
|
|
12804
12802
|
parentDepth: depth,
|
|
@@ -13001,7 +12999,7 @@ async function routeSubagentModel(input) {
|
|
|
13001
12999
|
}
|
|
13002
13000
|
|
|
13003
13001
|
// dist/builtin/subagents/src/runs/shared/run-history.ts
|
|
13004
|
-
import * as
|
|
13002
|
+
import * as fs13 from "node:fs";
|
|
13005
13003
|
import * as os6 from "node:os";
|
|
13006
13004
|
import * as path14 from "node:path";
|
|
13007
13005
|
import { getAgentConfigPaths as getAgentConfigPaths4 } from "@bastani/atomic";
|
|
@@ -13016,14 +13014,14 @@ function recordRun(agent, task, status, durationMs) {
|
|
|
13016
13014
|
status,
|
|
13017
13015
|
duration: durationMs
|
|
13018
13016
|
};
|
|
13019
|
-
|
|
13020
|
-
|
|
13017
|
+
fs13.mkdirSync(path14.dirname(HISTORY_PATH), { recursive: true });
|
|
13018
|
+
fs13.appendFileSync(HISTORY_PATH, `${JSON.stringify(entry)}
|
|
13021
13019
|
`);
|
|
13022
13020
|
} catch {}
|
|
13023
13021
|
}
|
|
13024
13022
|
|
|
13025
13023
|
// dist/builtin/subagents/src/runs/shared/single-output.ts
|
|
13026
|
-
import * as
|
|
13024
|
+
import * as fs14 from "node:fs";
|
|
13027
13025
|
import * as path15 from "node:path";
|
|
13028
13026
|
function normalizeSingleOutputOverride(output, defaultOutput) {
|
|
13029
13027
|
if (output === false || output === "false")
|
|
@@ -13089,7 +13087,7 @@ function captureSingleOutputSnapshot(outputPath) {
|
|
|
13089
13087
|
if (!outputPath)
|
|
13090
13088
|
return;
|
|
13091
13089
|
try {
|
|
13092
|
-
const stat =
|
|
13090
|
+
const stat = fs14.statSync(outputPath);
|
|
13093
13091
|
return { exists: true, mtimeMs: stat.mtimeMs, size: stat.size };
|
|
13094
13092
|
} catch {
|
|
13095
13093
|
return { exists: false };
|
|
@@ -13099,8 +13097,8 @@ function persistSingleOutput(outputPath, fullOutput) {
|
|
|
13099
13097
|
if (!outputPath)
|
|
13100
13098
|
return {};
|
|
13101
13099
|
try {
|
|
13102
|
-
|
|
13103
|
-
|
|
13100
|
+
fs14.mkdirSync(path15.dirname(outputPath), { recursive: true });
|
|
13101
|
+
fs14.writeFileSync(outputPath, fullOutput, "utf-8");
|
|
13104
13102
|
return { savedPath: outputPath };
|
|
13105
13103
|
} catch (err) {
|
|
13106
13104
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
@@ -13111,7 +13109,7 @@ function resolveSingleOutput(outputPath, fallbackOutput, beforeRun) {
|
|
|
13111
13109
|
return { fullOutput: fallbackOutput };
|
|
13112
13110
|
let changedSinceStart = false;
|
|
13113
13111
|
try {
|
|
13114
|
-
const stat =
|
|
13112
|
+
const stat = fs14.statSync(outputPath);
|
|
13115
13113
|
changedSinceStart = !beforeRun?.exists || stat.mtimeMs !== beforeRun.mtimeMs || stat.size !== beforeRun.size;
|
|
13116
13114
|
} catch (error) {
|
|
13117
13115
|
const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
|
|
@@ -13124,7 +13122,7 @@ function resolveSingleOutput(outputPath, fallbackOutput, beforeRun) {
|
|
|
13124
13122
|
}
|
|
13125
13123
|
if (changedSinceStart) {
|
|
13126
13124
|
try {
|
|
13127
|
-
return { fullOutput:
|
|
13125
|
+
return { fullOutput: fs14.readFileSync(outputPath, "utf-8"), savedPath: outputPath };
|
|
13128
13126
|
} catch (error) {
|
|
13129
13127
|
return {
|
|
13130
13128
|
fullOutput: fallbackOutput,
|
|
@@ -13161,13 +13159,13 @@ ${params.saveError}`;
|
|
|
13161
13159
|
|
|
13162
13160
|
// dist/builtin/subagents/src/runs/shared/worktree.ts
|
|
13163
13161
|
import { spawnSync } from "node:child_process";
|
|
13164
|
-
import * as
|
|
13162
|
+
import * as fs17 from "node:fs";
|
|
13165
13163
|
import * as os7 from "node:os";
|
|
13166
13164
|
import * as path18 from "node:path";
|
|
13167
13165
|
import { createChildProcessEnvironment as createChildProcessEnvironment3, createGitEnvironment } from "@bastani/atomic";
|
|
13168
13166
|
|
|
13169
13167
|
// dist/builtin/subagents/src/runs/shared/worktree-post-create.ts
|
|
13170
|
-
import * as
|
|
13168
|
+
import * as fs15 from "node:fs";
|
|
13171
13169
|
import * as path16 from "node:path";
|
|
13172
13170
|
function tracked(runGit, repo, relativePath) {
|
|
13173
13171
|
return runGit(repo, ["ls-files", "--error-unmatch", "--", relativePath]).status === 0;
|
|
@@ -13186,10 +13184,10 @@ function hasTrackedPathComponent(runGit, repo, relativePath) {
|
|
|
13186
13184
|
function copySettings(runGit, mainRoot, worktreeRoot, relativePath) {
|
|
13187
13185
|
const source = path16.join(mainRoot, relativePath);
|
|
13188
13186
|
const destination = path16.join(worktreeRoot, relativePath);
|
|
13189
|
-
if (!
|
|
13187
|
+
if (!fs15.existsSync(source) || fs15.existsSync(destination) || hasTrackedPathComponent(runGit, worktreeRoot, relativePath))
|
|
13190
13188
|
return false;
|
|
13191
|
-
|
|
13192
|
-
|
|
13189
|
+
fs15.mkdirSync(path16.dirname(destination), { recursive: true });
|
|
13190
|
+
fs15.copyFileSync(source, destination);
|
|
13193
13191
|
return true;
|
|
13194
13192
|
}
|
|
13195
13193
|
function configureHooks(runGit, mainRoot) {
|
|
@@ -13197,12 +13195,12 @@ function configureHooks(runGit, mainRoot) {
|
|
|
13197
13195
|
const ordinary = path16.join(mainRoot, ".git", "hooks");
|
|
13198
13196
|
let desired;
|
|
13199
13197
|
try {
|
|
13200
|
-
if (
|
|
13198
|
+
if (fs15.statSync(husky).isDirectory())
|
|
13201
13199
|
desired = husky;
|
|
13202
13200
|
} catch {}
|
|
13203
13201
|
if (!desired) {
|
|
13204
13202
|
try {
|
|
13205
|
-
if (
|
|
13203
|
+
if (fs15.readdirSync(ordinary, { withFileTypes: true }).some((entry) => entry.isFile() && !entry.name.endsWith(".sample")))
|
|
13206
13204
|
desired = ordinary;
|
|
13207
13205
|
} catch {}
|
|
13208
13206
|
}
|
|
@@ -13216,7 +13214,7 @@ function configureHooks(runGit, mainRoot) {
|
|
|
13216
13214
|
throw new Error(result.stderr.trim() || "failed to configure shared core.hooksPath");
|
|
13217
13215
|
}
|
|
13218
13216
|
function copyIncludes(runGit, mainRoot, worktreeRoot) {
|
|
13219
|
-
if (!
|
|
13217
|
+
if (!fs15.existsSync(path16.join(mainRoot, ".worktreeinclude")))
|
|
13220
13218
|
return;
|
|
13221
13219
|
const ignored = runGit(mainRoot, ["ls-files", "--others", "--ignored", "--exclude-standard"]);
|
|
13222
13220
|
const included = runGit(mainRoot, ["ls-files", "--others", "--ignored", "--exclude-from=.worktreeinclude"]);
|
|
@@ -13229,10 +13227,10 @@ function copyIncludes(runGit, mainRoot, worktreeRoot) {
|
|
|
13229
13227
|
const source = path16.join(mainRoot, relativePath);
|
|
13230
13228
|
const destination = path16.join(worktreeRoot, relativePath);
|
|
13231
13229
|
try {
|
|
13232
|
-
if (!
|
|
13230
|
+
if (!fs15.statSync(source).isFile() || fs15.existsSync(destination))
|
|
13233
13231
|
continue;
|
|
13234
|
-
|
|
13235
|
-
|
|
13232
|
+
fs15.mkdirSync(path16.dirname(destination), { recursive: true });
|
|
13233
|
+
fs15.copyFileSync(source, destination);
|
|
13236
13234
|
} catch {}
|
|
13237
13235
|
}
|
|
13238
13236
|
}
|
|
@@ -13246,9 +13244,9 @@ function performPostCreationSetup(runGit, mainRoot, worktreeRoot) {
|
|
|
13246
13244
|
configureHooks(runGit, mainRoot);
|
|
13247
13245
|
const source = path16.join(mainRoot, "node_modules");
|
|
13248
13246
|
const destination = path16.join(worktreeRoot, "node_modules");
|
|
13249
|
-
if (
|
|
13247
|
+
if (fs15.existsSync(source) && !fs15.existsSync(destination) && !tracked(runGit, worktreeRoot, "node_modules")) {
|
|
13250
13248
|
try {
|
|
13251
|
-
|
|
13249
|
+
fs15.symlinkSync(source, destination, process.platform === "win32" ? "junction" : undefined);
|
|
13252
13250
|
synthetic.push("node_modules");
|
|
13253
13251
|
} catch {}
|
|
13254
13252
|
}
|
|
@@ -13257,19 +13255,19 @@ function performPostCreationSetup(runGit, mainRoot, worktreeRoot) {
|
|
|
13257
13255
|
}
|
|
13258
13256
|
|
|
13259
13257
|
// dist/builtin/subagents/src/runs/shared/worktree-root.ts
|
|
13260
|
-
import * as
|
|
13258
|
+
import * as fs16 from "node:fs";
|
|
13261
13259
|
import * as path17 from "node:path";
|
|
13262
13260
|
function readText(file) {
|
|
13263
13261
|
try {
|
|
13264
|
-
return
|
|
13262
|
+
return fs16.readFileSync(file, "utf8");
|
|
13265
13263
|
} catch {
|
|
13266
13264
|
return;
|
|
13267
13265
|
}
|
|
13268
13266
|
}
|
|
13269
13267
|
function samePath(left, right) {
|
|
13270
13268
|
try {
|
|
13271
|
-
const a =
|
|
13272
|
-
const b =
|
|
13269
|
+
const a = fs16.realpathSync.native(left);
|
|
13270
|
+
const b = fs16.realpathSync.native(right);
|
|
13273
13271
|
return process.platform === "win32" ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
13274
13272
|
} catch {
|
|
13275
13273
|
return false;
|
|
@@ -13278,14 +13276,14 @@ function samePath(left, right) {
|
|
|
13278
13276
|
function findGitRoot(cwd) {
|
|
13279
13277
|
let current = path17.resolve(cwd);
|
|
13280
13278
|
try {
|
|
13281
|
-
if (!
|
|
13279
|
+
if (!fs16.statSync(current).isDirectory())
|
|
13282
13280
|
current = path17.dirname(current);
|
|
13283
13281
|
} catch {
|
|
13284
13282
|
return;
|
|
13285
13283
|
}
|
|
13286
13284
|
while (true) {
|
|
13287
13285
|
try {
|
|
13288
|
-
const entry =
|
|
13286
|
+
const entry = fs16.statSync(path17.join(current, ".git"));
|
|
13289
13287
|
if (entry.isDirectory() || entry.isFile())
|
|
13290
13288
|
return current;
|
|
13291
13289
|
} catch {}
|
|
@@ -13299,7 +13297,7 @@ function resolveMainRepoRoot(repoRoot) {
|
|
|
13299
13297
|
const gitEntry = path17.join(repoRoot, ".git");
|
|
13300
13298
|
let stats;
|
|
13301
13299
|
try {
|
|
13302
|
-
stats =
|
|
13300
|
+
stats = fs16.statSync(gitEntry);
|
|
13303
13301
|
} catch {
|
|
13304
13302
|
return;
|
|
13305
13303
|
}
|
|
@@ -13386,7 +13384,7 @@ function resolveRepoState(cwd) {
|
|
|
13386
13384
|
function normalizeComparableCwd(cwd) {
|
|
13387
13385
|
const resolved = path18.resolve(cwd);
|
|
13388
13386
|
try {
|
|
13389
|
-
return
|
|
13387
|
+
return fs17.realpathSync(resolved);
|
|
13390
13388
|
} catch {
|
|
13391
13389
|
return resolved;
|
|
13392
13390
|
}
|
|
@@ -13421,8 +13419,8 @@ function buildWorktreePath(mainRoot, runId, index) {
|
|
|
13421
13419
|
}
|
|
13422
13420
|
function ensureWorktreeIgnore(mainRoot) {
|
|
13423
13421
|
const root = path18.join(mainRoot, ".atomic", "worktrees");
|
|
13424
|
-
|
|
13425
|
-
|
|
13422
|
+
fs17.mkdirSync(root, { recursive: true });
|
|
13423
|
+
fs17.writeFileSync(path18.join(root, ".gitignore"), `*
|
|
13426
13424
|
`, "utf8");
|
|
13427
13425
|
}
|
|
13428
13426
|
function resolveRepoCwdRelative(cwd) {
|
|
@@ -13458,10 +13456,10 @@ function resolveWorktreeSetupHook(repoRoot, config) {
|
|
|
13458
13456
|
} else {
|
|
13459
13457
|
throw new Error("worktree setup hook must be an absolute path or a repo-relative path");
|
|
13460
13458
|
}
|
|
13461
|
-
if (!
|
|
13459
|
+
if (!fs17.existsSync(resolvedPath)) {
|
|
13462
13460
|
throw new Error(`worktree setup hook not found: ${resolvedPath}`);
|
|
13463
13461
|
}
|
|
13464
|
-
if (
|
|
13462
|
+
if (fs17.statSync(resolvedPath).isDirectory()) {
|
|
13465
13463
|
throw new Error(`worktree setup hook must be a file, got directory: ${resolvedPath}`);
|
|
13466
13464
|
}
|
|
13467
13465
|
return {
|
|
@@ -13608,7 +13606,7 @@ function removeSyntheticPath(worktree, syntheticPath) {
|
|
|
13608
13606
|
}
|
|
13609
13607
|
let stat;
|
|
13610
13608
|
try {
|
|
13611
|
-
stat =
|
|
13609
|
+
stat = fs17.lstatSync(resolved);
|
|
13612
13610
|
} catch (error) {
|
|
13613
13611
|
const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
|
|
13614
13612
|
if (code === "ENOENT")
|
|
@@ -13616,14 +13614,14 @@ function removeSyntheticPath(worktree, syntheticPath) {
|
|
|
13616
13614
|
throw error;
|
|
13617
13615
|
}
|
|
13618
13616
|
if (stat.isSymbolicLink()) {
|
|
13619
|
-
|
|
13617
|
+
fs17.unlinkSync(resolved);
|
|
13620
13618
|
return;
|
|
13621
13619
|
}
|
|
13622
13620
|
if (stat.isDirectory()) {
|
|
13623
|
-
|
|
13621
|
+
fs17.rmSync(resolved, { recursive: true, force: true });
|
|
13624
13622
|
return;
|
|
13625
13623
|
}
|
|
13626
|
-
|
|
13624
|
+
fs17.rmSync(resolved, { force: true });
|
|
13627
13625
|
}
|
|
13628
13626
|
function removeSyntheticPathsBeforeDiff(worktree) {
|
|
13629
13627
|
if (worktree.syntheticPaths.length === 0)
|
|
@@ -13672,7 +13670,7 @@ function captureWorktreeDiff(setup, worktree, agent, patchPath) {
|
|
|
13672
13670
|
const diffStat = runGitChecked(worktree.path, ["diff", "--cached", "--stat", setup.baseCommit]).trim();
|
|
13673
13671
|
const patch = runGitChecked(worktree.path, ["diff", "--cached", setup.baseCommit]);
|
|
13674
13672
|
const numstat = runGitChecked(worktree.path, ["diff", "--cached", "--numstat", setup.baseCommit]);
|
|
13675
|
-
|
|
13673
|
+
fs17.writeFileSync(patchPath, patch, "utf-8");
|
|
13676
13674
|
if (!patch.trim()) {
|
|
13677
13675
|
return emptyDiff(worktree.index, agent, worktree.branch, patchPath);
|
|
13678
13676
|
}
|
|
@@ -13690,7 +13688,7 @@ function captureWorktreeDiff(setup, worktree, agent, patchPath) {
|
|
|
13690
13688
|
}
|
|
13691
13689
|
function writeEmptyPatch(patchPath) {
|
|
13692
13690
|
try {
|
|
13693
|
-
|
|
13691
|
+
fs17.writeFileSync(patchPath, "", "utf-8");
|
|
13694
13692
|
} catch {}
|
|
13695
13693
|
}
|
|
13696
13694
|
function hasWorktreeChanges(diff) {
|
|
@@ -13713,7 +13711,7 @@ function createWorktrees(cwd, runId, count, options) {
|
|
|
13713
13711
|
}
|
|
13714
13712
|
function diffWorktrees(setup, agents, diffsDir) {
|
|
13715
13713
|
try {
|
|
13716
|
-
|
|
13714
|
+
fs17.mkdirSync(diffsDir, { recursive: true });
|
|
13717
13715
|
} catch {
|
|
13718
13716
|
return [];
|
|
13719
13717
|
}
|
|
@@ -13929,6 +13927,7 @@ async function runForegroundParallelTasks(input) {
|
|
|
13929
13927
|
const taskAgents = input.agentConfigs && agentConfig ? [agentConfig] : input.agents;
|
|
13930
13928
|
const sharedProgress = index === input.behaviors.findIndex((candidate) => candidate.progress) ? join19(input.paramsCwd, "progress.md") : undefined;
|
|
13931
13929
|
const runOptions = {
|
|
13930
|
+
runningCapacity: input.runningCapacity,
|
|
13932
13931
|
getChildSessionOptions: input.ctx.getChildSessionOptions,
|
|
13933
13932
|
resourceLoaderInheritanceSnapshot: input.resourceLoaderInheritanceSnapshot,
|
|
13934
13933
|
cwd: taskCwd,
|
|
@@ -13940,7 +13939,7 @@ async function runForegroundParallelTasks(input) {
|
|
|
13940
13939
|
runId: input.runId,
|
|
13941
13940
|
index,
|
|
13942
13941
|
sessionDir: input.sessionDirForIndex(index),
|
|
13943
|
-
|
|
13942
|
+
sessionManager: await input.sessionManagerForIndex(index),
|
|
13944
13943
|
share: input.shareEnabled,
|
|
13945
13944
|
artifactsDir: input.artifactConfig.enabled ? input.artifactsDir : undefined,
|
|
13946
13945
|
artifactConfig: input.artifactConfig,
|
|
@@ -14513,7 +14512,7 @@ async function runParallelPath(data, deps) {
|
|
|
14513
14512
|
signal,
|
|
14514
14513
|
runId,
|
|
14515
14514
|
sessionDirForIndex,
|
|
14516
|
-
|
|
14515
|
+
sessionManagerForIndex,
|
|
14517
14516
|
shareEnabled,
|
|
14518
14517
|
artifactConfig,
|
|
14519
14518
|
artifactsDir,
|
|
@@ -14529,7 +14528,12 @@ async function runParallelPath(data, deps) {
|
|
|
14529
14528
|
const parallelConcurrency = resolveTopLevelParallelConcurrency(params.concurrency, deps.config.parallel?.concurrency);
|
|
14530
14529
|
if (tasks.length > maxParallelTasks)
|
|
14531
14530
|
return {
|
|
14532
|
-
content: [
|
|
14531
|
+
content: [
|
|
14532
|
+
{
|
|
14533
|
+
type: "text",
|
|
14534
|
+
text: `Too many parallel tasks (${tasks.length} after count expansion). Maximum is ${maxParallelTasks} (configure parallel.maxTasks in ~/.atomic/agent/extensions/subagent/config.json).`
|
|
14535
|
+
}
|
|
14536
|
+
],
|
|
14533
14537
|
isError: true,
|
|
14534
14538
|
details: { mode: "parallel", results: [] }
|
|
14535
14539
|
};
|
|
@@ -14665,7 +14669,7 @@ async function runParallelPath(data, deps) {
|
|
|
14665
14669
|
signal,
|
|
14666
14670
|
runId,
|
|
14667
14671
|
sessionDirForIndex,
|
|
14668
|
-
|
|
14672
|
+
sessionManagerForIndex,
|
|
14669
14673
|
shareEnabled,
|
|
14670
14674
|
artifactConfig,
|
|
14671
14675
|
artifactsDir,
|
|
@@ -14687,6 +14691,7 @@ async function runParallelPath(data, deps) {
|
|
|
14687
14691
|
sharedAutoIntercomGroup: sharedAutoGroupForSet(params.group, tasks),
|
|
14688
14692
|
foregroundControl,
|
|
14689
14693
|
concurrencyLimit: parallelConcurrency,
|
|
14694
|
+
runningCapacity: deps.config.parallel?.runningCapacity,
|
|
14690
14695
|
parentDepth: data.parentDepth,
|
|
14691
14696
|
liveResults,
|
|
14692
14697
|
liveProgress,
|
|
@@ -14787,7 +14792,7 @@ ${worktreeSuffix}` : childContent;
|
|
|
14787
14792
|
}
|
|
14788
14793
|
|
|
14789
14794
|
// dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts
|
|
14790
|
-
import { existsSync as
|
|
14795
|
+
import { existsSync as existsSync14, statSync as statSync9 } from "node:fs";
|
|
14791
14796
|
import { join as join20 } from "node:path";
|
|
14792
14797
|
|
|
14793
14798
|
// dist/builtin/subagents/src/runs/shared/model-candidate-filter.ts
|
|
@@ -15096,7 +15101,7 @@ function noSpawnableCandidatesResult(agent, task, skippedAttempts) {
|
|
|
15096
15101
|
}
|
|
15097
15102
|
async function runSingleInProcess(runtimeCwd, agent, task, options) {
|
|
15098
15103
|
const cwd = options.cwd ?? runtimeCwd;
|
|
15099
|
-
if (!
|
|
15104
|
+
if (!existsSync14(cwd))
|
|
15100
15105
|
return refusedResult(agent, task, `cwd does not exist: ${cwd}`);
|
|
15101
15106
|
if (!statSync9(cwd).isDirectory())
|
|
15102
15107
|
return refusedResult(agent, task, `cwd is not a directory: ${cwd}`);
|
|
@@ -15139,7 +15144,7 @@ async function runSingleInProcess(runtimeCwd, agent, task, options) {
|
|
|
15139
15144
|
...orchestrationContext ? { orchestrationContext } : {}
|
|
15140
15145
|
};
|
|
15141
15146
|
const sessionRoot = options.sessionDir ?? join20(options.artifactsDir ?? cwd, ".atomic", "subagents");
|
|
15142
|
-
const control = getOrCreateSubagentControl(parent, sessionRoot);
|
|
15147
|
+
const control = getOrCreateSubagentControl(parent, sessionRoot, resolveTopLevelParallelRunningCapacity(options.runningCapacity));
|
|
15143
15148
|
control.registerAgents([agent]);
|
|
15144
15149
|
const artifactsDir = options.artifactsDir && options.artifactConfig?.enabled !== false ? options.artifactsDir : undefined;
|
|
15145
15150
|
const artifactPaths = artifactsDir ? getArtifactPaths(artifactsDir, options.runId, agent.name, options.index) : undefined;
|
|
@@ -15157,7 +15162,7 @@ ${task}`);
|
|
|
15157
15162
|
agent,
|
|
15158
15163
|
cwd,
|
|
15159
15164
|
testSession,
|
|
15160
|
-
|
|
15165
|
+
sessionManager: options.sessionManager,
|
|
15161
15166
|
...options.progressPath ? { progressPath: options.progressPath } : {},
|
|
15162
15167
|
...options.progressArtifactPath ? { progressArtifactPath: options.progressArtifactPath } : options.progressPath && artifactsDir ? { progressArtifactPath: options.progressPath } : {},
|
|
15163
15168
|
...artifactPaths?.outputPath ? { outputArtifactPath: artifactPaths.outputPath } : {},
|
|
@@ -15402,7 +15407,7 @@ function resolveSubagentExecutorRuntimeDeps(overrides) {
|
|
|
15402
15407
|
}
|
|
15403
15408
|
|
|
15404
15409
|
// dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts
|
|
15405
|
-
import * as
|
|
15410
|
+
import * as fs18 from "node:fs";
|
|
15406
15411
|
import * as path20 from "node:path";
|
|
15407
15412
|
function formatFailedSingleRunOutput(result, displayOutput) {
|
|
15408
15413
|
const error = result.error || "Failed";
|
|
@@ -15421,7 +15426,7 @@ function cleanupTransientProgress(progressDir, artifactsEnabled) {
|
|
|
15421
15426
|
if (!progressDir || artifactsEnabled)
|
|
15422
15427
|
return;
|
|
15423
15428
|
try {
|
|
15424
|
-
|
|
15429
|
+
fs18.rmSync(progressDir, { recursive: true, force: true });
|
|
15425
15430
|
} catch {}
|
|
15426
15431
|
}
|
|
15427
15432
|
function createForwardSingleUpdate(onUpdate, foregroundControl, agent, index) {
|
|
@@ -15454,7 +15459,7 @@ async function runSinglePath(data, deps) {
|
|
|
15454
15459
|
signal,
|
|
15455
15460
|
runId,
|
|
15456
15461
|
sessionDirForIndex,
|
|
15457
|
-
|
|
15462
|
+
sessionManagerForIndex,
|
|
15458
15463
|
shareEnabled,
|
|
15459
15464
|
artifactConfig,
|
|
15460
15465
|
artifactsDir,
|
|
@@ -15541,6 +15546,7 @@ async function runSinglePath(data, deps) {
|
|
|
15541
15546
|
try {
|
|
15542
15547
|
const supervisorAuthorization = await requestSupervisorAuthorization(deps.pi.events, childIntercomTarget, ctx.getChildSessionOptions?.({ tools: agentConfig.tools }));
|
|
15543
15548
|
const runOptions = {
|
|
15549
|
+
runningCapacity: deps.config.parallel?.runningCapacity,
|
|
15544
15550
|
getChildSessionOptions: ctx.getChildSessionOptions,
|
|
15545
15551
|
resourceLoaderInheritanceSnapshot: deps.pi.getResourceLoaderInheritanceSnapshot?.(),
|
|
15546
15552
|
cwd: effectiveCwd,
|
|
@@ -15551,7 +15557,7 @@ async function runSinglePath(data, deps) {
|
|
|
15551
15557
|
intercomEvents: deps.pi.events,
|
|
15552
15558
|
runId,
|
|
15553
15559
|
sessionDir: sessionDirForIndex(0),
|
|
15554
|
-
|
|
15560
|
+
sessionManager: await sessionManagerForIndex(0),
|
|
15555
15561
|
share: shareEnabled,
|
|
15556
15562
|
artifactsDir: artifactConfig.enabled ? artifactsDir : undefined,
|
|
15557
15563
|
artifactConfig,
|
|
@@ -17519,13 +17525,13 @@ function renderSubagentResult(result, options, theme) {
|
|
|
17519
17525
|
return appendParentAskOutput(c, handoffOutput, theme);
|
|
17520
17526
|
}
|
|
17521
17527
|
// dist/builtin/subagents/src/extension/config.ts
|
|
17522
|
-
import * as
|
|
17528
|
+
import * as fs19 from "node:fs";
|
|
17523
17529
|
import { getAgentConfigPaths as getAgentConfigPaths5 } from "@bastani/atomic";
|
|
17524
17530
|
function loadConfig() {
|
|
17525
17531
|
for (const configPath of getAgentConfigPaths5("extensions", "subagent", "config.json")) {
|
|
17526
17532
|
try {
|
|
17527
|
-
if (
|
|
17528
|
-
return JSON.parse(
|
|
17533
|
+
if (fs19.existsSync(configPath)) {
|
|
17534
|
+
return JSON.parse(fs19.readFileSync(configPath, "utf-8"));
|
|
17529
17535
|
}
|
|
17530
17536
|
} catch (error) {
|
|
17531
17537
|
console.error(`Failed to load subagent config from '${configPath}':`, error);
|
|
@@ -17741,8 +17747,7 @@ var SubagentParams = Type.Object({
|
|
|
17741
17747
|
description: `Agent config for create/update. Agent: name, package (optional namespace; runtime name becomes package.name), description, scope ('user'|'project', default 'user'), systemPrompt, systemPromptMode, inheritProjectContext, inheritSkills, defaultContext ('fresh'|'fork'), model, tools (comma-separated), extensions (comma-separated), skills (comma-separated), thinking, output, reads, progress. String values must be valid JSON.`
|
|
17742
17748
|
})),
|
|
17743
17749
|
tasks: Type.Optional(Type.Array(TaskItem, {
|
|
17744
|
-
|
|
17745
|
-
description: `PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]. Maximum ${MAX_PARALLEL_TASKS} tasks after count expansion.`
|
|
17750
|
+
description: `PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]. Maximum tasks after count expansion is configured by parallel.maxTasks (default ${MAX_PARALLEL_TASKS}).`
|
|
17746
17751
|
})),
|
|
17747
17752
|
concurrency: Type.Optional(Type.Integer({
|
|
17748
17753
|
minimum: 1,
|
|
@@ -17863,7 +17868,7 @@ function renderSubagentToolResult(result, options, theme, context) {
|
|
|
17863
17868
|
const outcomes = response.kind === "parallel" ? response.slots.map((slot) => slot.outcome) : [response];
|
|
17864
17869
|
const labels = request && !burst ? [
|
|
17865
17870
|
...request.agent ? [{ agent: request.agent, task: request.task ?? "" }] : [],
|
|
17866
|
-
...(request.tasks ?? []).flatMap((task) => Array.from({ length: Math.
|
|
17871
|
+
...(request.tasks ?? []).flatMap((task) => Array.from({ length: Math.max(1, task.count ?? 1) }, () => task))
|
|
17867
17872
|
] : [];
|
|
17868
17873
|
const lines = outcomes.map((outcome, index) => {
|
|
17869
17874
|
if (outcome.kind === "unstarted")
|
|
@@ -17957,11 +17962,11 @@ function getApiScopedSet(pi, key) {
|
|
|
17957
17962
|
import * as path22 from "node:path";
|
|
17958
17963
|
|
|
17959
17964
|
// dist/builtin/subagents/src/runs/inprocess/runtime-support/temp-cleanup.ts
|
|
17960
|
-
import * as
|
|
17965
|
+
import * as fs20 from "node:fs";
|
|
17961
17966
|
import * as path21 from "node:path";
|
|
17962
17967
|
var SUBAGENT_RUNTIME_TEMP_DIR = path21.join(TEMP_ROOT_DIR, "nested-subagent-events");
|
|
17963
17968
|
function hasEntryNewerThan(filePath, cutoff) {
|
|
17964
|
-
const stat =
|
|
17969
|
+
const stat = fs20.statSync(filePath);
|
|
17965
17970
|
if (stat.mtimeMs >= cutoff)
|
|
17966
17971
|
return true;
|
|
17967
17972
|
if (!stat.isDirectory())
|
|
@@ -17971,14 +17976,14 @@ function hasEntryNewerThan(filePath, cutoff) {
|
|
|
17971
17976
|
function directoryHasEntryNewerThan(dirPath, cutoff) {
|
|
17972
17977
|
let entries;
|
|
17973
17978
|
try {
|
|
17974
|
-
entries =
|
|
17979
|
+
entries = fs20.readdirSync(dirPath);
|
|
17975
17980
|
} catch {
|
|
17976
17981
|
return false;
|
|
17977
17982
|
}
|
|
17978
17983
|
for (const entry of entries) {
|
|
17979
17984
|
const childPath = path21.join(dirPath, entry);
|
|
17980
17985
|
try {
|
|
17981
|
-
const stat =
|
|
17986
|
+
const stat = fs20.statSync(childPath);
|
|
17982
17987
|
if (stat.mtimeMs >= cutoff)
|
|
17983
17988
|
return true;
|
|
17984
17989
|
if (stat.isDirectory() && directoryHasEntryNewerThan(childPath, cutoff))
|
|
@@ -17990,7 +17995,7 @@ function directoryHasEntryNewerThan(dirPath, cutoff) {
|
|
|
17990
17995
|
function cleanupOldSubdirectories(root, maxAgeDays) {
|
|
17991
17996
|
let entries;
|
|
17992
17997
|
try {
|
|
17993
|
-
entries =
|
|
17998
|
+
entries = fs20.readdirSync(root);
|
|
17994
17999
|
} catch (error) {
|
|
17995
18000
|
if (error.code === "ENOENT")
|
|
17996
18001
|
return;
|
|
@@ -18001,7 +18006,7 @@ function cleanupOldSubdirectories(root, maxAgeDays) {
|
|
|
18001
18006
|
const entryPath = path21.join(root, entry);
|
|
18002
18007
|
try {
|
|
18003
18008
|
if (!hasEntryNewerThan(entryPath, cutoff))
|
|
18004
|
-
|
|
18009
|
+
fs20.rmSync(entryPath, { recursive: true, force: true });
|
|
18005
18010
|
} catch {}
|
|
18006
18011
|
}
|
|
18007
18012
|
}
|
|
@@ -18106,7 +18111,7 @@ function getSubagentSessionRoot(parentSessionFile) {
|
|
|
18106
18111
|
const sessionsDir = path23.dirname(parentSessionFile);
|
|
18107
18112
|
return path23.join(sessionsDir, baseName);
|
|
18108
18113
|
}
|
|
18109
|
-
return
|
|
18114
|
+
return fs21.mkdtempSync(path23.join(os8.tmpdir(), `${APP_NAME3}-subagent-session-`));
|
|
18110
18115
|
}
|
|
18111
18116
|
function expandTilde2(p) {
|
|
18112
18117
|
return p.startsWith("~/") ? path23.join(os8.homedir(), p.slice(2)) : p;
|