@yiyi_zhang/reactflow-ui 0.1.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.
Files changed (53) hide show
  1. package/README.md +107 -0
  2. package/dist/WorkflowIDE.d.ts +108 -0
  3. package/dist/components/AICopilot/AIChatPanel.d.ts +8 -0
  4. package/dist/components/AICopilot/ParameterSuggester.d.ts +16 -0
  5. package/dist/components/ConfirmDialog.d.ts +7 -0
  6. package/dist/components/Controls/ActionBar.d.ts +10 -0
  7. package/dist/components/Controls/ControlButton.d.ts +13 -0
  8. package/dist/components/Controls/ControlHub.d.ts +3 -0
  9. package/dist/components/Editor/NodeSelector.d.ts +8 -0
  10. package/dist/components/EmptyStatePanel.d.ts +7 -0
  11. package/dist/components/ExecutionStatusBar.d.ts +5 -0
  12. package/dist/components/ExecutionTaskPanel.d.ts +5 -0
  13. package/dist/components/HealthCheckPanel.d.ts +12 -0
  14. package/dist/components/TaskDetailPanel.d.ts +11 -0
  15. package/dist/components/Toast.d.ts +11 -0
  16. package/dist/components/WorkflowDesigner.d.ts +15 -0
  17. package/dist/components/WorkflowSettingsPanel.d.ts +10 -0
  18. package/dist/components/edges/AddableEdge.d.ts +8 -0
  19. package/dist/components/nodes/DecisionNode.d.ts +5 -0
  20. package/dist/components/nodes/ExecutionStatusBadge.d.ts +7 -0
  21. package/dist/components/nodes/ForkJoinNode.d.ts +16 -0
  22. package/dist/components/nodes/LoopNode.d.ts +5 -0
  23. package/dist/components/nodes/NodeLayout.d.ts +16 -0
  24. package/dist/components/nodes/NodeWrapper.d.ts +15 -0
  25. package/dist/components/nodes/SubWorkflowNode.d.ts +5 -0
  26. package/dist/components/nodes/TaskNode.d.ts +5 -0
  27. package/dist/config/taskTypes.d.ts +14 -0
  28. package/dist/hooks/useConfirm.d.ts +14 -0
  29. package/dist/hooks/useNodeExecution.d.ts +8 -0
  30. package/dist/hooks/useNodeLayout.d.ts +10 -0
  31. package/dist/hooks/useShortcuts.d.ts +11 -0
  32. package/dist/hooks/useToast.d.ts +9 -0
  33. package/dist/index.d.ts +5 -0
  34. package/dist/layout/autoLayout.d.ts +22 -0
  35. package/dist/parser/conductorGenerator.d.ts +28 -0
  36. package/dist/parser/conductorParser.d.ts +24 -0
  37. package/dist/reactflow-ui.css +1 -0
  38. package/dist/reactflow-ui.es.js +11035 -0
  39. package/dist/reactflow-ui.umd.js +229 -0
  40. package/dist/sample-workflows/complex-workflow.json +210 -0
  41. package/dist/sample-workflows/decision-workflow.json +118 -0
  42. package/dist/sample-workflows/fork-join-workflow.json +112 -0
  43. package/dist/sample-workflows/sample-execution.json +327 -0
  44. package/dist/sample-workflows/simple-workflow.json +42 -0
  45. package/dist/services/aiService.d.ts +24 -0
  46. package/dist/services/promptTemplates.d.ts +6 -0
  47. package/dist/store/workflowStore.d.ts +30 -0
  48. package/dist/types/conductor.d.ts +170 -0
  49. package/dist/types/workflow.d.ts +165 -0
  50. package/dist/utils/validationRules.d.ts +85 -0
  51. package/dist/utils/validator.d.ts +6 -0
  52. package/dist/vite.svg +1 -0
  53. package/package.json +71 -0
