@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,537 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
FORWARDED_COMMANDS,
|
|
4
|
+
MOBILE_COMMANDS,
|
|
5
|
+
resolveWithinRoots
|
|
6
|
+
} from "./chunk-7JIYPIQU.js";
|
|
7
|
+
import {
|
|
8
|
+
conversationBinding,
|
|
9
|
+
createPicker,
|
|
10
|
+
isGatewayOwner
|
|
11
|
+
} from "./chunk-NKH2QBKF.js";
|
|
12
|
+
import {
|
|
13
|
+
computeContextBreakdown
|
|
14
|
+
} from "./chunk-V3HK3FE7.js";
|
|
15
|
+
import {
|
|
16
|
+
findExactModelReferenceMatch
|
|
17
|
+
} from "./chunk-MNRO3UCV.js";
|
|
18
|
+
import {
|
|
19
|
+
SessionManager
|
|
20
|
+
} from "./chunk-VIVYOI7C.js";
|
|
21
|
+
import {
|
|
22
|
+
runtimeScope
|
|
23
|
+
} from "./chunk-IMLCWLPI.js";
|
|
24
|
+
import {
|
|
25
|
+
defaultGatewayConfig
|
|
26
|
+
} from "./chunk-O2AT4MEU.js";
|
|
27
|
+
|
|
28
|
+
// packages/coding-agent/dist/gateway/commands.js
|
|
29
|
+
var MODEL_CACHE_TTL_MS = 300 * 1e3, SESSIONS_CACHE_TTL_MS = 300 * 1e3, MAX_MODEL_LIST_LINES = 15, PROVIDER_PER_PAGE = 10;
|
|
30
|
+
var MAX_MODELS_PER_PROVIDER = 50, MODEL_ID_MAX = 38, MODEL_CACHE_CAP = 100, SESSIONS_CACHE_CAP = 100, modelCache = /* @__PURE__ */ new Map(), sessionsCache = /* @__PURE__ */ new Map();
|
|
31
|
+
function evictLRU(map, cap) {
|
|
32
|
+
for (; map.size > cap; ) {
|
|
33
|
+
let first = map.keys().next().value;
|
|
34
|
+
first !== void 0 && map.delete(first);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function getCachedModels(key) {
|
|
38
|
+
let cached = modelCache.get(key);
|
|
39
|
+
if (cached) {
|
|
40
|
+
if (Date.now() > cached.expires) {
|
|
41
|
+
modelCache.delete(key);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
return modelCache.delete(key), modelCache.set(key, cached), cached.models;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function setCachedModels(key, models) {
|
|
48
|
+
modelCache.set(key, { models, expires: Date.now() + MODEL_CACHE_TTL_MS }), evictLRU(modelCache, MODEL_CACHE_CAP);
|
|
49
|
+
}
|
|
50
|
+
function getCachedSessions(key) {
|
|
51
|
+
let cached = sessionsCache.get(key);
|
|
52
|
+
if (cached) {
|
|
53
|
+
if (Date.now() > cached.expires) {
|
|
54
|
+
sessionsCache.delete(key);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
return sessionsCache.delete(key), sessionsCache.set(key, cached), cached.sessions;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function setCachedSessions(key, sessions) {
|
|
61
|
+
sessionsCache.set(key, { sessions, expires: Date.now() + SESSIONS_CACHE_TTL_MS }), evictLRU(sessionsCache, SESSIONS_CACHE_CAP);
|
|
62
|
+
}
|
|
63
|
+
function oneLine(text) {
|
|
64
|
+
return text.replace(/\s+/g, " ").trim().slice(0, 200);
|
|
65
|
+
}
|
|
66
|
+
function prefixLines(text, prefix) {
|
|
67
|
+
return text.split(`
|
|
68
|
+
`).map((line, index) => (index === 0 ? prefix : " ") + line).join(`
|
|
69
|
+
`);
|
|
70
|
+
}
|
|
71
|
+
function truncate(text, max) {
|
|
72
|
+
return text.length <= max ? text : `${text.slice(0, max - 1)}\u2026`;
|
|
73
|
+
}
|
|
74
|
+
function formatRelativeTime(date) {
|
|
75
|
+
let seconds = Math.max(0, Math.floor((Date.now() - date.getTime()) / 1e3));
|
|
76
|
+
if (seconds < 60)
|
|
77
|
+
return `${seconds}s ago`;
|
|
78
|
+
let minutes = Math.floor(seconds / 60);
|
|
79
|
+
if (minutes < 60)
|
|
80
|
+
return `${minutes}m ago`;
|
|
81
|
+
let hours = Math.floor(minutes / 60);
|
|
82
|
+
return hours < 24 ? `${hours}h ago` : `${Math.floor(hours / 24)}d ago`;
|
|
83
|
+
}
|
|
84
|
+
function formatModelList(models, maxLines = MAX_MODEL_LIST_LINES) {
|
|
85
|
+
if (models.length === 0)
|
|
86
|
+
return ["No models available."];
|
|
87
|
+
let byProvider = /* @__PURE__ */ new Map();
|
|
88
|
+
for (let model of models) {
|
|
89
|
+
let list = byProvider.get(model.provider) ?? [];
|
|
90
|
+
list.push(model), byProvider.set(model.provider, list);
|
|
91
|
+
}
|
|
92
|
+
let providers = [...byProvider.keys()].sort(), lines = [], index = 1;
|
|
93
|
+
for (let provider of providers) {
|
|
94
|
+
let list = (byProvider.get(provider) ?? []).sort((a, b) => a.id.localeCompare(b.id));
|
|
95
|
+
for (let model of list)
|
|
96
|
+
lines.push(`${index}) ${provider}/${model.id}`), index++;
|
|
97
|
+
}
|
|
98
|
+
return lines.length <= maxLines ? lines : [
|
|
99
|
+
`${models.length} models across ${providers.length} providers.`,
|
|
100
|
+
"Use /model <provider/id> or /model <query>.",
|
|
101
|
+
...providers.map((p) => `- ${p}`)
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
function groupModelsByProvider(models) {
|
|
105
|
+
let byProvider = /* @__PURE__ */ new Map();
|
|
106
|
+
for (let model of models) {
|
|
107
|
+
let list = byProvider.get(model.provider) ?? [];
|
|
108
|
+
list.push(model), byProvider.set(model.provider, list);
|
|
109
|
+
}
|
|
110
|
+
for (let list of byProvider.values())
|
|
111
|
+
list.sort((a, b) => a.id.localeCompare(b.id));
|
|
112
|
+
return byProvider;
|
|
113
|
+
}
|
|
114
|
+
function truncateModelId(id) {
|
|
115
|
+
let lastSlash = id.lastIndexOf("/"), name = lastSlash >= 0 ? id.slice(lastSlash + 1) : id;
|
|
116
|
+
return truncate(name, MODEL_ID_MAX);
|
|
117
|
+
}
|
|
118
|
+
async function refreshAndCacheModels(session, key) {
|
|
119
|
+
let runtime = session.modelRuntime;
|
|
120
|
+
await runtime.refresh();
|
|
121
|
+
let models = [...await runtime.getAvailable()].sort((a, b) => a.provider.localeCompare(b.provider) || a.id.localeCompare(b.id));
|
|
122
|
+
return setCachedModels(key, models), models;
|
|
123
|
+
}
|
|
124
|
+
async function setModelAndReply(ctx, model) {
|
|
125
|
+
let session = ctx.session;
|
|
126
|
+
try {
|
|
127
|
+
await session.setModel(model);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
if ((error instanceof Error ? error.message : String(error)).includes("No API key")) {
|
|
130
|
+
await ctx.reply(`No API key for ${model.provider}.`);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
await ctx.reply(`Model \u2192 ${model.provider}/${model.id} (thinking level re-clamped to ${session.thinkingLevel})`);
|
|
136
|
+
}
|
|
137
|
+
var newCommand = {
|
|
138
|
+
name: "new",
|
|
139
|
+
aliases: ["reset"],
|
|
140
|
+
description: "start a fresh session for this chat",
|
|
141
|
+
// lunr: busy-session /new must bypass the guard (same as /stop).
|
|
142
|
+
bypassBusy: !0,
|
|
143
|
+
needsSession: !1,
|
|
144
|
+
async handler(ctx) {
|
|
145
|
+
await ctx.bridge.reset(ctx.key);
|
|
146
|
+
let cfg = ctx.cfg ?? defaultGatewayConfig(), owner = isGatewayOwner(ctx.event.source, cfg), ready = !!conversationBinding(ctx.key)?.cwd;
|
|
147
|
+
if (!ready && owner && cfg.defaultProject)
|
|
148
|
+
try {
|
|
149
|
+
resolveWithinRoots(cfg.defaultProject, cfg.projectRoots ?? []), ready = !0;
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
await ctx.reply(ready ? "Session reset. Send a message to start fresh in the approved project." : owner ? "Session reset. Use /project to choose an approved project before sending a message." : "Session reset. Ask the computer's gateway owner to configure this chat's project access locally.");
|
|
153
|
+
}
|
|
154
|
+
}, undoCommand = {
|
|
155
|
+
name: "undo",
|
|
156
|
+
description: "rewind the session tree before the last user turn",
|
|
157
|
+
bypassBusy: !1,
|
|
158
|
+
needsSession: !0,
|
|
159
|
+
async handler(ctx) {
|
|
160
|
+
let { userText } = await ctx.bridge.undo(ctx.key), text = userText ? ` "${truncate(userText, 60)}"` : "";
|
|
161
|
+
await ctx.reply(`Undone \u2014 rewound before${text}. /redo to restore.`);
|
|
162
|
+
}
|
|
163
|
+
}, redoCommand = {
|
|
164
|
+
name: "redo",
|
|
165
|
+
description: "restore the last undone turn",
|
|
166
|
+
bypassBusy: !1,
|
|
167
|
+
needsSession: !0,
|
|
168
|
+
async handler(ctx) {
|
|
169
|
+
await ctx.bridge.redo(ctx.key), await ctx.reply("Redone.");
|
|
170
|
+
}
|
|
171
|
+
}, stopCommand = {
|
|
172
|
+
name: "stop",
|
|
173
|
+
description: "abort the running turn",
|
|
174
|
+
bypassBusy: !0,
|
|
175
|
+
needsSession: !1,
|
|
176
|
+
async handler(ctx) {
|
|
177
|
+
await ctx.bridge.abort(ctx.key), await ctx.reply("Stopped.");
|
|
178
|
+
}
|
|
179
|
+
}, statusCommand = {
|
|
180
|
+
name: "status",
|
|
181
|
+
description: "session status",
|
|
182
|
+
bypassBusy: !0,
|
|
183
|
+
needsSession: !1,
|
|
184
|
+
async handler(ctx) {
|
|
185
|
+
let status = ctx.bridge.getStatus(ctx.key), age = status.createdAt ? `${Math.max(0, Math.round((Date.now() - Date.parse(status.createdAt)) / 1e3))}s` : "no session yet";
|
|
186
|
+
await ctx.reply(`${ctx.event.source.platform} \xB7 session age ${age} \xB7 ${status.busy ? "busy" : "idle"} \xB7 queue ${status.queueDepth}
|
|
187
|
+
Project: ${conversationBinding(ctx.key)?.cwd ?? "not selected"}`);
|
|
188
|
+
}
|
|
189
|
+
}, whoamiCommand = {
|
|
190
|
+
name: "whoami",
|
|
191
|
+
description: "your ids and session key",
|
|
192
|
+
bypassBusy: !0,
|
|
193
|
+
needsSession: !1,
|
|
194
|
+
async handler(ctx) {
|
|
195
|
+
let { userId, chatId } = ctx.event.source;
|
|
196
|
+
await ctx.reply(`userId: ${userId}
|
|
197
|
+
chatId: ${chatId}
|
|
198
|
+
key: ${ctx.key}`);
|
|
199
|
+
}
|
|
200
|
+
}, helpCommand = {
|
|
201
|
+
name: "help",
|
|
202
|
+
description: "this message",
|
|
203
|
+
bypassBusy: !0,
|
|
204
|
+
needsSession: !1,
|
|
205
|
+
async handler(ctx) {
|
|
206
|
+
await ctx.reply(formatHelpText());
|
|
207
|
+
}
|
|
208
|
+
}, modelCommand = {
|
|
209
|
+
name: "model",
|
|
210
|
+
description: "list or switch models",
|
|
211
|
+
bypassBusy: !1,
|
|
212
|
+
needsSession: !0,
|
|
213
|
+
async handler(ctx) {
|
|
214
|
+
let session = ctx.session, arg = ctx.args.trim();
|
|
215
|
+
if (!arg) {
|
|
216
|
+
let models2 = getCachedModels(ctx.key) ?? await refreshAndCacheModels(session, ctx.key), byProvider = groupModelsByProvider(models2), current = session.model, currentRef = current ? `${current.provider}/${current.id}` : "", providerItems = [...byProvider.keys()].sort().map((provider) => ({
|
|
217
|
+
label: `${current?.provider === provider ? "\u2713 " : ""}${provider} (${byProvider.get(provider)?.length ?? 0})`,
|
|
218
|
+
value: provider
|
|
219
|
+
})), pickerOpts = {
|
|
220
|
+
replyTo: ctx.event.messageId,
|
|
221
|
+
threadId: ctx.event.source.threadId
|
|
222
|
+
};
|
|
223
|
+
if (!(await createPicker(ctx.adapter, ctx.event.source, {
|
|
224
|
+
kind: "model",
|
|
225
|
+
sessionKey: ctx.key,
|
|
226
|
+
invokerId: ctx.event.source.userId,
|
|
227
|
+
items: providerItems,
|
|
228
|
+
perPage: PROVIDER_PER_PAGE,
|
|
229
|
+
title: "Pick a model provider",
|
|
230
|
+
async resolve(item) {
|
|
231
|
+
if (item.value === "__back__")
|
|
232
|
+
return { done: !1, items: providerItems, title: "Pick a model provider" };
|
|
233
|
+
if (!item.value.includes("/")) {
|
|
234
|
+
let provider = item.value, list = byProvider.get(provider) ?? [], capped = list.slice(0, MAX_MODELS_PER_PROVIDER), note = list.length > MAX_MODELS_PER_PROVIDER ? ` \u2014 ${list.length - MAX_MODELS_PER_PROVIDER} more available` : "", modelItems = [];
|
|
235
|
+
for (let m of capped) {
|
|
236
|
+
let ref = `${provider}/${m.id}`;
|
|
237
|
+
modelItems.push({
|
|
238
|
+
label: `${currentRef === ref ? "\u2713 " : ""}${truncateModelId(m.id)}`,
|
|
239
|
+
value: ref
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return modelItems.unshift({ label: "\u25C0 Back", value: "__back__" }), {
|
|
243
|
+
done: !1,
|
|
244
|
+
items: modelItems,
|
|
245
|
+
title: `${provider} (${list.length})${note}`,
|
|
246
|
+
breadcrumbs: provider
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
let exact2 = findExactModelReferenceMatch(item.value, models2);
|
|
250
|
+
if (!exact2)
|
|
251
|
+
return { done: !0, text: "That model is no longer available." };
|
|
252
|
+
try {
|
|
253
|
+
await session.setModel(exact2);
|
|
254
|
+
} catch (error) {
|
|
255
|
+
if ((error instanceof Error ? error.message : String(error)).includes("No API key"))
|
|
256
|
+
return { done: !0, text: `No API key for ${exact2.provider}.` };
|
|
257
|
+
throw error;
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
done: !0,
|
|
261
|
+
text: `Model \u2192 ${exact2.provider}/${exact2.id} (thinking level re-clamped to ${session.thinkingLevel})`
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}, pickerOpts)).success) {
|
|
265
|
+
let currentText = `${current?.provider ?? "none"}/${current?.id ?? "none"}`, lines = formatModelList(models2);
|
|
266
|
+
await ctx.reply([`Current: ${currentText}`, ...lines, "Use /model <n> or /model <provider/id>"].join(`
|
|
267
|
+
`));
|
|
268
|
+
}
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
let numeric = Number.parseInt(arg, 10);
|
|
272
|
+
if (!Number.isNaN(numeric) && /^\d+$/.test(arg)) {
|
|
273
|
+
let cached = getCachedModels(ctx.key);
|
|
274
|
+
if (!cached || numeric < 1 || numeric > cached.length) {
|
|
275
|
+
await ctx.reply("Invalid selection \u2014 run /model to see the current list.");
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
await setModelAndReply(ctx, cached[numeric - 1]);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
let models = getCachedModels(ctx.key) ?? await refreshAndCacheModels(session, ctx.key), exact = findExactModelReferenceMatch(arg, models);
|
|
282
|
+
if (exact) {
|
|
283
|
+
await setModelAndReply(ctx, exact);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
let query = arg.toLowerCase(), matches = models.filter((m) => m.id.toLowerCase().includes(query) || `${m.provider}/${m.id}`.toLowerCase().includes(query) || (m.name?.toLowerCase().includes(query) ?? !1));
|
|
287
|
+
if (matches.length === 0) {
|
|
288
|
+
await ctx.reply(`No model matches "${arg}".`);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (matches.length > 1) {
|
|
292
|
+
await ctx.reply(formatModelList(matches).join(`
|
|
293
|
+
`));
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
await setModelAndReply(ctx, matches[0]);
|
|
297
|
+
}
|
|
298
|
+
}, sessionsCommand = {
|
|
299
|
+
name: "sessions",
|
|
300
|
+
description: "list or switch sessions",
|
|
301
|
+
bypassBusy: !1,
|
|
302
|
+
needsSession: !0,
|
|
303
|
+
async handler(ctx) {
|
|
304
|
+
let session = ctx.session, arg = ctx.args.trim(), currentFile = session.sessionManager?.getSessionFile(), cwd = session.sessionManager?.getCwd() ?? conversationBinding(ctx.key)?.cwd;
|
|
305
|
+
if (!cwd)
|
|
306
|
+
throw new Error("Select a project before listing sessions.");
|
|
307
|
+
if (!arg) {
|
|
308
|
+
let all = await SessionManager.list(cwd);
|
|
309
|
+
all.sort((a, b) => b.modified.getTime() - a.modified.getTime());
|
|
310
|
+
let sessions = all.slice(0, 10);
|
|
311
|
+
setCachedSessions(ctx.key, sessions);
|
|
312
|
+
let items = sessions.map((s) => ({
|
|
313
|
+
label: `${s.path === currentFile ? "(current) " : ""}${s.name ? truncate(s.name, 30) : truncate(s.firstMessage, 30) || "(empty)"}`,
|
|
314
|
+
value: s.path
|
|
315
|
+
}));
|
|
316
|
+
if (!(await createPicker(ctx.adapter, ctx.event.source, {
|
|
317
|
+
kind: "sessions",
|
|
318
|
+
sessionKey: ctx.key,
|
|
319
|
+
invokerId: ctx.event.source.userId,
|
|
320
|
+
items,
|
|
321
|
+
perPage: 8,
|
|
322
|
+
title: "Pick a session",
|
|
323
|
+
async resolve(item) {
|
|
324
|
+
await ctx.bridge.switchSession(ctx.key, item.value);
|
|
325
|
+
let switched2 = await ctx.bridge.getSession(ctx.key), name2 = switched2?.sessionManager?.getSessionName() ?? "unnamed", count2 = switched2?.sessionManager?.getEntries().length ?? 0;
|
|
326
|
+
return { done: !0, text: `Switched to "${name2}" (${count2} msgs). History continues here.` };
|
|
327
|
+
}
|
|
328
|
+
}, { replyTo: ctx.event.messageId, threadId: ctx.event.source.threadId })).success) {
|
|
329
|
+
let lines = sessions.map((s, i) => {
|
|
330
|
+
let marker = s.path === currentFile ? " (current)" : "", label = s.name ? truncate(s.name, 40) : truncate(s.firstMessage, 40) || "(empty)";
|
|
331
|
+
return `${i + 1}) ${label}${marker} \xB7 ${formatRelativeTime(s.modified)} \xB7 ${s.messageCount} msgs`;
|
|
332
|
+
});
|
|
333
|
+
await ctx.reply([`Sessions for ${cwd}`, ...lines, "Use /sessions <n> or /sessions <id-prefix>"].join(`
|
|
334
|
+
`));
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
let path, numeric = Number.parseInt(arg, 10), cached = getCachedSessions(ctx.key);
|
|
339
|
+
if (!Number.isNaN(numeric) && /^\d+$/.test(arg)) {
|
|
340
|
+
if (!cached || numeric < 1 || numeric > cached.length) {
|
|
341
|
+
await ctx.reply("Invalid selection \u2014 run /sessions to see the current list.");
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
path = cached[numeric - 1].path;
|
|
345
|
+
} else {
|
|
346
|
+
let matches = (cached ?? await SessionManager.list(cwd)).filter((s) => s.id.startsWith(arg) || s.path.startsWith(arg));
|
|
347
|
+
if (matches.length === 0) {
|
|
348
|
+
await ctx.reply(`No session matches "${arg}".`);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
if (matches.length > 1) {
|
|
352
|
+
await ctx.reply(`Multiple sessions match "${arg}" \u2014 use a longer prefix.`);
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
path = matches[0].path;
|
|
356
|
+
}
|
|
357
|
+
if (!path) {
|
|
358
|
+
await ctx.reply("No session selected.");
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
await ctx.bridge.switchSession(ctx.key, path);
|
|
362
|
+
let switched = await ctx.bridge.getSession(ctx.key), name = switched?.sessionManager?.getSessionName() ?? "unnamed", count = switched?.sessionManager?.getEntries().length ?? 0;
|
|
363
|
+
await ctx.reply(`Switched to "${name}" (${count} msgs). History continues here.`);
|
|
364
|
+
}
|
|
365
|
+
}, titleCommand = {
|
|
366
|
+
name: "title",
|
|
367
|
+
aliases: ["name"],
|
|
368
|
+
description: "name the current session",
|
|
369
|
+
bypassBusy: !0,
|
|
370
|
+
needsSession: !0,
|
|
371
|
+
async handler(ctx) {
|
|
372
|
+
let session = ctx.session, name = ctx.args.trim();
|
|
373
|
+
if (!name) {
|
|
374
|
+
let current = session.sessionManager?.getSessionName();
|
|
375
|
+
await ctx.reply(current ? `Session title: ${current}` : "(unnamed)");
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
session.setSessionName(name);
|
|
379
|
+
let readBack = session.sessionManager?.getSessionName() ?? name;
|
|
380
|
+
await ctx.reply(`Session titled "${readBack}".`);
|
|
381
|
+
}
|
|
382
|
+
}, contextCommand = {
|
|
383
|
+
name: "context",
|
|
384
|
+
description: "estimated context window breakdown",
|
|
385
|
+
bypassBusy: !0,
|
|
386
|
+
needsSession: !0,
|
|
387
|
+
async handler(ctx) {
|
|
388
|
+
let session = ctx.session, model = session.model;
|
|
389
|
+
if (!model) {
|
|
390
|
+
await ctx.reply("No model selected.");
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
let contextWindow = model.contextWindow ?? 0;
|
|
394
|
+
if (contextWindow <= 0) {
|
|
395
|
+
await ctx.reply("Context window unknown for this model.");
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
let tools = session.getActiveToolNames().map((name) => session.getToolDefinition(name)).filter((d) => d !== void 0), breakdown = computeContextBreakdown({
|
|
399
|
+
systemPrompt: session.systemPrompt,
|
|
400
|
+
tools,
|
|
401
|
+
messages: session.messages,
|
|
402
|
+
contextWindow
|
|
403
|
+
}), usage = session.getContextUsage(), tokens = usage?.tokens ?? breakdown.total, percent = usage?.percent ?? (contextWindow > 0 ? tokens / contextWindow * 100 : 0), messageTokens = breakdown.user + breakdown.assistantText + breakdown.thinking + breakdown.toolCalls + breakdown.toolResults + breakdown.summaries, stats = session.getSessionStats();
|
|
404
|
+
await ctx.reply([
|
|
405
|
+
`Context: ${tokens.toLocaleString("en-US")} / ${contextWindow.toLocaleString("en-US")} tokens (${Math.round(percent)}%)`,
|
|
406
|
+
` system ${breakdown.systemPrompt.toLocaleString("en-US")} \xB7 tools ${breakdown.toolDefinitions.toLocaleString("en-US")} \xB7 messages ${messageTokens.toLocaleString("en-US")}`,
|
|
407
|
+
`Session: ${stats.totalMessages} messages \xB7 ${stats.userMessages} turns \xB7 model ${model.provider}/${model.id}`
|
|
408
|
+
].join(`
|
|
409
|
+
`));
|
|
410
|
+
}
|
|
411
|
+
}, compactCommand = {
|
|
412
|
+
name: "compact",
|
|
413
|
+
description: "summarize and compress session context",
|
|
414
|
+
bypassBusy: !0,
|
|
415
|
+
needsSession: !0,
|
|
416
|
+
async handler(ctx) {
|
|
417
|
+
let session = ctx.session, instructions = ctx.args.trim() || void 0;
|
|
418
|
+
try {
|
|
419
|
+
let result = await session.compact(instructions), before = result.tokensBefore.toLocaleString("en-US"), after = result.estimatedTokensAfter !== void 0 ? `~${result.estimatedTokensAfter.toLocaleString("en-US")}` : "~?";
|
|
420
|
+
await ctx.reply(`Compacted: ${before} \u2192 ${after} tokens.`);
|
|
421
|
+
} catch (error) {
|
|
422
|
+
let message = error instanceof Error ? error.message : String(error);
|
|
423
|
+
if (message.includes("Nothing to compact") || message.includes("Already compacted") || message.includes("No model selected")) {
|
|
424
|
+
await ctx.reply(message);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
throw error;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}, thinkingCommand = {
|
|
431
|
+
name: "thinking",
|
|
432
|
+
aliases: ["effort", "reasoning"],
|
|
433
|
+
description: "get or set the thinking level",
|
|
434
|
+
bypassBusy: !1,
|
|
435
|
+
needsSession: !0,
|
|
436
|
+
async handler(ctx) {
|
|
437
|
+
let session = ctx.session, levels = session.getAvailableThinkingLevels();
|
|
438
|
+
if (!session.supportsThinking()) {
|
|
439
|
+
await ctx.reply(`Model ${session.model?.provider ?? "none"}/${session.model?.id ?? "none"} doesn't support thinking.`);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
let arg = ctx.args.trim().toLowerCase();
|
|
443
|
+
if (!arg) {
|
|
444
|
+
let current = session.thinkingLevel, items = levels.map((level) => ({
|
|
445
|
+
label: `${level === current ? "\u2713 " : ""}${level}`,
|
|
446
|
+
value: level
|
|
447
|
+
}));
|
|
448
|
+
(await createPicker(ctx.adapter, ctx.event.source, {
|
|
449
|
+
kind: "thinking",
|
|
450
|
+
sessionKey: ctx.key,
|
|
451
|
+
invokerId: ctx.event.source.userId,
|
|
452
|
+
items,
|
|
453
|
+
perPage: levels.length,
|
|
454
|
+
title: "Pick a thinking level",
|
|
455
|
+
async resolve(item) {
|
|
456
|
+
let level = item.value;
|
|
457
|
+
return session.setThinkingLevel(level), { done: !0, text: `Thinking \u2192 ${level}` };
|
|
458
|
+
}
|
|
459
|
+
}, { replyTo: ctx.event.messageId, threadId: ctx.event.source.threadId })).success || await ctx.reply(`Level: ${current} \u2014 available: ${levels.join(", ")}`);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (!levels.includes(arg)) {
|
|
463
|
+
await ctx.reply(`Invalid level. Available: ${levels.join(", ")}`);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
session.setThinkingLevel(arg), await ctx.reply(`Thinking \u2192 ${arg}`);
|
|
467
|
+
}
|
|
468
|
+
}, CHAT_COMMANDS = [
|
|
469
|
+
newCommand,
|
|
470
|
+
undoCommand,
|
|
471
|
+
redoCommand,
|
|
472
|
+
stopCommand,
|
|
473
|
+
statusCommand,
|
|
474
|
+
whoamiCommand,
|
|
475
|
+
helpCommand,
|
|
476
|
+
modelCommand,
|
|
477
|
+
sessionsCommand,
|
|
478
|
+
titleCommand,
|
|
479
|
+
contextCommand,
|
|
480
|
+
compactCommand,
|
|
481
|
+
thinkingCommand
|
|
482
|
+
];
|
|
483
|
+
function botCommandSpecs() {
|
|
484
|
+
return [
|
|
485
|
+
...new Map([
|
|
486
|
+
{ name: "start", description: "Check gateway readiness" },
|
|
487
|
+
...CHAT_COMMANDS,
|
|
488
|
+
...MOBILE_COMMANDS,
|
|
489
|
+
...FORWARDED_COMMANDS
|
|
490
|
+
].map((c) => [c.name, { name: c.name, description: c.description }])).values()
|
|
491
|
+
];
|
|
492
|
+
}
|
|
493
|
+
function formatHelpText() {
|
|
494
|
+
let lines = ["lunR gateway commands:", "/start \u2014 check gateway readiness"];
|
|
495
|
+
for (let cmd of CHAT_COMMANDS) {
|
|
496
|
+
let names = [cmd.name, ...cmd.aliases ?? []].map((a) => `/${a}`).join(" | ");
|
|
497
|
+
lines.push(`${names} \u2014 ${cmd.description}`);
|
|
498
|
+
}
|
|
499
|
+
for (let cmd of botCommandSpecs())
|
|
500
|
+
CHAT_COMMANDS.some((c) => c.name === cmd.name) || lines.push(`/${cmd.name} \xB7 ${cmd.description}`);
|
|
501
|
+
return lines.push(""), lines.push("Tap to pick: /model, /thinking, /sessions (run without args to see buttons)."), lines.join(`
|
|
502
|
+
`);
|
|
503
|
+
}
|
|
504
|
+
async function runChatCommand(cmd, ctx) {
|
|
505
|
+
if (!cmd.bypassBusy && ctx.bridge.getStatus(ctx.key).busy)
|
|
506
|
+
return await ctx.reply("\u23F3 busy \u2014 /stop first or wait"), !0;
|
|
507
|
+
if (cmd.needsSession) {
|
|
508
|
+
let session = await ctx.bridge.getSession(ctx.key, cmd.name === "model");
|
|
509
|
+
if (!session)
|
|
510
|
+
return await ctx.reply("No session yet. Select an approved project with /project first."), !0;
|
|
511
|
+
ctx.session = session;
|
|
512
|
+
}
|
|
513
|
+
try {
|
|
514
|
+
let settingsManager = ctx.session?.settingsManager;
|
|
515
|
+
return (settingsManager ? await runtimeScope.run({ settingsManager, modelRuntime: ctx.session?.modelRuntime, thinking: () => ctx.session.thinkingLevel }, () => cmd.handler(ctx)) : await cmd.handler(ctx)) ?? !0;
|
|
516
|
+
} catch (err) {
|
|
517
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
518
|
+
return await ctx.adapter.send(ctx.event.source.chatId, `\u26A0 ${oneLine(message)}`, {
|
|
519
|
+
replyTo: ctx.event.messageId,
|
|
520
|
+
threadId: ctx.event.source.threadId
|
|
521
|
+
}), !0;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
async function sendCommandReply(adapter, event, text) {
|
|
525
|
+
await adapter.send(event.source.chatId, prefixLines(text, ""), {
|
|
526
|
+
replyTo: event.messageId,
|
|
527
|
+
threadId: event.source.threadId
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export {
|
|
532
|
+
CHAT_COMMANDS,
|
|
533
|
+
botCommandSpecs,
|
|
534
|
+
formatHelpText,
|
|
535
|
+
runChatCommand,
|
|
536
|
+
sendCommandReply
|
|
537
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
runtimeScope
|
|
4
|
+
} from "./chunk-IMLCWLPI.js";
|
|
5
|
+
|
|
6
|
+
// packages/coding-agent/dist/core/customize.js
|
|
7
|
+
var CUSTOMIZE_BRIDGE_SYMBOL = /* @__PURE__ */ Symbol.for("@lunr/customize"), activeSettingsManager, bridge = {
|
|
8
|
+
getOpenAIFastMode() {
|
|
9
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getOpenAIFastMode() ?? !1;
|
|
10
|
+
},
|
|
11
|
+
getFooterMcp() {
|
|
12
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterMcp() ?? !0;
|
|
13
|
+
},
|
|
14
|
+
getFooterLsp() {
|
|
15
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterLsp() ?? !1;
|
|
16
|
+
},
|
|
17
|
+
getFooterContext() {
|
|
18
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterContext() ?? !0;
|
|
19
|
+
},
|
|
20
|
+
getFooterTokens() {
|
|
21
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterTokens() ?? !0;
|
|
22
|
+
},
|
|
23
|
+
getFooterCacheHitRate() {
|
|
24
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterCacheHitRate() ?? !0;
|
|
25
|
+
},
|
|
26
|
+
getFooterTps() {
|
|
27
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterTps() ?? !0;
|
|
28
|
+
},
|
|
29
|
+
getFooterStatuses() {
|
|
30
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterStatuses() ?? !0;
|
|
31
|
+
},
|
|
32
|
+
getFooterGit() {
|
|
33
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterGit() ?? !0;
|
|
34
|
+
},
|
|
35
|
+
getFooterPlan() {
|
|
36
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterPlan() ?? !0;
|
|
37
|
+
},
|
|
38
|
+
getFooterPlanBar() {
|
|
39
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getFooterPlanBar() ?? !0;
|
|
40
|
+
},
|
|
41
|
+
getSubagentSpinner() {
|
|
42
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getSubagentSpinner() ?? "braille";
|
|
43
|
+
},
|
|
44
|
+
getHideThinkingBlock() {
|
|
45
|
+
return (runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.getHideThinkingBlock() ?? !1;
|
|
46
|
+
},
|
|
47
|
+
setHideThinkingBlock(hide) {
|
|
48
|
+
(runtimeScope.getStore()?.settingsManager ?? activeSettingsManager)?.setHideThinkingBlock(hide);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
function registerCustomizeBridge(settingsManager) {
|
|
52
|
+
activeSettingsManager = settingsManager, globalThis[CUSTOMIZE_BRIDGE_SYMBOL] = bridge;
|
|
53
|
+
}
|
|
54
|
+
function getCustomizeBridge() {
|
|
55
|
+
return globalThis[CUSTOMIZE_BRIDGE_SYMBOL];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
CUSTOMIZE_BRIDGE_SYMBOL,
|
|
60
|
+
registerCustomizeBridge,
|
|
61
|
+
getCustomizeBridge
|
|
62
|
+
};
|
|
@@ -1,25 +1,4 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
abortable,
|
|
4
|
-
computeServerHash,
|
|
5
|
-
extractToolUiStreamMode,
|
|
6
|
-
getMetadataCachePath,
|
|
7
|
-
getMissingConfiguredDirectToolServers,
|
|
8
|
-
interpolateEnvRecord,
|
|
9
|
-
isServerCacheValid,
|
|
10
|
-
loadMcpConfig,
|
|
11
|
-
loadMetadataCache,
|
|
12
|
-
openUrl,
|
|
13
|
-
parallelLimit,
|
|
14
|
-
reconstructToolMetadata,
|
|
15
|
-
resolveBearerToken,
|
|
16
|
-
resolveConfigPath,
|
|
17
|
-
saveMetadataCache,
|
|
18
|
-
serializeResources,
|
|
19
|
-
serializeTools,
|
|
20
|
-
throwIfAborted,
|
|
21
|
-
truncateAtWord
|
|
22
|
-
} from "./chunk-VSELYKWU.js";
|
|
23
2
|
import {
|
|
24
3
|
AjvJsonSchemaValidator,
|
|
25
4
|
Client,
|
|
@@ -36,10 +15,7 @@ import {
|
|
|
36
15
|
extractWWWAuthenticateParams,
|
|
37
16
|
normalizeHeaders,
|
|
38
17
|
supportsOAuth
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import {
|
|
41
|
-
getAgentPath
|
|
42
|
-
} from "./chunk-4HXHDDCF.js";
|
|
18
|
+
} from "./chunk-7IQGBKBJ.js";
|
|
43
19
|
import {
|
|
44
20
|
CallToolResultSchema,
|
|
45
21
|
ContentBlockSchema,
|
|
@@ -57,14 +33,38 @@ import {
|
|
|
57
33
|
UrlElicitationRequiredError
|
|
58
34
|
} from "./chunk-2IDTZAG5.js";
|
|
59
35
|
import {
|
|
60
|
-
|
|
61
|
-
|
|
36
|
+
abortable,
|
|
37
|
+
computeServerHash,
|
|
38
|
+
extractToolUiStreamMode,
|
|
39
|
+
getMetadataCachePath,
|
|
40
|
+
getMissingConfiguredDirectToolServers,
|
|
41
|
+
interpolateEnvRecord,
|
|
42
|
+
isServerCacheValid,
|
|
43
|
+
loadMcpConfig,
|
|
44
|
+
loadMetadataCache,
|
|
45
|
+
openUrl,
|
|
46
|
+
parallelLimit,
|
|
47
|
+
reconstructToolMetadata,
|
|
48
|
+
resolveBearerToken,
|
|
49
|
+
resolveConfigPath,
|
|
50
|
+
saveMetadataCache,
|
|
51
|
+
serializeResources,
|
|
52
|
+
serializeTools,
|
|
53
|
+
throwIfAborted,
|
|
54
|
+
truncateAtWord
|
|
55
|
+
} from "./chunk-LWYIVUGV.js";
|
|
56
|
+
import {
|
|
57
|
+
getAgentPath
|
|
58
|
+
} from "./chunk-4HXHDDCF.js";
|
|
62
59
|
import {
|
|
63
60
|
formatToolName,
|
|
64
61
|
isToolExcluded,
|
|
65
62
|
resourceNameToToolName,
|
|
66
63
|
serverStreamResultPatchNotificationSchema
|
|
67
64
|
} from "./chunk-ARC4KOTI.js";
|
|
65
|
+
import {
|
|
66
|
+
external_exports
|
|
67
|
+
} from "./chunk-BI3DHYCN.js";
|
|
68
68
|
import {
|
|
69
69
|
__require
|
|
70
70
|
} from "./chunk-BRJX2PRC.js";
|