@theia/ai-ide 1.75.0-next.8 → 1.75.0
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/lib/browser/ai-allow-all-mode-chat-banner.js +2 -20
- package/lib/browser/ai-allow-all-mode-chat-banner.js.map +1 -1
- package/lib/browser/ai-configuration/agent-icon.d.ts +16 -0
- package/lib/browser/ai-configuration/agent-icon.d.ts.map +1 -0
- package/lib/browser/ai-configuration/agent-icon.js +38 -0
- package/lib/browser/ai-configuration/agent-icon.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.d.ts +36 -0
- package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.js +163 -0
- package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.d.ts +50 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.js +208 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.js +139 -0
- package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.d.ts +13 -0
- package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js +48 -0
- package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.d.ts +22 -0
- package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.js +72 -0
- package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.js +126 -0
- package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-resource.d.ts +10 -0
- package/lib/browser/ai-configuration/ai-configuration-resource.d.ts.map +1 -0
- package/lib/browser/ai-configuration/{components/configuration-section.js → ai-configuration-resource.js} +11 -11
- package/lib/browser/ai-configuration/ai-configuration-resource.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-search-widget.d.ts +29 -0
- package/lib/browser/ai-configuration/ai-configuration-search-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-search-widget.js +106 -0
- package/lib/browser/ai-configuration/ai-configuration-search-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-search.d.ts +18 -0
- package/lib/browser/ai-configuration/ai-configuration-search.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-search.js +45 -0
- package/lib/browser/ai-configuration/ai-configuration-search.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-search.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-search.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-search.spec.js +79 -0
- package/lib/browser/ai-configuration/ai-configuration-search.spec.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-model.d.ts +8 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-model.d.ts.map +1 -0
- package/lib/browser/ai-configuration/{base/ai-configuration-base-widget.js → ai-configuration-tree-model.js} +11 -14
- package/lib/browser/ai-configuration/ai-configuration-tree-model.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.d.ts +57 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.js +134 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.js +134 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-widget.d.ts +96 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-widget.js +407 -0
- package/lib/browser/ai-configuration/ai-configuration-tree-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +38 -4
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +151 -19
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +21 -23
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.js +102 -70
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts +56 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js +195 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js +140 -0
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-chips.d.ts +15 -0
- package/lib/browser/ai-configuration/categories/agent-chips.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-chips.js +19 -0
- package/lib/browser/ai-configuration/categories/agent-chips.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts +37 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.js +99 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-detail-view.d.ts +28 -0
- package/lib/browser/ai-configuration/categories/agent-detail-view.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-detail-view.js +135 -0
- package/lib/browser/ai-configuration/categories/agent-detail-view.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts +78 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.js +352 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.js +99 -0
- package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.d.ts +93 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.js +313 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.spec.js +213 -0
- package/lib/browser/ai-configuration/categories/general-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.d.ts +53 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.js +241 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.js +75 -0
- package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.d.ts +72 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.js +227 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.spec.js +145 -0
- package/lib/browser/ai-configuration/categories/models-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.d.ts +114 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.js +341 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.js +199 -0
- package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.d.ts +84 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.js +341 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.js +184 -0
- package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.d.ts +38 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js +130 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.js +51 -0
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.d.ts +60 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.js +302 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.js +111 -0
- package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.d.ts +72 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.js +245 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.js.map +1 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.js +131 -0
- package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.js.map +1 -0
- package/lib/browser/ai-configuration/components/agent-notification-settings.d.ts +6 -2
- package/lib/browser/ai-configuration/components/agent-notification-settings.d.ts.map +1 -1
- package/lib/browser/ai-configuration/components/agent-notification-settings.js +15 -21
- package/lib/browser/ai-configuration/components/agent-notification-settings.js.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.d.ts +25 -1
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.js +159 -63
- package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/language-model-renderer.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.spec.js +93 -0
- package/lib/browser/ai-configuration/language-model-renderer.spec.js.map +1 -0
- package/lib/browser/ai-sessions-widget.js +12 -16
- package/lib/browser/ai-sessions-widget.js.map +1 -1
- package/lib/browser/app-tester-chat-agent.d.ts +2 -0
- package/lib/browser/app-tester-chat-agent.d.ts.map +1 -1
- package/lib/browser/app-tester-chat-agent.js +5 -0
- package/lib/browser/app-tester-chat-agent.js.map +1 -1
- package/lib/browser/architect-agent.d.ts +2 -0
- package/lib/browser/architect-agent.d.ts.map +1 -1
- package/lib/browser/architect-agent.js +5 -0
- package/lib/browser/architect-agent.js.map +1 -1
- package/lib/browser/architect-prompt-template.d.ts.map +1 -1
- package/lib/browser/architect-prompt-template.js +7 -0
- package/lib/browser/architect-prompt-template.js.map +1 -1
- package/lib/browser/chat-session-item.d.ts.map +1 -1
- package/lib/browser/chat-session-item.js +17 -30
- package/lib/browser/chat-session-item.js.map +1 -1
- package/lib/browser/chat-session-list-components.js +7 -30
- package/lib/browser/chat-session-list-components.js.map +1 -1
- package/lib/browser/chat-session-list-service.d.ts +2 -1
- package/lib/browser/chat-session-list-service.d.ts.map +1 -1
- package/lib/browser/chat-session-list-service.js +6 -1
- package/lib/browser/chat-session-list-service.js.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.js +3 -21
- package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
- package/lib/browser/code-reviewer-agent.d.ts +2 -0
- package/lib/browser/code-reviewer-agent.d.ts.map +1 -1
- package/lib/browser/code-reviewer-agent.js +5 -0
- package/lib/browser/code-reviewer-agent.js.map +1 -1
- package/lib/browser/coder-agent.d.ts +2 -0
- package/lib/browser/coder-agent.d.ts.map +1 -1
- package/lib/browser/coder-agent.js +6 -1
- package/lib/browser/coder-agent.js.map +1 -1
- package/lib/browser/context-file-validation-service-impl.spec.js +2 -0
- package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -1
- package/lib/browser/create-skill-agent.d.ts +2 -0
- package/lib/browser/create-skill-agent.d.ts.map +1 -1
- package/lib/browser/create-skill-agent.js +5 -0
- package/lib/browser/create-skill-agent.js.map +1 -1
- package/lib/browser/explore-agent.d.ts +2 -0
- package/lib/browser/explore-agent.d.ts.map +1 -1
- package/lib/browser/explore-agent.js +5 -0
- package/lib/browser/explore-agent.js.map +1 -1
- package/lib/browser/file-changeset-functions.d.ts +7 -1
- package/lib/browser/file-changeset-functions.d.ts.map +1 -1
- package/lib/browser/file-changeset-functions.js +62 -20
- package/lib/browser/file-changeset-functions.js.map +1 -1
- package/lib/browser/file-changeset-functions.spec.js +130 -1
- package/lib/browser/file-changeset-functions.spec.js.map +1 -1
- package/lib/browser/frontend-module.d.ts.map +1 -1
- package/lib/browser/frontend-module.js +65 -59
- package/lib/browser/frontend-module.js.map +1 -1
- package/lib/browser/github-chat-agent.d.ts +2 -1
- package/lib/browser/github-chat-agent.d.ts.map +1 -1
- package/lib/browser/github-chat-agent.js +5 -0
- package/lib/browser/github-chat-agent.js.map +1 -1
- package/lib/browser/github-repo-variable-contribution.d.ts +2 -1
- package/lib/browser/github-repo-variable-contribution.d.ts.map +1 -1
- package/lib/browser/github-repo-variable-contribution.js +6 -1
- package/lib/browser/github-repo-variable-contribution.js.map +1 -1
- package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -1
- package/lib/browser/ide-chat-welcome-message-provider.js +31 -118
- package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -1
- package/lib/browser/memory-capability-contribution.d.ts +8 -0
- package/lib/browser/memory-capability-contribution.d.ts.map +1 -0
- package/lib/browser/memory-capability-contribution.js +88 -0
- package/lib/browser/memory-capability-contribution.js.map +1 -0
- package/lib/browser/memory-capability-contribution.spec.d.ts +2 -0
- package/lib/browser/memory-capability-contribution.spec.d.ts.map +1 -0
- package/lib/browser/memory-capability-contribution.spec.js +74 -0
- package/lib/browser/memory-capability-contribution.spec.js.map +1 -0
- package/lib/browser/memory-directory-variable-contribution.d.ts +41 -0
- package/lib/browser/memory-directory-variable-contribution.d.ts.map +1 -0
- package/lib/browser/memory-directory-variable-contribution.js +107 -0
- package/lib/browser/memory-directory-variable-contribution.js.map +1 -0
- package/lib/browser/memory-directory-variable-contribution.spec.d.ts +2 -0
- package/lib/browser/memory-directory-variable-contribution.spec.d.ts.map +1 -0
- package/lib/browser/memory-directory-variable-contribution.spec.js +98 -0
- package/lib/browser/memory-directory-variable-contribution.spec.js.map +1 -0
- package/lib/browser/open-editors-hint-contribution.d.ts +7 -0
- package/lib/browser/open-editors-hint-contribution.d.ts.map +1 -0
- package/lib/browser/open-editors-hint-contribution.js +43 -0
- package/lib/browser/open-editors-hint-contribution.js.map +1 -0
- package/lib/browser/project-info-agent.d.ts +2 -0
- package/lib/browser/project-info-agent.d.ts.map +1 -1
- package/lib/browser/project-info-agent.js +5 -0
- package/lib/browser/project-info-agent.js.map +1 -1
- package/lib/browser/review/pr-review-agent.d.ts +2 -0
- package/lib/browser/review/pr-review-agent.d.ts.map +1 -1
- package/lib/browser/review/pr-review-agent.js +5 -0
- package/lib/browser/review/pr-review-agent.js.map +1 -1
- package/lib/browser/summarize-session-command-contribution.d.ts +2 -1
- package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -1
- package/lib/browser/summarize-session-command-contribution.js +6 -1
- package/lib/browser/summarize-session-command-contribution.js.map +1 -1
- package/lib/browser/task-context-file-storage-service.d.ts.map +1 -1
- package/lib/browser/task-context-file-storage-service.js +1 -0
- package/lib/browser/task-context-file-storage-service.js.map +1 -1
- package/lib/browser/todo-tool-renderer.js +11 -19
- package/lib/browser/todo-tool-renderer.js.map +1 -1
- package/lib/browser/user-interaction-tool-renderer.js +39 -83
- package/lib/browser/user-interaction-tool-renderer.js.map +1 -1
- package/lib/browser/user-interaction-tool.d.ts +2 -0
- package/lib/browser/user-interaction-tool.d.ts.map +1 -1
- package/lib/browser/user-interaction-tool.js +7 -1
- package/lib/browser/user-interaction-tool.js.map +1 -1
- package/lib/browser/user-interaction-tool.spec.js +4 -2
- package/lib/browser/user-interaction-tool.spec.js.map +1 -1
- package/lib/browser/workspace-functions.d.ts +45 -7
- package/lib/browser/workspace-functions.d.ts.map +1 -1
- package/lib/browser/workspace-functions.js +108 -70
- package/lib/browser/workspace-functions.js.map +1 -1
- package/lib/browser/workspace-functions.spec.js +139 -9
- package/lib/browser/workspace-functions.spec.js.map +1 -1
- package/lib/browser/workspace-launch-provider.spec.js +3 -0
- package/lib/browser/workspace-launch-provider.spec.js.map +1 -1
- package/lib/browser/workspace-search-provider.d.ts.map +1 -1
- package/lib/browser/workspace-search-provider.js +4 -7
- package/lib/browser/workspace-search-provider.js.map +1 -1
- package/lib/browser/workspace-search-provider.spec.js +1 -2
- package/lib/browser/workspace-search-provider.spec.js.map +1 -1
- package/lib/browser/workspace-task-provider.spec.js +4 -0
- package/lib/browser/workspace-task-provider.spec.js.map +1 -1
- package/lib/common/coder-replace-prompt-template.d.ts +0 -2
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
- package/lib/common/coder-replace-prompt-template.js +10 -11
- package/lib/common/coder-replace-prompt-template.js.map +1 -1
- package/lib/common/command-chat-agents.d.ts +2 -1
- package/lib/common/command-chat-agents.d.ts.map +1 -1
- package/lib/common/command-chat-agents.js +6 -1
- package/lib/common/command-chat-agents.js.map +1 -1
- package/lib/common/open-editors-hint-fragment-id.d.ts +2 -0
- package/lib/common/open-editors-hint-fragment-id.d.ts.map +1 -0
- package/lib/{browser/ai-configuration/components/empty-state.js → common/open-editors-hint-fragment-id.js} +5 -11
- package/lib/common/open-editors-hint-fragment-id.js.map +1 -0
- package/lib/common/orchestrator-chat-agent.d.ts +2 -1
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -1
- package/lib/common/orchestrator-chat-agent.js +5 -0
- package/lib/common/orchestrator-chat-agent.js.map +1 -1
- package/lib/common/universal-chat-agent.d.ts +2 -0
- package/lib/common/universal-chat-agent.d.ts.map +1 -1
- package/lib/common/universal-chat-agent.js +5 -0
- package/lib/common/universal-chat-agent.js.map +1 -1
- package/lib/common/universal-prompt-template.d.ts.map +1 -1
- package/lib/common/universal-prompt-template.js +3 -0
- package/lib/common/universal-prompt-template.js.map +1 -1
- package/lib/common/workspace-preferences.js +2 -2
- package/lib/common/workspace-preferences.js.map +1 -1
- package/lib/common/workspace-search-provider-util.d.ts +2 -1
- package/lib/common/workspace-search-provider-util.d.ts.map +1 -1
- package/lib/common/workspace-search-provider-util.js +3 -2
- package/lib/common/workspace-search-provider-util.js.map +1 -1
- package/lib/common/workspace-search-provider-util.spec.d.ts +2 -0
- package/lib/common/workspace-search-provider-util.spec.d.ts.map +1 -0
- package/lib/common/workspace-search-provider-util.spec.js +55 -0
- package/lib/common/workspace-search-provider-util.spec.js.map +1 -0
- package/lib/node/github-repo-service-impl.d.ts +2 -0
- package/lib/node/github-repo-service-impl.d.ts.map +1 -1
- package/lib/node/github-repo-service-impl.js +7 -1
- package/lib/node/github-repo-service-impl.js.map +1 -1
- package/package.json +26 -25
- package/src/browser/ai-configuration/agent-icon.ts +37 -0
- package/src/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.ts +164 -0
- package/src/browser/ai-configuration/ai-configuration-detail-widget.spec.ts +165 -0
- package/src/browser/ai-configuration/ai-configuration-detail-widget.tsx +237 -0
- package/src/browser/ai-configuration/ai-configuration-label-provider-contribution.ts +47 -0
- package/src/browser/ai-configuration/ai-configuration-open-preference-renderer.ts +64 -0
- package/src/browser/ai-configuration/ai-configuration-preference-ownership.spec.ts +135 -0
- package/src/browser/ai-configuration/{components/configuration-section.tsx → ai-configuration-resource.ts} +9 -19
- package/src/browser/ai-configuration/ai-configuration-search-widget.tsx +135 -0
- package/src/browser/ai-configuration/ai-configuration-search.spec.ts +91 -0
- package/src/browser/ai-configuration/ai-configuration-search.ts +43 -0
- package/src/browser/ai-configuration/{components/empty-state.tsx → ai-configuration-tree-model.ts} +7 -11
- package/src/browser/ai-configuration/ai-configuration-tree-nodes.spec.ts +150 -0
- package/src/browser/ai-configuration/ai-configuration-tree-nodes.ts +167 -0
- package/src/browser/ai-configuration/ai-configuration-tree-widget.tsx +457 -0
- package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +156 -18
- package/src/browser/ai-configuration/ai-configuration-widget.tsx +107 -75
- package/src/browser/ai-configuration/categories/agent-capabilities-settings.spec.ts +161 -0
- package/src/browser/ai-configuration/categories/agent-capabilities-settings.tsx +340 -0
- package/src/browser/ai-configuration/categories/agent-chips.tsx +51 -0
- package/src/browser/ai-configuration/categories/agent-detail-model.ts +152 -0
- package/src/browser/ai-configuration/categories/agent-detail-view.tsx +329 -0
- package/src/browser/ai-configuration/categories/agents-configuration-category.spec.ts +119 -0
- package/src/browser/ai-configuration/categories/agents-configuration-category.tsx +431 -0
- package/src/browser/ai-configuration/categories/general-configuration-category.spec.ts +225 -0
- package/src/browser/ai-configuration/categories/general-configuration-category.tsx +465 -0
- package/src/browser/ai-configuration/categories/model-aliases-configuration-category.spec.ts +87 -0
- package/src/browser/ai-configuration/categories/model-aliases-configuration-category.tsx +286 -0
- package/src/browser/ai-configuration/categories/models-configuration-category.spec.ts +167 -0
- package/src/browser/ai-configuration/categories/models-configuration-category.tsx +264 -0
- package/src/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.ts +250 -0
- package/src/browser/ai-configuration/categories/prompt-snippets-configuration-category.tsx +438 -0
- package/src/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.ts +226 -0
- package/src/browser/ai-configuration/categories/prompts-and-skills-configuration-category.tsx +419 -0
- package/src/browser/ai-configuration/categories/token-usage-configuration-category.spec.ts +57 -0
- package/src/browser/ai-configuration/categories/token-usage-configuration-category.tsx +185 -0
- package/src/browser/ai-configuration/categories/tools-configuration-category.spec.ts +130 -0
- package/src/browser/ai-configuration/categories/tools-configuration-category.tsx +421 -0
- package/src/browser/ai-configuration/categories/variables-configuration-category.spec.ts +154 -0
- package/src/browser/ai-configuration/categories/variables-configuration-category.tsx +322 -0
- package/src/browser/ai-configuration/components/agent-notification-settings.tsx +38 -33
- package/src/browser/ai-configuration/language-model-renderer.spec.ts +100 -0
- package/src/browser/ai-configuration/language-model-renderer.tsx +244 -100
- package/src/browser/app-tester-chat-agent.ts +5 -2
- package/src/browser/architect-agent.ts +5 -2
- package/src/browser/architect-prompt-template.ts +7 -0
- package/src/browser/chat-session-item.tsx +2 -4
- package/src/browser/chat-session-list-service.ts +6 -3
- package/src/browser/code-reviewer-agent.ts +5 -2
- package/src/browser/coder-agent.ts +7 -5
- package/src/browser/context-file-validation-service-impl.spec.ts +3 -2
- package/src/browser/create-skill-agent.ts +5 -2
- package/src/browser/explore-agent.ts +5 -2
- package/src/browser/file-changeset-functions.spec.ts +158 -5
- package/src/browser/file-changeset-functions.ts +61 -23
- package/src/browser/frontend-module.ts +76 -63
- package/src/browser/github-chat-agent.ts +5 -2
- package/src/browser/github-repo-variable-contribution.ts +6 -3
- package/src/browser/ide-chat-welcome-message-provider.tsx +11 -11
- package/src/browser/memory-capability-contribution.spec.ts +85 -0
- package/src/browser/memory-capability-contribution.ts +86 -0
- package/src/browser/memory-directory-variable-contribution.spec.ts +113 -0
- package/src/browser/memory-directory-variable-contribution.ts +113 -0
- package/src/browser/open-editors-hint-contribution.ts +38 -0
- package/src/browser/project-info-agent.ts +5 -2
- package/src/browser/review/pr-review-agent.ts +5 -2
- package/src/browser/style/ai-configuration-base.css +0 -6
- package/src/browser/style/ai-configuration-shell.css +416 -0
- package/src/browser/style/ai-configuration-table.css +2 -15
- package/src/browser/style/index.css +220 -276
- package/src/browser/summarize-session-command-contribution.ts +6 -3
- package/src/browser/task-context-file-storage-service.ts +5 -2
- package/src/browser/user-interaction-tool.spec.ts +5 -2
- package/src/browser/user-interaction-tool.ts +6 -2
- package/src/browser/workspace-functions.spec.ts +163 -10
- package/src/browser/workspace-functions.ts +121 -72
- package/src/browser/workspace-launch-provider.spec.ts +4 -1
- package/src/browser/workspace-search-provider.spec.ts +1 -2
- package/src/browser/workspace-search-provider.ts +4 -7
- package/src/browser/workspace-task-provider.spec.ts +5 -1
- package/src/common/coder-replace-prompt-template.ts +9 -9
- package/src/common/command-chat-agents.ts +6 -2
- package/src/{browser/ai-configuration/base/ai-configuration-base-widget.tsx → common/open-editors-hint-fragment-id.ts} +2 -22
- package/src/common/orchestrator-chat-agent.ts +5 -2
- package/src/common/universal-chat-agent.ts +5 -2
- package/src/common/universal-prompt-template.ts +3 -0
- package/src/common/workspace-preferences.ts +2 -2
- package/src/common/workspace-search-provider-util.spec.ts +61 -0
- package/src/common/workspace-search-provider-util.ts +3 -2
- package/src/node/github-repo-service-impl.ts +6 -2
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +0 -72
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +0 -620
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.spec.d.ts +0 -2
- package/lib/browser/ai-configuration/agent-configuration-widget.spec.d.ts.map +0 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.spec.js +0 -56
- package/lib/browser/ai-configuration/agent-configuration-widget.spec.js.map +0 -1
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts +0 -31
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js +0 -55
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts +0 -13
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.js.map +0 -1
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts +0 -23
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js +0 -60
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts +0 -55
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js +0 -96
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts +0 -44
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js +0 -66
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/components/configuration-section.d.ts +0 -12
- package/lib/browser/ai-configuration/components/configuration-section.d.ts.map +0 -1
- package/lib/browser/ai-configuration/components/configuration-section.js.map +0 -1
- package/lib/browser/ai-configuration/components/empty-state.d.ts +0 -10
- package/lib/browser/ai-configuration/components/empty-state.d.ts.map +0 -1
- package/lib/browser/ai-configuration/components/empty-state.js.map +0 -1
- package/lib/browser/ai-configuration/components/expandable-section.d.ts +0 -13
- package/lib/browser/ai-configuration/components/expandable-section.d.ts.map +0 -1
- package/lib/browser/ai-configuration/components/expandable-section.js +0 -31
- package/lib/browser/ai-configuration/components/expandable-section.js.map +0 -1
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +0 -26
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +0 -198
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -140
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +0 -508
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.d.ts +0 -29
- package/lib/browser/ai-configuration/skills-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.js +0 -166
- package/lib/browser/ai-configuration/skills-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.spec.d.ts +0 -2
- package/lib/browser/ai-configuration/skills-configuration-widget.spec.d.ts.map +0 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.spec.js +0 -191
- package/lib/browser/ai-configuration/skills-configuration-widget.spec.js.map +0 -1
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts +0 -9
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +0 -1
- package/lib/browser/ai-configuration/template-settings-renderer.js +0 -78
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +0 -1
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +0 -20
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js +0 -170
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +0 -52
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.js +0 -357
- package/lib/browser/ai-configuration/tools-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +0 -22
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/variable-configuration-widget.js +0 -133
- package/lib/browser/ai-configuration/variable-configuration-widget.js.map +0 -1
- package/src/browser/ai-configuration/agent-configuration-widget.spec.ts +0 -71
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +0 -928
- package/src/browser/ai-configuration/base/ai-card-grid-configuration-widget.tsx +0 -72
- package/src/browser/ai-configuration/base/ai-hierarchical-configuration-widget.tsx +0 -51
- package/src/browser/ai-configuration/base/ai-list-detail-configuration-widget.tsx +0 -140
- package/src/browser/ai-configuration/base/ai-table-configuration-widget.tsx +0 -107
- package/src/browser/ai-configuration/components/expandable-section.tsx +0 -51
- package/src/browser/ai-configuration/model-aliases-configuration-widget.tsx +0 -270
- package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +0 -736
- package/src/browser/ai-configuration/skills-configuration-widget.spec.ts +0 -248
- package/src/browser/ai-configuration/skills-configuration-widget.tsx +0 -229
- package/src/browser/ai-configuration/template-settings-renderer.tsx +0 -125
- package/src/browser/ai-configuration/token-usage-configuration-widget.tsx +0 -214
- package/src/browser/ai-configuration/tools-configuration-widget.tsx +0 -544
- package/src/browser/ai-configuration/variable-configuration-widget.tsx +0 -159
- package/src/browser/style/ai-configuration-cards.css +0 -60
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { FrontendLanguageModelRegistry } from '@theia/ai-core/lib/common/language-model';
|
|
18
|
+
import {
|
|
19
|
+
BYPASS_MODEL_REQUIREMENT_PREF,
|
|
20
|
+
PERSISTED_SESSION_LIMIT_PREF,
|
|
21
|
+
PIN_CHAT_AGENT_PREF,
|
|
22
|
+
SESSION_STORAGE_PREF,
|
|
23
|
+
WELCOME_SCREEN_SESSIONS_PREF
|
|
24
|
+
} from '@theia/ai-chat/lib/common/ai-chat-preferences';
|
|
25
|
+
import { Emitter, Event, ILogger, nls } from '@theia/core';
|
|
26
|
+
import { codicon } from '@theia/core/lib/browser';
|
|
27
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
28
|
+
import { DisposableCollection } from '@theia/core/lib/common';
|
|
29
|
+
import { inject, injectable, named, postConstruct } from '@theia/core/shared/inversify';
|
|
30
|
+
import * as React from '@theia/core/shared/react';
|
|
31
|
+
import {
|
|
32
|
+
AiConfigurationCategory,
|
|
33
|
+
AiConfigurationCategoryId,
|
|
34
|
+
AiConfigurationCategoryOrder,
|
|
35
|
+
AiConfigurationRenderContext,
|
|
36
|
+
AiConfigurationSearchItem,
|
|
37
|
+
AiConfigurationSearchProvider
|
|
38
|
+
} from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
|
|
39
|
+
import { AiSettingsRowService } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-settings-row-service';
|
|
40
|
+
import {
|
|
41
|
+
AiEnumSelect,
|
|
42
|
+
AiSessionLimitControl,
|
|
43
|
+
AiToggleSwitch
|
|
44
|
+
} from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-controls';
|
|
45
|
+
import { AiConfigurationSection, AiMarkdownDescription } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-primitives';
|
|
46
|
+
import { AiConfigurationSettingRow } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-setting-row';
|
|
47
|
+
import { AiSettingsRow } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-settings-row';
|
|
48
|
+
import { AiConfigurationCategoryRegistry } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category-registry';
|
|
49
|
+
import { PREFERENCE_NAME_ENABLE_AI } from '../../../common/ai-ide-preferences';
|
|
50
|
+
|
|
51
|
+
/** Documentation on Theia's AI capabilities, linked from the hero's cost/data disclosure. */
|
|
52
|
+
const AI_DOCUMENTATION_URL = 'https://theia-ide.org/docs/user_ai/';
|
|
53
|
+
|
|
54
|
+
/** A single setting on the page, paired with its section for the deep-search index. */
|
|
55
|
+
interface GeneralSettingRef {
|
|
56
|
+
readonly section: string;
|
|
57
|
+
readonly preferenceId: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The General category: a `single-page` category that presents the top-level `ai-features.*`
|
|
62
|
+
* preferences as a curated "AI Features" page. A hero card hosts the master enablement toggle
|
|
63
|
+
* and LLM-provider status; the dependent settings are grouped into a Chat section and are
|
|
64
|
+
* visually gated while the master toggle is off.
|
|
65
|
+
*
|
|
66
|
+
* All values are read and written through {@link AiSettingsRowService} (backed by the
|
|
67
|
+
* {@link PreferenceService}), so the page stays live-synced with `settings.json` and the
|
|
68
|
+
* classic preferences editor. Gating is purely visual/interactive; preference values are
|
|
69
|
+
* never rewritten when the master toggle changes.
|
|
70
|
+
*/
|
|
71
|
+
@injectable()
|
|
72
|
+
export class GeneralConfigurationCategory implements AiConfigurationCategory, AiConfigurationSearchProvider {
|
|
73
|
+
|
|
74
|
+
readonly id = AiConfigurationCategoryId.GENERAL;
|
|
75
|
+
readonly label = nls.localize('theia/ai/ide/generalConfiguration/label', 'General');
|
|
76
|
+
readonly description = nls.localize('theia/ai/ide/generalConfiguration/description',
|
|
77
|
+
'Turn AI features on or off and configure how the assistant behaves across the IDE.');
|
|
78
|
+
readonly iconClass = codicon('settings-gear');
|
|
79
|
+
readonly order = AiConfigurationCategoryOrder.GENERAL;
|
|
80
|
+
readonly kind = 'single-page' as const;
|
|
81
|
+
|
|
82
|
+
@inject(ILogger) @named('ai-ide:GeneralConfigurationCategory')
|
|
83
|
+
protected readonly logger: ILogger;
|
|
84
|
+
|
|
85
|
+
@inject(AiSettingsRowService)
|
|
86
|
+
protected readonly settingsRowService: AiSettingsRowService;
|
|
87
|
+
|
|
88
|
+
@inject(AiConfigurationCategoryRegistry)
|
|
89
|
+
protected readonly categoryRegistry: AiConfigurationCategoryRegistry;
|
|
90
|
+
|
|
91
|
+
@inject(FrontendLanguageModelRegistry)
|
|
92
|
+
protected readonly languageModelRegistry: FrontendLanguageModelRegistry;
|
|
93
|
+
|
|
94
|
+
protected readonly onDidChangeEmitter = new Emitter<void>();
|
|
95
|
+
readonly onDidChange: Event<void> = this.onDidChangeEmitter.event;
|
|
96
|
+
protected readonly toDispose = new DisposableCollection(this.onDidChangeEmitter);
|
|
97
|
+
|
|
98
|
+
/** Whether at least one language-model provider is ready; drives the hero status line. */
|
|
99
|
+
protected hasReadyProvider = false;
|
|
100
|
+
|
|
101
|
+
/** Bound markdown renderer passed to description components (stable identity for `useEffect`). */
|
|
102
|
+
protected readonly renderMarkdown = (markdown: string): HTMLElement => this.settingsRowService.renderMarkdown(markdown);
|
|
103
|
+
|
|
104
|
+
get renderer(): this {
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
getOwnedPreferenceIds(): string[] {
|
|
109
|
+
return [
|
|
110
|
+
PREFERENCE_NAME_ENABLE_AI,
|
|
111
|
+
PIN_CHAT_AGENT_PREF,
|
|
112
|
+
BYPASS_MODEL_REQUIREMENT_PREF,
|
|
113
|
+
PERSISTED_SESSION_LIMIT_PREF,
|
|
114
|
+
WELCOME_SCREEN_SESSIONS_PREF,
|
|
115
|
+
SESSION_STORAGE_PREF
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
get search(): AiConfigurationSearchProvider {
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@postConstruct()
|
|
124
|
+
protected init(): void {
|
|
125
|
+
// Refresh the page (values, modified indicators, gating) whenever any preference changes.
|
|
126
|
+
this.toDispose.push(this.settingsRowService.onPreferenceChanged(() => this.onDidChangeEmitter.fire()));
|
|
127
|
+
// Re-evaluate the provider status line when the set of language models changes.
|
|
128
|
+
this.toDispose.push(this.languageModelRegistry.onChange(() => this.refreshProviderStatus()));
|
|
129
|
+
this.refreshProviderStatus();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
dispose(): void {
|
|
133
|
+
this.toDispose.dispose();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
protected async refreshProviderStatus(): Promise<void> {
|
|
137
|
+
const models = await this.languageModelRegistry.getLanguageModels();
|
|
138
|
+
const hasReady = models.some(model => model.status.status === 'ready');
|
|
139
|
+
if (hasReady !== this.hasReadyProvider) {
|
|
140
|
+
this.hasReadyProvider = hasReady;
|
|
141
|
+
this.onDidChangeEmitter.fire();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** The page's sections and their settings, shared by rendering and the search index. */
|
|
146
|
+
protected getSectionRefs(): GeneralSettingRef[] {
|
|
147
|
+
return [
|
|
148
|
+
{ section: this.sectionChat, preferenceId: PIN_CHAT_AGENT_PREF },
|
|
149
|
+
{ section: this.sectionChat, preferenceId: BYPASS_MODEL_REQUIREMENT_PREF },
|
|
150
|
+
{ section: this.sectionChat, preferenceId: PERSISTED_SESSION_LIMIT_PREF },
|
|
151
|
+
{ section: this.sectionChat, preferenceId: WELCOME_SCREEN_SESSIONS_PREF },
|
|
152
|
+
{ section: this.sectionChat, preferenceId: SESSION_STORAGE_PREF }
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
protected get sectionChat(): string {
|
|
157
|
+
return nls.localizeByDefault('Chat');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Per-setting, human-readable titles. The preferences share a schema `title`, so titles are authored here. */
|
|
161
|
+
protected titleFor(preferenceId: string): string {
|
|
162
|
+
switch (preferenceId) {
|
|
163
|
+
case PREFERENCE_NAME_ENABLE_AI:
|
|
164
|
+
return nls.localizeByDefault('Enable AI features');
|
|
165
|
+
case PIN_CHAT_AGENT_PREF:
|
|
166
|
+
return nls.localize('theia/ai/ide/generalConfiguration/pinAgentTitle', 'Pin mentioned agents');
|
|
167
|
+
case BYPASS_MODEL_REQUIREMENT_PREF:
|
|
168
|
+
return nls.localize('theia/ai/ide/generalConfiguration/bypassModelTitle', 'Skip language model check');
|
|
169
|
+
case PERSISTED_SESSION_LIMIT_PREF:
|
|
170
|
+
return nls.localize('theia/ai/ide/generalConfiguration/persistedSessionsTitle', 'Persisted chat sessions');
|
|
171
|
+
case WELCOME_SCREEN_SESSIONS_PREF:
|
|
172
|
+
return nls.localize('theia/ai/ide/generalConfiguration/homeSessionsTitle', 'Sessions on the home view');
|
|
173
|
+
case SESSION_STORAGE_PREF:
|
|
174
|
+
return nls.localize('theia/ai/ide/generalConfiguration/sessionStorageTitle', 'Session storage location');
|
|
175
|
+
default:
|
|
176
|
+
return this.settingsRowService.describe(preferenceId).label ?? preferenceId;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
renderPage(ctx: AiConfigurationRenderContext): React.ReactNode {
|
|
181
|
+
const enabled = this.isEnabled(ctx);
|
|
182
|
+
return <div className='ai-configuration-page'>
|
|
183
|
+
{this.renderHero(ctx, enabled)}
|
|
184
|
+
{!enabled && this.renderGateNote()}
|
|
185
|
+
<div className={`ai-configuration-sections${enabled ? '' : ' ai-configuration-sections-off'}`}>
|
|
186
|
+
{this.renderChatSection(ctx, !enabled)}
|
|
187
|
+
{this.renderCatchAllSections(ctx, !enabled)}
|
|
188
|
+
</div>
|
|
189
|
+
</div>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* AI preferences that no dedicated category claims — the "in doubt, put it in General" home. Chat
|
|
194
|
+
* preferences fold into the Chat section (see {@link renderChatSection}); everything else is grouped
|
|
195
|
+
* into a section per `ai-features.<segment>`. This keeps every AI preference reachable, since they are
|
|
196
|
+
* hidden from the Settings UI, without a separate catch-all page.
|
|
197
|
+
*/
|
|
198
|
+
protected unclaimedPreferenceIds(): string[] {
|
|
199
|
+
const claimed = new Set<string>();
|
|
200
|
+
for (const category of this.categoryRegistry.getCategories()) {
|
|
201
|
+
for (const owned of category.renderer.getOwnedPreferenceIds?.() ?? []) {
|
|
202
|
+
claimed.add(owned);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return this.settingsRowService.aiFeaturePreferenceIds().filter(id => !claimed.has(id));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
protected renderCatchAllSections(ctx: AiConfigurationRenderContext, disabled: boolean): React.ReactNode {
|
|
209
|
+
const bySegment = new Map<string, string[]>();
|
|
210
|
+
for (const id of this.unclaimedPreferenceIds()) {
|
|
211
|
+
const segment = id.substring('ai-features.'.length).split('.')[0];
|
|
212
|
+
if (segment === 'chat') {
|
|
213
|
+
continue; // folded into the Chat section
|
|
214
|
+
}
|
|
215
|
+
const block = bySegment.get(segment) ?? [];
|
|
216
|
+
block.push(id);
|
|
217
|
+
bySegment.set(segment, block);
|
|
218
|
+
}
|
|
219
|
+
return Array.from(bySegment.entries())
|
|
220
|
+
.sort((left, right) => this.segmentLabel(left[0]).localeCompare(this.segmentLabel(right[0])))
|
|
221
|
+
.map(([segment, ids]) => (
|
|
222
|
+
<AiConfigurationSection title={this.segmentLabel(segment)} key={segment}>
|
|
223
|
+
{ids.map(id => this.renderGenericRow(ctx, id, disabled))}
|
|
224
|
+
</AiConfigurationSection>
|
|
225
|
+
));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
protected renderGenericRow(ctx: AiConfigurationRenderContext, preferenceId: string, disabled: boolean): React.ReactNode {
|
|
229
|
+
return <AiSettingsRow
|
|
230
|
+
key={preferenceId}
|
|
231
|
+
service={this.settingsRowService}
|
|
232
|
+
preferenceId={preferenceId}
|
|
233
|
+
scope={ctx.scope}
|
|
234
|
+
control={this.settingsRowService.controlFor(preferenceId)}
|
|
235
|
+
disabled={disabled}
|
|
236
|
+
onDidChange={ctx.update}
|
|
237
|
+
/>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** `ai-features.<segment>` → Title Case words (e.g. `codeCompletion` → "Code Completion"). */
|
|
241
|
+
protected segmentLabel(segment: string): string {
|
|
242
|
+
const spaced = segment.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
|
|
243
|
+
return spaced.charAt(0).toLocaleUpperCase() + spaced.slice(1);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
protected isEnabled(ctx: AiConfigurationRenderContext): boolean {
|
|
247
|
+
return this.settingsRowService.inspect(PREFERENCE_NAME_ENABLE_AI, ctx.scope).value === true;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
protected renderHero(ctx: AiConfigurationRenderContext, enabled: boolean): React.ReactNode {
|
|
251
|
+
// Carries the same deep-link anchor as a normal setting row, so this category's search item for
|
|
252
|
+
// `PREFERENCE_NAME_ENABLE_AI` can scroll to and flash the toggle even though it is not rendered
|
|
253
|
+
// through `AiConfigurationSettingRow`.
|
|
254
|
+
return <div className='ai-configuration-hero' data-ai-config-row-id={PREFERENCE_NAME_ENABLE_AI}>
|
|
255
|
+
<div className='ai-settings-row-top'>
|
|
256
|
+
<div className='ai-settings-row-main'>
|
|
257
|
+
<div className='ai-settings-row-title'>
|
|
258
|
+
{this.titleFor(PREFERENCE_NAME_ENABLE_AI)}
|
|
259
|
+
</div>
|
|
260
|
+
<div className='ai-settings-row-description'>
|
|
261
|
+
{nls.localize('theia/ai/ide/generalConfiguration/enableAiDescription',
|
|
262
|
+
'Turns on all AI capabilities of {0}. Requires at least one configured language model provider.',
|
|
263
|
+
FrontendApplicationConfigProvider.get().applicationName)}
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
<div className='ai-settings-row-control'>
|
|
267
|
+
<AiToggleSwitch
|
|
268
|
+
large
|
|
269
|
+
checked={enabled}
|
|
270
|
+
ariaLabel={this.titleFor(PREFERENCE_NAME_ENABLE_AI)}
|
|
271
|
+
onChange={value => this.commit(PREFERENCE_NAME_ENABLE_AI, value, ctx)}
|
|
272
|
+
/>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
{enabled && this.renderProviderStatus(ctx)}
|
|
276
|
+
{enabled && <details className='ai-configuration-risks'>
|
|
277
|
+
<summary>{nls.localize('theia/ai/ide/generalConfiguration/aboutCosts', 'About costs and data usage')}</summary>
|
|
278
|
+
<div className='ai-configuration-risk-body'>
|
|
279
|
+
<AiMarkdownDescription
|
|
280
|
+
renderMarkdown={this.renderMarkdown}
|
|
281
|
+
markdown={nls.localize('theia/ai/ide/generalConfiguration/costsBody',
|
|
282
|
+
'AI features send requests to the language model providers you configure. Depending on your provider and usage, this can incur \
|
|
283
|
+
costs — monitor them closely. Requests may run continuously while agents are active. See [the documentation]({0}) for details.',
|
|
284
|
+
AI_DOCUMENTATION_URL)}
|
|
285
|
+
/>
|
|
286
|
+
</div>
|
|
287
|
+
</details>}
|
|
288
|
+
</div>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
protected renderProviderStatus(ctx: AiConfigurationRenderContext): React.ReactNode {
|
|
292
|
+
if (this.hasReadyProvider) {
|
|
293
|
+
return <div className='ai-configuration-status-line'>
|
|
294
|
+
<span className='ai-configuration-status ai-configuration-status-on'></span>
|
|
295
|
+
<span>{nls.localize('theia/ai/ide/generalConfiguration/providerReady', 'A language model provider is configured and ready.')}</span>
|
|
296
|
+
</div>;
|
|
297
|
+
}
|
|
298
|
+
return <div className='ai-configuration-status-line'>
|
|
299
|
+
<span className='ai-configuration-status ai-configuration-status-warn'></span>
|
|
300
|
+
<span>
|
|
301
|
+
{nls.localize('theia/ai/ide/generalConfiguration/noProvider', 'No language model provider is configured yet.')}{' '}
|
|
302
|
+
<a
|
|
303
|
+
href='#'
|
|
304
|
+
onClick={e => { e.preventDefault(); ctx.navigate({ categoryId: AiConfigurationCategoryId.MODELS }); }}
|
|
305
|
+
>{nls.localize('theia/ai/ide/generalConfiguration/configureProvider', 'Configure a provider')}</a>
|
|
306
|
+
</span>
|
|
307
|
+
</div>;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
protected renderGateNote(): React.ReactNode {
|
|
311
|
+
return <div className='ai-configuration-gate-note'>
|
|
312
|
+
<span className={codicon('info')}></span>
|
|
313
|
+
<span>{nls.localize('theia/ai/ide/generalConfiguration/gateNote', 'The settings below take effect once Enable AI features is turned on.')}</span>
|
|
314
|
+
</div>;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
protected renderChatSection(ctx: AiConfigurationRenderContext, disabled: boolean): React.ReactNode {
|
|
318
|
+
return this.renderSection(this.sectionChat, [
|
|
319
|
+
this.renderSettingRow(ctx, PIN_CHAT_AGENT_PREF, {
|
|
320
|
+
control: <AiToggleSwitch
|
|
321
|
+
checked={this.booleanValue(PIN_CHAT_AGENT_PREF, ctx)}
|
|
322
|
+
ariaLabel={this.titleFor(PIN_CHAT_AGENT_PREF)}
|
|
323
|
+
disabled={disabled}
|
|
324
|
+
onChange={value => this.commit(PIN_CHAT_AGENT_PREF, value, ctx)}
|
|
325
|
+
/>
|
|
326
|
+
}),
|
|
327
|
+
this.renderSettingRow(ctx, BYPASS_MODEL_REQUIREMENT_PREF, {
|
|
328
|
+
control: <AiToggleSwitch
|
|
329
|
+
checked={this.booleanValue(BYPASS_MODEL_REQUIREMENT_PREF, ctx)}
|
|
330
|
+
ariaLabel={this.titleFor(BYPASS_MODEL_REQUIREMENT_PREF)}
|
|
331
|
+
disabled={disabled}
|
|
332
|
+
onChange={value => this.commit(BYPASS_MODEL_REQUIREMENT_PREF, value, ctx)}
|
|
333
|
+
/>
|
|
334
|
+
}),
|
|
335
|
+
this.renderSettingRow(ctx, PERSISTED_SESSION_LIMIT_PREF, {
|
|
336
|
+
below: <AiSessionLimitControl
|
|
337
|
+
value={this.numberValue(PERSISTED_SESSION_LIMIT_PREF, ctx, 25)}
|
|
338
|
+
limitedMin={1}
|
|
339
|
+
limitedMax={999}
|
|
340
|
+
specials={[
|
|
341
|
+
{ value: -1, label: nls.localize('theia/ai/ide/generalConfiguration/unlimited', 'Unlimited') },
|
|
342
|
+
{ value: 0, label: nls.localize('theia/ai/ide/generalConfiguration/dontPersist', "Don't persist") }
|
|
343
|
+
]}
|
|
344
|
+
ariaLabel={this.titleFor(PERSISTED_SESSION_LIMIT_PREF)}
|
|
345
|
+
disabled={disabled}
|
|
346
|
+
onCommit={value => this.commit(PERSISTED_SESSION_LIMIT_PREF, value, ctx)}
|
|
347
|
+
/>
|
|
348
|
+
}),
|
|
349
|
+
this.renderSettingRow(ctx, WELCOME_SCREEN_SESSIONS_PREF, {
|
|
350
|
+
below: <AiSessionLimitControl
|
|
351
|
+
value={this.numberValue(WELCOME_SCREEN_SESSIONS_PREF, ctx, 20)}
|
|
352
|
+
limitedMin={1}
|
|
353
|
+
limitedMax={99}
|
|
354
|
+
specials={[
|
|
355
|
+
{ value: 0, label: nls.localize('theia/ai/ide/generalConfiguration/hideList', 'Hide list') }
|
|
356
|
+
]}
|
|
357
|
+
ariaLabel={this.titleFor(WELCOME_SCREEN_SESSIONS_PREF)}
|
|
358
|
+
disabled={disabled}
|
|
359
|
+
onCommit={value => this.commit(WELCOME_SCREEN_SESSIONS_PREF, value, ctx)}
|
|
360
|
+
/>
|
|
361
|
+
}),
|
|
362
|
+
this.renderSettingRow(ctx, SESSION_STORAGE_PREF, {
|
|
363
|
+
below: <AiEnumSelect
|
|
364
|
+
value={this.selectValue(SESSION_STORAGE_PREF, ctx)}
|
|
365
|
+
options={this.enumOptions(SESSION_STORAGE_PREF)}
|
|
366
|
+
ariaLabel={this.titleFor(SESSION_STORAGE_PREF)}
|
|
367
|
+
disabled={disabled}
|
|
368
|
+
onCommit={value => this.commit(SESSION_STORAGE_PREF, value, ctx)}
|
|
369
|
+
/>
|
|
370
|
+
}),
|
|
371
|
+
// Any other chat.* preference no category claims (e.g. token-usage, server-side compaction).
|
|
372
|
+
...this.unclaimedPreferenceIds()
|
|
373
|
+
.filter(id => id.startsWith('ai-features.chat.'))
|
|
374
|
+
.map(id => this.renderGenericRow(ctx, id, disabled))
|
|
375
|
+
]);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
protected renderSection(title: string, rows: React.ReactNode[]): React.ReactNode {
|
|
379
|
+
return <AiConfigurationSection title={title} key={title}>{rows}</AiConfigurationSection>;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Renders one setting row via the shared {@link AiConfigurationSettingRow}: title, the schema
|
|
384
|
+
* description, a control (inline via {@link options.control} or full-width via {@link options.below}),
|
|
385
|
+
* a modified edge when overridden in the current scope, and the Settings-UI gear menu (Reset / Copy
|
|
386
|
+
* Setting ID / Copy as JSON) wired to the shared {@link AiSettingsRowService.openSettingContextMenu}.
|
|
387
|
+
*/
|
|
388
|
+
protected renderSettingRow(
|
|
389
|
+
ctx: AiConfigurationRenderContext,
|
|
390
|
+
preferenceId: string,
|
|
391
|
+
options: { control?: React.ReactNode; below?: React.ReactNode }
|
|
392
|
+
): React.ReactNode {
|
|
393
|
+
const inspection = this.settingsRowService.inspect(preferenceId, ctx.scope);
|
|
394
|
+
return <AiConfigurationSettingRow
|
|
395
|
+
key={preferenceId}
|
|
396
|
+
preferenceId={preferenceId}
|
|
397
|
+
title={this.titleFor(preferenceId)}
|
|
398
|
+
description={this.settingsRowService.describe(preferenceId).description}
|
|
399
|
+
renderMarkdown={this.renderMarkdown}
|
|
400
|
+
modified={inspection.modified}
|
|
401
|
+
tags={this.settingsRowService.tags(preferenceId)}
|
|
402
|
+
onOpenMenu={gear => this.settingsRowService.openSettingContextMenu(gear, preferenceId, inspection.value, ctx.scope)}
|
|
403
|
+
control={options.control}
|
|
404
|
+
below={options.below}
|
|
405
|
+
/>;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
protected commit(preferenceId: string, value: unknown, ctx: AiConfigurationRenderContext): void {
|
|
409
|
+
this.settingsRowService.set(preferenceId, value, ctx.scope)
|
|
410
|
+
.then(() => ctx.update())
|
|
411
|
+
.catch(error => this.logger.error(`Failed to set preference '${preferenceId}'`, error));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
protected booleanValue(preferenceId: string, ctx: AiConfigurationRenderContext): boolean {
|
|
415
|
+
return this.settingsRowService.inspect(preferenceId, ctx.scope).value === true;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
protected numberValue(preferenceId: string, ctx: AiConfigurationRenderContext, fallback: number): number {
|
|
419
|
+
const value = this.settingsRowService.inspect(preferenceId, ctx.scope).value;
|
|
420
|
+
return typeof value === 'number' ? value : fallback;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
protected selectValue(preferenceId: string, ctx: AiConfigurationRenderContext): string | undefined {
|
|
424
|
+
const value = this.settingsRowService.inspect(preferenceId, ctx.scope).value;
|
|
425
|
+
return value === undefined ? undefined : String(value);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
protected enumOptions(preferenceId: string): { value: string; label: string; title?: string }[] {
|
|
429
|
+
return this.settingsRowService.enumOptions(preferenceId).map(option => {
|
|
430
|
+
const value = option.value ?? '';
|
|
431
|
+
// Keep the option's explanatory text as the select's per-option `title`, never as its label.
|
|
432
|
+
return { value, label: option.label ?? value, title: option.description };
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
getSearchItems(): AiConfigurationSearchItem[] {
|
|
437
|
+
const settingLabel = nls.localizeByDefault('Setting');
|
|
438
|
+
const items = this.getSectionRefs().map(ref => ({
|
|
439
|
+
label: this.titleFor(ref.preferenceId),
|
|
440
|
+
typeLabel: settingLabel,
|
|
441
|
+
categoryId: this.id,
|
|
442
|
+
target: { categoryId: this.id, highlight: { rowId: ref.preferenceId } },
|
|
443
|
+
keywords: `${ref.preferenceId} ${ref.section}`
|
|
444
|
+
} satisfies AiConfigurationSearchItem));
|
|
445
|
+
// Include the master enablement toggle (rendered in the hero rather than a section).
|
|
446
|
+
items.unshift({
|
|
447
|
+
label: this.titleFor(PREFERENCE_NAME_ENABLE_AI),
|
|
448
|
+
typeLabel: settingLabel,
|
|
449
|
+
categoryId: this.id,
|
|
450
|
+
target: { categoryId: this.id, highlight: { rowId: PREFERENCE_NAME_ENABLE_AI } },
|
|
451
|
+
keywords: PREFERENCE_NAME_ENABLE_AI
|
|
452
|
+
});
|
|
453
|
+
// Catch-all preferences rendered on this page (see renderCatchAllSections / the Chat section).
|
|
454
|
+
for (const id of this.unclaimedPreferenceIds()) {
|
|
455
|
+
items.push({
|
|
456
|
+
label: this.settingsRowService.describe(id).label ?? id,
|
|
457
|
+
typeLabel: settingLabel,
|
|
458
|
+
categoryId: this.id,
|
|
459
|
+
target: { categoryId: this.id, highlight: { rowId: id } },
|
|
460
|
+
keywords: id
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
return items;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom';
|
|
18
|
+
let disableJSDOM = enableJSDOM();
|
|
19
|
+
|
|
20
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
21
|
+
FrontendApplicationConfigProvider.set({});
|
|
22
|
+
|
|
23
|
+
import { expect } from 'chai';
|
|
24
|
+
import { LanguageModel } from '@theia/ai-core/lib/common/language-model';
|
|
25
|
+
import { LanguageModelAlias } from '@theia/ai-core/lib/common/language-model-alias';
|
|
26
|
+
import { AiConfigurationCategoryId } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
|
|
27
|
+
import { ModelAliasesConfigurationCategory } from './model-aliases-configuration-category';
|
|
28
|
+
|
|
29
|
+
disableJSDOM();
|
|
30
|
+
|
|
31
|
+
function alias(id: string, description = ''): LanguageModelAlias {
|
|
32
|
+
return { id, description, defaultModelIds: [] } as unknown as LanguageModelAlias;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function readyModel(id: string): LanguageModel {
|
|
36
|
+
return { id, status: { status: 'ready' } } as unknown as LanguageModel;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function unreadyModel(id: string): LanguageModel {
|
|
40
|
+
return { id, status: { status: 'unavailable', message: 'nope' } } as unknown as LanguageModel;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function createCategory(aliases: LanguageModelAlias[], resolved: Map<string, LanguageModel | undefined>): ModelAliasesConfigurationCategory {
|
|
44
|
+
const category = new ModelAliasesConfigurationCategory();
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
(category as any).aliases = aliases;
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
(category as any).resolvedModelForAlias = resolved;
|
|
49
|
+
return category;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe('ModelAliasesConfigurationCategory', () => {
|
|
53
|
+
|
|
54
|
+
before(() => disableJSDOM = enableJSDOM());
|
|
55
|
+
after(() => disableJSDOM());
|
|
56
|
+
|
|
57
|
+
it('declares the model-aliases collection metadata', () => {
|
|
58
|
+
const category = createCategory([], new Map());
|
|
59
|
+
expect(category.id).to.equal(AiConfigurationCategoryId.MODEL_ALIASES);
|
|
60
|
+
expect(category.kind).to.equal('collection');
|
|
61
|
+
expect(category.renderer).to.equal(category);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('maps aliases to tree items with a resolved/warn/error status', () => {
|
|
65
|
+
const aliases = [alias('default/code', 'Coding'), alias('default/chat'), alias('broken')];
|
|
66
|
+
const resolved = new Map<string, LanguageModel | undefined>([
|
|
67
|
+
['default/code', readyModel('m1')],
|
|
68
|
+
['default/chat', unreadyModel('m2')],
|
|
69
|
+
['broken', undefined]
|
|
70
|
+
]);
|
|
71
|
+
const children = createCategory(aliases, resolved).getTreeChildren();
|
|
72
|
+
expect(children.map(c => c.id)).to.deep.equal(['default/code', 'default/chat', 'broken']);
|
|
73
|
+
expect(children[0].status?.kind).to.equal('on');
|
|
74
|
+
// A ready alias shows what it resolves to (the model), not a generic "Ready".
|
|
75
|
+
expect(children[0].status?.label).to.equal('m1');
|
|
76
|
+
expect(children[1].status?.kind).to.equal('warn');
|
|
77
|
+
expect(children[2].status?.kind).to.equal('error');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('indexes one search item per alias, navigating to the item', () => {
|
|
81
|
+
const category = createCategory([alias('default/code', 'Coding alias')], new Map());
|
|
82
|
+
const items = category.getSearchItems();
|
|
83
|
+
expect(items).to.have.lengthOf(1);
|
|
84
|
+
expect(items[0].target).to.deep.equal({ categoryId: AiConfigurationCategoryId.MODEL_ALIASES, itemId: 'default/code' });
|
|
85
|
+
expect(items[0].keywords).to.equal('Coding alias');
|
|
86
|
+
});
|
|
87
|
+
});
|