@ashx-j/lunr-dev 0.2.19-dev.10.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 +60 -2
- package/README.md +2 -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 -2
- 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 +15 -14
- 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 +6 -5
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +24 -7
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +6 -4
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +114 -61
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +365 -351
- 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/fanout-child.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +9 -7
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +143 -59
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +18 -8
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +39 -14
- 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 +5 -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 +32 -17
- 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 +12 -2
- 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 +401 -58
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts +29 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +184 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +91 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +542 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +13 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +42 -12
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +35 -8
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.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/notify.d.ts +7 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +26 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +55 -38
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +100 -0
- 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 +47 -32
- 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 +6 -6
- 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 +75 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +15 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +14 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.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 +43 -4
- 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 +26 -9
- 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 +4 -3
- 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 +0 -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 +94 -25
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +75 -18
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.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/completion-guard.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +13 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +67 -11
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +5 -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 +25 -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 +17 -5
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +5 -10
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +3 -0
- 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 +70 -13
- package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +12 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +21 -2
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +23 -4
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +11 -7
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +6 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +46 -29
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.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-subagents/src/tui/render.d.ts +46 -4
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +407 -450
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +2 -13
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +5 -91
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
- 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 +27 -0
- package/dist/core/computer-use/image.d.ts.map +1 -0
- package/dist/core/computer-use/image.js +72 -0
- package/dist/core/computer-use/image.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -1
- package/dist/core/computer-use/policy.js +2 -6
- package/dist/core/computer-use/policy.js.map +1 -1
- package/dist/core/computer-use/schemas.d.ts +14 -10
- package/dist/core/computer-use/schemas.d.ts.map +1 -1
- package/dist/core/computer-use/schemas.js +27 -35
- package/dist/core/computer-use/schemas.js.map +1 -1
- package/dist/core/computer-use/workflow.d.ts +16 -8
- package/dist/core/computer-use/workflow.d.ts.map +1 -1
- package/dist/core/computer-use/workflow.js +337 -260
- package/dist/core/computer-use/workflow.js.map +1 -1
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +17 -13
- 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 +17 -23
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +79 -146
- 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 -24
- 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 -2
- 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 +24 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +78 -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-cancellation.d.ts +21 -0
- package/dist/core/subagent-cancellation.d.ts.map +1 -0
- package/dist/core/subagent-cancellation.js +53 -0
- package/dist/core/subagent-cancellation.js.map +1 -0
- 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-spinner-setting.d.ts +6 -0
- package/dist/core/subagent-spinner-setting.d.ts.map +1 -0
- package/dist/core/subagent-spinner-setting.js +12 -0
- package/dist/core/subagent-spinner-setting.js.map +1 -0
- package/dist/core/subagent-spinner.d.ts +4 -0
- package/dist/core/subagent-spinner.d.ts.map +1 -0
- package/dist/core/subagent-spinner.js +6 -0
- package/dist/core/subagent-spinner.js.map +1 -0
- 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 +90 -35
- 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 +16 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +147 -4
- 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 +55 -44
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/extension-widget-order.d.ts +8 -0
- package/dist/modes/interactive/extension-widget-order.d.ts.map +1 -0
- package/dist/modes/interactive/extension-widget-order.js +37 -0
- package/dist/modes/interactive/extension-widget-order.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +11 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +386 -155
- 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-7STLFW3A.js → builtin-extensions-4GNDR6U3.js} +8 -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-OTT6JMPU.js → chunk-2MI5OPMN.js} +17 -370
- package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
- package/dist/node-runtime/{chunk-K72NVGUB.js → chunk-33SIKK3Y.js} +38 -164
- package/dist/node-runtime/{chunk-GZQHMEWL.js → chunk-3DKIWPKN.js} +19 -4
- package/dist/node-runtime/{chunk-5OLJGVCB.js → chunk-3ONQTOMR.js} +2 -2
- 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-BKAZ6BKX.js → chunk-4SBQAI4T.js} +31 -31
- package/dist/node-runtime/{chunk-W7S2REEG.js → chunk-53ARRUHA.js} +785 -285
- package/dist/node-runtime/{chunk-ZSEZY3II.js → chunk-5Q4A37RB.js} +10 -4
- package/dist/node-runtime/{chunk-SWSN6HAB.js → chunk-5UZOPGE3.js} +1 -1
- package/dist/node-runtime/{chunk-LCACDWHJ.js → chunk-5Z5PCXGY.js} +263 -222
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/chunk-7JIYPIQU.js +356 -0
- package/dist/node-runtime/{chunk-ZRDIMBEQ.js → chunk-AJ6R5VTV.js} +66 -91
- package/dist/node-runtime/chunk-ATIF3RX5.js +352 -0
- package/dist/node-runtime/chunk-BBUVIEZB.js +51 -0
- 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-MUMMMTW4.js → chunk-DRJI7ZSC.js} +572 -401
- package/dist/node-runtime/{chunk-6SPPH4FY.js → chunk-E75WFZ33.js} +4 -4
- package/dist/node-runtime/{chunk-MJQDX3BA.js → chunk-EBB4BJW4.js} +3 -3
- package/dist/node-runtime/{chunk-5NWQCSKR.js → chunk-EOEAQIJV.js} +70 -3
- 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-FLYMHKCS.js → chunk-JJWZB7S3.js} +60 -48
- 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-EHMBW7FA.js → chunk-LWYIVUGV.js} +5 -4
- package/dist/node-runtime/{chunk-T5GM5BFH.js → chunk-MFV2LOOX.js} +186 -2194
- 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-4SJWFTUP.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-QFADHUQV.js +74 -0
- package/dist/node-runtime/chunk-RBZQU6TJ.js +27 -0
- package/dist/node-runtime/{chunk-MGSB2C3M.js → chunk-RVOQBXTA.js} +10 -6
- package/dist/node-runtime/{chunk-ISQDQIZN.js → chunk-RW4PYFNE.js} +14 -94
- package/dist/node-runtime/chunk-TP7K7YWS.js +2830 -0
- package/dist/node-runtime/{chunk-TAP7QTUT.js → chunk-TVLBDVTR.js} +46 -436
- 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-J7QGQD45.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-5Q45AVQG.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-LGR5VT5X.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-XEXL2DGQ.js → customize-VFJV3U6A.js} +2 -1
- package/dist/node-runtime/{direct-tool-executor-TDJS7TBD.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-IUCVZCWC.js → extract-EQJE7FZZ.js} +2 -2
- package/dist/node-runtime/gateway-QENRQA5X.js +1476 -0
- package/dist/node-runtime/{gemini-search-NCIDF7NE.js → gemini-search-35OCRFLN.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-OKIN7AIP.js → gemini-url-context-UQY3PHHW.js} +2 -2
- package/dist/node-runtime/index.js +120 -77
- package/dist/node-runtime/{init-EKE277AG.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-IAUNXSXH.js +138 -0
- package/dist/node-runtime/{lunr-cron-KKBOGAEF.js → lunr-cron-P6ZJGVEF.js} +22 -8
- package/dist/node-runtime/main.js +50 -35
- 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-C4EJOO5Q.js → package-manager-cli-J337RKTI.js} +28 -19
- package/dist/node-runtime/{pi-intercom-EEMBGQID.js → pi-intercom-QM53RLTS.js} +114 -88
- package/dist/node-runtime/{pi-mcp-adapter-DPTJGAAL.js → pi-mcp-adapter-3PHF4KZ4.js} +9 -8
- package/dist/node-runtime/{pi-subagents-VKCLYIBY.js → pi-subagents-RCHPB6UK.js} +1476 -646
- package/dist/node-runtime/{pi-web-access-BV6DSZOP.js → pi-web-access-PNG35XW7.js} +11 -11
- package/dist/node-runtime/process-registry-PVJ44F7H.js +31 -0
- package/dist/node-runtime/{proxy-modes-R64LU6WZ.js → proxy-modes-5FAPSZEZ.js} +14 -14
- package/dist/node-runtime/rpc-entry.js +50 -35
- 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-K6IPIQTI.js → settings-manager-HIBIUNBK.js} +13 -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-EFLTO32A.js → subagent-executor-2BH76MMS.js} +242 -314
- 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-I6OVDRPL.js → update-cli-TVTPVUNM.js} +7 -3
- package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
- package/dist/node-runtime/{video-extract-ETA5RA7U.js → video-extract-OOZHR7SU.js} +2 -2
- package/dist/node-runtime/workflow-TVJNKKQP.js +509 -0
- package/dist/node-runtime/{youtube-extract-SRVGNN26.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 +319 -268
- package/docs/extensions.md +2 -0
- package/docs/features.md +129 -30
- package/docs/index.md +1 -1
- package/docs/interactive-startup.md +2 -1
- package/docs/keybindings.md +4 -2
- package/docs/providers.md +6 -2
- package/docs/quickstart.md +2 -2
- package/docs/sessions.md +10 -0
- package/docs/settings.md +6 -3
- 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/builtin-extensions/lunr-settings-tools.d.ts +0 -4
- package/dist/builtin-extensions/lunr-settings-tools.d.ts.map +0 -1
- package/dist/builtin-extensions/lunr-settings-tools.js +0 -120
- package/dist/builtin-extensions/lunr-settings-tools.js.map +0 -1
- package/dist/core/settings-tools-bridge.d.ts +0 -35
- package/dist/core/settings-tools-bridge.d.ts.map +0 -1
- package/dist/core/settings-tools-bridge.js +0 -56
- package/dist/core/settings-tools-bridge.js.map +0 -1
- package/dist/node-runtime/agent-session-services-RSGP5GDN.js +0 -39
- package/dist/node-runtime/chunk-EH2LJQPM.js +0 -64
- package/dist/node-runtime/chunk-HQCKFM2O.js +0 -56
- package/dist/node-runtime/chunk-JT6YCS5B.js +0 -5648
- package/dist/node-runtime/command-6UXQ6XZN.js +0 -13
- package/dist/node-runtime/gateway-3OLC4GQN.js +0 -2139
- package/dist/node-runtime/image-resize-6ZPBFMWW.js +0 -11
- package/dist/node-runtime/interactive-mode-S5M26CQ7.js +0 -59
- package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +0 -206
- package/dist/node-runtime/runtime-bridges-UJ5WJJLN.js +0 -14
- package/dist/node-runtime/workflow-SA34S4VX.js +0 -325
- 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-GPFAU3N6.js → src-IVPNZ2BX.js} +6 -6
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-M3LZLQW2.js";
|
|
5
5
|
import {
|
|
6
6
|
computerPolicy
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3ONQTOMR.js";
|
|
8
8
|
import {
|
|
9
|
+
CONFIG_DIR_NAME,
|
|
9
10
|
getAgentDir
|
|
10
11
|
} from "./chunk-PCIGF2XK.js";
|
|
11
12
|
|
|
12
13
|
// packages/coding-agent/dist/core/plan-mode.js
|
|
13
|
-
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([
|
|
14
15
|
"ls",
|
|
15
16
|
"ll",
|
|
16
17
|
"cat",
|
|
@@ -127,19 +128,21 @@ var PLAN_MODE_ADDENDUM = "You are in plan mode. Investigate read-only, then pres
|
|
|
127
128
|
function isCodeRewriteMutating(input) {
|
|
128
129
|
return input?.dry_run === !1;
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function readOnlyModeBlockReason(toolName, input) {
|
|
131
132
|
if (toolName.startsWith("computer_"))
|
|
132
133
|
try {
|
|
133
|
-
return computerPolicy(toolName, {})?.observation ? void 0 :
|
|
134
|
+
return computerPolicy(toolName, {})?.observation ? void 0 : READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
134
135
|
} catch {
|
|
135
|
-
return
|
|
136
|
+
return READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
136
137
|
}
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
138
|
+
if (toolName === "browser" && input?.action === "act")
|
|
139
|
+
return `${READ_ONLY_MODE_BLOCK_MESSAGE} Browser interactions require a writable mode; observation remains available.`;
|
|
140
|
+
if (BLOCKED_TOOLS.has(toolName) || toolName === "code_rewrite" && isCodeRewriteMutating(input))
|
|
141
|
+
return READ_ONLY_MODE_BLOCK_MESSAGE;
|
|
139
142
|
if (toolName === "bash") {
|
|
140
143
|
let command = readBashCommand(input);
|
|
141
144
|
if (command && isMutatingBashCommand(command))
|
|
142
|
-
return `${
|
|
145
|
+
return `${READ_ONLY_MODE_BLOCK_MESSAGE} Blocked command: ${command}`;
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
148
|
function readBashCommand(input) {
|
|
@@ -371,16 +374,16 @@ function effectiveLargeSubagentLaunchCountForTurn(args, assistantMessage) {
|
|
|
371
374
|
}
|
|
372
375
|
|
|
373
376
|
// packages/coding-agent/dist/core/permissions.js
|
|
374
|
-
var PERMISSION_MODES = ["
|
|
377
|
+
var PERMISSION_MODES = ["yolo", "auto", "read-only"];
|
|
375
378
|
function nextPermissionMode(current) {
|
|
376
379
|
let i = PERMISSION_MODES.indexOf(current);
|
|
377
380
|
return PERMISSION_MODES[(i + 1) % PERMISSION_MODES.length];
|
|
378
381
|
}
|
|
379
|
-
function
|
|
380
|
-
return getPermissionMode(sessionId) === "
|
|
382
|
+
function isReadOnlyModeActive(sessionId) {
|
|
383
|
+
return getPermissionMode(sessionId) === "read-only";
|
|
381
384
|
}
|
|
382
385
|
function restorePermissionModeAfterPlan(previous, defaultMode) {
|
|
383
|
-
return previous && previous !== "
|
|
386
|
+
return previous && previous !== "read-only" ? previous : defaultMode;
|
|
384
387
|
}
|
|
385
388
|
var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
386
389
|
"read",
|
|
@@ -404,9 +407,15 @@ var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
|
404
407
|
"lsp_symbols",
|
|
405
408
|
"lsp_code_actions",
|
|
406
409
|
"lsp_completions",
|
|
410
|
+
"lsp_rename",
|
|
407
411
|
"memory_load",
|
|
408
|
-
"
|
|
409
|
-
|
|
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,14 +455,10 @@ 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
|
}
|
|
456
|
-
var GLOBAL_AGENTS_FILE_WRITE_BLOCK_REASON = "The agents instruction tree is user-managed. The agent cannot change ~/.lunr/agent/agents/.", MEMORY_FILE_DIRECT_WRITE_BLOCK_REASON = "Memory is model-managed through the memory tools. Do not directly change ~/.lunr/simple-memory/memory.md.";
|
|
461
|
+
var GLOBAL_AGENTS_FILE_WRITE_BLOCK_REASON = "The agents instruction tree is user-managed. The agent cannot change ~/.lunr/agent/agents/.", MEMORY_FILE_DIRECT_WRITE_BLOCK_REASON = "Memory is model-managed through the memory tools. Do not directly change ~/.lunr/simple-memory/memory.md.", SETTINGS_FILE_DIRECT_WRITE_BLOCK_REASON = "lunR settings are user-managed through /settings. Do not directly change settings.json.";
|
|
457
462
|
function protectedFileWriteReason(toolName, input, cwd) {
|
|
458
463
|
if (toolName !== "edit" && toolName !== "write" && toolName !== "code_rewrite")
|
|
459
464
|
return;
|
|
@@ -468,9 +473,11 @@ function protectedFileWriteReason(toolName, input, cwd) {
|
|
|
468
473
|
return GLOBAL_AGENTS_FILE_WRITE_BLOCK_REASON;
|
|
469
474
|
if (normalize(target) === normalize(join(dirname(getAgentDir()), "simple-memory", "memory.md")))
|
|
470
475
|
return MEMORY_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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.";
|
|
479
|
+
if (normalizedTarget === globalSettings || normalizedTarget === projectSettings)
|
|
480
|
+
return SETTINGS_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
474
481
|
}
|
|
475
482
|
function collectRequestedChildLaunches(value, launches) {
|
|
476
483
|
if (!value || typeof value != "object" || Array.isArray(value))
|
|
@@ -495,9 +502,6 @@ function getRequestedChildLaunches(input) {
|
|
|
495
502
|
let launches = [];
|
|
496
503
|
return collectRequestedChildLaunches(input, launches), launches;
|
|
497
504
|
}
|
|
498
|
-
function requiresManualApproval(toolName, input) {
|
|
499
|
-
return toolName.startsWith("computer_") ? toolName !== "computer_end" : isMutatingTool(toolName) ? !0 : toolName.startsWith("settings_") && toolName !== "settings_load" ? Object.keys(input).length > 0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
|
|
500
|
-
}
|
|
501
505
|
function firstTaskText(value) {
|
|
502
506
|
return typeof value == "string" && value.trim() ? sanitizeDetail(value) : "";
|
|
503
507
|
}
|
|
@@ -524,16 +528,14 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
|
|
|
524
528
|
if (ctx.mode === "auto" || options?.confirmLargeSubagentLaunches === !1)
|
|
525
529
|
return;
|
|
526
530
|
let count = effectiveLargeSubagentLaunchCountForTurn(input, options?.assistantMessage);
|
|
527
|
-
if (count <= 2)
|
|
531
|
+
if (count <= 2 || ctx.approvals.has(LARGE_SUBAGENT_LAUNCH_ACTION))
|
|
528
532
|
return;
|
|
529
|
-
if (ctx.approvals.has(LARGE_SUBAGENT_LAUNCH_ACTION))
|
|
530
|
-
return { fullChildrenApproved: !1 };
|
|
531
533
|
let turnKey = options?.assistantMessage, cached = turnKey ? turnLargeLaunchDecisions.get(turnKey) : void 0;
|
|
532
534
|
if (cached)
|
|
533
535
|
return cached.decision === "reject" ? {
|
|
534
536
|
block: !0,
|
|
535
537
|
reason: cached.feedback ? `${LARGE_SUBAGENT_LAUNCH_REJECT_REASON} ${cached.feedback}` : LARGE_SUBAGENT_LAUNCH_REJECT_REASON
|
|
536
|
-
} :
|
|
538
|
+
} : void 0;
|
|
537
539
|
if (!approvalHandler || ctx.allowApprovals === !1)
|
|
538
540
|
return { block: !0, reason: NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
|
|
539
541
|
let summary = largeLaunchTaskSummary(input, options?.assistantMessage), siblingLaunches = (options?.assistantMessage?.content ?? []).flatMap((block) => {
|
|
@@ -541,7 +543,7 @@ async function gateLargeSubagentLaunch(input, ctx, options) {
|
|
|
541
543
|
return [];
|
|
542
544
|
let args = block.arguments && typeof block.arguments == "object" && !Array.isArray(block.arguments) ? block.arguments : void 0;
|
|
543
545
|
return args ? getRequestedChildLaunches(args) : [];
|
|
544
|
-
}),
|
|
546
|
+
}), launchSummary = (siblingLaunches.length > 0 ? siblingLaunches : getRequestedChildLaunches(input)).map((launch) => `${launch.description}
|
|
545
547
|
permissions: ${launch.permissions}`).join(`
|
|
546
548
|
`), resp;
|
|
547
549
|
try {
|
|
@@ -556,10 +558,15 @@ ${launchSummary || summary}` : ""}`,
|
|
|
556
558
|
return { block: !0, reason: err instanceof Error ? err.message : NO_LARGE_SUBAGENT_LAUNCH_HANDLER_REASON };
|
|
557
559
|
}
|
|
558
560
|
let rawDecision = typeof resp == "string" ? resp : resp.decision, decision = rawDecision === "approve" ? "once" : rawDecision, feedback = typeof resp == "string" ? void 0 : resp.feedback?.trim();
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
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
|
+
};
|
|
563
570
|
}
|
|
564
571
|
function sanitizeDetail(value) {
|
|
565
572
|
let text = String(value ?? "").trim();
|
|
@@ -576,67 +583,35 @@ async function gateToolCall(toolName, input, cwd, sessionId, options) {
|
|
|
576
583
|
let protectedWriteReason = protectedFileWriteReason(toolName, input, cwd);
|
|
577
584
|
if (protectedWriteReason)
|
|
578
585
|
return { block: !0, reason: protectedWriteReason };
|
|
579
|
-
if (READ_ONLY_TOOLS.has(toolName))
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
let path = resolvePath(cwd, input.path);
|
|
601
|
-
action = (path ? isPathOutsideCwd(path, cwd) : !1) ? `${toolName}-outside` : toolName, detail = path || String(input.path ?? "");
|
|
602
|
-
} else if (toolName === "memory_add")
|
|
603
|
-
action = toolName, detail = sanitizeDetail(input.content);
|
|
604
|
-
else if (toolName === "memory_remove")
|
|
605
|
-
action = toolName, detail = sanitizeDetail(input.line);
|
|
606
|
-
else if (toolName === "cron")
|
|
607
|
-
action = "cron", detail = sanitizeDetail(input.action);
|
|
608
|
-
else if (toolName === "subagent") {
|
|
609
|
-
action = FULL_CHILD_ACTION;
|
|
610
|
-
let launches = getRequestedChildLaunches(input).filter((launch) => launch.permissions === "full");
|
|
611
|
-
detail = sanitizeDetail(launches.map((launch) => `${launch.description}
|
|
612
|
-
permissions: ${launch.permissions}`).join(`
|
|
613
|
-
`));
|
|
614
|
-
} else toolName === "code_rewrite" ? (action = "code_rewrite", detail = sanitizeDetail(input.path ?? input.pattern)) : (action = toolName, detail = "");
|
|
615
|
-
if (!toolName.startsWith("computer_") && ctx.approvals.has(action))
|
|
616
|
-
return;
|
|
617
|
-
if (!approvalHandler || ctx.allowApprovals === !1)
|
|
618
|
-
return { block: !0, reason: NO_HANDLER_REASON };
|
|
619
|
-
let resp;
|
|
620
|
-
try {
|
|
621
|
-
resp = await approvalHandler({ toolName, action, detail });
|
|
622
|
-
} catch (err) {
|
|
623
|
-
return { block: !0, reason: err instanceof Error ? err.message : NO_HANDLER_REASON };
|
|
624
|
-
}
|
|
625
|
-
let decision = typeof resp == "string" ? resp : resp.decision;
|
|
626
|
-
if (decision === "session") {
|
|
627
|
-
toolName.startsWith("computer_") || ctx.approvals.add(action);
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
if (decision === "reject") {
|
|
631
|
-
let feedback = typeof resp == "string" ? void 0 : resp.feedback?.trim();
|
|
632
|
-
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
|
+
}
|
|
633
607
|
}
|
|
634
608
|
}
|
|
635
609
|
|
|
636
610
|
export {
|
|
637
|
-
|
|
611
|
+
READ_ONLY_MODE_ADDENDUM,
|
|
612
|
+
PERMISSION_MODES,
|
|
638
613
|
nextPermissionMode,
|
|
639
|
-
|
|
614
|
+
isReadOnlyModeActive,
|
|
640
615
|
restorePermissionModeAfterPlan,
|
|
641
616
|
NO_HANDLER_REASON,
|
|
642
617
|
createPermissionContext,
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getAgentDir
|
|
4
|
+
} from "./chunk-PCIGF2XK.js";
|
|
5
|
+
|
|
6
|
+
// packages/coding-agent/dist/gateway/service.js
|
|
7
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
8
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
9
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
10
|
+
import { homedir, userInfo } from "node:os";
|
|
11
|
+
import { dirname, join, resolve } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
var servicePrefix = "lunr-gateway", serviceDirectory = () => join(getAgentDir(), "gateway-service"), gatewayLogPath = () => join(serviceDirectory(), "gateway.log"), statusPath = () => join(serviceDirectory(), "status.json"), controlPath = () => join(serviceDirectory(), "control.json"), settingsPath = () => join(serviceDirectory(), "service.json");
|
|
14
|
+
function atomicJson(path, value) {
|
|
15
|
+
mkdirSync(dirname(path), { recursive: !0, mode: 448 });
|
|
16
|
+
let temp = `${path}.${randomUUID()}.tmp`;
|
|
17
|
+
writeFileSync(temp, `${JSON.stringify(value, null, 2)}
|
|
18
|
+
`, { mode: 384 }), renameSync(temp, path);
|
|
19
|
+
}
|
|
20
|
+
function readJson(path) {
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
23
|
+
} catch {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function loadServiceSettings() {
|
|
28
|
+
let raw = readJson(settingsPath());
|
|
29
|
+
return raw && typeof raw == "object" && "startup" in raw && (raw.startup === "login" || raw.startup === "boot") ? { startup: raw.startup } : { startup: "off" };
|
|
30
|
+
}
|
|
31
|
+
function processExists(pid) {
|
|
32
|
+
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
33
|
+
return !1;
|
|
34
|
+
try {
|
|
35
|
+
return process.kill(pid, 0), !0;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return !(error && typeof error == "object" && "code" in error && error.code === "ESRCH");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function readGatewayStatus(file = statusPath()) {
|
|
41
|
+
let raw = readJson(file);
|
|
42
|
+
if (!(!raw || typeof raw != "object" || !("version" in raw) || raw.version !== 1 || !("pid" in raw) || typeof raw.pid != "number") && !(!("instance" in raw) || typeof raw.instance != "string" || !("updatedAt" in raw) || typeof raw.updatedAt != "string") && !(!("state" in raw) || !["starting", "ready", "stopping"].includes(String(raw.state))) && !(!("platforms" in raw) || !raw.platforms || typeof raw.platforms != "object" || !("startedAt" in raw) || typeof raw.startedAt != "string"))
|
|
43
|
+
return raw;
|
|
44
|
+
}
|
|
45
|
+
function gatewayIsRunning() {
|
|
46
|
+
let status = readGatewayStatus();
|
|
47
|
+
return !!status && processExists(status.pid);
|
|
48
|
+
}
|
|
49
|
+
function claimGateway(onStop) {
|
|
50
|
+
let dir = serviceDirectory();
|
|
51
|
+
mkdirSync(dir, { recursive: !0, mode: 448 });
|
|
52
|
+
let lock = join(dir, "lock");
|
|
53
|
+
try {
|
|
54
|
+
mkdirSync(lock);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
if (!error || typeof error != "object" || !("code" in error) || error.code !== "EEXIST")
|
|
57
|
+
throw error;
|
|
58
|
+
let previous = readGatewayStatus(join(lock, "owner.json"));
|
|
59
|
+
if (!previous || processExists(previous.pid))
|
|
60
|
+
throw new Error("Gateway already running or startup lock is unresolved. Run lunr gateway doctor.");
|
|
61
|
+
let recovery = join(dir, "recovery");
|
|
62
|
+
mkdirSync(recovery);
|
|
63
|
+
try {
|
|
64
|
+
let current = readGatewayStatus(join(lock, "owner.json"));
|
|
65
|
+
if (!current || current.instance !== previous.instance || processExists(current.pid))
|
|
66
|
+
throw new Error("Gateway ownership changed. Try again.");
|
|
67
|
+
rmSync(lock, { recursive: !0 }), mkdirSync(lock);
|
|
68
|
+
} finally {
|
|
69
|
+
rmSync(recovery, { recursive: !0, force: !0 });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
let status = {
|
|
73
|
+
version: 1,
|
|
74
|
+
instance: randomUUID(),
|
|
75
|
+
pid: process.pid,
|
|
76
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
77
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
78
|
+
state: "starting",
|
|
79
|
+
platforms: {}
|
|
80
|
+
};
|
|
81
|
+
atomicJson(join(lock, "owner.json"), status);
|
|
82
|
+
let save = () => {
|
|
83
|
+
status.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), atomicJson(statusPath(), status);
|
|
84
|
+
};
|
|
85
|
+
save();
|
|
86
|
+
let stopping = !1, timer = setInterval(() => {
|
|
87
|
+
save();
|
|
88
|
+
let control = readJson(controlPath());
|
|
89
|
+
!stopping && control && typeof control == "object" && "instance" in control && control.instance === status.instance && "action" in control && control.action === "stop" && (stopping = !0, status.state = "stopping", onStop());
|
|
90
|
+
}, 500);
|
|
91
|
+
return {
|
|
92
|
+
update(platforms, state = "ready") {
|
|
93
|
+
if (stopping && state !== "stopping") {
|
|
94
|
+
stopping = !1;
|
|
95
|
+
let control = readJson(controlPath());
|
|
96
|
+
control && typeof control == "object" && "instance" in control && control.instance === status.instance && rmSync(controlPath(), { force: !0 });
|
|
97
|
+
}
|
|
98
|
+
status.platforms = { ...platforms }, status.state = state, save();
|
|
99
|
+
},
|
|
100
|
+
release() {
|
|
101
|
+
clearInterval(timer), readGatewayStatus()?.instance === status.instance && (rmSync(statusPath(), { force: !0 }), rmSync(controlPath(), { force: !0 }), rmSync(lock, { recursive: !0, force: !0 }));
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function cliPath() {
|
|
106
|
+
let candidate = process.argv[1];
|
|
107
|
+
return candidate && existsSync(candidate) ? resolve(candidate) : fileURLToPath(new URL("../cli.js", new URL("../gateway/service.js", import.meta.url).href));
|
|
108
|
+
}
|
|
109
|
+
var sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
110
|
+
async function startGatewayService() {
|
|
111
|
+
if (gatewayIsRunning()) {
|
|
112
|
+
if (readGatewayStatus()?.state === "ready")
|
|
113
|
+
return "Gateway is already running.";
|
|
114
|
+
throw new Error(`Gateway process is running but no bot is connected. ${serviceStatusText()}
|
|
115
|
+
Inspect ${gatewayLogPath()}`);
|
|
116
|
+
}
|
|
117
|
+
mkdirSync(serviceDirectory(), { recursive: !0, mode: 448 });
|
|
118
|
+
let startup = loadServiceSettings().startup;
|
|
119
|
+
if (startup !== "off") {
|
|
120
|
+
let user = userInfo(), spec = startupSpec(process.platform, startup, {
|
|
121
|
+
home: homedir(),
|
|
122
|
+
agentDir: getAgentDir(),
|
|
123
|
+
node: process.execPath,
|
|
124
|
+
cli: cliPath(),
|
|
125
|
+
username: user.username,
|
|
126
|
+
uid: user.uid
|
|
127
|
+
});
|
|
128
|
+
execute(spec.start);
|
|
129
|
+
for (let i = 0; i < 100; i++) {
|
|
130
|
+
if (readGatewayStatus()?.state === "ready" && gatewayIsRunning())
|
|
131
|
+
return "Gateway started.";
|
|
132
|
+
await sleep(200);
|
|
133
|
+
}
|
|
134
|
+
throw new Error(`Startup service did not connect within 20 seconds. ${serviceStatusText()}
|
|
135
|
+
Run lunr gateway doctor and inspect ${gatewayLogPath()}`);
|
|
136
|
+
}
|
|
137
|
+
let { openSync, closeSync } = await import("node:fs"), log = openSync(gatewayLogPath(), "a", 384), child = spawn(process.execPath, [cliPath(), "gateway", "run"], {
|
|
138
|
+
cwd: homedir(),
|
|
139
|
+
detached: !0,
|
|
140
|
+
windowsHide: !0,
|
|
141
|
+
stdio: ["ignore", log, log],
|
|
142
|
+
env: { ...process.env, PI_CODING_AGENT_DIR: getAgentDir() }
|
|
143
|
+
});
|
|
144
|
+
closeSync(log);
|
|
145
|
+
let spawnError;
|
|
146
|
+
child.on("error", (error) => {
|
|
147
|
+
spawnError = error;
|
|
148
|
+
}), child.unref();
|
|
149
|
+
for (let i = 0; i < 100; i++) {
|
|
150
|
+
if (spawnError)
|
|
151
|
+
throw spawnError;
|
|
152
|
+
let status = readGatewayStatus();
|
|
153
|
+
if (status && status.pid === child.pid && status.state === "ready")
|
|
154
|
+
return "Gateway started.";
|
|
155
|
+
if (child.exitCode !== null)
|
|
156
|
+
throw new Error(`Gateway exited with code ${child.exitCode}. See ${gatewayLogPath()}`);
|
|
157
|
+
await sleep(200);
|
|
158
|
+
}
|
|
159
|
+
throw new Error(`Gateway did not connect within 20 seconds. ${serviceStatusText()}
|
|
160
|
+
Check lunr gateway status and ${gatewayLogPath()}`);
|
|
161
|
+
}
|
|
162
|
+
async function stopGatewayService() {
|
|
163
|
+
let status = readGatewayStatus();
|
|
164
|
+
if (!status || !processExists(status.pid))
|
|
165
|
+
return "Gateway is not running.";
|
|
166
|
+
atomicJson(controlPath(), { instance: status.instance, action: "stop" });
|
|
167
|
+
for (let i = 0; i < 150; i++) {
|
|
168
|
+
if (readGatewayStatus()?.instance !== status.instance || !processExists(status.pid))
|
|
169
|
+
return "Gateway stopped.";
|
|
170
|
+
await sleep(200);
|
|
171
|
+
}
|
|
172
|
+
throw new Error("Gateway is still stopping after 30 seconds. Inspect the log; no unrelated process was terminated.");
|
|
173
|
+
}
|
|
174
|
+
function xml(value) {
|
|
175
|
+
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
176
|
+
}
|
|
177
|
+
function systemdArg(value) {
|
|
178
|
+
return `"${value.replaceAll("%", "%%").replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
179
|
+
}
|
|
180
|
+
function ps(value) {
|
|
181
|
+
return `'${value.replaceAll("'", "''")}'`;
|
|
182
|
+
}
|
|
183
|
+
function startupSpec(platform, mode, options) {
|
|
184
|
+
let { home, agentDir, node, cli, username, uid } = options;
|
|
185
|
+
if ([home, agentDir, node, cli, username].some((value) => /[\r\n\0]/.test(value)))
|
|
186
|
+
throw new Error("Startup paths and account names must not contain control characters.");
|
|
187
|
+
let suffix = createHash("sha256").update(resolve(agentDir)).digest("hex").slice(0, 10), serviceName = `${servicePrefix}-${suffix}`, log = join(agentDir, "gateway-service", "gateway.log");
|
|
188
|
+
if (platform === "linux")
|
|
189
|
+
return {
|
|
190
|
+
path: join(home, ".config", "systemd", "user", `${serviceName}.service`),
|
|
191
|
+
content: `[Unit]
|
|
192
|
+
Description=lunR chat gateway
|
|
193
|
+
After=network-online.target
|
|
194
|
+
|
|
195
|
+
[Service]
|
|
196
|
+
Type=simple
|
|
197
|
+
ExecStart=${systemdArg(node)} ${systemdArg(cli)} gateway run
|
|
198
|
+
WorkingDirectory=${systemdArg(home)}
|
|
199
|
+
Environment=${systemdArg(`PI_CODING_AGENT_DIR=${agentDir}`)}
|
|
200
|
+
Restart=on-failure
|
|
201
|
+
RestartSec=5
|
|
202
|
+
TimeoutStopSec=30
|
|
203
|
+
StandardOutput=append:${log.replaceAll("%", "%%")}
|
|
204
|
+
StandardError=append:${log.replaceAll("%", "%%")}
|
|
205
|
+
UMask=0077
|
|
206
|
+
|
|
207
|
+
[Install]
|
|
208
|
+
WantedBy=default.target
|
|
209
|
+
`,
|
|
210
|
+
install: [
|
|
211
|
+
...mode === "boot" ? [["loginctl", "enable-linger", username]] : [],
|
|
212
|
+
["systemctl", "--user", "daemon-reload"],
|
|
213
|
+
["systemctl", "--user", "enable", `${serviceName}.service`]
|
|
214
|
+
],
|
|
215
|
+
remove: [["systemctl", "--user", "disable", `${serviceName}.service`]],
|
|
216
|
+
verify: ["systemctl", "--user", "is-enabled", `${serviceName}.service`],
|
|
217
|
+
start: ["systemctl", "--user", "start", `${serviceName}.service`]
|
|
218
|
+
};
|
|
219
|
+
if (platform === "darwin") {
|
|
220
|
+
let label = `dev.lunr.gateway.${suffix}`, path = mode === "boot" ? `/Library/LaunchDaemons/${label}.plist` : join(home, "Library", "LaunchAgents", `${label}.plist`), domain = mode === "boot" ? "system" : `gui/${uid}`, command = (args) => mode === "boot" ? ["sudo", "launchctl", ...args] : ["launchctl", ...args];
|
|
221
|
+
return {
|
|
222
|
+
path,
|
|
223
|
+
content: `<?xml version="1.0" encoding="UTF-8"?>
|
|
224
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
225
|
+
<plist version="1.0"><dict><key>Label</key><string>${label}</string><key>ProgramArguments</key><array>${[node, cli, "gateway", "run"].map((v) => `<string>${xml(v)}</string>`).join("")}</array><key>WorkingDirectory</key><string>${xml(home)}</string>${mode === "boot" ? `<key>UserName</key><string>${xml(username)}</string>` : ""}<key>EnvironmentVariables</key><dict><key>PI_CODING_AGENT_DIR</key><string>${xml(agentDir)}</string><key>HOME</key><string>${xml(home)}</string></dict><key>RunAtLoad</key><true/><key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict><key>StandardOutPath</key><string>${xml(log)}</string><key>StandardErrorPath</key><string>${xml(log)}</string></dict></plist>
|
|
226
|
+
`,
|
|
227
|
+
install: [command(["bootstrap", domain, path])],
|
|
228
|
+
remove: [command(["bootout", `${domain}/${label}`])],
|
|
229
|
+
verify: command(["print", `${domain}/${label}`]),
|
|
230
|
+
start: command(["kickstart", `${domain}/${label}`])
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (platform === "win32") {
|
|
234
|
+
let path = join(agentDir, "gateway-service", "startup.ps1"), content = `$env:PI_CODING_AGENT_DIR = ${ps(agentDir)}
|
|
235
|
+
Set-Location -LiteralPath ${ps(home)}
|
|
236
|
+
& ${ps(node)} ${ps(cli)} gateway run *>> ${ps(log)}
|
|
237
|
+
exit $LASTEXITCODE
|
|
238
|
+
`, action = `New-ScheduledTaskAction -Execute 'powershell.exe' -Argument ${ps(`-NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File "${path}"`)}`, trigger = mode === "boot" ? "New-ScheduledTaskTrigger -AtStartup" : `New-ScheduledTaskTrigger -AtLogOn -User ${ps(username)}`, register = `$ErrorActionPreference='Stop'; $a=${action}; $t=${trigger}; $s=New-ScheduledTaskSettingsSet -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1) -ExecutionTimeLimit ([TimeSpan]::Zero) -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries; ${mode === "boot" ? `$c=Get-Credential -UserName ${ps(username)} -Message 'Windows needs your account credentials to run lunR before login'; if(!$c){throw 'Cancelled'}; Register-ScheduledTask -TaskName '${serviceName}' -Action $a -Trigger $t -Settings $s -User $c.UserName -Password $c.GetNetworkCredential().Password -Force | Out-Null` : `Register-ScheduledTask -TaskName '${serviceName}' -Action $a -Trigger $t -Settings $s -User ${ps(username)} -Force | Out-Null`}`, command = (script) => ["powershell.exe", "-NoProfile", "-Command", script];
|
|
239
|
+
return {
|
|
240
|
+
path,
|
|
241
|
+
content,
|
|
242
|
+
install: [command(register)],
|
|
243
|
+
remove: [
|
|
244
|
+
command(`$ErrorActionPreference='Stop'; Unregister-ScheduledTask -TaskName '${serviceName}' -Confirm:$false`)
|
|
245
|
+
],
|
|
246
|
+
verify: command(`$ErrorActionPreference='Stop'; Get-ScheduledTask -TaskName '${serviceName}' | Out-Null`),
|
|
247
|
+
start: command(`$ErrorActionPreference='Stop'; Start-ScheduledTask -TaskName '${serviceName}'`)
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
throw new Error(`Automatic startup is not supported on ${platform}. Run lunr gateway start manually.`);
|
|
251
|
+
}
|
|
252
|
+
function execute(command) {
|
|
253
|
+
let [file, ...args] = command, result = spawnSync(file, args, { stdio: "inherit", windowsHide: !0, timeout: 12e4 });
|
|
254
|
+
if (result.error)
|
|
255
|
+
throw result.error;
|
|
256
|
+
if (result.status !== 0)
|
|
257
|
+
throw new Error(`${file} failed. Check OS permissions and run lunr gateway doctor.`);
|
|
258
|
+
}
|
|
259
|
+
async function configureStartup(mode) {
|
|
260
|
+
let previous = loadServiceSettings().startup;
|
|
261
|
+
if (process.platform === "linux" && mode === "login" && spawnSync("loginctl", ["show-user", userInfo().username, "--property=Linger", "--value"], {
|
|
262
|
+
encoding: "utf8",
|
|
263
|
+
timeout: 1e4
|
|
264
|
+
}).stdout?.trim() === "yes")
|
|
265
|
+
throw new Error("Linux user services already start at boot because lingering is enabled. Choose boot, or disable lingering yourself before choosing login. lunR will not change other user services.");
|
|
266
|
+
let user = userInfo(), options = {
|
|
267
|
+
home: homedir(),
|
|
268
|
+
agentDir: getAgentDir(),
|
|
269
|
+
node: process.execPath,
|
|
270
|
+
cli: cliPath(),
|
|
271
|
+
username: user.username,
|
|
272
|
+
uid: user.uid
|
|
273
|
+
};
|
|
274
|
+
if (previous !== "off") {
|
|
275
|
+
let old = startupSpec(process.platform, previous, options);
|
|
276
|
+
for (let command of old.remove)
|
|
277
|
+
execute(command);
|
|
278
|
+
process.platform === "darwin" && previous === "boot" ? execute(["sudo", "rm", "-f", old.path]) : rmSync(old.path, { force: !0 }), atomicJson(settingsPath(), { startup: "off" });
|
|
279
|
+
}
|
|
280
|
+
if (mode === "off") {
|
|
281
|
+
atomicJson(settingsPath(), { startup: "off" });
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
let spec = startupSpec(process.platform, mode, options);
|
|
285
|
+
if (mkdirSync(serviceDirectory(), { recursive: !0, mode: 448 }), process.platform === "darwin" && mode === "boot") {
|
|
286
|
+
let temporary = join(serviceDirectory(), "install.plist");
|
|
287
|
+
writeFileSync(temporary, spec.content, { mode: 384 });
|
|
288
|
+
try {
|
|
289
|
+
execute(["sudo", "install", "-o", "root", "-g", "wheel", "-m", "644", temporary, spec.path]);
|
|
290
|
+
} finally {
|
|
291
|
+
rmSync(temporary, { force: !0 });
|
|
292
|
+
}
|
|
293
|
+
} else
|
|
294
|
+
mkdirSync(dirname(spec.path), { recursive: !0, mode: 448 }), writeFileSync(spec.path, spec.content, { mode: 384 });
|
|
295
|
+
for (let command of spec.install)
|
|
296
|
+
execute(command);
|
|
297
|
+
execute(spec.verify), atomicJson(settingsPath(), { startup: mode });
|
|
298
|
+
}
|
|
299
|
+
function startupVerification() {
|
|
300
|
+
let mode = loadServiceSettings().startup;
|
|
301
|
+
if (mode === "off")
|
|
302
|
+
return "";
|
|
303
|
+
try {
|
|
304
|
+
let user = userInfo(), spec = startupSpec(process.platform, mode, {
|
|
305
|
+
home: homedir(),
|
|
306
|
+
agentDir: getAgentDir(),
|
|
307
|
+
node: process.execPath,
|
|
308
|
+
cli: cliPath(),
|
|
309
|
+
username: user.username,
|
|
310
|
+
uid: user.uid
|
|
311
|
+
}), [command, ...args] = spec.verify[0] === "sudo" ? spec.verify.slice(1) : spec.verify;
|
|
312
|
+
return spawnSync(command, args, { encoding: "utf8", windowsHide: !0, timeout: 5e3 }).status === 0 ? " (native service verified)" : " (native service missing or unavailable)";
|
|
313
|
+
} catch {
|
|
314
|
+
return " (native service could not be checked)";
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function serviceStatusText() {
|
|
318
|
+
let status = readGatewayStatus(), alive = !!status && processExists(status.pid), fresh = !!status && Date.now() - Date.parse(status.updatedAt) < 5e3;
|
|
319
|
+
return [
|
|
320
|
+
`Gateway: ${alive ? `${status.state}${fresh ? "" : " (not responding)"}` : "stopped"}`,
|
|
321
|
+
`Automatic startup: ${loadServiceSettings().startup}${startupVerification()}`,
|
|
322
|
+
...alive ? [`PID: ${status.pid}`, ...Object.entries(status.platforms).map(([name, state]) => `${name}: ${state}`)] : [],
|
|
323
|
+
`Log: ${gatewayLogPath()}`
|
|
324
|
+
].join(`
|
|
325
|
+
`);
|
|
326
|
+
}
|
|
327
|
+
function readGatewayLog() {
|
|
328
|
+
try {
|
|
329
|
+
return readFileSync(gatewayLogPath(), "utf8").split(`
|
|
330
|
+
`).slice(-100).join(`
|
|
331
|
+
`).replace(/bot\d+:[A-Za-z0-9_-]+/g, "bot[redacted]");
|
|
332
|
+
} catch {
|
|
333
|
+
return "No gateway log yet.";
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export {
|
|
338
|
+
serviceDirectory,
|
|
339
|
+
gatewayLogPath,
|
|
340
|
+
atomicJson,
|
|
341
|
+
loadServiceSettings,
|
|
342
|
+
processExists,
|
|
343
|
+
readGatewayStatus,
|
|
344
|
+
gatewayIsRunning,
|
|
345
|
+
claimGateway,
|
|
346
|
+
startGatewayService,
|
|
347
|
+
stopGatewayService,
|
|
348
|
+
startupSpec,
|
|
349
|
+
configureStartup,
|
|
350
|
+
serviceStatusText,
|
|
351
|
+
readGatewayLog
|
|
352
|
+
};
|