@next-vibe/checker 1.0.11 → 1.0.13

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 (400) hide show
  1. package/.dist/bin/vibe-runtime.js +26 -22
  2. package/.dist/bin/vibe-runtime.js.map +5 -5
  3. package/.dist/oxlint-plugins/i18n.js +4 -0
  4. package/.dist/oxlint-plugins/i18n.js.map +1 -0
  5. package/.dist/oxlint-plugins/jsx-capitalization.js +4 -0
  6. package/.dist/oxlint-plugins/jsx-capitalization.js.map +1 -0
  7. package/.dist/oxlint-plugins/restricted-syntax.js +4 -0
  8. package/.dist/oxlint-plugins/restricted-syntax.js.map +1 -0
  9. package/check.config.ts +4 -12
  10. package/package.json +2 -9
  11. package/src/app/api/[locale]/LICENSE +674 -0
  12. package/src/app/api/[locale]/i18n/de/index.ts +13 -0
  13. package/src/app/api/[locale]/i18n/en/index.ts +12 -0
  14. package/src/app/api/[locale]/i18n/pl/index.ts +11 -0
  15. package/src/app/api/[locale]/shared/i18n/de/index.ts +85 -0
  16. package/src/app/api/[locale]/shared/i18n/en/index.ts +83 -0
  17. package/src/app/api/[locale]/shared/i18n/pl/index.ts +85 -0
  18. package/src/app/api/[locale]/shared/stats-filtering.ts +202 -0
  19. package/src/app/api/[locale]/shared/types/common.schema.ts +55 -0
  20. package/src/app/api/[locale]/shared/types/response.schema.ts +372 -0
  21. package/src/app/api/[locale]/shared/types/stats-filtering.schema.ts +375 -0
  22. package/src/app/api/[locale]/shared/types/utils.ts +190 -0
  23. package/src/app/api/[locale]/shared/utils/base64.ts +49 -0
  24. package/src/app/api/[locale]/shared/utils/env-util.ts +40 -0
  25. package/src/app/api/[locale]/shared/utils/i18n/de/index.ts +21 -0
  26. package/src/app/api/[locale]/shared/utils/i18n/en/index.ts +19 -0
  27. package/src/app/api/[locale]/shared/utils/i18n/pl/index.ts +21 -0
  28. package/src/app/api/[locale]/shared/utils/index.ts +11 -0
  29. package/src/app/api/[locale]/shared/utils/object-path.ts +41 -0
  30. package/src/app/api/[locale]/shared/utils/object.test.ts +82 -0
  31. package/src/app/api/[locale]/shared/utils/object.ts +75 -0
  32. package/src/app/api/[locale]/shared/utils/parse-error.ts +134 -0
  33. package/src/app/api/[locale]/shared/utils/parse-json.ts +70 -0
  34. package/src/app/api/[locale]/shared/utils/time.ts +53 -0
  35. package/src/app/api/[locale]/shared/utils/validation.ts +127 -0
  36. package/src/app/api/[locale]/shared/utils/zod-required-fields.ts +116 -0
  37. package/src/app/api/[locale]/system/builder/definition.ts +1942 -0
  38. package/src/app/api/[locale]/system/builder/enum.ts +78 -0
  39. package/src/app/api/[locale]/system/builder/i18n/de/index.ts +677 -0
  40. package/src/app/api/[locale]/system/builder/i18n/en/index.ts +665 -0
  41. package/src/app/api/[locale]/system/builder/i18n/pl/index.ts +668 -0
  42. package/src/app/api/[locale]/system/builder/repository/build-executor.test.ts +182 -0
  43. package/src/app/api/[locale]/system/builder/repository/build-executor.ts +583 -0
  44. package/src/app/api/[locale]/system/builder/repository/bun-compiler.ts +261 -0
  45. package/src/app/api/[locale]/system/builder/repository/bundle-analyzer.ts +197 -0
  46. package/src/app/api/[locale]/system/builder/repository/config-loader.ts +159 -0
  47. package/src/app/api/[locale]/system/builder/repository/config-validator.ts +97 -0
  48. package/src/app/api/[locale]/system/builder/repository/constants.ts +125 -0
  49. package/src/app/api/[locale]/system/builder/repository/error-suggester.ts +75 -0
  50. package/src/app/api/[locale]/system/builder/repository/file-copier.ts +98 -0
  51. package/src/app/api/[locale]/system/builder/repository/folder-cleaner.ts +80 -0
  52. package/src/app/api/[locale]/system/builder/repository/index.ts +2 -0
  53. package/src/app/api/[locale]/system/builder/repository/npm-package-generator.ts +146 -0
  54. package/src/app/api/[locale]/system/builder/repository/output-formatter.ts +104 -0
  55. package/src/app/api/[locale]/system/builder/repository/profile-service.ts +79 -0
  56. package/src/app/api/[locale]/system/builder/repository/report-generator.ts +125 -0
  57. package/src/app/api/[locale]/system/builder/repository/vite-compiler.ts +291 -0
  58. package/src/app/api/[locale]/system/builder/route.ts +21 -0
  59. package/src/app/api/[locale]/system/builder/test-files/file1.ts +2 -0
  60. package/src/app/api/[locale]/system/builder/test-files/file2.tsx +10 -0
  61. package/src/app/api/[locale]/system/builder/test-files/file3.tsx +16 -0
  62. package/src/app/api/[locale]/system/builder/test-files/folderToCopy/fileInFolder.ts +2 -0
  63. package/src/app/api/[locale]/system/builder/test-files/test-config.ts +38 -0
  64. package/src/app/api/[locale]/system/builder/test-files/test-delete-config.ts +8 -0
  65. package/src/app/api/[locale]/system/builder/test-files/test-project/package.json +24 -0
  66. package/src/app/api/[locale]/system/builder/test-files/test-project/src/constants.ts +6 -0
  67. package/src/app/api/[locale]/system/builder/test-files/test-project/src/greet.ts +18 -0
  68. package/src/app/api/[locale]/system/builder/test-files/test-project/src/index.ts +7 -0
  69. package/src/app/api/[locale]/system/builder/test-files/test-project/src/utils/calculate.ts +27 -0
  70. package/src/app/api/[locale]/system/builder/test-files/test-project/tsconfig.json +19 -0
  71. package/src/app/api/[locale]/system/builder/test-files/test-project/tsconfig.tsbuildinfo +1 -0
  72. package/src/app/api/[locale]/system/builder/test-files/test3.css +1 -0
  73. package/src/app/api/[locale]/system/check/config/repository.ts +886 -0
  74. package/src/app/api/[locale]/system/check/config/shared.ts +396 -0
  75. package/src/app/api/[locale]/system/check/config/types.ts +616 -0
  76. package/src/app/api/[locale]/system/check/config/utils.ts +171 -0
  77. package/src/app/api/[locale]/system/check/i18n/de/index.ts +15 -0
  78. package/src/app/api/[locale]/system/check/i18n/en/index.ts +14 -0
  79. package/src/app/api/[locale]/system/check/i18n/pl/index.ts +15 -0
  80. package/src/app/api/[locale]/system/check/lint/definition.ts +414 -0
  81. package/src/app/api/[locale]/system/check/lint/enum.ts +37 -0
  82. package/src/app/api/[locale]/system/check/lint/i18n/de/index.ts +164 -0
  83. package/src/app/api/[locale]/system/check/lint/i18n/en/index.ts +162 -0
  84. package/src/app/api/[locale]/system/check/lint/i18n/pl/index.ts +164 -0
  85. package/src/app/api/[locale]/system/check/lint/repository.ts +753 -0
  86. package/src/app/api/[locale]/system/check/lint/route.ts +21 -0
  87. package/src/app/api/[locale]/system/check/oxlint/README.md +190 -0
  88. package/src/app/api/[locale]/system/check/oxlint/definition.ts +414 -0
  89. package/src/app/api/[locale]/system/check/oxlint/enum.ts +37 -0
  90. package/src/app/api/[locale]/system/check/oxlint/i18n/de/index.ts +171 -0
  91. package/src/app/api/[locale]/system/check/oxlint/i18n/en/index.ts +168 -0
  92. package/src/app/api/[locale]/system/check/oxlint/i18n/pl/index.ts +172 -0
  93. package/src/app/api/[locale]/system/check/oxlint/plugins/i18n/src/index.ts +372 -0
  94. package/src/app/api/[locale]/system/check/oxlint/plugins/jsx-capitalization/README.md +246 -0
  95. package/src/app/api/[locale]/system/check/oxlint/plugins/jsx-capitalization/src/index.ts +583 -0
  96. package/src/app/api/[locale]/system/check/oxlint/plugins/restricted-syntax/src/index.ts +500 -0
  97. package/src/app/api/[locale]/system/check/oxlint/plugins/restricted-syntax/test.tsx +74 -0
  98. package/src/app/api/[locale]/system/check/oxlint/plugins/shared/config-loader.ts +305 -0
  99. package/src/app/api/[locale]/system/check/oxlint/repository.ts +959 -0
  100. package/src/app/api/[locale]/system/check/oxlint/route.ts +21 -0
  101. package/src/app/api/[locale]/system/check/oxlint/types.ts +193 -0
  102. package/src/app/api/[locale]/system/check/test-project/bun.lock +532 -0
  103. package/src/app/api/[locale]/system/check/test-project/check.config.ts +981 -0
  104. package/src/app/api/[locale]/system/check/test-project/package.json +12 -0
  105. package/src/app/api/[locale]/system/check/test-project/src/constants.ts +6 -0
  106. package/src/app/api/[locale]/system/check/test-project/src/greet.ts +18 -0
  107. package/src/app/api/[locale]/system/check/test-project/src/test-issues/a11y-issues.tsx +107 -0
  108. package/src/app/api/[locale]/system/check/test-project/src/test-issues/eslint-issues.tsx +37 -0
  109. package/src/app/api/[locale]/system/check/test-project/src/test-issues/general-issues.ts +137 -0
  110. package/src/app/api/[locale]/system/check/test-project/src/test-issues/i18n-issues.tsx +129 -0
  111. package/src/app/api/[locale]/system/check/test-project/src/test-issues/jsx-capitalization-issues.tsx +131 -0
  112. package/src/app/api/[locale]/system/check/test-project/src/test-issues/nextjs-issues.tsx +95 -0
  113. package/src/app/api/[locale]/system/check/test-project/src/test-issues/promise-issues.ts +76 -0
  114. package/src/app/api/[locale]/system/check/test-project/src/test-issues/react-issues.tsx +95 -0
  115. package/src/app/api/[locale]/system/check/test-project/src/test-issues/restricted-syntax-issues.tsx +61 -0
  116. package/src/app/api/[locale]/system/check/test-project/src/test-issues/typescript-issues.ts +80 -0
  117. package/src/app/api/[locale]/system/check/test-project/src/utils/calculate.ts +27 -0
  118. package/src/app/api/[locale]/system/check/test-project/tsconfig.json +34 -0
  119. package/src/app/api/[locale]/system/check/test-project/tsconfig.tsbuildinfo +1 -0
  120. package/src/app/api/[locale]/system/check/typecheck/definition.ts +369 -0
  121. package/src/app/api/[locale]/system/check/typecheck/enum.ts +37 -0
  122. package/src/app/api/[locale]/system/check/typecheck/i18n/de/index.ts +159 -0
  123. package/src/app/api/[locale]/system/check/typecheck/i18n/en/index.ts +150 -0
  124. package/src/app/api/[locale]/system/check/typecheck/i18n/pl/index.ts +155 -0
  125. package/src/app/api/[locale]/system/check/typecheck/repository.ts +919 -0
  126. package/src/app/api/[locale]/system/check/typecheck/route.ts +22 -0
  127. package/src/app/api/[locale]/system/check/typecheck/utils.ts +168 -0
  128. package/src/app/api/[locale]/system/check/vibe-check/definition.ts +568 -0
  129. package/src/app/api/[locale]/system/check/vibe-check/enum.ts +69 -0
  130. package/src/app/api/[locale]/system/check/vibe-check/i18n/de/index.ts +192 -0
  131. package/src/app/api/[locale]/system/check/vibe-check/i18n/en/index.ts +189 -0
  132. package/src/app/api/[locale]/system/check/vibe-check/i18n/pl/index.ts +192 -0
  133. package/src/app/api/[locale]/system/check/vibe-check/repository.ts +545 -0
  134. package/src/app/api/[locale]/system/check/vibe-check/route.test.ts +1142 -0
  135. package/src/app/api/[locale]/system/check/vibe-check/route.ts +21 -0
  136. package/src/app/api/[locale]/system/generated/endpoint.ts +313 -0
  137. package/src/app/api/[locale]/system/generated/endpoints.ts +156 -0
  138. package/src/app/api/[locale]/system/generated/route-handlers.ts +224 -0
  139. package/src/app/api/[locale]/system/generators/endpoint/definition.ts +193 -0
  140. package/src/app/api/[locale]/system/generators/endpoint/i18n/de/index.ts +48 -0
  141. package/src/app/api/[locale]/system/generators/endpoint/i18n/en/index.ts +48 -0
  142. package/src/app/api/[locale]/system/generators/endpoint/i18n/pl/index.ts +50 -0
  143. package/src/app/api/[locale]/system/generators/endpoint/repository.ts +291 -0
  144. package/src/app/api/[locale]/system/generators/endpoint/route.ts +21 -0
  145. package/src/app/api/[locale]/system/generators/endpoints/definition.ts +246 -0
  146. package/src/app/api/[locale]/system/generators/endpoints/i18n/de/index.ts +54 -0
  147. package/src/app/api/[locale]/system/generators/endpoints/i18n/en/index.ts +52 -0
  148. package/src/app/api/[locale]/system/generators/endpoints/i18n/pl/index.ts +54 -0
  149. package/src/app/api/[locale]/system/generators/endpoints/options-repository.ts +463 -0
  150. package/src/app/api/[locale]/system/generators/endpoints/repository.ts +383 -0
  151. package/src/app/api/[locale]/system/generators/endpoints/route.ts +18 -0
  152. package/src/app/api/[locale]/system/generators/endpoints-index/definition.ts +194 -0
  153. package/src/app/api/[locale]/system/generators/endpoints-index/i18n/de/index.ts +71 -0
  154. package/src/app/api/[locale]/system/generators/endpoints-index/i18n/en/index.ts +69 -0
  155. package/src/app/api/[locale]/system/generators/endpoints-index/i18n/pl/index.ts +71 -0
  156. package/src/app/api/[locale]/system/generators/endpoints-index/repository.ts +294 -0
  157. package/src/app/api/[locale]/system/generators/endpoints-index/route.ts +18 -0
  158. package/src/app/api/[locale]/system/generators/generate-all/definition.ts +355 -0
  159. package/src/app/api/[locale]/system/generators/generate-all/i18n/de/index.ts +96 -0
  160. package/src/app/api/[locale]/system/generators/generate-all/i18n/en/index.ts +94 -0
  161. package/src/app/api/[locale]/system/generators/generate-all/i18n/pl/index.ts +96 -0
  162. package/src/app/api/[locale]/system/generators/generate-all/repository.ts +257 -0
  163. package/src/app/api/[locale]/system/generators/generate-all/route.ts +20 -0
  164. package/src/app/api/[locale]/system/generators/i18n/de/index.ts +15 -0
  165. package/src/app/api/[locale]/system/generators/i18n/en/index.ts +14 -0
  166. package/src/app/api/[locale]/system/generators/i18n/pl/index.ts +15 -0
  167. package/src/app/api/[locale]/system/generators/route-handlers/definition.ts +198 -0
  168. package/src/app/api/[locale]/system/generators/route-handlers/i18n/de/index.ts +48 -0
  169. package/src/app/api/[locale]/system/generators/route-handlers/i18n/en/index.ts +48 -0
  170. package/src/app/api/[locale]/system/generators/route-handlers/i18n/pl/index.ts +50 -0
  171. package/src/app/api/[locale]/system/generators/route-handlers/repository.ts +277 -0
  172. package/src/app/api/[locale]/system/generators/route-handlers/route.ts +17 -0
  173. package/src/app/api/[locale]/system/generators/shared/utils.ts +233 -0
  174. package/src/app/api/[locale]/system/help/definition.ts +445 -0
  175. package/src/app/api/[locale]/system/help/i18n/de/index.ts +267 -0
  176. package/src/app/api/[locale]/system/help/i18n/en/index.ts +262 -0
  177. package/src/app/api/[locale]/system/help/i18n/pl/index.ts +265 -0
  178. package/src/app/api/[locale]/system/help/interactive/definition.ts +125 -0
  179. package/src/app/api/[locale]/system/help/interactive/i18n/de/index.ts +22 -0
  180. package/src/app/api/[locale]/system/help/interactive/i18n/en/index.ts +19 -0
  181. package/src/app/api/[locale]/system/help/interactive/i18n/pl/index.ts +22 -0
  182. package/src/app/api/[locale]/system/help/interactive/repository.ts +1025 -0
  183. package/src/app/api/[locale]/system/help/interactive/route.ts +53 -0
  184. package/src/app/api/[locale]/system/help/list/definition.ts +372 -0
  185. package/src/app/api/[locale]/system/help/list/repository.ts +110 -0
  186. package/src/app/api/[locale]/system/help/list/route.ts +21 -0
  187. package/src/app/api/[locale]/system/help/repository.ts +212 -0
  188. package/src/app/api/[locale]/system/help/route.ts +16 -0
  189. package/src/app/api/[locale]/system/i18n/de/index.ts +68 -0
  190. package/src/app/api/[locale]/system/i18n/en/index.ts +65 -0
  191. package/src/app/api/[locale]/system/i18n/pl/index.ts +66 -0
  192. package/src/app/api/[locale]/system/release-tool/definition.ts +3104 -0
  193. package/src/app/api/[locale]/system/release-tool/i18n/de/index.ts +813 -0
  194. package/src/app/api/[locale]/system/release-tool/i18n/en/index.ts +797 -0
  195. package/src/app/api/[locale]/system/release-tool/i18n/pl/index.ts +810 -0
  196. package/src/app/api/[locale]/system/release-tool/repository/asset-zipper.ts +128 -0
  197. package/src/app/api/[locale]/system/release-tool/repository/changelog-generator.ts +212 -0
  198. package/src/app/api/[locale]/system/release-tool/repository/ci-detector.ts +566 -0
  199. package/src/app/api/[locale]/system/release-tool/repository/config.ts +113 -0
  200. package/src/app/api/[locale]/system/release-tool/repository/constants.ts +407 -0
  201. package/src/app/api/[locale]/system/release-tool/repository/dependency-manager.ts +527 -0
  202. package/src/app/api/[locale]/system/release-tool/repository/git-service.ts +403 -0
  203. package/src/app/api/[locale]/system/release-tool/repository/hook-runner.ts +100 -0
  204. package/src/app/api/[locale]/system/release-tool/repository/index.ts +1 -0
  205. package/src/app/api/[locale]/system/release-tool/repository/notification-service.ts +638 -0
  206. package/src/app/api/[locale]/system/release-tool/repository/package-service.ts +169 -0
  207. package/src/app/api/[locale]/system/release-tool/repository/publisher.ts +253 -0
  208. package/src/app/api/[locale]/system/release-tool/repository/quality-runner.ts +428 -0
  209. package/src/app/api/[locale]/system/release-tool/repository/release-creator.ts +293 -0
  210. package/src/app/api/[locale]/system/release-tool/repository/release-executor.ts +1198 -0
  211. package/src/app/api/[locale]/system/release-tool/repository/snyk-service.ts +136 -0
  212. package/src/app/api/[locale]/system/release-tool/repository/utils.ts +642 -0
  213. package/src/app/api/[locale]/system/release-tool/repository/validation.ts +288 -0
  214. package/src/app/api/[locale]/system/release-tool/repository/version-service.ts +297 -0
  215. package/src/app/api/[locale]/system/release-tool/route.ts +21 -0
  216. package/src/app/api/[locale]/system/unified-interface/README.md +328 -0
  217. package/src/app/api/[locale]/system/unified-interface/cli/README.md +349 -0
  218. package/src/app/api/[locale]/system/unified-interface/cli/auth/cli-handler.ts +95 -0
  219. package/src/app/api/[locale]/system/unified-interface/cli/auth/cli-user.ts +146 -0
  220. package/src/app/api/[locale]/system/unified-interface/cli/auth/session-file.ts +266 -0
  221. package/src/app/api/[locale]/system/unified-interface/cli/env.ts +26 -0
  222. package/src/app/api/[locale]/system/unified-interface/cli/i18n/de/index.ts +157 -0
  223. package/src/app/api/[locale]/system/unified-interface/cli/i18n/en/index.ts +155 -0
  224. package/src/app/api/[locale]/system/unified-interface/cli/i18n/pl/index.ts +158 -0
  225. package/src/app/api/[locale]/system/unified-interface/cli/runtime/debug.ts +595 -0
  226. package/src/app/api/[locale]/system/unified-interface/cli/runtime/entry-point.ts +129 -0
  227. package/src/app/api/[locale]/system/unified-interface/cli/runtime/environment.ts +155 -0
  228. package/src/app/api/[locale]/system/unified-interface/cli/runtime/execution-errors.ts +452 -0
  229. package/src/app/api/[locale]/system/unified-interface/cli/runtime/parsing.ts +297 -0
  230. package/src/app/api/[locale]/system/unified-interface/cli/runtime/route-executor.ts +859 -0
  231. package/src/app/api/[locale]/system/unified-interface/cli/setup/i18n/de/index.ts +12 -0
  232. package/src/app/api/[locale]/system/unified-interface/cli/setup/i18n/en/index.ts +11 -0
  233. package/src/app/api/[locale]/system/unified-interface/cli/setup/i18n/pl/index.ts +12 -0
  234. package/src/app/api/[locale]/system/unified-interface/cli/setup/install/definition.ts +262 -0
  235. package/src/app/api/[locale]/system/unified-interface/cli/setup/install/i18n/de/index.ts +54 -0
  236. package/src/app/api/[locale]/system/unified-interface/cli/setup/install/i18n/en/index.ts +52 -0
  237. package/src/app/api/[locale]/system/unified-interface/cli/setup/install/i18n/pl/index.ts +54 -0
  238. package/src/app/api/[locale]/system/unified-interface/cli/setup/install/repository.ts +421 -0
  239. package/src/app/api/[locale]/system/unified-interface/cli/setup/install/route.ts +25 -0
  240. package/src/app/api/[locale]/system/unified-interface/cli/setup/status/definition.ts +181 -0
  241. package/src/app/api/[locale]/system/unified-interface/cli/setup/status/i18n/de/index.ts +61 -0
  242. package/src/app/api/[locale]/system/unified-interface/cli/setup/status/i18n/en/index.ts +59 -0
  243. package/src/app/api/[locale]/system/unified-interface/cli/setup/status/i18n/pl/index.ts +61 -0
  244. package/src/app/api/[locale]/system/unified-interface/cli/setup/status/repository.ts +195 -0
  245. package/src/app/api/[locale]/system/unified-interface/cli/setup/status/route.ts +22 -0
  246. package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/definition.ts +188 -0
  247. package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/i18n/de/index.ts +54 -0
  248. package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/i18n/en/index.ts +52 -0
  249. package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/i18n/pl/index.ts +54 -0
  250. package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/repository.ts +209 -0
  251. package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/route.ts +24 -0
  252. package/src/app/api/[locale]/system/unified-interface/cli/setup/update/definition.ts +200 -0
  253. package/src/app/api/[locale]/system/unified-interface/cli/setup/update/i18n/de/index.ts +54 -0
  254. package/src/app/api/[locale]/system/unified-interface/cli/setup/update/i18n/en/index.ts +52 -0
  255. package/src/app/api/[locale]/system/unified-interface/cli/setup/update/i18n/pl/index.ts +54 -0
  256. package/src/app/api/[locale]/system/unified-interface/cli/setup/update/repository.ts +113 -0
  257. package/src/app/api/[locale]/system/unified-interface/cli/setup/update/route.ts +22 -0
  258. package/src/app/api/[locale]/system/unified-interface/cli/vibe-runtime.ts +304 -0
  259. package/src/app/api/[locale]/system/unified-interface/cli/widgets/core/base-renderer.ts +270 -0
  260. package/src/app/api/[locale]/system/unified-interface/cli/widgets/core/registry.ts +309 -0
  261. package/src/app/api/[locale]/system/unified-interface/cli/widgets/core/types.ts +126 -0
  262. package/src/app/api/[locale]/system/unified-interface/cli/widgets/i18n/de/index.ts +67 -0
  263. package/src/app/api/[locale]/system/unified-interface/cli/widgets/i18n/en/index.ts +65 -0
  264. package/src/app/api/[locale]/system/unified-interface/cli/widgets/i18n/pl/index.ts +67 -0
  265. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/accordion.ts +74 -0
  266. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/avatar.ts +39 -0
  267. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/badge.ts +54 -0
  268. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-output.ts +298 -0
  269. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-quality-files.ts +89 -0
  270. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-quality-list.ts +298 -0
  271. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-quality-summary.ts +96 -0
  272. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/container.ts +186 -0
  273. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-card.ts +65 -0
  274. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-cards.ts +570 -0
  275. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-list.ts +80 -0
  276. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-table.ts +385 -0
  277. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/editable-text.ts +99 -0
  278. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/empty-state.ts +55 -0
  279. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/errors.ts +67 -0
  280. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/grouped-list.ts +729 -0
  281. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/link-card.ts +87 -0
  282. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/link-list.ts +112 -0
  283. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/link.ts +59 -0
  284. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/loading.ts +50 -0
  285. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/markdown.ts +131 -0
  286. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/metric.ts +291 -0
  287. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/section.ts +120 -0
  288. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/stats-grid.ts +149 -0
  289. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/tabs.ts +61 -0
  290. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/text.ts +78 -0
  291. package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/title.ts +42 -0
  292. package/src/app/api/[locale]/system/unified-interface/cli/widgets/renderers/response-renderer.ts +418 -0
  293. package/src/app/api/[locale]/system/unified-interface/cli/widgets/renderers/schema-handler.ts +534 -0
  294. package/src/app/api/[locale]/system/unified-interface/i18n/de/index.ts +42 -0
  295. package/src/app/api/[locale]/system/unified-interface/i18n/en/index.ts +40 -0
  296. package/src/app/api/[locale]/system/unified-interface/i18n/pl/index.ts +43 -0
  297. package/src/app/api/[locale]/system/unified-interface/mcp/README.md +114 -0
  298. package/src/app/api/[locale]/system/unified-interface/mcp/converter.ts +146 -0
  299. package/src/app/api/[locale]/system/unified-interface/mcp/i18n/de/index.ts +182 -0
  300. package/src/app/api/[locale]/system/unified-interface/mcp/i18n/en/index.ts +179 -0
  301. package/src/app/api/[locale]/system/unified-interface/mcp/i18n/pl/index.ts +181 -0
  302. package/src/app/api/[locale]/system/unified-interface/mcp/registry.ts +343 -0
  303. package/src/app/api/[locale]/system/unified-interface/mcp/serve/definition.ts +147 -0
  304. package/src/app/api/[locale]/system/unified-interface/mcp/serve/repository.ts +38 -0
  305. package/src/app/api/[locale]/system/unified-interface/mcp/serve/route.ts +14 -0
  306. package/src/app/api/[locale]/system/unified-interface/mcp/server/protocol-handler.ts +309 -0
  307. package/src/app/api/[locale]/system/unified-interface/mcp/server/server.ts +154 -0
  308. package/src/app/api/[locale]/system/unified-interface/mcp/server/stdio-transport.ts +193 -0
  309. package/src/app/api/[locale]/system/unified-interface/mcp/types.ts +246 -0
  310. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/create-form.ts +1510 -0
  311. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/create.ts +581 -0
  312. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/endpoint-to-metadata.ts +52 -0
  313. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/loader.ts +152 -0
  314. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definitions/registry.ts +265 -0
  315. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/permissions/registry.ts +680 -0
  316. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/executor.ts +220 -0
  317. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/handler.ts +325 -0
  318. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/multi.ts +184 -0
  319. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/request-validator.ts +201 -0
  320. package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/single.ts +58 -0
  321. package/src/app/api/[locale]/system/unified-interface/shared/env/define-env-client.ts +49 -0
  322. package/src/app/api/[locale]/system/unified-interface/shared/env/define-env.ts +47 -0
  323. package/src/app/api/[locale]/system/unified-interface/shared/env/validation-logger.ts +58 -0
  324. package/src/app/api/[locale]/system/unified-interface/shared/field/enum.ts +110 -0
  325. package/src/app/api/[locale]/system/unified-interface/shared/field/specialized.ts +339 -0
  326. package/src/app/api/[locale]/system/unified-interface/shared/field/utils.test.ts +408 -0
  327. package/src/app/api/[locale]/system/unified-interface/shared/field/utils.ts +1349 -0
  328. package/src/app/api/[locale]/system/unified-interface/shared/field-config/endpoint-field-types.ts +107 -0
  329. package/src/app/api/[locale]/system/unified-interface/shared/field-config/field-config-types.ts +268 -0
  330. package/src/app/api/[locale]/system/unified-interface/shared/logger/colors.ts +114 -0
  331. package/src/app/api/[locale]/system/unified-interface/shared/logger/endpoint.ts +169 -0
  332. package/src/app/api/[locale]/system/unified-interface/shared/logger/file-logger.ts +88 -0
  333. package/src/app/api/[locale]/system/unified-interface/shared/logger/formatters.ts +177 -0
  334. package/src/app/api/[locale]/system/unified-interface/shared/server-only/auth/base-auth-handler.ts +82 -0
  335. package/src/app/api/[locale]/system/unified-interface/shared/server-only/auth/factory.ts +33 -0
  336. package/src/app/api/[locale]/system/unified-interface/shared/server-only/server-only.ts +4 -0
  337. package/src/app/api/[locale]/system/unified-interface/shared/types/actions.ts +289 -0
  338. package/src/app/api/[locale]/system/unified-interface/shared/types/endpoint.ts +1167 -0
  339. package/src/app/api/[locale]/system/unified-interface/shared/types/enums.ts +382 -0
  340. package/src/app/api/[locale]/system/unified-interface/shared/types/platform.ts +34 -0
  341. package/src/app/api/[locale]/system/unified-interface/shared/types/types.ts +80 -0
  342. package/src/app/api/[locale]/system/unified-interface/shared/types/ui-config.ts +76 -0
  343. package/src/app/api/[locale]/system/unified-interface/shared/utils/error-types.ts +27 -0
  344. package/src/app/api/[locale]/system/unified-interface/shared/utils/path.ts +63 -0
  345. package/src/app/api/[locale]/system/unified-interface/shared/utils/scanner.ts +241 -0
  346. package/src/app/api/[locale]/system/unified-interface/shared/widgets/actions.ts +256 -0
  347. package/src/app/api/[locale]/system/unified-interface/shared/widgets/configs.ts +1158 -0
  348. package/src/app/api/[locale]/system/unified-interface/shared/widgets/helpers.ts +80 -0
  349. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/accordion.ts +82 -0
  350. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/avatar.ts +75 -0
  351. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/badge.ts +89 -0
  352. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/code-output.ts +302 -0
  353. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/code-quality-list.ts +202 -0
  354. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/container.ts +129 -0
  355. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-card.ts +81 -0
  356. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-cards.ts +258 -0
  357. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-list.ts +123 -0
  358. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-table.ts +387 -0
  359. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/editable-text.ts +89 -0
  360. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/empty-state.ts +78 -0
  361. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/errors.ts +93 -0
  362. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/grouped-list.ts +448 -0
  363. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/index.ts +38 -0
  364. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/link-card.ts +130 -0
  365. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/link-list.ts +127 -0
  366. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/link.ts +68 -0
  367. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/loading.ts +81 -0
  368. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/markdown.ts +176 -0
  369. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/metric-card.ts +241 -0
  370. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/section.ts +90 -0
  371. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/stats-grid.ts +71 -0
  372. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/tabs.ts +80 -0
  373. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/text.ts +105 -0
  374. package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/title.ts +72 -0
  375. package/src/app/api/[locale]/system/unified-interface/shared/widgets/types.ts +240 -0
  376. package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/field-helpers.ts +137 -0
  377. package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/formatting.ts +437 -0
  378. package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/url.ts +40 -0
  379. package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/widget-helpers.ts +465 -0
  380. package/src/app/api/[locale]/user/auth/enum.ts +16 -0
  381. package/src/app/api/[locale]/user/auth/i18n/de/index.ts +227 -0
  382. package/src/app/api/[locale]/user/auth/i18n/en/index.ts +205 -0
  383. package/src/app/api/[locale]/user/auth/i18n/pl/index.ts +219 -0
  384. package/src/app/api/[locale]/user/auth/types.ts +110 -0
  385. package/src/app/api/[locale]/user/enum.ts +64 -0
  386. package/src/app/api/[locale]/user/private/i18n/de/index.ts +3 -0
  387. package/src/app/api/[locale]/user/private/i18n/en/index.ts +1 -0
  388. package/src/app/api/[locale]/user/private/i18n/pl/index.ts +3 -0
  389. package/src/app/api/[locale]/user/types.ts +118 -0
  390. package/src/app/api/[locale]/user/user-roles/enum.ts +112 -0
  391. package/src/app/api/[locale]/user/user-roles/i18n/de/index.ts +85 -0
  392. package/src/app/api/[locale]/user/user-roles/i18n/en/index.ts +83 -0
  393. package/src/app/api/[locale]/user/user-roles/i18n/pl/index.ts +86 -0
  394. package/src/app/api/[locale]/user/user-roles/types.ts +34 -0
  395. package/src/app/api/i18n/de/index.ts +6 -0
  396. package/src/app/api/i18n/en/index.ts +5 -0
  397. package/src/app/api/i18n/pl/index.ts +5 -0
  398. package/src/app/i18n/de/index.ts +6 -0
  399. package/src/app/i18n/en/index.ts +5 -0
  400. package/src/app/i18n/pl/index.ts +5 -0
