@selesai/code 0.6.2 → 0.7.0
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 +16 -1
- package/README.md +1 -1
- package/dist/bun/cli.d.ts +0 -1
- package/dist/bun/cli.js +0 -1
- package/dist/bun/register-bedrock.d.ts +0 -1
- package/dist/bun/register-bedrock.js +0 -1
- package/dist/bun/restore-sandbox-env.d.ts +0 -1
- package/dist/bun/restore-sandbox-env.js +0 -1
- package/dist/cli/args.d.ts +0 -1
- package/dist/cli/args.js +0 -1
- package/dist/cli/config-selector.d.ts +0 -1
- package/dist/cli/config-selector.js +0 -1
- package/dist/cli/credential-print.d.ts +0 -1
- package/dist/cli/credential-print.js +0 -1
- package/dist/cli/file-processor.d.ts +0 -1
- package/dist/cli/file-processor.js +0 -1
- package/dist/cli/initial-message.d.ts +0 -1
- package/dist/cli/initial-message.js +0 -1
- package/dist/cli/list-models.d.ts +0 -1
- package/dist/cli/list-models.js +0 -1
- package/dist/cli/project-trust.d.ts +0 -1
- package/dist/cli/project-trust.js +0 -1
- package/dist/cli/session-picker.d.ts +0 -1
- package/dist/cli/session-picker.js +0 -1
- package/dist/cli/startup-ui.d.ts +0 -1
- package/dist/cli/startup-ui.js +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/core/agent-session-auto-handoff.test.d.ts +0 -1
- package/dist/core/agent-session-auto-handoff.test.js +0 -1
- package/dist/core/agent-session-runtime.d.ts +0 -1
- package/dist/core/agent-session-runtime.js +0 -1
- package/dist/core/agent-session-services.d.ts +0 -1
- package/dist/core/agent-session-services.js +0 -1
- package/dist/core/agent-session-skill-block.test.d.ts +0 -1
- package/dist/core/agent-session-skill-block.test.js +0 -1
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +0 -1
- package/dist/core/agents.d.ts +0 -1
- package/dist/core/agents.js +0 -1
- package/dist/core/auth-guidance.d.ts +0 -1
- package/dist/core/auth-guidance.js +0 -1
- package/dist/core/auth-storage.d.ts +0 -1
- package/dist/core/auth-storage.js +0 -1
- package/dist/core/bash-executor.d.ts +0 -1
- package/dist/core/bash-executor.js +0 -1
- package/dist/core/built-in-extensions.d.ts +0 -1
- package/dist/core/built-in-extensions.js +0 -1
- package/dist/core/cache-stats.d.ts +0 -1
- package/dist/core/cache-stats.js +0 -1
- package/dist/core/compaction/branch-summarization.d.ts +0 -1
- package/dist/core/compaction/branch-summarization.js +0 -1
- package/dist/core/compaction/compaction.d.ts +0 -1
- package/dist/core/compaction/compaction.js +0 -1
- package/dist/core/compaction/index.d.ts +0 -1
- package/dist/core/compaction/index.js +0 -1
- package/dist/core/compaction/utils.d.ts +0 -1
- package/dist/core/compaction/utils.js +0 -1
- package/dist/core/defaults.d.ts +0 -1
- package/dist/core/defaults.js +0 -1
- package/dist/core/diagnostics.d.ts +0 -1
- package/dist/core/diagnostics.js +0 -1
- package/dist/core/event-bus.d.ts +0 -1
- package/dist/core/event-bus.js +0 -1
- package/dist/core/exec.d.ts +0 -1
- package/dist/core/exec.js +0 -1
- package/dist/core/experimental.d.ts +0 -1
- package/dist/core/experimental.js +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts +0 -1
- package/dist/core/export-html/ansi-to-html.js +0 -1
- package/dist/core/export-html/index.d.ts +0 -1
- package/dist/core/export-html/index.js +0 -1
- package/dist/core/export-html/tool-renderer.d.ts +0 -1
- package/dist/core/export-html/tool-renderer.js +0 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +0 -1
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/loader.js +0 -1
- package/dist/core/extensions/runner.d.ts +0 -1
- package/dist/core/extensions/runner.js +0 -1
- package/dist/core/extensions/types.d.ts +0 -1
- package/dist/core/extensions/types.js +0 -1
- package/dist/core/extensions/wrapper.d.ts +0 -1
- package/dist/core/extensions/wrapper.js +0 -1
- package/dist/core/footer-data-provider.d.ts +0 -1
- package/dist/core/footer-data-provider.js +0 -1
- package/dist/core/git-command.d.ts +0 -1
- package/dist/core/git-command.js +0 -1
- package/dist/core/http-dispatcher.d.ts +0 -1
- package/dist/core/http-dispatcher.js +0 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/keybindings.d.ts +0 -1
- package/dist/core/keybindings.js +0 -1
- package/dist/core/llama/client.d.ts +0 -1
- package/dist/core/llama/client.js +0 -1
- package/dist/core/llama/huggingface.d.ts +0 -1
- package/dist/core/llama/huggingface.js +0 -1
- package/dist/core/llama/index.d.ts +0 -1
- package/dist/core/llama/index.js +0 -1
- package/dist/core/llama/provider.d.ts +0 -1
- package/dist/core/llama/provider.js +0 -1
- package/dist/core/llama/ui.d.ts +0 -1
- package/dist/core/llama/ui.js +0 -1
- package/dist/core/messages.d.ts +0 -1
- package/dist/core/messages.js +0 -1
- package/dist/core/model-config.d.ts +0 -1
- package/dist/core/model-config.js +0 -1
- package/dist/core/model-registry.d.ts +0 -1
- package/dist/core/model-registry.js +0 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.js +0 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.js +0 -1
- package/dist/core/models-store.d.ts +0 -1
- package/dist/core/models-store.js +0 -1
- package/dist/core/output-guard.d.ts +0 -1
- package/dist/core/output-guard.js +0 -1
- package/dist/core/package-manager.d.ts +0 -1
- package/dist/core/package-manager.js +0 -1
- package/dist/core/package-manager.test.d.ts +0 -1
- package/dist/core/package-manager.test.js +0 -1
- package/dist/core/project-trust.d.ts +0 -1
- package/dist/core/project-trust.js +0 -1
- package/dist/core/prompt-templates.d.ts +0 -1
- package/dist/core/prompt-templates.js +0 -1
- package/dist/core/provider-attribution.d.ts +0 -1
- package/dist/core/provider-attribution.js +0 -1
- package/dist/core/provider-composer.d.ts +0 -1
- package/dist/core/provider-composer.js +0 -1
- package/dist/core/radius.d.ts +0 -1
- package/dist/core/radius.js +0 -1
- package/dist/core/remote-catalog-provider.d.ts +0 -1
- package/dist/core/remote-catalog-provider.js +0 -1
- package/dist/core/resolve-config-value.d.ts +0 -1
- package/dist/core/resolve-config-value.js +0 -1
- package/dist/core/resource-loader.d.ts +0 -1
- package/dist/core/resource-loader.js +0 -1
- package/dist/core/runtime-credentials.d.ts +0 -1
- package/dist/core/runtime-credentials.js +0 -1
- package/dist/core/sdk.d.ts +0 -1
- package/dist/core/sdk.js +0 -1
- package/dist/core/session-cwd.d.ts +0 -1
- package/dist/core/session-cwd.js +0 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.js +0 -1
- package/dist/core/settings-manager-auto-handoff.test.d.ts +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js +0 -1
- package/dist/core/settings-manager.d.ts +0 -4
- package/dist/core/settings-manager.js +0 -12
- package/dist/core/skills.d.ts +0 -1
- package/dist/core/skills.js +0 -1
- package/dist/core/slash-commands.d.ts +0 -1
- package/dist/core/slash-commands.js +0 -1
- package/dist/core/source-info.d.ts +0 -1
- package/dist/core/source-info.js +0 -1
- package/dist/core/system-prompt.d.ts +0 -1
- package/dist/core/system-prompt.js +0 -1
- package/dist/core/system-prompt.test.d.ts +0 -1
- package/dist/core/system-prompt.test.js +0 -1
- package/dist/core/telemetry.d.ts +0 -1
- package/dist/core/telemetry.js +0 -1
- package/dist/core/timings.d.ts +0 -1
- package/dist/core/timings.js +0 -1
- package/dist/core/tools/bash.d.ts +0 -1
- package/dist/core/tools/bash.js +0 -1
- package/dist/core/tools/edit-diff.d.ts +0 -1
- package/dist/core/tools/edit-diff.js +0 -1
- package/dist/core/tools/edit.d.ts +0 -1
- package/dist/core/tools/edit.js +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts +0 -1
- package/dist/core/tools/file-mutation-queue.js +0 -1
- package/dist/core/tools/find.d.ts +0 -1
- package/dist/core/tools/find.js +0 -1
- package/dist/core/tools/grep.d.ts +0 -1
- package/dist/core/tools/grep.js +0 -1
- package/dist/core/tools/index.d.ts +0 -1
- package/dist/core/tools/index.js +0 -1
- package/dist/core/tools/ls.d.ts +0 -1
- package/dist/core/tools/ls.js +0 -1
- package/dist/core/tools/output-accumulator.d.ts +0 -1
- package/dist/core/tools/output-accumulator.js +0 -1
- package/dist/core/tools/path-utils.d.ts +0 -1
- package/dist/core/tools/path-utils.js +0 -1
- package/dist/core/tools/read.d.ts +0 -1
- package/dist/core/tools/read.js +0 -1
- package/dist/core/tools/render-utils.d.ts +0 -1
- package/dist/core/tools/render-utils.js +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +0 -1
- package/dist/core/tools/tool-definition-wrapper.js +0 -1
- package/dist/core/tools/truncate.d.ts +0 -1
- package/dist/core/tools/truncate.js +0 -1
- package/dist/core/tools/write.d.ts +0 -1
- package/dist/core/tools/write.js +0 -1
- package/dist/core/trust-manager.d.ts +0 -1
- package/dist/core/trust-manager.js +0 -1
- package/dist/core/usage-totals.d.ts +0 -1
- package/dist/core/usage-totals.js +0 -1
- package/dist/defaults/models.json +8 -0
- package/dist/defaults/settings.json +6 -7
- package/dist/extensions/inline-skills.test.ts +13 -13
- package/dist/extensions/inline-skills.ts +6 -6
- package/dist/extensions/pi-subagents/CHANGELOG.md +89 -12
- package/dist/extensions/pi-subagents/README.md +339 -604
- package/dist/extensions/pi-subagents/package-lock.json +190 -2079
- package/dist/extensions/pi-subagents/package.json +13 -5
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +1 -1
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +1 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +10 -10
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +32 -43
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +106 -105
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +3 -3
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +28 -35
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +167 -124
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +19 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +163 -75
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +10 -7
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +5 -3
- package/dist/extensions/pi-subagents/src/agents/identity.ts +1 -1
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +14 -11
- package/dist/extensions/pi-subagents/src/agents/skills.ts +23 -6
- package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +8 -1
- package/dist/extensions/pi-subagents/src/api/control-channel.ts +4 -0
- package/dist/extensions/pi-subagents/src/api/delegation.ts +26 -194
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +129 -0
- package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +3 -0
- package/dist/extensions/pi-subagents/src/api/pi-args.ts +5 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +4 -4
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +19 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +10 -0
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +5 -39
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +10 -9
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +7 -4
- package/dist/extensions/pi-subagents/src/extension/index.ts +243 -77
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +18 -6
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +50 -39
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +36 -103
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +229 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +130 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +141 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +154 -0
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +330 -0
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +3 -2
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +5 -1
- package/dist/extensions/pi-subagents/src/missions/actions.ts +372 -0
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +314 -0
- package/dist/extensions/pi-subagents/src/missions/store.ts +442 -0
- package/dist/extensions/pi-subagents/src/missions/types.ts +135 -0
- package/dist/extensions/pi-subagents/src/policy/authority.ts +46 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +32 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +103 -72
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +10 -2
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +29 -1
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -2
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +9 -7
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +3 -4
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +3 -28
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +5 -5
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +18 -68
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +35 -8
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +602 -375
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +612 -464
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +50 -9
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +253 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +12 -4
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +8 -4
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +74 -102
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +21 -22
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1050 -396
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +44 -18
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +0 -1
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +302 -22
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +130 -0
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +42 -1
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +59 -5
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +9 -4
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +86 -2
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +11 -2
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +95 -0
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +15 -6
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +9 -63
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +37 -6
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +5 -2
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +2 -23
- package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +6 -6
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +124 -13
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +29 -7
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +18 -1
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +3 -2
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +1 -0
- package/dist/extensions/pi-subagents/src/shared/settings.ts +10 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +158 -55
- package/dist/extensions/pi-subagents/src/shared/utils.ts +16 -66
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +33 -199
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +43 -126
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +103 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +158 -205
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +22 -58
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +14 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +44 -642
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +18 -14
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +156 -21
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +110 -5
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +60 -24
- package/dist/extensions/pi-subagents/src/tui/render.ts +296 -140
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +14 -0
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +13 -7
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +2 -2
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +145 -0
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +4 -1
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +3 -2
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +140 -0
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +415 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +41 -144
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +16 -16
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +415 -298
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +149 -82
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +40 -40
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +15 -15
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +193 -133
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -49
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +62 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +56 -58
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +81 -68
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +20 -25
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +425 -317
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +73 -73
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +123 -98
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +653 -240
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +20 -1661
- 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 +3 -3
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +8 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +6 -6
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -20
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +25 -4
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +280 -295
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +47 -207
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +89 -89
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +10 -0
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +33 -9
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +24 -2
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +11 -9
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +40 -40
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +5 -39
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +19 -19
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +20 -20
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +99 -0
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +9 -9
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +41 -0
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +35 -5
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +16 -82
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +162 -620
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
- package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +125 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +94 -0
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +66 -0
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +242 -52
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +127 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +197 -36
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +245 -0
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +494 -0
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +261 -31
- package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +6 -6
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +217 -0
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +182 -0
- package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +20 -12
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +47 -5
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +49 -55
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +20 -3
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +37 -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/permissions.test.ts +46 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +31 -10
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +40 -16
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +42 -44
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +75 -9
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +20 -84
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +15 -16
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +28 -28
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +19 -12
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +37 -21
- 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 +50 -50
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +396 -433
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +76 -153
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +411 -0
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +1 -91
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +139 -0
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +29 -0
- 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 +2 -2
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +53 -18
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +13 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +44 -11
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +2 -26
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +24 -148
- package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +11 -9
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +351 -0
- 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-permission-arbiter.test.ts +79 -0
- 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 +45 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +197 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +142 -12
- package/dist/extensions/pi-subagents/tsconfig.json +15 -0
- package/dist/extensions/pi-web-agent/package.json +1 -1
- package/dist/extensions/rtk.test.ts +126 -0
- package/dist/extensions/rtk.ts +56 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -1
- package/dist/migrations.d.ts +0 -1
- package/dist/migrations.js +0 -1
- package/dist/modes/index.d.ts +0 -1
- package/dist/modes/index.js +0 -1
- package/dist/modes/interactive/components/armin.d.ts +0 -1
- package/dist/modes/interactive/components/armin.js +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -1
- package/dist/modes/interactive/components/assistant-message.js +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.js +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +0 -1
- package/dist/modes/interactive/components/bordered-loader.js +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts +0 -1
- package/dist/modes/interactive/components/config-selector.js +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +0 -1
- package/dist/modes/interactive/components/countdown-timer.js +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -1
- package/dist/modes/interactive/components/custom-editor.js +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +0 -1
- package/dist/modes/interactive/components/custom-entry.js +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts +0 -1
- package/dist/modes/interactive/components/custom-message.js +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +0 -1
- package/dist/modes/interactive/components/daxnuts.js +0 -1
- package/dist/modes/interactive/components/diff.d.ts +0 -1
- package/dist/modes/interactive/components/diff.js +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +0 -1
- package/dist/modes/interactive/components/dynamic-border.js +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -1
- package/dist/modes/interactive/components/extension-editor.js +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts +0 -1
- package/dist/modes/interactive/components/extension-input.js +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +0 -1
- package/dist/modes/interactive/components/extension-selector.js +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +0 -1
- package/dist/modes/interactive/components/first-time-setup.js +0 -1
- package/dist/modes/interactive/components/footer.d.ts +0 -1
- package/dist/modes/interactive/components/footer.js +0 -1
- package/dist/modes/interactive/components/index.d.ts +0 -1
- package/dist/modes/interactive/components/index.js +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +0 -1
- package/dist/modes/interactive/components/login-dialog.js +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts +0 -1
- package/dist/modes/interactive/components/model-selector.js +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -1
- package/dist/modes/interactive/components/oauth-selector.js +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector-search.js +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector.js +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +0 -3
- package/dist/modes/interactive/components/settings-selector.js +1 -14
- package/dist/modes/interactive/components/show-images-selector.d.ts +0 -1
- package/dist/modes/interactive/components/show-images-selector.js +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -1
- package/dist/modes/interactive/components/status-indicator.js +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +0 -1
- package/dist/modes/interactive/components/theme-selector.js +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +0 -1
- package/dist/modes/interactive/components/thinking-selector.js +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/dist/modes/interactive/components/tool-execution.js +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -1
- package/dist/modes/interactive/components/tree-selector.js +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +0 -1
- package/dist/modes/interactive/components/trust-selector.js +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +0 -1
- package/dist/modes/interactive/components/user-message-selector.js +0 -1
- package/dist/modes/interactive/components/user-message.d.ts +0 -1
- package/dist/modes/interactive/components/user-message.js +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +0 -1
- package/dist/modes/interactive/components/visual-truncate.js +0 -1
- package/dist/modes/interactive/external-editor.d.ts +0 -1
- package/dist/modes/interactive/external-editor.js +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -2
- package/dist/modes/interactive/interactive-mode.js +1 -22
- package/dist/modes/interactive/model-search.d.ts +0 -1
- package/dist/modes/interactive/model-search.js +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
- package/dist/modes/interactive/theme/theme-controller.js +0 -1
- package/dist/modes/interactive/theme/theme.d.ts +0 -1
- package/dist/modes/interactive/theme/theme.js +0 -1
- package/dist/modes/print-mode.d.ts +0 -1
- package/dist/modes/print-mode.js +0 -1
- package/dist/modes/rpc/jsonl.d.ts +0 -1
- package/dist/modes/rpc/jsonl.js +0 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -2
- package/dist/modes/rpc/rpc-client.js +1 -2
- package/dist/modes/rpc/rpc-mode.d.ts +0 -1
- package/dist/modes/rpc/rpc-mode.js +0 -9
- package/dist/modes/rpc/rpc-types.d.ts +0 -1
- package/dist/modes/rpc/rpc-types.js +0 -1
- package/dist/package-manager-cli.d.ts +0 -1
- package/dist/package-manager-cli.js +0 -1
- package/dist/rpc-entry.d.ts +0 -1
- package/dist/rpc-entry.js +0 -1
- package/dist/utils/ansi.d.ts +0 -1
- package/dist/utils/ansi.js +0 -1
- package/dist/utils/changelog.d.ts +0 -1
- package/dist/utils/changelog.js +0 -1
- package/dist/utils/child-process.d.ts +0 -1
- package/dist/utils/child-process.js +0 -1
- package/dist/utils/clipboard-image.d.ts +0 -1
- package/dist/utils/clipboard-image.js +0 -1
- package/dist/utils/clipboard-native.d.ts +0 -1
- package/dist/utils/clipboard-native.js +0 -1
- package/dist/utils/clipboard.d.ts +0 -1
- package/dist/utils/clipboard.js +0 -1
- package/dist/utils/deprecation.d.ts +0 -1
- package/dist/utils/deprecation.js +0 -1
- package/dist/utils/exif-orientation.d.ts +0 -1
- package/dist/utils/exif-orientation.js +0 -1
- package/dist/utils/frontmatter.d.ts +0 -1
- package/dist/utils/frontmatter.js +0 -1
- package/dist/utils/fs-watch.d.ts +0 -1
- package/dist/utils/fs-watch.js +0 -1
- package/dist/utils/git.d.ts +0 -1
- package/dist/utils/git.js +0 -1
- package/dist/utils/html.d.ts +0 -1
- package/dist/utils/html.js +0 -1
- package/dist/utils/image-convert.d.ts +0 -1
- package/dist/utils/image-convert.js +0 -1
- package/dist/utils/image-process.d.ts +0 -1
- package/dist/utils/image-process.js +0 -1
- package/dist/utils/image-resize-core.d.ts +0 -1
- package/dist/utils/image-resize-core.js +0 -1
- package/dist/utils/image-resize-worker.d.ts +0 -1
- package/dist/utils/image-resize-worker.js +0 -1
- package/dist/utils/image-resize.d.ts +0 -1
- package/dist/utils/image-resize.js +0 -1
- package/dist/utils/json.d.ts +0 -1
- package/dist/utils/json.js +0 -1
- package/dist/utils/mime.d.ts +0 -1
- package/dist/utils/mime.js +0 -1
- package/dist/utils/open-browser.d.ts +0 -1
- package/dist/utils/open-browser.js +0 -1
- package/dist/utils/paths.d.ts +0 -1
- package/dist/utils/paths.js +0 -1
- package/dist/utils/photon.d.ts +0 -1
- package/dist/utils/photon.js +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -1
- package/dist/utils/pi-user-agent.js +0 -1
- package/dist/utils/shell.d.ts +0 -1
- package/dist/utils/shell.js +0 -1
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/utils/sleep.js +0 -1
- package/dist/utils/syntax-highlight.d.ts +0 -1
- package/dist/utils/syntax-highlight.js +0 -1
- package/dist/utils/thinking-tags.d.ts +0 -1
- package/dist/utils/thinking-tags.js +0 -1
- package/dist/utils/tools-manager.d.ts +3 -3
- package/dist/utils/tools-manager.js +125 -42
- package/dist/utils/version-check.d.ts +0 -1
- package/dist/utils/version-check.js +0 -1
- package/dist/utils/windows-self-update.d.ts +0 -1
- package/dist/utils/windows-self-update.js +0 -1
- package/docs/rpc.md +1 -2
- package/docs/settings.md +0 -1
- package/docs/skills.md +10 -18
- package/package.json +4 -3
- package/dist/bun/cli.d.ts.map +0 -1
- package/dist/bun/cli.js.map +0 -1
- package/dist/bun/register-bedrock.d.ts.map +0 -1
- package/dist/bun/register-bedrock.js.map +0 -1
- package/dist/bun/restore-sandbox-env.d.ts.map +0 -1
- package/dist/bun/restore-sandbox-env.js.map +0 -1
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-selector.d.ts.map +0 -1
- package/dist/cli/config-selector.js.map +0 -1
- package/dist/cli/credential-print.d.ts.map +0 -1
- package/dist/cli/credential-print.js.map +0 -1
- package/dist/cli/file-processor.d.ts.map +0 -1
- package/dist/cli/file-processor.js.map +0 -1
- package/dist/cli/initial-message.d.ts.map +0 -1
- package/dist/cli/initial-message.js.map +0 -1
- package/dist/cli/list-models.d.ts.map +0 -1
- package/dist/cli/list-models.js.map +0 -1
- package/dist/cli/project-trust.d.ts.map +0 -1
- package/dist/cli/project-trust.js.map +0 -1
- package/dist/cli/session-picker.d.ts.map +0 -1
- package/dist/cli/session-picker.js.map +0 -1
- package/dist/cli/startup-ui.d.ts.map +0 -1
- package/dist/cli/startup-ui.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/core/agent-session-auto-handoff.test.d.ts.map +0 -1
- package/dist/core/agent-session-auto-handoff.test.js.map +0 -1
- package/dist/core/agent-session-runtime.d.ts.map +0 -1
- package/dist/core/agent-session-runtime.js.map +0 -1
- package/dist/core/agent-session-services.d.ts.map +0 -1
- package/dist/core/agent-session-services.js.map +0 -1
- package/dist/core/agent-session-skill-block.test.d.ts.map +0 -1
- package/dist/core/agent-session-skill-block.test.js.map +0 -1
- package/dist/core/agent-session.d.ts.map +0 -1
- package/dist/core/agent-session.js.map +0 -1
- package/dist/core/agents.d.ts.map +0 -1
- package/dist/core/agents.js.map +0 -1
- package/dist/core/auth-guidance.d.ts.map +0 -1
- package/dist/core/auth-guidance.js.map +0 -1
- package/dist/core/auth-storage.d.ts.map +0 -1
- package/dist/core/auth-storage.js.map +0 -1
- package/dist/core/bash-executor.d.ts.map +0 -1
- package/dist/core/bash-executor.js.map +0 -1
- package/dist/core/built-in-extensions.d.ts.map +0 -1
- package/dist/core/built-in-extensions.js.map +0 -1
- package/dist/core/cache-stats.d.ts.map +0 -1
- package/dist/core/cache-stats.js.map +0 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
- package/dist/core/compaction/branch-summarization.js.map +0 -1
- package/dist/core/compaction/compaction.d.ts.map +0 -1
- package/dist/core/compaction/compaction.js.map +0 -1
- package/dist/core/compaction/index.d.ts.map +0 -1
- package/dist/core/compaction/index.js.map +0 -1
- package/dist/core/compaction/utils.d.ts.map +0 -1
- package/dist/core/compaction/utils.js.map +0 -1
- package/dist/core/defaults.d.ts.map +0 -1
- package/dist/core/defaults.js.map +0 -1
- package/dist/core/diagnostics.d.ts.map +0 -1
- package/dist/core/diagnostics.js.map +0 -1
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/exec.d.ts.map +0 -1
- package/dist/core/exec.js.map +0 -1
- package/dist/core/experimental.d.ts.map +0 -1
- package/dist/core/experimental.js.map +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/dist/core/export-html/index.d.ts.map +0 -1
- package/dist/core/export-html/index.js.map +0 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/dist/core/export-html/tool-renderer.js.map +0 -1
- package/dist/core/extensions/index.d.ts.map +0 -1
- package/dist/core/extensions/index.js.map +0 -1
- package/dist/core/extensions/loader.d.ts.map +0 -1
- package/dist/core/extensions/loader.js.map +0 -1
- package/dist/core/extensions/runner.d.ts.map +0 -1
- package/dist/core/extensions/runner.js.map +0 -1
- package/dist/core/extensions/types.d.ts.map +0 -1
- package/dist/core/extensions/types.js.map +0 -1
- package/dist/core/extensions/wrapper.d.ts.map +0 -1
- package/dist/core/extensions/wrapper.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/core/git-command.d.ts.map +0 -1
- package/dist/core/git-command.js.map +0 -1
- package/dist/core/http-dispatcher.d.ts.map +0 -1
- package/dist/core/http-dispatcher.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/keybindings.d.ts.map +0 -1
- package/dist/core/keybindings.js.map +0 -1
- package/dist/core/llama/client.d.ts.map +0 -1
- package/dist/core/llama/client.js.map +0 -1
- package/dist/core/llama/huggingface.d.ts.map +0 -1
- package/dist/core/llama/huggingface.js.map +0 -1
- package/dist/core/llama/index.d.ts.map +0 -1
- package/dist/core/llama/index.js.map +0 -1
- package/dist/core/llama/provider.d.ts.map +0 -1
- package/dist/core/llama/provider.js.map +0 -1
- package/dist/core/llama/ui.d.ts.map +0 -1
- package/dist/core/llama/ui.js.map +0 -1
- package/dist/core/messages.d.ts.map +0 -1
- package/dist/core/messages.js.map +0 -1
- package/dist/core/model-config.d.ts.map +0 -1
- package/dist/core/model-config.js.map +0 -1
- package/dist/core/model-registry.d.ts.map +0 -1
- package/dist/core/model-registry.js.map +0 -1
- package/dist/core/model-resolver.d.ts.map +0 -1
- package/dist/core/model-resolver.js.map +0 -1
- package/dist/core/model-runtime.d.ts.map +0 -1
- package/dist/core/model-runtime.js.map +0 -1
- package/dist/core/models-store.d.ts.map +0 -1
- package/dist/core/models-store.js.map +0 -1
- package/dist/core/output-guard.d.ts.map +0 -1
- package/dist/core/output-guard.js.map +0 -1
- package/dist/core/package-manager.d.ts.map +0 -1
- package/dist/core/package-manager.js.map +0 -1
- package/dist/core/package-manager.test.d.ts.map +0 -1
- package/dist/core/package-manager.test.js.map +0 -1
- package/dist/core/project-trust.d.ts.map +0 -1
- package/dist/core/project-trust.js.map +0 -1
- package/dist/core/prompt-templates.d.ts.map +0 -1
- package/dist/core/prompt-templates.js.map +0 -1
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js.map +0 -1
- package/dist/core/provider-composer.d.ts.map +0 -1
- package/dist/core/provider-composer.js.map +0 -1
- package/dist/core/radius.d.ts.map +0 -1
- package/dist/core/radius.js.map +0 -1
- package/dist/core/remote-catalog-provider.d.ts.map +0 -1
- package/dist/core/remote-catalog-provider.js.map +0 -1
- package/dist/core/resolve-config-value.d.ts.map +0 -1
- package/dist/core/resolve-config-value.js.map +0 -1
- package/dist/core/resource-loader.d.ts.map +0 -1
- package/dist/core/resource-loader.js.map +0 -1
- package/dist/core/runtime-credentials.d.ts.map +0 -1
- package/dist/core/runtime-credentials.js.map +0 -1
- package/dist/core/sdk.d.ts.map +0 -1
- package/dist/core/sdk.js.map +0 -1
- package/dist/core/session-cwd.d.ts.map +0 -1
- package/dist/core/session-cwd.js.map +0 -1
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/settings-manager-auto-handoff.test.d.ts.map +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js.map +0 -1
- package/dist/core/settings-manager.d.ts.map +0 -1
- package/dist/core/settings-manager.js.map +0 -1
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/skills.js.map +0 -1
- package/dist/core/slash-commands.d.ts.map +0 -1
- package/dist/core/slash-commands.js.map +0 -1
- package/dist/core/source-info.d.ts.map +0 -1
- package/dist/core/source-info.js.map +0 -1
- package/dist/core/system-prompt.d.ts.map +0 -1
- package/dist/core/system-prompt.js.map +0 -1
- package/dist/core/system-prompt.test.d.ts.map +0 -1
- package/dist/core/system-prompt.test.js.map +0 -1
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js.map +0 -1
- package/dist/core/timings.d.ts.map +0 -1
- package/dist/core/timings.js.map +0 -1
- package/dist/core/tools/bash.d.ts.map +0 -1
- package/dist/core/tools/bash.js.map +0 -1
- package/dist/core/tools/edit-diff.d.ts.map +0 -1
- package/dist/core/tools/edit-diff.js.map +0 -1
- package/dist/core/tools/edit.d.ts.map +0 -1
- package/dist/core/tools/edit.js.map +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
- package/dist/core/tools/file-mutation-queue.js.map +0 -1
- package/dist/core/tools/find.d.ts.map +0 -1
- package/dist/core/tools/find.js.map +0 -1
- package/dist/core/tools/grep.d.ts.map +0 -1
- package/dist/core/tools/grep.js.map +0 -1
- package/dist/core/tools/index.d.ts.map +0 -1
- package/dist/core/tools/index.js.map +0 -1
- package/dist/core/tools/ls.d.ts.map +0 -1
- package/dist/core/tools/ls.js.map +0 -1
- package/dist/core/tools/output-accumulator.d.ts.map +0 -1
- package/dist/core/tools/output-accumulator.js.map +0 -1
- package/dist/core/tools/path-utils.d.ts.map +0 -1
- package/dist/core/tools/path-utils.js.map +0 -1
- package/dist/core/tools/read.d.ts.map +0 -1
- package/dist/core/tools/read.js.map +0 -1
- package/dist/core/tools/render-utils.d.ts.map +0 -1
- package/dist/core/tools/render-utils.js.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +0 -1
- package/dist/core/tools/truncate.d.ts.map +0 -1
- package/dist/core/tools/truncate.js.map +0 -1
- package/dist/core/tools/write.d.ts.map +0 -1
- package/dist/core/tools/write.js.map +0 -1
- package/dist/core/trust-manager.d.ts.map +0 -1
- package/dist/core/trust-manager.js.map +0 -1
- package/dist/core/usage-totals.d.ts.map +0 -1
- package/dist/core/usage-totals.js.map +0 -1
- package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/dist/extensions/pi-subagents/test/unit/slash-chain-groups.test.ts +0 -464
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/migrations.d.ts.map +0 -1
- package/dist/migrations.js.map +0 -1
- package/dist/modes/index.d.ts.map +0 -1
- package/dist/modes/index.js.map +0 -1
- package/dist/modes/interactive/components/armin.d.ts.map +0 -1
- package/dist/modes/interactive/components/armin.js.map +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-entry.js.map +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
- package/dist/modes/interactive/components/daxnuts.js.map +0 -1
- package/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/dist/modes/interactive/components/diff.js.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +0 -1
- package/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/dist/modes/interactive/components/footer.js.map +0 -1
- package/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/dist/modes/interactive/components/index.js.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +0 -1
- package/dist/modes/interactive/components/status-indicator.js.map +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/trust-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message.js.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/dist/modes/interactive/external-editor.d.ts.map +0 -1
- package/dist/modes/interactive/external-editor.js.map +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/dist/modes/interactive/model-search.d.ts.map +0 -1
- package/dist/modes/interactive/model-search.js.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme.js.map +0 -1
- package/dist/modes/print-mode.d.ts.map +0 -1
- package/dist/modes/print-mode.js.map +0 -1
- package/dist/modes/rpc/jsonl.d.ts.map +0 -1
- package/dist/modes/rpc/jsonl.js.map +0 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-client.js.map +0 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-types.js.map +0 -1
- package/dist/package-manager-cli.d.ts.map +0 -1
- package/dist/package-manager-cli.js.map +0 -1
- package/dist/rpc-entry.d.ts.map +0 -1
- package/dist/rpc-entry.js.map +0 -1
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/ansi.js.map +0 -1
- package/dist/utils/changelog.d.ts.map +0 -1
- package/dist/utils/changelog.js.map +0 -1
- package/dist/utils/child-process.d.ts.map +0 -1
- package/dist/utils/child-process.js.map +0 -1
- package/dist/utils/clipboard-image.d.ts.map +0 -1
- package/dist/utils/clipboard-image.js.map +0 -1
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js.map +0 -1
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/clipboard.js.map +0 -1
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js.map +0 -1
- package/dist/utils/exif-orientation.d.ts.map +0 -1
- package/dist/utils/exif-orientation.js.map +0 -1
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/fs-watch.d.ts.map +0 -1
- package/dist/utils/fs-watch.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/html.d.ts.map +0 -1
- package/dist/utils/html.js.map +0 -1
- package/dist/utils/image-convert.d.ts.map +0 -1
- package/dist/utils/image-convert.js.map +0 -1
- package/dist/utils/image-process.d.ts.map +0 -1
- package/dist/utils/image-process.js.map +0 -1
- package/dist/utils/image-resize-core.d.ts.map +0 -1
- package/dist/utils/image-resize-core.js.map +0 -1
- package/dist/utils/image-resize-worker.d.ts.map +0 -1
- package/dist/utils/image-resize-worker.js.map +0 -1
- package/dist/utils/image-resize.d.ts.map +0 -1
- package/dist/utils/image-resize.js.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json.js.map +0 -1
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js.map +0 -1
- package/dist/utils/open-browser.d.ts.map +0 -1
- package/dist/utils/open-browser.js.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/photon.d.ts.map +0 -1
- package/dist/utils/photon.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js.map +0 -1
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/sleep.js.map +0 -1
- package/dist/utils/syntax-highlight.d.ts.map +0 -1
- package/dist/utils/syntax-highlight.js.map +0 -1
- package/dist/utils/thinking-tags.d.ts.map +0 -1
- package/dist/utils/thinking-tags.js.map +0 -1
- package/dist/utils/tools-manager.d.ts.map +0 -1
- package/dist/utils/tools-manager.js.map +0 -1
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js.map +0 -1
- package/dist/utils/windows-self-update.d.ts.map +0 -1
- package/dist/utils/windows-self-update.js.map +0 -1
|
@@ -3,7 +3,8 @@ import * as fs from "node:fs";
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { keyText, type ExtensionAPI, type ExtensionContext } from "@selesai/code";
|
|
5
5
|
import { Key, matchesKey, type Component, type TUI } from "@earendil-works/pi-tui";
|
|
6
|
-
import { BUILTIN_AGENT_NAMES, discoverAgents
|
|
6
|
+
import { BUILTIN_AGENT_NAMES, discoverAgents } from "../agents/agents.ts";
|
|
7
|
+
import { registerInlineSubagentInvocation } from "./inline-subagents.ts";
|
|
7
8
|
import {
|
|
8
9
|
DEFAULT_PROVIDER_MODELS_MAX_AGE_DAYS,
|
|
9
10
|
applySubagentProfile,
|
|
@@ -14,14 +15,11 @@ import {
|
|
|
14
15
|
refreshProviderModelCatalog,
|
|
15
16
|
} from "../profiles/profiles.ts";
|
|
16
17
|
import type { SubagentParamsLike } from "../runs/foreground/subagent-executor.ts";
|
|
17
|
-
import { isDynamicParallelStep, isParallelStep, type ChainStep } from "../shared/settings.ts";
|
|
18
18
|
import { findModelInfo, toModelInfo } from "../shared/model-info.ts";
|
|
19
19
|
import { formatTokens, shortenPath } from "../shared/formatters.ts";
|
|
20
20
|
import { listAsyncRuns, formatAsyncRunProgressLabel, type AsyncRunSummary } from "../runs/background/async-status.ts";
|
|
21
|
-
import {
|
|
21
|
+
import { listScheduledRunSummaries } from "../runs/background/scheduled-runs.ts";
|
|
22
22
|
import { SUBAGENT_FANOUT_CHILD_ENV } from "../runs/shared/pi-args.ts";
|
|
23
|
-
import { assertJsonSchemaObject } from "../runs/shared/structured-output.ts";
|
|
24
|
-
import { validateAcceptanceInput } from "../runs/shared/acceptance.ts";
|
|
25
23
|
import type { SlashSubagentResponse, SlashSubagentUpdate } from "./slash-bridge.ts";
|
|
26
24
|
import { registerPromptWorkflowCommands } from "./prompt-workflows.ts";
|
|
27
25
|
import { openSubagentsAdmin } from "./subagents-admin.ts";
|
|
@@ -41,7 +39,7 @@ import {
|
|
|
41
39
|
SLASH_SUBAGENT_RESPONSE_EVENT,
|
|
42
40
|
SLASH_SUBAGENT_STARTED_EVENT,
|
|
43
41
|
SLASH_SUBAGENT_UPDATE_EVENT,
|
|
44
|
-
|
|
42
|
+
DIRS,
|
|
45
43
|
type Details,
|
|
46
44
|
type JsonSchemaObject,
|
|
47
45
|
type SingleResult,
|
|
@@ -55,14 +53,6 @@ interface InlineConfig {
|
|
|
55
53
|
reads?: string[] | false;
|
|
56
54
|
model?: string;
|
|
57
55
|
skill?: string[] | false;
|
|
58
|
-
progress?: boolean;
|
|
59
|
-
as?: string;
|
|
60
|
-
label?: string;
|
|
61
|
-
phase?: string;
|
|
62
|
-
cwd?: string;
|
|
63
|
-
count?: number;
|
|
64
|
-
outputSchema?: string;
|
|
65
|
-
acceptance?: string;
|
|
66
56
|
}
|
|
67
57
|
|
|
68
58
|
const parseInlineConfig = (raw: string): InlineConfig => {
|
|
@@ -71,10 +61,7 @@ const parseInlineConfig = (raw: string): InlineConfig => {
|
|
|
71
61
|
const trimmed = part.trim();
|
|
72
62
|
if (!trimmed) continue;
|
|
73
63
|
const eq = trimmed.indexOf("=");
|
|
74
|
-
if (eq === -1)
|
|
75
|
-
if (trimmed === "progress") config.progress = true;
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
64
|
+
if (eq === -1) continue;
|
|
78
65
|
const key = trimmed.slice(0, eq).trim();
|
|
79
66
|
const val = trimmed.slice(eq + 1).trim();
|
|
80
67
|
switch (key) {
|
|
@@ -83,14 +70,6 @@ const parseInlineConfig = (raw: string): InlineConfig => {
|
|
|
83
70
|
case "reads": config.reads = val === "false" ? false : val.split("+").filter(Boolean); break;
|
|
84
71
|
case "model": config.model = val || undefined; break;
|
|
85
72
|
case "skill": case "skills": config.skill = val === "false" ? false : val.split("+").filter(Boolean); break;
|
|
86
|
-
case "progress": config.progress = val !== "false"; break;
|
|
87
|
-
case "as": config.as = val || undefined; break;
|
|
88
|
-
case "label": config.label = val || undefined; break;
|
|
89
|
-
case "phase": config.phase = val || undefined; break;
|
|
90
|
-
case "cwd": config.cwd = val || undefined; break;
|
|
91
|
-
case "count": { const n = Number(val); if (Number.isInteger(n) && n > 0) config.count = n; break; }
|
|
92
|
-
case "outputSchema": config.outputSchema = val || undefined; break;
|
|
93
|
-
case "acceptance": config.acceptance = val || undefined; break;
|
|
94
73
|
}
|
|
95
74
|
}
|
|
96
75
|
return config;
|
|
@@ -125,69 +104,11 @@ const extractExecutionFlags = (rawArgs: string): { args: string; bg: boolean; fo
|
|
|
125
104
|
return { args, bg, fork };
|
|
126
105
|
};
|
|
127
106
|
|
|
128
|
-
const makeAgentCompletions = (state: SubagentState
|
|
129
|
-
if (!state.baseCwd) return null;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return agents.filter((a) => a.name.startsWith(prefix)).map((a) => ({ value: a.name, label: a.name }));
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Find the start of the current chain step: after the last top-level `->` arrow or `(`,
|
|
137
|
-
// or after a `|` *inside* a group. A `|` at depth 0 is plain task text (only `(` opens a
|
|
138
|
-
// group), so it must not restart agent completion — otherwise `scout -- do x | wr` would
|
|
139
|
-
// wrongly resume suggesting agents past the `--` task. Quotes are tracked so separators
|
|
140
|
-
// inside a task are ignored.
|
|
141
|
-
let inSingle = false, inDouble = false, depth = 0, segStart = 0;
|
|
142
|
-
for (let i = 0; i < prefix.length; i++) {
|
|
143
|
-
const ch = prefix[i]!;
|
|
144
|
-
if (inSingle) { if (ch === "'") inSingle = false; continue; }
|
|
145
|
-
if (inDouble) { if (ch === '"') inDouble = false; continue; }
|
|
146
|
-
if (ch === "'") { inSingle = true; continue; }
|
|
147
|
-
if (ch === '"') { inDouble = true; continue; }
|
|
148
|
-
if (ch === "(") {
|
|
149
|
-
if (!prefix.slice(segStart, i).includes(" -- ")) {
|
|
150
|
-
depth++;
|
|
151
|
-
segStart = i + 1;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
else if (ch === ")") {
|
|
155
|
-
if (depth > 0) {
|
|
156
|
-
depth--;
|
|
157
|
-
segStart = i + 1;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
else if (ch === "|" && depth > 0) segStart = i + 1;
|
|
161
|
-
else if (ch === ">" && prefix[i - 1] === "-" && depth === 0) segStart = i + 1;
|
|
162
|
-
}
|
|
163
|
-
// Inside an open quote, or once the task has started (`--` / a quote), we are no
|
|
164
|
-
// longer typing an agent name.
|
|
165
|
-
if (inSingle || inDouble) return null;
|
|
166
|
-
const segment = prefix.slice(segStart);
|
|
167
|
-
if (segment.includes(" -- ") || segment.includes('"') || segment.includes("'")) return null;
|
|
168
|
-
|
|
169
|
-
const lastWord = (segment.match(/(\S*)$/) || ["", ""])[1];
|
|
170
|
-
let beforeLastWord = prefix.slice(0, prefix.length - lastWord.length);
|
|
171
|
-
// A bare `->` or `|` just typed (no trailing space) needs a separating space;
|
|
172
|
-
// `(` glues naturally to the agent name.
|
|
173
|
-
if (lastWord === "" && /[>|]$/.test(beforeLastWord)) beforeLastWord = `${beforeLastWord} `;
|
|
174
|
-
|
|
175
|
-
return agents.filter((a) => a.name.startsWith(lastWord)).map((a) => ({ value: `${beforeLastWord}${a.name}`, label: a.name }));
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
const discoverSavedChains = (cwd: string): ChainConfig[] => {
|
|
179
|
-
const chainsByName = new Map<string, ChainConfig>();
|
|
180
|
-
for (const chain of discoverAgentsAll(cwd).chains) {
|
|
181
|
-
chainsByName.set(chain.name, chain);
|
|
182
|
-
}
|
|
183
|
-
return Array.from(chainsByName.values());
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const makeChainCompletions = (state: SubagentState) => (prefix: string) => {
|
|
187
|
-
if (prefix.includes(" ") || !state.baseCwd) return null;
|
|
188
|
-
return discoverSavedChains(state.baseCwd)
|
|
189
|
-
.filter((chain) => chain.name.startsWith(prefix))
|
|
190
|
-
.map((chain) => ({ value: chain.name, label: chain.name }));
|
|
107
|
+
const makeAgentCompletions = (state: SubagentState) => (prefix: string) => {
|
|
108
|
+
if (!state.baseCwd || prefix.includes(" ")) return null;
|
|
109
|
+
return discoverAgents(state.baseCwd, "both").agents
|
|
110
|
+
.filter((agent) => agent.name.startsWith(prefix))
|
|
111
|
+
.map((agent) => ({ value: agent.name, label: agent.name }));
|
|
191
112
|
};
|
|
192
113
|
|
|
193
114
|
const makeBuiltinAgentNameCompletions = () => (prefix: string) => {
|
|
@@ -241,7 +162,7 @@ type StopSelectorResult = { confirmed: boolean; target?: StopSelectorTarget };
|
|
|
241
162
|
|
|
242
163
|
function commandForTarget(target: StopSelectorTarget): string {
|
|
243
164
|
return target.kind === "scheduled"
|
|
244
|
-
? `subagent({ action: "schedule
|
|
165
|
+
? `subagent({ action: "schedule.pause", id: ${JSON.stringify(target.id)} })`
|
|
245
166
|
: `subagent({ action: "stop", id: ${JSON.stringify(target.id)} })`;
|
|
246
167
|
}
|
|
247
168
|
|
|
@@ -257,35 +178,26 @@ function formatAsyncStopTarget(run: AsyncRunSummary): StopSelectorTarget {
|
|
|
257
178
|
};
|
|
258
179
|
}
|
|
259
180
|
|
|
260
|
-
function scheduledStopTargets(ctx: ExtensionContext,
|
|
261
|
-
const sessionId = state.currentSessionId ?? ctx.sessionManager.getSessionId();
|
|
262
|
-
if (!sessionId) return [];
|
|
263
|
-
const storePath = scheduledRunStorePath(ctx.cwd, sessionId);
|
|
264
|
-
if (!fs.existsSync(storePath)) return [];
|
|
265
|
-
let parsed: unknown;
|
|
181
|
+
function scheduledStopTargets(ctx: ExtensionContext, _state: SubagentState): StopSelectorTarget[] {
|
|
266
182
|
try {
|
|
267
|
-
|
|
183
|
+
return listScheduledRunSummaries(ctx.cwd)
|
|
184
|
+
.filter((schedule) => !schedule.paused && !schedule.activeRunId && schedule.trigger.nextRunAt)
|
|
185
|
+
.sort((left, right) => left.trigger.nextRunAt!.localeCompare(right.trigger.nextRunAt!))
|
|
186
|
+
.map((schedule) => ({
|
|
187
|
+
kind: "scheduled" as const,
|
|
188
|
+
id: schedule.id,
|
|
189
|
+
label: `${schedule.id} · ${schedule.name}`,
|
|
190
|
+
detail: `scheduled · ${schedule.trigger.nextRunAt}`,
|
|
191
|
+
actionLabel: "pause schedule",
|
|
192
|
+
}));
|
|
268
193
|
} catch {
|
|
269
194
|
return [];
|
|
270
195
|
}
|
|
271
|
-
const jobs = parsed && typeof parsed === "object" && Array.isArray((parsed as { jobs?: unknown }).jobs)
|
|
272
|
-
? (parsed as { jobs: Array<Record<string, unknown>> }).jobs
|
|
273
|
-
: [];
|
|
274
|
-
return jobs
|
|
275
|
-
.filter((job) => job.state === "scheduled" && typeof job.id === "string" && typeof job.name === "string" && typeof job.runAt === "number")
|
|
276
|
-
.sort((left, right) => Number(left.runAt) - Number(right.runAt))
|
|
277
|
-
.map((job) => ({
|
|
278
|
-
kind: "scheduled" as const,
|
|
279
|
-
id: String(job.id),
|
|
280
|
-
label: `${String(job.id)} · ${String(job.name)}`,
|
|
281
|
-
detail: `scheduled · ${new Date(Number(job.runAt)).toISOString()}`,
|
|
282
|
-
actionLabel: "cancel scheduled run",
|
|
283
|
-
}));
|
|
284
196
|
}
|
|
285
197
|
|
|
286
198
|
function discoverStopTargets(ctx: ExtensionContext, state: SubagentState): StopSelectorTarget[] {
|
|
287
199
|
const sessionId = state.currentSessionId ?? ctx.sessionManager.getSessionId() ?? undefined;
|
|
288
|
-
const asyncTargets = listAsyncRuns(
|
|
200
|
+
const asyncTargets = listAsyncRuns(DIRS.async, {
|
|
289
201
|
states: ["queued", "running"],
|
|
290
202
|
...(sessionId ? { sessionId } : {}),
|
|
291
203
|
}).map(formatAsyncStopTarget);
|
|
@@ -367,6 +279,8 @@ class SubagentsStopSelector implements Component {
|
|
|
367
279
|
}
|
|
368
280
|
}
|
|
369
281
|
|
|
282
|
+
invalidate(): void {}
|
|
283
|
+
|
|
370
284
|
render(width: number): string[] {
|
|
371
285
|
const contentWidth = Math.max(40, Math.min(this.width, width || this.width));
|
|
372
286
|
const lines = [this.theme.bold("Stop subagent run"), this.theme.fg("dim", "Select a current-session async run to stop, or a scheduled run to cancel."), ""];
|
|
@@ -509,63 +423,11 @@ function parseSingleRequiredArg(args: string, usage: string): { ok: true; value:
|
|
|
509
423
|
return { ok: true, value: parts[0]! };
|
|
510
424
|
}
|
|
511
425
|
|
|
512
|
-
function
|
|
426
|
+
function getProfileWorkerModel(profile: { subagents?: { agentOverrides?: Record<string, { model?: string }> } }): string | undefined {
|
|
513
427
|
const model = profile.subagents?.agentOverrides?.builder?.model;
|
|
514
428
|
return typeof model === "string" && model.trim() ? model.trim() : undefined;
|
|
515
429
|
}
|
|
516
430
|
|
|
517
|
-
function loadSavedOutputSchema(chain: ChainConfig, stepAgent: string, outputSchema: unknown): JsonSchemaObject | undefined {
|
|
518
|
-
if (outputSchema === undefined) return undefined;
|
|
519
|
-
if (typeof outputSchema === "string") {
|
|
520
|
-
const schemaPath = path.isAbsolute(outputSchema)
|
|
521
|
-
? outputSchema
|
|
522
|
-
: path.join(path.dirname(chain.filePath), outputSchema);
|
|
523
|
-
const parsed = JSON.parse(fs.readFileSync(schemaPath, "utf-8")) as unknown;
|
|
524
|
-
assertJsonSchemaObject(parsed, `outputSchema for chain '${chain.name}' step '${stepAgent}' (${schemaPath})`);
|
|
525
|
-
return parsed;
|
|
526
|
-
}
|
|
527
|
-
assertJsonSchemaObject(outputSchema, `outputSchema for chain '${chain.name}' step '${stepAgent}'`);
|
|
528
|
-
return outputSchema;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
const mapSavedChainSteps = (chain: ChainConfig, worktree = false): ChainStep[] => {
|
|
532
|
-
return (chain.steps as unknown as Array<ChainStep & { skills?: string[] | false }>).map((step) => {
|
|
533
|
-
if (isParallelStep(step)) {
|
|
534
|
-
const parallel = step.parallel.map((task) => {
|
|
535
|
-
const { outputSchema: rawOutputSchema, ...rest } = task as typeof task & { outputSchema?: unknown };
|
|
536
|
-
const outputSchema = loadSavedOutputSchema(chain, task.agent, rawOutputSchema);
|
|
537
|
-
return { ...rest, ...(outputSchema ? { outputSchema } : {}) };
|
|
538
|
-
});
|
|
539
|
-
return { ...step, parallel, ...(worktree ? { worktree: true } : {}) };
|
|
540
|
-
}
|
|
541
|
-
if (isDynamicParallelStep(step)) {
|
|
542
|
-
const { outputSchema: rawOutputSchema, ...parallelRest } = step.parallel as typeof step.parallel & { outputSchema?: unknown };
|
|
543
|
-
const outputSchema = loadSavedOutputSchema(chain, step.parallel.agent, rawOutputSchema);
|
|
544
|
-
const collectSchema = loadSavedOutputSchema(chain, `${step.collect.as} collection`, step.collect.outputSchema);
|
|
545
|
-
return {
|
|
546
|
-
...step,
|
|
547
|
-
parallel: { ...parallelRest, ...(outputSchema ? { outputSchema } : {}) },
|
|
548
|
-
collect: { ...step.collect, ...(collectSchema ? { outputSchema: collectSchema } : {}) },
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
const outputSchema = loadSavedOutputSchema(chain, step.agent, (step as { outputSchema?: unknown }).outputSchema);
|
|
552
|
-
return {
|
|
553
|
-
agent: step.agent,
|
|
554
|
-
task: step.task || undefined,
|
|
555
|
-
...(step.phase ? { phase: step.phase } : {}),
|
|
556
|
-
...(step.label ? { label: step.label } : {}),
|
|
557
|
-
...(step.as ? { as: step.as } : {}),
|
|
558
|
-
...(outputSchema ? { outputSchema } : {}),
|
|
559
|
-
...((step as { acceptance?: unknown }).acceptance !== undefined ? { acceptance: (step as { acceptance?: unknown }).acceptance } : {}),
|
|
560
|
-
output: step.output,
|
|
561
|
-
outputMode: step.outputMode,
|
|
562
|
-
reads: step.reads,
|
|
563
|
-
progress: step.progress,
|
|
564
|
-
skill: step.skill ?? step.skills,
|
|
565
|
-
model: step.model,
|
|
566
|
-
};
|
|
567
|
-
});
|
|
568
|
-
};
|
|
569
431
|
|
|
570
432
|
async function requestSlashRun(
|
|
571
433
|
pi: ExtensionAPI,
|
|
@@ -752,7 +614,7 @@ async function runSlashSubagent(
|
|
|
752
614
|
}
|
|
753
615
|
}
|
|
754
616
|
|
|
755
|
-
function launchSlashSubagent(
|
|
617
|
+
export function launchSlashSubagent(
|
|
756
618
|
pi: ExtensionAPI,
|
|
757
619
|
ctx: ExtensionContext,
|
|
758
620
|
params: SubagentParamsLike,
|
|
@@ -760,405 +622,13 @@ function launchSlashSubagent(
|
|
|
760
622
|
void runSlashSubagent(pi, ctx, params);
|
|
761
623
|
}
|
|
762
624
|
|
|
763
|
-
export interface GroupConfig { concurrency?: number; failFast?: boolean; worktree?: boolean }
|
|
764
|
-
export interface ParsedStep { kind: "step"; name: string; config: InlineConfig; task?: string }
|
|
765
|
-
export interface ParsedGroup { kind: "group"; tasks: ParsedStep[]; config: GroupConfig }
|
|
766
|
-
export type ParsedGroupStep = ParsedStep | ParsedGroup;
|
|
767
|
-
|
|
768
|
-
export const PARALLEL_GROUP_USAGE =
|
|
769
|
-
'Usage: /chain agent "task" -> (agent2 "task" | agent3 "task") -> agent4';
|
|
770
|
-
|
|
771
|
-
export class SlashParseError extends Error {}
|
|
772
|
-
|
|
773
|
-
// Walk `input` tracking quote/paren state; returns true if parens are unbalanced.
|
|
774
|
-
function findUnmatchedCloseParen(input: string): boolean {
|
|
775
|
-
let depth = 0, inSingle = false, inDouble = false;
|
|
776
|
-
for (let i = 0; i < input.length; i++) {
|
|
777
|
-
const ch = input[i]!;
|
|
778
|
-
if (inSingle) { if (ch === "'") inSingle = false; continue; }
|
|
779
|
-
if (inDouble) { if (ch === '"') inDouble = false; continue; }
|
|
780
|
-
if (ch === "'") { inSingle = true; continue; }
|
|
781
|
-
if (ch === '"') { inDouble = true; continue; }
|
|
782
|
-
if (ch === "(") depth++;
|
|
783
|
-
else if (ch === ")") { depth--; if (depth < 0) return true; }
|
|
784
|
-
}
|
|
785
|
-
return depth !== 0;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
// Split on top-level " -> ", ignoring arrows inside quotes or parentheses.
|
|
789
|
-
function splitOnArrow(input: string): string[] {
|
|
790
|
-
const segments: string[] = [];
|
|
791
|
-
let depth = 0, inSingle = false, inDouble = false, start = 0;
|
|
792
|
-
for (let i = 0; i < input.length; i++) {
|
|
793
|
-
const ch = input[i]!;
|
|
794
|
-
if (inSingle) { if (ch === "'") inSingle = false; continue; }
|
|
795
|
-
if (inDouble) { if (ch === '"') inDouble = false; continue; }
|
|
796
|
-
if (ch === "'") { inSingle = true; continue; }
|
|
797
|
-
if (ch === '"') { inDouble = true; continue; }
|
|
798
|
-
if (ch === "(") depth++;
|
|
799
|
-
else if (ch === ")") depth--;
|
|
800
|
-
else if (depth === 0 && ch === "-" && input[i + 1] === ">" && input[i + 2] === " ") {
|
|
801
|
-
segments.push(input.slice(start, i));
|
|
802
|
-
i += 2;
|
|
803
|
-
start = i + 1;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
segments.push(input.slice(start));
|
|
807
|
-
return segments;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
// Split a group's inner text on top-level " | ", ignoring pipes inside quotes/parens.
|
|
811
|
-
function splitGroupTasks(inner: string): string[] {
|
|
812
|
-
const parts: string[] = [];
|
|
813
|
-
let depth = 0, inSingle = false, inDouble = false, start = 0;
|
|
814
|
-
for (let i = 0; i < inner.length; i++) {
|
|
815
|
-
const ch = inner[i]!;
|
|
816
|
-
if (inSingle) { if (ch === "'") inSingle = false; continue; }
|
|
817
|
-
if (inDouble) { if (ch === '"') inDouble = false; continue; }
|
|
818
|
-
if (ch === "'") { inSingle = true; continue; }
|
|
819
|
-
if (ch === '"') { inDouble = true; continue; }
|
|
820
|
-
if (ch === "(") depth++;
|
|
821
|
-
else if (ch === ")") depth--;
|
|
822
|
-
else if (ch === "|" && depth === 0) {
|
|
823
|
-
parts.push(inner.slice(start, i));
|
|
824
|
-
start = i + 1;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
parts.push(inner.slice(start));
|
|
828
|
-
return parts;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
export function parseSingleTaskToken(token: string): ParsedStep {
|
|
832
|
-
let agentPart: string;
|
|
833
|
-
let task: string | undefined;
|
|
834
|
-
const qMatch = token.match(/^(\S+(?:\[[^\]]*\])?)\s+(?:"([^"]*)"|'([^']*)')$/);
|
|
835
|
-
if (qMatch) {
|
|
836
|
-
agentPart = qMatch[1]!;
|
|
837
|
-
task = (qMatch[2] ?? qMatch[3]) || undefined;
|
|
838
|
-
} else {
|
|
839
|
-
const dashIdx = token.indexOf(" -- ");
|
|
840
|
-
if (dashIdx !== -1) {
|
|
841
|
-
agentPart = token.slice(0, dashIdx).trim();
|
|
842
|
-
task = token.slice(dashIdx + 4).trim() || undefined;
|
|
843
|
-
} else {
|
|
844
|
-
agentPart = token;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
return { kind: "step", ...parseAgentToken(agentPart), task };
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
const parseGroupConfig = (raw: string): GroupConfig => {
|
|
851
|
-
const config: GroupConfig = {};
|
|
852
|
-
for (const part of raw.split(",")) {
|
|
853
|
-
const trimmed = part.trim();
|
|
854
|
-
if (!trimmed) continue;
|
|
855
|
-
const eq = trimmed.indexOf("=");
|
|
856
|
-
const key = eq === -1 ? trimmed : trimmed.slice(0, eq).trim();
|
|
857
|
-
const val = eq === -1 ? "" : trimmed.slice(eq + 1).trim();
|
|
858
|
-
switch (key) {
|
|
859
|
-
case "concurrency": { const n = Number(val); if (Number.isInteger(n) && n > 0) config.concurrency = n; break; }
|
|
860
|
-
case "failFast": config.failFast = eq === -1 ? true : val !== "false"; break;
|
|
861
|
-
case "worktree": config.worktree = eq === -1 ? true : val !== "false"; break;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
return config;
|
|
865
|
-
};
|
|
866
|
-
|
|
867
|
-
// Split `(...)` from an optional trailing `[...]` group-config suffix, respecting
|
|
868
|
-
// quotes and nested parens. Returns the inner group text and the parsed config.
|
|
869
|
-
const splitGroupBody = (trimmed: string): { inner: string; config: GroupConfig } => {
|
|
870
|
-
let depth = 0, inSingle = false, inDouble = false, closeIdx = -1;
|
|
871
|
-
for (let i = 0; i < trimmed.length; i++) {
|
|
872
|
-
const ch = trimmed[i]!;
|
|
873
|
-
if (inSingle) { if (ch === "'") inSingle = false; continue; }
|
|
874
|
-
if (inDouble) { if (ch === '"') inDouble = false; continue; }
|
|
875
|
-
if (ch === "'") { inSingle = true; continue; }
|
|
876
|
-
if (ch === '"') { inDouble = true; continue; }
|
|
877
|
-
if (ch === "(") depth++;
|
|
878
|
-
else if (ch === ")") { depth--; if (depth === 0) { closeIdx = i; break; } }
|
|
879
|
-
}
|
|
880
|
-
if (closeIdx === -1) throw new SlashParseError(`Unmatched parentheses in group: '${trimmed}'`);
|
|
881
|
-
const inner = trimmed.slice(1, closeIdx);
|
|
882
|
-
const suffix = trimmed.slice(closeIdx + 1).trim();
|
|
883
|
-
if (!suffix) return { inner, config: {} };
|
|
884
|
-
if (!suffix.startsWith("[") || !suffix.endsWith("]")) {
|
|
885
|
-
throw new SlashParseError(`Group options must be wrapped in [...]: '${suffix}'`);
|
|
886
|
-
}
|
|
887
|
-
return { inner, config: parseGroupConfig(suffix.slice(1, -1)) };
|
|
888
|
-
};
|
|
889
|
-
|
|
890
|
-
export function parseGroupSegment(segment: string): ParsedGroup {
|
|
891
|
-
const trimmed = segment.trim();
|
|
892
|
-
if (!trimmed.startsWith("(")) {
|
|
893
|
-
throw new SlashParseError(`Parallel group must be wrapped in parentheses: '${trimmed}'`);
|
|
894
|
-
}
|
|
895
|
-
const { inner, config } = splitGroupBody(trimmed);
|
|
896
|
-
const rawParts = splitGroupTasks(inner).map((p) => p.trim()).filter((p) => p.length > 0);
|
|
897
|
-
if (rawParts.length < 2) {
|
|
898
|
-
throw new SlashParseError("Parallel group must contain at least two tasks separated by ' | '");
|
|
899
|
-
}
|
|
900
|
-
return { kind: "group", tasks: rawParts.map((part) => parseSingleTaskToken(part)), config };
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
// True if `input` uses inline parallel-group syntax. A group is a *step* that begins
|
|
904
|
-
// with `(` at the top level, so we split on top-level ` -> ` arrows and look for a
|
|
905
|
-
// segment that opens with `(`. Parentheses appearing inside a task (e.g.
|
|
906
|
-
// `scout -- inspect auth (backend)`) do not count, which keeps legacy shared-task
|
|
907
|
-
// `-- task` parsing — including a bare `|` inside the task — on the single-agent path.
|
|
908
|
-
export function hasGroupSyntax(input: string): boolean {
|
|
909
|
-
return splitOnArrow(input).some((seg) => seg.trim().startsWith("("));
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
export function parseChainExpression(input: string): { steps: ParsedGroupStep[] } {
|
|
913
|
-
const trimmed = input.trim();
|
|
914
|
-
if (!trimmed.includes(" -> ")) {
|
|
915
|
-
throw new SlashParseError('Parallel groups in /chain require " -> " between steps');
|
|
916
|
-
}
|
|
917
|
-
if (findUnmatchedCloseParen(trimmed)) {
|
|
918
|
-
throw new SlashParseError("Unmatched parentheses in /chain expression");
|
|
919
|
-
}
|
|
920
|
-
const steps: ParsedGroupStep[] = [];
|
|
921
|
-
for (const seg of splitOnArrow(trimmed)) {
|
|
922
|
-
const t = seg.trim();
|
|
923
|
-
if (!t) continue;
|
|
924
|
-
if (t.startsWith("(")) {
|
|
925
|
-
steps.push(parseGroupSegment(t));
|
|
926
|
-
continue;
|
|
927
|
-
}
|
|
928
|
-
if (findUnmatchedCloseParen(t)) {
|
|
929
|
-
throw new SlashParseError(`Unmatched parentheses in chain segment: '${t}'`);
|
|
930
|
-
}
|
|
931
|
-
steps.push(parseSingleTaskToken(t));
|
|
932
|
-
}
|
|
933
|
-
if (steps.length === 0) {
|
|
934
|
-
throw new SlashParseError("/chain expression must include at least one step");
|
|
935
|
-
}
|
|
936
|
-
return { steps };
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
const parseAgentArgs = (
|
|
940
|
-
state: SubagentState,
|
|
941
|
-
args: string,
|
|
942
|
-
command: string,
|
|
943
|
-
ctx: ExtensionContext,
|
|
944
|
-
): { steps: ParsedStep[]; task: string } | null => {
|
|
945
|
-
const input = args.trim();
|
|
946
|
-
const usage = `Usage: /${command} agent1 "task1" -> agent2 "task2"`;
|
|
947
|
-
let steps: ParsedStep[];
|
|
948
|
-
let sharedTask: string;
|
|
949
|
-
let perStep = false;
|
|
950
|
-
|
|
951
|
-
if (input.includes(" -> ")) {
|
|
952
|
-
perStep = true;
|
|
953
|
-
const segments = input.split(" -> ");
|
|
954
|
-
steps = [];
|
|
955
|
-
for (const seg of segments) {
|
|
956
|
-
const trimmed = seg.trim();
|
|
957
|
-
if (!trimmed) continue;
|
|
958
|
-
steps.push(parseSingleTaskToken(trimmed));
|
|
959
|
-
}
|
|
960
|
-
sharedTask = steps.find((s) => s.task)?.task ?? "";
|
|
961
|
-
} else {
|
|
962
|
-
const delimiterIndex = input.indexOf(" -- ");
|
|
963
|
-
if (delimiterIndex === -1) {
|
|
964
|
-
ctx.ui.notify(usage, "error");
|
|
965
|
-
return null;
|
|
966
|
-
}
|
|
967
|
-
const agentsPart = input.slice(0, delimiterIndex).trim();
|
|
968
|
-
sharedTask = input.slice(delimiterIndex + 4).trim();
|
|
969
|
-
if (!agentsPart || !sharedTask) {
|
|
970
|
-
ctx.ui.notify(usage, "error");
|
|
971
|
-
return null;
|
|
972
|
-
}
|
|
973
|
-
steps = agentsPart.split(/\s+/).filter(Boolean).map((t) => parseSingleTaskToken(t));
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
if (steps.length === 0) {
|
|
977
|
-
ctx.ui.notify(usage, "error");
|
|
978
|
-
return null;
|
|
979
|
-
}
|
|
980
|
-
if (!state.baseCwd) {
|
|
981
|
-
ctx.ui.notify("Subagent session cwd is not initialized yet", "error");
|
|
982
|
-
return null;
|
|
983
|
-
}
|
|
984
|
-
const agents = discoverAgents(state.baseCwd, "both").agents;
|
|
985
|
-
for (const step of steps) {
|
|
986
|
-
if (!agents.find((a) => a.name === step.name)) {
|
|
987
|
-
ctx.ui.notify(`Unknown agent: ${step.name}`, "error");
|
|
988
|
-
return null;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
if (command === "chain" && !steps[0]?.task && (perStep || !sharedTask)) {
|
|
992
|
-
ctx.ui.notify(`First step must have a task: /chain agent "task" -> agent2`, "error");
|
|
993
|
-
return null;
|
|
994
|
-
}
|
|
995
|
-
if (command === "parallel" && !steps.some((s) => s.task) && !sharedTask) {
|
|
996
|
-
ctx.ui.notify("At least one step must have a task", "error");
|
|
997
|
-
return null;
|
|
998
|
-
}
|
|
999
|
-
return { steps, task: sharedTask };
|
|
1000
|
-
};
|
|
1001
|
-
|
|
1002
|
-
type ChainStepObject = {
|
|
1003
|
-
agent: string;
|
|
1004
|
-
task?: string;
|
|
1005
|
-
output?: string | false;
|
|
1006
|
-
outputMode?: "inline" | "file-only";
|
|
1007
|
-
reads?: string[] | false;
|
|
1008
|
-
model?: string;
|
|
1009
|
-
skill?: string[] | false;
|
|
1010
|
-
progress?: boolean;
|
|
1011
|
-
as?: string;
|
|
1012
|
-
label?: string;
|
|
1013
|
-
phase?: string;
|
|
1014
|
-
cwd?: string;
|
|
1015
|
-
count?: number;
|
|
1016
|
-
outputSchema?: JsonSchemaObject;
|
|
1017
|
-
acceptance?: string;
|
|
1018
|
-
};
|
|
1019
|
-
|
|
1020
|
-
const INLINE_ACCEPTANCE_LEVELS = new Set(["auto", "attested", "checked"]);
|
|
1021
|
-
|
|
1022
|
-
function validateInlineAcceptanceInput(value: string, agent: string): void {
|
|
1023
|
-
const errors = validateAcceptanceInput(value, `acceptance for step '${agent}'`);
|
|
1024
|
-
if (errors.length > 0) throw new SlashParseError(errors[0]!);
|
|
1025
|
-
if (!INLINE_ACCEPTANCE_LEVELS.has(value)) {
|
|
1026
|
-
throw new SlashParseError(`Inline acceptance for step '${agent}' supports auto, attested, or checked. Use the subagent tool API or a saved .chain.json file for none, verified, or review requirements; reviewed is an achieved status, not an input level.`);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
// Load an inline `outputSchema=<path>` JSON file, resolved against the session cwd.
|
|
1031
|
-
// Throws (SlashParseError / fs / JSON) on a missing or malformed schema.
|
|
1032
|
-
function loadInlineOutputSchema(baseCwd: string, agent: string, value: string): JsonSchemaObject {
|
|
1033
|
-
const schemaPath = path.isAbsolute(value) ? value : path.join(baseCwd, value);
|
|
1034
|
-
const label = `outputSchema for step '${agent}' (${schemaPath})`;
|
|
1035
|
-
let parsed: unknown;
|
|
1036
|
-
try {
|
|
1037
|
-
parsed = JSON.parse(fs.readFileSync(schemaPath, "utf-8"));
|
|
1038
|
-
} catch (error) {
|
|
1039
|
-
throw new SlashParseError(`Cannot read ${label}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1040
|
-
}
|
|
1041
|
-
assertJsonSchemaObject(parsed, label);
|
|
1042
|
-
return parsed;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
// Build a ChainStep object from a parsed token. `inGroup` enables `count` (parallel-only).
|
|
1046
|
-
// May throw SlashParseError for an invalid acceptance level or outputSchema path.
|
|
1047
|
-
const mapParsedTaskToStepObject = (
|
|
1048
|
-
step: ParsedStep,
|
|
1049
|
-
fallbackTask: string | undefined,
|
|
1050
|
-
isFirst: boolean,
|
|
1051
|
-
opts: { baseCwd: string; inGroup: boolean },
|
|
1052
|
-
): ChainStepObject => {
|
|
1053
|
-
const { name, config, task: stepTask } = step;
|
|
1054
|
-
if (config.acceptance !== undefined) validateInlineAcceptanceInput(config.acceptance, name);
|
|
1055
|
-
return {
|
|
1056
|
-
agent: name,
|
|
1057
|
-
...(stepTask ? { task: stepTask } : isFirst && fallbackTask ? { task: fallbackTask } : {}),
|
|
1058
|
-
...(config.output !== undefined ? { output: config.output } : {}),
|
|
1059
|
-
...(config.outputMode !== undefined ? { outputMode: config.outputMode } : {}),
|
|
1060
|
-
...(config.reads !== undefined ? { reads: config.reads } : {}),
|
|
1061
|
-
...(config.model ? { model: config.model } : {}),
|
|
1062
|
-
...(config.skill !== undefined ? { skill: config.skill } : {}),
|
|
1063
|
-
...(config.progress !== undefined ? { progress: config.progress } : {}),
|
|
1064
|
-
...(config.as ? { as: config.as } : {}),
|
|
1065
|
-
...(config.label ? { label: config.label } : {}),
|
|
1066
|
-
...(config.phase ? { phase: config.phase } : {}),
|
|
1067
|
-
...(config.cwd ? { cwd: config.cwd } : {}),
|
|
1068
|
-
...(opts.inGroup && config.count !== undefined ? { count: config.count } : {}),
|
|
1069
|
-
...(config.outputSchema ? { outputSchema: loadInlineOutputSchema(opts.baseCwd, name, config.outputSchema) } : {}),
|
|
1070
|
-
...(config.acceptance ? { acceptance: config.acceptance } : {}),
|
|
1071
|
-
};
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
|
-
export function buildChainExpressionSteps(
|
|
1075
|
-
state: SubagentState,
|
|
1076
|
-
input: string,
|
|
1077
|
-
ctx: ExtensionContext,
|
|
1078
|
-
): { chain: ChainStep[]; task: string } | null {
|
|
1079
|
-
const notify = (message: string) => ctx.ui.notify(message, "error");
|
|
1080
|
-
if (!hasGroupSyntax(input)) {
|
|
1081
|
-
const parsed = parseAgentArgs(state, input, "chain", ctx);
|
|
1082
|
-
if (!parsed) return null;
|
|
1083
|
-
const baseCwd = state.baseCwd!; // parseAgentArgs already verified baseCwd is set
|
|
1084
|
-
try {
|
|
1085
|
-
const chain: ChainStep[] = parsed.steps.map((step, i) =>
|
|
1086
|
-
mapParsedTaskToStepObject(step, parsed.task || undefined, i === 0, { baseCwd, inGroup: false }),
|
|
1087
|
-
);
|
|
1088
|
-
return { chain, task: parsed.task };
|
|
1089
|
-
} catch (error) {
|
|
1090
|
-
notify(error instanceof Error ? error.message : String(error));
|
|
1091
|
-
return null;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
let expression: { steps: ParsedGroupStep[] };
|
|
1096
|
-
try {
|
|
1097
|
-
expression = parseChainExpression(input);
|
|
1098
|
-
} catch (error) {
|
|
1099
|
-
notify(error instanceof Error ? error.message : String(error));
|
|
1100
|
-
return null;
|
|
1101
|
-
}
|
|
1102
|
-
if (!state.baseCwd) {
|
|
1103
|
-
notify("Subagent session cwd is not initialized yet");
|
|
1104
|
-
return null;
|
|
1105
|
-
}
|
|
1106
|
-
const agents = discoverAgents(state.baseCwd, "both").agents;
|
|
1107
|
-
const stepAgentNames = expression.steps.flatMap((step) =>
|
|
1108
|
-
step.kind === "group" ? step.tasks.map((t) => t.name) : [step.name],
|
|
1109
|
-
);
|
|
1110
|
-
for (const name of stepAgentNames) {
|
|
1111
|
-
if (!agents.find((a) => a.name === name)) {
|
|
1112
|
-
notify(`Unknown agent: ${name}`);
|
|
1113
|
-
return null;
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
// Every task inside a parallel group needs its own task; there is no shared-task fallback.
|
|
1117
|
-
for (const step of expression.steps) {
|
|
1118
|
-
if (step.kind === "group" && step.tasks.some((t) => !t.task)) {
|
|
1119
|
-
notify('Each task in a parallel group needs a task: (agent "a" | agent "b")');
|
|
1120
|
-
return null;
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
const firstStep = expression.steps[0]!;
|
|
1124
|
-
const firstHasTask =
|
|
1125
|
-
firstStep.kind === "group"
|
|
1126
|
-
? firstStep.tasks.some((t) => Boolean(t.task))
|
|
1127
|
-
: Boolean(firstStep.task);
|
|
1128
|
-
if (!firstHasTask) {
|
|
1129
|
-
notify('First step must have a task: /chain agent "task" -> agent2');
|
|
1130
|
-
return null;
|
|
1131
|
-
}
|
|
1132
|
-
const sharedTask =
|
|
1133
|
-
firstStep.kind === "group"
|
|
1134
|
-
? (firstStep.tasks.find((t) => t.task)?.task ?? "")
|
|
1135
|
-
: (firstStep.task ?? "");
|
|
1136
|
-
const baseCwd = state.baseCwd;
|
|
1137
|
-
let chain: ChainStep[];
|
|
1138
|
-
try {
|
|
1139
|
-
chain = expression.steps.map((step) => {
|
|
1140
|
-
if (step.kind === "group") {
|
|
1141
|
-
const parallel = step.tasks.map((t) => mapParsedTaskToStepObject(t, undefined, false, { baseCwd, inGroup: true }));
|
|
1142
|
-
return {
|
|
1143
|
-
parallel,
|
|
1144
|
-
...(step.config.concurrency !== undefined ? { concurrency: step.config.concurrency } : {}),
|
|
1145
|
-
...(step.config.failFast !== undefined ? { failFast: step.config.failFast } : {}),
|
|
1146
|
-
...(step.config.worktree !== undefined ? { worktree: step.config.worktree } : {}),
|
|
1147
|
-
};
|
|
1148
|
-
}
|
|
1149
|
-
return mapParsedTaskToStepObject(step, sharedTask || undefined, false, { baseCwd, inGroup: false });
|
|
1150
|
-
});
|
|
1151
|
-
} catch (error) {
|
|
1152
|
-
notify(error instanceof Error ? error.message : String(error));
|
|
1153
|
-
return null;
|
|
1154
|
-
}
|
|
1155
|
-
return { chain, task: sharedTask };
|
|
1156
|
-
}
|
|
1157
625
|
|
|
1158
626
|
export function registerSlashCommands(
|
|
1159
627
|
pi: ExtensionAPI,
|
|
1160
628
|
state: SubagentState,
|
|
1161
629
|
): void {
|
|
630
|
+
registerInlineSubagentInvocation(pi, state);
|
|
631
|
+
|
|
1162
632
|
let fleetOpen = false;
|
|
1163
633
|
const showFleet = async (ctx: ExtensionContext) => {
|
|
1164
634
|
state.lastUiContext = ctx;
|
|
@@ -1172,7 +642,7 @@ export function registerSlashCommands(
|
|
|
1172
642
|
}
|
|
1173
643
|
fleetOpen = true;
|
|
1174
644
|
try {
|
|
1175
|
-
await openSubagentFleet(ctx, state);
|
|
645
|
+
await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, resultsDir: DIRS.results });
|
|
1176
646
|
} finally {
|
|
1177
647
|
fleetOpen = false;
|
|
1178
648
|
}
|
|
@@ -1187,7 +657,7 @@ export function registerSlashCommands(
|
|
|
1187
657
|
|
|
1188
658
|
pi.registerCommand("run", {
|
|
1189
659
|
description: "Run a subagent directly: /run agent[output=file] [task] [--bg] [--fork]",
|
|
1190
|
-
getArgumentCompletions: makeAgentCompletions(state
|
|
660
|
+
getArgumentCompletions: makeAgentCompletions(state),
|
|
1191
661
|
handler: async (args, ctx) => {
|
|
1192
662
|
const { args: cleanedArgs, bg, fork } = extractExecutionFlags(args);
|
|
1193
663
|
const input = cleanedArgs.trim();
|
|
@@ -1215,74 +685,6 @@ export function registerSlashCommands(
|
|
|
1215
685
|
},
|
|
1216
686
|
});
|
|
1217
687
|
|
|
1218
|
-
pi.registerCommand("chain", {
|
|
1219
|
-
description: "Run agents in sequence: /chain explorer \"task\" -> architect [--bg] [--fork]",
|
|
1220
|
-
getArgumentCompletions: makeAgentCompletions(state, true),
|
|
1221
|
-
handler: async (args, ctx) => {
|
|
1222
|
-
const { args: cleanedArgs, bg, fork } = extractExecutionFlags(args);
|
|
1223
|
-
const built = buildChainExpressionSteps(state, cleanedArgs, ctx);
|
|
1224
|
-
if (!built) return;
|
|
1225
|
-
const params: SubagentParamsLike = { chain: built.chain, task: built.task, clarify: false, agentScope: "both" };
|
|
1226
|
-
if (bg) params.async = true;
|
|
1227
|
-
if (fork) params.context = "fork";
|
|
1228
|
-
launchSlashSubagent(pi, ctx, params);
|
|
1229
|
-
},
|
|
1230
|
-
});
|
|
1231
|
-
|
|
1232
|
-
pi.registerCommand("run-chain", {
|
|
1233
|
-
description: "Run a saved chain: /run-chain chainName -- task [--bg] [--fork]",
|
|
1234
|
-
getArgumentCompletions: makeChainCompletions(state),
|
|
1235
|
-
handler: async (args, ctx) => {
|
|
1236
|
-
const { args: cleanedArgs, bg, fork } = extractExecutionFlags(args);
|
|
1237
|
-
const delimiterIndex = cleanedArgs.indexOf(" -- ");
|
|
1238
|
-
const usage = "Usage: /run-chain <chainName> -- <task> [--bg] [--fork]";
|
|
1239
|
-
if (delimiterIndex === -1) {
|
|
1240
|
-
ctx.ui.notify(usage, "error");
|
|
1241
|
-
return;
|
|
1242
|
-
}
|
|
1243
|
-
const chainName = cleanedArgs.slice(0, delimiterIndex).trim();
|
|
1244
|
-
const task = cleanedArgs.slice(delimiterIndex + 4).trim();
|
|
1245
|
-
if (!chainName || !task) {
|
|
1246
|
-
ctx.ui.notify(usage, "error");
|
|
1247
|
-
return;
|
|
1248
|
-
}
|
|
1249
|
-
if (!state.baseCwd) { ctx.ui.notify("Subagent session cwd is not initialized yet", "error"); return; }
|
|
1250
|
-
const chain = discoverSavedChains(state.baseCwd).find((candidate) => candidate.name === chainName);
|
|
1251
|
-
if (!chain) {
|
|
1252
|
-
ctx.ui.notify(`Unknown chain: ${chainName}`, "error");
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
const params: SubagentParamsLike = { chain: mapSavedChainSteps(chain), task, clarify: false, agentScope: "both" };
|
|
1256
|
-
if (bg) params.async = true;
|
|
1257
|
-
if (fork) params.context = "fork";
|
|
1258
|
-
launchSlashSubagent(pi, ctx, params);
|
|
1259
|
-
},
|
|
1260
|
-
});
|
|
1261
|
-
|
|
1262
|
-
pi.registerCommand("parallel", {
|
|
1263
|
-
description: "Run agents in parallel: /parallel explorer \"task1\" -> commentator \"task2\" [--bg] [--fork]",
|
|
1264
|
-
getArgumentCompletions: makeAgentCompletions(state, true),
|
|
1265
|
-
handler: async (args, ctx) => {
|
|
1266
|
-
const { args: cleanedArgs, bg, fork } = extractExecutionFlags(args);
|
|
1267
|
-
const parsed = parseAgentArgs(state, cleanedArgs, "parallel", ctx);
|
|
1268
|
-
if (!parsed) return;
|
|
1269
|
-
const tasks = parsed.steps.map(({ name, config, task: stepTask }) => ({
|
|
1270
|
-
agent: name,
|
|
1271
|
-
task: stepTask ?? parsed.task,
|
|
1272
|
-
...(config.output !== undefined ? { output: config.output } : {}),
|
|
1273
|
-
...(config.outputMode !== undefined ? { outputMode: config.outputMode } : {}),
|
|
1274
|
-
...(config.reads !== undefined ? { reads: config.reads } : {}),
|
|
1275
|
-
...(config.model ? { model: config.model } : {}),
|
|
1276
|
-
...(config.skill !== undefined ? { skill: config.skill } : {}),
|
|
1277
|
-
...(config.progress !== undefined ? { progress: config.progress } : {}),
|
|
1278
|
-
}));
|
|
1279
|
-
const params: SubagentParamsLike = { tasks, clarify: false, agentScope: "both" };
|
|
1280
|
-
if (bg) params.async = true;
|
|
1281
|
-
if (fork) params.context = "fork";
|
|
1282
|
-
launchSlashSubagent(pi, ctx, params);
|
|
1283
|
-
},
|
|
1284
|
-
});
|
|
1285
|
-
|
|
1286
688
|
pi.registerCommand("subagent-cost", {
|
|
1287
689
|
description: "Show parent and subagent child usage cost for this session",
|
|
1288
690
|
handler: async (_args, ctx) => {
|
|
@@ -1371,7 +773,7 @@ export function registerSlashCommands(
|
|
|
1371
773
|
);
|
|
1372
774
|
if (!result?.confirmed || !result.target) return;
|
|
1373
775
|
if (result.target.kind === "scheduled") {
|
|
1374
|
-
await runSlashSubagent(pi, ctx, { action: "schedule
|
|
776
|
+
await runSlashSubagent(pi, ctx, { action: "schedule.pause", id: result.target.id });
|
|
1375
777
|
return;
|
|
1376
778
|
}
|
|
1377
779
|
await runSlashSubagent(pi, ctx, { action: "stop", id: result.target.id });
|
|
@@ -1430,14 +832,14 @@ export function registerSlashCommands(
|
|
|
1430
832
|
},
|
|
1431
833
|
handler: async (args, ctx) => {
|
|
1432
834
|
const parsed = parseSingleRequiredArg(args, "Usage: /subagents-load-profile <name>");
|
|
1433
|
-
if (
|
|
835
|
+
if (parsed.ok === false) {
|
|
1434
836
|
ctx.ui.notify(parsed.message, "error");
|
|
1435
837
|
return;
|
|
1436
838
|
}
|
|
1437
839
|
try {
|
|
1438
840
|
await withSlashStatus(ctx, `Loading profile ${parsed.value}…`, async () => {
|
|
1439
841
|
const { profile } = readSubagentProfile(parsed.value);
|
|
1440
|
-
const
|
|
842
|
+
const workerModel = getProfileWorkerModel(profile);
|
|
1441
843
|
const result = applySubagentProfile(parsed.value);
|
|
1442
844
|
const lines = [
|
|
1443
845
|
`Loaded subagent profile: ${parsed.value}`,
|
|
@@ -1445,24 +847,24 @@ export function registerSlashCommands(
|
|
|
1445
847
|
`Updated: ${result.settingsPath}`,
|
|
1446
848
|
];
|
|
1447
849
|
|
|
1448
|
-
if (
|
|
850
|
+
if (workerModel && typeof pi.setModel === "function" && typeof ctx.modelRegistry?.find === "function" && typeof ctx.modelRegistry?.getAvailable === "function") {
|
|
1449
851
|
const shouldSwitch = await ctx.ui.confirm(
|
|
1450
852
|
"",
|
|
1451
|
-
`Profile loaded. Also switch this session to the profile builder model?\n\n${
|
|
853
|
+
`Profile loaded. Also switch this session to the profile builder model?\n\n${workerModel}`,
|
|
1452
854
|
);
|
|
1453
855
|
if (shouldSwitch) {
|
|
1454
|
-
const modelInfo = findModelInfo(
|
|
856
|
+
const modelInfo = findModelInfo(workerModel, ctx.modelRegistry.getAvailable().map(toModelInfo));
|
|
1455
857
|
const model = modelInfo ? ctx.modelRegistry.find(modelInfo.provider, modelInfo.id) : undefined;
|
|
1456
858
|
if (!modelInfo || !model) {
|
|
1457
|
-
lines.push(`Could not switch current session model: '${
|
|
859
|
+
lines.push(`Could not switch current session model: '${workerModel}' is not available in the current model registry.`);
|
|
1458
860
|
} else {
|
|
1459
861
|
const success = await pi.setModel(model);
|
|
1460
862
|
if (success) lines.push(`Current session model switched to: ${modelInfo.fullId}`);
|
|
1461
|
-
else lines.push(`Could not switch current session model to '${
|
|
863
|
+
else lines.push(`Could not switch current session model to '${workerModel}': no API key or provider access is available.`);
|
|
1462
864
|
}
|
|
1463
865
|
}
|
|
1464
|
-
} else if (
|
|
1465
|
-
lines.push(`Profile builder model: ${
|
|
866
|
+
} else if (workerModel) {
|
|
867
|
+
lines.push(`Profile builder model: ${workerModel}`);
|
|
1466
868
|
}
|
|
1467
869
|
|
|
1468
870
|
sendSlashText(pi, lines.join("\n"));
|
|
@@ -1481,7 +883,7 @@ export function registerSlashCommands(
|
|
|
1481
883
|
const force = /(?:^|\s)--force$/.test(trimmed) || /(?:^|\s)force$/.test(trimmed);
|
|
1482
884
|
const withoutForce = trimmed.replace(/(?:^|\s)(?:--force|force)$/, "").trim();
|
|
1483
885
|
const parsed = parseSingleRequiredArg(withoutForce, "Usage: /subagents-refresh-provider-models <provider> [--force]");
|
|
1484
|
-
if (
|
|
886
|
+
if (parsed.ok === false) {
|
|
1485
887
|
ctx.ui.notify(parsed.message, "error");
|
|
1486
888
|
return;
|
|
1487
889
|
}
|
|
@@ -1512,7 +914,7 @@ export function registerSlashCommands(
|
|
|
1512
914
|
getArgumentCompletions: makeProviderCompletions(state),
|
|
1513
915
|
handler: async (args, ctx) => {
|
|
1514
916
|
const parsed = parseSingleRequiredArg(args, "Usage: /subagents-generate-profiles <provider>");
|
|
1515
|
-
if (
|
|
917
|
+
if (parsed.ok === false) {
|
|
1516
918
|
ctx.ui.notify(parsed.message, "error");
|
|
1517
919
|
return;
|
|
1518
920
|
}
|
|
@@ -1555,7 +957,7 @@ export function registerSlashCommands(
|
|
|
1555
957
|
},
|
|
1556
958
|
handler: async (args, ctx) => {
|
|
1557
959
|
const parsed = parseSingleRequiredArg(args, "Usage: /subagents-check-profile <name>");
|
|
1558
|
-
if (
|
|
960
|
+
if (parsed.ok === false) {
|
|
1559
961
|
ctx.ui.notify(parsed.message, "error");
|
|
1560
962
|
return;
|
|
1561
963
|
}
|