@selesai/code 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.js +1 -1
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/sdk.js +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/extensions/ascii.txt +9 -0
- package/dist/extensions/package.json +1 -2
- package/dist/extensions/pi-hermes-memory/CHANGELOG.md +371 -0
- package/dist/extensions/pi-hermes-memory/LICENSE +21 -0
- package/dist/extensions/pi-hermes-memory/README.md +643 -0
- package/dist/extensions/pi-hermes-memory/docs/0.1/TASKS.md +197 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/PLAN.md +290 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/TASKS.md +134 -0
- package/dist/extensions/pi-hermes-memory/docs/0.2/TEST-PLAN.md +216 -0
- package/dist/extensions/pi-hermes-memory/docs/0.3/PLAN.md +330 -0
- package/dist/extensions/pi-hermes-memory/docs/0.3/TASKS.md +125 -0
- package/dist/extensions/pi-hermes-memory/docs/0.4/PLAN.md +160 -0
- package/dist/extensions/pi-hermes-memory/docs/0.4/TASKS.md +113 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/CHANGELOG.md +57 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/PLAN.md +202 -0
- package/dist/extensions/pi-hermes-memory/docs/0.6/TASKS.md +144 -0
- package/dist/extensions/pi-hermes-memory/docs/0.7/PLAN.md +349 -0
- package/dist/extensions/pi-hermes-memory/docs/0.7/TASKS.md +110 -0
- package/dist/extensions/pi-hermes-memory/docs/PUBLISHING.md +149 -0
- package/dist/extensions/pi-hermes-memory/docs/ROADMAP.md +468 -0
- package/dist/extensions/pi-hermes-memory/docs/images/memory-architecture.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi-logo.svg +22 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.png +0 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.svg +19 -0
- package/dist/extensions/pi-hermes-memory/docs/images/security-flow.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/session-lifecycle.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/images/source-architecture.svg +1 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/memory-architecture.mmd +49 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/security-flow.mmd +40 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/session-lifecycle.mmd +56 -0
- package/dist/extensions/pi-hermes-memory/docs/mermaid/source-architecture.mmd +54 -0
- package/dist/extensions/pi-hermes-memory/package-lock.json +3799 -0
- package/dist/extensions/pi-hermes-memory/package.json +66 -0
- package/dist/extensions/pi-hermes-memory/scripts/check-min-sdk.mjs +99 -0
- package/dist/extensions/pi-hermes-memory/scripts/ensure-dev.mjs +57 -0
- package/dist/extensions/pi-hermes-memory/src/auto-consolidation-warning.ts +6 -0
- package/dist/extensions/pi-hermes-memory/src/config.ts +178 -0
- package/dist/extensions/pi-hermes-memory/src/constants.ts +424 -0
- package/dist/extensions/pi-hermes-memory/src/extension-root-migration.ts +639 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/auto-consolidate.ts +401 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/background-review.ts +297 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/child-process-watchdog.mjs +90 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/correction-detector.ts +300 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/index-sessions.ts +86 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/insights.ts +78 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/interview.ts +37 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/learn-memory.ts +186 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/message-parts.ts +27 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/pi-child-process.ts +485 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/preview-context.ts +105 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/review-memory-ops.ts +506 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-backfill.ts +145 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-flush.ts +151 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/session-live-index.ts +94 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/skills-command.ts +1334 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/standing-pin.ts +111 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/switch-project.ts +75 -0
- package/dist/extensions/pi-hermes-memory/src/handlers/sync-markdown-memories.ts +266 -0
- package/dist/extensions/pi-hermes-memory/src/index.ts +378 -0
- package/dist/extensions/pi-hermes-memory/src/lifecycle-timing.ts +54 -0
- package/dist/extensions/pi-hermes-memory/src/paths.ts +61 -0
- package/dist/extensions/pi-hermes-memory/src/project-context.ts +13 -0
- package/dist/extensions/pi-hermes-memory/src/project-memory-migration.ts +93 -0
- package/dist/extensions/pi-hermes-memory/src/project.ts +157 -0
- package/dist/extensions/pi-hermes-memory/src/prompt-context.ts +55 -0
- package/dist/extensions/pi-hermes-memory/src/store/atomic-lock-coordinator.ts +375 -0
- package/dist/extensions/pi-hermes-memory/src/store/canonical-storage-path.ts +54 -0
- package/dist/extensions/pi-hermes-memory/src/store/content-scanner.ts +101 -0
- package/dist/extensions/pi-hermes-memory/src/store/db.ts +1180 -0
- package/dist/extensions/pi-hermes-memory/src/store/fts-query.ts +101 -0
- package/dist/extensions/pi-hermes-memory/src/store/markdown-mutation-lock.ts +38 -0
- package/dist/extensions/pi-hermes-memory/src/store/memory-lookup.ts +24 -0
- package/dist/extensions/pi-hermes-memory/src/store/memory-store.ts +1191 -0
- package/dist/extensions/pi-hermes-memory/src/store/recovery-maintenance.ts +66 -0
- package/dist/extensions/pi-hermes-memory/src/store/schema.ts +118 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-anchor-search.ts +472 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-indexer.ts +511 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-parser.ts +213 -0
- package/dist/extensions/pi-hermes-memory/src/store/session-search.ts +234 -0
- package/dist/extensions/pi-hermes-memory/src/store/skill-store.ts +950 -0
- package/dist/extensions/pi-hermes-memory/src/store/skill-utils.ts +133 -0
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-memory-store.ts +1002 -0
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-native.ts +241 -0
- package/dist/extensions/pi-hermes-memory/src/store/standing-instructions.ts +247 -0
- package/dist/extensions/pi-hermes-memory/src/tools/memory-search-tool.ts +95 -0
- package/dist/extensions/pi-hermes-memory/src/tools/memory-tool.ts +469 -0
- package/dist/extensions/pi-hermes-memory/src/tools/session-search-tool.ts +246 -0
- package/dist/extensions/pi-hermes-memory/src/tools/shared-output-view.ts +170 -0
- package/dist/extensions/pi-hermes-memory/src/tools/skill-tool.ts +333 -0
- package/dist/extensions/pi-hermes-memory/src/tools/tool-result-views.ts +105 -0
- package/dist/extensions/pi-hermes-memory/src/types.ts +214 -0
- package/dist/extensions/pi-hermes-memory/tests/config.test.ts +434 -0
- package/dist/extensions/pi-hermes-memory/tests/extension-root-migration.test.ts +368 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/auto-consolidate.test.ts +984 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/background-review.test.ts +950 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/correction-detector.test.ts +671 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/insights.test.ts +157 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/interview.test.ts +127 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/pi-child-process.test.ts +905 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/preview-context.test.ts +152 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/prompt-context.test.ts +166 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/resources-discover.test.ts +71 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/review-memory-ops.test.ts +614 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-backfill.test.ts +192 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-flush.test.ts +677 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-live-index.test.ts +225 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/skills-command.test.ts +827 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/standing-pin.test.ts +134 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/sync-markdown-memories.test.ts +491 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/system-prompt.test.ts +199 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/thinking-max.test.ts +64 -0
- package/dist/extensions/pi-hermes-memory/tests/index.test.ts +30 -0
- package/dist/extensions/pi-hermes-memory/tests/integration/flow.test.ts +126 -0
- package/dist/extensions/pi-hermes-memory/tests/lifecycle-timing.test.ts +76 -0
- package/dist/extensions/pi-hermes-memory/tests/paths.test.ts +23 -0
- package/dist/extensions/pi-hermes-memory/tests/project-memory-migration.test.ts +80 -0
- package/dist/extensions/pi-hermes-memory/tests/project-rebinding.test.ts +115 -0
- package/dist/extensions/pi-hermes-memory/tests/project.test.ts +120 -0
- package/dist/extensions/pi-hermes-memory/tests/run-all-timeout.test.ts +107 -0
- package/dist/extensions/pi-hermes-memory/tests/run-all.sh +45 -0
- package/dist/extensions/pi-hermes-memory/tests/store/atomic-lock-coordinator.test.ts +381 -0
- package/dist/extensions/pi-hermes-memory/tests/store/content-scanner.test.ts +388 -0
- package/dist/extensions/pi-hermes-memory/tests/store/db.test.ts +1046 -0
- package/dist/extensions/pi-hermes-memory/tests/store/markdown-mutation-lock.test.ts +34 -0
- package/dist/extensions/pi-hermes-memory/tests/store/memory-store.test.ts +2150 -0
- package/dist/extensions/pi-hermes-memory/tests/store/recovery-maintenance.test.ts +170 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-anchor-search.test.ts +210 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-indexer.test.ts +643 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-parser.test.ts +282 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-search.test.ts +287 -0
- package/dist/extensions/pi-hermes-memory/tests/store/skill-store.test.ts +678 -0
- package/dist/extensions/pi-hermes-memory/tests/store/skill-utils.test.ts +21 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-lazy-load.test.ts +78 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-memory-store.test.ts +543 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-native.test.ts +164 -0
- package/dist/extensions/pi-hermes-memory/tests/store/standing-instructions.test.ts +171 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-search-tool.test.ts +84 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-tool.test.ts +709 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/session-search-tool.test.ts +345 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/shared-output-view.test.ts +362 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/skill-tool.test.ts +478 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/tool-result-renderer-wiring.test.ts +40 -0
- package/dist/extensions/pi-hermes-memory/tsconfig.json +19 -0
- package/dist/extensions/pi-subagents/.oxlintrc.json +43 -0
- package/dist/extensions/pi-subagents/AGENTS.md +5 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +157 -0
- package/dist/extensions/pi-subagents/README.md +12 -6
- package/dist/extensions/pi-subagents/VISION.md +81 -0
- package/dist/extensions/pi-subagents/agents/claude-code-writer.md +15 -0
- package/dist/extensions/pi-subagents/agents/claude-code.md +15 -0
- package/dist/extensions/pi-subagents/agents/codex-exec-writer.md +15 -0
- package/dist/extensions/pi-subagents/agents/codex-exec.md +15 -0
- package/dist/extensions/pi-subagents/agents/cursor-agent-writer.md +14 -0
- package/dist/extensions/pi-subagents/agents/cursor-agent.md +14 -0
- package/dist/extensions/pi-subagents/agents/reviewer.md +1 -3
- package/dist/extensions/pi-subagents/docs/agents.md +488 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +46 -9
- package/dist/extensions/pi-subagents/docs/extension-api.md +42 -3
- package/dist/extensions/pi-subagents/docs/models.md +27 -4
- package/dist/extensions/pi-subagents/docs/observability.md +10 -9
- package/dist/extensions/pi-subagents/docs/tool-reference.md +102 -6
- package/dist/extensions/pi-subagents/docs/workflows.md +135 -0
- package/dist/extensions/pi-subagents/package-lock.json +389 -2
- package/dist/extensions/pi-subagents/package.json +3 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +2 -2
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +3 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +7 -3
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +2 -2
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +26 -5
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +41 -22
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +4 -4
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +9 -2
- package/dist/extensions/pi-subagents/src/agents/agents.ts +322 -75
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +6 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-events.ts +70 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +27 -20
- package/dist/extensions/pi-subagents/src/api/agents.ts +10 -5
- package/dist/extensions/pi-subagents/src/api/background-work.ts +5 -1
- package/dist/extensions/pi-subagents/src/api/delegation.ts +0 -7
- package/dist/extensions/pi-subagents/src/api/preflight.ts +34 -12
- package/dist/extensions/pi-subagents/src/extension/config.ts +70 -0
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +3 -3
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +5 -3
- package/dist/extensions/pi-subagents/src/extension/index.ts +83 -30
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +44 -15
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +55 -19
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +41 -15
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +28 -31
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +2 -1
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +2 -10
- package/dist/extensions/pi-subagents/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +51 -3
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +2 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +5 -6
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +77 -10
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +176 -53
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +19 -12
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +29 -27
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +20 -3
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +23 -261
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +73 -7
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +8 -3
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +74 -8
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +37 -21
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +8 -8
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +184 -9
- package/dist/extensions/pi-subagents/src/runs/background/result-delivery-ownership.ts +45 -0
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +28 -14
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +38 -15
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +50 -13
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +93 -8
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +10 -4
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +4 -14
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +549 -377
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +58 -10
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +26 -1
- package/dist/extensions/pi-subagents/src/runs/background/wait-config.ts +23 -9
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +9 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +204 -129
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +9 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +23 -1
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +773 -311
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +140 -115
- package/dist/extensions/pi-subagents/src/runs/shared/abort-recovery.ts +119 -0
- package/dist/extensions/pi-subagents/src/runs/shared/async-status-projection.ts +463 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +19 -4
- package/dist/extensions/pi-subagents/src/runs/shared/child-launch-plan.ts +151 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +21 -7
- package/dist/extensions/pi-subagents/src/runs/shared/claude-code-adapter.ts +129 -0
- package/dist/extensions/pi-subagents/src/runs/shared/codex-exec-adapter.ts +129 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-evidence.ts +89 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +5 -4
- package/dist/extensions/pi-subagents/src/runs/shared/cursor-agent-adapter.ts +114 -0
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-contract.ts +167 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-preflight.ts +122 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +348 -55
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +5 -5
- package/dist/extensions/pi-subagents/src/runs/shared/host-step-status.ts +230 -0
- package/dist/extensions/pi-subagents/src/runs/shared/lane-metadata.ts +105 -0
- package/dist/extensions/pi-subagents/src/runs/shared/launch-cwd.ts +16 -0
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +2 -1
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-config-sources.ts +422 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +221 -158
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-grant.ts +197 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +69 -7
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +47 -6
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +7 -2
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +9 -3
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +9 -5
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +419 -7
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +15 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +81 -8
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +13 -0
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +21 -1
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +44 -4
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +98 -13
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +847 -0
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +18 -0
- package/dist/extensions/pi-subagents/src/shared/child-session-name.ts +46 -0
- package/dist/extensions/pi-subagents/src/shared/extension-context.ts +24 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +21 -0
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +18 -3
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +5 -1
- package/dist/extensions/pi-subagents/src/shared/pruned-fork.ts +450 -0
- package/dist/extensions/pi-subagents/src/shared/session-file-trust.ts +19 -0
- package/dist/extensions/pi-subagents/src/shared/session-tokens.ts +14 -3
- package/dist/extensions/pi-subagents/src/shared/settings.ts +19 -105
- package/dist/extensions/pi-subagents/src/shared/shortcuts.ts +17 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +359 -40
- package/dist/extensions/pi-subagents/src/shared/utils.ts +41 -84
- package/dist/extensions/pi-subagents/src/shared/workflow-child-permit.ts +116 -0
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +1 -9
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +0 -4
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +1 -2
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +378 -88
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +22 -11
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +3 -0
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +147 -79
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +11 -5
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +39 -18
- package/dist/extensions/pi-subagents/src/tui/render.ts +369 -46
- package/dist/extensions/pi-subagents/src/watchdog/turn-delta.ts +1 -1
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +6 -3
- package/dist/extensions/pi-subagents/src/workflows/host-command.ts +230 -0
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +740 -58
- package/dist/extensions/pi-subagents/src/workflows/workflow-child-summary.ts +121 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-preflight.ts +270 -0
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +195 -6
- package/dist/extensions/pi-subagents/src/workflows/workflow-settlement.ts +246 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1114 -260
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +150 -3
- package/dist/extensions/pi-subagents/test/integration/claude-code-smoke.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/integration/claude-code-writer-smoke.test.ts +55 -0
- package/dist/extensions/pi-subagents/test/integration/codex-exec-smoke.test.ts +53 -0
- package/dist/extensions/pi-subagents/test/integration/codex-exec-writer-smoke.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/integration/cursor-agent-smoke.test.ts +59 -0
- package/dist/extensions/pi-subagents/test/integration/cursor-agent-writer-smoke.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +57 -1
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +20 -0
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +4 -3
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +54 -4
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +482 -4
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +157 -9
- package/dist/extensions/pi-subagents/test/integration/session-tokens.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +1508 -291
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +423 -1
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +8 -0
- package/dist/extensions/pi-subagents/test/support/cursor-smoke-inputs.ts +51 -0
- package/dist/extensions/pi-subagents/test/support/helpers.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +5 -5
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/abort-recovery.test.ts +152 -0
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +48 -0
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +184 -6
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +66 -6
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +77 -0
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +18 -0
- package/dist/extensions/pi-subagents/test/unit/anti-slop-oxlint.test.ts +86 -0
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +101 -1
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +121 -0
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +28 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +14 -7
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +53 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-projection.test.ts +190 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-snapshot.test.ts +42 -0
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +8 -4
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +23 -0
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +78 -1
- package/dist/extensions/pi-subagents/test/unit/child-launch-plan.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/child-session-name.test.ts +50 -0
- package/dist/extensions/pi-subagents/test/unit/claude-code-adapter.test.ts +245 -0
- package/dist/extensions/pi-subagents/test/unit/codex-exec-adapter.test.ts +192 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/completion-evidence.test.ts +150 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/cursor-agent-adapter.test.ts +259 -0
- package/dist/extensions/pi-subagents/test/unit/cursor-smoke-inputs.test.ts +77 -0
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +1 -4
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/extension-context.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +223 -0
- package/dist/extensions/pi-subagents/test/unit/fast-mode-extension.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +208 -2
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +29 -1
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +110 -1
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +10 -0
- package/dist/extensions/pi-subagents/test/unit/formatters.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +18 -9
- package/dist/extensions/pi-subagents/test/unit/herdr-session-roots-codec.test.ts +63 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-shell-command.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +132 -0
- package/dist/extensions/pi-subagents/test/unit/host-command.test.ts +156 -0
- package/dist/extensions/pi-subagents/test/unit/host-step-status.test.ts +98 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +178 -26
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +2 -1
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/mcp-direct-tool-grant.test.ts +138 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +91 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +72 -7
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +20 -2
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +129 -1
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +4 -0
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +358 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +574 -21
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +109 -1
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +71 -1
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/pruned-fork.test.ts +214 -0
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +29 -8
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +53 -0
- package/dist/extensions/pi-subagents/test/unit/result-delivery-ownership.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +101 -3
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +10 -8
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +71 -1
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +41 -7
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +136 -2
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +137 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +33 -12
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +504 -1
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +8 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +12 -1
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +3 -5
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +5 -6
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +0 -8
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +5 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +157 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +63 -4
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +27 -23
- package/dist/extensions/pi-subagents/test/unit/wait-completions.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +7 -5
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +106 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +484 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +38 -4
- package/dist/extensions/pi-subagents/test/unit/workflow-preflight.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +318 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-resume-hint.test.ts +365 -0
- package/dist/extensions/pi-subagents/test/unit/worktree-cleanup-plan.test.ts +349 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +21 -0
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +2 -7
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/index.ts +13 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +52 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/index.ts +41 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +77 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +49 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +247 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-module-mocking.ts +91 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-object-parameters.ts +126 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +28 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-get.ts +28 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +67 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +39 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +83 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +115 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +72 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +134 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +366 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +62 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/dictionary-types.ts +502 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +60 -0
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/reflect-method.ts +35 -0
- package/dist/extensions/pi-tool-display/tests/capabilities.test.ts +1 -1
- package/dist/extensions/pi-tool-display/tests/settings-inspector.test.ts +2 -2
- package/dist/extensions/pi-tool-display/tests/tool-overrides-mcp.test.ts +1 -1
- package/dist/modes/interactive/interactive-mode.js +7 -7
- package/dist/skills/workflow/SKILL.md +65 -50
- package/package.json +112 -110
- package/dist/extensions/enable-readonly-tools.test.ts +0 -63
- package/dist/extensions/enable-readonly-tools.ts +0 -24
- package/dist/extensions/model-prompt-injector/config.json +0 -16
- package/dist/extensions/model-prompt-injector/index.test.ts +0 -102
- package/dist/extensions/model-prompt-injector/index.ts +0 -148
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +0 -250
|
@@ -14,6 +14,7 @@ import type { AuthorityPolicyConfig } from "../policy/authority.ts";
|
|
|
14
14
|
import type { ThinkingLevel } from "./model-info.ts";
|
|
15
15
|
import type { GlobalMissionIndexRecord, MissionRecord, MissionStoreConfig } from "../missions/types.ts";
|
|
16
16
|
import type { ExtensionBindings } from "../runs/shared/extension-bindings.ts";
|
|
17
|
+
import type { WorkflowChildPermitContext } from "./workflow-child-permit.ts";
|
|
17
18
|
|
|
18
19
|
// ============================================================================
|
|
19
20
|
// Basic Types
|
|
@@ -39,11 +40,43 @@ export interface ChainOutputMapEntry {
|
|
|
39
40
|
|
|
40
41
|
export type ChainOutputMap = Record<string, ChainOutputMapEntry>;
|
|
41
42
|
|
|
42
|
-
export type WorkflowNodeStatus = "pending" | "running" | "completed" | "failed" | "paused" | "stopped" | "detached" | "rejected";
|
|
43
|
+
export type WorkflowNodeStatus = "pending" | "running" | "completed" | "failed" | "partial" | "paused" | "stopped" | "detached" | "rejected";
|
|
44
|
+
|
|
45
|
+
export type HostStepMonitorKind = "command" | "ci" | "gate";
|
|
46
|
+
export type HostStepState = "pending" | "running" | "done" | "cancelled" | "error";
|
|
47
|
+
export type HostStepVerdict = "pass" | "fail" | "inconclusive";
|
|
48
|
+
|
|
49
|
+
export interface HostStepFreshnessV1 {
|
|
50
|
+
expectedRef: string;
|
|
51
|
+
observedRef?: string;
|
|
52
|
+
stale?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Bounded, provider-agnostic status for a host-owned workflow monitor. */
|
|
56
|
+
export interface HostStepNodeV1 {
|
|
57
|
+
version: 1;
|
|
58
|
+
kind: "host-step";
|
|
59
|
+
/** Explicit monitor category; never inferred from labels or commands. */
|
|
60
|
+
monitorKind: HostStepMonitorKind;
|
|
61
|
+
id: string;
|
|
62
|
+
label: string;
|
|
63
|
+
role?: string;
|
|
64
|
+
provider?: string;
|
|
65
|
+
state: HostStepState;
|
|
66
|
+
verdict?: HostStepVerdict;
|
|
67
|
+
reasonCode?: string;
|
|
68
|
+
detail?: string;
|
|
69
|
+
target?: string;
|
|
70
|
+
freshness?: HostStepFreshnessV1;
|
|
71
|
+
reportPath?: string;
|
|
72
|
+
exitCode?: number | null;
|
|
73
|
+
updatedAt: number;
|
|
74
|
+
deadlineAt?: number;
|
|
75
|
+
}
|
|
43
76
|
|
|
44
77
|
export interface WorkflowGraphNode {
|
|
45
78
|
id: string;
|
|
46
|
-
kind: "step" | "parallel-group" | "dynamic-parallel-group" | "agent";
|
|
79
|
+
kind: "step" | "parallel-group" | "dynamic-parallel-group" | "agent" | "host-step";
|
|
47
80
|
agent?: string;
|
|
48
81
|
phase?: string;
|
|
49
82
|
label: string;
|
|
@@ -63,6 +96,7 @@ export interface WorkflowGraphNode {
|
|
|
63
96
|
structured?: boolean;
|
|
64
97
|
acceptanceStatus?: AcceptanceLedgerStatus;
|
|
65
98
|
error?: string;
|
|
99
|
+
hostStep?: HostStepNodeV1;
|
|
66
100
|
}
|
|
67
101
|
|
|
68
102
|
export interface WorkflowGraphSnapshot {
|
|
@@ -73,18 +107,89 @@ export interface WorkflowGraphSnapshot {
|
|
|
73
107
|
currentNodeId?: string;
|
|
74
108
|
}
|
|
75
109
|
|
|
110
|
+
export type WorkflowPreflightCoverage = "complete" | "partial";
|
|
111
|
+
export type WorkflowPreflightMode = "mutation" | "review" | "scout" | "gate";
|
|
112
|
+
|
|
113
|
+
/** Bounded, display-only lane hints supplied alongside a workflowScript launch. */
|
|
114
|
+
export interface WorkflowPreflightLaneV1 {
|
|
115
|
+
key: string;
|
|
116
|
+
mode?: WorkflowPreflightMode;
|
|
117
|
+
decision?: string;
|
|
118
|
+
claims?: string[];
|
|
119
|
+
expectedOutput?: string;
|
|
120
|
+
independence?: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Versioned, display-only workflow launch plan; it never grants launch authority. */
|
|
124
|
+
export interface WorkflowPreflightV1 {
|
|
125
|
+
version: 1;
|
|
126
|
+
coverage: WorkflowPreflightCoverage;
|
|
127
|
+
lanes: WorkflowPreflightLaneV1[];
|
|
128
|
+
}
|
|
129
|
+
|
|
76
130
|
export type WorkflowReceiptState = "complete" | "failed" | "paused" | "stopped";
|
|
77
131
|
|
|
132
|
+
export type WorkflowTerminalResolution = "settled-awaiting-resume" | "failed-child" | "interrupted-child";
|
|
133
|
+
|
|
134
|
+
export interface WorkflowTerminalOutcome {
|
|
135
|
+
state: "partial";
|
|
136
|
+
reason: "budget_exhausted" | "timeout";
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface WorkflowRecoveryAction {
|
|
140
|
+
key: string;
|
|
141
|
+
call: "runs.run";
|
|
142
|
+
resume: { workflowRunId: string; key: string; latest: true };
|
|
143
|
+
taskRequired: true;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Bounded, launch-declared workflow lane metadata. This is display and
|
|
148
|
+
* triage information only; capability ceilings, authorization, and cleanup
|
|
149
|
+
* safety remain owned by their existing enforcement and handoff paths.
|
|
150
|
+
*/
|
|
151
|
+
export type WorkflowLaneMode = "mutation" | "review" | "scout" | "gate";
|
|
152
|
+
|
|
153
|
+
export interface WorkflowLaneMetadata {
|
|
154
|
+
version: 1;
|
|
155
|
+
key: string;
|
|
156
|
+
mode?: WorkflowLaneMode;
|
|
157
|
+
sourceRef?: string;
|
|
158
|
+
claims?: string[];
|
|
159
|
+
outputPaths?: string[];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface WorkflowChildSummaryV1 {
|
|
163
|
+
version: 1;
|
|
164
|
+
parentToolCallId: string;
|
|
165
|
+
workflowRunId: string;
|
|
166
|
+
inventoryComplete: boolean;
|
|
167
|
+
workflowState: "queued" | "running" | "completed" | "failed" | "paused" | "stopped";
|
|
168
|
+
children: Array<{
|
|
169
|
+
childId: string;
|
|
170
|
+
runId?: string;
|
|
171
|
+
agent?: string;
|
|
172
|
+
/** Human-readable display name for the child session, when derived at launch. */
|
|
173
|
+
sessionName?: string;
|
|
174
|
+
model?: string;
|
|
175
|
+
thinking?: string;
|
|
176
|
+
state: "pending" | "running" | "completed" | "failed" | "paused" | "stopped" | "rejected" | "detached";
|
|
177
|
+
}>;
|
|
178
|
+
}
|
|
179
|
+
|
|
78
180
|
type WorkflowReceiptEntryResumability =
|
|
79
181
|
| { latestRunId: string; resumability: { state: "resumable" } }
|
|
80
182
|
| { latestRunId?: string; resumability: { state: "not-resumable"; reason: string } };
|
|
81
183
|
|
|
82
184
|
export type WorkflowReceiptEntry = WorkflowReceiptEntryResumability & {
|
|
83
185
|
key: string;
|
|
186
|
+
lane?: WorkflowLaneMetadata;
|
|
187
|
+
terminalOutcome?: WorkflowTerminalOutcome;
|
|
84
188
|
agent?: string;
|
|
85
189
|
requestedContext?: "fresh" | "fork";
|
|
86
190
|
resolvedContext?: "fresh" | "fork" | "mixed";
|
|
87
191
|
outputReference?: string;
|
|
192
|
+
externalAdapter?: ExternalCliReceiptMetadata;
|
|
88
193
|
continuation: { runIds: string[] };
|
|
89
194
|
};
|
|
90
195
|
|
|
@@ -94,6 +199,11 @@ export interface WorkflowReceipt {
|
|
|
94
199
|
state: WorkflowReceiptState;
|
|
95
200
|
createdAt: number;
|
|
96
201
|
entries: Record<string, WorkflowReceiptEntry>;
|
|
202
|
+
hostSteps?: HostStepNodeV1[];
|
|
203
|
+
workflowChildren?: WorkflowChildSummaryV1;
|
|
204
|
+
workflowResolution?: WorkflowTerminalResolution;
|
|
205
|
+
terminalOutcome?: WorkflowTerminalOutcome;
|
|
206
|
+
recovery?: WorkflowRecoveryAction[];
|
|
97
207
|
}
|
|
98
208
|
|
|
99
209
|
export interface SavedOutputReference {
|
|
@@ -120,16 +230,6 @@ export interface Usage {
|
|
|
120
230
|
turns: number;
|
|
121
231
|
}
|
|
122
232
|
|
|
123
|
-
export interface TurnBudgetConfig {
|
|
124
|
-
maxTurns: number;
|
|
125
|
-
graceTurns?: number;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface ResolvedTurnBudget {
|
|
129
|
-
maxTurns: number;
|
|
130
|
-
graceTurns: number;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
233
|
export interface ToolBudgetConfig {
|
|
134
234
|
soft?: number;
|
|
135
235
|
hard: number;
|
|
@@ -152,9 +252,19 @@ export interface ToolBudgetState extends ResolvedToolBudget {
|
|
|
152
252
|
blockedTool?: string;
|
|
153
253
|
}
|
|
154
254
|
|
|
255
|
+
/**
|
|
256
|
+
* @deprecated Turn budgets are no longer accepted as launch configuration or
|
|
257
|
+
* enforced. Retained only to decode historical persisted status and result data.
|
|
258
|
+
*/
|
|
155
259
|
export type TurnBudgetOutcome = "within-budget" | "wrap-up-requested" | "termination-deferred" | "exceeded";
|
|
156
260
|
|
|
157
|
-
|
|
261
|
+
/**
|
|
262
|
+
* @deprecated Historical persisted turn-budget state. New runs do not produce
|
|
263
|
+
* this field, but status readers retain it for backwards compatibility.
|
|
264
|
+
*/
|
|
265
|
+
export interface TurnBudgetState {
|
|
266
|
+
maxTurns: number;
|
|
267
|
+
graceTurns: number;
|
|
158
268
|
outcome: TurnBudgetOutcome;
|
|
159
269
|
turnCount: number;
|
|
160
270
|
wrapUpRequestedAtTurn?: number;
|
|
@@ -166,6 +276,10 @@ export interface TokenUsage {
|
|
|
166
276
|
input: number;
|
|
167
277
|
output: number;
|
|
168
278
|
total: number;
|
|
279
|
+
/** Input plus cache-read tokens for the latest assistant turn. */
|
|
280
|
+
window?: number;
|
|
281
|
+
/** Largest window observed in this usage scope. */
|
|
282
|
+
windowPeak?: number;
|
|
169
283
|
}
|
|
170
284
|
|
|
171
285
|
export type ActivityState = "active_long_running" | "needs_attention";
|
|
@@ -216,6 +330,8 @@ export interface CompletionBatchConfig {
|
|
|
216
330
|
|
|
217
331
|
export interface WaitToolConfigObject {
|
|
218
332
|
enabled?: boolean;
|
|
333
|
+
/** Default blocking window for subagent_wait calls that omit timeoutMs. */
|
|
334
|
+
defaultTimeoutMs?: number;
|
|
219
335
|
}
|
|
220
336
|
|
|
221
337
|
export type WaitToolConfig = boolean | WaitToolConfigObject;
|
|
@@ -266,6 +382,11 @@ export interface ParallelHandoffChild {
|
|
|
266
382
|
index: number;
|
|
267
383
|
taskIndex: number;
|
|
268
384
|
agent: string;
|
|
385
|
+
/** Stable workflow identity used to join status/receipt metadata. */
|
|
386
|
+
workflowKey?: string;
|
|
387
|
+
/** Child run id when the worktree belongs to a workflow child. */
|
|
388
|
+
runId?: string;
|
|
389
|
+
lane?: WorkflowLaneMetadata;
|
|
269
390
|
status: SubagentResultStatus;
|
|
270
391
|
summary: string;
|
|
271
392
|
outputPath?: string;
|
|
@@ -275,6 +396,15 @@ export interface ParallelHandoffChild {
|
|
|
275
396
|
patch: ParallelHandoffPatch;
|
|
276
397
|
}
|
|
277
398
|
|
|
399
|
+
/** Launch-time identity retained while a handoff group has no terminal child rows yet. */
|
|
400
|
+
export interface ParallelHandoffLaneBinding {
|
|
401
|
+
index: number;
|
|
402
|
+
taskIndex: number;
|
|
403
|
+
workflowKey?: string;
|
|
404
|
+
runId?: string;
|
|
405
|
+
lane?: WorkflowLaneMetadata;
|
|
406
|
+
}
|
|
407
|
+
|
|
278
408
|
export interface ParallelHandoffCleanupTask {
|
|
279
409
|
index: number;
|
|
280
410
|
path: string;
|
|
@@ -286,11 +416,38 @@ export interface ParallelHandoffCleanupTask {
|
|
|
286
416
|
errors?: string[];
|
|
287
417
|
}
|
|
288
418
|
|
|
419
|
+
export type CleanupEligibility =
|
|
420
|
+
| { state: "active" }
|
|
421
|
+
| { state: "terminal-eligible" }
|
|
422
|
+
| { state: "terminal-blocked"; reason: string }
|
|
423
|
+
| { state: "superseded-eligible" }
|
|
424
|
+
| { state: "unknown" };
|
|
425
|
+
|
|
426
|
+
export interface ParallelHandoffMergeEvidence {
|
|
427
|
+
prNumber: number;
|
|
428
|
+
reviewedHead: string;
|
|
429
|
+
mergeCommit: string;
|
|
430
|
+
treeEquivalent: boolean | "unknown";
|
|
431
|
+
postMergeChecks: "recorded" | "unknown";
|
|
432
|
+
attestedBy: string;
|
|
433
|
+
attestedAt: string;
|
|
434
|
+
manifestDigest?: string;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export interface ParallelHandoffSupersessionEvidence {
|
|
438
|
+
supersededBy: string;
|
|
439
|
+
attestedBy: string;
|
|
440
|
+
attestedAt: string;
|
|
441
|
+
manifestDigest?: string;
|
|
442
|
+
}
|
|
443
|
+
|
|
289
444
|
export interface ParallelHandoffGroup {
|
|
290
445
|
stepIndex: number;
|
|
291
446
|
baseCommit: string;
|
|
292
447
|
repoRoot: string;
|
|
293
448
|
children: ParallelHandoffChild[];
|
|
449
|
+
/** Optional launch identities for pending groups before child results settle. */
|
|
450
|
+
laneBindings?: ParallelHandoffLaneBinding[];
|
|
294
451
|
cleanup: {
|
|
295
452
|
state: "complete" | "partial";
|
|
296
453
|
tasks: ParallelHandoffCleanupTask[];
|
|
@@ -308,6 +465,9 @@ export interface ParallelHandoffManifest {
|
|
|
308
465
|
createdAt: number;
|
|
309
466
|
updatedAt: number;
|
|
310
467
|
groups: ParallelHandoffGroup[];
|
|
468
|
+
merge?: ParallelHandoffMergeEvidence;
|
|
469
|
+
supersession?: ParallelHandoffSupersessionEvidence;
|
|
470
|
+
cleanupEligibility?: CleanupEligibility;
|
|
311
471
|
}
|
|
312
472
|
|
|
313
473
|
export interface ParallelHandoffReference {
|
|
@@ -317,6 +477,7 @@ export interface ParallelHandoffReference {
|
|
|
317
477
|
childCount: number;
|
|
318
478
|
changedPatches: number;
|
|
319
479
|
cleanupState: "complete" | "partial";
|
|
480
|
+
cleanupEligibility?: CleanupEligibility;
|
|
320
481
|
}
|
|
321
482
|
|
|
322
483
|
export interface AgentContract {
|
|
@@ -325,7 +486,7 @@ export interface AgentContract {
|
|
|
325
486
|
|
|
326
487
|
export type ChainGateLayer = "execution" | "acceptance";
|
|
327
488
|
|
|
328
|
-
export type ExecutionProjectionStatus = "completed" | "failed" | "paused" | "stopped" | "detached";
|
|
489
|
+
export type ExecutionProjectionStatus = "completed" | "failed" | "partial" | "paused" | "stopped" | "detached";
|
|
329
490
|
|
|
330
491
|
export interface ExecutionProjection {
|
|
331
492
|
status: ExecutionProjectionStatus;
|
|
@@ -352,8 +513,24 @@ export interface FileMutationEffect {
|
|
|
352
513
|
evidence?: TrackedMutationEvidence;
|
|
353
514
|
}
|
|
354
515
|
|
|
516
|
+
export interface SettlementDiagnostic {
|
|
517
|
+
finalTextPresent: boolean;
|
|
518
|
+
mutation: {
|
|
519
|
+
expected: boolean;
|
|
520
|
+
attempted: boolean;
|
|
521
|
+
observed: boolean;
|
|
522
|
+
};
|
|
523
|
+
requiredOutput?: {
|
|
524
|
+
kind: "file-only" | "structured";
|
|
525
|
+
path: string;
|
|
526
|
+
missing: boolean;
|
|
527
|
+
};
|
|
528
|
+
afterCompactionSettlement?: boolean;
|
|
529
|
+
}
|
|
530
|
+
|
|
355
531
|
export interface EffectsProjection {
|
|
356
532
|
fileMutation?: FileMutationEffect;
|
|
533
|
+
settlementDiagnostic?: SettlementDiagnostic;
|
|
357
534
|
}
|
|
358
535
|
|
|
359
536
|
export interface TrackedMutationSnapshot {
|
|
@@ -579,12 +756,15 @@ export interface SteeringRecoveryDescriptor {
|
|
|
579
756
|
thinking?: string;
|
|
580
757
|
thinkingCeiling?: ThinkingLevel;
|
|
581
758
|
tools?: string[];
|
|
759
|
+
allowNestedSubagents?: boolean;
|
|
582
760
|
extensions?: string[];
|
|
583
761
|
subagentOnlyExtensions?: string[];
|
|
584
762
|
mcpDirectTools?: string[];
|
|
763
|
+
mutationTools?: string[];
|
|
585
764
|
systemPrompt?: string;
|
|
586
765
|
systemPromptMode: "append" | "replace";
|
|
587
766
|
inheritProjectContext: boolean;
|
|
767
|
+
inheritGlobalContext: boolean;
|
|
588
768
|
inheritSkills: boolean;
|
|
589
769
|
skills?: string[];
|
|
590
770
|
skillPath?: string[];
|
|
@@ -600,8 +780,8 @@ export interface SteeringRecoveryDescriptor {
|
|
|
600
780
|
context?: "fresh" | "fork";
|
|
601
781
|
/** Raw per-run bridge override. Omitted descriptors continue to use global config. */
|
|
602
782
|
intercomBridge?: IntercomBridgeConfig;
|
|
783
|
+
lane?: WorkflowLaneMetadata;
|
|
603
784
|
absoluteDeadlineAt?: number;
|
|
604
|
-
initialTurnBudget?: ResolvedTurnBudget;
|
|
605
785
|
initialToolBudget?: ResolvedToolBudget;
|
|
606
786
|
maxSubagentDepth: number;
|
|
607
787
|
maxOutput?: MaxOutputConfig;
|
|
@@ -615,7 +795,7 @@ export interface SteeringRecoveryDescriptor {
|
|
|
615
795
|
|
|
616
796
|
export type PublicNestedStepSummary = Pick<
|
|
617
797
|
NestedStepSummary,
|
|
618
|
-
"agent" | "status" | "model" | "thinking" | "sessionFile" | "transcriptPath" | "transcriptError" | "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount" | "toolBudget" | "toolBudgetBlocked" | "startedAt" | "endedAt" | "error" | "timedOut" | "stopped"
|
|
798
|
+
"agent" | "sessionName" | "status" | "model" | "thinking" | "sessionFile" | "transcriptPath" | "transcriptError" | "activityState" | "lastActivityAt" | "currentTool" | "currentToolStartedAt" | "currentPath" | "turnCount" | "toolCount" | "toolBudget" | "toolBudgetBlocked" | "startedAt" | "endedAt" | "error" | "timedOut" | "stopped"
|
|
619
799
|
> & {
|
|
620
800
|
children?: PublicNestedRunSummary[];
|
|
621
801
|
};
|
|
@@ -628,7 +808,7 @@ export type CostSummary = {
|
|
|
628
808
|
|
|
629
809
|
export type PublicNestedRunSummary = Pick<
|
|
630
810
|
NestedRunSummary,
|
|
631
|
-
"id" | "parentRunId" | "parentStepIndex" | "parentAgent" | "depth" | "path" | "asyncDir" | "sessionId" | "sessionFile" | "intercomTarget" | "ownerIntercomTarget" | "leafIntercomTarget" | "ownerState" | "mode" | "state" | "agent" | "agents" | "model" | "thinking" | "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"
|
|
811
|
+
"id" | "parentRunId" | "parentStepIndex" | "parentAgent" | "depth" | "path" | "asyncDir" | "sessionId" | "sessionFile" | "intercomTarget" | "ownerIntercomTarget" | "leafIntercomTarget" | "ownerState" | "mode" | "state" | "agent" | "sessionName" | "agents" | "model" | "thinking" | "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"
|
|
632
812
|
> & {
|
|
633
813
|
steps?: PublicNestedStepSummary[];
|
|
634
814
|
children?: PublicNestedRunSummary[];
|
|
@@ -636,6 +816,8 @@ export type PublicNestedRunSummary = Pick<
|
|
|
636
816
|
|
|
637
817
|
export interface SubagentResultIntercomChild {
|
|
638
818
|
agent: string;
|
|
819
|
+
/** Human-readable display name for the child session, when derived at launch. */
|
|
820
|
+
sessionName?: string;
|
|
639
821
|
/** Process/lifecycle status. It does not establish semantic task completion. */
|
|
640
822
|
status: SubagentResultStatus;
|
|
641
823
|
/** Whether the child produced substantive output before its process ended. */
|
|
@@ -684,6 +866,8 @@ export interface ChildWatchdogProgress {
|
|
|
684
866
|
export interface AgentProgress {
|
|
685
867
|
index: number;
|
|
686
868
|
agent: string;
|
|
869
|
+
/** Human-readable display name for the child's session, when derived at launch. */
|
|
870
|
+
sessionName?: string;
|
|
687
871
|
status: "pending" | "running" | "completed" | "failed" | "detached";
|
|
688
872
|
activityState?: ActivityState;
|
|
689
873
|
task: string;
|
|
@@ -703,6 +887,8 @@ export interface AgentProgress {
|
|
|
703
887
|
thinking?: string;
|
|
704
888
|
inputTokens?: number;
|
|
705
889
|
outputTokens?: number;
|
|
890
|
+
window?: number;
|
|
891
|
+
windowPeak?: number;
|
|
706
892
|
durationMs: number;
|
|
707
893
|
error?: string;
|
|
708
894
|
failedTool?: string;
|
|
@@ -717,6 +903,8 @@ export interface ToolCallSummary {
|
|
|
717
903
|
interface ProgressSummary {
|
|
718
904
|
index?: number;
|
|
719
905
|
agent?: string;
|
|
906
|
+
/** Human-readable display name for the child's session, when derived at launch. */
|
|
907
|
+
sessionName?: string;
|
|
720
908
|
status?: AgentProgress["status"];
|
|
721
909
|
activityState?: ActivityState;
|
|
722
910
|
skills?: string[];
|
|
@@ -977,6 +1165,9 @@ export interface SingleResult {
|
|
|
977
1165
|
index: number;
|
|
978
1166
|
agent: string;
|
|
979
1167
|
task: string;
|
|
1168
|
+
/** Human-readable display name for the child's own session (agent + task
|
|
1169
|
+
* excerpt), when the launcher derived one. Display metadata only. */
|
|
1170
|
+
sessionName?: string;
|
|
980
1171
|
/** Resolved launch context for this child. */
|
|
981
1172
|
context?: "fresh" | "fork";
|
|
982
1173
|
exitCode: number;
|
|
@@ -1044,6 +1235,8 @@ export interface SingleResult {
|
|
|
1044
1235
|
watchdog?: ChildWatchdogProgress;
|
|
1045
1236
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1046
1237
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1238
|
+
runner?: ExternalCliRunnerStatus | ExternalJobRunnerStatus;
|
|
1239
|
+
externalProcess?: ExternalProcessStatus;
|
|
1047
1240
|
}
|
|
1048
1241
|
|
|
1049
1242
|
export interface SpawnBudgetGrant {
|
|
@@ -1069,6 +1262,10 @@ export interface WaitCompletionChild {
|
|
|
1069
1262
|
agent?: string;
|
|
1070
1263
|
/** Child run identity where the producer records one (workflow children); artifact files are keyed by it. */
|
|
1071
1264
|
runId?: string;
|
|
1265
|
+
/** Bounded accounting projection used by /subagent-cost after async completion. */
|
|
1266
|
+
usage?: Usage;
|
|
1267
|
+
/** Persisted Pi child session when available. */
|
|
1268
|
+
sessionFile?: string;
|
|
1072
1269
|
success?: boolean;
|
|
1073
1270
|
outputState?: SubagentOutputState;
|
|
1074
1271
|
error?: string;
|
|
@@ -1090,6 +1287,7 @@ export interface WaitCompletion {
|
|
|
1090
1287
|
/** Versioned bounded output archive retained with the durable completion replay. */
|
|
1091
1288
|
archivePath?: string;
|
|
1092
1289
|
results?: WaitCompletionChild[];
|
|
1290
|
+
workflowChildren?: WorkflowChildSummaryV1;
|
|
1093
1291
|
}
|
|
1094
1292
|
|
|
1095
1293
|
export interface Details {
|
|
@@ -1100,6 +1298,7 @@ export interface Details {
|
|
|
1100
1298
|
/** Run-level context summary. "mixed" when children resolved to different modes. */
|
|
1101
1299
|
context?: "fresh" | "fork" | "mixed";
|
|
1102
1300
|
results: SingleResult[];
|
|
1301
|
+
workflowChildren?: WorkflowChildSummaryV1;
|
|
1103
1302
|
/**
|
|
1104
1303
|
* Terminal completion payloads for runs this subagent_wait call observed
|
|
1105
1304
|
* finishing. Async completions travel as result files that are consumed and
|
|
@@ -1107,6 +1306,12 @@ export interface Details {
|
|
|
1107
1306
|
* identity never reaches tool_result details.
|
|
1108
1307
|
*/
|
|
1109
1308
|
completions?: WaitCompletion[];
|
|
1309
|
+
wait?: {
|
|
1310
|
+
reason: "window_elapsed";
|
|
1311
|
+
timedOut: true;
|
|
1312
|
+
activeRunIds: string[];
|
|
1313
|
+
activeProviderItems: Array<{ provider: string; id: string }>;
|
|
1314
|
+
};
|
|
1110
1315
|
controlEvents?: ControlEvent[];
|
|
1111
1316
|
steering?: SteerActionResult;
|
|
1112
1317
|
asyncId?: string;
|
|
@@ -1116,7 +1321,6 @@ export interface Details {
|
|
|
1116
1321
|
deadlineAt?: number;
|
|
1117
1322
|
timedOut?: boolean;
|
|
1118
1323
|
stopped?: boolean;
|
|
1119
|
-
turnBudget?: ResolvedTurnBudget;
|
|
1120
1324
|
toolBudget?: ResolvedToolBudget;
|
|
1121
1325
|
usageBudget?: UsageBudgetState;
|
|
1122
1326
|
progress?: AgentProgress[];
|
|
@@ -1136,6 +1340,9 @@ export interface Details {
|
|
|
1136
1340
|
totalSteps?: number; // Total steps in chain
|
|
1137
1341
|
currentStepIndex?: number; // 0-indexed current step (for running chains)
|
|
1138
1342
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1343
|
+
/** Validated, display-only fanout plan supplied with a workflow launch. */
|
|
1344
|
+
preflight?: WorkflowPreflightV1;
|
|
1345
|
+
preflightWarnings?: string[];
|
|
1139
1346
|
outputs?: ChainOutputMap;
|
|
1140
1347
|
// Aggregated child usage across all agents in the run
|
|
1141
1348
|
totalChildUsage?: Usage;
|
|
@@ -1164,8 +1371,9 @@ export interface Details {
|
|
|
1164
1371
|
mission?: MissionRecord;
|
|
1165
1372
|
workflow?: {
|
|
1166
1373
|
value?: unknown;
|
|
1374
|
+
preflightWarnings?: string[];
|
|
1167
1375
|
trace: Array<{
|
|
1168
|
-
operation: "run" | "status" | "steer";
|
|
1376
|
+
operation: "run" | "status" | "steer" | "host";
|
|
1169
1377
|
key: string;
|
|
1170
1378
|
state: "started" | "completed" | "failed" | "detached" | "stopped" | "reused" | "queued" | "delivered" | "missed";
|
|
1171
1379
|
agent?: string;
|
|
@@ -1173,6 +1381,9 @@ export interface Details {
|
|
|
1173
1381
|
phase?: string;
|
|
1174
1382
|
label?: string;
|
|
1175
1383
|
durationMs?: number;
|
|
1384
|
+
/** Internal provenance for a generated runs.lanes child key. */
|
|
1385
|
+
generatedLaneKey?: string;
|
|
1386
|
+
warning?: string;
|
|
1176
1387
|
error?: string;
|
|
1177
1388
|
}>;
|
|
1178
1389
|
emits: unknown[];
|
|
@@ -1232,7 +1443,7 @@ export interface AsyncParallelGroupStatus {
|
|
|
1232
1443
|
stepIndex: number;
|
|
1233
1444
|
}
|
|
1234
1445
|
|
|
1235
|
-
export type NestedRunState = "queued" | "running" | "complete" | "failed" | "paused" | "stopped" | "rejected";
|
|
1446
|
+
export type NestedRunState = "queued" | "running" | "complete" | "failed" | "partial" | "paused" | "stopped" | "rejected";
|
|
1236
1447
|
export type NestedOwnerState = "live" | "gone" | "unknown";
|
|
1237
1448
|
|
|
1238
1449
|
export interface NestedRunAddress {
|
|
@@ -1246,7 +1457,9 @@ export interface NestedRunAddress {
|
|
|
1246
1457
|
|
|
1247
1458
|
export interface NestedStepSummary {
|
|
1248
1459
|
agent: string;
|
|
1249
|
-
|
|
1460
|
+
/** Human-readable display name for the child session, when derived at launch. */
|
|
1461
|
+
sessionName?: string;
|
|
1462
|
+
status: "pending" | "running" | "complete" | "completed" | "failed" | "partial" | "paused" | "stopped" | "rejected";
|
|
1250
1463
|
model?: string;
|
|
1251
1464
|
thinking?: string;
|
|
1252
1465
|
sessionFile?: string;
|
|
@@ -1297,6 +1510,8 @@ export interface NestedRunSummary extends NestedRunAddress {
|
|
|
1297
1510
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1298
1511
|
state: NestedRunState;
|
|
1299
1512
|
agent?: string;
|
|
1513
|
+
/** Human-readable display name for the child session, when derived at launch. */
|
|
1514
|
+
sessionName?: string;
|
|
1300
1515
|
agents?: string[];
|
|
1301
1516
|
model?: string;
|
|
1302
1517
|
thinking?: string;
|
|
@@ -1358,6 +1573,7 @@ export interface AsyncStartedEvent {
|
|
|
1358
1573
|
chainStepCount?: number;
|
|
1359
1574
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
1360
1575
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1576
|
+
preflight?: WorkflowPreflightV1;
|
|
1361
1577
|
launchContractDigest?: string;
|
|
1362
1578
|
launchResolvedExtensions?: LaunchResolvedChildExtensionsV1;
|
|
1363
1579
|
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensionsV1;
|
|
@@ -1375,9 +1591,11 @@ export type AgentRunnerConfig =
|
|
|
1375
1591
|
| { type: "pi" }
|
|
1376
1592
|
| {
|
|
1377
1593
|
type: "external-cli";
|
|
1594
|
+
adapter?: "codex-exec" | "codex-exec-writer" | "claude-code" | "claude-code-writer" | "cursor-agent" | "cursor-agent-writer";
|
|
1378
1595
|
command: string;
|
|
1379
1596
|
args?: string[];
|
|
1380
1597
|
promptDelivery?: "stdin";
|
|
1598
|
+
capabilities?: ExternalCliCapabilityNarrowing;
|
|
1381
1599
|
}
|
|
1382
1600
|
| {
|
|
1383
1601
|
type: "external-job";
|
|
@@ -1385,18 +1603,46 @@ export type AgentRunnerConfig =
|
|
|
1385
1603
|
options?: Record<string, unknown>;
|
|
1386
1604
|
};
|
|
1387
1605
|
|
|
1606
|
+
export type ExternalCliCapabilityNarrowing = Partial<Record<"steer" | "resume" | "structuredOutput" | "toolEvents" | "supervisor" | "forkContext" | "extensionBindings", false>>;
|
|
1607
|
+
|
|
1608
|
+
export interface ExternalCliCapabilities {
|
|
1609
|
+
stop: true;
|
|
1610
|
+
steer: false;
|
|
1611
|
+
resume: false;
|
|
1612
|
+
structuredOutput: false;
|
|
1613
|
+
toolEvents: false;
|
|
1614
|
+
supervisor: "unsupported";
|
|
1615
|
+
forkContext: false;
|
|
1616
|
+
extensionBindings: false;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
export interface ExternalCliReceiptMetadata {
|
|
1620
|
+
adapter: { id: "external-cli" | "codex-exec" | "codex-exec-writer" | "claude-code" | "claude-code-writer" | "cursor-agent" | "cursor-agent-writer" | "grok-build"; version: 1; executionMode: "one-shot-stdin" | "one-shot-prompt-file" };
|
|
1621
|
+
capabilities: ExternalCliCapabilities;
|
|
1622
|
+
safety?:
|
|
1623
|
+
| { sandbox: "read-only"; approvalPolicy: "never"; ephemeral: true }
|
|
1624
|
+
| { access: "workspace-write"; sandbox: "workspace-write"; approvalPolicy: "never"; ephemeral: true }
|
|
1625
|
+
| { permissionMode: "plan"; tools: "none"; mcp: "empty-strict"; settingSources: "none"; sessionPersistence: false }
|
|
1626
|
+
| { access: "read-only"; authentication: "existing-cli-required"; permissionMode: "plan"; tools: "none"; mcp: "empty-strict"; settingSources: "user"; userSettingsTrust: "required"; sessionPersistence: false }
|
|
1627
|
+
| { access: "workspace-write"; authentication: "existing-cli-required"; permissionMode: "acceptEdits"; tools: "Read,Write,Edit,Glob,Grep"; mcp: "empty-strict"; settingSources: "user"; userSettingsTrust: "required"; sessionPersistence: false }
|
|
1628
|
+
| { access: "read-only"; authentication: "cursor-api-key-or-existing-login"; mode: "ask"; sandbox: "enabled"; workspaceTrust: "existing-required"; sessionReuse: false }
|
|
1629
|
+
| { access: "workspace-write"; authentication: "cursor-api-key-or-existing-login"; mode: "print"; sandbox: "enabled"; workspaceTrust: "existing-required"; sessionReuse: false };
|
|
1630
|
+
outputArtifacts?: { stdoutPath?: string; stderrPath?: string; finalOutputPath?: string };
|
|
1631
|
+
handoff: { mode: "fresh" };
|
|
1632
|
+
supervisor: { mode: "unsupported"; reason: string };
|
|
1633
|
+
nonResumableReason: string;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1388
1636
|
export interface ExternalCliRunnerStatus {
|
|
1389
1637
|
type: "external-cli";
|
|
1390
1638
|
command: string;
|
|
1391
1639
|
args: string[];
|
|
1392
|
-
promptDelivery: "stdin";
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
toolEvents: false;
|
|
1399
|
-
};
|
|
1640
|
+
promptDelivery: "stdin" | "prompt-file";
|
|
1641
|
+
adapter: ExternalCliReceiptMetadata["adapter"];
|
|
1642
|
+
safety?: ExternalCliReceiptMetadata["safety"];
|
|
1643
|
+
capabilities: ExternalCliCapabilities;
|
|
1644
|
+
unsupportedReasons: Record<Exclude<keyof ExternalCliCapabilities, "stop">, string>;
|
|
1645
|
+
nonResumableReason: string;
|
|
1400
1646
|
}
|
|
1401
1647
|
|
|
1402
1648
|
export interface ExternalJobRunnerStatus {
|
|
@@ -1443,6 +1689,11 @@ export interface ExternalProcessStatus {
|
|
|
1443
1689
|
processSignal?: string | null;
|
|
1444
1690
|
stdoutPath: string;
|
|
1445
1691
|
stderrPath: string;
|
|
1692
|
+
finalOutputPath?: string;
|
|
1693
|
+
stdoutBytes?: number;
|
|
1694
|
+
stderrBytes?: number;
|
|
1695
|
+
stdoutTruncated?: boolean;
|
|
1696
|
+
stderrTruncated?: boolean;
|
|
1446
1697
|
}
|
|
1447
1698
|
|
|
1448
1699
|
export interface AsyncStatus {
|
|
@@ -1456,7 +1707,7 @@ export interface AsyncStatus {
|
|
|
1456
1707
|
mode: SubagentRunMode;
|
|
1457
1708
|
context?: "fresh" | "fork" | "mixed";
|
|
1458
1709
|
isNested?: boolean;
|
|
1459
|
-
state: "queued" | "running" | "complete" | "failed" | "paused" | "stopped" | "rejected";
|
|
1710
|
+
state: "queued" | "running" | "complete" | "failed" | "partial" | "paused" | "stopped" | "rejected";
|
|
1460
1711
|
/** Display-only dismissal marker for a reload-orphaned workflow. */
|
|
1461
1712
|
displayDismissedAt?: number;
|
|
1462
1713
|
error?: string;
|
|
@@ -1490,6 +1741,7 @@ export interface AsyncStatus {
|
|
|
1490
1741
|
pendingAppends?: number;
|
|
1491
1742
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
1492
1743
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1744
|
+
preflight?: WorkflowPreflightV1;
|
|
1493
1745
|
processTerminal?: ProcessTerminalV1;
|
|
1494
1746
|
runFanoutBudget?: RunFanoutBudgetSnapshot;
|
|
1495
1747
|
runFanoutBudgetDescriptor?: RunFanoutBudgetDescriptor;
|
|
@@ -1499,14 +1751,18 @@ export interface AsyncStatus {
|
|
|
1499
1751
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1500
1752
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1501
1753
|
workflow?: Details["workflow"];
|
|
1754
|
+
workflowChildren?: WorkflowChildSummaryV1;
|
|
1502
1755
|
parentWorkflowRunId?: string;
|
|
1503
1756
|
workflowKey?: string;
|
|
1757
|
+
lane?: WorkflowLaneMetadata;
|
|
1504
1758
|
/** Set when a durable schedule launched this run, so completions can name their origin. */
|
|
1505
1759
|
scheduleOrigin?: ScheduleOrigin;
|
|
1506
1760
|
steps?: Array<{
|
|
1507
1761
|
/** Stable caller-facing child identity for inspect/status/stop. */
|
|
1508
1762
|
childId?: string;
|
|
1509
1763
|
agent: string;
|
|
1764
|
+
/** Human-readable display name for the child session, when derived at launch. */
|
|
1765
|
+
sessionName?: string;
|
|
1510
1766
|
runner?: ExternalCliRunnerStatus | ExternalJobRunnerStatus;
|
|
1511
1767
|
externalProcess?: ExternalProcessStatus;
|
|
1512
1768
|
externalJob?: ExternalJobStatus;
|
|
@@ -1517,6 +1773,11 @@ export interface AsyncStatus {
|
|
|
1517
1773
|
phase?: string;
|
|
1518
1774
|
label?: string;
|
|
1519
1775
|
workflowKey?: string;
|
|
1776
|
+
lane?: WorkflowLaneMetadata;
|
|
1777
|
+
/** Display-only worktree path copied at launch; handoff remains authoritative. */
|
|
1778
|
+
worktreePath?: string;
|
|
1779
|
+
/** Display-only branch copied at launch; handoff remains authoritative. */
|
|
1780
|
+
branch?: string;
|
|
1520
1781
|
/** Child run identity for workflow capacity reconciliation. */
|
|
1521
1782
|
runId?: string;
|
|
1522
1783
|
/** True only when this workflow child owns a detached async runner. */
|
|
@@ -1524,7 +1785,7 @@ export interface AsyncStatus {
|
|
|
1524
1785
|
parentWorkflowRunId?: string;
|
|
1525
1786
|
outputName?: string;
|
|
1526
1787
|
structured?: boolean;
|
|
1527
|
-
status: "pending" | "running" | "complete" | "completed" | "failed" | "paused" | "stopped" | "rejected";
|
|
1788
|
+
status: "pending" | "running" | "complete" | "completed" | "failed" | "partial" | "paused" | "stopped" | "rejected";
|
|
1528
1789
|
stopRequested?: boolean;
|
|
1529
1790
|
stopRequestedAt?: number;
|
|
1530
1791
|
children?: NestedRunSummary[];
|
|
@@ -1557,6 +1818,7 @@ export interface AsyncStatus {
|
|
|
1557
1818
|
skills?: string[];
|
|
1558
1819
|
model?: string;
|
|
1559
1820
|
thinking?: string;
|
|
1821
|
+
contextLimit?: number;
|
|
1560
1822
|
thinkingCeiling?: ThinkingLevel;
|
|
1561
1823
|
attemptedModels?: string[];
|
|
1562
1824
|
modelAttempts?: ModelAttempt[];
|
|
@@ -1604,7 +1866,7 @@ export interface AsyncJobState {
|
|
|
1604
1866
|
cwd?: string;
|
|
1605
1867
|
/** Parent-resolved child session root retained for trusted live transcript lookup. */
|
|
1606
1868
|
sessionRoot?: string;
|
|
1607
|
-
status: "queued" | "running" | "complete" | "failed" | "paused" | "stopped" | "rejected";
|
|
1869
|
+
status: "queued" | "running" | "complete" | "failed" | "partial" | "paused" | "stopped" | "rejected";
|
|
1608
1870
|
/** Short caller-facing task/goal shown in fleet surfaces when available. */
|
|
1609
1871
|
description?: string;
|
|
1610
1872
|
pid?: number;
|
|
@@ -1625,7 +1887,10 @@ export interface AsyncJobState {
|
|
|
1625
1887
|
currentStep?: number;
|
|
1626
1888
|
chainStepCount?: number;
|
|
1627
1889
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
1890
|
+
/** Bounded host-owned CI/gate nodes loaded from the workflow status graph. */
|
|
1891
|
+
hostSteps?: HostStepNodeV1[];
|
|
1628
1892
|
steps?: AsyncJobStep[];
|
|
1893
|
+
preflight?: WorkflowPreflightV1;
|
|
1629
1894
|
stepsTotal?: number;
|
|
1630
1895
|
runningSteps?: number;
|
|
1631
1896
|
completedSteps?: number;
|
|
@@ -1654,10 +1919,14 @@ export interface AsyncJobState {
|
|
|
1654
1919
|
parentWorkflowRunId?: string;
|
|
1655
1920
|
workflowKey?: string;
|
|
1656
1921
|
workflow?: Details["workflow"];
|
|
1922
|
+
workflowChildren?: WorkflowChildSummaryV1;
|
|
1923
|
+
lane?: WorkflowLaneMetadata;
|
|
1657
1924
|
}
|
|
1658
1925
|
|
|
1659
1926
|
export interface ForegroundResumeChild {
|
|
1660
1927
|
agent: string;
|
|
1928
|
+
/** Human-readable display name for the child session, when derived at launch. */
|
|
1929
|
+
sessionName?: string;
|
|
1661
1930
|
index: number;
|
|
1662
1931
|
context?: "fresh" | "fork";
|
|
1663
1932
|
sessionFile?: string;
|
|
@@ -1671,6 +1940,8 @@ export interface ForegroundResumeChild {
|
|
|
1671
1940
|
currentPath?: string;
|
|
1672
1941
|
turnCount?: number;
|
|
1673
1942
|
tokens?: number;
|
|
1943
|
+
window?: number;
|
|
1944
|
+
windowPeak?: number;
|
|
1674
1945
|
toolCount?: number;
|
|
1675
1946
|
exitCode?: number;
|
|
1676
1947
|
error?: string;
|
|
@@ -1685,6 +1956,14 @@ export interface ForegroundResumeChild {
|
|
|
1685
1956
|
detachedReason?: string;
|
|
1686
1957
|
acceptance?: AcceptanceLedger;
|
|
1687
1958
|
agentContract?: AgentContract;
|
|
1959
|
+
/** Private bounded launch fields needed to preserve the child contract on resume. */
|
|
1960
|
+
resumeContract?: {
|
|
1961
|
+
outputSchema?: JsonSchemaObject;
|
|
1962
|
+
agentContract?: AgentContract;
|
|
1963
|
+
acceptance?: AcceptanceInput;
|
|
1964
|
+
output?: string | boolean;
|
|
1965
|
+
outputMode?: OutputMode;
|
|
1966
|
+
};
|
|
1688
1967
|
launchContractDigest?: string;
|
|
1689
1968
|
/** Private retained launch authority. Never project into status or result output. */
|
|
1690
1969
|
extensionBindings?: ExtensionBindings;
|
|
@@ -1711,6 +1990,8 @@ export interface ForegroundResumeRun {
|
|
|
1711
1990
|
export interface ForegroundChildControl {
|
|
1712
1991
|
index: number;
|
|
1713
1992
|
agent: string;
|
|
1993
|
+
/** Human-readable display name for the child's session, when derived at launch. */
|
|
1994
|
+
sessionName?: string;
|
|
1714
1995
|
description?: string;
|
|
1715
1996
|
startedAt: number;
|
|
1716
1997
|
updatedAt: number;
|
|
@@ -1723,6 +2004,8 @@ export interface ForegroundChildControl {
|
|
|
1723
2004
|
tokens?: number;
|
|
1724
2005
|
inputTokens?: number;
|
|
1725
2006
|
outputTokens?: number;
|
|
2007
|
+
window?: number;
|
|
2008
|
+
windowPeak?: number;
|
|
1726
2009
|
model?: string;
|
|
1727
2010
|
thinking?: string;
|
|
1728
2011
|
toolCount?: number;
|
|
@@ -1746,6 +2029,8 @@ export interface ForegroundRunControl {
|
|
|
1746
2029
|
/** Effective working directory used to resolve live transcript artifacts. */
|
|
1747
2030
|
cwd?: string;
|
|
1748
2031
|
currentAgent?: string;
|
|
2032
|
+
/** Human-readable display name for the current child session, when derived at launch. */
|
|
2033
|
+
sessionName?: string;
|
|
1749
2034
|
currentIndex?: number;
|
|
1750
2035
|
/** Short caller-facing task/goal shown in fleet surfaces when available. */
|
|
1751
2036
|
description?: string;
|
|
@@ -1758,6 +2043,8 @@ export interface ForegroundRunControl {
|
|
|
1758
2043
|
tokens?: number;
|
|
1759
2044
|
inputTokens?: number;
|
|
1760
2045
|
outputTokens?: number;
|
|
2046
|
+
window?: number;
|
|
2047
|
+
windowPeak?: number;
|
|
1761
2048
|
model?: string;
|
|
1762
2049
|
thinking?: string;
|
|
1763
2050
|
toolCount?: number;
|
|
@@ -1808,6 +2095,8 @@ export interface SubagentState {
|
|
|
1808
2095
|
parentSessionFile?: string | null;
|
|
1809
2096
|
/** Extension-owned roots trusted for child session transcript reads. */
|
|
1810
2097
|
trustedSessionRoots?: string[];
|
|
2098
|
+
/** Pi sessions base that caps exact runtime-recorded session file trust. */
|
|
2099
|
+
trustedSessionFileRoot?: string;
|
|
1811
2100
|
/** Live async session roots created by this parent executor, keyed by run id. */
|
|
1812
2101
|
liveAsyncSessionRoots?: Map<string, string>;
|
|
1813
2102
|
/** Last valid parent session model observed for this session; used when continuation contexts omit ctx.model. */
|
|
@@ -1932,6 +2221,8 @@ export interface SubagentChildStatusEvent {
|
|
|
1932
2221
|
// ============================================================================
|
|
1933
2222
|
|
|
1934
2223
|
export interface RunSyncOptions {
|
|
2224
|
+
/** Exact discovery provenance for an unknown-agent error; omission uses defensive fallback discovery. */
|
|
2225
|
+
unknownAgentDiagnosticContext?: import("../agents/agents.ts").UnknownAgentDiagnosticContext;
|
|
1935
2226
|
/** Opt-in global permission rules; missing tools remain allowed. */
|
|
1936
2227
|
permissions?: import("../runs/shared/permissions.ts").PermissionConfig;
|
|
1937
2228
|
/** Session id of the direct parent session for permission-system ask forwarding. */
|
|
@@ -1943,6 +2234,8 @@ export interface RunSyncOptions {
|
|
|
1943
2234
|
/** Resolved launch context for this child. */
|
|
1944
2235
|
context?: "fresh" | "fork";
|
|
1945
2236
|
cwd?: string;
|
|
2237
|
+
/** Original cwd input retained for launch diagnostics. */
|
|
2238
|
+
requestedCwd?: string;
|
|
1946
2239
|
signal?: AbortSignal;
|
|
1947
2240
|
interruptSignal?: AbortSignal;
|
|
1948
2241
|
timeoutMs?: number;
|
|
@@ -1951,10 +2244,7 @@ export interface RunSyncOptions {
|
|
|
1951
2244
|
toolTimeoutMs?: number;
|
|
1952
2245
|
/** Raw global config.toolTimeoutMs, used by the per-child resolver. */
|
|
1953
2246
|
configToolTimeoutMs?: number;
|
|
1954
|
-
turnBudget?: ResolvedTurnBudget;
|
|
1955
2247
|
usageBudget?: UsageBudgetConfig;
|
|
1956
|
-
/** Enforce maxTurns + graceTurns as a hard model-turn boundary. */
|
|
1957
|
-
enforceHardTurnLimit?: boolean;
|
|
1958
2248
|
toolBudget?: ResolvedToolBudget;
|
|
1959
2249
|
allowZeroToolBudget?: boolean;
|
|
1960
2250
|
allowIntercomDetach?: boolean;
|
|
@@ -1979,10 +2269,13 @@ export interface RunSyncOptions {
|
|
|
1979
2269
|
sessionFile?: string;
|
|
1980
2270
|
share?: boolean;
|
|
1981
2271
|
outputPath?: string;
|
|
2272
|
+
outputClaimPath?: string;
|
|
1982
2273
|
outputMode?: OutputMode;
|
|
1983
2274
|
maxSubagentDepth?: number;
|
|
1984
2275
|
/** Effective parent wait-tool setting propagated to the child runtime. */
|
|
1985
2276
|
waitToolEnabled?: boolean;
|
|
2277
|
+
/** Effective parent default wait window propagated to the child runtime. */
|
|
2278
|
+
waitToolDefaultTimeoutMs?: number;
|
|
1986
2279
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1987
2280
|
runFanoutBudget?: RunFanoutBudgetDescriptor;
|
|
1988
2281
|
nestedRoute?: NestedRouteInfo;
|
|
@@ -1998,10 +2291,14 @@ export interface RunSyncOptions {
|
|
|
1998
2291
|
thinkingOverride?: AgentConfig["thinking"];
|
|
1999
2292
|
thinkingCeiling?: ThinkingLevel;
|
|
2000
2293
|
extensionBindings?: ExtensionBindings;
|
|
2294
|
+
/** Package-internal one-use authorization for one foreground workflow child. */
|
|
2295
|
+
workflowChildPermitLaunch?: WorkflowChildPermitContext;
|
|
2001
2296
|
/** Registry models available for heuristic bare-model resolution */
|
|
2002
|
-
availableModels?: Array<{ provider: string; id: string; fullId: string }>;
|
|
2297
|
+
availableModels?: Array<{ provider: string; id: string; fullId: string; contextWindow?: number }>;
|
|
2003
2298
|
/** Current parent-session provider to prefer for ambiguous bare model ids */
|
|
2004
2299
|
preferredModelProvider?: string;
|
|
2300
|
+
/** Parent Pi event host used to snapshot runtime-registered MCP servers before child launch. */
|
|
2301
|
+
runtimeSnapshotHost?: import("../runs/shared/mcp-direct-tool-allowlist.ts").McpRuntimeSnapshotHost;
|
|
2005
2302
|
/** Optional subagent model-scope enforcement for fallback candidates */
|
|
2006
2303
|
modelScope?: ModelScopeRule | ModelScopeRule[];
|
|
2007
2304
|
/** Skills to make available (overrides agent default if provided) */
|
|
@@ -2063,6 +2360,11 @@ export interface ScheduledRunsConfig {
|
|
|
2063
2360
|
storeRoot?: string;
|
|
2064
2361
|
}
|
|
2065
2362
|
|
|
2363
|
+
export interface ModelExclusionsConfig {
|
|
2364
|
+
/** Default duration in milliseconds. A lower configured value also shortens active cached exclusions. */
|
|
2365
|
+
defaultTtlMs?: number;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2066
2368
|
export type FleetViewPlacement = "aboveEditor" | "belowEditor";
|
|
2067
2369
|
|
|
2068
2370
|
export const FLEET_KEYBINDING_ACTIONS = [
|
|
@@ -2097,10 +2399,24 @@ export interface MainWindowRendererConfig {
|
|
|
2097
2399
|
compactResultMaxLines?: number;
|
|
2098
2400
|
}
|
|
2099
2401
|
|
|
2402
|
+
export interface ForkContextConfig {
|
|
2403
|
+
/** Keep the complete fork by default, or summarize large text-only tool results before launch. */
|
|
2404
|
+
mode?: "full" | "pruned";
|
|
2405
|
+
/** Required pruning model when mode is "pruned". */
|
|
2406
|
+
model?: string;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
export interface ActiveAsyncCapacityConfig {
|
|
2410
|
+
/** Reclaim failed runner slots after this age when process proof is unknown; false keeps strict retention. */
|
|
2411
|
+
abandonedSlotReleaseAfterMs?: number | false;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2100
2414
|
export interface ExtensionConfig {
|
|
2101
2415
|
asyncByDefault?: boolean;
|
|
2102
2416
|
/** Set the context for launches that omit an explicit context. */
|
|
2103
2417
|
defaultSubagentContext?: "fresh" | "fork";
|
|
2418
|
+
/** Configure how every resolved fork session is prepared before child spawn. */
|
|
2419
|
+
forkContext?: ForkContextConfig;
|
|
2104
2420
|
/** Optional shortcut that detaches the active foreground single-subagent run. */
|
|
2105
2421
|
foregroundDetachShortcut?: string;
|
|
2106
2422
|
/** Show the Claude Code-style navigable fleet. Defaults to true. */
|
|
@@ -2111,7 +2427,9 @@ export interface ExtensionConfig {
|
|
|
2111
2427
|
fleetKeybindings?: FleetKeybindingsConfig;
|
|
2112
2428
|
/** Show the under-editor async runs widget. Defaults to true, including when FleetView is enabled. */
|
|
2113
2429
|
asyncWidget?: boolean;
|
|
2114
|
-
/**
|
|
2430
|
+
/** Configure the process-wide TTL policy for persisted model exclusions. */
|
|
2431
|
+
modelExclusions?: ModelExclusionsConfig;
|
|
2432
|
+
/** Tool description variant registered for the parent-facing subagent tool. Defaults to full. */
|
|
2115
2433
|
toolDescriptionMode?: ToolDescriptionMode;
|
|
2116
2434
|
/** Inline chat rendering for the subagent tool. Defaults to rich. */
|
|
2117
2435
|
inlineToolDisplay?: InlineToolDisplay;
|
|
@@ -2130,6 +2448,8 @@ export interface ExtensionConfig {
|
|
|
2130
2448
|
maxSubagentSpawnsPerRun?: number;
|
|
2131
2449
|
/** Optional active top-level async run cap per parent session. Unset or 0 means unlimited. */
|
|
2132
2450
|
maxActiveAsyncRunsPerSession?: number;
|
|
2451
|
+
/** Active-capacity cleanup policy. */
|
|
2452
|
+
capacity?: ActiveAsyncCapacityConfig;
|
|
2133
2453
|
/** Global cap on simultaneously-running subagent tasks within a single run. Defaults to 20. */
|
|
2134
2454
|
globalConcurrencyLimit?: number;
|
|
2135
2455
|
/**
|
|
@@ -2153,7 +2473,6 @@ export interface ExtensionConfig {
|
|
|
2153
2473
|
toolTimeoutMs?: number;
|
|
2154
2474
|
control?: ControlConfig;
|
|
2155
2475
|
completionBatch?: CompletionBatchConfig;
|
|
2156
|
-
turnBudget?: TurnBudgetConfig;
|
|
2157
2476
|
toolBudget?: ToolBudgetConfig;
|
|
2158
2477
|
/** Opt-in native tool permissions. Bash remains outside this policy. */
|
|
2159
2478
|
permissions?: import("../runs/shared/permissions.ts").PermissionConfig;
|
|
@@ -2163,7 +2482,7 @@ export interface ExtensionConfig {
|
|
|
2163
2482
|
worktreeSetupHook?: string;
|
|
2164
2483
|
worktreeSetupHookTimeoutMs?: number;
|
|
2165
2484
|
worktreeBaseDir?: string;
|
|
2166
|
-
/** Where to store subagent artifact files. Defaults to "session"
|
|
2485
|
+
/** Where to store subagent artifact files. Defaults to "project" (cwd/.pi-subagents). Set to "session" for the pi session directory, or OS temp when unavailable. */
|
|
2167
2486
|
artifactDir?: ArtifactDirPreference;
|
|
2168
2487
|
/** Artifact cleanup retention. Set cleanupDays to 0 to disable cleanup. */
|
|
2169
2488
|
artifactConfig?: Pick<ArtifactConfig, "cleanupDays">;
|
|
@@ -2285,7 +2604,7 @@ export const POLL_INTERVAL_MS = 250;
|
|
|
2285
2604
|
export const WIDGET_ANIMATION_INTERVAL_MS = 1000;
|
|
2286
2605
|
export const MAX_WIDGET_JOBS = 4;
|
|
2287
2606
|
export const DEFAULT_SUBAGENT_MAX_DEPTH = 2;
|
|
2288
|
-
export const SUBAGENT_ACTIONS = ["list", "get", "models", "children.list", "guide", "create", "update", "delete", "eject", "disable", "enable", "reset", "mission.create", "mission.list", "mission.show", "mission.update", "mission.resolve-decision", "mission.attach-run", "mission.close", "worktree.discard", "refine", "refine.show", "refine.rollback", "inspector.open", "inspector.status", "inspector.close", "project.open", "project.status", "project.close", "status", "debug.run", "grant-spawn-budget", "interrupt", "resume", "steer", "stop", "dismiss", "doctor", "watchdog.status", "watchdog.check", "watchdog.configure", "watchdog.recommend-model", "schedule.create", "schedule.list", "schedule.show", "schedule.history", "schedule.pause", "schedule.resume", "schedule.run", "schedule.run-due", "schedule.delete"] as const;
|
|
2607
|
+
export const SUBAGENT_ACTIONS = ["list", "get", "models", "children.list", "guide", "validate", "create", "update", "delete", "eject", "disable", "enable", "reset", "mission.create", "mission.list", "mission.show", "mission.update", "mission.resolve-decision", "mission.attach-run", "mission.close", "worktree.discard", "worktree.cleanup", "lane.status", "lane.recordMerge", "lane.recordSupersession", "refine", "refine.show", "refine.rollback", "inspector.open", "inspector.status", "inspector.close", "project.open", "project.status", "project.close", "status", "debug.run", "grant-spawn-budget", "interrupt", "resume", "steer", "stop", "dismiss", "doctor", "watchdog.status", "watchdog.check", "watchdog.configure", "watchdog.recommend-model", "schedule.create", "schedule.list", "schedule.show", "schedule.history", "schedule.pause", "schedule.resume", "schedule.run", "schedule.run-due", "schedule.delete"] as const;
|
|
2289
2608
|
|
|
2290
2609
|
export const DEFAULT_FORK_PREAMBLE =
|
|
2291
2610
|
"You are a delegated subagent running from a fork of the parent session. " +
|