@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,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var AITokenUsageConfigurationWidget_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.AITokenUsageConfigurationWidget = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const React = require("@theia/core/shared/react");
|
|
23
|
-
const core_1 = require("@theia/core");
|
|
24
|
-
const token_usage_frontend_service_1 = require("@theia/ai-core/lib/browser/token-usage-frontend-service");
|
|
25
|
-
const date_fns_1 = require("date-fns");
|
|
26
|
-
const ai_table_configuration_widget_1 = require("./base/ai-table-configuration-widget");
|
|
27
|
-
let AITokenUsageConfigurationWidget = class AITokenUsageConfigurationWidget extends ai_table_configuration_widget_1.AITableConfigurationWidget {
|
|
28
|
-
static { AITokenUsageConfigurationWidget_1 = this; }
|
|
29
|
-
static { this.ID = 'ai-token-usage-configuration-container-widget'; }
|
|
30
|
-
static { this.LABEL = core_1.nls.localize('theia/ai/tokenUsage/label', 'Token Usage'); }
|
|
31
|
-
init() {
|
|
32
|
-
this.id = AITokenUsageConfigurationWidget_1.ID;
|
|
33
|
-
this.title.label = AITokenUsageConfigurationWidget_1.LABEL;
|
|
34
|
-
this.title.closable = false;
|
|
35
|
-
this.addClass('ai-configuration-widget');
|
|
36
|
-
this.loadItems().then(() => this.update());
|
|
37
|
-
this.toDispose.push(this.tokenUsageService.onTokenUsageUpdated(data => {
|
|
38
|
-
this.items = data.sort((a, b) => a.modelId.localeCompare(b.modelId));
|
|
39
|
-
this.update();
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
async loadItems() {
|
|
43
|
-
try {
|
|
44
|
-
this.items = (await this.tokenUsageService.getTokenUsageData()).sort((a, b) => a.modelId.localeCompare(b.modelId));
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
this.messageService.error(core_1.nls.localize('theia/ai/tokenUsage/failedToGetTokenUsageData', 'Failed to fetch token usage data: {0}', error));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
getItemId(item) {
|
|
51
|
-
return item.modelId;
|
|
52
|
-
}
|
|
53
|
-
formatNumber(num) {
|
|
54
|
-
return num.toLocaleString();
|
|
55
|
-
}
|
|
56
|
-
formatDate(date) {
|
|
57
|
-
if (!date) {
|
|
58
|
-
return core_1.nls.localizeByDefault('Never');
|
|
59
|
-
}
|
|
60
|
-
return (0, date_fns_1.formatDistanceToNow)(date, { addSuffix: true });
|
|
61
|
-
}
|
|
62
|
-
hasCacheData() {
|
|
63
|
-
return this.items.some(model => model.cachedInputTokens !== undefined ||
|
|
64
|
-
model.readCachedInputTokens !== undefined);
|
|
65
|
-
}
|
|
66
|
-
getColumns() {
|
|
67
|
-
const showCacheColumns = this.hasCacheData();
|
|
68
|
-
const columns = [
|
|
69
|
-
{
|
|
70
|
-
id: 'model',
|
|
71
|
-
label: core_1.nls.localizeByDefault('Model'),
|
|
72
|
-
className: 'token-usage-model-column',
|
|
73
|
-
renderCell: item => React.createElement("span", null, item.modelId)
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: 'input-tokens',
|
|
77
|
-
label: core_1.nls.localize('theia/ai/tokenUsage/inputTokens', 'Input Tokens'),
|
|
78
|
-
className: 'token-usage-column',
|
|
79
|
-
renderCell: item => React.createElement("span", null, this.formatNumber(item.inputTokens))
|
|
80
|
-
}
|
|
81
|
-
];
|
|
82
|
-
if (showCacheColumns) {
|
|
83
|
-
columns.push({
|
|
84
|
-
id: 'cached-input-tokens',
|
|
85
|
-
label: core_1.nls.localize('theia/ai/tokenUsage/cachedInputTokens', 'Input Tokens Written to Cache'),
|
|
86
|
-
className: 'token-usage-column',
|
|
87
|
-
renderCell: item => (React.createElement("span", { title: core_1.nls.localize('theia/ai/tokenUsage/cachedInputTokensTooltip', "Tracked additionally to 'Input Tokens'. Usually more expensive than non-cached tokens.") }, item.cachedInputTokens !== undefined ? this.formatNumber(item.cachedInputTokens) : '-'))
|
|
88
|
-
}, {
|
|
89
|
-
id: 'read-cached-input-tokens',
|
|
90
|
-
label: core_1.nls.localize('theia/ai/tokenUsage/readCachedInputTokens', 'Input Tokens Read From Cache'),
|
|
91
|
-
className: 'token-usage-column',
|
|
92
|
-
renderCell: item => (React.createElement("span", { title: core_1.nls.localize('theia/ai/tokenUsage/readCachedInputTokensTooltip', "Tracked additionally to 'Input Token'. Usually much less expensive than not cached. Usually does not count to rate limits.") }, item.readCachedInputTokens !== undefined ? this.formatNumber(item.readCachedInputTokens) : '-'))
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
columns.push({
|
|
96
|
-
id: 'output-tokens',
|
|
97
|
-
label: core_1.nls.localize('theia/ai/tokenUsage/outputTokens', 'Output Tokens'),
|
|
98
|
-
className: 'token-usage-column',
|
|
99
|
-
renderCell: item => React.createElement("span", null, this.formatNumber(item.outputTokens))
|
|
100
|
-
}, {
|
|
101
|
-
id: 'total-tokens',
|
|
102
|
-
label: core_1.nls.localizeByDefault('Total Tokens'),
|
|
103
|
-
className: 'token-usage-column',
|
|
104
|
-
renderCell: item => {
|
|
105
|
-
const totalTokens = item.inputTokens + item.outputTokens + (item.cachedInputTokens ?? 0);
|
|
106
|
-
return (React.createElement("span", { title: core_1.nls.localize('theia/ai/tokenUsage/totalTokensTooltip', "'Input Tokens' + 'Output Tokens'") }, this.formatNumber(totalTokens)));
|
|
107
|
-
}
|
|
108
|
-
}, {
|
|
109
|
-
id: 'last-used',
|
|
110
|
-
label: core_1.nls.localize('theia/ai/tokenUsage/lastUsed', 'Last Used'),
|
|
111
|
-
className: 'token-usage-column',
|
|
112
|
-
renderCell: item => {
|
|
113
|
-
const lastUsedDate = item.lastUsed ? new Date(item.lastUsed) : undefined;
|
|
114
|
-
const exactDateString = lastUsedDate ? lastUsedDate.toLocaleString() : '';
|
|
115
|
-
return React.createElement("span", { title: exactDateString }, this.formatDate(lastUsedDate));
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
return columns;
|
|
119
|
-
}
|
|
120
|
-
renderHeader() {
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
renderFooter() {
|
|
124
|
-
if (this.items.length === 0) {
|
|
125
|
-
return (React.createElement("div", { className: "ai-empty-state-content" },
|
|
126
|
-
React.createElement("p", null, core_1.nls.localize('theia/ai/tokenUsage/noData', 'No token usage data available yet.'))));
|
|
127
|
-
}
|
|
128
|
-
const showCacheColumns = this.hasCacheData();
|
|
129
|
-
const totalInputTokens = this.items.reduce((sum, model) => sum + model.inputTokens, 0);
|
|
130
|
-
const totalOutputTokens = this.items.reduce((sum, model) => sum + model.outputTokens, 0);
|
|
131
|
-
const totalCachedInputTokens = this.items.reduce((sum, model) => sum + (model.cachedInputTokens || 0), 0);
|
|
132
|
-
const totalReadCachedInputTokens = this.items.reduce((sum, model) => sum + (model.readCachedInputTokens || 0), 0);
|
|
133
|
-
const totalTokens = totalInputTokens + totalCachedInputTokens + totalOutputTokens;
|
|
134
|
-
return (React.createElement("div", { className: "ai-configuration-footer-total" },
|
|
135
|
-
React.createElement("table", { className: "ai-configuration-table" },
|
|
136
|
-
React.createElement("tfoot", null,
|
|
137
|
-
React.createElement("tr", { className: "ai-configuration-footer-total-row" },
|
|
138
|
-
React.createElement("td", { className: "token-usage-model-column" }, core_1.nls.localizeByDefault('Total')),
|
|
139
|
-
React.createElement("td", { className: "token-usage-column" }, this.formatNumber(totalInputTokens)),
|
|
140
|
-
showCacheColumns && (React.createElement(React.Fragment, null,
|
|
141
|
-
React.createElement("td", { className: "token-usage-column" }, this.formatNumber(totalCachedInputTokens)),
|
|
142
|
-
React.createElement("td", { className: "token-usage-column" }, this.formatNumber(totalReadCachedInputTokens)))),
|
|
143
|
-
React.createElement("td", { className: "token-usage-column" }, this.formatNumber(totalOutputTokens)),
|
|
144
|
-
React.createElement("td", { className: "token-usage-column" }, this.formatNumber(totalTokens)),
|
|
145
|
-
React.createElement("td", { className: "token-usage-column" })))),
|
|
146
|
-
React.createElement("div", { className: "ai-configuration-info-box" },
|
|
147
|
-
React.createElement("p", { className: "ai-configuration-info-text" },
|
|
148
|
-
React.createElement("i", { className: "codicon codicon-info ai-configuration-info-icon" }),
|
|
149
|
-
core_1.nls.localize('theia/ai/tokenUsage/note', 'Token usage is tracked since the start of the application and is not persisted.')))));
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
exports.AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget;
|
|
153
|
-
tslib_1.__decorate([
|
|
154
|
-
(0, inversify_1.inject)(core_1.MessageService),
|
|
155
|
-
tslib_1.__metadata("design:type", core_1.MessageService)
|
|
156
|
-
], AITokenUsageConfigurationWidget.prototype, "messageService", void 0);
|
|
157
|
-
tslib_1.__decorate([
|
|
158
|
-
(0, inversify_1.inject)(token_usage_frontend_service_1.TokenUsageFrontendService),
|
|
159
|
-
tslib_1.__metadata("design:type", Object)
|
|
160
|
-
], AITokenUsageConfigurationWidget.prototype, "tokenUsageService", void 0);
|
|
161
|
-
tslib_1.__decorate([
|
|
162
|
-
(0, inversify_1.postConstruct)(),
|
|
163
|
-
tslib_1.__metadata("design:type", Function),
|
|
164
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
165
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
166
|
-
], AITokenUsageConfigurationWidget.prototype, "init", null);
|
|
167
|
-
exports.AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget_1 = tslib_1.__decorate([
|
|
168
|
-
(0, inversify_1.injectable)()
|
|
169
|
-
], AITokenUsageConfigurationWidget);
|
|
170
|
-
//# sourceMappingURL=token-usage-configuration-widget.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-usage-configuration-widget.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/token-usage-configuration-widget.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;AAEhF,4DAAiF;AACjF,kDAAkD;AAClD,sCAAkD;AAClD,0GAAyH;AACzH,uCAA+C;AAC/C,wFAA+F;AAGxF,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,0DAA+C;;aAEhF,OAAE,GAAG,+CAA+C,AAAlD,CAAmD;aACrD,UAAK,GAAG,UAAG,CAAC,QAAQ,CAAC,2BAA2B,EAAE,aAAa,CAAC,AAA3D,CAA4D;IASvE,IAAI;QACV,IAAI,CAAC,EAAE,GAAG,iCAA+B,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,iCAA+B,CAAC,KAAK,C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AAG,SAAS,EAAC,iDAAiD,GAAK;oBAClE,UAAG,CAAC,QAAQ,CAAC,0BAA0B,EAAE,iFAAiF,CAAC,CAC5H,CACF,CACJ,CACT,CAAC;IACN,CAAC;;AA5LQ,0EAA+B;AAMrB;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACY,qBAAc;uEAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,wDAAyB,CAAC;;0EAC8B;AAGtD;IADT,IAAA,yBAAa,GAAE;;;;2DAef;0CA1BQ,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CA6L3C"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as React from '@theia/core/shared/react';
|
|
2
|
-
import { AiConfigurationService, ToolInvocationRegistry, ToolRequest } from '@theia/ai-core';
|
|
3
|
-
import { ToolConfirmationManager } from '@theia/ai-chat/lib/browser/chat-tool-preference-bindings';
|
|
4
|
-
import { ShellCommandPermissionService } from '@theia/ai-terminal/lib/browser/shell-command-permission-service';
|
|
5
|
-
import { ToolConfirmationMode } from '@theia/ai-chat/lib/common/chat-tool-preferences';
|
|
6
|
-
import { AITableConfigurationWidget, TableColumn } from './base/ai-table-configuration-widget';
|
|
7
|
-
interface ToolItem {
|
|
8
|
-
name: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class AIToolsConfigurationWidget extends AITableConfigurationWidget<ToolItem> {
|
|
11
|
-
static readonly ID = "ai-tools-configuration-widget";
|
|
12
|
-
static readonly LABEL: string;
|
|
13
|
-
protected readonly confirmationManager: ToolConfirmationManager;
|
|
14
|
-
protected readonly aiConfigurationService: AiConfigurationService;
|
|
15
|
-
protected readonly toolInvocationRegistry: ToolInvocationRegistry;
|
|
16
|
-
protected readonly shellCommandPermissionService: ShellCommandPermissionService;
|
|
17
|
-
protected toolConfirmationModes: Record<string, ToolConfirmationMode>;
|
|
18
|
-
protected defaultState: ToolConfirmationMode;
|
|
19
|
-
protected allowlistPatterns: string[];
|
|
20
|
-
protected allowlistInputRef: React.RefObject<HTMLInputElement>;
|
|
21
|
-
protected allowlistError: string | undefined;
|
|
22
|
-
protected denylistPatterns: string[];
|
|
23
|
-
protected denylistInputRef: React.RefObject<HTMLInputElement>;
|
|
24
|
-
protected denylistError: string | undefined;
|
|
25
|
-
protected init(): void;
|
|
26
|
-
protected loadData(): Promise<void>;
|
|
27
|
-
protected loadItems(): Promise<void>;
|
|
28
|
-
protected getItemId(item: ToolItem): string;
|
|
29
|
-
protected loadDefaultConfirmation(): Promise<ToolConfirmationMode>;
|
|
30
|
-
protected loadToolConfigurationModes(): Promise<Record<string, ToolConfirmationMode>>;
|
|
31
|
-
protected updateToolConfirmationMode(tool: string, state: ToolConfirmationMode, toolRequest?: ToolRequest): Promise<void>;
|
|
32
|
-
protected updateDefaultConfirmation(state: ToolConfirmationMode): Promise<void>;
|
|
33
|
-
protected handleToolConfirmationModeChange: (toolName: string, event: React.ChangeEvent<HTMLSelectElement>) => Promise<void>;
|
|
34
|
-
protected showConfirmAlwaysAllowDialog(toolName: string, toolRequest: ToolRequest): Promise<boolean>;
|
|
35
|
-
protected handleDefaultStateChange: (event: React.ChangeEvent<HTMLSelectElement>) => Promise<void>;
|
|
36
|
-
protected resetAllToolsToDefault(): Promise<void>;
|
|
37
|
-
protected renderHeader(): React.ReactNode;
|
|
38
|
-
protected renderRecommendedDefaultsBanner(): React.ReactNode;
|
|
39
|
-
protected allowCurrentTools(): Promise<void>;
|
|
40
|
-
protected buildAllowCurrentToolsMessage(): HTMLElement;
|
|
41
|
-
protected getEffectiveState(toolName: string): ToolConfirmationMode;
|
|
42
|
-
protected getColumns(): TableColumn<ToolItem>[];
|
|
43
|
-
protected getRowClassName(item: ToolItem): string;
|
|
44
|
-
protected handleAddAllowlistPattern(): void;
|
|
45
|
-
protected handleRemoveAllowlistPattern(pattern: string): void;
|
|
46
|
-
protected handleAddDenylistPattern(): void;
|
|
47
|
-
protected handleRemoveDenylistPattern(pattern: string): void;
|
|
48
|
-
protected handleAddPatternToList(inputRef: React.RefObject<HTMLInputElement | null>, addFn: (pattern: string) => Promise<void>, getFn: () => string[], setPatterns: (patterns: string[]) => void, setError: (error: string | undefined) => void): void;
|
|
49
|
-
protected renderFooter(): React.ReactNode;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=tools-configuration-widget.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/tools-configuration-widget.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iEAAiE,CAAC;AAChH,OAAO,EAGH,oBAAoB,EACvB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAQ/F,UAAU,QAAQ;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBACa,0BAA2B,SAAQ,0BAA0B,CAAC,QAAQ,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,EAAE,mCAAmC;IACrD,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAkC;IAGvD,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;IAGhE,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGlE,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGlE,SAAS,CAAC,QAAQ,CAAC,6BAA6B,EAAE,6BAA6B,CAAC;IAEhF,SAAS,CAAC,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CA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AAC,SAAS;IA8BlD,SAAS,CAAC,+BAA+B,IAAI,KAAK,CAAC,SAAS;cAwB5C,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BlD,SAAS,CAAC,6BAA6B,IAAI,WAAW;IAgCtD,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB;IAcnE,SAAS,CAAC,UAAU,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE;cAgC5B,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM;IAM1D,SAAS,CAAC,yBAAyB,IAAI,IAAI;IAU3C,SAAS,CAAC,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK7D,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAU1C,SAAS,CAAC,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5D,SAAS,CAAC,sBAAsB,CAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAClD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACzC,KAAK,EAAE,MAAM,MAAM,EAAE,EACrB,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,EACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,GAC9C,IAAI;cA2BY,YAAY,IAAI,KAAK,CAAC,SAAS;CAkHrD"}
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var AIToolsConfigurationWidget_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.AIToolsConfigurationWidget = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
-
const React = require("@theia/core/shared/react");
|
|
24
|
-
const ai_core_1 = require("@theia/ai-core");
|
|
25
|
-
const core_1 = require("@theia/core");
|
|
26
|
-
const chat_tool_preference_bindings_1 = require("@theia/ai-chat/lib/browser/chat-tool-preference-bindings");
|
|
27
|
-
const shell_command_permission_service_1 = require("@theia/ai-terminal/lib/browser/shell-command-permission-service");
|
|
28
|
-
const chat_tool_preferences_1 = require("@theia/ai-chat/lib/common/chat-tool-preferences");
|
|
29
|
-
const shell_command_preferences_1 = require("@theia/ai-terminal/lib/common/shell-command-preferences");
|
|
30
|
-
const ai_table_configuration_widget_1 = require("./base/ai-table-configuration-widget");
|
|
31
|
-
const TOOL_OPTIONS = [
|
|
32
|
-
{ value: chat_tool_preferences_1.ToolConfirmationMode.DISABLED, label: core_1.nls.localizeByDefault('Disabled'), icon: 'close' },
|
|
33
|
-
{ value: chat_tool_preferences_1.ToolConfirmationMode.CONFIRM, label: core_1.nls.localize('theia/ai/ide/toolsConfiguration/toolOptions/confirm/label', 'Confirm'), icon: 'question' },
|
|
34
|
-
{ value: chat_tool_preferences_1.ToolConfirmationMode.ALWAYS_ALLOW, label: core_1.nls.localizeByDefault('Always Allow'), icon: 'thumbsup' },
|
|
35
|
-
];
|
|
36
|
-
let AIToolsConfigurationWidget = class AIToolsConfigurationWidget extends ai_table_configuration_widget_1.AITableConfigurationWidget {
|
|
37
|
-
constructor() {
|
|
38
|
-
super(...arguments);
|
|
39
|
-
this.toolConfirmationModes = {};
|
|
40
|
-
this.allowlistPatterns = [];
|
|
41
|
-
this.allowlistInputRef = React.createRef();
|
|
42
|
-
this.denylistPatterns = [];
|
|
43
|
-
this.denylistInputRef = React.createRef();
|
|
44
|
-
this.handleToolConfirmationModeChange = async (toolName, event) => {
|
|
45
|
-
const newState = event.target.value;
|
|
46
|
-
const toolRequest = this.toolInvocationRegistry.getFunction(toolName);
|
|
47
|
-
// Check if we need extra confirmation for ALWAYS_ALLOW on confirmAlwaysAllow tools
|
|
48
|
-
if (newState === chat_tool_preferences_1.ToolConfirmationMode.ALWAYS_ALLOW) {
|
|
49
|
-
if (toolRequest?.confirmAlwaysAllow) {
|
|
50
|
-
const confirmed = await this.showConfirmAlwaysAllowDialog(toolName, toolRequest);
|
|
51
|
-
if (!confirmed) {
|
|
52
|
-
// Revert selection by triggering a re-render
|
|
53
|
-
this.update();
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
await this.updateToolConfirmationMode(toolName, newState, toolRequest);
|
|
59
|
-
// Reload from preferences to ensure consistency (setConfirmationMode may remove entries that match default)
|
|
60
|
-
this.toolConfirmationModes = await this.loadToolConfigurationModes();
|
|
61
|
-
this.update();
|
|
62
|
-
};
|
|
63
|
-
this.handleDefaultStateChange = async (event) => {
|
|
64
|
-
const newState = event.target.value;
|
|
65
|
-
await this.updateDefaultConfirmation(newState);
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
static { AIToolsConfigurationWidget_1 = this; }
|
|
69
|
-
static { this.ID = 'ai-tools-configuration-widget'; }
|
|
70
|
-
static { this.LABEL = core_1.nls.localizeByDefault('Tools'); }
|
|
71
|
-
init() {
|
|
72
|
-
this.id = AIToolsConfigurationWidget_1.ID;
|
|
73
|
-
this.title.label = AIToolsConfigurationWidget_1.LABEL;
|
|
74
|
-
this.title.closable = false;
|
|
75
|
-
this.addClass('ai-configuration-widget');
|
|
76
|
-
this.loadData().then(() => this.update());
|
|
77
|
-
this.toDispose.pushAll([
|
|
78
|
-
this.aiConfigurationService.onDidChange(async (e) => {
|
|
79
|
-
if (e.affectsPreference(chat_tool_preferences_1.TOOL_CONFIRMATION_PREFERENCE)
|
|
80
|
-
|| e.affectsPreference(chat_tool_preferences_1.DEFAULT_TOOL_CONFIRMATION_PREFERENCE)) {
|
|
81
|
-
this.defaultState = await this.loadDefaultConfirmation();
|
|
82
|
-
this.toolConfirmationModes = await this.loadToolConfigurationModes();
|
|
83
|
-
this.update();
|
|
84
|
-
}
|
|
85
|
-
if (e.affectsPreference(shell_command_preferences_1.SHELL_COMMAND_ALLOWLIST_PREFERENCE)) {
|
|
86
|
-
this.allowlistPatterns = this.shellCommandPermissionService.getAllowlistPatterns();
|
|
87
|
-
this.update();
|
|
88
|
-
}
|
|
89
|
-
if (e.affectsPreference(shell_command_preferences_1.SHELL_COMMAND_DENYLIST_PREFERENCE)) {
|
|
90
|
-
this.denylistPatterns = this.shellCommandPermissionService.getDenylistPatterns();
|
|
91
|
-
this.update();
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
this.toolInvocationRegistry.onDidChange(async () => {
|
|
95
|
-
await this.loadItems();
|
|
96
|
-
this.update();
|
|
97
|
-
})
|
|
98
|
-
]);
|
|
99
|
-
}
|
|
100
|
-
async loadData() {
|
|
101
|
-
await this.aiConfigurationService.ready;
|
|
102
|
-
await this.loadItems();
|
|
103
|
-
this.defaultState = await this.loadDefaultConfirmation();
|
|
104
|
-
this.toolConfirmationModes = await this.loadToolConfigurationModes();
|
|
105
|
-
this.allowlistPatterns = this.shellCommandPermissionService.getAllowlistPatterns();
|
|
106
|
-
this.denylistPatterns = this.shellCommandPermissionService.getDenylistPatterns();
|
|
107
|
-
}
|
|
108
|
-
async loadItems() {
|
|
109
|
-
const toolNames = this.toolInvocationRegistry.getAllFunctions()
|
|
110
|
-
.map(func => func.name)
|
|
111
|
-
.sort((a, b) => {
|
|
112
|
-
const aIsMcp = a.startsWith('mcp_');
|
|
113
|
-
const bIsMcp = b.startsWith('mcp_');
|
|
114
|
-
if (aIsMcp !== bIsMcp) {
|
|
115
|
-
// Place names starting with "mcp_" after non-mcp names
|
|
116
|
-
return aIsMcp ? 1 : -1;
|
|
117
|
-
}
|
|
118
|
-
return a.localeCompare(b);
|
|
119
|
-
});
|
|
120
|
-
this.items = toolNames.map(name => ({ name }));
|
|
121
|
-
}
|
|
122
|
-
getItemId(item) {
|
|
123
|
-
return item.name;
|
|
124
|
-
}
|
|
125
|
-
async loadDefaultConfirmation() {
|
|
126
|
-
return this.confirmationManager.getDefaultConfirmationMode();
|
|
127
|
-
}
|
|
128
|
-
async loadToolConfigurationModes() {
|
|
129
|
-
return this.confirmationManager.getAllConfirmationSettings();
|
|
130
|
-
}
|
|
131
|
-
async updateToolConfirmationMode(tool, state, toolRequest) {
|
|
132
|
-
await this.confirmationManager.setConfirmationMode(tool, state, toolRequest);
|
|
133
|
-
}
|
|
134
|
-
async updateDefaultConfirmation(state) {
|
|
135
|
-
await this.confirmationManager.setDefaultConfirmationMode(state);
|
|
136
|
-
}
|
|
137
|
-
async showConfirmAlwaysAllowDialog(toolName, toolRequest) {
|
|
138
|
-
const warningMessage = typeof toolRequest.confirmAlwaysAllow === 'string'
|
|
139
|
-
? toolRequest.confirmAlwaysAllow
|
|
140
|
-
: core_1.nls.localize('theia/ai/ide/toolsConfiguration/confirmAlwaysAllow/genericWarning', 'This tool requires confirmation before auto-approval can be enabled. ' +
|
|
141
|
-
'Once enabled, all future invocations will execute without confirmation. ' +
|
|
142
|
-
'Only enable this if you trust this tool and understand the potential risks.');
|
|
143
|
-
const dialog = new browser_1.ConfirmDialog({
|
|
144
|
-
title: core_1.nls.localize('theia/ai/ide/toolsConfiguration/confirmAlwaysAllow/title', 'Enable Auto-Approval for "{0}"?', toolName),
|
|
145
|
-
msg: warningMessage,
|
|
146
|
-
ok: core_1.nls.localize('theia/ai/ide/toolsConfiguration/confirmAlwaysAllow/confirm', 'I understand, enable auto-approval'),
|
|
147
|
-
cancel: core_1.nls.localizeByDefault('Cancel')
|
|
148
|
-
});
|
|
149
|
-
return !!await dialog.open();
|
|
150
|
-
}
|
|
151
|
-
async resetAllToolsToDefault() {
|
|
152
|
-
const dialog = new browser_1.ConfirmDialog({
|
|
153
|
-
title: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAllConfirmDialog/title', 'Reset All Tool Confirmation Modes'),
|
|
154
|
-
msg: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAllConfirmDialog/msg', 'Are you sure you want to reset all tool confirmation modes to the default? This will remove all custom settings.'),
|
|
155
|
-
ok: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAll', 'Reset All'),
|
|
156
|
-
cancel: core_1.nls.localizeByDefault('Cancel')
|
|
157
|
-
});
|
|
158
|
-
const shouldReset = await dialog.open();
|
|
159
|
-
if (shouldReset) {
|
|
160
|
-
await this.confirmationManager.resetAllConfirmationModeSettings();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
renderHeader() {
|
|
164
|
-
return (React.createElement(React.Fragment, null,
|
|
165
|
-
React.createElement("div", { className: "ai-tools-configuration-header" },
|
|
166
|
-
React.createElement("div", { style: { fontWeight: 500 } }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/default/label', 'Default Tool Confirmation Mode:')),
|
|
167
|
-
React.createElement("select", { className: "theia-select", value: this.defaultState, onChange: this.handleDefaultStateChange }, TOOL_OPTIONS.map(opt => (React.createElement("option", { key: opt.value, value: opt.value }, opt.label)))),
|
|
168
|
-
React.createElement("button", { className: 'theia-button secondary ai-tools-reset-button', style: { marginLeft: 'auto' }, title: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAllTooltip', 'Reset all tools to default'), onClick: () => this.resetAllToolsToDefault() }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAll', 'Reset All'))),
|
|
169
|
-
this.renderRecommendedDefaultsBanner()));
|
|
170
|
-
}
|
|
171
|
-
renderRecommendedDefaultsBanner() {
|
|
172
|
-
if (this.defaultState !== chat_tool_preferences_1.ToolConfirmationMode.CONFIRM) {
|
|
173
|
-
return undefined;
|
|
174
|
-
}
|
|
175
|
-
return (React.createElement("div", { className: "ai-tools-recommended-defaults-banner" },
|
|
176
|
-
React.createElement("span", { className: "ai-tools-recommended-defaults-text" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/message', 'Tool calls currently require approval. Auto-allow all built-in tools at once.' +
|
|
177
|
-
' Tools that require extra confirmation (e.g. shell execution), MCP tools,' +
|
|
178
|
-
' and any tools added later will still ask before running.')),
|
|
179
|
-
React.createElement("button", { className: 'theia-button main', onClick: () => this.allowCurrentTools() }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/apply', 'Allow Default Tools'))));
|
|
180
|
-
}
|
|
181
|
-
async allowCurrentTools() {
|
|
182
|
-
const dialog = new browser_1.ConfirmDialog({
|
|
183
|
-
title: core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/dialogTitle', 'Allow Default Tools?'),
|
|
184
|
-
msg: this.buildAllowCurrentToolsMessage(),
|
|
185
|
-
ok: core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/dialogConfirm', 'I understand, allow'),
|
|
186
|
-
cancel: core_1.nls.localizeByDefault('Cancel')
|
|
187
|
-
});
|
|
188
|
-
const confirmed = await dialog.open();
|
|
189
|
-
if (!confirmed) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
// Leave the global default at CONFIRM so any tool added later still requires confirmation.
|
|
193
|
-
// Skip tools that require extra consent (confirmAlwaysAllow), MCP tools (third-party code
|
|
194
|
-
// that should require informed per-tool consent), and tools the user has explicitly disabled.
|
|
195
|
-
const updates = [];
|
|
196
|
-
for (const tool of this.toolInvocationRegistry.getAllFunctions()) {
|
|
197
|
-
if (tool.confirmAlwaysAllow) {
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
if (tool.name.startsWith('mcp_')) {
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
if (this.toolConfirmationModes[tool.name] === chat_tool_preferences_1.ToolConfirmationMode.DISABLED) {
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
updates.push({ toolId: tool.name, mode: chat_tool_preferences_1.ToolConfirmationMode.ALWAYS_ALLOW, toolRequest: tool });
|
|
207
|
-
}
|
|
208
|
-
await this.confirmationManager.setConfirmationModes(updates);
|
|
209
|
-
}
|
|
210
|
-
buildAllowCurrentToolsMessage() {
|
|
211
|
-
const container = document.createElement('div');
|
|
212
|
-
const lines = [
|
|
213
|
-
core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line1', 'This sets all currently registered built-in tools to "Always Allow".'),
|
|
214
|
-
core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line2', 'Tools that require extra confirmation (such as shell execution) will still ask before running.'),
|
|
215
|
-
core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line3', 'MCP tools are third-party and are not included. You can allow them individually in this view.'),
|
|
216
|
-
core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line4', 'Tools added later will still default to "Confirm" so you can review them.'),
|
|
217
|
-
core_1.nls.localize('theia/ai/ide/toolsConfiguration/recommendedDefaults/msg/line5', 'You can change this later in this view.')
|
|
218
|
-
];
|
|
219
|
-
for (const line of lines) {
|
|
220
|
-
const p = document.createElement('p');
|
|
221
|
-
p.textContent = line;
|
|
222
|
-
container.appendChild(p);
|
|
223
|
-
}
|
|
224
|
-
return container;
|
|
225
|
-
}
|
|
226
|
-
getEffectiveState(toolName) {
|
|
227
|
-
// If there's an explicit setting for this tool, use it
|
|
228
|
-
const explicitSetting = this.toolConfirmationModes[toolName];
|
|
229
|
-
if (explicitSetting !== undefined) {
|
|
230
|
-
return explicitSetting;
|
|
231
|
-
}
|
|
232
|
-
// Otherwise, apply confirmAlwaysAllow logic to the default
|
|
233
|
-
const toolRequest = this.toolInvocationRegistry.getFunction(toolName);
|
|
234
|
-
if (toolRequest?.confirmAlwaysAllow && this.defaultState === chat_tool_preferences_1.ToolConfirmationMode.ALWAYS_ALLOW) {
|
|
235
|
-
return chat_tool_preferences_1.ToolConfirmationMode.CONFIRM;
|
|
236
|
-
}
|
|
237
|
-
return this.defaultState;
|
|
238
|
-
}
|
|
239
|
-
getColumns() {
|
|
240
|
-
return [
|
|
241
|
-
{
|
|
242
|
-
id: 'tool-name',
|
|
243
|
-
label: core_1.nls.localizeByDefault('Tool'),
|
|
244
|
-
className: 'tool-name-column',
|
|
245
|
-
renderCell: (item) => React.createElement("span", null, item.name)
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
id: 'confirmation-mode',
|
|
249
|
-
label: core_1.nls.localize('theia/ai/ide/toolsConfiguration/confirmationMode/label', 'Confirmation Mode'),
|
|
250
|
-
className: 'confirmation-mode-column',
|
|
251
|
-
renderCell: (item) => {
|
|
252
|
-
const effectiveState = this.getEffectiveState(item.name);
|
|
253
|
-
return (React.createElement("select", { className: "theia-select", value: effectiveState, onChange: e => this.handleToolConfirmationModeChange(item.name, e) }, TOOL_OPTIONS.map(opt => (React.createElement("option", { key: opt.value, value: opt.value }, opt.label)))));
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
];
|
|
257
|
-
}
|
|
258
|
-
getRowClassName(item) {
|
|
259
|
-
const effectiveState = this.getEffectiveState(item.name);
|
|
260
|
-
const isDefault = effectiveState === this.defaultState;
|
|
261
|
-
return isDefault ? 'default-mode' : 'custom-mode';
|
|
262
|
-
}
|
|
263
|
-
handleAddAllowlistPattern() {
|
|
264
|
-
this.handleAddPatternToList(this.allowlistInputRef, pattern => this.shellCommandPermissionService.addAllowlistPatterns(pattern), () => this.shellCommandPermissionService.getAllowlistPatterns(), patterns => { this.allowlistPatterns = patterns; }, error => { this.allowlistError = error; });
|
|
265
|
-
}
|
|
266
|
-
handleRemoveAllowlistPattern(pattern) {
|
|
267
|
-
this.shellCommandPermissionService.removeAllowlistPattern(pattern)
|
|
268
|
-
.catch(error => console.error('Failed to remove allowlist pattern:', error));
|
|
269
|
-
}
|
|
270
|
-
handleAddDenylistPattern() {
|
|
271
|
-
this.handleAddPatternToList(this.denylistInputRef, pattern => this.shellCommandPermissionService.addDenylistPatterns(pattern), () => this.shellCommandPermissionService.getDenylistPatterns(), patterns => { this.denylistPatterns = patterns; }, error => { this.denylistError = error; });
|
|
272
|
-
}
|
|
273
|
-
handleRemoveDenylistPattern(pattern) {
|
|
274
|
-
this.shellCommandPermissionService.removeDenylistPattern(pattern)
|
|
275
|
-
.catch(error => console.error('Failed to remove denylist pattern:', error));
|
|
276
|
-
}
|
|
277
|
-
handleAddPatternToList(inputRef, addFn, getFn, setPatterns, setError) {
|
|
278
|
-
const input = inputRef.current;
|
|
279
|
-
if (!input) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
const trimmed = input.value.trim();
|
|
283
|
-
if (trimmed.length === 0) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
try {
|
|
287
|
-
// Validation throws synchronously; a failed write rejects the returned promise.
|
|
288
|
-
addFn(trimmed).catch(error => {
|
|
289
|
-
setError(error instanceof Error ? error.message : 'Failed to save pattern');
|
|
290
|
-
this.update();
|
|
291
|
-
});
|
|
292
|
-
input.value = '';
|
|
293
|
-
setError(undefined);
|
|
294
|
-
setPatterns(getFn());
|
|
295
|
-
this.update();
|
|
296
|
-
}
|
|
297
|
-
catch (error) {
|
|
298
|
-
setError(error instanceof Error ? error.message : 'Invalid pattern');
|
|
299
|
-
this.update();
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
renderFooter() {
|
|
303
|
-
return (React.createElement(React.Fragment, null,
|
|
304
|
-
React.createElement("div", { className: "ai-shell-permission-list-section" },
|
|
305
|
-
React.createElement("div", { className: "settings-section-title settings-section-category-title" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/shellAllowlist/title', 'Shell Execute Allowlist')),
|
|
306
|
-
React.createElement("p", { className: "ai-shell-permission-list-description" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/shellAllowlist/description', 'Commands matching these patterns will be automatically allowed without confirmation. ' +
|
|
307
|
-
'Use * as wildcard: "git log" (exact match), "git log *" (with any arguments). ' +
|
|
308
|
-
'Wildcard must be preceded by a space.')),
|
|
309
|
-
React.createElement("div", { className: "ai-shell-permission-list-input-row" },
|
|
310
|
-
React.createElement("input", { ref: this.allowlistInputRef, type: "text", className: "theia-input", placeholder: core_1.nls.localize('theia/ai/ide/shellAllowlist/placeholder', 'e.g., "git log" (exact) or "git log *" (with args)'), onKeyDown: e => e.key === 'Enter' && this.handleAddAllowlistPattern() }),
|
|
311
|
-
React.createElement("button", { className: "theia-button main", onClick: () => this.handleAddAllowlistPattern() }, core_1.nls.localizeByDefault('Add'))),
|
|
312
|
-
this.allowlistError && (React.createElement("p", { className: "ai-shell-permission-list-error" }, this.allowlistError)),
|
|
313
|
-
React.createElement("ul", { className: "ai-shell-permission-list-patterns" }, [...this.allowlistPatterns].sort((a, b) => a.localeCompare(b)).map(pattern => (React.createElement("li", { key: pattern, className: "ai-shell-permission-list-pattern-item" },
|
|
314
|
-
React.createElement("code", null, pattern),
|
|
315
|
-
React.createElement("button", { className: "theia-button secondary", onClick: () => this.handleRemoveAllowlistPattern(pattern) }, core_1.nls.localizeByDefault('Remove')))))),
|
|
316
|
-
this.allowlistPatterns.length === 0 && (React.createElement("p", { className: "ai-shell-permission-list-empty" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/shellAllowlist/empty', 'No patterns configured. All shell commands will require confirmation.')))),
|
|
317
|
-
React.createElement("div", { className: "ai-shell-permission-list-section" },
|
|
318
|
-
React.createElement("div", { className: "settings-section-title settings-section-category-title" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/shellDenylist/title', 'Shell Execute Denylist')),
|
|
319
|
-
React.createElement("p", { className: "ai-shell-permission-list-description" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/shellDenylist/description', 'Commands matching these patterns will be automatically denied without confirmation. ' +
|
|
320
|
-
"Use this to block dangerous commands like 'git push *' or 'rm -rf /'.")),
|
|
321
|
-
React.createElement("div", { className: "ai-shell-permission-list-input-row" },
|
|
322
|
-
React.createElement("input", { ref: this.denylistInputRef, type: "text", className: "theia-input", placeholder: core_1.nls.localize('theia/ai/ide/shellDenylist/placeholder', 'e.g., "git push *" or "rm -rf /"'), onKeyDown: e => e.key === 'Enter' && this.handleAddDenylistPattern() }),
|
|
323
|
-
React.createElement("button", { className: "theia-button main", onClick: () => this.handleAddDenylistPattern() }, core_1.nls.localizeByDefault('Add'))),
|
|
324
|
-
this.denylistError && (React.createElement("p", { className: "ai-shell-permission-list-error" }, this.denylistError)),
|
|
325
|
-
React.createElement("ul", { className: "ai-shell-permission-list-patterns" }, [...this.denylistPatterns].sort((a, b) => a.localeCompare(b)).map(pattern => (React.createElement("li", { key: pattern, className: "ai-shell-permission-list-pattern-item" },
|
|
326
|
-
React.createElement("code", null, pattern),
|
|
327
|
-
React.createElement("button", { className: "theia-button secondary", onClick: () => this.handleRemoveDenylistPattern(pattern) }, core_1.nls.localizeByDefault('Remove')))))),
|
|
328
|
-
this.denylistPatterns.length === 0 && (React.createElement("p", { className: "ai-shell-permission-list-empty" }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/shellDenylist/empty', 'No patterns configured. No shell commands will be automatically denied.'))))));
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
exports.AIToolsConfigurationWidget = AIToolsConfigurationWidget;
|
|
332
|
-
tslib_1.__decorate([
|
|
333
|
-
(0, inversify_1.inject)(chat_tool_preference_bindings_1.ToolConfirmationManager),
|
|
334
|
-
tslib_1.__metadata("design:type", chat_tool_preference_bindings_1.ToolConfirmationManager)
|
|
335
|
-
], AIToolsConfigurationWidget.prototype, "confirmationManager", void 0);
|
|
336
|
-
tslib_1.__decorate([
|
|
337
|
-
(0, inversify_1.inject)(ai_core_1.AiConfigurationService),
|
|
338
|
-
tslib_1.__metadata("design:type", Object)
|
|
339
|
-
], AIToolsConfigurationWidget.prototype, "aiConfigurationService", void 0);
|
|
340
|
-
tslib_1.__decorate([
|
|
341
|
-
(0, inversify_1.inject)(ai_core_1.ToolInvocationRegistry),
|
|
342
|
-
tslib_1.__metadata("design:type", Object)
|
|
343
|
-
], AIToolsConfigurationWidget.prototype, "toolInvocationRegistry", void 0);
|
|
344
|
-
tslib_1.__decorate([
|
|
345
|
-
(0, inversify_1.inject)(shell_command_permission_service_1.ShellCommandPermissionService),
|
|
346
|
-
tslib_1.__metadata("design:type", shell_command_permission_service_1.ShellCommandPermissionService)
|
|
347
|
-
], AIToolsConfigurationWidget.prototype, "shellCommandPermissionService", void 0);
|
|
348
|
-
tslib_1.__decorate([
|
|
349
|
-
(0, inversify_1.postConstruct)(),
|
|
350
|
-
tslib_1.__metadata("design:type", Function),
|
|
351
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
352
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
353
|
-
], AIToolsConfigurationWidget.prototype, "init", null);
|
|
354
|
-
exports.AIToolsConfigurationWidget = AIToolsConfigurationWidget = AIToolsConfigurationWidget_1 = tslib_1.__decorate([
|
|
355
|
-
(0, inversify_1.injectable)()
|
|
356
|
-
], AIToolsConfigurationWidget);
|
|
357
|
-
//# sourceMappingURL=tools-configuration-widget.js.map
|