@digitalsee-ai/rcs 1.1.8 → 2.0.0-beta10

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 (182) hide show
  1. package/README.md +6 -38
  2. package/README.npm.md +37 -0
  3. package/dist/components/digitalsee/JsonRenderer/index.d.ts +1 -1
  4. package/dist/components/digitalsee/workflow/Canvas/FastOperationButtons.d.ts +5 -2
  5. package/dist/components/digitalsee/workflow/Canvas/FullscreenLoading.d.ts +10 -2
  6. package/dist/components/digitalsee/workflow/Canvas/MiniMap.d.ts +1 -1
  7. package/dist/components/digitalsee/workflow/Canvas/NodePlaceholder.d.ts +12 -0
  8. package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +3 -6
  9. package/dist/components/digitalsee/workflow/Canvas/actionItemToNodeData.d.ts +1 -6
  10. package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +25 -26
  11. package/dist/components/digitalsee/workflow/Canvas/hooks/{classicNodeAddConnection.d.ts → nodePackageAddConnection.d.ts} +3 -3
  12. package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +4 -2
  13. package/dist/components/digitalsee/workflow/Canvas/hooks/useDataLoading.d.ts +42 -5
  14. package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +2 -3
  15. package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +22 -4
  16. package/dist/components/digitalsee/workflow/Canvas/types.d.ts +18 -6
  17. package/dist/components/digitalsee/workflow/Edges/BaseEdge.d.ts +2 -0
  18. package/dist/components/digitalsee/workflow/Edges/EdgeFactory.d.ts +3 -8
  19. package/dist/components/digitalsee/workflow/Edges/edgeLayout.d.ts +97 -0
  20. package/dist/components/digitalsee/workflow/Handles/CustomHandle.d.ts +1 -0
  21. package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +28 -1
  22. package/dist/components/digitalsee/workflow/Nodes/DeclaredNode.d.ts +37 -0
  23. package/dist/components/digitalsee/workflow/Nodes/DynamicNode.d.ts +24 -0
  24. package/dist/components/digitalsee/workflow/Nodes/NodeFactory.d.ts +42 -4
  25. package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +2 -1
  26. package/dist/components/digitalsee/workflow/Nodes/classicPortLayout.d.ts +51 -0
  27. package/dist/components/digitalsee/workflow/Nodes/components/NodeStatusBadge.d.ts +11 -0
  28. package/dist/components/digitalsee/workflow/Nodes/{classicNodePackagePortLayout.d.ts → nodePackagePortLayout.d.ts} +4 -4
  29. package/dist/components/digitalsee/workflow/Nodes/nodeTypeRegistry.d.ts +131 -0
  30. package/dist/components/digitalsee/workflow/Nodes/useNodePackagePorts.d.ts +35 -0
  31. package/dist/components/digitalsee/workflow/NodesConfig/NodePackageConfig/fieldSchemaAdapter.d.ts +14 -0
  32. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/help.d.ts +5 -1
  33. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TextField/index.d.ts +2 -0
  34. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +1 -0
  35. package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.d.ts +2 -0
  36. package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.helpers.d.ts +11 -0
  37. package/dist/components/digitalsee/workflow/NodesConfig/components/VariableModal/tree-help.d.ts +5 -12
  38. package/dist/components/digitalsee/workflow/NodesConfig/context.d.ts +13 -0
  39. package/dist/components/digitalsee/workflow/NodesConfig/submitPayload.d.ts +10 -17
  40. package/dist/components/digitalsee/workflow/NodesConfig/useClearVariableTargetOnFormMouseDown.d.ts +15 -0
  41. package/dist/components/digitalsee/workflow/NodesConfig/useVariableActiveTarget.d.ts +13 -0
  42. package/dist/components/digitalsee/workflow/Panels/CanvasConfigDebugger.d.ts +1 -1
  43. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryItem.d.ts +1 -1
  44. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryTabs.d.ts +1 -1
  45. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCard.d.ts +1 -1
  46. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeItem.d.ts +1 -1
  47. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/PanelHeader.d.ts +1 -1
  48. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useConnectableNodeSelector.d.ts +5 -8
  49. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +10 -4
  50. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableDataSource.d.ts +6 -10
  51. package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/components/NodeListItem.d.ts +1 -1
  52. package/dist/components/digitalsee/workflow/api/dip.types.d.ts +30 -1
  53. package/dist/components/digitalsee/workflow/api/index.d.ts +3 -22
  54. package/dist/components/digitalsee/workflow/builtin/controls/ConfigSubflow/index.d.ts +2 -2
  55. package/dist/components/digitalsee/workflow/builtin/globalConfig/index.d.ts +5 -1
  56. package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -5
  57. package/dist/components/digitalsee/workflow/config/layerConfig.d.ts +14 -0
  58. package/dist/components/digitalsee/workflow/config/themeConfig.d.ts +20 -23
  59. package/dist/components/digitalsee/workflow/constants/nodePackageHandles.d.ts +10 -0
  60. package/dist/components/digitalsee/workflow/context/workflowTriggerContext.d.ts +22 -0
  61. package/dist/components/digitalsee/workflow/coverage/acceptanceManifest.d.ts +30 -0
  62. package/dist/components/digitalsee/workflow/coverage/runtimeCoverage.d.ts +34 -0
  63. package/dist/components/digitalsee/workflow/design-system/AiFlowNodeTestPanel.d.ts +24 -0
  64. package/dist/components/digitalsee/workflow/design-system/AiFlowVariableTree.d.ts +34 -0
  65. package/dist/components/digitalsee/workflow/design-system/index.d.ts +3 -0
  66. package/dist/components/digitalsee/workflow/design-system/tokens.d.ts +103 -0
  67. package/dist/components/digitalsee/workflow/enums/canvas.d.ts +0 -12
  68. package/dist/components/digitalsee/workflow/enums/edge.d.ts +4 -2
  69. package/dist/components/digitalsee/workflow/enums/node.d.ts +5 -6
  70. package/dist/components/digitalsee/workflow/enums/workflow.d.ts +1 -1
  71. package/dist/components/digitalsee/workflow/examples/global-config-example.d.ts +1 -1
  72. package/dist/components/digitalsee/workflow/hooks/state.hooks.d.ts +1 -7
  73. package/dist/components/digitalsee/workflow/hooks/use-flow-data-operation.d.ts +1 -1
  74. package/dist/components/digitalsee/workflow/hooks/useCanvasLayout.d.ts +1 -1
  75. package/dist/components/digitalsee/workflow/hooks/useCanvasMode.d.ts +8 -0
  76. package/dist/components/digitalsee/workflow/hooks/useCanvasNavigate.d.ts +10 -0
  77. package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +11 -1
  78. package/dist/components/digitalsee/workflow/hooks/useVariables.d.ts +1 -0
  79. package/dist/components/digitalsee/workflow/hooks/useWorkflow.d.ts +1 -1
  80. package/dist/components/digitalsee/workflow/index.d.ts +39 -44
  81. package/dist/components/digitalsee/workflow/migration/umi.d.ts +1 -2
  82. package/dist/components/digitalsee/workflow/store/panelSlice.d.ts +64 -0
  83. package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +5 -2
  84. package/dist/components/digitalsee/workflow/types/Node.d.ts +2 -0
  85. package/dist/components/digitalsee/workflow/types/NodeAddContext.d.ts +1 -1
  86. package/dist/components/digitalsee/workflow/types/Workflow.d.ts +1 -1
  87. package/dist/components/digitalsee/workflow/types/engine.d.ts +29 -12
  88. package/dist/components/digitalsee/workflow/types/flowVersion.d.ts +0 -30
  89. package/dist/components/digitalsee/workflow/utils/connectionCheck.d.ts +30 -0
  90. package/dist/components/digitalsee/workflow/utils/graphLoop.d.ts +12 -0
  91. package/dist/components/digitalsee/workflow/utils/layoutUtils.d.ts +2 -2
  92. package/dist/components/digitalsee/workflow/utils/mcpCanvas.d.ts +0 -40
  93. package/dist/components/digitalsee/workflow/utils/mode.d.ts +18 -0
  94. package/dist/components/digitalsee/workflow/utils/nodeAutoConnect.d.ts +24 -0
  95. package/dist/components/digitalsee/workflow/utils/nodeCommon.d.ts +5 -0
  96. package/dist/components/digitalsee/workflow/utils/nodeHandleLayout.d.ts +83 -0
  97. package/dist/components/digitalsee/workflow/utils/nodePackageConnection.d.ts +28 -0
  98. package/dist/components/digitalsee/workflow/utils/nodePackageGraphValidation.d.ts +29 -0
  99. package/dist/components/digitalsee/workflow/utils/nodePackageSchemaCache.d.ts +15 -0
  100. package/dist/components/digitalsee/workflow/utils/onNodeRemoveHook.d.ts +13 -0
  101. package/dist/components/digitalsee/workflow/utils/triggerNode.d.ts +13 -0
  102. package/dist/components/digitalsee/workflow/utils/workflowConnectionValidator.d.ts +1 -3
  103. package/dist/components/digitalsee/workflow/workflow.story-fixtures.d.ts +50 -0
  104. package/dist/components/dynamic-form/context/VariableSelectorContext.d.ts +17 -16
  105. package/dist/components/dynamic-form/index.d.ts +1 -4
  106. package/dist/index-B5ujKdXE.mjs +282 -0
  107. package/dist/{index-CRdKUD0G.mjs → index-BLqed5HY.mjs} +45697 -48347
  108. package/dist/locales/en-US/common.d.ts +29 -52
  109. package/dist/locales/en-US.d.ts +29 -52
  110. package/dist/locales/zh-CN/common.d.ts +29 -52
  111. package/dist/locales/zh-CN.d.ts +29 -52
  112. package/dist/locales/zh-TW/common.d.ts +29 -52
  113. package/dist/locales/zh-TW.d.ts +29 -52
  114. package/dist/rcs.css +1 -1
  115. package/dist/rcs.es.js +36 -35
  116. package/dist/rcs.umd.js +131 -78
  117. package/package.json +38 -23
  118. package/dist/components/digitalsee/workflow/Canvas/FlowVersionManager.d.ts +0 -16
  119. package/dist/components/digitalsee/workflow/Canvas/NextConfigModalWrapper.d.ts +0 -9
  120. package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvas.d.ts +0 -4
  121. package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvasHeader.d.ts +0 -15
  122. package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +0 -38
  123. package/dist/components/digitalsee/workflow/NextNodesConfigModal/index.d.ts +0 -13
  124. package/dist/components/digitalsee/workflow/Nodes/AISubNode.d.ts +0 -9
  125. package/dist/components/digitalsee/workflow/Nodes/ActionNode.d.ts +0 -13
  126. package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +0 -10
  127. package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +0 -10
  128. package/dist/components/digitalsee/workflow/Nodes/BuiltinMCPNode.d.ts +0 -9
  129. package/dist/components/digitalsee/workflow/Nodes/ConditionNode.d.ts +0 -13
  130. package/dist/components/digitalsee/workflow/Nodes/CustomNode.d.ts +0 -15
  131. package/dist/components/digitalsee/workflow/Nodes/LoopNode.d.ts +0 -4
  132. package/dist/components/digitalsee/workflow/Nodes/MCPServerNode.d.ts +0 -9
  133. package/dist/components/digitalsee/workflow/Nodes/MCPToolNode.d.ts +0 -9
  134. package/dist/components/digitalsee/workflow/Nodes/NextNodeFactory.d.ts +0 -12
  135. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextActionNode.d.ts +0 -9
  136. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextBaseNode.d.ts +0 -16
  137. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextConditionNode.d.ts +0 -10
  138. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextLoopNode.d.ts +0 -10
  139. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextSwitchNode.d.ts +0 -10
  140. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextTriggerNode.d.ts +0 -9
  141. package/dist/components/digitalsee/workflow/Nodes/SelfLoopNode.d.ts +0 -4
  142. package/dist/components/digitalsee/workflow/Nodes/StartNode.d.ts +0 -1
  143. package/dist/components/digitalsee/workflow/Nodes/SwitchNode.d.ts +0 -13
  144. package/dist/components/digitalsee/workflow/Nodes/TriggerNode.d.ts +0 -10
  145. package/dist/components/digitalsee/workflow/Nodes/components/NextNodeDescription.d.ts +0 -16
  146. package/dist/components/digitalsee/workflow/Nodes/components/NextNodeOperations.d.ts +0 -11
  147. package/dist/components/digitalsee/workflow/Nodes/useClassicNodePackagePorts.d.ts +0 -27
  148. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CreateCredentialModal.d.ts +0 -13
  149. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CredentialSelect.d.ts +0 -17
  150. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/ModifyCredentialModal.d.ts +0 -17
  151. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.d.ts +0 -10
  152. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/index.d.ts +0 -17
  153. package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeSettings.d.ts +0 -6
  154. package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeTest.d.ts +0 -6
  155. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/index.d.ts +0 -6
  156. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.d.ts +0 -49
  157. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/EntryTypeSelector.d.ts +0 -8
  158. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCardList.d.ts +0 -20
  159. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeActionState.d.ts +0 -28
  160. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeSelectorPresentation.d.ts +0 -25
  161. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/filterEdgeInsertActions.d.ts +0 -62
  162. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/queryParams.d.ts +0 -18
  163. package/dist/components/digitalsee/workflow/constants/nextHandles.d.ts +0 -1
  164. package/dist/components/digitalsee/workflow/utils/classicNodePackageConnection.d.ts +0 -28
  165. package/dist/components/digitalsee/workflow/utils/classicNodePackageGraphValidation.d.ts +0 -29
  166. package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +0 -14
  167. package/dist/components/digitalsee/workflow/utils/queuedNodeConfigOpen.d.ts +0 -12
  168. package/dist/components/dynamic-form/components/SelectWithExpression/index.d.ts +0 -25
  169. package/dist/components/dynamic-form/components/VariableInput/index.d.ts +0 -26
  170. package/dist/components/dynamic-form/components/VariableInput/utils.d.ts +0 -38
  171. package/dist/components/dynamic-form/components/VariableTextarea/index.d.ts +0 -10
  172. package/dist/index-CRdKUD0G.mjs.map +0 -1
  173. package/dist/index-rjDBrC08.mjs +0 -312
  174. package/dist/index-rjDBrC08.mjs.map +0 -1
  175. package/dist/postcss.config.js +0 -1
  176. package/dist/rcs.es.js.map +0 -1
  177. package/dist/rcs.umd.js.map +0 -1
  178. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/WorkflowNodeSchemaFieldProvider.d.ts +0 -0
  179. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowCodeField.d.ts +0 -0
  180. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowProxyField.d.ts +0 -0
  181. /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/proxyField.d.ts +0 -0
  182. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/{next-compatible.d.ts → nodePackage-compatible.d.ts} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { FlowStatus } from '../NodesConfig/define/flow';
