@connectorx/n8n-nodes-cortex 0.1.43 → 0.1.44
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.
|
@@ -6,7 +6,7 @@ class CortexTrigger {
|
|
|
6
6
|
this.description = {
|
|
7
7
|
displayName: 'Cortex Trigger',
|
|
8
8
|
name: 'cortexTrigger',
|
|
9
|
-
icon: 'file:cortex.
|
|
9
|
+
icon: 'file:cortex.svg',
|
|
10
10
|
group: ['trigger'],
|
|
11
11
|
version: 2,
|
|
12
12
|
description: 'Recebe eventos do Cortex via webhook: mensagens, atualizações de prompt e atribuições de conversa.',
|
|
@@ -14,12 +14,12 @@ class CortexTrigger {
|
|
|
14
14
|
name: 'Cortex Trigger',
|
|
15
15
|
},
|
|
16
16
|
inputs: [],
|
|
17
|
-
outputs:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
outputs: `={{(() => {
|
|
18
|
+
const o = [{ type: "main", displayName: "Mensagens Recebidas" }];
|
|
19
|
+
if ($parameter.enablePromptOutput) o.push({ type: "main", displayName: "Prompt Atualizado" });
|
|
20
|
+
if ($parameter.enableAssignmentOutput) o.push({ type: "main", displayName: "Conversa Atribuída" });
|
|
21
|
+
return o;
|
|
22
|
+
})()}}`,
|
|
23
23
|
properties: [
|
|
24
24
|
{
|
|
25
25
|
displayName: 'Webhook Secret',
|
|
@@ -47,15 +47,15 @@ class CortexTrigger {
|
|
|
47
47
|
displayName: 'Saída separada para Prompt Atualizado',
|
|
48
48
|
name: 'enablePromptOutput',
|
|
49
49
|
type: 'boolean',
|
|
50
|
-
default:
|
|
51
|
-
description: 'Quando LIGADO, eventos de atualização de prompt do agente saem
|
|
50
|
+
default: false,
|
|
51
|
+
description: 'Quando LIGADO, eventos de atualização de prompt do agente saem por uma saída dedicada. Quando DESLIGADO, vão para a saída principal (Mensagens Recebidas).',
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
displayName: 'Saída separada para Conversa Atribuída',
|
|
55
55
|
name: 'enableAssignmentOutput',
|
|
56
56
|
type: 'boolean',
|
|
57
|
-
default:
|
|
58
|
-
description: 'Quando LIGADO, eventos de atribuição de conversa a um agente IA saem
|
|
57
|
+
default: false,
|
|
58
|
+
description: 'Quando LIGADO, eventos de atribuição de conversa a um agente IA saem por uma saída dedicada. Quando DESLIGADO, vão para a saída principal (Mensagens Recebidas).',
|
|
59
59
|
},
|
|
60
60
|
],
|
|
61
61
|
webhooks: [
|
|
@@ -131,18 +131,28 @@ class CortexTrigger {
|
|
|
131
131
|
},
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
const enablePromptOutput = this.getNodeParameter('enablePromptOutput',
|
|
135
|
-
const enableAssignmentOutput = this.getNodeParameter('enableAssignmentOutput',
|
|
134
|
+
const enablePromptOutput = this.getNodeParameter('enablePromptOutput', false);
|
|
135
|
+
const enableAssignmentOutput = this.getNodeParameter('enableAssignmentOutput', false);
|
|
136
136
|
const outputData = this.helpers.returnJsonArray(body);
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
const outputCount = 1 + (enablePromptOutput ? 1 : 0) + (enableAssignmentOutput ? 1 : 0);
|
|
138
|
+
const result = new Array(outputCount).fill(null).map(() => []);
|
|
139
|
+
let promptIndex = -1;
|
|
140
|
+
let assignIndex = -1;
|
|
141
|
+
let idx = 1;
|
|
142
|
+
if (enablePromptOutput)
|
|
143
|
+
promptIndex = idx++;
|
|
144
|
+
if (enableAssignmentOutput)
|
|
145
|
+
assignIndex = idx++;
|
|
146
|
+
if (eventType === 'agent_prompt_updated' && promptIndex >= 0) {
|
|
147
|
+
result[promptIndex] = outputData;
|
|
139
148
|
}
|
|
140
|
-
else if (eventType === 'ai_assignment' &&
|
|
141
|
-
|
|
149
|
+
else if (eventType === 'ai_assignment' && assignIndex >= 0) {
|
|
150
|
+
result[assignIndex] = outputData;
|
|
142
151
|
}
|
|
143
152
|
else {
|
|
144
|
-
|
|
153
|
+
result[0] = outputData;
|
|
145
154
|
}
|
|
155
|
+
return { workflowData: result };
|
|
146
156
|
}
|
|
147
157
|
return {
|
|
148
158
|
webhookResponse: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#7c3aed"/>
|
|
5
|
+
<stop offset="100%" stop-color="#10b981"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="128" height="128" rx="28" fill="url(#bg)"/>
|
|
9
|
+
<g transform="translate(64,66) scale(0.7)">
|
|
10
|
+
<path d="M-2,-44 C-10,-44 -18,-40 -24,-34 C-30,-28 -34,-20 -34,-12 C-40,-10 -44,-4 -44,4 C-44,10 -42,16 -38,20 C-40,26 -38,34 -32,40 C-26,44 -18,46 -10,46 L0,46z" fill="white" opacity="0.92"/>
|
|
11
|
+
<path d="M2,-44 C10,-44 18,-40 24,-34 C30,-28 34,-20 34,-12 C40,-10 44,-4 44,4 C44,10 42,16 38,20 C40,26 38,34 32,40 C26,44 18,46 10,46 L0,46z" fill="white" opacity="0.78"/>
|
|
12
|
+
<path d="M-22,-18 Q-28,-6 -22,6 Q-16,18 -22,30" stroke="rgba(124,58,237,0.35)" stroke-width="3" fill="none" stroke-linecap="round"/>
|
|
13
|
+
<path d="M-11,-34 Q-18,-18 -13,-4 Q-8,10 -15,24" stroke="rgba(124,58,237,0.25)" stroke-width="2.5" fill="none" stroke-linecap="round"/>
|
|
14
|
+
<path d="M22,-18 Q28,-6 22,6 Q16,18 22,30" stroke="rgba(16,185,129,0.35)" stroke-width="3" fill="none" stroke-linecap="round"/>
|
|
15
|
+
<path d="M11,-34 Q18,-18 13,-4 Q8,10 15,24" stroke="rgba(16,185,129,0.25)" stroke-width="2.5" fill="none" stroke-linecap="round"/>
|
|
16
|
+
<line x1="0" y1="-42" x2="0" y2="44" stroke="rgba(255,255,255,0.15)" stroke-width="1.5"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|