@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.
Files changed (72) hide show
  1. package/README.md +28 -3
  2. package/dist/AiWorkflowIDE.d.ts +21 -0
  3. package/dist/WorkflowIDE.d.ts +34 -0
  4. package/dist/actions/builtin/common.d.ts +8 -0
  5. package/dist/actions/builtin/ecs.d.ts +12 -0
  6. package/dist/actions/fromDefinitions.d.ts +70 -0
  7. package/dist/actions/registry.d.ts +24 -0
  8. package/dist/actions/types.d.ts +71 -0
  9. package/dist/ai.d.ts +9 -0
  10. package/dist/components/AiNative/AiCommandCenter.d.ts +4 -0
  11. package/dist/components/business/ActionForm.d.ts +12 -0
  12. package/dist/components/business/ActionPickerModal.d.ts +25 -0
  13. package/dist/components/business/DataPillInput.d.ts +16 -0
  14. package/dist/components/business/DecisionBranchCard.d.ts +15 -0
  15. package/dist/components/business/ForkJoinCard.d.ts +15 -0
  16. package/dist/components/business/FriendlyErrorCard.d.ts +8 -0
  17. package/dist/components/business/LibraryVersionBadge.d.ts +29 -0
  18. package/dist/components/business/LoopDoWhileCard.d.ts +15 -0
  19. package/dist/components/business/NestedControlStep.d.ts +22 -0
  20. package/dist/components/business/PillPicker.d.ts +11 -0
  21. package/dist/components/business/RunStoryTimeline.d.ts +9 -0
  22. package/dist/components/business/StepFlowEditor.d.ts +20 -0
  23. package/dist/components/business/StepListEditor.d.ts +29 -0
  24. package/dist/components/template/TemplateExtractor.d.ts +10 -0
  25. package/dist/components/template/TemplateGallery.d.ts +10 -0
  26. package/dist/components/template/TemplateSetupWizard.d.ts +9 -0
  27. package/dist/index.d.ts +36 -1
  28. package/dist/library/catalog.d.ts +93 -0
  29. package/dist/library/conductorProvider.d.ts +41 -0
  30. package/dist/library/diff.d.ts +62 -0
  31. package/dist/library/index.d.ts +16 -0
  32. package/dist/library/level.d.ts +6 -0
  33. package/dist/library/naming.d.ts +28 -0
  34. package/dist/library/projections.d.ts +53 -0
  35. package/dist/library/types.d.ts +58 -0
  36. package/dist/library/useLibraryCatalog.d.ts +9 -0
  37. package/dist/library/version.d.ts +17 -0
  38. package/dist/library/versionStatus.d.ts +44 -0
  39. package/dist/product-launch.html +3 -3
  40. package/dist/reactflow-ui-ai.es.js +14330 -8509
  41. package/dist/reactflow-ui.css +1 -1
  42. package/dist/reactflow-ui.es.js +16707 -8202
  43. package/dist/reactflow-ui.umd.js +30 -24
  44. package/dist/sample-workflows/ecs-lifecycle-automation.json +74 -0
  45. package/dist/sample-workflows/library-capabilities-demo.json +66 -0
  46. package/dist/services/ai/agentRunner.d.ts +11 -0
  47. package/dist/services/ai/schemaRegistry.d.ts +7 -1
  48. package/dist/services/ai/systemPrompt.d.ts +11 -0
  49. package/dist/services/ai/toolExecutor.d.ts +12 -0
  50. package/dist/services/ai/workflowSynthesizer.d.ts +28 -3
  51. package/dist/stepmodel/compile.d.ts +11 -0
  52. package/dist/stepmodel/decompile.d.ts +10 -0
  53. package/dist/stepmodel/factory.d.ts +8 -0
  54. package/dist/stepmodel/types.d.ts +64 -0
  55. package/dist/store/ideStoresContext.d.ts +3 -0
  56. package/dist/store/workflowStore.d.ts +1 -0
  57. package/dist/template/applyTemplate.d.ts +10 -0
  58. package/dist/template/builtin/templates.d.ts +37 -0
  59. package/dist/template/sanitizer/anonymize.d.ts +5 -0
  60. package/dist/template/sanitizer/prune.d.ts +10 -0
  61. package/dist/template/sanitizer/rules.d.ts +10 -0
  62. package/dist/template/sanitizer/types.d.ts +55 -0
  63. package/dist/template/templateStore.d.ts +32 -0
  64. package/dist/template/types.d.ts +99 -0
  65. package/dist/types/conductor.d.ts +13 -8
  66. package/dist/types/workflow.d.ts +9 -0
  67. package/dist/types/workflowLibrary.d.ts +2 -0
  68. package/dist/utils/friendlyErrorTranslator.d.ts +26 -0
  69. package/dist/utils/taskTypeMeta.d.ts +3 -3
  70. package/package.json +1 -1
  71. package/dist/components/AiNative/BusinessCanvas.d.ts +0 -15
  72. package/dist/components/Controls/ModeSlider.d.ts +0 -2
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "ecs_lifecycle_automation",
3
+ "description": "云主机全生命周期自动化:自动创建实例 -> 轮询查询详情 -> 远程下发初始化运维命令 -> 创建安全快照 -> 发送协同群通知",
4
+ "version": 1,
5
+ "schemaVersion": 2,
6
+ "tasks": [
7
+ {
8
+ "name": "ecs_create_instance",
9
+ "taskReferenceName": "create_app_node",
10
+ "type": "HTTP",
11
+ "description": "创建云主机: app-server-node",
12
+ "inputParameters": {
13
+ "_actionId": "ecs.create_instance",
14
+ "actionName": "创建云主机",
15
+ "regionId": "cn-hangzhou",
16
+ "instanceType": "ecs.c7.xlarge",
17
+ "imageId": "image-alilinux-3",
18
+ "instanceName": "app-server-node",
19
+ "systemDiskSize": 120
20
+ }
21
+ },
22
+ {
23
+ "name": "ecs_query_instance",
24
+ "taskReferenceName": "query_node_status",
25
+ "type": "HTTP",
26
+ "description": "查询云主机详情与IP地址",
27
+ "inputParameters": {
28
+ "_actionId": "ecs.query_instance",
29
+ "actionName": "查询云主机详情",
30
+ "instanceId": "${create_app_node.output.instanceId}"
31
+ }
32
+ },
33
+ {
34
+ "name": "ecs_run_command",
35
+ "taskReferenceName": "init_server_env",
36
+ "type": "HTTP",
37
+ "description": "主机下发命令: 初始化运行时环境",
38
+ "inputParameters": {
39
+ "_actionId": "ecs.run_command",
40
+ "actionName": "执行远程运维脚本",
41
+ "instanceId": "${create_app_node.output.instanceId}",
42
+ "commandType": "RunShellScript",
43
+ "commandContent": "yum update -y && systemctl start docker && docker ps",
44
+ "timeoutSeconds": 60
45
+ }
46
+ },
47
+ {
48
+ "name": "ecs_create_snapshot",
49
+ "taskReferenceName": "create_backup_snapshot",
50
+ "type": "HTTP",
51
+ "description": "创建安全回滚快照",
52
+ "inputParameters": {
53
+ "_actionId": "ecs.create_snapshot",
54
+ "actionName": "创建云盘快照",
55
+ "instanceId": "${create_app_node.output.instanceId}",
56
+ "snapshotName": "init-baseline-snapshot",
57
+ "retentionDays": 14
58
+ }
59
+ },
60
+ {
61
+ "name": "send_operation_notification",
62
+ "taskReferenceName": "notify_devops_team",
63
+ "type": "EVENT",
64
+ "description": "发送协同群通知",
65
+ "inputParameters": {
66
+ "_actionId": "notify.send_message",
67
+ "actionName": "发送运维通知",
68
+ "channel": "webhook_dingtalk",
69
+ "title": "【部署就绪】新云主机已初始化并完成快照",
70
+ "content": "主机 ${create_app_node.output.instanceId} 已完成环境配置并生成基线快照,内网IP: ${query_node_status.output.privateIp}。"
71
+ }
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "custom-L2-应用管理-demo-library_showcase",
3
+ "description": "流程库能力演示:引用治理服务中的库能力并固定版本。含「有新版本」、「版本不可用」(已撤回 / 已下线)与当前版本四种状态。",
4
+ "version": 1,
5
+ "schemaVersion": 2,
6
+ "ownerEmail": "platform-governance@example.com",
7
+ "tasks": [
8
+ {
9
+ "name": "std-L1-配置管理-cmdb-query_ci",
10
+ "taskReferenceName": "query_ci",
11
+ "type": "SUB_WORKFLOW",
12
+ "description": "查询配置项(固定 v1,库已有 v2:新增必填「租户编号」、删除出参「耗时」)",
13
+ "inputParameters": {
14
+ "ciType": "服务器",
15
+ "keyword": "order",
16
+ "pageSize": 20
17
+ },
18
+ "subWorkflowParam": {
19
+ "name": "std-L1-配置管理-cmdb-query_ci",
20
+ "version": 1
21
+ }
22
+ },
23
+ {
24
+ "name": "std-L1-云资源-ecs-snapshot",
25
+ "taskReferenceName": "snapshot_vm",
26
+ "type": "SUB_WORKFLOW",
27
+ "description": "云主机快照(固定 v1,该版本已被治理服务撤回)",
28
+ "inputParameters": {
29
+ "instanceId": "i-demo0001"
30
+ },
31
+ "subWorkflowParam": {
32
+ "name": "std-L1-云资源-ecs-snapshot",
33
+ "version": 1
34
+ }
35
+ },
36
+ {
37
+ "name": "std-L1-系统工具-sftp-upload_file",
38
+ "taskReferenceName": "upload_pkg",
39
+ "type": "SUB_WORKFLOW",
40
+ "description": "SFTP 上传文件(该能力已下线)",
41
+ "inputParameters": {
42
+ "host": "10.20.30.41",
43
+ "remotePath": "/data/upload",
44
+ "fileUrl": "http://mock-gateway.internal/files/demo.tar.gz"
45
+ },
46
+ "subWorkflowParam": {
47
+ "name": "std-L1-系统工具-sftp-upload_file",
48
+ "version": 1
49
+ }
50
+ },
51
+ {
52
+ "name": "std-L1-通知协助-msg-send_sms",
53
+ "taskReferenceName": "notify_owner",
54
+ "type": "SUB_WORKFLOW",
55
+ "description": "发送短信(固定 v2,即当前最新版本)",
56
+ "inputParameters": {
57
+ "phone": "13800000001",
58
+ "content": "配置项查询完成,共 ${query_ci.output.total} 条,耗时 ${query_ci.output.costMs} 毫秒"
59
+ },
60
+ "subWorkflowParam": {
61
+ "name": "std-L1-通知协助-msg-send_sms",
62
+ "version": 2
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import type { AiStore } from '../../store/aiStore';
17
17
  import type { LibraryStore } from '../../store/libraryStore';
18
+ import type { LibraryCatalog } from '../../library/catalog';
18
19
  import type { ToolRegistry } from './toolRegistry';
19
20
  import type { AiEvent } from '../../types/aiEvents';
20
21
  import type { UseBoundStore, StoreApi } from 'zustand';
@@ -26,11 +27,17 @@ export interface AgentRunnerOptions {
26
27
  canRepair?: boolean;
27
28
  };
28
29
  onAiEvent?: (event: AiEvent) => void;
30
+ /** 流程库目录注入系统提示词的条数上限(缺省 50);超出部分提示 AI 改用 search_workflow_library */
31
+ promptCatalogLimit?: number;
32
+ /** 任务 Schema 注入系统提示词的条数上限(缺省不限制) */
33
+ promptSchemaLimit?: number;
29
34
  }
30
35
  export interface AgentRunnerStores {
31
36
  aiStore: UseBoundStore<StoreApi<AiStore>>;
32
37
  libraryStore: UseBoundStore<StoreApi<LibraryStore>>;
33
38
  toolRegistry: ToolRegistry;
39
+ /** 本 IDE 实例的流程库目录;提供后用于固定子工作流版本与服务端检索 */
40
+ libraryCatalog?: LibraryCatalog;
34
41
  }
35
42
  export declare class AgentRunner {
36
43
  private getOptions;
@@ -39,7 +46,11 @@ export declare class AgentRunner {
39
46
  constructor(getOptions: () => AgentRunnerOptions, stores: AgentRunnerStores);
40
47
  abort(): void;
41
48
  private toolExecutionContext;
49
+ /** 子工作流版本固定:把目录里的「当前最新版本」以查询函数的形式注入纯函数的工具执行层 */
50
+ private latestVersionResolver;
42
51
  private buildHistory;
52
+ /** 服务端检索:Provider 没有 search、或检索失败时返回 undefined(调用方退回本地匹配) */
53
+ private serverLibrarySearch;
43
54
  /**
44
55
  * Immediately promotes the current in-progress `workingDraft` (from an interrupted or paused
45
56
  * multi-phase session) into a reviewable `pendingProposal`.
@@ -45,7 +45,13 @@ declare class SchemaRegistry {
45
45
  get(taskName: string): TaskSchema | undefined;
46
46
  getAll(): TaskSchema[];
47
47
  hasSchemas(): boolean;
48
- buildPromptSection(): string | null;
48
+ /**
49
+ * @param options.limit 最多注入的 Schema 条数(缺省不限制)。目录很大时用来控制提示词体积,
50
+ * 超出部分提示改用 search_workflow_library 检索。
51
+ */
52
+ buildPromptSection(options?: {
53
+ limit?: number;
54
+ }): string | null;
49
55
  }
50
56
  export declare const schemaRegistry: SchemaRegistry;
51
57
  export {};
@@ -27,4 +27,15 @@ export declare function buildSystemPrompt(userInput: string, workflowSnapshot: W
27
27
  systemPromptExtra?: string;
28
28
  viewMode?: ViewMode;
29
29
  pendingProposalDef?: import('../../types/conductor').WorkflowDef;
30
+ /** 流程库目录注入提示词的条数上限,默认 DEFAULT_PROMPT_CATALOG_LIMIT;超出部分提示改用 search_workflow_library */
31
+ promptCatalogLimit?: number;
32
+ /** 任务 Schema 注入提示词的条数上限;缺省不限制(保持旧行为) */
33
+ promptSchemaLimit?: number;
30
34
  }): string;
35
+ /** 目录注入提示词的默认条数上限(治理平台可能有 1000+ 工作流,不能全量塞进提示词) */
36
+ export declare const DEFAULT_PROMPT_CATALOG_LIMIT = 50;
37
+ /**
38
+ * 构建流程库目录段落。
39
+ * 超过 limit 时按层级 L3 -> L2 -> L1 截断(高层场景优先),并写明剩余数量与检索指引。
40
+ */
41
+ export declare function buildLibraryCatalog(allItems: WorkflowLibraryItem[], limit?: number): string | null;
@@ -84,7 +84,19 @@ export interface ToolExecutionContext {
84
84
  workingDraft?: WorkflowDef | null;
85
85
  validationResults: ValidationResults;
86
86
  libraryItems: WorkflowLibraryItem[];
87
+ /**
88
+ * 查询流程库中某个名称的当前最新版本(由调用方注入,本模块保持纯净、不读 store)。
89
+ * 提供后,AI 新建的 SUB_WORKFLOW 缺少版本时固定为库当前版本;已有版本号一律不改。
90
+ */
91
+ resolveLatestVersion?: (name: string) => number | undefined;
92
+ /**
93
+ * 服务端检索命中(由调用方在调用前预取,通常来自 LibraryProvider.search)。
94
+ * 提供时 search_workflow_library 直接展示这些结果,不再在 libraryItems 内本地匹配。
95
+ */
96
+ librarySearchResults?: WorkflowLibraryItem[];
87
97
  }
98
+ /** 工作流库检索结果最多展示的条数(目录可能有上千项,避免一次塞满上下文) */
99
+ export declare const LIBRARY_SEARCH_RESULT_LIMIT = 50;
88
100
  export declare function applyPatch(def: WorkflowDef, ops: PatchOp[]): WorkflowDef;
89
101
  export declare function computeDiff(before: WorkflowDef | null, after: WorkflowDef): DiffSummary;
90
102
  export declare function executeToolCall(toolName: string, args: Record<string, any>, ctx: ToolExecutionContext): ToolCallResult;
@@ -66,6 +66,21 @@ export interface VerificationSummary {
66
66
  * Collects all tasks in execution order (pre-order traversal of top-level and nested tasks).
67
67
  */
68
68
  export declare function collectAllTasksInOrder(tasks?: TaskDef[]): TaskDef[];
69
+ /**
70
+ * 规范化选项(均为可选,保持本模块为纯函数:数据由调用方注入,不读取任何 store)。
71
+ */
72
+ export interface NormalizeOptions {
73
+ /**
74
+ * 查询工作流库中某个名称的当前最新版本。提供后,新建的 SUB_WORKFLOW 若没有
75
+ * `subWorkflowParam.version`,会固定为库当前版本;已有版本号一律不改。
76
+ */
77
+ resolveLatestVersion?: (name: string) => number | undefined;
78
+ /**
79
+ * 画布上已存在的任务引用名。这些任务不会被自动补版本——
80
+ * 未固定版本的旧步骤保持原语义,避免 AI 改动其它内容时顺带改变它们。
81
+ */
82
+ existingRefs?: ReadonlySet<string>;
83
+ }
69
84
  /**
70
85
  * Normalizes a single task's structure to prevent common LLM schema mismatches:
71
86
  * - Ensures `name` and `taskReferenceName` and `type` exist
@@ -73,7 +88,7 @@ export declare function collectAllTasksInOrder(tasks?: TaskDef[]): TaskDef[];
73
88
  * - Normalizes `SUB_WORKFLOW` `workflowName` into `subWorkflowParam.name`
74
89
  * - Normalizes `TERMINATE` `terminationStatus` into `inputParameters.terminationStatus`
75
90
  */
76
- export declare function normalizeTaskDef(task: TaskDef, autoFixed?: string[]): TaskDef;
91
+ export declare function normalizeTaskDef(task: TaskDef, autoFixed?: string[], options?: NormalizeOptions): TaskDef;
77
92
  /**
78
93
  * Extracts all `${...}` expressions from an arbitrary JSON value.
79
94
  */
@@ -84,7 +99,17 @@ export declare function extractExpressions(value: any): string[];
84
99
  * - Normalizes all tasks and FORK_JOIN <-> JOIN pairings
85
100
  * - Auto-collects `${workflow.input.xxx}` into `workflow.inputParameters` if missing
86
101
  */
87
- export declare function normalizeWorkflowDef(def: WorkflowDef): {
102
+ export declare function normalizeWorkflowDef(def: WorkflowDef, options?: NormalizeOptions): {
103
+ workflow: WorkflowDef;
104
+ autoFixed: string[];
105
+ };
106
+ /**
107
+ * 只做「SUB_WORKFLOW 固定版本」的轻量规范化(供 replace_workflow / patch_workflow 使用,
108
+ * 这两条路径不经过完整的 normalizeWorkflowDef):
109
+ * 为新建的、未记录版本的子工作流任务填入流程库当前版本。已有版本号、画布上已存在的任务一律不改。
110
+ * 未提供 resolveLatestVersion 时原样返回。
111
+ */
112
+ export declare function pinSubWorkflowVersions(def: WorkflowDef, options: NormalizeOptions): {
88
113
  workflow: WorkflowDef;
89
114
  autoFixed: string[];
90
115
  };
@@ -102,7 +127,7 @@ export declare function applyTopologyScaffold(currentDraft: WorkflowDef | null,
102
127
  /**
103
128
  * Phase 3: Enriches individual tasks in the working draft with detailed configurations.
104
129
  */
105
- export declare function applyTaskConfigurations(currentDraft: WorkflowDef, args: ConfigureTasksArgs): {
130
+ export declare function applyTaskConfigurations(currentDraft: WorkflowDef, args: ConfigureTasksArgs, options?: NormalizeOptions): {
106
131
  workflow: WorkflowDef;
107
132
  configuredRefs: string[];
108
133
  missingRefs: string[];
@@ -0,0 +1,11 @@
1
+ import type { WorkflowDef, TaskDef } from '../types/conductor';
2
+ import type { BusinessWorkflowModel, BusinessStep } from './types';
3
+ import { ActionRegistry } from '../actions/registry';
4
+ export declare function compileStepToTaskDef(step: BusinessStep, index: number, workflowName: string, registry?: ActionRegistry): TaskDef;
5
+ /**
6
+ * 编译一组顺序步骤(顶层、分支内、泳道内、循环体内通用,可任意层级嵌套)。
7
+ * 遇到 FORK_JOIN 时,会在其后自动补全配对的 JOIN 节点,
8
+ * joinOn 取各泳道编译后的最后一个任务(若泳道末尾是嵌套并行,则为其 JOIN)。
9
+ */
10
+ export declare function compileStepList(steps: BusinessStep[], workflowName: string, registry?: ActionRegistry): TaskDef[];
11
+ export declare function compileStepModelToWorkflowDef(model: BusinessWorkflowModel, registry?: ActionRegistry): WorkflowDef;
@@ -0,0 +1,10 @@
1
+ import type { WorkflowDef, TaskDef } from '../types/conductor';
2
+ import type { BusinessWorkflowModel, BusinessStep } from './types';
3
+ import { ActionRegistry } from '../actions/registry';
4
+ export declare function decompileTaskDefToStep(task: TaskDef, index: number, registry?: ActionRegistry): BusinessStep;
5
+ /**
6
+ * 反编译一组顺序任务(顶层、分支内、泳道内、循环体内通用,可任意层级嵌套)。
7
+ * FORK_JOIN 后配对的 JOIN 节点会被折叠进并行组(记录在 pairedJoinTaskRef),不单独成步。
8
+ */
9
+ export declare function decompileTaskList(tasks: TaskDef[], registry?: ActionRegistry): BusinessStep[];
10
+ export declare function decompileWorkflowDefToStepModel(def: WorkflowDef | null | undefined, registry?: ActionRegistry): BusinessWorkflowModel;
@@ -0,0 +1,8 @@
1
+ import type { ActionDefinition } from '../actions/types';
2
+ import type { BusinessStep } from './types';
3
+ /**
4
+ * 根据动作定义创建一个新的业务步骤。
5
+ * 控制流动作(分支 / 并行 / 循环)会生成带 controlType 的容器步骤,
6
+ * 因此可以在任意层级(顶层、分支内、泳道内、循环体内)递归嵌套。
7
+ */
8
+ export declare function createStepFromAction(action: ActionDefinition): BusinessStep;
@@ -0,0 +1,64 @@
1
+ import type { TaskDef, WorkflowDef } from '../types/conductor';
2
+ import type { LibraryRef } from '../actions/types';
3
+ export interface PillToken {
4
+ /** The Conductor reference path, e.g. "ecs_create_0.output.instanceId" or "workflow.input.userId" */
5
+ rawRef: string;
6
+ /** Human-friendly Chinese label, e.g. "实例ID" or "用户ID" */
7
+ label: string;
8
+ /** Task or step origin label, e.g. "创建云主机" */
9
+ stepLabel?: string;
10
+ /** Optional formatting filter, e.g. "lowercase", "date" */
11
+ format?: string;
12
+ }
13
+ /**
14
+ * 控制流节点类型
15
+ */
16
+ export type StepControlType = 'decision' | 'fork' | 'loop';
17
+ /**
18
+ * 分支定义 (针对 DECISION / SWITCH)
19
+ */
20
+ export interface BranchCase {
21
+ caseKey: string;
22
+ caseLabel?: string;
23
+ steps: BusinessStep[];
24
+ }
25
+ /**
26
+ * 并行泳道 (针对 FORK_JOIN)
27
+ */
28
+ export interface ForkLane {
29
+ laneId: string;
30
+ laneLabel?: string;
31
+ steps: BusinessStep[];
32
+ }
33
+ export interface BusinessStep {
34
+ id: string;
35
+ actionId: string;
36
+ taskReferenceName: string;
37
+ name: string;
38
+ description?: string;
39
+ values: Record<string, any>;
40
+ /**
41
+ * If true, this step represents an unmapped technical Conductor task (e.g. raw JQ or custom Lambda)
42
+ * which is preserved losslessly as a read-only "Professional Step" card in business mode.
43
+ */
44
+ isProFallback?: boolean;
45
+ rawTaskDef?: TaskDef;
46
+ /** 引用流程库能力时记录的名称与版本(首次引用时固定,不随库升级自动变化) */
47
+ libraryRef?: LibraryRef;
48
+ controlType?: StepControlType;
49
+ caseParam?: string;
50
+ caseExpression?: string;
51
+ branches?: BranchCase[];
52
+ forkLanes?: ForkLane[];
53
+ pairedJoinTaskRef?: string;
54
+ loopCondition?: string;
55
+ loopSteps?: BusinessStep[];
56
+ }
57
+ export interface BusinessWorkflowModel {
58
+ name: string;
59
+ description?: string;
60
+ version?: number;
61
+ steps: BusinessStep[];
62
+ inputParameters?: any[];
63
+ rawWorkflowDef?: WorkflowDef;
64
+ }
@@ -20,10 +20,13 @@ import type { UseBoundStore, StoreApi } from 'zustand';
20
20
  import type { AiStore } from './aiStore';
21
21
  import type { LibraryStore } from './libraryStore';
22
22
  import type { ToolRegistry } from '../services/ai/toolRegistry';
23
+ import type { LibraryCatalog } from '../library/catalog';
23
24
  export interface IdeStores {
24
25
  aiStore: UseBoundStore<StoreApi<AiStore>>;
25
26
  libraryStore: UseBoundStore<StoreApi<LibraryStore>>;
26
27
  toolRegistry: ToolRegistry;
28
+ /** 本实例的流程库目录(LibraryProvider 规范化后的单一数据源);每个实例独立,不是全局单例 */
29
+ libraryCatalog?: LibraryCatalog;
27
30
  }
28
31
  export declare function IdeStoresProvider({ stores, children }: {
29
32
  stores: IdeStores;
@@ -17,6 +17,7 @@ declare const useWorkflowStore: import("zustand").UseBoundStore<Omit<Omit<import
17
17
  workflowDef: WorkflowDef | null;
18
18
  layoutDirection: LayoutDirection;
19
19
  nodes: import("../types/workflow").WorkflowNode[];
20
+ graphStale: boolean;
20
21
  edges: import("reactflow").Edge[];
21
22
  taskMap: Record<string, TaskDef>;
22
23
  theme: ThemeMode;
@@ -0,0 +1,10 @@
1
+ import type { WorkflowDef } from '../types/conductor';
2
+ import type { WorkflowTemplate } from './types';
3
+ /**
4
+ * 将用户在向导中填写的变量值注入到模板的 Conductor WorkflowDef 骨架中
5
+ *
6
+ * @param template 选中的工作流模板
7
+ * @param variableValues 用户填写的变量键值对
8
+ * @returns 注入参数后的完整 WorkflowDef
9
+ */
10
+ export declare function applyTemplateVariables(template: WorkflowTemplate, variableValues: Record<string, any>): WorkflowDef;
@@ -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,5 @@
1
+ import type { ExtractTemplateOptions, ExtractionResult } from './types';
2
+ /**
3
+ * 从真实生产执行实例中一键萃取、脱敏并生成标准化模板骨架
4
+ */
5
+ export declare function extractTemplateFromInstance(options: ExtractTemplateOptions): ExtractionResult;
@@ -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;