graphai 1.0.13 → 2.0.0

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.
@@ -1,6 +1,7 @@
1
1
  import { DataSource, AgentFunction, AgentFunctionInfo, NodeData, StaticNodeData, ComputedNodeData, NodeState } from "../type";
2
+ import type { GraphNodes } from "../node";
2
3
  export declare const sleep: (milliseconds: number) => Promise<unknown>;
3
- export declare const parseNodeName: (inputNodeId: any, isSelfNode?: boolean) => DataSource;
4
+ export declare const parseNodeName: (inputNodeId: any, isSelfNode?: boolean, nodes?: GraphNodes) => DataSource;
4
5
  export declare function assert(condition: boolean, message: string, isWarn?: boolean): asserts condition;
5
6
  export declare const isObject: <Values = unknown>(x: unknown) => x is Record<string, Values>;
6
7
  export declare const isNull: (data: unknown) => data is null | undefined;
@@ -4,11 +4,12 @@ exports.loopCounterKey = exports.isStaticNodeData = exports.isComputedNodeData =
4
4
  exports.assert = assert;
5
5
  const type_1 = require("../type");
6
6
  const GraphAILogger_1 = require("./GraphAILogger");
7
+ const prop_function_1 = require("./prop_function");
7
8
  const sleep = async (milliseconds) => {
8
9
  return await new Promise((resolve) => setTimeout(resolve, milliseconds));
9
10
  };
10
11
  exports.sleep = sleep;
11
- const parseNodeName = (inputNodeId, isSelfNode = false) => {
12
+ const parseNodeName = (inputNodeId, isSelfNode = false, nodes) => {
12
13
  if (isSelfNode) {
13
14
  if (typeof inputNodeId === "string" && inputNodeId[0] === ".") {
14
15
  const parts = inputNodeId.split(".");
@@ -19,14 +20,19 @@ const parseNodeName = (inputNodeId, isSelfNode = false) => {
19
20
  if (typeof inputNodeId === "string") {
20
21
  const regex = /^:(.*)$/;
21
22
  const match = inputNodeId.match(regex);
22
- if (!match) {
23
- return { value: inputNodeId }; // string literal
23
+ if (match) {
24
+ const parts = match[1].split(/(?<!\()\.(?!\))/);
25
+ if (parts.length == 1) {
26
+ return { nodeId: parts[0] };
27
+ }
28
+ return { nodeId: parts[0], propIds: parts.slice(1) };
24
29
  }
25
- const parts = match[1].split(/(?<!\()\.(?!\))/);
26
- if (parts.length == 1) {
27
- return { nodeId: parts[0] };
30
+ const regexUtil = /^@(.*)$/;
31
+ const matchUtil = inputNodeId.match(regexUtil);
32
+ // Only when just called from resultsOfInner
33
+ if (nodes && matchUtil) {
34
+ return { value: (0, prop_function_1.utilsFunctions)(inputNodeId, nodes) };
28
35
  }
29
- return { nodeId: parts[0], propIds: parts.slice(1) };
30
36
  }
31
37
  return { value: inputNodeId }; // non-string literal
32
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphai",
3
- "version": "1.0.13",
3
+ "version": "2.0.0",
4
4
  "description": "Asynchronous data flow execution engine for agentic AI apps.",
5
5
  "main": "lib/bundle.cjs.js",
6
6
  "module": "lib/bundle.esm.js",