n8n-nodes-dopomogai 1.1.2 → 1.2.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.
Files changed (31) hide show
  1. package/dist/index.d.ts +10 -1
  2. package/dist/index.js +12 -1
  3. package/dist/nodes/Agents/Agents.node.d.ts +5 -0
  4. package/dist/nodes/Agents/Agents.node.js +186 -0
  5. package/dist/nodes/Agents/dopomogai.svg +4 -0
  6. package/dist/nodes/{Dopomogai/Dopomogai.node.d.ts → Chat/Chat.node.d.ts} +1 -1
  7. package/dist/nodes/Chat/Chat.node.js +300 -0
  8. package/dist/nodes/Chat/dopomogai.svg +4 -0
  9. package/dist/nodes/Conversations/Conversations.node.d.ts +5 -0
  10. package/dist/nodes/Conversations/Conversations.node.js +209 -0
  11. package/dist/nodes/Conversations/dopomogai.svg +4 -0
  12. package/dist/nodes/Files/Files.node.d.ts +5 -0
  13. package/dist/nodes/Files/Files.node.js +147 -0
  14. package/dist/nodes/Files/dopomogai.svg +4 -0
  15. package/dist/nodes/Knowledge/Knowledge.node.d.ts +5 -0
  16. package/dist/nodes/Knowledge/Knowledge.node.js +110 -0
  17. package/dist/nodes/Knowledge/dopomogai.svg +4 -0
  18. package/dist/nodes/Tools/Tools.node.d.ts +5 -0
  19. package/dist/nodes/Tools/Tools.node.js +174 -0
  20. package/dist/nodes/Tools/dopomogai.svg +4 -0
  21. package/dist/shared/attachments.d.ts +19 -0
  22. package/dist/shared/attachments.js +38 -0
  23. package/dist/{nodes/Dopomogai/helpers → shared}/http.d.ts +11 -1
  24. package/dist/{nodes/Dopomogai/helpers → shared}/http.js +45 -13
  25. package/dist/{nodes/Dopomogai/helpers → shared}/sse.js +0 -2
  26. package/dist/shared/upload.d.ts +16 -0
  27. package/dist/shared/upload.js +29 -0
  28. package/package.json +14 -7
  29. package/scripts/copy-icons.mjs +39 -0
  30. package/dist/nodes/Dopomogai/Dopomogai.node.js +0 -496
  31. /package/dist/{nodes/Dopomogai/helpers → shared}/sse.d.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,2 +1,11 @@
1
- export * from './nodes/Dopomogai/Dopomogai.node';
2
1
  export * from './credentials/DopomogaiApiKey.credentials';
2
+ export * from './nodes/Agents/Agents.node';
3
+ export * from './nodes/Chat/Chat.node';
4
+ export * from './nodes/Conversations/Conversations.node';
5
+ export * from './nodes/Files/Files.node';
6
+ export * from './nodes/Tools/Tools.node';
7
+ export * from './nodes/Knowledge/Knowledge.node';
8
+ export * from './shared/http';
9
+ export * from './shared/sse';
10
+ export * from './shared/upload';
11
+ export * from './shared/attachments';
package/dist/index.js CHANGED
@@ -14,5 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./nodes/Dopomogai/Dopomogai.node"), exports);
18
17
  __exportStar(require("./credentials/DopomogaiApiKey.credentials"), exports);
