@yiyi_zhang/reactflow-ui 1.0.0 → 1.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 (38) hide show
  1. package/README.md +28 -3
  2. package/dist/WorkflowIDE.d.ts +13 -0
  3. package/dist/actions/builtin/common.d.ts +8 -0
  4. package/dist/actions/builtin/ecs.d.ts +12 -0
  5. package/dist/actions/registry.d.ts +23 -0
  6. package/dist/actions/types.d.ts +45 -0
  7. package/dist/components/business/ActionForm.d.ts +12 -0
  8. package/dist/components/business/DataPillInput.d.ts +14 -0
  9. package/dist/components/business/DecisionBranchCard.d.ts +13 -0
  10. package/dist/components/business/ForkJoinCard.d.ts +13 -0
  11. package/dist/components/business/FriendlyErrorCard.d.ts +8 -0
  12. package/dist/components/business/LoopDoWhileCard.d.ts +13 -0
  13. package/dist/components/business/PillPicker.d.ts +11 -0
  14. package/dist/components/business/RunStoryTimeline.d.ts +9 -0
  15. package/dist/components/business/StepFlowEditor.d.ts +11 -0
  16. package/dist/components/template/TemplateExtractor.d.ts +10 -0
  17. package/dist/components/template/TemplateGallery.d.ts +10 -0
  18. package/dist/components/template/TemplateSetupWizard.d.ts +9 -0
  19. package/dist/index.d.ts +29 -0
  20. package/dist/reactflow-ui-ai.es.js +2117 -2156
  21. package/dist/reactflow-ui.css +1 -1
  22. package/dist/reactflow-ui.es.js +15685 -8305
  23. package/dist/reactflow-ui.umd.js +25 -22
  24. package/dist/sample-workflows/ecs-lifecycle-automation.json +74 -0
  25. package/dist/stepmodel/compile.d.ts +5 -0
  26. package/dist/stepmodel/decompile.d.ts +5 -0
  27. package/dist/stepmodel/types.d.ts +61 -0
  28. package/dist/template/applyTemplate.d.ts +10 -0
  29. package/dist/template/builtin/templates.d.ts +37 -0
  30. package/dist/template/sanitizer/anonymize.d.ts +5 -0
  31. package/dist/template/sanitizer/prune.d.ts +10 -0
  32. package/dist/template/sanitizer/rules.d.ts +10 -0
  33. package/dist/template/sanitizer/types.d.ts +55 -0
  34. package/dist/template/templateStore.d.ts +32 -0
  35. package/dist/template/types.d.ts +99 -0
  36. package/dist/utils/friendlyErrorTranslator.d.ts +26 -0
  37. package/package.json +1 -1
  38. package/dist/components/Controls/ModeSlider.d.ts +0 -2
package/README.md CHANGED
@@ -1,14 +1,39 @@
1
- # Conductor Workflow IDE (`@yiyi_zhang/reactflow-ui` v1.0.0)
1
+ # Conductor Workflow IDE (`@yiyi_zhang/reactflow-ui` v1.1.0)
2
2
 
