@digitalsee-ai/rcs 0.0.15 → 1.0.1
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 +69 -237
- package/dist/components/digitalsee/workflow/Canvas/NextConfigModalWrapper.d.ts +9 -0
- package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvas.d.ts +4 -0
- package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvasHeader.d.ts +15 -0
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvas.d.ts +1 -12
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasBase.d.ts +4 -0
- package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +2 -1
- package/dist/components/digitalsee/workflow/Canvas/color.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +75 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +49 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +22 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/useDataLoading.d.ts +21 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +44 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeFormDraftCache.d.ts +14 -0
- package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +78 -0
- package/dist/components/digitalsee/workflow/Canvas/types.d.ts +91 -0
- package/dist/components/digitalsee/workflow/Edges/BaseEdge.d.ts +3 -2
- package/dist/components/digitalsee/workflow/Edges/EdgeFactory.d.ts +43 -0
- package/dist/components/digitalsee/workflow/NextNodesConfigModal/index.d.ts +13 -0
- package/dist/components/digitalsee/workflow/Nodes/ActionNode.d.ts +3 -3
- package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +2 -2
- package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +2 -2
- package/dist/components/digitalsee/workflow/Nodes/CustomNode.d.ts +2 -2
- package/dist/components/digitalsee/workflow/Nodes/NextNodeFactory.d.ts +11 -0
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextActionNode.d.ts +9 -0
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextBaseNode.d.ts +15 -0
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextConditionNode.d.ts +10 -0
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextLoopNode.d.ts +10 -0
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextSwitchNode.d.ts +10 -0
- package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextTriggerNode.d.ts +9 -0
- package/dist/components/digitalsee/workflow/Nodes/NodeFactory.d.ts +3 -12
- package/dist/components/digitalsee/workflow/Nodes/StickyNoteNode.d.ts +2 -2
- package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Nodes/components/NextNodeDescription.d.ts +16 -0
- package/dist/components/digitalsee/workflow/Nodes/components/NextNodeOperations.d.ts +11 -0
- package/dist/components/digitalsee/workflow/Nodes/components/NodeOperations.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/ActionNodeConfig/index.d.ts +7 -1
- package/dist/components/digitalsee/workflow/NodesConfig/ConditionNodeConfig/index.d.ts +5 -4
- package/dist/components/digitalsee/workflow/NodesConfig/ErrorHandler.d.ts +17 -2
- package/dist/components/digitalsee/workflow/NodesConfig/LoopNodeConfig/index.d.ts +2 -3
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CreateCredentialModal.d.ts +13 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CredentialSelect.d.ts +17 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/ModifyCredentialModal.d.ts +17 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.d.ts +10 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/index.d.ts +15 -0
- package/dist/components/digitalsee/workflow/NodesConfig/SwitchNodeConfig/index.d.ts +6 -5
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/CreateAccountModal/index.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/CredentialAccountForm.d.ts +10 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/DateField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/DateTimeField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/ExtendObjectField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/FixedObjectField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/PasswordField/index.d.ts +2 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/TextAreaField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/TextField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/TimeField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/ModifyAccountModal/index.d.ts +3 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/index.d.ts +5 -3
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/components/AIFormField.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/DateField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/DateTimeField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/FixedObjectField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/HourMinuteField/index.d.ts +5 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/common-placeholder-theme.d.ts +11 -11
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JavascriptTagEditorField/editor.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/interface.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/keywords.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/common-placeholder-theme.d.ts +11 -11
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/interface.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/plugin/keywords.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/plugin/keywords.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{MutilRowAIExtractConfigField → MultiRowAIExtractConfigField}/index.d.ts +2 -2
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/useVariableInfo.d.ts +13 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TextField/index.d.ts +2 -2
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TimeField/index.d.ts +1 -1
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +3 -3
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/next-compatible.d.ts +2 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/next-compatible.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeSettings.d.ts +6 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeTest.d.ts +6 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/index.d.ts +6 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.d.ts +49 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/components/VariableModal/index.d.ts +2 -1
- package/dist/components/digitalsee/workflow/NodesConfig/context.d.ts +4 -0
- package/dist/components/digitalsee/workflow/NodesConfig/define/actions.d.ts +3 -3
- package/dist/components/digitalsee/workflow/NodesConfig/define/condition.d.ts +5 -58
- package/dist/components/digitalsee/workflow/NodesConfig/define/condition.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/NodesConfig/define/flow.d.ts +1 -26
- package/dist/components/digitalsee/workflow/NodesConfig/index.d.ts +3 -6
- package/dist/components/digitalsee/workflow/NodesConfig/utils/credentialRequirement.d.ts +17 -0
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryTabs.d.ts +1 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +17 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/dataTransformers.d.ts +2 -1
- package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/dataTransformers.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/components/NodeListItem.d.ts +8 -0
- package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/hooks/useNodeList.d.ts +14 -0
- package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/index.d.ts +9 -0
- package/dist/components/digitalsee/workflow/api/dip.d.ts +311 -0
- package/dist/components/digitalsee/workflow/api/dip.types.d.ts +996 -0
- package/dist/components/digitalsee/workflow/api/index.d.ts +38 -13
- package/dist/components/digitalsee/workflow/api/index.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/builtin/controls/MultiRowGuard/index.d.ts +13 -0
- package/dist/components/digitalsee/workflow/builtin/controls/{MutilRowGuard → MultiRowGuard}/types.d.ts +15 -23
- package/dist/components/digitalsee/workflow/builtin/controls/MutilRowGuard/index.d.ts +9 -9
- package/dist/components/digitalsee/workflow/builtin/globalConfig/index.d.ts +1 -0
- package/dist/components/digitalsee/workflow/builtin/globalConfig/service.d.ts +8 -0
- package/dist/components/digitalsee/workflow/builtin/globalConfig/service.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/builtin/globalConfig/types.d.ts +17 -0
- package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -1
- package/dist/components/digitalsee/workflow/constants/nextHandles.d.ts +1 -0
- package/dist/components/digitalsee/workflow/enums/canvas.d.ts +63 -0
- package/dist/components/digitalsee/workflow/enums/edge.d.ts +10 -0
- package/dist/components/digitalsee/workflow/enums/handle.d.ts +42 -0
- package/dist/components/digitalsee/workflow/enums/index.d.ts +5 -0
- package/dist/components/digitalsee/workflow/enums/node.d.ts +199 -0
- package/dist/components/digitalsee/workflow/enums/workflow.d.ts +90 -0
- package/dist/components/digitalsee/workflow/events/eventBus.d.ts +8 -2
- package/dist/components/digitalsee/workflow/hooks/use-before-unload.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/useCanvasLayout.d.ts +2 -1
- package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +1 -1
- package/dist/components/digitalsee/workflow/hooks/usePanel.d.ts +26 -0
- package/dist/components/digitalsee/workflow/hooks/useVariables.d.ts +52 -0
- package/dist/components/digitalsee/workflow/hooks/useWorkflow.d.ts +3 -3
- package/dist/components/digitalsee/workflow/index.d.ts +23 -6
- package/dist/components/digitalsee/workflow/store/index.d.ts +17 -0
- package/dist/components/digitalsee/workflow/store/panelSlice.d.ts +5 -5
- package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +44 -0
- package/dist/components/digitalsee/workflow/store/workflowSlice.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/types/Edge.d.ts +1 -3
- package/dist/components/digitalsee/workflow/types/Handle.d.ts +3 -29
- package/dist/components/digitalsee/workflow/types/Node.d.ts +25 -63
- package/dist/components/digitalsee/workflow/types/NodeProtocol.d.ts +1 -12
- package/dist/components/digitalsee/workflow/types/Workflow.d.ts +4 -26
- package/dist/components/digitalsee/workflow/types/engine.d.ts +9 -0
- package/dist/components/digitalsee/workflow/utils/common.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/flowDataAdapterNext.d.ts +13 -0
- package/dist/components/digitalsee/workflow/utils/glob.d.ts +1 -1
- package/dist/components/digitalsee/workflow/utils/layoutUtils.d.ts +2 -3
- package/dist/components/digitalsee/workflow/utils/mergeConfig.d.ts +3 -6
- package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +6 -0
- package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.test.d.ts +1 -0
- package/dist/components/digitalsee/workflow/utils/nodeDataFormatter.d.ts +1 -1
- package/dist/components/digitalsee/workflow/utils/nodeDataFormatterNext.d.ts +11 -0
- package/dist/components/digitalsee/workflow/utils/nodeSummaryAdapter.d.ts +15 -0
- package/dist/components/dynamic-form/DynamicForm.d.ts +8 -3
- package/dist/components/dynamic-form/DynamicForm.test.d.ts +1 -0
- package/dist/components/dynamic-form/DynamicFormContext.d.ts +4 -0
- package/dist/components/dynamic-form/FieldRenderer.d.ts +6 -2
- package/dist/components/dynamic-form/components/ValueModeWrapper/index.d.ts +7 -1
- package/dist/components/dynamic-form/components/VariableInput/index.d.ts +1 -0
- package/dist/components/dynamic-form/fields/complex/KeyValueField.test.d.ts +1 -0
- package/dist/components/dynamic-form/fields/index.d.ts +12 -0
- package/dist/components/dynamic-form/index.d.ts +6 -6
- package/dist/components/dynamic-form/registry/createFieldComponent.test.d.ts +1 -0
- package/dist/components/dynamic-form/registry/index.d.ts +2 -2
- package/dist/components/dynamic-form/types/field-component.d.ts +12 -3
- package/dist/locales/en-US/common.d.ts +8 -17
- package/dist/locales/en-US/components.d.ts +28 -0
- package/dist/locales/en-US/link/flow.d.ts +9 -5
- package/dist/locales/en-US.d.ts +42 -22
- package/dist/locales/index.d.ts +2 -714
- package/dist/locales/zh-CN/common.d.ts +8 -17
- package/dist/locales/zh-CN/components.d.ts +28 -0
- package/dist/locales/zh-CN/link/flow.d.ts +9 -5
- package/dist/locales/zh-CN.d.ts +42 -22
- package/dist/locales/zh-TW/common.d.ts +8 -17
- package/dist/locales/zh-TW/components.d.ts +28 -0
- package/dist/locales/zh-TW/link/flow.d.ts +9 -5
- package/dist/locales/zh-TW.d.ts +42 -22
- package/dist/postcss.config.js +1 -0
- package/dist/rcs.css +1 -1
- package/dist/rcs.es.js +55726 -50708
- package/dist/rcs.es.js.map +1 -0
- package/dist/rcs.umd.js +68 -67
- package/dist/rcs.umd.js.map +1 -0
- package/package.json +148 -151
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/HourMiniuteField/index.d.ts +0 -5
- package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JavscriptTagEditorField/editor.d.ts +0 -1
- package/dist/components/digitalsee/workflow/NodesConfig/define/config-form-item.d.ts +0 -40
- package/dist/components/digitalsee/workflow/de.d.ts +0 -1
- package/dist/components/digitalsee/workflow/types/SaveStatus.d.ts +0 -1
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/extensions.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/index.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/base-theme.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/custom-completions.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/functions.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/hint.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/placeholders.d.ts +0 -0
- /package/dist/components/digitalsee/workflow/hooks/{use-wokflow-id.d.ts → use-workflow-id.d.ts} +0 -0
|
@@ -15,8 +15,14 @@ export type NodeAddEvent = {
|
|
|
15
15
|
info: NodeAddInfo;
|
|
16
16
|
nodeType: NodeTypeItem;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
/** 简易事件发射器 */
|
|
19
|
+
interface SimpleEventEmitter<T> {
|
|
20
|
+
emit: (val: T) => void;
|
|
21
|
+
useSubscription: (callback: (val: T) => void) => void;
|
|
22
|
+
listeners: Set<(val: T) => void>;
|
|
23
|
+
}
|
|
24
|
+
export declare const nodeAddEventBus: SimpleEventEmitter<NodeAddEvent>;
|
|
19
25
|
export declare const canvasEventBus: {
|
|
20
|
-
nodeAdd:
|
|
26
|
+
nodeAdd: SimpleEventEmitter<NodeAddEvent>;
|
|
21
27
|
};
|
|
22
28
|
export default canvasEventBus;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CanvasLayoutResult
|
|
1
|
+
import { CanvasLayoutResult } from '../utils/layoutUtils';
|
|
2
|
+
import { CanvasLayoutTarget } from '../enums/workflow';
|
|
2
3
|
export declare const useCanvasLayout: (id?: string) => {
|
|
3
4
|
layout: (target?: CanvasLayoutTarget, shouldFitView?: boolean) => CanvasLayoutResult;
|
|
4
5
|
autoLayout: (shouldFitView?: boolean) => CanvasLayoutResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HandleDirection } from '../
|
|
1
|
+
import { HandleDirection } from '../enums/handle';
|
|
2
2
|
export declare function useHandleConnections(): {
|
|
3
3
|
getHandleConnections: (nodeId: string, handleId: string, handleType: HandleDirection) => import('@xyflow/react').Edge[];
|
|
4
4
|
handleStatus: (nodeId: string, handleId: string) => "default" | "connected";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActionItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
2
|
+
export interface NodeAddInfo {
|
|
3
|
+
sourceNodeId?: string;
|
|
4
|
+
sourceHandle?: string;
|
|
5
|
+
targetNodeId?: string;
|
|
6
|
+
targetHandle?: string;
|
|
7
|
+
position?: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
edge?: any;
|
|
12
|
+
sourceNode?: any;
|
|
13
|
+
targetNode?: any;
|
|
14
|
+
trigger?: boolean;
|
|
15
|
+
protocol?: string;
|
|
16
|
+
refresh?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function usePanel(): {
|
|
19
|
+
nodeSelectorVisible: boolean;
|
|
20
|
+
nodeAddInfo: import('../store/panelSlice').NodeAddInfo;
|
|
21
|
+
openNodeSelector: (info: NodeAddInfo) => void;
|
|
22
|
+
closeNodeSelector: () => void;
|
|
23
|
+
handleNodeSelect: (nodeType: ActionItem) => void;
|
|
24
|
+
handleManualAdd: (info: any, nodeType: ActionItem) => void;
|
|
25
|
+
setNodeAddCallback: (callback: (info: NodeAddInfo, nodeType: ActionItem) => void) => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { VarDatum } from '../NodesConfig/components/VariableModal/tree-help';
|
|
2
|
+
export declare enum GlobalVariableType {
|
|
3
|
+
TEXT = "TEXT",
|
|
4
|
+
NUMBER = "NUMBER",
|
|
5
|
+
JSON = "JSON"
|
|
6
|
+
}
|
|
7
|
+
export interface GlobalVariableDto {
|
|
8
|
+
id: number | string;
|
|
9
|
+
name: string;
|
|
10
|
+
display_name?: string;
|
|
11
|
+
var_type: GlobalVariableType;
|
|
12
|
+
var_value: unknown;
|
|
13
|
+
description?: string;
|
|
14
|
+
allow_flow_update?: 0 | 1;
|
|
15
|
+
create_time?: string;
|
|
16
|
+
update_time?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface EnhancedGlobalVariable extends GlobalVariableDto {
|
|
19
|
+
mappedType: 'STRING' | 'NUMBER' | 'OBJECT';
|
|
20
|
+
}
|
|
21
|
+
export interface EnhancedVarDatum extends VarDatum {
|
|
22
|
+
nodeIcon?: string;
|
|
23
|
+
isValid: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface UseVariablesOptions {
|
|
26
|
+
nodeId: string;
|
|
27
|
+
flowId: string;
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
includeGlobalVariables?: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface UseVariablesReturn {
|
|
32
|
+
globalVariables: EnhancedGlobalVariable[];
|
|
33
|
+
nodeVariables: EnhancedVarDatum[];
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
refresh: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 加载 classic 变量面板需要展示的全局变量和节点变量。
|
|
39
|
+
*
|
|
40
|
+
* 处理逻辑:
|
|
41
|
+
* - `enabled` 为 false 或 `flowId` 为空:不请求后端,保持当前状态。
|
|
42
|
+
* - 开启全局变量:同时请求全局变量接口;关闭时使用空列表兜底。
|
|
43
|
+
* - 节点变量:后端变量树里的 `node_id` 使用旧版变量 token 语义,节点引用固定
|
|
44
|
+
* 带 `N` 前缀;匹配 React Flow 节点时需要先去掉这个前缀。
|
|
45
|
+
* - 匹配到节点:补充节点图标,并标记变量有效。
|
|
46
|
+
* - 未匹配到节点:保留变量数据但标记无效,避免错误绑定到其他节点。
|
|
47
|
+
*
|
|
48
|
+
* @param options 变量加载参数,包含当前节点 ID、流程 ID 和开关项。
|
|
49
|
+
* @returns 变量列表、加载状态和手动刷新函数。
|
|
50
|
+
*/
|
|
51
|
+
export declare const useVariables: (options: UseVariablesOptions) => UseVariablesReturn;
|
|
52
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Connection, Edge, Node, OnConnect, OnEdgesChange, OnNodesChange } from '@xyflow/react';
|
|
2
2
|
import { EdgeData } from '../types/Edge';
|
|
3
3
|
import { NodeData } from '../types/Node';
|
|
4
|
-
import {
|
|
4
|
+
import { FlowStatus } from '../NodesConfig/define/flow';
|
|
5
5
|
export interface UseWorkflowOptions {
|
|
6
6
|
initialNodes?: Node<NodeData>[];
|
|
7
7
|
initialEdges?: Edge<EdgeData>[];
|
|
@@ -9,7 +9,7 @@ export interface UseWorkflowOptions {
|
|
|
9
9
|
export declare function useWorkflow(id?: string): {
|
|
10
10
|
nodes: Node<NodeData>[];
|
|
11
11
|
edges: Edge<EdgeData>[];
|
|
12
|
-
op_status:
|
|
12
|
+
op_status: FlowStatus;
|
|
13
13
|
selectedNodes: Node<NodeData>[];
|
|
14
14
|
selectedEdges: Edge<EdgeData>[];
|
|
15
15
|
currentNodeConfigVisibleId: string;
|
|
@@ -25,7 +25,7 @@ export declare function useWorkflow(id?: string): {
|
|
|
25
25
|
setEdges: (newEdges: Edge[]) => void;
|
|
26
26
|
updateNode: (nodeId: string, nodeData: Partial<NodeData>) => void;
|
|
27
27
|
refreshFlow: () => void;
|
|
28
|
-
setFlowOpStatusAction: (opStatus:
|
|
28
|
+
setFlowOpStatusAction: (opStatus: FlowStatus) => void;
|
|
29
29
|
workflowId: string;
|
|
30
30
|
setNodeConfigVisible: (nodeId: string | null) => void;
|
|
31
31
|
isLocked: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { default as defaultCanvasEngineConfig } from './config/defaultCanvasEngineConfig';
|
|
3
|
-
import { CanvasEngineConfig, HistoryNavigator, HttpClient } from './types/engine';
|
|
2
|
+
import { CanvasEngineConfig, DeepPartial, HistoryNavigator, HttpClient, CanvasAPI } from './types/engine';
|
|
4
3
|
import { mergeConfig } from './utils/mergeConfig';
|
|
5
4
|
import { LocaleType } from '../../../locales';
|
|
5
|
+
import { EngineMode } from './enums/workflow';
|
|
6
6
|
/**
|
|
7
7
|
* DigitalseeWorkFlow 组件对外暴露的属性定义
|
|
8
8
|
*
|
|
@@ -45,12 +45,18 @@ export interface DigitalseeWorkFlowProps {
|
|
|
45
45
|
* @param workflow 当前工作流数据
|
|
46
46
|
*/
|
|
47
47
|
onSave?: (workflow: any) => void;
|
|
48
|
+
/**
|
|
49
|
+
* 画布初始化回调
|
|
50
|
+
*
|
|
51
|
+
* @param api 画布对外 API
|
|
52
|
+
*/
|
|
53
|
+
onInit?: (api: CanvasAPI) => void;
|
|
48
54
|
/**
|
|
49
55
|
* 画布配置
|
|
50
56
|
*
|
|
51
57
|
* @description 支持传入局部配置,内部会与默认配置做深度合并
|
|
52
58
|
*/
|
|
53
|
-
config?:
|
|
59
|
+
config?: DeepPartial<CanvasEngineConfig>;
|
|
54
60
|
/**
|
|
55
61
|
* Locale override for workflow translations
|
|
56
62
|
*
|
|
@@ -81,18 +87,29 @@ export interface DigitalseeWorkFlowProps {
|
|
|
81
87
|
* @description 用于处理页面导航,可传入 React Router 的 history 对象
|
|
82
88
|
*/
|
|
83
89
|
history?: HistoryNavigator;
|
|
90
|
+
/**
|
|
91
|
+
* 引擎模式
|
|
92
|
+
*
|
|
93
|
+
* @description 'classic' 使用 ACM 后端,'next' 使用 DIP 后端 + DynamicForm
|
|
94
|
+
* @default 'classic'
|
|
95
|
+
*/
|
|
96
|
+
engineMode?: EngineMode;
|
|
84
97
|
}
|
|
85
98
|
/**
|
|
86
99
|
* DigitalseeWorkFlow 工作流画布组件
|
|
87
100
|
*
|
|
88
101
|
* @param props 组件参数
|
|
89
102
|
*/
|
|
90
|
-
declare const DigitalseeWorkFlow:
|
|
103
|
+
declare const DigitalseeWorkFlow: (props: DigitalseeWorkFlowProps) => any;
|
|
91
104
|
export { DigitalseeWorkFlow };
|
|
92
105
|
export type { WorkflowHttpClient } from './api';
|
|
93
|
-
export type { CanvasEngineConfig, HistoryNavigator, HttpClient } from './types/engine';
|
|
106
|
+
export type { CanvasAPI, CanvasEngineConfig, DeepPartial, HistoryNavigator, HttpClient, } from './types/engine';
|
|
107
|
+
export { EngineMode, WorkflowOpStatus } from './enums/workflow';
|
|
108
|
+
export { NodeStatus, NodeType } from './enums/node';
|
|
109
|
+
export { useCanvasApi } from './context/canvasApiContext';
|
|
110
|
+
export { useCanvasConfig } from './context/canvasConfig';
|
|
94
111
|
export { defaultCanvasEngineConfig, mergeConfig };
|
|
95
|
-
export type { LocaleType as WorkflowLocale, TranslateFn as WorkflowTranslateFn } from '../../../locales';
|
|
112
|
+
export type { LocaleType as WorkflowLocale, TranslateFn as WorkflowTranslateFn, } from '../../../locales';
|
|
96
113
|
export { createTranslator } from '../../../locales';
|
|
97
114
|
export { configureWorkflow, getGlobalWorkflowConfig, resetGlobalWorkflowConfig, } from './config/globalConfig';
|
|
98
115
|
export * from './config/themeConfig';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TypedUseSelectorHook } from 'react-redux';
|
|
2
|
+
export declare const store: import('@reduxjs/toolkit').EnhancedStore<{
|
|
3
|
+
workflow: import('./workflowSlice').WorkflowState;
|
|
4
|
+
panel: import('./panelSlice').PanelState;
|
|
5
|
+
}, import('@reduxjs/toolkit').UnknownAction, import('@reduxjs/toolkit').Tuple<[import('@reduxjs/toolkit').StoreEnhancer<{
|
|
6
|
+
dispatch: import('@reduxjs/toolkit').ThunkDispatch<{
|
|
7
|
+
workflow: import('./workflowSlice').WorkflowState;
|
|
8
|
+
panel: import('./panelSlice').PanelState;
|
|
9
|
+
}, undefined, import('@reduxjs/toolkit').UnknownAction>;
|
|
10
|
+
}>, import('@reduxjs/toolkit').StoreEnhancer]>>;
|
|
11
|
+
export type RootState = ReturnType<typeof store.getState>;
|
|
12
|
+
export type AppDispatch = typeof store.dispatch;
|
|
13
|
+
export declare const useAppDispatch: () => import('@reduxjs/toolkit').ThunkDispatch<{
|
|
14
|
+
workflow: import('./workflowSlice').WorkflowState;
|
|
15
|
+
panel: import('./panelSlice').PanelState;
|
|
16
|
+
}, undefined, import('@reduxjs/toolkit').UnknownAction> & import('@reduxjs/toolkit').Dispatch<import('@reduxjs/toolkit').UnknownAction>;
|
|
17
|
+
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { NodeTypeItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
3
|
-
interface NodeAddInfo {
|
|
2
|
+
import { ActionItem, NodeTypeItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
3
|
+
export interface NodeAddInfo {
|
|
4
4
|
sourceNodeId: string;
|
|
5
5
|
sourceHandle: string;
|
|
6
6
|
targetNodeId?: string;
|
|
@@ -12,8 +12,8 @@ interface NodeAddInfo {
|
|
|
12
12
|
trigger?: boolean;
|
|
13
13
|
protocol?: string;
|
|
14
14
|
}
|
|
15
|
-
type NodeAddCallback = ((info: NodeAddInfo, nodeType:
|
|
16
|
-
interface PanelState {
|
|
15
|
+
type NodeAddCallback = ((info: NodeAddInfo, nodeType: ActionItem) => void) | null;
|
|
16
|
+
export interface PanelState {
|
|
17
17
|
nodeSelectorVisible: boolean;
|
|
18
18
|
nodeAddInfo: NodeAddInfo | null;
|
|
19
19
|
nodeAddCallback: NodeAddCallback;
|
|
@@ -84,6 +84,6 @@ export declare const panelSlice: import('@reduxjs/toolkit').Slice<PanelState, {
|
|
|
84
84
|
nodeAddCallback: NodeAddCallback;
|
|
85
85
|
}, action: PayloadAction<NodeTypeItem>) => void;
|
|
86
86
|
}, "panel", "panel", import('@reduxjs/toolkit').SliceSelectors<PanelState>>;
|
|
87
|
-
export declare const openNodeSelector: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<NodeAddInfo, "panel/openNodeSelector">, closeNodeSelector: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"panel/closeNodeSelector">, setNodeAddCallback: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<(info: NodeAddInfo, nodeType:
|
|
87
|
+
export declare const openNodeSelector: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<NodeAddInfo, "panel/openNodeSelector">, closeNodeSelector: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"panel/closeNodeSelector">, setNodeAddCallback: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<(info: NodeAddInfo, nodeType: ActionItem) => void, "panel/setNodeAddCallback">, executeNodeAddCallback: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<NodeTypeItem, "panel/executeNodeAddCallback">;
|
|
88
88
|
declare const _default: import('@reduxjs/toolkit').Reducer<PanelState>;
|
|
89
89
|
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FlowStatus } from '../NodesConfig/define/flow';
|
|
2
|
+
import { EdgeData } from '../types/Edge';
|
|
3
|
+
import { NodeData, NodeType } from '../types/Node';
|
|
4
|
+
import { Connection, Edge, EdgeChange, Node, NodeChange } from '@xyflow/react';
|
|
5
|
+
export interface ExecutionControlState {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
timeout_value: number;
|
|
8
|
+
timeout_unit: 'SECONDS' | 'MINUTES' | 'HOURS';
|
|
9
|
+
max_node_executions: number;
|
|
10
|
+
webhook_url?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkflowState {
|
|
13
|
+
nodes: Node<NodeData>[];
|
|
14
|
+
edges: Edge<EdgeData>[];
|
|
15
|
+
selectedNodes: Node<NodeData>[];
|
|
16
|
+
selectedEdges: Edge<EdgeData>[];
|
|
17
|
+
workflowId?: string;
|
|
18
|
+
workflowName: string;
|
|
19
|
+
op_status?: FlowStatus;
|
|
20
|
+
refreshWorkFlowNum: number;
|
|
21
|
+
autoSaveWatchNum: number;
|
|
22
|
+
currentNodeConfigVisibleId: string | null;
|
|
23
|
+
isLocked: boolean;
|
|
24
|
+
executionControl: ExecutionControlState | null;
|
|
25
|
+
}
|
|
26
|
+
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<{
|
|
27
|
+
type: NodeType;
|
|
28
|
+
position: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
data: NodeData;
|
|
33
|
+
}, "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<{
|
|
34
|
+
nodes: Node<NodeData>[];
|
|
35
|
+
edges: Edge<EdgeData>[];
|
|
36
|
+
}, "workflow/setSelection">, updateEdge: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
37
|
+
oldEdge: Edge<EdgeData>;
|
|
38
|
+
newConnection: Connection;
|
|
39
|
+
}, "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<{
|
|
40
|
+
id: string;
|
|
41
|
+
data: Partial<NodeData>;
|
|
42
|
+
}, "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">, resetFlow: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/resetFlow">, executeAutoSave: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"workflow/executeAutoSave">;
|
|
43
|
+
declare const _default: import('@reduxjs/toolkit').Reducer<WorkflowState>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,36 +1,10 @@
|
|
|
1
1
|
import { Position } from '@xyflow/react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
TARGET = "target"
|
|
5
|
-
}
|
|
6
|
-
export declare enum HandleType {
|
|
7
|
-
SOURCE = "source",
|
|
8
|
-
TARGET = "target"
|
|
9
|
-
}
|
|
10
|
-
export declare enum HandleConnectionType {
|
|
11
|
-
INPUT = "input",
|
|
12
|
-
OUTPUT = "output",
|
|
13
|
-
CHAT_MODEL = "chat_model",
|
|
14
|
-
DONE = "done",
|
|
15
|
-
LOOP = "loop",
|
|
16
|
-
FALSE = "false",
|
|
17
|
-
TRUE = "true",
|
|
18
|
-
MEMORY = "memory",
|
|
19
|
-
TOOLS = "tools",
|
|
20
|
-
BUILTIN_MCP = "builtin_mcp"
|
|
21
|
-
}
|
|
22
|
-
export type HandleDirection = 'input' | 'output';
|
|
23
|
-
export declare enum HandleStatus {
|
|
24
|
-
DEFAULT = "default",
|
|
25
|
-
VALID = "valid",
|
|
26
|
-
INVALID = "invalid",
|
|
27
|
-
CONNECTING = "connecting",
|
|
28
|
-
FULL = "full"
|
|
29
|
-
}
|
|
2
|
+
import { HandleType, HandleStatus } from '../enums/handle';
|
|
3
|
+
export { HandleType, HandleConnectionType, HandleDirection, HandleStatus, } from '../enums/handle';
|
|
30
4
|
export interface HandleData {
|
|
31
5
|
id: string;
|
|
32
6
|
label?: string;
|
|
33
|
-
type:
|
|
7
|
+
type: HandleType;
|
|
34
8
|
position: Position;
|
|
35
9
|
isMain?: boolean;
|
|
36
10
|
maxConnections?: number;
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { Node as ReactFlowNode } from '@xyflow/react';
|
|
2
2
|
import { ActionItem } from '../Panels/ModernNodeSelectorPanel/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TRIGGER = "StartEventNode",
|
|
6
|
-
ACTION = "ActionNode",
|
|
7
|
-
CONDITION = "ConditionNode",
|
|
8
|
-
LOOP = "LoopNode",
|
|
9
|
-
SELFLOOP = "SelfLoopNode",
|
|
10
|
-
MCPServer = "MCPServerNode",
|
|
11
|
-
BuiltinMCP = "BuiltinMCPNode",
|
|
12
|
-
VECTORSTORE = "VectorStoreNode",
|
|
13
|
-
AGENT = "AgentNode",
|
|
14
|
-
BROWSER = "BrowserNode",
|
|
15
|
-
AISUBNODE = "AISubNode",
|
|
16
|
-
MCPTOOL = "MCPToolNode",
|
|
17
|
-
ENDNODE = "EndNode",
|
|
18
|
-
SWITCH = "SwitchNode",
|
|
19
|
-
STICKY = "StickyNoteNode"
|
|
20
|
-
}
|
|
3
|
+
import { NodeStatus } from '../enums/node';
|
|
4
|
+
export { NodeType, NodeStatus } from '../enums/node';
|
|
21
5
|
export type NodeData = ActionItem & {
|
|
22
6
|
connector_name: string;
|
|
23
7
|
description: string;
|
|
@@ -25,6 +9,28 @@ export type NodeData = ActionItem & {
|
|
|
25
9
|
closed: '0' | '1';
|
|
26
10
|
note: string | null;
|
|
27
11
|
status: NodeStatus;
|
|
12
|
+
/** 节点显示标签 */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** 是否悬停 */
|
|
15
|
+
isHovered?: boolean;
|
|
16
|
+
/** 后端返回的原始数据 */
|
|
17
|
+
backendData?: Record<string, any>;
|
|
18
|
+
/** 节点配置 schema */
|
|
19
|
+
config_schema?: any;
|
|
20
|
+
/** 后端节点类型标识 */
|
|
21
|
+
node_type?: string;
|
|
22
|
+
/** 动作 ID */
|
|
23
|
+
action_id?: string;
|
|
24
|
+
/** 连接器 ID */
|
|
25
|
+
connector_id?: string;
|
|
26
|
+
/** 后端节点 ID */
|
|
27
|
+
n_id?: string;
|
|
28
|
+
/** 账号 ID */
|
|
29
|
+
account_id?: string | null;
|
|
30
|
+
/** 节点协议类型(AI_LANGUAGE_MODEL / MCP 等) */
|
|
31
|
+
protocol?: string;
|
|
32
|
+
/** index signature — 满足 ReactFlow v12 的 Record<string, unknown> 约束 */
|
|
33
|
+
[key: string]: unknown;
|
|
28
34
|
};
|
|
29
35
|
export interface WorkflowNode extends ReactFlowNode<NodeData> {
|
|
30
36
|
type: string;
|
|
@@ -47,7 +53,7 @@ export interface NodeParameter {
|
|
|
47
53
|
}>;
|
|
48
54
|
}
|
|
49
55
|
export interface NodeDefinition {
|
|
50
|
-
type:
|
|
56
|
+
type: string;
|
|
51
57
|
name: string;
|
|
52
58
|
description: string;
|
|
53
59
|
icon: string;
|
|
@@ -56,47 +62,3 @@ export interface NodeDefinition {
|
|
|
56
62
|
outputs: number;
|
|
57
63
|
parameters: NodeParameter[];
|
|
58
64
|
}
|
|
59
|
-
export declare enum NodeStatus {
|
|
60
|
-
/**
|
|
61
|
-
* 未发布 该节点配置不完整
|
|
62
|
-
*
|
|
63
|
-
* @type {string}
|
|
64
|
-
* @memberof NodeStatus
|
|
65
|
-
*/
|
|
66
|
-
INVALID = "INVALID",
|
|
67
|
-
/**
|
|
68
|
-
* 空闲状态
|
|
69
|
-
*
|
|
70
|
-
* @type {string}
|
|
71
|
-
* @memberof NodeStatus
|
|
72
|
-
*/
|
|
73
|
-
IDLE = "IDLE",
|
|
74
|
-
/**
|
|
75
|
-
* 运行中
|
|
76
|
-
*
|
|
77
|
-
* @type {string}
|
|
78
|
-
* @memberof NodeStatus
|
|
79
|
-
*/
|
|
80
|
-
RUNNING = "RUNNING",
|
|
81
|
-
/**
|
|
82
|
-
* 最近一次执行失败
|
|
83
|
-
*
|
|
84
|
-
* @type {string}
|
|
85
|
-
* @memberof NodeStatus
|
|
86
|
-
*/
|
|
87
|
-
FAILED = "FAILED",
|
|
88
|
-
/**
|
|
89
|
-
* 最近一次执行成功
|
|
90
|
-
*
|
|
91
|
-
* @type {string}
|
|
92
|
-
* @memberof NodeStatus
|
|
93
|
-
*/
|
|
94
|
-
SUCCESS = "SUCCESS",
|
|
95
|
-
/**
|
|
96
|
-
* 线上运行
|
|
97
|
-
*
|
|
98
|
-
* @type {string}
|
|
99
|
-
* @memberof NodeStatus
|
|
100
|
-
*/
|
|
101
|
-
RUNNABLE = "RUNNABLE"
|
|
102
|
-
}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
AI_LANGUAGE_MODEL = "AI_LANGUAGE_MODEL",
|
|
3
|
-
AI_VECTOR_STORE = "AI_VECTORSTORE",
|
|
4
|
-
AI_MEMORY = "AI_MEMORY",
|
|
5
|
-
AI_DOCUMENT = "AI_DOCUMENT",
|
|
6
|
-
AI_TEXT_SPLITTER = "AI_TEXTSPLITTER",
|
|
7
|
-
AI_EMBEDDING = "AI_EMBEDDING",
|
|
8
|
-
AI_TOOL = "AI_TOOL",
|
|
9
|
-
MCP = "MCP",
|
|
10
|
-
BUILTIN_MCP = "BUILTIN_MCP",
|
|
11
|
-
MCP_SERVER = "MCP_SERVER"
|
|
12
|
-
}
|
|
1
|
+
export { NodeProtocol } from '../enums/node';
|
|
@@ -1,31 +1,9 @@
|
|
|
1
1
|
import { WorkflowEdge } from './Edge';
|
|
2
2
|
import { WorkflowNode } from './Node';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
UNPUBLISHED = "UNPUBLISHED",
|
|
8
|
-
/**
|
|
9
|
-
* 已上线
|
|
10
|
-
*/
|
|
11
|
-
ONLINE = "ONLINE",
|
|
12
|
-
/**
|
|
13
|
-
* 已下线
|
|
14
|
-
*/
|
|
15
|
-
OFFLINE = "OFFLINE",
|
|
16
|
-
/**
|
|
17
|
-
* 未发布
|
|
18
|
-
*/
|
|
19
|
-
ON_WARN = "ON_WARN",
|
|
20
|
-
/**
|
|
21
|
-
* 未发布
|
|
22
|
-
*/
|
|
23
|
-
OFF_WARN = "OFF_WARN",
|
|
24
|
-
/**
|
|
25
|
-
* 上线中
|
|
26
|
-
*/
|
|
27
|
-
ONLINE_ING = "ONLINE_ING"
|
|
28
|
-
}
|
|
3
|
+
import { WorkflowOpStatus } from '../enums/workflow';
|
|
4
|
+
/**
|
|
5
|
+
* 工作流定义
|
|
6
|
+
*/
|
|
29
7
|
export interface Workflow {
|
|
30
8
|
id: string;
|
|
31
9
|
name: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactFlow } from '@xyflow/react';
|
|
2
2
|
import { ComponentProps, ReactNode } from 'react';
|
|
3
3
|
import { Rule } from 'antd/es/form';
|
|
4
|
+
import { EngineMode, WorkflowOpStatus } from '../enums/workflow';
|
|
4
5
|
export type HttpClient = <T = any>(url: string, config: any) => Promise<T>;
|
|
5
6
|
export interface HistoryNavigator {
|
|
6
7
|
push(path: string, state?: any): void;
|
|
@@ -10,8 +11,12 @@ export interface HistoryNavigator {
|
|
|
10
11
|
goForward(): void;
|
|
11
12
|
listen?(listener: (location: any, action: any) => void): () => void;
|
|
12
13
|
}
|
|
14
|
+
export type DeepPartial<T> = {
|
|
15
|
+
[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
|
+
};
|
|
13
17
|
export interface CanvasEngineConfig {
|
|
14
18
|
flowId: string;
|
|
19
|
+
engineMode?: EngineMode;
|
|
15
20
|
canvas: CanvasCoreConfig;
|
|
16
21
|
nodeTypes: NodeTypesRegistryConfig;
|
|
17
22
|
edgeRules: EdgeRulesConfig;
|
|
@@ -56,6 +61,7 @@ export interface CanvasCoreConfig {
|
|
|
56
61
|
}
|
|
57
62
|
export interface NodeTypesRegistryConfig {
|
|
58
63
|
types: Record<string, NodeTypeConfig>;
|
|
64
|
+
nodeBlackList?: string[];
|
|
59
65
|
fixed?: {
|
|
60
66
|
triggers?: string[];
|
|
61
67
|
finalAction?: string;
|
|
@@ -146,6 +152,8 @@ export interface ToolbarButtonConfig {
|
|
|
146
152
|
icon?: ReactNode;
|
|
147
153
|
style?: Record<string, any>;
|
|
148
154
|
type?: 'link' | 'text' | 'default' | 'primary' | 'dashed';
|
|
155
|
+
danger?: boolean;
|
|
156
|
+
loading?: boolean;
|
|
149
157
|
onClick?: (ctx: CanvasAPI) => void;
|
|
150
158
|
}
|
|
151
159
|
export interface NodeConfigPanelConfig {
|
|
@@ -188,6 +196,7 @@ export interface CanvasAPI {
|
|
|
188
196
|
init(): void;
|
|
189
197
|
destroy(): void;
|
|
190
198
|
refresh(): void;
|
|
199
|
+
setFlowOpStatus(status: WorkflowOpStatus): void;
|
|
191
200
|
getData(): FlowData;
|
|
192
201
|
setData(flow: FlowData): void;
|
|
193
202
|
exportJSON(): any;
|
|
@@ -42,6 +42,7 @@ export declare function objectToBase64(obj: any): string;
|
|
|
42
42
|
* @example
|
|
43
43
|
* ```typescript
|
|
44
44
|
* const requestConfig = objectToBase64RequestBody({ name: '张三', age: 25 });
|
|
45
|
+
* cspell: disable-next-line
|
|
45
46
|
* // 返回: { data: "eyJuYW1lIjoi5byg5LiJIiwiYWdlIjoyNX0=", headers: { 'Content-Type': 'text/plain' } }
|
|
46
47
|
*
|
|
47
48
|
* // 使用方式:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DipWorkflowDefinitionEntity } from '../api/dip';
|
|
2
|
+
import { Edge, Node } from '@xyflow/react';
|
|
3
|
+
/**
|
|
4
|
+
* 将 DIP WorkflowDefinitionEntity 转换为 ReactFlow 画布数据
|
|
5
|
+
* 直接使用 DIP 端口名,无需适配层
|
|
6
|
+
*/
|
|
7
|
+
export declare function adaptDipFlowData(data: DipWorkflowDefinitionEntity): {
|
|
8
|
+
workflowId: string;
|
|
9
|
+
workflowName: string;
|
|
10
|
+
nodes: Node[];
|
|
11
|
+
edges: Edge[];
|
|
12
|
+
active: boolean;
|
|
13
|
+
};
|
|
@@ -7,7 +7,7 @@ export declare class FlowDesignerDAO {
|
|
|
7
7
|
getNodeIcon(node_id: string): any;
|
|
8
8
|
addNodeTips(seriesNo: number, tips: string): void;
|
|
9
9
|
getNodeTips(seriesNo: number): any;
|
|
10
|
-
|
|
10
|
+
getBuiltinVariableTips(variable: string): any;
|
|
11
11
|
getToolTipColor(seriesNo: number): "red" | "#2db7f5";
|
|
12
12
|
getConnectorIcon(connector_id?: string): string | null;
|
|
13
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Edge, Node } from '@xyflow/react';
|
|
2
1
|
import { EdgeData } from '../types/Edge';
|
|
3
2
|
import { NodeData } from '../types/Node';
|
|
3
|
+
import { Edge, Node } from '@xyflow/react';
|
|
4
|
+
import { CanvasLayoutSource, CanvasLayoutTarget } from '../enums/workflow';
|
|
4
5
|
export declare const GRID_SIZE = 20;
|
|
5
6
|
export declare const NODE_SIZE = 300;
|
|
6
7
|
export declare const NODE_X_SPACING: number;
|
|
@@ -27,8 +28,6 @@ export type CanvasLayoutResult = {
|
|
|
27
28
|
boundingBox: BoundingBox;
|
|
28
29
|
nodes: NodeLayoutResult[];
|
|
29
30
|
};
|
|
30
|
-
export type CanvasLayoutTarget = 'selection' | 'all';
|
|
31
|
-
export type CanvasLayoutSource = 'keyboard-shortcut' | 'canvas-button' | 'context-menu';
|
|
32
31
|
export type CanvasLayoutEvent = {
|
|
33
32
|
result: CanvasLayoutResult;
|
|
34
33
|
source: CanvasLayoutSource;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* mergeConfig - Deep merge helper for CanvasEngineConfig
|
|
3
|
-
* 支持深度合并、数组自定义合并策略、对象合并、函数覆盖
|
|
4
|
-
*/
|
|
1
|
+
import { DeepPartial } from '../types/engine';
|
|
5
2
|
type MergeArrayStrategy = 'append' | 'override' | 'mergeById';
|
|
6
3
|
/**
|
|
7
4
|
* merge options
|
|
@@ -13,10 +10,10 @@ export interface MergeConfigOptions {
|
|
|
13
10
|
/**
|
|
14
11
|
* Deep merge core function
|
|
15
12
|
*/
|
|
16
|
-
export declare function mergeDeep<T>(target:
|
|
13
|
+
export declare function mergeDeep<T>(target: T | DeepPartial<T>, source: DeepPartial<T>, options?: MergeConfigOptions): T;
|
|
17
14
|
/**
|
|
18
15
|
* 业务常用:合并 CanvasEngineConfig
|
|
19
16
|
* mergeConfig(defaultConfig, customConfig)
|
|
20
17
|
*/
|
|
21
|
-
export declare function mergeConfig<T>(base: T, override:
|
|
18
|
+
export declare function mergeConfig<T>(base: T, override: DeepPartial<T>, options?: MergeConfigOptions): T;
|
|
22
19
|
export default mergeConfig;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DipNodeSchema } from '../api/dip';
|
|
2
|
+
export declare function clearNextNodeSchemaCache(): void;
|
|
3
|
+
export declare function setCachedNextNodeSchema(nodeKey: string, nodeVersion: number | undefined, schema: DipNodeSchema): void;
|
|
4
|
+
export declare function setCachedClassicNextNodeSchema(nodeKey: string, nodeVersion: number | undefined, schema: DipNodeSchema): void;
|
|
5
|
+
export declare function getCachedClassicNextNodeSchema(nodeKey: string, nodeVersion?: number): Promise<DipNodeSchema | null>;
|
|
6
|
+
export declare function getCachedNextNodeSchema(nodeKey: string, nodeVersion?: number): Promise<DipNodeSchema | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|