@bastani/atomic 0.9.13-alpha.2 → 0.9.13-alpha.4
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 +30 -0
- package/README.md +1 -1
- package/dist/builtin/i-have-adhd/package.json +1 -1
- package/dist/builtin/intercom/CHANGELOG.md +14 -0
- package/dist/builtin/intercom/README.md +12 -12
- package/dist/builtin/intercom/incoming-message-delivery.ts +1 -1
- package/dist/builtin/intercom/index.ts +1 -1
- package/dist/builtin/intercom/intercom-tool.ts +1 -1
- package/dist/builtin/intercom/intercom-utils.ts +3 -6
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/result-renderers.ts +1 -1
- package/dist/builtin/intercom/session-target.ts +1 -15
- package/dist/builtin/intercom/skills/intercom/SKILL.md +6 -6
- package/dist/builtin/intercom/terminal-ordering-barrier.ts +2 -2
- package/dist/builtin/intercom/ui/inline-message.ts +7 -5
- package/dist/builtin/intercom/ui/session-list.ts +23 -10
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +19 -0
- package/dist/builtin/subagents/README.md +29 -73
- package/dist/builtin/subagents/package.json +2 -2
- package/dist/builtin/subagents/prompts/parallel-cleanup.md +1 -1
- package/dist/builtin/subagents/prompts/parallel-review.md +1 -1
- package/dist/builtin/subagents/prompts/review-loop.md +2 -2
- package/dist/builtin/subagents/skills/subagent/SKILL.md +23 -59
- package/dist/builtin/subagents/skills/tmux/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/control-notices.ts +2 -3
- package/dist/builtin/subagents/src/extension/doctor.ts +2 -14
- package/dist/builtin/subagents/src/extension/fanout-child.ts +1 -17
- package/dist/builtin/subagents/src/extension/index.ts +9 -70
- package/dist/builtin/subagents/src/extension/notification-content.ts +1 -1
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +2 -2
- package/dist/builtin/subagents/src/extension/schemas.ts +2 -8
- package/dist/builtin/subagents/src/extension/tool-description.ts +2 -3
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +1 -1
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +5 -46
- package/dist/builtin/subagents/src/runs/{background → foreground}/completion-notification.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +25 -88
- package/dist/builtin/subagents/src/runs/{background → foreground}/notify.ts +5 -5
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +11 -28
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +3 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-runtime.ts +0 -5
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +30 -20
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +4 -4
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +0 -13
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +104 -48
- package/dist/builtin/subagents/src/runs/inprocess/index.ts +1 -1
- package/dist/builtin/subagents/src/runs/inprocess/runner.ts +5 -5
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-api.ts +0 -7
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-core.ts +0 -10
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-projection.ts +3 -108
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-sanitize.ts +0 -4
- package/dist/builtin/subagents/src/runs/shared/subagent-control.ts +1 -1
- package/dist/builtin/subagents/src/shared/formatters.ts +3 -5
- package/dist/builtin/subagents/src/shared/model-resolution.ts +78 -0
- package/dist/builtin/subagents/src/shared/status-format.ts +4 -11
- package/dist/builtin/subagents/src/shared/types-config.ts +10 -9
- package/dist/builtin/subagents/src/shared/types-nested.ts +127 -0
- package/dist/builtin/subagents/src/shared/types-results.ts +2 -8
- package/dist/builtin/subagents/src/shared/types-runtime.ts +0 -9
- package/dist/builtin/subagents/src/shared/types.ts +1 -1
- package/dist/builtin/subagents/src/shared/utils.ts +1 -109
- package/dist/builtin/subagents/src/slash/slash-commands.ts +7 -17
- package/dist/builtin/subagents/src/tui/render-event-formatting.ts +2 -252
- package/dist/builtin/subagents/src/tui/render-layout.ts +4 -4
- package/dist/builtin/subagents/src/tui/render-result.ts +0 -9
- package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -34
- package/dist/builtin/subagents/src/tui/render.ts +0 -2
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +23 -0
- package/dist/builtin/workflows/README.md +3 -3
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/durable/backend.ts +11 -0
- package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +63 -25
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +166 -25
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +42 -24
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +2 -1
- package/dist/builtin/workflows/src/durable/run-timing.ts +28 -7
- package/dist/builtin/workflows/src/durable/scoped-backend.ts +4 -0
- package/dist/builtin/workflows/src/durable/targeted-inspection.ts +110 -0
- package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +2 -2
- package/dist/builtin/workflows/src/engine/runtime.ts +19 -2
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +3 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +750 -168
- package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +6 -0
- package/dist/builtin/workflows/src/extension/ui-surface.ts +4 -0
- package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +6 -1
- package/dist/builtin/workflows/src/extension/workflow-targets.ts +18 -10
- package/dist/builtin/workflows/src/extension/workflow-tool-inspection.ts +31 -16
- package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +75 -3
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +53 -6
- package/dist/builtin/workflows/src/runs/background/run-inspect.ts +5 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +94 -60
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-context.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +7 -7
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +25 -4
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +2 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +142 -4
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +2 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-session-heartbeat.ts +88 -0
- package/dist/builtin/workflows/src/tui/keybindings-adapter.ts +1 -0
- package/dist/builtin/workflows/src/tui/overlay-adapter.ts +1 -0
- package/dist/builtin/workflows/src/tui/run-detail.ts +25 -12
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +27 -8
- package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +17 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +20 -3
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +10 -1
- package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +1 -0
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +22 -5
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +2 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +10 -4
- 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-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +68 -0
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +6 -0
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-summary.d.ts +21 -0
- package/dist/core/agent-session-summary.d.ts.map +1 -0
- package/dist/core/agent-session-summary.js +156 -0
- package/dist/core/agent-session-summary.js.map +1 -0
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +0 -4
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.d.ts.map +1 -1
- package/dist/core/agent-session-transfer.js +0 -2
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +6 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +22 -5
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/atomic-guide-command.js +2 -2
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/session-summarization.d.ts +41 -0
- package/dist/core/compaction/session-summarization.d.ts.map +1 -0
- package/dist/core/compaction/session-summarization.js +97 -0
- package/dist/core/compaction/session-summarization.js.map +1 -0
- package/dist/core/extensions/ui-types.d.ts +4 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/keybindings.d.ts +0 -5
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +0 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +3 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +9 -1
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +24 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +48 -0
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +10 -0
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +10 -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/settings-manager-basic-accessors.d.ts +3 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +5 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +4 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash.d.ts +0 -15
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -81
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/fetch-url.d.ts +12 -0
- package/dist/core/tools/fetch-url.d.ts.map +1 -1
- package/dist/core/tools/fetch-url.js +76 -10
- package/dist/core/tools/fetch-url.js.map +1 -1
- package/dist/core/tools/index.js +4 -4
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/session-temp-dir.d.ts +2 -2
- package/dist/core/tools/session-temp-dir.d.ts.map +1 -1
- package/dist/core/tools/session-temp-dir.js +6 -7
- package/dist/core/tools/session-temp-dir.js.map +1 -1
- package/dist/core/usage-totals.js +1 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.d.ts.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.js +1 -0
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js +29 -4
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/transcript-follow-indicator.d.ts +14 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.js +36 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +6 -0
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +3 -0
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +0 -3
- package/dist/modes/interactive/interactive-input-handling.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 +7 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -3
- 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-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +2 -5
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +6 -0
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-transcript-follow.d.ts +2 -0
- package/dist/modes/interactive/interactive-transcript-follow.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-transcript-follow.js +6 -0
- package/dist/modes/interactive/interactive-transcript-follow.js.map +1 -0
- package/dist/modes/interactive/interactive-tui.d.ts +13 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +59 -1
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +2 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +1 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +5 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +21 -9
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/docs/environment-variables.md +1 -1
- package/docs/intercom.md +20 -21
- package/docs/keybindings.md +2 -5
- package/docs/quickstart.md +5 -1
- package/docs/sdk.md +1 -1
- package/docs/session-format.md +15 -0
- package/docs/sessions.md +8 -0
- package/docs/settings.md +6 -0
- package/docs/subagents.md +19 -31
- package/docs/tools.md +3 -5
- package/docs/usage.md +3 -1
- package/docs/windows.md +1 -1
- package/docs/workflows.md +60 -32
- package/npm-shrinkwrap.json +29 -29
- package/package.json +2 -2
- package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +0 -331
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +0 -161
- package/dist/builtin/subagents/src/runs/inprocess/background-single.ts +0 -195
- package/dist/builtin/subagents/src/runs/inprocess/background.ts +0 -90
- package/dist/builtin/subagents/src/shared/types-async.ts +0 -247
- package/dist/builtin/subagents/src/tui/render-widget-graph.ts +0 -217
- package/dist/builtin/subagents/src/tui/render-widget.ts +0 -366
- package/dist/core/async/format.d.ts +0 -3
- package/dist/core/async/format.d.ts.map +0 -1
- package/dist/core/async/format.js +0 -52
- package/dist/core/async/format.js.map +0 -1
- package/dist/core/async/job-manager.d.ts +0 -40
- package/dist/core/async/job-manager.d.ts.map +0 -1
- package/dist/core/async/job-manager.js +0 -293
- package/dist/core/async/job-manager.js.map +0 -1
- package/dist/core/async/session-manager.d.ts +0 -16
- package/dist/core/async/session-manager.d.ts.map +0 -1
- package/dist/core/async/session-manager.js +0 -34
- package/dist/core/async/session-manager.js.map +0 -1
- package/dist/core/async/types.d.ts +0 -23
- package/dist/core/async/types.d.ts.map +0 -1
- package/dist/core/async/types.js +0 -2
- package/dist/core/async/types.js.map +0 -1
- package/dist/core/tools/bash-async-execution.d.ts +0 -27
- package/dist/core/tools/bash-async-execution.d.ts.map +0 -1
- package/dist/core/tools/bash-async-execution.js +0 -81
- package/dist/core/tools/bash-async-execution.js.map +0 -1
- package/dist/core/tools/bash-async-jobs.d.ts +0 -30
- package/dist/core/tools/bash-async-jobs.d.ts.map +0 -1
- package/dist/core/tools/bash-async-jobs.js +0 -87
- package/dist/core/tools/bash-async-jobs.js.map +0 -1
- package/dist/core/tools/bash-async-output.d.ts +0 -13
- package/dist/core/tools/bash-async-output.d.ts.map +0 -1
- package/dist/core/tools/bash-async-output.js +0 -122
- package/dist/core/tools/bash-async-output.js.map +0 -1
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { isStaleExtensionContextError } from "@bastani/atomic";
|
|
4
|
-
import { buildSkillInjection, resolveSkillsWithFallback } from "../../agents/skills.ts";
|
|
5
|
-
import { injectSingleProgressInstruction, writeInitialProgressFile } from "../../shared/settings.ts";
|
|
6
|
-
import {
|
|
7
|
-
ASYNC_DIR,
|
|
8
|
-
resolveChildMaxSubagentDepth,
|
|
9
|
-
SUBAGENT_ASYNC_COMPLETE_EVENT,
|
|
10
|
-
SUBAGENT_ASYNC_STARTED_EVENT,
|
|
11
|
-
} from "../../shared/types.ts";
|
|
12
|
-
import { resolveChildCwd } from "../../shared/utils.ts";
|
|
13
|
-
import { runSingleInProcess } from "../foreground/inprocess-run-sync.ts";
|
|
14
|
-
import { resolveChildIntercomGroup } from "../shared/intercom-group.js";
|
|
15
|
-
import { filterSpawnableModelCandidates } from "../shared/model-candidate-filter.ts";
|
|
16
|
-
import { buildModelCandidates } from "../shared/model-fallback.ts";
|
|
17
|
-
import {
|
|
18
|
-
injectSingleOutputInstruction,
|
|
19
|
-
normalizeSingleOutputOverride,
|
|
20
|
-
resolveSingleOutputPath,
|
|
21
|
-
validateFileOnlyOutputMode,
|
|
22
|
-
} from "../shared/single-output.ts";
|
|
23
|
-
import {
|
|
24
|
-
type AsyncExecutionResult,
|
|
25
|
-
type AsyncSingleParams,
|
|
26
|
-
formatAsyncStartError,
|
|
27
|
-
formatAsyncStartedMessage,
|
|
28
|
-
UNAVAILABLE_SUBAGENT_SKILL_ERROR,
|
|
29
|
-
} from "./background.ts";
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Execute a single agent asynchronously using the in-process runner.
|
|
33
|
-
*
|
|
34
|
-
* The returned promise resolves after admission and continuation, not after the
|
|
35
|
-
* model attempt. Terminal delivery happens through the existing detached-exit
|
|
36
|
-
* callback and in-memory result path.
|
|
37
|
-
*/
|
|
38
|
-
export async function executeAsyncSingle(id: string, params: AsyncSingleParams): Promise<AsyncExecutionResult> {
|
|
39
|
-
const {
|
|
40
|
-
agent,
|
|
41
|
-
agentConfig,
|
|
42
|
-
ctx,
|
|
43
|
-
cwd,
|
|
44
|
-
maxOutput,
|
|
45
|
-
artifactsDir,
|
|
46
|
-
artifactConfig,
|
|
47
|
-
sessionRoot,
|
|
48
|
-
sessionFile,
|
|
49
|
-
maxSubagentDepth,
|
|
50
|
-
parentDepth,
|
|
51
|
-
workflowStageSubagentGuard,
|
|
52
|
-
controlConfig,
|
|
53
|
-
controlIntercomTarget,
|
|
54
|
-
childIntercomTarget,
|
|
55
|
-
} = params;
|
|
56
|
-
const task = params.task ?? "";
|
|
57
|
-
const runnerCwd = resolveChildCwd(ctx.cwd, cwd);
|
|
58
|
-
const skillNames = params.skills ?? agentConfig.skills ?? [];
|
|
59
|
-
const { resolved: resolvedSkills, missing: missingSkills } = resolveSkillsWithFallback(
|
|
60
|
-
skillNames,
|
|
61
|
-
runnerCwd,
|
|
62
|
-
ctx.cwd,
|
|
63
|
-
);
|
|
64
|
-
if (missingSkills.includes("subagent")) return formatAsyncStartError("single", UNAVAILABLE_SUBAGENT_SKILL_ERROR);
|
|
65
|
-
|
|
66
|
-
let systemPrompt = agentConfig.systemPrompt?.trim() ?? "";
|
|
67
|
-
if (resolvedSkills.length > 0) {
|
|
68
|
-
const injection = buildSkillInjection(resolvedSkills);
|
|
69
|
-
systemPrompt = systemPrompt ? `${systemPrompt}\n\n${injection}` : injection;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const asyncDir = path.join(ASYNC_DIR, id);
|
|
73
|
-
try {
|
|
74
|
-
fs.mkdirSync(asyncDir, { recursive: true });
|
|
75
|
-
} catch (error) {
|
|
76
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
77
|
-
return formatAsyncStartError("single", `Failed to create async run directory '${asyncDir}': ${message}`);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const effectiveOutput = normalizeSingleOutputOverride(params.output, agentConfig.output);
|
|
81
|
-
const outputPath = resolveSingleOutputPath(effectiveOutput, ctx.cwd, runnerCwd);
|
|
82
|
-
const outputMode = params.outputMode ?? "inline";
|
|
83
|
-
const validationError = validateFileOnlyOutputMode(outputMode, outputPath, `Async single run (${agent})`);
|
|
84
|
-
if (validationError) return formatAsyncStartError("single", validationError);
|
|
85
|
-
let taskWithOutputInstruction = injectSingleOutputInstruction(task, outputPath);
|
|
86
|
-
if (params.progress) {
|
|
87
|
-
const progressDir =
|
|
88
|
-
artifactConfig.enabled && artifactsDir
|
|
89
|
-
? path.join(artifactsDir, "progress", id)
|
|
90
|
-
: path.join(asyncDir, "progress");
|
|
91
|
-
writeInitialProgressFile(progressDir);
|
|
92
|
-
taskWithOutputInstruction = injectSingleProgressInstruction(taskWithOutputInstruction, progressDir);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const availableModels = params.availableModels;
|
|
96
|
-
const knownModelProviders = params.knownModelProviders;
|
|
97
|
-
const rawModelCandidates = buildModelCandidates(
|
|
98
|
-
params.modelOverride ?? agentConfig.model,
|
|
99
|
-
agentConfig.fallbackModels,
|
|
100
|
-
availableModels,
|
|
101
|
-
ctx.currentModelProvider,
|
|
102
|
-
ctx.currentModel,
|
|
103
|
-
agentConfig.fallbackThinkingLevels,
|
|
104
|
-
);
|
|
105
|
-
const filteredCandidates = filterSpawnableModelCandidates({
|
|
106
|
-
candidates: rawModelCandidates,
|
|
107
|
-
availableModels,
|
|
108
|
-
knownModelProviders,
|
|
109
|
-
currentModel: ctx.currentModel,
|
|
110
|
-
});
|
|
111
|
-
if (rawModelCandidates.length > 0 && filteredCandidates.candidates.length === 0) {
|
|
112
|
-
return formatAsyncStartError("single", "No spawnable subagent model candidates after pre-spawn filtering.");
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const childAgent = { ...agentConfig, systemPrompt };
|
|
116
|
-
const result = await runSingleInProcess(runnerCwd, childAgent, taskWithOutputInstruction, {
|
|
117
|
-
cwd: runnerCwd,
|
|
118
|
-
runId: id,
|
|
119
|
-
sessionDir: path.join(sessionRoot ?? asyncDir, "session"),
|
|
120
|
-
sessionFile,
|
|
121
|
-
artifactsDir: artifactConfig.enabled ? artifactsDir : undefined,
|
|
122
|
-
artifactConfig,
|
|
123
|
-
maxOutput,
|
|
124
|
-
outputPath,
|
|
125
|
-
outputMode,
|
|
126
|
-
backgroundContinuation: true,
|
|
127
|
-
maxSubagentDepth: resolveChildMaxSubagentDepth(maxSubagentDepth, agentConfig.maxSubagentDepth),
|
|
128
|
-
parentDepth,
|
|
129
|
-
workflowStageSubagentGuard,
|
|
130
|
-
workflowSessionMetadata: ctx.workflowSessionMetadata,
|
|
131
|
-
controlConfig,
|
|
132
|
-
supervisorAuthorization: params.supervisorAuthorization,
|
|
133
|
-
intercomSessionName: childIntercomTarget?.(agent, 0),
|
|
134
|
-
orchestratorIntercomTarget: controlIntercomTarget,
|
|
135
|
-
intercomGroup: resolveChildIntercomGroup(params.group, ctx.intercomGroup, undefined),
|
|
136
|
-
modelOverride: filteredCandidates.candidates[0] ?? params.modelOverride ?? agentConfig.model,
|
|
137
|
-
availableModels,
|
|
138
|
-
knownModelProviders,
|
|
139
|
-
preferredModelProvider: ctx.currentModelProvider,
|
|
140
|
-
currentModel: ctx.currentModel,
|
|
141
|
-
skills: resolvedSkills.map((skill) => skill.name),
|
|
142
|
-
testSession: params.testSession,
|
|
143
|
-
onDetachedExit: (completed) => {
|
|
144
|
-
const envelope = completed.envelope?.trim() ? completed.envelope : "(no output)";
|
|
145
|
-
try {
|
|
146
|
-
ctx.pi.events.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, {
|
|
147
|
-
id,
|
|
148
|
-
runId: id,
|
|
149
|
-
asyncDir,
|
|
150
|
-
agent,
|
|
151
|
-
status: completed.status,
|
|
152
|
-
summary: envelope,
|
|
153
|
-
envelope,
|
|
154
|
-
timestamp: Date.now(),
|
|
155
|
-
sessionFile: completed.sessionFile,
|
|
156
|
-
results: [
|
|
157
|
-
{
|
|
158
|
-
agent,
|
|
159
|
-
output: envelope,
|
|
160
|
-
status: completed.status,
|
|
161
|
-
index: 0,
|
|
162
|
-
intercomTarget: childIntercomTarget?.(agent, 0),
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
result: completed,
|
|
166
|
-
});
|
|
167
|
-
} catch (error) {
|
|
168
|
-
if (!isStaleExtensionContextError(error)) throw error;
|
|
169
|
-
// A detached child may finish after its parent extension runtime reloads.
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
try {
|
|
175
|
-
ctx.pi.events.emit(SUBAGENT_ASYNC_STARTED_EVENT, {
|
|
176
|
-
id,
|
|
177
|
-
asyncDir,
|
|
178
|
-
sessionId: result.path,
|
|
179
|
-
mode: "single",
|
|
180
|
-
agent,
|
|
181
|
-
agents: [agent],
|
|
182
|
-
...(result.model !== undefined ? { model: result.model } : {}),
|
|
183
|
-
...(result.thinking !== undefined ? { thinking: result.thinking } : {}),
|
|
184
|
-
...(result.fastMode ? { fastMode: true } : {}),
|
|
185
|
-
});
|
|
186
|
-
} catch (error) {
|
|
187
|
-
if (!isStaleExtensionContextError(error)) throw error;
|
|
188
|
-
// The launch result remains useful when the captured runtime is stale.
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
content: [{ type: "text", text: formatAsyncStartedMessage(`Async: ${agent} [${id}]`) }],
|
|
192
|
-
details: { mode: "single", runId: id, results: [result], asyncId: id, asyncDir },
|
|
193
|
-
...(result.status === "error" ? { isError: true } : {}),
|
|
194
|
-
};
|
|
195
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI, SessionWorkflowMetadata } from "@bastani/atomic";
|
|
2
|
-
import type { AgentConfig } from "../../agents/agents.ts";
|
|
3
|
-
import type { SupervisorAuthorization } from "../../intercom/supervisor-authorization.ts";
|
|
4
|
-
import type { ModelInfo } from "../../shared/model-info.ts";
|
|
5
|
-
import type { RunSyncOptions } from "../../shared/types.ts";
|
|
6
|
-
|
|
7
|
-
export interface AsyncExecutionContext {
|
|
8
|
-
pi: ExtensionAPI;
|
|
9
|
-
cwd: string;
|
|
10
|
-
currentSessionId: string;
|
|
11
|
-
currentModelProvider?: string;
|
|
12
|
-
currentModel?: string;
|
|
13
|
-
intercomGroup?: string;
|
|
14
|
-
workflowSessionMetadata?: SessionWorkflowMetadata;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface AsyncSingleParams {
|
|
18
|
-
agent: string;
|
|
19
|
-
task?: string;
|
|
20
|
-
group?: string | true;
|
|
21
|
-
agentConfig: AgentConfig;
|
|
22
|
-
ctx: AsyncExecutionContext;
|
|
23
|
-
cwd?: string;
|
|
24
|
-
maxOutput?: { bytes?: number; lines?: number };
|
|
25
|
-
artifactsDir?: string;
|
|
26
|
-
artifactConfig: {
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
includeInput: boolean;
|
|
29
|
-
includeOutput: boolean;
|
|
30
|
-
includeJsonl: boolean;
|
|
31
|
-
includeMetadata: boolean;
|
|
32
|
-
cleanupDays: number;
|
|
33
|
-
};
|
|
34
|
-
shareEnabled: boolean;
|
|
35
|
-
sessionRoot?: string;
|
|
36
|
-
sessionFile?: string;
|
|
37
|
-
skills?: string[];
|
|
38
|
-
output?: string | boolean;
|
|
39
|
-
outputMode?: "inline" | "file-only";
|
|
40
|
-
progress?: boolean;
|
|
41
|
-
modelOverride?: string;
|
|
42
|
-
availableModels?: ModelInfo[];
|
|
43
|
-
knownModelProviders?: string[];
|
|
44
|
-
maxSubagentDepth: number;
|
|
45
|
-
parentDepth?: number;
|
|
46
|
-
workflowStageSubagentGuard?: boolean;
|
|
47
|
-
worktreeSetupHook?: string;
|
|
48
|
-
worktreeSetupHookTimeoutMs?: number;
|
|
49
|
-
controlConfig?: import("../../shared/types.ts").ResolvedControlConfig;
|
|
50
|
-
controlIntercomTarget?: string;
|
|
51
|
-
childIntercomTarget?: (agent: string, index: number) => string | undefined;
|
|
52
|
-
supervisorAuthorization?: SupervisorAuthorization;
|
|
53
|
-
nestedRoute?: import("../../shared/types.ts").NestedRouteInfo;
|
|
54
|
-
/** Internal seam used by focused runtime tests. */
|
|
55
|
-
testSession?: RunSyncOptions["testSession"];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface AsyncExecutionResult {
|
|
59
|
-
content: Array<{ type: "text"; text: string }>;
|
|
60
|
-
details: import("../../shared/types.ts").Details;
|
|
61
|
-
isError?: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function formatAsyncStartedMessage(headline: string): string {
|
|
65
|
-
return [
|
|
66
|
-
`Launched: ${headline}`,
|
|
67
|
-
"Completion pending; Atomic will deliver the result when the in-process child finishes.",
|
|
68
|
-
"",
|
|
69
|
-
"The async child is tied to the current parent process and does not survive parent exit.",
|
|
70
|
-
'Use subagent({ action: "status", id: "..." }) when you need the current status/result.',
|
|
71
|
-
].join("\n");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** Async execution is always available because it no longer depends on a jiti child process. */
|
|
75
|
-
export function isAsyncAvailable(): boolean {
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function formatAsyncStartError(mode: "single" | "parallel", message: string): AsyncExecutionResult {
|
|
80
|
-
return {
|
|
81
|
-
content: [{ type: "text", text: message }],
|
|
82
|
-
isError: true,
|
|
83
|
-
details: { mode, results: [] },
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const UNAVAILABLE_SUBAGENT_SKILL_ERROR = "Skills not found: subagent";
|
|
88
|
-
|
|
89
|
-
export class UnavailableSubagentSkillError extends Error {}
|
|
90
|
-
export class AsyncStartValidationError extends Error {}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Async job, nested run, and extension state public types.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { FSWatcher } from "node:fs";
|
|
6
|
-
import type { ExtensionContext } from "@bastani/atomic";
|
|
7
|
-
import type {
|
|
8
|
-
ActivityState,
|
|
9
|
-
ModelAttempt,
|
|
10
|
-
SingleResult,
|
|
11
|
-
SubagentResultStatus,
|
|
12
|
-
SubagentRunMode,
|
|
13
|
-
TokenUsage,
|
|
14
|
-
} from "./types-results.ts";
|
|
15
|
-
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Async Execution
|
|
18
|
-
// ============================================================================
|
|
19
|
-
|
|
20
|
-
export type NestedRunState = "queued" | "running" | "complete" | "failed" | "paused";
|
|
21
|
-
export type NestedOwnerState = "live" | "gone" | "unknown";
|
|
22
|
-
|
|
23
|
-
export interface NestedRunAddress {
|
|
24
|
-
id: string;
|
|
25
|
-
parentRunId: string;
|
|
26
|
-
parentStepIndex?: number;
|
|
27
|
-
parentAgent?: string;
|
|
28
|
-
depth: number;
|
|
29
|
-
path: Array<{ runId: string; stepIndex?: number; agent?: string }>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface NestedStepSummary {
|
|
33
|
-
agent: string;
|
|
34
|
-
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused";
|
|
35
|
-
sessionFile?: string;
|
|
36
|
-
activityState?: ActivityState;
|
|
37
|
-
lastActivityAt?: number;
|
|
38
|
-
currentTool?: string;
|
|
39
|
-
currentToolStartedAt?: number;
|
|
40
|
-
currentPath?: string;
|
|
41
|
-
turnCount?: number;
|
|
42
|
-
toolCount?: number;
|
|
43
|
-
startedAt?: number;
|
|
44
|
-
endedAt?: number;
|
|
45
|
-
error?: string;
|
|
46
|
-
children?: NestedRunSummary[];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface NestedRunSummary extends NestedRunAddress {
|
|
50
|
-
asyncDir?: string;
|
|
51
|
-
pid?: number;
|
|
52
|
-
sessionId?: string;
|
|
53
|
-
sessionFile?: string;
|
|
54
|
-
intercomTarget?: string;
|
|
55
|
-
ownerIntercomTarget?: string;
|
|
56
|
-
leafIntercomTarget?: string;
|
|
57
|
-
ownerState?: NestedOwnerState;
|
|
58
|
-
controlInbox?: string;
|
|
59
|
-
capabilityToken?: string;
|
|
60
|
-
mode?: SubagentRunMode;
|
|
61
|
-
state: NestedRunState;
|
|
62
|
-
agent?: string;
|
|
63
|
-
agents?: string[];
|
|
64
|
-
steps?: NestedStepSummary[];
|
|
65
|
-
children?: NestedRunSummary[];
|
|
66
|
-
activityState?: ActivityState;
|
|
67
|
-
lastActivityAt?: number;
|
|
68
|
-
currentTool?: string;
|
|
69
|
-
currentToolStartedAt?: number;
|
|
70
|
-
currentPath?: string;
|
|
71
|
-
turnCount?: number;
|
|
72
|
-
toolCount?: number;
|
|
73
|
-
totalTokens?: TokenUsage;
|
|
74
|
-
startedAt?: number;
|
|
75
|
-
endedAt?: number;
|
|
76
|
-
lastUpdate?: number;
|
|
77
|
-
error?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface NestedRouteInfo {
|
|
81
|
-
rootRunId: string;
|
|
82
|
-
eventSink: string;
|
|
83
|
-
controlInbox: string;
|
|
84
|
-
capabilityToken: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface AsyncStartedEvent {
|
|
88
|
-
id?: string;
|
|
89
|
-
asyncDir?: string;
|
|
90
|
-
pid?: number;
|
|
91
|
-
sessionId?: string;
|
|
92
|
-
mode?: SubagentRunMode;
|
|
93
|
-
agent?: string;
|
|
94
|
-
agents?: string[];
|
|
95
|
-
model?: string;
|
|
96
|
-
thinking?: string;
|
|
97
|
-
fastMode?: boolean;
|
|
98
|
-
nestedRoute?: NestedRouteInfo;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface AsyncStatus {
|
|
102
|
-
runId: string;
|
|
103
|
-
sessionId?: string;
|
|
104
|
-
mode: SubagentRunMode;
|
|
105
|
-
state: "queued" | "running" | "complete" | "failed" | "paused";
|
|
106
|
-
activityState?: ActivityState;
|
|
107
|
-
lastActivityAt?: number;
|
|
108
|
-
currentTool?: string;
|
|
109
|
-
currentToolStartedAt?: number;
|
|
110
|
-
currentPath?: string;
|
|
111
|
-
turnCount?: number;
|
|
112
|
-
toolCount?: number;
|
|
113
|
-
startedAt: number;
|
|
114
|
-
endedAt?: number;
|
|
115
|
-
lastUpdate?: number;
|
|
116
|
-
pid?: number;
|
|
117
|
-
cwd?: string;
|
|
118
|
-
steps?: Array<{
|
|
119
|
-
agent: string;
|
|
120
|
-
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused";
|
|
121
|
-
children?: NestedRunSummary[];
|
|
122
|
-
sessionFile?: string;
|
|
123
|
-
activityState?: ActivityState;
|
|
124
|
-
lastActivityAt?: number;
|
|
125
|
-
currentTool?: string;
|
|
126
|
-
currentToolArgs?: string;
|
|
127
|
-
currentToolStartedAt?: number;
|
|
128
|
-
currentPath?: string;
|
|
129
|
-
recentTools?: Array<{ tool: string; args: string; endMs: number }>;
|
|
130
|
-
recentOutput?: string[];
|
|
131
|
-
turnCount?: number;
|
|
132
|
-
toolCount?: number;
|
|
133
|
-
startedAt?: number;
|
|
134
|
-
endedAt?: number;
|
|
135
|
-
durationMs?: number;
|
|
136
|
-
tokens?: TokenUsage;
|
|
137
|
-
skills?: string[];
|
|
138
|
-
model?: string;
|
|
139
|
-
thinking?: string;
|
|
140
|
-
fastMode?: boolean;
|
|
141
|
-
attemptedModels?: string[];
|
|
142
|
-
modelAttempts?: ModelAttempt[];
|
|
143
|
-
error?: string;
|
|
144
|
-
}>;
|
|
145
|
-
sessionDir?: string;
|
|
146
|
-
outputFile?: string;
|
|
147
|
-
totalTokens?: TokenUsage;
|
|
148
|
-
sessionFile?: string;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export type AsyncJobStep = NonNullable<AsyncStatus["steps"]>[number] & {
|
|
152
|
-
index?: number;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export interface AsyncJobState {
|
|
156
|
-
asyncId: string;
|
|
157
|
-
asyncDir: string;
|
|
158
|
-
status: "queued" | "running" | "complete" | "failed" | "paused";
|
|
159
|
-
pid?: number;
|
|
160
|
-
sessionId?: string;
|
|
161
|
-
activityState?: ActivityState;
|
|
162
|
-
lastActivityAt?: number;
|
|
163
|
-
currentTool?: string;
|
|
164
|
-
currentToolStartedAt?: number;
|
|
165
|
-
currentPath?: string;
|
|
166
|
-
turnCount?: number;
|
|
167
|
-
toolCount?: number;
|
|
168
|
-
mode?: SubagentRunMode;
|
|
169
|
-
agents?: string[];
|
|
170
|
-
steps?: AsyncJobStep[];
|
|
171
|
-
stepsTotal?: number;
|
|
172
|
-
runningSteps?: number;
|
|
173
|
-
completedSteps?: number;
|
|
174
|
-
activeParallelGroup?: boolean;
|
|
175
|
-
startedAt?: number;
|
|
176
|
-
updatedAt?: number;
|
|
177
|
-
sessionDir?: string;
|
|
178
|
-
outputFile?: string;
|
|
179
|
-
totalTokens?: TokenUsage;
|
|
180
|
-
sessionFile?: string;
|
|
181
|
-
controlEventCursor?: number;
|
|
182
|
-
nestedRoute?: NestedRouteInfo;
|
|
183
|
-
nestedChildren?: NestedRunSummary[];
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface ForegroundResumeChild {
|
|
187
|
-
agent: string;
|
|
188
|
-
index: number;
|
|
189
|
-
sessionFile?: string;
|
|
190
|
-
status: SubagentResultStatus;
|
|
191
|
-
result?: SingleResult;
|
|
192
|
-
/**
|
|
193
|
-
* Effective delegation limit this child ran under. Retained per child because
|
|
194
|
-
* edit to the agent definition must not widen a resumed child's budget.
|
|
195
|
-
*/
|
|
196
|
-
maxSubagentDepth?: number;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface ForegroundResumeRun {
|
|
200
|
-
runId: string;
|
|
201
|
-
mode: SubagentRunMode;
|
|
202
|
-
cwd: string;
|
|
203
|
-
updatedAt: number;
|
|
204
|
-
children: ForegroundResumeChild[];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export interface SubagentState {
|
|
208
|
-
baseCwd: string;
|
|
209
|
-
currentSessionId: string | null;
|
|
210
|
-
asyncJobs: Map<string, AsyncJobState>;
|
|
211
|
-
subagentInProgress?: boolean;
|
|
212
|
-
foregroundRuns?: Map<string, ForegroundResumeRun>;
|
|
213
|
-
foregroundControls: Map<
|
|
214
|
-
string,
|
|
215
|
-
{
|
|
216
|
-
runId: string;
|
|
217
|
-
mode: SubagentRunMode;
|
|
218
|
-
startedAt: number;
|
|
219
|
-
updatedAt: number;
|
|
220
|
-
currentAgent?: string;
|
|
221
|
-
currentIndex?: number;
|
|
222
|
-
currentActivityState?: ActivityState;
|
|
223
|
-
lastActivityAt?: number;
|
|
224
|
-
currentTool?: string;
|
|
225
|
-
currentToolStartedAt?: number;
|
|
226
|
-
currentPath?: string;
|
|
227
|
-
turnCount?: number;
|
|
228
|
-
tokens?: number;
|
|
229
|
-
toolCount?: number;
|
|
230
|
-
nestedRoute?: NestedRouteInfo;
|
|
231
|
-
nestedChildren?: NestedRunSummary[];
|
|
232
|
-
interrupt?: () => boolean;
|
|
233
|
-
}
|
|
234
|
-
>;
|
|
235
|
-
lastForegroundControlId: string | null;
|
|
236
|
-
pendingForegroundControlNotices?: Map<string, ReturnType<typeof setTimeout>>;
|
|
237
|
-
cleanupTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
238
|
-
lastUiContext: ExtensionContext | null;
|
|
239
|
-
poller: NodeJS.Timeout | null;
|
|
240
|
-
completionSeen: Map<string, number | { seenAt: number; signature?: string }>;
|
|
241
|
-
watcher: FSWatcher | null;
|
|
242
|
-
watcherRestartTimer: ReturnType<typeof setTimeout> | null;
|
|
243
|
-
resultFileCoalescer: {
|
|
244
|
-
schedule(file: string, delayMs?: number): boolean;
|
|
245
|
-
clear(): void;
|
|
246
|
-
};
|
|
247
|
-
}
|