@minded-ai/mindedjs 1.0.0-ec2-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 (454) hide show
  1. package/README.md +6 -0
  2. package/dist/agent.d.ts +256 -0
  3. package/dist/agent.d.ts.map +1 -0
  4. package/dist/agent.js +896 -0
  5. package/dist/agent.js.map +1 -0
  6. package/dist/browserTask/README.md +419 -0
  7. package/dist/browserTask/browserAgent.py +632 -0
  8. package/dist/browserTask/captcha_isolated.png +0 -0
  9. package/dist/browserTask/executeBrowserTask.d.ts +14 -0
  10. package/dist/browserTask/executeBrowserTask.d.ts.map +1 -0
  11. package/dist/browserTask/executeBrowserTask.js +195 -0
  12. package/dist/browserTask/executeBrowserTask.js.map +1 -0
  13. package/dist/browserTask/executeBrowserTask.py +153 -0
  14. package/dist/browserTask/executeBrowserTask.ts +79 -0
  15. package/dist/browserTask/localBrowserTask.d.ts +49 -0
  16. package/dist/browserTask/localBrowserTask.d.ts.map +1 -0
  17. package/dist/browserTask/localBrowserTask.js +284 -0
  18. package/dist/browserTask/localBrowserTask.js.map +1 -0
  19. package/dist/browserTask/requirements.txt +8 -0
  20. package/dist/browserTask/setup.sh +144 -0
  21. package/dist/browserTask/types.d.ts +35 -0
  22. package/dist/browserTask/types.d.ts.map +1 -0
  23. package/dist/browserTask/types.js +10 -0
  24. package/dist/browserTask/types.js.map +1 -0
  25. package/dist/checkpointer/checkpointSaverFactory.d.ts +7 -0
  26. package/dist/checkpointer/checkpointSaverFactory.d.ts.map +1 -0
  27. package/dist/checkpointer/checkpointSaverFactory.js +53 -0
  28. package/dist/checkpointer/checkpointSaverFactory.js.map +1 -0
  29. package/dist/cli/index.d.ts +3 -0
  30. package/dist/cli/index.d.ts.map +1 -0
  31. package/dist/cli/index.js +209 -0
  32. package/dist/cli/index.js.map +1 -0
  33. package/dist/cli/lambdaHandlerTemplate.d.ts +10 -0
  34. package/dist/cli/lambdaHandlerTemplate.d.ts.map +1 -0
  35. package/dist/cli/lambdaHandlerTemplate.js +76 -0
  36. package/dist/cli/lambdaHandlerTemplate.js.map +1 -0
  37. package/dist/cli/lambdaHandlerTemplate.ts +78 -0
  38. package/dist/cli/localOperatorSetup.d.ts +6 -0
  39. package/dist/cli/localOperatorSetup.d.ts.map +1 -0
  40. package/dist/cli/localOperatorSetup.js +310 -0
  41. package/dist/cli/localOperatorSetup.js.map +1 -0
  42. package/dist/debugging/index.d.ts +2 -0
  43. package/dist/debugging/index.d.ts.map +1 -0
  44. package/dist/debugging/index.js +6 -0
  45. package/dist/debugging/index.js.map +1 -0
  46. package/dist/debugging/llmCallbackHandler.d.ts +36 -0
  47. package/dist/debugging/llmCallbackHandler.d.ts.map +1 -0
  48. package/dist/debugging/llmCallbackHandler.js +101 -0
  49. package/dist/debugging/llmCallbackHandler.js.map +1 -0
  50. package/dist/edges/createDirectEdge.d.ts +4 -0
  51. package/dist/edges/createDirectEdge.d.ts.map +1 -0
  52. package/dist/edges/createDirectEdge.js +24 -0
  53. package/dist/edges/createDirectEdge.js.map +1 -0
  54. package/dist/edges/createLogicalRouter.d.ts +8 -0
  55. package/dist/edges/createLogicalRouter.d.ts.map +1 -0
  56. package/dist/edges/createLogicalRouter.js +194 -0
  57. package/dist/edges/createLogicalRouter.js.map +1 -0
  58. package/dist/edges/createPromptRouter.d.ts +12 -0
  59. package/dist/edges/createPromptRouter.d.ts.map +1 -0
  60. package/dist/edges/createPromptRouter.js +176 -0
  61. package/dist/edges/createPromptRouter.js.map +1 -0
  62. package/dist/edges/edgeFactory.d.ts +14 -0
  63. package/dist/edges/edgeFactory.d.ts.map +1 -0
  64. package/dist/edges/edgeFactory.js +125 -0
  65. package/dist/edges/edgeFactory.js.map +1 -0
  66. package/dist/events/AgentEvents.d.ts +56 -0
  67. package/dist/events/AgentEvents.d.ts.map +1 -0
  68. package/dist/events/AgentEvents.js +13 -0
  69. package/dist/events/AgentEvents.js.map +1 -0
  70. package/dist/events/index.d.ts +3 -0
  71. package/dist/events/index.d.ts.map +1 -0
  72. package/dist/events/index.js +5 -0
  73. package/dist/events/index.js.map +1 -0
  74. package/dist/index.d.ts +35 -0
  75. package/dist/index.d.ts.map +1 -0
  76. package/dist/index.js +98 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/interfaces/zendesk.d.ts +35 -0
  79. package/dist/interfaces/zendesk.d.ts.map +1 -0
  80. package/dist/interfaces/zendesk.js +219 -0
  81. package/dist/interfaces/zendesk.js.map +1 -0
  82. package/dist/internalTools/appActionRunnerTool.d.ts +5 -0
  83. package/dist/internalTools/appActionRunnerTool.d.ts.map +1 -0
  84. package/dist/internalTools/appActionRunnerTool.js +88 -0
  85. package/dist/internalTools/appActionRunnerTool.js.map +1 -0
  86. package/dist/internalTools/documentExtraction/documentExtraction.d.ts +129 -0
  87. package/dist/internalTools/documentExtraction/documentExtraction.d.ts.map +1 -0
  88. package/dist/internalTools/documentExtraction/documentExtraction.js +736 -0
  89. package/dist/internalTools/documentExtraction/documentExtraction.js.map +1 -0
  90. package/dist/internalTools/documentExtraction/types.d.ts +29 -0
  91. package/dist/internalTools/documentExtraction/types.d.ts.map +1 -0
  92. package/dist/internalTools/documentExtraction/types.js +35 -0
  93. package/dist/internalTools/documentExtraction/types.js.map +1 -0
  94. package/dist/internalTools/libraryActionRunnerTool.d.ts +4 -0
  95. package/dist/internalTools/libraryActionRunnerTool.d.ts.map +1 -0
  96. package/dist/internalTools/libraryActionRunnerTool.js +53 -0
  97. package/dist/internalTools/libraryActionRunnerTool.js.map +1 -0
  98. package/dist/internalTools/retell.d.ts +12 -0
  99. package/dist/internalTools/retell.d.ts.map +1 -0
  100. package/dist/internalTools/retell.js +54 -0
  101. package/dist/internalTools/retell.js.map +1 -0
  102. package/dist/internalTools/sendPlaceholderMessage.d.ts +14 -0
  103. package/dist/internalTools/sendPlaceholderMessage.d.ts.map +1 -0
  104. package/dist/internalTools/sendPlaceholderMessage.js +61 -0
  105. package/dist/internalTools/sendPlaceholderMessage.js.map +1 -0
  106. package/dist/internalTools/timer.d.ts +99 -0
  107. package/dist/internalTools/timer.d.ts.map +1 -0
  108. package/dist/internalTools/timer.js +139 -0
  109. package/dist/internalTools/timer.js.map +1 -0
  110. package/dist/internalTools/voice/escalateVoiceCall.d.ts +2 -0
  111. package/dist/internalTools/voice/escalateVoiceCall.d.ts.map +1 -0
  112. package/dist/internalTools/voice/escalateVoiceCall.js +52 -0
  113. package/dist/internalTools/voice/escalateVoiceCall.js.map +1 -0
  114. package/dist/internalTools/voice/retell.d.ts +12 -0
  115. package/dist/internalTools/voice/retell.d.ts.map +1 -0
  116. package/dist/internalTools/voice/retell.js +54 -0
  117. package/dist/internalTools/voice/retell.js.map +1 -0
  118. package/dist/internalTools/voice/sendPlaceholderMessage.d.ts +14 -0
  119. package/dist/internalTools/voice/sendPlaceholderMessage.d.ts.map +1 -0
  120. package/dist/internalTools/voice/sendPlaceholderMessage.js +61 -0
  121. package/dist/internalTools/voice/sendPlaceholderMessage.js.map +1 -0
  122. package/dist/interrupts/BaseInterruptSessionManager.d.ts +49 -0
  123. package/dist/interrupts/BaseInterruptSessionManager.d.ts.map +1 -0
  124. package/dist/interrupts/BaseInterruptSessionManager.js +34 -0
  125. package/dist/interrupts/BaseInterruptSessionManager.js.map +1 -0
  126. package/dist/interrupts/MemoryInterruptSessionManager.d.ts +14 -0
  127. package/dist/interrupts/MemoryInterruptSessionManager.d.ts.map +1 -0
  128. package/dist/interrupts/MemoryInterruptSessionManager.js +60 -0
  129. package/dist/interrupts/MemoryInterruptSessionManager.js.map +1 -0
  130. package/dist/interrupts/MindedInterruptSessionManager.d.ts +13 -0
  131. package/dist/interrupts/MindedInterruptSessionManager.d.ts.map +1 -0
  132. package/dist/interrupts/MindedInterruptSessionManager.js +162 -0
  133. package/dist/interrupts/MindedInterruptSessionManager.js.map +1 -0
  134. package/dist/interrupts/interruptSessionManagerFactory.d.ts +3 -0
  135. package/dist/interrupts/interruptSessionManagerFactory.d.ts.map +1 -0
  136. package/dist/interrupts/interruptSessionManagerFactory.js +56 -0
  137. package/dist/interrupts/interruptSessionManagerFactory.js.map +1 -0
  138. package/dist/llm/createLlmInstance.d.ts +3 -0
  139. package/dist/llm/createLlmInstance.d.ts.map +1 -0
  140. package/dist/llm/createLlmInstance.js +31 -0
  141. package/dist/llm/createLlmInstance.js.map +1 -0
  142. package/dist/nodes/addAppToolNode.d.ts +13 -0
  143. package/dist/nodes/addAppToolNode.d.ts.map +1 -0
  144. package/dist/nodes/addAppToolNode.js +87 -0
  145. package/dist/nodes/addAppToolNode.js.map +1 -0
  146. package/dist/nodes/addBrowserTaskNode.d.ts +13 -0
  147. package/dist/nodes/addBrowserTaskNode.d.ts.map +1 -0
  148. package/dist/nodes/addBrowserTaskNode.js +167 -0
  149. package/dist/nodes/addBrowserTaskNode.js.map +1 -0
  150. package/dist/nodes/addBrowserTaskRunNode.d.ts +13 -0
  151. package/dist/nodes/addBrowserTaskRunNode.d.ts.map +1 -0
  152. package/dist/nodes/addBrowserTaskRunNode.js +167 -0
  153. package/dist/nodes/addBrowserTaskRunNode.js.map +1 -0
  154. package/dist/nodes/addHumanInTheLoopNode.d.ts +9 -0
  155. package/dist/nodes/addHumanInTheLoopNode.d.ts.map +1 -0
  156. package/dist/nodes/addHumanInTheLoopNode.js +22 -0
  157. package/dist/nodes/addHumanInTheLoopNode.js.map +1 -0
  158. package/dist/nodes/addJumpToNode.d.ts +7 -0
  159. package/dist/nodes/addJumpToNode.d.ts.map +1 -0
  160. package/dist/nodes/addJumpToNode.js +24 -0
  161. package/dist/nodes/addJumpToNode.js.map +1 -0
  162. package/dist/nodes/addJunctionNode.d.ts +7 -0
  163. package/dist/nodes/addJunctionNode.d.ts.map +1 -0
  164. package/dist/nodes/addJunctionNode.js +20 -0
  165. package/dist/nodes/addJunctionNode.js.map +1 -0
  166. package/dist/nodes/addPromptNode.d.ts +18 -0
  167. package/dist/nodes/addPromptNode.d.ts.map +1 -0
  168. package/dist/nodes/addPromptNode.js +253 -0
  169. package/dist/nodes/addPromptNode.js.map +1 -0
  170. package/dist/nodes/addRpaNode.d.ts +18 -0
  171. package/dist/nodes/addRpaNode.d.ts.map +1 -0
  172. package/dist/nodes/addRpaNode.js +180 -0
  173. package/dist/nodes/addRpaNode.js.map +1 -0
  174. package/dist/nodes/addToolNode.d.ts +13 -0
  175. package/dist/nodes/addToolNode.d.ts.map +1 -0
  176. package/dist/nodes/addToolNode.js +67 -0
  177. package/dist/nodes/addToolNode.js.map +1 -0
  178. package/dist/nodes/addToolRunNode.d.ts +17 -0
  179. package/dist/nodes/addToolRunNode.d.ts.map +1 -0
  180. package/dist/nodes/addToolRunNode.js +59 -0
  181. package/dist/nodes/addToolRunNode.js.map +1 -0
  182. package/dist/nodes/addTriggerNode.d.ts +7 -0
  183. package/dist/nodes/addTriggerNode.d.ts.map +1 -0
  184. package/dist/nodes/addTriggerNode.js +25 -0
  185. package/dist/nodes/addTriggerNode.js.map +1 -0
  186. package/dist/nodes/compilePrompt.d.ts +5 -0
  187. package/dist/nodes/compilePrompt.d.ts.map +1 -0
  188. package/dist/nodes/compilePrompt.js +76 -0
  189. package/dist/nodes/compilePrompt.js.map +1 -0
  190. package/dist/nodes/nodeFactory.d.ts +16 -0
  191. package/dist/nodes/nodeFactory.d.ts.map +1 -0
  192. package/dist/nodes/nodeFactory.js +45 -0
  193. package/dist/nodes/nodeFactory.js.map +1 -0
  194. package/dist/nodes/rpaStepsExecutor.d.ts +5 -0
  195. package/dist/nodes/rpaStepsExecutor.d.ts.map +1 -0
  196. package/dist/nodes/rpaStepsExecutor.js +156 -0
  197. package/dist/nodes/rpaStepsExecutor.js.map +1 -0
  198. package/dist/platform/config.d.ts +16 -0
  199. package/dist/platform/config.d.ts.map +1 -0
  200. package/dist/platform/config.js +80 -0
  201. package/dist/platform/config.js.map +1 -0
  202. package/dist/platform/mindedCheckpointSaver.d.ts +10 -0
  203. package/dist/platform/mindedCheckpointSaver.d.ts.map +1 -0
  204. package/dist/platform/mindedCheckpointSaver.js +137 -0
  205. package/dist/platform/mindedCheckpointSaver.js.map +1 -0
  206. package/dist/platform/mindedConnection.d.ts +15 -0
  207. package/dist/platform/mindedConnection.d.ts.map +1 -0
  208. package/dist/platform/mindedConnection.js +254 -0
  209. package/dist/platform/mindedConnection.js.map +1 -0
  210. package/dist/platform/mindedConnectionTypes.d.ts +404 -0
  211. package/dist/platform/mindedConnectionTypes.d.ts.map +1 -0
  212. package/dist/platform/mindedConnectionTypes.js +51 -0
  213. package/dist/platform/mindedConnectionTypes.js.map +1 -0
  214. package/dist/platform/models/mindedChatOpenAI.d.ts +20 -0
  215. package/dist/platform/models/mindedChatOpenAI.d.ts.map +1 -0
  216. package/dist/platform/models/mindedChatOpenAI.js +32 -0
  217. package/dist/platform/models/mindedChatOpenAI.js.map +1 -0
  218. package/dist/platform/models/parallelWrapper.d.ts +17 -0
  219. package/dist/platform/models/parallelWrapper.d.ts.map +1 -0
  220. package/dist/platform/models/parallelWrapper.js +105 -0
  221. package/dist/platform/models/parallelWrapper.js.map +1 -0
  222. package/dist/platform/piiGateway/gateway.d.ts +14 -0
  223. package/dist/platform/piiGateway/gateway.d.ts.map +1 -0
  224. package/dist/platform/piiGateway/gateway.js +117 -0
  225. package/dist/platform/piiGateway/gateway.js.map +1 -0
  226. package/dist/platform/piiGateway/index.d.ts +3 -0
  227. package/dist/platform/piiGateway/index.d.ts.map +1 -0
  228. package/dist/platform/piiGateway/index.js +7 -0
  229. package/dist/platform/piiGateway/index.js.map +1 -0
  230. package/dist/platform/piiGateway/types.d.ts +27 -0
  231. package/dist/platform/piiGateway/types.d.ts.map +1 -0
  232. package/dist/platform/piiGateway/types.js +3 -0
  233. package/dist/platform/piiGateway/types.js.map +1 -0
  234. package/dist/platform/toolExecutor.d.ts +29 -0
  235. package/dist/platform/toolExecutor.d.ts.map +1 -0
  236. package/dist/platform/toolExecutor.js +84 -0
  237. package/dist/platform/toolExecutor.js.map +1 -0
  238. package/dist/platform/utils/parseAttachments.d.ts +14 -0
  239. package/dist/platform/utils/parseAttachments.d.ts.map +1 -0
  240. package/dist/platform/utils/parseAttachments.js +53 -0
  241. package/dist/platform/utils/parseAttachments.js.map +1 -0
  242. package/dist/platform/utils/tools.d.ts +6 -0
  243. package/dist/platform/utils/tools.d.ts.map +1 -0
  244. package/dist/platform/utils/tools.js +57 -0
  245. package/dist/platform/utils/tools.js.map +1 -0
  246. package/dist/playbooks/playbooks.d.ts +15 -0
  247. package/dist/playbooks/playbooks.d.ts.map +1 -0
  248. package/dist/playbooks/playbooks.js +208 -0
  249. package/dist/playbooks/playbooks.js.map +1 -0
  250. package/dist/toolsLibrary/classifier.d.ts +74 -0
  251. package/dist/toolsLibrary/classifier.d.ts.map +1 -0
  252. package/dist/toolsLibrary/classifier.js +256 -0
  253. package/dist/toolsLibrary/classifier.js.map +1 -0
  254. package/dist/toolsLibrary/extraction.d.ts +83 -0
  255. package/dist/toolsLibrary/extraction.d.ts.map +1 -0
  256. package/dist/toolsLibrary/extraction.js +328 -0
  257. package/dist/toolsLibrary/extraction.js.map +1 -0
  258. package/dist/toolsLibrary/index.d.ts +9 -0
  259. package/dist/toolsLibrary/index.d.ts.map +1 -0
  260. package/dist/toolsLibrary/index.js +46 -0
  261. package/dist/toolsLibrary/index.js.map +1 -0
  262. package/dist/toolsLibrary/parseDocument.d.ts +30 -0
  263. package/dist/toolsLibrary/parseDocument.d.ts.map +1 -0
  264. package/dist/toolsLibrary/parseDocument.js +119 -0
  265. package/dist/toolsLibrary/parseDocument.js.map +1 -0
  266. package/dist/triggers/triggerTypeToDefaultMessage.d.ts +4 -0
  267. package/dist/triggers/triggerTypeToDefaultMessage.d.ts.map +1 -0
  268. package/dist/triggers/triggerTypeToDefaultMessage.js +10 -0
  269. package/dist/triggers/triggerTypeToDefaultMessage.js.map +1 -0
  270. package/dist/types/Agent.types.d.ts +60 -0
  271. package/dist/types/Agent.types.d.ts.map +1 -0
  272. package/dist/types/Agent.types.js +9 -0
  273. package/dist/types/Agent.types.js.map +1 -0
  274. package/dist/types/Flows.types.d.ts +232 -0
  275. package/dist/types/Flows.types.d.ts.map +1 -0
  276. package/dist/types/Flows.types.js +65 -0
  277. package/dist/types/Flows.types.js.map +1 -0
  278. package/dist/types/LLM.types.d.ts +7 -0
  279. package/dist/types/LLM.types.d.ts.map +1 -0
  280. package/dist/types/LLM.types.js +11 -0
  281. package/dist/types/LLM.types.js.map +1 -0
  282. package/dist/types/LangGraph.types.d.ts +45 -0
  283. package/dist/types/LangGraph.types.d.ts.map +1 -0
  284. package/dist/types/LangGraph.types.js +77 -0
  285. package/dist/types/LangGraph.types.js.map +1 -0
  286. package/dist/types/Platform.types.d.ts +7 -0
  287. package/dist/types/Platform.types.d.ts.map +1 -0
  288. package/dist/types/Platform.types.js +11 -0
  289. package/dist/types/Platform.types.js.map +1 -0
  290. package/dist/types/Tools.types.d.ts +26 -0
  291. package/dist/types/Tools.types.d.ts.map +1 -0
  292. package/dist/types/Tools.types.js +3 -0
  293. package/dist/types/Tools.types.js.map +1 -0
  294. package/dist/types/Voice.types.d.ts +5 -0
  295. package/dist/types/Voice.types.d.ts.map +1 -0
  296. package/dist/types/Voice.types.js +3 -0
  297. package/dist/types/Voice.types.js.map +1 -0
  298. package/dist/utils/agentUtils.d.ts +5 -0
  299. package/dist/utils/agentUtils.d.ts.map +1 -0
  300. package/dist/utils/agentUtils.js +97 -0
  301. package/dist/utils/agentUtils.js.map +1 -0
  302. package/dist/utils/extractStateMemoryResponse.d.ts +5 -0
  303. package/dist/utils/extractStateMemoryResponse.d.ts.map +1 -0
  304. package/dist/utils/extractStateMemoryResponse.js +91 -0
  305. package/dist/utils/extractStateMemoryResponse.js.map +1 -0
  306. package/dist/utils/history.d.ts +4 -0
  307. package/dist/utils/history.d.ts.map +1 -0
  308. package/dist/utils/history.js +33 -0
  309. package/dist/utils/history.js.map +1 -0
  310. package/dist/utils/logger.d.ts +3 -0
  311. package/dist/utils/logger.d.ts.map +1 -0
  312. package/dist/utils/logger.js +39 -0
  313. package/dist/utils/logger.js.map +1 -0
  314. package/dist/utils/schemaUtils.d.ts +15 -0
  315. package/dist/utils/schemaUtils.d.ts.map +1 -0
  316. package/dist/utils/schemaUtils.js +56 -0
  317. package/dist/utils/schemaUtils.js.map +1 -0
  318. package/dist/utils/wait.d.ts +2 -0
  319. package/dist/utils/wait.d.ts.map +1 -0
  320. package/dist/utils/wait.js +6 -0
  321. package/dist/utils/wait.js.map +1 -0
  322. package/dist/voice/elevenLabsUtils.d.ts +65 -0
  323. package/dist/voice/elevenLabsUtils.d.ts.map +1 -0
  324. package/dist/voice/elevenLabsUtils.js +4 -0
  325. package/dist/voice/elevenLabsUtils.js.map +1 -0
  326. package/dist/voice/voiceSession.d.ts +37 -0
  327. package/dist/voice/voiceSession.d.ts.map +1 -0
  328. package/dist/voice/voiceSession.js +306 -0
  329. package/dist/voice/voiceSession.js.map +1 -0
  330. package/docs/.gitbook/assets/ADLC.png +0 -0
  331. package/docs/.gitbook/assets/PII-masking.png +0 -0
  332. package/docs/.gitbook/assets/image.png +0 -0
  333. package/docs/.gitbook/assets/on-prem.svg +4 -0
  334. package/docs/README.md +54 -0
  335. package/docs/SUMMARY.md +56 -0
  336. package/docs/examples/order-refund-flow.md +566 -0
  337. package/docs/getting-started/environment-configuration.md +158 -0
  338. package/docs/getting-started/installation.md +44 -0
  339. package/docs/getting-started/project-configuration.md +206 -0
  340. package/docs/getting-started/quick-start.md +262 -0
  341. package/docs/integrations/zendesk.md +554 -0
  342. package/docs/low-code-editor/edges.md +396 -0
  343. package/docs/low-code-editor/flows.md +74 -0
  344. package/docs/low-code-editor/nodes.md +367 -0
  345. package/docs/low-code-editor/playbooks.md +280 -0
  346. package/docs/low-code-editor/tools.md +358 -0
  347. package/docs/low-code-editor/triggers.md +182 -0
  348. package/docs/platform/on-prem.md +182 -0
  349. package/docs/platform/operator.md +89 -0
  350. package/docs/platform/pii-masking.md +221 -0
  351. package/docs/platform/scenarios.md +43 -0
  352. package/docs/platform/secrets.md +99 -0
  353. package/docs/platform/sso.md +27 -0
  354. package/docs/resources/your-first-eval.md +108 -0
  355. package/docs/sdk/agent-api.md +540 -0
  356. package/docs/sdk/debugging.md +80 -0
  357. package/docs/sdk/events.md +595 -0
  358. package/docs/sdk/logging.md +72 -0
  359. package/docs/sdk/memory.md +271 -0
  360. package/docs/sdk/parallel-llm.md +242 -0
  361. package/docs/sdk/vectorstore-query.md +60 -0
  362. package/docs/tooling/classifier.md +217 -0
  363. package/docs/tooling/document-processing.md +389 -0
  364. package/docs/tooling/extraction.md +78 -0
  365. package/docs/tooling/timers.md +61 -0
  366. package/package.json +73 -0
  367. package/src/agent.ts +1019 -0
  368. package/src/browserTask/executeBrowserTask.py +153 -0
  369. package/src/browserTask/executeBrowserTask.ts +253 -0
  370. package/src/browserTask/localBrowserTask.ts +300 -0
  371. package/src/browserTask/profile/Default/Extension Rules/000003.log +0 -0
  372. package/src/browserTask/profile/Default/Extension Scripts/000003.log +0 -0
  373. package/src/browserTask/profile/Default/Extension State/000003.log +0 -0
  374. package/src/browserTask/profile/Default/GCM Store/000003.log +0 -0
  375. package/src/browserTask/profile/Default/Local Storage/leveldb/000004.log +0 -0
  376. package/src/browserTask/profile/Default/Session Storage/000003.log +0 -0
  377. package/src/browserTask/profile/Default/Site Characteristics Database/000003.log +0 -0
  378. package/src/browserTask/profile/Default/Sync Data/LevelDB/000003.log +0 -0
  379. package/src/browserTask/profile/Default/shared_proto_db/000003.log +0 -0
  380. package/src/browserTask/profile/Default/shared_proto_db/metadata/000003.log +0 -0
  381. package/src/browserTask/types.ts +37 -0
  382. package/src/checkpointer/checkpointSaverFactory.ts +18 -0
  383. package/src/cli/index.ts +188 -0
  384. package/src/cli/lambdaHandlerTemplate.ts +78 -0
  385. package/src/cli/localOperatorSetup.ts +308 -0
  386. package/src/debugging/index.ts +1 -0
  387. package/src/debugging/llmCallbackHandler.ts +125 -0
  388. package/src/edges/createDirectEdge.ts +22 -0
  389. package/src/edges/createLogicalRouter.ts +182 -0
  390. package/src/edges/createPromptRouter.ts +213 -0
  391. package/src/edges/edgeFactory.ts +167 -0
  392. package/src/events/AgentEvents.ts +58 -0
  393. package/src/events/index.ts +3 -0
  394. package/src/index.ts +105 -0
  395. package/src/interfaces/zendesk.ts +212 -0
  396. package/src/internalTools/appActionRunnerTool.ts +68 -0
  397. package/src/internalTools/documentExtraction/documentExtraction.ts +804 -0
  398. package/src/internalTools/documentExtraction/types.ts +59 -0
  399. package/src/internalTools/libraryActionRunnerTool.ts +62 -0
  400. package/src/internalTools/timer.ts +125 -0
  401. package/src/internalTools/voice/escalateVoiceCall.ts +15 -0
  402. package/src/internalTools/voice/retell.ts +28 -0
  403. package/src/internalTools/voice/sendPlaceholderMessage.ts +27 -0
  404. package/src/interrupts/BaseInterruptSessionManager.ts +80 -0
  405. package/src/interrupts/MemoryInterruptSessionManager.ts +63 -0
  406. package/src/interrupts/MindedInterruptSessionManager.ts +163 -0
  407. package/src/interrupts/interruptSessionManagerFactory.ts +20 -0
  408. package/src/llm/createLlmInstance.ts +33 -0
  409. package/src/nodes/addAppToolNode.ts +111 -0
  410. package/src/nodes/addBrowserTaskNode.ts +191 -0
  411. package/src/nodes/addBrowserTaskRunNode.ts +190 -0
  412. package/src/nodes/addHumanInTheLoopNode.ts +26 -0
  413. package/src/nodes/addJumpToNode.ts +26 -0
  414. package/src/nodes/addJunctionNode.ts +21 -0
  415. package/src/nodes/addPromptNode.ts +305 -0
  416. package/src/nodes/addRpaNode.ts +217 -0
  417. package/src/nodes/addToolNode.ts +84 -0
  418. package/src/nodes/addToolRunNode.ts +80 -0
  419. package/src/nodes/addTriggerNode.ts +27 -0
  420. package/src/nodes/compilePrompt.ts +44 -0
  421. package/src/nodes/nodeFactory.ts +61 -0
  422. package/src/nodes/rpaStepsExecutor.ts +175 -0
  423. package/src/platform/config.ts +89 -0
  424. package/src/platform/mindedCheckpointSaver.ts +146 -0
  425. package/src/platform/mindedConnection.ts +250 -0
  426. package/src/platform/mindedConnectionTypes.ts +495 -0
  427. package/src/platform/models/mindedChatOpenAI.ts +49 -0
  428. package/src/platform/models/parallelWrapper.ts +141 -0
  429. package/src/platform/piiGateway/gateway.ts +103 -0
  430. package/src/platform/piiGateway/index.ts +5 -0
  431. package/src/platform/piiGateway/types.ts +29 -0
  432. package/src/platform/toolExecutor.ts +106 -0
  433. package/src/platform/utils/parseAttachments.ts +56 -0
  434. package/src/platform/utils/tools.ts +55 -0
  435. package/src/playbooks/playbooks.ts +200 -0
  436. package/src/toolsLibrary/classifier.ts +326 -0
  437. package/src/toolsLibrary/extraction.ts +393 -0
  438. package/src/toolsLibrary/index.ts +10 -0
  439. package/src/toolsLibrary/parseDocument.ts +129 -0
  440. package/src/triggers/triggerTypeToDefaultMessage.ts +9 -0
  441. package/src/types/Agent.types.ts +73 -0
  442. package/src/types/Flows.types.ts +262 -0
  443. package/src/types/LLM.types.ts +15 -0
  444. package/src/types/LangGraph.types.ts +86 -0
  445. package/src/types/Platform.types.ts +6 -0
  446. package/src/types/Tools.types.ts +28 -0
  447. package/src/types/Voice.types.ts +4 -0
  448. package/src/utils/agentUtils.ts +69 -0
  449. package/src/utils/history.ts +38 -0
  450. package/src/utils/logger.ts +38 -0
  451. package/src/utils/schemaUtils.ts +68 -0
  452. package/src/utils/wait.ts +1 -0
  453. package/src/voice/elevenLabsUtils.ts +81 -0
  454. package/src/voice/voiceSession.ts +309 -0
