@minded-ai/mindedjs 1.0.29 → 1.0.30

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 (173) hide show
  1. package/dist/agent.d.ts +1 -0
  2. package/dist/agent.d.ts.map +1 -0
  3. package/dist/checkpointer/checkpointSaverFactory.d.ts +1 -0
  4. package/dist/checkpointer/checkpointSaverFactory.d.ts.map +1 -0
  5. package/dist/cli/index.d.ts +1 -0
  6. package/dist/cli/index.d.ts.map +1 -0
  7. package/dist/cli/index.js +0 -0
  8. package/dist/edges/createDirectEdge.d.ts +1 -0
  9. package/dist/edges/createDirectEdge.d.ts.map +1 -0
  10. package/dist/edges/createLogicalRouter.d.ts +1 -0
  11. package/dist/edges/createLogicalRouter.d.ts.map +1 -0
  12. package/dist/edges/createPromptRouter.d.ts +1 -0
  13. package/dist/edges/createPromptRouter.d.ts.map +1 -0
  14. package/dist/edges/edgeFactory.d.ts +1 -0
  15. package/dist/edges/edgeFactory.d.ts.map +1 -0
  16. package/dist/events/AgentEvents.d.ts +1 -0
  17. package/dist/events/AgentEvents.d.ts.map +1 -0
  18. package/dist/events/index.d.ts +1 -0
  19. package/dist/events/index.d.ts.map +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/llm/createLlmInstance.d.ts +1 -0
  23. package/dist/llm/createLlmInstance.d.ts.map +1 -0
  24. package/dist/nodes/addHumanInTheLoopNode.d.ts +1 -0
  25. package/dist/nodes/addHumanInTheLoopNode.d.ts.map +1 -0
  26. package/dist/nodes/addPromptNode.d.ts +1 -0
  27. package/dist/nodes/addPromptNode.d.ts.map +1 -0
  28. package/dist/nodes/addToolNode.d.ts +1 -0
  29. package/dist/nodes/addToolNode.d.ts.map +1 -0
  30. package/dist/nodes/addTriggerNode.d.ts +1 -0
  31. package/dist/nodes/addTriggerNode.d.ts.map +1 -0
  32. package/dist/nodes/nodeFactory.d.ts +1 -0
  33. package/dist/nodes/nodeFactory.d.ts.map +1 -0
  34. package/dist/platform/config.d.ts +1 -0
  35. package/dist/platform/config.d.ts.map +1 -0
  36. package/dist/platform/mindedChatOpenAI.d.ts +1 -0
  37. package/dist/platform/mindedChatOpenAI.d.ts.map +1 -0
  38. package/dist/platform/mindedCheckpointSaver.d.ts +1 -0
  39. package/dist/platform/mindedCheckpointSaver.d.ts.map +1 -0
  40. package/dist/platform/mindedConnection.d.ts +1 -0
  41. package/dist/platform/mindedConnection.d.ts.map +1 -0
  42. package/dist/platform/mindedConnectionTypes.d.ts +1 -0
  43. package/dist/platform/mindedConnectionTypes.d.ts.map +1 -0
  44. package/dist/platform/mindedRequest.js +2 -2
  45. package/dist/platform/mindedRequest.js.map +1 -1
  46. package/dist/triggers/triggerTypeToDefaultMessage.d.ts +1 -0
  47. package/dist/triggers/triggerTypeToDefaultMessage.d.ts.map +1 -0
  48. package/dist/types/Agent.types.d.ts +1 -0
  49. package/dist/types/Agent.types.d.ts.map +1 -0
  50. package/dist/types/Flows.types.d.ts +1 -0
  51. package/dist/types/Flows.types.d.ts.map +1 -0
  52. package/dist/types/LLM.types.d.ts +1 -0
  53. package/dist/types/LLM.types.d.ts.map +1 -0
  54. package/dist/types/LangGraph.types.d.ts +1 -0
  55. package/dist/types/LangGraph.types.d.ts.map +1 -0
  56. package/dist/types/Tools.types.d.ts +1 -0
  57. package/dist/types/Tools.types.d.ts.map +1 -0
  58. package/dist/types/Triggers.types.d.ts +1 -0
  59. package/dist/types/Triggers.types.js +3 -0
  60. package/dist/types/Triggers.types.js.map +1 -0
  61. package/package.json +6 -2
  62. package/.github/workflows/CI.yml +0 -34
  63. package/.prettierrc +0 -8
  64. package/dist/internalTools/appActionRunnerTool.d.ts +0 -6
  65. package/dist/internalTools/appActionRunnerTool.js +0 -55
  66. package/dist/internalTools/appActionRunnerTool.js.map +0 -1
  67. package/dist/nodes/actionRunnerTool.d.ts +0 -11
  68. package/dist/nodes/actionRunnerTool.js +0 -84
  69. package/dist/nodes/actionRunnerTool.js.map +0 -1
  70. package/dist/nodes/addAppTool.d.ts +0 -8
  71. package/dist/nodes/addAppTool.js +0 -12
  72. package/dist/nodes/addAppTool.js.map +0 -1
  73. package/dist/nodes/addAppToolNode.d.ts +0 -8
  74. package/dist/nodes/addAppToolNode.js +0 -29
  75. package/dist/nodes/addAppToolNode.js.map +0 -1
  76. package/dist/nodes/callTool.d.ts +0 -10
  77. package/dist/nodes/callTool.js +0 -57
  78. package/dist/nodes/callTool.js.map +0 -1
  79. package/dist/nodes/toolNodeRunner.d.ts +0 -15
  80. package/dist/nodes/toolNodeRunner.js +0 -79
  81. package/dist/nodes/toolNodeRunner.js.map +0 -1
  82. package/dist/tools/appToolRunner.d.ts +0 -30
  83. package/dist/tools/appToolRunner.js +0 -35
  84. package/dist/tools/appToolRunner.js.map +0 -1
  85. package/dist/tools/parser.d.ts +0 -14
  86. package/dist/tools/parser.js +0 -17
  87. package/dist/tools/parser.js.map +0 -1
  88. package/dist/tools/triggerTypeToDefaultMessage.d.ts +0 -3
  89. package/dist/tools/triggerTypeToDefaultMessage.js +0 -10
  90. package/dist/tools/triggerTypeToDefaultMessage.js.map +0 -1
  91. package/docs/.gitbook/assets/image.png +0 -0
  92. package/docs/README.md +0 -51
  93. package/docs/SUMMARY.md +0 -23
  94. package/docs/api-reference/.nojekyll +0 -1
  95. package/docs/api-reference/assets/hierarchy.js +0 -1
  96. package/docs/api-reference/assets/highlight.css +0 -120
  97. package/docs/api-reference/assets/icons.js +0 -18
  98. package/docs/api-reference/assets/icons.svg +0 -1
  99. package/docs/api-reference/assets/main.js +0 -60
  100. package/docs/api-reference/assets/navigation.js +0 -1
  101. package/docs/api-reference/assets/search.js +0 -1
  102. package/docs/api-reference/assets/style.css +0 -1640
  103. package/docs/api-reference/classes/index.Agent.html +0 -4
  104. package/docs/api-reference/enums/index.EdgeType.html +0 -4
  105. package/docs/api-reference/enums/index.NodeType.html +0 -6
  106. package/docs/api-reference/enums/index.TriggerType.html +0 -4
  107. package/docs/api-reference/enums/index.events.html +0 -3
  108. package/docs/api-reference/hierarchy.html +0 -1
  109. package/docs/api-reference/index.html +0 -310
  110. package/docs/api-reference/interfaces/index.AppToolNode.html +0 -5
  111. package/docs/api-reference/interfaces/index.AppTriggerNode.html +0 -6
  112. package/docs/api-reference/interfaces/index.Flow.html +0 -4
  113. package/docs/api-reference/interfaces/index.JunctionNode.html +0 -4
  114. package/docs/api-reference/interfaces/index.LogicalConditionEdge.html +0 -5
  115. package/docs/api-reference/interfaces/index.ManualTriggerNode.html +0 -5
  116. package/docs/api-reference/interfaces/index.PromptConditionEdge.html +0 -5
  117. package/docs/api-reference/interfaces/index.PromptNode.html +0 -6
  118. package/docs/api-reference/interfaces/index.StepForwardEdge.html +0 -4
  119. package/docs/api-reference/interfaces/index.Tool.html +0 -6
  120. package/docs/api-reference/interfaces/index.ToolNode.html +0 -5
  121. package/docs/api-reference/modules/index-1.html +0 -1
  122. package/docs/api-reference/modules/index.html +0 -1
  123. package/docs/api-reference/modules.html +0 -1
  124. package/docs/api-reference/types/index.Edge.html +0 -1
  125. package/docs/api-reference/types/index.Node.html +0 -1
  126. package/docs/api-reference/types/index.TriggerNode.html +0 -1
  127. package/docs/core-concepts/edges.md +0 -299
  128. package/docs/core-concepts/events.md +0 -165
  129. package/docs/core-concepts/flows.md +0 -74
  130. package/docs/core-concepts/memory-types.md +0 -208
  131. package/docs/core-concepts/nodes.md +0 -257
  132. package/docs/core-concepts/tools.md +0 -225
  133. package/docs/core-concepts/triggers.md +0 -87
  134. package/docs/examples/order-refund-flow.md +0 -560
  135. package/docs/getting-started/environment-configuration.md +0 -117
  136. package/docs/getting-started/installation.md +0 -40
  137. package/docs/getting-started/quick-start.md +0 -264
  138. package/docs-structure.md +0 -144
  139. package/eslint.config.js +0 -68
  140. package/examples/orderRefundAgent/flows/orderRefundFlow.yaml +0 -26
  141. package/examples/orderRefundAgent/minded.json +0 -10
  142. package/examples/orderRefundAgent/orderRefundAgent.ts +0 -64
  143. package/examples/orderRefundAgent/schema.ts +0 -7
  144. package/examples/orderRefundAgent/tools/escalateConversation.ts +0 -28
  145. package/examples/orderRefundAgent/tools/index.ts +0 -4
  146. package/examples/orderRefundAgent/tools/refundOrder.ts +0 -27
  147. package/test/can-stay-on-node/can-stay-on-node.test.ts +0 -154
  148. package/test/can-stay-on-node/flows/test-flow.yaml +0 -25
  149. package/test/cannot-stay-on-node/cannot-stay-on-node.test.ts +0 -209
  150. package/test/cannot-stay-on-node/flows/test-flow.yaml +0 -34
  151. package/test/checkpoint-saver/minded-checkpoint-saver-list.test.ts +0 -140
  152. package/test/checkpoint-saver/minded-checkpoint-saver.test.ts +0 -100
  153. package/test/edge-priority/edge-priority.test.ts +0 -182
  154. package/test/edge-priority/flows/all-three-edges/test-flow.yaml +0 -35
  155. package/test/edge-priority/flows/logical-prompt-edges/test-flow.yaml +0 -26
  156. package/test/edge-priority/flows/stepforward-logical-edges/test-flow.yaml +0 -25
  157. package/test/edge-priority/flows/stepforward-prompt-edges/test-flow.yaml +0 -25
  158. package/test/human-in-the-loop-node/flows/test-flow.yaml +0 -23
  159. package/test/human-in-the-loop-node/human-in-the-loop-node.test.ts +0 -94
  160. package/test/logical-edges/flows/logical-edge-test-flow.yaml +0 -24
  161. package/test/logical-edges/logical-edges.test.ts +0 -68
  162. package/test/no-human-in-the-loop-node/flows/test-flow.yaml +0 -23
  163. package/test/no-human-in-the-loop-node/no-human-in-the-loop-node.test.ts +0 -81
  164. package/test/prompt-edges/flows/test-flow.yaml +0 -24
  165. package/test/prompt-edges/prompt-edges.test.ts +0 -92
  166. package/test/prompt-node/flows/test-flow.yaml +0 -24
  167. package/test/prompt-node/prompt-node.test.ts +0 -88
  168. package/test/setup.ts +0 -5
  169. package/test/tool-node/flows/test-flow.yaml +0 -14
  170. package/test/tool-node/tool-node.test.ts +0 -68
  171. package/test/trigger/flows/test-flow.yaml +0 -7
  172. package/test/trigger/trigger.test.ts +0 -185
  173. package/tsconfig.json +0 -17
