diff --git a/tests/agentFilters/test_simple.ts b/tests/agentFilters/test_simple.ts index 08157c879..3da28f502 100644 --- a/tests/agentFilters/test_simple.ts +++ b/tests/agentFilters/test_simple.ts @@ -29,7 +29,7 @@ const callbackDictonary = {}; test("test agent filter", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -40,7 +40,7 @@ test("test agent filter", async () => { }, bypassAgent: { agent: "bypassAgent", - inputs: ["echo"], + inputs: [":echo"], isResult: true, }, }, @@ -64,7 +64,7 @@ test("test agent filter", async () => { test("test agent filter with agent condition", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -74,7 +74,7 @@ test("test agent filter with agent condition", async () => { }, bypassAgent: { agent: "bypassAgent", - inputs: ["echo"], + inputs: [":echo"], isResult: true, }, }, @@ -99,7 +99,7 @@ test("test agent filter with agent condition", async () => { test("test agent filter with agent condition", async () => { const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", @@ -109,7 +109,7 @@ test("test agent filter with agent condition", async () => { }, bypassAgent: { agent: "bypassAgent", - inputs: ["echo"], + inputs: [":echo"], isResult: true, }, }, diff --git a/tests/agentFilters/test_stream.ts b/tests/agentFilters/test_stream.ts index 8509eee59..c7e4e1801 100644 --- a/tests/agentFilters/test_stream.ts +++ b/tests/agentFilters/test_stream.ts @@ -29,7 +29,7 @@ const agentFilters = [ ]; const graph_data = { - version: 0.2, + version: 0.3, nodes: { echo: { agent: "echoAgent", diff --git a/tests/agents/test_map_agent.ts b/tests/agents/test_map_agent.ts index 39ff77ad6..06e5a3c01 100644 --- a/tests/agents/test_map_agent.ts +++ b/tests/agents/test_map_agent.ts @@ -9,14 +9,14 @@ test("test map_agent", async () => { ...defaultTestContext, agents: { mapAgent, stringTemplateAgent }, graphData: { - version: 0.2, + version: 0.3, nodes: { node2: { agent: "stringTemplateAgent", params: { template: "I love ${0}.", }, - inputs: ["$0.fruit"], + inputs: [":$0.fruit"], isResult: true, }, }, @@ -33,14 +33,14 @@ test("test map_agent 2", async () => { ...defaultTestContext, agents: { mapAgent, stringTemplateAgent }, graphData: { - version: 0.2, + version: 0.3, nodes: { node2: { agent: "stringTemplateAgent", params: { template: "I love ${0}.", }, - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -57,14 +57,14 @@ test("test map_agent 3", async () => { ...defaultTestContext, agents: { mapAgent, stringTemplateAgent }, graphData: { - version: 0.2, + version: 0.3, nodes: { node2: { agent: "stringTemplateAgent", params: { template: "${1} ${2} ${0}.", }, - inputs: ["$0", "$1", "$2"], + inputs: [":$0", ":$1", ":$2"], isResult: true, }, }, diff --git a/tests/agents/test_nest_agent.ts b/tests/agents/test_nest_agent.ts index 2f848eafd..7a599ee77 100644 --- a/tests/agents/test_nest_agent.ts +++ b/tests/agents/test_nest_agent.ts @@ -9,11 +9,11 @@ test("test nest agent", async () => { ...defaultTestContext, agents: { sleeperAgent }, graphData: { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "sleeperAgent", - inputs: ["$0", "$1", "$2"], + inputs: [":$0", ":$1", ":$2"], isResult: true, }, }, @@ -26,11 +26,11 @@ test("test nest agent", async () => { }); const dynamic_graph = { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "sleeperAgent", - inputs: ["$1", "$2", "$3"], + inputs: [":$1", ":$2", ":$3"], isResult: true, }, }, diff --git a/tests/graphai/test_inputs.ts b/tests/graphai/test_inputs.ts index 6a3d6d730..49cc4fad9 100644 --- a/tests/graphai/test_inputs.ts +++ b/tests/graphai/test_inputs.ts @@ -5,7 +5,7 @@ import test from "node:test"; import assert from "node:assert"; const graphdata_inputs = { - version: 0.2, + version: 0.3, nodes: { apple: { value: { fruits: { apple: "red" } }, @@ -15,7 +15,7 @@ const graphdata_inputs = { }, total: { agent: "sleeperAgent", - inputs: ["apple", "lemon", "apple.fruits", "lemon.fruits"], + inputs: [":apple", ":lemon", ":apple.fruits", ":lemon.fruits"], }, }, }; diff --git a/tests/graphai/test_loop.ts b/tests/graphai/test_loop.ts index a840373e0..5bc89a18b 100644 --- a/tests/graphai/test_loop.ts +++ b/tests/graphai/test_loop.ts @@ -6,14 +6,14 @@ import test from "node:test"; import assert from "node:assert"; const graphdata_push = { - version: 0.2, + version: 0.3, loop: { count: 10, }, nodes: { array: { value: [], - update: "reducer", + update: ":reducer", }, item: { agent: "sleeperAgent", @@ -25,7 +25,7 @@ const graphdata_push = { reducer: { isResult: true, agent: "pushAgent", - inputs: ["array", "item"], + inputs: [":array", ":item"], }, }, }; @@ -40,26 +40,26 @@ test("test loop & push", async () => { }); const graphdata_pop = { - version: 0.2, + version: 0.3, loop: { - while: "source", + while: ":source", }, nodes: { source: { value: ["orange", "banana", "lemon"], - update: "popper.array", + update: ":popper.array", }, result: { value: [], - update: "reducer", + update: ":reducer", }, popper: { - inputs: ["source"], + inputs: [":source"], agent: "popAgent", // returns { array, item } }, reducer: { agent: "pushAgent", - inputs: ["result", "popper.item"], + inputs: [":result", ":popper.item"], }, }, }; diff --git a/tests/graphai/test_loop_2.ts b/tests/graphai/test_loop_2.ts index 47630dce1..727d63235 100644 --- a/tests/graphai/test_loop_2.ts +++ b/tests/graphai/test_loop_2.ts @@ -6,18 +6,18 @@ import test from "node:test"; import assert from "node:assert"; const graphdata_counter = { - version: 0.2, + version: 0.3, loop: { count: 10, }, nodes: { data: { value: { v: 0 }, - update: "counter", + update: ":counter", }, counter: { agent: "counterAgent", - inputs: ["data"], + inputs: [":data"], isResult: true, }, }, @@ -36,14 +36,14 @@ test("test counter", async () => { test("test counter2", async () => { const nested_graphdata = { - version: 0.2, + version: 0.3, loop: { count: 10, }, nodes: { workingMemory: { value: {}, - update: "nested1.counter", // update data from nested1 data + update: ":nested1.counter", // update data from nested1 data }, nested1: { agent: "nestedAgent", @@ -52,7 +52,7 @@ test("test counter2", async () => { params: { injectionTo: ["data"], // inject workingMemory data to data node in graphdata_counter }, - inputs: ["workingMemory"], + inputs: [":workingMemory"], }, }, }; @@ -66,7 +66,7 @@ test("test counter2", async () => { test("test counter3", async () => { const nested_graphdata = { - version: 0.2, + version: 0.3, concurrency: 2, loop: { count: 10, @@ -74,16 +74,16 @@ test("test counter3", async () => { nodes: { workingMemory: { value: {}, - update: "merge", // update data from nested1 data + update: ":merge", // update data from nested1 data }, workingMemory2: { // HACK until we fix the bug (inputs:["workingMemory", "workingMemory"]) agent: "totalAgent", - inputs: ["workingMemory"], + inputs: [":workingMemory"], }, mapping: { agent: "mapAgent", - inputs: ["workingMemory", "workingMemory2"], + inputs: [":workingMemory", ":workingMemory2"], params: { injectionTo: ["data"], }, @@ -91,7 +91,7 @@ test("test counter3", async () => { }, merge: { agent: "totalAgent", - inputs: ["mapping.counter"], + inputs: [":mapping.counter"], }, }, }; diff --git a/tests/graphai/test_map.ts b/tests/graphai/test_map.ts index aff610d8f..356200c6e 100644 --- a/tests/graphai/test_map.ts +++ b/tests/graphai/test_map.ts @@ -5,23 +5,23 @@ import test from "node:test"; import assert from "node:assert"; const graphdata_push = { - version: 0.2, + version: 0.3, nodes: { source: { value: { fruits: ["apple", "orange", "banana", "lemon", "melon", "pineapple", "tomato"] }, }, nestedNode: { agent: "mapAgent", - inputs: ["source.fruits"], + inputs: [":source.fruits"], graph: { - version: 0.2, + version: 0.3, nodes: { node2: { agent: "stringTemplateAgent", params: { template: "I love ${0}.", }, - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -29,7 +29,7 @@ const graphdata_push = { }, result: { agent: "sleeperAgent", - inputs: ["nestedNode.node2"], + inputs: [":nestedNode.node2"], }, }, }; @@ -48,7 +48,7 @@ test("test map 1", async () => { }); const graphdata_map2 = { - version: 0.2, + version: 0.3, nodes: { source1: { value: { fruit: "apple" }, @@ -64,16 +64,16 @@ const graphdata_map2 = { }, nestedNode: { agent: "mapAgent", - inputs: ["source1.fruit", "source2.fruit", "source3.fruit", "source4.fruit"], + inputs: [":source1.fruit", ":source2.fruit", ":source3.fruit", ":source4.fruit"], graph: { - version: 0.2, + version: 0.3, nodes: { node2: { agent: "stringTemplateAgent", params: { template: "I love ${0}.", }, - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -81,7 +81,7 @@ const graphdata_map2 = { }, result: { agent: "sleeperAgent", - inputs: ["nestedNode.node2"], + inputs: [":nestedNode.node2"], }, }, }; @@ -93,20 +93,20 @@ test("test map 2", async () => { // nest graph and flat const graphdata_map3 = { - version: 0.2, + version: 0.3, nodes: { source1: { value: ["hello", "hello2"], }, nestedNode: { agent: "mapAgent", - inputs: ["source1"], + inputs: [":source1"], graph: { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "bypassAgent", - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -114,7 +114,7 @@ const graphdata_map3 = { }, result: { agent: "bypassAgent", - inputs: ["nestedNode.node1"], + inputs: [":nestedNode.node1"], }, }, }; @@ -125,20 +125,20 @@ test("test map 3", async () => { }); const graphdata_map4 = { - version: 0.2, + version: 0.3, nodes: { source1: { value: ["hello", "hello2"], }, nestedNode: { agent: "mapAgent", - inputs: ["source1"], + inputs: [":source1"], graph: { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "bypassAgent", - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -149,7 +149,7 @@ const graphdata_map4 = { params: { flat: 1, }, - inputs: ["nestedNode.node1"], + inputs: [":nestedNode.node1"], }, }, }; @@ -161,20 +161,20 @@ test("test map 4", async () => { }); const graphdata_map5 = { - version: 0.2, + version: 0.3, nodes: { source1: { value: ["hello", "hello2"], }, nestedNode: { agent: "mapAgent", - inputs: ["source1"], + inputs: [":source1"], graph: { - version: 0.2, + version: 0.3, nodes: { node1: { agent: "bypassAgent", - inputs: ["$0"], + inputs: [":$0"], isResult: true, }, }, @@ -185,7 +185,7 @@ const graphdata_map5 = { params: { flat: 2, }, - inputs: ["nestedNode.node1"], + inputs: [":nestedNode.node1"], }, }, }; diff --git a/tests/graphai/test_simple_dispatch.ts b/tests/graphai/test_simple_dispatch.ts index 0b076d13f..b8e2a260f 100644 --- a/tests/graphai/test_simple_dispatch.ts +++ b/tests/graphai/test_simple_dispatch.ts @@ -18,7 +18,7 @@ const dispatchAgentGenerator = (selectedNodeId: string) => { }; const dispatchGraph = { - version: 0.2, + version: 0.3, nodes: { select1: { agent: "dispatchAgent", @@ -31,18 +31,18 @@ const dispatchGraph = { params: { duration: 20, }, - inputs: ["select1.next", "select2.next"], + inputs: [":select1.next", ":select2.next"], anyInput: true, }, node: { agent: "mergeNodeIdAgent", }, merge: { - inputs: ["node", "ghost"], + inputs: [":node", ":ghost"], agent: "mergeNodeIdAgent", }, result: { - inputs: ["merge"], + inputs: [":merge"], agent: "mergeNodeIdAgent", }, }, @@ -75,7 +75,7 @@ test("test select 2", async () => { }); const dispatchGraph2 = { - version: 0.2, + version: 0.3, nodes: { select: { agent: "dispatchAgent", @@ -85,7 +85,7 @@ const dispatchGraph2 = { params: { duration: 20, }, - inputs: ["select.next1"], + inputs: [":select.next1"], anyInput: true, }, ghost2: { @@ -93,7 +93,7 @@ const dispatchGraph2 = { params: { duration: 20, }, - inputs: ["select.next2"], + inputs: [":select.next2"], anyInput: true, }, ghost3: { @@ -101,19 +101,19 @@ const dispatchGraph2 = { params: { duration: 20, }, - inputs: ["select.next3"], + inputs: [":select.next3"], anyInput: true, }, result1: { - inputs: ["ghost1"], + inputs: [":ghost1"], agent: "mergeNodeIdAgent", }, result2: { - inputs: ["ghost2"], + inputs: [":ghost2"], agent: "mergeNodeIdAgent", }, result3: { - inputs: ["ghost3"], + inputs: [":ghost3"], agent: "mergeNodeIdAgent", }, }, diff --git a/tests/graphai/test_streamer.ts b/tests/graphai/test_streamer.ts index 0a524a173..22248750b 100644 --- a/tests/graphai/test_streamer.ts +++ b/tests/graphai/test_streamer.ts @@ -30,7 +30,7 @@ class WordStreamer { const theMessage = "May the force be with you."; const graphdata_any = { - version: 0.2, + version: 0.3, nodes: { message: { value: theMessage, @@ -39,7 +39,7 @@ const graphdata_any = { agent: (message: string) => { return new WordStreamer(message); }, - inputs: ["message"], + inputs: [":message"], }, destination: { agent: (streamer: WordStreamer) => { @@ -56,7 +56,7 @@ const graphdata_any = { }); }, isResult: true, - inputs: ["source"], + inputs: [":source"], }, }, }; diff --git a/tests/graphai/test_validator_computed_node.ts b/tests/graphai/test_validator_computed_node.ts index 5a451312f..c8fc8c25f 100644 --- a/tests/graphai/test_validator_computed_node.ts +++ b/tests/graphai/test_validator_computed_node.ts @@ -5,7 +5,7 @@ import test from "node:test"; test("test computed node validation value", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { computed1: { value: {}, @@ -18,7 +18,7 @@ test("test computed node validation value", async () => { test("test static node validation value", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { computed1: { update: "", diff --git a/tests/graphai/test_validator_inputs.ts b/tests/graphai/test_validator_inputs.ts index 314ebbfae..336797dcc 100644 --- a/tests/graphai/test_validator_inputs.ts +++ b/tests/graphai/test_validator_inputs.ts @@ -5,14 +5,14 @@ import test from "node:test"; test("test computed node validation value", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { computed1: { agent: "echoAgent", }, computed2: { agent: "echoAgent", - inputs: ["dummy"], + inputs: [":dummy"], }, }, }); @@ -21,15 +21,15 @@ test("test computed node validation value", async () => { test("test computed node validation value", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { computed1: { agent: "echoAgent", - inputs: ["computed2"], + inputs: [":computed2"], }, computed2: { agent: "echoAgent", - inputs: ["computed1"], + inputs: [":computed1"], }, }, }); @@ -38,15 +38,15 @@ test("test computed node validation value", async () => { test("test no initial running node", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { computed1: { agent: "echoAgent", - inputs: ["computed2"], + inputs: [":computed2"], }, computed2: { agent: "echoAgent", - inputs: ["computed1"], + inputs: [":computed1"], }, }, }); @@ -55,18 +55,18 @@ test("test no initial running node", async () => { test("test closed loop validation", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { computed1: { agent: "echoAgent", }, computed2: { agent: "echoAgent", - inputs: ["computed1"], + inputs: [":computed1"], }, computed3: { agent: "echoAgent", - inputs: ["computed3"], + inputs: [":computed3"], }, }, }); diff --git a/tests/graphai/test_validator_nodes.ts b/tests/graphai/test_validator_nodes.ts index 29b3f0ecd..1ee060821 100644 --- a/tests/graphai/test_validator_nodes.ts +++ b/tests/graphai/test_validator_nodes.ts @@ -10,7 +10,7 @@ test("test validation no data", async () => { test("test validation nodes is array", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: [], }); await rejectTest(graph_data, "Invalid Graph Data: nodes must be object"); @@ -18,7 +18,7 @@ test("test validation nodes is array", async () => { test("test validation nodes is empty", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: {}, }); await rejectTest(graph_data, "Invalid Graph Data: nodes is empty"); @@ -26,7 +26,7 @@ test("test validation nodes is empty", async () => { test("test validation nodes is not object", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: "123", }); await rejectTest(graph_data, "Invalid Graph Data: invalid nodes"); @@ -34,7 +34,7 @@ test("test validation nodes is not object", async () => { test("test validation invalid agent", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { invalidAgent: { agent: "NonExistAgent", @@ -46,7 +46,7 @@ test("test validation invalid agent", async () => { test("test validation invalid agent", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { nodeTest: {}, }, @@ -56,7 +56,7 @@ test("test validation invalid agent", async () => { test("test validation invalid agent", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { nodeTest: { value: {}, diff --git a/tests/graphai/test_validator_static_node.ts b/tests/graphai/test_validator_static_node.ts index 85dc8777b..d07100eef 100644 --- a/tests/graphai/test_validator_static_node.ts +++ b/tests/graphai/test_validator_static_node.ts @@ -5,7 +5,7 @@ import test from "node:test"; test("test static node validation inputs", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, @@ -18,7 +18,7 @@ test("test static node validation inputs", async () => { test("test static node validation anyInput", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, @@ -31,7 +31,7 @@ test("test static node validation anyInput", async () => { test("test static node validation params", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, @@ -44,7 +44,7 @@ test("test static node validation params", async () => { test("test static node validation retry", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, @@ -57,7 +57,7 @@ test("test static node validation retry", async () => { test("test static node validation timeout", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, @@ -70,32 +70,32 @@ test("test static node validation timeout", async () => { test("test static node validation update", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, - update: "unknown", + update: ":unknown", }, computed1: { agent: "echoAgent", }, }, }); - await rejectTest(graph_data, "Update not match: NodeId static1, update: unknown"); + await rejectTest(graph_data, "Update not match: NodeId static1, update: :unknown"); }); test("test static node validation update", async () => { const graph_data = anonymization({ - version: 0.2, + version: 0.3, nodes: { static1: { value: {}, - update: "unknown.param1", + update: ":unknown.param1", }, computed1: { agent: "echoAgent", }, }, }); - await rejectTest(graph_data, "Update not match: NodeId static1, update: unknown.param1"); + await rejectTest(graph_data, "Update not match: NodeId static1, update: :unknown.param1"); });