@minded-ai/mindedjs 1.0.90 → 1.0.91-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 (72) hide show
  1. package/dist/agent.d.ts.map +1 -1
  2. package/dist/agent.js +13 -5
  3. package/dist/agent.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/nodes/addAppToolNode.d.ts.map +1 -1
  9. package/dist/nodes/addAppToolNode.js +2 -2
  10. package/dist/nodes/addAppToolNode.js.map +1 -1
  11. package/dist/nodes/addJumpToNode.d.ts.map +1 -1
  12. package/dist/nodes/addJumpToNode.js +2 -2
  13. package/dist/nodes/addJumpToNode.js.map +1 -1
  14. package/dist/nodes/addJunctionNode.d.ts +7 -0
  15. package/dist/nodes/addJunctionNode.d.ts.map +1 -0
  16. package/dist/nodes/addJunctionNode.js +20 -0
  17. package/dist/nodes/addJunctionNode.js.map +1 -0
  18. package/dist/nodes/addPromptNode.d.ts.map +1 -1
  19. package/dist/nodes/addPromptNode.js +2 -2
  20. package/dist/nodes/addPromptNode.js.map +1 -1
  21. package/dist/nodes/addToolNode.d.ts.map +1 -1
  22. package/dist/nodes/addToolNode.js +2 -2
  23. package/dist/nodes/addToolNode.js.map +1 -1
  24. package/dist/nodes/addToolRunNode.d.ts.map +1 -1
  25. package/dist/nodes/addToolRunNode.js +1 -2
  26. package/dist/nodes/addToolRunNode.js.map +1 -1
  27. package/dist/nodes/addTriggerNode.d.ts.map +1 -1
  28. package/dist/nodes/addTriggerNode.js +1 -2
  29. package/dist/nodes/addTriggerNode.js.map +1 -1
  30. package/dist/nodes/nodeFactory.d.ts.map +1 -1
  31. package/dist/nodes/nodeFactory.js +2 -5
  32. package/dist/nodes/nodeFactory.js.map +1 -1
  33. package/dist/types/Agent.types.d.ts +11 -6
  34. package/dist/types/Agent.types.d.ts.map +1 -1
  35. package/dist/types/Agent.types.js +1 -0
  36. package/dist/types/Agent.types.js.map +1 -1
  37. package/docs/.gitbook/assets/ADLC.png +0 -0
  38. package/docs/.gitbook/assets/PII-masking.png +0 -0
  39. package/docs/.gitbook/assets/image.png +0 -0
  40. package/docs/README.md +54 -0
  41. package/docs/SUMMARY.md +39 -0
  42. package/docs/examples/order-refund-flow.md +566 -0
  43. package/docs/getting-started/environment-configuration.md +98 -0
  44. package/docs/getting-started/installation.md +44 -0
  45. package/docs/getting-started/project-configuration.md +206 -0
  46. package/docs/getting-started/quick-start.md +262 -0
  47. package/docs/integrations/zendesk.md +554 -0
  48. package/docs/low-code-editor/edges.md +392 -0
  49. package/docs/low-code-editor/flows.md +74 -0
  50. package/docs/low-code-editor/nodes.md +331 -0
  51. package/docs/low-code-editor/playbooks.md +262 -0
  52. package/docs/low-code-editor/tools.md +303 -0
  53. package/docs/low-code-editor/triggers.md +156 -0
  54. package/docs/platform/events.md +374 -0
  55. package/docs/platform/logging.md +72 -0
  56. package/docs/platform/memory.md +219 -0
  57. package/docs/platform/pii-masking.md +220 -0
  58. package/docs/platform/secrets.md +99 -0
  59. package/docs/resources/your-first-eval.md +108 -0
  60. package/docs-structure.md +141 -0
  61. package/package.json +5 -3
  62. package/src/agent.ts +19 -12
  63. package/src/index.ts +0 -1
  64. package/src/nodes/addAppToolNode.ts +3 -3
  65. package/src/nodes/addJumpToNode.ts +3 -3
  66. package/src/nodes/addJunctionNode.ts +19 -0
  67. package/src/nodes/addPromptNode.ts +3 -3
  68. package/src/nodes/addToolNode.ts +2 -3
  69. package/src/nodes/addToolRunNode.ts +2 -3
  70. package/src/nodes/addTriggerNode.ts +3 -3
  71. package/src/nodes/nodeFactory.ts +1 -5
  72. package/src/types/Agent.types.ts +11 -5
