@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
package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
+
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
20
|
+
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
21
|
+
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
22
|
+
const chai_1 = require("chai");
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
24
|
+
const ai_configuration_category_1 = require("@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category");
|
|
25
|
+
const prompts_and_skills_configuration_category_1 = require("./prompts-and-skills-configuration-category");
|
|
26
|
+
disableJSDOM();
|
|
27
|
+
describe('PromptsAndSkillsConfigurationCategory', () => {
|
|
28
|
+
before(() => disableJSDOM = (0, jsdom_1.enableJSDOM)());
|
|
29
|
+
after(() => disableJSDOM());
|
|
30
|
+
function categoryWith(skills, slashCommands) {
|
|
31
|
+
const category = new prompts_and_skills_configuration_category_1.PromptsAndSkillsConfigurationCategory();
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
category.skills = skills;
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
category.slashCommands = slashCommands;
|
|
36
|
+
return category;
|
|
37
|
+
}
|
|
38
|
+
/** Leaves the bridge unbound when `installedPlugins` is omitted, i.e. a product without `@theia/ai-registry`. */
|
|
39
|
+
function categoryWithPlugins(skills, installedPlugins, revealed = []) {
|
|
40
|
+
const category = categoryWith(skills, []);
|
|
41
|
+
if (installedPlugins) {
|
|
42
|
+
const bridge = {
|
|
43
|
+
getPlugin: pluginId => installedPlugins.find(plugin => plugin.pluginId === pluginId),
|
|
44
|
+
getPluginByQualifier: qualifier => installedPlugins.find(plugin => plugin.qualifier === qualifier),
|
|
45
|
+
revealPlugin: pluginId => { revealed.push(pluginId); },
|
|
46
|
+
onDidChange: core_1.Event.None
|
|
47
|
+
};
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
category.agentPluginUiBridge = bridge;
|
|
50
|
+
}
|
|
51
|
+
return category;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Leaves the bridge unbound when `managed` is omitted. `managed` maps a skill location to the
|
|
55
|
+
* registry entry it was installed from, which is how the real bridge keys them.
|
|
56
|
+
*/
|
|
57
|
+
function categoryWithRegistrySkills(skills, managed, revealed = []) {
|
|
58
|
+
const category = categoryWith(skills, []);
|
|
59
|
+
if (managed) {
|
|
60
|
+
const bridge = {
|
|
61
|
+
getRegistryEntryId: forSkill => managed[forSkill.location],
|
|
62
|
+
revealSkill: skillId => { revealed.push(skillId); },
|
|
63
|
+
onDidChange: core_1.Event.None
|
|
64
|
+
};
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
+
category.skillRegistryUiBridge = bridge;
|
|
67
|
+
}
|
|
68
|
+
return category;
|
|
69
|
+
}
|
|
70
|
+
function skillRow(category, forSkill) {
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
return category.buildSkillRow(forSkill);
|
|
73
|
+
}
|
|
74
|
+
function skill(overrides) {
|
|
75
|
+
return { name: 'query-builder', qualifiedName: 'query-builder', description: 'Build SQL', location: '/skills/query-builder/SKILL.md', ...overrides };
|
|
76
|
+
}
|
|
77
|
+
it('declares the skills and slash commands single-page metadata', () => {
|
|
78
|
+
const category = new prompts_and_skills_configuration_category_1.PromptsAndSkillsConfigurationCategory();
|
|
79
|
+
(0, chai_1.expect)(category.id).to.equal(ai_configuration_category_1.AiConfigurationCategoryId.PROMPTS_AND_SKILLS);
|
|
80
|
+
(0, chai_1.expect)(category.kind).to.equal('single-page');
|
|
81
|
+
});
|
|
82
|
+
it('indexes skills and slash commands for search, highlighting their rows', () => {
|
|
83
|
+
const category = categoryWith([{ name: 'refactor', qualifiedName: 'refactor', description: 'do it', location: '/s' }], [{ id: 'cmd', commandName: 'go', commandDescription: 'run' }]);
|
|
84
|
+
const items = category.getSearchItems();
|
|
85
|
+
const byType = (typeIncludes) => items.filter(i => i.typeLabel.toLowerCase().includes(typeIncludes));
|
|
86
|
+
(0, chai_1.expect)(byType('skill')).to.have.lengthOf(1);
|
|
87
|
+
(0, chai_1.expect)(byType('slash')).to.have.lengthOf(1);
|
|
88
|
+
(0, chai_1.expect)(items.find(i => i.label === 'refactor')?.target.highlight?.rowId).to.equal('skill:refactor');
|
|
89
|
+
(0, chai_1.expect)(items.find(i => i.label === '/go')?.target.highlight?.rowId).to.equal('cmd:cmd');
|
|
90
|
+
(0, chai_1.expect)(items.every(i => i.target.categoryId === ai_configuration_category_1.AiConfigurationCategoryId.PROMPTS_AND_SKILLS)).to.equal(true);
|
|
91
|
+
});
|
|
92
|
+
it('does not list skill-backed synthetic commands as slash commands', () => {
|
|
93
|
+
const category = new prompts_and_skills_configuration_category_1.PromptsAndSkillsConfigurationCategory();
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95
|
+
category.promptService = {
|
|
96
|
+
getCommands: () => [
|
|
97
|
+
{ id: 'skill-command-refactor', commandName: 'refactor', isCommand: true },
|
|
98
|
+
{ id: 'remember', commandName: 'remember', isCommand: true }
|
|
99
|
+
]
|
|
100
|
+
};
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
category.loadSlashCommands();
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
|
+
const commands = category.slashCommands;
|
|
105
|
+
(0, chai_1.expect)(commands.map(command => command.id)).to.deep.equal(['remember']);
|
|
106
|
+
});
|
|
107
|
+
describe('Agent Plugin provenance', () => {
|
|
108
|
+
const bigquery = { pluginId: 'io.example/bq', name: 'BigQuery Data Analytics', qualifier: 'bigquery' };
|
|
109
|
+
const contributed = skill({ qualifiedName: 'bigquery:query-builder', location: '/plugins/bigquery/skills/query-builder/SKILL.md' });
|
|
110
|
+
it('keys and titles a skill row by its qualified name, which is what the model addresses', () => {
|
|
111
|
+
const row = skillRow(categoryWithPlugins([contributed], [bigquery]), contributed);
|
|
112
|
+
(0, chai_1.expect)(row.id).to.equal('skill:bigquery:query-builder');
|
|
113
|
+
(0, chai_1.expect)(row.title).to.equal('bigquery:query-builder');
|
|
114
|
+
});
|
|
115
|
+
it('labels a contributed skill with the shared origin badge naming the plugin that supplied it', () => {
|
|
116
|
+
const row = skillRow(categoryWithPlugins([contributed], [bigquery]), contributed);
|
|
117
|
+
// The same descriptor the MCP page builds, so both pages render one badge rather than two designs.
|
|
118
|
+
(0, chai_1.expect)(row.origins?.map(origin => origin.label)).to.deep.equal(['via BigQuery Data Analytics']);
|
|
119
|
+
// Filterable by the plugin name too, so a plugin's skills can be listed together.
|
|
120
|
+
(0, chai_1.expect)(row.filterText).to.contain('bigquery data analytics');
|
|
121
|
+
});
|
|
122
|
+
it('reveals the owning plugin when the origin badge is activated', () => {
|
|
123
|
+
const revealed = [];
|
|
124
|
+
const row = skillRow(categoryWithPlugins([contributed], [bigquery], revealed), contributed);
|
|
125
|
+
// Activated directly: rendering the badge as a button is `AiConfigurationOriginBadge`'s
|
|
126
|
+
// contract, tested where it lives; what belongs here is where this page's badge leads.
|
|
127
|
+
row.origins[0].activate();
|
|
128
|
+
(0, chai_1.expect)(revealed).to.deep.equal([bigquery.pluginId]);
|
|
129
|
+
});
|
|
130
|
+
it('keeps the provenance out of the pills, which state what the skill is rather than where it came from', () => {
|
|
131
|
+
const row = skillRow(categoryWithPlugins([contributed], [bigquery]), contributed);
|
|
132
|
+
(0, chai_1.expect)(row.pills?.some(pill => pill.startsWith('via '))).to.not.equal(true);
|
|
133
|
+
});
|
|
134
|
+
it('labels nothing for a skill from a built-in root, which is the common case', () => {
|
|
135
|
+
const own = skill({});
|
|
136
|
+
(0, chai_1.expect)(skillRow(categoryWithPlugins([own], [bigquery]), own).origins).to.equal(undefined);
|
|
137
|
+
});
|
|
138
|
+
it('labels nothing rather than a bare qualifier when the qualifier belongs to no installed plugin', () => {
|
|
139
|
+
const row = skillRow(categoryWithPlugins([contributed], []), contributed);
|
|
140
|
+
(0, chai_1.expect)(row.origins).to.equal(undefined);
|
|
141
|
+
(0, chai_1.expect)(row.title).to.equal('bigquery:query-builder');
|
|
142
|
+
});
|
|
143
|
+
it('labels nothing when no bridge is bound, i.e. without `@theia/ai-registry`', () => {
|
|
144
|
+
(0, chai_1.expect)(skillRow(categoryWithPlugins([contributed], undefined), contributed).origins).to.equal(undefined);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
describe('AI registry provenance', () => {
|
|
148
|
+
const installed = skill({ location: '/home/alex/.agents/skills/query-builder/SKILL.md' });
|
|
149
|
+
const entryId = 'io.github.acme/query-builder';
|
|
150
|
+
it('labels a registry-installed skill with the shared "From registry" badge', () => {
|
|
151
|
+
const row = skillRow(categoryWithRegistrySkills([installed], { [installed.location]: entryId }), installed);
|
|
152
|
+
(0, chai_1.expect)(row.origins?.map(origin => origin.label)).to.deep.equal(['From registry']);
|
|
153
|
+
(0, chai_1.expect)(row.origins[0].tooltip).to.contain(entryId);
|
|
154
|
+
});
|
|
155
|
+
it('reveals the registry entry when the badge is activated', () => {
|
|
156
|
+
const revealed = [];
|
|
157
|
+
const row = skillRow(categoryWithRegistrySkills([installed], { [installed.location]: entryId }, revealed), installed);
|
|
158
|
+
row.origins[0].activate();
|
|
159
|
+
(0, chai_1.expect)(revealed).to.deep.equal([entryId]);
|
|
160
|
+
});
|
|
161
|
+
it('labels nothing for a skill in a directory the user controls', () => {
|
|
162
|
+
const own = skill({ location: '/workspace/.agents/skills/query-builder/SKILL.md' });
|
|
163
|
+
(0, chai_1.expect)(skillRow(categoryWithRegistrySkills([own], { [installed.location]: entryId }), own).origins).to.equal(undefined);
|
|
164
|
+
});
|
|
165
|
+
it('labels nothing when no bridge is bound, i.e. without `@theia/ai-registry`', () => {
|
|
166
|
+
(0, chai_1.expect)(skillRow(categoryWithRegistrySkills([installed], undefined), installed).origins).to.equal(undefined);
|
|
167
|
+
});
|
|
168
|
+
it('credits the plugin, not the registry, for a skill a plugin contributed', () => {
|
|
169
|
+
// A plugin ships its skills inside the plugin, so the two origins cannot both apply; were the
|
|
170
|
+
// registry consulted anyway, a stale name collision would show a skill as coming from both.
|
|
171
|
+
const bigquery = { pluginId: 'io.example/bq', name: 'BigQuery', qualifier: 'bigquery' };
|
|
172
|
+
const contributed = skill({ qualifiedName: 'bigquery:query-builder', location: '/plugins/bigquery/skills/query-builder/SKILL.md' });
|
|
173
|
+
const category = categoryWithPlugins([contributed], [bigquery]);
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
175
|
+
category.skillRegistryUiBridge = {
|
|
176
|
+
getRegistryEntryId: () => entryId,
|
|
177
|
+
revealSkill: () => { },
|
|
178
|
+
onDidChange: core_1.Event.None
|
|
179
|
+
};
|
|
180
|
+
(0, chai_1.expect)(skillRow(category, contributed).origins?.map(origin => origin.label)).to.deep.equal(['via BigQuery']);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=prompts-and-skills-configuration-category.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-and-skills-configuration-category.spec.js","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,8DAAiE;AACjE,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AAEjC,uHAAiH;AACjH,wEAAiC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAE1C,+BAA8B;AAC9B,sCAAoC;AAKpC,wHAAqH;AAErH,2GAAoG;AAEpG,YAAY,EAAE,CAAC;AAKf,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IAEnD,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC,CAAC;IAC3C,KAAK,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;IAE5B,SAAS,YAAY,CAAC,MAAe,EAAE,aAA+B;QAClE,MAAM,QAAQ,GAAG,IAAI,iFAAqC,EAAE,CAAC;QAC7D,8DAA8D;QAC7D,QAAgB,CAAC,MAAM,GAAG,MAAM,CAAC;QAClC,8DAA8D;QAC7D,QAAgB,CAAC,aAA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,2EAA2E,EAAE,GAAG,EAAE;YACjF,IAAA,aAAM,EAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;YAC9E,8FAA8F;YAC9F,4FAA4F;YAC5F,MAAM,QAAQ,GAAoB,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;YACzG,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,aAAa,EAAE,wBAAwB,EAAE,QAAQ,EAAE,iDAAiD,EAAE,CAAC,CAAC;YACpI,MAAM,QAAQ,GAAG,mBAAmB,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChE,8DAA8D;YAC7D,QAAgB,CAAC,qBAAqB,GAAG;gBACtC,kBAAkB,EAAE,GAAG,EAAE,CAAC,OAAO;gBACjC,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC;gBACtB,WAAW,EAAE,YAAK,CAAC,IAAI;aACM,CAAC;YAElC,IAAA,aAAM,EAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QACjH,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ModelTokenUsageData, TokenUsageFrontendService } from '@theia/ai-core/lib/browser/token-usage-frontend-service';
|
|
2
|
+
import { Emitter, Event, MessageService } from '@theia/core';
|
|
3
|
+
import { DisposableCollection } from '@theia/core/lib/common';
|
|
4
|
+
import * as React from '@theia/core/shared/react';
|
|
5
|
+
import { AiConfigurationCategory, AiConfigurationSearchItem, AiConfigurationSearchProvider } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
|
|
6
|
+
import { SinglePageCategoryRenderer } from '@theia/ai-core-ui/lib/browser/ai-configuration/renderers/single-page-category-renderer';
|
|
7
|
+
/**
|
|
8
|
+
* The Token Usage category: a read-only `single-page` category showing per-model token usage
|
|
9
|
+
* (input / cache write / cache read / output / total / last-used) with totals. Data is cached and
|
|
10
|
+
* refreshed on the token-usage service updates.
|
|
11
|
+
*/
|
|
12
|
+
export declare class TokenUsageConfigurationCategory extends SinglePageCategoryRenderer implements AiConfigurationCategory, AiConfigurationSearchProvider {
|
|
13
|
+
readonly id = "token-usage";
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly iconClass: string;
|
|
17
|
+
readonly order = 900;
|
|
18
|
+
readonly kind: "single-page";
|
|
19
|
+
protected readonly messageService: MessageService;
|
|
20
|
+
protected readonly tokenUsageService: TokenUsageFrontendService;
|
|
21
|
+
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
22
|
+
readonly onDidChange: Event<void>;
|
|
23
|
+
protected readonly toDispose: DisposableCollection;
|
|
24
|
+
protected items: ModelTokenUsageData[];
|
|
25
|
+
get renderer(): this;
|
|
26
|
+
get search(): AiConfigurationSearchProvider;
|
|
27
|
+
protected init(): void;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
protected load(): Promise<void>;
|
|
30
|
+
protected formatNumber(value: number): string;
|
|
31
|
+
protected formatDate(date?: Date): string;
|
|
32
|
+
protected hasCacheData(): boolean;
|
|
33
|
+
protected renderSections(): React.ReactNode;
|
|
34
|
+
protected renderRow(item: ModelTokenUsageData, showCache: boolean): React.ReactNode;
|
|
35
|
+
protected renderTotals(showCache: boolean): React.ReactNode;
|
|
36
|
+
getSearchItems(): AiConfigurationSearchItem[];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=token-usage-configuration-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-usage-configuration-category.d.ts","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/categories/token-usage-configuration-category.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACzH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAO,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACH,uBAAuB,EAGvB,yBAAyB,EACzB,6BAA6B,EAChC,MAAM,0EAA0E,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wFAAwF,CAAC;AAEpI;;;;GAIG;AACH,qBACa,+BAAgC,SAAQ,0BAA2B,YAAW,uBAAuB,EAAE,6BAA6B;IAE7I,QAAQ,CAAC,EAAE,iBAAyC;IACpD,QAAQ,CAAC,KAAK,SAA4D;IAC1E,QAAQ,CAAC,WAAW,SACyC;IAC7D,QAAQ,CAAC,SAAS,SAAoB;IACtC,QAAQ,CAAC,KAAK,OAA4C;IAC1D,QAAQ,CAAC,IAAI,EAAG,aAAa,CAAU;IAGvC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;IAEhE,SAAS,CAAC,QAAQ,CAAC,kBAAkB,gBAAuB;IAC5D,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAiC;IAClE,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAAqD;IAEjF,SAAS,CAAC,KAAK,EAAE,mBAAmB,EAAE,CAAM;IAE5C,IAAI,QAAQ,IAAI,IAAI,CAEnB;IAED,IAAI,MAAM,IAAI,6BAA6B,CAE1C;IAGD,SAAS,CAAC,IAAI,IAAI,IAAI;IAQtB,OAAO,IAAI,IAAI;cAIC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IASrC,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI7C,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM;IAIzC,SAAS,CAAC,YAAY,IAAI,OAAO;IAIjC,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS;IAoC3C,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS;IAgBnF,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS;IAqB3D,cAAc,IAAI,yBAAyB,EAAE;CAShD"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenUsageConfigurationCategory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("@theia/core/shared/react/jsx-runtime");
|
|
6
|
+
// *****************************************************************************
|
|
7
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
8
|
+
//
|
|
9
|
+
// This program and the accompanying materials are made available under the
|
|
10
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
11
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
12
|
+
//
|
|
13
|
+
// This Source Code may also be made available under the following Secondary
|
|
14
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
15
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
16
|
+
// with the GNU Classpath Exception which is available at
|
|
17
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
18
|
+
//
|
|
19
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
20
|
+
// *****************************************************************************
|
|
21
|
+
const token_usage_frontend_service_1 = require("@theia/ai-core/lib/browser/token-usage-frontend-service");
|
|
22
|
+
const core_1 = require("@theia/core");
|
|
23
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
24
|
+
const common_1 = require("@theia/core/lib/common");
|
|
25
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
26
|
+
const date_fns_1 = require("date-fns");
|
|
27
|
+
const ai_configuration_category_1 = require("@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category");
|
|
28
|
+
const single_page_category_renderer_1 = require("@theia/ai-core-ui/lib/browser/ai-configuration/renderers/single-page-category-renderer");
|
|
29
|
+
/**
|
|
30
|
+
* The Token Usage category: a read-only `single-page` category showing per-model token usage
|
|
31
|
+
* (input / cache write / cache read / output / total / last-used) with totals. Data is cached and
|
|
32
|
+
* refreshed on the token-usage service updates.
|
|
33
|
+
*/
|
|
34
|
+
let TokenUsageConfigurationCategory = class TokenUsageConfigurationCategory extends single_page_category_renderer_1.SinglePageCategoryRenderer {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
this.id = ai_configuration_category_1.AiConfigurationCategoryId.TOKEN_USAGE;
|
|
38
|
+
this.label = core_1.nls.localize('theia/ai/tokenUsage/label', 'Token Usage');
|
|
39
|
+
this.description = core_1.nls.localize('theia/ai/tokenUsage/description', 'Review token consumption across providers and models.');
|
|
40
|
+
this.iconClass = (0, browser_1.codicon)('graph');
|
|
41
|
+
this.order = ai_configuration_category_1.AiConfigurationCategoryOrder.TOKEN_USAGE;
|
|
42
|
+
this.kind = 'single-page';
|
|
43
|
+
this.onDidChangeEmitter = new core_1.Emitter();
|
|
44
|
+
this.onDidChange = this.onDidChangeEmitter.event;
|
|
45
|
+
this.toDispose = new common_1.DisposableCollection(this.onDidChangeEmitter);
|
|
46
|
+
this.items = [];
|
|
47
|
+
}
|
|
48
|
+
get renderer() {
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
get search() {
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
init() {
|
|
55
|
+
this.load();
|
|
56
|
+
this.toDispose.push(this.tokenUsageService.onTokenUsageUpdated(data => {
|
|
57
|
+
this.items = [...data].sort((a, b) => a.modelId.localeCompare(b.modelId));
|
|
58
|
+
this.onDidChangeEmitter.fire();
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
dispose() {
|
|
62
|
+
this.toDispose.dispose();
|
|
63
|
+
}
|
|
64
|
+
async load() {
|
|
65
|
+
try {
|
|
66
|
+
this.items = (await this.tokenUsageService.getTokenUsageData()).sort((a, b) => a.modelId.localeCompare(b.modelId));
|
|
67
|
+
this.onDidChangeEmitter.fire();
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
this.messageService.error(core_1.nls.localize('theia/ai/tokenUsage/failedToGetTokenUsageData', 'Failed to fetch token usage data: {0}', String(error)));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
formatNumber(value) {
|
|
74
|
+
return value.toLocaleString();
|
|
75
|
+
}
|
|
76
|
+
formatDate(date) {
|
|
77
|
+
return date ? (0, date_fns_1.formatDistanceToNow)(date, { addSuffix: true }) : core_1.nls.localizeByDefault('Never');
|
|
78
|
+
}
|
|
79
|
+
hasCacheData() {
|
|
80
|
+
return this.items.some(model => model.cachedInputTokens !== undefined || model.readCachedInputTokens !== undefined);
|
|
81
|
+
}
|
|
82
|
+
renderSections() {
|
|
83
|
+
if (this.items.length === 0) {
|
|
84
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'ai-empty-state-content', children: (0, jsx_runtime_1.jsx)("p", { children: core_1.nls.localize('theia/ai/tokenUsage/noData', 'No token usage data available yet.') }) });
|
|
85
|
+
}
|
|
86
|
+
const showCache = this.hasCacheData();
|
|
87
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'ai-configuration-page', children: [(0, jsx_runtime_1.jsxs)("table", { className: 'ai-configuration-table', children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { className: 'token-usage-model-column', children: core_1.nls.localizeByDefault('Model') }), (0, jsx_runtime_1.jsx)("th", { className: 'token-usage-column', children: core_1.nls.localize('theia/ai/tokenUsage/inputTokens', 'Input Tokens') }), showCache && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("th", { className: 'token-usage-column', children: core_1.nls.localize('theia/ai/tokenUsage/cachedInputTokens', 'Input Tokens Written to Cache') }), (0, jsx_runtime_1.jsx)("th", { className: 'token-usage-column', children: core_1.nls.localize('theia/ai/tokenUsage/readCachedInputTokens', 'Input Tokens Read From Cache') })] }), (0, jsx_runtime_1.jsx)("th", { className: 'token-usage-column', children: core_1.nls.localize('theia/ai/tokenUsage/outputTokens', 'Output Tokens') }), (0, jsx_runtime_1.jsx)("th", { className: 'token-usage-column', children: core_1.nls.localizeByDefault('Total Tokens') }), (0, jsx_runtime_1.jsx)("th", { className: 'token-usage-column', children: core_1.nls.localize('theia/ai/tokenUsage/lastUsed', 'Last Used') })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: this.items.map(item => this.renderRow(item, showCache)) }), this.renderTotals(showCache)] }), (0, jsx_runtime_1.jsx)("div", { className: 'ai-configuration-info-box', children: (0, jsx_runtime_1.jsxs)("p", { className: 'ai-configuration-info-text', children: [(0, jsx_runtime_1.jsx)("i", { className: `${(0, browser_1.codicon)('info')} ai-configuration-info-icon` }), core_1.nls.localize('theia/ai/tokenUsage/note', 'Token usage is tracked since the start of the application and is not persisted.')] }) })] });
|
|
88
|
+
}
|
|
89
|
+
renderRow(item, showCache) {
|
|
90
|
+
const total = item.inputTokens + item.outputTokens + (item.cachedInputTokens ?? 0);
|
|
91
|
+
const lastUsedDate = item.lastUsed ? new Date(item.lastUsed) : undefined;
|
|
92
|
+
return (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { className: 'token-usage-model-column', children: item.modelId }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(item.inputTokens) }), showCache && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: item.cachedInputTokens !== undefined ? this.formatNumber(item.cachedInputTokens) : '-' }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: item.readCachedInputTokens !== undefined ? this.formatNumber(item.readCachedInputTokens) : '-' })] }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(item.outputTokens) }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(total) }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', title: lastUsedDate ? lastUsedDate.toLocaleString() : undefined, children: this.formatDate(lastUsedDate) })] }, item.modelId);
|
|
93
|
+
}
|
|
94
|
+
renderTotals(showCache) {
|
|
95
|
+
const sum = (pick) => this.items.reduce((total, model) => total + pick(model), 0);
|
|
96
|
+
const totalInput = sum(model => model.inputTokens);
|
|
97
|
+
const totalOutput = sum(model => model.outputTokens);
|
|
98
|
+
const totalCached = sum(model => model.cachedInputTokens ?? 0);
|
|
99
|
+
const totalRead = sum(model => model.readCachedInputTokens ?? 0);
|
|
100
|
+
return (0, jsx_runtime_1.jsx)("tfoot", { children: (0, jsx_runtime_1.jsxs)("tr", { className: 'ai-configuration-footer-total-row', children: [(0, jsx_runtime_1.jsx)("td", { className: 'token-usage-model-column', children: core_1.nls.localizeByDefault('Total') }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(totalInput) }), showCache && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(totalCached) }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(totalRead) })] }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(totalOutput) }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column', children: this.formatNumber(totalInput + totalCached + totalOutput) }), (0, jsx_runtime_1.jsx)("td", { className: 'token-usage-column' })] }) });
|
|
101
|
+
}
|
|
102
|
+
getSearchItems() {
|
|
103
|
+
return [{
|
|
104
|
+
label: this.label,
|
|
105
|
+
typeLabel: core_1.nls.localize('theia/ai/ide/aiConfiguration/pageTypeLabel', 'Page'),
|
|
106
|
+
categoryId: this.id,
|
|
107
|
+
target: { categoryId: this.id },
|
|
108
|
+
keywords: 'token usage tokens cost'
|
|
109
|
+
}];
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
exports.TokenUsageConfigurationCategory = TokenUsageConfigurationCategory;
|
|
113
|
+
tslib_1.__decorate([
|
|
114
|
+
(0, inversify_1.inject)(core_1.MessageService),
|
|
115
|
+
tslib_1.__metadata("design:type", core_1.MessageService)
|
|
116
|
+
], TokenUsageConfigurationCategory.prototype, "messageService", void 0);
|
|
117
|
+
tslib_1.__decorate([
|
|
118
|
+
(0, inversify_1.inject)(token_usage_frontend_service_1.TokenUsageFrontendService),
|
|
119
|
+
tslib_1.__metadata("design:type", Object)
|
|
120
|
+
], TokenUsageConfigurationCategory.prototype, "tokenUsageService", void 0);
|
|
121
|
+
tslib_1.__decorate([
|
|
122
|
+
(0, inversify_1.postConstruct)(),
|
|
123
|
+
tslib_1.__metadata("design:type", Function),
|
|
124
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
125
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
126
|
+
], TokenUsageConfigurationCategory.prototype, "init", null);
|
|
127
|
+
exports.TokenUsageConfigurationCategory = TokenUsageConfigurationCategory = tslib_1.__decorate([
|
|
128
|
+
(0, inversify_1.injectable)()
|
|
129
|
+
], TokenUsageConfigurationCategory);
|
|
130
|
+
//# sourceMappingURL=token-usage-configuration-category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-usage-configuration-category.js","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/categories/token-usage-configuration-category.tsx"],"names":[],"mappings":";;;;;AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,0GAAyH;AACzH,sCAAkE;AAClE,qDAAkD;AAClD,mDAA8D;AAC9D,4DAAiF;AAEjF,uCAA+C;AAC/C,wHAMkF;AAClF,0IAAoI;AAEpI;;;;GAIG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,0DAA0B;IAAxE;;QAEM,OAAE,GAAG,qDAAyB,CAAC,WAAW,CAAC;QAC3C,UAAK,GAAG,UAAG,CAAC,QAAQ,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC;QACjE,gBAAW,GAAG,UAAG,CAAC,QAAQ,CAAC,iCAAiC,EACjE,uDAAuD,CAAC,CAAC;QACpD,cAAS,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;QAC7B,UAAK,GAAG,wDAA4B,CAAC,WAAW,CAAC;QACjD,SAAI,GAAG,aAAsB,CAAC;QAQpB,uBAAkB,GAAG,IAAI,cAAO,EAAQ,CAAC;QACnD,gBAAW,GAAgB,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;QAC/C,cAAS,GAAG,IAAI,6BAAoB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEvE,UAAK,GAA0B,EAAE,CAAC;IA8HhD,CAAC;IA5HG,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,MA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C,OAAO,CAAC,GAAM,EAC9E,+BAAI,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAM,EACtE,SAAS,IAAI,6DACV,+BAAI,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAM,EACxE,+BAAI,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,GAAM,IACvE,EACH,+BAAI,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAM,EACxE,+BAAI,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC,GAAM,EACnG,+BAAI,SAAS,EAAC,oBAAoB,GAAM,IACvC,GACD,CAAC;IACb,CAAC;IAED,cAAc;QACV,OAAO,CAAC;gBACJ,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,SAAS,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAAE,MAAM,CAAC;gBAC7E,UAAU,EAAE,IAAI,CAAC,EAAE;gBACnB,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;gBAC/B,QAAQ,EAAE,yBAAyB;aACtC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAlJY,0EAA+B;AAWrB;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACY,qBAAc;uEAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,wDAAyB,CAAC;;0EAC8B;AAiBtD;IADT,IAAA,yBAAa,GAAE;;;;2DAOf;0CArCQ,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAkJ3C"}
|
package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-usage-configuration-category.spec.d.ts","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/categories/token-usage-configuration-category.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
19
|
+
let disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
20
|
+
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
21
|
+
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
22
|
+
const chai_1 = require("chai");
|
|
23
|
+
const ai_configuration_category_1 = require("@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category");
|
|
24
|
+
const token_usage_configuration_category_1 = require("./token-usage-configuration-category");
|
|
25
|
+
disableJSDOM();
|
|
26
|
+
describe('TokenUsageConfigurationCategory', () => {
|
|
27
|
+
before(() => disableJSDOM = (0, jsdom_1.enableJSDOM)());
|
|
28
|
+
after(() => disableJSDOM());
|
|
29
|
+
it('declares the token-usage single-page metadata and a page-level search item', () => {
|
|
30
|
+
const category = new token_usage_configuration_category_1.TokenUsageConfigurationCategory();
|
|
31
|
+
(0, chai_1.expect)(category.id).to.equal(ai_configuration_category_1.AiConfigurationCategoryId.TOKEN_USAGE);
|
|
32
|
+
(0, chai_1.expect)(category.kind).to.equal('single-page');
|
|
33
|
+
const items = category.getSearchItems();
|
|
34
|
+
(0, chai_1.expect)(items).to.have.lengthOf(1);
|
|
35
|
+
(0, chai_1.expect)(items[0].target).to.deep.equal({ categoryId: ai_configuration_category_1.AiConfigurationCategoryId.TOKEN_USAGE });
|
|
36
|
+
});
|
|
37
|
+
it('shows cache columns only when at least one model reports cache data', () => {
|
|
38
|
+
const category = new token_usage_configuration_category_1.TokenUsageConfigurationCategory();
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
const withoutCache = [{ modelId: 'm', inputTokens: 1, outputTokens: 2 }];
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
category.items = withoutCache;
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
(0, chai_1.expect)(category.hasCacheData()).to.equal(false);
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
category.items = [{ modelId: 'm', inputTokens: 1, outputTokens: 2, cachedInputTokens: 3 }];
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
(0, chai_1.expect)(category.hasCacheData()).to.equal(true);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=token-usage-configuration-category.spec.js.map
|
package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-usage-configuration-category.spec.js","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/categories/token-usage-configuration-category.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,m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;QAC3E,MAAM,QAAQ,GAAG,IAAI,oEAA+B,EAAE,CAAC;QACvD,8DAA8D;QAC9D,MAAM,YAAY,GAA0B,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAS,CAAC,CAAC;QACvG,8DAA8D;QAC7D,QAAgB,CAAC,KAAK,GAAG,YAAY,CAAC;QACvC,8DAA8D;QAC9D,IAAA,aAAM,EAAE,QAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzD,8DAA8D;QAC7D,QAAgB,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAS,CAAC,CAAC;QAC3G,8DAA8D;QAC9D,IAAA,aAAM,EAAE,QAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AiConfigurationService, ToolInvocationRegistry, ToolRequest } from '@theia/ai-core';
|
|
2
|
+
import { ToolConfirmationManager } from '@theia/ai-chat/lib/browser/chat-tool-preference-bindings';
|
|
3
|
+
import { ToolConfirmationMode } from '@theia/ai-chat/lib/common/chat-tool-preferences';
|
|
4
|
+
import { ShellCommandPermissionService } from '@theia/ai-terminal/lib/browser/shell-command-permission-service';
|
|
5
|
+
import { Emitter, Event } from '@theia/core';
|
|
6
|
+
import { DisposableCollection } from '@theia/core/lib/common';
|
|
7
|
+
import * as React from '@theia/core/shared/react';
|
|
8
|
+
import { AiConfigurationCategory, AiConfigurationRenderContext, AiConfigurationSearchItem, AiConfigurationSearchProvider } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
|
|
9
|
+
import { SinglePageCategoryRenderer } from '@theia/ai-core-ui/lib/browser/ai-configuration/renderers/single-page-category-renderer';
|
|
10
|
+
import { AiSettingsControl, AiSettingsRowService } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-settings-row-service';
|
|
11
|
+
/**
|
|
12
|
+
* The Tools category: a `single-page` category with the default confirmation mode, a per-tool
|
|
13
|
+
* confirmation table, the recommended-defaults banner, and the shell allow/deny-list editors.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ToolsConfigurationCategory extends SinglePageCategoryRenderer implements AiConfigurationCategory, AiConfigurationSearchProvider {
|
|
16
|
+
readonly id = "tools";
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly description: string;
|
|
19
|
+
readonly iconClass: string;
|
|
20
|
+
readonly order = 800;
|
|
21
|
+
readonly kind: "single-page";
|
|
22
|
+
protected readonly confirmationManager: ToolConfirmationManager;
|
|
23
|
+
protected readonly toolInvocationRegistry: ToolInvocationRegistry;
|
|
24
|
+
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
25
|
+
readonly onDidChange: Event<void>;
|
|
26
|
+
protected readonly toDispose: DisposableCollection;
|
|
27
|
+
protected toolNames: string[];
|
|
28
|
+
protected toolConfirmationModes: Record<string, ToolConfirmationMode>;
|
|
29
|
+
protected defaultState: ToolConfirmationMode;
|
|
30
|
+
get renderer(): this;
|
|
31
|
+
getOwnedPreferenceIds(): string[];
|
|
32
|
+
get search(): AiConfigurationSearchProvider;
|
|
33
|
+
protected readonly aiConfigurationService: AiConfigurationService;
|
|
34
|
+
protected readonly settingsRowService: AiSettingsRowService;
|
|
35
|
+
protected readonly shellCommandPermissionService: ShellCommandPermissionService;
|
|
36
|
+
protected readonly renderMarkdown: (markdown: string) => HTMLElement;
|
|
37
|
+
protected init(): void;
|
|
38
|
+
dispose(): void;
|
|
39
|
+
protected load(): Promise<void>;
|
|
40
|
+
protected loadTools(): void;
|
|
41
|
+
protected loadConfirmation(): Promise<void>;
|
|
42
|
+
protected getEffectiveState(toolName: string): ToolConfirmationMode;
|
|
43
|
+
/** Title of the default-confirmation-mode row, shared by the header and the search index. */
|
|
44
|
+
protected defaultModeLabel(): string;
|
|
45
|
+
protected renderHeader(ctx: AiConfigurationRenderContext): React.ReactNode;
|
|
46
|
+
protected renderRecommendedDefaultsBanner(): React.ReactNode;
|
|
47
|
+
protected renderSections(ctx: AiConfigurationRenderContext): React.ReactNode;
|
|
48
|
+
protected handleToolConfirmationModeChange(toolName: string, mode: ToolConfirmationMode): Promise<void>;
|
|
49
|
+
protected showConfirmAlwaysAllowDialog(toolName: string, toolRequest: ToolRequest): Promise<boolean>;
|
|
50
|
+
protected resetAllToolsToDefault(): Promise<void>;
|
|
51
|
+
protected allowCurrentTools(): Promise<void>;
|
|
52
|
+
protected buildAllowCurrentToolsMessage(): HTMLElement;
|
|
53
|
+
/**
|
|
54
|
+
* The list control for a shell command pattern list, with the service's own rules attached so an invalid
|
|
55
|
+
* pattern is refused with its message instead of being written.
|
|
56
|
+
*/
|
|
57
|
+
protected shellPatternControl(preferenceId: string): AiSettingsControl;
|
|
58
|
+
getSearchItems(): AiConfigurationSearchItem[];
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=tools-configuration-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-configuration-category.d.ts","sourceRoot":"","sources":["../../../../src/browser/ai-configuration/categories/tools-configuration-category.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAKH,oBAAoB,EACvB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iEAAiE,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAO,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE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