package/dist/agent.d.ts CHANGED
@@ -35,3 +35,4 @@ export declare class Agent {
35
35
  private emit;
36
36
  }
37
37
  export {};
38
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAI3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI3D,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAe,MAAM,sBAAsB,CAAC;AAC1G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAAE,eAAe,EAA4B,MAAM,qBAAqB,CAAC;AAWhF,KAAK,iBAAiB,CAAC,MAAM,IAAI;IAC/B,YAAY,EAAE,CAAC,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC,CAAC;AACF,qBAAa,KAAK;IAChB,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,GAAG,CAAoB;IAC/B,OAAO,CAAC,gBAAgB,CAAiC;IAEzD,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,CAAC,aAAa,CAAgB;IAGrC,OAAO,CAAC,aAAa,CAId;gBAEK,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;IAsBxE,OAAO,CAAC,sBAAsB;IAoC9B,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,eAAe;IAyCvB,OAAO,CAAC,IAAI;IAUC,MAAM,CAAC,EAClB,WAAW,EACX,WAAW,EACX,SAAS,EACT,OAAO,GACR,EAAE;QACD,WAAW,EAAE,GAAG,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IA4CM,EAAE,CAAC,CAAC,SAAS,MAAM,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,EACpF,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CACP,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,KACrE,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GACpF,IAAI;YASO,IAAI;CAUnB"}
@@ -6,3 +6,4 @@ import { MindedConnection } from '../platform/mindedConnection';
6
6
  * @returns BaseCheckpointSaver instance (either MemorySaver or MindedCheckpointSaver)
