@ashx-j/lunr 0.2.20 → 0.2.22
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 +14 -2
- package/README.md +20 -4
- 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 +3 -0
- package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-browser.js +56 -0
- package/dist/builtin-extensions/lunr-browser.js.map +1 -0
- 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.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +30 -21
- 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 +15 -3
- package/dist/builtin-extensions/pi-intercom/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 +8 -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 +78 -31
- 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 +2 -2
- 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 +6 -2
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +4 -11
- 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 +5 -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 +186 -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.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 -3
- 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 +2 -0
- 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/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 +6 -2
- 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 +23 -1
- 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.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +1 -0
- 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 +46 -31
- 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 +1 -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 +2 -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/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 +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.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 +1 -1
- 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 +9 -9
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.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/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 +3 -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 +5 -0
- 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 +1 -1
- 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/types.d.ts +6 -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/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 +4 -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 +22 -23
- 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 +47 -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 +2 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +237 -374
- package/dist/builtin-extensions/pi-subagents/src/tui/render.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 +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +20 -2
- 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/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/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-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.map +1 -1
- package/dist/core/permissions.js +9 -0
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +3 -0
- 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-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 +13 -0
- 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 +184 -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 +11 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +29 -0
- 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 +2 -0
- package/dist/core/slash-commands.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/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -2
- 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 +11 -2
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +31 -4
- 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 +112 -17
- 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 +34 -11
- package/dist/gateway/adapters/telegram.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +14 -3
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +252 -60
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/approval.d.ts +1 -0
- package/dist/gateway/approval.d.ts.map +1 -1
- package/dist/gateway/approval.js +60 -18
- 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 +18 -3
- 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.map +1 -1
- package/dist/gateway/commands.js +18 -3
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/config.d.ts +5 -0
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js +5 -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/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 +85 -26
- 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 +422 -0
- package/dist/gateway/mobile-commands.js.map +1 -0
- package/dist/gateway/presenter.d.ts +16 -0
- package/dist/gateway/presenter.d.ts.map +1 -0
- package/dist/gateway/presenter.js +210 -0
- package/dist/gateway/presenter.js.map +1 -0
- package/dist/gateway/router.d.ts +1 -0
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +32 -3
- 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 +395 -0
- package/dist/gateway/service.js.map +1 -0
- package/dist/gateway/setup.d.ts +4 -0
- package/dist/gateway/setup.d.ts.map +1 -0
- package/dist/gateway/setup.js +146 -0
- package/dist/gateway/setup.js.map +1 -0
- 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 +2 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +11 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +53 -16
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/copyable-text.d.ts +31 -0
- package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/copyable-text.js +165 -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 +9 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +111 -1
- package/dist/modes/interactive/components/settings-selector.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 +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +166 -29
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/node-runtime/agent-session-services-NQ6GKOIK.js +49 -0
- package/dist/node-runtime/{builtin-extensions-X4JMM4ZS.js → builtin-extensions-GVC6IFDU.js} +6 -4
- 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-4EULYYR4.js +62 -0
- package/dist/node-runtime/chunk-5BNJ4JUH.js +672 -0
- package/dist/node-runtime/{chunk-6N22HULO.js → chunk-5D7LC2ZQ.js} +7 -2
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-KBKMCJDU.js → chunk-5ZQXRPMC.js} +19 -4
- package/dist/node-runtime/{chunk-6KDIOJL3.js → chunk-6427XAWG.js} +3 -3
- package/dist/node-runtime/{chunk-BOHIDQT4.js → chunk-6B2POMK7.js} +1 -1
- package/dist/node-runtime/{chunk-RNBHABBA.js → chunk-7QWNYZDI.js} +7 -0
- package/dist/node-runtime/chunk-AZJHNQKQ.js +205 -0
- package/dist/node-runtime/chunk-BFNXONG3.js +521 -0
- package/dist/node-runtime/{chunk-IRPJXI6U.js → chunk-BX2RB477.js} +1 -1
- package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
- package/dist/node-runtime/{chunk-25I2BHAA.js → chunk-CSUZVNYE.js} +1 -1
- package/dist/node-runtime/{chunk-QZMODZQ2.js → chunk-E24EO34J.js} +2 -1
- package/dist/node-runtime/{chunk-QKFMBRAL.js → chunk-EQ63ANHL.js} +508 -140
- package/dist/node-runtime/{chunk-ELWEXVO5.js → chunk-GJSAD4AB.js} +216 -201
- package/dist/node-runtime/{chunk-AOFXZQKA.js → chunk-GMHJCCEN.js} +8 -8
- package/dist/node-runtime/{chunk-DDWHZ633.js → chunk-GNN7H3B7.js} +1 -1
- package/dist/node-runtime/chunk-GS66LV4M.js +2830 -0
- package/dist/node-runtime/{chunk-6BEIBLQ3.js → chunk-H3XF4UVQ.js} +1 -1
- package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
- package/dist/node-runtime/{chunk-AROOY4BB.js → chunk-HTFRRDSF.js} +2 -7
- package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
- package/dist/node-runtime/{chunk-4CSFRBCN.js → chunk-IQIEU7SB.js} +9 -674
- package/dist/node-runtime/{chunk-OPEK5RRY.js → chunk-IVXYUAJE.js} +1 -1
- package/dist/node-runtime/{chunk-AL2FMKKM.js → chunk-IWOWXRWU.js} +58 -48
- package/dist/node-runtime/chunk-KKUTQQV7.js +144 -0
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/{chunk-K3646JTM.js → chunk-LMBNLFXQ.js} +25 -314
- package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-NAY6UUQZ.js} +1 -1
- package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
- package/dist/node-runtime/{chunk-STERBGUB.js → chunk-OFKSVRV7.js} +2 -2
- package/dist/node-runtime/{chunk-JZQ7F36T.js → chunk-ORH324EP.js} +19 -3
- package/dist/node-runtime/{chunk-2SJB2AWP.js → chunk-PC2Z5TKZ.js} +3 -3
- package/dist/node-runtime/{chunk-46ECNOLF.js → chunk-QDGKKKUM.js} +97 -162
- package/dist/node-runtime/chunk-R3K2F5GI.js +122 -0
- package/dist/node-runtime/chunk-RMQZU2YU.js +117 -0
- package/dist/node-runtime/{chunk-JYNNB7DU.js → chunk-TDL7UWJ7.js} +283 -2999
- package/dist/node-runtime/{chunk-G6LRAP36.js → chunk-TQGPP4SC.js} +1 -1
- package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
- package/dist/node-runtime/{chunk-4DJ6HEGH.js → chunk-UAFLNHSH.js} +18 -14
- package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
- package/dist/node-runtime/chunk-UP2XBVH5.js +40 -0
- package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-UQUCFAJ3.js} +1 -1
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/chunk-US544NN6.js +13 -0
- package/dist/node-runtime/chunk-UWPJL22I.js +341 -0
- package/dist/node-runtime/chunk-V2A7CEXK.js +355 -0
- package/dist/node-runtime/chunk-VJPTNWAP.js +708 -0
- package/dist/node-runtime/{chunk-WKDK4C5P.js → chunk-VSSXXL36.js} +38 -164
- package/dist/node-runtime/{chunk-4I23VTC4.js → chunk-VWCE2HSZ.js} +21 -124
- package/dist/node-runtime/{chunk-CBGB57XT.js → chunk-WADV2VDS.js} +32 -1014
- package/dist/node-runtime/{chunk-GKLEQ3I4.js → chunk-XLTL257W.js} +126 -27
- package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
- package/dist/node-runtime/cli-runtime.js +2 -2
- package/dist/node-runtime/command-3JHHXOPX.js +45 -0
- package/dist/node-runtime/commands-2JVNFGMQ.js +36 -0
- package/dist/node-runtime/{commands-MV5KOZ64.js → commands-KAMO2T6P.js} +10 -10
- package/dist/node-runtime/config-RORQUQFG.js +20 -0
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-VFJV3U6A.js} +2 -1
- package/dist/node-runtime/{direct-tool-executor-BK7CLEBX.js → direct-tool-executor-YAVOLDFY.js} +8 -8
- package/dist/node-runtime/{export-html-TEXVV5RP.js → export-html-KBFVV63J.js} +4 -3
- package/dist/node-runtime/{extension-input-O4HSAEM4.js → extension-input-K24TVKVW.js} +4 -4
- package/dist/node-runtime/{extension-selector-X5FCX43D.js → extension-selector-SPNF7EDR.js} +4 -4
- package/dist/node-runtime/{extract-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
- package/dist/node-runtime/{gateway-L4ANRTVE.js → gateway-VFO6SFKK.js} +275 -994
- 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 +105 -64
- package/dist/node-runtime/{init-3C7Z24OI.js → init-X2LIUB2H.js} +3 -3
- package/dist/node-runtime/{install-cli-EXMJQESX.js → install-cli-C3CF7O7N.js} +21 -82
- package/dist/node-runtime/interactive-mode-LOM6AIF6.js +72 -0
- package/dist/node-runtime/{interactive-view-ILS6TAN5.js → interactive-view-IDSCPPK7.js} +8 -8
- package/dist/node-runtime/lunr-browser-YNW7FTYX.js +87 -0
- package/dist/node-runtime/{lunr-cron-NNYTWTGF.js → lunr-cron-BKHGNBKT.js} +19 -5
- package/dist/node-runtime/main.js +45 -30
- package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
- package/dist/node-runtime/mobile-commands-HMP25WBC.js +32 -0
- package/dist/node-runtime/model-runtime-PLQKAG4B.js +16 -0
- package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-7RKSZGEN.js → package-manager-cli-VCK4E2RC.js} +23 -15
- package/dist/node-runtime/{pi-intercom-DDQMRNPJ.js → pi-intercom-HBPK5HSJ.js} +38 -34
- package/dist/node-runtime/{pi-mcp-adapter-GUFZWW54.js → pi-mcp-adapter-E6WULBKF.js} +4 -4
- package/dist/node-runtime/{pi-subagents-T5WMMLBB.js → pi-subagents-FEUDLJOE.js} +476 -412
- package/dist/node-runtime/{pi-web-access-2CQGFLT2.js → pi-web-access-WTGMNZ32.js} +15 -15
- package/dist/node-runtime/process-registry-4FAKZQOL.js +31 -0
- package/dist/node-runtime/{proxy-modes-V6YVFH3C.js → proxy-modes-OSQCWRBI.js} +9 -9
- package/dist/node-runtime/rpc-entry.js +46 -31
- package/dist/node-runtime/{rpc-mode-W5ZTLTMZ.js → rpc-mode-P5ODXPEG.js} +2 -2
- package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
- package/dist/node-runtime/{runtime-bridges-NJQERQ72.js → runtime-bridges-3XUQ46XW.js} +6 -5
- package/dist/node-runtime/service-ISSP6VHE.js +36 -0
- package/dist/node-runtime/session-handoff-HC7R5E24.js +33 -0
- package/dist/node-runtime/{session-manager-E7AREDTV.js → session-manager-CFN4UFM2.js} +2 -1
- package/dist/node-runtime/{session-selector-FJ7M2AIX.js → session-selector-LHRMJOKT.js} +5 -4
- package/dist/node-runtime/{settings-manager-GHPTUN7R.js → settings-manager-UUZ6NUXI.js} +8 -2
- package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
- package/dist/node-runtime/setup-NRXVZBLJ.js +155 -0
- package/dist/node-runtime/{subagent-executor-SRFC26SJ.js → subagent-executor-MLUMBWCP.js} +35 -63
- package/dist/node-runtime/theme-U7IGOA7O.js +68 -0
- package/dist/node-runtime/trust-manager-MMISNCYO.js +17 -0
- package/dist/node-runtime/{update-cli-L3JIBH2U.js → update-cli-4TP25CNW.js} +8 -2
- 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/{youtube-extract-TQYKGFGS.js → youtube-extract-FNPAUNHU.js} +6 -6
- package/docs/browser.md +86 -0
- package/docs/extensions.md +2 -0
- package/docs/features.md +99 -17
- package/docs/interactive-startup.md +2 -1
- package/docs/sessions.md +10 -0
- package/docs/settings.md +3 -1
- package/docs/tui.md +2 -0
- package/docs/usage.md +16 -0
- 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/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/package.json +7 -4
- package/scripts/install-browser.mjs +20 -0
- package/dist/node-runtime/agent-session-services-75JKASCW.js +0 -36
- package/dist/node-runtime/chunk-HQCKFM2O.js +0 -56
- package/dist/node-runtime/command-RBTRL55A.js +0 -13
- package/dist/node-runtime/interactive-mode-HPUNH7SV.js +0 -57
- package/dist/node-runtime/{chunk-UWQYRSYQ.js → chunk-YJMMG7C6.js} +25 -25
- 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
|
@@ -2,6 +2,10 @@ import { createRequire as __lunrRequire } from "node:module"; const require = __
|
|
|
2
2
|
import {
|
|
3
3
|
runSessionCleanups
|
|
4
4
|
} from "./chunk-AUXVGBO4.js";
|
|
5
|
+
import {
|
|
6
|
+
loadEnabledModelPatterns,
|
|
7
|
+
modelMatchesEnabledPatterns
|
|
8
|
+
} from "./chunk-4ZWGEEAS.js";
|
|
5
9
|
import {
|
|
6
10
|
isBrowserCookieAccessAllowed
|
|
7
11
|
} from "./chunk-DMMTJQMQ.js";
|
|
@@ -18,7 +22,7 @@ import {
|
|
|
18
22
|
loadPerplexity,
|
|
19
23
|
loadSummaryReview,
|
|
20
24
|
loadTavily
|
|
21
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-NAY6UUQZ.js";
|
|
22
26
|
import {
|
|
23
27
|
activityMonitor
|
|
24
28
|
} from "./chunk-DAPBPCBP.js";
|
|
@@ -27,14 +31,10 @@ import {
|
|
|
27
31
|
getWebSearchConfigPath
|
|
28
32
|
} from "./chunk-VRB2IYGG.js";
|
|
29
33
|
import {
|
|
30
|
-
|
|
31
|
-
modelMatchesEnabledPatterns
|
|
32
|
-
} from "./chunk-4ZWGEEAS.js";
|
|
33
|
-
import {
|
|
34
|
-
formatGroupedCall,
|
|
34
|
+
GroupedCallText,
|
|
35
35
|
toolGroupTree,
|
|
36
36
|
toolStatusDotFromContext
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-5ZQXRPMC.js";
|
|
38
38
|
import "./chunk-CSFI6YXL.js";
|
|
39
39
|
import "./chunk-FQMM2EZ2.js";
|
|
40
40
|
import "./chunk-Q4Q6D4IY.js";
|
|
@@ -1035,7 +1035,7 @@ Open manually: ${handle.url}` }],
|
|
|
1035
1035
|
}), initConfig.webSearch?.enabled !== !1 && pi.registerTool({
|
|
1036
1036
|
name: "web_search",
|
|
1037
1037
|
label: "Web Search",
|
|
1038
|
-
description: 'Search the web using OpenAI, Brave, Parallel, Tavily, Exa, Perplexity, or Gemini. Returns an AI-synthesized answer with source citations. OpenAI web_search uses a Codex subscription or OpenAI API key. For comprehensive research, prefer queries (plural) with 2-4 varied angles over a single query \u2014 each query gets its own synthesized answer, so varying phrasing and scope gives much broader coverage. When includeContent is true, full page content is fetched in the background. Searches auto-open the interactive browser curator and stream results live; set workflow to "none" to skip curation or "auto-summary" for a model-generated summary without the browser curator. Provider auto-selects: OpenAI when suitable and available, then Exa, Brave, Parallel, Tavily, Perplexity, Gemini API, then Gemini Web.',
|
|
1038
|
+
description: 'Search the web using OpenAI, Brave, Parallel, Tavily, Exa, Perplexity, or Gemini. Use web_search for discovery and fetch_content for reading URLs. When the browser tool is available, use it for JavaScript-rendered inspection or explicit website interaction; never automatically fall back to browser. Returns an AI-synthesized answer with source citations. OpenAI web_search uses a Codex subscription or OpenAI API key. For comprehensive research, prefer queries (plural) with 2-4 varied angles over a single query \u2014 each query gets its own synthesized answer, so varying phrasing and scope gives much broader coverage. When includeContent is true, full page content is fetched in the background. Searches auto-open the interactive browser curator and stream results live; set workflow to "none" to skip curation or "auto-summary" for a model-generated summary without the browser curator. Provider auto-selects: OpenAI when suitable and available, then Exa, Brave, Parallel, Tavily, Perplexity, Gemini API, then Gemini Web.',
|
|
1039
1039
|
promptSnippet: "Use for web research questions. Prefer {queries:[...]} with 2-4 varied angles over a single query for broader coverage.",
|
|
1040
1040
|
parameters: Type.Object({
|
|
1041
1041
|
query: Type.Optional(Type.String({ description: "Single search query. For research tasks, prefer 'queries' with multiple varied angles instead." })),
|
|
@@ -1245,15 +1245,15 @@ Open manually: ${handle.url}` }],
|
|
|
1245
1245
|
let queryList = collectSearchQueries(args), compact = !!(context && !context.isPartial && !context.expanded && !context.isError);
|
|
1246
1246
|
if (formatSearchCallTitle(queryList).empty)
|
|
1247
1247
|
return new Text(theme.fg("toolTitle", theme.bold("search ")) + theme.fg("error", "(no query)"), 0, 0);
|
|
1248
|
-
let detail = formatSearchDetail(queryList, compact ? context?.result?.details : void 0);
|
|
1249
|
-
return
|
|
1248
|
+
let detail = formatSearchDetail(queryList, compact ? context?.result?.details : void 0), header = new GroupedCallText("", 0, 0);
|
|
1249
|
+
return header.setCall({
|
|
1250
1250
|
role: context?.groupRole ?? "singleton",
|
|
1251
1251
|
compact,
|
|
1252
1252
|
tree: context ? toolGroupTree(context) : !1,
|
|
1253
1253
|
dot: context ? toolStatusDotFromContext(context, theme) : theme.fg("success", "\u25CF"),
|
|
1254
1254
|
title: theme.fg("toolTitle", theme.bold("search")),
|
|
1255
1255
|
detail: theme.fg("accent", detail)
|
|
1256
|
-
}),
|
|
1256
|
+
}), header;
|
|
1257
1257
|
},
|
|
1258
1258
|
renderResult(result, { expanded, isPartial }, theme, context) {
|
|
1259
1259
|
let details = result.details;
|
|
@@ -1294,7 +1294,7 @@ Open manually: ${handle.url}` }],
|
|
|
1294
1294
|
}), pi.registerTool({
|
|
1295
1295
|
name: "fetch_content",
|
|
1296
1296
|
label: "Fetch Content",
|
|
1297
|
-
description: "Fetch URL(s) and extract readable content as markdown. Supports YouTube video transcripts (with thumbnail), GitHub repository contents, and local video files (with frame thumbnail). Video frames can be extracted via timestamp/range or sampled across the entire video with frames alone. Falls back to Gemini for pages that block bots or fail Readability extraction. For YouTube and video files: ALWAYS pass the user's specific question via the prompt parameter \u2014 this directs the AI to focus on that aspect of the video, producing much better results than a generic extraction. Content is always stored and can be retrieved with get_search_content.",
|
|
1297
|
+
description: "Fetch URL(s) and extract readable content as markdown. Prefer fetch_content for reading URLs and web_search for discovery. The browser tool handles JavaScript-rendered inspection and explicit website interactions when enabled; it is not an automatic fallback, and interaction tasks do not require a preliminary fetch. Supports YouTube video transcripts (with thumbnail), GitHub repository contents, and local video files (with frame thumbnail). Video frames can be extracted via timestamp/range or sampled across the entire video with frames alone. Falls back to Gemini for pages that block bots or fail Readability extraction. For YouTube and video files: ALWAYS pass the user's specific question via the prompt parameter \u2014 this directs the AI to focus on that aspect of the video, producing much better results than a generic extraction. Content is always stored and can be retrieved with get_search_content.",
|
|
1298
1298
|
promptSnippet: "Use to extract readable content from URL(s), YouTube, GitHub repos, or local videos. For video questions, pass the user's exact question in prompt.",
|
|
1299
1299
|
parameters: Type.Object({
|
|
1300
1300
|
url: Type.Optional(Type.String({ description: "Single URL to fetch" })),
|
|
@@ -1402,15 +1402,15 @@ Use get_search_content({ responseId: "${responseId}", urlIndex: 0 }) to retrieve
|
|
|
1402
1402
|
let urlList = collectFetchUrls(args), compact = !!(context && !context.isPartial && !context.expanded && !context.isError);
|
|
1403
1403
|
if (formatFetchCallTitle(urlList).empty)
|
|
1404
1404
|
return new Text(theme.fg("toolTitle", theme.bold("fetch ")) + theme.fg("error", "(no URL)"), 0, 0);
|
|
1405
|
-
let detail = formatFetchDetail(urlList, compact ? context?.result?.details : void 0);
|
|
1406
|
-
return
|
|
1405
|
+
let detail = formatFetchDetail(urlList, compact ? context?.result?.details : void 0), header = new GroupedCallText("", 0, 0);
|
|
1406
|
+
return header.setCall({
|
|
1407
1407
|
role: context?.groupRole ?? "singleton",
|
|
1408
1408
|
compact,
|
|
1409
1409
|
tree: context ? toolGroupTree(context) : !1,
|
|
1410
1410
|
dot: context ? toolStatusDotFromContext(context, theme) : theme.fg("success", "\u25CF"),
|
|
1411
1411
|
title: theme.fg("toolTitle", theme.bold("fetch")),
|
|
1412
1412
|
detail: theme.fg("accent", detail)
|
|
1413
|
-
}),
|
|
1413
|
+
}), header;
|
|
1414
1414
|
},
|
|
1415
1415
|
renderResult(result, { expanded, isPartial }, theme, context) {
|
|
1416
1416
|
let details = result.details;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
clearRegistry,
|
|
4
|
+
isWindows,
|
|
5
|
+
kill,
|
|
6
|
+
killAll,
|
|
7
|
+
list,
|
|
8
|
+
markExited,
|
|
9
|
+
pause,
|
|
10
|
+
register,
|
|
11
|
+
restart,
|
|
12
|
+
resume,
|
|
13
|
+
unregister
|
|
14
|
+
} from "./chunk-KKUTQQV7.js";
|
|
15
|
+
import "./chunk-CSFI6YXL.js";
|
|
16
|
+
import "./chunk-FQMM2EZ2.js";
|
|
17
|
+
import "./chunk-Q4Q6D4IY.js";
|
|
18
|
+
import "./chunk-BRJX2PRC.js";
|
|
19
|
+
export {
|
|
20
|
+
clearRegistry,
|
|
21
|
+
isWindows,
|
|
22
|
+
kill,
|
|
23
|
+
killAll,
|
|
24
|
+
list,
|
|
25
|
+
markExited,
|
|
26
|
+
pause,
|
|
27
|
+
register,
|
|
28
|
+
restart,
|
|
29
|
+
resume,
|
|
30
|
+
unregister
|
|
31
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
resolveMcpOutputGuardOptions,
|
|
7
7
|
resolveMcpResultContent,
|
|
8
8
|
transformMcpContent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BX2RB477.js";
|
|
10
10
|
import {
|
|
11
11
|
buildToolMetadata,
|
|
12
12
|
findToolByName,
|
|
@@ -17,13 +17,7 @@ import {
|
|
|
17
17
|
updateMetadataCache,
|
|
18
18
|
updateServerMetadata,
|
|
19
19
|
updateStatusBar
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
abortable,
|
|
23
|
-
formatAuthRequiredMessage,
|
|
24
|
-
throwIfAborted,
|
|
25
|
-
truncateAtWord
|
|
26
|
-
} from "./chunk-VSELYKWU.js";
|
|
20
|
+
} from "./chunk-YJMMG7C6.js";
|
|
27
21
|
import {
|
|
28
22
|
UrlElicitationRequiredError,
|
|
29
23
|
authenticate,
|
|
@@ -31,12 +25,18 @@ import {
|
|
|
31
25
|
startAuth,
|
|
32
26
|
supportsOAuth
|
|
33
27
|
} from "./chunk-4TLO4PO2.js";
|
|
28
|
+
import {
|
|
29
|
+
abortable,
|
|
30
|
+
formatAuthRequiredMessage,
|
|
31
|
+
throwIfAborted,
|
|
32
|
+
truncateAtWord
|
|
33
|
+
} from "./chunk-VSELYKWU.js";
|
|
34
34
|
import "./chunk-4HXHDDCF.js";
|
|
35
|
-
import "./chunk-BI3DHYCN.js";
|
|
36
35
|
import {
|
|
37
36
|
getServerPrefix,
|
|
38
37
|
parseUiPromptHandoff
|
|
39
38
|
} from "./chunk-ARC4KOTI.js";
|
|
39
|
+
import "./chunk-BI3DHYCN.js";
|
|
40
40
|
import "./chunk-Q4Q6D4IY.js";
|
|
41
41
|
import "./chunk-BRJX2PRC.js";
|
|
42
42
|
|
|
@@ -2,51 +2,66 @@
|
|
|
2
2
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
main
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-IWOWXRWU.js";
|
|
6
|
+
import "./chunk-LMBNLFXQ.js";
|
|
7
|
+
import "./chunk-UAFLNHSH.js";
|
|
8
|
+
import "./chunk-YPHAIRZT.js";
|
|
9
|
+
import "./chunk-PL6JKXWI.js";
|
|
10
|
+
import "./chunk-5ZH3ZFIZ.js";
|
|
11
|
+
import "./chunk-CSUZVNYE.js";
|
|
12
|
+
import "./chunk-TDL7UWJ7.js";
|
|
13
|
+
import "./chunk-CCCN2UCX.js";
|
|
14
|
+
import "./chunk-IQIEU7SB.js";
|
|
13
15
|
import "./chunk-OBMWP3I5.js";
|
|
14
16
|
import "./chunk-DVGWF6A2.js";
|
|
15
17
|
import "./chunk-QFWG2RVL.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-WKDK4C5P.js";
|
|
18
|
+
import "./chunk-VSSXXL36.js";
|
|
18
19
|
import "./chunk-53YJI7JU.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-5ZQXRPMC.js";
|
|
21
|
+
import "./chunk-AD6VXAO7.js";
|
|
22
|
+
import "./chunk-GS66LV4M.js";
|
|
21
23
|
import {
|
|
22
24
|
configureHttpDispatcher
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-WADV2VDS.js";
|
|
26
|
+
import "./chunk-UP2XBVH5.js";
|
|
27
|
+
import "./chunk-VWCE2HSZ.js";
|
|
28
|
+
import "./chunk-LISUTZS3.js";
|
|
29
|
+
import "./chunk-GMHJCCEN.js";
|
|
30
|
+
import "./chunk-HTFRRDSF.js";
|
|
31
|
+
import "./chunk-URD2SLIT.js";
|
|
32
|
+
import "./chunk-OFKSVRV7.js";
|
|
33
|
+
import "./chunk-5BNJ4JUH.js";
|
|
34
|
+
import "./chunk-CGBXPL3E.js";
|
|
35
|
+
import "./chunk-BBUVIEZB.js";
|
|
36
|
+
import "./chunk-5D7LC2ZQ.js";
|
|
32
37
|
import "./chunk-M3LZLQW2.js";
|
|
38
|
+
import "./chunk-KKUTQQV7.js";
|
|
39
|
+
import "./chunk-CSFI6YXL.js";
|
|
40
|
+
import "./chunk-AZJHNQKQ.js";
|
|
41
|
+
import "./chunk-XLTL257W.js";
|
|
42
|
+
import "./chunk-FVDOXRUD.js";
|
|
43
|
+
import "./chunk-4EULYYR4.js";
|
|
44
|
+
import "./chunk-UJOCPOMX.js";
|
|
45
|
+
import "./chunk-2TKODGBZ.js";
|
|
46
|
+
import "./chunk-2MI5OPMN.js";
|
|
47
|
+
import "./chunk-IMLCWLPI.js";
|
|
48
|
+
import "./chunk-ORH324EP.js";
|
|
49
|
+
import "./chunk-UAEOTO52.js";
|
|
33
50
|
import "./chunk-RQ2Q5IYR.js";
|
|
34
51
|
import "./chunk-JHYKXIMM.js";
|
|
35
52
|
import "./chunk-H2EOZYMP.js";
|
|
53
|
+
import "./chunk-5EFIU3OM.js";
|
|
36
54
|
import "./chunk-PVCDKGR6.js";
|
|
37
55
|
import "./chunk-OR4L3IB2.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-QZMODZQ2.js";
|
|
56
|
+
import "./chunk-R3K2F5GI.js";
|
|
57
|
+
import "./chunk-E24EO34J.js";
|
|
41
58
|
import "./chunk-CCZJ3PYY.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-6427XAWG.js";
|
|
60
|
+
import "./chunk-PC2Z5TKZ.js";
|
|
44
61
|
import "./chunk-I6R76AG7.js";
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-DDWHZ633.js";
|
|
49
|
-
import "./chunk-RNBHABBA.js";
|
|
62
|
+
import "./chunk-6B2POMK7.js";
|
|
63
|
+
import "./chunk-GNN7H3B7.js";
|
|
64
|
+
import "./chunk-7QWNYZDI.js";
|
|
50
65
|
import {
|
|
51
66
|
APP_NAME
|
|
52
67
|
} from "./chunk-FQMM2EZ2.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runRpcMode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IVXYUAJE.js";
|
|
5
5
|
import "./chunk-OBMWP3I5.js";
|
|
6
6
|
import "./chunk-CSFI6YXL.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-7QWNYZDI.js";
|
|
8
8
|
import "./chunk-FQMM2EZ2.js";
|
|
9
9
|
import "./chunk-Q4Q6D4IY.js";
|
|
10
10
|
import "./chunk-BRJX2PRC.js";
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
truncateHead
|
|
4
|
+
} from "./chunk-53YJI7JU.js";
|
|
5
|
+
import "./chunk-BRJX2PRC.js";
|
|
6
|
+
|
|
7
|
+
// packages/coding-agent/dist/core/browser/network.js
|
|
8
|
+
import { lookup } from "node:dns/promises";
|
|
9
|
+
import { createServer, request } from "node:http";
|
|
10
|
+
import { BlockList, connect, isIP } from "node:net";
|
|
11
|
+
var blocked = new BlockList();
|
|
12
|
+
for (let [address, prefix] of [
|
|
13
|
+
["0.0.0.0", 8],
|
|
14
|
+
["10.0.0.0", 8],
|
|
15
|
+
["100.64.0.0", 10],
|
|
16
|
+
["127.0.0.0", 8],
|
|
17
|
+
["169.254.0.0", 16],
|
|
18
|
+
["172.16.0.0", 12],
|
|
19
|
+
["192.0.0.0", 24],
|
|
20
|
+
["192.0.2.0", 24],
|
|
21
|
+
["192.168.0.0", 16],
|
|
22
|
+
["192.88.99.0", 24],
|
|
23
|
+
["198.18.0.0", 15],
|
|
24
|
+
["198.51.100.0", 24],
|
|
25
|
+
["203.0.113.0", 24],
|
|
26
|
+
["224.0.0.0", 4],
|
|
27
|
+
["240.0.0.0", 4]
|
|
28
|
+
])
|
|
29
|
+
blocked.addSubnet(address, prefix, "ipv4");
|
|
30
|
+
for (let [address, prefix] of [
|
|
31
|
+
["2001::", 23],
|
|
32
|
+
["2001:db8::", 32],
|
|
33
|
+
["2002::", 16],
|
|
34
|
+
["3fff::", 20]
|
|
35
|
+
])
|
|
36
|
+
blocked.addSubnet(address, prefix, "ipv6");
|
|
37
|
+
var globalV6 = new BlockList();
|
|
38
|
+
globalV6.addSubnet("2000::", 3, "ipv6");
|
|
39
|
+
function isPublicAddress(address) {
|
|
40
|
+
return isIP(address) === 4 ? !blocked.check(address, "ipv4") : isIP(address) === 6 && globalV6.check(address, "ipv6") && !blocked.check(address, "ipv6");
|
|
41
|
+
}
|
|
42
|
+
function browserUrl(raw) {
|
|
43
|
+
let url = new URL(raw);
|
|
44
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password)
|
|
45
|
+
throw new Error("Browser permits HTTP(S) URLs without embedded credentials only.");
|
|
46
|
+
return url;
|
|
47
|
+
}
|
|
48
|
+
async function resolveBrowserHost(host, allowPrivate) {
|
|
49
|
+
let hostname = host.replace(/^\[|\]$/g, ""), addresses = isIP(hostname) ? [{ address: hostname }] : await lookup(hostname, { all: !0 });
|
|
50
|
+
if (!addresses.length || !allowPrivate && addresses.some(({ address }) => !isPublicAddress(address)))
|
|
51
|
+
throw new Error("Browser network policy blocked a private or reserved address. Local/private access requires explicit user configuration.");
|
|
52
|
+
return addresses[0].address;
|
|
53
|
+
}
|
|
54
|
+
async function createBrowserProxy(allowPrivate) {
|
|
55
|
+
let sockets = /* @__PURE__ */ new Set(), closed = !1, lastBlocked, track = (socket) => {
|
|
56
|
+
if (closed || sockets.size >= 128) {
|
|
57
|
+
socket.destroy();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
sockets.add(socket), socket.setTimeout(3e4, () => socket.destroy()), socket.on("close", () => sockets.delete(socket)), socket.on("error", () => socket.destroy());
|
|
61
|
+
}, server = createServer(async (incoming, outgoing) => {
|
|
62
|
+
try {
|
|
63
|
+
let url = browserUrl(incoming.url ?? "");
|
|
64
|
+
if (url.protocol !== "http:")
|
|
65
|
+
throw new Error("Use CONNECT for HTTPS.");
|
|
66
|
+
let address2 = await resolveBrowserHost(url.hostname, allowPrivate);
|
|
67
|
+
if (closed || incoming.destroyed)
|
|
68
|
+
return outgoing.destroy();
|
|
69
|
+
let headers = { ...incoming.headers, host: url.host };
|
|
70
|
+
delete headers["proxy-authorization"], delete headers["proxy-connection"];
|
|
71
|
+
let upstream = request({
|
|
72
|
+
hostname: address2,
|
|
73
|
+
port: url.port || 80,
|
|
74
|
+
method: incoming.method,
|
|
75
|
+
path: `${url.pathname}${url.search}`,
|
|
76
|
+
headers,
|
|
77
|
+
agent: !1
|
|
78
|
+
}, (response) => {
|
|
79
|
+
outgoing.writeHead(response.statusCode ?? 502, response.headers), response.pipe(outgoing);
|
|
80
|
+
});
|
|
81
|
+
upstream.on("socket", track), upstream.on("error", () => outgoing.destroy()), outgoing.on("close", () => upstream.destroy()), incoming.pipe(upstream);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
lastBlocked = error instanceof Error ? error.message : "Network request blocked.", outgoing.writeHead(403).end("Browser network policy blocked this request.");
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
server.on("connection", track), server.on("connect", async (incoming, client, head) => {
|
|
87
|
+
try {
|
|
88
|
+
let url = browserUrl(`https://${incoming.url}`), address2 = await resolveBrowserHost(url.hostname, allowPrivate);
|
|
89
|
+
if (closed || client.destroyed)
|
|
90
|
+
return client.destroy();
|
|
91
|
+
let upstream = connect({ host: address2, port: Number(url.port || 443) });
|
|
92
|
+
track(upstream), client.on("close", () => upstream.destroy()), upstream.on("close", () => client.destroy()), upstream.on("connect", () => {
|
|
93
|
+
client.write(`HTTP/1.1 200 Connection Established\r
|
|
94
|
+
\r
|
|
95
|
+
`), head.length && upstream.write(head), client.pipe(upstream), upstream.pipe(client);
|
|
96
|
+
});
|
|
97
|
+
} catch (error) {
|
|
98
|
+
lastBlocked = error instanceof Error ? error.message : "Network request blocked.", client.end(`HTTP/1.1 403 Forbidden\r
|
|
99
|
+
Connection: close\r
|
|
100
|
+
\r
|
|
101
|
+
`);
|
|
102
|
+
}
|
|
103
|
+
}), server.on("upgrade", (_request, socket) => socket.destroy()), server.on("clientError", (_error, socket) => socket.destroy()), await new Promise((resolve, reject) => {
|
|
104
|
+
server.once("error", reject), server.listen(0, "127.0.0.1", () => {
|
|
105
|
+
server.off("error", reject), resolve();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
let address = server.address();
|
|
109
|
+
if (!address || typeof address == "string")
|
|
110
|
+
throw new Error("Browser proxy failed to listen.");
|
|
111
|
+
return {
|
|
112
|
+
url: `http://127.0.0.1:${address.port}`,
|
|
113
|
+
blockedReason: () => lastBlocked,
|
|
114
|
+
async close() {
|
|
115
|
+
closed = !0;
|
|
116
|
+
for (let socket of sockets)
|
|
117
|
+
socket.destroy();
|
|
118
|
+
await new Promise((resolve) => server.close(() => resolve()));
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// packages/coding-agent/dist/core/browser/runtime.js
|
|
124
|
+
function boundedBrowserText(text) {
|
|
125
|
+
let result = truncateHead(text.replace(/[\x00-\x08\x0b-\x1f\x7f-\x9f]/g, ""), { maxBytes: 16384, maxLines: 300 });
|
|
126
|
+
return result.content + (result.truncated ? `
|
|
127
|
+
[Snapshot truncated. Inspect a specific role/name or label to narrow it.]` : "");
|
|
128
|
+
}
|
|
129
|
+
function target(page, input) {
|
|
130
|
+
if (input.label !== void 0 && input.role === void 0 && input.name === void 0)
|
|
131
|
+
return page.getByLabel(input.label, { exact: !0 });
|
|
132
|
+
if (input.role && input.label === void 0)
|
|
133
|
+
return page.getByRole(input.role, { name: input.name, exact: !0 });
|
|
134
|
+
throw new Error("Specify role with optional exact name, or label alone. Inspect the page to find a target.");
|
|
135
|
+
}
|
|
136
|
+
async function uniqueTarget(page, input) {
|
|
137
|
+
let locator = target(page, input), count = await locator.count();
|
|
138
|
+
if (count !== 1)
|
|
139
|
+
throw new Error(`Target matched ${count} elements. Inspect and choose a unique exact role/name or label; no action was taken.`);
|
|
140
|
+
return locator;
|
|
141
|
+
}
|
|
142
|
+
var BrowserSession = class {
|
|
143
|
+
resources;
|
|
144
|
+
queue = Promise.resolve();
|
|
145
|
+
closing = Promise.resolve();
|
|
146
|
+
generation = 0;
|
|
147
|
+
queued = 0;
|
|
148
|
+
idle;
|
|
149
|
+
allowPrivate;
|
|
150
|
+
idleMs;
|
|
151
|
+
constructor(allowPrivate = !1, idleMs = 3e5) {
|
|
152
|
+
this.allowPrivate = allowPrivate, this.idleMs = idleMs;
|
|
153
|
+
}
|
|
154
|
+
async close() {
|
|
155
|
+
this.generation++, clearTimeout(this.idle);
|
|
156
|
+
let pending = this.resources;
|
|
157
|
+
this.resources = void 0;
|
|
158
|
+
let previous = this.closing, closing = (async () => {
|
|
159
|
+
await previous;
|
|
160
|
+
let resources = await pending?.catch(() => {
|
|
161
|
+
});
|
|
162
|
+
if (resources)
|
|
163
|
+
try {
|
|
164
|
+
await resources.browser.close();
|
|
165
|
+
} finally {
|
|
166
|
+
await resources.proxy.close();
|
|
167
|
+
}
|
|
168
|
+
})();
|
|
169
|
+
return this.closing = closing.catch(() => {
|
|
170
|
+
}), closing;
|
|
171
|
+
}
|
|
172
|
+
async run(input, signal) {
|
|
173
|
+
if (this.queued >= 16)
|
|
174
|
+
throw new Error("Browser queue is full. Wait for the current operation.");
|
|
175
|
+
let generation = this.generation;
|
|
176
|
+
this.queued++;
|
|
177
|
+
let operation = this.queue.then(async () => {
|
|
178
|
+
if (signal?.aborted || generation !== this.generation)
|
|
179
|
+
throw new Error("Browser operation cancelled; navigate again in a new call.");
|
|
180
|
+
clearTimeout(this.idle);
|
|
181
|
+
let cancellation = new AbortController(), abort = () => {
|
|
182
|
+
cancellation.abort(), this.close().catch(() => {
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
signal?.addEventListener("abort", abort, { once: !0 });
|
|
186
|
+
let deadline = setTimeout(abort, 3e4);
|
|
187
|
+
try {
|
|
188
|
+
if (input.action === "close")
|
|
189
|
+
return await this.close(), {
|
|
190
|
+
content: [{ type: "text", text: "Browser closed; ephemeral cookies and tabs discarded." }],
|
|
191
|
+
details: { action: input.action }
|
|
192
|
+
};
|
|
193
|
+
if (await this.closing, signal?.aborted || generation !== this.generation)
|
|
194
|
+
throw new Error("Browser operation cancelled.");
|
|
195
|
+
if (!this.resources && input.action !== "navigate" && !(input.action === "tabs" && input.operation === "create"))
|
|
196
|
+
throw new Error("No browser is open. Use navigate or tabs/create first. Idle cleanup discards tabs after 5 minutes.");
|
|
197
|
+
this.resources ??= this.open().catch((error) => {
|
|
198
|
+
throw generation === this.generation && (this.resources = void 0), error;
|
|
199
|
+
});
|
|
200
|
+
let resources = await this.resources;
|
|
201
|
+
if (generation !== this.generation)
|
|
202
|
+
throw new Error("Browser operation cancelled.");
|
|
203
|
+
let content = await Promise.race([
|
|
204
|
+
this.perform(resources, input),
|
|
205
|
+
new Promise((_resolve, reject) => {
|
|
206
|
+
let cancelled = () => reject(new Error("Browser cancelled or exceeded 30s; browser closed. External effects may already have occurred."));
|
|
207
|
+
cancellation.signal.aborted ? cancelled() : cancellation.signal.addEventListener("abort", cancelled, { once: !0 });
|
|
208
|
+
})
|
|
209
|
+
]);
|
|
210
|
+
if (signal?.aborted || generation !== this.generation)
|
|
211
|
+
throw new Error("Browser operation cancelled; external effects may already have occurred. Inspect before retrying.");
|
|
212
|
+
return this.idle = setTimeout(() => {
|
|
213
|
+
this.close().catch(() => {
|
|
214
|
+
});
|
|
215
|
+
}, this.idleMs), this.idle.unref(), { content, details: { action: input.action } };
|
|
216
|
+
} catch (error) {
|
|
217
|
+
generation === this.generation && (this.idle = setTimeout(() => {
|
|
218
|
+
this.close().catch(() => {
|
|
219
|
+
});
|
|
220
|
+
}, this.idleMs), this.idle.unref());
|
|
221
|
+
let message = error instanceof Error ? error.message : String(error);
|
|
222
|
+
throw new Error(boundedBrowserText(message));
|
|
223
|
+
} finally {
|
|
224
|
+
clearTimeout(deadline), signal?.removeEventListener("abort", abort);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
this.queue = operation.catch(() => {
|
|
228
|
+
});
|
|
229
|
+
try {
|
|
230
|
+
return await operation;
|
|
231
|
+
} finally {
|
|
232
|
+
this.queued--;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async open() {
|
|
236
|
+
let proxy = await createBrowserProxy(this.allowPrivate), browser;
|
|
237
|
+
try {
|
|
238
|
+
let { chromium } = await import("playwright-core");
|
|
239
|
+
browser = await chromium.launch({
|
|
240
|
+
headless: !0,
|
|
241
|
+
timeout: 15e3,
|
|
242
|
+
chromiumSandbox: !0,
|
|
243
|
+
proxy: { server: proxy.url, bypass: "<-loopback>" },
|
|
244
|
+
args: ["--disable-quic", "--force-webrtc-ip-handling-policy=disable_non_proxied_udp"]
|
|
245
|
+
});
|
|
246
|
+
let context = await browser.newContext({
|
|
247
|
+
acceptDownloads: !1,
|
|
248
|
+
serviceWorkers: "block",
|
|
249
|
+
permissions: [],
|
|
250
|
+
viewport: { width: 1280, height: 800 }
|
|
251
|
+
});
|
|
252
|
+
context.setDefaultTimeout(1e4), context.setDefaultNavigationTimeout(15e3), await context.route("**/*", async (route) => {
|
|
253
|
+
try {
|
|
254
|
+
browserUrl(route.request().url()), await route.continue();
|
|
255
|
+
} catch {
|
|
256
|
+
await route.abort().catch(() => {
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}), await context.routeWebSocket("**/*", (socket) => socket.close());
|
|
260
|
+
let resources = { browser, context, proxy, pages: /* @__PURE__ */ new Map(), nextId: 1 };
|
|
261
|
+
return context.on("page", (page) => {
|
|
262
|
+
if (resources.pages.size >= 4) {
|
|
263
|
+
page.close().catch(() => {
|
|
264
|
+
});
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
let id = resources.nextId++;
|
|
268
|
+
resources.pages.set(id, page), page.on("close", () => resources.pages.delete(id)), page.on("dialog", (dialog) => {
|
|
269
|
+
dialog.dismiss().catch(() => {
|
|
270
|
+
});
|
|
271
|
+
}), page.on("download", (download) => {
|
|
272
|
+
download.cancel().catch(() => {
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
}), resources;
|
|
276
|
+
} catch (error) {
|
|
277
|
+
await browser?.close().catch(() => {
|
|
278
|
+
}), await proxy.close();
|
|
279
|
+
let message = error instanceof Error ? error.message : String(error);
|
|
280
|
+
throw new Error(`Browser launch failed. Matching Chromium may be missing after --ignore-scripts or offline installation. Ask the user to run lunr browser install when online. Nothing was installed by this call. ${message}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
async perform(resources, input) {
|
|
284
|
+
let text = (value) => [{ type: "text", text: boundedBrowserText(value) }], page = resources.pages.get(input.tab ?? resources.selected ?? -1);
|
|
285
|
+
if (input.action === "tabs") {
|
|
286
|
+
if (!input.operation)
|
|
287
|
+
throw new Error("tabs requires operation list/create/select/close.");
|
|
288
|
+
if (input.operation === "list")
|
|
289
|
+
return text(JSON.stringify([...resources.pages].map(([id, tab]) => ({
|
|
290
|
+
id,
|
|
291
|
+
selected: id === resources.selected,
|
|
292
|
+
url: tab.url()
|
|
293
|
+
}))));
|
|
294
|
+
if (input.operation === "select") {
|
|
295
|
+
if (!page || input.tab === void 0)
|
|
296
|
+
throw new Error("Select requires an existing tab id from tabs/list.");
|
|
297
|
+
return resources.selected = input.tab, text(`Selected tab ${input.tab}.`);
|
|
298
|
+
}
|
|
299
|
+
if (input.operation === "close") {
|
|
300
|
+
if (!page)
|
|
301
|
+
throw new Error("No matching tab. Use tabs/list.");
|
|
302
|
+
return await page.close(), resources.pages.has(resources.selected ?? -1) || (resources.selected = resources.pages.keys().next().value), text("Tab closed.");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (input.action === "navigate" || input.action === "tabs" && input.operation === "create") {
|
|
306
|
+
if (input.action === "navigate" && !input.url)
|
|
307
|
+
throw new Error("navigate requires url.");
|
|
308
|
+
let url = input.url ? browserUrl(input.url) : void 0;
|
|
309
|
+
if (url && await resolveBrowserHost(url.hostname, this.allowPrivate), input.tab !== void 0 && !page && input.action === "navigate")
|
|
310
|
+
throw new Error("Unknown tab. Use tabs/list.");
|
|
311
|
+
if (!page || input.action === "tabs") {
|
|
312
|
+
if (resources.pages.size >= 4)
|
|
313
|
+
throw new Error("Maximum 4 tabs. Close a tab first.");
|
|
314
|
+
page = await resources.context.newPage();
|
|
315
|
+
}
|
|
316
|
+
return resources.selected = [...resources.pages].find(([, candidate]) => candidate === page)?.[0], url && await page.goto(url.href, { waitUntil: "domcontentloaded" }), text(`Tab ${resources.selected}: ${page.url()}
|
|
317
|
+
Use inspect for rendered content.${resources.proxy.blockedReason() ? `
|
|
318
|
+
Network warning: ${resources.proxy.blockedReason()}` : ""}`);
|
|
319
|
+
}
|
|
320
|
+
if (!page)
|
|
321
|
+
throw new Error("No selected tab. Use tabs/list or navigate.");
|
|
322
|
+
if (input.action === "inspect") {
|
|
323
|
+
let locator = input.role || input.label !== void 0 ? await uniqueTarget(page, input) : page.locator("body");
|
|
324
|
+
return text(`Untrusted page content at ${page.url()}:
|
|
325
|
+
${await locator.ariaSnapshot()}`);
|
|
326
|
+
}
|
|
327
|
+
if (input.action === "screenshot") {
|
|
328
|
+
let image = await page.screenshot({ type: "jpeg", quality: 70, fullPage: !1, timeout: 1e4 });
|
|
329
|
+
if (image.length > 2 * 1024 * 1024)
|
|
330
|
+
throw new Error("Screenshot exceeds 2MB limit.");
|
|
331
|
+
return [
|
|
332
|
+
...text(`Untrusted viewport screenshot at ${page.url()}`),
|
|
333
|
+
{ type: "image", mimeType: "image/jpeg", data: image.toString("base64") }
|
|
334
|
+
];
|
|
335
|
+
}
|
|
336
|
+
if (input.action === "act") {
|
|
337
|
+
let locator = await uniqueTarget(page, input);
|
|
338
|
+
switch (input.interaction) {
|
|
339
|
+
case "click":
|
|
340
|
+
await locator.click();
|
|
341
|
+
break;
|
|
342
|
+
case "fill":
|
|
343
|
+
if (input.value === void 0)
|
|
344
|
+
throw new Error("fill requires value.");
|
|
345
|
+
await locator.fill(input.value);
|
|
346
|
+
break;
|
|
347
|
+
case "select":
|
|
348
|
+
if (input.value === void 0)
|
|
349
|
+
throw new Error("select requires option value.");
|
|
350
|
+
await locator.selectOption(input.value);
|
|
351
|
+
break;
|
|
352
|
+
case "check":
|
|
353
|
+
if (input.checked === void 0)
|
|
354
|
+
throw new Error("check requires checked.");
|
|
355
|
+
await locator.setChecked(input.checked);
|
|
356
|
+
break;
|
|
357
|
+
case "press":
|
|
358
|
+
if (!input.value || !/^(Enter|Tab|Escape|Space|Backspace|Delete|ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Home|End|PageUp|PageDown)$/.test(input.value))
|
|
359
|
+
throw new Error("press accepts Enter/Tab/Escape/Space/Backspace/Delete/arrows/Home/End/PageUp/PageDown only. Use fill for text.");
|
|
360
|
+
await locator.press(input.value);
|
|
361
|
+
break;
|
|
362
|
+
default:
|
|
363
|
+
throw new Error("act requires interaction click/fill/select/check/press.");
|
|
364
|
+
}
|
|
365
|
+
return text(`Interaction completed at ${page.url()}. Inspect to verify the result. External effects cannot be undone by /undo.`);
|
|
366
|
+
}
|
|
367
|
+
throw new Error("Unsupported browser action.");
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
export {
|
|
371
|
+
BrowserSession,
|
|
372
|
+
boundedBrowserText
|
|
373
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
bindRuntimeBridges
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-GMHJCCEN.js";
|
|
5
|
+
import "./chunk-4EULYYR4.js";
|
|
6
|
+
import "./chunk-UJOCPOMX.js";
|
|
7
|
+
import "./chunk-2TKODGBZ.js";
|
|
8
|
+
import "./chunk-2MI5OPMN.js";
|
|
9
|
+
import "./chunk-IMLCWLPI.js";
|
|
9
10
|
import "./chunk-BRJX2PRC.js";
|
|
10
11
|
export {
|
|
11
12
|
bindRuntimeBridges
|