@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.
Files changed (335) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -2
  3. package/THIRD-PARTY-NOTICES.md +57 -0
  4. package/dist/ai-markdown-esl-I5ck.js +7 -0
  5. package/dist/chrome.d.ts +11 -0
  6. package/dist/chrome.js +358 -0
  7. package/dist/core.d.ts +11 -0
  8. package/dist/core.js +3 -0
  9. package/dist/coze/compat/base.d.ts +116 -0
  10. package/dist/coze/control-icon.d.ts +15 -0
  11. package/dist/coze/execution-panel.d.ts +8 -0
  12. package/dist/coze/schema-tree.d.ts +9 -0
  13. package/dist/coze/side-panel.d.ts +12 -0
  14. package/dist/coze/source/form-extensions/components/output-tree/components/custom-tree-node/constants.d.ts +13 -0
  15. package/dist/coze/source/form-extensions/components/output-tree/components/custom-tree-node/type.d.ts +34 -0
  16. package/dist/coze/start-form.d.ts +9 -0
  17. package/dist/coze/test-input.d.ts +9 -0
  18. package/dist/coze/test-run-button.d.ts +4 -0
  19. package/dist/coze/workflow-header.d.ts +5 -0
  20. package/dist/designer.d.ts +2 -0
  21. package/dist/flowgram-designer.d.ts +62 -0
  22. package/dist/graph-scope.d.ts +147 -0
  23. package/dist/header-shortcuts-BQZuNfpA.js +6 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.js +8694 -0
  26. package/dist/input-fields.d.ts +4 -0
  27. package/dist/panel-focus.d.ts +3 -0
  28. package/dist/prompt-kit.d.ts +47 -0
  29. package/dist/result-preview.d.ts +5 -0
  30. package/dist/schema-tree-CTM6hEdm.js +309 -0
  31. package/dist/start-form-D_J3UIoE.js +9330 -0
  32. package/dist/styles.css +2 -0
  33. package/dist/templates.d.ts +1 -0
  34. package/dist/test-input-validation-CkORPCfm.js +55 -0
  35. package/dist/test-input-validation.d.ts +11 -0
  36. package/dist/theme.d.ts +17 -0
  37. package/package.json +103 -4
  38. package/vendor/coze/LICENSE-APACHE +177 -0
  39. package/vendor/coze/UPSTREAM.json +2247 -0
  40. package/vendor/coze/original/base-test-button.tsx +22 -0
  41. package/vendor/coze/original/comment-container.tsx +68 -0
  42. package/vendor/coze/original/condition-container.tsx +60 -0
  43. package/vendor/coze/original/condition-tag.tsx +58 -0
  44. package/vendor/coze/original/coze-global.less +234 -0
  45. package/vendor/coze/original/create-loop-function-json.ts +134 -0
  46. package/vendor/coze/original/create-loop-function.ts +56 -0
  47. package/vendor/coze/original/end-registry.ts +41 -0
  48. package/vendor/coze/original/execute-result-panel.less +97 -0
  49. package/vendor/coze/original/execute-result-panel.tsx +171 -0
  50. package/vendor/coze/original/form-item.less +39 -0
  51. package/vendor/coze/original/form-item.tsx +200 -0
  52. package/vendor/coze/original/http-api-field.tsx +42 -0
  53. package/vendor/coze/original/http-form-render.tsx +102 -0
  54. package/vendor/coze/original/icon-add.svg +3 -0
  55. package/vendor/coze/original/icon-arrow-left.svg +3 -0
  56. package/vendor/coze/original/icon-auto-layout.svg +18 -0
  57. package/vendor/coze/original/icon-batch.jpg +0 -0
  58. package/vendor/coze/original/icon-break.jpg +0 -0
  59. package/vendor/coze/original/icon-code.svg +13 -0
  60. package/vendor/coze/original/icon-condition.jpg +0 -0
  61. package/vendor/coze/original/icon-condition.svg +12 -0
  62. package/vendor/coze/original/icon-continue.jpg +0 -0
  63. package/vendor/coze/original/icon-database-query.jpg +0 -0
  64. package/vendor/coze/original/icon-database-update.jpg +0 -0
  65. package/vendor/coze/original/icon-database.svg +18 -0
  66. package/vendor/coze/original/icon-delete.svg +5 -0
  67. package/vendor/coze/original/icon-end.jpg +0 -0
  68. package/vendor/coze/original/icon-fullscreen.svg +9 -0
  69. package/vendor/coze/original/icon-http.jpg +0 -0
  70. package/vendor/coze/original/icon-intent.jpg +0 -0
  71. package/vendor/coze/original/icon-json-parser.jpg +0 -0
  72. package/vendor/coze/original/icon-json-stringify.jpg +0 -0
  73. package/vendor/coze/original/icon-llm.jpg +0 -0
  74. package/vendor/coze/original/icon-loop.jpg +0 -0
  75. package/vendor/coze/original/icon-more.svg +11 -0
  76. package/vendor/coze/original/icon-play-round-outlined.svg +8 -0
  77. package/vendor/coze/original/icon-plugin-tool.svg +6 -0
  78. package/vendor/coze/original/icon-standard-copy.svg +8 -0
  79. package/vendor/coze/original/icon-start.jpg +0 -0
  80. package/vendor/coze/original/icon-text.jpg +0 -0
  81. package/vendor/coze/original/icon-unknown.svg +7 -0
  82. package/vendor/coze/original/icon-var.svg +6 -0
  83. package/vendor/coze/original/icon-variable-assign.jpg +0 -0
  84. package/vendor/coze/original/icon-variable-merge.jpg +0 -0
  85. package/vendor/coze/original/icon-workflow-end.svg +5 -0
  86. package/vendor/coze/original/icon-workflow-start.svg +5 -0
  87. package/vendor/coze/original/icon-workflow.jpg +0 -0
  88. package/vendor/coze/original/icon-workflow.svg +21 -0
  89. package/vendor/coze/original/icon-workflows.svg +5 -0
  90. package/vendor/coze/original/if-form-meta.tsx +88 -0
  91. package/vendor/coze/original/logic-display.tsx +33 -0
  92. package/vendor/coze/original/mouse-icon.tsx +35 -0
  93. package/vendor/coze/original/mouse-pad-selector.tsx +180 -0
  94. package/vendor/coze/original/node-card.tsx +77 -0
  95. package/vendor/coze/original/node-category-panel.less +4 -0
  96. package/vendor/coze/original/node-category-panel.tsx +53 -0
  97. package/vendor/coze/original/node-config-form.tsx +67 -0
  98. package/vendor/coze/original/node-header.less +165 -0
  99. package/vendor/coze/original/node-header.tsx +552 -0
  100. package/vendor/coze/original/node-panel.less +183 -0
  101. package/vendor/coze/original/node-render.less +20 -0
  102. package/vendor/coze/original/node-side-sheet.less +57 -0
  103. package/vendor/coze/original/node-side-sheet.tsx +214 -0
  104. package/vendor/coze/original/node-wrapper.tsx +71 -0
  105. package/vendor/coze/original/pad-icon.tsx +45 -0
  106. package/vendor/coze/original/resizable-side-panel-constants.ts +18 -0
  107. package/vendor/coze/original/resizable-side-panel.tsx +42 -0
  108. package/vendor/coze/original/start-registry.ts +53 -0
  109. package/vendor/coze/original/sub-canvas-background.less +4 -0
  110. package/vendor/coze/original/sub-canvas-background.tsx +48 -0
  111. package/vendor/coze/original/sub-canvas-container.less +16 -0
  112. package/vendor/coze/original/sub-canvas-container.tsx +97 -0
  113. package/vendor/coze/original/sub-canvas-header.less +75 -0
  114. package/vendor/coze/original/sub-canvas-header.tsx +95 -0
  115. package/vendor/coze/original/test-form-sheet-header.tsx +82 -0
  116. package/vendor/coze/original/test-form-sheet.less +178 -0
  117. package/vendor/coze/original/toolbar-add-node.tsx +68 -0
  118. package/vendor/coze/original/toolbar-auto-layout.tsx +61 -0
  119. package/vendor/coze/original/toolbar-comment.tsx +121 -0
  120. package/vendor/coze/original/toolbar-container.tsx +42 -0
  121. package/vendor/coze/original/toolbar-interactive.tsx +98 -0
  122. package/vendor/coze/original/toolbar-minimap-switch.tsx +41 -0
  123. package/vendor/coze/original/toolbar-tools.less +46 -0
  124. package/vendor/coze/original/toolbar-tools.tsx +89 -0
  125. package/vendor/coze/original/toolbar-zoom.tsx +134 -0
  126. package/vendor/coze/original/tree-variable-selector.less +292 -0
  127. package/vendor/coze/original/tree-variable-selector.tsx +298 -0
  128. package/vendor/coze/original/workflow-document-custom-options.ts +151 -0
  129. package/vendor/coze/original/workflow-header.less +65 -0
  130. package/vendor/coze/original/workflow-header.tsx +85 -0
  131. package/vendor/coze/source/agent-models/model-option/index.module.less +19 -0
  132. package/vendor/coze/source/agent-models/model-option/index.tsx +321 -0
  133. package/vendor/coze/source/agent-models/model-option-avatar/index.tsx +175 -0
  134. package/vendor/coze/source/agent-models/model-option-group/index.tsx +87 -0
  135. package/vendor/coze/source/agent-models/model-option-thumb/index.tsx +41 -0
  136. package/vendor/coze/source/agent-models/model-select-ui/index.tsx +238 -0
  137. package/vendor/coze/source/agent-models/popover-model-list-view/index.tsx +146 -0
  138. package/vendor/coze/source/components/code-editor/text-editor.tsx +71 -0
  139. package/vendor/coze/source/components/comment/components/editor/block.tsx +117 -0
  140. package/vendor/coze/source/components/comment/components/editor/leaf.tsx +64 -0
  141. package/vendor/coze/source/components/comment/components/toolbar.tsx +366 -0
  142. package/vendor/coze/source/components/comment/constant.ts +94 -0
  143. package/vendor/coze/source/components/editor-container/expand-editor/index.module.less +107 -0
  144. package/vendor/coze/source/components/editor-container/expand-editor/index.tsx +117 -0
  145. package/vendor/coze/source/components/model-select/components/model-setting.tsx +300 -0
  146. package/vendor/coze/source/components/model-select/components/settings.tsx +144 -0
  147. package/vendor/coze/source/components/model-select/index.module.less +34 -0
  148. package/vendor/coze/source/components/model-select/utils/index.tsx +100 -0
  149. package/vendor/coze/source/components/node-render/node-render-new/fields/constants.tsx +79 -0
  150. package/vendor/coze/source/components/node-render/node-render-new/fields/field-empty.module.less +12 -0
  151. package/vendor/coze/source/components/node-render/node-render-new/fields/field-empty.tsx +37 -0
  152. package/vendor/coze/source/components/node-render/node-render-new/fields/field.module.less +19 -0
  153. package/vendor/coze/source/components/node-render/node-render-new/fields/field.tsx +52 -0
  154. package/vendor/coze/source/components/node-render/node-render-new/fields/http-api-field/index.tsx +42 -0
  155. package/vendor/coze/source/components/node-render/node-render-new/fields/overflow-tag-list.module.less +47 -0
  156. package/vendor/coze/source/components/node-render/node-render-new/fields/overflow-tag-list.tsx +162 -0
  157. package/vendor/coze/source/components/node-render/node-render-new/fields/variable-tag-list.module.less +48 -0
  158. package/vendor/coze/source/components/node-render/node-render-new/fields/variable-tag-list.tsx +126 -0
  159. package/vendor/coze/source/components/node-wrapper/execute-result-panel/index.module.less +97 -0
  160. package/vendor/coze/source/components/node-wrapper/execute-result-panel/index.tsx +171 -0
  161. package/vendor/coze/source/components/sub-canvas/components/background/index.module.less +4 -0
  162. package/vendor/coze/source/components/sub-canvas/components/header/index.module.less +75 -0
  163. package/vendor/coze/source/components/test-run/test-run-button/single-node.tsx +158 -0
  164. package/vendor/coze/source/execution-panel/panel.module.less +48 -0
  165. package/vendor/coze/source/execution-panel/panel.tsx +99 -0
  166. package/vendor/coze/source/execution-panel/use-resize.ts +79 -0
  167. package/vendor/coze/source/external/features/log/components/data-viewer/constants.ts +28 -0
  168. package/vendor/coze/source/external/features/log/components/data-viewer/context/context.ts +21 -0
  169. package/vendor/coze/source/external/features/log/components/data-viewer/context/create-store.ts +48 -0
  170. package/vendor/coze/source/external/features/log/components/data-viewer/context/index.ts +19 -0
  171. package/vendor/coze/source/external/features/log/components/data-viewer/context/provider.tsx +50 -0
  172. package/vendor/coze/source/external/features/log/components/data-viewer/data-viewer.module.less +26 -0
  173. package/vendor/coze/source/external/features/log/components/data-viewer/data-viewer.tsx +79 -0
  174. package/vendor/coze/source/external/features/log/components/data-viewer/hooks/index.ts +18 -0
  175. package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-data-viewer-store.ts +29 -0
  176. package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-expand.ts +35 -0
  177. package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-value.tsx +66 -0
  178. package/vendor/coze/source/external/features/log/components/data-viewer/index.tsx +21 -0
  179. package/vendor/coze/source/external/features/log/components/data-viewer/json-field/index.tsx +186 -0
  180. package/vendor/coze/source/external/features/log/components/data-viewer/json-field/json-field.module.less +79 -0
  181. package/vendor/coze/source/external/features/log/components/data-viewer/types.ts +50 -0
  182. package/vendor/coze/source/external/features/log/components/data-viewer/utils/big-number.ts +35 -0
  183. package/vendor/coze/source/external/features/log/components/data-viewer/utils/generate-field.ts +104 -0
  184. package/vendor/coze/source/external/features/log/components/log-parser/log-wrap.module.less +27 -0
  185. package/vendor/coze/source/external/features/log/components/log-parser/log-wrap.tsx +109 -0
  186. package/vendor/coze/source/external/features/log/components/node-status-bar/node-status-bar.module.less +52 -0
  187. package/vendor/coze/source/external/features/log/components/node-status-bar/node-status-bar.tsx +113 -0
  188. package/vendor/coze/source/form/components/field-empty.tsx +45 -0
  189. package/vendor/coze/source/form/components/section.tsx +91 -0
  190. package/vendor/coze/source/form-extensions/components/add-item-button/index.tsx +64 -0
  191. package/vendor/coze/source/form-extensions/components/form-card/index.module.less +131 -0
  192. package/vendor/coze/source/form-extensions/components/form-card/index.tsx +309 -0
  193. package/vendor/coze/source/form-extensions/components/form-item/index.module.less +39 -0
  194. package/vendor/coze/source/form-extensions/components/form-item/index.tsx +200 -0
  195. package/vendor/coze/source/form-extensions/components/form-item-feedback/index.module.less +7 -0
  196. package/vendor/coze/source/form-extensions/components/form-item-feedback/index.tsx +39 -0
  197. package/vendor/coze/source/form-extensions/components/level-line/index.module.less +346 -0
  198. package/vendor/coze/source/form-extensions/components/level-line/index.ts +17 -0
  199. package/vendor/coze/source/form-extensions/components/level-line/level-line.tsx +460 -0
  200. package/vendor/coze/source/form-extensions/components/level-line/types.ts +38 -0
  201. package/vendor/coze/source/form-extensions/components/level-line/utils.ts +60 -0
  202. package/vendor/coze/source/form-extensions/components/literal-value-input/constants.ts +61 -0
  203. package/vendor/coze/source/form-extensions/components/literal-value-input/input-boolean.tsx +80 -0
  204. package/vendor/coze/source/form-extensions/components/literal-value-input/input-integer.tsx +68 -0
  205. package/vendor/coze/source/form-extensions/components/literal-value-input/input-number.tsx +62 -0
  206. package/vendor/coze/source/form-extensions/components/literal-value-input/input-select.tsx +59 -0
  207. package/vendor/coze/source/form-extensions/components/literal-value-input/input-string.tsx +55 -0
  208. package/vendor/coze/source/form-extensions/components/literal-value-input/literal-value-input.tsx +35 -0
  209. package/vendor/coze/source/form-extensions/components/literal-value-input/styles.module.less +46 -0
  210. package/vendor/coze/source/form-extensions/components/literal-value-input/type.ts +61 -0
  211. package/vendor/coze/source/form-extensions/components/literal-value-input/utils.tsx +117 -0
  212. package/vendor/coze/source/form-extensions/components/node-header/components/close-button.tsx +44 -0
  213. package/vendor/coze/source/form-extensions/components/node-header/description-display.tsx +52 -0
  214. package/vendor/coze/source/form-extensions/components/node-header/description.tsx +131 -0
  215. package/vendor/coze/source/form-extensions/components/node-header/index.module.less +165 -0
  216. package/vendor/coze/source/form-extensions/components/node-header/index.tsx +552 -0
  217. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-btn/index.tsx +43 -0
  218. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/default-value-input.tsx +276 -0
  219. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/index.module.less +124 -0
  220. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/index.tsx +131 -0
  221. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/types.ts +32 -0
  222. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-name/index.module.less +38 -0
  223. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-name/index.tsx +101 -0
  224. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-operator/index.module.less +51 -0
  225. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-operator/index.tsx +107 -0
  226. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-required/index.module.less +17 -0
  227. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-required/index.tsx +53 -0
  228. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/constants.tsx +77 -0
  229. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/index.module.less +97 -0
  230. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/index.tsx +155 -0
  231. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/constants.ts +38 -0
  232. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/index.module.less +138 -0
  233. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/index.tsx +360 -0
  234. package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/type.ts +88 -0
  235. package/vendor/coze/source/form-extensions/components/output-tree/components/header/index.module.less +36 -0
  236. package/vendor/coze/source/form-extensions/components/output-tree/components/header/index.tsx +104 -0
  237. package/vendor/coze/source/form-extensions/components/output-tree/constants.ts +22 -0
  238. package/vendor/coze/source/form-extensions/components/output-tree/context.ts +28 -0
  239. package/vendor/coze/source/form-extensions/components/output-tree/hooks/use-columns-style.ts +39 -0
  240. package/vendor/coze/source/form-extensions/components/output-tree/index.module.less +83 -0
  241. package/vendor/coze/source/form-extensions/components/output-tree/index.tsx +692 -0
  242. package/vendor/coze/source/form-extensions/components/output-tree/utils.ts +185 -0
  243. package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/index.tsx +97 -0
  244. package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/option-item.tsx +30 -0
  245. package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/types.ts +23 -0
  246. package/vendor/coze/source/form-extensions/components/setting-on-error/components/retry-times/index.tsx +45 -0
  247. package/vendor/coze/source/form-extensions/components/setting-on-error/components/timeout/index.tsx +102 -0
  248. package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select-option.tsx +167 -0
  249. package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select-tree-panel.tsx +165 -0
  250. package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select.module.less +96 -0
  251. package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select.tsx +265 -0
  252. package/vendor/coze/source/form-extensions/components/tree-variable-selector/context.tsx +42 -0
  253. package/vendor/coze/source/form-extensions/components/tree-variable-selector/expand-icon.tsx +30 -0
  254. package/vendor/coze/source/form-extensions/components/tree-variable-selector/index.module.less +292 -0
  255. package/vendor/coze/source/form-extensions/components/tree-variable-selector/node-variable-tree.module.less +49 -0
  256. package/vendor/coze/source/form-extensions/components/tree-variable-selector/node-variable-tree.tsx +149 -0
  257. package/vendor/coze/source/form-extensions/components/tree-variable-selector/utils.tsx +500 -0
  258. package/vendor/coze/source/form-extensions/components/tree-variable-selector/value-display.tsx +130 -0
  259. package/vendor/coze/source/form-extensions/components/value-expression-input/const.ts +68 -0
  260. package/vendor/coze/source/form-extensions/components/value-expression-input/context.ts +27 -0
  261. package/vendor/coze/source/form-extensions/components/value-expression-input/index.module.less +144 -0
  262. package/vendor/coze/source/form-extensions/components/value-expression-input/value-expression-input.tsx +418 -0
  263. package/vendor/coze/source/form-extensions/components/variable-type-selector/constants.tsx +77 -0
  264. package/vendor/coze/source/form-extensions/components/variable-type-selector/index.module.less +31 -0
  265. package/vendor/coze/source/form-extensions/components/variable-type-selector/index.tsx +17 -0
  266. package/vendor/coze/source/form-extensions/components/variable-type-selector/utils.tsx +298 -0
  267. package/vendor/coze/source/form-extensions/components/variable-type-selector/variable-type-selector.tsx +235 -0
  268. package/vendor/coze/source/form-extensions/components/variable-type-tag/index.tsx +54 -0
  269. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-branch.module.less +9 -0
  270. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-branch.tsx +249 -0
  271. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-header.tsx +50 -0
  272. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-item-logic.module.less +13 -0
  273. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-item-logic.tsx +73 -0
  274. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/delete/index.module.less +10 -0
  275. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/delete/index.tsx +42 -0
  276. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/index.module.less +9 -0
  277. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/index.tsx +254 -0
  278. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/operator/index.module.less +7 -0
  279. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/operator/index.tsx +144 -0
  280. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/value-expression-with-state/index.tsx +69 -0
  281. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/context.ts +36 -0
  282. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/condition-branch-preview.tsx +44 -0
  283. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/condition-branch.tsx +152 -0
  284. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/container.tsx +19 -0
  285. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/custom-drag-layer.tsx +117 -0
  286. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/types.ts +18 -0
  287. package/vendor/coze/source/form-extensions/setters/condition/multi-condition/types.ts +58 -0
  288. package/vendor/coze/source/node-registries/end/components/terminate-plan-field.tsx +29 -0
  289. package/vendor/coze/source/node-registries/end/constants.ts +34 -0
  290. package/vendor/coze/source/node-registries/end/form.tsx +66 -0
  291. package/vendor/coze/source/node-registries/end/types.ts +45 -0
  292. package/vendor/coze/source/node-registries/http/components/base-editor/raw-text-editor.tsx +80 -0
  293. package/vendor/coze/source/node-registries/http/constants.ts +80 -0
  294. package/vendor/coze/source/node-registries/http/fields/json-import-editor/index.module.less +191 -0
  295. package/vendor/coze/source/node-registries/http/fields/json-import-editor/json-import-components/json-expand-editor.tsx +141 -0
  296. package/vendor/coze/source/node-registries/http/fields/json-import-editor/json-import-components/json-import.tsx +99 -0
  297. package/vendor/coze/source/node-registries/http/form-render.tsx +102 -0
  298. package/vendor/coze/source/node-registries/http/setters/api/curl-expand-editor.tsx +161 -0
  299. package/vendor/coze/source/node-registries/http/setters/api/curl-import.tsx +96 -0
  300. package/vendor/coze/source/node-registries/http/setters/api/index.module.less +199 -0
  301. package/vendor/coze/source/node-registries/http/setters/api/index.tsx +149 -0
  302. package/vendor/coze/source/node-registries/http/setters/api/utils.ts +41 -0
  303. package/vendor/coze/source/node-registries/http/setters/body/index.tsx +201 -0
  304. package/vendor/coze/source/node-registries/http/setters/constants.ts +83 -0
  305. package/vendor/coze/source/node-registries/if/components/else/index.tsx +41 -0
  306. package/vendor/coze/source/node-registries/intent/components/intents/index.module.less +15 -0
  307. package/vendor/coze/source/node-registries/intent/components/intents/option-item/index.tsx +189 -0
  308. package/vendor/coze/source/node-registries/json-stringify/constants.ts +32 -0
  309. package/vendor/coze/source/node-registries/json-stringify/form.tsx +46 -0
  310. package/vendor/coze/source/node-registries/loop/constants.ts +43 -0
  311. package/vendor/coze/source/node-registries/loop/loop-fields/loop-settings-section/index.tsx +48 -0
  312. package/vendor/coze/source/node-registries/loop/loop-fields/loop-type/index.tsx +81 -0
  313. package/vendor/coze/source/node-registries/loop/loop-fields/loop-type/options.ts +34 -0
  314. package/vendor/coze/source/node-registries/start/form.tsx +209 -0
  315. package/vendor/coze/source/node-registries/text-process/components/method-selector/index.tsx +46 -0
  316. package/vendor/coze/source/node-registries/text-process/constants.ts +132 -0
  317. package/vendor/coze/source/nodes-v2/components/form-item-feedback/index.module.less +7 -0
  318. package/vendor/coze/source/nodes-v2/components/form-item-feedback/index.tsx +47 -0
  319. package/vendor/coze/source/nodes-v2/components/system-prompt/index.module.less +66 -0
  320. package/vendor/coze/source/nodes-v2/components/system-prompt/prompt-kit-bar.tsx +129 -0
  321. package/vendor/coze/source/nodes-v2/components/system-prompt/system-prompt-editor.tsx +110 -0
  322. package/vendor/coze/source/nodes-v2/llm/user-prompt/index.tsx +64 -0
  323. package/vendor/coze/source/prompt-kit/input-config-popover/index.tsx +80 -0
  324. package/vendor/coze/source/prompt-kit/input-slot-widget/index.css +34 -0
  325. package/vendor/coze/source/prompt-kit/input-slot-widget/index.ts +169 -0
  326. package/vendor/coze/source/prompt-kit/library-item.tsx +141 -0
  327. package/vendor/coze/source/prompt-kit/prompt-info-input.tsx +90 -0
  328. package/vendor/coze/source/ui-components/add-operation/index.module.less +19 -0
  329. package/vendor/coze/source/ui-components/add-operation/index.tsx +67 -0
  330. package/vendor/coze/source/ui-components/auto-size-tooltip/index.module.less +39 -0
  331. package/vendor/coze/source/ui-components/auto-size-tooltip/index.tsx +74 -0
  332. package/vendor/coze/source/ui-components/workflow-sl-input/index.module.less +36 -0
  333. package/vendor/coze/source/ui-components/workflow-sl-input/index.tsx +194 -0
  334. package/vendor/coze/source/utils/create-slots/index.tsx +126 -0
  335. package/vendor/coze/source/utils/create-slots/use-force-update.ts +23 -0
