@digitalsee-ai/rcs 2.0.4-beta4 → 2.0.4-beta5
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/dist/components/digitalsee/workflow/utils/connectionCheck.d.ts +5 -3
- package/dist/components/digitalsee/workflow/utils/nodePackageConnection.d.ts +6 -1
- package/dist/components/digitalsee/workflow/utils/portConnectionValidator.d.ts +22 -0
- package/dist/{index-BsmxiP3Z.mjs → index-CrQAjjAC.mjs} +9341 -9327
- package/dist/{index-Dn79lXZq.mjs → index-c0d003Wm.mjs} +2 -2
- package/dist/rcs.es.js +1 -1
- package/dist/rcs.umd.js +70 -70
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { PortNodeKeyAccessCode } from './portConnectionValidator';
|
|
1
2
|
import { Node } from '@xyflow/react';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* 统一连线检查的结果码,端口黑白名单部分复用 PortNodeKeyAccessCode。
|
|
4
5
|
*/
|
|
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 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' | PortNodeKeyAccessCode;
|
|
6
7
|
export interface ConnectionCheckResult {
|
|
7
8
|
valid: boolean;
|
|
8
9
|
code: ConnectionCheckCode;
|
|
@@ -22,7 +23,8 @@ export interface ConnectionCheckConnection {
|
|
|
22
23
|
* 范围(与手动拖线今天的实际行为一致,再叠自连规则门):
|
|
23
24
|
* 1. 节点存在性;
|
|
24
25
|
* 2. 协议一致性(大小写不敏感;双侧均无法解析协议时放行,保留旧 `?? ''` 行为);
|
|
25
|
-
* 3. 自连(source === target)必须命中节点声明的 auto_connect
|
|
26
|
+
* 3. 自连(source === target)必须命中节点声明的 auto_connect 规则;
|
|
27
|
+
* 4. NodePackage schema.input / schema.output 的 node key 黑白名单(放在最后验证)。
|
|
26
28
|
*
|
|
27
29
|
* workflowConnectionValidator 的重链(edgeRules / connectable / native 校验)
|
|
28
30
|
* 有意不在本检查内,仍由各自的既有入口负责。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DipNodeSchema } from '../api/dip';
|
|
2
|
-
import { PortConnectionEdge, PortConnectionValidationCode } from './portConnectionValidator';
|
|
2
|
+
import { NormalizedDipPortSchema, PortConnectionEdge, PortConnectionValidationCode } from './portConnectionValidator';
|
|
3
3
|
import { Node } from '@xyflow/react';
|
|
4
4
|
export type NodePackageConnectionCode = PortConnectionValidationCode | 'NOT_APPLICABLE' | 'SCHEMA_NOT_READY';
|
|
5
5
|
export interface NodePackageConnectionResult {
|
|
@@ -19,6 +19,11 @@ export interface ValidateNodePackageConnectionInput {
|
|
|
19
19
|
/** 同步解析已预加载的 NodePackage Schema。 */
|
|
20
20
|
export declare function resolveNodePackageSchema(node?: Node | null): DipNodeSchema | null;
|
|
21
21
|
export declare function isNodePackageConnectionNode(node?: Node | null): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 读取 NodePackage 节点 schema 指定方向的端口定义(schema.inputs / schema.outputs)。
|
|
24
|
+
* 非 NodePackage 节点、Schema 未预热或端口未声明时返回 null,视为无黑白名单约束。
|
|
25
|
+
*/
|
|
26
|
+
export declare function findNodePackagePort(node: Node | undefined, handle: string | null | undefined, side: 'inputs' | 'outputs'): NormalizedDipPortSchema | null;
|
|
22
27
|
/**
|
|
23
28
|
* 校验两个 NodePackage 节点之间的端口连接。
|
|
24
29
|
*
|
|
@@ -57,6 +57,28 @@ export interface PortConnectionValidationResult {
|
|
|
57
57
|
export declare const normalizePortSchema: (port: DipPortSchema) => NormalizedDipPortSchema;
|
|
58
58
|
/** 从 ReactFlow 节点 data 中解析用于黑白名单判断的 NodePackage schema key。 */
|
|
59
59
|
export declare const getPortConnectionNodeIdentity: (node?: PortConnectionNode | null) => string | null;
|
|
60
|
+
/** 端口 node key 黑白名单校验失败的返回码。 */
|
|
61
|
+
export type PortNodeKeyAccessCode = 'SOURCE_NODE_DENIED' | 'TARGET_NODE_DENIED' | 'SOURCE_NODE_NOT_ALLOWED' | 'TARGET_NODE_NOT_ALLOWED';
|
|
62
|
+
export interface PortNodeKeyAccessViolation {
|
|
63
|
+
code: PortNodeKeyAccessCode;
|
|
64
|
+
/** 中文兜底原因,便于 console 调试。 */
|
|
65
|
+
reason: string;
|
|
66
|
+
}
|
|
67
|
+
/** 黑白名单校验的单侧输入:本侧端口 Schema 约束匹配的是对端节点的身份。 */
|
|
68
|
+
export interface PortNodeKeyAccessSide {
|
|
69
|
+
port: NormalizedDipPortSchema | null;
|
|
70
|
+
identity: string | null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 按连接方向校验端口 node key 黑白名单(schema.input / schema.output):
|
|
74
|
+
* - 未配置(缺失或为空)不限制;
|
|
75
|
+
* - 黑名单命中即拒绝;
|
|
76
|
+
* - 白名单非空时,过滤完黑名单后必须命中白名单;
|
|
77
|
+
* - 不在黑名单且未配置白名单则允许。
|
|
78
|
+
*
|
|
79
|
+
* 双侧 port 均可为 null(该侧无 Schema 约束,仅跳过该侧规则);返回 null 表示放行。
|
|
80
|
+
*/
|
|
81
|
+
export declare const checkPortNodeKeyAccess: (source: PortNodeKeyAccessSide, target: PortNodeKeyAccessSide) => PortNodeKeyAccessViolation | null;
|
|
60
82
|
/**
|
|
61
83
|
* 按 NodePackage PortSchema 校验一条准备创建的连接。
|
|
62
84
|
*
|