@digitalsee-ai/rcs 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/components/digitalsee/workflow/Handles/customHandleConnectable.d.ts +9 -3
  2. package/dist/components/digitalsee/workflow/Nodes/AISubNode.d.ts +1 -1
  3. package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +2 -2
  4. package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +2 -2
  5. package/dist/components/digitalsee/workflow/enums/handle.d.ts +9 -0
  6. package/dist/components/digitalsee/workflow/utils/legacyAiHandles.d.ts +23 -0
  7. package/dist/components/digitalsee/workflow/utils/mcpCanvas.d.ts +7 -4
  8. package/dist/components/dynamic-form/components/ValueModeWrapper/ValueModeFieldScope.d.ts +17 -0
  9. package/dist/components/dynamic-form/components/ValueModeWrapper/ValueModePolicyContext.d.ts +26 -0
  10. package/dist/components/dynamic-form/components/ValueModeWrapper/ValueModeSwitch.d.ts +16 -0
  11. package/dist/components/dynamic-form/components/ValueModeWrapper/index.d.ts +6 -5
  12. package/dist/components/dynamic-form/components/ValueModeWrapper/valueModeConfig.d.ts +11 -0
  13. package/dist/components/dynamic-form/index.d.ts +1 -1
  14. package/dist/{index-B3ZrjegL.mjs → index-CRdKUD0G.mjs} +15046 -14853
  15. package/dist/index-CRdKUD0G.mjs.map +1 -0
  16. package/dist/{index-DgHUyAIK.mjs → index-rjDBrC08.mjs} +2 -2
  17. package/dist/{index-DgHUyAIK.mjs.map → index-rjDBrC08.mjs.map} +1 -1
  18. package/dist/rcs.css +1 -1
  19. package/dist/rcs.es.js +51 -46
  20. package/dist/rcs.umd.js +58 -58
  21. package/dist/rcs.umd.js.map +1 -1
  22. package/package.json +1 -1
  23. package/dist/index-B3ZrjegL.mjs.map +0 -1
@@ -2,6 +2,7 @@ import { NodeAddInfo } from '../types/NodeAddContext';
2
2
  import { Node } from '@xyflow/react';
