@selesai/code 0.13.16 → 0.13.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +2 -14
- package/dist/bun/cli.d.ts +3 -1
- package/dist/bun/cli.js +3 -9
- package/dist/bun/{register-bedrock.js → runtime-setup.js} +5 -0
- package/dist/bun/sandbox-env-setup.d.ts +1 -0
- package/dist/bun/sandbox-env-setup.js +3 -0
- package/dist/cli/auth-command.d.ts +23 -0
- package/dist/cli/auth-command.js +102 -0
- package/dist/cli/config-selector.js +2 -1
- package/dist/cli/setup.d.ts +1 -0
- package/dist/cli/setup.js +11 -0
- package/dist/cli.js +2 -14
- package/dist/config.d.ts +3 -2
- package/dist/config.js +9 -4
- package/dist/core/agent-session-runtime.js +15 -7
- package/dist/core/agent-session.d.ts +2 -6
- package/dist/core/agent-session.js +15 -4
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -1
- package/dist/core/extensions/loader.js +3 -0
- package/dist/core/extensions/types.d.ts +16 -2
- package/dist/core/http-dispatcher.js +2 -0
- package/dist/core/keybindings.d.ts +5 -0
- package/dist/core/keybindings.js +4 -0
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/model-config.d.ts +15 -0
- package/dist/core/model-config.js +3 -0
- package/dist/core/model-runtime.d.ts +1 -0
- package/dist/core/model-runtime.js +5 -2
- package/dist/core/provider-composer.js +8 -2
- package/dist/core/session-export.d.ts +3 -0
- package/dist/core/session-export.js +31 -0
- package/dist/core/session-manager.d.ts +3 -2
- package/dist/core/session-manager.js +40 -13
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.js +4 -2
- package/dist/core/system-prompt.js +10 -10
- package/dist/core/tools/bash.js +3 -117
- package/dist/core/tools/edit.d.ts +1 -12
- package/dist/core/tools/edit.js +5 -163
- package/dist/core/tools/find.js +4 -55
- package/dist/core/tools/grep.js +4 -60
- package/dist/core/tools/ls.js +4 -49
- package/dist/core/tools/read.d.ts +4 -0
- package/dist/core/tools/read.js +10 -122
- package/dist/core/tools/renderers/bash.d.ts +11 -0
- package/dist/core/tools/renderers/bash.js +129 -0
- package/dist/core/tools/renderers/edit.d.ts +22 -0
- package/dist/core/tools/renderers/edit.js +166 -0
- package/dist/core/tools/renderers/find.d.ts +9 -0
- package/dist/core/tools/renderers/find.js +63 -0
- package/dist/core/tools/renderers/grep.d.ts +9 -0
- package/dist/core/tools/renderers/grep.js +68 -0
- package/dist/core/tools/renderers/index.d.ts +27 -0
- package/dist/core/tools/renderers/index.js +46 -0
- package/dist/core/tools/renderers/ls.d.ts +9 -0
- package/dist/core/tools/renderers/ls.js +57 -0
- package/dist/core/tools/renderers/read.d.ts +10 -0
- package/dist/core/tools/renderers/read.js +128 -0
- package/dist/core/tools/renderers/write.d.ts +9 -0
- package/dist/core/tools/renderers/write.js +152 -0
- package/dist/core/tools/write.js +5 -146
- package/dist/extensions/pi-hermes-memory/CHANGELOG.md +18 -0
- package/dist/extensions/pi-hermes-memory/README.md +16 -12
- package/dist/extensions/pi-hermes-memory/docs/ROADMAP.md +1 -1
- package/dist/extensions/pi-hermes-memory/package-lock.json +587 -62
- package/dist/extensions/pi-hermes-memory/package.json +4 -4
- package/dist/extensions/pi-hermes-memory/src/config.ts +32 -0
- package/dist/extensions/pi-hermes-memory/src/constants.ts +12 -2
- package/dist/extensions/pi-hermes-memory/src/handlers/background-review.ts +109 -51
- package/dist/extensions/pi-hermes-memory/src/handlers/index-sessions.ts +9 -3
- package/dist/extensions/pi-hermes-memory/src/handlers/review-memory-ops.ts +257 -98
- package/dist/extensions/pi-hermes-memory/src/handlers/session-backfill.ts +9 -2
- package/dist/extensions/pi-hermes-memory/src/handlers/sync-markdown-memories.ts +5 -0
- package/dist/extensions/pi-hermes-memory/src/index.ts +22 -2
- package/dist/extensions/pi-hermes-memory/src/paths.ts +1 -1
- package/dist/extensions/pi-hermes-memory/src/store/db.ts +6 -0
- package/dist/extensions/pi-hermes-memory/src/store/fts-query.ts +58 -1
- package/dist/extensions/pi-hermes-memory/src/store/memory-store.ts +60 -8
- package/dist/extensions/pi-hermes-memory/src/store/session-indexer.ts +169 -7
- package/dist/extensions/pi-hermes-memory/src/store/session-search.ts +7 -21
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-memory-store.ts +134 -15
- package/dist/extensions/pi-hermes-memory/src/tools/memory-search-tool.ts +4 -2
- package/dist/extensions/pi-hermes-memory/src/tools/memory-tool.ts +24 -9
- package/dist/extensions/pi-hermes-memory/src/types.ts +11 -0
- package/dist/extensions/pi-hermes-memory/tests/config.test.ts +42 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/background-review.test.ts +159 -3
- package/dist/extensions/pi-hermes-memory/tests/handlers/review-memory-ops.test.ts +452 -0
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-backfill.test.ts +39 -0
- package/dist/extensions/pi-hermes-memory/tests/integration/corruption-recovery-integration.test.ts +91 -0
- package/dist/extensions/pi-hermes-memory/tests/store/db.test.ts +29 -0
- package/dist/extensions/pi-hermes-memory/tests/store/fts-query.test.ts +116 -0
- package/dist/extensions/pi-hermes-memory/tests/store/memory-store.test.ts +163 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-indexer.test.ts +233 -0
- package/dist/extensions/pi-hermes-memory/tests/store/session-search.test.ts +12 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-memory-store.test.ts +175 -0
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-native.test.ts +2 -2
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-search-tool.test.ts +22 -0
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-tool.test.ts +37 -1
- package/dist/extensions/pi-intercom/CHANGELOG.md +13 -0
- package/dist/extensions/pi-intercom/README.md +16 -2
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +19 -2
- package/dist/extensions/pi-intercom/broker/spawn.ts +4 -4
- package/dist/extensions/pi-intercom/index.ts +1 -1
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +121 -2
- package/dist/extensions/pi-intercom/package.json +1 -1
- package/dist/extensions/pi-intercom/project-agent.test.ts +1 -1
- package/dist/extensions/pi-intercom/project-agent.ts +1 -6
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +7 -6
- package/dist/extensions/pi-rewind-hook/index.test.ts +7 -0
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +36 -4
- package/dist/extensions/pi-subagents/CHANGELOG.md +120 -0
- package/dist/extensions/pi-subagents/README.md +3 -3
- package/dist/extensions/pi-subagents/agents/researcher.md +23 -13
- package/dist/extensions/pi-subagents/agents/reviewer.md +1 -1
- package/dist/extensions/pi-subagents/agents/scout.md +1 -1
- package/dist/extensions/pi-subagents/docs/agents.md +32 -16
- package/dist/extensions/pi-subagents/docs/configuration.md +41 -15
- package/dist/extensions/pi-subagents/docs/extension-api.md +109 -6
- package/dist/extensions/pi-subagents/docs/missions.md +2 -0
- package/dist/extensions/pi-subagents/docs/models.md +58 -1
- package/dist/extensions/pi-subagents/docs/observability.md +50 -12
- package/dist/extensions/pi-subagents/docs/tool-reference.md +17 -10
- package/dist/extensions/pi-subagents/docs/watchdog.md +1 -1
- package/dist/extensions/pi-subagents/docs/workflows.md +26 -9
- package/dist/extensions/pi-subagents/package-lock.json +747 -177
- package/dist/extensions/pi-subagents/package.json +6 -4
- package/dist/extensions/pi-subagents/runner-server-preload.mjs +13 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +2 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +21 -4
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +2 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +2 -0
- package/dist/extensions/pi-subagents/src/agents/advertised-agent-prompt.ts +63 -0
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +61 -16
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +2 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +8 -0
- package/dist/extensions/pi-subagents/src/api/capability-ceiling.ts +0 -1
- package/dist/extensions/pi-subagents/src/api/{pi-args.ts → child-tool-plan.ts} +1 -1
- package/dist/extensions/pi-subagents/src/api/preflight.ts +7 -4
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +2 -2
- package/dist/extensions/pi-subagents/src/api/workflow-resources.ts +6 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +4 -2
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +2 -10
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +9 -11
- package/dist/extensions/pi-subagents/src/extension/index.ts +99 -10
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +13 -0
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +7 -23
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +11 -8
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +25 -7
- package/dist/extensions/pi-subagents/src/integrations/pi-web-session-liveness.ts +73 -0
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +228 -136
- package/dist/extensions/pi-subagents/src/intercom/supervisor-ui.ts +244 -0
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +37 -16
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +18 -18
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +51 -25
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +46 -3
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +14 -3
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +9 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +10 -12
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +18 -15
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +40 -29
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +8 -0
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +79 -247
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +88 -12
- package/dist/extensions/pi-subagents/src/runs/background/owned-process-tree.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +24 -24
- package/dist/extensions/pi-subagents/src/runs/background/retained-nested-route-tracker.ts +96 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-child-session.ts +642 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +75 -6
- package/dist/extensions/pi-subagents/src/runs/background/runner-aliases.ts +163 -0
- package/dist/extensions/pi-subagents/src/runs/background/runner-child-launch.ts +86 -0
- package/dist/extensions/pi-subagents/src/runs/background/runner-child-sessions.ts +31 -0
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +18 -4
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +597 -1092
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +3 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +4 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +20 -17
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +296 -394
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +4 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +9 -5
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +630 -283
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +8 -5
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +78 -98
- package/dist/extensions/pi-subagents/src/runs/shared/abort-recovery.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +16 -3
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/async-status-projection.ts +47 -47
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +1 -2
- package/dist/extensions/pi-subagents/src/runs/shared/child-hooks.ts +174 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +14 -3
- package/dist/extensions/pi-subagents/src/runs/shared/child-launch.ts +319 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-lifecycle.ts +25 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-runtime-config.ts +126 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-session.ts +373 -0
- package/dist/extensions/pi-subagents/src/runs/shared/child-tool-plan.ts +530 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-evidence.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +2 -1
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-preflight.ts +16 -0
- package/dist/extensions/pi-subagents/src/runs/shared/host-step-status.ts +11 -11
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +30 -20
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +5 -4
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +84 -15
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +88 -12
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +37 -53
- package/dist/extensions/pi-subagents/src/runs/shared/nested-path.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +18 -7
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +57 -12
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +3 -4
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +0 -11
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +4 -1
- package/dist/extensions/pi-subagents/src/runs/shared/readonly-drain-observation.ts +42 -0
- package/dist/extensions/pi-subagents/src/runs/shared/readonly-model-continuation.ts +69 -0
- package/dist/extensions/pi-subagents/src/runs/shared/readonly-session-evidence.ts +307 -0
- package/dist/extensions/pi-subagents/src/runs/shared/run-fanout-budget.ts +8 -21
- package/dist/extensions/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +3 -30
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +17 -4
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +99 -386
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +18 -62
- package/dist/extensions/pi-subagents/src/runs/shared/tool-budget.ts +0 -14
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +31 -9
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-setup-command.ts +190 -0
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +506 -226
- package/dist/extensions/pi-subagents/src/shared/child-session-name.ts +1 -1
- package/dist/extensions/pi-subagents/src/shared/jsonl-writer.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/model-response-aliases.ts +13 -0
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +0 -6
- package/dist/extensions/pi-subagents/src/shared/types.ts +145 -89
- package/dist/extensions/pi-subagents/src/shared/utils.ts +13 -6
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +2 -0
- package/dist/extensions/pi-subagents/src/shared/workflow-child-permit.ts +18 -13
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +0 -6
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +1 -1
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +11 -6
- package/dist/extensions/pi-subagents/src/tui/render.ts +277 -46
- package/dist/extensions/pi-subagents/src/watchdog/child-status.ts +0 -1
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +12 -12
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +3 -3
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +116 -15
- package/dist/extensions/pi-subagents/src/workflows/workflow-checklist.ts +15 -18
- package/dist/extensions/pi-subagents/src/workflows/workflow-child-summary.ts +57 -8
- package/dist/extensions/pi-subagents/src/workflows/workflow-preflight.ts +19 -19
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +3 -3
- package/dist/extensions/pi-subagents/src/workflows/workflow-resources.ts +97 -22
- package/dist/extensions/pi-subagents/src/workflows/workflow-settlement.ts +3 -0
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +336 -21
- package/dist/extensions/pi-subagents/test/integration/async-execution.part-1.test.ts +1181 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.part-2.test.ts +2240 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.part-3.test.ts +2268 -0
- package/dist/extensions/pi-subagents/test/integration/async-execution.part-4.test.ts +1512 -0
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +231 -16
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +4 -18
- package/dist/extensions/pi-subagents/test/integration/foreign-workflow-steering.test.ts +95 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +9 -15
- package/dist/extensions/pi-subagents/test/integration/in-process-child.test.ts +374 -0
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +20 -10
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +18 -6
- package/dist/extensions/pi-subagents/test/integration/recovered-assistant-error.test.ts +151 -0
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +42 -1
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +150 -25
- package/dist/extensions/pi-subagents/test/integration/result-publication.test.ts +354 -0
- package/dist/extensions/pi-subagents/test/integration/shared-cwd-terminal-evidence.test.ts +117 -0
- package/dist/extensions/pi-subagents/test/integration/single-execution.part-1.test.ts +3678 -0
- package/dist/extensions/pi-subagents/test/integration/{single-execution.test.ts → single-execution.part-2.test.ts} +500 -4207
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +1 -2
- package/dist/extensions/pi-subagents/test/integration/workflow-result-publication.test.ts +127 -0
- package/dist/extensions/pi-subagents/test/integration/workflow-steer-inbox.test.ts +365 -0
- package/dist/extensions/pi-subagents/test/smoke/pi085-child.ts +31 -0
- package/dist/extensions/pi-subagents/test/smoke/pi085-clean-install.mjs +74 -0
- package/dist/extensions/pi-subagents/test/smoke/pi085-extension.ts +16 -0
- package/dist/extensions/pi-subagents/test/support/async-execution-fixture.ts +699 -0
- package/dist/extensions/pi-subagents/test/support/fake-child-session.ts +418 -0
- package/dist/extensions/pi-subagents/test/support/foreign-workflow-steer-host.mjs +13 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +30 -76
- package/dist/extensions/pi-subagents/test/support/notify-diagnostics-fixture.ts +84 -0
- package/dist/extensions/pi-subagents/test/support/result-publication-capacity-preload.mjs +70 -0
- package/dist/extensions/pi-subagents/test/support/runner-child-session-factory.ts +17 -0
- package/dist/extensions/pi-subagents/test/support/single-execution-fixture.ts +390 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance-compaction.test.ts +120 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +24 -3
- package/dist/extensions/pi-subagents/test/unit/advertised-agent-prompt.test.ts +87 -0
- package/dist/extensions/pi-subagents/test/unit/advertised-agent-refresh.test.ts +163 -0
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +70 -31
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +78 -3
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +2 -8
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +73 -66
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +51 -1
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +49 -1
- package/dist/extensions/pi-subagents/test/unit/async-spawn-preload.test.ts +103 -0
- package/dist/extensions/pi-subagents/test/unit/async-status-projection.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +9 -8
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling.test.ts +10 -7
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +48 -6
- package/dist/extensions/pi-subagents/test/unit/child-runtime-config.test.ts +90 -0
- package/dist/extensions/pi-subagents/test/unit/{pi-args-permission-system.test.ts → child-tool-plan-permission-system.test.ts} +48 -86
- package/dist/extensions/pi-subagents/test/unit/child-tool-plan.test.ts +33 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +18 -18
- package/dist/extensions/pi-subagents/test/unit/completion-evidence.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +8 -7
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +225 -65
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +17 -22
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +11 -1
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +47 -3
- package/dist/extensions/pi-subagents/test/unit/foreign-workflow-steering.test.ts +74 -0
- package/dist/extensions/pi-subagents/test/unit/fork-cache-key.test.ts +23 -29
- package/dist/extensions/pi-subagents/test/unit/host-peer-runtime-imports.test.ts +96 -4
- package/dist/extensions/pi-subagents/test/unit/host-step-status.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +116 -55
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +58 -1
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +104 -3
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +10 -1
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +31 -1
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +102 -51
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +196 -6
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +181 -38
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +62 -70
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +58 -53
- package/dist/extensions/pi-subagents/test/unit/notify-diagnostics.test.ts +42 -0
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +84 -0
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +13 -5
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +21 -5
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +5 -4
- package/dist/extensions/pi-subagents/test/unit/permissions.test.ts +2 -6
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +28 -2
- package/dist/extensions/pi-subagents/test/unit/pi-web-session-liveness.test.ts +209 -0
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +38 -1
- package/dist/extensions/pi-subagents/test/unit/prompt-audit-optional-peers.test.ts +43 -0
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +24 -2
- package/dist/extensions/pi-subagents/test/unit/readonly-drain-observation.test.ts +174 -0
- package/dist/extensions/pi-subagents/test/unit/readonly-model-continuation.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/readonly-session-evidence.test.ts +1329 -0
- package/dist/extensions/pi-subagents/test/unit/recursion-guard.test.ts +29 -80
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +11 -8
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/retained-nested-route-tracker.test.ts +175 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +38 -12
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +2 -5
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +89 -1
- package/dist/extensions/pi-subagents/test/unit/runtime-acknowledged-extensions.test.ts +2 -16
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +27 -3
- package/dist/extensions/pi-subagents/test/unit/scheduled-supervisor-demand.test.ts +215 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +15 -11
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +237 -1
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -5
- package/dist/extensions/pi-subagents/test/unit/streamed-progress-bounds.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +14 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +130 -739
- package/dist/extensions/pi-subagents/test/unit/supervisor-ask-registration.test.ts +682 -0
- package/dist/extensions/pi-subagents/test/unit/supervisor-ui.test.ts +137 -0
- package/dist/extensions/pi-subagents/test/unit/tool-budget.test.ts +1 -11
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +23 -3
- package/dist/extensions/pi-subagents/test/unit/wait-completions.test.ts +8 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-tool-actions.test.ts +19 -1
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +72 -4
- package/dist/extensions/pi-subagents/test/unit/workflow-checklist.test.ts +17 -3
- package/dist/extensions/pi-subagents/test/unit/workflow-child-summary.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +12 -2
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +46 -6
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/workflow-resources.test.ts +133 -1
- package/dist/extensions/pi-subagents/test/unit/workflow-resume-hint.test.ts +53 -2
- package/dist/extensions/pi-subagents/test/unit/worktree-cleanup-plan.test.ts +222 -14
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +526 -85
- package/dist/extensions/pi-zentui/README.md +17 -0
- package/dist/extensions/pi-zentui/assets/screenshots/footer-status-hyperlink.png +0 -0
- package/dist/extensions/pi-zentui/docs/configuration.md +71 -2
- package/dist/extensions/pi-zentui/extensions/zentui/config.ts +11 -0
- package/dist/extensions/pi-zentui/extensions/zentui/editor-transfer.ts +14 -0
- package/dist/extensions/pi-zentui/extensions/zentui/extension-status.ts +29 -13
- package/dist/extensions/pi-zentui/extensions/zentui/footer-layout.ts +5 -4
- package/dist/extensions/pi-zentui/extensions/zentui/footer-text.ts +11 -0
- package/dist/extensions/pi-zentui/extensions/zentui/footer.ts +11 -10
- package/dist/extensions/pi-zentui/extensions/zentui/index.ts +77 -3
- package/dist/extensions/pi-zentui/extensions/zentui/presets.ts +77 -0
- package/dist/extensions/pi-zentui/extensions/zentui/settings-command.ts +103 -2
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-extension-segments.ts +115 -0
- package/dist/extensions/pi-zentui/extensions/zentui/working-line.ts +87 -5
- package/dist/extensions/pi-zentui/package-lock.json +277 -517
- package/dist/extensions/pi-zentui/package.json +7 -4
- package/dist/extensions/pi-zentui/test/config-presets.test.ts +238 -0
- package/dist/extensions/pi-zentui/test/editor-transfer.test.ts +24 -1
- package/dist/extensions/pi-zentui/test/extension-compliance.test.ts +570 -2
- package/dist/extensions/pi-zentui/test/extension-status.test.ts +90 -0
- package/dist/extensions/pi-zentui/test/footer-hyperlink.test.ts +243 -0
- package/dist/extensions/pi-zentui/test/package-contents.mjs +1 -0
- package/dist/extensions/pi-zentui/test/presets.test.ts +121 -0
- package/dist/extensions/pi-zentui/test/settings-command.test.ts +205 -1
- package/dist/extensions/pi-zentui/test/working-line-extension-segments.test.ts +139 -0
- package/dist/extensions/pi-zentui/test/working-line-lifecycle.integration.test.ts +237 -3
- package/dist/extensions/pi-zentui/test/working-line.test.ts +94 -2
- package/dist/index.d.ts +1 -1
- package/dist/main.js +4 -1
- package/dist/modes/interactive/chat-viewport.d.ts +19 -0
- package/dist/modes/interactive/chat-viewport.js +27 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +6 -2
- package/dist/modes/interactive/components/assistant-message.js +30 -13
- package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
- package/dist/modes/interactive/components/custom-editor.js +39 -1
- package/dist/modes/interactive/components/first-time-setup.js +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +2 -0
- package/dist/modes/interactive/components/markdown-transform.js +18 -0
- package/dist/modes/interactive/components/model-selector.js +19 -17
- package/dist/modes/interactive/components/scoped-models-selector.js +21 -23
- package/dist/modes/interactive/components/settings-selector.d.ts +7 -1
- package/dist/modes/interactive/components/settings-selector.js +128 -20
- package/dist/modes/interactive/components/settings-submenu.d.ts +71 -0
- package/dist/modes/interactive/components/settings-submenu.js +164 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
- package/dist/modes/interactive/components/status-indicator.js +10 -3
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
- package/dist/modes/interactive/components/thinking-selector.js +75 -18
- package/dist/modes/interactive/components/tool-execution.d.ts +21 -4
- package/dist/modes/interactive/components/tool-execution.js +35 -33
- package/dist/modes/interactive/components/trust-selector.js +2 -2
- package/dist/modes/interactive/interactive-mode.d.ts +13 -15
- package/dist/modes/interactive/interactive-mode.js +144 -80
- package/dist/modes/interactive/session-share.d.ts +15 -0
- package/dist/modes/interactive/session-share.js +183 -0
- package/dist/modes/interactive/theme/dark.json +2 -1
- package/dist/modes/interactive/theme/light.json +2 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +5 -0
- package/dist/modes/interactive/theme/theme-json.d.ts +83 -0
- package/dist/modes/interactive/theme/theme-json.js +129 -0
- package/dist/modes/interactive/theme/theme-schema.json +9 -1
- package/dist/modes/interactive/theme/theme.d.ts +14 -5
- package/dist/modes/interactive/theme/theme.js +18 -119
- package/dist/modes/interactive/tui-renderer.d.ts +20 -0
- package/dist/modes/interactive/tui-renderer.js +65 -0
- package/dist/utils/exif-orientation.js +2 -3
- package/dist/utils/management-http.d.ts +24 -0
- package/dist/utils/management-http.js +53 -0
- package/dist/utils/text.d.ts +7 -0
- package/dist/utils/text.js +8 -0
- package/dist/utils/tools-manager.d.ts +1 -0
- package/dist/utils/tools-manager.js +43 -21
- package/docs/docs.json +0 -4
- package/package.json +4 -4
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +0 -415
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +0 -1059
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +0 -116
- package/dist/extensions/pi-subagents/src/shared/post-exit-stdio-guard.ts +0 -85
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +0 -224
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +0 -6986
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +0 -447
- package/dist/extensions/pi-subagents/test/support/real-session-child-cli.mjs +0 -185
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +0 -311
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-pi-args.test.ts +0 -84
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +0 -202
- package/dist/extensions/pi-subagents/test/unit/close-grace-timer.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +0 -2347
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +0 -104
- package/dist/extensions/pi-subagents/test/unit/windows-hide-spawn.test.ts +0 -49
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +0 -1465
- package/dist/skills/imagegen-frontend-web/SKILL.md +0 -987
- package/dist/skills/implanger/SKILL.md +0 -70
- package/dist/skills/output/SKILL.md +0 -49
- package/dist/skills/planger/SKILL.md +0 -167
- package/dist/skills/workflow/SKILL.md +0 -95
- package/docs/workflows.md +0 -18
- /package/dist/bun/{register-bedrock.d.ts → runtime-setup.d.ts} +0 -0
|
@@ -47,14 +47,14 @@ export type HostStepMonitorKind = "command" | "ci" | "gate";
|
|
|
47
47
|
export type HostStepState = "pending" | "running" | "done" | "cancelled" | "error";
|
|
48
48
|
export type HostStepVerdict = "pass" | "fail" | "inconclusive";
|
|
49
49
|
|
|
50
|
-
export interface
|
|
50
|
+
export interface HostStepFreshness {
|
|
51
51
|
expectedRef: string;
|
|
52
52
|
observedRef?: string;
|
|
53
53
|
stale?: boolean;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/** Bounded, provider-agnostic status for a host-owned workflow monitor. */
|
|
57
|
-
export interface
|
|
57
|
+
export interface HostStepNode {
|
|
58
58
|
version: 1;
|
|
59
59
|
kind: "host-step";
|
|
60
60
|
/** Explicit monitor category; never inferred from labels or commands. */
|
|
@@ -68,7 +68,7 @@ export interface HostStepNodeV1 {
|
|
|
68
68
|
reasonCode?: string;
|
|
69
69
|
detail?: string;
|
|
70
70
|
target?: string;
|
|
71
|
-
freshness?:
|
|
71
|
+
freshness?: HostStepFreshness;
|
|
72
72
|
reportPath?: string;
|
|
73
73
|
exitCode?: number | null;
|
|
74
74
|
updatedAt: number;
|
|
@@ -97,7 +97,7 @@ export interface WorkflowGraphNode {
|
|
|
97
97
|
structured?: boolean;
|
|
98
98
|
acceptanceStatus?: AcceptanceLedgerStatus;
|
|
99
99
|
error?: string;
|
|
100
|
-
hostStep?:
|
|
100
|
+
hostStep?: HostStepNode;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
export interface WorkflowGraphSnapshot {
|
|
@@ -112,7 +112,7 @@ export type WorkflowPreflightCoverage = "complete" | "partial";
|
|
|
112
112
|
export type WorkflowPreflightMode = "mutation" | "review" | "scout" | "gate";
|
|
113
113
|
|
|
114
114
|
/** Bounded, display-only lane hints supplied alongside a workflowScript launch. */
|
|
115
|
-
export interface
|
|
115
|
+
export interface WorkflowPreflightLane {
|
|
116
116
|
key: string;
|
|
117
117
|
mode?: WorkflowPreflightMode;
|
|
118
118
|
decision?: string;
|
|
@@ -122,10 +122,10 @@ export interface WorkflowPreflightLaneV1 {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/** Versioned, display-only workflow launch plan; it never grants launch authority. */
|
|
125
|
-
export interface
|
|
125
|
+
export interface WorkflowPreflight {
|
|
126
126
|
version: 1;
|
|
127
127
|
coverage: WorkflowPreflightCoverage;
|
|
128
|
-
lanes:
|
|
128
|
+
lanes: WorkflowPreflightLane[];
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export type WorkflowReceiptState = "complete" | "failed" | "paused" | "stopped";
|
|
@@ -149,7 +149,7 @@ export interface WorkflowRecoveryAction {
|
|
|
149
149
|
* Permission/policy extensions can use it to distinguish resolved content from
|
|
150
150
|
* raw workflow scripts. This audit projection never grants execution authority.
|
|
151
151
|
*/
|
|
152
|
-
export interface
|
|
152
|
+
export interface WorkflowResourceProvenance {
|
|
153
153
|
kind: "workflow";
|
|
154
154
|
name: string;
|
|
155
155
|
version: number;
|
|
@@ -174,7 +174,20 @@ export interface WorkflowLaneMetadata {
|
|
|
174
174
|
outputPaths?: string[];
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
/** Bounded foreground activity; excludes tool arguments and transcript content. */
|
|
178
|
+
export interface WorkflowChildActivity {
|
|
179
|
+
currentTool?: string;
|
|
180
|
+
currentToolStartedAt?: number;
|
|
181
|
+
lastActivityAt?: number;
|
|
182
|
+
durationMs?: number;
|
|
183
|
+
toolCount?: number;
|
|
184
|
+
turnCount?: number;
|
|
185
|
+
tokens?: number;
|
|
186
|
+
inputTokens?: number;
|
|
187
|
+
outputTokens?: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface WorkflowChildSummary {
|
|
178
191
|
version: 1;
|
|
179
192
|
parentToolCallId: string;
|
|
180
193
|
workflowRunId: string;
|
|
@@ -188,6 +201,8 @@ export interface WorkflowChildSummaryV1 {
|
|
|
188
201
|
sessionName?: string;
|
|
189
202
|
model?: string;
|
|
190
203
|
thinking?: string;
|
|
204
|
+
/** Present only while a synchronous foreground child is running. */
|
|
205
|
+
activity?: WorkflowChildActivity;
|
|
191
206
|
state: "pending" | "running" | "completed" | "failed" | "paused" | "stopped" | "rejected" | "detached";
|
|
192
207
|
}>;
|
|
193
208
|
}
|
|
@@ -215,9 +230,9 @@ export interface WorkflowReceipt {
|
|
|
215
230
|
state: WorkflowReceiptState;
|
|
216
231
|
createdAt: number;
|
|
217
232
|
entries: Record<string, WorkflowReceiptEntry>;
|
|
218
|
-
resource?:
|
|
219
|
-
hostSteps?:
|
|
220
|
-
workflowChildren?:
|
|
233
|
+
resource?: WorkflowResourceProvenance;
|
|
234
|
+
hostSteps?: HostStepNode[];
|
|
235
|
+
workflowChildren?: WorkflowChildSummary;
|
|
221
236
|
workflowResolution?: WorkflowTerminalResolution;
|
|
222
237
|
terminalOutcome?: WorkflowTerminalOutcome;
|
|
223
238
|
recovery?: WorkflowRecoveryAction[];
|
|
@@ -369,6 +384,7 @@ export interface ControlEvent {
|
|
|
369
384
|
tokens?: number;
|
|
370
385
|
toolCount?: number;
|
|
371
386
|
currentTool?: string;
|
|
387
|
+
toolCallId?: string;
|
|
372
388
|
currentToolDurationMs?: number;
|
|
373
389
|
currentPath?: string;
|
|
374
390
|
elapsedMs?: number;
|
|
@@ -624,7 +640,7 @@ export type ProcessTerminalReason =
|
|
|
624
640
|
| "proof-write-failed"
|
|
625
641
|
| "stale-repair";
|
|
626
642
|
|
|
627
|
-
export interface
|
|
643
|
+
export interface RunnerProcessInstanceExit {
|
|
628
644
|
processInstanceId: string;
|
|
629
645
|
kind: "runner";
|
|
630
646
|
closeObservedAt: number;
|
|
@@ -632,7 +648,7 @@ export interface RunnerProcessInstanceExitV1 {
|
|
|
632
648
|
signal: string | null;
|
|
633
649
|
}
|
|
634
650
|
|
|
635
|
-
export type
|
|
651
|
+
export type ProcessTreeTerminal =
|
|
636
652
|
| {
|
|
637
653
|
state: "observed";
|
|
638
654
|
mechanism: "posix-process-group";
|
|
@@ -645,26 +661,26 @@ export type ProcessTreeTerminalV1 =
|
|
|
645
661
|
diagnostic?: string;
|
|
646
662
|
};
|
|
647
663
|
|
|
648
|
-
export interface
|
|
664
|
+
export interface PiWriterProcessInstanceExit {
|
|
649
665
|
processInstanceId: string;
|
|
650
666
|
kind: "pi-writer";
|
|
651
667
|
attempt: number;
|
|
652
668
|
closeObservedAt: number;
|
|
653
669
|
exitCode: number | null;
|
|
654
670
|
signal: string | null;
|
|
655
|
-
processTree:
|
|
671
|
+
processTree: ProcessTreeTerminal;
|
|
656
672
|
}
|
|
657
673
|
|
|
658
|
-
export type
|
|
674
|
+
export type ProcessInstanceExit = RunnerProcessInstanceExit | PiWriterProcessInstanceExit;
|
|
659
675
|
|
|
660
|
-
export interface
|
|
676
|
+
export interface CanonicalSessionTerminal {
|
|
661
677
|
canonicalSessionId: string;
|
|
662
678
|
leaseDisposition: "released" | "not-held";
|
|
663
679
|
freeAtObservation: true;
|
|
664
680
|
canonicalSessionLeaseReleased?: true;
|
|
665
681
|
}
|
|
666
682
|
|
|
667
|
-
interface
|
|
683
|
+
interface ProcessTerminalBase {
|
|
668
684
|
version: 1;
|
|
669
685
|
runId: string;
|
|
670
686
|
childIndex?: number;
|
|
@@ -674,15 +690,15 @@ interface ProcessTerminalBaseV1 {
|
|
|
674
690
|
resumeDisposition?: "resumable" | "non-resumable" | "unavailable";
|
|
675
691
|
}
|
|
676
692
|
|
|
677
|
-
export type
|
|
678
|
-
| (
|
|
679
|
-
| (
|
|
693
|
+
export type ProcessTerminal =
|
|
694
|
+
| (ProcessTerminalBase & { state: "pending" | "not-started" })
|
|
695
|
+
| (ProcessTerminalBase & {
|
|
680
696
|
state: "observed";
|
|
681
697
|
observedAt: number;
|
|
682
|
-
instances:
|
|
683
|
-
canonicalSession?:
|
|
698
|
+
instances: ProcessInstanceExit[];
|
|
699
|
+
canonicalSession?: CanonicalSessionTerminal;
|
|
684
700
|
})
|
|
685
|
-
| (
|
|
701
|
+
| (ProcessTerminalBase & {
|
|
686
702
|
state: "unknown";
|
|
687
703
|
reason: ProcessTerminalReason;
|
|
688
704
|
diagnostic?: string;
|
|
@@ -778,6 +794,8 @@ export interface RunFanoutRejection extends RunFanoutBudgetSnapshot {
|
|
|
778
794
|
}
|
|
779
795
|
|
|
780
796
|
export interface SteeringRecoveryDescriptor {
|
|
797
|
+
/** Captured response identity authority; absence means no declared aliases on revival. */
|
|
798
|
+
modelResponseAliases?: Record<string, string[]>;
|
|
781
799
|
version: 1;
|
|
782
800
|
launchContractDigest?: string;
|
|
783
801
|
extensionBindings?: ExtensionBindings;
|
|
@@ -786,6 +804,8 @@ export interface SteeringRecoveryDescriptor {
|
|
|
786
804
|
agentContract?: AgentContract;
|
|
787
805
|
agent: string;
|
|
788
806
|
sessionFile?: string;
|
|
807
|
+
/** Git ref used to allocate managed worktrees for this run. */
|
|
808
|
+
baseRef?: string;
|
|
789
809
|
cwd: string;
|
|
790
810
|
model?: string;
|
|
791
811
|
modelProvider?: string;
|
|
@@ -827,7 +847,7 @@ export interface SteeringRecoveryDescriptor {
|
|
|
827
847
|
maxSubagentDepth: number;
|
|
828
848
|
maxOutput?: MaxOutputConfig;
|
|
829
849
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
830
|
-
launchResolvedExtensions?:
|
|
850
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
831
851
|
share: boolean;
|
|
832
852
|
sessionDir?: string;
|
|
833
853
|
artifactsDir?: string;
|
|
@@ -1159,16 +1179,7 @@ export interface AcceptanceLedger {
|
|
|
1159
1179
|
};
|
|
1160
1180
|
}
|
|
1161
1181
|
|
|
1162
|
-
export interface
|
|
1163
|
-
code: "protocol_output_limit";
|
|
1164
|
-
stream: "stdout" | "stderr";
|
|
1165
|
-
limitBytes: number;
|
|
1166
|
-
observedBytes: number;
|
|
1167
|
-
diagnosticPrefix: string;
|
|
1168
|
-
diagnosticTail: string;
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
export interface LaunchResolvedChildExtensionsV1 {
|
|
1182
|
+
export interface LaunchResolvedChildExtensions {
|
|
1172
1183
|
version: 1;
|
|
1173
1184
|
/** This is parent-resolved launch intent, not child-runtime acknowledgement that extensions loaded. */
|
|
1174
1185
|
source: "launch-resolved";
|
|
@@ -1183,7 +1194,7 @@ export interface LaunchResolvedChildExtensionsV1 {
|
|
|
1183
1194
|
};
|
|
1184
1195
|
}
|
|
1185
1196
|
|
|
1186
|
-
export interface
|
|
1197
|
+
export interface RuntimeAcknowledgedChildExtensions {
|
|
1187
1198
|
version: 1;
|
|
1188
1199
|
/** Best-effort child-runtime registration acknowledgement, not extension health. */
|
|
1189
1200
|
source: "child-runtime";
|
|
@@ -1262,7 +1273,6 @@ export interface SingleResult {
|
|
|
1262
1273
|
* a signal to reduce input size or re-decompose the task.
|
|
1263
1274
|
*/
|
|
1264
1275
|
contextOverflow?: boolean;
|
|
1265
|
-
protocolError?: ProtocolOutputLimit;
|
|
1266
1276
|
sessionFile?: string;
|
|
1267
1277
|
skills?: string[];
|
|
1268
1278
|
skillsWarning?: string;
|
|
@@ -1287,8 +1297,8 @@ export interface SingleResult {
|
|
|
1287
1297
|
acceptance?: AcceptanceLedger;
|
|
1288
1298
|
agentContract?: AgentContract;
|
|
1289
1299
|
launchContractDigest?: string;
|
|
1290
|
-
launchResolvedExtensions?:
|
|
1291
|
-
runtimeAcknowledgedExtensions?:
|
|
1300
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1301
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1292
1302
|
execution?: ExecutionProjection;
|
|
1293
1303
|
review?: ReviewProjection;
|
|
1294
1304
|
effects?: EffectsProjection;
|
|
@@ -1346,6 +1356,7 @@ export interface WaitCompletionChild {
|
|
|
1346
1356
|
*/
|
|
1347
1357
|
export interface WaitCompletion {
|
|
1348
1358
|
runId: string;
|
|
1359
|
+
workflowReceiptPath?: string;
|
|
1349
1360
|
agent?: string;
|
|
1350
1361
|
mode?: string;
|
|
1351
1362
|
state?: string;
|
|
@@ -1353,7 +1364,7 @@ export interface WaitCompletion {
|
|
|
1353
1364
|
/** Versioned bounded output archive retained with the durable completion replay. */
|
|
1354
1365
|
archivePath?: string;
|
|
1355
1366
|
results?: WaitCompletionChild[];
|
|
1356
|
-
workflowChildren?:
|
|
1367
|
+
workflowChildren?: WorkflowChildSummary;
|
|
1357
1368
|
}
|
|
1358
1369
|
|
|
1359
1370
|
export interface AgentCapabilitiesSnapshot {
|
|
@@ -1369,7 +1380,7 @@ export interface AgentCapabilityRow {
|
|
|
1369
1380
|
executable: boolean;
|
|
1370
1381
|
restrictionSources?: string[];
|
|
1371
1382
|
aliases?: string[];
|
|
1372
|
-
runner: { type: "pi" } | { type: "external-cli"; adapter?: string; capabilities: ExternalCliCapabilities } | { type: "external-job"; provider: string; available?: boolean; capabilities: ExternalJobRunnerStatus["capabilities"] };
|
|
1383
|
+
runner: { type: "pi" } | { type: "external-cli"; adapter?: string; command: string; available: boolean; unavailableReason?: string; capabilities: ExternalCliCapabilities } | { type: "external-job"; provider: string; available?: boolean; capabilities: ExternalJobRunnerStatus["capabilities"] };
|
|
1373
1384
|
tools: { ambient: boolean; names: string[]; excludeTools?: string[]; mcpDirectTools: string[]; mutationTools?: string[] };
|
|
1374
1385
|
model?: { value?: string; fallbackModels?: string[]; thinking?: string | false };
|
|
1375
1386
|
execution?: { defaultAsync?: boolean; timeoutMs?: number };
|
|
@@ -1379,13 +1390,14 @@ export interface AgentCapabilityRow {
|
|
|
1379
1390
|
|
|
1380
1391
|
export interface Details {
|
|
1381
1392
|
mode: SubagentResultMode | "management";
|
|
1393
|
+
workflowReceiptPath?: string;
|
|
1382
1394
|
runId?: string;
|
|
1383
1395
|
/** Host tool-call id retained when it differs from the internal run id. */
|
|
1384
1396
|
toolCallId?: string;
|
|
1385
1397
|
/** Run-level context summary. "mixed" when children resolved to different modes. */
|
|
1386
1398
|
context?: "fresh" | "fork" | "mixed";
|
|
1387
1399
|
results: SingleResult[];
|
|
1388
|
-
workflowChildren?:
|
|
1400
|
+
workflowChildren?: WorkflowChildSummary;
|
|
1389
1401
|
/**
|
|
1390
1402
|
* Terminal completion payloads for runs this bg_wait call observed
|
|
1391
1403
|
* finishing. Async completions travel as result files that are consumed and
|
|
@@ -1428,7 +1440,7 @@ export interface Details {
|
|
|
1428
1440
|
currentStepIndex?: number; // 0-indexed current step (for running chains)
|
|
1429
1441
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1430
1442
|
/** Validated, display-only fanout plan supplied with a workflow launch. */
|
|
1431
|
-
preflight?:
|
|
1443
|
+
preflight?: WorkflowPreflight;
|
|
1432
1444
|
preflightWarnings?: string[];
|
|
1433
1445
|
outputs?: ChainOutputMap;
|
|
1434
1446
|
// Aggregated child usage across all agents in the run
|
|
@@ -1444,11 +1456,11 @@ export interface Details {
|
|
|
1444
1456
|
agentCapabilities?: AgentCapabilitiesSnapshot;
|
|
1445
1457
|
parallelHandoff?: ParallelHandoffReference;
|
|
1446
1458
|
lifecycleStatus?: {
|
|
1447
|
-
processTerminal?:
|
|
1459
|
+
processTerminal?: ProcessTerminal;
|
|
1448
1460
|
};
|
|
1449
1461
|
launchContractDigest?: string;
|
|
1450
|
-
launchResolvedExtensions?:
|
|
1451
|
-
runtimeAcknowledgedExtensions?:
|
|
1462
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1463
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1452
1464
|
/** Original launch contract whose persisted session is being revived. */
|
|
1453
1465
|
sourceLaunchContractDigest?: string;
|
|
1454
1466
|
/** Durable mission attached to this run, when mission mode was explicitly used. */
|
|
@@ -1459,7 +1471,7 @@ export interface Details {
|
|
|
1459
1471
|
mission?: MissionRecord;
|
|
1460
1472
|
workflow?: {
|
|
1461
1473
|
value?: unknown;
|
|
1462
|
-
resource?:
|
|
1474
|
+
resource?: WorkflowResourceProvenance;
|
|
1463
1475
|
preflightWarnings?: string[];
|
|
1464
1476
|
trace: Array<{
|
|
1465
1477
|
operation: "run" | "status" | "steer" | "host";
|
|
@@ -1572,9 +1584,9 @@ export interface NestedStepSummary {
|
|
|
1572
1584
|
wrapUpRequested?: boolean;
|
|
1573
1585
|
toolBudget?: ToolBudgetState;
|
|
1574
1586
|
toolBudgetBlocked?: boolean;
|
|
1575
|
-
processTerminal?:
|
|
1576
|
-
launchResolvedExtensions?:
|
|
1577
|
-
runtimeAcknowledgedExtensions?:
|
|
1587
|
+
processTerminal?: ProcessTerminal;
|
|
1588
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1589
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1578
1590
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1579
1591
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1580
1592
|
children?: NestedRunSummary[];
|
|
@@ -1592,9 +1604,9 @@ export interface NestedRunSummary extends NestedRunAddress {
|
|
|
1592
1604
|
controlInbox?: string;
|
|
1593
1605
|
capabilityToken?: string;
|
|
1594
1606
|
mode?: SubagentRunMode;
|
|
1595
|
-
processTerminal?:
|
|
1596
|
-
launchResolvedExtensions?:
|
|
1597
|
-
runtimeAcknowledgedExtensions?:
|
|
1607
|
+
processTerminal?: ProcessTerminal;
|
|
1608
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1609
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1598
1610
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1599
1611
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1600
1612
|
state: NestedRunState;
|
|
@@ -1662,10 +1674,10 @@ export interface AsyncStartedEvent {
|
|
|
1662
1674
|
chainStepCount?: number;
|
|
1663
1675
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
1664
1676
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1665
|
-
preflight?:
|
|
1677
|
+
preflight?: WorkflowPreflight;
|
|
1666
1678
|
launchContractDigest?: string;
|
|
1667
|
-
launchResolvedExtensions?:
|
|
1668
|
-
runtimeAcknowledgedExtensions?:
|
|
1679
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1680
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1669
1681
|
usageBudget?: UsageBudgetState;
|
|
1670
1682
|
timeoutMs?: number;
|
|
1671
1683
|
deadlineAt?: number;
|
|
@@ -1786,6 +1798,8 @@ export interface ExternalProcessStatus {
|
|
|
1786
1798
|
}
|
|
1787
1799
|
|
|
1788
1800
|
export interface AsyncStatus {
|
|
1801
|
+
/** Exact reference returned by successful current workflow receipt publication. */
|
|
1802
|
+
workflowReceiptPath?: string;
|
|
1789
1803
|
lifecycleArtifactVersion?: SubagentLifecycleArtifactVersion;
|
|
1790
1804
|
runId: string;
|
|
1791
1805
|
/** Parent Pi process/window that owns local completion delivery. */
|
|
@@ -1830,17 +1844,17 @@ export interface AsyncStatus {
|
|
|
1830
1844
|
pendingAppends?: number;
|
|
1831
1845
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
1832
1846
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1833
|
-
preflight?:
|
|
1834
|
-
processTerminal?:
|
|
1847
|
+
preflight?: WorkflowPreflight;
|
|
1848
|
+
processTerminal?: ProcessTerminal;
|
|
1835
1849
|
runFanoutBudget?: RunFanoutBudgetSnapshot;
|
|
1836
1850
|
runFanoutBudgetDescriptor?: RunFanoutBudgetDescriptor;
|
|
1837
1851
|
launchContractDigest?: string;
|
|
1838
|
-
launchResolvedExtensions?:
|
|
1839
|
-
runtimeAcknowledgedExtensions?:
|
|
1852
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1853
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1840
1854
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1841
1855
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1842
1856
|
workflow?: Details["workflow"];
|
|
1843
|
-
workflowChildren?:
|
|
1857
|
+
workflowChildren?: WorkflowChildSummary;
|
|
1844
1858
|
parentWorkflowRunId?: string;
|
|
1845
1859
|
workflowKey?: string;
|
|
1846
1860
|
lane?: WorkflowLaneMetadata;
|
|
@@ -1926,13 +1940,13 @@ export interface AsyncStatus {
|
|
|
1926
1940
|
acceptance?: AcceptanceLedger;
|
|
1927
1941
|
agentContract?: AgentContract;
|
|
1928
1942
|
launchContractDigest?: string;
|
|
1929
|
-
launchResolvedExtensions?:
|
|
1930
|
-
runtimeAcknowledgedExtensions?:
|
|
1943
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
1944
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
1931
1945
|
execution?: ExecutionProjection;
|
|
1932
1946
|
review?: ReviewProjection;
|
|
1933
1947
|
effects?: EffectsProjection;
|
|
1934
1948
|
watchdog?: ChildWatchdogProgress;
|
|
1935
|
-
processTerminal?:
|
|
1949
|
+
processTerminal?: ProcessTerminal;
|
|
1936
1950
|
capabilityCeiling?: ResolvedSubagentCapabilityCeiling;
|
|
1937
1951
|
capabilityAudit?: SubagentCapabilityAudit;
|
|
1938
1952
|
}>;
|
|
@@ -1982,11 +1996,11 @@ export interface AsyncJobState {
|
|
|
1982
1996
|
chainStepCount?: number;
|
|
1983
1997
|
parallelGroups?: AsyncParallelGroupStatus[];
|
|
1984
1998
|
/** Bounded host-owned CI/gate nodes loaded from the workflow status graph. */
|
|
1985
|
-
hostSteps?:
|
|
1999
|
+
hostSteps?: HostStepNode[];
|
|
1986
2000
|
/** Full bounded workflow plan, including not-yet-materialized stages. */
|
|
1987
2001
|
workflowGraph?: WorkflowGraphSnapshot;
|
|
1988
2002
|
steps?: AsyncJobStep[];
|
|
1989
|
-
preflight?:
|
|
2003
|
+
preflight?: WorkflowPreflight;
|
|
1990
2004
|
stepsTotal?: number;
|
|
1991
2005
|
runningSteps?: number;
|
|
1992
2006
|
completedSteps?: number;
|
|
@@ -2015,7 +2029,7 @@ export interface AsyncJobState {
|
|
|
2015
2029
|
parentWorkflowRunId?: string;
|
|
2016
2030
|
workflowKey?: string;
|
|
2017
2031
|
workflow?: Details["workflow"];
|
|
2018
|
-
workflowChildren?:
|
|
2032
|
+
workflowChildren?: WorkflowChildSummary;
|
|
2019
2033
|
lane?: WorkflowLaneMetadata;
|
|
2020
2034
|
}
|
|
2021
2035
|
|
|
@@ -2054,6 +2068,7 @@ export interface ForegroundResumeChild {
|
|
|
2054
2068
|
agentContract?: AgentContract;
|
|
2055
2069
|
/** Private bounded launch fields needed to preserve the child contract on resume. */
|
|
2056
2070
|
resumeContract?: {
|
|
2071
|
+
modelResponseAliases?: Record<string, string[]>;
|
|
2057
2072
|
outputSchema?: JsonSchemaObject;
|
|
2058
2073
|
agentContract?: AgentContract;
|
|
2059
2074
|
acceptance?: AcceptanceInput;
|
|
@@ -2063,8 +2078,8 @@ export interface ForegroundResumeChild {
|
|
|
2063
2078
|
launchContractDigest?: string;
|
|
2064
2079
|
/** Private retained launch authority. Never project into status or result output. */
|
|
2065
2080
|
extensionBindings?: ExtensionBindings;
|
|
2066
|
-
launchResolvedExtensions?:
|
|
2067
|
-
runtimeAcknowledgedExtensions?:
|
|
2081
|
+
launchResolvedExtensions?: LaunchResolvedChildExtensions;
|
|
2082
|
+
runtimeAcknowledgedExtensions?: RuntimeAcknowledgedChildExtensions;
|
|
2068
2083
|
execution?: ExecutionProjection;
|
|
2069
2084
|
review?: ReviewProjection;
|
|
2070
2085
|
effects?: EffectsProjection;
|
|
@@ -2107,6 +2122,18 @@ export interface ForegroundChildControl {
|
|
|
2107
2122
|
toolCount?: number;
|
|
2108
2123
|
interrupt?: () => boolean;
|
|
2109
2124
|
detach?: () => boolean;
|
|
2125
|
+
/** Steer the live in-process child session; undefined until the session exists. */
|
|
2126
|
+
steer?: (input: ForegroundSteerInput) => Promise<ForegroundSteerOutcome>;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
export interface ForegroundSteerInput {
|
|
2130
|
+
message: string;
|
|
2131
|
+
mode?: "steer" | "follow_up" | "auto";
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
export interface ForegroundSteerOutcome {
|
|
2135
|
+
state: "delivered" | "queued" | "failed";
|
|
2136
|
+
reason?: string;
|
|
2110
2137
|
}
|
|
2111
2138
|
|
|
2112
2139
|
export interface ForegroundRunControl {
|
|
@@ -2115,8 +2142,6 @@ export interface ForegroundRunControl {
|
|
|
2115
2142
|
parentWorkflowRunId?: string;
|
|
2116
2143
|
/** Stable workflow lane key for this live foreground child. */
|
|
2117
2144
|
workflowKey?: string;
|
|
2118
|
-
/** Private control root used to steer a live workflow-owned child. */
|
|
2119
|
-
workflowSteeringDir?: string;
|
|
2120
2145
|
/** Originating parent session; required for public fleet projection. */
|
|
2121
2146
|
sessionId?: string;
|
|
2122
2147
|
mode: SubagentRunMode;
|
|
@@ -2158,6 +2183,7 @@ export interface ForegroundRunControl {
|
|
|
2158
2183
|
nestedChildren?: NestedRunSummary[];
|
|
2159
2184
|
interrupt?: () => boolean;
|
|
2160
2185
|
detach?: () => boolean;
|
|
2186
|
+
steer?: ForegroundChildControl["steer"];
|
|
2161
2187
|
}
|
|
2162
2188
|
|
|
2163
2189
|
export interface WaitSubscriptionRecord {
|
|
@@ -2180,6 +2206,8 @@ export interface ActiveAsyncCapacitySnapshot {
|
|
|
2180
2206
|
export interface SubagentState {
|
|
2181
2207
|
baseCwd: string;
|
|
2182
2208
|
currentSessionId: string | null;
|
|
2209
|
+
/** Exact SDK runtime session ID for supervisor ownership; never a session file path. */
|
|
2210
|
+
supervisorOwnerSessionId?: string | null;
|
|
2183
2211
|
/** Session for which active status projections were restored successfully. */
|
|
2184
2212
|
statusProjectionSessionId?: string | null;
|
|
2185
2213
|
/** Reload-stable identity for this parent Pi process/window. */
|
|
@@ -2197,6 +2225,8 @@ export interface SubagentState {
|
|
|
2197
2225
|
trustedSessionFileRoot?: string;
|
|
2198
2226
|
/** Live async session roots created by this parent executor, keyed by run id. */
|
|
2199
2227
|
liveAsyncSessionRoots?: Map<string, string>;
|
|
2228
|
+
/** Foreground nested routes retained after their direct parent settles, keyed by root run id. */
|
|
2229
|
+
retainedForegroundNestedRoutes?: Map<string, NestedRouteInfo>;
|
|
2200
2230
|
/** Last valid parent session model observed for this session; used when continuation contexts omit ctx.model. */
|
|
2201
2231
|
lastParentModel?: { provider: string; id: string };
|
|
2202
2232
|
subagentInProgress?: boolean;
|
|
@@ -2318,17 +2348,25 @@ export interface SubagentChildStatusEvent {
|
|
|
2318
2348
|
// Execution Options
|
|
2319
2349
|
// ============================================================================
|
|
2320
2350
|
|
|
2351
|
+
/** Live controls for one in-process foreground child session. */
|
|
2352
|
+
export interface ForegroundChildSessionControls {
|
|
2353
|
+
steer: (text: string) => Promise<void>;
|
|
2354
|
+
followUp: (text: string) => Promise<void>;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2321
2357
|
export interface RunSyncOptions {
|
|
2322
2358
|
/** Exact discovery provenance for an unknown-agent error; omission uses defensive fallback discovery. */
|
|
2323
2359
|
unknownAgentDiagnosticContext?: import("../agents/agents.ts").UnknownAgentDiagnosticContext;
|
|
2360
|
+
/** Session factory for the in-process child; defaults to the process-wide factory. */
|
|
2361
|
+
childSessionFactory?: import("../runs/shared/child-session.ts").ChildSessionFactory;
|
|
2362
|
+
/** The launching executor's own child runtime when it is itself an in-process child. */
|
|
2363
|
+
childRuntime?: import("../runs/shared/child-runtime-config.ts").ChildRuntimeConfig;
|
|
2364
|
+
/** Fires once the child session exists and can be steered. */
|
|
2365
|
+
onChildSession?: (controls: ForegroundChildSessionControls) => void;
|
|
2324
2366
|
/** Opt-in global permission rules; missing tools remain allowed. */
|
|
2325
2367
|
permissions?: import("../runs/shared/permissions.ts").PermissionConfig;
|
|
2326
2368
|
/** Session id of the direct parent session for permission-system ask forwarding. */
|
|
2327
2369
|
parentSessionId?: string;
|
|
2328
|
-
/** Private prompt-runtime steering transport for workflow-owned foreground children. */
|
|
2329
|
-
steerInboxDir?: string;
|
|
2330
|
-
steerCapabilityPath?: string;
|
|
2331
|
-
steerAckDir?: string;
|
|
2332
2370
|
/** Resolved launch context for this child. */
|
|
2333
2371
|
context?: "fresh" | "fork";
|
|
2334
2372
|
cwd?: string;
|
|
@@ -2356,7 +2394,7 @@ export interface RunSyncOptions {
|
|
|
2356
2394
|
/** Internal foreground receipt proposal; returns true only when the outer waiter accepted it. */
|
|
2357
2395
|
onDetachReceipt?: (result: SingleResult) => boolean;
|
|
2358
2396
|
/** Authoritative terminal result, emitted only after the full detached run finalizes. */
|
|
2359
|
-
onDetachedExit?: (result: SingleResult) => void
|
|
2397
|
+
onDetachedExit?: (result: SingleResult) => void | Promise<void>;
|
|
2360
2398
|
controlConfig?: ResolvedControlConfig;
|
|
2361
2399
|
intercomSessionName?: string;
|
|
2362
2400
|
orchestratorIntercomTarget?: string;
|
|
@@ -2397,6 +2435,7 @@ export interface RunSyncOptions {
|
|
|
2397
2435
|
workflowChildPermitLaunch?: WorkflowChildPermitContext;
|
|
2398
2436
|
/** Registry models available for heuristic bare-model resolution */
|
|
2399
2437
|
availableModels?: Array<{ provider: string; id: string; fullId: string; contextWindow?: number }>;
|
|
2438
|
+
modelResponseAliases?: Record<string, string[]>;
|
|
2400
2439
|
/** Current parent-session provider to prefer for ambiguous bare model ids */
|
|
2401
2440
|
preferredModelProvider?: string;
|
|
2402
2441
|
/** Parent Pi event host used to snapshot runtime-registered MCP servers before child launch. */
|
|
@@ -2410,6 +2449,7 @@ export interface RunSyncOptions {
|
|
|
2410
2449
|
schemaPath: string;
|
|
2411
2450
|
outputPath: string;
|
|
2412
2451
|
acceptanceReportPath?: string;
|
|
2452
|
+
acceptanceReportRequired?: boolean;
|
|
2413
2453
|
};
|
|
2414
2454
|
agentContract?: AgentContract;
|
|
2415
2455
|
acceptance?: AcceptanceInput;
|
|
@@ -2531,7 +2571,9 @@ export interface ExtensionConfig {
|
|
|
2531
2571
|
asyncWidget?: boolean;
|
|
2532
2572
|
/** Configure the process-wide TTL policy for persisted model exclusions. */
|
|
2533
2573
|
modelExclusions?: ModelExclusionsConfig;
|
|
2534
|
-
/**
|
|
2574
|
+
/** Exact provider/model candidates mapped to operator-declared equivalent response IDs. Empty arrays add no accepted IDs. */
|
|
2575
|
+
modelResponseAliases?: Record<string, string[]>;
|
|
2576
|
+
/** Tool description variant registered for the parent-facing subagent tool. Defaults to full. */
|
|
2535
2577
|
toolDescriptionMode?: ToolDescriptionMode;
|
|
2536
2578
|
/** Inline chat rendering for the subagent tool. Defaults to rich. */
|
|
2537
2579
|
inlineToolDisplay?: InlineToolDisplay;
|
|
@@ -2765,8 +2807,17 @@ export function normalizeMaxSubagentDepth(value: unknown): number | undefined {
|
|
|
2765
2807
|
return normalizeNonNegativeInteger(value);
|
|
2766
2808
|
}
|
|
2767
2809
|
|
|
2768
|
-
|
|
2769
|
-
|
|
2810
|
+
/** Depth context of the executor's own child runtime, when it runs as an in-process child. */
|
|
2811
|
+
export interface SubagentDepthContext {
|
|
2812
|
+
depth: number;
|
|
2813
|
+
maxDepth?: number;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
/** Operator override for the top-level parent; children inherit their limit through their runtime config. */
|
|
2817
|
+
export const SUBAGENT_MAX_DEPTH_ENV = "SELESAI_SUBAGENT_MAX_DEPTH";
|
|
2818
|
+
|
|
2819
|
+
export function resolveCurrentMaxSubagentDepth(configMaxDepth?: number, runtime?: SubagentDepthContext): number {
|
|
2820
|
+
return normalizeMaxSubagentDepth(runtime ? runtime.maxDepth : process.env[SUBAGENT_MAX_DEPTH_ENV])
|
|
2770
2821
|
?? normalizeMaxSubagentDepth(configMaxDepth)
|
|
2771
2822
|
?? DEFAULT_SUBAGENT_MAX_DEPTH;
|
|
2772
2823
|
}
|
|
@@ -2777,19 +2828,24 @@ export function resolveChildMaxSubagentDepth(parentMaxDepth: number, agentMaxDep
|
|
|
2777
2828
|
return normalizedAgent === undefined ? normalizedParent : Math.min(normalizedParent, normalizedAgent);
|
|
2778
2829
|
}
|
|
2779
2830
|
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2831
|
+
/** Depth of the executor itself: 0 for a top-level parent, its own child depth otherwise. */
|
|
2832
|
+
export function resolveCurrentSubagentDepth(runtime?: SubagentDepthContext): number {
|
|
2833
|
+
const depth = runtime ? runtime.depth : 0;
|
|
2834
|
+
return Number.isFinite(depth) ? depth : 0;
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
export function checkSubagentDepth(configMaxDepth?: number, runtime?: SubagentDepthContext): { blocked: boolean; depth: number; maxDepth: number } {
|
|
2838
|
+
const depth = resolveCurrentSubagentDepth(runtime);
|
|
2839
|
+
const maxDepth = resolveCurrentMaxSubagentDepth(configMaxDepth, runtime);
|
|
2840
|
+
const blocked = depth >= maxDepth;
|
|
2784
2841
|
return { blocked, depth, maxDepth };
|
|
2785
2842
|
}
|
|
2786
2843
|
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
const nextDepth = Number.isFinite(parentDepth) ? parentDepth + 1 : 1;
|
|
2844
|
+
/** Depth context handed to a child launched by an executor at `runtime` (undefined for a top-level parent). */
|
|
2845
|
+
export function resolveChildDepth(maxDepth?: number, runtime?: SubagentDepthContext): Required<SubagentDepthContext> {
|
|
2790
2846
|
return {
|
|
2791
|
-
|
|
2792
|
-
|
|
2847
|
+
depth: resolveCurrentSubagentDepth(runtime) + 1,
|
|
2848
|
+
maxDepth: normalizeMaxSubagentDepth(maxDepth) ?? resolveCurrentMaxSubagentDepth(undefined, runtime),
|
|
2793
2849
|
};
|
|
2794
2850
|
}
|
|
2795
2851
|
|
|
@@ -135,6 +135,9 @@ function isNotFoundError(error: unknown): boolean {
|
|
|
135
135
|
* Read async job status from disk (with mtime-based caching)
|
|
136
136
|
*/
|
|
137
137
|
export function readStatus(asyncDir: string): AsyncStatus | null {
|
|
138
|
+
if (Buffer.byteLength(path.basename(asyncDir), "utf-8") > 255) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
138
141
|
const statusPath = path.join(asyncDir, "status.json");
|
|
139
142
|
|
|
140
143
|
let stat: fs.Stats;
|
|
@@ -413,10 +416,9 @@ export function compactForegroundDetails(details: Details): Details {
|
|
|
413
416
|
*
|
|
414
417
|
* The completed-compaction helpers above bail out while a child is still
|
|
415
418
|
* `running`, so a long or deeply nested fan-out streams full, unbounded progress on
|
|
416
|
-
* every tick.
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
* `protocol_output_limit`.
|
|
419
|
+
* every tick. The parent records every streamed `tool_execution_update` in its
|
|
420
|
+
* transcript and `events.jsonl`, so an unbounded running snapshot grows those
|
|
421
|
+
* artifacts and the live display state without bound.
|
|
420
422
|
*
|
|
421
423
|
* These bound the STREAMED snapshot only. The final returned result keeps the full
|
|
422
424
|
* live progress and message transcript, and every live-display consumer already
|
|
@@ -455,8 +457,13 @@ export function hasEmptyTerminalAssistantResponse(messages: Message[]): boolean
|
|
|
455
457
|
const lastAssistant = messages.findLast((message) => message.role === "assistant");
|
|
456
458
|
return lastAssistant?.role === "assistant"
|
|
457
459
|
&& Array.isArray(lastAssistant.content)
|
|
458
|
-
&& lastAssistant.content.length === 0
|
|
459
|
-
|
|
460
|
+
&& ((lastAssistant.content.length === 0 && lastAssistant.usage.output === 0)
|
|
461
|
+
|| (messages.at(-1) === lastAssistant
|
|
462
|
+
&& lastAssistant.stopReason === "stop"
|
|
463
|
+
&& !lastAssistant.errorMessage
|
|
464
|
+
&& lastAssistant.content.length > 0
|
|
465
|
+
// Token accounting can be nonzero even when no response text was emitted.
|
|
466
|
+
&& lastAssistant.content.every((part) => part.type === "text" && part.text === "")));
|
|
460
467
|
}
|
|
461
468
|
|
|
462
469
|
export function formatEmptyTerminalAssistantResponseError(messages: Message[]): string {
|