@digitalsee-ai/rcs 2.0.4-alpha → 2.0.4-beta

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.
@@ -1,9 +1,11 @@
1
1
  import { EdgeType } from '../enums/edge';
2
2
  import { EdgeData } from '../types/Edge';
3
- import { Edge } from '@xyflow/react';
4
- interface EdgeCreationOptions {
3
+ import { Edge, Node } from '@xyflow/react';
4
+ export interface EdgeCreationOptions {
5
5
  sourceHandle?: string;
6
6
  targetHandle?: string;
7
+ sourceNode?: Node | null;
8
+ targetNode?: Node | null;
7
9
  data?: EdgeData;
8
10
  onAddNode?: (position: {
9
11
  x: number;
@@ -27,12 +29,12 @@ declare class EdgeFactory {
27
29
  static getEdgeComponent(type: EdgeType): import('react').FC<import('./BaseEdge').CustomEdgeProps>;
28
30
  /**
29
31
  * 创建一个连线实例
30
- * @param type 连线类型
32
+ * @param type 连线类型(若不提供或为 MAIN,则仅当 source/target 为 NodePackage 节点时取其 handle 对应类型,否则为 MAIN)
31
33
  * @param id 连线ID
32
34
  * @param source 源节点ID
33
35
  * @param target 目标节点ID
34
- * @param options 可选参数,包括sourceHandle, targetHandle, data和回调函数
36
+ * @param options 可选参数,包括sourceHandle, targetHandle, sourceNode, targetNode, data和回调函数
35
37
  */
36
- static createEdge(type: EdgeType | string, id: string, source: string, target: string, options?: EdgeCreationOptions): Edge;
38
+ static createEdge(type: EdgeType | string | undefined | null, id: string, source: string, target: string, options?: EdgeCreationOptions): Edge;
37
39
  }
38
40
  export default EdgeFactory;
@@ -23,6 +23,8 @@ export interface NodePortSchema extends Omit<DipPortSchema, 'protocol'> {
23
23
  style?: React.CSSProperties;
24
24
  /** isMain 覆盖;缺省 name === 'main' */
25
25
  isMain?: boolean;
26
+ /** 针对某种支持多种协议的情况 */
27
+ protocols?: string[];
26
28
  }
27
29
  /** (type, protocol) 维度的端口覆盖声明;省略一侧即继承 type 级默认。 */
28
30
  export interface NodePortsDeclaration {
@@ -303,11 +303,12 @@ export interface DipWorkflowDefinition {
303
303
  * | `DATETIME` | 日期时间 | DatePicker |
304
304
  * | `CODE` | 代码/JSON 文本 | 工作流代码编辑器 |
305
305
  * | `PROXY` | 代理网关 | 工作流代理网关选择器 |
306
+ * | `GLOBAL_VARIABLE_KEY` | 全局变量键 | 工作流全局变量选择器 |
306
307
  * | `OBJECT` | 嵌套对象 | 递归渲染子字段 |
307
308
  * | `ARRAY` / `DYNAMIC_ARRAY` | 数组/列表 | 动态增减表单项 |
308
309
  * | `KEYVALUE` | 键值对列表 | Key-Value 编辑器 |
309
310
  */
310
- export type DipFieldType = 'STRING' | 'TEXTAREA' | 'PASSWORD' | 'HIDDEN' | 'NUMBER' | 'BOOLEAN' | 'SELECT' | 'DATETIME' | 'CODE' | 'PROXY' | 'OBJECT' | 'ARRAY' | 'DYNAMIC_ARRAY' | 'KEYVALUE';
311
+ export type DipFieldType = 'STRING' | 'TEXTAREA' | 'PASSWORD' | 'HIDDEN' | 'NUMBER' | 'BOOLEAN' | 'SELECT' | 'DATETIME' | 'CODE' | 'PROXY' | 'GLOBAL_VARIABLE_KEY' | 'OBJECT' | 'ARRAY' | 'DYNAMIC_ARRAY' | 'KEYVALUE';
311
312
  /**
312
313
  * 数组元素类型
313
314
  *
@@ -168,7 +168,11 @@ export interface FlowOutputTreeRequest {
168
168
  edges?: any[];
169
169
  }
170
170
  export declare function apiGetFlowOutputTree(flowId: string, data: FlowOutputTreeRequest): Promise<any>;
171
- export declare function apiGetGlobalVariables(): Promise<any>;
171
+ export interface GlobalVariablesQuery {
172
+ /** 传 1 时仅返回允许流程更新的全局变量 */
173
+ allowFlowUpdate?: 0 | 1;
174
+ }
175
+ export declare function apiGetGlobalVariables(query?: GlobalVariablesQuery): Promise<any>;
172
176
  /**
173
177
  * Fetches the account model for a credential schema key.
174
178
  *
@@ -113,6 +113,7 @@ export declare enum NodeProtocol {
113
113
  AI_TEXT_SPLITTER = "AI_TEXTSPLITTER",
114
114
  AI_EMBEDDING = "AI_EMBEDDING",
115
115
  AI_TOOL = "AI_TOOL",
116
+ KNOWLEDGE = "KNOWLEDGE",
116
117
  MCP = "MCP",
117
118
  BUILTIN_MCP = "BUILTIN_MCP",
118
119
  MCP_SERVER = "MCP_SERVER"
@@ -85,4 +85,8 @@ export declare function base64ToString(base64Str: string): string;
85
85
  * ```
86
86
  */
87
87
  export declare function isValidBase64(str: string): boolean;
88
+ /**
89
+ * 模块级翻译函数:调用时动态读取全局 locale(由 DigitalseeWorkFlow 依据宿主传入的 locale 同步),
90
+ * 适用于工具函数、事件回调等非 React 上下文;渲染路径中的文案建议用 useIntl()/FormattedMessage(响应式)。
91
+ */
88
92
  export declare const t: import('../../../../locales').TranslateFn;
@@ -51,7 +51,7 @@ export declare function convertNodesToReactFlowFormat(backendNodes: BackendNode[
51
51
  /**
52
52
  * 将后端连接数据转换为前端可用的边数据
53
53
  */
54
- export declare function convertConnectionsToReactFlowEdges(connections: BackendConnection): Edge[];
54
+ export declare function convertConnectionsToReactFlowEdges(connections: BackendConnection, nodes?: Node[]): Edge[];
55
55
  /**
56
56
  * 将后端响应数据转换为前端工作流数据
57
57
  */
@@ -0,0 +1,3 @@
1
+ /** 全局变量键的数据源动作名,宿主 optionsLoader 需实现该 action */
2
+ export declare const GLOBAL_VARIABLE_KEY_ACTION = "globalVariables";
3
+ export declare const GlobalVariableKeyField: import('../../types/field-component').FieldComponentDefinition<import('../../types/form-schema').FieldDef>;
@@ -1,5 +1,6 @@
1
1
  export { AutoCompleteField } from './AutoCompleteField';
2
2
  export { ColorPickerField } from './ColorPickerField';
3
+ export { GlobalVariableKeyField, GLOBAL_VARIABLE_KEY_ACTION, } from './GlobalVariableKeyField';
3
4
  export { MentionsField } from './MentionsField';
4
5
  export { RateField } from './RateField';
5
6
  export { SliderField } from './SliderField';
@@ -65,6 +65,7 @@ export declare enum DynamicFormField {
65
65
  JSON = "JSON",// JSON 编辑器
66
66
  CODE = "CODE",// 工作流代码/JSON 编辑器(由宿主作用域注册)
67
67
  PROXY = "PROXY",// 工作流代理网关选择器(由宿主作用域注册)
68
+ GLOBAL_VARIABLE_KEY = "GLOBAL_VARIABLE_KEY",// 全局变量键选择器(选项由宿主 optionsLoader 提供)
68
69
  DIVIDER = "DIVIDER",// 分割线
69
70
  INFO_CARD = "INFO_CARD",// 展示卡片
70
71
  ARRAY = "ARRAY",// 简单数组
@@ -246,6 +247,12 @@ export type InfoCardField = BaseField & {
246
247
  closable?: boolean;
247
248
  showIcon?: boolean;
248
249
  };
250
+ /** 全局变量键字段定义 */
251
+ export type GlobalVariableKeyField = BaseField & {
252
+ type: DynamicFormField.GLOBAL_VARIABLE_KEY;
253
+ /** 静态兜底选项(宿主未提供 optionsLoader 时使用) */
254
+ options?: Option[];
255
+ };
249
256
  /** 数组字段定义 */
250
257
  export type ArrayField = BaseField & {
251
258
  type: DynamicFormField.ARRAY;
@@ -298,7 +305,7 @@ export type ArrayObjectField = BaseField & {
298
305
  }) => Record<string, unknown>;
299
306
  };
300
307
  /** 字段定义联合类型 */
301
- export type FieldDef = BaseField | TextareaField | SelectField | RadioField | CheckboxGroupField | DateField | DateRangeField | TimeField | TimeRangeField | NumberField | UploadField | SliderField | RateField | CascaderField | TreeSelectField | AutoCompleteField | SwitchField | InfoCardField | ArrayField | ObjectField | KeyValueField | ArrayObjectField;
308
+ export type FieldDef = BaseField | TextareaField | SelectField | RadioField | CheckboxGroupField | DateField | DateRangeField | TimeField | TimeRangeField | NumberField | UploadField | SliderField | RateField | CascaderField | TreeSelectField | AutoCompleteField | SwitchField | InfoCardField | GlobalVariableKeyField | ArrayField | ObjectField | KeyValueField | ArrayObjectField;
302
309
  /** 表单 Schema */
303
310
  export type FormSchema = {
304
311
  fields: FieldDef[];