@huanban/rulego-editor-core 1.4.2 → 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-DFhXz0vB.js → editor-core-styles-CwjFPfAo.js} +967 -510
  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 +2856 -2086
  86. package/dist/index.d.ts +33 -10
  87. package/dist/index.esm.js +1182 -810
  88. package/dist/index.umd.js +2850 -2080
  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 +1 -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 +4 -0
  145. package/dist/standalone/variable-completion-dropdown.d.ts +18 -0
  146. package/dist/types/component.d.ts +22 -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-Cls7lcgT.js +0 -11302
  156. package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +0 -217
  157. package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +0 -4
package/dist/index.esm.js CHANGED
@@ -1,255 +1,261 @@
1
- import { A as nt, B as ot, C as at, a as ct, b as lt, c as dt, d as ut, D as ht, e as ft, f as pt, g as mt, h as gt, E as yt, i as bt, j as Et, k as St, l as Tt, m as At, F as Rt, H as xt, n as Ct, o as _t, O as It, T as wt, p as Nt, q as vt, r as kt, V as Dt, s as Ot, t as Mt, u as Pt, v as Lt, w as Ft, x as Ut, y as Kt, z as Bt, G as Gt, I as Ht, J as $t, K as jt, L as zt, M as Vt, N as Wt, P as qt, Q as Yt, R as Jt, S as Xt, U as Zt, W as Qt, X as er, Y as tr, Z as rr, _ as sr, $ as ir, a0 as nr, a1 as or, a2 as ar, a3 as cr, a4 as lr, a5 as dr, a6 as ur, a7 as hr, a8 as fr } from "./chunks/editor-core-standalone-Cls7lcgT.js";
2
- import { T as $, S as j, R as y, F as v, ao as z, u as V, p as W, r as q } from "./chunks/editor-core-dialogs-BMWb0WRN.js";
3
- import { an as mr, am as gr, al as yr, aG as br, aH as Er, aI as Sr, aJ as Tr, aK as Ar, aL as Rr, aM as xr, aN as Cr, ai as _r, O as Ir, aO as wr, aP as Nr, aj as vr, aQ as kr, av as Dr, P as Or, H as Mr, au as Pr, aR as Lr, aS as Fr, ac as Ur, aT as Kr, aU as Br, U as Gr, g as Hr, aV as $r, aW as jr, c as zr, ar as Vr, y as Wr, J as qr, aF as Yr, b as Jr, e as Xr, aX as Zr, aY as Qr, aZ as es, a_ as ts, a$ as rs, f as ss, m as is, v as ns, w as os, b0 as as, a7 as cs, k as ls, q as ds, l as us, b1 as hs, b2 as fs, Q as ps, b3 as ms, aD as gs, a6 as ys, b4 as bs, j as Es, b5 as Ss, b6 as Ts, ak as As, ah as Rs, b7 as xs, b8 as Cs, C as _s, x as Is, D as ws, A as Ns, b9 as vs, ba as ks, bb as Ds, d as Os, a8 as Ms, bc as Ps, K as Ls, bd as Fs, I as Us, be as Ks, af as Bs, ag as Gs, bf as Hs, i as $s, bg as js, bh as zs, aC as Vs, bi as Ws, t as qs, bj as Ys, B as Js, bk as Xs } from "./chunks/editor-core-dialogs-BMWb0WRN.js";
4
- import { D as Qs, h as ei, i as ti, j as ri, F as si, R as ii, S as ni, k as oi, l as ai, m as ci, n as li, o as di, q as ui, t as hi, u as fi, v as pi, w as mi, x as gi, y as yi, z as bi, A as Ei, B as Si, C as Ti, E as Ai, G as Ri, H as xi, I as Ci, J as _i, K as Ii, L as wi, M as Ni, N as vi, O as ki, P as Di } from "./chunks/editor-core-property-drawers-BPh-jj1b.js";
5
- import "./chunks/editor-core-node-views-BOaPVdmN.js";
6
- import { E as Mi, d as Pi, e as Li, T as Fi, b as Ui, g as Ki, a as Bi, f as Gi, n as Hi } from "./chunks/editor-core-styles-DFhXz0vB.js";
7
- import { d as ji } from "./chunks/editor-core-default-components-BjF65lar.js";
8
- import { a as Vi, l as Wi } from "./chunks/editor-core-locales-i6o28vm2.js";
9
- import { HtmlNodeModel as Y } from "@logicflow/core";
10
- import { D as Yi, n as Ji } from "./chunks/editor-core-icons-BqeFofNA.js";
11
- function Ne(t, e) {
12
- return { chainId: t, requestId: e };
13
- }
14
- function ve(t, e, r) {
15
- return t.chainId === e && t.requestId === r;
16
- }
17
- const J = "section:root", X = "section:sub", Z = {
1
+ import { A as At, B as Rt, C as wt, a as It, b as xt, D as _t, c as vt, d as Nt, e as kt, f as Dt, g as Ot, h as Pt, E as Lt, i as Ut, j as Mt, k as Ft, l as $t, m as Kt, n as Bt, F as Gt, H as qt, o as zt, p as Ht, O as Vt, P as jt, R as Jt, q as Wt, r as Yt, s as Xt, t as Zt, u as Qt, v as es, w as ts, x as ss, y as rs, z as os, G as is, I as ns, J as as, K as ls, L as cs, M as ds, N as us, Q as hs, S as fs, T as ps, U as ms, V as gs, W as ys, X as bs, Y as Ss, Z as Ts, _ as Es, $ as Cs, a0 as As } from "./chunks/editor-core-standalone-C7pzm8ZB.js";
2
+ import { S as H, a as V } from "./chunks/editor-core-api-BQiYFuIO.js";
3
+ import { A as ws, D as Is, R as xs, b as _s, c as vs, f as Ns, e as ks, g as Ds, h as Os, d as Ps, n as Ls } from "./chunks/editor-core-api-BQiYFuIO.js";
4
+ import { w as j } from "./chunks/editor-core-property-drawers-Bqmp9B_J.js";
5
+ import { D as Ms, c as Fs, d as $s, e as Ks, F as Bs, R as Gs, S as qs, f as zs, g as Hs, h as Vs, i as js, j as Js, k as Ws, l as Ys, m as Xs, n as Zs, o as Qs, p as er, q as tr, r as sr, t as rr, u as or, v as ir, x as nr, y as ar, z as lr, A as cr, B as dr, C as ur, E as hr, G as fr, H as pr, I as mr, J as gr, K as yr, L as br, M as Sr } from "./chunks/editor-core-property-drawers-Bqmp9B_J.js";
6
+ import { u as F, L as J, r as W } from "./chunks/editor-core-canvas-nodes-BE9eN51s.js";
7
+ import { aY as Er, aZ as Cr, a_ as Ar, a$ as Rr, b0 as wr, b1 as Ir, c as xr, G as _r, a2 as vr, b2 as Nr, b3 as kr, S as Dr, aT as Or, aH as Pr, ac as Lr, ab as Ur, b4 as Mr, Z as Fr, aS as $r, m as Kr, k as Br, H as Gr, i as qr, g as zr, b5 as Hr, f as Vr, ah as jr, ak as Jr, N as Wr, M as Yr, af as Xr, ai as Zr, ag as Qr, b6 as eo, b7 as to, a3 as so, aW as ro, b8 as oo, ae as io, aw as no, j as ao, a8 as lo, a9 as co, aB as uo, b9 as ho, q as fo, ao as po, d as mo, b as go, aP as yo, n as bo, al as So, am as To, e as Eo, h as Co, aa as Ao, ba as Ro, aI as wo, bb as Io, bc as xo, O as _o, aN as vo, E as No, bd as ko, ad as Do, be as Oo, aV as Po, bf as Lo, bg as Uo, a4 as Mo, w as Fo, l as $o } from "./chunks/editor-core-canvas-nodes-BE9eN51s.js";
8
+ import { f as Y } from "./chunks/editor-core-dialogs-D9YHvzys.js";
9
+ import { a2 as Bo, a3 as Go, a4 as qo, x as zo, V as Ho, a5 as Vo, a6 as jo, a7 as Jo, h as Wo, a8 as Yo, a9 as Xo, aa as Zo, ab as Qo, ac as ei, ad as ti, ae as si, af as ri, ag as oi, ah as ii, ai as ni, aj as ai, U as li, ak as ci, n as di, o as ui, al as hi, am as fi, G as pi, F as mi, an as gi, ao as yi, ap as bi, m as Si, aq as Ti, ar as Ei, l as Ci, as as Ai, at as Ri, au as wi, av as Ii, aw as xi, ax as _i, ay as vi } from "./chunks/editor-core-dialogs-D9YHvzys.js";
10
+ import { R as b, D as v } from "./chunks/editor-core-settings-DcGCJSc7.js";
11
+ import { Z as ki, Y as Di, a3 as Oi, a4 as Pi, S as Li, a5 as Ui, a6 as Mi, a7 as Fi, T as $i, d as Ki, g as Bi, a8 as Gi, a9 as qi, G as zi, aa as Hi, ab as Vi, $ as ji, B as Ji, O as Wi, _ as Yi, ac as Xi, P as Zi, ad as Qi, ae as en, af as tn, c as sn, ag as rn, ah as on, ai as nn, aj as an, ak as ln, u as cn, m as dn, al as un, am as hn, an as fn, ao as pn, J as mn, I as gn, ap as yn, K as bn, F as Sn, aq as Tn, ar as En, E as Cn, a2 as An, a0 as Rn, a1 as wn, w as In, U as xn, t as _n } from "./chunks/editor-core-settings-DcGCJSc7.js";
12
+ import { E as Nn, e as kn, f as Dn, T as On, a as Pn, g as Ln, d as Un, b as Mn, n as Fn } from "./chunks/editor-core-styles-CwjFPfAo.js";
13
+ import { d as Kn } from "./chunks/editor-core-default-components-BsNP8ma1.js";
14
+ import { j as Gn, l as qn } from "./chunks/editor-core-locales-CsqTh7Wh.js";
15
+ import { HtmlNodeModel as X } from "@logicflow/core";
16
+ import { D as Hn, n as Vn } from "./chunks/editor-core-icons-BqeFofNA.js";
17
+ function Be(s, e) {
18
+ return { chainId: s, requestId: e };
19
+ }
20
+ function Ge(s, e, t) {
21
+ return s.chainId === e && s.requestId === t;
22
+ }
23
+ const Z = "section:root", Q = "section:sub", ee = {
18
24
  root: "主规则链",
19
25
  sub: "子规则链",
20
26
  uncategorized: "未分类"
21
27
  };
22
- function Q(t, e) {
23
- return t == null ? void 0 : t[e];
28
+ function te(s, e) {
29
+ return s == null ? void 0 : s[e];
24
30
  }
25
- function ee(t) {
26
- return typeof t != "string" ? [] : t.split("/").map((e) => e.trim()).filter(Boolean);
31
+ function se(s) {
32
+ return typeof s != "string" ? [] : s.split("/").map((e) => e.trim()).filter(Boolean);
27
33
  }
28
- function U(t) {
29
- const e = Q(t, "additionalInfo");
34
+ function $(s) {
35
+ const e = te(s, "additionalInfo");
30
36
  return !e || typeof e != "object" ? "" : typeof e.category == "string" ? String(e.category).trim() : "";
31
37
  }
32
- function S(t) {
33
- var s;
34
- const e = t.updateTime || ((s = t.additionalInfo) == null ? void 0 : s.updateTime);
38
+ function C(s) {
39
+ var r;
40
+ const e = s.updateTime || ((r = s.additionalInfo) == null ? void 0 : r.updateTime);
35
41
  if (!e) return 0;
36
- const r = new Date(String(e).replace(/-/g, "/")).getTime();
37
- return Number.isFinite(r) ? r : 0;
42
+ const t = new Date(String(e).replace(/-/g, "/")).getTime();
43
+ return Number.isFinite(t) ? t : 0;
38
44
  }
39
- function K(t) {
40
- return encodeURIComponent(t);
45
+ function K(s) {
46
+ return encodeURIComponent(s);
41
47
  }
42
- function te(t) {
43
- return `chain:${K(String(t.id || ""))}`;
48
+ function re(s) {
49
+ return `chain:${K(String(s.id || ""))}`;
44
50
  }
45
- function k(t, e) {
46
- return `${t}:category:${K(e)}`;
51
+ function N(s, e) {
52
+ return `${s}:category:${K(e)}`;
47
53
  }
48
- function re(t, e) {
54
+ function oe(s, e) {
49
55
  if (!e) return !0;
50
- const r = U(t);
51
- return [t.id, t.name, t.description, r].map((s) => String(s || "").toLocaleLowerCase()).some((s) => s.includes(e));
52
- }
53
- function D(t, e, r, s) {
54
- if (r.length === 0) return null;
55
- const n = { chains: [], children: /* @__PURE__ */ new Map() };
56
- for (const d of r) {
57
- const u = ee(U(d));
58
- let p = n;
59
- u.forEach((f, g) => {
60
- const N = [...u.slice(0, g), f].join("/");
56
+ const t = $(s);
57
+ return [s.id, s.name, s.description, t].map((r) => String(r || "").toLocaleLowerCase()).some((r) => r.includes(e));
58
+ }
59
+ function k(s, e, t, r) {
60
+ if (t.length === 0) return null;
61
+ const o = { chains: [], children: /* @__PURE__ */ new Map() };
62
+ for (const c of t) {
63
+ const u = se($(c));
64
+ let p = o;
65
+ u.forEach((f, m) => {
66
+ const y = [...u.slice(0, m), f].join("/");
61
67
  let E = p.children.get(f);
62
- E || (E = { path: N, segments: N.split("/"), chains: [], children: /* @__PURE__ */ new Map() }, p.children.set(f, E)), p = E;
63
- }), p.chains.push(d);
68
+ E || (E = { path: y, segments: y.split("/"), chains: [], children: /* @__PURE__ */ new Map() }, p.children.set(f, E)), p = E;
69
+ }), p.chains.push(c);
64
70
  }
65
- const i = (d) => ({
66
- key: te(d),
67
- label: String(d.name || d.id || "-"),
71
+ const i = (c) => ({
72
+ key: re(c),
73
+ label: String(c.name || c.id || "-"),
68
74
  kind: "chain",
69
- chain: d
70
- }), o = (d) => {
71
- const u = [...d.children.values()].sort((f, g) => f.path.localeCompare(g.path)).map((f) => ({
72
- key: k(t, f.path),
73
- label: f.segments[f.segments.length - 1] || s,
75
+ chain: c
76
+ }), n = (c) => {
77
+ const u = [...c.children.values()].sort((f, m) => f.path.localeCompare(m.path)).map((f) => ({
78
+ key: N(s, f.path),
79
+ label: f.segments[f.segments.length - 1] || r,
74
80
  kind: "category",
75
81
  path: f.path,
76
82
  count: a(f),
77
- children: o(f)
78
- })), p = d.chains.slice().sort((f, g) => S(g) - S(f) || String(f.name || f.id).localeCompare(String(g.name || g.id))).map(i);
83
+ children: n(f)
84
+ })), p = c.chains.slice().sort((f, m) => C(m) - C(f) || String(f.name || f.id).localeCompare(String(m.name || m.id))).map(i);
79
85
  return [...u, ...p];
80
- }, a = (d) => {
81
- let u = d.chains.length;
82
- return d.children.forEach((p) => {
86
+ }, a = (c) => {
87
+ let u = c.chains.length;
88
+ return c.children.forEach((p) => {
83
89
  u += a(p);
84
90
  }), u;
85
- }, c = o(n), l = n.chains.length > 0 ? [{
86
- key: k(t, ""),
87
- label: s,
91
+ }, l = n(o), d = o.chains.length > 0 ? [{
92
+ key: N(s, ""),
93
+ label: r,
88
94
  kind: "category",
89
95
  path: "",
90
- count: n.chains.length,
91
- children: n.chains.slice().sort((d, u) => S(u) - S(d) || String(d.name || d.id).localeCompare(String(u.name || u.id))).map(i)
92
- }] : [], h = c.filter((d) => d.kind === "category");
96
+ count: o.chains.length,
97
+ children: o.chains.slice().sort((c, u) => C(u) - C(c) || String(c.name || c.id).localeCompare(String(u.name || u.id))).map(i)
98
+ }] : [], h = l.filter((c) => c.kind === "category");
93
99
  return {
94
- key: t,
100
+ key: s,
95
101
  label: e,
96
102
  kind: "section",
97
- count: r.length,
98
- children: [...h, ...l]
103
+ count: t.length,
104
+ children: [...h, ...d]
99
105
  };
100
106
  }
101
- function T(t = [], e = {}) {
102
- const r = { ...Z, ...e.labels || {} }, s = String(e.keyword || "").trim().toLocaleLowerCase(), n = /* @__PURE__ */ new Set(), i = t.filter((c) => {
103
- const l = String((c == null ? void 0 : c.id) || "").trim();
104
- return !l || n.has(l) || !re(c, s) ? !1 : (n.add(l), !0);
105
- }), o = i.filter((c) => c.root !== !1), a = i.filter((c) => c.root === !1);
107
+ function A(s = [], e = {}) {
108
+ const t = { ...ee, ...e.labels || {} }, r = String(e.keyword || "").trim().toLocaleLowerCase(), o = /* @__PURE__ */ new Set(), i = s.filter((l) => {
109
+ const d = String((l == null ? void 0 : l.id) || "").trim();
110
+ return !d || o.has(d) || !oe(l, r) ? !1 : (o.add(d), !0);
111
+ }), n = i.filter((l) => l.root !== !1), a = i.filter((l) => l.root === !1);
106
112
  return [
107
- D(J, r.root, o, r.uncategorized),
108
- D(X, r.sub, a, r.uncategorized)
109
- ].filter((c) => c !== null);
113
+ k(Z, t.root, n, t.uncategorized),
114
+ k(Q, t.sub, a, t.uncategorized)
115
+ ].filter((l) => l !== null);
110
116
  }
111
- function b(t = []) {
112
- const e = [], r = (s) => {
113
- s.forEach((n) => {
117
+ function S(s = []) {
118
+ const e = [], t = (r) => {
119
+ r.forEach((o) => {
114
120
  var i;
115
- (i = n.children) != null && i.length && (e.push(n.key), r(n.children));
121
+ (i = o.children) != null && i.length && (e.push(o.key), t(o.children));
116
122
  });
117
123
  };
118
- return r(t), e;
124
+ return t(s), e;
119
125
  }
120
- function se(t = [], e) {
121
- const r = (s, n) => {
122
- for (const i of s) {
123
- if (i.key === e) return n;
126
+ function ie(s = [], e) {
127
+ const t = (r, o) => {
128
+ for (const i of r) {
129
+ if (i.key === e) return o;
124
130
  if (i.children) {
125
- const o = r(i.children, [...n, i.key]);
126
- if (o) return o;
131
+ const n = t(i.children, [...o, i.key]);
132
+ if (n) return n;
127
133
  }
128
134
  }
129
135
  return null;
130
136
  };
131
- return r(t, []) || [];
132
- }
133
- function A(t, e) {
134
- const r = new Set(b(t));
135
- return [...new Set(e)].filter((s) => r.has(s));
136
- }
137
- function ie(t = [], e) {
138
- for (const r of t) {
139
- if (r.key === e) return r;
140
- if (r.children) {
141
- const s = ie(r.children, e);
142
- if (s) return s;
137
+ return t(s, []) || [];
138
+ }
139
+ function R(s, e) {
140
+ const t = new Set(S(s));
141
+ return [...new Set(e)].filter((r) => t.has(r));
142
+ }
143
+ function ne(s = [], e) {
144
+ for (const t of s) {
145
+ if (t.key === e) return t;
146
+ if (t.children) {
147
+ const r = ne(t.children, e);
148
+ if (r) return r;
143
149
  }
144
150
  }
145
151
  return null;
146
152
  }
147
- function ne(t) {
148
- if (!t || typeof t != "object") return null;
149
- const e = t.expandedKeys;
153
+ function ae(s) {
154
+ if (!s || typeof s != "object") return null;
155
+ const e = s.expandedKeys;
150
156
  return Array.isArray(e) ? {
151
- expandedKeys: [...new Set(e.filter((r) => typeof r == "string" && !!r.trim()))]
157
+ expandedKeys: [...new Set(e.filter((t) => typeof t == "string" && !!t.trim()))]
152
158
  } : null;
153
159
  }
154
- function oe(t) {
155
- const e = Number(t);
160
+ function le(s) {
161
+ const e = Number(s);
156
162
  return Number.isFinite(e) && e >= 0 ? Math.floor(e) : 20;
157
163
  }
158
- function ae(t) {
159
- return t ? `chain:${encodeURIComponent(t)}` : "";
164
+ function ce(s) {
165
+ return s ? `chain:${encodeURIComponent(s)}` : "";
160
166
  }
161
- function B(t) {
167
+ function B(s) {
162
168
  var e;
163
169
  return {
164
- ...t,
165
- chain: t.chain ? { ...t.chain, additionalInfo: { ...t.chain.additionalInfo } } : void 0,
166
- children: (e = t.children) == null ? void 0 : e.map(B)
170
+ ...s,
171
+ chain: s.chain ? { ...s.chain, additionalInfo: { ...s.chain.additionalInfo } } : void 0,
172
+ children: (e = s.children) == null ? void 0 : e.map(B)
167
173
  };
168
174
  }
169
- function C(t) {
175
+ function w(s) {
170
176
  return {
171
- tree: t.tree.map(B),
172
- keyword: t.keyword,
173
- activeChainId: t.activeChainId,
174
- rememberedExpandedKeys: [...t.rememberedExpandedKeys],
175
- forcedExpandedKeys: [...t.forcedExpandedKeys],
176
- expandedKeys: [...t.expandedKeys]
177
+ tree: s.tree.map(B),
178
+ keyword: s.keyword,
179
+ activeChainId: s.activeChainId,
180
+ rememberedExpandedKeys: [...s.rememberedExpandedKeys],
181
+ forcedExpandedKeys: [...s.forcedExpandedKeys],
182
+ expandedKeys: [...s.expandedKeys]
177
183
  };
178
184
  }
179
- function O(t) {
180
- const e = t.additionalInfo && typeof t.additionalInfo == "object" ? t.additionalInfo : {};
185
+ function D(s) {
186
+ const e = s.additionalInfo && typeof s.additionalInfo == "object" ? s.additionalInfo : {};
181
187
  return JSON.stringify([
182
- String(t.id || ""),
183
- String(t.name || ""),
184
- t.root === !1 ? "sub" : "root",
185
- !!t.disabled,
186
- String(t.description || ""),
187
- String(t.updateTime || e.updateTime || ""),
188
+ String(s.id || ""),
189
+ String(s.name || ""),
190
+ s.root === !1 ? "sub" : "root",
191
+ !!s.disabled,
192
+ String(s.description || ""),
193
+ String(s.updateTime || e.updateTime || ""),
188
194
  typeof e.category == "string" ? e.category : ""
189
195
  ]);
190
196
  }
191
- function ce(t, e) {
192
- return t.length !== e.length ? !1 : t.every((r, s) => O(r) === O(e[s]));
197
+ function de(s, e) {
198
+ return s.length !== e.length ? !1 : s.every((t, r) => D(t) === D(e[r]));
193
199
  }
194
- class ke {
200
+ class qe {
195
201
  constructor(e = {}) {
196
- var c, l;
197
- this.destroyed = !1, this.labels = e.labels, this.smallTreeMax = oe(e.smallTreeMax), this.persistence = $("explorer", e.persistence, ne), this.workflows = [...e.workflows || []], this.seeded = ((c = this.persistence) == null ? void 0 : c.restoredState) !== null && ((l = this.persistence) == null ? void 0 : l.restoredState) !== void 0;
198
- const r = String(e.keyword || ""), s = String(e.activeChainId || "").trim(), n = T(this.workflows, { keyword: r, labels: this.labels }), i = r.trim() ? T(this.workflows, { labels: this.labels }) : n, o = this.resolveRememberedKeys(i), a = this.resolveForcedKeys(n, r, s);
199
- this.store = new j({
200
- tree: n,
201
- keyword: r,
202
- activeChainId: s,
203
- rememberedExpandedKeys: o,
202
+ var l, d;
203
+ this.destroyed = !1, this.labels = e.labels, this.smallTreeMax = le(e.smallTreeMax), this.persistence = Y("explorer", e.persistence, ae), this.workflows = [...e.workflows || []], this.seeded = ((l = this.persistence) == null ? void 0 : l.restoredState) !== null && ((d = this.persistence) == null ? void 0 : d.restoredState) !== void 0;
204
+ const t = String(e.keyword || ""), r = String(e.activeChainId || "").trim(), o = A(this.workflows, { keyword: t, labels: this.labels }), i = t.trim() ? A(this.workflows, { labels: this.labels }) : o, n = this.resolveRememberedKeys(i), a = this.resolveForcedKeys(o, t, r);
205
+ this.store = new H({
206
+ tree: o,
207
+ keyword: t,
208
+ activeChainId: r,
209
+ rememberedExpandedKeys: n,
204
210
  forcedExpandedKeys: a,
205
- expandedKeys: [.../* @__PURE__ */ new Set([...o, ...a])]
211
+ expandedKeys: [.../* @__PURE__ */ new Set([...n, ...a])]
206
212
  });
207
213
  }
208
214
  getState() {
209
- return C(this.store.getState());
215
+ return w(this.store.getState());
210
216
  }
211
217
  subscribe(e) {
212
218
  return this.destroyed ? () => {
213
- } : this.store.subscribe((r, s) => e(C(r), C(s)));
219
+ } : this.store.subscribe((t, r) => e(w(t), w(r)));
214
220
  }
215
221
  setWorkflows(e) {
216
222
  if (this.destroyed) return;
217
- const r = [...e || []];
218
- ce(this.workflows, r) || (this.workflows = r, this.rebuild());
223
+ const t = [...e || []];
224
+ de(this.workflows, t) || (this.workflows = t, this.rebuild());
219
225
  }
220
226
  setKeyword(e) {
221
227
  if (this.destroyed) return;
222
- const r = String(e || "");
223
- r !== this.store.getState().keyword && this.rebuild(r);
228
+ const t = String(e || "");
229
+ t !== this.store.getState().keyword && this.rebuild(t);
224
230
  }
225
231
  setActiveChainId(e) {
226
232
  if (this.destroyed) return;
227
- const r = String(e || "").trim(), s = this.store.getState();
228
- if (r === s.activeChainId) return;
229
- const n = this.resolveForcedKeys(s.tree, s.keyword, r), i = A(s.tree, s.rememberedExpandedKeys);
233
+ const t = String(e || "").trim(), r = this.store.getState();
234
+ if (t === r.activeChainId) return;
235
+ const o = this.resolveForcedKeys(r.tree, r.keyword, t), i = R(r.tree, r.rememberedExpandedKeys);
230
236
  this.store.setState({
231
- activeChainId: r,
237
+ activeChainId: t,
232
238
  rememberedExpandedKeys: i,
233
- forcedExpandedKeys: n,
234
- expandedKeys: [.../* @__PURE__ */ new Set([...i, ...n])]
239
+ forcedExpandedKeys: o,
240
+ expandedKeys: [.../* @__PURE__ */ new Set([...i, ...o])]
235
241
  });
236
242
  }
237
243
  /** Search and active-chain expansion are temporary and never written here. */
238
- setExpanded(e, r) {
239
- var l;
244
+ setExpanded(e, t) {
245
+ var d;
240
246
  if (this.destroyed) return !1;
241
- const s = this.store.getState();
242
- if (s.keyword.trim() || !new Set(b(s.tree)).has(e)) return !1;
243
- const i = new Set(s.rememberedExpandedKeys);
244
- if (!(r ? !i.has(e) : i.has(e))) return !1;
245
- r ? i.add(e) : i.delete(e), this.seeded = !0;
246
- const a = A(s.tree, [...i]);
247
- (l = this.persistence) == null || l.save({ expandedKeys: a });
248
- const c = this.resolveForcedKeys(s.tree, s.keyword, s.activeChainId);
247
+ const r = this.store.getState();
248
+ if (r.keyword.trim() || !new Set(S(r.tree)).has(e)) return !1;
249
+ const i = new Set(r.rememberedExpandedKeys);
250
+ if (!(t ? !i.has(e) : i.has(e))) return !1;
251
+ t ? i.add(e) : i.delete(e), this.seeded = !0;
252
+ const a = R(r.tree, [...i]);
253
+ (d = this.persistence) == null || d.save({ expandedKeys: a });
254
+ const l = this.resolveForcedKeys(r.tree, r.keyword, r.activeChainId);
249
255
  return this.store.setState({
250
256
  rememberedExpandedKeys: a,
251
- forcedExpandedKeys: c,
252
- expandedKeys: [.../* @__PURE__ */ new Set([...a, ...c])]
257
+ forcedExpandedKeys: l,
258
+ expandedKeys: [.../* @__PURE__ */ new Set([...a, ...l])]
253
259
  }), !0;
254
260
  }
255
261
  toggleExpanded(e) {
@@ -260,58 +266,58 @@ class ke {
260
266
  this.destroyed || (this.destroyed = !0, (e = this.persistence) == null || e.destroy(), this.store.destroy(), this.workflows = []);
261
267
  }
262
268
  rebuild(e = this.store.getState().keyword) {
263
- var a, c;
264
- const r = this.store.getState(), s = T(this.workflows, { keyword: e, labels: this.labels }), n = e.trim() ? T(this.workflows, { labels: this.labels }) : s;
265
- let i = A(n, r.rememberedExpandedKeys);
269
+ var a, l;
270
+ const t = this.store.getState(), r = A(this.workflows, { keyword: e, labels: this.labels }), o = e.trim() ? A(this.workflows, { labels: this.labels }) : r;
271
+ let i = R(o, t.rememberedExpandedKeys);
266
272
  if (!this.seeded && this.workflows.length > 0) {
267
- const l = b(n);
268
- i = this.workflows.length <= this.smallTreeMax ? l : n.map((h) => h.key), this.seeded = !0, (a = this.persistence) == null || a.save({ expandedKeys: i });
269
- } else i.length !== r.rememberedExpandedKeys.length && ((c = this.persistence) == null || c.save({ expandedKeys: i }));
270
- const o = this.resolveForcedKeys(s, e, r.activeChainId);
273
+ const d = S(o);
274
+ i = this.workflows.length <= this.smallTreeMax ? d : o.map((h) => h.key), this.seeded = !0, (a = this.persistence) == null || a.save({ expandedKeys: i });
275
+ } else i.length !== t.rememberedExpandedKeys.length && ((l = this.persistence) == null || l.save({ expandedKeys: i }));
276
+ const n = this.resolveForcedKeys(r, e, t.activeChainId);
271
277
  this.store.setState({
272
- tree: s,
278
+ tree: r,
273
279
  keyword: e,
274
280
  rememberedExpandedKeys: i,
275
- forcedExpandedKeys: o,
276
- expandedKeys: [.../* @__PURE__ */ new Set([...i, ...o])]
281
+ forcedExpandedKeys: n,
282
+ expandedKeys: [.../* @__PURE__ */ new Set([...i, ...n])]
277
283
  });
278
284
  }
279
285
  resolveRememberedKeys(e) {
280
- var n, i;
281
- const r = (n = this.persistence) == null ? void 0 : n.restoredState;
282
- if (r) return A(e, r.expandedKeys);
286
+ var o, i;
287
+ const t = (o = this.persistence) == null ? void 0 : o.restoredState;
288
+ if (t) return R(e, t.expandedKeys);
283
289
  if (this.workflows.length === 0) return [];
284
290
  this.seeded = !0;
285
- const s = this.workflows.length <= this.smallTreeMax ? b(e) : e.map((o) => o.key);
286
- return (i = this.persistence) == null || i.save({ expandedKeys: s }), s;
291
+ const r = this.workflows.length <= this.smallTreeMax ? S(e) : e.map((n) => n.key);
292
+ return (i = this.persistence) == null || i.save({ expandedKeys: r }), r;
287
293
  }
288
- resolveForcedKeys(e, r, s) {
289
- const n = r.trim() ? b(e) : se(e, ae(s));
290
- return [...new Set(n)];
294
+ resolveForcedKeys(e, t, r) {
295
+ const o = t.trim() ? S(e) : ie(e, ce(r));
296
+ return [...new Set(o)];
291
297
  }
292
298
  }
293
- function De(t) {
294
- return G(t) === "stopped";
299
+ function ze(s) {
300
+ return G(s) === "stopped";
295
301
  }
296
- function le(t) {
302
+ function ue(s) {
297
303
  var e;
298
- return typeof t.pinned == "boolean" ? t.pinned : ((e = t.metadata) == null ? void 0 : e.pinned) === !0;
304
+ return typeof s.pinned == "boolean" ? s.pinned : ((e = s.metadata) == null ? void 0 : e.pinned) === !0;
299
305
  }
300
- function G(t) {
301
- var r;
302
- const e = (r = t.data) == null ? void 0 : r.ruleChain;
306
+ function G(s) {
307
+ var t;
308
+ const e = (t = s.data) == null ? void 0 : t.ruleChain;
303
309
  if (e && Object.prototype.hasOwnProperty.call(e, "disabled")) {
304
310
  if (e.disabled === !1) return "running";
305
311
  if (e.disabled === !0) return "stopped";
306
312
  }
307
- if (t.metadata && Object.prototype.hasOwnProperty.call(t.metadata, "disabled")) {
308
- if (t.metadata.disabled === !1) return "running";
309
- if (t.metadata.disabled === !0) return "stopped";
313
+ if (s.metadata && Object.prototype.hasOwnProperty.call(s.metadata, "disabled")) {
314
+ if (s.metadata.disabled === !1) return "running";
315
+ if (s.metadata.disabled === !0) return "stopped";
310
316
  }
311
317
  return "undeployed";
312
318
  }
313
- function Oe(t) {
314
- const e = t.readonly, r = G(t), s = le(t);
319
+ function He(s) {
320
+ const e = s.readonly, t = G(s), r = ue(s);
315
321
  return [
316
322
  { id: "close", labelKey: "editor.workspace.close", disabled: !1 },
317
323
  { id: "close-others", labelKey: "editor.workspace.closeOthers", disabled: !1 },
@@ -319,47 +325,47 @@ function Oe(t) {
319
325
  { id: "rename", labelKey: "editor.workspace.rename", disabled: e },
320
326
  {
321
327
  id: "toggle-pinned",
322
- labelKey: s ? "editor.workspace.unpin" : "editor.workspace.pin",
328
+ labelKey: r ? "editor.workspace.unpin" : "editor.workspace.pin",
323
329
  disabled: !1
324
330
  },
325
331
  { id: "edit-info", labelKey: "editor.workspace.editInfo", disabled: !1, dividerBefore: !0 },
326
- { id: "run-history", labelKey: "editor.workspace.runHistory", disabled: !t.chainId },
327
- { id: "debug", labelKey: "editor.workspace.debug", disabled: !t.chainId },
332
+ { id: "run-history", labelKey: "editor.workspace.runHistory", disabled: !s.chainId },
333
+ { id: "debug", labelKey: "editor.workspace.debug", disabled: !s.chainId },
328
334
  {
329
335
  id: "toggle-disabled",
330
- labelKey: r === "running" ? "editor.workspace.stop" : "editor.workspace.deploy",
331
- disabled: e || !t.chainId,
336
+ labelKey: t === "running" ? "editor.workspace.stop" : "editor.workspace.deploy",
337
+ disabled: e || !s.chainId,
332
338
  dividerBefore: !0
333
339
  }
334
340
  ];
335
341
  }
336
- const de = ["flow", "end", "break"];
337
- class m {
342
+ const he = ["flow", "end", "break"];
343
+ class g {
338
344
  /**
339
345
  * 校验完整的规则链数据
340
346
  * @param data - RuleGo 规则链 JSON 数据
341
347
  * @returns 校验结果
342
348
  */
343
349
  static validate(e) {
344
- var l;
345
- const r = [];
346
- if (!((l = e == null ? void 0 : e.metadata) != null && l.nodes))
350
+ var d;
351
+ const t = [];
352
+ if (!((d = e == null ? void 0 : e.metadata) != null && d.nodes))
347
353
  return { valid: !0, issues: [], errors: [], warnings: [] };
348
- const s = e.metadata.nodes, n = e.metadata.connections || [], i = e.metadata.endpoints || [];
349
- if (s.length + i.length > y.maxGraphNodes)
350
- throw new v("GRAPH_NODES_LIMIT", `validate graph has ${s.length + i.length} nodes, max is ${y.maxGraphNodes}`);
351
- if (n.length > y.maxGraphEdges)
352
- throw new v("GRAPH_EDGES_LIMIT", `validate graph has ${n.length} edges, max is ${y.maxGraphEdges}`);
353
- const o = new Set(s.map((h) => h.id));
354
- s.forEach((h) => {
355
- m._validateNode(h, o, r);
356
- }), m._validateConnections(n, s, o, r), m._validateFirstNode(e, r);
357
- const a = r.filter((h) => h.severity === "error"), c = r.filter((h) => h.severity === "warning");
354
+ const r = e.metadata.nodes, o = e.metadata.connections || [], i = e.metadata.endpoints || [];
355
+ if (r.length + i.length > b.maxGraphNodes)
356
+ throw new v("GRAPH_NODES_LIMIT", `validate graph has ${r.length + i.length} nodes, max is ${b.maxGraphNodes}`);
357
+ if (o.length > b.maxGraphEdges)
358
+ throw new v("GRAPH_EDGES_LIMIT", `validate graph has ${o.length} edges, max is ${b.maxGraphEdges}`);
359
+ const n = new Set(r.map((h) => h.id));
360
+ r.forEach((h) => {
361
+ g._validateNode(h, n, t);
362
+ }), g._validateConnections(o, r, n, t), g._validateFirstNode(e, t);
363
+ const a = t.filter((h) => h.severity === "error"), l = t.filter((h) => h.severity === "warning");
358
364
  return {
359
365
  valid: a.length === 0,
360
- issues: r,
366
+ issues: t,
361
367
  errors: a,
362
- warnings: c
368
+ warnings: l
363
369
  };
364
370
  }
365
371
  /**
@@ -368,12 +374,12 @@ class m {
368
374
  * @param nodeIdSet - 所有节点 ID 集合
369
375
  * @param issues - 问题列表 (会被修改)
370
376
  */
371
- static _validateNode(e, r, s) {
372
- const n = e.configuration || {}, i = { nodeId: e.id, nodeName: e.name, nodeType: e.type };
377
+ static _validateNode(e, t, r) {
378
+ const o = e.configuration || {}, i = { nodeId: e.id, nodeName: e.name, nodeType: e.type };
373
379
  switch (e.type) {
374
380
  case "switch":
375
381
  case "inclusive": {
376
- (!Array.isArray(n.cases) || n.cases.length === 0) && s.push({
382
+ (!Array.isArray(o.cases) || o.cases.length === 0) && r.push({
377
383
  ...i,
378
384
  severity: "warning",
379
385
  message: `${e.type} 节点 "${e.name}" 没有配置任何条件分支 (cases)`,
@@ -382,12 +388,12 @@ class m {
382
388
  break;
383
389
  }
384
390
  case "for": {
385
- n.range || s.push({
391
+ o.range || r.push({
386
392
  ...i,
387
393
  severity: "error",
388
394
  message: `for 节点 "${e.name}" 缺少遍历范围 (range)`,
389
395
  category: "missing_config"
390
- }), n.do ? m._validateNodeRef(n.do, e, "do", r, s) : s.push({
396
+ }), o.do ? g._validateNodeRef(o.do, e, "do", t, r) : r.push({
391
397
  ...i,
392
398
  severity: "error",
393
399
  message: `for 节点 "${e.name}" 缺少循环体目标 (do)`,
@@ -396,12 +402,12 @@ class m {
396
402
  break;
397
403
  }
398
404
  case "while": {
399
- n.condition || n.jsScript || s.push({
405
+ o.condition || o.jsScript || r.push({
400
406
  ...i,
401
407
  severity: "error",
402
408
  message: `while 节点 "${e.name}" 缺少循环条件 (condition)`,
403
409
  category: "missing_config"
404
- }), n.do ? m._validateNodeRef(n.do, e, "do", r, s) : s.push({
410
+ }), o.do ? g._validateNodeRef(o.do, e, "do", t, r) : r.push({
405
411
  ...i,
406
412
  severity: "error",
407
413
  message: `while 节点 "${e.name}" 缺少循环体目标 (do)`,
@@ -410,31 +416,31 @@ class m {
410
416
  break;
411
417
  }
412
418
  case "groupFilter": {
413
- const o = m._parseNodeIds(n.nodeIds);
414
- o.length === 0 ? s.push({
419
+ const n = g._parseNodeIds(o.nodeIds);
420
+ n.length === 0 ? r.push({
415
421
  ...i,
416
422
  severity: "error",
417
423
  message: `groupFilter 节点 "${e.name}" 缺少过滤器节点列表 (nodeIds)`,
418
424
  category: "missing_config"
419
- }) : o.forEach((a) => {
420
- m._validateNodeRef(a, e, "nodeIds", r, s);
425
+ }) : n.forEach((a) => {
426
+ g._validateNodeRef(a, e, "nodeIds", t, r);
421
427
  });
422
428
  break;
423
429
  }
424
430
  case "groupAction": {
425
- const o = m._parseNodeIds(n.nodeIds);
426
- o.length === 0 ? s.push({
431
+ const n = g._parseNodeIds(o.nodeIds);
432
+ n.length === 0 ? r.push({
427
433
  ...i,
428
434
  severity: "error",
429
435
  message: `groupAction 节点 "${e.name}" 缺少动作节点列表 (nodeIds)`,
430
436
  category: "missing_config"
431
- }) : o.forEach((a) => {
432
- m._validateNodeRef(a, e, "nodeIds", r, s);
437
+ }) : n.forEach((a) => {
438
+ g._validateNodeRef(a, e, "nodeIds", t, r);
433
439
  });
434
440
  break;
435
441
  }
436
442
  case "iterator": {
437
- s.push({
443
+ r.push({
438
444
  ...i,
439
445
  severity: "warning",
440
446
  message: `iterator 节点 "${e.name}" 已弃用,建议替换为 for 节点`,
@@ -454,13 +460,13 @@ class m {
454
460
  * @param nodeIdSet - 节点 ID 集合
455
461
  * @param issues - 问题列表
456
462
  */
457
- static _validateNodeRef(e, r, s, n, i) {
458
- e.startsWith("chain:") || n.has(e) || i.push({
459
- nodeId: r.id,
460
- nodeName: r.name,
461
- nodeType: r.type,
463
+ static _validateNodeRef(e, t, r, o, i) {
464
+ e.startsWith("chain:") || o.has(e) || i.push({
465
+ nodeId: t.id,
466
+ nodeName: t.name,
467
+ nodeType: t.type,
462
468
  severity: "error",
463
- message: `${r.type} 节点 "${r.name}" 的 ${s} 引用了不存在的节点: "${e}"`,
469
+ message: `${t.type} 节点 "${t.name}" 的 ${r} 引用了不存在的节点: "${e}"`,
464
470
  category: "invalid_reference"
465
471
  });
466
472
  }
@@ -471,27 +477,27 @@ class m {
471
477
  * @param nodeIdSet - 节点 ID 集合
472
478
  * @param issues - 问题列表
473
479
  */
474
- static _validateConnections(e, r, s, n) {
475
- const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
476
- r.forEach((a) => {
477
- i.set(a.id, a.type), o.set(a.id, a.name);
480
+ static _validateConnections(e, t, r, o) {
481
+ const i = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
482
+ t.forEach((a) => {
483
+ i.set(a.id, a.type), n.set(a.id, a.name);
478
484
  }), e.forEach((a) => {
479
- s.has(a.fromId) || n.push({
485
+ r.has(a.fromId) || o.push({
480
486
  severity: "error",
481
487
  message: `连接的源节点不存在: "${a.fromId}"`,
482
488
  category: "connection"
483
- }), s.has(a.toId) || n.push({
489
+ }), r.has(a.toId) || o.push({
484
490
  severity: "error",
485
491
  message: `连接的目标节点不存在: "${a.toId}"`,
486
492
  category: "connection"
487
493
  });
488
- const c = i.get(a.fromId);
489
- c && de.includes(c) && n.push({
494
+ const l = i.get(a.fromId);
495
+ l && he.includes(l) && o.push({
490
496
  nodeId: a.fromId,
491
- nodeName: o.get(a.fromId),
492
- nodeType: c,
497
+ nodeName: n.get(a.fromId),
498
+ nodeType: l,
493
499
  severity: "warning",
494
- message: `终端节点 "${o.get(a.fromId)}" (${c}) 不应有输出连接`,
500
+ message: `终端节点 "${n.get(a.fromId)}" (${l}) 不应有输出连接`,
495
501
  category: "connection"
496
502
  });
497
503
  });
@@ -502,12 +508,12 @@ class m {
502
508
  * @param nodeIdSet - 节点 ID 集合
503
509
  * @param issues - 问题列表
504
510
  */
505
- static _validateFirstNode(e, r) {
506
- var i, o;
507
- const s = ((i = e.metadata) == null ? void 0 : i.firstNodeIndex) ?? 0, n = ((o = e.metadata) == null ? void 0 : o.nodes) || [];
508
- n.length > 0 && (s < 0 || s >= n.length) && r.push({
511
+ static _validateFirstNode(e, t) {
512
+ var i, n;
513
+ const r = ((i = e.metadata) == null ? void 0 : i.firstNodeIndex) ?? 0, o = ((n = e.metadata) == null ? void 0 : n.nodes) || [];
514
+ o.length > 0 && (r < 0 || r >= o.length) && t.push({
509
515
  severity: "error",
510
- message: `firstNodeIndex (${s}) 超出节点范围 (0-${n.length - 1})`,
516
+ message: `firstNodeIndex (${r}) 超出节点范围 (0-${o.length - 1})`,
511
517
  category: "connection"
512
518
  });
513
519
  }
@@ -517,300 +523,287 @@ class m {
517
523
  * @returns 节点 ID 列表
518
524
  */
519
525
  static _parseNodeIds(e) {
520
- return e ? Array.isArray(e) ? e.map((r) => String(r).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((r) => r.trim()).filter(Boolean) : [] : [];
521
- }
522
- }
523
- function Me(t) {
524
- return t.filter((e, r, s) => {
525
- if (e.status === "sending" || e.status === "error") return !1;
526
- const n = s[r + 1];
527
- return !(e.role === "user" && (n == null ? void 0 : n.role) === "assistant" && n.status === "error");
528
- });
529
- }
530
- function Pe(t = [], e) {
531
- const r = e.index !== void 0 ? `tool-index-${e.index}` : `tool-${t.length + 1}`, s = String(e.id || r), n = t.findIndex((a) => a.id === s || e.index !== void 0 && a.index === e.index), i = n >= 0 ? t[n] : null, o = {
532
- id: (i == null ? void 0 : i.id) || s,
533
- index: e.index ?? (i == null ? void 0 : i.index),
534
- type: e.type || (i == null ? void 0 : i.type),
535
- name: e.name || (i == null ? void 0 : i.name) || "tool",
536
- arguments: `${(i == null ? void 0 : i.arguments) || ""}${e.arguments || ""}` || void 0,
537
- result: `${(i == null ? void 0 : i.result) || ""}${e.result || ""}` || void 0,
538
- status: e.status || (i == null ? void 0 : i.status) || "loading"
539
- };
540
- return n < 0 ? [...t, o] : t.map((a, c) => c === n ? o : a);
541
- }
542
- function Le(t) {
543
- return t == null ? void 0 : t.map((e) => e.status === "loading" ? { ...e, status: "received" } : e);
544
- }
545
- function M(t) {
546
- return typeof t == "string" ? t : Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e == null ? void 0 : e.text).filter((e) => typeof e == "string").join("") : "";
547
- }
548
- function x(t) {
549
- if (t != null) {
550
- if (typeof t == "string") return t;
551
- try {
552
- const e = JSON.stringify(t);
553
- return e === void 0 ? void 0 : e;
554
- } catch {
555
- return String(t);
556
- }
526
+ return e ? Array.isArray(e) ? e.map((t) => String(t).trim()).filter(Boolean) : typeof e == "string" ? e.split(",").map((t) => t.trim()).filter(Boolean) : [] : [];
557
527
  }
558
528
  }
559
- function ue(t) {
560
- var r, s;
561
- if (typeof t == "string") return t.trim();
562
- if (!t || typeof t != "object") return ((r = x(t)) == null ? void 0 : r.trim()) || "";
563
- const e = t;
564
- return ((s = x(e.message ?? e.msg ?? e.detail ?? t)) == null ? void 0 : s.trim()) || "";
565
- }
566
- function he(t) {
567
- const e = t.trim();
568
- return /^\s*\[[^\]\r\n]*RunError\]\s*/i.test(e) || /\bGraphRunError\b[\s\S]*\bexceeds\s+max\s+steps\b/i.test(e) || /\bexceeds\s+max\s+steps\b/i.test(e);
569
- }
570
- function fe(t) {
571
- if (!t || typeof t != "object") return null;
572
- const e = String(t.type ?? t.event ?? "").trim(), r = t.function && typeof t.function == "object" ? t.function : {}, s = String(t.toolCallName ?? t.name ?? r.name ?? "").trim() || void 0, n = r.arguments ?? t.arguments ?? t.args, i = t.result ?? t.output ?? (/RESULT|END|ERROR|CANCEL/i.test(e) ? t.content ?? t.data : void 0);
573
- if (!(t.id !== void 0 || t.index !== void 0 || s || n !== void 0 || i !== void 0 || e)) return null;
574
- let a;
575
- return /ERROR/i.test(e) ? a = "error" : /CANCEL/i.test(e) ? a = "cancel" : /RESULT|END/i.test(e) ? a = "success" : /START|ARGS/i.test(e) && (a = "loading"), {
576
- id: t.id === void 0 || t.id === null ? void 0 : String(t.id),
577
- index: typeof t.index == "number" ? t.index : void 0,
578
- type: t.type === void 0 ? void 0 : String(t.type),
579
- name: s,
580
- arguments: x(n),
581
- result: x(i),
582
- status: a
583
- };
529
+ const fe = 100, pe = 80;
530
+ function me(s, e) {
531
+ const r = s.toLowerCase().indexOf(e.toLowerCase());
532
+ if (r < 0) return s.slice(0, pe);
533
+ const o = Math.max(0, r - 20), i = Math.min(s.length, r + e.length + 40);
534
+ let n = s.slice(o, i);
535
+ return o > 0 && (n = "..." + n), i < s.length && (n = n + "..."), n;
584
536
  }
585
- function R(t, e, r, s) {
586
- const n = t == null ? void 0 : t.error;
587
- if (n) throw new Error(ue(n) || "AI request failed");
588
- const i = Array.isArray(t == null ? void 0 : t.choices) ? t.choices[0] : void 0, o = (i == null ? void 0 : i.delta) || (i == null ? void 0 : i.message) || (t == null ? void 0 : t.message) || t, a = M((o == null ? void 0 : o.content) ?? (t == null ? void 0 : t.content)), c = M(
589
- (o == null ? void 0 : o.reasoning_content) ?? (o == null ? void 0 : o.reasoning) ?? (t == null ? void 0 : t.reasoning_content) ?? (t == null ? void 0 : t.reasoning)
590
- );
591
- if (a && he(a)) throw new Error(a.trim());
592
- a && (e == null || e(a)), c && (r == null || r(c));
593
- const l = (o == null ? void 0 : o.tool_calls) ?? (o == null ? void 0 : o.toolCalls) ?? (t == null ? void 0 : t.tool_calls) ?? (t == null ? void 0 : t.toolCalls);
594
- (Array.isArray(l) ? l : l ? [l] : []).forEach((d) => {
595
- const u = fe(d);
596
- u && (s == null || s(u));
597
- });
598
- }
599
- async function pe(t, e, r, s) {
600
- if (!t.body) {
601
- R(await t.json(), e, r, s);
602
- return;
603
- }
604
- const n = t.body.getReader(), i = new TextDecoder();
605
- let o = "";
606
- try {
607
- for (; ; ) {
608
- const c = await n.read();
609
- if (c.done) break;
610
- o += i.decode(c.value, { stream: !0 });
611
- const l = o.split(/\r?\n/);
612
- o = l.pop() || "";
613
- for (const h of l) {
614
- const d = h.trim();
615
- if (!d.startsWith("data:")) continue;
616
- const u = d.slice(5).trim();
617
- if (!u || u === "[DONE]") continue;
618
- let p;
619
- try {
620
- p = JSON.parse(u);
621
- } catch {
622
- continue;
623
- }
624
- R(p, e, r, s);
537
+ function q(s, e) {
538
+ for (const [t, r] of Object.entries(s))
539
+ if (r != null) {
540
+ if (typeof r == "string") {
541
+ if (r.toLowerCase().includes(e))
542
+ return { matchValue: `${t}: ${r}`, matchContext: me(r, e) };
543
+ } else if (typeof r == "number" || typeof r == "boolean") {
544
+ const o = String(r);
545
+ if (o.toLowerCase().includes(e))
546
+ return { matchValue: `${t}: ${o}`, matchContext: o };
547
+ } else if (typeof r == "object" && !Array.isArray(r)) {
548
+ const o = q(r, e);
549
+ if (o) return o;
625
550
  }
626
551
  }
627
- const a = o.trim();
628
- if (a.startsWith("data:")) {
629
- const c = a.slice(5).trim();
630
- if (c && c !== "[DONE]") {
631
- let l;
632
- try {
633
- l = JSON.parse(c);
634
- } catch {
635
- l = void 0;
552
+ return null;
553
+ }
554
+ function Ve(s) {
555
+ return {
556
+ async search(e, t) {
557
+ var l, d;
558
+ const r = e.trim();
559
+ if (!r) return [];
560
+ const o = r.toLowerCase(), i = (t == null ? void 0 : t.maxResults) ?? fe, n = [], a = s();
561
+ for (const h of a) {
562
+ if (n.length >= i) break;
563
+ const c = ((d = (l = h.data) == null ? void 0 : l.metadata) == null ? void 0 : d.nodes) ?? [];
564
+ for (const u of c) {
565
+ if (n.length >= i) break;
566
+ const p = u.id ?? "", f = u.name ?? "", m = u.type ?? "";
567
+ if (f.toLowerCase().includes(o)) {
568
+ n.push({
569
+ chainId: h.id,
570
+ chainName: h.name,
571
+ nodeId: p,
572
+ nodeName: f,
573
+ nodeType: m,
574
+ matchField: "name",
575
+ matchValue: f
576
+ });
577
+ continue;
578
+ }
579
+ if (m.toLowerCase().includes(o)) {
580
+ n.push({
581
+ chainId: h.id,
582
+ chainName: h.name,
583
+ nodeId: p,
584
+ nodeName: f,
585
+ nodeType: m,
586
+ matchField: "type",
587
+ matchValue: m
588
+ });
589
+ continue;
590
+ }
591
+ if (u.configuration && typeof u.configuration == "object") {
592
+ const y = q(u.configuration, o);
593
+ y && n.push({
594
+ chainId: h.id,
595
+ chainName: h.name,
596
+ nodeId: p,
597
+ nodeName: f,
598
+ nodeType: m,
599
+ matchField: "configuration",
600
+ matchValue: y.matchValue,
601
+ matchContext: y.matchContext
602
+ });
603
+ }
636
604
  }
637
- l !== void 0 && R(l, e, r, s);
638
605
  }
606
+ return n;
639
607
  }
640
- } catch (a) {
641
- try {
642
- await n.cancel(a);
643
- } catch {
644
- }
645
- throw a;
646
- } finally {
647
- n.releaseLock();
608
+ };
609
+ }
610
+ function je(s) {
611
+ const e = String(s ?? "").trim();
612
+ if (e === "") return [];
613
+ let t;
614
+ try {
615
+ t = JSON.parse(e);
616
+ } catch {
617
+ return null;
648
618
  }
619
+ return t === null || typeof t != "object" || Array.isArray(t) ? null : Object.entries(t).map(([r, o]) => ({
620
+ key: r,
621
+ value: typeof o == "string" ? o : JSON.stringify(o)
622
+ }));
649
623
  }
650
- async function Fe(t) {
624
+ function Je(s) {
625
+ const e = {};
626
+ for (const t of s || []) {
627
+ const r = String((t == null ? void 0 : t.key) ?? "").trim();
628
+ r !== "" && (e[r] = ge(t == null ? void 0 : t.value));
629
+ }
630
+ return JSON.stringify(e);
631
+ }
632
+ function We(s) {
633
+ const e = String(s ?? "").trim();
634
+ if (e === "") return !0;
635
+ try {
636
+ const t = JSON.parse(e);
637
+ return t !== null && typeof t == "object" && !Array.isArray(t);
638
+ } catch {
639
+ return !1;
640
+ }
641
+ }
642
+ function ge(s) {
643
+ const e = String(s ?? "").trim();
644
+ if (e === "") return "";
645
+ try {
646
+ return JSON.parse(e);
647
+ } catch {
648
+ return String(s ?? "");
649
+ }
650
+ }
651
+ function O(s) {
652
+ return String((typeof s == "function" ? s() : s) || "").trim();
653
+ }
654
+ function ye(s) {
651
655
  var o;
652
- const e = String(t.endpoint || "").trim();
653
- if (!e) throw new Error("CopilotChat endpoint is not configured");
654
- const r = new Headers(t.headers || {});
655
- r.has("Content-Type") || r.set("Content-Type", "application/json");
656
- const s = {
657
- messages: t.messages,
658
- stream: t.stream !== !1
659
- };
660
- (o = t.model) != null && o.trim() && (s.model = t.model.trim());
661
- const n = {
662
- method: "POST",
663
- headers: r,
664
- body: JSON.stringify(s),
665
- signal: t.signal
666
- }, i = t.customFetch ? await t.customFetch(e, n) : await fetch(e, n);
667
- if (!i.ok) {
668
- const a = await i.text().catch(() => "");
669
- throw new Error(`HTTP ${i.status}${a ? `: ${a.slice(0, 500)}` : ""}`);
670
- }
671
- if (t.stream === !1) {
672
- R(await i.json(), t.onDelta, t.onReasoningDelta, t.onToolCallDelta);
673
- return;
674
- }
675
- await pe(i, t.onDelta, t.onReasoningDelta, t.onToolCallDelta);
676
- }
677
- const Ue = ["string", "number", "boolean", "object", "array"], Ke = ["string", "number", "boolean", "object"];
678
- function Be(t) {
679
- return Array.isArray(t) ? t.filter((e) => e && typeof e == "object" && !Array.isArray(e)).map((e) => ({ ...e })) : [];
680
- }
681
- function Ge(t = 1) {
656
+ const e = (o = s.chainId) == null ? void 0 : o.trim();
657
+ if (!e) return "";
658
+ const t = O(s.baseUrl).replace(/\/+$/, ""), r = (O(s.apiPrefix) || "/api/v1").replace(/^\/+|\/+$/g, "");
659
+ return `${t}${r ? `/${r}` : ""}/rules/${encodeURIComponent(e)}/v1/chat/completions`;
660
+ }
661
+ function Ye(s, e = {}) {
662
+ var i, n;
663
+ const t = ye(s);
664
+ if (!t) throw new Error("AIChat chainId is required");
665
+ const r = new Headers(e.headers);
666
+ r.set("X-Stream-Protocol", "agui"), r.delete("Authorization");
667
+ const o = (n = (i = s.getToken) == null ? void 0 : i.call(s)) == null ? void 0 : n.trim();
668
+ return o && r.set("Authorization", `Bearer ${o}`), { endpoint: t, init: { ...e, headers: r } };
669
+ }
670
+ const Xe = ["string", "number", "boolean", "object", "array"], Ze = ["string", "number", "boolean", "object"];
671
+ function Qe(s) {
672
+ return Array.isArray(s) ? s.filter((e) => e && typeof e == "object" && !Array.isArray(e)).map((e) => ({ ...e })) : [];
673
+ }
674
+ function et(s = 1) {
682
675
  return {
683
676
  name: "",
684
677
  title: "",
685
678
  description: "",
686
679
  type: "string",
687
- order: t,
680
+ order: s,
688
681
  required: !1,
689
682
  properties: [],
690
683
  itemsType: "string",
691
684
  itemsProperties: []
692
685
  };
693
686
  }
694
- function P(t) {
695
- const e = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = e.properties && typeof e.properties == "object" && !Array.isArray(e.properties) ? e.properties : {}, s = new Set(Array.isArray(e.required) ? e.required.map(String) : []);
696
- return Object.keys(r).map((n, i) => {
697
- var l;
698
- const o = r[n] || {}, a = String(o.type || "string"), c = String(((l = o.items) == null ? void 0 : l.type) || "string");
687
+ function P(s) {
688
+ const e = s && typeof s == "object" && !Array.isArray(s) ? s : {}, t = e.properties && typeof e.properties == "object" && !Array.isArray(e.properties) ? e.properties : {}, r = new Set(Array.isArray(e.required) ? e.required.map(String) : []);
689
+ return Object.keys(t).map((o, i) => {
690
+ var d;
691
+ const n = t[o] || {}, a = String(n.type || "string"), l = String(((d = n.items) == null ? void 0 : d.type) || "string");
699
692
  return {
700
- name: n,
701
- title: String(o.title || ""),
702
- description: String(o.description || ""),
693
+ name: o,
694
+ title: String(n.title || ""),
695
+ description: String(n.description || ""),
703
696
  type: a,
704
- order: Number.isFinite(Number(o.order)) ? Number(o.order) : i + 1,
705
- required: s.has(n),
706
- properties: a === "object" ? P(o) : [],
707
- itemsType: c,
708
- itemsProperties: a === "array" && c === "object" ? P(o.items) : []
697
+ order: Number.isFinite(Number(n.order)) ? Number(n.order) : i + 1,
698
+ required: r.has(o),
699
+ properties: a === "object" ? P(n) : [],
700
+ itemsType: l,
701
+ itemsProperties: a === "array" && l === "object" ? P(n.items) : []
709
702
  };
710
- }).sort((n, i) => Number(n.order || 0) - Number(i.order || 0));
703
+ }).sort((o, i) => Number(o.order || 0) - Number(i.order || 0));
711
704
  }
712
- function L(t) {
705
+ function L(s) {
713
706
  const e = { type: "object", properties: {}, required: [] };
714
- return t.filter((r) => r.name.trim()).sort((r, s) => Number(r.order || 0) - Number(s.order || 0)).forEach((r, s) => {
715
- const n = r.name.trim(), i = {
716
- type: r.type || "string",
717
- order: Number.isFinite(Number(r.order)) ? Number(r.order) : s + 1
707
+ return s.filter((t) => t.name.trim()).sort((t, r) => Number(t.order || 0) - Number(r.order || 0)).forEach((t, r) => {
708
+ const o = t.name.trim(), i = {
709
+ type: t.type || "string",
710
+ order: Number.isFinite(Number(t.order)) ? Number(t.order) : r + 1
718
711
  };
719
- if (r.title.trim() && (i.title = r.title.trim()), r.description.trim() && (i.description = r.description.trim()), r.type === "object") {
720
- const o = L(r.properties || []);
721
- i.properties = o.properties, o.required && (i.required = o.required);
712
+ if (t.title.trim() && (i.title = t.title.trim()), t.description.trim() && (i.description = t.description.trim()), t.type === "object") {
713
+ const n = L(t.properties || []);
714
+ i.properties = n.properties, n.required && (i.required = n.required);
722
715
  }
723
- if (r.type === "array" && (i.items = { type: r.itemsType || "string" }, i.items.type === "object")) {
724
- const o = L(r.itemsProperties || []);
725
- i.items.properties = o.properties, o.required && (i.items.required = o.required);
716
+ if (t.type === "array" && (i.items = { type: t.itemsType || "string" }, i.items.type === "object")) {
717
+ const n = L(t.itemsProperties || []);
718
+ i.items.properties = n.properties, n.required && (i.items.required = n.required);
726
719
  }
727
- e.properties[n] = i, r.required && e.required.push(n);
720
+ e.properties[o] = i, t.required && e.required.push(o);
728
721
  }), e.required.length === 0 && delete e.required, e;
729
722
  }
730
- function I(t) {
731
- return t.map((e) => ({
723
+ function x(s) {
724
+ return s.map((e) => ({
732
725
  ...e,
733
- properties: I(e.properties || []),
734
- itemsProperties: I(e.itemsProperties || [])
726
+ properties: x(e.properties || []),
727
+ itemsProperties: x(e.itemsProperties || [])
735
728
  }));
736
729
  }
737
- function He(t) {
738
- return t.map((e, r) => ({ ...e, order: r + 1 }));
730
+ function tt(s) {
731
+ return s.map((e, t) => ({ ...e, order: t + 1 }));
739
732
  }
740
- function me(t, e) {
741
- if (!e) return t;
742
- const r = e.split(".").filter(Boolean);
743
- let s = t, n;
744
- for (const i of r) {
733
+ function be(s, e) {
734
+ if (!e) return s;
735
+ const t = e.split(".").filter(Boolean);
736
+ let r = s, o;
737
+ for (const i of t) {
745
738
  if (i === "items") {
746
- s = (n == null ? void 0 : n.itemsProperties) || [];
739
+ r = (o == null ? void 0 : o.itemsProperties) || [];
747
740
  continue;
748
741
  }
749
- if (n = s[Number(i)], !n) return [];
750
- s = n.properties || [];
742
+ if (o = r[Number(i)], !o) return [];
743
+ r = o.properties || [];
751
744
  }
752
- return s;
745
+ return r;
753
746
  }
754
- function $e(t, e, r) {
755
- const s = I(t);
756
- return r(me(s, e)), s;
747
+ function st(s, e, t) {
748
+ const r = x(s);
749
+ return t(be(r, e)), r;
757
750
  }
758
- function je(t, e = "{}") {
759
- if (typeof t == "string") return t.trim() || e;
760
- if (t == null) return e;
751
+ function rt(s, e = "{}") {
752
+ if (typeof s == "string") return s.trim() || e;
753
+ if (s == null) return e;
761
754
  try {
762
- return JSON.stringify(t, null, 2);
755
+ return JSON.stringify(s, null, 2);
763
756
  } catch {
764
757
  return e;
765
758
  }
766
759
  }
767
- function ze(t, e = {}) {
768
- if (!t.trim()) return e;
769
- const r = JSON.parse(t);
770
- return r && typeof r == "object" && !Array.isArray(r) ? r : e;
760
+ function ot(s, e = {}) {
761
+ if (!s.trim()) return e;
762
+ const t = JSON.parse(s);
763
+ return t && typeof t == "object" && !Array.isArray(t) ? t : e;
771
764
  }
772
- function H(t) {
773
- if (!t || typeof t != "object") return null;
774
- const e = t, r = String(e.name || e.Name || e.tool_name || e.type || "").trim();
775
- if (!r) return null;
776
- const s = e.params_one_of || e.paramsOneOf || e.ParamsOneOf || e.parameters || e.schema || {}, n = (s == null ? void 0 : s.open_api_v3) || (s == null ? void 0 : s.openApiV3) || (s == null ? void 0 : s.OpenApiV3) || s;
765
+ function z(s) {
766
+ if (!s || typeof s != "object") return null;
767
+ const e = s, t = String(e.name || e.Name || e.tool_name || e.type || "").trim();
768
+ if (!t) return null;
769
+ const r = e.params_one_of || e.paramsOneOf || e.ParamsOneOf || e.parameters || e.schema || {}, o = (r == null ? void 0 : r.open_api_v3) || (r == null ? void 0 : r.openApiV3) || (r == null ? void 0 : r.OpenApiV3) || r;
777
770
  return {
778
- value: r,
779
- label: r,
771
+ value: t,
772
+ label: t,
780
773
  desc: String(e.desc || e.Desc || e.tool_desc || e.description || ""),
781
- parameters: n && typeof n == "object" && !Array.isArray(n) ? n : {},
774
+ parameters: o && typeof o == "object" && !Array.isArray(o) ? o : {},
782
775
  fields: Array.isArray(e.fields) ? e.fields : [],
783
776
  defaultGlobalDir: String(e.defaultGlobalDir || e.default_global_dir || ""),
784
- raw: t
777
+ raw: s
785
778
  };
786
779
  }
787
- function ge(t) {
788
- var s, n;
789
- const e = t && typeof t == "object" ? t : {}, r = (n = (s = e == null ? void 0 : e.builtins) == null ? void 0 : s["ai/tools"]) == null ? void 0 : n.tools;
790
- return Array.isArray(r) ? r.map(H).filter(Boolean) : [];
780
+ function Se(s) {
781
+ var r, o;
782
+ const e = s && typeof s == "object" ? s : {}, t = (o = (r = e == null ? void 0 : e.builtins) == null ? void 0 : r["ai/tools"]) == null ? void 0 : o.tools;
783
+ return Array.isArray(t) ? t.map(z).filter(Boolean) : [];
791
784
  }
792
- function Ve(...t) {
793
- for (const e of t) {
785
+ function it(...s) {
786
+ for (const e of s) {
794
787
  if (Array.isArray(e)) {
795
- const s = e.map(H).filter(Boolean);
796
- if (s.length > 0) return s;
788
+ const r = e.map(z).filter(Boolean);
789
+ if (r.length > 0) return r;
797
790
  }
798
- const r = ge(e);
799
- if (r.length > 0) return r;
791
+ const t = Se(e);
792
+ if (t.length > 0) return t;
800
793
  }
801
794
  return [];
802
795
  }
803
- function We(...t) {
804
- for (const e of t) {
796
+ function nt(...s) {
797
+ for (const e of s) {
805
798
  if (typeof e == "string" && e.trim()) return e;
806
799
  if (e && typeof e == "object") {
807
- const r = e.skillPath;
808
- if (typeof r == "string" && r.trim()) return r;
800
+ const t = e.skillPath;
801
+ if (typeof t == "string" && t.trim()) return t;
809
802
  }
810
803
  }
811
804
  return "";
812
805
  }
813
- const qe = "assets/images/logo.svg", Ye = "assets/images/favicon.svg", ye = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Huanban workflow logo">
806
+ const at = "assets/images/logo.svg", lt = "assets/images/favicon.svg", Te = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Huanban workflow logo">
814
807
  <defs>
815
808
  <linearGradient id="ink" x1="14" y1="8" x2="50" y2="56" gradientUnits="userSpaceOnUse">
816
809
  <stop offset="0" stop-color="#0f172a"/>
@@ -846,7 +839,7 @@ const qe = "assets/images/logo.svg", Ye = "assets/images/favicon.svg", ye = `<sv
846
839
  <circle cx="8.5" cy="32" r="2.4" fill="#f59e0b"/>
847
840
  <circle cx="15.4" cy="15.4" r="2.4" fill="#14b8a6"/>
848
841
  </g>
849
- </svg>`, be = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Huanban workflow icon">
842
+ </svg>`, Ee = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Huanban workflow icon">
850
843
  <defs>
851
844
  <linearGradient id="ink" x1="14" y1="8" x2="50" y2="56" gradientUnits="userSpaceOnUse">
852
845
  <stop offset="0" stop-color="#0f172a"/>
@@ -868,72 +861,79 @@ const qe = "assets/images/logo.svg", Ye = "assets/images/favicon.svg", ye = `<sv
868
861
  <path d="M17.5 32c3.6-7.5 8.5-11.2 14.5-11.2S43 24.5 46.5 32c-3.6 7.5-8.5 11.2-14.5 11.2S21 39.5 17.5 32Z" stroke="#2563eb" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" opacity=".78"/>
869
862
  <circle cx="17.5" cy="32" r="3.4" fill="#2563eb" stroke="#f8fafc" stroke-width="1.6"/>
870
863
  <circle cx="46.5" cy="32" r="3.4" fill="#14b8a6" stroke="#f8fafc" stroke-width="1.6"/>
871
- </svg>`, Je = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(ye)}`, Xe = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(be)}`;
872
- class Ee {
873
- constructor(e = z) {
874
- this.modelsCache = null, this.fetchPromise = null, this.fetchPromiseKey = null, this.lastFetchTime = 0, this.cacheKey = "", this.provider = e;
864
+ </svg>`, ct = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(Te)}`, dt = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(Ee)}`;
865
+ class Ce {
866
+ constructor(e = V, t = {}) {
867
+ var r;
868
+ this.modelsCache = null, this.fetchPromise = null, this.fetchPromiseKey = null, this.lastFetchTime = 0, this.cacheKey = "", this.provider = e, this.modelsPath = ((r = t.modelsPath) == null ? void 0 : r.trim()) || "", this.loader = t.loader;
875
869
  }
876
870
  /**
877
- * 获取可用大模型列表(带 60s 内存缓存与接口容灾探活)
871
+ * Load explicitly configured model metadata with a 60s in-memory cache.
878
872
  */
879
873
  async getAvailableModels() {
880
- const e = Date.now(), r = this.provider.isModelCacheEnabled(), s = this.provider.getCacheKey();
881
- if (!r)
874
+ if (!this.modelsPath && !this.loader)
875
+ return {
876
+ fallback: !0,
877
+ status: "unconfigured",
878
+ models: [],
879
+ error: "AI model discovery is not configured"
880
+ };
881
+ const e = Date.now(), t = this.provider.isModelCacheEnabled(), r = this.provider.getCacheKey();
882
+ if (!t)
882
883
  this.modelsCache = null, this.lastFetchTime = 0, this.cacheKey = "", this.fetchPromise = null, this.fetchPromiseKey = null;
883
- else if (this.modelsCache && this.cacheKey === s && e - this.lastFetchTime < 6e4)
884
+ else if (this.modelsCache && this.cacheKey === r && e - this.lastFetchTime < 6e4)
884
885
  return this.modelsCache;
885
- if (r && this.fetchPromise && this.fetchPromiseKey === s)
886
+ if (t && this.fetchPromise && this.fetchPromiseKey === r)
886
887
  return this.fetchPromise;
887
- const n = this.fetchAvailableModels(e, s, r);
888
- if (!r) return n;
888
+ const o = this.fetchAvailableModels(e, r, t);
889
+ if (!t) return o;
889
890
  let i;
890
- return i = n.finally(() => {
891
+ return i = o.finally(() => {
891
892
  this.fetchPromise === i && (this.fetchPromise = null, this.fetchPromiseKey = null);
892
- }), this.fetchPromise = i, this.fetchPromiseKey = s, i;
893
+ }), this.fetchPromise = i, this.fetchPromiseKey = r, i;
893
894
  }
894
- async fetchAvailableModels(e, r, s) {
895
+ async fetchAvailableModels(e, t, r) {
895
896
  try {
896
897
  if (!this.provider.getBaseUrl())
897
898
  throw new Error("API Base URL is not set");
898
- const i = new AbortController(), o = setTimeout(() => i.abort(), 3e3);
899
+ const i = new AbortController(), n = setTimeout(() => i.abort(), 3e3);
899
900
  let a = null;
900
901
  try {
901
- a = await this.provider.request("/api/v1/ai/models", {
902
- signal: i.signal
903
- });
902
+ a = this.loader ? await this.loader(this.provider.request.bind(this.provider), i.signal) : await this.provider.request(this.modelsPath, { signal: i.signal });
904
903
  } finally {
905
- clearTimeout(o);
904
+ clearTimeout(n);
906
905
  }
907
906
  if (!a || !a.ok) throw new Error(`HTTP Error ${(a == null ? void 0 : a.status) || "NO_RESPONSE"}`);
908
- const c = V(await a.json());
909
- return s && this.provider.isModelCacheEnabled() && this.provider.getCacheKey() === r && (this.modelsCache = c, this.lastFetchTime = e, this.cacheKey = r), c;
910
- } catch (n) {
911
- const i = n instanceof Error ? n.message : String(n || "AI 模型服务不可用");
912
- return console.warn("[AI Orchestration] AI 接口探测失败,大模型服务不可用", n), { fallback: !0, models: [], error: i };
907
+ const l = F(await a.json());
908
+ return r && this.provider.isModelCacheEnabled() && this.provider.getCacheKey() === t && (this.modelsCache = l, this.lastFetchTime = e, this.cacheKey = t), l;
909
+ } catch (o) {
910
+ const i = o instanceof Error ? o.message : String(o || "AI 模型服务不可用");
911
+ return console.warn("[AI Orchestration] AI 接口探测失败,大模型服务不可用", o), { fallback: !0, models: [], error: i };
913
912
  }
914
913
  }
915
914
  }
916
- const Ze = new Ee(), Se = 5, Te = 20, Ae = 1e3, Re = 16e3, xe = 1e4;
917
- function F(t, e) {
918
- return Number.isFinite(t) && t !== void 0 ? Math.max(0, Math.floor(t)) : e;
915
+ const ut = new Ce(), Ae = 5, Re = 20, we = 1e3, Ie = 16e3, xe = 1e4;
916
+ function U(s, e) {
917
+ return Number.isFinite(s) && s !== void 0 ? Math.max(0, Math.floor(s)) : e;
919
918
  }
920
- function _(t, e) {
921
- return Number.isFinite(t) && t !== void 0 ? Math.max(0, t) : e;
919
+ function I(s, e) {
920
+ return Number.isFinite(s) && s !== void 0 ? Math.max(0, s) : e;
922
921
  }
923
- class Qe {
922
+ class ht {
924
923
  /**
925
924
  * 构造函数
926
925
  * @param endpoint {string} WebSocket 服务端点 URL
927
926
  * @param onMessage {(msg: any) => void} 接收到服务端消息时的回调
928
927
  * @param onError {(err: any) => void} 出现异常或重连失败时的回调
929
928
  */
930
- constructor(e, r, s, n = {}) {
931
- this.endpoint = e, this.onMessage = r, this.onError = s, this.ws = null, this.pingInterval = null, this.reconnectTimer = null, this.reconnectAttempts = 0, this.lifetimeReconnectAttempts = 0, this.isStopped = !1, this.stableResetTimer = null, this.maxRetryReported = !1, this.isDestroyed = !1, this.options = {
932
- maxReconnectAttempts: F(n.maxReconnectAttempts, Se),
933
- maxLifetimeReconnectAttempts: F(n.maxLifetimeReconnectAttempts, Te),
934
- reconnectBaseDelayMs: _(n.reconnectBaseDelayMs, Ae),
935
- reconnectMaxDelayMs: _(n.reconnectMaxDelayMs, Re),
936
- stableResetDelayMs: _(n.stableResetDelayMs, xe)
929
+ constructor(e, t, r, o = {}) {
930
+ this.endpoint = e, this.onMessage = t, this.onError = r, this.ws = null, this.pingInterval = null, this.reconnectTimer = null, this.reconnectAttempts = 0, this.lifetimeReconnectAttempts = 0, this.isStopped = !1, this.stableResetTimer = null, this.maxRetryReported = !1, this.isDestroyed = !1, this.options = {
931
+ getToken: o.getToken,
932
+ maxReconnectAttempts: U(o.maxReconnectAttempts, Ae),
933
+ maxLifetimeReconnectAttempts: U(o.maxLifetimeReconnectAttempts, Re),
934
+ reconnectBaseDelayMs: I(o.reconnectBaseDelayMs, we),
935
+ reconnectMaxDelayMs: I(o.reconnectMaxDelayMs, Ie),
936
+ stableResetDelayMs: I(o.stableResetDelayMs, xe)
937
937
  };
938
938
  }
939
939
  /**
@@ -947,9 +947,9 @@ class Qe {
947
947
  this.clearReconnectTimer(), this.closeSocket();
948
948
  let e;
949
949
  try {
950
- e = new WebSocket(this.endpoint);
951
- } catch (r) {
952
- this.onError(r), this.handleReconnect();
950
+ e = new WebSocket(j(this.endpoint, this.options.getToken));
951
+ } catch (t) {
952
+ this.onError(t), this.handleReconnect();
953
953
  return;
954
954
  }
955
955
  this.ws = e, e.onopen = () => {
@@ -958,23 +958,23 @@ class Qe {
958
958
  }, this.options.stableResetDelayMs), this.pingInterval = setInterval(() => {
959
959
  this.ws === e && e.readyState === WebSocket.OPEN && e.send(JSON.stringify({ type: "ping" }));
960
960
  }, 15e3));
961
- }, e.onmessage = (r) => {
961
+ }, e.onmessage = (t) => {
962
962
  if (!(this.isDestroyed || this.isStopped || this.ws !== e))
963
963
  try {
964
- if (typeof r.data != "string") return;
965
- const s = W(r.data, {
966
- maxBytes: y.maxDebugItemChars,
964
+ if (typeof t.data != "string") return;
965
+ const r = J(t.data, {
966
+ maxBytes: b.maxDebugItemChars,
967
967
  label: "debug socket message"
968
968
  });
969
- if (s.type === "pong") return;
970
- this.onMessage(q(s));
971
- } catch (s) {
972
- console.warn("[DebugSocketClient] Failed to parse message", s);
969
+ if (r.type === "pong") return;
970
+ this.onMessage(W(r));
971
+ } catch (r) {
972
+ console.warn("[DebugSocketClient] Failed to parse message", r);
973
973
  }
974
974
  }, e.onclose = () => {
975
975
  this.ws === e && (this.ws = null, this.clearPingInterval(), this.clearStableResetTimer(), !this.isDestroyed && !this.isStopped && this.handleReconnect());
976
- }, e.onerror = (r) => {
977
- this.isDestroyed || this.isStopped || this.ws !== e || this.onError(r);
976
+ }, e.onerror = (t) => {
977
+ this.isDestroyed || this.isStopped || this.ws !== e || this.onError(t);
978
978
  };
979
979
  }
980
980
  /**
@@ -1030,16 +1030,297 @@ class Qe {
1030
1030
  this.isDestroyed = !0, this.isStopped = !0, this.clearReconnectTimer(), this.clearStableResetTimer(), this.closeSocket();
1031
1031
  }
1032
1032
  }
1033
- function Ce(t) {
1034
- if (!t) return 0;
1033
+ class _e extends Error {
1034
+ constructor(e, t, r) {
1035
+ super(e), this.name = "ExtendedApiError", this.status = t, this.url = r;
1036
+ }
1037
+ }
1038
+ class T {
1039
+ constructor(e) {
1040
+ this.apiBase = e.apiBase.replace(/\/+$/, ""), this.timeout = e.timeout ?? 8e3, this.authToken = e.authToken, this.fetchImpl = e.customFetch, this.credentials = e.credentials, this.headerSource = e.headers ?? {};
1041
+ }
1042
+ getHeaders() {
1043
+ const t = { "Content-Type": "application/json", ...typeof this.headerSource == "function" ? this.headerSource() : this.headerSource };
1044
+ return this.authToken && !Object.keys(t).some((r) => r.toLowerCase() === "authorization") && (t.Authorization = `Bearer ${this.authToken}`), t;
1045
+ }
1046
+ async request(e, t) {
1047
+ const r = new AbortController(), o = setTimeout(() => r.abort(), this.timeout), i = t == null ? void 0 : t.signal, n = () => r.abort();
1048
+ i && (i.aborted ? r.abort() : i.addEventListener("abort", n, { once: !0 }));
1049
+ const a = `${this.apiBase}${e}`, l = new Headers(this.getHeaders());
1050
+ new Headers((t == null ? void 0 : t.headers) || {}).forEach((h, c) => l.set(c, h));
1051
+ const d = {
1052
+ ...t,
1053
+ headers: l,
1054
+ signal: r.signal
1055
+ };
1056
+ d.credentials === void 0 && this.credentials !== void 0 && (d.credentials = this.credentials);
1057
+ try {
1058
+ const c = await (this.fetchImpl || fetch)(a, d);
1059
+ if (!c.ok) {
1060
+ const m = await c.text().catch(() => "");
1061
+ throw new _e(
1062
+ `API request failed [${c.status}]: ${m || c.statusText}`,
1063
+ c.status,
1064
+ a
1065
+ );
1066
+ }
1067
+ const u = await c.text();
1068
+ if (!u.trim()) return;
1069
+ const p = c.headers.get("content-type") || "";
1070
+ if (!(!p.trim() || p.split(";", 1)[0].trim().toLowerCase() === "application/json")) return u;
1071
+ try {
1072
+ return F(JSON.parse(u));
1073
+ } catch (m) {
1074
+ if (!p.trim() && m instanceof SyntaxError) return u;
1075
+ throw m;
1076
+ }
1077
+ } finally {
1078
+ clearTimeout(o), i == null || i.removeEventListener("abort", n);
1079
+ }
1080
+ }
1081
+ /** Return the configured API base URL. */
1082
+ getApiBase() {
1083
+ return this.apiBase;
1084
+ }
1085
+ }
1086
+ const ve = {
1087
+ components: "/marketplace/components",
1088
+ chains: "/marketplace/chains",
1089
+ dynamicComponents: "/dynamic-components"
1090
+ };
1091
+ class ft extends T {
1092
+ constructor(e) {
1093
+ super(e), this.routes = { ...ve, ...e.routes };
1094
+ }
1095
+ /** Search marketplace components. */
1096
+ async getComponents(e) {
1097
+ const t = new URLSearchParams({ checkMy: "true" });
1098
+ return e != null && e.keywords && t.set("keywords", e.keywords), (e == null ? void 0 : e.page) != null && t.set("page", String(e.page)), (e == null ? void 0 : e.size) != null && t.set("size", String(e.size)), this.request(`${this.routes.components}?${t}`);
1099
+ }
1100
+ /** Search marketplace chains. */
1101
+ async getChains(e) {
1102
+ const t = new URLSearchParams({ checkMy: "true" });
1103
+ return (e == null ? void 0 : e.root) != null && t.set("root", String(e.root)), e != null && e.keywords && t.set("keywords", e.keywords), (e == null ? void 0 : e.page) != null && t.set("page", String(e.page)), (e == null ? void 0 : e.size) != null && t.set("size", String(e.size)), this.request(`${this.routes.chains}?${t}`);
1104
+ }
1105
+ /** Install a dynamic component from marketplace. */
1106
+ async installComponent(e, t) {
1107
+ return this.request(`${this.routes.dynamicComponents}/${encodeURIComponent(e)}`, {
1108
+ method: "POST",
1109
+ body: JSON.stringify(t)
1110
+ });
1111
+ }
1112
+ /** Uninstall a dynamic component. */
1113
+ async uninstallComponent(e) {
1114
+ return this.request(`${this.routes.dynamicComponents}/${encodeURIComponent(e)}`, {
1115
+ method: "DELETE"
1116
+ });
1117
+ }
1118
+ /** Get the DSL definition for a dynamic component. */
1119
+ async getComponentDSL(e) {
1120
+ return this.request(`${this.routes.dynamicComponents}/${encodeURIComponent(e)}`);
1121
+ }
1122
+ }
1123
+ const Ne = {
1124
+ agentPrompt: (s) => `/system/agents/${encodeURIComponent(s)}/prompt`,
1125
+ agentModel: (s) => `/system/agents/${encodeURIComponent(s)}/model`
1126
+ }, M = "_assistant";
1127
+ class pt extends T {
1128
+ constructor(e) {
1129
+ super(e), this.routes = { ...Ne, ...e.routes };
1130
+ }
1131
+ /** Get the system prompt for an agent. */
1132
+ async getPrompt(e = M) {
1133
+ const t = await this.request(this.routes.agentPrompt(e));
1134
+ return typeof t == "string" ? t : (t == null ? void 0 : t.content) ?? "";
1135
+ }
1136
+ /** Update the system prompt for an agent. */
1137
+ async updatePrompt(e, t) {
1138
+ await this.request(this.routes.agentPrompt(e), {
1139
+ method: "POST",
1140
+ body: JSON.stringify({ content: t })
1141
+ });
1142
+ }
1143
+ /** Get the model configuration for an agent. */
1144
+ async getModel(e = M) {
1145
+ return this.request(this.routes.agentModel(e));
1146
+ }
1147
+ /** Update the model configuration for an agent. */
1148
+ async updateModel(e, t, r) {
1149
+ const o = { model: t };
1150
+ r !== void 0 && (o.provider = r), await this.request(this.routes.agentModel(e), {
1151
+ method: "POST",
1152
+ body: JSON.stringify(o)
1153
+ });
1154
+ }
1155
+ }
1156
+ const ke = {
1157
+ list: "/skills",
1158
+ detail: (s) => `/skills/${encodeURIComponent(s)}`,
1159
+ create: "/skills",
1160
+ update: (s) => `/skills/${encodeURIComponent(s)}`,
1161
+ remove: (s) => `/skills/${encodeURIComponent(s)}`,
1162
+ upload: "/skills/upload"
1163
+ };
1164
+ class mt extends T {
1165
+ constructor(e) {
1166
+ super(e), this.routes = { ...ke, ...e.routes };
1167
+ }
1168
+ /** List all skills, optionally filtered by scope. */
1169
+ async list(e = "global") {
1170
+ const t = new URLSearchParams({ scope: e });
1171
+ return this.request(`${this.routes.list}?${t}`);
1172
+ }
1173
+ /** Get the detail definition of a skill. */
1174
+ async getDetail(e, t = "global") {
1175
+ const r = new URLSearchParams({ scope: t });
1176
+ return this.request(`${this.routes.detail(e)}?${r}`);
1177
+ }
1178
+ /** Create a new skill. */
1179
+ async create(e) {
1180
+ await this.request(this.routes.create, {
1181
+ method: "POST",
1182
+ body: JSON.stringify(e)
1183
+ });
1184
+ }
1185
+ /** Update an existing skill by name. */
1186
+ async update(e, t) {
1187
+ await this.request(this.routes.update(e), {
1188
+ method: "PUT",
1189
+ body: JSON.stringify(t)
1190
+ });
1191
+ }
1192
+ /** Delete a skill by name. */
1193
+ async delete(e, t = "global") {
1194
+ const r = new URLSearchParams({ scope: t });
1195
+ await this.request(`${this.routes.remove(e)}?${r}`, {
1196
+ method: "DELETE"
1197
+ });
1198
+ }
1199
+ /**
1200
+ * Upload a skill archive (zip).
1201
+ *
1202
+ * Note: this method sends multipart/form-data. The base Content-Type header
1203
+ * is intentionally overridden so the browser sets the correct boundary.
1204
+ */
1205
+ async upload(e, t = "global") {
1206
+ const r = new FormData();
1207
+ r.append("file", e);
1208
+ const o = new URLSearchParams({ scope: t });
1209
+ return this.request(`${this.routes.upload}?${o}`, {
1210
+ method: "POST",
1211
+ body: r,
1212
+ headers: {
1213
+ // Remove the default application/json; let the browser set multipart boundary
1214
+ "Content-Type": ""
1215
+ }
1216
+ });
1217
+ }
1218
+ }
1219
+ const De = {
1220
+ list: "/iot/point-templates",
1221
+ detail: (s) => `/iot/point-templates/${encodeURIComponent(s)}`,
1222
+ create: "/iot/point-templates",
1223
+ update: (s) => `/iot/point-templates/${encodeURIComponent(s)}`,
1224
+ remove: (s) => `/iot/point-templates/${encodeURIComponent(s)}`
1225
+ };
1226
+ class gt extends T {
1227
+ constructor(e) {
1228
+ super(e), this.routes = { ...De, ...e.routes };
1229
+ }
1230
+ /** List point templates, optionally filtered by protocol and category. */
1231
+ async list(e) {
1232
+ const t = new URLSearchParams();
1233
+ e != null && e.protocol && t.set("protocol", e.protocol), e != null && e.category && t.set("category", e.category);
1234
+ const r = t.toString();
1235
+ return this.request(`${this.routes.list}${r ? `?${r}` : ""}`);
1236
+ }
1237
+ /** Get a single point template by ID. */
1238
+ async get(e) {
1239
+ return this.request(this.routes.detail(e));
1240
+ }
1241
+ /** Create a new point template. */
1242
+ async create(e) {
1243
+ return this.request(this.routes.create, {
1244
+ method: "POST",
1245
+ body: JSON.stringify(e)
1246
+ });
1247
+ }
1248
+ /** Update an existing point template. */
1249
+ async update(e, t) {
1250
+ await this.request(this.routes.update(e), {
1251
+ method: "PUT",
1252
+ body: JSON.stringify(t)
1253
+ });
1254
+ }
1255
+ /** Delete a point template by ID. */
1256
+ async delete(e) {
1257
+ await this.request(this.routes.remove(e), {
1258
+ method: "DELETE"
1259
+ });
1260
+ }
1261
+ }
1262
+ const Oe = {
1263
+ login: "/login",
1264
+ currentUser: "/users/me",
1265
+ users: "/users",
1266
+ deleteUser: (s) => `/users/${encodeURIComponent(s)}`,
1267
+ ruleCategories: "/category/rule"
1268
+ };
1269
+ class yt extends T {
1270
+ constructor(e) {
1271
+ super(e), this.routes = { ...Oe, ...e.routes };
1272
+ }
1273
+ /** Authenticate with username and password. */
1274
+ async login(e, t) {
1275
+ return this.request(this.routes.login, {
1276
+ method: "POST",
1277
+ body: JSON.stringify({ username: e, password: t })
1278
+ });
1279
+ }
1280
+ /** Get the currently authenticated user. */
1281
+ async getCurrentUser() {
1282
+ return this.request(this.routes.currentUser);
1283
+ }
1284
+ /** List all users (admin only). */
1285
+ async getUsers() {
1286
+ return this.request(this.routes.users);
1287
+ }
1288
+ /**
1289
+ * Create or update a user.
1290
+ * If the username already exists, the user is updated.
1291
+ * When creating: password is required; apiKey and roles can be omitted.
1292
+ */
1293
+ async saveUser(e) {
1294
+ await this.request(this.routes.users, {
1295
+ method: "POST",
1296
+ body: JSON.stringify(e)
1297
+ });
1298
+ }
1299
+ /**
1300
+ * Delete a user by username.
1301
+ * @param purge - if true, also removes the user's data directory.
1302
+ */
1303
+ async deleteUser(e, t = !1) {
1304
+ const r = t ? "?purge=true" : "";
1305
+ await this.request(`${this.routes.deleteUser(e)}${r}`, {
1306
+ method: "DELETE"
1307
+ });
1308
+ }
1309
+ /** Get rule chain category enumeration. */
1310
+ async getRuleCategories() {
1311
+ return this.request(this.routes.ruleCategories);
1312
+ }
1313
+ }
1314
+ function Pe(s) {
1315
+ if (!s) return 0;
1035
1316
  let e = 0;
1036
- for (let r = 0; r < t.length; r++) {
1037
- const s = t.charCodeAt(r);
1038
- s >= 0 && s <= 128 ? e += 1 : e += 2;
1317
+ for (let t = 0; t < s.length; t++) {
1318
+ const r = s.charCodeAt(t);
1319
+ r >= 0 && r <= 128 ? e += 1 : e += 2;
1039
1320
  }
1040
1321
  return e;
1041
1322
  }
1042
- class w extends Y {
1323
+ class _ extends X {
1043
1324
  /**
1044
1325
  * 初始化并设置节点的基本属性
1045
1326
  *
@@ -1047,11 +1328,11 @@ class w extends Y {
1047
1328
  * - 设定最小兜底宽度,防止越界
1048
1329
  */
1049
1330
  setAttributes() {
1050
- var s, n;
1331
+ var r, o;
1051
1332
  super.setAttributes();
1052
- const e = String(((s = this.text) == null ? void 0 : s.value) || ((n = this.properties) == null ? void 0 : n.name) || "");
1053
- let r = 30 + Ce(e) * 9;
1054
- r < 200 && (r = 200), this.width = r, this.height = 60, this.radius = 8;
1333
+ const e = String(((r = this.text) == null ? void 0 : r.value) || ((o = this.properties) == null ? void 0 : o.name) || "");
1334
+ let t = 30 + Pe(e) * 9;
1335
+ t < 200 && (t = 200), this.width = t, this.height = 60, this.radius = 8;
1055
1336
  }
1056
1337
  /**
1057
1338
  * 覆写 LogicFlow 原生的源点连线规则 (从本节点拉出的线)
@@ -1062,16 +1343,16 @@ class w extends Y {
1062
1343
  * @returns {Array} 规则数组
1063
1344
  */
1064
1345
  getConnectedSourceRules() {
1065
- const e = super.getConnectedSourceRules(), r = (s) => this.graphModel.getNodeModelById(s);
1346
+ const e = super.getConnectedSourceRules(), t = (r) => this.graphModel.getNodeModelById(r);
1066
1347
  return e.push({
1067
1348
  message: "端点节点不能作为起点连线",
1068
- validate: (s, n) => !this.properties.notInput
1349
+ validate: (r, o) => !this.properties.notInput
1069
1350
  }), e.push({
1070
1351
  message: "外部节点不允许连接组内节点",
1071
- validate: (s, n) => {
1072
- var c, l, h, d, u, p;
1073
- const i = r(n.id), o = (h = (l = (c = s.properties) == null ? void 0 : c.model) == null ? void 0 : l.additionalInfo) == null ? void 0 : h.parentGroupId, a = (p = (u = (d = i == null ? void 0 : i.properties) == null ? void 0 : d.model) == null ? void 0 : u.additionalInfo) == null ? void 0 : p.parentGroupId;
1074
- return !(!o && a || o && !a || o && a && o !== a);
1352
+ validate: (r, o) => {
1353
+ var l, d, h, c, u, p;
1354
+ const i = t(o.id), n = (h = (d = (l = r.properties) == null ? void 0 : l.model) == null ? void 0 : d.additionalInfo) == null ? void 0 : h.parentGroupId, a = (p = (u = (c = i == null ? void 0 : i.properties) == null ? void 0 : c.model) == null ? void 0 : u.additionalInfo) == null ? void 0 : p.parentGroupId;
1355
+ return !(!n && a || n && !a || n && a && n !== a);
1075
1356
  }
1076
1357
  }), e;
1077
1358
  }
@@ -1086,11 +1367,11 @@ class w extends Y {
1086
1367
  const e = super.getConnectedTargetRules();
1087
1368
  return e.push({
1088
1369
  message: "该节点不允许作为目标连线",
1089
- validate: (r, s) => !0
1370
+ validate: (t, r) => !0
1090
1371
  }), e;
1091
1372
  }
1092
1373
  }
1093
- class et extends w {
1374
+ class bt extends _ {
1094
1375
  /**
1095
1376
  * 初始化节点属性
1096
1377
  * 设定固定宽高,并注入特殊的锚点偏移位置 (anchorsOffset)。
@@ -1116,18 +1397,18 @@ class et extends w {
1116
1397
  * @returns 返回 6 个固定的锚点定义 (包含 4 个禁止添加连线的辅助配置锚点)
1117
1398
  */
1118
1399
  getDefaultAnchor() {
1119
- const { x: e, y: r, id: s } = this, { width: n, height: i } = this;
1400
+ const { x: e, y: t, id: r } = this, { width: o, height: i } = this;
1120
1401
  return [
1121
- { x: e - n / 2, y: r, type: "left", id: `${s}_left` },
1122
- { x: e + n / 2, y: r, type: "right", id: `${s}_right` },
1123
- { x: e - 40, y: r + i / 2, type: "bottom", id: `${s}_llm`, edgeAddable: !1 },
1124
- { x: e - 10, y: r + i / 2, type: "bottom", id: `${s}_tools`, edgeAddable: !1 },
1125
- { x: e + 20, y: r + i / 2, type: "bottom", id: `${s}_memory`, edgeAddable: !1 },
1126
- { x: e + 50, y: r + i / 2, type: "bottom", id: `${s}_knowledge`, edgeAddable: !1 }
1402
+ { x: e - o / 2, y: t, type: "left", id: `${r}_left` },
1403
+ { x: e + o / 2, y: t, type: "right", id: `${r}_right` },
1404
+ { x: e - 40, y: t + i / 2, type: "bottom", id: `${r}_llm`, edgeAddable: !1 },
1405
+ { x: e - 10, y: t + i / 2, type: "bottom", id: `${r}_tools`, edgeAddable: !1 },
1406
+ { x: e + 20, y: t + i / 2, type: "bottom", id: `${r}_memory`, edgeAddable: !1 },
1407
+ { x: e + 50, y: t + i / 2, type: "bottom", id: `${r}_knowledge`, edgeAddable: !1 }
1127
1408
  ];
1128
1409
  }
1129
1410
  }
1130
- class tt extends w {
1411
+ class St extends _ {
1131
1412
  constructor() {
1132
1413
  super(...arguments), this.isGroup = !0, this.children = /* @__PURE__ */ new Set(), this.isFolded = !1;
1133
1414
  }
@@ -1171,7 +1452,7 @@ class tt extends w {
1171
1452
  this.isFolded;
1172
1453
  }
1173
1454
  }
1174
- class rt extends w {
1455
+ class Tt extends _ {
1175
1456
  /**
1176
1457
  * 初始化节点默认宽高
1177
1458
  */
@@ -1186,266 +1467,357 @@ class rt extends w {
1186
1467
  const e = super.getConnectedSourceRules();
1187
1468
  return e.push({
1188
1469
  message: "Switch节点连出必须附带分支条件",
1189
- validate: (r, s) => !0
1470
+ validate: (t, r) => !0
1190
1471
  }), e;
1191
1472
  }
1192
1473
  }
1193
1474
  export {
1194
- Ee as AIManager,
1195
- nt as ActionRegistry,
1196
- et as AgentOrchestrationNodeModel,
1197
- mr as ApiProvider,
1198
- w as BaseNodeModel,
1199
- ot as BatchCommand,
1200
- at as CAPABILITY_BASE,
1201
- ct as CAPABILITY_PROFILES,
1202
- lt as ComponentCatalogCache,
1203
- dt as ComponentDocService,
1204
- ut as ComponentRegistry,
1205
- gr as ConnectionStatusController,
1206
- yr as ConnectionStatusStore,
1207
- br as DEFAULT_AI_PROVIDERS,
1208
- Er as DEFAULT_COMPONENT_CATEGORY_ORDER,
1209
- Sr as DEFAULT_EDITOR_DOCK_STATE,
1210
- ht as DEFAULT_EDITOR_OPEN_PANEL_IDS,
1211
- ft as DEFAULT_EDITOR_PANELS,
1212
- Yi as DEFAULT_ICON_URL,
1213
- pt as DEFAULT_NODE_CONFIG_DOCK_WIDTH,
1214
- Tr as DEFAULT_ROUTES,
1215
- Qs as DEFAULT_RUNTIME_FIELD_MAX_DEPTH,
1216
- ei as DEFAULT_RUNTIME_FIELD_MAX_PATHS,
1217
- ti as DEFAULT_RUNTIME_FIELD_SAMPLE_LENGTH,
1475
+ pt as AIAssistantAPI,
1476
+ Ce as AIManager,
1477
+ M as AI_ASSISTANT_DEFAULT_AGENT_ID,
1478
+ At as ActionRegistry,
1479
+ bt as AgentOrchestrationNodeModel,
1480
+ ws as ApiProvider,
1481
+ _ as BaseNodeModel,
1482
+ Rt as BatchCommand,
1483
+ Bo as CAPABILITY_BASE,
1484
+ Go as CAPABILITY_PROFILES,
1485
+ wt as ComponentCatalogCache,
1486
+ It as ComponentDocService,
1487
+ xt as ComponentRegistry,
1488
+ ki as ConnectionStatusController,
1489
+ Di as ConnectionStatusStore,
1490
+ Er as DEFAULT_AI_PROVIDERS,
1491
+ Cr as DEFAULT_COMPONENT_CATEGORY_ORDER,
1492
+ qo as DEFAULT_EDITOR_DOCK_STATE,
1493
+ _t as DEFAULT_EDITOR_OPEN_PANEL_IDS,
1494
+ vt as DEFAULT_EDITOR_PANELS,
1495
+ Hn as DEFAULT_ICON_URL,
1496
+ Nt as DEFAULT_KEYMAP,
1497
+ kt as DEFAULT_NODE_CONFIG_DOCK_WIDTH,
1498
+ Is as DEFAULT_ROUTES,
1499
+ Ms as DEFAULT_RUNTIME_FIELD_MAX_DEPTH,
1500
+ Fs as DEFAULT_RUNTIME_FIELD_MAX_PATHS,
1501
+ $s as DEFAULT_RUNTIME_FIELD_SAMPLE_LENGTH,
1218
1502
  Ar as DEFAULT_VIRTUAL_WINDOW_ITEM_HEIGHT,
1219
1503
  Rr as DEFAULT_VIRTUAL_WINDOW_OVERSCAN,
1220
- xr as DEFAULT_VIRTUAL_WINDOW_THRESHOLD,
1221
- Cr as DEFAULT_VIRTUAL_WINDOW_VIEWPORT_HEIGHT,
1222
- mt as DataAdapter,
1223
- Qe as DebugSocketClient,
1224
- gt as DiagnosticService,
1225
- Mi as EDITOR_OVERLAY_LAYERS,
1226
- Pi as EDITOR_OVERLAY_LAYER_CSS_TEXT,
1227
- Li as EDITOR_OVERLAY_LAYER_CSS_VARIABLES,
1228
- yt as EDITOR_VERSION,
1229
- J as EXPLORER_SECTION_ROOT,
1230
- X as EXPLORER_SECTION_SUB,
1231
- bt as EditorCore,
1232
- _r as EditorDockStore,
1233
- Et as EditorPanelRegistry,
1234
- St as EditorTestCasesStore,
1235
- Tt as EditorWorkspace,
1236
- At as EventBus,
1237
- ke as ExplorerTreeStore,
1238
- Rt as FieldCapabilityRegistry,
1239
- ri as FieldChangeHandlerNotFoundError,
1240
- si as FieldChangeRegistry,
1241
- tt as GroupNodeModel,
1242
- Xe as HUANBAN_FAVICON_DATA_URI,
1243
- be as HUANBAN_FAVICON_SVG,
1244
- Ye as HUANBAN_FAVICON_SVG_PATH,
1245
- Je as HUANBAN_LOGO_DATA_URI,
1246
- ye as HUANBAN_LOGO_SVG,
1247
- qe as HUANBAN_LOGO_SVG_PATH,
1248
- xt as HUANBAN_RULEGO_EDITOR_VERSION,
1249
- Ct as HistoryManager,
1250
- _t as HuanbanRulegoEditor,
1251
- Ir as I18nManager,
1252
- It as OptionSourceRegistry,
1253
- y as RUNTIME_LIMITS,
1254
- wr as RuleChainAPI,
1255
- Nr as RuleChainApiError,
1256
- m as RuleChainValidator,
1257
- ii as RuntimeFieldDictionary,
1504
+ wr as DEFAULT_VIRTUAL_WINDOW_THRESHOLD,
1505
+ Ir as DEFAULT_VIRTUAL_WINDOW_VIEWPORT_HEIGHT,
1506
+ Dt as DataAdapter,
1507
+ ht as DebugSocketClient,
1508
+ Ot as DefaultIdentityProvider,
1509
+ Pt as DiagnosticService,
1510
+ Nn as EDITOR_OVERLAY_LAYERS,
1511
+ kn as EDITOR_OVERLAY_LAYER_CSS_TEXT,
1512
+ Dn as EDITOR_OVERLAY_LAYER_CSS_VARIABLES,
1513
+ Lt as EDITOR_REGION_IDS,
1514
+ Ut as EDITOR_VERSION,
1515
+ Z as EXPLORER_SECTION_ROOT,
1516
+ Q as EXPLORER_SECTION_SUB,
1517
+ Mt as EditorCore,
1518
+ zo as EditorDockStore,
1519
+ Ft as EditorPanelRegistry,
1520
+ $t as EditorTestCasesStore,
1521
+ Kt as EditorWorkspace,
1522
+ Bt as EventBus,
1523
+ qe as ExplorerTreeStore,
1524
+ T as ExtendedApiBase,
1525
+ _e as ExtendedApiError,
1526
+ Gt as FieldCapabilityRegistry,
1527
+ Ks as FieldChangeHandlerNotFoundError,
1528
+ Bs as FieldChangeRegistry,
1529
+ xr as GLOBAL_CONFIG_MASK,
1530
+ Oi as GlobalConfigAPI,
1531
+ Pi as GlobalConfigApiError,
1532
+ _r as GlobalConfigError,
1533
+ St as GroupNodeModel,
1534
+ dt as HUANBAN_FAVICON_DATA_URI,
1535
+ Ee as HUANBAN_FAVICON_SVG,
1536
+ lt as HUANBAN_FAVICON_SVG_PATH,
1537
+ ct as HUANBAN_LOGO_DATA_URI,
1538
+ Te as HUANBAN_LOGO_SVG,
1539
+ at as HUANBAN_LOGO_SVG_PATH,
1540
+ qt as HUANBAN_RULEGO_EDITOR_VERSION,
1541
+ zt as HistoryManager,
1542
+ Ht as HuanbanRulegoEditor,
1543
+ vr as I18nManager,
1544
+ gt as IoTPointTemplateAPI,
1545
+ ft as MarketplaceAPI,
1546
+ Vt as OptionSourceRegistry,
1547
+ jt as PropertyControlRegistry,
1548
+ b as RUNTIME_LIMITS,
1549
+ xs as RuleChainAPI,
1550
+ _s as RuleChainApiError,
1551
+ g as RuleChainValidator,
1552
+ Jt as RuleChainVersionsAPI,
1553
+ Li as RuleChainVersionsError,
1554
+ Gs as RuntimeFieldDictionary,
1258
1555
  v as RuntimeLimitError,
1259
- ni as SIMPLE_ARRAY_DELIMITER,
1260
- vr as ServerStatusStore,
1261
- j as StateStore,
1262
- rt as SwitchNodeModel,
1263
- wt as THEME_BLUE,
1264
- Nt as THEME_DARK,
1265
- vt as THEME_LIGHT,
1266
- Fi as THEME_PRESETS,
1267
- Ke as TOOL_SCHEMA_ITEM_TYPES,
1268
- Ue as TOOL_SCHEMA_TYPES,
1269
- kt as ThemeManager,
1270
- Dt as ValidationEngine,
1271
- Ot as adapterComponents,
1556
+ qs as SIMPLE_ARRAY_DELIMITER,
1557
+ Nr as SUBGROUPED_COMPONENT_CATEGORIES,
1558
+ vs as ServerStatusStore,
1559
+ mt as SkillsAPI,
1560
+ H as StateStore,
1561
+ Tt as SwitchNodeModel,
1562
+ Ui as THEME_BLUE,
1563
+ Mi as THEME_DARK,
1564
+ Fi as THEME_LIGHT,
1565
+ On as THEME_PRESETS,
1566
+ Ze as TOOL_SCHEMA_ITEM_TYPES,
1567
+ Xe as TOOL_SCHEMA_TYPES,
1568
+ $i as ThemeManager,
1569
+ yt as UserAPI,
1570
+ Ho as ValidationEngine,
1571
+ Wt as adapterComponents,
1272
1572
  kr as adapterComponentsLocal,
1273
1573
  Dr as adapterRuntimeComponent,
1274
- Ze as aiManager,
1275
- Mt as alignGraphNodes,
1276
- z as apiProvider,
1277
- Pt as applyComponentsRuntimePayloadOptions,
1278
- Or as assertComponentsWithinLimits,
1279
- Mr as assertGraphWithinLimits,
1280
- Pr as assertObjectDepth,
1281
- Lr as assertTextWithinBytes,
1282
- Fr as bindCopilotCodeInteractions,
1283
- Ur as buildComponentPalette,
1284
- Kr as buildDefaultConfiguration,
1285
- Br as buildEditorChatHistoryKey,
1286
- Gr as buildEditorPersistenceKey,
1287
- T as buildExplorerTree,
1288
- Hr as buildFieldAttachments,
1289
- Lt as buildOptionSourceRequestKey,
1290
- $r as calculateVirtualWindow,
1291
- Ft as clampContextMenuPosition,
1292
- jr as clearEditorChatHistory,
1293
- zr as cloneConfiguration,
1294
- Ut as cloneGraphSelection,
1295
- Vr as cloneNodePropertiesForCopy,
1296
- I as cloneSchemaRows,
1297
- Kt as closeEditorTour,
1298
- oi as coerceTableCellValue,
1299
- Bt as componentCatalogCache,
1300
- Wr as confirmDrawerUnsavedClose,
1301
- Ne as createDebugPanelRequestSnapshot,
1302
- ai as createEmptyTableRow,
1303
- Gt as createRuleChainSaveFingerprint,
1304
- ci as cronPresetToRuleGoCron,
1305
- qr as debugLog,
1306
- li as decodeTableRowsForEditing,
1307
- ji as defaultComponents,
1308
- Ht as defaultIdGenerator,
1309
- Yr as deriveWsUrl,
1310
- $t as distributeGraphNodes,
1311
- Ge as emptySchemaEditorRow,
1312
- di as encodeTableRowsForStorage,
1313
- Jr as escapeAttr,
1314
- Xr as escapeHtml,
1315
- Zr as evaluateFieldDependency,
1316
- b as expandedExplorerKeys,
1317
- se as explorerAncestorKeys,
1318
- ge as extractBuiltinToolOptionsFromPayload,
1319
- Qr as extractMsgFields,
1320
- es as extractMsgTypes,
1321
- ts as extractRunMessageFields,
1322
- rs as extractRunMessageTypes,
1323
- ui as extractRuntimeFieldPaths,
1324
- Me as filterCopilotSuccessfulTurns,
1325
- hi as findDuplicateRowValues,
1326
- ie as findExplorerNode,
1327
- ss as formatJsonBounded,
1328
- is as formatMapEntryValue,
1329
- fi as generatePointRows,
1574
+ ut as aiManager,
1575
+ Vo as alignGraphNodes,
1576
+ V as apiProvider,
1577
+ Or as applyComponentLocaleMetadata,
1578
+ Yt as applyComponentsRuntimePayloadOptions,
1579
+ Ki as assertComponentsWithinLimits,
1580
+ Bi as assertGraphWithinLimits,
1581
+ Gi as assertObjectDepth,
1582
+ qi as assertTextWithinBytes,
1583
+ zi as awaitVersionRequest,
1584
+ zs as bindAnchoredPopover,
1585
+ jo as bindCopilotCodeInteractions,
1586
+ Pr as buildComponentPalette,
1587
+ Lr as buildDefaultConfiguration,
1588
+ Jo as buildEditorChatHistoryKey,
1589
+ Wo as buildEditorPersistenceKey,
1590
+ A as buildExplorerTree,
1591
+ Ur as buildFieldAttachments,
1592
+ Xt as buildOptionSourceRequestKey,
1593
+ Hi as buildRunWaterfall,
1594
+ Mr as calculateVirtualWindow,
1595
+ Zt as clampContextMenuPosition,
1596
+ Vi as cleanSnapshot,
1597
+ ji as cleanSnapshotString,
1598
+ Yo as clearEditorChatHistory,
1599
+ Ns as clearToken,
1600
+ Fr as cloneConfiguration,
1601
+ Xo as cloneGraphSelection,
1602
+ $r as cloneNodePropertiesForCopy,
1603
+ x as cloneSchemaRows,
1604
+ Qt as closeEditorTour,
1605
+ Hs as coerceTableCellValue,
1606
+ es as componentCatalogCache,
1607
+ Ji as confirmDrawerUnsavedClose,
1608
+ Be as createDebugPanelRequestSnapshot,
1609
+ Wi as createDefaultDialogProvider,
1610
+ ts as createDefaultIdentityProvider,
1611
+ Yi as createDirtySuppression,
1612
+ Vs as createEmptyTableRow,
1613
+ Kr as createGlobalConfigPatch,
1614
+ Br as createGlobalConfigRows,
1615
+ Ve as createLocalGlobalSearch,
1616
+ Xi as createRuleChainSaveFingerprint,
1617
+ Zi as createRuleChainVersionsController,
1618
+ Qi as createRunAnalysis,
1619
+ en as createRunComparePanel,
1620
+ tn as createRunWaterfall,
1621
+ sn as createSharedNodeManager,
1622
+ js as createVariableCompletionSource,
1623
+ ss as createVersionHistory,
1624
+ Js as cronPresetToRuleGoCron,
1625
+ Gr as debugLog,
1626
+ Ws as decodeTableRowsForEditing,
1627
+ Kn as defaultComponents,
1628
+ rs as defaultIdGenerator,
1629
+ ks as deriveWsUrl,
1630
+ rn as diffChains,
1631
+ on as diffJsonPaths,
1632
+ nn as diffRuns,
1633
+ Zo as distributeGraphNodes,
1634
+ et as emptySchemaEditorRow,
1635
+ Ys as encodeTableRowsForStorage,
1636
+ qr as escapeAttr,
1637
+ zr as escapeHtml,
1638
+ Hr as evaluateFieldDependency,
1639
+ S as expandedExplorerKeys,
1640
+ ie as explorerAncestorKeys,
1641
+ Qo as extractAssistantRuleChain,
1642
+ Se as extractBuiltinToolOptionsFromPayload,
1643
+ ei as extractMsgFields,
1644
+ ti as extractMsgTypes,
1645
+ si as extractRuleChainFromToolCalls,
1646
+ ri as extractRunMessageFields,
1647
+ oi as extractRunMessageTypes,
1648
+ Xs as extractRuntimeFieldPaths,
1649
+ ii as filterCopilotSuccessfulTurns,
1650
+ Zs as findDuplicateRowValues,
1651
+ ne as findExplorerNode,
1652
+ os as findKeyBinding,
1653
+ Vr as formatJsonBounded,
1654
+ is as formatKeyBinding,
1655
+ jr as formatMapEntryValue,
1656
+ Qs as generatePointRows,
1330
1657
  L as generateToolSchemaFromRows,
1331
- jt as generateUUID,
1332
- ns as getAiEmbeddingProviders,
1333
- os as getAiProviders,
1334
- Ve as getBuiltinToolOptionsFromSources,
1335
- zt as getBytesLength,
1336
- as as getCopilotCodeBlockCode,
1337
- Ui as getCoreThemeDefinition,
1338
- Ki as getCoreThemeVariables,
1339
- Vt as getEdgeBySourceNodeIdAndTargetNodeId,
1340
- cs as getEditorToolbarIconSvg,
1341
- Oe as getEditorWorkspaceTabActions,
1342
- ls as getFieldAttachmentTarget,
1343
- pi as getFieldChangeHandlerName,
1344
- ds as getFieldPathValue,
1345
- us as getMapValueMode,
1346
- Wt as getNodeByID,
1347
- qt as getNodeSeq,
1348
- mi as getPointTableImportDecision,
1349
- hs as getRuleChainErrorTexts,
1350
- We as getSkillPathFromSources,
1351
- gi as getTableColumns,
1352
- yi as getTableDetailFields,
1353
- Bi as getThemeList,
1354
- Gi as getThemeRuntimeVariables,
1355
- fs as getVisibleComponentFields,
1658
+ ns as generateUUID,
1659
+ Jr as getAiEmbeddingProviders,
1660
+ Wr as getAiProviders,
1661
+ it as getBuiltinToolOptionsFromSources,
1662
+ as as getBytesLength,
1663
+ ni as getCopilotCodeBlockCode,
1664
+ Pn as getCoreThemeDefinition,
1665
+ Ln as getCoreThemeVariables,
1666
+ ls as getEdgeBySourceNodeIdAndTargetNodeId,
1667
+ Yr as getEditorToolbarIconSvg,
1668
+ He as getEditorWorkspaceTabActions,
1669
+ Xr as getFieldAttachmentTarget,
1670
+ er as getFieldChangeHandlerName,
1671
+ Zr as getFieldPathValue,
1672
+ Qr as getMapValueMode,
1673
+ cs as getNodeByID,
1674
+ ds as getNodeSeq,
1675
+ tr as getPointTableImportDecision,
1676
+ ai as getRuleChainErrorTexts,
1677
+ an as getRunNodeTiming,
1678
+ nt as getSkillPathFromSources,
1679
+ sr as getTableColumns,
1680
+ rr as getTableDetailFields,
1681
+ Un as getThemeList,
1682
+ Mn as getThemeRuntimeVariables,
1683
+ Ds as getToken,
1684
+ eo as getVisibleComponentFields,
1685
+ ln as getVolatileKeys,
1356
1686
  G as getWorkspaceTabLifecycleState,
1357
- Yt as groupDiagnosticsByElement,
1358
- Jt as hasRuleChainSaveConflict,
1359
- ps as i18nText,
1360
- ms as inferRunInput,
1361
- Xt as insertGraphNodeOnEdge,
1362
- Zt as isComponentFieldOption,
1363
- gs as isDebug,
1364
- ve as isDebugPanelRequestCurrent,
1365
- ys as isEditorNodeRunTarget,
1366
- bs as isEditorToolbarIconName,
1367
- Qt as isEditorTourDone,
1368
- Es as isFieldDependencySatisfied,
1369
- Ss as isLogicFlowVisualNodeType,
1370
- bi as isPointTableFields,
1371
- Ts as isRuleChainNotDeployedError,
1372
- De as isWorkspaceTabDisabled,
1373
- le as isWorkspaceTabPinned,
1374
- Vi as localeEnUS,
1375
- Wi as localeZhCN,
1376
- Pe as mergeCopilotToolCallDelta,
1377
- Ei as mergeRuntimeFieldCompletions,
1378
- Si as mergeSimpleArrayValues,
1379
- Ti as nextRuleGoCronRuns,
1380
- As as normalizeApiProviderBaseUrl,
1381
- Rs as normalizeApiV1BaseUrl,
1382
- H as normalizeBuiltinToolOption,
1383
- xs as normalizeComponentCategory,
1384
- er as normalizeComponentsPayload,
1385
- tr as normalizeComponentsRawPayload,
1386
- Cs as normalizeConnectionStatusMap,
1387
- _s as normalizeEditableNodeModel,
1388
- Hi as normalizeEditorTheme,
1389
- A as normalizeExplorerExpandedKeys,
1390
- Ji as normalizeIconTheme,
1391
- rr as normalizeKeyValueSelection,
1392
- Is as normalizePagedResponse,
1393
- sr as normalizeRuleChainSaveSnapshot,
1394
- Ai as normalizeRuleGoCron,
1395
- Ri as normalizeSimpleArrayValues,
1396
- xi as normalizeTableRows,
1397
- Be as normalizeToolRows,
1398
- Ci as paginateTableRows,
1399
- _i as parseCsvTable,
1400
- Ii as parseExcelTable,
1401
- W as parseJsonBounded,
1402
- ze as parseJsonObjectText,
1403
- ws as parseMapEntryValue,
1404
- wi as parseSimpleArrayInput,
1687
+ us as groupDiagnosticsByElement,
1688
+ to as hasDeclaredSubgroups,
1689
+ li as hasDestructiveRuleChainChanges,
1690
+ cn as hasRuleChainSaveConflict,
1691
+ so as i18nText,
1692
+ ci as inferRunInput,
1693
+ di as insertGraphNodeOnEdge,
1694
+ hs as isComponentFieldOption,
1695
+ ro as isDebug,
1696
+ Ge as isDebugPanelRequestCurrent,
1697
+ ui as isEditorNodeRunTarget,
1698
+ oo as isEditorToolbarIconName,
1699
+ fs as isEditorTourDone,
1700
+ io as isFieldDependencySatisfied,
1701
+ no as isLogicFlowVisualNodeType,
1702
+ or as isPointTableFields,
1703
+ hi as isRuleChainNotDeployedError,
1704
+ ao as isSensitiveGlobalConfigKey,
1705
+ We as isValidPayloadJson,
1706
+ ze as isWorkspaceTabDisabled,
1707
+ ue as isWorkspaceTabPinned,
1708
+ Gn as localeEnUS,
1709
+ qn as localeZhCN,
1710
+ lo as localizeComponentDefinition,
1711
+ co as localizeComponentFields,
1712
+ uo as localizeComponentGroups,
1713
+ fi as mergeCopilotToolCallDelta,
1714
+ pi as mergeEditorCapabilities,
1715
+ mi as mergeEditorToolbarOptions,
1716
+ ps as mergeKeymap,
1717
+ ir as mergeRuntimeFieldCompletions,
1718
+ nr as mergeSimpleArrayValues,
1719
+ dn as mountGlobalConfigPanel,
1720
+ ar as nextRuleGoCronRuns,
1721
+ un as nodeMsgDiff,
1722
+ Os as normalizeApiPrefix,
1723
+ Ps as normalizeApiProviderBaseUrl,
1724
+ Ls as normalizeApiV1BaseUrl,
1725
+ z as normalizeBuiltinToolOption,
1726
+ ho as normalizeComponentCategory,
1727
+ fo as normalizeComponentLocaleMessages,
1728
+ ms as normalizeComponentsPayload,
1729
+ gs as normalizeComponentsRawPayload,
1730
+ hn as normalizeConnectionStatusMap,
1731
+ po as normalizeEditableNodeModel,
1732
+ Fn as normalizeEditorTheme,
1733
+ R as normalizeExplorerExpandedKeys,
1734
+ mo as normalizeGlobalConfigReload,
1735
+ go as normalizeGlobalConfigValues,
1736
+ Vn as normalizeIconTheme,
1737
+ ys as normalizeKeyValueSelection,
1738
+ yo as normalizeLocale,
1739
+ bo as normalizePagedResponse,
1740
+ fn as normalizeRuleChainSaveSnapshot,
1741
+ pn as normalizeRuleChainVersion,
1742
+ mn as normalizeRuleChainVersionDetail,
1743
+ gn as normalizeRuleChainVersionPage,
1744
+ lr as normalizeRuleGoCron,
1745
+ yn as normalizeRunMessage,
1746
+ cr as normalizeSimpleArrayValues,
1747
+ dr as normalizeTableRows,
1748
+ Qe as normalizeToolRows,
1749
+ ur as paginateTableRows,
1750
+ hr as parseCsvTable,
1751
+ fr as parseExcelTable,
1752
+ J as parseJsonBounded,
1753
+ ot as parseJsonObjectText,
1754
+ So as parseMapEntryValue,
1755
+ je as parsePayloadToKvRows,
1756
+ pr as parseSimpleArrayInput,
1405
1757
  P as parseToolSchemaRows,
1406
- Ns as parseUnknownConfiguration,
1407
- vs as readEditorChatHistory,
1408
- q as redactSensitive,
1409
- ir as removeKeyValueEntriesAtIndexes,
1410
- ks as renderCopilotCodeHtml,
1411
- Ds as renderCopilotMarkdown,
1412
- He as renumberSchemaRowOrders,
1413
- nr as reserveUniqueGraphElementId,
1414
- or as resolveCapabilities,
1415
- Os as resolveComponentFields,
1416
- Ms as resolveConnectionStatusView,
1417
- ar as resolveContextSubmenuPosition,
1418
- Ps as resolveCopilotCodeBlockAction,
1419
- cr as resolveEditorCapabilities,
1420
- Ls as resolveIconUrl,
1421
- Fs as resolveRuleChainDeployState,
1422
- Us as resolveRuleGoNodeType,
1423
- me as resolveSchemaRowsByParent,
1424
- Ni as ruleGoCronToPreset,
1425
- Ks as safeCssColor,
1426
- Bs as safeImageUrl,
1427
- Gs as safeUrl,
1428
- Hs as sanitizeConfigurationByFields,
1429
- $s as sanitizeDescription,
1430
- js as sanitizeRichHtml,
1431
- lr as selectConnectedNodeIds,
1432
- vi as serializeCsvTable,
1433
- ki as serializeExcelTable,
1434
- zs as setCopilotCodeBlockPanel,
1435
- Vs as setDebug,
1436
- Ws as setSafeText,
1437
- Le as settleCopilotToolCalls,
1438
- dr as snapGraphNodesToGrid,
1439
- ur as startEditorTour,
1440
- Fe as streamOpenAiChatCompletion,
1441
- je as stringifyToolJson,
1442
- hr as toComponentMap,
1443
- qs as truncateText,
1444
- V as unwrapApiEnvelope,
1445
- $e as updateSchemaRowsAtParent,
1446
- Ys as validateComponentFields,
1447
- Js as validateFieldValue,
1448
- Di as validateRuleGoCron,
1449
- fr as validateTopology,
1450
- Xs as writeEditorChatHistory
1758
+ To as parseUnknownConfiguration,
1759
+ bn as parseVersionRuleChain,
1760
+ mr as previewTemplate,
1761
+ Eo as readChainBusinessLog,
1762
+ gi as readEditorChatHistory,
1763
+ Co as readNodeBusinessLog,
1764
+ W as redactSensitive,
1765
+ bs as removeKeyValueEntriesAtIndexes,
1766
+ yi as renderCopilotCodeHtml,
1767
+ bi as renderCopilotMarkdown,
1768
+ tt as renumberSchemaRowOrders,
1769
+ Si as reserveUniqueGraphElementId,
1770
+ ye as resolveAIChatEndpoint,
1771
+ Ye as resolveAIChatTransportOptions,
1772
+ Ti as resolveCapabilities,
1773
+ Ao as resolveComponentFields,
1774
+ Ro as resolveComponentIconPath,
1775
+ wo as resolveComponentIconUrl,
1776
+ Sn as resolveConnectionStatusView,
1777
+ Ss as resolveContextSubmenuPosition,
1778
+ Ei as resolveCopilotCodeBlockAction,
1779
+ Ci as resolveEditorCapabilities,
1780
+ Io as resolveIconUrl,
1781
+ Ai as resolveRuleChainDeployState,
1782
+ xo as resolveRuleGoNodeType,
1783
+ be as resolveSchemaRowsByParent,
1784
+ gr as ruleGoCronToPreset,
1785
+ Tn as runLogOccurrences,
1786
+ En as runPairKey,
1787
+ _o as safeCssColor,
1788
+ vo as safeImageUrl,
1789
+ No as safeUrl,
1790
+ Cn as sameCleanSnapshot,
1791
+ ko as sanitizeConfigurationByFields,
1792
+ Do as sanitizeDescription,
1793
+ Oo as sanitizeRichHtml,
1794
+ Ri as selectConnectedNodeIds,
1795
+ yr as serializeCsvTable,
1796
+ br as serializeExcelTable,
1797
+ Je as serializeKvRowsToJson,
1798
+ wi as setCopilotCodeBlockPanel,
1799
+ Po as setDebug,
1800
+ Lo as setSafeText,
1801
+ Ii as settleCopilotToolCalls,
1802
+ An as showChainLogDialog,
1803
+ Rn as showGlobalConfigDialog,
1804
+ wn as showNodeLogDialog,
1805
+ In as showRunAnalysis,
1806
+ Ts as showVersionHistory,
1807
+ xi as snapGraphNodesToGrid,
1808
+ xn as stableAnalysisJson,
1809
+ Es as startEditorTour,
1810
+ _i as streamOpenAiChatCompletion,
1811
+ rt as stringifyToolJson,
1812
+ Cs as toComponentMap,
1813
+ _n as truncateText,
1814
+ F as unwrapApiEnvelope,
1815
+ st as updateSchemaRowsAtParent,
1816
+ Uo as validateComponentFields,
1817
+ Mo as validateFieldValue,
1818
+ Sr as validateRuleGoCron,
1819
+ As as validateTopology,
1820
+ Fo as withChainBusinessLog,
1821
+ $o as withNodeBusinessLog,
1822
+ vi as writeEditorChatHistory
1451
1823
  };