@bastani/atomic 0.9.14 → 0.9.15-alpha.1
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 +23 -0
- package/README.md +1 -1
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +6 -0
- package/dist/builtin/mcp/package.json +4 -4
- package/dist/builtin/mcp/sampling-handler.ts +2 -2
- package/dist/builtin/mcp/types.ts +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +21 -0
- package/dist/builtin/subagents/README.md +5 -22
- package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
- package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
- package/dist/builtin/subagents/agents/worker.md +2 -2
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -6
- package/dist/builtin/subagents/src/agents/agent-loaders.ts +0 -4
- package/dist/builtin/subagents/src/agents/agent-management-helpers.ts +1 -12
- package/dist/builtin/subagents/src/agents/agent-management.ts +0 -1
- package/dist/builtin/subagents/src/agents/agent-serializer.ts +7 -6
- package/dist/builtin/subagents/src/agents/agent-types.ts +0 -1
- package/dist/builtin/subagents/src/extension/schemas.ts +2 -2
- package/dist/builtin/subagents/src/extension/startup-maintenance.ts +2 -2
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +0 -127
- package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +1 -3
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +15 -106
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +0 -3
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +2 -13
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +2 -12
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +1 -20
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +0 -6
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +10 -21
- package/dist/builtin/subagents/src/runs/inprocess/attempt-handles.ts +104 -0
- package/dist/builtin/subagents/src/runs/inprocess/index.ts +10 -21
- package/dist/builtin/subagents/src/runs/inprocess/prompt-behavior.ts +2 -3
- package/dist/builtin/subagents/src/runs/inprocess/runner.ts +11 -32
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/temp-cleanup.ts +69 -0
- package/dist/builtin/subagents/src/shared/model-resolution.ts +1 -1
- package/dist/builtin/subagents/src/shared/types-config.ts +0 -4
- package/dist/builtin/subagents/src/shared/types-depth.ts +15 -103
- package/dist/builtin/subagents/src/shared/types-foreground-state.ts +56 -0
- package/dist/builtin/subagents/src/shared/types-results.ts +1 -59
- package/dist/builtin/subagents/src/shared/types-runtime.ts +0 -2
- package/dist/builtin/subagents/src/shared/types.ts +1 -1
- package/dist/builtin/subagents/src/shared/utils.ts +1 -1
- package/dist/builtin/subagents/src/slash/slash-live-state.ts +1 -1
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/web-access/summary-review.ts +2 -2
- package/dist/builtin/web-access/web-search-summary.ts +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +14 -0
- package/dist/builtin/workflows/README.md +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +60473 -401
- package/dist/builtin/workflows/src/extension/public-types.ts +1 -1
- package/dist/builtin/workflows/src/extension/wiring.ts +1 -1
- package/dist/builtin/workflows/src/extension/workflow-heartbeat-delivery.ts +48 -4
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +5 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +35 -2
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-pause.ts +6 -0
- package/dist/builtin/workflows/src/tui/chat-surface-message.ts +15 -13
- package/dist/builtin/workflows/src/tui/store-widget-installer.ts +25 -2
- package/dist/bun/cli.js +1 -1
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-bedrock.js +2 -2
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/cli/auth-check.d.ts +1 -1
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js +1 -1
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/credential-print.d.ts +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +2 -2
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/list-models.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 +1 -1
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +1 -1
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +1 -1
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +2 -2
- 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 +2 -2
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +1 -1
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.js +1 -1
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +1 -1
- 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.map +1 -1
- package/dist/core/agent-session-state.d.ts +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +1 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-thinking-guard.d.ts +1 -1
- package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
- package/dist/core/anthropic-thinking-guard.js +1 -1
- package/dist/core/anthropic-thinking-guard.js.map +1 -1
- package/dist/core/auth-storage.d.ts +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/cache-stats.d.ts +1 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cloudflare-gateway-binding.d.ts +1 -1
- package/dist/core/cloudflare-gateway-binding.d.ts.map +1 -1
- package/dist/core/cloudflare-gateway-binding.js +1 -1
- package/dist/core/cloudflare-gateway-binding.js.map +1 -1
- package/dist/core/codex-fast-mode.d.ts +2 -2
- package/dist/core/codex-fast-mode.d.ts.map +1 -1
- package/dist/core/codex-fast-mode.js +3 -2
- package/dist/core/codex-fast-mode.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +2 -2
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +2 -2
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/fallback-planner.d.ts +1 -1
- package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
- package/dist/core/compaction/fallback-planner.js.map +1 -1
- package/dist/core/compaction/planner-outcome.d.ts +1 -1
- package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
- package/dist/core/compaction/planner-outcome.js +1 -1
- package/dist/core/compaction/planner-outcome.js.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.d.ts +1 -1
- package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.js +1 -1
- package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts +2 -2
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +2 -2
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/session-summarization.d.ts +2 -2
- package/dist/core/compaction/session-summarization.d.ts.map +1 -1
- package/dist/core/compaction/session-summarization.js +2 -2
- package/dist/core/compaction/session-summarization.js.map +1 -1
- package/dist/core/compaction/transcript-serialization.d.ts +1 -1
- package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
- package/dist/core/compaction/transcript-serialization.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/experimental.d.ts +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/agent-events.d.ts +2 -2
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +2 -2
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +1 -7
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/event-results.d.ts +1 -1
- package/dist/core/extensions/event-results.d.ts.map +1 -1
- package/dist/core/extensions/event-results.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +21 -9
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -2
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/reactive-widget.d.ts +6 -0
- package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
- package/dist/core/extensions/reactive-widget.js +62 -6
- package/dist/core/extensions/reactive-widget.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +1 -1
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts +1 -1
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +2 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +2 -2
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/tool-events.d.ts +1 -1
- package/dist/core/extensions/tool-events.d.ts.map +1 -1
- package/dist/core/extensions/tool-events.js.map +1 -1
- package/dist/core/extensions/tool-types.d.ts +2 -2
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +2 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/fallback-models.d.ts +1 -1
- package/dist/core/fallback-models.d.ts.map +1 -1
- package/dist/core/fallback-models.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +14 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-capabilities.d.ts +1 -1
- package/dist/core/model-capabilities.d.ts.map +1 -1
- package/dist/core/model-capabilities.js.map +1 -1
- package/dist/core/model-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +18 -1
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-cli.js.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts +1 -1
- package/dist/core/model-resolver-defaults.d.ts.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/model-resolver-initial.d.ts +1 -1
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver-patterns.d.ts +1 -1
- package/dist/core/model-resolver-patterns.d.ts.map +1 -1
- package/dist/core/model-resolver-patterns.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +1 -1
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.js +1 -1
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-resolver-types.d.ts +1 -1
- 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-runtime-auth.d.ts +1 -1
- package/dist/core/model-runtime-auth.d.ts.map +1 -1
- package/dist/core/model-runtime-auth.js.map +1 -1
- package/dist/core/model-runtime-providers.d.ts +2 -2
- package/dist/core/model-runtime-providers.d.ts.map +1 -1
- package/dist/core/model-runtime-providers.js +2 -2
- package/dist/core/model-runtime-providers.js.map +1 -1
- package/dist/core/model-runtime-restoration.d.ts +1 -1
- package/dist/core/model-runtime-restoration.d.ts.map +1 -1
- package/dist/core/model-runtime-restoration.js.map +1 -1
- package/dist/core/model-runtime-snapshot.d.ts +1 -1
- package/dist/core/model-runtime-snapshot.d.ts.map +1 -1
- package/dist/core/model-runtime-snapshot.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts +1 -1
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +1 -1
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime-types.d.ts +1 -1
- package/dist/core/model-runtime-types.d.ts.map +1 -1
- package/dist/core/model-runtime-types.js.map +1 -1
- package/dist/core/model-runtime.d.ts +8 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +15 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/oauth-login.d.ts +1 -1
- package/dist/core/oauth-login.d.ts.map +1 -1
- package/dist/core/oauth-login.js.map +1 -1
- package/dist/core/oauth-provider-metadata.d.ts +1 -1
- package/dist/core/oauth-provider-metadata.d.ts.map +1 -1
- package/dist/core/oauth-provider-metadata.js.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.d.ts +1 -1
- package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.js.map +1 -1
- package/dist/core/provider-attribution.d.ts +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +1 -1
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +2 -2
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-context-usage.d.ts.map +1 -1
- package/dist/core/provider-context-usage.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +1 -1
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk-types.d.ts +1 -1
- 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 +30 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +2 -2
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +1 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +1 -1
- 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.js +1 -1
- package/dist/core/session-manager-validation.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +11 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +2 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/summarization-retry.d.ts +1 -1
- package/dist/core/summarization-retry.d.ts.map +1 -1
- package/dist/core/summarization-retry.js.map +1 -1
- package/dist/core/tools/bash-session-environment.d.ts +1 -1
- package/dist/core/tools/bash-session-environment.d.ts.map +1 -1
- package/dist/core/tools/bash-session-environment.js.map +1 -1
- package/dist/core/tools/oversized-tool-result.d.ts +1 -1
- package/dist/core/tools/oversized-tool-result.d.ts.map +1 -1
- package/dist/core/tools/oversized-tool-result.js.map +1 -1
- package/dist/core/tools/read-url.d.ts +1 -1
- package/dist/core/tools/read-url.d.ts.map +1 -1
- package/dist/core/tools/read-url.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/resource-selectors.d.ts +1 -1
- package/dist/core/tools/resource-selectors.d.ts.map +1 -1
- package/dist/core/tools/resource-selectors.js +2 -7
- package/dist/core/tools/resource-selectors.js.map +1 -1
- package/dist/core/typebox-compat.js +1 -1
- package/dist/core/typebox-compat.js.map +1 -1
- package/dist/core/usage-totals.d.ts +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/main-app-mode.d.ts +1 -1
- package/dist/main-app-mode.d.ts.map +1 -1
- package/dist/main-app-mode.js.map +1 -1
- package/dist/main-session-options.js +1 -1
- package/dist/main-session-options.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-context.js +26 -0
- package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +7 -2
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +1 -0
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -0
- 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/model-catalog-refresh.d.ts +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/streaming-assistant-message.d.ts +1 -1
- package/dist/modes/interactive/streaming-assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/streaming-assistant-message.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +3 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +26 -3
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts +2 -1
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +14 -0
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/json-event.d.ts +1 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -2
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.js +4 -1
- package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -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/tool-result-images.d.ts +1 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/docs/custom-provider.md +11 -8
- package/docs/development.md +0 -2
- package/docs/extensions.md +2 -2
- package/docs/json.md +1 -1
- package/docs/models/artificial-analysis-index.md +2 -2
- package/docs/models/model-selection.md +8 -8
- package/docs/models/pareto-efficiency.md +10 -10
- package/docs/models.md +9 -3
- package/docs/packages.md +1 -1
- package/docs/providers.md +5 -3
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +2 -2
- package/docs/session-format.md +2 -2
- package/docs/settings.md +2 -1
- package/docs/subagents.md +5 -6
- package/docs/tui.md +3 -0
- package/docs/workflows.md +3 -1
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/custom-footer.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
- package/examples/extensions/handoff.ts +2 -2
- package/examples/extensions/hello.ts +1 -1
- package/examples/extensions/plan-mode/index.ts +1 -1
- package/examples/extensions/preset.ts +1 -1
- package/examples/extensions/qna.ts +1 -1
- package/examples/extensions/subagent/display.ts +1 -1
- package/examples/extensions/subagent/runner.ts +1 -1
- package/examples/extensions/subagent/types.ts +1 -1
- package/examples/extensions/summarize.ts +2 -2
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +54 -31
- package/package.json +3 -3
- package/dist/builtin/subagents/src/extension/fanout-child.ts +0 -259
- package/dist/builtin/subagents/src/runs/inprocess/nested-routing.ts +0 -218
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-api.ts +0 -55
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-control.ts +0 -178
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-core.ts +0 -187
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-paths.ts +0 -57
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-projection.ts +0 -42
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-registry.ts +0 -352
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-rendering.ts +0 -136
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-sanitize.ts +0 -252
- package/dist/builtin/subagents/src/shared/types-nested.ts +0 -127
- package/dist/core/copilot-env-routing.d.ts +0 -36
- package/dist/core/copilot-env-routing.d.ts.map +0 -1
- package/dist/core/copilot-env-routing.js +0 -94
- package/dist/core/copilot-env-routing.js.map +0 -1
|
@@ -3,9 +3,6 @@ import { isStaleExtensionContextError } from "@bastani/atomic";
|
|
|
3
3
|
import {
|
|
4
4
|
type Details,
|
|
5
5
|
type IntercomEventBus,
|
|
6
|
-
MAX_SUBAGENT_NESTING_DEPTH,
|
|
7
|
-
type NestedRunSummary,
|
|
8
|
-
type PublicNestedRunSummary,
|
|
9
6
|
type SingleResult,
|
|
10
7
|
SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT,
|
|
11
8
|
SUBAGENT_RESULT_INTERCOM_EVENT,
|
|
@@ -63,128 +60,6 @@ function resolveGroupedStatus(children: SubagentResultIntercomChild[]): Subagent
|
|
|
63
60
|
return "failed";
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
function compactNestedRun(run: NestedRunSummary | PublicNestedRunSummary, depth = 0): PublicNestedRunSummary {
|
|
67
|
-
return {
|
|
68
|
-
id: run.id,
|
|
69
|
-
parentRunId: run.parentRunId,
|
|
70
|
-
...(run.parentStepIndex !== undefined ? { parentStepIndex: run.parentStepIndex } : {}),
|
|
71
|
-
...(run.parentAgent ? { parentAgent: run.parentAgent } : {}),
|
|
72
|
-
depth: run.depth,
|
|
73
|
-
path: run.path.slice(0, MAX_SUBAGENT_NESTING_DEPTH + 1).map((part) => ({
|
|
74
|
-
runId: part.runId,
|
|
75
|
-
...(part.stepIndex !== undefined ? { stepIndex: part.stepIndex } : {}),
|
|
76
|
-
...(part.agent ? { agent: part.agent } : {}),
|
|
77
|
-
})),
|
|
78
|
-
...(run.sessionId ? { sessionId: run.sessionId } : {}),
|
|
79
|
-
...(run.sessionFile ? { sessionFile: run.sessionFile } : {}),
|
|
80
|
-
...(run.intercomTarget ? { intercomTarget: run.intercomTarget } : {}),
|
|
81
|
-
...(run.ownerIntercomTarget ? { ownerIntercomTarget: run.ownerIntercomTarget } : {}),
|
|
82
|
-
...(run.leafIntercomTarget ? { leafIntercomTarget: run.leafIntercomTarget } : {}),
|
|
83
|
-
...(run.ownerState ? { ownerState: run.ownerState } : {}),
|
|
84
|
-
...(run.mode ? { mode: run.mode } : {}),
|
|
85
|
-
state: run.state,
|
|
86
|
-
...(run.agent ? { agent: run.agent } : {}),
|
|
87
|
-
...(run.agents?.length ? { agents: run.agents.slice(0, 12) } : {}),
|
|
88
|
-
...(run.activityState ? { activityState: run.activityState } : {}),
|
|
89
|
-
...(run.lastActivityAt !== undefined ? { lastActivityAt: run.lastActivityAt } : {}),
|
|
90
|
-
...(run.currentTool ? { currentTool: run.currentTool } : {}),
|
|
91
|
-
...(run.currentToolStartedAt !== undefined ? { currentToolStartedAt: run.currentToolStartedAt } : {}),
|
|
92
|
-
...(run.currentPath ? { currentPath: run.currentPath } : {}),
|
|
93
|
-
...(run.turnCount !== undefined ? { turnCount: run.turnCount } : {}),
|
|
94
|
-
...(run.toolCount !== undefined ? { toolCount: run.toolCount } : {}),
|
|
95
|
-
...(run.totalTokens ? { totalTokens: run.totalTokens } : {}),
|
|
96
|
-
...(run.startedAt !== undefined ? { startedAt: run.startedAt } : {}),
|
|
97
|
-
...(run.endedAt !== undefined ? { endedAt: run.endedAt } : {}),
|
|
98
|
-
...(run.lastUpdate !== undefined ? { lastUpdate: run.lastUpdate } : {}),
|
|
99
|
-
...(run.error ? { error: run.error } : {}),
|
|
100
|
-
...(run.steps?.length
|
|
101
|
-
? {
|
|
102
|
-
steps: run.steps.slice(0, 12).map((step) => ({
|
|
103
|
-
agent: step.agent,
|
|
104
|
-
status: step.status,
|
|
105
|
-
...(step.sessionFile ? { sessionFile: step.sessionFile } : {}),
|
|
106
|
-
...(step.activityState ? { activityState: step.activityState } : {}),
|
|
107
|
-
...(step.lastActivityAt !== undefined ? { lastActivityAt: step.lastActivityAt } : {}),
|
|
108
|
-
...(step.currentTool ? { currentTool: step.currentTool } : {}),
|
|
109
|
-
...(step.currentToolStartedAt !== undefined
|
|
110
|
-
? { currentToolStartedAt: step.currentToolStartedAt }
|
|
111
|
-
: {}),
|
|
112
|
-
...(step.currentPath ? { currentPath: step.currentPath } : {}),
|
|
113
|
-
...(step.turnCount !== undefined ? { turnCount: step.turnCount } : {}),
|
|
114
|
-
...(step.toolCount !== undefined ? { toolCount: step.toolCount } : {}),
|
|
115
|
-
...(step.startedAt !== undefined ? { startedAt: step.startedAt } : {}),
|
|
116
|
-
...(step.endedAt !== undefined ? { endedAt: step.endedAt } : {}),
|
|
117
|
-
...(step.error ? { error: step.error } : {}),
|
|
118
|
-
...(depth < MAX_SUBAGENT_NESTING_DEPTH && step.children?.length
|
|
119
|
-
? { children: step.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) }
|
|
120
|
-
: {}),
|
|
121
|
-
})),
|
|
122
|
-
}
|
|
123
|
-
: {}),
|
|
124
|
-
...(depth < MAX_SUBAGENT_NESTING_DEPTH && run.children?.length
|
|
125
|
-
? { children: run.children.slice(0, 8).map((child) => compactNestedRun(child, depth + 1)) }
|
|
126
|
-
: {}),
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function compactNestedResultChildren(
|
|
131
|
-
children: Array<NestedRunSummary | PublicNestedRunSummary> | undefined,
|
|
132
|
-
): PublicNestedRunSummary[] | undefined {
|
|
133
|
-
if (!children?.length) return undefined;
|
|
134
|
-
return children.slice(0, 16).map((child) => compactNestedRun(child));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function attachNestedChildrenToResultChildren(
|
|
138
|
-
runId: string,
|
|
139
|
-
children: SubagentResultIntercomChild[],
|
|
140
|
-
nestedChildren: NestedRunSummary[] | undefined,
|
|
141
|
-
): SubagentResultIntercomChild[] {
|
|
142
|
-
const compact = compactNestedResultChildren(nestedChildren);
|
|
143
|
-
if (!compact?.length)
|
|
144
|
-
return children.map((child) => ({ ...child, children: compactNestedResultChildren(child.children) }));
|
|
145
|
-
return children.map((child, index) => {
|
|
146
|
-
const childIndex = child.index ?? index;
|
|
147
|
-
const alreadyAttachedIds = new Set(child.children?.map((nested) => nested.id) ?? []);
|
|
148
|
-
const attached = compact.filter(
|
|
149
|
-
(nested) =>
|
|
150
|
-
nested.parentRunId === runId && nested.parentStepIndex === childIndex && !alreadyAttachedIds.has(nested.id),
|
|
151
|
-
);
|
|
152
|
-
const fallbackAttached =
|
|
153
|
-
children.length === 1
|
|
154
|
-
? compact.filter(
|
|
155
|
-
(nested) =>
|
|
156
|
-
nested.parentRunId === runId &&
|
|
157
|
-
nested.parentStepIndex === undefined &&
|
|
158
|
-
!alreadyAttachedIds.has(nested.id),
|
|
159
|
-
)
|
|
160
|
-
: [];
|
|
161
|
-
const merged = compactNestedResultChildren([...(child.children ?? []), ...attached, ...fallbackAttached]);
|
|
162
|
-
return merged?.length ? { ...child, children: merged } : { ...child, children: undefined };
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function formatNestedResultLines(children: PublicNestedRunSummary[] | undefined): string[] {
|
|
167
|
-
if (!children?.length) return [];
|
|
168
|
-
const lines = ["Nested subagents:"];
|
|
169
|
-
let remaining = 10;
|
|
170
|
-
const append = (runs: PublicNestedRunSummary[] | undefined, indent: string): void => {
|
|
171
|
-
for (const run of runs ?? []) {
|
|
172
|
-
if (remaining <= 0) {
|
|
173
|
-
lines.push(`${indent}↳ +more nested runs; inspect status for full tree`);
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
remaining--;
|
|
177
|
-
const label = run.agent ?? run.agents?.join("+") ?? run.id;
|
|
178
|
-
lines.push(`${indent}↳ ${label} — ${run.state} [${run.id}]`);
|
|
179
|
-
if (run.sessionFile) lines.push(`${indent} Session: ${run.sessionFile}`);
|
|
180
|
-
append(run.children, `${indent} `);
|
|
181
|
-
for (const step of run.steps ?? []) append(step.children, `${indent} `);
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
append(children, "");
|
|
185
|
-
return lines;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
63
|
export interface GroupedResultIntercomMessageInput {
|
|
189
64
|
to: string;
|
|
190
65
|
runId: string;
|
|
@@ -220,7 +95,6 @@ function formatSubagentResultIntercomMessage(input: {
|
|
|
220
95
|
if (child.intercomTarget) lines.push(`Run intercom target: ${child.intercomTarget}`);
|
|
221
96
|
if (child.artifactPath) lines.push(`Output artifact: ${child.artifactPath}`);
|
|
222
97
|
if (child.sessionPath) lines.push(`Session: ${child.sessionPath}`);
|
|
223
|
-
lines.push(...formatNestedResultLines(child.children));
|
|
224
98
|
lines.push("Summary:", child.summary);
|
|
225
99
|
}
|
|
226
100
|
|
|
@@ -233,7 +107,6 @@ export function buildSubagentResultIntercomPayload(
|
|
|
233
107
|
const children = input.children.map((child) => ({
|
|
234
108
|
...child,
|
|
235
109
|
summary: child.summary.trim() || "(no output)",
|
|
236
|
-
children: compactNestedResultChildren(child.children),
|
|
237
110
|
}));
|
|
238
111
|
const status = resolveGroupedStatus(children);
|
|
239
112
|
const summary = formatStatusCounts(countStatuses(children));
|
|
@@ -56,7 +56,6 @@ function workflowOrchestrationContext(options: RunSyncOptions): ParentContext["o
|
|
|
56
56
|
workflowStageName: workflow.stageName,
|
|
57
57
|
constraints: {
|
|
58
58
|
disableWorkflowTool: true,
|
|
59
|
-
maxSubagentDepth: options.maxSubagentDepth ?? 5,
|
|
60
59
|
},
|
|
61
60
|
...(options.intercomGroup ? { intercomGroup: options.intercomGroup } : {}),
|
|
62
61
|
};
|
|
@@ -263,7 +262,6 @@ export async function runSingleInProcess(
|
|
|
263
262
|
cwd,
|
|
264
263
|
testSession: testSession,
|
|
265
264
|
sessionFile: options.sessionFile,
|
|
266
|
-
...(options.maxSubagentDepth === undefined ? {} : { maxSubagentDepth: options.maxSubagentDepth }),
|
|
267
265
|
tools: agent.tools,
|
|
268
266
|
mcpDirectTools: agent.mcpDirectTools,
|
|
269
267
|
skills: options.skills ?? agent.skills,
|
|
@@ -351,7 +349,7 @@ export async function runSingleInProcess(
|
|
|
351
349
|
lastActivityAt: Date.now(),
|
|
352
350
|
});
|
|
353
351
|
}
|
|
354
|
-
control.
|
|
352
|
+
control.registerAttempt(options.runId, running, {
|
|
355
353
|
model: resolvedCandidate?.model,
|
|
356
354
|
modelId: candidate,
|
|
357
355
|
thinkingLevel: spec.thinkingLevel,
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
applyIntercomBridgeToAgent,
|
|
8
8
|
resolveIntercomBridge,
|
|
9
9
|
resolveIntercomSessionTarget,
|
|
10
|
-
resolveSubagentIntercomTarget,
|
|
11
10
|
} from "../../intercom/intercom-bridge.js";
|
|
12
11
|
import { getArtifactsDir } from "../../shared/artifacts.js";
|
|
13
12
|
import { createForkContextResolver } from "../../shared/fork-context.js";
|
|
@@ -15,19 +14,13 @@ import { resolveCurrentSessionId } from "../../shared/session-identity.js";
|
|
|
15
14
|
import { buildReadInstruction } from "../../shared/settings.js";
|
|
16
15
|
import {
|
|
17
16
|
type ArtifactConfig,
|
|
18
|
-
checkSubagentDepth,
|
|
19
17
|
DEFAULT_ARTIFACT_CONFIG,
|
|
20
|
-
|
|
18
|
+
getCurrentSubagentDepth,
|
|
19
|
+
isSubagentChildSession,
|
|
20
|
+
SUBAGENT_CHILD_DELEGATION_BLOCKED_MESSAGE,
|
|
21
|
+
type SubagentRunMode,
|
|
21
22
|
type SubagentToolResult,
|
|
22
|
-
subagentDepthBlockedMessage,
|
|
23
23
|
} from "../../shared/types.js";
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
createNestedRoute,
|
|
27
|
-
resolveInheritedNestedRouteFromEnv,
|
|
28
|
-
resolveNestedParentAddressFromEnv,
|
|
29
|
-
writeNestedEvent,
|
|
30
|
-
} from "../inprocess/runtime-support/nested-api.js";
|
|
31
24
|
import { resolveControlConfig } from "../shared/subagent-control.js";
|
|
32
25
|
import {
|
|
33
26
|
applyAgentDefaultContext,
|
|
@@ -43,23 +36,19 @@ import type {
|
|
|
43
36
|
SubagentParamsLike,
|
|
44
37
|
} from "./subagent-executor-types.js";
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Delegation is one level deep and not configurable: a session that was itself
|
|
41
|
+
* admitted as a subagent child may never call the subagent tool.
|
|
42
|
+
*/
|
|
43
|
+
export function refuseSubagentChildDelegation(
|
|
44
|
+
ctx: Pick<ExtensionContext, "subagentPolicy">,
|
|
45
|
+
mode: SubagentRunMode | "management",
|
|
49
46
|
): SubagentToolResult | undefined {
|
|
50
|
-
|
|
51
|
-
const { blocked, depth, maxDepth } = checkSubagentDepth(ctx, depthPolicy.maxSubagentDepth);
|
|
52
|
-
const workflowStageSubagentGuard = depthPolicy.workflowStageSubagentGuard;
|
|
53
|
-
if (!blocked) return undefined;
|
|
47
|
+
if (!isSubagentChildSession(ctx)) return undefined;
|
|
54
48
|
return {
|
|
55
|
-
content: [
|
|
56
|
-
{
|
|
57
|
-
type: "text",
|
|
58
|
-
text: subagentDepthBlockedMessage(depth, maxDepth, { workflowStageGuard: workflowStageSubagentGuard }),
|
|
59
|
-
},
|
|
60
|
-
],
|
|
49
|
+
content: [{ type: "text", text: SUBAGENT_CHILD_DELEGATION_BLOCKED_MESSAGE }],
|
|
61
50
|
isError: true,
|
|
62
|
-
details: { mode
|
|
51
|
+
details: { mode, results: [] },
|
|
63
52
|
};
|
|
64
53
|
}
|
|
65
54
|
|
|
@@ -71,8 +60,7 @@ export function prepareExecutionContext(input: {
|
|
|
71
60
|
deps: ResolvedExecutorDeps;
|
|
72
61
|
}): ExecutionContextBuildResult {
|
|
73
62
|
const { params, ctx, signal, onUpdate, deps } = input;
|
|
74
|
-
const
|
|
75
|
-
const { depth } = checkSubagentDepth(ctx, depthPolicy.maxSubagentDepth);
|
|
63
|
+
const depth = getCurrentSubagentDepth(ctx);
|
|
76
64
|
const normalized = normalizeRepeatedParallelCounts(params);
|
|
77
65
|
if (normalized.error) return { error: normalized.error };
|
|
78
66
|
const normalizedParams = normalized.params!;
|
|
@@ -96,9 +84,6 @@ export function prepareExecutionContext(input: {
|
|
|
96
84
|
? discoveredAgents.map((agent) => applyIntercomBridgeToAgent(agent, intercomBridge))
|
|
97
85
|
: discoveredAgents;
|
|
98
86
|
const runId = randomUUID().slice(0, 8);
|
|
99
|
-
const inheritedNestedRoute = resolveInheritedNestedRouteFromEnv();
|
|
100
|
-
const nestedParentAddress = inheritedNestedRoute ? resolveNestedParentAddressFromEnv() : undefined;
|
|
101
|
-
const nestedRoute = inheritedNestedRoute ?? createNestedRoute(runId);
|
|
102
87
|
const shareEnabled = effectiveParams.share === true;
|
|
103
88
|
const hasTasks = (effectiveParams.tasks?.length ?? 0) > 0;
|
|
104
89
|
const hasSingle = !hasTasks && Boolean(effectiveParams.agent);
|
|
@@ -169,7 +154,6 @@ export function prepareExecutionContext(input: {
|
|
|
169
154
|
parentDepth: depth,
|
|
170
155
|
controlConfig,
|
|
171
156
|
intercomBridge,
|
|
172
|
-
nestedRoute,
|
|
173
157
|
};
|
|
174
158
|
|
|
175
159
|
const foregroundMode: "single" | "parallel" = hasTasks ? "parallel" : "single";
|
|
@@ -178,85 +162,11 @@ export function prepareExecutionContext(input: {
|
|
|
178
162
|
mode: foregroundMode,
|
|
179
163
|
startedAt: Date.now(),
|
|
180
164
|
updatedAt: Date.now(),
|
|
181
|
-
nestedRoute,
|
|
182
165
|
interrupt: undefined,
|
|
183
166
|
};
|
|
184
167
|
deps.state.foregroundControls.set(runId, foregroundControl);
|
|
185
168
|
deps.state.lastForegroundControlId = runId;
|
|
186
169
|
|
|
187
|
-
const writeNestedForegroundEvent = (
|
|
188
|
-
type: "subagent.nested.started" | "subagent.nested.completed",
|
|
189
|
-
result?: SubagentToolResult,
|
|
190
|
-
): void => {
|
|
191
|
-
if (!inheritedNestedRoute || !nestedParentAddress) return;
|
|
192
|
-
const now = Date.now();
|
|
193
|
-
const details = result?.details;
|
|
194
|
-
const state =
|
|
195
|
-
type === "subagent.nested.started"
|
|
196
|
-
? "running"
|
|
197
|
-
: result?.isError || details?.results.some((child) => child.status === "error")
|
|
198
|
-
? "failed"
|
|
199
|
-
: details?.results.some((child) => child.interrupted || child.status === "interrupted")
|
|
200
|
-
? "paused"
|
|
201
|
-
: "complete";
|
|
202
|
-
const errorText = result?.isError ? result.content.find((item) => item.type === "text")?.text : undefined;
|
|
203
|
-
const agentsForSummary =
|
|
204
|
-
hasTasks && effectiveParams.tasks
|
|
205
|
-
? effectiveParams.tasks.map((task) => task.agent)
|
|
206
|
-
: effectiveParams.agent
|
|
207
|
-
? [effectiveParams.agent]
|
|
208
|
-
: [];
|
|
209
|
-
const leafIntercomTarget =
|
|
210
|
-
intercomBridge.active && agentsForSummary[0]
|
|
211
|
-
? resolveSubagentIntercomTarget(runId, agentsForSummary[0], 0)
|
|
212
|
-
: undefined;
|
|
213
|
-
try {
|
|
214
|
-
writeNestedEvent(inheritedNestedRoute, {
|
|
215
|
-
type,
|
|
216
|
-
ts: now,
|
|
217
|
-
parentRunId: nestedParentAddress.parentRunId,
|
|
218
|
-
parentStepIndex: nestedParentAddress.parentStepIndex,
|
|
219
|
-
child: {
|
|
220
|
-
id: runId,
|
|
221
|
-
parentRunId: nestedParentAddress.parentRunId,
|
|
222
|
-
parentStepIndex: nestedParentAddress.parentStepIndex,
|
|
223
|
-
depth: nestedParentAddress.depth,
|
|
224
|
-
path: nestedParentAddress.path,
|
|
225
|
-
ownerIntercomTarget:
|
|
226
|
-
ctx.subagentPolicy?.intercom?.sessionName ?? ctx.subagentPolicy?.intercom?.orchestratorTarget,
|
|
227
|
-
leafIntercomTarget,
|
|
228
|
-
intercomTarget: leafIntercomTarget,
|
|
229
|
-
ownerState: state === "running" ? "live" : "gone",
|
|
230
|
-
mode: foregroundMode,
|
|
231
|
-
state,
|
|
232
|
-
agent: agentsForSummary[0],
|
|
233
|
-
agents: agentsForSummary,
|
|
234
|
-
startedAt: foregroundControl?.startedAt ?? now,
|
|
235
|
-
...(state !== "running" ? { endedAt: now } : {}),
|
|
236
|
-
lastUpdate: now,
|
|
237
|
-
...(errorText ? { error: errorText } : {}),
|
|
238
|
-
...(details?.results.length
|
|
239
|
-
? {
|
|
240
|
-
steps: details.results.map((child) => ({
|
|
241
|
-
agent: child.agent,
|
|
242
|
-
status:
|
|
243
|
-
child.interrupted || child.status === "interrupted"
|
|
244
|
-
? "paused"
|
|
245
|
-
: child.status === "ok"
|
|
246
|
-
? "complete"
|
|
247
|
-
: "failed",
|
|
248
|
-
...(child.sessionFile ? { sessionFile: child.sessionFile } : {}),
|
|
249
|
-
...(child.error ? { error: child.error } : {}),
|
|
250
|
-
})),
|
|
251
|
-
}
|
|
252
|
-
: {}),
|
|
253
|
-
},
|
|
254
|
-
});
|
|
255
|
-
} catch (error) {
|
|
256
|
-
console.error("Failed to emit nested foreground status event:", error);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
|
|
260
170
|
return {
|
|
261
171
|
prepared: {
|
|
262
172
|
effectiveParams,
|
|
@@ -267,7 +177,6 @@ export function prepareExecutionContext(input: {
|
|
|
267
177
|
foregroundMode,
|
|
268
178
|
execData,
|
|
269
179
|
foregroundControl,
|
|
270
|
-
writeNestedForegroundEvent,
|
|
271
180
|
},
|
|
272
181
|
};
|
|
273
182
|
}
|
|
@@ -38,7 +38,6 @@ interface ForegroundParallelRunInput {
|
|
|
38
38
|
artifactsDir: string;
|
|
39
39
|
maxOutput?: MaxOutputConfig;
|
|
40
40
|
paramsCwd: string;
|
|
41
|
-
maxSubagentDepths: number[];
|
|
42
41
|
parentDepth?: number;
|
|
43
42
|
workflowStageSubagentGuard?: boolean;
|
|
44
43
|
availableModels: ModelInfo[];
|
|
@@ -126,7 +125,6 @@ export async function runForegroundParallelTasks(input: ForegroundParallelRunInp
|
|
|
126
125
|
maxOutput: input.maxOutput,
|
|
127
126
|
outputPath,
|
|
128
127
|
outputMode: behavior?.outputMode,
|
|
129
|
-
maxSubagentDepth: input.maxSubagentDepths[index],
|
|
130
128
|
parentDepth: input.parentDepth,
|
|
131
129
|
workflowStageSubagentGuard: input.workflowStageSubagentGuard,
|
|
132
130
|
workflowSessionMetadata: workflowSessionMetadataFromContext(input.ctx),
|
|
@@ -142,7 +140,6 @@ export async function runForegroundParallelTasks(input: ForegroundParallelRunInp
|
|
|
142
140
|
onDetachedExit: (result) => input.onDetachedExit?.(index, result),
|
|
143
141
|
intercomDetachSignal: intercomDetachController.signal,
|
|
144
142
|
onIntercomDetachCommit: () => intercomDetachController.abort(),
|
|
145
|
-
nestedRoute: input.foregroundControl?.nestedRoute,
|
|
146
143
|
modelOverride: input.modelOverrides[index],
|
|
147
144
|
availableModels: input.availableModels,
|
|
148
145
|
knownModelProviders: input.knownModelProviders,
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
type AgentProgress,
|
|
14
14
|
type ArtifactPaths,
|
|
15
|
-
|
|
16
|
-
resolveSubagentDepthPolicy,
|
|
15
|
+
isWorkflowStageOrchestrationContext,
|
|
17
16
|
resolveTopLevelParallelConcurrency,
|
|
18
17
|
resolveTopLevelParallelMaxTasks,
|
|
19
18
|
type SingleResult,
|
|
@@ -21,7 +20,6 @@ import {
|
|
|
21
20
|
wrapForkTask,
|
|
22
21
|
} from "../../shared/types.js";
|
|
23
22
|
import { compactForegroundDetails, getSingleResultOutput } from "../../shared/utils.js";
|
|
24
|
-
import { updateForegroundNestedProjection } from "../inprocess/runtime-support/nested-api.js";
|
|
25
23
|
import { sharedAutoGroupForSet } from "../shared/intercom-group.js";
|
|
26
24
|
import { resolveModelCandidate } from "../shared/model-fallback.js";
|
|
27
25
|
import { aggregateParallelOutputs } from "../shared/parallel-utils.js";
|
|
@@ -97,12 +95,7 @@ export async function runParallelPath(
|
|
|
97
95
|
agentConfigs.push(config);
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
const
|
|
101
|
-
const currentMaxSubagentDepth = depthPolicy.maxSubagentDepth;
|
|
102
|
-
const workflowStageSubagentGuard = depthPolicy.workflowStageSubagentGuard;
|
|
103
|
-
const maxSubagentDepths = agentConfigs.map((config) =>
|
|
104
|
-
resolveChildMaxSubagentDepth(currentMaxSubagentDepth, config.maxSubagentDepth),
|
|
105
|
-
);
|
|
98
|
+
const workflowStageSubagentGuard = isWorkflowStageOrchestrationContext(ctx);
|
|
106
99
|
|
|
107
100
|
if (params.worktree) {
|
|
108
101
|
const worktreeTaskCwdError = buildParallelWorktreeTaskCwdError(tasks, effectiveCwd);
|
|
@@ -227,7 +220,6 @@ export async function runParallelPath(
|
|
|
227
220
|
sharedAutoIntercomGroup: sharedAutoGroupForSet(params.group, tasks),
|
|
228
221
|
foregroundControl,
|
|
229
222
|
concurrencyLimit: parallelConcurrency,
|
|
230
|
-
maxSubagentDepths,
|
|
231
223
|
parentDepth: data.parentDepth,
|
|
232
224
|
liveResults,
|
|
233
225
|
liveProgress,
|
|
@@ -258,7 +250,6 @@ export async function runParallelPath(
|
|
|
258
250
|
mode: "parallel",
|
|
259
251
|
cwd: effectiveCwd,
|
|
260
252
|
results: details.results,
|
|
261
|
-
maxSubagentDepths,
|
|
262
253
|
});
|
|
263
254
|
if (interrupted) {
|
|
264
255
|
return {
|
|
@@ -288,14 +279,12 @@ export async function runParallelPath(
|
|
|
288
279
|
};
|
|
289
280
|
}
|
|
290
281
|
|
|
291
|
-
if (foregroundControl) updateForegroundNestedProjection(foregroundControl);
|
|
292
282
|
const intercomReceipt = await maybeBuildForegroundIntercomReceipt({
|
|
293
283
|
pi: deps.pi,
|
|
294
284
|
intercomBridge: data.intercomBridge,
|
|
295
285
|
runId,
|
|
296
286
|
mode: "parallel",
|
|
297
287
|
details,
|
|
298
|
-
...(foregroundControl?.nestedChildren?.length ? { nestedChildren: foregroundControl.nestedChildren } : {}),
|
|
299
288
|
});
|
|
300
289
|
if (intercomReceipt) {
|
|
301
290
|
return {
|
|
@@ -12,15 +12,13 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
type AgentProgress,
|
|
14
14
|
type ArtifactPaths,
|
|
15
|
-
|
|
16
|
-
resolveSubagentDepthPolicy,
|
|
15
|
+
isWorkflowStageOrchestrationContext,
|
|
17
16
|
type SingleResult,
|
|
18
17
|
type SubagentToolResult,
|
|
19
18
|
workflowSessionMetadataFromContext,
|
|
20
19
|
wrapForkTask,
|
|
21
20
|
} from "../../shared/types.js";
|
|
22
21
|
import { compactForegroundDetails, getSingleResultOutput } from "../../shared/utils.js";
|
|
23
|
-
import { updateForegroundNestedProjection } from "../inprocess/runtime-support/nested-api.js";
|
|
24
22
|
import { inheritedIntercomGroup, resolveChildIntercomGroup } from "../shared/intercom-group.js";
|
|
25
23
|
import { currentModelFullId, resolveModelCandidate } from "../shared/model-fallback.js";
|
|
26
24
|
import { recordRun } from "../shared/run-history.js";
|
|
@@ -135,10 +133,7 @@ export async function runSinglePath(
|
|
|
135
133
|
const rawOutput = params.output !== undefined ? params.output : agentConfig.output;
|
|
136
134
|
const effectiveOutput = normalizeSingleOutputOverride(rawOutput, agentConfig.output);
|
|
137
135
|
const effectiveOutputMode = params.outputMode ?? "inline";
|
|
138
|
-
const
|
|
139
|
-
const currentMaxSubagentDepth = depthPolicy.maxSubagentDepth;
|
|
140
|
-
const workflowStageSubagentGuard = depthPolicy.workflowStageSubagentGuard;
|
|
141
|
-
const maxSubagentDepth = resolveChildMaxSubagentDepth(currentMaxSubagentDepth, agentConfig.maxSubagentDepth);
|
|
136
|
+
const workflowStageSubagentGuard = isWorkflowStageOrchestrationContext(ctx);
|
|
142
137
|
const progress = resolveSingleProgress(agentConfig, params.progress, task);
|
|
143
138
|
|
|
144
139
|
if (params.context === "fork") {
|
|
@@ -204,7 +199,6 @@ export async function runSinglePath(
|
|
|
204
199
|
maxOutput: params.maxOutput,
|
|
205
200
|
outputPath,
|
|
206
201
|
outputMode: effectiveOutputMode,
|
|
207
|
-
maxSubagentDepth,
|
|
208
202
|
parentDepth: data.parentDepth,
|
|
209
203
|
workflowStageSubagentGuard,
|
|
210
204
|
workflowSessionMetadata: workflowSessionMetadataFromContext(ctx),
|
|
@@ -214,7 +208,6 @@ export async function runSinglePath(
|
|
|
214
208
|
intercomSessionName: childIntercomTarget,
|
|
215
209
|
orchestratorIntercomTarget: data.intercomBridge.active ? data.intercomBridge.orchestratorTarget : undefined,
|
|
216
210
|
intercomGroup: resolveChildIntercomGroup(params.group, inheritedIntercomGroup(ctx), undefined),
|
|
217
|
-
nestedRoute: foregroundControl?.nestedRoute,
|
|
218
211
|
onDetachedExit: (result) => {
|
|
219
212
|
cleanupTransientProgress(progressDir, artifactConfig.enabled);
|
|
220
213
|
if (result) {
|
|
@@ -279,18 +272,15 @@ export async function runSinglePath(
|
|
|
279
272
|
mode: "single",
|
|
280
273
|
cwd: effectiveCwd,
|
|
281
274
|
results: details.results,
|
|
282
|
-
maxSubagentDepths: [maxSubagentDepth],
|
|
283
275
|
});
|
|
284
276
|
|
|
285
277
|
if (!r.detached && !r.interrupted) {
|
|
286
|
-
if (foregroundControl) updateForegroundNestedProjection(foregroundControl);
|
|
287
278
|
const intercomReceipt = await maybeBuildForegroundIntercomReceipt({
|
|
288
279
|
pi: deps.pi,
|
|
289
280
|
intercomBridge: data.intercomBridge,
|
|
290
281
|
runId,
|
|
291
282
|
mode: "single",
|
|
292
283
|
details,
|
|
293
|
-
...(foregroundControl?.nestedChildren?.length ? { nestedChildren: foregroundControl.nestedChildren } : {}),
|
|
294
284
|
});
|
|
295
285
|
if (intercomReceipt) {
|
|
296
286
|
return {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ExtensionAPI, isStaleExtensionContextError } from "@bastani/atomic";
|
|
2
2
|
import { type IntercomBridgeState, resolveSubagentIntercomTarget } from "../../intercom/intercom-bridge.js";
|
|
3
3
|
import {
|
|
4
|
-
attachNestedChildrenToResultChildren,
|
|
5
4
|
buildSubagentResultIntercomPayload,
|
|
6
5
|
deliverSubagentResultIntercomEvent,
|
|
7
6
|
formatSubagentResultReceipt,
|
|
@@ -11,7 +10,6 @@ import {
|
|
|
11
10
|
import {
|
|
12
11
|
type ControlEvent,
|
|
13
12
|
type Details,
|
|
14
|
-
type NestedRunSummary,
|
|
15
13
|
type SingleResult,
|
|
16
14
|
SUBAGENT_CONTROL_EVENT,
|
|
17
15
|
SUBAGENT_CONTROL_INTERCOM_EVENT,
|
|
@@ -20,8 +18,6 @@ import {
|
|
|
20
18
|
type SubagentToolResult,
|
|
21
19
|
} from "../../shared/types.js";
|
|
22
20
|
import { compactForegroundDetails, compactForegroundResult, getSingleResultOutput } from "../../shared/utils.js";
|
|
23
|
-
import { updateForegroundNestedProjection } from "../inprocess/runtime-support/nested-api.js";
|
|
24
|
-
import { formatNestedRunStatusLines } from "../inprocess/runtime-support/nested-rendering.js";
|
|
25
21
|
import {
|
|
26
22
|
formatControlIntercomMessage,
|
|
27
23
|
formatControlNoticeMessage,
|
|
@@ -68,12 +64,6 @@ function formatForegroundActivity(control: ForegroundControl): string | undefine
|
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
export function foregroundStatusResult(control: ForegroundControl): SubagentToolResult {
|
|
71
|
-
let nestedWarning: string | undefined;
|
|
72
|
-
try {
|
|
73
|
-
updateForegroundNestedProjection(control);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
nestedWarning = `Nested status unavailable: ${error instanceof Error ? error.message : String(error)}`;
|
|
76
|
-
}
|
|
77
67
|
const activity = formatForegroundActivity(control);
|
|
78
68
|
const lines = [
|
|
79
69
|
`Run: ${control.runId}`,
|
|
@@ -84,8 +74,6 @@ export function foregroundStatusResult(control: ForegroundControl): SubagentTool
|
|
|
84
74
|
: undefined,
|
|
85
75
|
activity ? `Activity: ${activity}` : undefined,
|
|
86
76
|
].filter((line): line is string => Boolean(line));
|
|
87
|
-
lines.push(...formatNestedRunStatusLines(control.nestedChildren, { indent: "", commandHints: true, maxLines: 20 }));
|
|
88
|
-
if (nestedWarning) lines.push(`Warning: ${nestedWarning}`);
|
|
89
77
|
return { content: [{ type: "text", text: lines.join("\n") }], details: { mode: "management", results: [] } };
|
|
90
78
|
}
|
|
91
79
|
|
|
@@ -132,8 +120,6 @@ export function rememberForegroundRun(
|
|
|
132
120
|
mode: "single" | "parallel";
|
|
133
121
|
cwd: string;
|
|
134
122
|
results: SingleResult[];
|
|
135
|
-
/** Effective delegation limit per child, aligned with `results` by index. */
|
|
136
|
-
maxSubagentDepths?: readonly (number | undefined)[];
|
|
137
123
|
},
|
|
138
124
|
): void {
|
|
139
125
|
state.foregroundRuns ??= new Map();
|
|
@@ -144,7 +130,6 @@ export function rememberForegroundRun(
|
|
|
144
130
|
updatedAt: Date.now(),
|
|
145
131
|
children: input.results.map((originalResult, index) => {
|
|
146
132
|
const result = takeEarlyDetachedResult(state, input.runId, index) ?? originalResult;
|
|
147
|
-
const maxSubagentDepth = input.maxSubagentDepths?.[index];
|
|
148
133
|
return {
|
|
149
134
|
agent: result.agent,
|
|
150
135
|
index,
|
|
@@ -154,7 +139,6 @@ export function rememberForegroundRun(
|
|
|
154
139
|
detached: result.detached,
|
|
155
140
|
}),
|
|
156
141
|
...(result.sessionFile ? { sessionFile: result.sessionFile } : {}),
|
|
157
|
-
...(maxSubagentDepth === undefined ? {} : { maxSubagentDepth }),
|
|
158
142
|
result,
|
|
159
143
|
};
|
|
160
144
|
}),
|
|
@@ -323,7 +307,6 @@ async function emitForegroundResultIntercom(input: {
|
|
|
323
307
|
runId: string;
|
|
324
308
|
mode: SubagentRunMode;
|
|
325
309
|
results: SingleResult[];
|
|
326
|
-
nestedChildren?: NestedRunSummary[];
|
|
327
310
|
}): Promise<ReturnType<typeof buildSubagentResultIntercomPayload> | null> {
|
|
328
311
|
if (!input.intercomBridge.active || !input.intercomBridge.orchestratorTarget) return null;
|
|
329
312
|
const children = input.results.flatMap((result, index) =>
|
|
@@ -350,7 +333,7 @@ async function emitForegroundResultIntercom(input: {
|
|
|
350
333
|
to: input.intercomBridge.orchestratorTarget,
|
|
351
334
|
runId: input.runId,
|
|
352
335
|
mode: input.mode,
|
|
353
|
-
children
|
|
336
|
+
children,
|
|
354
337
|
});
|
|
355
338
|
const delivered = await deliverSubagentResultIntercomEvent(input.pi.events, payload);
|
|
356
339
|
if (!delivered) return null;
|
|
@@ -363,7 +346,6 @@ export async function maybeBuildForegroundIntercomReceipt(input: {
|
|
|
363
346
|
runId: string;
|
|
364
347
|
mode: SubagentRunMode;
|
|
365
348
|
details: Details;
|
|
366
|
-
nestedChildren?: NestedRunSummary[];
|
|
367
349
|
}): Promise<{ text: string; details: Details } | null> {
|
|
368
350
|
const payload = await emitForegroundResultIntercom({
|
|
369
351
|
pi: input.pi,
|
|
@@ -371,7 +353,6 @@ export async function maybeBuildForegroundIntercomReceipt(input: {
|
|
|
371
353
|
runId: input.runId,
|
|
372
354
|
mode: input.mode,
|
|
373
355
|
results: input.details.results,
|
|
374
|
-
...(input.nestedChildren?.length ? { nestedChildren: input.nestedChildren } : {}),
|
|
375
356
|
});
|
|
376
357
|
if (!payload) return null;
|
|
377
358
|
return {
|
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
ArtifactConfig,
|
|
7
7
|
ControlConfig,
|
|
8
8
|
MaxOutputConfig,
|
|
9
|
-
NestedRouteInfo,
|
|
10
9
|
ResolvedControlConfig,
|
|
11
10
|
SUBAGENT_ACTIONS,
|
|
12
11
|
SubagentState,
|
|
@@ -105,7 +104,6 @@ export interface ExecutionContextData {
|
|
|
105
104
|
parentDepth?: number;
|
|
106
105
|
controlConfig: ResolvedControlConfig;
|
|
107
106
|
intercomBridge: IntercomBridgeState;
|
|
108
|
-
nestedRoute?: NestedRouteInfo;
|
|
109
107
|
}
|
|
110
108
|
|
|
111
109
|
export interface PreparedExecutionContext {
|
|
@@ -117,10 +115,6 @@ export interface PreparedExecutionContext {
|
|
|
117
115
|
foregroundMode: "single" | "parallel";
|
|
118
116
|
execData: ExecutionContextData;
|
|
119
117
|
foregroundControl?: SubagentState["foregroundControls"] extends Map<string, infer T> ? T : never;
|
|
120
|
-
writeNestedForegroundEvent: (
|
|
121
|
-
type: "subagent.nested.started" | "subagent.nested.completed",
|
|
122
|
-
result?: SubagentToolResult,
|
|
123
|
-
) => void;
|
|
124
118
|
}
|
|
125
119
|
|
|
126
120
|
export interface ExecutionContextBuildResult {
|