@coze-arch/cli 0.0.10 → 0.0.11

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 (437) hide show
  1. package/lib/__templates__/expo/AGENTS.md +3 -3
  2. package/lib/__templates__/expo/README.md +3 -3
  3. package/lib/__templates__/expo/client/components/Provider.tsx +4 -1
  4. package/lib/__templates__/expo/client/components/Screen.tsx +4 -1
  5. package/lib/__templates__/expo/client/eslint.config.mjs +2 -0
  6. package/lib/__templates__/expo/client/global.css +1 -0
  7. package/lib/__templates__/expo/client/heroui/components/accordion/accordion.animation.ts +178 -0
  8. package/lib/__templates__/expo/client/heroui/components/accordion/accordion.constants.ts +62 -0
  9. package/lib/__templates__/expo/client/heroui/components/accordion/accordion.md +437 -0
  10. package/lib/__templates__/expo/client/heroui/components/accordion/accordion.styles.ts +95 -0
  11. package/lib/__templates__/expo/client/heroui/components/accordion/accordion.tsx +340 -0
  12. package/lib/__templates__/expo/client/heroui/components/accordion/accordion.types.ts +267 -0
  13. package/lib/__templates__/expo/client/heroui/components/accordion/index.ts +17 -0
  14. package/lib/__templates__/expo/client/heroui/components/alert/alert.constants.ts +13 -0
  15. package/lib/__templates__/expo/client/heroui/components/alert/alert.hooks.ts +28 -0
  16. package/lib/__templates__/expo/client/heroui/components/alert/alert.md +263 -0
  17. package/lib/__templates__/expo/client/heroui/components/alert/alert.styles.ts +65 -0
  18. package/lib/__templates__/expo/client/heroui/components/alert/alert.tsx +181 -0
  19. package/lib/__templates__/expo/client/heroui/components/alert/alert.types.ts +99 -0
  20. package/lib/__templates__/expo/client/heroui/components/alert/alert.utils.tsx +25 -0
  21. package/lib/__templates__/expo/client/heroui/components/alert/default-icon.tsx +28 -0
  22. package/lib/__templates__/expo/client/heroui/components/alert/index.ts +15 -0
  23. package/lib/__templates__/expo/client/heroui/components/alert/success-icon.tsx +28 -0
  24. package/lib/__templates__/expo/client/heroui/components/alert/warning-icon.tsx +28 -0
  25. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.animation.ts +123 -0
  26. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.constants.ts +19 -0
  27. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.context.ts +11 -0
  28. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.md +386 -0
  29. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.styles.ts +145 -0
  30. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.tsx +307 -0
  31. package/lib/__templates__/expo/client/heroui/components/avatar/avatar.types.ts +239 -0
  32. package/lib/__templates__/expo/client/heroui/components/avatar/index.ts +13 -0
  33. package/lib/__templates__/expo/client/heroui/components/avatar/person-icon.tsx +23 -0
  34. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.animation.ts +42 -0
  35. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.constants.ts +13 -0
  36. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.md +349 -0
  37. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.styles.ts +66 -0
  38. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.tsx +351 -0
  39. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/bottom-sheet.types.ts +150 -0
  40. package/lib/__templates__/expo/client/heroui/components/bottom-sheet/index.ts +16 -0
  41. package/lib/__templates__/expo/client/heroui/components/button/button.constants.ts +7 -0
  42. package/lib/__templates__/expo/client/heroui/components/button/button.md +381 -0
  43. package/lib/__templates__/expo/client/heroui/components/button/button.styles.ts +89 -0
  44. package/lib/__templates__/expo/client/heroui/components/button/button.tsx +284 -0
  45. package/lib/__templates__/expo/client/heroui/components/button/button.types.ts +175 -0
  46. package/lib/__templates__/expo/client/heroui/components/button/button.utils.ts +34 -0
  47. package/lib/__templates__/expo/client/heroui/components/button/index.ts +9 -0
  48. package/lib/__templates__/expo/client/heroui/components/card/card.constants.ts +11 -0
  49. package/lib/__templates__/expo/client/heroui/components/card/card.md +186 -0
  50. package/lib/__templates__/expo/client/heroui/components/card/card.styles.ts +35 -0
  51. package/lib/__templates__/expo/client/heroui/components/card/card.tsx +153 -0
  52. package/lib/__templates__/expo/client/heroui/components/card/card.types.ts +77 -0
  53. package/lib/__templates__/expo/client/heroui/components/card/index.ts +10 -0
  54. package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.animation.ts +202 -0
  55. package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.constants.ts +6 -0
  56. package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.md +311 -0
  57. package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.styles.ts +105 -0
  58. package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.tsx +251 -0
  59. package/lib/__templates__/expo/client/heroui/components/checkbox/checkbox.types.ts +216 -0
  60. package/lib/__templates__/expo/client/heroui/components/checkbox/index.ts +3 -0
  61. package/lib/__templates__/expo/client/heroui/components/chip/chip.animation.ts +18 -0
  62. package/lib/__templates__/expo/client/heroui/components/chip/chip.constants.ts +7 -0
  63. package/lib/__templates__/expo/client/heroui/components/chip/chip.md +190 -0
  64. package/lib/__templates__/expo/client/heroui/components/chip/chip.styles.ts +234 -0
  65. package/lib/__templates__/expo/client/heroui/components/chip/chip.tsx +125 -0
  66. package/lib/__templates__/expo/client/heroui/components/chip/chip.types.ts +69 -0
  67. package/lib/__templates__/expo/client/heroui/components/chip/index.ts +3 -0
  68. package/lib/__templates__/expo/client/heroui/components/close-button/close-button.constants.ts +6 -0
  69. package/lib/__templates__/expo/client/heroui/components/close-button/close-button.md +109 -0
  70. package/lib/__templates__/expo/client/heroui/components/close-button/close-button.styles.ts +13 -0
  71. package/lib/__templates__/expo/client/heroui/components/close-button/close-button.tsx +57 -0
  72. package/lib/__templates__/expo/client/heroui/components/close-button/close-button.types.ts +30 -0
  73. package/lib/__templates__/expo/client/heroui/components/close-button/index.ts +6 -0
  74. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.animation.ts +18 -0
  75. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.constants.ts +7 -0
  76. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.context.ts +14 -0
  77. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.md +241 -0
  78. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.styles.ts +15 -0
  79. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.tsx +245 -0
  80. package/lib/__templates__/expo/client/heroui/components/control-field/control-field.types.ts +67 -0
  81. package/lib/__templates__/expo/client/heroui/components/control-field/index.ts +6 -0
  82. package/lib/__templates__/expo/client/heroui/components/description/description.animation.ts +53 -0
  83. package/lib/__templates__/expo/client/heroui/components/description/description.constants.ts +30 -0
  84. package/lib/__templates__/expo/client/heroui/components/description/description.md +129 -0
  85. package/lib/__templates__/expo/client/heroui/components/description/description.styles.ts +25 -0
  86. package/lib/__templates__/expo/client/heroui/components/description/description.tsx +81 -0
  87. package/lib/__templates__/expo/client/heroui/components/description/description.types.ts +77 -0
  88. package/lib/__templates__/expo/client/heroui/components/description/index.ts +3 -0
  89. package/lib/__templates__/expo/client/heroui/components/dialog/dialog.animation.ts +9 -0
  90. package/lib/__templates__/expo/client/heroui/components/dialog/dialog.constants.ts +13 -0
  91. package/lib/__templates__/expo/client/heroui/components/dialog/dialog.md +288 -0
  92. package/lib/__templates__/expo/client/heroui/components/dialog/dialog.styles.ts +77 -0
  93. package/lib/__templates__/expo/client/heroui/components/dialog/dialog.tsx +379 -0
  94. package/lib/__templates__/expo/client/heroui/components/dialog/dialog.types.ts +199 -0
  95. package/lib/__templates__/expo/client/heroui/components/dialog/index.ts +12 -0
  96. package/lib/__templates__/expo/client/heroui/components/field-error/field-error.animation.ts +50 -0
  97. package/lib/__templates__/expo/client/heroui/components/field-error/field-error.constants.ts +31 -0
  98. package/lib/__templates__/expo/client/heroui/components/field-error/field-error.md +204 -0
  99. package/lib/__templates__/expo/client/heroui/components/field-error/field-error.styles.ts +23 -0
  100. package/lib/__templates__/expo/client/heroui/components/field-error/field-error.tsx +91 -0
  101. package/lib/__templates__/expo/client/heroui/components/field-error/field-error.types.ts +79 -0
  102. package/lib/__templates__/expo/client/heroui/components/field-error/index.ts +3 -0
  103. package/lib/__templates__/expo/client/heroui/components/input/index.ts +3 -0
  104. package/lib/__templates__/expo/client/heroui/components/input/input.constants.ts +6 -0
  105. package/lib/__templates__/expo/client/heroui/components/input/input.md +193 -0
  106. package/lib/__templates__/expo/client/heroui/components/input/input.styles.ts +51 -0
  107. package/lib/__templates__/expo/client/heroui/components/input/input.tsx +96 -0
  108. package/lib/__templates__/expo/client/heroui/components/input/input.types.ts +44 -0
  109. package/lib/__templates__/expo/client/heroui/components/input-group/index.ts +9 -0
  110. package/lib/__templates__/expo/client/heroui/components/input-group/input-group.animation.ts +14 -0
  111. package/lib/__templates__/expo/client/heroui/components/input-group/input-group.constants.ts +6 -0
  112. package/lib/__templates__/expo/client/heroui/components/input-group/input-group.md +197 -0
  113. package/lib/__templates__/expo/client/heroui/components/input-group/input-group.styles.ts +31 -0
  114. package/lib/__templates__/expo/client/heroui/components/input-group/input-group.tsx +239 -0
  115. package/lib/__templates__/expo/client/heroui/components/input-group/input-group.types.ts +98 -0
  116. package/lib/__templates__/expo/client/heroui/components/input-otp/index.ts +9 -0
  117. package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.animation.ts +199 -0
  118. package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.constants.ts +12 -0
  119. package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.md +376 -0
  120. package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.styles.ts +68 -0
  121. package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.tsx +414 -0
  122. package/lib/__templates__/expo/client/heroui/components/input-otp/input-otp.types.ts +275 -0
  123. package/lib/__templates__/expo/client/heroui/components/label/index.ts +3 -0
  124. package/lib/__templates__/expo/client/heroui/components/label/label.animation.ts +18 -0
  125. package/lib/__templates__/expo/client/heroui/components/label/label.constants.ts +7 -0
  126. package/lib/__templates__/expo/client/heroui/components/label/label.md +187 -0
  127. package/lib/__templates__/expo/client/heroui/components/label/label.styles.ts +44 -0
  128. package/lib/__templates__/expo/client/heroui/components/label/label.tsx +172 -0
  129. package/lib/__templates__/expo/client/heroui/components/label/label.types.ts +86 -0
  130. package/lib/__templates__/expo/client/heroui/components/list-group/index.ts +17 -0
  131. package/lib/__templates__/expo/client/heroui/components/list-group/list-group.constants.ts +17 -0
  132. package/lib/__templates__/expo/client/heroui/components/list-group/list-group.md +387 -0
  133. package/lib/__templates__/expo/client/heroui/components/list-group/list-group.styles.ts +40 -0
  134. package/lib/__templates__/expo/client/heroui/components/list-group/list-group.tsx +206 -0
  135. package/lib/__templates__/expo/client/heroui/components/list-group/list-group.types.ts +132 -0
  136. package/lib/__templates__/expo/client/heroui/components/menu/index.ts +38 -0
  137. package/lib/__templates__/expo/client/heroui/components/menu/menu.animation.ts +121 -0
  138. package/lib/__templates__/expo/client/heroui/components/menu/menu.constants.ts +37 -0
  139. package/lib/__templates__/expo/client/heroui/components/menu/menu.md +620 -0
  140. package/lib/__templates__/expo/client/heroui/components/menu/menu.styles.ts +107 -0
  141. package/lib/__templates__/expo/client/heroui/components/menu/menu.tsx +664 -0
  142. package/lib/__templates__/expo/client/heroui/components/menu/menu.types.ts +394 -0
  143. package/lib/__templates__/expo/client/heroui/components/popover/arrow-svg.tsx +180 -0
  144. package/lib/__templates__/expo/client/heroui/components/popover/index.ts +18 -0
  145. package/lib/__templates__/expo/client/heroui/components/popover/popover.animation.ts +9 -0
  146. package/lib/__templates__/expo/client/heroui/components/popover/popover.constants.ts +34 -0
  147. package/lib/__templates__/expo/client/heroui/components/popover/popover.md +508 -0
  148. package/lib/__templates__/expo/client/heroui/components/popover/popover.styles.ts +98 -0
  149. package/lib/__templates__/expo/client/heroui/components/popover/popover.tsx +624 -0
  150. package/lib/__templates__/expo/client/heroui/components/popover/popover.types.ts +290 -0
  151. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/index.ts +3 -0
  152. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.animation.ts +450 -0
  153. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.constants.ts +12 -0
  154. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.md +328 -0
  155. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.styles.ts +84 -0
  156. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.tsx +330 -0
  157. package/lib/__templates__/expo/client/heroui/components/pressable-feedback/pressable-feedback.types.ts +386 -0
  158. package/lib/__templates__/expo/client/heroui/components/radio/index.ts +9 -0
  159. package/lib/__templates__/expo/client/heroui/components/radio/radio.animation.ts +92 -0
  160. package/lib/__templates__/expo/client/heroui/components/radio/radio.constants.ts +11 -0
  161. package/lib/__templates__/expo/client/heroui/components/radio/radio.md +339 -0
  162. package/lib/__templates__/expo/client/heroui/components/radio/radio.styles.ts +80 -0
  163. package/lib/__templates__/expo/client/heroui/components/radio/radio.tsx +217 -0
  164. package/lib/__templates__/expo/client/heroui/components/radio/radio.types.ts +106 -0
  165. package/lib/__templates__/expo/client/heroui/components/radio-group/index.ts +9 -0
  166. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.animation.ts +20 -0
  167. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.constants.ts +7 -0
  168. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.context.ts +14 -0
  169. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.md +273 -0
  170. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.styles.ts +15 -0
  171. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.tsx +220 -0
  172. package/lib/__templates__/expo/client/heroui/components/radio-group/radio-group.types.ts +64 -0
  173. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/index.ts +7 -0
  174. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.animation.ts +132 -0
  175. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.constants.ts +21 -0
  176. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.md +206 -0
  177. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.styles.ts +52 -0
  178. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.tsx +262 -0
  179. package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.types.ts +121 -0
  180. package/lib/__templates__/expo/client/heroui/components/search-field/index.ts +17 -0
  181. package/lib/__templates__/expo/client/heroui/components/search-field/search-field.animation.ts +18 -0
  182. package/lib/__templates__/expo/client/heroui/components/search-field/search-field.constants.ts +10 -0
  183. package/lib/__templates__/expo/client/heroui/components/search-field/search-field.md +231 -0
  184. package/lib/__templates__/expo/client/heroui/components/search-field/search-field.styles.ts +35 -0
  185. package/lib/__templates__/expo/client/heroui/components/search-field/search-field.tsx +253 -0
  186. package/lib/__templates__/expo/client/heroui/components/search-field/search-field.types.ts +160 -0
  187. package/lib/__templates__/expo/client/heroui/components/search-field/search-icon.tsx +37 -0
  188. package/lib/__templates__/expo/client/heroui/components/select/index.ts +28 -0
  189. package/lib/__templates__/expo/client/heroui/components/select/select.animation.ts +92 -0
  190. package/lib/__templates__/expo/client/heroui/components/select/select.constants.ts +53 -0
  191. package/lib/__templates__/expo/client/heroui/components/select/select.md +796 -0
  192. package/lib/__templates__/expo/client/heroui/components/select/select.styles.ts +149 -0
  193. package/lib/__templates__/expo/client/heroui/components/select/select.tsx +828 -0
  194. package/lib/__templates__/expo/client/heroui/components/select/select.types.ts +438 -0
  195. package/lib/__templates__/expo/client/heroui/components/separator/index.ts +7 -0
  196. package/lib/__templates__/expo/client/heroui/components/separator/separator.constants.ts +6 -0
  197. package/lib/__templates__/expo/client/heroui/components/separator/separator.md +106 -0
  198. package/lib/__templates__/expo/client/heroui/components/separator/separator.styles.ts +50 -0
  199. package/lib/__templates__/expo/client/heroui/components/separator/separator.tsx +62 -0
  200. package/lib/__templates__/expo/client/heroui/components/separator/separator.types.ts +40 -0
  201. package/lib/__templates__/expo/client/heroui/components/skeleton/index.ts +7 -0
  202. package/lib/__templates__/expo/client/heroui/components/skeleton/linear-gradient.tsx +45 -0
  203. package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.animation.ts +351 -0
  204. package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.constants.ts +39 -0
  205. package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.md +208 -0
  206. package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.styles.ts +49 -0
  207. package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.tsx +183 -0
  208. package/lib/__templates__/expo/client/heroui/components/skeleton/skeleton.types.ts +191 -0
  209. package/lib/__templates__/expo/client/heroui/components/skeleton-group/index.ts +7 -0
  210. package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.constants.ts +7 -0
  211. package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.md +247 -0
  212. package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.styles.ts +10 -0
  213. package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.tsx +94 -0
  214. package/lib/__templates__/expo/client/heroui/components/skeleton-group/skeleton-group.types.ts +28 -0
  215. package/lib/__templates__/expo/client/heroui/components/slider/index.ts +23 -0
  216. package/lib/__templates__/expo/client/heroui/components/slider/slider.animation.ts +87 -0
  217. package/lib/__templates__/expo/client/heroui/components/slider/slider.constants.ts +24 -0
  218. package/lib/__templates__/expo/client/heroui/components/slider/slider.md +348 -0
  219. package/lib/__templates__/expo/client/heroui/components/slider/slider.styles.ts +85 -0
  220. package/lib/__templates__/expo/client/heroui/components/slider/slider.tsx +413 -0
  221. package/lib/__templates__/expo/client/heroui/components/slider/slider.types.ts +120 -0
  222. package/lib/__templates__/expo/client/heroui/components/spinner/index.ts +10 -0
  223. package/lib/__templates__/expo/client/heroui/components/spinner/spinner-icon.tsx +49 -0
  224. package/lib/__templates__/expo/client/heroui/components/spinner/spinner.animation.ts +150 -0
  225. package/lib/__templates__/expo/client/heroui/components/spinner/spinner.constants.ts +36 -0
  226. package/lib/__templates__/expo/client/heroui/components/spinner/spinner.md +199 -0
  227. package/lib/__templates__/expo/client/heroui/components/spinner/spinner.styles.ts +44 -0
  228. package/lib/__templates__/expo/client/heroui/components/spinner/spinner.tsx +198 -0
  229. package/lib/__templates__/expo/client/heroui/components/spinner/spinner.types.ts +158 -0
  230. package/lib/__templates__/expo/client/heroui/components/surface/index.ts +3 -0
  231. package/lib/__templates__/expo/client/heroui/components/surface/surface.animation.ts +18 -0
  232. package/lib/__templates__/expo/client/heroui/components/surface/surface.constants.ts +6 -0
  233. package/lib/__templates__/expo/client/heroui/components/surface/surface.md +136 -0
  234. package/lib/__templates__/expo/client/heroui/components/surface/surface.styles.ts +28 -0
  235. package/lib/__templates__/expo/client/heroui/components/surface/surface.tsx +66 -0
  236. package/lib/__templates__/expo/client/heroui/components/surface/surface.types.ts +46 -0
  237. package/lib/__templates__/expo/client/heroui/components/switch/index.ts +3 -0
  238. package/lib/__templates__/expo/client/heroui/components/switch/switch.animation.ts +243 -0
  239. package/lib/__templates__/expo/client/heroui/components/switch/switch.constants.ts +26 -0
  240. package/lib/__templates__/expo/client/heroui/components/switch/switch.md +334 -0
  241. package/lib/__templates__/expo/client/heroui/components/switch/switch.styles.ts +83 -0
  242. package/lib/__templates__/expo/client/heroui/components/switch/switch.tsx +280 -0
  243. package/lib/__templates__/expo/client/heroui/components/switch/switch.types.ts +208 -0
  244. package/lib/__templates__/expo/client/heroui/components/tabs/index.ts +8 -0
  245. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.animation.ts +246 -0
  246. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.constants.ts +17 -0
  247. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.context.ts +28 -0
  248. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.md +565 -0
  249. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.styles.ts +168 -0
  250. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.tsx +445 -0
  251. package/lib/__templates__/expo/client/heroui/components/tabs/tabs.types.ts +341 -0
  252. package/lib/__templates__/expo/client/heroui/components/tag-group/index.ts +15 -0
  253. package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.animation.ts +17 -0
  254. package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.constants.ts +10 -0
  255. package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.md +404 -0
  256. package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.styles.ts +74 -0
  257. package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.tsx +325 -0
  258. package/lib/__templates__/expo/client/heroui/components/tag-group/tag-group.types.ts +125 -0
  259. package/lib/__templates__/expo/client/heroui/components/text-area/index.ts +3 -0
  260. package/lib/__templates__/expo/client/heroui/components/text-area/text-area.constants.ts +6 -0
  261. package/lib/__templates__/expo/client/heroui/components/text-area/text-area.md +133 -0
  262. package/lib/__templates__/expo/client/heroui/components/text-area/text-area.styles.ts +10 -0
  263. package/lib/__templates__/expo/client/heroui/components/text-area/text-area.tsx +44 -0
  264. package/lib/__templates__/expo/client/heroui/components/text-area/text-area.types.ts +6 -0
  265. package/lib/__templates__/expo/client/heroui/components/text-field/index.ts +3 -0
  266. package/lib/__templates__/expo/client/heroui/components/text-field/text-field.animation.ts +20 -0
  267. package/lib/__templates__/expo/client/heroui/components/text-field/text-field.constants.ts +6 -0
  268. package/lib/__templates__/expo/client/heroui/components/text-field/text-field.md +256 -0
  269. package/lib/__templates__/expo/client/heroui/components/text-field/text-field.styles.ts +10 -0
  270. package/lib/__templates__/expo/client/heroui/components/text-field/text-field.tsx +82 -0
  271. package/lib/__templates__/expo/client/heroui/components/text-field/text-field.types.ts +56 -0
  272. package/lib/__templates__/expo/client/heroui/components/toast/index.ts +4 -0
  273. package/lib/__templates__/expo/client/heroui/components/toast/toast.animation.ts +381 -0
  274. package/lib/__templates__/expo/client/heroui/components/toast/toast.constants.ts +10 -0
  275. package/lib/__templates__/expo/client/heroui/components/toast/toast.hooks.ts +73 -0
  276. package/lib/__templates__/expo/client/heroui/components/toast/toast.md +420 -0
  277. package/lib/__templates__/expo/client/heroui/components/toast/toast.styles.ts +89 -0
  278. package/lib/__templates__/expo/client/heroui/components/toast/toast.tsx +472 -0
  279. package/lib/__templates__/expo/client/heroui/components/toast/toast.types.ts +320 -0
  280. package/lib/__templates__/expo/client/heroui/docs.md +47 -0
  281. package/lib/__templates__/expo/client/heroui/helpers/external/hooks/index.ts +3 -0
  282. package/lib/__templates__/expo/client/heroui/helpers/external/hooks/use-is-on-surface.ts +8 -0
  283. package/lib/__templates__/expo/client/heroui/helpers/external/hooks/use-theme-color.ts +137 -0
  284. package/lib/__templates__/expo/client/heroui/helpers/external/utils/cn.ts +12 -0
  285. package/lib/__templates__/expo/client/heroui/helpers/external/utils/color-kit/index.ts +2395 -0
  286. package/lib/__templates__/expo/client/heroui/helpers/external/utils/color-kit/types.ts +212 -0
  287. package/lib/__templates__/expo/client/heroui/helpers/external/utils/index.ts +2 -0
  288. package/lib/__templates__/expo/client/heroui/helpers/internal/components/animated-check-icon.tsx +78 -0
  289. package/lib/__templates__/expo/client/heroui/helpers/internal/components/bottom-sheet-content-container.tsx +97 -0
  290. package/lib/__templates__/expo/client/heroui/helpers/internal/components/bottom-sheet-content.tsx +158 -0
  291. package/lib/__templates__/expo/client/heroui/helpers/internal/components/check-icon.tsx +28 -0
  292. package/lib/__templates__/expo/client/heroui/helpers/internal/components/chevron-down-icon.tsx +28 -0
  293. package/lib/__templates__/expo/client/heroui/helpers/internal/components/chevron-right-icon.tsx +29 -0
  294. package/lib/__templates__/expo/client/heroui/helpers/internal/components/close-icon.tsx +29 -0
  295. package/lib/__templates__/expo/client/heroui/helpers/internal/components/full-window-overlay.tsx +48 -0
  296. package/lib/__templates__/expo/client/heroui/helpers/internal/components/hero-text.tsx +71 -0
  297. package/lib/__templates__/expo/client/heroui/helpers/internal/components/index.ts +9 -0
  298. package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/animation-settings-context.ts +19 -0
  299. package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/bottom-sheet-is-dragging-context.ts +11 -0
  300. package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/form-field-context.ts +36 -0
  301. package/lib/__templates__/expo/client/heroui/helpers/internal/contexts/index.ts +3 -0
  302. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/index.ts +14 -0
  303. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-augmented-ref.ts +32 -0
  304. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-bottom-sheet-aware-handlers.ts +94 -0
  305. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-bottom-sheet-gesture-handlers.ts +52 -0
  306. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-combined-animation-disabled-state.ts +49 -0
  307. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts +124 -0
  308. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-dev-info.ts +38 -0
  309. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-keyboard-status.ts +22 -0
  310. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-bottom-sheet-content-animation.ts +67 -0
  311. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-dialog-content-animation.ts +296 -0
  312. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-overlay-animation.ts +91 -0
  313. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-popover-content-animation.ts +199 -0
  314. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-popup-root-animation.ts +26 -0
  315. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-relative-position.ts +353 -0
  316. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-resolved-style-property.ts +118 -0
  317. package/lib/__templates__/expo/client/heroui/helpers/internal/types/animation.ts +131 -0
  318. package/lib/__templates__/expo/client/heroui/helpers/internal/types/bottom-sheet.ts +99 -0
  319. package/lib/__templates__/expo/client/heroui/helpers/internal/types/index.ts +5 -0
  320. package/lib/__templates__/expo/client/heroui/helpers/internal/types/misc.ts +10 -0
  321. package/lib/__templates__/expo/client/heroui/helpers/internal/types/primitives.ts +146 -0
  322. package/lib/__templates__/expo/client/heroui/helpers/internal/types/theme.ts +18 -0
  323. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/animation.ts +266 -0
  324. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/children-to-string.ts +117 -0
  325. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/combine-styles.ts +17 -0
  326. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/create-context.ts +60 -0
  327. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/ease-gradient/create-interpolation.ts +35 -0
  328. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/ease-gradient/index.ts +97 -0
  329. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/get-element-by-display-name.ts +15 -0
  330. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/get-element-with-default.ts +17 -0
  331. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/has-prop.ts +18 -0
  332. package/lib/__templates__/expo/client/heroui/helpers/internal/utils/index.ts +8 -0
  333. package/lib/__templates__/expo/client/heroui/index.tsx +51 -0
  334. package/lib/__templates__/expo/client/heroui/primitives/README.md +27 -0
  335. package/lib/__templates__/expo/client/heroui/primitives/accordion/accordion.tsx +270 -0
  336. package/lib/__templates__/expo/client/heroui/primitives/accordion/accordion.types.ts +117 -0
  337. package/lib/__templates__/expo/client/heroui/primitives/accordion/accordion.utils.ts +12 -0
  338. package/lib/__templates__/expo/client/heroui/primitives/accordion/index.ts +2 -0
  339. package/lib/__templates__/expo/client/heroui/primitives/activity-indicator/activity-indicator.tsx +50 -0
  340. package/lib/__templates__/expo/client/heroui/primitives/activity-indicator/activity-indicator.types.ts +24 -0
  341. package/lib/__templates__/expo/client/heroui/primitives/activity-indicator/index.ts +2 -0
  342. package/lib/__templates__/expo/client/heroui/primitives/alert/alert.tsx +124 -0
  343. package/lib/__templates__/expo/client/heroui/primitives/alert/alert.types.ts +87 -0
  344. package/lib/__templates__/expo/client/heroui/primitives/alert/index.ts +2 -0
  345. package/lib/__templates__/expo/client/heroui/primitives/avatar/avatar.tsx +171 -0
  346. package/lib/__templates__/expo/client/heroui/primitives/avatar/avatar.types.ts +62 -0
  347. package/lib/__templates__/expo/client/heroui/primitives/avatar/avatar.utils.ts +102 -0
  348. package/lib/__templates__/expo/client/heroui/primitives/avatar/index.ts +2 -0
  349. package/lib/__templates__/expo/client/heroui/primitives/bottom-sheet/bottom-sheet.tsx +235 -0
  350. package/lib/__templates__/expo/client/heroui/primitives/bottom-sheet/bottom-sheet.types.ts +127 -0
  351. package/lib/__templates__/expo/client/heroui/primitives/bottom-sheet/index.ts +2 -0
  352. package/lib/__templates__/expo/client/heroui/primitives/checkbox/checkbox.tsx +119 -0
  353. package/lib/__templates__/expo/client/heroui/primitives/checkbox/checkbox.types.ts +37 -0
  354. package/lib/__templates__/expo/client/heroui/primitives/checkbox/index.ts +2 -0
  355. package/lib/__templates__/expo/client/heroui/primitives/dialog/dialog.tsx +274 -0
  356. package/lib/__templates__/expo/client/heroui/primitives/dialog/dialog.types.ts +129 -0
  357. package/lib/__templates__/expo/client/heroui/primitives/dialog/index.ts +2 -0
  358. package/lib/__templates__/expo/client/heroui/primitives/input-otp/index.ts +3 -0
  359. package/lib/__templates__/expo/client/heroui/primitives/input-otp/input-otp.tsx +431 -0
  360. package/lib/__templates__/expo/client/heroui/primitives/input-otp/input-otp.types.ts +169 -0
  361. package/lib/__templates__/expo/client/heroui/primitives/input-otp/input-otp.utils.ts +31 -0
  362. package/lib/__templates__/expo/client/heroui/primitives/label/index.ts +2 -0
  363. package/lib/__templates__/expo/client/heroui/primitives/label/label.tsx +24 -0
  364. package/lib/__templates__/expo/client/heroui/primitives/label/label.types.ts +39 -0
  365. package/lib/__templates__/expo/client/heroui/primitives/menu/index.ts +2 -0
  366. package/lib/__templates__/expo/client/heroui/primitives/menu/menu.tsx +765 -0
  367. package/lib/__templates__/expo/client/heroui/primitives/menu/menu.types.ts +401 -0
  368. package/lib/__templates__/expo/client/heroui/primitives/popover/index.ts +2 -0
  369. package/lib/__templates__/expo/client/heroui/primitives/popover/popover.tsx +382 -0
  370. package/lib/__templates__/expo/client/heroui/primitives/popover/popover.types.ts +201 -0
  371. package/lib/__templates__/expo/client/heroui/primitives/portal/index.ts +1 -0
  372. package/lib/__templates__/expo/client/heroui/primitives/portal/portal.tsx +126 -0
  373. package/lib/__templates__/expo/client/heroui/primitives/radio/index.ts +2 -0
  374. package/lib/__templates__/expo/client/heroui/primitives/radio/radio.tsx +133 -0
  375. package/lib/__templates__/expo/client/heroui/primitives/radio/radio.types.ts +47 -0
  376. package/lib/__templates__/expo/client/heroui/primitives/radio-group/index.ts +2 -0
  377. package/lib/__templates__/expo/client/heroui/primitives/radio-group/radio-group.tsx +114 -0
  378. package/lib/__templates__/expo/client/heroui/primitives/radio-group/radio-group.types.ts +65 -0
  379. package/lib/__templates__/expo/client/heroui/primitives/select/index.ts +2 -0
  380. package/lib/__templates__/expo/client/heroui/primitives/select/select.tsx +705 -0
  381. package/lib/__templates__/expo/client/heroui/primitives/select/select.types.ts +409 -0
  382. package/lib/__templates__/expo/client/heroui/primitives/select/select.utils.ts +35 -0
  383. package/lib/__templates__/expo/client/heroui/primitives/slider/index.ts +3 -0
  384. package/lib/__templates__/expo/client/heroui/primitives/slider/slider.tsx +464 -0
  385. package/lib/__templates__/expo/client/heroui/primitives/slider/slider.types.ts +208 -0
  386. package/lib/__templates__/expo/client/heroui/primitives/slider/slider.utils.ts +93 -0
  387. package/lib/__templates__/expo/client/heroui/primitives/slot/index.ts +1 -0
  388. package/lib/__templates__/expo/client/heroui/primitives/slot/slot.tsx +122 -0
  389. package/lib/__templates__/expo/client/heroui/primitives/slot/types.ts +19 -0
  390. package/lib/__templates__/expo/client/heroui/primitives/slot/utils.ts +96 -0
  391. package/lib/__templates__/expo/client/heroui/primitives/switch/index.ts +2 -0
  392. package/lib/__templates__/expo/client/heroui/primitives/switch/switch.tsx +61 -0
  393. package/lib/__templates__/expo/client/heroui/primitives/switch/switch.types.ts +55 -0
  394. package/lib/__templates__/expo/client/heroui/primitives/tabs/index.ts +2 -0
  395. package/lib/__templates__/expo/client/heroui/primitives/tabs/tabs.tsx +202 -0
  396. package/lib/__templates__/expo/client/heroui/primitives/tabs/tabs.types.ts +77 -0
  397. package/lib/__templates__/expo/client/heroui/primitives/tag-group/index.ts +2 -0
  398. package/lib/__templates__/expo/client/heroui/primitives/tag-group/tag-group.tsx +324 -0
  399. package/lib/__templates__/expo/client/heroui/primitives/tag-group/tag-group.types.ts +119 -0
  400. package/lib/__templates__/expo/client/heroui/primitives/toast/index.ts +2 -0
  401. package/lib/__templates__/expo/client/heroui/primitives/toast/toast.tsx +138 -0
  402. package/lib/__templates__/expo/client/heroui/primitives/toast/toast.types.ts +86 -0
  403. package/lib/__templates__/expo/client/heroui/providers/animation-settings/index.ts +8 -0
  404. package/lib/__templates__/expo/client/heroui/providers/animation-settings/provider.tsx +47 -0
  405. package/lib/__templates__/expo/client/heroui/providers/animation-settings/types.ts +27 -0
  406. package/lib/__templates__/expo/client/heroui/providers/hero-ui-native/index.ts +2 -0
  407. package/lib/__templates__/expo/client/heroui/providers/hero-ui-native/provider.tsx +67 -0
  408. package/lib/__templates__/expo/client/heroui/providers/hero-ui-native/types.ts +114 -0
  409. package/lib/__templates__/expo/client/heroui/providers/hero-ui-native-raw/index.ts +2 -0
  410. package/lib/__templates__/expo/client/heroui/providers/hero-ui-native-raw/provider.tsx +50 -0
  411. package/lib/__templates__/expo/client/heroui/providers/hero-ui-native-raw/types.ts +39 -0
  412. package/lib/__templates__/expo/client/heroui/providers/text-component/index.ts +2 -0
  413. package/lib/__templates__/expo/client/heroui/providers/text-component/provider.tsx +9 -0
  414. package/lib/__templates__/expo/client/heroui/providers/text-component/types.ts +52 -0
  415. package/lib/__templates__/expo/client/heroui/providers/toast/index.ts +3 -0
  416. package/lib/__templates__/expo/client/heroui/providers/toast/insets-container.tsx +87 -0
  417. package/lib/__templates__/expo/client/heroui/providers/toast/provider.tsx +431 -0
  418. package/lib/__templates__/expo/client/heroui/providers/toast/reducer.ts +34 -0
  419. package/lib/__templates__/expo/client/heroui/providers/toast/toast-config.context.ts +27 -0
  420. package/lib/__templates__/expo/client/heroui/providers/toast/toast-item-renderer.tsx +45 -0
  421. package/lib/__templates__/expo/client/heroui/providers/toast/types.ts +373 -0
  422. package/lib/__templates__/expo/client/heroui/styles/index.css +3 -0
  423. package/lib/__templates__/expo/client/heroui/styles/theme.css +112 -0
  424. package/lib/__templates__/expo/client/heroui/styles/utilities.css +8 -0
  425. package/lib/__templates__/expo/client/heroui/styles/variables.css +146 -0
  426. package/lib/__templates__/expo/client/package.json +4 -1
  427. package/lib/__templates__/expo/package.json +1 -1
  428. package/lib/__templates__/expo/pnpm-lock.yaml +68 -0
  429. package/lib/__templates__/nextjs/AGENTS.md +6 -4
  430. package/lib/__templates__/nextjs/eslint.config.mjs +9 -0
  431. package/lib/__templates__/taro/.coze +2 -0
  432. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +1 -2
  433. package/lib/__templates__/taro/config/index.ts +1 -1
  434. package/lib/__templates__/taro/package.json +1 -0
  435. package/lib/__templates__/taro/project.config.json +1 -1
  436. package/lib/cli.js +246 -252
  437. package/package.json +3 -2
