@theia/ai-ide 1.59.0-next.62
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/README.md +48 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +27 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js +242 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts +13 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js +44 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +12 -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 +56 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +20 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js +89 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts +11 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.js +125 -0
- package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts +12 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js +57 -0
- package/lib/browser/ai-configuration/template-settings-renderer.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 +98 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.js.map +1 -0
- package/lib/browser/architect-agent.d.ts +13 -0
- package/lib/browser/architect-agent.d.ts.map +1 -0
- package/lib/browser/architect-agent.js +47 -0
- package/lib/browser/architect-agent.js.map +1 -0
- package/lib/browser/coder-agent.d.ts +13 -0
- package/lib/browser/coder-agent.d.ts.map +1 -0
- package/lib/browser/coder-agent.js +48 -0
- package/lib/browser/coder-agent.js.map +1 -0
- package/lib/browser/content-replacer.d.ts +46 -0
- package/lib/browser/content-replacer.d.ts.map +1 -0
- package/lib/browser/content-replacer.js +115 -0
- package/lib/browser/content-replacer.js.map +1 -0
- package/lib/browser/content-replacer.spec.d.ts +2 -0
- package/lib/browser/content-replacer.spec.d.ts.map +1 -0
- package/lib/browser/content-replacer.spec.js +86 -0
- package/lib/browser/content-replacer.spec.js.map +1 -0
- package/lib/browser/context-functions.d.ts +10 -0
- package/lib/browser/context-functions.d.ts.map +1 -0
- package/lib/browser/context-functions.js +82 -0
- package/lib/browser/context-functions.js.map +1 -0
- package/lib/browser/file-changeset-functions.d.ts +21 -0
- package/lib/browser/file-changeset-functions.d.ts.map +1 -0
- package/lib/browser/file-changeset-functions.js +189 -0
- package/lib/browser/file-changeset-functions.js.map +1 -0
- package/lib/browser/frontend-module.d.ts +4 -0
- package/lib/browser/frontend-module.d.ts.map +1 -0
- package/lib/browser/frontend-module.js +87 -0
- package/lib/browser/frontend-module.js.map +1 -0
- package/lib/browser/workspace-functions.d.ts +48 -0
- package/lib/browser/workspace-functions.d.ts.map +1 -0
- package/lib/browser/workspace-functions.js +306 -0
- package/lib/browser/workspace-functions.js.map +1 -0
- package/lib/browser/workspace-preferences.d.ts +5 -0
- package/lib/browser/workspace-preferences.d.ts.map +1 -0
- package/lib/browser/workspace-preferences.js +42 -0
- package/lib/browser/workspace-preferences.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 +29 -0
- package/lib/common/architect-prompt-template.js.map +1 -0
- package/lib/common/coder-replace-prompt-template.d.ts +5 -0
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -0
- package/lib/common/coder-replace-prompt-template.js +46 -0
- package/lib/common/coder-replace-prompt-template.js.map +1 -0
- package/lib/common/command-chat-agents.d.ts +37 -0
- package/lib/common/command-chat-agents.d.ts.map +1 -0
- package/lib/common/command-chat-agents.js +329 -0
- package/lib/common/command-chat-agents.js.map +1 -0
- package/lib/common/orchestrator-chat-agent.d.ts +24 -0
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -0
- package/lib/common/orchestrator-chat-agent.js +164 -0
- package/lib/common/orchestrator-chat-agent.js.map +1 -0
- package/lib/common/universal-chat-agent.d.ts +15 -0
- package/lib/common/universal-chat-agent.d.ts.map +1 -0
- package/lib/common/universal-chat-agent.js +107 -0
- package/lib/common/universal-chat-agent.js.map +1 -0
- package/lib/common/workspace-functions.d.ts +4 -0
- package/lib/common/workspace-functions.d.ts.map +1 -0
- package/lib/common/workspace-functions.js +22 -0
- package/lib/common/workspace-functions.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 +57 -0
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +330 -0
- package/src/browser/ai-configuration/ai-configuration-service.ts +43 -0
- package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +53 -0
- package/src/browser/ai-configuration/ai-configuration-widget.tsx +81 -0
- package/src/browser/ai-configuration/language-model-renderer.tsx +122 -0
- package/src/browser/ai-configuration/template-settings-renderer.tsx +128 -0
- package/src/browser/ai-configuration/variable-configuration-widget.tsx +108 -0
- package/src/browser/architect-agent.ts +41 -0
- package/src/browser/coder-agent.ts +42 -0
- package/src/browser/content-replacer.spec.ts +92 -0
- package/src/browser/content-replacer.ts +126 -0
- package/src/browser/context-functions.ts +78 -0
- package/src/browser/file-changeset-functions.ts +185 -0
- package/src/browser/frontend-module.ts +102 -0
- package/src/browser/style/index.css +127 -0
- package/src/browser/workspace-functions.ts +326 -0
- package/src/browser/workspace-preferences.ts +43 -0
- package/src/common/architect-prompt-template.ts +42 -0
- package/src/common/coder-replace-prompt-template.ts +49 -0
- package/src/common/command-chat-agents.ts +343 -0
- package/src/common/orchestrator-chat-agent.ts +169 -0
- package/src/common/universal-chat-agent.ts +102 -0
- package/src/common/workspace-functions.ts +18 -0
- package/src/package.spec.ts +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - AI IDE Agents EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/ai-ide` package consolidates various AI agents for use within IDEs like the Theia IDE.
|
|
16
|
+
|
|
17
|
+
## Agents
|
|
18
|
+
|
|
19
|
+
The package includes the following agents:
|
|
20
|
+
|
|
21
|
+
- **Orchestrator Chat Agent**: Analyzes user requests and determines which specific chat agent is best suited to handle each request. It seamlessly delegates tasks to the appropriate agent, ensuring users receive the most relevant assistance. It used as the default agent if no other agent is specified.
|
|
22
|
+
|
|
23
|
+
- **Universal Chat Agent**: Provides general programming support. It answers broad programming-related questions and serves as a fallback for generic inquiries, without specific access to the user context or workspace. This agent is used as the preferred fallback in case the default agent is not available.
|
|
24
|
+
|
|
25
|
+
- **Coder Agent**: Assists software developers with code-related tasks in the Theia IDE. It utilizes AI to provide recommendations and improvements, leveraging a suite of functions to interact with the workspace.
|
|
26
|
+
|
|
27
|
+
- **Command Chat Agent**: This agent helps users execute commands within the Theia IDE based on user requests. It identifies the correct command from Theia's command registry and facilitates its execution, providing users with a seamless command interaction experience.
|
|
28
|
+
|
|
29
|
+
- **Architect Agent**: The agent is able to inspect the current files of the workspace, including their content, to answer questions.
|
|
30
|
+
|
|
31
|
+
## Configuration View
|
|
32
|
+
|
|
33
|
+
The package provides a configuration view that enables you to adjust settings related to the behavior of AI agents. This view is implemented in the files located at packages/ai-ide/src/browser/ai-configuration and offers customization of default parameters, feature toggles, and additional preferences for the AI IDE.
|
|
34
|
+
|
|
35
|
+
## Additional Information
|
|
36
|
+
|
|
37
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
38
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
43
|
+
- [GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
44
|
+
|
|
45
|
+
## Trademark
|
|
46
|
+
|
|
47
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
48
|
+
<https://www.eclipse.org/theia>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Agent, AgentService, AISettingsService, AIVariableService, LanguageModel, LanguageModelRegistry, PromptCustomizationService, PromptService } from '@theia/ai-core/lib/common';
|
|
3
|
+
import { ReactWidget } from '@theia/core/lib/browser';
|
|
4
|
+
import * as React from '@theia/core/shared/react';
|
|
5
|
+
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
6
|
+
export declare class AIAgentConfigurationWidget extends ReactWidget {
|
|
7
|
+
static readonly ID = "ai-agent-configuration-container-widget";
|
|
8
|
+
static readonly LABEL: string;
|
|
9
|
+
protected readonly agentService: AgentService;
|
|
10
|
+
protected readonly languageModelRegistry: LanguageModelRegistry;
|
|
11
|
+
protected readonly promptCustomizationService: PromptCustomizationService;
|
|
12
|
+
protected readonly aiSettingsService: AISettingsService;
|
|
13
|
+
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
14
|
+
protected readonly variableService: AIVariableService;
|
|
15
|
+
protected promptService: PromptService;
|
|
16
|
+
protected languageModels: LanguageModel[] | undefined;
|
|
17
|
+
protected init(): void;
|
|
18
|
+
protected render(): React.ReactNode;
|
|
19
|
+
private renderAgentName;
|
|
20
|
+
private renderAgentDetails;
|
|
21
|
+
private parsePromptTemplatesForVariableAndFunction;
|
|
22
|
+
protected showVariableConfigurationTab(): void;
|
|
23
|
+
protected addCustomAgent(): void;
|
|
24
|
+
protected setActiveAgent(agent: Agent): void;
|
|
25
|
+
private toggleAgentEnabled;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=agent-configuration-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/agent-configuration-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EACH,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EAGrB,0BAA0B,EAC1B,aAAa,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAW,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAY7E,qBACa,0BAA2B,SAAQ,WAAW;IAEvD,MAAM,CAAC,QAAQ,CAAC,EAAE,6CAA6C;IAC/D,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAoE;IAGzF,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAG9C,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGhE,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAGpF,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAGtD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEvC,SAAS,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IAGtD,SAAS,CAAC,IAAI,IAAI,IAAI;IAqBtB,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IAyBnC,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,kBAAkB;IA6E1B,OAAO,CAAC,0CAA0C;IA6BlD,SAAS,CAAC,4BAA4B,IAAI,IAAI;IAI9C,SAAS,CAAC,cAAc,IAAI,IAAI;IAIhC,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,OAAO,CAAC,kBAAkB,CAYxB;CAEL"}
|
|
@@ -0,0 +1,242 @@
|
|
|
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 template_settings_renderer_1 = require("./template-settings-renderer");
|
|
28
|
+
const variable_configuration_widget_1 = require("./variable-configuration-widget");
|
|
29
|
+
const core_1 = require("@theia/core");
|
|
30
|
+
;
|
|
31
|
+
let AIAgentConfigurationWidget = AIAgentConfigurationWidget_1 = class AIAgentConfigurationWidget extends browser_1.ReactWidget {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this.toggleAgentEnabled = () => {
|
|
35
|
+
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
36
|
+
if (!agent) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const enabled = this.agentService.isEnabled(agent.id);
|
|
40
|
+
if (enabled) {
|
|
41
|
+
this.agentService.disableAgent(agent.id);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.agentService.enableAgent(agent.id);
|
|
45
|
+
}
|
|
46
|
+
this.update();
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
init() {
|
|
50
|
+
this.id = AIAgentConfigurationWidget_1.ID;
|
|
51
|
+
this.title.label = AIAgentConfigurationWidget_1.LABEL;
|
|
52
|
+
this.title.closable = false;
|
|
53
|
+
this.languageModelRegistry.getLanguageModels().then(models => {
|
|
54
|
+
this.languageModels = models !== null && models !== void 0 ? models : [];
|
|
55
|
+
this.update();
|
|
56
|
+
});
|
|
57
|
+
this.toDispose.push(this.languageModelRegistry.onChange(({ models }) => {
|
|
58
|
+
this.languageModels = models;
|
|
59
|
+
this.update();
|
|
60
|
+
}));
|
|
61
|
+
this.toDispose.push(this.promptCustomizationService.onDidChangePrompt(() => this.update()));
|
|
62
|
+
this.aiSettingsService.onDidChange(() => this.update());
|
|
63
|
+
this.aiConfigurationSelectionService.onDidAgentChange(() => this.update());
|
|
64
|
+
this.agentService.onDidChangeAgents(() => this.update());
|
|
65
|
+
this.update();
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return React.createElement("div", { className: 'ai-agent-configuration-main' },
|
|
69
|
+
React.createElement("div", { className: 'configuration-agents-list preferences-tree-widget theia-TreeContainer', style: { width: '25%' } },
|
|
70
|
+
React.createElement("ul", null, this.agentService.getAllAgents().map(agent => React.createElement("li", { key: agent.id, className: 'theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode', onClick: () => this.setActiveAgent(agent) }, this.renderAgentName(agent)))),
|
|
71
|
+
React.createElement("div", { className: 'configuration-agents-add' },
|
|
72
|
+
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')))),
|
|
73
|
+
React.createElement("div", { className: 'configuration-agent-panel preferences-editor-widget' }, this.renderAgentDetails()));
|
|
74
|
+
}
|
|
75
|
+
renderAgentName(agent) {
|
|
76
|
+
var _a;
|
|
77
|
+
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))) : '';
|
|
78
|
+
return React.createElement("span", null,
|
|
79
|
+
agent.name,
|
|
80
|
+
" ",
|
|
81
|
+
tagsSuffix);
|
|
82
|
+
}
|
|
83
|
+
renderAgentDetails() {
|
|
84
|
+
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
85
|
+
if (!agent) {
|
|
86
|
+
return React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/selectAgentMessage', 'Please select an Agent first!'));
|
|
87
|
+
}
|
|
88
|
+
const enabled = this.agentService.isEnabled(agent.id);
|
|
89
|
+
const parsedPromptParts = this.parsePromptTemplatesForVariableAndFunction(agent);
|
|
90
|
+
const globalVariables = Array.from(new Set([...parsedPromptParts.globalVariables, ...agent.variables]));
|
|
91
|
+
const functions = Array.from(new Set([...parsedPromptParts.functions, ...agent.functions]));
|
|
92
|
+
return React.createElement("div", { key: agent.id, style: { display: 'flex', flexDirection: 'column', alignItems: 'flex-start' } },
|
|
93
|
+
React.createElement("div", { className: 'settings-section-title settings-section-category-title', style: { paddingLeft: 0, paddingBottom: 10 } }, this.renderAgentName(agent)),
|
|
94
|
+
React.createElement("div", { style: { paddingBottom: 10 } }, agent.description),
|
|
95
|
+
React.createElement("div", { style: { paddingBottom: 10 } },
|
|
96
|
+
React.createElement("label", null,
|
|
97
|
+
React.createElement("input", { type: "checkbox", checked: enabled, onChange: this.toggleAgentEnabled }),
|
|
98
|
+
core_1.nls.localize('theia/ai/core/agentConfiguration/enableAgent', 'Enable Agent'))),
|
|
99
|
+
React.createElement("div", { className: "settings-section-subcategory-title ai-settings-section-subcategory-title" }, core_1.nls.localize('theia/ai/core/agentConfiguration/promptTemplates', 'Prompt Templates')),
|
|
100
|
+
React.createElement("div", { className: "ai-templates" }, (() => {
|
|
101
|
+
var _a;
|
|
102
|
+
const defaultTemplates = ((_a = agent.promptTemplates) === null || _a === void 0 ? void 0 : _a.filter(template => !template.variantOf)) || [];
|
|
103
|
+
return defaultTemplates.length > 0 ? (defaultTemplates.map(template => (React.createElement("div", { key: agent.id + '.' + template.id },
|
|
104
|
+
React.createElement(template_settings_renderer_1.TemplateRenderer, { key: agent.id + '.' + template.id, agentId: agent.id, template: template, promptService: this.promptService, aiSettingsService: this.aiSettingsService, promptCustomizationService: this.promptCustomizationService }))))) : (React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/noDefaultTemplate', 'No default template available')));
|
|
105
|
+
})()),
|
|
106
|
+
React.createElement("div", { className: 'ai-lm-requirements' },
|
|
107
|
+
React.createElement(language_model_renderer_1.LanguageModelRenderer, { agent: agent, languageModels: this.languageModels, aiSettingsService: this.aiSettingsService, languageModelRegistry: this.languageModelRegistry })),
|
|
108
|
+
React.createElement("div", null,
|
|
109
|
+
React.createElement("span", null, "Used Global Variables:"),
|
|
110
|
+
React.createElement("ul", { className: 'variable-references' },
|
|
111
|
+
React.createElement(AgentGlobalVariables, { variables: globalVariables, showVariableConfigurationTab: this.showVariableConfigurationTab.bind(this) }))),
|
|
112
|
+
React.createElement("div", null,
|
|
113
|
+
React.createElement("span", null, "Used agent-specific Variables:"),
|
|
114
|
+
React.createElement("ul", { className: 'variable-references' },
|
|
115
|
+
React.createElement(AgentSpecificVariables, { promptVariables: parsedPromptParts.agentSpecificVariables, agent: agent }))),
|
|
116
|
+
React.createElement("div", null,
|
|
117
|
+
React.createElement("span", null, "Used Functions:"),
|
|
118
|
+
React.createElement("ul", { className: 'function-references' },
|
|
119
|
+
React.createElement(AgentFunctions, { functions: functions }))));
|
|
120
|
+
}
|
|
121
|
+
parsePromptTemplatesForVariableAndFunction(agent) {
|
|
122
|
+
const promptTemplates = agent.promptTemplates;
|
|
123
|
+
const result = { functions: [], globalVariables: [], agentSpecificVariables: [] };
|
|
124
|
+
promptTemplates.forEach(template => {
|
|
125
|
+
var _a;
|
|
126
|
+
const storedPrompt = this.promptService.getUnresolvedPrompt(template.id);
|
|
127
|
+
const prompt = (_a = storedPrompt === null || storedPrompt === void 0 ? void 0 : storedPrompt.template) !== null && _a !== void 0 ? _a : template.template;
|
|
128
|
+
const variableMatches = (0, common_1.matchVariablesRegEx)(prompt);
|
|
129
|
+
variableMatches.forEach(match => {
|
|
130
|
+
const variableId = match[1];
|
|
131
|
+
// if the variable is part of the variable service and not part of the agent specific variables then it is a global variable
|
|
132
|
+
if (this.variableService.hasVariable(variableId) &&
|
|
133
|
+
agent.agentSpecificVariables.find(v => v.name === variableId) === undefined) {
|
|
134
|
+
result.globalVariables.push(variableId);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
result.agentSpecificVariables.push(variableId);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const functionMatches = [...prompt.matchAll(common_1.PROMPT_FUNCTION_REGEX)];
|
|
141
|
+
functionMatches.forEach(match => {
|
|
142
|
+
const functionId = match[1];
|
|
143
|
+
result.functions.push(functionId);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
showVariableConfigurationTab() {
|
|
149
|
+
this.aiConfigurationSelectionService.selectConfigurationTab(variable_configuration_widget_1.AIVariableConfigurationWidget.ID);
|
|
150
|
+
}
|
|
151
|
+
addCustomAgent() {
|
|
152
|
+
this.promptCustomizationService.openCustomAgentYaml();
|
|
153
|
+
}
|
|
154
|
+
setActiveAgent(agent) {
|
|
155
|
+
this.aiConfigurationSelectionService.setActiveAgent(agent);
|
|
156
|
+
this.update();
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
exports.AIAgentConfigurationWidget = AIAgentConfigurationWidget;
|
|
160
|
+
AIAgentConfigurationWidget.ID = 'ai-agent-configuration-container-widget';
|
|
161
|
+
AIAgentConfigurationWidget.LABEL = core_1.nls.localize('theia/ai/core/agentConfiguration/label', 'Agents');
|
|
162
|
+
tslib_1.__decorate([
|
|
163
|
+
(0, inversify_1.inject)(common_1.AgentService),
|
|
164
|
+
tslib_1.__metadata("design:type", Object)
|
|
165
|
+
], AIAgentConfigurationWidget.prototype, "agentService", void 0);
|
|
166
|
+
tslib_1.__decorate([
|
|
167
|
+
(0, inversify_1.inject)(common_1.LanguageModelRegistry),
|
|
168
|
+
tslib_1.__metadata("design:type", Object)
|
|
169
|
+
], AIAgentConfigurationWidget.prototype, "languageModelRegistry", void 0);
|
|
170
|
+
tslib_1.__decorate([
|
|
171
|
+
(0, inversify_1.inject)(common_1.PromptCustomizationService),
|
|
172
|
+
tslib_1.__metadata("design:type", Object)
|
|
173
|
+
], AIAgentConfigurationWidget.prototype, "promptCustomizationService", void 0);
|
|
174
|
+
tslib_1.__decorate([
|
|
175
|
+
(0, inversify_1.inject)(common_1.AISettingsService),
|
|
176
|
+
tslib_1.__metadata("design:type", Object)
|
|
177
|
+
], AIAgentConfigurationWidget.prototype, "aiSettingsService", void 0);
|
|
178
|
+
tslib_1.__decorate([
|
|
179
|
+
(0, inversify_1.inject)(ai_configuration_service_1.AIConfigurationSelectionService),
|
|
180
|
+
tslib_1.__metadata("design:type", ai_configuration_service_1.AIConfigurationSelectionService)
|
|
181
|
+
], AIAgentConfigurationWidget.prototype, "aiConfigurationSelectionService", void 0);
|
|
182
|
+
tslib_1.__decorate([
|
|
183
|
+
(0, inversify_1.inject)(common_1.AIVariableService),
|
|
184
|
+
tslib_1.__metadata("design:type", Object)
|
|
185
|
+
], AIAgentConfigurationWidget.prototype, "variableService", void 0);
|
|
186
|
+
tslib_1.__decorate([
|
|
187
|
+
(0, inversify_1.inject)(common_1.PromptService),
|
|
188
|
+
tslib_1.__metadata("design:type", Object)
|
|
189
|
+
], AIAgentConfigurationWidget.prototype, "promptService", void 0);
|
|
190
|
+
tslib_1.__decorate([
|
|
191
|
+
(0, inversify_1.postConstruct)(),
|
|
192
|
+
tslib_1.__metadata("design:type", Function),
|
|
193
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
194
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
195
|
+
], AIAgentConfigurationWidget.prototype, "init", null);
|
|
196
|
+
exports.AIAgentConfigurationWidget = AIAgentConfigurationWidget = AIAgentConfigurationWidget_1 = tslib_1.__decorate([
|
|
197
|
+
(0, inversify_1.injectable)()
|
|
198
|
+
], AIAgentConfigurationWidget);
|
|
199
|
+
const AgentGlobalVariables = ({ variables: globalVariables, showVariableConfigurationTab }) => {
|
|
200
|
+
if (globalVariables.length === 0) {
|
|
201
|
+
return React.createElement(React.Fragment, null, core_1.nls.localizeByDefault('None'));
|
|
202
|
+
}
|
|
203
|
+
return React.createElement(React.Fragment, null, globalVariables.map(variableId => React.createElement("li", { key: variableId, className: 'theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode theia-mod-selected' },
|
|
204
|
+
React.createElement("div", { key: variableId, onClick: () => { showVariableConfigurationTab(); }, className: 'variable-reference' },
|
|
205
|
+
React.createElement("span", null, variableId),
|
|
206
|
+
React.createElement("i", { className: (0, browser_1.codicon)('chevron-right') })))));
|
|
207
|
+
};
|
|
208
|
+
const AgentFunctions = ({ functions }) => {
|
|
209
|
+
if (functions.length === 0) {
|
|
210
|
+
return React.createElement(React.Fragment, null, core_1.nls.localizeByDefault('None'));
|
|
211
|
+
}
|
|
212
|
+
return React.createElement(React.Fragment, null, functions.map(functionId => React.createElement("li", { key: functionId, className: 'variable-reference' },
|
|
213
|
+
React.createElement("span", null, functionId))));
|
|
214
|
+
};
|
|
215
|
+
const AgentSpecificVariables = ({ promptVariables, agent }) => {
|
|
216
|
+
const agentDefinedVariablesName = agent.agentSpecificVariables.map(v => v.name);
|
|
217
|
+
const variables = Array.from(new Set([...promptVariables, ...agentDefinedVariablesName]));
|
|
218
|
+
if (variables.length === 0) {
|
|
219
|
+
return React.createElement(React.Fragment, null, core_1.nls.localizeByDefault('None'));
|
|
220
|
+
}
|
|
221
|
+
return React.createElement(React.Fragment, null, variables.map(variableId => React.createElement(AgentSpecifcVariable, { key: variableId, variableId: variableId, agent: agent, promptVariables: promptVariables })));
|
|
222
|
+
};
|
|
223
|
+
const AgentSpecifcVariable = ({ variableId, agent, promptVariables }) => {
|
|
224
|
+
const agentDefinedVariable = agent.agentSpecificVariables.find(v => v.name === variableId);
|
|
225
|
+
const undeclared = agentDefinedVariable === undefined;
|
|
226
|
+
const notUsed = !promptVariables.includes(variableId) && (agentDefinedVariable === null || agentDefinedVariable === void 0 ? void 0 : agentDefinedVariable.usedInPrompt) === true;
|
|
227
|
+
return React.createElement("li", { key: variableId },
|
|
228
|
+
React.createElement("div", null,
|
|
229
|
+
React.createElement("span", null, core_1.nls.localize('theia/ai/core/agentConfiguration/name', 'Name:')),
|
|
230
|
+
" ",
|
|
231
|
+
React.createElement("span", null, variableId)),
|
|
232
|
+
undeclared ? React.createElement("div", null,
|
|
233
|
+
React.createElement("span", null, core_1.nls.localize('theia/ai/core/agentConfiguration/undeclared', 'Undeclared'))) :
|
|
234
|
+
(React.createElement(React.Fragment, null,
|
|
235
|
+
React.createElement("div", null,
|
|
236
|
+
React.createElement("span", null, core_1.nls.localize('theia/ai/core/agentConfiguration/description', 'Description:')),
|
|
237
|
+
" ",
|
|
238
|
+
React.createElement("span", null, agentDefinedVariable.description)),
|
|
239
|
+
notUsed && React.createElement("div", null, core_1.nls.localize('theia/ai/core/agentConfiguration/notUsedInPrompt', 'Not used in prompt')))),
|
|
240
|
+
React.createElement("hr", null));
|
|
241
|
+
};
|
|
242
|
+
//# 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,sDAWmC;AACnC,qDAA+D;AAC/D,4DAAiF;AACjF,kDAAkD;AAClD,yEAA6E;AAC7E,uEAAkE;AAClE,6EAAgE;AAChE,mFAAgF;AAChF,sCAAkC;AAMjC,CAAC;AAGK,IAAM,0BAA0B,kCAAhC,MAAM,0BAA2B,SAAQ,qBAAW;IAApD;;QAuMK,uBAAkB,GAAG,GAA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AAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IAC3F,MAAM,UAAU,GAAG,oBAAoB,KAAK,SAAS,CAAC;IACtD,MAAM,OAAO,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAA,oBAAoB,aAApB,oBAAoB,uBAApB,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,13 @@
|
|
|
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 readonly onDidSelectConfigurationEmitter: Emitter<string>;
|
|
6
|
+
onDidSelectConfiguration: import("@theia/core").Event<string>;
|
|
7
|
+
protected readonly onDidAgentChangeEmitter: Emitter<Agent | undefined>;
|
|
8
|
+
onDidAgentChange: import("@theia/core").Event<string>;
|
|
9
|
+
getActiveAgent(): Agent | undefined;
|
|
10
|
+
setActiveAgent(agent?: Agent): void;
|
|
11
|
+
selectConfigurationTab(widgetId: string): void;
|
|
12
|
+
}
|
|
13
|
+
//# 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;IAE9B,SAAS,CAAC,QAAQ,CAAC,+BAA+B,kBAAyB;IAC3E,wBAAwB,sCAA8C;IAEtE,SAAS,CAAC,QAAQ,CAAC,uBAAuB,6BAAoC;IAC9E,gBAAgB,sCAA8C;IAEvD,cAAc,IAAI,KAAK,GAAG,SAAS;IAInC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;IAKnC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAGxD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.onDidSelectConfigurationEmitter.event;
|
|
28
|
+
}
|
|
29
|
+
getActiveAgent() {
|
|
30
|
+
return this.activeAgent;
|
|
31
|
+
}
|
|
32
|
+
setActiveAgent(agent) {
|
|
33
|
+
this.activeAgent = agent;
|
|
34
|
+
this.onDidAgentChangeEmitter.fire(agent);
|
|
35
|
+
}
|
|
36
|
+
selectConfigurationTab(widgetId) {
|
|
37
|
+
this.onDidSelectConfigurationEmitter.fire(widgetId);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.AIConfigurationSelectionService = AIConfigurationSelectionService;
|
|
41
|
+
exports.AIConfigurationSelectionService = AIConfigurationSelectionService = tslib_1.__decorate([
|
|
42
|
+
(0, inversify_1.injectable)()
|
|
43
|
+
], AIConfigurationSelectionService);
|
|
44
|
+
//# 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;QAGgB,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,+BAA+B,CAAC,KAAK,CAAC;IAclE,CAAC;IAZU,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,sBAAsB,CAAC,QAAgB;QAC1C,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;CACJ,CAAA;AArBY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAqB3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AIViewContribution } from '@theia/ai-core/lib/browser';
|
|
2
|
+
import { Command, CommandRegistry } from '@theia/core';
|
|
3
|
+
import { FrontendApplication } from '@theia/core/lib/browser';
|
|
4
|
+
import { AIConfigurationContainerWidget } from './ai-configuration-widget';
|
|
5
|
+
export declare const AI_CONFIGURATION_TOGGLE_COMMAND_ID = "aiConfiguration:toggle";
|
|
6
|
+
export declare const OPEN_AI_CONFIG_VIEW: Command;
|
|
7
|
+
export declare class AIAgentConfigurationViewContribution extends AIViewContribution<AIConfigurationContainerWidget> {
|
|
8
|
+
constructor();
|
|
9
|
+
initializeLayout(_app: FrontendApplication): Promise<void>;
|
|
10
|
+
registerCommands(commands: CommandRegistry): void;
|
|
11
|
+
}
|
|
12
|
+
//# 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,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvD,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,CAAC;;IAclG,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;CAM7D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 browser_1 = require("@theia/ai-core/lib/browser");
|
|
21
|
+
const core_1 = require("@theia/core");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const ai_configuration_widget_1 = require("./ai-configuration-widget");
|
|
24
|
+
exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID = 'aiConfiguration:toggle';
|
|
25
|
+
exports.OPEN_AI_CONFIG_VIEW = core_1.Command.toLocalizedCommand({
|
|
26
|
+
id: 'aiConfiguration:open',
|
|
27
|
+
label: 'Open AI Configuration view',
|
|
28
|
+
});
|
|
29
|
+
let AIAgentConfigurationViewContribution = class AIAgentConfigurationViewContribution extends browser_1.AIViewContribution {
|
|
30
|
+
constructor() {
|
|
31
|
+
super({
|
|
32
|
+
widgetId: ai_configuration_widget_1.AIConfigurationContainerWidget.ID,
|
|
33
|
+
widgetName: ai_configuration_widget_1.AIConfigurationContainerWidget.LABEL,
|
|
34
|
+
defaultWidgetOptions: {
|
|
35
|
+
area: 'main',
|
|
36
|
+
rank: 100
|
|
37
|
+
},
|
|
38
|
+
toggleCommandId: exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async initializeLayout(_app) {
|
|
42
|
+
await this.openView();
|
|
43
|
+
}
|
|
44
|
+
registerCommands(commands) {
|
|
45
|
+
super.registerCommands(commands);
|
|
46
|
+
commands.registerCommand(exports.OPEN_AI_CONFIG_VIEW, {
|
|
47
|
+
execute: () => this.openView({ activate: true }),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.AIAgentConfigurationViewContribution = AIAgentConfigurationViewContribution;
|
|
52
|
+
exports.AIAgentConfigurationViewContribution = AIAgentConfigurationViewContribution = tslib_1.__decorate([
|
|
53
|
+
(0, inversify_1.injectable)(),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
55
|
+
], AIAgentConfigurationViewContribution);
|
|
56
|
+
//# 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,wDAAgE;AAChE,sCAAuD;AAEvD,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;CACJ,CAAA;AAxBY,oFAAoC;+CAApC,oCAAoC;IADhD,IAAA,sBAAU,GAAE;;GACA,oCAAoC,CAwBhD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseWidget, DockPanel, WidgetManager } from '@theia/core/lib/browser';
|
|
2
|
+
import { TheiaDockPanel } from '@theia/core/lib/browser/shell/theia-dock-panel';
|
|
3
|
+
import '../../../src/browser/style/index.css';
|
|
4
|
+
import { AIAgentConfigurationWidget } from './agent-configuration-widget';
|
|
5
|
+
import { AIVariableConfigurationWidget } from './variable-configuration-widget';
|
|
6
|
+
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
7
|
+
export declare class AIConfigurationContainerWidget extends BaseWidget {
|
|
8
|
+
static readonly ID = "ai-configuration";
|
|
9
|
+
static readonly LABEL: string;
|
|
10
|
+
protected dockpanel: DockPanel;
|
|
11
|
+
protected readonly dockPanelFactory: TheiaDockPanel.Factory;
|
|
12
|
+
protected readonly widgetManager: WidgetManager;
|
|
13
|
+
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
14
|
+
protected agentsWidget: AIAgentConfigurationWidget;
|
|
15
|
+
protected variablesWidget: AIVariableConfigurationWidget;
|
|
16
|
+
protected init(): void;
|
|
17
|
+
protected initUI(): Promise<void>;
|
|
18
|
+
protected initListeners(): void;
|
|
19
|
+
}
|
|
20
|
+
//# 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,yBAAyB,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAEhF,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAG7E,qBACa,8BAA+B,SAAQ,UAAU;IAE1D,MAAM,CAAC,QAAQ,CAAC,EAAE,sBAAsB;IACxC,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAqF;IAC1G,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAG/B,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,cAAc,CAAC,OAAO,CAAC;IAE5D,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEhD,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAEpF,SAAS,CAAC,YAAY,EAAE,0BAA0B,CAAC;IACnD,SAAS,CAAC,eAAe,EAAE,6BAA6B,CAAC;IAGzD,SAAS,CAAC,IAAI,IAAI,IAAI;cAUN,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAkBvC,SAAS,CAAC,aAAa,IAAI,IAAI;CASlC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 AIConfigurationContainerWidget_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AIConfigurationContainerWidget = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const theia_dock_panel_1 = require("@theia/core/lib/browser/shell/theia-dock-panel");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
require("../../../src/browser/style/index.css");
|
|
25
|
+
const agent_configuration_widget_1 = require("./agent-configuration-widget");
|
|
26
|
+
const variable_configuration_widget_1 = require("./variable-configuration-widget");
|
|
27
|
+
const ai_configuration_service_1 = require("./ai-configuration-service");
|
|
28
|
+
const core_1 = require("@theia/core");
|
|
29
|
+
let AIConfigurationContainerWidget = AIConfigurationContainerWidget_1 = class AIConfigurationContainerWidget extends browser_1.BaseWidget {
|
|
30
|
+
init() {
|
|
31
|
+
this.id = AIConfigurationContainerWidget_1.ID;
|
|
32
|
+
this.title.label = AIConfigurationContainerWidget_1.LABEL;
|
|
33
|
+
this.title.closable = true;
|
|
34
|
+
this.addClass('theia-settings-container');
|
|
35
|
+
this.title.iconClass = (0, browser_1.codicon)('hubot');
|
|
36
|
+
this.initUI();
|
|
37
|
+
this.initListeners();
|
|
38
|
+
}
|
|
39
|
+
async initUI() {
|
|
40
|
+
const layout = (this.layout = new browser_1.BoxLayout({ direction: 'top-to-bottom', spacing: 0 }));
|
|
41
|
+
this.dockpanel = this.dockPanelFactory({
|
|
42
|
+
mode: 'multiple-document',
|
|
43
|
+
spacing: 0
|
|
44
|
+
});
|
|
45
|
+
browser_1.BoxLayout.setStretch(this.dockpanel, 1);
|
|
46
|
+
layout.addWidget(this.dockpanel);
|
|
47
|
+
this.dockpanel.addClass('ai-configuration-widget');
|
|
48
|
+
this.agentsWidget = await this.widgetManager.getOrCreateWidget(agent_configuration_widget_1.AIAgentConfigurationWidget.ID);
|
|
49
|
+
this.variablesWidget = await this.widgetManager.getOrCreateWidget(variable_configuration_widget_1.AIVariableConfigurationWidget.ID);
|
|
50
|
+
this.dockpanel.addWidget(this.agentsWidget);
|
|
51
|
+
this.dockpanel.addWidget(this.variablesWidget);
|
|
52
|
+
this.update();
|
|
53
|
+
}
|
|
54
|
+
initListeners() {
|
|
55
|
+
this.aiConfigurationSelectionService.onDidSelectConfiguration(widgetId => {
|
|
56
|
+
if (widgetId === agent_configuration_widget_1.AIAgentConfigurationWidget.ID) {
|
|
57
|
+
this.dockpanel.activateWidget(this.agentsWidget);
|
|
58
|
+
}
|
|
59
|
+
else if (widgetId === variable_configuration_widget_1.AIVariableConfigurationWidget.ID) {
|
|
60
|
+
this.dockpanel.activateWidget(this.variablesWidget);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.AIConfigurationContainerWidget = AIConfigurationContainerWidget;
|
|
66
|
+
AIConfigurationContainerWidget.ID = 'ai-configuration';
|
|
67
|
+
AIConfigurationContainerWidget.LABEL = core_1.nls.localize('theia/ai/core/aiConfiguration/label', '✨ AI Configuration [Alpha]');
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, inversify_1.inject)(theia_dock_panel_1.TheiaDockPanel.Factory),
|
|
70
|
+
tslib_1.__metadata("design:type", Function)
|
|
71
|
+
], AIConfigurationContainerWidget.prototype, "dockPanelFactory", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, inversify_1.inject)(browser_1.WidgetManager),
|
|
74
|
+
tslib_1.__metadata("design:type", browser_1.WidgetManager)
|
|
75
|
+
], AIConfigurationContainerWidget.prototype, "widgetManager", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, inversify_1.inject)(ai_configuration_service_1.AIConfigurationSelectionService),
|
|
78
|
+
tslib_1.__metadata("design:type", ai_configuration_service_1.AIConfigurationSelectionService)
|
|
79
|
+
], AIConfigurationContainerWidget.prototype, "aiConfigurationSelectionService", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, inversify_1.postConstruct)(),
|
|
82
|
+
tslib_1.__metadata("design:type", Function),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
84
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
85
|
+
], AIConfigurationContainerWidget.prototype, "init", null);
|
|
86
|
+
exports.AIConfigurationContainerWidget = AIConfigurationContainerWidget = AIConfigurationContainerWidget_1 = tslib_1.__decorate([
|
|
87
|
+
(0, inversify_1.injectable)()
|
|
88
|
+
], AIConfigurationContainerWidget);
|
|
89
|
+
//# sourceMappingURL=ai-configuration-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-configuration-widget.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/ai-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,qDAAmG;AACnG,qFAAgF;AAChF,4DAAiF;AACjF,gDAA8C;AAC9C,6EAA0E;AAC1E,mFAAgF;AAChF,yEAA6E;AAC7E,sCAAkC;AAG3B,IAAM,8BAA8B,sCAApC,MAAM,8BAA+B,SAAQ,oBAAU;IAiBhD,IAAI;QACV,I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