7
7
  */
8
8
  export declare function createCheckpointSaver(mindedConnection: MindedConnection | null): BaseCheckpointSaver;
9
+ //# sourceMappingURL=checkpointSaverFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpointSaverFactory.d.ts","sourceRoot":"","sources":["../../src/checkpointer/checkpointSaverFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GAAG,mBAAmB,CAQpG"}
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
package/dist/cli/index.js CHANGED
File without changes
@@ -1,2 +1,3 @@
1
1
  import { StepForwardEdge } from '../types/Flows.types';
2
2
  export declare const createDirectEdge: (edge: StepForwardEdge) => () => Promise<string>;
3
+ //# sourceMappingURL=createDirectEdge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDirectEdge.d.ts","sourceRoot":"","sources":["../../src/edges/createDirectEdge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,gBAAgB,GAAI,MAAM,eAAe,0BAOrD,CAAC"}
@@ -3,3 +3,4 @@ import { stateAnnotation } from '../types/LangGraph.types';
3
3
  export declare const createLogicalRouter: ({ edges }: {
4
4
  edges: LogicalConditionEdge[];
5
5
  }) => (state: typeof stateAnnotation.State) => Promise<string>;
6
+ //# sourceMappingURL=createLogicalRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createLogicalRouter.d.ts","sourceRoot":"","sources":["../../src/edges/createLogicalRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,eAAO,MAAM,mBAAmB,GAAI,WAAW;IAAE,KAAK,EAAE,oBAAoB,EAAE,CAAA;CAAE,MAChE,OAAO,OAAO,eAAe,CAAC,KAAK,oBAWlD,CAAC"}
@@ -5,3 +5,4 @@ export declare const createPromptRouter: ({ edges, llm }: {
5
5
  edges: PromptConditionEdge[];
6
6
  llm: BaseLanguageModel;
7
7
  }) => (state: typeof stateAnnotation.State) => Promise<string>;
