mcpgraph 0.1.5 → 0.1.7
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 -0
- package/dist/api.d.ts +17 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +33 -4
- package/dist/api.js.map +1 -1
- package/dist/execution/context.d.ts +3 -6
- package/dist/execution/context.d.ts.map +1 -1
- package/dist/execution/context.js +11 -2
- package/dist/execution/context.js.map +1 -1
- package/dist/execution/controller.d.ts +29 -0
- package/dist/execution/controller.d.ts.map +1 -0
- package/dist/execution/controller.js +95 -0
- package/dist/execution/controller.js.map +1 -0
- package/dist/execution/executor.d.ts +8 -1
- package/dist/execution/executor.d.ts.map +1 -1
- package/dist/execution/executor.js +184 -37
- package/dist/execution/executor.js.map +1 -1
- package/dist/execution/nodes/entry-executor.d.ts +1 -1
- package/dist/execution/nodes/entry-executor.d.ts.map +1 -1
- package/dist/execution/nodes/entry-executor.js +3 -2
- package/dist/execution/nodes/entry-executor.js.map +1 -1
- package/dist/execution/nodes/exit-executor.d.ts +1 -1
- package/dist/execution/nodes/exit-executor.d.ts.map +1 -1
- package/dist/execution/nodes/exit-executor.js +3 -2
- package/dist/execution/nodes/exit-executor.js.map +1 -1
- package/dist/execution/nodes/mcp-tool-executor.d.ts +1 -1
- package/dist/execution/nodes/mcp-tool-executor.d.ts.map +1 -1
- package/dist/execution/nodes/mcp-tool-executor.js +3 -2
- package/dist/execution/nodes/mcp-tool-executor.js.map +1 -1
- package/dist/execution/nodes/switch-executor.d.ts +1 -1
- package/dist/execution/nodes/switch-executor.d.ts.map +1 -1
- package/dist/execution/nodes/switch-executor.js +7 -2
- package/dist/execution/nodes/switch-executor.js.map +1 -1
- package/dist/execution/nodes/transform-executor.d.ts +1 -1
- package/dist/execution/nodes/transform-executor.d.ts.map +1 -1
- package/dist/execution/nodes/transform-executor.js +3 -2
- package/dist/execution/nodes/transform-executor.js.map +1 -1
- package/dist/types/execution.d.ts +92 -0
- package/dist/types/execution.d.ts.map +1 -0
- package/dist/types/execution.js +5 -0
- package/dist/types/execution.js.map +1 -0
- package/docs/design.md +220 -0
- package/docs/implementation.md +377 -0
- package/docs/introspection-debugging.md +651 -0
- package/examples/api-usage.ts +49 -1
- package/examples/switch_example.yaml +80 -0
- package/package.json +2 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
version: "1.0"
|
|
2
|
+
|
|
3
|
+
# MCP Server Metadata
|
|
4
|
+
server:
|
|
5
|
+
name: "switchExample"
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
description: "Example demonstrating switch node functionality"
|
|
8
|
+
|
|
9
|
+
# Tool Definitions
|
|
10
|
+
tools:
|
|
11
|
+
- name: "test_switch"
|
|
12
|
+
description: "Test switch node with conditional routing"
|
|
13
|
+
inputSchema:
|
|
14
|
+
type: "object"
|
|
15
|
+
properties:
|
|
16
|
+
value:
|
|
17
|
+
type: "number"
|
|
18
|
+
description: "A numeric value to route based on"
|
|
19
|
+
required:
|
|
20
|
+
- value
|
|
21
|
+
outputSchema:
|
|
22
|
+
type: "object"
|
|
23
|
+
properties:
|
|
24
|
+
result:
|
|
25
|
+
type: "string"
|
|
26
|
+
description: "The routing result"
|
|
27
|
+
|
|
28
|
+
# Graph Nodes
|
|
29
|
+
nodes:
|
|
30
|
+
# Entry node: Receives tool arguments
|
|
31
|
+
- id: "entry"
|
|
32
|
+
type: "entry"
|
|
33
|
+
tool: "test_switch"
|
|
34
|
+
next: "switch_node"
|
|
35
|
+
|
|
36
|
+
# Switch node: Routes based on value
|
|
37
|
+
- id: "switch_node"
|
|
38
|
+
type: "switch"
|
|
39
|
+
conditions:
|
|
40
|
+
- rule:
|
|
41
|
+
">":
|
|
42
|
+
- { var: "value" }
|
|
43
|
+
- 10
|
|
44
|
+
target: "high_path"
|
|
45
|
+
- rule:
|
|
46
|
+
">":
|
|
47
|
+
- { var: "value" }
|
|
48
|
+
- 0
|
|
49
|
+
target: "low_path"
|
|
50
|
+
- target: "zero_path"
|
|
51
|
+
|
|
52
|
+
# High path (> 10)
|
|
53
|
+
- id: "high_path"
|
|
54
|
+
type: "transform"
|
|
55
|
+
transform:
|
|
56
|
+
expr: |
|
|
57
|
+
{ "result": "high" }
|
|
58
|
+
next: "exit"
|
|
59
|
+
|
|
60
|
+
# Low path (> 0 but <= 10)
|
|
61
|
+
- id: "low_path"
|
|
62
|
+
type: "transform"
|
|
63
|
+
transform:
|
|
64
|
+
expr: |
|
|
65
|
+
{ "result": "low" }
|
|
66
|
+
next: "exit"
|
|
67
|
+
|
|
68
|
+
# Zero/negative path (default)
|
|
69
|
+
- id: "zero_path"
|
|
70
|
+
type: "transform"
|
|
71
|
+
transform:
|
|
72
|
+
expr: |
|
|
73
|
+
{ "result": "zero_or_negative" }
|
|
74
|
+
next: "exit"
|
|
75
|
+
|
|
76
|
+
# Exit node: Returns the result
|
|
77
|
+
- id: "exit"
|
|
78
|
+
type: "exit"
|
|
79
|
+
tool: "test_switch"
|
|
80
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpgraph",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "MCP server that executes directed graphs of MCP server calls",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
18
18
|
"examples",
|
|
19
|
+
"docs",
|
|
19
20
|
"README.md",
|
|
20
21
|
"LICENSE"
|
|
21
22
|
],
|