@selesai/code 0.8.3 → 0.8.5
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 +15 -0
- package/README.md +7 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/defaults/models.json +41 -55
- package/dist/defaults/settings.json +7 -8
- 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 +225 -14
- package/dist/extensions/pi-subagents/README.md +66 -1613
- 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 +372 -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 +38 -19
- 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 +62 -8
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +2 -2
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +40 -0
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +51 -26
- package/dist/extensions/pi-subagents/src/extension/index.ts +140 -50
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +77 -0
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +18 -24
- 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/intercom-bridge.ts +4 -1
- 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 -17
- package/dist/extensions/pi-subagents/src/missions/store.ts +151 -9
- package/dist/extensions/pi-subagents/src/missions/types.ts +58 -3
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +260 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +8 -8
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +374 -0
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +46 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +158 -36
- 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 +26 -4
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +45 -6
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +33 -15
- 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/owned-process-tree.ts +104 -0
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +17 -3
- 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 +26 -3
- 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 +233 -101
- 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 +40 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +188 -46
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +12 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +137 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +171 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1365 -252
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +187 -0
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +178 -26
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +286 -0
- 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 +32 -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 +3 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +509 -117
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +10 -10
- package/dist/extensions/pi-subagents/src/runs/shared/run-fanout-budget.ts +280 -0
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +4 -2
- 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 +21 -5
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +20 -8
- 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 +192 -3
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +11 -0
- package/dist/extensions/pi-subagents/src/shared/utils.ts +46 -34
- 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 +37 -21
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +375 -42
- 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 +332 -27
- 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 +102 -15
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +507 -306
- 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 +124 -58
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +62 -16
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +167 -113
- 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 +139 -58
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +324 -59
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +98 -22
- 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 +1122 -96
- 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 +194 -59
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +317 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +66 -66
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +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 +118 -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 +18 -3
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +99 -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 +94 -23
- 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 +70 -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 +30 -2
- 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 +91 -47
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +468 -38
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +14 -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 +7 -6
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +171 -0
- 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 +81 -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 +42 -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/owned-process-tree.test.ts +69 -0
- 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 +440 -92
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +24 -8
- 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 +59 -6
- 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 +51 -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 +111 -31
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +121 -0
- 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 +65 -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 +60 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +424 -49
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +28 -0
- 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 +130 -92
- 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 +65 -26
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +138 -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 +68 -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/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.js +48 -1
- 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/docs/quickstart.md +27 -43
- package/docs/settings.md +4 -0
- package/docs/usage.md +1 -0
- package/package.json +2 -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
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# Plan — Merge: workflow extension as durable shell driving `workflowScript` steps
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Make the bundled `workflow` extension the durable, human-gated process shell, and let
|
|
6
|
+
it drive pi-subagents' `workflowScript` orchestration as **one step inside a phase**.
|
|
7
|
+
Both extensions stay; nothing is deleted. All workflow-extension guarantees (durable
|
|
8
|
+
resume, marker gates, exclusive transitions, loop caps, parent-owned artifacts, slash
|
|
9
|
+
commands/footer) survive unchanged.
|
|
10
|
+
|
|
11
|
+
Executed by: a small coding model with no project knowledge. Everything needed is
|
|
12
|
+
written here.
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
- `src/extensions/workflow/adapter.ts` — two small adapter extensions (child-output
|
|
17
|
+
suppression for scripted calls; loop-engine recognition of scripted review waves).
|
|
18
|
+
- `src/extensions/workflow/modes/*.ts` — prompt-text doctrine for the scripted-step
|
|
19
|
+
contract (loop phase in all four modes; research phase in prototype/quicktype).
|
|
20
|
+
- `src/extensions/workflow/adapter.ts` resume continuation text (loop branch).
|
|
21
|
+
- Tests: `src/__tests__/{adapter,loop-workflow,task-workflow}.test.ts`.
|
|
22
|
+
- Docs: `doc-web/src/content/docs/capabilities/delegation/{workflow,pi-subagents}.mdx`,
|
|
23
|
+
`doc-web/src/data/capabilities.ts`.
|
|
24
|
+
- Skill doctrine: `execution-controls.md` synced 3-way.
|
|
25
|
+
|
|
26
|
+
Explicitly **out of scope**: deleting either extension, new abstractions, new
|
|
27
|
+
dependencies, changing pi-subagents' sandbox API, re-architecting `WorkflowStateMachine`
|
|
28
|
+
or `runWorkflowScript`, and creating a new workflow skill.
|
|
29
|
+
|
|
30
|
+
## Established facts (verified in prior sessions; trust these)
|
|
31
|
+
|
|
32
|
+
- The workflow extension is a pure consumer of the `subagent` tool. Every mode prompt
|
|
33
|
+
hardcodes single-agent calls with `output: false`; `adapter.ts` enforces
|
|
34
|
+
parent-owns-artifacts. pi-subagents has zero runtime coupling back to it.
|
|
35
|
+
- `disableSubagentOutput` (`src/extensions/workflow/adapter.ts:85`) rewrites only
|
|
36
|
+
`input.agent` (string), `input.tasks`, `input.chain` (+ `step.parallel`). It does not
|
|
37
|
+
touch `input.workflowScript`.
|
|
38
|
+
- For a `workflowScript` call, the script's **own** result is always inline text
|
|
39
|
+
(foreground workflow branch builds text sections; no result file is written for the
|
|
40
|
+
script). Top-level `output`/`outputMode` are destructured into `workflowChildDefaults`
|
|
41
|
+
and forwarded to the script's **children** as defaults
|
|
42
|
+
(`src/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts:4553` and
|
|
43
|
+
`:4692`). `output: false` therefore means "children stay inline".
|
|
44
|
+
- Mode resolution precedence: `workflowScript` beats `chain`/`tasks`/`agent`
|
|
45
|
+
(`subagent-executor.ts:2007` `getRequestedModeLabel`).
|
|
46
|
+
- Loop gating (`adapter.ts:713-717` `commentatorTransition`) and the `tool_result` loop
|
|
47
|
+
branches (`adapter.ts:760-780`, `agent === "builder"` / `agent === "commentator"`)
|
|
48
|
+
match only on `event.input.agent`. A scripted call (no agent) is currently invisible
|
|
49
|
+
to the loop engine.
|
|
50
|
+
- The sandbox surface is exactly `{ runs, prompts, emit, console, Promise, state? }`
|
|
51
|
+
(`src/extensions/pi-subagents/src/workflows/scripted-workflow.ts:296-297`). No host
|
|
52
|
+
call maps to workflow start/advance/resume. Scripts cannot be driven from inside a
|
|
53
|
+
workflowScript — by design; this plan does not change that.
|
|
54
|
+
- Script return rendering (`formatWorkflowValue`, `subagent-executor.ts:4272`): strings
|
|
55
|
+
render verbatim; other JSON renders pretty-printed. The loop marker regex
|
|
56
|
+
`LOOP_STATUS_RE = /WORKFLOW_REVIEW_STATUS\s*:\s*(clean|blocking)\b/i` is not
|
|
57
|
+
line-anchored, so markers match inside either rendering.
|
|
58
|
+
- `textFromSubagentResult` (`adapter.ts:70`) already falls back to reading
|
|
59
|
+
`event.details?.results?.[0]?.artifactPaths?.outputPath` when the inline content has
|
|
60
|
+
no marker — reuse it as-is for scripted results.
|
|
61
|
+
- Tests: workflow tests live in `src/__tests__/` (`adapter.test.ts`,
|
|
62
|
+
`loop-workflow.test.ts`, `task-workflow.test.ts`, `quicktype-workflow.test.ts`,
|
|
63
|
+
`state-machine.test.ts`, `workflow-run-state.test.ts`) using an in-memory harness
|
|
64
|
+
(`createHarness`/`start`/`result` helpers that dispatch fake `subagent` tool events
|
|
65
|
+
through `__resetWorkflowRegistryForTests` + `createWorkflowExtension`). pi-subagents
|
|
66
|
+
integration tests live in `src/extensions/pi-subagents/test/integration/`.
|
|
67
|
+
- Skills are synced 3-way and currently byte-identical:
|
|
68
|
+
`src/extensions/pi-subagents/skills/pi-subagents` ↔ `src/skills/pi-subagents` ↔
|
|
69
|
+
`~/.selesai/agent/skills` (verified with `diff -q`).
|
|
70
|
+
- Both extensions register via the bundled extension dir through
|
|
71
|
+
`additionalExtensionPaths` (`src/main.ts:726`). Both are listed in
|
|
72
|
+
`doc-web/src/data/capabilities.ts` under `delegation-and-workflows`.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Task 1 — Adapter: force `output: false` on scripted subagent calls
|
|
77
|
+
|
|
78
|
+
### 1. Discovery
|
|
79
|
+
|
|
80
|
+
Search `src/extensions/workflow/adapter.ts` for `function disableSubagentOutput` (line
|
|
81
|
+
85). Read its three existing branches (agent / tasks / chain) and the call site in the
|
|
82
|
+
`pi.on("tool_call", ...)` hook (~line 730) that guards with
|
|
83
|
+
`!isSubagentManagementAction(event.input) && event.input`.
|
|
84
|
+
|
|
85
|
+
### 2. Identification
|
|
86
|
+
|
|
87
|
+
- **File to modify:** `src/extensions/workflow/adapter.ts` — it owns all tool-call
|
|
88
|
+
rewriting for the workflow; nothing else should change.
|
|
89
|
+
- **Why not others:** the executor (`subagent-executor.ts`) never sees `output: false`
|
|
90
|
+
unless the caller passes it; the workflow must impose it because the model may not.
|
|
91
|
+
|
|
92
|
+
### 3. Change
|
|
93
|
+
|
|
94
|
+
In `disableSubagentOutput`, after the `input.agent` branch, add:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
// ponytail: a scripted call's own result is always inline text, but top-level
|
|
98
|
+
// output is forwarded to the script's children as a default (subagent-executor
|
|
99
|
+
// destructures it into workflowChildDefaults). Force it off so children stay
|
|
100
|
+
// inline. Per-child `output:` inside the workflowScript string cannot be
|
|
101
|
+
// rewritten here; the mode prompts carry that contract.
|
|
102
|
+
if (typeof input.workflowScript === "string") input.output = false;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Keep the existing agent/tasks/chain branches byte-identical.
|
|
106
|
+
|
|
107
|
+
**Code explicitly not to add:** rewriting the script string contents, recursion into
|
|
108
|
+
`runs.run` param objects, or any new helper.
|
|
109
|
+
|
|
110
|
+
### 4. Verification
|
|
111
|
+
|
|
112
|
+
- **Success:** after `disableSubagentOutput({ workflowScript: "return runs.run(...)" })`,
|
|
113
|
+
`input.output === false`; the script text is untouched.
|
|
114
|
+
- **Failure:** n/a (pure rewrite; no error paths).
|
|
115
|
+
- **Regression:** `{ agent: "x", output: <path> }` → `output: false`; `tasks`/`chain`
|
|
116
|
+
(incl. `step.parallel`) rewrites unchanged. Existing `adapter.test.ts` cases still
|
|
117
|
+
pass.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Task 2 — Adapter: loop engine recognizes scripted review waves
|
|
122
|
+
|
|
123
|
+
### 1. Discovery
|
|
124
|
+
|
|
125
|
+
Read `src/extensions/workflow/adapter.ts`:
|
|
126
|
+
- `pi.on("tool_call", ...)` hook, `commentatorTransition` at lines 713-717 and the
|
|
127
|
+
`transitionBatchBlock` usage at 717.
|
|
128
|
+
- `pi.on("tool_result", ...)` hook, lines ~755-785: the `agent === "builder"` /
|
|
129
|
+
`agent === "commentator"` branches, `parseLoopReviewStatus`, `textFromSubagentResult`,
|
|
130
|
+
loop-complete.md write with `MARKERS.loopComplete`, maxed cap, and the trailing
|
|
131
|
+
`onArtifactMaybe(deps)` call.
|
|
132
|
+
- `validators.ts` `MARKERS` and `loopCompleteValidator`.
|
|
133
|
+
|
|
134
|
+
### 2. Identification
|
|
135
|
+
|
|
136
|
+
- **File to modify:** `src/extensions/workflow/adapter.ts` — the loop engine lives
|
|
137
|
+
entirely in this adapter (state machine stays pure; it only reacts to artifacts).
|
|
138
|
+
- **Why not the state machine:** `loop-complete.md` detection, review-round tracking,
|
|
139
|
+
and loop-state persistence are adapter concerns (deps + `loopState`); the SM has no
|
|
140
|
+
knowledge of `subagent` events.
|
|
141
|
+
|
|
142
|
+
### 3. Change
|
|
143
|
+
|
|
144
|
+
**3a.** In the `tool_call` hook, replace the `commentatorTransition` expression with a
|
|
145
|
+
version that also matches scripted calls:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
const scriptedLoopCall = tool === "subagent" &&
|
|
149
|
+
typeof event.input?.workflowScript === "string" && snap.phase === "loop" &&
|
|
150
|
+
!isSubagentManagementAction(event.input);
|
|
151
|
+
const commentatorTransition = (tool === "subagent" &&
|
|
152
|
+
event.input?.agent === "commentator" && snap.phase === "loop" &&
|
|
153
|
+
!isSubagentManagementAction(event.input)) || scriptedLoopCall;
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
This routes scripted loop calls through `transitionBatchBlock` (exclusive-call
|
|
157
|
+
enforcement) exactly like a commentator call.
|
|
158
|
+
|
|
159
|
+
**3b.** In the `tool_result` hook, inside the `if (event.toolName === "subagent" &&
|
|
160
|
+
sm.snapshot.active && sm.snapshot.phase === "loop")` block, after `const agent =
|
|
161
|
+
event.input?.agent;` add `const scripted = typeof event.input?.workflowScript ===
|
|
162
|
+
"string";` and change the branch guard from `else if (agent === "commentator")` to
|
|
163
|
+
`else if (agent === "commentator" || scripted)`. The entire existing commentator body
|
|
164
|
+
(review round increment, `loop-review-N.md` persist, `parseLoopReviewStatus`, clean →
|
|
165
|
+
loop-complete.md with `MARKERS.loopComplete`, maxed cap + one-time notify, blocking →
|
|
166
|
+
`stage = "building"`) is reused as-is. The builder branch stays `agent === "builder"`
|
|
167
|
+
only.
|
|
168
|
+
|
|
169
|
+
**Contract (documented in Task 3, not code):** a scripted call in loop phase IS one
|
|
170
|
+
review round. The script must return/emit the aggregated review text containing the
|
|
171
|
+
marker (string return renders verbatim; the regex is not line-anchored so JSON renders
|
|
172
|
+
also match). The builder round remains single-agent.
|
|
173
|
+
|
|
174
|
+
**Code explicitly not to add:** parsing `details.workflow.value`, special-casing
|
|
175
|
+
`details.results`, or new loop-state fields.
|
|
176
|
+
|
|
177
|
+
### 4. Verification
|
|
178
|
+
|
|
179
|
+
- **Success (loop mode):** scripted `subagent` call in loop phase → `reviewRound`
|
|
180
|
+
increments; inline result containing `WORKFLOW_REVIEW_STATUS: clean` → `loop-review-N.md`
|
|
181
|
+
written, `loop-complete.md` written with `WORKFLOW_LOOP_STATUS: clean`, workflow
|
|
182
|
+
becomes terminal-ready (`terminalReady`), `end_workflow` closes it. Blocking marker →
|
|
183
|
+
`stage = "building"`, next round continues; 3 blocking rounds → `maxed` + exactly one
|
|
184
|
+
warning notify. A scripted call batched with another tool call in loop → `{ block:
|
|
185
|
+
true, reason: "Workflow transition tools must be called alone. ..." }`.
|
|
186
|
+
- **Failure:** scripted result with no marker → treated as blocking (same as malformed
|
|
187
|
+
commentator). `event.isError` subagent result → hook returns early (existing guard).
|
|
188
|
+
- **Regression:** `{ agent: "commentator" }` loop behavior byte-identical; builder
|
|
189
|
+
rounds unchanged; non-loop phases unchanged; management actions pass through.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Task 3 — Mode prompts + resume text: the scripted-step contract
|
|
194
|
+
|
|
195
|
+
### 1. Discovery
|
|
196
|
+
|
|
197
|
+
Read the loop-phase prompt strings in `src/extensions/workflow/modes/loop.ts`,
|
|
198
|
+
`modes/task.ts`, `modes/quicktype.ts`, `modes/prototype.ts`, and the research-phase
|
|
199
|
+
prompt in `modes/prototype.ts` / `modes/quicktype.ts`. Read the loop resume continuation
|
|
200
|
+
text in `adapter.ts` `resumeController` (the `ls.stage === "reviewing"` branch).
|
|
201
|
+
|
|
202
|
+
### 2. Identification
|
|
203
|
+
|
|
204
|
+
- **Files to modify:** the four `modes/*.ts` prompt factories + the resume string in
|
|
205
|
+
`adapter.ts`. Mode prompts are the runtime doctrine the model sees; the resume text is
|
|
206
|
+
the only other place that instructs commentator calls.
|
|
207
|
+
- **Why not elsewhere:** the pi-subagents skill is the engine's doctrine (Task 6); the
|
|
208
|
+
mode prompts own phase behavior.
|
|
209
|
+
|
|
210
|
+
### 3. Change
|
|
211
|
+
|
|
212
|
+
**3a. Loop prompt (all four modes).** After the commentator bullet, append one optional
|
|
213
|
+
paragraph (exact wording up to the implementer, must preserve every existing
|
|
214
|
+
`WORKFLOW_*` marker string verbatim):
|
|
215
|
+
|
|
216
|
+
> Alternatively, run the review as ONE scripted wave: call the subagent tool with
|
|
217
|
+
> `{ workflowScript: "...", output: false }` that fans out parallel reviewer children
|
|
218
|
+
> via `runs.all([...])` and returns a single aggregated review text ending with exactly
|
|
219
|
+
> one line `WORKFLOW_REVIEW_STATUS: clean` or `WORKFLOW_REVIEW_STATUS: blocking`. Do not
|
|
220
|
+
> set `output` inside `runs.run` params (the adapter forces `output: false`); the script
|
|
221
|
+
> must return or emit the review text inline. Use either the single commentator call or
|
|
222
|
+
> one scripted wave per round, not both.
|
|
223
|
+
|
|
224
|
+
**3b. Research prompt (prototype/quicktype only).** Add one optional sentence: a
|
|
225
|
+
scripted parallel researcher wave (`{ workflowScript, output: false }`) may replace the
|
|
226
|
+
single `{ agent: "researcher" }` call; the parent still writes `research.md` via
|
|
227
|
+
`write_workflow_artifact`. (No engine coupling here — this phase is existence-only.)
|
|
228
|
+
|
|
229
|
+
**3c. Resume text (`adapter.ts`).** In the `ls.stage === "reviewing"` continuation,
|
|
230
|
+
append "(or a scripted review wave with `{ workflowScript, output: false }`)" to the
|
|
231
|
+
commentator instruction.
|
|
232
|
+
|
|
233
|
+
**Code explicitly not to add:** marker-string changes, prompt templating infrastructure,
|
|
234
|
+
or new prompt files.
|
|
235
|
+
|
|
236
|
+
### 4. Verification
|
|
237
|
+
|
|
238
|
+
- **Success:** each modified prompt string contains the new paragraph and still contains
|
|
239
|
+
exactly its required marker strings (`WORKFLOW_PLAN_STATUS: ready`,
|
|
240
|
+
`WORKFLOW_HANDOFF_STATUS: ready`, `WORKFLOW_REVIEW_STATUS: clean|blocking`,
|
|
241
|
+
`WORKFLOW_LOOP_STATUS: clean` where relevant) — grep-able.
|
|
242
|
+
- **Failure:** n/a.
|
|
243
|
+
- **Regression:** non-loop prompt text byte-identical; existing prompt tests (if any)
|
|
244
|
+
pass.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Task 4 — Tests
|
|
249
|
+
|
|
250
|
+
### 1. Discovery
|
|
251
|
+
|
|
252
|
+
Read `src/__tests__/adapter.test.ts` (disableSubagentOutput cases), and the harness in
|
|
253
|
+
`src/__tests__/loop-workflow.test.ts` (`createHarness`, `start`, `result` helpers that
|
|
254
|
+
dispatch fake `subagent` events through the registry). Note how existing tests simulate
|
|
255
|
+
builder/commentator results and how `task-workflow.test.ts` covers phase advancement.
|
|
256
|
+
|
|
257
|
+
### 2. Identification
|
|
258
|
+
|
|
259
|
+
- **Files to modify:** `src/__tests__/adapter.test.ts`, `src/__tests__/loop-workflow.test.ts`,
|
|
260
|
+
`src/__tests__/task-workflow.test.ts` — they are the in-repo home for workflow tests.
|
|
261
|
+
- **Why not pi-subagents' integration suite:** the changed behavior is adapter-side;
|
|
262
|
+
pi-subagents integration must stay untouched (regression proof).
|
|
263
|
+
|
|
264
|
+
### 3. Change
|
|
265
|
+
|
|
266
|
+
Add cases:
|
|
267
|
+
|
|
268
|
+
- **adapter.test.ts:** `disableSubagentOutput({ workflowScript: "..." })` sets
|
|
269
|
+
`output: false`; agent/tasks/chain cases still assert the old shapes; script text
|
|
270
|
+
untouched.
|
|
271
|
+
- **loop-workflow.test.ts (new flow):** dispatch a scripted loop `subagent` result
|
|
272
|
+
(`event.input` has `workflowScript`, `event.content` is inline text containing
|
|
273
|
+
`WORKFLOW_REVIEW_STATUS: clean`) → assert loop-review-1.md + loop-complete.md written
|
|
274
|
+
and terminal-ready; blocking variant → next round; third blocking round → maxed + one
|
|
275
|
+
notify; a batched scripted loop call → blocked result. Use the existing harness
|
|
276
|
+
helpers; extend them only if strictly needed.
|
|
277
|
+
- **task-workflow.test.ts (regression + one new flow):** a scripted `subagent` call in a
|
|
278
|
+
non-loop phase is ignored by the engine (parent still must call
|
|
279
|
+
`write_workflow_artifact` to advance); the clean-scripted-loop path ends terminal-ready
|
|
280
|
+
and `end_workflow` closes it.
|
|
281
|
+
|
|
282
|
+
**Code explicitly not to add:** new test harnesses, mocking frameworks, or touching
|
|
283
|
+
pi-subagents' test suites.
|
|
284
|
+
|
|
285
|
+
### 4. Verification
|
|
286
|
+
|
|
287
|
+
- **Success:** the new cases pass; targeted run:
|
|
288
|
+
`npx vitest run src/__tests__/adapter.test.ts src/__tests__/loop-workflow.test.ts src/__tests__/task-workflow.test.ts`.
|
|
289
|
+
- **Failure:** n/a.
|
|
290
|
+
- **Regression:** full unit suite (previously 1833 passing) and pi-subagents integration
|
|
291
|
+
suite (previously 737 passing) stay green:
|
|
292
|
+
`npx vitest run` and the pi-subagents integration runner used previously (confirm the
|
|
293
|
+
exact command from the prior session's verification log).
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Task 5 — Docs
|
|
298
|
+
|
|
299
|
+
### 1. Discovery
|
|
300
|
+
|
|
301
|
+
Read `doc-web/src/content/docs/capabilities/delegation/workflow.mdx` and
|
|
302
|
+
`pi-subagents.mdx`; read the workflow entry in `doc-web/src/data/capabilities.ts`
|
|
303
|
+
(lines ~58-70).
|
|
304
|
+
|
|
305
|
+
### 2. Identification
|
|
306
|
+
|
|
307
|
+
- **Files to modify:** the two `.mdx` pages and the `capabilities.ts` benefit string for
|
|
308
|
+
`workflow`.
|
|
309
|
+
- **Why not others:** these are the registered capability pages under
|
|
310
|
+
`delegation-and-workflows`; the skill reference is handled in Task 6.
|
|
311
|
+
|
|
312
|
+
### 3. Change
|
|
313
|
+
|
|
314
|
+
- **workflow.mdx:** add a "Scripted subagent steps" section (after "What you can do" or
|
|
315
|
+
in "Limits and safety"): the workflow extension is the durable shell; a phase may call
|
|
316
|
+
`subagent({ workflowScript, output: false })` as one step; in loop phase a scripted
|
|
317
|
+
call counts as one review round (script must return/emit the review text with the
|
|
318
|
+
marker); per-child `output:` inside the script is not rewritten — instruct scripts to
|
|
319
|
+
omit it; scripted steps remain child-level and ephemeral (no durable process state —
|
|
320
|
+
the workflow run file is still the source of truth).
|
|
321
|
+
- **pi-subagents.mdx:** one paragraph under "Limits and safety": the bundled workflow
|
|
322
|
+
extension can drive a `workflowScript` as a phase step; `workflowScript` stays
|
|
323
|
+
child-level/ephemeral and is not resumable as a process — pair it with the workflow
|
|
324
|
+
extension when durable/resumable/human-gated execution is needed.
|
|
325
|
+
- **capabilities.ts:** extend the `workflow` benefit string with "scripted subagent
|
|
326
|
+
steps" (one clause, keep existing wording).
|
|
327
|
+
|
|
328
|
+
### 4. Verification
|
|
329
|
+
|
|
330
|
+
- **Success:** pages render (run the doc-web build or the repo's markdown check if one
|
|
331
|
+
exists; at minimum the frontmatter/imports stay intact); new text greps to the two
|
|
332
|
+
pages.
|
|
333
|
+
- **Failure:** n/a.
|
|
334
|
+
- **Regression:** existing anchors/links in both pages unchanged.
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Task 6 — Skill doctrine sync (3-way)
|
|
339
|
+
|
|
340
|
+
### 1. Discovery
|
|
341
|
+
|
|
342
|
+
Read `src/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md`
|
|
343
|
+
"### Scripted workflows" section (line ~54). Confirm the three synced copies are
|
|
344
|
+
byte-identical (they are, per prior verification):
|
|
345
|
+
`src/extensions/pi-subagents/skills/pi-subagents` ↔ `src/skills/pi-subagents` ↔
|
|
346
|
+
`~/.selesai/agent/skills`.
|
|
347
|
+
|
|
348
|
+
### 2. Identification
|
|
349
|
+
|
|
350
|
+
- **Files to modify:** all three copies of `references/execution-controls.md` (identical
|
|
351
|
+
bytes after the change). The extension copy is canonical; the other two mirror it.
|
|
352
|
+
|
|
353
|
+
### 3. Change
|
|
354
|
+
|
|
355
|
+
Append a short "Durable-shell integration" note to the Scripted workflows section:
|
|
356
|
+
- The bundled workflow extension may drive a script as one step inside a phase; it
|
|
357
|
+
forces `output: false` on the call (children stay inline). Per-child `output:` inside
|
|
358
|
+
the script string is not rewritten — omit it.
|
|
359
|
+
- In the workflow's loop phase, a scripted call counts as ONE review round; the script
|
|
360
|
+
must return/emit the aggregated review text containing `WORKFLOW_REVIEW_STATUS:
|
|
361
|
+
clean|blocking` inline.
|
|
362
|
+
- `workflowScript` remains child-level and ephemeral; the workflow extension's
|
|
363
|
+
`workflow.json` is the durable process state.
|
|
364
|
+
|
|
365
|
+
Apply the identical diff to all three copies, then verify.
|
|
366
|
+
|
|
367
|
+
### 4. Verification
|
|
368
|
+
|
|
369
|
+
- **Success:** `diff -q` between the three copies reports identical; the new note greps
|
|
370
|
+
in all three.
|
|
371
|
+
- **Failure:** n/a.
|
|
372
|
+
- **Regression:** all other sections byte-identical.
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Task order and dependencies
|
|
377
|
+
|
|
378
|
+
1. Task 1 (adapter rewrite) — independent.
|
|
379
|
+
2. Task 2 (loop recognition) — independent of Task 1; same file, do both before tests.
|
|
380
|
+
3. Task 3 (prompts/resume text) — depends on the contract fixed in Tasks 1-2.
|
|
381
|
+
4. Task 4 (tests) — after Tasks 1-2 (behavior) and 3 (contract for wording assertions).
|
|
382
|
+
5. Tasks 5-6 (docs/skill) — after behavior is stable; can run in parallel.
|
|
383
|
+
|
|
384
|
+
## Definition of done
|
|
385
|
+
|
|
386
|
+
- `npx vitest run src/__tests__/adapter.test.ts src/__tests__/loop-workflow.test.ts src/__tests__/task-workflow.test.ts` green.
|
|
387
|
+
- Full unit suite (1833) + pi-subagents integration suite (737) green.
|
|
388
|
+
- Typecheck clean with the repo's established command (the one used for the previous
|
|
389
|
+
pi-subagents 0.47.1 verification; run `npx tsc --noEmit` from the repo root if no
|
|
390
|
+
other command is recorded).
|
|
391
|
+
- `diff -q` clean across the 3-way skill sync.
|
|
392
|
+
- `git status` shows only: `adapter.ts`, `modes/*.ts`, the three test files, two `.mdx`
|
|
393
|
+
pages, `capabilities.ts`, three `execution-controls.md` copies, and this plan.
|
|
394
|
+
|
|
395
|
+
## Final review checklist (planger)
|
|
396
|
+
|
|
397
|
+
- [x] Discovery: every touched file/line cited; no assumptions about ownership.
|
|
398
|
+
- [x] Ownership: adapter owns tool-call rewriting + loop engine; SM stays pure;
|
|
399
|
+
prompts own runtime doctrine; tests live in `src/__tests__`.
|
|
400
|
+
- [x] Simplest acceptable: two small predicates + one prompt paragraph + docs; no new
|
|
401
|
+
abstractions, deps, or services.
|
|
402
|
+
- [x] Reuse: `textFromSubagentResult`, `parseLoopReviewStatus`, `MARKERS`, the loop
|
|
403
|
+
engine body, and the existing harness are all reused as-is.
|
|
404
|
+
- [x] Scope: no extension deletions, no sandbox/API changes, no SM refactor.
|
|
405
|
+
- [x] Verification: success/failure/regression per task + full-suite Definition of done.
|
|
406
|
+
- [x] Executable without assumptions: exact paths, line refs, predicates, and commands.
|
package/docs/quickstart.md
CHANGED
|
@@ -1,42 +1,26 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
-
This page gets you from install to a useful first
|
|
3
|
+
This page gets you from install to a useful first Selesai session.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Selesai is distributed as an npm package:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g
|
|
10
|
+
npm install -g @selesai/code
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Uninstall
|
|
16
|
-
|
|
17
|
-
Use the package manager that installed pi. The curl installer uses npm globally, so curl and npm installs are removed with npm:
|
|
13
|
+
Then start Selesai in the project directory you want it to work on:
|
|
18
14
|
|
|
19
15
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# pnpm
|
|
24
|
-
pnpm remove -g @earendil-works/pi-coding-agent
|
|
25
|
-
|
|
26
|
-
# Yarn
|
|
27
|
-
yarn global remove @earendil-works/pi-coding-agent
|
|
28
|
-
|
|
29
|
-
# Bun
|
|
30
|
-
bun uninstall -g @earendil-works/pi-coding-agent
|
|
16
|
+
cd /path/to/project
|
|
17
|
+
selesai
|
|
31
18
|
```
|
|
32
19
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Then start pi in the project directory you want it to work on:
|
|
20
|
+
To install directly from the public repository (builds the latest `main` from source):
|
|
36
21
|
|
|
37
22
|
```bash
|
|
38
|
-
|
|
39
|
-
pi
|
|
23
|
+
npm install -g github:SelesaiInTech/selesai-code
|
|
40
24
|
```
|
|
41
25
|
|
|
42
26
|
## Authenticate
|
|
@@ -45,7 +29,7 @@ Pi can use subscription providers through `/login`, or API-key providers through
|
|
|
45
29
|
|
|
46
30
|
### Option 1: subscription login
|
|
47
31
|
|
|
48
|
-
Start
|
|
32
|
+
Start Selesai and run:
|
|
49
33
|
|
|
50
34
|
```text
|
|
51
35
|
/login
|
|
@@ -55,26 +39,26 @@ Then select a provider. Built-in subscription logins include Claude Pro/Max, Cha
|
|
|
55
39
|
|
|
56
40
|
### Option 2: API key
|
|
57
41
|
|
|
58
|
-
Set an API key before launching
|
|
42
|
+
Set an API key before launching Selesai:
|
|
59
43
|
|
|
60
44
|
```bash
|
|
61
45
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
62
|
-
|
|
46
|
+
selesai
|
|
63
47
|
```
|
|
64
48
|
|
|
65
|
-
You can also run `/login` and select an API-key provider to store the key in `~/.
|
|
49
|
+
You can also run `/login` and select an API-key provider to store the key in `~/.selesai/agent/auth.json`.
|
|
66
50
|
|
|
67
51
|
See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
|
|
68
52
|
|
|
69
53
|
## First session
|
|
70
54
|
|
|
71
|
-
Once
|
|
55
|
+
Once Selesai starts, type a request and press Enter:
|
|
72
56
|
|
|
73
57
|
```text
|
|
74
58
|
Summarize this repository and tell me how to run its checks.
|
|
75
59
|
```
|
|
76
60
|
|
|
77
|
-
By default,
|
|
61
|
+
By default, Selesai gives the model four tools:
|
|
78
62
|
|
|
79
63
|
- `read` - read files
|
|
80
64
|
- `write` - create or overwrite files
|
|
@@ -83,7 +67,7 @@ By default, pi gives the model four tools:
|
|
|
83
67
|
|
|
84
68
|
Additional built-in read-only tools (`grep`, `find`, `ls`) are available through tool options. Pi runs in your current working directory and can modify files there. Use git or another checkpointing workflow if you want easy rollback.
|
|
85
69
|
|
|
86
|
-
## Give
|
|
70
|
+
## Give Selesai project instructions
|
|
87
71
|
|
|
88
72
|
Pi loads context files at startup. Add an `AGENTS.md` file to tell it how to work in a project:
|
|
89
73
|
|
|
@@ -97,10 +81,10 @@ Pi loads context files at startup. Add an `AGENTS.md` file to tell it how to wor
|
|
|
97
81
|
|
|
98
82
|
Pi loads:
|
|
99
83
|
|
|
100
|
-
- `~/.
|
|
84
|
+
- `~/.selesai/agent/AGENTS.md` for global instructions
|
|
101
85
|
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
102
86
|
|
|
103
|
-
Restart
|
|
87
|
+
Restart Selesai, or run `/reload`, after changing context files.
|
|
104
88
|
|
|
105
89
|
## Common things to try
|
|
106
90
|
|
|
@@ -109,8 +93,8 @@ Restart pi, or run `/reload`, after changing context files.
|
|
|
109
93
|
Type `@` in the editor to fuzzy-search files, or pass files on the command line:
|
|
110
94
|
|
|
111
95
|
```bash
|
|
112
|
-
|
|
113
|
-
|
|
96
|
+
selesai @README.md "Summarize this"
|
|
97
|
+
selesai @src/app.ts @src/app.test.ts "Review these together"
|
|
114
98
|
```
|
|
115
99
|
|
|
116
100
|
Images can be pasted with Ctrl+V (Alt+V on Windows) or dragged into supported terminals.
|
|
@@ -134,22 +118,22 @@ Use `/model` or Ctrl+L to choose a model. Use Shift+Tab to cycle thinking level.
|
|
|
134
118
|
Sessions are saved automatically:
|
|
135
119
|
|
|
136
120
|
```bash
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
121
|
+
selesai -c # Continue most recent session
|
|
122
|
+
selesai -r # Browse previous sessions
|
|
123
|
+
selesai --name "my task" # Set session display name at startup
|
|
124
|
+
selesai --session <path|id> # Open a specific session
|
|
141
125
|
```
|
|
142
126
|
|
|
143
|
-
Inside
|
|
127
|
+
Inside Selesai, use `/resume`, `/new`, `/tree`, `/fork`, and `/clone` to manage sessions.
|
|
144
128
|
|
|
145
129
|
### Non-interactive mode
|
|
146
130
|
|
|
147
131
|
For one-shot prompts:
|
|
148
132
|
|
|
149
133
|
```bash
|
|
150
|
-
|
|
151
|
-
cat README.md |
|
|
152
|
-
|
|
134
|
+
selesai -p "Summarize this codebase"
|
|
135
|
+
cat README.md | selesai -p "Summarize this text"
|
|
136
|
+
selesai -p @screenshot.png "What's in this image?"
|
|
153
137
|
```
|
|
154
138
|
|
|
155
139
|
Use `--mode json` for JSON event output or `--mode rpc` for process integration.
|
package/docs/settings.md
CHANGED
|
@@ -322,3 +322,7 @@ Project settings (`.selesai/settings.json`) override global settings. Nested obj
|
|
|
322
322
|
"compaction": { "enabled": true, "reserveTokens": 8192 }
|
|
323
323
|
}
|
|
324
324
|
```
|
|
325
|
+
|
|
326
|
+
## Factory Reset
|
|
327
|
+
|
|
328
|
+
Run `/settings-factory-reset` inside a session to restore the global settings file (`~/.selesai/agent/settings.json`) to the bundled factory defaults. The command warns before replacing the file, saves a backup as `settings.json.bak` next to it, and leaves credentials (`auth.json`), sessions, extensions, skills, and themes untouched. Settings take effect immediately after the reset (equivalent to `/reload`).
|
package/docs/usage.md
CHANGED
|
@@ -43,6 +43,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
43
43
|
| `/model` | Switch models |
|
|
44
44
|
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
45
45
|
| `/settings` | Thinking level, theme, message delivery, transport |
|
|
46
|
+
| `/settings-factory-reset` | Reset settings to factory defaults (with confirmation) |
|
|
46
47
|
| `/resume` | Pick from previous sessions |
|
|
47
48
|
| `/new` | Start a new session |
|
|
48
49
|
| `/name <name>` | Set session display name |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selesai/code",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Maintained, extension-first Pi coding agent with built-in workflows, subagents, web research, questions, skills, and an enhanced terminal UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
],
|
|
51
51
|
"scripts": {
|
|
52
52
|
"clean": "shx rm -rf dist",
|
|
53
|
+
"prepare": "npm run build",
|
|
53
54
|
"build": "npm run clean && tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js dist/rpc-entry.js && npm run copy-assets",
|
|
54
55
|
"copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/modes/interactive/assets && shx cp src/modes/interactive/assets/*.png dist/modes/interactive/assets/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/ && shx mkdir -p dist/defaults && shx cp src/defaults/* dist/defaults/ && shx mkdir -p dist/extensions && node scripts/copy-extensions.mjs && shx mkdir -p dist/themes && shx cp -r src/themes/. dist/themes/ && shx mkdir -p dist/skills && shx cp -r src/skills/. dist/skills/"
|
|
55
56
|
},
|