@yiyi_zhang/reactflow-ui 1.0.0 → 1.2.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.
- package/README.md +28 -3
- package/dist/AiWorkflowIDE.d.ts +21 -0
- package/dist/WorkflowIDE.d.ts +34 -0
- package/dist/actions/builtin/common.d.ts +8 -0
- package/dist/actions/builtin/ecs.d.ts +12 -0
- package/dist/actions/fromDefinitions.d.ts +70 -0
- package/dist/actions/registry.d.ts +24 -0
- package/dist/actions/types.d.ts +71 -0
- package/dist/ai.d.ts +9 -0
- package/dist/components/AiNative/AiCommandCenter.d.ts +4 -0
- package/dist/components/business/ActionForm.d.ts +12 -0
- package/dist/components/business/ActionPickerModal.d.ts +25 -0
- package/dist/components/business/DataPillInput.d.ts +16 -0
- package/dist/components/business/DecisionBranchCard.d.ts +15 -0
- package/dist/components/business/ForkJoinCard.d.ts +15 -0
- package/dist/components/business/FriendlyErrorCard.d.ts +8 -0
- package/dist/components/business/LibraryVersionBadge.d.ts +29 -0
- package/dist/components/business/LoopDoWhileCard.d.ts +15 -0
- package/dist/components/business/NestedControlStep.d.ts +22 -0
- package/dist/components/business/PillPicker.d.ts +11 -0
- package/dist/components/business/RunStoryTimeline.d.ts +9 -0
- package/dist/components/business/StepFlowEditor.d.ts +20 -0
- package/dist/components/business/StepListEditor.d.ts +29 -0
- package/dist/components/template/TemplateExtractor.d.ts +10 -0
- package/dist/components/template/TemplateGallery.d.ts +10 -0
- package/dist/components/template/TemplateSetupWizard.d.ts +9 -0
- package/dist/index.d.ts +36 -1
- package/dist/library/catalog.d.ts +93 -0
- package/dist/library/conductorProvider.d.ts +41 -0
- package/dist/library/diff.d.ts +62 -0
- package/dist/library/index.d.ts +16 -0
- package/dist/library/level.d.ts +6 -0
- package/dist/library/naming.d.ts +28 -0
- package/dist/library/projections.d.ts +53 -0
- package/dist/library/types.d.ts +58 -0
- package/dist/library/useLibraryCatalog.d.ts +9 -0
- package/dist/library/version.d.ts +17 -0
- package/dist/library/versionStatus.d.ts +44 -0
- package/dist/product-launch.html +3 -3
- package/dist/reactflow-ui-ai.es.js +14330 -8509
- package/dist/reactflow-ui.css +1 -1
- package/dist/reactflow-ui.es.js +16707 -8202
- package/dist/reactflow-ui.umd.js +30 -24
- package/dist/sample-workflows/ecs-lifecycle-automation.json +74 -0
- package/dist/sample-workflows/library-capabilities-demo.json +66 -0
- package/dist/services/ai/agentRunner.d.ts +11 -0
- package/dist/services/ai/schemaRegistry.d.ts +7 -1
- package/dist/services/ai/systemPrompt.d.ts +11 -0
- package/dist/services/ai/toolExecutor.d.ts +12 -0
- package/dist/services/ai/workflowSynthesizer.d.ts +28 -3
- package/dist/stepmodel/compile.d.ts +11 -0
- package/dist/stepmodel/decompile.d.ts +10 -0
- package/dist/stepmodel/factory.d.ts +8 -0
- package/dist/stepmodel/types.d.ts +64 -0
- package/dist/store/ideStoresContext.d.ts +3 -0
- package/dist/store/workflowStore.d.ts +1 -0
- package/dist/template/applyTemplate.d.ts +10 -0
- package/dist/template/builtin/templates.d.ts +37 -0
- package/dist/template/sanitizer/anonymize.d.ts +5 -0
- package/dist/template/sanitizer/prune.d.ts +10 -0
- package/dist/template/sanitizer/rules.d.ts +10 -0
- package/dist/template/sanitizer/types.d.ts +55 -0
- package/dist/template/templateStore.d.ts +32 -0
- package/dist/template/types.d.ts +99 -0
- package/dist/types/conductor.d.ts +13 -8
- package/dist/types/workflow.d.ts +9 -0
- package/dist/types/workflowLibrary.d.ts +2 -0
- package/dist/utils/friendlyErrorTranslator.d.ts +26 -0
- package/dist/utils/taskTypeMeta.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/AiNative/BusinessCanvas.d.ts +0 -15
- package/dist/components/Controls/ModeSlider.d.ts +0 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { WorkflowDef } from '../types/conductor';
|
|
2
|
+
/**
|
|
3
|
+
* 模板分类枚举:
|
|
4
|
+
* - compute: 资源交付与计算管理
|
|
5
|
+
* - security: 安全备份与应急合规
|
|
6
|
+
* - cost: 资源节能与成本优化
|
|
7
|
+
* - ops: 日常运维与自动自愈
|
|
8
|
+
*/
|
|
9
|
+
export type TemplateCategory = 'compute' | 'security' | 'cost' | 'ops';
|
|
10
|
+
/**
|
|
11
|
+
* 模板变量定义(填空向导中的表单字段)
|
|
12
|
+
*/
|
|
13
|
+
export interface TemplateVariable {
|
|
14
|
+
/** 变量唯一键名 */
|
|
15
|
+
key: string;
|
|
16
|
+
/** 中文业务标签名称,如 "通知目标群组" */
|
|
17
|
+
label: string;
|
|
18
|
+
/** 字段辅助提示说明 */
|
|
19
|
+
help?: string;
|
|
20
|
+
/** 变量输入控件类型 */
|
|
21
|
+
type: 'text' | 'number' | 'select' | 'boolean' | 'account' | 'cron-friendly';
|
|
22
|
+
/** 默认值 */
|
|
23
|
+
defaultValue?: any;
|
|
24
|
+
/** 下拉选项 */
|
|
25
|
+
options?: {
|
|
26
|
+
label: string;
|
|
27
|
+
value: any;
|
|
28
|
+
}[];
|
|
29
|
+
/** 是否必填 */
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/** 占位提示文案 */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 变量注入路径列表:
|
|
35
|
+
* 支持通过 JSONPath 或属性链将该值灌入 WorkflowDef 中对应的任务参数,
|
|
36
|
+
* 例如: ["tasks[0].inputParameters.instanceName", "tasks[1].inputParameters.title"]
|
|
37
|
+
*/
|
|
38
|
+
bindings: string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 模板内置的高保真拟真沙盒数据场景
|
|
42
|
+
*/
|
|
43
|
+
export interface MockScenario {
|
|
44
|
+
/** 场景名称,如 "默认成功场景"、"高负载触发升配场景" */
|
|
45
|
+
name: string;
|
|
46
|
+
/** 场景业务说明 */
|
|
47
|
+
description?: string;
|
|
48
|
+
/** 该场景下的工作流全局入参 */
|
|
49
|
+
workflowInput: Record<string, any>;
|
|
50
|
+
/** 任务级拟真输出覆盖映射 (taskReferenceName -> outputData) */
|
|
51
|
+
taskOutputs?: Record<string, any>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 场景化工作流模板标准模型
|
|
55
|
+
*/
|
|
56
|
+
export interface WorkflowTemplate {
|
|
57
|
+
/** 模板唯一标识 ID */
|
|
58
|
+
id: string;
|
|
59
|
+
/** 模板版本号 */
|
|
60
|
+
version: string;
|
|
61
|
+
/** 模板中文标题,如 "核心云主机每日定时快照备份" */
|
|
62
|
+
title: string;
|
|
63
|
+
/** 所属业务分类 */
|
|
64
|
+
category: TemplateCategory;
|
|
65
|
+
/** 模板视觉图标 Emoji */
|
|
66
|
+
icon: string;
|
|
67
|
+
/** 一句话核心业务价值主张(拒绝技术罗列,讲清节省的时间与业务成效) */
|
|
68
|
+
valueProposition: string;
|
|
69
|
+
/** 详细场景背景说明 */
|
|
70
|
+
description: string;
|
|
71
|
+
/** 所需连接器图标或名称标识,如 ["cloud_host", "dingtalk"] */
|
|
72
|
+
connectors: string[];
|
|
73
|
+
/** 投资回报与提效收益指标 (ROI) */
|
|
74
|
+
roi: {
|
|
75
|
+
/** 单次执行预估节省人工分钟数 */
|
|
76
|
+
minutesSavedPerRun: number;
|
|
77
|
+
/** 典型业务每周触发频次 */
|
|
78
|
+
typicalRunsPerWeek: number;
|
|
79
|
+
/** 模板热度/累计使用次数 */
|
|
80
|
+
popularityCount?: number;
|
|
81
|
+
};
|
|
82
|
+
/** 上手难度等级 */
|
|
83
|
+
difficulty: 'starter' | 'intermediate' | 'advanced';
|
|
84
|
+
/** 填空式启用向导的必填变量清单 (2~4 项最佳) */
|
|
85
|
+
variables: TemplateVariable[];
|
|
86
|
+
/** 经过剪枝与参数化的标准 Conductor 工作流骨架 */
|
|
87
|
+
definition: WorkflowDef;
|
|
88
|
+
/** 拟真业务沙盒数据集(用于无需授权即可一键本地试跑体验) */
|
|
89
|
+
mockDataset: {
|
|
90
|
+
scenarios: MockScenario[];
|
|
91
|
+
};
|
|
92
|
+
/** 模板溯源与发布审计信息 */
|
|
93
|
+
provenance?: {
|
|
94
|
+
source: 'official' | 'extracted';
|
|
95
|
+
author?: string;
|
|
96
|
+
publishedAt?: string;
|
|
97
|
+
extractedFromWorkflowId?: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -74,6 +74,17 @@ export interface TaskDef {
|
|
|
74
74
|
timeoutSeconds?: number;
|
|
75
75
|
timeoutPolicy?: 'RETRY' | 'TIME_OUT_WF' | 'ALERT_ONLY' | 'FAIL_WORKFLOW';
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Conductor 标准 Schema 定义(WorkflowDef / TaskDef 的 inputSchema / outputSchema)。
|
|
79
|
+
* 仅 JSON 类型会被服务端真正校验;data 为 JSON Schema 文档本身。
|
|
80
|
+
*/
|
|
81
|
+
export interface SchemaDef {
|
|
82
|
+
name?: string;
|
|
83
|
+
version?: number;
|
|
84
|
+
type?: 'JSON' | 'AVRO' | 'PROTOBUF' | string;
|
|
85
|
+
data?: Record<string, any>;
|
|
86
|
+
externalRef?: string;
|
|
87
|
+
}
|
|
77
88
|
/**
|
|
78
89
|
* 工作流入参定义(结构化,向后兼容 string[] 旧格式)
|
|
79
90
|
*/
|
|
@@ -133,15 +144,9 @@ export interface WorkflowDef {
|
|
|
133
144
|
concurrentExecLimit?: number;
|
|
134
145
|
};
|
|
135
146
|
/** 输入 Schema 定义 */
|
|
136
|
-
inputSchema?:
|
|
137
|
-
name?: string;
|
|
138
|
-
type?: string;
|
|
139
|
-
};
|
|
147
|
+
inputSchema?: SchemaDef;
|
|
140
148
|
/** 输出 Schema 定义 */
|
|
141
|
-
outputSchema?:
|
|
142
|
-
name?: string;
|
|
143
|
-
type?: string;
|
|
144
|
-
};
|
|
149
|
+
outputSchema?: SchemaDef;
|
|
145
150
|
/** 是否强制 Schema 校验 */
|
|
146
151
|
enforceSchema?: boolean;
|
|
147
152
|
}
|
package/dist/types/workflow.d.ts
CHANGED
|
@@ -205,6 +205,11 @@ export interface WorkflowState {
|
|
|
205
205
|
isSimRunning: boolean;
|
|
206
206
|
/** 每次 setWorkflow() 调用时递增,用于触发 WorkflowDesigner 的 fitView */
|
|
207
207
|
workflowLoadKey: number;
|
|
208
|
+
/**
|
|
209
|
+
* 画布数据(nodes/edges/taskMap)是否落后于 workflowDef。
|
|
210
|
+
* 业务卡片视图下画布未挂载,编辑只更新定义(setWorkflowDefOnly),切回画布前再 refreshGraph()。
|
|
211
|
+
*/
|
|
212
|
+
graphStale: boolean;
|
|
208
213
|
/** P4.2 执行触发状态 */
|
|
209
214
|
runState: RunState;
|
|
210
215
|
pendingExecutionId: string | null;
|
|
@@ -237,6 +242,10 @@ export interface WorkflowState {
|
|
|
237
242
|
*/
|
|
238
243
|
export interface WorkflowActions {
|
|
239
244
|
setWorkflow: (workflowJson: any, direction?: LayoutDirection) => void;
|
|
245
|
+
/** 仅更新定义与校验结果,不重建画布(业务卡片视图下的高频编辑使用);画布数据标记为过期 */
|
|
246
|
+
setWorkflowDefOnly: (workflowJson: any) => void;
|
|
247
|
+
/** 画布数据过期时,按当前定义重新解析并布局;未过期则什么都不做 */
|
|
248
|
+
refreshGraph: () => void;
|
|
240
249
|
setMode: (mode: EditorMode) => void;
|
|
241
250
|
setExecutionData: (data: Record<string, TaskExecutionData> | null) => void;
|
|
242
251
|
updateTaskStatus: (taskRef: string, status: ExecutionStatus) => void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 生活化错误诊断结构
|
|
3
|
+
*/
|
|
4
|
+
export interface FriendlyErrorDiagnosis {
|
|
5
|
+
/** 错误分类类型 */
|
|
6
|
+
type: 'auth' | 'timeout' | 'missing_data' | 'quota' | 'script_fail' | 'network' | 'unknown';
|
|
7
|
+
/** 大白话标题 */
|
|
8
|
+
title: string;
|
|
9
|
+
/** 通俗易懂的业务原因解释(普通人能看懂) */
|
|
10
|
+
explanation: string;
|
|
11
|
+
/** 系统给出的可行动建议方案 */
|
|
12
|
+
suggestion: string;
|
|
13
|
+
/** 一键快捷恢复动作文案(可选) */
|
|
14
|
+
actionLabel?: string;
|
|
15
|
+
/** 快捷动作标识(可选) */
|
|
16
|
+
actionKey?: 'reauth' | 'retry' | 'inspect_upstream' | 'change_spec' | 'contact_admin';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 将技术错误日志、HTTP 状态码或调用栈翻译为普通业务人员可理解的生活化诊断
|
|
20
|
+
*
|
|
21
|
+
* @param errorMessage 底层技术报错信息或异常原因 (reasonForIncompletion)
|
|
22
|
+
* @param statusCode HTTP 响应状态码 (可选)
|
|
23
|
+
* @param taskName 任务名称 (可选)
|
|
24
|
+
* @returns 业务化诊断卡片数据
|
|
25
|
+
*/
|
|
26
|
+
export declare function translateTechnicalError(errorMessage?: string, statusCode?: number, taskName?: string): FriendlyErrorDiagnosis;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Task Type Meta — business-friendly labels for Conductor task types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Used by ProposalPreviewCard so AI proposals speak business language for each
|
|
5
|
+
* task type (originally extracted from the former BusinessCanvas, which the AI IDE
|
|
6
|
+
* business view replaced with StepFlowEditor in 1.2.x).
|
|
7
7
|
*/
|
|
8
8
|
export interface TaskTypeMeta {
|
|
9
9
|
label: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yiyi_zhang/reactflow-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Conductor Workflow IDE — Next-Gen AI-Native visual workflow designer with W-LSP data lineage, deterministic in-browser sandbox dry-run, time-travel waterfall debugger, and live split-view sync built with React 19, ReactFlow and Zustand.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"conductor",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BusinessCanvas — renders a WorkflowDef as business-friendly step cards
|
|
3
|
-
* for non-technical users (business view mode).
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { WorkflowDef } from '../../types/conductor';
|
|
7
|
-
interface BusinessCanvasProps {
|
|
8
|
-
workflowDef: WorkflowDef | null;
|
|
9
|
-
/** Task statuses from execution (ref → status) */
|
|
10
|
-
executionStatus?: Record<string, string>;
|
|
11
|
-
/** Called when user clicks a step to ask AI about it */
|
|
12
|
-
onStepClick?: (taskRef: string, taskType: string) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const BusinessCanvas: React.FC<BusinessCanvasProps>;
|
|
15
|
-
export default BusinessCanvas;
|