@@ -0,0 +1,22 @@
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 { IconCozPlayFill } from '@coze-arch/coze-design/icons';
18
+ import { Button, type ButtonProps } from '@coze-arch/coze-design';
19
+
20
+ export const BaseTestButton: React.FC<ButtonProps> = props => (
21
+ <Button color="green" icon={<IconCozPlayFill />} {...props} />
22
+ );
@@ -0,0 +1,68 @@
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 ReactNode, type FC, type CSSProperties } from 'react';
18
+
19
+ import classNames from 'classnames';
20
+
21
+ interface ICommentContainer {
22
+ focused: boolean;
23
+ children?: ReactNode;
24
+ style?: React.CSSProperties;
25
+ }
26
+
27
+ export const CommentContainer: FC<ICommentContainer> = props => {
28
+ const { focused, children, style } = props;
29
+
30
+ const scrollbarStyle = {
31
+ // scroll bar style
32
+ scrollbarWidth: 'thin',
33
+ scrollbarColor: 'rgb(159 159 158 / 65%) transparent',
34
+ // Styles for WebKit browsers such as Chrome, Safari
35
+ '&::-webkit-scrollbar': {
36
+ width: '4px',
37
+ },
38
+ '&::-webkit-scrollbar-track': {
39
+ background: 'transparent',
40
+ },
41
+ '&::-webkit-scrollbar-thumb': {
42
+ backgroundColor: 'rgb(159 159 158 / 65%)',
43
+ borderRadius: '20px',
44
+ border: '2px solid transparent',
45
+ },
46
+ } as unknown as CSSProperties;
47
+
48
+ return (
49
+ <div
50
+ className={classNames(
51
+ 'workflow-comment-container flex flex-col items-start justify-start w-full h-full rounded-[8px] outline-solid py-[6px] px-[10px] overflow-y-auto overflow-x-hidden outline-[1px]',
52
+ {
53
+ 'bg-[#FFF3EA] outline-[#FF811A]': focused,
54
+ 'bg-[#FFFBED] outline-[#F2B600]': !focused,
55
+ },
56
+ )}
57
+ data-flow-editor-selectable="false"
58
+ style={{
59
+ // Tailwind does not support the style of outline, so you need to use style to set it here.
60
+ outline: focused ? '1px solid #FF811A' : '1px solid #F2B600',
61
+ ...scrollbarStyle,
62
+ ...style,
63
+ }}
64
+ >
65
+ {children}
66
+ </div>
67
+ );
68
+ };
@@ -0,0 +1,60 @@
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 } from 'react';
18
+
19
+ import { ConditionLogic } from '@coze-workflow/base';
20
+
21
+ import { LogicDisplay } from './logic-display';
22
+
23
+ interface Condition {
24
+ left?: React.ReactNode;
25
+ operator?: React.ReactNode;
26
+ right?: React.ReactNode;
27
+ }
28
+
29
+ interface ConditionContainerProps {
30
+ conditions: Condition[];
31
+ logic?: ConditionLogic;
32
+ }
33
+
34
+ export const ConditionContainer: FC<ConditionContainerProps> = props => {
35
+ const { conditions = [], logic = ConditionLogic.AND } = props;
36
+
37
+ return (
38
+ <div className="coz-stroke-plus coz-bg-max border border-solid py-1 rounded-mini text-xs coz-fg-primary min-h-[32px]">
39
+ {conditions.map((condition, index) => (
40
+ <>
41
+ <div className="flex items-center px-1">
42
+ <div className="flex-1 min-w-0 overflow-hidden">
43
+ {condition.left}
44
+ </div>
45
+ <div className="flex items-center flex-grow-0 flex-shrink-0 basis-[0] px-2 ">
46
+ {condition.operator}
47
+ </div>
48
+
49
+ <div className="flex-1 min-w-0 overflow-hidden">
50
+ {condition.right}
51
+ </div>
52
+ </div>
53
+ {index < conditions.length - 1 ? (
54
+ <LogicDisplay logic={logic} />
55
+ ) : null}
56
+ </>
57
+ ))}
58
+ </div>
59
+ );
60
+ };
@@ -0,0 +1,58 @@
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 PropsWithChildren, type FC, type ReactNode } from 'react';
18
+
19
+ import classnames from 'classnames';
20
+ import { Tag, Tooltip } from '@coze-arch/coze-design';
21
+
22
+ import styles from './condition-tag.module.less';
23
+
24
+ export const ConditionTag: FC<
25
+ PropsWithChildren<{
26
+ tooltip?: ReactNode;
27
+ invalid?: boolean;
28
+ }>
29
+ > = props => {
30
+ const color = props.invalid ? 'yellow' : 'primary';
31
+ if (props.tooltip && !props.invalid) {
32
+ return (
33
+ <Tooltip content={props.tooltip}>
34
+ <Tag
35
+ color={color}
36
+ className={classnames(
37
+ styles['condition-tag'],
38
+ 'font-medium truncate w-full',
39
+ )}
40
+ >
41
+ {props.children}
42
+ </Tag>
43
+ </Tooltip>
44
+ );
45
+ } else {
46
+ return (
47
+ <Tag
48
+ color={color}
49
+ className={classnames(
50
+ styles['condition-tag'],
51
+ 'font-medium truncate w-full',
52
+ )}
53
+ >
54
+ {props.children}
55
+ </Tag>
56
+ );
57
+ }
58
+ };
@@ -0,0 +1,234 @@
1
+ // !NOTE: 全局样式代码,不要随便修改!!!
2
+
3
+ html,
4
+ body {
5
+ width: 100%;
6
+ min-width: 1200px;
7
+ height: 100%;
8
+ min-height: 600px;
9
+ margin: 0;
10
+ padding: 0;
11
+ // 原来的版本是 冬青(Hiragino) > 苹方;但是项目里大量使用 semi 组件自带 font family,没有暴露出来
12
+ // 这里修复一下顺序 PingFang > Hiragino
13
+ font-family: 'PingFang SC', 'Noto Sans SC', sans-serif;
14
+
15
+ background: linear-gradient(to bottom, transparent, #fff) #eceeef;
16
+ }
17
+
18
+ body {
19
+ // @flowpd/card-web-runtime 依赖 arco design
20
+ // arco-design 的 reset css, 搞了 body line-height 1.5
21
+ // 没设置 line-height 的元素可能会因为按需加载 arco 产生瞬时抖动
22
+ line-height: 1.5;
23
+ }
24
+
25
+ #root {
26
+ width: 100%;
27
+ height: 100%;
28
+ }
29
+
30
+ p {
31
+ margin: 0;
32
+ }
33
+
34
+ * {
35
+ box-sizing: border-box;
36
+ font-family: 'PingFang SC', 'Noto Sans SC', sans-serif;
37
+ -webkit-font-smoothing: antialiased;
38
+ -moz-osx-font-smoothing: grayscale;
39
+ }
40
+
41
+ // 去除 safari 浏览器按钮 focus 状态的蓝色框
42
+ a:focus,
43
+ input:focus,
44
+ p:focus,
45
+ li:focus,
46
+ div:focus,
47
+ svg:focus,
48
+ a:focus-visible,
49
+ input:focus-visible,
50
+ p:focus-visible,
51
+ li:focus-visible,
52
+ div:focus-visible {
53
+ outline: none;
54
+
55
+ -webkit-tap-highlight-color: rgb(0 0 0 / 0% / 0);
56
+ }
57
+
58
+ // TODO: 底层库依赖了这个 class,暂时不移除
59
+ .operation-admin-base-header {
60
+ display: flex;
61
+ align-items: flex-end;
62
+ justify-content: space-between;
63
+
64
+ height: 56px;
65
+
66
+ line-height: 56px;
67
+
68
+ background-color: #fff;
69
+ border-bottom: 1px solid rgb(46 50 56 / 5%);
70
+
71
+ .semi-tabs-content {
72
+ display: none;
73
+ }
74
+ }
75
+
76
+ .operation-admin-base-header-title {
77
+ display: flex;
78
+ align-items: center;
79
+
80
+ margin: 12px 24px;
81
+
82
+ font-size: 18px;
83
+ line-height: 24px;
84
+ color: var(--light-color-grey-grey-9, #1c1f23);
85
+
86
+ * {
87
+ user-select: none;
88
+ }
89
+
90
+ .universe-icon {
91
+ margin-right: 6px;
92
+ }
93
+ }
94
+
95
+ .operation-admin-base-header-user-avatar {
96
+ width: 24px;
97
+ height: 24px;
98
+ }
99
+
100
+ .operation-admin-base-header-avatar-method-block {
101
+ display: flex;
102
+ justify-content: center;
103
+ width: 100%;
104
+ padding: 8px;
105
+ }
106
+
107
+ .operation-admin-base-header-avatar-sign-out {
108
+ text-align: center;
109
+ }
110
+
111
+ .operation-admin-base-aside {
112
+ border-right: 1px solid rgb(229 231 235);
113
+
114
+ // 非本期改动,但阻塞了ci的构建
115
+ /* stylelint-disable-next-line selector-class-pattern */
116
+ .ud__layout__sider-trigger {
117
+ border-right: 1px solid rgb(229 231 235);
118
+ }
119
+ }
120
+
121
+ .operation-admin-base-app {
122
+ height: 100%;
123
+ }
124
+
125
+ .operation-admin-base-module-content {
126
+ overflow-y: auto;
127
+ display: flex;
128
+ flex-direction: column;
129
+ align-items: flex-start;
130
+ }
131
+
132
+ .operation-admin-base-module-content[app-name='playground_prompt'] {
133
+ background-color: #fff;
134
+ }
135
+
136
+ .operation-admin-base-module-content[app-name='build_bot'] {
137
+ background-color: #fff;
138
+ }
139
+
140
+ .operation-admin-base-module-content[app-name='discover'] {
141
+ background-color: #fff;
142
+ }
143
+
144
+ .operation-admin-base-404 {
145
+ display: flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+
149
+ width: 100%;
150
+ height: 100%;
151
+ }
152
+
153
+ .no-permission {
154
+ height: calc(100vh - 64px);
155
+ border: 20px solid #f2f3f5;
156
+ }
157
+
158
+ .error-wrapper {
159
+ display: flex;
160
+ align-items: center;
161
+ width: 100%;
162
+ height: 100%;
163
+ }
164
+
165
+ .operation-admin-no-permission {
166
+ display: flex;
167
+ align-items: center;
168
+ justify-content: center;
169
+
170
+ width: 100%;
171
+ height: 100%;
172
+ }
173
+
174
+ .operation-admin-base-main-content {
175
+ overflow: hidden;
176
+ }
177
+
178
+ .operation-admin-base-header-name {
179
+ padding: 8px;
180
+ padding-bottom: 0;
181
+
182
+ font-size: 14px;
183
+ font-weight: bold;
184
+ line-height: 22px;
185
+ }
186
+
187
+ .bp5-overflow-list {
188
+ display: flex;
189
+ flex-wrap: nowrap;
190
+ min-width: 0;
191
+ }
192
+
193
+ .bp5-overflow-list-spacer {
194
+ flex-shrink: 1;
195
+ width: 1px;
196
+ }
197
+
198
+ // styled-scrollbar 给需要滚动的元素添加的滚动条样式 增加这个 class 即可
199
+ .styled-scrollbar::-webkit-scrollbar-thumb {
200
+ background-color: rgba(31, 35, 41, 30%);
201
+ background-clip: padding-box;
202
+ border: 2px solid transparent;
203
+ border-radius: 9999px;
204
+
205
+ transition: background 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
206
+ }
207
+
208
+ .styled-scrollbar::-webkit-scrollbar {
209
+ display: inline-block;
210
+ width: 11px;
211
+ height: 11px;
212
+ background-color: transparent;
213
+ }
214
+
215
+ .styled-scrollbar::-webkit-scrollbar-thumb:hover {
216
+ background-color: rgba(31, 35, 41, 60%);
217
+ }
218
+
219
+ .styled-scrollbar::-webkit-scrollbar:hover {
220
+ width: 11px;
221
+ height: 11px;
222
+ }
223
+
224
+ .styled-scrollbar::-webkit-scrollbar-button {
225
+ display: none;
226
+ }
227
+
228
+ .styled-scrollbar::-webkit-scrollbar-track {
229
+ background-color: transparent;
230
+ }
231
+
232
+ .styled-scrollbar::-webkit-scrollbar-corner {
233
+ background-color: transparent;
234
+ }
@@ -0,0 +1,134 @@
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 {
18
+ WorkflowNodeEntity,
19
+ WorkflowSubCanvas,
20
+ } from '@flowgram-adapter/free-layout-editor';
21
+ import {
22
+ FlowNodeBaseType,
23
+ FlowNodeTransformData,
24
+ } from '@flowgram-adapter/free-layout-editor';
25
+ import { FlowRendererKey } from '@flowgram-adapter/free-layout-editor';
26
+ import {
27
+ type IPoint,
28
+ type PaddingSchema,
29
+ type PositionSchema,
30
+ } from '@flowgram-adapter/common';
31
+ import type { WorkflowNodeJSON } from '@coze-workflow/base';
32
+ import { I18n } from '@coze-arch/i18n';
33
+
34
+ import { LoopFunctionSize } from '../constants';
35
+ import { getLoopID } from './relation';
36
+
37
+ export const createLoopFunctionJSON = (params: {
38
+ id: string;
39
+ position: IPoint;
40
+ loopNode: WorkflowNodeEntity;
41
+ }): WorkflowNodeJSON => {
42
+ const { id, position } = params;
43
+ return {
44
+ id,
45
+ type: FlowNodeBaseType.SUB_CANVAS,
46
+ data: {},
47
+ meta: {
48
+ isContainer: true,
49
+ position,
50
+ nodeDTOType: FlowNodeBaseType.SUB_CANVAS,
51
+ useDynamicPort: true,
52
+ disableSideSheet: true,
53
+ renderKey: FlowRendererKey.SUB_CANVAS,
54
+ size: {
55
+ width: LoopFunctionSize.width,
56
+ height: LoopFunctionSize.height,
57
+ },
58
+ defaultPorts: [
59
+ { type: 'input', portID: 'loop-function-input', disabled: true },
60
+ { type: 'input', portID: 'loop-function-inline-input' },
61
+ { type: 'output', portID: 'loop-function-inline-output' },
62
+ ],
63
+ padding: (transform: FlowNodeTransformData): PaddingSchema => ({
64
+ top: 100,
65
+ bottom: 60,
66
+ left: 100,
67
+ right: 100,
68
+ }),
69
+ selectable(node: WorkflowNodeEntity, mousePos?: PositionSchema): boolean {
70
+ if (!mousePos) {
71
+ return true;
72
+ }
73
+ const transform = node.getData<FlowNodeTransformData>(
74
+ FlowNodeTransformData,
75
+ );
76
+ // The mouse can only be selected when the starting position does not include the current node
77
+ return !transform.bounds.contains(mousePos.x, mousePos.y);
78
+ },
79
+ renderSubCanvas: () => ({
80
+ title: I18n.t('workflow_loop_body_canva'),
81
+ tooltip: I18n.t('workflow_loop_body_canva_tips'),
82
+ style: {
83
+ minWidth: LoopFunctionSize.width,
84
+ minHeight: LoopFunctionSize.height,
85
+ },
86
+ renderPorts: [
87
+ {
88
+ id: 'loop-function-input',
89
+ type: 'input',
90
+ style: {
91
+ position: 'absolute',
92
+ left: '50%',
93
+ top: '0',
94
+ },
95
+ },
96
+ {
97
+ id: 'loop-function-inline-input',
98
+ type: 'input',
99
+ style: {
100
+ position: 'absolute',
101
+ right: '0',
102
+ top: '50%',
103
+ transform: 'translateY(20px)',
104
+ },
105
+ },
106
+ {
107
+ id: 'loop-function-inline-output',
108
+ type: 'output',
109
+ style: {
110
+ position: 'absolute',
111
+ left: '0',
112
+ top: '50%',
113
+ transform: 'translateY(20px)',
114
+ },
115
+ },
116
+ ],
117
+ }),
118
+ subCanvas: (node: WorkflowNodeEntity): WorkflowSubCanvas | undefined => {
119
+ const canvasNode = node;
120
+ const parentNodeID = getLoopID(canvasNode.id);
121
+ const parentNode = node.document.getNode(parentNodeID);
122
+ if (!parentNode) {
123
+ return undefined;
124
+ }
125
+ const subCanvas: WorkflowSubCanvas = {
126
+ isCanvas: true,
127
+ parentNode,
128
+ canvasNode,
129
+ };
130
+ return subCanvas;
131
+ },
132
+ },
133
+ };
134
+ };
@@ -0,0 +1,56 @@
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 {
18
+ WorkflowDocument,
19
+ WorkflowNodeEntity,
20
+ } from '@flowgram-adapter/free-layout-editor';
21
+ import { type IPoint } from '@flowgram-adapter/common';
22
+ import type { WorkflowNodeJSON } from '@coze-workflow/base';
23
+
24
+ import { LoopFunctionIDPrefix } from './relation';
25
+ import { createLoopFunctionTemplateData } from './create-loop-function-template-data';
26
+ import { createLoopFunctionLines } from './create-loop-function-lines';
27
+ import { createLoopFunctionJSON } from './create-loop-function-json';
28
+
29
+ /** Create Loop Body Node */
30
+ export const createLoopFunction = async (
31
+ loopNode: WorkflowNodeEntity,
32
+ loopJson: WorkflowNodeJSON,
33
+ ) => {
34
+ const document = loopNode.document as WorkflowDocument;
35
+ const id = `${LoopFunctionIDPrefix}${loopNode.id}`;
36
+ const loopPosition: IPoint = {
37
+ x: loopJson.meta?.position?.x || 0,
38
+ y: loopJson.meta?.position?.y || 0,
39
+ };
40
+ const offset: IPoint = {
41
+ x: 0,
42
+ y: 200,
43
+ };
44
+ const position = {
45
+ x: loopPosition.x + offset.x,
46
+ y: loopPosition.y + offset.y,
47
+ };
48
+ const loopFunctionJSON = createLoopFunctionJSON({ id, position, loopNode });
49
+ const loopFunctionNode = await document.createWorkflowNode(loopFunctionJSON);
50
+ createLoopFunctionTemplateData(loopNode, loopFunctionNode);
51
+ createLoopFunctionLines({
52
+ document,
53
+ loopId: loopNode.id,
54
+ loopFunctionId: loopFunctionNode.id,
55
+ });
56
+ };
@@ -0,0 +1,41 @@
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 { DEFAULT_NODE_META_PATH } from '@coze-workflow/nodes';
18
+ import {
19
+ StandardNodeType,
20
+ type WorkflowNodeRegistry,
21
+ } from '@coze-workflow/base';
22
+
23
+ import { END_FORM_META } from './form-meta';
24
+ import { INPUT_PATH } from './constants';
25
+
26
+ export const END_NODE_REGISTRY: WorkflowNodeRegistry = {
27
+ type: StandardNodeType.End,
28
+ meta: {
29
+ isNodeEnd: true,
30
+ deleteDisable: true,
31
+ copyDisable: true,
32
+ headerReadonly: true,
33
+ nodeDTOType: StandardNodeType.End,
34
+ size: { width: 360, height: 78.2 },
35
+ nodeMetaPath: DEFAULT_NODE_META_PATH,
36
+ inputParametersPath: INPUT_PATH, // Imported parameter path, practice running and other functions rely on this path to extract parameters
37
+ defaultPorts: [{ type: 'input' }],
38
+ helpLink: '/open/docs/guides/start_end_node',
39
+ },
40
+ formMeta: END_FORM_META,
41
+ };