@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
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
parseFrontmatter
|
|
10
10
|
} from "./chunk-QFWG2RVL.js";
|
|
11
|
+
import {
|
|
12
|
+
SettingsManager
|
|
13
|
+
} from "./chunk-WADV2VDS.js";
|
|
11
14
|
import {
|
|
12
15
|
minimatch
|
|
13
16
|
} from "./chunk-CGBXPL3E.js";
|
|
14
|
-
import {
|
|
15
|
-
SettingsManager
|
|
16
|
-
} from "./chunk-CBGB57XT.js";
|
|
17
17
|
import {
|
|
18
18
|
getGlobalInstructionsPath,
|
|
19
19
|
loadSelectedUserInstructions
|
|
@@ -23,9 +23,8 @@ import {
|
|
|
23
23
|
resetTimings
|
|
24
24
|
} from "./chunk-PVCDKGR6.js";
|
|
25
25
|
import {
|
|
26
|
-
loadThemeFromPath
|
|
27
|
-
|
|
28
|
-
} from "./chunk-RNBHABBA.js";
|
|
26
|
+
loadThemeFromPath
|
|
27
|
+
} from "./chunk-7QWNYZDI.js";
|
|
29
28
|
import {
|
|
30
29
|
CONFIG_DIR_NAME,
|
|
31
30
|
canonicalizePath,
|
|
@@ -6652,9 +6651,9 @@ var DefaultResourceLoader = class {
|
|
|
6652
6651
|
themesResult = { themes: deduped.themes, diagnostics: [...loaded.diagnostics, ...deduped.diagnostics] };
|
|
6653
6652
|
}
|
|
6654
6653
|
let resolvedThemes = this.themesOverride ? this.themesOverride(themesResult) : themesResult;
|
|
6655
|
-
this.themes = resolvedThemes.themes.map((
|
|
6656
|
-
let sourcePath =
|
|
6657
|
-
return
|
|
6654
|
+
this.themes = resolvedThemes.themes.map((theme) => {
|
|
6655
|
+
let sourcePath = theme.sourcePath;
|
|
6656
|
+
return theme.sourceInfo = sourcePath ? this.findSourceInfoForPath(sourcePath, this.extensionThemeSourceInfos, metadataByPath) ?? theme.sourceInfo ?? this.getDefaultSourceInfoForPath(sourcePath) : theme.sourceInfo, theme;
|
|
6658
6657
|
}), this.themeDiagnostics = resolvedThemes.diagnostics;
|
|
6659
6658
|
}
|
|
6660
6659
|
applyExtensionSourceInfo(extensions, metadataByPath) {
|
|
@@ -6878,667 +6877,6 @@ var DefaultResourceLoader = class {
|
|
|
6878
6877
|
}
|
|
6879
6878
|
};
|
|
6880
6879
|
|
|
6881
|
-
// packages/coding-agent/dist/core/extensions/runner.js
|
|
6882
|
-
var RESERVED_KEYBINDINGS_FOR_EXTENSION_CONFLICTS = [
|
|
6883
|
-
"app.interrupt",
|
|
6884
|
-
"app.clear",
|
|
6885
|
-
"app.exit",
|
|
6886
|
-
"app.suspend",
|
|
6887
|
-
"app.thinking.cycle",
|
|
6888
|
-
"app.mode.cycle",
|
|
6889
|
-
"app.model.cycleForward",
|
|
6890
|
-
"app.model.cycleBackward",
|
|
6891
|
-
"app.model.select",
|
|
6892
|
-
"app.tools.expand",
|
|
6893
|
-
"app.thinking.toggle",
|
|
6894
|
-
"app.editor.external",
|
|
6895
|
-
"app.message.copy",
|
|
6896
|
-
"app.message.followUp",
|
|
6897
|
-
"tui.input.submit",
|
|
6898
|
-
"tui.select.confirm",
|
|
6899
|
-
"tui.select.cancel",
|
|
6900
|
-
"tui.input.copy",
|
|
6901
|
-
"tui.editor.deleteToLineEnd"
|
|
6902
|
-
], buildBuiltinKeybindings = (resolvedKeybindings) => {
|
|
6903
|
-
let builtinKeybindings = {};
|
|
6904
|
-
for (let [keybinding, keys] of Object.entries(resolvedKeybindings)) {
|
|
6905
|
-
if (keys === void 0)
|
|
6906
|
-
continue;
|
|
6907
|
-
let keyList = Array.isArray(keys) ? keys : [keys], restrictOverride = RESERVED_KEYBINDINGS_FOR_EXTENSION_CONFLICTS.includes(keybinding);
|
|
6908
|
-
for (let key of keyList) {
|
|
6909
|
-
let normalizedKey = key.toLowerCase();
|
|
6910
|
-
builtinKeybindings[normalizedKey]?.restrictOverride && !restrictOverride || (builtinKeybindings[normalizedKey] = {
|
|
6911
|
-
keybinding,
|
|
6912
|
-
restrictOverride
|
|
6913
|
-
});
|
|
6914
|
-
}
|
|
6915
|
-
}
|
|
6916
|
-
return builtinKeybindings;
|
|
6917
|
-
};
|
|
6918
|
-
async function emitSessionShutdownEvent(extensionRunner, event) {
|
|
6919
|
-
return extensionRunner.hasHandlers("session_shutdown") ? (await extensionRunner.emit(event), !0) : !1;
|
|
6920
|
-
}
|
|
6921
|
-
async function emitProjectTrustEvent(extensionsResult, event, ctx) {
|
|
6922
|
-
let errors = [];
|
|
6923
|
-
for (let ext of extensionsResult.extensions) {
|
|
6924
|
-
let handlers = ext.handlers.get("project_trust");
|
|
6925
|
-
if (!(!handlers || handlers.length === 0))
|
|
6926
|
-
for (let handler of handlers)
|
|
6927
|
-
try {
|
|
6928
|
-
let handlerResult = await handler(event, ctx);
|
|
6929
|
-
if (handlerResult.trusted === "undecided")
|
|
6930
|
-
continue;
|
|
6931
|
-
return { result: handlerResult, errors };
|
|
6932
|
-
} catch (error) {
|
|
6933
|
-
errors.push({
|
|
6934
|
-
extensionPath: ext.path,
|
|
6935
|
-
event: event.type,
|
|
6936
|
-
error: error instanceof Error ? error.message : String(error),
|
|
6937
|
-
stack: error instanceof Error ? error.stack : void 0
|
|
6938
|
-
});
|
|
6939
|
-
}
|
|
6940
|
-
}
|
|
6941
|
-
return { errors };
|
|
6942
|
-
}
|
|
6943
|
-
var noOpUIContext = {
|
|
6944
|
-
select: async () => {
|
|
6945
|
-
},
|
|
6946
|
-
confirm: async () => !1,
|
|
6947
|
-
input: async () => {
|
|
6948
|
-
},
|
|
6949
|
-
notify: () => {
|
|
6950
|
-
},
|
|
6951
|
-
onTerminalInput: () => () => {
|
|
6952
|
-
},
|
|
6953
|
-
setStatus: () => {
|
|
6954
|
-
},
|
|
6955
|
-
setWorkingMessage: () => {
|
|
6956
|
-
},
|
|
6957
|
-
setWorkingVisible: () => {
|
|
6958
|
-
},
|
|
6959
|
-
setWorkingIndicator: () => {
|
|
6960
|
-
},
|
|
6961
|
-
setHiddenThinkingLabel: () => {
|
|
6962
|
-
},
|
|
6963
|
-
setWidget: () => {
|
|
6964
|
-
},
|
|
6965
|
-
setFooter: () => {
|
|
6966
|
-
},
|
|
6967
|
-
setHeader: () => {
|
|
6968
|
-
},
|
|
6969
|
-
setTitle: () => {
|
|
6970
|
-
},
|
|
6971
|
-
custom: async () => {
|
|
6972
|
-
},
|
|
6973
|
-
pasteToEditor: () => {
|
|
6974
|
-
},
|
|
6975
|
-
setEditorText: () => {
|
|
6976
|
-
},
|
|
6977
|
-
getEditorText: () => "",
|
|
6978
|
-
editor: async () => {
|
|
6979
|
-
},
|
|
6980
|
-
addAutocompleteProvider: () => {
|
|
6981
|
-
},
|
|
6982
|
-
setEditorComponent: () => {
|
|
6983
|
-
},
|
|
6984
|
-
getEditorComponent: () => {
|
|
6985
|
-
},
|
|
6986
|
-
get theme() {
|
|
6987
|
-
return theme;
|
|
6988
|
-
},
|
|
6989
|
-
getAllThemes: () => [],
|
|
6990
|
-
getTheme: () => {
|
|
6991
|
-
},
|
|
6992
|
-
setTheme: (_theme) => ({ success: !1, error: "UI not available" }),
|
|
6993
|
-
getToolsExpanded: () => !1,
|
|
6994
|
-
setToolsExpanded: () => {
|
|
6995
|
-
}
|
|
6996
|
-
}, ExtensionRunner = class {
|
|
6997
|
-
extensions;
|
|
6998
|
-
runtime;
|
|
6999
|
-
uiContext;
|
|
7000
|
-
mode = "print";
|
|
7001
|
-
cwd;
|
|
7002
|
-
sessionManager;
|
|
7003
|
-
modelRegistry;
|
|
7004
|
-
errorListeners = /* @__PURE__ */ new Set();
|
|
7005
|
-
getModel = () => {
|
|
7006
|
-
};
|
|
7007
|
-
isIdleFn = () => !0;
|
|
7008
|
-
isProjectTrustedFn = () => !0;
|
|
7009
|
-
getSignalFn = () => {
|
|
7010
|
-
};
|
|
7011
|
-
waitForIdleFn = async () => {
|
|
7012
|
-
};
|
|
7013
|
-
abortFn = () => {
|
|
7014
|
-
};
|
|
7015
|
-
hasPendingMessagesFn = () => !1;
|
|
7016
|
-
getContextUsageFn = () => {
|
|
7017
|
-
};
|
|
7018
|
-
compactFn = () => {
|
|
7019
|
-
};
|
|
7020
|
-
getSystemPromptFn = () => "";
|
|
7021
|
-
getSystemPromptOptionsFn = () => ({ cwd: this.cwd });
|
|
7022
|
-
newSessionHandler = async () => ({ cancelled: !1 });
|
|
7023
|
-
forkHandler = async () => ({ cancelled: !1 });
|
|
7024
|
-
navigateTreeHandler = async () => ({ cancelled: !1 });
|
|
7025
|
-
switchSessionHandler = async () => ({ cancelled: !1 });
|
|
7026
|
-
reloadHandler = async () => {
|
|
7027
|
-
};
|
|
7028
|
-
shutdownHandler = () => {
|
|
7029
|
-
};
|
|
7030
|
-
shortcutDiagnostics = [];
|
|
7031
|
-
commandDiagnostics = [];
|
|
7032
|
-
staleMessage;
|
|
7033
|
-
constructor(extensions, runtime, cwd, sessionManager, modelRegistry) {
|
|
7034
|
-
this.extensions = extensions, this.runtime = runtime, this.uiContext = noOpUIContext, this.cwd = cwd, this.sessionManager = sessionManager, this.modelRegistry = modelRegistry;
|
|
7035
|
-
}
|
|
7036
|
-
bindCore(actions, contextActions, providerActions) {
|
|
7037
|
-
this.runtime.sendMessage = actions.sendMessage, this.runtime.sendUserMessage = actions.sendUserMessage, this.runtime.appendEntry = actions.appendEntry, this.runtime.setSessionName = actions.setSessionName, this.runtime.getSessionName = actions.getSessionName, this.runtime.setLabel = actions.setLabel, this.runtime.getActiveTools = actions.getActiveTools, this.runtime.getAllTools = actions.getAllTools, this.runtime.setActiveTools = actions.setActiveTools, this.runtime.refreshTools = actions.refreshTools, this.runtime.getCommands = actions.getCommands, this.runtime.setModel = actions.setModel, this.runtime.getThinkingLevel = actions.getThinkingLevel, this.runtime.setThinkingLevel = actions.setThinkingLevel, this.getModel = contextActions.getModel, this.isIdleFn = contextActions.isIdle, this.isProjectTrustedFn = contextActions.isProjectTrusted, this.getSignalFn = contextActions.getSignal, this.abortFn = contextActions.abort, this.hasPendingMessagesFn = contextActions.hasPendingMessages, this.shutdownHandler = contextActions.shutdown, this.getContextUsageFn = contextActions.getContextUsage, this.compactFn = contextActions.compact, this.getSystemPromptFn = contextActions.getSystemPrompt, this.getSystemPromptOptionsFn = contextActions.getSystemPromptOptions ?? (() => ({ cwd: this.cwd }));
|
|
7038
|
-
for (let { name, config, extensionPath } of this.runtime.pendingProviderRegistrations)
|
|
7039
|
-
try {
|
|
7040
|
-
providerActions?.registerProvider ? providerActions.registerProvider(name, config) : this.modelRegistry.registerProvider(name, config);
|
|
7041
|
-
} catch (err) {
|
|
7042
|
-
this.emitError({
|
|
7043
|
-
extensionPath,
|
|
7044
|
-
event: "register_provider",
|
|
7045
|
-
error: err instanceof Error ? err.message : String(err),
|
|
7046
|
-
stack: err instanceof Error ? err.stack : void 0
|
|
7047
|
-
});
|
|
7048
|
-
}
|
|
7049
|
-
this.runtime.pendingProviderRegistrations = [], this.runtime.registerProvider = (name, config) => {
|
|
7050
|
-
if (providerActions?.registerProvider) {
|
|
7051
|
-
providerActions.registerProvider(name, config);
|
|
7052
|
-
return;
|
|
7053
|
-
}
|
|
7054
|
-
this.modelRegistry.registerProvider(name, config);
|
|
7055
|
-
}, this.runtime.unregisterProvider = (name) => {
|
|
7056
|
-
if (providerActions?.unregisterProvider) {
|
|
7057
|
-
providerActions.unregisterProvider(name);
|
|
7058
|
-
return;
|
|
7059
|
-
}
|
|
7060
|
-
this.modelRegistry.unregisterProvider(name);
|
|
7061
|
-
};
|
|
7062
|
-
}
|
|
7063
|
-
bindCommandContext(actions) {
|
|
7064
|
-
if (actions) {
|
|
7065
|
-
this.waitForIdleFn = actions.waitForIdle, this.newSessionHandler = actions.newSession, this.forkHandler = actions.fork, this.navigateTreeHandler = actions.navigateTree, this.switchSessionHandler = actions.switchSession, this.reloadHandler = actions.reload;
|
|
7066
|
-
return;
|
|
7067
|
-
}
|
|
7068
|
-
this.waitForIdleFn = async () => {
|
|
7069
|
-
}, this.newSessionHandler = async () => ({ cancelled: !1 }), this.forkHandler = async () => ({ cancelled: !1 }), this.navigateTreeHandler = async () => ({ cancelled: !1 }), this.switchSessionHandler = async () => ({ cancelled: !1 }), this.reloadHandler = async () => {
|
|
7070
|
-
};
|
|
7071
|
-
}
|
|
7072
|
-
setUIContext(uiContext, mode = "print") {
|
|
7073
|
-
this.uiContext = uiContext ?? noOpUIContext, this.mode = mode;
|
|
7074
|
-
}
|
|
7075
|
-
getUIContext() {
|
|
7076
|
-
return this.uiContext;
|
|
7077
|
-
}
|
|
7078
|
-
hasUI() {
|
|
7079
|
-
return this.uiContext !== noOpUIContext;
|
|
7080
|
-
}
|
|
7081
|
-
getExtensionPaths() {
|
|
7082
|
-
return this.extensions.map((e) => e.path);
|
|
7083
|
-
}
|
|
7084
|
-
/** Append already-loaded extensions to this runner. Bindings stay on the existing runtime. */
|
|
7085
|
-
appendExtensions(extensions) {
|
|
7086
|
-
let existing = new Set(this.extensions), existingPaths = new Set(this.extensions.map((extension) => extension.path));
|
|
7087
|
-
for (let extension of extensions)
|
|
7088
|
-
existing.has(extension) || existingPaths.has(extension.path) || (this.extensions.push(extension), existing.add(extension), existingPaths.add(extension.path));
|
|
7089
|
-
}
|
|
7090
|
-
/** Get all registered tools from all extensions (first registration per name wins). */
|
|
7091
|
-
getAllRegisteredTools() {
|
|
7092
|
-
let toolsByName = /* @__PURE__ */ new Map();
|
|
7093
|
-
for (let ext of this.extensions)
|
|
7094
|
-
for (let tool of ext.tools.values())
|
|
7095
|
-
toolsByName.has(tool.definition.name) || toolsByName.set(tool.definition.name, tool);
|
|
7096
|
-
return Array.from(toolsByName.values());
|
|
7097
|
-
}
|
|
7098
|
-
/** Get a tool definition by name. Returns undefined if not found. */
|
|
7099
|
-
getToolDefinition(toolName) {
|
|
7100
|
-
for (let ext of this.extensions) {
|
|
7101
|
-
let tool = ext.tools.get(toolName);
|
|
7102
|
-
if (tool)
|
|
7103
|
-
return tool.definition;
|
|
7104
|
-
}
|
|
7105
|
-
}
|
|
7106
|
-
getFlags() {
|
|
7107
|
-
let allFlags = /* @__PURE__ */ new Map();
|
|
7108
|
-
for (let ext of this.extensions)
|
|
7109
|
-
for (let [name, flag] of ext.flags)
|
|
7110
|
-
allFlags.has(name) || allFlags.set(name, flag);
|
|
7111
|
-
return allFlags;
|
|
7112
|
-
}
|
|
7113
|
-
setFlagValue(name, value) {
|
|
7114
|
-
this.runtime.flagValues.set(name, value);
|
|
7115
|
-
}
|
|
7116
|
-
getFlagValues() {
|
|
7117
|
-
return new Map(this.runtime.flagValues);
|
|
7118
|
-
}
|
|
7119
|
-
getShortcuts(resolvedKeybindings) {
|
|
7120
|
-
this.shortcutDiagnostics = [];
|
|
7121
|
-
let builtinKeybindings = buildBuiltinKeybindings(resolvedKeybindings), extensionShortcuts = /* @__PURE__ */ new Map(), addDiagnostic = (message, extensionPath) => {
|
|
7122
|
-
this.shortcutDiagnostics.push({ type: "warning", message, path: extensionPath }), this.hasUI() || console.warn(message);
|
|
7123
|
-
};
|
|
7124
|
-
for (let ext of this.extensions)
|
|
7125
|
-
for (let [key, shortcut] of ext.shortcuts) {
|
|
7126
|
-
let normalizedKey = key.toLowerCase(), builtInKeybinding = builtinKeybindings[normalizedKey];
|
|
7127
|
-
if (builtInKeybinding?.restrictOverride === !0) {
|
|
7128
|
-
addDiagnostic(`Extension shortcut '${key}' from ${shortcut.extensionPath} conflicts with built-in shortcut. Skipping.`, shortcut.extensionPath);
|
|
7129
|
-
continue;
|
|
7130
|
-
}
|
|
7131
|
-
builtInKeybinding?.restrictOverride === !1 && addDiagnostic(`Extension shortcut conflict: '${key}' is built-in shortcut for ${builtInKeybinding.keybinding} and ${shortcut.extensionPath}. Using ${shortcut.extensionPath}.`, shortcut.extensionPath);
|
|
7132
|
-
let existingExtensionShortcut = extensionShortcuts.get(normalizedKey);
|
|
7133
|
-
existingExtensionShortcut && addDiagnostic(`Extension shortcut conflict: '${key}' registered by both ${existingExtensionShortcut.extensionPath} and ${shortcut.extensionPath}. Using ${shortcut.extensionPath}.`, shortcut.extensionPath), extensionShortcuts.set(normalizedKey, shortcut);
|
|
7134
|
-
}
|
|
7135
|
-
return extensionShortcuts;
|
|
7136
|
-
}
|
|
7137
|
-
getShortcutDiagnostics() {
|
|
7138
|
-
return this.shortcutDiagnostics;
|
|
7139
|
-
}
|
|
7140
|
-
invalidate(message = "This extension ctx is stale after session replacement or reload. Do not use a captured pi or command ctx after ctx.newSession(), ctx.fork(), ctx.switchSession(), or ctx.reload(). For newSession, fork, and switchSession, move post-replacement work into withSession and use the ctx passed to withSession. For reload, do not use the old ctx after await ctx.reload().") {
|
|
7141
|
-
this.staleMessage || (this.staleMessage = message, this.runtime.invalidate(message));
|
|
7142
|
-
}
|
|
7143
|
-
assertActive() {
|
|
7144
|
-
if (this.staleMessage)
|
|
7145
|
-
throw new Error(this.staleMessage);
|
|
7146
|
-
}
|
|
7147
|
-
onError(listener) {
|
|
7148
|
-
return this.errorListeners.add(listener), () => this.errorListeners.delete(listener);
|
|
7149
|
-
}
|
|
7150
|
-
emitError(error) {
|
|
7151
|
-
for (let listener of this.errorListeners)
|
|
7152
|
-
listener(error);
|
|
7153
|
-
}
|
|
7154
|
-
hasHandlers(eventType) {
|
|
7155
|
-
for (let ext of this.extensions) {
|
|
7156
|
-
let handlers = ext.handlers.get(eventType);
|
|
7157
|
-
if (handlers && handlers.length > 0)
|
|
7158
|
-
return !0;
|
|
7159
|
-
}
|
|
7160
|
-
return !1;
|
|
7161
|
-
}
|
|
7162
|
-
getMessageRenderer(customType) {
|
|
7163
|
-
for (let ext of this.extensions) {
|
|
7164
|
-
let renderer = ext.messageRenderers.get(customType);
|
|
7165
|
-
if (renderer)
|
|
7166
|
-
return renderer;
|
|
7167
|
-
}
|
|
7168
|
-
}
|
|
7169
|
-
getEntryRenderer(customType) {
|
|
7170
|
-
for (let ext of this.extensions) {
|
|
7171
|
-
let renderer = ext.entryRenderers?.get(customType);
|
|
7172
|
-
if (renderer)
|
|
7173
|
-
return renderer;
|
|
7174
|
-
}
|
|
7175
|
-
}
|
|
7176
|
-
resolveRegisteredCommands() {
|
|
7177
|
-
let commands = [], counts = /* @__PURE__ */ new Map();
|
|
7178
|
-
for (let ext of this.extensions)
|
|
7179
|
-
for (let command of ext.commands.values())
|
|
7180
|
-
commands.push(command), counts.set(command.name, (counts.get(command.name) ?? 0) + 1);
|
|
7181
|
-
let seen = /* @__PURE__ */ new Map(), takenInvocationNames = /* @__PURE__ */ new Set();
|
|
7182
|
-
return commands.map((command) => {
|
|
7183
|
-
let occurrence = (seen.get(command.name) ?? 0) + 1;
|
|
7184
|
-
seen.set(command.name, occurrence);
|
|
7185
|
-
let invocationName = (counts.get(command.name) ?? 0) > 1 ? `${command.name}:${occurrence}` : command.name;
|
|
7186
|
-
if (takenInvocationNames.has(invocationName)) {
|
|
7187
|
-
let suffix = occurrence;
|
|
7188
|
-
do
|
|
7189
|
-
suffix++, invocationName = `${command.name}:${suffix}`;
|
|
7190
|
-
while (takenInvocationNames.has(invocationName));
|
|
7191
|
-
}
|
|
7192
|
-
return takenInvocationNames.add(invocationName), {
|
|
7193
|
-
...command,
|
|
7194
|
-
invocationName
|
|
7195
|
-
};
|
|
7196
|
-
});
|
|
7197
|
-
}
|
|
7198
|
-
getModelRegistry() {
|
|
7199
|
-
return this.modelRegistry;
|
|
7200
|
-
}
|
|
7201
|
-
getRegisteredCommands() {
|
|
7202
|
-
return this.commandDiagnostics = [], this.resolveRegisteredCommands();
|
|
7203
|
-
}
|
|
7204
|
-
getCommandDiagnostics() {
|
|
7205
|
-
return this.commandDiagnostics;
|
|
7206
|
-
}
|
|
7207
|
-
getCommand(name) {
|
|
7208
|
-
return this.resolveRegisteredCommands().find((command) => command.invocationName === name);
|
|
7209
|
-
}
|
|
7210
|
-
/**
|
|
7211
|
-
* Request a graceful shutdown. Called by extension tools and event handlers.
|
|
7212
|
-
* The actual shutdown behavior is provided by the mode via bindExtensions().
|
|
7213
|
-
*/
|
|
7214
|
-
shutdown() {
|
|
7215
|
-
this.shutdownHandler();
|
|
7216
|
-
}
|
|
7217
|
-
getActiveTools() {
|
|
7218
|
-
return this.assertActive(), this.runtime.getActiveTools();
|
|
7219
|
-
}
|
|
7220
|
-
/**
|
|
7221
|
-
* Create an ExtensionContext for use in event handlers and tool execution.
|
|
7222
|
-
* Context values are resolved at call time, so changes via bindCore/bindUI are reflected.
|
|
7223
|
-
*/
|
|
7224
|
-
createContext() {
|
|
7225
|
-
let runner = this, getModel = this.getModel;
|
|
7226
|
-
return {
|
|
7227
|
-
get ui() {
|
|
7228
|
-
return runner.assertActive(), runner.uiContext;
|
|
7229
|
-
},
|
|
7230
|
-
get mode() {
|
|
7231
|
-
return runner.assertActive(), runner.mode;
|
|
7232
|
-
},
|
|
7233
|
-
get hasUI() {
|
|
7234
|
-
return runner.assertActive(), runner.hasUI();
|
|
7235
|
-
},
|
|
7236
|
-
get cwd() {
|
|
7237
|
-
return runner.assertActive(), runner.cwd;
|
|
7238
|
-
},
|
|
7239
|
-
get sessionManager() {
|
|
7240
|
-
return runner.assertActive(), runner.sessionManager;
|
|
7241
|
-
},
|
|
7242
|
-
get modelRegistry() {
|
|
7243
|
-
return runner.assertActive(), runner.modelRegistry;
|
|
7244
|
-
},
|
|
7245
|
-
get model() {
|
|
7246
|
-
return runner.assertActive(), getModel();
|
|
7247
|
-
},
|
|
7248
|
-
isIdle: () => (runner.assertActive(), runner.isIdleFn()),
|
|
7249
|
-
isProjectTrusted: () => (runner.assertActive(), runner.isProjectTrustedFn()),
|
|
7250
|
-
get signal() {
|
|
7251
|
-
return runner.assertActive(), runner.getSignalFn();
|
|
7252
|
-
},
|
|
7253
|
-
abort: () => {
|
|
7254
|
-
runner.assertActive(), runner.abortFn();
|
|
7255
|
-
},
|
|
7256
|
-
hasPendingMessages: () => (runner.assertActive(), runner.hasPendingMessagesFn()),
|
|
7257
|
-
shutdown: () => {
|
|
7258
|
-
runner.assertActive(), runner.shutdownHandler();
|
|
7259
|
-
},
|
|
7260
|
-
getContextUsage: () => (runner.assertActive(), runner.getContextUsageFn()),
|
|
7261
|
-
compact: (options) => {
|
|
7262
|
-
runner.assertActive(), runner.compactFn(options);
|
|
7263
|
-
},
|
|
7264
|
-
getSystemPrompt: () => (runner.assertActive(), runner.getSystemPromptFn())
|
|
7265
|
-
};
|
|
7266
|
-
}
|
|
7267
|
-
createCommandContext() {
|
|
7268
|
-
let context = Object.defineProperties({}, Object.getOwnPropertyDescriptors(this.createContext()));
|
|
7269
|
-
return context.getSystemPromptOptions = () => (this.assertActive(), this.getSystemPromptOptionsFn()), context.waitForIdle = () => (this.assertActive(), this.waitForIdleFn()), context.newSession = (options) => (this.assertActive(), this.newSessionHandler(options)), context.fork = (entryId, options) => (this.assertActive(), this.forkHandler(entryId, options)), context.navigateTree = (targetId, options) => (this.assertActive(), this.navigateTreeHandler(targetId, options)), context.switchSession = (sessionPath, options) => (this.assertActive(), this.switchSessionHandler(sessionPath, options)), context.reload = () => (this.assertActive(), this.reloadHandler()), context;
|
|
7270
|
-
}
|
|
7271
|
-
isSessionBeforeEvent(event) {
|
|
7272
|
-
return event.type === "session_before_switch" || event.type === "session_before_fork" || event.type === "session_before_compact" || event.type === "session_before_tree";
|
|
7273
|
-
}
|
|
7274
|
-
async emit(event) {
|
|
7275
|
-
let ctx = this.createContext(), result;
|
|
7276
|
-
for (let ext of this.extensions) {
|
|
7277
|
-
let handlers = ext.handlers.get(event.type);
|
|
7278
|
-
if (!(!handlers || handlers.length === 0))
|
|
7279
|
-
for (let handler of handlers)
|
|
7280
|
-
try {
|
|
7281
|
-
let handlerResult = await handler(event, ctx);
|
|
7282
|
-
if (this.isSessionBeforeEvent(event) && handlerResult && (result = handlerResult, result.cancel))
|
|
7283
|
-
return result;
|
|
7284
|
-
} catch (err) {
|
|
7285
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7286
|
-
this.emitError({
|
|
7287
|
-
extensionPath: ext.path,
|
|
7288
|
-
event: event.type,
|
|
7289
|
-
error: message,
|
|
7290
|
-
stack
|
|
7291
|
-
});
|
|
7292
|
-
}
|
|
7293
|
-
}
|
|
7294
|
-
return result;
|
|
7295
|
-
}
|
|
7296
|
-
async emitMessageEnd(event) {
|
|
7297
|
-
let ctx = this.createContext(), currentMessage = event.message, modified = !1;
|
|
7298
|
-
for (let ext of this.extensions) {
|
|
7299
|
-
let handlers = ext.handlers.get("message_end");
|
|
7300
|
-
if (!(!handlers || handlers.length === 0))
|
|
7301
|
-
for (let handler of handlers)
|
|
7302
|
-
try {
|
|
7303
|
-
let currentEvent = { ...event, message: currentMessage }, handlerResult = await handler(currentEvent, ctx);
|
|
7304
|
-
if (!handlerResult?.message)
|
|
7305
|
-
continue;
|
|
7306
|
-
if (handlerResult.message.role !== currentMessage.role) {
|
|
7307
|
-
this.emitError({
|
|
7308
|
-
extensionPath: ext.path,
|
|
7309
|
-
event: "message_end",
|
|
7310
|
-
error: "message_end handlers must return a message with the same role"
|
|
7311
|
-
});
|
|
7312
|
-
continue;
|
|
7313
|
-
}
|
|
7314
|
-
currentMessage = handlerResult.message, modified = !0;
|
|
7315
|
-
} catch (err) {
|
|
7316
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7317
|
-
this.emitError({
|
|
7318
|
-
extensionPath: ext.path,
|
|
7319
|
-
event: "message_end",
|
|
7320
|
-
error: message,
|
|
7321
|
-
stack
|
|
7322
|
-
});
|
|
7323
|
-
}
|
|
7324
|
-
}
|
|
7325
|
-
return modified ? currentMessage : void 0;
|
|
7326
|
-
}
|
|
7327
|
-
async emitToolResult(event) {
|
|
7328
|
-
let ctx = this.createContext(), currentEvent = { ...event }, modified = !1;
|
|
7329
|
-
for (let ext of this.extensions) {
|
|
7330
|
-
let handlers = ext.handlers.get("tool_result");
|
|
7331
|
-
if (!(!handlers || handlers.length === 0))
|
|
7332
|
-
for (let handler of handlers)
|
|
7333
|
-
try {
|
|
7334
|
-
let handlerResult = await handler(currentEvent, ctx);
|
|
7335
|
-
if (!handlerResult)
|
|
7336
|
-
continue;
|
|
7337
|
-
handlerResult.content !== void 0 && (currentEvent.content = handlerResult.content, modified = !0), handlerResult.details !== void 0 && (currentEvent.details = handlerResult.details, modified = !0), handlerResult.isError !== void 0 && (currentEvent.isError = handlerResult.isError, modified = !0);
|
|
7338
|
-
} catch (err) {
|
|
7339
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7340
|
-
this.emitError({
|
|
7341
|
-
extensionPath: ext.path,
|
|
7342
|
-
event: "tool_result",
|
|
7343
|
-
error: message,
|
|
7344
|
-
stack
|
|
7345
|
-
});
|
|
7346
|
-
}
|
|
7347
|
-
}
|
|
7348
|
-
if (modified)
|
|
7349
|
-
return {
|
|
7350
|
-
content: currentEvent.content,
|
|
7351
|
-
details: currentEvent.details,
|
|
7352
|
-
isError: currentEvent.isError
|
|
7353
|
-
};
|
|
7354
|
-
}
|
|
7355
|
-
async emitToolCall(event) {
|
|
7356
|
-
let ctx = this.createContext(), result;
|
|
7357
|
-
for (let ext of this.extensions) {
|
|
7358
|
-
let handlers = ext.handlers.get("tool_call");
|
|
7359
|
-
if (!(!handlers || handlers.length === 0))
|
|
7360
|
-
for (let handler of handlers) {
|
|
7361
|
-
let handlerResult = await handler(event, ctx);
|
|
7362
|
-
if (handlerResult && (result = handlerResult, result.block))
|
|
7363
|
-
return result;
|
|
7364
|
-
}
|
|
7365
|
-
}
|
|
7366
|
-
return result;
|
|
7367
|
-
}
|
|
7368
|
-
async emitUserBash(event) {
|
|
7369
|
-
let ctx = this.createContext();
|
|
7370
|
-
for (let ext of this.extensions) {
|
|
7371
|
-
let handlers = ext.handlers.get("user_bash");
|
|
7372
|
-
if (!(!handlers || handlers.length === 0))
|
|
7373
|
-
for (let handler of handlers)
|
|
7374
|
-
try {
|
|
7375
|
-
let handlerResult = await handler(event, ctx);
|
|
7376
|
-
if (handlerResult)
|
|
7377
|
-
return handlerResult;
|
|
7378
|
-
} catch (err) {
|
|
7379
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7380
|
-
this.emitError({
|
|
7381
|
-
extensionPath: ext.path,
|
|
7382
|
-
event: "user_bash",
|
|
7383
|
-
error: message,
|
|
7384
|
-
stack
|
|
7385
|
-
});
|
|
7386
|
-
}
|
|
7387
|
-
}
|
|
7388
|
-
}
|
|
7389
|
-
async emitContext(messages) {
|
|
7390
|
-
let ctx = this.createContext(), currentMessages = structuredClone(messages);
|
|
7391
|
-
for (let ext of this.extensions) {
|
|
7392
|
-
let handlers = ext.handlers.get("context");
|
|
7393
|
-
if (!(!handlers || handlers.length === 0))
|
|
7394
|
-
for (let handler of handlers)
|
|
7395
|
-
try {
|
|
7396
|
-
let handlerResult = await handler({ type: "context", messages: currentMessages }, ctx);
|
|
7397
|
-
handlerResult && handlerResult.messages && (currentMessages = handlerResult.messages);
|
|
7398
|
-
} catch (err) {
|
|
7399
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7400
|
-
this.emitError({
|
|
7401
|
-
extensionPath: ext.path,
|
|
7402
|
-
event: "context",
|
|
7403
|
-
error: message,
|
|
7404
|
-
stack
|
|
7405
|
-
});
|
|
7406
|
-
}
|
|
7407
|
-
}
|
|
7408
|
-
return currentMessages;
|
|
7409
|
-
}
|
|
7410
|
-
async emitBeforeProviderRequest(payload) {
|
|
7411
|
-
let ctx = this.createContext(), currentPayload = payload;
|
|
7412
|
-
for (let ext of this.extensions) {
|
|
7413
|
-
let handlers = ext.handlers.get("before_provider_request");
|
|
7414
|
-
if (!(!handlers || handlers.length === 0))
|
|
7415
|
-
for (let handler of handlers)
|
|
7416
|
-
try {
|
|
7417
|
-
let handlerResult = await handler({
|
|
7418
|
-
type: "before_provider_request",
|
|
7419
|
-
payload: currentPayload
|
|
7420
|
-
}, ctx);
|
|
7421
|
-
handlerResult !== void 0 && (currentPayload = handlerResult);
|
|
7422
|
-
} catch (err) {
|
|
7423
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7424
|
-
this.emitError({
|
|
7425
|
-
extensionPath: ext.path,
|
|
7426
|
-
event: "before_provider_request",
|
|
7427
|
-
error: message,
|
|
7428
|
-
stack
|
|
7429
|
-
});
|
|
7430
|
-
}
|
|
7431
|
-
}
|
|
7432
|
-
return currentPayload;
|
|
7433
|
-
}
|
|
7434
|
-
async emitBeforeProviderHeaders(headers) {
|
|
7435
|
-
let ctx = this.createContext();
|
|
7436
|
-
for (let ext of this.extensions) {
|
|
7437
|
-
let handlers = ext.handlers.get("before_provider_headers");
|
|
7438
|
-
if (!(!handlers || handlers.length === 0))
|
|
7439
|
-
for (let handler of handlers)
|
|
7440
|
-
try {
|
|
7441
|
-
await handler({
|
|
7442
|
-
type: "before_provider_headers",
|
|
7443
|
-
headers
|
|
7444
|
-
}, ctx);
|
|
7445
|
-
} catch (err) {
|
|
7446
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7447
|
-
this.emitError({
|
|
7448
|
-
extensionPath: ext.path,
|
|
7449
|
-
event: "before_provider_headers",
|
|
7450
|
-
error: message,
|
|
7451
|
-
stack
|
|
7452
|
-
});
|
|
7453
|
-
}
|
|
7454
|
-
}
|
|
7455
|
-
return headers;
|
|
7456
|
-
}
|
|
7457
|
-
async emitBeforeAgentStart(prompt, images, systemPrompt, systemPromptOptions) {
|
|
7458
|
-
let currentSystemPrompt = systemPrompt, ctx = Object.defineProperties({}, Object.getOwnPropertyDescriptors(this.createContext()));
|
|
7459
|
-
ctx.getSystemPrompt = () => (this.assertActive(), currentSystemPrompt);
|
|
7460
|
-
let messages = [], systemPromptModified = !1;
|
|
7461
|
-
for (let ext of this.extensions) {
|
|
7462
|
-
let handlers = ext.handlers.get("before_agent_start");
|
|
7463
|
-
if (!(!handlers || handlers.length === 0))
|
|
7464
|
-
for (let handler of handlers)
|
|
7465
|
-
try {
|
|
7466
|
-
let handlerResult = await handler({
|
|
7467
|
-
type: "before_agent_start",
|
|
7468
|
-
prompt,
|
|
7469
|
-
images,
|
|
7470
|
-
systemPrompt: currentSystemPrompt,
|
|
7471
|
-
systemPromptOptions
|
|
7472
|
-
}, ctx);
|
|
7473
|
-
if (handlerResult) {
|
|
7474
|
-
let result = handlerResult;
|
|
7475
|
-
result.message && messages.push(result.message), result.systemPrompt !== void 0 && (currentSystemPrompt = result.systemPrompt, systemPromptModified = !0);
|
|
7476
|
-
}
|
|
7477
|
-
} catch (err) {
|
|
7478
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7479
|
-
this.emitError({
|
|
7480
|
-
extensionPath: ext.path,
|
|
7481
|
-
event: "before_agent_start",
|
|
7482
|
-
error: message,
|
|
7483
|
-
stack
|
|
7484
|
-
});
|
|
7485
|
-
}
|
|
7486
|
-
}
|
|
7487
|
-
if (messages.length > 0 || systemPromptModified)
|
|
7488
|
-
return {
|
|
7489
|
-
messages: messages.length > 0 ? messages : void 0,
|
|
7490
|
-
systemPrompt: systemPromptModified ? currentSystemPrompt : void 0
|
|
7491
|
-
};
|
|
7492
|
-
}
|
|
7493
|
-
async emitResourcesDiscover(cwd, reason) {
|
|
7494
|
-
let ctx = this.createContext(), skillPaths = [], promptPaths = [], themePaths = [];
|
|
7495
|
-
for (let ext of this.extensions) {
|
|
7496
|
-
let handlers = ext.handlers.get("resources_discover");
|
|
7497
|
-
if (!(!handlers || handlers.length === 0))
|
|
7498
|
-
for (let handler of handlers)
|
|
7499
|
-
try {
|
|
7500
|
-
let result = await handler({ type: "resources_discover", cwd, reason }, ctx);
|
|
7501
|
-
result?.skillPaths?.length && skillPaths.push(...result.skillPaths.map((path2) => ({ path: path2, extensionPath: ext.path }))), result?.promptPaths?.length && promptPaths.push(...result.promptPaths.map((path2) => ({ path: path2, extensionPath: ext.path }))), result?.themePaths?.length && themePaths.push(...result.themePaths.map((path2) => ({ path: path2, extensionPath: ext.path })));
|
|
7502
|
-
} catch (err) {
|
|
7503
|
-
let message = err instanceof Error ? err.message : String(err), stack = err instanceof Error ? err.stack : void 0;
|
|
7504
|
-
this.emitError({
|
|
7505
|
-
extensionPath: ext.path,
|
|
7506
|
-
event: "resources_discover",
|
|
7507
|
-
error: message,
|
|
7508
|
-
stack
|
|
7509
|
-
});
|
|
7510
|
-
}
|
|
7511
|
-
}
|
|
7512
|
-
return { skillPaths, promptPaths, themePaths };
|
|
7513
|
-
}
|
|
7514
|
-
/** Emit input event. Transforms chain, "handled" short-circuits. */
|
|
7515
|
-
async emitInput(text, images, source, streamingBehavior) {
|
|
7516
|
-
let ctx = this.createContext(), currentText = text, currentImages = images;
|
|
7517
|
-
for (let ext of this.extensions)
|
|
7518
|
-
for (let handler of ext.handlers.get("input") ?? [])
|
|
7519
|
-
try {
|
|
7520
|
-
let result = await handler({
|
|
7521
|
-
type: "input",
|
|
7522
|
-
text: currentText,
|
|
7523
|
-
images: currentImages,
|
|
7524
|
-
source,
|
|
7525
|
-
streamingBehavior
|
|
7526
|
-
}, ctx);
|
|
7527
|
-
if (result?.action === "handled")
|
|
7528
|
-
return result;
|
|
7529
|
-
result?.action === "transform" && (currentText = result.text, currentImages = result.images ?? currentImages);
|
|
7530
|
-
} catch (err) {
|
|
7531
|
-
this.emitError({
|
|
7532
|
-
extensionPath: ext.path,
|
|
7533
|
-
event: "input",
|
|
7534
|
-
error: err instanceof Error ? err.message : String(err),
|
|
7535
|
-
stack: err instanceof Error ? err.stack : void 0
|
|
7536
|
-
});
|
|
7537
|
-
}
|
|
7538
|
-
return currentText !== text || currentImages !== images ? { action: "transform", text: currentText, images: currentImages } : { action: "continue" };
|
|
7539
|
-
}
|
|
7540
|
-
};
|
|
7541
|
-
|
|
7542
6880
|
export {
|
|
7543
6881
|
createEventBus,
|
|
7544
6882
|
createSyntheticSourceInfo,
|
|
@@ -7551,8 +6889,5 @@ export {
|
|
|
7551
6889
|
formatSkillsForPrompt,
|
|
7552
6890
|
loadSkills,
|
|
7553
6891
|
loadProjectContextFiles,
|
|
7554
|
-
DefaultResourceLoader
|
|
7555
|
-
emitSessionShutdownEvent,
|
|
7556
|
-
emitProjectTrustEvent,
|
|
7557
|
-
ExtensionRunner
|
|
6892
|
+
DefaultResourceLoader
|
|
7558
6893
|
};
|