graphai 2.0.12 → 2.0.13

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/lib/bundle.esm.js CHANGED
@@ -378,9 +378,10 @@ const dataSourceNodeIds = (sources) => {
378
378
  };
379
379
 
380
380
  class TransactionLog {
381
- constructor(nodeId) {
381
+ constructor(nodeId, mapIndex) {
382
382
  this.nodeId = nodeId;
383
383
  this.state = NodeState.Waiting;
384
+ this.mapIndex = mapIndex;
384
385
  }
385
386
  initForComputedNode(node, graph) {
386
387
  this.agentId = node.getAgentId();
@@ -569,7 +570,7 @@ class Node {
569
570
  this.result = undefined;
570
571
  this.nodeId = nodeId;
571
572
  this.graph = graph;
572
- this.log = new TransactionLog(nodeId);
573
+ this.log = new TransactionLog(nodeId, this.graph.mapIndex);
573
574
  this.console = {};
574
575
  }
575
576
  asString() {
@@ -1370,6 +1371,7 @@ class GraphAI {
1370
1371
  config: {},
1371
1372
  graphLoader: undefined,
1372
1373
  forceLoop: false,
1374
+ mapIndex: undefined,
1373
1375
  }) {
1374
1376
  this.staticNodeInitData = {};
1375
1377
  this.logs = [];
@@ -1394,6 +1396,7 @@ class GraphAI {
1394
1396
  this.config = options.config;
1395
1397
  this.graphLoader = options.graphLoader;
1396
1398
  this.forceLoop = options.forceLoop ?? false;
1399
+ this.mapIndex = options.mapIndex;
1397
1400
  this.loop = graphData.loop;
1398
1401
  this.verbose = graphData.verbose === true;
1399
1402
  this.onComplete = (__isAbort) => {
@@ -1545,6 +1548,12 @@ class GraphAI {
1545
1548
  if (this.isRunning() || this.processLoopIfNecessary()) {
1546
1549
  return; // continue running
1547
1550
  }
1551
+ if (this.verbose) {
1552
+ const notExecutedNodes = Object.values(this.nodes).filter((node) => node.isComputedNode && node.state !== "completed");
1553
+ if (notExecutedNodes.length > 0) {
1554
+ console.log("Those nodes are not running. " + notExecutedNodes.map((node) => `${node.nodeId}: ${node.state}`).join(", "));
1555
+ }
1556
+ }
1548
1557
  this.onComplete(false); // Nothing to run. Finish it.
1549
1558
  }
1550
1559
  // Must be called only from onExecutionComplete righ after removeRunning