@minded-ai/mindedjs 1.0.91 → 1.0.92-beta-2
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 +93 -12
- package/dist/agent.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/interrupts/InterruptSessionManager.types.d.ts +36 -0
- package/dist/interrupts/InterruptSessionManager.types.d.ts.map +1 -0
- package/dist/interrupts/InterruptSessionManager.types.js +39 -0
- package/dist/interrupts/InterruptSessionManager.types.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 +51 -0
- package/dist/interrupts/MemoryInterruptSessionManager.js.map +1 -0
- package/dist/interrupts/MindedInterruptSessionManager.d.ts +15 -0
- package/dist/interrupts/MindedInterruptSessionManager.d.ts.map +1 -0
- package/dist/interrupts/MindedInterruptSessionManager.js +121 -0
- package/dist/interrupts/MindedInterruptSessionManager.js.map +1 -0
- package/dist/interrupts/interruptSessionManagerFactory.d.ts +4 -0
- package/dist/interrupts/interruptSessionManagerFactory.d.ts.map +1 -0
- package/dist/interrupts/interruptSessionManagerFactory.js +19 -0
- package/dist/interrupts/interruptSessionManagerFactory.js.map +1 -0
- package/dist/nodes/addAppToolNode.d.ts.map +1 -1
- package/dist/nodes/addAppToolNode.js +2 -2
- package/dist/nodes/addAppToolNode.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.d.ts.map +1 -1
- package/dist/nodes/addJumpToNode.js +2 -2
- package/dist/nodes/addJumpToNode.js.map +1 -1
- package/dist/nodes/addJunctionNode.d.ts +7 -0
- package/dist/nodes/addJunctionNode.d.ts.map +1 -0
- package/dist/nodes/addJunctionNode.js +20 -0
- package/dist/nodes/addJunctionNode.js.map +1 -0
- package/dist/nodes/addPromptNode.d.ts.map +1 -1
- package/dist/nodes/addPromptNode.js +42 -2
- package/dist/nodes/addPromptNode.js.map +1 -1
- package/dist/nodes/addToolNode.d.ts.map +1 -1
- package/dist/nodes/addToolNode.js +2 -2
- package/dist/nodes/addToolNode.js.map +1 -1
- package/dist/nodes/addToolRunNode.d.ts.map +1 -1
- package/dist/nodes/addToolRunNode.js +1 -2
- package/dist/nodes/addToolRunNode.js.map +1 -1
- package/dist/nodes/addTriggerNode.d.ts.map +1 -1
- package/dist/nodes/addTriggerNode.js +1 -2
- package/dist/nodes/addTriggerNode.js.map +1 -1
- package/dist/nodes/nodeFactory.d.ts.map +1 -1
- package/dist/nodes/nodeFactory.js +2 -5
- package/dist/nodes/nodeFactory.js.map +1 -1
- package/dist/platform/mindedConnectionTypes.d.ts +82 -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/types/Agent.types.d.ts +11 -13
- package/dist/types/Agent.types.d.ts.map +1 -1
- package/dist/types/Agent.types.js +1 -10
- 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/package.json +2 -2
- package/src/agent.ts +119 -21
- package/src/index.ts +0 -1
- package/src/interrupts/InterruptSessionManager.types.ts +79 -0
- package/src/interrupts/MemoryInterruptSessionManager.ts +56 -0
- package/src/interrupts/MindedInterruptSessionManager.ts +157 -0
- package/src/interrupts/interruptSessionManagerFactory.ts +17 -0
- package/src/nodes/addAppToolNode.ts +3 -3
- package/src/nodes/addHumanInTheLoopNode.ts +2 -1
- package/src/nodes/addJumpToNode.ts +3 -3
- package/src/nodes/addJunctionNode.ts +19 -0
- package/src/nodes/addPromptNode.ts +48 -7
- package/src/nodes/addToolNode.ts +2 -3
- package/src/nodes/addToolRunNode.ts +2 -3
- package/src/nodes/addTriggerNode.ts +3 -3
- package/src/nodes/nodeFactory.ts +2 -7
- package/src/platform/mindedConnectionTypes.ts +100 -0
- package/src/types/Agent.types.ts +12 -15
- package/src/types/LangGraph.types.ts +3 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MindedInterruptSessionManager = void 0;
|
|
4
|
+
const InterruptSessionManager_types_1 = require("./InterruptSessionManager.types");
|
|
5
|
+
const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
|
|
6
|
+
class MindedInterruptSessionManager extends InterruptSessionManager_types_1.BaseInterruptSessionManager {
|
|
7
|
+
constructor(mindedConnection) {
|
|
8
|
+
super();
|
|
9
|
+
this.mindedConnection = mindedConnection;
|
|
10
|
+
}
|
|
11
|
+
async isProcessed(sessionId) {
|
|
12
|
+
var _a;
|
|
13
|
+
try {
|
|
14
|
+
const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_IS_PROCESSED, {
|
|
15
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_IS_PROCESSED,
|
|
16
|
+
sessionId,
|
|
17
|
+
});
|
|
18
|
+
return (_a = response.isProcessed) !== null && _a !== void 0 ? _a : false;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error('Error checking if session is processed:', error);
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async lock(sessionId) {
|
|
26
|
+
try {
|
|
27
|
+
await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_LOCK, {
|
|
28
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_LOCK,
|
|
29
|
+
sessionId,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Error locking session:', error);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async release(sessionId) {
|
|
38
|
+
try {
|
|
39
|
+
await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_RELEASE, {
|
|
40
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_RELEASE,
|
|
41
|
+
sessionId,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error('Error releasing session:', error);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async enqueueMessage(sessionId, message) {
|
|
50
|
+
try {
|
|
51
|
+
await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_ENQUEUE, {
|
|
52
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_ENQUEUE,
|
|
53
|
+
sessionId,
|
|
54
|
+
message,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error('Error enqueuing message:', error);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async dequeueAll(sessionId) {
|
|
63
|
+
var _a;
|
|
64
|
+
try {
|
|
65
|
+
const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE_ALL, {
|
|
66
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE_ALL,
|
|
67
|
+
sessionId,
|
|
68
|
+
});
|
|
69
|
+
return (_a = response.messages) !== null && _a !== void 0 ? _a : [];
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('Error dequeuing all messages:', error);
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async dequeue(sessionId) {
|
|
77
|
+
var _a;
|
|
78
|
+
try {
|
|
79
|
+
const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE, {
|
|
80
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE,
|
|
81
|
+
sessionId,
|
|
82
|
+
});
|
|
83
|
+
return (_a = response.message) !== null && _a !== void 0 ? _a : null;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error('Error dequeuing message:', error);
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Implementation of abstract methods from BaseInterruptSessionManager
|
|
91
|
+
async hasQueuedMessages(sessionId) {
|
|
92
|
+
var _a;
|
|
93
|
+
try {
|
|
94
|
+
const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_HAS_MESSAGES, {
|
|
95
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_HAS_MESSAGES,
|
|
96
|
+
sessionId,
|
|
97
|
+
});
|
|
98
|
+
return (_a = response.hasMessages) !== null && _a !== void 0 ? _a : false;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('Error checking if session has messages:', error);
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async getQueuedMessages(sessionId) {
|
|
106
|
+
var _a;
|
|
107
|
+
try {
|
|
108
|
+
const response = await this.mindedConnection.awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_GET_MESSAGES, {
|
|
109
|
+
type: mindedConnectionTypes_1.MindedConnectionSocketMessageType.INTERRUPT_SESSION_GET_MESSAGES,
|
|
110
|
+
sessionId,
|
|
111
|
+
});
|
|
112
|
+
return (_a = response.messages) !== null && _a !== void 0 ? _a : [];
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error('Error getting queued messages:', error);
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.MindedInterruptSessionManager = MindedInterruptSessionManager;
|
|
121
|
+
//# sourceMappingURL=MindedInterruptSessionManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MindedInterruptSessionManager.js","sourceRoot":"","sources":["../../src/interrupts/MindedInterruptSessionManager.ts"],"names":[],"mappings":";;;AAAA,mFAA6F;AAE7F,6EAkB2C;AAE3C,MAAa,6BAA8B,SAAQ,2DAA2B;IAG5E,YAAY,gBAAkC;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,SAAiB;;QACjC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACpD,yDAAiC,CAAC,8BAA8B,EAChE;gBACE,IAAI,EAAE,yDAAiC,CAAC,8BAA8B;gBACtE,SAAS;aACV,CACF,CAAC;YACF,OAAO,MAAA,QAAQ,CAAC,WAAW,mCAAI,KAAK,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;YAChE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,SAAiB;QAC1B,IAAI,CAAC;YACH,MA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,CAAC,8BAA8B,EAChE;gBACE,IAAI,EAAE,yDAAiC,CAAC,8BAA8B;gBACtE,SAAS;aACV,CACF,CAAC;YACF,OAAO,MAAA,QAAQ,CAAC,QAAQ,mCAAI,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AAtID,sEAsIC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InterruptSessionManager } from './InterruptSessionManager.types';
|
|
2
|
+
import { MindedConnection } from '../platform/mindedConnection';
|
|
3
|
+
export declare function createInterruptSessionManager(mindedConnection: MindedConnection | null): InterruptSessionManager;
|
|
4
|
+
//# sourceMappingURL=interruptSessionManagerFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interruptSessionManagerFactory.d.ts","sourceRoot":"","sources":["../../src/interrupts/interruptSessionManagerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,wBAAgB,6BAA6B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GAAG,uBAAuB,CAUhH"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createInterruptSessionManager = createInterruptSessionManager;
|
|
4
|
+
const MemoryInterruptSessionManager_1 = require("./MemoryInterruptSessionManager");
|
|
5
|
+
const MindedInterruptSessionManager_1 = require("./MindedInterruptSessionManager");
|
|
6
|
+
const config_1 = require("../platform/config");
|
|
7
|
+
function createInterruptSessionManager(mindedConnection) {
|
|
8
|
+
const { runLocally } = (0, config_1.getConfig)();
|
|
9
|
+
if (runLocally) {
|
|
10
|
+
return new MemoryInterruptSessionManager_1.MemoryInterruptSessionManager();
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
if (!mindedConnection) {
|
|
14
|
+
throw new Error('MindedConnection is required for platform interrupt session manager');
|
|
15
|
+
}
|
|
16
|
+
return new MindedInterruptSessionManager_1.MindedInterruptSessionManager(mindedConnection);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=interruptSessionManagerFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interruptSessionManagerFactory.js","sourceRoot":"","sources":["../../src/interrupts/interruptSessionManagerFactory.ts"],"names":[],"mappings":";;AAMA,sEAUC;AAfD,mFAAgF;AAChF,mFAAgF;AAEhF,+CAA+C;AAE/C,SAAgB,6BAA6B,CAAC,gBAAyC;IACrF,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IACnC,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,IAAI,6DAA6B,EAAE,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACzF,CAAC;QACD,OAAO,IAAI,6DAA6B,CAAC,gBAAgB,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAppToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
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;AAGlD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,eAAO,MAAM,cAAc,GAAU,8BAKlC;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;CACd,kBAsEA,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAppToolNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
4
5
|
const tools_1 = require("@langchain/core/tools");
|
|
5
6
|
const messages_1 = require("@langchain/core/messages");
|
|
6
7
|
const appActionRunnerTool_1 = require("../internalTools/appActionRunnerTool");
|
|
7
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
8
8
|
const logger_1 = require("../utils/logger");
|
|
9
9
|
const playbooks_1 = require("../playbooks/playbooks");
|
|
10
10
|
const history_1 = require("../utils/history");
|
|
@@ -67,7 +67,7 @@ const addAppToolNode = async ({ graph, node, llm, agent, }) => {
|
|
|
67
67
|
return {
|
|
68
68
|
messages: [AIToolCallMessage, toolCallMessage],
|
|
69
69
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
70
|
-
type:
|
|
70
|
+
type: Flows_types_1.NodeType.APP_TOOL,
|
|
71
71
|
nodeId: node.name,
|
|
72
72
|
nodeDisplayName: node.displayName,
|
|
73
73
|
raw: AIToolCallMessage.tool_calls[0],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAppToolNode.js","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"addAppToolNode.js","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":";;;AAAA,sD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O,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;AAhFW,QAAA,cAAc,kBAgFzB"}
|
|
@@ -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,GAAI,UAAU,MAAM,WAA0D,CAAC;AAEvH,eAAO,MAAM,qBAAqB,GAAU,+BAA+B,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 InterruptSessionManager_types_1 = require("../interrupts/InterruptSessionManager.types");
|
|
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.info(`Executing "human in the loop" node for the attached 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: InterruptSessionManager_types_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,+FAA4E;AAOrE,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,IAAI,CAAC,2DAA2D,kBAAkB,EAAE,CAAC,CAAC;QAE7F,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,6CAAa,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addJumpToNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"addJumpToNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AAK5D,eAAO,MAAM,aAAa,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,kBAgBjG,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addJumpToNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
4
5
|
const logger_1 = require("../utils/logger");
|
|
5
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
6
6
|
const history_1 = require("../utils/history");
|
|
7
7
|
const addJumpToNode = async ({ graph, node }) => {
|
|
8
8
|
const callback = async (state) => {
|
|
@@ -10,7 +10,7 @@ const addJumpToNode = async ({ graph, node }) => {
|
|
|
10
10
|
// No state modifications are necessary; control flow is handled via edges.
|
|
11
11
|
return {
|
|
12
12
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
13
|
-
type:
|
|
13
|
+
type: Flows_types_1.NodeType.JUMP_TO_NODE,
|
|
14
14
|
nodeId: node.name,
|
|
15
15
|
nodeDisplayName: node.displayName,
|
|
16
16
|
raw: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addJumpToNode.js","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":";;;
|
|
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;QACzF,2EAA2E;QAC3E,OAAO;YACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,YAAY;gBAC3B,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,EAAE;aACR,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAW,EAAE,IAAI,CAAC,YAAmB,CAAC,CAAC;AAC5D,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JunctionNode } from '../types/Flows.types';
|
|
2
|
+
import { PreCompiledGraph } from '../types/LangGraph.types';
|
|
3
|
+
export declare const addJunctionNode: ({ graph, node }: {
|
|
4
|
+
graph: PreCompiledGraph;
|
|
5
|
+
node: JunctionNode;
|
|
6
|
+
}) => void;
|
|
7
|
+
//# sourceMappingURL=addJunctionNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addJunctionNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addJunctionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAY,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAK7E,eAAO,MAAM,eAAe,GAAI,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,SAY/F,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addJunctionNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
5
|
+
const history_1 = require("../utils/history");
|
|
6
|
+
const addJunctionNode = ({ graph, node }) => {
|
|
7
|
+
const callback = async (state) => {
|
|
8
|
+
return {
|
|
9
|
+
history: (0, history_1.createHistoryStep)(state.history, {
|
|
10
|
+
type: Flows_types_1.NodeType.JUNCTION,
|
|
11
|
+
nodeId: node.name,
|
|
12
|
+
nodeDisplayName: node.displayName,
|
|
13
|
+
raw: '',
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
graph.addNode(node.name, callback);
|
|
18
|
+
};
|
|
19
|
+
exports.addJunctionNode = addJunctionNode;
|
|
20
|
+
//# sourceMappingURL=addJunctionNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addJunctionNode.js","sourceRoot":"","sources":["../../src/nodes/addJunctionNode.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAG9D,8CAAqD;AAG9C,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAmD,EAAE,EAAE;IAClG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,OAAO;YACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,EAAE;aACR,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
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;AAKjC,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,GAAU,0CAA0C,mBAAmB,kBAmIhG,CAAC"}
|
|
@@ -4,17 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.addPromptNode = void 0;
|
|
7
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
7
8
|
const messages_1 = require("@langchain/core/messages");
|
|
8
9
|
const tools_1 = require("@langchain/core/tools");
|
|
9
10
|
const AgentEvents_1 = require("../events/AgentEvents");
|
|
10
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
11
11
|
const createLlmInstance_1 = require("../llm/createLlmInstance");
|
|
12
12
|
const extractStateMemoryResponse_1 = __importDefault(require("../utils/extractStateMemoryResponse"));
|
|
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 wait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
16
17
|
const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
17
18
|
const callback = async (state) => {
|
|
19
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
18
20
|
logger_1.logger.info(`Executing prompt node ${node.displayName}`);
|
|
19
21
|
const llmToUse = node.llmConfig ? (0, createLlmInstance_1.createLlmInstance)(node.llmConfig) : llm;
|
|
20
22
|
const globalTools = tools
|
|
@@ -35,6 +37,7 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
35
37
|
${compiledPlaybooks ? `# General guidelines:\n${compiledPlaybooks}\n\n` : ''}
|
|
36
38
|
`;
|
|
37
39
|
const result = await llmToUse.bindTools(globalTools).invoke([...state.messages, new messages_1.SystemMessage(message)]);
|
|
40
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
38
41
|
// Check if the result contains tool calls
|
|
39
42
|
if (result.tool_calls && result.tool_calls.length > 0) {
|
|
40
43
|
// Execute the tools
|
|
@@ -47,6 +50,24 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
47
50
|
try {
|
|
48
51
|
// Invoke the LangChain tool directly
|
|
49
52
|
const toolResult = await matchedTool.invoke(toolCall);
|
|
53
|
+
console.log('after invoke?');
|
|
54
|
+
//check for queue after tool call
|
|
55
|
+
await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId, {
|
|
56
|
+
messages: [
|
|
57
|
+
result,
|
|
58
|
+
toolResult,
|
|
59
|
+
new messages_1.SystemMessage('you called tool when the user send a new message, Consider calling the function again after user message is processed'),
|
|
60
|
+
],
|
|
61
|
+
history: [
|
|
62
|
+
(0, history_1.createHistoryStep)(state.history, {
|
|
63
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
64
|
+
nodeId: node.name,
|
|
65
|
+
nodeDisplayName: node.displayName,
|
|
66
|
+
raw: toolResult,
|
|
67
|
+
messageIds: [toolResult.id],
|
|
68
|
+
}),
|
|
69
|
+
],
|
|
70
|
+
});
|
|
50
71
|
const toolStateUpdate = (0, extractStateMemoryResponse_1.default)(toolResult);
|
|
51
72
|
// Properly merge memory and other state updates
|
|
52
73
|
stateUpdates = {
|
|
@@ -57,6 +78,8 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
57
78
|
toolResults.push(toolResult);
|
|
58
79
|
}
|
|
59
80
|
catch (error) {
|
|
81
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'GraphInterrupt')
|
|
82
|
+
throw error;
|
|
60
83
|
logger_1.logger.error({ msg: `Error executing tool ${toolCall.name}:`, error });
|
|
61
84
|
const errorMessage = new messages_1.ToolMessage({
|
|
62
85
|
content: JSON.stringify({ error: error instanceof Error ? error.message : String(error) }),
|
|
@@ -69,10 +92,27 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
69
92
|
logger_1.logger.error({ msg: `Model tried to call tool ${toolCall.name} but it was not found` });
|
|
70
93
|
}
|
|
71
94
|
}
|
|
95
|
+
// await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
|
|
72
96
|
// Return the tool call message and tool results with state updates spread at top level
|
|
73
97
|
return {
|
|
74
98
|
...stateUpdates,
|
|
75
99
|
messages: [result, ...toolResults],
|
|
100
|
+
history: [
|
|
101
|
+
(0, history_1.createHistoryStep)(state.history, {
|
|
102
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
103
|
+
nodeId: node.name,
|
|
104
|
+
nodeDisplayName: node.displayName,
|
|
105
|
+
raw: result,
|
|
106
|
+
messageIds: [result.id],
|
|
107
|
+
}),
|
|
108
|
+
...toolResults.map((toolResult) => (0, history_1.createHistoryStep)(state.history, {
|
|
109
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
110
|
+
nodeId: node.name,
|
|
111
|
+
nodeDisplayName: node.displayName,
|
|
112
|
+
raw: toolResult,
|
|
113
|
+
messageIds: [toolResult.id],
|
|
114
|
+
})),
|
|
115
|
+
],
|
|
76
116
|
};
|
|
77
117
|
}
|
|
78
118
|
if (result.getType() === 'ai') {
|
|
@@ -84,7 +124,7 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
84
124
|
}
|
|
85
125
|
return {
|
|
86
126
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
87
|
-
type:
|
|
127
|
+
type: Flows_types_1.NodeType.PROMPT_NODE,
|
|
88
128
|
nodeId: node.name,
|
|
89
129
|
nodeDisplayName: node.displayName,
|
|
90
130
|
raw: result.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPromptNode.js","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":";;;;;;
|
|
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;AACrD,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAU5D,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAuB,EAAE,EAAE;IACnG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,MAAM,KAAK,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5E,eAAM,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,qCAAiB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAE1E,MAAM,WAAW,GAAG,KAAK;aACtB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC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
|
+
{"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;AAKjC,eAAO,MAAM,WAAW,GAAU,qCAM/B;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,kBA6CA,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addToolNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
4
5
|
const tools_1 = require("@langchain/core/tools");
|
|
5
6
|
const messages_1 = require("@langchain/core/messages");
|
|
6
7
|
const logger_1 = require("../utils/logger");
|
|
7
8
|
const playbooks_1 = require("../playbooks/playbooks");
|
|
8
9
|
const history_1 = require("../utils/history");
|
|
9
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
10
10
|
const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
|
|
11
11
|
const toolNode = node;
|
|
12
12
|
const matchedTool = tools.find((tool) => tool.name === toolNode.toolName);
|
|
@@ -41,7 +41,7 @@ const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
|
|
|
41
41
|
return {
|
|
42
42
|
messages: [AIToolCallMessage],
|
|
43
43
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
44
|
-
type:
|
|
44
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
45
45
|
nodeId: node.name,
|
|
46
46
|
nodeDisplayName: node.displayName,
|
|
47
47
|
raw: ((_a = AIToolCallMessage.tool_calls) === null || _a === void 0 ? void 0 : _a[0]) || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolNode.js","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":";;;
|
|
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,8CAAqD;AAG9C,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,eAAM,CAAC,IAAI,CAAC,uBAAuB,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAE3D,MAAM,IAAI,GAAG,IAAA,YAAa,EAAC,GAAG,EAAE,GAAE,CAAC,EAAE;YACnC,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,MAAM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AC;AAzDW,QAAA,WAAW,eAyDtB"}
|
|
@@ -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,
|
|
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,GAAI,UAAU,MAAM,WAAiD,CAAC;AAEvG,eAAO,MAAM,cAAc,GAAU,uDAAuD,oBAAoB,kBAgD/G,CAAC"}
|
|
@@ -9,7 +9,6 @@ const tools_1 = require("@langchain/core/tools");
|
|
|
9
9
|
const extractStateMemoryResponse_1 = __importDefault(require("../utils/extractStateMemoryResponse"));
|
|
10
10
|
const logger_1 = require("../utils/logger");
|
|
11
11
|
const history_1 = require("../utils/history");
|
|
12
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
13
12
|
const buildToolRunNodeName = (nodeName) => `${nodeName}${Flows_types_1.internalNodesSuffix.TOOL_RUN}`;
|
|
14
13
|
exports.buildToolRunNodeName = buildToolRunNodeName;
|
|
15
14
|
const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeName, agent }) => {
|
|
@@ -46,7 +45,7 @@ const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeName, agen
|
|
|
46
45
|
...toolStateUpdate,
|
|
47
46
|
messages: updatedMessages,
|
|
48
47
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
49
|
-
type:
|
|
48
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
50
49
|
nodeId: toolNode.name,
|
|
51
50
|
nodeDisplayName: toolNode.displayName,
|
|
52
51
|
raw: toolCallMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAIA,
|
|
1
|
+
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAIA,sDAA+E;AAC/E,iDAA8D;AAG9D,qGAA2E;AAE3E,4CAAyC;AACzC,8CAAqD;AAY9C,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,QAAQ,GAAG,iCAAmB,CAAC,QAAQ,EAAE,CAAC;AAA1F,QAAA,oBAAoB,wBAAsE;AAEhG,MAAM,cAAc,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAwB,EAAE,EAAE;IAClH,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,MAAM,WAAW,GAAG,KAAK,CAAC,IA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C,eAAe,EAAE,GAAG,CAAE,eAAuB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;QAExF,uEAAuE;QACvE,OAAO;YACL,GAAG,eAAe;YAClB,QAAQ,EAAE,eAAe;YACzB,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,IAAI;gBACnB,MAAM,EAAE,QAAQ,CAAC,IAAI;gBACrB,eAAe,EAAE,QAAQ,CAAC,WAAW;gBACrC,GAAG,EAAE,eAAe;gBACpB,UAAU,EAAE,EAAE;aACf,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAA,4BAAoB,EAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC;IAClE,KAAK,CAAC,OAAO,CAAC,kBAAyB,EAAE,IAAA,4BAAoB,EAAC,kBAAkB,CAAQ,CAAC,CAAC;AAC5F,CAAC,CAAC;AAhDW,QAAA,cAAc,kBAgDzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAK7E,eAAO,MAAM,cAAc,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,kBAkBnG,CAAC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addTriggerNode = void 0;
|
|
4
4
|
const Flows_types_1 = require("../types/Flows.types");
|
|
5
5
|
const logger_1 = require("../utils/logger");
|
|
6
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
7
6
|
const history_1 = require("../utils/history");
|
|
8
7
|
const addTriggerNode = async ({ graph, node }) => {
|
|
9
8
|
const callback = async (state) => {
|
|
@@ -11,7 +10,7 @@ const addTriggerNode = async ({ graph, node }) => {
|
|
|
11
10
|
if (node.triggerType === Flows_types_1.TriggerType.MANUAL) {
|
|
12
11
|
return {
|
|
13
12
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
14
|
-
type:
|
|
13
|
+
type: Flows_types_1.NodeType.TRIGGER,
|
|
15
14
|
nodeId: node.name,
|
|
16
15
|
nodeDisplayName: node.displayName,
|
|
17
16
|
raw: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTriggerNode.js","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"addTriggerNode.js","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":";;;AACA,sDAA0E;AAE1E,4CAAyC;AAEzC,8CAAqD;AAE9C,MAAM,cAAc,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAkD,EAAE,EAAE;IACtG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,IAAI,CAAC,0BAA0B,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1D,IAAI,IAAI,CAAC,WAAW,KAAK,yBAAW,CAAC,MAAM,EAAE,CAAC;YAC5C,OAAO;gBACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;oBACrD,IAAI,EAAE,sBAAQ,CAAC,OAAO;oBACtB,MAAM,EAAE,IAAI,CAAC,IAAI;oBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;oBACjC,GAAG,EAAE,EAAE;oBACP,UAAU,EAAE,EAAE;iBACf,CAAC;aACH,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAlBW,QAAA,cAAc,kBAkBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,eAAO,MAAM,WAAW,GAAI,2CAOzB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;CACd,SAwBA,CAAC"}
|
|
@@ -7,10 +7,7 @@ const addPromptNode_1 = require("./addPromptNode");
|
|
|
7
7
|
const addAppToolNode_1 = require("./addAppToolNode");
|
|
8
8
|
const addTriggerNode_1 = require("./addTriggerNode");
|
|
9
9
|
const addJumpToNode_1 = require("./addJumpToNode");
|
|
10
|
-
const
|
|
11
|
-
const callback = async () => { };
|
|
12
|
-
graph.addNode(node.name, callback);
|
|
13
|
-
};
|
|
10
|
+
const addJunctionNode_1 = require("./addJunctionNode");
|
|
14
11
|
const nodeFactory = ({ graph, node, tools, llm, emit, agent, }) => {
|
|
15
12
|
const nodeType = node.type;
|
|
16
13
|
switch (nodeType) {
|
|
@@ -21,7 +18,7 @@ const nodeFactory = ({ graph, node, tools, llm, emit, agent, }) => {
|
|
|
21
18
|
(0, addToolNode_1.addToolNode)({ graph, node, tools, llm, agent });
|
|
22
19
|
break;
|
|
23
20
|
case Flows_types_1.NodeType.JUNCTION:
|
|
24
|
-
addJunctionNode({ graph, node });
|
|
21
|
+
(0, addJunctionNode_1.addJunctionNode)({ graph, node });
|
|
25
22
|
break;
|
|
26
23
|
case Flows_types_1.NodeType.APP_TOOL:
|
|
27
24
|
(0, addAppToolNode_1.addAppToolNode)({ graph, node, llm, agent });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFactory.js","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"nodeFactory.js","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AAGtD,+CAA4C;AAC5C,mDAAgD;AAGhD,qDAAkD;AAClD,qDAAkD;AAGlD,mDAAgD;AAChD,uDAAoD;AAE7C,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,IAAI,EACJ,KAAK,GAQN,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC3B,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,sBAAQ,CAAC,OAAO;YACnB,IAAA,+BAAc,EAAC,EAAE,KAA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