@huanban/rulego-editor-core 1.4.1 → 2.0.0

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 (157) hide show
  1. package/README.md +20 -8
  2. package/dist/ai/ai-chat-options.d.ts +12 -0
  3. package/dist/api/AIAssistantAPI.d.ts +29 -0
  4. package/dist/api/AIManager.d.ts +7 -1
  5. package/dist/api/ApiProvider.d.ts +17 -4
  6. package/dist/api/DebugSocketClient.d.ts +2 -0
  7. package/dist/api/GlobalConfigAPI.d.ts +35 -0
  8. package/dist/api/IoTPointTemplateAPI.d.ts +32 -0
  9. package/dist/api/MarketplaceAPI.d.ts +39 -0
  10. package/dist/api/RuleChainAPI.d.ts +23 -4
  11. package/dist/api/RuleChainVersionsAPI.d.ts +28 -0
  12. package/dist/api/SkillsAPI.d.ts +31 -0
  13. package/dist/api/UserAPI.d.ts +39 -0
  14. package/dist/api/extended-api-shared.d.ts +25 -0
  15. package/dist/api/index.d.ts +19 -2
  16. package/dist/api/public-api.test-d.d.ts +87 -0
  17. package/dist/api/response-utils.d.ts +1 -0
  18. package/dist/api/types.d.ts +86 -14
  19. package/dist/chunks/editor-core-api-BQiYFuIO.js +1157 -0
  20. package/dist/chunks/editor-core-canvas-nodes-BE9eN51s.js +6921 -0
  21. package/dist/chunks/editor-core-code-editor-DFm5Owtv.js +660 -0
  22. package/dist/chunks/{editor-core-default-components-BjF65lar.js → editor-core-default-components-BsNP8ma1.js} +98 -98
  23. package/dist/chunks/editor-core-dialogs-D9YHvzys.js +12009 -0
  24. package/dist/chunks/{editor-core-locales-i6o28vm2.js → editor-core-locales-CsqTh7Wh.js} +1723 -11
  25. package/dist/chunks/{editor-core-node-patches-BJTT3TuX.js → editor-core-node-patches-Dbi8XYxu.js} +633 -184
  26. package/dist/chunks/{editor-core-node-views-BOaPVdmN.js → editor-core-node-views-C8FQYC3E.js} +39 -29
  27. package/dist/chunks/editor-core-property-drawers-Bqmp9B_J.js +9562 -0
  28. package/dist/chunks/editor-core-settings-DcGCJSc7.js +4161 -0
  29. package/dist/chunks/editor-core-standalone-C7pzm8ZB.js +10013 -0
  30. package/dist/chunks/{editor-core-styles-C1TbLgCK.js → editor-core-styles-CwjFPfAo.js} +1203 -507
  31. package/dist/chunks/vendor-highlight-acC2fLd8.js +5868 -0
  32. package/dist/chunks/vendor-logicflow-core-runtime-DpsWXOGl.js +4 -0
  33. package/dist/chunks/vendor-logicflow-shared-C_kIdBKO.js +4 -0
  34. package/dist/core/ActionRegistry.d.ts +4 -2
  35. package/dist/core/DataAdapter.d.ts +17 -1
  36. package/dist/core/DialogProvider.d.ts +33 -0
  37. package/dist/core/EditorCore.d.ts +16 -3
  38. package/dist/core/FieldCapabilityRegistry.d.ts +4 -1
  39. package/dist/core/FieldChangeRegistry.d.ts +3 -1
  40. package/dist/core/I18nManager.d.ts +1 -1
  41. package/dist/core/IdentityProvider.d.ts +32 -0
  42. package/dist/core/OptionSourceRegistry.d.ts +4 -1
  43. package/dist/core/PropertyControlRegistry.d.ts +29 -0
  44. package/dist/core/ThemeManager.d.ts +7 -0
  45. package/dist/core/anchored-popover.d.ts +16 -0
  46. package/dist/core/assistant-dsl.d.ts +18 -0
  47. package/dist/core/business-log-config.d.ts +18 -0
  48. package/dist/core/clean-snapshot.d.ts +14 -0
  49. package/dist/core/component-localization.d.ts +17 -0
  50. package/dist/core/component-palette.d.ts +3 -0
  51. package/dist/core/connection-status.d.ts +11 -0
  52. package/dist/core/dialog-styles.d.ts +1 -0
  53. package/dist/core/editor-capabilities.d.ts +82 -1
  54. package/dist/core/editor-edge-anchors.d.ts +16 -0
  55. package/dist/core/endpoint-protocol.d.ts +15 -0
  56. package/dist/core/expression-preview.d.ts +6 -0
  57. package/dist/core/field-protocol.d.ts +19 -4
  58. package/dist/core/global-config.d.ts +47 -0
  59. package/dist/core/global-search.d.ts +31 -0
  60. package/dist/core/group-protocol.d.ts +56 -0
  61. package/dist/core/identity-provider-default.d.ts +32 -0
  62. package/dist/core/index.d.ts +31 -5
  63. package/dist/core/keymap.d.ts +10 -0
  64. package/dist/core/payload-kv.d.ts +7 -0
  65. package/dist/core/rule-chain-versions.d.ts +143 -0
  66. package/dist/core/run-analysis.d.ts +126 -0
  67. package/dist/core/runtime-field-dictionary.d.ts +3 -0
  68. package/dist/core/save-conflict.d.ts +1 -0
  69. package/dist/core/server-status.d.ts +1 -0
  70. package/dist/core/toolbar-icons.d.ts +1 -1
  71. package/dist/core/variable-completion.d.ts +13 -0
  72. package/dist/core/websocket-auth.d.ts +2 -0
  73. package/dist/defaults/analysis-locales.d.ts +241 -0
  74. package/dist/defaults/component-locale-categories.d.ts +14 -0
  75. package/dist/defaults/component-locale-data.d.ts +4 -0
  76. package/dist/defaults/component-locale-en-US.d.ts +10 -0
  77. package/dist/defaults/component-locale-summaries.d.ts +15 -0
  78. package/dist/defaults/component-locale-zh-CN.d.ts +10 -0
  79. package/dist/defaults/editor-shell-locales.d.ts +290 -0
  80. package/dist/defaults/example-chain.d.ts +2 -0
  81. package/dist/defaults/field-interaction-locales.d.ts +19 -0
  82. package/dist/defaults/global-config-locales.d.ts +166 -0
  83. package/dist/defaults/official-component-fallbacks.d.ts +2 -1
  84. package/dist/defaults/point-template-locales.d.ts +64 -0
  85. package/dist/index.cjs +2897 -2115
  86. package/dist/index.d.ts +33 -10
  87. package/dist/index.esm.js +1184 -809
  88. package/dist/index.umd.js +2874 -2092
  89. package/dist/nodes/UnknownNodeModel.d.ts +12 -1
  90. package/dist/standalone/HuanbanRulegoEditor.d.ts +145 -13
  91. package/dist/standalone/auth-fetch.d.ts +1 -0
  92. package/dist/standalone/auth-ui-defaults.d.ts +15 -0
  93. package/dist/standalone/code-editor.d.ts +7 -5
  94. package/dist/standalone/connection-status-binding.d.ts +3 -2
  95. package/dist/standalone/custom-nodes.d.ts +13 -0
  96. package/dist/standalone/drawer-locale.d.ts +12 -0
  97. package/dist/standalone/drawer-unsaved-guard.d.ts +6 -1
  98. package/dist/standalone/dynamic-field-browse.d.ts +25 -0
  99. package/dist/standalone/edge-label-quick-editor.d.ts +2 -1
  100. package/dist/standalone/editor-actions.d.ts +1 -0
  101. package/dist/standalone/editor-canvas-anchors.d.ts +19 -0
  102. package/dist/standalone/editor-canvas-shortcuts.d.ts +1 -0
  103. package/dist/standalone/editor-chain-info.d.ts +1 -0
  104. package/dist/standalone/editor-debug-data.d.ts +18 -0
  105. package/dist/standalone/editor-debug-ws.d.ts +2 -0
  106. package/dist/standalone/editor-delete.d.ts +5 -3
  107. package/dist/standalone/editor-dialog-provider.d.ts +3 -0
  108. package/dist/standalone/editor-dialogs.d.ts +25 -2
  109. package/dist/standalone/editor-global-config.d.ts +44 -0
  110. package/dist/standalone/editor-group-interactions.d.ts +1 -0
  111. package/dist/standalone/editor-host-region-styles.d.ts +1 -0
  112. package/dist/standalone/editor-host-regions.d.ts +53 -0
  113. package/dist/standalone/editor-login.d.ts +15 -0
  114. package/dist/standalone/editor-overlays.d.ts +5 -0
  115. package/dist/standalone/editor-property-drawers.d.ts +3 -1
  116. package/dist/standalone/editor-run-analysis.d.ts +81 -0
  117. package/dist/standalone/editor-run-compare.d.ts +20 -0
  118. package/dist/standalone/editor-run-waterfall.d.ts +11 -0
  119. package/dist/standalone/editor-toast.d.ts +1 -1
  120. package/dist/standalone/editor-toolbar-presentation.d.ts +12 -0
  121. package/dist/standalone/editor-toolbar.d.ts +5 -1
  122. package/dist/standalone/editor-ui-configuration.d.ts +55 -0
  123. package/dist/standalone/editor-ui-settings.d.ts +26 -0
  124. package/dist/standalone/editor-user-menu.d.ts +8 -0
  125. package/dist/standalone/editor-version-history.d.ts +82 -0
  126. package/dist/standalone/editor-workspace-shell.d.ts +47 -0
  127. package/dist/standalone/editor-workspace-styles.d.ts +1 -0
  128. package/dist/standalone/field-expression-preview.d.ts +12 -0
  129. package/dist/standalone/group-node.d.ts +19 -3
  130. package/dist/standalone/icon-utils.d.ts +7 -0
  131. package/dist/standalone/index.d.ts +17 -5
  132. package/dist/standalone/keyboard-events.d.ts +3 -0
  133. package/dist/standalone/multi-select-popover.d.ts +16 -0
  134. package/dist/standalone/node-copy.d.ts +1 -0
  135. package/dist/standalone/node-definitions.d.ts +4 -0
  136. package/dist/standalone/node-renderer-utils.d.ts +21 -0
  137. package/dist/standalone/node-theme.d.ts +2 -1
  138. package/dist/standalone/point-template-actions.d.ts +43 -0
  139. package/dist/standalone/property-field-draft.d.ts +5 -0
  140. package/dist/standalone/question-list-editor.d.ts +35 -0
  141. package/dist/standalone/shared-node-manager.d.ts +14 -0
  142. package/dist/standalone/single-select-popover.d.ts +6 -0
  143. package/dist/standalone/theme-scope.d.ts +15 -0
  144. package/dist/standalone/themes.d.ts +8 -0
  145. package/dist/standalone/variable-completion-dropdown.d.ts +18 -0
  146. package/dist/types/component.d.ts +24 -1
  147. package/dist/types/editor.d.ts +41 -0
  148. package/dist/utils/relation-utils.d.ts +19 -1
  149. package/dist/version.d.ts +2 -2
  150. package/package.json +3 -3
  151. package/vite-chunks.mjs +66 -0
  152. package/dist/chunks/editor-core-code-editor-CRki2wA_.js +0 -512
  153. package/dist/chunks/editor-core-dialogs-BMWb0WRN.js +0 -17228
  154. package/dist/chunks/editor-core-property-drawers-BPh-jj1b.js +0 -7998
  155. package/dist/chunks/editor-core-standalone-CJDytHO9.js +0 -11269
  156. package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +0 -217
  157. package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +0 -4