package/lib/cli.js CHANGED
@@ -2106,7 +2106,7 @@ const EventBuilder = {
2106
2106
  };
2107
2107
 
2108
2108
  var name = "@coze-arch/cli";
2109
- var version = "0.0.10";
2109
+ var version = "0.0.11";
2110
2110
  var description = "coze coding devtools cli";
2111
2111
  var license = "MIT";
2112
2112
  var author = "fanwenjie.fe@bytedance.com";
@@ -2166,6 +2166,7 @@ var devDependencies = {
2166
2166
  "@coze-coding/lambda": "workspace:*",
2167
2167
  "@inquirer/prompts": "^3.2.0",
2168
2168
  "@playwright/test": "~1.55.0",
2169
+ "@slardar/rd-cli": "^0.10.3",
2169
2170
  "@types/debug": "^4.1.12",
2170
2171
  "@types/ejs": "^3.1.5",
2171
2172
  "@types/iarna__toml": "^2.0.5",
@@ -2178,7 +2179,7 @@ var devDependencies = {
2178
2179
  "json-schema-to-typescript": "^15.0.3",
2179
2180
  minimatch: "^10.0.1",
2180
2181
  playwright: "~1.55.0",
2181
- rollup: "^4.41.1",
2182
+ rollup: "^4.60.1",
2182
2183
  sucrase: "^3.35.0",
2183
2184
  "tree-kill": "^1.2.2",
2184
2185
  tsx: "^4.20.6",
@@ -3400,118 +3401,6 @@ function safeJsonParse(
3400
3401
  }
3401
3402
  }
3402
3403
 
3403
- function _optionalChain$g(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3404
-
3405
-
3406
- /**
3407
- * 检测并解析配置文件内容
3408
- *
3409
- * @param content - 文件内容
3410
- * @returns 解析后的配置对象
3411
- */
3412
- const parseConfigContent = (content) => {
3413
- // 1. 尝试 TOML 格式 (默认)
3414
- try {
3415
- const config = toml.parse(content);
3416
- return config ;
3417
- } catch (error) {
3418
- // TOML 解析失败,继续尝试其他格式
3419
-
3420
- console.debug('TOML parse failed:', error);
3421
- }
3422
-
3423
- // 2. 尝试 YAML 格式
3424
- try {
3425
- const config = jsYaml.load(content);
3426
- if (config && typeof config === 'object') {
3427
- return config ;
3428
- }
3429
- } catch (error) {
3430
- // YAML 解析失败,继续尝试其他格式
3431
-
3432
- console.debug('YAML parse failed:', error);
3433
- }
3434
-
3435
- // 3. 尝试 JSON 格式
3436
- const config = safeJsonParse(content);
3437
- if (config) {
3438
- return config;
3439
- }
3440
-
3441
- return null;
3442
- };
3443
-
3444
- /**
3445
- * 加载 .coze 配置文件
3446
- *
3447
- * @param projectPath - 项目目录路径
3448
- * @returns .coze 配置对象
3449
- */
3450
- const loadCozeConfig = async (
3451
- projectPath = process.cwd(),
3452
- ) => {
3453
- const cozeConfigPath = path.join(projectPath, '.coze');
3454
-
3455
- let content;
3456
- try {
3457
- content = await fs$1.readFile(cozeConfigPath, 'utf-8');
3458
- } catch (error) {
3459
- throw new Error(
3460
- `.coze config file not found in ${projectPath}\n` +
3461
- 'Please ensure you are in a project directory initialized with coze-coding.\n' +
3462
- `Error: ${error instanceof Error ? error.message : String(error)}`,
3463
- );
3464
- }
3465
-
3466
- const config = parseConfigContent(content);
3467
- if (!config) {
3468
- throw new Error(
3469
- 'Failed to parse .coze config file.\n' +
3470
- 'Please ensure the file is in valid TOML, YAML, or JSON format.',
3471
- );
3472
- }
3473
-
3474
- return config;
3475
- };
3476
-
3477
- /**
3478
- * 获取指定命令的配置
3479
- *
3480
- * @param config - .coze 配置对象
3481
- * @param commandName - 命令名称 (dev/build/start)
3482
- * @returns 命令配置数组
3483
- */
3484
- const getCommandConfig = (
3485
- config,
3486
- commandName,
3487
- ) => {
3488
- let commandConfig;
3489
-
3490
- // 根据命令名称映射到配置路径
3491
- switch (commandName) {
3492
- case 'dev':
3493
- commandConfig = _optionalChain$g([config, 'access', _ => _.dev, 'optionalAccess', _2 => _2.run]);
3494
- break;
3495
- case 'build':
3496
- commandConfig = _optionalChain$g([config, 'access', _3 => _3.deploy, 'optionalAccess', _4 => _4.build]);
3497
- break;
3498
- case 'start':
3499
- commandConfig = _optionalChain$g([config, 'access', _5 => _5.deploy, 'optionalAccess', _6 => _6.run]);
3500
- break;
3501
- default:
3502
- throw new Error(`Unknown command: ${commandName}`);
3503
- }
3504
-
3505
- if (!commandConfig || commandConfig.length === 0) {
3506
- throw new Error(
3507
- `Command '${commandName}' is not configured in .coze file.\n` +
3508
- 'Please add the corresponding configuration to your .coze file.',
3509
- );
3510
- }
3511
-
3512
- return commandConfig;
3513
- };
3514
-
3515
3404
  const ALIAS = Symbol.for('yaml.alias');
3516
3405
  const DOC = Symbol.for('yaml.document');
3517
3406
  const MAP = Symbol.for('yaml.map');
@@ -3547,7 +3436,7 @@ function isNode(node) {
3547
3436
  }
3548
3437
  const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
3549
3438
 
3550
- function _optionalChain$f(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3439
+ function _optionalChain$g(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3551
3440
  const BREAK = Symbol('break visit');
3552
3441
  const SKIP = Symbol('skip children');
3553
3442
  const REMOVE = Symbol('remove node');
@@ -3660,15 +3549,15 @@ function callVisitor(key, node, visitor, path) {
3660
3549
  if (typeof visitor === 'function')
3661
3550
  return visitor(key, node, path);
3662
3551
  if (isMap(node))
3663
- return _optionalChain$f([visitor, 'access', _ => _.Map, 'optionalCall', _2 => _2(key, node, path)]);
3552
+ return _optionalChain$g([visitor, 'access', _ => _.Map, 'optionalCall', _2 => _2(key, node, path)]);
3664
3553
  if (isSeq(node))
3665
- return _optionalChain$f([visitor, 'access', _3 => _3.Seq, 'optionalCall', _4 => _4(key, node, path)]);
3554
+ return _optionalChain$g([visitor, 'access', _3 => _3.Seq, 'optionalCall', _4 => _4(key, node, path)]);
3666
3555
  if (isPair(node))
3667
- return _optionalChain$f([visitor, 'access', _5 => _5.Pair, 'optionalCall', _6 => _6(key, node, path)]);
3556
+ return _optionalChain$g([visitor, 'access', _5 => _5.Pair, 'optionalCall', _6 => _6(key, node, path)]);
3668
3557
  if (isScalar(node))
3669
- return _optionalChain$f([visitor, 'access', _7 => _7.Scalar, 'optionalCall', _8 => _8(key, node, path)]);
3558
+ return _optionalChain$g([visitor, 'access', _7 => _7.Scalar, 'optionalCall', _8 => _8(key, node, path)]);
3670
3559
  if (isAlias(node))
3671
- return _optionalChain$f([visitor, 'access', _9 => _9.Alias, 'optionalCall', _10 => _10(key, node, path)]);
3560
+ return _optionalChain$g([visitor, 'access', _9 => _9.Alias, 'optionalCall', _10 => _10(key, node, path)]);
3672
3561
  return undefined;
3673
3562
  }
3674
3563
  function replaceNode(key, path, node) {
@@ -3759,7 +3648,7 @@ function applyReviver(reviver, obj, key, val) {
3759
3648
  return reviver.call(obj, key, val);
3760
3649
  }
3761
3650
 
3762
- function _optionalChain$e(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3651
+ function _optionalChain$f(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3763
3652
  /**
3764
3653
  * Recursively convert any node or its contents to native JavaScript
3765
3654
  *
@@ -3789,7 +3678,7 @@ function toJS(value, arg, ctx) {
3789
3678
  ctx.onCreate(res);
3790
3679
  return res;
3791
3680
  }
3792
- if (typeof value === 'bigint' && !_optionalChain$e([ctx, 'optionalAccess', _ => _.keep]))
3681
+ if (typeof value === 'bigint' && !_optionalChain$f([ctx, 'optionalAccess', _ => _.keep]))
3793
3682
  return Number(value);
3794
3683
  return value;
3795
3684
  }
@@ -3827,7 +3716,7 @@ class NodeBase {
3827
3716
  }
3828
3717
  }
3829
3718
 
3830
- function _optionalChain$d(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3719
+ function _optionalChain$e(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3831
3720
  class Alias extends NodeBase {
3832
3721
  constructor(source) {
3833
3722
  super(ALIAS);
@@ -3844,7 +3733,7 @@ class Alias extends NodeBase {
3844
3733
  */
3845
3734
  resolve(doc, ctx) {
3846
3735
  let nodes;
3847
- if (_optionalChain$d([ctx, 'optionalAccess', _ => _.aliasResolveCache])) {
3736
+ if (_optionalChain$e([ctx, 'optionalAccess', _ => _.aliasResolveCache])) {
3848
3737
  nodes = ctx.aliasResolveCache;
3849
3738
  }
3850
3739
  else {
@@ -3883,7 +3772,7 @@ class Alias extends NodeBase {
3883
3772
  data = anchors.get(source);
3884
3773
  }
3885
3774
  /* istanbul ignore if */
3886
- if (_optionalChain$d([data, 'optionalAccess', _2 => _2.res]) === undefined) {
3775
+ if (_optionalChain$e([data, 'optionalAccess', _2 => _2.res]) === undefined) {
3887
3776
  const msg = 'This should not happen: Alias anchor was not resolved?';
3888
3777
  throw new ReferenceError(msg);
3889
3778
  }
@@ -3935,7 +3824,7 @@ function getAliasCount(doc, node, anchors) {
3935
3824
  return 1;
3936
3825
  }
3937
3826
 
3938
- function _optionalChain$c(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3827
+ function _optionalChain$d(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3939
3828
  const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');
3940
3829
  class Scalar extends NodeBase {
3941
3830
  constructor(value) {
@@ -3943,7 +3832,7 @@ class Scalar extends NodeBase {
3943
3832
  this.value = value;
3944
3833
  }
3945
3834
  toJSON(arg, ctx) {
3946
- return _optionalChain$c([ctx, 'optionalAccess', _ => _.keep]) ? this.value : toJS(this.value, arg, ctx);
3835
+ return _optionalChain$d([ctx, 'optionalAccess', _ => _.keep]) ? this.value : toJS(this.value, arg, ctx);
3947
3836
  }
3948
3837
  toString() {
3949
3838
  return String(this.value);
@@ -3955,7 +3844,7 @@ Scalar.PLAIN = 'PLAIN';
3955
3844
  Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
3956
3845
  Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
3957
3846
 
3958
- function _nullishCoalesce$6(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$b(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3847
+ function _nullishCoalesce$6(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$c(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3959
3848
  const defaultTagPrefix = 'tag:yaml.org,2002:';
3960
3849
  function findTagObject(value, tagName, tags) {
3961
3850
  if (tagName) {
@@ -3965,7 +3854,7 @@ function findTagObject(value, tagName, tags) {
3965
3854
  throw new Error(`Tag ${tagName} not found`);
3966
3855
  return tagObj;
3967
3856
  }
3968
- return tags.find(t => _optionalChain$b([t, 'access', _ => _.identify, 'optionalCall', _2 => _2(value)]) && !t.format);
3857
+ return tags.find(t => _optionalChain$c([t, 'access', _ => _.identify, 'optionalCall', _2 => _2(value)]) && !t.format);
3969
3858
  }
3970
3859
  function createNode(value, tagName, ctx) {
3971
3860
  if (isDocument(value))
@@ -3973,7 +3862,7 @@ function createNode(value, tagName, ctx) {
3973
3862
  if (isNode(value))
3974
3863
  return value;
3975
3864
  if (isPair(value)) {
3976
- const map = _optionalChain$b([ctx, 'access', _3 => _3.schema, 'access', _4 => _4[MAP], 'access', _5 => _5.createNode, 'optionalCall', _6 => _6(ctx.schema, null, ctx)]);
3865
+ const map = _optionalChain$c([ctx, 'access', _3 => _3.schema, 'access', _4 => _4[MAP], 'access', _5 => _5.createNode, 'optionalCall', _6 => _6(ctx.schema, null, ctx)]);
3977
3866
  map.items.push(value);
3978
3867
  return map;
3979
3868
  }
@@ -4000,7 +3889,7 @@ function createNode(value, tagName, ctx) {
4000
3889
  sourceObjects.set(value, ref);
4001
3890
  }
4002
3891
  }
4003
- if (_optionalChain$b([tagName, 'optionalAccess', _7 => _7.startsWith, 'call', _8 => _8('!!')]))
3892
+ if (_optionalChain$c([tagName, 'optionalAccess', _7 => _7.startsWith, 'call', _8 => _8('!!')]))
4004
3893
  tagName = defaultTagPrefix + tagName.slice(2);
4005
3894
  let tagObj = findTagObject(value, tagName, schema.tags);
4006
3895
  if (!tagObj) {
@@ -4025,9 +3914,9 @@ function createNode(value, tagName, ctx) {
4025
3914
  onTagObj(tagObj);
4026
3915
  delete ctx.onTagObj;
4027
3916
  }
4028
- const node = _optionalChain$b([tagObj, 'optionalAccess', _9 => _9.createNode])
3917
+ const node = _optionalChain$c([tagObj, 'optionalAccess', _9 => _9.createNode])
4029
3918
  ? tagObj.createNode(ctx.schema, value, ctx)
4030
- : typeof _optionalChain$b([tagObj, 'optionalAccess', _10 => _10.nodeClass, 'optionalAccess', _11 => _11.from]) === 'function'
3919
+ : typeof _optionalChain$c([tagObj, 'optionalAccess', _10 => _10.nodeClass, 'optionalAccess', _11 => _11.from]) === 'function'
4031
3920
  ? tagObj.nodeClass.from(ctx.schema, value, ctx)
4032
3921
  : new Scalar(value);
4033
3922
  if (tagName)
@@ -4345,7 +4234,7 @@ function consumeMoreIndentedLines(text, i, indent) {
4345
4234
  return end;
4346
4235
  }
4347
4236
 
4348
- function _optionalChain$a(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4237
+ function _optionalChain$b(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4349
4238
  const getFoldOptions = (ctx, isBlock) => ({
4350
4239
  indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
4351
4240
  lineWidth: ctx.options.lineWidth,
@@ -4630,9 +4519,9 @@ function plainString(item, ctx, onComment, onChompKeep) {
4630
4519
  // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
4631
4520
  // and others in v1.1.
4632
4521
  if (actualString) {
4633
- const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && _optionalChain$a([tag, 'access', _ => _.test, 'optionalAccess', _2 => _2.test, 'call', _3 => _3(str)]);
4522
+ const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && _optionalChain$b([tag, 'access', _ => _.test, 'optionalAccess', _2 => _2.test, 'call', _3 => _3(str)]);
4634
4523
  const { compat, tags } = ctx.doc.schema;
4635
- if (tags.some(test) || _optionalChain$a([compat, 'optionalAccess', _4 => _4.some, 'call', _5 => _5(test)]))
4524
+ if (tags.some(test) || _optionalChain$b([compat, 'optionalAccess', _4 => _4.some, 'call', _5 => _5(test)]))
4636
4525
  return quotedString(value, ctx);
4637
4526
  }
4638
4527
  return implicitKey
@@ -4678,7 +4567,7 @@ function stringifyString(item, ctx, onComment, onChompKeep) {
4678
4567
  return res;
4679
4568
  }
4680
4569
 
4681
- function _nullishCoalesce$5(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$9(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4570
+ function _nullishCoalesce$5(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$a(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4682
4571
  function createStringifyContext(doc, options) {
4683
4572
  const opt = Object.assign({
4684
4573
  blockQuote: true,
@@ -4696,6 +4585,7 @@ function createStringifyContext(doc, options) {
4696
4585
  nullStr: 'null',
4697
4586
  simpleKeys: false,
4698
4587
  singleQuote: null,
4588
+ trailingComma: false,
4699
4589
  trueStr: 'true',
4700
4590
  verifyAliasOrder: true
4701
4591
  }, doc.schema.toStringOptions, options);
@@ -4730,7 +4620,7 @@ function getTagObject(tags, item) {
4730
4620
  let obj;
4731
4621
  if (isScalar(item)) {
4732
4622
  obj = item.value;
4733
- let match = tags.filter(t => _optionalChain$9([t, 'access', _ => _.identify, 'optionalCall', _2 => _2(obj)]));
4623
+ let match = tags.filter(t => _optionalChain$a([t, 'access', _ => _.identify, 'optionalCall', _2 => _2(obj)]));
4734
4624
  if (match.length > 1) {
4735
4625
  const testMatch = match.filter(t => t.test);
4736
4626
  if (testMatch.length > 0)
@@ -4744,7 +4634,7 @@ function getTagObject(tags, item) {
4744
4634
  tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
4745
4635
  }
4746
4636
  if (!tagObj) {
4747
- const name = _nullishCoalesce$5(_optionalChain$9([obj, 'optionalAccess', _3 => _3.constructor, 'optionalAccess', _4 => _4.name]), () => ( (obj === null ? 'null' : typeof obj)));
4637
+ const name = _nullishCoalesce$5(_optionalChain$a([obj, 'optionalAccess', _3 => _3.constructor, 'optionalAccess', _4 => _4.name]), () => ( (obj === null ? 'null' : typeof obj)));
4748
4638
  throw new Error(`Tag not resolved for ${name} value`);
4749
4639
  }
4750
4640
  return tagObj;
@@ -4770,7 +4660,7 @@ function stringify(item, ctx, onComment, onChompKeep) {
4770
4660
  if (isAlias(item)) {
4771
4661
  if (ctx.doc.directives)
4772
4662
  return item.toString(ctx);
4773
- if (_optionalChain$9([ctx, 'access', _5 => _5.resolvedAliases, 'optionalAccess', _6 => _6.has, 'call', _7 => _7(item)])) {
4663
+ if (_optionalChain$a([ctx, 'access', _5 => _5.resolvedAliases, 'optionalAccess', _6 => _6.has, 'call', _7 => _7(item)])) {
4774
4664
  throw new TypeError(`Cannot stringify circular structure without alias nodes`);
4775
4665
  }
4776
4666
  else {
@@ -4952,7 +4842,7 @@ function warn(logLevel, warning) {
4952
4842
  }
4953
4843
  }
4954
4844
 
4955
- function _optionalChain$8(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4845
+ function _optionalChain$9(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4956
4846
  // If the value associated with a merge key is a single mapping node, each of
4957
4847
  // its key/value pairs is inserted into the current mapping, unless the key
4958
4848
  // already exists in it. If the value associated with the merge key is a
@@ -4976,7 +4866,7 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
4976
4866
  (isScalar(key) &&
4977
4867
  (!key.type || key.type === Scalar.PLAIN) &&
4978
4868
  merge.identify(key.value))) &&
4979
- _optionalChain$8([ctx, 'optionalAccess', _ => _.doc, 'access', _2 => _2.schema, 'access', _3 => _3.tags, 'access', _4 => _4.some, 'call', _5 => _5(tag => tag.tag === merge.tag && tag.default)]);
4869
+ _optionalChain$9([ctx, 'optionalAccess', _ => _.doc, 'access', _2 => _2.schema, 'access', _3 => _3.tags, 'access', _4 => _4.some, 'call', _5 => _5(tag => tag.tag === merge.tag && tag.default)]);
4980
4870
  function addMergeToJSMap(ctx, map, value) {
4981
4871
  value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
4982
4872
  if (isSeq(value))
@@ -5013,7 +4903,7 @@ function mergeValue(ctx, map, value) {
5013
4903
  return map;
5014
4904
  }
5015
4905
 
5016
- function _optionalChain$7(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4906
+ function _optionalChain$8(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5017
4907
  function addPairToJSMap(ctx, map, { key, value }) {
5018
4908
  if (isNode(key) && key.addToJSMap)
5019
4909
  key.addToJSMap(ctx, map, value);
@@ -5050,7 +4940,7 @@ function stringifyKey(key, jsKey, ctx) {
5050
4940
  // eslint-disable-next-line @typescript-eslint/no-base-to-string
5051
4941
  if (typeof jsKey !== 'object')
5052
4942
  return String(jsKey);
5053
- if (isNode(key) && _optionalChain$7([ctx, 'optionalAccess', _ => _.doc])) {
4943
+ if (isNode(key) && _optionalChain$8([ctx, 'optionalAccess', _ => _.doc])) {
5054
4944
  const strCtx = createStringifyContext(ctx.doc, {});
5055
4945
  strCtx.anchors = new Set();
5056
4946
  for (const node of ctx.anchors.keys())
@@ -5070,7 +4960,7 @@ function stringifyKey(key, jsKey, ctx) {
5070
4960
  return JSON.stringify(jsKey);
5071
4961
  }
5072
4962
 
5073
- function _optionalChain$6(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4963
+ function _optionalChain$7(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5074
4964
  function createPair(key, value, ctx) {
5075
4965
  const k = createNode(key, undefined, ctx);
5076
4966
  const v = createNode(value, undefined, ctx);
@@ -5091,17 +4981,17 @@ class Pair {
5091
4981
  return new Pair(key, value);
5092
4982
  }
5093
4983
  toJSON(_, ctx) {
5094
- const pair = _optionalChain$6([ctx, 'optionalAccess', _2 => _2.mapAsMap]) ? new Map() : {};
4984
+ const pair = _optionalChain$7([ctx, 'optionalAccess', _2 => _2.mapAsMap]) ? new Map() : {};
5095
4985
  return addPairToJSMap(ctx, pair, this);
5096
4986
  }
5097
4987
  toString(ctx, onComment, onChompKeep) {
5098
- return _optionalChain$6([ctx, 'optionalAccess', _3 => _3.doc])
4988
+ return _optionalChain$7([ctx, 'optionalAccess', _3 => _3.doc])
5099
4989
  ? stringifyPair(this, ctx, onComment, onChompKeep)
5100
4990
  : JSON.stringify(this);
5101
4991
  }
5102
4992
  }
5103
4993
 
5104
- function _nullishCoalesce$3(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4994
+ function _nullishCoalesce$3(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$6(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5105
4995
  function stringifyCollection(collection, ctx, options) {
5106
4996
  const flow = _nullishCoalesce$3(ctx.inFlow, () => ( collection.flow));
5107
4997
  const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
@@ -5195,19 +5085,29 @@ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
5195
5085
  if (iv.commentBefore)
5196
5086
  reqNewline = true;
5197
5087
  }
5198
- else if (item.value == null && _optionalChain$5([ik, 'optionalAccess', _ => _.comment])) {
5088
+ else if (item.value == null && _optionalChain$6([ik, 'optionalAccess', _ => _.comment])) {
5199
5089
  comment = ik.comment;
5200
5090
  }
5201
5091
  }
5202
5092
  if (comment)
5203
5093
  reqNewline = true;
5204
5094
  let str = stringify(item, itemCtx, () => (comment = null));
5205
- if (i < items.length - 1)
5095
+ reqNewline || (reqNewline = lines.length > linesAtValue || str.includes('\n'));
5096
+ if (i < items.length - 1) {
5206
5097
  str += ',';
5098
+ }
5099
+ else if (ctx.options.trailingComma) {
5100
+ if (ctx.options.lineWidth > 0) {
5101
+ reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) +
5102
+ (str.length + 2) >
5103
+ ctx.options.lineWidth);
5104
+ }
5105
+ if (reqNewline) {
5106
+ str += ',';
5107
+ }
5108
+ }
5207
5109
  if (comment)
5208
5110
  str += lineComment(str, itemIndent, commentString(comment));
5209
- if (!reqNewline && (lines.length > linesAtValue || str.includes('\n')))
5210
- reqNewline = true;
5211
5111
  lines.push(str);
5212
5112
  linesAtValue = lines.length;
5213
5113
  }
@@ -5240,7 +5140,7 @@ function addCommentBefore({ indent, options: { commentString } }, lines, comment
5240
5140
  }
5241
5141
  }
5242
5142
 
5243
- function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5143
+ function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5244
5144
  function findPair(items, key) {
5245
5145
  const k = isScalar(key) ? key.value : key;
5246
5146
  for (const it of items) {
@@ -5301,12 +5201,12 @@ class YAMLMap extends Collection {
5301
5201
  _pair = pair;
5302
5202
  else if (!pair || typeof pair !== 'object' || !('key' in pair)) {
5303
5203
  // In TypeScript, this never happens.
5304
- _pair = new Pair(pair, _optionalChain$4([pair, 'optionalAccess', _2 => _2.value]));
5204
+ _pair = new Pair(pair, _optionalChain$5([pair, 'optionalAccess', _2 => _2.value]));
5305
5205
  }
5306
5206
  else
5307
5207
  _pair = new Pair(pair.key, pair.value);
5308
5208
  const prev = findPair(this.items, _pair.key);
5309
- const sortEntries = _optionalChain$4([this, 'access', _3 => _3.schema, 'optionalAccess', _4 => _4.sortMapEntries]);
5209
+ const sortEntries = _optionalChain$5([this, 'access', _3 => _3.schema, 'optionalAccess', _4 => _4.sortMapEntries]);
5310
5210
  if (prev) {
5311
5211
  if (!overwrite)
5312
5212
  throw new Error(`Key ${_pair.key} already set`);
@@ -5336,7 +5236,7 @@ class YAMLMap extends Collection {
5336
5236
  }
5337
5237
  get(key, keepScalar) {
5338
5238
  const it = findPair(this.items, key);
5339
- const node = _optionalChain$4([it, 'optionalAccess', _5 => _5.value]);
5239
+ const node = _optionalChain$5([it, 'optionalAccess', _5 => _5.value]);
5340
5240
  return _nullishCoalesce$2((!keepScalar && isScalar(node) ? node.value : node), () => ( undefined));
5341
5241
  }
5342
5242
  has(key) {
@@ -5351,8 +5251,8 @@ class YAMLMap extends Collection {
5351
5251
  * @returns Instance of Type, Map, or Object
5352
5252
  */
5353
5253
  toJSON(_, ctx, Type) {
5354
- const map = Type ? new Type() : _optionalChain$4([ctx, 'optionalAccess', _6 => _6.mapAsMap]) ? new Map() : {};
5355
- if (_optionalChain$4([ctx, 'optionalAccess', _7 => _7.onCreate]))
5254
+ const map = Type ? new Type() : _optionalChain$5([ctx, 'optionalAccess', _6 => _6.mapAsMap]) ? new Map() : {};
5255
+ if (_optionalChain$5([ctx, 'optionalAccess', _7 => _7.onCreate]))
5356
5256
  ctx.onCreate(map);
5357
5257
  for (const item of this.items)
5358
5258
  addPairToJSMap(ctx, map, item);
@@ -5377,7 +5277,7 @@ class YAMLMap extends Collection {
5377
5277
  }
5378
5278
  }
5379
5279
 
5380
- function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5280
+ function _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5381
5281
  class YAMLSeq extends Collection {
5382
5282
  static get tagName() {
5383
5283
  return 'tag:yaml.org,2002:seq';
@@ -5440,7 +5340,7 @@ class YAMLSeq extends Collection {
5440
5340
  }
5441
5341
  toJSON(_, ctx) {
5442
5342
  const seq = [];
5443
- if (_optionalChain$3([ctx, 'optionalAccess', _2 => _2.onCreate]))
5343
+ if (_optionalChain$4([ctx, 'optionalAccess', _2 => _2.onCreate]))
5444
5344
  ctx.onCreate(seq);
5445
5345
  let i = 0;
5446
5346
  for (const item of this.items)
@@ -5519,7 +5419,7 @@ function createPairs(schema, iterable, ctx) {
5519
5419
  return pairs;
5520
5420
  }
5521
5421
 
5522
- function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5422
+ function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5523
5423
  class YAMLOMap extends YAMLSeq {
5524
5424
  constructor() {
5525
5425
  super();
@@ -5538,7 +5438,7 @@ class YAMLOMap extends YAMLSeq {
5538
5438
  if (!ctx)
5539
5439
  return super.toJSON(_);
5540
5440
  const map = new Map();
5541
- if (_optionalChain$2([ctx, 'optionalAccess', _2 => _2.onCreate]))
5441
+ if (_optionalChain$3([ctx, 'optionalAccess', _2 => _2.onCreate]))
5542
5442
  ctx.onCreate(map);
5543
5443
  for (const pair of this.items) {
5544
5444
  let key, value;
@@ -5912,6 +5812,118 @@ const isProjectType = async (
5912
5812
  return result.detected && result.type === expectedType;
5913
5813
  };
5914
5814
 
5815
+ function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5816
+
5817
+
5818
+ /**
5819
+ * 检测并解析配置文件内容
5820
+ *
5821
+ * @param content - 文件内容
5822
+ * @returns 解析后的配置对象
5823
+ */
5824
+ const parseConfigContent = (content) => {
5825
+ // 1. 尝试 TOML 格式 (默认)
5826
+ try {
5827
+ const config = toml.parse(content);
5828
+ return config ;
5829
+ } catch (error) {
5830
+ // TOML 解析失败,继续尝试其他格式
5831
+
5832
+ console.debug('TOML parse failed:', error);
5833
+ }
5834
+
5835
+ // 2. 尝试 YAML 格式
5836
+ try {
5837
+ const config = jsYaml.load(content);
5838
+ if (config && typeof config === 'object') {
5839
+ return config ;
5840
+ }
5841
+ } catch (error) {
5842
+ // YAML 解析失败,继续尝试其他格式
5843
+
5844
+ console.debug('YAML parse failed:', error);
5845
+ }
5846
+
5847
+ // 3. 尝试 JSON 格式
5848
+ const config = safeJsonParse(content);
5849
+ if (config) {
5850
+ return config;
5851
+ }
5852
+
5853
+ return null;
5854
+ };
5855
+
5856
+ /**
5857
+ * 加载 .coze 配置文件
5858
+ *
5859
+ * @param projectPath - 项目目录路径
5860
+ * @returns .coze 配置对象
5861
+ */
5862
+ const loadCozeConfig = async (
5863
+ projectPath = process.cwd(),
5864
+ ) => {
5865
+ const cozeConfigPath = path.join(projectPath, '.coze');
5866
+
5867
+ let content;
5868
+ try {
5869
+ content = await fs$1.readFile(cozeConfigPath, 'utf-8');
5870
+ } catch (error) {
5871
+ throw new Error(
5872
+ `.coze config file not found in ${projectPath}\n` +
5873
+ 'Please ensure you are in a project directory initialized with coze-coding.\n' +
5874
+ `Error: ${error instanceof Error ? error.message : String(error)}`,
5875
+ );
5876
+ }
5877
+
5878
+ const config = parseConfigContent(content);
5879
+ if (!config) {
5880
+ throw new Error(
5881
+ 'Failed to parse .coze config file.\n' +
5882
+ 'Please ensure the file is in valid TOML, YAML, or JSON format.',
5883
+ );
5884
+ }
5885
+
5886
+ return config;
5887
+ };
5888
+
5889
+ /**
5890
+ * 获取指定命令的配置
5891
+ *
5892
+ * @param config - .coze 配置对象
5893
+ * @param commandName - 命令名称 (dev/build/start)
5894
+ * @returns 命令配置数组
5895
+ */
5896
+ const getCommandConfig = (
5897
+ config,
5898
+ commandName,
5899
+ ) => {
5900
+ let commandConfig;
5901
+
5902
+ // 根据命令名称映射到配置路径
5903
+ switch (commandName) {
5904
+ case 'dev':
5905
+ commandConfig = _optionalChain$2([config, 'access', _ => _.dev, 'optionalAccess', _2 => _2.run]);
5906
+ break;
5907
+ case 'build':
5908
+ commandConfig = _optionalChain$2([config, 'access', _3 => _3.deploy, 'optionalAccess', _4 => _4.build]);
5909
+ break;
5910
+ case 'start':
5911
+ commandConfig = _optionalChain$2([config, 'access', _5 => _5.deploy, 'optionalAccess', _6 => _6.run]);
5912
+ break;
5913
+ default:
5914
+ throw new Error(`Unknown command: ${commandName}`);
5915
+ }
5916
+
5917
+ if (!commandConfig || commandConfig.length === 0) {
5918
+ throw new Error(
5919
+ `Command '${commandName}' is not configured in .coze file.\n` +
5920
+ 'Please add the corresponding configuration to your .coze file.',
5921
+ );
5922
+ }
5923
+
5924
+ return commandConfig;
5925
+ };
5926
+
5915
5927
  // ABOUTME: Fix rule to replace npx commands with pnpm in shell scripts (dev.sh, build.sh)
5916
5928
  // ABOUTME: This fixes module resolution issues when using npx in certain project types
5917
5929
  // ABOUTME: See: /Users/bytedance/Downloads/projects2/docs/npx-pnpm-module-resolution-issue.md
@@ -6425,18 +6437,50 @@ const createLogStream = (logFilePath) => {
6425
6437
  const logDir = path.dirname(logFilePath);
6426
6438
 
6427
6439
  // 确保日志目录存在
6440
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from config, not raw user input
6428
6441
  if (!fs.existsSync(logDir)) {
6442
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from config, not raw user input
6429
6443
  fs.mkdirSync(logDir, { recursive: true });
6430
6444
  }
6431
6445
 
6432
6446
  // 使用 'w' 标志覆盖之前的日志
6447
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from config, not raw user input
6433
6448
  return fs.createWriteStream(logFilePath, { flags: 'w' });
6434
6449
  };
6435
6450
 
6436
6451
  /**
6437
6452
  * 执行命令的内部实现
6438
6453
  */
6439
- // eslint-disable-next-line @coze-arch/max-line-per-function, max-lines-per-function
6454
+ const reportFailureAndExit = (
6455
+ error,
6456
+ exitCode,
6457
+ context
6458
+
6459
+
6460
+
6461
+
6462
+
6463
+ ,
6464
+ ) => {
6465
+ const { commandName, cmdStartTime, options, categories, errorContext } =
6466
+ context;
6467
+ reportError(error, { command: commandName, ...errorContext });
6468
+ reportCommandComplete(commandName, false, Date.now() - cmdStartTime, {
6469
+ args: JSON.stringify(options),
6470
+ errorCode: exitCode,
6471
+ errorMessage: error.message,
6472
+ categories,
6473
+ });
6474
+ flushSlardar()
6475
+ .then(() => {
6476
+ process.exit(exitCode);
6477
+ })
6478
+ .catch(() => {
6479
+ process.exit(exitCode);
6480
+ });
6481
+ };
6482
+
6483
+ // eslint-disable-next-line @coze-arch/max-line-per-function, max-lines-per-function -- orchestrates fix+build+reporting
6440
6484
  const executeRun = async (
6441
6485
  commandName,
6442
6486
  options = {},
@@ -6444,12 +6488,17 @@ const executeRun = async (
6444
6488
  const cmdStartTime = Date.now();
6445
6489
  let fixDuration = 0;
6446
6490
  let buildStartTime = 0;
6491
+ let projectType = 'unknown';
6447
6492
 
6448
6493
  try {
6449
6494
  logger.info(`Running ${commandName} command...`);
6450
6495
 
6496
+ // 检测项目类型,用于上报
6497
+ const projectDetection = await detectProjectType(process.cwd());
6498
+ projectType = projectDetection.type;
6499
+
6451
6500
  // 上报命令开始
6452
- reportCommandStart(commandName, JSON.stringify(options));
6501
+ reportCommandStart(commandName, JSON.stringify(options), { projectType });
6453
6502
 
6454
6503
  // 1. 对于 build 命令,先执行 fix 以确保项目配置正确
6455
6504
  if (['dev', 'build'].includes(commandName)) {
@@ -6457,9 +6506,9 @@ const executeRun = async (
6457
6506
  const fixStartTime = Date.now();
6458
6507
  try {
6459
6508
  await executeFix();
6460
- // eslint-disable-next-line @coze-arch/no-empty-catch
6461
- } catch (e) {
6462
- // just ignore
6509
+ // eslint-disable-next-line @coze-arch/no-empty-catch, @coze-arch/use-error-in-catch -- intentionally ignored
6510
+ } catch (_e) {
6511
+ // fix errors are intentionally ignored to allow the main command to proceed
6463
6512
  }
6464
6513
  fixDuration = Date.now() - fixStartTime;
6465
6514
  logger.info('');
@@ -6516,25 +6565,23 @@ const executeRun = async (
6516
6565
  logger.error(`Check log file for details: ${logFilePath}`);
6517
6566
 
6518
6567
  // 上报命令失败
6519
- reportError(new Error(errorMessage), {
6520
- command: commandName,
6521
- exitCode: String(_nullishCoalesce$1(code, () => ( 'unknown'))),
6522
- signal: _nullishCoalesce$1(signal, () => ( 'none')),
6523
- logFile: logFilePath,
6524
- });
6525
- reportCommandComplete(commandName, false, Date.now() - cmdStartTime, {
6526
- args: JSON.stringify(options),
6527
- errorCode: _nullishCoalesce$1(code, () => ( 1)),
6528
- errorMessage,
6568
+ reportFailureAndExit(new Error(errorMessage), code || 1, {
6569
+ commandName,
6570
+ cmdStartTime,
6571
+ options,
6572
+ categories: {
6573
+ fixDuration: String(fixDuration),
6574
+ buildDuration: String(buildDuration),
6575
+ exitCode: String(_nullishCoalesce$1(code, () => ( 'unknown'))),
6576
+ projectType,
6577
+ },
6578
+ errorContext: {
6579
+ exitCode: String(_nullishCoalesce$1(code, () => ( 'unknown'))),
6580
+ signal: _nullishCoalesce$1(signal, () => ( 'none')),
6581
+ logFile: logFilePath,
6582
+ projectType,
6583
+ },
6529
6584
  });
6530
- flushSlardar()
6531
- .then(() => {
6532
- process.exit(code || 1);
6533
- })
6534
- .catch(() => {
6535
- // Catch any errors in the promise chain to prevent unhandled rejections
6536
- process.exit(code || 1);
6537
- });
6538
6585
  } else {
6539
6586
  logger.success('Command completed successfully');
6540
6587
  logger.info(`Log file: ${logFilePath}`);
@@ -6546,6 +6593,7 @@ const executeRun = async (
6546
6593
  fixDuration: String(fixDuration),
6547
6594
  buildDuration: String(buildDuration),
6548
6595
  exitCode: '0',
6596
+ projectType,
6549
6597
  },
6550
6598
  });
6551
6599
  // flush 由 main 函数统一处理
@@ -6564,65 +6612,21 @@ const executeRun = async (
6564
6612
  const buildDuration = Date.now() - buildStartTime;
6565
6613
 
6566
6614
  // 上报错误
6567
- reportError(error, {
6568
- command: commandName,
6569
- type: 'child_process_error',
6570
- });
6571
- reportCommandComplete(commandName, false, Date.now() - cmdStartTime, {
6572
- args: JSON.stringify(options),
6573
- errorCode: 1,
6574
- errorMessage: error.message,
6615
+ reportFailureAndExit(error, 1, {
6616
+ commandName,
6617
+ cmdStartTime,
6618
+ options,
6575
6619
  categories: {
6576
6620
  fixDuration: String(fixDuration),
6577
6621
  buildDuration: String(buildDuration),
6578
6622
  exitCode: 'error',
6623
+ errorType: 'child_process_error',
6624
+ projectType,
6579
6625
  },
6626
+ errorContext: { type: 'child_process_error', projectType },
6580
6627
  });
6581
- flushSlardar()
6582
- .then(() => {
6583
- process.exit(1);
6584
- })
6585
- .catch(() => {
6586
- // Catch any errors in the promise chain to prevent unhandled rejections
6587
- process.exit(1);
6588
- });
6589
6628
  });
6590
6629
  });
6591
-
6592
- childProcess.on('error', (error) => {
6593
- logger.error('Failed to execute command:');
6594
- logger.error(`Error: ${error.message}`);
6595
- if (error.stack) {
6596
- logger.error(`Stack trace:\n${error.stack}`);
6597
- }
6598
- logStream.end();
6599
-
6600
- const buildDuration = Date.now() - buildStartTime;
6601
-
6602
- // 上报错误
6603
- reportError(error, {
6604
- command: commandName,
6605
- type: 'child_process_error',
6606
- });
6607
- reportCommandComplete(commandName, false, Date.now() - cmdStartTime, {
6608
- args: JSON.stringify(options),
6609
- errorCode: 1,
6610
- errorMessage: error.message,
6611
- categories: {
6612
- fixDuration: String(fixDuration),
6613
- buildDuration: String(buildDuration),
6614
- errorType: 'child_process_error',
6615
- },
6616
- });
6617
- flushSlardar()
6618
- .then(() => {
6619
- process.exit(1);
6620
- })
6621
- .catch(() => {
6622
- // Catch any errors in the promise chain to prevent unhandled rejections
6623
- process.exit(1);
6624
- });
6625
- });
6626
6630
  } catch (error) {
6627
6631
  const err = error instanceof Error ? error : new Error(String(error));
6628
6632
  logger.error(`Failed to run ${commandName} command:`);
@@ -6631,28 +6635,18 @@ const executeRun = async (
6631
6635
  const buildDuration = buildStartTime > 0 ? Date.now() - buildStartTime : 0;
6632
6636
 
6633
6637
  // 上报错误
6634
- reportError(err, {
6635
- command: commandName,
6636
- type: 'execution_error',
6637
- });
6638
- reportCommandComplete(commandName, false, Date.now() - cmdStartTime, {
6639
- args: JSON.stringify(options),
6640
- errorCode: 1,
6641
- errorMessage: err.message,
6638
+ reportFailureAndExit(err, 1, {
6639
+ commandName,
6640
+ cmdStartTime,
6641
+ options,
6642
6642
  categories: {
6643
6643
  fixDuration: String(fixDuration),
6644
6644
  buildDuration: String(buildDuration),
6645
6645
  errorType: 'execution_error',
6646
+ projectType,
6646
6647
  },
6648
+ errorContext: { type: 'execution_error', projectType },
6647
6649
  });
6648
- flushSlardar()
6649
- .then(() => {
6650
- process.exit(1);
6651
- })
6652
- .catch(() => {
6653
- // Catch any errors in the promise chain to prevent unhandled rejections
6654
- process.exit(1);
6655
- });
6656
6650
  }
6657
6651
  };
6658
6652