@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,130 @@
|
|
|
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 { createRoot } from '@theia/core/shared/react-dom/client';
|
|
25
|
+
import { flushSync } from '@theia/core/shared/react-dom';
|
|
26
|
+
import { ToolRequest } from '@theia/ai-core';
|
|
27
|
+
import { ToolConfirmationMode } from '@theia/ai-chat/lib/common/chat-tool-preferences';
|
|
28
|
+
import {
|
|
29
|
+
AiConfigurationCategoryId,
|
|
30
|
+
AiConfigurationRenderContext,
|
|
31
|
+
AiConfigurationTools
|
|
32
|
+
} from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
|
|
33
|
+
import { ToolsConfigurationCategory } from './tools-configuration-category';
|
|
34
|
+
|
|
35
|
+
disableJSDOM();
|
|
36
|
+
|
|
37
|
+
function createCategory(
|
|
38
|
+
functions: Record<string, Partial<ToolRequest>>,
|
|
39
|
+
modes: Record<string, ToolConfirmationMode>,
|
|
40
|
+
defaultState: ToolConfirmationMode
|
|
41
|
+
): ToolsConfigurationCategory {
|
|
42
|
+
const category = new ToolsConfigurationCategory();
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
(category as any).toolInvocationRegistry = { getFunction: (name: string) => functions[name] };
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
(category as any).toolConfirmationModes = modes;
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
(category as any).defaultState = defaultState;
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
(category as any).toolNames = Object.keys(functions);
|
|
51
|
+
// Enough of the settings-row service to both describe the default-mode row and render the page.
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
(category as any).settingsRowService = {
|
|
54
|
+
describe: () => ({ label: 'Default Tool Confirmation Mode' }),
|
|
55
|
+
inspect: () => ({ value: ToolConfirmationMode.CONFIRM, scopeValue: undefined, defaultValue: ToolConfirmationMode.CONFIRM, modified: false }),
|
|
56
|
+
tags: () => [],
|
|
57
|
+
controlFor: () => ({ type: 'string' }),
|
|
58
|
+
renderMarkdown: (markdown: string) => {
|
|
59
|
+
const element = document.createElement('span');
|
|
60
|
+
element.textContent = markdown;
|
|
61
|
+
return element;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return category;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
describe('ToolsConfigurationCategory', () => {
|
|
68
|
+
|
|
69
|
+
before(() => disableJSDOM = enableJSDOM());
|
|
70
|
+
after(() => disableJSDOM());
|
|
71
|
+
|
|
72
|
+
it('declares the tools single-page metadata', () => {
|
|
73
|
+
const category = createCategory({}, {}, ToolConfirmationMode.CONFIRM);
|
|
74
|
+
expect(category.id).to.equal(AiConfigurationCategoryId.TOOLS);
|
|
75
|
+
expect(category.kind).to.equal('single-page');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe('getEffectiveState', () => {
|
|
79
|
+
it('uses an explicit per-tool setting when present', () => {
|
|
80
|
+
const category = createCategory({ a: {} }, { a: ToolConfirmationMode.DISABLED }, ToolConfirmationMode.CONFIRM);
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
expect((category as any).getEffectiveState('a')).to.equal(ToolConfirmationMode.DISABLED);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('falls back to the default when there is no explicit setting', () => {
|
|
86
|
+
const category = createCategory({ a: {} }, {}, ToolConfirmationMode.ALWAYS_ALLOW);
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
+
expect((category as any).getEffectiveState('a')).to.equal(ToolConfirmationMode.ALWAYS_ALLOW);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('downgrades confirmAlwaysAllow tools to CONFIRM when the default is ALWAYS_ALLOW', () => {
|
|
92
|
+
const category = createCategory({ a: { confirmAlwaysAllow: true } }, {}, ToolConfirmationMode.ALWAYS_ALLOW);
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
|
+
expect((category as any).getEffectiveState('a')).to.equal(ToolConfirmationMode.CONFIRM);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('anchors every tool row with the row id its search item and the cross-page links navigate to', () => {
|
|
99
|
+
const category = createCategory({ a: {}, mcp_x_y: {} }, {}, ToolConfirmationMode.CONFIRM);
|
|
100
|
+
const container = document.createElement('div');
|
|
101
|
+
document.body.appendChild(container);
|
|
102
|
+
const root = createRoot(container);
|
|
103
|
+
const ctx: AiConfigurationRenderContext = { scope: 'user', navigate: () => { }, update: () => { } };
|
|
104
|
+
try {
|
|
105
|
+
flushSync(() => root.render(category.renderPage(ctx)));
|
|
106
|
+
const anchored = Array.from(container.querySelectorAll('[data-ai-config-row-id]'))
|
|
107
|
+
.map(element => element.getAttribute('data-ai-config-row-id'));
|
|
108
|
+
const indexed = category.getSearchItems()
|
|
109
|
+
.map(item => item.target.highlight?.rowId)
|
|
110
|
+
.filter((rowId): rowId is string => rowId !== undefined);
|
|
111
|
+
|
|
112
|
+
// An indexed-but-unanchored row silently never scrolls or flashes when navigated to.
|
|
113
|
+
expect(indexed).to.have.members(['tool:a', 'tool:mcp_x_y']);
|
|
114
|
+
indexed.forEach(rowId => expect(anchored).to.include(rowId));
|
|
115
|
+
// The same ids an agent's used-tools list and a server's tool list link to.
|
|
116
|
+
expect(anchored).to.include(AiConfigurationTools.selectionFor('mcp_x_y').highlight!.rowId);
|
|
117
|
+
} finally {
|
|
118
|
+
flushSync(() => root.unmount());
|
|
119
|
+
container.remove();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('indexes the default-mode setting plus one item per tool', () => {
|
|
124
|
+
const category = createCategory({ a: {}, mcp_x: {} }, {}, ToolConfirmationMode.CONFIRM);
|
|
125
|
+
const items = category.getSearchItems();
|
|
126
|
+
expect(items).to.have.lengthOf(3);
|
|
127
|
+
expect(items[0].target).to.deep.equal({ categoryId: AiConfigurationCategoryId.TOOLS });
|
|
128
|
+
expect(items.slice(1).map(i => i.label)).to.have.members(['a', 'mcp_x']);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
@@ -0,0 +1,421 @@
|
|
|
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 { AiConfigurationService, ToolInvocationRegistry, ToolRequest } from '@theia/ai-core';
|
|
18
|
+
import { ToolConfirmationManager } from '@theia/ai-chat/lib/browser/chat-tool-preference-bindings';
|
|
19
|
+
import {
|
|
20
|
+
DEFAULT_TOOL_CONFIRMATION_PREFERENCE,
|
|
21
|
+
TOOL_CONFIRMATION_MODE_DESCRIPTIONS,
|
|
22
|
+
TOOL_CONFIRMATION_MODE_VALUES,
|
|
23
|
+
TOOL_CONFIRMATION_PREFERENCE,
|
|
24
|
+
ToolConfirmationMode
|
|
25
|
+
} from '@theia/ai-chat/lib/common/chat-tool-preferences';
|
|
26
|
+
import { SHELL_COMMAND_ALLOWLIST_PREFERENCE, SHELL_COMMAND_DENYLIST_PREFERENCE } from '@theia/ai-terminal/lib/common/shell-command-preferences';
|
|
27
|
+
import { ShellCommandPermissionService } from '@theia/ai-terminal/lib/browser/shell-command-permission-service';
|
|
28
|
+
import { Emitter, Event, nls } from '@theia/core';
|
|
29
|
+
import { codicon, ConfirmDialog } from '@theia/core/lib/browser';
|
|
30
|
+
import { DisposableCollection } from '@theia/core/lib/common';
|
|
31
|
+
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
32
|
+
import * as React from '@theia/core/shared/react';
|
|
33
|
+
import {
|
|
34
|
+
AiConfigurationCategory,
|
|
35
|
+
AiConfigurationCategoryId,
|
|
36
|
+
AiConfigurationCategoryOrder,
|
|
37
|
+
AiConfigurationRenderContext,
|
|
38
|
+
AiConfigurationSearchItem,
|
|
39
|
+
AiConfigurationSearchProvider,
|
|
40
|
+
AiConfigurationTools
|
|
41
|
+
} from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
|
|
42
|
+
import { SinglePageCategoryRenderer } from '@theia/ai-core-ui/lib/browser/ai-configuration/renderers/single-page-category-renderer';
|
|
43
|
+
import {
|
|
44
|
+
AiConfigurationCallout,
|
|
45
|
+
AiConfigurationFilterInput,
|
|
46
|
+
AiConfigurationSection
|
|
47
|
+
} from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-primitives';
|
|
48
|
+
import { AiEnumSelect } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-controls';
|
|
49
|
+
import { AiConfigurationItemRow } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-item-row';
|
|
50
|
+
import { AiConfigurationSettingRow } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-setting-row';
|
|
51
|
+
import { AiSettingsRow } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-settings-row';
|
|
52
|
+
import { AiSettingsControl, AiSettingsRowService } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-settings-row-service';
|
|
53
|
+
|
|
54
|
+
// UI labels for the modes (the schema has no `enumItemLabels`); the values and per-option descriptions
|
|
55
|
+
// come straight from the preference definition so the descriptions are not duplicated here.
|
|
56
|
+
const TOOL_OPTION_LABELS: Record<ToolConfirmationMode, string> = {
|
|
57
|
+
[ToolConfirmationMode.DISABLED]: nls.localizeByDefault('Disabled'),
|
|
58
|
+
[ToolConfirmationMode.CONFIRM]: nls.localize('theia/ai/ide/toolsConfiguration/toolOptions/confirm/label', 'Confirm'),
|
|
59
|
+
[ToolConfirmationMode.ALWAYS_ALLOW]: nls.localizeByDefault('Always Allow')
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const TOOL_OPTIONS: { value: ToolConfirmationMode; label: string; title: string }[] = TOOL_CONFIRMATION_MODE_VALUES.map((value, index) => ({
|
|
63
|
+
value,
|
|
64
|
+
label: TOOL_OPTION_LABELS[value],
|
|
65
|
+
title: TOOL_CONFIRMATION_MODE_DESCRIPTIONS[index]
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The Tools category: a `single-page` category with the default confirmation mode, a per-tool
|
|
70
|
+
* confirmation table, the recommended-defaults banner, and the shell allow/deny-list editors.
|
|
71
|
+
*/
|
|
72
|
+
@injectable()
|
|
73
|
+
export class ToolsConfigurationCategory extends SinglePageCategoryRenderer implements AiConfigurationCategory, AiConfigurationSearchProvider {
|
|
74
|
+
|
|
75
|
+
readonly id = AiConfigurationCategoryId.TOOLS;
|
|
76
|
+
readonly label = nls.localizeByDefault('Tools');
|
|
77
|
+
readonly description = nls.localize('theia/ai/ide/toolsConfiguration/description',
|
|
78
|
+
'Choose which tools agents may call and whether each one needs confirmation before it runs.');
|
|
79
|
+
readonly iconClass = codicon('tools');
|
|
80
|
+
readonly order = AiConfigurationCategoryOrder.TOOLS;
|
|
81
|
+
readonly kind = 'single-page' as const;
|
|
82
|
+
|
|
83
|
+
@inject(ToolConfirmationManager)
|
|
84
|
+
protected readonly confirmationManager: ToolConfirmationManager;
|
|
85
|
+
|
|
86
|
+
@inject(ToolInvocationRegistry)
|
|
87
|
+
protected readonly toolInvocationRegistry: ToolInvocationRegistry;
|
|
88
|
+
|
|
89
|
+
protected readonly onDidChangeEmitter = new Emitter<void>();
|
|
90
|
+
readonly onDidChange: Event<void> = this.onDidChangeEmitter.event;
|
|
91
|
+
protected readonly toDispose = new DisposableCollection(this.onDidChangeEmitter);
|
|
92
|
+
|
|
93
|
+
protected toolNames: string[] = [];
|
|
94
|
+
protected toolConfirmationModes: Record<string, ToolConfirmationMode> = {};
|
|
95
|
+
protected defaultState: ToolConfirmationMode = ToolConfirmationMode.CONFIRM;
|
|
96
|
+
|
|
97
|
+
get renderer(): this {
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
getOwnedPreferenceIds(): string[] {
|
|
102
|
+
// Managed via the confirmation-mode selector/table and the shell allow/deny editors on this page.
|
|
103
|
+
return [
|
|
104
|
+
DEFAULT_TOOL_CONFIRMATION_PREFERENCE,
|
|
105
|
+
TOOL_CONFIRMATION_PREFERENCE,
|
|
106
|
+
SHELL_COMMAND_ALLOWLIST_PREFERENCE,
|
|
107
|
+
SHELL_COMMAND_DENYLIST_PREFERENCE
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
get search(): AiConfigurationSearchProvider {
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@inject(AiConfigurationService)
|
|
116
|
+
protected readonly aiConfigurationService: AiConfigurationService;
|
|
117
|
+
|
|
118
|
+
@inject(AiSettingsRowService)
|
|
119
|
+
protected readonly settingsRowService: AiSettingsRowService;
|
|
120
|
+
|
|
121
|
+
@inject(ShellCommandPermissionService)
|
|
122
|
+
protected readonly shellCommandPermissionService: ShellCommandPermissionService;
|
|
123
|
+
|
|
124
|
+
protected readonly renderMarkdown = (markdown: string): HTMLElement => this.settingsRowService.renderMarkdown(markdown);
|
|
125
|
+
|
|
126
|
+
@postConstruct()
|
|
127
|
+
protected init(): void {
|
|
128
|
+
this.load();
|
|
129
|
+
this.toDispose.pushAll([
|
|
130
|
+
this.toolInvocationRegistry.onDidChange(() => {
|
|
131
|
+
this.loadTools();
|
|
132
|
+
this.onDidChangeEmitter.fire();
|
|
133
|
+
}),
|
|
134
|
+
this.aiConfigurationService.onDidChange(async event => {
|
|
135
|
+
if (event.affectsPreference(TOOL_CONFIRMATION_PREFERENCE) || event.affectsPreference(DEFAULT_TOOL_CONFIRMATION_PREFERENCE)) {
|
|
136
|
+
await this.loadConfirmation();
|
|
137
|
+
this.onDidChangeEmitter.fire();
|
|
138
|
+
}
|
|
139
|
+
if (event.affectsPreference(SHELL_COMMAND_ALLOWLIST_PREFERENCE) || event.affectsPreference(SHELL_COMMAND_DENYLIST_PREFERENCE)) {
|
|
140
|
+
this.onDidChangeEmitter.fire();
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
]);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
dispose(): void {
|
|
147
|
+
this.toDispose.dispose();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
protected async load(): Promise<void> {
|
|
151
|
+
this.loadTools();
|
|
152
|
+
await this.loadConfirmation();
|
|
153
|
+
this.onDidChangeEmitter.fire();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
protected loadTools(): void {
|
|
157
|
+
this.toolNames = this.toolInvocationRegistry.getAllFunctions()
|
|
158
|
+
.map(func => func.name)
|
|
159
|
+
.sort((a, b) => {
|
|
160
|
+
const aIsMcp = a.startsWith('mcp_');
|
|
161
|
+
const bIsMcp = b.startsWith('mcp_');
|
|
162
|
+
if (aIsMcp !== bIsMcp) {
|
|
163
|
+
return aIsMcp ? 1 : -1;
|
|
164
|
+
}
|
|
165
|
+
return a.localeCompare(b);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
protected async loadConfirmation(): Promise<void> {
|
|
170
|
+
this.defaultState = this.confirmationManager.getDefaultConfirmationMode();
|
|
171
|
+
this.toolConfirmationModes = this.confirmationManager.getAllConfirmationSettings();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
protected getEffectiveState(toolName: string): ToolConfirmationMode {
|
|
175
|
+
const explicit = this.toolConfirmationModes[toolName];
|
|
176
|
+
if (explicit !== undefined) {
|
|
177
|
+
return explicit;
|
|
178
|
+
}
|
|
179
|
+
const toolRequest = this.toolInvocationRegistry.getFunction(toolName);
|
|
180
|
+
if (toolRequest?.confirmAlwaysAllow && this.defaultState === ToolConfirmationMode.ALWAYS_ALLOW) {
|
|
181
|
+
return ToolConfirmationMode.CONFIRM;
|
|
182
|
+
}
|
|
183
|
+
return this.defaultState;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Title of the default-confirmation-mode row, shared by the header and the search index. */
|
|
187
|
+
protected defaultModeLabel(): string {
|
|
188
|
+
return this.settingsRowService.describe(DEFAULT_TOOL_CONFIRMATION_PREFERENCE).label
|
|
189
|
+
?? nls.localize('theia/ai/ide/toolsConfiguration/default/rowLabel', 'Default Tool Confirmation Mode');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
protected override renderHeader(ctx: AiConfigurationRenderContext): React.ReactNode {
|
|
193
|
+
const described = this.settingsRowService.describe(DEFAULT_TOOL_CONFIRMATION_PREFERENCE);
|
|
194
|
+
const inspection = this.settingsRowService.inspect(DEFAULT_TOOL_CONFIRMATION_PREFERENCE, ctx.scope);
|
|
195
|
+
const modeLabel = this.defaultModeLabel();
|
|
196
|
+
return <div className='ai-configuration-page'>
|
|
197
|
+
{/* Rendered as a normal setting row (id/title/description + control below), plus a page-level
|
|
198
|
+
"Reset All" action in the row's action slot. */}
|
|
199
|
+
<AiConfigurationSettingRow
|
|
200
|
+
preferenceId={DEFAULT_TOOL_CONFIRMATION_PREFERENCE}
|
|
201
|
+
title={modeLabel}
|
|
202
|
+
description={described.description}
|
|
203
|
+
renderMarkdown={this.renderMarkdown}
|
|
204
|
+
modified={inspection.modified}
|
|
205
|
+
tags={this.settingsRowService.tags(DEFAULT_TOOL_CONFIRMATION_PREFERENCE)}
|
|
206
|
+
onOpenMenu={gear => this.settingsRowService.openSettingContextMenu(gear, DEFAULT_TOOL_CONFIRMATION_PREFERENCE, inspection.value, ctx.scope)}
|
|
207
|
+
below={<AiEnumSelect
|
|
208
|
+
ariaLabel={modeLabel}
|
|
209
|
+
value={this.defaultState}
|
|
210
|
+
options={TOOL_OPTIONS}
|
|
211
|
+
onCommit={value => this.confirmationManager.setDefaultConfirmationMode(value as ToolConfirmationMode)}
|
|
212
|
+
/>}
|
|
213
|
+
actions={<button
|
|
214
|
+
className='theia-button secondary'
|
|
215
|
+
title={nls.localize('theia/ai/ide/toolsConfiguration/resetAllTooltip', 'Reset all tools to default')}
|
|
216
|
+
onClick={() => this.resetAllToolsToDefault()}
|
|
217
|
+
>
|
|
218
|
+
{nls.localize('theia/ai/ide/toolsConfiguration/resetAll', 'Reset All')}
|
|
219
|
+
</button>}
|
|
220
|
+
/>
|
|
221
|
+
{this.renderRecommendedDefaultsBanner()}
|
|
222
|
+
</div>;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
protected renderRecommendedDefaultsBanner(): React.ReactNode {
|
|
226
|
+
if (this.defaultState !== ToolConfirmationMode.CONFIRM) {
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
return <AiConfigurationCallout
|
|
230
|
+
message={nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/message',
|
|
231
|
+
'Tool calls currently require approval. Auto-allow all built-in tools at once.'
|
|
232
|
+
+ ' Tools that require extra confirmation (e.g. shell execution), MCP tools,'
|
|
233
|
+
+ ' and any tools added later will still ask before running.')}
|
|
234
|
+
action={<button className='theia-button main' onClick={() => this.allowCurrentTools()}>
|
|
235
|
+
{nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/apply', 'Allow Default Tools')}
|
|
236
|
+
</button>}
|
|
237
|
+
/>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
protected renderSections(ctx: AiConfigurationRenderContext): React.ReactNode {
|
|
241
|
+
return <div className='ai-configuration-page'>
|
|
242
|
+
<ToolConfirmationTable
|
|
243
|
+
toolNames={this.toolNames}
|
|
244
|
+
getDescription={name => this.toolInvocationRegistry.getFunction(name)?.description}
|
|
245
|
+
getEffectiveState={name => this.getEffectiveState(name)}
|
|
246
|
+
isModified={name => this.toolConfirmationModes[name] !== undefined}
|
|
247
|
+
onChangeMode={(name, value) => this.handleToolConfirmationModeChange(name, value)}
|
|
248
|
+
/>
|
|
249
|
+
{/* The allow/deny lists are plain `string[]` preferences, rendered as normal setting rows with the
|
|
250
|
+
shared list editor rather than a bespoke add/remove control. Entries are checked by
|
|
251
|
+
`ShellCommandPermissionService` first: this is the only GUI for these patterns, and an
|
|
252
|
+
unchecked one silently misbehaves ("*" would auto-approve everything, "git log*" would also
|
|
253
|
+
match "git logfoo"). The row still writes the preference itself, so it keeps honouring the
|
|
254
|
+
page's scope; only the rules come from the service. */}
|
|
255
|
+
<AiConfigurationSection title={nls.localize('theia/ai/ide/toolsConfiguration/shellExecution', 'Shell Command Execution')}>
|
|
256
|
+
<AiSettingsRow
|
|
257
|
+
service={this.settingsRowService}
|
|
258
|
+
preferenceId={SHELL_COMMAND_ALLOWLIST_PREFERENCE}
|
|
259
|
+
scope={ctx.scope}
|
|
260
|
+
control={this.shellPatternControl(SHELL_COMMAND_ALLOWLIST_PREFERENCE)}
|
|
261
|
+
onDidChange={ctx.update}
|
|
262
|
+
/>
|
|
263
|
+
<AiSettingsRow
|
|
264
|
+
service={this.settingsRowService}
|
|
265
|
+
preferenceId={SHELL_COMMAND_DENYLIST_PREFERENCE}
|
|
266
|
+
scope={ctx.scope}
|
|
267
|
+
control={this.shellPatternControl(SHELL_COMMAND_DENYLIST_PREFERENCE)}
|
|
268
|
+
onDidChange={ctx.update}
|
|
269
|
+
/>
|
|
270
|
+
</AiConfigurationSection>
|
|
271
|
+
</div>;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
protected async handleToolConfirmationModeChange(toolName: string, mode: ToolConfirmationMode): Promise<void> {
|
|
275
|
+
const toolRequest = this.toolInvocationRegistry.getFunction(toolName);
|
|
276
|
+
if (mode === ToolConfirmationMode.ALWAYS_ALLOW && toolRequest?.confirmAlwaysAllow) {
|
|
277
|
+
const confirmed = await this.showConfirmAlwaysAllowDialog(toolName, toolRequest);
|
|
278
|
+
if (!confirmed) {
|
|
279
|
+
this.onDidChangeEmitter.fire();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
await this.confirmationManager.setConfirmationMode(toolName, mode, toolRequest);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
protected async showConfirmAlwaysAllowDialog(toolName: string, toolRequest: ToolRequest): Promise<boolean> {
|
|
287
|
+
const warningMessage = typeof toolRequest.confirmAlwaysAllow === 'string'
|
|
288
|
+
? toolRequest.confirmAlwaysAllow
|
|
289
|
+
: nls.localize('theia/ai/ide/toolsConfiguration/confirmAlwaysAllow/genericWarning',
|
|
290
|
+
'This tool requires confirmation before auto-approval can be enabled. '
|
|
291
|
+
+ 'Once enabled, all future invocations will execute without confirmation. '
|
|
292
|
+
+ 'Only enable this if you trust this tool and understand the potential risks.');
|
|
293
|
+
const dialog = new ConfirmDialog({
|
|
294
|
+
title: nls.localize('theia/ai/ide/toolsConfiguration/confirmAlwaysAllow/title', 'Enable Auto-Approval for "{0}"?', toolName),
|
|
295
|
+
msg: warningMessage,
|
|
296
|
+
ok: nls.localize('theia/ai/ide/toolsConfiguration/confirmAlwaysAllow/confirm', 'I understand, enable auto-approval'),
|
|
297
|
+
cancel: nls.localizeByDefault('Cancel')
|
|
298
|
+
});
|
|
299
|
+
return !!await dialog.open();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
protected async resetAllToolsToDefault(): Promise<void> {
|
|
303
|
+
const dialog = new ConfirmDialog({
|
|
304
|
+
title: nls.localize('theia/ai/ide/toolsConfiguration/resetAllConfirmDialog/title', 'Reset All Tool Confirmation Modes'),
|
|
305
|
+
msg: nls.localize('theia/ai/ide/toolsConfiguration/resetAllConfirmDialog/msg',
|
|
306
|
+
'Are you sure you want to reset all tool confirmation modes to the default? This will remove all custom settings.'),
|
|
307
|
+
ok: nls.localize('theia/ai/ide/toolsConfiguration/resetAll', 'Reset All'),
|
|
308
|
+
cancel: nls.localizeByDefault('Cancel')
|
|
309
|
+
});
|
|
310
|
+
if (await dialog.open()) {
|
|
311
|
+
await this.confirmationManager.resetAllConfirmationModeSettings();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
protected async allowCurrentTools(): Promise<void> {
|
|
316
|
+
const dialog = new ConfirmDialog({
|
|
317
|
+
title: nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/dialogTitle', 'Allow Default Tools?'),
|
|
318
|
+
msg: this.buildAllowCurrentToolsMessage(),
|
|
319
|
+
ok: nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/dialogConfirm', 'I understand, allow'),
|
|
320
|
+
cancel: nls.localizeByDefault('Cancel')
|
|
321
|
+
});
|
|
322
|
+
if (!await dialog.open()) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const updates: Array<{ toolId: string; mode: ToolConfirmationMode; toolRequest: ToolRequest }> = [];
|
|
326
|
+
for (const tool of this.toolInvocationRegistry.getAllFunctions()) {
|
|
327
|
+
if (tool.confirmAlwaysAllow || tool.name.startsWith('mcp_') || this.toolConfirmationModes[tool.name] === ToolConfirmationMode.DISABLED) {
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
updates.push({ toolId: tool.name, mode: ToolConfirmationMode.ALWAYS_ALLOW, toolRequest: tool });
|
|
331
|
+
}
|
|
332
|
+
await this.confirmationManager.setConfirmationModes(updates);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
protected buildAllowCurrentToolsMessage(): HTMLElement {
|
|
336
|
+
const container = document.createElement('div');
|
|
337
|
+
const lines = [
|
|
338
|
+
nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line1', 'This sets all currently registered built-in tools to "Always Allow".'),
|
|
339
|
+
nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line2',
|
|
340
|
+
'Tools that require extra confirmation (such as shell execution) will still ask before running.'),
|
|
341
|
+
nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line3',
|
|
342
|
+
'MCP tools are third-party and are not included. You can allow them individually in this view.'),
|
|
343
|
+
nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line4', 'Tools added later will still default to "Confirm" so you can review them.'),
|
|
344
|
+
nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line5', 'You can change this later in this view.')
|
|
345
|
+
];
|
|
346
|
+
for (const line of lines) {
|
|
347
|
+
const paragraph = document.createElement('p');
|
|
348
|
+
paragraph.textContent = line;
|
|
349
|
+
container.appendChild(paragraph);
|
|
350
|
+
}
|
|
351
|
+
return container;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* The list control for a shell command pattern list, with the service's own rules attached so an invalid
|
|
356
|
+
* pattern is refused with its message instead of being written.
|
|
357
|
+
*/
|
|
358
|
+
protected shellPatternControl(preferenceId: string): AiSettingsControl {
|
|
359
|
+
const control = this.settingsRowService.controlFor(preferenceId);
|
|
360
|
+
if (control.type !== 'array') {
|
|
361
|
+
return control;
|
|
362
|
+
}
|
|
363
|
+
return { ...control, validate: pattern => this.shellCommandPermissionService.checkPattern(pattern) };
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
getSearchItems(): AiConfigurationSearchItem[] {
|
|
367
|
+
const toolTypeLabel = nls.localizeByDefault('Tool');
|
|
368
|
+
const items: AiConfigurationSearchItem[] = [{
|
|
369
|
+
label: this.defaultModeLabel(),
|
|
370
|
+
typeLabel: nls.localizeByDefault('Setting'),
|
|
371
|
+
categoryId: this.id,
|
|
372
|
+
target: { categoryId: this.id },
|
|
373
|
+
keywords: `${DEFAULT_TOOL_CONFIRMATION_PREFERENCE} ${TOOL_CONFIRMATION_PREFERENCE} ${SHELL_COMMAND_ALLOWLIST_PREFERENCE} ${SHELL_COMMAND_DENYLIST_PREFERENCE}`
|
|
374
|
+
}];
|
|
375
|
+
for (const name of this.toolNames) {
|
|
376
|
+
items.push({ label: name, typeLabel: toolTypeLabel, categoryId: this.id, target: AiConfigurationTools.selectionFor(name), keywords: name });
|
|
377
|
+
}
|
|
378
|
+
return items;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* The per-tool confirmation-mode list with a reusable filter above it. The filter is local UI state, so
|
|
384
|
+
* typing narrows the (potentially long) tool list without touching any preference. Each tool is a
|
|
385
|
+
* non-navigable {@link AiConfigurationItemRow} whose trailing control is its confirmation-mode select,
|
|
386
|
+
* so the list matches the Skills / Variables list style.
|
|
387
|
+
*/
|
|
388
|
+
const ToolConfirmationTable: React.FC<{
|
|
389
|
+
toolNames: string[];
|
|
390
|
+
getDescription: (name: string) => string | undefined;
|
|
391
|
+
getEffectiveState: (name: string) => ToolConfirmationMode;
|
|
392
|
+
isModified: (name: string) => boolean;
|
|
393
|
+
onChangeMode: (name: string, value: ToolConfirmationMode) => void;
|
|
394
|
+
}> = ({ toolNames, getDescription, getEffectiveState, isModified, onChangeMode }) => {
|
|
395
|
+
const [filter, setFilter] = React.useState('');
|
|
396
|
+
const term = filter.trim().toLowerCase();
|
|
397
|
+
const filtered = term ? toolNames.filter(name => name.toLowerCase().includes(term)) : toolNames;
|
|
398
|
+
const modeLabel = nls.localize('theia/ai/ide/toolsConfiguration/confirmationMode/label', 'Confirmation Mode');
|
|
399
|
+
return <>
|
|
400
|
+
<AiConfigurationFilterInput
|
|
401
|
+
value={filter}
|
|
402
|
+
onChange={setFilter}
|
|
403
|
+
placeholder={nls.localize('theia/ai/ide/toolsConfiguration/filterPlaceholder', 'Filter tools')}
|
|
404
|
+
/>
|
|
405
|
+
<div className='ai-configuration-item-list'>
|
|
406
|
+
{filtered.map(name => <AiConfigurationItemRow
|
|
407
|
+
key={name}
|
|
408
|
+
rowId={AiConfigurationTools.ROW_ID_PREFIX + name}
|
|
409
|
+
label={name}
|
|
410
|
+
description={getDescription(name)}
|
|
411
|
+
modified={isModified(name)}
|
|
412
|
+
trailing={<AiEnumSelect
|
|
413
|
+
ariaLabel={modeLabel}
|
|
414
|
+
value={getEffectiveState(name)}
|
|
415
|
+
options={TOOL_OPTIONS}
|
|
416
|
+
onCommit={value => onChangeMode(name, value as ToolConfirmationMode)}
|
|
417
|
+
/>}
|
|
418
|
+
/>)}
|
|
419
|
+
</div>
|
|
420
|
+
</>;
|
|
421
|
+
};
|