2
2
  import { EdgeData } from '../types/Edge';
3
+ import { FlowVersionStatusVO } from '../types/flowVersion';
3
4
  import { NodeData, NodeType } from '../types/Node';
4
5
  import { Connection, Edge, EdgeChange, Node, NodeChange } from '@xyflow/react';
5
6
  export interface ExecutionControlState {
@@ -23,6 +24,8 @@ export interface WorkflowState {
23
24
  isLocked: boolean;
24
25
  executionControl: ExecutionControlState | null;
25
26
  flowMetadata: Record<string, unknown>;
27
+ /** 用户是否手动删除过 trigger 节点(手动删除后不再展示 NodePlaceholder) */
28
+ triggerDeleted: boolean;
26
29
  }
27
30
  export declare const setWorkflowId: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, "workflow/setWorkflowId">, setWorkflowName: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, "workflow/setWorkflowName">, applyNodesChanges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<NodeChange[], "workflow/applyNodesChanges">, applyEdgesChanges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<EdgeChange[], "workflow/applyEdgesChanges">, addConnection: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Connection, "workflow/addConnection">, addNode: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
28
31
  type: NodeType;
@@ -31,7 +34,7 @@ export declare const setWorkflowId: import('@reduxjs/toolkit').ActionCreatorWith
31
34
  y: number;
32
35
  };
