@runtypelabs/react-flow 0.4.3 → 1.0.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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +146 -0
- package/dist/index.js +2 -4
- package/dist/index.mjs +2 -4
- package/example/CHANGELOG.md +163 -0
- package/example/node_modules/.bin/vite +2 -2
- package/example/package.json +5 -4
- package/example/src/App.tsx +30 -7
- package/package.json +4 -3
- package/src/components/RuntypeFlowEditor.tsx +10 -4
- package/src/components/nodes/BaseNode.tsx +2 -2
- package/src/flow-step-types.ts +0 -2
- package/src/utils/adapter.ts +0 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,7 +7,7 @@ $ tsup
|
|
|
7
7
|
[34mCLI[39m Cleaning output folder
|
|
8
8
|
[34mCJS[39m Build start
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
10
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m101.48 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 285ms
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m105.53 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 288ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,151 @@
|
|
|
1
1
|
# @runtypelabs/react-flow
|
|
2
2
|
|
|
3
|
+
## 1.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [843b702]
|
|
8
|
+
- @runtypelabs/sdk@6.1.4
|
|
9
|
+
|
|
10
|
+
## 1.0.6
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [1acada7]
|
|
15
|
+
- Updated dependencies [db2cf06]
|
|
16
|
+
- @runtypelabs/sdk@6.1.3
|
|
17
|
+
|
|
18
|
+
## 1.0.5
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [158223e]
|
|
23
|
+
- Updated dependencies [3abba4d]
|
|
24
|
+
- @runtypelabs/sdk@6.1.2
|
|
25
|
+
|
|
26
|
+
## 1.0.4
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [40cb003]
|
|
31
|
+
- @runtypelabs/sdk@6.1.1
|
|
32
|
+
|
|
33
|
+
## 1.0.3
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [c26556c]
|
|
38
|
+
- Updated dependencies [cfacf11]
|
|
39
|
+
- Updated dependencies [2c315c5]
|
|
40
|
+
- Updated dependencies [644e057]
|
|
41
|
+
- Updated dependencies [cd1133f]
|
|
42
|
+
- @runtypelabs/sdk@6.1.0
|
|
43
|
+
|
|
44
|
+
## 1.0.2
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Updated dependencies [a948051]
|
|
49
|
+
- @runtypelabs/sdk@6.0.2
|
|
50
|
+
|
|
51
|
+
## 1.0.1
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [4b4bbe9]
|
|
56
|
+
- Updated dependencies [9a3dd1a]
|
|
57
|
+
- Updated dependencies [aab02e1]
|
|
58
|
+
- Updated dependencies [ebb401b]
|
|
59
|
+
- @runtypelabs/sdk@6.0.1
|
|
60
|
+
|
|
61
|
+
## 1.0.0
|
|
62
|
+
|
|
63
|
+
### Major Changes
|
|
64
|
+
|
|
65
|
+
- 51ab2d1: Remove the `fetch-github` flow step from validation, execution, SDKs, generated schemas, and dashboard surfaces. The step was never surfaced in the UI, ignored half of its own config fields, and depended on an external repomix ingestor service. Use `api-call` for single GitHub API requests, `transform-data` with a container sandbox (`daytona` / `runtype-sandbox`) to clone and work on repositories, or the GitHub MCP server for agent-driven GitHub work.
|
|
66
|
+
- a27eea9: Remove the non-functional `send-text` flow step from validation, SDKs, generated schemas, and dashboard surfaces.
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- 5cff576: Enforce full-workspace ESLint coverage for published TypeScript packages.
|
|
71
|
+
- Updated dependencies [5cff576]
|
|
72
|
+
- Updated dependencies [51ab2d1]
|
|
73
|
+
- Updated dependencies [a27eea9]
|
|
74
|
+
- Updated dependencies [5f08625]
|
|
75
|
+
- Updated dependencies [9ab9197]
|
|
76
|
+
- @runtypelabs/sdk@6.0.0
|
|
77
|
+
|
|
78
|
+
## 0.4.12
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [6aac451]
|
|
83
|
+
- @runtypelabs/sdk@5.15.0
|
|
84
|
+
|
|
85
|
+
## 0.4.11
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [29ce53f]
|
|
90
|
+
- Updated dependencies [5d828d9]
|
|
91
|
+
- @runtypelabs/sdk@5.14.3
|
|
92
|
+
|
|
93
|
+
## 0.4.10
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Updated dependencies [b00dea7]
|
|
98
|
+
- @runtypelabs/sdk@5.14.2
|
|
99
|
+
|
|
100
|
+
## 0.4.9
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [0d4b1b8]
|
|
105
|
+
- @runtypelabs/sdk@5.14.1
|
|
106
|
+
|
|
107
|
+
## 0.4.8
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- Updated dependencies [facb5d9]
|
|
112
|
+
- @runtypelabs/sdk@5.14.0
|
|
113
|
+
|
|
114
|
+
## 0.4.7
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- Updated dependencies [89dbb72]
|
|
119
|
+
- @runtypelabs/sdk@5.13.0
|
|
120
|
+
|
|
121
|
+
## 0.4.6
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- Updated dependencies [b2badd2]
|
|
126
|
+
- @runtypelabs/sdk@5.12.1
|
|
127
|
+
|
|
128
|
+
## 0.4.5
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- Updated dependencies [2821ddb]
|
|
133
|
+
- Updated dependencies [9a527cd]
|
|
134
|
+
- Updated dependencies [ec895c9]
|
|
135
|
+
- @runtypelabs/sdk@5.12.0
|
|
136
|
+
|
|
137
|
+
## 0.4.4
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- Updated dependencies [8f998e7]
|
|
142
|
+
- Updated dependencies [e6b97e1]
|
|
143
|
+
- Updated dependencies [e88000e]
|
|
144
|
+
- Updated dependencies [3ac490c]
|
|
145
|
+
- Updated dependencies [9a47ef1]
|
|
146
|
+
- Updated dependencies [d7780b7]
|
|
147
|
+
- @runtypelabs/sdk@5.11.0
|
|
148
|
+
|
|
3
149
|
## 0.4.3
|
|
4
150
|
|
|
5
151
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -302,14 +302,12 @@ function getDefaultStepName(type) {
|
|
|
302
302
|
"retrieve-record": "Retrieve Record",
|
|
303
303
|
"get-record": "Get Record",
|
|
304
304
|
"list-records": "List Records",
|
|
305
|
-
"fetch-github": "Fetch GitHub",
|
|
306
305
|
"api-call": "API Call",
|
|
307
306
|
"transform-data": "Transform Data",
|
|
308
307
|
conditional: "Conditional",
|
|
309
308
|
"set-variable": "Set Variable",
|
|
310
309
|
"upsert-record": "Upsert Record",
|
|
311
310
|
"send-email": "Send Email",
|
|
312
|
-
"send-text": "Send Text",
|
|
313
311
|
"send-event": "Send Event",
|
|
314
312
|
"send-stream": "Send Stream",
|
|
315
313
|
"update-record": "Update Record",
|
|
@@ -1249,7 +1247,7 @@ var BaseNode = react.memo(function BaseNode2({
|
|
|
1249
1247
|
additionalSourceHandles,
|
|
1250
1248
|
children
|
|
1251
1249
|
}) {
|
|
1252
|
-
const { step,
|
|
1250
|
+
const { step, onDelete } = data;
|
|
1253
1251
|
const color = headerColor || NODE_HEADER_COLORS[step.type] || NODE_HEADER_COLORS.default;
|
|
1254
1252
|
const handleDelete = (e) => {
|
|
1255
1253
|
e.stopPropagation();
|
|
@@ -3027,7 +3025,7 @@ function RuntypeFlowEditor({
|
|
|
3027
3025
|
className
|
|
3028
3026
|
}) {
|
|
3029
3027
|
const [showAddMenu, setShowAddMenu] = react.useState(false);
|
|
3030
|
-
const [
|
|
3028
|
+
const [, setSelectedNode] = react.useState(null);
|
|
3031
3029
|
const {
|
|
3032
3030
|
nodes,
|
|
3033
3031
|
edges,
|
package/dist/index.mjs
CHANGED
|
@@ -300,14 +300,12 @@ function getDefaultStepName(type) {
|
|
|
300
300
|
"retrieve-record": "Retrieve Record",
|
|
301
301
|
"get-record": "Get Record",
|
|
302
302
|
"list-records": "List Records",
|
|
303
|
-
"fetch-github": "Fetch GitHub",
|
|
304
303
|
"api-call": "API Call",
|
|
305
304
|
"transform-data": "Transform Data",
|
|
306
305
|
conditional: "Conditional",
|
|
307
306
|
"set-variable": "Set Variable",
|
|
308
307
|
"upsert-record": "Upsert Record",
|
|
309
308
|
"send-email": "Send Email",
|
|
310
|
-
"send-text": "Send Text",
|
|
311
309
|
"send-event": "Send Event",
|
|
312
310
|
"send-stream": "Send Stream",
|
|
313
311
|
"update-record": "Update Record",
|
|
@@ -1247,7 +1245,7 @@ var BaseNode = memo(function BaseNode2({
|
|
|
1247
1245
|
additionalSourceHandles,
|
|
1248
1246
|
children
|
|
1249
1247
|
}) {
|
|
1250
|
-
const { step,
|
|
1248
|
+
const { step, onDelete } = data;
|
|
1251
1249
|
const color = headerColor || NODE_HEADER_COLORS[step.type] || NODE_HEADER_COLORS.default;
|
|
1252
1250
|
const handleDelete = (e) => {
|
|
1253
1251
|
e.stopPropagation();
|
|
@@ -3025,7 +3023,7 @@ function RuntypeFlowEditor({
|
|
|
3025
3023
|
className
|
|
3026
3024
|
}) {
|
|
3027
3025
|
const [showAddMenu, setShowAddMenu] = useState(false);
|
|
3028
|
-
const [
|
|
3026
|
+
const [, setSelectedNode] = useState(null);
|
|
3029
3027
|
const {
|
|
3030
3028
|
nodes,
|
|
3031
3029
|
edges,
|
package/example/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,168 @@
|
|
|
1
1
|
# @runtypelabs/react-flow-example
|
|
2
2
|
|
|
3
|
+
## 0.0.133
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [843b702]
|
|
8
|
+
- @runtypelabs/sdk@6.1.4
|
|
9
|
+
- @runtypelabs/react-flow@1.0.7
|
|
10
|
+
|
|
11
|
+
## 0.0.132
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [1acada7]
|
|
16
|
+
- Updated dependencies [db2cf06]
|
|
17
|
+
- @runtypelabs/sdk@6.1.3
|
|
18
|
+
- @runtypelabs/react-flow@1.0.6
|
|
19
|
+
|
|
20
|
+
## 0.0.131
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [158223e]
|
|
25
|
+
- Updated dependencies [3abba4d]
|
|
26
|
+
- @runtypelabs/sdk@6.1.2
|
|
27
|
+
- @runtypelabs/react-flow@1.0.5
|
|
28
|
+
|
|
29
|
+
## 0.0.130
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [40cb003]
|
|
34
|
+
- @runtypelabs/sdk@6.1.1
|
|
35
|
+
- @runtypelabs/react-flow@1.0.4
|
|
36
|
+
|
|
37
|
+
## 0.0.129
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [c26556c]
|
|
42
|
+
- Updated dependencies [cfacf11]
|
|
43
|
+
- Updated dependencies [2c315c5]
|
|
44
|
+
- Updated dependencies [644e057]
|
|
45
|
+
- Updated dependencies [cd1133f]
|
|
46
|
+
- @runtypelabs/sdk@6.1.0
|
|
47
|
+
- @runtypelabs/react-flow@1.0.3
|
|
48
|
+
|
|
49
|
+
## 0.0.128
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [a948051]
|
|
54
|
+
- @runtypelabs/sdk@6.0.2
|
|
55
|
+
- @runtypelabs/react-flow@1.0.2
|
|
56
|
+
|
|
57
|
+
## 0.0.127
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [4b4bbe9]
|
|
62
|
+
- Updated dependencies [9a3dd1a]
|
|
63
|
+
- Updated dependencies [aab02e1]
|
|
64
|
+
- Updated dependencies [ebb401b]
|
|
65
|
+
- @runtypelabs/sdk@6.0.1
|
|
66
|
+
- @runtypelabs/react-flow@1.0.1
|
|
67
|
+
|
|
68
|
+
## 0.0.126
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- Updated dependencies [5cff576]
|
|
73
|
+
- Updated dependencies [51ab2d1]
|
|
74
|
+
- Updated dependencies [a27eea9]
|
|
75
|
+
- Updated dependencies [5f08625]
|
|
76
|
+
- Updated dependencies [9ab9197]
|
|
77
|
+
- @runtypelabs/sdk@6.0.0
|
|
78
|
+
- @runtypelabs/react-flow@1.0.0
|
|
79
|
+
|
|
80
|
+
## 0.0.125
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- Updated dependencies [6aac451]
|
|
85
|
+
- @runtypelabs/sdk@5.15.0
|
|
86
|
+
- @runtypelabs/react-flow@0.4.12
|
|
87
|
+
|
|
88
|
+
## 0.0.124
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- a446883: Upgrade internal Vite apps (admin-portal, starting-gun, usage-stats, react-flow example) to Vite 8.1 (Rolldown), renaming `build.rollupOptions` to `build.rolldownOptions` and bumping `@vitejs/plugin-react` to v6 in the react-flow example.
|
|
93
|
+
|
|
94
|
+
## 0.0.123
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [29ce53f]
|
|
99
|
+
- Updated dependencies [5d828d9]
|
|
100
|
+
- @runtypelabs/sdk@5.14.3
|
|
101
|
+
- @runtypelabs/react-flow@0.4.11
|
|
102
|
+
|
|
103
|
+
## 0.0.122
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [b00dea7]
|
|
108
|
+
- @runtypelabs/sdk@5.14.2
|
|
109
|
+
- @runtypelabs/react-flow@0.4.10
|
|
110
|
+
|
|
111
|
+
## 0.0.121
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Updated dependencies [0d4b1b8]
|
|
116
|
+
- @runtypelabs/sdk@5.14.1
|
|
117
|
+
- @runtypelabs/react-flow@0.4.9
|
|
118
|
+
|
|
119
|
+
## 0.0.120
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- Updated dependencies [facb5d9]
|
|
124
|
+
- @runtypelabs/sdk@5.14.0
|
|
125
|
+
- @runtypelabs/react-flow@0.4.8
|
|
126
|
+
|
|
127
|
+
## 0.0.119
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- Updated dependencies [89dbb72]
|
|
132
|
+
- @runtypelabs/sdk@5.13.0
|
|
133
|
+
- @runtypelabs/react-flow@0.4.7
|
|
134
|
+
|
|
135
|
+
## 0.0.118
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- Updated dependencies [b2badd2]
|
|
140
|
+
- @runtypelabs/sdk@5.12.1
|
|
141
|
+
- @runtypelabs/react-flow@0.4.6
|
|
142
|
+
|
|
143
|
+
## 0.0.117
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [2821ddb]
|
|
148
|
+
- Updated dependencies [9a527cd]
|
|
149
|
+
- Updated dependencies [ec895c9]
|
|
150
|
+
- @runtypelabs/sdk@5.12.0
|
|
151
|
+
- @runtypelabs/react-flow@0.4.5
|
|
152
|
+
|
|
153
|
+
## 0.0.116
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Updated dependencies [8f998e7]
|
|
158
|
+
- Updated dependencies [e6b97e1]
|
|
159
|
+
- Updated dependencies [e88000e]
|
|
160
|
+
- Updated dependencies [3ac490c]
|
|
161
|
+
- Updated dependencies [9a47ef1]
|
|
162
|
+
- Updated dependencies [d7780b7]
|
|
163
|
+
- @runtypelabs/sdk@5.11.0
|
|
164
|
+
- @runtypelabs/react-flow@0.4.4
|
|
165
|
+
|
|
3
166
|
## 0.0.115
|
|
4
167
|
|
|
5
168
|
### Patch Changes
|
|
@@ -25,9 +25,9 @@ case `uname -a` in
|
|
|
25
25
|
esac
|
|
26
26
|
|
|
27
27
|
if [ -z "$NODE_PATH" ]; then
|
|
28
|
-
export NODE_PATH="/home/runner/_work/core/core/node_modules/.pnpm/vite@
|
|
28
|
+
export NODE_PATH="/home/runner/_work/core/core/node_modules/.pnpm/vite@8.1.4_@types+node@26.1.1_esbuild@0.28.1_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/_work/core/core/node_modules/.pnpm/vite@8.1.4_@types+node@26.1.1_esbuild@0.28.1_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules:/home/runner/_work/core/core/node_modules/.pnpm/node_modules"
|
|
29
29
|
else
|
|
30
|
-
export NODE_PATH="/home/runner/_work/core/core/node_modules/.pnpm/vite@
|
|
30
|
+
export NODE_PATH="/home/runner/_work/core/core/node_modules/.pnpm/vite@8.1.4_@types+node@26.1.1_esbuild@0.28.1_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/node_modules:/home/runner/_work/core/core/node_modules/.pnpm/vite@8.1.4_@types+node@26.1.1_esbuild@0.28.1_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules:/home/runner/_work/core/core/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
31
31
|
fi
|
|
32
32
|
if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then
|
|
33
33
|
exec "$basedir/node.exe" "$basedir_win/../vite/bin/vite.js" "$@"
|
package/example/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/react-flow-example",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.133",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
8
|
"build": "vite build",
|
|
9
|
-
"preview": "vite preview"
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"lint": "eslint ."
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"@runtypelabs/sdk": "workspace:*",
|
|
@@ -18,8 +19,8 @@
|
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@types/react": "^19.2.14",
|
|
20
21
|
"@types/react-dom": "^18.3.0",
|
|
21
|
-
"@vitejs/plugin-react": "^
|
|
22
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
22
23
|
"typescript": "^6.0.3",
|
|
23
|
-
"vite": "^
|
|
24
|
+
"vite": "^8.1.4"
|
|
24
25
|
}
|
|
25
26
|
}
|
package/example/src/App.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useCallback, useMemo
|
|
1
|
+
import React, { useState, useCallback, useMemo } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
ReactFlow,
|
|
4
4
|
Controls,
|
|
@@ -52,6 +52,12 @@ interface FlowWithSteps extends Flow {
|
|
|
52
52
|
steps: FlowStep[]
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
interface FlowApiData extends Partial<Flow> {
|
|
56
|
+
flow_steps?: FlowStep[]
|
|
57
|
+
flowSteps?: FlowStep[]
|
|
58
|
+
[key: string]: unknown
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
// ============================================================================
|
|
56
62
|
// Flow Execution Types
|
|
57
63
|
// ============================================================================
|
|
@@ -62,11 +68,28 @@ interface StepProgress {
|
|
|
62
68
|
index: number
|
|
63
69
|
status: 'pending' | 'running' | 'completed' | 'failed'
|
|
64
70
|
streamingText?: string
|
|
65
|
-
result?:
|
|
71
|
+
result?: unknown
|
|
66
72
|
error?: string
|
|
67
73
|
executionTime?: number
|
|
68
74
|
}
|
|
69
75
|
|
|
76
|
+
interface FlowSSEEvent {
|
|
77
|
+
type: string
|
|
78
|
+
flowId?: string
|
|
79
|
+
totalSteps?: number
|
|
80
|
+
index?: number
|
|
81
|
+
id?: string
|
|
82
|
+
name?: string
|
|
83
|
+
text?: string
|
|
84
|
+
content?: string
|
|
85
|
+
output?: { message?: string; [key: string]: unknown }
|
|
86
|
+
result?: unknown
|
|
87
|
+
executionTime?: number
|
|
88
|
+
error?: string
|
|
89
|
+
success?: boolean
|
|
90
|
+
duration?: number
|
|
91
|
+
}
|
|
92
|
+
|
|
70
93
|
interface FlowProgress {
|
|
71
94
|
flowId: string
|
|
72
95
|
flowName: string
|
|
@@ -336,7 +359,7 @@ console.log(response)`}</pre>
|
|
|
336
359
|
) : (
|
|
337
360
|
<>
|
|
338
361
|
<p style={descriptionStyle}>Individual step configurations in the flow:</p>
|
|
339
|
-
{steps.map((step
|
|
362
|
+
{steps.map((step) => (
|
|
340
363
|
<div key={step.id} style={stepCardStyle}>
|
|
341
364
|
<div style={stepHeaderStyle}>
|
|
342
365
|
<span style={stepBadgeStyle(step.type)}>{step.type}</span>
|
|
@@ -484,7 +507,7 @@ function ExecutionPanel({
|
|
|
484
507
|
|
|
485
508
|
{/* Steps List */}
|
|
486
509
|
<div style={{ marginTop: '16px' }}>
|
|
487
|
-
{flowProgress?.steps.map((step
|
|
510
|
+
{flowProgress?.steps.map((step) => (
|
|
488
511
|
<div key={step.id} style={executionStepStyle}>
|
|
489
512
|
<div style={executionStepHeaderStyle}>
|
|
490
513
|
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
@@ -598,11 +621,11 @@ function FlowBrowserPanel({ isOpen, onClose, onLoadFlow }: FlowBrowserPanelProps
|
|
|
598
621
|
if (!flowResponse.ok) {
|
|
599
622
|
throw new Error(`Failed to fetch flow: ${flowResponse.status}`)
|
|
600
623
|
}
|
|
601
|
-
const flowData = await flowResponse.json()
|
|
624
|
+
const flowData = (await flowResponse.json()) as FlowApiData
|
|
602
625
|
|
|
603
626
|
// Use flow steps from the flow response (consolidated endpoint)
|
|
604
627
|
const stepsArray = flowData.flow_steps || flowData.flowSteps || []
|
|
605
|
-
const steps: FlowStep[] = stepsArray.map((step
|
|
628
|
+
const steps: FlowStep[] = stepsArray.map((step) => ({
|
|
606
629
|
id: step.id,
|
|
607
630
|
type: step.type,
|
|
608
631
|
name: step.name,
|
|
@@ -1038,7 +1061,7 @@ export default function App() {
|
|
|
1038
1061
|
}, [currentSteps, flowName])
|
|
1039
1062
|
|
|
1040
1063
|
// Handle SSE events from the streaming response
|
|
1041
|
-
const handleSSEEvent = useCallback((data:
|
|
1064
|
+
const handleSSEEvent = useCallback((data: FlowSSEEvent) => {
|
|
1042
1065
|
switch (data.type) {
|
|
1043
1066
|
case 'flow_start':
|
|
1044
1067
|
setFlowProgress((prev) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/react-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "React Flow adapter for building visual flow editors with Runtype",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"*.css"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@runtypelabs/sdk": "
|
|
19
|
+
"@runtypelabs/sdk": "6.1.4"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@xyflow/react": "^12.0.0",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"build": "tsup",
|
|
60
60
|
"dev": "tsup --watch",
|
|
61
61
|
"clean": "rm -rf dist",
|
|
62
|
-
"typecheck": "tsgo --noEmit --skipLibCheck"
|
|
62
|
+
"typecheck": "tsgo --noEmit --skipLibCheck",
|
|
63
|
+
"lint": "eslint ."
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useState } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
ReactFlow,
|
|
4
4
|
Controls,
|
|
@@ -10,7 +10,13 @@ import {
|
|
|
10
10
|
ConnectionLineType,
|
|
11
11
|
} from '@xyflow/react'
|
|
12
12
|
|
|
13
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
RuntypeFlowEditorProps,
|
|
15
|
+
RuntypeNode,
|
|
16
|
+
RuntypeNodeData,
|
|
17
|
+
FlowStep,
|
|
18
|
+
SupportedNodeType,
|
|
19
|
+
} from '../types'
|
|
14
20
|
import { useRuntypeFlow } from '../hooks/useRuntypeFlow'
|
|
15
21
|
import { useFlowValidation } from '../hooks/useFlowValidation'
|
|
16
22
|
import { PromptNode } from './nodes/PromptNode'
|
|
@@ -163,7 +169,7 @@ function DefaultNode(props: {
|
|
|
163
169
|
|
|
164
170
|
return (
|
|
165
171
|
<BaseNode
|
|
166
|
-
data={data as
|
|
172
|
+
data={data as unknown as RuntypeNodeData}
|
|
167
173
|
selected={selected}
|
|
168
174
|
id={id}
|
|
169
175
|
typeLabel={data.step.type}
|
|
@@ -237,7 +243,7 @@ export function RuntypeFlowEditor({
|
|
|
237
243
|
className,
|
|
238
244
|
}: RuntypeFlowEditorProps) {
|
|
239
245
|
const [showAddMenu, setShowAddMenu] = useState(false)
|
|
240
|
-
const [
|
|
246
|
+
const [, setSelectedNode] = useState<RuntypeNode | null>(null)
|
|
241
247
|
|
|
242
248
|
// Initialize flow hook
|
|
243
249
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react'
|
|
2
2
|
import { Handle, Position } from '@xyflow/react'
|
|
3
|
-
import type { RuntypeNodeData
|
|
3
|
+
import type { RuntypeNodeData } from '../../types'
|
|
4
4
|
|
|
5
5
|
// ============================================================================
|
|
6
6
|
// Types
|
|
@@ -158,7 +158,7 @@ export const BaseNode = memo(function BaseNode({
|
|
|
158
158
|
additionalSourceHandles,
|
|
159
159
|
children,
|
|
160
160
|
}: BaseNodeProps) {
|
|
161
|
-
const { step,
|
|
161
|
+
const { step, onDelete } = data
|
|
162
162
|
const color = headerColor || NODE_HEADER_COLORS[step.type] || NODE_HEADER_COLORS.default
|
|
163
163
|
|
|
164
164
|
const handleDelete = (e: React.MouseEvent) => {
|
package/src/flow-step-types.ts
CHANGED
|
@@ -11,14 +11,12 @@ export type ContextStepType =
|
|
|
11
11
|
| 'retrieve-record'
|
|
12
12
|
| 'get-record'
|
|
13
13
|
| 'list-records'
|
|
14
|
-
| 'fetch-github'
|
|
15
14
|
| 'api-call'
|
|
16
15
|
| 'transform-data'
|
|
17
16
|
| 'conditional'
|
|
18
17
|
| 'set-variable'
|
|
19
18
|
| 'upsert-record'
|
|
20
19
|
| 'send-email'
|
|
21
|
-
| 'send-text'
|
|
22
20
|
| 'send-event'
|
|
23
21
|
| 'send-stream'
|
|
24
22
|
| 'update-record'
|
package/src/utils/adapter.ts
CHANGED
|
@@ -436,14 +436,12 @@ export function getDefaultStepName(type: FlowStepType): string {
|
|
|
436
436
|
'retrieve-record': 'Retrieve Record',
|
|
437
437
|
'get-record': 'Get Record',
|
|
438
438
|
'list-records': 'List Records',
|
|
439
|
-
'fetch-github': 'Fetch GitHub',
|
|
440
439
|
'api-call': 'API Call',
|
|
441
440
|
'transform-data': 'Transform Data',
|
|
442
441
|
conditional: 'Conditional',
|
|
443
442
|
'set-variable': 'Set Variable',
|
|
444
443
|
'upsert-record': 'Upsert Record',
|
|
445
444
|
'send-email': 'Send Email',
|
|
446
|
-
'send-text': 'Send Text',
|
|
447
445
|
'send-event': 'Send Event',
|
|
448
446
|
'send-stream': 'Send Stream',
|
|
449
447
|
'update-record': 'Update Record',
|