@theia/ai-core 1.46.0-next.241

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.
Files changed (209) hide show
  1. package/README.md +31 -0
  2. package/data/prompttemplate.tmLanguage.json +107 -0
  3. package/lib/browser/ai-activation-service.d.ts +17 -0
  4. package/lib/browser/ai-activation-service.d.ts.map +1 -0
  5. package/lib/browser/ai-activation-service.js +63 -0
  6. package/lib/browser/ai-activation-service.js.map +1 -0
  7. package/lib/browser/ai-command-handler-factory.d.ts +4 -0
  8. package/lib/browser/ai-command-handler-factory.d.ts.map +1 -0
  9. package/lib/browser/ai-command-handler-factory.js +20 -0
  10. package/lib/browser/ai-command-handler-factory.js.map +1 -0
  11. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +28 -0
  12. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -0
  13. package/lib/browser/ai-configuration/agent-configuration-widget.js +242 -0
  14. package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -0
  15. package/lib/browser/ai-configuration/ai-configuration-service.d.ts +13 -0
  16. package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +1 -0
  17. package/lib/browser/ai-configuration/ai-configuration-service.js +44 -0
  18. package/lib/browser/ai-configuration/ai-configuration-service.js.map +1 -0
  19. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +12 -0
  20. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -0
  21. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +41 -0
  22. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -0
  23. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +20 -0
  24. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -0
  25. package/lib/browser/ai-configuration/ai-configuration-widget.js +88 -0
  26. package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -0
  27. package/lib/browser/ai-configuration/language-model-renderer.d.ts +13 -0
  28. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -0
  29. package/lib/browser/ai-configuration/language-model-renderer.js +104 -0
  30. package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -0
  31. package/lib/browser/ai-configuration/template-settings-renderer.d.ts +13 -0
  32. package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
  33. package/lib/browser/ai-configuration/template-settings-renderer.js +71 -0
  34. package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -0
  35. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +20 -0
  36. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +1 -0
  37. package/lib/browser/ai-configuration/variable-configuration-widget.js +99 -0
  38. package/lib/browser/ai-configuration/variable-configuration-widget.js.map +1 -0
  39. package/lib/browser/ai-core-frontend-application-contribution.d.ts +10 -0
  40. package/lib/browser/ai-core-frontend-application-contribution.d.ts.map +1 -0
  41. package/lib/browser/ai-core-frontend-application-contribution.js +46 -0
  42. package/lib/browser/ai-core-frontend-application-contribution.js.map +1 -0
  43. package/lib/browser/ai-core-frontend-module.d.ts +4 -0
  44. package/lib/browser/ai-core-frontend-module.d.ts.map +1 -0
  45. package/lib/browser/ai-core-frontend-module.js +122 -0
  46. package/lib/browser/ai-core-frontend-module.js.map +1 -0
  47. package/lib/browser/ai-core-preferences.d.ts +29 -0
  48. package/lib/browser/ai-core-preferences.d.ts.map +1 -0
  49. package/lib/browser/ai-core-preferences.js +98 -0
  50. package/lib/browser/ai-core-preferences.js.map +1 -0
  51. package/lib/browser/ai-settings-service.d.ts +14 -0
  52. package/lib/browser/ai-settings-service.d.ts.map +1 -0
  53. package/lib/browser/ai-settings-service.js +56 -0
  54. package/lib/browser/ai-settings-service.js.map +1 -0
  55. package/lib/browser/ai-view-contribution.d.ts +14 -0
  56. package/lib/browser/ai-view-contribution.d.ts.map +1 -0
  57. package/lib/browser/ai-view-contribution.js +71 -0
  58. package/lib/browser/ai-view-contribution.js.map +1 -0
  59. package/lib/browser/frontend-language-model-registry.d.ts +39 -0
  60. package/lib/browser/frontend-language-model-registry.d.ts.map +1 -0
  61. package/lib/browser/frontend-language-model-registry.js +321 -0
  62. package/lib/browser/frontend-language-model-registry.js.map +1 -0
  63. package/lib/browser/frontend-prompt-customization-service.d.ts +33 -0
  64. package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -0
  65. package/lib/browser/frontend-prompt-customization-service.js +237 -0
  66. package/lib/browser/frontend-prompt-customization-service.js.map +1 -0
  67. package/lib/browser/frontend-variable-service.d.ts +6 -0
  68. package/lib/browser/frontend-variable-service.d.ts.map +1 -0
  69. package/lib/browser/frontend-variable-service.js +31 -0
  70. package/lib/browser/frontend-variable-service.js.map +1 -0
  71. package/lib/browser/index.d.ts +11 -0
  72. package/lib/browser/index.d.ts.map +1 -0
  73. package/lib/browser/index.js +29 -0
  74. package/lib/browser/index.js.map +1 -0
  75. package/lib/browser/prompttemplate-contribution.d.ts +29 -0
  76. package/lib/browser/prompttemplate-contribution.d.ts.map +1 -0
  77. package/lib/browser/prompttemplate-contribution.js +208 -0
  78. package/lib/browser/prompttemplate-contribution.js.map +1 -0
  79. package/lib/browser/theia-variable-contribution.d.ts +13 -0
  80. package/lib/browser/theia-variable-contribution.d.ts.map +1 -0
  81. package/lib/browser/theia-variable-contribution.js +64 -0
  82. package/lib/browser/theia-variable-contribution.js.map +1 -0
  83. package/lib/common/agent-service.d.ts +66 -0
  84. package/lib/common/agent-service.d.ts.map +1 -0
  85. package/lib/common/agent-service.js +92 -0
  86. package/lib/common/agent-service.js.map +1 -0
  87. package/lib/common/agent.d.ts +45 -0
  88. package/lib/common/agent.d.ts.map +1 -0
  89. package/lib/common/agent.js +20 -0
  90. package/lib/common/agent.js.map +1 -0
  91. package/lib/common/agents-variable-contribution.d.ts +19 -0
  92. package/lib/common/agents-variable-contribution.d.ts.map +1 -0
  93. package/lib/common/agents-variable-contribution.js +56 -0
  94. package/lib/common/agents-variable-contribution.js.map +1 -0
  95. package/lib/common/communication-recording-service.d.ts +29 -0
  96. package/lib/common/communication-recording-service.d.ts.map +1 -0
  97. package/lib/common/communication-recording-service.js +20 -0
  98. package/lib/common/communication-recording-service.js.map +1 -0
  99. package/lib/common/index.d.ts +16 -0
  100. package/lib/common/index.d.ts.map +1 -0
  101. package/lib/common/index.js +34 -0
  102. package/lib/common/index.js.map +1 -0
  103. package/lib/common/language-model-delegate.d.ts +24 -0
  104. package/lib/common/language-model-delegate.d.ts.map +1 -0
  105. package/lib/common/language-model-delegate.js +26 -0
  106. package/lib/common/language-model-delegate.js.map +1 -0
  107. package/lib/common/language-model-util.d.ts +16 -0
  108. package/lib/common/language-model-util.d.ts.map +1 -0
  109. package/lib/common/language-model-util.js +92 -0
  110. package/lib/common/language-model-util.js.map +1 -0
  111. package/lib/common/language-model.d.ts +144 -0
  112. package/lib/common/language-model.d.ts.map +1 -0
  113. package/lib/common/language-model.js +142 -0
  114. package/lib/common/language-model.js.map +1 -0
  115. package/lib/common/language-model.spec.d.ts +2 -0
  116. package/lib/common/language-model.spec.d.ts.map +1 -0
  117. package/lib/common/language-model.spec.js +62 -0
  118. package/lib/common/language-model.spec.js.map +1 -0
  119. package/lib/common/prompt-service-util.d.ts +8 -0
  120. package/lib/common/prompt-service-util.d.ts.map +1 -0
  121. package/lib/common/prompt-service-util.js +34 -0
  122. package/lib/common/prompt-service-util.js.map +1 -0
  123. package/lib/common/prompt-service.d.ts +161 -0
  124. package/lib/common/prompt-service.d.ts.map +1 -0
  125. package/lib/common/prompt-service.js +204 -0
  126. package/lib/common/prompt-service.js.map +1 -0
  127. package/lib/common/prompt-service.spec.d.ts +2 -0
  128. package/lib/common/prompt-service.spec.d.ts.map +1 -0
  129. package/lib/common/prompt-service.spec.js +254 -0
  130. package/lib/common/prompt-service.spec.js.map +1 -0
  131. package/lib/common/protocol.d.ts +7 -0
  132. package/lib/common/protocol.d.ts.map +1 -0
  133. package/lib/common/protocol.js +20 -0
  134. package/lib/common/protocol.js.map +1 -0
  135. package/lib/common/settings-service.d.ts +23 -0
  136. package/lib/common/settings-service.d.ts.map +1 -0
  137. package/lib/common/settings-service.js +5 -0
  138. package/lib/common/settings-service.js.map +1 -0
  139. package/lib/common/today-variable-contribution.d.ts +17 -0
  140. package/lib/common/today-variable-contribution.d.ts.map +1 -0
  141. package/lib/common/today-variable-contribution.js +48 -0
  142. package/lib/common/today-variable-contribution.js.map +1 -0
  143. package/lib/common/tomorrow-variable-contribution.d.ts +17 -0
  144. package/lib/common/tomorrow-variable-contribution.d.ts.map +1 -0
  145. package/lib/common/tomorrow-variable-contribution.js +48 -0
  146. package/lib/common/tomorrow-variable-contribution.js.map +1 -0
  147. package/lib/common/tool-invocation-registry.d.ts +23 -0
  148. package/lib/common/tool-invocation-registry.d.ts.map +1 -0
  149. package/lib/common/tool-invocation-registry.js +72 -0
  150. package/lib/common/tool-invocation-registry.js.map +1 -0
  151. package/lib/common/variable-service.d.ts +70 -0
  152. package/lib/common/variable-service.d.ts.map +1 -0
  153. package/lib/common/variable-service.js +122 -0
  154. package/lib/common/variable-service.js.map +1 -0
  155. package/lib/node/ai-core-backend-module.d.ts +4 -0
  156. package/lib/node/ai-core-backend-module.d.ts.map +1 -0
  157. package/lib/node/ai-core-backend-module.js +47 -0
  158. package/lib/node/ai-core-backend-module.js.map +1 -0
  159. package/lib/node/backend-language-model-registry.d.ts +12 -0
  160. package/lib/node/backend-language-model-registry.d.ts.map +1 -0
  161. package/lib/node/backend-language-model-registry.js +61 -0
  162. package/lib/node/backend-language-model-registry.js.map +1 -0
  163. package/lib/node/language-model-frontend-delegate.d.ts +18 -0
  164. package/lib/node/language-model-frontend-delegate.d.ts.map +1 -0
  165. package/lib/node/language-model-frontend-delegate.js +100 -0
  166. package/lib/node/language-model-frontend-delegate.js.map +1 -0
  167. package/package.json +61 -0
  168. package/src/browser/ai-activation-service.ts +56 -0
  169. package/src/browser/ai-command-handler-factory.ts +20 -0
  170. package/src/browser/ai-configuration/agent-configuration-widget.tsx +324 -0
  171. package/src/browser/ai-configuration/ai-configuration-service.ts +43 -0
  172. package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +54 -0
  173. package/src/browser/ai-configuration/ai-configuration-widget.tsx +80 -0
  174. package/src/browser/ai-configuration/language-model-renderer.tsx +113 -0
  175. package/src/browser/ai-configuration/template-settings-renderer.tsx +128 -0
  176. package/src/browser/ai-configuration/variable-configuration-widget.tsx +110 -0
  177. package/src/browser/ai-core-frontend-application-contribution.ts +39 -0
  178. package/src/browser/ai-core-frontend-module.ts +161 -0
  179. package/src/browser/ai-core-preferences.ts +115 -0
  180. package/src/browser/ai-settings-service.ts +50 -0
  181. package/src/browser/ai-view-contribution.ts +77 -0
  182. package/src/browser/frontend-language-model-registry.ts +405 -0
  183. package/src/browser/frontend-prompt-customization-service.ts +243 -0
  184. package/src/browser/frontend-variable-service.ts +26 -0
  185. package/src/browser/index.ts +26 -0
  186. package/src/browser/prompttemplate-contribution.ts +252 -0
  187. package/src/browser/style/index.css +127 -0
  188. package/src/browser/theia-variable-contribution.ts +58 -0
  189. package/src/common/agent-service.ts +137 -0
  190. package/src/common/agent.ts +70 -0
  191. package/src/common/agents-variable-contribution.ts +64 -0
  192. package/src/common/communication-recording-service.ts +53 -0
  193. package/src/common/index.ts +30 -0
  194. package/src/common/language-model-delegate.ts +45 -0
  195. package/src/common/language-model-util.ts +84 -0
  196. package/src/common/language-model.spec.ts +86 -0
  197. package/src/common/language-model.ts +242 -0
  198. package/src/common/prompt-service-util.ts +31 -0
  199. package/src/common/prompt-service.spec.ts +301 -0
  200. package/src/common/prompt-service.ts +334 -0
  201. package/src/common/protocol.ts +23 -0
  202. package/src/common/settings-service.ts +38 -0
  203. package/src/common/today-variable-contribution.ts +67 -0
  204. package/src/common/tomorrow-variable-contribution.ts +66 -0
  205. package/src/common/tool-invocation-registry.ts +79 -0
  206. package/src/common/variable-service.ts +177 -0
  207. package/src/node/ai-core-backend-module.ts +83 -0
  208. package/src/node/backend-language-model-registry.ts +59 -0
  209. package/src/node/language-model-frontend-delegate.ts +116 -0
