n8n 1.116.2 → 1.117.1
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/dist/active-executions.d.ts +3 -1
- package/dist/active-executions.js +7 -8
- package/dist/active-executions.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/base-command.js +1 -5
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/execute-batch.js +2 -3
- package/dist/commands/execute-batch.js.map +1 -1
- package/dist/commands/execute.js +2 -6
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/start.js +5 -5
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/webhook.js +4 -8
- package/dist/commands/webhook.js.map +1 -1
- package/dist/commands/worker.js +5 -9
- package/dist/commands/worker.js.map +1 -1
- package/dist/concurrency/concurrency-control.service.js +1 -2
- package/dist/concurrency/concurrency-control.service.js.map +1 -1
- package/dist/config/index.d.ts +0 -3
- package/dist/config/schema.d.ts +0 -8
- package/dist/config/schema.js +0 -8
- package/dist/config/schema.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +2 -1
- package/dist/controllers/ai.controller.js +19 -0
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.d.ts +3 -1
- package/dist/controllers/e2e.controller.js +7 -5
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +1 -1
- package/dist/controllers/users.controller.js +1 -1
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/deprecation/deprecation.service.js +1 -5
- package/dist/deprecation/deprecation.service.js.map +1 -1
- package/dist/environments.ee/source-control/source-control-export.service.ee.d.ts +1 -1
- package/dist/environments.ee/source-control/source-control-export.service.ee.js +2 -2
- package/dist/environments.ee/source-control/source-control-export.service.ee.js.map +1 -1
- package/dist/environments.ee/source-control/source-control-helper.ee.d.ts +2 -0
- package/dist/environments.ee/source-control/source-control-helper.ee.js +11 -2
- package/dist/environments.ee/source-control/source-control-helper.ee.js.map +1 -1
- package/dist/environments.ee/source-control/source-control-import.service.ee.d.ts +6 -4
- package/dist/environments.ee/source-control/source-control-import.service.ee.js +63 -51
- package/dist/environments.ee/source-control/source-control-import.service.ee.js.map +1 -1
- package/dist/environments.ee/source-control/source-control-status.service.ee.js +28 -3
- package/dist/environments.ee/source-control/source-control-status.service.ee.js.map +1 -1
- package/dist/environments.ee/variables/variables.service.ee.js +6 -1
- package/dist/environments.ee/variables/variables.service.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +3 -1
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +7 -5
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/eventbus/message-event-bus/message-event-bus.js +1 -2
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.js +1 -0
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +18 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +1 -0
- package/dist/events/relays/telemetry.event-relay.js +12 -4
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/executions/execution.service.js +2 -6
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/license.js +1 -5
- package/dist/license.js.map +1 -1
- package/dist/metrics/prometheus-metrics.service.js +1 -2
- package/dist/metrics/prometheus-metrics.service.js.map +1 -1
- package/dist/middlewares/list-query/dtos/workflow.select.dto.js +1 -0
- package/dist/middlewares/list-query/dtos/workflow.select.dto.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-message.entity.d.ts +28 -0
- package/dist/modules/chat-hub/chat-hub-message.entity.js +124 -0
- package/dist/modules/chat-hub/chat-hub-message.entity.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-session.entity.d.ts +17 -0
- package/dist/modules/chat-hub/chat-hub-session.entity.js +72 -0
- package/dist/modules/chat-hub/chat-hub-session.entity.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub.controller.d.ts +8 -5
- package/dist/modules/chat-hub/chat-hub.controller.js +151 -22
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub.module.js +6 -1
- package/dist/modules/chat-hub/chat-hub.module.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.service.d.ts +34 -13
- package/dist/modules/chat-hub/chat-hub.service.js +500 -315
- package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +25 -11
- package/dist/modules/chat-hub/chat-message.repository.d.ts +16 -0
- package/dist/modules/chat-hub/chat-message.repository.js +60 -0
- package/dist/modules/chat-hub/chat-message.repository.js.map +1 -0
- package/dist/modules/chat-hub/chat-session.repository.d.ts +12 -0
- package/dist/modules/chat-hub/chat-session.repository.js +77 -0
- package/dist/modules/chat-hub/chat-session.repository.js.map +1 -0
- package/dist/modules/chat-hub/context-limits.d.ts +3 -0
- package/dist/modules/chat-hub/context-limits.js +142 -0
- package/dist/modules/chat-hub/context-limits.js.map +1 -0
- package/dist/modules/community-packages/community-node-types.controller.js +2 -2
- package/dist/modules/community-packages/community-node-types.controller.js.map +1 -1
- package/dist/modules/mcp/mcp-api-key.service.d.ts +4 -1
- package/dist/modules/mcp/mcp-api-key.service.js +23 -8
- package/dist/modules/mcp/mcp-api-key.service.js.map +1 -1
- package/dist/modules/mcp/mcp.constants.d.ts +5 -0
- package/dist/modules/mcp/mcp.constants.js +9 -0
- package/dist/modules/mcp/mcp.constants.js.map +1 -0
- package/dist/modules/mcp/mcp.controller.d.ts +4 -1
- package/dist/modules/mcp/mcp.controller.js +56 -4
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.event-relay.d.ts +11 -0
- package/dist/modules/mcp/mcp.event-relay.js +61 -0
- package/dist/modules/mcp/mcp.event-relay.js.map +1 -0
- package/dist/modules/mcp/mcp.module.js +2 -0
- package/dist/modules/mcp/mcp.module.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.controller.js +1 -1
- package/dist/modules/mcp/mcp.settings.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.typeguards.d.ts +3 -0
- package/dist/modules/mcp/mcp.typeguards.js +19 -1
- package/dist/modules/mcp/mcp.typeguards.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +24 -0
- package/dist/modules/mcp/mcp.utils.d.ts +8 -0
- package/dist/modules/mcp/mcp.utils.js +37 -0
- package/dist/modules/mcp/mcp.utils.js.map +1 -0
- package/dist/modules/provisioning.ee/constants.d.ts +1 -0
- package/dist/modules/provisioning.ee/constants.js +5 -0
- package/dist/modules/provisioning.ee/constants.js.map +1 -0
- package/dist/modules/provisioning.ee/provisioning.controller.ee.d.ts +10 -0
- package/dist/modules/provisioning.ee/provisioning.controller.ee.js +41 -0
- package/dist/modules/provisioning.ee/provisioning.controller.ee.js.map +1 -0
- package/dist/modules/provisioning.ee/provisioning.module.d.ts +4 -0
- package/dist/modules/provisioning.ee/provisioning.module.js +53 -0
- package/dist/modules/provisioning.ee/provisioning.module.js.map +1 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +15 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +67 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -0
- package/dist/posthog/index.js +0 -4
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +12 -0
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/scaling/pubsub/publisher.service.d.ts +3 -1
- package/dist/scaling/pubsub/publisher.service.js +7 -8
- package/dist/scaling/pubsub/publisher.service.js.map +1 -1
- package/dist/scaling/pubsub/subscriber.service.d.ts +3 -1
- package/dist/scaling/pubsub/subscriber.service.js +6 -4
- package/dist/scaling/pubsub/subscriber.service.js.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/services/ai-workflow-builder.service.d.ts +3 -0
- package/dist/services/ai-workflow-builder.service.js +6 -0
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/cache/cache.service.js +1 -5
- package/dist/services/cache/cache.service.js.map +1 -1
- package/dist/services/frontend.service.js +12 -3
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/role.service.js +15 -3
- package/dist/services/role.service.js.map +1 -1
- package/dist/services/user.service.d.ts +3 -1
- package/dist/services/user.service.js +14 -5
- package/dist/services/user.service.js.map +1 -1
- package/dist/sso.ee/oidc/oidc.service.ee.js +6 -1
- package/dist/sso.ee/oidc/oidc.service.ee.js.map +1 -1
- package/dist/workflow-runner.d.ts +0 -2
- package/dist/workflow-runner.js +4 -9
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-execution.service.js +1 -5
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +24 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +16 -16
|
@@ -19,6 +19,12 @@ const decorators_1 = require("@n8n/decorators");
|
|
|
19
19
|
const node_assert_1 = require("node:assert");
|
|
20
20
|
const chat_hub_service_1 = require("./chat-hub.service");
|
|
21
21
|
const chat_models_request_dto_1 = require("./dto/chat-models-request.dto");
|
|
22
|
+
const JSONL_STREAM_HEADERS = {
|
|
23
|
+
'Content-Type': 'application/json-lines; charset=utf-8',
|
|
24
|
+
'Transfer-Encoding': 'chunked',
|
|
25
|
+
'Cache-Control': 'no-cache',
|
|
26
|
+
Connection: 'keep-alive',
|
|
27
|
+
};
|
|
22
28
|
let ChatHubController = class ChatHubController {
|
|
23
29
|
constructor(chatService, logger) {
|
|
24
30
|
this.chatService = chatService;
|
|
@@ -27,35 +33,101 @@ let ChatHubController = class ChatHubController {
|
|
|
27
33
|
async getModels(req, _res, payload) {
|
|
28
34
|
return await this.chatService.getModels(req.user, payload.credentials);
|
|
29
35
|
}
|
|
36
|
+
async getConversations(req, _res) {
|
|
37
|
+
return await this.chatService.getConversations(req.user.id);
|
|
38
|
+
}
|
|
39
|
+
async getConversationMessages(req, _res, sessionId) {
|
|
40
|
+
return await this.chatService.getConversation(req.user.id, sessionId);
|
|
41
|
+
}
|
|
30
42
|
async sendMessage(req, res, payload) {
|
|
31
|
-
res.
|
|
32
|
-
res.
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
res.writeHead(200, JSONL_STREAM_HEADERS);
|
|
44
|
+
res.flushHeaders();
|
|
45
|
+
this.logger.debug(`Chat send request received: ${JSON.stringify(payload)}`);
|
|
46
|
+
try {
|
|
47
|
+
await this.chatService.sendHumanMessage(res, req.user, {
|
|
48
|
+
...payload,
|
|
49
|
+
userId: req.user.id,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch (executionError) {
|
|
53
|
+
(0, node_assert_1.strict)(executionError instanceof Error);
|
|
54
|
+
this.logger.error(`Error in chat send endpoint: ${executionError}`);
|
|
55
|
+
if (!res.headersSent) {
|
|
56
|
+
res.status(500).json({
|
|
57
|
+
code: 500,
|
|
58
|
+
message: executionError.message,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else if (!res.writableEnded) {
|
|
62
|
+
res.write(JSON.stringify({
|
|
63
|
+
type: 'error',
|
|
64
|
+
content: executionError.message,
|
|
65
|
+
}) + '\n');
|
|
66
|
+
res.flush();
|
|
67
|
+
}
|
|
68
|
+
if (!res.writableEnded)
|
|
69
|
+
res.end();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async editMessage(req, res, sessionId, editId, payload) {
|
|
73
|
+
res.writeHead(200, JSONL_STREAM_HEADERS);
|
|
74
|
+
res.flushHeaders();
|
|
75
|
+
this.logger.debug(`Chat edit request received: ${JSON.stringify(payload)}`);
|
|
76
|
+
try {
|
|
77
|
+
await this.chatService.editHumanMessage(res, req.user, {
|
|
78
|
+
...payload,
|
|
79
|
+
sessionId,
|
|
80
|
+
editId,
|
|
81
|
+
userId: req.user.id,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch (executionError) {
|
|
85
|
+
(0, node_assert_1.strict)(executionError instanceof Error);
|
|
86
|
+
this.logger.error(`Error in chat edit endpoint: ${executionError}`);
|
|
87
|
+
if (!res.headersSent) {
|
|
88
|
+
res.status(500).json({
|
|
89
|
+
code: 500,
|
|
90
|
+
message: executionError.message,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else if (!res.writableEnded) {
|
|
94
|
+
res.write(JSON.stringify({
|
|
95
|
+
type: 'error',
|
|
96
|
+
content: executionError.message,
|
|
97
|
+
id: payload.replyId,
|
|
98
|
+
}) + '\n');
|
|
99
|
+
res.flush();
|
|
100
|
+
}
|
|
101
|
+
if (!res.writableEnded)
|
|
102
|
+
res.end();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async regenerateMessage(req, res, sessionId, retryId, payload) {
|
|
106
|
+
res.writeHead(200, JSONL_STREAM_HEADERS);
|
|
35
107
|
res.flushHeaders();
|
|
36
|
-
|
|
37
|
-
this.logger.info(`Chat send request received: ${JSON.stringify(payload)}`);
|
|
108
|
+
this.logger.debug(`Chat retry request received: ${JSON.stringify(payload)}`);
|
|
38
109
|
try {
|
|
39
|
-
await this.chatService.
|
|
110
|
+
await this.chatService.regenerateAIMessage(res, req.user, {
|
|
40
111
|
...payload,
|
|
112
|
+
sessionId,
|
|
113
|
+
retryId,
|
|
41
114
|
userId: req.user.id,
|
|
42
|
-
replyId,
|
|
43
115
|
});
|
|
44
116
|
}
|
|
45
117
|
catch (executionError) {
|
|
46
118
|
(0, node_assert_1.strict)(executionError instanceof Error);
|
|
47
|
-
this.logger.error(
|
|
119
|
+
this.logger.error(`Error in chat retry endpoint: ${executionError}`);
|
|
48
120
|
if (!res.headersSent) {
|
|
49
121
|
res.status(500).json({
|
|
50
122
|
code: 500,
|
|
51
123
|
message: executionError.message,
|
|
52
124
|
});
|
|
53
125
|
}
|
|
54
|
-
else {
|
|
126
|
+
else if (!res.writableEnded) {
|
|
55
127
|
res.write(JSON.stringify({
|
|
56
128
|
type: 'error',
|
|
57
129
|
content: executionError.message,
|
|
58
|
-
id: replyId,
|
|
130
|
+
id: payload.replyId,
|
|
59
131
|
}) + '\n');
|
|
60
132
|
res.flush();
|
|
61
133
|
}
|
|
@@ -63,41 +135,98 @@ let ChatHubController = class ChatHubController {
|
|
|
63
135
|
res.end();
|
|
64
136
|
}
|
|
65
137
|
}
|
|
66
|
-
async
|
|
67
|
-
|
|
138
|
+
async stopGeneration(req, res, sessionId, messageId) {
|
|
139
|
+
this.logger.debug(`Chat stop request received: ${JSON.stringify({ sessionId, messageId })}`);
|
|
140
|
+
await this.chatService.stopGeneration(req.user, sessionId, messageId);
|
|
141
|
+
res.status(204).send();
|
|
68
142
|
}
|
|
69
|
-
async
|
|
70
|
-
|
|
143
|
+
async updateConversationTitle(req, _res, sessionId, payload) {
|
|
144
|
+
await this.chatService.updateSessionTitle(req.user.id, sessionId, payload.title);
|
|
145
|
+
return await this.chatService.getConversation(req.user.id, sessionId);
|
|
146
|
+
}
|
|
147
|
+
async deleteConversation(req, res, sessionId) {
|
|
148
|
+
await this.chatService.deleteSession(req.user.id, sessionId);
|
|
149
|
+
res.status(204).send();
|
|
71
150
|
}
|
|
72
151
|
};
|
|
73
152
|
exports.ChatHubController = ChatHubController;
|
|
74
153
|
__decorate([
|
|
75
154
|
(0, decorators_1.Post)('/models'),
|
|
155
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
76
156
|
__param(2, decorators_1.Body),
|
|
77
157
|
__metadata("design:type", Function),
|
|
78
158
|
__metadata("design:paramtypes", [Object, Object, chat_models_request_dto_1.ChatModelsRequestDto]),
|
|
79
159
|
__metadata("design:returntype", Promise)
|
|
80
160
|
], ChatHubController.prototype, "getModels", null);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, decorators_1.Get)('/conversations'),
|
|
163
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
166
|
+
__metadata("design:returntype", Promise)
|
|
167
|
+
], ChatHubController.prototype, "getConversations", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, decorators_1.Get)('/conversations/:sessionId'),
|
|
170
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
171
|
+
__param(2, (0, decorators_1.Param)('sessionId')),
|
|
172
|
+
__metadata("design:type", Function),
|
|
173
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
174
|
+
__metadata("design:returntype", Promise)
|
|
175
|
+
], ChatHubController.prototype, "getConversationMessages", null);
|
|
81
176
|
__decorate([
|
|
82
177
|
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
83
|
-
(0, decorators_1.Post)('/send'),
|
|
178
|
+
(0, decorators_1.Post)('/conversations/send'),
|
|
84
179
|
__param(2, decorators_1.Body),
|
|
85
180
|
__metadata("design:type", Function),
|
|
86
181
|
__metadata("design:paramtypes", [Object, Object, api_types_1.ChatHubSendMessageRequest]),
|
|
87
182
|
__metadata("design:returntype", Promise)
|
|
88
183
|
], ChatHubController.prototype, "sendMessage", null);
|
|
89
184
|
__decorate([
|
|
90
|
-
(0, decorators_1.
|
|
185
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
186
|
+
(0, decorators_1.Post)('/conversations/:sessionId/messages/:messageId/edit'),
|
|
187
|
+
__param(2, (0, decorators_1.Param)('sessionId')),
|
|
188
|
+
__param(3, (0, decorators_1.Param)('messageId')),
|
|
189
|
+
__param(4, decorators_1.Body),
|
|
91
190
|
__metadata("design:type", Function),
|
|
92
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
191
|
+
__metadata("design:paramtypes", [Object, Object, String, String, api_types_1.ChatHubEditMessageRequest]),
|
|
93
192
|
__metadata("design:returntype", Promise)
|
|
94
|
-
], ChatHubController.prototype, "
|
|
193
|
+
], ChatHubController.prototype, "editMessage", null);
|
|
95
194
|
__decorate([
|
|
96
|
-
(0, decorators_1.
|
|
195
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
196
|
+
(0, decorators_1.Post)('/conversations/:sessionId/messages/:messageId/regenerate'),
|
|
197
|
+
__param(2, (0, decorators_1.Param)('sessionId')),
|
|
198
|
+
__param(3, (0, decorators_1.Param)('messageId')),
|
|
199
|
+
__param(4, decorators_1.Body),
|
|
97
200
|
__metadata("design:type", Function),
|
|
98
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
201
|
+
__metadata("design:paramtypes", [Object, Object, String, String, api_types_1.ChatHubRegenerateMessageRequest]),
|
|
99
202
|
__metadata("design:returntype", Promise)
|
|
100
|
-
], ChatHubController.prototype, "
|
|
203
|
+
], ChatHubController.prototype, "regenerateMessage", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
206
|
+
(0, decorators_1.Post)('/conversations/:sessionId/messages/:messageId/stop'),
|
|
207
|
+
__param(2, (0, decorators_1.Param)('sessionId')),
|
|
208
|
+
__param(3, (0, decorators_1.Param)('messageId')),
|
|
209
|
+
__metadata("design:type", Function),
|
|
210
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
211
|
+
__metadata("design:returntype", Promise)
|
|
212
|
+
], ChatHubController.prototype, "stopGeneration", null);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, decorators_1.Post)('/conversations/:sessionId/rename'),
|
|
215
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
216
|
+
__param(2, (0, decorators_1.Param)('sessionId')),
|
|
217
|
+
__param(3, decorators_1.Body),
|
|
218
|
+
__metadata("design:type", Function),
|
|
219
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.ChatHubChangeConversationTitleRequest]),
|
|
220
|
+
__metadata("design:returntype", Promise)
|
|
221
|
+
], ChatHubController.prototype, "updateConversationTitle", null);
|
|
222
|
+
__decorate([
|
|
223
|
+
(0, decorators_1.Delete)('/conversations/:sessionId'),
|
|
224
|
+
(0, decorators_1.GlobalScope)('chatHub:message'),
|
|
225
|
+
__param(2, (0, decorators_1.Param)('sessionId')),
|
|
226
|
+
__metadata("design:type", Function),
|
|
227
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
228
|
+
__metadata("design:returntype", Promise)
|
|
229
|
+
], ChatHubController.prototype, "deleteConversation", null);
|
|
101
230
|
exports.ChatHubController = ChatHubController = __decorate([
|
|
102
231
|
(0, decorators_1.RestController)('/chat'),
|
|
103
232
|
__metadata("design:paramtypes", [chat_hub_service_1.ChatHubService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-hub.controller.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/chat-hub.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"chat-hub.controller.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/chat-hub.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAUwB;AACxB,wDAA6C;AAE7C,gDAA8F;AAE9F,6CAA+C;AAE/C,yDAAoD;AACpD,2EAAqE;AAGrE,MAAM,oBAAoB,GAAG;IAC5B,cAAc,EAAE,uCAAuC;IACvD,mBAAmB,EAAE,SAAS;IAC9B,eAAe,EAAE,UAAU;IAC3B,UAAU,EAAE,YAAY;CACxB,CAAC;AAIK,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC7B,YACkB,WAA2B,EAC3B,MAAc;QADd,gBAAW,GAAX,WAAW,CAAgB;QAC3B,WAAM,GAAN,MAAM,CAAQ;IAC7B,CAAC;IAIE,AAAN,KAAK,CAAC,SAAS,CACd,GAAyB,EACzB,IAAc,EACR,OAA6B;QAEnC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,C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AAiB,CAAC;IAC9B,IAAA,iBAAI,EAAC,oDAAoD,CAAC;IAIzD,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;;;;uDAMnB;AAIK;IAFL,IAAA,iBAAI,EAAC,kCAAkC,CAAC;IACxC,IAAA,wBAAW,EAAC,iBAAiB,CAAC;IAI7B,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,iBAAI,CAAA;;6DAAU,iDAAqC;;gEAKpD;AAIK;IAFL,IAAA,mBAAM,EAAC,2BAA2B,CAAC;IACnC,IAAA,wBAAW,EAAC,iBAAiB,CAAC;IAI7B,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;;;;2DAKnB;4BA7MW,iBAAiB;IAD7B,IAAA,2BAAc,EAAC,OAAO,CAAC;qCAGQ,iCAAc;QACnB,uBAAM;GAHpB,iBAAiB,CA8M7B"}
|
|
@@ -4,5 +4,6 @@ export declare class ChatHubModule implements ModuleInterface {
|
|
|
4
4
|
settings(): Promise<{
|
|
5
5
|
chatAccessEnabled: boolean;
|
|
6
6
|
}>;
|
|
7
|
+
entities(): Promise<(typeof import("./chat-hub-session.entity").ChatHubSession | typeof import("./chat-hub-message.entity").ChatHubMessage)[]>;
|
|
7
8
|
shutdown(): Promise<void>;
|
|
8
9
|
}
|
|
@@ -48,7 +48,7 @@ const decorators_1 = require("@n8n/decorators");
|
|
|
48
48
|
const di_1 = require("@n8n/di");
|
|
49
49
|
const YELLOW = '\x1b[33m';
|
|
50
50
|
const CLEAR = '\x1b[0m';
|
|
51
|
-
const WARNING_MESSAGE = "[Chat] 'chat' module is experimental, undocumented and subject to change. " +
|
|
51
|
+
const WARNING_MESSAGE = "[Chat] 'chat-hub' module is experimental, undocumented and subject to change. " +
|
|
52
52
|
'Before its official release any features may become inaccessible at any point, ' +
|
|
53
53
|
'and using the module could compromise the stability of your system. Use at your own risk!';
|
|
54
54
|
let ChatHubModule = class ChatHubModule {
|
|
@@ -63,6 +63,11 @@ let ChatHubModule = class ChatHubModule {
|
|
|
63
63
|
const chatAccessEnabled = await di_1.Container.get(ChatHubSettingsService).getEnabled();
|
|
64
64
|
return { chatAccessEnabled };
|
|
65
65
|
}
|
|
66
|
+
async entities() {
|
|
67
|
+
const { ChatHubSession } = await Promise.resolve().then(() => __importStar(require('./chat-hub-session.entity')));
|
|
68
|
+
const { ChatHubMessage } = await Promise.resolve().then(() => __importStar(require('./chat-hub-message.entity')));
|
|
69
|
+
return [ChatHubSession, ChatHubMessage];
|
|
70
|
+
}
|
|
66
71
|
async shutdown() { }
|
|
67
72
|
};
|
|
68
73
|
exports.ChatHubModule = ChatHubModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-hub.module.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/chat-hub.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA6C;AAE7C,gDAA4D;AAC5D,gCAAoC;AAEpC,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,eAAe,GACpB,
|
|
1
|
+
{"version":3,"file":"chat-hub.module.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/chat-hub.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA6C;AAE7C,gDAA4D;AAC5D,gCAAoC;AAEpC,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,eAAe,GACpB,gFAAgF;IAChF,iFAAiF;IACjF,2FAA2F,CAAC;AAGtF,IAAM,aAAa,GAAnB,MAAM,aAAa;IACzB,KAAK,CAAC,IAAI;QACT,MAAM,MAAM,GAAG,cAAS,CAAC,GAAG,CAAC,uBAAM,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxD,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,eAAe,GAAG,KAAK,EAAE,CAAC,CAAC;QAEnD,wDAAa,uBAAuB,GAAC,CAAC;QACtC,wDAAa,gCAAgC,GAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,QAAQ;QACb,MAAM,EAAE,sBAAsB,EAAE,GAAG,wDAAa,6BAA6B,GAAC,CAAC;QAC/E,MAAM,iBAAiB,GAAG,MAAM,cAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,EAAE,CAAC;QACnF,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,QAAQ;QACb,MAAM,EAAE,cAAc,EAAE,GAAG,wDAAa,2BAA2B,GAAC,CAAC;QACrE,MAAM,EAAE,cAAc,EAAE,GAAG,wDAAa,2BAA2B,GAAC,CAAC;QAErE,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IACzC,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,KAAI,CAAC;CACnB,CAAA;AAxBY,sCAAa;AAuBnB;IADL,IAAA,uBAAU,GAAE;;;;6CACM;wBAvBP,aAAa;IADzB,IAAA,0BAAa,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;GACvB,aAAa,CAwBzB"}
|
|
@@ -1,34 +1,55 @@
|
|
|
1
|
-
import { type ChatHubProvider, type ChatModelsResponse, type ChatHubConversationsResponse, type
|
|
1
|
+
import { type ChatHubProvider, type ChatModelsResponse, type ChatHubConversationsResponse, type ChatHubConversationResponse, type ChatMessageId, type ChatSessionId } from '@n8n/api-types';
|
|
2
2
|
import { Logger } from '@n8n/backend-common';
|
|
3
3
|
import { ExecutionRepository, ProjectRepository, SharedWorkflowRepository, User, WorkflowRepository } from '@n8n/db';
|
|
4
4
|
import type { Response } from 'express';
|
|
5
|
-
import type { ChatPayloadWithCredentials } from './chat-hub.types';
|
|
6
|
-
import { CredentialsHelper } from '../../credentials-helper';
|
|
7
|
-
import { WorkflowExecutionService } from '../../workflows/workflow-execution.service';
|
|
8
|
-
import { CredentialsService } from '../../credentials/credentials.service';
|
|
9
5
|
import { ActiveExecutions } from '../../active-executions';
|
|
6
|
+
import { CredentialsService } from '../../credentials/credentials.service';
|
|
7
|
+
import { ExecutionService } from '../../executions/execution.service';
|
|
8
|
+
import { DynamicNodeParametersService } from '../../services/dynamic-node-parameters.service';
|
|
9
|
+
import { WorkflowExecutionService } from '../../workflows/workflow-execution.service';
|
|
10
|
+
import type { HumanMessagePayload, RegenerateMessagePayload, EditMessagePayload } from './chat-hub.types';
|
|
11
|
+
import { ChatHubMessageRepository } from './chat-message.repository';
|
|
12
|
+
import { ChatHubSessionRepository } from './chat-session.repository';
|
|
10
13
|
export declare class ChatHubService {
|
|
11
14
|
private readonly logger;
|
|
12
15
|
private readonly credentialsService;
|
|
13
|
-
private readonly
|
|
16
|
+
private readonly executionService;
|
|
17
|
+
private readonly nodeParametersService;
|
|
14
18
|
private readonly executionRepository;
|
|
15
19
|
private readonly workflowExecutionService;
|
|
16
20
|
private readonly workflowRepository;
|
|
17
21
|
private readonly projectRepository;
|
|
18
22
|
private readonly sharedWorkflowRepository;
|
|
19
23
|
private readonly activeExecutions;
|
|
20
|
-
private
|
|
21
|
-
|
|
24
|
+
private readonly sessionRepository;
|
|
25
|
+
private readonly messageRepository;
|
|
26
|
+
constructor(logger: Logger, credentialsService: CredentialsService, executionService: ExecutionService, nodeParametersService: DynamicNodeParametersService, executionRepository: ExecutionRepository, workflowExecutionService: WorkflowExecutionService, workflowRepository: WorkflowRepository, projectRepository: ProjectRepository, sharedWorkflowRepository: SharedWorkflowRepository, activeExecutions: ActiveExecutions, sessionRepository: ChatHubSessionRepository, messageRepository: ChatHubMessageRepository);
|
|
22
27
|
getModels(user: User, credentialIds: Record<ChatHubProvider, string | null>): Promise<ChatModelsResponse>;
|
|
23
28
|
private fetchModelsForProvider;
|
|
24
29
|
private fetchOpenAiModels;
|
|
25
30
|
private fetchAnthropicModels;
|
|
26
31
|
private fetchGoogleModels;
|
|
27
|
-
private extractApiKey;
|
|
28
32
|
private createChatWorkflow;
|
|
29
|
-
private
|
|
30
|
-
|
|
33
|
+
private deleteChatWorkflow;
|
|
34
|
+
private getErrorMessage;
|
|
35
|
+
private getAIOutput;
|
|
36
|
+
private getCredentialId;
|
|
37
|
+
sendHumanMessage(res: Response, user: User, payload: HumanMessagePayload): Promise<void>;
|
|
38
|
+
editHumanMessage(res: Response, user: User, payload: EditMessagePayload): Promise<void>;
|
|
39
|
+
regenerateAIMessage(res: Response, user: User, payload: RegenerateMessagePayload): Promise<void>;
|
|
40
|
+
stopGeneration(user: User, sessionId: ChatSessionId, messageId: ChatMessageId): Promise<void>;
|
|
41
|
+
private executeChatWorkflow;
|
|
42
|
+
private prepareChatWorkflow;
|
|
43
|
+
private saveHumanMessage;
|
|
44
|
+
private saveAIMessage;
|
|
45
|
+
private getChatSession;
|
|
46
|
+
private getChatMessage;
|
|
31
47
|
private createModelNode;
|
|
32
|
-
getConversations(): Promise<ChatHubConversationsResponse>;
|
|
33
|
-
|
|
48
|
+
getConversations(userId: string): Promise<ChatHubConversationsResponse>;
|
|
49
|
+
getConversation(userId: string, sessionId: string): Promise<ChatHubConversationResponse>;
|
|
50
|
+
private convertMessageToDto;
|
|
51
|
+
private buildMessageHistory;
|
|
52
|
+
deleteAllSessions(): Promise<import("@n8n/typeorm").DeleteResult>;
|
|
53
|
+
updateSessionTitle(userId: string, sessionId: ChatSessionId, title: string): Promise<import("./chat-hub-session.entity").ChatHubSession>;
|
|
54
|
+
deleteSession(userId: string, sessionId: ChatSessionId): Promise<void>;
|
|
34
55
|
}
|