@@ -1,4 +1,4 @@
1
- import { AppToolNode } from '../types/Flows.types';
1
+ import { AppToolNode, NodeType } from '../types/Flows.types';
2
2
  import { tool as langchainTool } from '@langchain/core/tools';
3
3
  import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
4
4
  import { SystemMessage } from '@langchain/core/messages';
@@ -6,7 +6,7 @@ import { RunnableLike } from '@langchain/core/runnables';
6
6
  import { z } from 'zod';
7
7
  import { LLMProviders } from '../types/LLM.types';
8
8
  import { getAppActionRunnerTool } from '../internalTools/appActionRunnerTool';
9
- import { AppActionInvocationHistoryStep, HistoryStepType } from '../types/Agent.types';
9
+ import { AppActionInvocationHistoryStep } from '../types/Agent.types';
10
10
  import { Agent } from '../agent';
11
11
  import { logger } from '../utils/logger';
12
12
  import { compilePlaybooks } from '../playbooks/playbooks';
@@ -82,7 +82,7 @@ export const addAppToolNode = async ({
82
82
  return {
83
83
  messages: [AIToolCallMessage, toolCallMessage],
84
84
  history: createHistoryStep<AppActionInvocationHistoryStep>(state.history, {
85
- type: HistoryStepType.APP_ACTION_NODE,
85
+ type: NodeType.APP_TOOL,
86
86
  nodeId: node.name,
87
87
  nodeDisplayName: node.displayName!,
88
88
  raw: AIToolCallMessage.tool_calls[0],
@@ -1,8 +1,8 @@
1
1
  import { RunnableLike } from '@langchain/core/runnables';
2
2
  import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
3
- import { JumpToNode } from '../types/Flows.types';
3
+ import { JumpToNode, NodeType } from '../types/Flows.types';
4
4
  import { logger } from '../utils/logger';
5
- import { HistoryStepType, HistoryStep } from '../types/Agent.types';
5
+ import { HistoryStep } from '../types/Agent.types';
6
6
  import { createHistoryStep } from '../utils/history';
7
7
 
8
8
  export const addJumpToNode = async ({ graph, node }: { graph: PreCompiledGraph; node: JumpToNode }) => {
@@ -11,7 +11,7 @@ export const addJumpToNode = async ({ graph, node }: { graph: PreCompiledGraph;
11
11
  // No state modifications are necessary; control flow is handled via edges.
12
12
  return {
13
13
  history: createHistoryStep<HistoryStep>(state.history, {
14
- type: HistoryStepType.JUMP_TO_NODE,
14
+ type: NodeType.JUMP_TO_NODE,
15
15
  nodeId: node.name,
16
16
  nodeDisplayName: node.displayName,
17
17
  raw: '',
@@ -0,0 +1,19 @@
1
+ import { JunctionNode, NodeType } from '../types/Flows.types';
2
+ import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
3
+ import { RunnableLike } from '@langchain/core/runnables';
4
+ import { createHistoryStep } from '../utils/history';
5
+ import { HistoryStep } from '../types/Agent.types';
6
+
7
+ export const addJunctionNode = ({ graph, node }: { graph: PreCompiledGraph; node: JunctionNode }) => {
8
+ const callback: RunnableLike = async (state: typeof stateAnnotation.State) => {
9
+ return {
10
+ history: createHistoryStep<HistoryStep>(state.history, {
11
+ type: NodeType.JUNCTION,
12
+ nodeId: node.name,
13
+ nodeDisplayName: node.displayName,
14
+ raw: '',
15
+ }),
16
+ };
17
+ };
18
+ graph.addNode(node.name, callback);
19
+ };
@@ -1,5 +1,5 @@
1
1
  import { RunnableLike } from '@langchain/core/runnables';
2
- import { PromptNode } from '../types/Flows.types';
2
+ import { NodeType, PromptNode } from '../types/Flows.types';
3
3
  import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
4
4
  import { z } from 'zod';
5
5
  import { BaseLanguageModel } from '@langchain/core/language_models/base';
@@ -7,7 +7,7 @@ import { SystemMessage, AIMessage, ToolMessage } from '@langchain/core/messages'
7
7
  import { Tool } from '../types/Tools.types';
8
8
  import { tool as langchainTool } from '@langchain/core/tools';
9
9
  import { AgentEventRequestPayloads, AgentEvents } from '../events/AgentEvents';
10
- import { EmitSignature, HistoryStepType, HistoryStep } from '../types/Agent.types';
10
+ import { EmitSignature, HistoryStep } from '../types/Agent.types';
11
11
  import { createLlmInstance } from '../llm/createLlmInstance';
12
12
  import extractToolStateResponse from '../utils/extractStateMemoryResponse';
13
13
  import { Agent } from '../agent';
@@ -104,7 +104,7 @@ export const addPromptNode = async ({ graph, node, llm, tools, emit, agent }: Ad
104
104
 
105
105
  return {
106
106
  history: createHistoryStep<HistoryStep>(state.history, {
107
- type: HistoryStepType.PROMPT_NODE,
107
+ type: NodeType.PROMPT_NODE,
108
108
  nodeId: node.name,
109
109
  nodeDisplayName: node.displayName,
110
110
  raw: result.content,
@@ -1,4 +1,4 @@
1
- import { ToolNode } from '../types/Flows.types';
1
+ import { NodeType, ToolNode } from '../types/Flows.types';
2
2
  import { Tool } from '../types/Tools.types';
3
3
  import { tool as langchainTool } from '@langchain/core/tools';
4
4
  import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
@@ -10,7 +10,6 @@ import { Agent } from '../agent';
10
10
  import { compilePlaybooks } from '../playbooks/playbooks';
11
11
  import { createHistoryStep } from '../utils/history';
12
12
  import { HistoryStep } from '../types/Agent.types';
13
- import { HistoryStepType } from '../types/Agent.types';
14
13
 
15
14
  export const addToolNode = async ({
16
15
  graph,
@@ -60,7 +59,7 @@ export const addToolNode = async ({
60
59
  return {
61
60
  messages: [AIToolCallMessage],
62
61
  history: createHistoryStep<HistoryStep>(state.history, {
63
- type: HistoryStepType.CUSTOM_ACTION_NODE,
62
+ type: NodeType.TOOL,
64
63
  nodeId: node.name,
65
64
  nodeDisplayName: node.displayName,
66
65
  raw: AIToolCallMessage.tool_calls?.[0] || '',
@@ -2,7 +2,7 @@ import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
2
2
  import { RunnableLike } from '@langchain/core/runnables';
3
3
  import { Tool } from '../types/Tools.types';
4
4
  import { LLMProviders } from '../types/LLM.types';
5
- import { internalNodesSuffix, ToolNode } from '../types/Flows.types';
5
+ import { internalNodesSuffix, NodeType, ToolNode } from '../types/Flows.types';
6
6
  import { tool as langchainTool } from '@langchain/core/tools';
7
7
  import { ToolMessage } from '@langchain/core/messages';
8
8
  import { z } from 'zod';
@@ -11,7 +11,6 @@ import { Agent } from '../agent';
11
11
  import { logger } from '../utils/logger';
12
12
  import { createHistoryStep } from '../utils/history';
13
13
  import { HistoryStep } from '../types/Agent.types';
14
- import { HistoryStepType } from '../types/Agent.types';
15
14
 
16
15
  type AddToolRunNodeParams = {
17
16
  graph: PreCompiledGraph;
@@ -61,7 +60,7 @@ export const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeNam
61
60
  ...toolStateUpdate,
62
61
  messages: updatedMessages,
63
62
  history: createHistoryStep<HistoryStep>(state.history, {
64
- type: HistoryStepType.CUSTOM_ACTION_NODE,
63
+ type: NodeType.TOOL,
65
64
  nodeId: toolNode.name,
66
65
  nodeDisplayName: toolNode.displayName,
67
66
  raw: toolCallMessage,
@@ -1,8 +1,8 @@
1
1
  import { RunnableLike } from '@langchain/core/runnables';
2
- import { TriggerNode, TriggerType } from '../types/Flows.types';
2
+ import { NodeType, TriggerNode, TriggerType } from '../types/Flows.types';
3
3
  import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
4
4
  import { logger } from '../utils/logger';
5
- import { HistoryStep, HistoryStepType } from '../types/Agent.types';
5
+ import { HistoryStep } from '../types/Agent.types';
6
6
  import { createHistoryStep } from '../utils/history';
7
7
 
8
8
  export const addTriggerNode = async ({ graph, node }: { graph: PreCompiledGraph; node: TriggerNode }) => {
@@ -11,7 +11,7 @@ export const addTriggerNode = async ({ graph, node }: { graph: PreCompiledGraph;
11
11
  if (node.triggerType === TriggerType.MANUAL) {
12
12
  return {
13
13
  history: createHistoryStep<HistoryStep>(state.history, {
14
- type: HistoryStepType.TRIGGER_NODE,
14
+ type: NodeType.TRIGGER,
15
15
  nodeId: node.name,
16
16
  nodeDisplayName: node.displayName,
17
17
  raw: '',
@@ -11,11 +11,7 @@ import { addTriggerNode } from './addTriggerNode';
11
11
  import { LLMProviders } from '../types/LLM.types';
12
12
  import { Agent } from '../agent';
13
13
  import { addJumpToNode } from './addJumpToNode';
14
-
15
- const addJunctionNode = ({ graph, node }: { graph: PreCompiledGraph; node: JunctionNode }) => {
16
- const callback: RunnableLike = async () => { };
17
- graph.addNode(node.name, callback);
18
- };
14
+ import { addJunctionNode } from './addJunctionNode';
19
15
 
20
16
  export const nodeFactory = ({
21
17
  graph,
@@ -1,5 +1,6 @@
1
1
  import { AgentEventRequestPayloads, AgentEventResponsePayloads } from '../events/AgentEvents';
2
2
  import { LLMConfig } from './LLM.types';
3
+ import { NodeType } from './Flows.types';
3
4
 
4
5
  export type EmitSignature<Memory, E extends keyof AgentEventRequestPayloads<Memory>> = (
5
6
  event: E,
@@ -37,10 +38,11 @@ export enum HistoryStepType {
37
38
  CUSTOM_ACTION_NODE = 'customActionNode',
38
39
  PROMPT_NODE = 'promptNode',
39
40
  JUMP_TO_NODE = 'jumpToNode',
41
+ JUNCTION_NODE = 'junctionNode',
40
42
  }
41
43
 
42
44
  export interface HistoryStep {
43
- type: HistoryStepType;
45
+ type: NodeType;
44
46
  step: number;
45
47
  raw: any;
46
48
  nodeId: string;
@@ -49,21 +51,25 @@ export interface HistoryStep {
49
51
  }
50
52
 
51
53
  export interface AppTriggerHistoryStep extends HistoryStep {
52
- type: HistoryStepType.APP_TRIGGER_NODE;
54
+ type: NodeType.TRIGGER;
53
55
  appName: string;
54
56
  }
55
57
 
56
58
  export interface TriggerHistoryStep extends HistoryStep {
57
- type: HistoryStepType.TRIGGER_NODE;
59
+ type: NodeType.TRIGGER;
58
60
  }
59
61
 
60
62
  export interface AppActionInvocationHistoryStep extends HistoryStep {
61
- type: HistoryStepType.APP_ACTION_NODE;
63
+ type: NodeType.APP_TOOL;
62
64
  appName: string;
63
65
  }
64
66
 
65
67
  export interface CustomActionInvocationHistoryStep extends HistoryStep {
66
- type: HistoryStepType.CUSTOM_ACTION_NODE;
68
+ type: NodeType.TOOL;
69
+ }
70
+
71
+ export interface JunctionHistoryStep extends HistoryStep {
72
+ type: NodeType.JUNCTION;
67
73
  }
68
74
 
69
75
  export enum SessionType {