33
36
  data: NodeData;
34
- }, "workflow/addNode">, addNodes: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Node<NodeData>[], "workflow/addNodes">, addEdges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Edge<EdgeData>[], "workflow/addEdges">, removeNodes: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string[], "workflow/removeNodes">, removeEdges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string[], "workflow/removeEdges">, setSelection: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
37
+ }, "workflow/addNode">, addEdges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Edge<EdgeData>[], "workflow/addEdges">, removeNodes: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string[], "workflow/removeNodes">, removeEdges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string[], "workflow/removeEdges">, setSelection: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
35
38
  nodes: Node<NodeData>[];
36
39
  edges: Edge<EdgeData>[];
37
40
  }, "workflow/setSelection">, updateEdge: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
@@ -40,6 +43,6 @@ export declare const setWorkflowId: import('@reduxjs/toolkit').ActionCreatorWith
40
43
  }, "workflow/updateEdge">, setNodes: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Node<NodeData>[], "workflow/setNodes">, setEdges: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Edge<EdgeData>[], "workflow/setEdges">, updateNode: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
41
44
  id: string;
42
45
  data: Partial<NodeData>;
43
- }, "workflow/updateNode">, setFlowOpStatus: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<FlowStatus, "workflow/setFlowOpStatus">, refreshFlow: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/refreshFlow">, setCurrentNodeConfigVisibleId: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, "workflow/setCurrentNodeConfigVisibleId">, setLocked: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<boolean, "workflow/setLocked">, setExecutionControl: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<ExecutionControlState, "workflow/setExecutionControl">, setFlowMetadata: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Record<string, unknown>, "workflow/setFlowMetadata">, resetFlow: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/resetFlow">, executeAutoSave: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/executeAutoSave">;
46
+ }, "workflow/updateNode">, setFlowOpStatus: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<FlowStatus, "workflow/setFlowOpStatus">, refreshFlow: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/refreshFlow">, setCurrentNodeConfigVisibleId: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, "workflow/setCurrentNodeConfigVisibleId">, setLocked: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<boolean, "workflow/setLocked">, setExecutionControl: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<ExecutionControlState, "workflow/setExecutionControl">, setFlowMetadata: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Record<string, unknown>, "workflow/setFlowMetadata">, setTriggerDeleted: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<boolean, "workflow/setTriggerDeleted">, resetFlow: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/resetFlow">, executeAutoSave: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/executeAutoSave">, setFlowVersionMeta: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<FlowVersionStatusVO, "workflow/setFlowVersionMeta">;
44
47
  declare const _default: import('@reduxjs/toolkit').Reducer<WorkflowState>;
45
48
  export default _default;
@@ -29,6 +29,8 @@ export type NodeData = ActionItem & {
29
29
  account_id?: string | null;
30
30
  /** 节点协议类型(AI_LANGUAGE_MODEL / MCP 等) */
31
31
  protocol?: string;
32
+ /** 是否是 Trigger 节点 */
33
+ is_trigger?: boolean;
32
34
  /** index signature — 满足 ReactFlow v12 的 Record<string, unknown> 约束 */
33
35
  [key: string]: unknown;
34
36
  };
@@ -1,6 +1,6 @@
1
1
  import { Node } from '@xyflow/react';
2
2
  /** 节点选择器只需保留 MCP 判定需要的轻量锚点信息,避免 Redux 声明泄漏 ReactFlow 样式类型。 */
3
- export type NodeAddAnchorNode = Pick<Node, 'id' | 'type' | 'data'>;
3
+ export type NodeAddAnchorNode = Pick<Node, 'id' | 'type' | 'data' | 'position' | 'measured'>;
4
4
  /** 边上插入节点时保留的原边上下文。 */
