@digitalsee-ai/rcs 1.1.8 → 2.0.0-beta2
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 +6 -38
- package/README.npm.md +37 -0
- package/dist/components/digitalsee/JsonRenderer/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Canvas/FastOperationButtons.d.ts +5 -2
- package/dist/components/digitalsee/workflow/Canvas/FullscreenLoading.d.ts +10 -2
- package/dist/components/digitalsee/workflow/Canvas/MiniMap.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Canvas/NodePlaceholder.d.ts +12 -0
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +3 -6
- package/dist/components/digitalsee/workflow/Canvas/actionItemToNodeData.d.ts +1 -6
- package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +6 -26
- package/dist/components/digitalsee/workflow/Canvas/hooks/{classicNodeAddConnection.d.ts → nodePackageAddConnection.d.ts} +3 -3
- package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +4 -2
- package/dist/components/digitalsee/workflow/Canvas/hooks/useDataLoading.d.ts +33 -4
- package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +2 -3
- package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +22 -4
- package/dist/components/digitalsee/workflow/Canvas/types.d.ts +18 -6
- package/dist/components/digitalsee/workflow/Edges/BaseEdge.d.ts +2 -0
- package/dist/components/digitalsee/workflow/Edges/EdgeFactory.d.ts +3 -8
- package/dist/components/digitalsee/workflow/Edges/edgeLayout.d.ts +73 -0
- package/dist/components/digitalsee/workflow/Handles/CustomHandle.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +19 -0
- package/dist/components/digitalsee/workflow/Nodes/DeclaredNode.d.ts +33 -0
- package/dist/components/digitalsee/workflow/Nodes/DynamicNode.d.ts +24 -0
- package/dist/components/digitalsee/workflow/Nodes/NodeFactory.d.ts +42 -4
- package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +2 -1
- package/dist/components/digitalsee/workflow/Nodes/classicPortLayout.d.ts +51 -0
- package/dist/components/digitalsee/workflow/Nodes/components/NodeStatusBadge.d.ts +11 -0
- package/dist/components/digitalsee/workflow/Nodes/{classicNodePackagePortLayout.d.ts → nodePackagePortLayout.d.ts} +4 -4
- package/dist/components/digitalsee/workflow/Nodes/nodeTypeRegistry.d.ts +131 -0
- package/dist/components/digitalsee/workflow/Nodes/useNodePackagePorts.d.ts +35 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NodePackageConfig/fieldSchemaAdapter.d.ts +14 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/help.d.ts +5 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NodeTest.helpers.d.ts +11 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/VariableModal/tree-help.d.ts +5 -12
- package/dist/components/digitalsee/workflow/NodesConfig/submitPayload.d.ts +10 -17
- package/dist/components/digitalsee/workflow/Panels/CanvasConfigDebugger.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryItem.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryTabs.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCard.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeItem.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/PanelHeader.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useConnectableNodeSelector.d.ts +2 -5
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +10 -4
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/connectableDataSource.d.ts +6 -10
- package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/components/NodeListItem.d.ts +1 -1
- package/dist/components/digitalsee/workflow/api/dip.types.d.ts +30 -1
- package/dist/components/digitalsee/workflow/api/index.d.ts +3 -22
- package/dist/components/digitalsee/workflow/builtin/controls/ConfigSubflow/index.d.ts +2 -2
- package/dist/components/digitalsee/workflow/builtin/globalConfig/index.d.ts +5 -1
- package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -5
- package/dist/components/digitalsee/workflow/config/layerConfig.d.ts +14 -0
- package/dist/components/digitalsee/workflow/config/themeConfig.d.ts +19 -23
- package/dist/components/digitalsee/workflow/constants/nodePackageHandles.d.ts +10 -0
- package/dist/components/digitalsee/workflow/context/workflowTriggerContext.d.ts +22 -0
- package/dist/components/digitalsee/workflow/coverage/acceptanceManifest.d.ts +30 -0
- package/dist/components/digitalsee/workflow/coverage/runtimeCoverage.d.ts +34 -0
- package/dist/components/digitalsee/workflow/design-system/AiFlowNodeTestPanel.d.ts +24 -0
- package/dist/components/digitalsee/workflow/design-system/AiFlowVariableTree.d.ts +34 -0
- package/dist/components/digitalsee/workflow/design-system/index.d.ts +3 -0
- package/dist/components/digitalsee/workflow/design-system/tokens.d.ts +103 -0
- package/dist/components/digitalsee/workflow/enums/canvas.d.ts +0 -12
- package/dist/components/digitalsee/workflow/enums/edge.d.ts +4 -2
- package/dist/components/digitalsee/workflow/enums/node.d.ts +5 -6
- package/dist/components/digitalsee/workflow/enums/workflow.d.ts +1 -1
- package/dist/components/digitalsee/workflow/examples/global-config-example.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/state.hooks.d.ts +1 -7
- package/dist/components/digitalsee/workflow/hooks/use-flow-data-operation.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/useCanvasLayout.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/useCanvasMode.d.ts +8 -0
- package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +9 -1
- package/dist/components/digitalsee/workflow/hooks/useVariables.d.ts +1 -0
- package/dist/components/digitalsee/workflow/hooks/useWorkflow.d.ts +1 -1
- package/dist/components/digitalsee/workflow/index.d.ts +18 -44
- package/dist/components/digitalsee/workflow/migration/umi.d.ts +1 -2
- package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +5 -2
- package/dist/components/digitalsee/workflow/types/Node.d.ts +2 -0
- package/dist/components/digitalsee/workflow/types/Workflow.d.ts +1 -1
- package/dist/components/digitalsee/workflow/types/engine.d.ts +21 -12
- package/dist/components/digitalsee/workflow/types/flowVersion.d.ts +0 -30
- package/dist/components/digitalsee/workflow/utils/connectionCheck.d.ts +30 -0
- package/dist/components/digitalsee/workflow/utils/layoutUtils.d.ts +2 -2
- package/dist/components/digitalsee/workflow/utils/mcpCanvas.d.ts +0 -40
- package/dist/components/digitalsee/workflow/utils/mode.d.ts +18 -0
- package/dist/components/digitalsee/workflow/utils/nodeAutoConnect.d.ts +24 -0
- package/dist/components/digitalsee/workflow/utils/nodeCommon.d.ts +5 -0
- package/dist/components/digitalsee/workflow/utils/nodeHandleLayout.d.ts +83 -0
- package/dist/components/digitalsee/workflow/utils/nodePackageConnection.d.ts +28 -0
- package/dist/components/digitalsee/workflow/utils/nodePackageGraphValidation.d.ts +29 -0
- package/dist/components/digitalsee/workflow/utils/nodePackageSchemaCache.d.ts +15 -0
- package/dist/components/digitalsee/workflow/utils/onNodeRemoveHook.d.ts +13 -0
- package/dist/components/digitalsee/workflow/utils/triggerNode.d.ts +13 -0
- package/dist/components/digitalsee/workflow/utils/workflowConnectionValidator.d.ts +1 -3
- package/dist/components/digitalsee/workflow/workflow.story-fixtures.d.ts +50 -0
- package/dist/components/dynamic-form/context/VariableSelectorContext.d.ts +17 -16
- package/dist/components/dynamic-form/index.d.ts +1 -1
- package/dist/index-CBoDAvhq.mjs +285 -0
- package/dist/{index-CRdKUD0G.mjs → index-zEq02rJh.mjs} +23582 -25697
- package/dist/locales/en-US/common.d.ts +29 -52
- package/dist/locales/en-US.d.ts +29 -52
- package/dist/locales/zh-CN/common.d.ts +29 -52
- package/dist/locales/zh-CN.d.ts +29 -52
- package/dist/locales/zh-TW/common.d.ts +29 -52
- package/dist/locales/zh-TW.d.ts +29 -52
- package/dist/rcs.css +1 -1
- package/dist/rcs.es.js +65 -61
- package/dist/rcs.umd.js +132 -72
- package/package.json +38 -23
- package/dist/components/digitalsee/workflow/Canvas/FlowVersionManager.d.ts +0 -16
- package/dist/components/digitalsee/workflow/Canvas/NextConfigModalWrapper.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvas.d.ts +0 -4
- package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvasHeader.d.ts +0 -15
- package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +0 -38
- package/dist/components/digitalsee/workflow/NextNodesConfigModal/index.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/AISubNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/ActionNode.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/BuiltinMCPNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/ConditionNode.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/CustomNode.d.ts +0 -15
- package/dist/components/digitalsee/workflow/Nodes/LoopNode.d.ts +0 -4
- package/dist/components/digitalsee/workflow/Nodes/MCPServerNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/MCPToolNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/NextNodeFactory.d.ts +0 -12
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextActionNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextBaseNode.d.ts +0 -16
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextConditionNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextLoopNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextSwitchNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextTriggerNode.d.ts +0 -9
- package/dist/components/digitalsee/workflow/Nodes/SelfLoopNode.d.ts +0 -4
- package/dist/components/digitalsee/workflow/Nodes/StartNode.d.ts +0 -1
- package/dist/components/digitalsee/workflow/Nodes/SwitchNode.d.ts +0 -13
- package/dist/components/digitalsee/workflow/Nodes/TriggerNode.d.ts +0 -10
- package/dist/components/digitalsee/workflow/Nodes/components/NextNodeDescription.d.ts +0 -16
- package/dist/components/digitalsee/workflow/Nodes/components/NextNodeOperations.d.ts +0 -11
- package/dist/components/digitalsee/workflow/Nodes/useClassicNodePackagePorts.d.ts +0 -27
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CreateCredentialModal.d.ts +0 -13
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CredentialSelect.d.ts +0 -17
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/ModifyCredentialModal.d.ts +0 -17
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.d.ts +0 -10
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/index.d.ts +0 -17
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeSettings.d.ts +0 -6
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeTest.d.ts +0 -6
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/index.d.ts +0 -6
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.d.ts +0 -49
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/EntryTypeSelector.d.ts +0 -8
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/NodeCardList.d.ts +0 -20
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeActionState.d.ts +0 -28
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useNodeSelectorPresentation.d.ts +0 -25
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/queryParams.d.ts +0 -18
- package/dist/components/digitalsee/workflow/constants/nextHandles.d.ts +0 -1
- package/dist/components/digitalsee/workflow/utils/classicNodePackageConnection.d.ts +0 -28
- package/dist/components/digitalsee/workflow/utils/classicNodePackageGraphValidation.d.ts +0 -29
- package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +0 -14
- package/dist/components/digitalsee/workflow/utils/queuedNodeConfigOpen.d.ts +0 -12
- package/dist/index-CRdKUD0G.mjs.map +0 -1
- package/dist/index-rjDBrC08.mjs +0 -312
- package/dist/index-rjDBrC08.mjs.map +0 -1
- package/dist/rcs.es.js.map +0 -1
- package/dist/rcs.umd.js.map +0 -1
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/WorkflowNodeSchemaFieldProvider.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowCodeField.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/fields/WorkflowProxyField.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/{NextNodeConfig → NodePackageConfig}/proxyField.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/{next-compatible.d.ts → nodePackage-compatible.d.ts} +0 -0
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* 节点渲染类型(ReactFlow 层概念)
|
|
6
6
|
*/
|
|
7
7
|
export declare enum NodeType {
|
|
8
|
-
/** 开始节点 */
|
|
9
|
-
START = "START",
|
|
10
8
|
/** 触发节点 */
|
|
11
9
|
TRIGGER = "StartEventNode",
|
|
12
10
|
/** 动作节点 */
|
|
@@ -17,11 +15,8 @@ export declare enum NodeType {
|
|
|
17
15
|
LOOP = "LoopNode",
|
|
18
16
|
/** 自环节点 */
|
|
19
17
|
SELF_LOOP = "SelfLoopNode",
|
|
20
|
-
/** MCP服务节点 */
|
|
21
18
|
MCPServer = "MCPServerNode",
|
|
22
|
-
/** MCP网关触发节点 */
|
|
23
19
|
MCP_TRIGGER_NODE = "MCP_TRIGGER_NODE",
|
|
24
|
-
/** 内置MCP节点 */
|
|
25
20
|
BuiltinMCP = "BuiltinMCPNode",
|
|
26
21
|
/** 向量存储节点 */
|
|
27
22
|
VECTOR_STORE = "VectorStoreNode",
|
|
@@ -42,7 +37,11 @@ export declare enum NodeType {
|
|
|
42
37
|
/**
|
|
43
38
|
* 自定义节点类型(内部扩展用)
|
|
44
39
|
*/
|
|
45
|
-
CUSTOM = "custom"
|
|
40
|
+
CUSTOM = "custom",
|
|
41
|
+
/**
|
|
42
|
+
* 动态 NodePackage节点
|
|
43
|
+
*/
|
|
44
|
+
DYNAMIC = "dynamic"
|
|
46
45
|
}
|
|
47
46
|
/**
|
|
48
47
|
* 节点运行状态
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export declare function WorkflowPageExample(): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const setupCustomClient: () => void;
|
|
8
8
|
export declare function useWorkflowAuth(): {
|
|
9
|
-
updateToken: (
|
|
9
|
+
updateToken: (_token: string) => void;
|
|
10
10
|
clearToken: () => void;
|
|
11
11
|
};
|
|
12
12
|
export declare function LoginExample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { FlowStatus } from '../NodesConfig/define/flow';
|
|
2
|
-
/**
|
|
3
|
-
* 判断当前流程是否允许编辑。
|
|
4
|
-
*
|
|
5
|
-
* 已发布及发布中的流程始终只读,不能因启用版本管理而绕过状态限制。
|
|
6
|
-
*/
|
|
7
|
-
export declare const resolveFlowEditable: (isLocked: boolean, opStatus: FlowStatus) => boolean;
|
|
8
1
|
export declare const useFlowEditable: () => boolean;
|
|
9
2
|
export declare const useCurrentFlowId: () => string;
|
|
3
|
+
export declare const useCurrentFlowMeta: () => Record<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useFlowDataOperation: () => {
|
|
2
2
|
getNodes: () => import('@xyflow/react').Node[];
|
|
3
|
-
removeNodes: (
|
|
3
|
+
removeNodes: (nodeIds: string[]) => void;
|
|
4
4
|
removeEdges: (edgeIds: string[]) => void;
|
|
5
5
|
addEdges: (newEdges: any[]) => void;
|
|
6
6
|
addNodes: (newNodes: any[]) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CanvasLayoutResult } from '../utils/layoutUtils';
|
|
2
1
|
import { CanvasLayoutTarget } from '../enums/workflow';
|
|
2
|
+
import { CanvasLayoutResult } from '../utils/layoutUtils';
|
|
3
3
|
export declare const useCanvasLayout: (id?: string) => {
|
|
4
4
|
layout: (target?: CanvasLayoutTarget, shouldFitView?: boolean) => CanvasLayoutResult;
|
|
5
5
|
autoLayout: (shouldFitView?: boolean) => CanvasLayoutResult;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { HandleDirection } from '../enums/handle';
|
|
2
|
+
import { Edge } from '@xyflow/react';
|
|
3
|
+
/**
|
|
4
|
+
* 过滤指定 Handle 上的边,用于 maxConnections 计数。
|
|
5
|
+
*
|
|
6
|
+
* 自环边(source === target,如 LOOP 的 loop -> input)不占 target 桩的
|
|
7
|
+
* maxConnections 名额;handleStatus 仍将其视为已连接样式。
|
|
8
|
+
*/
|
|
9
|
+
export declare const filterHandleConnections: (edges: readonly Edge[], nodeId: string, handleId: string, handleType: HandleDirection) => Edge[];
|
|
2
10
|
export declare function useHandleConnections(): {
|
|
3
|
-
getHandleConnections: (nodeId: string, handleId: string, handleType: HandleDirection) =>
|
|
11
|
+
getHandleConnections: (nodeId: string, handleId: string, handleType: HandleDirection) => Edge[];
|
|
4
12
|
handleStatus: (nodeId: string, handleId: string) => "default" | "connected";
|
|
5
13
|
};
|
|
@@ -17,7 +17,6 @@ export declare function useWorkflow(id?: string): {
|
|
|
17
17
|
onEdgesChange: OnEdgesChange;
|
|
18
18
|
onConnect: OnConnect;
|
|
19
19
|
onEdgeUpdate: (oldEdge: Edge<EdgeData>, newConnection: Connection) => void;
|
|
20
|
-
addNodes: (newNodes: Node[]) => void;
|
|
21
20
|
addEdges: (newEdges: Edge[]) => void;
|
|
22
21
|
removeNodes: (nodeIds: string[]) => void;
|
|
23
22
|
removeEdges: (edgeIds: string[]) => void;
|
|
@@ -31,4 +30,5 @@ export declare function useWorkflow(id?: string): {
|
|
|
31
30
|
isLocked: boolean;
|
|
32
31
|
setLocked: (locked: boolean) => void;
|
|
33
32
|
autoSaveFlow: () => void;
|
|
33
|
+
flowMetadata: Record<string, unknown>;
|
|
34
34
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as defaultCanvasEngineConfig } from './config/defaultCanvasEngineConfig';
|
|
2
|
-
import { CanvasEngineConfig, DeepPartial, CanvasAPI, HistoryNavigator, HttpClient } from './types/engine';
|
|
2
|
+
import { CanvasEngineConfig, DeepPartial, WorkflowCanvasMode, CanvasAPI, HistoryNavigator, HttpClient } from './types/engine';
|
|
3
3
|
import { mergeConfig } from './utils/mergeConfig';
|
|
4
|
-
import { EngineMode } from './enums/workflow';
|
|
5
4
|
import { FlowDraftPayload } from './types/flowVersion';
|
|
6
5
|
import { LocaleType } from '../../../locales';
|
|
7
6
|
/**
|
|
@@ -17,29 +16,11 @@ export interface DigitalseeWorkFlowProps {
|
|
|
17
16
|
*/
|
|
18
17
|
workflowId?: string;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* 画布模式(默认 'edit')
|
|
21
20
|
*
|
|
22
|
-
* @description
|
|
21
|
+
* @description edit=可编辑可改名;flow=不能改名字、返回 history.back();preview=只读展示、不渲染 Header
|
|
23
22
|
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 是否预览模式
|
|
27
|
-
*
|
|
28
|
-
* @description 预览模式下仅展示,不允许交互
|
|
29
|
-
*/
|
|
30
|
-
preview?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 预览使用的工作流 ID
|
|
33
|
-
*/
|
|
34
|
-
previewId?: string;
|
|
35
|
-
/**
|
|
36
|
-
* 是否应用流模式
|
|
37
|
-
*/
|
|
38
|
-
appFlowMode?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* 是否链接模式
|
|
41
|
-
*/
|
|
42
|
-
linkMode?: boolean;
|
|
23
|
+
mode?: WorkflowCanvasMode;
|
|
43
24
|
/**
|
|
44
25
|
* 保存回调
|
|
45
26
|
*
|
|
@@ -63,23 +44,12 @@ export interface DigitalseeWorkFlowProps {
|
|
|
63
44
|
*
|
|
64
45
|
* @description Defaults to zh-CN when omitted
|
|
65
46
|
*/
|
|
66
|
-
locale?: LocaleType;
|
|
67
|
-
/**
|
|
68
|
-
* Base URL for workflow service APIs
|
|
69
|
-
*
|
|
70
|
-
* @description When provided, all internal API calls will prepend this URL
|
|
71
|
-
*/
|
|
72
|
-
apiBaseUrl?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Authorization token for workflow service APIs
|
|
75
|
-
*
|
|
76
|
-
* @description Injected as the Authorization header for every API call
|
|
77
|
-
*/
|
|
78
|
-
apiToken?: string;
|
|
47
|
+
locale?: LocaleType | string;
|
|
79
48
|
/**
|
|
80
49
|
* HTTP 客户端实例
|
|
81
50
|
*
|
|
82
|
-
* @description 用于执行所有 HTTP 请求,可传入自定义的 HTTP 客户端(如 axios
|
|
51
|
+
* @description 用于执行所有 HTTP 请求,可传入自定义的 HTTP 客户端(如 axios 实例)。
|
|
52
|
+
* 认证(token 等)与地址(baseUrl 等)完全由该客户端负责
|
|
83
53
|
*/
|
|
84
54
|
httpClient?: HttpClient;
|
|
85
55
|
/**
|
|
@@ -89,13 +59,15 @@ export interface DigitalseeWorkFlowProps {
|
|
|
89
59
|
*/
|
|
90
60
|
history?: HistoryNavigator;
|
|
91
61
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @
|
|
95
|
-
|
|
96
|
-
|
|
62
|
+
* 宿主响应连接流下线逻辑
|
|
63
|
+
* @param workflowId
|
|
64
|
+
* @returns 是否成功下线
|
|
65
|
+
*/
|
|
66
|
+
onOffline?: (workflowId: string) => Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* 场景值
|
|
97
69
|
*/
|
|
98
|
-
|
|
70
|
+
scene?: string;
|
|
99
71
|
}
|
|
100
72
|
/**
|
|
101
73
|
* DigitalseeWorkFlow 工作流画布组件
|
|
@@ -108,13 +80,15 @@ export { configureWorkflow, getGlobalWorkflowConfig, resetGlobalWorkflowConfig,
|
|
|
108
80
|
export * from './config/themeConfig';
|
|
109
81
|
export { useCanvasApi } from './context/canvasApiContext';
|
|
110
82
|
export { useCanvasConfig } from './context/canvasConfig';
|
|
83
|
+
export * from './design-system';
|
|
111
84
|
export { default as EdgeFactory } from './Edges/EdgeFactory';
|
|
112
85
|
export { NodeStatus, NodeType } from './enums/node';
|
|
113
|
-
export {
|
|
86
|
+
export { WorkflowOpStatus } from './enums/workflow';
|
|
114
87
|
export { default as HandleFactory } from './Handles/HandleFactory';
|
|
115
88
|
export { useCanvasLayout } from './hooks/useCanvasLayout';
|
|
116
89
|
export { useUndo } from './hooks/useUndo';
|
|
117
90
|
export { useWorkflow } from './hooks/useWorkflow';
|
|
91
|
+
export { default as AiFlowNodeStatusBadge, type NodeStatusBadgeProps as AiFlowNodeStatusBadgeProps, } from './Nodes/components/NodeStatusBadge';
|
|
118
92
|
export { default as NodeFactory } from './Nodes/NodeFactory';
|
|
119
93
|
export * from './types/Edge';
|
|
120
94
|
export type { CanvasAPI, CanvasEngineConfig, DeepPartial, HistoryNavigator, HttpClient, } from './types/engine';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FormattedMessage } from 'react-intl';
|
|
2
2
|
import * as history from 'history';
|
|
3
3
|
declare const context: history.BrowserHistory;
|
|
4
|
-
export { FormattedMessage };
|
|
5
|
-
export { context as history };
|
|
4
|
+
export { context as history, FormattedMessage };
|
|
6
5
|
export declare function Link(props: any): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export declare const useSearchParams: (url?: string) => URLSearchParams[];
|
|
@@ -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">,
|
|
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,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 {
|
|
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,19 @@ export interface HistoryNavigator {
|
|
|
11
11
|
goForward(): void;
|
|
12
12
|
listen?(listener: (location: any, action: any) => void): () => void;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* 画布模式(单一事实源):取代散落的 readOnly / preview / previewId / appFlowMode 参数。
|
|
16
|
+
*
|
|
17
|
+
* - edit : 可编辑可改名(默认),独立页导航返回 history.push('/link/ai-flow')
|
|
18
|
+
* - flow : 应用流嵌入页 不可改名字
|
|
19
|
+
* - preview: 只读展示,不渲染 Header,节点不可拖/连/选
|
|
20
|
+
*/
|
|
21
|
+
export type WorkflowCanvasMode = 'edit' | 'flow' | 'preview';
|
|
14
22
|
export type DeepPartial<T> = {
|
|
15
23
|
[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
24
|
};
|
|
17
25
|
export interface CanvasEngineConfig {
|
|
18
26
|
flowId: string;
|
|
19
|
-
engineMode?: EngineMode;
|
|
20
27
|
canvas: CanvasCoreConfig;
|
|
21
28
|
nodeSelector: NodeSelectorConfig;
|
|
22
29
|
nodeTypes: NodeTypesRegistryConfig;
|
|
@@ -25,6 +32,7 @@ export interface CanvasEngineConfig {
|
|
|
25
32
|
nodeConfigPanel: NodeConfigPanelConfig;
|
|
26
33
|
httpClient?: HttpClient;
|
|
27
34
|
history?: HistoryNavigator;
|
|
35
|
+
scene?: string;
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
38
|
* NodePackage 可连线候选能力配置。
|
|
@@ -56,7 +64,7 @@ export interface CanvasCoreConfig {
|
|
|
56
64
|
size?: number;
|
|
57
65
|
};
|
|
58
66
|
allowRemoveTrigger?: boolean;
|
|
59
|
-
mode?:
|
|
67
|
+
mode?: WorkflowCanvasMode;
|
|
60
68
|
miniMap?: boolean;
|
|
61
69
|
header?: boolean;
|
|
62
70
|
controls?: boolean;
|
|
@@ -158,17 +166,16 @@ export interface ToolbarConfig {
|
|
|
158
166
|
enableOnlineConfirmMessage?: string;
|
|
159
167
|
enableFlowText?: string;
|
|
160
168
|
/**
|
|
161
|
-
*
|
|
169
|
+
* 连接流版本管理集成回调,仅 CLASSIC/ACM 画布支持。
|
|
170
|
+
*
|
|
171
|
+
* 注意:「是否启用版本管理」由 `flowMetadata.version_group_id` 自动判定(归属版本组的流程即为版本管理流),
|
|
172
|
+
* 宿主无需配置 `enabled` 开关;提供下方任一回调即在版本管理流中显示对应入口。
|
|
162
173
|
*/
|
|
163
|
-
customOnlineApi?: (workflowId: string) => Promise<void>;
|
|
164
|
-
/**
|
|
165
|
-
* 自定义下线API,用于自定义MFA流程下线
|
|
166
|
-
*/
|
|
167
|
-
customOfflineApi?: (workflowId: string) => Promise<void>;
|
|
168
|
-
/** 连接流版本管理,仅 CLASSIC/ACM 画布支持。 */
|
|
169
174
|
versionManagement?: {
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
/** 宿主提供时才显示「历史版本」入口;点击时调用,由宿主打开历史 UI。 */
|
|
176
|
+
onShowHistory?: () => void;
|
|
177
|
+
/** 宿主提供时才显示「发布并启用」入口;点击时回调传入当前画布 payload(含 meta data)。 */
|
|
178
|
+
onConfirmPublish?: (payload?: any) => void;
|
|
172
179
|
};
|
|
173
180
|
}
|
|
174
181
|
export interface ToolbarButtonConfig {
|
|
@@ -276,5 +283,7 @@ export interface CanvasAPI {
|
|
|
276
283
|
*/
|
|
277
284
|
once<T = any>(event: CanvasEventType, handler: CanvasEventHandler<T>): void;
|
|
278
285
|
saveFlow(): Promise<import('./flowVersion').FlowDraftPayload | undefined>;
|
|
286
|
+
/** 刷新版本状态(版本号、发布状态等),从服务端拉取最新元数据写入 store */
|
|
287
|
+
refreshFlowVersionStatus(): Promise<void>;
|
|
279
288
|
}
|
|
280
289
|
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;
|
|
@@ -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 =
|
|
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
|
|
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;
|