@theia/ai-core 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/data/prompttemplate.tmLanguage.json +52 -0
- package/lib/browser/ai-activation-service.d.ts +17 -0
- package/lib/browser/ai-activation-service.d.ts.map +1 -0
- package/lib/browser/ai-activation-service.js +63 -0
- package/lib/browser/ai-activation-service.js.map +1 -0
- package/lib/browser/ai-command-handler-factory.d.ts +4 -0
- package/lib/browser/ai-command-handler-factory.d.ts.map +1 -0
- package/lib/browser/ai-command-handler-factory.js +20 -0
- package/lib/browser/ai-command-handler-factory.js.map +1 -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 +231 -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 +41 -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 +88 -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/template-settings-renderer.d.ts +11 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js +33 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +20 -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-core-frontend-application-contribution.d.ts +8 -0
- package/lib/browser/ai-core-frontend-application-contribution.d.ts.map +1 -0
- package/lib/browser/ai-core-frontend-application-contribution.js +46 -0
- package/lib/browser/ai-core-frontend-application-contribution.js.map +1 -0
- package/lib/browser/ai-core-frontend-module.d.ts +4 -0
- package/lib/browser/ai-core-frontend-module.d.ts.map +1 -0
- package/lib/browser/ai-core-frontend-module.js +122 -0
- package/lib/browser/ai-core-frontend-module.js.map +1 -0
- package/lib/browser/ai-core-preferences.d.ts +14 -0
- package/lib/browser/ai-core-preferences.d.ts.map +1 -0
- package/lib/browser/ai-core-preferences.js +69 -0
- package/lib/browser/ai-core-preferences.js.map +1 -0
- package/lib/browser/ai-settings-service.d.ts +14 -0
- package/lib/browser/ai-settings-service.d.ts.map +1 -0
- package/lib/browser/ai-settings-service.js +56 -0
- package/lib/browser/ai-settings-service.js.map +1 -0
- package/lib/browser/ai-view-contribution.d.ts +14 -0
- package/lib/browser/ai-view-contribution.d.ts.map +1 -0
- package/lib/browser/ai-view-contribution.js +71 -0
- package/lib/browser/ai-view-contribution.js.map +1 -0
- package/lib/browser/frontend-language-model-registry.d.ts +39 -0
- package/lib/browser/frontend-language-model-registry.d.ts.map +1 -0
- package/lib/browser/frontend-language-model-registry.js +321 -0
- package/lib/browser/frontend-language-model-registry.js.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.d.ts +31 -0
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.js +194 -0
- package/lib/browser/frontend-prompt-customization-service.js.map +1 -0
- package/lib/browser/frontend-variable-service.d.ts +6 -0
- package/lib/browser/frontend-variable-service.d.ts.map +1 -0
- package/lib/browser/frontend-variable-service.js +31 -0
- package/lib/browser/frontend-variable-service.js.map +1 -0
- package/lib/browser/index.d.ts +11 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +29 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/prompttemplate-contribution.d.ts +28 -0
- package/lib/browser/prompttemplate-contribution.d.ts.map +1 -0
- package/lib/browser/prompttemplate-contribution.js +207 -0
- package/lib/browser/prompttemplate-contribution.js.map +1 -0
- package/lib/browser/theia-variable-contribution.d.ts +13 -0
- package/lib/browser/theia-variable-contribution.d.ts.map +1 -0
- package/lib/browser/theia-variable-contribution.js +64 -0
- package/lib/browser/theia-variable-contribution.js.map +1 -0
- package/lib/common/agent-service.d.ts +48 -0
- package/lib/common/agent-service.d.ts.map +1 -0
- package/lib/common/agent-service.js +88 -0
- package/lib/common/agent-service.js.map +1 -0
- package/lib/common/agent.d.ts +45 -0
- package/lib/common/agent.d.ts.map +1 -0
- package/lib/common/agent.js +20 -0
- package/lib/common/agent.js.map +1 -0
- package/lib/common/agents-variable-contribution.d.ts +19 -0
- package/lib/common/agents-variable-contribution.d.ts.map +1 -0
- package/lib/common/agents-variable-contribution.js +56 -0
- package/lib/common/agents-variable-contribution.js.map +1 -0
- package/lib/common/communication-recording-service.d.ts +23 -0
- package/lib/common/communication-recording-service.d.ts.map +1 -0
- package/lib/common/communication-recording-service.js +20 -0
- package/lib/common/communication-recording-service.js.map +1 -0
- package/lib/common/index.d.ts +16 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +34 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/language-model-delegate.d.ts +24 -0
- package/lib/common/language-model-delegate.d.ts.map +1 -0
- package/lib/common/language-model-delegate.js +26 -0
- package/lib/common/language-model-delegate.js.map +1 -0
- package/lib/common/language-model-util.d.ts +5 -0
- package/lib/common/language-model-util.d.ts.map +1 -0
- package/lib/common/language-model-util.js +75 -0
- package/lib/common/language-model-util.js.map +1 -0
- package/lib/common/language-model.d.ts +137 -0
- package/lib/common/language-model.d.ts.map +1 -0
- package/lib/common/language-model.js +142 -0
- package/lib/common/language-model.js.map +1 -0
- package/lib/common/language-model.spec.d.ts +2 -0
- package/lib/common/language-model.spec.d.ts.map +1 -0
- package/lib/common/language-model.spec.js +62 -0
- package/lib/common/language-model.spec.js.map +1 -0
- package/lib/common/prompt-service-util.d.ts +5 -0
- package/lib/common/prompt-service-util.d.ts.map +1 -0
- package/lib/common/prompt-service-util.js +23 -0
- package/lib/common/prompt-service-util.js.map +1 -0
- package/lib/common/prompt-service.d.ts +101 -0
- package/lib/common/prompt-service.d.ts.map +1 -0
- package/lib/common/prompt-service.js +139 -0
- package/lib/common/prompt-service.js.map +1 -0
- package/lib/common/prompt-service.spec.d.ts +2 -0
- package/lib/common/prompt-service.spec.d.ts.map +1 -0
- package/lib/common/prompt-service.spec.js +86 -0
- package/lib/common/prompt-service.spec.js.map +1 -0
- package/lib/common/protocol.d.ts +7 -0
- package/lib/common/protocol.d.ts.map +1 -0
- package/lib/common/protocol.js +20 -0
- package/lib/common/protocol.js.map +1 -0
- package/lib/common/settings-service.d.ts +18 -0
- package/lib/common/settings-service.d.ts.map +1 -0
- package/lib/common/settings-service.js +5 -0
- package/lib/common/settings-service.js.map +1 -0
- package/lib/common/today-variable-contribution.d.ts +17 -0
- package/lib/common/today-variable-contribution.d.ts.map +1 -0
- package/lib/common/today-variable-contribution.js +48 -0
- package/lib/common/today-variable-contribution.js.map +1 -0
- package/lib/common/tomorrow-variable-contribution.d.ts +17 -0
- package/lib/common/tomorrow-variable-contribution.d.ts.map +1 -0
- package/lib/common/tomorrow-variable-contribution.js +48 -0
- package/lib/common/tomorrow-variable-contribution.js.map +1 -0
- package/lib/common/tool-invocation-registry.d.ts +23 -0
- package/lib/common/tool-invocation-registry.d.ts.map +1 -0
- package/lib/common/tool-invocation-registry.js +72 -0
- package/lib/common/tool-invocation-registry.js.map +1 -0
- package/lib/common/variable-service.d.ts +70 -0
- package/lib/common/variable-service.d.ts.map +1 -0
- package/lib/common/variable-service.js +122 -0
- package/lib/common/variable-service.js.map +1 -0
- package/lib/node/ai-core-backend-module.d.ts +4 -0
- package/lib/node/ai-core-backend-module.d.ts.map +1 -0
- package/lib/node/ai-core-backend-module.js +47 -0
- package/lib/node/ai-core-backend-module.js.map +1 -0
- package/lib/node/backend-language-model-registry.d.ts +12 -0
- package/lib/node/backend-language-model-registry.d.ts.map +1 -0
- package/lib/node/backend-language-model-registry.js +61 -0
- package/lib/node/backend-language-model-registry.js.map +1 -0
- package/lib/node/language-model-frontend-delegate.d.ts +18 -0
- package/lib/node/language-model-frontend-delegate.d.ts.map +1 -0
- package/lib/node/language-model-frontend-delegate.js +100 -0
- package/lib/node/language-model-frontend-delegate.js.map +1 -0
- package/package.json +59 -0
- package/src/browser/ai-activation-service.ts +56 -0
- package/src/browser/ai-command-handler-factory.ts +20 -0
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +299 -0
- package/src/browser/ai-configuration/ai-configuration-service.ts +43 -0
- package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +54 -0
- package/src/browser/ai-configuration/ai-configuration-widget.tsx +80 -0
- package/src/browser/ai-configuration/language-model-renderer.tsx +113 -0
- package/src/browser/ai-configuration/template-settings-renderer.tsx +39 -0
- package/src/browser/ai-configuration/variable-configuration-widget.tsx +110 -0
- package/src/browser/ai-core-frontend-application-contribution.ts +40 -0
- package/src/browser/ai-core-frontend-module.ts +161 -0
- package/src/browser/ai-core-preferences.ts +76 -0
- package/src/browser/ai-settings-service.ts +50 -0
- package/src/browser/ai-view-contribution.ts +77 -0
- package/src/browser/frontend-language-model-registry.ts +405 -0
- package/src/browser/frontend-prompt-customization-service.ts +197 -0
- package/src/browser/frontend-variable-service.ts +26 -0
- package/src/browser/index.ts +26 -0
- package/src/browser/prompttemplate-contribution.ts +250 -0
- package/src/browser/style/index.css +90 -0
- package/src/browser/theia-variable-contribution.ts +58 -0
- package/src/common/agent-service.ts +108 -0
- package/src/common/agent.ts +70 -0
- package/src/common/agents-variable-contribution.ts +64 -0
- package/src/common/communication-recording-service.ts +44 -0
- package/src/common/index.ts +30 -0
- package/src/common/language-model-delegate.ts +45 -0
- package/src/common/language-model-util.ts +67 -0
- package/src/common/language-model.spec.ts +86 -0
- package/src/common/language-model.ts +237 -0
- package/src/common/prompt-service-util.ts +21 -0
- package/src/common/prompt-service.spec.ts +98 -0
- package/src/common/prompt-service.ts +213 -0
- package/src/common/protocol.ts +23 -0
- package/src/common/settings-service.ts +33 -0
- package/src/common/today-variable-contribution.ts +67 -0
- package/src/common/tomorrow-variable-contribution.ts +66 -0
- package/src/common/tool-invocation-registry.ts +79 -0
- package/src/common/variable-service.ts +177 -0
- package/src/node/ai-core-backend-module.ts +83 -0
- package/src/node/backend-language-model-registry.ts +59 -0
- package/src/node/language-model-frontend-delegate.ts +116 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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 Core EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/ai-core` extension serves as the basis of all AI integration in Theia.
|
|
16
|
+
It manages the integration of language models and provides core concepts like agents, prompts and AI variables.
|
|
17
|
+
|
|
18
|
+
## Additional Information
|
|
19
|
+
|
|
20
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
+
|
|
28
|
+
## Trademark
|
|
29
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
+
https://www.eclipse.org/theia
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeName": "source.prompttemplate",
|
|
3
|
+
"patterns": [
|
|
4
|
+
{
|
|
5
|
+
"name": "variable.other.prompttemplate",
|
|
6
|
+
"begin": "{{",
|
|
7
|
+
"beginCaptures": {
|
|
8
|
+
"0": {
|
|
9
|
+
"name": "punctuation.definition.brace.begin"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"end": "}}",
|
|
13
|
+
"endCaptures": {
|
|
14
|
+
"0": {
|
|
15
|
+
"name": "punctuation.definition.brace.end"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"patterns": [
|
|
19
|
+
{
|
|
20
|
+
"name": "keyword.control",
|
|
21
|
+
"match": "[a-zA-Z_][a-zA-Z0-9_]*"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "support.function.prompttemplate",
|
|
27
|
+
"begin": "~{",
|
|
28
|
+
"beginCaptures": {
|
|
29
|
+
"0": {
|
|
30
|
+
"name": "punctuation.definition.brace.begin"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"end": "}",
|
|
34
|
+
"endCaptures": {
|
|
35
|
+
"0": {
|
|
36
|
+
"name": "punctuation.definition.brace.end"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"patterns": [
|
|
40
|
+
{
|
|
41
|
+
"name": "keyword.control",
|
|
42
|
+
"match": "[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"repository": {},
|
|
48
|
+
"name": "PromptTemplate",
|
|
49
|
+
"fileTypes": [
|
|
50
|
+
".prompttemplate"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FrontendApplicationContribution, PreferenceService } from '@theia/core/lib/browser';
|
|
2
|
+
import { Emitter, MaybePromise, Event } from '@theia/core';
|
|
3
|
+
import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
|
|
4
|
+
/**
|
|
5
|
+
* Context key for the experimental AI feature. It is set to `true` if the feature is enabled.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXPERIMENTAL_AI_CONTEXT_KEY = "ai-features.AiEnable.enableAI";
|
|
8
|
+
export declare class AIActivationService implements FrontendApplicationContribution {
|
|
9
|
+
protected readonly contextKeyService: ContextKeyService;
|
|
10
|
+
protected preferenceService: PreferenceService;
|
|
11
|
+
protected isExperimentalEnabledKey: ContextKey<boolean>;
|
|
12
|
+
protected onDidChangeExperimental: Emitter<boolean>;
|
|
13
|
+
get onDidChangeActiveStatus(): Event<boolean>;
|
|
14
|
+
get isActive(): boolean;
|
|
15
|
+
initialize(): MaybePromise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ai-activation-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-activation-service.d.ts","sourceRoot":"","sources":["../../src/browser/ai-activation-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAG,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAG5F;;GAEG;AAEH,eAAO,MAAM,2BAA2B,kCAAsC,CAAC;AAE/E,qBACa,mBAAoB,YAAW,+BAA+B;IAEvE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,wBAAwB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAExD,SAAS,CAAC,uBAAuB,mBAA0B;IAC3D,IAAI,uBAAuB,IAAI,KAAK,CAAC,OAAO,CAAC,CAE5C;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,UAAU,IAAI,YAAY,CAAC,IAAI,CAAC;CASnC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIActivationService = exports.EXPERIMENTAL_AI_CONTEXT_KEY = 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 inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const core_1 = require("@theia/core");
|
|
23
|
+
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
24
|
+
const ai_core_preferences_1 = require("./ai-core-preferences");
|
|
25
|
+
/**
|
|
26
|
+
* Context key for the experimental AI feature. It is set to `true` if the feature is enabled.
|
|
27
|
+
*/
|
|
28
|
+
// We reuse the enablement preference for the context key
|
|
29
|
+
exports.EXPERIMENTAL_AI_CONTEXT_KEY = ai_core_preferences_1.PREFERENCE_NAME_ENABLE_EXPERIMENTAL;
|
|
30
|
+
let AIActivationService = class AIActivationService {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.onDidChangeExperimental = new core_1.Emitter();
|
|
33
|
+
}
|
|
34
|
+
get onDidChangeActiveStatus() {
|
|
35
|
+
return this.onDidChangeExperimental.event;
|
|
36
|
+
}
|
|
37
|
+
get isActive() {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_a = this.isExperimentalEnabledKey.get()) !== null && _a !== void 0 ? _a : false;
|
|
40
|
+
}
|
|
41
|
+
initialize() {
|
|
42
|
+
this.isExperimentalEnabledKey = this.contextKeyService.createKey(exports.EXPERIMENTAL_AI_CONTEXT_KEY, false);
|
|
43
|
+
this.preferenceService.onPreferenceChanged(e => {
|
|
44
|
+
if (e.preferenceName === ai_core_preferences_1.PREFERENCE_NAME_ENABLE_EXPERIMENTAL) {
|
|
45
|
+
this.isExperimentalEnabledKey.set(e.newValue);
|
|
46
|
+
this.onDidChangeExperimental.fire(e.newValue);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.AIActivationService = AIActivationService;
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
54
|
+
tslib_1.__metadata("design:type", Object)
|
|
55
|
+
], AIActivationService.prototype, "contextKeyService", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, inversify_1.inject)(browser_1.PreferenceService),
|
|
58
|
+
tslib_1.__metadata("design:type", Object)
|
|
59
|
+
], AIActivationService.prototype, "preferenceService", void 0);
|
|
60
|
+
exports.AIActivationService = AIActivationService = tslib_1.__decorate([
|
|
61
|
+
(0, inversify_1.injectable)()
|
|
62
|
+
], AIActivationService);
|
|
63
|
+
//# sourceMappingURL=ai-activation-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-activation-service.js","sourceRoot":"","sources":["../../src/browser/ai-activation-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;AAChF,4DAAkE;AAClE,qDAA6F;AAC7F,sCAA4D;AAC5D,qFAA4F;AAC5F,+DAA4E;AAE5E;;GAEG;AACH,yDAAyD;AAC5C,QAAA,2BAA2B,GAAG,yDAAmC,CAAC;AAGxE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAAzB;QASO,4BAAuB,GAAG,IAAI,cAAO,EAAW,CAAC;IAkB/D,CAAC;IAjBG,IAAI,uBAAuB;QACvB,OAAO,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;IAC9C,CAAC;IAED,IAAI,QAAQ;;QACR,OAAO,MAAA,IAAI,CAAC,wBAAwB,CAAC,GAAG,EAAE,mCAAI,KAAK,CAAC;IACxD,CAAC;IAED,UAAU;QACN,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,mCAA2B,EAAE,KAAK,CAAC,CAAC;QACrG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE;YAC3C,IAAI,CAAC,CAAC,cAAc,KAAK,yDAAmC,EAAE,CAAC;gBAC3D,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAC9C,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YAClD,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA3BY,kDAAmB;AAET;IADlB,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;8DAC8B;AAG9C;IADT,IAAA,kBAAM,EAAC,2BAAiB,CAAC;;8DACqB;8BALtC,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CA2B/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-command-handler-factory.d.ts","sourceRoot":"","sources":["../../src/browser/ai-command-handler-factory.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,EAAE,cAAc,KAAK,cAAc,CAAC;AAClF,eAAO,MAAM,uBAAuB,eAAoC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.AICommandHandlerFactory = void 0;
|
|
19
|
+
exports.AICommandHandlerFactory = Symbol('AICommandHandlerFactory');
|
|
20
|
+
//# sourceMappingURL=ai-command-handler-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-command-handler-factory.js","sourceRoot":"","sources":["../../src/browser/ai-command-handler-factory.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;;;AAKnE,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactWidget } from '@theia/core/lib/browser';
|
|
3
|
+
import * as React from '@theia/core/shared/react';
|
|
4
|
+
import { Agent, AISettingsService, AIVariableService, LanguageModel, LanguageModelRegistry, PromptCustomizationService, PromptService } from '../../common';
|
|
5
|
+
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
6
|
+
import { AgentService } from '../../common/agent-service';
|
|
7
|
+
export declare class AIAgentConfigurationWidget extends ReactWidget {
|
|
8
|
+
static readonly ID = "ai-agent-configuration-container-widget";
|
|
9
|
+
static readonly LABEL = "Agents";
|
|
10
|
+
protected readonly agentService: AgentService;
|
|
11
|
+
protected readonly languageModelRegistry: LanguageModelRegistry;
|
|
12
|
+
protected readonly promptCustomizationService: PromptCustomizationService;
|
|
13
|
+
protected readonly aiSettingsService: AISettingsService;
|
|
14
|
+
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
15
|
+
protected readonly variableService: AIVariableService;
|
|
16
|
+
protected promptService: PromptService;
|
|
17
|
+
protected languageModels: LanguageModel[] | undefined;
|
|
18
|
+
protected init(): void;
|
|
19
|
+
protected render(): React.ReactNode;
|
|
20
|
+
private renderAgentName;
|
|
21
|
+
private renderAgentDetails;
|
|
22
|
+
private parsePromptTemplatesForVariableAndFunction;
|
|
23
|
+
protected showVariableConfigurationTab(): 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,EAAW,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EACH,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EAGrB,0BAA0B,EAC1B,aAAa,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAQ1D,qBACa,0BAA2B,SAAQ,WAAW;IAEvD,MAAM,CAAC,QAAQ,CAAC,EAAE,6CAA6C;IAC/D,MAAM,CAAC,QAAQ,CAAC,KAAK,YAAY;IAGjC,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;IAoBtB,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IAiBnC,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,kBAAkB;IA4D1B,OAAO,CAAC,0CAA0C;IA6BlD,SAAS,CAAC,4BAA4B,IAAI,IAAI;IAI9C,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,OAAO,CAAC,kBAAkB,CAYxB;CAEL"}
|
|
@@ -0,0 +1,231 @@
|
|
|
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 browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const React = require("@theia/core/shared/react");
|
|
24
|
+
const common_1 = require("../../common");
|
|
25
|
+
const language_model_renderer_1 = require("./language-model-renderer");
|
|
26
|
+
const template_settings_renderer_1 = require("./template-settings-renderer");
|
|
27
|
+
const ai_configuration_service_1 = require("./ai-configuration-service");
|
|
28
|
+
const variable_configuration_widget_1 = require("./variable-configuration-widget");
|
|
29
|
+
const agent_service_1 = require("../../common/agent-service");
|
|
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.update();
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return React.createElement("div", { className: 'ai-agent-configuration-main' },
|
|
68
|
+
React.createElement("div", { className: 'configuration-agents-list preferences-tree-widget theia-TreeContainer', style: { width: '25%' } },
|
|
69
|
+
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))))),
|
|
70
|
+
React.createElement("div", { className: 'configuration-agent-panel preferences-editor-widget' }, this.renderAgentDetails()));
|
|
71
|
+
}
|
|
72
|
+
renderAgentName(agent) {
|
|
73
|
+
var _a;
|
|
74
|
+
const tagsSuffix = ((_a = agent.tags) === null || _a === void 0 ? void 0 : _a.length) ? React.createElement("span", null, agent.tags.map(tag => React.createElement("span", { className: 'agent-tag' }, tag))) : '';
|
|
75
|
+
return React.createElement("span", null,
|
|
76
|
+
agent.name,
|
|
77
|
+
" ",
|
|
78
|
+
tagsSuffix);
|
|
79
|
+
}
|
|
80
|
+
renderAgentDetails() {
|
|
81
|
+
var _a;
|
|
82
|
+
const agent = this.aiConfigurationSelectionService.getActiveAgent();
|
|
83
|
+
if (!agent) {
|
|
84
|
+
return React.createElement("div", null, "Please select an Agent first!");
|
|
85
|
+
}
|
|
86
|
+
const enabled = this.agentService.isEnabled(agent.id);
|
|
87
|
+
const parsedPromptParts = this.parsePromptTemplatesForVariableAndFunction(agent);
|
|
88
|
+
const globalVariables = Array.from(new Set([...parsedPromptParts.globalVariables, ...agent.variables]));
|
|
89
|
+
const functions = Array.from(new Set([...parsedPromptParts.functions, ...agent.functions]));
|
|
90
|
+
return React.createElement("div", { key: agent.id, style: { display: 'flex', flexDirection: 'column', alignItems: 'flex-start' } },
|
|
91
|
+
React.createElement("div", { className: 'settings-section-title settings-section-category-title', style: { paddingLeft: 0, paddingBottom: 10 } }, this.renderAgentName(agent)),
|
|
92
|
+
React.createElement("div", { style: { paddingBottom: 10 } }, agent.description),
|
|
93
|
+
React.createElement("div", { style: { paddingBottom: 10 } },
|
|
94
|
+
React.createElement("label", null,
|
|
95
|
+
React.createElement("input", { type: "checkbox", checked: enabled, onChange: this.toggleAgentEnabled }),
|
|
96
|
+
"Enable Agent")),
|
|
97
|
+
React.createElement("div", { className: 'ai-templates' }, (_a = agent.promptTemplates) === null || _a === void 0 ? void 0 : _a.map(template => React.createElement(template_settings_renderer_1.TemplateRenderer, { key: (agent === null || agent === void 0 ? void 0 : agent.id) + '.' + template.id, agentId: agent.id, template: template, promptCustomizationService: this.promptCustomizationService }))),
|
|
98
|
+
React.createElement("div", { className: 'ai-lm-requirements' },
|
|
99
|
+
React.createElement(language_model_renderer_1.LanguageModelRenderer, { agent: agent, languageModels: this.languageModels, aiSettingsService: this.aiSettingsService, languageModelRegistry: this.languageModelRegistry })),
|
|
100
|
+
React.createElement("div", null,
|
|
101
|
+
React.createElement("span", null, "Used Global Variables:"),
|
|
102
|
+
React.createElement("ul", { className: 'variable-references' },
|
|
103
|
+
React.createElement(AgentGlobalVariables, { variables: globalVariables, showVariableConfigurationTab: this.showVariableConfigurationTab.bind(this) }))),
|
|
104
|
+
React.createElement("div", null,
|
|
105
|
+
React.createElement("span", null, "Used agent-specific Variables:"),
|
|
106
|
+
React.createElement("ul", { className: 'variable-references' },
|
|
107
|
+
React.createElement(AgentSpecificVariables, { promptVariables: parsedPromptParts.agentSpecificVariables, agent: agent }))),
|
|
108
|
+
React.createElement("div", null,
|
|
109
|
+
React.createElement("span", null, "Used Functions:"),
|
|
110
|
+
React.createElement("ul", { className: 'function-references' },
|
|
111
|
+
React.createElement(AgentFunctions, { functions: functions }))));
|
|
112
|
+
}
|
|
113
|
+
parsePromptTemplatesForVariableAndFunction(agent) {
|
|
114
|
+
const promptTemplates = agent.promptTemplates;
|
|
115
|
+
const result = { functions: [], globalVariables: [], agentSpecificVariables: [] };
|
|
116
|
+
promptTemplates.forEach(template => {
|
|
117
|
+
var _a;
|
|
118
|
+
const storedPrompt = this.promptService.getRawPrompt(template.id);
|
|
119
|
+
const prompt = (_a = storedPrompt === null || storedPrompt === void 0 ? void 0 : storedPrompt.template) !== null && _a !== void 0 ? _a : template.template;
|
|
120
|
+
const variableMatches = [...prompt.matchAll(common_1.PROMPT_VARIABLE_REGEX)];
|
|
121
|
+
variableMatches.forEach(match => {
|
|
122
|
+
const variableId = match[1];
|
|
123
|
+
// if the variable is part of the variable service and not part of the agent specific variables then it is a global variable
|
|
124
|
+
if (this.variableService.hasVariable(variableId) &&
|
|
125
|
+
agent.agentSpecificVariables.find(v => v.name === variableId) === undefined) {
|
|
126
|
+
result.globalVariables.push(variableId);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
result.agentSpecificVariables.push(variableId);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const functionMatches = [...prompt.matchAll(common_1.PROMPT_FUNCTION_REGEX)];
|
|
133
|
+
functionMatches.forEach(match => {
|
|
134
|
+
const functionId = match[1];
|
|
135
|
+
result.functions.push(functionId);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
showVariableConfigurationTab() {
|
|
141
|
+
this.aiConfigurationSelectionService.selectConfigurationTab(variable_configuration_widget_1.AIVariableConfigurationWidget.ID);
|
|
142
|
+
}
|
|
143
|
+
setActiveAgent(agent) {
|
|
144
|
+
this.aiConfigurationSelectionService.setActiveAgent(agent);
|
|
145
|
+
this.update();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
exports.AIAgentConfigurationWidget = AIAgentConfigurationWidget;
|
|
149
|
+
AIAgentConfigurationWidget.ID = 'ai-agent-configuration-container-widget';
|
|
150
|
+
AIAgentConfigurationWidget.LABEL = 'Agents';
|
|
151
|
+
tslib_1.__decorate([
|
|
152
|
+
(0, inversify_1.inject)(agent_service_1.AgentService),
|
|
153
|
+
tslib_1.__metadata("design:type", Object)
|
|
154
|
+
], AIAgentConfigurationWidget.prototype, "agentService", void 0);
|
|
155
|
+
tslib_1.__decorate([
|
|
156
|
+
(0, inversify_1.inject)(common_1.LanguageModelRegistry),
|
|
157
|
+
tslib_1.__metadata("design:type", Object)
|
|
158
|
+
], AIAgentConfigurationWidget.prototype, "languageModelRegistry", void 0);
|
|
159
|
+
tslib_1.__decorate([
|
|
160
|
+
(0, inversify_1.inject)(common_1.PromptCustomizationService),
|
|
161
|
+
tslib_1.__metadata("design:type", Object)
|
|
162
|
+
], AIAgentConfigurationWidget.prototype, "promptCustomizationService", void 0);
|
|
163
|
+
tslib_1.__decorate([
|
|
164
|
+
(0, inversify_1.inject)(common_1.AISettingsService),
|
|
165
|
+
tslib_1.__metadata("design:type", Object)
|
|
166
|
+
], AIAgentConfigurationWidget.prototype, "aiSettingsService", void 0);
|
|
167
|
+
tslib_1.__decorate([
|
|
168
|
+
(0, inversify_1.inject)(ai_configuration_service_1.AIConfigurationSelectionService),
|
|
169
|
+
tslib_1.__metadata("design:type", ai_configuration_service_1.AIConfigurationSelectionService)
|
|
170
|
+
], AIAgentConfigurationWidget.prototype, "aiConfigurationSelectionService", void 0);
|
|
171
|
+
tslib_1.__decorate([
|
|
172
|
+
(0, inversify_1.inject)(common_1.AIVariableService),
|
|
173
|
+
tslib_1.__metadata("design:type", Object)
|
|
174
|
+
], AIAgentConfigurationWidget.prototype, "variableService", void 0);
|
|
175
|
+
tslib_1.__decorate([
|
|
176
|
+
(0, inversify_1.inject)(common_1.PromptService),
|
|
177
|
+
tslib_1.__metadata("design:type", Object)
|
|
178
|
+
], AIAgentConfigurationWidget.prototype, "promptService", void 0);
|
|
179
|
+
tslib_1.__decorate([
|
|
180
|
+
(0, inversify_1.postConstruct)(),
|
|
181
|
+
tslib_1.__metadata("design:type", Function),
|
|
182
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
183
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
184
|
+
], AIAgentConfigurationWidget.prototype, "init", null);
|
|
185
|
+
exports.AIAgentConfigurationWidget = AIAgentConfigurationWidget = AIAgentConfigurationWidget_1 = tslib_1.__decorate([
|
|
186
|
+
(0, inversify_1.injectable)()
|
|
187
|
+
], AIAgentConfigurationWidget);
|
|
188
|
+
const AgentGlobalVariables = ({ variables: globalVariables, showVariableConfigurationTab }) => {
|
|
189
|
+
if (globalVariables.length === 0) {
|
|
190
|
+
return React.createElement(React.Fragment, null, "None");
|
|
191
|
+
}
|
|
192
|
+
return React.createElement(React.Fragment, null, globalVariables.map(variableId => React.createElement("li", { key: variableId, className: 'theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode theia-mod-selected' },
|
|
193
|
+
React.createElement("div", { key: variableId, onClick: () => { showVariableConfigurationTab(); }, className: 'variable-reference' },
|
|
194
|
+
React.createElement("span", null, variableId),
|
|
195
|
+
React.createElement("i", { className: (0, browser_1.codicon)('chevron-right') })))));
|
|
196
|
+
};
|
|
197
|
+
const AgentFunctions = ({ functions }) => {
|
|
198
|
+
if (functions.length === 0) {
|
|
199
|
+
return React.createElement(React.Fragment, null, "None");
|
|
200
|
+
}
|
|
201
|
+
return React.createElement(React.Fragment, null, functions.map(functionId => React.createElement("li", { key: functionId, className: 'variable-reference' },
|
|
202
|
+
React.createElement("span", null, functionId))));
|
|
203
|
+
};
|
|
204
|
+
const AgentSpecificVariables = ({ promptVariables, agent }) => {
|
|
205
|
+
const agentDefinedVariablesName = agent.agentSpecificVariables.map(v => v.name);
|
|
206
|
+
const variables = Array.from(new Set([...promptVariables, ...agentDefinedVariablesName]));
|
|
207
|
+
if (variables.length === 0) {
|
|
208
|
+
return React.createElement(React.Fragment, null, "None");
|
|
209
|
+
}
|
|
210
|
+
return React.createElement(React.Fragment, null, variables.map(variableId => React.createElement(AgentSpecifcVariable, { key: variableId, variableId: variableId, agent: agent, promptVariables: promptVariables })));
|
|
211
|
+
};
|
|
212
|
+
const AgentSpecifcVariable = ({ variableId, agent, promptVariables }) => {
|
|
213
|
+
const agentDefinedVariable = agent.agentSpecificVariables.find(v => v.name === variableId);
|
|
214
|
+
const undeclared = agentDefinedVariable === undefined;
|
|
215
|
+
const notUsed = !promptVariables.includes(variableId) && (agentDefinedVariable === null || agentDefinedVariable === void 0 ? void 0 : agentDefinedVariable.usedInPrompt) === true;
|
|
216
|
+
return React.createElement("li", { key: variableId },
|
|
217
|
+
React.createElement("div", null,
|
|
218
|
+
React.createElement("span", null, "Name:"),
|
|
219
|
+
" ",
|
|
220
|
+
React.createElement("span", null, variableId)),
|
|
221
|
+
undeclared ? React.createElement("div", null,
|
|
222
|
+
React.createElement("span", null, "Undeclared")) :
|
|
223
|
+
(React.createElement(React.Fragment, null,
|
|
224
|
+
React.createElement("div", null,
|
|
225
|
+
React.createElement("span", null, "Description:"),
|
|
226
|
+
" ",
|
|
227
|
+
React.createElement("span", null, agentDefinedVariable.description)),
|
|
228
|
+
notUsed && React.createElement("div", null, "Not used in prompt"))),
|
|
229
|
+
React.createElement("hr", null));
|
|
230
|
+
};
|
|
231
|
+
//# 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,qDAA+D;AAC/D,4DAAiF;AACjF,kDAAkD;AAClD,yCAUsB;AACtB,uEAAkE;AAClE,6EAAgE;AAChE,yEAA6E;AAC7E,mFAAg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E;IAC/F,MAAM,oBAAoB,GAAG,KAAK,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,0CAAkB;;YAAC,kCAAO,UAAU,CAAQ,CAAM;QACtD,UAAU,CAAC,CAAC,CAAC;YAAK,+CAAuB,CAAM,CAAC,CAAC;YAC9C,CAAC;gBACG;oBAAK,iDAAyB;;oBAAC,kCAAO,oBAAoB,CAAC,WAAW,CAAQ,CAAM;gBACnF,OAAO,IAAI,sDAA6B,CAC1C,CAAC;QACR,+BAAM,CACL,CAAC;AACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Emitter } from '@theia/core';
|
|
2
|
+
import { Agent } from '../../common';
|
|
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,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,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;;;;AAEhF,sCAAsC;AACtC,4DAA0D;AAInD,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 { FrontendApplication } from '@theia/core/lib/browser';
|
|
2
|
+
import { AIViewContribution } from '../ai-view-contribution';
|
|
3
|
+
import { AIConfigurationContainerWidget } from './ai-configuration-widget';
|
|
4
|
+
import { Command, CommandRegistry } from '@theia/core';
|
|
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,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvD,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,41 @@
|
|
|
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
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
6
|
+
const ai_view_contribution_1 = require("../ai-view-contribution");
|
|
7
|
+
const ai_configuration_widget_1 = require("./ai-configuration-widget");
|
|
8
|
+
const core_1 = require("@theia/core");
|
|
9
|
+
exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID = 'aiConfiguration:toggle';
|
|
10
|
+
exports.OPEN_AI_CONFIG_VIEW = core_1.Command.toLocalizedCommand({
|
|
11
|
+
id: 'aiConfiguration:open',
|
|
12
|
+
label: 'Open AI Configuration view',
|
|
13
|
+
});
|
|
14
|
+
let AIAgentConfigurationViewContribution = class AIAgentConfigurationViewContribution extends ai_view_contribution_1.AIViewContribution {
|
|
15
|
+
constructor() {
|
|
16
|
+
super({
|
|
17
|
+
widgetId: ai_configuration_widget_1.AIConfigurationContainerWidget.ID,
|
|
18
|
+
widgetName: ai_configuration_widget_1.AIConfigurationContainerWidget.LABEL,
|
|
19
|
+
defaultWidgetOptions: {
|
|
20
|
+
area: 'main',
|
|
21
|
+
rank: 100
|
|
22
|
+
},
|
|
23
|
+
toggleCommandId: exports.AI_CONFIGURATION_TOGGLE_COMMAND_ID
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async initializeLayout(_app) {
|
|
27
|
+
await this.openView();
|
|
28
|
+
}
|
|
29
|
+
registerCommands(commands) {
|
|
30
|
+
super.registerCommands(commands);
|
|
31
|
+
commands.registerCommand(exports.OPEN_AI_CONFIG_VIEW, {
|
|
32
|
+
execute: () => this.openView({ activate: true }),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.AIAgentConfigurationViewContribution = AIAgentConfigurationViewContribution;
|
|
37
|
+
exports.AIAgentConfigurationViewContribution = AIAgentConfigurationViewContribution = tslib_1.__decorate([
|
|
38
|
+
(0, inversify_1.injectable)(),
|
|
39
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
40
|
+
], AIAgentConfigurationViewContribution);
|
|
41
|
+
//# 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":";;;;AAgBA,4DAA0D;AAC1D,kEAA6D;AAC7D,uEAA2E;AAC3E,sCAAuD;AAE1C,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,yCAAkD;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"}
|