@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
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
bindConversation,
|
|
4
|
+
conversationBinding,
|
|
5
|
+
createPicker,
|
|
6
|
+
gatewayInput,
|
|
7
|
+
gatewaySelect,
|
|
8
|
+
isGatewayOwner,
|
|
9
|
+
requireGatewayOwner
|
|
10
|
+
} from "./chunk-NKH2QBKF.js";
|
|
11
|
+
import {
|
|
12
|
+
getSubagentCancellation
|
|
13
|
+
} from "./chunk-BBUVIEZB.js";
|
|
14
|
+
import {
|
|
15
|
+
PERMISSION_MODES,
|
|
16
|
+
getPermissionMode,
|
|
17
|
+
setPermissionMode
|
|
18
|
+
} from "./chunk-AJ6R5VTV.js";
|
|
19
|
+
import {
|
|
20
|
+
SessionManager
|
|
21
|
+
} from "./chunk-VIVYOI7C.js";
|
|
22
|
+
import {
|
|
23
|
+
loadGatewayConfig
|
|
24
|
+
} from "./chunk-O2AT4MEU.js";
|
|
25
|
+
|
|
26
|
+
// packages/coding-agent/dist/gateway/mobile-commands.js
|
|
27
|
+
import { mkdirSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
28
|
+
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
29
|
+
var MOBILE_COMMANDS = [
|
|
30
|
+
{ name: "project", description: "Browse folders and choose a project" },
|
|
31
|
+
{ name: "continue", description: "Continue a handoff or the latest TUI session" },
|
|
32
|
+
{ name: "sessions", description: "Browse saved sessions across projects" },
|
|
33
|
+
{ name: "mode", description: "Choose yolo, auto, or read-only permissions" },
|
|
34
|
+
{ name: "plan", description: "Plan work and approve it from this chat" },
|
|
35
|
+
{ name: "settings", description: "Change this session's model, thinking, or permissions" },
|
|
36
|
+
{ name: "stopall", description: "Stop this session and its background subagents" },
|
|
37
|
+
{ name: "download", description: "Send a file from the current project" },
|
|
38
|
+
{ name: "usage", description: "Show session tokens and subscription usage" },
|
|
39
|
+
{ name: "processes", description: "List or stop this session's shell processes" },
|
|
40
|
+
{ name: "refresh", description: "Refresh available models" },
|
|
41
|
+
{ name: "skill", description: "Choose a skill and send it a task" },
|
|
42
|
+
{ name: "fast", description: "Toggle OpenAI Codex fast mode" }
|
|
43
|
+
], FORWARDED_COMMANDS = [
|
|
44
|
+
{ name: "goal", description: "Set or manage the session goal" },
|
|
45
|
+
{ name: "cron", description: "Schedule prompts and manage scheduled jobs" },
|
|
46
|
+
{ name: "run", description: "Launch a subagent task" },
|
|
47
|
+
{ name: "chain", description: "Run a sequence of subagent tasks" },
|
|
48
|
+
{ name: "parallel", description: "Run independent subagent tasks" },
|
|
49
|
+
{ name: "mcp", description: "Show configured MCP servers" },
|
|
50
|
+
{ name: "lsp", description: "Show language server status" }
|
|
51
|
+
];
|
|
52
|
+
function resolveWithinRoots(path, roots) {
|
|
53
|
+
let actual = realpathSync(resolve(path));
|
|
54
|
+
if (!roots.some((root) => {
|
|
55
|
+
try {
|
|
56
|
+
let rel = relative(realpathSync(root), actual);
|
|
57
|
+
return rel === "" || !rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) && rel !== ".." && !isAbsolute(rel);
|
|
58
|
+
} catch {
|
|
59
|
+
return !1;
|
|
60
|
+
}
|
|
61
|
+
}))
|
|
62
|
+
throw new Error("That path is outside the approved folders.");
|
|
63
|
+
return actual;
|
|
64
|
+
}
|
|
65
|
+
function createProjectFolder(parent, name, roots) {
|
|
66
|
+
if (!name || name === "." || name === ".." || /[\\/\x00-\x1f<>:"|?*]/.test(name) || /[. ]$/.test(name) || /^(con|prn|aux|nul|com\d|lpt\d)(\.|$)/i.test(name))
|
|
67
|
+
throw new Error("Use a simple folder name without slashes or reserved characters.");
|
|
68
|
+
let actual = resolveWithinRoots(parent, roots);
|
|
69
|
+
return mkdirSync(join(actual, name)), resolveWithinRoots(join(actual, name), roots);
|
|
70
|
+
}
|
|
71
|
+
async function browseProject(ctx, initialPath) {
|
|
72
|
+
let { key, event, adapter, bridge } = ctx, roots = ctx.cfg.projectRoots ?? [];
|
|
73
|
+
if (!roots.length)
|
|
74
|
+
throw new Error("Add approved project folders with lunr gateway setup first.");
|
|
75
|
+
let current = initialPath ? resolveWithinRoots(initialPath, ctx.cfg.projectRoots ?? []) : void 0, view = () => {
|
|
76
|
+
if (!current)
|
|
77
|
+
return {
|
|
78
|
+
title: "Choose a project folder",
|
|
79
|
+
items: [.../* @__PURE__ */ new Set([...conversationBinding(key)?.recentProjects ?? [], ...roots])].filter((p) => {
|
|
80
|
+
try {
|
|
81
|
+
return resolveWithinRoots(p, roots), !0;
|
|
82
|
+
} catch {
|
|
83
|
+
return !1;
|
|
84
|
+
}
|
|
85
|
+
}).map((p) => ({ label: p, value: p }))
|
|
86
|
+
};
|
|
87
|
+
current = resolveWithinRoots(current, roots);
|
|
88
|
+
let items = [
|
|
89
|
+
{ label: "Use this folder", value: "use" },
|
|
90
|
+
{ label: "New folder", value: "new" },
|
|
91
|
+
{ label: "Recent and roots", value: "roots" }
|
|
92
|
+
];
|
|
93
|
+
try {
|
|
94
|
+
let up = resolveWithinRoots(dirname(current), roots);
|
|
95
|
+
up !== current && items.push({ label: "Up", value: up });
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
for (let item of readdirSync(current, { withFileTypes: !0 }).sort((a, b) => a.name.localeCompare(b.name)))
|
|
99
|
+
if (!(!item.isDirectory() && !item.isSymbolicLink()))
|
|
100
|
+
try {
|
|
101
|
+
let path = resolveWithinRoots(join(current, item.name), roots);
|
|
102
|
+
statSync(path).isDirectory() && items.push({ label: item.name, value: path });
|
|
103
|
+
} catch {
|
|
104
|
+
}
|
|
105
|
+
return { title: current, items };
|
|
106
|
+
}, initial = view();
|
|
107
|
+
await createPicker(adapter, event.source, {
|
|
108
|
+
kind: "project",
|
|
109
|
+
sessionKey: key,
|
|
110
|
+
invokerId: event.source.userId,
|
|
111
|
+
...initial,
|
|
112
|
+
validate: () => isGatewayOwner(event.source, loadGatewayConfig()),
|
|
113
|
+
resolve: async (item) => {
|
|
114
|
+
if (requireGatewayOwner(event.source), item.value === "use" && current) {
|
|
115
|
+
let cwd = resolveWithinRoots(current, loadGatewayConfig().projectRoots ?? []);
|
|
116
|
+
if (bridge.getStatus(key).busy)
|
|
117
|
+
throw new Error("Stop the current turn or wait before switching projects.");
|
|
118
|
+
return await bridge.reset(key), bindConversation(key, event.source, { cwd, owner: event.source.userId }), {
|
|
119
|
+
done: !0,
|
|
120
|
+
text: `Project selected: ${cwd}
|
|
121
|
+
Send a task to begin. Existing sessions are still available through /sessions.`
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (item.value === "new" && current) {
|
|
125
|
+
let name = await gatewayInput(key, "New folder name");
|
|
126
|
+
name && (current = createProjectFolder(current, name, loadGatewayConfig().projectRoots ?? []));
|
|
127
|
+
} else
|
|
128
|
+
current = item.value === "roots" ? void 0 : item.value;
|
|
129
|
+
return { done: !1, ...view() };
|
|
130
|
+
}
|
|
131
|
+
}, { threadId: event.source.threadId });
|
|
132
|
+
}
|
|
133
|
+
var transfers = /* @__PURE__ */ new Map();
|
|
134
|
+
function cancelMobileTransfer(key) {
|
|
135
|
+
transfers.get(key)?.abort();
|
|
136
|
+
}
|
|
137
|
+
async function continueSession(ctx, file) {
|
|
138
|
+
if (transfers.has(ctx.key))
|
|
139
|
+
throw new Error("A session transfer is already pending. Use /stop to cancel it.");
|
|
140
|
+
let controller = new AbortController();
|
|
141
|
+
transfers.set(ctx.key, controller);
|
|
142
|
+
try {
|
|
143
|
+
await performContinue(ctx, file, controller.signal);
|
|
144
|
+
} finally {
|
|
145
|
+
transfers.delete(ctx.key);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async function performContinue(ctx, file, signal) {
|
|
149
|
+
requireGatewayOwner(ctx.event.source);
|
|
150
|
+
let { requestSessionTransfer, SessionTransferError } = await import("./session-handoff-IAFIK7QP.js"), { key, bridge } = ctx;
|
|
151
|
+
if (bridge.peekSession?.(key)?.sessionManager?.getSessionFile() === file) {
|
|
152
|
+
await ctx.adapter.send(ctx.event.source.chatId, "This session is already open here.");
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (bridge.getStatus(key).busy)
|
|
156
|
+
throw new Error("Stop the current phone session before switching.");
|
|
157
|
+
try {
|
|
158
|
+
await requestSessionTransfer(file, { timeoutMs: 3e3, signal });
|
|
159
|
+
} catch (error) {
|
|
160
|
+
if (!(error instanceof SessionTransferError) || !["busy", "timeout"].includes(error.code))
|
|
161
|
+
throw error;
|
|
162
|
+
let choice = await gatewaySelect(key, `${error instanceof Error ? error.message : "Session is in use"}
|
|
163
|
+
How should lunR continue?`, ["Wait until idle", "Stop and continue", "Cancel"], { signal });
|
|
164
|
+
if (!choice || choice === "Cancel")
|
|
165
|
+
return;
|
|
166
|
+
if (choice === "Stop and continue")
|
|
167
|
+
await requestSessionTransfer(file, { stop: !0, timeoutMs: 3e4, signal });
|
|
168
|
+
else {
|
|
169
|
+
let deadline = Date.now() + 12e4;
|
|
170
|
+
for (; ; ) {
|
|
171
|
+
signal.throwIfAborted(), requireGatewayOwner(ctx.event.source);
|
|
172
|
+
try {
|
|
173
|
+
await requestSessionTransfer(file, { timeoutMs: 3e3, signal });
|
|
174
|
+
break;
|
|
175
|
+
} catch (retryError) {
|
|
176
|
+
if (!(retryError instanceof SessionTransferError) || !["busy", "timeout"].includes(retryError.code) || Date.now() >= deadline)
|
|
177
|
+
throw retryError;
|
|
178
|
+
}
|
|
179
|
+
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
signal.throwIfAborted(), requireGatewayOwner(ctx.event.source), await bridge.switchSession(key, file);
|
|
184
|
+
let session = await bridge.getSession(key), cwd = session?.sessionManager?.getCwd();
|
|
185
|
+
bindConversation(key, ctx.event.source, { cwd, owner: ctx.event.source.userId });
|
|
186
|
+
let id = session?.sessionManager?.getSessionId();
|
|
187
|
+
if (id && ["auto", "yolo"].includes(getPermissionMode(id))) {
|
|
188
|
+
let requested = getPermissionMode(id);
|
|
189
|
+
setPermissionMode("read-only", id), session?.sessionManager?.setPermissionMode?.("read-only"), await gatewaySelect(key, `Continue with ${requested} permissions? Tools can change files and run commands without individual approval.`, ["Keep read-only", `Use ${requested}`]) === `Use ${requested}` && (setPermissionMode(requested, id), session?.sessionManager?.setPermissionMode?.(requested));
|
|
190
|
+
}
|
|
191
|
+
await ctx.adapter.send(ctx.event.source.chatId, `Continuing ${session?.sessionManager?.getSessionName() ?? basename(file)}
|
|
192
|
+
Project: ${cwd}
|
|
193
|
+
Send your next instruction.`, { threadId: ctx.event.source.threadId });
|
|
194
|
+
}
|
|
195
|
+
async function browseSessions(ctx, args, quick) {
|
|
196
|
+
let handoff = await import("./session-handoff-IAFIK7QP.js");
|
|
197
|
+
if (quick) {
|
|
198
|
+
let candidates = handoff.listHandoffCandidates();
|
|
199
|
+
if (!candidates.length) {
|
|
200
|
+
let latest = handoff.latestTuiSession();
|
|
201
|
+
if (!latest)
|
|
202
|
+
throw new Error("No recent TUI session found. Use /sessions or mark one in the terminal with /handoff.");
|
|
203
|
+
await continueSession(ctx, latest.sessionFile);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (candidates.length === 1) {
|
|
207
|
+
await continueSession(ctx, candidates[0].sessionFile);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
await sessionPicker(ctx, candidates.map((s) => ({ label: `${s.cwd} \xB7 ${basename(s.sessionFile)}`, value: s.sessionFile })));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
let sessions = await SessionManager.listAll(), known = new Set(sessions.map((s) => s.path));
|
|
214
|
+
for (let file of handoff.listRegisteredSessionPaths())
|
|
215
|
+
if (!known.has(file))
|
|
216
|
+
try {
|
|
217
|
+
let manager = SessionManager.openReadOnly(file), header = manager.getHeader();
|
|
218
|
+
header && sessions.push({
|
|
219
|
+
id: header.id,
|
|
220
|
+
path: file,
|
|
221
|
+
cwd: manager.getCwd(),
|
|
222
|
+
name: manager.getSessionName(),
|
|
223
|
+
created: new Date(header.timestamp),
|
|
224
|
+
modified: statSync(file).mtime,
|
|
225
|
+
messageCount: manager.getEntries().length,
|
|
226
|
+
firstMessage: "",
|
|
227
|
+
allMessagesText: ""
|
|
228
|
+
});
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
let query = args.toLowerCase(), items = sessions.sort((a, b) => b.modified.getTime() - a.modified.getTime()).filter((s) => !query || `${s.name ?? ""} ${s.cwd} ${s.id}`.toLowerCase().includes(query)).map((s) => ({
|
|
232
|
+
label: `${s.name || s.firstMessage.slice(0, 35) || s.id.slice(0, 8)} \xB7 ${basename(s.cwd)} \xB7 ${s.modified.toLocaleDateString()}`,
|
|
233
|
+
value: s.path
|
|
234
|
+
}));
|
|
235
|
+
await sessionPicker(ctx, items);
|
|
236
|
+
}
|
|
237
|
+
async function sessionPicker(ctx, items) {
|
|
238
|
+
await createPicker(ctx.adapter, ctx.event.source, {
|
|
239
|
+
kind: "sessions",
|
|
240
|
+
sessionKey: ctx.key,
|
|
241
|
+
invokerId: ctx.event.source.userId,
|
|
242
|
+
title: "Choose a session. Use /sessions <search> to filter.",
|
|
243
|
+
items,
|
|
244
|
+
validate: () => isGatewayOwner(ctx.event.source, loadGatewayConfig()),
|
|
245
|
+
resolve: async (item) => (await continueSession(ctx, item.value), { done: !0, text: "Session selection finished." })
|
|
246
|
+
}, { threadId: ctx.event.source.threadId });
|
|
247
|
+
}
|
|
248
|
+
async function handleMobileCommand(ctx, command, args) {
|
|
249
|
+
if (!MOBILE_COMMANDS.some((c) => c.name === command) && command !== "resume")
|
|
250
|
+
return !1;
|
|
251
|
+
if (requireGatewayOwner(ctx.event.source, ctx.cfg), bindConversation(ctx.key, ctx.event.source, { owner: ctx.event.source.userId }), command === "project")
|
|
252
|
+
return await browseProject(ctx, args.trim() || void 0), !0;
|
|
253
|
+
if (command === "sessions" || command === "resume" || command === "continue")
|
|
254
|
+
return await browseSessions(ctx, args, command === "continue"), !0;
|
|
255
|
+
let session = await ctx.bridge.getSession(ctx.key);
|
|
256
|
+
if (!session)
|
|
257
|
+
throw new Error("Select a project and send a task, or use /continue first.");
|
|
258
|
+
let id = session.sessionManager?.getSessionId();
|
|
259
|
+
if (command === "usage") {
|
|
260
|
+
let stats = session.getSessionStats(), plans = await (await import("./usage-service-LFB2SWYV.js")).getAllPlanUsageResults(session.model?.provider, session.modelRuntime);
|
|
261
|
+
return await ctx.adapter.send(ctx.event.source.chatId, [
|
|
262
|
+
`Tokens: ${stats.tokens.total} \xB7 cost: $${stats.cost.toFixed(4)}`,
|
|
263
|
+
...plans.usages.flatMap((p) => p.windows.map((w) => `${p.provider} ${w.label}: ${w.usedPercent.toFixed(1)}% used`)),
|
|
264
|
+
...plans.errors
|
|
265
|
+
].join(`
|
|
266
|
+
`)), !0;
|
|
267
|
+
}
|
|
268
|
+
if (command === "processes") {
|
|
269
|
+
if (!id)
|
|
270
|
+
throw new Error("No session identity.");
|
|
271
|
+
let processes = await import("./process-registry-PVJ44F7H.js"), own = processes.list(id);
|
|
272
|
+
if (args) {
|
|
273
|
+
let [action, raw] = args.split(/\s+/), pid = Number(raw);
|
|
274
|
+
if (action !== "stop" || !own.some((p) => p.pid === pid))
|
|
275
|
+
throw new Error("Usage: /processes stop <pid> from this session's process list.");
|
|
276
|
+
processes.kill(pid), await ctx.adapter.send(ctx.event.source.chatId, `Stop requested for process ${pid}.`);
|
|
277
|
+
} else
|
|
278
|
+
await ctx.adapter.send(ctx.event.source.chatId, own.length ? own.map((p) => `${p.pid} \xB7 ${p.status} \xB7 ${p.command}`).join(`
|
|
279
|
+
`).slice(0, ctx.adapter.maxMessageLength) : "No tracked processes.");
|
|
280
|
+
return !0;
|
|
281
|
+
}
|
|
282
|
+
if (command === "stopall") {
|
|
283
|
+
await ctx.bridge.abort(ctx.key);
|
|
284
|
+
let result = id ? await getSubagentCancellation(id)?.stop() : void 0, processes = await import("./process-registry-PVJ44F7H.js"), count = id ? processes.list(id).filter((p) => p.status !== "exited").length : 0;
|
|
285
|
+
return id && processes.killAll(id), await ctx.adapter.send(ctx.event.source.chatId, `Stopped the current turn. Requested stop for ${result?.requested ?? 0} background runs and ${count} tracked processes${result?.failed ? `; ${result.failed} requests failed` : ""}. Wait for them to exit before transferring.`), !0;
|
|
286
|
+
}
|
|
287
|
+
if (ctx.bridge.getStatus(ctx.key).busy)
|
|
288
|
+
throw new Error("Wait for the current turn or use /stop first.");
|
|
289
|
+
if (command === "refresh")
|
|
290
|
+
return await session.modelRuntime.refresh(), await ctx.adapter.send(ctx.event.source.chatId, "Model catalog refreshed. Use /model to choose."), !0;
|
|
291
|
+
if (command === "fast") {
|
|
292
|
+
if (session.model?.provider !== "openai-codex" || !session.settingsManager)
|
|
293
|
+
throw new Error("Fast mode is available only for OpenAI Codex subscriptions.");
|
|
294
|
+
let current = session.settingsManager.getOpenAIFastMode();
|
|
295
|
+
if (args && !["on", "off", "status"].includes(args))
|
|
296
|
+
throw new Error("Usage: /fast on|off|status");
|
|
297
|
+
return args !== "status" && session.settingsManager.setOpenAIFastMode(args ? args === "on" : !current), await ctx.adapter.send(ctx.event.source.chatId, `Fast mode: ${session.settingsManager.getOpenAIFastMode() ? "on" : "off"}`), !0;
|
|
298
|
+
}
|
|
299
|
+
if (command === "skill") {
|
|
300
|
+
let names = session.resourceLoader?.getSkills().skills.map((s) => s.name) ?? [], [name, ...task] = args.split(/\s+/).filter(Boolean), chosen = name || await gatewaySelect(ctx.key, "Choose a skill", names);
|
|
301
|
+
if (!chosen)
|
|
302
|
+
return !0;
|
|
303
|
+
if (!names.includes(chosen))
|
|
304
|
+
throw new Error("That skill is not loaded for this project.");
|
|
305
|
+
return ctx.event.text = `/skill:${chosen} ${task.join(" ") || await gatewayInput(ctx.key, "What should this skill do?") || ""}`, !1;
|
|
306
|
+
}
|
|
307
|
+
if (command === "download") {
|
|
308
|
+
if (!ctx.adapter.sendFile)
|
|
309
|
+
throw new Error("This platform cannot send files.");
|
|
310
|
+
if (!args)
|
|
311
|
+
throw new Error("Usage: /download <project-relative path>");
|
|
312
|
+
let cwd = session.sessionManager?.getCwd();
|
|
313
|
+
if (!cwd)
|
|
314
|
+
throw new Error("No project selected.");
|
|
315
|
+
let file = resolveWithinRoots(resolve(cwd, args), [cwd]), stat = statSync(file);
|
|
316
|
+
if (!stat.isFile() || stat.size > 8 * 1024 * 1024)
|
|
317
|
+
throw new Error("Choose a file no larger than 8 MB.");
|
|
318
|
+
if (/(^|[\\/])(?:\.env(?:\.[^\\/]*)?|auth\.json|gateway\.json|credentials[^\\/]*|id_rsa|id_ed25519)([\\/]|$)/i.test(file))
|
|
319
|
+
throw new Error("Credential files cannot be sent through chat.");
|
|
320
|
+
let result = await ctx.adapter.sendFile(ctx.event.source.chatId, file, { threadId: ctx.event.source.threadId });
|
|
321
|
+
if (!result.success)
|
|
322
|
+
throw new Error(result.error ?? "File delivery failed.");
|
|
323
|
+
return !0;
|
|
324
|
+
}
|
|
325
|
+
if (command === "settings") {
|
|
326
|
+
let choice = await gatewaySelect(ctx.key, "Session settings", ["Model", "Thinking", "Permissions"]);
|
|
327
|
+
if (choice === "Model" || choice === "Thinking") {
|
|
328
|
+
let { CHAT_COMMANDS, runChatCommand } = await import("./commands-Y2OUC2T7.js"), cmd = CHAT_COMMANDS.find((c) => c.name === choice.toLowerCase());
|
|
329
|
+
return cmd && await runChatCommand(cmd, {
|
|
330
|
+
...ctx,
|
|
331
|
+
args: "",
|
|
332
|
+
reply: async (text) => {
|
|
333
|
+
await ctx.adapter.send(ctx.event.source.chatId, text);
|
|
334
|
+
}
|
|
335
|
+
}), !0;
|
|
336
|
+
}
|
|
337
|
+
if (choice !== "Permissions")
|
|
338
|
+
return !0;
|
|
339
|
+
}
|
|
340
|
+
let requested = command === "plan" ? "read-only" : args || await gatewaySelect(ctx.key, `Permission mode: ${getPermissionMode(id)}`, [...PERMISSION_MODES]);
|
|
341
|
+
if (!requested)
|
|
342
|
+
return !0;
|
|
343
|
+
let mode = requested === "read" ? "read-only" : requested;
|
|
344
|
+
if (!PERMISSION_MODES.includes(mode))
|
|
345
|
+
throw new Error("Choose yolo, auto, or read-only.");
|
|
346
|
+
return setPermissionMode(mode, id), session.sessionManager?.setPermissionMode?.(mode), await ctx.adapter.send(ctx.event.source.chatId, `Permission mode: ${mode}`), command === "plan" && args ? (ctx.event.text = `Create a plan for: ${args}`, !1) : !0;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export {
|
|
350
|
+
MOBILE_COMMANDS,
|
|
351
|
+
FORWARDED_COMMANDS,
|
|
352
|
+
resolveWithinRoots,
|
|
353
|
+
createProjectFolder,
|
|
354
|
+
cancelMobileTransfer,
|
|
355
|
+
handleMobileCommand
|
|
356
|
+
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-PCIGF2XK.js";
|
|
12
12
|
|
|
13
13
|
// packages/coding-agent/dist/core/plan-mode.js
|
|
14
|
-
var
|
|
14
|
+
var READ_ONLY_MODE_ADDENDUM = "You are in read-only mode. Investigate and answer without making changes. If the user asks for a plan, you may call present_plan for approval. Do not implement until the user switches modes or approves that plan.", READ_ONLY_MODE_BLOCK_MESSAGE = "Read-only mode is active; no changes allowed.", BLOCKED_TOOLS = /* @__PURE__ */ new Set(["edit", "write", "memory_add", "memory_remove", "cron"]), ALLOWED_COMMANDS = /* @__PURE__ */ new Set([
|
|
15
15
|
"ls",
|
|
16
16
|
"ll",
|
|
17
17
|
"cat",
|
|
@@ -128,19 +128,21 @@ var PLAN_MODE_ADDENDUM = "You are in plan mode. Investigate read-only, then pres
|
|
|
128
128
|
function isCodeRewriteMutating(input) {
|
|
129
129
|
return input?.dry_run === !1;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function readOnlyModeBlockReason(toolName, input) {
|
|
132
132
|
if (toolName.startsWith("computer_"))
|
|
133
133
|
try {
|
|
134
|
-
return computerPolicy(toolName, {})?.observation ? void 0 :
|
|
134
|
+
return computerPolicy(toolName, {})?.observation ? void 0 : READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
135
135
|
} catch {
|
|
136
|
-
return
|
|
136
|
+
return READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
137
137
|
}
|
|
138
|
+
if (toolName === "browser" && input?.action === "act")
|
|
139
|
+
return `${READ_ONLY_MODE_BLOCK_MESSAGE} Browser interactions require a writable mode; observation remains available.`;
|
|
138
140
|
if (BLOCKED_TOOLS.has(toolName) || toolName === "code_rewrite" && isCodeRewriteMutating(input))
|
|
139
|
-
return
|
|
141
|
+
return READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
140
142
|
if (toolName === "bash") {
|
|
141
143
|
let command = readBashCommand(input);
|
|
142
144
|
if (command && isMutatingBashCommand(command))
|
|
143
|
-
return `${
|
|
145
|
+
return `${READ_ONLY_MODE_BLOCK_MESSAGE} Blocked command: ${command}`;
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
function readBashCommand(input) {
|
|
@@ -372,16 +374,16 @@ function effectiveLargeSubagentLaunchCountForTurn(args, assistantMessage) {
|
|
|
372
374
|
}
|
|
373
375
|
|
|
374
376
|
// packages/coding-agent/dist/core/permissions.js
|
|
375
|
-
var PERMISSION_MODES = ["
|
|
377
|
+
var PERMISSION_MODES = ["yolo", "auto", "read-only"];
|
|
376
378
|
function nextPermissionMode(current) {
|
|
377
379
|
let i = PERMISSION_MODES.indexOf(current);
|
|
378
380
|
return PERMISSION_MODES[(i + 1) % PERMISSION_MODES.length];
|
|
379
381
|
}
|
|
380
|
-
function
|
|
381
|
-
return getPermissionMode(sessionId) === "
|
|
382
|
+
function isReadOnlyModeActive(sessionId) {
|
|
383
|
+
return getPermissionMode(sessionId) === "read-only";
|
|
382
384
|
}
|
|
383
385
|
function restorePermissionModeAfterPlan(previous, defaultMode) {
|
|
384
|
-
return previous && previous !== "
|
|
386
|
+
return previous && previous !== "read-only" ? previous : defaultMode;
|
|
385
387
|
}
|
|
386
388
|
var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
387
389
|
"read",
|
|
@@ -405,8 +407,15 @@ var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
|
405
407
|
"lsp_symbols",
|
|
406
408
|
"lsp_code_actions",
|
|
407
409
|
"lsp_completions",
|
|
408
|
-
"
|
|
409
|
-
|
|
410
|
+
"lsp_rename",
|
|
411
|
+
"memory_load",
|
|
412
|
+
"subagent_wait",
|
|
413
|
+
"subagent_supervisor",
|
|
414
|
+
"intercom",
|
|
415
|
+
"contact_supervisor",
|
|
416
|
+
"present_plan",
|
|
417
|
+
"structured_output"
|
|
418
|
+
]), NO_HANDLER_REASON = "Approval channel unavailable.", LARGE_SUBAGENT_LAUNCH_REJECT_REASON = "Large subagent launch rejected by user.", NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON = "Large subagent launch blocked: no approval channel available.", LARGE_SUBAGENT_LAUNCH_ACTION = "large-subagent-launch", contexts = /* @__PURE__ */ new Map(), defaultContext = { mode: "yolo", approvals: /* @__PURE__ */ new Set() }, approvalHandler, turnLargeLaunchDecisions = /* @__PURE__ */ new WeakMap();
|
|
410
419
|
function getContext(sessionId) {
|
|
411
420
|
return sessionId ? contexts.get(sessionId) ?? defaultContext : defaultContext;
|
|
412
421
|
}
|
|
@@ -422,7 +431,7 @@ function getPermissionMode(sessionId) {
|
|
|
422
431
|
function setPermissionMode(mode, sessionId) {
|
|
423
432
|
getContext(sessionId).mode = mode;
|
|
424
433
|
}
|
|
425
|
-
function resetPermissions(defaultMode = "
|
|
434
|
+
function resetPermissions(defaultMode = "yolo", sessionId) {
|
|
426
435
|
sessionId ? contexts.set(sessionId, { mode: defaultMode, approvals: /* @__PURE__ */ new Set() }) : defaultContext = { mode: defaultMode, approvals: /* @__PURE__ */ new Set() };
|
|
427
436
|
}
|
|
428
437
|
function registerApprovalHandler(fn) {
|
|
@@ -446,10 +455,6 @@ async function requestPlanApproval(summary) {
|
|
|
446
455
|
return planApprovalResultText(resp);
|
|
447
456
|
}
|
|
448
457
|
var AUTO_MODE_ADDENDUM = "You are running fully autonomously. Do not ask the user questions or wait for confirmation; make reasonable decisions and complete the task end-to-end.";
|
|
449
|
-
function isPathOutsideCwd(absPath, cwd) {
|
|
450
|
-
let norm = (p) => p.replace(/\\/g, "/").replace(/\/$/, ""), np = norm(absPath), nc = norm(cwd);
|
|
451
|
-
return np === nc ? !1 : !np.startsWith(`${nc}/`);
|
|
452
|
-
}
|
|
453
458
|
function resolvePath(cwd, p) {
|
|
454
459
|
return typeof p != "string" || !p ? "" : resolve(cwd, p);
|
|
455
460
|
}
|
|
@@ -469,12 +474,11 @@ function protectedFileWriteReason(toolName, input, cwd) {
|
|
|
469
474
|
if (normalize(target) === normalize(join(dirname(getAgentDir()), "simple-memory", "memory.md")))
|
|
470
475
|
return MEMORY_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
471
476
|
let globalSettings = normalize(join(getAgentDir(), "settings.json")), projectSettings = normalize(join(cwd, CONFIG_DIR_NAME, "settings.json")), normalizedTarget = normalize(target);
|
|
477
|
+
if (normalizedTarget === normalize(join(getAgentDir(), "install-features.json")))
|
|
478
|
+
return "Optional features are user-managed through lunr features; Browser is managed in /settings. Do not change install-features.json directly.";
|
|
472
479
|
if (normalizedTarget === globalSettings || normalizedTarget === projectSettings)
|
|
473
480
|
return SETTINGS_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
474
481
|
}
|
|
475
|
-
function isMutatingTool(toolName) {
|
|
476
|
-
return MUTATING_TOOLS.has(toolName);
|
|
477
|
-
}
|
|
478
482
|
function collectRequestedChildLaunches(value, launches) {
|
|
479
483
|
if (!value || typeof value != "object" || Array.isArray(value))
|
|
480
484
|
return;
|
|
@@ -498,9 +502,6 @@ function getRequestedChildLaunches(input) {
|
|
|
498
502
|
let launches = [];
|
|
499
503
|
return collectRequestedChildLaunches(input, launches), launches;
|
|
500
504
|
}
|
|
501
|
-
function requiresManualApproval(toolName, input) {
|
|
502
|
-
return toolName.startsWith("computer_") ? toolName !== "computer_end" : isMutatingTool(toolName) ? !0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
|
|
503
|
-
}
|
|
504
505
|
function firstTaskText(value) {
|
|
505
506
|
return typeof value == "string" && value.trim() ? sanitizeDetail(value) : "";
|
|
506
507
|
}
|
|
@@ -527,16 +528,14 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
|
|
|
527
528
|
if (ctx.mode === "auto" || options?.confirmLargeSubagentLaunches === !1)
|
|
528
529
|
return;
|
|
529
530
|
let count = effectiveLargeSubagentLaunchCountForTurn(input, options?.assistantMessage);
|
|
530
|
-
if (count <= 2)
|
|
531
|
+
if (count <= 2 || ctx.approvals.has(LARGE_SUBAGENT_LAUNCH_ACTION))
|
|
531
532
|
return;
|
|
532
|
-
if (ctx.approvals.has(LARGE_SUBAGENT_LAUNCH_ACTION))
|
|
533
|
-
return { fullChildrenApproved: !1 };
|
|
534
533
|
let turnKey = options?.assistantMessage, cached = turnKey ? turnLargeLaunchDecisions.get(turnKey) : void 0;
|
|
535
534
|
if (cached)
|
|
536
535
|
return cached.decision === "reject" ? {
|
|
537
536
|
block: !0,
|
|
538
537
|
reason: cached.feedback ? `${LARGE_SUBAGENT_LAUNCH_REJECT_REASON} ${cached.feedback}` : LARGE_SUBAGENT_LAUNCH_REJECT_REASON
|
|
539
|
-
} :
|
|
538
|
+
} : void 0;
|
|
540
539
|
if (!approvalHandler || ctx.allowApprovals === !1)
|
|
541
540
|
return { block: !0, reason: NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
|
|
542
541
|
let summary = largeLaunchTaskSummary(input, options?.assistantMessage), siblingLaunches = (options?.assistantMessage?.content ?? []).flatMap((block) => {
|
|
@@ -544,7 +543,7 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
|
|
|
544
543
|
return [];
|
|
545
544
|
let args = block.arguments && typeof block.arguments == "object" && !Array.isArray(block.arguments) ? block.arguments : void 0;
|
|
546
545
|
return args ? getRequestedChildLaunches(args) : [];
|
|
547
|
-
}),
|
|
546
|
+
}), launchSummary = (siblingLaunches.length > 0 ? siblingLaunches : getRequestedChildLaunches(input)).map((launch) => `${launch.description}
|
|
548
547
|
permissions: ${launch.permissions}`).join(`
|
|
549
548
|
`), resp;
|
|
550
549
|
try {
|
|
@@ -559,10 +558,15 @@ ${launchSummary || summary}` : ""}`,
|
|
|
559
558
|
return { block: !0, reason: err instanceof Error ? err.message : NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
|
|
560
559
|
}
|
|
561
560
|
let rawDecision = typeof resp == "string" ? resp : resp.decision, decision = rawDecision === "approve" ? "once" : rawDecision, feedback = typeof resp == "string" ? void 0 : resp.feedback?.trim();
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
561
|
+
if (turnKey && turnLargeLaunchDecisions.set(turnKey, { decision, ...feedback ? { feedback } : {} }), decision === "session") {
|
|
562
|
+
ctx.approvals.add(LARGE_SUBAGENT_LAUNCH_ACTION);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (decision === "reject")
|
|
566
|
+
return {
|
|
567
|
+
block: !0,
|
|
568
|
+
reason: feedback ? `${LARGE_SUBAGENT_LAUNCH_REJECT_REASON} ${feedback}` : LARGE_SUBAGENT_LAUNCH_REJECT_REASON
|
|
569
|
+
};
|
|
566
570
|
}
|
|
567
571
|
function sanitizeDetail(value) {
|
|
568
572
|
let text = String(value ?? "").trim();
|
|
@@ -579,67 +583,35 @@ async function gateToolCall(toolName, input, cwd, sessionId, options) {
|
|
|
579
583
|
let protectedWriteReason = protectedFileWriteReason(toolName, input, cwd);
|
|
580
584
|
if (protectedWriteReason)
|
|
581
585
|
return { block: !0, reason: protectedWriteReason };
|
|
582
|
-
if (READ_ONLY_TOOLS.has(toolName))
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
let path = resolvePath(cwd, input.path);
|
|
604
|
-
action = (path ? isPathOutsideCwd(path, cwd) : !1) ? `${toolName}-outside` : toolName, detail = path || String(input.path ?? "");
|
|
605
|
-
} else if (toolName === "memory_add")
|
|
606
|
-
action = toolName, detail = sanitizeDetail(input.content);
|
|
607
|
-
else if (toolName === "memory_remove")
|
|
608
|
-
action = toolName, detail = sanitizeDetail(input.line);
|
|
609
|
-
else if (toolName === "cron")
|
|
610
|
-
action = "cron", detail = sanitizeDetail(input.action);
|
|
611
|
-
else if (toolName === "subagent") {
|
|
612
|
-
action = FULL_CHILD_ACTION;
|
|
613
|
-
let launches = getRequestedChildLaunches(input).filter((launch) => launch.permissions === "full");
|
|
614
|
-
detail = sanitizeDetail(launches.map((launch) => `${launch.description}
|
|
615
|
-
permissions: ${launch.permissions}`).join(`
|
|
616
|
-
`));
|
|
617
|
-
} else toolName === "code_rewrite" ? (action = "code_rewrite", detail = sanitizeDetail(input.path ?? input.pattern)) : (action = toolName, detail = "");
|
|
618
|
-
if (!toolName.startsWith("computer_") && ctx.approvals.has(action))
|
|
619
|
-
return;
|
|
620
|
-
if (!approvalHandler || ctx.allowApprovals === !1)
|
|
621
|
-
return { block: !0, reason: NO_HANDLER_REASON };
|
|
622
|
-
let resp;
|
|
623
|
-
try {
|
|
624
|
-
resp = await approvalHandler({ toolName, action, detail });
|
|
625
|
-
} catch (err) {
|
|
626
|
-
return { block: !0, reason: err instanceof Error ? err.message : NO_HANDLER_REASON };
|
|
627
|
-
}
|
|
628
|
-
let decision = typeof resp == "string" ? resp : resp.decision;
|
|
629
|
-
if (decision === "session") {
|
|
630
|
-
toolName.startsWith("computer_") || ctx.approvals.add(action);
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
if (decision === "reject") {
|
|
634
|
-
let feedback = typeof resp == "string" ? void 0 : resp.feedback?.trim();
|
|
635
|
-
return { block: !0, reason: feedback ? `${REJECT_REASON} ${feedback}` : REJECT_REASON };
|
|
586
|
+
if (!READ_ONLY_TOOLS.has(toolName)) {
|
|
587
|
+
if (ctx.mode === "read-only") {
|
|
588
|
+
let reason = readOnlyModeBlockReason(toolName, input);
|
|
589
|
+
if (reason)
|
|
590
|
+
return { block: !0, reason };
|
|
591
|
+
if (toolName === "mcp")
|
|
592
|
+
return input.tool || input.connect || input.action && input.action !== "ui-messages" ? { block: !0, reason: "Read-only mode blocks MCP tool calls, connections, and authentication." } : void 0;
|
|
593
|
+
if (toolName === "subagent") {
|
|
594
|
+
let action = input.action;
|
|
595
|
+
return getRequestedChildLaunches(input).some((child) => child.permissions === "full") || action === "resume" || action === "steer" || action === "append-step" || action === "schedule" || action === "schedule-cancel" ? {
|
|
596
|
+
block: !0,
|
|
597
|
+
reason: "Read-only mode cannot launch full-access children or change running children."
|
|
598
|
+
} : void 0;
|
|
599
|
+
}
|
|
600
|
+
return toolName.startsWith("computer_") || toolName === "bash" || toolName === "browser" || toolName === "code_rewrite" ? void 0 : { block: !0, reason: `Read-only mode cannot verify that ${toolName} is safe.` };
|
|
601
|
+
}
|
|
602
|
+
if (toolName === "subagent") {
|
|
603
|
+
let launchResult = await gateLargeSubagentLaunch(input, ctx, options);
|
|
604
|
+
if (launchResult)
|
|
605
|
+
return launchResult;
|
|
606
|
+
}
|
|
636
607
|
}
|
|
637
608
|
}
|
|
638
609
|
|
|
639
610
|
export {
|
|
640
|
-
|
|
611
|
+
READ_ONLY_MODE_ADDENDUM,
|
|
612
|
+
PERMISSION_MODES,
|
|
641
613
|
nextPermissionMode,
|
|
642
|
-
|
|
614
|
+
isReadOnlyModeActive,
|
|
643
615
|
restorePermissionModeAfterPlan,
|
|
644
616
|
NO_HANDLER_REASON,
|
|
645
617
|
createPermissionContext,
|