@minded-ai/mindedjs 1.0.102 → 1.0.103-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.
Files changed (170) hide show
  1. package/dist/agent.d.ts +4 -1
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +76 -30
  4. package/dist/agent.js.map +1 -1
  5. package/dist/checkpointer/checkpointSaverFactory.js +1 -1
  6. package/dist/checkpointer/checkpointSaverFactory.js.map +1 -1
  7. package/dist/cli/index.js +12 -12
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/edges/createDirectEdge.d.ts +1 -2
  10. package/dist/edges/createDirectEdge.d.ts.map +1 -1
  11. package/dist/edges/createDirectEdge.js +2 -6
  12. package/dist/edges/createDirectEdge.js.map +1 -1
  13. package/dist/edges/createLogicalRouter.d.ts.map +1 -1
  14. package/dist/edges/createLogicalRouter.js +6 -23
  15. package/dist/edges/createLogicalRouter.js.map +1 -1
  16. package/dist/edges/createPromptRouter.d.ts.map +1 -1
  17. package/dist/edges/createPromptRouter.js +6 -12
  18. package/dist/edges/createPromptRouter.js.map +1 -1
  19. package/dist/edges/edgeFactory.d.ts.map +1 -1
  20. package/dist/edges/edgeFactory.js +3 -8
  21. package/dist/edges/edgeFactory.js.map +1 -1
  22. package/dist/index.d.ts +0 -4
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -6
  25. package/dist/index.js.map +1 -1
  26. package/dist/interrupts/BaseInterruptSessionManager.d.ts +51 -0
  27. package/dist/interrupts/BaseInterruptSessionManager.d.ts.map +1 -0
  28. package/dist/interrupts/BaseInterruptSessionManager.js +39 -0
  29. package/dist/interrupts/BaseInterruptSessionManager.js.map +1 -0
  30. package/dist/interrupts/InterruptSessionManager.types.d.ts +36 -0
  31. package/dist/interrupts/InterruptSessionManager.types.d.ts.map +1 -0
  32. package/dist/interrupts/InterruptSessionManager.types.js +40 -0
  33. package/dist/interrupts/InterruptSessionManager.types.js.map +1 -0
  34. package/dist/interrupts/MemoryInterruptSessionManager.d.ts +14 -0
  35. package/dist/interrupts/MemoryInterruptSessionManager.d.ts.map +1 -0
  36. package/dist/interrupts/MemoryInterruptSessionManager.js +56 -0
  37. package/dist/interrupts/MemoryInterruptSessionManager.js.map +1 -0
  38. package/dist/interrupts/MindedInterruptSessionManager.d.ts +13 -0
  39. package/dist/interrupts/MindedInterruptSessionManager.d.ts.map +1 -0
  40. package/dist/interrupts/MindedInterruptSessionManager.js +156 -0
  41. package/dist/interrupts/MindedInterruptSessionManager.js.map +1 -0
  42. package/dist/interrupts/interruptSessionManagerFactory.d.ts +3 -0
  43. package/dist/interrupts/interruptSessionManagerFactory.d.ts.map +1 -0
  44. package/dist/interrupts/interruptSessionManagerFactory.js +56 -0
  45. package/dist/interrupts/interruptSessionManagerFactory.js.map +1 -0
  46. package/dist/llm/createLlmInstance.d.ts +1 -1
  47. package/dist/llm/createLlmInstance.d.ts.map +1 -1
  48. package/dist/llm/createLlmInstance.js +1 -18
  49. package/dist/llm/createLlmInstance.js.map +1 -1
  50. package/dist/nodes/addAppToolNode.d.ts.map +1 -1
  51. package/dist/nodes/addAppToolNode.js +4 -5
  52. package/dist/nodes/addAppToolNode.js.map +1 -1
  53. package/dist/nodes/addHumanInTheLoopNode.d.ts.map +1 -1
  54. package/dist/nodes/addHumanInTheLoopNode.js +3 -2
  55. package/dist/nodes/addHumanInTheLoopNode.js.map +1 -1
  56. package/dist/nodes/addJumpToNode.d.ts.map +1 -1
  57. package/dist/nodes/addJumpToNode.js +1 -2
  58. package/dist/nodes/addJumpToNode.js.map +1 -1
  59. package/dist/nodes/addJunctionNode.d.ts.map +1 -1
  60. package/dist/nodes/addJunctionNode.js +0 -1
  61. package/dist/nodes/addJunctionNode.js.map +1 -1
  62. package/dist/nodes/addPromptNode.d.ts.map +1 -1
  63. package/dist/nodes/addPromptNode.js +61 -7
  64. package/dist/nodes/addPromptNode.js.map +1 -1
  65. package/dist/nodes/addToolNode.js +4 -2
  66. package/dist/nodes/addToolNode.js.map +1 -1
  67. package/dist/nodes/addToolRunNode.d.ts.map +1 -1
  68. package/dist/nodes/addToolRunNode.js +2 -2
  69. package/dist/nodes/addToolRunNode.js.map +1 -1
  70. package/dist/nodes/addTriggerNode.d.ts.map +1 -1
  71. package/dist/nodes/addTriggerNode.js +1 -2
  72. package/dist/nodes/addTriggerNode.js.map +1 -1
  73. package/dist/nodes/nodeFactory.d.ts.map +1 -1
  74. package/dist/nodes/nodeFactory.js +0 -4
  75. package/dist/nodes/nodeFactory.js.map +1 -1
  76. package/dist/platform/mindedChatOpenAI.d.ts +5 -0
  77. package/dist/platform/mindedChatOpenAI.d.ts.map +1 -0
  78. package/dist/platform/{models/mindedChatOpenAI.js → mindedChatOpenAI.js} +1 -10
  79. package/dist/platform/mindedChatOpenAI.js.map +1 -0
  80. package/dist/platform/mindedConnection.d.ts.map +1 -1
  81. package/dist/platform/mindedConnection.js +12 -12
  82. package/dist/platform/mindedConnection.js.map +1 -1
  83. package/dist/platform/mindedConnectionTypes.d.ts +151 -1
  84. package/dist/platform/mindedConnectionTypes.d.ts.map +1 -1
  85. package/dist/platform/mindedConnectionTypes.js +9 -0
  86. package/dist/platform/mindedConnectionTypes.js.map +1 -1
  87. package/dist/playbooks/playbooks.js +4 -4
  88. package/dist/playbooks/playbooks.js.map +1 -1
  89. package/dist/types/Agent.types.d.ts +2 -0
  90. package/dist/types/Agent.types.d.ts.map +1 -1
  91. package/dist/types/Agent.types.js.map +1 -1
  92. package/dist/types/Flows.types.d.ts +3 -18
  93. package/dist/types/Flows.types.d.ts.map +1 -1
  94. package/dist/types/Flows.types.js +0 -2
  95. package/dist/types/Flows.types.js.map +1 -1
  96. package/dist/types/LLM.types.d.ts.map +1 -1
  97. package/dist/types/LLM.types.js +1 -1
  98. package/dist/types/LLM.types.js.map +1 -1
  99. package/dist/types/LangGraph.types.d.ts +2 -4
  100. package/dist/types/LangGraph.types.d.ts.map +1 -1
  101. package/dist/types/LangGraph.types.js +2 -5
  102. package/dist/types/LangGraph.types.js.map +1 -1
  103. package/dist/utils/logger.d.ts.map +1 -1
  104. package/dist/utils/logger.js +2 -1
  105. package/dist/utils/logger.js.map +1 -1
  106. package/dist/voice/voiceSession.d.ts.map +1 -1
  107. package/dist/voice/voiceSession.js +17 -16
  108. package/dist/voice/voiceSession.js.map +1 -1
  109. package/docs/SUMMARY.md +0 -1
  110. package/docs/getting-started/installation.md +0 -42
  111. package/docs/low-code-editor/nodes.md +0 -27
  112. package/docs/low-code-editor/tools.md +0 -32
  113. package/package.json +2 -3
  114. package/src/agent.ts +93 -32
  115. package/src/checkpointer/checkpointSaverFactory.ts +1 -1
  116. package/src/cli/index.ts +12 -12
  117. package/src/edges/createDirectEdge.ts +2 -7
  118. package/src/edges/createLogicalRouter.ts +6 -23
  119. package/src/edges/createPromptRouter.ts +6 -13
  120. package/src/edges/edgeFactory.ts +4 -20
  121. package/src/index.ts +0 -6
  122. package/src/interrupts/BaseInterruptSessionManager.ts +94 -0
  123. package/src/interrupts/MemoryInterruptSessionManager.ts +57 -0
  124. package/src/interrupts/MindedInterruptSessionManager.ts +155 -0
  125. package/src/interrupts/interruptSessionManagerFactory.ts +20 -0
  126. package/src/llm/createLlmInstance.ts +2 -25
  127. package/src/nodes/addAppToolNode.ts +4 -5
  128. package/src/nodes/addHumanInTheLoopNode.ts +3 -3
  129. package/src/nodes/addJumpToNode.ts +1 -2
  130. package/src/nodes/addJunctionNode.ts +0 -1
  131. package/src/nodes/addPromptNode.ts +65 -10
  132. package/src/nodes/addToolNode.ts +4 -4
  133. package/src/nodes/addToolRunNode.ts +2 -4
  134. package/src/nodes/addTriggerNode.ts +1 -2
  135. package/src/nodes/nodeFactory.ts +1 -5
  136. package/src/platform/mindedChatOpenAI.ts +19 -0
  137. package/src/platform/mindedConnection.ts +15 -25
  138. package/src/platform/mindedConnectionTypes.ts +188 -1
  139. package/src/playbooks/playbooks.ts +4 -4
  140. package/src/types/Agent.types.ts +2 -0
  141. package/src/types/Flows.types.ts +1 -17
  142. package/src/types/LLM.types.ts +5 -5
  143. package/src/types/LangGraph.types.ts +2 -5
  144. package/src/utils/logger.ts +2 -1
  145. package/src/voice/voiceSession.ts +17 -16
  146. package/dist/browserTask/executeBrowserTask.d.ts +0 -12
  147. package/dist/browserTask/executeBrowserTask.d.ts.map +0 -1
  148. package/dist/browserTask/executeBrowserTask.js +0 -181
  149. package/dist/browserTask/executeBrowserTask.js.map +0 -1
  150. package/dist/nodes/addBrowserTaskNode.d.ts +0 -13
  151. package/dist/nodes/addBrowserTaskNode.d.ts.map +0 -1
  152. package/dist/nodes/addBrowserTaskNode.js +0 -230
  153. package/dist/nodes/addBrowserTaskNode.js.map +0 -1
  154. package/dist/nodes/addBrowserTaskRunNode.d.ts +0 -13
  155. package/dist/nodes/addBrowserTaskRunNode.d.ts.map +0 -1
  156. package/dist/nodes/addBrowserTaskRunNode.js +0 -126
  157. package/dist/nodes/addBrowserTaskRunNode.js.map +0 -1
  158. package/dist/platform/models/mindedChatOpenAI.d.ts +0 -20
  159. package/dist/platform/models/mindedChatOpenAI.d.ts.map +0 -1
  160. package/dist/platform/models/mindedChatOpenAI.js.map +0 -1
  161. package/dist/platform/models/parallelWrapper.d.ts +0 -17
  162. package/dist/platform/models/parallelWrapper.d.ts.map +0 -1
  163. package/dist/platform/models/parallelWrapper.js +0 -105
  164. package/dist/platform/models/parallelWrapper.js.map +0 -1
  165. package/docs/platform/parallel-llm.md +0 -242
  166. package/src/browserTask/executeBrowserTask.ts +0 -213
  167. package/src/nodes/addBrowserTaskNode.ts +0 -229
  168. package/src/nodes/addBrowserTaskRunNode.ts +0 -142
  169. package/src/platform/models/mindedChatOpenAI.ts +0 -49
  170. package/src/platform/models/parallelWrapper.ts +0 -141
