@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
|
@@ -1,928 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
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 {
|
|
18
|
-
Agent,
|
|
19
|
-
AgentService,
|
|
20
|
-
AISettingsService,
|
|
21
|
-
AIVariableService,
|
|
22
|
-
FrontendLanguageModelRegistry,
|
|
23
|
-
LanguageModel,
|
|
24
|
-
LanguageModelRegistry,
|
|
25
|
-
matchVariablesRegEx,
|
|
26
|
-
PROMPT_FUNCTION_REGEX,
|
|
27
|
-
ParsedCapability,
|
|
28
|
-
parseCapabilitiesFromTemplate,
|
|
29
|
-
PromptFragmentCustomizationService,
|
|
30
|
-
CustomAgentsLocation,
|
|
31
|
-
PromptService,
|
|
32
|
-
NotificationType,
|
|
33
|
-
PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE,
|
|
34
|
-
GenericCapabilitySelections,
|
|
35
|
-
CAPABILITY_TYPE_PROMPT_MAP,
|
|
36
|
-
} from '@theia/ai-core/lib/common';
|
|
37
|
-
import { isChatAgent } from '@theia/ai-chat/lib/common';
|
|
38
|
-
import { codicon, CommonCommands, QuickInputService } from '@theia/core/lib/browser';
|
|
39
|
-
import { CommandService } from '@theia/core/lib/common/command';
|
|
40
|
-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
41
|
-
import * as React from '@theia/core/shared/react';
|
|
42
|
-
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
43
|
-
import { LanguageModelRenderer } from './language-model-renderer';
|
|
44
|
-
import { LanguageModelAliasRegistry, LanguageModelAlias } from '@theia/ai-core/lib/common/language-model-alias';
|
|
45
|
-
import { AIVariableConfigurationWidget } from './variable-configuration-widget';
|
|
46
|
-
import { MessageService, nls, URI } from '@theia/core';
|
|
47
|
-
import { PromptVariantRenderer } from './template-settings-renderer';
|
|
48
|
-
import { AIListDetailConfigurationWidget } from './base/ai-list-detail-configuration-widget';
|
|
49
|
-
import { AgentNotificationSettings } from './components/agent-notification-settings';
|
|
50
|
-
|
|
51
|
-
interface ParsedPrompt {
|
|
52
|
-
functions: string[];
|
|
53
|
-
globalVariables: string[];
|
|
54
|
-
agentSpecificVariables: string[];
|
|
55
|
-
capabilities: ParsedCapability[];
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/** A candidate location for creating a new custom agent: its scope directory and `agents/` folder. */
|
|
59
|
-
interface CustomAgentScopeOption {
|
|
60
|
-
scopeDir: URI;
|
|
61
|
-
agentsDir: URI;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@injectable()
|
|
65
|
-
export class AIAgentConfigurationWidget extends AIListDetailConfigurationWidget<Agent> {
|
|
66
|
-
|
|
67
|
-
static readonly ID = 'ai-agent-configuration-container-widget';
|
|
68
|
-
static readonly LABEL = nls.localizeByDefault('Agents');
|
|
69
|
-
|
|
70
|
-
@inject(AgentService)
|
|
71
|
-
protected readonly agentService: AgentService;
|
|
72
|
-
|
|
73
|
-
@inject(LanguageModelRegistry)
|
|
74
|
-
protected readonly languageModelRegistry: FrontendLanguageModelRegistry;
|
|
75
|
-
|
|
76
|
-
@inject(PromptFragmentCustomizationService)
|
|
77
|
-
protected readonly promptFragmentCustomizationService: PromptFragmentCustomizationService;
|
|
78
|
-
|
|
79
|
-
@inject(LanguageModelAliasRegistry)
|
|
80
|
-
protected readonly languageModelAliasRegistry: LanguageModelAliasRegistry;
|
|
81
|
-
|
|
82
|
-
@inject(AISettingsService)
|
|
83
|
-
protected readonly aiSettingsService: AISettingsService;
|
|
84
|
-
|
|
85
|
-
@inject(AIConfigurationSelectionService)
|
|
86
|
-
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
87
|
-
|
|
88
|
-
@inject(AIVariableService)
|
|
89
|
-
protected readonly variableService: AIVariableService;
|
|
90
|
-
|
|
91
|
-
@inject(PromptService)
|
|
92
|
-
protected promptService: PromptService;
|
|
93
|
-
|
|
94
|
-
@inject(QuickInputService)
|
|
95
|
-
protected readonly quickInputService: QuickInputService;
|
|
96
|
-
|
|
97
|
-
@inject(CommandService)
|
|
98
|
-
protected readonly commandService: CommandService;
|
|
99
|
-
|
|
100
|
-
@inject(MessageService)
|
|
101
|
-
protected readonly messageService: MessageService;
|
|
102
|
-
|
|
103
|
-
protected languageModels: LanguageModel[] | undefined;
|
|
104
|
-
protected languageModelAliases: LanguageModelAlias[] = [];
|
|
105
|
-
protected parsedPromptParts: ParsedPrompt | undefined;
|
|
106
|
-
protected isLoadingDetails = false;
|
|
107
|
-
protected agentCompletionNotificationType?: NotificationType;
|
|
108
|
-
protected savedCapabilityOverrides: Record<string, boolean> | undefined;
|
|
109
|
-
protected savedGenericCapabilitySelections: GenericCapabilitySelections | undefined;
|
|
110
|
-
|
|
111
|
-
@postConstruct()
|
|
112
|
-
protected init(): void {
|
|
113
|
-
this.id = AIAgentConfigurationWidget.ID;
|
|
114
|
-
this.title.label = AIAgentConfigurationWidget.LABEL;
|
|
115
|
-
this.title.closable = false;
|
|
116
|
-
|
|
117
|
-
Promise.all([
|
|
118
|
-
this.loadItems(),
|
|
119
|
-
this.languageModelRegistry.getLanguageModels().then(models => {
|
|
120
|
-
this.languageModels = models ?? [];
|
|
121
|
-
})
|
|
122
|
-
]).then(() => this.update());
|
|
123
|
-
|
|
124
|
-
this.languageModelAliasRegistry.ready.then(() => {
|
|
125
|
-
this.languageModelAliases = this.languageModelAliasRegistry.getAliases();
|
|
126
|
-
this.toDispose.push(this.languageModelAliasRegistry.onDidChange(() => {
|
|
127
|
-
this.languageModelAliases = this.languageModelAliasRegistry.getAliases();
|
|
128
|
-
this.update();
|
|
129
|
-
}));
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
this.toDispose.pushAll([
|
|
133
|
-
this.languageModelRegistry.onChange(({ models }) => {
|
|
134
|
-
this.languageModelAliases = this.languageModelAliasRegistry.getAliases();
|
|
135
|
-
this.languageModels = models;
|
|
136
|
-
this.update();
|
|
137
|
-
}),
|
|
138
|
-
this.promptService.onPromptsChange(() => this.updateParsedPromptParts()),
|
|
139
|
-
this.promptFragmentCustomizationService.onDidChangePromptFragmentCustomization(() => {
|
|
140
|
-
this.updateParsedPromptParts();
|
|
141
|
-
}),
|
|
142
|
-
this.aiSettingsService.onDidChange(() => {
|
|
143
|
-
this.updateParsedPromptParts();
|
|
144
|
-
}),
|
|
145
|
-
this.aiConfigurationSelectionService.onDidAgentChange(() => {
|
|
146
|
-
this.selectedItem = this.aiConfigurationSelectionService.getActiveAgent();
|
|
147
|
-
this.updateParsedPromptParts();
|
|
148
|
-
}),
|
|
149
|
-
this.agentService.onDidChangeAgents(async () => {
|
|
150
|
-
await this.loadItems();
|
|
151
|
-
this.update();
|
|
152
|
-
})
|
|
153
|
-
]);
|
|
154
|
-
|
|
155
|
-
this.updateParsedPromptParts();
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
protected async loadItems(): Promise<void> {
|
|
159
|
-
this.items = this.agentService.getAllAgents();
|
|
160
|
-
const activeAgent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
161
|
-
if (activeAgent) {
|
|
162
|
-
this.selectedItem = activeAgent;
|
|
163
|
-
} else if (this.items.length > 0 && !this.selectedItem) {
|
|
164
|
-
this.selectedItem = this.items[0];
|
|
165
|
-
this.aiConfigurationSelectionService.setActiveAgent(this.items[0]);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
protected getItemId(agent: Agent): string {
|
|
170
|
-
return agent.id;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
protected getItemLabel(agent: Agent): string {
|
|
174
|
-
return agent.name;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
protected override getEmptySelectionMessage(): string {
|
|
178
|
-
return nls.localize('theia/ai/core/agentConfiguration/selectAgentMessage', 'Please select an Agent first!');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
protected override handleItemSelect = (agent: Agent): void => {
|
|
182
|
-
this.selectedItem = agent;
|
|
183
|
-
this.aiConfigurationSelectionService.setActiveAgent(agent);
|
|
184
|
-
this.updateParsedPromptParts();
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
protected override renderItemPrefix(agent: Agent): React.ReactNode {
|
|
188
|
-
const enabled = this.agentService.isEnabled(agent.id);
|
|
189
|
-
return (
|
|
190
|
-
<span
|
|
191
|
-
className={
|
|
192
|
-
`agent-status-indicator ${enabled ? `agent-enabled ${codicon('circle-filled')}` : `agent-disabled ${codicon('circle')}`}`
|
|
193
|
-
}
|
|
194
|
-
title={enabled ? nls.localizeByDefault('Enabled') : nls.localizeByDefault('Disabled')}
|
|
195
|
-
>
|
|
196
|
-
</span>
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
protected override renderItemSuffix(agent: Agent): React.ReactNode {
|
|
201
|
-
if (!agent.tags?.length) {
|
|
202
|
-
return undefined;
|
|
203
|
-
}
|
|
204
|
-
return <span>{agent.tags.map(tag => <span key={tag} className='agent-tag'>{tag}</span>)}</span>;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
protected override renderList(): React.ReactNode {
|
|
208
|
-
return (
|
|
209
|
-
<div className="ai-configuration-list preferences-tree-widget theia-TreeContainer">
|
|
210
|
-
<ul>
|
|
211
|
-
{this.items.map(agent => {
|
|
212
|
-
const agentId = this.getItemId(agent);
|
|
213
|
-
const isSelected = this.selectedItem && this.getItemId(this.selectedItem) === agentId;
|
|
214
|
-
return <li
|
|
215
|
-
key={agentId}
|
|
216
|
-
className={`theia-TreeNode theia-CompositeTreeNode${isSelected ? ' theia-mod-selected' : ''} ${this.getItemClassName(agent)}`}
|
|
217
|
-
onClick={() => this.handleItemSelect(agent)}
|
|
218
|
-
>
|
|
219
|
-
{this.renderItemPrefix(agent)}
|
|
220
|
-
<span className="ai-configuration-list-item-label">{this.getItemLabel(agent)}</span>
|
|
221
|
-
{this.renderItemSuffix(agent)}
|
|
222
|
-
</li>;
|
|
223
|
-
})}
|
|
224
|
-
</ul>
|
|
225
|
-
<div className='configuration-agents-add'>
|
|
226
|
-
<button
|
|
227
|
-
className='theia-button main'
|
|
228
|
-
onClick={() => this.addCustomAgent()}>
|
|
229
|
-
{nls.localize('theia/ai/core/agentConfiguration/addCustomAgent', 'Add Custom Agent')}
|
|
230
|
-
</button>
|
|
231
|
-
</div>
|
|
232
|
-
</div>
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
protected async updateParsedPromptParts(): Promise<void> {
|
|
237
|
-
this.isLoadingDetails = true;
|
|
238
|
-
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
239
|
-
if (agent) {
|
|
240
|
-
this.parsedPromptParts = await this.parsePromptFragmentsForVariableAndFunction(agent);
|
|
241
|
-
const agentSettings = await this.aiSettingsService.getAgentSettings(agent.id);
|
|
242
|
-
this.showInChatState = agentSettings?.showInChat ?? true;
|
|
243
|
-
this.agentCompletionNotificationType = agentSettings?.completionNotification;
|
|
244
|
-
this.savedCapabilityOverrides = agentSettings?.capabilityOverrides;
|
|
245
|
-
this.savedGenericCapabilitySelections = agentSettings?.genericCapabilitySelections;
|
|
246
|
-
} else {
|
|
247
|
-
this.parsedPromptParts = undefined;
|
|
248
|
-
this.agentCompletionNotificationType = undefined;
|
|
249
|
-
this.savedCapabilityOverrides = undefined;
|
|
250
|
-
this.savedGenericCapabilitySelections = undefined;
|
|
251
|
-
}
|
|
252
|
-
this.isLoadingDetails = false;
|
|
253
|
-
this.update();
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
protected showInChatState: boolean = true;
|
|
257
|
-
|
|
258
|
-
protected renderItemDetail(agent: Agent): React.ReactNode {
|
|
259
|
-
if (this.isLoadingDetails) {
|
|
260
|
-
return <div>{nls.localizeByDefault('Loading...')}</div>;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const enabled = this.agentService.isEnabled(agent.id);
|
|
264
|
-
|
|
265
|
-
if (!this.parsedPromptParts) {
|
|
266
|
-
this.updateParsedPromptParts();
|
|
267
|
-
return <div>{nls.localizeByDefault('Loading...')}</div>;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const globalVariables = Array.from(new Set([...this.parsedPromptParts.globalVariables, ...agent.variables]));
|
|
271
|
-
const functions = Array.from(new Set([...this.parsedPromptParts.functions, ...agent.functions]));
|
|
272
|
-
|
|
273
|
-
const agentNameWithTags = <>
|
|
274
|
-
{agent.name}
|
|
275
|
-
{agent.tags && agent.tags.length > 0 && <span>{agent.tags.map(tag => <span key={tag} className='agent-tag'>{tag}</span>)}</span>}
|
|
276
|
-
</>;
|
|
277
|
-
|
|
278
|
-
return <div key={agent.id}>
|
|
279
|
-
<div className='settings-section-title settings-section-category-title agent-title-with-toggle'>
|
|
280
|
-
<div className='agent-title-content'>
|
|
281
|
-
<div>
|
|
282
|
-
{agentNameWithTags}
|
|
283
|
-
<pre className='ai-id-label'>Id: {agent.id}</pre>
|
|
284
|
-
</div>
|
|
285
|
-
<div className='agent-toggles'>
|
|
286
|
-
<label className='agent-enable-toggle' title={nls.localize('theia/ai/core/agentConfiguration/enableAgent', 'Enable Agent')}>
|
|
287
|
-
<span className='toggle-label'>{nls.localize('theia/ai/core/agentConfiguration/enableAgent', 'Enable Agent')}</span>
|
|
288
|
-
<div className='toggle-switch' onClick={this.toggleAgentEnabled}>
|
|
289
|
-
<input type="checkbox" checked={enabled} onChange={this.toggleAgentEnabled} />
|
|
290
|
-
<span className='toggle-slider'></span>
|
|
291
|
-
</div>
|
|
292
|
-
</label>
|
|
293
|
-
{isChatAgent(agent) && (
|
|
294
|
-
<label className={`agent-enable-toggle${enabled ? '' : ' disabled'}`}
|
|
295
|
-
title={nls.localize('theia/ai/core/agentConfiguration/showInChat', 'Show in Chat')}>
|
|
296
|
-
<span className='toggle-label'>{nls.localize('theia/ai/core/agentConfiguration/showInChat', 'Show in Chat')}</span>
|
|
297
|
-
<div className='toggle-switch' onClick={enabled ? this.toggleShowInChat : undefined}>
|
|
298
|
-
<input type="checkbox" checked={this.showInChatState} disabled={!enabled} onChange={this.toggleShowInChat} />
|
|
299
|
-
<span className='toggle-slider'></span>
|
|
300
|
-
</div>
|
|
301
|
-
</label>
|
|
302
|
-
)}
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
305
|
-
</div>
|
|
306
|
-
|
|
307
|
-
{agent.description && (
|
|
308
|
-
<div className="ai-agent-description">
|
|
309
|
-
{agent.description}
|
|
310
|
-
</div>
|
|
311
|
-
)}
|
|
312
|
-
{agent.prompts.length > 0 && (
|
|
313
|
-
<>
|
|
314
|
-
<div className="settings-section-subcategory-title ai-settings-section-subcategory-title">
|
|
315
|
-
{nls.localize('theia/ai/core/agentConfiguration/promptTemplates', 'Prompt Templates')}
|
|
316
|
-
</div>
|
|
317
|
-
<table className="ai-templates-table">
|
|
318
|
-
<thead>
|
|
319
|
-
<tr>
|
|
320
|
-
<th>{nls.localize('theia/ai/core/agentConfiguration/templateName', 'Template')}</th>
|
|
321
|
-
<th>{nls.localize('theia/ai/core/agentConfiguration/variant', 'Variant')}</th>
|
|
322
|
-
<th className="template-actions-header">{nls.localizeByDefault('Actions')}</th>
|
|
323
|
-
</tr>
|
|
324
|
-
</thead>
|
|
325
|
-
<tbody>
|
|
326
|
-
{agent.prompts.map(prompt => (
|
|
327
|
-
<PromptVariantRenderer
|
|
328
|
-
key={agent.id + '.' + prompt.id}
|
|
329
|
-
agentId={agent.id}
|
|
330
|
-
promptVariantSet={prompt}
|
|
331
|
-
promptService={this.promptService}
|
|
332
|
-
/>
|
|
333
|
-
))}
|
|
334
|
-
</tbody>
|
|
335
|
-
</table>
|
|
336
|
-
</>
|
|
337
|
-
)}
|
|
338
|
-
|
|
339
|
-
<div className='ai-lm-requirements'>
|
|
340
|
-
<LanguageModelRenderer
|
|
341
|
-
agent={agent}
|
|
342
|
-
languageModels={this.languageModels}
|
|
343
|
-
aiSettingsService={this.aiSettingsService}
|
|
344
|
-
languageModelRegistry={this.languageModelRegistry}
|
|
345
|
-
languageModelAliases={this.languageModelAliases}
|
|
346
|
-
/>
|
|
347
|
-
</div>
|
|
348
|
-
|
|
349
|
-
{globalVariables.length > 0 && (
|
|
350
|
-
<>
|
|
351
|
-
<div className="settings-section-subcategory-title ai-settings-section-subcategory-title">
|
|
352
|
-
{nls.localize('theia/ai/core/agentConfiguration/usedGlobalVariables', 'Used Global Variables')}
|
|
353
|
-
</div>
|
|
354
|
-
<AgentGlobalVariables
|
|
355
|
-
variables={globalVariables}
|
|
356
|
-
variableService={this.variableService}
|
|
357
|
-
/>
|
|
358
|
-
</>
|
|
359
|
-
)}
|
|
360
|
-
|
|
361
|
-
{this.parsedPromptParts.agentSpecificVariables.length > 0 && (
|
|
362
|
-
<>
|
|
363
|
-
<div className="settings-section-subcategory-title ai-settings-section-subcategory-title">
|
|
364
|
-
{nls.localize('theia/ai/core/agentConfiguration/usedAgentSpecificVariables', 'Used Agent-Specific Variables')}
|
|
365
|
-
</div>
|
|
366
|
-
<ul className='variable-references'>
|
|
367
|
-
<AgentSpecificVariables
|
|
368
|
-
promptVariables={this.parsedPromptParts.agentSpecificVariables}
|
|
369
|
-
agent={agent}
|
|
370
|
-
/>
|
|
371
|
-
</ul>
|
|
372
|
-
</>
|
|
373
|
-
)}
|
|
374
|
-
|
|
375
|
-
{functions.length > 0 && (
|
|
376
|
-
<>
|
|
377
|
-
<div className="settings-section-subcategory-title ai-settings-section-subcategory-title">
|
|
378
|
-
{nls.localize('theia/ai/core/agentConfiguration/usedFunctions', 'Used Functions')}
|
|
379
|
-
</div>
|
|
380
|
-
<ul className='function-references'>
|
|
381
|
-
<AgentFunctions functions={functions} />
|
|
382
|
-
</ul>
|
|
383
|
-
</>
|
|
384
|
-
)}
|
|
385
|
-
|
|
386
|
-
{this.parsedPromptParts.capabilities.length > 0 && (
|
|
387
|
-
<>
|
|
388
|
-
<div className="settings-section-subcategory-title">
|
|
389
|
-
{nls.localize('theia/ai/core/agentConfiguration/availableCapabilities', 'Available Capabilities')}
|
|
390
|
-
</div>
|
|
391
|
-
<AgentCapabilitiesSettings
|
|
392
|
-
capabilities={this.parsedPromptParts.capabilities}
|
|
393
|
-
agentId={agent.id}
|
|
394
|
-
savedOverrides={this.savedCapabilityOverrides}
|
|
395
|
-
aiSettingsService={this.aiSettingsService}
|
|
396
|
-
onSettingsChange={() => this.updateParsedPromptParts()}
|
|
397
|
-
/>
|
|
398
|
-
</>
|
|
399
|
-
)}
|
|
400
|
-
|
|
401
|
-
{GenericCapabilitySelections.hasSelections(this.savedGenericCapabilitySelections) && (
|
|
402
|
-
<>
|
|
403
|
-
<div className="settings-section-subcategory-title ai-settings-section-subcategory-title">
|
|
404
|
-
{nls.localize('theia/ai/ide/agentConfiguration/genericCapabilitiesSettings', 'Generic Capabilities')}
|
|
405
|
-
</div>
|
|
406
|
-
<AgentGenericCapabilitiesSettings
|
|
407
|
-
agentId={agent.id}
|
|
408
|
-
savedSelections={this.savedGenericCapabilitySelections}
|
|
409
|
-
aiSettingsService={this.aiSettingsService}
|
|
410
|
-
onSettingsChange={() => this.updateParsedPromptParts()}
|
|
411
|
-
/>
|
|
412
|
-
</>
|
|
413
|
-
)}
|
|
414
|
-
|
|
415
|
-
{isChatAgent(agent) && (
|
|
416
|
-
<>
|
|
417
|
-
<div className="settings-section-subcategory-title ai-settings-section-subcategory-title">
|
|
418
|
-
{nls.localize('theia/ai/core/agentConfiguration/notificationSettings', 'Notification Settings')}
|
|
419
|
-
</div>
|
|
420
|
-
<AgentNotificationSettings
|
|
421
|
-
agentId={agent.id}
|
|
422
|
-
currentNotificationType={this.agentCompletionNotificationType}
|
|
423
|
-
onNotificationTypeChange={this.handleNotificationTypeChange}
|
|
424
|
-
onOpenNotificationSettings={this.openNotificationSettings}
|
|
425
|
-
/>
|
|
426
|
-
</>
|
|
427
|
-
)}
|
|
428
|
-
</div>;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
protected async parsePromptFragmentsForVariableAndFunction(agent: Agent): Promise<ParsedPrompt> {
|
|
432
|
-
const result: ParsedPrompt = { functions: [], globalVariables: [], agentSpecificVariables: [], capabilities: [] };
|
|
433
|
-
const agentSettings = await this.aiSettingsService.getAgentSettings(agent.id);
|
|
434
|
-
const selectedVariants = agentSettings?.selectedVariants ?? {};
|
|
435
|
-
|
|
436
|
-
for (const mainTemplate of agent.prompts) {
|
|
437
|
-
const promptId = selectedVariants[mainTemplate.id] ?? mainTemplate.defaultVariant.id ?? mainTemplate.id;
|
|
438
|
-
const promptToAnalyze: string | undefined = this.promptService.getRawPromptFragment(promptId)?.template;
|
|
439
|
-
|
|
440
|
-
if (!promptToAnalyze) {
|
|
441
|
-
continue;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
this.extractVariablesAndFunctions(promptToAnalyze, result, agent);
|
|
445
|
-
this.extractCapabilities(promptToAnalyze, result);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
return result;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
protected extractCapabilities(promptContent: string, result: ParsedPrompt): void {
|
|
452
|
-
const capabilities = parseCapabilitiesFromTemplate(promptContent);
|
|
453
|
-
const existingIds = new Set(result.capabilities.map(c => c.fragmentId));
|
|
454
|
-
for (const capability of capabilities) {
|
|
455
|
-
if (!existingIds.has(capability.fragmentId)) {
|
|
456
|
-
const fragment = this.promptService.getRawPromptFragment(capability.fragmentId);
|
|
457
|
-
result.capabilities.push({
|
|
458
|
-
...capability,
|
|
459
|
-
name: fragment?.name,
|
|
460
|
-
description: fragment?.description,
|
|
461
|
-
});
|
|
462
|
-
existingIds.add(capability.fragmentId);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
protected extractVariablesAndFunctions(promptContent: string, result: ParsedPrompt, agent: Agent): void {
|
|
468
|
-
const variableMatches = matchVariablesRegEx(promptContent);
|
|
469
|
-
variableMatches.forEach(match => {
|
|
470
|
-
const variableId = match[1];
|
|
471
|
-
if (variableId.startsWith('!--') || variableId.startsWith('capability:')) {
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const baseVariableId = variableId.split(':')[0];
|
|
476
|
-
|
|
477
|
-
if (this.variableService.hasVariable(baseVariableId) &&
|
|
478
|
-
agent.agentSpecificVariables.find(v => v.name === baseVariableId) === undefined) {
|
|
479
|
-
result.globalVariables.push(variableId);
|
|
480
|
-
} else {
|
|
481
|
-
result.agentSpecificVariables.push(variableId);
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
const functionMatches = [...promptContent.matchAll(PROMPT_FUNCTION_REGEX)];
|
|
486
|
-
functionMatches.forEach(match => {
|
|
487
|
-
const functionId = match[1];
|
|
488
|
-
result.functions.push(functionId);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
protected showVariableConfigurationTab(): void {
|
|
493
|
-
this.aiConfigurationSelectionService.selectConfigurationTab(AIVariableConfigurationWidget.ID);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Selects the candidate creation locations from the reported agent locations. Only `agents/`
|
|
498
|
-
* directories are considered (legacy `customAgents.yml` entries exist for discovery only). A
|
|
499
|
-
* scope is offered when it already contains an `agents/` folder; the preferred scope (the first
|
|
500
|
-
* one, i.e. `.agents`) is always kept so a fresh workspace defaults to `.agents` without
|
|
501
|
-
* surfacing empty fallback folders such as `.prompts`.
|
|
502
|
-
*/
|
|
503
|
-
protected selectAgentScopeOptions(locations: CustomAgentsLocation[]): CustomAgentScopeOption[] {
|
|
504
|
-
return locations
|
|
505
|
-
.filter(location => location.kind === 'agents-dir')
|
|
506
|
-
.filter((location, index) => index === 0 || location.exists)
|
|
507
|
-
.map(location => ({ scopeDir: location.uri.parent, agentsDir: location.uri }));
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
protected async addCustomAgent(): Promise<void> {
|
|
511
|
-
const allLocations = await this.promptFragmentCustomizationService.getCustomAgentsLocations();
|
|
512
|
-
const scopeOptions = this.selectAgentScopeOptions(allLocations);
|
|
513
|
-
if (scopeOptions.length === 0) {
|
|
514
|
-
this.messageService.warn(nls.localize('theia/ai/ide/agentConfiguration/newAgent/noLocation',
|
|
515
|
-
'Cannot create a custom agent: no prompt-templates location is configured. Set a global or workspace prompt-templates folder and try again.'));
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
let chosen = scopeOptions[0];
|
|
520
|
-
if (scopeOptions.length > 1) {
|
|
521
|
-
chosen = await new Promise<typeof scopeOptions[number]>((resolve, reject) => {
|
|
522
|
-
const quickPick = this.quickInputService.createQuickPick();
|
|
523
|
-
quickPick.title = nls.localize('theia/ai/ide/agentConfiguration/customAgentLocationQuickPick/title',
|
|
524
|
-
'Select location for the new custom agent');
|
|
525
|
-
quickPick.placeholder = nls.localize('theia/ai/ide/agentConfiguration/customAgentLocationQuickPick/placeholder',
|
|
526
|
-
'Choose where to create the agents/<id>/agent.md file');
|
|
527
|
-
quickPick.items = scopeOptions.map(opt => ({
|
|
528
|
-
label: opt.scopeDir.path.toString(),
|
|
529
|
-
description: opt.agentsDir.path.toString(),
|
|
530
|
-
option: opt
|
|
531
|
-
}));
|
|
532
|
-
quickPick.onDidAccept(() => {
|
|
533
|
-
const selected = quickPick.selectedItems[0] as unknown as { option: typeof scopeOptions[number] };
|
|
534
|
-
quickPick.dispose();
|
|
535
|
-
if (selected?.option) {
|
|
536
|
-
resolve(selected.option);
|
|
537
|
-
} else {
|
|
538
|
-
reject(new Error('No location selected'));
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
quickPick.onDidHide(() => reject(new Error('Selection cancelled')));
|
|
542
|
-
quickPick.show();
|
|
543
|
-
}).catch(() => undefined) ?? scopeOptions[0];
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
const id = await this.quickInputService.input({
|
|
547
|
-
title: nls.localize('theia/ai/ide/agentConfiguration/newAgent/idTitle', 'New custom agent'),
|
|
548
|
-
prompt: nls.localize('theia/ai/ide/agentConfiguration/newAgent/idPrompt',
|
|
549
|
-
'Agent id (used as folder name under agents/)'),
|
|
550
|
-
placeHolder: 'my-agent',
|
|
551
|
-
validateInput: async value => /^[A-Za-z0-9._-]+$/.test(value)
|
|
552
|
-
? undefined
|
|
553
|
-
: nls.localize('theia/ai/ide/agentConfiguration/newAgent/idInvalid',
|
|
554
|
-
'Use letters, digits, dash, underscore, or dot only.')
|
|
555
|
-
});
|
|
556
|
-
if (!id) {
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
try {
|
|
561
|
-
await this.promptFragmentCustomizationService.createCustomAgentFile(chosen.scopeDir, {
|
|
562
|
-
id,
|
|
563
|
-
name: id,
|
|
564
|
-
description: nls.localize('theia/ai/ide/agentConfiguration/newAgent/defaultDescription',
|
|
565
|
-
'Custom agent. Edit this description in agent.md.'),
|
|
566
|
-
prompt: nls.localize('theia/ai/ide/agentConfiguration/newAgent/defaultPrompt',
|
|
567
|
-
'You are a helpful agent. Adjust this prompt to fit your needs.'),
|
|
568
|
-
defaultLLM: 'default/universal',
|
|
569
|
-
showInChat: true
|
|
570
|
-
});
|
|
571
|
-
} catch (error) {
|
|
572
|
-
this.messageService.error(nls.localize('theia/ai/ide/agentConfiguration/newAgent/createFailed',
|
|
573
|
-
'Could not create the custom agent "{0}": {1}', id, error instanceof Error ? error.message : String(error)));
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
private toggleAgentEnabled = async () => {
|
|
578
|
-
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
579
|
-
if (!agent) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
|
-
const enabled = this.agentService.isEnabled(agent.id);
|
|
583
|
-
if (enabled) {
|
|
584
|
-
await this.agentService.disableAgent(agent.id);
|
|
585
|
-
} else {
|
|
586
|
-
await this.agentService.enableAgent(agent.id);
|
|
587
|
-
}
|
|
588
|
-
this.update();
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
private toggleShowInChat = async () => {
|
|
592
|
-
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
593
|
-
if (!agent) {
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
if (!this.agentService.isEnabled(agent.id)) {
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
const newValue = !this.showInChatState;
|
|
600
|
-
await this.aiSettingsService.updateAgentSettings(agent.id, { showInChat: newValue });
|
|
601
|
-
this.showInChatState = newValue;
|
|
602
|
-
this.update();
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
private handleNotificationTypeChange = async (agentId: string, notificationType: NotificationType | undefined): Promise<void> => {
|
|
606
|
-
await this.aiSettingsService.updateAgentSettings(agentId, {
|
|
607
|
-
completionNotification: notificationType
|
|
608
|
-
});
|
|
609
|
-
this.agentCompletionNotificationType = notificationType;
|
|
610
|
-
this.update();
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
private openNotificationSettings = (): void => {
|
|
614
|
-
this.commandService.executeCommand(CommonCommands.OPEN_PREFERENCES.id, PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE);
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
interface AgentGlobalVariablesProps {
|
|
619
|
-
variables: string[];
|
|
620
|
-
variableService: AIVariableService;
|
|
621
|
-
}
|
|
622
|
-
const AgentGlobalVariables = ({ variables: globalVariables, variableService }: AgentGlobalVariablesProps) => {
|
|
623
|
-
if (globalVariables.length === 0) {
|
|
624
|
-
return <div className="ai-empty-state-content">
|
|
625
|
-
{nls.localizeByDefault('None')}
|
|
626
|
-
</div>;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
const allVariables = variableService.getVariables();
|
|
630
|
-
const variableData = globalVariables.map(varId => {
|
|
631
|
-
const variable = allVariables.find(v => v.id === varId);
|
|
632
|
-
return {
|
|
633
|
-
id: varId,
|
|
634
|
-
name: variable?.name || varId,
|
|
635
|
-
description: variable?.description || ''
|
|
636
|
-
};
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
return (
|
|
640
|
-
<table className="ai-templates-table">
|
|
641
|
-
<thead>
|
|
642
|
-
<tr>
|
|
643
|
-
<th>{nls.localizeByDefault('Variable')}</th>
|
|
644
|
-
<th>{nls.localizeByDefault('Description')}</th>
|
|
645
|
-
</tr>
|
|
646
|
-
</thead>
|
|
647
|
-
<tbody>
|
|
648
|
-
{variableData.map(variable => (
|
|
649
|
-
<tr key={variable.id}>
|
|
650
|
-
<td className="ai-variable-name-cell">{variable.name}</td>
|
|
651
|
-
<td className="ai-variable-description-cell">
|
|
652
|
-
{variable.description || nls.localize('theia/ai/ide/agentConfiguration/noDescription', 'No description available')}
|
|
653
|
-
</td>
|
|
654
|
-
</tr>
|
|
655
|
-
))}
|
|
656
|
-
</tbody>
|
|
657
|
-
</table>
|
|
658
|
-
);
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
interface AgentFunctionsProps {
|
|
662
|
-
functions: string[];
|
|
663
|
-
}
|
|
664
|
-
const AgentFunctions = ({ functions }: AgentFunctionsProps) => {
|
|
665
|
-
if (functions.length === 0) {
|
|
666
|
-
return <>{nls.localizeByDefault('None')}</>;
|
|
667
|
-
}
|
|
668
|
-
return <>
|
|
669
|
-
{functions.map(functionId => <li key={functionId} className='variable-reference'>
|
|
670
|
-
<span>{functionId}</span>
|
|
671
|
-
</li>)}
|
|
672
|
-
</>;
|
|
673
|
-
};
|
|
674
|
-
|
|
675
|
-
interface AgentCapabilitiesSettingsProps {
|
|
676
|
-
capabilities: ParsedCapability[];
|
|
677
|
-
agentId: string;
|
|
678
|
-
savedOverrides: Record<string, boolean> | undefined;
|
|
679
|
-
aiSettingsService: AISettingsService;
|
|
680
|
-
onSettingsChange: () => void;
|
|
681
|
-
}
|
|
682
|
-
const AgentCapabilitiesSettings = ({ capabilities, agentId, savedOverrides, aiSettingsService, onSettingsChange }: AgentCapabilitiesSettingsProps) => {
|
|
683
|
-
const [loading, setLoading] = React.useState(false);
|
|
684
|
-
|
|
685
|
-
const handleToggle = async (fragmentId: string, currentValue: boolean) => {
|
|
686
|
-
if (loading) {
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
setLoading(true);
|
|
690
|
-
try {
|
|
691
|
-
const newValue = !currentValue;
|
|
692
|
-
const capability = capabilities.find(c => c.fragmentId === fragmentId);
|
|
693
|
-
if (!capability) {
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
const newOverrides = { ...savedOverrides };
|
|
698
|
-
|
|
699
|
-
// If new value matches default, remove the override
|
|
700
|
-
if (newValue === capability.defaultEnabled) {
|
|
701
|
-
delete newOverrides[fragmentId];
|
|
702
|
-
} else {
|
|
703
|
-
newOverrides[fragmentId] = newValue;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
await aiSettingsService.updateAgentSettings(agentId, { capabilityOverrides: newOverrides });
|
|
707
|
-
onSettingsChange();
|
|
708
|
-
} catch (error) {
|
|
709
|
-
console.error('Failed to update capability settings:', error);
|
|
710
|
-
} finally {
|
|
711
|
-
setLoading(false);
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
const handleResetAll = async () => {
|
|
716
|
-
if (loading) {
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
setLoading(true);
|
|
720
|
-
try {
|
|
721
|
-
await aiSettingsService.updateAgentSettings(agentId, { capabilityOverrides: undefined });
|
|
722
|
-
onSettingsChange();
|
|
723
|
-
} catch (error) {
|
|
724
|
-
console.error('Failed to reset all capability settings:', error);
|
|
725
|
-
} finally {
|
|
726
|
-
setLoading(false);
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
|
|
730
|
-
const getCurrentValue = (capability: ParsedCapability): boolean => {
|
|
731
|
-
if (savedOverrides && capability.fragmentId in savedOverrides) {
|
|
732
|
-
return savedOverrides[capability.fragmentId];
|
|
733
|
-
}
|
|
734
|
-
return capability.defaultEnabled;
|
|
735
|
-
};
|
|
736
|
-
|
|
737
|
-
const hasOverride = (capability: ParsedCapability): boolean =>
|
|
738
|
-
savedOverrides !== undefined && capability.fragmentId in savedOverrides;
|
|
739
|
-
|
|
740
|
-
const hasAnyOverrides = savedOverrides && Object.keys(savedOverrides).length > 0;
|
|
741
|
-
|
|
742
|
-
return (
|
|
743
|
-
<>
|
|
744
|
-
{hasAnyOverrides && (
|
|
745
|
-
<div className="capability-reset-all-container">
|
|
746
|
-
<button
|
|
747
|
-
className="theia-button secondary"
|
|
748
|
-
onClick={handleResetAll}
|
|
749
|
-
disabled={loading}
|
|
750
|
-
title={nls.localize('theia/ai/ide/agentConfiguration/resetAllCapabilities', 'Reset all capabilities to their default values')}
|
|
751
|
-
>
|
|
752
|
-
{nls.localize('theia/ai/ide/agentConfiguration/resetAllDefaults', 'Reset All to Defaults')}
|
|
753
|
-
</button>
|
|
754
|
-
</div>
|
|
755
|
-
)}
|
|
756
|
-
<table className="ai-templates-table">
|
|
757
|
-
<thead>
|
|
758
|
-
<tr>
|
|
759
|
-
<th>{nls.localizeByDefault('ID')}</th>
|
|
760
|
-
<th>{nls.localizeByDefault('Name')}</th>
|
|
761
|
-
<th>{nls.localizeByDefault('Description')}</th>
|
|
762
|
-
<th>{nls.localizeByDefault('Enabled')}</th>
|
|
763
|
-
</tr>
|
|
764
|
-
</thead>
|
|
765
|
-
<tbody>
|
|
766
|
-
{capabilities.map(capability => (
|
|
767
|
-
<tr key={capability.fragmentId} className={hasOverride(capability) ? 'capability-modified' : ''}>
|
|
768
|
-
<td className="ai-variable-name-cell">{capability.fragmentId}</td>
|
|
769
|
-
<td className="ai-variable-name-cell">
|
|
770
|
-
{capability.name ?? capability.fragmentId}
|
|
771
|
-
</td>
|
|
772
|
-
<td className="ai-variable-description-cell">
|
|
773
|
-
{capability.description ?? nls.localize('theia/ai/ide/agentConfiguration/noDescription', 'No description available')}
|
|
774
|
-
</td>
|
|
775
|
-
<td>
|
|
776
|
-
<div className='toggle-switch' onClick={!loading ? () => handleToggle(capability.fragmentId, getCurrentValue(capability)) : undefined}>
|
|
777
|
-
<input type="checkbox" checked={getCurrentValue(capability)} disabled={loading} readOnly />
|
|
778
|
-
<span className='toggle-slider'></span>
|
|
779
|
-
</div>
|
|
780
|
-
</td>
|
|
781
|
-
</tr>
|
|
782
|
-
))}
|
|
783
|
-
</tbody>
|
|
784
|
-
</table>
|
|
785
|
-
</>
|
|
786
|
-
);
|
|
787
|
-
};
|
|
788
|
-
|
|
789
|
-
interface AgentSpecificVariablesProps {
|
|
790
|
-
promptVariables: string[];
|
|
791
|
-
agent: Agent;
|
|
792
|
-
}
|
|
793
|
-
const AgentSpecificVariables = ({ promptVariables, agent }: AgentSpecificVariablesProps) => {
|
|
794
|
-
const agentDefinedVariablesName = agent.agentSpecificVariables.map(v => v.name);
|
|
795
|
-
const variables = Array.from(new Set([...promptVariables, ...agentDefinedVariablesName]));
|
|
796
|
-
if (variables.length === 0) {
|
|
797
|
-
return <div className="ai-empty-state-content">
|
|
798
|
-
{nls.localizeByDefault('None')}
|
|
799
|
-
</div>;
|
|
800
|
-
}
|
|
801
|
-
return <div>
|
|
802
|
-
{variables.map(variableId =>
|
|
803
|
-
<AgentSpecificVariable
|
|
804
|
-
key={variableId}
|
|
805
|
-
variableId={variableId}
|
|
806
|
-
agent={agent}
|
|
807
|
-
promptVariables={promptVariables} />
|
|
808
|
-
)}
|
|
809
|
-
</div>;
|
|
810
|
-
};
|
|
811
|
-
interface AgentSpecificVariableProps {
|
|
812
|
-
variableId: string;
|
|
813
|
-
agent: Agent;
|
|
814
|
-
promptVariables: string[];
|
|
815
|
-
}
|
|
816
|
-
const AgentSpecificVariable = ({ variableId, agent, promptVariables }: AgentSpecificVariableProps) => {
|
|
817
|
-
const agentDefinedVariable = agent.agentSpecificVariables.find(v => v.name === variableId);
|
|
818
|
-
const undeclared = agentDefinedVariable === undefined;
|
|
819
|
-
const notUsed = !promptVariables.includes(variableId) && agentDefinedVariable?.usedInPrompt === true;
|
|
820
|
-
return <div key={variableId} className="ai-agent-specific-variable-item">
|
|
821
|
-
<div className="ai-configuration-value-row">
|
|
822
|
-
<span className="ai-configuration-value-row-label">{nls.localizeByDefault('Name')}:</span>
|
|
823
|
-
<span className="ai-configuration-value-row-value">{variableId}</span>
|
|
824
|
-
</div>
|
|
825
|
-
{undeclared ? (
|
|
826
|
-
<div className="ai-configuration-value-row"
|
|
827
|
-
title={nls.localize('theia/ai/core/agentConfiguration/undeclaredTooltip',
|
|
828
|
-
'This variable is used in the prompt but has no description declared by the agent.')}>
|
|
829
|
-
<span className="ai-configuration-value-row-label">{nls.localizeByDefault('Status')}:</span>
|
|
830
|
-
<span className="ai-configuration-value-row-value ai-configuration-warning-text">
|
|
831
|
-
{nls.localize('theia/ai/core/agentConfiguration/undeclared', 'Undeclared')}
|
|
832
|
-
</span>
|
|
833
|
-
</div>
|
|
834
|
-
) : (
|
|
835
|
-
<>
|
|
836
|
-
<div className="ai-configuration-value-row">
|
|
837
|
-
<span className="ai-configuration-value-row-label">{nls.localizeByDefault('Description')}:</span>
|
|
838
|
-
<span className="ai-configuration-value-row-value">{agentDefinedVariable.description}</span>
|
|
839
|
-
</div>
|
|
840
|
-
{notUsed && (
|
|
841
|
-
<div className="ai-configuration-value-row"
|
|
842
|
-
title={nls.localize('theia/ai/core/agentConfiguration/notUsedInPromptTooltip',
|
|
843
|
-
'This variable is declared by the agent but not referenced in the current prompt template.')}>
|
|
844
|
-
<span className="ai-configuration-value-row-label">{nls.localizeByDefault('Status')}:</span>
|
|
845
|
-
<span className="ai-configuration-value-row-value ai-configuration-warning-text">
|
|
846
|
-
{nls.localize('theia/ai/core/agentConfiguration/notUsedInPrompt', 'Not used in prompt')}
|
|
847
|
-
</span>
|
|
848
|
-
</div>
|
|
849
|
-
)}
|
|
850
|
-
</>
|
|
851
|
-
)}
|
|
852
|
-
</div>;
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
interface AgentGenericCapabilitiesSettingsProps {
|
|
856
|
-
agentId: string;
|
|
857
|
-
savedSelections: GenericCapabilitySelections | undefined;
|
|
858
|
-
aiSettingsService: AISettingsService;
|
|
859
|
-
onSettingsChange: () => void;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
const AgentGenericCapabilitiesSettings = ({ agentId, savedSelections, aiSettingsService, onSettingsChange }: AgentGenericCapabilitiesSettingsProps) => {
|
|
863
|
-
const [loading, setLoading] = React.useState(false);
|
|
864
|
-
|
|
865
|
-
const handleReset = async (capabilityType: keyof GenericCapabilitySelections) => {
|
|
866
|
-
if (loading) {
|
|
867
|
-
return;
|
|
868
|
-
}
|
|
869
|
-
setLoading(true);
|
|
870
|
-
try {
|
|
871
|
-
const newSelections: GenericCapabilitySelections = {
|
|
872
|
-
...savedSelections,
|
|
873
|
-
[capabilityType]: undefined
|
|
874
|
-
};
|
|
875
|
-
await aiSettingsService.updateAgentSettings(agentId, { genericCapabilitySelections: newSelections });
|
|
876
|
-
onSettingsChange();
|
|
877
|
-
} catch (error) {
|
|
878
|
-
console.error('Failed to reset generic capability selections:', error);
|
|
879
|
-
} finally {
|
|
880
|
-
setLoading(false);
|
|
881
|
-
}
|
|
882
|
-
};
|
|
883
|
-
|
|
884
|
-
const capabilityTypes = CAPABILITY_TYPE_PROMPT_MAP.map(m => m.type);
|
|
885
|
-
|
|
886
|
-
const getDisplayName = (type: keyof GenericCapabilitySelections): string => ({
|
|
887
|
-
skills: nls.localizeByDefault('Skills'),
|
|
888
|
-
mcpFunctions: nls.localize('theia/ai/ide/agentConfiguration/genericCapabilityType/mcpFunctions', 'MCP Functions'),
|
|
889
|
-
functions: nls.localize('theia/ai/ide/agentConfiguration/genericCapabilityType/functions', 'Functions'),
|
|
890
|
-
promptFragments: nls.localize('theia/ai/ide/agentConfiguration/genericCapabilityType/promptFragments', 'Prompt Fragments'),
|
|
891
|
-
agentDelegation: nls.localize('theia/ai/ide/agentConfiguration/genericCapabilityType/agentDelegation', 'Agent Delegation'),
|
|
892
|
-
variables: nls.localizeByDefault('Variables')
|
|
893
|
-
} as const)[type];
|
|
894
|
-
|
|
895
|
-
return (
|
|
896
|
-
<table className="ai-templates-table">
|
|
897
|
-
<thead>
|
|
898
|
-
<tr>
|
|
899
|
-
<th>{nls.localizeByDefault('Type')}</th>
|
|
900
|
-
<th>{nls.localize('theia/ai/ide/agentConfiguration/selections', 'Selections')}</th>
|
|
901
|
-
<th className="template-actions-header">{nls.localizeByDefault('Actions')}</th>
|
|
902
|
-
</tr>
|
|
903
|
-
</thead>
|
|
904
|
-
<tbody>
|
|
905
|
-
{capabilityTypes
|
|
906
|
-
.filter(type => (savedSelections?.[type]?.length ?? 0) > 0)
|
|
907
|
-
.map(type => (
|
|
908
|
-
<tr key={type}>
|
|
909
|
-
<td className="ai-variable-name-cell">{getDisplayName(type)}</td>
|
|
910
|
-
<td className="ai-variable-description-cell">
|
|
911
|
-
{(savedSelections?.[type] ?? []).join(', ')}
|
|
912
|
-
</td>
|
|
913
|
-
<td className="template-actions-cell">
|
|
914
|
-
<button
|
|
915
|
-
className="theia-button secondary"
|
|
916
|
-
onClick={() => handleReset(type)}
|
|
917
|
-
disabled={loading}
|
|
918
|
-
title={nls.localizeByDefault('Reset')}
|
|
919
|
-
>
|
|
920
|
-
{nls.localizeByDefault('Reset')}
|
|
921
|
-
</button>
|
|
922
|
-
</td>
|
|
923
|
-
</tr>
|
|
924
|
-
))}
|
|
925
|
-
</tbody>
|
|
926
|
-
</table>
|
|
927
|
-
);
|
|
928
|
-
};
|