@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
@@ -1,92 +0,0 @@
1
- import { expect } from 'chai';
2
- import { Agent } from '../../src/agent';
3
- import { z } from 'zod';
4
- import path from 'path';
5
- import { AgentEvents } from '../../src/events/AgentEvents';
6
- import { HumanMessage } from '@langchain/core/messages';
7
-
8
- const memorySchema = z.object({
9
- userName: z.string(),
10
- });
11
-
12
- describe('Prompt Edges', () => {
13
- let agent: Agent;
14
-
15
- beforeEach(() => {
16
- const flowsPath = path.join(__dirname, 'flows');
17
- const toolsPath = path.join(__dirname, 'tools');
18
- agent = new Agent({
19
- memorySchema,
20
- config: {
21
- flows: [flowsPath],
22
- tools: [toolsPath],
23
- llm: {
24
- name: 'ChatOpenAI',
25
- properties: {
26
- model: 'gpt-4.1'
27
- }
28
- }
29
- },
30
- tools: [
31
- {
32
- name: 'successTool',
33
- description: 'Success Tool',
34
- input: z.object({
35
- userName: z.string(),
36
- }),
37
- execute: async ({ input }) => ({
38
- memory: { userName: input.userName },
39
- }),
40
- },
41
- {
42
- name: 'failureTool',
43
- description: 'Failure Tool',
44
- input: z.object({
45
- userName: z.string(),
46
- }),
47
- execute: async ({ input }) => ({
48
- memory: { userName: input.userName },
49
- }),
50
- },
51
- ],
52
- });
53
-
54
- // Add trigger event handler
55
- agent.on(AgentEvents.TRIGGER_EVENT, async ({ triggerName, triggerBody }) => {
56
- if (triggerName === 'Trigger') {
57
- return {
58
- memory: {},
59
- messages: [new HumanMessage(triggerBody.message)],
60
- };
61
- }
62
- });
63
- });
64
-
65
- it('should evaluate prompt condition edge correctly', async function () {
66
- this.timeout(10000); // Increase timeout to 10 seconds
67
-
68
- const result = await agent.invoke({
69
- triggerBody: {
70
- message: 'Hi, my name is Itay',
71
- },
72
- triggerName: 'Trigger',
73
- appName: 'test',
74
- });
75
-
76
- expect(result.memory.userName).to.equal('Itay');
77
- });
78
-
79
- it('should evaluate prompt condition edge correctly', async function () {
80
- this.timeout(10000); // Increase timeout to 10 seconds
81
-
82
- const result = await agent.invoke({
83
- triggerBody: {
84
- message: 'Hi, my name is Ilan',
85
- },
86
- triggerName: 'Trigger',
87
- appName: 'test',
88
- });
89
-
90
- expect(result.memory.userName).to.equal('Ilan');
91
- });
92
- });
@@ -1,24 +0,0 @@
1
- name: Test Flow
2
- nodes:
3
- - type: 'trigger'
4
- triggerType: 'manual'
5
- name: 'Trigger'
6
-
7
- - type: 'promptNode'
8
- name: 'Prompt'
9
- prompt: 'Ask the user for their name'
10
- humanInTheLoop: true
11
- canStayOnNode: true
12
-
13
- - type: 'tool'
14
- name: 'Success'
15
- toolName: 'successTool'
16
-
17
- edges:
18
- - source: 'Trigger'
19
- target: 'Prompt'
20
- type: 'stepForward'
21
-
22
- - source: 'Prompt'
23
- target: 'Success'
24
- type: 'stepForward'
@@ -1,88 +0,0 @@
1
- import { expect } from 'chai';
2
- import { Agent } from '../../src/agent';
3
- import { z } from 'zod';
4
- import { v4 as uuidv4 } from 'uuid';
5
- import path from 'path';
6
- import { AgentEvents } from '../../src/events/AgentEvents';
7
- import { HumanMessage } from '@langchain/core/messages';
8
-
9
- const memorySchema = z.object({
10
- success: z.boolean(),
11
- });
12
-
13
- describe('Prompt Node', function () {
14
- this.timeout(10000); // Set timeout to 10 seconds for all tests in this suite
15
-
16
- let agent: Agent;
17
-
18
- beforeEach(() => {
19
- const flowsPath = path.join(__dirname, 'flows');
20
- const toolsPath = path.join(__dirname, 'tools');
21
- agent = new Agent({
22
- memorySchema,
23
- config: {
24
- flows: [flowsPath],
25
- tools: [toolsPath],
26
- llm: {
27
- name: 'ChatOpenAI',
28
- properties: {
29
- model: 'gpt-4.1',
30
- },
31
- },
32
- },
33
- tools: [
34
- {
35
- name: 'successTool',
36
- description: 'Success Tool',
37
- input: z.object({
38
- name: z.string(),
39
- }),
40
- execute: async () => ({
41
- memory: {
42
- success: true,
43
- },
44
- }),
45
- },
46
- ],
47
- });
48
-
49
- // Add trigger event handler
50
- agent.on(AgentEvents.TRIGGER_EVENT, async ({ triggerName, triggerBody }) => {
51
- if (triggerName === 'Trigger') {
52
- return {
53
- memory: {},
54
- messages: [new HumanMessage(triggerBody.message)],
55
- };
56
- }
57
- });
58
- });
59
-
60
- it('should execute a multi-stage prompt node with onMessage callback', async function () {
61
- this.timeout(20000); // Set timeout to 10 seconds for all tests in this suite
62
-
63
- const sessionId = uuidv4();
64
- const result = await agent.invoke({
65
- triggerBody: {
66
- message: 'Hi there',
67
- },
68
- triggerName: 'Trigger',
69
- sessionId: sessionId,
70
- appName: 'test',
71
- });
72
-
73
- // Should pause execution at prompt node
74
- expect(result.memory.success).to.not.equal(true);
75
-
76
- // Should resume execution at success node
77
- const result2 = await agent.invoke({
78
- triggerBody: {
79
- message: 'Itay',
80
- },
81
- triggerName: 'Trigger',
82
- sessionId: sessionId,
83
- appName: 'test',
84
- });
85
-
86
- expect(result2.memory.success).to.equal(true);
87
- });
88
- });
package/test/setup.ts DELETED
@@ -1,5 +0,0 @@
1
- import { config } from 'dotenv';
2
- import { resolve } from 'path';
3
-
4
- // Load environment variables from .env file
5
- config({ path: resolve(__dirname, '../.env') });
@@ -1,14 +0,0 @@
1
- name: Test Flow
2
- nodes:
3
- - type: 'trigger'
4
- triggerType: 'manual'
5
- name: 'Trigger'
6
-
7
- - type: 'tool'
8
- name: 'Test Tool'
9
- toolName: 'testTool'
10
-
11
- edges:
12
- - source: 'Trigger'
13
- target: 'Test Tool'
14
- type: 'stepForward'
@@ -1,68 +0,0 @@
1
- import { expect } from 'chai';
2
- import { Agent } from '../../src/agent';
3
- import { z } from 'zod';
4
- import path from 'path';
5
- import { AgentEvents } from '../../src/events/AgentEvents';
6
- import { HumanMessage } from '@langchain/core/messages';
7
-
8
- const memorySchema = z.object({
9
- processed: z.boolean(),
10
- });
11
-
12
- describe('Tool Node', function () {
13
- this.timeout(10000); // Set timeout to 10 seconds for all tests in this suite
14
-
15
- let agent: Agent;
16
-
17
- beforeEach(() => {
18
- const flowsPath = path.join(__dirname, 'flows');
19
- const toolsPath = path.join(__dirname, 'tools');
20
- agent = new Agent({
21
- memorySchema,
22
- config: {
23
- flows: [flowsPath],
24
- tools: [toolsPath],
25
- llm: {
26
- name: 'ChatOpenAI',
27
- properties: {
28
- model: 'gpt-4.1'
29
- }
30
- }
31
- },
32
- tools: [
33
- {
34
- name: 'testTool',
35
- description: 'Test Tool',
36
- input: z.object({
37
- test: z.string(),
38
- }),
39
- execute: async () => ({
40
- memory: { processed: true },
41
- }),
42
- },
43
- ],
44
- });
45
-
46
- // Add trigger event handler
47
- agent.on(AgentEvents.TRIGGER_EVENT, async ({ triggerName, triggerBody }) => {
48
- if (triggerName === 'Trigger') {
49
- return {
50
- memory: {},
51
- messages: [new HumanMessage(triggerBody.message)],
52
- };
53
- }
54
- });
55
- });
56
-
57
- it('should execute tool with correct input', async () => {
58
- const result = await agent.invoke({
59
- triggerBody: {
60
- message: 'Test message',
61
- },
62
- triggerName: 'Trigger',
63
- appName: 'test',
64
- });
65
-
66
- expect(result.memory.processed).to.equal(true);
67
- });
68
- });
@@ -1,7 +0,0 @@
1
- name: Test Flow
2
- nodes:
3
- - type: 'trigger'
4
- triggerType: 'manual'
5
- name: 'Trigger'
6
-
7
- edges: []
@@ -1,185 +0,0 @@
1
- import { expect } from 'chai';
2
- import { Agent } from '../../src/agent';
3
- import { z } from 'zod';
4
- import path from 'path';
5
- import { AgentEvents } from '../../src/events/AgentEvents';
6
- import { HumanMessage } from '@langchain/core/messages';
7
- import { Tool } from '../../src/types/Tools.types';
8
- type Memory = z.infer<typeof memorySchema>;
9
-
10
- const memorySchema = z.object({
11
- success: z.boolean(),
12
- });
13
-
14
-
15
- const schema = z.object({
16
- orderId: z.string(),
17
- customerName: z.string(),
18
- });
19
-
20
- const testTool: Tool<typeof schema, Memory> = {
21
- name: 'testTool',
22
- description: 'Test tool',
23
- input: schema,
24
- execute: async ({ triggerInvocations }) => {
25
- expect(triggerInvocations).to.have.lengthOf(1);
26
- },
27
- };
28
-
29
- describe('Trigger Node', () => {
30
- let agent: Agent;
31
-
32
- it('should add trigger invocation to history', async function () {
33
- const flowsPath = path.join(__dirname, 'flows');
34
- const toolsPath = path.join(__dirname, 'tools');
35
- agent = new Agent({
36
- memorySchema,
37
- config: {
38
- flows: [flowsPath],
39
- tools: [toolsPath],
40
- llm: {
41
- name: 'ChatOpenAI',
42
- properties: {
43
- model: 'gpt-4.1'
44
- }
45
- }
46
- },
47
- tools: [testTool],
48
- });
49
- await agent.invoke({
50
- triggerBody: {
51
- message: 'Test message',
52
- },
53
- triggerName: 'Trigger',
54
- appName: 'test',
55
- });
56
-
57
- });
58
-
59
- it('should properly transform trigger input', async function () {
60
- const flowsPath = path.join(__dirname, 'flows');
61
- const toolsPath = path.join(__dirname, 'tools');
62
- agent = new Agent({
63
- memorySchema,
64
- config: {
65
- flows: [flowsPath],
66
- tools: [toolsPath],
67
- llm: {
68
- name: 'ChatOpenAI',
69
- properties: {
70
- model: 'gpt-4.1'
71
- }
72
- }
73
- },
74
- tools: [],
75
- });
76
- // Add trigger event handler
77
- agent.on(AgentEvents.TRIGGER_EVENT, async ({ triggerName, triggerBody }) => {
78
- if (triggerName === 'Trigger') {
79
- return {
80
- memory: { success: true },
81
- messages: [new HumanMessage(triggerBody.message)],
82
- };
83
- }
84
- });
85
- this.timeout(10000); // Increase timeout to 10 seconds
86
-
87
- const result = await agent.invoke({
88
- triggerBody: {
89
- message: 'Test message',
90
- },
91
- triggerName: 'Trigger',
92
- appName: 'test',
93
- });
94
-
95
- expect(result.messages).to.have.lengthOf(1);
96
- expect(result.messages[0].content).to.equal('Test message');
97
- expect(result.memory.success).to.equal(true);
98
- });
99
-
100
- it('should add trigger invocation to tool calls', async function () {
101
- const flowsPath = path.join(__dirname, 'flows');
102
- const toolsPath = path.join(__dirname, 'tools');
103
- agent = new Agent({
104
- memorySchema,
105
- config: {
106
- flows: [flowsPath],
107
- tools: [toolsPath],
108
- llm: {
109
- name: 'ChatOpenAI',
110
- properties: {
111
- model: 'gpt-4.1'
112
- }
113
- }
114
- },
115
- tools: [testTool],
116
- });
117
-
118
- await agent.invoke({
119
- triggerBody: {
120
- message: 'Test message',
121
- },
122
- triggerName: 'Trigger',
123
- appName: 'test',
124
- });
125
- });
126
-
127
- it('should add human message for Slack triggers', async function () {
128
- const flowsPath = path.join(__dirname, 'flows');
129
- const toolsPath = path.join(__dirname, 'tools');
130
- agent = new Agent({
131
- memorySchema,
132
- config: {
133
- flows: [flowsPath],
134
- tools: [toolsPath],
135
- llm: {
136
- name: 'ChatOpenAI',
137
- properties: {
138
- model: 'gpt-4.1'
139
- }
140
- }
141
- },
142
- tools: [],
143
- });
144
-
145
- const slackResult = await agent.invoke({
146
- triggerBody: {
147
- text: 'Hello from Slack'
148
- },
149
- triggerName: 'New Direct Message (Instant)',
150
- appName: 'Slack',
151
- });
152
-
153
- expect(slackResult.messages).to.have.lengthOf(1);
154
- expect(slackResult.messages[0].content).to.equal('Hello from Slack');
155
- });
156
-
157
- it('should not add messages for triggers without default message injection', async function () {
158
- const flowsPath = path.join(__dirname, 'flows');
159
- const toolsPath = path.join(__dirname, 'tools');
160
- agent = new Agent({
161
- memorySchema,
162
- config: {
163
- flows: [flowsPath],
164
- tools: [toolsPath],
165
- llm: {
166
- name: 'ChatOpenAI',
167
- properties: {
168
- model: 'gpt-4.1'
169
- }
170
- }
171
- },
172
- tools: [],
173
- });
174
-
175
- const otherResult = await agent.invoke({
176
- triggerBody: {
177
- text: 'Hello from other app'
178
- },
179
- triggerName: 'SomeOtherTrigger',
180
- appName: 'OtherApp',
181
- });
182
-
183
- expect(otherResult.messages).to.have.lengthOf(0);
184
- });
185
- });
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "commonjs",
5
- "declaration": true,
6
- "outDir": "./dist",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "moduleResolution": "node",
12
- "resolveJsonModule": true,
13
- "sourceMap": true
14
- },
15
- "include": ["src/**/*"],
16
- "exclude": ["node_modules", "dist"]
17
- }