@minded-ai/mindedjs 1.0.26 → 1.0.27
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.
- package/dist/agent.d.ts +1 -2
- package/dist/agent.js +19 -25
- package/dist/agent.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/edges/createPromptRouter.js +1 -4
- package/dist/edges/createPromptRouter.js.map +1 -1
- package/dist/events/AgentEvents.d.ts +0 -2
- package/dist/events/AgentEvents.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/nodes/addPromptNode.js +1 -4
- package/dist/nodes/addPromptNode.js.map +1 -1
- package/dist/nodes/addToolNode.d.ts +4 -4
- package/dist/nodes/addToolNode.js +3 -6
- package/dist/nodes/addToolNode.js.map +1 -1
- package/dist/nodes/addTriggerNode.js.map +1 -1
- package/dist/nodes/nodeFactory.js +1 -1
- package/dist/nodes/nodeFactory.js.map +1 -1
- package/dist/platform/mindedConnectionTypes.d.ts +0 -1
- package/dist/types/Agent.types.d.ts +0 -12
- package/dist/types/Agent.types.js +0 -6
- package/dist/types/Agent.types.js.map +1 -1
- package/dist/types/Flows.types.d.ts +3 -15
- package/dist/types/LangGraph.types.d.ts +0 -3
- package/dist/types/LangGraph.types.js +0 -8
- package/dist/types/LangGraph.types.js.map +1 -1
- package/dist/types/Tools.types.d.ts +1 -3
- package/dist/types/Triggers.types.d.ts +1 -0
- package/dist/types/Triggers.types.js +3 -0
- package/dist/types/Triggers.types.js.map +1 -0
- package/docs/SUMMARY.md +1 -0
- package/docs/core-concepts/edges.md +84 -27
- package/docs/core-concepts/events.md +12 -8
- package/docs/getting-started/environment-configuration.md +117 -0
- package/docs/getting-started/installation.md +9 -3
- package/examples/orderRefundAgent/orderRefundAgent.ts +1 -1
- package/package.json +1 -1
- package/src/agent.ts +25 -8
- package/src/edges/createDirectEdge.ts +1 -2
- package/src/edges/edgeFactory.ts +76 -51
- package/src/events/AgentEvents.ts +1 -0
- package/src/nodes/addPromptNode.ts +2 -1
- package/src/platform/config.ts +42 -0
- package/src/platform/mindedChatOpenAI.ts +16 -0
- package/src/platform/mindedConnection.ts +4 -3
- package/src/types/LLM.types.ts +4 -2
- package/src/types/LangGraph.types.ts +0 -4
- package/test/edge-priority/edge-priority.test.ts +182 -0
- package/test/edge-priority/flows/all-three-edges/test-flow.yaml +35 -0
- package/test/edge-priority/flows/logical-prompt-edges/test-flow.yaml +26 -0
- package/test/edge-priority/flows/stepforward-logical-edges/test-flow.yaml +25 -0
- package/test/edge-priority/flows/stepforward-prompt-edges/test-flow.yaml +25 -0
- package/dist/internalTools/appActionRunnerTool.d.ts +0 -25
- package/dist/internalTools/appActionRunnerTool.js +0 -30
- package/dist/internalTools/appActionRunnerTool.js.map +0 -1
- package/dist/nodes/actionRunnerTool.d.ts +0 -11
- package/dist/nodes/actionRunnerTool.js +0 -83
- package/dist/nodes/actionRunnerTool.js.map +0 -1
- package/dist/nodes/addAppTool.d.ts +0 -8
- package/dist/nodes/addAppTool.js +0 -12
- package/dist/nodes/addAppTool.js.map +0 -1
- package/dist/nodes/addAppToolNode.d.ts +0 -8
- package/dist/nodes/addAppToolNode.js +0 -14
- package/dist/nodes/addAppToolNode.js.map +0 -1
- package/dist/nodes/callTool.d.ts +0 -10
- package/dist/nodes/callTool.js +0 -57
- package/dist/nodes/callTool.js.map +0 -1
- package/dist/nodes/toolNodeRunner.d.ts +0 -15
- package/dist/nodes/toolNodeRunner.js +0 -79
- package/dist/nodes/toolNodeRunner.js.map +0 -1
- package/dist/tools/appToolRunner.d.ts +0 -30
- package/dist/tools/appToolRunner.js +0 -35
- package/dist/tools/appToolRunner.js.map +0 -1
- package/dist/tools/parser.d.ts +0 -14
- package/dist/tools/parser.js +0 -17
- package/dist/tools/parser.js.map +0 -1
- package/dist/tools/triggerTypeToDefaultMessage.d.ts +0 -3
- package/dist/tools/triggerTypeToDefaultMessage.js +0 -10
- package/dist/tools/triggerTypeToDefaultMessage.js.map +0 -1
- package/dist/triggers/triggerTypeToDefaultMessage.d.ts +0 -3
- package/dist/triggers/triggerTypeToDefaultMessage.js +0 -10
- package/dist/triggers/triggerTypeToDefaultMessage.js.map +0 -1
- package/src/platform/analytics.ts +0 -16
- package/src/platform/mindedRequest.ts +0 -29
|
@@ -22,7 +22,7 @@ type AddPromptNodeParams = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const addPromptNode = async ({ graph, node, llm, tools, emit }: AddPromptNodeParams) => {
|
|
25
|
-
const callback: RunnableLike = async (state: typeof stateAnnotation.State) => {
|
|
25
|
+
const callback: RunnableLike = async (state: typeof stateAnnotation.State, { configurable }) => {
|
|
26
26
|
console.log(`Executing prompt node ${node.name}`);
|
|
27
27
|
const llmToUse = node.llmConfig ? createLlmInstance(node.llmConfig) : llm;
|
|
28
28
|
|
|
@@ -62,6 +62,7 @@ export const addPromptNode = async ({ graph, node, llm, tools, emit }: AddPrompt
|
|
|
62
62
|
await emit(AgentEvents.AI_MESSAGE, {
|
|
63
63
|
message: lastMessage.content as string,
|
|
64
64
|
memory: state.memory,
|
|
65
|
+
sessionId: configurable.thread_id,
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
return {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type MindedConfig = {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
env: Environment;
|
|
4
|
+
token: string;
|
|
5
|
+
runLocally: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type Environment = 'development' | 'sandbox' | 'production' | 'test';
|
|
9
|
+
|
|
10
|
+
export const getConfig = (): MindedConfig => {
|
|
11
|
+
const environment = (process.env.NODE_ENV as Environment) || 'sandbox';
|
|
12
|
+
switch (environment) {
|
|
13
|
+
case 'test':
|
|
14
|
+
return {
|
|
15
|
+
baseUrl: 'http://localhost:8888',
|
|
16
|
+
env: 'test',
|
|
17
|
+
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
18
|
+
runLocally: true,
|
|
19
|
+
};
|
|
20
|
+
case 'development':
|
|
21
|
+
return {
|
|
22
|
+
baseUrl: 'http://localhost:8888',
|
|
23
|
+
env: 'development',
|
|
24
|
+
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
25
|
+
runLocally: process.env.RUN_LOCALLY === 'true',
|
|
26
|
+
};
|
|
27
|
+
case 'sandbox':
|
|
28
|
+
return {
|
|
29
|
+
baseUrl: 'https://dashboard-api.minded.com',
|
|
30
|
+
env: 'sandbox',
|
|
31
|
+
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
32
|
+
runLocally: false,
|
|
33
|
+
};
|
|
34
|
+
case 'production':
|
|
35
|
+
return {
|
|
36
|
+
baseUrl: 'https://api.minded.com',
|
|
37
|
+
env: 'production',
|
|
38
|
+
token: process.env.MINDED_CONNECTION_TOKEN || '',
|
|
39
|
+
runLocally: false,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChatOpenAI, ChatOpenAIFields } from "@langchain/openai";
|
|
2
|
+
import { getConfig } from "./config";
|
|
3
|
+
|
|
4
|
+
export class MindedChatOpenAI extends ChatOpenAI {
|
|
5
|
+
constructor(fields?: ChatOpenAIFields) {
|
|
6
|
+
const { token, baseUrl } = getConfig();
|
|
7
|
+
const mindedBaseUrl = `${baseUrl}/sdk/llmGateway/chatOpenAI`;
|
|
8
|
+
super({
|
|
9
|
+
...fields,
|
|
10
|
+
apiKey: token,
|
|
11
|
+
configuration: {
|
|
12
|
+
baseURL: mindedBaseUrl,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -4,6 +4,7 @@ import { BaseMindedConnectionSocketMessage, MindedConnectionSocketMessageType }
|
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import * as path from 'path';
|
|
6
6
|
import { stringify } from 'flatted';
|
|
7
|
+
import { getConfig } from './config';
|
|
7
8
|
|
|
8
9
|
export class MindedConnection {
|
|
9
10
|
private socket: Socket | null = null;
|
|
@@ -14,7 +15,7 @@ export class MindedConnection {
|
|
|
14
15
|
} = {};
|
|
15
16
|
|
|
16
17
|
constructor() {
|
|
17
|
-
if (!
|
|
18
|
+
if (!getConfig().token && !this.getSavedToken()) {
|
|
18
19
|
this.initializeReadline();
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -46,7 +47,7 @@ export class MindedConnection {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
private async getMindedToken(): Promise<string> {
|
|
49
|
-
const envToken =
|
|
50
|
+
const envToken = getConfig().token;
|
|
50
51
|
if (envToken) {
|
|
51
52
|
this.saveToken(envToken);
|
|
52
53
|
return envToken;
|
|
@@ -110,7 +111,7 @@ export class MindedConnection {
|
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
private async connect(token: string) {
|
|
113
|
-
this.socket = io(
|
|
114
|
+
this.socket = io(getConfig().baseUrl, {
|
|
114
115
|
path: '/minded-connect',
|
|
115
116
|
query: {
|
|
116
117
|
token,
|
package/src/types/LLM.types.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { AzureChatOpenAI, ChatOpenAI } from '@langchain/openai';
|
|
2
|
+
import { MindedChatOpenAI } from '../platform/mindedChatOpenAI';
|
|
2
3
|
|
|
3
4
|
export type LLMConfig = {
|
|
4
5
|
name: string,
|
|
5
6
|
properties: Record<string, any>
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
export type LLMProvider = 'ChatOpenAI' | 'AzureChatOpenAI';
|
|
9
|
+
export type LLMProvider = 'ChatOpenAI' | 'AzureChatOpenAI' | 'MindedChatOpenAI';
|
|
9
10
|
|
|
10
|
-
export const LLMProviders = {
|
|
11
|
+
export const LLMProviders: Record<LLMProvider, any> = {
|
|
11
12
|
ChatOpenAI: ChatOpenAI,
|
|
12
13
|
AzureChatOpenAI: AzureChatOpenAI,
|
|
14
|
+
MindedChatOpenAI,
|
|
13
15
|
}
|
|
@@ -19,10 +19,6 @@ export const stateAnnotation = Annotation.Root({
|
|
|
19
19
|
name: string;
|
|
20
20
|
triggerBody: any;
|
|
21
21
|
} | null>,
|
|
22
|
-
interruptedNode: Annotation<string | null>({
|
|
23
|
-
default: () => null,
|
|
24
|
-
reducer: (a, b) => b,
|
|
25
|
-
}),
|
|
26
22
|
history: Annotation<Array<FlowHistory>>({
|
|
27
23
|
default: () => [],
|
|
28
24
|
reducer: (a, b) => a.concat(b),
|
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
result: z.string().optional(),
|
|
10
|
+
userAge: z.number().optional(),
|
|
11
|
+
userName: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const createTestAgent = (flowsPath: string) => {
|
|
15
|
+
const toolsPath = path.join(__dirname, 'tools');
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
memorySchema,
|
|
18
|
+
config: {
|
|
19
|
+
flows: [flowsPath],
|
|
20
|
+
tools: [toolsPath],
|
|
21
|
+
llm: {
|
|
22
|
+
name: 'ChatOpenAI',
|
|
23
|
+
properties: {
|
|
24
|
+
model: 'gpt-4.1',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
tools: [
|
|
29
|
+
{
|
|
30
|
+
name: 'stepForwardTool',
|
|
31
|
+
description: 'Step Forward Tool',
|
|
32
|
+
input: z.object({
|
|
33
|
+
message: z.string(),
|
|
34
|
+
}),
|
|
35
|
+
execute: async () => ({
|
|
36
|
+
memory: { result: 'stepForward' },
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'logicalTool',
|
|
41
|
+
description: 'Logical Tool',
|
|
42
|
+
input: z.object({
|
|
43
|
+
message: z.string(),
|
|
44
|
+
}),
|
|
45
|
+
execute: async () => ({
|
|
46
|
+
memory: { result: 'logical' },
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'promptTool',
|
|
51
|
+
description: 'Prompt Tool',
|
|
52
|
+
input: z.object({
|
|
53
|
+
message: z.string(),
|
|
54
|
+
}),
|
|
55
|
+
execute: async () => ({
|
|
56
|
+
memory: { result: 'prompt' },
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Add trigger event handler
|
|
63
|
+
agent.on(AgentEvents.TRIGGER_EVENT, async ({ triggerName, triggerBody }) => {
|
|
64
|
+
if (triggerName === 'TestTrigger') {
|
|
65
|
+
return {
|
|
66
|
+
memory: triggerBody.memory || {},
|
|
67
|
+
messages: [new HumanMessage(triggerBody.message)],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
return agent;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
describe('Edge Priority Logic', () => {
|
|
76
|
+
describe('All 3 Edge Types (Step Forward > Logical > Prompt)', () => {
|
|
77
|
+
let agent: Agent;
|
|
78
|
+
|
|
79
|
+
beforeEach(() => {
|
|
80
|
+
const flowsPath = path.join(__dirname, 'flows/all-three-edges');
|
|
81
|
+
agent = createTestAgent(flowsPath);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('should prioritize step forward over logical and prompt', async function () {
|
|
85
|
+
this.timeout(20000);
|
|
86
|
+
|
|
87
|
+
const result = await agent.invoke({
|
|
88
|
+
triggerBody: {
|
|
89
|
+
message: 'Test message',
|
|
90
|
+
memory: { userAge: 25, userName: 'Test' }, // Satisfies logical condition
|
|
91
|
+
},
|
|
92
|
+
triggerName: 'TestTrigger',
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Step forward should win regardless of other conditions
|
|
96
|
+
expect(result.memory.result).to.equal('stepForward');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('Logical + Prompt Edges (Logical > Prompt)', () => {
|
|
101
|
+
let agent: Agent;
|
|
102
|
+
|
|
103
|
+
beforeEach(() => {
|
|
104
|
+
const flowsPath = path.join(__dirname, 'flows/logical-prompt-edges');
|
|
105
|
+
agent = createTestAgent(flowsPath);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should prioritize logical over prompt when logical condition is met', async function () {
|
|
109
|
+
this.timeout(20000);
|
|
110
|
+
|
|
111
|
+
const result = await agent.invoke({
|
|
112
|
+
triggerBody: {
|
|
113
|
+
message: 'Test message',
|
|
114
|
+
memory: { userAge: 25 }, // Satisfies logical condition (age >= 18)
|
|
115
|
+
},
|
|
116
|
+
triggerName: 'TestTrigger',
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
expect(result.memory.result).to.equal('logical');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should fall back to prompt when logical condition is not met', async function () {
|
|
123
|
+
this.timeout(20000);
|
|
124
|
+
|
|
125
|
+
const result = await agent.invoke({
|
|
126
|
+
triggerBody: {
|
|
127
|
+
message: 'Test message',
|
|
128
|
+
memory: { userAge: 15 }, // Does not satisfy logical condition (age < 18)
|
|
129
|
+
},
|
|
130
|
+
triggerName: 'TestTrigger',
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
expect(result.memory.result).to.equal('prompt');
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('Step Forward + Prompt Edges (Step Forward > Prompt)', () => {
|
|
138
|
+
let agent: Agent;
|
|
139
|
+
|
|
140
|
+
beforeEach(() => {
|
|
141
|
+
const flowsPath = path.join(__dirname, 'flows/stepforward-prompt-edges');
|
|
142
|
+
agent = createTestAgent(flowsPath);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('should prioritize step forward over prompt', async function () {
|
|
146
|
+
this.timeout(20000);
|
|
147
|
+
|
|
148
|
+
const result = await agent.invoke({
|
|
149
|
+
triggerBody: {
|
|
150
|
+
message: 'Test message',
|
|
151
|
+
memory: { userName: 'TestUser' }, // Would satisfy prompt condition
|
|
152
|
+
},
|
|
153
|
+
triggerName: 'TestTrigger',
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
expect(result.memory.result).to.equal('stepForward');
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
describe('Step Forward + Logical Edges (Step Forward > Logical)', () => {
|
|
161
|
+
let agent: Agent;
|
|
162
|
+
|
|
163
|
+
beforeEach(() => {
|
|
164
|
+
const flowsPath = path.join(__dirname, 'flows/stepforward-logical-edges');
|
|
165
|
+
agent = createTestAgent(flowsPath);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('should prioritize step forward over logical', async function () {
|
|
169
|
+
this.timeout(20000);
|
|
170
|
+
|
|
171
|
+
const result = await agent.invoke({
|
|
172
|
+
triggerBody: {
|
|
173
|
+
message: 'Test message',
|
|
174
|
+
memory: { userAge: 25 }, // Would satisfy logical condition
|
|
175
|
+
},
|
|
176
|
+
triggerName: 'TestTrigger',
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
expect(result.memory.result).to.equal('stepForward');
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: All Three Edges Priority Test
|
|
2
|
+
nodes:
|
|
3
|
+
- type: 'trigger'
|
|
4
|
+
triggerType: 'manual'
|
|
5
|
+
name: 'TestTrigger'
|
|
6
|
+
|
|
7
|
+
- type: 'tool'
|
|
8
|
+
name: 'Step Forward Tool'
|
|
9
|
+
toolName: 'stepForwardTool'
|
|
10
|
+
|
|
11
|
+
- type: 'tool'
|
|
12
|
+
name: 'Logical Tool'
|
|
13
|
+
toolName: 'logicalTool'
|
|
14
|
+
|
|
15
|
+
- type: 'tool'
|
|
16
|
+
name: 'Prompt Tool'
|
|
17
|
+
toolName: 'promptTool'
|
|
18
|
+
|
|
19
|
+
edges:
|
|
20
|
+
# Prompt condition edge (Priority 3)
|
|
21
|
+
- source: 'TestTrigger'
|
|
22
|
+
target: 'Prompt Tool'
|
|
23
|
+
type: 'promptCondition'
|
|
24
|
+
prompt: 'User wants to use prompt tool'
|
|
25
|
+
|
|
26
|
+
# Step forward edge (Priority 1 - should win)
|
|
27
|
+
- source: 'TestTrigger'
|
|
28
|
+
target: 'Step Forward Tool'
|
|
29
|
+
type: 'stepForward'
|
|
30
|
+
|
|
31
|
+
# Logical condition edge (Priority 2)
|
|
32
|
+
- source: 'TestTrigger'
|
|
33
|
+
target: 'Logical Tool'
|
|
34
|
+
type: 'logicalCondition'
|
|
35
|
+
condition: '({ memory }) => memory.userAge >= 18'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Logical + Prompt Edges Priority Test
|
|
2
|
+
nodes:
|
|
3
|
+
- type: 'trigger'
|
|
4
|
+
triggerType: 'manual'
|
|
5
|
+
name: 'TestTrigger'
|
|
6
|
+
|
|
7
|
+
- type: 'tool'
|
|
8
|
+
name: 'Logical Tool'
|
|
9
|
+
toolName: 'logicalTool'
|
|
10
|
+
|
|
11
|
+
- type: 'tool'
|
|
12
|
+
name: 'Prompt Tool'
|
|
13
|
+
toolName: 'promptTool'
|
|
14
|
+
|
|
15
|
+
edges:
|
|
16
|
+
# Prompt condition edge (Priority 3 - fallback when logical fails)
|
|
17
|
+
- source: 'TestTrigger'
|
|
18
|
+
target: 'Prompt Tool'
|
|
19
|
+
type: 'promptCondition'
|
|
20
|
+
prompt: 'User wants to use prompt tool'
|
|
21
|
+
|
|
22
|
+
# Logical condition edge (Priority 2 - should win when condition met)
|
|
23
|
+
- source: 'TestTrigger'
|
|
24
|
+
target: 'Logical Tool'
|
|
25
|
+
type: 'logicalCondition'
|
|
26
|
+
condition: '({ memory }) => memory.userAge >= 18'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Step Forward + Logical Edges Priority Test
|
|
2
|
+
nodes:
|
|
3
|
+
- type: 'trigger'
|
|
4
|
+
triggerType: 'manual'
|
|
5
|
+
name: 'TestTrigger'
|
|
6
|
+
|
|
7
|
+
- type: 'tool'
|
|
8
|
+
name: 'Step Forward Tool'
|
|
9
|
+
toolName: 'stepForwardTool'
|
|
10
|
+
|
|
11
|
+
- type: 'tool'
|
|
12
|
+
name: 'Logical Tool'
|
|
13
|
+
toolName: 'logicalTool'
|
|
14
|
+
|
|
15
|
+
edges:
|
|
16
|
+
# Logical condition edge (Priority 2)
|
|
17
|
+
- source: 'TestTrigger'
|
|
18
|
+
target: 'Logical Tool'
|
|
19
|
+
type: 'logicalCondition'
|
|
20
|
+
condition: '({ memory }) => memory.userAge >= 18'
|
|
21
|
+
|
|
22
|
+
# Step forward edge (Priority 1 - should win)
|
|
23
|
+
- source: 'TestTrigger'
|
|
24
|
+
target: 'Step Forward Tool'
|
|
25
|
+
type: 'stepForward'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Step Forward + Prompt Edges Priority Test
|
|
2
|
+
nodes:
|
|
3
|
+
- type: 'trigger'
|
|
4
|
+
triggerType: 'manual'
|
|
5
|
+
name: 'TestTrigger'
|
|
6
|
+
|
|
7
|
+
- type: 'tool'
|
|
8
|
+
name: 'Step Forward Tool'
|
|
9
|
+
toolName: 'stepForwardTool'
|
|
10
|
+
|
|
11
|
+
- type: 'tool'
|
|
12
|
+
name: 'Prompt Tool'
|
|
13
|
+
toolName: 'promptTool'
|
|
14
|
+
|
|
15
|
+
edges:
|
|
16
|
+
# Prompt condition edge (Priority 3)
|
|
17
|
+
- source: 'TestTrigger'
|
|
18
|
+
target: 'Prompt Tool'
|
|
19
|
+
type: 'promptCondition'
|
|
20
|
+
prompt: 'User wants to use prompt tool'
|
|
21
|
+
|
|
22
|
+
# Step forward edge (Priority 1 - should win)
|
|
23
|
+
- source: 'TestTrigger'
|
|
24
|
+
target: 'Step Forward Tool'
|
|
25
|
+
type: 'stepForward'
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { Tool } from '../types/Tools.types';
|
|
3
|
-
declare const memorySchema: z.ZodObject<{
|
|
4
|
-
appName: z.ZodString;
|
|
5
|
-
actionName: z.ZodString;
|
|
6
|
-
actionOutput: z.ZodAny;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
appName: string;
|
|
9
|
-
actionName: string;
|
|
10
|
-
actionOutput?: any;
|
|
11
|
-
}, {
|
|
12
|
-
appName: string;
|
|
13
|
-
actionName: string;
|
|
14
|
-
actionOutput?: any;
|
|
15
|
-
}>;
|
|
16
|
-
export type AppActionRunnerMemory = z.infer<typeof memorySchema>;
|
|
17
|
-
declare const schema: z.ZodObject<{
|
|
18
|
-
actionInput: z.ZodString;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
actionInput: string;
|
|
21
|
-
}, {
|
|
22
|
-
actionInput: string;
|
|
23
|
-
}>;
|
|
24
|
-
declare const appActionRunnerToolCreator: Tool<typeof schema, AppActionRunnerMemory>;
|
|
25
|
-
export default appActionRunnerToolCreator;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const zod_1 = require("zod");
|
|
4
|
-
const memorySchema = zod_1.z.object({
|
|
5
|
-
appName: zod_1.z.string(),
|
|
6
|
-
actionName: zod_1.z.string(),
|
|
7
|
-
actionOutput: zod_1.z.any(), // TODO: output schema from pipedream actions output ?
|
|
8
|
-
});
|
|
9
|
-
const schema = zod_1.z.object({
|
|
10
|
-
actionInput: zod_1.z.string(), // TODO: input schema from pipedream actions input - mandatory for the model to call with the correct input parameters
|
|
11
|
-
});
|
|
12
|
-
const appActionRunnerToolCreator = {
|
|
13
|
-
name: 'appActionRunnerTool',
|
|
14
|
-
description: 'App action runner tool',
|
|
15
|
-
input: schema,
|
|
16
|
-
execute: async ({ input }) => {
|
|
17
|
-
console.log('*Action: App action runner*');
|
|
18
|
-
console.log('input', input);
|
|
19
|
-
const appActionRunnerInput = input;
|
|
20
|
-
return {
|
|
21
|
-
memory: {
|
|
22
|
-
appName: appActionRunnerInput.appName,
|
|
23
|
-
actionName: appActionRunnerInput.actionName,
|
|
24
|
-
actionOutput: input.actionInput,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
exports.default = appActionRunnerToolCreator;
|
|
30
|
-
//# sourceMappingURL=appActionRunnerTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appActionRunnerTool.js","sourceRoot":"","sources":["../../src/internalTools/appActionRunnerTool.ts"],"names":[],"mappings":";;AAAA,6BAAwB;AAExB,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,YAAY,EAAE,OAAC,CAAC,GAAG,EAAE,EAAE,sDAAsD;CAChF,CAAC,CAAC;AAGH,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,sHAAsH;CAClJ,CAAC,CAAC;AAEH,MAAM,0BAA0B,GAA+C;IAC3E,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,wBAAwB;IACrC,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5B,MAAM,oBAAoB,GAAG,KAA6B,CAAC;QAC3D,OAAO;YACH,MAAM,EAAE;gBACJ,OAAO,EAAE,oBAAoB,CAAC,OAAO;gBACrC,UAAU,EAAE,oBAAoB,CAAC,UAAU;gBAC3C,YAAY,EAAE,KAAK,CAAC,WAAW;aAClC;SACJ,CAAC;IACN,CAAC;CACJ,CAAC;AAEF,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) => (state: typeof stateAnnotation.State) => Promise<{
|
|
7
|
-
memory: Partial<Memory>;
|
|
8
|
-
messages: (BaseMessage | ToolMessage)[];
|
|
9
|
-
triggerInvocations: import("..").TriggerInvocationHistory[];
|
|
10
|
-
}>;
|
|
11
|
-
export default actionRunnerTool;
|
|
@@ -1,83 +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) => {
|
|
10
|
-
return async (state) => {
|
|
11
|
-
try {
|
|
12
|
-
console.log(`Executing tool node ${toolNode.name}`);
|
|
13
|
-
const executeWrapper = async (input) => {
|
|
14
|
-
try {
|
|
15
|
-
if (toolNode.type === Flows_types_1.NodeType.APP_TOOL) {
|
|
16
|
-
input.appName = toolNode.appName;
|
|
17
|
-
input.actionName = toolNode.actionName;
|
|
18
|
-
}
|
|
19
|
-
const response = await matchedTool.execute({ input, memory: state.memory, triggerInvocations: state.triggerInvocations });
|
|
20
|
-
return response || {};
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
console.error('Error executing tool', error);
|
|
24
|
-
throw error;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const tool = (0, tools_1.tool)(executeWrapper, {
|
|
28
|
-
name: matchedTool.name,
|
|
29
|
-
description: matchedTool.description,
|
|
30
|
-
schema: matchedTool.input,
|
|
31
|
-
});
|
|
32
|
-
const prompt = `
|
|
33
|
-
Context:
|
|
34
|
-
messages: ${JSON.stringify(state.messages)}
|
|
35
|
-
workflow memory: ${JSON.stringify(state.memory)}
|
|
36
|
-
Instructions:
|
|
37
|
-
Call immediately tool ${tool.name}(...)
|
|
38
|
-
${toolNode.prompt && `Tool execution instructions: ${toolNode.prompt}`}
|
|
39
|
-
`;
|
|
40
|
-
const toolCallingAgent = (0, prebuilt_1.createReactAgent)({
|
|
41
|
-
checkpointer: new langgraph_1.MemorySaver(),
|
|
42
|
-
llm,
|
|
43
|
-
tools: [tool],
|
|
44
|
-
});
|
|
45
|
-
const response = await toolCallingAgent.invoke({ messages: [new messages_1.SystemMessage(prompt)] }, { configurable: { thread_id: (0, uuid_1.v4)() } });
|
|
46
|
-
const toolCallMessage = getLastToolCallMessage(response.messages);
|
|
47
|
-
const toolResponseMessage = getLastToolMessage(response.messages);
|
|
48
|
-
if (!toolCallMessage || !toolResponseMessage) {
|
|
49
|
-
throw new Error('Tool call or tool response message not found');
|
|
50
|
-
}
|
|
51
|
-
const toolMemory = extractToolMemoryResponse(toolResponseMessage);
|
|
52
|
-
return { memory: toolMemory, messages: [toolCallMessage, toolResponseMessage], triggerInvocations: state.triggerInvocations };
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
console.error('Error executing tool node', error);
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
exports.default = actionRunnerTool;
|
|
61
|
-
const getLastToolCallMessage = (messages) => {
|
|
62
|
-
const toolCallMessages = messages.filter((message) => { var _a; return ((_a = message.tool_calls) === null || _a === void 0 ? void 0 : _a.length) || 0 > 0; });
|
|
63
|
-
const lastToolCallMessage = toolCallMessages[toolCallMessages.length - 1];
|
|
64
|
-
return lastToolCallMessage;
|
|
65
|
-
};
|
|
66
|
-
const getLastToolMessage = (messages) => {
|
|
67
|
-
const toolMessages = messages.filter((message) => message.getType() === 'tool');
|
|
68
|
-
const lastToolMessage = toolMessages[toolMessages.length - 1];
|
|
69
|
-
return lastToolMessage;
|
|
70
|
-
};
|
|
71
|
-
const extractToolMemoryResponse = (toolMessage) => {
|
|
72
|
-
try {
|
|
73
|
-
const parsed = JSON.parse(toolMessage.content);
|
|
74
|
-
if (typeof parsed === 'object' && parsed !== null && 'memory' in parsed) {
|
|
75
|
-
return parsed.memory;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
console.error('Error parsing tool memory response', error);
|
|
80
|
-
}
|
|
81
|
-
return {};
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=actionRunnerTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actionRunnerTool.js","sourceRoot":"","sources":["../../src/nodes/actionRunnerTool.ts"],"names":[],"mappings":"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"}
|
|
@@ -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;
|
package/dist/nodes/addAppTool.js
DELETED
|
@@ -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"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseLanguageModel } from "@langchain/core/language_models/base";
|
|
2
|
-
import { AppToolNode } from "../types/Flows.types";
|
|
3
|
-
import { PreCompiledGraph } from "../types/LangGraph.types";
|
|
4
|
-
export declare const addAppToolNode: ({ graph, node, llm, }: {
|
|
5
|
-
graph: PreCompiledGraph;
|
|
6
|
-
node: AppToolNode;
|
|
7
|
-
llm: BaseLanguageModel;
|
|
8
|
-
}) => void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addAppToolNode = void 0;
|
|
7
|
-
const appActionRunnerTool_1 = __importDefault(require("../internalTools/appActionRunnerTool"));
|
|
8
|
-
const actionRunnerTool_1 = __importDefault(require("./actionRunnerTool"));
|
|
9
|
-
const addAppToolNode = ({ graph, node, llm, }) => {
|
|
10
|
-
const callback = (0, actionRunnerTool_1.default)(appActionRunnerTool_1.default, node, llm);
|
|
11
|
-
graph.addNode(node.name, callback);
|
|
12
|
-
};
|
|
13
|
-
exports.addAppToolNode = addAppToolNode;
|
|
14
|
-
//# sourceMappingURL=addAppToolNode.js.map
|