@selesai/code 0.8.3 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/extensions/handoff-new.ts +1 -1
- package/dist/extensions/inline-skills.test.ts +1 -0
- package/dist/extensions/inline-skills.ts +1 -1
- package/dist/extensions/pi-intercom/CHANGELOG.md +25 -3
- package/dist/extensions/pi-intercom/README.md +34 -15
- package/dist/extensions/pi-intercom/broker/broker.ts +38 -141
- package/dist/extensions/pi-intercom/broker/client-liveness.test.ts +173 -0
- package/dist/extensions/pi-intercom/broker/client.ts +78 -150
- package/dist/extensions/pi-intercom/broker/extension-state.ts +18 -7
- package/dist/extensions/pi-intercom/broker/framing.ts +1 -1
- package/dist/extensions/pi-intercom/broker/protocol.ts +182 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +106 -7
- package/dist/extensions/pi-intercom/broker/spawn.ts +37 -11
- package/dist/extensions/pi-intercom/config.test.ts +8 -10
- package/dist/extensions/pi-intercom/config.ts +3 -3
- package/dist/extensions/pi-intercom/index.ts +218 -147
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +891 -103
- package/dist/extensions/pi-intercom/package.json +3 -2
- package/dist/extensions/pi-intercom/project-agent.test.ts +145 -0
- package/dist/extensions/pi-intercom/project-agent.ts +324 -0
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +86 -1
- package/dist/extensions/pi-intercom/reply-tracker.ts +41 -9
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +49 -9
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +9 -9
- package/dist/extensions/pi-intercom/types.ts +3 -1
- package/dist/extensions/pi-intercom/ui/inline-message.ts +7 -7
- package/dist/extensions/pi-powerline-footer/.github/workflows/test.yml +2 -2
- package/dist/extensions/pi-powerline-footer/CHANGELOG.md +14 -1
- package/dist/extensions/pi-powerline-footer/README.md +20 -37
- package/dist/extensions/pi-powerline-footer/bash-mode/completion.ts +40 -25
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +149 -18
- package/dist/extensions/pi-powerline-footer/bash-mode/types.ts +1 -0
- package/dist/extensions/pi-powerline-footer/editor-performance.ts +99 -0
- package/dist/extensions/pi-powerline-footer/git-status.ts +15 -0
- package/dist/extensions/pi-powerline-footer/index.ts +394 -317
- package/dist/extensions/pi-powerline-footer/package.json +1 -1
- package/dist/extensions/pi-powerline-footer/powerline-config.ts +0 -12
- package/dist/extensions/pi-powerline-footer/queue/store.ts +8 -56
- package/dist/extensions/pi-powerline-footer/queue/types.ts +1 -2
- package/dist/extensions/pi-powerline-footer/segments.ts +0 -3
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +231 -1
- package/dist/extensions/pi-powerline-footer/tests/custom-items.test.ts +5 -19
- package/dist/extensions/pi-powerline-footer/tests/editor-performance.test.ts +43 -0
- package/dist/extensions/pi-powerline-footer/tests/git-optional-locks.test.ts +64 -0
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +116 -0
- package/dist/extensions/pi-powerline-footer/tests/queue-store.test.ts +19 -149
- package/dist/extensions/pi-powerline-footer/tests/remaining-regressions.test.ts +6 -0
- package/dist/extensions/pi-powerline-footer/tests/usage-display.test.ts +5 -5
- package/dist/extensions/pi-powerline-footer/types.ts +1 -2
- package/dist/extensions/pi-subagents/CHANGELOG.md +202 -14
- package/dist/extensions/pi-subagents/README.md +65 -1614
- package/dist/extensions/pi-subagents/agents/builder.md +0 -1
- package/dist/extensions/pi-subagents/agents/delegate.md +14 -0
- package/dist/extensions/pi-subagents/agents/oracle.md +74 -0
- package/dist/extensions/pi-subagents/agents/reviewer.md +78 -0
- package/dist/extensions/pi-subagents/agents/scout.md +50 -0
- package/dist/extensions/pi-subagents/agents/worker.md +58 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +328 -0
- package/dist/extensions/pi-subagents/docs/extension-api.md +308 -0
- package/dist/extensions/pi-subagents/docs/missions.md +119 -0
- package/dist/extensions/pi-subagents/docs/models.md +192 -0
- package/dist/extensions/pi-subagents/docs/observability.md +174 -0
- package/dist/extensions/pi-subagents/docs/tool-reference.md +343 -0
- package/dist/extensions/pi-subagents/docs/watchdog.md +176 -0
- package/dist/extensions/pi-subagents/docs/workflows.md +163 -0
- package/dist/extensions/pi-subagents/inspector-runner.mjs +11 -0
- package/dist/extensions/pi-subagents/package-lock.json +152 -194
- package/dist/extensions/pi-subagents/package.json +9 -10
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +9 -9
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +6 -6
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +8 -8
- package/dist/extensions/pi-subagents/prompts/review-loop.md +12 -12
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +22 -17
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +77 -72
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +177 -69
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +28 -8
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +88 -66
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +3 -3
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +624 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +29 -16
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +7 -3
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +2 -2
- package/dist/extensions/pi-subagents/src/agents/skills.ts +2 -9
- package/dist/extensions/pi-subagents/src/api/delegation.ts +1 -2
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +30 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +56 -8
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +2 -2
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +51 -26
- package/dist/extensions/pi-subagents/src/extension/index.ts +119 -50
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +72 -0
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +15 -15
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +58 -21
- package/dist/extensions/pi-subagents/src/extension/subagent-guide.ts +39 -0
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +47 -25
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +3 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +460 -64
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +102 -4
- package/dist/extensions/pi-subagents/src/missions/actions.ts +77 -16
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +162 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +65 -14
- package/dist/extensions/pi-subagents/src/missions/store.ts +147 -5
- package/dist/extensions/pi-subagents/src/missions/types.ts +58 -3
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +256 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +8 -8
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +42 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +41 -7
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +294 -134
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +19 -3
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +39 -6
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +267 -0
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +145 -60
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +114 -6
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +33 -0
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +68 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +71 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +21 -2
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +42 -14
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +12 -24
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +7 -5
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +152 -68
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +146 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +21 -5
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +85 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +43 -18
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +20 -19
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +3 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +55 -26
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +137 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +798 -112
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +187 -0
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +165 -22
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +9 -5
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +12 -2
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +1 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +465 -116
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +10 -10
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +189 -32
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +2 -2
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +3 -3
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +128 -3
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +100 -0
- package/dist/extensions/pi-subagents/src/shared/file-coalescer.ts +9 -0
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +13 -0
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +4 -6
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +51 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +41 -11
- package/dist/extensions/pi-subagents/src/shared/types.ts +100 -3
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/utils.ts +43 -33
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +1 -14
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +1 -1
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +14 -12
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +176 -21
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +12 -6
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +52 -18
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +36 -5
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +30 -16
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +151 -31
- package/dist/extensions/pi-subagents/src/tui/render.ts +201 -68
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +0 -6
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +5 -4
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +0 -1
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +313 -25
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +84 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/package.json +14 -0
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +411 -300
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +309 -123
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +99 -56
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +62 -16
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +159 -108
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +4 -2
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +56 -56
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +114 -45
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +57 -19
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +106 -106
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +416 -106
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +287 -17
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +809 -87
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +107 -20
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +26 -6
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/support/helpers.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +1 -1
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +0 -8
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +163 -58
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +66 -66
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +334 -248
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +52 -52
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +99 -99
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +160 -0
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +43 -1
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +36 -10
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +387 -30
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +94 -40
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +5 -3
- package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +20 -20
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +35 -5
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +52 -52
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +187 -0
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +125 -71
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +18 -3
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +17 -23
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +15 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +62 -44
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +329 -37
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +37 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +69 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +79 -2
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +102 -49
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +98 -32
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +116 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +55 -7
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +289 -13
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +28 -1
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +11 -2
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +84 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +122 -8
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +24 -24
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +16 -2
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +26 -17
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +405 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +357 -92
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +22 -6
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +43 -43
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +243 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +68 -168
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +58 -15
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +40 -0
- package/dist/extensions/pi-subagents/test/unit/reads-resolution.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +47 -28
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +12 -12
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +57 -0
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +107 -27
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +56 -50
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +69 -28
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +59 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +424 -49
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +23 -1
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +32 -5
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +120 -91
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +85 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +312 -22
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +150 -15
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +73 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +76 -25
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +55 -6
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +138 -11
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +7 -7
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +6 -6
- package/dist/extensions/workflow/extension.ts +21 -19
- package/dist/extensions/workflow/modes.ts +65 -0
- package/dist/skills/pi-subagents/SKILL.md +20 -15
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +77 -83
- package/dist/skills/pi-subagents/references/execution-controls.md +215 -106
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +29 -9
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +58 -43
- package/docs/plans/workflow-autoloop-reference.md +192 -0
- package/docs/plans/workflow-subagent-consolidation-planb.md +374 -0
- package/docs/plans/workflow-subagent-scripted-merge.md +406 -0
- package/package.json +1 -1
- package/dist/extensions/workflow/adapter.ts +0 -949
- package/dist/extensions/workflow/modes/loop.ts +0 -74
- package/dist/extensions/workflow/modes/prototype.ts +0 -170
- package/dist/extensions/workflow/modes/quicktype.ts +0 -150
- package/dist/extensions/workflow/modes/task.ts +0 -105
- package/dist/extensions/workflow/run-state.ts +0 -124
- package/dist/extensions/workflow/state-machine.ts +0 -484
- package/dist/extensions/workflow/validators.ts +0 -42
|
@@ -6,6 +6,7 @@ import { describe, it } from "node:test";
|
|
|
6
6
|
import { waitForSubagents } from "../../src/runs/background/subagent-wait.ts";
|
|
7
7
|
import { registerWaitTool } from "../../src/runs/background/wait-tool.ts";
|
|
8
8
|
import { createWaitSubscriptionManager } from "../../src/runs/background/wait-subscriptions.ts";
|
|
9
|
+
import { recordWaitCompletion } from "../../src/runs/background/wait-completions.ts";
|
|
9
10
|
import { inspectSubagentStatus } from "../../src/runs/background/run-status.ts";
|
|
10
11
|
import { SUBAGENT_ASYNC_COMPLETE_EVENT, type IntercomEventBus, type SubagentState } from "../../src/shared/types.ts";
|
|
11
12
|
|
|
@@ -19,7 +20,7 @@ function writeStatus(asyncRoot: string, runId: string, state: string, extra: obj
|
|
|
19
20
|
state,
|
|
20
21
|
startedAt: now,
|
|
21
22
|
lastUpdate: now,
|
|
22
|
-
steps: [{ agent: "
|
|
23
|
+
steps: [{ agent: "worker", status: state }],
|
|
23
24
|
...extra,
|
|
24
25
|
}), "utf-8");
|
|
25
26
|
}
|
|
@@ -97,7 +98,7 @@ describe("non-blocking wait subscriptions", () => {
|
|
|
97
98
|
cwd: root,
|
|
98
99
|
sessionId: "session-a",
|
|
99
100
|
updatedAt: Date.now(),
|
|
100
|
-
children: [{ agent: "
|
|
101
|
+
children: [{ agent: "worker", index: 0, status: "detached" }],
|
|
101
102
|
}]]);
|
|
102
103
|
let tool: { execute: (...args: unknown[]) => Promise<{ content: Array<{ text?: string }>; isError?: boolean }> } | undefined;
|
|
103
104
|
registerWaitTool({
|
|
@@ -120,10 +121,10 @@ describe("non-blocking wait subscriptions", () => {
|
|
|
120
121
|
const resultsDir = path.join(root, "results");
|
|
121
122
|
const subscriptionsDir = path.join(root, "subscriptions");
|
|
122
123
|
const bus = new TestBus();
|
|
123
|
-
const sent: Array<{ message: { content?: unknown }; options?: { triggerTurn?: boolean } }> = [];
|
|
124
|
+
const sent: Array<{ message: { content?: unknown; details?: { completions?: Array<{ runId?: string; archivePath?: string }> } }; options?: { triggerTurn?: boolean } }> = [];
|
|
124
125
|
const pi = {
|
|
125
126
|
events: bus,
|
|
126
|
-
sendMessage(message: { content?: unknown }, options?: { triggerTurn?: boolean }) { sent.push({ message, options }); },
|
|
127
|
+
sendMessage(message: { content?: unknown; details?: { completions?: Array<{ runId?: string; archivePath?: string }> } }, options?: { triggerTurn?: boolean }) { sent.push({ message, options }); },
|
|
127
128
|
};
|
|
128
129
|
try {
|
|
129
130
|
writeStatus(asyncRoot, "run-exact", "running", { sessionId: "session-a", pid: 999_999 });
|
|
@@ -145,9 +146,19 @@ describe("non-blocking wait subscriptions", () => {
|
|
|
145
146
|
assert.equal(sent.length, 0, "an unrelated exact run must not satisfy the subscription");
|
|
146
147
|
|
|
147
148
|
writeStatus(asyncRoot, "run-exact", "complete", { sessionId: "session-a" });
|
|
149
|
+
recordWaitCompletion(restoredState, "run-exact", {
|
|
150
|
+
agent: "worker",
|
|
151
|
+
state: "complete",
|
|
152
|
+
success: true,
|
|
153
|
+
results: [{ agent: "worker", success: true, output: "done" }],
|
|
154
|
+
}, Date.now(), 60_000, { resultsDir, sessionId: "session-a" });
|
|
155
|
+
restoredState.completedResults?.clear();
|
|
148
156
|
bus.emit(SUBAGENT_ASYNC_COMPLETE_EVENT, { runId: "run-exact" });
|
|
149
157
|
assert.equal(sent.length, 1);
|
|
150
158
|
assert.match(String(sent[0]?.message.content), /run run-exact: completed/);
|
|
159
|
+
assert.match(String(sent[0]?.message.content), /Completion archive:/);
|
|
160
|
+
assert.equal(sent[0]?.message.details?.completions?.[0]?.runId, "run-exact");
|
|
161
|
+
assert.ok(sent[0]?.message.details?.completions?.[0]?.archivePath);
|
|
151
162
|
assert.equal(sent[0]?.options?.triggerTurn, true);
|
|
152
163
|
assert.equal(restoredState.waitSubscriptions?.has(registration.token), false);
|
|
153
164
|
assert.equal(fs.existsSync(path.join(subscriptionsDir, `${registration.token}.json`)), false);
|
|
@@ -186,6 +197,44 @@ describe("non-blocking wait subscriptions", () => {
|
|
|
186
197
|
}
|
|
187
198
|
});
|
|
188
199
|
|
|
200
|
+
it("tells the parent to revive the failed child before replacing resumable async runs", () => {
|
|
201
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-wait-subscribe-revive-first-"));
|
|
202
|
+
const asyncRoot = path.join(root, "runs");
|
|
203
|
+
const subscriptionsDir = path.join(root, "subscriptions");
|
|
204
|
+
const completedSessionFile = path.join(root, "completed-session.jsonl");
|
|
205
|
+
const failedSessionFile = path.join(root, "failed-session.jsonl");
|
|
206
|
+
const sent: string[] = [];
|
|
207
|
+
const state = makeState();
|
|
208
|
+
const manager = createWaitSubscriptionManager({
|
|
209
|
+
events: new TestBus(),
|
|
210
|
+
sendMessage(message: { content?: unknown }) { sent.push(String(message.content)); },
|
|
211
|
+
} as never, state, { asyncDirRoot: asyncRoot, subscriptionsDir, pollIntervalMs: 60_000, kill: () => true });
|
|
212
|
+
try {
|
|
213
|
+
fs.writeFileSync(completedSessionFile, "{}\n", "utf-8");
|
|
214
|
+
fs.writeFileSync(failedSessionFile, "{}\n", "utf-8");
|
|
215
|
+
writeStatus(asyncRoot, "run-revive", "running", { sessionId: "session-a", pid: 999_999 });
|
|
216
|
+
manager.arm({ targetKind: "async", runId: "run-revive", requestedId: "run-revive", timeoutMs: 30_000 });
|
|
217
|
+
|
|
218
|
+
writeStatus(asyncRoot, "run-revive", "failed", {
|
|
219
|
+
sessionId: "session-a",
|
|
220
|
+
steps: [
|
|
221
|
+
{ agent: "first", status: "complete", sessionFile: completedSessionFile },
|
|
222
|
+
{ agent: "second", status: "failed", sessionFile: failedSessionFile },
|
|
223
|
+
],
|
|
224
|
+
});
|
|
225
|
+
manager.reconcile();
|
|
226
|
+
|
|
227
|
+
const message = sent[0] ?? "";
|
|
228
|
+
assert.match(message, /Resume-first/);
|
|
229
|
+
assert.match(message, /subagent\(\{ action: "resume", id: "run-revive", index: 1, message:/);
|
|
230
|
+
assert.match(message, /before reporting failure or launching a replacement/);
|
|
231
|
+
assert.match(message, /only if revive fails or the user explicitly asks/);
|
|
232
|
+
} finally {
|
|
233
|
+
manager.dispose();
|
|
234
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
189
238
|
it("waits for foreground run restoration before reconciling a restored subscription", () => {
|
|
190
239
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-wait-subscribe-foreground-restore-"));
|
|
191
240
|
const subscriptionsDir = path.join(root, "subscriptions");
|
|
@@ -198,7 +247,7 @@ describe("non-blocking wait subscriptions", () => {
|
|
|
198
247
|
cwd: root,
|
|
199
248
|
sessionId: "session-a",
|
|
200
249
|
updatedAt: Date.now(),
|
|
201
|
-
children: [{ agent: "
|
|
250
|
+
children: [{ agent: "worker", index: 0, status: "detached" }],
|
|
202
251
|
}]]);
|
|
203
252
|
const pi = {
|
|
204
253
|
events: bus,
|
|
@@ -331,7 +380,7 @@ describe("non-blocking wait subscriptions", () => {
|
|
|
331
380
|
sessionId: "session-a",
|
|
332
381
|
pid: 999_999,
|
|
333
382
|
activityState: "needs_attention",
|
|
334
|
-
steps: [{ agent: "
|
|
383
|
+
steps: [{ agent: "worker", status: "running", activityState: "needs_attention" }],
|
|
335
384
|
});
|
|
336
385
|
manager.reconcile();
|
|
337
386
|
assert.match(sent.shift() ?? "", /needs attention/);
|
|
@@ -22,19 +22,19 @@ describe("child watchdog status helpers", () => {
|
|
|
22
22
|
model: "openai/gpt-test-child",
|
|
23
23
|
thinking: "low",
|
|
24
24
|
overrides: {
|
|
25
|
-
|
|
26
|
-
model: "anthropic/claude-test-
|
|
25
|
+
worker: {
|
|
26
|
+
model: "anthropic/claude-test-worker",
|
|
27
27
|
thinking: false,
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
agent: "
|
|
32
|
+
agent: "worker",
|
|
33
33
|
runId: "run-1",
|
|
34
34
|
childIndex: 0,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
assert.equal(config?.model, "anthropic/claude-test-
|
|
37
|
+
assert.equal(config?.model, "anthropic/claude-test-worker");
|
|
38
38
|
assert.equal(config?.thinking, false);
|
|
39
39
|
assert.deepEqual(config?.lsp, DEFAULT_WATCHDOG_CONFIG.lsp);
|
|
40
40
|
});
|
|
@@ -43,7 +43,7 @@ describe("child watchdog status helpers", () => {
|
|
|
43
43
|
const payload = {
|
|
44
44
|
enabled: true,
|
|
45
45
|
runId: "run-1",
|
|
46
|
-
agent: "
|
|
46
|
+
agent: "worker",
|
|
47
47
|
childIndex: 1,
|
|
48
48
|
watchdogTailTimeoutMs: 100,
|
|
49
49
|
agentEndTimeoutMs: 200,
|
|
@@ -79,7 +79,7 @@ describe("child watchdog status helpers", () => {
|
|
|
79
79
|
const firstEvent = {
|
|
80
80
|
type: CHILD_WATCHDOG_STATUS_EVENT,
|
|
81
81
|
runId: "run-1",
|
|
82
|
-
agent: "
|
|
82
|
+
agent: "worker",
|
|
83
83
|
childIndex: 0,
|
|
84
84
|
seq: 1,
|
|
85
85
|
phase: "reviewing",
|
|
@@ -88,20 +88,20 @@ describe("child watchdog status helpers", () => {
|
|
|
88
88
|
} as const;
|
|
89
89
|
|
|
90
90
|
assert.equal(isChildWatchdogStatusEvent(firstEvent), true);
|
|
91
|
-
const first = acceptChildWatchdogEvent({ event: firstEvent, runId: "run-1", agent: "
|
|
91
|
+
const first = acceptChildWatchdogEvent({ event: firstEvent, runId: "run-1", agent: "worker", childIndex: 0, current: undefined });
|
|
92
92
|
assert.deepEqual(first, { phase: "reviewing", seq: 1, lastUpdate: 10, followUpPending: false });
|
|
93
93
|
assert.equal(childWatchdogIsActive(first), true);
|
|
94
|
-
assert.equal(acceptChildWatchdogEvent({ event: firstEvent, current: first, runId: "run-1", agent: "
|
|
95
|
-
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, runId: undefined }, current: first, runId: "run-1", agent: "
|
|
96
|
-
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: undefined }, current: first, runId: "run-1", agent: "
|
|
97
|
-
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, childIndex: undefined }, current: first, runId: "run-1", agent: "
|
|
98
|
-
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: "other" }, current: first, runId: "run-1", agent: "
|
|
94
|
+
assert.equal(acceptChildWatchdogEvent({ event: firstEvent, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
|
|
95
|
+
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, runId: undefined }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
|
|
96
|
+
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: undefined }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
|
|
97
|
+
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, childIndex: undefined }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
|
|
98
|
+
assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: "other" }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
|
|
99
99
|
|
|
100
100
|
const settled = acceptChildWatchdogEvent({
|
|
101
101
|
event: { ...firstEvent, seq: 2, phase: "idle", ts: 20 },
|
|
102
102
|
current: first,
|
|
103
103
|
runId: "run-1",
|
|
104
|
-
agent: "
|
|
104
|
+
agent: "worker",
|
|
105
105
|
childIndex: 0,
|
|
106
106
|
});
|
|
107
107
|
assert.equal(settled?.phase, "idle");
|
|
@@ -110,7 +110,7 @@ describe("watchdog LSP diagnostics", () => {
|
|
|
110
110
|
cwd: temp,
|
|
111
111
|
root: temp,
|
|
112
112
|
changedPaths: ["src/file.ts"],
|
|
113
|
-
config: { enabled: true, timeoutMs:
|
|
113
|
+
config: { enabled: true, timeoutMs: 500, maxFiles: 10, maxDiagnostics: 10 },
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
assert.equal(diagnostics.status, "failed");
|
|
@@ -337,7 +337,7 @@ describe("main watchdog runtime", () => {
|
|
|
337
337
|
assert.equal(runtime.getSnapshot().lastWarning, undefined);
|
|
338
338
|
});
|
|
339
339
|
|
|
340
|
-
it("bounds review input before calling the
|
|
340
|
+
it("bounds review input before calling the reviewer", async () => {
|
|
341
341
|
let reviewedDelta = "";
|
|
342
342
|
const runtime = new MainWatchdogRuntime({
|
|
343
343
|
resolveConfig: () => configResult(enabledConfig()),
|
|
@@ -87,7 +87,7 @@ describe("watchdog settings", () => {
|
|
|
87
87
|
children: {
|
|
88
88
|
autoFollow: { maxAttempts: 4 },
|
|
89
89
|
overrides: {
|
|
90
|
-
|
|
90
|
+
worker: { enabled: true, model: "anthropic/claude-test" },
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
93
|
guidance: { systemPromptPath: "/tmp/user-watchdog.md" },
|
|
@@ -105,8 +105,8 @@ describe("watchdog settings", () => {
|
|
|
105
105
|
children: {
|
|
106
106
|
autoFollow: { blockers: false },
|
|
107
107
|
overrides: {
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
worker: { thinking: "medium" },
|
|
109
|
+
reviewer: { enabled: false },
|
|
110
110
|
},
|
|
111
111
|
},
|
|
112
112
|
},
|
|
@@ -118,7 +118,7 @@ describe("watchdog settings", () => {
|
|
|
118
118
|
autoFollow: { maxAttempts: null },
|
|
119
119
|
children: {
|
|
120
120
|
overrides: {
|
|
121
|
-
|
|
121
|
+
worker: { enabled: false },
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
},
|
|
@@ -133,12 +133,12 @@ describe("watchdog settings", () => {
|
|
|
133
133
|
assert.deepEqual(result.config.cadence, { everyNTools: 10 });
|
|
134
134
|
assert.deepEqual(result.config.lsp, { enabled: false, timeoutMs: 1500, maxFiles: 4, maxDiagnostics: 7 });
|
|
135
135
|
assert.deepEqual(result.config.children.autoFollow, { blockers: false, maxAttempts: 4, stalemateRepeats: 3 });
|
|
136
|
-
assert.deepEqual(result.config.children.overrides.
|
|
136
|
+
assert.deepEqual(result.config.children.overrides.worker, {
|
|
137
137
|
enabled: false,
|
|
138
138
|
model: "anthropic/claude-test",
|
|
139
139
|
thinking: "medium",
|
|
140
140
|
});
|
|
141
|
-
assert.deepEqual(result.config.children.overrides.
|
|
141
|
+
assert.deepEqual(result.config.children.overrides.reviewer, { enabled: false });
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
it("returns exact validation errors at the watchdog boundary", () => {
|
|
@@ -166,7 +166,7 @@ describe("watchdog settings", () => {
|
|
|
166
166
|
writeJson(userSettingsPath(), {
|
|
167
167
|
subagents: {
|
|
168
168
|
watchdog: {
|
|
169
|
-
children: { overrides: {
|
|
169
|
+
children: { overrides: { worker: { mode: "fast" } } },
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
172
|
});
|
|
@@ -174,7 +174,7 @@ describe("watchdog settings", () => {
|
|
|
174
174
|
assert.throws(
|
|
175
175
|
() => resolveWatchdogConfigStrict(tempProject),
|
|
176
176
|
(error: unknown) => error instanceof Error
|
|
177
|
-
&& error.message === `Watchdog settings in '${userSettingsPath()}' have unknown field 'subagents.watchdog.children.overrides.
|
|
177
|
+
&& error.message === `Watchdog settings in '${userSettingsPath()}' have unknown field 'subagents.watchdog.children.overrides.worker.mode'.`,
|
|
178
178
|
);
|
|
179
179
|
});
|
|
180
180
|
|
|
@@ -39,13 +39,13 @@ function job(child: NestedRunSummary): AsyncJobState {
|
|
|
39
39
|
|
|
40
40
|
describe("nested widget rendering", () => {
|
|
41
41
|
it("renders a bounded collapsed tree and full child rows when expanded", () => {
|
|
42
|
-
const child = nested("nested-
|
|
42
|
+
const child = nested("nested-reviewer", "root-run", "running", { currentTool: "read", model: "gpt-5.6-luna:medium", thinking: "medium" });
|
|
43
43
|
const collapsed = buildWidgetLines([job(child)], theme as any, 120, false).join("\n");
|
|
44
|
-
assert.match(collapsed, /↳ └─ \[\d{2}:\d{2}:\d{2}\] . nested-
|
|
44
|
+
assert.match(collapsed, /↳ └─ \[\d{2}:\d{2}:\d{2}\] . nested-reviewer · running · gpt-5.6-luna · thinking medium · read/);
|
|
45
45
|
assert.equal((collapsed.match(/thinking medium/g) ?? []).length, 1);
|
|
46
46
|
|
|
47
47
|
const expanded = buildWidgetLines([job(child)], theme as any, 120, true).join("\n");
|
|
48
|
-
assert.match(expanded, /↳ \[\d{2}:\d{2}:\d{2}\] . nested-
|
|
48
|
+
assert.match(expanded, /↳ \[\d{2}:\d{2}:\d{2}\] . nested-reviewer · running · gpt-5.6-luna · thinking medium · read/);
|
|
49
49
|
|
|
50
50
|
const epoch = buildWidgetLines([job(nested("epoch", "root-run", "running", { lastUpdate: 0, startedAt: 0 }))], theme as any, 120, false).join("\n");
|
|
51
51
|
assert.match(epoch, /↳ └─ \[\d{2}:\d{2}:\d{2}\] . epoch · running/);
|
|
@@ -137,7 +137,7 @@ describe("nested widget rendering", () => {
|
|
|
137
137
|
});
|
|
138
138
|
|
|
139
139
|
it("keeps event-time timestamps stable instead of advancing with wall time", async () => {
|
|
140
|
-
const state = job(nested("nested-
|
|
140
|
+
const state = job(nested("nested-reviewer", "root-run", "running", { currentTool: "read", currentToolStartedAt: 0 }));
|
|
141
141
|
const first = buildWidgetLines([state], theme as any, 120, true);
|
|
142
142
|
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
143
143
|
const second = buildWidgetLines([state], theme as any, 120, true);
|
|
@@ -145,8 +145,8 @@ describe("nested widget rendering", () => {
|
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
it("rerenders when only nested state changes", () => {
|
|
148
|
-
const first = job(nested("nested-
|
|
149
|
-
const second = job(nested("nested-
|
|
148
|
+
const first = job(nested("nested-reviewer", "root-run", "running"));
|
|
149
|
+
const second = job(nested("nested-reviewer", "root-run", "complete"));
|
|
150
150
|
assert.notEqual(widgetRenderKey(first), widgetRenderKey(second));
|
|
151
151
|
});
|
|
152
152
|
});
|
|
@@ -6,8 +6,10 @@ import * as path from "node:path";
|
|
|
6
6
|
import { describe, it } from "node:test";
|
|
7
7
|
import { isSameGitRepository, resolveWorkflowChatProgress } from "../../src/workflows/chat-progress.ts";
|
|
8
8
|
import { renderSubagentResult } from "../../src/tui/render.ts";
|
|
9
|
-
import { createSubagentExecutor, foregroundResultIntercomStatus, shouldSuppressRoutineResultIntercom } from "../../src/runs/foreground/subagent-executor.ts";
|
|
10
|
-
import
|
|
9
|
+
import { bindMissionWorkflowChildAsyncLaunch, createSubagentExecutor, foregroundResultIntercomStatus, missionWorkflowChildStatus, runMissionWorkflowChild, shouldSuppressRoutineResultIntercom } from "../../src/runs/foreground/subagent-executor.ts";
|
|
10
|
+
import { readMissionBinding } from "../../src/missions/lifecycle.ts";
|
|
11
|
+
import { createMission, readMission } from "../../src/missions/store.ts";
|
|
12
|
+
import { DIRS, type Details, type SingleResult, type SubagentState } from "../../src/shared/types.ts";
|
|
11
13
|
|
|
12
14
|
const theme = {
|
|
13
15
|
fg(_name: string, text: string): string { return text; },
|
|
@@ -96,6 +98,7 @@ describe("workflow chat progress policy", () => {
|
|
|
96
98
|
assert.equal(resolveWorkflowChatProgress({ requested: "auto", parentCwd: repo, workflowCwd: worktree, background: true }).projection?.mode, "milestones");
|
|
97
99
|
assert.equal(resolveWorkflowChatProgress({ requested: "auto", parentCwd: repo, workflowCwd: other, background: false }).projection?.mode, "terminal");
|
|
98
100
|
assert.match(resolveWorkflowChatProgress({ requested: "live-card", parentCwd: repo, workflowCwd: other, background: false }).error ?? "", /same Git repository/i);
|
|
101
|
+
assert.match(resolveWorkflowChatProgress({ requested: "terminal", parentCwd: repo, workflowCwd: repo, background: false }).projection?.mode ?? "", /terminal/);
|
|
99
102
|
} finally {
|
|
100
103
|
try { git(repo, ["worktree", "remove", "--force", worktree]); } catch {}
|
|
101
104
|
fs.rmSync(repo, { recursive: true, force: true });
|
|
@@ -112,7 +115,7 @@ describe("workflow chat progress rendering", () => {
|
|
|
112
115
|
const updates: Array<{ details?: Details }> = [];
|
|
113
116
|
const result = await createExecutor().execute(
|
|
114
117
|
"wf-live",
|
|
115
|
-
{ workflowScript: `return await runs.run("
|
|
118
|
+
{ workflowScript: `return await runs.run("scout", { agent: "missing-agent", task: "scan", phase: "Validation", label: "Find renderer seam" });`, async: false },
|
|
116
119
|
new AbortController().signal,
|
|
117
120
|
(update) => updates.push(update),
|
|
118
121
|
ctx(repo),
|
|
@@ -120,14 +123,85 @@ describe("workflow chat progress rendering", () => {
|
|
|
120
123
|
assert.equal(result.isError, true);
|
|
121
124
|
const liveUpdate = updates.find((update) => update.details?.chatProgress?.mode === "live-card");
|
|
122
125
|
assert.ok(liveUpdate, "expected a live-card update");
|
|
123
|
-
assert.equal(liveUpdate.details?.workflow?.trace[0]?.key, "
|
|
126
|
+
assert.equal(liveUpdate.details?.workflow?.trace[0]?.key, "scout");
|
|
124
127
|
assert.equal(liveUpdate.details?.workflow?.trace[0]?.phase, "Validation");
|
|
125
128
|
assert.equal(liveUpdate.details?.workflow?.trace[0]?.label, "Find renderer seam");
|
|
129
|
+
const ledgerChild = result.details.mission?.workflowChildren[0];
|
|
130
|
+
assert.equal(ledgerChild?.key, "scout");
|
|
131
|
+
assert.equal(ledgerChild?.workflowRunId, "wf-live");
|
|
132
|
+
assert.equal(ledgerChild?.agent, "missing-agent");
|
|
133
|
+
assert.equal(ledgerChild?.phase, "Validation");
|
|
134
|
+
assert.equal(ledgerChild?.status, "failed");
|
|
135
|
+
assert.equal(ledgerChild?.heartbeat?.status, "failed");
|
|
126
136
|
} finally {
|
|
127
137
|
fs.rmSync(repo, { recursive: true, force: true });
|
|
128
138
|
}
|
|
129
139
|
});
|
|
130
140
|
|
|
141
|
+
it("keeps async workflow launch receipts running in the mission ledger", () => {
|
|
142
|
+
assert.equal(missionWorkflowChildStatus({
|
|
143
|
+
content: [{ type: "text", text: "Async: worker [run-1]" }],
|
|
144
|
+
details: { mode: "single", runId: "run-1", asyncId: "run-1", asyncDir: "/tmp/run-1", results: [] },
|
|
145
|
+
} as any), "running");
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("writes mission binding before async workflow child launch", () => {
|
|
149
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-workflow-child-binding-"));
|
|
150
|
+
const asyncId = `workflow-child-${process.pid}-${Date.now()}`;
|
|
151
|
+
const asyncDir = path.join(DIRS.async, asyncId);
|
|
152
|
+
try {
|
|
153
|
+
const location = {
|
|
154
|
+
projectRoot: root,
|
|
155
|
+
missionDir: path.join(root, ".pi-subagents", "missions"),
|
|
156
|
+
globalIndexDir: path.join(root, ".pi-subagents", "mission-index"),
|
|
157
|
+
writeGlobalIndex: false,
|
|
158
|
+
};
|
|
159
|
+
const mission = createMission(location, { title: "Workflow", objective: "Track child" });
|
|
160
|
+
const params = bindMissionWorkflowChildAsyncLaunch(
|
|
161
|
+
{ agent: "worker", task: "run", async: true },
|
|
162
|
+
{ missionId: mission.id, location, autoCreated: false },
|
|
163
|
+
false,
|
|
164
|
+
asyncId,
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
assert.equal(params.workflowChildAsyncId, asyncId);
|
|
168
|
+
assert.equal(readMissionBinding(asyncDir)?.missionId, mission.id);
|
|
169
|
+
} finally {
|
|
170
|
+
fs.rmSync(asyncDir, { recursive: true, force: true });
|
|
171
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it("marks workflow launch preparation failures as failed mission children", async () => {
|
|
176
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-workflow-prep-failure-"));
|
|
177
|
+
try {
|
|
178
|
+
const location = {
|
|
179
|
+
projectRoot: root,
|
|
180
|
+
missionDir: path.join(root, ".pi-subagents", "missions"),
|
|
181
|
+
globalIndexDir: path.join(root, ".pi-subagents", "mission-index"),
|
|
182
|
+
writeGlobalIndex: false,
|
|
183
|
+
};
|
|
184
|
+
const mission = createMission(location, { title: "Workflow", objective: "Track child" });
|
|
185
|
+
|
|
186
|
+
await assert.rejects(
|
|
187
|
+
() => runMissionWorkflowChild({ missionId: mission.id, location, autoCreated: false }, "wf-prep-failure", "resume", "Prep", async () => {
|
|
188
|
+
throw new Error("gate is not supported with retained resume");
|
|
189
|
+
}),
|
|
190
|
+
/gate is not supported with retained resume/,
|
|
191
|
+
);
|
|
192
|
+
const ledgerChild = readMission(location, mission.id).workflowChildren[0];
|
|
193
|
+
|
|
194
|
+
assert.equal(ledgerChild?.key, "resume");
|
|
195
|
+
assert.equal(ledgerChild?.status, "failed");
|
|
196
|
+
assert.equal(ledgerChild?.heartbeat?.status, "failed");
|
|
197
|
+
assert.equal(ledgerChild?.heartbeat?.phase, "Prep");
|
|
198
|
+
assert.match(ledgerChild?.heartbeat?.message ?? "", /gate is not supported with retained resume/);
|
|
199
|
+
assert.ok(ledgerChild?.completedAt);
|
|
200
|
+
} finally {
|
|
201
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
131
205
|
it("renders stable rows keyed by workflow trace entries", () => {
|
|
132
206
|
const text = componentText(renderSubagentResult({
|
|
133
207
|
content: [{ type: "text", text: "Workflow running." }],
|
|
@@ -138,7 +212,7 @@ describe("workflow chat progress rendering", () => {
|
|
|
138
212
|
chatProgress: { mode: "live-card", repoRelation: "same", repoLabel: "pi-subagents" },
|
|
139
213
|
workflow: {
|
|
140
214
|
trace: [
|
|
141
|
-
{ operation: "run", key: "
|
|
215
|
+
{ operation: "run", key: "scout", state: "completed", runId: "run-scout", phase: "Validation", label: "Found renderer seam", durationMs: 12 },
|
|
142
216
|
{ operation: "run", key: "tests", state: "started", phase: "Validation", label: "focused integration suite" },
|
|
143
217
|
{ operation: "run", key: "review", state: "failed", phase: "Validation", label: "fresh-context UX review", error: "needs fixes" },
|
|
144
218
|
],
|
|
@@ -151,15 +225,68 @@ describe("workflow chat progress rendering", () => {
|
|
|
151
225
|
assert.match(text, /workflow wf_8f3a12345 .* same repo .* failed/);
|
|
152
226
|
assert.match(text, /Repo pi-subagents/);
|
|
153
227
|
assert.match(text, /Phase Validation/);
|
|
154
|
-
assert.match(text, /complete\s+
|
|
228
|
+
assert.match(text, /complete\s+scout Found renderer seam/);
|
|
155
229
|
assert.match(text, /running\s+tests focused integration suite/);
|
|
156
230
|
assert.match(text, /failed\s+review fresh-context UX review .* needs fixes/);
|
|
157
231
|
});
|
|
158
232
|
|
|
233
|
+
it("bounds workflow live-card rows and keeps old failed children visible", () => {
|
|
234
|
+
const trace = Array.from({ length: 10 }, (_, index) => ({
|
|
235
|
+
operation: "run" as const,
|
|
236
|
+
key: `step-${index}`,
|
|
237
|
+
state: index === 0 ? "failed" as const : "started" as const,
|
|
238
|
+
label: `review ${index}`,
|
|
239
|
+
...(index === 0 ? { error: "Failed\n\nOutput:\nI will read the required plan first.\nI will inspect the exact head.\nI will read agent default application path." } : {}),
|
|
240
|
+
}));
|
|
241
|
+
const text = componentText(renderSubagentResult({
|
|
242
|
+
content: [{ type: "text", text: "Workflow running." }],
|
|
243
|
+
details: {
|
|
244
|
+
mode: "workflow",
|
|
245
|
+
runId: "wf_noisy",
|
|
246
|
+
results: [],
|
|
247
|
+
chatProgress: { mode: "live-card", repoRelation: "same", repoLabel: "pi-subagents" },
|
|
248
|
+
workflow: { trace, emits: [], console: [] },
|
|
249
|
+
},
|
|
250
|
+
}, { expanded: false }, theme as any));
|
|
251
|
+
|
|
252
|
+
assert.match(text, /2 older workflow rows hidden/);
|
|
253
|
+
assert.match(text, /failed\s+step-0 review 0 .* Failed · latest: read agent default application path/);
|
|
254
|
+
assert.match(text, /running\s+step-9 review 9/);
|
|
255
|
+
assert.doesNotMatch(text, /step-1/);
|
|
256
|
+
assert.doesNotMatch(text, /Output:/);
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it("keeps mixed workflow child error output visible", () => {
|
|
260
|
+
const text = componentText(renderSubagentResult({
|
|
261
|
+
content: [{ type: "text", text: "Workflow running." }],
|
|
262
|
+
details: {
|
|
263
|
+
mode: "workflow",
|
|
264
|
+
runId: "wf_mixed_error",
|
|
265
|
+
results: [],
|
|
266
|
+
chatProgress: { mode: "live-card", repoRelation: "same", repoLabel: "pi-subagents" },
|
|
267
|
+
workflow: {
|
|
268
|
+
trace: [{
|
|
269
|
+
operation: "run",
|
|
270
|
+
key: "gate-monitor",
|
|
271
|
+
state: "failed",
|
|
272
|
+
label: "bot gate",
|
|
273
|
+
error: "Failed\n\nOutput:\nerror: failed to fetch review threads\nI will inspect the retry path.",
|
|
274
|
+
}],
|
|
275
|
+
emits: [],
|
|
276
|
+
console: [],
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
}, { expanded: false }, theme as any));
|
|
280
|
+
|
|
281
|
+
assert.match(text, /Failed · error: failed to fetch review threads I will inspect the retry path/);
|
|
282
|
+
assert.doesNotMatch(text, /latest: inspect the retry path/);
|
|
283
|
+
assert.doesNotMatch(text, /Output:/);
|
|
284
|
+
});
|
|
285
|
+
|
|
159
286
|
it("suppresses only successful routine child result intercom for live-card workflows", () => {
|
|
160
|
-
const completed = { agent: "
|
|
161
|
-
const failed = { agent: "
|
|
162
|
-
const rejected = { agent: "
|
|
287
|
+
const completed = { agent: "delegate", exitCode: 0, outputState: "present" } as SingleResult;
|
|
288
|
+
const failed = { agent: "delegate", exitCode: 1, outputState: "present" } as SingleResult;
|
|
289
|
+
const rejected = { agent: "delegate", exitCode: 0, acceptance: { status: "rejected" }, outputState: "present" } as SingleResult;
|
|
163
290
|
|
|
164
291
|
assert.equal(shouldSuppressRoutineResultIntercom({ suppressRoutineResultIntercom: true, results: [completed] }), true);
|
|
165
292
|
assert.equal(shouldSuppressRoutineResultIntercom({ suppressRoutineResultIntercom: true, results: [failed] }), false);
|
|
@@ -168,7 +295,7 @@ describe("workflow chat progress rendering", () => {
|
|
|
168
295
|
});
|
|
169
296
|
|
|
170
297
|
it("marks acceptance-rejected foreground intercom results as failed", () => {
|
|
171
|
-
const rejected = { agent: "
|
|
298
|
+
const rejected = { agent: "delegate", exitCode: 0, acceptance: { status: "rejected" }, outputState: "present" } as SingleResult;
|
|
172
299
|
|
|
173
300
|
assert.equal(foregroundResultIntercomStatus(rejected), "failed");
|
|
174
301
|
});
|
|
@@ -183,7 +310,7 @@ describe("workflow chat progress rendering", () => {
|
|
|
183
310
|
chatProgress: { mode: "live-card", repoRelation: "same", repoLabel: "pi-subagents" },
|
|
184
311
|
workflow: {
|
|
185
312
|
value: "final answer",
|
|
186
|
-
trace: [{ operation: "run", key: "
|
|
313
|
+
trace: [{ operation: "run", key: "scout", state: "completed", runId: "run-scout" }],
|
|
187
314
|
emits: [],
|
|
188
315
|
console: [],
|
|
189
316
|
},
|
|
@@ -7,7 +7,7 @@ describe("workflow graph snapshots", () => {
|
|
|
7
7
|
const graph = buildWorkflowGraphSnapshot({
|
|
8
8
|
runId: "run-1",
|
|
9
9
|
steps: [
|
|
10
|
-
{ agent: "
|
|
10
|
+
{ agent: "scout", task: "Scan", phase: "Research", label: "Find context", as: "context" },
|
|
11
11
|
{ agent: "writer", task: "Use {outputs.context}", phase: "Synthesis", outputSchema: { type: "object" } },
|
|
12
12
|
],
|
|
13
13
|
results: [{ exitCode: 0 }, { exitCode: 1, error: "bad output" }],
|
|
@@ -25,9 +25,9 @@ describe("workflow graph snapshots", () => {
|
|
|
25
25
|
]);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
it("maps a long alternating
|
|
28
|
+
it("maps a long alternating worker and reviewer chain without losing indexes", () => {
|
|
29
29
|
const steps = Array.from({ length: 40 }, (_, index) => ({
|
|
30
|
-
agent: index % 2 === 0 ? "
|
|
30
|
+
agent: index % 2 === 0 ? "worker" : "reviewer",
|
|
31
31
|
task: index === 0 ? "Start" : "{previous}",
|
|
32
32
|
}));
|
|
33
33
|
const results = steps.map(() => ({ exitCode: 0 }));
|
|
@@ -43,10 +43,10 @@ describe("workflow graph snapshots", () => {
|
|
|
43
43
|
assert.equal(graph.nodes[0]?.id, "step-0");
|
|
44
44
|
assert.equal(graph.nodes[0]?.flatIndex, 0);
|
|
45
45
|
assert.equal(graph.nodes[37]?.id, "step-37");
|
|
46
|
-
assert.equal(graph.nodes[37]?.agent, "
|
|
46
|
+
assert.equal(graph.nodes[37]?.agent, "reviewer");
|
|
47
47
|
assert.equal(graph.nodes[37]?.flatIndex, 37);
|
|
48
48
|
assert.equal(graph.nodes[39]?.id, "step-39");
|
|
49
|
-
assert.equal(graph.nodes[39]?.agent, "
|
|
49
|
+
assert.equal(graph.nodes[39]?.agent, "reviewer");
|
|
50
50
|
assert.equal(graph.nodes[39]?.flatIndex, 39);
|
|
51
51
|
assert.equal(graph.currentNodeId, "step-37");
|
|
52
52
|
});
|
|
@@ -58,7 +58,7 @@ describe("workflow graph snapshots", () => {
|
|
|
58
58
|
{ agent: "setup", task: "Setup" },
|
|
59
59
|
{
|
|
60
60
|
parallel: [
|
|
61
|
-
{ agent: "
|
|
61
|
+
{ agent: "reviewer", label: "Correctness", phase: "Review", as: "correctness" },
|
|
62
62
|
{ agent: "security", label: "Security", phase: "Review", as: "security" },
|
|
63
63
|
],
|
|
64
64
|
},
|
|
@@ -107,7 +107,7 @@ describe("workflow graph snapshots", () => {
|
|
|
107
107
|
it("uses dynamic group status overrides for empty or aggregate-failure fanout states", () => {
|
|
108
108
|
const steps = [{
|
|
109
109
|
expand: { from: { output: "targets", path: "/items" }, maxItems: 4 },
|
|
110
|
-
parallel: { agent: "
|
|
110
|
+
parallel: { agent: "reviewer", task: "Review {item}" },
|
|
111
111
|
collect: { as: "reviews" },
|
|
112
112
|
}];
|
|
113
113
|
|
|
@@ -123,7 +123,7 @@ describe("workflow graph snapshots", () => {
|
|
|
123
123
|
const collectFailure = buildWorkflowGraphSnapshot({
|
|
124
124
|
runId: "run-dynamic-collect-fail",
|
|
125
125
|
steps,
|
|
126
|
-
dynamicChildren: { 0: [{ agent: "
|
|
126
|
+
dynamicChildren: { 0: [{ agent: "reviewer", flatIndex: 0, itemKey: "a" }] },
|
|
127
127
|
results: [{ exitCode: 0 }],
|
|
128
128
|
dynamicGroupStatuses: { 0: { status: "failed", error: "Collected output validation failed" } },
|
|
129
129
|
});
|