18
+ // Nodes (split for better UX in n8n)
19
+ __exportStar(require("./nodes/Agents/Agents.node"), exports);
20
+ __exportStar(require("./nodes/Chat/Chat.node"), exports);
21
+ __exportStar(require("./nodes/Conversations/Conversations.node"), exports);
22
+ __exportStar(require("./nodes/Files/Files.node"), exports);
23
+ __exportStar(require("./nodes/Tools/Tools.node"), exports);
24
+ __exportStar(require("./nodes/Knowledge/Knowledge.node"), exports);
25
+ // Shared helpers (optional export; useful for tests or internal reuse)
26
+ __exportStar(require("./shared/http"), exports);
27
+ __exportStar(require("./shared/sse"), exports);
28
+ __exportStar(require("./shared/upload"), exports);
29
+ __exportStar(require("./shared/attachments"), exports);
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class DopomogaiAgents implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DopomogaiAgents = void 0;
4
+ const http_1 = require("../../shared/http");
5
+ class DopomogaiAgents {
6
+ description = {
7
+ displayName: 'DopomogAI Agents',
8
+ name: 'dopomogaiAgents',
9
+ icon: 'file:dopomogai.svg',
10
+ group: ['transform'],
11
+ version: 1,
12
+ description: 'Manage DopomogAI agents (CRUD + tool linking).',
13
+ defaults: { name: 'DopomogAI Agents' },
14
+ inputs: ['main'],
15
+ outputs: ['main'],
16
+ credentials: [{ name: 'dopomogaiApiKey', required: true }],
17
+ properties: [
18
+ {
19
+ displayName: 'Operation',
20
+ name: 'operation',
21
+ type: 'options',
22
+ noDataExpression: true,
23
+ default: 'list',
24
+ options: [
25
+ { name: 'List', value: 'list' },
26
+ { name: 'Create', value: 'create' },
27
+ { name: 'Get', value: 'get' },
28
+ { name: 'Update', value: 'update' },
29
+ { name: 'Delete', value: 'delete' },
30
+ { name: 'Get Tools Linked to Agent', value: 'getTools' },
31
+ { name: 'Set Tools Linked to Agent', value: 'setTools' },
32
+ ],
33
+ },
34
+ // IDs
35
+ {
36
+ displayName: 'Agent ID',
37
+ name: 'agentId',
38
+ type: 'string',
39
+ default: '',
40
+ displayOptions: {
41
+ show: { operation: ['get', 'update', 'delete', 'getTools', 'setTools'] },
42
+ },
43
+ required: true,
44
+ },
45
+ // Create
46
+ {
47
+ displayName: 'Name',
48
+ name: 'name',
49
+ type: 'string',
50
+ default: '',
51
+ displayOptions: { show: { operation: ['create'] } },
52
+ required: true,
53
+ },
54
+ {
55
+ displayName: 'LLM Model',
56
+ name: 'llm_model',
57
+ type: 'string',
58
+ default: 'openrouter:openai/gpt-4o',
59
+ displayOptions: { show: { operation: ['create'] } },
60
+ required: true,
61
+ },
62
+ {
63
+ displayName: 'Description',
64
+ name: 'description',
65
+ type: 'string',
66
+ default: '',
67
+ displayOptions: { show: { operation: ['create', 'update'] } },
68
+ },
69
+ {
70
+ displayName: 'Is Public',
71
+ name: 'is_public',
72
+ type: 'boolean',
73
+ default: false,
74
+ displayOptions: { show: { operation: ['create', 'update'] } },
75
+ },
76
+ {
77
+ displayName: 'Agent Settings (JSON)',
78
+ name: 'agent_settings_json',
79
+ type: 'string',
80
+ default: '{}',
81
+ displayOptions: { show: { operation: ['create', 'update'] } },
82
+ description: 'JSON object for agent_settings.',
83
+ },
84
+ // Tool linking
85
+ {
86
+ displayName: 'Tool Slugs (one per line)',
87
+ name: 'tool_slugs',
88
+ type: 'string',
89
+ typeOptions: { rows: 6 },
90
+ default: '',
91
+ displayOptions: { show: { operation: ['setTools'] } },
92
+ description: 'List of tool slugs to link to the agent. Replaces existing.',
93
+ },
94
+ ],
95
+ };
96
+ async execute() {
97
+ const items = this.getInputData();
98
+ const out = [];
99
+ for (let i = 0; i < items.length; i++) {
100
+ const op = this.getNodeParameter('operation', i);
101
+ if (op === 'list') {
102
+ const { data } = await (0, http_1.requestJson)(this, { method: 'GET', path: '/api/v1/agents' });
103
+ out.push({ json: data });
104
+ continue;
105
+ }
106
+ if (op === 'create') {
107
+ const name = this.getNodeParameter('name', i);
108
+ const llm_model = this.getNodeParameter('llm_model', i);
109
+ const description = this.getNodeParameter('description', i, '');
110
+ const is_public = this.getNodeParameter('is_public', i, false);
111
+ const settingsRaw = this.getNodeParameter('agent_settings_json', i, '{}');
112
+ let agent_settings = null;
113
+ try {
114
+ agent_settings = settingsRaw ? JSON.parse(settingsRaw) : null;
115
+ }
116
+ catch {
117
+ throw new Error('Invalid Agent Settings JSON');
118
+ }
119
+ const body = {
120
+ name,
121
+ llm_model,
122
+ description: description || null,
123
+ agent_settings,
124
+ is_public,
125
+ };
126
+ const { data } = await (0, http_1.requestJson)(this, { method: 'POST', path: '/api/v1/agents', body });
127
+ out.push({ json: data });
128
+ continue;
129
+ }
130
+ // all remaining ops require agentId
131
+ const agentId = this.getNodeParameter('agentId', i);
132
+ if (op === 'get') {
133
+ const { data } = await (0, http_1.requestJson)(this, { method: 'GET', path: `/api/v1/agents/${agentId}` });
134
+ out.push({ json: data });
135
+ continue;
136
+ }
137
+ if (op === 'update') {
138
+ const description = this.getNodeParameter('description', i, '');
139
+ const is_public = this.getNodeParameter('is_public', i, false);
140
+ const settingsRaw = this.getNodeParameter('agent_settings_json', i, '{}');
141
+ let agent_settings = undefined;
142
+ try {
143
+ agent_settings = settingsRaw ? JSON.parse(settingsRaw) : undefined;
144
+ }
145
+ catch {
146
+ throw new Error('Invalid Agent Settings JSON');
147
+ }
148
+ const body = { is_public };
149
+ if (description !== '')
150
+ body.description = description;
151
+ if (agent_settings !== undefined)
152
+ body.agent_settings = agent_settings;
153
+ const { data } = await (0, http_1.requestJson)(this, { method: 'PUT', path: `/api/v1/agents/${agentId}`, body });
154
+ out.push({ json: data });
155
+ continue;
156
+ }
157
+ if (op === 'delete') {
158
+ await (0, http_1.requestJson)(this, { method: 'DELETE', path: `/api/v1/agents/${agentId}` });
159
+ out.push({ json: { ok: true } });
160
+ continue;
161
+ }
162
+ if (op === 'getTools') {
163
+ const { data } = await (0, http_1.requestJson)(this, { method: 'GET', path: `/api/v1/agents/${agentId}/tools` });
164
+ out.push({ json: data });
165
+ continue;
166
+ }
167
+ if (op === 'setTools') {
168
+ const raw = this.getNodeParameter('tool_slugs', i, '');
169
+ const toolSlugs = raw
170
+ .split(/\r?\n/)
171
+ .map((s) => s.trim())
172
+ .filter(Boolean);
173
+ const { data } = await (0, http_1.requestJson)(this, {
174
+ method: 'PUT',
175
+ path: `/api/v1/agents/${agentId}/tools`,
176
+ body: toolSlugs,
177
+ });
178
+ out.push({ json: data });
179
+ continue;
180
+ }
181
+ throw new Error(`Unsupported operation: ${op}`);
182
+ }
183
+ return [out];
184
+ }
185
+ }
186
+ exports.DopomogaiAgents = DopomogaiAgents;
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
2
+ <rect x="6" y="6" width="52" height="52" rx="12" fill="#111827"/>
3
+ <path d="M20 22h24v6H20zM20 32h24v6H20zM20 42h16v6H20z" fill="#22c55e"/>
4
+ </svg>
@@ -1,5 +1,5 @@
1
1
  import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class Dopomogai implements INodeType {
2
+ export declare class DopomogaiChat implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
5
  }
