@yiyi_zhang/reactflow-ui 0.5.0-beta.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.
- package/README.md +150 -117
- package/dist/AiWorkflowIDE.d.ts +2 -0
- package/dist/WorkflowIDE.d.ts +14 -2
- package/dist/actions/builtin/common.d.ts +8 -0
- package/dist/actions/builtin/ecs.d.ts +12 -0
- package/dist/actions/registry.d.ts +23 -0
- package/dist/actions/types.d.ts +45 -0
- package/dist/ai.d.ts +5 -1
- package/dist/components/AICopilot/ParameterSuggester.d.ts +9 -0
- package/dist/components/AiNative/AgentTimeline.d.ts +11 -6
- package/dist/components/AiNative/InlineCanvasCopilot.d.ts +7 -0
- package/dist/components/AiNative/ProposalPreviewCard.d.ts +3 -3
- package/dist/components/BrandLogo.d.ts +13 -0
- package/dist/components/ExecutionWaterfallPanel.d.ts +3 -0
- package/dist/components/SandboxConfigModal.d.ts +7 -0
- package/dist/components/StructuredJsonViewer.d.ts +11 -0
- package/dist/components/business/ActionForm.d.ts +12 -0
- package/dist/components/business/DataPillInput.d.ts +14 -0
- package/dist/components/business/DecisionBranchCard.d.ts +13 -0
- package/dist/components/business/ForkJoinCard.d.ts +13 -0
- package/dist/components/business/FriendlyErrorCard.d.ts +8 -0
- package/dist/components/business/LoopDoWhileCard.d.ts +13 -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 +11 -0
- package/dist/components/nodes/NodeLayout.d.ts +3 -1
- 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/hooks/useNodeExecution.d.ts +5 -2
- package/dist/index.d.ts +33 -0
- package/dist/logo.svg +37 -0
- package/dist/product-launch.html +1400 -0
- package/dist/reactflow-ui-ai.es.js +21392 -10
- package/dist/reactflow-ui.css +1 -1
- package/dist/reactflow-ui.es.js +20314 -9020
- package/dist/reactflow-ui.umd.js +31 -21
- package/dist/sample-workflows/ecs-lifecycle-automation.json +74 -0
- package/dist/services/ai/agentRunner.d.ts +23 -19
- package/dist/services/ai/draftPersistence.d.ts +3 -2
- package/dist/services/ai/systemPrompt.d.ts +1 -1
- package/dist/services/ai/toolExecutor.d.ts +15 -2
- package/dist/services/ai/workflowSynthesizer.d.ts +118 -0
- package/dist/services/wlsp/workflowLsp.d.ts +101 -0
- package/dist/stepmodel/compile.d.ts +5 -0
- package/dist/stepmodel/decompile.d.ts +5 -0
- package/dist/stepmodel/types.d.ts +61 -0
- package/dist/store/aiStore.d.ts +34 -3
- 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/aiEvents.d.ts +3 -1
- package/dist/types/conductor.d.ts +6 -1
- package/dist/types/workflow.d.ts +32 -0
- package/dist/utils/friendlyErrorTranslator.d.ts +26 -0
- package/dist/utils/localSandboxEngine.d.ts +49 -0
- package/package.json +7 -4
- package/dist/ai-BJwQZcGK.js +0 -15168
- package/dist/arc-BUGZGgtu.js +0 -83
- package/dist/architectureDiagram-3BPJPVTR-ZcgvTwSO.js +0 -4692
- package/dist/blockDiagram-GPEHLZMM-DtVtOBbH.js +0 -2418
- package/dist/c4Diagram-AAUBKEIU-tBS5Rcvm.js +0 -1577
- package/dist/channel-CURI9jmI.js +0 -5
- package/dist/chunk-2J33WTMH-D7gashNz.js +0 -19
- package/dist/chunk-4BX2VUAB-DE3VjyiZ.js +0 -8
- package/dist/chunk-55IACEB6-GYZ_m2MY.js +0 -8
- package/dist/chunk-727SXJPM-D4WVyvOg.js +0 -1528
- package/dist/chunk-AQP2D5EJ-Os2Uwqya.js +0 -1387
- package/dist/chunk-FMBD7UC4-B3CSVzS4.js +0 -19
- package/dist/chunk-ND2GUHAM-CNj_s1aK.js +0 -68
- package/dist/chunk-QZHKN3VN-DoV8iUKo.js +0 -15
- package/dist/classDiagram-4FO5ZUOK-Dr9C18x4.js +0 -16
- package/dist/classDiagram-v2-Q7XG4LA2-Dr9C18x4.js +0 -16
- package/dist/components/Controls/ModeSlider.d.ts +0 -2
- package/dist/cose-bilkent-S5V4N54A-CgQlI-io.js +0 -2609
- package/dist/cytoscape.esm-kVAWcYoG.js +0 -18755
- package/dist/dagre-BM42HDAG-CFMIuOmS.js +0 -445
- package/dist/defaultLocale-BgPVtth8.js +0 -171
- package/dist/diagram-2AECGRRQ-C5jZp2YX.js +0 -217
- package/dist/diagram-5GNKFQAL-DRUVcHpp.js +0 -123
- package/dist/diagram-KO2AKTUF-BOl4aaej.js +0 -461
- package/dist/diagram-LMA3HP47-ZeckPR2Q.js +0 -142
- package/dist/diagram-OG6HWLK6-qUWeLfa-.js +0 -528
- package/dist/erDiagram-TEJ5UH35-Bw_CWS13.js +0 -899
- package/dist/flowDiagram-I6XJVG4X-D3xEvQA-.js +0 -1628
- package/dist/ganttDiagram-6RSMTGT7-D8GvenY3.js +0 -2707
- package/dist/gitGraphDiagram-PVQCEYII-BWrN_HOm.js +0 -815
- package/dist/graph-BRoPeNF3.js +0 -1545
- package/dist/infoDiagram-5YYISTIA-Da8FG5tB.js +0 -24
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/ishikawaDiagram-YF4QCWOH-Bg2_mKEc.js +0 -621
- package/dist/journeyDiagram-JHISSGLW-sFIxGfua.js +0 -834
- package/dist/kanban-definition-UN3LZRKU-CGmopzHd.js +0 -724
- package/dist/katex-DoRnZ_sp.js +0 -11682
- package/dist/layout-D9EpM4Fg.js +0 -1728
- package/dist/linear-BA49eco4.js +0 -259
- package/dist/mermaid.core-XSpZEAKP.js +0 -16137
- package/dist/mindmap-definition-RKZ34NQL-Bqf76QGB.js +0 -827
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/pieDiagram-4H26LBE5-hHiP8HzL.js +0 -163
- package/dist/quadrantDiagram-W4KKPZXB-DSccwH8B.js +0 -1024
- package/dist/requirementDiagram-4Y6WPE33-DIpyoYZ_.js +0 -882
- package/dist/sankeyDiagram-5OEKKPKP-DsaPqq8D.js +0 -847
- package/dist/sequenceDiagram-3UESZ5HK-BNg7orie.js +0 -2891
- package/dist/stateDiagram-AJRCARHV-Rv1mSmnJ.js +0 -263
- package/dist/stateDiagram-v2-BHNVJYJU-BME16k02.js +0 -16
- package/dist/timeline-definition-PNZ67QCA-CmmzdVk-.js +0 -1055
- package/dist/vennDiagram-CIIHVFJN-BQt00w9Q.js +0 -1557
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +0 -22512
- package/dist/wardleyDiagram-YWT4CUSO-LZpiODGN.js +0 -675
- package/dist/xychartDiagram-2RQKCTM6-BpJlv_mc.js +0 -1342
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { WorkflowTemplate } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 模板 1: 云主机自动化交付与环境配置
|
|
4
|
+
*/
|
|
5
|
+
export declare const templateEcsAutoProvision: WorkflowTemplate;
|
|
6
|
+
/**
|
|
7
|
+
* 模板 2: 核心云主机每日定时快照备份
|
|
8
|
+
*/
|
|
9
|
+
export declare const templateEcsDailySnapshotBackup: WorkflowTemplate;
|
|
10
|
+
/**
|
|
11
|
+
* 模板 3: 主机高负载告警与在线自动升配
|
|
12
|
+
*/
|
|
13
|
+
export declare const templateEcsHighLoadAutoscale: WorkflowTemplate;
|
|
14
|
+
/**
|
|
15
|
+
* 模板 4: 生产主机一键漏洞巡检与修复
|
|
16
|
+
*/
|
|
17
|
+
export declare const templateEcsVulnerabilityPatch: WorkflowTemplate;
|
|
18
|
+
/**
|
|
19
|
+
* 模板 5: 非生产环境夜间定时关机降本
|
|
20
|
+
*/
|
|
21
|
+
export declare const templateEcsNightIdleShutdown: WorkflowTemplate;
|
|
22
|
+
/**
|
|
23
|
+
* 模板 6: 测试环境工作日早晨定时自动开机
|
|
24
|
+
*/
|
|
25
|
+
export declare const templateEcsMorningBoot: WorkflowTemplate;
|
|
26
|
+
/**
|
|
27
|
+
* 模板 7: 磁盘容量告警与在线自动扩容
|
|
28
|
+
*/
|
|
29
|
+
export declare const templateEcsDiskExpansion: WorkflowTemplate;
|
|
30
|
+
/**
|
|
31
|
+
* 模板 8: 突发入侵应急响应与快照取证
|
|
32
|
+
*/
|
|
33
|
+
export declare const templateEcsEmergencyIsolation: WorkflowTemplate;
|
|
34
|
+
/**
|
|
35
|
+
* 8 个官方场景化黄金模板清单
|
|
36
|
+
*/
|
|
37
|
+
export declare const BUILTIN_WORKFLOW_TEMPLATES: WorkflowTemplate[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkflowDef, WorkflowInstance } from '../../types/conductor';
|
|
2
|
+
import type { PruneRecommendation } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 启发式分析工作流中的冗余节点,识别边缘防御与调试任务,生成建议剪枝清单
|
|
5
|
+
*/
|
|
6
|
+
export declare function analyzeTasksForPruning(def: WorkflowDef, instance?: WorkflowInstance): PruneRecommendation[];
|
|
7
|
+
/**
|
|
8
|
+
* 根据管理员勾选的剪枝清单对工作流进行骨架修剪
|
|
9
|
+
*/
|
|
10
|
+
export declare function applyTaskPruning(def: WorkflowDef, prunedTaskRefs: Set<string>): WorkflowDef;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkflowDef } from '../../types/conductor';
|
|
2
|
+
import type { SensitiveFinding } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 递归深度扫描一个对象的所有属性值,识别其中的敏感配置
|
|
5
|
+
*/
|
|
6
|
+
export declare function scanObjectForSensitiveFindings(obj: any, taskRef: string, basePath: string, findings?: SensitiveFinding[]): SensitiveFinding[];
|
|
7
|
+
/**
|
|
8
|
+
* 扫描整个工作流定义,收集所有的敏感项
|
|
9
|
+
*/
|
|
10
|
+
export declare function scanWorkflowDef(def: WorkflowDef): SensitiveFinding[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { WorkflowInstance } from '../../types/conductor';
|
|
2
|
+
import type { WorkflowTemplate } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 敏感识别项类别
|
|
5
|
+
*/
|
|
6
|
+
export type SensitiveKind = 'credential' | 'network' | 'pii' | 'resourceId' | 'threshold';
|
|
7
|
+
/**
|
|
8
|
+
* 扫描出的敏感配置条目
|
|
9
|
+
*/
|
|
10
|
+
export interface SensitiveFinding {
|
|
11
|
+
id: string;
|
|
12
|
+
kind: SensitiveKind;
|
|
13
|
+
path: string;
|
|
14
|
+
taskRef: string;
|
|
15
|
+
keyName: string;
|
|
16
|
+
rawValue: any;
|
|
17
|
+
maskedValue: any;
|
|
18
|
+
suggestedVarName?: string;
|
|
19
|
+
action: 'mask' | 'variable' | 'keep';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 拓扑剪枝建议项
|
|
23
|
+
*/
|
|
24
|
+
export interface PruneRecommendation {
|
|
25
|
+
taskReferenceName: string;
|
|
26
|
+
taskName: string;
|
|
27
|
+
taskType: string;
|
|
28
|
+
reason: string;
|
|
29
|
+
selected: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 模板萃取生成结果包
|
|
33
|
+
*/
|
|
34
|
+
export interface ExtractionResult {
|
|
35
|
+
template: WorkflowTemplate;
|
|
36
|
+
findings: SensitiveFinding[];
|
|
37
|
+
prunedTasks: PruneRecommendation[];
|
|
38
|
+
report: {
|
|
39
|
+
extractedAt: string;
|
|
40
|
+
totalTasksScanned: number;
|
|
41
|
+
sensitiveItemsCount: number;
|
|
42
|
+
credentialsRedactedCount: number;
|
|
43
|
+
variablesCreatedCount: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 模板提炼输入选项
|
|
48
|
+
*/
|
|
49
|
+
export interface ExtractTemplateOptions {
|
|
50
|
+
instance: WorkflowInstance;
|
|
51
|
+
title?: string;
|
|
52
|
+
category?: WorkflowTemplate['category'];
|
|
53
|
+
valueProposition?: string;
|
|
54
|
+
author?: string;
|
|
55
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { WorkflowTemplate, TemplateCategory } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 场景化模板仓库管理器
|
|
4
|
+
*/
|
|
5
|
+
export declare class TemplateStore {
|
|
6
|
+
private templates;
|
|
7
|
+
constructor(initialTemplates?: WorkflowTemplate[]);
|
|
8
|
+
/**
|
|
9
|
+
* 注册单个工作流模板
|
|
10
|
+
*/
|
|
11
|
+
register(template: WorkflowTemplate): void;
|
|
12
|
+
/**
|
|
13
|
+
* 批量注册工作流模板
|
|
14
|
+
*/
|
|
15
|
+
registerAll(templates: WorkflowTemplate[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* 获取所有可用模板
|
|
18
|
+
*/
|
|
19
|
+
getAllTemplates(): WorkflowTemplate[];
|
|
20
|
+
/**
|
|
21
|
+
* 按 ID 查找模板
|
|
22
|
+
*/
|
|
23
|
+
getTemplateById(id: string): WorkflowTemplate | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* 按分类或关键词检索模板
|
|
26
|
+
*/
|
|
27
|
+
search(query?: string, category?: TemplateCategory | 'all'): WorkflowTemplate[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 全局默认场景化模板中心仓库(预置 8 个官方黄金模板)
|
|
31
|
+
*/
|
|
32
|
+
export declare const defaultTemplateStore: TemplateStore;
|
|
@@ -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
|
+
}
|
package/dist/types/aiEvents.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* />
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
export type AiEventType = 'proposal:created' | 'proposal:accepted' | 'proposal:accepted:partial' | 'proposal:rejected' | 'plan:created' | 'plan:executed' | 'plan:cancelled' | 'repair:proposed'
|
|
12
|
+
export type AiEventType = 'proposal:created' | 'proposal:accepted' | 'proposal:accepted:partial' | 'proposal:rejected' | 'stage:completed' | 'session:resumed' | 'plan:created' | 'plan:executed' | 'plan:cancelled' | 'repair:proposed'
|
|
13
13
|
/** User clicked the inline second-click confirmation before a runtime-mutating repair action fires */
|
|
14
14
|
| 'repair:confirmed' | 'repair:executed' | 'repair:dismissed' | 'tool:called' | 'undo:applied'
|
|
15
15
|
/** AI request failed (network/HTTP/provider error). The user only ever sees a humanized
|
|
@@ -20,6 +20,8 @@ export interface AiEvent {
|
|
|
20
20
|
timestamp: number;
|
|
21
21
|
/** For tool:called events */
|
|
22
22
|
tool?: string;
|
|
23
|
+
/** For stage:completed events */
|
|
24
|
+
phase?: string;
|
|
23
25
|
/** For repair:executed / repair:confirmed events */
|
|
24
26
|
repairActionType?: string;
|
|
25
27
|
/** For proposal events: change counts */
|
|
@@ -54,7 +54,9 @@ export interface TaskDef {
|
|
|
54
54
|
};
|
|
55
55
|
sink?: string;
|
|
56
56
|
evaluatorType?: 'graaljs' | 'javascript' | 'value-param' | 'python';
|
|
57
|
+
expression?: string;
|
|
57
58
|
caseExpression?: string;
|
|
59
|
+
defaultExclusiveJoinTask?: string[];
|
|
58
60
|
keepLastN?: number;
|
|
59
61
|
forkTaskType?: string;
|
|
60
62
|
forkTaskName?: string;
|
|
@@ -168,7 +170,7 @@ export interface TaskInstance {
|
|
|
168
170
|
executed?: boolean;
|
|
169
171
|
callbackFromWorker?: boolean;
|
|
170
172
|
responseTimeoutSeconds?: number;
|
|
171
|
-
workflowInstanceId
|
|
173
|
+
workflowInstanceId?: string;
|
|
172
174
|
workflowType?: string;
|
|
173
175
|
taskId: string;
|
|
174
176
|
reasonForIncompletion?: string;
|
|
@@ -176,6 +178,7 @@ export interface TaskInstance {
|
|
|
176
178
|
workerId?: string;
|
|
177
179
|
externalInputPayloadStoragePath?: string;
|
|
178
180
|
externalOutputPayloadStoragePath?: string;
|
|
181
|
+
workflowTask?: TaskDef;
|
|
179
182
|
}
|
|
180
183
|
/**
|
|
181
184
|
* Conductor 工作流实例 (运行时)
|
|
@@ -184,6 +187,8 @@ export interface WorkflowInstance {
|
|
|
184
187
|
status: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'TERMINATED' | 'PAUSED';
|
|
185
188
|
endTime?: number;
|
|
186
189
|
workflowId: string;
|
|
190
|
+
workflowName?: string;
|
|
191
|
+
workflowVersion?: number;
|
|
187
192
|
parentWorkflowId?: string;
|
|
188
193
|
parentWorkflowTaskId?: string;
|
|
189
194
|
tasks: TaskInstance[];
|
package/dist/types/workflow.d.ts
CHANGED
|
@@ -213,6 +213,24 @@ export interface WorkflowState {
|
|
|
213
213
|
showAnalysisPanel: boolean;
|
|
214
214
|
/** P4.1 聚焦参数字段("去修复"跳转时使用) */
|
|
215
215
|
focusedParamKey: string | null;
|
|
216
|
+
/** W-LSP: 是否在画布叠加显示数据血缘飞线 (Data Lineage DFG) */
|
|
217
|
+
showDataLineage: boolean;
|
|
218
|
+
/** W-LSP: 最近一次引用名重构提示结构 */
|
|
219
|
+
lastRefactorNotice: {
|
|
220
|
+
oldRef: string;
|
|
221
|
+
newRef: string;
|
|
222
|
+
replacedCount: number;
|
|
223
|
+
affectedTasks: string[];
|
|
224
|
+
timestamp: number;
|
|
225
|
+
} | null;
|
|
226
|
+
/** 运行态:是否显示底部并发瀑布流与时空回放面板 */
|
|
227
|
+
showWaterfallPanel: boolean;
|
|
228
|
+
/** 运行态:时空旅行回放游标时间戳 (ms),为 null 表示展示最终实时态 */
|
|
229
|
+
timeTravelTimestamp: number | null;
|
|
230
|
+
/** 运行态:每个 DO_WHILE 循环容器当前选中的迭代轮次 (loopRef -> iteration) */
|
|
231
|
+
activeLoopIterations: Record<string, number>;
|
|
232
|
+
/** AI 共驾:画布原位 Cmd+K 浮窗当前锚定的任务引用名 */
|
|
233
|
+
inlineCopilotTaskRef: string | null;
|
|
216
234
|
}
|
|
217
235
|
/**
|
|
218
236
|
* 工作流操作接口
|
|
@@ -264,6 +282,20 @@ export interface WorkflowActions {
|
|
|
264
282
|
setRunState: (state: RunState, execId?: string | null, error?: string | null) => void;
|
|
265
283
|
/** P4.3: 切回 edit 模式并聚焦到指定任务的指定参数字段 */
|
|
266
284
|
switchToEditAndFocusParam: (taskRef: string, paramKey?: string) => void;
|
|
285
|
+
/** W-LSP: 切换数据血缘飞线叠加显示 */
|
|
286
|
+
setShowDataLineage: (show: boolean) => void;
|
|
287
|
+
/** W-LSP: 清除重构提示文案 */
|
|
288
|
+
clearRefactorNotice: () => void;
|
|
289
|
+
/** 运行态:切换底部并发瀑布流面板 */
|
|
290
|
+
setShowWaterfallPanel: (show: boolean) => void;
|
|
291
|
+
/** 运行态:设置时空旅行时间戳 */
|
|
292
|
+
setTimeTravelTimestamp: (ts: number | null) => void;
|
|
293
|
+
/** 运行态:切换指定 DO_WHILE 循环容器的展示迭代轮次 */
|
|
294
|
+
setLoopIteration: (loopRef: string, iteration: number) => void;
|
|
295
|
+
/** AI 共驾:打开/关闭画布原位 Cmd+K 浮窗 */
|
|
296
|
+
setInlineCopilotTaskRef: (taskRef: string | null) => void;
|
|
297
|
+
/** 本地沙箱:在浏览器内执行零延迟确定性试运行并进入调试视图 */
|
|
298
|
+
runLocalSandboxDryRun: (mockInput?: Record<string, any>, taskMocks?: Record<string, any>, maxLoopIterations?: number) => void;
|
|
267
299
|
}
|
|
268
300
|
/**
|
|
269
301
|
* 重启选项
|
|
@@ -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;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { WorkflowDef, TaskDef as WorkflowTask, WorkflowInstance, TaskInstance as TaskExecution } from '../types/conductor';
|
|
2
|
+
export interface TaskMockOverride {
|
|
3
|
+
__isMockOverride?: boolean;
|
|
4
|
+
/** Override execution status (e.g. simulate FAILED or TIMED_OUT) */
|
|
5
|
+
status?: 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'COMPLETED_WITH_ERRORS';
|
|
6
|
+
/** Override simulated execution duration in ms */
|
|
7
|
+
durationMs?: number;
|
|
8
|
+
/** For SWITCH / DECISION tasks: force routing to a specific case key (or '__default__') */
|
|
9
|
+
forceCase?: string;
|
|
10
|
+
/** Custom outputData JSON for this task */
|
|
11
|
+
outputData?: Record<string, any>;
|
|
12
|
+
/** Custom error message when status is FAILED / TIMED_OUT */
|
|
13
|
+
reasonForIncompletion?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SandboxDryRunOptions {
|
|
16
|
+
/** Mock workflow input JSON */
|
|
17
|
+
workflowInput?: Record<string, any>;
|
|
18
|
+
/** Custom task output or behavior overrides keyed by taskReferenceName */
|
|
19
|
+
taskMocks?: Record<string, Record<string, any> | TaskMockOverride>;
|
|
20
|
+
/** Max iterations per DO_WHILE loop in dry-run (default: 2) */
|
|
21
|
+
maxLoopIterations?: number;
|
|
22
|
+
}
|
|
23
|
+
interface SandboxRuntimeContext {
|
|
24
|
+
workflowInput: Record<string, any>;
|
|
25
|
+
variables: Record<string, any>;
|
|
26
|
+
taskOutputs: Record<string, Record<string, any>>;
|
|
27
|
+
taskMocks: Record<string, Record<string, any> | TaskMockOverride>;
|
|
28
|
+
tasks: TaskExecution[];
|
|
29
|
+
currentTimeMs: number;
|
|
30
|
+
maxLoopIterations: number;
|
|
31
|
+
seqCounter: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve Conductor `${...}` expressions against current sandbox context
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveExpressionValue(val: any, ctx: SandboxRuntimeContext): any;
|
|
37
|
+
/**
|
|
38
|
+
* Generate default synthetic output for a given task (used both at runtime and as UI template preview)
|
|
39
|
+
*/
|
|
40
|
+
export declare function generateDefaultTaskOutputPreview(task: WorkflowTask, resolvedInput?: Record<string, any>, iteration?: number): Record<string, any>;
|
|
41
|
+
/**
|
|
42
|
+
* Build default mock input from workflowDef.inputParameters and auto-discovered ${workflow.input.*} references
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildDefaultWorkflowMockInput(workflowDef: WorkflowDef): Record<string, any>;
|
|
45
|
+
/**
|
|
46
|
+
* Execute an entire WorkflowDef in-browser deterministically and return a complete WorkflowInstance
|
|
47
|
+
*/
|
|
48
|
+
export declare function executeLocalSandboxDryRun(workflowDef: WorkflowDef, options?: SandboxDryRunOptions): WorkflowInstance;
|
|
49
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yiyi_zhang/reactflow-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Conductor Workflow IDE —
|
|
3
|
+
"version": "1.1.0",
|
|
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",
|
|
7
7
|
"workflow",
|
|
8
8
|
"reactflow",
|
|
9
9
|
"react",
|
|
10
10
|
"visual-editor",
|
|
11
|
-
"dag"
|
|
11
|
+
"dag",
|
|
12
|
+
"ai-workflow",
|
|
13
|
+
"wlsp",
|
|
14
|
+
"sandbox"
|
|
12
15
|
],
|
|
13
16
|
"license": "MIT",
|
|
14
17
|
"repository": {
|
|
@@ -41,6 +44,7 @@
|
|
|
41
44
|
"scripts": {
|
|
42
45
|
"dev": "vite",
|
|
43
46
|
"build": "vite build && vite build --mode ai && tsc -p tsconfig.build.json",
|
|
47
|
+
"build:demo": "vite build --mode demo",
|
|
44
48
|
"lint": "eslint .",
|
|
45
49
|
"preview": "vite preview",
|
|
46
50
|
"test": "vitest run",
|
|
@@ -50,7 +54,6 @@
|
|
|
50
54
|
"dependencies": {
|
|
51
55
|
"dagre": "^0.8.5",
|
|
52
56
|
"lucide-react": "^0.562.0",
|
|
53
|
-
"mermaid": "^11.15.0",
|
|
54
57
|
"react-hotkeys-hook": "^5.2.1",
|
|
55
58
|
"zundo": "^2.3.0",
|
|
56
59
|
"zustand": "^5.0.9"
|