3
3
  基于 **React 19、ReactFlow 与 Zustand** 构建的下一代企业级 [Netflix Conductor](https://conductor-oss.org/) 工作流可视化设计器与 AI 原生编排 IDE。
4
4
 
5
5
  提供两个可独立按需集成的核心组件入口:
6
- - **`WorkflowIDE`**(主入口 `@yiyi_zhang/reactflow-ui`)— 面向专业编排与研发人员的完整可视化 IDE
6
+ - **`WorkflowIDE`**(主入口 `@yiyi_zhang/reactflow-ui`)— 双模全融合,支持面向业务与运维的**业务卡片流 (StepFlow)**,以及面向架构研发的**专业开发者 DAG 拓扑**同屏热切换
7
7
  - **`AiWorkflowIDE`**(子路径 `@yiyi_zhang/reactflow-ui/ai`)— 对话优先、AI 驱动,支持多轮 Agentic 编排、子工作流库复用与混合交互
8
8
 
9
9
  ---
10
10
 
11
- ## 🌟 v1.0.0 四大核心支柱架构 (Next-Gen Architecture)
11
+ ## ⚡ v1.1.0 业务与技术全融合核心新特性 (New in v1.1.0)
12
+
13
+ ### 👔 支柱一:业务卡片流设计器 (Business StepFlow) 与双模同屏无损热切换
14
+ - **双模毫秒级热切换**:工具栏一键切换 `👔 业务模式` ⇄ `💻 开发者模式`。业务模式下将复杂的微服务连线拓扑解构为清晰直观的业务卡片流,支持任意位置插入步骤、上下重排与内联表单配置。
15
+ - **StepModel 双向无损编译引擎**:提供递归编译器与反编译器,保证卡片流与原生 Conductor DAG 之间 100% 状态保真转换,非标任务通过 `isProFallback` 严格兜底。
16
+
17
+ ### ☁️ 支柱二:内置云平台动作库与动态参数胶囊
18
+ - **首发生态对接类阿里云云主机 (ECS) 全生命周期动作**:创建云主机、启停机、磁盘快照备份、平滑升降规格、释放实例等。
19
+ - **动态参数胶囊与智能上游引用**:表单输入项胶囊化呈现,一键联想并安全绑定上游步骤产出的参数引用。
20
+
21
+ ### 🔀 支柱三:业务容器化高级控制流卡片
22
+ - **分支路由卡片 (`DecisionBranchCard`)**:分支 Tabs 导航、条件参数配置、分支内多步骤嵌套编排。
23
+ - **并行任务泳道卡片 (`ForkJoinCard`)**:多泳道并发设计器,动态增删泳道。
24
+ - **循环迭代容器卡片 (`LoopDoWhileCard`)**:循环体内嵌任务序列、继续条件表达式与防死循环熔断保护。
25
+
26
+ ### 🪄 支柱四:生产实例一键脱敏提炼为模板工具链 (Template Extractor)
27
+ - **生产资产一键沉淀**:将生产环境或演练场调试好的工作流一键提炼为公共模板,智能隐私脱敏引擎自动擦除内网 IP、密钥、密码与机密 ID。
28
+ - **8 大开箱即用场景模板中心**:覆盖云主机自动化、扩容容灾、定时省电关机等高频场景,支持全流程浏览器沙箱试跑验证。
29
+
30
+ ### 📖 支柱五:运行故事线时间轴与生活化诊断自愈建议
31
+ - **流水账故事线展开 (`RunStoryTimeline`)**:运行态以自然语言叙述工作流执行过程,直观呈现每一步耗时与数据快照。
32
+ - **生活化故障诊断自愈**:告别晦涩堆栈报错,提供通俗易懂的根因诊断与可直接操作的自愈行动建议。
33
+
34
+ ---
35
+
36
+ ## 🌟 v1.0.0 四大确定性工程底座 (Foundation)
12
37
 
13
38
  ### 🧬 支柱一:确定性工作流语言服务 (W-LSP) 与数据血缘图谱
14
39
  - **0ms 确定性 JSONPath 补全**:在节点配置面板输入 `${` 时,W-LSP 引擎实时遍历当前节点的所有**合法上游祖先节点**,融合五类数据源(运行态真实 Output、人工 Mock Output、`TaskSchema` 注册表、节点配置自省、类型默认字段)弹出零延迟自动补全,并附带 `⚡ 实时值预览`。
@@ -1,6 +1,7 @@
1
1
  import { ThemeMode, ThemeColor, LayoutDirection, ValidationResults, ExecutionActions, ViewMode, WorkflowExecutionInput } from './types/workflow';
2
2
  import { WorkflowDef, WorkflowInstance } from './types/conductor';
3
3
  import { AIServiceConfig } from './services/aiService';
4
+ import { ActionDefinition } from './actions/types';
4
5
  import './styles/tokens.css';
5
6
  import './styles/executionStyles.css';
6
7
  /**
@@ -92,6 +93,18 @@ export interface WorkflowIDEProps {
92
93
  * AI 配置。通过 Props 注入优先于 localStorage 配置。
93
94
  */
94
95
  aiConfig?: Partial<AIServiceConfig>;
96
+ /**
97
+ * UI 体验模式:
98
+ * - `pro` (默认): 专业开发者模式,展示完整 DAG 画布、底层参数、Monaco JSON
99
+ * - `business`: 面向普通使用者的业务模式,提供卡片步骤流、业务动作与数据胶囊
100
+ * @default 'pro'
101
+ */
102
+ uiMode?: 'pro' | 'business';
103
+ /**
104
+ * 自定义扩展的业务动作定义列表。
105
+ * 宿主可传入自定义业务动作(如私有云/特定系统连接器)。
106
+ */
107
+ actions?: ActionDefinition[];
95
108
  /**
96
109
  * 组件容器高度。
97
110
  * @default '100%'
@@ -0,0 +1,8 @@
1
+ import type { ActionDefinition } from '../types';
2
+ export declare const notifySendMessageAction: ActionDefinition;
3
+ export declare const humanApprovalAction: ActionDefinition;
4
+ export declare const controlWaitAction: ActionDefinition;
5
+ export declare const controlDecisionAction: ActionDefinition;
6
+ export declare const controlForkAction: ActionDefinition;
7
+ export declare const controlLoopAction: ActionDefinition;
8
+ export declare const BUILTIN_COMMON_ACTIONS: ActionDefinition[];
@@ -0,0 +1,12 @@
1
+ import type { ActionDefinition } from '../types';
2
+ export declare const ecsCreateInstanceAction: ActionDefinition;
3
+ export declare const ecsQueryInstanceAction: ActionDefinition;
4
+ export declare const ecsStartInstanceAction: ActionDefinition;
5
+ export declare const ecsStopInstanceAction: ActionDefinition;
6
+ export declare const ecsRestartInstanceAction: ActionDefinition;
7
+ export declare const ecsModifySpecAction: ActionDefinition;
8
+ export declare const ecsCreateSnapshotAction: ActionDefinition;
9
+ export declare const ecsRunCommandAction: ActionDefinition;
10
+ export declare const ecsGetMonitorMetricsAction: ActionDefinition;
11
+ export declare const ecsReleaseInstanceAction: ActionDefinition;
12
+ export declare const BUILTIN_ECS_ACTIONS: ActionDefinition[];
@@ -0,0 +1,23 @@
1
+ import type { ActionDefinition, ActionCategory } from './types';
2
+ import type { TaskDef } from '../types/conductor';
3
+ export declare class ActionRegistry {
4
+ private actions;
5
+ constructor(initialActions?: ActionDefinition[]);
6
+ register(action: ActionDefinition): void;
7
+ registerAll(actions: ActionDefinition[]): void;
8
+ getAction(id: string): ActionDefinition | undefined;
9
+ getAllActions(): ActionDefinition[];
10
+ getActionsByCategory(category?: ActionCategory): ActionDefinition[];
11
+ /**
12
+ * Given a Conductor TaskDef, attempt to find a matching ActionDefinition
13
+ * and decompile it into friendly form values.
14
+ */
15
+ findActionForTask(task: TaskDef): {
16
+ action: ActionDefinition;
17
+ values: Record<string, any>;
18
+ } | null;
19
+ }
20
+ /**
21
+ * Global default ActionRegistry pre-populated with Cloud Host (ECS) and Common actions
22
+ */
23
+ export declare const defaultActionRegistry: ActionRegistry;
@@ -0,0 +1,45 @@
1
+ import type { TaskDef } from '../types/conductor';
2
+ export type ActionCategory = 'compute' | 'storage' | 'network' | 'monitor' | 'notify' | 'logic' | 'human' | 'custom';
3
+ export type ActionFieldType = 'text' | 'textarea' | 'number' | 'select' | 'boolean' | 'account' | 'cron-friendly';
4
+ export interface ActionFieldOption {
5
+ label: string;
6
+ value: any;
7
+ description?: string;
8
+ }
9
+ export interface ActionField {
10
+ key: string;
11
+ label: string;
12
+ type: ActionFieldType;
13
+ help?: string;
14
+ placeholder?: string;
15
+ required?: boolean;
16
+ defaultValue?: any;
17
+ options?: ActionFieldOption[];
18
+ acceptsPills?: boolean;
19
+ }
20
+ export interface ActionOutputField {
21
+ key: string;
22
+ label: string;
23
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array';
24
+ example?: any;
25
+ description?: string;
26
+ }
27
+ export interface CompileCtx {
28
+ taskReferenceName: string;
29
+ stepIndex: number;
30
+ workflowName?: string;
31
+ }
32
+ export interface ActionDefinition {
33
+ id: string;
34
+ name: string;
35
+ category: ActionCategory;
36
+ icon: string;
37
+ description: string;
38
+ connector?: string;
39
+ riskLevel: 'safe' | 'sensitive';
40
+ fields: ActionField[];
41
+ outputs: ActionOutputField[];
42
+ compile: (values: Record<string, any>, ctx: CompileCtx) => TaskDef;
43
+ decompile?: (task: TaskDef) => Record<string, any> | null;
44
+ mockOutput?: (values: Record<string, any>) => Record<string, any>;
45
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { BusinessStep } from '../../stepmodel/types';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ export interface ActionFormProps {
5
+ step: BusinessStep;
6
+ upstreamSteps: BusinessStep[];
7
+ workflowInputParams?: any[];
8
+ registry?: ActionRegistry;
9
+ onChange: (updatedStep: BusinessStep) => void;
10
+ disabled?: boolean;
11
+ }
12
+ export declare const ActionForm: React.FC<ActionFormProps>;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { BusinessStep } from '../../stepmodel/types';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ export interface DataPillInputProps {
5
+ value: any;
6
+ onChange: (val: any) => void;
7
+ placeholder?: string;
8
+ multiline?: boolean;
9
+ upstreamSteps: BusinessStep[];
10
+ registry?: ActionRegistry;
11
+ workflowInputParams?: any[];
12
+ disabled?: boolean;
13
+ }
14
+ export declare const DataPillInput: React.FC<DataPillInputProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { BusinessStep } from '../../stepmodel/types';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ import type { ActionDefinition } from '../../actions/types';
5
+ export interface DecisionBranchCardProps {
6
+ step: BusinessStep;
7
+ upstreamSteps: BusinessStep[];
8
+ registry?: ActionRegistry;
9
+ disabled?: boolean;
10
+ onChange: (updated: BusinessStep) => void;
11
+ onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
12
+ }
13
+ export declare const DecisionBranchCard: React.FC<DecisionBranchCardProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { BusinessStep } from '../../stepmodel/types';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ import type { ActionDefinition } from '../../actions/types';
5
+ export interface ForkJoinCardProps {
6
+ step: BusinessStep;
7
+ upstreamSteps: BusinessStep[];
8
+ registry?: ActionRegistry;
9
+ disabled?: boolean;
10
+ onChange: (updated: BusinessStep) => void;
11
+ onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
12
+ }
13
+ export declare const ForkJoinCard: React.FC<ForkJoinCardProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface FriendlyErrorCardProps {
3
+ rawError?: string;
4
+ statusCode?: number;
5
+ taskName?: string;
6
+ onActionClick?: (actionKey?: string) => void;
7
+ }
8
+ export declare const FriendlyErrorCard: React.FC<FriendlyErrorCardProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { BusinessStep } from '../../stepmodel/types';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ import type { ActionDefinition } from '../../actions/types';
5
+ export interface LoopDoWhileCardProps {
6
+ step: BusinessStep;
7
+ upstreamSteps: BusinessStep[];
8
+ registry?: ActionRegistry;
9
+ disabled?: boolean;
10
+ onChange: (updated: BusinessStep) => void;
11
+ onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
12
+ }
13
+ export declare const LoopDoWhileCard: React.FC<LoopDoWhileCardProps>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { BusinessStep, PillToken } from '../../stepmodel/types';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ export interface PillPickerProps {
5
+ upstreamSteps: BusinessStep[];
6
+ onSelect: (pill: PillToken) => void;
7
+ onClose: () => void;
8
+ registry?: ActionRegistry;
9
+ workflowInputParams?: any[];
10
+ }
11
+ export declare const PillPicker: React.FC<PillPickerProps>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { WorkflowInstance } from '../../types/conductor';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ export interface RunStoryTimelineProps {
5
+ instance: WorkflowInstance;
6
+ registry?: ActionRegistry;
7
+ onInspectStep?: (taskRef: string) => void;
8
+ }
9
+ export declare const RunStoryTimeline: React.FC<RunStoryTimelineProps>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { WorkflowDef, WorkflowInstance } from '../../types/conductor';
3
+ import { ActionRegistry } from '../../actions/registry';
4
+ export interface StepFlowEditorProps {
5
+ workflowDef: WorkflowDef | null;
6
+ onChange: (def: WorkflowDef) => void;
7
+ registry?: ActionRegistry;
8
+ readOnly?: boolean;
9
+ workflowExecution?: WorkflowInstance;
10
+ }
11
+ export declare const StepFlowEditor: React.FC<StepFlowEditorProps>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { WorkflowInstance } from '../../types/conductor';
3
+ import type { WorkflowTemplate } from '../../template/types';
4
+ export interface TemplateExtractorProps {
5
+ isOpen: boolean;
6
+ instance: WorkflowInstance;
7
+ onClose: () => void;
8
+ onPublished?: (template: WorkflowTemplate) => void;
9
+ }
10
+ export declare const TemplateExtractor: React.FC<TemplateExtractorProps>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { WorkflowDef } from '../../types/conductor';
3
+ import { TemplateStore } from '../../template/templateStore';
4
+ export interface TemplateGalleryProps {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ onSelectTemplate: (configuredDef: WorkflowDef) => void;
8
+ templateStore?: TemplateStore;
9
+ }
10
+ export declare const TemplateGallery: React.FC<TemplateGalleryProps>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { WorkflowDef } from '../../types/conductor';
3
+ import type { WorkflowTemplate } from '../../template/types';
4
+ export interface TemplateSetupWizardProps {
5
+ template: WorkflowTemplate;
6
+ onApply: (configuredDef: WorkflowDef) => void;
7
+ onClose: () => void;
8
+ }
9
+ export declare const TemplateSetupWizard: React.FC<TemplateSetupWizardProps>;
package/dist/index.d.ts CHANGED
@@ -8,3 +8,32 @@ export { getCompletionItems, buildDataFlowGraph, refactorTaskReferenceName, getU
8
8
  export type { WlspCompletionItem, DataFlowGraph, DataFlowEdge, InferredField, UpstreamTaskInfo, } from './services/wlsp/workflowLsp';
9
9
  export { executeLocalSandboxDryRun, buildDefaultWorkflowMockInput, generateDefaultTaskOutputPreview, } from './utils/localSandboxEngine';
10
10
  export type { SandboxDryRunOptions, TaskMockOverride, } from './utils/localSandboxEngine';
11
+ export * from './actions/types';
12
+ export { ActionRegistry, defaultActionRegistry } from './actions/registry';
13
+ export { BUILTIN_ECS_ACTIONS } from './actions/builtin/ecs';
14
+ export { BUILTIN_COMMON_ACTIONS } from './actions/builtin/common';
15
+ export * from './stepmodel/types';
16
+ export { compileStepToTaskDef, compileStepModelToWorkflowDef, } from './stepmodel/compile';
17
+ export { decompileTaskDefToStep, decompileWorkflowDefToStepModel, } from './stepmodel/decompile';
18
+ export { StepFlowEditor } from './components/business/StepFlowEditor';
19
+ export { DecisionBranchCard } from './components/business/DecisionBranchCard';
20
+ export { ForkJoinCard } from './components/business/ForkJoinCard';
21
+ export { LoopDoWhileCard } from './components/business/LoopDoWhileCard';
22
+ export { DataPillInput } from './components/business/DataPillInput';
23
+ export { ActionForm } from './components/business/ActionForm';
24
+ export * from './template/types';
25
+ export { TemplateStore, defaultTemplateStore } from './template/templateStore';
26
+ export { applyTemplateVariables } from './template/applyTemplate';
27
+ export { BUILTIN_WORKFLOW_TEMPLATES } from './template/builtin/templates';
28
+ export { TemplateGallery } from './components/template/TemplateGallery';
29
+ export { TemplateSetupWizard } from './components/template/TemplateSetupWizard';
30
+ export * from './template/sanitizer/types';
31
+ export { scanWorkflowDef, scanObjectForSensitiveFindings } from './template/sanitizer/rules';
32
+ export { analyzeTasksForPruning, applyTaskPruning } from './template/sanitizer/prune';
33
+ export { extractTemplateFromInstance } from './template/sanitizer/anonymize';
34
+ export { TemplateExtractor } from './components/template/TemplateExtractor';
35
+ export * from './utils/friendlyErrorTranslator';
36
+ export { FriendlyErrorCard } from './components/business/FriendlyErrorCard';
37
+ export type { FriendlyErrorCardProps } from './components/business/FriendlyErrorCard';
38
+ export { RunStoryTimeline } from './components/business/RunStoryTimeline';
39
+ export type { RunStoryTimelineProps } from './components/business/RunStoryTimeline';