@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#3c4043" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#3c4043" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#3c4043" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#3c4043" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#2563eb" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#2563eb" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#2563eb" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#2563eb" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#256d3b" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#256d3b" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#256d3b" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#256d3b" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#334155" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#334155" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#334155" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#334155" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#22d3ee" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#22d3ee" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#22d3ee" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#22d3ee" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#cccccc" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#cccccc" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><circle cx="512" cy="512" r="300"/><path d="M690 334L430 428C392 442 364 470 350 508L256 768C244 804 280 840 316 828L576 734C614 720 642 692 656 654L750 394C762 358 726 322 690 334Z"/><circle cx="512" cy="512" r="64"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#cccccc" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><g fill="none" stroke="#cccccc" stroke-width="64" stroke-linecap="round" stroke-linejoin="round" transform="translate(512 512) scale(0.84) translate(-512 -512)"><rect x="226" y="228" width="572" height="568" rx="84"/><path d="M304 704V320L516 704V320"/><path d="M604 320V704H742"/><path d="M604 512H714"/></g></svg>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface CopilotMarkdownOptions {
|
|
2
|
+
codeCopyLabel?: string;
|
|
3
|
+
maxChars?: number;
|
|
4
|
+
streaming?: boolean;
|
|
5
|
+
codeLabel?: string;
|
|
6
|
+
codePreviewLabel?: string;
|
|
7
|
+
codeFullscreenLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export type CopilotCodeBlockPanel = 'code' | 'preview';
|
|
10
|
+
export type CopilotCodeBlockAction = {
|
|
11
|
+
kind: 'tab';
|
|
12
|
+
block: HTMLElement;
|
|
13
|
+
panel: CopilotCodeBlockPanel;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'copy';
|
|
16
|
+
block: HTMLElement;
|
|
17
|
+
code: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'fullscreen';
|
|
20
|
+
block: HTMLElement;
|
|
21
|
+
code: string;
|
|
22
|
+
language: string;
|
|
23
|
+
previewable: boolean;
|
|
24
|
+
srcdoc: string;
|
|
25
|
+
panel: CopilotCodeBlockPanel;
|
|
26
|
+
};
|
|
27
|
+
export declare function getCopilotCodeBlockCode(block: HTMLElement): string;
|
|
28
|
+
export declare function setCopilotCodeBlockPanel(block: HTMLElement, panel: CopilotCodeBlockPanel): void;
|
|
29
|
+
export declare function resolveCopilotCodeBlockAction(target: EventTarget | null): CopilotCodeBlockAction | null;
|
|
30
|
+
export interface CopilotCodeInteractionOptions {
|
|
31
|
+
copyLabel?: string;
|
|
32
|
+
copiedLabel?: string;
|
|
33
|
+
copyFailedLabel?: string;
|
|
34
|
+
closeLabel?: string;
|
|
35
|
+
codeLabel?: string;
|
|
36
|
+
codePreviewLabel?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function bindCopilotCodeInteractions(container: HTMLElement | null, options?: CopilotCodeInteractionOptions): () => void;
|
|
39
|
+
export declare function renderCopilotCodeHtml(code: string, language: string, streaming?: boolean): string;
|
|
40
|
+
export declare function renderCopilotMarkdown(content: string, options?: CopilotMarkdownOptions): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type CopilotChatRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
2
|
+
export interface CopilotChatMessage {
|
|
3
|
+
role: CopilotChatRole;
|
|
4
|
+
content: string;
|
|
5
|
+
timestamp?: number | string;
|
|
6
|
+
}
|
|
7
|
+
export interface CopilotConversationMessage extends CopilotChatMessage {
|
|
8
|
+
status?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function filterCopilotSuccessfulTurns<T extends CopilotConversationMessage>(messages: T[]): T[];
|
|
11
|
+
export type CopilotChatToolCallStatus = 'loading' | 'received' | 'success' | 'error' | 'cancel';
|
|
12
|
+
export interface CopilotChatToolCallDelta {
|
|
13
|
+
id?: string;
|
|
14
|
+
index?: number;
|
|
15
|
+
type?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
arguments?: string;
|
|
18
|
+
result?: string;
|
|
19
|
+
status?: CopilotChatToolCallStatus;
|
|
20
|
+
}
|
|
21
|
+
export interface CopilotChatToolCall extends CopilotChatToolCallDelta {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function mergeCopilotToolCallDelta(calls: CopilotChatToolCall[] | undefined, delta: CopilotChatToolCallDelta): CopilotChatToolCall[];
|
|
26
|
+
export declare function settleCopilotToolCalls(calls?: CopilotChatToolCall[]): CopilotChatToolCall[] | undefined;
|
|
27
|
+
export interface CopilotChatTransportOptions {
|
|
28
|
+
endpoint: string;
|
|
29
|
+
messages: CopilotChatMessage[];
|
|
30
|
+
model?: string;
|
|
31
|
+
stream?: boolean;
|
|
32
|
+
headers?: Record<string, string>;
|
|
33
|
+
customFetch?: (url: string, init?: RequestInit) => Promise<Response>;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
onDelta?: (content: string) => void;
|
|
36
|
+
onReasoningDelta?: (content: string) => void;
|
|
37
|
+
onToolCallDelta?: (toolCall: CopilotChatToolCallDelta) => void;
|
|
38
|
+
}
|
|
39
|
+
export declare function streamOpenAiChatCompletion(options: CopilotChatTransportOptions): Promise<void>;
|
package/dist/api/AIManager.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ApiProvider } from './ApiProvider';
|
|
1
2
|
export declare class AIManager {
|
|
3
|
+
private readonly provider;
|
|
2
4
|
private modelsCache;
|
|
3
5
|
private fetchPromise;
|
|
6
|
+
private fetchPromiseKey;
|
|
4
7
|
private lastFetchTime;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
+
private cacheKey;
|
|
9
|
+
constructor(provider?: ApiProvider);
|
|
8
10
|
getAvailableModels(): Promise<any>;
|
|
9
11
|
private fetchAvailableModels;
|
|
10
12
|
}
|
|
11
13
|
export declare const aiManager: AIManager;
|
|
12
|
-
//# sourceMappingURL=AIManager.d.ts.map
|
|
@@ -1,83 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @description API 服务提供者,统一管理整个规则编辑器的 HTTP 请求与 WebSocket 连接生成。
|
|
4
|
-
* 允许外部主框架(如 HuanbanClaw)通过 updateConfig 动态替换 fetch 底层或注入 Token。
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* 引擎 API 基础配置接口
|
|
8
|
-
* @interface EditorApiConfig
|
|
9
|
-
*/
|
|
1
|
+
import { ServerStatusStore } from '../core/server-status';
|
|
2
|
+
import type { ApiAuthRequiredHandler, ApiCacheKey, ApiCustomFetch, ApiRequestHeaders } from './types';
|
|
10
3
|
export interface EditorApiConfig {
|
|
11
|
-
/** 后端 API 基础地址 (包含 context-path) */
|
|
12
4
|
baseUrl: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* 完全自定义底层的 Fetch 函数实现。
|
|
20
|
-
* 如果外层有 axios 拦截器或需要特殊签名,可以通过该钩子替换。
|
|
21
|
-
*/
|
|
22
|
-
customFetch?: (url: string, init?: RequestInit) => Promise<Response>;
|
|
5
|
+
fetchHeaders?: ApiRequestHeaders;
|
|
6
|
+
customFetch?: ApiCustomFetch;
|
|
7
|
+
cacheKey?: ApiCacheKey;
|
|
8
|
+
includeStoredToken?: boolean;
|
|
9
|
+
onAuthRequired?: ApiAuthRequiredHandler;
|
|
10
|
+
serverStatus?: ServerStatusStore;
|
|
23
11
|
}
|
|
24
|
-
/**
|
|
25
|
-
* 标准化给 ApiProvider 使用的服务根地址。
|
|
26
|
-
*
|
|
27
|
-
* HuanbanRulegoEditor 的 apiBase 约定通常包含 /api/v1(例如
|
|
28
|
-
* http://host:9090/api/v1),而 ApiProvider 内部方法会自己拼
|
|
29
|
-
* /api/v1/components、/api/v1/ai/models。这里剥离尾部 /api/v1,
|
|
30
|
-
* 防止真实后端调用时出现 /api/v1/api/v1 的重复路径。
|
|
31
|
-
*/
|
|
32
12
|
export declare function normalizeApiProviderBaseUrl(baseUrl: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* 标准化给编辑器内置对话框/抽屉使用的 API v1 地址。
|
|
35
|
-
*
|
|
36
|
-
* 这些模块直接请求 /components、/rules、/logs/debug 等 v1 下的路径;
|
|
37
|
-
* 调用方既可能传 http://host:9090,也可能传 http://host:9090/api/v1。
|
|
38
|
-
*/
|
|
39
13
|
export declare function normalizeApiV1BaseUrl(baseUrl: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* 全局 API 调度中心类
|
|
42
|
-
* @class ApiProvider
|
|
43
|
-
*/
|
|
44
14
|
export declare class ApiProvider {
|
|
45
15
|
private config;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*/
|
|
16
|
+
private configGeneration;
|
|
17
|
+
private readonly lastAuthNotifyAt;
|
|
18
|
+
constructor(config?: Partial<EditorApiConfig>);
|
|
50
19
|
updateConfig(newConfig: Partial<EditorApiConfig>): void;
|
|
51
|
-
/**
|
|
52
|
-
* 获取当前配置的基础 URL
|
|
53
|
-
* @returns {string} baseUrl
|
|
54
|
-
*/
|
|
55
20
|
getBaseUrl(): string;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* @private
|
|
60
|
-
*/
|
|
21
|
+
isSharedCacheEnabled(): boolean;
|
|
22
|
+
isModelCacheEnabled(): boolean;
|
|
23
|
+
getCacheKey(): string;
|
|
61
24
|
request(path: string, init?: RequestInit): Promise<Response>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* @returns {Promise<any>} 返回 JSON 数据字典
|
|
66
|
-
*/
|
|
67
|
-
fetchComponents(): Promise<unknown>;
|
|
68
|
-
/**
|
|
69
|
-
* 下发测试指令到规则引擎
|
|
70
|
-
* @param {string} chainId - 规则链ID
|
|
71
|
-
* @param {any} data - 需要灌入的 JSON 报文
|
|
72
|
-
* @returns {Promise<any>}
|
|
73
|
-
*/
|
|
25
|
+
private isCurrentRequestGeneration;
|
|
26
|
+
private notifyAuthRequired;
|
|
27
|
+
fetchComponents(init?: RequestInit): Promise<unknown>;
|
|
74
28
|
runDebug(chainId: string, data: any): Promise<unknown>;
|
|
75
|
-
/**
|
|
76
|
-
* 根据当前 HTTP 地址,自动换算获取 WebSocket 的连接地址
|
|
77
|
-
* @param {string} chainId - 规则链ID
|
|
78
|
-
* @returns {string} 完整的 ws:// 或 wss:// 地址
|
|
79
|
-
*/
|
|
80
29
|
getDebugWsUrl(chainId: string): string;
|
|
81
30
|
}
|
|
82
31
|
export declare const apiProvider: ApiProvider;
|
|
83
|
-
//# sourceMappingURL=ApiProvider.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RawComponentData } from '../types/component';
|
|
2
|
+
import type { ApiProvider } from './ApiProvider';
|
|
3
|
+
export interface ComponentCatalogCacheOptions {
|
|
4
|
+
ttlMs?: number;
|
|
5
|
+
maxEntries?: number;
|
|
6
|
+
now?: () => number;
|
|
7
|
+
}
|
|
8
|
+
export interface ComponentCatalogLoadOptions {
|
|
9
|
+
forceRefresh?: boolean;
|
|
10
|
+
ttlMs?: number;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
fetcher?: (signal?: AbortSignal) => Promise<RawComponentData>;
|
|
13
|
+
}
|
|
14
|
+
export declare class ComponentCatalogCache {
|
|
15
|
+
private readonly entries;
|
|
16
|
+
private readonly ttlMs;
|
|
17
|
+
private readonly maxEntries;
|
|
18
|
+
private readonly now;
|
|
19
|
+
constructor(options?: ComponentCatalogCacheOptions);
|
|
20
|
+
load(provider: ApiProvider, options?: ComponentCatalogLoadOptions): Promise<RawComponentData>;
|
|
21
|
+
prewarm(provider: ApiProvider, options?: ComponentCatalogLoadOptions): Promise<RawComponentData>;
|
|
22
|
+
invalidate(target?: ApiProvider | string): void;
|
|
23
|
+
get size(): number;
|
|
24
|
+
private prune;
|
|
25
|
+
private release;
|
|
26
|
+
}
|
|
27
|
+
export declare const componentCatalogCache: ComponentCatalogCache;
|
|
@@ -1,39 +1,32 @@
|
|
|
1
|
+
export interface DebugSocketClientOptions {
|
|
2
|
+
maxReconnectAttempts?: number;
|
|
3
|
+
maxLifetimeReconnectAttempts?: number;
|
|
4
|
+
reconnectBaseDelayMs?: number;
|
|
5
|
+
reconnectMaxDelayMs?: number;
|
|
6
|
+
stableResetDelayMs?: number;
|
|
7
|
+
}
|
|
1
8
|
export declare class DebugSocketClient {
|
|
2
9
|
private endpoint;
|
|
3
10
|
private onMessage;
|
|
4
11
|
private onError;
|
|
5
|
-
/** 内部 WebSocket 实例 */
|
|
6
12
|
private ws;
|
|
7
|
-
/** 心跳定时器引用 */
|
|
8
13
|
private pingInterval;
|
|
9
|
-
/** 待执行的重连定时器 */
|
|
10
14
|
private reconnectTimer;
|
|
11
|
-
/** 当前重连尝试次数 */
|
|
12
15
|
private reconnectAttempts;
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
+
private lifetimeReconnectAttempts;
|
|
17
|
+
private isStopped;
|
|
18
|
+
private stableResetTimer;
|
|
19
|
+
private maxRetryReported;
|
|
20
|
+
private readonly options;
|
|
16
21
|
private isDestroyed;
|
|
17
|
-
|
|
18
|
-
* 构造函数
|
|
19
|
-
* @param endpoint {string} WebSocket 服务端点 URL
|
|
20
|
-
* @param onMessage {(msg: any) => void} 接收到服务端消息时的回调
|
|
21
|
-
* @param onError {(err: any) => void} 出现异常或重连失败时的回调
|
|
22
|
-
*/
|
|
23
|
-
constructor(endpoint: string, onMessage: (msg: any) => void, onError: (err: any) => void);
|
|
24
|
-
/**
|
|
25
|
-
* 建立连接并绑定生命周期事件
|
|
26
|
-
*/
|
|
22
|
+
constructor(endpoint: string, onMessage: (msg: any) => void, onError: (err: any) => void, options?: DebugSocketClientOptions);
|
|
27
23
|
connect(): void;
|
|
28
|
-
|
|
29
|
-
* 指数退避重连算法实现
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
24
|
+
private connectInternal;
|
|
32
25
|
private handleReconnect;
|
|
33
26
|
private closeSocket;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
private clearPingInterval;
|
|
28
|
+
private clearReconnectTimer;
|
|
29
|
+
private clearStableResetTimer;
|
|
30
|
+
stop(): void;
|
|
37
31
|
destroy(): void;
|
|
38
32
|
}
|
|
39
|
-
//# sourceMappingURL=DebugSocketClient.d.ts.map
|
|
@@ -1,170 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* - 部署/下线操作
|
|
9
|
-
* - 变量/秘钥管理
|
|
10
|
-
* - 复制规则链
|
|
11
|
-
*
|
|
12
|
-
* 该类实现了 WorkflowFetcher 接口,可直接作为默认请求层使用。
|
|
13
|
-
* 消费者也可以传入自定义 fetcher 来替换整个请求层。
|
|
14
|
-
*
|
|
15
|
-
* 所有方法均为实例方法,使用原生 fetch + AbortController 超时。
|
|
16
|
-
*
|
|
17
|
-
* 使用方式:
|
|
18
|
-
* ```ts
|
|
19
|
-
* import { RuleChainAPI } from '@huanban/rulego-editor-core'
|
|
20
|
-
*
|
|
21
|
-
* // 方式1: 直接用 RuleChainAPI
|
|
22
|
-
* const api = new RuleChainAPI({ apiBase: 'http://127.0.0.1:9090/api/v1' })
|
|
23
|
-
* const data = await api.list(1, 20, 'test')
|
|
24
|
-
*
|
|
25
|
-
* // 方式2: 作为 fetcher 传给组件
|
|
26
|
-
* <WorkflowList fetcher={new RuleChainAPI({ apiBase: '...' })} />
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @module @huanban/rulego-editor-core/api
|
|
30
|
-
*/
|
|
31
|
-
import type { WorkflowItem, PagedResponse, ApiResult, WorkflowFetcher, RuleChainAPIOptions, RulePatchPreviewResponse, RuleRepairPlanResponse, RuleSchemaDiffResponse, RuleValidateUpstreamResponse, JSONPatchOperation } from './types';
|
|
32
|
-
/**
|
|
33
|
-
* 规则链 API 客户端
|
|
34
|
-
*
|
|
35
|
-
* @description 封装所有规则链相关的 REST API 调用,
|
|
36
|
-
* 实现 WorkflowFetcher 接口,可整体替换。
|
|
37
|
-
* 使用原生 fetch,不依赖任何框架。
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const api = new RuleChainAPI({ apiBase: 'http://localhost:9090/api/v1' })
|
|
42
|
-
*
|
|
43
|
-
* // 作为 WorkflowFetcher 使用
|
|
44
|
-
* const list = await api.list(1, 20, '')
|
|
45
|
-
* const chain = await api.getContent('chain-123')
|
|
46
|
-
*
|
|
47
|
-
* // 直接传给组件
|
|
48
|
-
* <WorkflowList fetcher={api} />
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare class RuleChainAPI implements WorkflowFetcher {
|
|
52
|
-
/** API 基础地址 */
|
|
1
|
+
import type { WorkflowItem, PagedResponse, ApiResult, WorkflowFetcher, SharedNode, SharedNodeFetcher, RuleChainAPIOptions, ListAllResult, RulePatchPreviewResponse, RuleRepairPlanResponse, RuleSchemaDiffResponse, RuleValidateUpstreamResponse, JSONPatchOperation } from './types';
|
|
2
|
+
export declare class RuleChainApiError extends Error {
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly url: string;
|
|
5
|
+
constructor(message: string, status: number, url: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class RuleChainAPI implements WorkflowFetcher, SharedNodeFetcher {
|
|
53
8
|
private apiBase;
|
|
54
|
-
/** 请求超时(毫秒) */
|
|
55
9
|
private timeout;
|
|
56
|
-
/** 自定义请求头 */
|
|
57
10
|
private headers;
|
|
58
|
-
|
|
11
|
+
private customFetch?;
|
|
12
|
+
private credentials?;
|
|
13
|
+
private onAuthRequired?;
|
|
14
|
+
private serverStatus?;
|
|
15
|
+
private includeStoredToken;
|
|
16
|
+
private lastAuthNotifyAt;
|
|
59
17
|
private routes;
|
|
60
|
-
/**
|
|
61
|
-
* 创建 API 客户端实例
|
|
62
|
-
*
|
|
63
|
-
* @param options - 配置项
|
|
64
|
-
* @param options.apiBase - API 基础地址(如 'http://127.0.0.1:9090/api/v1')
|
|
65
|
-
* @param options.timeout - 请求超时毫秒数,默认 8000
|
|
66
|
-
* @param options.headers - 自定义请求头
|
|
67
|
-
* @param options.authToken - Bearer Token
|
|
68
|
-
*/
|
|
69
18
|
constructor(options: RuleChainAPIOptions);
|
|
70
|
-
/**
|
|
71
|
-
* 发起 fetch 请求(带超时控制)
|
|
72
|
-
*
|
|
73
|
-
* @param path - API 路径(相对 apiBase)
|
|
74
|
-
* @param init - fetch 配置
|
|
75
|
-
* @returns 解析后的 JSON
|
|
76
|
-
*/
|
|
77
19
|
private request;
|
|
20
|
+
private notifyAuthRequired;
|
|
78
21
|
private getHeaders;
|
|
79
22
|
private getRuleChainId;
|
|
80
23
|
private resolveCreatePath;
|
|
81
|
-
|
|
82
|
-
* 将后端 RuleChain DSL 对象转为前端扁平化 WorkflowItem
|
|
83
|
-
*
|
|
84
|
-
* @description 后端返回 { ruleChain: { id, name, root, disabled, additionalInfo }, metadata: {...} }
|
|
85
|
-
* 前端通过此方法转换为扁平化结构。
|
|
86
|
-
*
|
|
87
|
-
* @param raw - 后端原始对象
|
|
88
|
-
* @returns 扁平化的 WorkflowItem
|
|
89
|
-
*/
|
|
24
|
+
private resolveSharedNodePath;
|
|
90
25
|
static parseRuleChain(raw: unknown): WorkflowItem;
|
|
91
|
-
/**
|
|
92
|
-
* 生成随机规则链 ID(12 位字母数字)
|
|
93
|
-
* @returns 生成的 ID
|
|
94
|
-
*/
|
|
95
26
|
static generateChainId(): string;
|
|
96
|
-
/**
|
|
97
|
-
* 查询规则链列表(分页 + 搜索)
|
|
98
|
-
*
|
|
99
|
-
* @param page - 页码(从 1 开始)
|
|
100
|
-
* @param size - 每页条数
|
|
101
|
-
* @param keywords - 搜索关键词
|
|
102
|
-
* @returns 分页结果
|
|
103
|
-
*/
|
|
104
27
|
list(page?: number, size?: number, keywords?: string): Promise<PagedResponse<WorkflowItem>>;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
28
|
+
listAll(size?: number, keywords?: string, maxPages?: number): Promise<WorkflowItem[]>;
|
|
29
|
+
listAllDetailed(size?: number, keywords?: string, maxPages?: number): Promise<ListAllResult<WorkflowItem>>;
|
|
30
|
+
getSharedNodes(keywords?: string, page?: number, size?: number, type?: string, signal?: AbortSignal): Promise<PagedResponse<SharedNode>>;
|
|
31
|
+
getSharedNode(id: string, type: string, signal?: AbortSignal): Promise<SharedNode>;
|
|
32
|
+
saveSharedNode<TResponse = unknown>(id: string, type: string, body: SharedNode, signal?: AbortSignal): Promise<TResponse>;
|
|
33
|
+
deleteSharedNode<TResponse = unknown>(id: string, type: string, signal?: AbortSignal): Promise<TResponse>;
|
|
111
34
|
create(data: Record<string, unknown>): Promise<ApiResult>;
|
|
112
|
-
/**
|
|
113
|
-
* 删除规则链
|
|
114
|
-
*
|
|
115
|
-
* @param id - 规则链 ID
|
|
116
|
-
* @returns 操作结果
|
|
117
|
-
*/
|
|
118
35
|
remove(id: string): Promise<ApiResult>;
|
|
119
|
-
/**
|
|
120
|
-
* 部署/下线规则链
|
|
121
|
-
*
|
|
122
|
-
* @param id - 规则链 ID
|
|
123
|
-
* @param type - 'start'(部署/启动)| 'stop'(下线)
|
|
124
|
-
* @returns 操作结果
|
|
125
|
-
*/
|
|
126
36
|
operate(id: string, type: 'start' | 'stop'): Promise<ApiResult>;
|
|
127
|
-
|
|
128
|
-
* 复制规则链
|
|
129
|
-
*
|
|
130
|
-
* @description 获取完整内容 → 修改名称和 ID → 创建新的
|
|
131
|
-
* @param id - 原始规则链 ID
|
|
132
|
-
* @param newName - 新名称(不传则自动加 _副本)
|
|
133
|
-
* @returns 操作结果
|
|
134
|
-
*/
|
|
37
|
+
restart(id: string): Promise<ApiResult>;
|
|
135
38
|
copy(id: string, newName?: string): Promise<ApiResult>;
|
|
136
|
-
/**
|
|
137
|
-
* 获取规则链完整内容(包含 metadata)
|
|
138
|
-
*
|
|
139
|
-
* @param id - 规则链 ID
|
|
140
|
-
* @returns 完整的 RuleChain DSL
|
|
141
|
-
*/
|
|
142
39
|
getContent(id: string): Promise<Record<string, unknown>>;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
*
|
|
146
|
-
* @param id - 规则链 ID
|
|
147
|
-
* @param info - 基础信息字段(name/description 等)
|
|
148
|
-
* @returns 操作结果
|
|
149
|
-
*/
|
|
40
|
+
getChainStatuses(id: string, signal?: AbortSignal): Promise<unknown>;
|
|
41
|
+
getSharedNodeStatuses(signal?: AbortSignal): Promise<unknown>;
|
|
150
42
|
saveBaseInfo(id: string, info: Record<string, unknown>): Promise<ApiResult>;
|
|
151
|
-
/**
|
|
152
|
-
* 保存规则链配置(变量或秘钥)
|
|
153
|
-
*
|
|
154
|
-
* @param id - 规则链 ID
|
|
155
|
-
* @param configType - 'vars'(变量)| 'secrets'(秘钥)
|
|
156
|
-
* @param data - key-value 配置数据
|
|
157
|
-
* @returns 操作结果
|
|
158
|
-
*/
|
|
159
43
|
saveConfig(id: string, configType: 'vars' | 'secrets', data: Record<string, string>): Promise<ApiResult>;
|
|
160
44
|
validateUpstream(id: string, dsl: Record<string, unknown>, options?: Record<string, unknown>): Promise<RuleValidateUpstreamResponse>;
|
|
161
45
|
getSchemaDiff(id: string): Promise<RuleSchemaDiffResponse>;
|
|
162
46
|
getRepairPlan(id: string, dsl: Record<string, unknown>, options?: Record<string, unknown>): Promise<RuleRepairPlanResponse>;
|
|
163
47
|
previewPatch(id: string, dsl: Record<string, unknown>, operations: JSONPatchOperation[]): Promise<RulePatchPreviewResponse>;
|
|
164
|
-
/**
|
|
165
|
-
* 获取当前 API 基础地址
|
|
166
|
-
* @returns apiBase
|
|
167
|
-
*/
|
|
168
48
|
getApiBase(): string;
|
|
169
49
|
}
|
|
170
|
-
//# sourceMappingURL=RuleChainAPI.d.ts.map
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file StreamParser.ts
|
|
3
|
-
* @description Server-Sent Events (SSE) 流式解析器,用于大模型流式响应
|
|
4
|
-
*/
|
|
5
1
|
export declare class StreamParser {
|
|
6
|
-
/**
|
|
7
|
-
* 解析标准的 SSE 响应
|
|
8
|
-
* @param response fetch Response
|
|
9
|
-
* @returns 异步生成器,产出解析后的 JSON 数据
|
|
10
|
-
*/
|
|
11
2
|
static parseSSE(response: Response): AsyncGenerator<any, void, unknown>;
|
|
12
3
|
}
|
|
13
|
-
//# sourceMappingURL=StreamParser.d.ts.map
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* @file api/index.ts
|
|
3
|
-
* @description API 模块 barrel 导出
|
|
4
|
-
*
|
|
5
|
-
* 导出内容:
|
|
6
|
-
* - RuleChainAPI: 内置请求实现(纯 fetch)
|
|
7
|
-
* - WorkflowFetcher: 请求适配器接口(用于替换请求层)
|
|
8
|
-
* - RuleChainRoutes / DEFAULT_ROUTES: 路由映射(用于替换 API 路径)
|
|
9
|
-
* - WorkflowListIcons / WorkflowInfoIcons: 图标映射接口
|
|
10
|
-
* - 数据类型: WorkflowItem / PagedResponse / ApiResult
|
|
11
|
-
*/
|
|
12
|
-
export { RuleChainAPI } from './RuleChainAPI';
|
|
1
|
+
export { RuleChainAPI, RuleChainApiError } from './RuleChainAPI';
|
|
13
2
|
export { normalizePagedResponse, unwrapApiEnvelope } from './response-utils';
|
|
14
3
|
export { DEFAULT_ROUTES } from './types';
|
|
15
|
-
export type { WorkflowItem, PagedResponse, ApiResult, WorkflowFetcher, RuleChainAPIOptions, RuleChainRoutes, WorkflowListIcons, WorkflowInfoIcons, WorkflowTheme, RuleMaintenanceSeverity, RuleMaintenanceCategory, RuleMaintenanceIssue, RuleMaintenanceRuntimeInfo, RuleValidateUpstreamRequest, RuleValidateUpstreamResponse, RuleSchemaDiffResponse, RuleRepairPlanResponse, JSONPatchOperation, RulePatchPreviewResponse, } from './types';
|
|
4
|
+
export type { WorkflowItem, PagedResponse, ListAllResult, ApiResult, SharedNode, SharedNodeFetcher, WorkflowFetcher, RuleChainAPIOptions, RuleChainRoutes, WorkflowListIcons, WorkflowInfoIcons, WorkflowTheme, RuleMaintenanceSeverity, RuleMaintenanceCategory, RuleMaintenanceIssue, RuleMaintenanceRuntimeInfo, RuleValidateUpstreamRequest, RuleValidateUpstreamResponse, RuleSchemaDiffResponse, RuleRepairPlanResponse, JSONPatchOperation, RulePatchPreviewResponse, ApiAuthRequiredDetails, ApiAuthRequiredHandler, ApiCacheKey, } from './types';
|
|
16
5
|
export { ApiProvider, apiProvider, normalizeApiProviderBaseUrl, normalizeApiV1BaseUrl, type EditorApiConfig } from './ApiProvider';
|
|
6
|
+
export { ComponentCatalogCache, componentCatalogCache, type ComponentCatalogCacheOptions, type ComponentCatalogLoadOptions, } from './ComponentCatalogCache';
|
|
17
7
|
export { AIManager, aiManager } from './AIManager';
|
|
18
8
|
export { DebugSocketClient } from './DebugSocketClient';
|
|
19
|
-
|
|
9
|
+
export type { DebugSocketClientOptions } from './DebugSocketClient';
|