@theia/ai-chat 1.67.0-next.13 → 1.67.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +9 -9
- package/lib/browser/agent-delegation-tool.d.ts +0 -25
- package/lib/browser/agent-delegation-tool.d.ts.map +0 -1
- package/lib/browser/agent-delegation-tool.js +0 -196
- package/lib/browser/agent-delegation-tool.js.map +0 -1
- package/lib/browser/ai-chat-frontend-contribution.d.ts +0 -11
- package/lib/browser/ai-chat-frontend-contribution.d.ts.map +0 -1
- package/lib/browser/ai-chat-frontend-contribution.js +0 -56
- package/lib/browser/ai-chat-frontend-contribution.js.map +0 -1
- package/lib/browser/ai-chat-frontend-module.d.ts +0 -4
- package/lib/browser/ai-chat-frontend-module.d.ts.map +0 -1
- package/lib/browser/ai-chat-frontend-module.js +0 -143
- package/lib/browser/ai-chat-frontend-module.js.map +0 -1
- package/lib/browser/change-set-decorator-service.d.ts +0 -24
- package/lib/browser/change-set-decorator-service.d.ts.map +0 -1
- package/lib/browser/change-set-decorator-service.js +0 -66
- package/lib/browser/change-set-decorator-service.js.map +0 -1
- package/lib/browser/change-set-file-element-deserializer.d.ts +0 -7
- package/lib/browser/change-set-file-element-deserializer.d.ts.map +0 -1
- package/lib/browser/change-set-file-element-deserializer.js +0 -61
- package/lib/browser/change-set-file-element-deserializer.js.map +0 -1
- package/lib/browser/change-set-file-element.d.ts +0 -122
- package/lib/browser/change-set-file-element.d.ts.map +0 -1
- package/lib/browser/change-set-file-element.js +0 -435
- package/lib/browser/change-set-file-element.js.map +0 -1
- package/lib/browser/change-set-file-resource.d.ts +0 -4
- package/lib/browser/change-set-file-resource.d.ts.map +0 -1
- package/lib/browser/change-set-file-resource.js +0 -24
- package/lib/browser/change-set-file-resource.js.map +0 -1
- package/lib/browser/change-set-file-service.d.ts +0 -32
- package/lib/browser/change-set-file-service.d.ts.map +0 -1
- package/lib/browser/change-set-file-service.js +0 -161
- package/lib/browser/change-set-file-service.js.map +0 -1
- package/lib/browser/change-set-variable.d.ts +0 -11
- package/lib/browser/change-set-variable.d.ts.map +0 -1
- package/lib/browser/change-set-variable.js +0 -64
- package/lib/browser/change-set-variable.js.map +0 -1
- package/lib/browser/chat-session-store-impl.d.ts +0 -36
- package/lib/browser/chat-session-store-impl.d.ts.map +0 -1
- package/lib/browser/chat-session-store-impl.js +0 -287
- package/lib/browser/chat-session-store-impl.js.map +0 -1
- package/lib/browser/chat-tool-preference-bindings.d.ts +0 -34
- package/lib/browser/chat-tool-preference-bindings.d.ts.map +0 -1
- package/lib/browser/chat-tool-preference-bindings.js +0 -122
- package/lib/browser/chat-tool-preference-bindings.js.map +0 -1
- package/lib/browser/chat-tool-request-service.d.ts +0 -21
- package/lib/browser/chat-tool-request-service.d.ts.map +0 -1
- package/lib/browser/chat-tool-request-service.js +0 -90
- package/lib/browser/chat-tool-request-service.js.map +0 -1
- package/lib/browser/context-file-validation-service.d.ts +0 -15
- package/lib/browser/context-file-validation-service.d.ts.map +0 -1
- package/lib/browser/context-file-validation-service.js +0 -26
- package/lib/browser/context-file-validation-service.js.map +0 -1
- package/lib/browser/context-file-variable-label-provider.d.ts +0 -14
- package/lib/browser/context-file-variable-label-provider.d.ts.map +0 -1
- package/lib/browser/context-file-variable-label-provider.js +0 -63
- package/lib/browser/context-file-variable-label-provider.js.map +0 -1
- package/lib/browser/context-variable-label-provider.d.ts +0 -9
- package/lib/browser/context-variable-label-provider.d.ts.map +0 -1
- package/lib/browser/context-variable-label-provider.js +0 -55
- package/lib/browser/context-variable-label-provider.js.map +0 -1
- package/lib/browser/custom-agent-factory.d.ts +0 -4
- package/lib/browser/custom-agent-factory.d.ts.map +0 -1
- package/lib/browser/custom-agent-factory.js +0 -20
- package/lib/browser/custom-agent-factory.js.map +0 -1
- package/lib/browser/custom-agent-frontend-application-contribution.d.ts +0 -13
- package/lib/browser/custom-agent-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/custom-agent-frontend-application-contribution.js +0 -83
- package/lib/browser/custom-agent-frontend-application-contribution.js.map +0 -1
- package/lib/browser/delegation-response-content.d.ts +0 -20
- package/lib/browser/delegation-response-content.d.ts.map +0 -1
- package/lib/browser/delegation-response-content.js +0 -47
- package/lib/browser/delegation-response-content.js.map +0 -1
- package/lib/browser/file-chat-variable-contribution.d.ts +0 -32
- package/lib/browser/file-chat-variable-contribution.d.ts.map +0 -1
- package/lib/browser/file-chat-variable-contribution.js +0 -241
- package/lib/browser/file-chat-variable-contribution.js.map +0 -1
- package/lib/browser/frontend-chat-service.d.ts +0 -15
- package/lib/browser/frontend-chat-service.d.ts.map +0 -1
- package/lib/browser/frontend-chat-service.js +0 -72
- package/lib/browser/frontend-chat-service.js.map +0 -1
- package/lib/browser/image-context-variable-contribution.d.ts +0 -27
- package/lib/browser/image-context-variable-contribution.d.ts.map +0 -1
- package/lib/browser/image-context-variable-contribution.js +0 -149
- package/lib/browser/image-context-variable-contribution.js.map +0 -1
- package/lib/browser/task-context-service.d.ts +0 -46
- package/lib/browser/task-context-service.d.ts.map +0 -1
- package/lib/browser/task-context-service.js +0 -256
- package/lib/browser/task-context-service.js.map +0 -1
- package/lib/browser/task-context-storage-service.d.ts +0 -19
- package/lib/browser/task-context-storage-service.d.ts.map +0 -1
- package/lib/browser/task-context-storage-service.js +0 -80
- package/lib/browser/task-context-storage-service.js.map +0 -1
- package/lib/browser/task-context-variable-contribution.d.ts +0 -20
- package/lib/browser/task-context-variable-contribution.d.ts.map +0 -1
- package/lib/browser/task-context-variable-contribution.js +0 -101
- package/lib/browser/task-context-variable-contribution.js.map +0 -1
- package/lib/browser/task-context-variable-label-provider.d.ts +0 -21
- package/lib/browser/task-context-variable-label-provider.d.ts.map +0 -1
- package/lib/browser/task-context-variable-label-provider.js +0 -83
- package/lib/browser/task-context-variable-label-provider.js.map +0 -1
- package/lib/browser/task-context-variable.d.ts +0 -3
- package/lib/browser/task-context-variable.d.ts.map +0 -1
- package/lib/browser/task-context-variable.js +0 -33
- package/lib/browser/task-context-variable.js.map +0 -1
- package/lib/common/ai-chat-preferences.d.ts +0 -5
- package/lib/common/ai-chat-preferences.d.ts.map +0 -1
- package/lib/common/ai-chat-preferences.js +0 -40
- package/lib/common/ai-chat-preferences.js.map +0 -1
- package/lib/common/change-set-element-deserializer.d.ts +0 -30
- package/lib/common/change-set-element-deserializer.d.ts.map +0 -1
- package/lib/common/change-set-element-deserializer.js +0 -81
- package/lib/common/change-set-element-deserializer.js.map +0 -1
- package/lib/common/change-set.d.ts +0 -85
- package/lib/common/change-set.d.ts.map +0 -1
- package/lib/common/change-set.js +0 -133
- package/lib/common/change-set.js.map +0 -1
- package/lib/common/chat-agent-service.d.ts +0 -46
- package/lib/common/chat-agent-service.d.ts.map +0 -1
- package/lib/common/chat-agent-service.js +0 -79
- package/lib/common/chat-agent-service.js.map +0 -1
- package/lib/common/chat-agents-variable-contribution.d.ts +0 -17
- package/lib/common/chat-agents-variable-contribution.d.ts.map +0 -1
- package/lib/common/chat-agents-variable-contribution.js +0 -67
- package/lib/common/chat-agents-variable-contribution.js.map +0 -1
- package/lib/common/chat-agents.d.ts +0 -138
- package/lib/common/chat-agents.d.ts.map +0 -1
- package/lib/common/chat-agents.js +0 -428
- package/lib/common/chat-agents.js.map +0 -1
- package/lib/common/chat-auto-save.spec.d.ts +0 -2
- package/lib/common/chat-auto-save.spec.d.ts.map +0 -1
- package/lib/common/chat-auto-save.spec.js +0 -304
- package/lib/common/chat-auto-save.spec.js.map +0 -1
- package/lib/common/chat-content-deserializer.d.ts +0 -161
- package/lib/common/chat-content-deserializer.d.ts.map +0 -1
- package/lib/common/chat-content-deserializer.js +0 -166
- package/lib/common/chat-content-deserializer.js.map +0 -1
- package/lib/common/chat-content-deserializer.spec.d.ts +0 -2
- package/lib/common/chat-content-deserializer.spec.d.ts.map +0 -1
- package/lib/common/chat-content-deserializer.spec.js +0 -307
- package/lib/common/chat-content-deserializer.spec.js.map +0 -1
- package/lib/common/chat-model-serialization.d.ts +0 -110
- package/lib/common/chat-model-serialization.d.ts.map +0 -1
- package/lib/common/chat-model-serialization.js +0 -20
- package/lib/common/chat-model-serialization.js.map +0 -1
- package/lib/common/chat-model-serialization.spec.d.ts +0 -2
- package/lib/common/chat-model-serialization.spec.d.ts.map +0 -1
- package/lib/common/chat-model-serialization.spec.js +0 -278
- package/lib/common/chat-model-serialization.spec.js.map +0 -1
- package/lib/common/chat-model-util.d.ts +0 -7
- package/lib/common/chat-model-util.d.ts.map +0 -1
- package/lib/common/chat-model-util.js +0 -50
- package/lib/common/chat-model-util.js.map +0 -1
- package/lib/common/chat-model.d.ts +0 -923
- package/lib/common/chat-model.d.ts.map +0 -1
- package/lib/common/chat-model.js +0 -1791
- package/lib/common/chat-model.js.map +0 -1
- package/lib/common/chat-request-parser.d.ts +0 -38
- package/lib/common/chat-request-parser.d.ts.map +0 -1
- package/lib/common/chat-request-parser.js +0 -230
- package/lib/common/chat-request-parser.js.map +0 -1
- package/lib/common/chat-request-parser.spec.d.ts +0 -2
- package/lib/common/chat-request-parser.spec.d.ts.map +0 -1
- package/lib/common/chat-request-parser.spec.js +0 -235
- package/lib/common/chat-request-parser.spec.js.map +0 -1
- package/lib/common/chat-service-deletion.spec.d.ts +0 -2
- package/lib/common/chat-service-deletion.spec.d.ts.map +0 -1
- package/lib/common/chat-service-deletion.spec.js +0 -221
- package/lib/common/chat-service-deletion.spec.js.map +0 -1
- package/lib/common/chat-service.d.ts +0 -153
- package/lib/common/chat-service.d.ts.map +0 -1
- package/lib/common/chat-service.js +0 -474
- package/lib/common/chat-service.js.map +0 -1
- package/lib/common/chat-session-naming-prompt-template.d.ts +0 -3
- package/lib/common/chat-session-naming-prompt-template.d.ts.map +0 -1
- package/lib/common/chat-session-naming-prompt-template.js +0 -31
- package/lib/common/chat-session-naming-prompt-template.js.map +0 -1
- package/lib/common/chat-session-naming-service.d.ts +0 -26
- package/lib/common/chat-session-naming-service.d.ts.map +0 -1
- package/lib/common/chat-session-naming-service.js +0 -119
- package/lib/common/chat-session-naming-service.js.map +0 -1
- package/lib/common/chat-session-store.d.ts +0 -43
- package/lib/common/chat-session-store.d.ts.map +0 -1
- package/lib/common/chat-session-store.js +0 -20
- package/lib/common/chat-session-store.js.map +0 -1
- package/lib/common/chat-session-summary-agent-prompt.d.ts +0 -8
- package/lib/common/chat-session-summary-agent-prompt.d.ts.map +0 -1
- package/lib/common/chat-session-summary-agent-prompt.js +0 -33
- package/lib/common/chat-session-summary-agent-prompt.js.map +0 -1
- package/lib/common/chat-session-summary-agent.d.ts +0 -16
- package/lib/common/chat-session-summary-agent.d.ts.map +0 -1
- package/lib/common/chat-session-summary-agent.js +0 -48
- package/lib/common/chat-session-summary-agent.js.map +0 -1
- package/lib/common/chat-string-utils.d.ts +0 -3
- package/lib/common/chat-string-utils.d.ts.map +0 -1
- package/lib/common/chat-string-utils.js +0 -27
- package/lib/common/chat-string-utils.js.map +0 -1
- package/lib/common/chat-tool-preferences.d.ts +0 -23
- package/lib/common/chat-tool-preferences.d.ts.map +0 -1
- package/lib/common/chat-tool-preferences.js +0 -68
- package/lib/common/chat-tool-preferences.js.map +0 -1
- package/lib/common/chat-tool-request-service.d.ts +0 -18
- package/lib/common/chat-tool-request-service.d.ts.map +0 -1
- package/lib/common/chat-tool-request-service.js +0 -52
- package/lib/common/chat-tool-request-service.js.map +0 -1
- package/lib/common/context-details-variable.d.ts +0 -9
- package/lib/common/context-details-variable.d.ts.map +0 -1
- package/lib/common/context-details-variable.js +0 -57
- package/lib/common/context-details-variable.js.map +0 -1
- package/lib/common/context-summary-variable.d.ts +0 -9
- package/lib/common/context-summary-variable.d.ts.map +0 -1
- package/lib/common/context-summary-variable.js +0 -57
- package/lib/common/context-summary-variable.js.map +0 -1
- package/lib/common/context-variables.d.ts +0 -4
- package/lib/common/context-variables.d.ts.map +0 -1
- package/lib/common/context-variables.js +0 -22
- package/lib/common/context-variables.js.map +0 -1
- package/lib/common/custom-chat-agent.d.ts +0 -10
- package/lib/common/custom-chat-agent.d.ts.map +0 -1
- package/lib/common/custom-chat-agent.js +0 -40
- package/lib/common/custom-chat-agent.js.map +0 -1
- package/lib/common/image-context-variable.d.ts +0 -29
- package/lib/common/image-context-variable.d.ts.map +0 -1
- package/lib/common/image-context-variable.js +0 -114
- package/lib/common/image-context-variable.js.map +0 -1
- package/lib/common/index.d.ts +0 -13
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -31
- package/lib/common/index.js.map +0 -1
- package/lib/common/parse-contents-with-incomplete-parts.spec.d.ts +0 -2
- package/lib/common/parse-contents-with-incomplete-parts.spec.d.ts.map +0 -1
- package/lib/common/parse-contents-with-incomplete-parts.spec.js +0 -103
- package/lib/common/parse-contents-with-incomplete-parts.spec.js.map +0 -1
- package/lib/common/parse-contents.d.ts +0 -12
- package/lib/common/parse-contents.d.ts.map +0 -1
- package/lib/common/parse-contents.js +0 -107
- package/lib/common/parse-contents.js.map +0 -1
- package/lib/common/parse-contents.spec.d.ts +0 -10
- package/lib/common/parse-contents.spec.d.ts.map +0 -1
- package/lib/common/parse-contents.spec.js +0 -146
- package/lib/common/parse-contents.spec.js.map +0 -1
- package/lib/common/parsed-chat-request.d.ts +0 -66
- package/lib/common/parsed-chat-request.d.ts.map +0 -1
- package/lib/common/parsed-chat-request.js +0 -83
- package/lib/common/parsed-chat-request.js.map +0 -1
- package/lib/common/response-content-matcher.d.ts +0 -69
- package/lib/common/response-content-matcher.d.ts.map +0 -1
- package/lib/common/response-content-matcher.js +0 -97
- package/lib/common/response-content-matcher.js.map +0 -1
- package/lib/node/ai-chat-backend-module.d.ts +0 -4
- package/lib/node/ai-chat-backend-module.d.ts.map +0 -1
- package/lib/node/ai-chat-backend-module.js +0 -26
- package/lib/node/ai-chat-backend-module.js.map +0 -1
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
var ChatSessionNamingAgent_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ChatSessionNamingAgent = exports.ChatSessionNamingService = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const ai_core_1 = require("@theia/ai-core");
|
|
22
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
-
const core_1 = require("@theia/core");
|
|
24
|
-
const chat_session_naming_prompt_template_1 = require("./chat-session-naming-prompt-template");
|
|
25
|
-
let ChatSessionNamingService = class ChatSessionNamingService {
|
|
26
|
-
async generateChatSessionName(chatSession, otherNames) {
|
|
27
|
-
const chatSessionNamingAgent = this.agentService.getAgents().find(agent => ChatSessionNamingAgent.ID === agent.id);
|
|
28
|
-
if (!(chatSessionNamingAgent instanceof ChatSessionNamingAgent)) {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
return chatSessionNamingAgent.generateChatSessionName(chatSession, otherNames);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.ChatSessionNamingService = ChatSessionNamingService;
|
|
35
|
-
tslib_1.__decorate([
|
|
36
|
-
(0, inversify_1.inject)(ai_core_1.AgentService),
|
|
37
|
-
tslib_1.__metadata("design:type", Object)
|
|
38
|
-
], ChatSessionNamingService.prototype, "agentService", void 0);
|
|
39
|
-
exports.ChatSessionNamingService = ChatSessionNamingService = tslib_1.__decorate([
|
|
40
|
-
(0, inversify_1.injectable)()
|
|
41
|
-
], ChatSessionNamingService);
|
|
42
|
-
let ChatSessionNamingAgent = ChatSessionNamingAgent_1 = class ChatSessionNamingAgent {
|
|
43
|
-
constructor() {
|
|
44
|
-
this.id = ChatSessionNamingAgent_1.ID;
|
|
45
|
-
this.name = ChatSessionNamingAgent_1.ID;
|
|
46
|
-
this.description = core_1.nls.localize('theia/ai/chat/chatSessionNamingAgent/description', 'Agent for generating chat session names');
|
|
47
|
-
this.variables = [];
|
|
48
|
-
this.prompts = [chat_session_naming_prompt_template_1.CHAT_SESSION_NAMING_PROMPT];
|
|
49
|
-
this.languageModelRequirements = [{
|
|
50
|
-
purpose: 'chat-session-naming',
|
|
51
|
-
identifier: 'default/summarize',
|
|
52
|
-
}];
|
|
53
|
-
this.agentSpecificVariables = [
|
|
54
|
-
{
|
|
55
|
-
name: 'conversation',
|
|
56
|
-
usedInPrompt: true,
|
|
57
|
-
description: core_1.nls.localize('theia/ai/chat/chatSessionNamingAgent/vars/conversation/description', 'The content of the chat conversation.')
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'listOfSessionNames',
|
|
61
|
-
usedInPrompt: true,
|
|
62
|
-
description: core_1.nls.localize('theia/ai/chat/chatSessionNamingAgent/vars/listOfSessionNames/description', 'The list of existing session names.')
|
|
63
|
-
}
|
|
64
|
-
];
|
|
65
|
-
this.functions = [];
|
|
66
|
-
}
|
|
67
|
-
async generateChatSessionName(chatSession, otherNames) {
|
|
68
|
-
const lm = await this.lmRegistry.selectLanguageModel({ agent: this.id, ...this.languageModelRequirements[0] });
|
|
69
|
-
if (!lm) {
|
|
70
|
-
throw new Error('No language model found for chat session naming');
|
|
71
|
-
}
|
|
72
|
-
if (chatSession.model.getRequests().length < 1) {
|
|
73
|
-
throw new Error('No chat request available to generate chat session name');
|
|
74
|
-
}
|
|
75
|
-
const conversation = chatSession.model.getRequests()
|
|
76
|
-
.map(req => `<user>${req.message.parts.map(chunk => chunk.promptText).join('')}</user>` +
|
|
77
|
-
(req.response.response ? `<assistant>${req.response.response.asString()}</assistant>` : ''))
|
|
78
|
-
.join('\n\n');
|
|
79
|
-
const listOfSessionNames = otherNames.map(name => name).join(', ');
|
|
80
|
-
const prompt = await this.promptService.getResolvedPromptFragment(chat_session_naming_prompt_template_1.CHAT_SESSION_NAMING_PROMPT.id, { conversation, listOfSessionNames });
|
|
81
|
-
const message = prompt === null || prompt === void 0 ? void 0 : prompt.text;
|
|
82
|
-
if (!message) {
|
|
83
|
-
throw new Error('Unable to create prompt message for generating chat session name');
|
|
84
|
-
}
|
|
85
|
-
const sessionId = (0, core_1.generateUuid)();
|
|
86
|
-
const requestId = (0, core_1.generateUuid)();
|
|
87
|
-
const request = {
|
|
88
|
-
messages: [{
|
|
89
|
-
actor: 'user',
|
|
90
|
-
text: message,
|
|
91
|
-
type: 'text'
|
|
92
|
-
}],
|
|
93
|
-
requestId,
|
|
94
|
-
sessionId,
|
|
95
|
-
agentId: this.id
|
|
96
|
-
};
|
|
97
|
-
const result = await this.languageModelService.sendRequest(lm, request);
|
|
98
|
-
const response = await (0, ai_core_1.getTextOfResponse)(result);
|
|
99
|
-
return response.replace(/\s+/g, ' ').substring(0, 100);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
exports.ChatSessionNamingAgent = ChatSessionNamingAgent;
|
|
103
|
-
ChatSessionNamingAgent.ID = 'Chat Session Naming';
|
|
104
|
-
tslib_1.__decorate([
|
|
105
|
-
(0, inversify_1.inject)(ai_core_1.LanguageModelRegistry),
|
|
106
|
-
tslib_1.__metadata("design:type", Object)
|
|
107
|
-
], ChatSessionNamingAgent.prototype, "lmRegistry", void 0);
|
|
108
|
-
tslib_1.__decorate([
|
|
109
|
-
(0, inversify_1.inject)(ai_core_1.LanguageModelService),
|
|
110
|
-
tslib_1.__metadata("design:type", Object)
|
|
111
|
-
], ChatSessionNamingAgent.prototype, "languageModelService", void 0);
|
|
112
|
-
tslib_1.__decorate([
|
|
113
|
-
(0, inversify_1.inject)(ai_core_1.PromptService),
|
|
114
|
-
tslib_1.__metadata("design:type", Object)
|
|
115
|
-
], ChatSessionNamingAgent.prototype, "promptService", void 0);
|
|
116
|
-
exports.ChatSessionNamingAgent = ChatSessionNamingAgent = ChatSessionNamingAgent_1 = tslib_1.__decorate([
|
|
117
|
-
(0, inversify_1.injectable)()
|
|
118
|
-
], ChatSessionNamingAgent);
|
|
119
|
-
//# sourceMappingURL=chat-session-naming-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-naming-service.js","sourceRoot":"","sources":["../../src/common/chat-session-naming-service.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ChatModel } from './chat-model';
|
|
2
|
-
import { SerializedChatData } from './chat-model-serialization';
|
|
3
|
-
import { ChatAgentLocation } from './chat-agents';
|
|
4
|
-
export declare const ChatSessionStore: unique symbol;
|
|
5
|
-
export interface ChatModelWithMetadata {
|
|
6
|
-
model: ChatModel;
|
|
7
|
-
title?: string;
|
|
8
|
-
pinnedAgentId?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ChatSessionStore {
|
|
11
|
-
/**
|
|
12
|
-
* Stores the handed over sessions.
|
|
13
|
-
*
|
|
14
|
-
* Might overwrite existing sessions when maximum storage capacity is exceeded.
|
|
15
|
-
*/
|
|
16
|
-
storeSessions(...sessions: Array<ChatModel | ChatModelWithMetadata>): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Read specified session
|
|
19
|
-
*/
|
|
20
|
-
readSession(sessionId: string): Promise<SerializedChatData | undefined>;
|
|
21
|
-
/**
|
|
22
|
-
* Delete specified session
|
|
23
|
-
*/
|
|
24
|
-
deleteSession(sessionId: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Deletes all sessions
|
|
27
|
-
*/
|
|
28
|
-
clearAllSessions(): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Get index of all stored sessions
|
|
31
|
-
*/
|
|
32
|
-
getSessionIndex(): Promise<ChatSessionIndex>;
|
|
33
|
-
}
|
|
34
|
-
export interface ChatSessionIndex {
|
|
35
|
-
[sessionId: string]: ChatSessionMetadata;
|
|
36
|
-
}
|
|
37
|
-
export interface ChatSessionMetadata {
|
|
38
|
-
sessionId: string;
|
|
39
|
-
title: string;
|
|
40
|
-
saveDate: number;
|
|
41
|
-
location: ChatAgentLocation;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=chat-session-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-store.d.ts","sourceRoot":"","sources":["../../src/common/chat-session-store.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC7B;;;;OAIG;IACH,aAAa,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,qBAAqB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IACxE;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC;;OAEG;IACH,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,gBAAgB;IAC7B,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,iBAAiB,CAAC;CAC/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
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.ChatSessionStore = void 0;
|
|
19
|
-
exports.ChatSessionStore = Symbol('ChatSessionStore');
|
|
20
|
-
//# sourceMappingURL=chat-session-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-store.js","sourceRoot":"","sources":["../../src/common/chat-session-store.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;;;AAMnE,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-summary-agent-prompt.d.ts","sourceRoot":"","sources":["../../src/common/chat-session-summary-agent-prompt.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,2BAA2B;;;;;;CAkBvC,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/tslint/config */
|
|
3
|
-
// *****************************************************************************
|
|
4
|
-
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
5
|
-
//
|
|
6
|
-
// This file is licensed under the MIT License.
|
|
7
|
-
// See LICENSE-MIT.txt in the project root for license information.
|
|
8
|
-
// https://opensource.org/license/mit.
|
|
9
|
-
//
|
|
10
|
-
// SPDX-License-Identifier: MIT
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CHAT_SESSION_SUMMARY_PROMPT = void 0;
|
|
13
|
-
const context_variables_1 = require("./context-variables");
|
|
14
|
-
exports.CHAT_SESSION_SUMMARY_PROMPT = {
|
|
15
|
-
id: 'chat-session-summary-system',
|
|
16
|
-
defaultVariant: {
|
|
17
|
-
id: 'chat-session-summary-system-default',
|
|
18
|
-
template: '{{!-- !-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).\n' +
|
|
19
|
-
'Made improvements or adaptations to this prompt template? We\'d love for you to share it with the community! Contribute back here: ' +
|
|
20
|
-
'https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}\n\n' +
|
|
21
|
-
'You are a chat agent for summarizing AI agent chat sessions for later use. ' +
|
|
22
|
-
'Review the conversation above and generate a concise summary that captures every crucial detail, ' +
|
|
23
|
-
'including all requirements, decisions, and pending tasks. ' +
|
|
24
|
-
'Ensure that the summary is sufficiently comprehensive to allow seamless continuation of the workflow. ' +
|
|
25
|
-
'The summary will primarily be used by other AI agents, so tailor your response for use by AI agents. ' +
|
|
26
|
-
'Also consider the system message. ' +
|
|
27
|
-
'Make sure you include all necessary context information and use unique references (such as URIs, file paths, etc.). ' +
|
|
28
|
-
'If the conversation was about a task, describe the state of the task, i.e. what has been completed and what is open. ' +
|
|
29
|
-
'If a changeset is open in the session, describe the state of the suggested changes. ' +
|
|
30
|
-
`\n\n{{${context_variables_1.CHANGE_SET_SUMMARY_VARIABLE_ID}}}`,
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=chat-session-summary-agent-prompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-summary-agent-prompt.js","sourceRoot":"","sources":["../../src/common/chat-session-summary-agent-prompt.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,+CAA+C;AAC/C,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,+BAA+B;;;AAE/B,2DAAqE;AAExD,QAAA,2BAA2B,GAAG;IACvC,EAAE,EAAE,6BAA6B;IACjC,cAAc,EAAE;QACZ,EAAE,EAAE,qCAAqC;QACzC,QAAQ,EAAE,iGAAiG;YACvG,sIAAsI;YACtI,uGAAuG;YACvG,6EAA6E;YAC7E,mGAAmG;YACnG,4DAA4D;YAC5D,wGAAwG;YACxG,uGAAuG;YACvG,oCAAoC;YACpC,sHAAsH;YACtH,uHAAuH;YACvH,sFAAsF;YACtF,SAAS,kDAA8B,IAAI;KAClD;CACJ,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LanguageModelRequirement, PromptVariantSet } from '@theia/ai-core';
|
|
2
|
-
import { AbstractStreamParsingChatAgent, ChatAgent } from './chat-agents';
|
|
3
|
-
export declare class ChatSessionSummaryAgent extends AbstractStreamParsingChatAgent implements ChatAgent {
|
|
4
|
-
static ID: string;
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
prompts: PromptVariantSet[];
|
|
9
|
-
protected readonly defaultLanguageModelPurpose = "chat-session-summary";
|
|
10
|
-
languageModelRequirements: LanguageModelRequirement[];
|
|
11
|
-
agentSpecificVariables: never[];
|
|
12
|
-
functions: never[];
|
|
13
|
-
locations: never[];
|
|
14
|
-
tags: never[];
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=chat-session-summary-agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-summary-agent.d.ts","sourceRoot":"","sources":["../../src/common/chat-session-summary-agent.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,wBAAwB,EACxB,gBAAgB,EACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1E,qBACa,uBAAwB,SAAQ,8BAA+B,YAAW,SAAS;IAC5F,MAAM,CAAC,EAAE,SAAgC;IACzC,EAAE,SAA8B;IAChC,IAAI,SAA0B;IACrB,WAAW,SAAqH;IAChI,OAAO,EAAE,gBAAgB,EAAE,CAAiC;IACrE,SAAS,CAAC,QAAQ,CAAC,2BAA2B,0BAA0B;IACxE,yBAAyB,EAAE,wBAAwB,EAAE,CAGlD;IACM,sBAAsB,UAAM;IAC5B,SAAS,UAAM;IACf,SAAS,UAAM;IACf,IAAI,UAAM;CACtB"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource 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
|
-
var ChatSessionSummaryAgent_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ChatSessionSummaryAgent = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const chat_agents_1 = require("./chat-agents");
|
|
23
|
-
const chat_session_summary_agent_prompt_1 = require("./chat-session-summary-agent-prompt");
|
|
24
|
-
const core_1 = require("@theia/core");
|
|
25
|
-
let ChatSessionSummaryAgent = ChatSessionSummaryAgent_1 = class ChatSessionSummaryAgent extends chat_agents_1.AbstractStreamParsingChatAgent {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.id = ChatSessionSummaryAgent_1.ID;
|
|
29
|
-
this.name = 'Chat Session Summary';
|
|
30
|
-
this.description = core_1.nls.localize('theia/ai/chat/chatSessionSummaryAgent/description', 'Agent for generating chat session summaries.');
|
|
31
|
-
this.prompts = [chat_session_summary_agent_prompt_1.CHAT_SESSION_SUMMARY_PROMPT];
|
|
32
|
-
this.defaultLanguageModelPurpose = 'chat-session-summary';
|
|
33
|
-
this.languageModelRequirements = [{
|
|
34
|
-
purpose: 'chat-session-summary',
|
|
35
|
-
identifier: 'default/summarize',
|
|
36
|
-
}];
|
|
37
|
-
this.agentSpecificVariables = [];
|
|
38
|
-
this.functions = [];
|
|
39
|
-
this.locations = [];
|
|
40
|
-
this.tags = [];
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.ChatSessionSummaryAgent = ChatSessionSummaryAgent;
|
|
44
|
-
ChatSessionSummaryAgent.ID = 'chat-session-summary-agent';
|
|
45
|
-
exports.ChatSessionSummaryAgent = ChatSessionSummaryAgent = ChatSessionSummaryAgent_1 = tslib_1.__decorate([
|
|
46
|
-
(0, inversify_1.injectable)()
|
|
47
|
-
], ChatSessionSummaryAgent);
|
|
48
|
-
//# sourceMappingURL=chat-session-summary-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-summary-agent.js","sourceRoot":"","sources":["../../src/common/chat-session-summary-agent.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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;;;;;AAMhF,4DAA0D;AAC1D,+CAA0E;AAC1E,2FAAkF;AAClF,sCAAkC;AAG3B,IAAM,uBAAuB,+BAA7B,MAAM,uBAAwB,SAAQ,4CAA8B;IAApE;;QAEH,OAAE,GAAG,yBAAuB,CAAC,EAAE,CAAC;QAChC,SAAI,GAAG,sBAAsB,CAAC;QACrB,gBAAW,GAAG,UAAG,CAAC,QAAQ,CAAC,mDAAmD,EAAE,8CAA8C,CAAC,CAAC;QAChI,YAAO,GAAuB,CAAC,+DAA2B,CAAC,CAAC;QAClD,gCAA2B,GAAG,sBAAsB,CAAC;QACxE,8BAAyB,GAA+B,CAAC;gBACrD,OAAO,EAAE,sBAAsB;gBAC/B,UAAU,EAAE,mBAAmB;aAClC,CAAC,CAAC;QACM,2BAAsB,GAAG,EAAE,CAAC;QAC5B,cAAS,GAAG,EAAE,CAAC;QACf,cAAS,GAAG,EAAE,CAAC;QACf,SAAI,GAAG,EAAE,CAAC;IACvB,CAAC;;AAfY,0DAAuB;AACzB,0BAAE,GAAG,4BAA4B,AAA/B,CAAgC;kCADhC,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAenC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-string-utils.d.ts","sourceRoot":"","sources":["../../src/common/chat-string-utils.ts"],"names":[],"mappings":"AAgBA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE1D"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource 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.dataToJsonCodeBlock = exports.stringJsonCodeBlock = void 0;
|
|
19
|
-
function stringJsonCodeBlock(input) {
|
|
20
|
-
return `\`\`\`json\n${input}\n\`\`\``;
|
|
21
|
-
}
|
|
22
|
-
exports.stringJsonCodeBlock = stringJsonCodeBlock;
|
|
23
|
-
function dataToJsonCodeBlock(input) {
|
|
24
|
-
return stringJsonCodeBlock(JSON.stringify(input, undefined, 2));
|
|
25
|
-
}
|
|
26
|
-
exports.dataToJsonCodeBlock = dataToJsonCodeBlock;
|
|
27
|
-
//# sourceMappingURL=chat-string-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-string-utils.js","sourceRoot":"","sources":["../../src/common/chat-string-utils.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,SAAgB,mBAAmB,CAAC,KAAa;IAC7C,OAAO,eAAe,KAAK,UAAU,CAAC;AAC1C,CAAC;AAFD,kDAEC;AAED,SAAgB,mBAAmB,CAAC,KAAc;IAC9C,OAAO,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,kDAEC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PreferenceProxy, PreferenceSchema, PreferenceService } from '@theia/core/lib/common/preferences';
|
|
2
|
-
import { interfaces } from '@theia/core/shared/inversify';
|
|
3
|
-
export type ChatToolPreferences = PreferenceProxy<ChatToolConfiguration>;
|
|
4
|
-
export declare const ChatToolPreferenceContribution: unique symbol;
|
|
5
|
-
export declare const ChatToolPreferences: unique symbol;
|
|
6
|
-
export declare function createChatToolPreferences(preferences: PreferenceService, schema?: PreferenceSchema): ChatToolPreferences;
|
|
7
|
-
export declare function bindChatToolPreferences(bind: interfaces.Bind): void;
|
|
8
|
-
/**
|
|
9
|
-
* Enum for tool confirmation modes
|
|
10
|
-
*/
|
|
11
|
-
export declare enum ToolConfirmationMode {
|
|
12
|
-
ALWAYS_ALLOW = "always_allow",
|
|
13
|
-
CONFIRM = "confirm",
|
|
14
|
-
DISABLED = "disabled"
|
|
15
|
-
}
|
|
16
|
-
export declare const TOOL_CONFIRMATION_PREFERENCE = "ai-features.chat.toolConfirmation";
|
|
17
|
-
export declare const chatToolPreferences: PreferenceSchema;
|
|
18
|
-
export interface ChatToolConfiguration {
|
|
19
|
-
[TOOL_CONFIRMATION_PREFERENCE]: {
|
|
20
|
-
[toolId: string]: ToolConfirmationMode;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=chat-tool-preferences.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-tool-preferences.d.ts","sourceRoot":"","sources":["../../src/common/chat-tool-preferences.ts"],"names":[],"mappings":"AAkBA,OAAO,EAGH,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAEzE,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AACvF,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,iBAAiB,EAAE,MAAM,GAAE,gBAAsC,GAAG,mBAAmB,CAE7I;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAQnE;AAED;;GAEG;AACH,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACxB;AAED,eAAO,MAAM,4BAA4B,sCAAsC,CAAC;AAEhF,eAAO,MAAM,mBAAmB,EAAE,gBAoBjC,CAAC;AAEF,MAAM,WAAW,qBAAqB;IAClC,CAAC,4BAA4B,CAAC,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAA;KAAE,CAAC;CAC9E"}
|
|
@@ -1,68 +0,0 @@
|
|
|
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.chatToolPreferences = exports.TOOL_CONFIRMATION_PREFERENCE = exports.ToolConfirmationMode = exports.bindChatToolPreferences = exports.createChatToolPreferences = exports.ChatToolPreferences = exports.ChatToolPreferenceContribution = void 0;
|
|
19
|
-
const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
|
|
20
|
-
const core_1 = require("@theia/core");
|
|
21
|
-
const preferences_1 = require("@theia/core/lib/common/preferences");
|
|
22
|
-
exports.ChatToolPreferenceContribution = Symbol('ChatToolPreferenceContribution');
|
|
23
|
-
exports.ChatToolPreferences = Symbol('ChatToolPreferences');
|
|
24
|
-
function createChatToolPreferences(preferences, schema = exports.chatToolPreferences) {
|
|
25
|
-
return (0, preferences_1.createPreferenceProxy)(preferences, schema);
|
|
26
|
-
}
|
|
27
|
-
exports.createChatToolPreferences = createChatToolPreferences;
|
|
28
|
-
function bindChatToolPreferences(bind) {
|
|
29
|
-
bind(exports.ChatToolPreferences).toDynamicValue((ctx) => {
|
|
30
|
-
const preferences = ctx.container.get(preferences_1.PreferenceService);
|
|
31
|
-
const contribution = ctx.container.get(exports.ChatToolPreferenceContribution);
|
|
32
|
-
return createChatToolPreferences(preferences, contribution.schema);
|
|
33
|
-
}).inSingletonScope();
|
|
34
|
-
bind(exports.ChatToolPreferenceContribution).toConstantValue({ schema: exports.chatToolPreferences });
|
|
35
|
-
bind(preferences_1.PreferenceContribution).toService(exports.ChatToolPreferenceContribution);
|
|
36
|
-
}
|
|
37
|
-
exports.bindChatToolPreferences = bindChatToolPreferences;
|
|
38
|
-
/**
|
|
39
|
-
* Enum for tool confirmation modes
|
|
40
|
-
*/
|
|
41
|
-
var ToolConfirmationMode;
|
|
42
|
-
(function (ToolConfirmationMode) {
|
|
43
|
-
ToolConfirmationMode["ALWAYS_ALLOW"] = "always_allow";
|
|
44
|
-
ToolConfirmationMode["CONFIRM"] = "confirm";
|
|
45
|
-
ToolConfirmationMode["DISABLED"] = "disabled";
|
|
46
|
-
})(ToolConfirmationMode || (exports.ToolConfirmationMode = ToolConfirmationMode = {}));
|
|
47
|
-
exports.TOOL_CONFIRMATION_PREFERENCE = 'ai-features.chat.toolConfirmation';
|
|
48
|
-
exports.chatToolPreferences = {
|
|
49
|
-
properties: {
|
|
50
|
-
[exports.TOOL_CONFIRMATION_PREFERENCE]: {
|
|
51
|
-
type: 'object',
|
|
52
|
-
additionalProperties: {
|
|
53
|
-
type: 'string',
|
|
54
|
-
enum: [ToolConfirmationMode.ALWAYS_ALLOW, ToolConfirmationMode.CONFIRM, ToolConfirmationMode.DISABLED],
|
|
55
|
-
enumDescriptions: [
|
|
56
|
-
core_1.nls.localize('theia/ai/chat/toolConfirmation/yolo/description', 'Execute tools automatically without confirmation'),
|
|
57
|
-
core_1.nls.localize('theia/ai/chat/toolConfirmation/confirm/description', 'Ask for confirmation before executing tools'),
|
|
58
|
-
core_1.nls.localize('theia/ai/chat/toolConfirmation/disabled/description', 'Disable tool execution')
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
default: {},
|
|
62
|
-
description: core_1.nls.localize('theia/ai/chat/toolConfirmation/description', 'Configure confirmation behavior for different tools. Key is the tool ID, value is the confirmation mode. ' +
|
|
63
|
-
'Use "*" as the key to set a global default for all tools.'),
|
|
64
|
-
title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=chat-tool-preferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-tool-preferences.js","sourceRoot":"","sources":["../../src/common/chat-tool-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,uFAA0F;AAC1F,sCAAkC;AAClC,oEAM4C;AAK/B,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAC1E,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjE,SAAgB,yBAAyB,CAAC,WAA8B,EAAE,SAA2B,2BAAmB;IACpH,OAAO,IAAA,mCAAqB,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAFD,8DAEC;AAED,SAAgB,uBAAuB,CAAC,IAAqB;IACzD,IAAI,CAAC,2BAAmB,CAAC,CAAC,cAAc,CAAC,CAAC,GAAuB,EAAE,EAAE;QACjE,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAoB,+BAAiB,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAyB,sCAA8B,CAAC,CAAC;QAC/F,OAAO,yBAAyB,CAAC,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtB,IAAI,CAAC,sCAA8B,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,2BAAmB,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC,oCAAsB,CAAC,CAAC,SAAS,CAAC,sCAA8B,CAAC,CAAC;AAC3E,CAAC;AARD,0DAQC;AAED;;GAEG;AACH,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,qDAA6B,CAAA;IAC7B,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;AACzB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAEY,QAAA,4BAA4B,GAAG,mCAAmC,CAAC;AAEnE,QAAA,mBAAmB,GAAqB;IACjD,UAAU,EAAE;QACR,CAAC,oCAA4B,CAAC,EAAE;YAC5B,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,oBAAoB,CAAC,YAAY,EAAE,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC;gBACtG,gBAAgB,EAAE;oBACd,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EAAE,kDAAkD,CAAC;oBACnH,UAAG,CAAC,QAAQ,CAAC,oDAAoD,EAAE,6CAA6C,CAAC;oBACjH,UAAG,CAAC,QAAQ,CAAC,qDAAqD,EAAE,wBAAwB,CAAC;iBAChG;aACJ;YACD,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,4CAA4C,EAClE,2GAA2G;gBAC3G,2DAA2D,CAAC;YAChE,KAAK,EAAE,+CAAyB;SACnC;KACJ;CACJ,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ToolRequest } from '@theia/ai-core';
|
|
2
|
-
import { MutableChatRequestModel } from './chat-model';
|
|
3
|
-
export interface ChatToolRequest extends ToolRequest {
|
|
4
|
-
handler(arg_string: string, context: MutableChatRequestModel): ReturnType<ToolRequest['handler']>;
|
|
5
|
-
handler(arg_string: string, ctx?: unknown): ReturnType<ToolRequest['handler']>;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Wraps tool requests in a chat context.
|
|
9
|
-
*
|
|
10
|
-
* This service extracts tool requests from a given chat request model and wraps their
|
|
11
|
-
* handler functions to provide additional context, such as the chat request model.
|
|
12
|
-
*/
|
|
13
|
-
export declare class ChatToolRequestService {
|
|
14
|
-
getChatToolRequests(request: MutableChatRequestModel): ChatToolRequest[];
|
|
15
|
-
toChatToolRequests(toolRequests: ToolRequest[] | undefined, request: MutableChatRequestModel): ChatToolRequest[];
|
|
16
|
-
protected toChatToolRequest(toolRequest: ToolRequest, request: MutableChatRequestModel): ChatToolRequest;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=chat-tool-request-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-tool-request-service.d.ts","sourceRoot":"","sources":["../../src/common/chat-tool-request-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;IAClG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;CAClF;AAED;;;;;GAKG;AACH,qBACa,sBAAsB;IAE/B,mBAAmB,CAAC,OAAO,EAAE,uBAAuB,GAAG,eAAe,EAAE;IAQxE,kBAAkB,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,uBAAuB,GAAG,eAAe,EAAE;IAOhH,SAAS,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,uBAAuB,GAAG,eAAe;CAO3G"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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.ChatToolRequestService = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
/**
|
|
22
|
-
* Wraps tool requests in a chat context.
|
|
23
|
-
*
|
|
24
|
-
* This service extracts tool requests from a given chat request model and wraps their
|
|
25
|
-
* handler functions to provide additional context, such as the chat request model.
|
|
26
|
-
*/
|
|
27
|
-
let ChatToolRequestService = class ChatToolRequestService {
|
|
28
|
-
getChatToolRequests(request) {
|
|
29
|
-
const toolRequests = request.message.toolRequests.size > 0 ? [...request.message.toolRequests.values()] : undefined;
|
|
30
|
-
if (!toolRequests) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
return this.toChatToolRequests(toolRequests, request);
|
|
34
|
-
}
|
|
35
|
-
toChatToolRequests(toolRequests, request) {
|
|
36
|
-
if (!toolRequests) {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
return toolRequests.map(toolRequest => this.toChatToolRequest(toolRequest, request));
|
|
40
|
-
}
|
|
41
|
-
toChatToolRequest(toolRequest, request) {
|
|
42
|
-
return {
|
|
43
|
-
...toolRequest,
|
|
44
|
-
handler: async (arg_string) => toolRequest.handler(arg_string, request)
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
exports.ChatToolRequestService = ChatToolRequestService;
|
|
49
|
-
exports.ChatToolRequestService = ChatToolRequestService = tslib_1.__decorate([
|
|
50
|
-
(0, inversify_1.injectable)()
|
|
51
|
-
], ChatToolRequestService);
|
|
52
|
-
//# sourceMappingURL=chat-tool-request-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-tool-request-service.js","sourceRoot":"","sources":["../../src/common/chat-tool-request-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;;;;AAGhF,4DAA0D;AAQ1D;;;;;GAKG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAE/B,mBAAmB,CAAC,OAAgC;QAChD,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACpH,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,kBAAkB,CAAC,YAAuC,EAAE,OAAgC;QACxF,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACzF,CAAC;IAES,iBAAiB,CAAC,WAAwB,EAAE,OAAgC;QAClF,OAAO;YACH,GAAG,WAAW;YACd,OAAO,EAAE,KAAK,EAAE,UAAkB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC;SAClF,CAAC;IACN,CAAC;CAEJ,CAAA;AAxBY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAwBlC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MaybePromise } from '@theia/core';
|
|
2
|
-
import { AIVariable, ResolvedAIVariable, AIVariableContribution, AIVariableResolver, AIVariableService, AIVariableResolutionRequest, AIVariableContext } from '@theia/ai-core';
|
|
3
|
-
export declare const CONTEXT_DETAILS_VARIABLE: AIVariable;
|
|
4
|
-
export declare class ContextDetailsVariableContribution implements AIVariableContribution, AIVariableResolver {
|
|
5
|
-
registerVariables(service: AIVariableService): void;
|
|
6
|
-
canResolve(request: AIVariableResolutionRequest, context: AIVariableContext): MaybePromise<number>;
|
|
7
|
-
resolve(request: AIVariableResolutionRequest, context: AIVariableContext): Promise<ResolvedAIVariable | undefined>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=context-details-variable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-details-variable.d.ts","sourceRoot":"","sources":["../../src/common/context-details-variable.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAO,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAK/K,eAAO,MAAM,wBAAwB,EAAE,UAItC,CAAC;AAEF,qBACa,kCAAmC,YAAW,sBAAsB,EAAE,kBAAkB;IACjG,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAInD,UAAU,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC;IAI5F,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;CAa3H"}
|
|
@@ -1,57 +0,0 @@
|
|
|
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.ContextDetailsVariableContribution = exports.CONTEXT_DETAILS_VARIABLE = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const core_1 = require("@theia/core");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const chat_string_utils_1 = require("./chat-string-utils");
|
|
23
|
-
const chat_agents_1 = require("./chat-agents");
|
|
24
|
-
const context_variables_1 = require("./context-variables");
|
|
25
|
-
exports.CONTEXT_DETAILS_VARIABLE = {
|
|
26
|
-
id: context_variables_1.CHAT_CONTEXT_DETAILS_VARIABLE_ID,
|
|
27
|
-
description: core_1.nls.localize('theia/ai/core/contextDetailsVariable/description', 'Provides full text values and descriptions for all context elements.'),
|
|
28
|
-
name: context_variables_1.CHAT_CONTEXT_DETAILS_VARIABLE_ID,
|
|
29
|
-
};
|
|
30
|
-
let ContextDetailsVariableContribution = class ContextDetailsVariableContribution {
|
|
31
|
-
registerVariables(service) {
|
|
32
|
-
service.registerResolver(exports.CONTEXT_DETAILS_VARIABLE, this);
|
|
33
|
-
}
|
|
34
|
-
canResolve(request, context) {
|
|
35
|
-
return request.variable.name === exports.CONTEXT_DETAILS_VARIABLE.name ? 50 : 0;
|
|
36
|
-
}
|
|
37
|
-
async resolve(request, context) {
|
|
38
|
-
/** By expecting context.request, we're assuming that this variable will not be resolved until the context has been resolved. */
|
|
39
|
-
if (!chat_agents_1.ChatSessionContext.is(context) || request.variable.name !== exports.CONTEXT_DETAILS_VARIABLE.name || !context.request) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
const data = context.request.context.variables.map(variable => ({
|
|
43
|
-
type: variable.variable.name,
|
|
44
|
-
ref: variable.value,
|
|
45
|
-
content: variable.contextValue
|
|
46
|
-
}));
|
|
47
|
-
return {
|
|
48
|
-
variable: exports.CONTEXT_DETAILS_VARIABLE,
|
|
49
|
-
value: (0, chat_string_utils_1.dataToJsonCodeBlock)(data)
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
exports.ContextDetailsVariableContribution = ContextDetailsVariableContribution;
|
|
54
|
-
exports.ContextDetailsVariableContribution = ContextDetailsVariableContribution = tslib_1.__decorate([
|
|
55
|
-
(0, inversify_1.injectable)()
|
|
56
|
-
], ContextDetailsVariableContribution);
|
|
57
|
-
//# sourceMappingURL=context-details-variable.js.map
|