@theia/ai-chat 1.67.0-next.56 → 1.67.0-next.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/agent-delegation-tool.d.ts +25 -0
- package/lib/browser/agent-delegation-tool.d.ts.map +1 -0
- package/lib/browser/agent-delegation-tool.js +196 -0
- package/lib/browser/agent-delegation-tool.js.map +1 -0
- package/lib/browser/ai-chat-frontend-contribution.d.ts +11 -0
- package/lib/browser/ai-chat-frontend-contribution.d.ts.map +1 -0
- package/lib/browser/ai-chat-frontend-contribution.js +56 -0
- package/lib/browser/ai-chat-frontend-contribution.js.map +1 -0
- package/lib/browser/ai-chat-frontend-module.d.ts +4 -0
- package/lib/browser/ai-chat-frontend-module.d.ts.map +1 -0
- package/lib/browser/ai-chat-frontend-module.js +143 -0
- package/lib/browser/ai-chat-frontend-module.js.map +1 -0
- package/lib/browser/change-set-decorator-service.d.ts +24 -0
- package/lib/browser/change-set-decorator-service.d.ts.map +1 -0
- package/lib/browser/change-set-decorator-service.js +66 -0
- package/lib/browser/change-set-decorator-service.js.map +1 -0
- package/lib/browser/change-set-file-element-deserializer.d.ts +7 -0
- package/lib/browser/change-set-file-element-deserializer.d.ts.map +1 -0
- package/lib/browser/change-set-file-element-deserializer.js +61 -0
- package/lib/browser/change-set-file-element-deserializer.js.map +1 -0
- package/lib/browser/change-set-file-element.d.ts +122 -0
- package/lib/browser/change-set-file-element.d.ts.map +1 -0
- package/lib/browser/change-set-file-element.js +435 -0
- package/lib/browser/change-set-file-element.js.map +1 -0
- package/lib/browser/change-set-file-resource.d.ts +4 -0
- package/lib/browser/change-set-file-resource.d.ts.map +1 -0
- package/lib/browser/change-set-file-resource.js +24 -0
- package/lib/browser/change-set-file-resource.js.map +1 -0
- package/lib/browser/change-set-file-service.d.ts +32 -0
- package/lib/browser/change-set-file-service.d.ts.map +1 -0
- package/lib/browser/change-set-file-service.js +161 -0
- package/lib/browser/change-set-file-service.js.map +1 -0
- package/lib/browser/change-set-variable.d.ts +11 -0
- package/lib/browser/change-set-variable.d.ts.map +1 -0
- package/lib/browser/change-set-variable.js +64 -0
- package/lib/browser/change-set-variable.js.map +1 -0
- package/lib/browser/chat-session-store-impl.d.ts +36 -0
- package/lib/browser/chat-session-store-impl.d.ts.map +1 -0
- package/lib/browser/chat-session-store-impl.js +287 -0
- package/lib/browser/chat-session-store-impl.js.map +1 -0
- package/lib/browser/chat-tool-preference-bindings.d.ts +34 -0
- package/lib/browser/chat-tool-preference-bindings.d.ts.map +1 -0
- package/lib/browser/chat-tool-preference-bindings.js +122 -0
- package/lib/browser/chat-tool-preference-bindings.js.map +1 -0
- package/lib/browser/chat-tool-request-service.d.ts +21 -0
- package/lib/browser/chat-tool-request-service.d.ts.map +1 -0
- package/lib/browser/chat-tool-request-service.js +90 -0
- package/lib/browser/chat-tool-request-service.js.map +1 -0
- package/lib/browser/context-file-validation-service.d.ts +15 -0
- package/lib/browser/context-file-validation-service.d.ts.map +1 -0
- package/lib/browser/context-file-validation-service.js +26 -0
- package/lib/browser/context-file-validation-service.js.map +1 -0
- 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/custom-agent-factory.d.ts +4 -0
- package/lib/browser/custom-agent-factory.d.ts.map +1 -0
- package/lib/browser/custom-agent-factory.js +20 -0
- package/lib/browser/custom-agent-factory.js.map +1 -0
- package/lib/browser/custom-agent-frontend-application-contribution.d.ts +13 -0
- package/lib/browser/custom-agent-frontend-application-contribution.d.ts.map +1 -0
- package/lib/browser/custom-agent-frontend-application-contribution.js +83 -0
- package/lib/browser/custom-agent-frontend-application-contribution.js.map +1 -0
- package/lib/browser/delegation-response-content.d.ts +20 -0
- package/lib/browser/delegation-response-content.d.ts.map +1 -0
- package/lib/browser/delegation-response-content.js +47 -0
- package/lib/browser/delegation-response-content.js.map +1 -0
- package/lib/browser/file-chat-variable-contribution.d.ts +32 -0
- package/lib/browser/file-chat-variable-contribution.d.ts.map +1 -0
- package/lib/browser/file-chat-variable-contribution.js +241 -0
- package/lib/browser/file-chat-variable-contribution.js.map +1 -0
- package/lib/browser/frontend-chat-service.d.ts +15 -0
- package/lib/browser/frontend-chat-service.d.ts.map +1 -0
- package/lib/browser/frontend-chat-service.js +72 -0
- package/lib/browser/frontend-chat-service.js.map +1 -0
- package/lib/browser/image-context-variable-contribution.d.ts +27 -0
- package/lib/browser/image-context-variable-contribution.d.ts.map +1 -0
- package/lib/browser/image-context-variable-contribution.js +149 -0
- package/lib/browser/image-context-variable-contribution.js.map +1 -0
- package/lib/browser/task-context-service.d.ts +46 -0
- package/lib/browser/task-context-service.d.ts.map +1 -0
- package/lib/browser/task-context-service.js +256 -0
- package/lib/browser/task-context-service.js.map +1 -0
- package/lib/browser/task-context-storage-service.d.ts +19 -0
- package/lib/browser/task-context-storage-service.d.ts.map +1 -0
- package/lib/browser/task-context-storage-service.js +80 -0
- package/lib/browser/task-context-storage-service.js.map +1 -0
- package/lib/browser/task-context-variable-contribution.d.ts +20 -0
- package/lib/browser/task-context-variable-contribution.d.ts.map +1 -0
- package/lib/browser/task-context-variable-contribution.js +101 -0
- package/lib/browser/task-context-variable-contribution.js.map +1 -0
- package/lib/browser/task-context-variable-label-provider.d.ts +21 -0
- package/lib/browser/task-context-variable-label-provider.d.ts.map +1 -0
- package/lib/browser/task-context-variable-label-provider.js +83 -0
- package/lib/browser/task-context-variable-label-provider.js.map +1 -0
- package/lib/browser/task-context-variable.d.ts +3 -0
- package/lib/browser/task-context-variable.d.ts.map +1 -0
- package/lib/browser/task-context-variable.js +33 -0
- package/lib/browser/task-context-variable.js.map +1 -0
- package/lib/common/ai-chat-preferences.d.ts +5 -0
- package/lib/common/ai-chat-preferences.d.ts.map +1 -0
- package/lib/common/ai-chat-preferences.js +40 -0
- package/lib/common/ai-chat-preferences.js.map +1 -0
- package/lib/common/change-set-element-deserializer.d.ts +30 -0
- package/lib/common/change-set-element-deserializer.d.ts.map +1 -0
- package/lib/common/change-set-element-deserializer.js +81 -0
- package/lib/common/change-set-element-deserializer.js.map +1 -0
- package/lib/common/change-set.d.ts +85 -0
- package/lib/common/change-set.d.ts.map +1 -0
- package/lib/common/change-set.js +133 -0
- package/lib/common/change-set.js.map +1 -0
- package/lib/common/chat-agent-service.d.ts +46 -0
- package/lib/common/chat-agent-service.d.ts.map +1 -0
- package/lib/common/chat-agent-service.js +79 -0
- package/lib/common/chat-agent-service.js.map +1 -0
- package/lib/common/chat-agents-variable-contribution.d.ts +17 -0
- package/lib/common/chat-agents-variable-contribution.d.ts.map +1 -0
- package/lib/common/chat-agents-variable-contribution.js +67 -0
- package/lib/common/chat-agents-variable-contribution.js.map +1 -0
- package/lib/common/chat-agents.d.ts +138 -0
- package/lib/common/chat-agents.d.ts.map +1 -0
- package/lib/common/chat-agents.js +428 -0
- package/lib/common/chat-agents.js.map +1 -0
- package/lib/common/chat-auto-save.spec.d.ts +2 -0
- package/lib/common/chat-auto-save.spec.d.ts.map +1 -0
- package/lib/common/chat-auto-save.spec.js +304 -0
- package/lib/common/chat-auto-save.spec.js.map +1 -0
- package/lib/common/chat-content-deserializer.d.ts +161 -0
- package/lib/common/chat-content-deserializer.d.ts.map +1 -0
- package/lib/common/chat-content-deserializer.js +166 -0
- package/lib/common/chat-content-deserializer.js.map +1 -0
- package/lib/common/chat-content-deserializer.spec.d.ts +2 -0
- package/lib/common/chat-content-deserializer.spec.d.ts.map +1 -0
- package/lib/common/chat-content-deserializer.spec.js +307 -0
- package/lib/common/chat-content-deserializer.spec.js.map +1 -0
- package/lib/common/chat-model-serialization.d.ts +110 -0
- package/lib/common/chat-model-serialization.d.ts.map +1 -0
- package/lib/common/chat-model-serialization.js +20 -0
- package/lib/common/chat-model-serialization.js.map +1 -0
- package/lib/common/chat-model-serialization.spec.d.ts +2 -0
- package/lib/common/chat-model-serialization.spec.d.ts.map +1 -0
- package/lib/common/chat-model-serialization.spec.js +278 -0
- package/lib/common/chat-model-serialization.spec.js.map +1 -0
- package/lib/common/chat-model-util.d.ts +7 -0
- package/lib/common/chat-model-util.d.ts.map +1 -0
- package/lib/common/chat-model-util.js +50 -0
- package/lib/common/chat-model-util.js.map +1 -0
- package/lib/common/chat-model.d.ts +923 -0
- package/lib/common/chat-model.d.ts.map +1 -0
- package/lib/common/chat-model.js +1791 -0
- package/lib/common/chat-model.js.map +1 -0
- package/lib/common/chat-request-parser.d.ts +38 -0
- package/lib/common/chat-request-parser.d.ts.map +1 -0
- package/lib/common/chat-request-parser.js +230 -0
- package/lib/common/chat-request-parser.js.map +1 -0
- package/lib/common/chat-request-parser.spec.d.ts +2 -0
- package/lib/common/chat-request-parser.spec.d.ts.map +1 -0
- package/lib/common/chat-request-parser.spec.js +235 -0
- package/lib/common/chat-request-parser.spec.js.map +1 -0
- package/lib/common/chat-service-deletion.spec.d.ts +2 -0
- package/lib/common/chat-service-deletion.spec.d.ts.map +1 -0
- package/lib/common/chat-service-deletion.spec.js +221 -0
- package/lib/common/chat-service-deletion.spec.js.map +1 -0
- package/lib/common/chat-service.d.ts +153 -0
- package/lib/common/chat-service.d.ts.map +1 -0
- package/lib/common/chat-service.js +474 -0
- package/lib/common/chat-service.js.map +1 -0
- package/lib/common/chat-session-naming-prompt-template.d.ts +3 -0
- package/lib/common/chat-session-naming-prompt-template.d.ts.map +1 -0
- package/lib/common/chat-session-naming-prompt-template.js +31 -0
- package/lib/common/chat-session-naming-prompt-template.js.map +1 -0
- package/lib/common/chat-session-naming-service.d.ts +26 -0
- package/lib/common/chat-session-naming-service.d.ts.map +1 -0
- package/lib/common/chat-session-naming-service.js +119 -0
- package/lib/common/chat-session-naming-service.js.map +1 -0
- package/lib/common/chat-session-store.d.ts +43 -0
- package/lib/common/chat-session-store.d.ts.map +1 -0
- package/lib/common/chat-session-store.js +20 -0
- package/lib/common/chat-session-store.js.map +1 -0
- package/lib/common/chat-session-summary-agent-prompt.d.ts +8 -0
- package/lib/common/chat-session-summary-agent-prompt.d.ts.map +1 -0
- package/lib/common/chat-session-summary-agent-prompt.js +33 -0
- package/lib/common/chat-session-summary-agent-prompt.js.map +1 -0
- package/lib/common/chat-session-summary-agent.d.ts +16 -0
- package/lib/common/chat-session-summary-agent.d.ts.map +1 -0
- package/lib/common/chat-session-summary-agent.js +48 -0
- package/lib/common/chat-session-summary-agent.js.map +1 -0
- package/lib/common/chat-string-utils.d.ts +3 -0
- package/lib/common/chat-string-utils.d.ts.map +1 -0
- package/lib/common/chat-string-utils.js +27 -0
- package/lib/common/chat-string-utils.js.map +1 -0
- package/lib/common/chat-tool-preferences.d.ts +23 -0
- package/lib/common/chat-tool-preferences.d.ts.map +1 -0
- package/lib/common/chat-tool-preferences.js +68 -0
- package/lib/common/chat-tool-preferences.js.map +1 -0
- package/lib/common/chat-tool-request-service.d.ts +18 -0
- package/lib/common/chat-tool-request-service.d.ts.map +1 -0
- package/lib/common/chat-tool-request-service.js +52 -0
- package/lib/common/chat-tool-request-service.js.map +1 -0
- package/lib/common/context-details-variable.d.ts +9 -0
- package/lib/common/context-details-variable.d.ts.map +1 -0
- package/lib/common/context-details-variable.js +57 -0
- package/lib/common/context-details-variable.js.map +1 -0
- package/lib/common/context-summary-variable.d.ts +9 -0
- package/lib/common/context-summary-variable.d.ts.map +1 -0
- package/lib/common/context-summary-variable.js +57 -0
- package/lib/common/context-summary-variable.js.map +1 -0
- package/lib/common/context-variables.d.ts +4 -0
- package/lib/common/context-variables.d.ts.map +1 -0
- package/lib/common/context-variables.js +22 -0
- package/lib/common/context-variables.js.map +1 -0
- package/lib/common/custom-chat-agent.d.ts +10 -0
- package/lib/common/custom-chat-agent.d.ts.map +1 -0
- package/lib/common/custom-chat-agent.js +40 -0
- package/lib/common/custom-chat-agent.js.map +1 -0
- package/lib/common/image-context-variable.d.ts +29 -0
- package/lib/common/image-context-variable.d.ts.map +1 -0
- package/lib/common/image-context-variable.js +114 -0
- package/lib/common/image-context-variable.js.map +1 -0
- package/lib/common/index.d.ts +13 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +31 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.d.ts +2 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.d.ts.map +1 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.js +103 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.js.map +1 -0
- package/lib/common/parse-contents.d.ts +12 -0
- package/lib/common/parse-contents.d.ts.map +1 -0
- package/lib/common/parse-contents.js +107 -0
- package/lib/common/parse-contents.js.map +1 -0
- package/lib/common/parse-contents.spec.d.ts +10 -0
- package/lib/common/parse-contents.spec.d.ts.map +1 -0
- package/lib/common/parse-contents.spec.js +146 -0
- package/lib/common/parse-contents.spec.js.map +1 -0
- package/lib/common/parsed-chat-request.d.ts +66 -0
- package/lib/common/parsed-chat-request.d.ts.map +1 -0
- package/lib/common/parsed-chat-request.js +83 -0
- package/lib/common/parsed-chat-request.js.map +1 -0
- package/lib/common/response-content-matcher.d.ts +69 -0
- package/lib/common/response-content-matcher.d.ts.map +1 -0
- package/lib/common/response-content-matcher.js +97 -0
- package/lib/common/response-content-matcher.js.map +1 -0
- package/lib/node/ai-chat-backend-module.d.ts +4 -0
- package/lib/node/ai-chat-backend-module.d.ts.map +1 -0
- package/lib/node/ai-chat-backend-module.js +26 -0
- package/lib/node/ai-chat-backend-module.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,166 @@
|
|
|
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.DefaultChatContentDeserializerContribution = exports.ChatContentDeserializerRegistryImpl = exports.ChatContentDeserializerRegistry = exports.ChatContentDeserializerContribution = exports.ChatContentDeserializer = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const chat_model_1 = require("./chat-model");
|
|
22
|
+
const core_1 = require("@theia/core");
|
|
23
|
+
exports.ChatContentDeserializer = Symbol('ChatContentDeserializer');
|
|
24
|
+
exports.ChatContentDeserializerContribution = Symbol('ChatContentDeserializerContribution');
|
|
25
|
+
exports.ChatContentDeserializerRegistry = Symbol('ChatContentDeserializerRegistry');
|
|
26
|
+
/**
|
|
27
|
+
* Default implementation of the chat content deserializer registry.
|
|
28
|
+
*
|
|
29
|
+
* This registry collects deserializers from all bound `ChatContentDeserializerContribution`
|
|
30
|
+
* instances during its post-construction initialization phase. Deserializers are stored
|
|
31
|
+
* in a map keyed by their content kind.
|
|
32
|
+
*
|
|
33
|
+
* The registry handles unknown content types gracefully by returning an
|
|
34
|
+
* `UnknownChatResponseContentImpl` instance when no deserializer is found,
|
|
35
|
+
* ensuring that chat sessions can still be loaded even if some content types
|
|
36
|
+
* are no longer supported or available.
|
|
37
|
+
*
|
|
38
|
+
* @see {@link ChatContentDeserializerRegistry} for the interface definition
|
|
39
|
+
*/
|
|
40
|
+
let ChatContentDeserializerRegistryImpl = class ChatContentDeserializerRegistryImpl {
|
|
41
|
+
constructor() {
|
|
42
|
+
/**
|
|
43
|
+
* Map of registered deserializers, keyed by content kind.
|
|
44
|
+
*/
|
|
45
|
+
this.deserializers = new Map();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the registry by collecting deserializers from all contributions.
|
|
49
|
+
* This method is automatically called after construction due to the `@postConstruct` decorator.
|
|
50
|
+
*/
|
|
51
|
+
initDeserializers() {
|
|
52
|
+
for (const contribution of this.deserializerContributions.getContributions()) {
|
|
53
|
+
contribution.registerDeserializers(this);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
register(deserializer) {
|
|
57
|
+
this.deserializers.set(deserializer.kind, deserializer);
|
|
58
|
+
}
|
|
59
|
+
deserialize(serialized) {
|
|
60
|
+
const deserializer = this.deserializers.get(serialized.kind);
|
|
61
|
+
if (!deserializer) {
|
|
62
|
+
this.logger.warn('No deserializer found for kind:', serialized.kind, 'Available kinds:', Array.from(this.deserializers.keys()));
|
|
63
|
+
return new chat_model_1.UnknownChatResponseContentImpl(serialized.kind, serialized.fallbackMessage, serialized.data);
|
|
64
|
+
}
|
|
65
|
+
return deserializer.deserialize(serialized.data);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.ChatContentDeserializerRegistryImpl = ChatContentDeserializerRegistryImpl;
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, inversify_1.inject)(core_1.ContributionProvider),
|
|
71
|
+
(0, inversify_1.named)(exports.ChatContentDeserializerContribution),
|
|
72
|
+
tslib_1.__metadata("design:type", Object)
|
|
73
|
+
], ChatContentDeserializerRegistryImpl.prototype, "deserializerContributions", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, inversify_1.inject)(core_1.ILogger),
|
|
76
|
+
(0, inversify_1.named)('ChatContentDeserializerRegistry'),
|
|
77
|
+
tslib_1.__metadata("design:type", Object)
|
|
78
|
+
], ChatContentDeserializerRegistryImpl.prototype, "logger", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, inversify_1.postConstruct)(),
|
|
81
|
+
tslib_1.__metadata("design:type", Function),
|
|
82
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
83
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
84
|
+
], ChatContentDeserializerRegistryImpl.prototype, "initDeserializers", null);
|
|
85
|
+
exports.ChatContentDeserializerRegistryImpl = ChatContentDeserializerRegistryImpl = tslib_1.__decorate([
|
|
86
|
+
(0, inversify_1.injectable)()
|
|
87
|
+
], ChatContentDeserializerRegistryImpl);
|
|
88
|
+
/**
|
|
89
|
+
* Default implementation of the chat content deserializer contribution.
|
|
90
|
+
*
|
|
91
|
+
* This contribution registers deserializers for all built-in content types supported
|
|
92
|
+
* by Theia AI.
|
|
93
|
+
*
|
|
94
|
+
* Note that some content types have limitations when deserialized from persistence.
|
|
95
|
+
*
|
|
96
|
+
* @see {@link ChatContentDeserializerContribution} for the contribution interface
|
|
97
|
+
*/
|
|
98
|
+
let DefaultChatContentDeserializerContribution = class DefaultChatContentDeserializerContribution {
|
|
99
|
+
registerDeserializers(registry) {
|
|
100
|
+
registry.register({
|
|
101
|
+
kind: 'text',
|
|
102
|
+
deserialize: (data) => new chat_model_1.TextChatResponseContentImpl(data.content)
|
|
103
|
+
});
|
|
104
|
+
registry.register({
|
|
105
|
+
kind: 'thinking',
|
|
106
|
+
deserialize: (data) => new chat_model_1.ThinkingChatResponseContentImpl(data.content, data.signature)
|
|
107
|
+
});
|
|
108
|
+
registry.register({
|
|
109
|
+
kind: 'markdownContent',
|
|
110
|
+
deserialize: (data) => new chat_model_1.MarkdownChatResponseContentImpl(data.content)
|
|
111
|
+
});
|
|
112
|
+
registry.register({
|
|
113
|
+
kind: 'informational',
|
|
114
|
+
deserialize: (data) => new chat_model_1.InformationalChatResponseContentImpl(data.content)
|
|
115
|
+
});
|
|
116
|
+
registry.register({
|
|
117
|
+
kind: 'code',
|
|
118
|
+
deserialize: (data) => new chat_model_1.CodeChatResponseContentImpl(data.code, data.language, data.location)
|
|
119
|
+
});
|
|
120
|
+
registry.register({
|
|
121
|
+
kind: 'toolCall',
|
|
122
|
+
deserialize: (data) => new chat_model_1.ToolCallChatResponseContentImpl(data.id, data.name, data.arguments, data.finished, data.result)
|
|
123
|
+
});
|
|
124
|
+
registry.register({
|
|
125
|
+
kind: 'command',
|
|
126
|
+
deserialize: (data) => {
|
|
127
|
+
const command = data.commandId ? { id: data.commandId } : undefined;
|
|
128
|
+
// Cannot restore customCallback since it contains a function
|
|
129
|
+
return new chat_model_1.CommandChatResponseContentImpl(command, undefined, data.arguments);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
registry.register({
|
|
133
|
+
kind: 'horizontal',
|
|
134
|
+
deserialize: async (data) => {
|
|
135
|
+
const childContentPromises = data.content.map(child => registry.deserialize(child));
|
|
136
|
+
const childContent = Promise.all(childContentPromises);
|
|
137
|
+
return new chat_model_1.HorizontalLayoutChatResponseContentImpl(await childContent);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
registry.register({
|
|
141
|
+
kind: 'progress',
|
|
142
|
+
deserialize: (data) => new chat_model_1.ProgressChatResponseContentImpl(data.message)
|
|
143
|
+
});
|
|
144
|
+
registry.register({
|
|
145
|
+
kind: 'error',
|
|
146
|
+
deserialize: (data) => {
|
|
147
|
+
const error = new Error(data.message);
|
|
148
|
+
if (data.stack) {
|
|
149
|
+
error.stack = data.stack;
|
|
150
|
+
}
|
|
151
|
+
return new chat_model_1.ErrorChatResponseContentImpl(error);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
registry.register({
|
|
155
|
+
kind: 'question',
|
|
156
|
+
deserialize: (data) =>
|
|
157
|
+
// Restore in read-only mode (no handler/request)
|
|
158
|
+
new chat_model_1.QuestionResponseContentImpl(data.question, data.options, undefined, undefined, data.selectedOption)
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
exports.DefaultChatContentDeserializerContribution = DefaultChatContentDeserializerContribution;
|
|
163
|
+
exports.DefaultChatContentDeserializerContribution = DefaultChatContentDeserializerContribution = tslib_1.__decorate([
|
|
164
|
+
(0, inversify_1.injectable)()
|
|
165
|
+
], DefaultChatContentDeserializerContribution);
|
|
166
|
+
//# sourceMappingURL=chat-content-deserializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-content-deserializer.js","sourceRoot":"","sources":["../../src/common/chat-content-deserializer.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,4DAAwF;AACxF,6CAyBsB;AAEtB,sCAA0E;AAE7D,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAwE5D,QAAA,mCAAmC,GAAG,MAAM,CAAC,qCAAqC,CAAC,CAAC;AA+CpF,QAAA,+BAA+B,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAC;AAEzF;;;;;;;;;;;;;GAaG;AAEI,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAAzC;QACH;;WAEG;QACO,kBAAa,GAAG,IAAI,GAAG,EAAmC,CAAC;IAmCzE,CAAC;IA3BG;;;OAGG;IAEO,iBAAiB;QACvB,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,EAAE,EAAE,CAAC;YAC3E,YAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;IACL,CAAC;IAED,QAAQ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C,OAAO,EACZ,SAAS,EACT,SAAS,EACT,IAAI,CAAC,cAAc,CACtB;SACR,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA5FY,gGAA0C;qDAA1C,0CAA0C;IADtD,IAAA,sBAAU,GAAE;GACA,0CAA0C,CA4FtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-content-deserializer.spec.d.ts","sourceRoot":"","sources":["../../src/common/chat-content-deserializer.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,307 @@
|
|
|
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
|
+
const chai_1 = require("chai");
|
|
19
|
+
const core_1 = require("@theia/core");
|
|
20
|
+
const vscode_languageserver_protocol_1 = require("@theia/core/shared/vscode-languageserver-protocol");
|
|
21
|
+
const chat_content_deserializer_1 = require("./chat-content-deserializer");
|
|
22
|
+
const chat_model_1 = require("./chat-model");
|
|
23
|
+
class MockLogger {
|
|
24
|
+
error() { }
|
|
25
|
+
warn() { }
|
|
26
|
+
info() { }
|
|
27
|
+
debug() { }
|
|
28
|
+
}
|
|
29
|
+
describe('Chat Content Serialization', () => {
|
|
30
|
+
let registry;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
registry = new chat_content_deserializer_1.ChatContentDeserializerRegistryImpl();
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
registry.logger = new MockLogger();
|
|
35
|
+
const contribution = new chat_content_deserializer_1.DefaultChatContentDeserializerContribution();
|
|
36
|
+
contribution.registerDeserializers(registry);
|
|
37
|
+
});
|
|
38
|
+
describe('TextChatResponseContentImpl', () => {
|
|
39
|
+
it('should serialize and deserialize correctly', async () => {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const original = new chat_model_1.TextChatResponseContentImpl('Hello, World!');
|
|
42
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
43
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
44
|
+
(0, chai_1.expect)(serialized.kind).to.equal('text');
|
|
45
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({ content: 'Hello, World!' });
|
|
46
|
+
// Simulate caller populating fallbackMessage
|
|
47
|
+
const withFallback = {
|
|
48
|
+
...serialized,
|
|
49
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
50
|
+
};
|
|
51
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
52
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('text');
|
|
53
|
+
(0, chai_1.expect)((_c = deserialized.asString) === null || _c === void 0 ? void 0 : _c.call(deserialized)).to.equal('Hello, World!');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe('ThinkingChatResponseContentImpl', () => {
|
|
57
|
+
it('should serialize and deserialize correctly', async () => {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
const original = new chat_model_1.ThinkingChatResponseContentImpl('Thinking...', 'sig123');
|
|
60
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
61
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
62
|
+
(0, chai_1.expect)(serialized.kind).to.equal('thinking');
|
|
63
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({
|
|
64
|
+
content: 'Thinking...',
|
|
65
|
+
signature: 'sig123'
|
|
66
|
+
});
|
|
67
|
+
// Simulate caller populating fallbackMessage
|
|
68
|
+
const withFallback = {
|
|
69
|
+
...serialized,
|
|
70
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
71
|
+
};
|
|
72
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
73
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('thinking');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('MarkdownChatResponseContentImpl', () => {
|
|
77
|
+
it('should serialize and deserialize correctly', async () => {
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
const original = new chat_model_1.MarkdownChatResponseContentImpl('# Title\n\nContent');
|
|
80
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
81
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
82
|
+
(0, chai_1.expect)(serialized.kind).to.equal('markdownContent');
|
|
83
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({ content: '# Title\n\nContent' });
|
|
84
|
+
// Simulate caller populating fallbackMessage
|
|
85
|
+
const withFallback = {
|
|
86
|
+
...serialized,
|
|
87
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
88
|
+
};
|
|
89
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
90
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('markdownContent');
|
|
91
|
+
(0, chai_1.expect)((_c = deserialized.asString) === null || _c === void 0 ? void 0 : _c.call(deserialized)).to.equal('# Title\n\nContent');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
describe('InformationalChatResponseContentImpl', () => {
|
|
95
|
+
it('should serialize and deserialize correctly', async () => {
|
|
96
|
+
var _a, _b;
|
|
97
|
+
const original = new chat_model_1.InformationalChatResponseContentImpl('Info message');
|
|
98
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
99
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
100
|
+
(0, chai_1.expect)(serialized.kind).to.equal('informational');
|
|
101
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({ content: 'Info message' });
|
|
102
|
+
// Simulate caller populating fallbackMessage
|
|
103
|
+
const withFallback = {
|
|
104
|
+
...serialized,
|
|
105
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
106
|
+
};
|
|
107
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
108
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('informational');
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
describe('CodeChatResponseContentImpl', () => {
|
|
112
|
+
it('should serialize and deserialize code without location', async () => {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
const original = new chat_model_1.CodeChatResponseContentImpl('console.log("test")', 'typescript');
|
|
115
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
116
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
117
|
+
(0, chai_1.expect)(serialized.kind).to.equal('code');
|
|
118
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({
|
|
119
|
+
code: 'console.log("test")',
|
|
120
|
+
language: 'typescript',
|
|
121
|
+
location: undefined
|
|
122
|
+
});
|
|
123
|
+
// Simulate caller populating fallbackMessage
|
|
124
|
+
const withFallback = {
|
|
125
|
+
...serialized,
|
|
126
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
127
|
+
};
|
|
128
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
129
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('code');
|
|
130
|
+
});
|
|
131
|
+
it('should serialize and deserialize code with location', async () => {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
const location = {
|
|
134
|
+
uri: new core_1.URI('file:///test.ts'),
|
|
135
|
+
position: vscode_languageserver_protocol_1.Position.create(1, 0)
|
|
136
|
+
};
|
|
137
|
+
const original = new chat_model_1.CodeChatResponseContentImpl('code', 'typescript', location);
|
|
138
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
139
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
140
|
+
(0, chai_1.expect)(serialized.kind).to.equal('code');
|
|
141
|
+
// Simulate caller populating fallbackMessage
|
|
142
|
+
const withFallback = {
|
|
143
|
+
...serialized,
|
|
144
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
145
|
+
};
|
|
146
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
147
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('code');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
describe('ToolCallChatResponseContentImpl', () => {
|
|
151
|
+
it('should serialize and deserialize correctly', async () => {
|
|
152
|
+
var _a, _b;
|
|
153
|
+
const original = new chat_model_1.ToolCallChatResponseContentImpl('id123', 'toolName', '{"arg": "value"}', true, 'result');
|
|
154
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
155
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
156
|
+
(0, chai_1.expect)(serialized.kind).to.equal('toolCall');
|
|
157
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({
|
|
158
|
+
id: 'id123',
|
|
159
|
+
name: 'toolName',
|
|
160
|
+
arguments: '{"arg": "value"}',
|
|
161
|
+
finished: true,
|
|
162
|
+
result: 'result'
|
|
163
|
+
});
|
|
164
|
+
// Simulate caller populating fallbackMessage
|
|
165
|
+
const withFallback = {
|
|
166
|
+
...serialized,
|
|
167
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
168
|
+
};
|
|
169
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
170
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('toolCall');
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
describe('ErrorChatResponseContentImpl', () => {
|
|
174
|
+
it('should serialize and deserialize correctly', async () => {
|
|
175
|
+
var _a, _b;
|
|
176
|
+
const error = new Error('Test error');
|
|
177
|
+
const original = new chat_model_1.ErrorChatResponseContentImpl(error);
|
|
178
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
179
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
180
|
+
(0, chai_1.expect)(serialized.kind).to.equal('error');
|
|
181
|
+
(0, chai_1.expect)(serialized.data).to.have.property('message', 'Test error');
|
|
182
|
+
// Simulate caller populating fallbackMessage
|
|
183
|
+
const withFallback = {
|
|
184
|
+
...serialized,
|
|
185
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
186
|
+
};
|
|
187
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
188
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('error');
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
describe('ProgressChatResponseContentImpl', () => {
|
|
192
|
+
it('should serialize and deserialize correctly', async () => {
|
|
193
|
+
var _a, _b;
|
|
194
|
+
const original = new chat_model_1.ProgressChatResponseContentImpl('Processing...');
|
|
195
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
196
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
197
|
+
(0, chai_1.expect)(serialized.kind).to.equal('progress');
|
|
198
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({ message: 'Processing...' });
|
|
199
|
+
// Simulate caller populating fallbackMessage
|
|
200
|
+
const withFallback = {
|
|
201
|
+
...serialized,
|
|
202
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
203
|
+
};
|
|
204
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
205
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('progress');
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
describe('HorizontalLayoutChatResponseContentImpl', () => {
|
|
209
|
+
it('should serialize and deserialize nested content', async () => {
|
|
210
|
+
var _a, _b;
|
|
211
|
+
const child1 = new chat_model_1.TextChatResponseContentImpl('Text 1');
|
|
212
|
+
const child2 = new chat_model_1.TextChatResponseContentImpl('Text 2');
|
|
213
|
+
const original = new chat_model_1.HorizontalLayoutChatResponseContentImpl([child1, child2]);
|
|
214
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
215
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
216
|
+
(0, chai_1.expect)(serialized.kind).to.equal('horizontal');
|
|
217
|
+
(0, chai_1.expect)(serialized.data).to.have.property('content');
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
219
|
+
(0, chai_1.expect)(serialized.data.content).to.be.an('array').with.length(2);
|
|
220
|
+
// Simulate caller populating fallbackMessage
|
|
221
|
+
const withFallback = {
|
|
222
|
+
...serialized,
|
|
223
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
224
|
+
};
|
|
225
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
226
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('horizontal');
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
describe('QuestionResponseContentImpl', () => {
|
|
230
|
+
it('should serialize and deserialize question with selected option', async () => {
|
|
231
|
+
var _a, _b, _c, _d;
|
|
232
|
+
const options = [
|
|
233
|
+
{ text: 'Blue' },
|
|
234
|
+
{ text: 'Green' },
|
|
235
|
+
{ text: 'Lavender' }
|
|
236
|
+
];
|
|
237
|
+
const original = new chat_model_1.QuestionResponseContentImpl('Which color do you find most calming?', options, undefined, // request
|
|
238
|
+
undefined, // handler
|
|
239
|
+
{ text: 'Blue' } // selectedOption
|
|
240
|
+
);
|
|
241
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
242
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
243
|
+
(0, chai_1.expect)(serialized.kind).to.equal('question');
|
|
244
|
+
(0, chai_1.expect)(serialized.data).to.deep.equal({
|
|
245
|
+
question: 'Which color do you find most calming?',
|
|
246
|
+
options: options,
|
|
247
|
+
selectedOption: { text: 'Blue' }
|
|
248
|
+
});
|
|
249
|
+
// Simulate caller populating fallbackMessage
|
|
250
|
+
const withFallback = {
|
|
251
|
+
...serialized,
|
|
252
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
253
|
+
};
|
|
254
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
255
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('question');
|
|
256
|
+
(0, chai_1.expect)((_c = deserialized.asString) === null || _c === void 0 ? void 0 : _c.call(deserialized)).to.include('Question: Which color do you find most calming?');
|
|
257
|
+
(0, chai_1.expect)((_d = deserialized.asString) === null || _d === void 0 ? void 0 : _d.call(deserialized)).to.include('Answer: Blue');
|
|
258
|
+
});
|
|
259
|
+
it('should serialize and deserialize question without selected option', async () => {
|
|
260
|
+
var _a, _b, _c, _d;
|
|
261
|
+
const options = [
|
|
262
|
+
{ text: 'Option 1' },
|
|
263
|
+
{ text: 'Option 2' }
|
|
264
|
+
];
|
|
265
|
+
const original = new chat_model_1.QuestionResponseContentImpl('What is your choice?', options, undefined, // request
|
|
266
|
+
undefined // handler
|
|
267
|
+
// no selectedOption
|
|
268
|
+
);
|
|
269
|
+
const serialized = (_a = original.toSerializable) === null || _a === void 0 ? void 0 : _a.call(original);
|
|
270
|
+
(0, chai_1.expect)(serialized).to.not.be.undefined;
|
|
271
|
+
(0, chai_1.expect)(serialized.kind).to.equal('question');
|
|
272
|
+
// Simulate caller populating fallbackMessage
|
|
273
|
+
const withFallback = {
|
|
274
|
+
...serialized,
|
|
275
|
+
fallbackMessage: ((_b = original.asString) === null || _b === void 0 ? void 0 : _b.call(original)) || original.toString()
|
|
276
|
+
};
|
|
277
|
+
const deserialized = await registry.deserialize(withFallback);
|
|
278
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('question');
|
|
279
|
+
(0, chai_1.expect)((_c = deserialized.asString) === null || _c === void 0 ? void 0 : _c.call(deserialized)).to.include('Question: What is your choice?');
|
|
280
|
+
(0, chai_1.expect)((_d = deserialized.asString) === null || _d === void 0 ? void 0 : _d.call(deserialized)).to.include('No answer');
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
describe('ChatContentDeserializerRegistry', () => {
|
|
284
|
+
it('should handle unknown content types with fallback', async () => {
|
|
285
|
+
var _a;
|
|
286
|
+
const unknownContent = {
|
|
287
|
+
kind: 'unknown-type',
|
|
288
|
+
fallbackMessage: 'Fallback text',
|
|
289
|
+
data: { some: 'data' }
|
|
290
|
+
};
|
|
291
|
+
const deserialized = await registry.deserialize(unknownContent);
|
|
292
|
+
(0, chai_1.expect)(deserialized.kind).to.equal('unknown');
|
|
293
|
+
(0, chai_1.expect)((_a = deserialized.asString) === null || _a === void 0 ? void 0 : _a.call(deserialized)).to.equal('Fallback text');
|
|
294
|
+
});
|
|
295
|
+
it('should use fallback message when deserializer not found', async () => {
|
|
296
|
+
var _a;
|
|
297
|
+
const unknownContent = {
|
|
298
|
+
kind: 'custom-extension-type',
|
|
299
|
+
fallbackMessage: 'Custom content not available',
|
|
300
|
+
data: undefined
|
|
301
|
+
};
|
|
302
|
+
const deserialized = await registry.deserialize(unknownContent);
|
|
303
|
+
(0, chai_1.expect)((_a = deserialized.asString) === null || _a === void 0 ? void 0 : _a.call(deserialized)).to.equal('Custom content not available');
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
//# sourceMappingURL=chat-content-deserializer.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-content-deserializer.spec.js","sourceRoot":"","sources":["../../src/common/chat-content-deserializer.spec.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,+BAA8B;AAC9B,sCAAkC;AAClC,sGAA6E;AAE7E,2EAGqC;AACrC,6CAWsB;AAEtB,MAAM,UAAU;IACZ,KAAK,KAAW,CAAC;IACjB,IAAI,KAAW,CAAC;IAChB,IAAI,KAAW,CAAC;IAChB,KAAK,KAAW,CAAC;CACpB;AAED,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAExC,IAAI,QAA6C,CAAC;IAElD,UAAU,CAAC,GAAG,EAAE;QACZ,QAAQ,GAAG,IAAI,+DAAmC,EAAE,CAAC;QACrD,8DAA8D;QAC7D,QAAgB,CAAC,MAAM,GAAG,IAAI,UAAU,EAAwB,CAAC;QAClE,MAAM,YAAY,GAAG,IAAI,sEAA0C,EAAE,CAAC;QACtE,YAAY,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;;YACxD,MAAM,QAAQ,GAAG,IAAI,wCAA2B,CAAC,eA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
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ChatAgentLocation } from './chat-agents';
|
|
2
|
+
export interface SerializableChangeSetElement {
|
|
3
|
+
kind?: string;
|
|
4
|
+
uri: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
additionalInfo?: string;
|
|
8
|
+
state?: 'pending' | 'applied' | 'stale';
|
|
9
|
+
type?: 'add' | 'modify' | 'delete';
|
|
10
|
+
data?: {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface SerializableChangeSetFileElementData {
|
|
15
|
+
targetState?: string;
|
|
16
|
+
originalState?: string;
|
|
17
|
+
replacements?: Array<{
|
|
18
|
+
oldContent: string;
|
|
19
|
+
newContent: string;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export interface SerializableChatRequestData {
|
|
24
|
+
id: string;
|
|
25
|
+
text: string;
|
|
26
|
+
agentId?: string;
|
|
27
|
+
changeSet?: {
|
|
28
|
+
title: string;
|
|
29
|
+
elements: SerializableChangeSetElement[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface SerializableChatResponseContentData<T = unknown> {
|
|
33
|
+
kind: string;
|
|
34
|
+
/**
|
|
35
|
+
* Fallback message used when the deserializer for this content type is not available.
|
|
36
|
+
*/
|
|
37
|
+
fallbackMessage?: string;
|
|
38
|
+
data: T;
|
|
39
|
+
}
|
|
40
|
+
export interface SerializableChatResponseData {
|
|
41
|
+
id: string;
|
|
42
|
+
requestId: string;
|
|
43
|
+
isComplete: boolean;
|
|
44
|
+
isError: boolean;
|
|
45
|
+
errorMessage?: string;
|
|
46
|
+
content: SerializableChatResponseContentData[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Serialized representation of an item in a hierarchy branch.
|
|
50
|
+
* Each item represents a request and optionally links to the next branch.
|
|
51
|
+
*/
|
|
52
|
+
export interface SerializableHierarchyBranchItem {
|
|
53
|
+
requestId: string;
|
|
54
|
+
nextBranchId?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Serialized representation of a branch in the chat request hierarchy.
|
|
58
|
+
* A branch contains alternative requests (created by editing messages).
|
|
59
|
+
*/
|
|
60
|
+
export interface SerializableHierarchyBranch {
|
|
61
|
+
/** Unique identifier for this branch */
|
|
62
|
+
id: string;
|
|
63
|
+
/** All items (alternative requests) in this branch */
|
|
64
|
+
items: SerializableHierarchyBranchItem[];
|
|
65
|
+
/** Index of the currently active item in this branch */
|
|
66
|
+
activeBranchIndex: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Serialized representation of the complete chat request hierarchy.
|
|
70
|
+
* The hierarchy is stored as a flat map of branches.
|
|
71
|
+
*/
|
|
72
|
+
export interface SerializableHierarchy {
|
|
73
|
+
/** ID of the root branch where the hierarchy starts */
|
|
74
|
+
rootBranchId: string;
|
|
75
|
+
/** Map of branch ID to branch data for all branches in the hierarchy */
|
|
76
|
+
branches: {
|
|
77
|
+
[branchId: string]: SerializableHierarchyBranch;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Serialized representation of ChatModel.
|
|
82
|
+
*/
|
|
83
|
+
export interface SerializedChatModel {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
location: ChatAgentLocation;
|
|
86
|
+
/**
|
|
87
|
+
* The complete hierarchy of requests including all alternatives (branches).
|
|
88
|
+
*/
|
|
89
|
+
hierarchy: SerializableHierarchy;
|
|
90
|
+
/** All requests referenced by the hierarchy */
|
|
91
|
+
requests: SerializableChatRequestData[];
|
|
92
|
+
/** All responses for the requests */
|
|
93
|
+
responses: SerializableChatResponseData[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Wrapper for persisted chat model data.
|
|
97
|
+
* Includes metadata (version, pinned agent, title) along with the chat model.
|
|
98
|
+
*/
|
|
99
|
+
export interface SerializedChatData {
|
|
100
|
+
version: number;
|
|
101
|
+
pinnedAgentId?: string;
|
|
102
|
+
title?: string;
|
|
103
|
+
model: SerializedChatModel;
|
|
104
|
+
saveDate: number;
|
|
105
|
+
}
|
|
106
|
+
export interface SerializableChatsData {
|
|
107
|
+
[sessionId: string]: SerializedChatData;
|
|
108
|
+
}
|
|
109
|
+
export declare const CHAT_DATA_VERSION = 1;
|
|
110
|
+
//# sourceMappingURL=chat-model-serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-model-serialization.d.ts","sourceRoot":"","sources":["../../src/common/chat-model-serialization.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,WAAW,4BAA4B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnC,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACrC;AAED,MAAM,WAAW,oCAAoC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,KAAK,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC,CAAC;CACN;AAED,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CA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AAE,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IAClC,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAAC;CAC3C;AAED,eAAO,MAAM,iBAAiB,IAAI,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.CHAT_DATA_VERSION = void 0;
|
|
19
|
+
exports.CHAT_DATA_VERSION = 1;
|
|
20
|
+
//# sourceMappingURL=chat-model-serialization.js.map
|