@theia/ai-chat 1.58.3 → 1.59.0-next.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/ai-chat-frontend-module.d.ts.map +1 -1
- package/lib/browser/ai-chat-frontend-module.js +10 -13
- package/lib/browser/ai-chat-frontend-module.js.map +1 -1
- package/lib/browser/ai-chat-preferences.d.ts +1 -0
- package/lib/browser/ai-chat-preferences.d.ts.map +1 -1
- package/lib/browser/ai-chat-preferences.js +12 -3
- package/lib/browser/ai-chat-preferences.js.map +1 -1
- package/lib/browser/change-set-file-element.d.ts +24 -6
- package/lib/browser/change-set-file-element.d.ts.map +1 -1
- package/lib/browser/change-set-file-element.js +105 -15
- package/lib/browser/change-set-file-element.js.map +1 -1
- package/lib/browser/change-set-file-resource.d.ts +40 -8
- package/lib/browser/change-set-file-resource.d.ts.map +1 -1
- package/lib/browser/change-set-file-resource.js +123 -37
- package/lib/browser/change-set-file-resource.js.map +1 -1
- package/lib/browser/change-set-file-service.d.ts +9 -3
- package/lib/browser/change-set-file-service.d.ts.map +1 -1
- package/lib/browser/change-set-file-service.js +35 -13
- package/lib/browser/change-set-file-service.js.map +1 -1
- package/lib/browser/context-file-variable-label-provider.d.ts +14 -0
- package/lib/browser/context-file-variable-label-provider.d.ts.map +1 -0
- package/lib/browser/context-file-variable-label-provider.js +63 -0
- package/lib/browser/context-file-variable-label-provider.js.map +1 -0
- package/lib/browser/context-variable-label-provider.d.ts +9 -0
- package/lib/browser/context-variable-label-provider.d.ts.map +1 -0
- package/lib/browser/context-variable-label-provider.js +55 -0
- package/lib/browser/context-variable-label-provider.js.map +1 -0
- package/lib/browser/file-chat-variable-contribution.d.ts +18 -0
- package/lib/browser/file-chat-variable-contribution.d.ts.map +1 -0
- package/lib/browser/file-chat-variable-contribution.js +135 -0
- package/lib/browser/file-chat-variable-contribution.js.map +1 -0
- package/lib/browser/frontend-chat-service.d.ts +10 -3
- package/lib/browser/frontend-chat-service.d.ts.map +1 -1
- package/lib/browser/frontend-chat-service.js +39 -19
- package/lib/browser/frontend-chat-service.js.map +1 -1
- package/lib/common/chat-agents.d.ts +47 -24
- package/lib/common/chat-agents.d.ts.map +1 -1
- package/lib/common/chat-agents.js +50 -19
- package/lib/common/chat-agents.js.map +1 -1
- package/lib/common/chat-history-entry.js +1 -1
- package/lib/common/chat-history-entry.js.map +1 -1
- package/lib/common/chat-model.d.ts +58 -35
- package/lib/common/chat-model.d.ts.map +1 -1
- package/lib/common/chat-model.js +96 -53
- package/lib/common/chat-model.js.map +1 -1
- package/lib/common/chat-service.d.ts +32 -12
- package/lib/common/chat-service.d.ts.map +1 -1
- package/lib/common/chat-service.js +77 -19
- package/lib/common/chat-service.js.map +1 -1
- package/lib/common/chat-tool-request-service.d.ts +5 -5
- package/lib/common/chat-tool-request-service.d.ts.map +1 -1
- package/lib/common/chat-tool-request-service.js.map +1 -1
- package/lib/common/custom-chat-agent.d.ts +7 -10
- package/lib/common/custom-chat-agent.d.ts.map +1 -1
- package/lib/common/custom-chat-agent.js +7 -11
- package/lib/common/custom-chat-agent.js.map +1 -1
- package/lib/common/index.d.ts +0 -3
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +0 -3
- package/lib/common/index.js.map +1 -1
- package/lib/common/parse-contents.d.ts +2 -2
- package/lib/common/parse-contents.d.ts.map +1 -1
- package/lib/common/parse-contents.js.map +1 -1
- package/lib/common/parse-contents.spec.d.ts.map +1 -1
- package/lib/common/parse-contents.spec.js.map +1 -1
- package/lib/common/response-content-matcher.d.ts +3 -3
- package/lib/common/response-content-matcher.d.ts.map +1 -1
- package/lib/common/response-content-matcher.js.map +1 -1
- package/package.json +12 -10
- package/src/browser/ai-chat-frontend-module.ts +14 -18
- package/src/browser/ai-chat-preferences.ts +13 -2
- package/src/browser/change-set-file-element.ts +99 -20
- package/src/browser/change-set-file-resource.ts +125 -39
- package/src/browser/change-set-file-service.ts +38 -16
- package/src/browser/context-file-variable-label-provider.ts +62 -0
- package/src/browser/context-variable-label-provider.ts +56 -0
- package/src/browser/file-chat-variable-contribution.ts +143 -0
- package/src/browser/frontend-chat-service.ts +40 -26
- package/src/common/chat-agents.ts +72 -27
- package/src/common/chat-history-entry.ts +1 -1
- package/src/common/chat-model.ts +138 -74
- package/src/common/chat-service.ts +96 -23
- package/src/common/chat-tool-request-service.ts +5 -5
- package/src/common/custom-chat-agent.ts +8 -20
- package/src/common/index.ts +0 -3
- package/src/common/parse-contents.spec.ts +2 -2
- package/src/common/parse-contents.ts +2 -2
- package/src/common/response-content-matcher.ts +3 -3
- package/lib/common/command-chat-agents.d.ts +0 -33
- package/lib/common/command-chat-agents.d.ts.map +0 -1
- package/lib/common/command-chat-agents.js +0 -329
- package/lib/common/command-chat-agents.js.map +0 -1
- package/lib/common/orchestrator-chat-agent.d.ts +0 -22
- package/lib/common/orchestrator-chat-agent.d.ts.map +0 -1
- package/lib/common/orchestrator-chat-agent.js +0 -167
- package/lib/common/orchestrator-chat-agent.js.map +0 -1
- package/lib/common/universal-chat-agent.d.ts +0 -16
- package/lib/common/universal-chat-agent.d.ts.map +0 -1
- package/lib/common/universal-chat-agent.js +0 -109
- package/lib/common/universal-chat-agent.js.map +0 -1
- package/src/common/command-chat-agents.ts +0 -354
- package/src/common/orchestrator-chat-agent.ts +0 -179
- package/src/common/universal-chat-agent.ts +0 -117
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-chat-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/ai-chat-frontend-module.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;
|
|
1
|
+
{"version":3,"file":"ai-chat-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/ai-chat-frontend-module.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AA0B/D,wBA2DG"}
|
|
@@ -21,11 +21,8 @@ const browser_1 = require("@theia/core/lib/browser");
|
|
|
21
21
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
22
|
const common_2 = require("../common");
|
|
23
23
|
const chat_agents_variable_contribution_1 = require("../common/chat-agents-variable-contribution");
|
|
24
|
-
const command_chat_agents_1 = require("../common/command-chat-agents");
|
|
25
24
|
const custom_chat_agent_1 = require("../common/custom-chat-agent");
|
|
26
|
-
const orchestrator_chat_agent_1 = require("../common/orchestrator-chat-agent");
|
|
27
25
|
const response_content_matcher_1 = require("../common/response-content-matcher");
|
|
28
|
-
const universal_chat_agent_1 = require("../common/universal-chat-agent");
|
|
29
26
|
const ai_chat_preferences_1 = require("./ai-chat-preferences");
|
|
30
27
|
const change_set_file_element_1 = require("./change-set-file-element");
|
|
31
28
|
const custom_agent_frontend_application_contribution_1 = require("./custom-agent-frontend-application-contribution");
|
|
@@ -34,13 +31,16 @@ const custom_agent_factory_1 = require("./custom-agent-factory");
|
|
|
34
31
|
const chat_tool_request_service_1 = require("../common/chat-tool-request-service");
|
|
35
32
|
const change_set_file_resource_1 = require("./change-set-file-resource");
|
|
36
33
|
const change_set_file_service_1 = require("./change-set-file-service");
|
|
34
|
+
const context_variable_label_provider_1 = require("./context-variable-label-provider");
|
|
35
|
+
const context_file_variable_label_provider_1 = require("./context-file-variable-label-provider");
|
|
36
|
+
const file_chat_variable_contribution_1 = require("./file-chat-variable-contribution");
|
|
37
37
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
38
38
|
(0, core_1.bindContributionProvider)(bind, common_1.Agent);
|
|
39
39
|
(0, core_1.bindContributionProvider)(bind, common_2.ChatAgent);
|
|
40
40
|
bind(chat_tool_request_service_1.ChatToolRequestService).toSelf().inSingletonScope();
|
|
41
41
|
bind(common_2.ChatAgentServiceImpl).toSelf().inSingletonScope();
|
|
42
42
|
bind(common_2.ChatAgentService).toService(common_2.ChatAgentServiceImpl);
|
|
43
|
-
bind(common_2.
|
|
43
|
+
bind(common_2.PinChatAgent).toConstantValue(true);
|
|
44
44
|
(0, core_1.bindContributionProvider)(bind, response_content_matcher_1.ResponseContentMatcherProvider);
|
|
45
45
|
bind(response_content_matcher_1.DefaultResponseContentMatcherProvider).toSelf().inSingletonScope();
|
|
46
46
|
bind(response_content_matcher_1.ResponseContentMatcherProvider).toService(response_content_matcher_1.DefaultResponseContentMatcherProvider);
|
|
@@ -50,15 +50,6 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
50
50
|
bind(common_2.ChatRequestParser).toService(common_2.ChatRequestParserImpl);
|
|
51
51
|
bind(frontend_chat_service_1.FrontendChatServiceImpl).toSelf().inSingletonScope();
|
|
52
52
|
bind(common_2.ChatService).toService(frontend_chat_service_1.FrontendChatServiceImpl);
|
|
53
|
-
bind(orchestrator_chat_agent_1.OrchestratorChatAgent).toSelf().inSingletonScope();
|
|
54
|
-
bind(common_1.Agent).toService(orchestrator_chat_agent_1.OrchestratorChatAgent);
|
|
55
|
-
bind(common_2.ChatAgent).toService(orchestrator_chat_agent_1.OrchestratorChatAgent);
|
|
56
|
-
bind(universal_chat_agent_1.UniversalChatAgent).toSelf().inSingletonScope();
|
|
57
|
-
bind(common_1.Agent).toService(universal_chat_agent_1.UniversalChatAgent);
|
|
58
|
-
bind(common_2.ChatAgent).toService(universal_chat_agent_1.UniversalChatAgent);
|
|
59
|
-
bind(command_chat_agents_1.CommandChatAgent).toSelf().inSingletonScope();
|
|
60
|
-
bind(common_1.Agent).toService(command_chat_agents_1.CommandChatAgent);
|
|
61
|
-
bind(common_2.ChatAgent).toService(command_chat_agents_1.CommandChatAgent);
|
|
62
53
|
bind(browser_1.PreferenceContribution).toConstantValue({ schema: ai_chat_preferences_1.aiChatPreferences });
|
|
63
54
|
bind(custom_chat_agent_1.CustomChatAgent).toSelf();
|
|
64
55
|
bind(custom_agent_factory_1.CustomAgentFactory).toFactory(ctx => (id, name, description, prompt, defaultLLM) => {
|
|
@@ -76,6 +67,10 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
76
67
|
return agent;
|
|
77
68
|
});
|
|
78
69
|
bind(browser_1.FrontendApplicationContribution).to(custom_agent_frontend_application_contribution_1.AICustomAgentsFrontendApplicationContribution).inSingletonScope();
|
|
70
|
+
bind(context_variable_label_provider_1.ContextVariableLabelProvider).toSelf().inSingletonScope();
|
|
71
|
+
bind(browser_1.LabelProviderContribution).toService(context_variable_label_provider_1.ContextVariableLabelProvider);
|
|
72
|
+
bind(context_file_variable_label_provider_1.ContextFileVariableLabelProvider).toSelf().inSingletonScope();
|
|
73
|
+
bind(browser_1.LabelProviderContribution).toService(context_file_variable_label_provider_1.ContextFileVariableLabelProvider);
|
|
79
74
|
bind(change_set_file_service_1.ChangeSetFileService).toSelf().inSingletonScope();
|
|
80
75
|
bind(change_set_file_element_1.ChangeSetFileElementFactory).toFactory(ctx => (args) => {
|
|
81
76
|
const container = ctx.container.createChild();
|
|
@@ -85,5 +80,7 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
85
80
|
});
|
|
86
81
|
bind(change_set_file_resource_1.ChangeSetFileResourceResolver).toSelf().inSingletonScope();
|
|
87
82
|
bind(core_1.ResourceResolver).toService(change_set_file_resource_1.ChangeSetFileResourceResolver);
|
|
83
|
+
bind(common_2.ToolCallChatResponseContentFactory).toSelf().inSingletonScope();
|
|
84
|
+
bind(common_1.AIVariableContribution).to(file_chat_variable_contribution_1.FileChatVariableContribution).inSingletonScope();
|
|
88
85
|
});
|
|
89
86
|
//# sourceMappingURL=ai-chat-frontend-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-chat-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-chat-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,sDAAwF;AACxF,sCAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"ai-chat-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-chat-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,sDAAwF;AACxF,sCAAyE;AACzE,qDAA6H;AAC7H,4DAA+D;AAC/D,sCASmB;AACnB,mGAA6F;AAC7F,mEAA8D;AAC9D,iFAA0J;AAC1J,+DAA0D;AAC1D,uEAAoH;AACpH,qHAAiH;AACjH,mEAAkE;AAClE,iEAA4D;AAC5D,mFAA6E;AAC7E,yEAA2E;AAC3E,uEAAiE;AACjE,uFAAiF;AACjF,iGAA0F;AAC1F,uFAAiF;AAEjF,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAA,+BAAwB,EAAC,IAAI,EAAE,cAAK,CAAC,CAAC;IACtC,IAAA,+BAAwB,EAAC,IAAI,EAAE,kBAAS,CAAC,CAAC;IAE1C,IAAI,CAAC,kDAAsB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAEzD,IAAI,CAAC,6BAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,CAAC,yBAAgB,CAAC,CAAC,SAAS,CAAC,6BAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,qBAAY,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAA,+BAAwB,EAAC,IAAI,EAAE,yDAA8B,CAAC,CAAC;IAC/D,IAAI,CAAC,gEAAqC,CAAC,CAAC,MAAM,EAAE,CAAC,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AC,wDAA6B,CAAC,CAAC;IAChE,IAAI,CAAC,2CAAkC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACrE,IAAI,CAAC,+BAAsB,CAAC,CAAC,EAAE,CAAC,8DAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACrF,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
|
|
2
2
|
export declare const DEFAULT_CHAT_AGENT_PREF = "ai-features.chat.defaultChatAgent";
|
|
3
|
+
export declare const PIN_CHAT_AGENT_PREF = "ai-features.chat.pinChatAgent";
|
|
3
4
|
export declare const aiChatPreferences: PreferenceSchema;
|
|
4
5
|
//# sourceMappingURL=ai-chat-preferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-chat-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/ai-chat-preferences.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-chat-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/ai-chat-preferences.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAE/F,eAAO,MAAM,uBAAuB,sCAAsC,CAAC;AAC3E,eAAO,MAAM,mBAAmB,kCAAkC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,EAAE,gBAmB/B,CAAC"}
|
|
@@ -15,16 +15,25 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.aiChatPreferences = exports.DEFAULT_CHAT_AGENT_PREF = void 0;
|
|
18
|
+
exports.aiChatPreferences = exports.PIN_CHAT_AGENT_PREF = exports.DEFAULT_CHAT_AGENT_PREF = void 0;
|
|
19
19
|
const ai_core_preferences_1 = require("@theia/ai-core/lib/browser/ai-core-preferences");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
20
21
|
exports.DEFAULT_CHAT_AGENT_PREF = 'ai-features.chat.defaultChatAgent';
|
|
22
|
+
exports.PIN_CHAT_AGENT_PREF = 'ai-features.chat.pinChatAgent';
|
|
21
23
|
exports.aiChatPreferences = {
|
|
22
24
|
type: 'object',
|
|
23
25
|
properties: {
|
|
24
26
|
[exports.DEFAULT_CHAT_AGENT_PREF]: {
|
|
25
27
|
type: 'string',
|
|
26
|
-
description: 'Optional: <agent-name> of the Chat Agent that shall be invoked, if no agent is explicitly mentioned with @<agent-name> in the user query
|
|
27
|
-
|
|
28
|
+
description: core_1.nls.localize('theia/ai/chat/defaultAgent/description', 'Optional: <agent-name> of the Chat Agent that shall be invoked, if no agent is explicitly mentioned with @<agent-name> in the user query. \
|
|
29
|
+
If no Default Agent is configured, Theia´s defaults will be applied.'),
|
|
30
|
+
title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
|
|
31
|
+
},
|
|
32
|
+
[exports.PIN_CHAT_AGENT_PREF]: {
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
description: core_1.nls.localize('theia/ai/chat/pinChatAgent/description', 'Enable agent pinning to automatically keep a mentioned chat agent active across prompts, reducing the need for repeated mentions.\
|
|
35
|
+
You can manually unpin or switch agents anytime.'),
|
|
36
|
+
default: true,
|
|
28
37
|
title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
|
|
29
38
|
}
|
|
30
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-chat-preferences.js","sourceRoot":"","sources":["../../src/browser/ai-chat-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,wFAA2F;
|
|
1
|
+
{"version":3,"file":"ai-chat-preferences.js","sourceRoot":"","sources":["../../src/browser/ai-chat-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,wFAA2F;AAC3F,sCAAkC;AAGrB,QAAA,uBAAuB,GAAG,mCAAmC,CAAC;AAC9D,QAAA,mBAAmB,GAAG,+BAA+B,CAAC;AAEtD,QAAA,iBAAiB,GAAqB;IAC/C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,CAAC,+BAAuB,CAAC,EAAE;YACvB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,wCAAwC,EAC9D;qEACqD,CAAC;YAC1D,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,2BAAmB,CAAC,EAAE;YACnB,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,wCAAwC,EAC9D;iDACiC,CAAC;YACtC,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,+CAAyB;SACnC;KACJ;CACJ,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { URI } from '@theia/core';
|
|
1
|
+
import { DisposableCollection, Emitter, URI } from '@theia/core';
|
|
2
2
|
import { ChangeSetElement, ChangeSetImpl } from '../common';
|
|
3
|
+
import { ChangeSetFileResourceResolver, UpdatableReferenceResource } from './change-set-file-resource';
|
|
3
4
|
import { ChangeSetFileService } from './change-set-file-service';
|
|
5
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
4
6
|
export declare const ChangeSetFileElementFactory: unique symbol;
|
|
5
7
|
export type ChangeSetFileElementFactory = (elementProps: ChangeSetElementArgs) => ChangeSetFileElement;
|
|
8
|
+
type ChangeSetElementState = ChangeSetElement['state'];
|
|
6
9
|
export declare const ChangeSetElementArgs: unique symbol;
|
|
7
10
|
export interface ChangeSetElementArgs extends Partial<ChangeSetElement> {
|
|
8
11
|
/** The URI of the element, expected to be unique within the same change set. */
|
|
@@ -18,19 +21,30 @@ export interface ChangeSetElementArgs extends Partial<ChangeSetElement> {
|
|
|
18
21
|
targetState?: string;
|
|
19
22
|
}
|
|
20
23
|
export declare class ChangeSetFileElement implements ChangeSetElement {
|
|
24
|
+
static toReadOnlyUri(baseUri: URI, sessionId: string): URI;
|
|
21
25
|
protected readonly elementProps: ChangeSetElementArgs;
|
|
22
26
|
protected readonly changeSetFileService: ChangeSetFileService;
|
|
23
|
-
protected
|
|
27
|
+
protected readonly fileService: FileService;
|
|
28
|
+
protected readonly resourceResolver: ChangeSetFileResourceResolver;
|
|
29
|
+
protected readonly toDispose: DisposableCollection;
|
|
30
|
+
protected _state: ChangeSetElementState;
|
|
24
31
|
protected originalContent: string | undefined;
|
|
32
|
+
protected readonly onDidChangeEmitter: Emitter<void>;
|
|
33
|
+
readonly onDidChange: import("@theia/core").Event<void>;
|
|
34
|
+
protected readOnlyResource: UpdatableReferenceResource;
|
|
35
|
+
protected changeResource: UpdatableReferenceResource;
|
|
25
36
|
init(): void;
|
|
26
37
|
protected obtainOriginalContent(): Promise<void>;
|
|
38
|
+
protected getResources(): void;
|
|
39
|
+
protected listenForOriginalFileChanges(): void;
|
|
27
40
|
get uri(): URI;
|
|
41
|
+
get readOnlyUri(): URI;
|
|
28
42
|
get changedUri(): URI;
|
|
29
43
|
get name(): string;
|
|
30
44
|
get icon(): string | undefined;
|
|
31
45
|
get additionalInfo(): string | undefined;
|
|
32
|
-
get state():
|
|
33
|
-
protected set state(value:
|
|
46
|
+
get state(): ChangeSetElementState;
|
|
47
|
+
protected set state(value: ChangeSetElementState);
|
|
34
48
|
get type(): 'add' | 'modify' | 'delete' | undefined;
|
|
35
49
|
get data(): {
|
|
36
50
|
[key: string]: unknown;
|
|
@@ -38,7 +52,11 @@ export declare class ChangeSetFileElement implements ChangeSetElement {
|
|
|
38
52
|
get targetState(): string;
|
|
39
53
|
open(): Promise<void>;
|
|
40
54
|
openChange(): Promise<void>;
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
apply(contents?: string): Promise<void>;
|
|
56
|
+
writeChanges(contents?: string): Promise<void>;
|
|
57
|
+
revert(): Promise<void>;
|
|
58
|
+
confirm(verb: string): Promise<boolean>;
|
|
59
|
+
dispose(): void;
|
|
43
60
|
}
|
|
61
|
+
export {};
|
|
44
62
|
//# sourceMappingURL=change-set-file-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set-file-element.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-file-element.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"change-set-file-element.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-file-element.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAA0B,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC/H,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAGzE,eAAO,MAAM,2BAA2B,eAAwC,CAAC;AACjF,MAAM,MAAM,2BAA2B,GAAG,CAAC,YAAY,EAAE,oBAAoB,KAAK,oBAAoB,CAAC;AACvG,KAAK,qBAAqB,GAAG,gBAAgB,CAAC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GAAG,CAEpB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED,IAAI,KAAK,IAAI,qBAAqB,CAEjC;IAED,SAAS,KAAK,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAK/C;IAED,IAAI,IAAI,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAElD;IAED,IAAI,IAAI,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAAE,GAAG,SAAS,CAElD;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAavC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAU7C,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -14,25 +14,79 @@
|
|
|
14
14
|
//
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
|
+
var ChangeSetFileElement_1;
|
|
17
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
19
|
exports.ChangeSetFileElement = exports.ChangeSetElementArgs = exports.ChangeSetFileElementFactory = void 0;
|
|
19
20
|
const tslib_1 = require("tslib");
|
|
21
|
+
const core_1 = require("@theia/core");
|
|
20
22
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
23
|
const change_set_file_resource_1 = require("./change-set-file-resource");
|
|
22
24
|
const change_set_file_service_1 = require("./change-set-file-service");
|
|
25
|
+
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
26
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
27
|
exports.ChangeSetFileElementFactory = Symbol('ChangeSetFileElementFactory');
|
|
24
28
|
exports.ChangeSetElementArgs = Symbol('ChangeSetElementArgs');
|
|
25
29
|
;
|
|
26
|
-
let ChangeSetFileElement = class ChangeSetFileElement {
|
|
30
|
+
let ChangeSetFileElement = ChangeSetFileElement_1 = class ChangeSetFileElement {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.toDispose = new core_1.DisposableCollection();
|
|
33
|
+
this.onDidChangeEmitter = new core_1.Emitter();
|
|
34
|
+
this.onDidChange = this.onDidChangeEmitter.event;
|
|
35
|
+
}
|
|
36
|
+
static toReadOnlyUri(baseUri, sessionId) {
|
|
37
|
+
return baseUri.withScheme('change-set-immutable').withAuthority(sessionId);
|
|
38
|
+
}
|
|
27
39
|
init() {
|
|
40
|
+
this.getResources();
|
|
28
41
|
this.obtainOriginalContent();
|
|
42
|
+
this.listenForOriginalFileChanges();
|
|
43
|
+
this.toDispose.push(this.onDidChangeEmitter);
|
|
29
44
|
}
|
|
30
45
|
async obtainOriginalContent() {
|
|
46
|
+
var _a;
|
|
31
47
|
this.originalContent = await this.changeSetFileService.read(this.uri);
|
|
48
|
+
this.readOnlyResource.update({ contents: (_a = this.originalContent) !== null && _a !== void 0 ? _a : '' });
|
|
49
|
+
if (this.state === 'applied') {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
getResources() {
|
|
53
|
+
var _a;
|
|
54
|
+
this.readOnlyResource = (_a = this.resourceResolver.tryGet(this.readOnlyUri)) !== null && _a !== void 0 ? _a : this.resourceResolver.add(this.readOnlyUri, { autosaveable: false, readOnly: true });
|
|
55
|
+
let changed = this.resourceResolver.tryGet(this.changedUri);
|
|
56
|
+
if (changed) {
|
|
57
|
+
changed.update({ contents: this.targetState, onSave: content => this.writeChanges(content) });
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
changed = this.resourceResolver.add(this.changedUri, { contents: this.targetState, onSave: content => this.writeChanges(content), autosaveable: false });
|
|
61
|
+
}
|
|
62
|
+
this.changeResource = changed;
|
|
63
|
+
this.toDispose.pushAll([this.readOnlyResource, this.changeResource]);
|
|
64
|
+
}
|
|
65
|
+
listenForOriginalFileChanges() {
|
|
66
|
+
this.toDispose.push(this.fileService.onDidFilesChange(async (event) => {
|
|
67
|
+
if (!event.contains(this.uri)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// If we are applied, the tricky thing becomes the question what to revert to; otherwise, what to apply.
|
|
71
|
+
const newContent = await this.changeSetFileService.read(this.uri).catch(() => '');
|
|
72
|
+
this.readOnlyResource.update({ contents: newContent });
|
|
73
|
+
if (newContent === this.originalContent) {
|
|
74
|
+
this.state = 'pending';
|
|
75
|
+
}
|
|
76
|
+
else if (newContent === this.targetState) {
|
|
77
|
+
this.state = 'applied';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.state = 'stale';
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
32
83
|
}
|
|
33
84
|
get uri() {
|
|
34
85
|
return this.elementProps.uri;
|
|
35
86
|
}
|
|
87
|
+
get readOnlyUri() {
|
|
88
|
+
return ChangeSetFileElement_1.toReadOnlyUri(this.uri, this.elementProps.chatSessionId);
|
|
89
|
+
}
|
|
36
90
|
get changedUri() {
|
|
37
91
|
return (0, change_set_file_resource_1.createChangeSetFileUri)(this.elementProps.chatSessionId, this.uri);
|
|
38
92
|
}
|
|
@@ -52,8 +106,10 @@ let ChangeSetFileElement = class ChangeSetFileElement {
|
|
|
52
106
|
return (_a = this._state) !== null && _a !== void 0 ? _a : this.elementProps.state;
|
|
53
107
|
}
|
|
54
108
|
set state(value) {
|
|
55
|
-
this._state
|
|
56
|
-
|
|
109
|
+
if (this._state !== value) {
|
|
110
|
+
this._state = value;
|
|
111
|
+
this.onDidChangeEmitter.fire();
|
|
112
|
+
}
|
|
57
113
|
}
|
|
58
114
|
get type() {
|
|
59
115
|
return this.elementProps.type;
|
|
@@ -70,27 +126,53 @@ let ChangeSetFileElement = class ChangeSetFileElement {
|
|
|
70
126
|
this.changeSetFileService.open(this);
|
|
71
127
|
}
|
|
72
128
|
async openChange() {
|
|
73
|
-
this.changeSetFileService.openDiff(this.
|
|
129
|
+
this.changeSetFileService.openDiff(this.readOnlyUri, this.changedUri);
|
|
74
130
|
}
|
|
75
|
-
async
|
|
76
|
-
this.
|
|
77
|
-
if (this.type === 'delete') {
|
|
78
|
-
await this.changeSetFileService.delete(this.uri);
|
|
79
|
-
this.state = 'applied';
|
|
131
|
+
async apply(contents) {
|
|
132
|
+
if (!await this.confirm('Apply')) {
|
|
80
133
|
return;
|
|
81
134
|
}
|
|
82
|
-
await this.changeSetFileService.
|
|
135
|
+
if (!(await this.changeSetFileService.trySave(this.changedUri))) {
|
|
136
|
+
if (this.type === 'delete') {
|
|
137
|
+
await this.changeSetFileService.delete(this.uri);
|
|
138
|
+
this.state = 'applied';
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
await this.writeChanges(contents);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
this.changeSetFileService.closeDiff(this.readOnlyUri);
|
|
145
|
+
}
|
|
146
|
+
async writeChanges(contents) {
|
|
147
|
+
await this.changeSetFileService.writeFrom(this.changedUri, this.uri, contents !== null && contents !== void 0 ? contents : this.targetState);
|
|
148
|
+
this.state = 'applied';
|
|
83
149
|
}
|
|
84
|
-
async
|
|
85
|
-
this.
|
|
150
|
+
async revert() {
|
|
151
|
+
if (!await this.confirm('Revert')) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this.state = 'pending';
|
|
86
155
|
if (this.type === 'add') {
|
|
87
156
|
await this.changeSetFileService.delete(this.uri);
|
|
88
|
-
return;
|
|
89
157
|
}
|
|
90
|
-
if (this.originalContent) {
|
|
158
|
+
else if (this.originalContent) {
|
|
91
159
|
await this.changeSetFileService.write(this.uri, this.originalContent);
|
|
92
160
|
}
|
|
93
161
|
}
|
|
162
|
+
async confirm(verb) {
|
|
163
|
+
if (this._state !== 'stale') {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
await this.openChange();
|
|
167
|
+
const thing = await new browser_1.ConfirmDialog({
|
|
168
|
+
title: `${verb} suggestion.`,
|
|
169
|
+
msg: `The file ${this.uri.path.toString()} has changed since this suggestion was created. Are you certain you wish to ${verb.toLowerCase()} the change?`
|
|
170
|
+
}).open(true);
|
|
171
|
+
return !!thing;
|
|
172
|
+
}
|
|
173
|
+
dispose() {
|
|
174
|
+
this.toDispose.dispose();
|
|
175
|
+
}
|
|
94
176
|
};
|
|
95
177
|
exports.ChangeSetFileElement = ChangeSetFileElement;
|
|
96
178
|
tslib_1.__decorate([
|
|
@@ -101,13 +183,21 @@ tslib_1.__decorate([
|
|
|
101
183
|
(0, inversify_1.inject)(change_set_file_service_1.ChangeSetFileService),
|
|
102
184
|
tslib_1.__metadata("design:type", change_set_file_service_1.ChangeSetFileService)
|
|
103
185
|
], ChangeSetFileElement.prototype, "changeSetFileService", void 0);
|
|
186
|
+
tslib_1.__decorate([
|
|
187
|
+
(0, inversify_1.inject)(file_service_1.FileService),
|
|
188
|
+
tslib_1.__metadata("design:type", file_service_1.FileService)
|
|
189
|
+
], ChangeSetFileElement.prototype, "fileService", void 0);
|
|
190
|
+
tslib_1.__decorate([
|
|
191
|
+
(0, inversify_1.inject)(change_set_file_resource_1.ChangeSetFileResourceResolver),
|
|
192
|
+
tslib_1.__metadata("design:type", change_set_file_resource_1.ChangeSetFileResourceResolver)
|
|
193
|
+
], ChangeSetFileElement.prototype, "resourceResolver", void 0);
|
|
104
194
|
tslib_1.__decorate([
|
|
105
195
|
(0, inversify_1.postConstruct)(),
|
|
106
196
|
tslib_1.__metadata("design:type", Function),
|
|
107
197
|
tslib_1.__metadata("design:paramtypes", []),
|
|
108
198
|
tslib_1.__metadata("design:returntype", void 0)
|
|
109
199
|
], ChangeSetFileElement.prototype, "init", null);
|
|
110
|
-
exports.ChangeSetFileElement = ChangeSetFileElement = tslib_1.__decorate([
|
|
200
|
+
exports.ChangeSetFileElement = ChangeSetFileElement = ChangeSetFileElement_1 = tslib_1.__decorate([
|
|
111
201
|
(0, inversify_1.injectable)()
|
|
112
202
|
], ChangeSetFileElement);
|
|
113
203
|
//# sourceMappingURL=change-set-file-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set-file-element.js","sourceRoot":"","sources":["../../src/browser/change-set-file-element.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
|
|
1
|
+
{"version":3,"file":"change-set-file-element.js","sourceRoot":"","sources":["../../src/browser/change-set-file-element.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,sCAAiE;AACjE,4DAAiF;AAEjF,yEAA+H;AAC/H,uEAAiE;AACjE,6EAAyE;AACzE,qDAAwD;AAE3C,QAAA,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAIpE,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAalE,CAAC;AAGK,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAA1B;QAkBgB,cAAS,GAAG,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AAGnC;IADlB,IAAA,kBAAM,EAAC,8CAAoB,CAAC;sCACY,8CAAoB;kEAAC;AAG3C;IADlB,IAAA,kBAAM,EAAC,0BAAW,CAAC;sCACY,0BAAW;yDAAC;AAGzB;IADlB,IAAA,kBAAM,EAAC,wDAA6B,CAAC;sCACD,wDAA6B;8DAAC;AAanE;IADC,IAAA,yBAAa,GAAE;;;;gDAMf;+BAlCQ,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA2KhC"}
|
|
@@ -1,13 +1,45 @@
|
|
|
1
|
-
import { Resource, ResourceResolver, URI } from '@theia/core';
|
|
2
|
-
import { ChatService } from '../common';
|
|
1
|
+
import { MutableResource, Reference, ReferenceMutableResource, Resource, ResourceResolver, URI } from '@theia/core';
|
|
3
2
|
export declare const CHANGE_SET_FILE_RESOURCE_SCHEME = "changeset-file";
|
|
3
|
+
export type ResourceInitializationOptions = Pick<Resource, 'autosaveable' | 'initiallyDirty' | 'readOnly'> & {
|
|
4
|
+
contents?: string;
|
|
5
|
+
onSave?: Resource['saveContents'];
|
|
6
|
+
};
|
|
7
|
+
export type ResourceUpdateOptions = Pick<ResourceInitializationOptions, 'contents' | 'onSave'>;
|
|
4
8
|
export declare function createChangeSetFileUri(chatSessionId: string, elementUri: URI): URI;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
export declare class UpdatableReferenceResource extends ReferenceMutableResource {
|
|
10
|
+
protected reference: DisposableRefCounter<DisposableMutableResource>;
|
|
11
|
+
static acquire(resource: UpdatableReferenceResource): UpdatableReferenceResource;
|
|
12
|
+
constructor(reference: DisposableRefCounter<DisposableMutableResource>);
|
|
13
|
+
update(options: ResourceUpdateOptions): void;
|
|
14
|
+
get readOnly(): Resource['readOnly'];
|
|
15
|
+
get initiallyDirty(): boolean;
|
|
16
|
+
get autosaveable(): boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class DisposableMutableResource extends MutableResource {
|
|
19
|
+
protected readonly options?: ResourceInitializationOptions | undefined;
|
|
20
|
+
onSave: Resource['saveContents'] | undefined;
|
|
21
|
+
constructor(uri: URI, options?: ResourceInitializationOptions | undefined);
|
|
22
|
+
get readOnly(): Resource['readOnly'];
|
|
23
|
+
get autosaveable(): boolean;
|
|
24
|
+
get initiallyDirty(): boolean;
|
|
25
|
+
saveContents(contents: string): Promise<void>;
|
|
26
|
+
update(options: ResourceUpdateOptions): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
export declare class DisposableRefCounter<V = unknown> implements Reference<V> {
|
|
30
|
+
protected readonly onDispose: () => void;
|
|
31
|
+
static acquire<V>(item: DisposableRefCounter<V>): DisposableRefCounter<V>;
|
|
32
|
+
static create<V>(value: V, onDispose: () => void): DisposableRefCounter<V>;
|
|
33
|
+
readonly object: V;
|
|
34
|
+
protected refs: number;
|
|
35
|
+
protected constructor(value: V, onDispose: () => void);
|
|
36
|
+
dispose(): void;
|
|
37
|
+
}
|
|
9
38
|
export declare class ChangeSetFileResourceResolver implements ResourceResolver {
|
|
10
|
-
protected readonly
|
|
11
|
-
|
|
39
|
+
protected readonly cache: Map<string, UpdatableReferenceResource>;
|
|
40
|
+
add(uri: URI, options?: ResourceInitializationOptions): UpdatableReferenceResource;
|
|
41
|
+
tryGet(uri: URI): UpdatableReferenceResource | undefined;
|
|
42
|
+
update(uri: URI, contents: string): void;
|
|
43
|
+
resolve(uri: URI): UpdatableReferenceResource;
|
|
12
44
|
}
|
|
13
45
|
//# sourceMappingURL=change-set-file-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set-file-resource.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-file-resource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"change-set-file-resource.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-file-resource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE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