@@ -0,0 +1,156 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.MindedInterruptSessionManager = void 0;
37
+ const BaseInterruptSessionManager_1 = require("./BaseInterruptSessionManager");
38
+ const mindedConnection = __importStar(require("../platform/mindedConnection"));
39
+ const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
40
+ class MindedInterruptSessionManager extends BaseInterruptSessionManager_1.BaseInterruptSessionManager {
41
+ constructor() {
42
+ super();
43
+ }
44
+ async isProcessed(sessionId) {
45
+ var _a;
46
+ try {
47
+ const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_IS_PROCESSED, {
48
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_IS_PROCESSED,
49
+ sessionId,
50
+ });
51
+ return (_a = response.isProcessed) !== null && _a !== void 0 ? _a : false;
52
+ }
53
+ catch (error) {
54
+ console.error('Error checking if session is processed:', error);
55
+ return false;
56
+ }
57
+ }
58
+ async lock(sessionId) {
59
+ var _a;
60
+ try {
61
+ const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_LOCK, {
62
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_LOCK,
63
+ sessionId,
64
+ });
65
+ return (_a = response.lockAcquired) !== null && _a !== void 0 ? _a : false;
66
+ }
67
+ catch (error) {
68
+ console.error('Error locking session:', error);
69
+ return false;
70
+ }
71
+ }
72
+ async release(sessionId) {
73
+ try {
74
+ await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_RELEASE, {
75
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_RELEASE,
76
+ sessionId,
77
+ });
78
+ }
79
+ catch (error) {
80
+ console.error('Error releasing session:', error);
81
+ throw error;
82
+ }
83
+ }
84
+ async enqueueMessage(sessionId, message) {
85
+ try {
86
+ await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_ENQUEUE, {
87
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_ENQUEUE,
88
+ sessionId,
89
+ message,
90
+ });
91
+ }
92
+ catch (error) {
93
+ console.error('Error enqueuing message:', error);
94
+ throw error;
95
+ }
96
+ }
97
+ async dequeueAll(sessionId) {
98
+ var _a;
99
+ try {
100
+ const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE_ALL, {
101
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE_ALL,
102
+ sessionId,
103
+ });
104
+ return (_a = response.messages) !== null && _a !== void 0 ? _a : [];
105
+ }
106
+ catch (error) {
107
+ console.error('Error dequeuing all messages:', error);
108
+ return [];
109
+ }
110
+ }
111
+ async dequeue(sessionId) {
112
+ var _a;
113
+ try {
114
+ const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE, {
115
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_DEQUEUE,
116
+ sessionId,
117
+ });
118
+ return (_a = response.message) !== null && _a !== void 0 ? _a : null;
119
+ }
120
+ catch (error) {
121
+ console.error('Error dequeuing message:', error);
122
+ return null;
123
+ }
124
+ }
125
+ // Implementation of abstract methods from BaseInterruptSessionManager
126
+ async hasQueuedMessages(sessionId) {
127
+ var _a;
128
+ try {
129
+ const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_HAS_MESSAGES, {
130
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_HAS_MESSAGES,
131
+ sessionId,
132
+ });
133
+ return (_a = response.hasMessages) !== null && _a !== void 0 ? _a : false;
134
+ }
135
+ catch (error) {
136
+ console.error('Error checking if session has messages:', error);
137
+ return false;
138
+ }
139
+ }
140
+ async getQueuedMessages(sessionId) {
141
+ var _a;
142
+ try {
143
+ const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_GET_MESSAGES, {
144
+ type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.INTERRUPT_SESSION_GET_MESSAGES,
145
+ sessionId,
146
+ });
147
+ return (_a = response.messages) !== null && _a !== void 0 ? _a : [];
148
+ }
149
+ catch (error) {
150
+ console.error('Error getting queued messages:', error);
151
+ return [];
152
+ }
153
+ }
154
+ }
155
+ exports.MindedInterruptSessionManager = MindedInterruptSessionManager;
156
+ //# sourceMappingURL=MindedInterruptSessionManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MindedInterruptS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,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;YACjD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,sEAAsE;IAC5D,KAAK,CAAC,iBAAiB,CAAC,SAAiB;;QACjD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAC/C,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;IAES,KAAK,CAAC,iBAAiB,CAAC,SAAiB;;QACjD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAC/C,yDAAiC,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;AApID,sEAoIC"}
@@ -0,0 +1,3 @@
1
+ import { InterruptSessionManager } from './BaseInterruptSessionManager';
2
+ export declare function createInterruptSessionManager(): InterruptSessionManager;
3
+ //# 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,+BAA+B,CAAC;AAOxE,wBAAgB,6BAA6B,IAAI,uBAAuB,CAYvE"}
@@ -0,0 +1,56 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.createInterruptSessionManager = createInterruptSessionManager;
37
+ const MemoryInterruptSessionManager_1 = require("./MemoryInterruptSessionManager");
38
+ const MindedInterruptSessionManager_1 = require("./MindedInterruptSessionManager");
39
+ const mindedConnection = __importStar(require("../platform/mindedConnection"));
40
+ const config_1 = require("../platform/config");
41
+ const logger_1 = require("../utils/logger");
42
+ function createInterruptSessionManager() {
43
+ const { runLocally } = (0, config_1.getConfig)();
44
+ if (runLocally) {
45
+ logger_1.logger.info({ message: 'Using memory interrupt session manager' });
46
+ return new MemoryInterruptSessionManager_1.MemoryInterruptSessionManager();
47
+ }
48
+ else {
49
+ if (!mindedConnection.isConnected()) {
50
+ throw new Error('MindedConnection is required for platform interrupt session manager');
51
+ }
52
+ logger_1.logger.info({ message: 'Using Minded interrupt session manager' });
53
+ return new MindedInterruptSessionManager_1.MindedInterruptSessionManager();
54
+ }
55
+ }
56
+ //# 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,OAAO,EAAE,wCAAwC,EAAE,CAAC,CAAC;QACnE,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,OAAO,EAAE,wCAAwC,EAAE,CAAC,CAAC;QACnE,OAAO,IAAI,6DAA6B,EAAE,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
- import { LLMConfig } from '../types/LLM.types';
1
+ import { LLMConfig } from "../types/LLM.types";
2
2
  export declare const createLlmInstance: (llmConfig: LLMConfig) => any;
