@digitalsee-ai/rcs 2.0.0-beta12 → 2.0.0-beta14

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.
@@ -518,7 +518,7 @@ export interface DipPortSchema {
518
518
  /**
519
519
  * 端口在节点边框上的渲染位置,对齐 ReactFlow `Position` 枚举字符串值。
520
520
  *
521
- * 缺省时由前端 `ACTION_KEY_HANDLE_LAYOUT` 兜底,再缺省为 Left/Right。
521
+ * 缺省为 Left/Right;MCP Server 画布会再强制 Left→Top、Right→Bottom。
522
522
  * 仅影响视觉布局,不参与连线协议匹配。
523
523
  */
524
524
  position?: 'left' | 'top' | 'right' | 'bottom';
@@ -4,44 +4,42 @@ export interface NodeHandlePositions {
4
4
  sources: Position[];
5
5
  targets: Position[];
6
6
  }
7
- interface ActionKeyHandleLayout {
8
- source: Position;
9
- target: Position;
7
+ export interface NodeHandleLayoutOptions {
8
+ /** MCP Server 画布:强制 Left→Top、Right→Bottom。 */
9
+ isMcpServerCanvas?: boolean;
10
10
  }
11
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` 全量铺开后即可删除本表。
12
+ * MCP Server 画布端口位置映射:Left → Top,Right → Bottom;Top/Bottom 保持不变。
13
+ */
14
+ export declare function remapPositionForMcpCanvas(position: Position): Position;
15
+ /**
16
+ * 节点列表是否构成 MCP Server 画布(存在 MCP Server 触发节点)。
20
17
  */
21
- export declare const ACTION_KEY_HANDLE_LAYOUT: Record<string, ActionKeyHandleLayout>;
18
+ export declare function detectIsMcpServerCanvas(nodes: Array<Pick<Node, 'type' | 'data'>>): boolean;
22
19
  /**
23
20
  * 给定一个 ReactFlow 节点,返回它所有 source / target handle 的 `Position`。
24
21
  *
25
22
  * 数据源优先级:
26
- * 1. NodePackage 节点 → `DipPortSchema.position` > `ACTION_KEY_HANDLE_LAYOUT` > 缺省 Left/Right
23
+ * 1. NodePackage 节点 → `DipPortSchema.position` > 缺省 Left/Right
27
24
  * 2. 经典节点 → `nodeTypeRegistry` 中的 legacy handles
28
25
  * 3. 兜底:返回空数组
29
26
  *
30
- * 该函数只读、不发起网络请求;schema 缺失时按 schema 字段的 `position` → 映射表 → Left/Right 降级。
27
+ * 当 `isMcpServerCanvas` 为真时,再将 Left→Top、Right→Bottom。
28
+ * 该函数只读、不发起网络请求。
31
29
  */
32
- export declare function getNodeHandlePositions(node: Node): NodeHandlePositions;
30
+ export declare function getNodeHandlePositions(node: Node, options?: NodeHandleLayoutOptions): NodeHandlePositions;
33
31
  /**
34
32
  * 节点是否参与垂直布局(子节点在父节点下方 / 上方)。
35
33
  *
36
34
  * 判定:节点的 source 或 target handle 中任一处于 Top/Bottom 即视为垂直。
37
35
  */
38
- export declare function isVerticalLayoutNode(node: Node): boolean;
36
+ export declare function isVerticalLayoutNode(node: Node, options?: NodeHandleLayoutOptions): boolean;
39
37
  /**
40
38
  * 节点是否参与水平布局(子节点在父节点右侧 / 左侧)。
41
39
  *
42
40
  * 判定:节点的 source 或 target handle 中任一处于 Left/Right 即视为水平。
43
41
  */
44
- export declare function isHorizontalLayoutNode(node: Node): boolean;
42
+ export declare function isHorizontalLayoutNode(node: Node, options?: NodeHandleLayoutOptions): boolean;
45
43
  /**
46
44
  * 按边的 target handle 位置判定布局方向。
47
45
  *
@@ -50,12 +48,12 @@ export declare function isHorizontalLayoutNode(node: Node): boolean;
50
48
  * - target handle 在 Left/Right → 'horizontal'
51
49
  * - 缺省 → null(调用方自行决定 fallback)
52
50
  */
53
- export declare function getEdgeLayoutDirection(edge: Pick<Edge, 'source' | 'target' | 'sourceHandle' | 'targetHandle'>, sourceNode?: Node | null, targetNode?: Node | null): LayoutDirection | null;
51
+ export declare function getEdgeLayoutDirection(edge: Pick<Edge, 'source' | 'target' | 'sourceHandle' | 'targetHandle'>, sourceNode?: Node | null, targetNode?: Node | null, options?: NodeHandleLayoutOptions): LayoutDirection | null;
54
52
  /**
55
53
  * 取边 source handle 在节点边框上的 `Position`(供连线风格 / 区间重叠判定使用)。
56
54
  * 无 sourceHandle 时取第一个 source handle;找不到匹配时返回 undefined,调用方按水平处理。
57
55
  */
58
- export declare function getEdgeSourcePosition(edge: Pick<Edge, 'sourceHandle'>, sourceNode: Node): Position | undefined;
56
+ export declare function getEdgeSourcePosition(edge: Pick<Edge, 'sourceHandle'>, sourceNode: Node, options?: NodeHandleLayoutOptions): Position | undefined;
59
57
  /**
60
58
  * 节点是否拥有 Top 输入 handle,用于区分主流程节点与垂直子节点。
61
59
  *
@@ -63,21 +61,20 @@ export declare function getEdgeSourcePosition(edge: Pick<Edge, 'sourceHandle'>,
63
61
  * Top 入桩(典型 AI 子节点升级后通过 Bottom 入桩连接到父节点 ai_* 桩,但若
64
62
  * 仍保留 Top 形态即可识别为"子节点")。
65
63
  */
66
- export declare function hasTopInputHandle(node: Node): boolean;
64
+ export declare function hasTopInputHandle(node: Node, options?: NodeHandleLayoutOptions): boolean;
67
65
  /**
68
66
  * 节点是否拥有 Top source handle。
69
67
  *
70
68
  * 旧版 `calculateNodePosition` 用 `n.type !== AI_SUB_NODE` 过滤主流程节点;
71
69
  * 现在等价语义改为:节点 source 不在 Top(说明它不向上输出,不会作为垂直子节点)。
72
70
  */
73
- export declare function hasTopSourceHandle(node: Node): boolean;
71
+ export declare function hasTopSourceHandle(node: Node, options?: NodeHandleLayoutOptions): boolean;
74
72
  /**
75
73
  * 节点是否属于某个父节点的垂直子布局(向上发送 → 自己即 child)。
76
74
  */
77
- export declare function isVerticalLayoutChild(node: Node): boolean;
75
+ export declare function isVerticalLayoutChild(node: Node, options?: NodeHandleLayoutOptions): boolean;
78
76
  /**
79
77
  * 画布整体方向:按节点 source handle 的方向统计,少数服从多数。
80
- * 缺省(无法判定或平票)走水平。
78
+ * MCP Server 画布强制垂直;缺省(无法判定或平票)走水平。
81
79
  */
82
80
  export declare function inferCanvasDirection(nodes: Node[]): LayoutDirection;
83
- export {};
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
- import { D as T, V as L, e as V, i as P, t as l, f as R, d as O } from "./index-DHj4kcT2.mjs";
2
+ import { D as T, V as L, e as V, i as P, t as l, f as R, d as O } from "./index-DuFVkAxn.mjs";
3
3
  import { useEventEmitter as B, useReactive as W, useSize as H } from "ahooks";
4
4
  import { FormattedMessage as $ } from "react-intl";
5
5
  import { CloseCircleFilled as A, CheckCircleFilled as K } from "@ant-design/icons";
@@ -279,4 +279,4 @@ function $e(e) {
279
279
  export {
280
280
  $e as default
281
281
  };
282
- //# sourceMappingURL=index-rOPtHLZf.mjs.map
282
+ //# sourceMappingURL=index-DQFqVRaJ.mjs.map