@huanban/rulego-editor-core 1.3.18 → 1.4.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 +153 -2
- package/assets/images/discovery-dark.svg +1 -0
- package/assets/images/discovery.svg +1 -0
- package/assets/images/nacos-dark.svg +1 -0
- package/assets/images/nacos.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos.svg +1 -0
- package/assets/theme-icons/apple/discovery-dark.svg +1 -0
- package/assets/theme-icons/apple/discovery.svg +1 -0
- package/assets/theme-icons/apple/nacos-dark.svg +1 -0
- package/assets/theme-icons/apple/nacos.svg +1 -0
- package/assets/theme-icons/colorful/discovery-dark.svg +1 -0
- package/assets/theme-icons/colorful/discovery.svg +1 -0
- package/assets/theme-icons/colorful/nacos-dark.svg +1 -0
- package/assets/theme-icons/colorful/nacos.svg +1 -0
- package/assets/theme-icons/dark/discovery-dark.svg +1 -0
- package/assets/theme-icons/dark/discovery.svg +1 -0
- package/assets/theme-icons/dark/nacos-dark.svg +1 -0
- package/assets/theme-icons/dark/nacos.svg +1 -0
- package/assets/theme-icons/default/discovery-dark.svg +1 -0
- package/assets/theme-icons/default/discovery.svg +1 -0
- package/assets/theme-icons/default/nacos-dark.svg +1 -0
- package/assets/theme-icons/default/nacos.svg +1 -0
- package/assets/theme-icons/elegant/discovery-dark.svg +1 -0
- package/assets/theme-icons/elegant/discovery.svg +1 -0
- package/assets/theme-icons/elegant/nacos-dark.svg +1 -0
- package/assets/theme-icons/elegant/nacos.svg +1 -0
- package/assets/theme-icons/github/discovery-dark.svg +1 -0
- package/assets/theme-icons/github/discovery.svg +1 -0
- package/assets/theme-icons/github/nacos-dark.svg +1 -0
- package/assets/theme-icons/github/nacos.svg +1 -0
- package/assets/theme-icons/icon-theme-manifest.json +30 -14
- package/assets/theme-icons/icon-theme-overview.svg +1599 -1287
- package/assets/theme-icons/material/discovery-dark.svg +1 -0
- package/assets/theme-icons/material/discovery.svg +1 -0
- package/assets/theme-icons/material/nacos-dark.svg +1 -0
- package/assets/theme-icons/material/nacos.svg +1 -0
- package/assets/theme-icons/modern/discovery-dark.svg +1 -0
- package/assets/theme-icons/modern/discovery.svg +1 -0
- package/assets/theme-icons/modern/nacos-dark.svg +1 -0
- package/assets/theme-icons/modern/nacos.svg +1 -0
- package/assets/theme-icons/nature/discovery-dark.svg +1 -0
- package/assets/theme-icons/nature/discovery.svg +1 -0
- package/assets/theme-icons/nature/nacos-dark.svg +1 -0
- package/assets/theme-icons/nature/nacos.svg +1 -0
- package/assets/theme-icons/tailwind/discovery-dark.svg +1 -0
- package/assets/theme-icons/tailwind/discovery.svg +1 -0
- package/assets/theme-icons/tailwind/nacos-dark.svg +1 -0
- package/assets/theme-icons/tailwind/nacos.svg +1 -0
- package/assets/theme-icons/tech/discovery-dark.svg +1 -0
- package/assets/theme-icons/tech/discovery.svg +1 -0
- package/assets/theme-icons/tech/nacos-dark.svg +1 -0
- package/assets/theme-icons/tech/nacos.svg +1 -0
- package/assets/theme-icons/vscode/discovery-dark.svg +1 -0
- package/assets/theme-icons/vscode/discovery.svg +1 -0
- package/assets/theme-icons/vscode/nacos-dark.svg +1 -0
- package/assets/theme-icons/vscode/nacos.svg +1 -0
- package/dist/ai/copilot-markdown.d.ts +40 -0
- package/dist/ai/copilot-transport.d.ts +39 -0
- package/dist/api/AIManager.d.ts +5 -4
- package/dist/api/ApiProvider.d.ts +17 -69
- package/dist/api/ComponentCatalogCache.d.ts +27 -0
- package/dist/api/DebugSocketClient.d.ts +18 -25
- package/dist/api/RuleChainAPI.d.ts +24 -145
- package/dist/api/StreamParser.d.ts +0 -10
- package/dist/api/index.d.ts +4 -14
- package/dist/api/response-utils.d.ts +4 -22
- package/dist/api/types.d.ts +44 -179
- package/dist/chunks/editor-core-code-editor-CRki2wA_.js +512 -0
- package/dist/chunks/editor-core-default-components-BjF65lar.js +9448 -0
- package/dist/chunks/editor-core-dialogs-CkFLaC8Q.js +17176 -0
- package/dist/chunks/editor-core-icons-BqeFofNA.js +668 -0
- package/dist/chunks/editor-core-json-diff-RHsPeX-w.js +199 -0
- package/dist/chunks/editor-core-locales-i6o28vm2.js +4159 -0
- package/dist/chunks/editor-core-node-patches-BJTT3TuX.js +8060 -0
- package/dist/chunks/editor-core-node-views-BOaPVdmN.js +1288 -0
- package/dist/chunks/editor-core-property-drawers-lLsBIoCa.js +8035 -0
- package/dist/chunks/editor-core-standalone-CHXk3ukc.js +11270 -0
- package/dist/chunks/editor-core-styles-C1TbLgCK.js +8841 -0
- package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +217 -0
- package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +4 -0
- package/dist/chunks/xlsx-BopDBbWb.js +24176 -0
- package/dist/core/ActionRegistry.d.ts +47 -0
- package/dist/core/AutoLayout.d.ts +1 -48
- package/dist/core/ComponentDocService.d.ts +28 -0
- package/dist/core/ComponentRegistry.d.ts +1 -125
- package/dist/core/DataAdapter.d.ts +4 -89
- package/dist/core/DiagnosticService.d.ts +15 -0
- package/dist/core/EditorCore.d.ts +22 -212
- package/dist/core/EditorWorkspace.d.ts +111 -0
- package/dist/core/EventBus.d.ts +0 -86
- package/dist/core/ExplorerTreeStore.d.ts +43 -0
- package/dist/core/FieldCapabilityRegistry.d.ts +16 -0
- package/dist/core/FieldChangeRegistry.d.ts +48 -0
- package/dist/core/HistoryManager.d.ts +0 -123
- package/dist/core/I18nManager.d.ts +0 -120
- package/dist/core/Optimizations.d.ts +0 -14
- package/dist/core/OptionSourceRegistry.d.ts +38 -0
- package/dist/core/RuleChainChatManager.d.ts +0 -37
- package/dist/core/RuleChainValidator.d.ts +0 -79
- package/dist/core/StateStore.d.ts +4 -140
- package/dist/core/ThemeManager.d.ts +0 -141
- package/dist/core/ValidationEngine.d.ts +0 -103
- package/dist/core/component-palette.d.ts +20 -0
- package/dist/core/component-payload.d.ts +0 -9
- package/dist/core/connection-status.d.ts +77 -0
- package/dist/core/context-menu-position.d.ts +27 -0
- package/dist/core/cron-schedule.d.ts +85 -0
- package/dist/core/debug-panel.d.ts +6 -0
- package/dist/core/editor-capabilities.d.ts +95 -0
- package/dist/core/editor-dock.d.ts +100 -0
- package/dist/core/editor-panel.d.ts +68 -0
- package/dist/core/explorer-tree.d.ts +27 -0
- package/dist/core/field-protocol.d.ts +32 -0
- package/dist/core/foundation-tokens.d.ts +38 -0
- package/dist/core/graph-operations.d.ts +34 -0
- package/dist/core/hover-tools.d.ts +26 -0
- package/dist/core/index.d.ts +68 -16
- package/dist/core/infer-run-input.d.ts +11 -0
- package/dist/core/key-value-editor.d.ts +6 -0
- package/dist/core/overlay-layers.d.ts +28 -0
- package/dist/core/recent-components.d.ts +51 -0
- package/dist/core/run-guard.d.ts +7 -0
- package/dist/core/runtime-field-dictionary.d.ts +68 -0
- package/dist/core/runtime-limits.d.ts +0 -5
- package/dist/core/save-conflict.d.ts +4 -0
- package/dist/core/server-status.d.ts +34 -0
- package/dist/core/simple-array.d.ts +4 -0
- package/dist/core/table-protocol.d.ts +36 -0
- package/dist/core/table-spreadsheet.d.ts +3 -0
- package/dist/core/test-cases.d.ts +54 -0
- package/dist/core/toolbar-icons.d.ts +4 -0
- package/dist/core/topology-rules.d.ts +17 -0
- package/dist/core/virtual-window.d.ts +20 -0
- package/dist/core/workspace-tab-actions.d.ts +13 -0
- package/dist/defaults/components.d.ts +0 -9
- package/dist/defaults/index.d.ts +0 -15
- package/dist/defaults/locale-en-US.d.ts +0 -24
- package/dist/defaults/locale-zh-CN.d.ts +0 -39
- package/dist/defaults/official-component-fallbacks.d.ts +0 -8
- package/dist/extensions/ClipboardExtension.d.ts +0 -23
- package/dist/extensions/KeyboardExtension.d.ts +0 -17
- package/dist/extensions/MenuExtension.d.ts +0 -23
- package/dist/iconRegistry.d.ts +0 -22
- package/dist/index.cjs +11320 -0
- package/dist/index.d.ts +25 -47
- package/dist/index.esm.js +1123 -99614
- package/dist/index.umd.js +3380 -1471
- package/dist/models/BaseNodeModel.d.ts +0 -32
- package/dist/models/index.d.ts +0 -1
- package/dist/nodes/AgentOrchestrationNode.d.ts +0 -24
- package/dist/nodes/GroupNode.d.ts +0 -38
- package/dist/nodes/HeadlessHtmlNode.d.ts +0 -16
- package/dist/nodes/SwitchNode.d.ts +0 -22
- package/dist/nodes/UnknownNodeModel.d.ts +0 -19
- package/dist/standalone/HuanbanRulegoEditor.d.ts +202 -401
- package/dist/standalone/ai-model-policy.d.ts +0 -1
- package/dist/standalone/ai-providers.d.ts +0 -1
- package/dist/standalone/auth-fetch.d.ts +2 -46
- package/dist/standalone/browser-assets.d.ts +0 -8
- package/dist/standalone/canvas-view.d.ts +6 -0
- package/dist/standalone/code-editor-language-loaders.d.ts +2 -0
- package/dist/standalone/code-editor-language-loaders.legacy.d.ts +7 -0
- package/dist/standalone/code-editor.d.ts +3 -87
- package/dist/standalone/connection-status-binding.d.ts +8 -0
- package/dist/standalone/custom-nodes.d.ts +0 -26
- package/dist/standalone/drawer-unsaved-guard.d.ts +2 -9
- package/dist/standalone/edge-label-quick-editor.d.ts +2 -0
- package/dist/standalone/editor-actions.d.ts +4 -0
- package/dist/standalone/editor-chain-info.d.ts +5 -38
- package/dist/standalone/editor-context-menu.d.ts +0 -21
- package/dist/standalone/editor-debug-ws.d.ts +37 -145
- package/dist/standalone/editor-delete.d.ts +0 -1
- package/dist/standalone/editor-dialogs.d.ts +16 -66
- package/dist/standalone/editor-events.d.ts +0 -27
- package/dist/standalone/editor-overlays.d.ts +14 -0
- package/dist/standalone/editor-property-drawers.d.ts +13 -71
- package/dist/standalone/editor-route-settings.d.ts +7 -55
- package/dist/standalone/editor-sidebar.d.ts +0 -18
- package/dist/standalone/editor-styles.d.ts +0 -11
- package/dist/standalone/editor-toast.d.ts +1 -2
- package/dist/standalone/editor-toolbar.d.ts +5 -80
- package/dist/standalone/editor-tour.d.ts +7 -0
- package/dist/standalone/editor-trace-overlay.d.ts +0 -5
- package/dist/standalone/full-json-dialog.d.ts +5 -1
- package/dist/standalone/group-node.d.ts +1 -51
- package/dist/standalone/icon-utils.d.ts +0 -20
- package/dist/standalone/index.d.ts +10 -7
- package/dist/standalone/json-diff.d.ts +0 -1
- package/dist/standalone/keyboard-events.d.ts +0 -1
- package/dist/standalone/layout-scheduler.d.ts +0 -6
- package/dist/standalone/lifecycle.d.ts +0 -5
- package/dist/standalone/logger.d.ts +0 -32
- package/dist/standalone/models-dev-catalog.d.ts +0 -1
- package/dist/standalone/node-copy.d.ts +7 -4
- package/dist/standalone/node-definitions.d.ts +0 -63
- package/dist/standalone/node-identity.d.ts +0 -1
- package/dist/standalone/node-theme.d.ts +8 -0
- package/dist/standalone/node-views-data.d.ts +0 -20
- package/dist/standalone/official-node-view-patches.d.ts +1 -14
- package/dist/standalone/outline-style.d.ts +7 -0
- package/dist/standalone/run-history-format.d.ts +0 -1
- package/dist/standalone/security-utils.d.ts +1 -5
- package/dist/standalone/shared-node-manager.d.ts +31 -0
- package/dist/standalone/themes.d.ts +0 -48
- package/dist/tools/tool-editor.d.ts +0 -1
- package/dist/types/component.d.ts +105 -87
- package/dist/types/editor.d.ts +16 -169
- package/dist/types/events.d.ts +30 -107
- package/dist/types/index.d.ts +3 -10
- package/dist/types/rule-chain.d.ts +0 -90
- package/dist/utils/GraphUtils.d.ts +0 -10
- package/dist/utils/helpers.d.ts +0 -80
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/pinyin-search.d.ts +0 -57
- package/dist/utils/relation-utils.d.ts +0 -1
- package/dist/utils/textUtils.d.ts +0 -12
- package/dist/version.d.ts +2 -3
- package/dist/xlsx-qn1xoUuv.cjs +105 -0
- package/package.json +19 -5
- package/vite-chunks.d.ts +11 -0
- package/vite-chunks.mjs +120 -0
- package/dist/index.cjs.js +0 -9515
|
@@ -58,4 +58,3 @@ export declare function modelProfileFromModelsDev(model: string, meta: ModelsDev
|
|
|
58
58
|
export declare function fallbackAiModelProfile(model: string, context?: Partial<AiModelProfile>): AiModelProfile;
|
|
59
59
|
export declare const AI_BUILTIN_PARAM_KEYS: readonly ["temperature", "topP", "presencePenalty", "frequencyPenalty", "maxTokens", "maxCompletionTokens", "n"];
|
|
60
60
|
export declare function buildAiParamPolicy(profile: AiModelProfile): AiParamPolicy;
|
|
61
|
-
//# sourceMappingURL=ai-model-policy.d.ts.map
|
|
@@ -4,4 +4,3 @@ export declare const DEFAULT_AI_PROVIDERS: AiProviderOption[];
|
|
|
4
4
|
export declare function getGlobalProviderList(name: 'rulegoAiProviders' | 'rulegoAiEmbeddingProviders'): AiProviderOption[];
|
|
5
5
|
export declare function getAiProviders(providers?: AiProviderOption[]): AiProviderOption[];
|
|
6
6
|
export declare function getAiEmbeddingProviders(providers?: AiProviderOption[]): AiProviderOption[];
|
|
7
|
-
//# sourceMappingURL=ai-providers.d.ts.map
|
|
@@ -1,53 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* @file standalone/auth-fetch.ts
|
|
3
|
-
* @description 统一的 fetch 请求封装 — 支持自定义 headers(如 Token 认证)和完全替换 fetch 函数
|
|
4
|
-
*
|
|
5
|
-
* 核心职责:
|
|
6
|
-
* 1. 提供 authFetch 函数,在所有 API 请求中自动注入配置的 headers
|
|
7
|
-
* 2. 支持 customFetch — 完全替换原生 fetch(用于自定义认证、拦截器等)
|
|
8
|
-
* 3. 提供 getAuthHeaders 从编辑器实例获取认证 headers 的工具函数
|
|
9
|
-
* 4. 集中管理请求超时、错误处理逻辑
|
|
10
|
-
*
|
|
11
|
-
* 使用方式:
|
|
12
|
-
* import { authFetch, getAuthHeaders } from './auth-fetch'
|
|
13
|
-
* const resp = await authFetch(url, { method: 'GET' }, editor)
|
|
14
|
-
*
|
|
15
|
-
* 自定义 fetch 函数:
|
|
16
|
-
* <RuleGoEditor customFetch={(url, init) => myAuthFetch(url, init)} />
|
|
17
|
-
* 当配置了 customFetch 时,authFetch 会直接使用它替代原生 fetch,
|
|
18
|
-
* 此时 fetchHeaders 仍会合并到 init.headers 中(如果同时配置了的话)
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* 从编辑器实例获取自定义请求头
|
|
22
|
-
* 支持 fetchHeaders 为静态对象或函数(动态获取 token)
|
|
23
|
-
*
|
|
24
|
-
* @param editor - HuanbanRulegoEditor 实例(需要 opts.fetchHeaders)
|
|
25
|
-
* @returns 合并后的 headers 对象
|
|
26
|
-
*/
|
|
27
|
-
export declare function getAuthHeaders(editor: any): Record<string, string>;
|
|
1
|
+
export declare function getAuthHeaders(editor: any, opts?: any): Record<string, string>;
|
|
28
2
|
export interface AuthFetchOptions {
|
|
29
3
|
timeoutMs?: number;
|
|
30
4
|
allowedOrigins?: string[];
|
|
31
5
|
sensitiveHeaderNames?: string[];
|
|
32
|
-
|
|
33
|
-
* Keep enabled by default for RuleGo backend APIs. Set to false for
|
|
34
|
-
* user-configured third-party endpoints that must not receive host auth.
|
|
35
|
-
*/
|
|
6
|
+
streamResponse?: boolean;
|
|
36
7
|
includeAuthHeaders?: boolean;
|
|
37
8
|
}
|
|
38
|
-
/**
|
|
39
|
-
* 带认证的 fetch 封装
|
|
40
|
-
*
|
|
41
|
-
* 优先级:
|
|
42
|
-
* 1. 如果 editor.opts.customFetch 存在 → 使用自定义 fetch 函数
|
|
43
|
-
* 2. 否则 → 使用原生 fetch + 自动注入 fetchHeaders
|
|
44
|
-
*
|
|
45
|
-
* 两种模式下,fetchHeaders 都会被合并到请求头中
|
|
46
|
-
*
|
|
47
|
-
* @param url - 请求地址
|
|
48
|
-
* @param init - fetch RequestInit 配置
|
|
49
|
-
* @param editor - HuanbanRulegoEditor 实例
|
|
50
|
-
* @returns fetch Response
|
|
51
|
-
*/
|
|
52
9
|
export declare function authFetch(url: string, init: RequestInit | undefined, editor: any, options?: AuthFetchOptions): Promise<Response>;
|
|
53
|
-
//# sourceMappingURL=auth-fetch.d.ts.map
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stable editor browser assets.
|
|
3
|
-
*
|
|
4
|
-
* The SVG files are shipped by @huanban/rulego-editor-core under assets/images.
|
|
5
|
-
* Examples use data URIs for in-app logos and normal favicon.svg files for
|
|
6
|
-
* browser tab icons.
|
|
7
|
-
*/
|
|
8
1
|
export declare const HUANBAN_LOGO_SVG_PATH = "assets/images/logo.svg";
|
|
9
2
|
export declare const HUANBAN_FAVICON_SVG_PATH = "assets/images/favicon.svg";
|
|
10
3
|
export declare const HUANBAN_LOGO_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" role=\"img\" aria-label=\"Huanban workflow logo\">\n <defs>\n <linearGradient id=\"ink\" x1=\"14\" y1=\"8\" x2=\"50\" y2=\"56\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#0f172a\"/>\n <stop offset=\"1\" stop-color=\"#27364a\"/>\n </linearGradient>\n <linearGradient id=\"teal\" x1=\"12\" y1=\"12\" x2=\"52\" y2=\"52\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#2dd4bf\"/>\n <stop offset=\"1\" stop-color=\"#0f766e\"/>\n </linearGradient>\n <linearGradient id=\"gold\" x1=\"45\" y1=\"10\" x2=\"20\" y2=\"56\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#fde68a\"/>\n <stop offset=\"1\" stop-color=\"#f59e0b\"/>\n </linearGradient>\n <filter id=\"soft-shadow\" x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\">\n <feDropShadow dx=\"0\" dy=\"2\" stdDeviation=\"2\" flood-color=\"#0f172a\" flood-opacity=\".16\"/>\n </filter>\n </defs>\n <g fill=\"none\" filter=\"url(#soft-shadow)\">\n <circle cx=\"32\" cy=\"32\" r=\"29\" stroke=\"url(#ink)\" stroke-width=\"3\"/>\n <circle cx=\"32\" cy=\"32\" r=\"25.5\" fill=\"#f8fafc\" stroke=\"#ffffff\" stroke-width=\"1.5\"/>\n <path d=\"M32 6.5a25.5 25.5 0 1 1 0 51 12.75 12.75 0 1 0 0-25.5 12.75 12.75 0 1 1 0-25.5Z\" fill=\"url(#ink)\"/>\n <circle cx=\"32\" cy=\"19.25\" r=\"5.6\" fill=\"#f8fafc\" stroke=\"url(#teal)\" stroke-width=\"2.5\"/>\n <circle cx=\"32\" cy=\"44.75\" r=\"5.6\" fill=\"#111827\" stroke=\"url(#gold)\" stroke-width=\"2.5\"/>\n <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=\".72\"/>\n <circle cx=\"17.5\" cy=\"32\" r=\"3.4\" fill=\"#2563eb\" stroke=\"#f8fafc\" stroke-width=\"1.6\"/>\n <circle cx=\"46.5\" cy=\"32\" r=\"3.4\" fill=\"#14b8a6\" stroke=\"#f8fafc\" stroke-width=\"1.6\"/>\n <circle cx=\"32\" cy=\"8.5\" r=\"2.4\" fill=\"#f59e0b\"/>\n <circle cx=\"48.6\" cy=\"15.4\" r=\"2.4\" fill=\"#14b8a6\"/>\n <circle cx=\"55.5\" cy=\"32\" r=\"2.4\" fill=\"#2563eb\"/>\n <circle cx=\"48.6\" cy=\"48.6\" r=\"2.4\" fill=\"#f59e0b\"/>\n <circle cx=\"32\" cy=\"55.5\" r=\"2.4\" fill=\"#14b8a6\"/>\n <circle cx=\"15.4\" cy=\"48.6\" r=\"2.4\" fill=\"#2563eb\"/>\n <circle cx=\"8.5\" cy=\"32\" r=\"2.4\" fill=\"#f59e0b\"/>\n <circle cx=\"15.4\" cy=\"15.4\" r=\"2.4\" fill=\"#14b8a6\"/>\n </g>\n</svg>";
|
|
11
4
|
export declare const HUANBAN_FAVICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" role=\"img\" aria-label=\"Huanban workflow icon\">\n <defs>\n <linearGradient id=\"ink\" x1=\"14\" y1=\"8\" x2=\"50\" y2=\"56\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#0f172a\"/>\n <stop offset=\"1\" stop-color=\"#27364a\"/>\n </linearGradient>\n <linearGradient id=\"teal\" x1=\"12\" y1=\"12\" x2=\"52\" y2=\"52\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#2dd4bf\"/>\n <stop offset=\"1\" stop-color=\"#0f766e\"/>\n </linearGradient>\n <linearGradient id=\"gold\" x1=\"45\" y1=\"10\" x2=\"20\" y2=\"56\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#fde68a\"/>\n <stop offset=\"1\" stop-color=\"#f59e0b\"/>\n </linearGradient>\n </defs>\n <circle cx=\"32\" cy=\"32\" r=\"29\" fill=\"#f8fafc\" stroke=\"url(#ink)\" stroke-width=\"3\"/>\n <path d=\"M32 6.5a25.5 25.5 0 1 1 0 51 12.75 12.75 0 1 0 0-25.5 12.75 12.75 0 1 1 0-25.5Z\" fill=\"url(#ink)\"/>\n <circle cx=\"32\" cy=\"19.25\" r=\"5.6\" fill=\"#f8fafc\" stroke=\"url(#teal)\" stroke-width=\"2.5\"/>\n <circle cx=\"32\" cy=\"44.75\" r=\"5.6\" fill=\"#111827\" stroke=\"url(#gold)\" stroke-width=\"2.5\"/>\n <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\"/>\n <circle cx=\"17.5\" cy=\"32\" r=\"3.4\" fill=\"#2563eb\" stroke=\"#f8fafc\" stroke-width=\"1.6\"/>\n <circle cx=\"46.5\" cy=\"32\" r=\"3.4\" fill=\"#14b8a6\" stroke=\"#f8fafc\" stroke-width=\"1.6\"/>\n</svg>";
|
|
12
5
|
export declare const HUANBAN_LOGO_DATA_URI: string;
|
|
13
6
|
export declare const HUANBAN_FAVICON_DATA_URI: string;
|
|
14
|
-
//# sourceMappingURL=browser-assets.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type CanvasGridType = 'mesh' | 'dot';
|
|
2
|
+
export declare function getCanvasGridType(lf: any): CanvasGridType;
|
|
3
|
+
export declare function setCanvasGridType(lf: any, type: CanvasGridType): boolean;
|
|
4
|
+
export declare function areCanvasEdgeLabelsHidden(lf: any): boolean;
|
|
5
|
+
export declare function setCanvasEdgeLabelsHidden(lf: any, hidden: boolean): boolean;
|
|
6
|
+
export declare function syncCanvasLevelOfDetail(lf: any): 0 | 1 | 2;
|
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/code-editor.ts
|
|
3
|
-
* @description CodeMirror 6 代码编辑器集成模块
|
|
4
|
-
*
|
|
5
|
-
* 功能:
|
|
6
|
-
* - 创建 CodeMirror 6 编辑器实例 (替代 textarea)
|
|
7
|
-
* - 支持 JavaScript / JSON / Lua / Plain 四种语言模式
|
|
8
|
-
* - 内置暗色主题 (oneDark)、行号、代码折叠、自动补全
|
|
9
|
-
* - 自动语法校验 (JS: linter, JSON: linter, Lua: 基础括号匹配, Plain: 不阻断)
|
|
10
|
-
* - 获取/设置编辑器内容
|
|
11
|
-
* - 统一销毁管理,避免内存泄漏
|
|
12
|
-
*
|
|
13
|
-
* 被 editor-property-drawers.ts 调用,用于节点属性中的
|
|
14
|
-
* jsScript / script / json 类型字段编辑。
|
|
15
|
-
*
|
|
16
|
-
* @input createCodeEditor(options) → CodeEditorInstance
|
|
17
|
-
* @output CodeEditorInstance { getValue, setValue, destroy, view }
|
|
18
|
-
*/
|
|
19
1
|
import { EditorView } from '@codemirror/view';
|
|
20
2
|
import { type CompletionSource } from '@codemirror/autocomplete';
|
|
21
|
-
|
|
22
|
-
* 代码编辑器语言类型
|
|
23
|
-
* - js: JavaScript 脚本
|
|
24
|
-
* - json: JSON 数据
|
|
25
|
-
* - lua: Lua 脚本 (仅基础高亮, 无内置 linter)
|
|
26
|
-
* - plain: SQL/表达式/未知代码类型,统一编辑器外观但不做语法阻断
|
|
27
|
-
*/
|
|
28
|
-
export type CodeEditorLang = 'js' | 'json' | 'lua' | 'plain';
|
|
3
|
+
export type CodeEditorLang = 'js' | 'json' | 'python' | 'lua' | 'plain';
|
|
29
4
|
export type CodeEditorCompletionMode = 'js' | 'sql' | 'plain';
|
|
30
5
|
export interface CodeEditorCompletionItem {
|
|
31
6
|
label?: string;
|
|
@@ -33,99 +8,40 @@ export interface CodeEditorCompletionItem {
|
|
|
33
8
|
detail?: string;
|
|
34
9
|
type?: string;
|
|
35
10
|
}
|
|
36
|
-
/**
|
|
37
|
-
* 创建代码编辑器的配置选项
|
|
38
|
-
*/
|
|
39
11
|
export interface CodeEditorOptions {
|
|
40
|
-
/** 挂载的 DOM 容器元素 */
|
|
41
12
|
parent: HTMLElement;
|
|
42
|
-
/** 初始代码内容 */
|
|
43
13
|
value?: string;
|
|
44
|
-
/** 语言类型: js / json / lua / plain */
|
|
45
14
|
lang?: CodeEditorLang;
|
|
46
|
-
/** 是否只读 */
|
|
47
15
|
readOnly?: boolean;
|
|
48
|
-
/** 内容变化回调 (防抖后触发) */
|
|
49
16
|
onChange?: (value: string) => void;
|
|
50
|
-
/** 语法校验状态回调: true=通过, string=错误信息 */
|
|
51
17
|
onValidate?: (result: true | string) => void;
|
|
52
|
-
/** 编辑器最小高度 (px), 默认 200 */
|
|
53
18
|
minHeight?: number;
|
|
54
|
-
/** 编辑器最大高度 (px), 默认 500 */
|
|
55
19
|
maxHeight?: number;
|
|
56
|
-
/** Tab 缩进空格数, 默认 2 */
|
|
57
20
|
tabSize?: number;
|
|
58
|
-
/** RuleGo 官方补全模式: js / sql / plain */
|
|
59
21
|
completionMode?: CodeEditorCompletionMode;
|
|
60
|
-
/** 当前规则链 additionalInfo.inputSchema 解析出的 msg.* 字段 */
|
|
61
22
|
schemaCompletions?: CodeEditorCompletionItem[];
|
|
62
|
-
|
|
23
|
+
getSchemaCompletions?: () => CodeEditorCompletionItem[] | undefined;
|
|
63
24
|
globalVars?: Array<string | {
|
|
64
25
|
label?: string;
|
|
65
26
|
value?: string;
|
|
66
27
|
name?: string;
|
|
67
28
|
}>;
|
|
68
29
|
}
|
|
69
|
-
/**
|
|
70
|
-
* 代码编辑器实例 — 对外提供的操作接口
|
|
71
|
-
*/
|
|
72
30
|
export interface CodeEditorInstance {
|
|
73
|
-
/** 获取当前编辑器内容 */
|
|
74
31
|
getValue(): string;
|
|
75
|
-
/** 设置编辑器内容 (会触发 onChange 回调) */
|
|
76
32
|
setValue(value: string): void;
|
|
77
|
-
/** 销毁编辑器实例,释放 DOM 和事件 */
|
|
78
33
|
destroy(): void;
|
|
79
|
-
/** CodeMirror EditorView 实例 (高级用法) */
|
|
80
34
|
view: EditorView;
|
|
81
35
|
}
|
|
82
|
-
/**
|
|
83
|
-
* 创建 RuleGo 官方补全源。
|
|
84
|
-
* 覆盖官方 PropertyCodeEditor.vue 中的触发协议:
|
|
85
|
-
* - `${global.` → lf.globalVars
|
|
86
|
-
* - `${` → `global.` 前缀
|
|
87
|
-
* - `msg.` → ruleChain.additionalInfo.inputSchema.properties
|
|
88
|
-
* - SQL 模式 → StreamSQL 函数/关键字
|
|
89
|
-
*/
|
|
90
36
|
export declare function createRulegoCompletionSource(options?: {
|
|
91
37
|
mode?: CodeEditorCompletionMode;
|
|
92
38
|
schemaCompletions?: CodeEditorCompletionItem[];
|
|
39
|
+
getSchemaCompletions?: () => CodeEditorCompletionItem[] | undefined;
|
|
93
40
|
globalVars?: Array<string | {
|
|
94
41
|
label?: string;
|
|
95
42
|
value?: string;
|
|
96
43
|
name?: string;
|
|
97
44
|
}>;
|
|
98
45
|
}): CompletionSource;
|
|
99
|
-
/**
|
|
100
|
-
* 创建 CodeMirror 6 代码编辑器实例
|
|
101
|
-
*
|
|
102
|
-
* @param options - 编辑器配置 (语言、初始值、回调等)
|
|
103
|
-
* @returns CodeEditorInstance — 包含 getValue / setValue / destroy 方法
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```ts
|
|
107
|
-
* const editor = createCodeEditor({
|
|
108
|
-
* parent: document.getElementById('code-container')!,
|
|
109
|
-
* value: 'function hello() { return "world"; }',
|
|
110
|
-
* lang: 'js',
|
|
111
|
-
* onChange: (val) => console.log('内容变化:', val),
|
|
112
|
-
* onValidate: (result) => {
|
|
113
|
-
* if (result === true) console.log('语法正确');
|
|
114
|
-
* else console.log('语法错误:', result);
|
|
115
|
-
* },
|
|
116
|
-
* });
|
|
117
|
-
* // 获取值
|
|
118
|
-
* const code = editor.getValue();
|
|
119
|
-
* // 销毁
|
|
120
|
-
* editor.destroy();
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
46
|
export declare function createCodeEditor(options: CodeEditorOptions): CodeEditorInstance;
|
|
124
|
-
/**
|
|
125
|
-
* 校验代码语法
|
|
126
|
-
* @param code - 代码内容
|
|
127
|
-
* @param lang - 语言类型
|
|
128
|
-
* @returns true 表示通过, string 表示错误信息
|
|
129
|
-
*/
|
|
130
47
|
export declare function validateCode(code: string, lang: CodeEditorLang): true | string;
|
|
131
|
-
//# sourceMappingURL=code-editor.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConnectionStatusState, ConnectionStatusStore } from '../core/connection-status';
|
|
2
|
+
export interface ConnectionStatusBindingHost {
|
|
3
|
+
lf: any;
|
|
4
|
+
connectionStatus: ConnectionStatusStore;
|
|
5
|
+
t?: (key: string) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare function applyConnectionStatusSnapshot(host: ConnectionStatusBindingHost, state: ConnectionStatusState): void;
|
|
8
|
+
export declare function bindConnectionStatusToLogicFlow(host: ConnectionStatusBindingHost): () => void;
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* custom-nodes.ts
|
|
3
|
-
* ===============
|
|
4
|
-
* 功能:LogicFlow 自定义图元注册
|
|
5
|
-
*
|
|
6
|
-
* 完全照搬原版 RuleGo Editor v1.2.0 的节点/边类型:
|
|
7
|
-
* - BaseNode (RedNode / RedNodeModel): 基础矩形节点
|
|
8
|
-
* - SimpleNode: 带图标的标准节点
|
|
9
|
-
* - StartNode: 起始节点 (不可移动, 只有右锚点)
|
|
10
|
-
* - EndpointNode: 端点节点 (只有右锚点)
|
|
11
|
-
* - ChainNode: 子规则链节点 (只有左锚点)
|
|
12
|
-
* - AgentNode / AgentOrchestrationNode: AI 智能体节点
|
|
13
|
-
* - FlowLink: 贝塞尔曲线连线
|
|
14
|
-
*
|
|
15
|
-
* 所有节点采用 Node-RED 风格:
|
|
16
|
-
* 120x30 矩形, 左侧30px图标区, 左右锚点连接
|
|
17
|
-
*
|
|
18
|
-
* 使用方式:
|
|
19
|
-
* import { registerCustomElements } from './custom-nodes'
|
|
20
|
-
* registerCustomElements(lf)
|
|
21
|
-
*/
|
|
22
1
|
import LogicFlow from '@logicflow/core';
|
|
23
2
|
export type CustomNodeTranslator = (key: string, fallback: string) => string;
|
|
24
|
-
/**
|
|
25
|
-
* 注册所有自定义图元到 LogicFlow 实例
|
|
26
|
-
* @param lf - LogicFlow 画布实例
|
|
27
|
-
*/
|
|
28
3
|
export declare function registerCustomElements(lf: LogicFlow, translate?: CustomNodeTranslator): void;
|
|
29
|
-
//# sourceMappingURL=custom-nodes.d.ts.map
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared guard for editable right-side drawers.
|
|
3
|
-
*
|
|
4
|
-
* The guard intentionally tracks only real form controls. Debug filters, search
|
|
5
|
-
* boxes, transient picker inputs, and tab state are excluded so browsing a
|
|
6
|
-
* drawer does not trigger an unsaved-change prompt.
|
|
7
|
-
*/
|
|
8
1
|
export type DrawerCloseDecision = 'save' | 'discard' | 'cancel';
|
|
9
2
|
export interface DrawerGuardI18nContext {
|
|
10
3
|
t(key: string, params?: Record<string, string>): string;
|
|
4
|
+
_activeDrawerWrapper?: HTMLElement | null;
|
|
11
5
|
}
|
|
12
6
|
export interface DrawerSnapshotOptions {
|
|
13
7
|
selector?: string;
|
|
14
|
-
extra?: unknown;
|
|
8
|
+
extra?: unknown | (() => unknown);
|
|
15
9
|
beforeCapture?: () => void;
|
|
16
10
|
}
|
|
17
11
|
export declare function captureDrawerFormSnapshot(root: ParentNode, options?: DrawerSnapshotOptions): string;
|
|
18
12
|
export declare function isDrawerFormDirty(root: ParentNode, initialSnapshot: string, options?: DrawerSnapshotOptions): boolean;
|
|
19
13
|
export declare function confirmDrawerUnsavedClose(ctx: DrawerGuardI18nContext): Promise<DrawerCloseDecision>;
|
|
20
|
-
//# sourceMappingURL=drawer-unsaved-guard.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorActionSource, EditorSelectionSnapshot } from '../core/ActionRegistry';
|
|
2
|
+
export declare function getEditorSelectionSnapshot(editor: any): EditorSelectionSnapshot;
|
|
3
|
+
export declare function registerDefaultEditorActions(editor: any): void;
|
|
4
|
+
export declare function invokeEditorAction(editor: any, id: string, source?: EditorActionSource): Promise<boolean>;
|
|
@@ -1,47 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/editor-chain-info.ts
|
|
3
|
-
* @description 链信息 Drawer 模块 — 从 HuanbanRulegoEditor.ts 中提取
|
|
4
|
-
*
|
|
5
|
-
* 包含以下功能:
|
|
6
|
-
* - 链信息 Drawer (showChainInfoDrawer) — 基础信息、输入定义、变量、应用集成
|
|
7
|
-
* - 新增变量/密钥弹窗 (showAddVarDialog)
|
|
8
|
-
*
|
|
9
|
-
* 每个函数接收 editor 实例作为参数 (ChainInfoContext 接口),
|
|
10
|
-
* 避免与主类产生循环依赖。
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* 链信息模块需要访问的编辑器上下文接口
|
|
14
|
-
* 使用接口而非直接引用 HuanbanRulegoEditor 类, 避免循环依赖
|
|
15
|
-
*/
|
|
16
1
|
export interface ChainInfoContext {
|
|
17
|
-
/** EditorCore 数据引擎实例 */
|
|
18
2
|
core: any;
|
|
19
|
-
/** 编辑器配置选项 (需要 apiBase, onChange 等) */
|
|
20
3
|
opts: any;
|
|
21
|
-
/** 国际化翻译方法 */
|
|
22
4
|
t(key: string, params?: Record<string, string>): string;
|
|
23
|
-
/** HTML 转义工具方法 */
|
|
24
5
|
_escapeHtml(str: string): string;
|
|
25
|
-
|
|
6
|
+
_activeDrawerWrapper?: HTMLElement | null;
|
|
7
|
+
_activeModalWrapper?: HTMLElement | null;
|
|
26
8
|
_closeDrawer(): void;
|
|
9
|
+
_closeModal?(): void;
|
|
10
|
+
_markDirty?(reason?: string): void;
|
|
11
|
+
_markSavedSnapshot?(data?: any): void;
|
|
27
12
|
}
|
|
28
|
-
/**
|
|
29
|
-
* 显示链信息 Drawer (默认实现)
|
|
30
|
-
* 对齐原版 RuleGo Server 的信息面板:
|
|
31
|
-
* 1. 基础信息 — ID、名称、根规则链、调试模式、分类、描述
|
|
32
|
-
* 2. 输入定义 — additionalInfo.inputSchema 可视化/JSON 编辑
|
|
33
|
-
* 3. 变量 — vars / secrets 表格
|
|
34
|
-
* 4. 应用集成 — 同步/异步/OpenAI/MCP 调用接口
|
|
35
|
-
*
|
|
36
|
-
* @param ctx - 编辑器上下文
|
|
37
|
-
* @param chain - 当前规则链数据对象
|
|
38
|
-
*/
|
|
39
13
|
export declare function showChainInfoDrawer(ctx: ChainInfoContext, chain: any): void;
|
|
40
|
-
/**
|
|
41
|
-
* 显示新增变量/密钥弹窗
|
|
42
|
-
* @param ctx - 编辑器上下文
|
|
43
|
-
* @param chain - 当前规则链数据
|
|
44
|
-
* @param isSecret - true=密钥, false=变量
|
|
45
|
-
*/
|
|
46
14
|
export declare function showAddVarDialog(ctx: ChainInfoContext, chain: any, isSecret: boolean): void;
|
|
47
|
-
//# sourceMappingURL=editor-chain-info.d.ts.map
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/editor-context-menu.ts
|
|
3
|
-
* @description 画布右键菜单模块
|
|
4
|
-
*
|
|
5
|
-
* 功能:
|
|
6
|
-
* - 画布空白处右键: 全选 / 适应画布 / 重置缩放 / 粘贴节点
|
|
7
|
-
* - 节点右键: 编辑 / 复制 / 从此节点开始执行 / 仅执行此节点 / 删除 / 断开连接
|
|
8
|
-
* - 连线右键: 编辑 / 删除
|
|
9
|
-
* - 自动定位在鼠标位置
|
|
10
|
-
* - 点击菜单外自动关闭
|
|
11
|
-
*
|
|
12
|
-
* @param editor - HuanbanRulegoEditor 实例
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* 初始化右键菜单事件绑定
|
|
16
|
-
* 在 HuanbanRulegoEditor.init() 中调用一次
|
|
17
|
-
*
|
|
18
|
-
* @param editor - 编辑器实例
|
|
19
|
-
* @returns 清理函数
|
|
20
|
-
*/
|
|
21
1
|
export declare function setupContextMenu(editor: any): () => void;
|
|
22
|
-
//# sourceMappingURL=editor-context-menu.d.ts.map
|
|
@@ -1,190 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* WebSocket 连接状态
|
|
25
|
-
*/
|
|
26
|
-
export type WsStatus = 'connecting' | 'live' | 'disconnected' | 'error';
|
|
27
|
-
/**
|
|
28
|
-
* WebSocket 回调选项
|
|
29
|
-
* @property onMessage - 收到日志消息时触发
|
|
30
|
-
* @property onStatus - 连接状态变化时触发
|
|
31
|
-
*/
|
|
1
|
+
export type WsStatus = 'connecting' | 'live' | 'reconnecting' | 'disconnected' | 'error';
|
|
2
|
+
export type DebugWsStatusReason = 'connecting' | 'connected' | 'socket-error' | 'socket-closed' | 'reconnecting' | 'max-reconnects' | 'manual-stop' | 'destroy';
|
|
3
|
+
export interface DebugWsStatusDetails {
|
|
4
|
+
reconnectAttempt: number;
|
|
5
|
+
lifetimeReconnectAttempt: number;
|
|
6
|
+
maxReconnects: number;
|
|
7
|
+
maxLifetimeReconnects: number;
|
|
8
|
+
closeCode: number | null;
|
|
9
|
+
intentional: boolean;
|
|
10
|
+
reason: DebugWsStatusReason;
|
|
11
|
+
}
|
|
12
|
+
export interface DebugWebSocketOptions {
|
|
13
|
+
wsUrl?: string;
|
|
14
|
+
wsBase?: string;
|
|
15
|
+
wsRoot?: string;
|
|
16
|
+
maxReconnects?: number;
|
|
17
|
+
maxLifetimeReconnects?: number;
|
|
18
|
+
reconnectBaseDelayMs?: number;
|
|
19
|
+
reconnectMaxDelayMs?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_DEBUG_WS_MAX_RECONNECTS = 5;
|
|
22
|
+
export declare const DEFAULT_DEBUG_WS_MAX_LIFETIME_RECONNECTS = 20;
|
|
23
|
+
export declare const DEFAULT_DEBUG_WS_STABLE_RESET_DELAY_MS = 10000;
|
|
32
24
|
export interface DebugWsCallbacks {
|
|
33
|
-
/** 收到一条新日志时调用 */
|
|
34
25
|
onMessage: (item: any) => void;
|
|
35
|
-
|
|
36
|
-
onStatus: (status: WsStatus) => void;
|
|
26
|
+
onStatus: (status: WsStatus, closeCode?: number | null, details?: DebugWsStatusDetails) => void;
|
|
37
27
|
}
|
|
38
28
|
export interface LiveTerminalRendererOptions {
|
|
39
29
|
getNodeName?: (nodeId: string) => string;
|
|
40
30
|
}
|
|
41
|
-
/**
|
|
42
|
-
* 调试日志 WebSocket 管理器
|
|
43
|
-
*
|
|
44
|
-
* 特性:
|
|
45
|
-
* - 自动重连(指数退避 1s → 2s → 4s → ... 最大 16s)
|
|
46
|
-
* - 最多重连 5 次后停止
|
|
47
|
-
* - destroy() 后不再重连
|
|
48
|
-
* - 心跳 ping(每 30 秒发送 "ping",保活)
|
|
49
|
-
*/
|
|
50
31
|
export declare class DebugWebSocket {
|
|
51
|
-
/** HTTP(S) API 基础路径,如 http://localhost:9090/api/v1 */
|
|
52
32
|
private apiBase;
|
|
53
|
-
/** 规则链 ID */
|
|
54
33
|
private chainId;
|
|
55
|
-
/** 客户端 ID (用于服务端标识连接,断开时移除 observer) */
|
|
56
34
|
private clientId;
|
|
57
|
-
/** 回调函数 */
|
|
58
35
|
private callbacks;
|
|
59
|
-
|
|
36
|
+
private options;
|
|
60
37
|
private ws;
|
|
61
|
-
/** 是否已主动销毁 */
|
|
62
38
|
private destroyed;
|
|
63
|
-
|
|
39
|
+
private stopped;
|
|
40
|
+
private started;
|
|
41
|
+
private lastStatus;
|
|
64
42
|
private reconnectCount;
|
|
65
|
-
|
|
66
|
-
private maxReconnects;
|
|
67
|
-
/** 重连定时器 */
|
|
43
|
+
private lifetimeReconnectCount;
|
|
68
44
|
private reconnectTimer;
|
|
69
|
-
/** 心跳定时器 */
|
|
70
45
|
private pingTimer;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* @param apiBase - API 基础路径 (http(s)://host/api/v1)
|
|
74
|
-
* @param chainId - 规则链 ID
|
|
75
|
-
* @param clientId - 客户端标识 (唯一,服务端用于管理 observer)
|
|
76
|
-
* @param callbacks - 回调函数
|
|
77
|
-
*/
|
|
78
|
-
constructor(apiBase: string, chainId: string, clientId: string, callbacks: DebugWsCallbacks);
|
|
79
|
-
/**
|
|
80
|
-
* 建立 WebSocket 连接
|
|
81
|
-
* 如果已连接则先关闭旧连接再重连
|
|
82
|
-
*/
|
|
46
|
+
private stableResetTimer;
|
|
47
|
+
constructor(apiBase: string, chainId: string, clientId: string, callbacks: DebugWsCallbacks, options?: DebugWebSocketOptions);
|
|
83
48
|
connect(): void;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* 通常在 Drawer 关闭时调用
|
|
87
|
-
*/
|
|
49
|
+
stop(): void;
|
|
50
|
+
private connectInternal;
|
|
88
51
|
destroy(): void;
|
|
89
|
-
/**
|
|
90
|
-
* 获取当前连接状态
|
|
91
|
-
*/
|
|
92
52
|
isConnected(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* 构建 WebSocket URL
|
|
95
|
-
* 将 http(s) 替换为 ws(s),拼接调试日志 WebSocket 路径
|
|
96
|
-
*
|
|
97
|
-
* RuleGo Server 路径: /api/v1/logs/ws/:chainId/:clientId
|
|
98
|
-
*
|
|
99
|
-
* @returns WebSocket URL 字符串
|
|
100
|
-
*/
|
|
101
53
|
private buildWsUrl;
|
|
102
|
-
/**
|
|
103
|
-
* 处理收到的消息
|
|
104
|
-
* 支持单条 JSON 和批量 JSON (每行一条)
|
|
105
|
-
*
|
|
106
|
-
* @param data - 原始消息数据
|
|
107
|
-
*/
|
|
108
54
|
private handleMessage;
|
|
109
|
-
/**
|
|
110
|
-
* 安排断线重连(指数退避)
|
|
111
|
-
*/
|
|
112
55
|
private scheduleReconnect;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
56
|
+
private emitStatus;
|
|
57
|
+
private clearReconnectTimer;
|
|
58
|
+
private clearStableResetTimer;
|
|
116
59
|
private closeSocket;
|
|
117
|
-
/**
|
|
118
|
-
* 启动心跳 ping (每 30 秒发送一次)
|
|
119
|
-
*/
|
|
120
60
|
private startPing;
|
|
121
|
-
/**
|
|
122
|
-
* 停止心跳 ping
|
|
123
|
-
*/
|
|
124
61
|
private stopPing;
|
|
125
62
|
}
|
|
126
|
-
|
|
127
|
-
* 实时日志终端 — 将 WebSocket 推送的日志渲染到终端面板
|
|
128
|
-
*
|
|
129
|
-
* 特性:
|
|
130
|
-
* - 最大保留 500 条日志 (FIFO)
|
|
131
|
-
* - 自动滚动到最新
|
|
132
|
-
* - 支持清空
|
|
133
|
-
*/
|
|
63
|
+
export declare function resolveDebugWsUrl(apiBase: string, chainId: string, clientId: string, options?: Pick<DebugWebSocketOptions, 'wsUrl' | 'wsBase' | 'wsRoot'>): string;
|
|
134
64
|
export declare class LiveTerminalRenderer {
|
|
135
|
-
/** 终端面板 DOM 元素 */
|
|
136
65
|
private container;
|
|
137
|
-
/** 日志缓冲区 */
|
|
138
66
|
private buffer;
|
|
139
|
-
/** IN 日志时间索引,用于按官方 chainId + msgId + nodeId 计算 OUT 耗时 */
|
|
140
67
|
private inTsByMsgNode;
|
|
141
|
-
/** 最大缓冲条数 */
|
|
142
68
|
private maxLines;
|
|
143
|
-
/** 渲染选项 */
|
|
144
69
|
private options;
|
|
145
|
-
/** 已安排但尚未执行的终端渲染帧 */
|
|
146
70
|
private pendingRenderFrame;
|
|
147
|
-
/** requestAnimationFrame 不可用时的降级渲染定时器 */
|
|
148
71
|
private pendingRenderTimer;
|
|
149
|
-
/** 是否已经销毁,销毁后不再追加或渲染 */
|
|
150
72
|
private destroyed;
|
|
151
|
-
/**
|
|
152
|
-
* @param container - 终端面板元素
|
|
153
|
-
* @param _escapeHtml - 兼容旧构造签名;当前渲染使用 textContent,不再需要 HTML 字符串转义
|
|
154
|
-
*/
|
|
155
73
|
constructor(container: HTMLElement, _escapeHtml: (text: string) => string, options?: LiveTerminalRendererOptions);
|
|
156
|
-
/**
|
|
157
|
-
* 追加一条日志消息
|
|
158
|
-
* @param item - 日志条目对象
|
|
159
|
-
*/
|
|
160
74
|
appendLog(item: any): void;
|
|
161
|
-
/**
|
|
162
|
-
* 清空所有日志
|
|
163
|
-
*/
|
|
164
75
|
clear(): void;
|
|
165
|
-
/**
|
|
166
|
-
* 销毁渲染器,释放待渲染帧、DOM 内容和内部索引。
|
|
167
|
-
*/
|
|
168
76
|
destroy(): void;
|
|
169
|
-
/**
|
|
170
|
-
* 获取当前日志条数
|
|
171
|
-
*/
|
|
172
77
|
getCount(): number;
|
|
173
|
-
/**
|
|
174
|
-
* 重新渲染终端内容并自动滚动到底部
|
|
175
|
-
*/
|
|
176
78
|
private render;
|
|
177
|
-
/**
|
|
178
|
-
* 格式化单条日志为终端结构化文本
|
|
179
|
-
*
|
|
180
|
-
* @param item - 日志条目
|
|
181
|
-
* @returns 终端行数据
|
|
182
|
-
*/
|
|
183
79
|
private formatLogLine;
|
|
184
|
-
/**
|
|
185
|
-
* 高频 WebSocket 日志下按帧合并渲染,避免每条消息全量 replaceChildren。
|
|
186
|
-
*/
|
|
187
80
|
private scheduleRender;
|
|
188
81
|
private cancelScheduledRender;
|
|
189
82
|
}
|
|
190
|
-
//# sourceMappingURL=editor-debug-ws.d.ts.map
|
|
@@ -6,4 +6,3 @@ export declare function confirmGraphElementsDelete(editor: any, nodes?: any[], e
|
|
|
6
6
|
export declare function canDeleteNodesWithInputGuard(editor: any, selectedNodes: any[]): boolean;
|
|
7
7
|
export declare function deleteGraphElementsWithInputGuard(editor: any, nodes?: any[], edges?: any[], options?: DeleteGraphElementsOptions): boolean;
|
|
8
8
|
export declare function deleteSelectedElementsWithInputGuard(editor: any): boolean;
|
|
9
|
-
//# sourceMappingURL=editor-delete.d.ts.map
|