@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,189 @@
|
|
|
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, { forwardRef } from 'react';
|
|
18
|
+
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import { type FieldError } from '@flowgram-adapter/free-layout-editor';
|
|
21
|
+
import { IconHandle } from '@douyinfe/semi-icons';
|
|
22
|
+
import { useNodeTestId } from '@coze-workflow/base';
|
|
23
|
+
import { IconCozMinusCircle } from '@coze-arch/coze-design/icons';
|
|
24
|
+
import { IconButton } from '@coze-arch/coze-design';
|
|
25
|
+
|
|
26
|
+
import { FormItemFeedback } from '@/nodes-v2/components/form-item-feedback';
|
|
27
|
+
import { ExpressionEditor } from '@/nodes-v2/components/expression-editor';
|
|
28
|
+
import { useField, withField } from '@/form';
|
|
29
|
+
|
|
30
|
+
import styles from '../index.module.less';
|
|
31
|
+
|
|
32
|
+
export interface OptionItemProps {
|
|
33
|
+
index?: number;
|
|
34
|
+
optionName: string;
|
|
35
|
+
content: string;
|
|
36
|
+
portId?: string;
|
|
37
|
+
canDrag?: boolean;
|
|
38
|
+
readonly?: boolean;
|
|
39
|
+
className?: string;
|
|
40
|
+
disableDelete?: boolean;
|
|
41
|
+
showOptionName?: boolean;
|
|
42
|
+
optionPlaceholder?: string;
|
|
43
|
+
optionEnableInterpolation?: boolean;
|
|
44
|
+
onChange?: (val: string) => void;
|
|
45
|
+
onDelete?: () => void;
|
|
46
|
+
errors?: FieldError[];
|
|
47
|
+
name?: string;
|
|
48
|
+
onFocus?: () => void;
|
|
49
|
+
onBlur?: () => void;
|
|
50
|
+
isField?: boolean;
|
|
51
|
+
testIdPath?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const Item = (props: OptionItemProps) => {
|
|
55
|
+
const {
|
|
56
|
+
content,
|
|
57
|
+
portId,
|
|
58
|
+
readonly = false,
|
|
59
|
+
disableDelete,
|
|
60
|
+
onChange,
|
|
61
|
+
onDelete,
|
|
62
|
+
optionPlaceholder,
|
|
63
|
+
optionEnableInterpolation,
|
|
64
|
+
errors,
|
|
65
|
+
onFocus,
|
|
66
|
+
onBlur,
|
|
67
|
+
testIdPath,
|
|
68
|
+
name = '',
|
|
69
|
+
} = props;
|
|
70
|
+
|
|
71
|
+
const { getNodeSetterId, concatTestId } = useNodeTestId();
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div className="w-full">
|
|
75
|
+
<div className="flex items-center space-x-1 w-full min-h-[24px]">
|
|
76
|
+
{!readonly ? (
|
|
77
|
+
<ExpressionEditor
|
|
78
|
+
name={name}
|
|
79
|
+
testId={testIdPath}
|
|
80
|
+
value={content}
|
|
81
|
+
onChange={val => {
|
|
82
|
+
onChange?.(val);
|
|
83
|
+
}}
|
|
84
|
+
onFocus={() => onFocus?.()}
|
|
85
|
+
onBlur={() => onBlur?.()}
|
|
86
|
+
isError={errors && errors?.length > 0}
|
|
87
|
+
readonly={readonly}
|
|
88
|
+
minRows={1}
|
|
89
|
+
placeholder={optionPlaceholder}
|
|
90
|
+
disableSuggestion={!optionEnableInterpolation}
|
|
91
|
+
className="!p-[4px]"
|
|
92
|
+
containerClassName={classNames(
|
|
93
|
+
'!rounded-[6px]',
|
|
94
|
+
styles['option-expression-editor'],
|
|
95
|
+
!optionEnableInterpolation
|
|
96
|
+
? styles['expression-editor-no-interpolation']
|
|
97
|
+
: '',
|
|
98
|
+
)}
|
|
99
|
+
/>
|
|
100
|
+
) : (
|
|
101
|
+
<div className="w-full">{content}</div>
|
|
102
|
+
)}
|
|
103
|
+
|
|
104
|
+
<div>
|
|
105
|
+
{onDelete && !readonly ? (
|
|
106
|
+
<IconButton
|
|
107
|
+
size="small"
|
|
108
|
+
color="secondary"
|
|
109
|
+
data-testid={concatTestId(
|
|
110
|
+
getNodeSetterId('answer-option-item-delete'),
|
|
111
|
+
portId || '',
|
|
112
|
+
)}
|
|
113
|
+
className={classNames('flex', {
|
|
114
|
+
'cursor-pointer': !disableDelete,
|
|
115
|
+
'cursor-not-allowed': disableDelete,
|
|
116
|
+
'text-[--semi-color-tertiary-active]': disableDelete,
|
|
117
|
+
})}
|
|
118
|
+
onClick={() => {
|
|
119
|
+
if (disableDelete) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
onDelete();
|
|
123
|
+
}}
|
|
124
|
+
icon={<IconCozMinusCircle className="text-sm" />}
|
|
125
|
+
/>
|
|
126
|
+
) : null}
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<FormItemFeedback errors={errors} />
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const ItemField = withField((props: OptionItemProps) => {
|
|
136
|
+
const { onBlur, onFocus, errors } = useField();
|
|
137
|
+
|
|
138
|
+
return <Item {...props} errors={errors} onFocus={onFocus} onBlur={onBlur} />;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export const OptionItem = forwardRef<HTMLDivElement, OptionItemProps>(
|
|
142
|
+
(props, dragRef) => {
|
|
143
|
+
const {
|
|
144
|
+
canDrag,
|
|
145
|
+
portId,
|
|
146
|
+
readonly = false,
|
|
147
|
+
className,
|
|
148
|
+
optionName,
|
|
149
|
+
showOptionName,
|
|
150
|
+
isField,
|
|
151
|
+
name,
|
|
152
|
+
} = props;
|
|
153
|
+
|
|
154
|
+
const { getNodeSetterId, concatTestId } = useNodeTestId();
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<div
|
|
158
|
+
className={classNames('flex items-start space-x-1 text-xs', className)}
|
|
159
|
+
>
|
|
160
|
+
<div className="flex w-4 min-w-4 shrink-0 mt-[4px]">
|
|
161
|
+
{canDrag ? (
|
|
162
|
+
<IconHandle
|
|
163
|
+
data-testid={concatTestId(
|
|
164
|
+
getNodeSetterId('answer-option-item-handle'),
|
|
165
|
+
portId || '',
|
|
166
|
+
)}
|
|
167
|
+
data-disable-node-drag="true"
|
|
168
|
+
className={classNames({
|
|
169
|
+
'cursor-move': !readonly,
|
|
170
|
+
'pointer-events-none': readonly,
|
|
171
|
+
})}
|
|
172
|
+
ref={dragRef}
|
|
173
|
+
style={{ color: '#aaa' }}
|
|
174
|
+
/>
|
|
175
|
+
) : null}
|
|
176
|
+
</div>
|
|
177
|
+
{showOptionName ? (
|
|
178
|
+
<div className="break-keep min-w-[75px] mt-[5px]">{optionName}</div>
|
|
179
|
+
) : null}
|
|
180
|
+
|
|
181
|
+
{isField && name ? (
|
|
182
|
+
<ItemField {...props} name={name} hasFeedback={false} />
|
|
183
|
+
) : (
|
|
184
|
+
<Item {...props} />
|
|
185
|
+
)}
|
|
186
|
+
</div>
|
|
187
|
+
);
|
|
188
|
+
},
|
|
189
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { nanoid } from 'nanoid';
|
|
18
|
+
import { ViewVariableType } from '@coze-workflow/variable';
|
|
19
|
+
|
|
20
|
+
// Imported parameter path, practice running and other functions rely on this path to extract parameters
|
|
21
|
+
export const INPUT_PATH = 'inputs.inputParameters';
|
|
22
|
+
|
|
23
|
+
// Define fixed exported parameters
|
|
24
|
+
export const OUTPUTS = [
|
|
25
|
+
{
|
|
26
|
+
key: nanoid(),
|
|
27
|
+
name: 'output',
|
|
28
|
+
type: ViewVariableType.String,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
export const DEFAULT_INPUTS = [{ name: 'input' }];
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { I18n } from '@coze-arch/i18n';
|
|
18
|
+
|
|
19
|
+
import { NodeConfigForm } from '@/node-registries/common/components';
|
|
20
|
+
|
|
21
|
+
import { OutputsField } from '../common/fields';
|
|
22
|
+
import { INPUT_PATH } from './constants';
|
|
23
|
+
import { InputsField } from './components/inputs';
|
|
24
|
+
|
|
25
|
+
export const FormRender = () => (
|
|
26
|
+
<NodeConfigForm>
|
|
27
|
+
<InputsField
|
|
28
|
+
name={INPUT_PATH}
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
defaultValue={[{ name: 'input' } as any]}
|
|
31
|
+
title={I18n.t('node_http_request_params')}
|
|
32
|
+
tooltip={I18n.t('workflow_250429_03')}
|
|
33
|
+
required={false}
|
|
34
|
+
layout="horizontal"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<OutputsField
|
|
38
|
+
title={I18n.t('workflow_detail_node_output')}
|
|
39
|
+
tooltip={I18n.t('node_http_response_data')}
|
|
40
|
+
id="jsonStringify-node-outputs"
|
|
41
|
+
name="outputs"
|
|
42
|
+
topLevelReadonly={true}
|
|
43
|
+
customReadonly
|
|
44
|
+
/>
|
|
45
|
+
</NodeConfigForm>
|
|
46
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/* eslint-disable @typescript-eslint/naming-convention*/
|
|
18
|
+
export const LoopSize = {
|
|
19
|
+
width: 360,
|
|
20
|
+
height: 139.86,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const LoopFunctionSize = {
|
|
24
|
+
width: LoopSize.width,
|
|
25
|
+
height: (LoopSize.width * 3) / 5,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const LoopVariablePrefix = 'var_';
|
|
29
|
+
export const LoopOutputsSuffix = '_list';
|
|
30
|
+
|
|
31
|
+
export enum LoopPath {
|
|
32
|
+
LoopType = 'inputs.loopType',
|
|
33
|
+
LoopCount = 'inputs.loopCount',
|
|
34
|
+
LoopArray = 'inputs.inputParameters',
|
|
35
|
+
LoopVariables = 'inputs.variableParameters',
|
|
36
|
+
LoopOutputs = 'outputs',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export enum LoopType {
|
|
40
|
+
Array = 'array',
|
|
41
|
+
Count = 'count',
|
|
42
|
+
Infinite = 'infinite',
|
|
43
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 type { FC, ReactNode } from 'react';
|
|
18
|
+
|
|
19
|
+
import { useNodeTestId } from '@coze-workflow/base';
|
|
20
|
+
import { I18n } from '@coze-arch/i18n';
|
|
21
|
+
|
|
22
|
+
import { Section } from '@/form';
|
|
23
|
+
|
|
24
|
+
interface LoopSettingsFieldProps {
|
|
25
|
+
title?: string;
|
|
26
|
+
tooltip?: string;
|
|
27
|
+
testId?: string;
|
|
28
|
+
children?: ReactNode | ReactNode[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const LoopSettingsSection: FC<LoopSettingsFieldProps> = ({
|
|
32
|
+
title = I18n.t('workflow_loop_title'),
|
|
33
|
+
tooltip,
|
|
34
|
+
testId,
|
|
35
|
+
children,
|
|
36
|
+
}) => {
|
|
37
|
+
const { getNodeSetterId } = useNodeTestId();
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Section
|
|
41
|
+
title={title}
|
|
42
|
+
tooltip={tooltip}
|
|
43
|
+
testId={getNodeSetterId(testId ?? '')}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</Section>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { useCallback } from 'react';
|
|
18
|
+
|
|
19
|
+
import { useNodeTestId } from '@coze-workflow/base';
|
|
20
|
+
import { I18n } from '@coze-arch/i18n';
|
|
21
|
+
import { Select } from '@coze-arch/coze-design';
|
|
22
|
+
|
|
23
|
+
import { FormItem } from '@/form-extensions/components/form-item';
|
|
24
|
+
import { useField, withField } from '@/form';
|
|
25
|
+
|
|
26
|
+
import { LoopType } from '../../constants';
|
|
27
|
+
import { LoopTypeOptions } from './options';
|
|
28
|
+
|
|
29
|
+
interface LoopTypeFieldProps {
|
|
30
|
+
title?: string;
|
|
31
|
+
tooltip?: string;
|
|
32
|
+
testId?: string;
|
|
33
|
+
emptyContent?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const LoopTypeField = withField<LoopTypeFieldProps, LoopType>(
|
|
37
|
+
({
|
|
38
|
+
title = I18n.t('workflow_loop_type'),
|
|
39
|
+
tooltip = I18n.t('workflow_loop_type_tooltips'),
|
|
40
|
+
emptyContent = I18n.t('workflow_detail_node_nodata'),
|
|
41
|
+
testId,
|
|
42
|
+
}) => {
|
|
43
|
+
const { value, onChange, readonly } = useField<LoopType>();
|
|
44
|
+
|
|
45
|
+
const { getNodeSetterId, concatTestId } = useNodeTestId();
|
|
46
|
+
const computedTestId = concatTestId(getNodeSetterId('select'), value);
|
|
47
|
+
|
|
48
|
+
const onSelect = useCallback((selectedOption: unknown) => {
|
|
49
|
+
onChange(selectedOption as LoopType);
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<FormItem
|
|
54
|
+
label={title}
|
|
55
|
+
tooltip={tooltip}
|
|
56
|
+
layout="vertical"
|
|
57
|
+
labelStyle={{
|
|
58
|
+
fontSize: 12,
|
|
59
|
+
fontWeight: 600,
|
|
60
|
+
color: 'var(--coz-fg-secondary, rgba(6, 7, 9, 0.50))',
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<Select
|
|
64
|
+
size="small"
|
|
65
|
+
value={value}
|
|
66
|
+
optionList={LoopTypeOptions}
|
|
67
|
+
style={{
|
|
68
|
+
width: '100%',
|
|
69
|
+
pointerEvents: readonly ? 'none' : 'auto',
|
|
70
|
+
}}
|
|
71
|
+
onChange={onSelect}
|
|
72
|
+
data-testid={testId ?? computedTestId}
|
|
73
|
+
emptyContent={emptyContent}
|
|
74
|
+
/>
|
|
75
|
+
</FormItem>
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
defaultValue: LoopType.Array,
|
|
80
|
+
},
|
|
81
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
/* eslint-disable @typescript-eslint/naming-convention*/
|
|
18
|
+
import { I18n } from '@coze-arch/i18n';
|
|
19
|
+
import { LoopType } from '../../constants';
|
|
20
|
+
|
|
21
|
+
export const LoopTypeOptions = [
|
|
22
|
+
{
|
|
23
|
+
value: LoopType.Array,
|
|
24
|
+
label: I18n.t('workflow_loop_type_array'),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: LoopType.Count,
|
|
28
|
+
label: I18n.t('workflow_loop_type_count'),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: LoopType.Infinite,
|
|
32
|
+
label: I18n.t('workflow_loop_type_infinite'),
|
|
33
|
+
},
|
|
34
|
+
];
|
|
@@ -0,0 +1,209 @@
|
|
|
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 { TriggerForm } from '@coze-workflow/nodes';
|
|
18
|
+
import { FILE_TYPES, ViewVariableType } from '@coze-workflow/base';
|
|
19
|
+
import { I18n } from '@coze-arch/i18n';
|
|
20
|
+
import { Switch } from '@coze-arch/coze-design';
|
|
21
|
+
import { useFlags } from '@coze-arch/bot-flags';
|
|
22
|
+
|
|
23
|
+
import { withNodeConfigForm } from '@/node-registries/common/hocs';
|
|
24
|
+
import { useGlobalState } from '@/hooks';
|
|
25
|
+
import { Section, useWatch } from '@/form';
|
|
26
|
+
import { TriggerTestRunButton } from '@/components/test-run/test-run-button';
|
|
27
|
+
|
|
28
|
+
import { FixedInputParameter } from '../trigger-upsert/components/fixed-input-parameter-field';
|
|
29
|
+
import { OutputsField, RadioSetterField, SwitchField } from '../common/fields';
|
|
30
|
+
import {
|
|
31
|
+
CronJobSelect,
|
|
32
|
+
DynamicForm,
|
|
33
|
+
Notify,
|
|
34
|
+
Timezone,
|
|
35
|
+
} from '../common/components';
|
|
36
|
+
import { useTrigger } from './hooks/use-trigger';
|
|
37
|
+
|
|
38
|
+
export const FormRender = withNodeConfigForm(() => {
|
|
39
|
+
const { isBindDouyin, isChatflow, projectId } = useGlobalState();
|
|
40
|
+
const [FLAGS] = useFlags();
|
|
41
|
+
|
|
42
|
+
let hiddenTypes = isBindDouyin ? FILE_TYPES : [];
|
|
43
|
+
|
|
44
|
+
if (IS_OPEN_SOURCE) {
|
|
45
|
+
hiddenTypes = [ViewVariableType.Voice, ViewVariableType.ArrayVoice];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tabName = useWatch<string>('trigger.tab');
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
triggerIsOpen,
|
|
52
|
+
setTriggerIsOpen,
|
|
53
|
+
triggerId,
|
|
54
|
+
dynamicFormMeta,
|
|
55
|
+
outputs,
|
|
56
|
+
onDynamicFormChange,
|
|
57
|
+
} = useTrigger();
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
{tabName === TriggerForm.Tab.Trigger && triggerIsOpen ? (
|
|
62
|
+
<Notify
|
|
63
|
+
isBreakLine
|
|
64
|
+
className="!border-b-0 !m-0 !mt-2.5 rounded-lg"
|
|
65
|
+
text={I18n.t(
|
|
66
|
+
'workflow_user_trigger_banner',
|
|
67
|
+
{},
|
|
68
|
+
'设置以后需要发布到对应渠道才能定时生效',
|
|
69
|
+
)}
|
|
70
|
+
/>
|
|
71
|
+
) : null}
|
|
72
|
+
|
|
73
|
+
{/* will support soon */}
|
|
74
|
+
{(projectId || IS_BOT_OP) && !IS_OPEN_SOURCE ? (
|
|
75
|
+
<RadioSetterField
|
|
76
|
+
name={'trigger.tab'}
|
|
77
|
+
defaultValue={TriggerForm.Tab.Basic}
|
|
78
|
+
options={{
|
|
79
|
+
key: TriggerForm.TabName,
|
|
80
|
+
mode: 'button',
|
|
81
|
+
direction: 'horizontal',
|
|
82
|
+
options: [
|
|
83
|
+
{
|
|
84
|
+
label: I18n.t('worklfow_start_basic_setting', {}, '基础设置'),
|
|
85
|
+
value: TriggerForm.Tab.Basic,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: I18n.t(
|
|
89
|
+
'workflow_start_trigger_setting',
|
|
90
|
+
{},
|
|
91
|
+
'触发器设置',
|
|
92
|
+
),
|
|
93
|
+
value: TriggerForm.Tab.Trigger,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
ignoreReadonly: true,
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
) : null}
|
|
100
|
+
{(tabName ?? TriggerForm.Tab.Basic) === TriggerForm.Tab.Basic ? (
|
|
101
|
+
<>
|
|
102
|
+
<OutputsField
|
|
103
|
+
id="start-node-output"
|
|
104
|
+
name="outputs"
|
|
105
|
+
title={I18n.t('workflow_detail_node_parameter_input')}
|
|
106
|
+
tooltip={I18n.t('workflow_detail_start_input_tooltip')}
|
|
107
|
+
addItemTitle={I18n.t('workflow_add_input')}
|
|
108
|
+
withDescription
|
|
109
|
+
withRequired
|
|
110
|
+
allowDeleteLast
|
|
111
|
+
emptyPlaceholder={I18n.t('workflow_start_no_parameter')}
|
|
112
|
+
hiddenTypes={hiddenTypes}
|
|
113
|
+
defaultCollapse={false}
|
|
114
|
+
needAppendChildWhenNodeIsPreset={undefined}
|
|
115
|
+
withDefaultValue
|
|
116
|
+
columnsRatio="4:3"
|
|
117
|
+
hasFeedback={false}
|
|
118
|
+
/>
|
|
119
|
+
|
|
120
|
+
{/* Support soon, so stay tuned. */}
|
|
121
|
+
{isChatflow && FLAGS['bot.automation.message_auto_write'] ? (
|
|
122
|
+
<Section title={I18n.t('basic_setting')} tooltip="">
|
|
123
|
+
<SwitchField
|
|
124
|
+
customLabel={I18n.t('workflow_250407_001', {}, '消息自动写入')}
|
|
125
|
+
customTooltip={I18n.t('workflow_250407_002')}
|
|
126
|
+
name="inputs.auto_save_history"
|
|
127
|
+
customStyles={{
|
|
128
|
+
display: 'grid',
|
|
129
|
+
gridTemplateColumns: 'auto auto 1fr',
|
|
130
|
+
}}
|
|
131
|
+
labelStyles={{
|
|
132
|
+
fontSize: '12px',
|
|
133
|
+
fontWeight: 'normal',
|
|
134
|
+
}}
|
|
135
|
+
switchCustomStyles={{
|
|
136
|
+
justifySelf: 'end',
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
</Section>
|
|
140
|
+
) : null}
|
|
141
|
+
</>
|
|
142
|
+
) : null}
|
|
143
|
+
{tabName === TriggerForm.Tab.Trigger ? (
|
|
144
|
+
<>
|
|
145
|
+
<>
|
|
146
|
+
<Section
|
|
147
|
+
title={I18n.t('workflow_start_trigger_setting', {}, '触发器设置')}
|
|
148
|
+
tooltip={I18n.t(
|
|
149
|
+
'workflow_start_trigger_setting_tooltips',
|
|
150
|
+
{},
|
|
151
|
+
'选择工作流的启动方式,可以通过预设时间或自定义时间来触发工作流的启动',
|
|
152
|
+
)}
|
|
153
|
+
actions={[
|
|
154
|
+
triggerIsOpen ? (
|
|
155
|
+
<TriggerTestRunButton triggerId={triggerId} />
|
|
156
|
+
) : (
|
|
157
|
+
false
|
|
158
|
+
),
|
|
159
|
+
<Switch
|
|
160
|
+
checked={triggerIsOpen}
|
|
161
|
+
onChange={setTriggerIsOpen}
|
|
162
|
+
size="mini"
|
|
163
|
+
/>,
|
|
164
|
+
].filter(Boolean)}
|
|
165
|
+
>
|
|
166
|
+
{triggerIsOpen ? (
|
|
167
|
+
<div className="flex flex-col gap-[8px]">
|
|
168
|
+
<DynamicForm
|
|
169
|
+
name={'trigger.dynamicInputs'}
|
|
170
|
+
formMeta={dynamicFormMeta}
|
|
171
|
+
components={{
|
|
172
|
+
Timezone,
|
|
173
|
+
CronJobSelect,
|
|
174
|
+
}}
|
|
175
|
+
onChange={onDynamicFormChange}
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
) : null}
|
|
179
|
+
</Section>
|
|
180
|
+
{triggerIsOpen ? (
|
|
181
|
+
<Section title={I18n.t('parameters', {}, '输入')} actions={[]}>
|
|
182
|
+
<div className="flex flex-col gap-[8px]">
|
|
183
|
+
<FixedInputParameter
|
|
184
|
+
name={'trigger.parameters'}
|
|
185
|
+
layout="horizontal"
|
|
186
|
+
refDisabled
|
|
187
|
+
fieldConfig={outputs
|
|
188
|
+
?.filter(d => d.type)
|
|
189
|
+
?.map(d => ({
|
|
190
|
+
label: d?.name,
|
|
191
|
+
description: d?.description ?? '',
|
|
192
|
+
name: TriggerForm.getVariableName(d),
|
|
193
|
+
required: !!d?.required,
|
|
194
|
+
type: d.type,
|
|
195
|
+
}))}
|
|
196
|
+
onChange={onDynamicFormChange}
|
|
197
|
+
inputPlaceholder={I18n.t(
|
|
198
|
+
'workflow_trigger_creat_name_placeholder',
|
|
199
|
+
)}
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
</Section>
|
|
203
|
+
) : null}
|
|
204
|
+
</>
|
|
205
|
+
</>
|
|
206
|
+
) : null}
|
|
207
|
+
</>
|
|
208
|
+
);
|
|
209
|
+
});
|