@agentuity/cli 2.0.10 → 3.0.0-alpha.0

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 (353) hide show
  1. package/dist/cmd/ai/prompt/index.d.ts.map +1 -1
  2. package/dist/cmd/ai/prompt/index.js +2 -7
  3. package/dist/cmd/ai/prompt/index.js.map +1 -1
  4. package/dist/cmd/build/adapters/generic.d.ts +29 -0
  5. package/dist/cmd/build/adapters/generic.d.ts.map +1 -0
  6. package/dist/cmd/build/adapters/generic.js +190 -0
  7. package/dist/cmd/build/adapters/generic.js.map +1 -0
  8. package/dist/cmd/build/adapters/index.d.ts +15 -0
  9. package/dist/cmd/build/adapters/index.d.ts.map +1 -0
  10. package/dist/cmd/build/adapters/index.js +24 -0
  11. package/dist/cmd/build/adapters/index.js.map +1 -0
  12. package/dist/cmd/build/adapters/nextjs.d.ts +11 -0
  13. package/dist/cmd/build/adapters/nextjs.d.ts.map +1 -0
  14. package/dist/cmd/build/adapters/nextjs.js +118 -0
  15. package/dist/cmd/build/adapters/nextjs.js.map +1 -0
  16. package/dist/cmd/build/adapters/static-server.d.ts +23 -0
  17. package/dist/cmd/build/adapters/static-server.d.ts.map +1 -0
  18. package/dist/cmd/build/adapters/static-server.js +137 -0
  19. package/dist/cmd/build/adapters/static-server.js.map +1 -0
  20. package/dist/cmd/build/adapters/types.d.ts +71 -0
  21. package/dist/cmd/build/adapters/types.d.ts.map +1 -0
  22. package/dist/cmd/build/adapters/types.js +8 -0
  23. package/dist/cmd/build/adapters/types.js.map +1 -0
  24. package/dist/cmd/build/detect/engine.d.ts +24 -0
  25. package/dist/cmd/build/detect/engine.d.ts.map +1 -0
  26. package/dist/cmd/build/detect/engine.js +91 -0
  27. package/dist/cmd/build/detect/engine.js.map +1 -0
  28. package/dist/cmd/build/detect/frameworks.d.ts +66 -0
  29. package/dist/cmd/build/detect/frameworks.d.ts.map +1 -0
  30. package/dist/cmd/build/detect/frameworks.js +278 -0
  31. package/dist/cmd/build/detect/frameworks.js.map +1 -0
  32. package/dist/cmd/build/detect/generic.d.ts +13 -0
  33. package/dist/cmd/build/detect/generic.d.ts.map +1 -0
  34. package/dist/cmd/build/detect/generic.js +62 -0
  35. package/dist/cmd/build/detect/generic.js.map +1 -0
  36. package/dist/cmd/build/detect/index.d.ts +27 -0
  37. package/dist/cmd/build/detect/index.d.ts.map +1 -0
  38. package/dist/cmd/build/detect/index.js +76 -0
  39. package/dist/cmd/build/detect/index.js.map +1 -0
  40. package/dist/cmd/build/detect/types.d.ts +91 -0
  41. package/dist/cmd/build/detect/types.d.ts.map +1 -0
  42. package/dist/cmd/build/detect/types.js +9 -0
  43. package/dist/cmd/build/detect/types.js.map +1 -0
  44. package/dist/cmd/build/detect/util.d.ts +41 -0
  45. package/dist/cmd/build/detect/util.d.ts.map +1 -0
  46. package/dist/cmd/build/detect/util.js +101 -0
  47. package/dist/cmd/build/detect/util.js.map +1 -0
  48. package/dist/cmd/build/index.d.ts.map +1 -1
  49. package/dist/cmd/build/index.js +49 -22
  50. package/dist/cmd/build/index.js.map +1 -1
  51. package/dist/cmd/build/package/index.d.ts +30 -0
  52. package/dist/cmd/build/package/index.d.ts.map +1 -0
  53. package/dist/cmd/build/package/index.js +39 -0
  54. package/dist/cmd/build/package/index.js.map +1 -0
  55. package/dist/cmd/build/package/launch.d.ts +56 -0
  56. package/dist/cmd/build/package/launch.d.ts.map +1 -0
  57. package/dist/cmd/build/package/launch.js +56 -0
  58. package/dist/cmd/build/package/launch.js.map +1 -0
  59. package/dist/cmd/build/typecheck.d.ts.map +1 -1
  60. package/dist/cmd/build/typecheck.js +8 -0
  61. package/dist/cmd/build/typecheck.js.map +1 -1
  62. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  63. package/dist/cmd/cloud/deploy.js +63 -13
  64. package/dist/cmd/cloud/deploy.js.map +1 -1
  65. package/dist/cmd/coder/create.d.ts.map +1 -1
  66. package/dist/cmd/coder/create.js +18 -0
  67. package/dist/cmd/coder/create.js.map +1 -1
  68. package/dist/cmd/coder/index.d.ts.map +1 -1
  69. package/dist/cmd/coder/index.js +4 -0
  70. package/dist/cmd/coder/index.js.map +1 -1
  71. package/dist/cmd/coder/start.d.ts.map +1 -1
  72. package/dist/cmd/coder/start.js +49 -1
  73. package/dist/cmd/coder/start.js.map +1 -1
  74. package/dist/cmd/coder/update.d.ts.map +1 -1
  75. package/dist/cmd/coder/update.js +21 -1
  76. package/dist/cmd/coder/update.js.map +1 -1
  77. package/dist/cmd/coder/workspace/create.d.ts.map +1 -1
  78. package/dist/cmd/coder/workspace/create.js +17 -1
  79. package/dist/cmd/coder/workspace/create.js.map +1 -1
  80. package/dist/cmd/coder/workspace/list.js +2 -2
  81. package/dist/cmd/coder/workspace/list.js.map +1 -1
  82. package/dist/cmd/dev/index.d.ts +9 -0
  83. package/dist/cmd/dev/index.d.ts.map +1 -1
  84. package/dist/cmd/dev/index.js +127 -923
  85. package/dist/cmd/dev/index.js.map +1 -1
  86. package/dist/cmd/project/auth/shared.d.ts.map +1 -1
  87. package/dist/cmd/project/auth/shared.js +14 -38
  88. package/dist/cmd/project/auth/shared.js.map +1 -1
  89. package/dist/cmd/project/create.d.ts.map +1 -1
  90. package/dist/cmd/project/create.js +12 -19
  91. package/dist/cmd/project/create.js.map +1 -1
  92. package/dist/cmd/project/frameworks-ai-examples.d.ts +15 -0
  93. package/dist/cmd/project/frameworks-ai-examples.d.ts.map +1 -0
  94. package/dist/cmd/project/frameworks-ai-examples.js +160 -0
  95. package/dist/cmd/project/frameworks-ai-examples.js.map +1 -0
  96. package/dist/cmd/project/frameworks-landing-pages.d.ts +17 -0
  97. package/dist/cmd/project/frameworks-landing-pages.d.ts.map +1 -0
  98. package/dist/cmd/project/frameworks-landing-pages.js +242 -0
  99. package/dist/cmd/project/frameworks-landing-pages.js.map +1 -0
  100. package/dist/cmd/project/frameworks.d.ts +58 -0
  101. package/dist/cmd/project/frameworks.d.ts.map +1 -0
  102. package/dist/cmd/project/frameworks.js +152 -0
  103. package/dist/cmd/project/frameworks.js.map +1 -0
  104. package/dist/cmd/project/reconcile.d.ts.map +1 -1
  105. package/dist/cmd/project/reconcile.js +10 -23
  106. package/dist/cmd/project/reconcile.js.map +1 -1
  107. package/dist/cmd/project/remote-import.js +1 -1
  108. package/dist/cmd/project/scaffold.d.ts +58 -0
  109. package/dist/cmd/project/scaffold.d.ts.map +1 -0
  110. package/dist/cmd/project/scaffold.js +223 -0
  111. package/dist/cmd/project/scaffold.js.map +1 -0
  112. package/dist/cmd/project/template-flow.d.ts +8 -4
  113. package/dist/cmd/project/template-flow.d.ts.map +1 -1
  114. package/dist/cmd/project/template-flow.js +93 -144
  115. package/dist/cmd/project/template-flow.js.map +1 -1
  116. package/dist/deploy-metadata.d.ts +49 -0
  117. package/dist/deploy-metadata.d.ts.map +1 -0
  118. package/dist/deploy-metadata.js +183 -0
  119. package/dist/deploy-metadata.js.map +1 -0
  120. package/dist/index.d.ts +1 -1
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.js.map +1 -1
  123. package/dist/types.d.ts +25 -31
  124. package/dist/types.d.ts.map +1 -1
  125. package/dist/types.js.map +1 -1
  126. package/package.json +13 -8
  127. package/src/cmd/ai/prompt/index.ts +2 -7
  128. package/src/cmd/build/adapters/generic.ts +239 -0
  129. package/src/cmd/build/adapters/index.ts +30 -0
  130. package/src/cmd/build/adapters/nextjs.ts +146 -0
  131. package/src/cmd/build/adapters/static-server.ts +143 -0
  132. package/src/cmd/build/adapters/types.ts +93 -0
  133. package/src/cmd/build/detect/engine.ts +111 -0
  134. package/src/cmd/build/detect/frameworks.ts +335 -0
  135. package/src/cmd/build/detect/generic.ts +71 -0
  136. package/src/cmd/build/detect/index.ts +122 -0
  137. package/src/cmd/build/detect/types.ts +109 -0
  138. package/src/cmd/build/detect/util.ts +104 -0
  139. package/src/cmd/build/index.ts +64 -24
  140. package/src/cmd/build/package/index.ts +66 -0
  141. package/src/cmd/build/package/launch.ts +104 -0
  142. package/src/cmd/build/typecheck.ts +9 -0
  143. package/src/cmd/cloud/deploy.ts +86 -13
  144. package/src/cmd/coder/create.ts +24 -1
  145. package/src/cmd/coder/index.ts +4 -0
  146. package/src/cmd/coder/start.ts +60 -1
  147. package/src/cmd/coder/update.ts +18 -1
  148. package/src/cmd/coder/workspace/create.ts +20 -2
  149. package/src/cmd/coder/workspace/list.ts +2 -2
  150. package/src/cmd/dev/index.ts +155 -1059
  151. package/src/cmd/project/auth/shared.ts +14 -39
  152. package/src/cmd/project/create.ts +14 -19
  153. package/src/cmd/project/frameworks-ai-examples.ts +166 -0
  154. package/src/cmd/project/frameworks-landing-pages.ts +267 -0
  155. package/src/cmd/project/frameworks.ts +223 -0
  156. package/src/cmd/project/reconcile.ts +10 -22
  157. package/src/cmd/project/remote-import.ts +1 -1
  158. package/src/cmd/project/scaffold.ts +300 -0
  159. package/src/cmd/project/template-flow.ts +102 -156
  160. package/src/deploy-metadata.ts +253 -0
  161. package/src/index.ts +0 -2
  162. package/src/types.ts +0 -31
  163. package/dist/agents-docs.d.ts +0 -23
  164. package/dist/agents-docs.d.ts.map +0 -1
  165. package/dist/agents-docs.js +0 -56
  166. package/dist/agents-docs.js.map +0 -1
  167. package/dist/cmd/ai/prompt/agent.d.ts +0 -10
  168. package/dist/cmd/ai/prompt/agent.d.ts.map +0 -1
  169. package/dist/cmd/ai/prompt/agent.js +0 -28
  170. package/dist/cmd/ai/prompt/agent.js.map +0 -1
  171. package/dist/cmd/build/app-router-detector.d.ts +0 -39
  172. package/dist/cmd/build/app-router-detector.d.ts.map +0 -1
  173. package/dist/cmd/build/app-router-detector.js +0 -229
  174. package/dist/cmd/build/app-router-detector.js.map +0 -1
  175. package/dist/cmd/build/format-schema.d.ts +0 -6
  176. package/dist/cmd/build/format-schema.d.ts.map +0 -1
  177. package/dist/cmd/build/format-schema.js +0 -60
  178. package/dist/cmd/build/format-schema.js.map +0 -1
  179. package/dist/cmd/build/vite/agent-discovery.d.ts +0 -37
  180. package/dist/cmd/build/vite/agent-discovery.d.ts.map +0 -1
  181. package/dist/cmd/build/vite/agent-discovery.js +0 -263
  182. package/dist/cmd/build/vite/agent-discovery.js.map +0 -1
  183. package/dist/cmd/build/vite/beacon-plugin.d.ts +0 -19
  184. package/dist/cmd/build/vite/beacon-plugin.d.ts.map +0 -1
  185. package/dist/cmd/build/vite/beacon-plugin.js +0 -137
  186. package/dist/cmd/build/vite/beacon-plugin.js.map +0 -1
  187. package/dist/cmd/build/vite/browser-env-plugin.d.ts +0 -9
  188. package/dist/cmd/build/vite/browser-env-plugin.d.ts.map +0 -1
  189. package/dist/cmd/build/vite/browser-env-plugin.js +0 -28
  190. package/dist/cmd/build/vite/browser-env-plugin.js.map +0 -1
  191. package/dist/cmd/build/vite/bun-dev-server.d.ts +0 -67
  192. package/dist/cmd/build/vite/bun-dev-server.d.ts.map +0 -1
  193. package/dist/cmd/build/vite/bun-dev-server.js +0 -340
  194. package/dist/cmd/build/vite/bun-dev-server.js.map +0 -1
  195. package/dist/cmd/build/vite/bundle-files.d.ts +0 -12
  196. package/dist/cmd/build/vite/bundle-files.d.ts.map +0 -1
  197. package/dist/cmd/build/vite/bundle-files.js +0 -107
  198. package/dist/cmd/build/vite/bundle-files.js.map +0 -1
  199. package/dist/cmd/build/vite/config-loader.d.ts +0 -29
  200. package/dist/cmd/build/vite/config-loader.d.ts.map +0 -1
  201. package/dist/cmd/build/vite/config-loader.js +0 -57
  202. package/dist/cmd/build/vite/config-loader.js.map +0 -1
  203. package/dist/cmd/build/vite/db-rewrite.d.ts +0 -50
  204. package/dist/cmd/build/vite/db-rewrite.d.ts.map +0 -1
  205. package/dist/cmd/build/vite/db-rewrite.js +0 -169
  206. package/dist/cmd/build/vite/db-rewrite.js.map +0 -1
  207. package/dist/cmd/build/vite/docs-generator.d.ts +0 -13
  208. package/dist/cmd/build/vite/docs-generator.d.ts.map +0 -1
  209. package/dist/cmd/build/vite/docs-generator.js +0 -97
  210. package/dist/cmd/build/vite/docs-generator.js.map +0 -1
  211. package/dist/cmd/build/vite/env-types-generator.d.ts +0 -26
  212. package/dist/cmd/build/vite/env-types-generator.d.ts.map +0 -1
  213. package/dist/cmd/build/vite/env-types-generator.js +0 -110
  214. package/dist/cmd/build/vite/env-types-generator.js.map +0 -1
  215. package/dist/cmd/build/vite/index.d.ts +0 -3
  216. package/dist/cmd/build/vite/index.d.ts.map +0 -1
  217. package/dist/cmd/build/vite/index.js +0 -4
  218. package/dist/cmd/build/vite/index.js.map +0 -1
  219. package/dist/cmd/build/vite/lifecycle-generator.d.ts +0 -19
  220. package/dist/cmd/build/vite/lifecycle-generator.d.ts.map +0 -1
  221. package/dist/cmd/build/vite/lifecycle-generator.js +0 -328
  222. package/dist/cmd/build/vite/lifecycle-generator.js.map +0 -1
  223. package/dist/cmd/build/vite/metadata-generator.d.ts +0 -36
  224. package/dist/cmd/build/vite/metadata-generator.d.ts.map +0 -1
  225. package/dist/cmd/build/vite/metadata-generator.js +0 -575
  226. package/dist/cmd/build/vite/metadata-generator.js.map +0 -1
  227. package/dist/cmd/build/vite/prompt-generator.d.ts +0 -23
  228. package/dist/cmd/build/vite/prompt-generator.d.ts.map +0 -1
  229. package/dist/cmd/build/vite/prompt-generator.js +0 -123
  230. package/dist/cmd/build/vite/prompt-generator.js.map +0 -1
  231. package/dist/cmd/build/vite/public-asset-path-plugin.d.ts +0 -45
  232. package/dist/cmd/build/vite/public-asset-path-plugin.d.ts.map +0 -1
  233. package/dist/cmd/build/vite/public-asset-path-plugin.js +0 -166
  234. package/dist/cmd/build/vite/public-asset-path-plugin.js.map +0 -1
  235. package/dist/cmd/build/vite/route-discovery.d.ts +0 -64
  236. package/dist/cmd/build/vite/route-discovery.d.ts.map +0 -1
  237. package/dist/cmd/build/vite/route-discovery.js +0 -187
  238. package/dist/cmd/build/vite/route-discovery.js.map +0 -1
  239. package/dist/cmd/build/vite/server-bundler.d.ts +0 -20
  240. package/dist/cmd/build/vite/server-bundler.d.ts.map +0 -1
  241. package/dist/cmd/build/vite/server-bundler.js +0 -388
  242. package/dist/cmd/build/vite/server-bundler.js.map +0 -1
  243. package/dist/cmd/build/vite/static-renderer.d.ts +0 -26
  244. package/dist/cmd/build/vite/static-renderer.d.ts.map +0 -1
  245. package/dist/cmd/build/vite/static-renderer.js +0 -188
  246. package/dist/cmd/build/vite/static-renderer.js.map +0 -1
  247. package/dist/cmd/build/vite/tailwind-source-plugin.d.ts +0 -15
  248. package/dist/cmd/build/vite/tailwind-source-plugin.d.ts.map +0 -1
  249. package/dist/cmd/build/vite/tailwind-source-plugin.js +0 -61
  250. package/dist/cmd/build/vite/tailwind-source-plugin.js.map +0 -1
  251. package/dist/cmd/build/vite/vite-asset-server-config.d.ts +0 -24
  252. package/dist/cmd/build/vite/vite-asset-server-config.d.ts.map +0 -1
  253. package/dist/cmd/build/vite/vite-asset-server-config.js +0 -285
  254. package/dist/cmd/build/vite/vite-asset-server-config.js.map +0 -1
  255. package/dist/cmd/build/vite/vite-asset-server.d.ts +0 -30
  256. package/dist/cmd/build/vite/vite-asset-server.d.ts.map +0 -1
  257. package/dist/cmd/build/vite/vite-asset-server.js +0 -109
  258. package/dist/cmd/build/vite/vite-asset-server.js.map +0 -1
  259. package/dist/cmd/build/vite/vite-builder.d.ts +0 -59
  260. package/dist/cmd/build/vite/vite-builder.d.ts.map +0 -1
  261. package/dist/cmd/build/vite/vite-builder.js +0 -401
  262. package/dist/cmd/build/vite/vite-builder.js.map +0 -1
  263. package/dist/cmd/build/vite/workbench-generator.d.ts +0 -10
  264. package/dist/cmd/build/vite/workbench-generator.d.ts.map +0 -1
  265. package/dist/cmd/build/vite/workbench-generator.js +0 -135
  266. package/dist/cmd/build/vite/workbench-generator.js.map +0 -1
  267. package/dist/cmd/build/vite/ws-proxy.d.ts +0 -53
  268. package/dist/cmd/build/vite/ws-proxy.d.ts.map +0 -1
  269. package/dist/cmd/build/vite/ws-proxy.js +0 -95
  270. package/dist/cmd/build/vite/ws-proxy.js.map +0 -1
  271. package/dist/cmd/build/vite-bundler.d.ts +0 -29
  272. package/dist/cmd/build/vite-bundler.d.ts.map +0 -1
  273. package/dist/cmd/build/vite-bundler.js +0 -93
  274. package/dist/cmd/build/vite-bundler.js.map +0 -1
  275. package/dist/cmd/dev/agents.d.ts +0 -2
  276. package/dist/cmd/dev/agents.d.ts.map +0 -1
  277. package/dist/cmd/dev/agents.js +0 -123
  278. package/dist/cmd/dev/agents.js.map +0 -1
  279. package/dist/cmd/dev/api.d.ts +0 -20
  280. package/dist/cmd/dev/api.d.ts.map +0 -1
  281. package/dist/cmd/dev/api.js +0 -42
  282. package/dist/cmd/dev/api.js.map +0 -1
  283. package/dist/cmd/dev/dev-lock.d.ts +0 -62
  284. package/dist/cmd/dev/dev-lock.d.ts.map +0 -1
  285. package/dist/cmd/dev/dev-lock.js +0 -250
  286. package/dist/cmd/dev/dev-lock.js.map +0 -1
  287. package/dist/cmd/dev/download.d.ts +0 -11
  288. package/dist/cmd/dev/download.d.ts.map +0 -1
  289. package/dist/cmd/dev/download.js +0 -94
  290. package/dist/cmd/dev/download.js.map +0 -1
  291. package/dist/cmd/dev/file-watcher.d.ts +0 -24
  292. package/dist/cmd/dev/file-watcher.d.ts.map +0 -1
  293. package/dist/cmd/dev/file-watcher.js +0 -349
  294. package/dist/cmd/dev/file-watcher.js.map +0 -1
  295. package/dist/cmd/dev/process-manager.d.ts +0 -104
  296. package/dist/cmd/dev/process-manager.d.ts.map +0 -1
  297. package/dist/cmd/dev/process-manager.js +0 -204
  298. package/dist/cmd/dev/process-manager.js.map +0 -1
  299. package/dist/cmd/dev/sync.d.ts +0 -12
  300. package/dist/cmd/dev/sync.d.ts.map +0 -1
  301. package/dist/cmd/dev/sync.js +0 -227
  302. package/dist/cmd/dev/sync.js.map +0 -1
  303. package/dist/cmd/dev/templates.d.ts +0 -3
  304. package/dist/cmd/dev/templates.d.ts.map +0 -1
  305. package/dist/cmd/dev/templates.js +0 -58
  306. package/dist/cmd/dev/templates.js.map +0 -1
  307. package/dist/cmd/project/download.d.ts +0 -35
  308. package/dist/cmd/project/download.d.ts.map +0 -1
  309. package/dist/cmd/project/download.js +0 -403
  310. package/dist/cmd/project/download.js.map +0 -1
  311. package/dist/cmd/project/templates.d.ts +0 -9
  312. package/dist/cmd/project/templates.d.ts.map +0 -1
  313. package/dist/cmd/project/templates.js +0 -34
  314. package/dist/cmd/project/templates.js.map +0 -1
  315. package/src/agents-docs.ts +0 -86
  316. package/src/cmd/ai/prompt/agent.md +0 -305
  317. package/src/cmd/ai/prompt/agent.ts +0 -31
  318. package/src/cmd/build/app-router-detector.ts +0 -320
  319. package/src/cmd/build/format-schema.ts +0 -66
  320. package/src/cmd/build/vite/agent-discovery.ts +0 -380
  321. package/src/cmd/build/vite/beacon-plugin.ts +0 -164
  322. package/src/cmd/build/vite/browser-env-plugin.ts +0 -34
  323. package/src/cmd/build/vite/bun-dev-server.ts +0 -458
  324. package/src/cmd/build/vite/bundle-files.ts +0 -135
  325. package/src/cmd/build/vite/config-loader.ts +0 -76
  326. package/src/cmd/build/vite/db-rewrite.ts +0 -189
  327. package/src/cmd/build/vite/docs-generator.ts +0 -103
  328. package/src/cmd/build/vite/env-types-generator.ts +0 -145
  329. package/src/cmd/build/vite/index.ts +0 -3
  330. package/src/cmd/build/vite/lifecycle-generator.ts +0 -381
  331. package/src/cmd/build/vite/metadata-generator.ts +0 -713
  332. package/src/cmd/build/vite/prompt-generator.ts +0 -169
  333. package/src/cmd/build/vite/public-asset-path-plugin.ts +0 -209
  334. package/src/cmd/build/vite/route-discovery.ts +0 -271
  335. package/src/cmd/build/vite/server-bundler.ts +0 -481
  336. package/src/cmd/build/vite/static-renderer.ts +0 -239
  337. package/src/cmd/build/vite/tailwind-source-plugin.ts +0 -73
  338. package/src/cmd/build/vite/vite-asset-server-config.ts +0 -349
  339. package/src/cmd/build/vite/vite-asset-server.ts +0 -154
  340. package/src/cmd/build/vite/vite-builder.ts +0 -503
  341. package/src/cmd/build/vite/workbench-generator.ts +0 -152
  342. package/src/cmd/build/vite/ws-proxy.ts +0 -126
  343. package/src/cmd/build/vite-bundler.ts +0 -137
  344. package/src/cmd/dev/agents.ts +0 -140
  345. package/src/cmd/dev/api.ts +0 -65
  346. package/src/cmd/dev/dev-lock.ts +0 -332
  347. package/src/cmd/dev/download.ts +0 -117
  348. package/src/cmd/dev/file-watcher.ts +0 -423
  349. package/src/cmd/dev/process-manager.ts +0 -261
  350. package/src/cmd/dev/sync.ts +0 -411
  351. package/src/cmd/dev/templates.ts +0 -66
  352. package/src/cmd/project/download.ts +0 -505
  353. package/src/cmd/project/templates.ts +0 -56
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Framework Detection
3
+ *
4
+ * Examines a project directory and determines which JS framework is being used.
5
+ * Returns a DetectedFramework with all the information needed to build and launch.
6
+ *
7
+ * Detection strategy:
8
+ * 1. Run the framework database engine (rules derived from @vercel/frameworks)
9
+ * 2. Fall back to generic detection (package.json scripts)
10
+ */
11
+
12
+ import type { DetectedFramework, PackageJsonData } from './types';
13
+ import { readPackageJson, detectPackageManager } from './util';
14
+ import { frameworkDefinitions } from './frameworks';
15
+ import { detectFromDatabase } from './engine';
16
+ import { genericDetector } from './generic';
17
+
18
+ /**
19
+ * Convert a matched framework definition + project context into a DetectedFramework.
20
+ */
21
+ async function frameworkDefToDetected(
22
+ slug: string,
23
+ _name: string,
24
+ buildCommand: string | null,
25
+ outputDirectory: string | null,
26
+ staticDirectory: string | null | undefined,
27
+ projectDir: string,
28
+ pkg: PackageJsonData
29
+ ): Promise<DetectedFramework> {
30
+ const pm = await detectPackageManager(projectDir);
31
+
32
+ // Use the project's build script if available, otherwise the framework default
33
+ const resolvedBuildCommand = pkg.scripts?.build ?? buildCommand ?? 'npm run build';
34
+
35
+ // Resolve output directory — use framework default or '.'
36
+ const resolvedOutputDir = outputDirectory ?? '.';
37
+
38
+ // Resolve static asset directory (relative to project root):
39
+ // - explicit string: path relative to project root (e.g., '.next/static', '.output/public')
40
+ // - null: the entire output directory is static (SSGs, SPAs) — use outputDirectory
41
+ // - undefined: no static assets known for this framework
42
+ const resolvedStaticDir =
43
+ staticDirectory === null
44
+ ? resolvedOutputDir // null means entire output IS the static dir
45
+ : (staticDirectory ?? undefined);
46
+
47
+ return {
48
+ name: slug,
49
+ runtime: 'node',
50
+ packageManager: pm,
51
+ buildCommand: resolvedBuildCommand,
52
+ buildOutput: resolvedOutputDir,
53
+ staticDir: resolvedStaticDir,
54
+ confidence: 'high',
55
+ };
56
+ }
57
+
58
+ /**
59
+ * Detect the framework used by a project.
60
+ *
61
+ * @param projectDir - Absolute path to the project root
62
+ * @returns DetectedFramework or null if nothing could be detected
63
+ */
64
+ export async function detectFramework(projectDir: string): Promise<DetectedFramework | null> {
65
+ const pkg = await readPackageJson(projectDir);
66
+ if (!pkg) return null;
67
+
68
+ // 1. Run through the framework database
69
+ const match = await detectFromDatabase(projectDir, pkg, frameworkDefinitions);
70
+ if (match) {
71
+ return frameworkDefToDetected(
72
+ match.slug,
73
+ match.name,
74
+ match.buildCommand,
75
+ match.outputDirectory,
76
+ match.staticDir,
77
+ projectDir,
78
+ pkg
79
+ );
80
+ }
81
+
82
+ // 2. Generic fallback
83
+ return genericDetector.detect(projectDir, pkg);
84
+ }
85
+
86
+ /**
87
+ * Detect the framework, but also return the parsed package.json for reuse.
88
+ */
89
+ export async function detectFrameworkWithPackageJson(
90
+ projectDir: string
91
+ ): Promise<{ framework: DetectedFramework | null; packageJson: PackageJsonData | null }> {
92
+ const pkg = await readPackageJson(projectDir);
93
+ if (!pkg) return { framework: null, packageJson: null };
94
+
95
+ // 1. Run through the framework database
96
+ const match = await detectFromDatabase(projectDir, pkg, frameworkDefinitions);
97
+ if (match) {
98
+ const framework = await frameworkDefToDetected(
99
+ match.slug,
100
+ match.name,
101
+ match.buildCommand,
102
+ match.outputDirectory,
103
+ match.staticDir,
104
+ projectDir,
105
+ pkg
106
+ );
107
+ return { framework, packageJson: pkg };
108
+ }
109
+
110
+ // 2. Generic fallback
111
+ const generic = await genericDetector.detect(projectDir, pkg);
112
+ return { framework: generic, packageJson: pkg };
113
+ }
114
+
115
+ // Re-export types
116
+ export type {
117
+ DetectedFramework,
118
+ FrameworkName,
119
+ PackageJsonData,
120
+ PackageManager,
121
+ RuntimeName,
122
+ } from './types';
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Framework detection types.
3
+ *
4
+ * These types define the contract between detection, adapters, and packaging.
5
+ * The detection system identifies what JS framework a project uses,
6
+ * and adapters know how to build and launch each framework.
7
+ */
8
+
9
+ /**
10
+ * Framework identifier.
11
+ *
12
+ * This is a string rather than a union type because the framework database
13
+ * (derived from @vercel/frameworks) contains 25+ slugs and may grow.
14
+ * Special values:
15
+ * - 'generic' — Fallback: has package.json with build/start scripts
16
+ */
17
+ export type FrameworkName = string;
18
+
19
+ /**
20
+ * Runtime that executes the built application.
21
+ */
22
+ export type RuntimeName = 'node' | 'bun';
23
+
24
+ /**
25
+ * Package manager detected or preferred.
26
+ */
27
+ export type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn';
28
+
29
+ /**
30
+ * Result of framework detection.
31
+ *
32
+ * This is the output of the detect phase and input to the adapter/build phase.
33
+ */
34
+ export interface DetectedFramework {
35
+ /** Framework identifier */
36
+ name: FrameworkName;
37
+
38
+ /** Human-readable framework version (e.g., "15.3.0" for Next.js) */
39
+ version?: string;
40
+
41
+ /** Runtime that runs the production server */
42
+ runtime: RuntimeName;
43
+
44
+ /** Detected package manager */
45
+ packageManager: PackageManager;
46
+
47
+ /** The build command to execute (e.g., "next build", "vite build") */
48
+ buildCommand: string;
49
+
50
+ /** Directory where build output is written (relative to project root) */
51
+ buildOutput: string;
52
+
53
+ /** Command to start the production server (only for mode='server') */
54
+ startCommand?: string;
55
+
56
+ /** Server entrypoint file (relative to buildOutput) */
57
+ serverEntry?: string;
58
+
59
+ /**
60
+ * Static/CDN asset directory (relative to project root).
61
+ * After the build runs, this directory contains files suitable for CDN upload.
62
+ * For pure SSGs/SPAs this equals buildOutput (entire output is static).
63
+ * For SSR frameworks this is a subdirectory (e.g., `.next/static`, `.output/public`).
64
+ */
65
+ staticDir?: string;
66
+
67
+ /** Environment variables needed at build time */
68
+ buildEnv?: Record<string, string>;
69
+
70
+ /** Port the app listens on (default: 3000) */
71
+ port?: number;
72
+
73
+ /** Detection confidence: 'high' if config file found, 'low' if inferred */
74
+ confidence: 'high' | 'medium' | 'low';
75
+ }
76
+
77
+ /**
78
+ * A single framework detector.
79
+ *
80
+ * Each detector examines the project directory and returns a DetectedFramework
81
+ * if it recognizes the project, or null if it doesn't apply.
82
+ */
83
+ export interface FrameworkDetector {
84
+ /** Framework this detector handles */
85
+ name: FrameworkName;
86
+
87
+ /** Priority (lower = checked first). Specific frameworks before generic. */
88
+ priority: number;
89
+
90
+ /**
91
+ * Examine the project and return detection result, or null if not applicable.
92
+ */
93
+ detect(projectDir: string, packageJson: PackageJsonData): Promise<DetectedFramework | null>;
94
+ }
95
+
96
+ /**
97
+ * Parsed package.json data relevant to detection.
98
+ */
99
+ export interface PackageJsonData {
100
+ name?: string;
101
+ version?: string;
102
+ scripts?: Record<string, string>;
103
+ dependencies?: Record<string, string>;
104
+ devDependencies?: Record<string, string>;
105
+ main?: string;
106
+ module?: string;
107
+ type?: string;
108
+ engines?: Record<string, string>;
109
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Detection utilities shared across framework detectors.
3
+ */
4
+
5
+ import { join } from 'node:path';
6
+ import type { PackageJsonData, PackageManager } from './types';
7
+
8
+ /**
9
+ * Check if a file exists (any of the given names) in a directory.
10
+ * Returns the first matching filename, or null.
11
+ */
12
+ export async function findFile(dir: string, names: string[]): Promise<string | null> {
13
+ for (const name of names) {
14
+ const file = Bun.file(join(dir, name));
15
+ if (await file.exists()) {
16
+ return name;
17
+ }
18
+ }
19
+ return null;
20
+ }
21
+
22
+ /**
23
+ * Check if a dependency exists in package.json (dependencies or devDependencies).
24
+ */
25
+ export function hasDependency(pkg: PackageJsonData, name: string): boolean {
26
+ return !!(pkg.dependencies?.[name] || pkg.devDependencies?.[name]);
27
+ }
28
+
29
+ /**
30
+ * Get the version of a dependency from package.json.
31
+ * Returns the version range string, or null if not found.
32
+ */
33
+ export function getDependencyVersion(pkg: PackageJsonData, name: string): string | null {
34
+ return pkg.dependencies?.[name] ?? pkg.devDependencies?.[name] ?? null;
35
+ }
36
+
37
+ /**
38
+ * Check if any dependency matching a pattern exists.
39
+ */
40
+ export function hasDependencyMatching(pkg: PackageJsonData, pattern: RegExp): boolean {
41
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
42
+ return Object.keys(allDeps).some((name) => pattern.test(name));
43
+ }
44
+
45
+ /**
46
+ * Detect which package manager the project uses by checking lockfiles.
47
+ */
48
+ export async function detectPackageManager(projectDir: string): Promise<PackageManager> {
49
+ if (await Bun.file(join(projectDir, 'bun.lockb')).exists()) return 'bun';
50
+ if (await Bun.file(join(projectDir, 'bun.lock')).exists()) return 'bun';
51
+ if (await Bun.file(join(projectDir, 'pnpm-lock.yaml')).exists()) return 'pnpm';
52
+ if (await Bun.file(join(projectDir, 'yarn.lock')).exists()) return 'yarn';
53
+ if (await Bun.file(join(projectDir, 'package-lock.json')).exists()) return 'npm';
54
+
55
+ // Default to bun (our preferred runtime)
56
+ return 'bun';
57
+ }
58
+
59
+ /**
60
+ * Get the run command prefix for a package manager.
61
+ * e.g., 'npm run', 'bun run', 'pnpm run', 'yarn'
62
+ */
63
+ export function getRunCommand(pm: PackageManager): string {
64
+ switch (pm) {
65
+ case 'bun':
66
+ return 'bun run';
67
+ case 'npm':
68
+ return 'npm run';
69
+ case 'pnpm':
70
+ return 'pnpm run';
71
+ case 'yarn':
72
+ return 'yarn';
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Get the exec command prefix for a package manager (npx/bunx/etc.).
78
+ */
79
+ export function getExecCommand(pm: PackageManager): string {
80
+ switch (pm) {
81
+ case 'bun':
82
+ return 'bunx';
83
+ case 'npm':
84
+ return 'npx';
85
+ case 'pnpm':
86
+ return 'pnpm exec';
87
+ case 'yarn':
88
+ return 'yarn dlx';
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Read and parse package.json from a directory.
94
+ * Returns null if not found or unparseable.
95
+ */
96
+ export async function readPackageJson(dir: string): Promise<PackageJsonData | null> {
97
+ const file = Bun.file(join(dir, 'package.json'));
98
+ if (!(await file.exists())) return null;
99
+ try {
100
+ return (await file.json()) as PackageJsonData;
101
+ } catch {
102
+ return null;
103
+ }
104
+ }
@@ -1,13 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import { resolve, join, relative } from 'node:path';
3
3
  import { createCommand, DeployOptionsSchema } from '../../types';
4
- import { viteBundle } from './vite-bundler';
5
4
  import * as tui from '../../tui';
6
5
  import { getCommand } from '../../command-prefix';
7
6
  import { ErrorCode } from '../../errors';
8
7
  import { typecheck } from './typecheck';
9
8
  import { BuildReportCollector, setGlobalCollector, clearGlobalCollector } from '../../build-report';
10
- import { detectVersionMismatch, formatVersionMismatchWarning } from '../../utils/version-mismatch';
9
+ import { detectFrameworkWithPackageJson } from './detect';
10
+ import { getAdapter } from './adapters';
11
+ import { packageBuildOutput } from './package';
11
12
 
12
13
  const BuildResponseSchema = z.object({
13
14
  success: z.boolean().describe('Whether the build succeeded'),
@@ -15,6 +16,7 @@ const BuildResponseSchema = z.object({
15
16
  projectName: z.string().describe('Project name'),
16
17
  dev: z.boolean().describe('Whether dev mode was enabled'),
17
18
  size: z.number().optional().describe('Build size in bytes'),
19
+ framework: z.string().optional().describe('Detected framework name'),
18
20
  });
19
21
 
20
22
  const BuildOptionsSchema = z.intersection(
@@ -58,6 +60,10 @@ export const command = createCommand({
58
60
  const { opts, projectDir, project } = ctx;
59
61
 
60
62
  if (opts.ci) {
63
+ if (!opts.url) {
64
+ tui.fatal('--url is required when using --ci mode', ErrorCode.CONFIG_INVALID);
65
+ }
66
+
61
67
  const { runCIBuild } = await import('./ci');
62
68
  await runCIBuild(
63
69
  {
@@ -95,37 +101,72 @@ export const command = createCommand({
95
101
  }
96
102
 
97
103
  const absoluteProjectDir = resolve(projectDir);
98
-
99
- // Check for version mismatches (v1 vs v2 SDK packages)
100
- const versionMismatch = detectVersionMismatch(absoluteProjectDir, ctx.logger);
101
- if (versionMismatch.hasV1Packages || versionMismatch.hasMajorMismatches) {
102
- tui.newline();
103
- tui.warning(formatVersionMismatchWarning(versionMismatch));
104
- tui.newline();
105
- }
106
-
107
104
  const outDir = opts.outdir ? resolve(opts.outdir) : join(absoluteProjectDir, '.agentuity');
108
105
 
109
106
  try {
110
107
  const rel = outDir.startsWith(absoluteProjectDir)
111
108
  ? relative(absoluteProjectDir, outDir)
112
109
  : outDir;
113
- tui.info(`Building project with Vite at ${absoluteProjectDir} to ${rel}`);
114
110
 
115
- await viteBundle({
116
- rootDir: absoluteProjectDir,
117
- dev: opts.dev || false,
111
+ // Step 1: Detect framework
112
+ tui.info('Detecting framework...');
113
+ const { framework, packageJson } =
114
+ await detectFrameworkWithPackageJson(absoluteProjectDir);
115
+
116
+ if (!framework) {
117
+ collector.addGeneralError(
118
+ 'build',
119
+ 'Could not detect a JS framework. Ensure package.json exists with a build script.',
120
+ 'BUILD010'
121
+ );
122
+ if (opts.reportFile) {
123
+ await collector.forceWrite();
124
+ }
125
+ clearGlobalCollector();
126
+ tui.fatal(
127
+ 'Could not detect a JS framework. Ensure package.json exists with a build script.',
128
+ ErrorCode.BUILD_FAILED
129
+ );
130
+ }
131
+
132
+ const frameworkLabel = framework.version
133
+ ? `${framework.name} v${framework.version}`
134
+ : framework.name;
135
+ tui.success(`Detected ${tui.bold(frameworkLabel)} (${framework.runtime})`);
136
+
137
+ // Step 2: Get the build adapter for this framework
138
+ const adapter = getAdapter(framework.name);
139
+ tui.info(`Building with ${adapter.name} adapter to ${rel}`);
140
+
141
+ // Step 3: Run the build
142
+ const endBuildDiagnostic = collector.startDiagnostic('build');
143
+ const buildResult = await adapter.build({
144
+ projectDir: absoluteProjectDir,
145
+ framework,
146
+ packageJson: packageJson!,
147
+ outputDir: outDir,
148
+ logger: ctx.logger,
149
+ collector,
150
+ dev: opts.dev,
118
151
  projectId: project?.projectId,
119
152
  orgId: project?.orgId,
120
153
  region: project?.region ?? 'local',
121
- logger: ctx.logger,
122
- collector,
123
154
  });
155
+ endBuildDiagnostic();
156
+
157
+ // Log build output
158
+ for (const line of buildResult.logs) {
159
+ tui.info(tui.muted(line));
160
+ }
161
+
162
+ // Step 4: Package the output with launch metadata
163
+ const packageResult = packageBuildOutput(framework, buildResult, buildResult.outputDir);
164
+ ctx.logger.debug('Launch metadata: %s', JSON.stringify(packageResult.launch, null, 2));
124
165
 
125
- // Copy profile-specific .env file AFTER bundling (bundler clears outDir first)
166
+ // Step 5: Copy profile-specific .env file AFTER building
126
167
  if (opts.dev && ctx.config?.name) {
127
168
  const envSourcePath = join(absoluteProjectDir, `.env.${ctx.config.name}`);
128
- const envDestPath = join(outDir, '.env');
169
+ const envDestPath = join(buildResult.outputDir, '.env');
129
170
 
130
171
  const envFile = Bun.file(envSourcePath);
131
172
  if (await envFile.exists()) {
@@ -136,7 +177,7 @@ export const command = createCommand({
136
177
  }
137
178
  }
138
179
 
139
- // Run TypeScript type checking after registry generation (skip in dev mode)
180
+ // Step 6: Run TypeScript type checking (skip in dev mode, skip for non-TS projects)
140
181
  if (!opts.dev && !opts.skipTypeCheck) {
141
182
  try {
142
183
  tui.info('Running type check...');
@@ -153,7 +194,6 @@ export const command = createCommand({
153
194
  const msg =
154
195
  'errors' in typeResult ? 'Fix type errors before building' : 'Build error';
155
196
 
156
- // Write report before fatal exit
157
197
  if (opts.reportFile) {
158
198
  await collector.forceWrite();
159
199
  }
@@ -164,7 +204,6 @@ export const command = createCommand({
164
204
  const errorMsg = error instanceof Error ? error.message : String(error);
165
205
  collector.addGeneralError('typescript', errorMsg, 'BUILD008');
166
206
 
167
- // Write report before fatal exit
168
207
  if (opts.reportFile) {
169
208
  await collector.forceWrite();
170
209
  }
@@ -178,7 +217,7 @@ export const command = createCommand({
178
217
  }
179
218
  }
180
219
 
181
- tui.success('Build complete');
220
+ tui.success(`Build complete (${frameworkLabel}, ${buildResult.duration}ms)`);
182
221
 
183
222
  // Write final report on success
184
223
  if (opts.reportFile) {
@@ -188,9 +227,10 @@ export const command = createCommand({
188
227
 
189
228
  return {
190
229
  success: true,
191
- bundlePath: outDir,
230
+ bundlePath: buildResult.outputDir,
192
231
  projectName: project?.projectId || 'unknown',
193
232
  dev: opts.dev || false,
233
+ framework: framework.name,
194
234
  };
195
235
  } catch (error: unknown) {
196
236
  // Add error to collector
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Build output packaging.
3
+ *
4
+ * After a framework adapter builds the project, the packager:
5
+ * 1. Generates launch metadata (how to start the app)
6
+ * 2. Writes a Procfile for compatibility
7
+ * 3. Optionally generates additional metadata
8
+ *
9
+ * The output is a self-contained directory ready for deployment
10
+ * as a buildpack image layer or traditional zip upload.
11
+ */
12
+
13
+ import { join } from 'node:path';
14
+ import { writeFileSync } from 'node:fs';
15
+ import type { DetectedFramework } from '../detect/types';
16
+ import type { BuildResult } from '../adapters/types';
17
+ import { generateLaunchMetadata, writeLaunchMetadata, type LaunchMetadata } from './launch';
18
+
19
+ export interface PackageResult {
20
+ /** Absolute path to the packaged output */
21
+ outputDir: string;
22
+
23
+ /** Launch metadata */
24
+ launch: LaunchMetadata;
25
+
26
+ /** Whether the output contains static assets */
27
+ hasStaticAssets: boolean;
28
+
29
+ /** Path to static assets (if any) */
30
+ staticDir?: string;
31
+ }
32
+
33
+ /**
34
+ * Package a build result into a deployment-ready directory.
35
+ */
36
+ export function packageBuildOutput(
37
+ framework: DetectedFramework,
38
+ buildResult: BuildResult,
39
+ outputDir: string
40
+ ): PackageResult {
41
+ // Generate launch metadata
42
+ const launch = generateLaunchMetadata(framework, buildResult);
43
+
44
+ // Write launch metadata to the output directory
45
+ writeLaunchMetadata(outputDir, launch);
46
+
47
+ // Write a .buildpack-ready marker file
48
+ const markerPath = join(outputDir, '.agentuity-build');
49
+ const markerContent = {
50
+ version: 1,
51
+ framework: framework.name,
52
+ runtime: framework.runtime,
53
+ buildDate: new Date().toISOString(),
54
+ };
55
+ writeFileSync(markerPath, JSON.stringify(markerContent, null, 2), 'utf-8');
56
+
57
+ return {
58
+ outputDir,
59
+ launch,
60
+ hasStaticAssets: !!buildResult.staticDir,
61
+ staticDir: buildResult.staticDir,
62
+ };
63
+ }
64
+
65
+ // Re-export
66
+ export type { LaunchMetadata, ProcessDefinition } from './launch';
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Launch metadata generation for buildpack-compatible output.
3
+ *
4
+ * Generates the metadata that tells the runtime how to start the application.
5
+ * This is analogous to CNB's launch.toml / Procfile / Docker CMD.
6
+ */
7
+
8
+ import { join } from 'node:path';
9
+ import { mkdirSync, writeFileSync } from 'node:fs';
10
+ import type { BuildResult } from '../adapters/types';
11
+ import type { DetectedFramework } from '../detect/types';
12
+
13
+ /**
14
+ * Process definition for the launch metadata.
15
+ */
16
+ export interface ProcessDefinition {
17
+ /** Process type (e.g., 'web', 'worker') */
18
+ type: string;
19
+ /** Command to execute */
20
+ command: string;
21
+ /** Whether this is the default process */
22
+ default: boolean;
23
+ /** Working directory (relative to app root) */
24
+ workingDirectory?: string;
25
+ }
26
+
27
+ /**
28
+ * Complete launch metadata written to the output directory.
29
+ */
30
+ export interface LaunchMetadata {
31
+ /** Application processes */
32
+ processes: ProcessDefinition[];
33
+ /** Framework that was detected */
34
+ framework: {
35
+ name: string;
36
+ version?: string;
37
+ };
38
+ /** Runtime information */
39
+ runtime: {
40
+ name: string;
41
+ port?: number;
42
+ };
43
+ /** Build information */
44
+ build: {
45
+ date: string;
46
+ duration: number;
47
+ };
48
+ }
49
+
50
+ /**
51
+ * Generate launch metadata from a build result and detected framework.
52
+ */
53
+ export function generateLaunchMetadata(
54
+ framework: DetectedFramework,
55
+ buildResult: BuildResult
56
+ ): LaunchMetadata {
57
+ const processes: ProcessDefinition[] = [];
58
+
59
+ // Primary web process
60
+ const startCommand = buildResult.startCommand ?? framework.startCommand;
61
+ if (startCommand) {
62
+ processes.push({
63
+ type: 'web',
64
+ command: startCommand,
65
+ default: true,
66
+ });
67
+ }
68
+
69
+ return {
70
+ processes,
71
+ framework: {
72
+ name: framework.name,
73
+ version: framework.version,
74
+ },
75
+ runtime: {
76
+ name: framework.runtime,
77
+ port: buildResult.port ?? framework.port,
78
+ },
79
+ build: {
80
+ date: new Date().toISOString(),
81
+ duration: buildResult.duration,
82
+ },
83
+ };
84
+ }
85
+
86
+ /**
87
+ * Write launch metadata to the output directory.
88
+ *
89
+ * Writes both:
90
+ * - launch.json — machine-readable launch metadata
91
+ * - Procfile — simple process definition for compatibility
92
+ */
93
+ export function writeLaunchMetadata(outputDir: string, metadata: LaunchMetadata): void {
94
+ mkdirSync(outputDir, { recursive: true });
95
+
96
+ // Write JSON metadata
97
+ const jsonPath = join(outputDir, 'launch.json');
98
+ writeFileSync(jsonPath, JSON.stringify(metadata, null, 2), 'utf-8');
99
+
100
+ // Write Procfile for broad compatibility (Heroku, Railway, Render, etc.)
101
+ const procfilePath = join(outputDir, 'Procfile');
102
+ const procfileLines = metadata.processes.map((p) => `${p.type}: ${p.command}`);
103
+ writeFileSync(procfilePath, procfileLines.join('\n') + '\n', 'utf-8');
104
+ }
@@ -1,3 +1,4 @@
1
+ import { join } from 'node:path';
1
2
  import { parse, type GrammarItem } from '../../tsc-output-parser';
2
3
  import { formatTypeScriptErrors, hasErrors } from '../../typescript-errors';
3
4
  import type { BuildReportCollector } from '../../build-report';
@@ -73,6 +74,14 @@ function filterNodeModulesErrors(output: string): string {
73
74
  * @returns
74
75
  */
75
76
  export async function typecheck(dir: string, options?: TypecheckOptions): Promise<TypeResult> {
77
+ // Skip typecheck for projects without tsconfig.json (plain JS projects)
78
+ const tsconfigPath = join(dir, 'tsconfig.json');
79
+ const tsconfigFile = Bun.file(tsconfigPath);
80
+ const tsconfigExists = await tsconfigFile.exists();
81
+ if (!tsconfigExists) {
82
+ return { success: true };
83
+ }
84
+
76
85
  const { collector } = options ?? {};
77
86
  const result = await Bun.$`bunx tsc --noEmit --skipLibCheck --pretty false`
78
87
  .cwd(dir)