@theia/ai-core 1.67.0-next.56 → 1.67.0-next.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/agent-completion-notification-service.d.ts +69 -0
- package/lib/browser/agent-completion-notification-service.d.ts.map +1 -0
- package/lib/browser/agent-completion-notification-service.js +187 -0
- package/lib/browser/agent-completion-notification-service.js.map +1 -0
- package/lib/browser/ai-activation-service.d.ts +31 -0
- package/lib/browser/ai-activation-service.d.ts.map +1 -0
- package/lib/browser/ai-activation-service.js +56 -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-core-command-contribution.d.ts +8 -0
- package/lib/browser/ai-core-command-contribution.d.ts.map +1 -0
- package/lib/browser/ai-core-command-contribution.js +44 -0
- package/lib/browser/ai-core-command-contribution.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 +137 -0
- package/lib/browser/ai-core-frontend-module.js.map +1 -0
- package/lib/browser/ai-settings-service.d.ts +16 -0
- package/lib/browser/ai-settings-service.d.ts.map +1 -0
- package/lib/browser/ai-settings-service.js +76 -0
- package/lib/browser/ai-settings-service.js.map +1 -0
- package/lib/browser/ai-variable-uri-label-provider.d.ts +17 -0
- package/lib/browser/ai-variable-uri-label-provider.d.ts.map +1 -0
- package/lib/browser/ai-variable-uri-label-provider.js +85 -0
- package/lib/browser/ai-variable-uri-label-provider.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 +87 -0
- package/lib/browser/ai-view-contribution.js.map +1 -0
- package/lib/browser/file-variable-contribution.d.ts +23 -0
- package/lib/browser/file-variable-contribution.d.ts.map +1 -0
- package/lib/browser/file-variable-contribution.js +114 -0
- package/lib/browser/file-variable-contribution.js.map +1 -0
- package/lib/browser/frontend-language-model-alias-registry.d.ts +31 -0
- package/lib/browser/frontend-language-model-alias-registry.d.ts.map +1 -0
- package/lib/browser/frontend-language-model-alias-registry.js +170 -0
- package/lib/browser/frontend-language-model-alias-registry.js.map +1 -0
- package/lib/browser/frontend-language-model-registry.d.ts +49 -0
- package/lib/browser/frontend-language-model-registry.d.ts.map +1 -0
- package/lib/browser/frontend-language-model-registry.js +387 -0
- package/lib/browser/frontend-language-model-registry.js.map +1 -0
- package/lib/browser/frontend-language-model-registry.spec.d.ts +2 -0
- package/lib/browser/frontend-language-model-registry.spec.d.ts.map +1 -0
- package/lib/browser/frontend-language-model-registry.spec.js +248 -0
- package/lib/browser/frontend-language-model-registry.spec.js.map +1 -0
- package/lib/browser/frontend-language-model-service.d.ts +10 -0
- package/lib/browser/frontend-language-model-service.d.ts.map +1 -0
- package/lib/browser/frontend-language-model-service.js +66 -0
- package/lib/browser/frontend-language-model-service.js.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.d.ts +271 -0
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.js +869 -0
- package/lib/browser/frontend-prompt-customization-service.js.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.spec.d.ts +2 -0
- package/lib/browser/frontend-prompt-customization-service.spec.d.ts.map +1 -0
- package/lib/browser/frontend-prompt-customization-service.spec.js +127 -0
- package/lib/browser/frontend-prompt-customization-service.spec.js.map +1 -0
- package/lib/browser/frontend-variable-service.d.ts +61 -0
- package/lib/browser/frontend-variable-service.d.ts.map +1 -0
- package/lib/browser/frontend-variable-service.js +165 -0
- package/lib/browser/frontend-variable-service.js.map +1 -0
- package/lib/browser/index.d.ts +20 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +38 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/open-editors-variable-contribution.d.ts +17 -0
- package/lib/browser/open-editors-variable-contribution.d.ts.map +1 -0
- package/lib/browser/open-editors-variable-contribution.js +84 -0
- package/lib/browser/open-editors-variable-contribution.js.map +1 -0
- package/lib/browser/os-notification-service.d.ts +96 -0
- package/lib/browser/os-notification-service.d.ts.map +1 -0
- package/lib/browser/os-notification-service.js +222 -0
- package/lib/browser/os-notification-service.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 +246 -0
- package/lib/browser/prompttemplate-contribution.js.map +1 -0
- package/lib/browser/prompttemplate-parser.d.ts +36 -0
- package/lib/browser/prompttemplate-parser.d.ts.map +1 -0
- package/lib/browser/prompttemplate-parser.js +94 -0
- package/lib/browser/prompttemplate-parser.js.map +1 -0
- package/lib/browser/theia-variable-contribution.d.ts +26 -0
- package/lib/browser/theia-variable-contribution.d.ts.map +1 -0
- package/lib/browser/theia-variable-contribution.js +146 -0
- package/lib/browser/theia-variable-contribution.js.map +1 -0
- package/lib/browser/token-usage-frontend-service-impl.d.ts +25 -0
- package/lib/browser/token-usage-frontend-service-impl.d.ts.map +1 -0
- package/lib/browser/token-usage-frontend-service-impl.js +138 -0
- package/lib/browser/token-usage-frontend-service-impl.js.map +1 -0
- package/lib/browser/token-usage-frontend-service.d.ts +33 -0
- package/lib/browser/token-usage-frontend-service.d.ts.map +1 -0
- package/lib/browser/token-usage-frontend-service.js +23 -0
- package/lib/browser/token-usage-frontend-service.js.map +1 -0
- package/lib/browser/window-blink-service.d.ts +41 -0
- package/lib/browser/window-blink-service.d.ts.map +1 -0
- package/lib/browser/window-blink-service.js +174 -0
- package/lib/browser/window-blink-service.js.map +1 -0
- package/lib/common/agent-preferences.d.ts +4 -0
- package/lib/common/agent-preferences.d.ts.map +1 -0
- package/lib/common/agent-preferences.js +84 -0
- package/lib/common/agent-preferences.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 +104 -0
- package/lib/common/agent-service.js.map +1 -0
- package/lib/common/agent.d.ts +72 -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 +57 -0
- package/lib/common/agents-variable-contribution.js.map +1 -0
- package/lib/common/ai-core-preferences.d.ts +48 -0
- package/lib/common/ai-core-preferences.d.ts.map +1 -0
- package/lib/common/ai-core-preferences.js +204 -0
- package/lib/common/ai-core-preferences.js.map +1 -0
- package/lib/common/ai-variable-resource.d.ts +18 -0
- package/lib/common/ai-variable-resource.d.ts.map +1 -0
- package/lib/common/ai-variable-resource.js +103 -0
- package/lib/common/ai-variable-resource.js.map +1 -0
- package/lib/common/configurable-in-memory-resources.d.ts +47 -0
- package/lib/common/configurable-in-memory-resources.d.ts.map +1 -0
- package/lib/common/configurable-in-memory-resources.js +154 -0
- package/lib/common/configurable-in-memory-resources.js.map +1 -0
- package/lib/common/index.d.ts +22 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +40 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/language-model-alias.d.ts +58 -0
- package/lib/common/language-model-alias.d.ts.map +1 -0
- package/lib/common/language-model-alias.js +20 -0
- package/lib/common/language-model-alias.js.map +1 -0
- package/lib/common/language-model-delegate.d.ts +25 -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-interaction-model.d.ts +74 -0
- package/lib/common/language-model-interaction-model.d.ts.map +1 -0
- package/lib/common/language-model-interaction-model.js +3 -0
- package/lib/common/language-model-interaction-model.js.map +1 -0
- package/lib/common/language-model-service.d.ts +38 -0
- package/lib/common/language-model-service.d.ts.map +1 -0
- package/lib/common/language-model-service.js +128 -0
- package/lib/common/language-model-service.js.map +1 -0
- package/lib/common/language-model-util.d.ts +17 -0
- package/lib/common/language-model-util.d.ts.map +1 -0
- package/lib/common/language-model-util.js +82 -0
- package/lib/common/language-model-util.js.map +1 -0
- package/lib/common/language-model.d.ts +285 -0
- package/lib/common/language-model.d.ts.map +1 -0
- package/lib/common/language-model.js +248 -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/notification-types.d.ts +7 -0
- package/lib/common/notification-types.d.ts.map +1 -0
- package/lib/common/notification-types.js +29 -0
- package/lib/common/notification-types.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 +467 -0
- package/lib/common/prompt-service.d.ts.map +1 -0
- package/lib/common/prompt-service.js +657 -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 +431 -0
- package/lib/common/prompt-service.spec.js.map +1 -0
- package/lib/common/prompt-text.d.ts +8 -0
- package/lib/common/prompt-text.d.ts.map +1 -0
- package/lib/common/prompt-text.js +27 -0
- package/lib/common/prompt-text.js.map +1 -0
- package/lib/common/prompt-variable-contribution.d.ts +18 -0
- package/lib/common/prompt-variable-contribution.d.ts.map +1 -0
- package/lib/common/prompt-variable-contribution.js +207 -0
- package/lib/common/prompt-variable-contribution.js.map +1 -0
- package/lib/common/prompt-variable-contribution.spec.d.ts +2 -0
- package/lib/common/prompt-variable-contribution.spec.d.ts.map +1 -0
- package/lib/common/prompt-variable-contribution.spec.js +163 -0
- package/lib/common/prompt-variable-contribution.spec.js.map +1 -0
- package/lib/common/protocol.d.ts +25 -0
- package/lib/common/protocol.d.ts.map +1 -0
- package/lib/common/protocol.js +22 -0
- package/lib/common/protocol.js.map +1 -0
- package/lib/common/settings-service.d.ts +29 -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 +68 -0
- package/lib/common/today-variable-contribution.js.map +1 -0
- package/lib/common/token-usage-service.d.ts +43 -0
- package/lib/common/token-usage-service.d.ts.map +1 -0
- package/lib/common/token-usage-service.js +20 -0
- package/lib/common/token-usage-service.js.map +1 -0
- package/lib/common/tool-invocation-registry.d.ts +66 -0
- package/lib/common/tool-invocation-registry.d.ts.map +1 -0
- package/lib/common/tool-invocation-registry.js +101 -0
- package/lib/common/tool-invocation-registry.js.map +1 -0
- package/lib/common/variable-service.d.ts +172 -0
- package/lib/common/variable-service.d.ts.map +1 -0
- package/lib/common/variable-service.js +287 -0
- package/lib/common/variable-service.js.map +1 -0
- package/lib/common/variable-service.spec.d.ts +2 -0
- package/lib/common/variable-service.spec.d.ts.map +1 -0
- package/lib/common/variable-service.spec.js +237 -0
- package/lib/common/variable-service.spec.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 +65 -0
- package/lib/node/ai-core-backend-module.js.map +1 -0
- package/lib/node/backend-language-model-registry.d.ts +13 -0
- package/lib/node/backend-language-model-registry.d.ts.map +1 -0
- package/lib/node/backend-language-model-registry.js +68 -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 +109 -0
- package/lib/node/language-model-frontend-delegate.js.map +1 -0
- package/lib/node/token-usage-service-impl.d.ts +23 -0
- package/lib/node/token-usage-service-impl.d.ts.map +1 -0
- package/lib/node/token-usage-service-impl.js +78 -0
- package/lib/node/token-usage-service-impl.js.map +1 -0
- package/lib/node/tool-request-parameters.spec.d.ts +2 -0
- package/lib/node/tool-request-parameters.spec.d.ts.map +1 -0
- package/lib/node/tool-request-parameters.spec.js +116 -0
- package/lib/node/tool-request-parameters.spec.js.map +1 -0
- package/package.json +9 -9
- package/src/browser/ai-settings-service.ts +7 -10
- package/src/browser/prompttemplate-contribution.ts +7 -4
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
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 frontend_language_model_alias_registry_1 = require("./frontend-language-model-alias-registry");
|
|
22
|
+
const language_model_alias_1 = require("../common/language-model-alias");
|
|
23
|
+
const common_1 = require("../common");
|
|
24
|
+
const frontend_language_model_registry_1 = require("./frontend-language-model-registry");
|
|
25
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
26
|
+
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
27
|
+
const textmate_1 = require("@theia/monaco/lib/browser/textmate");
|
|
28
|
+
const ai_core_frontend_application_contribution_1 = require("./ai-core-frontend-application-contribution");
|
|
29
|
+
const ai_core_preferences_1 = require("../common/ai-core-preferences");
|
|
30
|
+
const ai_settings_service_1 = require("./ai-settings-service");
|
|
31
|
+
const frontend_prompt_customization_service_1 = require("./frontend-prompt-customization-service");
|
|
32
|
+
const frontend_variable_service_1 = require("./frontend-variable-service");
|
|
33
|
+
const prompttemplate_contribution_1 = require("./prompttemplate-contribution");
|
|
34
|
+
const file_variable_contribution_1 = require("./file-variable-contribution");
|
|
35
|
+
const theia_variable_contribution_1 = require("./theia-variable-contribution");
|
|
36
|
+
const today_variable_contribution_1 = require("../common/today-variable-contribution");
|
|
37
|
+
const agents_variable_contribution_1 = require("../common/agents-variable-contribution");
|
|
38
|
+
const open_editors_variable_contribution_1 = require("./open-editors-variable-contribution");
|
|
39
|
+
const ai_activation_service_1 = require("./ai-activation-service");
|
|
40
|
+
const agent_service_1 = require("../common/agent-service");
|
|
41
|
+
const ai_command_handler_factory_1 = require("./ai-command-handler-factory");
|
|
42
|
+
const settings_service_1 = require("../common/settings-service");
|
|
43
|
+
const ai_core_command_contribution_1 = require("./ai-core-command-contribution");
|
|
44
|
+
const prompt_variable_contribution_1 = require("../common/prompt-variable-contribution");
|
|
45
|
+
const language_model_service_1 = require("../common/language-model-service");
|
|
46
|
+
const frontend_language_model_service_1 = require("./frontend-language-model-service");
|
|
47
|
+
const token_usage_frontend_service_1 = require("./token-usage-frontend-service");
|
|
48
|
+
const token_usage_frontend_service_impl_1 = require("./token-usage-frontend-service-impl");
|
|
49
|
+
const ai_variable_uri_label_provider_1 = require("./ai-variable-uri-label-provider");
|
|
50
|
+
const agent_completion_notification_service_1 = require("./agent-completion-notification-service");
|
|
51
|
+
const os_notification_service_1 = require("./os-notification-service");
|
|
52
|
+
const window_blink_service_1 = require("./window-blink-service");
|
|
53
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
54
|
+
(0, core_1.bindContributionProvider)(bind, common_1.Agent);
|
|
55
|
+
(0, core_1.bindContributionProvider)(bind, common_1.LanguageModelProvider);
|
|
56
|
+
bind(frontend_language_model_registry_1.FrontendLanguageModelRegistryImpl).toSelf().inSingletonScope();
|
|
57
|
+
bind(common_1.FrontendLanguageModelRegistry).toService(frontend_language_model_registry_1.FrontendLanguageModelRegistryImpl);
|
|
58
|
+
bind(common_1.LanguageModelRegistry).toService(frontend_language_model_registry_1.FrontendLanguageModelRegistryImpl);
|
|
59
|
+
bind(frontend_language_model_registry_1.LanguageModelDelegateClientImpl).toSelf().inSingletonScope();
|
|
60
|
+
bind(common_1.LanguageModelDelegateClient).toService(frontend_language_model_registry_1.LanguageModelDelegateClientImpl);
|
|
61
|
+
bind(common_1.LanguageModelRegistryClient).toService(common_1.LanguageModelDelegateClient);
|
|
62
|
+
bind(common_1.LanguageModelRegistryFrontendDelegate).toDynamicValue(ctx => {
|
|
63
|
+
const connection = ctx.container.get(service_connection_provider_1.RemoteConnectionProvider);
|
|
64
|
+
const client = ctx.container.get(common_1.LanguageModelRegistryClient);
|
|
65
|
+
return connection.createProxy(common_1.languageModelRegistryDelegatePath, client);
|
|
66
|
+
});
|
|
67
|
+
bind(common_1.LanguageModelFrontendDelegate)
|
|
68
|
+
.toDynamicValue(ctx => {
|
|
69
|
+
const connection = ctx.container.get(service_connection_provider_1.RemoteConnectionProvider);
|
|
70
|
+
const client = ctx.container.get(common_1.LanguageModelDelegateClient);
|
|
71
|
+
return connection.createProxy(common_1.languageModelDelegatePath, client);
|
|
72
|
+
})
|
|
73
|
+
.inSingletonScope();
|
|
74
|
+
(0, ai_core_preferences_1.bindAICorePreferences)(bind);
|
|
75
|
+
bind(frontend_prompt_customization_service_1.DefaultPromptFragmentCustomizationService).toSelf().inSingletonScope();
|
|
76
|
+
bind(common_1.PromptFragmentCustomizationService).toService(frontend_prompt_customization_service_1.DefaultPromptFragmentCustomizationService);
|
|
77
|
+
bind(common_1.PromptServiceImpl).toSelf().inSingletonScope();
|
|
78
|
+
bind(common_1.PromptService).toService(common_1.PromptServiceImpl);
|
|
79
|
+
bind(prompttemplate_contribution_1.PromptTemplateContribution).toSelf().inSingletonScope();
|
|
80
|
+
bind(textmate_1.LanguageGrammarDefinitionContribution).toService(prompttemplate_contribution_1.PromptTemplateContribution);
|
|
81
|
+
bind(core_1.CommandContribution).toService(prompttemplate_contribution_1.PromptTemplateContribution);
|
|
82
|
+
bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(prompttemplate_contribution_1.PromptTemplateContribution);
|
|
83
|
+
bind(ai_settings_service_1.AISettingsServiceImpl).toSelf().inSingletonScope();
|
|
84
|
+
bind(settings_service_1.AISettingsService).toService(ai_settings_service_1.AISettingsServiceImpl);
|
|
85
|
+
(0, core_1.bindContributionProvider)(bind, common_1.AIVariableContribution);
|
|
86
|
+
bind(frontend_variable_service_1.DefaultFrontendVariableService).toSelf().inSingletonScope();
|
|
87
|
+
bind(frontend_variable_service_1.FrontendVariableService).toService(frontend_variable_service_1.DefaultFrontendVariableService);
|
|
88
|
+
bind(common_1.AIVariableService).toService(frontend_variable_service_1.FrontendVariableService);
|
|
89
|
+
bind(browser_1.FrontendApplicationContribution).toService(frontend_variable_service_1.FrontendVariableService);
|
|
90
|
+
bind(theia_variable_contribution_1.TheiaVariableContribution).toSelf().inSingletonScope();
|
|
91
|
+
bind(common_1.AIVariableContribution).toService(theia_variable_contribution_1.TheiaVariableContribution);
|
|
92
|
+
bind(common_1.AIVariableContribution).to(prompt_variable_contribution_1.PromptVariableContribution).inSingletonScope();
|
|
93
|
+
bind(common_1.AIVariableContribution).to(today_variable_contribution_1.TodayVariableContribution).inSingletonScope();
|
|
94
|
+
bind(common_1.AIVariableContribution).to(file_variable_contribution_1.FileVariableContribution).inSingletonScope();
|
|
95
|
+
bind(common_1.AIVariableContribution).to(agents_variable_contribution_1.AgentsVariableContribution).inSingletonScope();
|
|
96
|
+
bind(common_1.AIVariableContribution).to(open_editors_variable_contribution_1.OpenEditorsVariableContribution).inSingletonScope();
|
|
97
|
+
bind(browser_1.FrontendApplicationContribution).to(ai_core_frontend_application_contribution_1.AICoreFrontendApplicationContribution).inSingletonScope();
|
|
98
|
+
bind(common_1.ToolInvocationRegistry).to(common_1.ToolInvocationRegistryImpl).inSingletonScope();
|
|
99
|
+
(0, core_1.bindContributionProvider)(bind, common_1.ToolProvider);
|
|
100
|
+
bind(ai_activation_service_1.AIActivationServiceImpl).toSelf().inSingletonScope();
|
|
101
|
+
bind(ai_activation_service_1.AIActivationService).toService(ai_activation_service_1.AIActivationServiceImpl);
|
|
102
|
+
bind(browser_1.FrontendApplicationContribution).toService(ai_activation_service_1.AIActivationService);
|
|
103
|
+
bind(agent_service_1.AgentServiceImpl).toSelf().inSingletonScope();
|
|
104
|
+
bind(agent_service_1.AgentService).toService(agent_service_1.AgentServiceImpl);
|
|
105
|
+
bind(ai_command_handler_factory_1.AICommandHandlerFactory).toFactory(context => (handler) => {
|
|
106
|
+
const activationService = context.container.get(ai_activation_service_1.AIActivationService);
|
|
107
|
+
return {
|
|
108
|
+
execute: (...args) => handler.execute(...args),
|
|
109
|
+
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); },
|
|
110
|
+
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); },
|
|
111
|
+
isToggled: handler.isToggled
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
bind(ai_core_command_contribution_1.AiCoreCommandContribution).toSelf().inSingletonScope();
|
|
115
|
+
bind(core_1.CommandContribution).toService(ai_core_command_contribution_1.AiCoreCommandContribution);
|
|
116
|
+
bind(frontend_language_model_service_1.FrontendLanguageModelServiceImpl).toSelf().inSingletonScope();
|
|
117
|
+
bind(language_model_service_1.LanguageModelService).toService(frontend_language_model_service_1.FrontendLanguageModelServiceImpl);
|
|
118
|
+
bind(token_usage_frontend_service_1.TokenUsageFrontendService).to(token_usage_frontend_service_impl_1.TokenUsageFrontendServiceImpl).inSingletonScope();
|
|
119
|
+
bind(common_1.TokenUsageServiceClient).to(token_usage_frontend_service_impl_1.TokenUsageServiceClientImpl).inSingletonScope();
|
|
120
|
+
bind(frontend_language_model_alias_registry_1.DefaultLanguageModelAliasRegistry).toSelf().inSingletonScope();
|
|
121
|
+
bind(language_model_alias_1.LanguageModelAliasRegistry).toService(frontend_language_model_alias_registry_1.DefaultLanguageModelAliasRegistry);
|
|
122
|
+
bind(common_1.TokenUsageService).toDynamicValue(ctx => {
|
|
123
|
+
const connection = ctx.container.get(service_connection_provider_1.RemoteConnectionProvider);
|
|
124
|
+
const client = ctx.container.get(common_1.TokenUsageServiceClient);
|
|
125
|
+
return connection.createProxy(common_1.TOKEN_USAGE_SERVICE_PATH, client);
|
|
126
|
+
}).inSingletonScope();
|
|
127
|
+
bind(common_1.AIVariableResourceResolver).toSelf().inSingletonScope();
|
|
128
|
+
bind(core_1.ResourceResolver).toService(common_1.AIVariableResourceResolver);
|
|
129
|
+
bind(ai_variable_uri_label_provider_1.AIVariableUriLabelProvider).toSelf().inSingletonScope();
|
|
130
|
+
bind(browser_1.LabelProviderContribution).toService(ai_variable_uri_label_provider_1.AIVariableUriLabelProvider);
|
|
131
|
+
bind(agent_completion_notification_service_1.AgentCompletionNotificationService).toSelf().inSingletonScope();
|
|
132
|
+
bind(os_notification_service_1.OSNotificationService).toSelf().inSingletonScope();
|
|
133
|
+
bind(window_blink_service_1.WindowBlinkService).toSelf().inSingletonScope();
|
|
134
|
+
bind(common_1.ConfigurableInMemoryResources).toSelf().inSingletonScope();
|
|
135
|
+
bind(core_1.ResourceResolver).toService(common_1.ConfigurableInMemoryResources);
|
|
136
|
+
});
|
|
137
|
+
//# 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;;AAEhF,sCAA8G;AAC9G,+GAGuE;AACvE,4DAA+D;AAC/D,qGAA6F;AAC7F,yEAA4E;AAC5E,sCAwBmB;AACnB,yFAG4C;AAC5C,qDAAqG;AACrG,mFAA0F;AAC1F,iEAA2F;AAC3F,2GAAoG;AACpG,uEAAsE;AACtE,+DAA8D;AAC9D,mGAAoG;AACpG,2EAAsG;AACtG,+EAA2E;AAC3E,6EAAwE;AACxE,+EAA0E;AAC1E,uFAAkF;AAClF,yFAAoF;AACpF,6FAAuF;AACvF,mEAAuF;AACvF,2DAAyE;AACzE,6EAAuE;AACvE,iEAA+D;AAC/D,iFAA2E;AAC3E,yFAAoF;AACpF,6EAAwE;AACxE,uFAAqF;AACrF,iFAA2E;AAC3E,2FAAiH;AACjH,qFAA8E;AAC9E,mGAA6F;AAC7F,uEAAkE;AAClE,iEAA4D;AAE5D,kBAAe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} from '@theia/core/lib/common';
|
|
3
|
+
import { AISettings, AISettingsService, AgentSettings } from '../common';
|
|
4
|
+
export declare class AISettingsServiceImpl implements AISettingsService {
|
|
5
|
+
protected readonly logger: ILogger;
|
|
6
|
+
protected preferenceService: PreferenceService;
|
|
7
|
+
static readonly PREFERENCE_NAME = "ai-features.agentSettings";
|
|
8
|
+
protected toDispose: DisposableCollection;
|
|
9
|
+
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
10
|
+
onDidChange: Event<void>;
|
|
11
|
+
protected init(): void;
|
|
12
|
+
updateAgentSettings(agent: string, agentSettings: Partial<AgentSettings>): Promise<void>;
|
|
13
|
+
getAgentSettings(agent: string): Promise<RecursiveReadonly<AgentSettings> | undefined>;
|
|
14
|
+
getSettings(): Promise<RecursiveReadonly<AISettings>>;
|
|
15
|
+
}
|
|
16
|
+
//# 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEzE,qBACa,qBAAsB,YAAW,iBAAiB;IAG3D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAER,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;IAGzD,SAAS,CAAC,IAAI,IAAI,IAAI;IAUhB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxF,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IAKtF,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;CAI9D"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const common_1 = require("@theia/core/lib/common");
|
|
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
|
+
init() {
|
|
31
|
+
this.toDispose.push(this.preferenceService.onPreferenceChanged(event => {
|
|
32
|
+
if (event.preferenceName === AISettingsServiceImpl_1.PREFERENCE_NAME) {
|
|
33
|
+
this.onDidChangeEmitter.fire();
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
async updateAgentSettings(agent, agentSettings) {
|
|
38
|
+
const settings = await this.getSettings();
|
|
39
|
+
const toSet = { ...settings, [agent]: { ...settings[agent], ...agentSettings } };
|
|
40
|
+
try {
|
|
41
|
+
await this.preferenceService.updateValue(AISettingsServiceImpl_1.PREFERENCE_NAME, toSet);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
this.onDidChangeEmitter.fire();
|
|
45
|
+
this.logger.warn('Updating the preferences was unsuccessful: ' + e);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async getAgentSettings(agent) {
|
|
49
|
+
const settings = await this.getSettings();
|
|
50
|
+
return settings[agent];
|
|
51
|
+
}
|
|
52
|
+
async getSettings() {
|
|
53
|
+
await this.preferenceService.ready;
|
|
54
|
+
return this.preferenceService.get(AISettingsServiceImpl_1.PREFERENCE_NAME, {});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.AISettingsServiceImpl = AISettingsServiceImpl;
|
|
58
|
+
AISettingsServiceImpl.PREFERENCE_NAME = 'ai-features.agentSettings';
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, inversify_1.inject)(core_1.ILogger),
|
|
61
|
+
tslib_1.__metadata("design:type", Object)
|
|
62
|
+
], AISettingsServiceImpl.prototype, "logger", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, inversify_1.inject)(common_1.PreferenceService),
|
|
65
|
+
tslib_1.__metadata("design:type", Object)
|
|
66
|
+
], AISettingsServiceImpl.prototype, "preferenceService", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, inversify_1.postConstruct)(),
|
|
69
|
+
tslib_1.__metadata("design:type", Function),
|
|
70
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
71
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
72
|
+
], AISettingsServiceImpl.prototype, "init", null);
|
|
73
|
+
exports.AISettingsServiceImpl = AISettingsServiceImpl = AISettingsServiceImpl_1 = tslib_1.__decorate([
|
|
74
|
+
(0, inversify_1.injectable)()
|
|
75
|
+
], AISettingsServiceImpl);
|
|
76
|
+
//# 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,sCAA+F;AAC/F,4DAAiF;AACjF,mDAA2D;AAIpD,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAA3B;QAQO,cAAS,GAAG,IAAI,2BAAoB,EAAE,CAAC;QAE9B,uBAAkB,GAAG,IAAI,cAAO,EAAQ,CAAC;QAC5D,gBAAW,GAAgB,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;IAiC7D,CAAC;IA9Ba,IAAI;QACV,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC/C,IAAI,KAAK,CAAC,cAAc,KAAK,uBAAqB,CAAC,eAAe,EAAE,CAAC;gBACjE,IAAI,CAAC,kBAAkB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,qBAAqB,CA4CjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { URI } from '@theia/core';
|
|
2
|
+
import { LabelProvider, LabelProviderContribution } from '@theia/core/lib/browser';
|
|
3
|
+
import { AIVariableResourceResolver } from '../common/ai-variable-resource';
|
|
4
|
+
import { AIVariableResolutionRequest, AIVariableService } from '../common/variable-service';
|
|
5
|
+
export declare class AIVariableUriLabelProvider implements LabelProviderContribution {
|
|
6
|
+
protected readonly labelProvider: LabelProvider;
|
|
7
|
+
protected variableResourceResolver: AIVariableResourceResolver;
|
|
8
|
+
protected readonly variableService: AIVariableService;
|
|
9
|
+
protected isMine(element: object): element is URI;
|
|
10
|
+
canHandle(element: object): number;
|
|
11
|
+
getIcon(element: object): string | undefined;
|
|
12
|
+
getName(element: object): string | undefined;
|
|
13
|
+
getLongName(element: object): string | undefined;
|
|
14
|
+
getDetails(element: object): string | undefined;
|
|
15
|
+
protected getResolutionRequest(element: object): AIVariableResolutionRequest | undefined;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ai-variable-uri-label-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-variable-uri-label-provider.d.ts","sourceRoot":"","sources":["../../src/browser/ai-variable-uri-label-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAA+B,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACzG,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE5F,qBACa,0BAA2B,YAAW,yBAAyB;IAEjD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACnC,SAAS,CAAC,wBAAwB,EAAE,0BAA0B,CAAC;IACxE,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAEjF,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,GAAG;IAIjD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIlC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAK5C,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAK5C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKhD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAK/C,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS;CAQ3F"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 Eclipse GmbH and others.
|
|
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.AIVariableUriLabelProvider = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const core_1 = require("@theia/core");
|
|
22
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
+
const ai_variable_resource_1 = require("../common/ai-variable-resource");
|
|
24
|
+
const variable_service_1 = require("../common/variable-service");
|
|
25
|
+
let AIVariableUriLabelProvider = class AIVariableUriLabelProvider {
|
|
26
|
+
isMine(element) {
|
|
27
|
+
return element instanceof core_1.URI && element.scheme === ai_variable_resource_1.AI_VARIABLE_RESOURCE_SCHEME;
|
|
28
|
+
}
|
|
29
|
+
canHandle(element) {
|
|
30
|
+
return this.isMine(element) ? 150 : -1;
|
|
31
|
+
}
|
|
32
|
+
getIcon(element) {
|
|
33
|
+
if (!this.isMine(element)) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return this.labelProvider.getIcon(this.getResolutionRequest(element));
|
|
37
|
+
}
|
|
38
|
+
getName(element) {
|
|
39
|
+
if (!this.isMine(element)) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return this.labelProvider.getName(this.getResolutionRequest(element));
|
|
43
|
+
}
|
|
44
|
+
getLongName(element) {
|
|
45
|
+
if (!this.isMine(element)) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
return this.labelProvider.getLongName(this.getResolutionRequest(element));
|
|
49
|
+
}
|
|
50
|
+
getDetails(element) {
|
|
51
|
+
if (!this.isMine(element)) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return this.labelProvider.getDetails(this.getResolutionRequest(element));
|
|
55
|
+
}
|
|
56
|
+
getResolutionRequest(element) {
|
|
57
|
+
if (!this.isMine(element)) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const metadata = this.variableResourceResolver.fromUri(element);
|
|
61
|
+
if (!metadata) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
const { variableName, arg } = metadata;
|
|
65
|
+
const variable = this.variableService.getVariable(variableName);
|
|
66
|
+
return variable && { variable, arg };
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.AIVariableUriLabelProvider = AIVariableUriLabelProvider;
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, inversify_1.inject)(browser_1.LabelProvider),
|
|
72
|
+
tslib_1.__metadata("design:type", browser_1.LabelProvider)
|
|
73
|
+
], AIVariableUriLabelProvider.prototype, "labelProvider", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, inversify_1.inject)(ai_variable_resource_1.AIVariableResourceResolver),
|
|
76
|
+
tslib_1.__metadata("design:type", ai_variable_resource_1.AIVariableResourceResolver)
|
|
77
|
+
], AIVariableUriLabelProvider.prototype, "variableResourceResolver", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, inversify_1.inject)(variable_service_1.AIVariableService),
|
|
80
|
+
tslib_1.__metadata("design:type", Object)
|
|
81
|
+
], AIVariableUriLabelProvider.prototype, "variableService", void 0);
|
|
82
|
+
exports.AIVariableUriLabelProvider = AIVariableUriLabelProvider = tslib_1.__decorate([
|
|
83
|
+
(0, inversify_1.injectable)()
|
|
84
|
+
], AIVariableUriLabelProvider);
|
|
85
|
+
//# sourceMappingURL=ai-variable-uri-label-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-variable-uri-label-provider.js","sourceRoot":"","sources":["../../src/browser/ai-variable-uri-label-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,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,4DAAkE;AAClE,sCAAkC;AAClC,qDAAmF;AACnF,yEAAyG;AACzG,iEAA4F;AAGrF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAMzB,MAAM,CAAC,OAAe;QAC5B,OAAO,OAAO,YAAY,U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C,EAAE,CAAC;YAAC,OAAO,SAAS,CAAC;QAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,EAAE,CAAC;YAAC,OAAO,SAAS,CAAC;QAAC,CAAC;QACpC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAChE,OAAO,QAAQ,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;IACzC,CAAC;CACJ,CAAA;AA1CY,gEAA0B;AAEO;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;sCAAmC,uBAAa;iEAAC;AACzB;IAA7C,IAAA,kBAAM,EAAC,iDAA0B,CAAC;sCAAqC,iDAA0B;4EAAC;AACrD;IAA7C,IAAA,kBAAM,EAAC,oCAAiB,CAAC;;mEAAuD;qCAJxE,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA0CtC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandRegistry, MenuModelRegistry, PreferenceService } from '@theia/core';
|
|
2
|
+
import { AbstractViewContribution, KeybindingRegistry, 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,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAe,kBAAkB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE5G,OAAO,EAAE,mBAAmB,EAAyB,MAAM,yBAAyB,CAAC;AACrF,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,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIViewContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// *****************************************************************************
|
|
6
|
+
// Copyright (C) 2024 EclipseSource GmbH.
|
|
7
|
+
//
|
|
8
|
+
// This program and the accompanying materials are made available under the
|
|
9
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
10
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
11
|
+
//
|
|
12
|
+
// This Source Code may also be made available under the following Secondary
|
|
13
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
14
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
15
|
+
// with the GNU Classpath Exception which is available at
|
|
16
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
17
|
+
//
|
|
18
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
19
|
+
// *****************************************************************************
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const ai_activation_service_1 = require("./ai-activation-service");
|
|
24
|
+
const ai_command_handler_factory_1 = require("./ai-command-handler-factory");
|
|
25
|
+
let AIViewContribution = class AIViewContribution extends browser_1.AbstractViewContribution {
|
|
26
|
+
init() {
|
|
27
|
+
this.activationService.onDidChangeActiveStatus(active => {
|
|
28
|
+
if (!active) {
|
|
29
|
+
this.closeView();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
registerCommands(commands) {
|
|
34
|
+
var _a;
|
|
35
|
+
if (this.toggleCommand) {
|
|
36
|
+
commands.registerCommand(this.toggleCommand, this.commandHandlerFactory({
|
|
37
|
+
execute: () => this.toggleView(),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
(_a = this.quickView) === null || _a === void 0 ? void 0 : _a.registerItem({
|
|
41
|
+
label: this.viewLabel,
|
|
42
|
+
when: ai_activation_service_1.ENABLE_AI_CONTEXT_KEY,
|
|
43
|
+
open: () => this.openView({ activate: true })
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
registerMenus(menus) {
|
|
47
|
+
if (this.toggleCommand) {
|
|
48
|
+
menus.registerMenuAction(browser_1.CommonMenus.VIEW_VIEWS, {
|
|
49
|
+
commandId: this.toggleCommand.id,
|
|
50
|
+
when: ai_activation_service_1.ENABLE_AI_CONTEXT_KEY,
|
|
51
|
+
label: this.viewLabel
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
registerKeybindings(keybindings) {
|
|
56
|
+
if (this.toggleCommand && this.options.toggleKeybinding) {
|
|
57
|
+
keybindings.registerKeybinding({
|
|
58
|
+
command: this.toggleCommand.id,
|
|
59
|
+
when: ai_activation_service_1.ENABLE_AI_CONTEXT_KEY,
|
|
60
|
+
keybinding: this.options.toggleKeybinding
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.AIViewContribution = AIViewContribution;
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
68
|
+
tslib_1.__metadata("design:type", Object)
|
|
69
|
+
], AIViewContribution.prototype, "preferenceService", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, inversify_1.inject)(ai_activation_service_1.AIActivationService),
|
|
72
|
+
tslib_1.__metadata("design:type", Object)
|
|
73
|
+
], AIViewContribution.prototype, "activationService", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, inversify_1.inject)(ai_command_handler_factory_1.AICommandHandlerFactory),
|
|
76
|
+
tslib_1.__metadata("design:type", Function)
|
|
77
|
+
], AIViewContribution.prototype, "commandHandlerFactory", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, inversify_1.postConstruct)(),
|
|
80
|
+
tslib_1.__metadata("design:type", Function),
|
|
81
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
82
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
83
|
+
], AIViewContribution.prototype, "init", null);
|
|
84
|
+
exports.AIViewContribution = AIViewContribution = tslib_1.__decorate([
|
|
85
|
+
(0, inversify_1.injectable)()
|
|
86
|
+
], AIViewContribution);
|
|
87
|
+
//# 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":";;;;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,sCAAoF;AACpF,qDAA4G;AAC5G,4DAAiF;AACjF,mEAAqF;AACrF,6EAAuE;AAGhE,IAAM,kBAAkB,GAAxB,MAAM,kBAAqC,SAAQ,kCAA2B;IAYvE,IAAI;QACV,IAAI,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,IAAI,CAAC,SAAS,EAAE,CAAC;YACrB,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEQ,gBAAgB,CAAC,QAAyB;;QAC/C,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YAErB,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,qBAAqB,CAAC;gBACpE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE;aACnC,CAAC,CAAC,CAAC;QACR,CAAC;QACD,MAAA,IAAI,CAAC,SAAS,0CAAE,YAAY,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,SAAS;YACrB,IAAI,EAAE,6CAAqB;YAC3B,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAChD,CAAC,CAAC;IAEP,CAAC;IAEQ,aAAa,CAAC,KAAwB;QAC3C,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,KAAK,CAAC,kBAAkB,CAAC,qBAAW,CAAC,UAAU,EAAE;gBAC7C,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE;gBAChC,IAAI,EAAE,6CAAqB;gBAC3B,KAAK,EAAE,IAAI,CAAC,SAAS;aACxB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IACQ,mBAAmB,CAAC,WAA+B;QACxD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACtD,WAAW,CAAC,kBAAkB,CAAC;gBAC3B,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE;gBAC9B,IAAI,EAAE,6CAAqB;gBAC3B,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB;aAC5C,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ,CAAA;AArDY,gDAAkB;AAGR;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;6DAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;;6DAC8B;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,23 @@
|
|
|
1
|
+
import { URI } from '@theia/core';
|
|
2
|
+
import { OpenerService } from '@theia/core/lib/browser';
|
|
3
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
4
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
5
|
+
import { AIVariable, AIVariableContext, AIVariableContribution, AIVariableOpener, AIVariableResolutionRequest, AIVariableResolver, ResolvedAIContextVariable } from '../common/variable-service';
|
|
6
|
+
import { FrontendVariableService } from './frontend-variable-service';
|
|
7
|
+
export declare namespace FileVariableArgs {
|
|
8
|
+
const uri = "uri";
|
|
9
|
+
}
|
|
10
|
+
export declare const FILE_VARIABLE: AIVariable;
|
|
11
|
+
export declare class FileVariableContribution implements AIVariableContribution, AIVariableResolver, AIVariableOpener {
|
|
12
|
+
protected readonly fileService: FileService;
|
|
13
|
+
protected readonly wsService: WorkspaceService;
|
|
14
|
+
protected readonly openerService: OpenerService;
|
|
15
|
+
registerVariables(service: FrontendVariableService): void;
|
|
16
|
+
canResolve(request: AIVariableResolutionRequest, _: AIVariableContext): Promise<number>;
|
|
17
|
+
resolve(request: AIVariableResolutionRequest, _: AIVariableContext): Promise<ResolvedAIContextVariable | undefined>;
|
|
18
|
+
protected toUri(request: AIVariableResolutionRequest): Promise<URI | undefined>;
|
|
19
|
+
canOpen(request: AIVariableResolutionRequest, context: AIVariableContext): Promise<number>;
|
|
20
|
+
open(request: AIVariableResolutionRequest, context: AIVariableContext): Promise<void>;
|
|
21
|
+
protected makeAbsolute(pathStr: string): Promise<URI | undefined>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=file-variable-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-variable-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/file-variable-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAa,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAsB,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EACH,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,GAAG,QAAQ,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,EAAE,UAQ3B,CAAC;AAEF,qBACa,wBAAyB,YAAW,sBAAsB,EAAE,kBAAkB,EAAE,gBAAgB;IAEzG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAG5C,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IAG/C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEhD,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAKnD,UAAU,CAAC,OAAO,EAAE,2BAA2B,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvF,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;cAiBzG,KAAK,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;IASrF,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIpF,IAAI,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;cAQ3E,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;CAiB1E"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 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.FileVariableContribution = exports.FILE_VARIABLE = exports.FileVariableArgs = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
24
|
+
const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
|
|
25
|
+
var FileVariableArgs;
|
|
26
|
+
(function (FileVariableArgs) {
|
|
27
|
+
FileVariableArgs.uri = 'uri';
|
|
28
|
+
})(FileVariableArgs || (exports.FileVariableArgs = FileVariableArgs = {}));
|
|
29
|
+
exports.FILE_VARIABLE = {
|
|
30
|
+
id: 'file-provider',
|
|
31
|
+
description: core_1.nls.localize('theia/ai/core/fileVariable/description', 'Resolves the contents of a file'),
|
|
32
|
+
name: 'file',
|
|
33
|
+
label: core_1.nls.localizeByDefault('File'),
|
|
34
|
+
iconClasses: (0, browser_1.codiconArray)('file'),
|
|
35
|
+
isContextVariable: true,
|
|
36
|
+
args: [{ name: FileVariableArgs.uri, description: core_1.nls.localize('theia/ai/core/fileVariable/uri/description', 'The URI of the requested file.') }]
|
|
37
|
+
};
|
|
38
|
+
let FileVariableContribution = class FileVariableContribution {
|
|
39
|
+
registerVariables(service) {
|
|
40
|
+
service.registerResolver(exports.FILE_VARIABLE, this);
|
|
41
|
+
service.registerOpener(exports.FILE_VARIABLE, this);
|
|
42
|
+
}
|
|
43
|
+
async canResolve(request, _) {
|
|
44
|
+
return request.variable.name === exports.FILE_VARIABLE.name ? 1 : 0;
|
|
45
|
+
}
|
|
46
|
+
async resolve(request, _) {
|
|
47
|
+
const uri = await this.toUri(request);
|
|
48
|
+
if (!uri) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const content = await this.fileService.readFile(uri);
|
|
53
|
+
return {
|
|
54
|
+
variable: request.variable,
|
|
55
|
+
value: await this.wsService.getWorkspaceRelativePath(uri),
|
|
56
|
+
contextValue: content.value.toString(),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async toUri(request) {
|
|
64
|
+
if (request.variable.name !== exports.FILE_VARIABLE.name || request.arg === undefined) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const path = request.arg;
|
|
68
|
+
return this.makeAbsolute(path);
|
|
69
|
+
}
|
|
70
|
+
canOpen(request, context) {
|
|
71
|
+
return this.canResolve(request, context);
|
|
72
|
+
}
|
|
73
|
+
async open(request, context) {
|
|
74
|
+
const uri = await this.toUri(request);
|
|
75
|
+
if (!uri) {
|
|
76
|
+
throw new Error('Unable to resolve URI for request.');
|
|
77
|
+
}
|
|
78
|
+
await (0, browser_1.open)(this.openerService, uri);
|
|
79
|
+
}
|
|
80
|
+
async makeAbsolute(pathStr) {
|
|
81
|
+
const path = new core_1.Path(core_1.Path.normalizePathSeparator(pathStr));
|
|
82
|
+
if (!path.isAbsolute) {
|
|
83
|
+
const workspaceRoots = this.wsService.tryGetRoots();
|
|
84
|
+
const wsUris = workspaceRoots.map(root => root.resource.resolve(path));
|
|
85
|
+
for (const uri of wsUris) {
|
|
86
|
+
if (await this.fileService.exists(uri)) {
|
|
87
|
+
return uri;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const argUri = new core_1.URI(pathStr);
|
|
92
|
+
if (await this.fileService.exists(argUri)) {
|
|
93
|
+
return argUri;
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
exports.FileVariableContribution = FileVariableContribution;
|
|
99
|
+
tslib_1.__decorate([
|
|
100
|
+
(0, inversify_1.inject)(file_service_1.FileService),
|
|
101
|
+
tslib_1.__metadata("design:type", file_service_1.FileService)
|
|
102
|
+
], FileVariableContribution.prototype, "fileService", void 0);
|
|
103
|
+
tslib_1.__decorate([
|
|
104
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
105
|
+
tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
106
|
+
], FileVariableContribution.prototype, "wsService", void 0);
|
|
107
|
+
tslib_1.__decorate([
|
|
108
|
+
(0, inversify_1.inject)(browser_1.OpenerService),
|
|
109
|
+
tslib_1.__metadata("design:type", Object)
|
|
110
|
+
], FileVariableContribution.prototype, "openerService", void 0);
|
|
111
|
+
exports.FileVariableContribution = FileVariableContribution = tslib_1.__decorate([
|
|
112
|
+
(0, inversify_1.injectable)()
|
|
113
|
+
], FileVariableContribution);
|
|
114
|
+
//# sourceMappingURL=file-variable-contribution.js.map
|