@@ -0,0 +1,1942 @@
1
+ /**
2
+ * Builder Endpoint Definition
3
+ * Single source of truth for all builder types and configuration
4
+ *
5
+ * This definition supports:
6
+ * - Vite builds: react-tailwind, react, vanilla
7
+ * - Bun builds: executable
8
+ */
9
+
10
+ import { z } from "zod";
11
+
12
+ import { createEndpoint } from "@/app/api/[locale]/system/unified-interface/shared/endpoints/definition/create";
13
+ import { createEnumOptions } from "@/app/api/[locale]/system/unified-interface/shared/field/enum";
14
+ import {
15
+ objectField,
16
+ objectOptionalField,
17
+ requestDataArrayOptionalField,
18
+ requestDataField,
19
+ responseArrayOptionalField,
20
+ responseField,
21
+ } from "@/app/api/[locale]/system/unified-interface/shared/field/utils";
22
+ import {
23
+ EndpointErrorTypes,
24
+ FieldDataType,
25
+ LayoutType,
26
+ Methods,
27
+ WidgetType,
28
+ } from "@/app/api/[locale]/system/unified-interface/shared/types/enums";
29
+ import { UserRole } from "@/app/api/[locale]/user/user-roles/enum";
30
+
31
+ import {
32
+ BuildProfileEnum,
33
+ BunBuildTypeEnum,
34
+ BunTargetEnum,
35
+ OutputFormatEnum,
36
+ SourcemapModeEnum,
37
+ StepStatusEnum,
38
+ ViteBuildTypeEnum,
39
+ ViteLibFormatEnum,
40
+ } from "./enum";
41
+
42
+ // ============================================================================
43
+ // Enum Options for UI - Created with createEnumOptions
44
+ // ============================================================================
45
+
46
+ export const { options: BuildProfileOptions } = createEnumOptions({
47
+ DEVELOPMENT: "app.api.system.builder.enums.profile.development",
48
+ PRODUCTION: "app.api.system.builder.enums.profile.production",
49
+ } as const);
50
+
51
+ export const { options: BuildTypeOptions } = createEnumOptions({
52
+ REACT_TAILWIND: "app.api.system.builder.enums.buildType.reactTailwind",
53
+ REACT: "app.api.system.builder.enums.buildType.react",
54
+ VANILLA: "app.api.system.builder.enums.buildType.vanilla",
55
+ EXECUTABLE: "app.api.system.builder.enums.buildType.executable",
56
+ } as const);
57
+
58
+ export const { options: BunTargetOptions } = createEnumOptions({
59
+ BUN: "app.api.system.builder.enums.bunTarget.bun",
60
+ NODE: "app.api.system.builder.enums.bunTarget.node",
61
+ BROWSER: "app.api.system.builder.enums.bunTarget.browser",
62
+ } as const);
63
+
64
+ export const { options: SourcemapModeOptions } = createEnumOptions({
65
+ EXTERNAL: "app.api.system.builder.enums.sourcemap.external",
66
+ INLINE: "app.api.system.builder.enums.sourcemap.inline",
67
+ NONE: "app.api.system.builder.enums.sourcemap.none",
68
+ } as const);
69
+
70
+ export const { options: OutputFormatOptions } = createEnumOptions({
71
+ ESM: "app.api.system.builder.enums.format.esm",
72
+ CJS: "app.api.system.builder.enums.format.cjs",
73
+ IIFE: "app.api.system.builder.enums.format.iife",
74
+ } as const);
75
+
76
+ export const { options: ViteMinifyOptions } = createEnumOptions({
77
+ ESBUILD: "app.api.system.builder.enums.viteMinify.esbuild",
78
+ TERSER: "app.api.system.builder.enums.viteMinify.terser",
79
+ FALSE: "app.api.system.builder.enums.viteMinify.false",
80
+ } as const);
81
+
82
+ export const { options: ViteLibFormatOptions } = createEnumOptions({
83
+ ES: "app.api.system.builder.enums.viteLibFormat.es",
84
+ CJS: "app.api.system.builder.enums.viteLibFormat.cjs",
85
+ UMD: "app.api.system.builder.enums.viteLibFormat.umd",
86
+ IIFE: "app.api.system.builder.enums.viteLibFormat.iife",
87
+ } as const);
88
+
89
+ // ============================================================================
90
+ // Complex Type Schemas
91
+ // ============================================================================
92
+
93
+ /**
94
+ * Package.json exports field schema
95
+ * Supports: string path, conditional exports, or nested export maps
96
+ * @example { ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" } }
97
+ */
98
+ export type PackageExportCondition =
99
+ | string
100
+ | { [key: string]: string | PackageExportCondition };
101
+ const PackageExportConditionSchema: z.ZodType<PackageExportCondition> = z.lazy(
102
+ () =>
103
+ z.union([
104
+ z.string(),
105
+ z.record(z.string(), z.union([z.string(), PackageExportConditionSchema])),
106
+ ]),
107
+ );
108
+
109
+ // ============================================================================
110
+ // Endpoint Definition
111
+ // ============================================================================
112
+
113
+ const { POST } = createEndpoint({
114
+ method: Methods.POST,
115
+ path: ["system", "builder"],
116
+ title: "app.api.system.builder.post.title",
117
+ description: "app.api.system.builder.post.description",
118
+ category: "app.api.system.server.category",
119
+ tags: [
120
+ "app.api.system.builder.tags.build",
121
+ "app.api.system.builder.tags.npm",
122
+ "app.api.system.builder.tags.vite",
123
+ ],
124
+ icon: "package",
125
+ allowedRoles: [
126
+ UserRole.ADMIN,
127
+ UserRole.AI_TOOL_OFF,
128
+ UserRole.MCP_OFF,
129
+ UserRole.WEB_OFF,
130
+ UserRole.CLI_AUTH_BYPASS,
131
+ ],
132
+ aliases: ["builder", "package", "bundle", "build"],
133
+
134
+ fields: objectField(
135
+ {
136
+ type: WidgetType.CONTAINER,
137
+ title: "app.api.system.builder.post.form.title",
138
+ description: "app.api.system.builder.post.form.description",
139
+ layoutType: LayoutType.GRID,
140
+ columns: 12,
141
+ },
142
+ { request: "data", response: true },
143
+ {
144
+ // ========================================================================
145
+ // CONFIG FILE PATH
146
+ // ========================================================================
147
+ configPath: requestDataField(
148
+ {
149
+ type: WidgetType.FORM_FIELD,
150
+ fieldType: FieldDataType.TEXT,
151
+ label: "app.api.system.builder.post.fields.configPath.title",
152
+ description:
153
+ "app.api.system.builder.post.fields.configPath.description",
154
+ placeholder:
155
+ "app.api.system.builder.post.fields.configPath.placeholder",
156
+ icon: "file-code",
157
+ colSpan: 12,
158
+ },
159
+ z.string().optional().default("build.config.ts"),
160
+ ),
161
+
162
+ // ========================================================================
163
+ // CONFIG OBJECT - Full inline build configuration
164
+ // ========================================================================
165
+ configObject: objectOptionalField(
166
+ {
167
+ type: WidgetType.ACCORDION,
168
+ title: "app.api.system.builder.post.fields.configObject.title",
169
+ description:
170
+ "app.api.system.builder.post.fields.configObject.description",
171
+ layoutType: LayoutType.GRID,
172
+ columns: 12,
173
+ optional: true,
174
+ icon: "settings",
175
+ defaultExpanded: true,
176
+ },
177
+ { request: "data" },
178
+ {
179
+ // ==================================================================
180
+ // RUNTIME OPTIONS SECTION
181
+ // ==================================================================
182
+ profile: requestDataField(
183
+ {
184
+ type: WidgetType.FORM_FIELD,
185
+ fieldType: FieldDataType.SELECT,
186
+ label: "app.api.system.builder.post.fields.profile.title",
187
+ description:
188
+ "app.api.system.builder.post.fields.profile.description",
189
+ options: BuildProfileOptions,
190
+ optional: true,
191
+ icon: "layers",
192
+ colSpan: 4,
193
+ },
194
+ z.enum(BuildProfileEnum).optional(),
195
+ ),
196
+
197
+ dryRun: requestDataField(
198
+ {
199
+ type: WidgetType.FORM_FIELD,
200
+ fieldType: FieldDataType.BOOLEAN,
201
+ label: "app.api.system.builder.post.fields.dryRun.title",
202
+ description:
203
+ "app.api.system.builder.post.fields.dryRun.description",
204
+ optional: true,
205
+ icon: "eye",
206
+ colSpan: 4,
207
+ },
208
+ z.boolean().optional(),
209
+ ),
210
+
211
+ verbose: requestDataField(
212
+ {
213
+ type: WidgetType.FORM_FIELD,
214
+ fieldType: FieldDataType.BOOLEAN,
215
+ label: "app.api.system.builder.post.fields.verbose.title",
216
+ description:
217
+ "app.api.system.builder.post.fields.verbose.description",
218
+ optional: true,
219
+ icon: "terminal",
220
+ colSpan: 4,
221
+ },
222
+ z.boolean().optional(),
223
+ ),
224
+
225
+ analyze: requestDataField(
226
+ {
227
+ type: WidgetType.FORM_FIELD,
228
+ fieldType: FieldDataType.BOOLEAN,
229
+ label: "app.api.system.builder.post.fields.analyze.title",
230
+ description:
231
+ "app.api.system.builder.post.fields.analyze.description",
232
+ optional: true,
233
+ icon: "bar-chart-2",
234
+ colSpan: 3,
235
+ },
236
+ z.boolean().optional(),
237
+ ),
238
+
239
+ watch: requestDataField(
240
+ {
241
+ type: WidgetType.FORM_FIELD,
242
+ fieldType: FieldDataType.BOOLEAN,
243
+ label: "app.api.system.builder.post.fields.watch.title",
244
+ description:
245
+ "app.api.system.builder.post.fields.watch.description",
246
+ optional: true,
247
+ icon: "refresh-cw",
248
+ colSpan: 3,
249
+ },
250
+ z.boolean().optional(),
251
+ ),
252
+
253
+ parallel: requestDataField(
254
+ {
255
+ type: WidgetType.FORM_FIELD,
256
+ fieldType: FieldDataType.BOOLEAN,
257
+ label: "app.api.system.builder.post.fields.parallel.title",
258
+ description:
259
+ "app.api.system.builder.post.fields.parallel.description",
260
+ optional: true,
261
+ icon: "git-branch",
262
+ colSpan: 3,
263
+ },
264
+ z.boolean().optional(),
265
+ ),
266
+
267
+ report: requestDataField(
268
+ {
269
+ type: WidgetType.FORM_FIELD,
270
+ fieldType: FieldDataType.BOOLEAN,
271
+ label: "app.api.system.builder.post.fields.report.title",
272
+ description:
273
+ "app.api.system.builder.post.fields.report.description",
274
+ optional: true,
275
+ icon: "file-text",
276
+ colSpan: 3,
277
+ },
278
+ z.boolean().optional(),
279
+ ),
280
+
281
+ minify: requestDataField(
282
+ {
283
+ type: WidgetType.FORM_FIELD,
284
+ fieldType: FieldDataType.BOOLEAN,
285
+ label: "app.api.system.builder.post.fields.minify.title",
286
+ description:
287
+ "app.api.system.builder.post.fields.minify.description",
288
+ optional: true,
289
+ icon: "minimize-2",
290
+ colSpan: 3,
291
+ },
292
+ z.boolean().optional(),
293
+ ),
294
+
295
+ // ==================================================================
296
+ // FOLDERS TO CLEAN
297
+ // ==================================================================
298
+ foldersToClean: requestDataField(
299
+ {
300
+ type: WidgetType.FORM_FIELD,
301
+ fieldType: FieldDataType.TAGS,
302
+ label: "app.api.system.builder.post.fields.foldersToClean.title",
303
+ description:
304
+ "app.api.system.builder.post.fields.foldersToClean.description",
305
+ placeholder:
306
+ "app.api.system.builder.post.fields.foldersToClean.placeholder",
307
+ optional: true,
308
+ icon: "trash-2",
309
+ colSpan: 12,
310
+ },
311
+ z.array(z.string()).optional(),
312
+ ),
313
+
314
+ // ==================================================================
315
+ // FILES TO COMPILE
316
+ // ==================================================================
317
+ filesToCompile: requestDataArrayOptionalField(
318
+ {
319
+ type: WidgetType.CONTAINER,
320
+ title: "app.api.system.builder.post.fields.filesToCompile.title",
321
+ description:
322
+ "app.api.system.builder.post.fields.filesToCompile.description",
323
+ layoutType: LayoutType.GRID,
324
+ columns: 12,
325
+ optional: true,
326
+ icon: "code",
327
+ },
328
+ objectField(
329
+ {
330
+ type: WidgetType.DATA_CARD,
331
+ title: "app.api.system.builder.post.fields.fileToCompile.title",
332
+ layoutType: LayoutType.GRID,
333
+ columns: 12,
334
+ icon: "file",
335
+ },
336
+ { request: "data" },
337
+ {
338
+ input: requestDataField(
339
+ {
340
+ type: WidgetType.FORM_FIELD,
341
+ fieldType: FieldDataType.TEXT,
342
+ label: "app.api.system.builder.post.fields.input.title",
343
+ description:
344
+ "app.api.system.builder.post.fields.input.description",
345
+ placeholder:
346
+ "app.api.system.builder.post.fields.input.placeholder",
347
+ icon: "file-input",
348
+ colSpan: 6,
349
+ },
350
+ z.string(),
351
+ ),
352
+
353
+ output: requestDataField(
354
+ {
355
+ type: WidgetType.FORM_FIELD,
356
+ fieldType: FieldDataType.TEXT,
357
+ label: "app.api.system.builder.post.fields.output.title",
358
+ description:
359
+ "app.api.system.builder.post.fields.output.description",
360
+ placeholder:
361
+ "app.api.system.builder.post.fields.output.placeholder",
362
+ icon: "file-output",
363
+ colSpan: 6,
364
+ },
365
+ z.string(),
366
+ ),
367
+
368
+ type: requestDataField(
369
+ {
370
+ type: WidgetType.FORM_FIELD,
371
+ fieldType: FieldDataType.SELECT,
372
+ label: "app.api.system.builder.post.fields.type.title",
373
+ description:
374
+ "app.api.system.builder.post.fields.type.description",
375
+ options: BuildTypeOptions,
376
+ icon: "box",
377
+ colSpan: 6,
378
+ },
379
+ z.union([
380
+ z.enum(ViteBuildTypeEnum),
381
+ z.enum(BunBuildTypeEnum),
382
+ ]),
383
+ ),
384
+
385
+ modulesToExternalize: requestDataField(
386
+ {
387
+ type: WidgetType.FORM_FIELD,
388
+ fieldType: FieldDataType.TAGS,
389
+ label:
390
+ "app.api.system.builder.post.fields.modulesToExternalize.title",
391
+ description:
392
+ "app.api.system.builder.post.fields.modulesToExternalize.description",
393
+ placeholder:
394
+ "app.api.system.builder.post.fields.modulesToExternalize.placeholder",
395
+ optional: true,
396
+ icon: "package",
397
+ colSpan: 6,
398
+ },
399
+ z.array(z.string()).optional(),
400
+ ),
401
+
402
+ // Vite-specific options
403
+ inlineCss: requestDataField(
404
+ {
405
+ type: WidgetType.FORM_FIELD,
406
+ fieldType: FieldDataType.BOOLEAN,
407
+ label: "app.api.system.builder.post.fields.inlineCss.title",
408
+ description:
409
+ "app.api.system.builder.post.fields.inlineCss.description",
410
+ optional: true,
411
+ icon: "paintbrush",
412
+ colSpan: 4,
413
+ },
414
+ z.boolean().optional(),
415
+ ),
416
+
417
+ bundleReact: requestDataField(
418
+ {
419
+ type: WidgetType.FORM_FIELD,
420
+ fieldType: FieldDataType.BOOLEAN,
421
+ label:
422
+ "app.api.system.builder.post.fields.bundleReact.title",
423
+ description:
424
+ "app.api.system.builder.post.fields.bundleReact.description",
425
+ optional: true,
426
+ icon: "atom",
427
+ colSpan: 4,
428
+ },
429
+ z.boolean().optional(),
430
+ ),
431
+
432
+ // Package config for library builds
433
+ packageConfig: objectOptionalField(
434
+ {
435
+ type: WidgetType.CONTAINER,
436
+ title:
437
+ "app.api.system.builder.post.fields.packageConfig.title",
438
+ description:
439
+ "app.api.system.builder.post.fields.packageConfig.description",
440
+ layoutType: LayoutType.GRID,
441
+ columns: 12,
442
+ optional: true,
443
+ icon: "package",
444
+ },
445
+ { request: "data" },
446
+ {
447
+ isPackage: requestDataField(
448
+ {
449
+ type: WidgetType.FORM_FIELD,
450
+ fieldType: FieldDataType.BOOLEAN,
451
+ label:
452
+ "app.api.system.builder.post.fields.isPackage.title",
453
+ description:
454
+ "app.api.system.builder.post.fields.isPackage.description",
455
+ colSpan: 4,
456
+ },
457
+ z.literal(true),
458
+ ),
459
+
460
+ dtsInclude: requestDataField(
461
+ {
462
+ type: WidgetType.FORM_FIELD,
463
+ fieldType: FieldDataType.TAGS,
464
+ label:
465
+ "app.api.system.builder.post.fields.dtsInclude.title",
466
+ description:
467
+ "app.api.system.builder.post.fields.dtsInclude.description",
468
+ placeholder:
469
+ "app.api.system.builder.post.fields.dtsInclude.placeholder",
470
+ icon: "file-type",
471
+ colSpan: 8,
472
+ },
473
+ z.array(z.string()),
474
+ ),
475
+
476
+ dtsEntryRoot: requestDataField(
477
+ {
478
+ type: WidgetType.FORM_FIELD,
479
+ fieldType: FieldDataType.TEXT,
480
+ label:
481
+ "app.api.system.builder.post.fields.dtsEntryRoot.title",
482
+ description:
483
+ "app.api.system.builder.post.fields.dtsEntryRoot.description",
484
+ placeholder:
485
+ "app.api.system.builder.post.fields.dtsEntryRoot.placeholder",
486
+ icon: "folder",
487
+ colSpan: 12,
488
+ },
489
+ z.string(),
490
+ ),
491
+ },
492
+ ),
493
+
494
+ // Bun-specific options
495
+ bunOptions: objectOptionalField(
496
+ {
497
+ type: WidgetType.CONTAINER,
498
+ title:
499
+ "app.api.system.builder.post.fields.bunOptions.title",
500
+ description:
501
+ "app.api.system.builder.post.fields.bunOptions.description",
502
+ layoutType: LayoutType.GRID,
503
+ columns: 12,
504
+ optional: true,
505
+ icon: "zap",
506
+ },
507
+ { request: "data" },
508
+ {
509
+ target: requestDataField(
510
+ {
511
+ type: WidgetType.FORM_FIELD,
512
+ fieldType: FieldDataType.SELECT,
513
+ label:
514
+ "app.api.system.builder.post.fields.bunTarget.title",
515
+ description:
516
+ "app.api.system.builder.post.fields.bunTarget.description",
517
+ options: BunTargetOptions,
518
+ optional: true,
519
+ icon: "target",
520
+ colSpan: 4,
521
+ },
522
+ z.enum(BunTargetEnum).optional(),
523
+ ),
524
+
525
+ minify: requestDataField(
526
+ {
527
+ type: WidgetType.FORM_FIELD,
528
+ fieldType: FieldDataType.BOOLEAN,
529
+ label:
530
+ "app.api.system.builder.post.fields.bunMinify.title",
531
+ description:
532
+ "app.api.system.builder.post.fields.bunMinify.description",
533
+ optional: true,
534
+ icon: "minimize-2",
535
+ colSpan: 4,
536
+ },
537
+ z.boolean().optional(),
538
+ ),
539
+
540
+ sourcemap: requestDataField(
541
+ {
542
+ type: WidgetType.FORM_FIELD,
543
+ fieldType: FieldDataType.SELECT,
544
+ label:
545
+ "app.api.system.builder.post.fields.sourcemap.title",
546
+ description:
547
+ "app.api.system.builder.post.fields.sourcemap.description",
548
+ options: SourcemapModeOptions,
549
+ optional: true,
550
+ icon: "map",
551
+ colSpan: 4,
552
+ },
553
+ z.enum(SourcemapModeEnum).optional(),
554
+ ),
555
+
556
+ external: requestDataField(
557
+ {
558
+ type: WidgetType.FORM_FIELD,
559
+ fieldType: FieldDataType.TAGS,
560
+ label:
561
+ "app.api.system.builder.post.fields.external.title",
562
+ description:
563
+ "app.api.system.builder.post.fields.external.description",
564
+ placeholder:
565
+ "app.api.system.builder.post.fields.external.placeholder",
566
+ optional: true,
567
+ icon: "external-link",
568
+ colSpan: 12,
569
+ },
570
+ z.array(z.string()).optional(),
571
+ ),
572
+
573
+ define: requestDataField(
574
+ {
575
+ type: WidgetType.FORM_FIELD,
576
+ fieldType: FieldDataType.JSON,
577
+ label:
578
+ "app.api.system.builder.post.fields.define.title",
579
+ description:
580
+ "app.api.system.builder.post.fields.define.description",
581
+ placeholder:
582
+ "app.api.system.builder.post.fields.define.placeholder",
583
+ optional: true,
584
+ icon: "code",
585
+ colSpan: 12,
586
+ },
587
+ z.record(z.string(), z.string()).optional(),
588
+ ),
589
+
590
+ splitting: requestDataField(
591
+ {
592
+ type: WidgetType.FORM_FIELD,
593
+ fieldType: FieldDataType.BOOLEAN,
594
+ label:
595
+ "app.api.system.builder.post.fields.splitting.title",
596
+ description:
597
+ "app.api.system.builder.post.fields.splitting.description",
598
+ optional: true,
599
+ icon: "git-branch",
600
+ colSpan: 4,
601
+ },
602
+ z.boolean().optional(),
603
+ ),
604
+
605
+ format: requestDataField(
606
+ {
607
+ type: WidgetType.FORM_FIELD,
608
+ fieldType: FieldDataType.SELECT,
609
+ label:
610
+ "app.api.system.builder.post.fields.format.title",
611
+ description:
612
+ "app.api.system.builder.post.fields.format.description",
613
+ options: OutputFormatOptions,
614
+ optional: true,
615
+ icon: "file-code",
616
+ colSpan: 4,
617
+ },
618
+ z.enum(OutputFormatEnum).optional(),
619
+ ),
620
+
621
+ bytecode: requestDataField(
622
+ {
623
+ type: WidgetType.FORM_FIELD,
624
+ fieldType: FieldDataType.BOOLEAN,
625
+ label:
626
+ "app.api.system.builder.post.fields.bytecode.title",
627
+ description:
628
+ "app.api.system.builder.post.fields.bytecode.description",
629
+ optional: true,
630
+ icon: "binary",
631
+ colSpan: 4,
632
+ },
633
+ z.boolean().optional(),
634
+ ),
635
+
636
+ banner: requestDataField(
637
+ {
638
+ type: WidgetType.FORM_FIELD,
639
+ fieldType: FieldDataType.TEXTAREA,
640
+ label:
641
+ "app.api.system.builder.post.fields.banner.title",
642
+ description:
643
+ "app.api.system.builder.post.fields.banner.description",
644
+ placeholder:
645
+ "app.api.system.builder.post.fields.banner.placeholder",
646
+ optional: true,
647
+ icon: "chevron-up",
648
+ colSpan: 6,
649
+ },
650
+ z.string().optional(),
651
+ ),
652
+
653
+ footer: requestDataField(
654
+ {
655
+ type: WidgetType.FORM_FIELD,
656
+ fieldType: FieldDataType.TEXTAREA,
657
+ label:
658
+ "app.api.system.builder.post.fields.footer.title",
659
+ description:
660
+ "app.api.system.builder.post.fields.footer.description",
661
+ placeholder:
662
+ "app.api.system.builder.post.fields.footer.placeholder",
663
+ optional: true,
664
+ icon: "chevron-down",
665
+ colSpan: 6,
666
+ },
667
+ z.string().optional(),
668
+ ),
669
+
670
+ // Advanced Bun options (passthrough to Bun.build)
671
+ publicPath: requestDataField(
672
+ {
673
+ type: WidgetType.FORM_FIELD,
674
+ fieldType: FieldDataType.TEXT,
675
+ label:
676
+ "app.api.system.builder.post.fields.publicPath.label",
677
+ description:
678
+ "app.api.system.builder.post.fields.publicPath.description",
679
+ optional: true,
680
+ colSpan: 6,
681
+ },
682
+ z.string().optional(),
683
+ ),
684
+
685
+ naming: requestDataField(
686
+ {
687
+ type: WidgetType.FORM_FIELD,
688
+ fieldType: FieldDataType.JSON,
689
+ label:
690
+ "app.api.system.builder.post.fields.naming.label",
691
+ description:
692
+ "app.api.system.builder.post.fields.naming.description",
693
+ optional: true,
694
+ colSpan: 6,
695
+ },
696
+ z
697
+ .union([
698
+ z.string(),
699
+ z.object({
700
+ entry: z.string().optional(),
701
+ chunk: z.string().optional(),
702
+ asset: z.string().optional(),
703
+ }),
704
+ ])
705
+ .optional(),
706
+ ),
707
+
708
+ root: requestDataField(
709
+ {
710
+ type: WidgetType.FORM_FIELD,
711
+ fieldType: FieldDataType.TEXT,
712
+ label: "app.api.system.builder.post.fields.root.label",
713
+ description:
714
+ "app.api.system.builder.post.fields.root.description",
715
+ optional: true,
716
+ colSpan: 6,
717
+ },
718
+ z.string().optional(),
719
+ ),
720
+
721
+ conditions: requestDataField(
722
+ {
723
+ type: WidgetType.FORM_FIELD,
724
+ fieldType: FieldDataType.JSON,
725
+ label:
726
+ "app.api.system.builder.post.fields.conditions.label",
727
+ description:
728
+ "app.api.system.builder.post.fields.conditions.description",
729
+ optional: true,
730
+ colSpan: 6,
731
+ },
732
+ z.array(z.string()).optional(),
733
+ ),
734
+
735
+ loader: requestDataField(
736
+ {
737
+ type: WidgetType.FORM_FIELD,
738
+ fieldType: FieldDataType.JSON,
739
+ label:
740
+ "app.api.system.builder.post.fields.loader.label",
741
+ description:
742
+ "app.api.system.builder.post.fields.loader.description",
743
+ optional: true,
744
+ colSpan: 6,
745
+ },
746
+ z
747
+ .record(
748
+ z.string(),
749
+ z.enum([
750
+ "js",
751
+ "jsx",
752
+ "ts",
753
+ "tsx",
754
+ "json",
755
+ "toml",
756
+ "text",
757
+ "file",
758
+ "napi",
759
+ "wasm",
760
+ ]),
761
+ )
762
+ .optional(),
763
+ ),
764
+
765
+ drop: requestDataField(
766
+ {
767
+ type: WidgetType.FORM_FIELD,
768
+ fieldType: FieldDataType.JSON,
769
+ label: "app.api.system.builder.post.fields.drop.label",
770
+ description:
771
+ "app.api.system.builder.post.fields.drop.description",
772
+ optional: true,
773
+ colSpan: 6,
774
+ },
775
+ z.array(z.string()).optional(),
776
+ ),
777
+ },
778
+ ),
779
+
780
+ // Vite advanced options
781
+ viteOptions: objectOptionalField(
782
+ {
783
+ type: WidgetType.CONTAINER,
784
+ title:
785
+ "app.api.system.builder.post.fields.viteOptions.title",
786
+ description:
787
+ "app.api.system.builder.post.fields.viteOptions.description",
788
+ layoutType: LayoutType.GRID,
789
+ columns: 12,
790
+ optional: true,
791
+ icon: "bolt",
792
+ },
793
+ { request: "data" },
794
+ {
795
+ target: requestDataField(
796
+ {
797
+ type: WidgetType.FORM_FIELD,
798
+ fieldType: FieldDataType.TAGS,
799
+ label:
800
+ "app.api.system.builder.post.fields.viteTarget.title",
801
+ description:
802
+ "app.api.system.builder.post.fields.viteTarget.description",
803
+ placeholder:
804
+ "app.api.system.builder.post.fields.viteTarget.placeholder",
805
+ optional: true,
806
+ icon: "target",
807
+ colSpan: 6,
808
+ },
809
+ z.union([z.string(), z.array(z.string())]).optional(),
810
+ ),
811
+
812
+ outDir: requestDataField(
813
+ {
814
+ type: WidgetType.FORM_FIELD,
815
+ fieldType: FieldDataType.TEXT,
816
+ label:
817
+ "app.api.system.builder.post.fields.viteOutDir.title",
818
+ description:
819
+ "app.api.system.builder.post.fields.viteOutDir.description",
820
+ placeholder:
821
+ "app.api.system.builder.post.fields.viteOutDir.placeholder",
822
+ optional: true,
823
+ icon: "folder-output",
824
+ colSpan: 6,
825
+ },
826
+ z.string().optional(),
827
+ ),
828
+
829
+ assetsDir: requestDataField(
830
+ {
831
+ type: WidgetType.FORM_FIELD,
832
+ fieldType: FieldDataType.TEXT,
833
+ label:
834
+ "app.api.system.builder.post.fields.viteAssetsDir.title",
835
+ description:
836
+ "app.api.system.builder.post.fields.viteAssetsDir.description",
837
+ placeholder:
838
+ "app.api.system.builder.post.fields.viteAssetsDir.placeholder",
839
+ optional: true,
840
+ icon: "folder",
841
+ colSpan: 4,
842
+ },
843
+ z.string().optional(),
844
+ ),
845
+
846
+ assetsInlineLimit: requestDataField(
847
+ {
848
+ type: WidgetType.FORM_FIELD,
849
+ fieldType: FieldDataType.NUMBER,
850
+ label:
851
+ "app.api.system.builder.post.fields.viteAssetsInlineLimit.title",
852
+ description:
853
+ "app.api.system.builder.post.fields.viteAssetsInlineLimit.description",
854
+ placeholder:
855
+ "app.api.system.builder.post.fields.viteAssetsInlineLimit.placeholder",
856
+ optional: true,
857
+ icon: "file-image",
858
+ colSpan: 4,
859
+ },
860
+ z.number().optional(),
861
+ ),
862
+
863
+ chunkSizeWarningLimit: requestDataField(
864
+ {
865
+ type: WidgetType.FORM_FIELD,
866
+ fieldType: FieldDataType.NUMBER,
867
+ label:
868
+ "app.api.system.builder.post.fields.viteChunkSizeWarningLimit.title",
869
+ description:
870
+ "app.api.system.builder.post.fields.viteChunkSizeWarningLimit.description",
871
+ placeholder:
872
+ "app.api.system.builder.post.fields.viteChunkSizeWarningLimit.placeholder",
873
+ optional: true,
874
+ icon: "alert-triangle",
875
+ colSpan: 4,
876
+ },
877
+ z.number().optional(),
878
+ ),
879
+
880
+ cssCodeSplit: requestDataField(
881
+ {
882
+ type: WidgetType.FORM_FIELD,
883
+ fieldType: FieldDataType.BOOLEAN,
884
+ label:
885
+ "app.api.system.builder.post.fields.viteCssCodeSplit.title",
886
+ description:
887
+ "app.api.system.builder.post.fields.viteCssCodeSplit.description",
888
+ optional: true,
889
+ icon: "scissors",
890
+ colSpan: 4,
891
+ },
892
+ z.boolean().optional(),
893
+ ),
894
+
895
+ sourcemap: requestDataField(
896
+ {
897
+ type: WidgetType.FORM_FIELD,
898
+ fieldType: FieldDataType.SELECT,
899
+ label:
900
+ "app.api.system.builder.post.fields.viteSourcemap.title",
901
+ description:
902
+ "app.api.system.builder.post.fields.viteSourcemap.description",
903
+ options: [
904
+ {
905
+ value: "true",
906
+ label:
907
+ "app.api.system.builder.enums.viteSourcemap.true",
908
+ },
909
+ {
910
+ value: "false",
911
+ label:
912
+ "app.api.system.builder.enums.viteSourcemap.false",
913
+ },
914
+ {
915
+ value: "inline",
916
+ label:
917
+ "app.api.system.builder.enums.viteSourcemap.inline",
918
+ },
919
+ {
920
+ value: "hidden",
921
+ label:
922
+ "app.api.system.builder.enums.viteSourcemap.hidden",
923
+ },
924
+ ],
925
+ optional: true,
926
+ icon: "map",
927
+ colSpan: 4,
928
+ },
929
+ z
930
+ .union([
931
+ z.boolean(),
932
+ z.literal("inline"),
933
+ z.literal("hidden"),
934
+ ])
935
+ .optional(),
936
+ ),
937
+
938
+ minify: requestDataField(
939
+ {
940
+ type: WidgetType.FORM_FIELD,
941
+ fieldType: FieldDataType.SELECT,
942
+ label:
943
+ "app.api.system.builder.post.fields.viteMinify.title",
944
+ description:
945
+ "app.api.system.builder.post.fields.viteMinify.description",
946
+ options: ViteMinifyOptions,
947
+ optional: true,
948
+ icon: "minimize-2",
949
+ colSpan: 4,
950
+ },
951
+ z
952
+ .union([
953
+ z.boolean(),
954
+ z.literal("terser"),
955
+ z.literal("esbuild"),
956
+ ])
957
+ .optional(),
958
+ ),
959
+
960
+ emptyOutDir: requestDataField(
961
+ {
962
+ type: WidgetType.FORM_FIELD,
963
+ fieldType: FieldDataType.BOOLEAN,
964
+ label:
965
+ "app.api.system.builder.post.fields.viteEmptyOutDir.title",
966
+ description:
967
+ "app.api.system.builder.post.fields.viteEmptyOutDir.description",
968
+ optional: true,
969
+ icon: "trash",
970
+ colSpan: 4,
971
+ },
972
+ z.boolean().optional(),
973
+ ),
974
+
975
+ reportCompressedSize: requestDataField(
976
+ {
977
+ type: WidgetType.FORM_FIELD,
978
+ fieldType: FieldDataType.BOOLEAN,
979
+ label:
980
+ "app.api.system.builder.post.fields.viteReportCompressedSize.title",
981
+ description:
982
+ "app.api.system.builder.post.fields.viteReportCompressedSize.description",
983
+ optional: true,
984
+ icon: "archive",
985
+ colSpan: 4,
986
+ },
987
+ z.boolean().optional(),
988
+ ),
989
+
990
+ manifest: requestDataField(
991
+ {
992
+ type: WidgetType.FORM_FIELD,
993
+ fieldType: FieldDataType.BOOLEAN,
994
+ label:
995
+ "app.api.system.builder.post.fields.viteManifest.title",
996
+ description:
997
+ "app.api.system.builder.post.fields.viteManifest.description",
998
+ optional: true,
999
+ icon: "list",
1000
+ colSpan: 4,
1001
+ },
1002
+ z.union([z.boolean(), z.string()]).optional(),
1003
+ ),
1004
+
1005
+ // Library mode options
1006
+ lib: objectOptionalField(
1007
+ {
1008
+ type: WidgetType.CONTAINER,
1009
+ title:
1010
+ "app.api.system.builder.post.fields.viteLib.title",
1011
+ description:
1012
+ "app.api.system.builder.post.fields.viteLib.description",
1013
+ layoutType: LayoutType.GRID,
1014
+ columns: 12,
1015
+ optional: true,
1016
+ icon: "library",
1017
+ },
1018
+ { request: "data" },
1019
+ {
1020
+ entry: requestDataField(
1021
+ {
1022
+ type: WidgetType.FORM_FIELD,
1023
+ fieldType: FieldDataType.TEXT,
1024
+ label:
1025
+ "app.api.system.builder.post.fields.viteLibEntry.title",
1026
+ description:
1027
+ "app.api.system.builder.post.fields.viteLibEntry.description",
1028
+ placeholder:
1029
+ "app.api.system.builder.post.fields.viteLibEntry.placeholder",
1030
+ icon: "file-input",
1031
+ colSpan: 6,
1032
+ },
1033
+ z.union([
1034
+ z.string(),
1035
+ z.array(z.string()),
1036
+ z.record(z.string(), z.string()),
1037
+ ]),
1038
+ ),
1039
+
1040
+ name: requestDataField(
1041
+ {
1042
+ type: WidgetType.FORM_FIELD,
1043
+ fieldType: FieldDataType.TEXT,
1044
+ label:
1045
+ "app.api.system.builder.post.fields.viteLibName.title",
1046
+ description:
1047
+ "app.api.system.builder.post.fields.viteLibName.description",
1048
+ placeholder:
1049
+ "app.api.system.builder.post.fields.viteLibName.placeholder",
1050
+ optional: true,
1051
+ icon: "tag",
1052
+ colSpan: 6,
1053
+ },
1054
+ z.string().optional(),
1055
+ ),
1056
+
1057
+ formats: requestDataField(
1058
+ {
1059
+ type: WidgetType.FORM_FIELD,
1060
+ fieldType: FieldDataType.MULTISELECT,
1061
+ label:
1062
+ "app.api.system.builder.post.fields.viteLibFormats.title",
1063
+ description:
1064
+ "app.api.system.builder.post.fields.viteLibFormats.description",
1065
+ options: ViteLibFormatOptions,
1066
+ optional: true,
1067
+ icon: "file-code",
1068
+ colSpan: 6,
1069
+ },
1070
+ z.array(z.enum(ViteLibFormatEnum)).optional(),
1071
+ ),
1072
+
1073
+ fileName: requestDataField(
1074
+ {
1075
+ type: WidgetType.FORM_FIELD,
1076
+ fieldType: FieldDataType.TEXT,
1077
+ label:
1078
+ "app.api.system.builder.post.fields.viteLibFileName.title",
1079
+ description:
1080
+ "app.api.system.builder.post.fields.viteLibFileName.description",
1081
+ placeholder:
1082
+ "app.api.system.builder.post.fields.viteLibFileName.placeholder",
1083
+ optional: true,
1084
+ icon: "file",
1085
+ colSpan: 6,
1086
+ },
1087
+ z.string().optional(),
1088
+ ),
1089
+ },
1090
+ ),
1091
+
1092
+ // Rollup options subset
1093
+ rollupOptions: objectOptionalField(
1094
+ {
1095
+ type: WidgetType.CONTAINER,
1096
+ title:
1097
+ "app.api.system.builder.post.fields.viteRollupOptions.title",
1098
+ description:
1099
+ "app.api.system.builder.post.fields.viteRollupOptions.description",
1100
+ layoutType: LayoutType.GRID,
1101
+ columns: 12,
1102
+ optional: true,
1103
+ icon: "package",
1104
+ },
1105
+ { request: "data" },
1106
+ {
1107
+ external: requestDataField(
1108
+ {
1109
+ type: WidgetType.FORM_FIELD,
1110
+ fieldType: FieldDataType.TAGS,
1111
+ label:
1112
+ "app.api.system.builder.post.fields.rollupExternal.title",
1113
+ description:
1114
+ "app.api.system.builder.post.fields.rollupExternal.description",
1115
+ placeholder:
1116
+ "app.api.system.builder.post.fields.rollupExternal.placeholder",
1117
+ optional: true,
1118
+ icon: "external-link",
1119
+ colSpan: 12,
1120
+ },
1121
+ z.union([z.string(), z.array(z.string())]).optional(),
1122
+ ),
1123
+
1124
+ treeshake: requestDataField(
1125
+ {
1126
+ type: WidgetType.FORM_FIELD,
1127
+ fieldType: FieldDataType.BOOLEAN,
1128
+ label:
1129
+ "app.api.system.builder.post.fields.rollupTreeshake.title",
1130
+ description:
1131
+ "app.api.system.builder.post.fields.rollupTreeshake.description",
1132
+ optional: true,
1133
+ icon: "tree",
1134
+ colSpan: 6,
1135
+ },
1136
+ z
1137
+ .union([
1138
+ z.boolean(),
1139
+ z.object({
1140
+ moduleSideEffects: z.boolean().optional(),
1141
+ }),
1142
+ ])
1143
+ .optional(),
1144
+ ),
1145
+
1146
+ output: requestDataField(
1147
+ {
1148
+ type: WidgetType.FORM_FIELD,
1149
+ fieldType: FieldDataType.JSON,
1150
+ label:
1151
+ "app.api.system.builder.post.fields.rollupOutput.label",
1152
+ description:
1153
+ "app.api.system.builder.post.fields.rollupOutput.description",
1154
+ optional: true,
1155
+ icon: "file-output",
1156
+ colSpan: 12,
1157
+ },
1158
+ z.record(z.string(), z.unknown()).optional(),
1159
+ ),
1160
+ },
1161
+ ),
1162
+
1163
+ // Raw plugins passthrough (for programmatic config files)
1164
+ plugins: requestDataField(
1165
+ {
1166
+ type: WidgetType.FORM_FIELD,
1167
+ fieldType: FieldDataType.JSON,
1168
+ label:
1169
+ "app.api.system.builder.post.fields.vitePlugins.label",
1170
+ description:
1171
+ "app.api.system.builder.post.fields.vitePlugins.description",
1172
+ optional: true,
1173
+ icon: "plug",
1174
+ colSpan: 12,
1175
+ },
1176
+ z.array(z.unknown()).optional(),
1177
+ ),
1178
+
1179
+ // Raw build options passthrough
1180
+ build: requestDataField(
1181
+ {
1182
+ type: WidgetType.FORM_FIELD,
1183
+ fieldType: FieldDataType.JSON,
1184
+ label:
1185
+ "app.api.system.builder.post.fields.viteBuild.label",
1186
+ description:
1187
+ "app.api.system.builder.post.fields.viteBuild.description",
1188
+ optional: true,
1189
+ icon: "settings",
1190
+ colSpan: 12,
1191
+ },
1192
+ z.record(z.string(), z.unknown()).optional(),
1193
+ ),
1194
+ },
1195
+ ),
1196
+ },
1197
+ ),
1198
+ ),
1199
+
1200
+ // ==================================================================
1201
+ // FILES/FOLDERS TO COPY
1202
+ // ==================================================================
1203
+ filesOrFoldersToCopy: requestDataArrayOptionalField(
1204
+ {
1205
+ type: WidgetType.CONTAINER,
1206
+ title:
1207
+ "app.api.system.builder.post.fields.filesOrFoldersToCopy.title",
1208
+ description:
1209
+ "app.api.system.builder.post.fields.filesOrFoldersToCopy.description",
1210
+ layoutType: LayoutType.GRID,
1211
+ columns: 12,
1212
+ optional: true,
1213
+ icon: "copy",
1214
+ },
1215
+ objectField(
1216
+ {
1217
+ type: WidgetType.DATA_CARD,
1218
+ title: "app.api.system.builder.post.fields.copyConfig.title",
1219
+ layoutType: LayoutType.GRID,
1220
+ columns: 12,
1221
+ icon: "file-copy",
1222
+ },
1223
+ { request: "data" },
1224
+ {
1225
+ input: requestDataField(
1226
+ {
1227
+ type: WidgetType.FORM_FIELD,
1228
+ fieldType: FieldDataType.TEXT,
1229
+ label: "app.api.system.builder.post.fields.copyInput.title",
1230
+ description:
1231
+ "app.api.system.builder.post.fields.copyInput.description",
1232
+ placeholder:
1233
+ "app.api.system.builder.post.fields.copyInput.placeholder",
1234
+ icon: "file-input",
1235
+ colSpan: 5,
1236
+ },
1237
+ z.string(),
1238
+ ),
1239
+
1240
+ output: requestDataField(
1241
+ {
1242
+ type: WidgetType.FORM_FIELD,
1243
+ fieldType: FieldDataType.TEXT,
1244
+ label:
1245
+ "app.api.system.builder.post.fields.copyOutput.title",
1246
+ description:
1247
+ "app.api.system.builder.post.fields.copyOutput.description",
1248
+ placeholder:
1249
+ "app.api.system.builder.post.fields.copyOutput.placeholder",
1250
+ icon: "file-output",
1251
+ colSpan: 5,
1252
+ },
1253
+ z.string(),
1254
+ ),
1255
+
1256
+ pattern: requestDataField(
1257
+ {
1258
+ type: WidgetType.FORM_FIELD,
1259
+ fieldType: FieldDataType.TEXT,
1260
+ label:
1261
+ "app.api.system.builder.post.fields.copyPattern.title",
1262
+ description:
1263
+ "app.api.system.builder.post.fields.copyPattern.description",
1264
+ placeholder:
1265
+ "app.api.system.builder.post.fields.copyPattern.placeholder",
1266
+ optional: true,
1267
+ icon: "filter",
1268
+ colSpan: 2,
1269
+ },
1270
+ z.string().optional(),
1271
+ ),
1272
+ },
1273
+ ),
1274
+ ),
1275
+
1276
+ // ==================================================================
1277
+ // NPM PACKAGE CONFIGURATION
1278
+ // ==================================================================
1279
+ npmPackage: objectOptionalField(
1280
+ {
1281
+ type: WidgetType.ACCORDION,
1282
+ title: "app.api.system.builder.post.fields.npmPackage.title",
1283
+ description:
1284
+ "app.api.system.builder.post.fields.npmPackage.description",
1285
+ layoutType: LayoutType.GRID,
1286
+ columns: 12,
1287
+ optional: true,
1288
+ icon: "npm",
1289
+ defaultExpanded: false,
1290
+ },
1291
+ { request: "data" },
1292
+ {
1293
+ name: requestDataField(
1294
+ {
1295
+ type: WidgetType.FORM_FIELD,
1296
+ fieldType: FieldDataType.TEXT,
1297
+ label: "app.api.system.builder.post.fields.packageName.title",
1298
+ description:
1299
+ "app.api.system.builder.post.fields.packageName.description",
1300
+ placeholder:
1301
+ "app.api.system.builder.post.fields.packageName.placeholder",
1302
+ icon: "package",
1303
+ colSpan: 6,
1304
+ },
1305
+ z.string(),
1306
+ ),
1307
+
1308
+ version: requestDataField(
1309
+ {
1310
+ type: WidgetType.FORM_FIELD,
1311
+ fieldType: FieldDataType.TEXT,
1312
+ label:
1313
+ "app.api.system.builder.post.fields.packageVersion.title",
1314
+ description:
1315
+ "app.api.system.builder.post.fields.packageVersion.description",
1316
+ placeholder:
1317
+ "app.api.system.builder.post.fields.packageVersion.placeholder",
1318
+ optional: true,
1319
+ icon: "tag",
1320
+ colSpan: 6,
1321
+ },
1322
+ z.string().optional(),
1323
+ ),
1324
+
1325
+ description: requestDataField(
1326
+ {
1327
+ type: WidgetType.FORM_FIELD,
1328
+ fieldType: FieldDataType.TEXTAREA,
1329
+ label:
1330
+ "app.api.system.builder.post.fields.packageDescription.title",
1331
+ description:
1332
+ "app.api.system.builder.post.fields.packageDescription.description",
1333
+ placeholder:
1334
+ "app.api.system.builder.post.fields.packageDescription.placeholder",
1335
+ optional: true,
1336
+ icon: "text",
1337
+ colSpan: 12,
1338
+ },
1339
+ z.string().optional(),
1340
+ ),
1341
+
1342
+ main: requestDataField(
1343
+ {
1344
+ type: WidgetType.FORM_FIELD,
1345
+ fieldType: FieldDataType.TEXT,
1346
+ label: "app.api.system.builder.post.fields.packageMain.title",
1347
+ description:
1348
+ "app.api.system.builder.post.fields.packageMain.description",
1349
+ placeholder:
1350
+ "app.api.system.builder.post.fields.packageMain.placeholder",
1351
+ optional: true,
1352
+ icon: "file-code",
1353
+ colSpan: 4,
1354
+ },
1355
+ z.string().optional(),
1356
+ ),
1357
+
1358
+ module: requestDataField(
1359
+ {
1360
+ type: WidgetType.FORM_FIELD,
1361
+ fieldType: FieldDataType.TEXT,
1362
+ label:
1363
+ "app.api.system.builder.post.fields.packageModule.title",
1364
+ description:
1365
+ "app.api.system.builder.post.fields.packageModule.description",
1366
+ placeholder:
1367
+ "app.api.system.builder.post.fields.packageModule.placeholder",
1368
+ optional: true,
1369
+ icon: "file-code-2",
1370
+ colSpan: 4,
1371
+ },
1372
+ z.string().optional(),
1373
+ ),
1374
+
1375
+ types: requestDataField(
1376
+ {
1377
+ type: WidgetType.FORM_FIELD,
1378
+ fieldType: FieldDataType.TEXT,
1379
+ label:
1380
+ "app.api.system.builder.post.fields.packageTypes.title",
1381
+ description:
1382
+ "app.api.system.builder.post.fields.packageTypes.description",
1383
+ placeholder:
1384
+ "app.api.system.builder.post.fields.packageTypes.placeholder",
1385
+ optional: true,
1386
+ icon: "file-type",
1387
+ colSpan: 4,
1388
+ },
1389
+ z.string().optional(),
1390
+ ),
1391
+
1392
+ bin: requestDataField(
1393
+ {
1394
+ type: WidgetType.FORM_FIELD,
1395
+ fieldType: FieldDataType.JSON,
1396
+ label: "app.api.system.builder.post.fields.packageBin.title",
1397
+ description:
1398
+ "app.api.system.builder.post.fields.packageBin.description",
1399
+ placeholder:
1400
+ "app.api.system.builder.post.fields.packageBin.placeholder",
1401
+ optional: true,
1402
+ icon: "terminal",
1403
+ colSpan: 12,
1404
+ },
1405
+ z.record(z.string(), z.string()).optional(),
1406
+ ),
1407
+
1408
+ exports: requestDataField(
1409
+ {
1410
+ type: WidgetType.FORM_FIELD,
1411
+ fieldType: FieldDataType.JSON,
1412
+ label:
1413
+ "app.api.system.builder.post.fields.packageExports.title",
1414
+ description:
1415
+ "app.api.system.builder.post.fields.packageExports.description",
1416
+ placeholder:
1417
+ "app.api.system.builder.post.fields.packageExports.placeholder",
1418
+ optional: true,
1419
+ icon: "share-2",
1420
+ colSpan: 12,
1421
+ },
1422
+ z.record(z.string(), PackageExportConditionSchema).optional(),
1423
+ ),
1424
+
1425
+ dependencies: requestDataField(
1426
+ {
1427
+ type: WidgetType.FORM_FIELD,
1428
+ fieldType: FieldDataType.JSON,
1429
+ label:
1430
+ "app.api.system.builder.post.fields.packageDependencies.title",
1431
+ description:
1432
+ "app.api.system.builder.post.fields.packageDependencies.description",
1433
+ placeholder:
1434
+ "app.api.system.builder.post.fields.packageDependencies.placeholder",
1435
+ optional: true,
1436
+ icon: "package",
1437
+ colSpan: 6,
1438
+ },
1439
+ z.record(z.string(), z.string()).optional(),
1440
+ ),
1441
+
1442
+ peerDependencies: requestDataField(
1443
+ {
1444
+ type: WidgetType.FORM_FIELD,
1445
+ fieldType: FieldDataType.JSON,
1446
+ label:
1447
+ "app.api.system.builder.post.fields.packagePeerDependencies.title",
1448
+ description:
1449
+ "app.api.system.builder.post.fields.packagePeerDependencies.description",
1450
+ placeholder:
1451
+ "app.api.system.builder.post.fields.packagePeerDependencies.placeholder",
1452
+ optional: true,
1453
+ icon: "users",
1454
+ colSpan: 6,
1455
+ },
1456
+ z.record(z.string(), z.string()).optional(),
1457
+ ),
1458
+
1459
+ files: requestDataField(
1460
+ {
1461
+ type: WidgetType.FORM_FIELD,
1462
+ fieldType: FieldDataType.TAGS,
1463
+ label:
1464
+ "app.api.system.builder.post.fields.packageFiles.title",
1465
+ description:
1466
+ "app.api.system.builder.post.fields.packageFiles.description",
1467
+ placeholder:
1468
+ "app.api.system.builder.post.fields.packageFiles.placeholder",
1469
+ optional: true,
1470
+ icon: "files",
1471
+ colSpan: 6,
1472
+ },
1473
+ z.array(z.string()).optional(),
1474
+ ),
1475
+
1476
+ keywords: requestDataField(
1477
+ {
1478
+ type: WidgetType.FORM_FIELD,
1479
+ fieldType: FieldDataType.TAGS,
1480
+ label:
1481
+ "app.api.system.builder.post.fields.packageKeywords.title",
1482
+ description:
1483
+ "app.api.system.builder.post.fields.packageKeywords.description",
1484
+ placeholder:
1485
+ "app.api.system.builder.post.fields.packageKeywords.placeholder",
1486
+ optional: true,
1487
+ icon: "hash",
1488
+ colSpan: 6,
1489
+ },
1490
+ z.array(z.string()).optional(),
1491
+ ),
1492
+
1493
+ license: requestDataField(
1494
+ {
1495
+ type: WidgetType.FORM_FIELD,
1496
+ fieldType: FieldDataType.TEXT,
1497
+ label:
1498
+ "app.api.system.builder.post.fields.packageLicense.title",
1499
+ description:
1500
+ "app.api.system.builder.post.fields.packageLicense.description",
1501
+ placeholder:
1502
+ "app.api.system.builder.post.fields.packageLicense.placeholder",
1503
+ optional: true,
1504
+ icon: "scale",
1505
+ colSpan: 6,
1506
+ },
1507
+ z.string().optional(),
1508
+ ),
1509
+
1510
+ repository: requestDataField(
1511
+ {
1512
+ type: WidgetType.FORM_FIELD,
1513
+ fieldType: FieldDataType.TEXT,
1514
+ label:
1515
+ "app.api.system.builder.post.fields.packageRepository.title",
1516
+ description:
1517
+ "app.api.system.builder.post.fields.packageRepository.description",
1518
+ placeholder:
1519
+ "app.api.system.builder.post.fields.packageRepository.placeholder",
1520
+ optional: true,
1521
+ icon: "github",
1522
+ colSpan: 6,
1523
+ },
1524
+ z
1525
+ .union([
1526
+ z.string(),
1527
+ z.object({ type: z.string(), url: z.string() }),
1528
+ ])
1529
+ .optional(),
1530
+ ),
1531
+ },
1532
+ ),
1533
+ },
1534
+ ),
1535
+
1536
+ // ========================================================================
1537
+ // RESPONSE FIELDS
1538
+ // ========================================================================
1539
+ success: responseField(
1540
+ {
1541
+ type: WidgetType.STATUS_INDICATOR,
1542
+ status: "success",
1543
+ label: "app.api.system.builder.post.fields.success.title",
1544
+ icon: "check-circle",
1545
+ },
1546
+ z.boolean(),
1547
+ ),
1548
+
1549
+ output: responseField(
1550
+ {
1551
+ type: WidgetType.CODE_OUTPUT,
1552
+ content: "app.api.system.builder.post.fields.buildOutput.title",
1553
+ language: "plaintext",
1554
+ icon: "terminal",
1555
+ },
1556
+ z.string(),
1557
+ ),
1558
+
1559
+ duration: responseField(
1560
+ {
1561
+ type: WidgetType.STAT,
1562
+ content: "app.api.system.builder.post.fields.duration.title",
1563
+ icon: "clock",
1564
+ suffix: "ms",
1565
+ },
1566
+ z.coerce.number(),
1567
+ ),
1568
+
1569
+ filesBuilt: responseArrayOptionalField(
1570
+ {
1571
+ type: WidgetType.DATA_LIST,
1572
+ items: [],
1573
+ optional: true,
1574
+ icon: "file-check",
1575
+ },
1576
+ z.string(),
1577
+ ),
1578
+
1579
+ filesCopied: responseArrayOptionalField(
1580
+ {
1581
+ type: WidgetType.DATA_LIST,
1582
+ items: [],
1583
+ optional: true,
1584
+ icon: "file-copy",
1585
+ },
1586
+ z.string(),
1587
+ ),
1588
+
1589
+ packageJson: responseField(
1590
+ {
1591
+ type: WidgetType.CODE_OUTPUT,
1592
+ content: "app.api.system.builder.post.fields.packageJson.title",
1593
+ language: "json",
1594
+ optional: true,
1595
+ icon: "file-json",
1596
+ },
1597
+ z.string().optional(),
1598
+ ),
1599
+
1600
+ profileUsed: responseField(
1601
+ {
1602
+ type: WidgetType.BADGE,
1603
+ content: "app.api.system.builder.post.fields.profileUsed.title",
1604
+ optional: true,
1605
+ icon: "layers",
1606
+ },
1607
+ z.enum(BuildProfileEnum).optional(),
1608
+ ),
1609
+
1610
+ reportPath: responseField(
1611
+ {
1612
+ type: WidgetType.TEXT,
1613
+ content: "app.api.system.builder.post.fields.reportPath.title",
1614
+ },
1615
+ z.string().optional(),
1616
+ ),
1617
+
1618
+ stepTimings: responseArrayOptionalField(
1619
+ {
1620
+ type: WidgetType.DATA_TABLE,
1621
+ columns: [
1622
+ {
1623
+ key: "step",
1624
+ label: "app.api.system.builder.post.fields.stepTimings.step",
1625
+ },
1626
+ {
1627
+ key: "duration",
1628
+ label: "app.api.system.builder.post.fields.stepTimings.duration",
1629
+ },
1630
+ {
1631
+ key: "status",
1632
+ label: "app.api.system.builder.post.fields.stepTimings.status",
1633
+ },
1634
+ {
1635
+ key: "filesAffected",
1636
+ label:
1637
+ "app.api.system.builder.post.fields.stepTimings.filesAffected",
1638
+ },
1639
+ ],
1640
+ optional: true,
1641
+ icon: "list-checks",
1642
+ },
1643
+ objectField(
1644
+ {
1645
+ type: WidgetType.CONTAINER,
1646
+ layoutType: LayoutType.GRID,
1647
+ columns: 12,
1648
+ },
1649
+ { response: true },
1650
+ {
1651
+ step: responseField(
1652
+ {
1653
+ type: WidgetType.TEXT,
1654
+ content: "app.api.system.builder.post.fields.stepTimings.step",
1655
+ icon: "chevron-right",
1656
+ },
1657
+ z.string(),
1658
+ ),
1659
+ duration: responseField(
1660
+ {
1661
+ type: WidgetType.STAT,
1662
+ label:
1663
+ "app.api.system.builder.post.fields.stepTimings.duration",
1664
+ icon: "clock",
1665
+ suffix: "ms",
1666
+ },
1667
+ z.coerce.number(),
1668
+ ),
1669
+ status: responseField(
1670
+ {
1671
+ type: WidgetType.BADGE,
1672
+ label: "app.api.system.builder.post.fields.stepTimings.status",
1673
+ icon: "activity",
1674
+ },
1675
+ z.enum(StepStatusEnum),
1676
+ ),
1677
+ filesAffected: responseField(
1678
+ {
1679
+ type: WidgetType.STAT,
1680
+ label:
1681
+ "app.api.system.builder.post.fields.stepTimings.filesAffected",
1682
+ optional: true,
1683
+ icon: "files",
1684
+ },
1685
+ z.coerce.number().optional(),
1686
+ ),
1687
+ },
1688
+ ),
1689
+ ),
1690
+ },
1691
+ ),
1692
+
1693
+ // === ERROR HANDLING ===
1694
+ errorTypes: {
1695
+ [EndpointErrorTypes.VALIDATION_FAILED]: {
1696
+ title: "app.api.system.builder.post.errors.validation.title",
1697
+ description: "app.api.system.builder.post.errors.validation.description",
1698
+ },
1699
+ [EndpointErrorTypes.NETWORK_ERROR]: {
1700
+ title: "app.api.system.builder.post.errors.network.title",
1701
+ description: "app.api.system.builder.post.errors.network.description",
1702
+ },
1703
+ [EndpointErrorTypes.UNAUTHORIZED]: {
1704
+ title: "app.api.system.builder.post.errors.unauthorized.title",
1705
+ description:
1706
+ "app.api.system.builder.post.errors.unauthorized.description",
1707
+ },
1708
+ [EndpointErrorTypes.FORBIDDEN]: {
1709
+ title: "app.api.system.builder.post.errors.forbidden.title",
1710
+ description: "app.api.system.builder.post.errors.forbidden.description",
1711
+ },
1712
+ [EndpointErrorTypes.NOT_FOUND]: {
1713
+ title: "app.api.system.builder.post.errors.notFound.title",
1714
+ description: "app.api.system.builder.post.errors.notFound.description",
1715
+ },
1716
+ [EndpointErrorTypes.SERVER_ERROR]: {
1717
+ title: "app.api.system.builder.post.errors.server.title",
1718
+ description: "app.api.system.builder.post.errors.server.description",
1719
+ },
1720
+ [EndpointErrorTypes.UNKNOWN_ERROR]: {
1721
+ title: "app.api.system.builder.post.errors.unknown.title",
1722
+ description: "app.api.system.builder.post.errors.unknown.description",
1723
+ },
1724
+ [EndpointErrorTypes.CONFLICT]: {
1725
+ title: "app.api.system.builder.post.errors.conflict.title",
1726
+ description: "app.api.system.builder.post.errors.conflict.description",
1727
+ },
1728
+ [EndpointErrorTypes.UNSAVED_CHANGES]: {
1729
+ title: "app.api.system.builder.post.errors.unsavedChanges.title",
1730
+ description:
1731
+ "app.api.system.builder.post.errors.unsavedChanges.description",
1732
+ },
1733
+ },
1734
+
1735
+ // === SUCCESS HANDLING ===
1736
+ successTypes: {
1737
+ title: "app.api.system.builder.post.success.title",
1738
+ description: "app.api.system.builder.post.success.description",
1739
+ },
1740
+
1741
+ // === EXAMPLES ===
1742
+ examples: {
1743
+ requests: {
1744
+ defaultConfig: {},
1745
+ productionBuild: {
1746
+ configObject: {
1747
+ profile: BuildProfileEnum.PRODUCTION,
1748
+ analyze: true,
1749
+ filesToCompile: [],
1750
+ filesOrFoldersToCopy: [],
1751
+ },
1752
+ },
1753
+ dryRun: {
1754
+ configObject: {
1755
+ dryRun: true,
1756
+ verbose: true,
1757
+ filesToCompile: [],
1758
+ filesOrFoldersToCopy: [],
1759
+ },
1760
+ },
1761
+ },
1762
+ responses: {
1763
+ defaultConfig: {
1764
+ success: true,
1765
+ output: "Build completed successfully",
1766
+ duration: 1500,
1767
+ filesBuilt: ["dist/bin/vibe-runtime.js"],
1768
+ filesCopied: ["dist/README.md", "dist/LICENSE"],
1769
+ profileUsed: BuildProfileEnum.DEVELOPMENT,
1770
+ stepTimings: [],
1771
+ },
1772
+ productionBuild: {
1773
+ success: true,
1774
+ output: "Build completed successfully",
1775
+ duration: 2500,
1776
+ filesBuilt: ["dist/bin/vibe-runtime.js"],
1777
+ filesCopied: [],
1778
+ profileUsed: BuildProfileEnum.PRODUCTION,
1779
+ stepTimings: [],
1780
+ },
1781
+ dryRun: {
1782
+ success: true,
1783
+ output: "[DRY RUN] Build preview completed",
1784
+ duration: 50,
1785
+ filesBuilt: ["dist/bin/vibe-runtime.js"],
1786
+ filesCopied: [],
1787
+ profileUsed: BuildProfileEnum.DEVELOPMENT,
1788
+ stepTimings: [],
1789
+ },
1790
+ },
1791
+ },
1792
+ });
1793
+
1794
+ // Export the definition
1795
+ const builderDefinition = { POST };
1796
+ export default builderDefinition;
1797
+
1798
+ // ============================================================================
1799
+ // Type Exports - Derived from Enums
1800
+ // ============================================================================
1801
+
1802
+ /** Build profile type (derived from enum) */
1803
+ export type BuildProfile = `${BuildProfileEnum}`;
1804
+
1805
+ /** Vite build types (derived from enum) */
1806
+ export type ViteBuildType = `${ViteBuildTypeEnum}`;
1807
+
1808
+ /** Bun build types (derived from enum) */
1809
+ export type BunBuildType = `${BunBuildTypeEnum}`;
1810
+
1811
+ /** All build types */
1812
+ export type BuildType = ViteBuildType | BunBuildType;
1813
+
1814
+ /** Bun target runtime (derived from enum) */
1815
+ export type BunTarget = `${BunTargetEnum}`;
1816
+
1817
+ /** Sourcemap mode (derived from enum) */
1818
+ export type SourcemapMode = `${SourcemapModeEnum}`;
1819
+
1820
+ /** Output format (derived from enum) */
1821
+ export type OutputFormat = `${OutputFormatEnum}`;
1822
+
1823
+ /** Step status (derived from enum) */
1824
+ export type StepStatus = `${StepStatusEnum}`;
1825
+
1826
+ // ============================================================================
1827
+ // Type Guards
1828
+ // ============================================================================
1829
+
1830
+ /** Type guard for Vite builds */
1831
+ export function isViteBuildType(type: BuildType): type is ViteBuildType {
1832
+ return Object.values(ViteBuildTypeEnum).includes(type as ViteBuildTypeEnum);
1833
+ }
1834
+
1835
+ /** Type guard for Bun builds */
1836
+ export function isBunBuildType(type: BuildType): type is BunBuildType {
1837
+ return type === BunBuildTypeEnum.EXECUTABLE;
1838
+ }
1839
+
1840
+ // ============================================================================
1841
+ // Inferred Types from Definition Fields
1842
+ // ============================================================================
1843
+
1844
+ /** Request type inferred from POST definition */
1845
+ export type BuilderRequest = typeof POST.types.RequestOutput;
1846
+
1847
+ /** Response type inferred from POST definition */
1848
+ export type BuilderResponse = typeof POST.types.ResponseOutput;
1849
+
1850
+ /** API config object type inferred from POST definition fields */
1851
+ export type ApiConfigObject = NonNullable<BuilderRequest["configObject"]>;
1852
+
1853
+ /** File to compile type inferred from API definition */
1854
+ export type FileToCompile = NonNullable<
1855
+ ApiConfigObject["filesToCompile"]
1856
+ >[number];
1857
+
1858
+ /** Copy config type inferred from API definition */
1859
+ export type CopyConfig = NonNullable<
1860
+ ApiConfigObject["filesOrFoldersToCopy"]
1861
+ >[number];
1862
+
1863
+ /** NPM package config type inferred from API definition */
1864
+ export type NpmPackageConfig = NonNullable<ApiConfigObject["npmPackage"]>;
1865
+
1866
+ /** Bun build options type inferred from API definition */
1867
+ export type BunBuildOptions = NonNullable<FileToCompile["bunOptions"]>;
1868
+
1869
+ /** Vite options type inferred from API definition */
1870
+ export type ViteOptions = NonNullable<FileToCompile["viteOptions"]>;
1871
+
1872
+ /** Package config type inferred from API definition */
1873
+ export type PackageConfig = NonNullable<FileToCompile["packageConfig"]>;
1874
+
1875
+ /** Step timing type inferred from response */
1876
+ export type StepTiming = NonNullable<BuilderResponse["stepTimings"]>[number];
1877
+
1878
+ /** Build step result - internal type for tracking build steps */
1879
+ export interface BuildStepResult {
1880
+ step: string;
1881
+ success: boolean;
1882
+ duration: number;
1883
+ filesAffected?: string[];
1884
+ size?: number;
1885
+ warnings?: string[];
1886
+ }
1887
+
1888
+ /** Bundle analysis result */
1889
+ export interface BundleAnalysis {
1890
+ totalSize: number;
1891
+ files: Array<{ name: string; size: number; percentage: number }>;
1892
+ suggestions: string[];
1893
+ warnings: string[];
1894
+ }
1895
+
1896
+ /** Full build report */
1897
+ export interface BuildReport {
1898
+ timestamp: string;
1899
+ duration: number;
1900
+ profile: BuildProfile;
1901
+ success: boolean;
1902
+ steps: BuildStepResult[];
1903
+ files: { built: string[]; copied: string[] };
1904
+ bundleAnalysis?: BundleAnalysis;
1905
+ environment: { nodeVersion: string; platform: string; cwd: string };
1906
+ }
1907
+
1908
+ /** Build hook context */
1909
+ export interface BuildHookContext {
1910
+ config: BuildConfig;
1911
+ profile: BuildProfile;
1912
+ outputDir: string;
1913
+ /** Logger instance (EndpointLogger) */
1914
+ logger: {
1915
+ info: (message: string) => void;
1916
+ warn: (message: string) => void;
1917
+ error: (message: string) => void;
1918
+ debug: (message: string) => void;
1919
+ };
1920
+ addOutput: (message: string) => void;
1921
+ }
1922
+
1923
+ /** Build hook function */
1924
+ export type BuildHook = (context: BuildHookContext) => Promise<void> | void;
1925
+
1926
+ /** Full BuildConfig type - API config + runtime-only fields (hooks, env, profiles) */
1927
+ export interface BuildConfig extends Omit<
1928
+ ApiConfigObject,
1929
+ "filesToCompile" | "filesOrFoldersToCopy" | "npmPackage"
1930
+ > {
1931
+ foldersToClean?: string[];
1932
+ filesToCompile?: FileToCompile[];
1933
+ filesOrFoldersToCopy?: CopyConfig[];
1934
+ npmPackage?: NpmPackageConfig | null;
1935
+ hooks?: {
1936
+ preBuild?: BuildHook;
1937
+ postBuild?: BuildHook;
1938
+ onFileCompiled?: (filePath: string, size: number) => void;
1939
+ };
1940
+ env?: Record<string, string>;
1941
+ profiles?: Partial<Record<BuildProfile, Partial<BuildConfig>>>;
1942
+ }