@ashx-j/lunr 0.2.13 → 0.2.15
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 +27 -1
- package/README.md +10 -7
- package/dist/builtin-extensions/ashxj-tui.d.ts +16 -1
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +48 -24
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +2 -0
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-settings-tools.d.ts +4 -0
- package/dist/builtin-extensions/lunr-settings-tools.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-settings-tools.js +120 -0
- package/dist/builtin-extensions/lunr-settings-tools.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.d.ts +2 -2
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.js +3 -3
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +29 -23
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +5 -11
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +12 -15
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +3 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +14 -27
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +9 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +16 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js +7 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js +3 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js +3 -35
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +7 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +20 -21
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +12 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +42 -17
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +23 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +3 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +15 -4
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +14 -3
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts +3 -3
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js +7 -6
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.js +3 -3
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +6 -4
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +15 -10
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js +5 -4
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +86 -52
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/catalog/models.json +1 -1
- package/dist/catalog/providers/amazon-bedrock.json +1 -1
- package/dist/catalog/providers/anthropic.json +1 -1
- package/dist/catalog/providers/azure-openai-responses.json +1 -1
- package/dist/catalog/providers/cloudflare-ai-gateway.json +1 -1
- package/dist/catalog/providers/fireworks.json +1 -1
- package/dist/catalog/providers/github-copilot.json +1 -1
- package/dist/catalog/providers/google-vertex.json +1 -1
- package/dist/catalog/providers/google.json +1 -1
- package/dist/catalog/providers/groq.json +1 -1
- package/dist/catalog/providers/huggingface.json +1 -1
- package/dist/catalog/providers/nvidia.json +1 -1
- package/dist/catalog/providers/openai-codex.json +1 -1
- package/dist/catalog/providers/openai.json +1 -1
- package/dist/catalog/providers/opencode-go.json +1 -1
- package/dist/catalog/providers/opencode.json +1 -1
- package/dist/catalog/providers/openrouter.json +1 -1
- package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
- package/dist/catalog/publication.json +131 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -0
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +52 -27
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +5 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +7 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +18 -6
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/catalog-cache-scope.d.ts +3 -0
- package/dist/core/catalog-cache-scope.d.ts.map +1 -0
- package/dist/core/catalog-cache-scope.js +12 -0
- package/dist/core/catalog-cache-scope.js.map +1 -0
- package/dist/core/catalog-merge.d.ts +2 -0
- package/dist/core/catalog-merge.d.ts.map +1 -1
- package/dist/core/catalog-merge.js +29 -2
- package/dist/core/catalog-merge.js.map +1 -1
- package/dist/core/catalog-refresh-polling.d.ts +8 -0
- package/dist/core/catalog-refresh-polling.d.ts.map +1 -0
- package/dist/core/catalog-refresh-polling.js +30 -0
- package/dist/core/catalog-refresh-polling.js.map +1 -0
- package/dist/core/codex-catalog.d.ts +3 -0
- package/dist/core/codex-catalog.d.ts.map +1 -0
- package/dist/core/codex-catalog.js +15 -0
- package/dist/core/codex-catalog.js.map +1 -0
- package/dist/core/context-breakdown.d.ts +2 -0
- package/dist/core/context-breakdown.d.ts.map +1 -1
- package/dist/core/context-breakdown.js +6 -2
- package/dist/core/context-breakdown.js.map +1 -1
- package/dist/core/customize.d.ts +2 -4
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +2 -8
- package/dist/core/customize.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +3 -4
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +54 -82
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/injected-prompt.d.ts +3 -3
- package/dist/core/injected-prompt.d.ts.map +1 -1
- package/dist/core/injected-prompt.js +2 -7
- package/dist/core/injected-prompt.js.map +1 -1
- package/dist/core/large-subagent-launch.d.ts +13 -0
- package/dist/core/large-subagent-launch.d.ts.map +1 -0
- package/dist/core/large-subagent-launch.js +54 -0
- package/dist/core/large-subagent-launch.js.map +1 -0
- package/dist/core/live-catalog.d.ts +5 -2
- package/dist/core/live-catalog.d.ts.map +1 -1
- package/dist/core/live-catalog.js +108 -27
- package/dist/core/live-catalog.js.map +1 -1
- package/dist/core/model-instructions.d.ts +24 -0
- package/dist/core/model-instructions.d.ts.map +1 -0
- package/dist/core/model-instructions.js +123 -0
- package/dist/core/model-instructions.js.map +1 -0
- package/dist/core/model-runtime.d.ts +8 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +64 -12
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/official-catalog.d.ts +4 -0
- package/dist/core/official-catalog.d.ts.map +1 -1
- package/dist/core/official-catalog.js +86 -21
- package/dist/core/official-catalog.js.map +1 -1
- package/dist/core/permissions.d.ts +10 -11
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +107 -40
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +10 -1
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/resource-loader.d.ts +3 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +13 -4
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-bridges.d.ts +4 -0
- package/dist/core/runtime-bridges.d.ts.map +1 -0
- package/dist/core/runtime-bridges.js +16 -0
- package/dist/core/runtime-bridges.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -6
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +32 -17
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-tools-bridge.d.ts +35 -0
- package/dist/core/settings-tools-bridge.d.ts.map +1 -0
- package/dist/core/settings-tools-bridge.js +56 -0
- package/dist/core/settings-tools-bridge.js.map +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +3 -2
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/approval.d.ts.map +1 -1
- package/dist/gateway/approval.js +4 -3
- package/dist/gateway/approval.js.map +1 -1
- package/dist/gateway/commands.d.ts +1 -1
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +1 -18
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +3 -2
- package/dist/gateway/cron.js.map +1 -1
- package/dist/gateway/router.d.ts +1 -1
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +1 -1
- package/dist/gateway/router.js.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +108 -58
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +2 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +18 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +1 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +4 -32
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +2 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/injected-prompt-message.d.ts +1 -1
- package/dist/modes/interactive/components/injected-prompt-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/injected-prompt-message.js +1 -1
- package/dist/modes/interactive/components/injected-prompt-message.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/plan-message.d.ts +1 -3
- package/dist/modes/interactive/components/plan-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/plan-message.js +1 -16
- package/dist/modes/interactive/components/plan-message.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +8 -5
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +71 -31
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +2 -19
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +163 -177
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/moon.json +0 -1
- package/dist/modes/interactive/theme/theme-schema.json +3 -3
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +95 -90
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/startup/interactive-view.d.ts +55 -0
- package/dist/startup/interactive-view.d.ts.map +1 -0
- package/dist/startup/interactive-view.js +332 -0
- package/dist/startup/interactive-view.js.map +1 -0
- package/dist/startup/launch-routing.d.ts +8 -0
- package/dist/startup/launch-routing.d.ts.map +1 -0
- package/dist/startup/launch-routing.js +29 -0
- package/dist/startup/launch-routing.js.map +1 -0
- package/dist/startup/startup-milestones.d.ts +4 -0
- package/dist/startup/startup-milestones.d.ts.map +1 -0
- package/dist/startup/startup-milestones.js +14 -0
- package/dist/startup/startup-milestones.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +10 -4
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/docs/features.md +9 -9
- package/docs/interactive-startup.md +58 -0
- package/docs/keybindings.md +1 -1
- package/docs/model-catalog.md +29 -0
- package/docs/quickstart.md +3 -2
- package/docs/settings.md +4 -4
- package/docs/terminal-setup.md +2 -2
- package/docs/termux.md +1 -1
- package/docs/usage.md +4 -3
- package/docs/windows.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/README.md +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +16 -16
- package/dist/core/swarm.d.ts +0 -54
- package/dist/core/swarm.d.ts.map +0 -1
- package/dist/core/swarm.js +0 -119
- package/dist/core/swarm.js.map +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Interactive startup plan
|
|
2
|
+
|
|
3
|
+
Paint the normal lunR interface before importing the agent runtime. Models,
|
|
4
|
+
resources, session restoration, extensions, and maintenance may take longer;
|
|
5
|
+
they must not determine when the user first sees the chatbox.
|
|
6
|
+
|
|
7
|
+
PR #41 starts a generic editor with a separate startup message, then changes the
|
|
8
|
+
layout and editor after hydration. Its first-frame marker also accepts terminal
|
|
9
|
+
setup writes. Keep its useful early routing and startup-dialog work, but replace
|
|
10
|
+
the temporary presentation and measure actual rendered content.
|
|
11
|
+
|
|
12
|
+
1. Start a persistent view using the existing themed ChatboxEditor,
|
|
13
|
+
BootScreenComponent, and stats renderer. Read only local display preferences.
|
|
14
|
+
Reuse the terminal and editor when InteractiveMode attaches. Unknown runtime
|
|
15
|
+
data fills in later; no second startup screen or editor reset.
|
|
16
|
+
2. Begin runtime imports after a complete TUI frame has been written. Keep
|
|
17
|
+
session selection and trust dialogs on that terminal. Preserve drafts,
|
|
18
|
+
cursor position, and pasted images while initialization proceeds.
|
|
19
|
+
3. Hold submissions until session and extension initialization completes, then
|
|
20
|
+
dispatch through the normal command/message handler. Keep failures visible
|
|
21
|
+
and allow exit while loading. Defer session retention and other maintenance.
|
|
22
|
+
4. Verify real frame content without a runtime, editor identity across binding,
|
|
23
|
+
delayed/failing initialization, command routing, and noninteractive launches.
|
|
24
|
+
Benchmark first content frame separately from runtime and feature readiness,
|
|
25
|
+
using isolated settings and both cold and warm compile caches.
|
|
26
|
+
|
|
27
|
+
This PR targets startup only. The permission, rollback, orchestrator, and release
|
|
28
|
+
changes in #41 remain separate. Custom extension themes/editors become available
|
|
29
|
+
when their resources load; the builtin moon interface is available immediately.
|
|
30
|
+
|
|
31
|
+
## Validation
|
|
32
|
+
|
|
33
|
+
The Node CLI keeps one terminal and one moon editor through attachment. Enter
|
|
34
|
+
during loading holds the current draft. Edits continue to change that draft;
|
|
35
|
+
Escape cancels the pending submission. Commands run through the normal handler
|
|
36
|
+
after features are ready. A failed feature load preserves the draft and reports
|
|
37
|
+
the error instead of submitting it.
|
|
38
|
+
|
|
39
|
+
The shipped moon theme avoids loading the schema compiler and highlighter before
|
|
40
|
+
paint. Custom theme validation and syntax highlighting use the same implementations
|
|
41
|
+
on first use. Footer git discovery and diffs run asynchronously.
|
|
42
|
+
|
|
43
|
+
After the offline builds, run:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
node scripts/check-interactive-first-paint.mjs
|
|
47
|
+
node scripts/profile-coding-agent-node.mjs --mode tui --skip-build --isolated-agent-dir --runs 3
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The first command exercises the built CLI with runtime loading stalled or failed.
|
|
51
|
+
It verifies the real chatbox appears before hydration, accepts edits while
|
|
52
|
+
waiting, and restores the terminal on exit. The Vitest integration also checks
|
|
53
|
+
editor identity, cursor position, images, dialogs, and delayed command dispatch.
|
|
54
|
+
|
|
55
|
+
On Windows with Node 24.15.0 and moon, three fresh compile-cache runs wrote the
|
|
56
|
+
first complete frame in 94.8–95.3ms. Three warm runs measured 96.6–99.1ms. Feature
|
|
57
|
+
readiness came at 2.01–2.43s. Milestones include Node entry-module loading.
|
|
58
|
+
Terminal compositor latency and compiled Bun binaries were not measured.
|
package/docs/keybindings.md
CHANGED
|
@@ -87,7 +87,7 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
|
|
|
87
87
|
| `app.exit` | `ctrl+d` | Exit (when editor empty) |
|
|
88
88
|
| `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
|
|
89
89
|
| `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
|
|
90
|
-
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image from clipboard |
|
|
90
|
+
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image from clipboard; `/paste-image` needs no shortcut |
|
|
91
91
|
|
|
92
92
|
### Sessions
|
|
93
93
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Model catalog maintenance
|
|
2
|
+
|
|
3
|
+
Routine catalog updates use HTTP requests and deterministic TypeScript normalization, with no AI inference or agent runs.
|
|
4
|
+
|
|
5
|
+
## Discovery and precedence
|
|
6
|
+
|
|
7
|
+
The public generator combines models.dev, OpenRouter, Vercel, NVIDIA, OpenCode Zen/Go, and OpenAI's published Codex metadata. Codex model IDs come from that upstream document, not a handwritten list.
|
|
8
|
+
|
|
9
|
+
At runtime, supported providers also expose live discovery. Codex uses the authenticated account-specific `/codex/models` endpoint, including its client-version query and account header. The client version is resolved from official npm release metadata; only JSON metadata is fetched, never package code. If that lookup fails, discovery uses its last successful version or the bundled fallback.
|
|
10
|
+
|
|
11
|
+
Provider-supplied capability fields override older published metadata for the same model. Missing fields use existing exact-model metadata or conservative defaults; unknown prices are marked unavailable in the picker. Explicit `models.json` and extension model configuration are applied last. API-specific transport compatibility remains code-owned.
|
|
12
|
+
|
|
13
|
+
A successful Codex account list controls picker availability, including hidden models. Existing model records remain resolvable for saved sessions and explicit configuration. Codex context limits are route-specific: its default context is not necessarily the maximum advertised for the OpenAI API. Unknown reasoning levels are retained as metadata but are not offered or sent until lunR supports them. Server prompt templates are not imported.
|
|
14
|
+
|
|
15
|
+
## Refresh and recovery
|
|
16
|
+
|
|
17
|
+
Interactive startup uses cached or bundled data without catalog network requests. After prompt readiness, an idle poll checks for refreshes; successful automatic refreshes are limited to once an hour per runtime/account configuration, with a one-minute retry delay on failure. Active turns retain their model object, and shutdown cancels the poll. `/refresh` bypasses the freshness gate. The model picker and CLI model listing also request a freshness check; unresolved explicit CLI models get a discovery attempt.
|
|
18
|
+
|
|
19
|
+
Live caches are scoped to provider, endpoint, and credential/account identity using a digest. A response from an account changed during the request is discarded. Legacy unscoped public provider caches remain readable; unscoped Codex account caches do not. A failed request retains the last good data for the same scope.
|
|
20
|
+
|
|
21
|
+
## Publication
|
|
22
|
+
|
|
23
|
+
The hourly `publish-model-catalog.yml` workflow validates sources and publication contracts, then publishes data directly to the dedicated `model-catalog` branch. Application code still goes through normal review. Each publication has an immutable content-addressed snapshot, per-shard checksums, source fetch timestamps/status, and a manifest. Clients fetch the manifest and only the shards for providers with stored credentials; the old master-branch index remains a fallback during migration. Custom catalog mirrors retain the legacy index/shard format.
|
|
24
|
+
|
|
25
|
+
Source requests have bounded retries and a last-good cache. Invalid schemas and suspicious drops greater than 25% for a source/provider previously containing at least ten models reuse cached data and appear in the workflow summary/manifest. Other sources can still update. A first run without a valid source cache fails closed. The final bundle must contain at least 500 models and include Anthropic, OpenAI, Codex, and OpenRouter, with valid limits, inputs, and prices.
|
|
26
|
+
|
|
27
|
+
For an upstream outage, inspect the workflow summary and manifest source status; the timestamps describe when data was actually fetched. For a legitimate large removal caught by the guard, review the upstream change before invalidating that source's last-good Actions cache. New provider protocols or incompatible capability schemas still require adapter work; discovery cannot grant access an account does not have.
|
|
28
|
+
|
|
29
|
+
`npm run sync:model-catalog` regenerates the checked-in offline bundle. Normal release builds remain offline and copy that bundle into the CLI package. Deploying the runtime changes requires a new CLI release; the publication workflow becomes active after it lands on the default branch.
|
package/docs/quickstart.md
CHANGED
|
@@ -121,7 +121,8 @@ lunR loads context files at startup. Add an `AGENTS.md` file to tell it how to w
|
|
|
121
121
|
|
|
122
122
|
lunR loads:
|
|
123
123
|
|
|
124
|
-
- `~/.lunr/agent/AGENTS.md` for global instructions
|
|
124
|
+
- `~/.lunr/agent/agents/AGENTS.md` for global instructions
|
|
125
|
+
- `~/.lunr/agent/agents/<model-name>/AGENTS.md` for optional model-specific instructions enabled in `/settings`
|
|
125
126
|
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
126
127
|
|
|
127
128
|
Restart lunR, or run `/reload`, after changing context files.
|
|
@@ -137,7 +138,7 @@ lunr @README.md "Summarize this"
|
|
|
137
138
|
lunr @src/app.ts @src/app.test.ts "Review these together"
|
|
138
139
|
```
|
|
139
140
|
|
|
140
|
-
Paste images with Ctrl+V
|
|
141
|
+
Paste images with Ctrl+V or Alt+V on Windows. VS Code owns those keys, so `/paste-image` pastes without a terminal shortcut. The editor inserts `[image_1]`, `[image_2]`, … chips instead of a temp path. Dragging images into supported terminals also works.
|
|
141
142
|
|
|
142
143
|
### Run shell commands
|
|
143
144
|
|
package/docs/settings.md
CHANGED
|
@@ -64,6 +64,8 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
|
|
|
64
64
|
| `memoryCharCap` | number | `5000` | Durable-facts memory character cap (1–30000) |
|
|
65
65
|
| `sessionRetentionDays` | number | `30` | Delete session files older than N days at launch; `0` keeps forever |
|
|
66
66
|
| `modelTiers` | object | - | Enable model tiers and per-tier thinking |
|
|
67
|
+
| `modelInstructions` | object | `{ enabled: false, mode: "both" }` | Model-specific instructions and whether they append to or replace global instructions |
|
|
68
|
+
| `confirmLargeSubagentLaunches` | boolean | `true` | Ask once before aggregate launches of three or more children outside Auto mode |
|
|
67
69
|
| `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`PI_EXPERIMENTAL=1`) |
|
|
68
70
|
| `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
|
|
69
71
|
| `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
|
|
@@ -224,21 +226,19 @@ When multiple sources specify a session directory, precedence is `--session-dir`
|
|
|
224
226
|
|
|
225
227
|
| Setting | Type | Default | Description |
|
|
226
228
|
|---------|------|---------|-------------|
|
|
227
|
-
| `gutterRail` | boolean | `true` | Thin left rail around each turn |
|
|
228
|
-
| `promptSymbol` | boolean | `true` | Show the ☾ › prompt glyph on the editor's first line |
|
|
229
229
|
| `footerMcp` | boolean | `true` | Show MCP status in the footer |
|
|
230
230
|
| `footerLsp` | boolean | `false` | Show LSP status in the footer |
|
|
231
231
|
| `footerContext` | boolean | `true` | Show context-usage pct/window |
|
|
232
232
|
| `footerTokens` | boolean | `true` | Show ↑in ↓out token totals |
|
|
233
233
|
| `footerCacheHitRate` | boolean | `true` | Show the latest prompt cache-hit rate when reported |
|
|
234
234
|
| `footerTps` | boolean | `true` | Show tokens/second. Independent of feature statuses |
|
|
235
|
-
| `footerStatuses` | boolean | `true` | Show plan
|
|
235
|
+
| `footerStatuses` | boolean | `true` | Show plan and goal status segments |
|
|
236
236
|
| `footerGit` | boolean | `true` | Show git branch + added/removed |
|
|
237
237
|
| `footerPlan` | boolean | `true` | Show the subscription usage segment |
|
|
238
238
|
| `footerPlanBar` | boolean | `true` | Show the █░ fill; off keeps the percent only |
|
|
239
239
|
| `planUsageWindow` | string | `"5h"` | Preferred plan window: `"5h"` or `"weekly"`. Missing 5h falls back to weekly |
|
|
240
240
|
|
|
241
|
-
Customize these from `/settings` → Customize
|
|
241
|
+
Customize these from `/settings` → Customize as well.
|
|
242
242
|
|
|
243
243
|
### Cron, rollback, subscriptions
|
|
244
244
|
|
package/docs/terminal-setup.md
CHANGED
|
@@ -97,7 +97,7 @@ Add to `keybindings.json`:
|
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
On Windows,
|
|
100
|
+
On Windows, VS Code owns `Ctrl+V` and uses `Alt+V` as the View menu mnemonic. Forward lunR's `Alt+V` image-paste binding explicitly:
|
|
101
101
|
|
|
102
102
|
```json
|
|
103
103
|
{
|
|
@@ -108,7 +108,7 @@ On Windows, lunR pastes clipboard images with `Alt+V` (`app.clipboard.pasteImage
|
|
|
108
108
|
}
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
A successful paste toasts `Pasted [image_1]` and inserts that chip in the editor. Submit keeps the label in the chat card and attaches the image to the model. `Clipboard contains no image
|
|
111
|
+
A successful paste toasts `Pasted [image_1]` and inserts that chip in the editor. If VS Code still owns the key, `/paste-image` invokes the same operation without depending on any terminal shortcut. Submit keeps the label in the chat card and attaches the image to the model. `Clipboard contains no image` means the command arrived but the OS clipboard had no image.
|
|
112
112
|
|
|
113
113
|
## Windows Terminal
|
|
114
114
|
|
package/docs/termux.md
CHANGED
|
@@ -34,7 +34,7 @@ Image clipboard is not supported on Termux (the `ctrl+v` image paste feature wil
|
|
|
34
34
|
|
|
35
35
|
## Example AGENTS.md for Termux
|
|
36
36
|
|
|
37
|
-
Create `~/.lunr/agent/AGENTS.md` to help the agent understand the Termux environment:
|
|
37
|
+
Create `~/.lunr/agent/agents/AGENTS.md` to help the agent understand the Termux environment:
|
|
38
38
|
|
|
39
39
|
````markdown
|
|
40
40
|
# Agent Environment: Termux on Android
|
package/docs/usage.md
CHANGED
|
@@ -23,7 +23,7 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
|
|
|
23
23
|
| Path completion | Press Tab to complete paths |
|
|
24
24
|
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
25
25
|
| Copy response | Ctrl+X copies the last assistant message; in `/tree`, it copies the selected message |
|
|
26
|
-
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal. Images insert `[image_n]` chips
|
|
26
|
+
| Images | Paste with Ctrl+V, Alt+V on Windows, `/paste-image`, or drag into the terminal. VS Code must forward Alt+V. Images insert `[image_n]` chips. |
|
|
27
27
|
| Shell command | `!command` runs and sends output to the model |
|
|
28
28
|
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
29
29
|
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
@@ -46,6 +46,7 @@ Built-in commands (from `slash-commands.ts`):
|
|
|
46
46
|
| `/import` | Import and resume a session from a JSONL file |
|
|
47
47
|
| `/share` | Share session as a secret GitHub gist. HTML viewer still defaults to https://pi.dev/session/ (leftover, not lunR-hosted). Override with `PI_SHARE_VIEWER_URL`. |
|
|
48
48
|
| `/copy` | Copy last agent message to clipboard |
|
|
49
|
+
| `/paste-image` | Paste an image from the clipboard |
|
|
49
50
|
| `/name`, `/title` | Set session display name |
|
|
50
51
|
| `/session` | Show session info and stats |
|
|
51
52
|
| `/usage` | This-session token totals, context, and every stored subscription plan (no `/token-usage`) |
|
|
@@ -68,7 +69,6 @@ Built-in commands (from `slash-commands.ts`):
|
|
|
68
69
|
| `/logout`, `/deauth` | Remove provider authentication |
|
|
69
70
|
| `/new` | Start a new session |
|
|
70
71
|
| `/init` | Generate a starter AGENTS.md for this project |
|
|
71
|
-
| `/swarm` | Orchestrate parallel subagents for a complex task |
|
|
72
72
|
| `/compact` | Manually compact the session context |
|
|
73
73
|
| `/resume`, `/sessions` | Browse and resume sessions |
|
|
74
74
|
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
@@ -120,7 +120,8 @@ See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
|
120
120
|
|
|
121
121
|
lunR loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
122
122
|
|
|
123
|
-
- `~/.lunr/agent/AGENTS.md` for global instructions
|
|
123
|
+
- `~/.lunr/agent/agents/AGENTS.md` for global instructions
|
|
124
|
+
- `~/.lunr/agent/agents/<model-name>/AGENTS.md` for optional model-specific instructions enabled in `/settings`
|
|
124
125
|
- parent directories, walking up from the current working directory
|
|
125
126
|
- the current directory
|
|
126
127
|
|
package/docs/windows.md
CHANGED
|
@@ -18,7 +18,7 @@ For most users, [Git for Windows](https://git-scm.com/download/win) is sufficien
|
|
|
18
18
|
|
|
19
19
|
## Image paste
|
|
20
20
|
|
|
21
|
-
Ctrl+V is the terminal's paste. lunR image paste is **Alt+V**. The editor inserts `[image_n]` chips, not a temp path. VS Code
|
|
21
|
+
Ctrl+V is the terminal's paste. lunR image paste is **Alt+V**. The editor inserts `[image_n]` chips, not a temp path. VS Code must forward Alt+V with `sendSequence` `\u001b[118;3u`; `/paste-image` works without a terminal shortcut.
|
|
22
22
|
|
|
23
23
|
## LSP
|
|
24
24
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.15",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.15",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.15",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Subagent Example (sample)
|
|
2
2
|
|
|
3
|
-
This is an **Extension API sample**, not lunR's product subagent implementation. lunR ships baked-in subagents (always fresh;
|
|
3
|
+
This is an **Extension API sample**, not lunR's product subagent implementation. lunR ships baked-in subagents (always fresh; aggregate confirmation for 3+ parallel). See [docs/features.md](../../../docs/features.md).
|
|
4
4
|
|
|
5
5
|
Delegate tasks to specialized subagents with isolated context windows.
|
|
6
6
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.15",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashx-j/lunr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"description": "lunR — terminal coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"shrinkwrap": "node ../../scripts/generate-coding-agent-shrinkwrap.mjs"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ashx-j/lunr-agent": "^0.2.
|
|
41
|
-
"@ashx-j/lunr-ai": "^0.2.
|
|
42
|
-
"@ashx-j/lunr-tui": "^0.2.
|
|
43
|
-
"@modelcontextprotocol/ext-apps": "
|
|
40
|
+
"@ashx-j/lunr-agent": "^0.2.15",
|
|
41
|
+
"@ashx-j/lunr-ai": "^0.2.15",
|
|
42
|
+
"@ashx-j/lunr-tui": "^0.2.15",
|
|
43
|
+
"@modelcontextprotocol/ext-apps": "1.7.4",
|
|
44
44
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
45
|
-
"@mozilla/readability": "
|
|
45
|
+
"@mozilla/readability": "0.6.0",
|
|
46
46
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
47
47
|
"@sinclair/typebox": "npm:typebox@1.1.38",
|
|
48
48
|
"chalk": "5.6.2",
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
"hosted-git-info": "9.0.3",
|
|
56
56
|
"ignore": "7.0.5",
|
|
57
57
|
"jiti": "2.7.0",
|
|
58
|
-
"linkedom": "
|
|
58
|
+
"linkedom": "0.16.11",
|
|
59
59
|
"minimatch": "10.2.5",
|
|
60
|
-
"open": "
|
|
61
|
-
"p-limit": "
|
|
60
|
+
"open": "10.2.0",
|
|
61
|
+
"p-limit": "6.2.0",
|
|
62
62
|
"proper-lockfile": "4.1.2",
|
|
63
|
-
"recheck": "
|
|
63
|
+
"recheck": "4.5.0",
|
|
64
64
|
"semver": "7.8.0",
|
|
65
|
-
"tree-sitter-wasms": "
|
|
66
|
-
"turndown": "
|
|
65
|
+
"tree-sitter-wasms": "0.1.13",
|
|
66
|
+
"turndown": "7.2.4",
|
|
67
67
|
"typebox": "1.1.38",
|
|
68
68
|
"undici": "8.5.0",
|
|
69
69
|
"unicode-animations": "1.0.3",
|
|
70
|
-
"unpdf": "
|
|
71
|
-
"vscode-languageserver-protocol": "
|
|
72
|
-
"web-tree-sitter": "
|
|
70
|
+
"unpdf": "1.6.2",
|
|
71
|
+
"vscode-languageserver-protocol": "3.18.2",
|
|
72
|
+
"web-tree-sitter": "0.24.7",
|
|
73
73
|
"yaml": "2.9.0",
|
|
74
|
-
"zod": "
|
|
74
|
+
"zod": "4.4.3"
|
|
75
75
|
},
|
|
76
76
|
"overrides": {
|
|
77
77
|
"rimraf": "6.1.2",
|
package/dist/core/swarm.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* lunR: reusable swarm prompt builder.
|
|
3
|
-
*
|
|
4
|
-
* Moved out of interactive-mode so the gateway can decompose tasks across
|
|
5
|
-
* parallel subagents the same way the TUI does.
|
|
6
|
-
*/
|
|
7
|
-
export declare function buildSwarmPrompt(task: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* lunR: agent-swarm auto-activation gate helpers.
|
|
10
|
-
*
|
|
11
|
-
* When the model launches more than SWARM_APPROVAL_THRESHOLD parallel subagents
|
|
12
|
-
* in one `subagent` `tasks`/`chain.parallel` call, or that many same-turn SINGLE
|
|
13
|
-
* `subagent` calls, that counts as an auto-activated agent swarm and requires
|
|
14
|
-
* user approval in every permission mode except `auto` (see core/permissions.ts).
|
|
15
|
-
* An explicit /swarm turn is pre-approved because the user already asked for the swarm.
|
|
16
|
-
*/
|
|
17
|
-
/** Parallel-subagent count above which the swarm approval gate engages. */
|
|
18
|
-
export declare const SWARM_APPROVAL_THRESHOLD = 2;
|
|
19
|
-
/**
|
|
20
|
-
* Effective number of parallel subagents a `subagent` tool call will launch:
|
|
21
|
-
* the `tasks` array (with `count` multipliers) plus any `chain` step `parallel`
|
|
22
|
-
* fan-out blocks. Sequential chain steps and single-agent calls count as 0.
|
|
23
|
-
* Dynamic `expand` fan-out has no static count and is not gated.
|
|
24
|
-
*/
|
|
25
|
-
export declare function effectiveSwarmCount(args: Record<string, unknown>): number;
|
|
26
|
-
interface AssistantMessageLike {
|
|
27
|
-
content?: ReadonlyArray<{
|
|
28
|
-
type?: string;
|
|
29
|
-
name?: string;
|
|
30
|
-
arguments?: unknown;
|
|
31
|
-
}>;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Parallel subagent count for the swarm gate. Uses this call's `tasks` / chain
|
|
35
|
-
* `parallel` blocks, plus every other same-turn SINGLE `subagent` call so three
|
|
36
|
-
* sibling singles still trip the >2 approval gate.
|
|
37
|
-
*/
|
|
38
|
-
export declare function effectiveSwarmCountForTurn(args: Record<string, unknown>, assistantMessage?: AssistantMessageLike): number;
|
|
39
|
-
interface BranchEntryLike {
|
|
40
|
-
type: string;
|
|
41
|
-
message?: {
|
|
42
|
-
role?: string;
|
|
43
|
-
content?: unknown;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* True when the current turn started from an explicit /swarm prompt (the most
|
|
48
|
-
* recent user message carries the literal `[SWARM MODE]` prefix). Both the TUI
|
|
49
|
-
* and the gateway inject the same buildSwarmPrompt text, so this works on both
|
|
50
|
-
* surfaces without extra state.
|
|
51
|
-
*/
|
|
52
|
-
export declare function isExplicitSwarmTurn(branch: readonly BranchEntryLike[]): boolean;
|
|
53
|
-
export {};
|
|
54
|
-
//# sourceMappingURL=swarm.d.ts.map
|
package/dist/core/swarm.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../../src/core/swarm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUrD;AAED;;;;;;;;GAQG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAe1C;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAczE;AAaD,UAAU,oBAAoB;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC/E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,gBAAgB,CAAC,EAAE,oBAAoB,GACrC,MAAM,CAYR;AAED,UAAU,eAAe;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/C;AAaD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAO/E","sourcesContent":["/**\n * lunR: reusable swarm prompt builder.\n *\n * Moved out of interactive-mode so the gateway can decompose tasks across\n * parallel subagents the same way the TUI does.\n */\n\nexport function buildSwarmPrompt(task: string): string {\n\treturn `[SWARM MODE] Task: ${task}\nAct as an orchestrator. 1) Decompose into 3-8 independent subtasks. 2) Launch them\nin ONE parallel subagent call (async:false) as generic children, each with task,\ndescription, and permissions (\"full\" or \"read-only\"; omit permissions for full).\nUse read-only children for inspection/review and full children only when edits\nare required. Pick a model tier per subtask. 3) Synthesize the results and report.\nRules: max 8 concurrent children; no nested fan-out; if a subtask fails, retry\nonce with the heavy tier before giving up on it; keep your final report under\n100 lines with per-subtask status.`;\n}\n\n/**\n * lunR: agent-swarm auto-activation gate helpers.\n *\n * When the model launches more than SWARM_APPROVAL_THRESHOLD parallel subagents\n * in one `subagent` `tasks`/`chain.parallel` call, or that many same-turn SINGLE\n * `subagent` calls, that counts as an auto-activated agent swarm and requires\n * user approval in every permission mode except `auto` (see core/permissions.ts).\n * An explicit /swarm turn is pre-approved because the user already asked for the swarm.\n */\n\n/** Parallel-subagent count above which the swarm approval gate engages. */\nexport const SWARM_APPROVAL_THRESHOLD = 2;\n\nfunction countEntry(item: unknown): number {\n\tconst count = item && typeof item === \"object\" ? (item as { count?: unknown }).count : undefined;\n\treturn typeof count === \"number\" && Number.isInteger(count) && count >= 1 ? count : 1;\n}\n\nfunction isManagementCall(args: Record<string, unknown>): boolean {\n\treturn typeof args.action === \"string\" && args.action.length > 0;\n}\n\nfunction isAsyncDetached(args: Record<string, unknown>): boolean {\n\treturn args.async === true && args.clarify !== true;\n}\n\n/**\n * Effective number of parallel subagents a `subagent` tool call will launch:\n * the `tasks` array (with `count` multipliers) plus any `chain` step `parallel`\n * fan-out blocks. Sequential chain steps and single-agent calls count as 0.\n * Dynamic `expand` fan-out has no static count and is not gated.\n */\nexport function effectiveSwarmCount(args: Record<string, unknown>): number {\n\tlet total = 0;\n\tif (Array.isArray(args.tasks)) {\n\t\tfor (const task of args.tasks) total += countEntry(task);\n\t}\n\tif (Array.isArray(args.chain)) {\n\t\tfor (const step of args.chain) {\n\t\t\tconst parallel = step && typeof step === \"object\" ? (step as { parallel?: unknown }).parallel : undefined;\n\t\t\tif (Array.isArray(parallel)) {\n\t\t\t\tfor (const child of parallel) total += countEntry(child);\n\t\t\t}\n\t\t}\n\t}\n\treturn total;\n}\n\nfunction siblingSingleCount(args: Record<string, unknown>): number {\n\tif (isManagementCall(args) || isAsyncDetached(args)) return 0;\n\tif (Array.isArray(args.tasks) || Array.isArray(args.chain)) return 0;\n\treturn typeof args.task === \"string\" &&\n\t\targs.task.length > 0 &&\n\t\ttypeof args.description === \"string\" &&\n\t\targs.description.length > 0\n\t\t? 1\n\t\t: 0;\n}\n\ninterface AssistantMessageLike {\n\tcontent?: ReadonlyArray<{ type?: string; name?: string; arguments?: unknown }>;\n}\n\n/**\n * Parallel subagent count for the swarm gate. Uses this call's `tasks` / chain\n * `parallel` blocks, plus every other same-turn SINGLE `subagent` call so three\n * sibling singles still trip the >2 approval gate.\n */\nexport function effectiveSwarmCountForTurn(\n\targs: Record<string, unknown>,\n\tassistantMessage?: AssistantMessageLike,\n): number {\n\tconst own = effectiveSwarmCount(args);\n\tconst siblingSingles = (assistantMessage?.content ?? []).reduce((total, block) => {\n\t\tif (block.type !== \"toolCall\" || block.name !== \"subagent\") return total;\n\t\tconst siblingArgs =\n\t\t\tblock.arguments && typeof block.arguments === \"object\" && !Array.isArray(block.arguments)\n\t\t\t\t? (block.arguments as Record<string, unknown>)\n\t\t\t\t: undefined;\n\t\tif (!siblingArgs) return total;\n\t\treturn total + siblingSingleCount(siblingArgs);\n\t}, 0);\n\treturn Math.max(own, siblingSingles);\n}\n\ninterface BranchEntryLike {\n\ttype: string;\n\tmessage?: { role?: string; content?: unknown };\n}\n\nfunction messageText(content: unknown): string {\n\tif (typeof content === \"string\") return content;\n\tif (Array.isArray(content)) {\n\t\treturn content\n\t\t\t.filter((c) => c && typeof c === \"object\" && (c as { type?: unknown }).type === \"text\")\n\t\t\t.map((c) => String((c as { text?: unknown }).text ?? \"\"))\n\t\t\t.join(\"\");\n\t}\n\treturn \"\";\n}\n\n/**\n * True when the current turn started from an explicit /swarm prompt (the most\n * recent user message carries the literal `[SWARM MODE]` prefix). Both the TUI\n * and the gateway inject the same buildSwarmPrompt text, so this works on both\n * surfaces without extra state.\n */\nexport function isExplicitSwarmTurn(branch: readonly BranchEntryLike[]): boolean {\n\tfor (let i = branch.length - 1; i >= 0; i--) {\n\t\tconst entry = branch[i];\n\t\tif (entry.type !== \"message\" || entry.message?.role !== \"user\") continue;\n\t\treturn messageText(entry.message.content).startsWith(\"[SWARM MODE]\");\n\t}\n\treturn false;\n}\n"]}
|
package/dist/core/swarm.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* lunR: reusable swarm prompt builder.
|
|
3
|
-
*
|
|
4
|
-
* Moved out of interactive-mode so the gateway can decompose tasks across
|
|
5
|
-
* parallel subagents the same way the TUI does.
|
|
6
|
-
*/
|
|
7
|
-
export function buildSwarmPrompt(task) {
|
|
8
|
-
return `[SWARM MODE] Task: ${task}
|
|
9
|
-
Act as an orchestrator. 1) Decompose into 3-8 independent subtasks. 2) Launch them
|
|
10
|
-
in ONE parallel subagent call (async:false) as generic children, each with task,
|
|
11
|
-
description, and permissions ("full" or "read-only"; omit permissions for full).
|
|
12
|
-
Use read-only children for inspection/review and full children only when edits
|
|
13
|
-
are required. Pick a model tier per subtask. 3) Synthesize the results and report.
|
|
14
|
-
Rules: max 8 concurrent children; no nested fan-out; if a subtask fails, retry
|
|
15
|
-
once with the heavy tier before giving up on it; keep your final report under
|
|
16
|
-
100 lines with per-subtask status.`;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* lunR: agent-swarm auto-activation gate helpers.
|
|
20
|
-
*
|
|
21
|
-
* When the model launches more than SWARM_APPROVAL_THRESHOLD parallel subagents
|
|
22
|
-
* in one `subagent` `tasks`/`chain.parallel` call, or that many same-turn SINGLE
|
|
23
|
-
* `subagent` calls, that counts as an auto-activated agent swarm and requires
|
|
24
|
-
* user approval in every permission mode except `auto` (see core/permissions.ts).
|
|
25
|
-
* An explicit /swarm turn is pre-approved because the user already asked for the swarm.
|
|
26
|
-
*/
|
|
27
|
-
/** Parallel-subagent count above which the swarm approval gate engages. */
|
|
28
|
-
export const SWARM_APPROVAL_THRESHOLD = 2;
|
|
29
|
-
function countEntry(item) {
|
|
30
|
-
const count = item && typeof item === "object" ? item.count : undefined;
|
|
31
|
-
return typeof count === "number" && Number.isInteger(count) && count >= 1 ? count : 1;
|
|
32
|
-
}
|
|
33
|
-
function isManagementCall(args) {
|
|
34
|
-
return typeof args.action === "string" && args.action.length > 0;
|
|
35
|
-
}
|
|
36
|
-
function isAsyncDetached(args) {
|
|
37
|
-
return args.async === true && args.clarify !== true;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Effective number of parallel subagents a `subagent` tool call will launch:
|
|
41
|
-
* the `tasks` array (with `count` multipliers) plus any `chain` step `parallel`
|
|
42
|
-
* fan-out blocks. Sequential chain steps and single-agent calls count as 0.
|
|
43
|
-
* Dynamic `expand` fan-out has no static count and is not gated.
|
|
44
|
-
*/
|
|
45
|
-
export function effectiveSwarmCount(args) {
|
|
46
|
-
let total = 0;
|
|
47
|
-
if (Array.isArray(args.tasks)) {
|
|
48
|
-
for (const task of args.tasks)
|
|
49
|
-
total += countEntry(task);
|
|
50
|
-
}
|
|
51
|
-
if (Array.isArray(args.chain)) {
|
|
52
|
-
for (const step of args.chain) {
|
|
53
|
-
const parallel = step && typeof step === "object" ? step.parallel : undefined;
|
|
54
|
-
if (Array.isArray(parallel)) {
|
|
55
|
-
for (const child of parallel)
|
|
56
|
-
total += countEntry(child);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return total;
|
|
61
|
-
}
|
|
62
|
-
function siblingSingleCount(args) {
|
|
63
|
-
if (isManagementCall(args) || isAsyncDetached(args))
|
|
64
|
-
return 0;
|
|
65
|
-
if (Array.isArray(args.tasks) || Array.isArray(args.chain))
|
|
66
|
-
return 0;
|
|
67
|
-
return typeof args.task === "string" &&
|
|
68
|
-
args.task.length > 0 &&
|
|
69
|
-
typeof args.description === "string" &&
|
|
70
|
-
args.description.length > 0
|
|
71
|
-
? 1
|
|
72
|
-
: 0;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Parallel subagent count for the swarm gate. Uses this call's `tasks` / chain
|
|
76
|
-
* `parallel` blocks, plus every other same-turn SINGLE `subagent` call so three
|
|
77
|
-
* sibling singles still trip the >2 approval gate.
|
|
78
|
-
*/
|
|
79
|
-
export function effectiveSwarmCountForTurn(args, assistantMessage) {
|
|
80
|
-
const own = effectiveSwarmCount(args);
|
|
81
|
-
const siblingSingles = (assistantMessage?.content ?? []).reduce((total, block) => {
|
|
82
|
-
if (block.type !== "toolCall" || block.name !== "subagent")
|
|
83
|
-
return total;
|
|
84
|
-
const siblingArgs = block.arguments && typeof block.arguments === "object" && !Array.isArray(block.arguments)
|
|
85
|
-
? block.arguments
|
|
86
|
-
: undefined;
|
|
87
|
-
if (!siblingArgs)
|
|
88
|
-
return total;
|
|
89
|
-
return total + siblingSingleCount(siblingArgs);
|
|
90
|
-
}, 0);
|
|
91
|
-
return Math.max(own, siblingSingles);
|
|
92
|
-
}
|
|
93
|
-
function messageText(content) {
|
|
94
|
-
if (typeof content === "string")
|
|
95
|
-
return content;
|
|
96
|
-
if (Array.isArray(content)) {
|
|
97
|
-
return content
|
|
98
|
-
.filter((c) => c && typeof c === "object" && c.type === "text")
|
|
99
|
-
.map((c) => String(c.text ?? ""))
|
|
100
|
-
.join("");
|
|
101
|
-
}
|
|
102
|
-
return "";
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* True when the current turn started from an explicit /swarm prompt (the most
|
|
106
|
-
* recent user message carries the literal `[SWARM MODE]` prefix). Both the TUI
|
|
107
|
-
* and the gateway inject the same buildSwarmPrompt text, so this works on both
|
|
108
|
-
* surfaces without extra state.
|
|
109
|
-
*/
|
|
110
|
-
export function isExplicitSwarmTurn(branch) {
|
|
111
|
-
for (let i = branch.length - 1; i >= 0; i--) {
|
|
112
|
-
const entry = branch[i];
|
|
113
|
-
if (entry.type !== "message" || entry.message?.role !== "user")
|
|
114
|
-
continue;
|
|
115
|
-
return messageText(entry.message.content).startsWith("[SWARM MODE]");
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=swarm.js.map
|
package/dist/core/swarm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"swarm.js","sourceRoot":"","sources":["../../src/core/swarm.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * lunR: reusable swarm prompt builder.\n *\n * Moved out of interactive-mode so the gateway can decompose tasks across\n * parallel subagents the same way the TUI does.\n */\n\nexport function buildSwarmPrompt(task: string): string {\n\treturn `[SWARM MODE] Task: ${task}\nAct as an orchestrator. 1) Decompose into 3-8 independent subtasks. 2) Launch them\nin ONE parallel subagent call (async:false) as generic children, each with task,\ndescription, and permissions (\"full\" or \"read-only\"; omit permissions for full).\nUse read-only children for inspection/review and full children only when edits\nare required. Pick a model tier per subtask. 3) Synthesize the results and report.\nRules: max 8 concurrent children; no nested fan-out; if a subtask fails, retry\nonce with the heavy tier before giving up on it; keep your final report under\n100 lines with per-subtask status.`;\n}\n\n/**\n * lunR: agent-swarm auto-activation gate helpers.\n *\n * When the model launches more than SWARM_APPROVAL_THRESHOLD parallel subagents\n * in one `subagent` `tasks`/`chain.parallel` call, or that many same-turn SINGLE\n * `subagent` calls, that counts as an auto-activated agent swarm and requires\n * user approval in every permission mode except `auto` (see core/permissions.ts).\n * An explicit /swarm turn is pre-approved because the user already asked for the swarm.\n */\n\n/** Parallel-subagent count above which the swarm approval gate engages. */\nexport const SWARM_APPROVAL_THRESHOLD = 2;\n\nfunction countEntry(item: unknown): number {\n\tconst count = item && typeof item === \"object\" ? (item as { count?: unknown }).count : undefined;\n\treturn typeof count === \"number\" && Number.isInteger(count) && count >= 1 ? count : 1;\n}\n\nfunction isManagementCall(args: Record<string, unknown>): boolean {\n\treturn typeof args.action === \"string\" && args.action.length > 0;\n}\n\nfunction isAsyncDetached(args: Record<string, unknown>): boolean {\n\treturn args.async === true && args.clarify !== true;\n}\n\n/**\n * Effective number of parallel subagents a `subagent` tool call will launch:\n * the `tasks` array (with `count` multipliers) plus any `chain` step `parallel`\n * fan-out blocks. Sequential chain steps and single-agent calls count as 0.\n * Dynamic `expand` fan-out has no static count and is not gated.\n */\nexport function effectiveSwarmCount(args: Record<string, unknown>): number {\n\tlet total = 0;\n\tif (Array.isArray(args.tasks)) {\n\t\tfor (const task of args.tasks) total += countEntry(task);\n\t}\n\tif (Array.isArray(args.chain)) {\n\t\tfor (const step of args.chain) {\n\t\t\tconst parallel = step && typeof step === \"object\" ? (step as { parallel?: unknown }).parallel : undefined;\n\t\t\tif (Array.isArray(parallel)) {\n\t\t\t\tfor (const child of parallel) total += countEntry(child);\n\t\t\t}\n\t\t}\n\t}\n\treturn total;\n}\n\nfunction siblingSingleCount(args: Record<string, unknown>): number {\n\tif (isManagementCall(args) || isAsyncDetached(args)) return 0;\n\tif (Array.isArray(args.tasks) || Array.isArray(args.chain)) return 0;\n\treturn typeof args.task === \"string\" &&\n\t\targs.task.length > 0 &&\n\t\ttypeof args.description === \"string\" &&\n\t\targs.description.length > 0\n\t\t? 1\n\t\t: 0;\n}\n\ninterface AssistantMessageLike {\n\tcontent?: ReadonlyArray<{ type?: string; name?: string; arguments?: unknown }>;\n}\n\n/**\n * Parallel subagent count for the swarm gate. Uses this call's `tasks` / chain\n * `parallel` blocks, plus every other same-turn SINGLE `subagent` call so three\n * sibling singles still trip the >2 approval gate.\n */\nexport function effectiveSwarmCountForTurn(\n\targs: Record<string, unknown>,\n\tassistantMessage?: AssistantMessageLike,\n): number {\n\tconst own = effectiveSwarmCount(args);\n\tconst siblingSingles = (assistantMessage?.content ?? []).reduce((total, block) => {\n\t\tif (block.type !== \"toolCall\" || block.name !== \"subagent\") return total;\n\t\tconst siblingArgs =\n\t\t\tblock.arguments && typeof block.arguments === \"object\" && !Array.isArray(block.arguments)\n\t\t\t\t? (block.arguments as Record<string, unknown>)\n\t\t\t\t: undefined;\n\t\tif (!siblingArgs) return total;\n\t\treturn total + siblingSingleCount(siblingArgs);\n\t}, 0);\n\treturn Math.max(own, siblingSingles);\n}\n\ninterface BranchEntryLike {\n\ttype: string;\n\tmessage?: { role?: string; content?: unknown };\n}\n\nfunction messageText(content: unknown): string {\n\tif (typeof content === \"string\") return content;\n\tif (Array.isArray(content)) {\n\t\treturn content\n\t\t\t.filter((c) => c && typeof c === \"object\" && (c as { type?: unknown }).type === \"text\")\n\t\t\t.map((c) => String((c as { text?: unknown }).text ?? \"\"))\n\t\t\t.join(\"\");\n\t}\n\treturn \"\";\n}\n\n/**\n * True when the current turn started from an explicit /swarm prompt (the most\n * recent user message carries the literal `[SWARM MODE]` prefix). Both the TUI\n * and the gateway inject the same buildSwarmPrompt text, so this works on both\n * surfaces without extra state.\n */\nexport function isExplicitSwarmTurn(branch: readonly BranchEntryLike[]): boolean {\n\tfor (let i = branch.length - 1; i >= 0; i--) {\n\t\tconst entry = branch[i];\n\t\tif (entry.type !== \"message\" || entry.message?.role !== \"user\") continue;\n\t\treturn messageText(entry.message.content).startsWith(\"[SWARM MODE]\");\n\t}\n\treturn false;\n}\n"]}
|