package/README.md ADDED
@@ -0,0 +1,31 @@
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
+
30
+ "Theia" is a trademark of the Eclipse Foundation
31
+ <https://www.eclipse.org/theia>
@@ -0,0 +1,107 @@
1
+ {
2
+ "scopeName": "source.prompttemplate",
3
+ "patterns": [
4
+ {
5
+ "name": "invalid.illegal.mismatched.prompttemplate",
6
+ "match": "\\{\\{\\{[^{}]*\\}\\}(?!\\})",
7
+ "captures": {
8
+ "0": {
9
+ "name": "invalid.illegal.bracket.mismatch"
10
+ }
11
+ }
12
+ },
13
+ {
14
+ "name": "invalid.illegal.mismatched.prompttemplate",
15
+ "match": "\\{\\{[^{}]*\\}\\}\\}(?!\\})",
16
+ "captures": {
17
+ "0": {
18
+ "name": "invalid.illegal.bracket.mismatch"
19
+ }
20
+ }
21
+ },
22
+ {
23
+ "name": "comment.block.prompttemplate",
24
+ "begin": "\\A{{!--",
25
+ "beginCaptures": {
26
+ "0": {
27
+ "name": "punctuation.definition.comment.begin"
28
+ }
29
+ },
30
+ "end": "--}}",
31
+ "endCaptures": {
32
+ "0": {
33
+ "name": "punctuation.definition.comment.end"
34
+ }
35
+ },
36
+ "patterns": []
37
+ },
38
+ {
39
+ "name": "variable.other.prompttemplate.double",
40
+ "begin": "\\{\\{",
41
+ "beginCaptures": {
42
+ "0": {
43
+ "name": "punctuation.definition.variable.begin"
44
+ }
45
+ },
46
+ "end": "\\}\\}(?!\\})",
47
+ "endCaptures": {
48
+ "0": {
49
+ "name": "punctuation.definition.variable.end"
50
+ }
51
+ },
52
+ "patterns": [
53
+ {
54
+ "name": "keyword.control",
55
+ "match": "[a-zA-Z_][a-zA-Z0-9_]*"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "name": "variable.other.prompttemplate.triple",
61
+ "begin": "\\{\\{\\{",
62
+ "beginCaptures": {
63
+ "0": {
64
+ "name": "punctuation.definition.variable.begin"
65
+ }
66
+ },
67
+ "end": "\\}\\}\\}(?!\\})",
68
+ "endCaptures": {
69
+ "0": {
70
+ "name": "punctuation.definition.variable.end"
71
+ }
72
+ },
73
+ "patterns": [
74
+ {
75
+ "name": "keyword.control",
76
+ "match": "[a-zA-Z_][a-zA-Z0-9_]*"
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ "name": "support.function.prompttemplate",
82
+ "begin": "~{",
83
+ "beginCaptures": {
84
+ "0": {
85
+ "name": "punctuation.definition.brace.begin"
86
+ }
87
+ },
88
+ "end": "}",
89
+ "endCaptures": {
90
+ "0": {
91
+ "name": "punctuation.definition.brace.end"
92
+ }
93
+ },
94
+ "patterns": [
95
+ {
96
+ "name": "keyword.control",
97
+ "match": "[a-zA-Z_][a-zA-Z0-9_\\-]*"
98
+ }
99
+ ]
100
+ }
101
+ ],
102
+ "repository": {},
103
+ "name": "PromptTemplate",
104
+ "fileTypes": [
105
+ ".prompttemplate"
106
+ ]
107
+ }
@@ -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,4 @@
1
+ import { CommandHandler } from '@theia/core';
2
+ export type AICommandHandlerFactory = (handler: CommandHandler) => CommandHandler;
3
+ export declare const AICommandHandlerFactory: unique symbol;
4
+ //# sourceMappingURL=ai-command-handler-factory.d.ts.map
@@ -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,28 @@
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 addCustomAgent(): void;
25
+ protected setActiveAgent(agent: Agent): void;
26
+ private toggleAgentEnabled;
27
+ }
28
+ //# 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;IAqBtB,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IAoBnC,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 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.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() }, "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, "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
+ "Enable Agent")),
99
+ React.createElement("div", { className: "settings-section-subcategory-title ai-settings-section-subcategory-title" }, "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, "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 = 'Agents';
162
+ tslib_1.__decorate([
163
+ (0, inversify_1.inject)(agent_service_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, "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, "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, "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, "Name:"),
230
+ " ",
231
+ React.createElement("span", null, variableId)),
232
+ undeclared ? React.createElement("div", null,
233
+ React.createElement("span", null, "Undeclared")) :
234
+ (React.createElement(React.Fragment, null,
235
+ React.createElement("div", null,
236
+ React.createElement("span", null, "Description:"),
237
+ " ",
238
+ React.createElement("span", null, agentDefinedVariable.description)),
239
+ notUsed && React.createElement("div", null, "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,qDAA+D;AAC/D,4DAAiF;AACjF,kDAAkD;AAClD,yCAUsB;AACtB,uEAAkE;AAClE,6EAAgE;AAChE,yE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AE,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"}