5
5
  export interface NodeAddEdgeContext {
6
6
  id: string;
@@ -1,6 +1,6 @@
1
+ import { WorkflowOpStatus } from '../enums/workflow';
1
2
  import { WorkflowEdge } from './Edge';
2
3
  import { WorkflowNode } from './Node';
3
- import { WorkflowOpStatus } from '../enums/workflow';
4
4
  /**
5
5
  * 工作流定义
6
6
  */
@@ -1,7 +1,7 @@
1
1
  import { ReactFlow } from '@xyflow/react';
2
2
  import { Rule } from 'antd/es/form';
3
3
  import { ComponentProps, ReactNode } from 'react';
4
- import { EngineMode, WorkflowOpStatus } from '../enums/workflow';
4
+ import { WorkflowOpStatus } from '../enums/workflow';
5
5
  export type HttpClient = <T = any>(url: string, config: any) => Promise<T>;
6
6
  export interface HistoryNavigator {
7
7
  push(path: string, state?: any): void;
@@ -11,12 +11,26 @@ export interface HistoryNavigator {
11
11
  goForward(): void;
12
12
  listen?(listener: (location: any, action: any) => void): () => void;
13
13
  }
14
+ /**
15
+ * 画布内部 URL 跳转回调,由宿主决定如何处理(同页路由 / 新标签 / 拦截等)。
16
+ *
17
+ * @param url 目标 URL
18
+ * @param openInNewTab 是否需要新标签页打开(原 window.open 场景)
19
+ */
20
+ export type CanvasNavigate = (url: string, openInNewTab?: boolean) => void;
21
+ /**
22
+ * 画布模式(单一事实源):取代散落的 readOnly / preview / previewId / appFlowMode 参数。
23
+ *
24
+ * - edit : 可编辑可改名(默认),独立页导航返回 history.push('/link/ai-flow')
25
+ * - flow : 应用流嵌入页 不可改名字
26
+ * - preview: 只读展示,不渲染 Header,节点不可拖/连/选
27
+ */
28
+ export type WorkflowCanvasMode = 'edit' | 'flow' | 'preview';
14
29
  export type DeepPartial<T> = {
15
30
  [P in keyof T]?: T[P] extends (...args: any[]) => any ? T[P] : T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends object ? DeepPartial<T[P]> : T[P];
16
31
  };
17
32
  export interface CanvasEngineConfig {
18
33
  flowId: string;
19
- engineMode?: EngineMode;
20
34
  canvas: CanvasCoreConfig;
21
35
  nodeSelector: NodeSelectorConfig;
22
36
  nodeTypes: NodeTypesRegistryConfig;
@@ -25,6 +39,8 @@ export interface CanvasEngineConfig {
25
39
  nodeConfigPanel: NodeConfigPanelConfig;
26
40
  httpClient?: HttpClient;
27
41
  history?: HistoryNavigator;
42
+ onNavigate?: CanvasNavigate;
43
+ scene?: string;
28
44
  }
29
45
  /**
30
46
  * NodePackage 可连线候选能力配置。
@@ -56,7 +72,7 @@ export interface CanvasCoreConfig {
56
72
  size?: number;
57
73
  };
58
74
  allowRemoveTrigger?: boolean;
59
- mode?: 'edit' | 'preview';
75
+ mode?: WorkflowCanvasMode;
60
76
  miniMap?: boolean;
61
77
  header?: boolean;
62
78
  controls?: boolean;
@@ -158,17 +174,16 @@ export interface ToolbarConfig {
158
174
  enableOnlineConfirmMessage?: string;
159
175
  enableFlowText?: string;
160
176
  /**
161
- * 自定义上线API,用于自定义MFA流程上线
162
- */
163
- customOnlineApi?: (workflowId: string) => Promise<void>;
164
- /**
165
- * 自定义下线API,用于自定义MFA流程下线
177
+ * 连接流版本管理集成回调,仅 CLASSIC/ACM 画布支持。
178
+ *
179
+ * 注意:「是否启用版本管理」由 `flowMetadata.version_group_id` 自动判定(归属版本组的流程即为版本管理流),
180
+ * 宿主无需配置 `enabled` 开关;提供下方任一回调即在版本管理流中显示对应入口。
166
181
  */
167
- customOfflineApi?: (workflowId: string) => Promise<void>;
168
- /** 连接流版本管理,仅 CLASSIC/ACM 画布支持。 */
169
182
  versionManagement?: {
170
- enabled?: boolean;
171
- canManage?: boolean;
183
+ /** 宿主提供时才显示「历史版本」入口;点击时调用,由宿主打开历史 UI。 */
184
+ onShowHistory?: () => void;
185
+ /** 宿主提供时才显示「发布并启用」入口;点击时回调传入当前画布 payload(含 meta data)。 */
186
+ onConfirmPublish?: (payload?: any) => void;
172
187
  };
173
188
  }
174
189
  export interface ToolbarButtonConfig {
@@ -276,5 +291,7 @@ export interface CanvasAPI {
276
291
  */
277
292
  once<T = any>(event: CanvasEventType, handler: CanvasEventHandler<T>): void;
278
293
  saveFlow(): Promise<import('./flowVersion').FlowDraftPayload | undefined>;
294
+ /** 刷新版本状态(版本号、发布状态等),从服务端拉取最新元数据写入 store */
295
+ refreshFlowVersionStatus(): Promise<void>;
279
296
  }
280
297
  export {};
@@ -12,24 +12,6 @@ export interface FlowDraftPayload {
12
12
  execution_control?: unknown;
13
13
  [key: string]: unknown;
14
14
  }
15
- /** 发布版本概要。 */
16
- export interface FlowVersionVO {
17
- id: string;
18
- version_group_id: string;
19
- version_no: number;
20
- version_name?: string;
21
- remark?: string;
22
- effective: boolean;
23
- publish_by?: string;
24
- publish_time?: string;
25
- }
26
- /** 版本历史分页结果。 */
27
- export interface FlowVersionPage {
28
- items: FlowVersionVO[];
29
- total: number;
30
- page: number;
31
- size: number;
32
- }
33
15
  /** 当前草稿与线上版本状态。 */
34
16
  export interface FlowVersionStatusVO {
35
17
  version_group_id: string;
@@ -39,15 +21,3 @@ export interface FlowVersionStatusVO {
39
21
  has_unpublished_changes: boolean;
40
22
  draft_version_no: 0;
41
23
  }
42
- /** 历史版本详情。 */
43
- export interface FlowVersionDetailVO {
44
- version: FlowVersionVO;
45
- flow: FlowDraftPayload;
46
- }
47
- /** 发布请求。 */
48
- export interface FlowVersionPublishRequest {
49
- flow: FlowDraftPayload;
50
- version_name?: string;
51
- remark?: string;
52
- force: boolean;
53
- }
@@ -0,0 +1,30 @@
1
+ import { Node } from '@xyflow/react';
2
+ /**
3
+ * 统一连线检查的结果码,命名对齐 portConnectionValidator 的 code 风格。
4
+ */
5
+ export type ConnectionCheckCode = 'VALID' | 'SOURCE_NODE_NOT_FOUND' | 'TARGET_NODE_NOT_FOUND' | 'SOURCE_PORT_NOT_FOUND' | 'TARGET_PORT_NOT_FOUND' | 'PROTOCOL_MISMATCH' | 'SELF_CONNECTION_NOT_ALLOWED';
6
+ export interface ConnectionCheckResult {
7
+ valid: boolean;
8
+ code: ConnectionCheckCode;
9
+ /** 中文兜底原因,便于 console 调试。 */
10
+ message: string;
11
+ }
12
+ /** 结构兼容 React Flow 的 Connection / Edge(只取定位字段)。 */
13
+ export interface ConnectionCheckConnection {
14
+ source?: string | null;
15
+ target?: string | null;
16
+ sourceHandle?: string | null;
17
+ targetHandle?: string | null;
18
+ }
19
+ /**
20
+ * 统一连线检查:手动拖线与运行时代码建边共用的入口。
21
+ *
22
+ * 范围(与手动拖线今天的实际行为一致,再叠自连规则门):
23
+ * 1. 节点存在性;
24
+ * 2. 协议一致性(大小写不敏感;双侧均无法解析协议时放行,保留旧 `?? ''` 行为);
25
+ * 3. 自连(source === target)必须命中节点声明的 auto_connect 规则。
26
+ *
27
+ * workflowConnectionValidator 的重链(edgeRules / connectable / native 校验)
28
+ * 有意不在本检查内,仍由各自的既有入口负责。
29
+ */
30
+ export declare function checkConnection(nodes: Node[], connection: ConnectionCheckConnection): ConnectionCheckResult;
@@ -0,0 +1,12 @@
1
+ import { Edge } from '@xyflow/react';
2
+ /**
3
+ * 判断 fromNodeId -> toNodeId 的连线是否会形成回环。
4
+ *
5
+ * 从 fromNodeId 出发沿入边(edge.target === current)向上遍历祖先链:
6
+ * - 途中遇到 toNodeId,说明已存在 toNodeId -> ... -> fromNodeId 的通路,
7
+ * 新边将闭合环路,返回 true;
8
+ * - 遍历到根(无入边)仍未遇到,返回 false。
9
+ *
10
+ * 用 visited 集合防止图中已有环导致死循环。
11
+ */
12
+ export declare function isLoopEdgeLine(fromNodeId: string, toNodeId: string, edges: Edge[]): boolean;
@@ -3,7 +3,7 @@ import { NodeData } from '../types/Node';
3
3
  import { Edge, Node } from '@xyflow/react';
4
4
  import { CanvasLayoutSource, CanvasLayoutTarget } from '../enums/workflow';
5
5
  export declare const GRID_SIZE = 20;
6
- export declare const NODE_SIZE = 300;
6
+ export declare const NODE_SIZE = 222;
7
7
  export declare const NODE_X_SPACING: number;
8
8
  export declare const NODE_Y_SPACING: number;
9
9
  export declare const VERTICAL_NODE_SPACING: number;
@@ -37,6 +37,6 @@ export interface ExtendedNodeData extends NodeData {
37
37
  [key: string]: unknown;
38
38
  }
39
39
  export type NodeDictionary = Record<string, Node<ExtendedNodeData>>;
40
- export declare function layoutGraph(nodes: Node<any>[], edges: Edge<EdgeData>[], options?: {
40
+ export declare function layoutGraph(nodes: Node[], edges: Edge<EdgeData>[], options?: {
41
41
  includeSticky?: boolean;
42
42
  }): CanvasLayoutResult;
@@ -1,47 +1,7 @@
1
- import { HandleConnectionType } from '../types/Handle';
2
1
  import { NodeProtocol } from '../types/NodeProtocol';
3
- import { Edge, Node } from '@xyflow/react';
4
2
  export declare const MCP_TRIGGER_CATEGORY = "MCP_TRIGGER";
5
3
  export declare const MCP_CATEGORY_TYPE = "mcp_trigger";
6
- export declare const MCP_ACTION_LINK_ID = "mcp-gateway";
7
4
  export declare const MCP_CATALOG_PAGE_SIZE = 200;
8
5
  export declare const MCP_ACTION_PAGE_SIZE = 10;
9
6
  export declare const MCP_SERVER_PROTOCOL = NodeProtocol.MCP_SERVER;
10
- export declare const MCP_MAX_TOOLS_PER_SERVER = 20;
11
- export declare const MCP_TOOL_MAX_DOWNSTREAM = 1;
12
- export declare const MCP_RETURN_VARIABLE_ACTION_KEY = "dip.core.mcp.return-variable";
13
7
  export declare const MCP_SERVER_ACTION_KEY = "dip.core.trigger.mcp-server";
14
- type McpNodeIdentity = Pick<Node, 'type'> & Partial<Pick<Node, 'data'>>;
15
- export declare const isMcpServerNode: (node?: McpNodeIdentity | null) => boolean;
16
- export declare const isMcpToolNode: (node?: Pick<Node, "type"> | null) => boolean;
17
- export declare const isMcpReturnVariableNode: (node?: (Pick<Node, "data"> & {
18
- data?: Record<string, unknown>;
19
- }) | null) => boolean;
20
- export declare const isMcpCanvas: (nodes: Array<Pick<Node, "type">>) => boolean;
21
- export declare const isMcpServerCanvas: (nodes: McpNodeIdentity[]) => boolean;
22
- export declare const markMcpServerCanvasNode: <T extends Node>(node: T) => T;
23
- export declare const isMcpServerToolHandle: (handleId?: string | null) => handleId is "main" | HandleConnectionType.BUILTIN_MCP;
24
- export declare const isMcpToolChainHandle: (handleId?: string | null) => handleId is "main" | HandleConnectionType.OUTPUT;
25
- export declare const getDirectMcpToolCount: (serverId: string, nodes: Array<Pick<Node, "id" | "type">>, edges: Array<Pick<Edge, "source" | "target">>) => number;
26
- export declare const canAddMoreMcpTools: (serverId: string, nodes: Array<Pick<Node, "id" | "type">>, edges: Array<Pick<Edge, "source" | "target">>) => boolean;
27
- export declare const getMcpToolDownstreamCount: (toolId: string, edges: Array<Pick<Edge, "source" | "sourceHandle">>) => number;
28
- export declare const canAddMcpToolDownstream: (toolId: string, edges: Array<Pick<Edge, "source" | "sourceHandle">>) => boolean;
29
- export declare const isMcpServerToToolConnection: (sourceNode?: McpNodeIdentity | null, targetNode?: Pick<Node, "type"> | null, _sourceHandle?: string | null) => boolean;
30
- export declare const isMcpToolToExecutionConnection: (sourceNode?: Pick<Node, "id" | "type"> | null, targetNode?: Pick<Node, "id" | "type"> | null, sourceHandle?: string | null) => boolean;
31
- export declare const getNodeTypeById: (nodes: Array<Pick<Node, "id" | "type">>, nodeId?: string | null) => string;
32
- /** MCP 画布只改变端口布局,连接端口 ID 必须始终保留 NodeSchema 的真实名称。 */
33
- export declare const resolveMcpCanvasTargetHandle: (_nodes: McpNodeIdentity[], fallback?: string | null) => string;
34
- /** 保存前不得把 Schema 端口改写成视觉方向名称。 */
35
- export declare const normalizeMcpCanvasEdge: <T extends Pick<Edge, "targetHandle">>(_nodes: McpNodeIdentity[], edge: T) => T;
36
- export declare const normalizeMcpCanvasEdges: <T extends Pick<Edge, "targetHandle">>(nodes: McpNodeIdentity[], edges: T[]) => T[];
37
- /** 旧版 MCP 画布把视觉方向写成了 targetHandle(以及部分 NodeSchema inputs.name)。 */
38
- export declare const LEGACY_MCP_CANVAS_TARGET_HANDLE = "top";
39
- type McpCanvasEdgeNode = Pick<Node, 'id' | 'type'> & Partial<Pick<Node, 'data'>>;
40
- /**
41
- * 升级旧版 MCP 画布的虚拟方向 targetHandle。
42
- *
43
- * 旧实现会把 MCP Server 画布上所有边的 targetHandle 写成 `top`。
44
- * MCP 网关相关节点 Schema 仍声明 top,需保留;经典 Action 等节点入桩是 input,需改回。
45
- */
46
- export declare const upgradeLegacyMcpCanvasEdges: <T extends Pick<Edge, "source" | "target" | "sourceHandle" | "targetHandle">>(nodes: McpCanvasEdgeNode[], edges: T[]) => T[];
47
- export {};
@@ -0,0 +1,18 @@
1
+ import { WorkflowCanvasMode } from '../types/engine';
2
+ /** resolveCanvasMode 的输入:显式 mode 优先,其次配置,最后默认值。 */
3
+ export interface ResolveCanvasModeInput {
4
+ /** 显式模式(最高优先级) */
5
+ mode?: WorkflowCanvasMode;
6
+ /** 配置中的 canvas.mode(优先级低于 props) */
7
+ configMode?: WorkflowCanvasMode;
8
+ }
9
+ /**
10
+ * 解析画布最终模式。
11
+ *
12
+ * 优先级:mode > configMode > edit。
13
+ */
14
+ export declare const resolveCanvasMode: (input: ResolveCanvasModeInput) => WorkflowCanvasMode;
15
+ /** 画布级可编辑:preview 恒不可编辑;其余模式受锁定(isLocked)约束。 */
16
+ export declare const deriveCanEdit: (mode: WorkflowCanvasMode, isLocked: boolean) => boolean;
17
+ /** 是否预览模式(只读展示、不渲染 Header、节点不可交互)。 */
18
+ export declare const deriveIsPreviewMode: (mode: WorkflowCanvasMode) => boolean;
@@ -0,0 +1,24 @@
1
+ import { NodeAutoConnectRule } from '../Nodes/classicPortLayout';
2
+ import { Edge, Node } from '@xyflow/react';
3
+ /**
4
+ * 解析节点声明的自身端口自动连线规则。
5
+ *
6
+ * NodePackage(type 含 `@`)读 schema cache 的 `auto_connections`;
7
+ * 经典节点读 registry 描述符的 `autoConnect`。均未声明时返回空数组(不自动连线)。
8
+ */
9
+ export declare function resolveNodeAutoConnectRules(node: Node): NodeAutoConnectRule[];
10
+ /**
11
+ * 判断节点自身端口连线(sourceHandle -> targetHandle)是否被 auto_connect 规则声明。
12
+ *
13
+ * 仅当规则中存在完全一致的有序配对时允许;未声明(含 handle 缺失)则拒绝。
14
+ * 手动拖线的自连与代码建边共用本判定,保证"自己连自己"必须走声明规则。
15
+ */
16
+ export declare function isSelfConnectionAllowed(node: Node, sourceHandle: string | null | undefined, targetHandle: string | null | undefined): boolean;
17
+ /**
18
+ * 按声明构建节点自身端口间的自动连线(如 LOOP 的 loop -> input 自环边)。
19
+ *
20
+ * 每条规则经端口存在性 + 协议一致性校验,不通过则跳过该条并告警;
21
+ * data.renderType / connectionType 沿用既有约定取 sourceHandle 名
22
+ * (BaseEdge 依赖 renderType='loop' 渲染循环边样式)。
23
+ */
24
+ export declare function buildNodeAutoConnectEdges(node: Node): Edge[];
@@ -0,0 +1,5 @@
1
+ import { Node } from '@xyflow/react';
2
+ import { DipPortSchema } from '../api/dip.types';
3
+ export declare const getNodeHandleProtocol: (node: Node, handleName: string) => string | null;
4
+ export declare const getNodeHandle: (node: Node, handleName: string) => DipPortSchema | null;
5
+ export declare const getNodeHandleByProtocol: (node: Node, protocol: string, isInput: boolean, preferredName?: string) => DipPortSchema | null;
@@ -0,0 +1,83 @@
1
+ import { Edge, Node, Position } from '@xyflow/react';
2
+ export type LayoutDirection = 'vertical' | 'horizontal';
3
+ export interface NodeHandlePositions {
4
+ sources: Position[];
5
+ targets: Position[];
6
+ }
7
+ interface ActionKeyHandleLayout {
8
+ source: Position;
9
+ target: Position;
10
+ }
11
+ /**
12
+ * NodePackage 节点端口 position 的过渡手工映射。
13
+ *
14
+ * 字段说明:
15
+ * - source:source handle 在节点边框上的位置
16
+ * - target:target handle 在节点边框上的位置
17
+ *
18
+ * 优先级:`DipPortSchema.position` > `ACTION_KEY_HANDLE_LAYOUT` > 缺省 Left/Right。
19
+ * 后续 `DipPortSchema.position` 全量铺开后即可删除本表。
20
+ */
21
+ export declare const ACTION_KEY_HANDLE_LAYOUT: Record<string, ActionKeyHandleLayout>;
22
+ /**
23
+ * 给定一个 ReactFlow 节点,返回它所有 source / target handle 的 `Position`。
24
+ *
25
+ * 数据源优先级:
26
+ * 1. NodePackage 节点 → `DipPortSchema.position` > `ACTION_KEY_HANDLE_LAYOUT` > 缺省 Left/Right
27
+ * 2. 经典节点 → `nodeTypeRegistry` 中的 legacy handles
28
+ * 3. 兜底:返回空数组
29
+ *
30
+ * 该函数只读、不发起网络请求;schema 缺失时按 schema 字段的 `position` → 映射表 → Left/Right 降级。
31
+ */
32
+ export declare function getNodeHandlePositions(node: Node): NodeHandlePositions;
33
+ /**
34
+ * 节点是否参与垂直布局(子节点在父节点下方 / 上方)。
35
+ *
36
+ * 判定:节点的 source 或 target handle 中任一处于 Top/Bottom 即视为垂直。
37
+ */
38
+ export declare function isVerticalLayoutNode(node: Node): boolean;
39
+ /**
40
+ * 节点是否参与水平布局(子节点在父节点右侧 / 左侧)。
41
+ *
42
+ * 判定:节点的 source 或 target handle 中任一处于 Left/Right 即视为水平。
43
+ */
44
+ export declare function isHorizontalLayoutNode(node: Node): boolean;
45
+ /**
46
+ * 按边的 target handle 位置判定布局方向。
47
+ *
48
+ * 规则(与用户约定一致):
49
+ * - target handle 在 Bottom/Top → 'vertical'
50
+ * - target handle 在 Left/Right → 'horizontal'
51
+ * - 缺省 → null(调用方自行决定 fallback)
52
+ */
53
+ export declare function getEdgeLayoutDirection(edge: Pick<Edge, 'source' | 'target' | 'sourceHandle' | 'targetHandle'>, sourceNode?: Node | null, targetNode?: Node | null): LayoutDirection | null;
54
+ /**
55
+ * 取边 source handle 在节点边框上的 `Position`(供连线风格 / 区间重叠判定使用)。
56
+ * 无 sourceHandle 时取第一个 source handle;找不到匹配时返回 undefined,调用方按水平处理。
57
+ */
58
+ export declare function getEdgeSourcePosition(edge: Pick<Edge, 'sourceHandle'>, sourceNode: Node): Position | undefined;
59
+ /**
60
+ * 节点是否拥有 Top 输入 handle,用于区分主流程节点与垂直子节点。
61
+ *
62
+ * 旧版用 `node.type === AI_SUB_NODE` 过滤;现在改为:节点的 target 中存在
63
+ * Top 入桩(典型 AI 子节点升级后通过 Bottom 入桩连接到父节点 ai_* 桩,但若
64
+ * 仍保留 Top 形态即可识别为"子节点")。
65
+ */
66
+ export declare function hasTopInputHandle(node: Node): boolean;
67
+ /**
68
+ * 节点是否拥有 Top source handle。
69
+ *
70
+ * 旧版 `calculateNodePosition` 用 `n.type !== AI_SUB_NODE` 过滤主流程节点;
71
+ * 现在等价语义改为:节点 source 不在 Top(说明它不向上输出,不会作为垂直子节点)。
72
+ */
73
+ export declare function hasTopSourceHandle(node: Node): boolean;
74
+ /**
75
+ * 节点是否属于某个父节点的垂直子布局(向上发送 → 自己即 child)。
76
+ */
77
+ export declare function isVerticalLayoutChild(node: Node): boolean;
78
+ /**
79
+ * 画布整体方向:按节点 source handle 的方向统计,少数服从多数。
80
+ * 缺省(无法判定或平票)走水平。
81
+ */
82
+ export declare function inferCanvasDirection(nodes: Node[]): LayoutDirection;
83
+ export {};
@@ -0,0 +1,28 @@
1
+ import { DipNodeSchema } from '../api/dip';
2
+ import { PortConnectionEdge, PortConnectionValidationCode } from './portConnectionValidator';
3
+ import { Node } from '@xyflow/react';
4
+ export type NodePackageConnectionCode = PortConnectionValidationCode | 'NOT_APPLICABLE' | 'SCHEMA_NOT_READY';
5
+ export interface NodePackageConnectionResult {
6
+ applicable: boolean;
7
+ valid: boolean;
8
+ code: NodePackageConnectionCode;
9
+ reason: string;
10
+ missingSchemaNodeIds?: string[];
11
+ }
12
+ export interface ValidateNodePackageConnectionInput {
13
+ sourceNode?: Node | null;
14
+ targetNode?: Node | null;
15
+ sourceHandle?: string | null;
16
+ targetHandle?: string | null;
17
+ edges?: readonly PortConnectionEdge[];
18
+ }
19
+ /** 同步解析已预加载的 NodePackage Schema。 */
20
+ export declare function resolveNodePackageSchema(node?: Node | null): DipNodeSchema | null;
21
+ export declare function isNodePackageConnectionNode(node?: Node | null): boolean;
22
+ /**
23
+ * 校验两个 NodePackage 节点之间的端口连接。
24
+ *
25
+ * 混合 legacy/nodepackage 连接保留前端当前精确 handle 名称,并按后端虚拟端口契约
26
+ * 将 legacy 端口能力类型统一映射为 main。
27
+ */
28
+ export declare function validateNodePackageConnection({ sourceNode, targetNode, sourceHandle, targetHandle, edges, }: ValidateNodePackageConnectionInput): NodePackageConnectionResult;
@@ -0,0 +1,29 @@
1
+ import { PortConnectionValidationCode } from './portConnectionValidator';
2
+ import { Edge, Node } from '@xyflow/react';
3
+ export type NodePackageGraphIssueCode = PortConnectionValidationCode | 'REQUIRED_INPUT_MISSING' | 'SCHEMA_NOT_READY';
4
+ export interface NodePackageGraphIssue {
5
+ code: NodePackageGraphIssueCode;
6
+ reason: string;
7
+ blocking: boolean;
8
+ nodeId?: string;
9
+ portName?: string;
10
+ edgeId?: string;
11
+ sourceNodeId?: string;
12
+ targetNodeId?: string;
13
+ }
14
+ export interface NodePackageGraphValidationResult {
15
+ valid: boolean;
16
+ issues: NodePackageGraphIssue[];
17
+ blockingIssues: NodePackageGraphIssue[];
18
+ missingSchemaNodeIds: string[];
19
+ }
20
+ interface ValidateNodePackageGraphInput {
21
+ nodes: readonly Node[];
22
+ edges: readonly Edge[];
23
+ }
24
+ /**
25
+ * 保存前检查当前已知的 NodePackage 端口约束。
26
+ * Schema 尚未加载属于非阻塞 warning,最终交给 ACM 后端兜底;已知非法端口则阻止保存。
27
+ */
28
+ export declare function validateNodePackageGraph({ nodes, edges, }: ValidateNodePackageGraphInput): NodePackageGraphValidationResult;
29
+ export {};
@@ -0,0 +1,15 @@
1
+ import { DipNodeSchema, DipPortSchema } from '../api/dip';
2
+ export declare function clearNodePackageSchemaCache(): void;
3
+ export declare function setNodePackageSchemaCache(nodeKey: string, nodeVersion: number | undefined | null, schema: DipNodeSchema): void;
4
+ /**
5
+ * 同步读取已预加载的 NodePackage Schema,不触发网络请求。
6
+ *
7
+ * 手动拖线发生在 ReactFlow 的同步校验阶段,无法等待异步 Schema 请求;
8
+ * 因此画布加载/选择器转换阶段会先预热缓存,再由这里读取。
9
+ */
10
+ export declare function peekNodePackageSchema(nodeKey: string, nodeVersion?: number): DipNodeSchema | null;
11
+ export declare function peekNodePackageSchemaByType(dynamicType: string): DipNodeSchema | null;
12
+ export declare function peekNodePackageSchemaHandleInfo(dynamicType: string, handleName: string): DipPortSchema | null;
13
+ export declare function peekSchemaHandleInfoByProtocol(dynamicType: string, protocol: string, isInput: boolean, preferredName?: string): DipPortSchema | null;
14
+ export declare function getNodePackageSchema(nodeKey: string, nodeVersion?: number): Promise<DipNodeSchema | null>;
15
+ export declare function getNodePackageSchemaByCache(nodeKey: string, nodeVersion?: number): DipNodeSchema | null;
@@ -0,0 +1,13 @@
1
+ import { Node } from '@xyflow/react';
2
+ /** 删除命中该列表的 Trigger 节点时,级联清空整张画布(删除所有其他节点) */
3
+ export declare const TRIGGER_CASCADE_CLEAR_KEYS: readonly string[];
4
+ /**
5
+ * 判断本次待删除节点中是否包含需要级联清空的 Trigger 节点。
6
+ * 若命中,返回画布上所有其他节点的 id,供调用方一并删除;否则返回空数组。
7
+ */
8
+ export declare const onNodeRemoveHook: (nodes: Node[], nodeIds: string[]) => string[];
9
+ /**
10
+ * 判断本次手动删除的节点中是否包含 trigger 节点。
11
+ * 命中表示用户主动删除了画布触发节点,画布据此不再展示 NodePlaceholder。
12
+ */
13
+ export declare const isManualTriggerDeletion: (nodes: Node[], nodeIds: string[]) => boolean;
@@ -0,0 +1,13 @@
1
+ import { Node } from '@xyflow/react';
2
+ type TriggerCandidate = Pick<Node, 'type'> & Partial<Pick<Node, 'data'>>;
3
+ /**
4
+ * 判断节点是否为 Trigger 节点。
5
+ *
6
+ * - 经典节点:type 固定为 StartEventNode
7
+ * - NodePackage 节点:判断与 nodeSchema 同级的 is_trigger 属性
8
+ * (is_trigger 为 true / 1 / '1' 视为触发节点,'0' / 0 / false 不视为)
9
+ *
10
+ * 一个画布最多只有一个 trigger 节点,因此画布级推导只需记录该节点信息即可。
11
+ */
12
+ export declare const isTriggerNode: (node?: TriggerCandidate | null) => boolean;
13
+ export {};
@@ -1,11 +1,9 @@
1
- import { EngineMode } from '../enums/workflow';
2
1
  import { EdgeConfig, EdgeRulesConfig, NodeSelectorConnectableConfig } from '../types/engine';
3
2
  import { Edge, IsValidConnection, Node } from '@xyflow/react';
4
3
  interface ValidateWorkflowConnectionInput {
5
4
  edge: EdgeConfig;
6
5
  nodes: Node[];
7
6
  edges: Edge[];
8
- engineMode?: EngineMode;
9
7
  connectable?: Pick<NodeSelectorConnectableConfig, 'enabled' | 'debug'>;
10
8
  validators?: EdgeRulesConfig['validators'];
11
9
  nativeIsValidConnection?: IsValidConnection;
@@ -16,5 +14,5 @@ interface ValidateWorkflowConnectionInput {
16
14
  * 手动拖线与程序化新增都传入各自的节点/边快照,从而复用 NodePackage、MCP、
17
15
  * 宿主 edgeRules 和 ReactFlow native validator。边中插入可由调用方先从快照移除旧边。
18
16
  */
19
- export declare function validateWorkflowConnection({ edge, nodes, edges, engineMode, connectable, validators, nativeIsValidConnection, }: ValidateWorkflowConnectionInput): boolean;
17
+ export declare function validateWorkflowConnection({ edge, nodes, edges, connectable, validators, nativeIsValidConnection, }: ValidateWorkflowConnectionInput): boolean;
20
18
  export {};
@@ -0,0 +1,50 @@
1
+ import { WorkflowHttpClient } from './index';
2
+ export declare const DEMO_WORKFLOW_ID = "local-ai-flow-preview";
3
+ export declare const DEMO_CONFIG_NODE_ID = "send-notice";
4
+ export declare const DEMO_NODE_CATALOG_WORKFLOW_ID = "local-ai-flow-node-catalog";
5
+ export declare const DEMO_CLASSIC_FIELDS_WORKFLOW_ID = "local-ai-flow-classic-fields";
6
+ export declare const DEMO_CLASSIC_FIELDS_NODE_ID = "classic-fields-catalog";
7
+ export declare const DEMO_CONTROL_NODES_WORKFLOW_ID = "local-ai-flow-control-nodes";
8
+ export declare const DEMO_CONDITION_NODE_ID = "control-condition";
9
+ export declare const DEMO_SWITCH_NODE_ID = "control-switch";
10
+ export declare const DEMO_LOOP_NODE_ID = "control-loop";
11
+ export declare const DEMO_MCP_TOOL_NODE_ID = "control-mcp-tool";
12
+ export declare const DEMO_CREDENTIAL_WORKFLOW_ID = "local-ai-flow-credential";
13
+ export declare const DEMO_CREDENTIAL_NODE_ID = "credential-database-query";
14
+ type MockFlowNode = {
15
+ id: string;
16
+ n_id: string;
17
+ node_type: string;
18
+ action_name: string;
19
+ connector_name: string;
20
+ connector_id: string;
21
+ action_id: string;
22
+ description: string;
23
+ protocol: string;
24
+ status: string;
25
+ position: {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ properties: Record<string, unknown>;
30
+ account_id?: string | null;
31
+ account_schema_id?: string | number;
32
+ deployment_type?: string;
33
+ output?: unknown;
34
+ branches?: Array<{
35
+ id: string;
36
+ label: string;
37
+ }>;
38
+ note?: string;
39
+ name?: string;
40
+ };
41
+ export declare const RUNTIME_NODE_CATALOG: MockFlowNode[];
42
+ /**
43
+ * 为 AI FLOW 源码验收页提供稳定的本地请求响应。
44
+ *
45
+ * @param url RCS 组件请求地址。
46
+ * @param options 请求方法与请求体。
47
+ * @returns 与线上接口形状一致的模拟数据。
48
+ */
49
+ export declare const mockAiFlowHttpClient: WorkflowHttpClient;
50
+ export {};