@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.
- package/README.md +31 -0
- package/data/prompttemplate.tmLanguage.json +107 -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 +28 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js +242 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts +13 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js +44 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +12 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +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 +13 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js +71 -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 +10 -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 +29 -0
- package/lib/browser/ai-core-preferences.d.ts.map +1 -0
- package/lib/browser/ai-core-preferences.js +98 -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 +33 -0
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.js +237 -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 +29 -0
- package/lib/browser/prompttemplate-contribution.d.ts.map +1 -0
- package/lib/browser/prompttemplate-contribution.js +208 -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 +66 -0
- package/lib/common/agent-service.d.ts.map +1 -0
- package/lib/common/agent-service.js +92 -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 +29 -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 +16 -0
- package/lib/common/language-model-util.d.ts.map +1 -0
- package/lib/common/language-model-util.js +92 -0
- package/lib/common/language-model-util.js.map +1 -0
- package/lib/common/language-model.d.ts +144 -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 +8 -0
- package/lib/common/prompt-service-util.d.ts.map +1 -0
- package/lib/common/prompt-service-util.js +34 -0
- package/lib/common/prompt-service-util.js.map +1 -0
- package/lib/common/prompt-service.d.ts +161 -0
- package/lib/common/prompt-service.d.ts.map +1 -0
- package/lib/common/prompt-service.js +204 -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 +254 -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 +23 -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 +61 -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 +324 -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 +128 -0
- package/src/browser/ai-configuration/variable-configuration-widget.tsx +110 -0
- package/src/browser/ai-core-frontend-application-contribution.ts +39 -0
- package/src/browser/ai-core-frontend-module.ts +161 -0
- package/src/browser/ai-core-preferences.ts +115 -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 +243 -0
- package/src/browser/frontend-variable-service.ts +26 -0
- package/src/browser/index.ts +26 -0
- package/src/browser/prompttemplate-contribution.ts +252 -0
- package/src/browser/style/index.css +127 -0
- package/src/browser/theia-variable-contribution.ts +58 -0
- package/src/common/agent-service.ts +137 -0
- package/src/common/agent.ts +70 -0
- package/src/common/agents-variable-contribution.ts +64 -0
- package/src/common/communication-recording-service.ts +53 -0
- package/src/common/index.ts +30 -0
- package/src/common/language-model-delegate.ts +45 -0
- package/src/common/language-model-util.ts +84 -0
- package/src/common/language-model.spec.ts +86 -0
- package/src/common/language-model.ts +242 -0
- package/src/common/prompt-service-util.ts +31 -0
- package/src/common/prompt-service.spec.ts +301 -0
- package/src/common/prompt-service.ts +334 -0
- package/src/common/protocol.ts +23 -0
- package/src/common/settings-service.ts +38 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-core-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/ai-core-frontend-module.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AA+C/D,wBA6FG"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// *****************************************************************************
|
|
4
|
+
// Copyright (C) 2024 EclipseSource GmbH.
|
|
5
|
+
//
|
|
6
|
+
// This program and the accompanying materials are made available under the
|
|
7
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
+
//
|
|
10
|
+
// This Source Code may also be made available under the following Secondary
|
|
11
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
+
// with the GNU Classpath Exception which is available at
|
|
14
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
15
|
+
//
|
|
16
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
17
|
+
// *****************************************************************************
|
|
18
|
+
const core_1 = require("@theia/core");
|
|
19
|
+
const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const common_1 = require("../common");
|
|
22
|
+
const frontend_language_model_registry_1 = require("./frontend-language-model-registry");
|
|
23
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
24
|
+
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
25
|
+
const textmate_1 = require("@theia/monaco/lib/browser/textmate");
|
|
26
|
+
const agent_configuration_widget_1 = require("./ai-configuration/agent-configuration-widget");
|
|
27
|
+
const ai_configuration_service_1 = require("./ai-configuration/ai-configuration-service");
|
|
28
|
+
const ai_configuration_view_contribution_1 = require("./ai-configuration/ai-configuration-view-contribution");
|
|
29
|
+
const ai_configuration_widget_1 = require("./ai-configuration/ai-configuration-widget");
|
|
30
|
+
const variable_configuration_widget_1 = require("./ai-configuration/variable-configuration-widget");
|
|
31
|
+
const ai_core_frontend_application_contribution_1 = require("./ai-core-frontend-application-contribution");
|
|
32
|
+
const ai_core_preferences_1 = require("./ai-core-preferences");
|
|
33
|
+
const ai_settings_service_1 = require("./ai-settings-service");
|
|
34
|
+
const frontend_prompt_customization_service_1 = require("./frontend-prompt-customization-service");
|
|
35
|
+
const frontend_variable_service_1 = require("./frontend-variable-service");
|
|
36
|
+
const prompttemplate_contribution_1 = require("./prompttemplate-contribution");
|
|
37
|
+
const tomorrow_variable_contribution_1 = require("../common/tomorrow-variable-contribution");
|
|
38
|
+
const theia_variable_contribution_1 = require("./theia-variable-contribution");
|
|
39
|
+
const today_variable_contribution_1 = require("../common/today-variable-contribution");
|
|
40
|
+
const agents_variable_contribution_1 = require("../common/agents-variable-contribution");
|
|
41
|
+
const ai_activation_service_1 = require("./ai-activation-service");
|
|
42
|
+
const agent_service_1 = require("../common/agent-service");
|
|
43
|
+
const ai_command_handler_factory_1 = require("./ai-command-handler-factory");
|
|
44
|
+
const settings_service_1 = require("../common/settings-service");
|
|
45
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
46
|
+
(0, core_1.bindContributionProvider)(bind, common_1.LanguageModelProvider);
|
|
47
|
+
bind(frontend_language_model_registry_1.FrontendLanguageModelRegistryImpl).toSelf().inSingletonScope();
|
|
48
|
+
bind(common_1.LanguageModelRegistry).toService(frontend_language_model_registry_1.FrontendLanguageModelRegistryImpl);
|
|
49
|
+
bind(frontend_language_model_registry_1.LanguageModelDelegateClientImpl).toSelf().inSingletonScope();
|
|
50
|
+
bind(common_1.LanguageModelDelegateClient).toService(frontend_language_model_registry_1.LanguageModelDelegateClientImpl);
|
|
51
|
+
bind(common_1.LanguageModelRegistryClient).toService(common_1.LanguageModelDelegateClient);
|
|
52
|
+
bind(common_1.LanguageModelRegistryFrontendDelegate).toDynamicValue(ctx => {
|
|
53
|
+
const connection = ctx.container.get(service_connection_provider_1.RemoteConnectionProvider);
|
|
54
|
+
const client = ctx.container.get(common_1.LanguageModelRegistryClient);
|
|
55
|
+
return connection.createProxy(common_1.languageModelRegistryDelegatePath, client);
|
|
56
|
+
});
|
|
57
|
+
bind(common_1.LanguageModelFrontendDelegate)
|
|
58
|
+
.toDynamicValue(ctx => {
|
|
59
|
+
const connection = ctx.container.get(service_connection_provider_1.RemoteConnectionProvider);
|
|
60
|
+
const client = ctx.container.get(common_1.LanguageModelDelegateClient);
|
|
61
|
+
return connection.createProxy(common_1.languageModelDelegatePath, client);
|
|
62
|
+
})
|
|
63
|
+
.inSingletonScope();
|
|
64
|
+
(0, ai_core_preferences_1.bindAICorePreferences)(bind);
|
|
65
|
+
bind(frontend_prompt_customization_service_1.FrontendPromptCustomizationServiceImpl).toSelf().inSingletonScope();
|
|
66
|
+
bind(common_1.PromptCustomizationService).toService(frontend_prompt_customization_service_1.FrontendPromptCustomizationServiceImpl);
|
|
67
|
+
bind(common_1.PromptServiceImpl).toSelf().inSingletonScope();
|
|
68
|
+
bind(common_1.PromptService).toService(common_1.PromptServiceImpl);
|
|
69
|
+
bind(prompttemplate_contribution_1.PromptTemplateContribution).toSelf().inSingletonScope();
|
|
70
|
+
bind(textmate_1.LanguageGrammarDefinitionContribution).toService(prompttemplate_contribution_1.PromptTemplateContribution);
|
|
71
|
+
bind(core_1.CommandContribution).toService(prompttemplate_contribution_1.PromptTemplateContribution);
|
|
72
|
+
bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(prompttemplate_contribution_1.PromptTemplateContribution);
|
|
73
|
+
bind(ai_configuration_service_1.AIConfigurationSelectionService).toSelf().inSingletonScope();
|
|
74
|
+
bind(ai_configuration_widget_1.AIConfigurationContainerWidget).toSelf();
|
|
75
|
+
bind(browser_1.WidgetFactory)
|
|
76
|
+
.toDynamicValue(ctx => ({
|
|
77
|
+
id: ai_configuration_widget_1.AIConfigurationContainerWidget.ID,
|
|
78
|
+
createWidget: () => ctx.container.get(ai_configuration_widget_1.AIConfigurationContainerWidget)
|
|
79
|
+
}))
|
|
80
|
+
.inSingletonScope();
|
|
81
|
+
(0, browser_1.bindViewContribution)(bind, ai_configuration_view_contribution_1.AIAgentConfigurationViewContribution);
|
|
82
|
+
bind(settings_service_1.AISettingsService).to(ai_settings_service_1.AISettingsServiceImpl).inRequestScope();
|
|
83
|
+
(0, core_1.bindContributionProvider)(bind, common_1.AIVariableContribution);
|
|
84
|
+
bind(frontend_variable_service_1.FrontendVariableService).toSelf().inSingletonScope();
|
|
85
|
+
bind(common_1.AIVariableService).toService(frontend_variable_service_1.FrontendVariableService);
|
|
86
|
+
bind(browser_1.FrontendApplicationContribution).toService(frontend_variable_service_1.FrontendVariableService);
|
|
87
|
+
bind(common_1.AIVariableContribution).to(theia_variable_contribution_1.TheiaVariableContribution).inSingletonScope();
|
|
88
|
+
bind(common_1.AIVariableContribution).to(today_variable_contribution_1.TodayVariableContribution).inSingletonScope();
|
|
89
|
+
bind(common_1.AIVariableContribution).to(tomorrow_variable_contribution_1.TomorrowVariableContribution).inSingletonScope();
|
|
90
|
+
bind(common_1.AIVariableContribution).to(agents_variable_contribution_1.AgentsVariableContribution).inSingletonScope();
|
|
91
|
+
bind(browser_1.FrontendApplicationContribution).to(ai_core_frontend_application_contribution_1.AICoreFrontendApplicationContribution).inSingletonScope();
|
|
92
|
+
bind(variable_configuration_widget_1.AIVariableConfigurationWidget).toSelf();
|
|
93
|
+
bind(browser_1.WidgetFactory)
|
|
94
|
+
.toDynamicValue(ctx => ({
|
|
95
|
+
id: variable_configuration_widget_1.AIVariableConfigurationWidget.ID,
|
|
96
|
+
createWidget: () => ctx.container.get(variable_configuration_widget_1.AIVariableConfigurationWidget)
|
|
97
|
+
}))
|
|
98
|
+
.inSingletonScope();
|
|
99
|
+
bind(agent_configuration_widget_1.AIAgentConfigurationWidget).toSelf();
|
|
100
|
+
bind(browser_1.WidgetFactory)
|
|
101
|
+
.toDynamicValue(ctx => ({
|
|
102
|
+
id: agent_configuration_widget_1.AIAgentConfigurationWidget.ID,
|
|
103
|
+
createWidget: () => ctx.container.get(agent_configuration_widget_1.AIAgentConfigurationWidget)
|
|
104
|
+
}))
|
|
105
|
+
.inSingletonScope();
|
|
106
|
+
bind(common_1.ToolInvocationRegistry).to(common_1.ToolInvocationRegistryImpl).inSingletonScope();
|
|
107
|
+
(0, core_1.bindContributionProvider)(bind, common_1.ToolProvider);
|
|
108
|
+
bind(ai_activation_service_1.AIActivationService).toSelf().inSingletonScope();
|
|
109
|
+
bind(browser_1.FrontendApplicationContribution).toService(ai_activation_service_1.AIActivationService);
|
|
110
|
+
bind(agent_service_1.AgentServiceImpl).toSelf().inSingletonScope();
|
|
111
|
+
bind(agent_service_1.AgentService).toService(agent_service_1.AgentServiceImpl);
|
|
112
|
+
bind(ai_command_handler_factory_1.AICommandHandlerFactory).toFactory(context => (handler) => {
|
|
113
|
+
const activationService = context.container.get(ai_activation_service_1.AIActivationService);
|
|
114
|
+
return {
|
|
115
|
+
execute: (...args) => handler.execute(...args),
|
|
116
|
+
isEnabled: (...args) => { var _a, _b; return activationService.isActive && ((_b = (_a = handler.isEnabled) === null || _a === void 0 ? void 0 : _a.call(handler, ...args)) !== null && _b !== void 0 ? _b : true); },
|
|
117
|
+
isVisible: (...args) => { var _a, _b; return activationService.isActive && ((_b = (_a = handler.isVisible) === null || _a === void 0 ? void 0 : _a.call(handler, ...args)) !== null && _b !== void 0 ? _b : true); },
|
|
118
|
+
isToggled: (...args) => { var _a, _b; return (_b = (_a = handler.isToggled) === null || _a === void 0 ? void 0 : _a.call(handler, ...args)) !== null && _b !== void 0 ? _b : false; }
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=ai-core-frontend-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-core-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-core-frontend-module.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,sCAA4F;AAC5F,+GAGuE;AACvE,4DAA+D;AAC/D,sCAiBmB;AACnB,yFAG4C;AAE5C,qDAA+G;AAC/G,mFAA0F;AAC1F,iEAA2F;AAC3F,8FAA2F;AAC3F,0FAA8F;AAC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AAI,CAAC,MAAA,MAAA,OAAO,CAAC,SAAS,wDAAG,GAAG,IAAI,CAAC,mCAAI,IAAI,CAAC,CAAA,EAAA;YACvG,SAAS,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,OAAO,CAAC,SAAS,wDAAG,GAAG,IAAI,CAAC,mCAAI,KAAK,CAAA,EAAA;SAC3E,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PreferenceProxy, PreferenceSchema } from '@theia/core/lib/browser';
|
|
2
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
3
|
+
export declare const AI_CORE_PREFERENCES_TITLE = "\u2728 AI Features [Experimental]";
|
|
4
|
+
export declare const PREFERENCE_NAME_ENABLE_EXPERIMENTAL = "ai-features.AiEnable.enableAI";
|
|
5
|
+
export declare const PREFERENCE_NAME_PROMPT_TEMPLATES = "ai-features.promptTemplates.promptTemplatesFolder";
|
|
6
|
+
export declare const PREFERENCE_NAME_REQUEST_SETTINGS = "ai-features.modelSettings.requestSettings";
|
|
7
|
+
export declare const aiCorePreferenceSchema: PreferenceSchema;
|
|
8
|
+
export interface AICoreConfiguration {
|
|
9
|
+
[PREFERENCE_NAME_ENABLE_EXPERIMENTAL]: boolean | undefined;
|
|
10
|
+
[PREFERENCE_NAME_PROMPT_TEMPLATES]: string | undefined;
|
|
11
|
+
[PREFERENCE_NAME_REQUEST_SETTINGS]: Array<{
|
|
12
|
+
modelId: string;
|
|
13
|
+
requestSettings?: {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
providerId?: string;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface RequestSetting {
|
|
20
|
+
modelId: string;
|
|
21
|
+
requestSettings?: {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
providerId?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const AICorePreferences: unique symbol;
|
|
27
|
+
export type AICorePreferences = PreferenceProxy<AICoreConfiguration>;
|
|
28
|
+
export declare function bindAICorePreferences(bind: interfaces.Bind): void;
|
|
29
|
+
//# sourceMappingURL=ai-core-preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-core-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/ai-core-preferences.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA0B,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,eAAO,MAAM,yBAAyB,sCAAiC,CAAC;AACxE,eAAO,MAAM,mCAAmC,kCAAkC,CAAC;AACnF,eAAO,MAAM,gCAAgC,sDAAsD,CAAC;AACpG,eAAO,MAAM,gCAAgC,8CAA8C,CAAC;AAE5F,eAAO,MAAM,sBAAsB,EAAE,gBA+DpC,CAAC;AACF,MAAM,WAAW,mBAAmB;IAChC,CAAC,mCAAmC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3D,CAAC,gCAAgC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvD,CAAC,gCAAgC,CAAC,EAAE,KAAK,CAAC;QACtC,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC,GAAG,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAErE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAMjE"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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.bindAICorePreferences = exports.AICorePreferences = exports.aiCorePreferenceSchema = exports.PREFERENCE_NAME_REQUEST_SETTINGS = exports.PREFERENCE_NAME_PROMPT_TEMPLATES = exports.PREFERENCE_NAME_ENABLE_EXPERIMENTAL = exports.AI_CORE_PREFERENCES_TITLE = void 0;
|
|
19
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
+
const injectable_preference_proxy_1 = require("@theia/core/lib/browser/preferences/injectable-preference-proxy");
|
|
21
|
+
exports.AI_CORE_PREFERENCES_TITLE = '✨ AI Features [Experimental]';
|
|
22
|
+
exports.PREFERENCE_NAME_ENABLE_EXPERIMENTAL = 'ai-features.AiEnable.enableAI';
|
|
23
|
+
exports.PREFERENCE_NAME_PROMPT_TEMPLATES = 'ai-features.promptTemplates.promptTemplatesFolder';
|
|
24
|
+
exports.PREFERENCE_NAME_REQUEST_SETTINGS = 'ai-features.modelSettings.requestSettings';
|
|
25
|
+
exports.aiCorePreferenceSchema = {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
[exports.PREFERENCE_NAME_ENABLE_EXPERIMENTAL]: {
|
|
29
|
+
title: exports.AI_CORE_PREFERENCES_TITLE,
|
|
30
|
+
markdownDescription: '❗ This setting allows you to access and experiment with the latest AI capabilities.\
|
|
31
|
+
\n\
|
|
32
|
+
Please note that these features are in an experimental phase, which means they may be unstable and\
|
|
33
|
+
undergo significant changes. It is important to be aware that these experimental features may generate\
|
|
34
|
+
continuous requests to the language models (LLMs) you provide access to. This might incur costs that you\
|
|
35
|
+
need to monitor closely. By enabling this option, you acknowledge these risks.\
|
|
36
|
+
\n\
|
|
37
|
+
**Please note! The settings below in this section will only take effect\n\
|
|
38
|
+
once the main feature setting is enabled. After enabling the feature, you need to configure at least one\
|
|
39
|
+
LLM provider below. Also see [the documentation](https://theia-ide.org/docs/user_ai/)**.',
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
[exports.PREFERENCE_NAME_PROMPT_TEMPLATES]: {
|
|
44
|
+
title: exports.AI_CORE_PREFERENCES_TITLE,
|
|
45
|
+
description: 'Folder for storing customized prompt templates. If not customized the user config directory is used. Please consider to use a folder, which is\
|
|
46
|
+
under version control to manage your variants of prompt templates.',
|
|
47
|
+
type: 'string',
|
|
48
|
+
default: '',
|
|
49
|
+
typeDetails: {
|
|
50
|
+
isFilepath: true,
|
|
51
|
+
selectionProps: {
|
|
52
|
+
openLabel: 'Select Folder',
|
|
53
|
+
canSelectFiles: false,
|
|
54
|
+
canSelectFolders: true,
|
|
55
|
+
canSelectMany: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
[exports.PREFERENCE_NAME_REQUEST_SETTINGS]: {
|
|
60
|
+
title: 'Custom Request Settings',
|
|
61
|
+
markdownDescription: 'Allows specifying custom request settings for multiple models.\n\
|
|
62
|
+
Each object represents the configuration for a specific model. The `modelId` field specifies the model ID, `requestSettings` defines model-specific settings.\n\
|
|
63
|
+
The `providerId` field is optional and allows you to apply the settings to a specific provider. If not set, the settings will be applied to all providers.\n\
|
|
64
|
+
Example providerIds: huggingface, openai, ollama, llamafile.\n\
|
|
65
|
+
Refer to [our documentation](https://theia-ide.org/docs/user_ai/#custom-request-settings) for more information.',
|
|
66
|
+
type: 'array',
|
|
67
|
+
items: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
modelId: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'The model id'
|
|
73
|
+
},
|
|
74
|
+
requestSettings: {
|
|
75
|
+
type: 'object',
|
|
76
|
+
additionalProperties: true,
|
|
77
|
+
description: 'Settings for the specific model ID.',
|
|
78
|
+
},
|
|
79
|
+
providerId: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'The (optional) provider id to apply the settings to. If not set, the settings will be applied to all providers.',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
default: [],
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.AICorePreferences = Symbol('AICorePreferences');
|
|
90
|
+
function bindAICorePreferences(bind) {
|
|
91
|
+
bind(exports.AICorePreferences).toDynamicValue(ctx => {
|
|
92
|
+
const factory = ctx.container.get(injectable_preference_proxy_1.PreferenceProxyFactory);
|
|
93
|
+
return factory(exports.aiCorePreferenceSchema);
|
|
94
|
+
}).inSingletonScope();
|
|
95
|
+
bind(browser_1.PreferenceContribution).toConstantValue({ schema: exports.aiCorePreferenceSchema });
|
|
96
|
+
}
|
|
97
|
+
exports.bindAICorePreferences = bindAICorePreferences;
|
|
98
|
+
//# sourceMappingURL=ai-core-preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-core-preferences.js","sourceRoot":"","sources":["../../src/browser/ai-core-preferences.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,qDAAoG;AACpG,iHAAyG;AAG5F,QAAA,yBAAyB,GAAG,8BAA8B,CAAC;AAC3D,QAAA,mCAAmC,GAAG,+BAA+B,CAAC;AACtE,QAAA,gCAAgC,GAAG,mDAAmD,CAAC;AACvF,QAAA,gCAAgC,GAAG,2CAA2C,CAAC;AAE/E,QAAA,sBAAsB,GAAqB;IACpD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,CAAC,2CAAmC,CAAC,EAAE;YACnC,KAAK,EAAE,iCAAyB;YAChC,mBAAmB,EAAE;;;;;;;;;qGASoE;YACzF,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACjB;QACD,CAAC,wCAAgC,CAAC,EAAE;YAChC,KAAK,EAAE,iCAAyB;YAChC,WAAW,EAAE;+EACsD;YACnE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EAAE;gBACT,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE;oBACZ,SAAS,EAAE,eAAe;oBAC1B,cAAc,EAAE,KAAK;oBACrB,gBAAgB,EAAE,IAAI;oBACtB,aAAa,EAAE,KAAK;iBACvB;aACJ;SACJ;QACD,CAAC,wCAAgC,CAAC,EAAE;YAChC,KAAK,EAAE,yBAAyB;YAChC,mBAAmB,EAAE;;;;4HAI2F;YAChH,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,OAAO,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,cAAc;qBAC9B;oBACD,eAAe,EAAE;wBACb,IAAI,EAAE,QAAQ;wBACd,oBAAoB,EAAE,IAAI;wBAC1B,WAAW,EAAE,qCAAqC;qBACrD;oBACD,UAAU,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iHAAiH;qBACjI;iBACJ;aACJ;YACD,OAAO,EAAE,EAAE;SACd;KACJ;CACJ,CAAC;AAiBW,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAG7D,SAAgB,qBAAqB,CAAC,IAAqB;IACvD,IAAI,CAAC,yBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACzC,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAyB,oDAAsB,CAAC,CAAC;QAClF,OAAO,OAAO,CAAC,8BAAsB,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtB,IAAI,CAAC,gCAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,8BAAsB,EAAE,CAAC,CAAC;AACrF,CAAC;AAND,sDAMC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DisposableCollection, Emitter, Event } from '@theia/core';
|
|
2
|
+
import { PreferenceService } from '@theia/core/lib/browser';
|
|
3
|
+
import { AISettings, AISettingsService, AgentSettings } from '../common';
|
|
4
|
+
export declare class AISettingsServiceImpl implements AISettingsService {
|
|
5
|
+
protected preferenceService: PreferenceService;
|
|
6
|
+
static readonly PREFERENCE_NAME = "ai-features.agentSettings";
|
|
7
|
+
protected toDispose: DisposableCollection;
|
|
8
|
+
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
9
|
+
onDidChange: Event<void>;
|
|
10
|
+
updateAgentSettings(agent: string, agentSettings: Partial<AgentSettings>): Promise<void>;
|
|
11
|
+
getAgentSettings(agent: string): Promise<AgentSettings | undefined>;
|
|
12
|
+
getSettings(): Promise<AISettings>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ai-settings-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-settings-service.d.ts","sourceRoot":"","sources":["../../src/browser/ai-settings-service.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAmB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG7E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEzE,qBACa,qBAAsB,YAAW,iBAAiB;IAChC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,eAAe,+BAA+B;IAE9D,SAAS,CAAC,SAAS,uBAA8B;IAEjD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,gBAAuB;IAC5D,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAiC;IAEnD,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxF,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAKnE,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC;CAK3C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var AISettingsServiceImpl_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AISettingsServiceImpl = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
// *****************************************************************************
|
|
7
|
+
// Copyright (C) 2024 EclipseSource GmbH.
|
|
8
|
+
//
|
|
9
|
+
// This program and the accompanying materials are made available under the
|
|
10
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
11
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
12
|
+
//
|
|
13
|
+
// This Source Code may also be made available under the following Secondary
|
|
14
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
15
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
16
|
+
// with the GNU Classpath Exception which is available at
|
|
17
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
18
|
+
//
|
|
19
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
20
|
+
// *****************************************************************************
|
|
21
|
+
const core_1 = require("@theia/core");
|
|
22
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
let AISettingsServiceImpl = AISettingsServiceImpl_1 = class AISettingsServiceImpl {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.toDispose = new core_1.DisposableCollection();
|
|
27
|
+
this.onDidChangeEmitter = new core_1.Emitter();
|
|
28
|
+
this.onDidChange = this.onDidChangeEmitter.event;
|
|
29
|
+
}
|
|
30
|
+
async updateAgentSettings(agent, agentSettings) {
|
|
31
|
+
const settings = await this.getSettings();
|
|
32
|
+
const newAgentSettings = { ...settings[agent], ...agentSettings };
|
|
33
|
+
settings[agent] = newAgentSettings;
|
|
34
|
+
this.preferenceService.set(AISettingsServiceImpl_1.PREFERENCE_NAME, settings, browser_1.PreferenceScope.User);
|
|
35
|
+
this.onDidChangeEmitter.fire();
|
|
36
|
+
}
|
|
37
|
+
async getAgentSettings(agent) {
|
|
38
|
+
const settings = await this.getSettings();
|
|
39
|
+
return settings[agent];
|
|
40
|
+
}
|
|
41
|
+
async getSettings() {
|
|
42
|
+
await this.preferenceService.ready;
|
|
43
|
+
const pref = this.preferenceService.inspect(AISettingsServiceImpl_1.PREFERENCE_NAME);
|
|
44
|
+
return (pref === null || pref === void 0 ? void 0 : pref.value) ? pref.value : {};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.AISettingsServiceImpl = AISettingsServiceImpl;
|
|
48
|
+
AISettingsServiceImpl.PREFERENCE_NAME = 'ai-features.agentSettings';
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, inversify_1.inject)(browser_1.PreferenceService),
|
|
51
|
+
tslib_1.__metadata("design:type", Object)
|
|
52
|
+
], AISettingsServiceImpl.prototype, "preferenceService", void 0);
|
|
53
|
+
exports.AISettingsServiceImpl = AISettingsServiceImpl = AISettingsServiceImpl_1 = tslib_1.__decorate([
|
|
54
|
+
(0, inversify_1.injectable)()
|
|
55
|
+
], AISettingsServiceImpl);
|
|
56
|
+
//# sourceMappingURL=ai-settings-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-settings-service.js","sourceRoot":"","sources":["../../src/browser/ai-settings-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,sCAAmE;AACnE,qDAA6E;AAC7E,4DAAkE;AAK3D,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAA3B;QAIO,cAAS,GAAG,IAAI,2BAAoB,EAAE,CAAC;QAE9B,uBAAkB,GAAG,IAAI,cAAO,EAAQ,CAAC;QAC5D,gBAAW,GAAgB,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;IAoB7D,CAAC;IAlBG,KAAK,CAAC,mBAAmB,CAAC,KAAa,EAAE,aAAqC;QAC1E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,gBAAgB,GAAG,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,aAAa,EAAE,CAAC;QAClE,QAAQ,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC;QACnC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,uBAAqB,CAAC,eAAe,EAAE,QAAQ,EAAE,yBAAe,CAAC,IAAI,CAAC,CAAC;QAClG,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAa;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,WAAW;QACb,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAA0B,uBAAqB,CAAC,eAAe,CAAC,CAAC;QAC5G,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,CAAC;;AA1BQ,sDAAqB;AAEd,qCAAe,GAAG,2BAA2B,AAA9B,CAA+B;AADzB;IAApC,IAAA,kBAAM,EAAC,2BAAiB,CAAC;;gEAAgD;gCADjE,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CA2BjC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandRegistry, MenuModelRegistry } from '@theia/core';
|
|
2
|
+
import { AbstractViewContribution, KeybindingRegistry, PreferenceService, Widget } from '@theia/core/lib/browser';
|
|
3
|
+
import { AIActivationService } from './ai-activation-service';
|
|
4
|
+
import { AICommandHandlerFactory } from './ai-command-handler-factory';
|
|
5
|
+
export declare class AIViewContribution<T extends Widget> extends AbstractViewContribution<T> {
|
|
6
|
+
protected readonly preferenceService: PreferenceService;
|
|
7
|
+
protected readonly activationService: AIActivationService;
|
|
8
|
+
protected readonly commandHandlerFactory: AICommandHandlerFactory;
|
|
9
|
+
protected init(): void;
|
|
10
|
+
registerCommands(commands: CommandRegistry): void;
|
|
11
|
+
registerMenus(menus: MenuModelRegistry): void;
|
|
12
|
+
registerKeybindings(keybindings: KeybindingRegistry): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ai-view-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-view-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/ai-view-contribution.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAe,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE/H,OAAO,EAAE,mBAAmB,EAA+B,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,qBACa,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,wBAAwB,CAAC,CAAC,CAAC;IAGjF,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;IAGlE,SAAS,CAAC,IAAI,IAAI,IAAI;IAQb,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAejD,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAS7C,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI;CAStE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIViewContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
6
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
7
|
+
const ai_activation_service_1 = require("./ai-activation-service");
|
|
8
|
+
const ai_command_handler_factory_1 = require("./ai-command-handler-factory");
|
|
9
|
+
let AIViewContribution = class AIViewContribution extends browser_1.AbstractViewContribution {
|
|
10
|
+
init() {
|
|
11
|
+
this.activationService.onDidChangeActiveStatus(active => {
|
|
12
|
+
if (!active) {
|
|
13
|
+
this.closeView();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
registerCommands(commands) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (this.toggleCommand) {
|
|
20
|
+
commands.registerCommand(this.toggleCommand, this.commandHandlerFactory({
|
|
21
|
+
execute: () => this.toggleView(),
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
(_a = this.quickView) === null || _a === void 0 ? void 0 : _a.registerItem({
|
|
25
|
+
label: this.viewLabel,
|
|
26
|
+
when: ai_activation_service_1.EXPERIMENTAL_AI_CONTEXT_KEY,
|
|
27
|
+
open: () => this.openView({ activate: true })
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
registerMenus(menus) {
|
|
31
|
+
if (this.toggleCommand) {
|
|
32
|
+
menus.registerMenuAction(browser_1.CommonMenus.VIEW_VIEWS, {
|
|
33
|
+
commandId: this.toggleCommand.id,
|
|
34
|
+
when: ai_activation_service_1.EXPERIMENTAL_AI_CONTEXT_KEY,
|
|
35
|
+
label: this.viewLabel
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
registerKeybindings(keybindings) {
|
|
40
|
+
if (this.toggleCommand && this.options.toggleKeybinding) {
|
|
41
|
+
keybindings.registerKeybinding({
|
|
42
|
+
command: this.toggleCommand.id,
|
|
43
|
+
when: ai_activation_service_1.EXPERIMENTAL_AI_CONTEXT_KEY,
|
|
44
|
+
keybinding: this.options.toggleKeybinding
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.AIViewContribution = AIViewContribution;
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, inversify_1.inject)(browser_1.PreferenceService),
|
|
52
|
+
tslib_1.__metadata("design:type", Object)
|
|
53
|
+
], AIViewContribution.prototype, "preferenceService", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, inversify_1.inject)(ai_activation_service_1.AIActivationService),
|
|
56
|
+
tslib_1.__metadata("design:type", ai_activation_service_1.AIActivationService)
|
|
57
|
+
], AIViewContribution.prototype, "activationService", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, inversify_1.inject)(ai_command_handler_factory_1.AICommandHandlerFactory),
|
|
60
|
+
tslib_1.__metadata("design:type", Function)
|
|
61
|
+
], AIViewContribution.prototype, "commandHandlerFactory", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, inversify_1.postConstruct)(),
|
|
64
|
+
tslib_1.__metadata("design:type", Function),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
66
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
67
|
+
], AIViewContribution.prototype, "init", null);
|
|
68
|
+
exports.AIViewContribution = AIViewContribution = tslib_1.__decorate([
|
|
69
|
+
(0, inversify_1.injectable)()
|
|
70
|
+
], AIViewContribution);
|
|
71
|
+
//# sourceMappingURL=ai-view-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-view-contribution.js","sourceRoot":"","sources":["../../src/browser/ai-view-contribution.ts"],"names":[],"mappings":";;;;AAgBA,qDAA+H;AAC/H,4DAAiF;AACjF,mEAA2F;AAC3F,6EAAuE;AAGhE,IAAM,kBAAkB,GAAxB,MAAM,kBAAqC,SAAQ,kCAA2B;IAYvE,IAAI;QACV,IAAI,CAAC,iBAAiB,CAAC,uBAAuB,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,CAAA;AArDY,gDAAkB;AAGR;IADlB,IAAA,kBAAM,EAAC,2BAAiB,CAAC;;6DAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;sCACU,2CAAmB;6DAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,oDAAuB,CAAC;;iEACkC;AAGxD;IADT,IAAA,yBAAa,GAAE;;;;8CAOf;6BAlBQ,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAqD9B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ILogger } from '@theia/core';
|
|
2
|
+
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
3
|
+
import { AISettingsService, DefaultLanguageModelRegistryImpl, LanguageModel, LanguageModelDelegateClient, LanguageModelFrontendDelegate, LanguageModelMetaData, LanguageModelRegistryClient, LanguageModelRegistryFrontendDelegate, LanguageModelSelector, LanguageModelStreamResponsePart } from '../common';
|
|
4
|
+
export declare class LanguageModelDelegateClientImpl implements LanguageModelDelegateClient, LanguageModelRegistryClient {
|
|
5
|
+
protected receiver: FrontendLanguageModelRegistryImpl;
|
|
6
|
+
setReceiver(receiver: FrontendLanguageModelRegistryImpl): void;
|
|
7
|
+
send(id: string, token: LanguageModelStreamResponsePart | undefined): void;
|
|
8
|
+
toolCall(requestId: string, toolId: string, args_string: string): Promise<unknown>;
|
|
9
|
+
languageModelAdded(metadata: LanguageModelMetaData): void;
|
|
10
|
+
languageModelRemoved(id: string): void;
|
|
11
|
+
}
|
|
12
|
+
interface StreamState {
|
|
13
|
+
id: string;
|
|
14
|
+
tokens: (LanguageModelStreamResponsePart | undefined)[];
|
|
15
|
+
resolve?: (_: unknown) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare class FrontendLanguageModelRegistryImpl extends DefaultLanguageModelRegistryImpl {
|
|
18
|
+
languageModelAdded(metadata: LanguageModelMetaData): void;
|
|
19
|
+
languageModelRemoved(id: string): void;
|
|
20
|
+
protected registryDelegate: LanguageModelRegistryFrontendDelegate;
|
|
21
|
+
protected providerDelegate: LanguageModelFrontendDelegate;
|
|
22
|
+
protected client: LanguageModelDelegateClientImpl;
|
|
23
|
+
protected logger: ILogger;
|
|
24
|
+
protected outputChannelManager: OutputChannelManager;
|
|
25
|
+
protected settingsService: AISettingsService;
|
|
26
|
+
private static requestCounter;
|
|
27
|
+
addLanguageModels(models: LanguageModelMetaData[] | LanguageModel[]): void;
|
|
28
|
+
protected init(): void;
|
|
29
|
+
createFrontendLanguageModel(description: LanguageModelMetaData): LanguageModel;
|
|
30
|
+
private streams;
|
|
31
|
+
private requests;
|
|
32
|
+
getIterable(state: StreamState): AsyncIterable<LanguageModelStreamResponsePart>;
|
|
33
|
+
send(id: string, token: LanguageModelStreamResponsePart | undefined): void;
|
|
34
|
+
toolCall(id: string, toolId: string, arg_string: string): Promise<unknown>;
|
|
35
|
+
selectLanguageModels(request: LanguageModelSelector): Promise<LanguageModel[]>;
|
|
36
|
+
selectLanguageModel(request: LanguageModelSelector): Promise<LanguageModel | undefined>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=frontend-language-model-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-language-model-registry.d.ts","sourceRoot":"","sources":["../../src/browser/frontend-language-model-registry.ts"],"names":[],"mappings":"AAeA,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAMzD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACH,iBAAiB,EACjB,gCAAgC,EAMhC,aAAa,EACb,2BAA2B,EAC3B,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC3B,qCAAqC,EAGrC,qBAAqB,EACrB,+BAA+B,EAClC,MAAM,WAAW,CAAC;AAEnB,qBACa,+BACT,YAAW,2BAA2B,EAAE,2BAA2B;IACnE,SAAS,CAAC,QAAQ,EAAE,iCAAiC,CAA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