everything-dev 1.53.1 → 2.0.0-rc.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 (713) hide show
  1. package/README.md +2 -11
  2. package/dist/_virtual/_rolldown/runtime.cjs +17 -2
  3. package/dist/_virtual/_rolldown/runtime.mjs +36 -0
  4. package/dist/api/auth-middleware.cjs +161 -0
  5. package/dist/api/auth-middleware.cjs.map +1 -0
  6. package/dist/api/auth-middleware.d.cts +69 -0
  7. package/dist/api/auth-middleware.d.mts +69 -0
  8. package/dist/api/auth-middleware.mjs +160 -0
  9. package/dist/api/auth-middleware.mjs.map +1 -0
  10. package/dist/api-contract.cjs +250 -62
  11. package/dist/api-contract.cjs.map +1 -1
  12. package/dist/api-contract.mjs +246 -65
  13. package/dist/api-contract.mjs.map +1 -1
  14. package/dist/app.cjs +99 -26
  15. package/dist/app.cjs.map +1 -1
  16. package/dist/app.d.cts +3 -0
  17. package/dist/app.d.mts +3 -0
  18. package/dist/app.mjs +100 -27
  19. package/dist/app.mjs.map +1 -1
  20. package/dist/auth-login.cjs +163 -0
  21. package/dist/auth-login.cjs.map +1 -0
  22. package/dist/auth-login.mjs +162 -0
  23. package/dist/auth-login.mjs.map +1 -0
  24. package/dist/auth-session.cjs +64 -0
  25. package/dist/auth-session.cjs.map +1 -0
  26. package/dist/auth-session.mjs +58 -0
  27. package/dist/auth-session.mjs.map +1 -0
  28. package/dist/auth-types-gen.cjs +0 -1
  29. package/dist/auth-types-gen.cjs.map +1 -1
  30. package/dist/build.cjs +37 -173
  31. package/dist/build.cjs.map +1 -1
  32. package/dist/build.mjs +37 -171
  33. package/dist/build.mjs.map +1 -1
  34. package/dist/bundle-cache.cjs +74 -0
  35. package/dist/bundle-cache.cjs.map +1 -0
  36. package/dist/bundle-cache.d.cts +27 -0
  37. package/dist/bundle-cache.d.mts +27 -0
  38. package/dist/bundle-cache.mjs +68 -0
  39. package/dist/bundle-cache.mjs.map +1 -0
  40. package/dist/bundle-fs-resolve.cjs +209 -0
  41. package/dist/bundle-fs-resolve.cjs.map +1 -0
  42. package/dist/bundle-fs-resolve.d.cts +76 -0
  43. package/dist/bundle-fs-resolve.d.mts +76 -0
  44. package/dist/bundle-fs-resolve.mjs +202 -0
  45. package/dist/bundle-fs-resolve.mjs.map +1 -0
  46. package/dist/cdn-deploy.cjs +126 -0
  47. package/dist/cdn-deploy.cjs.map +1 -0
  48. package/dist/cdn-deploy.mjs +124 -0
  49. package/dist/cdn-deploy.mjs.map +1 -0
  50. package/dist/cli/db-doctor.cjs +19 -19
  51. package/dist/cli/db-doctor.cjs.map +1 -1
  52. package/dist/cli/db-doctor.mjs +18 -18
  53. package/dist/cli/db-doctor.mjs.map +1 -1
  54. package/dist/cli/db-repair.cjs +9 -32
  55. package/dist/cli/db-repair.cjs.map +1 -1
  56. package/dist/cli/db-repair.mjs +9 -32
  57. package/dist/cli/db-repair.mjs.map +1 -1
  58. package/dist/cli/framework-version.cjs +7 -3
  59. package/dist/cli/framework-version.cjs.map +1 -1
  60. package/dist/cli/framework-version.mjs +7 -3
  61. package/dist/cli/framework-version.mjs.map +1 -1
  62. package/dist/cli/infra.cjs +159 -251
  63. package/dist/cli/infra.cjs.map +1 -1
  64. package/dist/cli/infra.mjs +154 -242
  65. package/dist/cli/infra.mjs.map +1 -1
  66. package/dist/cli/init.cjs +624 -196
  67. package/dist/cli/init.cjs.map +1 -1
  68. package/dist/cli/init.d.cts +61 -8
  69. package/dist/cli/init.d.mts +61 -8
  70. package/dist/cli/init.mjs +613 -194
  71. package/dist/cli/init.mjs.map +1 -1
  72. package/dist/cli/parse.cjs +8 -7
  73. package/dist/cli/parse.cjs.map +1 -1
  74. package/dist/cli/parse.mjs +9 -7
  75. package/dist/cli/parse.mjs.map +1 -1
  76. package/dist/cli/prompts.cjs +14 -1
  77. package/dist/cli/prompts.cjs.map +1 -1
  78. package/dist/cli/prompts.mjs +14 -1
  79. package/dist/cli/prompts.mjs.map +1 -1
  80. package/dist/cli/prune.cjs +220 -0
  81. package/dist/cli/prune.cjs.map +1 -0
  82. package/dist/cli/prune.mjs +220 -0
  83. package/dist/cli/prune.mjs.map +1 -0
  84. package/dist/cli/snapshot.cjs +2 -1
  85. package/dist/cli/snapshot.cjs.map +1 -1
  86. package/dist/cli/snapshot.mjs +2 -1
  87. package/dist/cli/snapshot.mjs.map +1 -1
  88. package/dist/cli/status.cjs +5 -4
  89. package/dist/cli/status.cjs.map +1 -1
  90. package/dist/cli/status.mjs +6 -5
  91. package/dist/cli/status.mjs.map +1 -1
  92. package/dist/cli/sync.cjs +156 -58
  93. package/dist/cli/sync.cjs.map +1 -1
  94. package/dist/cli/sync.mjs +158 -63
  95. package/dist/cli/sync.mjs.map +1 -1
  96. package/dist/cli/timing.cjs +0 -1
  97. package/dist/cli/timing.cjs.map +1 -1
  98. package/dist/cli/upgrade.cjs +95 -69
  99. package/dist/cli/upgrade.cjs.map +1 -1
  100. package/dist/cli/upgrade.mjs +97 -72
  101. package/dist/cli/upgrade.mjs.map +1 -1
  102. package/dist/cli/utils/helpers.cjs.map +1 -1
  103. package/dist/cli.cjs +320 -72
  104. package/dist/cli.cjs.map +1 -1
  105. package/dist/cli.mjs +316 -68
  106. package/dist/cli.mjs.map +1 -1
  107. package/dist/code-artifacts.cjs +76 -8
  108. package/dist/code-artifacts.cjs.map +1 -1
  109. package/dist/code-artifacts.mjs +76 -10
  110. package/dist/code-artifacts.mjs.map +1 -1
  111. package/dist/commands/build.cjs +65 -0
  112. package/dist/commands/build.cjs.map +1 -0
  113. package/dist/commands/build.mjs +65 -0
  114. package/dist/commands/build.mjs.map +1 -0
  115. package/dist/commands/config.cjs +77 -0
  116. package/dist/commands/config.cjs.map +1 -0
  117. package/dist/commands/config.d.cts +8 -0
  118. package/dist/commands/config.d.mts +8 -0
  119. package/dist/commands/config.mjs +74 -0
  120. package/dist/commands/config.mjs.map +1 -0
  121. package/dist/commands/db.cjs +107 -0
  122. package/dist/commands/db.cjs.map +1 -0
  123. package/dist/commands/db.mjs +107 -0
  124. package/dist/commands/db.mjs.map +1 -0
  125. package/dist/commands/deploy.cjs +336 -0
  126. package/dist/commands/deploy.cjs.map +1 -0
  127. package/dist/commands/deploy.mjs +334 -0
  128. package/dist/commands/deploy.mjs.map +1 -0
  129. package/dist/commands/dev.cjs +75 -0
  130. package/dist/commands/dev.cjs.map +1 -0
  131. package/dist/commands/dev.mjs +73 -0
  132. package/dist/commands/dev.mjs.map +1 -0
  133. package/dist/commands/init.cjs +234 -0
  134. package/dist/commands/init.cjs.map +1 -0
  135. package/dist/commands/init.mjs +231 -0
  136. package/dist/commands/init.mjs.map +1 -0
  137. package/dist/commands/keys.cjs +255 -0
  138. package/dist/commands/keys.cjs.map +1 -0
  139. package/dist/commands/keys.mjs +253 -0
  140. package/dist/commands/keys.mjs.map +1 -0
  141. package/dist/commands/ops.cjs +199 -0
  142. package/dist/commands/ops.cjs.map +1 -0
  143. package/dist/commands/ops.mjs +197 -0
  144. package/dist/commands/ops.mjs.map +1 -0
  145. package/dist/commands/plugins.cjs +211 -0
  146. package/dist/commands/plugins.cjs.map +1 -0
  147. package/dist/commands/plugins.mjs +211 -0
  148. package/dist/commands/plugins.mjs.map +1 -0
  149. package/dist/commands/shared.cjs +8 -0
  150. package/dist/commands/shared.cjs.map +1 -0
  151. package/dist/commands/shared.d.cts +6 -0
  152. package/dist/commands/shared.d.mts +6 -0
  153. package/dist/commands/shared.mjs +8 -0
  154. package/dist/commands/shared.mjs.map +1 -0
  155. package/dist/commands/upgrade.cjs +325 -0
  156. package/dist/commands/upgrade.cjs.map +1 -0
  157. package/dist/commands/upgrade.mjs +323 -0
  158. package/dist/commands/upgrade.mjs.map +1 -0
  159. package/dist/components/dev-render.cjs +340 -0
  160. package/dist/components/dev-render.cjs.map +1 -0
  161. package/dist/components/dev-render.mjs +332 -0
  162. package/dist/components/dev-render.mjs.map +1 -0
  163. package/dist/config.cjs +460 -221
  164. package/dist/config.cjs.map +1 -1
  165. package/dist/config.d.cts +491 -48
  166. package/dist/config.d.mts +491 -48
  167. package/dist/config.mjs +439 -212
  168. package/dist/config.mjs.map +1 -1
  169. package/dist/contract.cjs +327 -50
  170. package/dist/contract.cjs.map +1 -1
  171. package/dist/contract.d.cts +1951 -1062
  172. package/dist/contract.d.mts +1951 -1062
  173. package/dist/contract.meta.cjs +107 -12
  174. package/dist/contract.meta.cjs.map +1 -1
  175. package/dist/contract.meta.d.cts +166 -8
  176. package/dist/contract.meta.d.mts +166 -8
  177. package/dist/contract.meta.mjs +107 -11
  178. package/dist/contract.meta.mjs.map +1 -1
  179. package/dist/contract.mjs +580 -327
  180. package/dist/contract.mjs.map +1 -1
  181. package/dist/dag.cjs +5 -3
  182. package/dist/dag.cjs.map +1 -1
  183. package/dist/dag.mjs +6 -3
  184. package/dist/dag.mjs.map +1 -1
  185. package/dist/db/binding.cjs +80 -0
  186. package/dist/db/binding.cjs.map +1 -0
  187. package/dist/db/binding.d.cts +39 -0
  188. package/dist/db/binding.d.mts +39 -0
  189. package/dist/db/binding.mjs +78 -0
  190. package/dist/db/binding.mjs.map +1 -0
  191. package/dist/db/bindings.cjs +78 -0
  192. package/dist/db/bindings.cjs.map +1 -0
  193. package/dist/db/bindings.d.cts +34 -0
  194. package/dist/db/bindings.d.mts +34 -0
  195. package/dist/db/bindings.mjs +76 -0
  196. package/dist/db/bindings.mjs.map +1 -0
  197. package/dist/db/core.cjs +204 -0
  198. package/dist/db/core.cjs.map +1 -0
  199. package/dist/db/core.d.cts +69 -0
  200. package/dist/db/core.d.mts +69 -0
  201. package/dist/db/core.mjs +192 -0
  202. package/dist/db/core.mjs.map +1 -0
  203. package/dist/db/driver.cjs +167 -0
  204. package/dist/db/driver.cjs.map +1 -0
  205. package/dist/db/driver.d.cts +50 -0
  206. package/dist/db/driver.d.mts +50 -0
  207. package/dist/db/driver.mjs +165 -0
  208. package/dist/db/driver.mjs.map +1 -0
  209. package/dist/db/drizzle-kit.cjs +177 -0
  210. package/dist/db/drizzle-kit.cjs.map +1 -0
  211. package/dist/db/drizzle-kit.d.cts +25 -0
  212. package/dist/db/drizzle-kit.d.mts +25 -0
  213. package/dist/db/drizzle-kit.mjs +175 -0
  214. package/dist/db/drizzle-kit.mjs.map +1 -0
  215. package/dist/db/errors.cjs +27 -0
  216. package/dist/db/errors.cjs.map +1 -0
  217. package/dist/db/errors.d.cts +16 -0
  218. package/dist/db/errors.d.mts +16 -0
  219. package/dist/db/errors.mjs +26 -0
  220. package/dist/db/errors.mjs.map +1 -0
  221. package/dist/db/identity.cjs +55 -0
  222. package/dist/db/identity.cjs.map +1 -0
  223. package/dist/db/identity.d.cts +40 -0
  224. package/dist/db/identity.d.mts +40 -0
  225. package/dist/db/identity.mjs +53 -0
  226. package/dist/db/identity.mjs.map +1 -0
  227. package/dist/db/index.cjs +43 -0
  228. package/dist/db/index.d.cts +9 -0
  229. package/dist/db/index.d.mts +9 -0
  230. package/dist/db/index.mjs +10 -0
  231. package/dist/db/run-migrations.cjs +343 -0
  232. package/dist/db/run-migrations.cjs.map +1 -0
  233. package/dist/db/run-migrations.d.cts +87 -0
  234. package/dist/db/run-migrations.d.mts +87 -0
  235. package/dist/db/run-migrations.mjs +341 -0
  236. package/dist/db/run-migrations.mjs.map +1 -0
  237. package/dist/delegate-signer.cjs +85 -0
  238. package/dist/delegate-signer.cjs.map +1 -0
  239. package/dist/delegate-signer.mjs +84 -0
  240. package/dist/delegate-signer.mjs.map +1 -0
  241. package/dist/deploy-diff.cjs +119 -0
  242. package/dist/deploy-diff.cjs.map +1 -0
  243. package/dist/deploy-diff.mjs +109 -0
  244. package/dist/deploy-diff.mjs.map +1 -0
  245. package/dist/descriptor/constructors.cjs +49 -0
  246. package/dist/descriptor/constructors.cjs.map +1 -0
  247. package/dist/descriptor/constructors.d.cts +27 -0
  248. package/dist/descriptor/constructors.d.mts +27 -0
  249. package/dist/descriptor/constructors.mjs +45 -0
  250. package/dist/descriptor/constructors.mjs.map +1 -0
  251. package/dist/descriptor/index.cjs +24 -0
  252. package/dist/descriptor/index.d.cts +5 -0
  253. package/dist/descriptor/index.d.mts +5 -0
  254. package/dist/descriptor/index.mjs +6 -0
  255. package/dist/descriptor/resolve.cjs +258 -0
  256. package/dist/descriptor/resolve.cjs.map +1 -0
  257. package/dist/descriptor/resolve.d.cts +50 -0
  258. package/dist/descriptor/resolve.d.mts +50 -0
  259. package/dist/descriptor/resolve.mjs +252 -0
  260. package/dist/descriptor/resolve.mjs.map +1 -0
  261. package/dist/descriptor/schema.cjs +109 -0
  262. package/dist/descriptor/schema.cjs.map +1 -0
  263. package/dist/descriptor/schema.d.cts +217 -0
  264. package/dist/descriptor/schema.d.mts +217 -0
  265. package/dist/descriptor/schema.mjs +102 -0
  266. package/dist/descriptor/schema.mjs.map +1 -0
  267. package/dist/descriptor/serialize.cjs +45 -0
  268. package/dist/descriptor/serialize.cjs.map +1 -0
  269. package/dist/descriptor/serialize.d.cts +7 -0
  270. package/dist/descriptor/serialize.d.mts +7 -0
  271. package/dist/descriptor/serialize.mjs +45 -0
  272. package/dist/descriptor/serialize.mjs.map +1 -0
  273. package/dist/dev-log-pipeline.cjs +273 -0
  274. package/dist/dev-log-pipeline.cjs.map +1 -0
  275. package/dist/dev-log-pipeline.mjs +267 -0
  276. package/dist/dev-log-pipeline.mjs.map +1 -0
  277. package/dist/dev-logs.cjs +39 -8
  278. package/dist/dev-logs.cjs.map +1 -1
  279. package/dist/dev-logs.mjs +37 -9
  280. package/dist/dev-logs.mjs.map +1 -1
  281. package/dist/dev-program.cjs +405 -0
  282. package/dist/dev-program.cjs.map +1 -0
  283. package/dist/dev-program.d.cts +10 -0
  284. package/dist/dev-program.d.mts +10 -0
  285. package/dist/dev-program.mjs +395 -0
  286. package/dist/dev-program.mjs.map +1 -0
  287. package/dist/dev-session-data.d.cts +27 -0
  288. package/dist/dev-session-data.d.mts +27 -0
  289. package/dist/dev-session.cjs +178 -105
  290. package/dist/dev-session.cjs.map +1 -1
  291. package/dist/dev-session.mjs +180 -105
  292. package/dist/dev-session.mjs.map +1 -1
  293. package/dist/env/process-env.cjs +16 -0
  294. package/dist/env/process-env.cjs.map +1 -0
  295. package/dist/env/process-env.mjs +13 -0
  296. package/dist/env/process-env.mjs.map +1 -0
  297. package/dist/env/project-env.cjs +144 -0
  298. package/dist/env/project-env.cjs.map +1 -0
  299. package/dist/env/project-env.d.cts +1 -0
  300. package/dist/env/project-env.d.mts +1 -0
  301. package/dist/env/project-env.mjs +132 -0
  302. package/dist/env/project-env.mjs.map +1 -0
  303. package/dist/fastkv.cjs +59 -12
  304. package/dist/fastkv.cjs.map +1 -1
  305. package/dist/fastkv.d.cts +42 -6
  306. package/dist/fastkv.d.mts +42 -6
  307. package/dist/fastkv.mjs +58 -13
  308. package/dist/fastkv.mjs.map +1 -1
  309. package/dist/fingerprint.cjs +57 -0
  310. package/dist/fingerprint.cjs.map +1 -0
  311. package/dist/fingerprint.d.cts +14 -0
  312. package/dist/fingerprint.d.mts +14 -0
  313. package/dist/fingerprint.mjs +55 -0
  314. package/dist/fingerprint.mjs.map +1 -0
  315. package/dist/http-client.cjs +17 -17
  316. package/dist/http-client.cjs.map +1 -1
  317. package/dist/http-client.mjs +17 -17
  318. package/dist/http-client.mjs.map +1 -1
  319. package/dist/image-deploy.cjs +186 -0
  320. package/dist/image-deploy.cjs.map +1 -0
  321. package/dist/image-deploy.mjs +182 -0
  322. package/dist/image-deploy.mjs.map +1 -0
  323. package/dist/index.cjs +66 -18
  324. package/dist/index.d.cts +8 -7
  325. package/dist/index.d.mts +8 -7
  326. package/dist/index.mjs +6 -5
  327. package/dist/infra/docker.cjs +77 -0
  328. package/dist/infra/docker.cjs.map +1 -0
  329. package/dist/infra/docker.d.cts +10 -0
  330. package/dist/infra/docker.d.mts +10 -0
  331. package/dist/infra/docker.mjs +69 -0
  332. package/dist/infra/docker.mjs.map +1 -0
  333. package/dist/infra/materializer.cjs +74 -0
  334. package/dist/infra/materializer.cjs.map +1 -0
  335. package/dist/infra/materializer.mjs +70 -0
  336. package/dist/infra/materializer.mjs.map +1 -0
  337. package/dist/infra/planner.cjs +135 -103
  338. package/dist/infra/planner.cjs.map +1 -1
  339. package/dist/infra/planner.mjs +137 -104
  340. package/dist/infra/planner.mjs.map +1 -1
  341. package/dist/infra/port-ownership.cjs +57 -0
  342. package/dist/infra/port-ownership.cjs.map +1 -0
  343. package/dist/infra/port-ownership.mjs +57 -0
  344. package/dist/infra/port-ownership.mjs.map +1 -0
  345. package/dist/infra/preflight.cjs +45 -33
  346. package/dist/infra/preflight.cjs.map +1 -1
  347. package/dist/infra/preflight.d.cts +1 -0
  348. package/dist/infra/preflight.d.mts +1 -0
  349. package/dist/infra/preflight.mjs +46 -34
  350. package/dist/infra/preflight.mjs.map +1 -1
  351. package/dist/infra/types.cjs.map +1 -1
  352. package/dist/infra/types.d.cts +2 -0
  353. package/dist/infra/types.d.mts +2 -0
  354. package/dist/infra/types.mjs.map +1 -1
  355. package/dist/integrity.cjs +50 -61
  356. package/dist/integrity.cjs.map +1 -1
  357. package/dist/integrity.d.cts +16 -10
  358. package/dist/integrity.d.mts +16 -10
  359. package/dist/integrity.mjs +50 -59
  360. package/dist/integrity.mjs.map +1 -1
  361. package/dist/internal/manifest-normalizer.cjs +8 -2
  362. package/dist/internal/manifest-normalizer.cjs.map +1 -1
  363. package/dist/internal/manifest-normalizer.mjs +9 -3
  364. package/dist/internal/manifest-normalizer.mjs.map +1 -1
  365. package/dist/merge.cjs +19 -1
  366. package/dist/merge.cjs.map +1 -1
  367. package/dist/merge.d.cts +1 -1
  368. package/dist/merge.d.mts +1 -1
  369. package/dist/merge.mjs +19 -2
  370. package/dist/merge.mjs.map +1 -1
  371. package/dist/mf.cjs +190 -3
  372. package/dist/mf.cjs.map +1 -1
  373. package/dist/mf.d.cts +24 -2
  374. package/dist/mf.d.mts +24 -2
  375. package/dist/mf.mjs +189 -4
  376. package/dist/mf.mjs.map +1 -1
  377. package/dist/near-cli.cjs +59 -91
  378. package/dist/near-cli.cjs.map +1 -1
  379. package/dist/near-cli.mjs +58 -90
  380. package/dist/near-cli.mjs.map +1 -1
  381. package/dist/near-signer.cjs +73 -0
  382. package/dist/near-signer.cjs.map +1 -0
  383. package/dist/near-signer.mjs +70 -0
  384. package/dist/near-signer.mjs.map +1 -0
  385. package/dist/network.cjs +0 -1
  386. package/dist/network.cjs.map +1 -1
  387. package/dist/orchestrator.cjs +256 -87
  388. package/dist/orchestrator.cjs.map +1 -1
  389. package/dist/orchestrator.mjs +248 -87
  390. package/dist/orchestrator.mjs.map +1 -1
  391. package/dist/platform-deploy.cjs +81 -0
  392. package/dist/platform-deploy.cjs.map +1 -0
  393. package/dist/platform-deploy.mjs +80 -0
  394. package/dist/platform-deploy.mjs.map +1 -0
  395. package/dist/plugin.cjs +54 -1389
  396. package/dist/plugin.cjs.map +1 -1
  397. package/dist/plugin.d.cts +6 -896
  398. package/dist/plugin.d.mts +6 -896
  399. package/dist/plugin.mjs +53 -1387
  400. package/dist/plugin.mjs.map +1 -1
  401. package/dist/process-kill.cjs +44 -0
  402. package/dist/process-kill.cjs.map +1 -0
  403. package/dist/process-kill.mjs +43 -0
  404. package/dist/process-kill.mjs.map +1 -0
  405. package/dist/process-registry.cjs +64 -9
  406. package/dist/process-registry.cjs.map +1 -1
  407. package/dist/process-registry.mjs +61 -10
  408. package/dist/process-registry.mjs.map +1 -1
  409. package/dist/progress.cjs +45 -0
  410. package/dist/progress.cjs.map +1 -0
  411. package/dist/progress.d.cts +13 -0
  412. package/dist/progress.d.mts +13 -0
  413. package/dist/progress.mjs +42 -0
  414. package/dist/progress.mjs.map +1 -0
  415. package/dist/publish.cjs +513 -79
  416. package/dist/publish.cjs.map +1 -1
  417. package/dist/publish.mjs +515 -82
  418. package/dist/publish.mjs.map +1 -1
  419. package/dist/registry-use.cjs +41 -0
  420. package/dist/registry-use.cjs.map +1 -0
  421. package/dist/registry-use.mjs +40 -0
  422. package/dist/registry-use.mjs.map +1 -0
  423. package/dist/resolution/session.cjs +335 -0
  424. package/dist/resolution/session.cjs.map +1 -0
  425. package/dist/resolution/session.d.cts +105 -0
  426. package/dist/resolution/session.d.mts +105 -0
  427. package/dist/resolution/session.mjs +331 -0
  428. package/dist/resolution/session.mjs.map +1 -0
  429. package/dist/rollback.cjs +131 -0
  430. package/dist/rollback.cjs.map +1 -0
  431. package/dist/rollback.mjs +128 -0
  432. package/dist/rollback.mjs.map +1 -0
  433. package/dist/sdk.cjs +7 -7
  434. package/dist/sdk.d.cts +3 -3
  435. package/dist/sdk.d.mts +3 -3
  436. package/dist/sdk.mjs +2 -2
  437. package/dist/service-descriptor.cjs +67 -34
  438. package/dist/service-descriptor.cjs.map +1 -1
  439. package/dist/service-descriptor.d.cts +4 -1
  440. package/dist/service-descriptor.d.mts +3 -0
  441. package/dist/service-descriptor.mjs +63 -35
  442. package/dist/service-descriptor.mjs.map +1 -1
  443. package/dist/shared-deps.cjs +17 -16
  444. package/dist/shared-deps.cjs.map +1 -1
  445. package/dist/shared-deps.mjs +17 -16
  446. package/dist/shared-deps.mjs.map +1 -1
  447. package/dist/start-config-source.cjs +24 -0
  448. package/dist/start-config-source.cjs.map +1 -0
  449. package/dist/start-config-source.d.cts +29 -0
  450. package/dist/start-config-source.d.mts +29 -0
  451. package/dist/start-config-source.mjs +22 -0
  452. package/dist/start-config-source.mjs.map +1 -0
  453. package/dist/storage-upload.cjs +145 -0
  454. package/dist/storage-upload.cjs.map +1 -0
  455. package/dist/storage-upload.mjs +143 -0
  456. package/dist/storage-upload.mjs.map +1 -0
  457. package/dist/types.cjs +126 -20
  458. package/dist/types.cjs.map +1 -1
  459. package/dist/types.d.cts +867 -585
  460. package/dist/types.d.mts +867 -585
  461. package/dist/types.mjs +307 -208
  462. package/dist/types.mjs.map +1 -1
  463. package/dist/ui/api.cjs +105 -0
  464. package/dist/ui/api.cjs.map +1 -0
  465. package/dist/ui/api.d.cts +31 -0
  466. package/dist/ui/api.d.mts +31 -0
  467. package/dist/ui/api.mjs +99 -0
  468. package/dist/ui/api.mjs.map +1 -0
  469. package/dist/ui/auth-guards.cjs +50 -0
  470. package/dist/ui/auth-guards.cjs.map +1 -0
  471. package/dist/ui/auth-guards.d.cts +39 -0
  472. package/dist/ui/auth-guards.d.mts +39 -0
  473. package/dist/ui/auth-guards.mjs +48 -0
  474. package/dist/ui/auth-guards.mjs.map +1 -0
  475. package/dist/ui/auth.cjs +197 -0
  476. package/dist/ui/auth.cjs.map +1 -0
  477. package/dist/ui/auth.d.cts +56 -0
  478. package/dist/ui/auth.d.mts +56 -0
  479. package/dist/ui/auth.mjs +179 -0
  480. package/dist/ui/auth.mjs.map +1 -0
  481. package/dist/ui/entry.cjs +16 -0
  482. package/dist/ui/entry.cjs.map +1 -0
  483. package/dist/ui/entry.d.cts +12 -0
  484. package/dist/ui/entry.d.mts +12 -0
  485. package/dist/ui/entry.mjs +15 -0
  486. package/dist/ui/entry.mjs.map +1 -0
  487. package/dist/ui/head.cjs +14 -7
  488. package/dist/ui/head.cjs.map +1 -1
  489. package/dist/ui/head.mjs +15 -7
  490. package/dist/ui/head.mjs.map +1 -1
  491. package/dist/ui/hydrate.cjs +265 -0
  492. package/dist/ui/hydrate.cjs.map +1 -0
  493. package/dist/ui/hydrate.d.cts +48 -0
  494. package/dist/ui/hydrate.d.mts +48 -0
  495. package/dist/ui/hydrate.mjs +263 -0
  496. package/dist/ui/hydrate.mjs.map +1 -0
  497. package/dist/ui/i18n.cjs +153 -0
  498. package/dist/ui/i18n.cjs.map +1 -0
  499. package/dist/ui/i18n.d.cts +29 -0
  500. package/dist/ui/i18n.d.mts +29 -0
  501. package/dist/ui/i18n.mjs +140 -0
  502. package/dist/ui/i18n.mjs.map +1 -0
  503. package/dist/ui/index.cjs +19 -1
  504. package/dist/ui/index.d.cts +6 -3
  505. package/dist/ui/index.d.mts +6 -3
  506. package/dist/ui/index.mjs +5 -2
  507. package/dist/ui/locale.cjs +53 -0
  508. package/dist/ui/locale.cjs.map +1 -0
  509. package/dist/ui/locale.d.cts +18 -0
  510. package/dist/ui/locale.d.mts +18 -0
  511. package/dist/ui/locale.mjs +49 -0
  512. package/dist/ui/locale.mjs.map +1 -0
  513. package/dist/ui/manifest/index.cjs +25 -0
  514. package/dist/ui/manifest/index.cjs.map +1 -0
  515. package/dist/ui/manifest/index.d.cts +9 -0
  516. package/dist/ui/manifest/index.d.mts +9 -0
  517. package/dist/ui/manifest/index.mjs +13 -0
  518. package/dist/ui/manifest/index.mjs.map +1 -0
  519. package/dist/ui/manifest-generator.cjs +8 -0
  520. package/dist/ui/manifest-generator.d.cts +1 -0
  521. package/dist/ui/manifest-generator.d.mts +1 -0
  522. package/dist/ui/manifest-generator.mjs +3 -0
  523. package/dist/ui/message-catalogs.cjs +8 -0
  524. package/dist/ui/message-catalogs.cjs.map +1 -0
  525. package/dist/ui/message-catalogs.d.cts +5 -0
  526. package/dist/ui/message-catalogs.d.mts +5 -0
  527. package/dist/ui/message-catalogs.mjs +8 -0
  528. package/dist/ui/message-catalogs.mjs.map +1 -0
  529. package/dist/ui/metadata.cjs +0 -1
  530. package/dist/ui/metadata.cjs.map +1 -1
  531. package/dist/ui/metadata.d.cts +1 -1
  532. package/dist/ui/metadata.d.mts +1 -1
  533. package/dist/ui/plugin-path.cjs +37 -0
  534. package/dist/ui/plugin-path.cjs.map +1 -0
  535. package/dist/ui/plugin-path.d.cts +25 -0
  536. package/dist/ui/plugin-path.d.mts +25 -0
  537. package/dist/ui/plugin-path.mjs +35 -0
  538. package/dist/ui/plugin-path.mjs.map +1 -0
  539. package/dist/ui/router-client.cjs +61 -0
  540. package/dist/ui/router-client.cjs.map +1 -0
  541. package/dist/ui/router-client.d.cts +20 -0
  542. package/dist/ui/router-client.d.mts +20 -0
  543. package/dist/ui/router-client.mjs +60 -0
  544. package/dist/ui/router-client.mjs.map +1 -0
  545. package/dist/ui/router-defaults.cjs +48 -0
  546. package/dist/ui/router-defaults.cjs.map +1 -0
  547. package/dist/ui/router-defaults.d.cts +8 -0
  548. package/dist/ui/router-defaults.d.mts +8 -0
  549. package/dist/ui/router-defaults.mjs +45 -0
  550. package/dist/ui/router-defaults.mjs.map +1 -0
  551. package/dist/ui/router-error.cjs +70 -0
  552. package/dist/ui/router-error.cjs.map +1 -0
  553. package/dist/ui/router-error.d.cts +19 -0
  554. package/dist/ui/router-error.d.mts +19 -0
  555. package/dist/ui/router-error.mjs +69 -0
  556. package/dist/ui/router-error.mjs.map +1 -0
  557. package/dist/ui/router-server.cjs +153 -0
  558. package/dist/ui/router-server.cjs.map +1 -0
  559. package/dist/ui/router-server.d.cts +38 -0
  560. package/dist/ui/router-server.d.mts +38 -0
  561. package/dist/ui/router-server.mjs +152 -0
  562. package/dist/ui/router-server.mjs.map +1 -0
  563. package/dist/ui/router.cjs +4 -16
  564. package/dist/ui/router.cjs.map +1 -1
  565. package/dist/ui/router.mjs +4 -15
  566. package/dist/ui/router.mjs.map +1 -1
  567. package/dist/ui/runtime.cjs +5 -1
  568. package/dist/ui/runtime.cjs.map +1 -1
  569. package/dist/ui/runtime.d.cts +2 -1
  570. package/dist/ui/runtime.d.mts +2 -1
  571. package/dist/ui/runtime.mjs +5 -1
  572. package/dist/ui/runtime.mjs.map +1 -1
  573. package/dist/ui/slot.cjs +34 -0
  574. package/dist/ui/slot.cjs.map +1 -0
  575. package/dist/ui/slot.d.cts +43 -0
  576. package/dist/ui/slot.d.mts +43 -0
  577. package/dist/ui/slot.mjs +34 -0
  578. package/dist/ui/slot.mjs.map +1 -0
  579. package/dist/ui/tenant.cjs +300 -0
  580. package/dist/ui/tenant.cjs.map +1 -0
  581. package/dist/ui/tenant.d.cts +122 -0
  582. package/dist/ui/tenant.d.mts +122 -0
  583. package/dist/ui/tenant.mjs +279 -0
  584. package/dist/ui/tenant.mjs.map +1 -0
  585. package/dist/ui/types.d.cts +32 -2
  586. package/dist/ui/types.d.mts +32 -2
  587. package/dist/ui/version-check.cjs +47 -0
  588. package/dist/ui/version-check.cjs.map +1 -0
  589. package/dist/ui/version-check.d.cts +23 -0
  590. package/dist/ui/version-check.d.mts +23 -0
  591. package/dist/ui/version-check.mjs +46 -0
  592. package/dist/ui/version-check.mjs.map +1 -0
  593. package/dist/utils/banner.cjs +2 -2
  594. package/dist/utils/banner.cjs.map +1 -1
  595. package/dist/utils/banner.mjs +2 -2
  596. package/dist/utils/banner.mjs.map +1 -1
  597. package/dist/utils/linkify.cjs +1 -1
  598. package/dist/utils/linkify.cjs.map +1 -1
  599. package/dist/utils/linkify.mjs +1 -0
  600. package/dist/utils/linkify.mjs.map +1 -1
  601. package/dist/utils/run.cjs +6 -6
  602. package/dist/utils/run.cjs.map +1 -1
  603. package/dist/utils/run.mjs +6 -6
  604. package/dist/utils/run.mjs.map +1 -1
  605. package/dist/utils/save-config.cjs +12 -0
  606. package/dist/utils/save-config.cjs.map +1 -1
  607. package/dist/utils/save-config.mjs +12 -0
  608. package/dist/utils/save-config.mjs.map +1 -1
  609. package/dist/utils/snapshot-hash.cjs +10 -0
  610. package/dist/utils/snapshot-hash.cjs.map +1 -0
  611. package/dist/utils/snapshot-hash.mjs +10 -0
  612. package/dist/utils/snapshot-hash.mjs.map +1 -0
  613. package/dist/utils/string.cjs +0 -1
  614. package/dist/utils/string.cjs.map +1 -1
  615. package/dist/utils/theme.cjs +30 -12
  616. package/dist/utils/theme.cjs.map +1 -1
  617. package/dist/utils/theme.mjs +30 -11
  618. package/dist/utils/theme.mjs.map +1 -1
  619. package/dist/version-manifest-deploy.cjs +50 -0
  620. package/dist/version-manifest-deploy.cjs.map +1 -0
  621. package/dist/version-manifest-deploy.mjs +49 -0
  622. package/dist/version-manifest-deploy.mjs.map +1 -0
  623. package/dist/version-manifest-resolve.cjs +42 -0
  624. package/dist/version-manifest-resolve.cjs.map +1 -0
  625. package/dist/version-manifest-resolve.d.cts +38 -0
  626. package/dist/version-manifest-resolve.d.mts +38 -0
  627. package/dist/version-manifest-resolve.mjs +40 -0
  628. package/dist/version-manifest-resolve.mjs.map +1 -0
  629. package/dist/version-status.cjs +18 -0
  630. package/dist/version-status.cjs.map +1 -0
  631. package/dist/version-status.d.cts +22 -0
  632. package/dist/version-status.d.mts +22 -0
  633. package/dist/version-status.mjs +17 -0
  634. package/dist/version-status.mjs.map +1 -0
  635. package/dist/workspace-catalog.cjs +53 -0
  636. package/dist/workspace-catalog.cjs.map +1 -0
  637. package/dist/workspace-catalog.mjs +51 -0
  638. package/dist/workspace-catalog.mjs.map +1 -0
  639. package/dist/workspace.cjs +237 -0
  640. package/dist/workspace.cjs.map +1 -0
  641. package/dist/workspace.mjs +233 -0
  642. package/dist/workspace.mjs.map +1 -0
  643. package/package.json +179 -27
  644. package/skills/add-a-route/SKILL.md +132 -0
  645. package/skills/api-and-auth/SKILL.md +87 -21
  646. package/skills/api-and-auth/references/middleware.md +1 -1
  647. package/skills/cli-reference/SKILL.md +48 -21
  648. package/skills/code-style/SKILL.md +8 -0
  649. package/skills/dev-workflow/SKILL.md +50 -26
  650. package/skills/extends-config/SKILL.md +31 -19
  651. package/skills/init-upgrade/SKILL.md +29 -16
  652. package/skills/plugin-development/SKILL.md +46 -112
  653. package/skills/plugin-development/references/database.md +82 -0
  654. package/skills/plugin-development/references/request-context.md +67 -0
  655. package/skills/publish-sync/SKILL.md +99 -22
  656. package/skills/registry/SKILL.md +82 -0
  657. package/skills/super-app/SKILL.md +25 -15
  658. package/skills/talk-to-the-app/SKILL.md +138 -0
  659. package/skills/ui-integration/SKILL.md +93 -11
  660. package/dist/cli/db-studio.cjs +0 -131
  661. package/dist/cli/db-studio.cjs.map +0 -1
  662. package/dist/cli/db-studio.mjs +0 -127
  663. package/dist/cli/db-studio.mjs.map +0 -1
  664. package/dist/cli/init.d.cts.map +0 -1
  665. package/dist/cli/init.d.mts.map +0 -1
  666. package/dist/components/dev-view.cjs +0 -309
  667. package/dist/components/dev-view.cjs.map +0 -1
  668. package/dist/components/dev-view.mjs +0 -309
  669. package/dist/components/dev-view.mjs.map +0 -1
  670. package/dist/components/streaming-view.cjs +0 -134
  671. package/dist/components/streaming-view.cjs.map +0 -1
  672. package/dist/components/streaming-view.mjs +0 -132
  673. package/dist/components/streaming-view.mjs.map +0 -1
  674. package/dist/config.d.cts.map +0 -1
  675. package/dist/config.d.mts.map +0 -1
  676. package/dist/contract.d.cts.map +0 -1
  677. package/dist/contract.d.mts.map +0 -1
  678. package/dist/contract.meta.d.cts.map +0 -1
  679. package/dist/contract.meta.d.mts.map +0 -1
  680. package/dist/dag.d.cts.map +0 -1
  681. package/dist/dag.d.mts.map +0 -1
  682. package/dist/db.cjs +0 -81
  683. package/dist/db.cjs.map +0 -1
  684. package/dist/db.d.cts +0 -30
  685. package/dist/db.d.cts.map +0 -1
  686. package/dist/db.d.mts +0 -30
  687. package/dist/db.d.mts.map +0 -1
  688. package/dist/db.mjs +0 -75
  689. package/dist/db.mjs.map +0 -1
  690. package/dist/fastkv.d.cts.map +0 -1
  691. package/dist/fastkv.d.mts.map +0 -1
  692. package/dist/integrity.d.cts.map +0 -1
  693. package/dist/integrity.d.mts.map +0 -1
  694. package/dist/merge.d.cts.map +0 -1
  695. package/dist/merge.d.mts.map +0 -1
  696. package/dist/mf.d.cts.map +0 -1
  697. package/dist/mf.d.mts.map +0 -1
  698. package/dist/plugin.d.cts.map +0 -1
  699. package/dist/plugin.d.mts.map +0 -1
  700. package/dist/service-descriptor.d.cts.map +0 -1
  701. package/dist/service-descriptor.d.mts.map +0 -1
  702. package/dist/types.d.cts.map +0 -1
  703. package/dist/types.d.mts.map +0 -1
  704. package/dist/ui/head.d.cts.map +0 -1
  705. package/dist/ui/head.d.mts.map +0 -1
  706. package/dist/ui/metadata.d.cts.map +0 -1
  707. package/dist/ui/metadata.d.mts.map +0 -1
  708. package/dist/ui/router.d.cts.map +0 -1
  709. package/dist/ui/router.d.mts.map +0 -1
  710. package/dist/ui/runtime.d.cts.map +0 -1
  711. package/dist/ui/runtime.d.mts.map +0 -1
  712. package/dist/ui/types.d.cts.map +0 -1
  713. package/dist/ui/types.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sync.cjs","names":["mergeBosConfigWithTemplate","isPlainObjectFromMerge","resolveExtendsRef","resolveSourceDir","readSnapshot","extractSkillsBlock","buildChildAgentsMd","personalizeConfig","syncResolvedSharedDeps","loadResolvedConfig","writeSnapshot","runBunInstall","runTypesGen"],"sources":["../../src/cli/sync.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { glob } from \"glob\";\nimport { loadResolvedConfig } from \"../config\";\nimport type { SyncOptions, SyncResult } from \"../contract\";\nimport {\n isPlainObject as isPlainObjectFromMerge,\n mergeBosConfigWithTemplate,\n resolveExtendsRef,\n} from \"../merge\";\nimport { syncResolvedSharedDeps } from \"../shared-deps\";\nimport { writeGeneratedInfra } from \"./infra\";\nimport {\n buildChildAgentsMd,\n extractSkillsBlock,\n personalizeConfig,\n resolveSourceDir,\n runBunInstall,\n runTypesGen,\n} from \"./init\";\nimport { readSnapshot, writeSnapshot } from \"./snapshot\";\n\nconst FRAMEWORK_OWNED_SYNC_FILES = new Set([\n \".env.example\",\n \".gitignore\",\n \"biome.json\",\n \"bos.config.json\",\n \"bunfig.toml\",\n \"package.json\",\n \".changeset/config.json\",\n \".changeset/README.md\",\n \".github/workflows/ci.yml\",\n \".github/workflows/deploy.yml\",\n \".github/workflows/staging.yml\",\n \".github/workflows/release.yml\",\n \"railway.toml\",\n \"ui/package.json\",\n \"ui/postcss.config.mjs\",\n \"ui/rsbuild.config.ts\",\n \"ui/tsconfig.json\",\n \"ui/src/app.ts\",\n \"ui/src/globals.d.ts\",\n \"ui/src/hydrate.tsx\",\n \"ui/src/lib/api.ts\",\n \"ui/src/lib/auth.ts\",\n \"ui/src/router.server.tsx\",\n \"ui/src/router.tsx\",\n \"ui/src/routes/__root.tsx\",\n \"api/package.json\",\n \"api/plugin.dev.ts\",\n \"api/rspack.config.js\",\n \"api/tsconfig.contract.json\",\n \"api/tsconfig.json\",\n \"api/src/lib/auth.ts\",\n \"api/src/lib/context.ts\",\n \"api/drizzle.config.ts\",\n \"api/src/db/index.ts\",\n \"api/src/db/layer.ts\",\n \"api/src/db/migrate.ts\",\n \"api/src/global.d.ts\",\n \"api/tests/types.d.ts\",\n]);\n\ntype PackageJson = Record<string, unknown>;\n\nfunction computeHash(content: string | Uint8Array): string {\n return createHash(\"sha256\").update(content).digest(\"hex\").substring(0, 16);\n}\n\nexport function isFrameworkOwnedSyncFile(filePath: string): boolean {\n if (FRAMEWORK_OWNED_SYNC_FILES.has(filePath)) return true;\n if (/^plugins\\/[^/]+\\/src\\/lib\\/(auth|context)\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/src\\/db\\/(index|layer|migrate)\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/rspack\\.config\\.js$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/drizzle\\.config\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/src\\/global\\.d\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/tests\\/types\\.d\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/tsconfig\\.json$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/tsconfig\\.contract\\.json$/.test(filePath)) return true;\n return false;\n}\n\nfunction computeLocalHash(projectDir: string, filePath: string): string | null {\n const fullPath = join(projectDir, filePath);\n if (!existsSync(fullPath)) return null;\n try {\n const content = readFileSync(fullPath);\n return computeHash(content);\n } catch {\n return null;\n }\n}\n\nfunction backupFiles(projectDir: string, filePaths: string[]): string | null {\n const filesToBackup = filePaths.filter((f) => existsSync(join(projectDir, f)));\n if (filesToBackup.length === 0) return null;\n\n const timestamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n const backupDir = join(projectDir, \".bos\", \"sync-backup\", timestamp);\n\n for (const filePath of filesToBackup) {\n const src = join(projectDir, filePath);\n const dest = join(backupDir, filePath);\n mkdirSync(dirname(dest), { recursive: true });\n copyFileSync(src, dest);\n }\n\n return backupDir;\n}\n\nfunction mergeStringMaps(\n local: Record<string, string> | undefined,\n template: Record<string, string> | undefined,\n): Record<string, string> | undefined {\n if (!local && !template) return undefined;\n\n const merged: Record<string, string> = { ...(local ?? {}) };\n for (const [name, value] of Object.entries(template ?? {})) {\n merged[name] = value;\n }\n\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nfunction mergeWorkspacePackages(local: unknown, template: unknown): string[] | undefined {\n const localPackages = Array.isArray(local) ? local : [];\n const templatePackages = Array.isArray(template) ? template : [];\n if (localPackages.length === 0 && templatePackages.length === 0) return undefined;\n\n const ordered = new Set<string>();\n for (const entry of templatePackages) {\n if (typeof entry === \"string\" && entry.length > 0) ordered.add(entry);\n }\n for (const entry of localPackages) {\n if (typeof entry === \"string\" && entry.length > 0) ordered.add(entry);\n }\n\n const hasPluginEntry = [...ordered].some((e) => e.startsWith(\"plugins/\") && e !== \"plugins/*\");\n if (hasPluginEntry) {\n for (const entry of [...ordered]) {\n if (entry.startsWith(\"plugins/\") && entry !== \"plugins/*\") {\n ordered.delete(entry);\n }\n }\n ordered.add(\"plugins/*\");\n }\n\n return ordered.size > 0 ? [...ordered] : undefined;\n}\n\nexport function mergePackageJson(\n filePath: string,\n local: PackageJson,\n template: PackageJson,\n): PackageJson {\n const merged: PackageJson = { ...local, ...template };\n\n if (filePath === \"package.json\") {\n for (const key of [\"name\", \"private\", \"version\"] as const) {\n if (key in local) {\n merged[key] = local[key];\n }\n }\n } else if (\"version\" in local) {\n merged.version = local.version;\n }\n\n for (const depField of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n \"overrides\",\n ] as const) {\n const localDeps = local[depField] as Record<string, string> | undefined;\n const templateDeps = template[depField] as Record<string, string> | undefined;\n\n const mergedDeps = mergeStringMaps(localDeps, templateDeps);\n if (mergedDeps) {\n merged[depField] = mergedDeps;\n } else {\n delete merged[depField];\n }\n }\n\n if (\n (local.scripts && typeof local.scripts === \"object\") ||\n (template.scripts && typeof template.scripts === \"object\")\n ) {\n const mergedScripts = mergeStringMaps(\n local.scripts as Record<string, string> | undefined,\n template.scripts as Record<string, string> | undefined,\n );\n if (mergedScripts) {\n merged.scripts = mergedScripts;\n } else {\n delete merged.scripts;\n }\n }\n\n if (\n (local.workspaces && typeof local.workspaces === \"object\") ||\n (template.workspaces && typeof template.workspaces === \"object\")\n ) {\n const localWorkspaces = (local.workspaces ?? {}) as {\n packages?: string[];\n catalog?: Record<string, string>;\n };\n const templateWorkspaces = (template.workspaces ?? {}) as {\n packages?: string[];\n catalog?: Record<string, string>;\n };\n\n const mergedWorkspaces: { packages?: string[]; catalog?: Record<string, string> } = {\n ...localWorkspaces,\n ...templateWorkspaces,\n };\n\n const mergedPackages = mergeWorkspacePackages(\n localWorkspaces.packages,\n templateWorkspaces.packages,\n );\n if (mergedPackages) {\n mergedWorkspaces.packages = mergedPackages;\n } else {\n delete mergedWorkspaces.packages;\n }\n\n const mergedCatalog = mergeStringMaps(localWorkspaces.catalog, templateWorkspaces.catalog);\n if (mergedCatalog) {\n mergedWorkspaces.catalog = mergedCatalog;\n } else {\n delete mergedWorkspaces.catalog;\n }\n\n if (Object.keys(mergedWorkspaces).length > 0) {\n merged.workspaces = mergedWorkspaces;\n } else {\n delete merged.workspaces;\n }\n }\n\n return merged;\n}\n\nfunction toSourcePath(sourceDir: string, destPath: string): string | null {\n if (destPath.startsWith(\".github/\")) {\n const templatePath = destPath.replace(/^\\.github\\//, \".github/templates/\");\n if (existsSync(join(sourceDir, templatePath))) {\n return templatePath;\n }\n }\n\n const directPath = join(sourceDir, destPath);\n if (existsSync(directPath)) {\n return destPath;\n }\n\n return null;\n}\n\nfunction buildSyncedFileContent(\n sourceDir: string,\n projectDir: string,\n filePath: string,\n explicitDestPath?: string,\n): string | Uint8Array {\n const src = join(sourceDir, filePath);\n const destPath =\n explicitDestPath ??\n (filePath.startsWith(\".github/templates/\")\n ? filePath.replace(/^\\.github\\/templates\\//, \".github/\")\n : filePath);\n const dest = join(projectDir, destPath);\n\n if (filePath.endsWith(\"bos.config.json\")) {\n const localContent = existsSync(dest) ? readFileSync(dest, \"utf-8\") : null;\n const templateContent = readFileSync(src, \"utf-8\");\n\n if (localContent) {\n const local = JSON.parse(localContent) as Record<string, unknown>;\n const template = JSON.parse(templateContent) as Record<string, unknown>;\n const merged = mergeBosConfigWithTemplate(local, template);\n return `${JSON.stringify(merged, null, 2)}\\n`;\n }\n }\n\n if (filePath.endsWith(\"package.json\")) {\n const localContent = existsSync(dest) ? readFileSync(dest, \"utf-8\") : null;\n const templateContent = readFileSync(src, \"utf-8\");\n\n if (localContent) {\n const local = JSON.parse(localContent) as Record<string, unknown>;\n const template = JSON.parse(templateContent) as Record<string, unknown>;\n const merged = mergePackageJson(destPath, local, template);\n return `${JSON.stringify(merged, null, 2)}\\n`;\n }\n }\n\n return readFileSync(src);\n}\n\nfunction writeSyncedFile(\n sourceDir: string,\n projectDir: string,\n filePath: string,\n explicitDestPath?: string,\n): void {\n const destPath =\n explicitDestPath ??\n (filePath.startsWith(\".github/templates/\")\n ? filePath.replace(/^\\.github\\/templates\\//, \".github/\")\n : filePath);\n const dest = join(projectDir, destPath);\n mkdirSync(dirname(dest), { recursive: true });\n writeFileSync(dest, buildSyncedFileContent(sourceDir, projectDir, filePath, destPath));\n}\n\nasync function getSelectedChildPlugins(\n projectDir: string,\n localConfig: Record<string, unknown>,\n): Promise<string[]> {\n if (!localConfig.plugins || typeof localConfig.plugins !== \"object\") {\n return [];\n }\n\n const pluginDirs = new Set(\n (\n await glob(\"plugins/*/package.json\", {\n cwd: projectDir,\n nodir: true,\n dot: false,\n absolute: false,\n })\n )\n .map((file) => file.match(/^plugins\\/([^/]+)\\/package\\.json$/)?.[1])\n .filter((key): key is string => Boolean(key)),\n );\n\n const selected: string[] = [];\n for (const [pluginKey, rawEntry] of Object.entries(\n localConfig.plugins as Record<string, unknown>,\n )) {\n if (typeof rawEntry === \"string\") {\n if (!rawEntry.startsWith(\"local:\")) {\n selected.push(pluginKey);\n continue;\n }\n\n const localPath = join(projectDir, rawEntry.slice(\"local:\".length).trim());\n if (existsSync(localPath) || pluginDirs.has(pluginKey)) {\n selected.push(pluginKey);\n }\n continue;\n }\n\n if (!rawEntry || typeof rawEntry !== \"object\") {\n selected.push(pluginKey);\n continue;\n }\n\n const entry = rawEntry as Record<string, unknown>;\n const development = typeof entry.development === \"string\" ? entry.development : undefined;\n if (!development?.startsWith(\"local:\")) {\n selected.push(pluginKey);\n continue;\n }\n\n const localPath = join(projectDir, development.slice(\"local:\".length).trim());\n if (existsSync(localPath) || pluginDirs.has(pluginKey)) {\n selected.push(pluginKey);\n }\n }\n\n return selected;\n}\n\nfunction hasPluginsWorkspace(projectDir: string): boolean {\n const packageJsonPath = join(projectDir, \"package.json\");\n if (!existsSync(packageJsonPath)) return false;\n\n try {\n const pkg = JSON.parse(readFileSync(packageJsonPath, \"utf-8\")) as {\n workspaces?: { packages?: string[] } | string[];\n };\n const workspaces = pkg.workspaces;\n const packages = Array.isArray(workspaces)\n ? workspaces\n : Array.isArray(workspaces?.packages)\n ? workspaces.packages\n : [];\n return packages.includes(\"plugins/*\");\n } catch {\n return false;\n }\n}\n\nexport async function syncTemplate(projectDir: string, options: SyncOptions): Promise<SyncResult> {\n // Sync reads the raw bos.config.json (not the resolved config) because it needs\n // the user's explicit local settings: their extends ref, selected plugins, etc.\n // The resolved config is the merged result and would include inherited parent\n // values that the user didn't explicitly choose, which would break sync filtering.\n const localConfig = JSON.parse(\n readFileSync(join(projectDir, \"bos.config.json\"), \"utf-8\"),\n ) as Record<string, unknown>;\n\n let extendsRef: string | undefined;\n if (typeof localConfig.extends === \"string\") {\n extendsRef = localConfig.extends;\n } else if (isPlainObjectFromMerge(localConfig.extends)) {\n extendsRef = resolveExtendsRef(localConfig.extends as Record<string, string>, \"production\");\n }\n if (!extendsRef?.startsWith(\"bos://\")) {\n return {\n status: \"error\",\n updated: [],\n skipped: [],\n added: [],\n conflicted: [],\n error: \"No extends field found in bos.config.json — cannot determine parent\",\n };\n }\n\n const extendsMatch = extendsRef.match(/^bos:\\/\\/([^/]+)\\/(.+)$/);\n if (!extendsMatch) {\n return {\n status: \"error\",\n updated: [],\n skipped: [],\n added: [],\n conflicted: [],\n error: `Invalid extends reference: ${extendsRef}`,\n };\n }\n\n const extendsAccount = extendsMatch[1];\n const extendsGateway = extendsMatch[2];\n\n const { sourceDir, cleanup } = await resolveSourceDir({\n extendsAccount,\n extendsGateway,\n });\n\n try {\n const childPlugins = await getSelectedChildPlugins(projectDir, localConfig);\n const withUi = existsSync(join(projectDir, \"ui\", \"package.json\"));\n const withApi = existsSync(join(projectDir, \"api\", \"package.json\"));\n const withHost = existsSync(join(projectDir, \"host\", \"package.json\"));\n const withPlugins = childPlugins.length > 0 || hasPluginsWorkspace(projectDir);\n\n const destToSource = new Map<string, string>();\n for (const destPath of FRAMEWORK_OWNED_SYNC_FILES) {\n if (destPath.startsWith(\"ui/\") && !withUi) continue;\n if (destPath.startsWith(\"api/\") && !withApi) continue;\n if (destPath.startsWith(\"host/\") && !withHost) continue;\n const sourcePath = toSourcePath(sourceDir, destPath);\n if (!sourcePath) continue;\n destToSource.set(destPath, sourcePath);\n }\n\n // Sync api/src/lib/{auth,context}.ts into each plugin's src/lib/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\"))) continue;\n for (const libFile of [\"auth.ts\", \"context.ts\"]) {\n const sourceFile = `api/src/lib/${libFile}`;\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/src/lib/${libFile}`, sourceFile);\n }\n }\n\n // Sync api/src/global.d.ts into each plugin's src/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\"))) continue;\n const sourceFile = \"api/src/global.d.ts\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/src/global.d.ts`, sourceFile);\n }\n\n // Sync tests/types.d.ts into each plugin's tests/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey))) continue;\n const sourceFile = \"plugins/_template/tests/types.d.ts\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/tests/types.d.ts`, sourceFile);\n }\n\n // Sync api/src/db/{index,layer,migrate}.ts into each plugin's src/db/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\", \"db\"))) continue;\n for (const dbFile of [\"index.ts\", \"layer.ts\", \"migrate.ts\"]) {\n const sourceFile = `api/src/db/${dbFile}`;\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/src/db/${dbFile}`, sourceFile);\n }\n }\n\n // Sync rspack.config.js from the template into each plugin\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey))) continue;\n const sourceFile = \"plugins/_template/rspack.config.js\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/rspack.config.js`, sourceFile);\n }\n\n // Sync drizzle.config.ts from api into each DB-enabled plugin\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\", \"db\"))) continue;\n const sourceFile = \"api/drizzle.config.ts\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/drizzle.config.ts`, sourceFile);\n }\n\n // Sync tsconfig files from the template into each plugin\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey))) continue;\n for (const tsconfigFile of [\"tsconfig.json\", \"tsconfig.contract.json\"]) {\n const sourceFile = `plugins/_template/${tsconfigFile}`;\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/${tsconfigFile}`, sourceFile);\n }\n }\n\n const updated: string[] = [];\n const skipped: string[] = [];\n const added: string[] = [];\n const conflicted: string[] = [];\n\n const snapshot = await readSnapshot(projectDir);\n const snapshotFiles = snapshot?.files ?? {};\n\n for (const [destPath, filePath] of destToSource.entries()) {\n const localHash = computeLocalHash(projectDir, destPath);\n const sourceHash = computeHash(buildSyncedFileContent(sourceDir, projectDir, filePath));\n\n if (localHash === null) {\n added.push(destPath);\n continue;\n }\n\n if (localHash === sourceHash) {\n skipped.push(destPath);\n continue;\n }\n\n const snapshotHash = snapshotFiles[destPath];\n if (!snapshotHash) {\n updated.push(destPath);\n continue;\n }\n\n if (localHash === snapshotHash) {\n updated.push(destPath);\n continue;\n }\n\n if (sourceHash === snapshotHash) {\n skipped.push(destPath);\n continue;\n }\n\n conflicted.push(destPath);\n }\n\n const account = (localConfig.account as string) || extendsAccount;\n const domain = (localConfig.domain as string) || extendsGateway;\n const overrides: Array<\"ui\" | \"api\" | \"host\" | \"plugins\"> = [];\n if (withUi) overrides.push(\"ui\");\n if (withApi) overrides.push(\"api\");\n if (withHost) overrides.push(\"host\");\n if (withPlugins) overrides.push(\"plugins\");\n\n if (options.dryRun) {\n const agentsMdSourcePath = toSourcePath(sourceDir, \"AGENTS.md\");\n if (agentsMdSourcePath) {\n const agentsMdSourceContent = readFileSync(join(sourceDir, agentsMdSourcePath), \"utf-8\");\n const skillsBlock = extractSkillsBlock(agentsMdSourceContent);\n if (skillsBlock) {\n const expectedContent = buildChildAgentsMd(skillsBlock, {\n overrides,\n plugins: childPlugins,\n });\n const expectedHash = computeHash(expectedContent);\n const agentsMdLocalHash = computeLocalHash(projectDir, \"AGENTS.md\");\n if (agentsMdLocalHash !== expectedHash) {\n updated.push(\"AGENTS.md\");\n }\n }\n }\n\n return {\n status: \"dry-run\",\n updated,\n skipped,\n added,\n conflicted,\n };\n }\n\n const filesToWrite = [...updated, ...added, ...conflicted];\n\n let backupDir: string | undefined;\n if (filesToWrite.length > 0) {\n backupDir = backupFiles(projectDir, filesToWrite) ?? undefined;\n\n for (const destPath of filesToWrite) {\n const sourcePath = destToSource.get(destPath) ?? destPath;\n writeSyncedFile(sourceDir, projectDir, sourcePath, destPath);\n }\n }\n\n await personalizeConfig(projectDir, {\n extendsAccount,\n extendsGateway,\n account,\n domain,\n overrides,\n plugins: childPlugins,\n workspaceOpts: { sourceDir },\n mode: \"sync\",\n existingConfig: localConfig,\n });\n\n await syncResolvedSharedDeps({\n configDir: projectDir,\n hostMode: \"local\",\n });\n\n const syncedConfig = await loadResolvedConfig({ cwd: projectDir });\n if (syncedConfig?.runtime) {\n writeGeneratedInfra(projectDir, syncedConfig.runtime);\n }\n\n const newSnapshotFiles: Record<string, string> = {};\n for (const destPath of destToSource.keys()) {\n const hash = computeLocalHash(projectDir, destPath);\n if (hash) {\n newSnapshotFiles[destPath] = hash;\n }\n }\n\n const agentsMdSourcePath = toSourcePath(sourceDir, \"AGENTS.md\");\n if (agentsMdSourcePath) {\n const agentsMdSourceContent = readFileSync(join(sourceDir, agentsMdSourcePath), \"utf-8\");\n const skillsBlock = extractSkillsBlock(agentsMdSourceContent);\n if (skillsBlock) {\n const expectedContent = buildChildAgentsMd(skillsBlock, {\n overrides,\n plugins: childPlugins,\n });\n const expectedHash = computeHash(expectedContent);\n\n const agentsMdLocalHash = computeLocalHash(projectDir, \"AGENTS.md\");\n if (agentsMdLocalHash !== expectedHash) {\n writeFileSync(join(projectDir, \"AGENTS.md\"), expectedContent);\n updated.push(\"AGENTS.md\");\n }\n\n newSnapshotFiles[\"AGENTS.md\"] = expectedHash;\n }\n }\n\n await writeSnapshot(projectDir, {\n parentRef: `bos://${extendsAccount}/${extendsGateway}`,\n files: newSnapshotFiles,\n });\n\n if (!options.noInstall) {\n await runBunInstall(projectDir);\n await runTypesGen(projectDir);\n }\n\n return {\n status: \"synced\",\n updated,\n skipped,\n added,\n conflicted,\n backupDir,\n };\n } finally {\n await cleanup();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,6CAA6B,IAAI,IAAI;CACzC;CACA;C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,6BAAY,UAAU;EAC9B;EAEA,OAAO;GACL,QAAQ;GACR;GACA;GACA;GACA;GACA;EACF;CACF,UAAU;EACR,MAAM,QAAQ;CAChB;AACF"}
