@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
|
@@ -31,15 +31,17 @@ import { getModelTiersBridge } from "../../core/model-tiers.js";
|
|
|
31
31
|
import { registerPermissionModeBridge } from "../../core/permission-mode.js";
|
|
32
32
|
import { nextModeForGoal, registerPermissionModeControlBridge } from "../../core/permission-mode-control.js";
|
|
33
33
|
import { AUTO_MODE_ADDENDUM, getPermissionMode, nextPermissionMode, registerApprovalHandler, resetPermissions, restorePermissionModeAfterPlan, setPermissionMode, } from "../../core/permissions.js";
|
|
34
|
-
import {
|
|
34
|
+
import { READ_ONLY_MODE_ADDENDUM } from "../../core/plan-mode.js";
|
|
35
35
|
import * as processRegistry from "../../core/process-registry.js";
|
|
36
36
|
import { captureTreeChanges, clearRollback, disableRollbackForSession, enableRollbackForSession, initRollback, isRollbackEnabled, isRollbackSessionForceEnabled, migrateRollbackSession, peekRollbackTurnsConsumed, beginTurn as rollbackBeginTurn, rollbackLastTurn, setRollbackWarningHandler, } from "../../core/rollback.js";
|
|
37
37
|
import { getSearchCuratorSetting, setSearchCuratorSetting } from "../../core/search-curator.js";
|
|
38
38
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
39
|
+
import { cancelSessionHandoff, markSessionHandoff, recordTuiActivity, registerTransferHandler, requestSessionTransfer, } from "../../core/session-handoff.js";
|
|
39
40
|
import { SessionManager, sessionEntryToContextMessages } from "../../core/session-manager.js";
|
|
40
41
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
41
42
|
import { getSubagentCancellation, SubagentEscapeSequence } from "../../core/subagent-cancellation.js";
|
|
42
43
|
import { time } from "../../core/timings.js";
|
|
44
|
+
import { notifyTodosEnabledChanged } from "../../core/todo-settings.js";
|
|
43
45
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
44
46
|
import { checkForUpdate, markUpdateNotified } from "../../core/update-check.js";
|
|
45
47
|
import { getAllPlanUsageResults, getUsageServiceBridge } from "../../core/usage-service.js";
|
|
@@ -121,9 +123,9 @@ function isDeadTerminalError(error) {
|
|
|
121
123
|
const code = error.code;
|
|
122
124
|
return code !== undefined && DEAD_TERMINAL_ERROR_CODES.has(code);
|
|
123
125
|
}
|
|
124
|
-
const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscription
|
|
126
|
+
const 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.";
|
|
125
127
|
// lunr: pre-connection ToS disclaimer for Anthropic subscription (OAuth) accounts.
|
|
126
|
-
const ANTHROPIC_TOS_DISCLAIMER = "Connecting an Anthropic subscription
|
|
128
|
+
const 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?";
|
|
127
129
|
const INIT_PROMPT = `Analyze this codebase and write a starter AGENTS.md in the project root.
|
|
128
130
|
Scan: package manifests, directory layout, build/test/lint scripts, CI config,
|
|
129
131
|
existing README/docs. Include only: project purpose (one paragraph), build &
|
|
@@ -255,8 +257,10 @@ export class InteractiveMode {
|
|
|
255
257
|
streamingTargetMessage = undefined;
|
|
256
258
|
streamingDisplayedLength = 0;
|
|
257
259
|
smoothStreamingTimer = undefined;
|
|
260
|
+
thinkingAnimationTimer;
|
|
258
261
|
// Tool execution tracking: toolCallId -> component
|
|
259
262
|
pendingTools = new Map();
|
|
263
|
+
browserActivityComponent;
|
|
260
264
|
// Tool output expansion state
|
|
261
265
|
toolOutputExpanded = false;
|
|
262
266
|
// Thinking block visibility state
|
|
@@ -275,8 +279,7 @@ export class InteractiveMode {
|
|
|
275
279
|
signalCleanupHandlers = [];
|
|
276
280
|
// Track if editor is in bash mode (text starts with !)
|
|
277
281
|
isBashMode = false;
|
|
278
|
-
//
|
|
279
|
-
// / `/plan <text>` to leave plan. Shift+Tab and `/mode` pick the destination themselves.
|
|
282
|
+
// Restore the previous mode after approving a plan or leaving read-only via /plan.
|
|
280
283
|
previousPermissionMode;
|
|
281
284
|
// lunr: mode in effect before `/goal` forced session auto. Dedicated so it cannot
|
|
282
285
|
// collide with plan restore.
|
|
@@ -360,7 +363,9 @@ export class InteractiveMode {
|
|
|
360
363
|
await this.rebindCurrentSession({ renderBeforeBind: true });
|
|
361
364
|
// lunr: re-init rollback for the new session id + re-apply auto force-enable.
|
|
362
365
|
initRollback(this.settingsManager, this.sessionManager.getSessionId());
|
|
363
|
-
this.
|
|
366
|
+
const mode = this.sessionManager.getPermissionMode() ?? this.settingsManager.getDefaultPermissionMode();
|
|
367
|
+
resetPermissions(mode);
|
|
368
|
+
this.syncPermissionModeEffects(mode);
|
|
364
369
|
});
|
|
365
370
|
this.version = VERSION;
|
|
366
371
|
this.ui = options.startupView?.ui ?? new TUI(new ProcessTerminal(), this.settingsManager.getShowHardwareCursor());
|
|
@@ -371,8 +376,7 @@ export class InteractiveMode {
|
|
|
371
376
|
enterGoalAuto: () => this.enterGoalAuto(),
|
|
372
377
|
leaveGoalAuto: () => this.leaveGoalAuto(),
|
|
373
378
|
});
|
|
374
|
-
|
|
375
|
-
resetPermissions(this.settingsManager.getDefaultPermissionMode());
|
|
379
|
+
resetPermissions(this.sessionManager.getPermissionMode() ?? this.settingsManager.getDefaultPermissionMode());
|
|
376
380
|
this.headerContainer = new Container();
|
|
377
381
|
if (options.startupView) {
|
|
378
382
|
this.headerContainer.addChild(new Spacer(1));
|
|
@@ -606,28 +610,27 @@ export class InteractiveMode {
|
|
|
606
610
|
time("ui.start");
|
|
607
611
|
void this.maybeNotifyCliUpdate();
|
|
608
612
|
this.startPlanUsagePolling();
|
|
609
|
-
//
|
|
613
|
+
// Plans and large subagent launches use distinct approval dialogs.
|
|
610
614
|
registerApprovalHandler(async (req) => {
|
|
611
615
|
if (req.kind === "large-subagent-launch") {
|
|
612
616
|
return this.showLargeSubagentLaunchApprovalDialog(req);
|
|
613
617
|
}
|
|
614
|
-
//
|
|
615
|
-
// restore runs BEFORE resolving so the model's next tool call already
|
|
616
|
-
// has full access. Decline keeps plan mode active.
|
|
618
|
+
// Approval restores writing access before the model's next tool call.
|
|
617
619
|
if (req.kind === "plan") {
|
|
618
620
|
const resp = await this.showPlanApprovalDialog(req.detail);
|
|
619
621
|
const decision = typeof resp === "string" ? resp : resp.decision;
|
|
620
622
|
if (decision !== "reject") {
|
|
621
|
-
this.
|
|
623
|
+
const target = this.restoreTargetAfterPlan();
|
|
624
|
+
this.applyPermissionMode(target === "read-only" ? "yolo" : target);
|
|
622
625
|
}
|
|
623
626
|
return resp;
|
|
624
627
|
}
|
|
625
|
-
return
|
|
628
|
+
return "reject";
|
|
626
629
|
});
|
|
627
630
|
// lunr: initialize rollback service for this session.
|
|
628
631
|
initRollback(this.settingsManager, this.sessionManager.getSessionId());
|
|
629
632
|
setRollbackWarningHandler((msg) => this.showStatus(msg));
|
|
630
|
-
this.syncPermissionModeEffects(this.settingsManager.getDefaultPermissionMode());
|
|
633
|
+
this.syncPermissionModeEffects(this.sessionManager.getPermissionMode() ?? this.settingsManager.getDefaultPermissionMode());
|
|
631
634
|
await this.themeController.applyFromSettings();
|
|
632
635
|
this.headerContainer.clear();
|
|
633
636
|
// Add boot screen header (unless silenced)
|
|
@@ -1383,7 +1386,7 @@ export class InteractiveMode {
|
|
|
1383
1386
|
if (result.cancelled) {
|
|
1384
1387
|
return { cancelled: true };
|
|
1385
1388
|
}
|
|
1386
|
-
this.
|
|
1389
|
+
this.clearChatContainer();
|
|
1387
1390
|
this.renderInitialMessages();
|
|
1388
1391
|
if (result.editorText && !this.editor.getText().trim()) {
|
|
1389
1392
|
this.restoreEditorFromTreeResult(result);
|
|
@@ -1452,8 +1455,26 @@ export class InteractiveMode {
|
|
|
1452
1455
|
}
|
|
1453
1456
|
return bootRows;
|
|
1454
1457
|
}
|
|
1458
|
+
unregisterSessionTransfer;
|
|
1459
|
+
transferInProgress = false;
|
|
1460
|
+
detachedDraft = "";
|
|
1455
1461
|
async rebindCurrentSession(options = {}) {
|
|
1456
1462
|
await this.waitForDeferredBuiltins();
|
|
1463
|
+
this.unregisterSessionTransfer?.();
|
|
1464
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
1465
|
+
this.unregisterSessionTransfer = registerTransferHandler(this.sessionManager, async ({ stop, signal }) => {
|
|
1466
|
+
this.transferInProgress = true;
|
|
1467
|
+
try {
|
|
1468
|
+
this.detachedDraft = this.editor.getText();
|
|
1469
|
+
await this.runtimeHost.releaseForTransfer({ stop, signal });
|
|
1470
|
+
this.editor.setText(this.detachedDraft);
|
|
1471
|
+
this.unregisterSessionTransfer?.();
|
|
1472
|
+
this.showStatus("Session released for remote continuation. Draft retained. Use /reclaim to continue here.");
|
|
1473
|
+
}
|
|
1474
|
+
finally {
|
|
1475
|
+
this.transferInProgress = false;
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1457
1478
|
this.unsubscribe?.();
|
|
1458
1479
|
this.unsubscribe = undefined;
|
|
1459
1480
|
this.applyRuntimeSettings();
|
|
@@ -1484,7 +1505,7 @@ export class InteractiveMode {
|
|
|
1484
1505
|
renderCurrentSessionState() {
|
|
1485
1506
|
this.ui.setChatScroll(0);
|
|
1486
1507
|
this.loadedResourcesContainer.clear();
|
|
1487
|
-
this.
|
|
1508
|
+
this.clearChatContainer();
|
|
1488
1509
|
this.pendingMessagesContainer.clear();
|
|
1489
1510
|
this.compactionQueuedMessages = [];
|
|
1490
1511
|
this.pendingCompactionRender = undefined;
|
|
@@ -2394,6 +2415,51 @@ export class InteractiveMode {
|
|
|
2394
2415
|
setupEditorSubmitHandler() {
|
|
2395
2416
|
this.defaultEditor.onSubmit = async (text) => {
|
|
2396
2417
|
text = text.trim();
|
|
2418
|
+
if (text === "/reclaim" || text === "/reclaim stop") {
|
|
2419
|
+
const file = this.sessionManager.getSessionFile();
|
|
2420
|
+
try {
|
|
2421
|
+
if (!file)
|
|
2422
|
+
throw new Error("This session is not saved.");
|
|
2423
|
+
if (!this.runtimeHost.isDetached) {
|
|
2424
|
+
this.showStatus("This terminal already owns the session.");
|
|
2425
|
+
return;
|
|
2426
|
+
}
|
|
2427
|
+
const draft = this.editor.getText();
|
|
2428
|
+
await requestSessionTransfer(file, { stop: text === "/reclaim stop" });
|
|
2429
|
+
await this.runtimeHost.switchSession(file);
|
|
2430
|
+
this.editor.setText(draft === text ? this.detachedDraft : draft);
|
|
2431
|
+
this.showStatus("Session reclaimed.");
|
|
2432
|
+
}
|
|
2433
|
+
catch (error) {
|
|
2434
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
2435
|
+
}
|
|
2436
|
+
return;
|
|
2437
|
+
}
|
|
2438
|
+
if ((this.runtimeHost.isDetached || this.transferInProgress) && !["/quit", "/exit"].includes(text)) {
|
|
2439
|
+
this.showError("Session is detached or transferring. Draft retained. Use /reclaim, /reclaim stop, or /quit.");
|
|
2440
|
+
return;
|
|
2441
|
+
}
|
|
2442
|
+
if (text === "/handoff" || text === "/handoff cancel") {
|
|
2443
|
+
try {
|
|
2444
|
+
if (text === "/handoff cancel")
|
|
2445
|
+
cancelSessionHandoff(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
2446
|
+
else
|
|
2447
|
+
markSessionHandoff(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
2448
|
+
this.showStatus(text === "/handoff cancel"
|
|
2449
|
+
? "Handoff mark cancelled."
|
|
2450
|
+
: "Marked for phone continuation for 8 hours. Busy work must finish or be explicitly stopped before transfer.");
|
|
2451
|
+
}
|
|
2452
|
+
catch (error) {
|
|
2453
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
2454
|
+
}
|
|
2455
|
+
return;
|
|
2456
|
+
}
|
|
2457
|
+
if (text &&
|
|
2458
|
+
!this.runtimeHost.isDetached &&
|
|
2459
|
+
(!text.startsWith("/") ||
|
|
2460
|
+
/^\/(?: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))) {
|
|
2461
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
2462
|
+
}
|
|
2397
2463
|
if (!text) {
|
|
2398
2464
|
this.takeSubmittedImages(text);
|
|
2399
2465
|
return;
|
|
@@ -2517,9 +2583,9 @@ export class InteractiveMode {
|
|
|
2517
2583
|
this.handleModeCommand(text === "/mode" ? "" : text.slice(6).trim());
|
|
2518
2584
|
return;
|
|
2519
2585
|
}
|
|
2520
|
-
if (text === "/
|
|
2586
|
+
if (text === "/read" || text === "/yolo" || text === "/auto") {
|
|
2521
2587
|
this.editor.setText("");
|
|
2522
|
-
this.applyPermissionMode(text.slice(1));
|
|
2588
|
+
this.applyPermissionMode(text === "/read" ? "read-only" : text.slice(1));
|
|
2523
2589
|
return;
|
|
2524
2590
|
}
|
|
2525
2591
|
if (text === "/processes") {
|
|
@@ -2621,15 +2687,30 @@ export class InteractiveMode {
|
|
|
2621
2687
|
}
|
|
2622
2688
|
return;
|
|
2623
2689
|
}
|
|
2624
|
-
//
|
|
2625
|
-
//
|
|
2626
|
-
if (this.session.isStreaming) {
|
|
2627
|
-
this.
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2690
|
+
// While streaming or settling a wait handoff, reserve normal Enter for subagent_wait when possible.
|
|
2691
|
+
// Extension commands keep their existing path.
|
|
2692
|
+
if (this.session.isStreaming || this.session.isWaitPromptHandoffActive) {
|
|
2693
|
+
if (!this.isExtensionCommand(text)) {
|
|
2694
|
+
await this.awaitDeferredBuiltinsForPrompt();
|
|
2695
|
+
const handoff = await this.session.interruptSubagentWaitWithPrompt(text, { images });
|
|
2696
|
+
if (handoff) {
|
|
2697
|
+
this.editor.addToHistory?.(text);
|
|
2698
|
+
this.editor.setText("");
|
|
2699
|
+
void handoff.completion.catch((error) => {
|
|
2700
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
2701
|
+
});
|
|
2702
|
+
this.ui.requestRender();
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
if (this.session.isStreaming) {
|
|
2707
|
+
this.editor.addToHistory?.(text);
|
|
2708
|
+
this.editor.setText("");
|
|
2709
|
+
await this.promptAfterDeferredBuiltins(text, { streamingBehavior: "steer", images });
|
|
2710
|
+
this.updatePendingMessagesDisplay();
|
|
2711
|
+
this.ui.requestRender();
|
|
2712
|
+
return;
|
|
2713
|
+
}
|
|
2633
2714
|
}
|
|
2634
2715
|
// Normal message submission
|
|
2635
2716
|
// First, move any pending bash components to chat
|
|
@@ -2648,6 +2729,18 @@ export class InteractiveMode {
|
|
|
2648
2729
|
getSmoothStreamingOptions() {
|
|
2649
2730
|
return { hideThinking: this.hideThinkingBlock };
|
|
2650
2731
|
}
|
|
2732
|
+
setThinkingAnimation(active) {
|
|
2733
|
+
if (!active) {
|
|
2734
|
+
if (this.thinkingAnimationTimer)
|
|
2735
|
+
clearInterval(this.thinkingAnimationTimer);
|
|
2736
|
+
this.thinkingAnimationTimer = undefined;
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
if (this.thinkingAnimationTimer)
|
|
2740
|
+
return;
|
|
2741
|
+
this.thinkingAnimationTimer = setInterval(() => this.ui.requestRender(), 33);
|
|
2742
|
+
this.thinkingAnimationTimer.unref?.();
|
|
2743
|
+
}
|
|
2651
2744
|
clearSmoothStreamingTimer() {
|
|
2652
2745
|
if (this.smoothStreamingTimer) {
|
|
2653
2746
|
clearInterval(this.smoothStreamingTimer);
|
|
@@ -2688,12 +2781,9 @@ export class InteractiveMode {
|
|
|
2688
2781
|
if (content.type !== "toolCall" || !revealedIds.has(content.id))
|
|
2689
2782
|
continue;
|
|
2690
2783
|
if (!this.pendingTools.has(content.id)) {
|
|
2691
|
-
const component =
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
2695
|
-
component.setExpanded(this.toolOutputExpanded);
|
|
2696
|
-
this.addToolComponentToChat(component);
|
|
2784
|
+
const component = content.name === "browser" && this.browserActivityComponent
|
|
2785
|
+
? this.browserActivityComponent
|
|
2786
|
+
: this.createToolExecutionComponent(content.name, content.id, content.arguments);
|
|
2697
2787
|
this.pendingTools.set(content.id, component);
|
|
2698
2788
|
}
|
|
2699
2789
|
else {
|
|
@@ -2728,6 +2818,7 @@ export class InteractiveMode {
|
|
|
2728
2818
|
}
|
|
2729
2819
|
}
|
|
2730
2820
|
stopSmoothStreaming() {
|
|
2821
|
+
this.setThinkingAnimation(false);
|
|
2731
2822
|
this.clearSmoothStreamingTimer();
|
|
2732
2823
|
this.streamingTargetMessage = undefined;
|
|
2733
2824
|
this.streamingDisplayedLength = 0;
|
|
@@ -2767,6 +2858,7 @@ export class InteractiveMode {
|
|
|
2767
2858
|
switch (event.type) {
|
|
2768
2859
|
case "agent_start":
|
|
2769
2860
|
this.pendingTools.clear();
|
|
2861
|
+
this.browserActivityComponent = undefined;
|
|
2770
2862
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
2771
2863
|
this.ui.terminal.setProgress(true);
|
|
2772
2864
|
}
|
|
@@ -2819,7 +2911,11 @@ export class InteractiveMode {
|
|
|
2819
2911
|
this.ui.requestRender();
|
|
2820
2912
|
}
|
|
2821
2913
|
else if (event.message.role === "assistant") {
|
|
2822
|
-
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse
|
|
2914
|
+
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
2915
|
+
requestRender: () => this.ui.requestRender(),
|
|
2916
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
2917
|
+
onThinkingAnimationChange: (active) => this.setThinkingAnimation(active),
|
|
2918
|
+
});
|
|
2823
2919
|
// lunr: collapsible reasoning — fresh timing array for this message.
|
|
2824
2920
|
this.thinkingRunTimings = [];
|
|
2825
2921
|
this.streamingComponent.setThinkingTimings(this.thinkingRunTimings);
|
|
@@ -2926,14 +3022,12 @@ export class InteractiveMode {
|
|
|
2926
3022
|
}
|
|
2927
3023
|
let component = this.pendingTools.get(event.toolCallId);
|
|
2928
3024
|
if (!component) {
|
|
2929
|
-
component =
|
|
2930
|
-
showImages: this.settingsManager.getShowImages(),
|
|
2931
|
-
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
2932
|
-
}, this.getRegisteredToolDefinition(event.toolName), this.ui, this.sessionManager.getCwd());
|
|
2933
|
-
component.setExpanded(this.toolOutputExpanded);
|
|
2934
|
-
this.addToolComponentToChat(component);
|
|
3025
|
+
component = this.createToolExecutionComponent(event.toolName, event.toolCallId, event.args);
|
|
2935
3026
|
this.pendingTools.set(event.toolCallId, component);
|
|
2936
3027
|
}
|
|
3028
|
+
else if (event.toolName === "browser" && !component.matchesToolCall(event.toolCallId)) {
|
|
3029
|
+
component.beginNextExecution(event.toolCallId, event.args);
|
|
3030
|
+
}
|
|
2937
3031
|
component.markExecutionStarted();
|
|
2938
3032
|
this.ui.requestRender();
|
|
2939
3033
|
break;
|
|
@@ -2968,6 +3062,7 @@ export class InteractiveMode {
|
|
|
2968
3062
|
this.streamingMessage = undefined;
|
|
2969
3063
|
}
|
|
2970
3064
|
this.pendingTools.clear();
|
|
3065
|
+
this.browserActivityComponent = undefined;
|
|
2971
3066
|
this.maybeAutoNameSession();
|
|
2972
3067
|
// lunr: capture tree-scope changes at turn boundary (bash side-effects).
|
|
2973
3068
|
captureTreeChanges(this.sessionManager.getCwd(), this.sessionManager.getSessionId());
|
|
@@ -3186,7 +3281,10 @@ export class InteractiveMode {
|
|
|
3186
3281
|
break;
|
|
3187
3282
|
}
|
|
3188
3283
|
case "assistant": {
|
|
3189
|
-
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse
|
|
3284
|
+
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.thinkingCollapse, {
|
|
3285
|
+
requestRender: () => this.ui.requestRender(),
|
|
3286
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
3287
|
+
});
|
|
3190
3288
|
// lunr: collapsible reasoning — re-attach live timings when this
|
|
3191
3289
|
// message was streamed in this session (undefined = history).
|
|
3192
3290
|
assistantComponent.setThinkingTimings(this.thinkingTimingsByMessage.get(message));
|
|
@@ -3206,6 +3304,7 @@ export class InteractiveMode {
|
|
|
3206
3304
|
}
|
|
3207
3305
|
renderSessionItems(items, options = {}) {
|
|
3208
3306
|
this.pendingTools.clear();
|
|
3307
|
+
let browserActivityComponent;
|
|
3209
3308
|
const renderedPendingTools = new Map();
|
|
3210
3309
|
// Cache-miss notices are not persisted; re-derive them from the full entry
|
|
3211
3310
|
// list and re-inject them after the assistant messages that paid for them.
|
|
@@ -3228,12 +3327,20 @@ export class InteractiveMode {
|
|
|
3228
3327
|
// Render tool call components
|
|
3229
3328
|
for (const content of message.content) {
|
|
3230
3329
|
if (content.type === "toolCall") {
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
}
|
|
3235
|
-
|
|
3236
|
-
|
|
3330
|
+
let component = content.name === "browser" ? browserActivityComponent : undefined;
|
|
3331
|
+
if (component) {
|
|
3332
|
+
component.beginNextExecution(content.id, content.arguments);
|
|
3333
|
+
}
|
|
3334
|
+
else {
|
|
3335
|
+
component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
3336
|
+
showImages: this.settingsManager.getShowImages(),
|
|
3337
|
+
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3338
|
+
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
3339
|
+
component.setExpanded(this.toolOutputExpanded);
|
|
3340
|
+
this.addToolComponentToChat(component);
|
|
3341
|
+
if (content.name === "browser")
|
|
3342
|
+
browserActivityComponent = component;
|
|
3343
|
+
}
|
|
3237
3344
|
if (message.stopReason === "aborted" || message.stopReason === "error") {
|
|
3238
3345
|
let errorMessage;
|
|
3239
3346
|
if (message.stopReason === "aborted") {
|
|
@@ -3268,6 +3375,8 @@ export class InteractiveMode {
|
|
|
3268
3375
|
}
|
|
3269
3376
|
}
|
|
3270
3377
|
else {
|
|
3378
|
+
if (message.role === "user")
|
|
3379
|
+
browserActivityComponent = undefined;
|
|
3271
3380
|
// All other messages use standard rendering
|
|
3272
3381
|
this.addMessageToChat(message, options);
|
|
3273
3382
|
}
|
|
@@ -3358,7 +3467,7 @@ export class InteractiveMode {
|
|
|
3358
3467
|
});
|
|
3359
3468
|
}
|
|
3360
3469
|
rebuildChatFromMessages() {
|
|
3361
|
-
this.
|
|
3470
|
+
this.clearChatContainer();
|
|
3362
3471
|
this.renderSessionEntries(this.sessionManager.buildContextEntries());
|
|
3363
3472
|
}
|
|
3364
3473
|
// =========================================================================
|
|
@@ -3388,6 +3497,7 @@ export class InteractiveMode {
|
|
|
3388
3497
|
if (this.isShuttingDown)
|
|
3389
3498
|
return;
|
|
3390
3499
|
this.isShuttingDown = true;
|
|
3500
|
+
this.unregisterSessionTransfer?.();
|
|
3391
3501
|
this.stopSmoothStreaming();
|
|
3392
3502
|
if (this.planUsageTimer) {
|
|
3393
3503
|
clearInterval(this.planUsageTimer);
|
|
@@ -3575,6 +3685,10 @@ export class InteractiveMode {
|
|
|
3575
3685
|
}
|
|
3576
3686
|
}
|
|
3577
3687
|
async handleFollowUp() {
|
|
3688
|
+
if (this.runtimeHost.isDetached || this.transferInProgress) {
|
|
3689
|
+
this.showError("Use /reclaim before sending more work. Draft retained.");
|
|
3690
|
+
return;
|
|
3691
|
+
}
|
|
3578
3692
|
const text = (this.editor.getExpandedText?.() ?? this.editor.getText()).trim();
|
|
3579
3693
|
if (!text)
|
|
3580
3694
|
return;
|
|
@@ -3629,6 +3743,9 @@ export class InteractiveMode {
|
|
|
3629
3743
|
this.ui.requestRender();
|
|
3630
3744
|
}
|
|
3631
3745
|
cycleThinkingLevel() {
|
|
3746
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
3747
|
+
return;
|
|
3748
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
3632
3749
|
const newLevel = this.session.cycleThinkingLevel();
|
|
3633
3750
|
if (newLevel === undefined) {
|
|
3634
3751
|
this.showStatus("Current model does not support thinking");
|
|
@@ -3642,6 +3759,9 @@ export class InteractiveMode {
|
|
|
3642
3759
|
this.applyPermissionMode(nextPermissionMode(getPermissionMode()), { silent: true });
|
|
3643
3760
|
}
|
|
3644
3761
|
async cycleModel(direction) {
|
|
3762
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
3763
|
+
return;
|
|
3764
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
3645
3765
|
try {
|
|
3646
3766
|
const result = await this.session.cycleModel(direction);
|
|
3647
3767
|
if (result === undefined) {
|
|
@@ -3678,6 +3798,32 @@ export class InteractiveMode {
|
|
|
3678
3798
|
globalThis[Symbol.for("@lunr/tools-expanded-changed")]?.(expanded);
|
|
3679
3799
|
this.ui.requestRender();
|
|
3680
3800
|
}
|
|
3801
|
+
createToolExecutionComponent(toolName, toolCallId, args) {
|
|
3802
|
+
if (toolName === "browser" && this.browserActivityComponent) {
|
|
3803
|
+
this.browserActivityComponent.beginNextExecution(toolCallId, args);
|
|
3804
|
+
return this.browserActivityComponent;
|
|
3805
|
+
}
|
|
3806
|
+
const component = new ToolExecutionComponent(toolName, toolCallId, args, {
|
|
3807
|
+
showImages: this.settingsManager.getShowImages(),
|
|
3808
|
+
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3809
|
+
}, this.getRegisteredToolDefinition(toolName), this.ui, this.sessionManager.getCwd());
|
|
3810
|
+
component.setExpanded(this.toolOutputExpanded);
|
|
3811
|
+
this.addToolComponentToChat(component);
|
|
3812
|
+
if (toolName === "browser")
|
|
3813
|
+
this.browserActivityComponent = component;
|
|
3814
|
+
return component;
|
|
3815
|
+
}
|
|
3816
|
+
disposeChatToolComponents() {
|
|
3817
|
+
for (const child of this.chatContainer.children) {
|
|
3818
|
+
if (child instanceof ToolExecutionComponent)
|
|
3819
|
+
child.dispose();
|
|
3820
|
+
}
|
|
3821
|
+
this.browserActivityComponent = undefined;
|
|
3822
|
+
}
|
|
3823
|
+
clearChatContainer() {
|
|
3824
|
+
this.disposeChatToolComponents();
|
|
3825
|
+
this.chatContainer.clear();
|
|
3826
|
+
}
|
|
3681
3827
|
// lunr: consecutive same-tool grouping — a tool component appended right after
|
|
3682
3828
|
// another component for the SAME tool becomes a group continuation (no top
|
|
3683
3829
|
// spacer / top pad); the previous card drops its bottom pad. Mixed neighbors
|
|
@@ -3691,7 +3837,6 @@ export class InteractiveMode {
|
|
|
3691
3837
|
this.hideThinkingBlock = !this.hideThinkingBlock;
|
|
3692
3838
|
this.settingsManager.setHideThinkingBlock(this.hideThinkingBlock);
|
|
3693
3839
|
// Rebuild chat from session messages
|
|
3694
|
-
this.chatContainer.clear();
|
|
3695
3840
|
this.rebuildChatFromMessages();
|
|
3696
3841
|
// If streaming, re-add the streaming component with updated visibility and re-render.
|
|
3697
3842
|
// Re-slice to the current revealed length so hide-thinking does not dump the tail.
|
|
@@ -3869,7 +4014,6 @@ export class InteractiveMode {
|
|
|
3869
4014
|
return !!extensionRunner.getCommand(commandName);
|
|
3870
4015
|
}
|
|
3871
4016
|
renderCompactionResult(result) {
|
|
3872
|
-
this.chatContainer.clear();
|
|
3873
4017
|
this.rebuildChatFromMessages();
|
|
3874
4018
|
this.addMessageToChat(createCompactionSummaryMessage(result.summary, result.tokensBefore, new Date().toISOString()));
|
|
3875
4019
|
this.footer.invalidate();
|
|
@@ -3995,6 +4139,7 @@ export class InteractiveMode {
|
|
|
3995
4139
|
availableThemes: getAvailableThemes(),
|
|
3996
4140
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
3997
4141
|
thinkingCollapse: this.thinkingCollapse,
|
|
4142
|
+
reasoningDisplay: this.settingsManager.getReasoningDisplay(),
|
|
3998
4143
|
cacheRetention: this.settingsManager.getCacheRetention() ?? "short",
|
|
3999
4144
|
doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
|
|
4000
4145
|
treeFilterMode: this.settingsManager.getTreeFilterMode(),
|
|
@@ -4017,8 +4162,12 @@ export class InteractiveMode {
|
|
|
4017
4162
|
confirmLargeSubagentLaunches: this.settingsManager.getConfirmLargeSubagentLaunches(),
|
|
4018
4163
|
computerUse: this.settingsManager.getComputerUse(),
|
|
4019
4164
|
computerForeground: this.settingsManager.getComputerForeground(),
|
|
4165
|
+
subagentCommunicationEnabled: this.settingsManager.getSubagentCommunicationEnabled(),
|
|
4166
|
+
automaticSubagentDelegation: this.settingsManager.getAutomaticSubagentDelegation(),
|
|
4167
|
+
browserEnabled: this.settingsManager.getBrowserEnabled(),
|
|
4020
4168
|
memoryEnabled: this.settingsManager.getMemoryEnabled(),
|
|
4021
4169
|
memoryCharCap: this.settingsManager.getMemoryCharCap(),
|
|
4170
|
+
todosEnabled: this.settingsManager.getTodosEnabled(),
|
|
4022
4171
|
searchCurator: getSearchCuratorSetting(),
|
|
4023
4172
|
// lunr: TUI customize settings
|
|
4024
4173
|
footerMcp: this.settingsManager.getFooterMcp(),
|
|
@@ -4108,7 +4257,6 @@ export class InteractiveMode {
|
|
|
4108
4257
|
child.setHideThinkingBlock(hidden);
|
|
4109
4258
|
}
|
|
4110
4259
|
}
|
|
4111
|
-
this.chatContainer.clear();
|
|
4112
4260
|
this.rebuildChatFromMessages();
|
|
4113
4261
|
},
|
|
4114
4262
|
onThinkingCollapseChange: (collapse) => {
|
|
@@ -4119,9 +4267,17 @@ export class InteractiveMode {
|
|
|
4119
4267
|
child.setThinkingCollapse(collapse);
|
|
4120
4268
|
}
|
|
4121
4269
|
}
|
|
4122
|
-
this.chatContainer.clear();
|
|
4123
4270
|
this.rebuildChatFromMessages();
|
|
4124
4271
|
},
|
|
4272
|
+
onReasoningDisplayChange: (display) => {
|
|
4273
|
+
this.settingsManager.setReasoningDisplay(display);
|
|
4274
|
+
for (const child of this.chatContainer.children) {
|
|
4275
|
+
if (child instanceof AssistantMessageComponent) {
|
|
4276
|
+
child.setReasoningDisplay(this.settingsManager.getReasoningDisplay());
|
|
4277
|
+
}
|
|
4278
|
+
}
|
|
4279
|
+
this.ui.requestRender();
|
|
4280
|
+
},
|
|
4125
4281
|
onShowCacheMissNoticesChange: (shown) => {
|
|
4126
4282
|
this.settingsManager.setShowCacheMissNotices(shown);
|
|
4127
4283
|
this.rebuildChatFromMessages();
|
|
@@ -4217,6 +4373,13 @@ export class InteractiveMode {
|
|
|
4217
4373
|
onConfirmLargeSubagentLaunchesChange: (enabled) => {
|
|
4218
4374
|
this.settingsManager.setConfirmLargeSubagentLaunches(enabled);
|
|
4219
4375
|
},
|
|
4376
|
+
onSubagentCommunicationChange: (enabled) => {
|
|
4377
|
+
this.settingsManager.setSubagentCommunicationEnabled(enabled);
|
|
4378
|
+
},
|
|
4379
|
+
onAutomaticSubagentDelegationChange: (enabled) => {
|
|
4380
|
+
this.settingsManager.setAutomaticSubagentDelegation(enabled);
|
|
4381
|
+
this.session.refreshToolRegistry();
|
|
4382
|
+
},
|
|
4220
4383
|
getTierThinkingLevels: (tier) => {
|
|
4221
4384
|
const model = this.resolveModelReference(this.settingsManager.getTierModel(tier));
|
|
4222
4385
|
if (model)
|
|
@@ -4232,11 +4395,20 @@ export class InteractiveMode {
|
|
|
4232
4395
|
onComputerForegroundChange: (enabled) => {
|
|
4233
4396
|
this.settingsManager.setComputerForeground(enabled);
|
|
4234
4397
|
},
|
|
4398
|
+
onBrowserEnabledChange: (enabled) => {
|
|
4399
|
+
this.settingsManager.setBrowserEnabled(enabled);
|
|
4400
|
+
this.session.refreshToolRegistry();
|
|
4401
|
+
},
|
|
4235
4402
|
onMemoryEnabledChange: (enabled) => {
|
|
4236
4403
|
this.settingsManager.setMemoryEnabled(enabled);
|
|
4237
4404
|
this.session.refreshToolRegistry();
|
|
4238
4405
|
this.showStatus(`Agent memory: ${enabled ? "on" : "off"}`);
|
|
4239
4406
|
},
|
|
4407
|
+
onTodosEnabledChange: (enabled) => {
|
|
4408
|
+
this.settingsManager.setTodosEnabled(enabled);
|
|
4409
|
+
notifyTodosEnabledChanged(enabled);
|
|
4410
|
+
this.session.refreshToolRegistry();
|
|
4411
|
+
},
|
|
4240
4412
|
onSearchCuratorChange: (setting) => {
|
|
4241
4413
|
if (!setSearchCuratorSetting(setting)) {
|
|
4242
4414
|
this.showError("pi-web-access is not loaded; curator setting unavailable.");
|
|
@@ -4276,6 +4448,36 @@ export class InteractiveMode {
|
|
|
4276
4448
|
onPlanUsageWindowChange: (window) => {
|
|
4277
4449
|
this.settingsManager.setPlanUsageWindow(window);
|
|
4278
4450
|
},
|
|
4451
|
+
onGatewayAction: (action) => {
|
|
4452
|
+
void (async () => {
|
|
4453
|
+
if (this.session.isStreaming) {
|
|
4454
|
+
this.showStatus("Wait for the current turn before managing the gateway.");
|
|
4455
|
+
return;
|
|
4456
|
+
}
|
|
4457
|
+
if (action === "status") {
|
|
4458
|
+
this.showStatus((await import("../../gateway/service.js")).serviceStatusText());
|
|
4459
|
+
return;
|
|
4460
|
+
}
|
|
4461
|
+
this.ui.stop();
|
|
4462
|
+
try {
|
|
4463
|
+
await new Promise((resolve, reject) => {
|
|
4464
|
+
const child = spawn(process.execPath, [process.argv[1], "gateway", ...action.split(" ")], {
|
|
4465
|
+
stdio: "inherit",
|
|
4466
|
+
env: process.env,
|
|
4467
|
+
});
|
|
4468
|
+
child.once("error", reject);
|
|
4469
|
+
child.once("exit", (code) => code === 0
|
|
4470
|
+
? resolve()
|
|
4471
|
+
: reject(new Error(`Gateway command exited with code ${code}. Run lunr gateway doctor.`)));
|
|
4472
|
+
});
|
|
4473
|
+
}
|
|
4474
|
+
finally {
|
|
4475
|
+
this.ui.start();
|
|
4476
|
+
this.ui.requestRender(true);
|
|
4477
|
+
}
|
|
4478
|
+
this.showStatus((await import("../../gateway/service.js")).serviceStatusText());
|
|
4479
|
+
})().catch((error) => this.showStatus(error instanceof Error ? error.message : String(error)));
|
|
4480
|
+
},
|
|
4279
4481
|
onDefaultPermissionModeChange: (mode) => {
|
|
4280
4482
|
this.settingsManager.setDefaultPermissionMode(mode);
|
|
4281
4483
|
},
|
|
@@ -4506,6 +4708,8 @@ export class InteractiveMode {
|
|
|
4506
4708
|
});
|
|
4507
4709
|
}
|
|
4508
4710
|
async showModelSelector(initialSearchInput) {
|
|
4711
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
4712
|
+
return;
|
|
4509
4713
|
// lunr: prefetch active subscription names so row rendering stays synchronous.
|
|
4510
4714
|
const subscriptionNames = await this.getActiveSubscriptionNames();
|
|
4511
4715
|
this.showSelector((done) => {
|
|
@@ -4698,6 +4902,8 @@ export class InteractiveMode {
|
|
|
4698
4902
|
});
|
|
4699
4903
|
}
|
|
4700
4904
|
showUserMessageSelector() {
|
|
4905
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
4906
|
+
return;
|
|
4701
4907
|
const userMessages = this.session.getUserMessagesForForking();
|
|
4702
4908
|
if (userMessages.length === 0) {
|
|
4703
4909
|
this.showStatus("No messages to fork from");
|
|
@@ -4746,6 +4952,8 @@ export class InteractiveMode {
|
|
|
4746
4952
|
}
|
|
4747
4953
|
}
|
|
4748
4954
|
showTreeSelector(initialSelectedId) {
|
|
4955
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
4956
|
+
return;
|
|
4749
4957
|
const tree = this.sessionManager.getTree();
|
|
4750
4958
|
const realLeafId = this.sessionManager.getLeafId();
|
|
4751
4959
|
const initialFilterMode = this.settingsManager.getTreeFilterMode();
|
|
@@ -4819,7 +5027,7 @@ export class InteractiveMode {
|
|
|
4819
5027
|
return;
|
|
4820
5028
|
}
|
|
4821
5029
|
// Update UI
|
|
4822
|
-
this.
|
|
5030
|
+
this.clearChatContainer();
|
|
4823
5031
|
this.renderInitialMessages();
|
|
4824
5032
|
if (result.editorText && !this.editor.getText().trim()) {
|
|
4825
5033
|
this.restoreEditorFromTreeResult(result);
|
|
@@ -4876,8 +5084,17 @@ export class InteractiveMode {
|
|
|
4876
5084
|
const next = (nextName ?? "").trim();
|
|
4877
5085
|
if (!next)
|
|
4878
5086
|
return;
|
|
5087
|
+
if (sessionFilePath === this.sessionManager.getSessionFile() && !this.runtimeHost.isDetached) {
|
|
5088
|
+
this.sessionManager.appendSessionInfo(next);
|
|
5089
|
+
return;
|
|
5090
|
+
}
|
|
4879
5091
|
const mgr = SessionManager.open(sessionFilePath);
|
|
4880
|
-
|
|
5092
|
+
try {
|
|
5093
|
+
mgr.appendSessionInfo(next);
|
|
5094
|
+
}
|
|
5095
|
+
finally {
|
|
5096
|
+
mgr.dispose();
|
|
5097
|
+
}
|
|
4881
5098
|
},
|
|
4882
5099
|
showRenameHint: true,
|
|
4883
5100
|
keybindings: this.keybindings,
|
|
@@ -4954,7 +5171,8 @@ export class InteractiveMode {
|
|
|
4954
5171
|
// lunr: providers with a multi-key pool list one entry per subscription plus an
|
|
4955
5172
|
// "all subscriptions" entry, encoding the target as "<providerId>#<subId|all>".
|
|
4956
5173
|
const options = [];
|
|
4957
|
-
for (const { providerId, type } of await this.session.modelRuntime.listCredentials()) {
|
|
5174
|
+
for (const { providerId, type: credentialType } of await this.session.modelRuntime.listCredentials()) {
|
|
5175
|
+
const type = credentialType === "external_claude_code" ? "oauth" : credentialType;
|
|
4958
5176
|
const name = this.session.modelRuntime.getProvider(providerId)?.name ?? providerId;
|
|
4959
5177
|
const status = { type, source: "stored credential" };
|
|
4960
5178
|
if (type === "api_key") {
|
|
@@ -5568,6 +5786,32 @@ export class InteractiveMode {
|
|
|
5568
5786
|
signal: dialog.signal,
|
|
5569
5787
|
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
5570
5788
|
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
5789
|
+
handoff: async (command, args, env) => {
|
|
5790
|
+
this.ui.stop();
|
|
5791
|
+
try {
|
|
5792
|
+
await new Promise((resolve, reject) => {
|
|
5793
|
+
const child = spawn(command, [...args], { stdio: "inherit", env, windowsHide: false });
|
|
5794
|
+
const abort = () => child.kill();
|
|
5795
|
+
dialog.signal.addEventListener("abort", abort, { once: true });
|
|
5796
|
+
if (dialog.signal.aborted)
|
|
5797
|
+
abort();
|
|
5798
|
+
child.once("error", (error) => {
|
|
5799
|
+
dialog.signal.removeEventListener("abort", abort);
|
|
5800
|
+
reject(error);
|
|
5801
|
+
});
|
|
5802
|
+
child.once("close", (code) => {
|
|
5803
|
+
dialog.signal.removeEventListener("abort", abort);
|
|
5804
|
+
if (code === 0)
|
|
5805
|
+
resolve();
|
|
5806
|
+
else
|
|
5807
|
+
reject(new Error("Claude Code login did not complete"));
|
|
5808
|
+
});
|
|
5809
|
+
});
|
|
5810
|
+
}
|
|
5811
|
+
finally {
|
|
5812
|
+
this.ui.start();
|
|
5813
|
+
}
|
|
5814
|
+
},
|
|
5571
5815
|
});
|
|
5572
5816
|
}
|
|
5573
5817
|
async showLoginDialog(providerId, providerName) {
|
|
@@ -5670,7 +5914,7 @@ export class InteractiveMode {
|
|
|
5670
5914
|
if (leafId) {
|
|
5671
5915
|
this.redoStack.push(leafId);
|
|
5672
5916
|
}
|
|
5673
|
-
this.
|
|
5917
|
+
this.clearChatContainer();
|
|
5674
5918
|
this.renderInitialMessages();
|
|
5675
5919
|
void this.flushCompactionQueue({ willRetry: false });
|
|
5676
5920
|
return { editorText: result.editorText, editorImages: result.editorImages };
|
|
@@ -5713,7 +5957,7 @@ export class InteractiveMode {
|
|
|
5713
5957
|
this.showStatus("Navigation cancelled");
|
|
5714
5958
|
return;
|
|
5715
5959
|
}
|
|
5716
|
-
this.
|
|
5960
|
+
this.clearChatContainer();
|
|
5717
5961
|
this.renderInitialMessages();
|
|
5718
5962
|
if (result.editorText && !this.editor.getText().trim()) {
|
|
5719
5963
|
this.restoreEditorFromTreeResult(result);
|
|
@@ -6233,83 +6477,68 @@ export class InteractiveMode {
|
|
|
6233
6477
|
this.chatContainer.addChild(new Text(lines.join("\n"), 1, 0));
|
|
6234
6478
|
this.ui.requestRender();
|
|
6235
6479
|
}
|
|
6236
|
-
//
|
|
6480
|
+
// /plan is a shortcut into read-only mode for planning.
|
|
6237
6481
|
async handlePlanCommand(args) {
|
|
6238
6482
|
const sub = args.toLowerCase();
|
|
6239
|
-
const
|
|
6483
|
+
const inReadOnly = getPermissionMode() === "read-only";
|
|
6240
6484
|
if (sub === "status") {
|
|
6241
|
-
this.showStatus(
|
|
6242
|
-
? "Plan mode is active — edit/write and mutating bash are blocked. /plan off to implement."
|
|
6243
|
-
: `Permission mode: ${getPermissionMode()}.`);
|
|
6485
|
+
this.showStatus(inReadOnly ? "Read mode is active. /plan off to leave it." : `Permission mode: ${getPermissionMode()}.`);
|
|
6244
6486
|
return;
|
|
6245
6487
|
}
|
|
6246
|
-
// lunr: `/plan <text>` — any arg other than on/off/status is task text.
|
|
6247
|
-
// While not in plan: enter plan and send. While in plan: restore previous
|
|
6248
|
-
// mode and send with full tool access ("looks good, go implement it").
|
|
6249
6488
|
if (sub !== "" && sub !== "on" && sub !== "off") {
|
|
6250
|
-
if (
|
|
6251
|
-
this.applyPermissionMode(
|
|
6252
|
-
}
|
|
6253
|
-
else {
|
|
6254
|
-
this.applyPermissionMode("plan");
|
|
6255
|
-
}
|
|
6256
|
-
await this.sendUserMessageAfterDeferredBuiltins(args);
|
|
6489
|
+
if (!inReadOnly)
|
|
6490
|
+
this.applyPermissionMode("read-only");
|
|
6491
|
+
await this.sendUserMessageAfterDeferredBuiltins(`Create a plan for: ${args}`);
|
|
6257
6492
|
return;
|
|
6258
6493
|
}
|
|
6259
|
-
const next = sub
|
|
6260
|
-
if (next ===
|
|
6261
|
-
this.showStatus(next ? "
|
|
6494
|
+
const next = sub !== "off";
|
|
6495
|
+
if (next === inReadOnly) {
|
|
6496
|
+
this.showStatus(next ? "Read mode is already active." : "Read mode is already off.");
|
|
6262
6497
|
return;
|
|
6263
6498
|
}
|
|
6264
|
-
|
|
6265
|
-
this.applyPermissionMode("plan");
|
|
6266
|
-
}
|
|
6267
|
-
else {
|
|
6268
|
-
this.applyPermissionMode(this.restoreTargetAfterPlan());
|
|
6269
|
-
}
|
|
6499
|
+
this.applyPermissionMode(next ? "read-only" : this.restoreTargetAfterPlan());
|
|
6270
6500
|
}
|
|
6271
|
-
// lunr: /mode — permission mode selector (manual / yolo / plan / auto). Per-session only.
|
|
6272
6501
|
handleModeCommand(args) {
|
|
6273
6502
|
const sub = args.toLowerCase();
|
|
6274
6503
|
if (sub === "status") {
|
|
6275
|
-
this.showStatus(`Permission mode: ${getPermissionMode()}`);
|
|
6504
|
+
this.showStatus(`Permission mode: ${getPermissionMode() === "read-only" ? "read" : getPermissionMode()}`);
|
|
6276
6505
|
return;
|
|
6277
6506
|
}
|
|
6278
|
-
if (sub === "
|
|
6279
|
-
this.applyPermissionMode(sub);
|
|
6507
|
+
if (sub === "yolo" || sub === "auto" || sub === "read-only" || sub === "read") {
|
|
6508
|
+
this.applyPermissionMode(sub === "read" ? "read-only" : sub);
|
|
6280
6509
|
return;
|
|
6281
6510
|
}
|
|
6282
6511
|
if (sub !== "") {
|
|
6283
|
-
this.showStatus("Usage: /mode [
|
|
6512
|
+
this.showStatus("Usage: /mode [yolo|auto|read] — bare /mode opens the selector.");
|
|
6284
6513
|
return;
|
|
6285
6514
|
}
|
|
6286
6515
|
const options = [
|
|
6287
|
-
"Manual — approve every action",
|
|
6288
6516
|
"YOLO — auto-approve tools, agent may still ask",
|
|
6289
|
-
"Plan — read-only; present a plan for approval",
|
|
6290
6517
|
"Auto — fully autonomous, no questions",
|
|
6518
|
+
"Read — inspect without making changes",
|
|
6291
6519
|
];
|
|
6292
6520
|
void this.showExtensionSelector("Permission mode", options).then((choice) => {
|
|
6293
6521
|
if (!choice)
|
|
6294
6522
|
return;
|
|
6295
|
-
if (choice.startsWith("
|
|
6296
|
-
this.applyPermissionMode("manual");
|
|
6297
|
-
else if (choice.startsWith("YOLO"))
|
|
6523
|
+
if (choice.startsWith("YOLO"))
|
|
6298
6524
|
this.applyPermissionMode("yolo");
|
|
6299
|
-
else if (choice.startsWith("Plan"))
|
|
6300
|
-
this.applyPermissionMode("plan");
|
|
6301
6525
|
else if (choice.startsWith("Auto"))
|
|
6302
6526
|
this.applyPermissionMode("auto");
|
|
6527
|
+
else if (choice.startsWith("Read"))
|
|
6528
|
+
this.applyPermissionMode("read-only");
|
|
6303
6529
|
});
|
|
6304
6530
|
}
|
|
6305
|
-
/** Destination
|
|
6531
|
+
/** Destination after plan approval or /plan off. */
|
|
6306
6532
|
restoreTargetAfterPlan() {
|
|
6307
6533
|
return restorePermissionModeAfterPlan(this.previousPermissionMode, this.settingsManager.getDefaultPermissionMode());
|
|
6308
6534
|
}
|
|
6309
6535
|
/** Apply addendum + auto-rollback for a mode without a status toast. */
|
|
6310
6536
|
syncPermissionModeEffects(mode) {
|
|
6311
|
-
if (
|
|
6312
|
-
|
|
6537
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
6538
|
+
return;
|
|
6539
|
+
this.sessionManager.setPermissionMode(mode);
|
|
6540
|
+
if (mode === "read-only") {
|
|
6541
|
+
this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM);
|
|
6313
6542
|
}
|
|
6314
6543
|
else if (mode === "auto") {
|
|
6315
6544
|
this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM);
|
|
@@ -6335,14 +6564,18 @@ export class InteractiveMode {
|
|
|
6335
6564
|
}
|
|
6336
6565
|
}
|
|
6337
6566
|
applyPermissionMode(mode, opts) {
|
|
6567
|
+
if (this.runtimeHost.isDetached || this.transferInProgress)
|
|
6568
|
+
return;
|
|
6569
|
+
this.sessionManager.setPermissionMode(mode);
|
|
6570
|
+
recordTuiActivity(this.sessionManager, this.runtimeHost.services.agentDir);
|
|
6338
6571
|
const prev = getPermissionMode();
|
|
6339
|
-
if (mode === "
|
|
6572
|
+
if (mode === "read-only" && prev !== "read-only") {
|
|
6340
6573
|
this.previousPermissionMode = prev;
|
|
6341
6574
|
}
|
|
6342
6575
|
setPermissionMode(mode);
|
|
6343
6576
|
this.ui.requestRender();
|
|
6344
|
-
if (mode === "
|
|
6345
|
-
this.session.setSystemPromptAppend(
|
|
6577
|
+
if (mode === "read-only") {
|
|
6578
|
+
this.session.setSystemPromptAppend(READ_ONLY_MODE_ADDENDUM);
|
|
6346
6579
|
}
|
|
6347
6580
|
else if (mode === "auto") {
|
|
6348
6581
|
this.session.setSystemPromptAppend(AUTO_MODE_ADDENDUM);
|
|
@@ -6361,43 +6594,13 @@ export class InteractiveMode {
|
|
|
6361
6594
|
if (mode === "auto" && prev !== "auto") {
|
|
6362
6595
|
this.showStatus("Auto mode active — fully autonomous. Rollback enabled for this session.");
|
|
6363
6596
|
}
|
|
6364
|
-
else if (mode === "
|
|
6365
|
-
this.showStatus("
|
|
6597
|
+
else if (mode === "read-only") {
|
|
6598
|
+
this.showStatus("Read mode active. Changes are blocked.");
|
|
6366
6599
|
}
|
|
6367
6600
|
else {
|
|
6368
6601
|
this.showStatus(`Permission mode: ${mode}`);
|
|
6369
6602
|
}
|
|
6370
6603
|
}
|
|
6371
|
-
// lunr: approval dialog for manual permission mode.
|
|
6372
|
-
// lunr: adds "Switch to auto" / "Switch to yolo" at the bottom so users can
|
|
6373
|
-
// escape manual approval mid-turn without a separate /mode round-trip.
|
|
6374
|
-
async showApprovalDialog(req) {
|
|
6375
|
-
return new Promise((resolve) => {
|
|
6376
|
-
this.showSelector((done) => {
|
|
6377
|
-
const selector = new ExtensionSelectorComponent(`Approve ${req.action}?`, ["Approve once", "Approve for session", "Reject", "Switch to auto", "Switch to yolo"], (option) => {
|
|
6378
|
-
done();
|
|
6379
|
-
if (option === "Approve once")
|
|
6380
|
-
resolve("once");
|
|
6381
|
-
else if (option === "Approve for session")
|
|
6382
|
-
resolve("session");
|
|
6383
|
-
else if (option === "Switch to auto") {
|
|
6384
|
-
this.applyPermissionMode("auto");
|
|
6385
|
-
resolve("once");
|
|
6386
|
-
}
|
|
6387
|
-
else if (option === "Switch to yolo") {
|
|
6388
|
-
this.applyPermissionMode("yolo");
|
|
6389
|
-
resolve("once");
|
|
6390
|
-
}
|
|
6391
|
-
else
|
|
6392
|
-
resolve("reject");
|
|
6393
|
-
}, () => {
|
|
6394
|
-
done();
|
|
6395
|
-
resolve("reject");
|
|
6396
|
-
}, { message: req.detail.slice(0, 500) });
|
|
6397
|
-
return { component: selector, focus: selector };
|
|
6398
|
-
});
|
|
6399
|
-
});
|
|
6400
|
-
}
|
|
6401
6604
|
// Approval dialog for one subagent call launching more than two children.
|
|
6402
6605
|
// "Reject with feedback" collects a one-line
|
|
6403
6606
|
// reason that becomes the block reason the model sees, so it can adjust the plan.
|
|
@@ -6426,7 +6629,7 @@ export class InteractiveMode {
|
|
|
6426
6629
|
});
|
|
6427
6630
|
});
|
|
6428
6631
|
}
|
|
6429
|
-
//
|
|
6632
|
+
// Approval dialog for present_plan (read-only mode). The "with feedback"
|
|
6430
6633
|
// options collect a one-line note via showExtensionInput that becomes part of
|
|
6431
6634
|
// the result text the model sees. Esc/close counts as Decline.
|
|
6432
6635
|
showPlanInChat(summary) {
|
|
@@ -6673,6 +6876,10 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
6673
6876
|
this.ui.requestRender();
|
|
6674
6877
|
}
|
|
6675
6878
|
async handleClearCommand() {
|
|
6879
|
+
if (this.runtimeHost.isDetached || this.transferInProgress) {
|
|
6880
|
+
this.showError("Use /reclaim first, or /quit to leave this terminal.");
|
|
6881
|
+
return;
|
|
6882
|
+
}
|
|
6676
6883
|
this.clearStatusIndicator();
|
|
6677
6884
|
this.ui.setChatScroll(0);
|
|
6678
6885
|
// Deferred factories must be on builtinRoster before /new rebuilds the runtime.
|
|
@@ -6813,6 +7020,7 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
6813
7020
|
}
|
|
6814
7021
|
}
|
|
6815
7022
|
stop() {
|
|
7023
|
+
this.setThinkingAnimation(false);
|
|
6816
7024
|
this.stopCatalogRefresh?.();
|
|
6817
7025
|
this.stopCatalogRefresh = undefined;
|
|
6818
7026
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
@@ -6823,6 +7031,7 @@ ${toggleThinking ? `| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
|
6823
7031
|
this.clearExtensionTerminalInputListeners();
|
|
6824
7032
|
this.footer.dispose();
|
|
6825
7033
|
this.footerDataProvider.dispose();
|
|
7034
|
+
this.disposeChatToolComponents();
|
|
6826
7035
|
if (this.unsubscribe) {
|
|
6827
7036
|
this.unsubscribe();
|
|
6828
7037
|
}
|