@minded-ai/mindedjs 1.0.120 → 1.0.122-beta-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/agent.d.ts +4 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +70 -10
- package/dist/agent.js.map +1 -1
- package/dist/browserTask/README.md +419 -0
- package/dist/browserTask/browserAgent.py +632 -0
- package/dist/browserTask/captcha_isolated.png +0 -0
- package/dist/browserTask/executeBrowserTask.ts +79 -0
- package/dist/browserTask/requirements.txt +8 -0
- package/dist/browserTask/setup.sh +144 -0
- package/dist/cli/index.js +14 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/edges/createLogicalRouter.js +1 -1
- package/dist/edges/createLogicalRouter.js.map +1 -1
- package/dist/edges/createPromptRouter.d.ts.map +1 -1
- package/dist/edges/createPromptRouter.js +0 -7
- package/dist/edges/createPromptRouter.js.map +1 -1
- package/dist/edges/edgeFactory.js +2 -2
- package/dist/edges/edgeFactory.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/internalTools/retell.js +17 -7
- package/dist/internalTools/retell.js.map +1 -1
- package/dist/internalTools/sendPlaceholderMessage.js +17 -7
- package/dist/internalTools/sendPlaceholderMessage.js.map +1 -1
- package/dist/internalTools/voice/escalateVoiceCall.d.ts +2 -0
- package/dist/internalTools/voice/escalateVoiceCall.d.ts.map +1 -0
- package/dist/internalTools/voice/escalateVoiceCall.js +42 -0
- package/dist/internalTools/voice/escalateVoiceCall.js.map +1 -0
- package/dist/internalTools/voice/retell.d.ts +12 -0
- package/dist/internalTools/voice/retell.d.ts.map +1 -0
- package/dist/internalTools/voice/retell.js +44 -0
- package/dist/internalTools/voice/retell.js.map +1 -0
- package/dist/internalTools/voice/sendPlaceholderMessage.d.ts +14 -0
- package/dist/internalTools/voice/sendPlaceholderMessage.d.ts.map +1 -0
- package/dist/internalTools/voice/sendPlaceholderMessage.js +51 -0
- package/dist/internalTools/voice/sendPlaceholderMessage.js.map +1 -0
- package/dist/interrupts/BaseInterruptSessionManager.d.ts +52 -0
- package/dist/interrupts/BaseInterruptSessionManager.d.ts.map +1 -0
- package/dist/interrupts/BaseInterruptSessionManager.js +40 -0
- package/dist/interrupts/BaseInterruptSessionManager.js.map +1 -0
- package/dist/interrupts/MemoryInterruptSessionManager.d.ts +14 -0
- package/dist/interrupts/MemoryInterruptSessionManager.d.ts.map +1 -0
- package/dist/interrupts/MemoryInterruptSessionManager.js +60 -0
- package/dist/interrupts/MemoryInterruptSessionManager.js.map +1 -0
- package/dist/interrupts/MindedInterruptSessionManager.d.ts +13 -0
- package/dist/interrupts/MindedInterruptSessionManager.d.ts.map +1 -0
- package/dist/interrupts/MindedInterruptSessionManager.js +151 -0
- package/dist/interrupts/MindedInterruptSessionManager.js.map +1 -0
- package/dist/interrupts/interruptSessionManagerFactory.d.ts +3 -0
- package/dist/interrupts/interruptSessionManagerFactory.d.ts.map +1 -0
- package/dist/interrupts/interruptSessionManagerFactory.js +46 -0
- package/dist/interrupts/interruptSessionManagerFactory.js.map +1 -0
- package/dist/nodes/addAppToolNode.d.ts.map +1 -1
- package/dist/nodes/addAppToolNode.js +7 -13
- package/dist/nodes/addAppToolNode.js.map +1 -1
- package/dist/nodes/addBrowserTaskNode.d.ts.map +1 -1
- package/dist/nodes/addBrowserTaskNode.js +7 -74
- package/dist/nodes/addBrowserTaskNode.js.map +1 -1
- package/dist/nodes/addHumanInTheLoopNode.d.ts.map +1 -1
- package/dist/nodes/addHumanInTheLoopNode.js +2 -1
- package/dist/nodes/addHumanInTheLoopNode.js.map +1 -1
- package/dist/nodes/addJumpToNode.js +2 -2
- package/dist/nodes/addJumpToNode.js.map +1 -1
- package/dist/nodes/addPromptNode.d.ts.map +1 -1
- package/dist/nodes/addPromptNode.js +96 -13
- package/dist/nodes/addPromptNode.js.map +1 -1
- package/dist/nodes/addToolNode.d.ts.map +1 -1
- package/dist/nodes/addToolNode.js +12 -13
- package/dist/nodes/addToolNode.js.map +1 -1
- package/dist/nodes/addToolRunNode.d.ts.map +1 -1
- package/dist/nodes/addToolRunNode.js +4 -0
- package/dist/nodes/addToolRunNode.js.map +1 -1
- package/dist/nodes/compilePrompt.d.ts +5 -0
- package/dist/nodes/compilePrompt.d.ts.map +1 -0
- package/dist/nodes/compilePrompt.js +64 -0
- package/dist/nodes/compilePrompt.js.map +1 -0
- package/dist/platform/mindedConnection.js +12 -12
- package/dist/platform/mindedConnection.js.map +1 -1
- package/dist/platform/mindedConnectionTypes.d.ts +151 -1
- package/dist/platform/mindedConnectionTypes.d.ts.map +1 -1
- package/dist/platform/mindedConnectionTypes.js +9 -0
- package/dist/platform/mindedConnectionTypes.js.map +1 -1
- package/dist/playbooks/playbooks.d.ts +2 -2
- package/dist/playbooks/playbooks.d.ts.map +1 -1
- package/dist/playbooks/playbooks.js +37 -45
- package/dist/playbooks/playbooks.js.map +1 -1
- package/dist/types/Agent.types.d.ts +2 -0
- package/dist/types/Agent.types.d.ts.map +1 -1
- package/dist/types/Agent.types.js.map +1 -1
- package/dist/types/LangGraph.types.d.ts +2 -2
- package/dist/types/LangGraph.types.d.ts.map +1 -1
- package/dist/types/LangGraph.types.js +3 -1
- package/dist/types/LangGraph.types.js.map +1 -1
- package/dist/voice/voiceSession.d.ts +0 -1
- package/dist/voice/voiceSession.d.ts.map +1 -1
- package/dist/voice/voiceSession.js +9 -13
- package/dist/voice/voiceSession.js.map +1 -1
- package/docs/low-code-editor/nodes.md +21 -12
- package/docs/low-code-editor/playbooks.md +50 -32
- package/package.json +2 -2
- package/src/agent.ts +87 -13
- package/src/cli/index.ts +14 -14
- package/src/edges/createLogicalRouter.ts +1 -1
- package/src/edges/createPromptRouter.ts +5 -12
- package/src/edges/edgeFactory.ts +2 -2
- package/src/index.ts +4 -3
- package/src/internalTools/voice/escalateVoiceCall.ts +15 -0
- package/src/internalTools/{retell.ts → voice/retell.ts} +2 -2
- package/src/internalTools/{sendPlaceholderMessage.ts → voice/sendPlaceholderMessage.ts} +2 -2
- package/src/interrupts/BaseInterruptSessionManager.ts +96 -0
- package/src/interrupts/MemoryInterruptSessionManager.ts +63 -0
- package/src/interrupts/MindedInterruptSessionManager.ts +162 -0
- package/src/interrupts/interruptSessionManagerFactory.ts +20 -0
- package/src/nodes/addAppToolNode.ts +10 -13
- package/src/nodes/addBrowserTaskNode.ts +7 -56
- package/src/nodes/addHumanInTheLoopNode.ts +2 -1
- package/src/nodes/addJumpToNode.ts +2 -2
- package/src/nodes/addPromptNode.ts +104 -18
- package/src/nodes/addToolNode.ts +12 -14
- package/src/nodes/addToolRunNode.ts +4 -1
- package/src/nodes/compilePrompt.ts +41 -0
- package/src/platform/mindedConnection.ts +12 -12
- package/src/platform/mindedConnectionTypes.ts +187 -0
- package/src/playbooks/playbooks.ts +38 -48
- package/src/types/Agent.types.ts +2 -0
- package/src/types/LangGraph.types.ts +3 -1
- package/src/voice/voiceSession.ts +9 -14
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.createInterruptSessionManager = createInterruptSessionManager;
|
|
27
|
+
const MemoryInterruptSessionManager_1 = require("./MemoryInterruptSessionManager");
|
|
28
|
+
const MindedInterruptSessionManager_1 = require("./MindedInterruptSessionManager");
|
|
29
|
+
const mindedConnection = __importStar(require("../platform/mindedConnection"));
|
|
30
|
+
const config_1 = require("../platform/config");
|
|
31
|
+
const logger_1 = require("../utils/logger");
|
|
32
|
+
function createInterruptSessionManager() {
|
|
33
|
+
const { runLocally } = (0, config_1.getConfig)();
|
|
34
|
+
if (runLocally) {
|
|
35
|
+
logger_1.logger.info({ msg: 'Using memory interrupt session manager' });
|
|
36
|
+
return new MemoryInterruptSessionManager_1.MemoryInterruptSessionManager();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (!mindedConnection.isConnected()) {
|
|
40
|
+
throw new Error('MindedConnection is required for platform interrupt session manager');
|
|
41
|
+
}
|
|
42
|
+
logger_1.logger.info({ msg: 'Using Minded interrupt session manager' });
|
|
43
|
+
return new MindedInterruptSessionManager_1.MindedInterruptSessionManager();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=interruptSessionManagerFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interruptSessionManagerFactory.js","sourceRoot":"","sources":["../../src/interrupts/interruptSessionManagerFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,sEAYC;AAlBD,mFAAgF;AAChF,mFAAgF;AAChF,+EAAiE;AACjE,+CAA+C;AAC/C,4CAAyC;AAEzC,SAAgB,6BAA6B;IAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IACnC,IAAI,UAAU,EAAE,CAAC;QACf,eAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,wCAAwC,EAAE,CAAC,CAAC;QAC/D,OAAO,IAAI,6DAA6B,EAAE,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACzF,CAAC;QACD,eAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,wCAAwC,EAAE,CAAC,CAAC;QAC/D,OAAO,IAAI,6DAA6B,EAAE,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAppToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAY,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAI7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"addAppToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAY,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAI7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAI5C,eAAO,MAAM,cAAc,wCAMxB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;CACzB,kBA2EA,CAAC"}
|
|
@@ -5,8 +5,9 @@ const Flows_types_1 = require("../types/Flows.types");
|
|
|
5
5
|
const tools_1 = require("@langchain/core/tools");
|
|
6
6
|
const messages_1 = require("@langchain/core/messages");
|
|
7
7
|
const logger_1 = require("../utils/logger");
|
|
8
|
-
const playbooks_1 = require("../playbooks/playbooks");
|
|
9
8
|
const history_1 = require("../utils/history");
|
|
9
|
+
const playbooks_1 = require("../playbooks/playbooks");
|
|
10
|
+
const compilePrompt_1 = require("./compilePrompt");
|
|
10
11
|
const addAppToolNode = async ({ graph, node, llm, agent, tools, }) => {
|
|
11
12
|
const cleanedParameters = Object.fromEntries(Object.entries(node.parameters || {}).filter(([, value]) => value !== ''));
|
|
12
13
|
// Find the tool from the tools array by name
|
|
@@ -31,13 +32,8 @@ const addAppToolNode = async ({ graph, node, llm, agent, tools, }) => {
|
|
|
31
32
|
description: appRunnerTool.description,
|
|
32
33
|
schema: appRunnerTool.input,
|
|
33
34
|
});
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
...state.memory, // Spread memory fields at the top level
|
|
37
|
-
currentTime: new Date().toISOString(),
|
|
38
|
-
};
|
|
39
|
-
const compiledPlaybooks = (0, playbooks_1.compilePlaybooks)(agent.playbooks, playbookParams) || '';
|
|
40
|
-
const message = `${compiledPlaybooks ? compiledPlaybooks + '\n\n' : ''}
|
|
35
|
+
const combinedPlaybooks = (0, playbooks_1.combinePlaybooks)(agent.playbooks) || '';
|
|
36
|
+
const message = `${combinedPlaybooks ? combinedPlaybooks + '\n\n' : ''}
|
|
41
37
|
Additional context:
|
|
42
38
|
previous messages are available for context.
|
|
43
39
|
Your goal is execute the tool with the correct parameters, some of them already chosen by the user and the rest should be generated.
|
|
@@ -49,15 +45,13 @@ const addAppToolNode = async ({ graph, node, llm, agent, tools, }) => {
|
|
|
49
45
|
Parameters manually configured by the user are:
|
|
50
46
|
${JSON.stringify(cleanedParameters)}
|
|
51
47
|
User instructions for choosing tool parameters are:
|
|
52
|
-
${node.prompt ? `${node.prompt}` : 'no instructions set by the user'}
|
|
53
|
-
|
|
54
|
-
${JSON.stringify(state.memory)}
|
|
55
|
-
`;
|
|
48
|
+
${node.prompt ? `${node.prompt}` : 'no instructions set by the user'}`;
|
|
49
|
+
const compiledPrompt = (0, compilePrompt_1.compilePrompt)(message, { memory: state.memory, system: { currentTime: new Date().toISOString() } });
|
|
56
50
|
const AIToolCallMessage = await llm
|
|
57
51
|
.bindTools([tool], {
|
|
58
52
|
tool_choice: tool.name,
|
|
59
53
|
})
|
|
60
|
-
.invoke([...state.messages, new messages_1.SystemMessage(
|
|
54
|
+
.invoke([...state.messages, new messages_1.SystemMessage(compiledPrompt)]);
|
|
61
55
|
AIToolCallMessage.tool_calls[0].args = {
|
|
62
56
|
...AIToolCallMessage.tool_calls[0].args,
|
|
63
57
|
...cleanedParameters, //user set parameters have priority over ai generated parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAppToolNode.js","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":";;;AAAA,sDAA6D;AAC7D,iDAA8D;AAE9D,uDAAyD;AAMzD,4CAAyC;AACzC,sDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"addAppToolNode.js","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":";;;AAAA,sDAA6D;AAC7D,iDAA8D;AAE9D,uDAAyD;AAMzD,4CAAyC;AACzC,8CAAqD;AAErD,sDAA0D;AAC1D,mDAAgD;AAEzC,MAAM,cAAc,G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,cAAc,EAAE;gBACd,QAAQ,EAAE,sBAAQ,CAAC,QAAQ;aAC5B;SACF,CAAC;QACF,OAAO;YACL,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;YAC9C,OAAO,EAAE,IAAA,2BAAiB,EAAiC,KAAK,CAAC,OAAO,EAAE;gBACxE,IAAI,EAAE,sBAAQ,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAY;gBAClC,GAAG,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;gBACpC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,UAAU,EAAE,CAAC,iBAAiB,CAAC,EAAG,CAAC;aACpC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAvFW,QAAA,cAAc,kBAuFzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBrowserTaskNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addBrowserTaskNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAM7E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"addBrowserTaskNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addBrowserTaskNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAM7E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,gCAAuC,wBAAwB,kBA2K7F,CAAC"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.addBrowserTaskNode = void 0;
|
|
27
4
|
const Flows_types_1 = require("../types/Flows.types");
|
|
@@ -32,42 +9,8 @@ const uuid_1 = require("uuid");
|
|
|
32
9
|
const executeBrowserTask_1 = require("../browserTask/executeBrowserTask");
|
|
33
10
|
const tools_1 = require("@langchain/core/tools");
|
|
34
11
|
const zod_1 = require("zod");
|
|
12
|
+
const compilePrompt_1 = require("./compilePrompt");
|
|
35
13
|
const playbooks_1 = require("../playbooks/playbooks");
|
|
36
|
-
const ejs = __importStar(require("ejs"));
|
|
37
|
-
/**
|
|
38
|
-
* Compile prompt with parameters using EJS and placeholder replacement
|
|
39
|
-
*/
|
|
40
|
-
function compilePrompt(prompt, params = {}) {
|
|
41
|
-
try {
|
|
42
|
-
// First, render with EJS
|
|
43
|
-
let compiledPrompt = ejs.render(prompt, params);
|
|
44
|
-
// Then, replace placeholders in {} format
|
|
45
|
-
compiledPrompt = replacePlaceholders(compiledPrompt, params);
|
|
46
|
-
return compiledPrompt;
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
logger_1.logger.error({ message: 'Error compiling prompt', error });
|
|
50
|
-
return prompt; // Return uncompiled if there's an error
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Replace placeholders in {key} format
|
|
55
|
-
*/
|
|
56
|
-
function replacePlaceholders(text, params) {
|
|
57
|
-
return text.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
58
|
-
const keys = key.split('.');
|
|
59
|
-
let value = params;
|
|
60
|
-
for (const k of keys) {
|
|
61
|
-
if (value && typeof value === 'object' && k in value) {
|
|
62
|
-
value = value[k];
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return match; // Return original if key not found
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return String(value);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
14
|
const addBrowserTaskNode = async ({ graph, node, agent, llm }) => {
|
|
72
15
|
const callback = async (state) => {
|
|
73
16
|
logger_1.logger.info({ msg: `Executing browser task node ${node.displayName}`, prompt: node.prompt });
|
|
@@ -101,16 +44,8 @@ const addBrowserTaskNode = async ({ graph, node, agent, llm }) => {
|
|
|
101
44
|
description: node.prompt,
|
|
102
45
|
schema: zodSchema,
|
|
103
46
|
});
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
...state.memory,
|
|
107
|
-
state,
|
|
108
|
-
currentTime: new Date().toISOString(),
|
|
109
|
-
};
|
|
110
|
-
const compiledPlaybooks = (0, playbooks_1.compilePlaybooks)(agent.playbooks, playbookParams) || '';
|
|
111
|
-
const systemPrompt = `${compiledPlaybooks ? compiledPlaybooks + '\n\n' : ''}
|
|
112
|
-
Additional context:
|
|
113
|
-
- workflow memory: ${JSON.stringify(state.memory)}`;
|
|
47
|
+
const combinedPlaybooks = (0, playbooks_1.combinePlaybooks)(agent.playbooks) || '';
|
|
48
|
+
const systemPrompt = combinedPlaybooks ? (0, compilePrompt_1.compilePrompt)(combinedPlaybooks, { state, currentTime: new Date().toISOString() }) : '';
|
|
114
49
|
try {
|
|
115
50
|
// Use LLM to generate tool call
|
|
116
51
|
const AIToolCallMessage = await llm
|
|
@@ -126,11 +61,11 @@ Additional context:
|
|
|
126
61
|
// Prepare parameters for prompt compilation
|
|
127
62
|
const promptParams = {
|
|
128
63
|
input: inputParams,
|
|
129
|
-
state,
|
|
130
|
-
currentTime: new Date().toISOString(),
|
|
64
|
+
memory: state.memory,
|
|
65
|
+
system: { currentTime: new Date().toISOString() },
|
|
131
66
|
};
|
|
132
67
|
// Compile the prompt with parameters
|
|
133
|
-
const compiledPrompt = compilePrompt(node.prompt, promptParams);
|
|
68
|
+
const compiledPrompt = (0, compilePrompt_1.compilePrompt)(node.prompt, promptParams);
|
|
134
69
|
// Build the full prompt with compiled content
|
|
135
70
|
const fullPrompt = `
|
|
136
71
|
Follow the instructions. Any retrieved data should be printed as string and not saved to a file.
|
|
@@ -138,9 +73,7 @@ Follow the instructions. Any retrieved data should be printed as string and not
|
|
|
138
73
|
# Task instructions:
|
|
139
74
|
${compiledPrompt}
|
|
140
75
|
|
|
141
|
-
${Object.keys(inputParams).length > 0 ? `# Input parameters:\n${JSON.stringify(inputParams, null, 2)}\n\n` : ''}
|
|
142
|
-
${state.memory ? `# Task context:\n${JSON.stringify(state.memory)}\n\n` : ''}
|
|
143
|
-
`;
|
|
76
|
+
${Object.keys(inputParams).length > 0 ? `# Input parameters:\n${JSON.stringify(inputParams, null, 2)}\n\n` : ''}`;
|
|
144
77
|
// Create browser session using socket
|
|
145
78
|
const session = await (0, executeBrowserTask_1.createBrowserSession)(node.proxy);
|
|
146
79
|
if (!session.sessionId || !session.cdpUrl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBrowserTaskNode.js","sourceRoot":"","sources":["../../src/nodes/addBrowserTaskNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addBrowserTaskNode.js","sourceRoot":"","sources":["../../src/nodes/addBrowserTaskNode.ts"],"names":[],"mappings":";;;AACA,sDAAiE;AAGjE,4CAAyC;AACzC,8CAAqD;AACrD,uDAAoE;AACpE,+BAAoC;AAEpC,0EAAyE;AACzE,iDAA8D;AAC9D,6BAAwB;AAExB,mDAAgD;AAChD,sDAA0D;AASnD,MAAM,kBAAkB,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAA4B,EAAE,EAAE;IAChG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,+BAA+B,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAE7F,qCAAqC;QACrC,MAAM,YAAY,GAAiC,EAAE,CAAC;QACtD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAA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AQ,EAAE,CAAC,kBAAkB,CAAC;aAC/B,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AA3KW,QAAA,kBAAkB,sBA2K7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addHumanInTheLoopNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addHumanInTheLoopNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"addHumanInTheLoopNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addHumanInTheLoopNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAM7E,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE,gBAAgB,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAAc,MAAM,WAA0D,CAAC;AAEvH,eAAO,MAAM,qBAAqB,kCAAyC,2BAA2B,kBAWrG,CAAC"}
|
|
@@ -4,13 +4,14 @@ exports.addHumanInTheLoopNode = exports.buildHumanInTheLoopNodeName = void 0;
|
|
|
4
4
|
const langgraph_1 = require("@langchain/langgraph");
|
|
5
5
|
const logger_1 = require("../utils/logger");
|
|
6
6
|
const Flows_types_1 = require("../types/Flows.types");
|
|
7
|
+
const BaseInterruptSessionManager_1 = require("../interrupts/BaseInterruptSessionManager");
|
|
7
8
|
const buildHumanInTheLoopNodeName = (nodeName) => `${nodeName}${Flows_types_1.internalNodesSuffix.HUMAN_IN_THE_LOOP}`;
|
|
8
9
|
exports.buildHumanInTheLoopNodeName = buildHumanInTheLoopNodeName;
|
|
9
10
|
const addHumanInTheLoopNode = async ({ graph, attachedToNodeName }) => {
|
|
10
11
|
const callback = async (state) => {
|
|
11
12
|
logger_1.logger.debug({ msg: `[Node] Waiting for human input`, node: attachedToNodeName });
|
|
12
13
|
if (state.messages[state.messages.length - 1].getType() === 'ai') {
|
|
13
|
-
const value = (0, langgraph_1.interrupt)(
|
|
14
|
+
const value = (0, langgraph_1.interrupt)({ type: BaseInterruptSessionManager_1.InterruptType.HUMAN_IN_THE_LOOP });
|
|
14
15
|
return value;
|
|
15
16
|
}
|
|
16
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addHumanInTheLoopNode.js","sourceRoot":"","sources":["../../src/nodes/addHumanInTheLoopNode.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AAGjD,4CAAyC;AACzC,sDAA2D;
|
|
1
|
+
{"version":3,"file":"addHumanInTheLoopNode.js","sourceRoot":"","sources":["../../src/nodes/addHumanInTheLoopNode.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AAGjD,4CAAyC;AACzC,sDAA2D;AAC3D,2FAA0E;AAOnE,MAAM,2BAA2B,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,QAAQ,GAAG,iCAAmB,CAAC,iBAAiB,EAAE,CAAC;AAA1G,QAAA,2BAA2B,+BAA+E;AAEhH,MAAM,qBAAqB,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAA+B,EAAE,EAAE;IACxG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAElF,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;YACjE,MAAM,KAAK,GAAG,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,2CAAa,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACnE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAA,mCAA2B,EAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC;IACzE,KAAK,CAAC,OAAO,CAAC,kBAAyB,EAAE,IAAA,mCAA2B,EAAC,kBAAkB,CAAQ,CAAC,CAAC;AACnG,CAAC,CAAC;AAXW,QAAA,qBAAqB,yBAWhC"}
|
|
@@ -6,10 +6,10 @@ const logger_1 = require("../utils/logger");
|
|
|
6
6
|
const history_1 = require("../utils/history");
|
|
7
7
|
const addJumpToNode = async ({ graph, node }) => {
|
|
8
8
|
const callback = async (state) => {
|
|
9
|
-
logger_1.logger.info(`Executing jump node ${node.displayName} – jumping to ${node.targetNodeId}`);
|
|
9
|
+
logger_1.logger.info({ msg: `Executing jump node ${node.displayName} – jumping to ${node.targetNodeId}` });
|
|
10
10
|
// No state modifications are necessary; control flow is handled via edges.
|
|
11
11
|
return {
|
|
12
|
-
goto:
|
|
12
|
+
goto: node.targetNodeId,
|
|
13
13
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
14
14
|
type: Flows_types_1.NodeType.JUMP_TO_NODE,
|
|
15
15
|
nodeId: node.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addJumpToNode.js","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":";;;AAEA,sDAA4D;AAC5D,4CAAyC;AAEzC,8CAAqD;AAE9C,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAiD,EAAE,EAAE;IACpG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,WAAW,iBAAiB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"addJumpToNode.js","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts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,EAAE,aAAa,EAAe,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"addPromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,yBAAyB,EAAe,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAe,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAMjC,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,iBAAiB,CAAC;IACvB,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,aAAa,6CAAoD,mBAAmB,kBAyIhG,CAAC"}
|
|
@@ -13,9 +13,13 @@ const extractStateMemoryResponse_1 = __importDefault(require("../utils/extractSt
|
|
|
13
13
|
const logger_1 = require("../utils/logger");
|
|
14
14
|
const playbooks_1 = require("../playbooks/playbooks");
|
|
15
15
|
const history_1 = require("../utils/history");
|
|
16
|
+
const compilePrompt_1 = require("./compilePrompt");
|
|
17
|
+
const uuid_1 = require("uuid");
|
|
16
18
|
const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
17
19
|
const callback = async (state) => {
|
|
18
|
-
|
|
20
|
+
var _a;
|
|
21
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
22
|
+
logger_1.logger.info({ msg: `[Node] Executing prompt node`, node: node.displayName });
|
|
19
23
|
const llmToUse = node.llmConfig ? (0, createLlmInstance_1.createLlmInstance)(node.llmConfig) : llm;
|
|
20
24
|
const globalTools = tools
|
|
21
25
|
.filter((tool) => tool.isGlobal)
|
|
@@ -24,17 +28,17 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
24
28
|
description: tool.description,
|
|
25
29
|
schema: tool.input,
|
|
26
30
|
}));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const combinedPlaybooks = (0, playbooks_1.combinePlaybooks)(agent.playbooks) || '';
|
|
32
|
+
// Get edges for the current node and format them
|
|
33
|
+
const edges = ((_a = agent.flows) === null || _a === void 0 ? void 0 : _a.flatMap((flow) => flow.edges)) || [];
|
|
34
|
+
const nodeEdges = edges.filter((edge) => edge.source === node.name);
|
|
35
|
+
const currentPromptNode = getCurrentPromptNode(node, nodeEdges);
|
|
36
|
+
const systemMessage = combinedPlaybooks + '\n\n' + currentPromptNode;
|
|
37
|
+
const compiledPrompt = (0, compilePrompt_1.compilePrompt)(systemMessage, { memory: state.memory, system: { currentTime: new Date().toISOString() } });
|
|
38
|
+
const startTime = Date.now();
|
|
39
|
+
const result = await llmToUse.bindTools(globalTools).invoke([new messages_1.SystemMessage(compiledPrompt), ...state.messages]);
|
|
40
|
+
const endTime = Date.now();
|
|
41
|
+
logger_1.logger.debug({ msg: '[Model] Model execution time', executionTimeMs: endTime - startTime });
|
|
38
42
|
// Check if the result contains tool calls
|
|
39
43
|
if (result.tool_calls && result.tool_calls.length > 0) {
|
|
40
44
|
// Execute the tools
|
|
@@ -46,8 +50,31 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
46
50
|
if (matchedTool) {
|
|
47
51
|
try {
|
|
48
52
|
// Invoke the LangChain tool directly
|
|
53
|
+
const startTime = Date.now();
|
|
49
54
|
const toolResult = await matchedTool.invoke(toolCall);
|
|
50
|
-
|
|
55
|
+
const endTime = Date.now();
|
|
56
|
+
logger_1.logger.debug({ msg: `[Tool] Tool result`, tool: matchedTool === null || matchedTool === void 0 ? void 0 : matchedTool.name, result: toolResult, executionTimeMs: endTime - startTime });
|
|
57
|
+
//check for queue after tool call
|
|
58
|
+
const systemMessageId = (0, uuid_1.v4)();
|
|
59
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId, {
|
|
60
|
+
messages: [
|
|
61
|
+
result,
|
|
62
|
+
toolResult,
|
|
63
|
+
new messages_1.SystemMessage({
|
|
64
|
+
id: systemMessageId,
|
|
65
|
+
content: 'you called tool when the user send a new message, Consider calling the function again after user message is processed',
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
history: [
|
|
69
|
+
(0, history_1.createHistoryStep)(state.history, {
|
|
70
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
71
|
+
nodeId: node.name,
|
|
72
|
+
nodeDisplayName: node.displayName,
|
|
73
|
+
raw: toolResult,
|
|
74
|
+
messageIds: [toolResult.id, systemMessageId],
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
77
|
+
});
|
|
51
78
|
const toolStateUpdate = (0, extractStateMemoryResponse_1.default)(toolResult);
|
|
52
79
|
// Properly merge memory and other state updates
|
|
53
80
|
stateUpdates = {
|
|
@@ -58,6 +85,8 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
58
85
|
toolResults.push(toolResult);
|
|
59
86
|
}
|
|
60
87
|
catch (error) {
|
|
88
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'GraphInterrupt')
|
|
89
|
+
throw error;
|
|
61
90
|
logger_1.logger.error({ msg: `[Tool] Error executing tool`, tool: toolCall.name, error });
|
|
62
91
|
const errorMessage = new messages_1.ToolMessage({
|
|
63
92
|
content: JSON.stringify({ error: error instanceof Error ? error.message : String(error) }),
|
|
@@ -70,10 +99,27 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
70
99
|
logger_1.logger.error({ msg: `[Tool] Model called tool but it was not found`, tool: toolCall.name });
|
|
71
100
|
}
|
|
72
101
|
}
|
|
102
|
+
// await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
73
103
|
// Return the tool call message and tool results with state updates spread at top level
|
|
74
104
|
return {
|
|
75
105
|
...stateUpdates,
|
|
76
106
|
messages: [result, ...toolResults],
|
|
107
|
+
history: [
|
|
108
|
+
(0, history_1.createHistoryStep)(state.history, {
|
|
109
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
110
|
+
nodeId: node.name,
|
|
111
|
+
nodeDisplayName: node.displayName,
|
|
112
|
+
raw: result,
|
|
113
|
+
messageIds: [result.id],
|
|
114
|
+
}),
|
|
115
|
+
...toolResults.map((toolResult) => (0, history_1.createHistoryStep)(state.history, {
|
|
116
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
117
|
+
nodeId: node.name,
|
|
118
|
+
nodeDisplayName: node.displayName,
|
|
119
|
+
raw: toolResult,
|
|
120
|
+
messageIds: [toolResult.id],
|
|
121
|
+
})),
|
|
122
|
+
],
|
|
77
123
|
};
|
|
78
124
|
}
|
|
79
125
|
if (result.getType() === 'ai') {
|
|
@@ -98,4 +144,41 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
98
144
|
graph.addNode(node.name, callback);
|
|
99
145
|
};
|
|
100
146
|
exports.addPromptNode = addPromptNode;
|
|
147
|
+
function getCurrentPromptNode(node, nodeEdges) {
|
|
148
|
+
// Format edges for display
|
|
149
|
+
let nextEdges = '';
|
|
150
|
+
if (node.canStayOnNode !== false) {
|
|
151
|
+
nextEdges = `0. Stay in the current step. step title: ${node.displayName}\n`;
|
|
152
|
+
}
|
|
153
|
+
let counter = node.canStayOnNode !== false ? 0 : -1;
|
|
154
|
+
const promptConditionEdges = nodeEdges.filter((edge) => edge.type === 'PROMPT_CONDITION');
|
|
155
|
+
promptConditionEdges.forEach((edge) => {
|
|
156
|
+
counter++;
|
|
157
|
+
nextEdges += `${counter}. ${edge.prompt || edge.condition || `Go to ${edge.target}`}\n`;
|
|
158
|
+
});
|
|
159
|
+
return `
|
|
160
|
+
# Current Node Instructions
|
|
161
|
+
|
|
162
|
+
The flow of the conversation is built upon nodes. each conversation turn you
|
|
163
|
+
will be given just with the current node prompt.
|
|
164
|
+
|
|
165
|
+
Always follow the guidelines of "Current node prompt"
|
|
166
|
+
|
|
167
|
+
Current node title: ${node.displayName}
|
|
168
|
+
|
|
169
|
+
Current node prompt:
|
|
170
|
+
${node.prompt}
|
|
171
|
+
|
|
172
|
+
# Next nodes
|
|
173
|
+
|
|
174
|
+
After handling current node you can stay in the same node or move to the next
|
|
175
|
+
node based on the condition.
|
|
176
|
+
|
|
177
|
+
The next nodes will run automatically by condition runner later, no need to
|
|
178
|
+
worry about it now.
|
|
179
|
+
|
|
180
|
+
Here are possible next nodes and their conditions, never share this
|
|
181
|
+
information with the user:
|
|
182
|
+
${nextEdges}`;
|
|
183
|
+
}
|
|
101
184
|
//# sourceMappingURL=addPromptNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPromptNode.js","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":";;;;;;AACA,sDAA4D;AAI5D,uDAAiF;AAEjF,iDAA8D;AAC9D,uDAA+E;AAE/E,gEAA6D;AAC7D,qGAA2E;AAE3E,4CAAyC;AACzC,sDAA0D;AAC1D,8CAAqD;
|
|
1
|
+
{"version":3,"file":"addPromptNode.js","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":";;;;;;AACA,sDAA4D;AAI5D,uD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AgB,EAAmB,MAAM,0BAA0B,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"addToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAMjC,eAAO,MAAM,WAAW,wCAMrB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,KAAK,EAAE,KAAK,CAAC;CACd,kBA2CA,CAAC"}
|
|
@@ -5,8 +5,9 @@ const Flows_types_1 = require("../types/Flows.types");
|
|
|
5
5
|
const tools_1 = require("@langchain/core/tools");
|
|
6
6
|
const messages_1 = require("@langchain/core/messages");
|
|
7
7
|
const logger_1 = require("../utils/logger");
|
|
8
|
-
const playbooks_1 = require("../playbooks/playbooks");
|
|
9
8
|
const history_1 = require("../utils/history");
|
|
9
|
+
const playbooks_1 = require("../playbooks/playbooks");
|
|
10
|
+
const compilePrompt_1 = require("./compilePrompt");
|
|
10
11
|
const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
|
|
11
12
|
const toolNode = node;
|
|
12
13
|
const matchedTool = tools.find((tool) => tool.name === toolNode.toolName);
|
|
@@ -15,28 +16,26 @@ const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
|
|
|
15
16
|
}
|
|
16
17
|
const callback = async (state) => {
|
|
17
18
|
var _a;
|
|
19
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
18
20
|
logger_1.logger.debug({ msg: `[Node] Executing tool node`, node: toolNode.displayName });
|
|
19
21
|
const tool = (0, tools_1.tool)(() => { }, {
|
|
20
22
|
name: matchedTool.name,
|
|
21
23
|
description: matchedTool.description,
|
|
22
24
|
schema: matchedTool.input,
|
|
23
25
|
});
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
const compiledPlaybooks = (0, playbooks_1.compilePlaybooks)(agent.playbooks, playbookParams) || '';
|
|
31
|
-
const prompt = `${compiledPlaybooks ? compiledPlaybooks + '\n\n' : ''}
|
|
32
|
-
Additional context:
|
|
33
|
-
workflow memory: ${JSON.stringify(state.memory)}
|
|
34
|
-
`;
|
|
26
|
+
const combinedPlaybooks = (0, playbooks_1.combinePlaybooks)(agent.playbooks) || '';
|
|
27
|
+
const systemPrompt = combinedPlaybooks
|
|
28
|
+
? (0, compilePrompt_1.compilePrompt)(combinedPlaybooks, { memory: state.memory, system: { currentTime: new Date().toISOString() } })
|
|
29
|
+
: '';
|
|
30
|
+
const startTime = Date.now();
|
|
35
31
|
const AIToolCallMessage = await llm
|
|
36
32
|
.bindTools([tool], {
|
|
37
33
|
tool_choice: tool.name,
|
|
38
34
|
})
|
|
39
|
-
.invoke([...state.messages, new messages_1.SystemMessage(
|
|
35
|
+
.invoke([...state.messages, new messages_1.SystemMessage(systemPrompt)]);
|
|
36
|
+
const endTime = Date.now();
|
|
37
|
+
logger_1.logger.debug({ msg: '[Tool] Model execution time', tool: matchedTool.name, executionTimeMs: endTime - startTime });
|
|
38
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
40
39
|
return {
|
|
41
40
|
goto: null,
|
|
42
41
|
messages: [AIToolCallMessage],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolNode.js","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAE1D,iDAA8D;AAE9D,uDAAoE;AAGpE,4CAAyC;AAEzC,sDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"addToolNode.js","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAE1D,iDAA8D;AAE9D,uDAAoE;AAGpE,4CAAyC;AAEzC,8CAAqD;AAErD,sDAA0D;AAC1D,mDAAgD;AAEzC,MAAM,WAAW,GAAG,KAAK,EAAE,EAChC,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,KAAK,GAON,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAgB,CAAC;IAClC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC1E,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,QAAQ,YAAY,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;;QAC3E,MAAM,KAAK,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5E,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,4BAA4B,EAAE,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAEhF,MAAM,IAAI,GAAG,IAAA,YAAa,EAAC,GAAG,EAAE,GAAE,CAAC,EAAE;YACnC,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,WAAW,EAAE,WAAW,CAAC,WAAW;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CAAA,MAAA,iBAAiB,CAAC,UAAU,0CAAG,CAAC,CAAC,KAAI,EAAE;gBAC5C,UAAU,EAAE,CAAC,iBAAiB,CAAC,EAAG,CAAC;aACpC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAvDW,QAAA,WAAW,eAuDtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolRunNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAiC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK/E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,QAAQ,EAAE,QAAQ,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,MAAM,WAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"addToolRunNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAiC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK/E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,QAAQ,EAAE,QAAQ,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,MAAM,WAAiD,CAAC;AAGvG,eAAO,MAAM,cAAc,0DAAiE,oBAAoB,kBAoD/G,CAAC"}
|
|
@@ -11,6 +11,7 @@ const logger_1 = require("../utils/logger");
|
|
|
11
11
|
const history_1 = require("../utils/history");
|
|
12
12
|
const buildToolRunNodeName = (nodeName) => `${nodeName}${Flows_types_1.internalNodesSuffix.TOOL_RUN}`;
|
|
13
13
|
exports.buildToolRunNodeName = buildToolRunNodeName;
|
|
14
|
+
//you never want to interrupt here because of new triggers, as this node depends on the last message to be the tool call from the addToolNode, interrupting will add human message here
|
|
14
15
|
const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeName, agent }) => {
|
|
15
16
|
const callback = async (state) => {
|
|
16
17
|
const matchedTool = tools.find((tool) => tool.name === toolNode.toolName);
|
|
@@ -19,7 +20,10 @@ const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeName, agen
|
|
|
19
20
|
}
|
|
20
21
|
const executeWrapper = async (input) => {
|
|
21
22
|
try {
|
|
23
|
+
const startTime = Date.now();
|
|
22
24
|
const response = await matchedTool.execute({ input, state, agent });
|
|
25
|
+
const endTime = Date.now();
|
|
26
|
+
logger_1.logger.debug({ msg: '[Tool] Tool execution time', tool: matchedTool.name, executionTimeMs: endTime - startTime });
|
|
23
27
|
return response || {};
|
|
24
28
|
}
|
|
25
29
|
catch (error) {
|