8
+ //# sourceMappingURL=createPromptRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPromptRouter.d.ts","sourceRoot":"","sources":["../../src/edges/createPromptRouter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,eAAO,MAAM,kBAAkB,GAAI,gBAAgB;IAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAAC,GAAG,EAAE,iBAAiB,CAAA;CAAE,MAU3F,OAAO,OAAO,eAAe,CAAC,KAAK,oBAsClD,CAAC"}
@@ -7,3 +7,4 @@ export declare const edgeFactory: ({ graph, edges, nodes, llm, }: {
7
7
  nodes: Record<string, Node>;
8
8
  llm: BaseLanguageModel;
9
9
  }) => void;
10
+ //# sourceMappingURL=edgeFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edgeFactory.d.ts","sourceRoot":"","sources":["../../src/edges/edgeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,IAAI,EAA8D,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAYzE,eAAO,MAAM,WAAW,GAAI,+BAKzB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,GAAG,EAAE,iBAAiB,CAAC;CACxB,SAqFA,CAAC"}
@@ -23,3 +23,4 @@ export type AgentEventResponsePayloads<Memory> = {
23
23
  history?: FlowHistory[];
24
24
  } | false;
25
25
  };
26
+ //# sourceMappingURL=AgentEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentEvents.d.ts","sourceRoot":"","sources":["../../src/events/AgentEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,oBAAY,WAAW;IACrB,UAAU,eAAe;IACzB,aAAa,kBAAkB;CAChC;AAED,MAAM,MAAM,yBAAyB,CAAC,MAAM,IAAI;IAC9C,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE;QAC3B,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,GAAG,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,MAAM,IAAI;IAC/C,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAC/B,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;KAAE,GAAG,KAAK,CAAC;CAC7G,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import { AgentEvents } from './AgentEvents';
2
2
  export default AgentEvents;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAe,WAAW,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export type { Flow, Node, Edge, TriggerNode, AppTriggerNode, PromptNode, PromptC
5
5
  export { NodeType, TriggerType, EdgeType } from './types/Flows.types';
6
6
  export type { Tool } from './types/Tools.types';
7
7
  export { FlowHistoryType, FlowHistory, TriggerInvocationHistory } from './types/Agent.types';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAEzB,YAAY,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import { LLMConfig } from "../types/LLM.types";
2
2
  export declare const createLlmInstance: (llmConfig: LLMConfig) => any;
3
+ //# sourceMappingURL=createLlmInstance.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -6,3 +6,4 @@ type AddHumanInTheLoopNodeParams = {
6
6
  export declare const buildHumanInTheLoopNodeName: (nodeName: string) => string;
7
7
  export declare const addHumanInTheLoopNode: ({ graph, attachedToNodeName }: AddHumanInTheLoopNodeParams) => Promise<void>;
8
8
  export {};
9
+ //# sourceMappingURL=addHumanInTheLoopNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addHumanInTheLoopNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addHumanInTheLoopNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE,gBAAgB,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,WAAiC,CAAC;AAE9F,eAAO,MAAM,qBAAqB,GAAU,+BAA+B,2BAA2B,kBAQrG,CAAC"}
@@ -13,3 +13,4 @@ type AddPromptNodeParams = {
13
13
  };
14
14
  export declare const addPromptNode: ({ graph, node, llm, tools, emit }: AddPromptNodeParams) => Promise<void>;
15
15
  export {};
16
+ //# sourceMappingURL=addPromptNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addPromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,yBAAyB,EAAe,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,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;CAChE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,mCAAmC,mBAAmB,kBAiDzF,CAAC"}
@@ -8,3 +8,4 @@ export declare const addToolNode: <Memory>({ graph, node, tools, llm, }: {
8
8
  tools: Tool<any, any>[];
9
9
  llm: BaseLanguageModel;
10
10
  }) => Promise<void>;
11
+ //# sourceMappingURL=addToolNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAQ7E,eAAO,MAAM,WAAW,GAAU,MAAM,EAAE,8BAKvC;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,iBAAiB,CAAC;CACxB,kBAmDA,CAAC"}
@@ -4,3 +4,4 @@ export declare const addTriggerNode: ({ graph, node }: {
4
4
  graph: PreCompiledGraph;
5
5
  node: TriggerNode;
6
6
  }) => Promise<void>;
7
+ //# sourceMappingURL=addTriggerNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,eAAO,MAAM,cAAc,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,kBAOnG,CAAC"}
@@ -11,3 +11,4 @@ export declare const nodeFactory: ({ graph, node, tools, llm, emit, }: {
11
11
  llm: BaseLanguageModel;
12
12
  emit: EmitSignature<any, keyof AgentEventRequestPayloads<any>>;
13
13
  }) => void;
14
+ //# sourceMappingURL=nodeFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAuBrD,eAAO,MAAM,WAAW,GAAI,oCAMzB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,iBAAiB,CAAC;IACvB,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;CAChE,SAqBA,CAAC"}
@@ -7,3 +7,4 @@ type MindedConfig = {
7
7
  type Environment = 'development' | 'sandbox' | 'production' | 'test';
8
8
  export declare const getConfig: () => MindedConfig;
9
9
  export {};
10
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,WAAW,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,KAAK,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC;AAErE,eAAO,MAAM,SAAS,QAAO,YAgC5B,CAAC"}
@@ -2,3 +2,4 @@ import { ChatOpenAI, ChatOpenAIFields } from "@langchain/openai";
2
2
  export declare class MindedChatOpenAI extends ChatOpenAI {
3
3
  constructor(fields?: ChatOpenAIFields);
4
4
  }
5
+ //# sourceMappingURL=mindedChatOpenAI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mindedChatOpenAI.d.ts","sourceRoot":"","sources":["../../src/platform/mindedChatOpenAI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGjE,qBAAa,gBAAiB,SAAQ,UAAU;gBAClC,MAAM,CAAC,EAAE,gBAAgB;CAWtC"}
@@ -9,3 +9,4 @@ export declare class MindedCheckpointSaver extends BaseCheckpointSaver<number> {
9
9
  put(config: RunnableConfig<Record<string, any>>, checkpoint: Checkpoint<string, string>, metadata: CheckpointMetadata, newVersions: ChannelVersions): Promise<RunnableConfig<Record<string, any>>>;
10
10
  putWrites(config: RunnableConfig<Record<string, any>>, writes: PendingWrite[], taskId: string): Promise<void>;
11
11
  }
12
+ //# sourceMappingURL=mindedCheckpointSaver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mindedCheckpointSaver.d.ts","sourceRoot":"","sources":["../../src/platform/mindedCheckpointSaver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,qBAAqB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAYtD,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,MAAM,CAAC;IACxD,OAAO,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAIhD,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAgD1F,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,cAAc,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC;IAgC9H,GAAG,CACP,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAC3C,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,eAAe,GAC3B,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAmBzC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAYpH"}
@@ -17,3 +17,4 @@ export declare class MindedConnection {
17
17
  private connect;
18
18
  start(): Promise<void>;
19
19
  }
20
+ //# sourceMappingURL=mindedConnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mindedConnection.d.ts","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAM/G,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,EAAE,CAAmC;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;IACvE,SAAS,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,CAAC,EAAE,CAAC;KACzE,CAAM;;IAQP,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,SAAS;YAQH,cAAc;IAwBrB,EAAE,GAAI,OAAO,iCAAiC,EAAE,UAAU,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,UAKnH;IAEK,IAAI,GAAI,OAAO,iCAAiC,EAAE,SAAS,iCAAiC,UAIjG;IAEK,SAAS,GAAI,CAAC,EAAE,CAAC,EAAE,OAAO,iCAAiC,EAAE,SAAS,CAAC,EAAE,YAAW,MAAa,KAAG,OAAO,CAAC,CAAC,CAAC,CAyBnH;YAEY,OAAO;IA+DR,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAIpC"}
@@ -47,3 +47,4 @@ export interface OnCheckpointList extends BaseMindedConnectionSocketMessage {
47
47
  export interface OnCheckpointListResponse extends BaseSdkConnectionSocketMessageResponseCallbackAck {
48
48
  checkpoints?: CheckpointTuple[];
49
49
  }
50
+ //# sourceMappingURL=mindedConnectionTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mindedConnectionTypes.d.ts","sourceRoot":"","sources":["../../src/platform/mindedConnectionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,oBAAY,iCAAiC;IAC3C,YAAY,mBAAmB;IAC/B,oBAAoB,yBAAyB;IAC7C,cAAc,mBAAmB;IACjC,eAAe,oBA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, "__esModule", { value: true });
6
6
  exports.mindedRequest = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
- const config_1 = require("./config");
9
8
  const mindedRequest = async ({ path, method, body, token, }) => {
9
+ const baseUrl = process.env.MINDED_SERVER || 'https://api.minded.com/sdk';
10
10
  const response = await (0, axios_1.default)({
11
11
  method,
12
- url: `${(0, config_1.getConfig)().baseUrl}${path}`,
12
+ url: `${baseUrl}${path}`,
13
13
  data: body,
14
14
  headers: {
15
15
  'Content-Type': 'application/json',
@@ -1 +1 @@
1
- {"version":3,"file":"mindedRequest.js","sourceRoot":"","sources":["../../src/platform/mindedRequest.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qCAAqC;AAI9B,MAAM,aAAa,GAAG,KAAK,EAA8B,EAC9D,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GAMN,EAAqB,EAAE;IAEtB,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC;QAC3B,MAAM;QACN,GAAG,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC,OAAO,GAAG,IAAI,EAAE;QACpC,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,KAAK,EAAE;SACjC;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AAvBW,QAAA,aAAa,iBAuBxB"}
1
+ {"version":3,"file":"mindedRequest.js","sourceRoot":"","sources":["../../src/platform/mindedRequest.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAInB,MAAM,aAAa,GAAG,KAAK,EAA8B,EAC9D,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GAMN,EAAqB,EAAE;IACtB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,4BAA4B,CAAC;IAE1E,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC;QAC3B,MAAM;QACN,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,EAAE;QACxB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,KAAK,EAAE;SACjC;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AAxBW,QAAA,aAAa,iBAwBxB"}
@@ -1,3 +1,4 @@
1
1
  import { BaseMessage } from "@langchain/core/messages";
2
2
  declare const triggerTypeToDefaultMessage: Record<string, Record<string, (triggerBody: any) => Array<BaseMessage>>>;
3
3
  export default triggerTypeToDefaultMessage;
4
+ //# sourceMappingURL=triggerTypeToDefaultMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerTypeToDefaultMessage.d.ts","sourceRoot":"","sources":["../../src/triggers/triggerTypeToDefaultMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAErE,QAAA,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,GAAG,KAAK,KAAK,CAAC,WAAW,CAAC,CAAC,CAIzG,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -18,3 +18,4 @@ export interface TriggerInvocationHistory extends FlowHistory {
18
18
  triggerName: string;
19
19
  triggerBody: any;
20
20
  }
21
+ //# sourceMappingURL=Agent.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Agent.types.d.ts","sourceRoot":"","sources":["../../src/types/Agent.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,aAAa,CAAC,MAAM,EAAE,CAAC,SAAS,MAAM,yBAAyB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAEvM,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAA;AAED,oBAAY,eAAe;IACzB,kBAAkB,sBAAsB;CACzC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,IAAI,EAAE,eAAe,CAAC,kBAAkB,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC;CAClB"}
@@ -93,3 +93,4 @@ export interface Flow {
93
93
  nodes: Node[];
94
94
  edges: Edge[];
95
95
  }
96
+ //# sourceMappingURL=Flows.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flows.types.d.ts","sourceRoot":"","sources":["../../src/types/Flows.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,YAAY;IACpB,WAAW,eAAe;CAC3B;AAED,oBAAY,QAAQ;IAClB,iBAAiB,qBAAqB;IACtC,gBAAgB,oBAAoB;IACpC,YAAY,gBAAgB;CAC7B;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;I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
5
  export type LLMProvider = 'ChatOpenAI' | 'AzureChatOpenAI' | 'MindedChatOpenAI';
6
6
  export declare const LLMProviders: Record<LLMProvider, any>;
7
+ //# sourceMappingURL=LLM.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LLM.types.d.ts","sourceRoot":"","sources":["../../src/types/LLM.types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAEhF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAIjD,CAAA"}
@@ -29,3 +29,4 @@ export declare const stateAnnotation: import("@langchain/langgraph").AnnotationR
29
29
  }>;
30
30
  export type CompiledGraph = CompiledStateGraph<any, any, string>;
31
31
  export type PreCompiledGraph = StateGraph<any, any, string>;
32
+ //# sourceMappingURL=LangGraph.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LangGraph.types.d.ts","sourceRoot":"","sources":["../../src/types/LangGraph.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAc,kBAAkB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEtE,eAAO,MAAM,eAAe;;;;;;kBAclB,MAAM;yBACC,GAAG;;;kBADV,MAAM;yBACC,GAAG;;kBADV,MAAM;yBACC,GAAG;;kBADV,MAAM;yBACC,GAAG;;kBADV,MAAM;yBACC,GAAG;;;;;EAMlB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AACjE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC"}
@@ -14,3 +14,4 @@ export interface Tool<Input extends z.ZodSchema, Memory> {
14
14
  result?: any;
15
15
  } | void>;
16
16
  }
17
+ //# sourceMappingURL=Tools.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tools.types.d.ts","sourceRoot":"","sources":["../../src/types/Tools.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,SAAS,EAAE,MAAM;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;KAAE,KAAK,OAAO,CAAC;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CACpM"}
@@ -0,0 +1 @@
1
+ export type TriggerBody = any;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Triggers.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Triggers.types.js","sourceRoot":"","sources":["../../src/types/Triggers.types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@minded-ai/mindedjs",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "MindedJS is a TypeScript library for building agents.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {
8
8
  "minded": "./dist/cli/index.js"
9
9
  },
10
+ "files": [
11
+ "dist",
12
+ "src"
13
+ ],
10
14
  "scripts": {
11
15
  "build": "tsc",
12
16
  "watch": "tsc -w",
@@ -49,4 +53,4 @@
49
53
  "uuid": "^11.1.0",
50
54
  "zod": "^3.24.4"
51
55
  }
52
- }
56
+ }
@@ -1,34 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- pull_request:
5
- branches: [ main ]
6
-
7
- jobs:
8
- test:
9
- runs-on: ubuntu-latest
10
-
11
- steps:
12
- - name: Checkout code
13
- uses: actions/checkout@v4
14
-
15
- - name: Use Node.js 20.x
16
- uses: actions/setup-node@v4
17
- with:
18
- node-version: 20.x
19
- cache: 'npm'
20
-
21
- - name: Install dependencies
22
- run: npm ci
23
-
24
- - name: Build project
25
- run: npm run build
26
-
27
- - name: Run lint
28
- run: npm run lint
29
-
30
- - name: Run tests
31
- run: npm test
32
- env:
33
- NODE_ENV: test
34
- OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
package/.prettierrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "bracketSpacing": true,
3
- "printWidth": 140,
4
- "singleQuote": true,
5
- "trailingComma": "all",
6
- "tabWidth": 2,
7
- "useTabs": false
8
- }
@@ -1,6 +0,0 @@
1
- import { MindedConnectionSocketMessageType } from '../platform/mindedConnectionTypes';
2
- import { ActionInputParam } from '../types/Flows.types';
3
- import { Tool } from '../types/Tools.types';
4
- declare const appActionRunnerToolCreator: (schema: ActionInputParam[], name: string, appName: string, awaitEmit: (event: MindedConnectionSocketMessageType, payload: any) => Promise<any>) => Tool<any, any>;
5
- export declare const getAppActionRunnerTool: (appName: string, actionName: string) => Tool<any, any>;
6
- export default appActionRunnerToolCreator;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppActionRunnerTool = void 0;
4
- const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
5
- const zod_1 = require("zod");
6
- const typeToZodMap = {
7
- string: zod_1.z.string(),
8
- number: zod_1.z.number(),
9
- boolean: zod_1.z.boolean(),
10
- array: zod_1.z.array(zod_1.z.any()),
11
- object: zod_1.z.record(zod_1.z.any()),
12
- any: zod_1.z.any()
13
- };
14
- const convertToZodSchema = (schema) => {
15
- var _a;
16
- const zodSchema = {};
17
- for (const [key, type] of Object.entries(schema)) {
18
- const zodType = (_a = typeToZodMap[type.toLowerCase()]) !== null && _a !== void 0 ? _a : zod_1.z.string();
19
- zodSchema[key] = zodType;
20
- }
21
- return zod_1.z.object(zodSchema);
22
- };
23
- const sanitizeName = (name) => {
24
- return name.replace(/[^a-zA-Z0-9_-]/g, '-');
25
- };
26
- const createdTools = {};
27
- const appActionRunnerToolCreator = (schema, name, appName, awaitEmit) => {
28
- const zodSchema = convertToZodSchema(schema.reduce((acc, param) => {
29
- acc[param.name] = param.type;
30
- return acc;
31
- }, {}));
32
- const tool = {
33
- name: `${sanitizeName(appName)}-${sanitizeName(name)}`,
34
- description: `Run ${name} action from ${appName}`,
35
- input: zodSchema,
36
- execute: async ({ input }) => {
37
- console.log('*Action: App action runner*');
38
- console.log('input', input);
39
- const response = await awaitEmit(mindedConnectionTypes_1.MindedConnectionSocketMessageType.OnAppAction, {
40
- appName,
41
- actionName: name,
42
- actionInput: input,
43
- });
44
- return response;
45
- },
46
- };
47
- createdTools[`${appName}-${name}`] = tool;
48
- return tool;
49
- };
50
- const getAppActionRunnerTool = (appName, actionName) => {
51
- return createdTools[`${appName}-${actionName}`];
52
- };
53
- exports.getAppActionRunnerTool = getAppActionRunnerTool;
54
- exports.default = appActionRunnerToolCreator;
55
- //# sourceMappingURL=appActionRunnerTool.js.map
@@ -1 +0,0 @@
1
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CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACX,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;QAC7B,OAAO,GAAG,CAAC;IACf,CAAC,EACD,EAA4B,CAC/B,CAAC,CAAC;IAGH,MAAM,IAAI,GAAG;QACT,IAAI,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE;QACtD,WAAW,EAAE,OAAO,IAAI,gBAAgB,OAAO,EAAE;QACjD,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAwB,EAAE,EAAE;YAC/C,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC5B,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,yDAAiC,CAAC,WAAW,EAAE;gBAC5E,OAAO;gBACP,UAAU,EAAE,IAAI;gBAChB,WAAW,EAAE,KAAK;aACrB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QACpB,CAAC;KACJ,CAAC;IACF,YAAY,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1C,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA;AAEM,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAE,EAAE;IAC1E,OAAO,YAAY,CAAC,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC;AACpD,CAAC,CAAA;AAFY,QAAA,sBAAsB,0BAElC;AAED,kBAAe,0BAA0B,CAAC"}
@@ -1,11 +0,0 @@
1
- import { AppToolNode, ToolNode } from "../types/Flows.types";
2
- import { stateAnnotation } from "../types/LangGraph.types";
3
- import { Tool } from "../types/Tools.types";
4
- import { BaseLanguageModel } from "@langchain/core/language_models/base";
5
- import { BaseMessage, ToolMessage } from "@langchain/core/messages";
6
- declare const actionRunnerTool: <Memory>(matchedTool: Tool<any, Memory>, toolNode: ToolNode | AppToolNode, llm: BaseLanguageModel, addedPrompt?: string) => (state: typeof stateAnnotation.State) => Promise<{
7
- memory: {};
8
- messages: (BaseMessage | ToolMessage)[];
9
- triggerInvocations: import("..").TriggerInvocationHistory[];
10
- }>;
11
- export default actionRunnerTool;
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Flows_types_1 = require("../types/Flows.types");
4
- const prebuilt_1 = require("@langchain/langgraph/prebuilt");
5
- const langgraph_1 = require("@langchain/langgraph");
6
- const messages_1 = require("@langchain/core/messages");
7
- const uuid_1 = require("uuid");
8
- const tools_1 = require("@langchain/core/tools");
9
- const actionRunnerTool = (matchedTool, toolNode, llm, addedPrompt) => {
10
- return async (state) => {
11
- try {
12
- console.log(`Executing tool node ${toolNode.name}`);
13
- const executeWrapper = async (input) => {
14
- try {
15
- const response = await matchedTool.execute({ input, memory: state.memory, triggerInvocations: state.triggerInvocations });
16
- return response || {};
17
- }
18
- catch (error) {
19
- console.error('Error executing tool', error);
20
- throw error;
21
- }
22
- };
23
- const tool = (0, tools_1.tool)(executeWrapper, {
24
- name: matchedTool.name,
25
- description: matchedTool.description,
26
- schema: matchedTool.input,
27
- });
28
- const prompt = `
29
- Context:
30
- messages: ${JSON.stringify(state.messages)}
31
- workflow memory: ${JSON.stringify(state.memory)}
32
- Instructions:
33
- Call immediately tool ${tool.name}(...)
34
- ${toolNode.prompt && `Tool execution instructions: ${toolNode.prompt}`}
35
- ${addedPrompt && `Additional instructions: ${addedPrompt}`}
36
- `;
37
- const toolCallingAgent = (0, prebuilt_1.createReactAgent)({
38
- checkpointer: new langgraph_1.MemorySaver(),
39
- llm,
40
- tools: [tool],
41
- });
42
- const response = await toolCallingAgent.invoke({ messages: [new messages_1.SystemMessage(prompt)] }, { configurable: { thread_id: (0, uuid_1.v4)() } });
43
- console.log('response', JSON.stringify({ response, matchedTool, toolNode, tool }, null, 2));
44
- const toolCallMessage = getLastToolCallMessage(response.messages);
45
- const toolResponseMessage = getLastToolMessage(response.messages);
46
- if (!toolCallMessage || !toolResponseMessage) {
47
- throw new Error('Tool call or tool response message not found');
48
- }
49
- let toolMemory = {};
50
- if (toolNode.type === Flows_types_1.NodeType.APP_TOOL) {
51
- toolMemory = extractToolMemoryResponse(toolResponseMessage);
52
- }
53
- return { memory: toolMemory, messages: [toolCallMessage, toolResponseMessage], triggerInvocations: state.triggerInvocations };
54
- }
55
- catch (error) {
56
- console.error('Error executing tool node', error);
57
- throw error;
58
- }
59
- };
60
- };
61
- exports.default = actionRunnerTool;
62
- const getLastToolCallMessage = (messages) => {
63
- const toolCallMessages = messages.filter((message) => { var _a; return ((_a = message.tool_calls) === null || _a === void 0 ? void 0 : _a.length) || 0 > 0; });
64
- const lastToolCallMessage = toolCallMessages[toolCallMessages.length - 1];
65
- return lastToolCallMessage;
66
- };
67
- const getLastToolMessage = (messages) => {
68
- const toolMessages = messages.filter((message) => message.getType() === 'tool');
69
- const lastToolMessage = toolMessages[toolMessages.length - 1];
70
- return lastToolMessage;
71
- };
72
- const extractToolMemoryResponse = (toolMessage) => {
73
- try {
74
- const parsed = JSON.parse(toolMessage.content);
75
- if (typeof parsed === 'object' && parsed !== null && 'memory' in parsed) {
76
- return parsed.memory;
77
- }
78
- }
79
- catch (error) {
80
- console.error('Error parsing tool memory response', error);
81
- }
82
- return {};
83
- };
84
- //# sourceMappingURL=actionRunnerTool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionRunnerTool.js","sourceRoot":"","sources":["../../src/nodes/actionRunnerTool.ts"],"names":[],"mappings":";;AAAA,sDAAuE;AAIvE,4DAAiE;AACjE,oDAAmD;AAEnD,uDAA8F;AAC9F,+BAAoC;AACpC,iDAA8D;AAE9D,MAAM,gBAAgB,GAAG,CAAS,WAA8B,EAAE,QAAgC,EAAE,GAAsB,EAAE,WAAoB,EAAE,EAAE;IAChJ,O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E,EAAE,WAAC,OAAA,CAAA,MAAC,OAAqB,CAAC,UAAU,0CAAE,MAAM,KAAI,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAAC;IAC1G,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1E,OAAO,mBAAmB,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,QAAuB,EAAe,EAAE;IAChE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,CAAC;IAChF,MAAM,eAAe,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9D,OAAO,eAA8B,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAS,WAAwB,EAAmB,EAAE;IACpF,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAiB,CAAC,CAAC;QACzD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;YACtE,OAAO,MAAM,CAAC,MAAM,CAAC;QACzB,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { AppToolNode } from '../types/Flows.types';
2
- import { PreCompiledGraph } from "../types/LangGraph.types";
3
- import { BaseLanguageModel } from "@langchain/core/language_models/base";
4
- export declare const addAppToolNode: <Memory>({ graph, node, llm, }: {
5
- graph: PreCompiledGraph;
6
- node: AppToolNode;
7
- llm: BaseLanguageModel;
8
- }) => void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addAppToolNode = void 0;
4
- const appToolRunner_1 = require("../tools/appToolRunner");
5
- const toolNodeRunner_1 = require("./toolNodeRunner");
6
- const addAppToolNode = ({ graph, node, llm, }) => {
7
- const toolNode = node;
8
- const callback = (0, toolNodeRunner_1.getToolNodeRunner)(toolNode, appToolRunner_1.appToolRunnerTool, llm);
9
- graph.addNode(node.name, callback);
10
- };
11
- exports.addAppToolNode = addAppToolNode;
12
- //# sourceMappingURL=addAppTool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addAppTool.js","sourceRoot":"","sources":["../../src/nodes/addAppTool.ts"],"names":[],"mappings":";;;AAGA,0DAA2D;AAC3D,qDAAqD;AAG9C,MAAM,cAAc,GAAG,CAAS,EACnC,KAAK,EACL,IAAI,EACJ,GAAG,GAKN,EAAE,EAAE;IACD,MAAM,QAAQ,GAAG,IAAmB,CAAC;IACrC,MAAM,QAAQ,GAAiB,IAAA,kCAAiB,EAAS,QAAQ,EAAE,iCAAiB,EAAE,GAAG,CAAC,CAAC;IAC3F,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC,CAAC;AAZW,QAAA,cAAc,kBAYzB"}