@fudanda/workflow 0.0.0-stage → 1.20261015.1-beta.1
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/LICENSE +21 -0
- package/README.md +113 -2
- package/THIRD-PARTY-NOTICES.md +57 -0
- package/dist/ai-markdown-esl-I5ck.js +7 -0
- package/dist/chrome.d.ts +11 -0
- package/dist/chrome.js +358 -0
- package/dist/core.d.ts +11 -0
- package/dist/core.js +3 -0
- package/dist/coze/compat/base.d.ts +116 -0
- package/dist/coze/control-icon.d.ts +15 -0
- package/dist/coze/execution-panel.d.ts +8 -0
- package/dist/coze/schema-tree.d.ts +9 -0
- package/dist/coze/side-panel.d.ts +12 -0
- package/dist/coze/source/form-extensions/components/output-tree/components/custom-tree-node/constants.d.ts +13 -0
- package/dist/coze/source/form-extensions/components/output-tree/components/custom-tree-node/type.d.ts +34 -0
- package/dist/coze/start-form.d.ts +9 -0
- package/dist/coze/test-input.d.ts +9 -0
- package/dist/coze/test-run-button.d.ts +4 -0
- package/dist/coze/workflow-header.d.ts +5 -0
- package/dist/designer.d.ts +2 -0
- package/dist/flowgram-designer.d.ts +62 -0
- package/dist/graph-scope.d.ts +147 -0
- package/dist/header-shortcuts-BQZuNfpA.js +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8694 -0
- package/dist/input-fields.d.ts +4 -0
- package/dist/panel-focus.d.ts +3 -0
- package/dist/prompt-kit.d.ts +47 -0
- package/dist/result-preview.d.ts +5 -0
- package/dist/schema-tree-CTM6hEdm.js +309 -0
- package/dist/start-form-D_J3UIoE.js +9330 -0
- package/dist/styles.css +2 -0
- package/dist/templates.d.ts +1 -0
- package/dist/test-input-validation-CkORPCfm.js +55 -0
- package/dist/test-input-validation.d.ts +11 -0
- package/dist/theme.d.ts +17 -0
- package/package.json +103 -4
- package/vendor/coze/LICENSE-APACHE +177 -0
- package/vendor/coze/UPSTREAM.json +2247 -0
- package/vendor/coze/original/base-test-button.tsx +22 -0
- package/vendor/coze/original/comment-container.tsx +68 -0
- package/vendor/coze/original/condition-container.tsx +60 -0
- package/vendor/coze/original/condition-tag.tsx +58 -0
- package/vendor/coze/original/coze-global.less +234 -0
- package/vendor/coze/original/create-loop-function-json.ts +134 -0
- package/vendor/coze/original/create-loop-function.ts +56 -0
- package/vendor/coze/original/end-registry.ts +41 -0
- package/vendor/coze/original/execute-result-panel.less +97 -0
- package/vendor/coze/original/execute-result-panel.tsx +171 -0
- package/vendor/coze/original/form-item.less +39 -0
- package/vendor/coze/original/form-item.tsx +200 -0
- package/vendor/coze/original/http-api-field.tsx +42 -0
- package/vendor/coze/original/http-form-render.tsx +102 -0
- package/vendor/coze/original/icon-add.svg +3 -0
- package/vendor/coze/original/icon-arrow-left.svg +3 -0
- package/vendor/coze/original/icon-auto-layout.svg +18 -0
- package/vendor/coze/original/icon-batch.jpg +0 -0
- package/vendor/coze/original/icon-break.jpg +0 -0
- package/vendor/coze/original/icon-code.svg +13 -0
- package/vendor/coze/original/icon-condition.jpg +0 -0
- package/vendor/coze/original/icon-condition.svg +12 -0
- package/vendor/coze/original/icon-continue.jpg +0 -0
- package/vendor/coze/original/icon-database-query.jpg +0 -0
- package/vendor/coze/original/icon-database-update.jpg +0 -0
- package/vendor/coze/original/icon-database.svg +18 -0
- package/vendor/coze/original/icon-delete.svg +5 -0
- package/vendor/coze/original/icon-end.jpg +0 -0
- package/vendor/coze/original/icon-fullscreen.svg +9 -0
- package/vendor/coze/original/icon-http.jpg +0 -0
- package/vendor/coze/original/icon-intent.jpg +0 -0
- package/vendor/coze/original/icon-json-parser.jpg +0 -0
- package/vendor/coze/original/icon-json-stringify.jpg +0 -0
- package/vendor/coze/original/icon-llm.jpg +0 -0
- package/vendor/coze/original/icon-loop.jpg +0 -0
- package/vendor/coze/original/icon-more.svg +11 -0
- package/vendor/coze/original/icon-play-round-outlined.svg +8 -0
- package/vendor/coze/original/icon-plugin-tool.svg +6 -0
- package/vendor/coze/original/icon-standard-copy.svg +8 -0
- package/vendor/coze/original/icon-start.jpg +0 -0
- package/vendor/coze/original/icon-text.jpg +0 -0
- package/vendor/coze/original/icon-unknown.svg +7 -0
- package/vendor/coze/original/icon-var.svg +6 -0
- package/vendor/coze/original/icon-variable-assign.jpg +0 -0
- package/vendor/coze/original/icon-variable-merge.jpg +0 -0
- package/vendor/coze/original/icon-workflow-end.svg +5 -0
- package/vendor/coze/original/icon-workflow-start.svg +5 -0
- package/vendor/coze/original/icon-workflow.jpg +0 -0
- package/vendor/coze/original/icon-workflow.svg +21 -0
- package/vendor/coze/original/icon-workflows.svg +5 -0
- package/vendor/coze/original/if-form-meta.tsx +88 -0
- package/vendor/coze/original/logic-display.tsx +33 -0
- package/vendor/coze/original/mouse-icon.tsx +35 -0
- package/vendor/coze/original/mouse-pad-selector.tsx +180 -0
- package/vendor/coze/original/node-card.tsx +77 -0
- package/vendor/coze/original/node-category-panel.less +4 -0
- package/vendor/coze/original/node-category-panel.tsx +53 -0
- package/vendor/coze/original/node-config-form.tsx +67 -0
- package/vendor/coze/original/node-header.less +165 -0
- package/vendor/coze/original/node-header.tsx +552 -0
- package/vendor/coze/original/node-panel.less +183 -0
- package/vendor/coze/original/node-render.less +20 -0
- package/vendor/coze/original/node-side-sheet.less +57 -0
- package/vendor/coze/original/node-side-sheet.tsx +214 -0
- package/vendor/coze/original/node-wrapper.tsx +71 -0
- package/vendor/coze/original/pad-icon.tsx +45 -0
- package/vendor/coze/original/resizable-side-panel-constants.ts +18 -0
- package/vendor/coze/original/resizable-side-panel.tsx +42 -0
- package/vendor/coze/original/start-registry.ts +53 -0
- package/vendor/coze/original/sub-canvas-background.less +4 -0
- package/vendor/coze/original/sub-canvas-background.tsx +48 -0
- package/vendor/coze/original/sub-canvas-container.less +16 -0
- package/vendor/coze/original/sub-canvas-container.tsx +97 -0
- package/vendor/coze/original/sub-canvas-header.less +75 -0
- package/vendor/coze/original/sub-canvas-header.tsx +95 -0
- package/vendor/coze/original/test-form-sheet-header.tsx +82 -0
- package/vendor/coze/original/test-form-sheet.less +178 -0
- package/vendor/coze/original/toolbar-add-node.tsx +68 -0
- package/vendor/coze/original/toolbar-auto-layout.tsx +61 -0
- package/vendor/coze/original/toolbar-comment.tsx +121 -0
- package/vendor/coze/original/toolbar-container.tsx +42 -0
- package/vendor/coze/original/toolbar-interactive.tsx +98 -0
- package/vendor/coze/original/toolbar-minimap-switch.tsx +41 -0
- package/vendor/coze/original/toolbar-tools.less +46 -0
- package/vendor/coze/original/toolbar-tools.tsx +89 -0
- package/vendor/coze/original/toolbar-zoom.tsx +134 -0
- package/vendor/coze/original/tree-variable-selector.less +292 -0
- package/vendor/coze/original/tree-variable-selector.tsx +298 -0
- package/vendor/coze/original/workflow-document-custom-options.ts +151 -0
- package/vendor/coze/original/workflow-header.less +65 -0
- package/vendor/coze/original/workflow-header.tsx +85 -0
- package/vendor/coze/source/agent-models/model-option/index.module.less +19 -0
- package/vendor/coze/source/agent-models/model-option/index.tsx +321 -0
- package/vendor/coze/source/agent-models/model-option-avatar/index.tsx +175 -0
- package/vendor/coze/source/agent-models/model-option-group/index.tsx +87 -0
- package/vendor/coze/source/agent-models/model-option-thumb/index.tsx +41 -0
- package/vendor/coze/source/agent-models/model-select-ui/index.tsx +238 -0
- package/vendor/coze/source/agent-models/popover-model-list-view/index.tsx +146 -0
- package/vendor/coze/source/components/code-editor/text-editor.tsx +71 -0
- package/vendor/coze/source/components/comment/components/editor/block.tsx +117 -0
- package/vendor/coze/source/components/comment/components/editor/leaf.tsx +64 -0
- package/vendor/coze/source/components/comment/components/toolbar.tsx +366 -0
- package/vendor/coze/source/components/comment/constant.ts +94 -0
- package/vendor/coze/source/components/editor-container/expand-editor/index.module.less +107 -0
- package/vendor/coze/source/components/editor-container/expand-editor/index.tsx +117 -0
- package/vendor/coze/source/components/model-select/components/model-setting.tsx +300 -0
- package/vendor/coze/source/components/model-select/components/settings.tsx +144 -0
- package/vendor/coze/source/components/model-select/index.module.less +34 -0
- package/vendor/coze/source/components/model-select/utils/index.tsx +100 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/constants.tsx +79 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field-empty.module.less +12 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field-empty.tsx +37 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field.module.less +19 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field.tsx +52 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/http-api-field/index.tsx +42 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/overflow-tag-list.module.less +47 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/overflow-tag-list.tsx +162 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/variable-tag-list.module.less +48 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/variable-tag-list.tsx +126 -0
- package/vendor/coze/source/components/node-wrapper/execute-result-panel/index.module.less +97 -0
- package/vendor/coze/source/components/node-wrapper/execute-result-panel/index.tsx +171 -0
- package/vendor/coze/source/components/sub-canvas/components/background/index.module.less +4 -0
- package/vendor/coze/source/components/sub-canvas/components/header/index.module.less +75 -0
- package/vendor/coze/source/components/test-run/test-run-button/single-node.tsx +158 -0
- package/vendor/coze/source/execution-panel/panel.module.less +48 -0
- package/vendor/coze/source/execution-panel/panel.tsx +99 -0
- package/vendor/coze/source/execution-panel/use-resize.ts +79 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/constants.ts +28 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/context.ts +21 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/create-store.ts +48 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/index.ts +19 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/provider.tsx +50 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/data-viewer.module.less +26 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/data-viewer.tsx +79 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/index.ts +18 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-data-viewer-store.ts +29 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-expand.ts +35 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-value.tsx +66 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/index.tsx +21 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/json-field/index.tsx +186 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/json-field/json-field.module.less +79 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/types.ts +50 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/utils/big-number.ts +35 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/utils/generate-field.ts +104 -0
- package/vendor/coze/source/external/features/log/components/log-parser/log-wrap.module.less +27 -0
- package/vendor/coze/source/external/features/log/components/log-parser/log-wrap.tsx +109 -0
- package/vendor/coze/source/external/features/log/components/node-status-bar/node-status-bar.module.less +52 -0
- package/vendor/coze/source/external/features/log/components/node-status-bar/node-status-bar.tsx +113 -0
- package/vendor/coze/source/form/components/field-empty.tsx +45 -0
- package/vendor/coze/source/form/components/section.tsx +91 -0
- package/vendor/coze/source/form-extensions/components/add-item-button/index.tsx +64 -0
- package/vendor/coze/source/form-extensions/components/form-card/index.module.less +131 -0
- package/vendor/coze/source/form-extensions/components/form-card/index.tsx +309 -0
- package/vendor/coze/source/form-extensions/components/form-item/index.module.less +39 -0
- package/vendor/coze/source/form-extensions/components/form-item/index.tsx +200 -0
- package/vendor/coze/source/form-extensions/components/form-item-feedback/index.module.less +7 -0
- package/vendor/coze/source/form-extensions/components/form-item-feedback/index.tsx +39 -0
- package/vendor/coze/source/form-extensions/components/level-line/index.module.less +346 -0
- package/vendor/coze/source/form-extensions/components/level-line/index.ts +17 -0
- package/vendor/coze/source/form-extensions/components/level-line/level-line.tsx +460 -0
- package/vendor/coze/source/form-extensions/components/level-line/types.ts +38 -0
- package/vendor/coze/source/form-extensions/components/level-line/utils.ts +60 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/constants.ts +61 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-boolean.tsx +80 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-integer.tsx +68 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-number.tsx +62 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-select.tsx +59 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-string.tsx +55 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/literal-value-input.tsx +35 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/styles.module.less +46 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/type.ts +61 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/utils.tsx +117 -0
- package/vendor/coze/source/form-extensions/components/node-header/components/close-button.tsx +44 -0
- package/vendor/coze/source/form-extensions/components/node-header/description-display.tsx +52 -0
- package/vendor/coze/source/form-extensions/components/node-header/description.tsx +131 -0
- package/vendor/coze/source/form-extensions/components/node-header/index.module.less +165 -0
- package/vendor/coze/source/form-extensions/components/node-header/index.tsx +552 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-btn/index.tsx +43 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/default-value-input.tsx +276 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/index.module.less +124 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/index.tsx +131 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/types.ts +32 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-name/index.module.less +38 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-name/index.tsx +101 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-operator/index.module.less +51 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-operator/index.tsx +107 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-required/index.module.less +17 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-required/index.tsx +53 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/constants.tsx +77 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/index.module.less +97 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/index.tsx +155 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/constants.ts +38 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/index.module.less +138 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/index.tsx +360 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/type.ts +88 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/header/index.module.less +36 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/header/index.tsx +104 -0
- package/vendor/coze/source/form-extensions/components/output-tree/constants.ts +22 -0
- package/vendor/coze/source/form-extensions/components/output-tree/context.ts +28 -0
- package/vendor/coze/source/form-extensions/components/output-tree/hooks/use-columns-style.ts +39 -0
- package/vendor/coze/source/form-extensions/components/output-tree/index.module.less +83 -0
- package/vendor/coze/source/form-extensions/components/output-tree/index.tsx +692 -0
- package/vendor/coze/source/form-extensions/components/output-tree/utils.ts +185 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/index.tsx +97 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/option-item.tsx +30 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/types.ts +23 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/retry-times/index.tsx +45 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/timeout/index.tsx +102 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select-option.tsx +167 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select-tree-panel.tsx +165 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select.module.less +96 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select.tsx +265 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/context.tsx +42 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/expand-icon.tsx +30 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/index.module.less +292 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/node-variable-tree.module.less +49 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/node-variable-tree.tsx +149 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/utils.tsx +500 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/value-display.tsx +130 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/const.ts +68 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/context.ts +27 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/index.module.less +144 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/value-expression-input.tsx +418 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/constants.tsx +77 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/index.module.less +31 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/index.tsx +17 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/utils.tsx +298 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/variable-type-selector.tsx +235 -0
- package/vendor/coze/source/form-extensions/components/variable-type-tag/index.tsx +54 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-branch.module.less +9 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-branch.tsx +249 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-header.tsx +50 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-item-logic.module.less +13 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-item-logic.tsx +73 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/delete/index.module.less +10 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/delete/index.tsx +42 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/index.module.less +9 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/index.tsx +254 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/operator/index.module.less +7 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/operator/index.tsx +144 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/value-expression-with-state/index.tsx +69 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/context.ts +36 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/condition-branch-preview.tsx +44 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/condition-branch.tsx +152 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/container.tsx +19 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/custom-drag-layer.tsx +117 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/types.ts +18 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/types.ts +58 -0
- package/vendor/coze/source/node-registries/end/components/terminate-plan-field.tsx +29 -0
- package/vendor/coze/source/node-registries/end/constants.ts +34 -0
- package/vendor/coze/source/node-registries/end/form.tsx +66 -0
- package/vendor/coze/source/node-registries/end/types.ts +45 -0
- package/vendor/coze/source/node-registries/http/components/base-editor/raw-text-editor.tsx +80 -0
- package/vendor/coze/source/node-registries/http/constants.ts +80 -0
- package/vendor/coze/source/node-registries/http/fields/json-import-editor/index.module.less +191 -0
- package/vendor/coze/source/node-registries/http/fields/json-import-editor/json-import-components/json-expand-editor.tsx +141 -0
- package/vendor/coze/source/node-registries/http/fields/json-import-editor/json-import-components/json-import.tsx +99 -0
- package/vendor/coze/source/node-registries/http/form-render.tsx +102 -0
- package/vendor/coze/source/node-registries/http/setters/api/curl-expand-editor.tsx +161 -0
- package/vendor/coze/source/node-registries/http/setters/api/curl-import.tsx +96 -0
- package/vendor/coze/source/node-registries/http/setters/api/index.module.less +199 -0
- package/vendor/coze/source/node-registries/http/setters/api/index.tsx +149 -0
- package/vendor/coze/source/node-registries/http/setters/api/utils.ts +41 -0
- package/vendor/coze/source/node-registries/http/setters/body/index.tsx +201 -0
- package/vendor/coze/source/node-registries/http/setters/constants.ts +83 -0
- package/vendor/coze/source/node-registries/if/components/else/index.tsx +41 -0
- package/vendor/coze/source/node-registries/intent/components/intents/index.module.less +15 -0
- package/vendor/coze/source/node-registries/intent/components/intents/option-item/index.tsx +189 -0
- package/vendor/coze/source/node-registries/json-stringify/constants.ts +32 -0
- package/vendor/coze/source/node-registries/json-stringify/form.tsx +46 -0
- package/vendor/coze/source/node-registries/loop/constants.ts +43 -0
- package/vendor/coze/source/node-registries/loop/loop-fields/loop-settings-section/index.tsx +48 -0
- package/vendor/coze/source/node-registries/loop/loop-fields/loop-type/index.tsx +81 -0
- package/vendor/coze/source/node-registries/loop/loop-fields/loop-type/options.ts +34 -0
- package/vendor/coze/source/node-registries/start/form.tsx +209 -0
- package/vendor/coze/source/node-registries/text-process/components/method-selector/index.tsx +46 -0
- package/vendor/coze/source/node-registries/text-process/constants.ts +132 -0
- package/vendor/coze/source/nodes-v2/components/form-item-feedback/index.module.less +7 -0
- package/vendor/coze/source/nodes-v2/components/form-item-feedback/index.tsx +47 -0
- package/vendor/coze/source/nodes-v2/components/system-prompt/index.module.less +66 -0
- package/vendor/coze/source/nodes-v2/components/system-prompt/prompt-kit-bar.tsx +129 -0
- package/vendor/coze/source/nodes-v2/components/system-prompt/system-prompt-editor.tsx +110 -0
- package/vendor/coze/source/nodes-v2/llm/user-prompt/index.tsx +64 -0
- package/vendor/coze/source/prompt-kit/input-config-popover/index.tsx +80 -0
- package/vendor/coze/source/prompt-kit/input-slot-widget/index.css +34 -0
- package/vendor/coze/source/prompt-kit/input-slot-widget/index.ts +169 -0
- package/vendor/coze/source/prompt-kit/library-item.tsx +141 -0
- package/vendor/coze/source/prompt-kit/prompt-info-input.tsx +90 -0
- package/vendor/coze/source/ui-components/add-operation/index.module.less +19 -0
- package/vendor/coze/source/ui-components/add-operation/index.tsx +67 -0
- package/vendor/coze/source/ui-components/auto-size-tooltip/index.module.less +39 -0
- package/vendor/coze/source/ui-components/auto-size-tooltip/index.tsx +74 -0
- package/vendor/coze/source/ui-components/workflow-sl-input/index.module.less +36 -0
- package/vendor/coze/source/ui-components/workflow-sl-input/index.tsx +194 -0
- package/vendor/coze/source/utils/create-slots/index.tsx +126 -0
- package/vendor/coze/source/utils/create-slots/use-force-update.ts +23 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.font-normal {
|
|
2
|
+
color: var(--light-usage-text-color-text-0, #1D1C23);
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
line-height: 22px;
|
|
7
|
+
/* 157.143% */
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: -46px;
|
|
13
|
+
left: calc(100% + 16px);
|
|
14
|
+
width: 380px;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
background: var(--light-color-grey-grey-0, #F7F7FA);
|
|
17
|
+
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.30), 0px 4px 68px 3px rgba(0, 0, 0, 0.14);
|
|
18
|
+
|
|
19
|
+
.wrapper {
|
|
20
|
+
position: relative;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 24px;
|
|
23
|
+
|
|
24
|
+
.delete-icon {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 16px;
|
|
29
|
+
right: 16px;
|
|
30
|
+
padding: 4px;
|
|
31
|
+
|
|
32
|
+
.icon {
|
|
33
|
+
width: 16px;
|
|
34
|
+
height: 16px;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
&>span {
|
|
38
|
+
width: 16px;
|
|
39
|
+
height: 16px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.title {
|
|
45
|
+
display: block;
|
|
46
|
+
.font-normal();
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
color: var(--light-usage-text-color-text-0, #1C1F23);
|
|
49
|
+
font-size: 18px;
|
|
50
|
+
line-height: 24px;
|
|
51
|
+
/* 133.333% */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.content {
|
|
55
|
+
margin-top: 32px;
|
|
56
|
+
|
|
57
|
+
.icon-config {
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
color: rgba(107, 109, 117, 1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.block-item {
|
|
63
|
+
margin-top: 12px;
|
|
64
|
+
|
|
65
|
+
&:first-child {
|
|
66
|
+
margin-top: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.info {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
|
|
73
|
+
.label {
|
|
74
|
+
.font-normal();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.copy {
|
|
78
|
+
margin-left: 8px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.code {
|
|
83
|
+
max-height: 280px;
|
|
84
|
+
border-radius: 8px;
|
|
85
|
+
border: 1px solid var(--light-usage-border-color-border, rgba(29, 28, 35, 0.08));
|
|
86
|
+
background: var(--light-usage-disabled-color-disabled-fill, rgba(46, 46, 56, 0.04));
|
|
87
|
+
margin-top: 12px;
|
|
88
|
+
padding: 6px 16px;
|
|
89
|
+
overflow-y: auto;
|
|
90
|
+
user-select: text;
|
|
91
|
+
cursor: text;
|
|
92
|
+
white-space: break-spaces;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React, { useCallback } from 'react';
|
|
18
|
+
|
|
19
|
+
import copy from 'copy-to-clipboard';
|
|
20
|
+
import classNames from 'classnames';
|
|
21
|
+
import { FlowNodeFormData } from '@flowgram-adapter/free-layout-editor';
|
|
22
|
+
import { type FlowNodeEntity } from '@flowgram-adapter/free-layout-editor';
|
|
23
|
+
import { DEFAULT_NODE_META_PATH } from '@coze-workflow/nodes';
|
|
24
|
+
import { StandardNodeType } from '@coze-workflow/base';
|
|
25
|
+
import { REPORT_EVENTS } from '@coze-arch/report-events';
|
|
26
|
+
import { I18n } from '@coze-arch/i18n';
|
|
27
|
+
import { safeJSONParse } from '@coze-arch/bot-utils';
|
|
28
|
+
import { UIIconButton } from '@coze-arch/bot-semi';
|
|
29
|
+
import { IconCopy, IconWorkflowRunResultClose } from '@coze-arch/bot-icons';
|
|
30
|
+
import { CustomError } from '@coze-arch/bot-error';
|
|
31
|
+
import { Toast, Tooltip } from '@coze-arch/coze-design';
|
|
32
|
+
|
|
33
|
+
import { useExecStateEntity } from '../../../hooks';
|
|
34
|
+
|
|
35
|
+
import styles from './index.module.less';
|
|
36
|
+
|
|
37
|
+
type ExecuteResultPanelProps = React.PropsWithChildren<{
|
|
38
|
+
id: string;
|
|
39
|
+
node: FlowNodeEntity;
|
|
40
|
+
showResult: boolean;
|
|
41
|
+
onClose?: () => void;
|
|
42
|
+
className?: string;
|
|
43
|
+
style?: React.CSSProperties;
|
|
44
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* raw_output could be a JSON string or a native string
|
|
49
|
+
*/
|
|
50
|
+
const getSafeOutput = (
|
|
51
|
+
type?: StandardNodeType,
|
|
52
|
+
output?: string,
|
|
53
|
+
rawOutput?: string,
|
|
54
|
+
errorInfo?: string,
|
|
55
|
+
// eslint-disable-next-line max-params
|
|
56
|
+
) => {
|
|
57
|
+
let safeOutput = safeJSONParse(output, output) || {};
|
|
58
|
+
// The LLM CODE node needs to use the output package separately
|
|
59
|
+
if (type === StandardNodeType.LLM || type === StandardNodeType.Code) {
|
|
60
|
+
safeOutput = {
|
|
61
|
+
output: safeOutput,
|
|
62
|
+
};
|
|
63
|
+
if (safeOutput && rawOutput) {
|
|
64
|
+
safeOutput.raw_output = safeJSONParse(rawOutput, rawOutput);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (errorInfo) {
|
|
68
|
+
safeOutput.errorInfo = errorInfo;
|
|
69
|
+
}
|
|
70
|
+
return safeOutput;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const JSON_STRINGIFY_FORMAT_CODE = 2;
|
|
74
|
+
|
|
75
|
+
export default function ExecuteResultPanel({
|
|
76
|
+
id,
|
|
77
|
+
node,
|
|
78
|
+
showResult,
|
|
79
|
+
onClose,
|
|
80
|
+
className,
|
|
81
|
+
style,
|
|
82
|
+
onClick,
|
|
83
|
+
}: ExecuteResultPanelProps) {
|
|
84
|
+
const entity = useExecStateEntity();
|
|
85
|
+
|
|
86
|
+
const executeResult = entity.getNodeExecResult(id);
|
|
87
|
+
const type = node.flowNodeType as StandardNodeType;
|
|
88
|
+
const formData = node.getData(FlowNodeFormData);
|
|
89
|
+
const title = formData?.formModel.getFormItemValueByPath(
|
|
90
|
+
node.getNodeMeta().nodeMetaPath || DEFAULT_NODE_META_PATH,
|
|
91
|
+
)?.title;
|
|
92
|
+
|
|
93
|
+
const safeOutput = getSafeOutput(
|
|
94
|
+
type,
|
|
95
|
+
executeResult?.output,
|
|
96
|
+
executeResult?.raw_output,
|
|
97
|
+
executeResult?.errorInfo,
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const onCopy = useCallback((text: string) => {
|
|
101
|
+
const res = copy(text);
|
|
102
|
+
if (!res) {
|
|
103
|
+
throw new CustomError(REPORT_EVENTS.parmasValidation, 'empty copy');
|
|
104
|
+
}
|
|
105
|
+
Toast.success({
|
|
106
|
+
content: I18n.t('copy_success'),
|
|
107
|
+
showClose: false,
|
|
108
|
+
});
|
|
109
|
+
}, []);
|
|
110
|
+
|
|
111
|
+
const ShowValueOptions = [
|
|
112
|
+
{
|
|
113
|
+
label: I18n.t('workflow_detail_node_input'),
|
|
114
|
+
code: JSON.stringify(
|
|
115
|
+
safeJSONParse(executeResult?.input) ?? '{}',
|
|
116
|
+
undefined,
|
|
117
|
+
JSON_STRINGIFY_FORMAT_CODE,
|
|
118
|
+
),
|
|
119
|
+
copyTip: I18n.t('workflow_detail_title_testrun_copyinput'),
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: I18n.t('workflow_detail_node_output'),
|
|
123
|
+
code: JSON.stringify(safeOutput, undefined, JSON_STRINGIFY_FORMAT_CODE),
|
|
124
|
+
copyTip: I18n.t('workflow_detail_title_testrun_copyoutput'),
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
if (!showResult) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return (
|
|
132
|
+
<div
|
|
133
|
+
className={classNames(styles.container, className, 'flow-move-hot-zone')}
|
|
134
|
+
style={style}
|
|
135
|
+
onClick={onClick}
|
|
136
|
+
data-testid="workflow.detail.node.testrun.result-panel"
|
|
137
|
+
>
|
|
138
|
+
<div className={styles.wrapper}>
|
|
139
|
+
<div className={styles['delete-icon']} onClick={onClose}>
|
|
140
|
+
<IconWorkflowRunResultClose className={styles.icon} />
|
|
141
|
+
</div>
|
|
142
|
+
<span className={styles.title}>
|
|
143
|
+
{title} {I18n.t('workflow_detail_title_testrun_process')}
|
|
144
|
+
</span>
|
|
145
|
+
<div className={styles.content}>
|
|
146
|
+
{ShowValueOptions.map(item => (
|
|
147
|
+
<div className={styles['block-item']} key={item.label}>
|
|
148
|
+
<div className={styles.info}>
|
|
149
|
+
<span className={styles.label}>{item.label}</span>
|
|
150
|
+
<Tooltip content={item.copyTip}>
|
|
151
|
+
<UIIconButton
|
|
152
|
+
iconSize="small"
|
|
153
|
+
className={styles.copy}
|
|
154
|
+
icon={<IconCopy className={styles['icon-config']} />}
|
|
155
|
+
onClick={() => onCopy(item.code)}
|
|
156
|
+
/>
|
|
157
|
+
</Tooltip>
|
|
158
|
+
</div>
|
|
159
|
+
<pre
|
|
160
|
+
className={classNames(styles.code, 'nowheel')}
|
|
161
|
+
data-testid="workflow.detail.node.testrun.result-item"
|
|
162
|
+
>
|
|
163
|
+
{item.code}
|
|
164
|
+
</pre>
|
|
165
|
+
</div>
|
|
166
|
+
))}
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.form-item {
|
|
2
|
+
margin-bottom: 8px;
|
|
3
|
+
|
|
4
|
+
&:last-child {
|
|
5
|
+
margin-bottom: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.popover {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
margin-top: 2px;
|
|
11
|
+
margin-left: 4px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.form-item-label {
|
|
15
|
+
margin-bottom: 2px;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
overflow-wrap: break-word;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.form-item-vertical {
|
|
21
|
+
.form-item-label {
|
|
22
|
+
height: 20px;
|
|
23
|
+
margin-bottom: 4px;
|
|
24
|
+
padding-right: 16px;
|
|
25
|
+
line-height: 20px;
|
|
26
|
+
|
|
27
|
+
&.form-item-label-right {
|
|
28
|
+
text-align: right;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.form-item-error {
|
|
34
|
+
font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 22px;
|
|
37
|
+
color: rgb(255, 68, 30)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React, {
|
|
18
|
+
type FC,
|
|
19
|
+
type ReactNode,
|
|
20
|
+
type CSSProperties,
|
|
21
|
+
type PropsWithChildren,
|
|
22
|
+
} from 'react';
|
|
23
|
+
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import { type WithCustomStyle } from '@coze-workflow/base/types';
|
|
26
|
+
import { IconCozInfoCircle } from '@coze-arch/coze-design/icons';
|
|
27
|
+
import { Row, Col } from '@coze-arch/coze-design';
|
|
28
|
+
import { type ColProps } from '@coze-arch/bot-semi/Grid';
|
|
29
|
+
|
|
30
|
+
import {
|
|
31
|
+
FormItemFeedback,
|
|
32
|
+
type FormItemErrorProps,
|
|
33
|
+
} from '../form-item-feedback';
|
|
34
|
+
import AutoSizeTooltip from '../../../ui-components/auto-size-tooltip';
|
|
35
|
+
|
|
36
|
+
import s from './index.module.less';
|
|
37
|
+
|
|
38
|
+
export interface FormItemProps {
|
|
39
|
+
required?: boolean;
|
|
40
|
+
hideRequiredTag?: boolean;
|
|
41
|
+
layout?: 'horizontal' | 'vertical';
|
|
42
|
+
label?: ReactNode;
|
|
43
|
+
tooltip?: ReactNode;
|
|
44
|
+
tag?: ReactNode;
|
|
45
|
+
labelAlign?: 'left' | 'right';
|
|
46
|
+
labelCol?: ColProps;
|
|
47
|
+
wrapperCol?: ColProps;
|
|
48
|
+
labelBlockStyle?: CSSProperties;
|
|
49
|
+
labelStyle?: CSSProperties;
|
|
50
|
+
labelColStyle?: CSSProperties;
|
|
51
|
+
labelClassName?: string;
|
|
52
|
+
wrapperColStyle?: CSSProperties;
|
|
53
|
+
feedbackText?: FormItemErrorProps['feedbackText'];
|
|
54
|
+
feedbackStatus?: FormItemErrorProps['feedbackStatus'];
|
|
55
|
+
disableFeedback?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Since the semi-ui Form does not provide a FormItem component for layout, it encapsulates a FormItem separately and continues to iterate with requirements
|
|
60
|
+
*/
|
|
61
|
+
export const FormItem: FC<
|
|
62
|
+
PropsWithChildren<WithCustomStyle<FormItemProps>>
|
|
63
|
+
> = props => {
|
|
64
|
+
const {
|
|
65
|
+
className,
|
|
66
|
+
style = {},
|
|
67
|
+
required,
|
|
68
|
+
hideRequiredTag = false,
|
|
69
|
+
layout = 'horizontal',
|
|
70
|
+
label,
|
|
71
|
+
tooltip,
|
|
72
|
+
tag,
|
|
73
|
+
labelAlign = 'left',
|
|
74
|
+
labelCol = {
|
|
75
|
+
span: 9,
|
|
76
|
+
},
|
|
77
|
+
wrapperCol = {
|
|
78
|
+
span: 15,
|
|
79
|
+
},
|
|
80
|
+
labelBlockStyle = {},
|
|
81
|
+
labelStyle = {},
|
|
82
|
+
labelColStyle = {},
|
|
83
|
+
wrapperColStyle = {},
|
|
84
|
+
labelClassName,
|
|
85
|
+
feedbackText,
|
|
86
|
+
feedbackStatus,
|
|
87
|
+
children,
|
|
88
|
+
disableFeedback = false,
|
|
89
|
+
} = props;
|
|
90
|
+
const renderLabelContent = () => (
|
|
91
|
+
<div className="flex items-center">
|
|
92
|
+
<div className="flex overflow-hidden items-center">
|
|
93
|
+
<AutoSizeTooltip
|
|
94
|
+
content={label}
|
|
95
|
+
showArrow
|
|
96
|
+
position="top"
|
|
97
|
+
className="flex-1 grow-1 truncate"
|
|
98
|
+
>
|
|
99
|
+
<span
|
|
100
|
+
className={classNames(
|
|
101
|
+
'flex-1 grow-1 truncate coz-fg-primary text-[12px] leading-[24px]',
|
|
102
|
+
labelClassName,
|
|
103
|
+
)}
|
|
104
|
+
style={labelStyle}
|
|
105
|
+
>
|
|
106
|
+
{label}
|
|
107
|
+
</span>
|
|
108
|
+
</AutoSizeTooltip>
|
|
109
|
+
|
|
110
|
+
{required && !hideRequiredTag ? (
|
|
111
|
+
<span
|
|
112
|
+
className="mt-[2px]"
|
|
113
|
+
style={{ color: 'var(--light-usage-danger-color-danger,#f93920)' }}
|
|
114
|
+
>
|
|
115
|
+
*
|
|
116
|
+
</span>
|
|
117
|
+
) : null}
|
|
118
|
+
{tooltip ? (
|
|
119
|
+
<AutoSizeTooltip
|
|
120
|
+
showArrow
|
|
121
|
+
position="top"
|
|
122
|
+
className={s.popover}
|
|
123
|
+
content={tooltip}
|
|
124
|
+
>
|
|
125
|
+
<IconCozInfoCircle className="coz-fg-secondary text-xs" />
|
|
126
|
+
</AutoSizeTooltip>
|
|
127
|
+
) : null}
|
|
128
|
+
</div>
|
|
129
|
+
{tag ? (
|
|
130
|
+
<div className="flex-1 shrink-0 grow-1 flex items-center">{tag}</div>
|
|
131
|
+
) : null}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const showLabel = !!label;
|
|
136
|
+
if (layout === 'horizontal') {
|
|
137
|
+
return (
|
|
138
|
+
<div
|
|
139
|
+
className={classNames(s.formItem, className, {
|
|
140
|
+
[s.formItemHorizontal]: layout === 'horizontal',
|
|
141
|
+
})}
|
|
142
|
+
style={style}
|
|
143
|
+
>
|
|
144
|
+
<Row type="flex" align="middle">
|
|
145
|
+
<Col
|
|
146
|
+
{...labelCol}
|
|
147
|
+
style={{
|
|
148
|
+
...{ alignSelf: 'flex-start' },
|
|
149
|
+
...labelColStyle,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<div
|
|
153
|
+
className={classNames(s.formItemLabel, {
|
|
154
|
+
[s.formItemLabelRight]: labelAlign === 'right',
|
|
155
|
+
})}
|
|
156
|
+
>
|
|
157
|
+
{renderLabelContent()}
|
|
158
|
+
</div>
|
|
159
|
+
</Col>
|
|
160
|
+
<Col {...wrapperCol} style={wrapperColStyle}>
|
|
161
|
+
{children}
|
|
162
|
+
{!disableFeedback && (
|
|
163
|
+
<FormItemFeedback
|
|
164
|
+
feedbackText={feedbackText}
|
|
165
|
+
feedbackStatus={feedbackStatus}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
</Col>
|
|
169
|
+
</Row>
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
} else {
|
|
173
|
+
return (
|
|
174
|
+
<div
|
|
175
|
+
className={classNames(s.formItem, className, {
|
|
176
|
+
[s.formItemVertical]: layout === 'vertical',
|
|
177
|
+
})}
|
|
178
|
+
style={style}
|
|
179
|
+
>
|
|
180
|
+
{showLabel ? (
|
|
181
|
+
<div
|
|
182
|
+
className={classNames(s.formItemLabel, {
|
|
183
|
+
[s.formItemLabelRight]: labelAlign === 'right',
|
|
184
|
+
})}
|
|
185
|
+
style={labelBlockStyle}
|
|
186
|
+
>
|
|
187
|
+
{renderLabelContent()}
|
|
188
|
+
</div>
|
|
189
|
+
) : null}
|
|
190
|
+
<div>{children}</div>
|
|
191
|
+
{!disableFeedback && (
|
|
192
|
+
<FormItemFeedback
|
|
193
|
+
feedbackText={feedbackText}
|
|
194
|
+
feedbackStatus={feedbackStatus}
|
|
195
|
+
/>
|
|
196
|
+
)}
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from 'react';
|
|
18
|
+
|
|
19
|
+
import { PublicScopeProvider } from '@coze-workflow/variable';
|
|
20
|
+
import { useWorkflowNode } from '@coze-workflow/base';
|
|
21
|
+
|
|
22
|
+
import { Field } from '../field';
|
|
23
|
+
import { UrlContainer } from './url-container';
|
|
24
|
+
|
|
25
|
+
export function HttpApiField() {
|
|
26
|
+
const { data } = useWorkflowNode();
|
|
27
|
+
const apiInfo = data?.inputs?.apiInfo;
|
|
28
|
+
const apiUrl = data?.inputs?.apiInfo?.url;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Field
|
|
32
|
+
labelClassName="h-full"
|
|
33
|
+
label={<div className="leading-[22px]">{apiInfo?.method}</div>}
|
|
34
|
+
isEmpty={!apiUrl}
|
|
35
|
+
customEmptyLabel={'URL'}
|
|
36
|
+
>
|
|
37
|
+
<PublicScopeProvider>
|
|
38
|
+
<UrlContainer apiUrl={apiUrl} />
|
|
39
|
+
</PublicScopeProvider>
|
|
40
|
+
</Field>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { ValueExpressionType, ViewVariableType } from '@coze-workflow/base';
|
|
18
|
+
import { I18n } from '@coze-arch/i18n';
|
|
19
|
+
|
|
20
|
+
import { NodeConfigForm } from '@/node-registries/common/components';
|
|
21
|
+
import { Section, InputNumberField } from '@/form';
|
|
22
|
+
|
|
23
|
+
import { OutputsField, ParametersInputGroup } from '../common/fields';
|
|
24
|
+
import { ApiSetter, AuthSetter, BodySetter } from './setters';
|
|
25
|
+
import { INPUT_VALUE_COLUMNS } from './constants';
|
|
26
|
+
|
|
27
|
+
const Render = () => (
|
|
28
|
+
<NodeConfigForm>
|
|
29
|
+
<ApiSetter />
|
|
30
|
+
<ParametersInputGroup
|
|
31
|
+
name="inputs.params"
|
|
32
|
+
title={I18n.t('node_http_request_params')}
|
|
33
|
+
tooltip={I18n.t('node_http_request_params_desc')}
|
|
34
|
+
hiddenTypes
|
|
35
|
+
defaultValue={[]}
|
|
36
|
+
columns={INPUT_VALUE_COLUMNS}
|
|
37
|
+
inputType={ViewVariableType.String}
|
|
38
|
+
/>
|
|
39
|
+
<ParametersInputGroup
|
|
40
|
+
name="inputs.headers"
|
|
41
|
+
title={I18n.t('node_http_headers')}
|
|
42
|
+
tooltip={I18n.t('node_http_headers_desc')}
|
|
43
|
+
hiddenTypes
|
|
44
|
+
defaultValue={[]}
|
|
45
|
+
columns={INPUT_VALUE_COLUMNS}
|
|
46
|
+
defaultAppendValue={{
|
|
47
|
+
name: '',
|
|
48
|
+
type: ViewVariableType.String,
|
|
49
|
+
input: { type: ValueExpressionType.LITERAL, content: '' },
|
|
50
|
+
}}
|
|
51
|
+
inputType={ViewVariableType.String}
|
|
52
|
+
/>
|
|
53
|
+
<AuthSetter setterName="inputs.auth" />
|
|
54
|
+
|
|
55
|
+
<BodySetter setterName="inputs.body" />
|
|
56
|
+
|
|
57
|
+
<Section title={I18n.t('node_http_timeout_setting')}>
|
|
58
|
+
<InputNumberField
|
|
59
|
+
name="inputs.setting.timeout"
|
|
60
|
+
defaultValue={120}
|
|
61
|
+
max={180}
|
|
62
|
+
min={0}
|
|
63
|
+
className="w-full"
|
|
64
|
+
style={{
|
|
65
|
+
height: '24px',
|
|
66
|
+
borderColor: 'var(--Stroke-COZ-stroke-plus, rgba(84, 97, 156, 0.27))',
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</Section>
|
|
70
|
+
<Section title={I18n.t('node_http_retry_count')}>
|
|
71
|
+
<InputNumberField
|
|
72
|
+
name="inputs.setting.retryTimes"
|
|
73
|
+
defaultValue={3}
|
|
74
|
+
max={10}
|
|
75
|
+
min={0}
|
|
76
|
+
className="w-full"
|
|
77
|
+
style={{
|
|
78
|
+
height: '24px',
|
|
79
|
+
borderColor: 'var(--Stroke-COZ-stroke-plus, rgba(84, 97, 156, 0.27))',
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
</Section>
|
|
83
|
+
<OutputsField
|
|
84
|
+
title={I18n.t('workflow_detail_node_output')}
|
|
85
|
+
tooltip={I18n.t('node_http_response_data')}
|
|
86
|
+
id="database-node-outputs"
|
|
87
|
+
name="outputs"
|
|
88
|
+
topLevelReadonly={true}
|
|
89
|
+
disabledTypes={[
|
|
90
|
+
ViewVariableType.Object,
|
|
91
|
+
ViewVariableType.ArrayBoolean,
|
|
92
|
+
ViewVariableType.ArrayObject,
|
|
93
|
+
ViewVariableType.ArrayInteger,
|
|
94
|
+
ViewVariableType.ArrayNumber,
|
|
95
|
+
ViewVariableType.ArrayString,
|
|
96
|
+
]}
|
|
97
|
+
customReadonly
|
|
98
|
+
/>
|
|
99
|
+
</NodeConfigForm>
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export default Render;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12 2C11.4477 2 11 2.44772 11 3V11H3C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13H11V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V13H21C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11H13V3C13 2.44772 12.5523 2 12 2Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M10.8619 1.52864C11.1223 1.78899 11.1223 2.2111 10.8619 2.47145L5.33333 8.00004L10.8619 13.5286C11.1223 13.789 11.1223 14.2111 10.8619 14.4714C10.6016 14.7318 10.1795 14.7318 9.91912 14.4714L4.39052 8.94285C3.86983 8.42215 3.86982 7.57793 4.39052 7.05723L9.91912 1.52864C10.1795 1.26829 10.6016 1.26829 10.8619 1.52864Z" fill="#1D1C23" fill-opacity="0.6"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<mask id="path-1-inside-1_6392_67566" fill="white">
|
|
3
|
+
<rect x="1.33325" y="1.33398" width="6" height="7.33333" rx="0.666667"/>
|
|
4
|
+
</mask>
|
|
5
|
+
<rect x="1.33325" y="1.33398" width="6" height="7.33333" rx="0.666667" stroke="#1D1C23" stroke-opacity="0.8" stroke-width="2.66667" mask="url(#path-1-inside-1_6392_67566)"/>
|
|
6
|
+
<mask id="path-2-inside-2_6392_67566" fill="white">
|
|
7
|
+
<rect x="14.6667" y="14.666" width="6" height="7.33333" rx="0.666667"/>
|
|
8
|
+
</mask>
|
|
9
|
+
<rect x="14.6667" y="14.666" width="6" height="7.33333" rx="0.666667" transform="rotate(180 14.6667 14.666)" stroke="#1D1C23" stroke-opacity="0.8" stroke-width="2.66667" mask="url(#path-2-inside-2_6392_67566)"/>
|
|
10
|
+
<mask id="path-3-inside-3_6392_67566" fill="white">
|
|
11
|
+
<rect x="1.33325" y="10" width="6" height="4.66667" rx="0.666667"/>
|
|
12
|
+
</mask>
|
|
13
|
+
<rect x="1.33325" y="10" width="6" height="4.66667" rx="0.666667" stroke="#1D1C23" stroke-opacity="0.8" stroke-width="2.66667" mask="url(#path-3-inside-3_6392_67566)"/>
|
|
14
|
+
<mask id="path-4-inside-4_6392_67566" fill="white">
|
|
15
|
+
<rect x="14.6667" y="6" width="6" height="4.66667" rx="0.666667"/>
|
|
16
|
+
</mask>
|
|
17
|
+
<rect x="14.6667" y="6" width="6" height="4.66667" rx="0.666667" transform="rotate(180 14.6667 6)" stroke="#1D1C23" stroke-opacity="0.8" stroke-width="2.66667" mask="url(#path-4-inside-4_6392_67566)"/>
|
|
18
|
+
</svg>
|
|
Binary file
|
|
Binary file
|