@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.
- package/README.md +20 -8
- package/dist/ai/ai-chat-options.d.ts +12 -0
- package/dist/api/AIAssistantAPI.d.ts +29 -0
- package/dist/api/AIManager.d.ts +7 -1
- package/dist/api/ApiProvider.d.ts +17 -4
- package/dist/api/DebugSocketClient.d.ts +2 -0
- package/dist/api/GlobalConfigAPI.d.ts +35 -0
- package/dist/api/IoTPointTemplateAPI.d.ts +32 -0
- package/dist/api/MarketplaceAPI.d.ts +39 -0
- package/dist/api/RuleChainAPI.d.ts +23 -4
- package/dist/api/RuleChainVersionsAPI.d.ts +28 -0
- package/dist/api/SkillsAPI.d.ts +31 -0
- package/dist/api/UserAPI.d.ts +39 -0
- package/dist/api/extended-api-shared.d.ts +25 -0
- package/dist/api/index.d.ts +19 -2
- package/dist/api/public-api.test-d.d.ts +87 -0
- package/dist/api/response-utils.d.ts +1 -0
- package/dist/api/types.d.ts +86 -14
- package/dist/chunks/editor-core-api-BQiYFuIO.js +1157 -0
- package/dist/chunks/editor-core-canvas-nodes-BE9eN51s.js +6921 -0
- package/dist/chunks/editor-core-code-editor-DFm5Owtv.js +660 -0
- package/dist/chunks/{editor-core-default-components-BjF65lar.js → editor-core-default-components-BsNP8ma1.js} +98 -98
- package/dist/chunks/editor-core-dialogs-D9YHvzys.js +12009 -0
- package/dist/chunks/{editor-core-locales-i6o28vm2.js → editor-core-locales-CsqTh7Wh.js} +1723 -11
- package/dist/chunks/{editor-core-node-patches-BJTT3TuX.js → editor-core-node-patches-Dbi8XYxu.js} +633 -184
- package/dist/chunks/{editor-core-node-views-BOaPVdmN.js → editor-core-node-views-C8FQYC3E.js} +39 -29
- package/dist/chunks/editor-core-property-drawers-Bqmp9B_J.js +9562 -0
- package/dist/chunks/editor-core-settings-DcGCJSc7.js +4161 -0
- package/dist/chunks/editor-core-standalone-C7pzm8ZB.js +10013 -0
- package/dist/chunks/{editor-core-styles-DFhXz0vB.js → editor-core-styles-CwjFPfAo.js} +967 -510
- package/dist/chunks/vendor-highlight-acC2fLd8.js +5868 -0
- package/dist/chunks/vendor-logicflow-core-runtime-DpsWXOGl.js +4 -0
- package/dist/chunks/vendor-logicflow-shared-C_kIdBKO.js +4 -0
- package/dist/core/ActionRegistry.d.ts +4 -2
- package/dist/core/DataAdapter.d.ts +17 -1
- package/dist/core/DialogProvider.d.ts +33 -0
- package/dist/core/EditorCore.d.ts +16 -3
- package/dist/core/FieldCapabilityRegistry.d.ts +4 -1
- package/dist/core/FieldChangeRegistry.d.ts +3 -1
- package/dist/core/I18nManager.d.ts +1 -1
- package/dist/core/IdentityProvider.d.ts +32 -0
- package/dist/core/OptionSourceRegistry.d.ts +4 -1
- package/dist/core/PropertyControlRegistry.d.ts +29 -0
- package/dist/core/ThemeManager.d.ts +7 -0
- package/dist/core/anchored-popover.d.ts +16 -0
- package/dist/core/assistant-dsl.d.ts +18 -0
- package/dist/core/business-log-config.d.ts +18 -0
- package/dist/core/clean-snapshot.d.ts +14 -0
- package/dist/core/component-localization.d.ts +17 -0
- package/dist/core/component-palette.d.ts +3 -0
- package/dist/core/connection-status.d.ts +11 -0
- package/dist/core/dialog-styles.d.ts +1 -0
- package/dist/core/editor-capabilities.d.ts +82 -1
- package/dist/core/editor-edge-anchors.d.ts +16 -0
- package/dist/core/endpoint-protocol.d.ts +15 -0
- package/dist/core/expression-preview.d.ts +6 -0
- package/dist/core/field-protocol.d.ts +19 -4
- package/dist/core/global-config.d.ts +47 -0
- package/dist/core/global-search.d.ts +31 -0
- package/dist/core/group-protocol.d.ts +56 -0
- package/dist/core/identity-provider-default.d.ts +32 -0
- package/dist/core/index.d.ts +31 -5
- package/dist/core/keymap.d.ts +10 -0
- package/dist/core/payload-kv.d.ts +7 -0
- package/dist/core/rule-chain-versions.d.ts +143 -0
- package/dist/core/run-analysis.d.ts +126 -0
- package/dist/core/runtime-field-dictionary.d.ts +3 -0
- package/dist/core/save-conflict.d.ts +1 -0
- package/dist/core/server-status.d.ts +1 -0
- package/dist/core/toolbar-icons.d.ts +1 -1
- package/dist/core/variable-completion.d.ts +13 -0
- package/dist/core/websocket-auth.d.ts +2 -0
- package/dist/defaults/analysis-locales.d.ts +241 -0
- package/dist/defaults/component-locale-categories.d.ts +14 -0
- package/dist/defaults/component-locale-data.d.ts +4 -0
- package/dist/defaults/component-locale-en-US.d.ts +10 -0
- package/dist/defaults/component-locale-summaries.d.ts +15 -0
- package/dist/defaults/component-locale-zh-CN.d.ts +10 -0
- package/dist/defaults/editor-shell-locales.d.ts +290 -0
- package/dist/defaults/example-chain.d.ts +2 -0
- package/dist/defaults/field-interaction-locales.d.ts +19 -0
- package/dist/defaults/global-config-locales.d.ts +166 -0
- package/dist/defaults/official-component-fallbacks.d.ts +2 -1
- package/dist/defaults/point-template-locales.d.ts +64 -0
- package/dist/index.cjs +2856 -2086
- package/dist/index.d.ts +33 -10
- package/dist/index.esm.js +1182 -810
- package/dist/index.umd.js +2850 -2080
- package/dist/nodes/UnknownNodeModel.d.ts +12 -1
- package/dist/standalone/HuanbanRulegoEditor.d.ts +145 -13
- package/dist/standalone/auth-fetch.d.ts +1 -0
- package/dist/standalone/auth-ui-defaults.d.ts +15 -0
- package/dist/standalone/code-editor.d.ts +7 -5
- package/dist/standalone/connection-status-binding.d.ts +3 -2
- package/dist/standalone/custom-nodes.d.ts +13 -0
- package/dist/standalone/drawer-locale.d.ts +12 -0
- package/dist/standalone/drawer-unsaved-guard.d.ts +6 -1
- package/dist/standalone/dynamic-field-browse.d.ts +25 -0
- package/dist/standalone/edge-label-quick-editor.d.ts +2 -1
- package/dist/standalone/editor-actions.d.ts +1 -0
- package/dist/standalone/editor-canvas-anchors.d.ts +19 -0
- package/dist/standalone/editor-canvas-shortcuts.d.ts +1 -0
- package/dist/standalone/editor-chain-info.d.ts +1 -0
- package/dist/standalone/editor-debug-data.d.ts +18 -0
- package/dist/standalone/editor-debug-ws.d.ts +2 -0
- package/dist/standalone/editor-delete.d.ts +5 -3
- package/dist/standalone/editor-dialog-provider.d.ts +3 -0
- package/dist/standalone/editor-dialogs.d.ts +25 -2
- package/dist/standalone/editor-global-config.d.ts +44 -0
- package/dist/standalone/editor-group-interactions.d.ts +1 -0
- package/dist/standalone/editor-host-region-styles.d.ts +1 -0
- package/dist/standalone/editor-host-regions.d.ts +53 -0
- package/dist/standalone/editor-login.d.ts +15 -0
- package/dist/standalone/editor-overlays.d.ts +5 -0
- package/dist/standalone/editor-property-drawers.d.ts +3 -1
- package/dist/standalone/editor-run-analysis.d.ts +81 -0
- package/dist/standalone/editor-run-compare.d.ts +20 -0
- package/dist/standalone/editor-run-waterfall.d.ts +11 -0
- package/dist/standalone/editor-toast.d.ts +1 -1
- package/dist/standalone/editor-toolbar-presentation.d.ts +12 -0
- package/dist/standalone/editor-toolbar.d.ts +5 -1
- package/dist/standalone/editor-ui-configuration.d.ts +55 -0
- package/dist/standalone/editor-ui-settings.d.ts +26 -0
- package/dist/standalone/editor-user-menu.d.ts +8 -0
- package/dist/standalone/editor-version-history.d.ts +82 -0
- package/dist/standalone/editor-workspace-shell.d.ts +47 -0
- package/dist/standalone/editor-workspace-styles.d.ts +1 -0
- package/dist/standalone/field-expression-preview.d.ts +12 -0
- package/dist/standalone/group-node.d.ts +19 -3
- package/dist/standalone/icon-utils.d.ts +7 -0
- package/dist/standalone/index.d.ts +17 -5
- package/dist/standalone/keyboard-events.d.ts +3 -0
- package/dist/standalone/multi-select-popover.d.ts +16 -0
- package/dist/standalone/node-copy.d.ts +1 -0
- package/dist/standalone/node-definitions.d.ts +4 -0
- package/dist/standalone/node-renderer-utils.d.ts +21 -0
- package/dist/standalone/node-theme.d.ts +1 -1
- package/dist/standalone/point-template-actions.d.ts +43 -0
- package/dist/standalone/property-field-draft.d.ts +5 -0
- package/dist/standalone/question-list-editor.d.ts +35 -0
- package/dist/standalone/shared-node-manager.d.ts +14 -0
- package/dist/standalone/single-select-popover.d.ts +6 -0
- package/dist/standalone/theme-scope.d.ts +15 -0
- package/dist/standalone/themes.d.ts +4 -0
- package/dist/standalone/variable-completion-dropdown.d.ts +18 -0
- package/dist/types/component.d.ts +22 -1
- package/dist/types/editor.d.ts +41 -0
- package/dist/utils/relation-utils.d.ts +19 -1
- package/dist/version.d.ts +2 -2
- package/package.json +3 -3
- package/vite-chunks.mjs +66 -0
- package/dist/chunks/editor-core-code-editor-CRki2wA_.js +0 -512
- package/dist/chunks/editor-core-dialogs-BMWb0WRN.js +0 -17228
- package/dist/chunks/editor-core-property-drawers-BPh-jj1b.js +0 -7998
- package/dist/chunks/editor-core-standalone-Cls7lcgT.js +0 -11302
- package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +0 -217
- package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +0 -4
package/dist/index.esm.js
CHANGED
|
@@ -1,255 +1,261 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./chunks/editor-core-
|
|
6
|
-
import {
|
|
7
|
-
import { d as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
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
|
|
23
|
-
return
|
|
28
|
+
function te(s, e) {
|
|
29
|
+
return s == null ? void 0 : s[e];
|
|
24
30
|
}
|
|
25
|
-
function
|
|
26
|
-
return typeof
|
|
31
|
+
function se(s) {
|
|
32
|
+
return typeof s != "string" ? [] : s.split("/").map((e) => e.trim()).filter(Boolean);
|
|
27
33
|
}
|
|
28
|
-
function
|
|
29
|
-
const e =
|
|
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
|
|
33
|
-
var
|
|
34
|
-
const e =
|
|
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
|
|
37
|
-
return Number.isFinite(
|
|
42
|
+
const t = new Date(String(e).replace(/-/g, "/")).getTime();
|
|
43
|
+
return Number.isFinite(t) ? t : 0;
|
|
38
44
|
}
|
|
39
|
-
function K(
|
|
40
|
-
return encodeURIComponent(
|
|
45
|
+
function K(s) {
|
|
46
|
+
return encodeURIComponent(s);
|
|
41
47
|
}
|
|
42
|
-
function
|
|
43
|
-
return `chain:${K(String(
|
|
48
|
+
function re(s) {
|
|
49
|
+
return `chain:${K(String(s.id || ""))}`;
|
|
44
50
|
}
|
|
45
|
-
function
|
|
46
|
-
return `${
|
|
51
|
+
function N(s, e) {
|
|
52
|
+
return `${s}:category:${K(e)}`;
|
|
47
53
|
}
|
|
48
|
-
function
|
|
54
|
+
function oe(s, e) {
|
|
49
55
|
if (!e) return !0;
|
|
50
|
-
const
|
|
51
|
-
return [
|
|
52
|
-
}
|
|
53
|
-
function
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
for (const
|
|
57
|
-
const u =
|
|
58
|
-
let p =
|
|
59
|
-
u.forEach((f,
|
|
60
|
-
const
|
|
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:
|
|
63
|
-
}), p.chains.push(
|
|
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 = (
|
|
66
|
-
key:
|
|
67
|
-
label: String(
|
|
71
|
+
const i = (c) => ({
|
|
72
|
+
key: re(c),
|
|
73
|
+
label: String(c.name || c.id || "-"),
|
|
68
74
|
kind: "chain",
|
|
69
|
-
chain:
|
|
70
|
-
}),
|
|
71
|
-
const u = [...
|
|
72
|
-
key:
|
|
73
|
-
label: f.segments[f.segments.length - 1] ||
|
|
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:
|
|
78
|
-
})), p =
|
|
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 = (
|
|
81
|
-
let u =
|
|
82
|
-
return
|
|
86
|
+
}, a = (c) => {
|
|
87
|
+
let u = c.chains.length;
|
|
88
|
+
return c.children.forEach((p) => {
|
|
83
89
|
u += a(p);
|
|
84
90
|
}), u;
|
|
85
|
-
},
|
|
86
|
-
key:
|
|
87
|
-
label:
|
|
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:
|
|
91
|
-
children:
|
|
92
|
-
}] : [], h =
|
|
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:
|
|
100
|
+
key: s,
|
|
95
101
|
label: e,
|
|
96
102
|
kind: "section",
|
|
97
|
-
count:
|
|
98
|
-
children: [...h, ...
|
|
103
|
+
count: t.length,
|
|
104
|
+
children: [...h, ...d]
|
|
99
105
|
};
|
|
100
106
|
}
|
|
101
|
-
function
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
return !
|
|
105
|
-
}),
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
].filter((
|
|
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
|
|
112
|
-
const e = [],
|
|
113
|
-
|
|
117
|
+
function S(s = []) {
|
|
118
|
+
const e = [], t = (r) => {
|
|
119
|
+
r.forEach((o) => {
|
|
114
120
|
var i;
|
|
115
|
-
(i =
|
|
121
|
+
(i = o.children) != null && i.length && (e.push(o.key), t(o.children));
|
|
116
122
|
});
|
|
117
123
|
};
|
|
118
|
-
return
|
|
124
|
+
return t(s), e;
|
|
119
125
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
for (const i of
|
|
123
|
-
if (i.key === e) return
|
|
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
|
|
126
|
-
if (
|
|
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
|
|
132
|
-
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
return [...new Set(e)].filter((
|
|
136
|
-
}
|
|
137
|
-
function
|
|
138
|
-
for (const
|
|
139
|
-
if (
|
|
140
|
-
if (
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
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
|
|
148
|
-
if (!
|
|
149
|
-
const e =
|
|
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((
|
|
157
|
+
expandedKeys: [...new Set(e.filter((t) => typeof t == "string" && !!t.trim()))]
|
|
152
158
|
} : null;
|
|
153
159
|
}
|
|
154
|
-
function
|
|
155
|
-
const e = Number(
|
|
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
|
|
159
|
-
return
|
|
164
|
+
function ce(s) {
|
|
165
|
+
return s ? `chain:${encodeURIComponent(s)}` : "";
|
|
160
166
|
}
|
|
161
|
-
function B(
|
|
167
|
+
function B(s) {
|
|
162
168
|
var e;
|
|
163
169
|
return {
|
|
164
|
-
...
|
|
165
|
-
chain:
|
|
166
|
-
children: (e =
|
|
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
|
|
175
|
+
function w(s) {
|
|
170
176
|
return {
|
|
171
|
-
tree:
|
|
172
|
-
keyword:
|
|
173
|
-
activeChainId:
|
|
174
|
-
rememberedExpandedKeys: [...
|
|
175
|
-
forcedExpandedKeys: [...
|
|
176
|
-
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
|
|
180
|
-
const e =
|
|
185
|
+
function D(s) {
|
|
186
|
+
const e = s.additionalInfo && typeof s.additionalInfo == "object" ? s.additionalInfo : {};
|
|
181
187
|
return JSON.stringify([
|
|
182
|
-
String(
|
|
183
|
-
String(
|
|
184
|
-
|
|
185
|
-
!!
|
|
186
|
-
String(
|
|
187
|
-
String(
|
|
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
|
|
192
|
-
return
|
|
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
|
|
200
|
+
class qe {
|
|
195
201
|
constructor(e = {}) {
|
|
196
|
-
var
|
|
197
|
-
this.destroyed = !1, this.labels = e.labels, this.smallTreeMax =
|
|
198
|
-
const
|
|
199
|
-
this.store = new
|
|
200
|
-
tree:
|
|
201
|
-
keyword:
|
|
202
|
-
activeChainId:
|
|
203
|
-
rememberedExpandedKeys:
|
|
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([...
|
|
211
|
+
expandedKeys: [.../* @__PURE__ */ new Set([...n, ...a])]
|
|
206
212
|
});
|
|
207
213
|
}
|
|
208
214
|
getState() {
|
|
209
|
-
return
|
|
215
|
+
return w(this.store.getState());
|
|
210
216
|
}
|
|
211
217
|
subscribe(e) {
|
|
212
218
|
return this.destroyed ? () => {
|
|
213
|
-
} : this.store.subscribe((
|
|
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
|
|
218
|
-
|
|
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
|
|
223
|
-
|
|
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
|
|
228
|
-
if (
|
|
229
|
-
const
|
|
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:
|
|
237
|
+
activeChainId: t,
|
|
232
238
|
rememberedExpandedKeys: i,
|
|
233
|
-
forcedExpandedKeys:
|
|
234
|
-
expandedKeys: [.../* @__PURE__ */ new Set([...i, ...
|
|
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,
|
|
239
|
-
var
|
|
244
|
+
setExpanded(e, t) {
|
|
245
|
+
var d;
|
|
240
246
|
if (this.destroyed) return !1;
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
const i = new Set(
|
|
244
|
-
if (!(
|
|
245
|
-
|
|
246
|
-
const a =
|
|
247
|
-
(
|
|
248
|
-
const
|
|
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:
|
|
252
|
-
expandedKeys: [.../* @__PURE__ */ new Set([...a, ...
|
|
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,
|
|
264
|
-
const
|
|
265
|
-
let i =
|
|
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
|
|
268
|
-
i = this.workflows.length <= this.smallTreeMax ?
|
|
269
|
-
} else i.length !==
|
|
270
|
-
const
|
|
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:
|
|
278
|
+
tree: r,
|
|
273
279
|
keyword: e,
|
|
274
280
|
rememberedExpandedKeys: i,
|
|
275
|
-
forcedExpandedKeys:
|
|
276
|
-
expandedKeys: [.../* @__PURE__ */ new Set([...i, ...
|
|
281
|
+
forcedExpandedKeys: n,
|
|
282
|
+
expandedKeys: [.../* @__PURE__ */ new Set([...i, ...n])]
|
|
277
283
|
});
|
|
278
284
|
}
|
|
279
285
|
resolveRememberedKeys(e) {
|
|
280
|
-
var
|
|
281
|
-
const
|
|
282
|
-
if (
|
|
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
|
|
286
|
-
return (i = this.persistence) == null || i.save({ expandedKeys:
|
|
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,
|
|
289
|
-
const
|
|
290
|
-
return [...new Set(
|
|
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
|
|
294
|
-
return G(
|
|
299
|
+
function ze(s) {
|
|
300
|
+
return G(s) === "stopped";
|
|
295
301
|
}
|
|
296
|
-
function
|
|
302
|
+
function ue(s) {
|
|
297
303
|
var e;
|
|
298
|
-
return typeof
|
|
304
|
+
return typeof s.pinned == "boolean" ? s.pinned : ((e = s.metadata) == null ? void 0 : e.pinned) === !0;
|
|
299
305
|
}
|
|
300
|
-
function G(
|
|
301
|
-
var
|
|
302
|
-
const e = (
|
|
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 (
|
|
308
|
-
if (
|
|
309
|
-
if (
|
|
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
|
|
314
|
-
const e =
|
|
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:
|
|
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: !
|
|
327
|
-
{ id: "debug", labelKey: "editor.workspace.debug", disabled: !
|
|
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:
|
|
331
|
-
disabled: e || !
|
|
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
|
|
337
|
-
class
|
|
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
|
|
345
|
-
const
|
|
346
|
-
if (!((
|
|
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
|
|
349
|
-
if (
|
|
350
|
-
throw new v("GRAPH_NODES_LIMIT", `validate graph has ${
|
|
351
|
-
if (
|
|
352
|
-
throw new v("GRAPH_EDGES_LIMIT", `validate graph has ${
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}),
|
|
357
|
-
const a =
|
|
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:
|
|
366
|
+
issues: t,
|
|
361
367
|
errors: a,
|
|
362
|
-
warnings:
|
|
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,
|
|
372
|
-
const
|
|
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(
|
|
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
|
-
|
|
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
|
-
}),
|
|
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
|
-
|
|
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
|
-
}),
|
|
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
|
|
414
|
-
|
|
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
|
-
}) :
|
|
420
|
-
|
|
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
|
|
426
|
-
|
|
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
|
-
}) :
|
|
432
|
-
|
|
437
|
+
}) : n.forEach((a) => {
|
|
438
|
+
g._validateNodeRef(a, e, "nodeIds", t, r);
|
|
433
439
|
});
|
|
434
440
|
break;
|
|
435
441
|
}
|
|
436
442
|
case "iterator": {
|
|
437
|
-
|
|
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,
|
|
458
|
-
e.startsWith("chain:") ||
|
|
459
|
-
nodeId:
|
|
460
|
-
nodeName:
|
|
461
|
-
nodeType:
|
|
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: `${
|
|
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,
|
|
475
|
-
const i = /* @__PURE__ */ new Map(),
|
|
476
|
-
|
|
477
|
-
i.set(a.id, a.type),
|
|
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
|
-
|
|
485
|
+
r.has(a.fromId) || o.push({
|
|
480
486
|
severity: "error",
|
|
481
487
|
message: `连接的源节点不存在: "${a.fromId}"`,
|
|
482
488
|
category: "connection"
|
|
483
|
-
}),
|
|
489
|
+
}), r.has(a.toId) || o.push({
|
|
484
490
|
severity: "error",
|
|
485
491
|
message: `连接的目标节点不存在: "${a.toId}"`,
|
|
486
492
|
category: "connection"
|
|
487
493
|
});
|
|
488
|
-
const
|
|
489
|
-
|
|
494
|
+
const l = i.get(a.fromId);
|
|
495
|
+
l && he.includes(l) && o.push({
|
|
490
496
|
nodeId: a.fromId,
|
|
491
|
-
nodeName:
|
|
492
|
-
nodeType:
|
|
497
|
+
nodeName: n.get(a.fromId),
|
|
498
|
+
nodeType: l,
|
|
493
499
|
severity: "warning",
|
|
494
|
-
message: `终端节点 "${
|
|
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,
|
|
506
|
-
var i,
|
|
507
|
-
const
|
|
508
|
-
|
|
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 (${
|
|
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((
|
|
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
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
if (
|
|
563
|
-
const
|
|
564
|
-
|
|
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
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
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
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
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
|
-
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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
|
-
|
|
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 =
|
|
653
|
-
if (!e)
|
|
654
|
-
const r =
|
|
655
|
-
r
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
(
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
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:
|
|
680
|
+
order: s,
|
|
688
681
|
required: !1,
|
|
689
682
|
properties: [],
|
|
690
683
|
itemsType: "string",
|
|
691
684
|
itemsProperties: []
|
|
692
685
|
};
|
|
693
686
|
}
|
|
694
|
-
function P(
|
|
695
|
-
const e =
|
|
696
|
-
return Object.keys(
|
|
697
|
-
var
|
|
698
|
-
const
|
|
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:
|
|
701
|
-
title: String(
|
|
702
|
-
description: String(
|
|
693
|
+
name: o,
|
|
694
|
+
title: String(n.title || ""),
|
|
695
|
+
description: String(n.description || ""),
|
|
703
696
|
type: a,
|
|
704
|
-
order: Number.isFinite(Number(
|
|
705
|
-
required:
|
|
706
|
-
properties: a === "object" ? P(
|
|
707
|
-
itemsType:
|
|
708
|
-
itemsProperties: a === "array" &&
|
|
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((
|
|
703
|
+
}).sort((o, i) => Number(o.order || 0) - Number(i.order || 0));
|
|
711
704
|
}
|
|
712
|
-
function L(
|
|
705
|
+
function L(s) {
|
|
713
706
|
const e = { type: "object", properties: {}, required: [] };
|
|
714
|
-
return
|
|
715
|
-
const
|
|
716
|
-
type:
|
|
717
|
-
order: Number.isFinite(Number(
|
|
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 (
|
|
720
|
-
const
|
|
721
|
-
i.properties =
|
|
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 (
|
|
724
|
-
const
|
|
725
|
-
i.items.properties =
|
|
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[
|
|
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
|
|
731
|
-
return
|
|
723
|
+
function x(s) {
|
|
724
|
+
return s.map((e) => ({
|
|
732
725
|
...e,
|
|
733
|
-
properties:
|
|
734
|
-
itemsProperties:
|
|
726
|
+
properties: x(e.properties || []),
|
|
727
|
+
itemsProperties: x(e.itemsProperties || [])
|
|
735
728
|
}));
|
|
736
729
|
}
|
|
737
|
-
function
|
|
738
|
-
return
|
|
730
|
+
function tt(s) {
|
|
731
|
+
return s.map((e, t) => ({ ...e, order: t + 1 }));
|
|
739
732
|
}
|
|
740
|
-
function
|
|
741
|
-
if (!e) return
|
|
742
|
-
const
|
|
743
|
-
let
|
|
744
|
-
for (const i of
|
|
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
|
-
|
|
739
|
+
r = (o == null ? void 0 : o.itemsProperties) || [];
|
|
747
740
|
continue;
|
|
748
741
|
}
|
|
749
|
-
if (
|
|
750
|
-
|
|
742
|
+
if (o = r[Number(i)], !o) return [];
|
|
743
|
+
r = o.properties || [];
|
|
751
744
|
}
|
|
752
|
-
return
|
|
745
|
+
return r;
|
|
753
746
|
}
|
|
754
|
-
function
|
|
755
|
-
const
|
|
756
|
-
return
|
|
747
|
+
function st(s, e, t) {
|
|
748
|
+
const r = x(s);
|
|
749
|
+
return t(be(r, e)), r;
|
|
757
750
|
}
|
|
758
|
-
function
|
|
759
|
-
if (typeof
|
|
760
|
-
if (
|
|
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(
|
|
755
|
+
return JSON.stringify(s, null, 2);
|
|
763
756
|
} catch {
|
|
764
757
|
return e;
|
|
765
758
|
}
|
|
766
759
|
}
|
|
767
|
-
function
|
|
768
|
-
if (!
|
|
769
|
-
const
|
|
770
|
-
return
|
|
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
|
|
773
|
-
if (!
|
|
774
|
-
const e =
|
|
775
|
-
if (!
|
|
776
|
-
const
|
|
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:
|
|
779
|
-
label:
|
|
771
|
+
value: t,
|
|
772
|
+
label: t,
|
|
780
773
|
desc: String(e.desc || e.Desc || e.tool_desc || e.description || ""),
|
|
781
|
-
parameters:
|
|
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:
|
|
777
|
+
raw: s
|
|
785
778
|
};
|
|
786
779
|
}
|
|
787
|
-
function
|
|
788
|
-
var
|
|
789
|
-
const e =
|
|
790
|
-
return Array.isArray(
|
|
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
|
|
793
|
-
for (const e of
|
|
785
|
+
function it(...s) {
|
|
786
|
+
for (const e of s) {
|
|
794
787
|
if (Array.isArray(e)) {
|
|
795
|
-
const
|
|
796
|
-
if (
|
|
788
|
+
const r = e.map(z).filter(Boolean);
|
|
789
|
+
if (r.length > 0) return r;
|
|
797
790
|
}
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
791
|
+
const t = Se(e);
|
|
792
|
+
if (t.length > 0) return t;
|
|
800
793
|
}
|
|
801
794
|
return [];
|
|
802
795
|
}
|
|
803
|
-
function
|
|
804
|
-
for (const e of
|
|
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
|
|
808
|
-
if (typeof
|
|
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
|
|
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>`,
|
|
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>`,
|
|
872
|
-
class
|
|
873
|
-
constructor(e =
|
|
874
|
-
|
|
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
|
-
*
|
|
871
|
+
* Load explicitly configured model metadata with a 60s in-memory cache.
|
|
878
872
|
*/
|
|
879
873
|
async getAvailableModels() {
|
|
880
|
-
|
|
881
|
-
|
|
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 ===
|
|
884
|
+
else if (this.modelsCache && this.cacheKey === r && e - this.lastFetchTime < 6e4)
|
|
884
885
|
return this.modelsCache;
|
|
885
|
-
if (
|
|
886
|
+
if (t && this.fetchPromise && this.fetchPromiseKey === r)
|
|
886
887
|
return this.fetchPromise;
|
|
887
|
-
const
|
|
888
|
-
if (!
|
|
888
|
+
const o = this.fetchAvailableModels(e, r, t);
|
|
889
|
+
if (!t) return o;
|
|
889
890
|
let i;
|
|
890
|
-
return i =
|
|
891
|
+
return i = o.finally(() => {
|
|
891
892
|
this.fetchPromise === i && (this.fetchPromise = null, this.fetchPromiseKey = null);
|
|
892
|
-
}), this.fetchPromise = i, this.fetchPromiseKey =
|
|
893
|
+
}), this.fetchPromise = i, this.fetchPromiseKey = r, i;
|
|
893
894
|
}
|
|
894
|
-
async fetchAvailableModels(e,
|
|
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(),
|
|
899
|
+
const i = new AbortController(), n = setTimeout(() => i.abort(), 3e3);
|
|
899
900
|
let a = null;
|
|
900
901
|
try {
|
|
901
|
-
a = await this.provider.request(
|
|
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(
|
|
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
|
|
909
|
-
return
|
|
910
|
-
} catch (
|
|
911
|
-
const i =
|
|
912
|
-
return console.warn("[AI Orchestration] AI 接口探测失败,大模型服务不可用",
|
|
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
|
|
917
|
-
function
|
|
918
|
-
return Number.isFinite(
|
|
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
|
|
921
|
-
return Number.isFinite(
|
|
919
|
+
function I(s, e) {
|
|
920
|
+
return Number.isFinite(s) && s !== void 0 ? Math.max(0, s) : e;
|
|
922
921
|
}
|
|
923
|
-
class
|
|
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,
|
|
931
|
-
this.endpoint = e, this.onMessage =
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
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 (
|
|
952
|
-
this.onError(
|
|
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 = (
|
|
961
|
+
}, e.onmessage = (t) => {
|
|
962
962
|
if (!(this.isDestroyed || this.isStopped || this.ws !== e))
|
|
963
963
|
try {
|
|
964
|
-
if (typeof
|
|
965
|
-
const
|
|
966
|
-
maxBytes:
|
|
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 (
|
|
970
|
-
this.onMessage(
|
|
971
|
-
} catch (
|
|
972
|
-
console.warn("[DebugSocketClient] Failed to parse message",
|
|
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 = (
|
|
977
|
-
this.isDestroyed || this.isStopped || this.ws !== e || this.onError(
|
|
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
|
-
|
|
1034
|
-
|
|
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
|
|
1037
|
-
const
|
|
1038
|
-
|
|
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
|
|
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
|
|
1331
|
+
var r, o;
|
|
1051
1332
|
super.setAttributes();
|
|
1052
|
-
const e = String(((
|
|
1053
|
-
let
|
|
1054
|
-
|
|
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(),
|
|
1346
|
+
const e = super.getConnectedSourceRules(), t = (r) => this.graphModel.getNodeModelById(r);
|
|
1066
1347
|
return e.push({
|
|
1067
1348
|
message: "端点节点不能作为起点连线",
|
|
1068
|
-
validate: (
|
|
1349
|
+
validate: (r, o) => !this.properties.notInput
|
|
1069
1350
|
}), e.push({
|
|
1070
1351
|
message: "外部节点不允许连接组内节点",
|
|
1071
|
-
validate: (
|
|
1072
|
-
var
|
|
1073
|
-
const i =
|
|
1074
|
-
return !(!
|
|
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: (
|
|
1370
|
+
validate: (t, r) => !0
|
|
1090
1371
|
}), e;
|
|
1091
1372
|
}
|
|
1092
1373
|
}
|
|
1093
|
-
class
|
|
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:
|
|
1400
|
+
const { x: e, y: t, id: r } = this, { width: o, height: i } = this;
|
|
1120
1401
|
return [
|
|
1121
|
-
{ x: e -
|
|
1122
|
-
{ x: e +
|
|
1123
|
-
{ x: e - 40, y:
|
|
1124
|
-
{ x: e - 10, y:
|
|
1125
|
-
{ x: e + 20, y:
|
|
1126
|
-
{ x: e + 50, y:
|
|
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
|
|
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
|
|
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: (
|
|
1470
|
+
validate: (t, r) => !0
|
|
1190
1471
|
}), e;
|
|
1191
1472
|
}
|
|
1192
1473
|
}
|
|
1193
1474
|
export {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
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
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
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
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
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
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
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
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
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
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
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
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
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
|
};
|