@selesai/code 0.9.11 → 0.9.12
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 +11 -0
- package/dist/config.d.ts +4 -6
- package/dist/config.js +10 -14
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +3 -49
- package/dist/core/extensions/types.d.ts +0 -2
- package/dist/core/settings-manager.d.ts +0 -2
- package/dist/core/settings-manager.js +0 -3
- package/dist/core/tools/index.d.ts +0 -1
- package/dist/core/tools/index.js +0 -1
- package/dist/defaults/settings.json +0 -1
- package/dist/extensions/model-prompt-injector/index.test.ts +0 -10
- package/dist/extensions/model-prompt-injector/index.ts +0 -3
- package/dist/extensions/pi-intercom/CHANGELOG.md +53 -16
- package/dist/extensions/pi-intercom/README.md +41 -8
- package/dist/extensions/pi-intercom/banner.png +0 -0
- package/dist/extensions/pi-intercom/broker/broker.ts +498 -215
- package/dist/extensions/pi-intercom/broker/client.ts +39 -12
- package/dist/extensions/pi-intercom/broker/extension.test.ts +102 -3
- package/dist/extensions/pi-intercom/broker/paths.test.ts +2 -2
- package/dist/extensions/pi-intercom/broker/protocol.ts +26 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +5 -20
- package/dist/extensions/pi-intercom/config.test.ts +41 -0
- package/dist/extensions/pi-intercom/config.ts +21 -0
- package/dist/extensions/pi-intercom/extension-api.ts +40 -0
- package/dist/extensions/pi-intercom/index.ts +362 -26
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +819 -13
- package/dist/extensions/pi-intercom/package.json +1 -1
- package/dist/extensions/pi-intercom/project-agent.ts +2 -2
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +8 -110
- package/dist/extensions/pi-intercom/types.ts +32 -5
- package/dist/extensions/pi-intercom/ui/inline-message.ts +6 -0
- package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
- package/dist/extensions/pi-subagents/.github/workflows/release.yml +28 -0
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +51 -0
- package/dist/extensions/pi-subagents/.greptile/config.json +33 -0
- package/dist/extensions/pi-subagents/.greptile/files.json +8 -0
- package/dist/extensions/pi-subagents/.greptile/rules.md +16 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +309 -87
- package/dist/extensions/pi-subagents/README.md +15 -17
- package/dist/extensions/pi-subagents/agents/oracle.md +3 -1
- package/dist/extensions/pi-subagents/agents/researcher.md +32 -13
- package/dist/extensions/pi-subagents/agents/reviewer.md +13 -2
- package/dist/extensions/pi-subagents/agents/scout.md +2 -2
- package/dist/extensions/pi-subagents/agents/worker.md +2 -1
- package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +180 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +106 -27
- package/dist/extensions/pi-subagents/docs/extension-api.md +85 -21
- package/dist/extensions/pi-subagents/docs/missions.md +41 -4
- package/dist/extensions/pi-subagents/docs/models.md +52 -9
- package/dist/extensions/pi-subagents/docs/observability.md +103 -16
- package/dist/extensions/pi-subagents/docs/tool-reference.md +60 -45
- package/dist/extensions/pi-subagents/docs/watchdog.md +60 -3
- package/dist/extensions/pi-subagents/docs/workflows.md +181 -7
- package/dist/extensions/pi-subagents/index.ts +10 -1
- package/dist/extensions/pi-subagents/install.mjs +4 -4
- package/dist/extensions/pi-subagents/package-lock.json +1483 -1470
- package/dist/extensions/pi-subagents/package.json +6 -3
- package/dist/extensions/pi-subagents/prompts/council.md +60 -0
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +5 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +9 -5
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +254 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +18 -17
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +107 -140
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +44 -92
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +261 -368
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +6 -2
- package/dist/extensions/pi-subagents/src/agents/agents.ts +388 -85
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +14 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +418 -0
- package/dist/extensions/pi-subagents/src/agents/skills.ts +1 -1
- package/dist/extensions/pi-subagents/src/api/agents.ts +7 -0
- package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +195 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +88 -27
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +2 -0
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +2 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +20 -11
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +14 -6
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +5 -4
- package/dist/extensions/pi-subagents/src/extension/index.ts +270 -187
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +65 -28
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +120 -11
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +46 -64
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +51 -37
- package/dist/extensions/pi-subagents/src/extension/tool-result.ts +19 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +2 -2
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +3 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +55 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +2 -1
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +230 -46
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +26 -4
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +32 -10
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +6 -1
- package/dist/extensions/pi-subagents/src/missions/store.ts +4 -9
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +2 -2
- package/dist/extensions/pi-subagents/src/policy/authority.ts +2 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +31 -8
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +210 -52
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +63 -33
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +71 -17
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +886 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +14 -5
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +49 -56
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +1 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -33
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +5 -0
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +5 -1
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +22 -12
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +105 -71
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +68 -19
- package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +59 -0
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +443 -0
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +94 -10
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +158 -90
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +141 -53
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +8 -5
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +14 -4
- package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +7 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +13 -14
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +46 -25
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +823 -0
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +9 -3
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +594 -216
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -13
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +138 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +23 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +82 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +5 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +21 -14
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +23 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +153 -58
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +7 -9
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1283 -1657
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +274 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +6 -5
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +59 -10
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +36 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +52 -2
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +78 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +460 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +389 -0
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +10 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +14 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +243 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +201 -85
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +106 -39
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +145 -0
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +150 -27
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +46 -4
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +19 -15
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +5 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +86 -2
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +9 -9
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +0 -6
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +18 -4
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +51 -7
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +62 -21
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +1 -23
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +14 -2
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +2 -2
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +22 -2
- package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +102 -0
- package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +14 -0
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +49 -1
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +59 -1
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +12 -5
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +20 -0
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +0 -40
- package/dist/extensions/pi-subagents/src/shared/settings.ts +11 -30
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +52 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +228 -49
- package/dist/extensions/pi-subagents/src/shared/utils.ts +11 -3
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +10 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +0 -162
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +2 -5
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +105 -13
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +6 -36
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +829 -0
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +1415 -0
- package/dist/extensions/pi-subagents/src/tui/render.ts +78 -7
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +1 -0
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +59 -51
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +8 -2
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +2 -1
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +4 -4
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +471 -86
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +140 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +1 -1
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +0 -54
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1053 -414
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +194 -4
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +59 -4
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +0 -77
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +107 -6
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +211 -897
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +265 -375
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +77 -7
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +547 -30
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +2112 -310
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +274 -34
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +20 -3
- package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +9 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +30 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -2
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +1 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +197 -0
- package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +204 -27
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +444 -145
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +256 -4
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +9 -7
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +152 -22
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +29 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +205 -23
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +579 -0
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +123 -0
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +81 -3
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +109 -7
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +5 -2
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +3 -2
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +961 -0
- package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +64 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +1110 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1664 -0
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +81 -1
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +138 -11
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +41 -2
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +210 -79
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +95 -0
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +596 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +10 -1
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +3 -5
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +167 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +319 -18
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +19 -5
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +129 -0
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +231 -2
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +28 -1
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +106 -2
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +204 -7
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +59 -4
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +2 -6
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +34 -2
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +116 -6
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +12 -3
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +56 -61
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +416 -1
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +9 -2
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +42 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +21 -30
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +86 -11
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +49 -1
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +233 -5
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +28 -5
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +323 -20
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +66 -10
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +68 -5
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +174 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +679 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +55 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +399 -84
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +13 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +15 -10
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +11 -7
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -0
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +40 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +10 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +38 -3
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +110 -12
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +204 -19
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +25 -0
- package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +73 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +90 -50
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +1 -2
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +234 -7
- package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +36 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +37 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +302 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +167 -7
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +6 -6
- package/dist/extensions/ponytail/index.js +31 -25
- package/dist/extensions/ponytail/ponytail-config.cjs +34 -7
- package/dist/extensions/ponytail/ponytail-instructions.cjs +7 -9
- package/dist/extensions/ponytail/test/extension.test.js +7 -8
- package/dist/extensions/ponytail/test/helpers.test.js +1 -1
- package/dist/skills/brandkit/SKILL.md +799 -0
- package/dist/skills/design-taste-frontend/SKILL.md +1207 -0
- package/dist/skills/design-taste-frontend-v1/SKILL.md +227 -0
- package/dist/skills/full-output-enforcement/SKILL.md +50 -0
- package/dist/skills/gpt-taste/SKILL.md +75 -0
- package/dist/skills/high-end-visual-design/SKILL.md +99 -0
- package/dist/skills/image-to-code/SKILL.md +1229 -0
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +1466 -0
- package/dist/skills/imagegen-frontend-web/SKILL.md +988 -0
- package/dist/skills/industrial-brutalist-ui/SKILL.md +93 -0
- package/dist/skills/minimalist-ui/SKILL.md +86 -0
- package/dist/skills/pi-subagents/SKILL.md +18 -17
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
- package/dist/skills/pi-subagents/references/execution-controls.md +95 -143
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
- package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +45 -94
- package/dist/skills/ponytail/SKILL.md +12 -8
- package/dist/skills/ponytail-audit/SKILL.md +0 -1
- package/dist/skills/ponytail-debt/SKILL.md +0 -1
- package/dist/skills/ponytail-gain/SKILL.md +0 -1
- package/dist/skills/ponytail-help/SKILL.md +4 -3
- package/dist/skills/ponytail-review/SKILL.md +0 -1
- package/dist/skills/redesign-existing-projects/SKILL.md +179 -0
- package/dist/skills/stitch-design-taste/SKILL.md +185 -0
- package/dist/skills/unlazy/CHANGELOG.md +100 -0
- package/dist/skills/unlazy/CONTRIBUTING.md +66 -0
- package/dist/skills/unlazy/LICENSE +21 -0
- package/dist/skills/unlazy/README.md +242 -0
- package/dist/skills/unlazy/SECURITY.md +70 -0
- package/dist/skills/unlazy/SKILL.md +100 -0
- package/dist/skills/unlazy/package.json +13 -0
- package/dist/skills/unlazy/references/dispatch.md +82 -0
- package/dist/skills/unlazy/references/gates.md +132 -0
- package/dist/skills/unlazy/references/method.md +49 -0
- package/dist/skills/unlazy/references/orchestration.md +99 -0
- package/dist/skills/unlazy/references/parallel.md +123 -0
- package/dist/skills/unlazy/references/token-economy.md +39 -0
- package/dist/skills/unlazy/research/validation-protocol.md +81 -0
- package/dist/skills/unlazy/scripts/dispatch-check.mjs +108 -0
- package/dist/skills/unlazy/scripts/gate-check.mjs +894 -0
- package/dist/skills/unlazy/scripts/gate-lint.mjs +178 -0
- package/dist/skills/unlazy/scripts/install-hooks.mjs +206 -0
- package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +46 -0
- package/dist/skills/unlazy/scripts/lib/dispatch.mjs +283 -0
- package/dist/skills/unlazy/scripts/lib/gates.mjs +629 -0
- package/dist/skills/unlazy/scripts/lib/process-tree.mjs +161 -0
- package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +9 -0
- package/dist/skills/unlazy/scripts/stop-hook.mjs +174 -0
- package/dist/skills/unlazy/templates/PLAN.md +65 -0
- package/dist/skills/unlazy/templates/gates-leaf.md +51 -0
- package/dist/skills/unlazy/templates/gates-node.md +50 -0
- package/dist/skills/unlazy/tests/contract-tests.mjs +127 -0
- package/dist/skills/unlazy/tests/dispatch-tests.mjs +481 -0
- package/dist/skills/unlazy/tests/hardening-tests.mjs +903 -0
- package/dist/skills/unlazy/tests/lint-tests.mjs +242 -0
- package/dist/skills/unlazy/tests/run-tests.mjs +554 -0
- package/dist/skills/unlazy/tests/self-check.mjs +165 -0
- package/dist/skills/unlazy/tests/stress-tests.mjs +356 -0
- package/dist/skills/web-design-guidelines/SKILL.md +40 -0
- package/docs/settings.md +0 -5
- package/package.json +1 -1
- package/dist/core/tools/schema-prune.d.ts +0 -16
- package/dist/core/tools/schema-prune.js +0 -39
- package/dist/core/tools/schema-prune.test.d.ts +0 -1
- package/dist/core/tools/schema-prune.test.js +0 -111
- package/dist/extensions/pi-subagents/UPSTREAM-V0.50-MAPPING.md +0 -172
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +0 -55
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +0 -61
- package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +0 -132
- package/dist/extensions/pi-subagents/src/extension/chain-validation.ts +0 -181
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +0 -1354
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +0 -1581
- package/dist/extensions/pi-subagents/src/shared/env.ts +0 -16
- package/dist/extensions/pi-subagents/src/shared/session-lineage.ts +0 -71
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +0 -136
- package/dist/extensions/pi-subagents/src/workflows/workflow-auto-relaunch.ts +0 -41
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +0 -466
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +0 -1859
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +0 -733
- package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +0 -63
- package/dist/extensions/pi-subagents/test/unit/chain-validation.test.ts +0 -326
- package/dist/extensions/pi-subagents/test/unit/handoff-adoption.test.ts +0 -103
- package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +0 -127
- package/dist/extensions/pi-subagents/test/unit/session-lineage.test.ts +0 -73
- package/dist/extensions/pi-subagents/test/unit/task-aware-routing.test.ts +0 -213
- package/dist/extensions/pi-subagents/test/unit/workflow-auto-relaunch.test.ts +0 -65
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { splitKnownThinkingSuffix, type ModelInfo as AvailableModelInfo } from "../../shared/model-info.ts";
|
|
2
2
|
import type { Usage } from "../../shared/types.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { filterFallbackCandidates, parseModelKey, recordModelFailure } from "./model-exclusions.ts";
|
|
4
|
+
import { checkModelScope, type ModelScopeCheckRule, type ModelScopeViolation, type ModelSource } from "./model-scope.ts";
|
|
4
5
|
|
|
5
6
|
export type { AvailableModelInfo };
|
|
6
7
|
|
|
@@ -13,12 +14,17 @@ interface ModelAttemptSummary {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function splitThinkingSuffix(model: string): { baseModel: string; thinkingSuffix: string } {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
return splitKnownThinkingSuffix(model);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function formatSubagentModelVerificationError(expectedModel: string, observedModel: string, availableModels: AvailableModelInfo[] | undefined): string | undefined {
|
|
21
|
+
if (!availableModels || availableModels.length === 0) return undefined;
|
|
22
|
+
const expectedBase = splitThinkingSuffix(expectedModel).baseModel;
|
|
23
|
+
const observedBase = splitThinkingSuffix(observedModel).baseModel;
|
|
24
|
+
if (expectedBase === observedBase) return undefined;
|
|
25
|
+
const expectedEntry = availableModels.find((entry) => entry.fullId === expectedBase);
|
|
26
|
+
if (expectedEntry && expectedEntry.id === observedBase) return undefined;
|
|
27
|
+
return `model_verification_failed: child reported a different model than the launch candidate. Expected '${expectedModel}' but observed '${observedModel}'.`;
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
/** Sentinel model value requesting that a subagent inherit the parent session's model. */
|
|
@@ -41,7 +47,7 @@ export function normalizeParentModel(model: unknown): ParentModel | undefined {
|
|
|
41
47
|
/**
|
|
42
48
|
* Normalize a model id or provider segment for fuzzy comparison: case-fold,
|
|
43
49
|
* treat dots/underscores as dashes (so `4.5` matches `4-5`), and collapse
|
|
44
|
-
* repeated separators.
|
|
50
|
+
* repeated separators.
|
|
45
51
|
*/
|
|
46
52
|
export function normalizeModelSegment(segment: string): string {
|
|
47
53
|
return segment
|
|
@@ -58,7 +64,7 @@ function isPlausibleDateStamp(year: string, month: string, day: string): boolean
|
|
|
58
64
|
return yyyy >= 1900 && yyyy <= 2099 && mm >= 1 && mm <= 12 && dd >= 1 && dd <= 31;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
/** Drop a trailing date stamp (`-20251001` or `-2025-10-01`) so dated and undated ids match.
|
|
67
|
+
/** Drop a trailing date stamp (`-20251001` or `-2025-10-01`) so dated and undated ids match. */
|
|
62
68
|
function stripTrailingDateStamp(segment: string): string {
|
|
63
69
|
const dashed = /^(.*)-(\d{4})-(\d{2})-(\d{2})$/.exec(segment);
|
|
64
70
|
if (dashed && isPlausibleDateStamp(dashed[2]!, dashed[3]!, dashed[4]!)) return dashed[1]!;
|
|
@@ -67,21 +73,65 @@ function stripTrailingDateStamp(segment: string): string {
|
|
|
67
73
|
return segment;
|
|
68
74
|
}
|
|
69
75
|
|
|
76
|
+
function isRegisteredProvider(provider: string, availableModels: AvailableModelInfo[]): boolean {
|
|
77
|
+
const normalized = normalizeModelSegment(provider);
|
|
78
|
+
return availableModels.some((entry) => normalizeModelSegment(entry.provider) === normalized);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Split `provider/id` only when the first path segment is a registered provider.
|
|
83
|
+
* Hugging Face-style `owner/name` ids therefore stay intact unless `owner` is
|
|
84
|
+
* itself a provider in the active registry. `:` and `.` keep the same rule.
|
|
85
|
+
*/
|
|
86
|
+
function splitQualifiedModelQuery(
|
|
87
|
+
baseModel: string,
|
|
88
|
+
availableModels: AvailableModelInfo[],
|
|
89
|
+
): { queryProvider?: string; queryIdRaw: string } {
|
|
90
|
+
const slashIdx = baseModel.indexOf("/");
|
|
91
|
+
if (slashIdx !== -1) {
|
|
92
|
+
const providerPart = baseModel.slice(0, slashIdx);
|
|
93
|
+
if (isRegisteredProvider(providerPart, availableModels)) {
|
|
94
|
+
return { queryProvider: normalizeModelSegment(providerPart), queryIdRaw: baseModel.slice(slashIdx + 1) };
|
|
95
|
+
}
|
|
96
|
+
return { queryIdRaw: baseModel };
|
|
97
|
+
}
|
|
98
|
+
const providerSeparators = [":", "."];
|
|
99
|
+
for (const separator of providerSeparators) {
|
|
100
|
+
const separatorIdx = baseModel.indexOf(separator);
|
|
101
|
+
if (separatorIdx <= 0) continue;
|
|
102
|
+
const providerPart = baseModel.slice(0, separatorIdx);
|
|
103
|
+
if (!isRegisteredProvider(providerPart, availableModels)) continue;
|
|
104
|
+
return { queryProvider: normalizeModelSegment(providerPart), queryIdRaw: baseModel.slice(separatorIdx + 1) };
|
|
105
|
+
}
|
|
106
|
+
return { queryIdRaw: baseModel };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function resolveExactIdMatches(
|
|
110
|
+
baseModel: string,
|
|
111
|
+
availableModels: AvailableModelInfo[],
|
|
112
|
+
preferredProvider?: string,
|
|
113
|
+
): string | undefined {
|
|
114
|
+
const exactMatches = availableModels.filter((entry) => entry.id === baseModel);
|
|
115
|
+
if (preferredProvider) {
|
|
116
|
+
const preferredMatch = exactMatches.find((entry) => entry.provider === preferredProvider);
|
|
117
|
+
if (preferredMatch) return preferredMatch.fullId;
|
|
118
|
+
}
|
|
119
|
+
if (exactMatches.length === 1) return exactMatches[0]!.fullId;
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
|
|
70
123
|
function resolveBaseModelCandidate(
|
|
71
124
|
baseModel: string,
|
|
72
125
|
availableModels: AvailableModelInfo[],
|
|
73
126
|
preferredProvider?: string,
|
|
74
127
|
): string | undefined {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (preferredMatch) return preferredMatch.fullId;
|
|
83
|
-
}
|
|
84
|
-
if (exactMatches.length === 1) return exactMatches[0]!.fullId;
|
|
128
|
+
const exact = availableModels.find((entry) => entry.fullId === baseModel);
|
|
129
|
+
if (exact) return exact.fullId;
|
|
130
|
+
|
|
131
|
+
const { queryProvider } = splitQualifiedModelQuery(baseModel, availableModels);
|
|
132
|
+
if (queryProvider === undefined) {
|
|
133
|
+
const exactId = resolveExactIdMatches(baseModel, availableModels, preferredProvider);
|
|
134
|
+
if (exactId) return exactId;
|
|
85
135
|
}
|
|
86
136
|
|
|
87
137
|
return fuzzyResolveModel(baseModel, availableModels, preferredProvider);
|
|
@@ -90,35 +140,20 @@ function resolveBaseModelCandidate(
|
|
|
90
140
|
/**
|
|
91
141
|
* Fuzzy-resolve a base model id (thinking suffix already stripped) against the
|
|
92
142
|
* registry, tolerating separator, case, and optional date-stamp differences so
|
|
93
|
-
* users do not have to spell provider/model exactly. A
|
|
143
|
+
* users do not have to spell provider/model exactly. A slash is a provider
|
|
144
|
+
* prefix only when that prefix is a registered provider; otherwise the whole
|
|
145
|
+
* string is the model id (Hugging Face `owner/name`). A qualified provider
|
|
94
146
|
* query only matches within the named provider — this never silently switches
|
|
95
147
|
* providers for security/cost-sensitive configs. Returns the matched `fullId`,
|
|
96
148
|
* or `undefined` when there is no match or the match is ambiguous across
|
|
97
|
-
* providers (and no `preferredProvider` disambiguates).
|
|
149
|
+
* providers (and no `preferredProvider` disambiguates).
|
|
98
150
|
*/
|
|
99
151
|
export function fuzzyResolveModel(
|
|
100
152
|
baseModel: string,
|
|
101
153
|
availableModels: AvailableModelInfo[],
|
|
102
154
|
preferredProvider?: string,
|
|
103
155
|
): string | undefined {
|
|
104
|
-
|
|
105
|
-
let queryIdRaw = baseModel;
|
|
106
|
-
const slashIdx = baseModel.indexOf("/");
|
|
107
|
-
if (slashIdx !== -1) {
|
|
108
|
-
queryProvider = normalizeModelSegment(baseModel.slice(0, slashIdx));
|
|
109
|
-
queryIdRaw = baseModel.slice(slashIdx + 1);
|
|
110
|
-
} else {
|
|
111
|
-
const providerSeparators = [":", "."];
|
|
112
|
-
for (const separator of providerSeparators) {
|
|
113
|
-
const separatorIdx = baseModel.indexOf(separator);
|
|
114
|
-
if (separatorIdx <= 0) continue;
|
|
115
|
-
const providerPart = normalizeModelSegment(baseModel.slice(0, separatorIdx));
|
|
116
|
-
if (!availableModels.some((entry) => normalizeModelSegment(entry.provider) === providerPart)) continue;
|
|
117
|
-
queryProvider = providerPart;
|
|
118
|
-
queryIdRaw = baseModel.slice(separatorIdx + 1);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
156
|
+
const { queryProvider, queryIdRaw } = splitQualifiedModelQuery(baseModel, availableModels);
|
|
122
157
|
const queryId = normalizeModelSegment(queryIdRaw);
|
|
123
158
|
const queryIdNoDate = stripTrailingDateStamp(queryId);
|
|
124
159
|
|
|
@@ -143,7 +178,7 @@ export function fuzzyResolveModel(
|
|
|
143
178
|
* thinking suffix). Exact registry matches win; fuzzy normalization
|
|
144
179
|
* (separator/case/date-stamp via {@link fuzzyResolveModel}) is a fallback so
|
|
145
180
|
* spelling differences still resolve. Never switches providers for a qualified
|
|
146
|
-
* query.
|
|
181
|
+
* query.
|
|
147
182
|
*/
|
|
148
183
|
export function resolveModelCandidate(
|
|
149
184
|
model: string | undefined,
|
|
@@ -163,23 +198,50 @@ export function resolveModelCandidate(
|
|
|
163
198
|
return model;
|
|
164
199
|
}
|
|
165
200
|
|
|
166
|
-
function
|
|
201
|
+
function resolveSubagentModelCandidate(
|
|
167
202
|
model: string,
|
|
168
203
|
availableModels: AvailableModelInfo[] | undefined,
|
|
169
204
|
preferredProvider?: string,
|
|
170
|
-
): string {
|
|
205
|
+
): string | undefined {
|
|
171
206
|
if (!availableModels || availableModels.length === 0) return model;
|
|
172
207
|
const resolvedWhole = resolveBaseModelCandidate(model, availableModels, preferredProvider);
|
|
173
208
|
if (resolvedWhole) return resolvedWhole;
|
|
174
209
|
const { baseModel, thinkingSuffix } = splitThinkingSuffix(model);
|
|
175
210
|
const resolvedBase = thinkingSuffix ? resolveBaseModelCandidate(baseModel, availableModels, preferredProvider) : undefined;
|
|
176
|
-
|
|
177
|
-
|
|
211
|
+
return resolvedBase ? `${resolvedBase}${thinkingSuffix}` : undefined;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function suggestAlternateProviderModel(
|
|
215
|
+
model: string,
|
|
216
|
+
availableModels: AvailableModelInfo[] | undefined,
|
|
217
|
+
): string | undefined {
|
|
218
|
+
if (!availableModels || availableModels.length === 0) return undefined;
|
|
219
|
+
const { baseModel, thinkingSuffix } = splitThinkingSuffix(model);
|
|
220
|
+
const { queryProvider, queryIdRaw } = splitQualifiedModelQuery(baseModel, availableModels);
|
|
221
|
+
if (queryProvider === undefined) return undefined;
|
|
222
|
+
const suggestion = resolveBaseModelCandidate(queryIdRaw, availableModels);
|
|
223
|
+
if (!suggestion) return undefined;
|
|
224
|
+
const matched = availableModels.find((entry) => entry.fullId === suggestion);
|
|
225
|
+
if (!matched || normalizeModelSegment(matched.provider) === queryProvider) return undefined;
|
|
226
|
+
return `${suggestion}${thinkingSuffix}`;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function resolveRequiredSubagentModelCandidate(
|
|
230
|
+
model: string,
|
|
231
|
+
availableModels: AvailableModelInfo[] | undefined,
|
|
232
|
+
preferredProvider?: string,
|
|
233
|
+
): string {
|
|
234
|
+
const resolved = resolveSubagentModelCandidate(model, availableModels, preferredProvider);
|
|
235
|
+
if (resolved) return resolved;
|
|
236
|
+
const suggestion = suggestAlternateProviderModel(model, availableModels);
|
|
237
|
+
throw new Error(
|
|
238
|
+
`Unknown subagent model '${model}' in the active Pi model registry.${suggestion ? ` Did you mean '${suggestion}'?` : ""}`,
|
|
239
|
+
);
|
|
178
240
|
}
|
|
179
241
|
|
|
180
242
|
export interface ResolveSubagentModelOverrideOptions {
|
|
181
243
|
/** When set with `enforce: true`, out-of-scope models are rejected. */
|
|
182
|
-
scope?:
|
|
244
|
+
scope?: ModelScopeCheckRule | ModelScopeCheckRule[];
|
|
183
245
|
/** Origin of the requested model: explicit caller-supplied (hard error) vs inherited (warn). Defaults to `"inherited"`. */
|
|
184
246
|
source?: ModelSource;
|
|
185
247
|
/** Called for warn-severity violations instead of `console.warn`. */
|
|
@@ -190,6 +252,32 @@ function defaultScopeWarn(violation: ModelScopeViolation): void {
|
|
|
190
252
|
console.warn(`[pi-subagents] ${violation.message}`);
|
|
191
253
|
}
|
|
192
254
|
|
|
255
|
+
function configuredScopes(scope: ModelScopeCheckRule | ModelScopeCheckRule[] | undefined): ModelScopeCheckRule[] {
|
|
256
|
+
return scope ? (Array.isArray(scope) ? scope : [scope]) : [];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function throwForUnresolvedEnforcedInheritScope(scope: ModelScopeCheckRule | ModelScopeCheckRule[] | undefined, includeMixed = false): void {
|
|
260
|
+
const unresolvedInheritScope = configuredScopes(scope)
|
|
261
|
+
.find((entry) => entry.enforce === true && (includeMixed ? entry.allow?.includes(INHERIT_MODEL) : entry.allow?.length === 1 && entry.allow[0] === INHERIT_MODEL));
|
|
262
|
+
if (!unresolvedInheritScope) return;
|
|
263
|
+
const origin = unresolvedInheritScope.origin ?? "modelScope";
|
|
264
|
+
throw new Error(`Cannot enforce subagent model scope (${origin}): 'inherit' requires a current parent session model.`);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function enforceModelScopes(
|
|
268
|
+
model: string,
|
|
269
|
+
scope: ModelScopeCheckRule | ModelScopeCheckRule[] | undefined,
|
|
270
|
+
source: ModelSource,
|
|
271
|
+
onWarn: ((violation: ModelScopeViolation) => void) | undefined,
|
|
272
|
+
): void {
|
|
273
|
+
const violations = configuredScopes(scope)
|
|
274
|
+
.map((entry) => checkModelScope(model, entry, source))
|
|
275
|
+
.filter((violation): violation is ModelScopeViolation => violation !== undefined);
|
|
276
|
+
const error = violations.find((violation) => violation.severity === "error");
|
|
277
|
+
if (error) throw new Error(error.message);
|
|
278
|
+
for (const violation of violations) (onWarn ?? defaultScopeWarn)(violation);
|
|
279
|
+
}
|
|
280
|
+
|
|
193
281
|
/**
|
|
194
282
|
* Resolve the `--model` override passed to a spawned subagent.
|
|
195
283
|
*
|
|
@@ -217,19 +305,16 @@ export function resolveSubagentModelOverride(
|
|
|
217
305
|
): string | undefined {
|
|
218
306
|
const trimmed = typeof requestedModel === "string" ? requestedModel.trim() : "";
|
|
219
307
|
const explicit = trimmed && trimmed !== INHERIT_MODEL ? trimmed : undefined;
|
|
308
|
+
if (!parentModel) throwForUnresolvedEnforcedInheritScope(options?.scope, explicit === undefined || options?.source === "inherited");
|
|
220
309
|
let resolved: string | undefined;
|
|
221
310
|
if (explicit === undefined) {
|
|
222
311
|
resolved = parentModel ? `${parentModel.provider}/${parentModel.id}` : undefined;
|
|
223
312
|
} else {
|
|
224
313
|
resolved = resolveRequiredSubagentModelCandidate(explicit, availableModels, preferredProvider);
|
|
225
314
|
}
|
|
226
|
-
if (resolved && options?.scope
|
|
315
|
+
if (resolved && options?.scope) {
|
|
227
316
|
const source: ModelSource = explicit === undefined ? "inherited" : (options.source ?? "inherited");
|
|
228
|
-
|
|
229
|
-
if (violation) {
|
|
230
|
-
if (violation.severity === "error") throw new Error(violation.message);
|
|
231
|
-
(options.onWarn ?? defaultScopeWarn)(violation);
|
|
232
|
-
}
|
|
317
|
+
enforceModelScopes(resolved, options.scope, source, options.onWarn);
|
|
233
318
|
}
|
|
234
319
|
return resolved;
|
|
235
320
|
}
|
|
@@ -261,8 +346,20 @@ export function resolveEffectiveSubagentModel(
|
|
|
261
346
|
|
|
262
347
|
export interface BuildModelCandidatesOptions {
|
|
263
348
|
/** Fallback models warn by default and throw when strict scope enforcement is enabled. */
|
|
264
|
-
scope?:
|
|
349
|
+
scope?: ModelScopeCheckRule | ModelScopeCheckRule[];
|
|
265
350
|
onWarn?: (violation: ModelScopeViolation) => void;
|
|
351
|
+
/** The primary model came from the running parent session, not configuration. */
|
|
352
|
+
primaryModelFromParent?: boolean;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function inheritsParentModel(
|
|
356
|
+
explicitModel: string | boolean | undefined,
|
|
357
|
+
agentModel: string | boolean | undefined,
|
|
358
|
+
parentModel: ParentModel | undefined,
|
|
359
|
+
): boolean {
|
|
360
|
+
const requestedModel = explicitModel ?? agentModel;
|
|
361
|
+
const trimmed = typeof requestedModel === "string" ? requestedModel.trim() : "";
|
|
362
|
+
return Boolean(parentModel && (!trimmed || trimmed === INHERIT_MODEL));
|
|
266
363
|
}
|
|
267
364
|
|
|
268
365
|
export function buildModelCandidates(
|
|
@@ -272,29 +369,37 @@ export function buildModelCandidates(
|
|
|
272
369
|
preferredProvider?: string,
|
|
273
370
|
options?: BuildModelCandidatesOptions,
|
|
274
371
|
): string[] {
|
|
372
|
+
if (!primaryModel) throwForUnresolvedEnforcedInheritScope(options?.scope, true);
|
|
275
373
|
const seen = new Set<string>();
|
|
276
374
|
const candidates: string[] = [];
|
|
277
375
|
const rawCandidates = [primaryModel, ...(fallbackModels ?? [])];
|
|
278
376
|
for (let index = 0; index < rawCandidates.length; index++) {
|
|
279
377
|
const raw = rawCandidates[index];
|
|
280
378
|
if (!raw) continue;
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
379
|
+
const model = raw.trim();
|
|
380
|
+
const normalized = index === 0
|
|
381
|
+
? options?.primaryModelFromParent
|
|
382
|
+
? model
|
|
383
|
+
: resolveRequiredSubagentModelCandidate(model, availableModels, preferredProvider)
|
|
384
|
+
: resolveSubagentModelCandidate(model, availableModels, preferredProvider);
|
|
385
|
+
if (!normalized) {
|
|
386
|
+
console.warn(`[pi-subagents] Skipping fallback model '${model}' because it is unavailable in this environment.`);
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
if (seen.has(normalized)) continue;
|
|
390
|
+
const scopes = configuredScopes(options?.scope);
|
|
391
|
+
if (index > 0 || scopes.some((scope) => scope.enforce === true && scope.strict === true)) {
|
|
392
|
+
enforceModelScopes(normalized, scopes, "inherited", options?.onWarn);
|
|
289
393
|
}
|
|
290
394
|
seen.add(normalized);
|
|
291
395
|
candidates.push(normalized);
|
|
292
396
|
}
|
|
293
|
-
return candidates;
|
|
397
|
+
return filterFallbackCandidates(candidates);
|
|
294
398
|
}
|
|
295
399
|
|
|
296
400
|
const RETRYABLE_MODEL_FAILURE_PATTERNS = [
|
|
297
401
|
/rate\s*limit/i,
|
|
402
|
+
/usage\s*limit/i,
|
|
298
403
|
/too many requests/i,
|
|
299
404
|
/\b429\b/,
|
|
300
405
|
/quota/i,
|
|
@@ -328,23 +433,9 @@ const RETRYABLE_MODEL_FAILURE_PATTERNS = [
|
|
|
328
433
|
/cold.?start/i,
|
|
329
434
|
/empty response/i,
|
|
330
435
|
/no output/i,
|
|
331
|
-
/no response body/i,
|
|
332
|
-
/no body/i,
|
|
333
|
-
/empty body/i,
|
|
334
|
-
/econnreset/i,
|
|
335
436
|
/model.*(?:load|fail|error)/i,
|
|
336
437
|
];
|
|
337
438
|
|
|
338
|
-
/**
|
|
339
|
-
* Bounded same-model retry schedule for transient provider errors (503, 429,
|
|
340
|
-
* overloaded, dropped/empty response bodies, etc.). Fallback models still
|
|
341
|
-
* switch first to preserve existing behavior; this schedule retries the final
|
|
342
|
-
* candidate on the same model when no fallback remains. Transient outages
|
|
343
|
-
* usually clear without a model change. The schedule stays short and bounded so
|
|
344
|
-
* persistent failures fail fast instead of amplifying a broken provider.
|
|
345
|
-
*/
|
|
346
|
-
export const MODEL_RETRY_DELAYS_MS = [500, 1500, 4000] as const;
|
|
347
|
-
|
|
348
439
|
/**
|
|
349
440
|
* Failures reported as `<tool> failed (exit N): ...` or `<tool> failed with
|
|
350
441
|
* exit code N` come from a tool call inside the child's task, not from the
|
|
@@ -360,18 +451,43 @@ export function isRetryableModelFailure(error: string | undefined): boolean {
|
|
|
360
451
|
return RETRYABLE_MODEL_FAILURE_PATTERNS.some((pattern) => pattern.test(error));
|
|
361
452
|
}
|
|
362
453
|
|
|
454
|
+
export function recordRetryableModelFailure(model: string | undefined, error: string | undefined): void {
|
|
455
|
+
if (!model || !isRetryableModelFailure(error)) return;
|
|
456
|
+
const { provider, modelId } = parseModelKey(model);
|
|
457
|
+
recordModelFailure({ modelId, reason: error, ...(provider ? { provider } : {}) });
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Context-overflow signals. These are deliberately NOT part of
|
|
462
|
+
* {@link RETRYABLE_MODEL_FAILURE_PATTERNS}: an overflow means the input was too
|
|
463
|
+
* large for the model's context window, so retrying the same input on another
|
|
464
|
+
* model (or the same model again) cannot succeed. Callers should treat overflow
|
|
465
|
+
* as a terminal, non-retryable failure and surface a clear "input too large"
|
|
466
|
+
* error instead of burning fallback attempts on a guaranteed failure.
|
|
467
|
+
*/
|
|
468
|
+
const CONTEXT_OVERFLOW_PATTERNS = [
|
|
469
|
+
/context(?: length| window| limit)? (?:exceed|overflow|too long)/i,
|
|
470
|
+
/maximum context length/i,
|
|
471
|
+
/too many tokens/i,
|
|
472
|
+
/token limit/i,
|
|
473
|
+
/context_length_exceeded/i,
|
|
474
|
+
/length_required/i,
|
|
475
|
+
/maximum.*tokens/i,
|
|
476
|
+
/prompt.*too long/i,
|
|
477
|
+
/input.*too long/i,
|
|
478
|
+
/exceeded.*context/i,
|
|
479
|
+
/context.*overflow/i,
|
|
480
|
+
];
|
|
481
|
+
|
|
482
|
+
export function isContextOverflow(error: string | undefined): boolean {
|
|
483
|
+
if (!error) return false;
|
|
484
|
+
if (TOOL_FAILURE_PREFIX.test(error.trim())) return false;
|
|
485
|
+
return CONTEXT_OVERFLOW_PATTERNS.some((pattern) => pattern.test(error));
|
|
486
|
+
}
|
|
487
|
+
|
|
363
488
|
export function formatModelAttemptNote(attempt: ModelAttemptSummary, nextModel?: string): string {
|
|
364
489
|
const failure = attempt.error?.trim() || `exit ${attempt.exitCode ?? 1}`;
|
|
365
490
|
return nextModel
|
|
366
491
|
? `[fallback] ${attempt.model} failed: ${failure}. Retrying with ${nextModel}.`
|
|
367
492
|
: `[fallback] ${attempt.model} failed: ${failure}.`;
|
|
368
493
|
}
|
|
369
|
-
|
|
370
|
-
export function formatModelRetryNote(input: {
|
|
371
|
-
model: string;
|
|
372
|
-
attempt: number;
|
|
373
|
-
maxAttempts: number;
|
|
374
|
-
delayMs: number;
|
|
375
|
-
}): string {
|
|
376
|
-
return `[model-retry] ${input.model} failed with a transient provider error (attempt ${input.attempt}/${input.maxAttempts}). Retrying the same model in ${input.delayMs}ms.`;
|
|
377
|
-
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import { splitKnownThinkingSuffix } from "../../shared/model-info.ts";
|
|
17
17
|
|
|
18
|
-
export interface
|
|
18
|
+
export interface ModelScopeRule {
|
|
19
19
|
enforce?: boolean;
|
|
20
20
|
/** Reject inherited and fallback models outside the allowlist instead of warning. */
|
|
21
21
|
strict?: boolean;
|
|
@@ -23,6 +23,19 @@ export interface ModelScopeConfig {
|
|
|
23
23
|
allow?: string[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export interface ModelScopeConfig extends ModelScopeRule {
|
|
27
|
+
/** Additional restrictions keyed by canonical agent name. */
|
|
28
|
+
agents?: Record<string, ModelScopeRule>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ModelScopeCheckRule extends ModelScopeRule {
|
|
32
|
+
origin?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ResolvedModelScope extends ModelScopeCheckRule {
|
|
36
|
+
origin: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
26
39
|
/** Where a resolved model originated, deciding enforcement severity. */
|
|
27
40
|
export type ModelSource = "explicit" | "inherited";
|
|
28
41
|
|
|
@@ -32,6 +45,7 @@ export interface ModelScopeViolation {
|
|
|
32
45
|
severity: "warn" | "error";
|
|
33
46
|
message: string;
|
|
34
47
|
allowedPatterns: string[];
|
|
48
|
+
origin: string;
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
function stripThinkingSuffix(model: string): string {
|
|
@@ -61,7 +75,7 @@ export function matchesScopePattern(model: string, pattern: string): boolean {
|
|
|
61
75
|
*/
|
|
62
76
|
export function checkModelScope(
|
|
63
77
|
model: string | undefined,
|
|
64
|
-
scope:
|
|
78
|
+
scope: ModelScopeCheckRule | undefined,
|
|
65
79
|
source: ModelSource,
|
|
66
80
|
): ModelScopeViolation | undefined {
|
|
67
81
|
if (!model || !scope?.enforce) return undefined;
|
|
@@ -71,16 +85,89 @@ export function checkModelScope(
|
|
|
71
85
|
|
|
72
86
|
const baseModel = stripThinkingSuffix(model);
|
|
73
87
|
const severity: ModelScopeViolation["severity"] = source === "explicit" || scope.strict === true ? "error" : "warn";
|
|
88
|
+
const origin = scope.origin ?? "modelScope";
|
|
74
89
|
return {
|
|
75
90
|
model: baseModel,
|
|
76
91
|
severity,
|
|
77
92
|
allowedPatterns: allow,
|
|
93
|
+
origin,
|
|
78
94
|
message:
|
|
79
|
-
`Model '${baseModel}' is outside the configured subagent model scope. ` +
|
|
95
|
+
`Model '${baseModel}' is outside the configured subagent model scope (${origin}). ` +
|
|
80
96
|
`Allowed patterns: ${allow.join(", ")}.`,
|
|
81
97
|
};
|
|
82
98
|
}
|
|
83
99
|
|
|
100
|
+
function expandInheritPattern(pattern: string, parentModel: { provider: string; id: string } | undefined): string {
|
|
101
|
+
return pattern === "inherit" && parentModel ? `${parentModel.provider}/${parentModel.id}` : pattern;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function assertRecord(value: unknown, field: string, meta: { filePath: string }, expected = "an object"): Record<string, unknown> {
|
|
105
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
106
|
+
throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}'; expected ${expected}.`);
|
|
107
|
+
}
|
|
108
|
+
return value as Record<string, unknown>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function parseAllowList(value: unknown, field: string, meta: { filePath: string }): string[] {
|
|
112
|
+
if (!Array.isArray(value)) {
|
|
113
|
+
throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}'; expected an array of strings.`);
|
|
114
|
+
}
|
|
115
|
+
const allow: string[] = [];
|
|
116
|
+
for (const entry of value) {
|
|
117
|
+
if (typeof entry !== "string") {
|
|
118
|
+
throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}'; expected an array of strings.`);
|
|
119
|
+
}
|
|
120
|
+
const trimmed = entry.trim();
|
|
121
|
+
if (trimmed) allow.push(trimmed);
|
|
122
|
+
}
|
|
123
|
+
if (allow.length === 0) {
|
|
124
|
+
throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}'; expected a non-empty array of patterns.`);
|
|
125
|
+
}
|
|
126
|
+
return allow;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function parseScopeRule(input: Record<string, unknown>, field: string, meta: { filePath: string }): ModelScopeRule {
|
|
130
|
+
const rule: ModelScopeRule = {};
|
|
131
|
+
if ("enforce" in input) {
|
|
132
|
+
if (typeof input.enforce !== "boolean") throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}.enforce'; expected a boolean.`);
|
|
133
|
+
rule.enforce = input.enforce;
|
|
134
|
+
}
|
|
135
|
+
if ("strict" in input) {
|
|
136
|
+
if (typeof input.strict !== "boolean") throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}.strict'; expected a boolean.`);
|
|
137
|
+
rule.strict = input.strict;
|
|
138
|
+
}
|
|
139
|
+
if ("allow" in input) rule.allow = parseAllowList(input.allow, `${field}.allow`, meta);
|
|
140
|
+
return rule;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Resolve the global and matching agent policies into independent launch-time checks. */
|
|
144
|
+
export function resolveModelScopesForAgent(
|
|
145
|
+
config: ModelScopeConfig | undefined,
|
|
146
|
+
agentName: string,
|
|
147
|
+
parentModel: { provider: string; id: string } | undefined,
|
|
148
|
+
): ResolvedModelScope[] {
|
|
149
|
+
if (!config) return [];
|
|
150
|
+
const scopes: ResolvedModelScope[] = [];
|
|
151
|
+
if (config.allow) {
|
|
152
|
+
scopes.push({
|
|
153
|
+
...(config.enforce !== undefined ? { enforce: config.enforce } : {}),
|
|
154
|
+
...(config.strict !== undefined ? { strict: config.strict } : {}),
|
|
155
|
+
allow: config.allow.map((pattern) => expandInheritPattern(pattern, parentModel)),
|
|
156
|
+
origin: "modelScope",
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const agentScope = config.agents?.[agentName];
|
|
160
|
+
if (agentScope?.allow) {
|
|
161
|
+
scopes.push({
|
|
162
|
+
enforce: agentScope.enforce ?? config.enforce,
|
|
163
|
+
strict: agentScope.strict ?? config.strict,
|
|
164
|
+
allow: agentScope.allow.map((pattern) => expandInheritPattern(pattern, parentModel)),
|
|
165
|
+
origin: `modelScope.agents.${agentName}`,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return scopes;
|
|
169
|
+
}
|
|
170
|
+
|
|
84
171
|
/**
|
|
85
172
|
* Validate and normalize a raw `subagents.modelScope` value from settings.
|
|
86
173
|
* Throws a descriptive error for malformed configs (matching the surrounding
|
|
@@ -91,46 +178,26 @@ export function parseModelScopeConfig(
|
|
|
91
178
|
meta: { filePath: string },
|
|
92
179
|
): ModelScopeConfig | undefined {
|
|
93
180
|
if (value === undefined) return undefined;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if ("strict" in input) {
|
|
109
|
-
if (typeof input.strict !== "boolean") {
|
|
110
|
-
throw new Error(`Subagent settings in '${meta.filePath}' have invalid 'modelScope.strict'; expected a boolean.`);
|
|
111
|
-
}
|
|
112
|
-
config.strict = input.strict;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if ("allow" in input) {
|
|
116
|
-
if (!Array.isArray(input.allow)) {
|
|
117
|
-
throw new Error(`Subagent settings in '${meta.filePath}' have invalid 'modelScope.allow'; expected an array of strings.`);
|
|
118
|
-
}
|
|
119
|
-
const allow: string[] = [];
|
|
120
|
-
for (const entry of input.allow) {
|
|
121
|
-
if (typeof entry !== "string") {
|
|
122
|
-
throw new Error(`Subagent settings in '${meta.filePath}' have invalid 'modelScope.allow'; expected an array of strings.`);
|
|
181
|
+
const input = assertRecord(value, "modelScope", meta);
|
|
182
|
+
const config: ModelScopeConfig = parseScopeRule(input, "modelScope", meta);
|
|
183
|
+
|
|
184
|
+
if ("agents" in input) {
|
|
185
|
+
const agents: Record<string, ModelScopeRule> = {};
|
|
186
|
+
for (const [rawName, rawScope] of Object.entries(assertRecord(input.agents, "modelScope.agents", meta, "an object keyed by agent name"))) {
|
|
187
|
+
const name = rawName.trim();
|
|
188
|
+
const field = `modelScope.agents.${name}`;
|
|
189
|
+
if (!name) throw new Error(`Subagent settings in '${meta.filePath}' have invalid 'modelScope.agents' key; expected a non-empty agent name.`);
|
|
190
|
+
const agentInput = assertRecord(rawScope, field, meta);
|
|
191
|
+
if ("agents" in agentInput) {
|
|
192
|
+
throw new Error(`Subagent settings in '${meta.filePath}' have invalid '${field}.agents'; nested agent scopes are not supported.`);
|
|
123
193
|
}
|
|
124
|
-
|
|
125
|
-
if (trimmed) allow.push(trimmed);
|
|
126
|
-
}
|
|
127
|
-
if (allow.length === 0) {
|
|
128
|
-
throw new Error(`Subagent settings in '${meta.filePath}' have invalid 'modelScope.allow'; expected a non-empty array of patterns.`);
|
|
194
|
+
agents[name] = parseScopeRule(agentInput, field, meta);
|
|
129
195
|
}
|
|
130
|
-
config.
|
|
196
|
+
config.agents = agents;
|
|
131
197
|
}
|
|
132
198
|
|
|
133
|
-
|
|
199
|
+
const hasAnyAllow = Boolean(config.allow?.length) || Object.values(config.agents ?? {}).some((scope) => Boolean(scope.allow?.length));
|
|
200
|
+
if (config.enforce === true && !hasAnyAllow) {
|
|
134
201
|
throw new Error(`Subagent settings in '${meta.filePath}' set modelScope.enforce without a non-empty 'allow' list; supply allowed model patterns or disable enforcement.`);
|
|
135
202
|
}
|
|
136
203
|
|