@selesai/code 0.5.19 → 0.5.21
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/dist/extensions/handoff-new.test.ts +8 -9
- package/dist/extensions/handoff-new.ts +6 -8
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +31 -0
- package/dist/extensions/pi-intercom/broker/spawn.ts +5 -3
- package/dist/extensions/pi-subagents/CHANGELOG.md +1367 -0
- package/dist/extensions/pi-subagents/README.md +602 -220
- package/dist/extensions/pi-subagents/banner.png +0 -0
- package/dist/extensions/pi-subagents/index.ts +1 -0
- package/dist/extensions/pi-subagents/install.mjs +3 -3
- package/dist/extensions/pi-subagents/package-lock.json +3405 -0
- package/dist/extensions/pi-subagents/package.json +26 -14
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +9 -9
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +3 -3
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +7 -7
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +6 -6
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +8 -8
- package/dist/extensions/pi-subagents/prompts/review-loop.md +13 -11
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +267 -176
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +89 -16
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +19 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +218 -120
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +67 -13
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +2 -2
- package/dist/extensions/pi-subagents/src/agents/skills.ts +25 -12
- package/dist/extensions/pi-subagents/src/api/background-work.ts +197 -0
- package/dist/extensions/pi-subagents/src/api/capability-ceiling.ts +17 -0
- package/dist/extensions/pi-subagents/src/api/delegation.ts +285 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +399 -0
- package/dist/extensions/pi-subagents/src/extension/chain-validation.ts +165 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +7 -1
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +15 -0
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +3 -1
- package/dist/extensions/pi-subagents/src/extension/index.ts +113 -157
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +41 -4
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +45 -15
- package/dist/extensions/pi-subagents/src/extension/steering-notices.ts +35 -0
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +28 -15
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +4 -3
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +225 -29
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +11 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +8 -10
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +452 -62
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +60 -9
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +198 -52
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +119 -21
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +67 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +16 -8
- package/dist/extensions/pi-subagents/src/runs/background/completion-batcher.ts +6 -4
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +2 -11
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +260 -13
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +32 -6
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +171 -90
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +280 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +149 -88
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +14 -2
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +33 -17
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +9 -1
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +38 -10
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +237 -0
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +1297 -307
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +610 -0
- package/dist/extensions/pi-subagents/src/runs/background/top-level-async.ts +2 -1
- package/dist/extensions/pi-subagents/src/runs/background/wait-config.ts +36 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +26 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +230 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +22 -6
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +228 -140
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +452 -138
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +90 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1001 -416
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +443 -132
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +38 -0
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +178 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +121 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +41 -93
- package/dist/extensions/pi-subagents/src/runs/shared/context-mode.ts +44 -0
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +11 -9
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +4 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +12 -6
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +36 -0
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +44 -7
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +4 -1
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +154 -0
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +18 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +174 -54
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +38 -31
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +90 -5
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +299 -0
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +61 -6
- package/dist/extensions/pi-subagents/src/runs/shared/spawn-budget.ts +128 -0
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +112 -7
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +14 -6
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +149 -36
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +181 -0
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +83 -0
- package/dist/extensions/pi-subagents/src/runs/shared/tool-budget.ts +11 -5
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +50 -4
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +63 -14
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +25 -0
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +37 -7
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +18 -43
- package/dist/extensions/pi-subagents/src/shared/child-transcript.ts +52 -0
- package/dist/extensions/pi-subagents/src/shared/env.ts +16 -0
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +47 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +28 -3
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +123 -0
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +8 -5
- package/dist/extensions/pi-subagents/src/shared/settings.ts +9 -1
- package/dist/extensions/pi-subagents/src/shared/status-format.ts +7 -1
- package/dist/extensions/pi-subagents/src/shared/types.ts +522 -51
- package/dist/extensions/pi-subagents/src/shared/utils.ts +59 -53
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +604 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-json.ts +108 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +249 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +353 -345
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +2 -2
- package/dist/extensions/pi-subagents/src/slash/selector.ts +147 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +265 -23
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +2 -2
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +428 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +362 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +472 -0
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +664 -0
- package/dist/extensions/pi-subagents/src/tui/render.ts +115 -31
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +220 -0
- package/dist/extensions/pi-subagents/src/watchdog/child-status.ts +205 -0
- package/dist/extensions/pi-subagents/src/watchdog/emission-guard.ts +123 -0
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +532 -0
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +167 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +117 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +433 -0
- package/dist/extensions/pi-subagents/src/watchdog/render.ts +54 -0
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +298 -0
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +714 -0
- package/dist/extensions/pi-subagents/src/watchdog/settings.ts +528 -0
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +155 -0
- package/dist/extensions/pi-subagents/src/watchdog/turn-delta.ts +161 -0
- package/dist/extensions/pi-subagents/src/watchdog/types.ts +188 -0
- package/dist/extensions/pi-subagents/src/watchdog/warning-format.ts +73 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +130 -2
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +439 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1632 -61
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +54 -1
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +112 -0
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +98 -1
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +179 -9
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +16 -9
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +6 -5
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +589 -9
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +528 -21
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +227 -3
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +235 -7
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +172 -2
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +1502 -18
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +993 -4
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +7 -1
- package/dist/extensions/pi-subagents/test/support/helpers.ts +32 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +59 -2
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +32 -6
- package/dist/extensions/pi-subagents/test/support/real-session-child-cli.mjs +25 -24
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +59 -35
- package/dist/extensions/pi-subagents/test/support/session-lease-child.mjs +42 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +703 -69
- package/dist/extensions/pi-subagents/test/unit/accessible-dir.test.ts +82 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +66 -66
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +478 -19
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +228 -7
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +198 -78
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +15 -1
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +102 -7
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +439 -6
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +41 -1
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +285 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-pi-args.test.ts +84 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling.test.ts +68 -0
- package/dist/extensions/pi-subagents/test/unit/chain-validation.test.ts +326 -0
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +82 -0
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +46 -4
- package/dist/extensions/pi-subagents/test/unit/completion-batcher.test.ts +3 -1
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +9 -17
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +175 -3
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +10 -5
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +126 -6
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +219 -0
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +913 -0
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +13 -2
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +351 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +280 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +575 -0
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +65 -0
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +94 -1
- package/dist/extensions/pi-subagents/test/unit/get-final-output.test.ts +23 -0
- package/dist/extensions/pi-subagents/test/unit/host-peer-runtime-imports.test.ts +157 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +367 -5
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +11 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +36 -0
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +25 -3
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +341 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +16 -0
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +168 -7
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +85 -7
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +175 -0
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +243 -16
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +79 -36
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +174 -56
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +322 -0
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +204 -0
- package/dist/extensions/pi-subagents/test/unit/recursion-guard.test.ts +20 -12
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +117 -4
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +40 -7
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +48 -1
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +21 -3
- package/dist/extensions/pi-subagents/test/unit/selector.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +326 -0
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +101 -2
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +111 -1
- package/dist/extensions/pi-subagents/test/unit/spawn-budget.test.ts +124 -0
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +6 -4
- package/dist/extensions/pi-subagents/test/unit/status-format.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +397 -0
- package/dist/extensions/pi-subagents/test/unit/steering-notices.test.ts +58 -0
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +173 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +25 -4
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +390 -25
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +837 -0
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +86 -0
- package/dist/extensions/pi-subagents/test/unit/tool-budget.test.ts +15 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +47 -1
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +56 -10
- package/dist/extensions/pi-subagents/test/unit/watchdog-change-signature.test.ts +387 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +110 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-emission-guard.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +144 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-model-selection.test.ts +121 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-render.test.ts +76 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-review.test.ts +327 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +863 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +290 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-tool-actions.test.ts +91 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-turn-delta.test.ts +130 -0
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +32 -4
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +5 -1
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +30 -0
- package/dist/extensions/question/batch.ts +39 -0
- package/dist/extensions/question/dialog-adapter.ts +23 -1
- package/dist/extensions/question/index.ts +237 -7
- package/dist/extensions/question/schemas.ts +28 -15
- package/dist/extensions/question/tests/batch.test.ts +26 -0
- package/dist/extensions/question/tests/ui-protocol.test.ts +23 -3
- package/dist/extensions/question/tui-adapter.ts +2 -3
- package/dist/extensions/question/types.ts +37 -0
- package/dist/extensions/question/ui-protocol.ts +3 -3
- package/dist/skills/batch-grill-me/SKILL.md +3 -1
- package/package.json +2 -1
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import * as os from "node:os";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import type { Message } from "@earendil-works/pi-ai";
|
|
8
|
+
import type { AgentConfig } from "../agents/agents.ts";
|
|
8
9
|
import type { FSWatcher } from "node:fs";
|
|
9
10
|
import type { ExtensionContext } from "@selesai/code";
|
|
10
11
|
import type { ModelScopeConfig } from "../runs/shared/model-scope.ts";
|
|
12
|
+
import type { ResolvedSubagentCapabilityCeiling, SubagentCapabilityAudit } from "../runs/shared/capability-ceiling.ts";
|
|
11
13
|
|
|
12
14
|
// ============================================================================
|
|
13
15
|
// Basic Types
|
|
@@ -20,6 +22,8 @@ export interface MaxOutputConfig {
|
|
|
20
22
|
|
|
21
23
|
export type OutputMode = "inline" | "file-only";
|
|
22
24
|
|
|
25
|
+
export type AcceptanceRole = "read-only" | "writer";
|
|
26
|
+
|
|
23
27
|
export type JsonSchemaObject = Record<string, unknown>;
|
|
24
28
|
|
|
25
29
|
export interface ChainOutputMapEntry {
|
|
@@ -31,7 +35,7 @@ export interface ChainOutputMapEntry {
|
|
|
31
35
|
|
|
32
36
|
export type ChainOutputMap = Record<string, ChainOutputMapEntry>;
|
|
33
37
|
|
|
34
|
-
export type WorkflowNodeStatus = "pending" | "running" | "completed" | "failed" | "paused" | "detached";
|
|
38
|
+
export type WorkflowNodeStatus = "pending" | "running" | "completed" | "failed" | "paused" | "stopped" | "detached";
|
|
35
39
|
|
|
36
40
|
export interface WorkflowGraphNode {
|
|
37
41
|
id: string;
|
|
@@ -121,12 +125,13 @@ export interface ToolBudgetState extends ResolvedToolBudget {
|
|
|
121
125
|
blockedTool?: string;
|
|
122
126
|
}
|
|
123
127
|
|
|
124
|
-
export type TurnBudgetOutcome = "within-budget" | "wrap-up-requested" | "exceeded";
|
|
128
|
+
export type TurnBudgetOutcome = "within-budget" | "wrap-up-requested" | "termination-deferred" | "exceeded";
|
|
125
129
|
|
|
126
130
|
export interface TurnBudgetState extends ResolvedTurnBudget {
|
|
127
131
|
outcome: TurnBudgetOutcome;
|
|
128
132
|
turnCount: number;
|
|
129
133
|
wrapUpRequestedAtTurn?: number;
|
|
134
|
+
terminationDeferredAtTurn?: number;
|
|
130
135
|
exceededAtTurn?: number;
|
|
131
136
|
}
|
|
132
137
|
|
|
@@ -181,6 +186,12 @@ export interface CompletionBatchConfig {
|
|
|
181
186
|
stragglerWindowMs?: number;
|
|
182
187
|
}
|
|
183
188
|
|
|
189
|
+
export interface WaitToolConfigObject {
|
|
190
|
+
enabled?: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export type WaitToolConfig = boolean | WaitToolConfigObject;
|
|
194
|
+
|
|
184
195
|
export interface ControlEvent {
|
|
185
196
|
type: ControlEventType;
|
|
186
197
|
from?: ActivityState;
|
|
@@ -192,7 +203,7 @@ export interface ControlEvent {
|
|
|
192
203
|
nestedRunId?: string;
|
|
193
204
|
nestingPath?: NestedRunAddress["path"];
|
|
194
205
|
message: string;
|
|
195
|
-
reason?: "idle" | "completion_guard" | "active_long_running" | "tool_failures" | "time_threshold" | "turn_threshold" | "token_threshold";
|
|
206
|
+
reason?: "idle" | "completion_guard" | "active_long_running" | "tool_failures" | "supervisor_request" | "time_threshold" | "turn_threshold" | "token_threshold";
|
|
196
207
|
turns?: number;
|
|
197
208
|
tokens?: number;
|
|
198
209
|
toolCount?: number;
|
|
@@ -203,14 +214,279 @@ export interface ControlEvent {
|
|
|
203
214
|
recentFailureSummary?: string;
|
|
204
215
|
}
|
|
205
216
|
|
|
206
|
-
export type SubagentResultStatus = "completed" | "failed" | "paused" | "detached";
|
|
217
|
+
export type SubagentResultStatus = "completed" | "failed" | "paused" | "stopped" | "detached";
|
|
207
218
|
export type SubagentRunMode = "single" | "parallel" | "chain";
|
|
208
|
-
|
|
219
|
+
|
|
220
|
+
export interface ParallelHandoffPatch {
|
|
221
|
+
path: string;
|
|
222
|
+
branch: string;
|
|
223
|
+
changed: boolean;
|
|
224
|
+
diffStat: string;
|
|
225
|
+
filesChanged: number;
|
|
226
|
+
insertions: number;
|
|
227
|
+
deletions: number;
|
|
228
|
+
error?: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface ParallelHandoffChild {
|
|
232
|
+
index: number;
|
|
233
|
+
taskIndex: number;
|
|
234
|
+
agent: string;
|
|
235
|
+
status: SubagentResultStatus;
|
|
236
|
+
summary: string;
|
|
237
|
+
outputPath?: string;
|
|
238
|
+
structuredOutput?: unknown;
|
|
239
|
+
structuredOutputPath?: string;
|
|
240
|
+
sessionPath?: string;
|
|
241
|
+
patch: ParallelHandoffPatch;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface ParallelHandoffCleanupTask {
|
|
245
|
+
index: number;
|
|
246
|
+
path: string;
|
|
247
|
+
branch: string;
|
|
248
|
+
worktreeRemoved: boolean;
|
|
249
|
+
branchRemoved: boolean;
|
|
250
|
+
errors?: string[];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface ParallelHandoffGroup {
|
|
254
|
+
stepIndex: number;
|
|
255
|
+
baseCommit: string;
|
|
256
|
+
repoRoot: string;
|
|
257
|
+
children: ParallelHandoffChild[];
|
|
258
|
+
cleanup: {
|
|
259
|
+
state: "complete" | "partial";
|
|
260
|
+
tasks: ParallelHandoffCleanupTask[];
|
|
261
|
+
pruned: boolean;
|
|
262
|
+
errors?: string[];
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface ParallelHandoffManifest {
|
|
267
|
+
version: 1;
|
|
268
|
+
runId: string;
|
|
269
|
+
mode: "parallel" | "chain";
|
|
270
|
+
source: "foreground" | "async";
|
|
271
|
+
cwd: string;
|
|
272
|
+
createdAt: number;
|
|
273
|
+
updatedAt: number;
|
|
274
|
+
groups: ParallelHandoffGroup[];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface ParallelHandoffReference {
|
|
278
|
+
version: 1;
|
|
279
|
+
path: string;
|
|
280
|
+
groupCount: number;
|
|
281
|
+
childCount: number;
|
|
282
|
+
changedPatches: number;
|
|
283
|
+
cleanupState: "complete" | "partial";
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface AgentContract {
|
|
287
|
+
version: 1;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export type ChainGateLayer = "execution" | "acceptance";
|
|
291
|
+
|
|
292
|
+
export type ExecutionProjectionStatus = "completed" | "failed" | "paused" | "stopped" | "detached";
|
|
293
|
+
|
|
294
|
+
export interface ExecutionProjection {
|
|
295
|
+
status: ExecutionProjectionStatus;
|
|
296
|
+
success: boolean;
|
|
297
|
+
exitCode: number;
|
|
298
|
+
error?: string;
|
|
299
|
+
interrupted?: boolean;
|
|
300
|
+
timedOut?: boolean;
|
|
301
|
+
stopped?: boolean;
|
|
302
|
+
detached?: boolean;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface ReviewProjection {
|
|
306
|
+
status: "not-requested" | "review-required" | "reviewed" | "blockers";
|
|
307
|
+
findings?: AcceptanceReviewResult["findings"];
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export interface FileMutationEffect {
|
|
311
|
+
status: "not-requested" | "not-applicable" | "observed" | "missing";
|
|
312
|
+
expected: boolean;
|
|
313
|
+
attempted: boolean;
|
|
314
|
+
message?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export interface EffectsProjection {
|
|
318
|
+
fileMutation?: FileMutationEffect;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export const SUBAGENT_LIFECYCLE_ARTIFACT_VERSION = 3;
|
|
209
322
|
export type SubagentLifecycleArtifactVersion = typeof SUBAGENT_LIFECYCLE_ARTIFACT_VERSION;
|
|
210
323
|
|
|
324
|
+
export type ProcessTerminalState = "pending" | "observed" | "unknown" | "not-started";
|
|
325
|
+
export type ProcessTerminalReason =
|
|
326
|
+
| "observer-unavailable"
|
|
327
|
+
| "runner-candidate-missing"
|
|
328
|
+
| "runner-instance-mismatch"
|
|
329
|
+
| "writer-close-unverified"
|
|
330
|
+
| "canonical-session-unavailable"
|
|
331
|
+
| "canonical-session-lease-active"
|
|
332
|
+
| "canonical-session-release-unverified"
|
|
333
|
+
| "proof-write-failed"
|
|
334
|
+
| "stale-repair";
|
|
335
|
+
|
|
336
|
+
export interface RunnerProcessInstanceExitV1 {
|
|
337
|
+
processInstanceId: string;
|
|
338
|
+
kind: "runner";
|
|
339
|
+
closeObservedAt: number;
|
|
340
|
+
exitCode: number | null;
|
|
341
|
+
signal: string | null;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface PiWriterProcessInstanceExitV1 {
|
|
345
|
+
processInstanceId: string;
|
|
346
|
+
kind: "pi-writer";
|
|
347
|
+
attempt: number;
|
|
348
|
+
closeObservedAt: number;
|
|
349
|
+
exitCode: number | null;
|
|
350
|
+
signal: string | null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export type ProcessInstanceExitV1 = RunnerProcessInstanceExitV1 | PiWriterProcessInstanceExitV1;
|
|
354
|
+
|
|
355
|
+
export interface CanonicalSessionTerminalV1 {
|
|
356
|
+
canonicalSessionId: string;
|
|
357
|
+
leaseDisposition: "released" | "not-held";
|
|
358
|
+
freeAtObservation: true;
|
|
359
|
+
canonicalSessionLeaseReleased?: true;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
interface ProcessTerminalBaseV1 {
|
|
363
|
+
version: 1;
|
|
364
|
+
runId: string;
|
|
365
|
+
childIndex?: number;
|
|
366
|
+
runnerProcessInstanceId: string;
|
|
367
|
+
resumeDisposition?: "resumable" | "non-resumable" | "unavailable";
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export type ProcessTerminalV1 =
|
|
371
|
+
| (ProcessTerminalBaseV1 & { state: "pending" | "not-started" })
|
|
372
|
+
| (ProcessTerminalBaseV1 & {
|
|
373
|
+
state: "observed";
|
|
374
|
+
observedAt: number;
|
|
375
|
+
instances: ProcessInstanceExitV1[];
|
|
376
|
+
canonicalSession?: CanonicalSessionTerminalV1;
|
|
377
|
+
})
|
|
378
|
+
| (ProcessTerminalBaseV1 & {
|
|
379
|
+
state: "unknown";
|
|
380
|
+
reason: ProcessTerminalReason;
|
|
381
|
+
diagnostic?: string;
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
export type SteeringActionState = "delivered" | "scheduled" | "pending" | "partial" | "recovered" | "failed";
|
|
385
|
+
export type SteeringTargetState = "scheduled" | "routed" | "delivered" | "late" | "failed" | "recovered";
|
|
386
|
+
|
|
387
|
+
export interface SteeringTargetStatus {
|
|
388
|
+
index: number;
|
|
389
|
+
state: SteeringTargetState;
|
|
390
|
+
routedAt?: number;
|
|
391
|
+
deliveredAt?: number;
|
|
392
|
+
lateDeliveredAt?: number;
|
|
393
|
+
failedAt?: number;
|
|
394
|
+
recoveredAt?: number;
|
|
395
|
+
reason?: string;
|
|
396
|
+
replacementRunId?: string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface SteeringRequestStatus {
|
|
400
|
+
id: string;
|
|
401
|
+
requestedAt: number;
|
|
402
|
+
source?: string;
|
|
403
|
+
messagePreview: string;
|
|
404
|
+
targets: SteeringTargetStatus[];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface SteeringStatus {
|
|
408
|
+
requested: number;
|
|
409
|
+
scheduled: number;
|
|
410
|
+
pending: number;
|
|
411
|
+
delivered: number;
|
|
412
|
+
failed: number;
|
|
413
|
+
recovered: number;
|
|
414
|
+
lastRequestedAt?: number;
|
|
415
|
+
lastDeliveredAt?: number;
|
|
416
|
+
recent: SteeringRequestStatus[];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export interface SteerActionTarget {
|
|
420
|
+
index: number;
|
|
421
|
+
state: SteeringTargetState;
|
|
422
|
+
deliveredAt?: number;
|
|
423
|
+
lateDeliveredAt?: number;
|
|
424
|
+
reason?: string;
|
|
425
|
+
replacementRunId?: string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export interface SteerActionResult {
|
|
429
|
+
requestId: string;
|
|
430
|
+
state: SteeringActionState;
|
|
431
|
+
sourceRunId: string;
|
|
432
|
+
replacementRunId?: string;
|
|
433
|
+
targets: SteerActionTarget[];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface SteeringNotice {
|
|
437
|
+
type: "subagent.steering.notice";
|
|
438
|
+
ts: number;
|
|
439
|
+
runId: string;
|
|
440
|
+
requestId: string;
|
|
441
|
+
state: "failed" | "partial" | "recovered";
|
|
442
|
+
message: string;
|
|
443
|
+
currentSessionId?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface SteeringRecoveryDescriptor {
|
|
447
|
+
version: 1;
|
|
448
|
+
launchContractDigest?: string;
|
|
449
|
+
sourceRunId: string;
|
|
450
|
+
agentContract?: AgentContract;
|
|
451
|
+
agent: string;
|
|
452
|
+
sessionFile?: string;
|
|
453
|
+
cwd: string;
|
|
454
|
+
model?: string;
|
|
455
|
+
fallbackModels?: string[];
|
|
456
|
+
thinking?: string;
|
|
457
|
+
tools?: string[];
|
|
458
|
+
extensions?: string[];
|
|
459
|
+
subagentOnlyExtensions?: string[];
|
|
460
|
+
mcpDirectTools?: string[];
|
|
461
|
+
systemPrompt?: string;
|
|
462
|
+
systemPromptMode: "append" | "replace";
|
|
463
|
+
inheritProjectContext: boolean;
|
|
464
|
+
inheritSkills: boolean;
|
|
465
|
+
skills?: string[];
|
|
466
|
+
skillPath?: string[];
|
|
467
|
+
agentFilePath?: string;
|
|
468
|
+
completionGuard?: boolean;
|
|
469
|
+
memory?: { scope: "project" | "user"; path: string };
|
|
470
|
+
outputPath?: string;
|
|
471
|
+
outputMode: "inline" | "file-only";
|
|
472
|
+
structuredOutputSchema?: JsonSchemaObject;
|
|
473
|
+
acceptance?: AcceptanceInput;
|
|
474
|
+
controlConfig?: ResolvedControlConfig;
|
|
475
|
+
absoluteDeadlineAt?: number;
|
|
476
|
+
initialTurnBudget?: ResolvedTurnBudget;
|
|
477
|
+
initialToolBudget?: ResolvedToolBudget;
|
|
478
|
+
maxSubagentDepth: number;
|
|
479
|
+
maxOutput?: MaxOutputConfig;
|
|
480
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
481
|
+
share: boolean;
|
|
482
|
+
sessionDir?: string;
|
|
483
|
+
artifactsDir?: string;
|
|
484
|
+
artifactConfig?: ArtifactConfig;
|
|
485
|
+
}
|
|
486
|
+
|
|
211
487
|
export type PublicNestedStepSummary = Pick<
|
|
212
488
|
NestedStepSummary,
|
|
213
|
-
"agent" | "status" | "sessionFile" | "transcriptPath" | "transcriptError" | "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount" | "toolBudget" | "toolBudgetBlocked" | "startedAt" | "endedAt" | "error" | "timedOut"
|
|
489
|
+
"agent" | "status" | "sessionFile" | "transcriptPath" | "transcriptError" | "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount" | "toolBudget" | "toolBudgetBlocked" | "startedAt" | "endedAt" | "error" | "timedOut" | "stopped"
|
|
214
490
|
> & {
|
|
215
491
|
children?: PublicNestedRunSummary[];
|
|
216
492
|
};
|
|
@@ -223,7 +499,7 @@ export type CostSummary = {
|
|
|
223
499
|
|
|
224
500
|
export type PublicNestedRunSummary = Pick<
|
|
225
501
|
NestedRunSummary,
|
|
226
|
-
"id" | "parentRunId" | "parentStepIndex" | "parentAgent" | "depth" | "path" | "asyncDir" | "sessionId" | "sessionFile" | "intercomTarget" | "ownerIntercomTarget" | "leafIntercomTarget" | "ownerState" | "mode" | "state" | "agent" | "agents" | "currentStep" | "chainStepCount" | "parallelGroups" | "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount" | "toolBudget" | "toolBudgetBlocked" | "totalTokens" | "totalCost" | "startedAt" | "endedAt" | "lastUpdate" | "error" | "timeoutMs" | "deadlineAt" | "timedOut" | "turnBudget" | "turnBudgetExceeded" | "wrapUpRequested"
|
|
502
|
+
"id" | "parentRunId" | "parentStepIndex" | "parentAgent" | "depth" | "path" | "asyncDir" | "sessionId" | "sessionFile" | "intercomTarget" | "ownerIntercomTarget" | "leafIntercomTarget" | "ownerState" | "mode" | "state" | "agent" | "agents" | "currentStep" | "chainStepCount" | "parallelGroups" | "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount" | "toolBudget" | "toolBudgetBlocked" | "totalTokens" | "totalCost" | "startedAt" | "endedAt" | "lastUpdate" | "error" | "timeoutMs" | "deadlineAt" | "timedOut" | "stopped" | "turnBudget" | "turnBudgetExceeded" | "wrapUpRequested"
|
|
227
503
|
> & {
|
|
228
504
|
steps?: PublicNestedStepSummary[];
|
|
229
505
|
children?: PublicNestedRunSummary[];
|
|
@@ -257,12 +533,22 @@ export interface SubagentResultIntercomPayload {
|
|
|
257
533
|
index?: number;
|
|
258
534
|
artifactPath?: string;
|
|
259
535
|
sessionPath?: string;
|
|
536
|
+
parallelHandoff?: ParallelHandoffReference;
|
|
260
537
|
}
|
|
261
538
|
|
|
262
539
|
// ============================================================================
|
|
263
540
|
// Progress Tracking
|
|
264
541
|
// ============================================================================
|
|
265
542
|
|
|
543
|
+
export interface ChildWatchdogProgress {
|
|
544
|
+
phase: "idle" | "reviewing" | "autofollow" | "settling" | "stale" | "failed";
|
|
545
|
+
seq: number;
|
|
546
|
+
lastUpdate: number;
|
|
547
|
+
followUpPending: boolean;
|
|
548
|
+
reason?: string;
|
|
549
|
+
timedOut?: boolean;
|
|
550
|
+
}
|
|
551
|
+
|
|
266
552
|
export interface AgentProgress {
|
|
267
553
|
index: number;
|
|
268
554
|
agent: string;
|
|
@@ -283,6 +569,7 @@ export interface AgentProgress {
|
|
|
283
569
|
durationMs: number;
|
|
284
570
|
error?: string;
|
|
285
571
|
failedTool?: string;
|
|
572
|
+
watchdog?: ChildWatchdogProgress;
|
|
286
573
|
}
|
|
287
574
|
|
|
288
575
|
export interface ToolCallSummary {
|
|
@@ -308,7 +595,7 @@ export interface ModelAttempt {
|
|
|
308
595
|
usage?: Usage;
|
|
309
596
|
}
|
|
310
597
|
|
|
311
|
-
export type AcceptanceLevel = "auto" | "none" | "attested" | "checked" | "verified"
|
|
598
|
+
export type AcceptanceLevel = "auto" | "none" | "attested" | "checked" | "verified";
|
|
312
599
|
|
|
313
600
|
export type AcceptanceEvidenceKind =
|
|
314
601
|
| "changed-files"
|
|
@@ -353,7 +640,8 @@ export interface AcceptanceConfig {
|
|
|
353
640
|
reason?: string;
|
|
354
641
|
}
|
|
355
642
|
|
|
356
|
-
|
|
643
|
+
/** Bare "none" is not accepted: use { level: "none", reason: "..." }; false remains a deprecated shorthand. */
|
|
644
|
+
export type AcceptanceInput = Exclude<AcceptanceLevel, "none"> | false | AcceptanceConfig;
|
|
357
645
|
|
|
358
646
|
export interface ResolvedAcceptanceGate extends AcceptanceGate {
|
|
359
647
|
id: string;
|
|
@@ -416,7 +704,7 @@ export interface AcceptanceVerifyResult {
|
|
|
416
704
|
}
|
|
417
705
|
|
|
418
706
|
export interface AcceptanceReviewResult {
|
|
419
|
-
status: "
|
|
707
|
+
status: "review-required" | "reviewed" | "blockers";
|
|
420
708
|
findings: Array<{
|
|
421
709
|
severity: "blocker" | "non-blocking";
|
|
422
710
|
file?: string;
|
|
@@ -425,18 +713,24 @@ export interface AcceptanceReviewResult {
|
|
|
425
713
|
}>;
|
|
426
714
|
}
|
|
427
715
|
|
|
428
|
-
export type
|
|
716
|
+
export type AcceptanceEvidenceStatus =
|
|
717
|
+
| "pending"
|
|
429
718
|
| "not-required"
|
|
430
719
|
| "claimed"
|
|
431
720
|
| "attested"
|
|
432
721
|
| "checked"
|
|
433
722
|
| "verified"
|
|
434
|
-
| "reviewed"
|
|
435
|
-
| "accepted"
|
|
436
723
|
| "rejected";
|
|
437
724
|
|
|
725
|
+
export type AcceptanceLedgerStatus =
|
|
726
|
+
| AcceptanceEvidenceStatus
|
|
727
|
+
| "review-required"
|
|
728
|
+
| "reviewed"
|
|
729
|
+
| "accepted";
|
|
730
|
+
|
|
438
731
|
export interface AcceptanceLedger {
|
|
439
732
|
status: AcceptanceLedgerStatus;
|
|
733
|
+
evidenceStatus: AcceptanceEvidenceStatus;
|
|
440
734
|
explicit: boolean;
|
|
441
735
|
effectiveAcceptance: ResolvedAcceptanceConfig;
|
|
442
736
|
inferredReason: string[];
|
|
@@ -453,14 +747,26 @@ export interface AcceptanceLedger {
|
|
|
453
747
|
};
|
|
454
748
|
}
|
|
455
749
|
|
|
750
|
+
export interface ProtocolOutputLimit {
|
|
751
|
+
code: "protocol_output_limit";
|
|
752
|
+
stream: "stdout" | "stderr";
|
|
753
|
+
limitBytes: number;
|
|
754
|
+
observedBytes: number;
|
|
755
|
+
diagnosticPrefix: string;
|
|
756
|
+
diagnosticTail: string;
|
|
757
|
+
}
|
|
758
|
+
|
|
456
759
|
export interface SingleResult {
|
|
457
760
|
agent: string;
|
|
458
761
|
task: string;
|
|
762
|
+
/** Resolved launch context for this child. */
|
|
763
|
+
context?: "fresh" | "fork";
|
|
459
764
|
exitCode: number;
|
|
460
765
|
detached?: boolean;
|
|
461
766
|
detachedReason?: string;
|
|
462
767
|
interrupted?: boolean;
|
|
463
768
|
timedOut?: boolean;
|
|
769
|
+
stopped?: boolean;
|
|
464
770
|
turnBudget?: TurnBudgetState;
|
|
465
771
|
turnBudgetExceeded?: boolean;
|
|
466
772
|
wrapUpRequested?: boolean;
|
|
@@ -469,10 +775,13 @@ export interface SingleResult {
|
|
|
469
775
|
messages?: Message[];
|
|
470
776
|
usage: Usage;
|
|
471
777
|
model?: string;
|
|
778
|
+
/** Effective thinking level used by this foreground child, when known. */
|
|
779
|
+
thinking?: string;
|
|
472
780
|
attemptedModels?: string[];
|
|
473
781
|
modelAttempts?: ModelAttempt[];
|
|
474
782
|
controlEvents?: ControlEvent[];
|
|
475
783
|
error?: string;
|
|
784
|
+
protocolError?: ProtocolOutputLimit;
|
|
476
785
|
sessionFile?: string;
|
|
477
786
|
skills?: string[];
|
|
478
787
|
skillsWarning?: string;
|
|
@@ -487,25 +796,55 @@ export interface SingleResult {
|
|
|
487
796
|
outputReference?: SavedOutputReference;
|
|
488
797
|
outputSaveError?: string;
|
|
489
798
|
structuredOutput?: unknown;
|
|
799
|
+
structuredOutputFailed?: boolean;
|
|
490
800
|
structuredOutputPath?: string;
|
|
491
801
|
structuredOutputSchemaPath?: string;
|
|
492
802
|
acceptance?: AcceptanceLedger;
|
|
803
|
+
agentContract?: AgentContract;
|
|
804
|
+
launchContractDigest?: string;
|
|
805
|
+
execution?: ExecutionProjection;
|
|
806
|
+
review?: ReviewProjection;
|
|
807
|
+
effects?: EffectsProjection;
|
|
493
808
|
transcriptPath?: string;
|
|
494
809
|
transcriptError?: string;
|
|
495
810
|
children?: NestedRunSummary[];
|
|
811
|
+
watchdog?: ChildWatchdogProgress;
|
|
812
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
813
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export interface SpawnBudgetGrant {
|
|
817
|
+
sessionId: string;
|
|
818
|
+
amount: number;
|
|
819
|
+
grantedAt: number;
|
|
820
|
+
previousLimit: number;
|
|
821
|
+
limit: number;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export interface SpawnBudgetSnapshot {
|
|
825
|
+
used: number;
|
|
826
|
+
configuredLimit: number | null;
|
|
827
|
+
granted: number;
|
|
828
|
+
limit: number | null;
|
|
829
|
+
remaining: number | null;
|
|
830
|
+
grantRemaining: number | null;
|
|
831
|
+
grantHistory: SpawnBudgetGrant[];
|
|
496
832
|
}
|
|
497
833
|
|
|
498
834
|
export interface Details {
|
|
499
835
|
mode: SubagentRunMode | "management";
|
|
500
836
|
runId?: string;
|
|
501
|
-
context
|
|
837
|
+
/** Run-level context summary. "mixed" when children resolved to different modes. */
|
|
838
|
+
context?: "fresh" | "fork" | "mixed";
|
|
502
839
|
results: SingleResult[];
|
|
503
840
|
controlEvents?: ControlEvent[];
|
|
841
|
+
steering?: SteerActionResult;
|
|
504
842
|
asyncId?: string;
|
|
505
843
|
asyncDir?: string;
|
|
506
844
|
timeoutMs?: number;
|
|
507
845
|
deadlineAt?: number;
|
|
508
846
|
timedOut?: boolean;
|
|
847
|
+
stopped?: boolean;
|
|
509
848
|
turnBudget?: ResolvedTurnBudget;
|
|
510
849
|
toolBudget?: ResolvedToolBudget;
|
|
511
850
|
progress?: AgentProgress[];
|
|
@@ -530,6 +869,14 @@ export interface Details {
|
|
|
530
869
|
totalChildUsage?: Usage;
|
|
531
870
|
// Aggregated cost across all agents in the run
|
|
532
871
|
totalCost?: CostSummary;
|
|
872
|
+
spawnBudget?: SpawnBudgetSnapshot;
|
|
873
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
874
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
875
|
+
parallelHandoff?: ParallelHandoffReference;
|
|
876
|
+
lifecycleStatus?: {
|
|
877
|
+
processTerminal?: ProcessTerminalV1;
|
|
878
|
+
};
|
|
879
|
+
launchContractDigest?: string;
|
|
533
880
|
}
|
|
534
881
|
|
|
535
882
|
// ============================================================================
|
|
@@ -544,8 +891,11 @@ export interface ArtifactPaths {
|
|
|
544
891
|
metadataPath: string;
|
|
545
892
|
}
|
|
546
893
|
|
|
894
|
+
export type ArtifactDirPreference = "project" | "session" | "temp";
|
|
895
|
+
|
|
547
896
|
export interface ArtifactConfig {
|
|
548
897
|
enabled: boolean;
|
|
898
|
+
dir?: ArtifactDirPreference;
|
|
549
899
|
includeInput: boolean;
|
|
550
900
|
includeOutput: boolean;
|
|
551
901
|
includeJsonl: boolean;
|
|
@@ -564,7 +914,7 @@ export interface AsyncParallelGroupStatus {
|
|
|
564
914
|
stepIndex: number;
|
|
565
915
|
}
|
|
566
916
|
|
|
567
|
-
export type NestedRunState = "queued" | "running" | "complete" | "failed" | "paused";
|
|
917
|
+
export type NestedRunState = "queued" | "running" | "complete" | "failed" | "paused" | "stopped";
|
|
568
918
|
export type NestedOwnerState = "live" | "gone" | "unknown";
|
|
569
919
|
|
|
570
920
|
export interface NestedRunAddress {
|
|
@@ -578,7 +928,7 @@ export interface NestedRunAddress {
|
|
|
578
928
|
|
|
579
929
|
export interface NestedStepSummary {
|
|
580
930
|
agent: string;
|
|
581
|
-
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused";
|
|
931
|
+
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused" | "stopped";
|
|
582
932
|
sessionFile?: string;
|
|
583
933
|
transcriptPath?: string;
|
|
584
934
|
transcriptError?: string;
|
|
@@ -592,12 +942,17 @@ export interface NestedStepSummary {
|
|
|
592
942
|
startedAt?: number;
|
|
593
943
|
endedAt?: number;
|
|
594
944
|
error?: string;
|
|
945
|
+
watchdog?: ChildWatchdogProgress;
|
|
595
946
|
timedOut?: boolean;
|
|
947
|
+
stopped?: boolean;
|
|
596
948
|
turnBudget?: TurnBudgetState;
|
|
597
949
|
turnBudgetExceeded?: boolean;
|
|
598
950
|
wrapUpRequested?: boolean;
|
|
599
951
|
toolBudget?: ToolBudgetState;
|
|
600
952
|
toolBudgetBlocked?: boolean;
|
|
953
|
+
processTerminal?: ProcessTerminalV1;
|
|
954
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
955
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
601
956
|
children?: NestedRunSummary[];
|
|
602
957
|
}
|
|
603
958
|
|
|
@@ -613,6 +968,9 @@ export interface NestedRunSummary extends NestedRunAddress {
|
|
|
613
968
|
controlInbox?: string;
|
|
614
969
|
capabilityToken?: string;
|
|
615
970
|
mode?: SubagentRunMode;
|
|
971
|
+
processTerminal?: ProcessTerminalV1;
|
|
972
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
973
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
616
974
|
state: NestedRunState;
|
|
617
975
|
agent?: string;
|
|
618
976
|
agents?: string[];
|
|
@@ -636,6 +994,7 @@ export interface NestedRunSummary extends NestedRunAddress {
|
|
|
636
994
|
timeoutMs?: number;
|
|
637
995
|
deadlineAt?: number;
|
|
638
996
|
timedOut?: boolean;
|
|
997
|
+
stopped?: boolean;
|
|
639
998
|
turnBudget?: TurnBudgetState;
|
|
640
999
|
turnBudgetExceeded?: boolean;
|
|
641
1000
|
wrapUpRequested?: boolean;
|
|
@@ -655,19 +1014,27 @@ export interface AsyncStartedEvent {
|
|
|
655
1014
|
lifecycleArtifactVersion?: SubagentLifecycleArtifactVersion;
|
|
656
1015
|
id?: string;
|
|
657
1016
|
asyncDir?: string;
|
|
1017
|
+
/** Parent-resolved launch directory, used as a trusted artifact root while this session is live. */
|
|
1018
|
+
cwd?: string;
|
|
658
1019
|
pid?: number;
|
|
659
1020
|
sessionId?: string;
|
|
660
1021
|
mode?: SubagentRunMode;
|
|
661
1022
|
agent?: string;
|
|
662
1023
|
agents?: string[];
|
|
1024
|
+
/** Truncated first child task retained for backwards compatibility. */
|
|
1025
|
+
task?: string;
|
|
1026
|
+
/** Workflow-level caller task, falling back to the first child task. */
|
|
1027
|
+
goal?: string;
|
|
663
1028
|
chain?: string[];
|
|
664
1029
|
chainStepCount?: number;
|
|
665
1030
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
666
1031
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1032
|
+
launchContractDigest?: string;
|
|
667
1033
|
timeoutMs?: number;
|
|
668
1034
|
deadlineAt?: number;
|
|
669
1035
|
turnBudget?: TurnBudgetState;
|
|
670
1036
|
nestedRoute?: NestedRouteInfo;
|
|
1037
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
671
1038
|
}
|
|
672
1039
|
|
|
673
1040
|
export interface AsyncStatus {
|
|
@@ -675,7 +1042,8 @@ export interface AsyncStatus {
|
|
|
675
1042
|
runId: string;
|
|
676
1043
|
sessionId?: string;
|
|
677
1044
|
mode: SubagentRunMode;
|
|
678
|
-
|
|
1045
|
+
isNested?: boolean;
|
|
1046
|
+
state: "queued" | "running" | "complete" | "failed" | "paused" | "stopped";
|
|
679
1047
|
error?: string;
|
|
680
1048
|
activityState?: ActivityState;
|
|
681
1049
|
lastActivityAt?: number;
|
|
@@ -684,14 +1052,14 @@ export interface AsyncStatus {
|
|
|
684
1052
|
currentPath?: string;
|
|
685
1053
|
turnCount?: number;
|
|
686
1054
|
toolCount?: number;
|
|
687
|
-
|
|
688
|
-
lastSteerAt?: number;
|
|
1055
|
+
steering?: SteeringStatus;
|
|
689
1056
|
startedAt: number;
|
|
690
1057
|
endedAt?: number;
|
|
691
1058
|
lastUpdate?: number;
|
|
692
1059
|
timeoutMs?: number;
|
|
693
1060
|
deadlineAt?: number;
|
|
694
1061
|
timedOut?: boolean;
|
|
1062
|
+
stopped?: boolean;
|
|
695
1063
|
turnBudget?: TurnBudgetState;
|
|
696
1064
|
turnBudgetExceeded?: boolean;
|
|
697
1065
|
wrapUpRequested?: boolean;
|
|
@@ -704,13 +1072,19 @@ export interface AsyncStatus {
|
|
|
704
1072
|
pendingAppends?: number;
|
|
705
1073
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
706
1074
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1075
|
+
processTerminal?: ProcessTerminalV1;
|
|
1076
|
+
launchContractDigest?: string;
|
|
1077
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1078
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
707
1079
|
steps?: Array<{
|
|
708
1080
|
agent: string;
|
|
1081
|
+
/** Resolved launch context for this child step. */
|
|
1082
|
+
context?: "fresh" | "fork";
|
|
709
1083
|
phase?: string;
|
|
710
1084
|
label?: string;
|
|
711
1085
|
outputName?: string;
|
|
712
1086
|
structured?: boolean;
|
|
713
|
-
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused";
|
|
1087
|
+
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused" | "stopped";
|
|
714
1088
|
children?: NestedRunSummary[];
|
|
715
1089
|
sessionFile?: string;
|
|
716
1090
|
transcriptPath?: string;
|
|
@@ -730,6 +1104,7 @@ export interface AsyncStatus {
|
|
|
730
1104
|
durationMs?: number;
|
|
731
1105
|
exitCode?: number | null;
|
|
732
1106
|
timedOut?: boolean;
|
|
1107
|
+
stopped?: boolean;
|
|
733
1108
|
turnBudget?: TurnBudgetState;
|
|
734
1109
|
turnBudgetExceeded?: boolean;
|
|
735
1110
|
wrapUpRequested?: boolean;
|
|
@@ -742,13 +1117,21 @@ export interface AsyncStatus {
|
|
|
742
1117
|
attemptedModels?: string[];
|
|
743
1118
|
modelAttempts?: ModelAttempt[];
|
|
744
1119
|
totalCost?: CostSummary;
|
|
745
|
-
|
|
746
|
-
lastSteerAt?: number;
|
|
1120
|
+
steering?: SteeringStatus;
|
|
747
1121
|
error?: string;
|
|
748
1122
|
structuredOutput?: unknown;
|
|
749
1123
|
structuredOutputPath?: string;
|
|
750
1124
|
structuredOutputSchemaPath?: string;
|
|
751
1125
|
acceptance?: AcceptanceLedger;
|
|
1126
|
+
agentContract?: AgentContract;
|
|
1127
|
+
launchContractDigest?: string;
|
|
1128
|
+
execution?: ExecutionProjection;
|
|
1129
|
+
review?: ReviewProjection;
|
|
1130
|
+
effects?: EffectsProjection;
|
|
1131
|
+
watchdog?: ChildWatchdogProgress;
|
|
1132
|
+
processTerminal?: ProcessTerminalV1;
|
|
1133
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1134
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
752
1135
|
}>;
|
|
753
1136
|
sessionDir?: string;
|
|
754
1137
|
outputFile?: string;
|
|
@@ -756,6 +1139,7 @@ export interface AsyncStatus {
|
|
|
756
1139
|
totalCost?: CostSummary;
|
|
757
1140
|
sessionFile?: string;
|
|
758
1141
|
outputs?: ChainOutputMap;
|
|
1142
|
+
parallelHandoff?: ParallelHandoffReference;
|
|
759
1143
|
}
|
|
760
1144
|
|
|
761
1145
|
export type AsyncJobStep = NonNullable<AsyncStatus["steps"]>[number] & {
|
|
@@ -765,7 +1149,11 @@ export type AsyncJobStep = NonNullable<AsyncStatus["steps"]>[number] & {
|
|
|
765
1149
|
export interface AsyncJobState {
|
|
766
1150
|
asyncId: string;
|
|
767
1151
|
asyncDir: string;
|
|
768
|
-
|
|
1152
|
+
/** Parent-resolved launch directory retained for trusted live artifact lookup. */
|
|
1153
|
+
cwd?: string;
|
|
1154
|
+
status: "queued" | "running" | "complete" | "failed" | "paused" | "stopped";
|
|
1155
|
+
/** Short caller-facing task/goal shown in fleet surfaces when available. */
|
|
1156
|
+
description?: string;
|
|
769
1157
|
pid?: number;
|
|
770
1158
|
sessionId?: string;
|
|
771
1159
|
activityState?: ActivityState;
|
|
@@ -775,9 +1163,10 @@ export interface AsyncJobState {
|
|
|
775
1163
|
currentPath?: string;
|
|
776
1164
|
turnCount?: number;
|
|
777
1165
|
toolCount?: number;
|
|
778
|
-
|
|
779
|
-
lastSteerAt?: number;
|
|
1166
|
+
steering?: SteeringStatus;
|
|
780
1167
|
mode?: SubagentRunMode;
|
|
1168
|
+
/** Run-level context summary derived from step contexts. */
|
|
1169
|
+
context?: "fresh" | "fork" | "mixed";
|
|
781
1170
|
agents?: string[];
|
|
782
1171
|
currentStep?: number;
|
|
783
1172
|
chainStepCount?: number;
|
|
@@ -793,6 +1182,7 @@ export interface AsyncJobState {
|
|
|
793
1182
|
timeoutMs?: number;
|
|
794
1183
|
deadlineAt?: number;
|
|
795
1184
|
timedOut?: boolean;
|
|
1185
|
+
stopped?: boolean;
|
|
796
1186
|
turnBudget?: TurnBudgetState;
|
|
797
1187
|
turnBudgetExceeded?: boolean;
|
|
798
1188
|
wrapUpRequested?: boolean;
|
|
@@ -810,14 +1200,34 @@ export interface AsyncJobState {
|
|
|
810
1200
|
export interface ForegroundResumeChild {
|
|
811
1201
|
agent: string;
|
|
812
1202
|
index: number;
|
|
1203
|
+
context?: "fresh" | "fork";
|
|
813
1204
|
sessionFile?: string;
|
|
814
1205
|
status: SubagentResultStatus;
|
|
1206
|
+
activityState?: ActivityState;
|
|
1207
|
+
lastActivityAt?: number;
|
|
1208
|
+
currentTool?: string;
|
|
1209
|
+
currentToolStartedAt?: number;
|
|
1210
|
+
currentPath?: string;
|
|
1211
|
+
turnCount?: number;
|
|
1212
|
+
tokens?: number;
|
|
1213
|
+
toolCount?: number;
|
|
815
1214
|
exitCode?: number;
|
|
1215
|
+
error?: string;
|
|
816
1216
|
finalOutput?: string;
|
|
1217
|
+
outputMode?: OutputMode;
|
|
1218
|
+
savedOutputPath?: string;
|
|
1219
|
+
outputSaveError?: string;
|
|
817
1220
|
artifactPaths?: ArtifactPaths;
|
|
818
1221
|
transcriptPath?: string;
|
|
819
1222
|
transcriptError?: string;
|
|
820
1223
|
detachedReason?: string;
|
|
1224
|
+
acceptance?: AcceptanceLedger;
|
|
1225
|
+
agentContract?: AgentContract;
|
|
1226
|
+
execution?: ExecutionProjection;
|
|
1227
|
+
review?: ReviewProjection;
|
|
1228
|
+
effects?: EffectsProjection;
|
|
1229
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1230
|
+
capabilityAudit?: SubagentCapabilityAudit;
|
|
821
1231
|
updatedAt?: number;
|
|
822
1232
|
}
|
|
823
1233
|
|
|
@@ -825,36 +1235,76 @@ export interface ForegroundResumeRun {
|
|
|
825
1235
|
runId: string;
|
|
826
1236
|
mode: SubagentRunMode;
|
|
827
1237
|
cwd: string;
|
|
1238
|
+
/** Originating parent session. Detached exits can outlive the active session. */
|
|
1239
|
+
sessionId?: string;
|
|
828
1240
|
updatedAt: number;
|
|
829
1241
|
children: ForegroundResumeChild[];
|
|
830
1242
|
}
|
|
831
1243
|
|
|
1244
|
+
export interface ForegroundChildControl {
|
|
1245
|
+
index: number;
|
|
1246
|
+
agent: string;
|
|
1247
|
+
description?: string;
|
|
1248
|
+
startedAt: number;
|
|
1249
|
+
updatedAt: number;
|
|
1250
|
+
currentActivityState?: ActivityState;
|
|
1251
|
+
lastActivityAt?: number;
|
|
1252
|
+
currentTool?: string;
|
|
1253
|
+
currentToolStartedAt?: number;
|
|
1254
|
+
currentPath?: string;
|
|
1255
|
+
turnCount?: number;
|
|
1256
|
+
tokens?: number;
|
|
1257
|
+
toolCount?: number;
|
|
1258
|
+
interrupt?: () => boolean;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
export interface ForegroundRunControl {
|
|
1262
|
+
runId: string;
|
|
1263
|
+
mode: SubagentRunMode;
|
|
1264
|
+
startedAt: number;
|
|
1265
|
+
updatedAt: number;
|
|
1266
|
+
/** Effective working directory used to resolve live transcript artifacts. */
|
|
1267
|
+
cwd?: string;
|
|
1268
|
+
currentAgent?: string;
|
|
1269
|
+
currentIndex?: number;
|
|
1270
|
+
/** Short caller-facing task/goal shown in fleet surfaces when available. */
|
|
1271
|
+
description?: string;
|
|
1272
|
+
currentActivityState?: ActivityState;
|
|
1273
|
+
lastActivityAt?: number;
|
|
1274
|
+
currentTool?: string;
|
|
1275
|
+
currentToolStartedAt?: number;
|
|
1276
|
+
currentPath?: string;
|
|
1277
|
+
turnCount?: number;
|
|
1278
|
+
tokens?: number;
|
|
1279
|
+
toolCount?: number;
|
|
1280
|
+
/** Independently tracked children for foreground parallel work and fleet inspection. */
|
|
1281
|
+
activeChildren?: Map<number, ForegroundChildControl>;
|
|
1282
|
+
nestedRoute?: NestedRouteInfo;
|
|
1283
|
+
nestedChildren?: NestedRunSummary[];
|
|
1284
|
+
interrupt?: () => boolean;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
832
1287
|
export interface SubagentState {
|
|
833
1288
|
baseCwd: string;
|
|
834
1289
|
currentSessionId: string | null;
|
|
1290
|
+
/** Runtime-owned artifact resolution inputs used by Fleet transcript targeting. */
|
|
1291
|
+
artifactDirPreference?: ArtifactDirPreference;
|
|
1292
|
+
parentSessionFile?: string | null;
|
|
835
1293
|
subagentInProgress?: boolean;
|
|
836
|
-
subagentSpawns?: {
|
|
1294
|
+
subagentSpawns?: {
|
|
1295
|
+
sessionId: string | null;
|
|
1296
|
+
count: number;
|
|
1297
|
+
configuredLimit?: number | null;
|
|
1298
|
+
granted?: number;
|
|
1299
|
+
grantHistory?: SpawnBudgetGrant[];
|
|
1300
|
+
};
|
|
837
1301
|
asyncJobs: Map<string, AsyncJobState>;
|
|
1302
|
+
/** Current-session active and recent async runs for the native fleet inspector. */
|
|
1303
|
+
fleetJobs?: Map<string, AsyncJobState>;
|
|
1304
|
+
/** Suppress dynamic status widgets while the fleet overlay owns the viewport. */
|
|
1305
|
+
fleetInspectorOpen?: boolean;
|
|
838
1306
|
foregroundRuns?: Map<string, ForegroundResumeRun>;
|
|
839
|
-
foregroundControls: Map<string,
|
|
840
|
-
runId: string;
|
|
841
|
-
mode: SubagentRunMode;
|
|
842
|
-
startedAt: number;
|
|
843
|
-
updatedAt: number;
|
|
844
|
-
currentAgent?: string;
|
|
845
|
-
currentIndex?: number;
|
|
846
|
-
currentActivityState?: ActivityState;
|
|
847
|
-
lastActivityAt?: number;
|
|
848
|
-
currentTool?: string;
|
|
849
|
-
currentToolStartedAt?: number;
|
|
850
|
-
currentPath?: string;
|
|
851
|
-
turnCount?: number;
|
|
852
|
-
tokens?: number;
|
|
853
|
-
toolCount?: number;
|
|
854
|
-
nestedRoute?: NestedRouteInfo;
|
|
855
|
-
nestedChildren?: NestedRunSummary[];
|
|
856
|
-
interrupt?: () => boolean;
|
|
857
|
-
}>;
|
|
1307
|
+
foregroundControls: Map<string, ForegroundRunControl>;
|
|
858
1308
|
lastForegroundControlId: string | null;
|
|
859
1309
|
pendingForegroundControlNotices?: Map<string, ReturnType<typeof setTimeout>>;
|
|
860
1310
|
cleanupTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
@@ -897,8 +1347,11 @@ export const INTERCOM_DETACH_REQUEST_EVENT = "pi-intercom:detach-request";
|
|
|
897
1347
|
export const INTERCOM_DETACH_RESPONSE_EVENT = "pi-intercom:detach-response";
|
|
898
1348
|
export const SUBAGENT_ASYNC_STARTED_EVENT = "subagent:async-started";
|
|
899
1349
|
export const SUBAGENT_ASYNC_COMPLETE_EVENT = "subagent:async-complete";
|
|
1350
|
+
export const SUBAGENT_PROCESS_TERMINAL_EVENT = "subagent:process-terminal";
|
|
1351
|
+
export const SUBAGENT_FOREGROUND_COMPLETE_EVENT = "subagent:foreground-complete";
|
|
900
1352
|
export const SUBAGENT_CONTROL_EVENT = "subagent:control-event";
|
|
901
1353
|
export const SUBAGENT_CONTROL_INTERCOM_EVENT = "subagent:control-intercom";
|
|
1354
|
+
export const SUBAGENT_STEERING_NOTICE_EVENT = "subagent:steering-notice";
|
|
902
1355
|
export const SUBAGENT_RESULT_INTERCOM_EVENT = "subagent:result-intercom";
|
|
903
1356
|
export const SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT = "subagent:result-intercom-delivery";
|
|
904
1357
|
|
|
@@ -909,13 +1362,18 @@ export const SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT = "subagent:result-intercom
|
|
|
909
1362
|
export interface RunSyncOptions {
|
|
910
1363
|
/** Session id of the direct parent session for permission-system ask forwarding. */
|
|
911
1364
|
parentSessionId?: string;
|
|
1365
|
+
/** Resolved launch context for this child. */
|
|
1366
|
+
context?: "fresh" | "fork";
|
|
912
1367
|
cwd?: string;
|
|
913
1368
|
signal?: AbortSignal;
|
|
914
1369
|
interruptSignal?: AbortSignal;
|
|
915
1370
|
timeoutMs?: number;
|
|
916
1371
|
deadlineAt?: number;
|
|
917
1372
|
turnBudget?: ResolvedTurnBudget;
|
|
1373
|
+
/** Enforce maxTurns + graceTurns as a hard model-turn boundary. */
|
|
1374
|
+
enforceHardTurnLimit?: boolean;
|
|
918
1375
|
toolBudget?: ResolvedToolBudget;
|
|
1376
|
+
allowZeroToolBudget?: boolean;
|
|
919
1377
|
allowIntercomDetach?: boolean;
|
|
920
1378
|
intercomEvents?: IntercomEventBus;
|
|
921
1379
|
onUpdate?: (r: import("@earendil-works/pi-agent-core").AgentToolResult<Details>) => void;
|
|
@@ -935,6 +1393,9 @@ export interface RunSyncOptions {
|
|
|
935
1393
|
outputPath?: string;
|
|
936
1394
|
outputMode?: OutputMode;
|
|
937
1395
|
maxSubagentDepth?: number;
|
|
1396
|
+
/** Effective parent wait-tool setting propagated to the child runtime. */
|
|
1397
|
+
waitToolEnabled?: boolean;
|
|
1398
|
+
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
938
1399
|
nestedRoute?: NestedRouteInfo;
|
|
939
1400
|
/** Override the agent's default model (format: "provider/id" or just "id") */
|
|
940
1401
|
modelOverride?: string;
|
|
@@ -953,6 +1414,7 @@ export interface RunSyncOptions {
|
|
|
953
1414
|
schemaPath: string;
|
|
954
1415
|
outputPath: string;
|
|
955
1416
|
};
|
|
1417
|
+
agentContract?: AgentContract;
|
|
956
1418
|
acceptance?: AcceptanceInput;
|
|
957
1419
|
acceptanceContext?: {
|
|
958
1420
|
mode?: SubagentRunMode;
|
|
@@ -997,12 +1459,18 @@ export interface ScheduledRunsConfig {
|
|
|
997
1459
|
|
|
998
1460
|
export interface ExtensionConfig {
|
|
999
1461
|
asyncByDefault?: boolean;
|
|
1462
|
+
/** Show the Claude Code-style navigable fleet below the editor. Defaults to true. */
|
|
1463
|
+
fleetView?: boolean;
|
|
1464
|
+
/** Show the legacy above-editor async runs widget. Defaults to true only when fleetView is disabled. */
|
|
1465
|
+
asyncWidget?: boolean;
|
|
1000
1466
|
/** Tool description variant registered for the parent-facing subagent tool. Defaults to full. */
|
|
1001
1467
|
toolDescriptionMode?: ToolDescriptionMode;
|
|
1002
1468
|
forceTopLevelAsync?: boolean;
|
|
1469
|
+
waitTool?: WaitToolConfig;
|
|
1003
1470
|
defaultSessionDir?: string;
|
|
1004
1471
|
singleRunOutputBaseDir?: string;
|
|
1005
1472
|
maxSubagentDepth?: number;
|
|
1473
|
+
/** Optional cumulative session cap. Unset or 0 means unlimited. */
|
|
1006
1474
|
maxSubagentSpawnsPerSession?: number;
|
|
1007
1475
|
/** Global cap on simultaneously-running subagent tasks within a single run. Defaults to 20. */
|
|
1008
1476
|
globalConcurrencyLimit?: number;
|
|
@@ -1015,6 +1483,8 @@ export interface ExtensionConfig {
|
|
|
1015
1483
|
worktreeSetupHook?: string;
|
|
1016
1484
|
worktreeSetupHookTimeoutMs?: number;
|
|
1017
1485
|
worktreeBaseDir?: string;
|
|
1486
|
+
/** Where to store subagent artifact files. Defaults to "project" (cwd/.pi-subagents). Set to "session" for pi session dir, or "temp" for OS temp. */
|
|
1487
|
+
artifactDir?: ArtifactDirPreference;
|
|
1018
1488
|
intercomBridge?: IntercomBridgeConfig;
|
|
1019
1489
|
proactiveSkillSubagents?: ProactiveSkillSubagentsConfig | false;
|
|
1020
1490
|
scheduledRuns?: ScheduledRunsConfig;
|
|
@@ -1031,6 +1501,7 @@ export const DEFAULT_MAX_OUTPUT: Required<MaxOutputConfig> = {
|
|
|
1031
1501
|
|
|
1032
1502
|
export const DEFAULT_ARTIFACT_CONFIG: ArtifactConfig = {
|
|
1033
1503
|
enabled: true,
|
|
1504
|
+
dir: "project",
|
|
1034
1505
|
includeInput: true,
|
|
1035
1506
|
includeOutput: true,
|
|
1036
1507
|
includeJsonl: false,
|
|
@@ -1110,8 +1581,7 @@ export const SLASH_SUBAGENT_CANCEL_EVENT = "subagent:slash:cancel";
|
|
|
1110
1581
|
export const POLL_INTERVAL_MS = 250;
|
|
1111
1582
|
export const MAX_WIDGET_JOBS = 4;
|
|
1112
1583
|
export const DEFAULT_SUBAGENT_MAX_DEPTH = 2;
|
|
1113
|
-
export const
|
|
1114
|
-
export const SUBAGENT_ACTIONS = ["list", "get", "models", "create", "update", "delete", "eject", "disable", "enable", "reset", "status", "interrupt", "resume", "steer", "append-step", "doctor", "schedule", "schedule-list", "schedule-status", "schedule-cancel"] as const;
|
|
1584
|
+
export const SUBAGENT_ACTIONS = ["list", "get", "models", "create", "update", "delete", "eject", "disable", "enable", "reset", "status", "grant-spawn-budget", "interrupt", "resume", "steer", "stop", "append-step", "doctor", "watchdog.status", "watchdog.check", "watchdog.configure", "watchdog.recommend-model", "schedule", "schedule-list", "schedule-status", "schedule-cancel"] as const;
|
|
1115
1585
|
|
|
1116
1586
|
export const DEFAULT_FORK_PREAMBLE =
|
|
1117
1587
|
"You are a delegated subagent running from a fork of the parent session. " +
|
|
@@ -1196,10 +1666,11 @@ export function normalizeMaxSubagentSpawnsPerSession(value: unknown): number | u
|
|
|
1196
1666
|
return normalizeNonNegativeInteger(value);
|
|
1197
1667
|
}
|
|
1198
1668
|
|
|
1199
|
-
export function resolveMaxSubagentSpawnsPerSession(configMaxSpawns?: number): number {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1669
|
+
export function resolveMaxSubagentSpawnsPerSession(configMaxSpawns?: number): number | undefined {
|
|
1670
|
+
const envMaxSpawns = normalizeMaxSubagentSpawnsPerSession(process.env.SELESAI_SUBAGENT_MAX_SPAWNS_PER_SESSION);
|
|
1671
|
+
if (envMaxSpawns !== undefined) return envMaxSpawns === 0 ? undefined : envMaxSpawns;
|
|
1672
|
+
const configuredMaxSpawns = normalizeMaxSubagentSpawnsPerSession(configMaxSpawns);
|
|
1673
|
+
return configuredMaxSpawns === 0 ? undefined : configuredMaxSpawns;
|
|
1203
1674
|
}
|
|
1204
1675
|
|
|
1205
1676
|
// ============================================================================
|