@ashx-j/lunr-dev 0.2.21-dev.12.1 → 0.2.25-dev.13.1
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 +25 -2
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +2 -2
- 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 +1 -0
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-browser.d.ts +9 -0
- package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-browser.js +169 -0
- package/dist/builtin-extensions/lunr-browser.js.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.js +3 -3
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -1
- package/dist/builtin-extensions/lunr-plan-tools.d.ts +7 -7
- package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-plan-tools.js +12 -12
- package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -1
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +15 -0
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +5 -0
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +5 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +18 -5
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +1 -1
- 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 +4 -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 +8 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts +17 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js +45 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +10 -14
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +4 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +167 -53
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +5 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +2 -0
- 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 +4 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.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 +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +11 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +41 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +1 -0
- 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 +5 -1
- 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 +3 -2
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +23 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +20 -15
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +4 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -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 +2 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +48 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +11 -7
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/install-cli.d.ts.map +1 -1
- package/dist/cli/install-cli.js +15 -45
- package/dist/cli/install-cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +9 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +126 -29
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +23 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +255 -109
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/browser/network.d.ts +9 -0
- package/dist/core/browser/network.d.ts.map +1 -0
- package/dist/core/browser/network.js +146 -0
- package/dist/core/browser/network.js.map +1 -0
- package/dist/core/browser/runtime.d.ts +24 -0
- package/dist/core/browser/runtime.d.ts.map +1 -0
- package/dist/core/browser/runtime.js +289 -0
- package/dist/core/browser/runtime.js.map +1 -0
- package/dist/core/browser/schema.d.ts +16 -0
- package/dist/core/browser/schema.d.ts.map +1 -0
- package/dist/core/browser/schema.js +36 -0
- package/dist/core/browser/schema.js.map +1 -0
- package/dist/core/browser/settings.d.ts +8 -0
- package/dist/core/browser/settings.d.ts.map +1 -0
- package/dist/core/browser/settings.js +30 -0
- package/dist/core/browser/settings.js.map +1 -0
- package/dist/core/browser/setup.d.ts +2 -0
- package/dist/core/browser/setup.d.ts.map +1 -0
- package/dist/core/browser/setup.js +16 -0
- package/dist/core/browser/setup.js.map +1 -0
- package/dist/core/catalog-cache-scope.d.ts.map +1 -1
- package/dist/core/catalog-cache-scope.js +3 -1
- package/dist/core/catalog-cache-scope.js.map +1 -1
- package/dist/core/computer-use/image.d.ts +1 -0
- package/dist/core/computer-use/image.d.ts.map +1 -1
- package/dist/core/computer-use/image.js +8 -0
- package/dist/core/computer-use/image.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts +1 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +2 -1
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +89 -23
- package/dist/core/computer-use/workflow.js.map +1 -1
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +15 -14
- package/dist/core/customize.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +4 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +1 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/install-features.d.ts.map +1 -1
- package/dist/core/install-features.js +10 -8
- package/dist/core/install-features.js.map +1 -1
- package/dist/core/memory-cap.d.ts.map +1 -1
- package/dist/core/memory-cap.js +5 -3
- package/dist/core/memory-cap.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +3 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/model-tiers.d.ts.map +1 -1
- package/dist/core/model-tiers.js +9 -6
- package/dist/core/model-tiers.js.map +1 -1
- package/dist/core/permissions.d.ts +16 -23
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +71 -142
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts +10 -12
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +20 -19
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/process-registry.d.ts.map +1 -1
- package/dist/core/process-registry.js +6 -4
- package/dist/core/process-registry.js.map +1 -1
- package/dist/core/runtime-bridges.d.ts.map +1 -1
- package/dist/core/runtime-bridges.js +2 -0
- package/dist/core/runtime-bridges.js.map +1 -1
- package/dist/core/runtime-scope.d.ts +11 -0
- package/dist/core/runtime-scope.d.ts.map +1 -0
- package/dist/core/runtime-scope.js +3 -0
- package/dist/core/runtime-scope.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +26 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-handoff.d.ts +35 -0
- package/dist/core/session-handoff.d.ts.map +1 -0
- package/dist/core/session-handoff.js +214 -0
- package/dist/core/session-handoff.js.map +1 -0
- package/dist/core/session-manager.d.ts +20 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +191 -22
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-ownership.d.ts +28 -0
- package/dist/core/session-ownership.d.ts.map +1 -0
- package/dist/core/session-ownership.js +138 -0
- package/dist/core/session-ownership.js.map +1 -0
- package/dist/core/session-retention.d.ts.map +1 -1
- package/dist/core/session-retention.js +11 -2
- package/dist/core/session-retention.js.map +1 -1
- package/dist/core/settings-manager.d.ts +20 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +67 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +6 -4
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-permission-inherit.d.ts +6 -10
- package/dist/core/subagent-permission-inherit.d.ts.map +1 -1
- package/dist/core/subagent-permission-inherit.js +14 -14
- package/dist/core/subagent-permission-inherit.js.map +1 -1
- package/dist/core/subagent-wait-interruption.d.ts +11 -0
- package/dist/core/subagent-wait-interruption.d.ts.map +1 -0
- package/dist/core/subagent-wait-interruption.js +19 -0
- package/dist/core/subagent-wait-interruption.js.map +1 -0
- package/dist/core/system-prompt.d.ts +2 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +14 -4
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/todo-settings.d.ts +5 -0
- package/dist/core/todo-settings.d.ts.map +1 -0
- package/dist/core/todo-settings.js +7 -0
- package/dist/core/todo-settings.js.map +1 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +4 -4
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +5 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +4 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -4
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +4 -4
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -4
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +14 -5
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +34 -7
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +4 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-service.d.ts.map +1 -1
- package/dist/core/usage-service.js +5 -3
- package/dist/core/usage-service.js.map +1 -1
- package/dist/gateway/adapters/discord.d.ts +12 -1
- package/dist/gateway/adapters/discord.d.ts.map +1 -1
- package/dist/gateway/adapters/discord.js +114 -24
- package/dist/gateway/adapters/discord.js.map +1 -1
- package/dist/gateway/adapters/telegram.d.ts +4 -2
- package/dist/gateway/adapters/telegram.d.ts.map +1 -1
- package/dist/gateway/adapters/telegram.js +41 -11
- package/dist/gateway/adapters/telegram.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +18 -4
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +305 -73
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/approval.d.ts +3 -6
- package/dist/gateway/approval.d.ts.map +1 -1
- package/dist/gateway/approval.js +62 -24
- package/dist/gateway/approval.js.map +1 -1
- package/dist/gateway/authz.d.ts +2 -0
- package/dist/gateway/authz.d.ts.map +1 -1
- package/dist/gateway/authz.js +13 -0
- package/dist/gateway/authz.js.map +1 -1
- package/dist/gateway/buttons.d.ts +3 -1
- package/dist/gateway/buttons.d.ts.map +1 -1
- package/dist/gateway/buttons.js +45 -20
- package/dist/gateway/buttons.js.map +1 -1
- package/dist/gateway/command.d.ts.map +1 -1
- package/dist/gateway/command.js +49 -4
- package/dist/gateway/command.js.map +1 -1
- package/dist/gateway/commands.d.ts +2 -0
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +52 -16
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/config.d.ts +6 -0
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js +7 -0
- package/dist/gateway/config.js.map +1 -1
- package/dist/gateway/conversations.d.ts +14 -0
- package/dist/gateway/conversations.d.ts.map +1 -0
- package/dist/gateway/conversations.js +30 -0
- package/dist/gateway/conversations.js.map +1 -0
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +2 -2
- package/dist/gateway/cron.js.map +1 -1
- package/dist/gateway/download.d.ts +2 -0
- package/dist/gateway/download.d.ts.map +1 -0
- package/dist/gateway/download.js +36 -0
- package/dist/gateway/download.js.map +1 -0
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +106 -47
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts +24 -0
- package/dist/gateway/mobile-commands.d.ts.map +1 -0
- package/dist/gateway/mobile-commands.js +423 -0
- package/dist/gateway/mobile-commands.js.map +1 -0
- package/dist/gateway/presenter.d.ts +27 -0
- package/dist/gateway/presenter.d.ts.map +1 -0
- package/dist/gateway/presenter.js +308 -0
- package/dist/gateway/presenter.js.map +1 -0
- package/dist/gateway/router.d.ts +6 -5
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +126 -43
- package/dist/gateway/router.js.map +1 -1
- package/dist/gateway/service.d.ts +46 -0
- package/dist/gateway/service.d.ts.map +1 -0
- package/dist/gateway/service.js +404 -0
- package/dist/gateway/service.js.map +1 -0
- package/dist/gateway/setup.d.ts +9 -0
- package/dist/gateway/setup.d.ts.map +1 -0
- package/dist/gateway/setup.js +202 -0
- package/dist/gateway/setup.js.map +1 -0
- package/dist/gateway/stream.d.ts +6 -5
- package/dist/gateway/stream.d.ts.map +1 -1
- package/dist/gateway/stream.js +24 -11
- package/dist/gateway/stream.js.map +1 -1
- package/dist/gateway/types.d.ts +4 -2
- package/dist/gateway/types.d.ts.map +1 -1
- package/dist/gateway/types.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +19 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +78 -17
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/copyable-text.d.ts +27 -0
- package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/copyable-text.js +156 -0
- package/dist/modes/interactive/components/copyable-text.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +8 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +8 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +12 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +74 -3
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.d.ts +9 -2
- package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-tail.js +43 -1
- package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -3
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +44 -45
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +10 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +342 -133
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +1 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +23 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/node-runtime/agent-session-services-MQUPZSIN.js +51 -0
- package/dist/node-runtime/{builtin-extensions-SRCYQPZ6.js → builtin-extensions-4GNDR6U3.js} +7 -6
- package/dist/node-runtime/{chunk-LTXUQJI4.js → chunk-24C5IAJ4.js} +1 -6
- package/dist/node-runtime/chunk-2BLXLDJR.js +144 -0
- package/dist/node-runtime/{chunk-RQ5DNUNG.js → chunk-2CMV4L24.js} +21 -124
- package/dist/node-runtime/{chunk-LTYWTR3V.js → chunk-2MI5OPMN.js} +17 -2
- package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
- package/dist/node-runtime/{chunk-GT5F3OKM.js → chunk-33SIKK3Y.js} +38 -164
- package/dist/node-runtime/{chunk-GZQHMEWL.js → chunk-3DKIWPKN.js} +19 -4
- package/dist/node-runtime/{chunk-3GHXVUAK.js → chunk-3VEY2IYY.js} +1 -1
- package/dist/node-runtime/chunk-4ER2ZV4Z.js +537 -0
- package/dist/node-runtime/chunk-4EULYYR4.js +62 -0
- package/dist/node-runtime/{chunk-LOYUC2ID.js → chunk-4SBQAI4T.js} +27 -27
- package/dist/node-runtime/{chunk-CZUBYPFP.js → chunk-53ARRUHA.js} +674 -257
- package/dist/node-runtime/{chunk-VTPM5V35.js → chunk-5Q4A37RB.js} +10 -4
- package/dist/node-runtime/{chunk-SWSN6HAB.js → chunk-5UZOPGE3.js} +1 -1
- package/dist/node-runtime/{chunk-XSRCAQK2.js → chunk-5Z5PCXGY.js} +263 -222
- package/dist/node-runtime/chunk-7JIYPIQU.js +356 -0
- package/dist/node-runtime/{chunk-D466UAID.js → chunk-AJ6R5VTV.js} +60 -88
- package/dist/node-runtime/chunk-ATIF3RX5.js +352 -0
- package/dist/node-runtime/{chunk-A3KMVBZV.js → chunk-BBUVIEZB.js} +1 -10
- package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
- package/dist/node-runtime/chunk-CJS4KQFI.js +3412 -0
- package/dist/node-runtime/chunk-DO6PALE2.js +205 -0
- package/dist/node-runtime/{chunk-N3PNL74S.js → chunk-DRJI7ZSC.js} +63 -163
- package/dist/node-runtime/{chunk-VTGEKB7R.js → chunk-E75WFZ33.js} +1 -1
- package/dist/node-runtime/{chunk-MJQDX3BA.js → chunk-EBB4BJW4.js} +3 -3
- package/dist/node-runtime/{chunk-VQ4UBWSA.js → chunk-EOEAQIJV.js} +63 -6
- package/dist/node-runtime/chunk-EOPL2HMM.js +117 -0
- package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
- package/dist/node-runtime/{chunk-HRS4HMDX.js → chunk-HT2XEJNP.js} +19 -3
- package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
- package/dist/node-runtime/{chunk-BJ6H7DPI.js → chunk-JJWZB7S3.js} +62 -50
- package/dist/node-runtime/chunk-KFFOQR4G.js +672 -0
- package/dist/node-runtime/chunk-L5LZUGT7.js +40 -0
- package/dist/node-runtime/chunk-LV6CEFW2.js +97 -0
- package/dist/node-runtime/{chunk-VSELYKWU.js → chunk-LWYIVUGV.js} +2 -1
- package/dist/node-runtime/{chunk-BYQ2MOFI.js → chunk-MFV2LOOX.js} +184 -2192
- package/dist/node-runtime/{chunk-5SQDLSZJ.js → chunk-MNRO3UCV.js} +2 -2
- package/dist/node-runtime/{chunk-JHYKXIMM.js → chunk-MPKSOJBT.js} +1 -1
- package/dist/node-runtime/{chunk-C4O2RSQQ.js → chunk-N4TUWAGA.js} +1 -1
- package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-NAY6UUQZ.js} +1 -1
- package/dist/node-runtime/chunk-NKH2QBKF.js +773 -0
- package/dist/node-runtime/chunk-O2AT4MEU.js +124 -0
- package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
- package/dist/node-runtime/{chunk-DDGMHUOW.js → chunk-OGJN3OZV.js} +2 -1
- package/dist/node-runtime/{chunk-MX3GJNXJ.js → chunk-PLGA743X.js} +23 -0
- package/dist/node-runtime/chunk-Q3FEOEDA.js +1364 -0
- package/dist/node-runtime/{chunk-H2BI7G7T.js → chunk-QFADHUQV.js} +2 -1
- package/dist/node-runtime/{chunk-W3SILANP.js → chunk-RBZQU6TJ.js} +12 -9
- package/dist/node-runtime/{chunk-ZVSORYRM.js → chunk-RVOQBXTA.js} +10 -6
- package/dist/node-runtime/{chunk-HXJS2PJM.js → chunk-RW4PYFNE.js} +14 -94
- package/dist/node-runtime/chunk-TP7K7YWS.js +2830 -0
- package/dist/node-runtime/{chunk-ZOIIMEN6.js → chunk-TVLBDVTR.js} +32 -21
- package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
- package/dist/node-runtime/{chunk-MGWCVY6Y.js → chunk-UDKX3PFN.js} +3 -3
- package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
- package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-UQUCFAJ3.js} +1 -1
- package/dist/node-runtime/chunk-US544NN6.js +13 -0
- package/dist/node-runtime/{chunk-7AFOFSDY.js → chunk-V3HK3FE7.js} +1 -1
- package/dist/node-runtime/{chunk-6UB6NKA3.js → chunk-VIVYOI7C.js} +130 -27
- package/dist/node-runtime/{chunk-MW2XJZIK.js → chunk-XHIRAZ26.js} +1 -1
- package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
- package/dist/node-runtime/{chunk-3RCWXWAY.js → chunk-YRUY57IN.js} +1 -1
- package/dist/node-runtime/cli-runtime.js +2 -2
- package/dist/node-runtime/command-PYBNGLPP.js +45 -0
- package/dist/node-runtime/{commands-BZGSLIP7.js → commands-EMBQQVVT.js} +13 -13
- package/dist/node-runtime/commands-Y2OUC2T7.js +37 -0
- package/dist/node-runtime/config-7DYMNJUO.js +20 -0
- package/dist/node-runtime/{customize-LF5VST47.js → customize-VFJV3U6A.js} +2 -1
- package/dist/node-runtime/{direct-tool-executor-BSZDHIYR.js → direct-tool-executor-4D7UXYU4.js} +10 -10
- package/dist/node-runtime/{export-html-E4DT6ZJQ.js → export-html-ETFOKW3M.js} +4 -3
- package/dist/node-runtime/{extension-input-RV5N6APL.js → extension-input-7QODTFAS.js} +4 -4
- package/dist/node-runtime/{extension-selector-CPD5LWDD.js → extension-selector-T65JEDJ5.js} +4 -4
- package/dist/node-runtime/{extract-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
- package/dist/node-runtime/gateway-QENRQA5X.js +1476 -0
- package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-35OCRFLN.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-UQY3PHHW.js} +2 -2
- package/dist/node-runtime/index.js +113 -73
- package/dist/node-runtime/{init-DVJUAOUO.js → init-P5AUV77I.js} +5 -5
- package/dist/node-runtime/{install-cli-TH7IJJQQ.js → install-cli-KHAXYBOO.js} +21 -82
- package/dist/node-runtime/interactive-mode-IN77GQGX.js +74 -0
- package/dist/node-runtime/{interactive-view-N6F4KUIT.js → interactive-view-OMWDFGUQ.js} +10 -10
- package/dist/node-runtime/lunr-browser-VVPRWC3F.js +174 -0
- package/dist/node-runtime/{lunr-computer-use-TJNDAMWM.js → lunr-computer-use-IAUNXSXH.js} +11 -8
- package/dist/node-runtime/{lunr-cron-J64I72C6.js → lunr-cron-P6ZJGVEF.js} +21 -7
- package/dist/node-runtime/main.js +47 -34
- package/dist/node-runtime/{mcp-auth-flow-YL6RWPYG.js → mcp-auth-flow-QVLFVLEO.js} +2 -2
- package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
- package/dist/node-runtime/mobile-commands-WKFSFACZ.js +33 -0
- package/dist/node-runtime/model-runtime-YXGJS5OJ.js +16 -0
- package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-VMYX4Y2S.js → package-manager-cli-J337RKTI.js} +25 -17
- package/dist/node-runtime/{pi-intercom-NV2LW6X7.js → pi-intercom-QM53RLTS.js} +6 -1
- package/dist/node-runtime/{pi-mcp-adapter-JLB5YL2F.js → pi-mcp-adapter-3PHF4KZ4.js} +8 -7
- package/dist/node-runtime/{pi-subagents-WEHV3W7H.js → pi-subagents-RCHPB6UK.js} +255 -88
- package/dist/node-runtime/{pi-web-access-FN5YC5T6.js → pi-web-access-PNG35XW7.js} +15 -15
- package/dist/node-runtime/process-registry-PVJ44F7H.js +31 -0
- package/dist/node-runtime/{proxy-modes-OR7ISBXK.js → proxy-modes-5FAPSZEZ.js} +11 -11
- package/dist/node-runtime/rpc-entry.js +47 -34
- package/dist/node-runtime/{rpc-mode-SJNSOA4G.js → rpc-mode-SH7VB4RH.js} +2 -2
- package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
- package/dist/node-runtime/runtime-bridges-3CQHWVVY.js +21 -0
- package/dist/node-runtime/service-HGGU3STY.js +36 -0
- package/dist/node-runtime/session-handoff-IAFIK7QP.js +33 -0
- package/dist/node-runtime/{session-manager-QEMZBMTM.js → session-manager-TCEFDKBL.js} +2 -1
- package/dist/node-runtime/{session-selector-URVJLOTK.js → session-selector-HG5J4BDZ.js} +5 -4
- package/dist/node-runtime/{settings-manager-3CCU326G.js → settings-manager-HIBIUNBK.js} +12 -5
- package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
- package/dist/node-runtime/setup-YU5LKRL3.js +215 -0
- package/dist/node-runtime/{subagent-executor-CXKXQDHH.js → subagent-executor-2BH76MMS.js} +64 -23
- package/dist/node-runtime/theme-WTJWZSGD.js +68 -0
- package/dist/node-runtime/trust-manager-6ZQANSBX.js +17 -0
- package/dist/node-runtime/{update-cli-NM7B4CKL.js → update-cli-TVTPVUNM.js} +6 -3
- package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
- package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-OOZHR7SU.js} +2 -2
- package/dist/node-runtime/{workflow-C26QCUTW.js → workflow-TVJNKKQP.js} +80 -39
- package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-FNPAUNHU.js} +6 -6
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +5 -1
- package/dist/startup/interactive-view.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts +2 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +10 -0
- package/dist/utils/image-resize-core.js.map +1 -1
- package/docs/browser.md +86 -0
- package/docs/computer-use.md +134 -48
- package/docs/extensions.md +2 -0
- package/docs/features.md +108 -27
- package/docs/index.md +1 -1
- package/docs/interactive-startup.md +2 -1
- package/docs/keybindings.md +1 -1
- package/docs/providers.md +6 -2
- package/docs/quickstart.md +2 -2
- package/docs/sessions.md +10 -0
- package/docs/settings.md +3 -1
- package/docs/tui.md +2 -0
- package/docs/usage.md +20 -4
- 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/plan-mode/README.md +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/install-lock/package-lock.json +39 -25
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +36 -22
- package/package.json +10 -7
- package/scripts/install-browser.mjs +20 -0
- package/dist/node-runtime/agent-session-services-QANFGM2V.js +0 -40
- package/dist/node-runtime/chunk-LISUTZS3.js +0 -19
- package/dist/node-runtime/chunk-VGYZ3APQ.js +0 -59
- package/dist/node-runtime/chunk-XAUQOKYK.js +0 -6011
- package/dist/node-runtime/command-ZURZJDXF.js +0 -13
- package/dist/node-runtime/gateway-FWHRIBK5.js +0 -2139
- package/dist/node-runtime/interactive-mode-BBASNWHN.js +0 -62
- package/dist/node-runtime/runtime-bridges-2VQTLPOZ.js +0 -12
- package/dist/node-runtime/{chunk-U6C7VTR5.js → chunk-7IQGBKBJ.js} +3 -3
- package/dist/node-runtime/{mcp-panel-IIGMXQGP.js → mcp-panel-KTTFXJZ4.js} +3 -3
- package/dist/node-runtime/{src-BPQFJR76.js → src-IVPNZ2BX.js} +9 -9
|
@@ -4,13 +4,11 @@ import {
|
|
|
4
4
|
markUpdateNotified
|
|
5
5
|
} from "./chunk-BR7YDUKA.js";
|
|
6
6
|
import {
|
|
7
|
-
computeContextBreakdown
|
|
8
|
-
} from "./chunk-7AFOFSDY.js";
|
|
9
|
-
import {
|
|
10
|
-
SubagentEscapeSequence,
|
|
11
|
-
getSubagentCancellation,
|
|
12
7
|
getSubagentSpinnerDefinition
|
|
13
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-US544NN6.js";
|
|
9
|
+
import {
|
|
10
|
+
computeContextBreakdown
|
|
11
|
+
} from "./chunk-V3HK3FE7.js";
|
|
14
12
|
import {
|
|
15
13
|
copyToClipboard,
|
|
16
14
|
readClipboardText
|
|
@@ -22,17 +20,14 @@ import {
|
|
|
22
20
|
import {
|
|
23
21
|
BootScreenComponent,
|
|
24
22
|
registerPermissionModeBridge
|
|
25
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5UZOPGE3.js";
|
|
26
24
|
import {
|
|
27
25
|
nextModeForGoal,
|
|
28
26
|
registerPermissionModeControlBridge
|
|
29
27
|
} from "./chunk-7N3YHTYF.js";
|
|
30
28
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
getProjectTrustOptions,
|
|
34
|
-
hasTrustRequiringProjectResources
|
|
35
|
-
} from "./chunk-LTXUQJI4.js";
|
|
29
|
+
areExperimentalFeaturesEnabled
|
|
30
|
+
} from "./chunk-YPHAIRZT.js";
|
|
36
31
|
import {
|
|
37
32
|
MissingSessionCwdError,
|
|
38
33
|
SessionImportFileNotFoundError,
|
|
@@ -41,45 +36,28 @@ import {
|
|
|
41
36
|
clearRollback,
|
|
42
37
|
disableRollbackForSession,
|
|
43
38
|
enableRollbackForSession,
|
|
44
|
-
formatCatalogRefreshSummary,
|
|
45
39
|
formatMissingSessionCwdPrompt,
|
|
46
|
-
hasGrokCliXaiAuth,
|
|
47
40
|
initRollback,
|
|
48
41
|
isRollbackEnabled,
|
|
49
42
|
isRollbackSessionForceEnabled,
|
|
50
43
|
migrateRollbackSession,
|
|
51
44
|
parseSkillBlock,
|
|
52
45
|
peekRollbackTurnsConsumed,
|
|
53
|
-
refreshModelCandidatesForInit,
|
|
54
46
|
rollbackLastTurn,
|
|
55
|
-
setRollbackWarningHandler
|
|
56
|
-
|
|
57
|
-
} from "./chunk-XAUQOKYK.js";
|
|
47
|
+
setRollbackWarningHandler
|
|
48
|
+
} from "./chunk-CJS4KQFI.js";
|
|
58
49
|
import {
|
|
59
|
-
|
|
60
|
-
} from "./chunk-
|
|
50
|
+
notifyTodosEnabledChanged
|
|
51
|
+
} from "./chunk-CCCN2UCX.js";
|
|
61
52
|
import {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
defaultModelPerProvider,
|
|
65
|
-
extractFileOpsFromMessage,
|
|
66
|
-
findExactModelReferenceMatch,
|
|
67
|
-
resolveModelScope
|
|
68
|
-
} from "./chunk-5SQDLSZJ.js";
|
|
53
|
+
parseGitUrl
|
|
54
|
+
} from "./chunk-MFV2LOOX.js";
|
|
69
55
|
import {
|
|
70
|
-
clearRegistry,
|
|
71
56
|
createAllToolDefinitions,
|
|
72
57
|
ensureTool,
|
|
73
58
|
getToolPath,
|
|
74
|
-
isWindows,
|
|
75
|
-
kill,
|
|
76
|
-
killAll,
|
|
77
|
-
list,
|
|
78
|
-
pause,
|
|
79
|
-
restart,
|
|
80
|
-
resume,
|
|
81
59
|
truncateToVisualLines
|
|
82
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-33SIKK3Y.js";
|
|
83
61
|
import {
|
|
84
62
|
DEFAULT_MAX_BYTES,
|
|
85
63
|
DEFAULT_MAX_LINES,
|
|
@@ -92,94 +70,132 @@ import {
|
|
|
92
70
|
toolGroupRole,
|
|
93
71
|
toolGroupTree,
|
|
94
72
|
toolStatusDot
|
|
95
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-3DKIWPKN.js";
|
|
96
74
|
import {
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
convertToPng,
|
|
76
|
+
processImage
|
|
77
|
+
} from "./chunk-XHIRAZ26.js";
|
|
78
|
+
import {
|
|
79
|
+
formatCatalogRefreshSummary,
|
|
80
|
+
hasGrokCliXaiAuth,
|
|
81
|
+
refreshModelCandidatesForInit,
|
|
82
|
+
stripJsonComments
|
|
83
|
+
} from "./chunk-TP7K7YWS.js";
|
|
99
84
|
import {
|
|
100
85
|
HTTP_IDLE_TIMEOUT_CHOICES,
|
|
101
86
|
SKILL_TAG_CHARACTERS,
|
|
87
|
+
SUBAGENT_SPINNER_LABELS,
|
|
88
|
+
SUBAGENT_SPINNER_NAMES,
|
|
102
89
|
configureHttpDispatcher,
|
|
103
90
|
formatHttpIdleTimeoutMs
|
|
104
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-EOEAQIJV.js";
|
|
105
92
|
import {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
SessionManager,
|
|
111
|
-
sessionEntryToContextMessages
|
|
112
|
-
} from "./chunk-6UB6NKA3.js";
|
|
113
|
-
import {
|
|
114
|
-
createCompactionSummaryMessage
|
|
115
|
-
} from "./chunk-FVDOXRUD.js";
|
|
116
|
-
import {
|
|
117
|
-
getModelTiersBridge
|
|
118
|
-
} from "./chunk-W3CVH5RX.js";
|
|
93
|
+
ProjectTrustStore,
|
|
94
|
+
getProjectTrustOptions,
|
|
95
|
+
hasTrustRequiringProjectResources
|
|
96
|
+
} from "./chunk-24C5IAJ4.js";
|
|
119
97
|
import {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
98
|
+
computeFileLists,
|
|
99
|
+
createFileOps,
|
|
100
|
+
defaultModelPerProvider,
|
|
101
|
+
extractFileOpsFromMessage,
|
|
102
|
+
findExactModelReferenceMatch,
|
|
103
|
+
resolveModelScope
|
|
104
|
+
} from "./chunk-MNRO3UCV.js";
|
|
123
105
|
import {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} from "./chunk-
|
|
106
|
+
SubagentEscapeSequence,
|
|
107
|
+
getSubagentCancellation
|
|
108
|
+
} from "./chunk-BBUVIEZB.js";
|
|
127
109
|
import {
|
|
128
110
|
AUTO_MODE_ADDENDUM,
|
|
129
|
-
|
|
111
|
+
READ_ONLY_MODE_ADDENDUM,
|
|
130
112
|
getPermissionMode,
|
|
131
113
|
nextPermissionMode,
|
|
132
114
|
registerApprovalHandler,
|
|
133
115
|
resetPermissions,
|
|
134
116
|
restorePermissionModeAfterPlan,
|
|
135
117
|
setPermissionMode
|
|
136
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-AJ6R5VTV.js";
|
|
137
119
|
import {
|
|
138
120
|
getGlobalInstructionsPath,
|
|
139
121
|
getModelInstructionsPath
|
|
140
122
|
} from "./chunk-M3LZLQW2.js";
|
|
141
123
|
import {
|
|
142
|
-
|
|
143
|
-
|
|
124
|
+
clearRegistry,
|
|
125
|
+
isWindows,
|
|
126
|
+
kill,
|
|
127
|
+
killAll,
|
|
128
|
+
list,
|
|
129
|
+
pause,
|
|
130
|
+
restart,
|
|
131
|
+
resume
|
|
132
|
+
} from "./chunk-2BLXLDJR.js";
|
|
144
133
|
import {
|
|
145
|
-
|
|
146
|
-
} from "./chunk-
|
|
134
|
+
killTrackedDetachedChildren
|
|
135
|
+
} from "./chunk-ZCHMJ34K.js";
|
|
136
|
+
import {
|
|
137
|
+
cancelSessionHandoff,
|
|
138
|
+
markSessionHandoff,
|
|
139
|
+
recordTuiActivity,
|
|
140
|
+
registerTransferHandler,
|
|
141
|
+
requestSessionTransfer
|
|
142
|
+
} from "./chunk-DO6PALE2.js";
|
|
143
|
+
import {
|
|
144
|
+
SessionManager,
|
|
145
|
+
sessionEntryToContextMessages
|
|
146
|
+
} from "./chunk-VIVYOI7C.js";
|
|
147
|
+
import {
|
|
148
|
+
createCompactionSummaryMessage
|
|
149
|
+
} from "./chunk-FVDOXRUD.js";
|
|
147
150
|
import {
|
|
148
151
|
getCustomizeBridge
|
|
149
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-4EULYYR4.js";
|
|
150
153
|
import {
|
|
151
154
|
MEMORY_CHAR_CAP_DEFAULT,
|
|
152
155
|
MEMORY_CHAR_CAP_MAX,
|
|
153
156
|
MEMORY_CHAR_CAP_MIN
|
|
154
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-UJOCPOMX.js";
|
|
158
|
+
import {
|
|
159
|
+
getModelTiersBridge
|
|
160
|
+
} from "./chunk-2TKODGBZ.js";
|
|
161
|
+
import {
|
|
162
|
+
getAllPlanUsageResults,
|
|
163
|
+
getUsageServiceBridge
|
|
164
|
+
} from "./chunk-2MI5OPMN.js";
|
|
165
|
+
import {
|
|
166
|
+
SessionSelectorComponent
|
|
167
|
+
} from "./chunk-HT2XEJNP.js";
|
|
168
|
+
import {
|
|
169
|
+
CustomEditor
|
|
170
|
+
} from "./chunk-H2EOZYMP.js";
|
|
171
|
+
import {
|
|
172
|
+
KeybindingsManager
|
|
173
|
+
} from "./chunk-CH6OL6P2.js";
|
|
174
|
+
import {
|
|
175
|
+
time
|
|
176
|
+
} from "./chunk-PVCDKGR6.js";
|
|
155
177
|
import {
|
|
156
178
|
markStartupMilestone
|
|
157
179
|
} from "./chunk-CCZJ3PYY.js";
|
|
158
180
|
import {
|
|
159
181
|
ExtensionSelectorComponent
|
|
160
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-EBB4BJW4.js";
|
|
161
183
|
import {
|
|
162
184
|
ExtensionInputComponent
|
|
163
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-UDKX3PFN.js";
|
|
164
186
|
import {
|
|
165
187
|
CountdownTimer
|
|
166
188
|
} from "./chunk-I6R76AG7.js";
|
|
167
|
-
import {
|
|
168
|
-
SessionSelectorComponent
|
|
169
|
-
} from "./chunk-HRS4HMDX.js";
|
|
170
|
-
import {
|
|
171
|
-
KeybindingsManager
|
|
172
|
-
} from "./chunk-CH6OL6P2.js";
|
|
173
189
|
import {
|
|
174
190
|
DynamicBorder
|
|
175
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-3VEY2IYY.js";
|
|
176
192
|
import {
|
|
177
193
|
formatKeyText,
|
|
178
194
|
keyDisplayText,
|
|
179
195
|
keyHint,
|
|
180
196
|
keyText,
|
|
181
197
|
rawKeyHint
|
|
182
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-N4TUWAGA.js";
|
|
183
199
|
import {
|
|
184
200
|
FS_WATCH_RETRY_DELAY_MS,
|
|
185
201
|
Theme,
|
|
@@ -205,7 +221,7 @@ import {
|
|
|
205
221
|
stopThemeWatcher,
|
|
206
222
|
theme,
|
|
207
223
|
watchWithErrorHandler
|
|
208
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-PLGA743X.js";
|
|
209
225
|
import {
|
|
210
226
|
APP_NAME,
|
|
211
227
|
APP_TITLE,
|
|
@@ -227,7 +243,7 @@ import * as fs2 from "node:fs";
|
|
|
227
243
|
import * as os2 from "node:os";
|
|
228
244
|
import * as path2 from "node:path";
|
|
229
245
|
import { getSupportedThinkingLevels } from "@ashx-j/lunr-ai/compat";
|
|
230
|
-
import { CombinedAutocompleteProvider, Container as Container19, collectImageMarkerIds, formatImageMarker, fuzzyFilter as fuzzyFilter5, isFocusable, Markdown as Markdown10, matchesKey as matchesKey2, ProcessTerminal, Spacer as Spacer19, setKeybindings, Text as Text21, TruncatedText as TruncatedText2, TUI, visibleWidth as
|
|
246
|
+
import { CombinedAutocompleteProvider, Container as Container19, collectImageMarkerIds, formatImageMarker, fuzzyFilter as fuzzyFilter5, isFocusable, Markdown as Markdown10, matchesKey as matchesKey2, ProcessTerminal, Spacer as Spacer19, setKeybindings, Text as Text21, TruncatedText as TruncatedText2, TUI, visibleWidth as visibleWidth6 } from "@ashx-j/lunr-tui";
|
|
231
247
|
import chalk from "chalk";
|
|
232
248
|
import { spawn as spawn3, spawnSync } from "child_process";
|
|
233
249
|
|
|
@@ -691,15 +707,15 @@ var BUILTIN_SLASH_COMMANDS = [
|
|
|
691
707
|
{ name: "context", description: "Show estimated context window breakdown" },
|
|
692
708
|
{
|
|
693
709
|
name: "plan",
|
|
694
|
-
description: "
|
|
710
|
+
description: "Use read-only mode to plan a task, or /plan <task> to start planning",
|
|
695
711
|
argumentHint: "[on|off|status|<task>]"
|
|
696
712
|
},
|
|
697
713
|
{
|
|
698
714
|
name: "mode",
|
|
699
|
-
description: "Set permission mode:
|
|
700
|
-
argumentHint: "[
|
|
715
|
+
description: "Set permission mode: yolo, auto, or read",
|
|
716
|
+
argumentHint: "[yolo|auto|read]"
|
|
701
717
|
},
|
|
702
|
-
{ name: "
|
|
718
|
+
{ name: "read", description: "Activate read-only permission mode" },
|
|
703
719
|
{ name: "yolo", description: "Activate YOLO permission mode (auto-approve tools)" },
|
|
704
720
|
{ name: "auto", description: "Activate auto permission mode (fully autonomous, no questions)" },
|
|
705
721
|
{ name: "processes", description: "View and manage background processes started this session" },
|
|
@@ -719,6 +735,8 @@ var BUILTIN_SLASH_COMMANDS = [
|
|
|
719
735
|
{ name: "new", description: "Start a new session" },
|
|
720
736
|
{ name: "init", description: "Generate a starter AGENTS.md for this project" },
|
|
721
737
|
{ name: "compact", description: "Manually compact the session context" },
|
|
738
|
+
{ name: "handoff", description: "Mark this saved session for phone continuation for 8 hours, or cancel" },
|
|
739
|
+
{ name: "reclaim", description: "Reclaim this session after its remote owner releases it" },
|
|
722
740
|
{ name: "resume", description: "Resume a different session" },
|
|
723
741
|
{ name: "sessions", description: "Browse and resume sessions" },
|
|
724
742
|
{ name: "reload", description: "Reload keybindings, extensions, skills, prompts, themes, and context files" },
|
|
@@ -1097,6 +1115,114 @@ var ArminComponent = class {
|
|
|
1097
1115
|
// packages/coding-agent/dist/modes/interactive/components/assistant-message.js
|
|
1098
1116
|
import { Container, Markdown as Markdown2, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
1099
1117
|
|
|
1118
|
+
// packages/coding-agent/dist/modes/interactive/components/copyable-text.js
|
|
1119
|
+
import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@ashx-j/lunr-tui";
|
|
1120
|
+
function sourceLines(source) {
|
|
1121
|
+
let lines = [], pattern = /([^\r\n]*)(\r\n|\r|\n|$)/g;
|
|
1122
|
+
for (let match of source.matchAll(pattern)) {
|
|
1123
|
+
let start = match.index, text = match[1], newline = match[2];
|
|
1124
|
+
if (lines.push({ start, end: start + text.length + newline.length, text }), !newline)
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
return lines;
|
|
1128
|
+
}
|
|
1129
|
+
function parseFenceOpening(line) {
|
|
1130
|
+
let match = /^( {0,3})(`{3,}|~{3,})(.*)$/.exec(line);
|
|
1131
|
+
if (!match)
|
|
1132
|
+
return;
|
|
1133
|
+
let fence = match[2], info = match[3];
|
|
1134
|
+
if (!(fence[0] === "`" && info.includes("`")))
|
|
1135
|
+
return {
|
|
1136
|
+
marker: fence[0],
|
|
1137
|
+
length: fence.length,
|
|
1138
|
+
copyable: info.trim() === "lunr-copy"
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
function isFenceClosing(line, opening) {
|
|
1142
|
+
let match = /^( {0,3})(`+|~+)[ \t]*$/.exec(line);
|
|
1143
|
+
if (!match)
|
|
1144
|
+
return !1;
|
|
1145
|
+
let fence = match[2];
|
|
1146
|
+
return fence[0] === opening.marker && fence.length >= opening.length;
|
|
1147
|
+
}
|
|
1148
|
+
function payloadEndBeforeClosing(source, closingStart) {
|
|
1149
|
+
return closingStart >= 2 && source.slice(closingStart - 2, closingStart) === `\r
|
|
1150
|
+
` ? closingStart - 2 : closingStart >= 1 && (source[closingStart - 1] === `
|
|
1151
|
+
` || source[closingStart - 1] === "\r") ? closingStart - 1 : closingStart;
|
|
1152
|
+
}
|
|
1153
|
+
function parseCopyableTextSegments(source) {
|
|
1154
|
+
let lines = sourceLines(source), segments = [], emittedThrough = 0, lineIndex = 0;
|
|
1155
|
+
for (; lineIndex < lines.length; ) {
|
|
1156
|
+
let openingLine = lines[lineIndex], opening = parseFenceOpening(openingLine.text);
|
|
1157
|
+
if (!opening) {
|
|
1158
|
+
lineIndex++;
|
|
1159
|
+
continue;
|
|
1160
|
+
}
|
|
1161
|
+
let closingIndex = -1;
|
|
1162
|
+
for (let i = lineIndex + 1; i < lines.length; i++)
|
|
1163
|
+
if (isFenceClosing(lines[i].text, opening)) {
|
|
1164
|
+
closingIndex = i;
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
if (!opening.copyable) {
|
|
1168
|
+
if (closingIndex < 0)
|
|
1169
|
+
break;
|
|
1170
|
+
lineIndex = closingIndex + 1;
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
openingLine.start > emittedThrough && segments.push({ type: "markdown", text: source.slice(emittedThrough, openingLine.start) });
|
|
1174
|
+
let payloadStart = openingLine.end;
|
|
1175
|
+
if (closingIndex < 0)
|
|
1176
|
+
return segments.push({
|
|
1177
|
+
type: "copyable",
|
|
1178
|
+
payload: source.slice(payloadStart),
|
|
1179
|
+
complete: !1,
|
|
1180
|
+
start: openingLine.start
|
|
1181
|
+
}), segments;
|
|
1182
|
+
let closingLine = lines[closingIndex];
|
|
1183
|
+
segments.push({
|
|
1184
|
+
type: "copyable",
|
|
1185
|
+
payload: source.slice(payloadStart, payloadEndBeforeClosing(source, closingLine.start)),
|
|
1186
|
+
complete: !0,
|
|
1187
|
+
start: openingLine.start
|
|
1188
|
+
}), emittedThrough = closingLine.end, lineIndex = closingIndex + 1;
|
|
1189
|
+
}
|
|
1190
|
+
return emittedThrough < source.length && segments.push({ type: "markdown", text: source.slice(emittedThrough) }), segments;
|
|
1191
|
+
}
|
|
1192
|
+
var CopyableTextBlockComponent = class {
|
|
1193
|
+
renderedRows = 0;
|
|
1194
|
+
payload;
|
|
1195
|
+
complete;
|
|
1196
|
+
outputPad;
|
|
1197
|
+
status;
|
|
1198
|
+
onCopy;
|
|
1199
|
+
constructor(payload, complete, outputPad, status, onCopy) {
|
|
1200
|
+
this.payload = payload, this.complete = complete, this.outputPad = outputPad, this.status = status, this.onCopy = onCopy;
|
|
1201
|
+
}
|
|
1202
|
+
invalidate() {
|
|
1203
|
+
this.renderedRows = 0;
|
|
1204
|
+
}
|
|
1205
|
+
render(width) {
|
|
1206
|
+
if (width <= 0)
|
|
1207
|
+
return this.renderedRows = 0, [];
|
|
1208
|
+
let horizontalPad = Math.min(this.outputPad, Math.max(0, width - 1)), pad = " ".repeat(horizontalPad), contentWidth = Math.max(1, width - horizontalPad * 2), paint = (content) => {
|
|
1209
|
+
let line = truncateToWidth(`${pad}${content}`, width, "");
|
|
1210
|
+
return theme.bg("userMessageBg", `${line}${" ".repeat(Math.max(0, width - visibleWidth(line)))}`);
|
|
1211
|
+
}, lines = [paint("")], payloadLines = this.payload.replace(/\t/g, " ").split(`
|
|
1212
|
+
`);
|
|
1213
|
+
for (let payloadLine of payloadLines)
|
|
1214
|
+
for (let wrappedLine of wrapTextWithAnsi(payloadLine, contentWidth))
|
|
1215
|
+
lines.push(paint(theme.fg("userMessageText", wrappedLine)));
|
|
1216
|
+
if (typeof this.status == "object")
|
|
1217
|
+
for (let wrappedLine of wrapTextWithAnsi(`Copy failed: ${this.status.error}`, contentWidth))
|
|
1218
|
+
lines.push(paint(theme.fg("error", wrappedLine)));
|
|
1219
|
+
return lines.push(paint("")), this.renderedRows = lines.length, lines;
|
|
1220
|
+
}
|
|
1221
|
+
handleClick(localY, width, localX) {
|
|
1222
|
+
return this.render(width), !this.complete || this.status === "copying" || localY < 0 || localY >= this.renderedRows || localX !== void 0 && (localX < 0 || localX >= width) ? !1 : (this.onCopy(), !0);
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1100
1226
|
// packages/coding-agent/dist/modes/interactive/components/thinking-summary.js
|
|
1101
1227
|
var LEADING_MARKDOWN_RE = /^[#*`>\-\s]+/;
|
|
1102
1228
|
function thinkingSnippet(joinedThinking, maxLen = 120) {
|
|
@@ -1143,7 +1269,7 @@ function isThinkingRunComplete(_hasFollowingBlock, timing, timingsAttached) {
|
|
|
1143
1269
|
}
|
|
1144
1270
|
|
|
1145
1271
|
// packages/coding-agent/dist/modes/interactive/components/thinking-tail.js
|
|
1146
|
-
import { Markdown } from "@ashx-j/lunr-tui";
|
|
1272
|
+
import { Markdown, truncateToWidth as truncateToWidth2, visibleWidth as visibleWidth2 } from "@ashx-j/lunr-tui";
|
|
1147
1273
|
var THINKING_TAIL_LINES = 4, ThinkingTailComponent = class {
|
|
1148
1274
|
markdown;
|
|
1149
1275
|
maxLines;
|
|
@@ -1157,6 +1283,28 @@ var THINKING_TAIL_LINES = 4, ThinkingTailComponent = class {
|
|
|
1157
1283
|
let lines = this.markdown.render(width);
|
|
1158
1284
|
return lines.length <= this.maxLines ? lines : lines.slice(-this.maxLines);
|
|
1159
1285
|
}
|
|
1286
|
+
}, shimmerSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" }), SHIMMER_PERIOD_MS = 2800, ThinkingLineComponent = class extends ThinkingTailComponent {
|
|
1287
|
+
startedAt;
|
|
1288
|
+
palette = theme.getFgGradient("thinkingText", "white", 32);
|
|
1289
|
+
constructor(text, paddingX, markdownTheme, startedAt) {
|
|
1290
|
+
super(text, paddingX, 0, markdownTheme), this.startedAt = startedAt;
|
|
1291
|
+
}
|
|
1292
|
+
invalidate() {
|
|
1293
|
+
super.invalidate(), this.palette = theme.getFgGradient("thinkingText", "white", 32);
|
|
1294
|
+
}
|
|
1295
|
+
render(width) {
|
|
1296
|
+
if (width <= 0)
|
|
1297
|
+
return ["", ""];
|
|
1298
|
+
let lines = this.markdown.render(width), latest = "";
|
|
1299
|
+
for (let index = lines.length - 1; index >= 0 && (latest = stripAnsi(lines[index]).trimEnd(), !latest.trim()); index--)
|
|
1300
|
+
;
|
|
1301
|
+
let text = stripAnsi(truncateToWidth2(latest, width, "")), length = visibleWidth2(text), band = Math.max(6, Math.min(18, length * 0.3)), progress = (performance.now() - this.startedAt) % SHIMMER_PERIOD_MS / SHIMMER_PERIOD_MS, center = -band + progress * (length + band * 2), column = 0, highlighted = "";
|
|
1302
|
+
for (let { segment } of shimmerSegmenter.segment(text)) {
|
|
1303
|
+
let cells = visibleWidth2(segment), distance = Math.abs(column + cells / 2 - center) / band, intensity = distance >= 1 ? 0 : (1 + Math.cos(Math.PI * distance)) / 2;
|
|
1304
|
+
highlighted += this.palette[Math.round(intensity * (this.palette.length - 1))] + segment, column += cells;
|
|
1305
|
+
}
|
|
1306
|
+
return ["", `\x1B[3m${highlighted}\x1B[23m\x1B[39m`];
|
|
1307
|
+
}
|
|
1160
1308
|
};
|
|
1161
1309
|
|
|
1162
1310
|
// packages/coding-agent/dist/modes/interactive/components/assistant-message.js
|
|
@@ -1181,12 +1329,23 @@ var OSC133_ZONE_START = "\x1B]133;A\x07", OSC133_ZONE_END = "\x1B]133;B\x07", OS
|
|
|
1181
1329
|
lastMessage;
|
|
1182
1330
|
thinkingSource;
|
|
1183
1331
|
hasToolCalls = !1;
|
|
1184
|
-
|
|
1185
|
-
|
|
1332
|
+
copyText;
|
|
1333
|
+
requestRender;
|
|
1334
|
+
copyStates = /* @__PURE__ */ new Map();
|
|
1335
|
+
reasoningDisplay;
|
|
1336
|
+
onThinkingAnimationChange;
|
|
1337
|
+
thinkingAnimationStart = performance.now();
|
|
1338
|
+
thinkingAnimationActive = !1;
|
|
1339
|
+
constructor(message, hideThinkingBlock = !1, markdownTheme = getMarkdownTheme(), hiddenThinkingLabel = "Thinking...", outputPad = 1, thinkingCollapse = !1, options = {}) {
|
|
1340
|
+
super(), this.hideThinkingBlock = hideThinkingBlock, this.thinkingCollapse = thinkingCollapse, this.markdownTheme = markdownTheme, this.hiddenThinkingLabel = hiddenThinkingLabel, this.outputPad = outputPad, this.copyText = options.copyText ?? copyToClipboard, this.requestRender = options.requestRender ?? (() => {
|
|
1341
|
+
}), this.reasoningDisplay = options.reasoningDisplay ?? "auto", this.onThinkingAnimationChange = options.onThinkingAnimationChange, this.contentContainer = new Container(), this.addChild(this.contentContainer), message && this.updateContent(message);
|
|
1186
1342
|
}
|
|
1187
1343
|
invalidate() {
|
|
1188
1344
|
super.invalidate(), this.lastMessage && this.updateContent(this.lastMessage, this.thinkingSourceOptions());
|
|
1189
1345
|
}
|
|
1346
|
+
setReasoningDisplay(display) {
|
|
1347
|
+
this.reasoningDisplay = display, this.lastMessage && this.updateContent(this.lastMessage, this.thinkingSourceOptions());
|
|
1348
|
+
}
|
|
1190
1349
|
setHideThinkingBlock(hide) {
|
|
1191
1350
|
this.hideThinkingBlock = hide, this.lastMessage && this.updateContent(this.lastMessage, this.thinkingSourceOptions());
|
|
1192
1351
|
}
|
|
@@ -1210,12 +1369,12 @@ var OSC133_ZONE_START = "\x1B]133;A\x07", OSC133_ZONE_END = "\x1B]133;B\x07", OS
|
|
|
1210
1369
|
} else this.expandedRuns.has(runIndex) ? this.expandedRuns.delete(runIndex) : this.expandedRuns.add(runIndex);
|
|
1211
1370
|
this.lastMessage && this.updateContent(this.lastMessage, this.thinkingSourceOptions());
|
|
1212
1371
|
}
|
|
1213
|
-
handleClick(localY, width) {
|
|
1372
|
+
handleClick(localY, width, localX) {
|
|
1214
1373
|
let contentWidth = width, y = 0;
|
|
1215
1374
|
for (let child of this.contentContainer.children) {
|
|
1216
1375
|
let h = child.render(contentWidth).length;
|
|
1217
1376
|
if (localY >= y && localY < y + h)
|
|
1218
|
-
return typeof child.handleClick == "function" ? child.handleClick(localY - y, contentWidth) : !1;
|
|
1377
|
+
return typeof child.handleClick == "function" ? child.handleClick(localY - y, contentWidth, localX) : !1;
|
|
1219
1378
|
y += h;
|
|
1220
1379
|
}
|
|
1221
1380
|
return !1;
|
|
@@ -1237,18 +1396,28 @@ var OSC133_ZONE_START = "\x1B]133;A\x07", OSC133_ZONE_END = "\x1B]133;B\x07", OS
|
|
|
1237
1396
|
return this.thinkingSource ? { thinkingSource: this.thinkingSource } : void 0;
|
|
1238
1397
|
}
|
|
1239
1398
|
updateContent(message, options) {
|
|
1240
|
-
this.lastMessage = message, this.thinkingSource = options?.thinkingSource, this.contentContainer.clear();
|
|
1399
|
+
this.lastMessage = message, this.thinkingSource = options?.thinkingSource, this.thinkingAnimationActive = !1, this.contentContainer.clear();
|
|
1241
1400
|
let sourceMessage = this.thinkingSource ?? message, sourceThinkingRuns = collectThinkingRuns(sourceMessage.content);
|
|
1242
1401
|
message.content.some((c) => c.type === "text" && c.text.trim() || !this.hideThinkingBlock && c.type === "thinking" && c.thinking.trim()) && this.contentContainer.addChild(new Spacer(1));
|
|
1243
1402
|
let isFirstTextBlock = !0, thinkingRunIndex = -1;
|
|
1244
1403
|
for (let i = 0; i < message.content.length; i++) {
|
|
1245
1404
|
let content = message.content[i];
|
|
1246
|
-
if (content.type === "text" && content.text.trim())
|
|
1247
|
-
let
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1405
|
+
if (content.type === "text" && content.text.trim())
|
|
1406
|
+
for (let segment of parseCopyableTextSegments(content.text)) {
|
|
1407
|
+
if (segment.type === "markdown") {
|
|
1408
|
+
let trimmed = segment.text.trim();
|
|
1409
|
+
if (!trimmed)
|
|
1410
|
+
continue;
|
|
1411
|
+
let text = isFirstTextBlock ? `\u25CF ${trimmed}` : trimmed;
|
|
1412
|
+
isFirstTextBlock = !1, this.contentContainer.addChild(new Markdown2(text, this.outputPad, 0, this.markdownTheme, {
|
|
1413
|
+
color: (body) => theme.fg("userMessageText", body)
|
|
1414
|
+
}));
|
|
1415
|
+
continue;
|
|
1416
|
+
}
|
|
1417
|
+
let key = `${i}:${segment.start}`, copyState = this.copyStates.get(key), status = copyState?.payload === segment.payload ? copyState.status : "idle";
|
|
1418
|
+
copyState && copyState.payload !== segment.payload && this.copyStates.delete(key), this.contentContainer.addChild(new CopyableTextBlockComponent(segment.payload, segment.complete, this.outputPad, status, () => this.copyPayload(key, segment.payload)));
|
|
1419
|
+
}
|
|
1420
|
+
else if (content.type === "thinking") {
|
|
1252
1421
|
thinkingRunIndex++;
|
|
1253
1422
|
let displayBlocks = [];
|
|
1254
1423
|
for (; i < message.content.length; i++) {
|
|
@@ -1276,6 +1445,18 @@ var OSC133_ZONE_START = "\x1B]133;A\x07", OSC133_ZONE_END = "\x1B]133;B\x07", OS
|
|
|
1276
1445
|
this.contentContainer.addChild(new Spacer(1)), this.contentContainer.addChild(new Text(theme.fg("error", `Error: ${errorMsg}`), this.outputPad, 0));
|
|
1277
1446
|
}
|
|
1278
1447
|
}
|
|
1448
|
+
this.onThinkingAnimationChange?.(this.thinkingAnimationActive);
|
|
1449
|
+
}
|
|
1450
|
+
copyPayload(key, payload) {
|
|
1451
|
+
this.copyStates.get(key)?.status !== "copying" && (this.copyStates.set(key, { payload, status: "copying" }), this.refreshCopyStatus(), Promise.resolve().then(() => this.copyText(payload)).then(() => {
|
|
1452
|
+
this.copyStates.set(key, { payload, status: "copied" }), this.refreshCopyStatus();
|
|
1453
|
+
}).catch((error) => {
|
|
1454
|
+
let message = (error instanceof Error ? error.message : String(error)).replace(/\s+/g, " ").trim();
|
|
1455
|
+
this.copyStates.set(key, { payload, status: { error: message || "Unknown error" } }), this.refreshCopyStatus();
|
|
1456
|
+
}));
|
|
1457
|
+
}
|
|
1458
|
+
refreshCopyStatus() {
|
|
1459
|
+
this.lastMessage && this.updateContent(this.lastMessage, this.thinkingSourceOptions()), this.requestRender();
|
|
1279
1460
|
}
|
|
1280
1461
|
renderThinkingRun(thinkingRunIndex, thinkingBlocks, displayMessage, displayIndex, fullyRevealed) {
|
|
1281
1462
|
let hasVisibleContentAfter = displayIndex >= 0 ? displayMessage.content.slice(displayIndex + 1).some((c) => c.type === "text" && c.text.trim() || c.type === "thinking" && c.thinking.trim()) : displayMessage.content.some((c) => c.type === "text" && c.text.trim()), runComplete = fullyRevealed && isThinkingRunComplete(!1, this.thinkingTimings?.[thinkingRunIndex], this.thinkingTimings !== void 0), wrap = (inner) => {
|
|
@@ -1284,13 +1465,19 @@ var OSC133_ZONE_START = "\x1B]133;A\x07", OSC133_ZONE_END = "\x1B]133;B\x07", OS
|
|
|
1284
1465
|
if (this.thinkingCollapse && !this.isRunExpanded(thinkingRunIndex) && runComplete) {
|
|
1285
1466
|
let timing = this.thinkingTimings?.[thinkingRunIndex], label = timing?.end !== void 0 ? `\u273B Thought for ${formatThoughtDuration(timing.end - timing.start)}` : "\u273B Thought", block = new Container();
|
|
1286
1467
|
block.addChild(new Text(theme.fg("thinkingText", theme.italic(label)), this.outputPad, 0));
|
|
1287
|
-
let
|
|
1468
|
+
let joinedThinking = thinkingBlocks.join(`
|
|
1288
1469
|
|
|
1289
|
-
`));
|
|
1470
|
+
`), snippet = thinkingSnippet(displayMessage.provider === "openai-codex" ? joinedThinking.replaceAll("**", "") : joinedThinking);
|
|
1290
1471
|
snippet && block.addChild(new Text(theme.fg("thinkingText", theme.italic(snippet)), this.outputPad + 2, 0)), wrap(block), hasVisibleContentAfter && this.contentContainer.addChild(new Spacer(1));
|
|
1291
1472
|
return;
|
|
1292
1473
|
}
|
|
1293
1474
|
if (!runComplete && !this.isRunExpanded(thinkingRunIndex)) {
|
|
1475
|
+
if (this.reasoningDisplay === "one-line" || this.reasoningDisplay === "auto" && displayMessage.provider === "openai-codex") {
|
|
1476
|
+
this.thinkingAnimationActive = !0, this.contentContainer.children.length === 1 && this.contentContainer.children[0] instanceof Spacer && this.contentContainer.clear(), wrap(new ThinkingLineComponent(thinkingBlocks.join(`
|
|
1477
|
+
|
|
1478
|
+
`), this.outputPad, this.markdownTheme, this.thinkingAnimationStart));
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1294
1481
|
wrap(new ThinkingTailComponent(thinkingBlocks.join(`
|
|
1295
1482
|
|
|
1296
1483
|
`), this.outputPad, 0, this.markdownTheme, {
|
|
@@ -1509,7 +1696,7 @@ var CompactionSummaryMessageComponent = class extends Box2 {
|
|
|
1509
1696
|
|
|
1510
1697
|
// packages/coding-agent/dist/modes/interactive/components/footer.js
|
|
1511
1698
|
import { isAbsolute, relative, resolve as resolve2, sep } from "node:path";
|
|
1512
|
-
import { truncateToWidth, visibleWidth } from "@ashx-j/lunr-tui";
|
|
1699
|
+
import { truncateToWidth as truncateToWidth3, visibleWidth as visibleWidth3 } from "@ashx-j/lunr-tui";
|
|
1513
1700
|
function sanitizeStatusText(text) {
|
|
1514
1701
|
return text.replace(/[\r\n\t]/g, " ").replace(/ +/g, " ").trim();
|
|
1515
1702
|
}
|
|
@@ -1568,38 +1755,38 @@ var FooterComponent = class {
|
|
|
1568
1755
|
}
|
|
1569
1756
|
let contextPercentStr, autoIndicator = this.autoCompactEnabled ? " (auto)" : "", contextPercentDisplay = contextPercent === "?" ? `?/${formatTokens(contextWindow)}${autoIndicator}` : `${contextPercent}%/${formatTokens(contextWindow)}${autoIndicator}`;
|
|
1570
1757
|
contextPercentValue > 90 ? contextPercentStr = theme.fg("error", contextPercentDisplay) : contextPercentValue > 70 ? contextPercentStr = theme.fg("warning", contextPercentDisplay) : contextPercentStr = contextPercentDisplay, statsParts.push(contextPercentStr), areExperimentalFeaturesEnabled() && statsParts.push(`${theme.fg("dim", "\u2022")} ${theme.bold(theme.fg("warning", "xp"))}`);
|
|
1571
|
-
let statsLeft = statsParts.join(" "), modelName = state.model?.id || "no-model", statsLeftWidth =
|
|
1572
|
-
statsLeftWidth > width && (statsLeft =
|
|
1758
|
+
let statsLeft = statsParts.join(" "), modelName = state.model?.id || "no-model", statsLeftWidth = visibleWidth3(statsLeft);
|
|
1759
|
+
statsLeftWidth > width && (statsLeft = truncateToWidth3(statsLeft, width, "..."), statsLeftWidth = visibleWidth3(statsLeft));
|
|
1573
1760
|
let minPadding = 2, rightSideWithoutProvider = modelName;
|
|
1574
1761
|
if (state.model?.reasoning) {
|
|
1575
1762
|
let thinkingLevel = state.thinkingLevel || "off";
|
|
1576
1763
|
rightSideWithoutProvider = thinkingLevel === "off" ? `${modelName} \u2022 thinking off` : `${modelName} \u2022 ${thinkingLevel}`;
|
|
1577
1764
|
}
|
|
1578
1765
|
let rightSide = rightSideWithoutProvider;
|
|
1579
|
-
this.footerData.getAvailableProviderCount() > 1 && state.model && (rightSide = `(${state.model.provider}) ${rightSideWithoutProvider}`, statsLeftWidth + minPadding +
|
|
1580
|
-
let rightSideWidth =
|
|
1766
|
+
this.footerData.getAvailableProviderCount() > 1 && state.model && (rightSide = `(${state.model.provider}) ${rightSideWithoutProvider}`, statsLeftWidth + minPadding + visibleWidth3(rightSide) > width && (rightSide = rightSideWithoutProvider));
|
|
1767
|
+
let rightSideWidth = visibleWidth3(rightSide), totalNeeded = statsLeftWidth + minPadding + rightSideWidth, statsLine;
|
|
1581
1768
|
if (totalNeeded <= width) {
|
|
1582
1769
|
let padding = " ".repeat(width - statsLeftWidth - rightSideWidth);
|
|
1583
1770
|
statsLine = statsLeft + padding + rightSide;
|
|
1584
1771
|
} else {
|
|
1585
1772
|
let availableForRight = width - statsLeftWidth - minPadding;
|
|
1586
1773
|
if (availableForRight > 0) {
|
|
1587
|
-
let truncatedRight =
|
|
1774
|
+
let truncatedRight = truncateToWidth3(rightSide, availableForRight, ""), truncatedRightWidth = visibleWidth3(truncatedRight), padding = " ".repeat(Math.max(0, width - statsLeftWidth - truncatedRightWidth));
|
|
1588
1775
|
statsLine = statsLeft + padding + truncatedRight;
|
|
1589
1776
|
} else
|
|
1590
1777
|
statsLine = statsLeft;
|
|
1591
1778
|
}
|
|
1592
|
-
let dimStatsLeft = theme.fg("dim", statsLeft), remainder = statsLine.slice(statsLeft.length), dimRemainder = theme.fg("dim", remainder), lines = [
|
|
1779
|
+
let dimStatsLeft = theme.fg("dim", statsLeft), remainder = statsLine.slice(statsLeft.length), dimRemainder = theme.fg("dim", remainder), lines = [truncateToWidth3(theme.fg("dim", pwd), width, theme.fg("dim", "...")), dimStatsLeft + dimRemainder], extensionStatuses = this.footerData.getExtensionStatuses();
|
|
1593
1780
|
if (extensionStatuses.size > 0) {
|
|
1594
1781
|
let statusLine = Array.from(extensionStatuses.entries()).sort(([a], [b]) => a.localeCompare(b)).map(([, text]) => sanitizeStatusText(text)).join(" ");
|
|
1595
|
-
lines.push(
|
|
1782
|
+
lines.push(truncateToWidth3(statusLine, width, theme.fg("dim", "...")));
|
|
1596
1783
|
}
|
|
1597
1784
|
return lines;
|
|
1598
1785
|
}
|
|
1599
1786
|
};
|
|
1600
1787
|
|
|
1601
1788
|
// packages/coding-agent/dist/modes/interactive/components/usage-view.js
|
|
1602
|
-
import { truncateToWidth as
|
|
1789
|
+
import { truncateToWidth as truncateToWidth4, visibleWidth as visibleWidth4 } from "@ashx-j/lunr-tui";
|
|
1603
1790
|
var BAR_CELLS = 20;
|
|
1604
1791
|
function usageLevelColor(percent) {
|
|
1605
1792
|
return percent > 90 ? "error" : percent > 70 ? "warning" : "success";
|
|
@@ -1637,9 +1824,9 @@ function planWindowLine(window, labelWidth) {
|
|
|
1637
1824
|
return ` ${window.label.padEnd(labelWidth)} ${usageBar(window.usedPercent)} ${pct}${reset}`;
|
|
1638
1825
|
}
|
|
1639
1826
|
function renderThemedBox(headerText, content, maxWidth) {
|
|
1640
|
-
let contentWidth = Math.max(...content.map((line) =>
|
|
1827
|
+
let contentWidth = Math.max(...content.map((line) => visibleWidth4(line))), totalWidth = Math.max(24, Math.min(contentWidth + 4, Math.max(24, maxWidth))), innerWidth = totalWidth - 4, border = (text) => theme.fg("border", text), top = border(`\u256D${headerText}${"\u2500".repeat(Math.max(0, totalWidth - 2 - headerText.length))}\u256E`), bottom = border(`\u2570${"\u2500".repeat(totalWidth - 2)}\u256F`), lines = [top];
|
|
1641
1828
|
for (let rawLine of content) {
|
|
1642
|
-
let line = rawLine.length > 0 ?
|
|
1829
|
+
let line = rawLine.length > 0 ? truncateToWidth4(rawLine, innerWidth, "") : "", padding = " ".repeat(Math.max(0, innerWidth - visibleWidth4(line)));
|
|
1643
1830
|
lines.push(`${border("\u2502 ")}${line}${padding}${border(" \u2502")}`);
|
|
1644
1831
|
}
|
|
1645
1832
|
return lines.push(bottom), lines;
|
|
@@ -1731,6 +1918,9 @@ var CustomEntryComponent = class extends Container4 {
|
|
|
1731
1918
|
setExpanded(expanded) {
|
|
1732
1919
|
this._expanded !== expanded && (this._expanded = expanded, this.rebuild());
|
|
1733
1920
|
}
|
|
1921
|
+
handleClick(localY, width) {
|
|
1922
|
+
return super.handleClick(localY, width) ? !0 : !this.customComponent || localY < 1 ? !1 : (this.setExpanded(!this._expanded), !0);
|
|
1923
|
+
}
|
|
1734
1924
|
invalidate() {
|
|
1735
1925
|
super.invalidate(), this.rebuild();
|
|
1736
1926
|
}
|
|
@@ -1762,6 +1952,9 @@ var CustomMessageComponent = class extends Container5 {
|
|
|
1762
1952
|
setExpanded(expanded) {
|
|
1763
1953
|
this._expanded !== expanded && (this._expanded = expanded, this.rebuild());
|
|
1764
1954
|
}
|
|
1955
|
+
handleClick(localY, width) {
|
|
1956
|
+
return super.handleClick(localY, width) ? !0 : !this.customRenderer || !this.customComponent || localY < 1 ? !1 : (this.setExpanded(!this._expanded), !0);
|
|
1957
|
+
}
|
|
1765
1958
|
invalidate() {
|
|
1766
1959
|
super.invalidate(), this.rebuild();
|
|
1767
1960
|
}
|
|
@@ -2410,7 +2603,7 @@ var PlanMessageComponent = class extends Container10 {
|
|
|
2410
2603
|
};
|
|
2411
2604
|
|
|
2412
2605
|
// packages/coding-agent/dist/modes/interactive/components/processes-selector.js
|
|
2413
|
-
import { Container as Container11, getKeybindings as getKeybindings5, Spacer as Spacer12, Text as Text13, truncateToWidth as
|
|
2606
|
+
import { Container as Container11, getKeybindings as getKeybindings5, Spacer as Spacer12, Text as Text13, truncateToWidth as truncateToWidth5 } from "@ashx-j/lunr-tui";
|
|
2414
2607
|
function formatElapsed(startedAt) {
|
|
2415
2608
|
let ms = Date.now() - startedAt, s = Math.floor(ms / 1e3);
|
|
2416
2609
|
if (s < 60)
|
|
@@ -2447,7 +2640,7 @@ var ProcessesSelectorComponent = class extends Container11 {
|
|
|
2447
2640
|
continue;
|
|
2448
2641
|
let elapsed = formatElapsed(p.startedAt), status;
|
|
2449
2642
|
p.status === "exited" ? status = `exited(${p.exitCode ?? "?"})` : p.status === "paused" ? status = "paused" : status = "running";
|
|
2450
|
-
let line = `${i === this.selected ? "\u25B8 " : " "}${p.pid} \xB7 ${status} \xB7 ${elapsed} \xB7 ${
|
|
2643
|
+
let line = `${i === this.selected ? "\u25B8 " : " "}${p.pid} \xB7 ${status} \xB7 ${elapsed} \xB7 ${truncateToWidth5(p.command, 60)}`, colored = i === this.selected ? theme.fg("accent", line) : theme.fg("dim", line);
|
|
2451
2644
|
this.addChild(new Text13(colored, 0, 0));
|
|
2452
2645
|
}
|
|
2453
2646
|
this.addChild(new Spacer12(1));
|
|
@@ -3422,6 +3615,14 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3422
3615
|
values: ["true", "false"],
|
|
3423
3616
|
disabled: () => config.hideThinkingBlock
|
|
3424
3617
|
},
|
|
3618
|
+
{
|
|
3619
|
+
id: "reasoning-display",
|
|
3620
|
+
label: "Reasoning display",
|
|
3621
|
+
description: "Auto uses one line for OpenAI Codex, four lines for other models. One line has a soft moving highlight.",
|
|
3622
|
+
currentValue: config.reasoningDisplay ?? "auto",
|
|
3623
|
+
values: ["auto", "one-line", "four-lines"],
|
|
3624
|
+
disabled: () => config.hideThinkingBlock
|
|
3625
|
+
},
|
|
3425
3626
|
{
|
|
3426
3627
|
id: "cache-miss-notices",
|
|
3427
3628
|
label: "Cache miss notices",
|
|
@@ -3466,6 +3667,13 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3466
3667
|
currentValue: config.computerForeground !== !1 ? "on" : "off",
|
|
3467
3668
|
values: ["on", "off"]
|
|
3468
3669
|
},
|
|
3670
|
+
{
|
|
3671
|
+
id: "browser-enabled",
|
|
3672
|
+
label: "Browser",
|
|
3673
|
+
description: "Browse JavaScript pages and interact with websites. Off closes the browser and hides its tool.",
|
|
3674
|
+
currentValue: config.browserEnabled ? "on" : "off",
|
|
3675
|
+
values: ["on", "off"]
|
|
3676
|
+
},
|
|
3469
3677
|
{
|
|
3470
3678
|
id: "agent-memory",
|
|
3471
3679
|
label: "Agent memory",
|
|
@@ -3473,6 +3681,13 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3473
3681
|
currentValue: config.memoryEnabled ? "on" : "off",
|
|
3474
3682
|
values: ["on", "off"]
|
|
3475
3683
|
},
|
|
3684
|
+
{
|
|
3685
|
+
id: "todos",
|
|
3686
|
+
label: "Todos",
|
|
3687
|
+
description: "Agent task list and todo tool",
|
|
3688
|
+
currentValue: config.todosEnabled ? "on" : "off",
|
|
3689
|
+
values: ["on", "off"]
|
|
3690
|
+
},
|
|
3476
3691
|
{
|
|
3477
3692
|
id: "memory-char-cap",
|
|
3478
3693
|
label: "Memory character cap",
|
|
@@ -3501,12 +3716,29 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3501
3716
|
currentValue: DEFAULT_PROJECT_TRUST_LABELS[config.defaultProjectTrust],
|
|
3502
3717
|
values: Object.values(DEFAULT_PROJECT_TRUST_LABELS)
|
|
3503
3718
|
},
|
|
3719
|
+
{
|
|
3720
|
+
id: "gateway",
|
|
3721
|
+
label: "Gateway",
|
|
3722
|
+
description: "Phone access and automatic startup",
|
|
3723
|
+
currentValue: "manage",
|
|
3724
|
+
submenu: (_value, done) => new SelectSubmenu("Gateway", "Boot startup may require administrator permission. Setup manages bot accounts and approved folders.", [
|
|
3725
|
+
{ value: "setup", label: "Set up Telegram or Discord" },
|
|
3726
|
+
{ value: "status", label: "Show gateway status" },
|
|
3727
|
+
{ value: "start", label: "Start gateway" },
|
|
3728
|
+
{ value: "stop", label: "Stop gateway" },
|
|
3729
|
+
{ value: "autostart login", label: "Start automatically at login" },
|
|
3730
|
+
{ value: "autostart boot", label: "Start automatically at boot" },
|
|
3731
|
+
{ value: "autostart off", label: "Disable automatic startup" }
|
|
3732
|
+
], "", (action) => {
|
|
3733
|
+
done(), callbacks.onGatewayAction?.(action);
|
|
3734
|
+
}, () => done())
|
|
3735
|
+
},
|
|
3504
3736
|
{
|
|
3505
3737
|
id: "default-permission-mode",
|
|
3506
3738
|
label: "Default permission mode",
|
|
3507
3739
|
description: "Starting permission mode for new sessions",
|
|
3508
|
-
currentValue: config.defaultPermissionMode,
|
|
3509
|
-
values: ["
|
|
3740
|
+
currentValue: config.defaultPermissionMode === "read-only" ? "read" : config.defaultPermissionMode,
|
|
3741
|
+
values: ["yolo", "auto", "read"]
|
|
3510
3742
|
},
|
|
3511
3743
|
{
|
|
3512
3744
|
id: "double-escape-action",
|
|
@@ -3556,6 +3788,20 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3556
3788
|
currentValue: config.modelInstructions.enabled ? "on" : "off",
|
|
3557
3789
|
submenu: (_currentValue, done) => new ModelInstructionsSubmenu(config, callbacks, done)
|
|
3558
3790
|
},
|
|
3791
|
+
{
|
|
3792
|
+
id: "subagent-communication",
|
|
3793
|
+
label: "Subagent communication",
|
|
3794
|
+
description: "Allow parent and child to exchange messages during a task",
|
|
3795
|
+
currentValue: config.subagentCommunicationEnabled ? "on" : "off",
|
|
3796
|
+
values: ["on", "off"]
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
id: "automatic-subagent-delegation",
|
|
3800
|
+
label: "Automatic subagent delegation",
|
|
3801
|
+
description: "Let the agent decide when to delegate work",
|
|
3802
|
+
currentValue: config.automaticSubagentDelegation ? "on" : "off",
|
|
3803
|
+
values: ["on", "off"]
|
|
3804
|
+
},
|
|
3559
3805
|
{
|
|
3560
3806
|
id: "confirm-large-subagent-launches",
|
|
3561
3807
|
label: "Confirm large subagent launches",
|
|
@@ -3734,6 +3980,9 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3734
3980
|
case "thinking-collapse":
|
|
3735
3981
|
callbacks.onThinkingCollapseChange(newValue === "true");
|
|
3736
3982
|
break;
|
|
3983
|
+
case "reasoning-display":
|
|
3984
|
+
(newValue === "auto" || newValue === "one-line" || newValue === "four-lines") && callbacks.onReasoningDisplayChange(newValue);
|
|
3985
|
+
break;
|
|
3737
3986
|
case "cache-miss-notices":
|
|
3738
3987
|
callbacks.onShowCacheMissNoticesChange(newValue === "true");
|
|
3739
3988
|
break;
|
|
@@ -3746,6 +3995,12 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3746
3995
|
case "smooth-streaming":
|
|
3747
3996
|
callbacks.onSmoothStreamingChange(newValue === "true");
|
|
3748
3997
|
break;
|
|
3998
|
+
case "subagent-communication":
|
|
3999
|
+
callbacks.onSubagentCommunicationChange(newValue === "on");
|
|
4000
|
+
break;
|
|
4001
|
+
case "automatic-subagent-delegation":
|
|
4002
|
+
callbacks.onAutomaticSubagentDelegationChange(newValue === "on");
|
|
4003
|
+
break;
|
|
3749
4004
|
case "plan-usage-window":
|
|
3750
4005
|
callbacks.onPlanUsageWindowChange(newValue === "5h" ? "5h" : "weekly");
|
|
3751
4006
|
break;
|
|
@@ -3758,9 +4013,15 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3758
4013
|
case "computer-foreground":
|
|
3759
4014
|
callbacks.onComputerForegroundChange?.(newValue === "on");
|
|
3760
4015
|
break;
|
|
4016
|
+
case "browser-enabled":
|
|
4017
|
+
callbacks.onBrowserEnabledChange(newValue === "on");
|
|
4018
|
+
break;
|
|
3761
4019
|
case "agent-memory":
|
|
3762
4020
|
callbacks.onMemoryEnabledChange(newValue === "on");
|
|
3763
4021
|
break;
|
|
4022
|
+
case "todos":
|
|
4023
|
+
callbacks.onTodosEnabledChange(newValue === "on");
|
|
4024
|
+
break;
|
|
3764
4025
|
case "search-curator":
|
|
3765
4026
|
callbacks.onSearchCuratorChange(newValue);
|
|
3766
4027
|
break;
|
|
@@ -3773,7 +4034,7 @@ var ThemeSubmenu = class extends Container13 {
|
|
|
3773
4034
|
break;
|
|
3774
4035
|
}
|
|
3775
4036
|
case "default-permission-mode":
|
|
3776
|
-
callbacks.onDefaultPermissionModeChange(newValue);
|
|
4037
|
+
callbacks.onDefaultPermissionModeChange(newValue === "read" ? "read-only" : newValue);
|
|
3777
4038
|
break;
|
|
3778
4039
|
case "double-escape-action":
|
|
3779
4040
|
callbacks.onDoubleEscapeActionChange(newValue);
|
|
@@ -3925,7 +4186,6 @@ var ToolExecutionComponent = class extends Container14 {
|
|
|
3925
4186
|
hideComponent = !1;
|
|
3926
4187
|
groupContinuation = !1;
|
|
3927
4188
|
groupFollowed = !1;
|
|
3928
|
-
groupPrev;
|
|
3929
4189
|
groupNext;
|
|
3930
4190
|
constructor(toolName, toolCallId, args, options = {}, toolDefinition, ui, cwd) {
|
|
3931
4191
|
super(), this.toolName = toolName, this.toolCallId = toolCallId, this.args = args, this.toolDefinition = toolDefinition, this.builtInToolDefinition = createAllToolDefinitions(cwd)[toolName], this.showImages = options.showImages ?? !0, this.imageWidthCells = options.imageWidthCells ?? 60, this.ui = ui, this.cwd = cwd, this.topSpacer = new Spacer15(1), this.addChild(this.topSpacer), this.contentBox = new Box7(1, 1, (text) => theme.bg("toolPendingBg", text)), this.contentText = new Text17("", 1, 1, (text) => theme.bg("toolPendingBg", text)), this.selfRenderContainer = new Container14(), this.hasRendererDefinition() ? this.addChild(this.getRenderShell() === "self" ? this.selfRenderContainer : this.contentBox) : this.addChild(this.contentText), this.updateDisplay();
|
|
@@ -3969,13 +4229,18 @@ var ToolExecutionComponent = class extends Container14 {
|
|
|
3969
4229
|
let state = this.isPartial ? "pending" : this.result?.isError ? "error" : "success";
|
|
3970
4230
|
return toolStatusDot(state, theme);
|
|
3971
4231
|
}
|
|
4232
|
+
getWaitDuration() {
|
|
4233
|
+
return this.toolName !== "subagent_wait" || this.isPartial || this.expanded ? void 0 : /^(?:Waited |Wait (?:timed out|aborted) after )(\d+(?:ms|[smhd])(?:\d+[smhd])*)\b/.exec(this.getTextOutput())?.[1];
|
|
4234
|
+
}
|
|
3972
4235
|
createCallFallback() {
|
|
4236
|
+
let waitDuration = this.getWaitDuration();
|
|
3973
4237
|
return new Text17(formatGroupedCall({
|
|
3974
4238
|
role: toolGroupRole(this.groupContinuation, this.groupFollowed),
|
|
3975
4239
|
compact: !this.isPartial && !this.expanded && !this.result?.isError,
|
|
3976
4240
|
tree: toolGroupTree({ expanded: this.expanded, isError: this.result?.isError }),
|
|
3977
4241
|
dot: this.getStatusDot(),
|
|
3978
|
-
title: theme.fg("toolTitle", theme.bold(this.toolName))
|
|
4242
|
+
title: theme.fg("toolTitle", theme.bold(this.toolName)),
|
|
4243
|
+
detail: waitDuration && theme.fg("toolOutput", waitDuration)
|
|
3979
4244
|
}), 0, 0);
|
|
3980
4245
|
}
|
|
3981
4246
|
createResultFallback() {
|
|
@@ -4010,16 +4275,30 @@ var ToolExecutionComponent = class extends Container14 {
|
|
|
4010
4275
|
}
|
|
4011
4276
|
}
|
|
4012
4277
|
setExpanded(expanded) {
|
|
4013
|
-
this.expanded = expanded, this.updateDisplay(), this.refreshGroupTail();
|
|
4278
|
+
this.toolName !== "browser" && (this.expanded = expanded, this.updateDisplay(), this.refreshGroupTail());
|
|
4014
4279
|
}
|
|
4015
4280
|
handleClick(_localY, _width) {
|
|
4016
|
-
return this.isPartial || this.toolName === "
|
|
4281
|
+
return this.isPartial || this.toolName === "browser" || this.toolName === "subagent" ? !1 : (this.setExpanded(!this.expanded), this.ui.requestRender(), !0);
|
|
4282
|
+
}
|
|
4283
|
+
beginNextExecution(toolCallId, args) {
|
|
4284
|
+
this.toolCallId = toolCallId, this.args = args, this.result = void 0, this.isPartial = !0, this.executionStarted = !1, this.argsComplete = !1, this.expanded = !1, this.disposeComponent(this.resultRendererComponent), this.resultRendererComponent = void 0, this.updateDisplay();
|
|
4285
|
+
}
|
|
4286
|
+
dispose() {
|
|
4287
|
+
let components = /* @__PURE__ */ new Set([this.callRendererComponent, this.resultRendererComponent]);
|
|
4288
|
+
for (let component of components)
|
|
4289
|
+
this.disposeComponent(component);
|
|
4290
|
+
}
|
|
4291
|
+
disposeComponent(component) {
|
|
4292
|
+
component?.dispose?.();
|
|
4017
4293
|
}
|
|
4018
4294
|
// lunr: consecutive same-tool grouping — exposes the tool name so the caller
|
|
4019
4295
|
// can detect adjacency.
|
|
4020
4296
|
getToolName() {
|
|
4021
4297
|
return this.toolName;
|
|
4022
4298
|
}
|
|
4299
|
+
matchesToolCall(toolCallId) {
|
|
4300
|
+
return this.toolCallId === toolCallId;
|
|
4301
|
+
}
|
|
4023
4302
|
// lunr: consecutive same-tool grouping — continuation calls hide the top
|
|
4024
4303
|
// spacer and top box pad so adjacent same-bg boxes read as one continuous
|
|
4025
4304
|
// background; the last card in a run keeps its bottom pad.
|
|
@@ -4031,41 +4310,22 @@ var ToolExecutionComponent = class extends Container14 {
|
|
|
4031
4310
|
setGroupFollowed(on) {
|
|
4032
4311
|
this.groupFollowed = on, this.applyGroupPadding(), this.invalidate();
|
|
4033
4312
|
}
|
|
4034
|
-
// lunr: same-name run link
|
|
4035
|
-
// under the last leaf instead of splitting the tree.
|
|
4313
|
+
// lunr: same-name run link keeps the final card refreshed as earlier calls settle.
|
|
4036
4314
|
linkGroupNext(next) {
|
|
4037
|
-
this.groupNext = next
|
|
4315
|
+
this.groupNext = next;
|
|
4038
4316
|
}
|
|
4039
4317
|
applyGroupPadding() {
|
|
4040
4318
|
let top = this.groupContinuation ? 0 : 1, bottom = this.groupFollowed ? 0 : 1;
|
|
4041
4319
|
this.contentBox.setPaddingTop(top), this.contentBox.setPaddingBottom(bottom), this.contentText.setPaddingTop(top), this.contentText.setPaddingBottom(bottom), this.getRenderShell() === "self" && this.callRendererComponent instanceof Box7 && (this.callRendererComponent.setPaddingTop(top), this.callRendererComponent.setPaddingBottom(bottom));
|
|
4042
4320
|
}
|
|
4043
|
-
shouldHideGroupedErrorBody() {
|
|
4044
|
-
return !!this.result?.isError && this.groupFollowed && !this.expanded && !this.isPartial && this.getRenderShell() === "default" && this.toolName !== "subagent" && this.toolName !== "subagent_wait";
|
|
4045
|
-
}
|
|
4046
4321
|
shouldSkipCompactResult() {
|
|
4047
4322
|
if (this.result === void 0 || this.isPartial || this.expanded)
|
|
4048
4323
|
return !1;
|
|
4049
4324
|
if (this.toolName === "subagent") {
|
|
4050
4325
|
let details = this.result.details;
|
|
4051
|
-
return !(this.result.isError || Array.isArray(details?.results) && details.results.length > 0 || details?.mode === "management");
|
|
4326
|
+
return !this.result.isError && this.args?.action === "steer" ? !0 : !(this.result.isError || Array.isArray(details?.results) && details.results.length > 0 || details?.mode === "management");
|
|
4052
4327
|
}
|
|
4053
|
-
return this.result.isError ?
|
|
4054
|
-
}
|
|
4055
|
-
formatHoistedGroupErrors() {
|
|
4056
|
-
if (this.groupFollowed || this.expanded)
|
|
4057
|
-
return;
|
|
4058
|
-
let texts = [], prev = this.groupPrev;
|
|
4059
|
-
for (; prev; ) {
|
|
4060
|
-
if (prev.shouldHideGroupedErrorBody()) {
|
|
4061
|
-
let output = prev.getTextOutput().trim();
|
|
4062
|
-
output && texts.unshift(output);
|
|
4063
|
-
}
|
|
4064
|
-
prev = prev.groupPrev;
|
|
4065
|
-
}
|
|
4066
|
-
return texts.length > 0 ? `
|
|
4067
|
-
${texts.join(`
|
|
4068
|
-
`)}` : void 0;
|
|
4328
|
+
return this.toolName === "subagent_wait" || this.result.isError ? !0 : this.getRenderShell() === "default";
|
|
4069
4329
|
}
|
|
4070
4330
|
refreshGroupTail() {
|
|
4071
4331
|
let next = this.groupNext;
|
|
@@ -4133,8 +4393,6 @@ ${texts.join(`
|
|
|
4133
4393
|
let component = this.createResultFallback();
|
|
4134
4394
|
component && (renderContainer.addChild(component), hasContent = !0);
|
|
4135
4395
|
}
|
|
4136
|
-
let hoisted = this.formatHoistedGroupErrors();
|
|
4137
|
-
hoisted && (renderContainer.addChild(new Text17(theme.fg("toolOutput", hoisted), 0, 0)), hasContent = !0);
|
|
4138
4396
|
}
|
|
4139
4397
|
} else
|
|
4140
4398
|
this.contentText.setCustomBgFn(bgFn), this.contentText.setText(this.formatToolExecution()), hasContent = !0;
|
|
@@ -4164,12 +4422,13 @@ ${texts.join(`
|
|
|
4164
4422
|
return getTextOutput(this.result, this.showImages);
|
|
4165
4423
|
}
|
|
4166
4424
|
formatToolExecution() {
|
|
4167
|
-
let
|
|
4425
|
+
let compact = !this.isPartial && !this.expanded, waitDuration = this.getWaitDuration(), text = formatGroupedCall({
|
|
4168
4426
|
role: toolGroupRole(this.groupContinuation, this.groupFollowed),
|
|
4169
4427
|
compact,
|
|
4170
4428
|
tree: toolGroupTree({ expanded: this.expanded, isError: this.result?.isError }),
|
|
4171
4429
|
dot: this.getStatusDot(),
|
|
4172
|
-
title: theme.fg("toolTitle", theme.bold(this.toolName))
|
|
4430
|
+
title: theme.fg("toolTitle", theme.bold(this.toolName)),
|
|
4431
|
+
detail: waitDuration && theme.fg("toolOutput", waitDuration)
|
|
4173
4432
|
});
|
|
4174
4433
|
if (!compact) {
|
|
4175
4434
|
let content = JSON.stringify(this.args, null, 2);
|
|
@@ -4180,8 +4439,7 @@ ${content}`);
|
|
|
4180
4439
|
output && (text += `
|
|
4181
4440
|
${output}`);
|
|
4182
4441
|
}
|
|
4183
|
-
|
|
4184
|
-
return hoisted && (text += hoisted), text;
|
|
4442
|
+
return text;
|
|
4185
4443
|
}
|
|
4186
4444
|
};
|
|
4187
4445
|
function applySameToolGrouping(previous, next) {
|
|
@@ -4189,7 +4447,7 @@ function applySameToolGrouping(previous, next) {
|
|
|
4189
4447
|
}
|
|
4190
4448
|
|
|
4191
4449
|
// packages/coding-agent/dist/modes/interactive/components/tree-selector.js
|
|
4192
|
-
import { Container as Container15, getKeybindings as getKeybindings8, Input as Input6, Spacer as Spacer16, sliceByColumn, Text as Text18, truncateToWidth as
|
|
4450
|
+
import { Container as Container15, getKeybindings as getKeybindings8, Input as Input6, Spacer as Spacer16, sliceByColumn, Text as Text18, truncateToWidth as truncateToWidth6, visibleWidth as visibleWidth5, wrapTextWithAnsi as wrapTextWithAnsi2 } from "@ashx-j/lunr-tui";
|
|
4193
4451
|
var TREE_GUTTER_WIDTH = 2, MIN_VISIBLE_ANCHOR_CONTENT_WIDTH = 4, MAX_VISIBLE_ANCHOR_CONTENT_WIDTH = 20, MIN_ANCHOR_CONTEXT_WIDTH = 2, MAX_ANCHOR_CONTEXT_WIDTH = 12;
|
|
4194
4452
|
function renderHorizontalViewport(rows, width) {
|
|
4195
4453
|
let viewportWidth = Math.max(0, width - TREE_GUTTER_WIDTH), maxBodyWidth = rows.reduce((max, row) => Math.max(max, row.bodyWidth), 0), maxHorizontalScroll = Math.max(0, maxBodyWidth - viewportWidth), selectedRow = rows.find((row) => row.isSelected), horizontalScroll = 0;
|
|
@@ -4202,7 +4460,7 @@ function renderHorizontalViewport(rows, width) {
|
|
|
4202
4460
|
}
|
|
4203
4461
|
return rows.map((row) => {
|
|
4204
4462
|
let line = horizontalScroll > 0 ? `${row.gutter}${sliceByColumn(row.body, horizontalScroll, viewportWidth, !0)}\x1B[0m` : row.gutter + row.body;
|
|
4205
|
-
return
|
|
4463
|
+
return truncateToWidth6(line, width, "");
|
|
4206
4464
|
});
|
|
4207
4465
|
}
|
|
4208
4466
|
var TreeList = class {
|
|
@@ -4520,7 +4778,7 @@ var TreeList = class {
|
|
|
4520
4778
|
render(width) {
|
|
4521
4779
|
let lines = [];
|
|
4522
4780
|
if (this.filteredNodes.length === 0)
|
|
4523
|
-
return lines.push(
|
|
4781
|
+
return lines.push(truncateToWidth6(theme.fg("muted", " No entries found"), width)), lines.push(truncateToWidth6(theme.fg("muted", ` (0/0)${this.getStatusLabels()}`), width)), lines;
|
|
4524
4782
|
let startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisibleLines / 2), this.filteredNodes.length - this.maxVisibleLines)), endIndex = Math.min(startIndex + this.maxVisibleLines, this.filteredNodes.length), renderedRows = [];
|
|
4525
4783
|
for (let i = startIndex; i < endIndex; i++) {
|
|
4526
4784
|
let flatNode = this.filteredNodes[i], entry = flatNode.node.entry, isSelected = i === this.selectedIndex, cursor = isSelected ? theme.fg("accent", "\u203A ") : " ", displayIndent = this.multipleRoots ? Math.max(0, flatNode.indent - 1) : flatNode.indent, connector = flatNode.showConnector && !flatNode.isVirtualRootChild ? flatNode.isLast ? "\u2514\u2500 " : "\u251C\u2500 " : "", connectorPosition = connector ? displayIndent - 1 : -1, totalChars = displayIndent * 3, prefixChars = [], isFolded = this.foldedNodes.has(entry.id);
|
|
@@ -4539,10 +4797,10 @@ var TreeList = class {
|
|
|
4539
4797
|
else
|
|
4540
4798
|
prefixChars.push(" ");
|
|
4541
4799
|
}
|
|
4542
|
-
let prefix = prefixChars.join(""), showsFoldInConnector = flatNode.showConnector && !flatNode.isVirtualRootChild, foldMarker = isFolded && !showsFoldInConnector ? theme.fg("accent", "\u229E ") : "", pathMarker = this.activePathIds.has(entry.id) ? theme.fg("accent", "\u2022 ") : "", label = flatNode.node.label ? theme.fg("warning", `[${flatNode.node.label}] `) : "", labelTimestamp = this.showLabelTimestamps && flatNode.node.label && flatNode.node.labelTimestamp ? theme.fg("muted", `${this.formatLabelTimestamp(flatNode.node.labelTimestamp)} `) : "", content = this.getEntryDisplayText(flatNode.node, isSelected), prefixPart = theme.fg("dim", prefix) + foldMarker + pathMarker, anchorCol =
|
|
4543
|
-
isSelected && (gutter = theme.bg("selectedBg", gutter), body = theme.bg("selectedBg", body)), renderedRows.push({ gutter, body, anchorCol, bodyWidth:
|
|
4800
|
+
let prefix = prefixChars.join(""), showsFoldInConnector = flatNode.showConnector && !flatNode.isVirtualRootChild, foldMarker = isFolded && !showsFoldInConnector ? theme.fg("accent", "\u229E ") : "", pathMarker = this.activePathIds.has(entry.id) ? theme.fg("accent", "\u2022 ") : "", label = flatNode.node.label ? theme.fg("warning", `[${flatNode.node.label}] `) : "", labelTimestamp = this.showLabelTimestamps && flatNode.node.label && flatNode.node.labelTimestamp ? theme.fg("muted", `${this.formatLabelTimestamp(flatNode.node.labelTimestamp)} `) : "", content = this.getEntryDisplayText(flatNode.node, isSelected), prefixPart = theme.fg("dim", prefix) + foldMarker + pathMarker, anchorCol = visibleWidth5(prefixPart), gutter = cursor, body = prefixPart + label + labelTimestamp + content;
|
|
4801
|
+
isSelected && (gutter = theme.bg("selectedBg", gutter), body = theme.bg("selectedBg", body)), renderedRows.push({ gutter, body, anchorCol, bodyWidth: visibleWidth5(body), isSelected });
|
|
4544
4802
|
}
|
|
4545
|
-
return lines.push(...renderHorizontalViewport(renderedRows, width)), lines.push(
|
|
4803
|
+
return lines.push(...renderHorizontalViewport(renderedRows, width)), lines.push(truncateToWidth6(theme.fg("muted", ` (${this.selectedIndex + 1}/${this.filteredNodes.length})${this.getStatusLabels()}`), width)), lines;
|
|
4546
4804
|
}
|
|
4547
4805
|
getEntryDisplayText(node, isSelected) {
|
|
4548
4806
|
let entry = node.entry, result, normalize = (s) => s.replace(/[\n\t]/g, " ").trim();
|
|
@@ -4801,7 +5059,7 @@ var TreeList = class {
|
|
|
4801
5059
|
}
|
|
4802
5060
|
render(width) {
|
|
4803
5061
|
let query = this.treeList.getSearchQuery();
|
|
4804
|
-
return query ? [
|
|
5062
|
+
return query ? [truncateToWidth6(` ${theme.fg("muted", "Type to search:")} ${theme.fg("accent", query)}`, width)] : [truncateToWidth6(` ${theme.fg("muted", "Type to search:")}`, width)];
|
|
4805
5063
|
}
|
|
4806
5064
|
handleInput(_keyData) {
|
|
4807
5065
|
}
|
|
@@ -4814,14 +5072,14 @@ var TreeList = class {
|
|
|
4814
5072
|
return text ? labelFirst ? `${label} ${text}` : `${text} ${label}` : label;
|
|
4815
5073
|
}), availableWidth = Math.max(1, width), indent = " ", separator = " \xB7 ", lines = [], currentLine = "";
|
|
4816
5074
|
for (let item of items) {
|
|
4817
|
-
let candidate = currentLine ? `${currentLine}${separator}${item}` :
|
|
4818
|
-
if (!currentLine ||
|
|
5075
|
+
let candidate = currentLine ? `${currentLine}${separator}${item}` : visibleWidth5(`${indent}${item}`) <= availableWidth ? `${indent}${item}` : item;
|
|
5076
|
+
if (!currentLine || visibleWidth5(candidate) <= availableWidth) {
|
|
4819
5077
|
currentLine = candidate;
|
|
4820
5078
|
continue;
|
|
4821
5079
|
}
|
|
4822
|
-
lines.push(...
|
|
5080
|
+
lines.push(...wrapTextWithAnsi2(currentLine.trimEnd(), availableWidth)), currentLine = visibleWidth5(`${indent}${item}`) <= availableWidth ? `${indent}${item}` : item;
|
|
4823
5081
|
}
|
|
4824
|
-
return currentLine && lines.push(...
|
|
5082
|
+
return currentLine && lines.push(...wrapTextWithAnsi2(currentLine.trimEnd(), availableWidth)), lines.map((line) => theme.fg("muted", line));
|
|
4825
5083
|
}
|
|
4826
5084
|
}, TREE_HELP_ITEMS = [
|
|
4827
5085
|
{ keys: ["tui.select.up", "tui.select.down"], label: "move" },
|
|
@@ -4880,7 +5138,7 @@ var LabelInput = class {
|
|
|
4880
5138
|
}
|
|
4881
5139
|
render(width) {
|
|
4882
5140
|
let lines = [], availableWidth = width - 2;
|
|
4883
|
-
return lines.push(
|
|
5141
|
+
return lines.push(truncateToWidth6(` ${theme.fg("muted", "Label (empty to remove):")}`, width)), lines.push(...this.input.render(availableWidth).map((line) => truncateToWidth6(` ${line}`, width))), lines.push(truncateToWidth6(` ${keyHint("tui.select.confirm", "save")} ${keyHint("tui.select.cancel", "cancel")}`, width)), lines;
|
|
4884
5142
|
}
|
|
4885
5143
|
handleInput(keyData) {
|
|
4886
5144
|
let kb = getKeybindings8();
|
|
@@ -4997,7 +5255,7 @@ var OSC133_ZONE_START2 = "\x1B]133;A\x07", OSC133_ZONE_END2 = "\x1B]133;B\x07",
|
|
|
4997
5255
|
};
|
|
4998
5256
|
|
|
4999
5257
|
// packages/coding-agent/dist/modes/interactive/components/user-message-selector.js
|
|
5000
|
-
import { Container as Container18, getKeybindings as getKeybindings10, Spacer as Spacer18, Text as Text20, truncateToWidth as
|
|
5258
|
+
import { Container as Container18, getKeybindings as getKeybindings10, Spacer as Spacer18, Text as Text20, truncateToWidth as truncateToWidth7 } from "@ashx-j/lunr-tui";
|
|
5001
5259
|
var UserMessageList = class {
|
|
5002
5260
|
messages = [];
|
|
5003
5261
|
selectedIndex = 0;
|
|
@@ -5018,7 +5276,7 @@ var UserMessageList = class {
|
|
|
5018
5276
|
return lines.push(theme.fg("muted", " No user messages found")), lines;
|
|
5019
5277
|
let startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.messages.length - this.maxVisible)), endIndex = Math.min(startIndex + this.maxVisible, this.messages.length);
|
|
5020
5278
|
for (let i = startIndex; i < endIndex; i++) {
|
|
5021
|
-
let message = this.messages[i], isSelected = i === this.selectedIndex, normalizedMessage = message.text.replace(/\n/g, " ").trim(), cursor = isSelected ? theme.fg("accent", "\u203A ") : " ", maxMsgWidth = width - 2, truncatedMsg =
|
|
5279
|
+
let message = this.messages[i], isSelected = i === this.selectedIndex, normalizedMessage = message.text.replace(/\n/g, " ").trim(), cursor = isSelected ? theme.fg("accent", "\u203A ") : " ", maxMsgWidth = width - 2, truncatedMsg = truncateToWidth7(normalizedMessage, maxMsgWidth), messageLine = cursor + (isSelected ? theme.bold(truncatedMsg) : truncatedMsg);
|
|
5022
5280
|
lines.push(messageLine);
|
|
5023
5281
|
let metadata = ` Message ${i + 1} of ${this.messages.length}`, metadataLine = theme.fg("muted", metadata);
|
|
5024
5282
|
lines.push(metadataLine), lines.push("");
|
|
@@ -5327,7 +5585,7 @@ function isDeadTerminalError(error) {
|
|
|
5327
5585
|
let code = error.code;
|
|
5328
5586
|
return code !== void 0 && DEAD_TERMINAL_ERROR_CODES.has(code);
|
|
5329
5587
|
}
|
|
5330
|
-
var ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscription
|
|
5588
|
+
var ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Claude Code handles Anthropic subscription authentication. lunR retains tool execution and conversation state. Check your Claude account for usage and any extra charges.", ANTHROPIC_TOS_DISCLAIMER = "Connecting an Anthropic subscription through Claude Code may be subject to Anthropic's Terms of Service (https://www.anthropic.com/legal/consumer-terms). Claude Code authenticates each lunR generation; lunR keeps its own tools and history. Continue?", INIT_PROMPT = `Analyze this codebase and write a starter AGENTS.md in the project root.
|
|
5331
5589
|
Scan: package manifests, directory layout, build/test/lint scripts, CI config,
|
|
5332
5590
|
existing README/docs. Include only: project purpose (one paragraph), build &
|
|
5333
5591
|
test commands, code style/conventions found, directory map, and agent rules
|
|
@@ -5440,8 +5698,10 @@ var InteractiveMode = class _InteractiveMode {
|
|
|
5440
5698
|
streamingTargetMessage = void 0;
|
|
5441
5699
|
streamingDisplayedLength = 0;
|
|
5442
5700
|
smoothStreamingTimer = void 0;
|
|
5701
|
+
thinkingAnimationTimer;
|
|
5443
5702
|
// Tool execution tracking: toolCallId -> component
|
|
5444
5703
|
pendingTools = /* @__PURE__ */ new Map();
|
|
5704
|
+
browserActivityComponent;
|
|
5445
5705
|
// Tool output expansion state
|
|
5446
5706
|
toolOutputExpanded = !1;
|
|
5447
5707
|
// Thinking block visibility state
|
|
@@ -5460,8 +5720,7 @@ var InteractiveMode = class _InteractiveMode {
|
|
|
5460
5720
|
signalCleanupHandlers = [];
|
|
5461
5721
|
// Track if editor is in bash mode (text starts with !)
|
|
5462
5722
|
isBashMode = !1;
|
|
5463
|
-
//
|
|
5464
|
-
// / `/plan <text>` to leave plan. Shift+Tab and `/mode` pick the destination themselves.
|
|
5723
|
+
// Restore the previous mode after approving a plan or leaving read-only via /plan.
|
|
5465
5724
|
previousPermissionMode;
|
|
5466
5725
|
// lunr: mode in effect before `/goal` forced session auto. Dedicated so it cannot
|
|
5467
5726
|
// collide with plan restore.
|
|
@@ -5526,11 +5785,13 @@ var InteractiveMode = class _InteractiveMode {
|
|
|
5526
5785
|
this.runtimeHost = runtimeHost, this.options = options, this.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd, this.runtimeHost.setBeforeSessionInvalidate((reason) => {
|
|
5527
5786
|
this.resetExtensionUI(), this.previousPermissionMode = void 0, this.preGoalPermissionMode = void 0, resetPermissions(this.settingsManager.getDefaultPermissionMode()), clearRegistry(), reason !== "fork" && clearRollback(this.sessionManager.getSessionId());
|
|
5528
5787
|
}), this.runtimeHost.setRebindSession(async () => {
|
|
5529
|
-
await this.rebindCurrentSession({ renderBeforeBind: !0 }), initRollback(this.settingsManager, this.sessionManager.getSessionId())
|
|
5788
|
+
await this.rebindCurrentSession({ renderBeforeBind: !0 }), initRollback(this.settingsManager, this.sessionManager.getSessionId());
|
|
5789
|
+
let mode = this.sessionManager.getPermissionMode() ?? this.settingsManager.getDefaultPermissionMode();
|
|
5790
|
+
resetPermissions(mode), this.syncPermissionModeEffects(mode);
|
|
5530
5791
|
}), this.version = VERSION, this.ui = options.startupView?.ui ?? new TUI(new ProcessTerminal(), this.settingsManager.getShowHardwareCursor()), this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink()), registerPermissionModeBridge(() => getPermissionMode()), registerPermissionModeControlBridge({
|
|
5531
5792
|
enterGoalAuto: () => this.enterGoalAuto(),
|
|
5532
5793
|
leaveGoalAuto: () => this.leaveGoalAuto()
|
|
5533
|
-
}), resetPermissions(this.settingsManager.getDefaultPermissionMode()), this.headerContainer = new Container19(), options.startupView && (this.headerContainer.addChild(new Spacer19(1)), this.headerContainer.addChild(options.startupView.header), this.customFooter = options.startupView.footer), this.loadedResourcesContainer = new Container19(), this.chatContainer = new Container19(), this.pendingMessagesContainer = new Container19(), this.statusContainer = options.startupView?.statusContainer ?? new Container19(), this.widgetContainerAbove = new Container19(), this.widgetContainerBelow = new Container19(), this.keybindings = options.startupView?.keybindings ?? KeybindingsManager.create(), setKeybindings(this.keybindings);
|
|
5794
|
+
}), resetPermissions(this.sessionManager.getPermissionMode() ?? this.settingsManager.getDefaultPermissionMode()), this.headerContainer = new Container19(), options.startupView && (this.headerContainer.addChild(new Spacer19(1)), this.headerContainer.addChild(options.startupView.header), this.customFooter = options.startupView.footer), this.loadedResourcesContainer = new Container19(), this.chatContainer = new Container19(), this.pendingMessagesContainer = new Container19(), this.statusContainer = options.startupView?.statusContainer ?? new Container19(), this.widgetContainerAbove = new Container19(), this.widgetContainerBelow = new Container19(), this.keybindings = options.startupView?.keybindings ?? KeybindingsManager.create(), setKeybindings(this.keybindings);
|
|
5534
5795
|
let editorPaddingX = this.settingsManager.getEditorPaddingX(), autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
5535
5796
|
this.defaultEditor = options.startupView?.editor ?? new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {
|
|
5536
5797
|
paddingX: editorPaddingX,
|
|
@@ -5646,10 +5907,14 @@ var InteractiveMode = class _InteractiveMode {
|
|
|
5646
5907
|
return this.showLargeSubagentLaunchApprovalDialog(req);
|
|
5647
5908
|
if (req.kind === "plan") {
|
|
5648
5909
|
let resp = await this.showPlanApprovalDialog(req.detail);
|
|
5649
|
-
|
|
5910
|
+
if ((typeof resp == "string" ? resp : resp.decision) !== "reject") {
|
|
5911
|
+
let target = this.restoreTargetAfterPlan();
|
|
5912
|
+
this.applyPermissionMode(target === "read-only" ? "yolo" : target);
|
|
5913
|
+
}
|
|
5914
|
+
return resp;
|
|
5650
5915
|
}
|
|
5651
|
-
return
|
|
5652
|
-
}), initRollback(this.settingsManager, this.sessionManager.getSessionId()), setRollbackWarningHandler((msg) => this.showStatus(msg)), this.syncPermissionModeEffects(this.settingsManager.getDefaultPermissionMode()), await this.themeController.applyFromSettings(), this.headerContainer.clear(), this.options.verbose || !this.settingsManager.getQuietStartup()) {
|
|
5916
|
+
return "reject";
|
|
5917
|
+
}), initRollback(this.settingsManager, this.sessionManager.getSessionId()), setRollbackWarningHandler((msg) => this.showStatus(msg)), this.syncPermissionModeEffects(this.sessionManager.getPermissionMode() ?? this.settingsManager.getDefaultPermissionMode()), await this.themeController.applyFromSettings(), this.headerContainer.clear(), this.options.verbose || !this.settingsManager.getQuietStartup()) {
|
|
5653
5918
|
let header = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
|
|
5654
5919
|
this.builtInHeader = new BootScreenComponent(header, this.buildBootRows()), this.headerContainer.addChild(new Spacer19(1)), this.headerContainer.addChild(this.builtInHeader);
|
|
5655
5920
|
} else
|
|
@@ -6136,7 +6401,7 @@ ${warningLines}`, 0, 0)), this.loadedResourcesContainer.addChild(new Spacer19(1)
|
|
|
6136
6401
|
replaceInstructions: options?.replaceInstructions,
|
|
6137
6402
|
label: options?.label
|
|
6138
6403
|
});
|
|
6139
|
-
return result.cancelled ? { cancelled: !0 } : (this.
|
|
6404
|
+
return result.cancelled ? { cancelled: !0 } : (this.clearChatContainer(), this.renderInitialMessages(), result.editorText && !this.editor.getText().trim() && this.restoreEditorFromTreeResult(result), this.showStatus("Navigated to selected point"), this.flushCompactionQueue({ willRetry: !1 }), { cancelled: !1 });
|
|
6140
6405
|
},
|
|
6141
6406
|
switchSession: async (sessionPath, options) => this.handleResumeSession(sessionPath, options),
|
|
6142
6407
|
reload: async () => {
|
|
@@ -6169,15 +6434,25 @@ ${warningLines}`, 0, 0)), this.loadedResourcesContainer.addChild(new Spacer19(1)
|
|
|
6169
6434
|
], skillsCount = this.session.resourceLoader.getSkills().skills.length;
|
|
6170
6435
|
return skillsCount > 0 && bootRows.push({ label: "skills", value: String(skillsCount) }), bootRows;
|
|
6171
6436
|
}
|
|
6437
|
+
unregisterSessionTransfer;
|
|
6438
|
+
transferInProgress = !1;
|
|
6439
|
+
detachedDraft = "";
|
|
6172
6440
|
async rebindCurrentSession(options = {}) {
|
|
6173
|
-
await this.waitForDeferredBuiltins(), this.
|
|
6441
|
+
await this.waitForDeferredBuiltins(), this.unregisterSessionTransfer?.(), recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir), this.unregisterSessionTransfer = registerTransferHandler(this.sessionManager, async ({ stop, signal }) => {
|
|
6442
|
+
this.transferInProgress = !0;
|
|
6443
|
+
try {
|
|
6444
|
+
this.detachedDraft = this.editor.getText(), await this.runtimeHost.releaseForTransfer({ stop, signal }), this.editor.setText(this.detachedDraft), this.unregisterSessionTransfer?.(), this.showStatus("Session released for remote continuation. Draft retained. Use /reclaim to continue here.");
|
|
6445
|
+
} finally {
|
|
6446
|
+
this.transferInProgress = !1;
|
|
6447
|
+
}
|
|
6448
|
+
}), this.unsubscribe?.(), this.unsubscribe = void 0, this.applyRuntimeSettings(), this.builtInHeader instanceof BootScreenComponent && this.builtInHeader.updateRows(this.buildBootRows()), options.renderBeforeBind ? (this.renderCurrentSessionState(), this.subscribeToAgent(), await this.bindCurrentSessionExtensions()) : (await this.bindCurrentSessionExtensions(), this.subscribeToAgent()), this.updateAvailableProviderCount(), this.updateEditorBorderColor(), this.updateTerminalTitle();
|
|
6174
6449
|
}
|
|
6175
6450
|
async handleFatalRuntimeError(prefix, error) {
|
|
6176
6451
|
let message = error instanceof Error ? error.message : String(error);
|
|
6177
6452
|
this.showError(`${prefix}: ${message}`), stopThemeWatcher(), this.stop(), process.exit(1);
|
|
6178
6453
|
}
|
|
6179
6454
|
renderCurrentSessionState() {
|
|
6180
|
-
this.ui.setChatScroll(0), this.loadedResourcesContainer.clear(), this.
|
|
6455
|
+
this.ui.setChatScroll(0), this.loadedResourcesContainer.clear(), this.clearChatContainer(), this.pendingMessagesContainer.clear(), this.compactionQueuedMessages = [], this.pendingCompactionRender = void 0, this.stopSmoothStreaming(), this.streamingComponent = void 0, this.streamingMessage = void 0, this.pendingTools.clear(), this.renderInitialMessages();
|
|
6181
6456
|
}
|
|
6182
6457
|
/**
|
|
6183
6458
|
* Get a registered tool definition by name (for custom rendering).
|
|
@@ -6692,7 +6967,35 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6692
6967
|
}
|
|
6693
6968
|
setupEditorSubmitHandler() {
|
|
6694
6969
|
this.defaultEditor.onSubmit = async (text) => {
|
|
6695
|
-
if (text = text.trim(),
|
|
6970
|
+
if (text = text.trim(), text === "/reclaim" || text === "/reclaim stop") {
|
|
6971
|
+
let file = this.sessionManager.getSessionFile();
|
|
6972
|
+
try {
|
|
6973
|
+
if (!file)
|
|
6974
|
+
throw new Error("This session is not saved.");
|
|
6975
|
+
if (!this.runtimeHost.isDetached) {
|
|
6976
|
+
this.showStatus("This terminal already owns the session.");
|
|
6977
|
+
return;
|
|
6978
|
+
}
|
|
6979
|
+
let draft = this.editor.getText();
|
|
6980
|
+
await requestSessionTransfer(file, { stop: text === "/reclaim stop" }), await this.runtimeHost.switchSession(file), this.editor.setText(draft === text ? this.detachedDraft : draft), this.showStatus("Session reclaimed.");
|
|
6981
|
+
} catch (error) {
|
|
6982
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
6983
|
+
}
|
|
6984
|
+
return;
|
|
6985
|
+
}
|
|
6986
|
+
if ((this.runtimeHost.isDetached || this.transferInProgress) && !["/quit", "/exit"].includes(text)) {
|
|
6987
|
+
this.showError("Session is detached or transferring. Draft retained. Use /reclaim, /reclaim stop, or /quit.");
|
|
6988
|
+
return;
|
|
6989
|
+
}
|
|
6990
|
+
if (text === "/handoff" || text === "/handoff cancel") {
|
|
6991
|
+
try {
|
|
6992
|
+
text === "/handoff cancel" ? cancelSessionHandoff(this.sessionManager, this.runtimeHost.services.agentDir) : markSessionHandoff(this.sessionManager, this.runtimeHost.services.agentDir), this.showStatus(text === "/handoff cancel" ? "Handoff mark cancelled." : "Marked for phone continuation for 8 hours. Busy work must finish or be explicitly stopped before transfer.");
|
|
6993
|
+
} catch (error) {
|
|
6994
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
6995
|
+
}
|
|
6996
|
+
return;
|
|
6997
|
+
}
|
|
6998
|
+
if (text && !this.runtimeHost.isDetached && (!text.startsWith("/") || /^\/(?:model|thinking|effort|reasoning|off|minimal|low|medium|high|xhigh|max|mode|plan|read|yolo|auto|name|title|undo|edit|redo|tree|compact)(?:\s|$)/.test(text)) && recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir), !text) {
|
|
6696
6999
|
this.takeSubmittedImages(text);
|
|
6697
7000
|
return;
|
|
6698
7001
|
}
|
|
@@ -6790,8 +7093,8 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6790
7093
|
this.editor.setText(""), this.handleModeCommand(text === "/mode" ? "" : text.slice(6).trim());
|
|
6791
7094
|
return;
|
|
6792
7095
|
}
|
|
6793
|
-
if (text === "/
|
|
6794
|
-
this.editor.setText(""), this.applyPermissionMode(text.slice(1));
|
|
7096
|
+
if (text === "/read" || text === "/yolo" || text === "/auto") {
|
|
7097
|
+
this.editor.setText(""), this.applyPermissionMode(text === "/read" ? "read-only" : text.slice(1));
|
|
6795
7098
|
return;
|
|
6796
7099
|
}
|
|
6797
7100
|
if (text === "/processes") {
|
|
@@ -6863,9 +7166,21 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6863
7166
|
this.isExtensionCommand(text) ? (this.editor.addToHistory?.(text), this.editor.setText(""), await this.promptAfterDeferredBuiltins(text)) : this.queueCompactionMessage(text, "steer", images);
|
|
6864
7167
|
return;
|
|
6865
7168
|
}
|
|
6866
|
-
if (this.session.isStreaming) {
|
|
6867
|
-
|
|
6868
|
-
|
|
7169
|
+
if (this.session.isStreaming || this.session.isWaitPromptHandoffActive) {
|
|
7170
|
+
if (!this.isExtensionCommand(text)) {
|
|
7171
|
+
await this.awaitDeferredBuiltinsForPrompt();
|
|
7172
|
+
let handoff = await this.session.interruptSubagentWaitWithPrompt(text, { images });
|
|
7173
|
+
if (handoff) {
|
|
7174
|
+
this.editor.addToHistory?.(text), this.editor.setText(""), handoff.completion.catch((error) => {
|
|
7175
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
7176
|
+
}), this.ui.requestRender();
|
|
7177
|
+
return;
|
|
7178
|
+
}
|
|
7179
|
+
}
|
|
7180
|
+
if (this.session.isStreaming) {
|
|
7181
|
+
this.editor.addToHistory?.(text), this.editor.setText(""), await this.promptAfterDeferredBuiltins(text, { streamingBehavior: "steer", images }), this.updatePendingMessagesDisplay(), this.ui.requestRender();
|
|
7182
|
+
return;
|
|
7183
|
+
}
|
|
6869
7184
|
}
|
|
6870
7185
|
this.flushPendingBashComponents(), this.onInputCallback ? this.onInputCallback({ text, images }) : this.pendingUserInputs.push({ text, images }), this.editor.addToHistory?.(text);
|
|
6871
7186
|
};
|
|
@@ -6875,6 +7190,13 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6875
7190
|
getSmoothStreamingOptions() {
|
|
6876
7191
|
return { hideThinking: this.hideThinkingBlock };
|
|
6877
7192
|
}
|
|
7193
|
+
setThinkingAnimation(active) {
|
|
7194
|
+
if (!active) {
|
|
7195
|
+
this.thinkingAnimationTimer && clearInterval(this.thinkingAnimationTimer), this.thinkingAnimationTimer = void 0;
|
|
7196
|
+
return;
|
|
7197
|
+
}
|
|
7198
|
+
this.thinkingAnimationTimer || (this.thinkingAnimationTimer = setInterval(() => this.ui.requestRender(), 33), this.thinkingAnimationTimer.unref?.());
|
|
7199
|
+
}
|
|
6878
7200
|
clearSmoothStreamingTimer() {
|
|
6879
7201
|
this.smoothStreamingTimer && (clearInterval(this.smoothStreamingTimer), this.smoothStreamingTimer = void 0);
|
|
6880
7202
|
}
|
|
@@ -6905,11 +7227,8 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6905
7227
|
let component = this.pendingTools.get(content.id);
|
|
6906
7228
|
component && component.updateArgs(content.arguments);
|
|
6907
7229
|
} else {
|
|
6908
|
-
let component =
|
|
6909
|
-
|
|
6910
|
-
imageWidthCells: this.settingsManager.getImageWidthCells()
|
|
6911
|
-
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
6912
|
-
component.setExpanded(this.toolOutputExpanded), this.addToolComponentToChat(component), this.pendingTools.set(content.id, component);
|
|
7230
|
+
let component = content.name === "browser" && this.browserActivityComponent ? this.browserActivityComponent : this.createToolExecutionComponent(content.name, content.id, content.arguments);
|
|
7231
|
+
this.pendingTools.set(content.id, component);
|
|
6913
7232
|
}
|
|
6914
7233
|
}
|
|
6915
7234
|
advanceSmoothStreaming() {
|
|
@@ -6927,7 +7246,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6927
7246
|
this.streamingDisplayedLength += computeSmoothRevealStep(backlog), this.streamingDisplayedLength > total && (this.streamingDisplayedLength = total), this.paintSmoothStreamingFrame(), this.streamingDisplayedLength >= total && this.clearSmoothStreamingTimer();
|
|
6928
7247
|
}
|
|
6929
7248
|
stopSmoothStreaming() {
|
|
6930
|
-
this.clearSmoothStreamingTimer(), this.streamingTargetMessage = void 0, this.streamingDisplayedLength = 0;
|
|
7249
|
+
this.setThinkingAnimation(!1), this.clearSmoothStreamingTimer(), this.streamingTargetMessage = void 0, this.streamingDisplayedLength = 0;
|
|
6931
7250
|
}
|
|
6932
7251
|
/** Apply a mid-stream smoothStreaming setting change without rewinding. */
|
|
6933
7252
|
applySmoothStreamingSettingChange(enabled) {
|
|
@@ -6949,7 +7268,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6949
7268
|
async handleEvent(event) {
|
|
6950
7269
|
switch (this.isInitialized || await this.init(), this.footer.invalidate(), event.type) {
|
|
6951
7270
|
case "agent_start":
|
|
6952
|
-
this.pendingTools.clear(), this.settingsManager.getShowTerminalProgress() && this.ui.terminal.setProgress(!0), this.retryEscapeHandler && (this.defaultEditor.onEscape = this.retryEscapeHandler, this.retryEscapeHandler = void 0), this.workingVisible ? this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions)) : this.clearStatusIndicator(), this.ui.requestRender();
|
|
7271
|
+
this.pendingTools.clear(), this.browserActivityComponent = void 0, this.settingsManager.getShowTerminalProgress() && this.ui.terminal.setProgress(!0), this.retryEscapeHandler && (this.defaultEditor.onEscape = this.retryEscapeHandler, this.retryEscapeHandler = void 0), this.workingVisible ? this.showStatusIndicator(new WorkingStatusIndicator(this.ui, this.workingMessage ?? this.defaultWorkingMessage, this.workingIndicatorOptions)) : this.clearStatusIndicator(), this.ui.requestRender();
|
|
6953
7272
|
break;
|
|
6954
7273
|
case "queue_update":
|
|
6955
7274
|
this.updatePendingMessagesDisplay(), this.ui.requestRender();
|
|
@@ -6964,7 +7283,11 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
6964
7283
|
this.footer.invalidate(), this.updateEditorBorderColor();
|
|
6965
7284
|
break;
|
|
6966
7285
|
case "message_start":
|
|
6967
|
-
event.message.role === "custom" ? (this.addMessageToChat(event.message), this.ui.requestRender()) : event.message.role === "user" ? (this.redoStack.length = 0, beginTurn(this.sessionManager.getCwd(), this.sessionManager.getSessionId()), this.stopSmoothStreaming(), this.addMessageToChat(event.message), this.updatePendingMessagesDisplay(), this.ui.requestRender()) : event.message.role === "assistant" && (this.streamingComponent = new AssistantMessageComponent(void 0, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse
|
|
7286
|
+
event.message.role === "custom" ? (this.addMessageToChat(event.message), this.ui.requestRender()) : event.message.role === "user" ? (this.redoStack.length = 0, beginTurn(this.sessionManager.getCwd(), this.sessionManager.getSessionId()), this.stopSmoothStreaming(), this.addMessageToChat(event.message), this.updatePendingMessagesDisplay(), this.ui.requestRender()) : event.message.role === "assistant" && (this.streamingComponent = new AssistantMessageComponent(void 0, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
7287
|
+
requestRender: () => this.ui.requestRender(),
|
|
7288
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
7289
|
+
onThinkingAnimationChange: (active) => this.setThinkingAnimation(active)
|
|
7290
|
+
}), this.thinkingRunTimings = [], this.streamingComponent.setThinkingTimings(this.thinkingRunTimings), this.streamingComponent.setExpanded(this.toolOutputExpanded), this.streamingMessage = event.message, this.streamingTargetMessage = event.message, this.streamingDisplayedLength = 0, this.chatContainer.addChild(this.streamingComponent), this.settingsManager.getSmoothStreaming() ? this.streamingComponent.updateContent(sliceMessageContent(this.streamingMessage, 0, this.getSmoothStreamingOptions()), { thinkingSource: this.streamingMessage }) : this.streamingComponent.updateContent(this.streamingMessage), this.ui.requestRender());
|
|
6968
7291
|
break;
|
|
6969
7292
|
case "message_update":
|
|
6970
7293
|
if (this.streamingComponent && event.message.role === "assistant")
|
|
@@ -7007,10 +7330,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7007
7330
|
this.streamingDisplayedLength < needed && (this.streamingDisplayedLength = needed), this.paintSmoothStreamingFrame();
|
|
7008
7331
|
}
|
|
7009
7332
|
let component = this.pendingTools.get(event.toolCallId);
|
|
7010
|
-
component
|
|
7011
|
-
showImages: this.settingsManager.getShowImages(),
|
|
7012
|
-
imageWidthCells: this.settingsManager.getImageWidthCells()
|
|
7013
|
-
}, this.getRegisteredToolDefinition(event.toolName), this.ui, this.sessionManager.getCwd()), component.setExpanded(this.toolOutputExpanded), this.addToolComponentToChat(component), this.pendingTools.set(event.toolCallId, component)), component.markExecutionStarted(), this.ui.requestRender();
|
|
7333
|
+
component ? event.toolName === "browser" && !component.matchesToolCall(event.toolCallId) && component.beginNextExecution(event.toolCallId, event.args) : (component = this.createToolExecutionComponent(event.toolName, event.toolCallId, event.args), this.pendingTools.set(event.toolCallId, component)), component.markExecutionStarted(), this.ui.requestRender();
|
|
7014
7334
|
break;
|
|
7015
7335
|
}
|
|
7016
7336
|
case "tool_execution_update": {
|
|
@@ -7024,7 +7344,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7024
7344
|
break;
|
|
7025
7345
|
}
|
|
7026
7346
|
case "agent_end":
|
|
7027
|
-
this.session.refreshModelFromRegistry(), this.settingsManager.getShowTerminalProgress() && this.ui.terminal.setProgress(!1), this.clearStatusIndicator("working"), this.stopSmoothStreaming(), this.streamingComponent && (this.chatContainer.removeChild(this.streamingComponent), this.streamingComponent = void 0, this.streamingMessage = void 0), this.pendingTools.clear(), this.maybeAutoNameSession(), captureTreeChanges(this.sessionManager.getCwd(), this.sessionManager.getSessionId()), this.ui.requestRender();
|
|
7347
|
+
this.session.refreshModelFromRegistry(), this.settingsManager.getShowTerminalProgress() && this.ui.terminal.setProgress(!1), this.clearStatusIndicator("working"), this.stopSmoothStreaming(), this.streamingComponent && (this.chatContainer.removeChild(this.streamingComponent), this.streamingComponent = void 0, this.streamingMessage = void 0), this.pendingTools.clear(), this.browserActivityComponent = void 0, this.maybeAutoNameSession(), captureTreeChanges(this.sessionManager.getCwd(), this.sessionManager.getSessionId()), this.ui.requestRender();
|
|
7028
7348
|
break;
|
|
7029
7349
|
case "agent_settled":
|
|
7030
7350
|
if (this.pendingCompactionRender) {
|
|
@@ -7145,7 +7465,10 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7145
7465
|
break;
|
|
7146
7466
|
}
|
|
7147
7467
|
case "assistant": {
|
|
7148
|
-
let assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse
|
|
7468
|
+
let assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
7469
|
+
requestRender: () => this.ui.requestRender(),
|
|
7470
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay()
|
|
7471
|
+
});
|
|
7149
7472
|
assistantComponent.setThinkingTimings(this.thinkingTimingsByMessage.get(message)), assistantComponent.setExpanded(this.toolOutputExpanded), this.chatContainer.addChild(assistantComponent);
|
|
7150
7473
|
break;
|
|
7151
7474
|
}
|
|
@@ -7158,7 +7481,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7158
7481
|
}
|
|
7159
7482
|
renderSessionItems(items, options = {}) {
|
|
7160
7483
|
this.pendingTools.clear();
|
|
7161
|
-
let renderedPendingTools = /* @__PURE__ */ new Map(), cacheMisses = this.settingsManager.getShowCacheMissNotices() ? collectCacheMisses(this.sessionManager.getEntries(), this.session.modelRuntime) : /* @__PURE__ */ new Map();
|
|
7484
|
+
let browserActivityComponent, renderedPendingTools = /* @__PURE__ */ new Map(), cacheMisses = this.settingsManager.getShowCacheMissNotices() ? collectCacheMisses(this.sessionManager.getEntries(), this.session.modelRuntime) : /* @__PURE__ */ new Map();
|
|
7162
7485
|
options.updateFooter && (this.footer.invalidate(), this.updateEditorBorderColor());
|
|
7163
7486
|
for (let item of items) {
|
|
7164
7487
|
if (isCustomSessionEntry(item)) {
|
|
@@ -7170,11 +7493,11 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7170
7493
|
this.addMessageToChat(message);
|
|
7171
7494
|
for (let content of message.content)
|
|
7172
7495
|
if (content.type === "toolCall") {
|
|
7173
|
-
let component =
|
|
7496
|
+
let component = content.name === "browser" ? browserActivityComponent : void 0;
|
|
7497
|
+
if (component ? component.beginNextExecution(content.id, content.arguments) : (component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
7174
7498
|
showImages: this.settingsManager.getShowImages(),
|
|
7175
7499
|
imageWidthCells: this.settingsManager.getImageWidthCells()
|
|
7176
|
-
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd())
|
|
7177
|
-
if (component.setExpanded(this.toolOutputExpanded), this.addToolComponentToChat(component), message.stopReason === "aborted" || message.stopReason === "error") {
|
|
7500
|
+
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd()), component.setExpanded(this.toolOutputExpanded), this.addToolComponentToChat(component), content.name === "browser" && (browserActivityComponent = component)), message.stopReason === "aborted" || message.stopReason === "error") {
|
|
7178
7501
|
let errorMessage;
|
|
7179
7502
|
if (message.stopReason === "aborted") {
|
|
7180
7503
|
let retryAttempt = this.session.retryAttempt;
|
|
@@ -7193,7 +7516,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7193
7516
|
let component = renderedPendingTools.get(message.toolCallId);
|
|
7194
7517
|
component && (component.updateResult(message), renderedPendingTools.delete(message.toolCallId));
|
|
7195
7518
|
} else
|
|
7196
|
-
this.addMessageToChat(message, options);
|
|
7519
|
+
message.role === "user" && (browserActivityComponent = void 0), this.addMessageToChat(message, options);
|
|
7197
7520
|
}
|
|
7198
7521
|
for (let [toolCallId, component] of renderedPendingTools)
|
|
7199
7522
|
this.pendingTools.set(toolCallId, component);
|
|
@@ -7252,7 +7575,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7252
7575
|
});
|
|
7253
7576
|
}
|
|
7254
7577
|
rebuildChatFromMessages() {
|
|
7255
|
-
this.
|
|
7578
|
+
this.clearChatContainer(), this.renderSessionEntries(this.sessionManager.buildContextEntries());
|
|
7256
7579
|
}
|
|
7257
7580
|
// =========================================================================
|
|
7258
7581
|
// Key handlers
|
|
@@ -7273,7 +7596,7 @@ ${message}`, ["Yes", "No"], opts) === "Yes";
|
|
|
7273
7596
|
async shutdown(options) {
|
|
7274
7597
|
if (this.isShuttingDown)
|
|
7275
7598
|
return;
|
|
7276
|
-
if (this.isShuttingDown = !0, this.stopSmoothStreaming(), this.planUsageTimer && (clearInterval(this.planUsageTimer), this.planUsageTimer = void 0), getUsageServiceBridge()?.setOnUpdate(void 0), options?.fromSignal) {
|
|
7599
|
+
if (this.isShuttingDown = !0, this.unregisterSessionTransfer?.(), this.stopSmoothStreaming(), this.planUsageTimer && (clearInterval(this.planUsageTimer), this.planUsageTimer = void 0), getUsageServiceBridge()?.setOnUpdate(void 0), options?.fromSignal) {
|
|
7277
7600
|
await this.runtimeHost.dispose(), this.themeController.disableAutoSync(), await this.ui.terminal.drainInput(1e3);
|
|
7278
7601
|
try {
|
|
7279
7602
|
killAll();
|
|
@@ -7374,6 +7697,10 @@ Kill them before exit?`) && killAll(), this.stop(), await this.runtimeHost.dispo
|
|
|
7374
7697
|
}
|
|
7375
7698
|
}
|
|
7376
7699
|
async handleFollowUp() {
|
|
7700
|
+
if (this.runtimeHost.isDetached || this.transferInProgress) {
|
|
7701
|
+
this.showError("Use /reclaim before sending more work. Draft retained.");
|
|
7702
|
+
return;
|
|
7703
|
+
}
|
|
7377
7704
|
let text = (this.editor.getExpandedText?.() ?? this.editor.getText()).trim();
|
|
7378
7705
|
if (text) {
|
|
7379
7706
|
if (this.session.isCompacting) {
|
|
@@ -7408,21 +7735,26 @@ Kill them before exit?`) && killAll(), this.stop(), await this.runtimeHost.dispo
|
|
|
7408
7735
|
this.ui.requestRender();
|
|
7409
7736
|
}
|
|
7410
7737
|
cycleThinkingLevel() {
|
|
7411
|
-
|
|
7738
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
7739
|
+
return;
|
|
7740
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir), this.session.cycleThinkingLevel() === void 0 ? this.showStatus("Current model does not support thinking") : (this.footer.invalidate(), this.updateEditorBorderColor());
|
|
7412
7741
|
}
|
|
7413
7742
|
cyclePermissionMode() {
|
|
7414
7743
|
this.applyPermissionMode(nextPermissionMode(getPermissionMode()), { silent: !0 });
|
|
7415
7744
|
}
|
|
7416
7745
|
async cycleModel(direction) {
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
let
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7746
|
+
if (!(this.runtimeHost.isDetached || this.transferInProgress)) {
|
|
7747
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
7748
|
+
try {
|
|
7749
|
+
let result = await this.session.cycleModel(direction);
|
|
7750
|
+
if (result === void 0) {
|
|
7751
|
+
let msg = this.session.scopedModels.length > 0 ? "Only one model in scope" : "Only one model available";
|
|
7752
|
+
this.showStatus(msg);
|
|
7753
|
+
} else
|
|
7754
|
+
this.footer.invalidate(), this.updateEditorBorderColor(), this.maybeWarnAboutAnthropicSubscriptionAuth(result.model);
|
|
7755
|
+
} catch (error) {
|
|
7756
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
7757
|
+
}
|
|
7426
7758
|
}
|
|
7427
7759
|
}
|
|
7428
7760
|
toggleToolOutputExpansion() {
|
|
@@ -7437,6 +7769,23 @@ Kill them before exit?`) && killAll(), this.stop(), await this.runtimeHost.dispo
|
|
|
7437
7769
|
isExpandable(child) && child.setExpanded(expanded);
|
|
7438
7770
|
globalThis[/* @__PURE__ */ Symbol.for("@lunr/tools-expanded-changed")]?.(expanded), this.ui.requestRender();
|
|
7439
7771
|
}
|
|
7772
|
+
createToolExecutionComponent(toolName, toolCallId, args) {
|
|
7773
|
+
if (toolName === "browser" && this.browserActivityComponent)
|
|
7774
|
+
return this.browserActivityComponent.beginNextExecution(toolCallId, args), this.browserActivityComponent;
|
|
7775
|
+
let component = new ToolExecutionComponent(toolName, toolCallId, args, {
|
|
7776
|
+
showImages: this.settingsManager.getShowImages(),
|
|
7777
|
+
imageWidthCells: this.settingsManager.getImageWidthCells()
|
|
7778
|
+
}, this.getRegisteredToolDefinition(toolName), this.ui, this.sessionManager.getCwd());
|
|
7779
|
+
return component.setExpanded(this.toolOutputExpanded), this.addToolComponentToChat(component), toolName === "browser" && (this.browserActivityComponent = component), component;
|
|
7780
|
+
}
|
|
7781
|
+
disposeChatToolComponents() {
|
|
7782
|
+
for (let child of this.chatContainer.children)
|
|
7783
|
+
child instanceof ToolExecutionComponent && child.dispose();
|
|
7784
|
+
this.browserActivityComponent = void 0;
|
|
7785
|
+
}
|
|
7786
|
+
clearChatContainer() {
|
|
7787
|
+
this.disposeChatToolComponents(), this.chatContainer.clear();
|
|
7788
|
+
}
|
|
7440
7789
|
// lunr: consecutive same-tool grouping — a tool component appended right after
|
|
7441
7790
|
// another component for the SAME tool becomes a group continuation (no top
|
|
7442
7791
|
// spacer / top pad); the previous card drops its bottom pad. Mixed neighbors
|
|
@@ -7446,7 +7795,7 @@ Kill them before exit?`) && killAll(), this.stop(), await this.runtimeHost.dispo
|
|
|
7446
7795
|
applySameToolGrouping(last instanceof ToolExecutionComponent ? last : void 0, component), this.chatContainer.addChild(component);
|
|
7447
7796
|
}
|
|
7448
7797
|
toggleThinkingBlockVisibility() {
|
|
7449
|
-
if (this.hideThinkingBlock = !this.hideThinkingBlock, this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock), this.
|
|
7798
|
+
if (this.hideThinkingBlock = !this.hideThinkingBlock, this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock), this.rebuildChatFromMessages(), this.streamingComponent && this.streamingMessage) {
|
|
7450
7799
|
if (this.streamingComponent.setHideThinkingBlock(this.hideThinkingBlock), this.settingsManager.getSmoothStreaming() && this.streamingTargetMessage) {
|
|
7451
7800
|
let opts = this.getSmoothStreamingOptions(), total = countMessageGraphemes(this.streamingTargetMessage, opts);
|
|
7452
7801
|
this.streamingDisplayedLength > total && (this.streamingDisplayedLength = total), this.paintSmoothStreamingFrame(), this.streamingDisplayedLength < total && this.startSmoothStreaming();
|
|
@@ -7563,7 +7912,7 @@ Pi will resume when the editor exits.
|
|
|
7563
7912
|
return !!extensionRunner.getCommand(commandName);
|
|
7564
7913
|
}
|
|
7565
7914
|
renderCompactionResult(result) {
|
|
7566
|
-
this.
|
|
7915
|
+
this.rebuildChatFromMessages(), this.addMessageToChat(createCompactionSummaryMessage(result.summary, result.tokensBefore, (/* @__PURE__ */ new Date()).toISOString())), this.footer.invalidate();
|
|
7567
7916
|
}
|
|
7568
7917
|
async flushCompactionQueue(options) {
|
|
7569
7918
|
if (this.compactionQueuedMessages.length === 0)
|
|
@@ -7642,6 +7991,7 @@ Pi will resume when the editor exits.
|
|
|
7642
7991
|
availableThemes: getAvailableThemes(),
|
|
7643
7992
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
7644
7993
|
thinkingCollapse: this.thinkingCollapse,
|
|
7994
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
7645
7995
|
cacheRetention: this.settingsManager.getCacheRetention() ?? "short",
|
|
7646
7996
|
doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
|
|
7647
7997
|
treeFilterMode: this.settingsManager.getTreeFilterMode(),
|
|
@@ -7664,8 +8014,12 @@ Pi will resume when the editor exits.
|
|
|
7664
8014
|
confirmLargeSubagentLaunches: this.settingsManager.getConfirmLargeSubagentLaunches(),
|
|
7665
8015
|
computerUse: this.settingsManager.getComputerUse(),
|
|
7666
8016
|
computerForeground: this.settingsManager.getComputerForeground(),
|
|
8017
|
+
subagentCommunicationEnabled: this.settingsManager.getSubagentCommunicationEnabled(),
|
|
8018
|
+
automaticSubagentDelegation: this.settingsManager.getAutomaticSubagentDelegation(),
|
|
8019
|
+
browserEnabled: this.settingsManager.getBrowserEnabled(),
|
|
7667
8020
|
memoryEnabled: this.settingsManager.getMemoryEnabled(),
|
|
7668
8021
|
memoryCharCap: this.settingsManager.getMemoryCharCap(),
|
|
8022
|
+
todosEnabled: this.settingsManager.getTodosEnabled(),
|
|
7669
8023
|
searchCurator: getSearchCuratorSetting(),
|
|
7670
8024
|
// lunr: TUI customize settings
|
|
7671
8025
|
footerMcp: this.settingsManager.getFooterMcp(),
|
|
@@ -7736,13 +8090,19 @@ Pi will resume when the editor exits.
|
|
|
7736
8090
|
this.hideThinkingBlock = hidden, this.settingsManager.setHideThinkingBlock(hidden);
|
|
7737
8091
|
for (let child of this.chatContainer.children)
|
|
7738
8092
|
child instanceof AssistantMessageComponent && child.setHideThinkingBlock(hidden);
|
|
7739
|
-
this.
|
|
8093
|
+
this.rebuildChatFromMessages();
|
|
7740
8094
|
},
|
|
7741
8095
|
onThinkingCollapseChange: (collapse) => {
|
|
7742
8096
|
this.thinkingCollapse = collapse, this.settingsManager.setThinkingCollapse(collapse);
|
|
7743
8097
|
for (let child of this.chatContainer.children)
|
|
7744
8098
|
child instanceof AssistantMessageComponent && child.setThinkingCollapse(collapse);
|
|
7745
|
-
this.
|
|
8099
|
+
this.rebuildChatFromMessages();
|
|
8100
|
+
},
|
|
8101
|
+
onReasoningDisplayChange: (display) => {
|
|
8102
|
+
this.settingsManager.setReasoningDisplay(display);
|
|
8103
|
+
for (let child of this.chatContainer.children)
|
|
8104
|
+
child instanceof AssistantMessageComponent && child.setReasoningDisplay(this.settingsManager.getReasoningDisplay());
|
|
8105
|
+
this.ui.requestRender();
|
|
7746
8106
|
},
|
|
7747
8107
|
onShowCacheMissNoticesChange: (shown) => {
|
|
7748
8108
|
this.settingsManager.setShowCacheMissNotices(shown), this.rebuildChatFromMessages();
|
|
@@ -7813,6 +8173,12 @@ Pi will resume when the editor exits.
|
|
|
7813
8173
|
onConfirmLargeSubagentLaunchesChange: (enabled) => {
|
|
7814
8174
|
this.settingsManager.setConfirmLargeSubagentLaunches(enabled);
|
|
7815
8175
|
},
|
|
8176
|
+
onSubagentCommunicationChange: (enabled) => {
|
|
8177
|
+
this.settingsManager.setSubagentCommunicationEnabled(enabled);
|
|
8178
|
+
},
|
|
8179
|
+
onAutomaticSubagentDelegationChange: (enabled) => {
|
|
8180
|
+
this.settingsManager.setAutomaticSubagentDelegation(enabled), this.session.refreshToolRegistry();
|
|
8181
|
+
},
|
|
7816
8182
|
getTierThinkingLevels: (tier) => {
|
|
7817
8183
|
let model = this.resolveModelReference(this.settingsManager.getTierModel(tier));
|
|
7818
8184
|
return model ? getSupportedThinkingLevels(model) : this.session.getAvailableThinkingLevels();
|
|
@@ -7826,9 +8192,15 @@ Pi will resume when the editor exits.
|
|
|
7826
8192
|
onComputerForegroundChange: (enabled) => {
|
|
7827
8193
|
this.settingsManager.setComputerForeground(enabled);
|
|
7828
8194
|
},
|
|
8195
|
+
onBrowserEnabledChange: (enabled) => {
|
|
8196
|
+
this.settingsManager.setBrowserEnabled(enabled), this.session.refreshToolRegistry();
|
|
8197
|
+
},
|
|
7829
8198
|
onMemoryEnabledChange: (enabled) => {
|
|
7830
8199
|
this.settingsManager.setMemoryEnabled(enabled), this.session.refreshToolRegistry(), this.showStatus(`Agent memory: ${enabled ? "on" : "off"}`);
|
|
7831
8200
|
},
|
|
8201
|
+
onTodosEnabledChange: (enabled) => {
|
|
8202
|
+
this.settingsManager.setTodosEnabled(enabled), notifyTodosEnabledChanged(enabled), this.session.refreshToolRegistry();
|
|
8203
|
+
},
|
|
7832
8204
|
onSearchCuratorChange: (setting) => {
|
|
7833
8205
|
setSearchCuratorSetting(setting) || this.showError("pi-web-access is not loaded; curator setting unavailable.");
|
|
7834
8206
|
},
|
|
@@ -7866,6 +8238,31 @@ Pi will resume when the editor exits.
|
|
|
7866
8238
|
onPlanUsageWindowChange: (window) => {
|
|
7867
8239
|
this.settingsManager.setPlanUsageWindow(window);
|
|
7868
8240
|
},
|
|
8241
|
+
onGatewayAction: (action) => {
|
|
8242
|
+
(async () => {
|
|
8243
|
+
if (this.session.isStreaming) {
|
|
8244
|
+
this.showStatus("Wait for the current turn before managing the gateway.");
|
|
8245
|
+
return;
|
|
8246
|
+
}
|
|
8247
|
+
if (action === "status") {
|
|
8248
|
+
this.showStatus((await import("./service-HGGU3STY.js")).serviceStatusText());
|
|
8249
|
+
return;
|
|
8250
|
+
}
|
|
8251
|
+
this.ui.stop();
|
|
8252
|
+
try {
|
|
8253
|
+
await new Promise((resolve4, reject) => {
|
|
8254
|
+
let child = spawn3(process.execPath, [process.argv[1], "gateway", ...action.split(" ")], {
|
|
8255
|
+
stdio: "inherit",
|
|
8256
|
+
env: process.env
|
|
8257
|
+
});
|
|
8258
|
+
child.once("error", reject), child.once("exit", (code) => code === 0 ? resolve4() : reject(new Error(`Gateway command exited with code ${code}. Run lunr gateway doctor.`)));
|
|
8259
|
+
});
|
|
8260
|
+
} finally {
|
|
8261
|
+
this.ui.start(), this.ui.requestRender(!0);
|
|
8262
|
+
}
|
|
8263
|
+
this.showStatus((await import("./service-HGGU3STY.js")).serviceStatusText());
|
|
8264
|
+
})().catch((error) => this.showStatus(error instanceof Error ? error.message : String(error)));
|
|
8265
|
+
},
|
|
7869
8266
|
onDefaultPermissionModeChange: (mode) => {
|
|
7870
8267
|
this.settingsManager.setDefaultPermissionMode(mode);
|
|
7871
8268
|
},
|
|
@@ -8037,6 +8434,8 @@ Pi will resume when the editor exits.
|
|
|
8037
8434
|
});
|
|
8038
8435
|
}
|
|
8039
8436
|
async showModelSelector(initialSearchInput) {
|
|
8437
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
8438
|
+
return;
|
|
8040
8439
|
let subscriptionNames = await this.getActiveSubscriptionNames();
|
|
8041
8440
|
this.showSelector((done) => {
|
|
8042
8441
|
let selector = new ModelSelectorComponent(this.ui, this.session.model, this.settingsManager, this.session.modelRuntime, this.session.scopedModels, async (model) => {
|
|
@@ -8173,6 +8572,8 @@ Pi will resume when the editor exits.
|
|
|
8173
8572
|
});
|
|
8174
8573
|
}
|
|
8175
8574
|
showUserMessageSelector() {
|
|
8575
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
8576
|
+
return;
|
|
8176
8577
|
let userMessages = this.session.getUserMessagesForForking();
|
|
8177
8578
|
if (userMessages.length === 0) {
|
|
8178
8579
|
this.showStatus("No messages to fork from");
|
|
@@ -8215,6 +8616,8 @@ Pi will resume when the editor exits.
|
|
|
8215
8616
|
}
|
|
8216
8617
|
}
|
|
8217
8618
|
showTreeSelector(initialSelectedId) {
|
|
8619
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
8620
|
+
return;
|
|
8218
8621
|
let tree = this.sessionManager.getTree(), realLeafId = this.sessionManager.getLeafId(), initialFilterMode = this.settingsManager.getTreeFilterMode();
|
|
8219
8622
|
if (tree.length === 0) {
|
|
8220
8623
|
this.showStatus("No entries in session");
|
|
@@ -8259,7 +8662,7 @@ Pi will resume when the editor exits.
|
|
|
8259
8662
|
this.showStatus("Navigation cancelled");
|
|
8260
8663
|
return;
|
|
8261
8664
|
}
|
|
8262
|
-
this.
|
|
8665
|
+
this.clearChatContainer(), this.renderInitialMessages(), result.editorText && !this.editor.getText().trim() && this.restoreEditorFromTreeResult(result), this.showStatus("Navigated to selected point"), this.flushCompactionQueue({ willRetry: !1 });
|
|
8263
8666
|
} catch (error) {
|
|
8264
8667
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
8265
8668
|
} finally {
|
|
@@ -8296,7 +8699,16 @@ Pi will resume when the editor exits.
|
|
|
8296
8699
|
let next = (nextName ?? "").trim();
|
|
8297
8700
|
if (!next)
|
|
8298
8701
|
return;
|
|
8299
|
-
|
|
8702
|
+
if (sessionFilePath === this.sessionManager.getSessionFile() && !this.runtimeHost.isDetached) {
|
|
8703
|
+
this.sessionManager.appendSessionInfo(next);
|
|
8704
|
+
return;
|
|
8705
|
+
}
|
|
8706
|
+
let mgr = SessionManager.open(sessionFilePath);
|
|
8707
|
+
try {
|
|
8708
|
+
mgr.appendSessionInfo(next);
|
|
8709
|
+
} finally {
|
|
8710
|
+
mgr.dispose();
|
|
8711
|
+
}
|
|
8300
8712
|
},
|
|
8301
8713
|
showRenameHint: !0,
|
|
8302
8714
|
keybindings: this.keybindings
|
|
@@ -8352,8 +8764,8 @@ Pi will resume when the editor exits.
|
|
|
8352
8764
|
}
|
|
8353
8765
|
async getLogoutProviderOptions() {
|
|
8354
8766
|
let options = [];
|
|
8355
|
-
for (let { providerId, type } of await this.session.modelRuntime.listCredentials()) {
|
|
8356
|
-
let name = this.session.modelRuntime.getProvider(providerId)?.name ?? providerId, status = { type, source: "stored credential" };
|
|
8767
|
+
for (let { providerId, type: credentialType } of await this.session.modelRuntime.listCredentials()) {
|
|
8768
|
+
let type = credentialType === "external_claude_code" ? "oauth" : credentialType, name = this.session.modelRuntime.getProvider(providerId)?.name ?? providerId, status = { type, source: "stored credential" };
|
|
8357
8769
|
if (type === "api_key") {
|
|
8358
8770
|
let subs = await this.session.modelRuntime.subscriptionManager.list(providerId);
|
|
8359
8771
|
if (subs.length > 1) {
|
|
@@ -8757,7 +9169,22 @@ Pi will resume when the editor exits.
|
|
|
8757
9169
|
return this.session.modelRuntime.login(providerId, method, {
|
|
8758
9170
|
signal: dialog.signal,
|
|
8759
9171
|
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
8760
|
-
notify: (event) => this.notifyAuthDialog(dialog, event)
|
|
9172
|
+
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
9173
|
+
handoff: async (command, args, env) => {
|
|
9174
|
+
this.ui.stop();
|
|
9175
|
+
try {
|
|
9176
|
+
await new Promise((resolve4, reject) => {
|
|
9177
|
+
let child = spawn3(command, [...args], { stdio: "inherit", env, windowsHide: !1 }), abort = () => child.kill();
|
|
9178
|
+
dialog.signal.addEventListener("abort", abort, { once: !0 }), dialog.signal.aborted && abort(), child.once("error", (error) => {
|
|
9179
|
+
dialog.signal.removeEventListener("abort", abort), reject(error);
|
|
9180
|
+
}), child.once("close", (code) => {
|
|
9181
|
+
dialog.signal.removeEventListener("abort", abort), code === 0 ? resolve4() : reject(new Error("Claude Code login did not complete"));
|
|
9182
|
+
});
|
|
9183
|
+
});
|
|
9184
|
+
} finally {
|
|
9185
|
+
this.ui.start();
|
|
9186
|
+
}
|
|
9187
|
+
}
|
|
8761
9188
|
});
|
|
8762
9189
|
}
|
|
8763
9190
|
async showLoginDialog(providerId, providerName) {
|
|
@@ -8838,7 +9265,7 @@ ${INIT_EXISTING_FILE_INSTRUCTIONS.append}`;
|
|
|
8838
9265
|
this.showStatus(command === "undo" ? "Undo cancelled" : "Edit cancelled");
|
|
8839
9266
|
return;
|
|
8840
9267
|
}
|
|
8841
|
-
return leafId && this.redoStack.push(leafId), this.
|
|
9268
|
+
return leafId && this.redoStack.push(leafId), this.clearChatContainer(), this.renderInitialMessages(), this.flushCompactionQueue({ willRetry: !1 }), { editorText: result.editorText, editorImages: result.editorImages };
|
|
8842
9269
|
} catch (error) {
|
|
8843
9270
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
8844
9271
|
return;
|
|
@@ -8870,7 +9297,7 @@ ${INIT_EXISTING_FILE_INSTRUCTIONS.append}`;
|
|
|
8870
9297
|
this.redoStack.push(targetId), this.showStatus("Navigation cancelled");
|
|
8871
9298
|
return;
|
|
8872
9299
|
}
|
|
8873
|
-
this.
|
|
9300
|
+
this.clearChatContainer(), this.renderInitialMessages(), result.editorText && !this.editor.getText().trim() && this.restoreEditorFromTreeResult(result), this.showStatus("Redone"), this.flushCompactionQueue({ willRetry: !1 });
|
|
8874
9301
|
} catch (error) {
|
|
8875
9302
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
8876
9303
|
}
|
|
@@ -9215,56 +9642,54 @@ ${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
|
9215
9642
|
this.chatContainer.addChild(new Spacer19(1)), this.chatContainer.addChild(new Text21(lines.join(`
|
|
9216
9643
|
`), 1, 0)), this.ui.requestRender();
|
|
9217
9644
|
}
|
|
9218
|
-
//
|
|
9645
|
+
// /plan is a shortcut into read-only mode for planning.
|
|
9219
9646
|
async handlePlanCommand(args) {
|
|
9220
|
-
let sub = args.toLowerCase(),
|
|
9647
|
+
let sub = args.toLowerCase(), inReadOnly = getPermissionMode() === "read-only";
|
|
9221
9648
|
if (sub === "status") {
|
|
9222
|
-
this.showStatus(
|
|
9649
|
+
this.showStatus(inReadOnly ? "Read mode is active. /plan off to leave it." : `Permission mode: ${getPermissionMode()}.`);
|
|
9223
9650
|
return;
|
|
9224
9651
|
}
|
|
9225
9652
|
if (sub !== "" && sub !== "on" && sub !== "off") {
|
|
9226
|
-
|
|
9653
|
+
inReadOnly || this.applyPermissionMode("read-only"), await this.sendUserMessageAfterDeferredBuiltins(`Create a plan for: ${args}`);
|
|
9227
9654
|
return;
|
|
9228
9655
|
}
|
|
9229
|
-
let next = sub
|
|
9230
|
-
if (next ===
|
|
9231
|
-
this.showStatus(next ? "
|
|
9656
|
+
let next = sub !== "off";
|
|
9657
|
+
if (next === inReadOnly) {
|
|
9658
|
+
this.showStatus(next ? "Read mode is already active." : "Read mode is already off.");
|
|
9232
9659
|
return;
|
|
9233
9660
|
}
|
|
9234
|
-
next ?
|
|
9661
|
+
this.applyPermissionMode(next ? "read-only" : this.restoreTargetAfterPlan());
|
|
9235
9662
|
}
|
|
9236
|
-
// lunr: /mode — permission mode selector (manual / yolo / plan / auto). Per-session only.
|
|
9237
9663
|
handleModeCommand(args) {
|
|
9238
9664
|
let sub = args.toLowerCase();
|
|
9239
9665
|
if (sub === "status") {
|
|
9240
|
-
this.showStatus(`Permission mode: ${getPermissionMode()}`);
|
|
9666
|
+
this.showStatus(`Permission mode: ${getPermissionMode() === "read-only" ? "read" : getPermissionMode()}`);
|
|
9241
9667
|
return;
|
|
9242
9668
|
}
|
|
9243
|
-
if (sub === "
|
|
9244
|
-
this.applyPermissionMode(sub);
|
|
9669
|
+
if (sub === "yolo" || sub === "auto" || sub === "read-only" || sub === "read") {
|
|
9670
|
+
this.applyPermissionMode(sub === "read" ? "read-only" : sub);
|
|
9245
9671
|
return;
|
|
9246
9672
|
}
|
|
9247
9673
|
if (sub !== "") {
|
|
9248
|
-
this.showStatus("Usage: /mode [
|
|
9674
|
+
this.showStatus("Usage: /mode [yolo|auto|read] \u2014 bare /mode opens the selector.");
|
|
9249
9675
|
return;
|
|
9250
9676
|
}
|
|
9251
9677
|
let options = [
|
|
9252
|
-
"Manual \u2014 approve every action",
|
|
9253
9678
|
"YOLO \u2014 auto-approve tools, agent may still ask",
|
|
9254
|
-
"
|
|
9255
|
-
"
|
|
9679
|
+
"Auto \u2014 fully autonomous, no questions",
|
|
9680
|
+
"Read \u2014 inspect without making changes"
|
|
9256
9681
|
];
|
|
9257
9682
|
this.showExtensionSelector("Permission mode", options).then((choice) => {
|
|
9258
|
-
choice && (choice.startsWith("
|
|
9683
|
+
choice && (choice.startsWith("YOLO") ? this.applyPermissionMode("yolo") : choice.startsWith("Auto") ? this.applyPermissionMode("auto") : choice.startsWith("Read") && this.applyPermissionMode("read-only"));
|
|
9259
9684
|
});
|
|
9260
9685
|
}
|
|
9261
|
-
/** Destination
|
|
9686
|
+
/** Destination after plan approval or /plan off. */
|
|
9262
9687
|
restoreTargetAfterPlan() {
|
|
9263
9688
|
return restorePermissionModeAfterPlan(this.previousPermissionMode, this.settingsManager.getDefaultPermissionMode());
|
|
9264
9689
|
}
|
|
9265
9690
|
/** Apply addendum + auto-rollback for a mode without a status toast. */
|
|
9266
9691
|
syncPermissionModeEffects(mode) {
|
|
9267
|
-
mode === "
|
|
9692
|
+
this.runtimeHost.isDetached || this.transferInProgress || (this.sessionManager.setPermissionMode(mode), mode === "read-only" ? this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM) : mode === "auto" ? (this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM), enableRollbackForSession(this.sessionManager.getSessionId())) : this.session.setSystemPromptAppend(void 0));
|
|
9268
9693
|
}
|
|
9269
9694
|
// lunr: `/goal` forces session auto without writing settings.
|
|
9270
9695
|
enterGoalAuto() {
|
|
@@ -9276,23 +9701,11 @@ ${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
|
9276
9701
|
this.preGoalPermissionMode = next.saved, next.mode !== getPermissionMode() && this.applyPermissionMode(next.mode, { silent: !0 });
|
|
9277
9702
|
}
|
|
9278
9703
|
applyPermissionMode(mode, opts) {
|
|
9704
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
9705
|
+
return;
|
|
9706
|
+
this.sessionManager.setPermissionMode(mode), recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
9279
9707
|
let prev = getPermissionMode();
|
|
9280
|
-
mode === "
|
|
9281
|
-
}
|
|
9282
|
-
// lunr: approval dialog for manual permission mode.
|
|
9283
|
-
// lunr: adds "Switch to auto" / "Switch to yolo" at the bottom so users can
|
|
9284
|
-
// escape manual approval mid-turn without a separate /mode round-trip.
|
|
9285
|
-
async showApprovalDialog(req) {
|
|
9286
|
-
return new Promise((resolve4) => {
|
|
9287
|
-
this.showSelector((done) => {
|
|
9288
|
-
let selector = new ExtensionSelectorComponent(`Approve ${req.action}?`, ["Approve once", "Approve for session", "Reject", "Switch to auto", "Switch to yolo"], (option) => {
|
|
9289
|
-
done(), option === "Approve once" ? resolve4("once") : option === "Approve for session" ? resolve4("session") : option === "Switch to auto" ? (this.applyPermissionMode("auto"), resolve4("once")) : option === "Switch to yolo" ? (this.applyPermissionMode("yolo"), resolve4("once")) : resolve4("reject");
|
|
9290
|
-
}, () => {
|
|
9291
|
-
done(), resolve4("reject");
|
|
9292
|
-
}, { message: req.detail.slice(0, 500) });
|
|
9293
|
-
return { component: selector, focus: selector };
|
|
9294
|
-
});
|
|
9295
|
-
});
|
|
9708
|
+
mode === "read-only" && prev !== "read-only" && (this.previousPermissionMode = prev), setPermissionMode(mode), this.ui.requestRender(), mode === "read-only" ? this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM) : mode === "auto" ? this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM) : this.session.setSystemPromptAppend(void 0), mode === "auto" && prev !== "auto" ? enableRollbackForSession(this.sessionManager.getSessionId()) : mode !== "auto" && prev === "auto" && disableRollbackForSession(this.sessionManager.getSessionId()), !opts?.silent && (mode === "auto" && prev !== "auto" ? this.showStatus("Auto mode active \u2014 fully autonomous. Rollback enabled for this session.") : mode === "read-only" ? this.showStatus("Read mode active. Changes are blocked.") : this.showStatus(`Permission mode: ${mode}`));
|
|
9296
9709
|
}
|
|
9297
9710
|
// Approval dialog for one subagent call launching more than two children.
|
|
9298
9711
|
// "Reject with feedback" collects a one-line
|
|
@@ -9312,7 +9725,7 @@ ${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
|
9312
9725
|
});
|
|
9313
9726
|
});
|
|
9314
9727
|
}
|
|
9315
|
-
//
|
|
9728
|
+
// Approval dialog for present_plan (read-only mode). The "with feedback"
|
|
9316
9729
|
// options collect a one-line note via showExtensionInput that becomes part of
|
|
9317
9730
|
// the result text the model sees. Esc/close counts as Decline.
|
|
9318
9731
|
showPlanInChat(summary) {
|
|
@@ -9461,6 +9874,10 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
9461
9874
|
this.chatContainer.addChild(new Spacer19(1)), this.chatContainer.addChild(new DynamicBorder()), this.chatContainer.addChild(new Text21(theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0)), this.chatContainer.addChild(new Spacer19(1)), this.chatContainer.addChild(new Markdown10(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings())), this.chatContainer.addChild(new DynamicBorder()), this.ui.requestRender();
|
|
9462
9875
|
}
|
|
9463
9876
|
async handleClearCommand() {
|
|
9877
|
+
if (this.runtimeHost.isDetached || this.transferInProgress) {
|
|
9878
|
+
this.showError("Use /reclaim first, or /quit to leave this terminal.");
|
|
9879
|
+
return;
|
|
9880
|
+
}
|
|
9464
9881
|
this.clearStatusIndicator(), this.ui.setChatScroll(0), await this.waitForDeferredBuiltins();
|
|
9465
9882
|
let previousModel = this.session.model;
|
|
9466
9883
|
try {
|
|
@@ -9479,7 +9896,7 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
9479
9896
|
"",
|
|
9480
9897
|
"=== All rendered lines with visible widths ===",
|
|
9481
9898
|
...allLines.map((line, idx) => {
|
|
9482
|
-
let vw =
|
|
9899
|
+
let vw = visibleWidth6(line), escaped = JSON.stringify(line);
|
|
9483
9900
|
return `[${idx}] (w=${vw}) ${escaped}`;
|
|
9484
9901
|
}),
|
|
9485
9902
|
"",
|
|
@@ -9532,7 +9949,7 @@ ${theme.fg("muted", debugLogPath)}`, 1, 1)), this.ui.requestRender();
|
|
|
9532
9949
|
}
|
|
9533
9950
|
}
|
|
9534
9951
|
stop() {
|
|
9535
|
-
this.stopCatalogRefresh?.(), this.stopCatalogRefresh = void 0, this.settingsManager.getShowTerminalProgress() && this.ui.terminal.setProgress(!1), this.clearStatusIndicator(), this.themeController.disableAutoSync(), this.clearExtensionTerminalInputListeners(), this.footer.dispose(), this.footerDataProvider.dispose(), this.unsubscribe && this.unsubscribe(), this.isInitialized && (this.ui.stop(), this.isInitialized = !1), this.unregisterSignalHandlers();
|
|
9952
|
+
this.setThinkingAnimation(!1), this.stopCatalogRefresh?.(), this.stopCatalogRefresh = void 0, this.settingsManager.getShowTerminalProgress() && this.ui.terminal.setProgress(!1), this.clearStatusIndicator(), this.themeController.disableAutoSync(), this.clearExtensionTerminalInputListeners(), this.footer.dispose(), this.footerDataProvider.dispose(), this.disposeChatToolComponents(), this.unsubscribe && this.unsubscribe(), this.isInitialized && (this.ui.stop(), this.isInitialized = !1), this.unregisterSignalHandlers();
|
|
9536
9953
|
}
|
|
9537
9954
|
};
|
|
9538
9955
|
|