@@ -0,0 +1,158 @@
1
+ # Environment Configuration
2
+
3
+ Configure your environment variables to customize MindedJS behavior and connect to external services.
4
+
5
+ ## Environment Variables
6
+
7
+ Create a `.env` file in your project root to configure MindedJS:
8
+
9
+ ```bash
10
+ # .env file
11
+ ```
12
+
13
+ ### Core Configuration
14
+
15
+ #### `RUN_LOCALLY`
16
+
17
+ Controls whether the agent runs fully local in memory or connects to the Minded platform.
18
+
19
+ ```bash
20
+ RUN_LOCALLY=true
21
+ ```
22
+
23
+ - **`true`**: Agent runs fully local in memory without external connections
24
+ - **`false`** (default): Agent connects to the Minded platform
25
+
26
+
27
+ #### `BROWSER_TASK_MODE`
28
+
29
+ Controls the mode in which the browser task runs.
30
+
31
+ ```bash
32
+ BROWSER_TASK_MODE=cloud
33
+ ```
34
+
35
+
36
+ - **`onPrem`**: Browser task runs on the customer's own infrastructure with a remotely installed on-premise kit.
37
+ - **`localRun`**: Browser task runs locally where the SDK is running. Requires configuring a UV project and installing dependencies.
38
+ - **`cloud`**: Browser task runs on the Minded platform. This is the default mode.
39
+
40
+
41
+ ### Chat Model Credentials
42
+
43
+ MindedJS currently supports OpenAI and Azure OpenAI chat models. Under the hood, these are implemented using LangChain chat models. If you want to use a chat model that is not currently supported, please reach out to us.
44
+
45
+ #### Supported Chat Model Configurations
46
+
47
+ **OpenAI**
48
+
49
+ ```bash
50
+ OPENAI_API_KEY=your-openai-api-key
51
+ ```
52
+
53
+ **Azure OpenAI**
54
+
55
+ ```bash
56
+ AZURE_OPENAI_API_KEY=your-azure-openai-api-key
57
+ AZURE_OPENAI_ENDPOINT=your-azure-openai-endpoint
58
+ AZURE_OPENAI_API_DEPLOYMENT_NAME=your-deployment-name
59
+ AZURE_OPENAI_API_VERSION=your-api-version
60
+ ```
61
+
62
+ {% hint style="info" %}
63
+ If you need support for additional chat models, please contact us and we'll work on adding support for your preferred provider.
64
+ {% endhint %}
65
+
66
+ ### Platform Connection
67
+
68
+ #### `MINDED_CONNECTION_TOKEN`
69
+
70
+ Required to connect to the Minded platform for advanced features and monitoring. Each token is specific to the agent you are working on.
71
+
72
+ ```bash
73
+ MINDED_CONNECTION_TOKEN=your-minded-connection-token
74
+ ```
75
+
76
+ {% hint style="info" %}
77
+ Your connection token is available on the [Minded platform](https://app.minded.com) in the agent page within the GitHub integration popup. You can also use the npx command provided there to automatically set the minded token.
78
+ {% endhint %}
79
+
80
+ ## Example .env File
81
+
82
+ Here's a complete example of a `.env` file:
83
+
84
+ ```bash
85
+ # Core Configuration
86
+ RUN_LOCALLY=false
87
+
88
+ # Chat Model (OpenAI example)
89
+ OPENAI_API_KEY=sk-your-openai-api-key-here
90
+
91
+ # Platform Connection
92
+ MINDED_CONNECTION_TOKEN=your-minded-connection-token-here
93
+ ```
94
+
95
+ ## Loading Environment Variables
96
+
97
+ MindedJS automatically loads environment variables from your `.env` file. Make sure to:
98
+
99
+ 1. Create the `.env` file in your project root
100
+ 2. Add `.env` to your `.gitignore` file to keep credentials secure
101
+ 3. Never commit your `.env` file to version control
102
+
103
+ ```bash
104
+ # Add to .gitignore
105
+ .env
106
+ ```
107
+
108
+ ## Runtime Environment Detection
109
+
110
+ MindedJS uses specific environment variables to determine the runtime environment and adjust behavior accordingly.
111
+
112
+ ### Environment Variables
113
+
114
+ | Environment | NODE_ENV | MINDED_CLOUD | Description |
115
+ | ------------------ | ------------- | ------------ | ------------------------------------ |
116
+ | Local Development | `development` | `false` | Running locally on developer machine |
117
+ | Minded Platform | `development` | `true` | Running in Minded platform sandbox |
118
+ | Staging Service | `staging` | `true` | Agent deployed as staging service |
119
+ | Production Service | `production` | `true` | Agent deployed as production service |
120
+
121
+ ### Usage in Code
122
+
123
+ ```typescript
124
+ // Check if running on Minded Cloud
125
+ if (process.env.MINDED_CLOUD === 'true') {
126
+ // Running on Minded infrastructure (dev/staging/prod)
127
+ logger.info({ message: 'Running on Minded Cloud' });
128
+ }
129
+
130
+ // Check specific environment
131
+ if (process.env.NODE_ENV === 'production' && process.env.MINDED_CLOUD === 'true') {
132
+ // Production environment on Minded Cloud
133
+ logger.info({ message: 'Production mode' });
134
+ }
135
+ ```
136
+
137
+ ### Environment-Specific Behavior
138
+
139
+ ```typescript
140
+ const isDevelopment = process.env.NODE_ENV === 'development';
141
+ const isMindedCloud = process.env.MINDED_CLOUD === 'true';
142
+
143
+ // Enable debug features only in development
144
+ if (isDevelopment) {
145
+ // Enable verbose logging
146
+ logger.setLevel('debug');
147
+ }
148
+
149
+ // Use different endpoints based on environment
150
+ const apiEndpoint = isMindedCloud ? 'https://api.minded.com' : 'http://localhost:3000';
151
+ ```
152
+
153
+ ## Next Steps
154
+
155
+ With your environment configured, continue to:
156
+
157
+ 1. [Project Configuration](project-configuration.md) - Set up your `minded.json` file
158
+ 2. [Quick Start](quick-start.md) - Build your first agent
@@ -0,0 +1,44 @@
1
+ # Installation
2
+
3
+ Get MindedJS up and running in your project.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 18 or later
8
+ - npm, yarn, or pnpm
9
+
10
+ ## Install MindedJS
11
+
12
+ {% tabs %}
13
+ {% tab title="npm" %}
14
+
15
+ ```bash
16
+ npm i @minded-ai/mindedjs langchain
17
+ ```
18
+
19
+ {% endtab %}
20
+
21
+ {% tab title="yarn" %}
22
+
23
+ ```bash
24
+ yarn add @minded-ai/mindedjs langchain
25
+ ```
26
+
27
+ {% endtab %}
28
+
29
+ {% tab title="pnpm" %}
30
+
31
+ ```bash
32
+ pnpm add @minded-ai/mindedjs langchain
33
+ ```
34
+
35
+ {% endtab %}
36
+ {% endtabs %}
37
+
38
+ ## Next Steps
39
+
40
+ Now that MindedJS is installed:
41
+
42
+ 1. Configure your environment variables in the [Environment Configuration](environment-configuration.md) guide
43
+ 2. Set up your project with `minded.json` in the [Project Configuration](project-configuration.md) guide
44
+ 3. Build your first agent with the [Quick Start](quick-start.md) guide!
@@ -0,0 +1,206 @@
1
+ # Project Configuration
2
+
3
+ Configure your MindedJS agent using the `minded.json` file to define how your agent operates, which flows to use, and deployment settings.
4
+
5
+ ## minded.json Overview
6
+
7
+ The `minded.json` file is the central configuration file for your MindedJS agent. It defines:
8
+
9
+ * **Flows**: Paths to your flow definition files
10
+ * **Tools**: Paths to your tool implementations (optional)
11
+ * **LLM Configuration**: Which language model to use and its settings
12
+ * **Agent Path**: Where your agent is exported (for deployment only)
13
+
14
+ This file should be placed in your project root directory.
15
+
16
+ ## Configuration Structure
17
+
18
+ ```json
19
+ {
20
+ "flows": ["./flows"],
21
+ "tools": ["./tools"],
22
+ "agent": "./agent.ts",
23
+ "llm": {
24
+ "name": "ChatOpenAI",
25
+ "properties": {
26
+ "model": "gpt-4o",
27
+ "temperature": 0.7
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ ## Configuration Fields
34
+
35
+ ### flows (required)
36
+
37
+ An array of paths to directories containing your flow YAML files.
38
+
39
+ ```json
40
+ {
41
+ "flows": ["./flows", "./custom-flows"]
42
+ }
43
+ ```
44
+
45
+ The agent will load all `.yaml` and `.yml` files from these directories.
46
+
47
+ ### tools (optional)
48
+
49
+ An array of paths to directories containing your tool implementations.
50
+
51
+ ```json
52
+ {
53
+ "tools": ["./tools"]
54
+ }
55
+ ```
56
+
57
+ If not specified, tools should be passed directly to the Agent constructor.
58
+
59
+ ### agent (deployment only)
60
+
61
+ The path to your main agent file where the agent is exported as default. This field is used by the Minded platform during deployment and is not required for local development.
62
+
63
+ ```json
64
+ {
65
+ "agent": "./agent.ts"
66
+ }
67
+ ```
68
+
69
+ {% hint style="info" %}
70
+ The `agent` field is only used during deployment to the Minded platform. It tells the platform where to find your agent's default export. This field is not used by the Agent class at runtime.
71
+ {% endhint %}
72
+
73
+ ### llm (required)
74
+
75
+ Configures the language model for your agent.
76
+
77
+ ```json
78
+ {
79
+ "llm": {
80
+ "name": "ChatOpenAI",
81
+ "properties": {
82
+ "model": "gpt-4o",
83
+ "temperature": 0.7,
84
+ "maxTokens": 2000
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ #### Supported LLM Providers
91
+
92
+ **ChatOpenAI**
93
+
94
+ ```json
95
+ {
96
+ "llm": {
97
+ "name": "ChatOpenAI",
98
+ "properties": {
99
+ "model": "gpt-4o",
100
+ "temperature": 0.7
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ **AzureChatOpenAI**
107
+
108
+ ```json
109
+ {
110
+ "llm": {
111
+ "name": "AzureChatOpenAI",
112
+ "properties": {
113
+ "model": "gpt-4o",
114
+ "temperature": 0.7
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## Usage in Your Agent
121
+
122
+ The `minded.json` configuration is passed directly to your Agent constructor:
123
+
124
+ ```typescript
125
+ import { Agent } from '@minded-ai/mindedjs';
126
+ import memorySchema from './schema';
127
+ import tools from './tools';
128
+ import mindedConfig from './minded.json';
129
+
130
+ const agent = new Agent({
131
+ memorySchema,
132
+ config: mindedConfig,
133
+ tools, // Optional if specified in minded.json
134
+ });
135
+ ```
136
+
137
+ ## Complete Example
138
+
139
+ Here's a full example of a `minded.json` file for a customer support agent:
140
+
141
+ ```json
142
+ {
143
+ "flows": ["./flows"],
144
+ "tools": ["./tools"],
145
+ "agent": "./customerSupportAgent.ts",
146
+ "llm": {
147
+ "name": "ChatOpenAI",
148
+ "properties": {
149
+ "model": "gpt-4o",
150
+ "temperature": 0.7,
151
+ "maxTokens": 1000,
152
+ "topP": 0.9
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ Corresponding project structure:
159
+
160
+ ```
161
+ your-project/
162
+ ├── minded.json # Agent configuration
163
+ ├── customerSupportAgent.ts # Main agent file (default export)
164
+ ├── schema.ts # Memory schema
165
+ ├── flows/ # Flow definitions
166
+ │ ├── mainFlow.yaml
167
+ │ └── escalationFlow.yaml
168
+ └── tools/ # Tool implementations
169
+ ├── lookupOrder.ts
170
+ ├── processRefund.ts
171
+ └── index.ts
172
+ ```
173
+
174
+ ## Environment-Specific Configuration
175
+
176
+ You can create environment-specific configurations:
177
+
178
+ ```
179
+ your-project/
180
+ ├── minded.json # Default configuration
181
+ ├── minded.development.json # Development overrides
182
+ ├── minded.production.json # Production settings
183
+ └── minded.staging.json # Staging configuration
184
+ ```
185
+
186
+ Load the appropriate configuration based on your environment:
187
+
188
+ ```typescript
189
+ const env = process.env.NODE_ENV || 'development';
190
+ const configPath = env === 'production' ? './minded.production.json' : './minded.json';
191
+ const mindedConfig = require(configPath);
192
+
193
+ const agent = new Agent({
194
+ memorySchema,
195
+ config: mindedConfig,
196
+ tools,
197
+ });
198
+ ```
199
+
200
+ ## Next Steps
201
+
202
+ With your `minded.json` configured, you're ready to:
203
+
204
+ 1. [Build your first agent](quick-start.md) - Follow the quick start guide
205
+ 2. [Define your flows](../low-code-editor/flows.md) - Learn about flow structure
206
+ 3. [Deploy to Minded platform](../platform/deployment.md) - Deploy your agent
@@ -0,0 +1,262 @@
1
+ # Quick Start
2
+
3
+ Build your first MindedJS agent in minutes! We'll create a customer support agent that can process refunds.
4
+
5
+ ## What You'll Build
6
+
7
+ A customer support agent for an ecommerce store:
8
+
9
+ * Greets customers and asks for order details
10
+ * Intelligently routes to refund processing when appropriate
11
+ * Processes refunds with business logic
12
+ * Maintains conversation state throughout
13
+
14
+ ## Project Setup
15
+
16
+ First, create the necessary files in your project:
17
+
18
+ ### 1. Agent Configuration
19
+
20
+ Create `minded.json` in your project root (see [Project Configuration](project-configuration.md) for detailed documentation):
21
+
22
+ ```json
23
+ {
24
+ "flows": ["./flows"],
25
+ "llm": {
26
+ "name": "ChatOpenAI",
27
+ "properties": {
28
+ "model": "gpt-4o"
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ### 2. Flow Definition
35
+
36
+ Create `flows/refundFlow.yaml`:
37
+
38
+ ```yaml
39
+ name: 'Order Refund Flow'
40
+ nodes:
41
+ - type: 'trigger'
42
+ triggerType: 'manual'
43
+ name: 'CLI Trigger'
44
+ - type: 'promptNode'
45
+ name: 'Support Agent'
46
+ prompt: "Hello! I'm your customer support agent. I can help you with refunds. Please provide your name, order ID, and describe your issue."
47
+ - type: 'tool'
48
+ name: 'Process Refund'
49
+ toolName: 'processRefund'
50
+ edges:
51
+ - source: 'CLI Trigger'
52
+ target: 'Support Agent'
53
+ type: 'stepForward'
54
+ - source: 'Support Agent'
55
+ target: 'Process Refund'
56
+ type: 'promptCondition'
57
+ prompt: 'The user is asking for a refund and provided their order details'
58
+ ```
59
+
60
+ ### 3. Memory Schema
61
+
62
+ Create `schema.ts`:
63
+
64
+ ```ts
65
+ import { z } from 'zod';
66
+
67
+ export default z.object({
68
+ customerName: z.string().optional(),
69
+ orderId: z.string().optional(),
70
+ issue: z.string().optional(),
71
+ });
72
+ ```
73
+
74
+ ### 4. Tools
75
+
76
+ Create `tools/processRefund.ts`:
77
+
78
+ ```ts
79
+ import { z } from 'zod';
80
+ import { Tool } from 'mindedjs/src/types/Tools.types';
81
+ import memorySchema from '../schema';
82
+
83
+ type Memory = z.infer<typeof memorySchema>;
84
+
85
+ const schema = z.object({
86
+ orderId: z.string(),
87
+ customerName: z.string(),
88
+ reason: z.string(),
89
+ });
90
+
91
+ const processRefundTool: Tool<typeof schema, Memory> = {
92
+ name: 'processRefund',
93
+ description: 'Process a refund for the customer order',
94
+ input: schema,
95
+ execute: async ({ input, memory }) => {
96
+ console.log('*Action: Processing refund*');
97
+ console.log(`Refunding order ${input.orderId} for ${input.customerName}`);
98
+ console.log(`Reason: ${input.reason}`);
99
+
100
+ // Simulate refund processing
101
+ const refundAmount = Math.floor(Math.random() * 100) + 20; // Random amount between $20-$120
102
+ console.log(`Refund of $${memory.orderAmount} has been processed successfully!`);
103
+
104
+ return {
105
+ memory: {
106
+ customerName: input.customerName,
107
+ orderId: input.orderId,
108
+ issue: `Refund processed - $${refundAmount}`,
109
+ },
110
+ };
111
+ },
112
+ };
113
+
114
+ export default processRefundTool;
115
+ ```
116
+
117
+ Create `tools/index.ts`:
118
+
119
+ ```ts
120
+ import processRefundTool from './processRefund';
121
+
122
+ export default [processRefundTool];
123
+ ```
124
+
125
+ ### 5. Main Agent
126
+
127
+ Create `agent.ts`:
128
+
129
+ ```ts
130
+ import { Agent } from 'mindedjs/src/agent';
131
+ import { HumanMessage } from '@langchain/core/messages';
132
+ import { events } from 'mindedjs/src/index';
133
+ import * as readline from 'readline';
134
+ import memorySchema from './schema';
135
+ import tools from './tools';
136
+ import config from './minded.json';
137
+
138
+ // 1. Create readline interface for interactive chat
139
+ const rl = readline.createInterface({
140
+ input: process.stdin,
141
+ output: process.stdout,
142
+ });
143
+
144
+ // 2. Create the agent with config from minded.json
145
+ const agent = new Agent({
146
+ memorySchema,
147
+ config,
148
+ tools,
149
+ });
150
+
151
+ // 3. Listen for AI messages
152
+ agent.on(events.AI_MESSAGE, async ({ message }) => {
153
+ console.log('AI:', message);
154
+ promptUser(); // Continue the conversation
155
+ });
156
+
157
+ // 4. Handle trigger events
158
+ agent.on(events.TRIGGER_EVENT, async ({ triggerName, triggerBody }) => {
159
+ if (triggerName === 'CLI Trigger') {
160
+ return {
161
+ memory: {},
162
+ messages: [new HumanMessage(triggerBody)],
163
+ };
164
+ }
165
+ });
166
+
167
+ // 5. Function to prompt user for input
168
+ const promptUser = () => {
169
+ rl.question('You: ', async (input) => {
170
+ if (input.toLowerCase() === 'exit' || input.toLowerCase() === 'quit') {
171
+ console.log('Goodbye!');
172
+ rl.close();
173
+ return;
174
+ }
175
+
176
+ console.log(); // Add spacing for readability
177
+
178
+ // Send user message to agent
179
+ await agent.invoke({
180
+ triggerBody: input,
181
+ triggerName: 'CLI Trigger',
182
+ });
183
+ });
184
+ };
185
+
186
+ // 6. Start the interactive session
187
+ console.log('🤖 Customer Support Agent is ready!');
188
+ console.log('Type your message below (or "exit" to quit):\n');
189
+ promptUser();
190
+ ```
191
+
192
+ ## Project Structure
193
+
194
+ Your project should look like this:
195
+
196
+ ```
197
+ your-project/
198
+ ├── minded.json # Agent configuration
199
+ ├── schema.ts # Memory schema definition
200
+ ├── agent.ts # Main agent file
201
+ ├── flows/ # Flow definitions
202
+ │ └── refundFlow.yaml # Individual flow files
203
+ └── tools/ # Tools directory
204
+ ├── processRefund.ts # Refund processing tool
205
+ └── index.ts # Export your tools
206
+ ```
207
+
208
+ ## Run Your Agent
209
+
210
+ Start the interactive chat session:
211
+
212
+ ```bash
213
+ npx ts-node agent.ts
214
+ ```
215
+
216
+ This will start an interactive conversation where you can chat with your agent:
217
+
218
+ ```
219
+ 🤖 Customer Support Agent is ready!
220
+ Type your message below (or "exit" to quit):
221
+
222
+ You: Hi, I want to refund my order #1234. I received the wrong item.
223
+
224
+ AI: Hello! I'm your customer support agent. I can help you with refunds. Please provide your name, order ID, and describe your issue.
225
+
226
+ You: My name is John Smith, order ID is 1234, and I received the wrong size shoes.
227
+
228
+ *Action: Processing refund*
229
+ Refunding order 1234 for John Smith
230
+ Reason: received the wrong size shoes
231
+ Refund of $87 has been processed successfully!
232
+
233
+ You: Thank you!
234
+
235
+ AI: You're welcome! Your refund has been processed successfully. Is there anything else I can help you with?
236
+
237
+ You: exit
238
+ Goodbye!
239
+ ```
240
+
241
+ **Tips:**
242
+
243
+ * Type `exit` or `quit` to end the conversation
244
+ * Each message maintains conversation context and memory
245
+ * The agent will intelligently route to refund processing when appropriate
246
+
247
+ ## What Happens
248
+
249
+ 1. **Trigger Activation**: The manual trigger receives your input message
250
+ 2. **Support Agent**: The prompt node greets the customer and asks for details
251
+ 3. **Intelligent Routing**: If the customer mentions refunds and provides order details, the flow routes to the refund tool
252
+ 4. **Refund Processing**: The tool processes the refund and updates memory
253
+ 5. **State Management**: Memory persists customer information throughout the conversation
254
+
255
+ ## Next Steps
256
+
257
+ Now that you have a working agent, explore:
258
+
259
+ * [**Core Concepts**](../low-code-editor/flows.md) - Understand how flows, nodes, and edges work
260
+ * [**Node Types**](../low-code-editor/nodes.md) - Learn about all available node types
261
+ * [**Edge Types**](../low-code-editor/edges.md) - Learn about all available edge types
262
+ * [**Tools**](../low-code-editor/tools.md) - Learn about all available tools