@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
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type Theme,
|
|
10
10
|
} from "@selesai/code";
|
|
11
11
|
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
12
|
-
import { isKeyRelease, type AutocompleteProvider, type SelectItem, SelectList, truncateToWidth, TUI_KEYBINDINGS, visibleWidth } from "@earendil-works/pi-tui";
|
|
12
|
+
import { CURSOR_MARKER, isKeyRelease, type AutocompleteProvider, type SelectItem, SelectList, truncateToWidth, TUI_KEYBINDINGS, visibleWidth } from "@earendil-works/pi-tui";
|
|
13
13
|
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from "node:fs";
|
|
14
14
|
import { join, dirname } from "node:path";
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
ModeAwareAutocompleteProvider,
|
|
24
24
|
OneOffBashAutocompleteProvider,
|
|
25
25
|
} from "./bash-mode/completion.ts";
|
|
26
|
-
import { BashModeEditor } from "./bash-mode/editor.ts";
|
|
26
|
+
import { BashModeEditor, isPrintableInput } from "./bash-mode/editor.ts";
|
|
27
27
|
import { ManagedShellSession } from "./bash-mode/shell-session.ts";
|
|
28
28
|
import { matchHistoryEntries, readGlobalShellHistory, readProjectHistory, appendProjectHistory } from "./bash-mode/history.ts";
|
|
29
29
|
import type { BashModeSettings } from "./bash-mode/types.ts";
|
|
@@ -40,6 +40,7 @@ import { getGuidePreferences, getNewGuideFeatures, markGuideVersionSeen, resolve
|
|
|
40
40
|
import { createRenderScheduler } from "./render-scheduler.ts";
|
|
41
41
|
import { createWelcomeDismissScheduler } from "./welcome-dismiss.ts";
|
|
42
42
|
import { getEditorAutocompleteProvider, passAutocompleteProviderThroughPreviousEditor } from "./editor-composition.ts";
|
|
43
|
+
import { EditorPerfProfiler, readEditorPerfOptions } from "./editor-performance.ts";
|
|
43
44
|
import { CoreContextUsageCache, estimateInitialContextTokens, estimateUnknownContextUsage, resolveDisplayContextUsage, type CoreContextUsage } from "./context-usage.ts";
|
|
44
45
|
import { isStaleExtensionContextError, shouldShowStartupWelcome } from "./lifecycle.ts";
|
|
45
46
|
import { getDefaultColors } from "./theme.ts";
|
|
@@ -70,8 +71,8 @@ import {
|
|
|
70
71
|
} from "./working-vibes.ts";
|
|
71
72
|
import { setupTpsTracker } from "./tps.ts";
|
|
72
73
|
import { readAsyncSubagentUsage } from "./session-usage.ts";
|
|
73
|
-
import { PowerlineQueueStore, currentQueueContext,
|
|
74
|
-
import type { PowerlineQueueItem, QueueContext, QueueIntent, QueueTarget } from "./queue/types.ts";
|
|
74
|
+
import { PowerlineQueueStore, currentQueueContext, formatQueueDeliveryText, parseCompactQueuedPrompt } from "./queue/store.ts";
|
|
75
|
+
import type { PowerlineQueueItem, QueueContext, QueueIntent, QueueSummary, QueueTarget } from "./queue/types.ts";
|
|
75
76
|
|
|
76
77
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
77
78
|
// Configuration
|
|
@@ -91,7 +92,6 @@ let config: PowerlineConfig = {
|
|
|
91
92
|
invalidPlacement: null,
|
|
92
93
|
welcome: true,
|
|
93
94
|
stashSharpSShortcut: false,
|
|
94
|
-
queue: { captureSigil: "#" },
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
const CUSTOM_COMPACTION_STATUS_KEY = "compact-policy";
|
|
@@ -103,7 +103,6 @@ export interface PowerlineShortcuts {
|
|
|
103
103
|
stashHistory: ShortcutBinding;
|
|
104
104
|
copyEditor: ShortcutBinding;
|
|
105
105
|
cutEditor: ShortcutBinding;
|
|
106
|
-
ideaCapture: ShortcutBinding;
|
|
107
106
|
queueOpen: ShortcutBinding;
|
|
108
107
|
editorStart: ShortcutBinding;
|
|
109
108
|
editorEnd: ShortcutBinding;
|
|
@@ -114,7 +113,6 @@ type PowerlineShortcutAction =
|
|
|
114
113
|
| { kind: "stashHistory" }
|
|
115
114
|
| { kind: "copyEditor" }
|
|
116
115
|
| { kind: "cutEditor" }
|
|
117
|
-
| { kind: "ideaCapture" }
|
|
118
116
|
| { kind: "queueOpen" }
|
|
119
117
|
| { kind: "bashMode" };
|
|
120
118
|
const STASH_HISTORY_LIMIT = 12;
|
|
@@ -124,17 +122,17 @@ const DEFAULT_SHORTCUTS: PowerlineShortcuts = {
|
|
|
124
122
|
stashHistory: "ctrl+alt+h",
|
|
125
123
|
copyEditor: "ctrl+alt+c",
|
|
126
124
|
cutEditor: "ctrl+alt+x",
|
|
127
|
-
ideaCapture: null,
|
|
128
125
|
queueOpen: "ctrl+alt+q",
|
|
129
126
|
editorStart: "super+shift+up",
|
|
130
127
|
editorEnd: "super+shift+down",
|
|
131
128
|
};
|
|
132
129
|
const DEFAULT_BASH_MODE_SETTINGS = {
|
|
133
130
|
toggleShortcut: "ctrl+shift+b",
|
|
131
|
+
completions: false,
|
|
134
132
|
transcriptMaxLines: 2000,
|
|
135
133
|
transcriptMaxBytes: 512 * 1024,
|
|
136
134
|
} as const satisfies BashModeSettings;
|
|
137
|
-
const SHORTCUT_KEYS: PowerlineShortcutKey[] = ["stashHistory", "copyEditor", "cutEditor", "
|
|
135
|
+
const SHORTCUT_KEYS: PowerlineShortcutKey[] = ["stashHistory", "copyEditor", "cutEditor", "queueOpen", "editorStart", "editorEnd"];
|
|
138
136
|
const APP_RESERVED_SHORTCUTS = [
|
|
139
137
|
"escape",
|
|
140
138
|
"ctrl+c",
|
|
@@ -180,6 +178,7 @@ const STREAMING_LAYOUT_CACHE_TTL_MS = 1000;
|
|
|
180
178
|
const STATUS_RENDER_DEBOUNCE_MS = 33;
|
|
181
179
|
const CONTEXT_STATUS_RENDER_MS = 250;
|
|
182
180
|
const EDITOR_STATUS_DEFER_MS = 150;
|
|
181
|
+
const QUEUE_SUMMARY_CACHE_TTL_MS = 250;
|
|
183
182
|
const PROMPT_HISTORY_TRACKED = Symbol.for("powerlinePromptHistoryTracked");
|
|
184
183
|
const PROMPT_HISTORY_STATE_KEY = Symbol.for("powerlinePromptHistoryState");
|
|
185
184
|
|
|
@@ -830,6 +829,9 @@ export function parseBashModeSettings(settings: Record<string, unknown>, powerli
|
|
|
830
829
|
`[powerline-footer] Bash mode shortcut conflict: "${configuredToggleShortcut}" replaced with "${toggleShortcut ?? "disabled"}"`,
|
|
831
830
|
);
|
|
832
831
|
}
|
|
832
|
+
const completions = typeof raw.completions === "boolean"
|
|
833
|
+
? raw.completions
|
|
834
|
+
: DEFAULT_BASH_MODE_SETTINGS.completions;
|
|
833
835
|
const transcriptMaxLines = typeof raw.transcriptMaxLines === "number" && Number.isFinite(raw.transcriptMaxLines)
|
|
834
836
|
? Math.max(100, Math.floor(raw.transcriptMaxLines))
|
|
835
837
|
: DEFAULT_BASH_MODE_SETTINGS.transcriptMaxLines;
|
|
@@ -839,11 +841,174 @@ export function parseBashModeSettings(settings: Record<string, unknown>, powerli
|
|
|
839
841
|
|
|
840
842
|
return {
|
|
841
843
|
toggleShortcut,
|
|
844
|
+
completions,
|
|
842
845
|
transcriptMaxLines,
|
|
843
846
|
transcriptMaxBytes,
|
|
844
847
|
};
|
|
845
848
|
}
|
|
846
849
|
|
|
850
|
+
const FAST_EDITOR_RENDER_LINE_THRESHOLD = 80;
|
|
851
|
+
const FAST_EDITOR_RENDER_COLUMN_THRESHOLD = 1200;
|
|
852
|
+
|
|
853
|
+
interface FastEditorState {
|
|
854
|
+
lines: string[];
|
|
855
|
+
cursorLine: number;
|
|
856
|
+
cursorCol: number;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
interface FastEditorVisualLine {
|
|
860
|
+
text: string;
|
|
861
|
+
cursorCol?: number;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
function readFastEditorState(editor: unknown): FastEditorState | null {
|
|
865
|
+
const state = Reflect.get(editor as object, "state");
|
|
866
|
+
if (!isRecord(state) || !Array.isArray(state.lines)) return null;
|
|
867
|
+
if (typeof state.cursorLine !== "number" || typeof state.cursorCol !== "number") return null;
|
|
868
|
+
|
|
869
|
+
const lines = state.lines as string[];
|
|
870
|
+
const cursorLine = Math.max(0, Math.min(lines.length - 1, Math.floor(state.cursorLine)));
|
|
871
|
+
const cursorText = lines[cursorLine] ?? "";
|
|
872
|
+
if (typeof cursorText !== "string") return null;
|
|
873
|
+
const cursorCol = Math.max(0, Math.min(cursorText.length, Math.floor(state.cursorCol)));
|
|
874
|
+
return { lines, cursorLine, cursorCol };
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
function fastChunkCount(line: string, width: number): number {
|
|
878
|
+
return Math.max(1, Math.ceil(Math.max(1, line.length) / width));
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
function fastChunk(line: string, width: number, chunkIndex: number): { text: string; startCol: number } {
|
|
882
|
+
const startCol = chunkIndex * width;
|
|
883
|
+
return { text: line.slice(startCol, startCol + width), startCol };
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
function isFastRenderableText(text: string): boolean {
|
|
887
|
+
return /^[\x20-\x7E]*$/.test(text);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function pushTrailingChunks(target: FastEditorVisualLine[], line: string, width: number, maxCount: number): void {
|
|
891
|
+
const count = fastChunkCount(line, width);
|
|
892
|
+
const start = Math.max(0, count - maxCount);
|
|
893
|
+
for (let index = start; index < count; index++) {
|
|
894
|
+
target.push({ text: fastChunk(line, width, index).text });
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
function collectFastEditorVisualLines(state: FastEditorState, layoutWidth: number, maxVisibleLines: number): {
|
|
899
|
+
lines: FastEditorVisualLine[];
|
|
900
|
+
hasBefore: boolean;
|
|
901
|
+
hasAfter: boolean;
|
|
902
|
+
} {
|
|
903
|
+
const cursorText = state.lines[state.cursorLine] ?? "";
|
|
904
|
+
const cursorChunkIndex = Math.floor(state.cursorCol / layoutWidth);
|
|
905
|
+
const cursorChunkCount = Math.max(fastChunkCount(cursorText, layoutWidth), cursorChunkIndex + 1);
|
|
906
|
+
const firstCursorChunk = Math.max(0, cursorChunkIndex - maxVisibleLines + 1);
|
|
907
|
+
|
|
908
|
+
const visualLines: FastEditorVisualLine[] = [];
|
|
909
|
+
for (let lineIndex = state.cursorLine - 1; lineIndex >= 0 && visualLines.length < maxVisibleLines - 1; lineIndex--) {
|
|
910
|
+
const chunks: FastEditorVisualLine[] = [];
|
|
911
|
+
pushTrailingChunks(chunks, state.lines[lineIndex] ?? "", layoutWidth, maxVisibleLines - 1 - visualLines.length);
|
|
912
|
+
visualLines.unshift(...chunks);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
for (let chunkIndex = firstCursorChunk; chunkIndex < cursorChunkIndex && visualLines.length < maxVisibleLines - 1; chunkIndex++) {
|
|
916
|
+
visualLines.push({ text: fastChunk(cursorText, layoutWidth, chunkIndex).text });
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
const cursorChunk = fastChunk(cursorText, layoutWidth, cursorChunkIndex);
|
|
920
|
+
visualLines.push({
|
|
921
|
+
text: cursorChunk.text,
|
|
922
|
+
cursorCol: state.cursorCol - cursorChunk.startCol,
|
|
923
|
+
});
|
|
924
|
+
|
|
925
|
+
for (let chunkIndex = cursorChunkIndex + 1; chunkIndex < cursorChunkCount && visualLines.length < maxVisibleLines; chunkIndex++) {
|
|
926
|
+
visualLines.push({ text: fastChunk(cursorText, layoutWidth, chunkIndex).text });
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
for (let lineIndex = state.cursorLine + 1; lineIndex < state.lines.length && visualLines.length < maxVisibleLines; lineIndex++) {
|
|
930
|
+
const line = state.lines[lineIndex] ?? "";
|
|
931
|
+
const count = fastChunkCount(line, layoutWidth);
|
|
932
|
+
for (let chunkIndex = 0; chunkIndex < count && visualLines.length < maxVisibleLines; chunkIndex++) {
|
|
933
|
+
visualLines.push({ text: fastChunk(line, layoutWidth, chunkIndex).text });
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
return {
|
|
938
|
+
lines: visualLines.slice(-maxVisibleLines),
|
|
939
|
+
hasBefore: state.cursorLine > 0 || firstCursorChunk > 0,
|
|
940
|
+
hasAfter: state.cursorLine < state.lines.length - 1 || cursorChunkIndex < cursorChunkCount - 1,
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
function renderFastCursorLine(line: string, cursorCol: number, focused: boolean): string {
|
|
945
|
+
const before = line.slice(0, cursorCol);
|
|
946
|
+
const target = line[cursorCol];
|
|
947
|
+
const marker = focused ? CURSOR_MARKER : "";
|
|
948
|
+
if (target) {
|
|
949
|
+
return `${before}${marker}\x1b[7m${target}\x1b[0m${line.slice(cursorCol + target.length)}`;
|
|
950
|
+
}
|
|
951
|
+
return `${before}${marker}\x1b[7m \x1b[0m`;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
function padToWidth(line: string, width: number): string {
|
|
955
|
+
return `${line}${" ".repeat(Math.max(0, width - visibleWidth(line)))}`;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
export function renderFastPowerlineEditor(
|
|
959
|
+
editor: unknown,
|
|
960
|
+
width: number,
|
|
961
|
+
options: { bashModeActive: boolean; completionsEnabled: boolean },
|
|
962
|
+
): string[] | null {
|
|
963
|
+
if (width < 10 || options.completionsEnabled) return null;
|
|
964
|
+
if (Reflect.get(editor as object, "isInPaste") === true || Reflect.get(editor as object, "jumpMode") != null) return null;
|
|
965
|
+
if (Reflect.get(editor as object, "autocompleteState") != null) return null;
|
|
966
|
+
|
|
967
|
+
const isShowingAutocomplete = Reflect.get(editor as object, "isShowingAutocomplete");
|
|
968
|
+
if (typeof isShowingAutocomplete === "function" && isShowingAutocomplete.call(editor)) return null;
|
|
969
|
+
|
|
970
|
+
const state = readFastEditorState(editor);
|
|
971
|
+
if (!state) return null;
|
|
972
|
+
|
|
973
|
+
const cursorText = state.lines[state.cursorLine] ?? "";
|
|
974
|
+
if (state.lines.length < FAST_EDITOR_RENDER_LINE_THRESHOLD && cursorText.length < FAST_EDITOR_RENDER_COLUMN_THRESHOLD) {
|
|
975
|
+
return null;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
const terminalRows = Reflect.get(Reflect.get(editor as object, "tui") ?? {}, "terminal")?.rows;
|
|
979
|
+
const maxVisibleLines = Math.max(5, Math.floor((typeof terminalRows === "number" ? terminalRows : 24) * 0.3));
|
|
980
|
+
const innerWidth = Math.max(1, width - 3);
|
|
981
|
+
const layoutWidth = Math.max(1, innerWidth - 1);
|
|
982
|
+
const viewport = collectFastEditorVisualLines(state, layoutWidth, maxVisibleLines);
|
|
983
|
+
if (viewport.lines.some((line) => !isFastRenderableText(line.text))) return null;
|
|
984
|
+
|
|
985
|
+
Reflect.set(editor as object, "lastWidth", layoutWidth);
|
|
986
|
+
|
|
987
|
+
const bc = (s: string) =>
|
|
988
|
+
typeof (editor as { borderColor?: unknown }).borderColor === "function"
|
|
989
|
+
? (editor as { borderColor: (s: string) => string }).borderColor(s)
|
|
990
|
+
: `${getFgAnsiCode("sep")}${s}${ansi.reset}`;
|
|
991
|
+
const border = (marker: "↑" | "↓" | "─") => {
|
|
992
|
+
const text = marker === "─" ? "─".repeat(width - 2) : `${marker}${"─".repeat(Math.max(0, width - 3))}`;
|
|
993
|
+
return ` ${bc(text)}`;
|
|
994
|
+
};
|
|
995
|
+
const promptGlyph = options.bashModeActive ? "$" : config.fixedEditorPromptGlyph;
|
|
996
|
+
const prompt = promptGlyph ? `${ansi.getFgAnsi(200, 200, 200)}${promptGlyph}${ansi.reset}` : "";
|
|
997
|
+
const promptPrefix = prompt ? ` ${prompt} ` : " ";
|
|
998
|
+
const contPrefix = " ";
|
|
999
|
+
|
|
1000
|
+
const lines = [border(viewport.hasBefore ? "↑" : "─")];
|
|
1001
|
+
for (let index = 0; index < viewport.lines.length; index++) {
|
|
1002
|
+
const visual = viewport.lines[index]!;
|
|
1003
|
+
const content = visual.cursorCol === undefined
|
|
1004
|
+
? visual.text
|
|
1005
|
+
: renderFastCursorLine(visual.text, visual.cursorCol, Reflect.get(editor as object, "focused") === true);
|
|
1006
|
+
lines.push(`${index === 0 ? promptPrefix : contPrefix}${padToWidth(content, innerWidth)}`);
|
|
1007
|
+
}
|
|
1008
|
+
lines.push(border(viewport.hasAfter ? "↓" : "─"));
|
|
1009
|
+
return lines;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
847
1012
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
848
1013
|
// Status Line Builder
|
|
849
1014
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -976,6 +1141,7 @@ function warnInvalidSegmentSettings(ctx: any): void {
|
|
|
976
1141
|
}
|
|
977
1142
|
|
|
978
1143
|
export default function powerlineFooter(pi: ExtensionAPI) {
|
|
1144
|
+
const editorPerf = new EditorPerfProfiler(readEditorPerfOptions());
|
|
979
1145
|
const startupSettings = readSettings();
|
|
980
1146
|
config = parsePowerlineConfig(startupSettings.powerline, PRESET_NAMES);
|
|
981
1147
|
let resolvedShortcuts = resolveShortcutConfig(startupSettings);
|
|
@@ -1001,6 +1167,13 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1001
1167
|
let welcomeOverlayShouldDismiss = false;
|
|
1002
1168
|
let lastUserPrompt = "";
|
|
1003
1169
|
let showLastPrompt = true;
|
|
1170
|
+
let lastPromptRenderCache: {
|
|
1171
|
+
source: string;
|
|
1172
|
+
compact: string;
|
|
1173
|
+
width: number;
|
|
1174
|
+
color: string;
|
|
1175
|
+
lines: string[];
|
|
1176
|
+
} | null = null;
|
|
1004
1177
|
let stashedEditorText: string | null = null;
|
|
1005
1178
|
let stashedPromptHistory: string[] = readPersistedStashHistory();
|
|
1006
1179
|
let currentEditor: any = null;
|
|
@@ -1009,6 +1182,13 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1009
1182
|
let bashCompletionEngine = new BashCompletionEngine();
|
|
1010
1183
|
let shellSession: ManagedShellSession | null = null;
|
|
1011
1184
|
const queueStore = new PowerlineQueueStore();
|
|
1185
|
+
let queueSummaryCache: {
|
|
1186
|
+
cwd: string;
|
|
1187
|
+
sessionId?: string;
|
|
1188
|
+
compacting: boolean;
|
|
1189
|
+
expiresAt: number;
|
|
1190
|
+
summary: QueueSummary;
|
|
1191
|
+
} | null = null;
|
|
1012
1192
|
let powerlineCompacting = false;
|
|
1013
1193
|
let deliverAfterRetrySettles = false;
|
|
1014
1194
|
let queueDeliveryTimer: ReturnType<typeof setTimeout> | null = null;
|
|
@@ -1251,7 +1431,32 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1251
1431
|
return currentQueueContext(ctx.cwd ?? process.cwd(), getQueueSessionId(ctx));
|
|
1252
1432
|
}
|
|
1253
1433
|
|
|
1434
|
+
function getQueueSummary(ctx: any): QueueSummary {
|
|
1435
|
+
const context = getQueueContext(ctx);
|
|
1436
|
+
const now = Date.now();
|
|
1437
|
+
if (
|
|
1438
|
+
queueSummaryCache
|
|
1439
|
+
&& queueSummaryCache.cwd === context.cwd
|
|
1440
|
+
&& queueSummaryCache.sessionId === context.sessionId
|
|
1441
|
+
&& queueSummaryCache.compacting === powerlineCompacting
|
|
1442
|
+
&& now < queueSummaryCache.expiresAt
|
|
1443
|
+
) {
|
|
1444
|
+
return queueSummaryCache.summary;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
const summary = queueStore.summarize(context, powerlineCompacting);
|
|
1448
|
+
queueSummaryCache = {
|
|
1449
|
+
cwd: context.cwd,
|
|
1450
|
+
...(context.sessionId ? { sessionId: context.sessionId } : {}),
|
|
1451
|
+
compacting: powerlineCompacting,
|
|
1452
|
+
expiresAt: now + QUEUE_SUMMARY_CACHE_TTL_MS,
|
|
1453
|
+
summary,
|
|
1454
|
+
};
|
|
1455
|
+
return summary;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1254
1458
|
function requestQueueRender(): void {
|
|
1459
|
+
queueSummaryCache = null;
|
|
1255
1460
|
requestImmediateStatusRender({ deferDuringTyping: false });
|
|
1256
1461
|
}
|
|
1257
1462
|
|
|
@@ -1277,49 +1482,6 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1277
1482
|
return item;
|
|
1278
1483
|
}
|
|
1279
1484
|
|
|
1280
|
-
function captureIdeaFromParsedInput(ctx: any, parsed: { target: string | null; text: string }): PowerlineQueueItem | null {
|
|
1281
|
-
const trimmed = parsed.text.trim();
|
|
1282
|
-
if (!trimmed) {
|
|
1283
|
-
ctx.ui.notify("Nothing to capture", "info");
|
|
1284
|
-
return null;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
const target = targetForIdea(parsed.target, queueStore, ctx.cwd ?? process.cwd());
|
|
1288
|
-
const item = captureQueueItem(ctx, trimmed, "idea", target);
|
|
1289
|
-
ctx.ui.notify(`Idea saved (${item.id}) — /ideas to review`, "info");
|
|
1290
|
-
return item;
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
function captureIdeaFromText(ctx: any, text: string): PowerlineQueueItem | null {
|
|
1294
|
-
return captureIdeaFromParsedInput(ctx, parseTargetPrefix(text));
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
function captureCurrentProjectIdea(ctx: any, text: string): PowerlineQueueItem | null {
|
|
1298
|
-
const trimmed = text.trim();
|
|
1299
|
-
if (!trimmed) {
|
|
1300
|
-
ctx.ui.notify("Nothing to capture", "info");
|
|
1301
|
-
return null;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
const item = captureQueueItem(ctx, trimmed, "idea", { kind: "project", cwd: ctx.cwd ?? process.cwd() });
|
|
1305
|
-
ctx.ui.notify(`Idea saved (${item.id}) — /ideas to review`, "info");
|
|
1306
|
-
return item;
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
function isSigilIdeaDraft(text: string): boolean {
|
|
1310
|
-
const sigil = config.queue.captureSigil;
|
|
1311
|
-
if (sigil === false) return false;
|
|
1312
|
-
const normalizedSigil = sigil.trim();
|
|
1313
|
-
if (!normalizedSigil) return false;
|
|
1314
|
-
const trimmed = text.trimStart();
|
|
1315
|
-
return trimmed.startsWith(normalizedSigil) && /^\s/.test(trimmed.slice(normalizedSigil.length));
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
function captureSigilGlyph(): string {
|
|
1319
|
-
const sigil = config.queue.captureSigil === false ? "#" : config.queue.captureSigil;
|
|
1320
|
-
return Array.from(sigil)[0] ?? "#";
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
1485
|
function capturePostCompactPrompt(ctx: any, text: string): PowerlineQueueItem | null {
|
|
1324
1486
|
const trimmed = text.trim();
|
|
1325
1487
|
if (!trimmed) return null;
|
|
@@ -1449,12 +1611,10 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1449
1611
|
}
|
|
1450
1612
|
}
|
|
1451
1613
|
|
|
1452
|
-
async function openQueuePicker(ctx: any
|
|
1453
|
-
const active = queueStore.activeItems(getQueueContext(ctx))
|
|
1454
|
-
mode === "ideas" ? item.intent === "idea" : item.intent !== "idea"
|
|
1455
|
-
));
|
|
1614
|
+
async function openQueuePicker(ctx: any): Promise<void> {
|
|
1615
|
+
const active = queueStore.activeItems(getQueueContext(ctx));
|
|
1456
1616
|
if (active.length === 0) {
|
|
1457
|
-
ctx.ui.notify(
|
|
1617
|
+
ctx.ui.notify("No queued items", "info");
|
|
1458
1618
|
return;
|
|
1459
1619
|
}
|
|
1460
1620
|
|
|
@@ -1465,7 +1625,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1465
1625
|
}));
|
|
1466
1626
|
const selected = await showSelectOverlay(
|
|
1467
1627
|
ctx,
|
|
1468
|
-
|
|
1628
|
+
"Powerline queue",
|
|
1469
1629
|
"↑↓ navigate • enter manage • esc cancel",
|
|
1470
1630
|
items,
|
|
1471
1631
|
Math.min(active.length, 12),
|
|
@@ -1478,7 +1638,12 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1478
1638
|
|
|
1479
1639
|
function resolveCommandTarget(ctx: any, spec: string): QueueTarget {
|
|
1480
1640
|
const normalized = spec.trim().replace(/^@/, "");
|
|
1481
|
-
|
|
1641
|
+
if (normalized === "current") return { kind: "current-session" };
|
|
1642
|
+
if (normalized === "global") return { kind: "global" };
|
|
1643
|
+
|
|
1644
|
+
const cwd = queueStore.resolveAlias(normalized);
|
|
1645
|
+
if (!cwd) throw new Error(`Unknown project alias @${normalized}. Use /queue alias ${normalized} <path> first.`);
|
|
1646
|
+
return { kind: "project", cwd, alias: normalized };
|
|
1482
1647
|
}
|
|
1483
1648
|
|
|
1484
1649
|
function sendOrRetryQueueItem(ctx: any, idPrefix: string): void {
|
|
@@ -1491,42 +1656,6 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1491
1656
|
if (updated) deliverQueueItem(ctx, updated);
|
|
1492
1657
|
}
|
|
1493
1658
|
|
|
1494
|
-
function findNextIdea(ctx: any): PowerlineQueueItem | null {
|
|
1495
|
-
return queueStore.activeItems(getQueueContext(ctx)).find((candidate) => candidate.intent === "idea") ?? null;
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
function sendIdeaIssueHandoff(ctx: any, item: PowerlineQueueItem): void {
|
|
1499
|
-
queueStore.update(item.id, { status: "delivering", error: undefined });
|
|
1500
|
-
requestQueueRender();
|
|
1501
|
-
|
|
1502
|
-
try {
|
|
1503
|
-
const deliverAs = deliveryModeForItem(ctx, item);
|
|
1504
|
-
const issuePrompt = formatIdeaIssuePrompt(item);
|
|
1505
|
-
if (deliverAs) {
|
|
1506
|
-
pi.sendUserMessage(issuePrompt, { deliverAs });
|
|
1507
|
-
} else {
|
|
1508
|
-
pi.sendUserMessage(issuePrompt);
|
|
1509
|
-
}
|
|
1510
|
-
queueStore.update(item.id, { status: "sent", error: undefined });
|
|
1511
|
-
ctx.ui.notify(`Sent idea ${item.id} for issue triage`, "info");
|
|
1512
|
-
requestQueueRender();
|
|
1513
|
-
} catch (error) {
|
|
1514
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1515
|
-
queueStore.update(item.id, { status: "failed", error: message });
|
|
1516
|
-
ctx.ui.notify(`Failed to send ${item.id}: ${message}`, "error");
|
|
1517
|
-
requestQueueRender();
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
function sendIdeaIssueHandoffById(ctx: any, id: string | undefined): void {
|
|
1522
|
-
const item = id ? queueStore.get(id) : findNextIdea(ctx);
|
|
1523
|
-
if (!item || item.intent !== "idea") {
|
|
1524
|
-
ctx.ui.notify(id ? `No unique idea matches ${id}` : "No ideas captured", id ? "warning" : "info");
|
|
1525
|
-
return;
|
|
1526
|
-
}
|
|
1527
|
-
sendIdeaIssueHandoff(ctx, item);
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
1659
|
// Track session start
|
|
1531
1660
|
setupTpsTracker(pi);
|
|
1532
1661
|
|
|
@@ -1569,10 +1698,6 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1569
1698
|
|
|
1570
1699
|
if (ctx.hasUI) {
|
|
1571
1700
|
ctx.ui.setStatus("stash", undefined);
|
|
1572
|
-
const pendingIdeas = queueStore.activeItems(getQueueContext(ctx)).filter((item) => item.intent === "idea").length;
|
|
1573
|
-
if (pendingIdeas > 0) {
|
|
1574
|
-
ctx.ui.notify(`${pendingIdeas} idea${pendingIdeas === 1 ? "" : "s"} waiting — /ideas`, "info");
|
|
1575
|
-
}
|
|
1576
1701
|
}
|
|
1577
1702
|
|
|
1578
1703
|
// Initialize vibe manager (needs modelRegistry from ctx)
|
|
@@ -1982,20 +2107,8 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
1982
2107
|
}
|
|
1983
2108
|
|
|
1984
2109
|
async function handleSelectedStashHistoryEntry(ctx: any, selected: string): Promise<void> {
|
|
1985
|
-
const action = await ctx.ui.select("Stashed prompt", ["Insert", "
|
|
1986
|
-
|
|
1987
|
-
if (action === "Insert") {
|
|
1988
|
-
await insertSelectedPromptHistoryEntry(ctx, selected);
|
|
1989
|
-
return;
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
if (action === "Promote to idea") {
|
|
1993
|
-
try {
|
|
1994
|
-
captureIdeaFromText(ctx, selected);
|
|
1995
|
-
} catch (error) {
|
|
1996
|
-
ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
2110
|
+
const action = await ctx.ui.select("Stashed prompt", ["Insert", "Cancel"]);
|
|
2111
|
+
if (action === "Insert") await insertSelectedPromptHistoryEntry(ctx, selected);
|
|
1999
2112
|
}
|
|
2000
2113
|
|
|
2001
2114
|
function isStashShortcutInput(data: string): boolean {
|
|
@@ -2023,9 +2136,6 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2023
2136
|
if (matchesConfiguredShortcut(data, resolvedShortcuts.cutEditor)) {
|
|
2024
2137
|
return { kind: "cutEditor" };
|
|
2025
2138
|
}
|
|
2026
|
-
if (matchesConfiguredShortcut(data, resolvedShortcuts.ideaCapture)) {
|
|
2027
|
-
return { kind: "ideaCapture" };
|
|
2028
|
-
}
|
|
2029
2139
|
if (matchesConfiguredShortcut(data, resolvedShortcuts.queueOpen)) {
|
|
2030
2140
|
return { kind: "queueOpen" };
|
|
2031
2141
|
}
|
|
@@ -2054,19 +2164,8 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2054
2164
|
return;
|
|
2055
2165
|
}
|
|
2056
2166
|
|
|
2057
|
-
if (action.kind === "ideaCapture") {
|
|
2058
|
-
const text = getEditorTextForClipboard(ctx);
|
|
2059
|
-
if (!text) return;
|
|
2060
|
-
|
|
2061
|
-
const item = captureCurrentProjectIdea(ctx, text);
|
|
2062
|
-
if (item) {
|
|
2063
|
-
ctx.ui.setEditorText("");
|
|
2064
|
-
}
|
|
2065
|
-
return;
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
2167
|
if (action.kind === "queueOpen") {
|
|
2069
|
-
void openQueuePicker(ctx
|
|
2168
|
+
void openQueuePicker(ctx);
|
|
2070
2169
|
return;
|
|
2071
2170
|
}
|
|
2072
2171
|
|
|
@@ -2176,98 +2275,6 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2176
2275
|
|
|
2177
2276
|
registerCdCommand(pi, () => currentCtx?.cwd ?? process.cwd());
|
|
2178
2277
|
|
|
2179
|
-
pi.registerCommand("idea", {
|
|
2180
|
-
description: "Capture an idea without interrupting the current agent. Usage: /idea [@alias|@global|@current] <text> | /idea issue [id]",
|
|
2181
|
-
handler: async (args, ctx) => {
|
|
2182
|
-
currentCtx = ctx;
|
|
2183
|
-
const trimmedArgs = args.trim();
|
|
2184
|
-
const [action, id] = trimmedArgs.split(/\s+/).filter(Boolean);
|
|
2185
|
-
if (action === "issue") {
|
|
2186
|
-
sendIdeaIssueHandoffById(ctx, id);
|
|
2187
|
-
return;
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
const raw = trimmedArgs || getCurrentEditorText(ctx, currentEditor).trim();
|
|
2191
|
-
if (!raw) {
|
|
2192
|
-
ctx.ui.notify("Usage: /idea [@alias|@global|@current] <text> | /idea issue [id]", "info");
|
|
2193
|
-
return;
|
|
2194
|
-
}
|
|
2195
|
-
|
|
2196
|
-
try {
|
|
2197
|
-
const item = captureIdeaFromText(ctx, raw);
|
|
2198
|
-
if (item && !trimmedArgs) {
|
|
2199
|
-
ctx.ui.setEditorText("");
|
|
2200
|
-
}
|
|
2201
|
-
} catch (error) {
|
|
2202
|
-
ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
2203
|
-
}
|
|
2204
|
-
},
|
|
2205
|
-
});
|
|
2206
|
-
|
|
2207
|
-
pi.registerCommand("ideas", {
|
|
2208
|
-
description: "Review or send captured ideas. Usage: /ideas next | /ideas issue [id] | /ideas [send|retry|clear|edit] <id>",
|
|
2209
|
-
handler: async (args, ctx) => {
|
|
2210
|
-
currentCtx = ctx;
|
|
2211
|
-
const parts = args.trim().split(/\s+/).filter(Boolean);
|
|
2212
|
-
const action = parts[0];
|
|
2213
|
-
const id = parts[1];
|
|
2214
|
-
|
|
2215
|
-
if (!action) {
|
|
2216
|
-
await openQueuePicker(ctx, "ideas");
|
|
2217
|
-
return;
|
|
2218
|
-
}
|
|
2219
|
-
|
|
2220
|
-
if (action === "next") {
|
|
2221
|
-
const item = findNextIdea(ctx);
|
|
2222
|
-
if (!item) {
|
|
2223
|
-
ctx.ui.notify("No ideas captured", "info");
|
|
2224
|
-
return;
|
|
2225
|
-
}
|
|
2226
|
-
const updated = queueStore.update(item.id, { status: "queued", target: { kind: "current-session" }, error: undefined });
|
|
2227
|
-
if (updated) deliverQueueItem(ctx, updated);
|
|
2228
|
-
return;
|
|
2229
|
-
}
|
|
2230
|
-
|
|
2231
|
-
if (action === "issue") {
|
|
2232
|
-
sendIdeaIssueHandoffById(ctx, id);
|
|
2233
|
-
return;
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
if (!id) {
|
|
2237
|
-
ctx.ui.notify("Usage: /ideas next | /ideas issue [id] | /ideas [send|retry|clear|edit] <id>", "info");
|
|
2238
|
-
return;
|
|
2239
|
-
}
|
|
2240
|
-
|
|
2241
|
-
const item = queueStore.get(id);
|
|
2242
|
-
if (!item || item.intent !== "idea") {
|
|
2243
|
-
ctx.ui.notify(`No unique idea matches ${id}`, "warning");
|
|
2244
|
-
return;
|
|
2245
|
-
}
|
|
2246
|
-
|
|
2247
|
-
if (action === "send" || action === "retry") {
|
|
2248
|
-
const updated = queueStore.update(item.id, { status: "queued", target: { kind: "current-session" }, error: undefined });
|
|
2249
|
-
if (updated) deliverQueueItem(ctx, updated);
|
|
2250
|
-
return;
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
if (action === "edit") {
|
|
2254
|
-
ctx.ui.setEditorText(item.text);
|
|
2255
|
-
queueStore.clear(item.id);
|
|
2256
|
-
requestQueueRender();
|
|
2257
|
-
return;
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
if (action === "clear") {
|
|
2261
|
-
queueStore.clear(item.id);
|
|
2262
|
-
ctx.ui.notify(`Cleared idea ${item.id}`, "info");
|
|
2263
|
-
requestQueueRender();
|
|
2264
|
-
return;
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
ctx.ui.notify("Usage: /ideas next | /ideas issue [id] | /ideas [send|retry|clear|edit] <id>", "info");
|
|
2268
|
-
},
|
|
2269
|
-
});
|
|
2270
|
-
|
|
2271
2278
|
pi.registerCommand("queue", {
|
|
2272
2279
|
description: "Manage Powerline queued prompts and project aliases",
|
|
2273
2280
|
handler: async (args, ctx) => {
|
|
@@ -2276,7 +2283,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2276
2283
|
const action = parts[0];
|
|
2277
2284
|
|
|
2278
2285
|
if (!action) {
|
|
2279
|
-
await openQueuePicker(ctx
|
|
2286
|
+
await openQueuePicker(ctx);
|
|
2280
2287
|
return;
|
|
2281
2288
|
}
|
|
2282
2289
|
|
|
@@ -2314,7 +2321,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2314
2321
|
if (action === "clear") {
|
|
2315
2322
|
const id = parts[1];
|
|
2316
2323
|
if (id === "all") {
|
|
2317
|
-
const active = queueStore.activeItems(getQueueContext(ctx))
|
|
2324
|
+
const active = queueStore.activeItems(getQueueContext(ctx));
|
|
2318
2325
|
for (const item of active) queueStore.clear(item.id);
|
|
2319
2326
|
ctx.ui.notify(`Cleared ${active.length} queued item${active.length === 1 ? "" : "s"}`, "info");
|
|
2320
2327
|
requestQueueRender();
|
|
@@ -2325,7 +2332,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2325
2332
|
return;
|
|
2326
2333
|
}
|
|
2327
2334
|
const item = queueStore.get(id);
|
|
2328
|
-
if (!item
|
|
2335
|
+
if (!item) {
|
|
2329
2336
|
ctx.ui.notify(`No unique queued item matches ${id}`, "warning");
|
|
2330
2337
|
return;
|
|
2331
2338
|
}
|
|
@@ -2528,6 +2535,22 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2528
2535
|
},
|
|
2529
2536
|
});
|
|
2530
2537
|
|
|
2538
|
+
pi.registerCommand("powerline-perf", {
|
|
2539
|
+
description: "Show or reset opt-in editor performance profiling",
|
|
2540
|
+
handler: async (args, ctx) => {
|
|
2541
|
+
if (!editorPerf.options.enabled) {
|
|
2542
|
+
ctx.ui.notify("Set POWERLINE_DEBUG_PERF=1 and reload to enable editor profiling", "info");
|
|
2543
|
+
return;
|
|
2544
|
+
}
|
|
2545
|
+
if (args.trim().toLowerCase() === "reset") {
|
|
2546
|
+
editorPerf.reset();
|
|
2547
|
+
ctx.ui.notify("Powerline editor performance counters reset", "info");
|
|
2548
|
+
return;
|
|
2549
|
+
}
|
|
2550
|
+
ctx.ui.notify(editorPerf.report(), "info");
|
|
2551
|
+
},
|
|
2552
|
+
});
|
|
2553
|
+
|
|
2531
2554
|
pi.registerCommand("bash-reset", {
|
|
2532
2555
|
description: "Reset the managed bash session",
|
|
2533
2556
|
handler: async (_args, ctx) => {
|
|
@@ -2733,7 +2756,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2733
2756
|
: false;
|
|
2734
2757
|
|
|
2735
2758
|
const thinkingLevel = currentThinkingLevel ?? thinkingLevelFromSession ?? getThinkingLevelFn?.() ?? "off";
|
|
2736
|
-
const queueSummary =
|
|
2759
|
+
const queueSummary = getQueueSummary(ctx);
|
|
2737
2760
|
|
|
2738
2761
|
return {
|
|
2739
2762
|
model: ctx.model,
|
|
@@ -2790,7 +2813,9 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2790
2813
|
const presetDef = getPreset(config.preset);
|
|
2791
2814
|
let segmentCtx: SegmentContext;
|
|
2792
2815
|
try {
|
|
2793
|
-
segmentCtx =
|
|
2816
|
+
segmentCtx = editorPerf.options.enabled
|
|
2817
|
+
? editorPerf.measure("layout.segment-context", () => buildSegmentContext(currentCtx, theme))
|
|
2818
|
+
: buildSegmentContext(currentCtx, theme);
|
|
2794
2819
|
} catch (error) {
|
|
2795
2820
|
if (!isStaleExtensionContextError(error)) throw error;
|
|
2796
2821
|
currentCtx = null;
|
|
@@ -2846,16 +2871,14 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2846
2871
|
|
|
2847
2872
|
function renderPowerlineQueuePreviewLines(width: number, theme: Theme): string[] {
|
|
2848
2873
|
if (!currentCtx) return [];
|
|
2849
|
-
const summary =
|
|
2874
|
+
const summary = getQueueSummary(currentCtx);
|
|
2850
2875
|
if (!summary.leadingText) return [];
|
|
2851
2876
|
|
|
2852
2877
|
const prefix = summary.leadingStatus === "blocked" || summary.leadingStatus === "failed"
|
|
2853
2878
|
? "blocked: "
|
|
2854
2879
|
: summary.leadingStatus === "delivering"
|
|
2855
2880
|
? "sending: "
|
|
2856
|
-
:
|
|
2857
|
-
? "idea: "
|
|
2858
|
-
: "queued: ";
|
|
2881
|
+
: "queued: ";
|
|
2859
2882
|
const text = `${prefix}${summary.leadingText.replace(/\s+/g, " ").trim()}`;
|
|
2860
2883
|
const color = summary.leadingStatus === "blocked" || summary.leadingStatus === "failed" ? "warning" : "dim";
|
|
2861
2884
|
return [` ${theme.fg(color, truncateToWidth(text, Math.max(1, width - 1), "…"))}`];
|
|
@@ -2895,28 +2918,43 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2895
2918
|
function renderLastPromptLines(width: number): string[] {
|
|
2896
2919
|
if (bashModeActive || !showLastPrompt || !lastUserPrompt) return [];
|
|
2897
2920
|
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2921
|
+
const color = getFgAnsiCode("sep");
|
|
2922
|
+
if (
|
|
2923
|
+
lastPromptRenderCache
|
|
2924
|
+
&& lastPromptRenderCache.source === lastUserPrompt
|
|
2925
|
+
&& lastPromptRenderCache.width === width
|
|
2926
|
+
&& lastPromptRenderCache.color === color
|
|
2927
|
+
) {
|
|
2928
|
+
return lastPromptRenderCache.lines;
|
|
2929
|
+
}
|
|
2904
2930
|
|
|
2905
|
-
|
|
2931
|
+
const compact = lastPromptRenderCache?.source === lastUserPrompt
|
|
2932
|
+
? lastPromptRenderCache.compact
|
|
2933
|
+
: lastUserPrompt.replace(/\s+/g, " ").trim();
|
|
2934
|
+
const prefix = ` ${color}↳${ansi.reset} `;
|
|
2935
|
+
const availableWidth = width - visibleWidth(prefix);
|
|
2936
|
+
const lines = compact && availableWidth >= 10
|
|
2937
|
+
? [truncateToWidth(`${prefix}${color}${truncateToWidth(compact, availableWidth, "…")}${ansi.reset}`, width, "…")]
|
|
2938
|
+
: [];
|
|
2906
2939
|
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
return [truncateToWidth(line, width, "…")];
|
|
2940
|
+
lastPromptRenderCache = { source: lastUserPrompt, compact, width, color, lines };
|
|
2941
|
+
return lines;
|
|
2910
2942
|
}
|
|
2911
2943
|
|
|
2912
2944
|
function installPowerlineWidgets(ctx: any) {
|
|
2945
|
+
if (!editorPerf.options.widgets) return;
|
|
2946
|
+
|
|
2947
|
+
const measureWidget = (name: string, render: () => string[]): string[] => {
|
|
2948
|
+
return editorPerf.options.enabled ? editorPerf.measure(`widget.${name}`, render) : render();
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2913
2951
|
ctx.ui.setWidget("powerline-status", () => ({
|
|
2914
2952
|
dispose() {},
|
|
2915
2953
|
invalidate() {
|
|
2916
2954
|
requestStatusRender();
|
|
2917
2955
|
},
|
|
2918
2956
|
render(width: number): string[] {
|
|
2919
|
-
return renderPowerlineStatusLines(width);
|
|
2957
|
+
return measureWidget("status", () => renderPowerlineStatusLines(width));
|
|
2920
2958
|
},
|
|
2921
2959
|
}), { placement: "aboveEditor" });
|
|
2922
2960
|
|
|
@@ -2926,7 +2964,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2926
2964
|
resetLayoutCache();
|
|
2927
2965
|
},
|
|
2928
2966
|
render(width: number): string[] {
|
|
2929
|
-
return renderPowerlinePrimaryLines(width, theme);
|
|
2967
|
+
return measureWidget("primary", () => renderPowerlinePrimaryLines(width, theme));
|
|
2930
2968
|
},
|
|
2931
2969
|
}), { placement: config.placement === "below" ? "belowEditor" : "aboveEditor" });
|
|
2932
2970
|
|
|
@@ -2936,33 +2974,37 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
2936
2974
|
resetLayoutCache();
|
|
2937
2975
|
},
|
|
2938
2976
|
render(width: number): string[] {
|
|
2939
|
-
return renderPowerlineSecondaryLines(width, theme);
|
|
2977
|
+
return measureWidget("secondary", () => renderPowerlineSecondaryLines(width, theme));
|
|
2940
2978
|
},
|
|
2941
2979
|
}), { placement: "belowEditor" });
|
|
2942
2980
|
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2981
|
+
if (editorPerf.options.bashWidgets) {
|
|
2982
|
+
ctx.ui.setWidget("powerline-bash-transcript", (_tui: any, theme: Theme) => ({
|
|
2983
|
+
dispose() {},
|
|
2984
|
+
invalidate() {},
|
|
2985
|
+
render(width: number): string[] {
|
|
2986
|
+
return measureWidget("bash-transcript", () => renderBashTranscriptLines(width, theme));
|
|
2987
|
+
},
|
|
2988
|
+
}), { placement: "belowEditor" });
|
|
2989
|
+
}
|
|
2950
2990
|
|
|
2951
2991
|
ctx.ui.setWidget("powerline-queue-preview", (_tui: any, theme: Theme) => ({
|
|
2952
2992
|
dispose() {},
|
|
2953
2993
|
invalidate() {},
|
|
2954
2994
|
render(width: number): string[] {
|
|
2955
|
-
return renderPowerlineQueuePreviewLines(width, theme);
|
|
2995
|
+
return measureWidget("queue-preview", () => renderPowerlineQueuePreviewLines(width, theme));
|
|
2956
2996
|
},
|
|
2957
2997
|
}), { placement: "belowEditor" });
|
|
2958
2998
|
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2999
|
+
if (editorPerf.options.lastPrompt) {
|
|
3000
|
+
ctx.ui.setWidget("powerline-last-prompt", () => ({
|
|
3001
|
+
dispose() {},
|
|
3002
|
+
invalidate() {},
|
|
3003
|
+
render(width: number): string[] {
|
|
3004
|
+
return measureWidget("last-prompt", () => renderLastPromptLines(width));
|
|
3005
|
+
},
|
|
3006
|
+
}), { placement: "belowEditor" });
|
|
3007
|
+
}
|
|
2966
3008
|
}
|
|
2967
3009
|
|
|
2968
3010
|
function setupCustomEditor(ctx: any) {
|
|
@@ -3001,7 +3043,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
3001
3043
|
ctx.ui.setWidget("powerline-queue-preview", undefined);
|
|
3002
3044
|
ctx.ui.setWidget("powerline-last-prompt", undefined);
|
|
3003
3045
|
|
|
3004
|
-
let autocompleteFixed =
|
|
3046
|
+
let autocompleteFixed = !bashModeSettings.completions;
|
|
3005
3047
|
const previousEditorFactory = typeof ctx.ui.getEditorComponent === "function" ? ctx.ui.getEditorComponent() : undefined;
|
|
3006
3048
|
|
|
3007
3049
|
const editorFactory = (tui: any, editorTheme: any, keybindings: any) => {
|
|
@@ -3024,6 +3066,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
3024
3066
|
},
|
|
3025
3067
|
onNotify: (message, level = "info") => ctx.ui.notify(message, level),
|
|
3026
3068
|
getHistoryEntries: (prefix) => getShellHistoryEntries(prefix),
|
|
3069
|
+
areCompletionsEnabled: () => bashModeSettings.completions,
|
|
3027
3070
|
resolveGhostSuggestion: async (text, signal) => {
|
|
3028
3071
|
const oneOffBash = getOneOffBashCommandContext(text);
|
|
3029
3072
|
if (oneOffBash) {
|
|
@@ -3057,6 +3100,7 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
3057
3100
|
};
|
|
3058
3101
|
|
|
3059
3102
|
const attachAutocompleteProvider = (): boolean => {
|
|
3103
|
+
if (!bashModeSettings.completions) return false;
|
|
3060
3104
|
if (editor.hasWrappedProvider()) return true;
|
|
3061
3105
|
const defaultProvider = getInstalledAutocompleteProvider();
|
|
3062
3106
|
if (!defaultProvider) return false;
|
|
@@ -3079,29 +3123,21 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
3079
3123
|
restorePromptHistory(editor);
|
|
3080
3124
|
attachAutocompleteProvider();
|
|
3081
3125
|
|
|
3082
|
-
const
|
|
3083
|
-
|
|
3126
|
+
const baseHandleInput = editor.handleInput.bind(editor);
|
|
3127
|
+
const originalHandleInput = editorPerf.options.enabled
|
|
3128
|
+
? (data: string) => editorPerf.measure("input.base-editor", () => baseHandleInput(data))
|
|
3129
|
+
: baseHandleInput;
|
|
3130
|
+
const handlePowerlineEditorInput = (data: string) => {
|
|
3084
3131
|
lastEditorInputAt = Date.now();
|
|
3085
3132
|
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
if (sigilCapture) {
|
|
3091
|
-
try {
|
|
3092
|
-
const item = captureIdeaFromParsedInput(ctx, sigilCapture);
|
|
3093
|
-
if (item) {
|
|
3094
|
-
editor.addToHistory?.(editor.getExpandedText().trim());
|
|
3095
|
-
editor.setText("");
|
|
3096
|
-
}
|
|
3097
|
-
} catch (error) {
|
|
3098
|
-
ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
3099
|
-
}
|
|
3100
|
-
scheduleDismissWelcome(ctx);
|
|
3101
|
-
return;
|
|
3102
|
-
}
|
|
3133
|
+
if (isPrintableInput(data)) {
|
|
3134
|
+
scheduleDismissWelcome(ctx);
|
|
3135
|
+
originalHandleInput(data);
|
|
3136
|
+
return;
|
|
3103
3137
|
}
|
|
3104
3138
|
|
|
3139
|
+
const isSubmit = keybindings.matches(data, "tui.input.submit") && !keybindings.matches(data, "tui.input.newLine");
|
|
3140
|
+
const isFollowUpSubmit = keybindings.matches(data, "app.message.followUp");
|
|
3105
3141
|
if (!powerlineCompacting && !bashModeActive && isSubmit && typeof ctx.compact === "function") {
|
|
3106
3142
|
const editorText = editor.getExpandedText().trim();
|
|
3107
3143
|
const compactQueuedPrompt = parseCompactQueuedPrompt(editorText);
|
|
@@ -3158,60 +3194,101 @@ export default function powerlineFooter(pi: ExtensionAPI) {
|
|
|
3158
3194
|
return;
|
|
3159
3195
|
}
|
|
3160
3196
|
|
|
3161
|
-
|
|
3197
|
+
if (bashModeSettings.completions) {
|
|
3198
|
+
attachAutocompleteProvider();
|
|
3199
|
+
}
|
|
3162
3200
|
scheduleDismissWelcome(ctx);
|
|
3163
3201
|
originalHandleInput(data);
|
|
3164
3202
|
};
|
|
3203
|
+
editor.handleInput = editorPerf.options.enabled
|
|
3204
|
+
? (data: string) => {
|
|
3205
|
+
editorPerf.measure("input.total", () => handlePowerlineEditorInput(data));
|
|
3206
|
+
const state = Reflect.get(editor, "state");
|
|
3207
|
+
const lines = state && typeof state === "object" ? Reflect.get(state, "lines") : null;
|
|
3208
|
+
if (Array.isArray(lines)) editorPerf.observeDraft(lines);
|
|
3209
|
+
}
|
|
3210
|
+
: handlePowerlineEditorInput;
|
|
3165
3211
|
|
|
3166
3212
|
const originalRender = editor.render.bind(editor);
|
|
3167
3213
|
editor.render = (width: number): string[] => {
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3214
|
+
const renderPowerlineEditor = (): string[] => {
|
|
3215
|
+
if (!editorPerf.options.editorChrome) {
|
|
3216
|
+
return editorPerf.options.enabled
|
|
3217
|
+
? editorPerf.measure("editor.render.base", () => originalRender(width))
|
|
3218
|
+
: originalRender(width);
|
|
3219
|
+
}
|
|
3171
3220
|
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
let bottomBorderIndex = lines.length - 1;
|
|
3188
|
-
for (let i = lines.length - 1; i >= 1; i--) {
|
|
3189
|
-
const stripped = lines[i]?.replace(/\x1b\[[0-9;]*m/g, "") || "";
|
|
3190
|
-
if (stripped.length > 0 && /^─{3,}/.test(stripped)) {
|
|
3191
|
-
bottomBorderIndex = i;
|
|
3192
|
-
break;
|
|
3221
|
+
if (editorPerf.options.fastRender) {
|
|
3222
|
+
const fastLines = editorPerf.options.enabled
|
|
3223
|
+
? editorPerf.measure("editor.render.fast-probe", () => renderFastPowerlineEditor(editor, width, {
|
|
3224
|
+
bashModeActive,
|
|
3225
|
+
completionsEnabled: bashModeSettings.completions,
|
|
3226
|
+
}))
|
|
3227
|
+
: renderFastPowerlineEditor(editor, width, {
|
|
3228
|
+
bashModeActive,
|
|
3229
|
+
completionsEnabled: bashModeSettings.completions,
|
|
3230
|
+
});
|
|
3231
|
+
if (fastLines) {
|
|
3232
|
+
if (editorPerf.options.enabled) editorPerf.count("editor.render.fast-hit");
|
|
3233
|
+
return fastLines;
|
|
3234
|
+
}
|
|
3193
3235
|
}
|
|
3194
|
-
}
|
|
3195
3236
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3237
|
+
if (width < 10) {
|
|
3238
|
+
return editorPerf.options.enabled
|
|
3239
|
+
? editorPerf.measure("editor.render.base", () => originalRender(width))
|
|
3240
|
+
: originalRender(width);
|
|
3241
|
+
}
|
|
3198
3242
|
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3243
|
+
const bc = (s: string) =>
|
|
3244
|
+
typeof editor.borderColor === "function"
|
|
3245
|
+
? editor.borderColor(s)
|
|
3246
|
+
: `${getFgAnsiCode("sep")}${s}${ansi.reset}`;
|
|
3247
|
+
const promptGlyph = bashModeActive ? "$" : config.fixedEditorPromptGlyph;
|
|
3248
|
+
const promptColor = ansi.getFgAnsi(200, 200, 200);
|
|
3249
|
+
const prompt = promptGlyph ? `${promptColor}${promptGlyph}${ansi.reset}` : "";
|
|
3250
|
+
const promptPrefix = prompt ? ` ${prompt} ` : " ";
|
|
3251
|
+
const contPrefix = " ";
|
|
3252
|
+
const contentWidth = Math.max(1, width - 1);
|
|
3253
|
+
const lines = editorPerf.options.enabled
|
|
3254
|
+
? editorPerf.measure("editor.render.base", () => originalRender(contentWidth))
|
|
3255
|
+
: originalRender(contentWidth);
|
|
3256
|
+
|
|
3257
|
+
if (lines.length === 0) return lines;
|
|
3258
|
+
|
|
3259
|
+
let bottomBorderIndex = lines.length - 1;
|
|
3260
|
+
for (let i = lines.length - 1; i >= 1; i--) {
|
|
3261
|
+
const stripped = lines[i]?.replace(/\x1b\[[0-9;]*m/g, "") || "";
|
|
3262
|
+
if (stripped.length > 0 && /^─{3,}/.test(stripped)) {
|
|
3263
|
+
bottomBorderIndex = i;
|
|
3264
|
+
break;
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3203
3267
|
|
|
3204
|
-
|
|
3205
|
-
result.push(
|
|
3206
|
-
|
|
3268
|
+
const result: string[] = [];
|
|
3269
|
+
result.push(" " + bc("─".repeat(width - 2)));
|
|
3270
|
+
|
|
3271
|
+
for (let i = 1; i < bottomBorderIndex; i++) {
|
|
3272
|
+
const prefix = i === 1 ? promptPrefix : contPrefix;
|
|
3273
|
+
result.push(`${prefix}${lines[i] || ""}`);
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
if (bottomBorderIndex === 1) {
|
|
3277
|
+
result.push(`${promptPrefix}${" ".repeat(contentWidth)}`);
|
|
3278
|
+
}
|
|
3207
3279
|
|
|
3208
|
-
|
|
3280
|
+
result.push(" " + bc("─".repeat(width - 2)));
|
|
3209
3281
|
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3282
|
+
for (let i = bottomBorderIndex + 1; i < lines.length; i++) {
|
|
3283
|
+
result.push(lines[i] || "");
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
return result;
|
|
3287
|
+
};
|
|
3213
3288
|
|
|
3214
|
-
return
|
|
3289
|
+
return editorPerf.options.enabled
|
|
3290
|
+
? editorPerf.measure("editor.render.total", renderPowerlineEditor)
|
|
3291
|
+
: renderPowerlineEditor();
|
|
3215
3292
|
};
|
|
3216
3293
|
|
|
3217
3294
|
return editor;
|