orient-cli 0.3.1 → 0.3.3
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/dist/cli.js +0 -0
- package/dist/integrations/notebooklm/notebooklm-extension.js +3 -8
- package/dist/integrations/notebooklm/notebooklm-extension.js.map +1 -1
- package/dist/integrations/playwright/playwright-extension.js +3 -11
- package/dist/integrations/playwright/playwright-extension.js.map +1 -1
- package/dist/integrations/web-search/bridge.js.map +1 -1
- package/dist/integrations/web-search/web-search-extension.js +0 -3
- package/dist/integrations/web-search/web-search-extension.js.map +1 -1
- package/dist/orient/orient-extension.js +4 -12
- package/dist/orient/orient-extension.js.map +1 -1
- package/package.json +1 -1
- package/vendor/@orient-cli/coding-agent/README.md +618 -0
- package/vendor/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/bun/cli.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/args.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/args.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/config-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/file-processor.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/list-models.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli/session-picker.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/cli.js +0 -0
- package/vendor/@orient-cli/coding-agent/dist/cli.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/config.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/config.js +23 -1
- package/vendor/@orient-cli/coding-agent/dist/config.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +0 -5
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.d.ts +32 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.js +47 -67
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +4 -0
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.js +4 -8
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/bash-executor.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/event-bus.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/exec.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/exec.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/index.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.js +18 -24
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/types.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.js +14 -15
- package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.d.ts +116 -116
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.js +0 -1
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/messages.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/messages.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/model-registry.js +8 -8
- package/vendor/@orient-cli/coding-agent/dist/core/model-registry.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/model-resolver.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/output-guard.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/package-manager.js +0 -6
- package/vendor/@orient-cli/coding-agent/dist/core/package-manager.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.js +0 -39
- package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/sdk.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.js +0 -1
- package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/session-manager.js +7 -11
- package/vendor/@orient-cli/coding-agent/dist/core/session-manager.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.js +7 -16
- package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/skills.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/skills.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/source-info.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/system-prompt.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/timings.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/timings.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.js +8 -5
- package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/find.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/grep.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/index.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/ls.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/read.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/write.js +0 -1
- package/vendor/@orient-cli/coding-agent/dist/core/tools/write.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/main.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/main.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/migrations.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/migrations.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +0 -5
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +4 -9
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +0 -3
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +1 -3
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +1 -3
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +6 -15
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +0 -5
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +1 -8
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +1 -6
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +0 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +1 -6
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +2 -8
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +1 -8
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +1 -3
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +3 -9
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +8 -20
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +2 -7
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +9 -13
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +33 -58
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +0 -2
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +0 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +1 -3
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +0 -2
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +0 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +9 -22
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +18 -32
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +3 -6
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +14 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +59 -84
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +0 -6
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/print-mode.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +6 -7
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/package-manager-cli.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/changelog.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/child-process.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/git.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/git.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/image-convert.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/image-resize.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/mime.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/paths.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/photon.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/shell.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/sleep.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +1 -1
- package/vendor/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +1 -1
- package/vendor/@orient-cli/coding-agent/docs/compaction.md +394 -0
- package/vendor/@orient-cli/coding-agent/docs/custom-provider.md +596 -0
- package/vendor/@orient-cli/coding-agent/docs/development.md +71 -0
- package/vendor/@orient-cli/coding-agent/docs/extensions.md +2262 -0
- package/vendor/@orient-cli/coding-agent/docs/images/doom-extension.png +0 -0
- package/vendor/@orient-cli/coding-agent/docs/images/exy.png +0 -0
- package/vendor/@orient-cli/coding-agent/docs/images/interactive-mode.png +0 -0
- package/vendor/@orient-cli/coding-agent/docs/images/tree-view.png +0 -0
- package/vendor/@orient-cli/coding-agent/docs/json.md +82 -0
- package/vendor/@orient-cli/coding-agent/docs/keybindings.md +175 -0
- package/vendor/@orient-cli/coding-agent/docs/models.md +392 -0
- package/vendor/@orient-cli/coding-agent/docs/packages.md +218 -0
- package/vendor/@orient-cli/coding-agent/docs/prompt-templates.md +67 -0
- package/vendor/@orient-cli/coding-agent/docs/providers.md +195 -0
- package/vendor/@orient-cli/coding-agent/docs/rpc.md +1377 -0
- package/vendor/@orient-cli/coding-agent/docs/sdk.md +1124 -0
- package/vendor/@orient-cli/coding-agent/docs/session.md +412 -0
- package/vendor/@orient-cli/coding-agent/docs/settings.md +246 -0
- package/vendor/@orient-cli/coding-agent/docs/shell-aliases.md +13 -0
- package/vendor/@orient-cli/coding-agent/docs/skills.md +232 -0
- package/vendor/@orient-cli/coding-agent/docs/terminal-setup.md +106 -0
- package/vendor/@orient-cli/coding-agent/docs/termux.md +127 -0
- package/vendor/@orient-cli/coding-agent/docs/themes.md +295 -0
- package/vendor/@orient-cli/coding-agent/docs/tmux.md +61 -0
- package/vendor/@orient-cli/coding-agent/docs/tree.md +231 -0
- package/vendor/@orient-cli/coding-agent/docs/tui.md +887 -0
- package/vendor/@orient-cli/coding-agent/docs/windows.md +17 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/template.js +0 -1690
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/vendor/highlight.min.js +0 -1213
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/vendor/marked.min.js +0 -6
|
@@ -36,6 +36,122 @@ declare module "@orient-cli/tui" {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
export declare const KEYBINDINGS: {
|
|
39
|
+
readonly "app.interrupt": {
|
|
40
|
+
readonly defaultKeys: "escape";
|
|
41
|
+
readonly description: "Cancel or abort";
|
|
42
|
+
};
|
|
43
|
+
readonly "app.clear": {
|
|
44
|
+
readonly defaultKeys: "ctrl+c";
|
|
45
|
+
readonly description: "Clear editor";
|
|
46
|
+
};
|
|
47
|
+
readonly "app.exit": {
|
|
48
|
+
readonly defaultKeys: "ctrl+d";
|
|
49
|
+
readonly description: "Exit when editor is empty";
|
|
50
|
+
};
|
|
51
|
+
readonly "app.suspend": {
|
|
52
|
+
readonly defaultKeys: "ctrl+z";
|
|
53
|
+
readonly description: "Suspend to background";
|
|
54
|
+
};
|
|
55
|
+
readonly "app.mode.toggle": {
|
|
56
|
+
readonly defaultKeys: "shift+tab";
|
|
57
|
+
readonly description: "Toggle Plan ↔ Execute mode (ORIENT dual-mode)";
|
|
58
|
+
};
|
|
59
|
+
readonly "app.thinking.cycle": {
|
|
60
|
+
readonly defaultKeys: "alt+t";
|
|
61
|
+
readonly description: "Cycle thinking level";
|
|
62
|
+
};
|
|
63
|
+
readonly "app.model.cycleForward": {
|
|
64
|
+
readonly defaultKeys: "ctrl+p";
|
|
65
|
+
readonly description: "Cycle to next model";
|
|
66
|
+
};
|
|
67
|
+
readonly "app.model.cycleBackward": {
|
|
68
|
+
readonly defaultKeys: "shift+ctrl+p";
|
|
69
|
+
readonly description: "Cycle to previous model";
|
|
70
|
+
};
|
|
71
|
+
readonly "app.model.select": {
|
|
72
|
+
readonly defaultKeys: "ctrl+l";
|
|
73
|
+
readonly description: "Open model selector";
|
|
74
|
+
};
|
|
75
|
+
readonly "app.tools.expand": {
|
|
76
|
+
readonly defaultKeys: "ctrl+o";
|
|
77
|
+
readonly description: "Toggle tool output";
|
|
78
|
+
};
|
|
79
|
+
readonly "app.thinking.toggle": {
|
|
80
|
+
readonly defaultKeys: "ctrl+t";
|
|
81
|
+
readonly description: "Toggle thinking blocks";
|
|
82
|
+
};
|
|
83
|
+
readonly "app.session.toggleNamedFilter": {
|
|
84
|
+
readonly defaultKeys: "ctrl+n";
|
|
85
|
+
readonly description: "Toggle named session filter";
|
|
86
|
+
};
|
|
87
|
+
readonly "app.editor.external": {
|
|
88
|
+
readonly defaultKeys: "ctrl+g";
|
|
89
|
+
readonly description: "Open external editor";
|
|
90
|
+
};
|
|
91
|
+
readonly "app.message.followUp": {
|
|
92
|
+
readonly defaultKeys: "alt+enter";
|
|
93
|
+
readonly description: "Queue follow-up message";
|
|
94
|
+
};
|
|
95
|
+
readonly "app.message.dequeue": {
|
|
96
|
+
readonly defaultKeys: "alt+up";
|
|
97
|
+
readonly description: "Restore queued messages";
|
|
98
|
+
};
|
|
99
|
+
readonly "app.clipboard.pasteImage": {
|
|
100
|
+
readonly defaultKeys: "ctrl+v" | "alt+v";
|
|
101
|
+
readonly description: "Paste image from clipboard";
|
|
102
|
+
};
|
|
103
|
+
readonly "app.session.new": {
|
|
104
|
+
readonly defaultKeys: [];
|
|
105
|
+
readonly description: "Start a new session";
|
|
106
|
+
};
|
|
107
|
+
readonly "app.session.tree": {
|
|
108
|
+
readonly defaultKeys: [];
|
|
109
|
+
readonly description: "Open session tree";
|
|
110
|
+
};
|
|
111
|
+
readonly "app.session.fork": {
|
|
112
|
+
readonly defaultKeys: [];
|
|
113
|
+
readonly description: "Fork current session";
|
|
114
|
+
};
|
|
115
|
+
readonly "app.session.resume": {
|
|
116
|
+
readonly defaultKeys: [];
|
|
117
|
+
readonly description: "Resume a session";
|
|
118
|
+
};
|
|
119
|
+
readonly "app.tree.foldOrUp": {
|
|
120
|
+
readonly defaultKeys: ["ctrl+left", "alt+left"];
|
|
121
|
+
readonly description: "Fold tree branch or move up";
|
|
122
|
+
};
|
|
123
|
+
readonly "app.tree.unfoldOrDown": {
|
|
124
|
+
readonly defaultKeys: ["ctrl+right", "alt+right"];
|
|
125
|
+
readonly description: "Unfold tree branch or move down";
|
|
126
|
+
};
|
|
127
|
+
readonly "app.tree.editLabel": {
|
|
128
|
+
readonly defaultKeys: "shift+l";
|
|
129
|
+
readonly description: "Edit tree label";
|
|
130
|
+
};
|
|
131
|
+
readonly "app.tree.toggleLabelTimestamp": {
|
|
132
|
+
readonly defaultKeys: "shift+t";
|
|
133
|
+
readonly description: "Toggle tree label timestamps";
|
|
134
|
+
};
|
|
135
|
+
readonly "app.session.togglePath": {
|
|
136
|
+
readonly defaultKeys: "ctrl+p";
|
|
137
|
+
readonly description: "Toggle session path display";
|
|
138
|
+
};
|
|
139
|
+
readonly "app.session.toggleSort": {
|
|
140
|
+
readonly defaultKeys: "ctrl+s";
|
|
141
|
+
readonly description: "Toggle session sort mode";
|
|
142
|
+
};
|
|
143
|
+
readonly "app.session.rename": {
|
|
144
|
+
readonly defaultKeys: "ctrl+r";
|
|
145
|
+
readonly description: "Rename session";
|
|
146
|
+
};
|
|
147
|
+
readonly "app.session.delete": {
|
|
148
|
+
readonly defaultKeys: "ctrl+d";
|
|
149
|
+
readonly description: "Delete session";
|
|
150
|
+
};
|
|
151
|
+
readonly "app.session.deleteNoninvasive": {
|
|
152
|
+
readonly defaultKeys: "ctrl+backspace";
|
|
153
|
+
readonly description: "Delete session when query is empty";
|
|
154
|
+
};
|
|
39
155
|
readonly "tui.editor.cursorUp": {
|
|
40
156
|
readonly defaultKeys: "up";
|
|
41
157
|
readonly description: "Move cursor up";
|
|
@@ -160,122 +276,6 @@ export declare const KEYBINDINGS: {
|
|
|
160
276
|
readonly defaultKeys: ["escape", "ctrl+c"];
|
|
161
277
|
readonly description: "Cancel selection";
|
|
162
278
|
};
|
|
163
|
-
readonly "app.interrupt": {
|
|
164
|
-
readonly defaultKeys: "escape";
|
|
165
|
-
readonly description: "Cancel or abort";
|
|
166
|
-
};
|
|
167
|
-
readonly "app.clear": {
|
|
168
|
-
readonly defaultKeys: "ctrl+c";
|
|
169
|
-
readonly description: "Clear editor";
|
|
170
|
-
};
|
|
171
|
-
readonly "app.exit": {
|
|
172
|
-
readonly defaultKeys: "ctrl+d";
|
|
173
|
-
readonly description: "Exit when editor is empty";
|
|
174
|
-
};
|
|
175
|
-
readonly "app.suspend": {
|
|
176
|
-
readonly defaultKeys: "ctrl+z";
|
|
177
|
-
readonly description: "Suspend to background";
|
|
178
|
-
};
|
|
179
|
-
readonly "app.mode.toggle": {
|
|
180
|
-
readonly defaultKeys: "shift+tab";
|
|
181
|
-
readonly description: "Toggle Plan ↔ Execute mode (ORIENT dual-mode)";
|
|
182
|
-
};
|
|
183
|
-
readonly "app.thinking.cycle": {
|
|
184
|
-
readonly defaultKeys: "alt+t";
|
|
185
|
-
readonly description: "Cycle thinking level";
|
|
186
|
-
};
|
|
187
|
-
readonly "app.model.cycleForward": {
|
|
188
|
-
readonly defaultKeys: "ctrl+p";
|
|
189
|
-
readonly description: "Cycle to next model";
|
|
190
|
-
};
|
|
191
|
-
readonly "app.model.cycleBackward": {
|
|
192
|
-
readonly defaultKeys: "shift+ctrl+p";
|
|
193
|
-
readonly description: "Cycle to previous model";
|
|
194
|
-
};
|
|
195
|
-
readonly "app.model.select": {
|
|
196
|
-
readonly defaultKeys: "ctrl+l";
|
|
197
|
-
readonly description: "Open model selector";
|
|
198
|
-
};
|
|
199
|
-
readonly "app.tools.expand": {
|
|
200
|
-
readonly defaultKeys: "ctrl+o";
|
|
201
|
-
readonly description: "Toggle tool output";
|
|
202
|
-
};
|
|
203
|
-
readonly "app.thinking.toggle": {
|
|
204
|
-
readonly defaultKeys: "ctrl+t";
|
|
205
|
-
readonly description: "Toggle thinking blocks";
|
|
206
|
-
};
|
|
207
|
-
readonly "app.session.toggleNamedFilter": {
|
|
208
|
-
readonly defaultKeys: "ctrl+n";
|
|
209
|
-
readonly description: "Toggle named session filter";
|
|
210
|
-
};
|
|
211
|
-
readonly "app.editor.external": {
|
|
212
|
-
readonly defaultKeys: "ctrl+g";
|
|
213
|
-
readonly description: "Open external editor";
|
|
214
|
-
};
|
|
215
|
-
readonly "app.message.followUp": {
|
|
216
|
-
readonly defaultKeys: "alt+enter";
|
|
217
|
-
readonly description: "Queue follow-up message";
|
|
218
|
-
};
|
|
219
|
-
readonly "app.message.dequeue": {
|
|
220
|
-
readonly defaultKeys: "alt+up";
|
|
221
|
-
readonly description: "Restore queued messages";
|
|
222
|
-
};
|
|
223
|
-
readonly "app.clipboard.pasteImage": {
|
|
224
|
-
readonly defaultKeys: "alt+v" | "ctrl+v";
|
|
225
|
-
readonly description: "Paste image from clipboard";
|
|
226
|
-
};
|
|
227
|
-
readonly "app.session.new": {
|
|
228
|
-
readonly defaultKeys: [];
|
|
229
|
-
readonly description: "Start a new session";
|
|
230
|
-
};
|
|
231
|
-
readonly "app.session.tree": {
|
|
232
|
-
readonly defaultKeys: [];
|
|
233
|
-
readonly description: "Open session tree";
|
|
234
|
-
};
|
|
235
|
-
readonly "app.session.fork": {
|
|
236
|
-
readonly defaultKeys: [];
|
|
237
|
-
readonly description: "Fork current session";
|
|
238
|
-
};
|
|
239
|
-
readonly "app.session.resume": {
|
|
240
|
-
readonly defaultKeys: [];
|
|
241
|
-
readonly description: "Resume a session";
|
|
242
|
-
};
|
|
243
|
-
readonly "app.tree.foldOrUp": {
|
|
244
|
-
readonly defaultKeys: ["ctrl+left", "alt+left"];
|
|
245
|
-
readonly description: "Fold tree branch or move up";
|
|
246
|
-
};
|
|
247
|
-
readonly "app.tree.unfoldOrDown": {
|
|
248
|
-
readonly defaultKeys: ["ctrl+right", "alt+right"];
|
|
249
|
-
readonly description: "Unfold tree branch or move down";
|
|
250
|
-
};
|
|
251
|
-
readonly "app.tree.editLabel": {
|
|
252
|
-
readonly defaultKeys: "shift+l";
|
|
253
|
-
readonly description: "Edit tree label";
|
|
254
|
-
};
|
|
255
|
-
readonly "app.tree.toggleLabelTimestamp": {
|
|
256
|
-
readonly defaultKeys: "shift+t";
|
|
257
|
-
readonly description: "Toggle tree label timestamps";
|
|
258
|
-
};
|
|
259
|
-
readonly "app.session.togglePath": {
|
|
260
|
-
readonly defaultKeys: "ctrl+p";
|
|
261
|
-
readonly description: "Toggle session path display";
|
|
262
|
-
};
|
|
263
|
-
readonly "app.session.toggleSort": {
|
|
264
|
-
readonly defaultKeys: "ctrl+s";
|
|
265
|
-
readonly description: "Toggle session sort mode";
|
|
266
|
-
};
|
|
267
|
-
readonly "app.session.rename": {
|
|
268
|
-
readonly defaultKeys: "ctrl+r";
|
|
269
|
-
readonly description: "Rename session";
|
|
270
|
-
};
|
|
271
|
-
readonly "app.session.delete": {
|
|
272
|
-
readonly defaultKeys: "ctrl+d";
|
|
273
|
-
readonly description: "Delete session";
|
|
274
|
-
};
|
|
275
|
-
readonly "app.session.deleteNoninvasive": {
|
|
276
|
-
readonly defaultKeys: "ctrl+backspace";
|
|
277
|
-
readonly description: "Delete session when query is empty";
|
|
278
|
-
};
|
|
279
279
|
};
|
|
280
280
|
export declare function migrateKeybindingsConfig(rawConfig: Record<string, unknown>): {
|
|
281
281
|
config: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keybindings.d.ts","sourceRoot":"","sources":["../../src/core/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EAEf,KAAK,iBAAiB,EACtB,KAAK,KAAK,EAEV,kBAAkB,IAAI,qBAAqB,EAC3C,MAAM,iBAAiB,CAAC;AAKzB,MAAM,WAAW,cAAc;IAC9B,eAAe,EAAE,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;IACjB,aAAa,EAAE,IAAI,CAAC;IACpB,iBAAiB,EAAE,IAAI,CAAC;IACxB,oBAAoB,EAAE,IAAI,CAAC;IAC3B,wBAAwB,EAAE,IAAI,CAAC;IAC/B,yBAAyB,EAAE,IAAI,CAAC;IAChC,kBAAkB,EAAE,IAAI,CAAC;IACzB,kBAAkB,EAAE,IAAI,CAAC;IACzB,qBAAqB,EAAE,IAAI,CAAC;IAC5B,+BAA+B,EAAE,IAAI,CAAC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AAa,kBAAmB,SAAQ,qBAAqB;IAC5D,OAAO,CAAC,UAAU,CAAqB;IAEvC,YAAY,YAAY,GAAE,iBAAsB,EAAE,UAAU,CAAC,EAAE,MAAM,EAGpE;IAED,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAE,MAAsB,GAAG,kBAAkB,CAIlE;IAED,MAAM,IAAI,IAAI,CAGb;IAED,kBAAkB,IAAI,iBAAiB,CAEtC;IAED,OAAO,CAAC,MAAM,CAAC,YAAY;CAK3B;AAED,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import {\n\ttype Keybinding,\n\ttype KeybindingDefinitions,\n\ttype KeybindingsConfig,\n\ttype KeyId,\n\tTUI_KEYBINDINGS,\n\tKeybindingsManager as TuiKeybindingsManager,\n} from \"@orient-cli/tui\";\nimport { existsSync, readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { getAgentDir } from \"../config.js\";\n\nexport interface AppKeybindings {\n\t\"app.interrupt\": true;\n\t\"app.clear\": true;\n\t\"app.exit\": true;\n\t\"app.suspend\": true;\n\t\"app.mode.toggle\": true;\n\t\"app.thinking.cycle\": true;\n\t\"app.model.cycleForward\": true;\n\t\"app.model.cycleBackward\": true;\n\t\"app.model.select\": true;\n\t\"app.tools.expand\": true;\n\t\"app.thinking.toggle\": true;\n\t\"app.session.toggleNamedFilter\": true;\n\t\"app.editor.external\": true;\n\t\"app.message.followUp\": true;\n\t\"app.message.dequeue\": true;\n\t\"app.clipboard.pasteImage\": true;\n\t\"app.session.new\": true;\n\t\"app.session.tree\": true;\n\t\"app.session.fork\": true;\n\t\"app.session.resume\": true;\n\t\"app.tree.foldOrUp\": true;\n\t\"app.tree.unfoldOrDown\": true;\n\t\"app.tree.editLabel\": true;\n\t\"app.tree.toggleLabelTimestamp\": true;\n\t\"app.session.togglePath\": true;\n\t\"app.session.toggleSort\": true;\n\t\"app.session.rename\": true;\n\t\"app.session.delete\": true;\n\t\"app.session.deleteNoninvasive\": true;\n}\n\nexport type AppKeybinding = keyof AppKeybindings;\n\ndeclare module \"@orient-cli/tui\" {\n\tinterface Keybindings extends AppKeybindings {}\n}\n\nexport const KEYBINDINGS = {\n\t...TUI_KEYBINDINGS,\n\t\"app.interrupt\": { defaultKeys: \"escape\", description: \"Cancel or abort\" },\n\t\"app.clear\": { defaultKeys: \"ctrl+c\", description: \"Clear editor\" },\n\t\"app.exit\": { defaultKeys: \"ctrl+d\", description: \"Exit when editor is empty\" },\n\t\"app.suspend\": { defaultKeys: \"ctrl+z\", description: \"Suspend to background\" },\n\t\"app.mode.toggle\": {\n\t\tdefaultKeys: \"shift+tab\",\n\t\tdescription: \"Toggle Plan ↔ Execute mode (ORIENT dual-mode)\",\n\t},\n\t\"app.thinking.cycle\": {\n\t\t// Rebound from shift+tab → alt+t in the ORIENT rebrand so the\n\t\t// openclaude/opencode/Claude-Code convention of shift+tab = mode\n\t\t// cycle applies here too. The thinking level picker is still\n\t\t// reachable via the settings selector.\n\t\tdefaultKeys: \"alt+t\",\n\t\tdescription: \"Cycle thinking level\",\n\t},\n\t\"app.model.cycleForward\": {\n\t\tdefaultKeys: \"ctrl+p\",\n\t\tdescription: \"Cycle to next model\",\n\t},\n\t\"app.model.cycleBackward\": {\n\t\tdefaultKeys: \"shift+ctrl+p\",\n\t\tdescription: \"Cycle to previous model\",\n\t},\n\t\"app.model.select\": { defaultKeys: \"ctrl+l\", description: \"Open model selector\" },\n\t\"app.tools.expand\": { defaultKeys: \"ctrl+o\", description: \"Toggle tool output\" },\n\t\"app.thinking.toggle\": {\n\t\tdefaultKeys: \"ctrl+t\",\n\t\tdescription: \"Toggle thinking blocks\",\n\t},\n\t\"app.session.toggleNamedFilter\": {\n\t\tdefaultKeys: \"ctrl+n\",\n\t\tdescription: \"Toggle named session filter\",\n\t},\n\t\"app.editor.external\": {\n\t\tdefaultKeys: \"ctrl+g\",\n\t\tdescription: \"Open external editor\",\n\t},\n\t\"app.message.followUp\": {\n\t\tdefaultKeys: \"alt+enter\",\n\t\tdescription: \"Queue follow-up message\",\n\t},\n\t\"app.message.dequeue\": {\n\t\tdefaultKeys: \"alt+up\",\n\t\tdescription: \"Restore queued messages\",\n\t},\n\t\"app.clipboard.pasteImage\": {\n\t\tdefaultKeys: process.platform === \"win32\" ? \"alt+v\" : \"ctrl+v\",\n\t\tdescription: \"Paste image from clipboard\",\n\t},\n\t\"app.session.new\": { defaultKeys: [], description: \"Start a new session\" },\n\t\"app.session.tree\": { defaultKeys: [], description: \"Open session tree\" },\n\t\"app.session.fork\": { defaultKeys: [], description: \"Fork current session\" },\n\t\"app.session.resume\": { defaultKeys: [], description: \"Resume a session\" },\n\t\"app.tree.foldOrUp\": {\n\t\tdefaultKeys: [\"ctrl+left\", \"alt+left\"],\n\t\tdescription: \"Fold tree branch or move up\",\n\t},\n\t\"app.tree.unfoldOrDown\": {\n\t\tdefaultKeys: [\"ctrl+right\", \"alt+right\"],\n\t\tdescription: \"Unfold tree branch or move down\",\n\t},\n\t\"app.tree.editLabel\": {\n\t\tdefaultKeys: \"shift+l\",\n\t\tdescription: \"Edit tree label\",\n\t},\n\t\"app.tree.toggleLabelTimestamp\": {\n\t\tdefaultKeys: \"shift+t\",\n\t\tdescription: \"Toggle tree label timestamps\",\n\t},\n\t\"app.session.togglePath\": {\n\t\tdefaultKeys: \"ctrl+p\",\n\t\tdescription: \"Toggle session path display\",\n\t},\n\t\"app.session.toggleSort\": {\n\t\tdefaultKeys: \"ctrl+s\",\n\t\tdescription: \"Toggle session sort mode\",\n\t},\n\t\"app.session.rename\": {\n\t\tdefaultKeys: \"ctrl+r\",\n\t\tdescription: \"Rename session\",\n\t},\n\t\"app.session.delete\": {\n\t\tdefaultKeys: \"ctrl+d\",\n\t\tdescription: \"Delete session\",\n\t},\n\t\"app.session.deleteNoninvasive\": {\n\t\tdefaultKeys: \"ctrl+backspace\",\n\t\tdescription: \"Delete session when query is empty\",\n\t},\n} as const satisfies KeybindingDefinitions;\n\nconst KEYBINDING_NAME_MIGRATIONS = {\n\tcursorUp: \"tui.editor.cursorUp\",\n\tcursorDown: \"tui.editor.cursorDown\",\n\tcursorLeft: \"tui.editor.cursorLeft\",\n\tcursorRight: \"tui.editor.cursorRight\",\n\tcursorWordLeft: \"tui.editor.cursorWordLeft\",\n\tcursorWordRight: \"tui.editor.cursorWordRight\",\n\tcursorLineStart: \"tui.editor.cursorLineStart\",\n\tcursorLineEnd: \"tui.editor.cursorLineEnd\",\n\tjumpForward: \"tui.editor.jumpForward\",\n\tjumpBackward: \"tui.editor.jumpBackward\",\n\tpageUp: \"tui.editor.pageUp\",\n\tpageDown: \"tui.editor.pageDown\",\n\tdeleteCharBackward: \"tui.editor.deleteCharBackward\",\n\tdeleteCharForward: \"tui.editor.deleteCharForward\",\n\tdeleteWordBackward: \"tui.editor.deleteWordBackward\",\n\tdeleteWordForward: \"tui.editor.deleteWordForward\",\n\tdeleteToLineStart: \"tui.editor.deleteToLineStart\",\n\tdeleteToLineEnd: \"tui.editor.deleteToLineEnd\",\n\tyank: \"tui.editor.yank\",\n\tyankPop: \"tui.editor.yankPop\",\n\tundo: \"tui.editor.undo\",\n\tnewLine: \"tui.input.newLine\",\n\tsubmit: \"tui.input.submit\",\n\ttab: \"tui.input.tab\",\n\tcopy: \"tui.input.copy\",\n\tselectUp: \"tui.select.up\",\n\tselectDown: \"tui.select.down\",\n\tselectPageUp: \"tui.select.pageUp\",\n\tselectPageDown: \"tui.select.pageDown\",\n\tselectConfirm: \"tui.select.confirm\",\n\tselectCancel: \"tui.select.cancel\",\n\tinterrupt: \"app.interrupt\",\n\tclear: \"app.clear\",\n\texit: \"app.exit\",\n\tsuspend: \"app.suspend\",\n\tcycleThinkingLevel: \"app.thinking.cycle\",\n\tcycleModelForward: \"app.model.cycleForward\",\n\tcycleModelBackward: \"app.model.cycleBackward\",\n\tselectModel: \"app.model.select\",\n\texpandTools: \"app.tools.expand\",\n\ttoggleThinking: \"app.thinking.toggle\",\n\ttoggleSessionNamedFilter: \"app.session.toggleNamedFilter\",\n\texternalEditor: \"app.editor.external\",\n\tfollowUp: \"app.message.followUp\",\n\tdequeue: \"app.message.dequeue\",\n\tpasteImage: \"app.clipboard.pasteImage\",\n\tnewSession: \"app.session.new\",\n\ttree: \"app.session.tree\",\n\tfork: \"app.session.fork\",\n\tresume: \"app.session.resume\",\n\ttreeFoldOrUp: \"app.tree.foldOrUp\",\n\ttreeUnfoldOrDown: \"app.tree.unfoldOrDown\",\n\ttreeEditLabel: \"app.tree.editLabel\",\n\ttreeToggleLabelTimestamp: \"app.tree.toggleLabelTimestamp\",\n\ttoggleSessionPath: \"app.session.togglePath\",\n\ttoggleSessionSort: \"app.session.toggleSort\",\n\trenameSession: \"app.session.rename\",\n\tdeleteSession: \"app.session.delete\",\n\tdeleteSessionNoninvasive: \"app.session.deleteNoninvasive\",\n} as const satisfies Record<string, Keybinding>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isLegacyKeybindingName(key: string): key is keyof typeof KEYBINDING_NAME_MIGRATIONS {\n\treturn key in KEYBINDING_NAME_MIGRATIONS;\n}\n\nfunction toKeybindingsConfig(value: unknown): KeybindingsConfig {\n\tif (!isRecord(value)) return {};\n\n\tconst config: KeybindingsConfig = {};\n\tfor (const [key, binding] of Object.entries(value)) {\n\t\tif (typeof binding === \"string\") {\n\t\t\tconfig[key] = binding as KeyId;\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(binding) && binding.every((entry) => typeof entry === \"string\")) {\n\t\t\tconfig[key] = binding as KeyId[];\n\t\t}\n\t}\n\treturn config;\n}\n\nexport function migrateKeybindingsConfig(rawConfig: Record<string, unknown>): {\n\tconfig: Record<string, unknown>;\n\tmigrated: boolean;\n} {\n\tconst config: Record<string, unknown> = {};\n\tlet migrated = false;\n\n\tfor (const [key, value] of Object.entries(rawConfig)) {\n\t\tconst nextKey = isLegacyKeybindingName(key) ? KEYBINDING_NAME_MIGRATIONS[key] : key;\n\t\tif (nextKey !== key) {\n\t\t\tmigrated = true;\n\t\t}\n\t\tif (key !== nextKey && Object.hasOwn(rawConfig, nextKey)) {\n\t\t\tmigrated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconfig[nextKey] = value;\n\t}\n\n\treturn { config: orderKeybindingsConfig(config), migrated };\n}\n\nfunction orderKeybindingsConfig(config: Record<string, unknown>): Record<string, unknown> {\n\tconst ordered: Record<string, unknown> = {};\n\tfor (const keybinding of Object.keys(KEYBINDINGS)) {\n\t\tif (Object.hasOwn(config, keybinding)) {\n\t\t\tordered[keybinding] = config[keybinding];\n\t\t}\n\t}\n\n\tconst extras = Object.keys(config)\n\t\t.filter((key) => !Object.hasOwn(ordered, key))\n\t\t.sort();\n\tfor (const key of extras) {\n\t\tordered[key] = config[key];\n\t}\n\n\treturn ordered;\n}\n\nfunction loadRawConfig(path: string): Record<string, unknown> | undefined {\n\tif (!existsSync(path)) return undefined;\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(path, \"utf-8\")) as unknown;\n\t\treturn isRecord(parsed) ? parsed : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport class KeybindingsManager extends TuiKeybindingsManager {\n\tprivate configPath: string | undefined;\n\n\tconstructor(userBindings: KeybindingsConfig = {}, configPath?: string) {\n\t\tsuper(KEYBINDINGS, userBindings);\n\t\tthis.configPath = configPath;\n\t}\n\n\tstatic create(agentDir: string = getAgentDir()): KeybindingsManager {\n\t\tconst configPath = join(agentDir, \"keybindings.json\");\n\t\tconst userBindings = KeybindingsManager.loadFromFile(configPath);\n\t\treturn new KeybindingsManager(userBindings, configPath);\n\t}\n\n\treload(): void {\n\t\tif (!this.configPath) return;\n\t\tthis.setUserBindings(KeybindingsManager.loadFromFile(this.configPath));\n\t}\n\n\tgetEffectiveConfig(): KeybindingsConfig {\n\t\treturn this.getResolvedBindings();\n\t}\n\n\tprivate static loadFromFile(path: string): KeybindingsConfig {\n\t\tconst rawConfig = loadRawConfig(path);\n\t\tif (!rawConfig) return {};\n\t\treturn toKeybindingsConfig(migrateKeybindingsConfig(rawConfig).config);\n\t}\n}\n\nexport type { Keybinding, KeyId, KeybindingsConfig };\n"]}
|
|
1
|
+
{"version":3,"file":"keybindings.d.ts","sourceRoot":"","sources":["../../src/core/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EAEf,KAAK,iBAAiB,EACtB,KAAK,KAAK,EAEV,kBAAkB,IAAI,qBAAqB,EAC3C,MAAM,iBAAiB,CAAC;AAKzB,MAAM,WAAW,cAAc;IAC9B,eAAe,EAAE,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;IACjB,aAAa,EAAE,IAAI,CAAC;IACpB,iBAAiB,EAAE,IAAI,CAAC;IACxB,oBAAoB,EAAE,IAAI,CAAC;IAC3B,wBAAwB,EAAE,IAAI,CAAC;IAC/B,yBAAyB,EAAE,IAAI,CAAC;IAChC,kBAAkB,EAAE,IAAI,CAAC;IACzB,kBAAkB,EAAE,IAAI,CAAC;IACzB,qBAAqB,EAAE,IAAI,CAAC;IAC5B,+BAA+B,EAAE,IAAI,CAAC;IACtC,qBAAqB,EAAE,IAAI,CAAC;IAC5B,sBAAsB,EAAE,IAAI,CAAC;IAC7B,qBAAqB,EAAE,IAAI,CAAC;IAC5B,0BAA0B,EAAE,IAAI,CAAC;IACjC,iBAAiB,EAAE,IAAI,CAAC;IACxB,kBAAkB,EAAE,IAAI,CAAC;IACzB,kBAAkB,EAAE,IAAI,CAAC;IACzB,oBAAoB,EAAE,IAAI,CAAC;IAC3B,mBAAmB,EAAE,IAAI,CAAC;IAC1B,uBAAuB,EAAE,IAAI,CAAC;IAC9B,oBAAoB,EAAE,IAAI,CAAC;IAC3B,+BAA+B,EAAE,IAAI,CAAC;IACtC,wBAAwB,EAAE,IAAI,CAAC;IAC/B,wBAAwB,EAAE,IAAI,CAAC;IAC/B,oB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AAY,GAAG,kBAAkB,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACjE,OAAO,IAAI,kBAAkB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAAA,CACxD;IAED,MAAM,GAAS;QACd,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO;QAC7B,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAAA,CACvE;IAED,kBAAkB,GAAsB;QACvC,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAAA,CAClC;IAEO,MAAM,CAAC,YAAY,CAAC,IAAY,EAAqB;QAC5D,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS;YAAE,OAAO,EAAE,CAAC;QAC1B,OAAO,mBAAmB,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IAAA,CACvE;CACD","sourcesContent":["import {\n\ttype Keybinding,\n\ttype KeybindingDefinitions,\n\ttype KeybindingsConfig,\n\ttype KeyId,\n\tTUI_KEYBINDINGS,\n\tKeybindingsManager as TuiKeybindingsManager,\n} from \"@orient-cli/tui\";\nimport { existsSync, readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { getAgentDir } from \"../config.js\";\n\nexport interface AppKeybindings {\n\t\"app.interrupt\": true;\n\t\"app.clear\": true;\n\t\"app.exit\": true;\n\t\"app.suspend\": true;\n\t\"app.mode.toggle\": true;\n\t\"app.thinking.cycle\": true;\n\t\"app.model.cycleForward\": true;\n\t\"app.model.cycleBackward\": true;\n\t\"app.model.select\": true;\n\t\"app.tools.expand\": true;\n\t\"app.thinking.toggle\": true;\n\t\"app.session.toggleNamedFilter\": true;\n\t\"app.editor.external\": true;\n\t\"app.message.followUp\": true;\n\t\"app.message.dequeue\": true;\n\t\"app.clipboard.pasteImage\": true;\n\t\"app.session.new\": true;\n\t\"app.session.tree\": true;\n\t\"app.session.fork\": true;\n\t\"app.session.resume\": true;\n\t\"app.tree.foldOrUp\": true;\n\t\"app.tree.unfoldOrDown\": true;\n\t\"app.tree.editLabel\": true;\n\t\"app.tree.toggleLabelTimestamp\": true;\n\t\"app.session.togglePath\": true;\n\t\"app.session.toggleSort\": true;\n\t\"app.session.rename\": true;\n\t\"app.session.delete\": true;\n\t\"app.session.deleteNoninvasive\": true;\n}\n\nexport type AppKeybinding = keyof AppKeybindings;\n\ndeclare module \"@orient-cli/tui\" {\n\tinterface Keybindings extends AppKeybindings {}\n}\n\nexport const KEYBINDINGS = {\n\t...TUI_KEYBINDINGS,\n\t\"app.interrupt\": { defaultKeys: \"escape\", description: \"Cancel or abort\" },\n\t\"app.clear\": { defaultKeys: \"ctrl+c\", description: \"Clear editor\" },\n\t\"app.exit\": { defaultKeys: \"ctrl+d\", description: \"Exit when editor is empty\" },\n\t\"app.suspend\": { defaultKeys: \"ctrl+z\", description: \"Suspend to background\" },\n\t\"app.mode.toggle\": {\n\t\tdefaultKeys: \"shift+tab\",\n\t\tdescription: \"Toggle Plan ↔ Execute mode (ORIENT dual-mode)\",\n\t},\n\t\"app.thinking.cycle\": {\n\t\t// Rebound from shift+tab → alt+t in the ORIENT rebrand so the\n\t\t// openclaude/opencode/Claude-Code convention of shift+tab = mode\n\t\t// cycle applies here too. The thinking level picker is still\n\t\t// reachable via the settings selector.\n\t\tdefaultKeys: \"alt+t\",\n\t\tdescription: \"Cycle thinking level\",\n\t},\n\t\"app.model.cycleForward\": {\n\t\tdefaultKeys: \"ctrl+p\",\n\t\tdescription: \"Cycle to next model\",\n\t},\n\t\"app.model.cycleBackward\": {\n\t\tdefaultKeys: \"shift+ctrl+p\",\n\t\tdescription: \"Cycle to previous model\",\n\t},\n\t\"app.model.select\": { defaultKeys: \"ctrl+l\", description: \"Open model selector\" },\n\t\"app.tools.expand\": { defaultKeys: \"ctrl+o\", description: \"Toggle tool output\" },\n\t\"app.thinking.toggle\": {\n\t\tdefaultKeys: \"ctrl+t\",\n\t\tdescription: \"Toggle thinking blocks\",\n\t},\n\t\"app.session.toggleNamedFilter\": {\n\t\tdefaultKeys: \"ctrl+n\",\n\t\tdescription: \"Toggle named session filter\",\n\t},\n\t\"app.editor.external\": {\n\t\tdefaultKeys: \"ctrl+g\",\n\t\tdescription: \"Open external editor\",\n\t},\n\t\"app.message.followUp\": {\n\t\tdefaultKeys: \"alt+enter\",\n\t\tdescription: \"Queue follow-up message\",\n\t},\n\t\"app.message.dequeue\": {\n\t\tdefaultKeys: \"alt+up\",\n\t\tdescription: \"Restore queued messages\",\n\t},\n\t\"app.clipboard.pasteImage\": {\n\t\tdefaultKeys: process.platform === \"win32\" ? \"alt+v\" : \"ctrl+v\",\n\t\tdescription: \"Paste image from clipboard\",\n\t},\n\t\"app.session.new\": { defaultKeys: [], description: \"Start a new session\" },\n\t\"app.session.tree\": { defaultKeys: [], description: \"Open session tree\" },\n\t\"app.session.fork\": { defaultKeys: [], description: \"Fork current session\" },\n\t\"app.session.resume\": { defaultKeys: [], description: \"Resume a session\" },\n\t\"app.tree.foldOrUp\": {\n\t\tdefaultKeys: [\"ctrl+left\", \"alt+left\"],\n\t\tdescription: \"Fold tree branch or move up\",\n\t},\n\t\"app.tree.unfoldOrDown\": {\n\t\tdefaultKeys: [\"ctrl+right\", \"alt+right\"],\n\t\tdescription: \"Unfold tree branch or move down\",\n\t},\n\t\"app.tree.editLabel\": {\n\t\tdefaultKeys: \"shift+l\",\n\t\tdescription: \"Edit tree label\",\n\t},\n\t\"app.tree.toggleLabelTimestamp\": {\n\t\tdefaultKeys: \"shift+t\",\n\t\tdescription: \"Toggle tree label timestamps\",\n\t},\n\t\"app.session.togglePath\": {\n\t\tdefaultKeys: \"ctrl+p\",\n\t\tdescription: \"Toggle session path display\",\n\t},\n\t\"app.session.toggleSort\": {\n\t\tdefaultKeys: \"ctrl+s\",\n\t\tdescription: \"Toggle session sort mode\",\n\t},\n\t\"app.session.rename\": {\n\t\tdefaultKeys: \"ctrl+r\",\n\t\tdescription: \"Rename session\",\n\t},\n\t\"app.session.delete\": {\n\t\tdefaultKeys: \"ctrl+d\",\n\t\tdescription: \"Delete session\",\n\t},\n\t\"app.session.deleteNoninvasive\": {\n\t\tdefaultKeys: \"ctrl+backspace\",\n\t\tdescription: \"Delete session when query is empty\",\n\t},\n} as const satisfies KeybindingDefinitions;\n\nconst KEYBINDING_NAME_MIGRATIONS = {\n\tcursorUp: \"tui.editor.cursorUp\",\n\tcursorDown: \"tui.editor.cursorDown\",\n\tcursorLeft: \"tui.editor.cursorLeft\",\n\tcursorRight: \"tui.editor.cursorRight\",\n\tcursorWordLeft: \"tui.editor.cursorWordLeft\",\n\tcursorWordRight: \"tui.editor.cursorWordRight\",\n\tcursorLineStart: \"tui.editor.cursorLineStart\",\n\tcursorLineEnd: \"tui.editor.cursorLineEnd\",\n\tjumpForward: \"tui.editor.jumpForward\",\n\tjumpBackward: \"tui.editor.jumpBackward\",\n\tpageUp: \"tui.editor.pageUp\",\n\tpageDown: \"tui.editor.pageDown\",\n\tdeleteCharBackward: \"tui.editor.deleteCharBackward\",\n\tdeleteCharForward: \"tui.editor.deleteCharForward\",\n\tdeleteWordBackward: \"tui.editor.deleteWordBackward\",\n\tdeleteWordForward: \"tui.editor.deleteWordForward\",\n\tdeleteToLineStart: \"tui.editor.deleteToLineStart\",\n\tdeleteToLineEnd: \"tui.editor.deleteToLineEnd\",\n\tyank: \"tui.editor.yank\",\n\tyankPop: \"tui.editor.yankPop\",\n\tundo: \"tui.editor.undo\",\n\tnewLine: \"tui.input.newLine\",\n\tsubmit: \"tui.input.submit\",\n\ttab: \"tui.input.tab\",\n\tcopy: \"tui.input.copy\",\n\tselectUp: \"tui.select.up\",\n\tselectDown: \"tui.select.down\",\n\tselectPageUp: \"tui.select.pageUp\",\n\tselectPageDown: \"tui.select.pageDown\",\n\tselectConfirm: \"tui.select.confirm\",\n\tselectCancel: \"tui.select.cancel\",\n\tinterrupt: \"app.interrupt\",\n\tclear: \"app.clear\",\n\texit: \"app.exit\",\n\tsuspend: \"app.suspend\",\n\tcycleThinkingLevel: \"app.thinking.cycle\",\n\tcycleModelForward: \"app.model.cycleForward\",\n\tcycleModelBackward: \"app.model.cycleBackward\",\n\tselectModel: \"app.model.select\",\n\texpandTools: \"app.tools.expand\",\n\ttoggleThinking: \"app.thinking.toggle\",\n\ttoggleSessionNamedFilter: \"app.session.toggleNamedFilter\",\n\texternalEditor: \"app.editor.external\",\n\tfollowUp: \"app.message.followUp\",\n\tdequeue: \"app.message.dequeue\",\n\tpasteImage: \"app.clipboard.pasteImage\",\n\tnewSession: \"app.session.new\",\n\ttree: \"app.session.tree\",\n\tfork: \"app.session.fork\",\n\tresume: \"app.session.resume\",\n\ttreeFoldOrUp: \"app.tree.foldOrUp\",\n\ttreeUnfoldOrDown: \"app.tree.unfoldOrDown\",\n\ttreeEditLabel: \"app.tree.editLabel\",\n\ttreeToggleLabelTimestamp: \"app.tree.toggleLabelTimestamp\",\n\ttoggleSessionPath: \"app.session.togglePath\",\n\ttoggleSessionSort: \"app.session.toggleSort\",\n\trenameSession: \"app.session.rename\",\n\tdeleteSession: \"app.session.delete\",\n\tdeleteSessionNoninvasive: \"app.session.deleteNoninvasive\",\n} as const satisfies Record<string, Keybinding>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isLegacyKeybindingName(key: string): key is keyof typeof KEYBINDING_NAME_MIGRATIONS {\n\treturn key in KEYBINDING_NAME_MIGRATIONS;\n}\n\nfunction toKeybindingsConfig(value: unknown): KeybindingsConfig {\n\tif (!isRecord(value)) return {};\n\n\tconst config: KeybindingsConfig = {};\n\tfor (const [key, binding] of Object.entries(value)) {\n\t\tif (typeof binding === \"string\") {\n\t\t\tconfig[key] = binding as KeyId;\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(binding) && binding.every((entry) => typeof entry === \"string\")) {\n\t\t\tconfig[key] = binding as KeyId[];\n\t\t}\n\t}\n\treturn config;\n}\n\nexport function migrateKeybindingsConfig(rawConfig: Record<string, unknown>): {\n\tconfig: Record<string, unknown>;\n\tmigrated: boolean;\n} {\n\tconst config: Record<string, unknown> = {};\n\tlet migrated = false;\n\n\tfor (const [key, value] of Object.entries(rawConfig)) {\n\t\tconst nextKey = isLegacyKeybindingName(key) ? KEYBINDING_NAME_MIGRATIONS[key] : key;\n\t\tif (nextKey !== key) {\n\t\t\tmigrated = true;\n\t\t}\n\t\tif (key !== nextKey && Object.hasOwn(rawConfig, nextKey)) {\n\t\t\tmigrated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconfig[nextKey] = value;\n\t}\n\n\treturn { config: orderKeybindingsConfig(config), migrated };\n}\n\nfunction orderKeybindingsConfig(config: Record<string, unknown>): Record<string, unknown> {\n\tconst ordered: Record<string, unknown> = {};\n\tfor (const keybinding of Object.keys(KEYBINDINGS)) {\n\t\tif (Object.hasOwn(config, keybinding)) {\n\t\t\tordered[keybinding] = config[keybinding];\n\t\t}\n\t}\n\n\tconst extras = Object.keys(config)\n\t\t.filter((key) => !Object.hasOwn(ordered, key))\n\t\t.sort();\n\tfor (const key of extras) {\n\t\tordered[key] = config[key];\n\t}\n\n\treturn ordered;\n}\n\nfunction loadRawConfig(path: string): Record<string, unknown> | undefined {\n\tif (!existsSync(path)) return undefined;\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(path, \"utf-8\")) as unknown;\n\t\treturn isRecord(parsed) ? parsed : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport class KeybindingsManager extends TuiKeybindingsManager {\n\tprivate configPath: string | undefined;\n\n\tconstructor(userBindings: KeybindingsConfig = {}, configPath?: string) {\n\t\tsuper(KEYBINDINGS, userBindings);\n\t\tthis.configPath = configPath;\n\t}\n\n\tstatic create(agentDir: string = getAgentDir()): KeybindingsManager {\n\t\tconst configPath = join(agentDir, \"keybindings.json\");\n\t\tconst userBindings = KeybindingsManager.loadFromFile(configPath);\n\t\treturn new KeybindingsManager(userBindings, configPath);\n\t}\n\n\treload(): void {\n\t\tif (!this.configPath) return;\n\t\tthis.setUserBindings(KeybindingsManager.loadFromFile(this.configPath));\n\t}\n\n\tgetEffectiveConfig(): KeybindingsConfig {\n\t\treturn this.getResolvedBindings();\n\t}\n\n\tprivate static loadFromFile(path: string): KeybindingsConfig {\n\t\tconst rawConfig = loadRawConfig(path);\n\t\tif (!rawConfig) return {};\n\t\treturn toKeybindingsConfig(migrateKeybindingsConfig(rawConfig).config);\n\t}\n}\n\nexport type { Keybinding, KeyId, KeybindingsConfig };\n"]}
|
|
1
|
+
{"version":3,"file":"keybindings.js","sourceRoot":"","sources":["../../src/core/keybindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,eAAe,EACf,kBAAkB,IAAI,qBAAqB,GAC3C,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAwC3C,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,GAAG,eAAe;IAClB,eAAe,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;IAC1E,WAAW,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;IACnE,UAAU,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;IAC/E,aAAa,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;IAC9E,iBAAiB,EAAE;QAClB,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE,+CAA+C;KAC5D;IACD,oBAAoB,EAAE;QACrB,8DAA8D;QAC9D,iEAAiE;QACjE,6DAA6D;QAC7D,uCAAuC;QACvC,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C,CAAC,CAAC,SAAS,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,MAAM,OAAO,kBAAmB,SAAQ,qBAAqB;IAG5D,YAAY,eAAkC,EAAE,EAAE,UAAmB;QACpE,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,WAAmB,WAAW,EAAE;QAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,kBAAkB,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACjE,OAAO,IAAI,kBAAkB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;IAED,MAAM;QACL,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO;QAC7B,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,kBAAkB;QACjB,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACnC,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,IAAY;QACvC,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS;YAAE,OAAO,EAAE,CAAC;QAC1B,OAAO,mBAAmB,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxE,CAAC;CACD","sourcesContent":["import {\n\ttype Keybinding,\n\ttype KeybindingDefinitions,\n\ttype KeybindingsConfig,\n\ttype KeyId,\n\tTUI_KEYBINDINGS,\n\tKeybindingsManager as TuiKeybindingsManager,\n} from \"@orient-cli/tui\";\nimport { existsSync, readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { getAgentDir } from \"../config.js\";\n\nexport interface AppKeybindings {\n\t\"app.interrupt\": true;\n\t\"app.clear\": true;\n\t\"app.exit\": true;\n\t\"app.suspend\": true;\n\t\"app.mode.toggle\": true;\n\t\"app.thinking.cycle\": true;\n\t\"app.model.cycleForward\": true;\n\t\"app.model.cycleBackward\": true;\n\t\"app.model.select\": true;\n\t\"app.tools.expand\": true;\n\t\"app.thinking.toggle\": true;\n\t\"app.session.toggleNamedFilter\": true;\n\t\"app.editor.external\": true;\n\t\"app.message.followUp\": true;\n\t\"app.message.dequeue\": true;\n\t\"app.clipboard.pasteImage\": true;\n\t\"app.session.new\": true;\n\t\"app.session.tree\": true;\n\t\"app.session.fork\": true;\n\t\"app.session.resume\": true;\n\t\"app.tree.foldOrUp\": true;\n\t\"app.tree.unfoldOrDown\": true;\n\t\"app.tree.editLabel\": true;\n\t\"app.tree.toggleLabelTimestamp\": true;\n\t\"app.session.togglePath\": true;\n\t\"app.session.toggleSort\": true;\n\t\"app.session.rename\": true;\n\t\"app.session.delete\": true;\n\t\"app.session.deleteNoninvasive\": true;\n}\n\nexport type AppKeybinding = keyof AppKeybindings;\n\ndeclare module \"@orient-cli/tui\" {\n\tinterface Keybindings extends AppKeybindings {}\n}\n\nexport const KEYBINDINGS = {\n\t...TUI_KEYBINDINGS,\n\t\"app.interrupt\": { defaultKeys: \"escape\", description: \"Cancel or abort\" },\n\t\"app.clear\": { defaultKeys: \"ctrl+c\", description: \"Clear editor\" },\n\t\"app.exit\": { defaultKeys: \"ctrl+d\", description: \"Exit when editor is empty\" },\n\t\"app.suspend\": { defaultKeys: \"ctrl+z\", description: \"Suspend to background\" },\n\t\"app.mode.toggle\": {\n\t\tdefaultKeys: \"shift+tab\",\n\t\tdescription: \"Toggle Plan ↔ Execute mode (ORIENT dual-mode)\",\n\t},\n\t\"app.thinking.cycle\": {\n\t\t// Rebound from shift+tab → alt+t in the ORIENT rebrand so the\n\t\t// openclaude/opencode/Claude-Code convention of shift+tab = mode\n\t\t// cycle applies here too. The thinking level picker is still\n\t\t// reachable via the settings selector.\n\t\tdefaultKeys: \"alt+t\",\n\t\tdescription: \"Cycle thinking level\",\n\t},\n\t\"app.model.cycleForward\": {\n\t\tdefaultKeys: \"ctrl+p\",\n\t\tdescription: \"Cycle to next model\",\n\t},\n\t\"app.model.cycleBackward\": {\n\t\tdefaultKeys: \"shift+ctrl+p\",\n\t\tdescription: \"Cycle to previous model\",\n\t},\n\t\"app.model.select\": { defaultKeys: \"ctrl+l\", description: \"Open model selector\" },\n\t\"app.tools.expand\": { defaultKeys: \"ctrl+o\", description: \"Toggle tool output\" },\n\t\"app.thinking.toggle\": {\n\t\tdefaultKeys: \"ctrl+t\",\n\t\tdescription: \"Toggle thinking blocks\",\n\t},\n\t\"app.session.toggleNamedFilter\": {\n\t\tdefaultKeys: \"ctrl+n\",\n\t\tdescription: \"Toggle named session filter\",\n\t},\n\t\"app.editor.external\": {\n\t\tdefaultKeys: \"ctrl+g\",\n\t\tdescription: \"Open external editor\",\n\t},\n\t\"app.message.followUp\": {\n\t\tdefaultKeys: \"alt+enter\",\n\t\tdescription: \"Queue follow-up message\",\n\t},\n\t\"app.message.dequeue\": {\n\t\tdefaultKeys: \"alt+up\",\n\t\tdescription: \"Restore queued messages\",\n\t},\n\t\"app.clipboard.pasteImage\": {\n\t\tdefaultKeys: process.platform === \"win32\" ? \"alt+v\" : \"ctrl+v\",\n\t\tdescription: \"Paste image from clipboard\",\n\t},\n\t\"app.session.new\": { defaultKeys: [], description: \"Start a new session\" },\n\t\"app.session.tree\": { defaultKeys: [], description: \"Open session tree\" },\n\t\"app.session.fork\": { defaultKeys: [], description: \"Fork current session\" },\n\t\"app.session.resume\": { defaultKeys: [], description: \"Resume a session\" },\n\t\"app.tree.foldOrUp\": {\n\t\tdefaultKeys: [\"ctrl+left\", \"alt+left\"],\n\t\tdescription: \"Fold tree branch or move up\",\n\t},\n\t\"app.tree.unfoldOrDown\": {\n\t\tdefaultKeys: [\"ctrl+right\", \"alt+right\"],\n\t\tdescription: \"Unfold tree branch or move down\",\n\t},\n\t\"app.tree.editLabel\": {\n\t\tdefaultKeys: \"shift+l\",\n\t\tdescription: \"Edit tree label\",\n\t},\n\t\"app.tree.toggleLabelTimestamp\": {\n\t\tdefaultKeys: \"shift+t\",\n\t\tdescription: \"Toggle tree label timestamps\",\n\t},\n\t\"app.session.togglePath\": {\n\t\tdefaultKeys: \"ctrl+p\",\n\t\tdescription: \"Toggle session path display\",\n\t},\n\t\"app.session.toggleSort\": {\n\t\tdefaultKeys: \"ctrl+s\",\n\t\tdescription: \"Toggle session sort mode\",\n\t},\n\t\"app.session.rename\": {\n\t\tdefaultKeys: \"ctrl+r\",\n\t\tdescription: \"Rename session\",\n\t},\n\t\"app.session.delete\": {\n\t\tdefaultKeys: \"ctrl+d\",\n\t\tdescription: \"Delete session\",\n\t},\n\t\"app.session.deleteNoninvasive\": {\n\t\tdefaultKeys: \"ctrl+backspace\",\n\t\tdescription: \"Delete session when query is empty\",\n\t},\n} as const satisfies KeybindingDefinitions;\n\nconst KEYBINDING_NAME_MIGRATIONS = {\n\tcursorUp: \"tui.editor.cursorUp\",\n\tcursorDown: \"tui.editor.cursorDown\",\n\tcursorLeft: \"tui.editor.cursorLeft\",\n\tcursorRight: \"tui.editor.cursorRight\",\n\tcursorWordLeft: \"tui.editor.cursorWordLeft\",\n\tcursorWordRight: \"tui.editor.cursorWordRight\",\n\tcursorLineStart: \"tui.editor.cursorLineStart\",\n\tcursorLineEnd: \"tui.editor.cursorLineEnd\",\n\tjumpForward: \"tui.editor.jumpForward\",\n\tjumpBackward: \"tui.editor.jumpBackward\",\n\tpageUp: \"tui.editor.pageUp\",\n\tpageDown: \"tui.editor.pageDown\",\n\tdeleteCharBackward: \"tui.editor.deleteCharBackward\",\n\tdeleteCharForward: \"tui.editor.deleteCharForward\",\n\tdeleteWordBackward: \"tui.editor.deleteWordBackward\",\n\tdeleteWordForward: \"tui.editor.deleteWordForward\",\n\tdeleteToLineStart: \"tui.editor.deleteToLineStart\",\n\tdeleteToLineEnd: \"tui.editor.deleteToLineEnd\",\n\tyank: \"tui.editor.yank\",\n\tyankPop: \"tui.editor.yankPop\",\n\tundo: \"tui.editor.undo\",\n\tnewLine: \"tui.input.newLine\",\n\tsubmit: \"tui.input.submit\",\n\ttab: \"tui.input.tab\",\n\tcopy: \"tui.input.copy\",\n\tselectUp: \"tui.select.up\",\n\tselectDown: \"tui.select.down\",\n\tselectPageUp: \"tui.select.pageUp\",\n\tselectPageDown: \"tui.select.pageDown\",\n\tselectConfirm: \"tui.select.confirm\",\n\tselectCancel: \"tui.select.cancel\",\n\tinterrupt: \"app.interrupt\",\n\tclear: \"app.clear\",\n\texit: \"app.exit\",\n\tsuspend: \"app.suspend\",\n\tcycleThinkingLevel: \"app.thinking.cycle\",\n\tcycleModelForward: \"app.model.cycleForward\",\n\tcycleModelBackward: \"app.model.cycleBackward\",\n\tselectModel: \"app.model.select\",\n\texpandTools: \"app.tools.expand\",\n\ttoggleThinking: \"app.thinking.toggle\",\n\ttoggleSessionNamedFilter: \"app.session.toggleNamedFilter\",\n\texternalEditor: \"app.editor.external\",\n\tfollowUp: \"app.message.followUp\",\n\tdequeue: \"app.message.dequeue\",\n\tpasteImage: \"app.clipboard.pasteImage\",\n\tnewSession: \"app.session.new\",\n\ttree: \"app.session.tree\",\n\tfork: \"app.session.fork\",\n\tresume: \"app.session.resume\",\n\ttreeFoldOrUp: \"app.tree.foldOrUp\",\n\ttreeUnfoldOrDown: \"app.tree.unfoldOrDown\",\n\ttreeEditLabel: \"app.tree.editLabel\",\n\ttreeToggleLabelTimestamp: \"app.tree.toggleLabelTimestamp\",\n\ttoggleSessionPath: \"app.session.togglePath\",\n\ttoggleSessionSort: \"app.session.toggleSort\",\n\trenameSession: \"app.session.rename\",\n\tdeleteSession: \"app.session.delete\",\n\tdeleteSessionNoninvasive: \"app.session.deleteNoninvasive\",\n} as const satisfies Record<string, Keybinding>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isLegacyKeybindingName(key: string): key is keyof typeof KEYBINDING_NAME_MIGRATIONS {\n\treturn key in KEYBINDING_NAME_MIGRATIONS;\n}\n\nfunction toKeybindingsConfig(value: unknown): KeybindingsConfig {\n\tif (!isRecord(value)) return {};\n\n\tconst config: KeybindingsConfig = {};\n\tfor (const [key, binding] of Object.entries(value)) {\n\t\tif (typeof binding === \"string\") {\n\t\t\tconfig[key] = binding as KeyId;\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(binding) && binding.every((entry) => typeof entry === \"string\")) {\n\t\t\tconfig[key] = binding as KeyId[];\n\t\t}\n\t}\n\treturn config;\n}\n\nexport function migrateKeybindingsConfig(rawConfig: Record<string, unknown>): {\n\tconfig: Record<string, unknown>;\n\tmigrated: boolean;\n} {\n\tconst config: Record<string, unknown> = {};\n\tlet migrated = false;\n\n\tfor (const [key, value] of Object.entries(rawConfig)) {\n\t\tconst nextKey = isLegacyKeybindingName(key) ? KEYBINDING_NAME_MIGRATIONS[key] : key;\n\t\tif (nextKey !== key) {\n\t\t\tmigrated = true;\n\t\t}\n\t\tif (key !== nextKey && Object.hasOwn(rawConfig, nextKey)) {\n\t\t\tmigrated = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconfig[nextKey] = value;\n\t}\n\n\treturn { config: orderKeybindingsConfig(config), migrated };\n}\n\nfunction orderKeybindingsConfig(config: Record<string, unknown>): Record<string, unknown> {\n\tconst ordered: Record<string, unknown> = {};\n\tfor (const keybinding of Object.keys(KEYBINDINGS)) {\n\t\tif (Object.hasOwn(config, keybinding)) {\n\t\t\tordered[keybinding] = config[keybinding];\n\t\t}\n\t}\n\n\tconst extras = Object.keys(config)\n\t\t.filter((key) => !Object.hasOwn(ordered, key))\n\t\t.sort();\n\tfor (const key of extras) {\n\t\tordered[key] = config[key];\n\t}\n\n\treturn ordered;\n}\n\nfunction loadRawConfig(path: string): Record<string, unknown> | undefined {\n\tif (!existsSync(path)) return undefined;\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(path, \"utf-8\")) as unknown;\n\t\treturn isRecord(parsed) ? parsed : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport class KeybindingsManager extends TuiKeybindingsManager {\n\tprivate configPath: string | undefined;\n\n\tconstructor(userBindings: KeybindingsConfig = {}, configPath?: string) {\n\t\tsuper(KEYBINDINGS, userBindings);\n\t\tthis.configPath = configPath;\n\t}\n\n\tstatic create(agentDir: string = getAgentDir()): KeybindingsManager {\n\t\tconst configPath = join(agentDir, \"keybindings.json\");\n\t\tconst userBindings = KeybindingsManager.loadFromFile(configPath);\n\t\treturn new KeybindingsManager(userBindings, configPath);\n\t}\n\n\treload(): void {\n\t\tif (!this.configPath) return;\n\t\tthis.setUserBindings(KeybindingsManager.loadFromFile(this.configPath));\n\t}\n\n\tgetEffectiveConfig(): KeybindingsConfig {\n\t\treturn this.getResolvedBindings();\n\t}\n\n\tprivate static loadFromFile(path: string): KeybindingsConfig {\n\t\tconst rawConfig = loadRawConfig(path);\n\t\tif (!rawConfig) return {};\n\t\treturn toKeybindingsConfig(migrateKeybindingsConfig(rawConfig).config);\n\t}\n}\n\nexport type { Keybinding, KeyId, KeybindingsConfig };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzE,eAAO,MAAM,yBAAyB,wGAGrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,iBAC3B,CAAC;AAEZ,eAAO,MAAM,qBAAqB,iGAGjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;;GAEG;AACH,MAAM,WA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B,CAAC;QACpC,iBAAiB,EAAE,wBAAwB,CAAC;KAC5C;CACD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,GAAG,MAAM,CAgBrE;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,oBAAoB,CAOnH;AAED,wBAAgB,8BAA8B,CAC7C,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GACf,wBAAwB,CAO1B;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,EAChD,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GACf,aAAa,CASf;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CA+ChE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;CAGxC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;WAC9B,CAAC;AAEZ,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;CAGpC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAuDlD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAyB
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;CAGxC,CAAC;AAEF,MAAM,CAAC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AO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,qBAAqB,GAAG,CAAC,CAAC,OAAO,GAAG,qBAAqB,EAAE,CAAC;oBACrG,SAAS,EAAE,CAAC,CAAC,SAAS;iBACtB,CAAC;YACH,KAAK,mBAAmB;gBACvB,OAAO;oBACN,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,GAAG,yBAAyB,EAAE;qBAClG;oBACD,SAAS,EAAE,CAAC,CAAC,SAAS;iBACtB,CAAC;YACH,KAAK,MAAM,CAAC;YACZ,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBAChB,OAAO,CAAC,CAAC;YACV;gBACC,2DAA2D;gBAC3D,MAAM,gBAAgB,GAAU,CAAC,CAAC;gBAClC,OAAO,SAAS,CAAC;QACnB,CAAC;IACF,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\n * Custom message types and transformers for the coding agent.\n *\n * Extends the base AgentMessage type with coding-agent specific message types,\n * and provides a transformer to convert them to LLM-compatible messages.\n */\n\nimport type { AgentMessage } from \"@orient-cli/agent-core\";\nimport type { ImageContent, Message, TextContent } from \"@orient-cli/ai\";\n\nexport const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:\n\n<summary>\n`;\n\nexport const COMPACTION_SUMMARY_SUFFIX = `\n</summary>`;\n\nexport const BRANCH_SUMMARY_PREFIX = `The following is a summary of a branch that this conversation came back from:\n\n<summary>\n`;\n\nexport const BRANCH_SUMMARY_SUFFIX = `</summary>`;\n\n/**\n * Message type for bash executions via the ! command.\n */\nexport interface BashExecutionMessage {\n\trole: \"bashExecution\";\n\tcommand: string;\n\toutput: string;\n\texitCode: number | undefined;\n\tcancelled: boolean;\n\ttruncated: boolean;\n\tfullOutputPath?: string;\n\ttimestamp: number;\n\t/** If true, this message is excluded from LLM context (!! prefix) */\n\texcludeFromContext?: boolean;\n}\n\n/**\n * Message type for extension-injected messages via sendMessage().\n * These are custom messages that extensions can inject into the conversation.\n */\nexport interface CustomMessage<T = unknown> {\n\trole: \"custom\";\n\tcustomType: string;\n\tcontent: string | (TextContent | ImageContent)[];\n\tdisplay: boolean;\n\tdetails?: T;\n\ttimestamp: number;\n}\n\nexport interface BranchSummaryMessage {\n\trole: \"branchSummary\";\n\tsummary: string;\n\tfromId: string;\n\ttimestamp: number;\n}\n\nexport interface CompactionSummaryMessage {\n\trole: \"compactionSummary\";\n\tsummary: string;\n\ttokensBefore: number;\n\ttimestamp: number;\n}\n\n// Extend CustomAgentMessages via declaration merging\ndeclare module \"@orient-cli/agent-core\" {\n\tinterface CustomAgentMessages {\n\t\tbashExecution: BashExecutionMessage;\n\t\tcustom: CustomMessage;\n\t\tbranchSummary: BranchSummaryMessage;\n\t\tcompactionSummary: CompactionSummaryMessage;\n\t}\n}\n\n/**\n * Convert a BashExecutionMessage to user message text for LLM context.\n */\nexport function bashExecutionToText(msg: BashExecutionMessage): string {\n\tlet text = `Ran \\`${msg.command}\\`\\n`;\n\tif (msg.output) {\n\t\ttext += `\\`\\`\\`\\n${msg.output}\\n\\`\\`\\``;\n\t} else {\n\t\ttext += \"(no output)\";\n\t}\n\tif (msg.cancelled) {\n\t\ttext += \"\\n\\n(command cancelled)\";\n\t} else if (msg.exitCode !== null && msg.exitCode !== undefined && msg.exitCode !== 0) {\n\t\ttext += `\\n\\nCommand exited with code ${msg.exitCode}`;\n\t}\n\tif (msg.truncated && msg.fullOutputPath) {\n\t\ttext += `\\n\\n[Output truncated. Full output: ${msg.fullOutputPath}]`;\n\t}\n\treturn text;\n}\n\nexport function createBranchSummaryMessage(summary: string, fromId: string, timestamp: string): BranchSummaryMessage {\n\treturn {\n\t\trole: \"branchSummary\",\n\t\tsummary,\n\t\tfromId,\n\t\ttimestamp: new Date(timestamp).getTime(),\n\t};\n}\n\nexport function createCompactionSummaryMessage(\n\tsummary: string,\n\ttokensBefore: number,\n\ttimestamp: string,\n): CompactionSummaryMessage {\n\treturn {\n\t\trole: \"compactionSummary\",\n\t\tsummary: summary,\n\t\ttokensBefore,\n\t\ttimestamp: new Date(timestamp).getTime(),\n\t};\n}\n\n/** Convert CustomMessageEntry to AgentMessage format */\nexport function createCustomMessage(\n\tcustomType: string,\n\tcontent: string | (TextContent | ImageContent)[],\n\tdisplay: boolean,\n\tdetails: unknown | undefined,\n\ttimestamp: string,\n): CustomMessage {\n\treturn {\n\t\trole: \"custom\",\n\t\tcustomType,\n\t\tcontent,\n\t\tdisplay,\n\t\tdetails,\n\t\ttimestamp: new Date(timestamp).getTime(),\n\t};\n}\n\n/**\n * Transform AgentMessages (including custom types) to LLM-compatible Messages.\n *\n * This is used by:\n * - Agent's transormToLlm option (for prompt calls and queued messages)\n * - Compaction's generateSummary (for summarization)\n * - Custom extensions and tools\n */\nexport function convertToLlm(messages: AgentMessage[]): Message[] {\n\treturn messages\n\t\t.map((m): Message | undefined => {\n\t\t\tswitch (m.role) {\n\t\t\t\tcase \"bashExecution\":\n\t\t\t\t\t// Skip messages excluded from context (!! prefix)\n\t\t\t\t\tif (m.excludeFromContext) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: bashExecutionToText(m) }],\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\tcase \"custom\": {\n\t\t\t\t\tconst content = typeof m.content === \"string\" ? [{ type: \"text\" as const, text: m.content }] : m.content;\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"branchSummary\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: [{ type: \"text\" as const, text: BRANCH_SUMMARY_PREFIX + m.summary + BRANCH_SUMMARY_SUFFIX }],\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\tcase \"compactionSummary\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t{ type: \"text\" as const, text: COMPACTION_SUMMARY_PREFIX + m.summary + COMPACTION_SUMMARY_SUFFIX },\n\t\t\t\t\t\t],\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\tcase \"user\":\n\t\t\t\tcase \"assistant\":\n\t\t\t\tcase \"toolResult\":\n\t\t\t\t\treturn m;\n\t\t\t\tdefault:\n\t\t\t\t\t// biome-ignore lint/correctness/noSwitchDeclarations: fine\n\t\t\t\t\tconst _exhaustiveCheck: never = m;\n\t\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})\n\t\t.filter((m) => m !== undefined);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-registry.d.ts","sourceRoot":"","sources":["../../src/core/model-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,KAAK,GAAG,EACR,KAAK,2BAA2B,EAChC,KAAK,OAAO,EAIZ,KAAK,KAAK,EACV,KAAK,sBAAsB,EAK3B,KAAK,mBAAmB,EACxB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACN,qBAAqB,EAIrB,MAAM,2BAA2B,CAAC;AAqKnC,MAAM,MAAM,mBAAmB,GAC5B;IACA,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC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QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,KAAK,EAAE,CAAC,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;QAC5B,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/E,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;KAC9B,CAAC,CAAC;CACH","sourcesContent":["/**\n * Model registry - manages built-in and custom models, provides API key resolution.\n */\n\nimport {\n\ttype Api,\n\ttype AssistantMessageEventStream,\n\ttype Context,\n\tgetModels,\n\tgetProviders,\n\ttype KnownProvider,\n\ttype Model,\n\ttype OAuthProviderInterface,\n\ttype OpenAICompletionsCompat,\n\ttype OpenAIResponsesCompat,\n\tregisterApiProvider,\n\tresetApiProviders,\n\ttype SimpleStreamOptions,\n} from \"@orient-cli/ai\";\nimport { registerOAuthProvider, resetOAuthProviders } from \"@orient-cli/ai/oauth\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport AjvModule from \"ajv\";\nimport { existsSync, readFileSync } from \"fs\";\nimport { join } from \"path\";\nimport { getAgentDir } from \"../config.js\";\nimport type { AuthStorage } from \"./auth-storage.js\";\nimport {\n\tclearConfigValueCache,\n\tresolveConfigValueOrThrow,\n\tresolveConfigValueUncached,\n\tresolveHeadersOrThrow,\n} from \"./resolve-config-value.js\";\n\nconst Ajv = (AjvModule as any).default || AjvModule;\nconst ajv = new Ajv();\n\n// Schema for OpenRouter routing preferences\nconst PercentileCutoffsSchema = Type.Object({\n\tp50: Type.Optional(Type.Number()),\n\tp75: Type.Optional(Type.Number()),\n\tp90: Type.Optional(Type.Number()),\n\tp99: Type.Optional(Type.Number()),\n});\n\nconst OpenRouterRoutingSchema = Type.Object({\n\tallow_fallbacks: Type.Optional(Type.Boolean()),\n\trequire_parameters: Type.Optional(Type.Boolean()),\n\tdata_collection: Type.Optional(Type.Union([Type.Literal(\"deny\"), Type.Literal(\"allow\")])),\n\tzdr: Type.Optional(Type.Boolean()),\n\tenforce_distillable_text: Type.Optional(Type.Boolean()),\n\torder: Type.Optional(Type.Array(Type.String())),\n\tonly: Type.Optional(Type.Array(Type.String())),\n\tignore: Type.Optional(Type.Array(Type.String())),\n\tquantizations: Type.Optional(Type.Array(Type.String())),\n\tsort: Type.Optional(\n\t\tType.Union([\n\t\t\tType.String(),\n\t\t\tType.Object({\n\t\t\t\tby: Type.Optional(Type.String()),\n\t\t\t\tpartition: Type.Optional(Type.Union([Type.String(), Type.Null()])),\n\t\t\t}),\n\t\t]),\n\t),\n\tmax_price: Type.Optional(\n\t\tType.Object({\n\t\t\tprompt: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\tcompletion: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\timage: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\taudio: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t\trequest: Type.Optional(Type.Union([Type.Number(), Type.String()])),\n\t\t}),\n\t),\n\tpreferred_min_throughput: Type.Optional(Type.Union([Type.Number(), PercentileCutoffsSchema])),\n\tpreferred_max_latency: Type.Optional(Type.Union([Type.Number(), PercentileCutoffsSchema])),\n});\n\n// Schema for Vercel AI Gateway routing preferences\nconst VercelGatewayRoutingSchema = Type.Object({\n\tonly: Type.Optional(Type.Array(Type.String())),\n\torder: Type.Optional(Type.Array(Type.String())),\n});\n\n// Schema for OpenAI compatibility settings\nconst ReasoningEffortMapSchema = Type.Object({\n\tminimal: Type.Optional(Type.String()),\n\tlow: Type.Optional(Type.String()),\n\tmedium: Type.Optional(Type.String()),\n\thigh: Type.Optional(Type.String()),\n\txhigh: Type.Optional(Type.String()),\n});\n\nconst OpenAICompletionsCompatSchema = Type.Object({\n\tsupportsStore: Type.Optional(Type.Boolean()),\n\tsupportsDeveloperRole: Type.Optional(Type.Boolean()),\n\tsupportsReasoningEffort: Type.Optional(Type.Boolean()),\n\treasoningEffortMap: Type.Optional(ReasoningEffortMapSchema),\n\tsupportsUsageInStreaming: Type.Optional(Type.Boolean()),\n\tmaxTokensField: Type.Optional(Type.Union([Type.Literal(\"max_completion_tokens\"), Type.Literal(\"max_tokens\")])),\n\trequiresToolResultName: Type.Optional(Type.Boolean()),\n\trequiresAssistantAfterToolResult: Type.Optional(Type.Boolean()),\n\trequiresThinkingAsText: Type.Optional(Type.Boolean()),\n\tthinkingFormat: Type.Optional(\n\t\tType.Union([\n\t\t\tType.Literal(\"openai\"),\n\t\t\tType.Literal(\"openrouter\"),\n\t\t\tType.Literal(\"zai\"),\n\t\t\tType.Literal(\"qwen\"),\n\t\t\tType.Literal(\"qwen-chat-template\"),\n\t\t]),\n\t),\n\topenRouterRouting: Type.Optional(OpenRouterRoutingSchema),\n\tvercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),\n\tsupportsStrictMode: Type.Optional(Type.Boolean()),\n});\n\nconst OpenAIResponsesCompatSchema = Type.Object({\n\t// Reserved for future use\n});\n\nconst OpenAICompatSchema = Type.Union([OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema]);\n\n// Schema for custom model definition\n// Most fields are optional with sensible defaults for local models (Ollama, LM Studio, etc.)\nconst ModelDefinitionSchema = Type.Object({\n\tid: Type.String({ minLength: 1 }),\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\tapi: Type.Optional(Type.String({ minLength: 1 })),\n\tbaseUrl: Type.Optional(Type.String({ minLength: 1 })),\n\treasoning: Type.Optional(Type.Boolean()),\n\tinput: Type.Optional(Type.Array(Type.Union([Type.Literal(\"text\"), Type.Literal(\"image\")]))),\n\tcost: Type.Optional(\n\t\tType.Object({\n\t\t\tinput: Type.Number(),\n\t\t\toutput: Type.Number(),\n\t\t\tcacheRead: Type.Number(),\n\t\t\tcacheWrite: Type.Number(),\n\t\t}),\n\t),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(OpenAICompatSchema),\n});\n\n// Schema for per-model overrides (all fields optional, merged with built-in model)\nconst ModelOverrideSchema = Type.Object({\n\tname: Type.Optional(Type.String({ minLength: 1 })),\n\treasoning: Type.Optional(Type.Boolean()),\n\tinput: Type.Optional(Type.Array(Type.Union([Type.Literal(\"text\"), Type.Literal(\"image\")]))),\n\tcost: Type.Optional(\n\t\tType.Object({\n\t\t\tinput: Type.Optional(Type.Number()),\n\t\t\toutput: Type.Optional(Type.Number()),\n\t\t\tcacheRead: Type.Optional(Type.Number()),\n\t\t\tcacheWrite: Type.Optional(Type.Number()),\n\t\t}),\n\t),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(OpenAICompatSchema),\n});\n\ntype ModelOverride = Static<typeof ModelOverrideSchema>;\n\nconst ProviderConfigSchema = Type.Object({\n\tbaseUrl: Type.Optional(Type.String({ minLength: 1 })),\n\tapiKey: Type.Optional(Type.String({ minLength: 1 })),\n\tapi: Type.Optional(Type.String({ minLength: 1 })),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tcompat: Type.Optional(OpenAICompatSchema),\n\tauthHeader: Type.Optional(Type.Boolean()),\n\tmodels: Type.Optional(Type.Array(ModelDefinitionSchema)),\n\tmodelOverrides: Type.Optional(Type.Record(Type.String(), ModelOverrideSchema)),\n});\n\nconst ModelsConfigSchema = Type.Object({\n\tproviders: Type.Record(Type.String(), ProviderConfigSchema),\n});\n\najv.addSchema(ModelsConfigSchema, \"ModelsConfig\");\n\ntype ModelsConfig = Static<typeof ModelsConfigSchema>;\n\n/** Provider override config (baseUrl, compat) without request auth/headers */\ninterface ProviderOverride {\n\tbaseUrl?: string;\n\tcompat?: Model<Api>[\"compat\"];\n}\n\ninterface ProviderRequestConfig {\n\tapiKey?: string;\n\theaders?: Record<string, string>;\n\tauthHeader?: boolean;\n}\n\nexport type ResolvedRequestAuth =\n\t| {\n\t\t\tok: true;\n\t\t\tapiKey?: string;\n\t\t\theaders?: Record<string, string>;\n\t }\n\t| {\n\t\t\tok: false;\n\t\t\terror: string;\n\t };\n\n/** Result of loading custom models from models.json */\ninterface CustomModelsResult {\n\tmodels: Model<Api>[];\n\t/** Providers with baseUrl/headers/apiKey overrides for built-in models */\n\toverrides: Map<string, ProviderOverride>;\n\t/** Per-model overrides: provider -> modelId -> override */\n\tmodelOverrides: Map<string, Map<string, ModelOverride>>;\n\terror: string | undefined;\n}\n\nfunction emptyCustomModelsResult(error?: string): CustomModelsResult {\n\treturn { models: [], overrides: new Map(), modelOverrides: new Map(), error };\n}\n\nfunction mergeCompat(\n\tbaseCompat: Model<Api>[\"compat\"],\n\toverrideCompat: ModelOverride[\"compat\"],\n): Model<Api>[\"compat\"] | undefined {\n\tif (!overrideCompat) return baseCompat;\n\n\tconst base = baseCompat as OpenAICompletionsCompat | OpenAIResponsesCompat | undefined;\n\tconst override = overrideCompat as OpenAICompletionsCompat | OpenAIResponsesCompat;\n\tconst merged = { ...base, ...override } as OpenAICompletionsCompat | OpenAIResponsesCompat;\n\n\tconst baseCompletions = base as OpenAICompletionsCompat | undefined;\n\tconst overrideCompletions = override as OpenAICompletionsCompat;\n\tconst mergedCompletions = merged as OpenAICompletionsCompat;\n\n\tif (baseCompletions?.openRouterRouting || overrideCompletions.openRouterRouting) {\n\t\tmergedCompletions.openRouterRouting = {\n\t\t\t...baseCompletions?.openRouterRouting,\n\t\t\t...overrideCompletions.openRouterRouting,\n\t\t};\n\t}\n\n\tif (baseCompletions?.vercelGatewayRouting || overrideCompletions.vercelGatewayRouting) {\n\t\tmergedCompletions.vercelGatewayRouting = {\n\t\t\t...baseCompletions?.vercelGatewayRouting,\n\t\t\t...overrideCompletions.vercelGatewayRouting,\n\t\t};\n\t}\n\n\treturn merged as Model<Api>[\"compat\"];\n}\n\n/**\n * Deep merge a model override into a model.\n * Handles nested objects (cost, compat) by merging rather than replacing.\n */\nfunction applyModelOverride(model: Model<Api>, override: ModelOverride): Model<Api> {\n\tconst result = { ...model };\n\n\t// Simple field overrides\n\tif (override.name !== undefined) result.name = override.name;\n\tif (override.reasoning !== undefined) result.reasoning = override.reasoning;\n\tif (override.input !== undefined) result.input = override.input as (\"text\" | \"image\")[];\n\tif (override.contextWindow !== undefined) result.contextWindow = override.contextWindow;\n\tif (override.maxTokens !== undefined) result.maxTokens = override.maxTokens;\n\n\t// Merge cost (partial override)\n\tif (override.cost) {\n\t\tresult.cost = {\n\t\t\tinput: override.cost.input ?? model.cost.input,\n\t\t\toutput: override.cost.output ?? model.cost.output,\n\t\t\tcacheRead: override.cost.cacheRead ?? model.cost.cacheRead,\n\t\t\tcacheWrite: override.cost.cacheWrite ?? model.cost.cacheWrite,\n\t\t};\n\t}\n\n\t// Deep merge compat\n\tresult.compat = mergeCompat(model.compat, override.compat);\n\n\treturn result;\n}\n\n/** Clear the config value command cache. Exported for testing. */\nexport const clearApiKeyCache = clearConfigValueCache;\n\n/**\n * Model registry - loads and manages models, resolves API keys via AuthStorage.\n */\nexport class ModelRegistry {\n\tprivate models: Model<Api>[] = [];\n\tprivate providerRequestConfigs: Map<string, ProviderRequestConfig> = new Map();\n\tprivate modelRequestHeaders: Map<string, Record<string, string>> = new Map();\n\tprivate registeredProviders: Map<string, ProviderConfigInput> = new Map();\n\tprivate loadError: string | undefined = undefined;\n\n\tprivate constructor(\n\t\treadonly authStorage: AuthStorage,\n\t\tprivate modelsJsonPath: string | undefined,\n\t) {\n\t\tthis.loadModels();\n\t}\n\n\tstatic create(authStorage: AuthStorage, modelsJsonPath: string = join(getAgentDir(), \"models.json\")): ModelRegistry {\n\t\treturn new ModelRegistry(authStorage, modelsJsonPath);\n\t}\n\n\tstatic inMemory(authStorage: AuthStorage): ModelRegistry {\n\t\treturn new ModelRegistry(authStorage, undefined);\n\t}\n\n\t/**\n\t * Reload models from disk (built-in + custom from models.json).\n\t */\n\trefresh(): void {\n\t\tthis.providerRequestConfigs.clear();\n\t\tthis.modelRequestHeaders.clear();\n\t\tthis.loadError = undefined;\n\n\t\t// Ensure dynamic API/OAuth registrations are rebuilt from current provider state.\n\t\tresetApiProviders();\n\t\tresetOAuthProviders();\n\n\t\tthis.loadModels();\n\n\t\tfor (const [providerName, config] of this.registeredProviders.entries()) {\n\t\t\tthis.applyProviderConfig(providerName, config);\n\t\t}\n\t}\n\n\t/**\n\t * Get any error from loading models.json (undefined if no error).\n\t */\n\tgetError(): string | undefined {\n\t\treturn this.loadError;\n\t}\n\n\tprivate loadModels(): void {\n\t\t// Load custom models and overrides from models.json\n\t\tconst {\n\t\t\tmodels: customModels,\n\t\t\toverrides,\n\t\t\tmodelOverrides,\n\t\t\terror,\n\t\t} = this.modelsJsonPath ? this.loadCustomModels(this.modelsJsonPath) : emptyCustomModelsResult();\n\n\t\tif (error) {\n\t\t\tthis.loadError = error;\n\t\t\t// Keep built-in models even if custom models failed to load\n\t\t}\n\n\t\tconst builtInModels = this.loadBuiltInModels(overrides, modelOverrides);\n\t\tlet combined = this.mergeCustomModels(builtInModels, customModels);\n\n\t\t// Let OAuth providers modify their models (e.g., update baseUrl)\n\t\tfor (const oauthProvider of this.authStorage.getOAuthProviders()) {\n\t\t\tconst cred = this.authStorage.get(oauthProvider.id);\n\t\t\tif (cred?.type === \"oauth\" && oauthProvider.modifyModels) {\n\t\t\t\tcombined = oauthProvider.modifyModels(combined, cred);\n\t\t\t}\n\t\t}\n\n\t\tthis.models = combined;\n\t}\n\n\t/** Load built-in models and apply provider/model overrides */\n\tprivate loadBuiltInModels(\n\t\toverrides: Map<string, ProviderOverride>,\n\t\tmodelOverrides: Map<string, Map<string, ModelOverride>>,\n\t): Model<Api>[] {\n\t\treturn getProviders().flatMap((provider) => {\n\t\t\tconst models = getModels(provider as KnownProvider) as Model<Api>[];\n\t\t\tconst providerOverride = overrides.get(provider);\n\t\t\tconst perModelOverrides = modelOverrides.get(provider);\n\n\t\t\treturn models.map((m) => {\n\t\t\t\tlet model = m;\n\n\t\t\t\t// Apply provider-level baseUrl/headers/compat override\n\t\t\t\tif (providerOverride) {\n\t\t\t\t\tmodel = {\n\t\t\t\t\t\t...model,\n\t\t\t\t\t\tbaseUrl: providerOverride.baseUrl ?? model.baseUrl,\n\t\t\t\t\t\tcompat: mergeCompat(model.compat, providerOverride.compat),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Apply per-model override\n\t\t\t\tconst modelOverride = perModelOverrides?.get(m.id);\n\t\t\t\tif (modelOverride) {\n\t\t\t\t\tmodel = applyModelOverride(model, modelOverride);\n\t\t\t\t}\n\n\t\t\t\treturn model;\n\t\t\t});\n\t\t});\n\t}\n\n\t/** Merge custom models into built-in list by provider+id (custom wins on conflicts). */\n\tprivate mergeCustomModels(builtInModels: Model<Api>[], customModels: Model<Api>[]): Model<Api>[] {\n\t\tconst merged = [...builtInModels];\n\t\tfor (const customModel of customModels) {\n\t\t\tconst existingIndex = merged.findIndex((m) => m.provider === customModel.provider && m.id === customModel.id);\n\t\t\tif (existingIndex >= 0) {\n\t\t\t\tmerged[existingIndex] = customModel;\n\t\t\t} else {\n\t\t\t\tmerged.push(customModel);\n\t\t\t}\n\t\t}\n\t\treturn merged;\n\t}\n\n\tprivate loadCustomModels(modelsJsonPath: string): CustomModelsResult {\n\t\tif (!existsSync(modelsJsonPath)) {\n\t\t\treturn emptyCustomModelsResult();\n\t\t}\n\n\t\ttry {\n\t\t\tconst content = readFileSync(modelsJsonPath, \"utf-8\");\n\t\t\tconst config: ModelsConfig = JSON.parse(content);\n\n\t\t\t// Validate schema\n\t\t\tconst validate = ajv.getSchema(\"ModelsConfig\")!;\n\t\t\tif (!validate(config)) {\n\t\t\t\tconst errors =\n\t\t\t\t\tvalidate.errors?.map((e: any) => ` - ${e.instancePath || \"root\"}: ${e.message}`).join(\"\\n\") ||\n\t\t\t\t\t\"Unknown schema error\";\n\t\t\t\treturn emptyCustomModelsResult(`Invalid models.json schema:\\n${errors}\\n\\nFile: ${modelsJsonPath}`);\n\t\t\t}\n\n\t\t\t// Additional validation\n\t\t\tthis.validateConfig(config);\n\n\t\t\tconst overrides = new Map<string, ProviderOverride>();\n\t\t\tconst modelOverrides = new Map<string, Map<string, ModelOverride>>();\n\n\t\t\tfor (const [providerName, providerConfig] of Object.entries(config.providers)) {\n\t\t\t\tif (providerConfig.baseUrl || providerConfig.compat) {\n\t\t\t\t\toverrides.set(providerName, {\n\t\t\t\t\t\tbaseUrl: providerConfig.baseUrl,\n\t\t\t\t\t\tcompat: providerConfig.compat,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.storeProviderRequestConfig(providerName, providerConfig);\n\n\t\t\t\tif (providerConfig.modelOverrides) {\n\t\t\t\t\tmodelOverrides.set(providerName, new Map(Object.entries(providerConfig.modelOverrides)));\n\t\t\t\t\tfor (const [modelId, modelOverride] of Object.entries(providerConfig.modelOverrides)) {\n\t\t\t\t\t\tthis.storeModelHeaders(providerName, modelId, modelOverride.headers);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { models: this.parseModels(config), overrides, modelOverrides, error: undefined };\n\t\t} catch (error) {\n\t\t\tif (error instanceof SyntaxError) {\n\t\t\t\treturn emptyCustomModelsResult(`Failed to parse models.json: ${error.message}\\n\\nFile: ${modelsJsonPath}`);\n\t\t\t}\n\t\t\treturn emptyCustomModelsResult(\n\t\t\t\t`Failed to load models.json: ${error instanceof Error ? error.message : error}\\n\\nFile: ${modelsJsonPath}`,\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate validateConfig(config: ModelsConfig): void {\n\t\tfor (const [providerName, providerConfig] of Object.entries(config.providers)) {\n\t\t\tconst hasProviderApi = !!providerConfig.api;\n\t\t\tconst models = providerConfig.models ?? [];\n\t\t\tconst hasModelOverrides =\n\t\t\t\tproviderConfig.modelOverrides && Object.keys(providerConfig.modelOverrides).length > 0;\n\n\t\t\tif (models.length === 0) {\n\t\t\t\t// Override-only config: needs baseUrl, compat, modelOverrides, or some combination.\n\t\t\t\tif (!providerConfig.baseUrl && !providerConfig.compat && !hasModelOverrides) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Provider ${providerName}: must specify \"baseUrl\", \"compat\", \"modelOverrides\", or \"models\".`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Custom models are merged into provider models and require endpoint + auth.\n\t\t\t\tif (!providerConfig.baseUrl) {\n\t\t\t\t\tthrow new Error(`Provider ${providerName}: \"baseUrl\" is required when defining custom models.`);\n\t\t\t\t}\n\t\t\t\tif (!providerConfig.apiKey) {\n\t\t\t\t\tthrow new Error(`Provider ${providerName}: \"apiKey\" is required when defining custom models.`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const modelDef of models) {\n\t\t\t\tconst hasModelApi = !!modelDef.api;\n\n\t\t\t\tif (!hasProviderApi && !hasModelApi) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Provider ${providerName}, model ${modelDef.id}: no \"api\" specified. Set at provider or model level.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (!modelDef.id) throw new Error(`Provider ${providerName}: model missing \"id\"`);\n\t\t\t\t// Validate contextWindow/maxTokens only if provided (they have defaults)\n\t\t\t\tif (modelDef.contextWindow !== undefined && modelDef.contextWindow <= 0)\n\t\t\t\t\tthrow new Error(`Provider ${providerName}, model ${modelDef.id}: invalid contextWindow`);\n\t\t\t\tif (modelDef.maxTokens !== undefined && modelDef.maxTokens <= 0)\n\t\t\t\t\tthrow new Error(`Provider ${providerName}, model ${modelDef.id}: invalid maxTokens`);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate parseModels(config: ModelsConfig): Model<Api>[] {\n\t\tconst models: Model<Api>[] = [];\n\n\t\tfor (const [providerName, providerConfig] of Object.entries(config.providers)) {\n\t\t\tconst modelDefs = providerConfig.models ?? [];\n\t\t\tif (modelDefs.length === 0) continue; // Override-only, no custom models\n\n\t\t\tfor (const modelDef of modelDefs) {\n\t\t\t\tconst api = modelDef.api || providerConfig.api;\n\t\t\t\tif (!api) continue;\n\n\t\t\t\tconst compat = mergeCompat(providerConfig.compat, modelDef.compat);\n\t\t\t\tthis.storeModelHeaders(providerName, modelDef.id, modelDef.headers);\n\n\t\t\t\t// Provider baseUrl is required when custom models are defined.\n\t\t\t\t// Individual models can override it with modelDef.baseUrl.\n\t\t\t\tconst defaultCost = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };\n\t\t\t\tmodels.push({\n\t\t\t\t\tid: modelDef.id,\n\t\t\t\t\tname: modelDef.name ?? modelDef.id,\n\t\t\t\t\tapi: api as Api,\n\t\t\t\t\tprovider: providerName,\n\t\t\t\t\tbaseUrl: modelDef.baseUrl ?? providerConfig.baseUrl!,\n\t\t\t\t\treasoning: modelDef.reasoning ?? false,\n\t\t\t\t\tinput: (modelDef.input ?? [\"text\"]) as (\"text\" | \"image\")[],\n\t\t\t\t\tcost: modelDef.cost ?? defaultCost,\n\t\t\t\t\tcontextWindow: modelDef.contextWindow ?? 128000,\n\t\t\t\t\tmaxTokens: modelDef.maxTokens ?? 16384,\n\t\t\t\t\theaders: undefined,\n\t\t\t\t\tcompat,\n\t\t\t\t} as Model<Api>);\n\t\t\t}\n\t\t}\n\n\t\treturn models;\n\t}\n\n\t/**\n\t * Get all models (built-in + custom).\n\t * If models.json had errors, returns only built-in models.\n\t */\n\tgetAll(): Model<Api>[] {\n\t\treturn this.models;\n\t}\n\n\t/**\n\t * Get only models that have auth configured.\n\t * This is a fast check that doesn't refresh OAuth tokens.\n\t */\n\tgetAvailable(): Model<Api>[] {\n\t\treturn this.models.filter((m) => this.hasConfiguredAuth(m));\n\t}\n\n\t/**\n\t * Find a model by provider and ID.\n\t */\n\tfind(provider: string, modelId: string): Model<Api> | undefined {\n\t\treturn this.models.find((m) => m.provider === provider && m.id === modelId);\n\t}\n\n\t/**\n\t * Get API key for a model.\n\t */\n\thasConfiguredAuth(model: Model<Api>): boolean {\n\t\treturn (\n\t\t\tthis.authStorage.hasAuth(model.provider) ||\n\t\t\tthis.providerRequestConfigs.get(model.provider)?.apiKey !== undefined\n\t\t);\n\t}\n\n\tprivate getModelRequestKey(provider: string, modelId: string): string {\n\t\treturn `${provider}:${modelId}`;\n\t}\n\n\tprivate storeProviderRequestConfig(\n\t\tproviderName: string,\n\t\tconfig: {\n\t\t\tapiKey?: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\tauthHeader?: boolean;\n\t\t},\n\t): void {\n\t\tif (!config.apiKey && !config.headers && !config.authHeader) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.providerRequestConfigs.set(providerName, {\n\t\t\tapiKey: config.apiKey,\n\t\t\theaders: config.headers,\n\t\t\tauthHeader: config.authHeader,\n\t\t});\n\t}\n\n\tprivate storeModelHeaders(providerName: string, modelId: string, headers?: Record<string, string>): void {\n\t\tconst key = this.getModelRequestKey(providerName, modelId);\n\t\tif (!headers || Object.keys(headers).length === 0) {\n\t\t\tthis.modelRequestHeaders.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tthis.modelRequestHeaders.set(key, headers);\n\t}\n\n\t/**\n\t * Get API key and request headers for a model.\n\t */\n\tasync getApiKeyAndHeaders(model: Model<Api>): Promise<ResolvedRequestAuth> {\n\t\ttry {\n\t\t\tconst providerConfig = this.providerRequestConfigs.get(model.provider);\n\t\t\tconst apiKeyFromAuthStorage = await this.authStorage.getApiKey(model.provider, { includeFallback: false });\n\t\t\tconst apiKey =\n\t\t\t\tapiKeyFromAuthStorage ??\n\t\t\t\t(providerConfig?.apiKey\n\t\t\t\t\t? resolveConfigValueOrThrow(providerConfig.apiKey, `API key for provider \"${model.provider}\"`)\n\t\t\t\t\t: undefined);\n\n\t\t\tconst providerHeaders = resolveHeadersOrThrow(providerConfig?.headers, `provider \"${model.provider}\"`);\n\t\t\tconst modelHeaders = resolveHeadersOrThrow(\n\t\t\t\tthis.modelRequestHeaders.get(this.getModelRequestKey(model.provider, model.id)),\n\t\t\t\t`model \"${model.provider}/${model.id}\"`,\n\t\t\t);\n\n\t\t\tlet headers =\n\t\t\t\tmodel.headers || providerHeaders || modelHeaders\n\t\t\t\t\t? { ...model.headers, ...providerHeaders, ...modelHeaders }\n\t\t\t\t\t: undefined;\n\n\t\t\tif (providerConfig?.authHeader) {\n\t\t\t\tif (!apiKey) {\n\t\t\t\t\treturn { ok: false, error: `No API key found for \"${model.provider}\"` };\n\t\t\t\t}\n\t\t\t\theaders = { ...headers, Authorization: `Bearer ${apiKey}` };\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tapiKey,\n\t\t\t\theaders: headers && Object.keys(headers).length > 0 ? headers : undefined,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Get API key for a provider.\n\t */\n\tasync getApiKeyForProvider(provider: string): Promise<string | undefined> {\n\t\tconst apiKey = await this.authStorage.getApiKey(provider, { includeFallback: false });\n\t\tif (apiKey !== undefined) {\n\t\t\treturn apiKey;\n\t\t}\n\n\t\tconst providerApiKey = this.providerRequestConfigs.get(provider)?.apiKey;\n\t\treturn providerApiKey ? resolveConfigValueUncached(providerApiKey) : undefined;\n\t}\n\n\t/**\n\t * Check if a model is using OAuth credentials (subscription).\n\t */\n\tisUsingOAuth(model: Model<Api>): boolean {\n\t\tconst cred = this.authStorage.get(model.provider);\n\t\treturn cred?.type === \"oauth\";\n\t}\n\n\t/**\n\t * Register a provider dynamically (from extensions).\n\t *\n\t * If provider has models: replaces all existing models for this provider.\n\t * If provider has only baseUrl/headers: overrides existing models' URLs.\n\t * If provider has oauth: registers OAuth provider for /login support.\n\t */\n\tregisterProvider(providerName: string, config: ProviderConfigInput): void {\n\t\tthis.validateProviderConfig(providerName, config);\n\t\tthis.applyProviderConfig(providerName, config);\n\t\tthis.registeredProviders.set(providerName, config);\n\t}\n\n\t/**\n\t * Unregister a previously registered provider.\n\t *\n\t * Removes the provider from the registry and reloads models from disk so that\n\t * built-in models overridden by this provider are restored to their original state.\n\t * Also resets dynamic OAuth and API stream registrations before reapplying\n\t * remaining dynamic providers.\n\t * Has no effect if the provider was never registered.\n\t */\n\tunregisterProvider(providerName: string): void {\n\t\tif (!this.registeredProviders.has(providerName)) return;\n\t\tthis.registeredProviders.delete(providerName);\n\t\tthis.refresh();\n\t}\n\n\tprivate validateProviderConfig(providerName: string, config: ProviderConfigInput): void {\n\t\tif (config.streamSimple && !config.api) {\n\t\t\tthrow new Error(`Provider ${providerName}: \"api\" is required when registering streamSimple.`);\n\t\t}\n\n\t\tif (!config.models || config.models.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!config.baseUrl) {\n\t\t\tthrow new Error(`Provider ${providerName}: \"baseUrl\" is required when defining models.`);\n\t\t}\n\t\tif (!config.apiKey && !config.oauth) {\n\t\t\tthrow new Error(`Provider ${providerName}: \"apiKey\" or \"oauth\" is required when defining models.`);\n\t\t}\n\n\t\tfor (const modelDef of config.models) {\n\t\t\tconst api = modelDef.api || config.api;\n\t\t\tif (!api) {\n\t\t\t\tthrow new Error(`Provider ${providerName}, model ${modelDef.id}: no \"api\" specified.`);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate applyProviderConfig(providerName: string, config: ProviderConfigInput): void {\n\t\t// Register OAuth provider if provided\n\t\tif (config.oauth) {\n\t\t\t// Ensure the OAuth provider ID matches the provider name\n\t\t\tconst oauthProvider: OAuthProviderInterface = {\n\t\t\t\t...config.oauth,\n\t\t\t\tid: providerName,\n\t\t\t};\n\t\t\tregisterOAuthProvider(oauthProvider);\n\t\t}\n\n\t\tif (config.streamSimple) {\n\t\t\tconst streamSimple = config.streamSimple;\n\t\t\tregisterApiProvider(\n\t\t\t\t{\n\t\t\t\t\tapi: config.api!,\n\t\t\t\t\tstream: (model, context, options) => streamSimple(model, context, options as SimpleStreamOptions),\n\t\t\t\t\tstreamSimple,\n\t\t\t\t},\n\t\t\t\t`provider:${providerName}`,\n\t\t\t);\n\t\t}\n\n\t\tthis.storeProviderRequestConfig(providerName, config);\n\n\t\tif (config.models && config.models.length > 0) {\n\t\t\t// Full replacement: remove existing models for this provider\n\t\t\tthis.models = this.models.filter((m) => m.provider !== providerName);\n\n\t\t\t// Parse and add new models\n\t\t\tfor (const modelDef of config.models) {\n\t\t\t\tconst api = modelDef.api || config.api;\n\t\t\t\tthis.storeModelHeaders(providerName, modelDef.id, modelDef.headers);\n\n\t\t\t\tthis.models.push({\n\t\t\t\t\tid: modelDef.id,\n\t\t\t\t\tname: modelDef.name,\n\t\t\t\t\tapi: api as Api,\n\t\t\t\t\tprovider: providerName,\n\t\t\t\t\tbaseUrl: config.baseUrl!,\n\t\t\t\t\treasoning: modelDef.reasoning,\n\t\t\t\t\tinput: modelDef.input as (\"text\" | \"image\")[],\n\t\t\t\t\tcost: modelDef.cost,\n\t\t\t\t\tcontextWindow: modelDef.contextWindow,\n\t\t\t\t\tmaxTokens: modelDef.maxTokens,\n\t\t\t\t\theaders: undefined,\n\t\t\t\t\tcompat: modelDef.compat,\n\t\t\t\t} as Model<Api>);\n\t\t\t}\n\n\t\t\t// Apply OAuth modifyModels if credentials exist (e.g., to update baseUrl)\n\t\t\tif (config.oauth?.modifyModels) {\n\t\t\t\tconst cred = this.authStorage.get(providerName);\n\t\t\t\tif (cred?.type === \"oauth\") {\n\t\t\t\t\tthis.models = config.oauth.modifyModels(this.models, cred);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (config.baseUrl || config.headers) {\n\t\t\t// Override-only: update baseUrl for existing models. Request headers are resolved per request.\n\t\t\tthis.models = this.models.map((m) => {\n\t\t\t\tif (m.provider !== providerName) return m;\n\t\t\t\treturn {\n\t\t\t\t\t...m,\n\t\t\t\t\tbaseUrl: config.baseUrl ?? m.baseUrl,\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t}\n}\n\n/**\n * Input type for registerProvider API.\n */\nexport interface ProviderConfigInput {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: Api;\n\tstreamSimple?: (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;\n\theaders?: Record<string, string>;\n\tauthHeader?: boolean;\n\t/** OAuth provider for /login support */\n\toauth?: Omit<OAuthProviderInterface, \"id\">;\n\tmodels?: Array<{\n\t\tid: string;\n\t\tname: string;\n\t\tapi?: Api;\n\t\tbaseUrl?: string;\n\t\treasoning: boolean;\n\t\tinput: (\"text\" | \"image\")[];\n\t\tcost: { input: number; output: number; cacheRead: number; cacheWrite: number };\n\t\tcontextWindow: number;\n\t\tmaxTokens: number;\n\t\theaders?: Record<string, string>;\n\t\tcompat?: Model<Api>[\"compat\"];\n\t}>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"model-registry.d.ts","sourceRoot":"","sources":["../../src/core/model-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,KAAK,GAAG,EACR,KAAK,2BAA2B,EAChC,KAAK,OAAO,EAIZ,KAAK,KAAK,EACV,KAAK,sBAAsB,EAK3B,KAAK,mBAAmB,EACxB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACN,qBAAqB,EAIrB,MAAM,2BAA2B,CAAC;AAqKnC,MAAM,MAAM,mBAAmB,GAC5B;IACA,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,GACD;IACA,E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QAC5B,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/E,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;KAC9B,CAAC,CAAC;CACH"}
|
|
@@ -79,7 +79,9 @@ const OpenAICompletionsCompatSchema = Type.Object({
|
|
|
79
79
|
vercelGatewayRouting: Type.Optional(VercelGatewayRoutingSchema),
|
|
80
80
|
supportsStrictMode: Type.Optional(Type.Boolean()),
|
|
81
81
|
});
|
|
82
|
-
const OpenAIResponsesCompatSchema = Type.Object({
|
|
82
|
+
const OpenAIResponsesCompatSchema = Type.Object({
|
|
83
|
+
// Reserved for future use
|
|
84
|
+
});
|
|
83
85
|
const OpenAICompatSchema = Type.Union([OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema]);
|
|
84
86
|
// Schema for custom model definition
|
|
85
87
|
// Most fields are optional with sensible defaults for local models (Ollama, LM Studio, etc.)
|
|
@@ -193,16 +195,14 @@ export const clearApiKeyCache = clearConfigValueCache;
|
|
|
193
195
|
* Model registry - loads and manages models, resolves API keys via AuthStorage.
|
|
194
196
|
*/
|
|
195
197
|
export class ModelRegistry {
|
|
196
|
-
authStorage;
|
|
197
|
-
modelsJsonPath;
|
|
198
|
-
models = [];
|
|
199
|
-
providerRequestConfigs = new Map();
|
|
200
|
-
modelRequestHeaders = new Map();
|
|
201
|
-
registeredProviders = new Map();
|
|
202
|
-
loadError = undefined;
|
|
203
198
|
constructor(authStorage, modelsJsonPath) {
|
|
204
199
|
this.authStorage = authStorage;
|
|
205
200
|
this.modelsJsonPath = modelsJsonPath;
|
|
201
|
+
this.models = [];
|
|
202
|
+
this.providerRequestConfigs = new Map();
|
|
203
|
+
this.modelRequestHeaders = new Map();
|
|
204
|
+
this.registeredProviders = new Map();
|
|
205
|
+
this.loadError = undefined;
|
|
206
206
|
this.loadModels();
|
|
207
207
|
}
|
|
208
208
|
static create(authStorage, modelsJsonPath = join(getAgentDir(), "models.json")) {
|