@atomoz/workflows-nodes 0.1.11 → 0.1.13
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/package.json +8 -8
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +1 -0
- package/src/nodes/consts/index.d.ts +3 -0
- package/src/nodes/consts/index.d.ts.map +1 -0
- package/src/nodes/consts/index.js +2 -0
- package/src/nodes/consts/node-colors.d.ts +7 -0
- package/src/nodes/consts/node-colors.d.ts.map +1 -0
- package/src/nodes/consts/node-colors.js +6 -0
- package/src/nodes/consts/node-functions.d.ts +20 -0
- package/src/nodes/consts/node-functions.d.ts.map +1 -0
- package/src/nodes/consts/node-functions.js +29 -0
- package/src/nodes/consts/nodes.d.ts +3 -0
- package/src/nodes/consts/nodes.d.ts.map +1 -0
- package/src/nodes/consts/nodes.js +30 -0
- package/src/nodes/consts/schemas.d.ts +30 -0
- package/src/nodes/consts/schemas.d.ts.map +1 -0
- package/src/nodes/consts/schemas.js +7 -0
- package/src/nodes/ia/agent/data.d.ts +11 -0
- package/src/nodes/ia/agent/data.d.ts.map +1 -0
- package/src/nodes/ia/agent/data.js +111 -0
- package/src/nodes/ia/agent/function.d.ts +2 -0
- package/src/nodes/ia/agent/function.d.ts.map +1 -0
- package/src/nodes/ia/agent/function.js +90 -0
- package/src/nodes/ia/agent/index.d.ts +3 -0
- package/src/nodes/ia/agent/index.d.ts.map +1 -0
- package/src/nodes/ia/agent/index.js +2 -0
- package/src/nodes/ia/index.d.ts +5 -0
- package/src/nodes/ia/index.d.ts.map +1 -0
- package/src/nodes/ia/index.js +4 -0
- package/src/nodes/ia/message/index.d.ts +2 -0
- package/src/nodes/ia/message/index.d.ts.map +1 -0
- package/src/nodes/ia/message/index.js +1 -0
- package/src/nodes/ia/message/message.d.ts +10 -0
- package/src/nodes/ia/message/message.d.ts.map +1 -0
- package/src/nodes/ia/message/message.js +118 -0
- package/src/nodes/ia/supervisor/data.d.ts +10 -0
- package/src/nodes/ia/supervisor/data.d.ts.map +1 -0
- package/src/nodes/ia/supervisor/data.js +84 -0
- package/src/nodes/ia/supervisor/function.d.ts +2 -0
- package/src/nodes/ia/supervisor/function.d.ts.map +1 -0
- package/src/nodes/ia/supervisor/function.js +227 -0
- package/src/nodes/ia/supervisor/index.d.ts +3 -0
- package/src/nodes/ia/supervisor/index.d.ts.map +1 -0
- package/src/nodes/ia/supervisor/index.js +2 -0
- package/src/nodes/ia/tool/data.d.ts +16 -0
- package/src/nodes/ia/tool/data.d.ts.map +1 -0
- package/src/nodes/ia/tool/data.js +70 -0
- package/src/nodes/ia/tool/function.d.ts +4 -0
- package/src/nodes/ia/tool/function.d.ts.map +1 -0
- package/src/nodes/ia/tool/function.js +36 -0
- package/src/nodes/ia/tool/index.d.ts +3 -0
- package/src/nodes/ia/tool/index.d.ts.map +1 -0
- package/src/nodes/ia/tool/index.js +2 -0
- package/src/nodes/index.d.ts +9 -0
- package/src/nodes/index.d.ts.map +1 -0
- package/src/nodes/index.js +8 -0
- package/src/nodes/inputs/chat/chat.d.ts +4 -0
- package/src/nodes/inputs/chat/chat.d.ts.map +1 -0
- package/src/nodes/inputs/chat/chat.js +51 -0
- package/src/nodes/inputs/http/delete/data.d.ts +3 -0
- package/src/nodes/inputs/http/delete/data.d.ts.map +1 -0
- package/src/nodes/inputs/http/delete/data.js +57 -0
- package/src/nodes/inputs/http/delete/function.d.ts +2 -0
- package/src/nodes/inputs/http/delete/function.d.ts.map +1 -0
- package/src/nodes/inputs/http/delete/function.js +28 -0
- package/src/nodes/inputs/http/delete/index.d.ts +4 -0
- package/src/nodes/inputs/http/delete/index.d.ts.map +1 -0
- package/src/nodes/inputs/http/delete/index.js +3 -0
- package/src/nodes/inputs/http/delete/schema.d.ts +16 -0
- package/src/nodes/inputs/http/delete/schema.d.ts.map +1 -0
- package/src/nodes/inputs/http/delete/schema.js +7 -0
- package/src/nodes/inputs/http/get/data.d.ts +3 -0
- package/src/nodes/inputs/http/get/data.d.ts.map +1 -0
- package/src/nodes/inputs/http/get/data.js +58 -0
- package/src/nodes/inputs/http/get/function.d.ts +2 -0
- package/src/nodes/inputs/http/get/function.d.ts.map +1 -0
- package/src/nodes/inputs/http/get/function.js +25 -0
- package/src/nodes/inputs/http/get/index.d.ts +4 -0
- package/src/nodes/inputs/http/get/index.d.ts.map +1 -0
- package/src/nodes/inputs/http/get/index.js +3 -0
- package/src/nodes/inputs/http/get/schema.d.ts +16 -0
- package/src/nodes/inputs/http/get/schema.d.ts.map +1 -0
- package/src/nodes/inputs/http/get/schema.js +7 -0
- package/src/nodes/inputs/http/index.d.ts +8 -0
- package/src/nodes/inputs/http/index.d.ts.map +1 -0
- package/src/nodes/inputs/http/index.js +10 -0
- package/src/nodes/inputs/http/patch/data.d.ts +3 -0
- package/src/nodes/inputs/http/patch/data.d.ts.map +1 -0
- package/src/nodes/inputs/http/patch/data.js +70 -0
- package/src/nodes/inputs/http/patch/function.d.ts +2 -0
- package/src/nodes/inputs/http/patch/function.d.ts.map +1 -0
- package/src/nodes/inputs/http/patch/function.js +36 -0
- package/src/nodes/inputs/http/patch/index.d.ts +4 -0
- package/src/nodes/inputs/http/patch/index.d.ts.map +1 -0
- package/src/nodes/inputs/http/patch/index.js +3 -0
- package/src/nodes/inputs/http/patch/schema.d.ts +21 -0
- package/src/nodes/inputs/http/patch/schema.d.ts.map +1 -0
- package/src/nodes/inputs/http/patch/schema.js +8 -0
- package/src/nodes/inputs/http/post/data.d.ts +3 -0
- package/src/nodes/inputs/http/post/data.d.ts.map +1 -0
- package/src/nodes/inputs/http/post/data.js +70 -0
- package/src/nodes/inputs/http/post/function.d.ts +2 -0
- package/src/nodes/inputs/http/post/function.d.ts.map +1 -0
- package/src/nodes/inputs/http/post/function.js +36 -0
- package/src/nodes/inputs/http/post/index.d.ts +4 -0
- package/src/nodes/inputs/http/post/index.d.ts.map +1 -0
- package/src/nodes/inputs/http/post/index.js +3 -0
- package/src/nodes/inputs/http/post/schema.d.ts +21 -0
- package/src/nodes/inputs/http/post/schema.d.ts.map +1 -0
- package/src/nodes/inputs/http/post/schema.js +8 -0
- package/src/nodes/inputs/http/put/data.d.ts +3 -0
- package/src/nodes/inputs/http/put/data.d.ts.map +1 -0
- package/src/nodes/inputs/http/put/data.js +70 -0
- package/src/nodes/inputs/http/put/function.d.ts +2 -0
- package/src/nodes/inputs/http/put/function.d.ts.map +1 -0
- package/src/nodes/inputs/http/put/function.js +36 -0
- package/src/nodes/inputs/http/put/index.d.ts +4 -0
- package/src/nodes/inputs/http/put/index.d.ts.map +1 -0
- package/src/nodes/inputs/http/put/index.js +3 -0
- package/src/nodes/inputs/http/put/schema.d.ts +21 -0
- package/src/nodes/inputs/http/put/schema.d.ts.map +1 -0
- package/src/nodes/inputs/http/put/schema.js +8 -0
- package/src/nodes/inputs/http/schemas.d.ts +18 -0
- package/src/nodes/inputs/http/schemas.d.ts.map +1 -0
- package/src/nodes/inputs/http/schemas.js +17 -0
- package/src/nodes/inputs/http/utils.d.ts +21 -0
- package/src/nodes/inputs/http/utils.d.ts.map +1 -0
- package/src/nodes/inputs/http/utils.js +63 -0
- package/src/nodes/inputs/index.d.ts +5 -0
- package/src/nodes/inputs/index.d.ts.map +1 -0
- package/src/nodes/inputs/index.js +4 -0
- package/src/nodes/inputs/manual/trigger.d.ts +4 -0
- package/src/nodes/inputs/manual/trigger.d.ts.map +1 -0
- package/src/nodes/inputs/manual/trigger.js +39 -0
- package/src/nodes/output-node/index.d.ts +4 -0
- package/src/nodes/output-node/index.d.ts.map +1 -0
- package/src/nodes/output-node/index.js +123 -0
- package/src/nodes/outputs/chat/output.d.ts +4 -0
- package/src/nodes/outputs/chat/output.d.ts.map +1 -0
- package/src/nodes/outputs/chat/output.js +48 -0
- package/src/nodes/outputs/http-output.d.ts +4 -0
- package/src/nodes/outputs/http-output.d.ts.map +1 -0
- package/src/nodes/outputs/http-output.js +76 -0
- package/src/nodes/processors/concat.d.ts +9 -0
- package/src/nodes/processors/concat.d.ts.map +1 -0
- package/src/nodes/processors/concat.js +68 -0
- package/src/nodes/processors/custom-code.d.ts +4 -0
- package/src/nodes/processors/custom-code.d.ts.map +1 -0
- package/src/nodes/processors/custom-code.js +54 -0
- package/src/nodes/processors/index.d.ts +2 -0
- package/src/nodes/processors/index.d.ts.map +1 -0
- package/src/nodes/processors/index.js +1 -0
- package/src/nodes/processors/transform.d.ts +3 -0
- package/src/nodes/processors/transform.d.ts.map +1 -0
- package/src/nodes/processors/transform.js +48 -0
- package/src/nodes/social/index.d.ts +2 -0
- package/src/nodes/social/index.d.ts.map +1 -0
- package/src/nodes/social/index.js +1 -0
- package/src/nodes/social/whatsapp/index.d.ts +4 -0
- package/src/nodes/social/whatsapp/index.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/index.js +3 -0
- package/src/nodes/social/whatsapp/message-trigger/data.d.ts +3 -0
- package/src/nodes/social/whatsapp/message-trigger/data.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/message-trigger/data.js +55 -0
- package/src/nodes/social/whatsapp/message-trigger/index.d.ts +2 -0
- package/src/nodes/social/whatsapp/message-trigger/index.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/message-trigger/index.js +1 -0
- package/src/nodes/social/whatsapp/send-message/data.d.ts +8 -0
- package/src/nodes/social/whatsapp/send-message/data.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/send-message/data.js +46 -0
- package/src/nodes/social/whatsapp/send-message/functions.d.ts +3 -0
- package/src/nodes/social/whatsapp/send-message/functions.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/send-message/functions.js +32 -0
- package/src/nodes/social/whatsapp/send-message/index.d.ts +3 -0
- package/src/nodes/social/whatsapp/send-message/index.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/send-message/index.js +2 -0
- package/src/nodes/social/whatsapp/send-template/data.d.ts +8 -0
- package/src/nodes/social/whatsapp/send-template/data.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/send-template/data.js +42 -0
- package/src/nodes/social/whatsapp/send-template/functions.d.ts +5 -0
- package/src/nodes/social/whatsapp/send-template/functions.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/send-template/functions.js +60 -0
- package/src/nodes/social/whatsapp/send-template/index.d.ts +3 -0
- package/src/nodes/social/whatsapp/send-template/index.d.ts.map +1 -0
- package/src/nodes/social/whatsapp/send-template/index.js +2 -0
- package/src/nodes/types/base-node.d.ts +17 -0
- package/src/nodes/types/base-node.d.ts.map +1 -0
- package/src/nodes/types/base-node.js +1 -0
- package/src/nodes/types/base-node.types.d.ts +144 -0
- package/src/nodes/types/base-node.types.d.ts.map +1 -0
- package/src/nodes/types/base-node.types.js +1 -0
- package/src/utils/llm-factory.d.ts +16 -0
- package/src/utils/llm-factory.d.ts.map +1 -0
- package/src/utils/llm-factory.js +110 -0
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomoz/workflows-nodes",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Atomoz Workflows - Node Library",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./
|
|
7
|
-
"module": "./
|
|
8
|
-
"types": "./
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"module": "./src/index.js",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./
|
|
12
|
-
"import": "./
|
|
13
|
-
"require": "./
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"import": "./src/index.js",
|
|
13
|
+
"require": "./src/index.js",
|
|
14
14
|
"default": "./index.js"
|
|
15
15
|
},
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
-
"
|
|
19
|
+
"src"
|
|
20
20
|
],
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"publishConfig": {
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/nodes/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './nodes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/consts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-colors.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/consts/node-colors.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;CAIlB,CAAA;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const nodeFunctions: {
|
|
2
|
+
ChatInput: (params: any) => any;
|
|
3
|
+
ChatOutput: (params: any) => Promise<any>;
|
|
4
|
+
HttpGetInput: (params: any) => Promise<any>;
|
|
5
|
+
HttpPostInput: (params: any) => any;
|
|
6
|
+
ManualTrigger: (params: any) => any;
|
|
7
|
+
HttpOutput: (params: any) => any;
|
|
8
|
+
ConcatNode: (inputs: any) => any;
|
|
9
|
+
IaMessageNode: (inputs: any) => Promise<any>;
|
|
10
|
+
IaAgentNode: (inputs: any) => Promise<any>;
|
|
11
|
+
AiToolNode: (fieldValues: any) => Promise<{
|
|
12
|
+
tool: any;
|
|
13
|
+
}>;
|
|
14
|
+
AiSupervisorNode: (fieldValues: any) => Promise<any>;
|
|
15
|
+
WhatsappNode: (fieldValues: any) => Promise<any>;
|
|
16
|
+
WhatsappSendMessageNode: (fieldValues: any) => Promise<any>;
|
|
17
|
+
CustomCodeNode: (params: any) => any;
|
|
18
|
+
};
|
|
19
|
+
export default nodeFunctions;
|
|
20
|
+
//# sourceMappingURL=node-functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-functions.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/consts/node-functions.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;CAelB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HttpPostInputNodeFunction } from "../inputs";
|
|
2
|
+
import { ChatInputNodeFunction } from "../inputs/chat/chat";
|
|
3
|
+
import { HttpGetInputNodeFunction } from "../inputs/http/get";
|
|
4
|
+
import { HttpOutputNodeFunction } from "../output-node";
|
|
5
|
+
import { ConcatNodeFunction } from "../processors/concat";
|
|
6
|
+
import { IaMessageNodeFunction, IaAgentNodeFunction, AiToolNodeFunction, AiSupervisorNodeFunction } from "../ia";
|
|
7
|
+
import { ChatOutputNodeFunction } from "../outputs/chat/output";
|
|
8
|
+
import { WhatsappStartChatFunction } from "../social/whatsapp/send-template/functions";
|
|
9
|
+
import { WhatsappSendMessageFunction } from "../social/whatsapp/send-message/functions";
|
|
10
|
+
// import { WhatsappMessageTriggerFunction } from "../social/whatsapp/message-trigger/functions";
|
|
11
|
+
import { ManualTriggerNodeFunction } from "../inputs/manual/trigger";
|
|
12
|
+
import { NodeFunction as CustomCodeNodeFunction } from "../processors/custom-code";
|
|
13
|
+
const nodeFunctions = {
|
|
14
|
+
ChatInput: ChatInputNodeFunction,
|
|
15
|
+
ChatOutput: ChatOutputNodeFunction,
|
|
16
|
+
HttpGetInput: HttpGetInputNodeFunction,
|
|
17
|
+
HttpPostInput: HttpPostInputNodeFunction,
|
|
18
|
+
ManualTrigger: ManualTriggerNodeFunction,
|
|
19
|
+
HttpOutput: HttpOutputNodeFunction,
|
|
20
|
+
ConcatNode: ConcatNodeFunction,
|
|
21
|
+
IaMessageNode: IaMessageNodeFunction,
|
|
22
|
+
IaAgentNode: IaAgentNodeFunction,
|
|
23
|
+
AiToolNode: AiToolNodeFunction,
|
|
24
|
+
AiSupervisorNode: AiSupervisorNodeFunction,
|
|
25
|
+
WhatsappNode: WhatsappStartChatFunction,
|
|
26
|
+
WhatsappSendMessageNode: WhatsappSendMessageFunction,
|
|
27
|
+
CustomCodeNode: CustomCodeNodeFunction,
|
|
28
|
+
};
|
|
29
|
+
export default nodeFunctions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/consts/nodes.ts"],"names":[],"mappings":"AAiBA,QAAA,MAAM,KAAK,yBAiBV,CAAA;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HttpGetInputNode } from "../inputs";
|
|
2
|
+
import { ManualTriggerNode } from "../inputs/manual/trigger";
|
|
3
|
+
import { ChatInputNode } from "../inputs/chat/chat";
|
|
4
|
+
import { ConcatNode } from "../processors/concat";
|
|
5
|
+
import { OutputNode } from "../output-node";
|
|
6
|
+
import { ChatOutputNode } from "../outputs/chat/output";
|
|
7
|
+
import { IaMessageNode, IaAgentNode, AiToolNode, AiSupervisorNode } from "../ia";
|
|
8
|
+
import { WhatsappSendTemplateNode } from "../social/whatsapp/send-template/data";
|
|
9
|
+
import { WhatsappSendMessageNode } from "../social/whatsapp/send-message/data";
|
|
10
|
+
import { WhatsappMessageTriggerNode } from "../social/whatsapp/message-trigger/data";
|
|
11
|
+
import { CustomCodeNode } from "../processors/custom-code";
|
|
12
|
+
const nodes = [
|
|
13
|
+
ChatInputNode,
|
|
14
|
+
ManualTriggerNode,
|
|
15
|
+
HttpGetInputNode,
|
|
16
|
+
// HttpPostInputNode,
|
|
17
|
+
// TransformNode,
|
|
18
|
+
ConcatNode,
|
|
19
|
+
OutputNode,
|
|
20
|
+
ChatOutputNode,
|
|
21
|
+
IaMessageNode,
|
|
22
|
+
IaAgentNode,
|
|
23
|
+
AiToolNode,
|
|
24
|
+
AiSupervisorNode,
|
|
25
|
+
WhatsappSendTemplateNode,
|
|
26
|
+
WhatsappSendMessageNode,
|
|
27
|
+
WhatsappMessageTriggerNode,
|
|
28
|
+
CustomCodeNode,
|
|
29
|
+
];
|
|
30
|
+
export default nodes;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const schemas: {
|
|
2
|
+
IaAgentNode: import("zod").ZodObject<{
|
|
3
|
+
name: import("zod").ZodString;
|
|
4
|
+
systemMessage: import("zod").ZodOptional<import("zod").ZodString>;
|
|
5
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
model: import("zod").ZodAny;
|
|
7
|
+
tools: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
8
|
+
}, import("zod/v4/core").$strip>;
|
|
9
|
+
AiSupervisorNode: import("zod").ZodObject<{
|
|
10
|
+
model: import("zod").ZodAny;
|
|
11
|
+
agents: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
12
|
+
message: import("zod").ZodString;
|
|
13
|
+
systemMessage: import("zod").ZodOptional<import("zod").ZodString>;
|
|
14
|
+
}, import("zod/v4/core").$strip>;
|
|
15
|
+
AiToolNode: import("zod").ZodObject<{
|
|
16
|
+
name: import("zod").ZodString;
|
|
17
|
+
description: import("zod").ZodString;
|
|
18
|
+
nodeFunction: import("zod").ZodAny;
|
|
19
|
+
nodeType: import("zod").ZodString;
|
|
20
|
+
originalNodeData: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
21
|
+
workflowService: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
22
|
+
currentResults: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
23
|
+
}, import("zod/v4/core").$strip>;
|
|
24
|
+
IaMessageNode: import("zod").ZodObject<{
|
|
25
|
+
model: import("zod").ZodAny;
|
|
26
|
+
systemMessage: import("zod").ZodOptional<import("zod").ZodString>;
|
|
27
|
+
message: import("zod").ZodString;
|
|
28
|
+
}, import("zod/v4/core").$strip>;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/consts/schemas.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKnB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IaAgentNodeSchema, AiSupervisorNodeSchema, AiToolNodeSchema, IaMessageNodeSchema } from "../ia";
|
|
2
|
+
export const schemas = {
|
|
3
|
+
IaAgentNode: IaAgentNodeSchema,
|
|
4
|
+
AiSupervisorNode: AiSupervisorNodeSchema,
|
|
5
|
+
AiToolNode: AiToolNodeSchema,
|
|
6
|
+
IaMessageNode: IaMessageNodeSchema,
|
|
7
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NodeData } from "../../types/base-node";
|
|
3
|
+
export declare const IaAgentNodeSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
systemMessage: z.ZodOptional<z.ZodString>;
|
|
6
|
+
message: z.ZodOptional<z.ZodString>;
|
|
7
|
+
model: z.ZodAny;
|
|
8
|
+
tools: z.ZodOptional<z.ZodAny>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const IaAgentNode: NodeData;
|
|
11
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/ia/agent/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,QAsGzB,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const IaAgentNodeSchema = z.object({
|
|
3
|
+
name: z.string().describe("Unique name for the agent"),
|
|
4
|
+
systemMessage: z.string().optional().describe("System context for the agent"),
|
|
5
|
+
message: z.string().optional().describe("Input message for the agent"),
|
|
6
|
+
model: z.any().describe("LLM model for the agent"),
|
|
7
|
+
tools: z.any().optional().describe("Tools available to the agent"),
|
|
8
|
+
});
|
|
9
|
+
export const IaAgentNode = {
|
|
10
|
+
label: "IA Agent",
|
|
11
|
+
type: "IaAgentNode",
|
|
12
|
+
category: "step",
|
|
13
|
+
description: "Creates a configurable AI agent for supervision",
|
|
14
|
+
icon: "🤖",
|
|
15
|
+
toolable: true,
|
|
16
|
+
group: 'IA',
|
|
17
|
+
tags: {
|
|
18
|
+
execution: 'async',
|
|
19
|
+
group: 'IA'
|
|
20
|
+
},
|
|
21
|
+
fields: [
|
|
22
|
+
{
|
|
23
|
+
id: "name",
|
|
24
|
+
label: "Agent Name",
|
|
25
|
+
type: "string",
|
|
26
|
+
required: true,
|
|
27
|
+
placeholder: "e.g., researcher_agent"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "systemMessage",
|
|
31
|
+
label: "System Message",
|
|
32
|
+
type: "textarea",
|
|
33
|
+
required: true,
|
|
34
|
+
placeholder: "You are a web researcher...",
|
|
35
|
+
handle: {
|
|
36
|
+
type: "input",
|
|
37
|
+
label: "System Message",
|
|
38
|
+
name: "systemMessage",
|
|
39
|
+
fieldType: "string",
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "message",
|
|
44
|
+
label: "Message",
|
|
45
|
+
type: "string",
|
|
46
|
+
required: false,
|
|
47
|
+
typeable: false,
|
|
48
|
+
handle: {
|
|
49
|
+
type: "input",
|
|
50
|
+
label: "Message",
|
|
51
|
+
name: "message",
|
|
52
|
+
fieldType: "string",
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "model",
|
|
57
|
+
label: "Model",
|
|
58
|
+
type: "model",
|
|
59
|
+
typeable: false,
|
|
60
|
+
required: true,
|
|
61
|
+
handle: {
|
|
62
|
+
type: "input",
|
|
63
|
+
label: "Model",
|
|
64
|
+
name: "model",
|
|
65
|
+
fieldType: "model",
|
|
66
|
+
acceptTypes: ["model"],
|
|
67
|
+
maxConnections: 1,
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'tools',
|
|
72
|
+
label: 'Tools',
|
|
73
|
+
type: 'tool',
|
|
74
|
+
required: false,
|
|
75
|
+
typeable: false,
|
|
76
|
+
handle: {
|
|
77
|
+
type: 'input',
|
|
78
|
+
label: 'Tools',
|
|
79
|
+
name: 'tools',
|
|
80
|
+
fieldType: 'tool',
|
|
81
|
+
acceptTypes: ['tool'],
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'agent',
|
|
86
|
+
label: 'Agent',
|
|
87
|
+
type: 'agent',
|
|
88
|
+
required: true,
|
|
89
|
+
typeable: false,
|
|
90
|
+
handle: {
|
|
91
|
+
type: 'output',
|
|
92
|
+
label: 'Agent',
|
|
93
|
+
name: 'agent',
|
|
94
|
+
fieldType: 'agent',
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'response',
|
|
99
|
+
label: 'Response',
|
|
100
|
+
type: 'string',
|
|
101
|
+
required: true,
|
|
102
|
+
typeable: false,
|
|
103
|
+
handle: {
|
|
104
|
+
type: 'output',
|
|
105
|
+
label: 'response',
|
|
106
|
+
name: 'response',
|
|
107
|
+
fieldType: 'string',
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/ia/agent/function.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,GAAU,QAAQ,GAAG,KAAG,OAAO,CAAC,GAAG,CAyFlE,CAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { createReactAgent } from "@langchain/langgraph/prebuilt";
|
|
3
|
+
import { SystemMessage } from "@langchain/core/messages";
|
|
4
|
+
import { createLLMFromModel } from "../../../utils/llm-factory";
|
|
5
|
+
export const IaAgentNodeFunction = async (inputs) => {
|
|
6
|
+
const { model, tools, systemMessage, name, message } = inputs.fieldValues;
|
|
7
|
+
const authToken = inputs.authToken;
|
|
8
|
+
if (!name) {
|
|
9
|
+
throw new Error("Agent 'name' is required. Please provide a unique name for the agent in the node properties.");
|
|
10
|
+
}
|
|
11
|
+
if (!model) {
|
|
12
|
+
throw new Error("Model is required for IaAgentNode");
|
|
13
|
+
}
|
|
14
|
+
let toolsArray = [];
|
|
15
|
+
if (Array.isArray(tools)) {
|
|
16
|
+
toolsArray = tools;
|
|
17
|
+
}
|
|
18
|
+
else if (tools) {
|
|
19
|
+
toolsArray = [tools];
|
|
20
|
+
}
|
|
21
|
+
const finalSystemMessageContent = `${systemMessage || ''}\n\nIMPORTANT: You must base your response on the last message in the conversation history.`;
|
|
22
|
+
const finalSystemMessage = new SystemMessage(finalSystemMessageContent);
|
|
23
|
+
// Instanciar LLM a partir do model config
|
|
24
|
+
let llmInstance;
|
|
25
|
+
if (model?.integrationId) {
|
|
26
|
+
// Model é um objeto com integrationId, criar instância
|
|
27
|
+
if (!authToken) {
|
|
28
|
+
throw new Error("Auth token is required to instantiate LLM from integration");
|
|
29
|
+
}
|
|
30
|
+
const streaming = Boolean(inputs?.stream);
|
|
31
|
+
llmInstance = await createLLMFromModel(model, authToken, streaming);
|
|
32
|
+
}
|
|
33
|
+
else if (typeof model?.bindTools === 'function') {
|
|
34
|
+
// Model já é uma instância de LLM válida
|
|
35
|
+
llmInstance = model;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
throw new Error("Invalid model: must have integrationId or be a valid LLM instance with bindTools method");
|
|
39
|
+
}
|
|
40
|
+
const agent = createReactAgent({
|
|
41
|
+
llm: llmInstance,
|
|
42
|
+
tools: toolsArray,
|
|
43
|
+
messageModifier: finalSystemMessage,
|
|
44
|
+
});
|
|
45
|
+
// Add the name to the agent so the supervisor can identify it
|
|
46
|
+
agent.name = name;
|
|
47
|
+
// If a message is provided, process it and return both agent and output
|
|
48
|
+
let output = '';
|
|
49
|
+
if (message) {
|
|
50
|
+
try {
|
|
51
|
+
const { HumanMessage } = await import("@langchain/core/messages");
|
|
52
|
+
const result = await agent.invoke({
|
|
53
|
+
messages: [new HumanMessage(message)]
|
|
54
|
+
});
|
|
55
|
+
// Extract the response from the result
|
|
56
|
+
if (result?.messages && result.messages.length > 0) {
|
|
57
|
+
const lastMessage = result.messages[result.messages.length - 1];
|
|
58
|
+
const content = lastMessage?.content;
|
|
59
|
+
// Handle different content types
|
|
60
|
+
if (typeof content === 'string') {
|
|
61
|
+
output = content;
|
|
62
|
+
}
|
|
63
|
+
else if (Array.isArray(content)) {
|
|
64
|
+
// Extract text from complex content array
|
|
65
|
+
output = content
|
|
66
|
+
.map((part) => {
|
|
67
|
+
if (typeof part === 'string')
|
|
68
|
+
return part;
|
|
69
|
+
if (part?.type === 'text')
|
|
70
|
+
return part.text;
|
|
71
|
+
return '';
|
|
72
|
+
})
|
|
73
|
+
.filter(Boolean)
|
|
74
|
+
.join('\n');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
output = '';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error('Error processing message in agent:', error);
|
|
83
|
+
output = `Error: ${error instanceof Error ? error.message : 'Unknown error'}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
agent: agent,
|
|
88
|
+
output: output || ''
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/ia/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/ia/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/ia/message/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './message';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NodeData } from "../../types/base-node";
|
|
3
|
+
export declare const IaMessageNodeSchema: z.ZodObject<{
|
|
4
|
+
model: z.ZodAny;
|
|
5
|
+
systemMessage: z.ZodOptional<z.ZodString>;
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const IaMessageNodeFunction: (inputs: any) => Promise<any>;
|
|
9
|
+
export declare const IaMessageNode: NodeData;
|
|
10
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/ia/message/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AAEH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,GAAG,KAAG,OAAO,CAAC,GAAG,CA+CpE,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,QAoE3B,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createLLMFromModel } from "../../../utils/llm-factory";
|
|
3
|
+
export const IaMessageNodeSchema = z.object({
|
|
4
|
+
model: z.any().describe("LLM model to use"),
|
|
5
|
+
systemMessage: z.string().optional().describe("System message for context"),
|
|
6
|
+
message: z.string().describe("User message to send to the LLM"),
|
|
7
|
+
});
|
|
8
|
+
export const IaMessageNodeFunction = async (inputs) => {
|
|
9
|
+
const fieldValues = inputs.fieldValues || inputs;
|
|
10
|
+
const { model, systemMessage, message } = fieldValues;
|
|
11
|
+
const authToken = inputs.authToken;
|
|
12
|
+
if (!model) {
|
|
13
|
+
throw new Error("Model is required");
|
|
14
|
+
}
|
|
15
|
+
if (!message) {
|
|
16
|
+
throw new Error("Message is required");
|
|
17
|
+
}
|
|
18
|
+
// Instanciar LLM a partir do model config
|
|
19
|
+
let llmInstance;
|
|
20
|
+
if (model?.model && model?.integrationId) {
|
|
21
|
+
// Model é um objeto com integrationId, criar instância
|
|
22
|
+
if (!authToken) {
|
|
23
|
+
throw new Error("Auth token is required to instantiate LLM from integration2 ");
|
|
24
|
+
}
|
|
25
|
+
const streaming = Boolean(inputs?.stream);
|
|
26
|
+
llmInstance = await createLLMFromModel(model, authToken, streaming);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// Model já é uma instância de LLM
|
|
30
|
+
llmInstance = model;
|
|
31
|
+
}
|
|
32
|
+
const messages = [];
|
|
33
|
+
if (systemMessage) {
|
|
34
|
+
messages.push(["system", systemMessage]);
|
|
35
|
+
}
|
|
36
|
+
messages.push(["human", message]);
|
|
37
|
+
try {
|
|
38
|
+
const response = await llmInstance.invoke(messages);
|
|
39
|
+
return {
|
|
40
|
+
output: response.content,
|
|
41
|
+
response: response.content,
|
|
42
|
+
fullResponse: response
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
47
|
+
throw new Error(`Error invoking Model: ${errorMessage}`);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export const IaMessageNode = {
|
|
51
|
+
label: 'AI Message',
|
|
52
|
+
type: 'IaMessageNode',
|
|
53
|
+
category: 'step',
|
|
54
|
+
description: 'Send message to AI model and return response',
|
|
55
|
+
icon: '💬',
|
|
56
|
+
group: 'IA',
|
|
57
|
+
tags: {
|
|
58
|
+
execution: 'async',
|
|
59
|
+
group: 'IA'
|
|
60
|
+
},
|
|
61
|
+
fields: [
|
|
62
|
+
{
|
|
63
|
+
id: 'model',
|
|
64
|
+
label: 'Model',
|
|
65
|
+
type: 'model',
|
|
66
|
+
required: true,
|
|
67
|
+
typeable: false,
|
|
68
|
+
handle: {
|
|
69
|
+
type: 'input',
|
|
70
|
+
label: 'Model',
|
|
71
|
+
name: 'model',
|
|
72
|
+
fieldType: 'model',
|
|
73
|
+
acceptTypes: ['model'],
|
|
74
|
+
maxConnections: 1,
|
|
75
|
+
required: true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'systemMessage',
|
|
80
|
+
label: 'System Message',
|
|
81
|
+
type: 'string',
|
|
82
|
+
required: false,
|
|
83
|
+
placeholder: 'You are a helpful assistant...',
|
|
84
|
+
handle: {
|
|
85
|
+
type: 'input',
|
|
86
|
+
label: 'System Message',
|
|
87
|
+
name: 'systemMessage',
|
|
88
|
+
fieldType: 'string',
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'message',
|
|
93
|
+
label: 'Message',
|
|
94
|
+
type: 'string',
|
|
95
|
+
required: true,
|
|
96
|
+
placeholder: 'Type your message...',
|
|
97
|
+
handle: {
|
|
98
|
+
type: 'input',
|
|
99
|
+
label: 'Message',
|
|
100
|
+
name: 'message',
|
|
101
|
+
fieldType: 'string'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'response',
|
|
106
|
+
label: 'Response',
|
|
107
|
+
type: 'string',
|
|
108
|
+
required: true,
|
|
109
|
+
typeable: false,
|
|
110
|
+
handle: {
|
|
111
|
+
type: 'output',
|
|
112
|
+
label: 'response',
|
|
113
|
+
name: 'response',
|
|
114
|
+
fieldType: 'string',
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NodeData } from "../../types/base-node";
|
|
3
|
+
export declare const AiSupervisorNodeSchema: z.ZodObject<{
|
|
4
|
+
model: z.ZodAny;
|
|
5
|
+
agents: z.ZodOptional<z.ZodAny>;
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
systemMessage: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const AiSupervisorNode: NodeData;
|
|
10
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/ia/supervisor/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,QA4E9B,CAAC"}
|