@@ -0,0 +1,210 @@
1
+ {
2
+ "name": "complex_workflow",
3
+ "description": "综合示例:包含多种任务类型和嵌套结构",
4
+ "version": 1,
5
+ "tasks": [
6
+ {
7
+ "name": "initialize",
8
+ "taskReferenceName": "init_ref",
9
+ "type": "SIMPLE",
10
+ "inputParameters": {
11
+ "workflowId": "${workflow.workflowId}"
12
+ }
13
+ },
14
+ {
15
+ "name": "check_environment",
16
+ "taskReferenceName": "env_check_ref",
17
+ "type": "DECISION",
18
+ "inputParameters": {
19
+ "environment": "${workflow.input.environment}"
20
+ },
21
+ "caseValueParam": "environment",
22
+ "decisionCases": {
23
+ "production": [
24
+ {
25
+ "name": "prod_validation",
26
+ "taskReferenceName": "prod_valid_ref",
27
+ "type": "SIMPLE",
28
+ "inputParameters": {
29
+ "strict": true
30
+ }
31
+ },
32
+ {
33
+ "name": "prod_parallel_tasks",
34
+ "taskReferenceName": "prod_fork_ref",
35
+ "type": "FORK_JOIN",
36
+ "forkTasks": [
37
+ [
38
+ {
39
+ "name": "security_check",
40
+ "taskReferenceName": "security_ref",
41
+ "type": "HTTP",
42
+ "inputParameters": {
43
+ "http_request": {
44
+ "uri": "https://api.example.com/security/check",
45
+ "method": "POST"
46
+ }
47
+ }
48
+ }
49
+ ],
50
+ [
51
+ {
52
+ "name": "compliance_check",
53
+ "taskReferenceName": "compliance_ref",
54
+ "type": "SIMPLE",
55
+ "inputParameters": {
56
+ "level": "strict"
57
+ }
58
+ }
59
+ ]
60
+ ]
61
+ },
62
+ {
63
+ "name": "join_prod_checks",
64
+ "taskReferenceName": "prod_join_ref",
65
+ "type": "JOIN",
66
+ "joinOn": [
67
+ "security_ref",
68
+ "compliance_ref"
69
+ ]
70
+ }
71
+ ],
72
+ "staging": [
73
+ {
74
+ "name": "staging_validation",
75
+ "taskReferenceName": "staging_valid_ref",
76
+ "type": "SIMPLE",
77
+ "inputParameters": {
78
+ "strict": false
79
+ }
80
+ }
81
+ ]
82
+ },
83
+ "defaultCase": [
84
+ {
85
+ "name": "dev_validation",
86
+ "taskReferenceName": "dev_valid_ref",
87
+ "type": "SIMPLE",
88
+ "inputParameters": {
89
+ "strict": false,
90
+ "skipChecks": true
91
+ }
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "name": "process_data_loop",
97
+ "taskReferenceName": "loop_ref",
98
+ "type": "DO_WHILE",
99
+ "inputParameters": {
100
+ "items": "${init_ref.output.items}"
101
+ },
102
+ "loopCondition": "if ($.loop_ref['iteration'] < $.init_ref.output.itemCount) { true; } else { false; }",
103
+ "loopOver": [
104
+ {
105
+ "name": "process_item",
106
+ "taskReferenceName": "process_item_ref",
107
+ "type": "SIMPLE",
108
+ "inputParameters": {
109
+ "item": "${workflow.input.items[$.loop_ref.iteration]}"
110
+ }
111
+ },
112
+ {
113
+ "name": "transform_item",
114
+ "taskReferenceName": "transform_item_ref",
115
+ "type": "JSON_JQ_TRANSFORM",
116
+ "inputParameters": {
117
+ "data": "${process_item_ref.output}",
118
+ "queryExpression": ".result"
119
+ }
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "name": "invoke_sub_workflow",
125
+ "taskReferenceName": "sub_wf_ref",
126
+ "type": "SUB_WORKFLOW",
127
+ "inputParameters": {
128
+ "workflowInput": {
129
+ "data": "${loop_ref.output}"
130
+ }
131
+ },
132
+ "subWorkflowParam": {
133
+ "name": "data_aggregation_workflow",
134
+ "version": 1
135
+ }
136
+ },
137
+ {
138
+ "name": "final_processing",
139
+ "taskReferenceName": "final_ref",
140
+ "type": "FORK_JOIN",
141
+ "forkTasks": [
142
+ [
143
+ {
144
+ "name": "save_to_database",
145
+ "taskReferenceName": "db_save_ref",
146
+ "type": "SIMPLE",
147
+ "inputParameters": {
148
+ "data": "${sub_wf_ref.output}"
149
+ }
150
+ }
151
+ ],
152
+ [
153
+ {
154
+ "name": "publish_event",
155
+ "taskReferenceName": "event_ref",
156
+ "type": "EVENT",
157
+ "inputParameters": {
158
+ "event": "workflow_completed",
159
+ "data": "${sub_wf_ref.output}"
160
+ }
161
+ }
162
+ ],
163
+ [
164
+ {
165
+ "name": "send_notification",
166
+ "taskReferenceName": "notify_ref",
167
+ "type": "KAFKA_PUBLISH",
168
+ "inputParameters": {
169
+ "topic": "workflow-notifications",
170
+ "message": {
171
+ "workflowId": "${workflow.workflowId}",
172
+ "status": "completed"
173
+ }
174
+ }
175
+ }
176
+ ]
177
+ ]
178
+ },
179
+ {
180
+ "name": "join_final_tasks",
181
+ "taskReferenceName": "final_join_ref",
182
+ "type": "JOIN",
183
+ "joinOn": [
184
+ "db_save_ref",
185
+ "event_ref",
186
+ "notify_ref"
187
+ ]
188
+ },
189
+ {
190
+ "name": "cleanup",
191
+ "taskReferenceName": "cleanup_ref",
192
+ "type": "SIMPLE",
193
+ "inputParameters": {
194
+ "workflowId": "${workflow.workflowId}"
195
+ }
196
+ }
197
+ ],
198
+ "inputParameters": [
199
+ "environment",
200
+ "items"
201
+ ],
202
+ "outputParameters": {
203
+ "result": "${cleanup_ref.output}",
204
+ "processedItems": "${loop_ref.output}",
205
+ "aggregatedData": "${sub_wf_ref.output}"
206
+ },
207
+ "schemaVersion": 2,
208
+ "ownerEmail": "team@example.com",
209
+ "timeoutSeconds": 3600
210
+ }
@@ -0,0 +1,118 @@
1
+ {
2
+ "name": "decision_workflow",
3
+ "description": "包含 DECISION 分支的工作流,支持嵌套任务",
4
+ "version": 1,
5
+ "tasks": [
6
+ {
7
+ "name": "check_user_type",
8
+ "taskReferenceName": "check_user_ref",
9
+ "type": "SIMPLE",
10
+ "inputParameters": {
11
+ "userId": "${workflow.input.userId}"
12
+ }
13
+ },
14
+ {
15
+ "name": "user_type_decision",
16
+ "taskReferenceName": "decision_ref",
17
+ "type": "DECISION",
18
+ "inputParameters": {
19
+ "userType": "${check_user_ref.output.userType}"
20
+ },
21
+ "caseValueParam": "userType",
22
+ "decisionCases": {
23
+ "premium": [
24
+ {
25
+ "name": "premium_processing",
26
+ "taskReferenceName": "premium_proc_ref",
27
+ "type": "SIMPLE",
28
+ "inputParameters": {
29
+ "level": "premium",
30
+ "userId": "${workflow.input.userId}"
31
+ }
32
+ },
33
+ {
34
+ "name": "send_premium_email",
35
+ "taskReferenceName": "premium_email_ref",
36
+ "type": "HTTP",
37
+ "inputParameters": {
38
+ "http_request": {
39
+ "uri": "https://api.example.com/email/premium",
40
+ "method": "POST",
41
+ "body": {
42
+ "userId": "${workflow.input.userId}",
43
+ "template": "premium"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ ],
49
+ "standard": [
50
+ {
51
+ "name": "standard_processing",
52
+ "taskReferenceName": "standard_proc_ref",
53
+ "type": "SIMPLE",
54
+ "inputParameters": {
55
+ "level": "standard",
56
+ "userId": "${workflow.input.userId}"
57
+ }
58
+ }
59
+ ],
60
+ "trial": [
61
+ {
62
+ "name": "trial_processing",
63
+ "taskReferenceName": "trial_proc_ref",
64
+ "type": "SIMPLE",
65
+ "inputParameters": {
66
+ "level": "trial",
67
+ "userId": "${workflow.input.userId}"
68
+ }
69
+ },
70
+ {
71
+ "name": "check_trial_expiry",
72
+ "taskReferenceName": "trial_expiry_ref",
73
+ "type": "SIMPLE",
74
+ "inputParameters": {
75
+ "userId": "${workflow.input.userId}"
76
+ }
77
+ }
78
+ ]
79
+ },
80
+ "defaultCase": [
81
+ {
82
+ "name": "default_processing",
83
+ "taskReferenceName": "default_proc_ref",
84
+ "type": "SIMPLE",
85
+ "inputParameters": {
86
+ "level": "unknown",
87
+ "userId": "${workflow.input.userId}"
88
+ }
89
+ },
90
+ {
91
+ "name": "log_unknown_user",
92
+ "taskReferenceName": "log_unknown_ref",
93
+ "type": "EVENT",
94
+ "inputParameters": {
95
+ "event": "unknown_user_type",
96
+ "userId": "${workflow.input.userId}"
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "name": "final_notification",
103
+ "taskReferenceName": "final_notify_ref",
104
+ "type": "SIMPLE",
105
+ "inputParameters": {
106
+ "message": "Workflow completed"
107
+ }
108
+ }
109
+ ],
110
+ "inputParameters": [
111
+ "userId"
112
+ ],
113
+ "outputParameters": {
114
+ "result": "${final_notify_ref.output}"
115
+ },
116
+ "schemaVersion": 2,
117
+ "ownerEmail": "team@example.com"
118
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "name": "fork_join_workflow",
3
+ "description": "包含 FORK_JOIN 并行任务的工作流",
4
+ "version": 1,
5
+ "tasks": [
6
+ {
7
+ "name": "prepare_data",
8
+ "taskReferenceName": "prepare_ref",
9
+ "type": "SIMPLE",
10
+ "inputParameters": {
11
+ "orderId": "${workflow.input.orderId}"
12
+ }
13
+ },
14
+ {
15
+ "name": "parallel_processing",
16
+ "taskReferenceName": "fork_join_ref",
17
+ "type": "FORK_JOIN",
18
+ "forkTasks": [
19
+ [
20
+ {
21
+ "name": "process_payment",
22
+ "taskReferenceName": "payment_ref",
23
+ "type": "HTTP",
24
+ "inputParameters": {
25
+ "http_request": {
26
+ "uri": "https://api.example.com/payment",
27
+ "method": "POST",
28
+ "body": {
29
+ "orderId": "${workflow.input.orderId}",
30
+ "amount": "${prepare_ref.output.amount}"
31
+ }
32
+ }
33
+ }
34
+ },
35
+ {
36
+ "name": "validate_payment",
37
+ "taskReferenceName": "validate_payment_ref",
38
+ "type": "SIMPLE",
39
+ "inputParameters": {
40
+ "paymentId": "${payment_ref.output.paymentId}"
41
+ }
42
+ }
43
+ ],
44
+ [
45
+ {
46
+ "name": "update_inventory",
47
+ "taskReferenceName": "inventory_ref",
48
+ "type": "SIMPLE",
49
+ "inputParameters": {
50
+ "orderId": "${workflow.input.orderId}",
51
+ "items": "${prepare_ref.output.items}"
52
+ }
53
+ }
54
+ ],
55
+ [
56
+ {
57
+ "name": "send_confirmation_email",
58
+ "taskReferenceName": "email_ref",
59
+ "type": "HTTP",
60
+ "inputParameters": {
61
+ "http_request": {
62
+ "uri": "https://api.example.com/email",
63
+ "method": "POST",
64
+ "body": {
65
+ "to": "${prepare_ref.output.customerEmail}",
66
+ "template": "order_confirmation"
67
+ }
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "name": "send_sms",
73
+ "taskReferenceName": "sms_ref",
74
+ "type": "SIMPLE",
75
+ "inputParameters": {
76
+ "phone": "${prepare_ref.output.customerPhone}",
77
+ "message": "Order confirmed"
78
+ }
79
+ }
80
+ ]
81
+ ]
82
+ },
83
+ {
84
+ "name": "join_parallel_tasks",
85
+ "taskReferenceName": "join_ref",
86
+ "type": "JOIN",
87
+ "joinOn": [
88
+ "validate_payment_ref",
89
+ "inventory_ref",
90
+ "sms_ref"
91
+ ]
92
+ },
93
+ {
94
+ "name": "finalize_order",
95
+ "taskReferenceName": "finalize_ref",
96
+ "type": "SIMPLE",
97
+ "inputParameters": {
98
+ "orderId": "${workflow.input.orderId}",
99
+ "paymentStatus": "${payment_ref.output.status}",
100
+ "inventoryStatus": "${inventory_ref.output.status}"
101
+ }
102
+ }
103
+ ],
104
+ "inputParameters": [
105
+ "orderId"
106
+ ],
107
+ "outputParameters": {
108
+ "result": "${finalize_ref.output}"
109
+ },
110
+ "schemaVersion": 2,
111
+ "ownerEmail": "team@example.com"
112
+ }