1
+ {"version":3,"file":"sync.cjs","names":["join","existsSync","readFileSync","computeHash","dirname","mergeBosConfigWithTemplate","findWorkspaceRoot","relative","parseYaml","loadAppDescriptorConfig","isPlainObjectFromMerge","resolveExtendsRef","resolveSourceDir","buildChildRootScripts","readSnapshot","extractSkillsBlock","buildChildAgentsMd","personalizeConfig","syncResolvedSharedDeps","openResolution","materializeViaLayer","writeSnapshot","runPnpmInstall","runTypesGen"],"sources":["../../src/cli/sync.ts"],"sourcesContent":["import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { glob } from \"glob\";\nimport { parse as parseYaml } from \"yaml\";\nimport { loadAppDescriptorConfig } from \"../config\";\nimport type { SyncOptions, SyncResult } from \"../contract\";\nimport { materializeViaLayer } from \"../infra/materializer\";\nimport {\n isPlainObject as isPlainObjectFromMerge,\n mergeBosConfigWithTemplate,\n resolveExtendsRef,\n} from \"../merge\";\nimport { openResolution } from \"../resolution/session\";\nimport { syncResolvedSharedDeps } from \"../shared-deps\";\nimport { computeSnapshotHash as computeHash } from \"../utils/snapshot-hash\";\nimport { findWorkspaceRoot } from \"../workspace\";\nimport {\n buildChildAgentsMd,\n buildChildRootScripts,\n extractSkillsBlock,\n personalizeConfig,\n resolveSourceDir,\n runPnpmInstall,\n runTypesGen,\n} from \"./init\";\nimport { readSnapshot, writeSnapshot } from \"./snapshot\";\n\nconst FRAMEWORK_OWNED_SYNC_FILES = new Set([\n \".env.example\",\n \".gitignore\",\n \"biome.json\",\n \"bos.config.json\",\n \"package.json\",\n \".changeset/config.json\",\n \".changeset/README.md\",\n \".github/workflows/ci.yml\",\n \".github/workflows/deploy.yml\",\n \".github/workflows/staging.yml\",\n \".github/workflows/release.yml\",\n \"railway.toml\",\n \"ui/package.json\",\n \"ui/postcss.config.mjs\",\n \"ui/tsconfig.json\",\n \"api/package.json\",\n \"api/plugin.dev.ts\",\n \"api/rspack.config.js\",\n \"api/tsconfig.json\",\n \"api/src/lib/context.ts\",\n \"api/drizzle.config.ts\",\n \"api/src/db/index.ts\",\n \"api/src/db/layer.ts\",\n \"api/src/db/migrate.ts\",\n \"api/src/global.d.ts\",\n \"api/tests/types.d.ts\",\n]);\n\n/**\n * Files the scaffold previously sync-owned but has retired (ADR 0023) — the\n * generated `.gen` bootstrap stubs replaced them. During sync: a local copy\n * whose hash still matches the sync snapshot is deleted silently; a\n * hand-modified (or never-snapshotted) copy is backed up, then deleted. The\n * app's authored ui files (router.tsx, app.ts, lib, routes, components) are\n * NOT retired — they leave the sync list as app-owned files, untouched.\n */\nexport const RETIRED_SYNC_FILES = new Set([\n \"ui/src/entry.ts\",\n \"ui/src/globals.d.ts\",\n \"ui/src/hydrate.tsx\",\n \"ui/src/router.server.tsx\",\n \"ui/src/compose.ts\",\n]);\n\ntype PackageJson = Record<string, unknown>;\n\nconst AGENT_SYNC_GLOBS = [\".agents/skills/**\", \"docs/agents/**\", \"skills-lock.json\"];\n\nexport function isFrameworkOwnedSyncFile(filePath: string): boolean {\n if (FRAMEWORK_OWNED_SYNC_FILES.has(filePath)) return true;\n if (\n filePath.startsWith(\".agents/skills/\") ||\n filePath.startsWith(\"docs/agents/\") ||\n filePath === \"skills-lock.json\"\n )\n return true;\n // lib/auth.ts is NOT sync-owned since #207: the middleware factory lives in\n // everything-dev/api (framework home); projects import it, they don't own a copy.\n if (/^plugins\\/[^/]+\\/src\\/lib\\/context\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/src\\/db\\/(index|layer|migrate)\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/rspack\\.config\\.js$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/drizzle\\.config\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/src\\/global\\.d\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/tests\\/types\\.d\\.ts$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/tsconfig\\.json$/.test(filePath)) return true;\n if (/^plugins\\/[^/]+\\/tsconfig\\.contract\\.json$/.test(filePath)) return true;\n return false;\n}\n\nfunction computeLocalHash(projectDir: string, filePath: string): string | null {\n const fullPath = join(projectDir, filePath);\n if (!existsSync(fullPath)) return null;\n try {\n const content = readFileSync(fullPath);\n return computeHash(content);\n } catch {\n return null;\n }\n}\n\nfunction backupFiles(projectDir: string, filePaths: string[]): string | null {\n const filesToBackup = filePaths.filter((f) => existsSync(join(projectDir, f)));\n if (filesToBackup.length === 0) return null;\n\n const timestamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n const backupDir = join(projectDir, \".bos\", \"sync-backup\", timestamp);\n\n for (const filePath of filesToBackup) {\n const src = join(projectDir, filePath);\n const dest = join(backupDir, filePath);\n mkdirSync(dirname(dest), { recursive: true });\n copyFileSync(src, dest);\n }\n\n return backupDir;\n}\n\nexport interface RetiredSyncFilesResult {\n /** unmodified stub copies — deleted (in a real run) */\n retired: string[];\n /** hand-modified or never-snapshotted stub copies — backed up, then deleted */\n retiredConflicted: string[];\n backupDir: string | null;\n}\n\n/**\n * Migrate a child off the retired bootstrap stub files (ADR 0023): unmodified\n * copies are deleted silently, hand-modified copies are backed up first. In\n * dry-run the actions are reported without touching the tree.\n */\nexport function retireSyncedFiles(\n projectDir: string,\n snapshotFiles: Record<string, string>,\n opts: { dryRun: boolean },\n): RetiredSyncFilesResult {\n const retired: string[] = [];\n const retiredConflicted: string[] = [];\n\n for (const destPath of RETIRED_SYNC_FILES) {\n const localHash = computeLocalHash(projectDir, destPath);\n if (localHash === null) continue;\n if (localHash === snapshotFiles[destPath]) {\n retired.push(destPath);\n } else {\n retiredConflicted.push(destPath);\n }\n }\n\n if (opts.dryRun || (retired.length === 0 && retiredConflicted.length === 0)) {\n return { retired, retiredConflicted, backupDir: null };\n }\n\n const backupDir = backupFiles(projectDir, retiredConflicted);\n for (const destPath of [...retired, ...retiredConflicted]) {\n rmSync(join(projectDir, destPath));\n }\n return { retired, retiredConflicted, backupDir };\n}\n\nfunction mergeStringMaps(\n local: Record<string, string> | undefined,\n template: Record<string, string> | undefined,\n): Record<string, string> | undefined {\n if (!local && !template) return undefined;\n\n const merged: Record<string, string> = { ...local };\n for (const [name, value] of Object.entries(template ?? {})) {\n merged[name] = value;\n }\n\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nfunction mergeWorkspacePackages(local: unknown, template: unknown): string[] | undefined {\n const localPackages = Array.isArray(local) ? local : [];\n const templatePackages = Array.isArray(template) ? template : [];\n if (localPackages.length === 0 && templatePackages.length === 0) return undefined;\n\n const ordered = new Set<string>();\n for (const entry of templatePackages) {\n if (typeof entry === \"string\" && entry.length > 0) ordered.add(entry);\n }\n for (const entry of localPackages) {\n if (typeof entry === \"string\" && entry.length > 0) ordered.add(entry);\n }\n\n const hasPluginEntry = [...ordered].some((e) => e.startsWith(\"plugins/\") && e !== \"plugins/*\");\n if (hasPluginEntry) {\n for (const entry of ordered) {\n if (entry.startsWith(\"plugins/\") && entry !== \"plugins/*\") {\n ordered.delete(entry);\n }\n }\n ordered.add(\"plugins/*\");\n }\n\n return ordered.size > 0 ? [...ordered] : undefined;\n}\n\nexport function mergePackageJson(\n filePath: string,\n local: PackageJson,\n template: PackageJson,\n childScripts?: Record<string, string>,\n): PackageJson {\n const merged: PackageJson = { ...local, ...template };\n\n if (filePath === \"package.json\") {\n for (const key of [\"name\", \"private\", \"version\"] as const) {\n if (key in local) {\n merged[key] = local[key];\n }\n }\n } else if (\"version\" in local) {\n merged.version = local.version;\n }\n\n for (const depField of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n \"overrides\",\n ] as const) {\n const localDeps = local[depField] as Record<string, string> | undefined;\n const templateDeps = template[depField] as Record<string, string> | undefined;\n\n const mergedDeps = mergeStringMaps(localDeps, templateDeps);\n if (mergedDeps) {\n merged[depField] = mergedDeps;\n } else {\n delete merged[depField];\n }\n }\n\n if (\n (local.scripts && typeof local.scripts === \"object\") ||\n (template.scripts && typeof template.scripts === \"object\") ||\n childScripts\n ) {\n const mergedScripts = mergeStringMaps(\n local.scripts as Record<string, string> | undefined,\n filePath === \"package.json\" && childScripts\n ? childScripts\n : (template.scripts as Record<string, string> | undefined),\n );\n if (mergedScripts) {\n merged.scripts = mergedScripts;\n } else {\n delete merged.scripts;\n }\n }\n\n if (\n (local.workspaces && typeof local.workspaces === \"object\") ||\n (template.workspaces && typeof template.workspaces === \"object\")\n ) {\n const localWorkspaces = (local.workspaces ?? {}) as {\n packages?: string[];\n catalog?: Record<string, string>;\n };\n const templateWorkspaces = (template.workspaces ?? {}) as {\n packages?: string[];\n catalog?: Record<string, string>;\n };\n\n const mergedWorkspaces: { packages?: string[]; catalog?: Record<string, string> } = {\n ...localWorkspaces,\n ...templateWorkspaces,\n };\n\n const mergedPackages = mergeWorkspacePackages(\n localWorkspaces.packages,\n templateWorkspaces.packages,\n );\n if (mergedPackages) {\n mergedWorkspaces.packages = mergedPackages;\n } else {\n delete mergedWorkspaces.packages;\n }\n\n const mergedCatalog = mergeStringMaps(localWorkspaces.catalog, templateWorkspaces.catalog);\n if (mergedCatalog) {\n mergedWorkspaces.catalog = mergedCatalog;\n } else {\n delete mergedWorkspaces.catalog;\n }\n\n if (Object.keys(mergedWorkspaces).length > 0) {\n merged.workspaces = mergedWorkspaces;\n } else {\n delete merged.workspaces;\n }\n }\n\n return merged;\n}\n\nfunction toSourcePath(sourceDir: string, destPath: string): string | null {\n if (destPath.startsWith(\".github/\")) {\n const templatePath = destPath.replace(/^\\.github\\//, \".github/templates/\");\n if (existsSync(join(sourceDir, templatePath))) {\n return templatePath;\n }\n }\n\n const directPath = join(sourceDir, destPath);\n if (existsSync(directPath)) {\n return destPath;\n }\n\n return null;\n}\n\nfunction buildSyncedFileContent(\n sourceDir: string,\n projectDir: string,\n filePath: string,\n explicitDestPath?: string,\n childScripts?: Record<string, string>,\n): string | Uint8Array {\n const src = join(sourceDir, filePath);\n const destPath =\n explicitDestPath ??\n (filePath.startsWith(\".github/templates/\")\n ? filePath.replace(/^\\.github\\/templates\\//, \".github/\")\n : filePath);\n const dest = join(projectDir, destPath);\n\n if (filePath.endsWith(\"bos.config.json\")) {\n const localContent = existsSync(dest) ? readFileSync(dest, \"utf-8\") : null;\n const templateContent = readFileSync(src, \"utf-8\");\n\n if (localContent) {\n const local = JSON.parse(localContent) as Record<string, unknown>;\n const template = JSON.parse(templateContent) as Record<string, unknown>;\n const merged = mergeBosConfigWithTemplate(local, template);\n return `${JSON.stringify(merged, null, 2)}\\n`;\n }\n }\n\n if (filePath.endsWith(\"package.json\")) {\n const localContent = existsSync(dest) ? readFileSync(dest, \"utf-8\") : null;\n const templateContent = readFileSync(src, \"utf-8\");\n\n if (localContent) {\n const local = JSON.parse(localContent) as Record<string, unknown>;\n const template = JSON.parse(templateContent) as Record<string, unknown>;\n const merged = mergePackageJson(destPath, local, template, childScripts);\n return `${JSON.stringify(merged, null, 2)}\\n`;\n }\n }\n\n return readFileSync(src);\n}\n\nfunction writeSyncedFile(\n sourceDir: string,\n projectDir: string,\n filePath: string,\n explicitDestPath?: string,\n childScripts?: Record<string, string>,\n): void {\n const destPath =\n explicitDestPath ??\n (filePath.startsWith(\".github/templates/\")\n ? filePath.replace(/^\\.github\\/templates\\//, \".github/\")\n : filePath);\n const dest = join(projectDir, destPath);\n mkdirSync(dirname(dest), { recursive: true });\n writeFileSync(\n dest,\n buildSyncedFileContent(sourceDir, projectDir, filePath, destPath, childScripts),\n );\n}\n\nasync function getSelectedChildPlugins(\n projectDir: string,\n localConfig: Record<string, unknown>,\n): Promise<string[]> {\n if (!localConfig.plugins || typeof localConfig.plugins !== \"object\") {\n return [];\n }\n\n const pluginDirs = new Set(\n (\n await glob(\"plugins/*/package.json\", {\n cwd: projectDir,\n nodir: true,\n dot: false,\n absolute: false,\n })\n )\n .map((file) => file.match(/^plugins\\/([^/]+)\\/package\\.json$/)?.[1])\n .filter((key): key is string => Boolean(key)),\n );\n\n const selected: string[] = [];\n for (const [pluginKey, rawEntry] of Object.entries(\n localConfig.plugins as Record<string, unknown>,\n )) {\n if (typeof rawEntry === \"string\") {\n if (!rawEntry.startsWith(\"local:\")) {\n selected.push(pluginKey);\n continue;\n }\n\n const localPath = join(projectDir, rawEntry.slice(\"local:\".length).trim());\n if (existsSync(localPath) || pluginDirs.has(pluginKey)) {\n selected.push(pluginKey);\n }\n continue;\n }\n\n if (!rawEntry || typeof rawEntry !== \"object\") {\n selected.push(pluginKey);\n continue;\n }\n\n const entry = rawEntry as Record<string, unknown>;\n const development = typeof entry.development === \"string\" ? entry.development : undefined;\n if (!development?.startsWith(\"local:\")) {\n selected.push(pluginKey);\n continue;\n }\n\n const localPath = join(projectDir, development.slice(\"local:\".length).trim());\n if (existsSync(localPath) || pluginDirs.has(pluginKey)) {\n selected.push(pluginKey);\n }\n }\n\n return selected;\n}\n\nfunction hasPluginsWorkspace(projectDir: string): boolean {\n const root = findWorkspaceRoot(projectDir);\n if (!root) return false;\n const rel = relative(root.dir, projectDir);\n const baseDir = rel.startsWith(\"..\") || rel === \"\" ? root.dir : projectDir;\n for (const manifest of [\"pnpm-workspace.yaml\", \"package.json\"]) {\n const manifestPath = join(baseDir, manifest);\n if (!existsSync(manifestPath)) continue;\n try {\n const content = readFileSync(manifestPath, \"utf-8\");\n const packages =\n manifest === \"pnpm-workspace.yaml\"\n ? (parseYaml(content) as { packages?: unknown } | null)?.packages\n : (\n JSON.parse(content) as {\n workspaces?: { packages?: string[] } | string[];\n }\n ).workspaces;\n const globs = Array.isArray(packages)\n ? packages\n : Array.isArray((packages as { packages?: string[] })?.packages)\n ? (packages as { packages?: string[] }).packages\n : [];\n if (globs.includes(\"plugins/*\")) return true;\n } catch {\n return false;\n }\n }\n return false;\n}\n\nexport async function syncTemplate(projectDir: string, options: SyncOptions): Promise<SyncResult> {\n // Sync reads the user's authored config — the raw bos.config.json, or the\n // materialized bos.app.ts descriptor for TS-form children — not the\n // resolved config: it needs the user's explicit local settings (their\n // extends ref, selected plugins, etc.). The resolved config is the merged\n // result and would include inherited parent values that the user didn't\n // explicitly choose, which would break sync filtering.\n const tsFormChild = existsSync(join(projectDir, \"bos.app.ts\"));\n const localConfig = (\n tsFormChild\n ? await loadAppDescriptorConfig(join(projectDir, \"bos.app.ts\"))\n : JSON.parse(readFileSync(join(projectDir, \"bos.config.json\"), \"utf-8\"))\n ) as Record<string, unknown>;\n\n let extendsRef: string | undefined;\n if (typeof localConfig.extends === \"string\") {\n extendsRef = localConfig.extends;\n } else if (isPlainObjectFromMerge(localConfig.extends)) {\n extendsRef = resolveExtendsRef(localConfig.extends as Record<string, string>, \"production\");\n }\n if (!extendsRef?.startsWith(\"bos://\")) {\n return {\n status: \"error\",\n updated: [],\n skipped: [],\n added: [],\n conflicted: [],\n error: \"No extends field found in bos.config.json — cannot determine parent\",\n };\n }\n\n const extendsMatch = extendsRef.match(/^bos:\\/\\/([^/]+)\\/(.+)$/);\n if (!extendsMatch) {\n return {\n status: \"error\",\n updated: [],\n skipped: [],\n added: [],\n conflicted: [],\n error: `Invalid extends reference: ${extendsRef}`,\n };\n }\n\n const extendsAccount = extendsMatch[1];\n const extendsGateway = extendsMatch[2];\n\n const { sourceDir, cleanup } = await resolveSourceDir({\n extendsAccount,\n extendsGateway,\n });\n\n try {\n const childPlugins = await getSelectedChildPlugins(projectDir, localConfig);\n const withUi = existsSync(join(projectDir, \"ui\", \"package.json\"));\n const withApi = existsSync(join(projectDir, \"api\", \"package.json\"));\n const withHost = existsSync(join(projectDir, \"host\", \"package.json\"));\n const withPlugins = childPlugins.length > 0 || hasPluginsWorkspace(projectDir);\n\n const childScripts = buildChildRootScripts({\n ui: withUi,\n api: withApi,\n host: withHost,\n plugins: withPlugins,\n });\n\n const destToSource = new Map<string, string>();\n // TS-form children author bos.app.ts — the parent's JSON config must\n // never sync into them.\n const tsFormChild = !existsSync(join(projectDir, \"bos.config.json\"));\n for (const destPath of FRAMEWORK_OWNED_SYNC_FILES) {\n if (destPath === \"bos.config.json\" && tsFormChild) continue;\n if (destPath.startsWith(\"ui/\") && !withUi) continue;\n if (destPath.startsWith(\"api/\") && !withApi) continue;\n if (destPath.startsWith(\"host/\") && !withHost) continue;\n const sourcePath = toSourcePath(sourceDir, destPath);\n if (!sourcePath) continue;\n destToSource.set(destPath, sourcePath);\n }\n\n for (const destPath of await glob(AGENT_SYNC_GLOBS, {\n cwd: sourceDir,\n nodir: true,\n dot: true,\n absolute: false,\n ignore: [\"**/node_modules/**\", \"**/.git/**\", \"**/dist/**\", \"**/.bos/**\"],\n })) {\n destToSource.set(destPath, destPath);\n }\n\n // Sync api/src/lib/{auth,context}.ts into each plugin's src/lib/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\"))) continue;\n for (const libFile of [\"auth.ts\", \"context.ts\"]) {\n const sourceFile = `api/src/lib/${libFile}`;\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/src/lib/${libFile}`, sourceFile);\n }\n }\n\n // Sync api/src/global.d.ts into each plugin's src/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\"))) continue;\n const sourceFile = \"api/src/global.d.ts\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/src/global.d.ts`, sourceFile);\n }\n\n // Sync tests/types.d.ts into each plugin's tests/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey))) continue;\n const sourceFile = \"plugins/_template/tests/types.d.ts\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/tests/types.d.ts`, sourceFile);\n }\n\n // Sync api/src/db/{index,layer,migrate}.ts into each plugin's src/db/\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\", \"db\"))) continue;\n for (const dbFile of [\"index.ts\", \"layer.ts\", \"migrate.ts\"]) {\n const sourceFile = `api/src/db/${dbFile}`;\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/src/db/${dbFile}`, sourceFile);\n }\n }\n\n // Sync rspack.config.js from the template into each plugin\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey))) continue;\n const sourceFile = \"plugins/_template/rspack.config.js\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/rspack.config.js`, sourceFile);\n }\n\n // Sync drizzle.config.ts from api into each DB-enabled plugin\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey, \"src\", \"db\"))) continue;\n const sourceFile = \"api/drizzle.config.ts\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/drizzle.config.ts`, sourceFile);\n }\n\n // Sync tsconfig from the template into each plugin\n for (const pluginKey of childPlugins) {\n if (!existsSync(join(projectDir, \"plugins\", pluginKey))) continue;\n const sourceFile = \"plugins/_template/tsconfig.json\";\n if (!existsSync(join(sourceDir, sourceFile))) continue;\n destToSource.set(`plugins/${pluginKey}/tsconfig.json`, sourceFile);\n }\n\n const updated: string[] = [];\n const skipped: string[] = [];\n const added: string[] = [];\n const conflicted: string[] = [];\n\n const snapshot = await readSnapshot(projectDir);\n const snapshotFiles = snapshot?.files ?? {};\n\n for (const [destPath, filePath] of destToSource.entries()) {\n if (!existsSync(join(sourceDir, filePath))) {\n // The template no longer ships this file — it was retired from the\n // scaffold. Leave the local copy untouched rather than crashing the\n // sync (the old-CLI + new-template transitional combo).\n skipped.push(destPath);\n continue;\n }\n const localHash = computeLocalHash(projectDir, destPath);\n const sourceHash = computeHash(\n buildSyncedFileContent(sourceDir, projectDir, filePath, undefined, childScripts),\n );\n\n if (localHash === null) {\n added.push(destPath);\n continue;\n }\n\n if (localHash === sourceHash) {\n skipped.push(destPath);\n continue;\n }\n\n const snapshotHash = snapshotFiles[destPath];\n if (!snapshotHash) {\n updated.push(destPath);\n continue;\n }\n\n if (localHash === snapshotHash) {\n updated.push(destPath);\n continue;\n }\n\n if (sourceHash === snapshotHash) {\n skipped.push(destPath);\n continue;\n }\n\n conflicted.push(destPath);\n }\n\n const account = (localConfig.account as string) || extendsAccount;\n const domain = (localConfig.domain as string) || extendsGateway;\n const overrides: Array<\"ui\" | \"api\" | \"host\" | \"plugins\"> = [];\n if (withUi) overrides.push(\"ui\");\n if (withApi) overrides.push(\"api\");\n if (withHost) overrides.push(\"host\");\n if (withPlugins) overrides.push(\"plugins\");\n\n if (options.dryRun) {\n const agentsMdSourcePath = toSourcePath(sourceDir, \"AGENTS.md\");\n if (agentsMdSourcePath) {\n const agentsMdSourceContent = readFileSync(join(sourceDir, agentsMdSourcePath), \"utf-8\");\n const skillsBlock = extractSkillsBlock(agentsMdSourceContent);\n if (skillsBlock) {\n const expectedContent = buildChildAgentsMd(skillsBlock, {\n overrides,\n plugins: childPlugins,\n });\n const expectedHash = computeHash(expectedContent);\n const agentsMdLocalHash = computeLocalHash(projectDir, \"AGENTS.md\");\n if (agentsMdLocalHash !== expectedHash) {\n updated.push(\"AGENTS.md\");\n }\n }\n }\n\n const retirement = retireSyncedFiles(projectDir, snapshotFiles, { dryRun: true });\n\n return {\n status: \"dry-run\",\n updated,\n skipped,\n added,\n conflicted,\n retired: retirement.retired,\n retiredConflicted: retirement.retiredConflicted,\n };\n }\n\n // Migrate the child off the retired bootstrap stubs (ADR 0023) before any\n // writes — a retired file is never in destToSource, so its snapshot entry\n // drops out at the next writeSnapshot.\n const retirement = retireSyncedFiles(projectDir, snapshotFiles, { dryRun: false });\n\n const filesToWrite = [...updated, ...added, ...conflicted];\n\n let backupDir: string | undefined = retirement.backupDir ?? undefined;\n if (filesToWrite.length > 0) {\n backupDir = backupFiles(projectDir, filesToWrite) ?? backupDir;\n\n for (const destPath of filesToWrite) {\n const sourcePath = destToSource.get(destPath) ?? destPath;\n writeSyncedFile(sourceDir, projectDir, sourcePath, destPath, childScripts);\n }\n }\n\n await personalizeConfig(projectDir, {\n extendsAccount,\n extendsGateway,\n account,\n domain,\n overrides,\n plugins: childPlugins,\n workspaceOpts: { sourceDir },\n mode: \"sync\",\n existingConfig: localConfig,\n });\n\n await syncResolvedSharedDeps({\n configDir: projectDir,\n hostMode: \"local\",\n });\n\n const syncedConfig = await openResolution({ cwd: projectDir });\n if (syncedConfig?.runtime) {\n await materializeViaLayer(projectDir, syncedConfig.runtime!);\n }\n\n const newSnapshotFiles: Record<string, string> = {};\n for (const destPath of destToSource.keys()) {\n const hash = computeLocalHash(projectDir, destPath);\n if (hash) {\n newSnapshotFiles[destPath] = hash;\n }\n }\n\n const agentsMdSourcePath = toSourcePath(sourceDir, \"AGENTS.md\");\n if (agentsMdSourcePath) {\n const agentsMdSourceContent = readFileSync(join(sourceDir, agentsMdSourcePath), \"utf-8\");\n const skillsBlock = extractSkillsBlock(agentsMdSourceContent);\n if (skillsBlock) {\n const expectedContent = buildChildAgentsMd(skillsBlock, {\n overrides,\n plugins: childPlugins,\n });\n const expectedHash = computeHash(expectedContent);\n\n const agentsMdLocalHash = computeLocalHash(projectDir, \"AGENTS.md\");\n if (agentsMdLocalHash !== expectedHash) {\n writeFileSync(join(projectDir, \"AGENTS.md\"), expectedContent);\n updated.push(\"AGENTS.md\");\n }\n\n newSnapshotFiles[\"AGENTS.md\"] = expectedHash;\n }\n }\n\n await writeSnapshot(projectDir, {\n parentRef: `bos://${extendsAccount}/${extendsGateway}`,\n files: newSnapshotFiles,\n });\n\n if (!options.noInstall) {\n await runPnpmInstall(findWorkspaceRoot(projectDir)?.dir ?? projectDir);\n await runTypesGen(projectDir);\n }\n\n return {\n status: \"synced\",\n updated,\n skipped,\n added,\n conflicted,\n retired: retirement.retired,\n retiredConflicted: retirement.retiredConflicted,\n ret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Ace,oCAAmB,qBAAqB;GAC5D,IAAI,aAAa;IACf,MAAM,kBAAkBC,oCAAmB,aAAa;KACtD;KACA,SAAS;IACX,CAAC;IACD,MAAM,eAAeb,0CAAY,eAAe;IAGhD,IAD0B,iBAAiB,YAAY,WACnC,MAAM,cAAc;KACtC,+BAAcH,gBAAK,YAAY,WAAW,GAAG,eAAe;KAC5D,QAAQ,KAAK,WAAW;IAC1B;IAEA,iBAAiB,eAAe;GAClC;EACF;EAEA,MAAMqB,+BAAc,YAAY;GAC9B,WAAW,SAAS,eAAe,GAAG;GACtC,OAAO;EACT,CAAC;EAED,IAAI,CAAC,QAAQ,WAAW;GACtB,MAAMC,gCAAehB,oCAAkB,UAAU,CAAC,EAAE,OAAO,UAAU;GACrE,MAAMiB,6BAAY,UAAU;EAC9B;EAEA,OAAO;GACL,QAAQ;GACR;GACA;GACA;GACA;GACA,SAAS,WAAW;GACpB,mBAAmB,WAAW;GAC9B,kBAAkB,WAAW,aAAa;GAC1C;EACF;CACF,UAAU;EACR,MAAM,QAAQ;CAChB;AACF"}
package/dist/cli/sync.mjs CHANGED
@@ -1,13 +1,16 @@
1
1
  import { isPlainObject, mergeBosConfigWithTemplate, resolveExtendsRef } from "../merge.mjs";
2
- import { loadResolvedConfig } from "../config.mjs";
3
- import { syncResolvedSharedDeps } from "../shared-deps.mjs";
4
- import { writeGeneratedInfra } from "./infra.mjs";
2
+ import { loadAppDescriptorConfig } from "../config.mjs";
3
+ import { computeSnapshotHash } from "../utils/snapshot-hash.mjs";
5
4
  import { readSnapshot, writeSnapshot } from "./snapshot.mjs";
6
- import { buildChildAgentsMd, extractSkillsBlock, personalizeConfig, resolveSourceDir, runBunInstall, runTypesGen } from "./init.mjs";
7
- import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
8
- import { dirname, join } from "node:path";
9
- import { createHash } from "node:crypto";
5
+ import { buildChildAgentsMd, buildChildRootScripts, extractSkillsBlock, personalizeConfig, resolveSourceDir, runPnpmInstall, runTypesGen } from "./init.mjs";
6
+ import { openResolution } from "../resolution/session.mjs";
7
+ import { findWorkspaceRoot } from "../workspace.mjs";
8
+ import { syncResolvedSharedDeps } from "../shared-deps.mjs";
9
+ import { materializeViaLayer } from "../infra/materializer.mjs";
10
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
11
+ import { dirname, join, relative } from "node:path";
10
12
  import { glob } from "glob";
13
+ import { parse } from "yaml";
11
14
 
12
15
  //#region src/cli/sync.ts
13
16
  const FRAMEWORK_OWNED_SYNC_FILES = /* @__PURE__ */ new Set([
@@ -15,7 +18,6 @@ const FRAMEWORK_OWNED_SYNC_FILES = /* @__PURE__ */ new Set([
15
18
  ".gitignore",
16
19
  "biome.json",
17
20
  "bos.config.json",
18
- "bunfig.toml",
19
21
  "package.json",
20
22
  ".changeset/config.json",
21
23
  ".changeset/README.md",
@@ -26,22 +28,11 @@ const FRAMEWORK_OWNED_SYNC_FILES = /* @__PURE__ */ new Set([
26
28
  "railway.toml",
27
29
  "ui/package.json",
28
30
  "ui/postcss.config.mjs",
29
- "ui/rsbuild.config.ts",
30
31
  "ui/tsconfig.json",
31
- "ui/src/app.ts",
32
- "ui/src/globals.d.ts",
33
- "ui/src/hydrate.tsx",
34
- "ui/src/lib/api.ts",
35
- "ui/src/lib/auth.ts",
36
- "ui/src/router.server.tsx",
37
- "ui/src/router.tsx",
38
- "ui/src/routes/__root.tsx",
39
32
  "api/package.json",
40
33
  "api/plugin.dev.ts",
41
34
  "api/rspack.config.js",
42
- "api/tsconfig.contract.json",
43
35
  "api/tsconfig.json",
44
- "api/src/lib/auth.ts",
45
36
  "api/src/lib/context.ts",
46
37
  "api/drizzle.config.ts",
47
38
  "api/src/db/index.ts",
@@ -50,14 +41,45 @@ const FRAMEWORK_OWNED_SYNC_FILES = /* @__PURE__ */ new Set([
50
41
  "api/src/global.d.ts",
51
42
  "api/tests/types.d.ts"
52
43
  ]);
53
- function computeHash(content) {
54
- return createHash("sha256").update(content).digest("hex").substring(0, 16);
44
+ /**
45
+ * Files the scaffold previously sync-owned but has retired (ADR 0023) — the
46
+ * generated `.gen` bootstrap stubs replaced them. During sync: a local copy
47
+ * whose hash still matches the sync snapshot is deleted silently; a
48
+ * hand-modified (or never-snapshotted) copy is backed up, then deleted. The
49
+ * app's authored ui files (router.tsx, app.ts, lib, routes, components) are
50
+ * NOT retired — they leave the sync list as app-owned files, untouched.
51
+ */
52
+ const RETIRED_SYNC_FILES = /* @__PURE__ */ new Set([
53
+ "ui/src/entry.ts",
54
+ "ui/src/globals.d.ts",
55
+ "ui/src/hydrate.tsx",
56
+ "ui/src/router.server.tsx",
57
+ "ui/src/compose.ts"
58
+ ]);
59
+ const AGENT_SYNC_GLOBS = [
60
+ ".agents/skills/**",
61
+ "docs/agents/**",
62
+ "skills-lock.json"
63
+ ];
64
+ function isFrameworkOwnedSyncFile(filePath) {
65
+ if (FRAMEWORK_OWNED_SYNC_FILES.has(filePath)) return true;
66
+ if (filePath.startsWith(".agents/skills/") || filePath.startsWith("docs/agents/") || filePath === "skills-lock.json") return true;
67
+ if (/^plugins\/[^/]+\/src\/lib\/context\.ts$/.test(filePath)) return true;
68
+ if (/^plugins\/[^/]+\/src\/db\/(index|layer|migrate)\.ts$/.test(filePath)) return true;
69
+ if (/^plugins\/[^/]+\/rspack\.config\.js$/.test(filePath)) return true;
70
+ if (/^plugins\/[^/]+\/drizzle\.config\.ts$/.test(filePath)) return true;
71
+ if (/^plugins\/[^/]+\/src\/global\.d\.ts$/.test(filePath)) return true;
72
+ if (/^plugins\/[^/]+\/tests\/types\.d\.ts$/.test(filePath)) return true;
73
+ if (/^plugins\/[^/]+\/tsconfig\.json$/.test(filePath)) return true;
74
+ if (/^plugins\/[^/]+\/tsconfig\.contract\.json$/.test(filePath)) return true;
75
+ return false;
55
76
  }
56
77
  function computeLocalHash(projectDir, filePath) {
57
78
  const fullPath = join(projectDir, filePath);
58
79
  if (!existsSync(fullPath)) return null;
59
80
  try {
60
- return computeHash(readFileSync(fullPath));
81
+ const content = readFileSync(fullPath);
82
+ return computeSnapshotHash(content);
61
83
  } catch {
62
84
  return null;
63
85
  }
@@ -65,7 +87,8 @@ function computeLocalHash(projectDir, filePath) {
65
87
  function backupFiles(projectDir, filePaths) {
66
88
  const filesToBackup = filePaths.filter((f) => existsSync(join(projectDir, f)));
67
89
  if (filesToBackup.length === 0) return null;
68
- const backupDir = join(projectDir, ".bos", "sync-backup", (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-"));
90
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
91
+ const backupDir = join(projectDir, ".bos", "sync-backup", timestamp);
69
92
  for (const filePath of filesToBackup) {
70
93
  const src = join(projectDir, filePath);
71
94
  const dest = join(backupDir, filePath);
@@ -74,9 +97,36 @@ function backupFiles(projectDir, filePaths) {
74
97
  }
75
98
  return backupDir;
76
99
  }
100
+ /**
101
+ * Migrate a child off the retired bootstrap stub files (ADR 0023): unmodified
102
+ * copies are deleted silently, hand-modified copies are backed up first. In
103
+ * dry-run the actions are reported without touching the tree.
104
+ */
105
+ function retireSyncedFiles(projectDir, snapshotFiles, opts) {
106
+ const retired = [];
107
+ const retiredConflicted = [];
108
+ for (const destPath of RETIRED_SYNC_FILES) {
109
+ const localHash = computeLocalHash(projectDir, destPath);
110
+ if (localHash === null) continue;
111
+ if (localHash === snapshotFiles[destPath]) retired.push(destPath);
112
+ else retiredConflicted.push(destPath);
113
+ }
114
+ if (opts.dryRun || retired.length === 0 && retiredConflicted.length === 0) return {
115
+ retired,
116
+ retiredConflicted,
117
+ backupDir: null
118
+ };
119
+ const backupDir = backupFiles(projectDir, retiredConflicted);
120
+ for (const destPath of [...retired, ...retiredConflicted]) rmSync(join(projectDir, destPath));
121
+ return {
122
+ retired,
123
+ retiredConflicted,
124
+ backupDir
125
+ };
126
+ }
77
127
  function mergeStringMaps(local, template) {
78
128
  if (!local && !template) return void 0;
79
- const merged = { ...local ?? {} };
129
+ const merged = { ...local };
80
130
  for (const [name, value] of Object.entries(template ?? {})) merged[name] = value;
81
131
  return Object.keys(merged).length > 0 ? merged : void 0;
82
132
  }
@@ -88,12 +138,12 @@ function mergeWorkspacePackages(local, template) {
88
138
  for (const entry of templatePackages) if (typeof entry === "string" && entry.length > 0) ordered.add(entry);
89
139
  for (const entry of localPackages) if (typeof entry === "string" && entry.length > 0) ordered.add(entry);
90
140
  if ([...ordered].some((e) => e.startsWith("plugins/") && e !== "plugins/*")) {
91
- for (const entry of [...ordered]) if (entry.startsWith("plugins/") && entry !== "plugins/*") ordered.delete(entry);
141
+ for (const entry of ordered) if (entry.startsWith("plugins/") && entry !== "plugins/*") ordered.delete(entry);
92
142
  ordered.add("plugins/*");
93
143
  }
94
144
  return ordered.size > 0 ? [...ordered] : void 0;
95
145
  }
96
- function mergePackageJson(filePath, local, template) {
146
+ function mergePackageJson(filePath, local, template, childScripts) {
97
147
  const merged = {
98
148
  ...local,
99
149
  ...template
@@ -117,8 +167,8 @@ function mergePackageJson(filePath, local, template) {
117
167
  if (mergedDeps) merged[depField] = mergedDeps;
118
168
  else delete merged[depField];
119
169
  }
120
- if (local.scripts && typeof local.scripts === "object" || template.scripts && typeof template.scripts === "object") {
121
- const mergedScripts = mergeStringMaps(local.scripts, template.scripts);
170
+ if (local.scripts && typeof local.scripts === "object" || template.scripts && typeof template.scripts === "object" || childScripts) {
171
+ const mergedScripts = mergeStringMaps(local.scripts, filePath === "package.json" && childScripts ? childScripts : template.scripts);
122
172
  if (mergedScripts) merged.scripts = mergedScripts;
123
173
  else delete merged.scripts;
124
174
  }
@@ -145,10 +195,11 @@ function toSourcePath(sourceDir, destPath) {
145
195
  const templatePath = destPath.replace(/^\.github\//, ".github/templates/");
146
196
  if (existsSync(join(sourceDir, templatePath))) return templatePath;
147
197
  }
148
- if (existsSync(join(sourceDir, destPath))) return destPath;
198
+ const directPath = join(sourceDir, destPath);
199
+ if (existsSync(directPath)) return destPath;
149
200
  return null;
150
201
  }
151
- function buildSyncedFileContent(sourceDir, projectDir, filePath, explicitDestPath) {
202
+ function buildSyncedFileContent(sourceDir, projectDir, filePath, explicitDestPath, childScripts) {
152
203
  const src = join(sourceDir, filePath);
153
204
  const destPath = explicitDestPath ?? (filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath);
154
205
  const dest = join(projectDir, destPath);
@@ -156,7 +207,9 @@ function buildSyncedFileContent(sourceDir, projectDir, filePath, explicitDestPat
156
207
  const localContent = existsSync(dest) ? readFileSync(dest, "utf-8") : null;
157
208
  const templateContent = readFileSync(src, "utf-8");
158
209
  if (localContent) {
159
- const merged = mergeBosConfigWithTemplate(JSON.parse(localContent), JSON.parse(templateContent));
210
+ const local = JSON.parse(localContent);
211
+ const template = JSON.parse(templateContent);
212
+ const merged = mergeBosConfigWithTemplate(local, template);
160
213
  return `${JSON.stringify(merged, null, 2)}\n`;
161
214
  }
162
215
  }
@@ -164,17 +217,17 @@ function buildSyncedFileContent(sourceDir, projectDir, filePath, explicitDestPat
164
217
  const localContent = existsSync(dest) ? readFileSync(dest, "utf-8") : null;
165
218
  const templateContent = readFileSync(src, "utf-8");
166
219
  if (localContent) {
167
- const merged = mergePackageJson(destPath, JSON.parse(localContent), JSON.parse(templateContent));
220
+ const merged = mergePackageJson(destPath, JSON.parse(localContent), JSON.parse(templateContent), childScripts);
168
221
  return `${JSON.stringify(merged, null, 2)}\n`;
169
222
  }
170
223
  }
171
224
  return readFileSync(src);
172
225
  }
173
- function writeSyncedFile(sourceDir, projectDir, filePath, explicitDestPath) {
226
+ function writeSyncedFile(sourceDir, projectDir, filePath, explicitDestPath, childScripts) {
174
227
  const destPath = explicitDestPath ?? (filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath);
175
228
  const dest = join(projectDir, destPath);
176
229
  mkdirSync(dirname(dest), { recursive: true });
177
- writeFileSync(dest, buildSyncedFileContent(sourceDir, projectDir, filePath, destPath));
230
+ writeFileSync(dest, buildSyncedFileContent(sourceDir, projectDir, filePath, destPath, childScripts));
178
231
  }
179
232
  async function getSelectedChildPlugins(projectDir, localConfig) {
180
233
  if (!localConfig.plugins || typeof localConfig.plugins !== "object") return [];
@@ -191,7 +244,8 @@ async function getSelectedChildPlugins(projectDir, localConfig) {
191
244
  selected.push(pluginKey);
192
245
  continue;
193
246
  }
194
- if (existsSync(join(projectDir, rawEntry.slice(6).trim())) || pluginDirs.has(pluginKey)) selected.push(pluginKey);
247
+ const localPath = join(projectDir, rawEntry.slice(6).trim());
248
+ if (existsSync(localPath) || pluginDirs.has(pluginKey)) selected.push(pluginKey);
195
249
  continue;
196
250
  }
197
251
  if (!rawEntry || typeof rawEntry !== "object") {
@@ -204,22 +258,31 @@ async function getSelectedChildPlugins(projectDir, localConfig) {
204
258
  selected.push(pluginKey);
205
259
  continue;
206
260
  }
207
- if (existsSync(join(projectDir, development.slice(6).trim())) || pluginDirs.has(pluginKey)) selected.push(pluginKey);
261
+ const localPath = join(projectDir, development.slice(6).trim());
262
+ if (existsSync(localPath) || pluginDirs.has(pluginKey)) selected.push(pluginKey);
208
263
  }
209
264
  return selected;
210
265
  }
211
266
  function hasPluginsWorkspace(projectDir) {
212
- const packageJsonPath = join(projectDir, "package.json");
213
- if (!existsSync(packageJsonPath)) return false;
214
- try {
215
- const workspaces = JSON.parse(readFileSync(packageJsonPath, "utf-8")).workspaces;
216
- return (Array.isArray(workspaces) ? workspaces : Array.isArray(workspaces?.packages) ? workspaces.packages : []).includes("plugins/*");
217
- } catch {
218
- return false;
267
+ const root = findWorkspaceRoot(projectDir);
268
+ if (!root) return false;
269
+ const rel = relative(root.dir, projectDir);
270
+ const baseDir = rel.startsWith("..") || rel === "" ? root.dir : projectDir;
271
+ for (const manifest of ["pnpm-workspace.yaml", "package.json"]) {
272
+ const manifestPath = join(baseDir, manifest);
273
+ if (!existsSync(manifestPath)) continue;
274
+ try {
275
+ const content = readFileSync(manifestPath, "utf-8");
276
+ const packages = manifest === "pnpm-workspace.yaml" ? parse(content)?.packages : JSON.parse(content).workspaces;
277
+ if ((Array.isArray(packages) ? packages : Array.isArray(packages?.packages) ? packages.packages : []).includes("plugins/*")) return true;
278
+ } catch {
279
+ return false;
280
+ }
219
281
  }
282
+ return false;
220
283
  }
221
284
  async function syncTemplate(projectDir, options) {
222
- const localConfig = JSON.parse(readFileSync(join(projectDir, "bos.config.json"), "utf-8"));
285
+ const localConfig = existsSync(join(projectDir, "bos.app.ts")) ? await loadAppDescriptorConfig(join(projectDir, "bos.app.ts")) : JSON.parse(readFileSync(join(projectDir, "bos.config.json"), "utf-8"));
223
286
  let extendsRef;
224
287
  if (typeof localConfig.extends === "string") extendsRef = localConfig.extends;
225
288
  else if (isPlainObject(localConfig.extends)) extendsRef = resolveExtendsRef(localConfig.extends, "production");
@@ -252,8 +315,16 @@ async function syncTemplate(projectDir, options) {
252
315
  const withApi = existsSync(join(projectDir, "api", "package.json"));
253
316
  const withHost = existsSync(join(projectDir, "host", "package.json"));
254
317
  const withPlugins = childPlugins.length > 0 || hasPluginsWorkspace(projectDir);
318
+ const childScripts = buildChildRootScripts({
319
+ ui: withUi,
320
+ api: withApi,
321
+ host: withHost,
322
+ plugins: withPlugins
323
+ });
255
324
  const destToSource = /* @__PURE__ */ new Map();
325
+ const tsFormChild = !existsSync(join(projectDir, "bos.config.json"));
256
326
  for (const destPath of FRAMEWORK_OWNED_SYNC_FILES) {
327
+ if (destPath === "bos.config.json" && tsFormChild) continue;
257
328
  if (destPath.startsWith("ui/") && !withUi) continue;
258
329
  if (destPath.startsWith("api/") && !withApi) continue;
259
330
  if (destPath.startsWith("host/") && !withHost) continue;
@@ -261,6 +332,18 @@ async function syncTemplate(projectDir, options) {
261
332
  if (!sourcePath) continue;
262
333
  destToSource.set(destPath, sourcePath);
263
334
  }
335
+ for (const destPath of await glob(AGENT_SYNC_GLOBS, {
336
+ cwd: sourceDir,
337
+ nodir: true,
338
+ dot: true,
339
+ absolute: false,
340
+ ignore: [
341
+ "**/node_modules/**",
342
+ "**/.git/**",
343
+ "**/dist/**",
344
+ "**/.bos/**"
345
+ ]
346
+ })) destToSource.set(destPath, destPath);
264
347
  for (const pluginKey of childPlugins) {
265
348
  if (!existsSync(join(projectDir, "plugins", pluginKey, "src"))) continue;
266
349
  for (const libFile of ["auth.ts", "context.ts"]) {
@@ -307,11 +390,9 @@ async function syncTemplate(projectDir, options) {
307
390
  }
308
391
  for (const pluginKey of childPlugins) {
309
392
  if (!existsSync(join(projectDir, "plugins", pluginKey))) continue;
310
- for (const tsconfigFile of ["tsconfig.json", "tsconfig.contract.json"]) {
311
- const sourceFile = `plugins/_template/${tsconfigFile}`;
312
- if (!existsSync(join(sourceDir, sourceFile))) continue;
313
- destToSource.set(`plugins/${pluginKey}/${tsconfigFile}`, sourceFile);
314
- }
393
+ const sourceFile = "plugins/_template/tsconfig.json";
394
+ if (!existsSync(join(sourceDir, sourceFile))) continue;
395
+ destToSource.set(`plugins/${pluginKey}/tsconfig.json`, sourceFile);
315
396
  }
316
397
  const updated = [];
317
398
  const skipped = [];
@@ -319,8 +400,12 @@ async function syncTemplate(projectDir, options) {
319
400
  const conflicted = [];
320
401
  const snapshotFiles = (await readSnapshot(projectDir))?.files ?? {};
321
402
  for (const [destPath, filePath] of destToSource.entries()) {
403
+ if (!existsSync(join(sourceDir, filePath))) {
404
+ skipped.push(destPath);
405
+ continue;
406
+ }
322
407
  const localHash = computeLocalHash(projectDir, destPath);
323
- const sourceHash = computeHash(buildSyncedFileContent(sourceDir, projectDir, filePath));
408
+ const sourceHash = computeSnapshotHash(buildSyncedFileContent(sourceDir, projectDir, filePath, void 0, childScripts));
324
409
  if (localHash === null) {
325
410
  added.push(destPath);
326
411
  continue;
@@ -354,32 +439,38 @@ async function syncTemplate(projectDir, options) {
354
439
  if (options.dryRun) {
355
440
  const agentsMdSourcePath = toSourcePath(sourceDir, "AGENTS.md");
356
441
  if (agentsMdSourcePath) {
357
- const skillsBlock = extractSkillsBlock(readFileSync(join(sourceDir, agentsMdSourcePath), "utf-8"));
442
+ const agentsMdSourceContent = readFileSync(join(sourceDir, agentsMdSourcePath), "utf-8");
443
+ const skillsBlock = extractSkillsBlock(agentsMdSourceContent);
358
444
  if (skillsBlock) {
359
- const expectedHash = computeHash(buildChildAgentsMd(skillsBlock, {
445
+ const expectedContent = buildChildAgentsMd(skillsBlock, {
360
446
  overrides,
361
447
  plugins: childPlugins
362
- }));
448
+ });
449
+ const expectedHash = computeSnapshotHash(expectedContent);
363
450
  if (computeLocalHash(projectDir, "AGENTS.md") !== expectedHash) updated.push("AGENTS.md");
364
451
  }
365
452
  }
453
+ const retirement = retireSyncedFiles(projectDir, snapshotFiles, { dryRun: true });
366
454
  return {
367
455
  status: "dry-run",
368
456
  updated,
369
457
  skipped,
370
458
  added,
371
- conflicted
459
+ conflicted,
460
+ retired: retirement.retired,
461
+ retiredConflicted: retirement.retiredConflicted
372
462
  };
373
463
  }
464
+ const retirement = retireSyncedFiles(projectDir, snapshotFiles, { dryRun: false });
374
465
  const filesToWrite = [
375
466
  ...updated,
376
467
  ...added,
377
468
  ...conflicted
378
469
  ];
379
- let backupDir;
470
+ let backupDir = retirement.backupDir ?? void 0;
380
471
  if (filesToWrite.length > 0) {
381
- backupDir = backupFiles(projectDir, filesToWrite) ?? void 0;
382
- for (const destPath of filesToWrite) writeSyncedFile(sourceDir, projectDir, destToSource.get(destPath) ?? destPath, destPath);
472
+ backupDir = backupFiles(projectDir, filesToWrite) ?? backupDir;
473
+ for (const destPath of filesToWrite) writeSyncedFile(sourceDir, projectDir, destToSource.get(destPath) ?? destPath, destPath, childScripts);
383
474
  }
384
475
  await personalizeConfig(projectDir, {
385
476
  extendsAccount,
@@ -396,8 +487,8 @@ async function syncTemplate(projectDir, options) {
396
487
  configDir: projectDir,
397
488
  hostMode: "local"
398
489
  });
399
- const syncedConfig = await loadResolvedConfig({ cwd: projectDir });
400
- if (syncedConfig?.runtime) writeGeneratedInfra(projectDir, syncedConfig.runtime);
490
+ const syncedConfig = await openResolution({ cwd: projectDir });
491
+ if (syncedConfig?.runtime) await materializeViaLayer(projectDir, syncedConfig.runtime);
401
492
  const newSnapshotFiles = {};
402
493
  for (const destPath of destToSource.keys()) {
403
494
  const hash = computeLocalHash(projectDir, destPath);
@@ -405,13 +496,14 @@ async function syncTemplate(projectDir, options) {
405
496
  }
406
497
  const agentsMdSourcePath = toSourcePath(sourceDir, "AGENTS.md");
407
498
  if (agentsMdSourcePath) {
408
- const skillsBlock = extractSkillsBlock(readFileSync(join(sourceDir, agentsMdSourcePath), "utf-8"));
499
+ const agentsMdSourceContent = readFileSync(join(sourceDir, agentsMdSourcePath), "utf-8");
500
+ const skillsBlock = extractSkillsBlock(agentsMdSourceContent);
409
501
  if (skillsBlock) {
410
502
  const expectedContent = buildChildAgentsMd(skillsBlock, {
411
503
  overrides,
412
504
  plugins: childPlugins
413
505
  });
414
- const expectedHash = computeHash(expectedContent);
506
+ const expectedHash = computeSnapshotHash(expectedContent);
415
507
  if (computeLocalHash(projectDir, "AGENTS.md") !== expectedHash) {
416
508
  writeFileSync(join(projectDir, "AGENTS.md"), expectedContent);
417
509
  updated.push("AGENTS.md");
@@ -424,7 +516,7 @@ async function syncTemplate(projectDir, options) {
424
516
  files: newSnapshotFiles
425
517
  });
426
518
  if (!options.noInstall) {
427
- await runBunInstall(projectDir);
519
+ await runPnpmInstall(findWorkspaceRoot(projectDir)?.dir ?? projectDir);
428
520
  await runTypesGen(projectDir);
429
521
  }
430
522
  return {
@@ -433,6 +525,9 @@ async function syncTemplate(projectDir, options) {
433
525
  skipped,
434
526
  added,
435
527
  conflicted,
528
+ retired: retirement.retired,
529
+ retiredConflicted: retirement.retiredConflicted,
530
+ retiredBackupDir: retirement.backupDir ?? void 0,
436
531
  backupDir
437
532
  };
438
533
  } finally {
@@ -441,5 +536,5 @@ async function syncTemplate(projectDir, options) {
441
536
  }
442
537
 
443
538
  //#endregion
444
- export { mergePackageJson, syncTemplate };
539
+ export { RETIRED_SYNC_FILES, isFrameworkOwnedSyncFile, mergePackageJson, retireSyncedFiles, syncTemplate };
445
540
  //# sourceMappingURL=sync.mjs.map