3
3
  //# sourceMappingURL=createLlmInstance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createLlmInstance.d.ts","sourceRoot":"","sources":["../../src/llm/createLlmInstance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,oBAAoB,CAAC;AAG1E,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,QA6BrD,CAAC"}
1
+ {"version":3,"file":"createLlmInstance.d.ts","sourceRoot":"","sources":["../../src/llm/createLlmInstance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,oBAAoB,CAAC;AAE1E,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,QAOrD,CAAC"}
@@ -2,30 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createLlmInstance = void 0;
4
4
  const LLM_types_1 = require("../types/LLM.types");
5
- const parallelWrapper_1 = require("../platform/models/parallelWrapper");
6
5
  const createLlmInstance = (llmConfig) => {
7
6
  const { name, properties } = llmConfig;
8
7
  const LLMClass = LLM_types_1.LLMProviders[name];
9
8
  if (!LLMClass) {
10
9
  throw new Error(`Unsupported LLM provider: ${name}`);
11
10
  }
12
- // Create the base LLM instance
13
- const llmInstance = new LLMClass(properties);
14
- // Check if parallel configuration is present
15
- const hasParallelConfig = properties.numParallelRequests && properties.numParallelRequests > 1;
16
- // For MindedChatOpenAI, parallel functionality is handled on the backend
17
- if (name === 'MindedChatOpenAI') {
18
- return llmInstance;
19
- }
20
- // For other LLM providers, apply client-side parallel wrapper if configured
21
- if (hasParallelConfig) {
22
- const parallelOptions = {
23
- numParallelRequests: properties.numParallelRequests,
24
- logTimings: properties.logTimings,
25
- };
26
- return (0, parallelWrapper_1.createParallelWrapper)(llmInstance, parallelOptions);
27
- }
28
- return llmInstance;
11
+ return new LLMClass(properties);
29
12
  };
30
13
  exports.createLlmInstance = createLlmInstance;
31
14
  //# sourceMappingURL=createLlmInstance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createLlmInstance.js","sourceRoot":"","sources":["../../src/llm/createLlmInstance.ts"],"names":[],"mappings":";;;AAAA,kDAA0E;AAC1E,wEAAmG;AAE5F,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAE,EAAE;IACxD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,QAAQ,GAAG,wBAAY,CAAC,IAAmB,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,+BAA+B;IAC/B,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE7C,6CAA6C;IAC7C,MAAM,iBAAiB,GAAG,UAAU,CAAC,mBAAmB,IAAI,UAAU,CAAC,mBAAmB,GAAG,CAAC,CAAC;IAE/F,yEAAyE;IACzE,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;QAChC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,4EAA4E;IAC5E,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,eAAe,GAA2B;YAC9C,mBAAmB,EAAE,UAAU,CAAC,mBAAmB;YACnD,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;QAEF,OAAO,IAAA,uCAAqB,EAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AA7BW,QAAA,iBAAiB,qBA6B5B"}
1
+ {"version":3,"file":"createLlmInstance.js","sourceRoot":"","sources":["../../src/llm/createLlmInstance.ts"],"names":[],"mappings":";;;AAAA,kDAA0E;AAEnE,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAE,EAAE;IACxD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,QAAQ,GAAG,wBAAY,CAAC,IAAmB,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC,CAAC;AAPW,QAAA,iBAAiB,qBAO5B"}
@@ -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;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,kBAuEA,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;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"}
@@ -12,14 +12,14 @@ const addAppToolNode = async ({ graph, node, llm, agent, }) => {
12
12
  const cleanedParameters = Object.fromEntries(Object.entries(node.parameters || {}).filter(([, value]) => value !== ''));
13
13
  const appRunnerTool = (0, appActionRunnerTool_1.getAppActionRunnerTool)(node.displayName);
14
14
  const callback = async (state) => {
15
- logger_1.logger.debug({ msg: `[Node] Executing tool node`, node: appRunnerTool.name });
15
+ logger_1.logger.info({ message: `Executing tool node ${appRunnerTool.name}` });
16
16
  const executeWrapper = async (input) => {
17
17
  try {
18
18
  const response = await appRunnerTool.execute({ input, state, agent });
19
19
  return response || {};
20
20
  }
21
21
  catch (error) {
22
- logger_1.logger.error({ msg: `[Node] Error executing tool`, error, node: node.name });
22
+ logger_1.logger.error({ msg: 'Error executing tool', error });
23
23
  throw error;
24
24
  }
25
25
  };
@@ -60,12 +60,11 @@ const addAppToolNode = async ({ graph, node, llm, agent, }) => {
60
60
  };
61
61
  const toolCallMessage = await tool.invoke(AIToolCallMessage.tool_calls[0]);
62
62
  AIToolCallMessage.additional_kwargs = {
63
- mindedMetadata: {
64
- nodeType: Flows_types_1.NodeType.APP_TOOL
63
+ appActionInvocation: {
64
+ nodeTitle: node.name,
65
65
  },
66
66
  };
67
67
  return {
68
- goto: null,
69
68
  messages: [AIToolCallMessage, toolCallMessage],
70
69
  history: (0, history_1.createHistoryStep)(state.history, {
71
70
  type: Flows_types_1.NodeType.APP_TOOL,
@@ -1 +1 @@
1
- {"version":3,"file":"addAppToolNode.js","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":";;;AAAA,sDAA6D;AAC7D,iDAA8D;AAE9D,uDAAyD;AAIzD,8EAA8E;AAG9E,4CAAyC;AACzC,sDAA0D;AAC1D,8CAAqD;AAE9C,MAAM,cAAc,GAAG,KAAK,EAAE,EACnC,KAAK,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AI,UAAU,MAAM,WAA0D,CAAC;AAEvH,eAAO,MAAM,qBAAqB,GAAU,+BAA+B,2BAA2B,kBAWrG,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,kBAUrG,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
- logger_1.logger.debug({ msg: `[Node] Waiting for human input`, node: attachedToNodeName });
12
+ logger_1.logger.info({ message: `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)('input from human in the loop');
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;AAOpD,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,8BAA8B,CAAC,CAAC;YACxD,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
+ {"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,IAAI,CAAC,EAAE,OAAO,EAAE,2DAA2D,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAC1G,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;AAVW,QAAA,qBAAqB,yBAUhC"}
@@ -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,EAAY,MAAM,sBAAsB,CAAC;AAK5D,eAAO,MAAM,aAAa,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,kBAiBjG,CAAC"}
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"}
@@ -6,10 +6,9 @@ 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({ message: `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: null,
13
12
  history: (0, history_1.createHistoryStep)(state.history, {
14
13
  type: Flows_types_1.NodeType.JUMP_TO_NODE,
15
14
  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;QACzF,2EAA2E;QAC3E,OAAO;YACL,IAAI,EAAE,IAAI;YACV,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;AAjBW,QAAA,aAAa,iBAiBxB"}
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,EAAE,OAAO,EAAE,uBAAuB,IAAI,CAAC,WAAW,iBAAiB,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACtG,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"}
@@ -1 +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,SAa/F,CAAC"}
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"}
@@ -6,7 +6,6 @@ const history_1 = require("../utils/history");
6
6
  const addJunctionNode = ({ graph, node }) => {
7
7
  const callback = async (state) => {
8
8
  return {
9
- goto: null,
10
9
  history: (0, history_1.createHistoryStep)(state.history, {
11
10
  type: Flows_types_1.NodeType.JUNCTION,
12
11
  nodeId: node.name,
@@ -1 +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,IAAI,EAAE,IAAI;YACV,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;AAbW,QAAA,eAAe,mBAa1B"}
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,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,KAA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ryResponse_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 wait_1 = require("../utils/wait");
17
+ const sendPlaceholderMessage_1 = require("../internalTools/sendPlaceholderMessage");
18
+ const uuid_1 = require("uuid");
19
+ let shouldWait = true;
16
20
  const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
17
21
  const callback = async (state) => {
18
- logger_1.logger.debug({ msg: `[Node] Executing prompt node`, node: node.displayName });
22
+ await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
23
+ logger_1.logger.info({ message: `Executing prompt node ${node.displayName}` });
19
24
  const llmToUse = node.llmConfig ? (0, createLlmInstance_1.createLlmInstance)(node.llmConfig) : llm;
20
25
  const globalTools = tools
21
26
  .filter((tool) => tool.isGlobal)
@@ -34,7 +39,18 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
34
39
  ${state.memory ? `# Task context:\n${JSON.stringify(state.memory)}\n\n` : ''}
35
40
  ${compiledPlaybooks ? `# General guidelines:\n${compiledPlaybooks}\n\n` : ''}
36
41
  `;
42
+ if (true) {
43
+ logger_1.logger.info({ msg: `waiting 15 seconds` });
44
+ shouldWait = false;
45
+ await (0, sendPlaceholderMessage_1.sendPlaceholderMessage)({ sessionId: state.sessionId, message: 'just a moment please... ' });
46
+ await (0, wait_1.wait)(10000);
47
+ logger_1.logger.info({ msg: `done waiting 15 seconds` });
48
+ }
49
+ else {
50
+ logger_1.logger.info({ msg: `not waiting` });
51
+ }
37
52
  const result = await llmToUse.bindTools(globalTools).invoke([...state.messages, new messages_1.SystemMessage(message)]);
53
+ await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
38
54
  // Check if the result contains tool calls
39
55
  if (result.tool_calls && result.tool_calls.length > 0) {
40
56
  // Execute the tools
@@ -42,12 +58,32 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
42
58
  let stateUpdates = {};
43
59
  for (const toolCall of result.tool_calls) {
44
60
  const matchedTool = globalTools.find((t) => t.name === toolCall.name);
45
- logger_1.logger.info({ msg: `[Model] Calling tool`, tool: matchedTool === null || matchedTool === void 0 ? void 0 : matchedTool.name });
61
+ logger_1.logger.info({ msg: `Model called tool ${matchedTool === null || matchedTool === void 0 ? void 0 : matchedTool.name}` });
46
62
  if (matchedTool) {
47
63
  try {
48
64
  // Invoke the LangChain tool directly
49
65
  const toolResult = await matchedTool.invoke(toolCall);
50
- logger_1.logger.debug({ msg: `[Tool] Tool result`, tool: matchedTool === null || matchedTool === void 0 ? void 0 : matchedTool.name, result: toolResult });
66
+ //check for queue after tool call
67
+ const systemMessageId = (0, uuid_1.v4)();
68
+ await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId, {
69
+ messages: [
70
+ result,
71
+ toolResult,
72
+ new messages_1.SystemMessage({
73
+ id: systemMessageId,
74
+ content: 'you called tool when the user send a new message, Consider calling the function again after user message is processed',
75
+ }),
76
+ ],
77
+ history: [
78
+ (0, history_1.createHistoryStep)(state.history, {
79
+ type: Flows_types_1.NodeType.TOOL,
80
+ nodeId: node.name,
81
+ nodeDisplayName: node.displayName,
82
+ raw: toolResult,
83
+ messageIds: [toolResult.id, systemMessageId],
84
+ }),
85
+ ],
86
+ });
51
87
  const toolStateUpdate = (0, extractStateMemoryResponse_1.default)(toolResult);
52
88
  // Properly merge memory and other state updates
53
89
  stateUpdates = {
@@ -58,7 +94,9 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
58
94
  toolResults.push(toolResult);
59
95
  }
60
96
  catch (error) {
61
- logger_1.logger.error({ msg: `[Tool] Error executing tool`, tool: toolCall.name, error });
97
+ if ((error === null || error === void 0 ? void 0 : error.name) === 'GraphInterrupt')
98
+ throw error;
99
+ logger_1.logger.error({ msg: `Error executing tool ${toolCall.name}:`, error });
62
100
  const errorMessage = new messages_1.ToolMessage({
63
101
  content: JSON.stringify({ error: error instanceof Error ? error.message : String(error) }),
64
102
  tool_call_id: toolCall.id,
@@ -67,13 +105,30 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
67
105
  }
68
106
  }
69
107
  else {
70
- logger_1.logger.error({ msg: `[Tool] Model called tool but it was not found`, tool: toolCall.name });
108
+ logger_1.logger.error({ msg: `Model tried to call tool ${toolCall.name} but it was not found` });
71
109
  }
72
110
  }
111
+ // await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
73
112
  // Return the tool call message and tool results with state updates spread at top level
74
113
  return {
75
114
  ...stateUpdates,
76
115
  messages: [result, ...toolResults],
116
+ history: [
117
+ (0, history_1.createHistoryStep)(state.history, {
118
+ type: Flows_types_1.NodeType.TOOL,
119
+ nodeId: node.name,
120
+ nodeDisplayName: node.displayName,
121
+ raw: result,
122
+ messageIds: [result.id],
123
+ }),
124
+ ...toolResults.map((toolResult) => (0, history_1.createHistoryStep)(state.history, {
125
+ type: Flows_types_1.NodeType.TOOL,
126
+ nodeId: node.name,
127
+ nodeDisplayName: node.displayName,
128
+ raw: toolResult,
129
+ messageIds: [toolResult.id],
130
+ })),
131
+ ],
77
132
  };
78
133
  }
79
134
  if (result.getType() === 'ai') {
@@ -81,10 +136,9 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
81
136
  message: result.content,
82
137
  state,
83
138
  });
84
- logger_1.logger.info({ msg: `[Model] Response`, content: result.content });
139
+ console.log('AI Message', result.content);
85
140
  }
86
141
  return {
87
- goto: null,
88
142
  history: (0, history_1.createHistoryStep)(state.history, {
89
143
  type: Flows_types_1.NodeType.PROMPT_NODE,
90
144
  nodeId: node.name,
@@ -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,sD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AAC;YAC9B,MAAM,IAAI,CAAC,yBAAW,CAAC,UAAU,EAAE;gBACjC,OAAO,EAAE,MAAM,CAAC,OAAiB;gBACjC,KAAK;aACN,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO;YACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,WAAW;gBAC1B,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,MAAM,CAAC,OAAO;gBACnB,UAAU,EAAE,CAAC,MAAM,CAAC,EAAG,CAAC;aACzB,CAAC;YACF,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AA/IW,QAAA,aAAa,iBA+IxB"}
@@ -15,7 +15,8 @@ const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
15
15
  }
16
16
  const callback = async (state) => {
17
17
  var _a;
18
- logger_1.logger.debug({ msg: `[Node] Executing tool node`, node: toolNode.displayName });
18
+ await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
19
+ logger_1.logger.info({ message: `Executing tool node ${toolNode.displayName}` });
19
20
  const tool = (0, tools_1.tool)(() => { }, {
20
21
  name: matchedTool.name,
21
22
  description: matchedTool.description,
@@ -38,8 +39,9 @@ const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
38
39
  tool_choice: tool.name,
39
40
  })
40
41
  .invoke([...state.messages, new messages_1.SystemMessage(prompt)]);
42
+ logger_1.logger.info({ message: 'after llm tool invoke' });
43
+ await agent.interruptSessionManager.checkQueueAndInterrupt(state.sessionId);
41
44
  return {
42
- goto: null,
43
45
  messages: [AIToolCallMessage],
44
46
  history: (0, history_1.createHistoryStep)(state.history, {
45
47
  type: Flows_types_1.NodeType.TOOL,
@@ -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,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,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;YACpC,MAAM,EAAE,WAAW,CAAC,KAAK;SAC1B,CAAC,CAAC;QAEH,gDAAgD;QAChD,MAAM,cAAc,GAAG;YACrB,GAAG,KAAK,CAAC,MAAM,EAAE,wCAAwC;YACzD,KAAK,EAAE,iDAAiD;YACxD,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EA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