@minded-ai/mindedjs 1.0.91 → 1.0.93
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/README.md +1 -1
- package/dist/agent.d.ts +3 -9
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +46 -74
- package/dist/agent.js.map +1 -1
- package/dist/checkpointer/checkpointSaverFactory.d.ts +1 -3
- package/dist/checkpointer/checkpointSaverFactory.d.ts.map +1 -1
- package/dist/checkpointer/checkpointSaverFactory.js +38 -5
- package/dist/checkpointer/checkpointSaverFactory.js.map +1 -1
- package/dist/events/AgentEvents.d.ts +1 -8
- package/dist/events/AgentEvents.d.ts.map +1 -1
- package/dist/events/AgentEvents.js +0 -1
- package/dist/events/AgentEvents.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/zendesk.d.ts.map +1 -1
- package/dist/interfaces/zendesk.js +70 -48
- package/dist/interfaces/zendesk.js.map +1 -1
- package/dist/internalTools/appActionRunnerTool.d.ts +1 -2
- package/dist/internalTools/appActionRunnerTool.d.ts.map +1 -1
- package/dist/internalTools/appActionRunnerTool.js +36 -2
- package/dist/internalTools/appActionRunnerTool.js.map +1 -1
- package/dist/internalTools/sendPlaceholderMessage.d.ts +14 -0
- package/dist/internalTools/sendPlaceholderMessage.d.ts.map +1 -0
- package/dist/internalTools/sendPlaceholderMessage.js +61 -0
- package/dist/internalTools/sendPlaceholderMessage.js.map +1 -0
- package/dist/internalTools/timer.d.ts +93 -0
- package/dist/internalTools/timer.d.ts.map +1 -0
- package/dist/internalTools/timer.js +152 -0
- package/dist/internalTools/timer.js.map +1 -0
- package/dist/nodes/addAppToolNode.d.ts.map +1 -1
- package/dist/nodes/addAppToolNode.js +2 -2
- package/dist/nodes/addAppToolNode.js.map +1 -1
- package/dist/nodes/addJumpToNode.d.ts.map +1 -1
- package/dist/nodes/addJumpToNode.js +2 -2
- package/dist/nodes/addJumpToNode.js.map +1 -1
- package/dist/nodes/addJunctionNode.d.ts +7 -0
- package/dist/nodes/addJunctionNode.d.ts.map +1 -0
- package/dist/nodes/addJunctionNode.js +20 -0
- package/dist/nodes/addJunctionNode.js.map +1 -0
- package/dist/nodes/addPromptNode.d.ts.map +1 -1
- package/dist/nodes/addPromptNode.js +2 -2
- package/dist/nodes/addPromptNode.js.map +1 -1
- package/dist/nodes/addToolNode.d.ts.map +1 -1
- package/dist/nodes/addToolNode.js +2 -2
- package/dist/nodes/addToolNode.js.map +1 -1
- package/dist/nodes/addToolRunNode.d.ts.map +1 -1
- package/dist/nodes/addToolRunNode.js +1 -2
- package/dist/nodes/addToolRunNode.js.map +1 -1
- package/dist/nodes/addTriggerNode.d.ts.map +1 -1
- package/dist/nodes/addTriggerNode.js +1 -2
- package/dist/nodes/addTriggerNode.js.map +1 -1
- package/dist/nodes/nodeFactory.d.ts.map +1 -1
- package/dist/nodes/nodeFactory.js +2 -5
- package/dist/nodes/nodeFactory.js.map +1 -1
- package/dist/platform/mindedCheckpointSaver.d.ts +1 -3
- package/dist/platform/mindedCheckpointSaver.d.ts.map +1 -1
- package/dist/platform/mindedCheckpointSaver.js +43 -10
- package/dist/platform/mindedCheckpointSaver.js.map +1 -1
- package/dist/platform/mindedConnection.d.ts +14 -14
- package/dist/platform/mindedConnection.d.ts.map +1 -1
- package/dist/platform/mindedConnection.js +152 -131
- package/dist/platform/mindedConnection.js.map +1 -1
- package/dist/platform/mindedConnectionTypes.d.ts +38 -38
- package/dist/platform/mindedConnectionTypes.js +24 -24
- package/dist/platform/piiGateway/gateway.d.ts +1 -3
- package/dist/platform/piiGateway/gateway.d.ts.map +1 -1
- package/dist/platform/piiGateway/gateway.js +39 -6
- package/dist/platform/piiGateway/gateway.js.map +1 -1
- package/dist/playbooks/playbooks.d.ts +1 -2
- package/dist/playbooks/playbooks.d.ts.map +1 -1
- package/dist/playbooks/playbooks.js +4 -3
- package/dist/playbooks/playbooks.js.map +1 -1
- package/dist/types/Agent.types.d.ts +9 -13
- package/dist/types/Agent.types.d.ts.map +1 -1
- package/dist/types/Agent.types.js +1 -10
- package/dist/types/Agent.types.js.map +1 -1
- package/dist/voice/voiceSession.d.ts.map +1 -1
- package/dist/voice/voiceSession.js +39 -5
- package/dist/voice/voiceSession.js.map +1 -1
- package/docs/SUMMARY.md +4 -0
- package/docs/tooling/timers.md +61 -0
- package/package.json +2 -3
- package/src/agent.ts +60 -91
- package/src/checkpointer/checkpointSaverFactory.ts +5 -6
- package/src/events/AgentEvents.ts +1 -8
- package/src/index.ts +3 -2
- package/src/interfaces/zendesk.ts +38 -37
- package/src/internalTools/appActionRunnerTool.ts +4 -4
- package/src/internalTools/sendPlaceholderMessage.ts +27 -0
- package/src/internalTools/timer.ts +137 -0
- package/src/nodes/addAppToolNode.ts +3 -3
- package/src/nodes/addJumpToNode.ts +3 -3
- package/src/nodes/addJunctionNode.ts +19 -0
- package/src/nodes/addPromptNode.ts +3 -3
- package/src/nodes/addToolNode.ts +2 -3
- package/src/nodes/addToolRunNode.ts +2 -3
- package/src/nodes/addTriggerNode.ts +3 -3
- package/src/nodes/nodeFactory.ts +2 -7
- package/src/platform/mindedCheckpointSaver.ts +27 -27
- package/src/platform/mindedConnection.ts +176 -147
- package/src/platform/mindedConnectionTypes.ts +38 -38
- package/src/platform/piiGateway/gateway.ts +8 -10
- package/src/playbooks/playbooks.ts +5 -5
- package/src/types/Agent.types.ts +10 -15
- package/src/voice/voiceSession.ts +6 -5
- package/docs-structure.md +0 -141
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.timerHandlers = void 0;
|
|
37
|
+
exports.resetTimer = resetTimer;
|
|
38
|
+
exports.cancelTimer = cancelTimer;
|
|
39
|
+
exports.onTimer = onTimer;
|
|
40
|
+
const mindedConnection = __importStar(require("../platform/mindedConnection"));
|
|
41
|
+
const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
|
|
42
|
+
// Store timer handlers by timer name
|
|
43
|
+
exports.timerHandlers = new Map();
|
|
44
|
+
/**
|
|
45
|
+
* Reset or set a timer for a specific session.
|
|
46
|
+
* When the timer expires, all registered timer handlers will be called.
|
|
47
|
+
*
|
|
48
|
+
* @param params - The timer configuration
|
|
49
|
+
* @param params.sessionId - The session ID to associate the timer with
|
|
50
|
+
* @param params.seconds - Number of seconds until the timer expires
|
|
51
|
+
* @param params.timerName - Unique name for this timer (used for cancellation and identification)
|
|
52
|
+
* @param params.eventArgs - Additional data to pass to the timer handler when it triggers
|
|
53
|
+
* @returns Promise resolving to timer reset response
|
|
54
|
+
* @throws {Error} When the Minded connection is not established
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* import { resetTimer } from '@minded-ai/mindedjs';
|
|
59
|
+
*
|
|
60
|
+
* // Set a timer to follow up in 10 seconds
|
|
61
|
+
* await resetTimer({
|
|
62
|
+
* sessionId: 'session-123',
|
|
63
|
+
* seconds: 10,
|
|
64
|
+
* timerName: 'followup',
|
|
65
|
+
* payload: {
|
|
66
|
+
* message: 'Are you still there?'
|
|
67
|
+
* }
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
async function resetTimer({ sessionId, seconds, timerName, payload = {} }) {
|
|
72
|
+
return await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.TIMER_RESET, {
|
|
73
|
+
sessionId,
|
|
74
|
+
seconds,
|
|
75
|
+
timerName,
|
|
76
|
+
eventArgs: payload,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Cancel an existing timer for a specific session.
|
|
81
|
+
*
|
|
82
|
+
* @param sessionId - The session ID the timer is associated with
|
|
83
|
+
* @param timerName - The name of the timer to cancel
|
|
84
|
+
* @returns Promise resolving to timer cancel response
|
|
85
|
+
* @throws {Error} When the Minded connection is not established
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* import { cancelTimer } from '@minded-ai/mindedjs';
|
|
90
|
+
*
|
|
91
|
+
* // Cancel a previously set timer
|
|
92
|
+
* await cancelTimer('session-123', 'followup');
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
async function cancelTimer(sessionId, timerName) {
|
|
96
|
+
if (!mindedConnection.isConnected()) {
|
|
97
|
+
throw new Error('Minded connection is not established when trying to cancel timer');
|
|
98
|
+
}
|
|
99
|
+
return await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.TIMER_CANCEL, {
|
|
100
|
+
sessionId,
|
|
101
|
+
timerName,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Register a handler for timer trigger events for a specific timer name.
|
|
106
|
+
* The handler will be called when the specified timer expires for any session.
|
|
107
|
+
*
|
|
108
|
+
* @param params - The configuration for the timer handler
|
|
109
|
+
* @param params.timerName - The name of the timer to handle
|
|
110
|
+
* @param params.handler - Function to call when the timer triggers
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* import { onTimer } from '@minded-ai/mindedjs';
|
|
115
|
+
*
|
|
116
|
+
* // Register a handler for the 'followup' timer
|
|
117
|
+
* onTimer({
|
|
118
|
+
* timerName: 'followup',
|
|
119
|
+
* handler: async ({ sessionId, payload }) => {
|
|
120
|
+
* console.log(`Followup timer triggered for session ${sessionId}`);
|
|
121
|
+
*
|
|
122
|
+
* // Handle the followup timer
|
|
123
|
+
* await agent.invoke({
|
|
124
|
+
* triggerName: 'timerFollowup',
|
|
125
|
+
* triggerBody: { message: payload.message },
|
|
126
|
+
* sessionId
|
|
127
|
+
* });
|
|
128
|
+
* }
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
function onTimer({ timerName, handler }) {
|
|
133
|
+
// Initialize handlers array for this timer name if it doesn't exist
|
|
134
|
+
if (!exports.timerHandlers.has(timerName)) {
|
|
135
|
+
exports.timerHandlers.set(timerName, []);
|
|
136
|
+
}
|
|
137
|
+
// Add the handler to the array for this timer name
|
|
138
|
+
const handlers = exports.timerHandlers.get(timerName);
|
|
139
|
+
handlers.push({ handler });
|
|
140
|
+
}
|
|
141
|
+
mindedConnection.on(mindedConnectionTypes_1.mindedConnectionSocketMessageType.TIMER_TRIGGER, async (timerTriggerMessage) => {
|
|
142
|
+
// Get handlers for the specific timer name
|
|
143
|
+
const handlers = exports.timerHandlers.get(timerTriggerMessage.timerName) || [];
|
|
144
|
+
// Call all handlers registered for this timer name
|
|
145
|
+
for (const { handler } of handlers) {
|
|
146
|
+
await handler({
|
|
147
|
+
sessionId: timerTriggerMessage.sessionId,
|
|
148
|
+
payload: timerTriggerMessage.eventArgs,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=timer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../src/internalTools/timer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,gCAiBC;AAkBD,kCAQC;AA8BD,0BAeC;AA3HD,+EAAiE;AACjE,6EAA+H;AAE/H,qCAAqC;AACxB,QAAA,aAAa,GAAG,IAAI,GAAG,EAE/B,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,UAAU,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,GAAG,EAAE,EAMb;IACC,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,yDAAiC,CAAC,WAAW,EAAE;QACrF,SAAS;QACT,OAAO;QACP,SAAS;QACT,SAAS,EAAE,OAAO;KACnB,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,WAAW,CAAC,SAAiB,EAAE,SAAiB;IACpE,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,yDAAiC,CAAC,YAAY,EAAE;QACtF,SAAS;QACT,SAAS;KACV,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,OAAO,CAAC,EACtB,SAAS,EACT,OAAO,EAIR;IACC,oEAAoE;IACpE,IAAI,CAAC,qBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,qBAAa,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,mDAAmD;IACnD,MAAM,QAAQ,GAAG,qBAAa,CAAC,GAAG,CAAC,SAAS,CAAE,CAAC;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,gBAAgB,CAAC,EAAE,CAAC,yDAAiC,CAAC,aAAa,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE;IACjG,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,qBAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAExE,mDAAmD;IACnD,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,QAAQ,EAAE,CAAC;QACnC,MAAM,OAAO,CAAC;YACZ,SAAS,EAAE,mBAAmB,CAAC,SAAS;YACxC,OAAO,EAAE,mBAAmB,CAAC,SAAS;SACvC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAppToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"addAppToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAY,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAI7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,eAAO,MAAM,cAAc,GAAU,8BAKlC;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,KAAK,EAAE,KAAK,CAAC;CACd,kBAsEA,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAppToolNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
4
5
|
const tools_1 = require("@langchain/core/tools");
|
|
5
6
|
const messages_1 = require("@langchain/core/messages");
|
|
6
7
|
const appActionRunnerTool_1 = require("../internalTools/appActionRunnerTool");
|
|
7
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
8
8
|
const logger_1 = require("../utils/logger");
|
|
9
9
|
const playbooks_1 = require("../playbooks/playbooks");
|
|
10
10
|
const history_1 = require("../utils/history");
|
|
@@ -67,7 +67,7 @@ const addAppToolNode = async ({ graph, node, llm, agent, }) => {
|
|
|
67
67
|
return {
|
|
68
68
|
messages: [AIToolCallMessage, toolCallMessage],
|
|
69
69
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
70
|
-
type:
|
|
70
|
+
type: Flows_types_1.NodeType.APP_TOOL,
|
|
71
71
|
nodeId: node.name,
|
|
72
72
|
nodeDisplayName: node.displayName,
|
|
73
73
|
raw: AIToolCallMessage.tool_calls[0],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAppToolNode.js","sourceRoot":"","sources":["../../src/nodes/addAppToolNode.ts"],"names":[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AAO;YACL,QAAQ,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;YAC9C,OAAO,EAAE,IAAA,2BAAiB,EAAiC,KAAK,CAAC,OAAO,EAAE;gBACxE,IAAI,EAAE,sBAAQ,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAY;gBAClC,GAAG,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;gBACpC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,UAAU,EAAE,CAAC,iBAAiB,CAAC,EAAG,CAAC;aACpC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAhFW,QAAA,cAAc,kBAgFzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addJumpToNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"addJumpToNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AAK5D,eAAO,MAAM,aAAa,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,kBAgBjG,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addJumpToNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
4
5
|
const logger_1 = require("../utils/logger");
|
|
5
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
6
6
|
const history_1 = require("../utils/history");
|
|
7
7
|
const addJumpToNode = async ({ graph, node }) => {
|
|
8
8
|
const callback = async (state) => {
|
|
@@ -10,7 +10,7 @@ const addJumpToNode = async ({ graph, node }) => {
|
|
|
10
10
|
// No state modifications are necessary; control flow is handled via edges.
|
|
11
11
|
return {
|
|
12
12
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
13
|
-
type:
|
|
13
|
+
type: Flows_types_1.NodeType.JUMP_TO_NODE,
|
|
14
14
|
nodeId: node.name,
|
|
15
15
|
nodeDisplayName: node.displayName,
|
|
16
16
|
raw: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addJumpToNode.js","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"addJumpToNode.js","sourceRoot":"","sources":["../../src/nodes/addJumpToNode.ts"],"names":[],"mappings":";;;AAEA,sDAA4D;AAC5D,4CAAyC;AAEzC,8CAAqD;AAE9C,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAiD,EAAE,EAAE;IACpG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,WAAW,iBAAiB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACzF,2EAA2E;QAC3E,OAAO;YACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,YAAY;gBAC3B,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,EAAE;aACR,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACnC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAW,EAAE,IAAI,CAAC,YAAmB,CAAC,CAAC;AAC5D,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JunctionNode } from '../types/Flows.types';
|
|
2
|
+
import { PreCompiledGraph } from '../types/LangGraph.types';
|
|
3
|
+
export declare const addJunctionNode: ({ graph, node }: {
|
|
4
|
+
graph: PreCompiledGraph;
|
|
5
|
+
node: JunctionNode;
|
|
6
|
+
}) => void;
|
|
7
|
+
//# sourceMappingURL=addJunctionNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addJunctionNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addJunctionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAY,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAK7E,eAAO,MAAM,eAAe,GAAI,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,SAY/F,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addJunctionNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
5
|
+
const history_1 = require("../utils/history");
|
|
6
|
+
const addJunctionNode = ({ graph, node }) => {
|
|
7
|
+
const callback = async (state) => {
|
|
8
|
+
return {
|
|
9
|
+
history: (0, history_1.createHistoryStep)(state.history, {
|
|
10
|
+
type: Flows_types_1.NodeType.JUNCTION,
|
|
11
|
+
nodeId: node.name,
|
|
12
|
+
nodeDisplayName: node.displayName,
|
|
13
|
+
raw: '',
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
graph.addNode(node.name, callback);
|
|
18
|
+
};
|
|
19
|
+
exports.addJunctionNode = addJunctionNode;
|
|
20
|
+
//# sourceMappingURL=addJunctionNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addJunctionNode.js","sourceRoot":"","sources":["../../src/nodes/addJunctionNode.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAG9D,8CAAqD;AAG9C,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAmD,EAAE,EAAE;IAClG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,OAAO;YACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,EAAE;aACR,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"addPromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,yBAAyB,EAAe,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAe,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,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;IAC/D,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,0CAA0C,mBAAmB,kBA0FhG,CAAC"}
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.addPromptNode = void 0;
|
|
7
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
7
8
|
const messages_1 = require("@langchain/core/messages");
|
|
8
9
|
const tools_1 = require("@langchain/core/tools");
|
|
9
10
|
const AgentEvents_1 = require("../events/AgentEvents");
|
|
10
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
11
11
|
const createLlmInstance_1 = require("../llm/createLlmInstance");
|
|
12
12
|
const extractStateMemoryResponse_1 = __importDefault(require("../utils/extractStateMemoryResponse"));
|
|
13
13
|
const logger_1 = require("../utils/logger");
|
|
@@ -84,7 +84,7 @@ const addPromptNode = async ({ graph, node, llm, tools, emit, agent }) => {
|
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
86
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
87
|
-
type:
|
|
87
|
+
type: Flows_types_1.NodeType.PROMPT_NODE,
|
|
88
88
|
nodeId: node.name,
|
|
89
89
|
nodeDisplayName: node.displayName,
|
|
90
90
|
raw: result.content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPromptNode.js","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"addPromptNode.js","sourceRoot":"","sources":["../../src/nodes/addPromptNode.ts"],"names":[],"mappings":";;;;;;AACA,sDAA4D;AAI5D,uDAAiF;AAEjF,iDAA8D;AAC9D,uDAA+E;AAE/E,gEAA6D;AAC7D,qGAA2E;AAE3E,4CAAyC;AACzC,sDAA0D;AAC1D,8CAAqD;AAW9C,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAuB,EAAE,EAAE;IACnG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,qCAAiB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAE1E,MAAM,WAAW,GAAG,KAAK;aACtB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;aAC/B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAA,YAAa,EAAC,CAAC,KAAiC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1F,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB,CAAC,CACH,CAAC;QAEJ,gDAAgD;QAChD,MAAM,cAAc,GAAG;YAC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C,yBAAW,CAAC,UAAU,EAAE;gBACjC,OAAO,EAAE,MAAM,CAAC,OAAiB;gBACjC,KAAK;aACN,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,WAAW;gBAC1B,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,MAAM,CAAC,OAAO;gBACnB,UAAU,EAAE,CAAC,MAAM,CAAC,EAAG,CAAC;aACzB,CAAC;YACF,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AA1FW,QAAA,aAAa,iBA0FxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"addToolNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,eAAO,MAAM,WAAW,GAAU,qCAM/B;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,KAAK,EAAE,KAAK,CAAC;CACd,kBA6CA,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addToolNode = void 0;
|
|
4
|
+
const Flows_types_1 = require("../types/Flows.types");
|
|
4
5
|
const tools_1 = require("@langchain/core/tools");
|
|
5
6
|
const messages_1 = require("@langchain/core/messages");
|
|
6
7
|
const logger_1 = require("../utils/logger");
|
|
7
8
|
const playbooks_1 = require("../playbooks/playbooks");
|
|
8
9
|
const history_1 = require("../utils/history");
|
|
9
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
10
10
|
const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
|
|
11
11
|
const toolNode = node;
|
|
12
12
|
const matchedTool = tools.find((tool) => tool.name === toolNode.toolName);
|
|
@@ -41,7 +41,7 @@ const addToolNode = async ({ graph, node, tools, llm, agent, }) => {
|
|
|
41
41
|
return {
|
|
42
42
|
messages: [AIToolCallMessage],
|
|
43
43
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
44
|
-
type:
|
|
44
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
45
45
|
nodeId: node.name,
|
|
46
46
|
nodeDisplayName: node.displayName,
|
|
47
47
|
raw: ((_a = AIToolCallMessage.tool_calls) === null || _a === void 0 ? void 0 : _a[0]) || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolNode.js","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"addToolNode.js","sourceRoot":"","sources":["../../src/nodes/addToolNode.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAE1D,iDAA8D;AAE9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AI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;SAChD,CAAC;QACN,MAAM,iBAAiB,GAAc,MAAM,GAAG;aAC3C,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE;YACjB,WAAW,EAAE,IAAI,CAAC,IAAI;SACvB,CAAC;aACD,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,wBAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1D,OAAO;YACL,QAAQ,EAAE,CAAC,iBAAiB,CAAC;YAC7B,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;gBACrD,IAAI,EAAE,sBAAQ,CAAC,IAAI;gBACnB,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,GAAG,EAAE,CAAA,MAAA,iBAAiB,CAAC,UAAU,0CAAG,CAAC,CAAC,KAAI,EAAE;gBAC5C,UAAU,EAAE,CAAC,iBAAiB,CAAC,EAAG,CAAC;aACpC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAzDW,QAAA,WAAW,eAyDtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolRunNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"addToolRunNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAiC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK/E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,QAAQ,EAAE,QAAQ,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,WAAiD,CAAC;AAEvG,eAAO,MAAM,cAAc,GAAU,uDAAuD,oBAAoB,kBAgD/G,CAAC"}
|
|
@@ -9,7 +9,6 @@ const tools_1 = require("@langchain/core/tools");
|
|
|
9
9
|
const extractStateMemoryResponse_1 = __importDefault(require("../utils/extractStateMemoryResponse"));
|
|
10
10
|
const logger_1 = require("../utils/logger");
|
|
11
11
|
const history_1 = require("../utils/history");
|
|
12
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
13
12
|
const buildToolRunNodeName = (nodeName) => `${nodeName}${Flows_types_1.internalNodesSuffix.TOOL_RUN}`;
|
|
14
13
|
exports.buildToolRunNodeName = buildToolRunNodeName;
|
|
15
14
|
const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeName, agent }) => {
|
|
@@ -46,7 +45,7 @@ const addToolRunNode = async ({ graph, tools, toolNode, attachedToNodeName, agen
|
|
|
46
45
|
...toolStateUpdate,
|
|
47
46
|
messages: updatedMessages,
|
|
48
47
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
49
|
-
type:
|
|
48
|
+
type: Flows_types_1.NodeType.TOOL,
|
|
50
49
|
nodeId: toolNode.name,
|
|
51
50
|
nodeDisplayName: toolNode.displayName,
|
|
52
51
|
raw: toolCallMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAIA,
|
|
1
|
+
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAIA,sDAA+E;AAC/E,iDAA8D;AAG9D,qGAA2E;AAE3E,4CAAyC;AACzC,8CAAqD;AAY9C,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,QAAQ,GAAG,iCAAmB,CAAC,QAAQ,EAAE,CAAC;AAA1F,QAAA,oBAAoB,wBAAsE;AAEhG,MAAM,cAAc,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAwB,EAAE,EAAE;IAClH,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC1E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1D,CAAC;QAED,MAAM,cAAc,GAAG,KAAK,EAAE,KAAwC,EAAE,EAAE;YACxE,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;gBACpE,OAAO,QAAQ,IAAI,EAAE,CAAC;YACxB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A,4BAAoB,EAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC;IAClE,KAAK,CAAC,OAAO,CAAC,kBAAyB,EAAE,IAAA,4BAAoB,EAAC,kBAAkB,CAAQ,CAAC,CAAC;AAC5F,CAAC,CAAC;AAhDW,QAAA,cAAc,kBAgDzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAK7E,eAAO,MAAM,cAAc,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,kBAkBnG,CAAC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addTriggerNode = void 0;
|
|
4
4
|
const Flows_types_1 = require("../types/Flows.types");
|
|
5
5
|
const logger_1 = require("../utils/logger");
|
|
6
|
-
const Agent_types_1 = require("../types/Agent.types");
|
|
7
6
|
const history_1 = require("../utils/history");
|
|
8
7
|
const addTriggerNode = async ({ graph, node }) => {
|
|
9
8
|
const callback = async (state) => {
|
|
@@ -11,7 +10,7 @@ const addTriggerNode = async ({ graph, node }) => {
|
|
|
11
10
|
if (node.triggerType === Flows_types_1.TriggerType.MANUAL) {
|
|
12
11
|
return {
|
|
13
12
|
history: (0, history_1.createHistoryStep)(state.history, {
|
|
14
|
-
type:
|
|
13
|
+
type: Flows_types_1.NodeType.TRIGGER,
|
|
15
14
|
nodeId: node.name,
|
|
16
15
|
nodeDisplayName: node.displayName,
|
|
17
16
|
raw: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTriggerNode.js","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"addTriggerNode.js","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":";;;AACA,sDAA0E;AAE1E,4CAAyC;AAEzC,8CAAqD;AAE9C,MAAM,cAAc,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAkD,EAAE,EAAE;IACtG,MAAM,QAAQ,GAAiB,KAAK,EAAE,KAAmC,EAAE,EAAE;QAC3E,eAAM,CAAC,IAAI,CAAC,0BAA0B,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1D,IAAI,IAAI,CAAC,WAAW,KAAK,yBAAW,CAAC,MAAM,EAAE,CAAC;YAC5C,OAAO;gBACL,OAAO,EAAE,IAAA,2BAAiB,EAAc,KAAK,CAAC,OAAO,EAAE;oBACrD,IAAI,EAAE,sBAAQ,CAAC,OAAO;oBACtB,MAAM,EAAE,IAAI,CAAC,IAAI;oBACjB,eAAe,EAAE,IAAI,CAAC,WAAW;oBACjC,GAAG,EAAE,EAAE;oBACP,UAAU,EAAE,EAAE;iBACf,CAAC;aACH,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAlBW,QAAA,cAAc,kBAkBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodeFactory.d.ts","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,eAAO,MAAM,WAAW,GAAI,2CAOzB;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxB,GAAG,EAAE,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC,CAAC;IACtD,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC;CACd,SAwBA,CAAC"}
|
|
@@ -7,10 +7,7 @@ const addPromptNode_1 = require("./addPromptNode");
|
|
|
7
7
|
const addAppToolNode_1 = require("./addAppToolNode");
|
|
8
8
|
const addTriggerNode_1 = require("./addTriggerNode");
|
|
9
9
|
const addJumpToNode_1 = require("./addJumpToNode");
|
|
10
|
-
const
|
|
11
|
-
const callback = async () => { };
|
|
12
|
-
graph.addNode(node.name, callback);
|
|
13
|
-
};
|
|
10
|
+
const addJunctionNode_1 = require("./addJunctionNode");
|
|
14
11
|
const nodeFactory = ({ graph, node, tools, llm, emit, agent, }) => {
|
|
15
12
|
const nodeType = node.type;
|
|
16
13
|
switch (nodeType) {
|
|
@@ -21,7 +18,7 @@ const nodeFactory = ({ graph, node, tools, llm, emit, agent, }) => {
|
|
|
21
18
|
(0, addToolNode_1.addToolNode)({ graph, node, tools, llm, agent });
|
|
22
19
|
break;
|
|
23
20
|
case Flows_types_1.NodeType.JUNCTION:
|
|
24
|
-
addJunctionNode({ graph, node });
|
|
21
|
+
(0, addJunctionNode_1.addJunctionNode)({ graph, node });
|
|
25
22
|
break;
|
|
26
23
|
case Flows_types_1.NodeType.APP_TOOL:
|
|
27
24
|
(0, addAppToolNode_1.addAppToolNode)({ graph, node, llm, agent });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeFactory.js","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"nodeFactory.js","sourceRoot":"","sources":["../../src/nodes/nodeFactory.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AAGtD,+CAA4C;AAC5C,mDAAgD;AAGhD,qDAAkD;AAClD,qDAAkD;AAGlD,mDAAgD;AAChD,uDAAoD;AAE7C,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,IAAI,EACJ,KAAK,GAQN,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC3B,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,sBAAQ,CAAC,OAAO;YACnB,IAAA,+BAAc,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAChC,MAAM;QACR,KAAK,sBAAQ,CAAC,IAAI;YAChB,IAAA,yBAAW,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YAChD,MAAM;QACR,KAAK,sBAAQ,CAAC,QAAQ;YACpB,IAAA,iCAAe,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjC,MAAM;QACR,KAAK,sBAAQ,CAAC,QAAQ;YACpB,IAAA,+BAAc,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5C,MAAM;QACR,KAAK,sBAAQ,CAAC,WAAW;YACvB,IAAA,6BAAa,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACxD,MAAM;QACR,KAAK,sBAAQ,CAAC,YAAY;YACxB,IAAA,6BAAa,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/B,MAAM;QACR;YACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC,CAAC;AAtCW,QAAA,WAAW,eAsCtB"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { BaseCheckpointSaver, CheckpointTuple, Checkpoint, CheckpointMetadata, ChannelVersions, PendingWrite, CheckpointListOptions } from '@langchain/langgraph-checkpoint';
|
|
2
2
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
3
|
-
import { MindedConnection } from './mindedConnection';
|
|
4
3
|
export declare class MindedCheckpointSaver extends BaseCheckpointSaver<number> {
|
|
5
|
-
|
|
6
|
-
constructor(mindedConnection: MindedConnection);
|
|
4
|
+
constructor();
|
|
7
5
|
getTuple(config: RunnableConfig<Record<string, any>>): Promise<CheckpointTuple | undefined>;
|
|
8
6
|
list(config: RunnableConfig<Record<string, any>>, options?: CheckpointListOptions): AsyncGenerator<CheckpointTuple, any, any>;
|
|
9
7
|
put(config: RunnableConfig<Record<string, any>>, checkpoint: Checkpoint<string, string>, metadata: CheckpointMetadata, newVersions: ChannelVersions): Promise<RunnableConfig<Record<string, any>>>;
|
|
@@ -1 +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;
|
|
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,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,MAAM,CAAC;;IAK9D,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"}
|
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.MindedCheckpointSaver = void 0;
|
|
4
37
|
const langgraph_checkpoint_1 = require("@langchain/langgraph-checkpoint");
|
|
38
|
+
const mindedConnection = __importStar(require("./mindedConnection"));
|
|
5
39
|
const mindedConnectionTypes_1 = require("./mindedConnectionTypes");
|
|
6
40
|
const logger_1 = require("../utils/logger");
|
|
7
41
|
class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
8
|
-
constructor(
|
|
42
|
+
constructor() {
|
|
9
43
|
super();
|
|
10
|
-
this.mindedConnection = mindedConnection;
|
|
11
44
|
}
|
|
12
45
|
async getTuple(config) {
|
|
13
|
-
const response = await
|
|
14
|
-
type: mindedConnectionTypes_1.
|
|
46
|
+
const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_GET_TUPLE, {
|
|
47
|
+
type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_GET_TUPLE,
|
|
15
48
|
config,
|
|
16
49
|
});
|
|
17
50
|
if (!response.tuple) {
|
|
@@ -46,8 +79,8 @@ class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
|
46
79
|
};
|
|
47
80
|
}
|
|
48
81
|
async *list(config, options) {
|
|
49
|
-
const response = await
|
|
50
|
-
type: mindedConnectionTypes_1.
|
|
82
|
+
const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_LIST, {
|
|
83
|
+
type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_LIST,
|
|
51
84
|
config,
|
|
52
85
|
options,
|
|
53
86
|
});
|
|
@@ -72,8 +105,8 @@ class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
|
72
105
|
}
|
|
73
106
|
async put(config, checkpoint, metadata, newVersions) {
|
|
74
107
|
try {
|
|
75
|
-
const response = await
|
|
76
|
-
type: mindedConnectionTypes_1.
|
|
108
|
+
const response = await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_PUT, {
|
|
109
|
+
type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_PUT,
|
|
77
110
|
config,
|
|
78
111
|
checkpoint,
|
|
79
112
|
metadata,
|
|
@@ -88,8 +121,8 @@ class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
|
88
121
|
}
|
|
89
122
|
async putWrites(config, writes, taskId) {
|
|
90
123
|
try {
|
|
91
|
-
await
|
|
92
|
-
type: mindedConnectionTypes_1.
|
|
124
|
+
await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_PUT_WRITES, {
|
|
125
|
+
type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.CHECKPOINT_PUT_WRITES,
|
|
93
126
|
config,
|
|
94
127
|
writes,
|
|
95
128
|
taskId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mindedCheckpointSaver.js","sourceRoot":"","sources":["../../src/platform/mindedCheckpointSaver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mindedCheckpointSaver.js","sourceRoot":"","sources":["../../src/platform/mindedCheckpointSaver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EASyC;AAEzC,qEAAuD;AACvD,mEASiC;AACjC,4CAAyC;AAEzC,MAAa,qBAAsB,SAAQ,0CAA2B;IACpE;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA2C;QACxD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAC/C,yDAAiC,CAAC,oBAAoB,EACtD;YACE,IAAI,EAAE,yDAAiC,CAAC,oBAAoB;YAC5D,MAAM;SACP,CACF,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAE7B,uEAAuE;QACvE,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,GAAG,IAAI,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