@theia/ai-ide 1.67.0-next.56 → 1.67.0-next.59
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-configuration/agent-configuration-widget.d.ts +41 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js +333 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts +18 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js +53 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +14 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +67 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +29 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js +118 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts +13 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.js +104 -0
- package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +43 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.js +302 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +41 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +226 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +141 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +508 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts +10 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js +48 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +22 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js +156 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +30 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.js +150 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +19 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.js +99 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.js.map +1 -0
- package/lib/browser/ai-ide-activation-service.d.ts +18 -0
- package/lib/browser/ai-ide-activation-service.d.ts.map +1 -0
- package/lib/browser/ai-ide-activation-service.js +71 -0
- package/lib/browser/ai-ide-activation-service.js.map +1 -0
- package/lib/browser/ai-terminal-functions.d.ts +13 -0
- package/lib/browser/ai-terminal-functions.d.ts.map +1 -0
- package/lib/browser/ai-terminal-functions.js +114 -0
- package/lib/browser/ai-terminal-functions.js.map +1 -0
- package/lib/browser/app-tester-chat-agent.d.ts +35 -0
- package/lib/browser/app-tester-chat-agent.d.ts.map +1 -0
- package/lib/browser/app-tester-chat-agent.js +142 -0
- package/lib/browser/app-tester-chat-agent.js.map +1 -0
- package/lib/browser/app-tester-chat-functions.d.ts +25 -0
- package/lib/browser/app-tester-chat-functions.d.ts.map +1 -0
- package/lib/browser/app-tester-chat-functions.js +170 -0
- package/lib/browser/app-tester-chat-functions.js.map +1 -0
- package/lib/browser/app-tester-prompt-template.d.ts +6 -0
- package/lib/browser/app-tester-prompt-template.d.ts.map +1 -0
- package/lib/browser/app-tester-prompt-template.js +83 -0
- package/lib/browser/app-tester-prompt-template.js.map +1 -0
- package/lib/browser/architect-agent.d.ts +15 -0
- package/lib/browser/architect-agent.d.ts.map +1 -0
- package/lib/browser/architect-agent.js +68 -0
- package/lib/browser/architect-agent.js.map +1 -0
- package/lib/browser/coder-agent.d.ts +15 -0
- package/lib/browser/coder-agent.d.ts.map +1 -0
- package/lib/browser/coder-agent.js +81 -0
- package/lib/browser/coder-agent.js.map +1 -0
- package/lib/browser/context-file-validation-service-impl.d.ts +13 -0
- package/lib/browser/context-file-validation-service-impl.d.ts.map +1 -0
- package/lib/browser/context-file-validation-service-impl.js +123 -0
- package/lib/browser/context-file-validation-service-impl.js.map +1 -0
- package/lib/browser/context-file-validation-service-impl.spec.d.ts +2 -0
- package/lib/browser/context-file-validation-service-impl.spec.d.ts.map +1 -0
- package/lib/browser/context-file-validation-service-impl.spec.js +340 -0
- package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -0
- package/lib/browser/context-functions.d.ts +16 -0
- package/lib/browser/context-functions.d.ts.map +1 -0
- package/lib/browser/context-functions.js +166 -0
- package/lib/browser/context-functions.js.map +1 -0
- package/lib/browser/context-functions.spec.d.ts +2 -0
- package/lib/browser/context-functions.spec.d.ts.map +1 -0
- package/lib/browser/context-functions.spec.js +213 -0
- package/lib/browser/context-functions.spec.js.map +1 -0
- package/lib/browser/file-changeset-function.spec.d.ts +2 -0
- package/lib/browser/file-changeset-function.spec.d.ts.map +1 -0
- package/lib/browser/file-changeset-function.spec.js +45 -0
- package/lib/browser/file-changeset-function.spec.js.map +1 -0
- package/lib/browser/file-changeset-functions.d.ts +87 -0
- package/lib/browser/file-changeset-functions.d.ts.map +1 -0
- package/lib/browser/file-changeset-functions.js +645 -0
- package/lib/browser/file-changeset-functions.js.map +1 -0
- package/lib/browser/file-changeset-functions.spec.d.ts +2 -0
- package/lib/browser/file-changeset-functions.spec.d.ts.map +1 -0
- package/lib/browser/file-changeset-functions.spec.js +179 -0
- package/lib/browser/file-changeset-functions.spec.js.map +1 -0
- package/lib/browser/frontend-module.d.ts +5 -0
- package/lib/browser/frontend-module.d.ts.map +1 -0
- package/lib/browser/frontend-module.js +220 -0
- package/lib/browser/frontend-module.js.map +1 -0
- package/lib/browser/github-chat-agent.d.ts +48 -0
- package/lib/browser/github-chat-agent.d.ts.map +1 -0
- package/lib/browser/github-chat-agent.js +222 -0
- package/lib/browser/github-chat-agent.js.map +1 -0
- package/lib/browser/github-prompt-template.d.ts +6 -0
- package/lib/browser/github-prompt-template.d.ts.map +1 -0
- package/lib/browser/github-prompt-template.js +53 -0
- package/lib/browser/github-prompt-template.js.map +1 -0
- package/lib/browser/github-repo-variable-contribution.d.ts +15 -0
- package/lib/browser/github-repo-variable-contribution.d.ts.map +1 -0
- package/lib/browser/github-repo-variable-contribution.js +82 -0
- package/lib/browser/github-repo-variable-contribution.js.map +1 -0
- package/lib/browser/ide-chat-welcome-message-provider.d.ts +10 -0
- package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -0
- package/lib/browser/ide-chat-welcome-message-provider.js +102 -0
- package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -0
- package/lib/browser/project-info-agent.d.ts +13 -0
- package/lib/browser/project-info-agent.d.ts.map +1 -0
- package/lib/browser/project-info-agent.js +45 -0
- package/lib/browser/project-info-agent.js.map +1 -0
- package/lib/browser/remember-command-contribution.d.ts +16 -0
- package/lib/browser/remember-command-contribution.d.ts.map +1 -0
- package/lib/browser/remember-command-contribution.js +101 -0
- package/lib/browser/remember-command-contribution.js.map +1 -0
- package/lib/browser/summarize-session-command-contribution.d.ts +19 -0
- package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -0
- package/lib/browser/summarize-session-command-contribution.js +118 -0
- package/lib/browser/summarize-session-command-contribution.js.map +1 -0
- package/lib/browser/task-background-summary-variable.d.ts +9 -0
- package/lib/browser/task-background-summary-variable.d.ts.map +1 -0
- package/lib/browser/task-background-summary-variable.js +60 -0
- package/lib/browser/task-background-summary-variable.js.map +1 -0
- package/lib/browser/task-context-agent.d.ts +13 -0
- package/lib/browser/task-context-agent.d.ts.map +1 -0
- package/lib/browser/task-context-agent.js +45 -0
- package/lib/browser/task-context-agent.js.map +1 -0
- package/lib/browser/task-context-file-storage-service.d.ts +40 -0
- package/lib/browser/task-context-file-storage-service.d.ts.map +1 -0
- package/lib/browser/task-context-file-storage-service.js +232 -0
- package/lib/browser/task-context-file-storage-service.js.map +1 -0
- package/lib/browser/template-preference-contribution.d.ts +17 -0
- package/lib/browser/template-preference-contribution.d.ts.map +1 -0
- package/lib/browser/template-preference-contribution.js +94 -0
- package/lib/browser/template-preference-contribution.js.map +1 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts +2 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts.map +1 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.js +52 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.js.map +1 -0
- package/lib/browser/workspace-functions.d.ts +78 -0
- package/lib/browser/workspace-functions.d.ts.map +1 -0
- package/lib/browser/workspace-functions.js +697 -0
- package/lib/browser/workspace-functions.js.map +1 -0
- package/lib/browser/workspace-functions.spec.d.ts +2 -0
- package/lib/browser/workspace-functions.spec.d.ts.map +1 -0
- package/lib/browser/workspace-functions.spec.js +161 -0
- package/lib/browser/workspace-functions.spec.js.map +1 -0
- package/lib/browser/workspace-launch-provider.d.ts +24 -0
- package/lib/browser/workspace-launch-provider.d.ts.map +1 -0
- package/lib/browser/workspace-launch-provider.js +216 -0
- package/lib/browser/workspace-launch-provider.js.map +1 -0
- package/lib/browser/workspace-launch-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-launch-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-launch-provider.spec.js +245 -0
- package/lib/browser/workspace-launch-provider.spec.js.map +1 -0
- package/lib/browser/workspace-search-provider.d.ts +15 -0
- package/lib/browser/workspace-search-provider.d.ts.map +1 -0
- package/lib/browser/workspace-search-provider.js +204 -0
- package/lib/browser/workspace-search-provider.js.map +1 -0
- package/lib/browser/workspace-search-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-search-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-search-provider.spec.js +82 -0
- package/lib/browser/workspace-search-provider.spec.js.map +1 -0
- package/lib/browser/workspace-task-provider.d.ts +15 -0
- package/lib/browser/workspace-task-provider.d.ts.map +1 -0
- package/lib/browser/workspace-task-provider.js +138 -0
- package/lib/browser/workspace-task-provider.js.map +1 -0
- package/lib/browser/workspace-task-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-task-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-task-provider.spec.js +109 -0
- package/lib/browser/workspace-task-provider.spec.js.map +1 -0
- package/lib/common/ai-configuration-preferences.d.ts +8 -0
- package/lib/common/ai-configuration-preferences.d.ts.map +1 -0
- package/lib/common/ai-configuration-preferences.js +41 -0
- package/lib/common/ai-configuration-preferences.js.map +1 -0
- package/lib/common/ai-ide-preferences.d.ts +5 -0
- package/lib/common/ai-ide-preferences.d.ts.map +1 -0
- package/lib/common/ai-ide-preferences.js +53 -0
- package/lib/common/ai-ide-preferences.js.map +1 -0
- package/lib/common/ai-terminal-functions.d.ts +2 -0
- package/lib/common/ai-terminal-functions.d.ts.map +1 -0
- package/lib/common/ai-terminal-functions.js +20 -0
- package/lib/common/ai-terminal-functions.js.map +1 -0
- package/lib/common/app-tester-chat-functions.d.ts +5 -0
- package/lib/common/app-tester-chat-functions.d.ts.map +1 -0
- package/lib/common/app-tester-chat-functions.js +23 -0
- package/lib/common/app-tester-chat-functions.js.map +1 -0
- package/lib/common/architect-prompt-template.d.ts +3 -0
- package/lib/common/architect-prompt-template.d.ts.map +1 -0
- package/lib/common/architect-prompt-template.js +81 -0
- package/lib/common/architect-prompt-template.js.map +1 -0
- package/lib/common/browser-automation-protocol.d.ts +15 -0
- package/lib/common/browser-automation-protocol.d.ts.map +1 -0
- package/lib/common/browser-automation-protocol.js +22 -0
- package/lib/common/browser-automation-protocol.js.map +1 -0
- package/lib/common/coder-replace-prompt-template.d.ts +11 -0
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -0
- package/lib/common/coder-replace-prompt-template.js +296 -0
- package/lib/common/coder-replace-prompt-template.js.map +1 -0
- package/lib/common/command-chat-agents.d.ts +36 -0
- package/lib/common/command-chat-agents.d.ts.map +1 -0
- package/lib/common/command-chat-agents.js +122 -0
- package/lib/common/command-chat-agents.js.map +1 -0
- package/lib/common/command-prompt-template.d.ts +3 -0
- package/lib/common/command-prompt-template.d.ts.map +1 -0
- package/lib/common/command-prompt-template.js +226 -0
- package/lib/common/command-prompt-template.js.map +1 -0
- package/lib/common/context-files-variable.d.ts +9 -0
- package/lib/common/context-files-variable.d.ts.map +1 -0
- package/lib/common/context-files-variable.js +52 -0
- package/lib/common/context-files-variable.js.map +1 -0
- package/lib/common/context-functions.d.ts +4 -0
- package/lib/common/context-functions.d.ts.map +1 -0
- package/lib/common/context-functions.js +22 -0
- package/lib/common/context-functions.js.map +1 -0
- package/lib/common/context-variables.d.ts +3 -0
- package/lib/common/context-variables.d.ts.map +1 -0
- package/lib/common/context-variables.js +21 -0
- package/lib/common/context-variables.js.map +1 -0
- package/lib/common/file-changeset-function-ids.d.ts +19 -0
- package/lib/common/file-changeset-function-ids.d.ts.map +1 -0
- package/lib/common/file-changeset-function-ids.js +37 -0
- package/lib/common/file-changeset-function-ids.js.map +1 -0
- package/lib/common/github-repo-protocol.d.ts +15 -0
- package/lib/common/github-repo-protocol.d.ts.map +1 -0
- package/lib/common/github-repo-protocol.js +21 -0
- package/lib/common/github-repo-protocol.js.map +1 -0
- package/lib/common/orchestrator-chat-agent.d.ts +36 -0
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -0
- package/lib/common/orchestrator-chat-agent.js +167 -0
- package/lib/common/orchestrator-chat-agent.js.map +1 -0
- package/lib/common/orchestrator-prompt-template.d.ts +3 -0
- package/lib/common/orchestrator-prompt-template.d.ts.map +1 -0
- package/lib/common/orchestrator-prompt-template.js +55 -0
- package/lib/common/orchestrator-prompt-template.js.map +1 -0
- package/lib/common/project-info-prompt-template.d.ts +6 -0
- package/lib/common/project-info-prompt-template.d.ts.map +1 -0
- package/lib/common/project-info-prompt-template.js +145 -0
- package/lib/common/project-info-prompt-template.js.map +1 -0
- package/lib/common/summarize-session-commands.d.ts +4 -0
- package/lib/common/summarize-session-commands.d.ts.map +1 -0
- package/lib/common/summarize-session-commands.js +28 -0
- package/lib/common/summarize-session-commands.js.map +1 -0
- package/lib/common/task-context-prompt-template.d.ts +8 -0
- package/lib/common/task-context-prompt-template.d.ts.map +1 -0
- package/lib/common/task-context-prompt-template.js +217 -0
- package/lib/common/task-context-prompt-template.js.map +1 -0
- package/lib/common/universal-chat-agent.d.ts +17 -0
- package/lib/common/universal-chat-agent.d.ts.map +1 -0
- package/lib/common/universal-chat-agent.js +47 -0
- package/lib/common/universal-chat-agent.js.map +1 -0
- package/lib/common/universal-prompt-template.d.ts +4 -0
- package/lib/common/universal-prompt-template.d.ts.map +1 -0
- package/lib/common/universal-prompt-template.js +32 -0
- package/lib/common/universal-prompt-template.js.map +1 -0
- package/lib/common/workspace-functions.d.ts +12 -0
- package/lib/common/workspace-functions.d.ts.map +1 -0
- package/lib/common/workspace-functions.js +30 -0
- package/lib/common/workspace-functions.js.map +1 -0
- package/lib/common/workspace-preferences.d.ts +10 -0
- package/lib/common/workspace-preferences.d.ts.map +1 -0
- package/lib/common/workspace-preferences.js +89 -0
- package/lib/common/workspace-preferences.js.map +1 -0
- package/lib/common/workspace-search-provider-util.d.ts +17 -0
- package/lib/common/workspace-search-provider-util.d.ts.map +1 -0
- package/lib/common/workspace-search-provider-util.js +51 -0
- package/lib/common/workspace-search-provider-util.js.map +1 -0
- package/lib/node/app-tester-agent/browser-automation-impl.d.ts +18 -0
- package/lib/node/app-tester-agent/browser-automation-impl.d.ts.map +1 -0
- package/lib/node/app-tester-agent/browser-automation-impl.js +96 -0
- package/lib/node/app-tester-agent/browser-automation-impl.js.map +1 -0
- package/lib/node/backend-module.d.ts +4 -0
- package/lib/node/backend-module.d.ts.map +1 -0
- package/lib/node/backend-module.js +45 -0
- package/lib/node/backend-module.js.map +1 -0
- package/lib/node/github-repo-service-impl.d.ts +7 -0
- package/lib/node/github-repo-service-impl.d.ts.map +1 -0
- package/lib/node/github-repo-service-impl.js +86 -0
- package/lib/node/github-repo-service-impl.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +21 -21
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Agent, AgentService, AISettingsService, AIVariableService, FrontendLanguageModelRegistry, LanguageModel, PromptFragmentCustomizationService, PromptService } from '@theia/ai-core/lib/common';
|
|
3
|
+
import { QuickInputService, ReactWidget } from '@theia/core/lib/browser';
|
|
4
|
+
import * as React from '@theia/core/shared/react';
|
|
5
|
+
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
6
|
+
import { LanguageModelAliasRegistry, LanguageModelAlias } from '@theia/ai-core/lib/common/language-model-alias';
|
|
7
|
+
interface ParsedPrompt {
|
|
8
|
+
functions: string[];
|
|
9
|
+
globalVariables: string[];
|
|
10
|
+
agentSpecificVariables: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare class AIAgentConfigurationWidget extends ReactWidget {
|
|
13
|
+
static readonly ID = "ai-agent-configuration-container-widget";
|
|
14
|
+
static readonly LABEL: string;
|
|
15
|
+
protected readonly agentService: AgentService;
|
|
16
|
+
protected readonly languageModelRegistry: FrontendLanguageModelRegistry;
|
|
17
|
+
protected readonly promptFragmentCustomizationService: PromptFragmentCustomizationService;
|
|
18
|
+
protected readonly languageModelAliasRegistry: LanguageModelAliasRegistry;
|
|
19
|
+
protected readonly aiSettingsService: AISettingsService;
|
|
20
|
+
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
21
|
+
protected readonly variableService: AIVariableService;
|
|
22
|
+
protected promptService: PromptService;
|
|
23
|
+
protected readonly quickInputService: QuickInputService;
|
|
24
|
+
protected languageModels: LanguageModel[] | undefined;
|
|
25
|
+
protected languageModelAliases: LanguageModelAlias[];
|
|
26
|
+
protected parsedPromptParts: ParsedPrompt | undefined;
|
|
27
|
+
protected isLoadingDetails: boolean;
|
|
28
|
+
protected init(): void;
|
|
29
|
+
protected updateParsedPromptParts(): Promise<void>;
|
|
30
|
+
protected render(): React.ReactNode;
|
|
31
|
+
protected renderAgentName(agent: Agent): React.ReactNode;
|
|
32
|
+
protected renderAgentDetails(): React.ReactNode;
|
|
33
|
+
protected parsePromptFragmentsForVariableAndFunction(agent: Agent): Promise<ParsedPrompt>;
|
|
34
|
+
protected extractVariablesAndFunctions(promptContent: string, result: ParsedPrompt, agent: Agent): void;
|
|
35
|
+
protected showVariableConfigurationTab(): void;
|
|
36
|
+
protected addCustomAgent(): Promise<void>;
|
|
37
|
+
protected setActiveAgent(agent: Agent): void;
|
|
38
|
+
private toggleAgentEnabled;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=agent-configuration-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-configuration-widget.d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AC;IAExD,SAAS,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,CAAM;IAC1D,SAAS,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,gBAAgB,UAAS;IAGnC,SAAS,CAAC,IAAI,IAAI,IAAI;cA0CN,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYxD,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IA2BnC,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS;IAKxD,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,SAAS;cA0F/B,0CAA0C,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;IAmB/F,SAAS,CAAC,4BAA4B,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IA2BvG,SAAS,CAAC,4BAA4B,IAAI,IAAI;cAI9B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAiC/C,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,OAAO,CAAC,kBAAkB,CAYxB;CACL"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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 AIAgentConfigurationWidget_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AIAgentConfigurationWidget = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const common_1 = require("@theia/ai-core/lib/common");
|
|
22
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
const React = require("@theia/core/shared/react");
|
|
25
|
+
const ai_configuration_service_1 = require("./ai-configuration-service");
|
|
26
|
+
const language_model_renderer_1 = require("./language-model-renderer");
|
|
27
|
+
const language_model_alias_1 = require("@theia/ai-core/lib/common/language-model-alias");
|
|
28
|
+
const variable_configuration_widget_1 = require("./variable-configuration-widget");
|
|
29
|
+
const core_1 = require("@theia/core");
|
|
30
|
+
const template_settings_renderer_1 = require("./template-settings-renderer");
|
|
31
|
+
;
|
|
32
|
+
let AIAgentConfigurationWidget = AIAgentConfigurationWidget_1 = class AIAgentConfigurationWidget extends browser_1.ReactWidget {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.languageModelAliases = [];
|
|
36
|
+
this.isLoadingDetails = false;
|
|
37
|
+
this.toggleAgentEnabled = async () => {
|
|
38
|
+
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
39
|
+
if (!agent) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const enabled = this.agentService.isEnabled(agent.id);
|
|
43
|
+
if (enabled) {
|
|
44
|
+
await this.agentService.disableAgent(agent.id);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
await this.agentService.enableAgent(agent.id);
|
|
48
|
+
}
|
|
49
|
+
this.update();
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
init() {
|
|
53
|
+
this.id = AIAgentConfigurationWidget_1.ID;
|
|
54
|
+
this.title.label = AIAgentConfigurationWidget_1.LABEL;
|
|
55
|
+
this.title.closable = false;
|
|
56
|
+
this.languageModelRegistry.getLanguageModels().then(models => {
|
|
57
|
+
this.languageModels = models !== null && models !== void 0 ? models : [];
|
|
58
|
+
this.update();
|
|
59
|
+
});
|
|
60
|
+
this.languageModelAliasRegistry.ready.then(() => {
|
|
61
|
+
this.languageModelAliases = this.languageModelAliasRegistry.getAliases();
|
|
62
|
+
this.toDispose.push(this.languageModelAliasRegistry.onDidChange(() => {
|
|
63
|
+
this.languageModelAliases = this.languageModelAliasRegistry.getAliases();
|
|
64
|
+
this.update();
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
this.toDispose.push(this.languageModelRegistry.onChange(({ models }) => {
|
|
68
|
+
this.languageModelAliases = this.languageModelAliasRegistry.getAliases();
|
|
69
|
+
this.languageModels = models;
|
|
70
|
+
this.update();
|
|
71
|
+
}));
|
|
72
|
+
this.toDispose.push(this.promptService.onPromptsChange(() => this.updateParsedPromptParts()));
|
|
73
|
+
// Only call updateParsedPromptParts() as it already calls this.update() internally
|
|
74
|
+
this.toDispose.push(this.promptFragmentCustomizationService.onDidChangePromptFragmentCustomization(() => {
|
|
75
|
+
this.updateParsedPromptParts();
|
|
76
|
+
}));
|
|
77
|
+
// Only call updateParsedPromptParts() as it already calls this.update() internally
|
|
78
|
+
this.toDispose.push(this.aiSettingsService.onDidChange(() => {
|
|
79
|
+
this.updateParsedPromptParts();
|
|
80
|
+
}));
|
|
81
|
+
// Only call updateParsedPromptParts() as it already calls this.update() internally
|
|
82
|
+
this.toDispose.push(this.aiConfigurationSelectionService.onDidAgentChange(() => {
|
|
83
|
+
this.updateParsedPromptParts();
|
|
84
|
+
}));
|
|
85
|
+
this.agentService.onDidChangeAgents(() => this.update());
|
|
86
|
+
this.updateParsedPromptParts();
|
|
87
|
+
}
|
|
88
|
+
async updateParsedPromptParts() {
|
|
89
|
+
this.isLoadingDetails = true;
|
|
90
|
+
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
91
|
+
if (agent) {
|
|
92
|
+
this.parsedPromptParts = await this.parsePromptFragmentsForVariableAndFunction(agent);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.parsedPromptParts = undefined;
|
|
96
|
+
}
|
|
97
|
+
this.isLoadingDetails = false;
|
|
98
|
+
this.update();
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
return React.createElement("div", { className: 'ai-agent-configuration-main' },
|
|
102
|
+
React.createElement("div", { className: 'configuration-agents-list theia-Tree theia-TreeContainer', style: { width: '25%' } },
|
|
103
|
+
React.createElement("ul", null, this.agentService.getAllAgents().map(agent => {
|
|
104
|
+
var _a;
|
|
105
|
+
const isActive = ((_a = this.aiConfigurationSelectionService.getActiveAgent()) === null || _a === void 0 ? void 0 : _a.id) === agent.id;
|
|
106
|
+
const className = `theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode${isActive ? ' theia-mod-selected' : ''}`;
|
|
107
|
+
return React.createElement("li", { key: agent.id, className: className, onClick: () => this.setActiveAgent(agent) }, this.renderAgentName(agent));
|
|
108
|
+
})),
|
|
109
|
+
React.createElement("div", { className: 'configuration-agents-add' },
|
|
110
|
+
React.createElement("button", { style: { marginLeft: 0 }, className: 'theia-button main', onClick: () => this.addCustomAgent() }, core_1.nls.localize('theia/ai/core/agentConfiguration/addCustomAgent', 'Add Custom Agent')))),
|
|
111
|
+
React.createElement("div", { className: 'configuration-agent-panel preferences-editor-widget' }, this.renderAgentDetails()));
|
|
112
|
+
}
|
|
113
|
+
renderAgentName(agent) {
|
|
114
|
+
var _a;
|
|
115
|
+
const tagsSuffix = ((_a = agent.tags) === null || _a === void 0 ? void 0 : _a.length) ? React.createElement("span", null, agent.tags.map(tag => React.createElement("span", { key: tag, className: 'agent-tag' }, tag))) : '';
|
|
116
|
+
return React.createElement("span", null,
|
|
117
|
+
agent.name,
|
|
118
|
+
" ",
|
|
119
|
+
tagsSuffix);
|
|
120
|
+
}
|
|
121
|
+
renderAgentDetails() {
|
|
122
|
+
if (this.isLoadingDetails) {
|
|
123
|
+
return React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/loading', 'Loading...'));
|
|
124
|
+
}
|
|
125
|
+
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
126
|
+
if (!agent) {
|
|
127
|
+
return React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/selectAgentMessage', 'Please select an Agent first!'));
|
|
128
|
+
}
|
|
129
|
+
const enabled = this.agentService.isEnabled(agent.id);
|
|
130
|
+
if (!this.parsedPromptParts) {
|
|
131
|
+
this.updateParsedPromptParts();
|
|
132
|
+
return React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/loading', 'Loading...'));
|
|
133
|
+
}
|
|
134
|
+
const globalVariables = Array.from(new Set([...this.parsedPromptParts.globalVariables, ...agent.variables]));
|
|
135
|
+
const functions = Array.from(new Set([...this.parsedPromptParts.functions, ...agent.functions]));
|
|
136
|
+
return React.createElement("div", { key: agent.id, style: { display: 'flex', flexDirection: 'column', alignItems: 'flex-start' } },
|
|
137
|
+
React.createElement("div", { className: 'settings-section-title settings-section-category-title', style: { paddingLeft: 0, paddingBottom: 10 } },
|
|
138
|
+
this.renderAgentName(agent),
|
|
139
|
+
React.createElement("pre", { style: { fontSize: 'small', margin: 0 } },
|
|
140
|
+
"Id: ",
|
|
141
|
+
agent.id)),
|
|
142
|
+
React.createElement("div", { style: { paddingBottom: 10 } }, agent.description),
|
|
143
|
+
React.createElement("div", { style: { paddingBottom: 10 } },
|
|
144
|
+
React.createElement("label", null,
|
|
145
|
+
React.createElement("input", { type: "checkbox", checked: enabled, onChange: this.toggleAgentEnabled }),
|
|
146
|
+
core_1.nls.localize('theia/ai/core/agentConfiguration/enableAgent', 'Enable Agent'))),
|
|
147
|
+
React.createElement("div", { className: "settings-section-subcategory-title ai-settings-section-subcategory-title" }, core_1.nls.localize('theia/ai/core/agentConfiguration/promptTemplates', 'Prompt Templates')),
|
|
148
|
+
React.createElement("div", { className: "ai-templates" }, (() => {
|
|
149
|
+
const prompts = agent.prompts;
|
|
150
|
+
return prompts.length > 0 ? (prompts.map(prompt => (React.createElement("div", { key: agent.id + '.' + prompt.id },
|
|
151
|
+
React.createElement(template_settings_renderer_1.PromptVariantRenderer, { key: agent.id + '.' + prompt.id, agentId: agent.id, promptVariantSet: prompt, promptService: this.promptService }))))) : (React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/noDefaultTemplate', 'No default template available')));
|
|
152
|
+
})()),
|
|
153
|
+
React.createElement("div", { className: 'ai-lm-requirements' },
|
|
154
|
+
React.createElement(language_model_renderer_1.LanguageModelRenderer, { agent: agent, languageModels: this.languageModels, aiSettingsService: this.aiSettingsService, languageModelRegistry: this.languageModelRegistry, languageModelAliases: this.languageModelAliases })),
|
|
155
|
+
React.createElement("div", null,
|
|
156
|
+
React.createElement("span", null, "Used Global Variables:"),
|
|
157
|
+
React.createElement("ul", { className: 'variable-references' },
|
|
158
|
+
React.createElement(AgentGlobalVariables, { variables: globalVariables, showVariableConfigurationTab: this.showVariableConfigurationTab.bind(this) }))),
|
|
159
|
+
React.createElement("div", null,
|
|
160
|
+
React.createElement("span", null, "Used agent-specific Variables:"),
|
|
161
|
+
React.createElement("ul", { className: 'variable-references' },
|
|
162
|
+
React.createElement(AgentSpecificVariables, { promptVariables: this.parsedPromptParts.agentSpecificVariables, agent: agent }))),
|
|
163
|
+
React.createElement("div", null,
|
|
164
|
+
React.createElement("span", null, "Used Functions:"),
|
|
165
|
+
React.createElement("ul", { className: 'function-references' },
|
|
166
|
+
React.createElement(AgentFunctions, { functions: functions }))));
|
|
167
|
+
}
|
|
168
|
+
async parsePromptFragmentsForVariableAndFunction(agent) {
|
|
169
|
+
var _a, _b, _c, _d;
|
|
170
|
+
const result = { functions: [], globalVariables: [], agentSpecificVariables: [] };
|
|
171
|
+
const agentSettings = await this.aiSettingsService.getAgentSettings(agent.id);
|
|
172
|
+
const selectedVariants = (_a = agentSettings === null || agentSettings === void 0 ? void 0 : agentSettings.selectedVariants) !== null && _a !== void 0 ? _a : {};
|
|
173
|
+
for (const mainTemplate of agent.prompts) {
|
|
174
|
+
const promptId = (_c = (_b = selectedVariants[mainTemplate.id]) !== null && _b !== void 0 ? _b : mainTemplate.defaultVariant.id) !== null && _c !== void 0 ? _c : mainTemplate.id;
|
|
175
|
+
const promptToAnalyze = (_d = this.promptService.getRawPromptFragment(promptId)) === null || _d === void 0 ? void 0 : _d.template;
|
|
176
|
+
if (!promptToAnalyze) {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
this.extractVariablesAndFunctions(promptToAnalyze, result, agent);
|
|
180
|
+
}
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
extractVariablesAndFunctions(promptContent, result, agent) {
|
|
184
|
+
const variableMatches = (0, common_1.matchVariablesRegEx)(promptContent);
|
|
185
|
+
variableMatches.forEach(match => {
|
|
186
|
+
const variableId = match[1];
|
|
187
|
+
// skip comments
|
|
188
|
+
if (variableId.startsWith('!--')) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
// Extract base variable ID without arguments
|
|
192
|
+
const baseVariableId = variableId.split(':')[0];
|
|
193
|
+
if (this.variableService.hasVariable(baseVariableId) &&
|
|
194
|
+
agent.agentSpecificVariables.find(v => v.name === baseVariableId) === undefined) {
|
|
195
|
+
result.globalVariables.push(variableId);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
result.agentSpecificVariables.push(variableId);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
const functionMatches = [...promptContent.matchAll(common_1.PROMPT_FUNCTION_REGEX)];
|
|
202
|
+
functionMatches.forEach(match => {
|
|
203
|
+
const functionId = match[1];
|
|
204
|
+
result.functions.push(functionId);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
showVariableConfigurationTab() {
|
|
208
|
+
this.aiConfigurationSelectionService.selectConfigurationTab(variable_configuration_widget_1.AIVariableConfigurationWidget.ID);
|
|
209
|
+
}
|
|
210
|
+
async addCustomAgent() {
|
|
211
|
+
const locations = await this.promptFragmentCustomizationService.getCustomAgentsLocations();
|
|
212
|
+
// If only one location is available, use the direct approach
|
|
213
|
+
if (locations.length === 1) {
|
|
214
|
+
this.promptFragmentCustomizationService.openCustomAgentYaml(locations[0].uri);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
// Multiple locations - show quick picker
|
|
218
|
+
const quickPick = this.quickInputService.createQuickPick();
|
|
219
|
+
quickPick.title = core_1.nls.localize('theia/ai/ide/agentConfiguration/customAgentLocationQuickPick/title', 'Select Location for Custom Agents File');
|
|
220
|
+
quickPick.placeholder = core_1.nls.localize('theia/ai/ide/agentConfiguration/customAgentLocationQuickPick/placeholder', 'Choose where to create or open a custom agents file');
|
|
221
|
+
quickPick.items = locations.map(location => ({
|
|
222
|
+
label: location.uri.path.toString(),
|
|
223
|
+
description: location.exists
|
|
224
|
+
? core_1.nls.localize('theia/ai/ide/agentConfiguration/customAgentLocationQuickPick/openExistingFile', 'Open existing file')
|
|
225
|
+
: core_1.nls.localize('theia/ai/ide/agentConfiguration/customAgentLocationQuickPick/createNewFile', 'Create new file'),
|
|
226
|
+
location
|
|
227
|
+
}));
|
|
228
|
+
quickPick.onDidAccept(async () => {
|
|
229
|
+
const selectedItem = quickPick.selectedItems[0];
|
|
230
|
+
if (selectedItem && selectedItem.location) {
|
|
231
|
+
quickPick.dispose();
|
|
232
|
+
this.promptFragmentCustomizationService.openCustomAgentYaml(selectedItem.location.uri);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
quickPick.show();
|
|
236
|
+
}
|
|
237
|
+
setActiveAgent(agent) {
|
|
238
|
+
this.aiConfigurationSelectionService.setActiveAgent(agent);
|
|
239
|
+
this.updateParsedPromptParts();
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
exports.AIAgentConfigurationWidget = AIAgentConfigurationWidget;
|
|
243
|
+
AIAgentConfigurationWidget.ID = 'ai-agent-configuration-container-widget';
|
|
244
|
+
AIAgentConfigurationWidget.LABEL = core_1.nls.localize('theia/ai/core/agentConfiguration/label', 'Agents');
|
|
245
|
+
tslib_1.__decorate([
|
|
246
|
+
(0, inversify_1.inject)(common_1.AgentService),
|
|
247
|
+
tslib_1.__metadata("design:type", Object)
|
|
248
|
+
], AIAgentConfigurationWidget.prototype, "agentService", void 0);
|
|
249
|
+
tslib_1.__decorate([
|
|
250
|
+
(0, inversify_1.inject)(common_1.LanguageModelRegistry),
|
|
251
|
+
tslib_1.__metadata("design:type", Object)
|
|
252
|
+
], AIAgentConfigurationWidget.prototype, "languageModelRegistry", void 0);
|
|
253
|
+
tslib_1.__decorate([
|
|
254
|
+
(0, inversify_1.inject)(common_1.PromptFragmentCustomizationService),
|
|
255
|
+
tslib_1.__metadata("design:type", Object)
|
|
256
|
+
], AIAgentConfigurationWidget.prototype, "promptFragmentCustomizationService", void 0);
|
|
257
|
+
tslib_1.__decorate([
|
|
258
|
+
(0, inversify_1.inject)(language_model_alias_1.LanguageModelAliasRegistry),
|
|
259
|
+
tslib_1.__metadata("design:type", Object)
|
|
260
|
+
], AIAgentConfigurationWidget.prototype, "languageModelAliasRegistry", void 0);
|
|
261
|
+
tslib_1.__decorate([
|
|
262
|
+
(0, inversify_1.inject)(common_1.AISettingsService),
|
|
263
|
+
tslib_1.__metadata("design:type", Object)
|
|
264
|
+
], AIAgentConfigurationWidget.prototype, "aiSettingsService", void 0);
|
|
265
|
+
tslib_1.__decorate([
|
|
266
|
+
(0, inversify_1.inject)(ai_configuration_service_1.AIConfigurationSelectionService),
|
|
267
|
+
tslib_1.__metadata("design:type", ai_configuration_service_1.AIConfigurationSelectionService)
|
|
268
|
+
], AIAgentConfigurationWidget.prototype, "aiConfigurationSelectionService", void 0);
|
|
269
|
+
tslib_1.__decorate([
|
|
270
|
+
(0, inversify_1.inject)(common_1.AIVariableService),
|
|
271
|
+
tslib_1.__metadata("design:type", Object)
|
|
272
|
+
], AIAgentConfigurationWidget.prototype, "variableService", void 0);
|
|
273
|
+
tslib_1.__decorate([
|
|
274
|
+
(0, inversify_1.inject)(common_1.PromptService),
|
|
275
|
+
tslib_1.__metadata("design:type", Object)
|
|
276
|
+
], AIAgentConfigurationWidget.prototype, "promptService", void 0);
|
|
277
|
+
tslib_1.__decorate([
|
|
278
|
+
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
279
|
+
tslib_1.__metadata("design:type", Object)
|
|
280
|
+
], AIAgentConfigurationWidget.prototype, "quickInputService", void 0);
|
|
281
|
+
tslib_1.__decorate([
|
|
282
|
+
(0, inversify_1.postConstruct)(),
|
|
283
|
+
tslib_1.__metadata("design:type", Function),
|
|
284
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
285
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
286
|
+
], AIAgentConfigurationWidget.prototype, "init", null);
|
|
287
|
+
exports.AIAgentConfigurationWidget = AIAgentConfigurationWidget = AIAgentConfigurationWidget_1 = tslib_1.__decorate([
|
|
288
|
+
(0, inversify_1.injectable)()
|
|
289
|
+
], AIAgentConfigurationWidget);
|
|
290
|
+
const AgentGlobalVariables = ({ variables: globalVariables, showVariableConfigurationTab }) => {
|
|
291
|
+
if (globalVariables.length === 0) {
|
|
292
|
+
return React.createElement(React.Fragment, null, core_1.nls.localizeByDefault('None'));
|
|
293
|
+
}
|
|
294
|
+
return React.createElement(React.Fragment, null, globalVariables.map(variableId => React.createElement("li", { key: variableId, className: 'theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode theia-mod-selected' },
|
|
295
|
+
React.createElement("div", { key: variableId, onClick: () => { showVariableConfigurationTab(); }, className: 'variable-reference' },
|
|
296
|
+
React.createElement("span", null, variableId),
|
|
297
|
+
React.createElement("i", { className: (0, browser_1.codicon)('chevron-right') })))));
|
|
298
|
+
};
|
|
299
|
+
const AgentFunctions = ({ functions }) => {
|
|
300
|
+
if (functions.length === 0) {
|
|
301
|
+
return React.createElement(React.Fragment, null, core_1.nls.localizeByDefault('None'));
|
|
302
|
+
}
|
|
303
|
+
return React.createElement(React.Fragment, null, functions.map(functionId => React.createElement("li", { key: functionId, className: 'variable-reference' },
|
|
304
|
+
React.createElement("span", null, functionId))));
|
|
305
|
+
};
|
|
306
|
+
const AgentSpecificVariables = ({ promptVariables, agent }) => {
|
|
307
|
+
const agentDefinedVariablesName = agent.agentSpecificVariables.map(v => v.name);
|
|
308
|
+
const variables = Array.from(new Set([...promptVariables, ...agentDefinedVariablesName]));
|
|
309
|
+
if (variables.length === 0) {
|
|
310
|
+
return React.createElement(React.Fragment, null, core_1.nls.localizeByDefault('None'));
|
|
311
|
+
}
|
|
312
|
+
return React.createElement(React.Fragment, null, variables.map(variableId => React.createElement(AgentSpecificVariable, { key: variableId, variableId: variableId, agent: agent, promptVariables: promptVariables })));
|
|
313
|
+
};
|
|
314
|
+
const AgentSpecificVariable = ({ variableId, agent, promptVariables }) => {
|
|
315
|
+
const agentDefinedVariable = agent.agentSpecificVariables.find(v => v.name === variableId);
|
|
316
|
+
const undeclared = agentDefinedVariable === undefined;
|
|
317
|
+
const notUsed = !promptVariables.includes(variableId) && (agentDefinedVariable === null || agentDefinedVariable === void 0 ? void 0 : agentDefinedVariable.usedInPrompt) === true;
|
|
318
|
+
return React.createElement("li", { key: variableId },
|
|
319
|
+
React.createElement("div", null,
|
|
320
|
+
React.createElement("span", null, core_1.nls.localize('theia/ai/core/agentConfiguration/name', 'Name:')),
|
|
321
|
+
" ",
|
|
322
|
+
React.createElement("span", null, variableId)),
|
|
323
|
+
undeclared ? React.createElement("div", null,
|
|
324
|
+
React.createElement("span", null, core_1.nls.localize('theia/ai/core/agentConfiguration/undeclared', 'Undeclared'))) :
|
|
325
|
+
(React.createElement(React.Fragment, null,
|
|
326
|
+
React.createElement("div", null,
|
|
327
|
+
React.createElement("span", null, core_1.nls.localize('theia/ai/core/agentConfiguration/description', 'Description:')),
|
|
328
|
+
" ",
|
|
329
|
+
React.createElement("span", null, agentDefinedVariable.description)),
|
|
330
|
+
notUsed && React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/notUsedInPrompt', 'Not used in prompt')))),
|
|
331
|
+
React.createElement("hr", null));
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=agent-configuration-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-configuration-widget.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/agent-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,sDAYmC;AACnC,qDAAkF;AAElF,4DAAiF;AACjF,kDAAkD;AAClD,yEAA6E;AAC7E,uEAAkE;AAClE,yFAAgH;AAChH,mFAAgF;AAChF,sCAAkC;AAClC,6EAAqE;AAMpE,CAAC;AAGK,IAAM,0BAA0B,kCAAhC,MAAM,0BAA2B,SAAQ,qBAAW;IAApD;;QAiCO,yBAAoB,GAAyB,EAAE,CAAC;QAEhD,qBAAgB,GAAG,KAAK,CAAC;QA2Q3B,uBAAkB,GAAG,KAAK,IAAI,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,+BAA+B,CAAC,cAAc,EAAE,CAAC;YACpE,IAAI,CAAC,KAAK,EAAE,CAAC;gBACT,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACtD,IA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AApB,oBAAoB,CAAE,YAAY,MAAK,IAAI,CAAC;IACrG,OAAO,4BAAI,GAAG,EAAE,UAAU;QACtB;YAAK,kCAAO,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EAAE,OAAO,CAAC,CAAQ;;YAAC,kCAAO,UAAU,CAAQ,CAAM;QACjH,UAAU,CAAC,CAAC,CAAC;YAAK,kCAAO,UAAG,CAAC,QAAQ,CAAC,6CAA6C,EAAE,YAAY,CAAC,CAAQ,CAAM,CAAC,CAAC;YAC/G,CAAC;gBACG;oBAAK,kCAAO,UAAG,CAAC,QAAQ,CAAC,8CAA8C,EAAE,cAAc,CAAC,CAAQ;;oBAAC,kCAAO,oBAAoB,CAAC,WAAW,CAAQ,CAAM;gBACrJ,OAAO,IAAI,iCAAM,UAAG,CAAC,QAAQ,CAAC,kDAAkD,EAAE,oBAAoB,CAAC,CAAO,CAChH,CAAC;QACR,+BAAM,CACL,CAAC;AACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Agent } from '@theia/ai-core/lib/common';
|
|
2
|
+
import { Emitter } from '@theia/core';
|
|
3
|
+
export declare class AIConfigurationSelectionService {
|
|
4
|
+
protected activeAgent?: Agent;
|
|
5
|
+
protected selectedAliasId?: string;
|
|
6
|
+
protected readonly onDidSelectConfigurationEmitter: Emitter<string>;
|
|
7
|
+
onDidSelectConfiguration: import("@theia/core").Event<string>;
|
|
8
|
+
protected readonly onDidAgentChangeEmitter: Emitter<Agent | undefined>;
|
|
9
|
+
onDidAgentChange: import("@theia/core").Event<Agent | undefined>;
|
|
10
|
+
protected readonly onDidAliasChangeEmitter: Emitter<string | undefined>;
|
|
11
|
+
onDidAliasChange: import("@theia/core").Event<string | undefined>;
|
|
12
|
+
getActiveAgent(): Agent | undefined;
|
|
13
|
+
setActiveAgent(agent?: Agent): void;
|
|
14
|
+
getSelectedAliasId(): string | undefined;
|
|
15
|
+
setSelectedAliasId(aliasId?: string): void;
|
|
16
|
+
selectConfigurationTab(widgetId: string): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ai-configuration-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-configuration-service.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,qBACa,+BAA+B;IACxC,SAAS,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IAC9B,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAEnC,SAAS,CAAC,QAAQ,CAAC,+BAA+B,kBAAyB;IAC3E,wBAAwB,sCAA8C;IAEtE,SAAS,CAAC,QAAQ,CAAC,uBAAuB,6BAAoC;IAC9E,gBAAgB,iDAAsC;IAEtD,SAAS,CAAC,QAAQ,CAAC,uBAAuB,8BAAqC;IAC/E,gBAAgB,kDAAsC;IAE/C,cAAc,IAAI,KAAK,GAAG,SAAS;IAInC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;IAKnC,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAIxC,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAK1C,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAGxD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AIConfigurationSelectionService = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
+
let AIConfigurationSelectionService = class AIConfigurationSelectionService {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.onDidSelectConfigurationEmitter = new core_1.Emitter();
|
|
25
|
+
this.onDidSelectConfiguration = this.onDidSelectConfigurationEmitter.event;
|
|
26
|
+
this.onDidAgentChangeEmitter = new core_1.Emitter();
|
|
27
|
+
this.onDidAgentChange = this.onDidAgentChangeEmitter.event;
|
|
28
|
+
this.onDidAliasChangeEmitter = new core_1.Emitter();
|
|
29
|
+
this.onDidAliasChange = this.onDidAliasChangeEmitter.event;
|
|
30
|
+
}
|
|
31
|
+
getActiveAgent() {
|
|
32
|
+
return this.activeAgent;
|
|
33
|
+
}
|
|
34
|
+
setActiveAgent(agent) {
|
|
35
|
+
this.activeAgent = agent;
|
|
36
|
+
this.onDidAgentChangeEmitter.fire(agent);
|
|
37
|
+
}
|
|
38
|
+
getSelectedAliasId() {
|
|
39
|
+
return this.selectedAliasId;
|
|
40
|
+
}
|
|
41
|
+
setSelectedAliasId(aliasId) {
|
|
42
|
+
this.selectedAliasId = aliasId;
|
|
43
|
+
this.onDidAliasChangeEmitter.fire(aliasId);
|
|
44
|
+
}
|
|
45
|
+
selectConfigurationTab(widgetId) {
|
|
46
|
+
this.onDidSelectConfigurationEmitter.fire(widgetId);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.AIConfigurationSelectionService = AIConfigurationSelectionService;
|
|
50
|
+
exports.AIConfigurationSelectionService = AIConfigurationSelectionService = tslib_1.__decorate([
|
|
51
|
+
(0, inversify_1.injectable)()
|
|
52
|
+
], AIConfigurationSelectionService);
|
|
53
|
+
//# sourceMappingURL=ai-configuration-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-configuration-service.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-service.ts"],"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;;;;AAGhF,sCAAsC;AACtC,4DAA0D;AAGnD,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAArC;QAIgB,oCAA+B,GAAG,IAAI,cAAO,EAAU,CAAC;QAC3E,6BAAwB,GAAG,IAAI,CAAC,+BAA+B,CAAC,KAAK,CAAC;QAEnD,4BAAuB,GAAG,IAAI,cAAO,EAAqB,CAAC;QAC9E,qBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;QAEnC,4BAAuB,GAAG,IAAI,cAAO,EAAsB,CAAC;QAC/E,qBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;IAuB1D,CAAC;IArBU,cAAc;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAEM,cAAc,CAAC,KAAa;QAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAEM,kBAAkB;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAEM,kBAAkB,CAAC,OAAgB;QACtC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;QAC/B,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEM,sBAAsB,CAAC,QAAgB;QAC1C,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;CACJ,CAAA;AAlCY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAkC3C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command, CommandRegistry } from '@theia/core';
|
|
2
|
+
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
3
|
+
import { AIViewContribution } from '@theia/ai-core/lib/browser';
|
|
4
|
+
import { FrontendApplication } from '@theia/core/lib/browser';
|
|
5
|
+
import { AIConfigurationContainerWidget } from './ai-configuration-widget';
|
|
6
|
+
export declare const AI_CONFIGURATION_TOGGLE_COMMAND_ID = "aiConfiguration:toggle";
|
|
7
|
+
export declare const OPEN_AI_CONFIG_VIEW: Command;
|
|
8
|
+
export declare class AIAgentConfigurationViewContribution extends AIViewContribution<AIConfigurationContainerWidget> implements TabBarToolbarContribution {
|
|
9
|
+
constructor();
|
|
10
|
+
initializeLayout(_app: FrontendApplication): Promise<void>;
|
|
11
|
+
registerCommands(commands: CommandRegistry): void;
|
|
12
|
+
registerToolbarItems(registry: TabBarToolbarRegistry): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ai-configuration-view-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-configuration-view-contribution.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-view-contribution.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAO,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACjH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,eAAO,MAAM,kCAAkC,2BAA2B,CAAC;AAC3E,eAAO,MAAM,mBAAmB,SAG9B,CAAC;AAEH,qBACa,oCAAqC,SAAQ,kBAAkB,CAAC,8BAA8B,CAAE,YAAW,yBAAyB;;IAcvI,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAO1D,oBAAoB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;CAU9D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIAgentConfigurationViewContribution = exports.OPEN_AI_CONFIG_VIEW = exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// *****************************************************************************
|
|
6
|
+
// Copyright (C) 2024 EclipseSource GmbH.
|
|
7
|
+
//
|
|
8
|
+
// This program and the accompanying materials are made available under the
|
|
9
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
10
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
11
|
+
//
|
|
12
|
+
// This Source Code may also be made available under the following Secondary
|
|
13
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
14
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
15
|
+
// with the GNU Classpath Exception which is available at
|
|
16
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
17
|
+
//
|
|
18
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
19
|
+
// *****************************************************************************
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const browser_1 = require("@theia/ai-core/lib/browser");
|
|
22
|
+
const chat_view_widget_1 = require("@theia/ai-chat-ui/lib/browser/chat-view-widget");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
const ai_configuration_widget_1 = require("./ai-configuration-widget");
|
|
25
|
+
exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID = 'aiConfiguration:toggle';
|
|
26
|
+
exports.OPEN_AI_CONFIG_VIEW = core_1.Command.toLocalizedCommand({
|
|
27
|
+
id: 'aiConfiguration:open',
|
|
28
|
+
label: 'Open AI Configuration view',
|
|
29
|
+
});
|
|
30
|
+
let AIAgentConfigurationViewContribution = class AIAgentConfigurationViewContribution extends browser_1.AIViewContribution {
|
|
31
|
+
constructor() {
|
|
32
|
+
super({
|
|
33
|
+
widgetId: ai_configuration_widget_1.AIConfigurationContainerWidget.ID,
|
|
34
|
+
widgetName: ai_configuration_widget_1.AIConfigurationContainerWidget.LABEL,
|
|
35
|
+
defaultWidgetOptions: {
|
|
36
|
+
area: 'main',
|
|
37
|
+
rank: 100
|
|
38
|
+
},
|
|
39
|
+
toggleCommandId: exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async initializeLayout(_app) {
|
|
43
|
+
await this.openView();
|
|
44
|
+
}
|
|
45
|
+
registerCommands(commands) {
|
|
46
|
+
super.registerCommands(commands);
|
|
47
|
+
commands.registerCommand(exports.OPEN_AI_CONFIG_VIEW, {
|
|
48
|
+
execute: () => this.openView({ activate: true }),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
registerToolbarItems(registry) {
|
|
52
|
+
registry.registerItem({
|
|
53
|
+
id: 'chat-view.' + exports.OPEN_AI_CONFIG_VIEW.id,
|
|
54
|
+
command: exports.OPEN_AI_CONFIG_VIEW.id,
|
|
55
|
+
tooltip: core_1.nls.localize('theia/ai-ide/open-agent-settings-tooltip', 'Open Agent settings...'),
|
|
56
|
+
group: 'ai-settings',
|
|
57
|
+
priority: 2,
|
|
58
|
+
isVisible: widget => this.activationService.isActive && widget instanceof chat_view_widget_1.ChatViewWidget
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.AIAgentConfigurationViewContribution = AIAgentConfigurationViewContribution;
|
|
63
|
+
exports.AIAgentConfigurationViewContribution = AIAgentConfigurationViewContribution = tslib_1.__decorate([
|
|
64
|
+
(0, inversify_1.injectable)(),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
66
|
+
], AIAgentConfigurationViewContribution);
|
|
67
|
+
//# sourceMappingURL=ai-configuration-view-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-configuration-view-contribution.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-view-contribution.ts"],"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;AAChF,sCAA4D;AAE5D,wDAAgE;AAChE,qFAAgF;AAEhF,4DAA0D;AAC1D,uEAA2E;AAE9D,QAAA,kCAAkC,GAAG,wBAAwB,CAAC;AAC9D,QAAA,mBAAmB,GAAG,cAAO,CAAC,kBAAkB,CAAC;IAC1D,EAAE,EAAE,sBAAsB;IAC1B,KAAK,EAAE,4BAA4B;CACtC,CAAC,CAAC;AAGI,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,4BAAkD;IAExG;QACI,KAAK,CAAC;YACF,QAAQ,EAAE,wDAA8B,CAAC,EAAE;YAC3C,UAAU,EAAE,wDAA8B,CAAC,KAAK;YAChD,oBAAoB,EAAE;gBAClB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,GAAG;aACZ;YACD,eAAe,EAAE,0CAAkC;SACtD,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,IAAyB;QAC5C,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAEQ,gBAAgB,CAAC,QAAyB;QAC/C,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACjC,QAAQ,CAAC,eAAe,CAAC,2BAAmB,EAAE;YAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACnD,CAAC,CAAC;IACP,CAAC;IAED,oBAAoB,CAAC,QAA+B;QAChD,QAAQ,CAAC,YAAY,CAAC;YAClB,EAAE,EAAE,YAAY,GAAG,2BAAmB,CAAC,EAAE;YACzC,OAAO,EAAE,2BAAmB,CAAC,EAAE;YAC/B,OAAO,EAAE,UAAG,CAAC,QAAQ,CAAC,0CAA0C,EAAE,wBAAwB,CAAC;YAC3F,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,IAAI,MAAM,YAAY,iCAAc;SAC3F,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAnCY,oFAAoC;+CAApC,oCAAoC;IADhD,IAAA,sBAAU,GAAE;;GACA,oCAAoC,CAmChD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseWidget, DockPanel, WidgetManager } from '@theia/core/lib/browser';
|
|
2
|
+
import { TheiaDockPanel } from '@theia/core/lib/browser/shell/theia-dock-panel';
|
|
3
|
+
import { AIAgentConfigurationWidget } from './agent-configuration-widget';
|
|
4
|
+
import { AIVariableConfigurationWidget } from './variable-configuration-widget';
|
|
5
|
+
import { AIToolsConfigurationWidget } from './tools-configuration-widget';
|
|
6
|
+
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
7
|
+
import { AIMCPConfigurationWidget } from './mcp-configuration-widget';
|
|
8
|
+
import { AITokenUsageConfigurationWidget } from './token-usage-configuration-widget';
|
|
9
|
+
import { AIPromptFragmentsConfigurationWidget } from './prompt-fragments-configuration-widget';
|
|
10
|
+
import { ModelAliasesConfigurationWidget } from './model-aliases-configuration-widget';
|
|
11
|
+
export declare class AIConfigurationContainerWidget extends BaseWidget {
|
|
12
|
+
static readonly ID = "ai-configuration";
|
|
13
|
+
static readonly LABEL: string;
|
|
14
|
+
protected dockpanel: DockPanel;
|
|
15
|
+
protected readonly dockPanelFactory: TheiaDockPanel.Factory;
|
|
16
|
+
protected readonly widgetManager: WidgetManager;
|
|
17
|
+
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
18
|
+
protected agentsWidget: AIAgentConfigurationWidget;
|
|
19
|
+
protected variablesWidget: AIVariableConfigurationWidget;
|
|
20
|
+
protected mcpWidget: AIMCPConfigurationWidget;
|
|
21
|
+
protected tokenUsageWidget: AITokenUsageConfigurationWidget;
|
|
22
|
+
protected promptFragmentsWidget: AIPromptFragmentsConfigurationWidget;
|
|
23
|
+
protected toolsWidget: AIToolsConfigurationWidget;
|
|
24
|
+
protected modelAliasesWidget: ModelAliasesConfigurationWidget;
|
|
25
|
+
protected init(): void;
|
|
26
|
+
protected initUI(): Promise<void>;
|
|
27
|
+
protected initListeners(): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ai-configuration-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-configuration-widget.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAsB,SAAS,EAAE,aAAa,EAAE,MAAM,yBA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