@@ -0,0 +1,300 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DopomogaiChat = void 0;
4
+ const http_1 = require("../../shared/http");
5
+ const sse_1 = require("../../shared/sse");
6
+ const attachments_1 = require("../../shared/attachments");
7
+ function safeJsonParse(input, label) {
8
+ if (!input)
9
+ return undefined;
10
+ try {
11
+ return JSON.parse(input);
12
+ }
13
+ catch {
14
+ throw new Error(`Invalid JSON for ${label}`);
15
+ }
16
+ }
17
+ class DopomogaiChat {
18
+ description = {
19
+ displayName: 'DopomogAI Chat',
20
+ name: 'dopomogaiChat',
21
+ icon: 'file:dopomogai.svg',
22
+ group: ['transform'],
23
+ version: 1,
24
+ description: 'Chat with agents (blocking SSE), with attachments and tool result submission.',
25
+ defaults: { name: 'DopomogAI Chat' },
26
+ inputs: ['main'],
27
+ outputs: ['main'],
28
+ credentials: [{ name: 'dopomogaiApiKey', required: true }],
29
+ properties: [
30
+ {
31
+ displayName: 'Operation',
32
+ name: 'operation',
33
+ type: 'options',
34
+ noDataExpression: true,
35
+ default: 'chatBlocking',
36
+ options: [
37
+ { name: 'Chat (Blocking)', value: 'chatBlocking' },
38
+ { name: 'Submit Tool Result (Blocking)', value: 'submitToolResultBlocking' },
39
+ ],
40
+ },
41
+ // ---------------- Chat (Blocking) ----------------
42
+ {
43
+ displayName: 'Agent ID',
44
+ name: 'agentId',
45
+ type: 'string',
46
+ default: '',
47
+ displayOptions: { show: { operation: ['chatBlocking'] } },
48
+ required: true,
49
+ },
50
+ {
51
+ displayName: 'Conversation ID',
52
+ name: 'conversationId',
53
+ type: 'string',
54
+ default: '',
55
+ displayOptions: { show: { operation: ['chatBlocking'] } },
56
+ description: 'Optional. If empty, backend creates a conversation and returns X-Conversation-Id.',
57
+ },
58
+ {
59
+ displayName: 'Message Text',
60
+ name: 'messageText',
61
+ type: 'string',
62
+ default: '',
63
+ displayOptions: { show: { operation: ['chatBlocking'] } },
64
+ description: 'Optional. If empty, you can still send attachments only.',
65
+ },
66
+ {
67
+ displayName: 'Attachments Mode',
68
+ name: 'attachmentsMode',
69
+ type: 'options',
70
+ default: 'none',
71
+ displayOptions: { show: { operation: ['chatBlocking'] } },
72
+ options: [
73
+ { name: 'None', value: 'none' },
74
+ { name: 'File IDs', value: 'fileIds' },
75
+ { name: 'Binary Properties (Upload then Attach)', value: 'binary' },
76
+ { name: 'Both', value: 'both' },
77
+ ],
78
+ },
79
+ {
80
+ displayName: 'File IDs (one per line)',
81
+ name: 'fileIds',
82
+ type: 'string',
83
+ typeOptions: { rows: 6 },
84
+ default: '',
85
+ displayOptions: { show: { operation: ['chatBlocking'], attachmentsMode: ['fileIds', 'both'] } },
86
+ },
87
+ {
88
+ displayName: 'Binary Properties (one per line)',
89
+ name: 'binaryProperties',
90
+ type: 'string',
91
+ typeOptions: { rows: 4 },
92
+ default: 'data',
93
+ description: 'Binary property name(s) on the incoming item, e.g. data, data2, file.',
94
+ displayOptions: { show: { operation: ['chatBlocking'], attachmentsMode: ['binary', 'both'] } },
95
+ },
96
+ {
97
+ displayName: 'Upload Purpose',
98
+ name: 'uploadPurpose',
99
+ type: 'string',
100
+ default: 'agent_input',
101
+ displayOptions: { show: { operation: ['chatBlocking'], attachmentsMode: ['binary', 'both'] } },
102
+ },
103
+ {
104
+ displayName: 'Upload Agent ID (optional)',
105
+ name: 'uploadAgentId',
106
+ type: 'string',
107
+ default: '',
108
+ displayOptions: { show: { operation: ['chatBlocking'], attachmentsMode: ['binary', 'both'] } },
109
+ description: 'Optional agent_id for /files/upload optimization. Usually same as Agent ID.',
110
+ },
111
+ {
112
+ displayName: 'Media Type Override (optional)',
113
+ name: 'mediaTypeOverride',
114
+ type: 'string',
115
+ default: '',
116
+ displayOptions: { show: { operation: ['chatBlocking'], attachmentsMode: ['fileIds', 'binary', 'both'] } },
117
+ description: 'If set, forces media_type for all attached file parts.',
118
+ },
119
+ {
120
+ displayName: 'Initial Context',
121
+ name: 'initialContext',
122
+ type: 'string',
123
+ default: '',
124
+ displayOptions: { show: { operation: ['chatBlocking'] } },
125
+ },
126
+ {
127
+ displayName: 'Turn Prompt Override',
128
+ name: 'turnPromptOverride',
129
+ type: 'string',
130
+ default: '',
131
+ displayOptions: { show: { operation: ['chatBlocking'] } },
132
+ },
133
+ {
134
+ displayName: 'Run Overrides (JSON)',
135
+ name: 'runOverridesJson',
136
+ type: 'string',
137
+ default: '{}',
138
+ displayOptions: { show: { operation: ['chatBlocking'] } },
139
+ description: 'Optional run_overrides JSON.',
140
+ },
141
+ {
142
+ displayName: 'Return Full Event Log',
143
+ name: 'returnEvents',
144
+ type: 'boolean',
145
+ default: false,
146
+ displayOptions: { show: { operation: ['chatBlocking'] } },
147
+ },
148
+ // -------------- Submit Tool Result (Blocking) --------------
149
+ {
150
+ displayName: 'Agent ID',
151
+ name: 'toolAgentId',
152
+ type: 'string',
153
+ default: '',
154
+ displayOptions: { show: { operation: ['submitToolResultBlocking'] } },
155
+ required: true,
156
+ },
157
+ {
158
+ displayName: 'Conversation ID',
159
+ name: 'toolConversationId',
160
+ type: 'string',
161
+ default: '',
162
+ displayOptions: { show: { operation: ['submitToolResultBlocking'] } },
163
+ required: true,
164
+ },
165
+ {
166
+ displayName: 'Tool Call ID',
167
+ name: 'toolCallId',
168
+ type: 'string',
169
+ default: '',
170
+ displayOptions: { show: { operation: ['submitToolResultBlocking'] } },
171
+ required: true,
172
+ },
173
+ {
174
+ displayName: 'Tool Name',
175
+ name: 'toolName',
176
+ type: 'string',
177
+ default: '',
178
+ displayOptions: { show: { operation: ['submitToolResultBlocking'] } },
179
+ required: true,
180
+ },
181
+ {
182
+ displayName: 'Tool Output (JSON)',
183
+ name: 'toolOutputJson',
184
+ type: 'string',
185
+ default: '{}',
186
+ displayOptions: { show: { operation: ['submitToolResultBlocking'] } },
187
+ required: true,
188
+ },
189
+ {
190
+ displayName: 'Return Full Event Log',
191
+ name: 'toolReturnEvents',
192
+ type: 'boolean',
193
+ default: false,
194
+ displayOptions: { show: { operation: ['submitToolResultBlocking'] } },
195
+ },
196
+ ],
197
+ };
198
+ async execute() {
199
+ const items = this.getInputData();
200
+ const out = [];
201
+ for (let i = 0; i < items.length; i++) {
202
+ const op = this.getNodeParameter('operation', i);
203
+ // ---------------- Chat (blocking) ----------------
204
+ if (op === 'chatBlocking') {
205
+ const creds = (0, http_1.getCreds)(this);
206
+ const agentId = this.getNodeParameter('agentId', i);
207
+ const conversationId = this.getNodeParameter('conversationId', i, '');
208
+ const messageText = this.getNodeParameter('messageText', i, '');
209
+ const attachmentsMode = this.getNodeParameter('attachmentsMode', i, 'none');
210
+ const fileIds = this.getNodeParameter('fileIds', i, '');
211
+ const binaryProperties = this.getNodeParameter('binaryProperties', i, 'data');
212
+ const uploadPurpose = this.getNodeParameter('uploadPurpose', i, 'agent_input');
213
+ const uploadAgentId = this.getNodeParameter('uploadAgentId', i, '');
214
+ const mediaTypeOverride = this.getNodeParameter('mediaTypeOverride', i, '');
215
+ const initialContext = this.getNodeParameter('initialContext', i, '');
216
+ const turnPromptOverride = this.getNodeParameter('turnPromptOverride', i, '');
217
+ const runOverridesJson = this.getNodeParameter('runOverridesJson', i, '{}');
218
+ const returnEvents = this.getNodeParameter('returnEvents', i, false);
219
+ const run_overrides = safeJsonParse(runOverridesJson, 'Run Overrides');
220
+ const att = await (0, attachments_1.resolveChatAttachments)({
221
+ ctx: this,
222
+ itemIndex: i,
223
+ mode: attachmentsMode,
224
+ fileIdsText: fileIds,
225
+ binaryPropertiesText: binaryProperties,
226
+ mediaTypeOverride: mediaTypeOverride || undefined,
227
+ uploadPurpose,
228
+ uploadAgentId: uploadAgentId || undefined,
229
+ });
230
+ const parts = [];
231
+ if (messageText)
232
+ parts.push({ type: 'text', content: messageText });
233
+ if (att.parts?.length)
234
+ parts.push(...att.parts);
235
+ const body = {
236
+ conversation_id: conversationId || undefined,
237
+ user_message: messageText || undefined,
238
+ parts: parts.length ? parts : undefined,
239
+ initial_context: initialContext || undefined,
240
+ turn_prompt_override: turnPromptOverride || undefined,
241
+ run_overrides: run_overrides && Object.keys(run_overrides).length ? run_overrides : undefined,
242
+ };
243
+ const url = `${creds.apiBaseUrl}/api/v1/agents/${agentId}/conversations/stream`;
244
+ const headers = (0, http_1.buildHeaders)(creds);
245
+ const sse = await (0, sse_1.postSseAndCollect)({
246
+ url,
247
+ headers,
248
+ body,
249
+ stopOn: { streamEnd: true, complete: false },
250
+ timeoutMs: 10 * 60 * 1000,
251
+ });
252
+ const finalText = sse.finalResponse || sse.accumulatedText;
253
+ out.push({
254
+ json: {
255
+ conversation_id: sse.conversationId || conversationId || null,
256
+ final_response: finalText || '',
257
+ usage: sse.usage,
258
+ attached_file_ids: att.fileIds,
259
+ events: returnEvents ? sse.events : undefined,
260
+ },
261
+ });
262
+ continue;
263
+ }
264
+ // ---------------- Submit tool result (blocking) ----------------
265
+ if (op === 'submitToolResultBlocking') {
266
+ const creds = (0, http_1.getCreds)(this);
267
+ const agentId = this.getNodeParameter('toolAgentId', i);
268
+ const conversationId = this.getNodeParameter('toolConversationId', i);
269
+ const toolCallId = this.getNodeParameter('toolCallId', i);
270
+ const toolName = this.getNodeParameter('toolName', i);
271
+ const toolOutputJson = this.getNodeParameter('toolOutputJson', i);
272
+ const returnEvents = this.getNodeParameter('toolReturnEvents', i, false);
273
+ const output = safeJsonParse(toolOutputJson, 'Tool Output');
274
+ const body = { tool_name: toolName, output };
275
+ const url = `${creds.apiBaseUrl}/api/v1/agents/${agentId}/conversations/${conversationId}/tools/${toolCallId}/result/stream`;
276
+ const headers = (0, http_1.buildHeaders)(creds);
277
+ const sse = await (0, sse_1.postSseAndCollect)({
278
+ url,
279
+ headers,
280
+ body,
281
+ stopOn: { streamEnd: true, complete: false },
282
+ timeoutMs: 10 * 60 * 1000,
283
+ });
284
+ const finalText = sse.finalResponse || sse.accumulatedText;
285
+ out.push({
286
+ json: {
287
+ conversation_id: sse.conversationId || conversationId,
288
+ final_response: finalText || '',
289
+ usage: sse.usage,
290
+ events: returnEvents ? sse.events : undefined,
291
+ },
292
+ });
293
+ continue;
294
+ }
295
+ throw new Error(`Unsupported operation: ${op}`);
296
+ }
297
+ return [out];
298
+ }
299
+ }
300
+ exports.DopomogaiChat = DopomogaiChat;
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
2
+ <rect x="6" y="6" width="52" height="52" rx="12" fill="#111827"/>
3
+ <path d="M20 22h24v6H20zM20 32h24v6H20zM20 42h16v6H20z" fill="#22c55e"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class DopomogaiConversations implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }