@minded-ai/mindedjs 1.0.57 → 1.0.58
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 +2 -2
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +8 -7
- package/dist/agent.js.map +1 -1
- package/dist/checkpointer/checkpointSaverFactory.d.ts.map +1 -1
- package/dist/checkpointer/checkpointSaverFactory.js +3 -2
- package/dist/checkpointer/checkpointSaverFactory.js.map +1 -1
- package/dist/cli/index.js +6 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/edges/createDirectEdge.d.ts.map +1 -1
- package/dist/edges/createDirectEdge.js +2 -1
- package/dist/edges/createDirectEdge.js.map +1 -1
- package/dist/edges/createLogicalRouter.d.ts.map +1 -1
- package/dist/edges/createLogicalRouter.js +2 -1
- package/dist/edges/createLogicalRouter.js.map +1 -1
- package/dist/edges/createPromptRouter.d.ts.map +1 -1
- package/dist/edges/createPromptRouter.js +3 -2
- package/dist/edges/createPromptRouter.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/nodes/addAppToolNode.d.ts.map +1 -1
- package/dist/nodes/addAppToolNode.js +23 -10
- package/dist/nodes/addAppToolNode.js.map +1 -1
- package/dist/nodes/addHumanInTheLoopNode.d.ts.map +1 -1
- package/dist/nodes/addHumanInTheLoopNode.js +2 -1
- package/dist/nodes/addHumanInTheLoopNode.js.map +1 -1
- package/dist/nodes/addPromptNode.d.ts.map +1 -1
- package/dist/nodes/addPromptNode.js +6 -2
- package/dist/nodes/addPromptNode.js.map +1 -1
- package/dist/nodes/addToolNode.d.ts.map +1 -1
- package/dist/nodes/addToolNode.js +2 -1
- package/dist/nodes/addToolNode.js.map +1 -1
- package/dist/nodes/addToolRunNode.d.ts.map +1 -1
- package/dist/nodes/addToolRunNode.js +2 -1
- package/dist/nodes/addToolRunNode.js.map +1 -1
- package/dist/nodes/addTriggerNode.d.ts.map +1 -1
- package/dist/nodes/addTriggerNode.js +2 -1
- package/dist/nodes/addTriggerNode.js.map +1 -1
- package/dist/platform/mindedCheckpointSaver.d.ts.map +1 -1
- package/dist/platform/mindedCheckpointSaver.js +3 -2
- package/dist/platform/mindedCheckpointSaver.js.map +1 -1
- package/dist/platform/mindedConnection.d.ts.map +1 -1
- package/dist/platform/mindedConnection.js +8 -7
- package/dist/platform/mindedConnection.js.map +1 -1
- package/dist/platform/piiGateway/gateway.d.ts.map +1 -1
- package/dist/platform/piiGateway/gateway.js +10 -2
- package/dist/platform/piiGateway/gateway.js.map +1 -1
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +28 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +3 -1
- package/src/agent.ts +8 -7
- package/src/checkpointer/checkpointSaverFactory.ts +3 -2
- package/src/cli/index.ts +7 -9
- package/src/edges/createDirectEdge.ts +2 -1
- package/src/edges/createLogicalRouter.ts +2 -1
- package/src/edges/createPromptRouter.ts +3 -2
- package/src/index.ts +2 -1
- package/src/nodes/addAppToolNode.ts +23 -10
- package/src/nodes/addHumanInTheLoopNode.ts +2 -1
- package/src/nodes/addPromptNode.ts +5 -2
- package/src/nodes/addToolNode.ts +2 -1
- package/src/nodes/addToolRunNode.ts +2 -1
- package/src/nodes/addTriggerNode.ts +7 -6
- package/src/platform/mindedCheckpointSaver.ts +3 -2
- package/src/platform/mindedConnection.ts +8 -7
- package/src/platform/piiGateway/gateway.ts +10 -2
- package/src/utils/logger.ts +22 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"names":[],"mappings":";;;;;;AAKA,iDAA8D;AAG9D,mGAA2E;
|
|
1
|
+
{"version":3,"file":"addToolRunNode.js","sourceRoot":"","sources":["../../src/nodes/addToolRunNode.ts"],"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CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAQ,CAAC;QACrE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,MAAM,UAAU,GAAG,IAAA,mCAAyB,EAAC,eAA8B,CAAC,CAAC;QAC7E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;IAC7D,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAA,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;AAjCW,QAAA,cAAc,kBAiCzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"addTriggerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,eAAO,MAAM,cAAc,GAAU,iBAAiB;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,kBAOnG,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addTriggerNode = void 0;
|
|
4
|
+
const logger_1 = require("../utils/logger");
|
|
4
5
|
const addTriggerNode = async ({ graph, node }) => {
|
|
5
6
|
const callback = async () => {
|
|
6
|
-
|
|
7
|
+
logger_1.logger.info(`Executing trigger node ${node.name}`);
|
|
7
8
|
return;
|
|
8
9
|
};
|
|
9
10
|
graph.addNode(node.name, callback);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTriggerNode.js","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"addTriggerNode.js","sourceRoot":"","sources":["../../src/nodes/addTriggerNode.ts"],"names":[],"mappings":";;;AAGA,4CAAyC;AAElC,MAAM,cAAc,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAkD,EAAE,EAAE;IACtG,MAAM,QAAQ,GAAiB,KAAK,IAAI,EAAE;QACxC,eAAM,CAAC,IAAI,CAAC,0BAA0B,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,OAAO;IACT,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB"}
|
|
@@ -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;AAChE,OAAO,EAAE,gBAAgB,EAAE,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@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MindedCheckpointSaver = void 0;
|
|
4
4
|
const langgraph_checkpoint_1 = require("@langchain/langgraph-checkpoint");
|
|
5
5
|
const mindedConnectionTypes_1 = require("./mindedConnectionTypes");
|
|
6
|
+
const logger_1 = require("../utils/logger");
|
|
6
7
|
class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
7
8
|
constructor(mindedConnection) {
|
|
8
9
|
super();
|
|
@@ -81,7 +82,7 @@ class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
|
81
82
|
return response.config;
|
|
82
83
|
}
|
|
83
84
|
catch (error) {
|
|
84
|
-
|
|
85
|
+
logger_1.logger.error({ msg: 'Error putting checkpoint:', error });
|
|
85
86
|
return config;
|
|
86
87
|
}
|
|
87
88
|
}
|
|
@@ -95,7 +96,7 @@ class MindedCheckpointSaver extends langgraph_checkpoint_1.BaseCheckpointSaver {
|
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
catch (error) {
|
|
98
|
-
|
|
99
|
+
logger_1.logger.error({ msg: 'Error putting writes:', error });
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mindedCheckpointSaver.js","sourceRoot":"","sources":["../../src/platform/mindedCheckpointSaver.ts"],"names":[],"mappings":";;;AAAA,0EASyC;AAGzC,mEASiC;
|
|
1
|
+
{"version":3,"file":"mindedCheckpointSaver.js","sourceRoot":"","sources":["../../src/platform/mindedCheckpointSaver.ts"],"names":[],"mappings":";;;AAAA,0EASyC;AAGzC,mEASiC;AACjC,4CAAyC;AAEzC,MAAa,qBAAsB,SAAQ,0CAA2B;IACpE,YAAoB,gBAAkC;QACpD,KAAK,EAAE,CAAC;QADU,qBAAgB,GAAhB,gBAAgB,CAAkB;IAEtD,CAAC;IAED,KAAK,CAAC,QAAQ,C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","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"mindedConnection.d.ts","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAK/G,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAuB;IACrC,SAAS,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,CAAC,EAAE,CAAC;KACzE,CAAM;IAEP,IAAW,WAAW,IAAI,OAAO,CAEhC;IAEM,EAAE,GAAI,OAAO,iCAAiC,EAAE,UAAU,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,UAKnH;IAEK,IAAI,GAAI,OAAO,iCAAiC,EAAE,SAAS,iCAAiC,UAIjG;IAEK,SAAS,GAAU,CAAC,EAAE,CAAC,EAAE,OAAO,iCAAiC,EAAE,SAAS,CAAC,EAAE,YAAW,MAAa,KAAG,OAAO,CAAC,CAAC,CAAC,CAuBzH;YAEY,OAAO;IAgER,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAOpC"}
|
|
@@ -4,6 +4,7 @@ exports.MindedConnection = void 0;
|
|
|
4
4
|
const socket_io_client_1 = require("socket.io-client");
|
|
5
5
|
const flatted_1 = require("flatted");
|
|
6
6
|
const config_1 = require("./config");
|
|
7
|
+
const logger_1 = require("../utils/logger");
|
|
7
8
|
class MindedConnection {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.socket = null;
|
|
@@ -58,23 +59,23 @@ class MindedConnection {
|
|
|
58
59
|
});
|
|
59
60
|
// Connection event handlers
|
|
60
61
|
this.socket.on('connect', () => {
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
logger_1.logger.info('\x1b[32mConnection with Minded platform is live!\x1b[0m');
|
|
63
|
+
logger_1.logger.info('\x1b[32mPress Ctrl+C to exit...');
|
|
63
64
|
resolve();
|
|
64
65
|
});
|
|
65
66
|
this.socket.on('connect_error', () => {
|
|
66
|
-
|
|
67
|
+
logger_1.logger.error('Failed to connect to minded platform');
|
|
67
68
|
reject(new Error('Failed to connect to minded platform'));
|
|
68
69
|
});
|
|
69
70
|
this.socket.on('disconnect', () => {
|
|
70
|
-
|
|
71
|
+
logger_1.logger.info('Disconnected from local debugging socket');
|
|
71
72
|
});
|
|
72
73
|
// Listen for error messages from the server
|
|
73
74
|
this.socket.on('error', async (error) => {
|
|
74
75
|
var _a;
|
|
75
|
-
|
|
76
|
+
logger_1.logger.error({ msg: 'Server error:', error });
|
|
76
77
|
if (error.message.includes('Invalid token')) {
|
|
77
|
-
|
|
78
|
+
logger_1.logger.info('Invalid token');
|
|
78
79
|
// Disconnect current socket
|
|
79
80
|
if ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.connected) {
|
|
80
81
|
this.socket.disconnect();
|
|
@@ -95,7 +96,7 @@ class MindedConnection {
|
|
|
95
96
|
process.on('SIGINT', () => {
|
|
96
97
|
var _a;
|
|
97
98
|
if ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.connected) {
|
|
98
|
-
|
|
99
|
+
logger_1.logger.info('\nDisconnecting...');
|
|
99
100
|
this.socket.disconnect();
|
|
100
101
|
}
|
|
101
102
|
process.exit(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mindedConnection.js","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":";;;AAAA,uDAA8C;AAE9C,qCAAoC;AACpC,qCAAqC;
|
|
1
|
+
{"version":3,"file":"mindedConnection.js","sourceRoot":"","sources":["../../src/platform/mindedConnection.ts"],"names":[],"mappings":";;;AAAA,uDAA8C;AAE9C,qCAAoC;AACpC,qCAAqC;AACrC,4CAAyC;AAEzC,MAAa,gBAAgB;IA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AAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF;AAvHD,4CAuHC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../src/platform/piiGateway/gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../src/platform/piiGateway/gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG9E,qBAAa,UAAW,YAAW,kBAAkB;IACnD,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,gBAAgB,EAAE,gBAAgB;YAIhC,WAAW;IA2DnB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAIlG,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,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
|
const mindedConnectionTypes_1 = require("../mindedConnectionTypes");
|
|
6
|
+
const logger_1 = require("../../utils/logger");
|
|
6
7
|
class PIIGateway {
|
|
7
8
|
constructor(mindedConnection) {
|
|
8
9
|
this.mindedConnection = mindedConnection;
|
|
@@ -30,7 +31,7 @@ class PIIGateway {
|
|
|
30
31
|
}
|
|
31
32
|
// Verify that the response requestId matches our request
|
|
32
33
|
if (response.requestId && response.requestId !== requestId) {
|
|
33
|
-
|
|
34
|
+
logger_1.logger.warn(`Response requestId (${response.requestId}) does not match request requestId (${requestId})`);
|
|
34
35
|
}
|
|
35
36
|
// Return generic HttpResponse format
|
|
36
37
|
return {
|
|
@@ -42,7 +43,14 @@ class PIIGateway {
|
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
catch (error) {
|
|
45
|
-
|
|
46
|
+
logger_1.logger.error({ msg: 'Secure HTTP request failed', error });
|
|
47
|
+
return {
|
|
48
|
+
data: undefined,
|
|
49
|
+
status: 500,
|
|
50
|
+
statusText: 'Internal Server Error',
|
|
51
|
+
headers: {},
|
|
52
|
+
config: config || {},
|
|
53
|
+
};
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
async get(sessionId, url, config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../src/platform/piiGateway/gateway.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAEpC,oEAAkH;
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../src/platform/piiGateway/gateway.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAEpC,oEAAkH;AAElH,+CAA4C;AAE5C,MAAa,UAAU;IAGrB,YAAY,gBAAkC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAEO,KAAK,CAAC,WAAW,CACvB,SAAiB,EACjB,MAAwE,EACxE,GAAW,EACX,IAAU,EACV,MAA0B;;QAE1B,IAAI,CA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AW,EAAE,MAA0B;QAC5E,OAAO,IAAI,CAAC,WAAW,CAAI,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,OAAO,CAAU,SAAiB,EAAE,GAAW,EAAE,MAA0B;QAC/E,OAAO,IAAI,CAAC,WAAW,CAAI,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,OAAO,CAAU,SAAiB,EAAE,MAAyB;;QACjE,MAAM,MAAM,GAAG,CAAC,CAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,WAAW,EAAE,KAAI,KAAK,CAAQ,CAAC;QAC9D,OAAO,IAAI,CAAC,WAAW,CAAI,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACvF,CAAC;CACF;AAlGD,gCAkGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,uCAgBjB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.logger = void 0;
|
|
7
|
+
const pino_1 = __importDefault(require("pino"));
|
|
8
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
|
+
dotenv_1.default.config();
|
|
10
|
+
// Create a Pino logger with a custom log format
|
|
11
|
+
exports.logger = (0, pino_1.default)({
|
|
12
|
+
level: process.env.LOG_LEVEL || 'info',
|
|
13
|
+
base: null,
|
|
14
|
+
transport: {
|
|
15
|
+
target: 'pino-pretty',
|
|
16
|
+
options: {
|
|
17
|
+
colorize: true,
|
|
18
|
+
crlf: true,
|
|
19
|
+
translateTime: 'SYS:standard',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
formatters: {
|
|
23
|
+
level(label) {
|
|
24
|
+
return { level: label };
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,gDAAgD;AACnC,QAAA,MAAM,GAAG,IAAA,cAAI,EAAC;IACzB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,MAAM;IACtC,IAAI,EAAE,IAAI;IACV,SAAS,EAAE;QACT,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI;YACV,aAAa,EAAE,cAAc;SAC9B;KACF;IACD,UAAU,EAAE;QACV,KAAK,CAAC,KAAK;YACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC1B,CAAC;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minded-ai/mindedjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"description": "MindedJS is a TypeScript library for building agents.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
"flatted": "^3.3.3",
|
|
50
50
|
"js-yaml": "^4.1.0",
|
|
51
51
|
"langchain": "^0.3.25",
|
|
52
|
+
"pino": "^9.7.0",
|
|
53
|
+
"pino-pretty": "^13.0.0",
|
|
52
54
|
"socket.io-client": "^4.8.1",
|
|
53
55
|
"uuid": "^11.1.0",
|
|
54
56
|
"zod": "^3.24.4"
|
package/src/agent.ts
CHANGED
|
@@ -24,6 +24,7 @@ import triggerTypeToDefaultMessage from './triggers/triggerTypeToDefaultMessage'
|
|
|
24
24
|
import appActionRunnerToolCreator from './internalTools/appActionRunnerTool';
|
|
25
25
|
import { wait } from './utils/wait';
|
|
26
26
|
import { PIIGateway, PIIGatewayInstance } from './platform/piiGateway';
|
|
27
|
+
import { logger } from './utils/logger';
|
|
27
28
|
|
|
28
29
|
type CreateAgentParams<Memory> = {
|
|
29
30
|
memorySchema: z.ZodSchema;
|
|
@@ -363,7 +364,7 @@ export class Agent {
|
|
|
363
364
|
const handlerResult = results.find((r) => r !== undefined);
|
|
364
365
|
if (handlerResult) {
|
|
365
366
|
if (!handlerResult.isQualified) {
|
|
366
|
-
|
|
367
|
+
logger.info(`Trigger ${triggerName} was disqualified`);
|
|
367
368
|
return;
|
|
368
369
|
}
|
|
369
370
|
memoryUpdate = handlerResult.memory || {};
|
|
@@ -380,13 +381,13 @@ export class Agent {
|
|
|
380
381
|
...triggerInvocation,
|
|
381
382
|
},
|
|
382
383
|
];
|
|
383
|
-
|
|
384
|
+
logger.info(`Invoking trigger ${triggerName} with session ${sessionId}`);
|
|
384
385
|
const config = { configurable: { thread_id: sessionId, recursionLimit: 3 } };
|
|
385
386
|
|
|
386
387
|
const state = await this.compiledGraph.getState(config);
|
|
387
388
|
// Resume interruption
|
|
388
389
|
if (state.tasks?.[0]?.interrupts?.length > 0) {
|
|
389
|
-
|
|
390
|
+
logger.info('Resuming interruption');
|
|
390
391
|
const res = await this.compiledGraph.invoke(
|
|
391
392
|
new Command({
|
|
392
393
|
resume: { memory: memoryUpdate, messages, history, triggerInvocations: [triggerInvocation], sessionId },
|
|
@@ -483,8 +484,8 @@ export class Agent {
|
|
|
483
484
|
* ```typescript
|
|
484
485
|
* // AI_MESSAGE Event Handler
|
|
485
486
|
* agent.on('AI_MESSAGE', async ({ message, memory, sessionId }) => {
|
|
486
|
-
*
|
|
487
|
-
*
|
|
487
|
+
* logger.info({ msg: 'AI said:', output: message });
|
|
488
|
+
* logger.info({ msg: 'Current memory:', output: memory });
|
|
488
489
|
*
|
|
489
490
|
* // Send to user interface with session context
|
|
490
491
|
* await sendMessageToUser(message, sessionId);
|
|
@@ -574,7 +575,7 @@ export class Agent {
|
|
|
574
575
|
// Skip secret loading in local development
|
|
575
576
|
const { runLocally } = getConfig();
|
|
576
577
|
if (runLocally) {
|
|
577
|
-
|
|
578
|
+
logger.info('Running locally - skipping secret loading');
|
|
578
579
|
return {};
|
|
579
580
|
}
|
|
580
581
|
if (!this.mindedConnection?.isConnected) {
|
|
@@ -606,7 +607,7 @@ export class Agent {
|
|
|
606
607
|
const secrets = response.secrets || {};
|
|
607
608
|
|
|
608
609
|
// Load secrets into process.env
|
|
609
|
-
|
|
610
|
+
logger.info(`Loading ${Object.keys(secrets).length} secrets into environment variables`);
|
|
610
611
|
Object.entries(secrets).forEach(([key, value]) => {
|
|
611
612
|
process.env[key] = value;
|
|
612
613
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseCheckpointSaver, MemorySaver } from '@langchain/langgraph';
|
|
2
2
|
import { MindedCheckpointSaver } from '../platform/mindedCheckpointSaver';
|
|
3
3
|
import { MindedConnection } from '../platform/mindedConnection';
|
|
4
|
+
import { logger } from '../utils/logger';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Factory function to create the appropriate checkpoint saver based on environment variables.
|
|
@@ -9,10 +10,10 @@ import { MindedConnection } from '../platform/mindedConnection';
|
|
|
9
10
|
*/
|
|
10
11
|
export function createCheckpointSaver(mindedConnection: MindedConnection | null): BaseCheckpointSaver {
|
|
11
12
|
if (!mindedConnection) {
|
|
12
|
-
|
|
13
|
+
logger.warn('mindedConnection not set, falling back to in-memory checkpoint saver');
|
|
13
14
|
return new MemorySaver();
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
logger.info('Using remote checkpoint saver');
|
|
17
18
|
return new MindedCheckpointSaver(mindedConnection);
|
|
18
19
|
}
|
package/src/cli/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as path from 'path';
|
|
5
|
+
import { logger } from '../utils/logger';
|
|
5
6
|
|
|
6
7
|
const ENV_FILE = '.env';
|
|
7
8
|
|
|
@@ -17,7 +18,7 @@ function setToken(token: string): void {
|
|
|
17
18
|
if (!fs.existsSync(envPath)) {
|
|
18
19
|
// Create .env file with the token
|
|
19
20
|
fs.writeFileSync(envPath, tokenLine + '\n');
|
|
20
|
-
|
|
21
|
+
logger.info(`Created ${envPath} and added token`);
|
|
21
22
|
} else {
|
|
22
23
|
// Read existing .env file
|
|
23
24
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
@@ -25,17 +26,14 @@ function setToken(token: string): void {
|
|
|
25
26
|
// Check if MINDED_CONNECTION_TOKEN already exists
|
|
26
27
|
if (envContent.includes('MINDED_CONNECTION_TOKEN=')) {
|
|
27
28
|
// Replace existing token
|
|
28
|
-
const updatedContent = envContent.replace(
|
|
29
|
-
/MINDED_CONNECTION_TOKEN=.*/,
|
|
30
|
-
tokenLine
|
|
31
|
-
);
|
|
29
|
+
const updatedContent = envContent.replace(/MINDED_CONNECTION_TOKEN=.*/, tokenLine);
|
|
32
30
|
fs.writeFileSync(envPath, updatedContent);
|
|
33
|
-
|
|
31
|
+
logger.info(`Updated MINDED_CONNECTION_TOKEN in ${envPath}`);
|
|
34
32
|
} else {
|
|
35
33
|
// Append token to existing file
|
|
36
34
|
const newContent = envContent.endsWith('\n') ? envContent + tokenLine + '\n' : envContent + '\n' + tokenLine + '\n';
|
|
37
35
|
fs.writeFileSync(envPath, newContent);
|
|
38
|
-
|
|
36
|
+
logger.info(`Added MINDED_CONNECTION_TOKEN to ${envPath}`);
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
}
|
|
@@ -47,12 +45,12 @@ function main() {
|
|
|
47
45
|
if (command === 'token') {
|
|
48
46
|
const token = args[1];
|
|
49
47
|
if (!token) {
|
|
50
|
-
|
|
48
|
+
logger.error('Please provide a token');
|
|
51
49
|
process.exit(1);
|
|
52
50
|
}
|
|
53
51
|
setToken(token);
|
|
54
52
|
} else {
|
|
55
|
-
|
|
53
|
+
logger.error('Unknown command. Available commands: token');
|
|
56
54
|
process.exit(1);
|
|
57
55
|
}
|
|
58
56
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { StepForwardEdge } from '../types/Flows.types';
|
|
2
|
+
import { logger } from '../utils/logger';
|
|
2
3
|
|
|
3
4
|
export const createDirectEdge = (edge: StepForwardEdge) => {
|
|
4
5
|
return async () => {
|
|
5
6
|
// For direct edges, we just return the target of the first edge
|
|
6
7
|
// since there's no conditional logic needed
|
|
7
|
-
|
|
8
|
+
logger.info(`Executing edge ${JSON.stringify(edge)}`);
|
|
8
9
|
return edge.target;
|
|
9
10
|
};
|
|
10
11
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LogicalConditionEdge } from '../types/Flows.types';
|
|
2
2
|
import { stateAnnotation } from '../types/LangGraph.types';
|
|
3
|
+
import { logger } from '../utils/logger';
|
|
3
4
|
|
|
4
5
|
export const createLogicalRouter = ({ edges }: { edges: LogicalConditionEdge[] }) => {
|
|
5
6
|
return async (state: typeof stateAnnotation.State) => {
|
|
6
|
-
|
|
7
|
+
logger.info(`Executing logical router. Edges: ${JSON.stringify(edges)}`);
|
|
7
8
|
for (const edge of edges) {
|
|
8
9
|
const conditionFn = eval(edge.condition);
|
|
9
10
|
const result = await conditionFn({ memory: state.memory });
|
|
@@ -6,6 +6,7 @@ import { AIMessage } from '@langchain/core/messages';
|
|
|
6
6
|
import { stateAnnotation } from '../types/LangGraph.types';
|
|
7
7
|
import { MemorySaver } from '@langchain/langgraph';
|
|
8
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
import { logger } from '../utils/logger';
|
|
9
10
|
|
|
10
11
|
export const createPromptRouter = ({ edges, llm }: { edges: PromptConditionEdge[]; llm: BaseLanguageModel }) => {
|
|
11
12
|
const agent = createReactAgent({
|
|
@@ -18,7 +19,7 @@ export const createPromptRouter = ({ edges, llm }: { edges: PromptConditionEdge[
|
|
|
18
19
|
}),
|
|
19
20
|
});
|
|
20
21
|
return async (state: typeof stateAnnotation.State) => {
|
|
21
|
-
|
|
22
|
+
logger.info(`Executing prompt router. Edges: ${JSON.stringify(edges)}`);
|
|
22
23
|
const result = await agent.invoke(
|
|
23
24
|
{
|
|
24
25
|
messages: [
|
|
@@ -46,7 +47,7 @@ Based on the memory state and available nodes, determine the most appropriate ne
|
|
|
46
47
|
);
|
|
47
48
|
try {
|
|
48
49
|
const nextNode = result.structuredResponse.nextNodeId;
|
|
49
|
-
|
|
50
|
+
logger.info(`Next node: ${nextNode}`);
|
|
50
51
|
if (!nextNode) {
|
|
51
52
|
throw new Error('No next node id returned from router');
|
|
52
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Agent } from './agent';
|
|
2
2
|
import events from './events';
|
|
3
|
+
import { logger } from './utils/logger';
|
|
3
4
|
|
|
4
|
-
export { Agent, events };
|
|
5
|
+
export { Agent, events, logger };
|
|
5
6
|
|
|
6
7
|
// HTTP module for PII masking - only public API
|
|
7
8
|
export type { PIIGatewayInstance, HttpRequestConfig, HttpResponse } from './platform/piiGateway';
|
|
@@ -8,6 +8,7 @@ import { LLMProviders } from '../types/LLM.types';
|
|
|
8
8
|
import { getAppActionRunnerTool } from '../internalTools/appActionRunnerTool';
|
|
9
9
|
import { FlowHistoryType } from '../types/Agent.types';
|
|
10
10
|
import { Agent } from '../agent';
|
|
11
|
+
import { logger } from '../utils/logger';
|
|
11
12
|
|
|
12
13
|
export const addAppToolNode = async ({
|
|
13
14
|
graph,
|
|
@@ -20,16 +21,17 @@ export const addAppToolNode = async ({
|
|
|
20
21
|
llm: (typeof LLMProviders)[keyof typeof LLMProviders];
|
|
21
22
|
agent: Agent;
|
|
22
23
|
}) => {
|
|
24
|
+
const cleanedParameters = Object.fromEntries(Object.entries(node.parameters || {}).filter(([, value]) => value !== ''));
|
|
23
25
|
const appRunnerTool = getAppActionRunnerTool(node.name);
|
|
24
26
|
const callback: RunnableLike = async (state: typeof stateAnnotation.State) => {
|
|
25
|
-
|
|
27
|
+
logger.info(`Executing tool node ${appRunnerTool.name}`);
|
|
26
28
|
|
|
27
29
|
const executeWrapper = async (input: z.infer<typeof appRunnerTool.input>) => {
|
|
28
30
|
try {
|
|
29
31
|
const response = await appRunnerTool.execute({ input, state, agent });
|
|
30
32
|
return response || {};
|
|
31
33
|
} catch (error) {
|
|
32
|
-
|
|
34
|
+
logger.error({ msg: 'Error executing tool', error });
|
|
33
35
|
throw error;
|
|
34
36
|
}
|
|
35
37
|
};
|
|
@@ -38,19 +40,30 @@ export const addAppToolNode = async ({
|
|
|
38
40
|
description: appRunnerTool.description,
|
|
39
41
|
schema: appRunnerTool.input,
|
|
40
42
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const message = `
|
|
44
|
+
previous messages are available for context.
|
|
45
|
+
Your goal is execute the tool with the correct parameters, some of them already chosen by the user and the rest should be generated.
|
|
46
|
+
You have 4 things to base your parameters on:
|
|
47
|
+
- Previous messages
|
|
48
|
+
- Parameters manually configured by the user (if any)
|
|
49
|
+
- User instructions for choosing tool parameters that are not set by the user (if any)
|
|
50
|
+
- Workflow memory
|
|
51
|
+
Parameters manually configured by the user are:
|
|
52
|
+
${JSON.stringify(cleanedParameters)}
|
|
53
|
+
User instructions for choosing tool parameters are:
|
|
54
|
+
${node.prompt ? `${node.prompt}` : 'no instructions set by the user'}
|
|
55
|
+
Workflow memory is:
|
|
56
|
+
${JSON.stringify(state.memory)}
|
|
44
57
|
`;
|
|
45
|
-
const messages = state.messages || [];
|
|
46
|
-
if (Object.keys(state.memory).length !== 0) {
|
|
47
|
-
messages.push(new SystemMessage(prompt));
|
|
48
|
-
}
|
|
49
58
|
const AIToolCallMessage = await llm
|
|
50
59
|
.bindTools([tool], {
|
|
51
60
|
tool_choice: tool.name,
|
|
52
61
|
})
|
|
53
|
-
.invoke(messages);
|
|
62
|
+
.invoke([...state.messages, new SystemMessage(message)]);
|
|
63
|
+
AIToolCallMessage.tool_calls[0].args = {
|
|
64
|
+
...AIToolCallMessage.tool_calls[0].args,
|
|
65
|
+
...cleanedParameters, //user set parameters have priority over ai generated parameters
|
|
66
|
+
};
|
|
54
67
|
const toolCallMessage = await tool.invoke(AIToolCallMessage.tool_calls[0]);
|
|
55
68
|
AIToolCallMessage.additional_kwargs = {
|
|
56
69
|
appActionInvocation: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { interrupt } from '@langchain/langgraph';
|
|
2
2
|
import { PreCompiledGraph } from '../types/LangGraph.types';
|
|
3
3
|
import { RunnableLike } from '@langchain/core/runnables';
|
|
4
|
+
import { logger } from '../utils/logger';
|
|
4
5
|
|
|
5
6
|
type AddHumanInTheLoopNodeParams = {
|
|
6
7
|
graph: PreCompiledGraph;
|
|
@@ -11,7 +12,7 @@ export const buildHumanInTheLoopNodeName = (nodeName: string) => `${nodeName}_hu
|
|
|
11
12
|
|
|
12
13
|
export const addHumanInTheLoopNode = async ({ graph, attachedToNodeName }: AddHumanInTheLoopNodeParams) => {
|
|
13
14
|
const callback: RunnableLike = async () => {
|
|
14
|
-
|
|
15
|
+
logger.info(`Executing "human in the loop" node for the attached node${attachedToNodeName}`);
|
|
15
16
|
const value = interrupt('input from human in the loop');
|
|
16
17
|
return value;
|
|
17
18
|
};
|
|
@@ -11,6 +11,7 @@ import { EmitSignature } from '../types/Agent.types';
|
|
|
11
11
|
import { createLlmInstance } from '../llm/createLlmInstance';
|
|
12
12
|
import extractToolMemoryResponse from '../utils/extractToolMemoryResponse';
|
|
13
13
|
import { Agent } from '../agent';
|
|
14
|
+
import { logger } from '../utils/logger';
|
|
14
15
|
|
|
15
16
|
type AddPromptNodeParams = {
|
|
16
17
|
graph: PreCompiledGraph;
|
|
@@ -23,7 +24,7 @@ type AddPromptNodeParams = {
|
|
|
23
24
|
|
|
24
25
|
export const addPromptNode = async ({ graph, node, llm, tools, emit, agent }: AddPromptNodeParams) => {
|
|
25
26
|
const callback: RunnableLike = async (state: typeof stateAnnotation.State, { configurable }) => {
|
|
26
|
-
|
|
27
|
+
logger.info(`Executing prompt node ${node.name}`);
|
|
27
28
|
const llmToUse = node.llmConfig ? createLlmInstance(node.llmConfig) : llm;
|
|
28
29
|
|
|
29
30
|
const globalTools = tools
|
|
@@ -60,13 +61,15 @@ export const addPromptNode = async ({ graph, node, llm, tools, emit, agent }: Ad
|
|
|
60
61
|
updatedMemory = { ...updatedMemory, ...extractToolMemoryResponse(toolResult) };
|
|
61
62
|
toolResults.push(toolResult);
|
|
62
63
|
} catch (error) {
|
|
63
|
-
|
|
64
|
+
logger.error({ msg: `Error executing tool ${toolCall.name}:`, error });
|
|
64
65
|
const errorMessage = new ToolMessage({
|
|
65
66
|
content: JSON.stringify({ error: error instanceof Error ? error.message : String(error) }),
|
|
66
67
|
tool_call_id: toolCall.id!,
|
|
67
68
|
});
|
|
68
69
|
toolResults.push(errorMessage);
|
|
69
70
|
}
|
|
71
|
+
} else {
|
|
72
|
+
logger.error({ msg: `Model tried to call tool ${toolCall.name} but it was not found` });
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
|
package/src/nodes/addToolNode.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { PreCompiledGraph, stateAnnotation } from '../types/LangGraph.types';
|
|
|
5
5
|
import { SystemMessage } from '@langchain/core/messages';
|
|
6
6
|
import { RunnableLike } from '@langchain/core/runnables';
|
|
7
7
|
import { LLMProviders } from '../types/LLM.types';
|
|
8
|
+
import { logger } from '../utils/logger';
|
|
8
9
|
|
|
9
10
|
export const addToolNode = async ({
|
|
10
11
|
graph,
|
|
@@ -23,7 +24,7 @@ export const addToolNode = async ({
|
|
|
23
24
|
throw new Error(`Tool not found: ${toolNode.toolName}`);
|
|
24
25
|
}
|
|
25
26
|
const callback: RunnableLike = async (state: typeof stateAnnotation.State) => {
|
|
26
|
-
|
|
27
|
+
logger.info(`Executing tool node ${toolNode.name}`);
|
|
27
28
|
|
|
28
29
|
const tool = langchainTool(() => {}, {
|
|
29
30
|
name: matchedTool.name,
|