@@ -1,11 +1,11 @@
1
- import { O as i } from "./editor-core-node-patches-BJTT3TuX.js";
1
+ import { O as r } from "./editor-core-node-patches-Dbi8XYxu.js";
2
2
  const e = (l = []) => ({
3
3
  type: "select",
4
4
  filterable: !0,
5
5
  allowCreate: !0,
6
6
  multiple: !1,
7
7
  ...l.length ? { options: l } : {}
8
- }), d = (l = []) => ({
8
+ }), t = (l = []) => ({
9
9
  type: "select",
10
10
  filterable: !0,
11
11
  allowCreate: !1,
@@ -15,19 +15,19 @@ const e = (l = []) => ({
15
15
  function b(l) {
16
16
  return !!l && typeof l == "object" && !Array.isArray(l);
17
17
  }
18
- function o(l, t) {
18
+ function i(l, c) {
19
19
  const a = { ...l };
20
- for (const [s, c] of Object.entries(t || {}))
21
- b(a[s]) && b(c) ? a[s] = o(a[s], c) : a[s] = c;
20
+ for (const [s, d] of Object.entries(c || {}))
21
+ b(a[s]) && b(d) ? a[s] = i(a[s], d) : a[s] = d;
22
22
  return a;
23
23
  }
24
- function r(l, t) {
24
+ function n(l, c) {
25
25
  const a = { ...l };
26
- for (const [s, c] of Object.entries(t || {}))
27
- a[s] = o(a[s] || {}, c);
26
+ for (const [s, d] of Object.entries(c || {}))
27
+ a[s] = i(a[s] || {}, d);
28
28
  return a;
29
29
  }
30
- const n = {
30
+ const m = {
31
31
  delay: {
32
32
  label: "延迟",
33
33
  icon: "images/delay.svg",
@@ -65,7 +65,7 @@ const n = {
65
65
  desc: "打印日志",
66
66
  jsScript: { label: "function String(msg, metadata, msgType) {", desc: "}" }
67
67
  }
68
- }, m = {
68
+ }, p = {
69
69
  break: { label: "中断", icon: "images/break.svg", desc: "中断当前流程" },
70
70
  comment: { label: "注释", icon: "images/comment.svg", desc: "添加注释说明" },
71
71
  end: { label: "结束", icon: "images/end.svg", desc: "结束当前流程" },
@@ -126,7 +126,7 @@ const n = {
126
126
  icon: "images/while.svg",
127
127
  desc: "While循环",
128
128
  condition: { label: "循环条件", desc: "例如: msg.count==nil || msg.count< 5", component: { type: "expr" } },
129
- do: { label: "处理节点", desc: "处理链的起始节点", component: d() },
129
+ do: { label: "处理节点", desc: "处理链的起始节点", component: t() },
130
130
  mode: { label: "执行模式", component: e([
131
131
  { label: "同步不合并执行结果", value: 0 },
132
132
  { label: "同步合并执行结果", value: 1 },
@@ -141,7 +141,7 @@ const n = {
141
141
  fieldName: { label: "字段名", desc: "" },
142
142
  jsScript: { label: "迭代脚本", desc: "" }
143
143
  }
144
- }, p = {
144
+ }, g = {
145
145
  exprFilter: {
146
146
  label: "表达式过滤",
147
147
  icon: "images/exprFilter.svg",
@@ -178,7 +178,7 @@ const n = {
178
178
  desc: "使用Lua脚本过滤消息",
179
179
  script: { label: "Lua脚本", desc: "" }
180
180
  }
181
- }, g = {
181
+ }, u = {
182
182
  exprTransform: {
183
183
  label: "表达式转换",
184
184
  icon: "images/exprTransform.svg",
@@ -209,7 +209,7 @@ const n = {
209
209
  desc: "使用Lua脚本转换消息",
210
210
  script: { label: "Lua脚本", desc: "" }
211
211
  }
212
- }, u = {
212
+ }, v = {
213
213
  cacheDelete: {
214
214
  label: "缓存删除",
215
215
  icon: "images/cacheDelete.svg",
@@ -549,7 +549,7 @@ const n = {
549
549
  kickBound: { label: "唤醒的Job数量上限", desc: "" },
550
550
  pauseTime: { label: "暂停时间", desc: "" }
551
551
  }
552
- }, v = {
552
+ }, y = {
553
553
  flow: {
554
554
  label: "子规则链",
555
555
  targetId: { label: "子规则链ID", desc: "" },
@@ -612,7 +612,7 @@ const n = {
612
612
  url: { label: "请求地址", desc: "" },
613
613
  action: { label: "SOAP Action", desc: "" }
614
614
  }
615
- }, y = {
615
+ }, T = {
616
616
  "ai/llm": {
617
617
  label: "AI文本生成",
618
618
  icon: "images/aiLlm.svg",
@@ -629,7 +629,7 @@ const n = {
629
629
  ]) },
630
630
  systemPrompt: { label: "系统提示", desc: "用于预先定义模型的基础行为框架和响应风格。可以使用${} 占位符变量", component: { type: "textarea" } },
631
631
  messages: { label: "上下文/用户消息列表", desc: "", component: { type: "table", options: [
632
- { name: "role", label: "角色", type: "string", component: d([{ label: "USER", value: "user" }, { label: "ASSISTANT", value: "assistant" }]) },
632
+ { name: "role", label: "角色", type: "string", component: t([{ label: "USER", value: "user" }, { label: "ASSISTANT", value: "assistant" }]) },
633
633
  { name: "content", label: "消息内容", type: "string", component: { type: "textarea" } }
634
634
  ] } },
635
635
  images: { label: "图片列表", desc: "" },
@@ -667,7 +667,7 @@ const n = {
667
667
  ]) },
668
668
  systemPrompt: { label: "系统提示", desc: "用于预先定义模型的基础行为框架和响应风格。可以使用${} 占位符变量", component: { type: "textarea" } },
669
669
  messages: { label: "内置消息列表", desc: "输入消息没有 messages 字段时自动使用。", component: { type: "table", options: [
670
- { name: "role", label: "角色", type: "string", component: d([{ label: "USER", value: "user" }, { label: "ASSISTANT", value: "assistant" }]) },
670
+ { name: "role", label: "角色", type: "string", component: t([{ label: "USER", value: "user" }, { label: "ASSISTANT", value: "assistant" }]) },
671
671
  { name: "content", label: "消息内容", type: "string", component: { type: "textarea" } }
672
672
  ] } },
673
673
  images: { label: "图片列表", desc: "多模态模型输入图片列表" },
@@ -751,7 +751,7 @@ const n = {
751
751
  "ai/indexer/redis": { label: "Redis索引", icon: "images/redis.svg", desc: "写入 Redis 向量索引。" },
752
752
  "ai/retriever/milvus": { label: "Milvus检索", icon: "images/aiLlm.svg", desc: "从 Milvus 向量索引检索。" },
753
753
  "ai/retriever/redis": { label: "Redis检索", icon: "images/redis.svg", desc: "从 Redis 向量索引检索。" }
754
- }, T = {
754
+ }, h = {
755
755
  "ci/gitClone": {
756
756
  label: "Git拉取",
757
757
  icon: "images/gitClone.svg",
@@ -820,7 +820,7 @@ const n = {
820
820
  icon: "images/ssh.svg",
821
821
  desc: "只执行系统白名单的命令。"
822
822
  }
823
- }, h = {
823
+ }, S = {
824
824
  "x/modbus": {
825
825
  label: "Modbus读写",
826
826
  icon: "images/modbus.svg",
@@ -927,7 +927,7 @@ const n = {
927
927
  startChar: { label: "起始字符", desc: "" },
928
928
  splitTimeout: { label: "分割超时(毫秒)", desc: "" }
929
929
  }
930
- }, S = {
930
+ }, f = {
931
931
  "x/streamAggregator": {
932
932
  label: "流聚合器",
933
933
  icon: "images/streamAggregator.svg",
@@ -948,7 +948,7 @@ const n = {
948
948
  rules: [{ noTemplateVariables: !0, message: "SQL 不支持 ${} 占位符变量,请直接引用 msg 数据字段" }]
949
949
  }
950
950
  }
951
- }, f = {
951
+ }, P = {
952
952
  "endpoint/http": {
953
953
  label: "HTTP",
954
954
  icon: "images/rest.svg",
@@ -1102,7 +1102,7 @@ const n = {
1102
1102
  label: "TCP/UDP",
1103
1103
  icon: "images/net.svg",
1104
1104
  desc: "TCP/UDP服务端点",
1105
- protocol: { label: "协议", desc: "tcp/udp", component: d([{ label: "TCP", value: "tcp" }, { label: "UDP", value: "udp" }]) },
1105
+ protocol: { label: "协议", desc: "tcp/udp", component: t([{ label: "TCP", value: "tcp" }, { label: "UDP", value: "udp" }]) },
1106
1106
  server: { ref: "primary", label: "监听地址", desc: "示例: :6335" },
1107
1107
  readTimeout: { label: "读取超时(秒)", desc: "" },
1108
1108
  encode: { label: "编码方式", desc: "" },
@@ -1244,7 +1244,7 @@ const n = {
1244
1244
  icon: "images/net.svg",
1245
1245
  desc: "TCP/UDP 客户端端点",
1246
1246
  server: { ref: "primary", label: "服务地址", desc: "" },
1247
- protocol: { label: "协议", desc: "tcp/udp", component: d([{ label: "TCP", value: "tcp" }, { label: "UDP", value: "udp" }]) },
1247
+ protocol: { label: "协议", desc: "tcp/udp", component: t([{ label: "TCP", value: "tcp" }, { label: "UDP", value: "udp" }]) },
1248
1248
  connectTimeout: { label: "连接超时(秒)", desc: "" },
1249
1249
  readTimeout: { label: "读取超时(秒)", desc: "" },
1250
1250
  reconnectInterval: { label: "重连间隔(秒)", desc: "" },
@@ -1270,8 +1270,7 @@ const n = {
1270
1270
  allowBinary: { label: "接收二进制消息", desc: "" },
1271
1271
  router: { from: { path: { label: "路由正则表达式", desc: "* 表示匹配所有" } } }
1272
1272
  }
1273
- }, k = r({
1274
- ...n,
1273
+ }, o = n({
1275
1274
  ...m,
1276
1275
  ...p,
1277
1276
  ...g,
@@ -1281,8 +1280,19 @@ const n = {
1281
1280
  ...T,
1282
1281
  ...h,
1283
1282
  ...S,
1284
- ...f
1285
- }, i);
1283
+ ...f,
1284
+ ...P
1285
+ }, r);
1286
+ for (const [l, c] of Object.entries({
1287
+ exec: "images/exec.svg",
1288
+ exprTransform: "images/exprTransform.svg",
1289
+ switch: "images/switch.svg",
1290
+ "x/luaFilter": "images/luaFilter.svg",
1291
+ "x/luaTransform": "images/luaTransform.svg",
1292
+ "x/redisPub": "images/redisPub.svg",
1293
+ "ci/gitClone": "images/gitClone.svg"
1294
+ }))
1295
+ o[l] = { ...o[l], icon: c };
1286
1296
  export {
1287
- k as D
1297
+ o as D
1288
1298
  };