3
3
  interface HandleExtenderVisibilityOptions {
4
4
  type: 'source' | 'target';
5
+ handleId?: string;
5
6
  isFull: boolean;
6
7
  connectionInProgress: boolean;
7
8
  canEdit: boolean;
@@ -9,8 +10,8 @@ interface HandleExtenderVisibilityOptions {
9
10
  /**
10
11
  * 判断连接桩是否展示快捷新增入口。
11
12
  *
12
- * 画布连线始终由 output/source 发起,input/target 只接收连线,
13
- * 因此快捷新增入口只允许展示在输出桩。连接数达到上限时隐藏入口。
13
+ * 默认仅输出桩展示;旧版 AI 孤独入桩(ai_model/ai_memory/ai_tool)虽是 target
14
+ * 仍需要半线入口以便按 target_id/target_handle 查询可连接节点。
14
15
  */
15
16
  export declare function shouldShowHandleExtender(options: HandleExtenderVisibilityOptions): boolean;
16
17
  /** output 只能发起连线,input 只能接收连线;空间布局不改变端口语义。 */
@@ -30,6 +31,11 @@ interface BuildHandleNodeAddInfoOptions {
30
31
  anchorNode?: Node;
31
32
  refresh: boolean;
32
33
  }
33
- /** 构造连接桩快捷新增上下文,避免输入桩误带 source/protocol 语义。 */
34
+ /**
35
+ * 构造连接桩快捷新增上下文。
36
+ *
37
+ * AI 孤独入桩走 target 半组(不带 protocol),以便 connectable 接口使用
38
+ * target_id/target_handle;其余 source 桩保留 protocol 专项入口语义。
39
+ */
34
40
  export declare function buildHandleNodeAddInfo(options: BuildHandleNodeAddInfoOptions): NodeAddInfo;
35
41
  export {};
@@ -1,7 +1,7 @@
1
1
  import { NodeProps } from '@xyflow/react';
2
2
  import { default as React } from 'react';
3
3
  /**
4
- * @description AI 子节点,渲染垂直布局下的 300×72px 卡片样式。
4
+ * @description AI 子节点,顶部 SOURCE 连入父节点的 ai_* 孤独入桩。
5
5
  * @param {NodeProps} props React Flow 传入的节点参数。
6
6
  * @returns {JSX.Element} 渲染后的节点。
7
7
  */
@@ -1,8 +1,8 @@
1
+ import { NodeData } from '../types/Node';
1
2
  import { Node, NodeProps } from '@xyflow/react';
2
3
  import { default as React } from 'react';
3
- import { NodeData } from '../types/Node';
4
4
  /**
5
- * @description Agent 节点,包含底部三个菱形子插槽与主输出。
5
+ * @description Agent 节点,包含底部三个孤独 AI 入桩与主输出。
6
6
  * @param {NodeProps<NodeData>} props React Flow 代理节点参数。
7
7
  * @returns {JSX.Element} 渲染后的 Agent 节点。
8
8
  */
@@ -1,8 +1,8 @@
1
+ import { NodeData } from '../types/Node';
1
2
  import { Node, NodeProps } from '@xyflow/react';
2
3
  import { default as React } from 'react';
3
- import { NodeData } from '../types/Node';
4
4
  /**
5
- * @description 浏览器节点,提供模型接入与右侧主输出的卡片布局。
5
+ * @description 浏览器节点,提供底部模型孤独入桩与右侧主输出。
6
6
  * @param {NodeProps<NodeData>} props React Flow 浏览器节点参数。
7
7
  * @returns {JSX.Element} 渲染后的浏览器节点。
8
8
  */
@@ -14,13 +14,22 @@ export declare enum HandleType {
14
14
  export declare enum HandleConnectionType {
15
15
  INPUT = "input",
16
16
  OUTPUT = "output",
17
+ /** @deprecated 旧版 Agent/Browser SOURCE 半线,加载时升级为 AI_MODEL */
17
18
  CHAT_MODEL = "chat_model",
18
19
  DONE = "done",
19
20
  LOOP = "loop",
20
21
  FALSE = "false",
21
22
  TRUE = "true",
23
+ /** @deprecated 旧版 Agent SOURCE 半线,加载时升级为 AI_MEMORY */
22
24
  MEMORY = "memory",
25
+ /** @deprecated 旧版 Agent SOURCE 半线,加载时升级为 AI_TOOL */
23
26
  TOOLS = "tools",
27
+ /** 高级 AI / 浏览器节点底部模型入桩(孤独 target) */
28
+ AI_MODEL = "ai_model",
29
+ /** 高级 AI 节点底部记忆入桩(孤独 target) */
30
+ AI_MEMORY = "ai_memory",
31
+ /** 高级 AI 节点底部工具入桩(孤独 target) */
32
+ AI_TOOL = "ai_tool",
24
33
  BUILTIN_MCP = "builtin_mcp"
25
34
  }
26
35
  /**
@@ -0,0 +1,23 @@
1
+ import { HandleConnectionType } from '../types/Handle';
2
+ import { NodeProtocol } from '../types/NodeProtocol';
3
+ import { Edge, Node } from '@xyflow/react';
4
+ /** 旧版高级 AI / 浏览器节点底部孤独入桩(connectable 查询用 target_handle)。 */
5
+ export declare const LEGACY_AI_LONELY_TARGET_HANDLES: readonly [HandleConnectionType.AI_MODEL, HandleConnectionType.AI_MEMORY, HandleConnectionType.AI_TOOL];
6
+ export type LegacyAiLonelyTargetHandle = (typeof LEGACY_AI_LONELY_TARGET_HANDLES)[number];
7
+ export declare function isLegacyAiLonelyTargetHandle(handleId?: string | null): handleId is LegacyAiLonelyTargetHandle;
8
+ /** 将历史 chat_model/memory/tools(及已是 ai_*)映射为固定 target_handle。 */
9
+ export declare function resolveLegacyAiLonelyTargetHandle(handleId?: string | null): LegacyAiLonelyTargetHandle | undefined;
10
+ export declare function getProtocolForLegacyAiLonelyTargetHandle(handleId?: string | null): NodeProtocol | undefined;
11
+ /**
12
+ * 校验 AI 子节点连入 Agent/Browser 孤独入桩:
13
+ * 由 AI 子节点 SOURCE 发起,Agent/Browser 的 ai_* TARGET 接收。
14
+ */
15
+ export declare function isValidLegacyAiLonelyConnection(options: {
16
+ sourceProtocol?: NodeProtocol | string | null;
17
+ targetHandle?: string | null;
18
+ }): boolean;
19
+ /**
20
+ * 将历史「Agent SOURCE(chat_model) → AISub TARGET(input)」边升级为
21
+ * 「AISub SOURCE(output) → Agent TARGET(ai_model)」。
22
+ */
23
+ export declare function upgradeLegacyAiCanvasEdges<T extends Pick<Edge, 'source' | 'target' | 'sourceHandle' | 'targetHandle'>>(nodes: Array<Pick<Node, 'id' | 'type'>>, edges: T[]): T[];
@@ -34,11 +34,14 @@ export declare const resolveMcpCanvasTargetHandle: (_nodes: McpNodeIdentity[], f
34
34
  /** 保存前不得把 Schema 端口改写成视觉方向名称。 */
35
35
  export declare const normalizeMcpCanvasEdge: <T extends Pick<Edge, "targetHandle">>(_nodes: McpNodeIdentity[], edge: T) => T;
36
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'>>;
37
40
  /**
38
- * 升级旧版 MCP 画布的虚拟方向端口。
41
+ * 升级旧版 MCP 画布的虚拟方向 targetHandle。
39
42
  *
40
- * 旧实现会在 MCP Server 画布中把 output/top builtin_mcp/top 当作真实端口保存;
41
- * 新版必须恢复为 NodeSchema main/main,下一次保存时写回正确数据。
43
+ * 旧实现会把 MCP Server 画布上所有边的 targetHandle 写成 `top`。
44
+ * MCP 网关相关节点 Schema 仍声明 top,需保留;经典 Action 等节点入桩是 input,需改回。
42
45
  */
43
- export declare const upgradeLegacyMcpCanvasEdges: <T extends Pick<Edge, "sourceHandle" | "targetHandle">>(nodes: McpNodeIdentity[], edges: T[]) => T[];
46
+ export declare const upgradeLegacyMcpCanvasEdges: <T extends Pick<Edge, "source" | "target" | "sourceHandle" | "targetHandle">>(nodes: McpCanvasEdgeNode[], edges: T[]) => T[];
44
47
  export {};
@@ -0,0 +1,17 @@
1
+ import { FieldDef, ValueModePolicy } from '../../types/form-schema';
2
+ import type * as React from 'react';
3
+ /**
4
+ * 将父级 valueModePolicy 注入到子字段;父级未配置时保留子字段自身策略。
5
+ */
6
+ export declare function withInheritedValueModePolicy<T extends FieldDef>(child: T, parentPolicy?: ValueModePolicy): T;
7
+ type ValueModeFieldScopeProps = {
8
+ policy?: ValueModePolicy;
9
+ disabled?: boolean;
10
+ readOnly?: boolean;
11
+ children: React.ReactNode;
12
+ };
13
+ /**
14
+ * 复杂字段第一层值模式作用域:渲染顶层切换器,抑制子级递归切换器。
15
+ */
16
+ export declare const ValueModeFieldScope: React.FC<ValueModeFieldScopeProps>;
17
+ export {};
@@ -0,0 +1,26 @@
1
+ import { ValueModePolicy } from '../../types/form-schema';
2
+ /** 与 ValueModeWrapper 保持一致的值模式 */
3
+ export type ValueModePolicyScopeMode = 'normal' | 'expression' | 'code';
4
+ /**
5
+ * 父级表单项的值模式作用域。
6
+ * 复杂字段(KEY_VALUE / OBJECT / ARRAY 等)在第一层挂载后,
7
+ * 子输入只消费 mode/policy,不再各自渲染右上角切换器。
8
+ */
9
+ export type ValueModePolicyContextValue = {
10
+ policy: ValueModePolicy;
11
+ mode: ValueModePolicyScopeMode;
12
+ onModeChange: (mode: ValueModePolicyScopeMode) => void;
13
+ /** 子级 ValueModeWrapper 隐藏模式切换器 */
14
+ suppressNestedSwitch: true;
15
+ };
16
+ export declare function useValueModePolicyOptional(): ValueModePolicyContextValue | null;
17
+ export type ValueModePolicyScopeProps = {
18
+ policy: ValueModePolicy;
19
+ mode: ValueModePolicyScopeMode;
20
+ onModeChange: (mode: ValueModePolicyScopeMode) => void;
21
+ children: React.ReactNode;
22
+ };
23
+ /**
24
+ * 在表单项第一层建立值模式作用域,向下传递 mode,抑制子级切换器。
25
+ */
26
+ export declare const ValueModePolicyScope: React.FC<ValueModePolicyScopeProps>;
@@ -0,0 +1,16 @@
1
+ import { ValueMode } from './valueModeConfig';
2
+ import { ValueModePolicy } from '../../types/form-schema';
3
+ import type * as React from 'react';
4
+ export type ValueModeSwitchProps = {
5
+ valueModePolicy: ValueModePolicy;
6
+ mode: ValueMode;
7
+ onModeChange?: (mode: ValueMode) => void;
8
+ disabled?: boolean;
9
+ readOnly?: boolean;
10
+ modeSwitchPosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
11
+ };
12
+ /**
13
+ * 右上角模式指示/切换器。
14
+ * BOTH 可切换;TEXT / EXPRESSION 渲染单个选中态选项,便于肉眼识别当前输入模式。
15
+ */
16
+ export declare const ValueModeSwitch: React.FC<ValueModeSwitchProps>;
@@ -1,10 +1,11 @@
1
+ import { ValueMode } from './valueModeConfig';
1
2
  import { ValueModePolicy } from '../../types/form-schema';
2
3
  import * as React from 'react';
3
- export type ValueMode = 'normal' | 'expression' | 'code';
4
- export declare function getValueModePolicyConfig(policy: ValueModePolicy): {
5
- availableModes: ValueMode[];
6
- defaultMode: ValueMode;
7
- };
4
+ export { ValueModeFieldScope, withInheritedValueModePolicy, } from './ValueModeFieldScope';
5
+ export { useValueModePolicyOptional, type ValueModePolicyContextValue, ValueModePolicyScope, type ValueModePolicyScopeProps, } from './ValueModePolicyContext';
6
+ export { ValueModeSwitch, type ValueModeSwitchProps, } from './ValueModeSwitch';
7
+ export type { ValueMode } from './valueModeConfig';
8
+ export { getValueModePolicyConfig } from './valueModeConfig';
8
9
  export declare function isEncodedExpressionValue(value: unknown): value is string;
9
10
  /**
10
11
  * 将节点配置中的历史值统一转换为输入组件可消费的字符串。
@@ -0,0 +1,11 @@
1
+ import { ValueModePolicy } from '../../types/form-schema';
2
+ export type ValueMode = 'normal' | 'expression' | 'code';
3
+ export declare const DEFAULT_AVAILABLE_MODES: ValueMode[];
4
+ export declare const VALUE_MODE_POLICY_CONFIG: Record<ValueModePolicy, {
5
+ availableModes: ValueMode[];
6
+ defaultMode: ValueMode;
7
+ }>;
8
+ export declare function getValueModePolicyConfig(policy: ValueModePolicy): {
9
+ availableModes: ValueMode[];
10
+ defaultMode: ValueMode;
11
+ };
@@ -1,7 +1,7 @@
1
1
  export * from './AntdProvider';
2
2
  export { AI_FILL_VALUE, AIFieldWrapper, type AIFieldWrapperProps, } from './components/AIFieldWrapper';
3
3
  export { type SelectValueMode, SelectWithExpression, type SelectWithExpressionProps, } from './components/SelectWithExpression';
4
- export { type ValueMode, ValueModeWrapper, type ValueModeWrapperProps, } from './components/ValueModeWrapper';
4
+ export { useValueModePolicyOptional, type ValueMode, ValueModeFieldScope, ValueModePolicyScope, ValueModeSwitch, type ValueModeSwitchProps, ValueModeWrapper, type ValueModeWrapperProps, withInheritedValueModePolicy, } from './components/ValueModeWrapper';
5
5
  export { VariableInput, type VariableInputProps, } from './components/VariableInput';
6
6
  export { VariableTextarea, type VariableTextareaProps, } from './components/VariableTextarea';
7
7
  export { useRegisterVariableField, useVariableSelector, useVariableSelectorOptional, type VariableInfo, type VariableSelectorContextValue, VariableSelectorProvider, type VariableSelectorProviderProps, } from './context/VariableSelectorContext';