everything-dev 1.53.2 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +627 -199
  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 +616 -197
  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
package/dist/cli/init.mjs CHANGED
@@ -1,32 +1,117 @@
1
1
  import { buildAuthContractStub, buildAuthExportStub, buildAuthTypesGenContent } from "../auth-types-gen.mjs";
2
2
  import { fetchResponse } from "../http-client.mjs";
3
3
  import { fetchBosConfigFromFastKv } from "../fastkv.mjs";
4
+ import { findConfigPath, isAppDescriptorPath, loadAppDescriptorConfig } from "../config.mjs";
5
+ import { serializeAppDescriptorSource } from "../descriptor/serialize.mjs";
6
+ import { readWorkspaceCatalog as readWorkspaceCatalog$1 } from "../workspace-catalog.mjs";
4
7
  import { loadManifestNormalizationSpec, normalizePackageManifestsInTree } from "../internal/manifest-normalizer.mjs";
5
8
  import { saveBosConfig } from "../utils/save-config.mjs";
9
+ import { computeSnapshotHash } from "../utils/snapshot-hash.mjs";
6
10
  import { writeSnapshot } from "./snapshot.mjs";
7
- import { getExtendsRef, parseBosRef, readJsonFile } from "./utils/helpers.mjs";
8
- import { createRequire } from "node:module";
11
+ import { getExtendsRef, parseBosRef } from "./utils/helpers.mjs";
12
+ import { runDockerComposeUp } from "../infra/docker.mjs";
13
+ import { walkExtendsChain } from "../resolution/session.mjs";
9
14
  import { createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
- import { dirname, join, relative, resolve } from "node:path";
11
- import { createHash } from "node:crypto";
15
+ import { basename, dirname, join, relative, resolve } from "node:path";
12
16
  import { tmpdir } from "node:os";
13
- import { execa } from "execa";
14
17
  import { pipeline } from "node:stream/promises";
18
+ import { execa } from "execa";
15
19
  import { glob } from "glob";
20
+ import { extract } from "tar";
21
+ import { parse, stringify } from "yaml";
16
22
 
17
23
  //#region src/cli/init.ts
18
- const require = createRequire(import.meta.url);
24
+ const PNPM_PACKAGE_MANAGER = "pnpm@12.10.1";
25
+ /**
26
+ * Transitive-singleton overrides every workspace in the fleet must agree on
27
+ * (ticket 05's deviation log: isolated resolution splits better-auth
28
+ * peer-context identities across the plugin fleet). Values derive from the
29
+ * catalog so sync keeps them current; keys absent from the catalog are left
30
+ * unpinned.
31
+ */
32
+ const CHILD_OVERRIDE_KEYS = [
33
+ "@better-fetch/fetch",
34
+ "@rspack/core",
35
+ "better-auth",
36
+ "react",
37
+ "react-dom"
38
+ ];
39
+ /**
40
+ * The child's workspace manifest: pnpm-workspace.yaml is canonical (v2, ADR
41
+ * 0026) — packages globs synthesized from the child's override sections, the
42
+ * catalog merged over any local entry, plus the fleet-wide linker posture and
43
+ * singleton overrides. Re-running (sync/upgrade) merges instead of clobbering.
44
+ */
45
+ function writeChildWorkspaceYaml(projectDir, next) {
46
+ const yamlPath = join(projectDir, "pnpm-workspace.yaml");
47
+ let doc = {};
48
+ if (existsSync(yamlPath)) try {
49
+ const parsed = parse(readFileSync(yamlPath, "utf-8"));
50
+ if (parsed && typeof parsed === "object") doc = parsed;
51
+ } catch {
52
+ doc = {};
53
+ }
54
+ let changed = !existsSync(yamlPath);
55
+ const packages = [.../* @__PURE__ */ new Set([...doc.packages ?? [], ...next.packages])].sort();
56
+ if (JSON.stringify(packages) !== JSON.stringify(doc.packages)) {
57
+ doc.packages = packages;
58
+ changed = true;
59
+ }
60
+ const catalog = { ...doc.catalog ?? {} };
61
+ for (const [name, version] of Object.entries(next.catalog)) if (catalog[name] !== version) {
62
+ catalog[name] = version;
63
+ changed = true;
64
+ }
65
+ if (Object.keys(catalog).length > 0 && Object.keys(catalog).length !== Object.keys(doc.catalog ?? {}).length) changed = true;
66
+ if (changed || !doc.catalog) doc.catalog = Object.fromEntries(Object.entries(catalog).sort(([a], [b]) => a.localeCompare(b)));
67
+ if (doc.nodeLinker !== "hoisted") {
68
+ doc.nodeLinker = "hoisted";
69
+ changed = true;
70
+ }
71
+ if (doc.linkWorkspacePackages !== true) {
72
+ doc.linkWorkspacePackages = true;
73
+ changed = true;
74
+ }
75
+ if (doc.ignoreScripts !== true) {
76
+ doc.ignoreScripts = true;
77
+ changed = true;
78
+ }
79
+ const overrides = { ...doc.overrides ?? {} };
80
+ for (const key of CHILD_OVERRIDE_KEYS) if (catalog[key] && overrides[key] !== catalog[key]) {
81
+ overrides[key] = catalog[key];
82
+ changed = true;
83
+ }
84
+ if (Object.keys(overrides).length > 0) doc.overrides = Object.fromEntries(Object.entries(overrides).sort(([a], [b]) => a.localeCompare(b)));
85
+ if (changed) {
86
+ writeFileSync(yamlPath, `${stringify(doc, { lineWidth: 0 }).trimEnd()}\n`);
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ /**
92
+ * Init must never reuse a lockfile left in the target (copied from a parent
93
+ * checkout or left by a previous run) — stale framework resolutions would
94
+ * survive the fresh install. Bun's bun.lock is deleted on sight (ADR 0026's
95
+ * silent-revert footgun); the child's own pnpm-lock.yaml is re-resolved.
96
+ */
97
+ function removeStrayLockfiles(projectDir) {
98
+ for (const lockfile of ["pnpm-lock.yaml", "bun.lock"]) {
99
+ const lockfilePath = join(projectDir, lockfile);
100
+ if (existsSync(lockfilePath)) rmSync(lockfilePath, { force: true });
101
+ }
102
+ }
19
103
  const INIT_ROOT_PATTERNS = [
20
104
  "bos.config.json",
21
105
  "package.json",
22
106
  ".env.example",
23
107
  ".gitignore",
24
108
  "biome.json",
25
- "bunfig.toml",
26
- "Dockerfile",
27
109
  "railway.json",
28
110
  "railway.toml",
29
111
  "AGENTS.md",
112
+ ".agents/skills/**",
113
+ "skills-lock.json",
114
+ "docs/agents/**",
30
115
  ".changeset/config.json",
31
116
  ".changeset/README.md",
32
117
  "README.md",
@@ -40,75 +125,43 @@ const OVERRIDE_WORKSPACE_MAP = {
40
125
  plugins: []
41
126
  };
42
127
  function readWorkspaceCatalog(sourceDir) {
43
- const pkgPath = join(sourceDir, "package.json");
44
- if (!existsSync(pkgPath)) return {};
45
- return { ...readJsonFile(pkgPath).workspaces?.catalog ?? {} };
128
+ return readWorkspaceCatalog$1(sourceDir);
46
129
  }
47
130
  async function resolveCatalogChainSource(opts) {
131
+ const entry = opts.sourceDir ? findConfigPath(resolve(opts.sourceDir)) ?? join(resolve(opts.sourceDir), "bos.config.json") : `bos://${opts.extendsAccount}/${opts.extendsGateway}`;
48
132
  const catalogs = [];
49
133
  const cleanups = [];
50
- const extendsChain = [];
51
- const visited = /* @__PURE__ */ new Set();
134
+ const resolvedRefs = [];
52
135
  let repository;
53
- let currentRef = `bos://${opts.extendsAccount}/${opts.extendsGateway}`;
54
- let sourceDir = opts.sourceDir ? resolve(opts.sourceDir) : void 0;
55
- let configPath = sourceDir ? join(sourceDir, "bos.config.json") : void 0;
56
136
  try {
57
- while (true) {
58
- if (visited.has(currentRef)) throw new Error(`Circular extends detected while resolving catalog source: ${currentRef}`);
59
- visited.add(currentRef);
60
- extendsChain.push(currentRef);
61
- let config;
62
- let currentSourceDir = sourceDir;
63
- let cleanup = async () => {};
64
- if (configPath) {
65
- config = readJsonFile(configPath);
66
- currentSourceDir = dirname(configPath);
67
- } else {
68
- const parsed = parseBosRef(currentRef);
69
- if (!parsed) break;
70
- const sourceResult = await resolveSourceDir({
71
- extendsAccount: parsed.account,
72
- extendsGateway: parsed.gateway
73
- });
74
- config = sourceResult.parentConfig;
75
- currentSourceDir = sourceResult.sourceDir || void 0;
76
- cleanup = sourceResult.cleanup;
137
+ await walkExtendsChain(entry, {
138
+ env: "production",
139
+ collectCatalogs: true,
140
+ registerCleanup: (fn) => cleanups.push(fn),
141
+ visit: async (link) => {
142
+ resolvedRefs.unshift(link.ref.startsWith("bos://") ? link.ref : join(link.baseDir, basename(link.ref)));
143
+ catalogs.push(readWorkspaceCatalog(link.sourceDir ?? link.baseDir));
144
+ const repositoryValue = link.config.repository;
145
+ if (typeof repositoryValue === "string" && repository === void 0) repository = repositoryValue;
77
146
  }
78
- cleanups.push(cleanup);
79
- catalogs.push(currentSourceDir ? readWorkspaceCatalog(currentSourceDir) : {});
80
- if (typeof config.repository === "string") repository = config.repository;
81
- const nextExtendsRef = getExtendsRef(config);
82
- if (!nextExtendsRef) break;
83
- if (nextExtendsRef.startsWith("bos://")) {
84
- currentRef = nextExtendsRef;
85
- sourceDir = void 0;
86
- configPath = void 0;
87
- continue;
88
- }
89
- if (!currentSourceDir) break;
90
- const nextConfigPath = resolve(currentSourceDir, nextExtendsRef);
91
- if (!existsSync(nextConfigPath)) break;
92
- currentRef = nextConfigPath;
93
- sourceDir = dirname(nextConfigPath);
94
- configPath = nextConfigPath;
95
- }
147
+ });
96
148
  } finally {
97
- for (const cleanup of cleanups.reverse()) await cleanup();
149
+ for (const cleanup of [...cleanups].reverse()) await cleanup();
98
150
  }
99
151
  return {
100
- catalog: Object.assign({}, ...catalogs.reverse()),
152
+ catalog: Object.assign({}, ...catalogs),
101
153
  repository,
102
- extendsChain
154
+ extendsChain: opts.sourceDir ? [`bos://${opts.extendsAccount}/${opts.extendsGateway}`, ...resolvedRefs.slice(1)] : resolvedRefs
103
155
  };
104
156
  }
105
157
  async function resolveSourceDir(opts) {
106
158
  if (opts.source) {
107
159
  const sourceDir = resolve(opts.source);
108
- if (!existsSync(join(sourceDir, "bos.config.json"))) throw new Error(`No bos.config.json found in source directory: ${sourceDir}`);
160
+ const configPath = findConfigPath(sourceDir);
161
+ if (!configPath) throw new Error(`No authored config (bos.app.ts or bos.config.json) found in source directory: ${sourceDir}`);
109
162
  return {
110
163
  sourceDir,
111
- parentConfig: JSON.parse(readFileSync(join(sourceDir, "bos.config.json"), "utf-8")),
164
+ parentConfig: isAppDescriptorPath(configPath) ? await loadAppDescriptorConfig(configPath) : JSON.parse(readFileSync(configPath, "utf-8")),
112
165
  cleanup: async () => {}
113
166
  };
114
167
  }
@@ -140,7 +193,8 @@ function buildInitPatterns(overrides, plugins, pluginDirMap) {
140
193
  const has = (section) => overrides.includes(section);
141
194
  const patterns = [...INIT_ROOT_PATTERNS];
142
195
  if (has("ui")) patterns.push("ui/**");
143
- if (has("api")) patterns.push("api/**");
196
+ if (has("api")) patterns.push(API_TEMPLATE_PATTERN);
197
+ if (has("api") || has("host")) patterns.push(COMPOSE_TEMPLATE_PATTERN);
144
198
  if (has("host")) patterns.push("host/**");
145
199
  if (has("plugins")) for (const plugin of plugins ?? []) {
146
200
  const dirName = pluginDirMap?.[plugin] ?? plugin;
@@ -148,6 +202,16 @@ function buildInitPatterns(overrides, plugins, pluginDirMap) {
148
202
  }
149
203
  return patterns;
150
204
  }
205
+ /** api-override children get the slim generic shell, never the parent's domain API. */
206
+ const API_TEMPLATE_PATTERN = ".github/templates/api/**";
207
+ /** Child-sized compose (api + api-test databases) for local compute overrides. */
208
+ const COMPOSE_TEMPLATE_PATTERN = ".github/templates/docker-compose.yml";
209
+ function isApiTemplatePath(filePath) {
210
+ return filePath.startsWith(".github/templates/api/");
211
+ }
212
+ function isComposeTemplatePath(filePath) {
213
+ return filePath === COMPOSE_TEMPLATE_PATTERN;
214
+ }
151
215
  function buildPluginRouteExclusions(parentConfig, selectedPlugins) {
152
216
  if (!parentConfig?.plugins) return [];
153
217
  const selected = new Set(selectedPlugins);
@@ -161,6 +225,54 @@ function buildPluginRouteExclusions(parentConfig, selectedPlugins) {
161
225
  }
162
226
  return claimedByUnselected.filter((route) => !claimedBySelected.has(route));
163
227
  }
228
+ const STARTER_PRODUCT_EXCLUSIONS = [
229
+ "_public/explore.tsx",
230
+ "_public/stake.tsx",
231
+ "_public/n/**",
232
+ "_public/$accountId.tsx",
233
+ "_public/$accountId/**",
234
+ "_public/activity/**",
235
+ "_public/-stake-*",
236
+ "_authenticated/_dashboard/dashboard/node/**",
237
+ "_authenticated/_dashboard/nodes/**",
238
+ "_authenticated/_dashboard/tenant.*",
239
+ "_authenticated/_dashboard/discover.tsx",
240
+ "_authenticated/_dashboard/apply.tsx",
241
+ "_authenticated/_dashboard/prototype-staking-poc.tsx",
242
+ "_authenticated/onboarding/**",
243
+ "_admin/_dashboard/_dashboard/admin/nodes/**",
244
+ "_admin/_dashboard/_dashboard/admin/proposals/**",
245
+ "_admin/_dashboard/_dashboard/admin/tenants/**",
246
+ "_admin/_dashboard/_dashboard/admin/relayer.tsx",
247
+ "_admin/_dashboard/_dashboard/admin/organizations.tsx"
248
+ ];
249
+ const STARTER_SIMPLE_EXCLUSIONS = [
250
+ "_authenticated.tsx",
251
+ "_authenticated/**",
252
+ "_admin.tsx",
253
+ "_admin/**"
254
+ ];
255
+ /**
256
+ * Route-file globs (relative to the child's `ui/src/routes/`) that a starter
257
+ * of the given level must not receive. Parent `starter` config can add
258
+ * exclusions (`exclude`, `levels[level].exclude`) or reclaim routes for a
259
+ * level (`levels[level].include`). Entries are prefixed with
260
+ * `ui/src/routes/` so they compose with `copyFilteredFiles`'s ignore list.
261
+ */
262
+ function buildStarterRouteExclusions(level, parentConfig) {
263
+ const excluded = /* @__PURE__ */ new Set([...STARTER_PRODUCT_EXCLUSIONS]);
264
+ if (level === "simple") for (const entry of STARTER_SIMPLE_EXCLUSIONS) excluded.add(entry);
265
+ const starter = parentConfig?.starter;
266
+ if (starter) {
267
+ for (const entry of starter.exclude ?? []) excluded.add(entry);
268
+ const levelConfig = starter.levels?.[level];
269
+ if (levelConfig) {
270
+ for (const entry of levelConfig.exclude ?? []) excluded.add(entry);
271
+ for (const entry of levelConfig.include ?? []) excluded.delete(entry);
272
+ }
273
+ }
274
+ return [...excluded].map((entry) => `ui/src/routes/${entry}`);
275
+ }
164
276
  function extractPluginRoutes(entry) {
165
277
  if (typeof entry !== "object" || entry === null) return void 0;
166
278
  const routes = entry.routes;
@@ -168,10 +280,13 @@ function extractPluginRoutes(entry) {
168
280
  return routes.filter((r) => typeof r === "string");
169
281
  }
170
282
  function sourcePathToDestinationPath(filePath) {
283
+ if (isApiTemplatePath(filePath)) return filePath.replace(/^\.github\/templates\/api\//, "api/");
284
+ if (isComposeTemplatePath(filePath)) return "docker-compose.yml";
171
285
  return filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
172
286
  }
173
287
  async function fetchParentConfig(extendsAccount, extendsGateway) {
174
- return fetchBosConfigFromFastKv(`bos://${extendsAccount}/${extendsGateway}`);
288
+ const bosUrl = `bos://${extendsAccount}/${extendsGateway}`;
289
+ return fetchBosConfigFromFastKv(bosUrl);
175
290
  }
176
291
  async function resolveRepositoryViaExtendsChain(extendsAccount, extendsGateway, visited = /* @__PURE__ */ new Set()) {
177
292
  const key = `bos://${extendsAccount}/${extendsGateway}`;
@@ -185,7 +300,8 @@ async function resolveRepositoryViaExtendsChain(extendsAccount, extendsGateway,
185
300
  };
186
301
  const extendsRef = getExtendsRef(config);
187
302
  if (extendsRef) {
188
- const parsed = parseBosRef(extendsRef.startsWith("bos://") ? extendsRef : `bos://${extendsRef}`);
303
+ const normalized = extendsRef.startsWith("bos://") ? extendsRef : `bos://${extendsRef}`;
304
+ const parsed = parseBosRef(normalized);
189
305
  if (parsed) {
190
306
  const result = await resolveRepositoryViaExtendsChain(parsed.account, parsed.gateway, visited);
191
307
  if (result) return result;
@@ -246,7 +362,7 @@ async function downloadTarball(repoUrl) {
246
362
  await pipeline(reader, fileStream);
247
363
  const extractDir = mkTmpDir("bos-init-extract-");
248
364
  try {
249
- await require("tar").extract({
365
+ await extract({
250
366
  cwd: extractDir,
251
367
  file: tarballPath,
252
368
  strip: 1
@@ -276,12 +392,12 @@ async function downloadTarball(repoUrl) {
276
392
  }
277
393
  function parseGitHubUrl(url) {
278
394
  const httpsMatch = url.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?(?:\/.*)?$/);
279
- if (httpsMatch) return {
395
+ if (httpsMatch?.[1] && httpsMatch[2]) return {
280
396
  owner: httpsMatch[1],
281
397
  repo: httpsMatch[2]
282
398
  };
283
399
  const sshMatch = url.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
284
- if (sshMatch) return {
400
+ if (sshMatch?.[1] && sshMatch[2]) return {
285
401
  owner: sshMatch[1],
286
402
  repo: sshMatch[2]
287
403
  };
@@ -307,14 +423,22 @@ async function copyFilteredFiles(sourceDir, destination, patterns, options) {
307
423
  });
308
424
  for (const match of matches) allFiles.add(match);
309
425
  }
426
+ if (!options.overrides.includes("api")) {
427
+ for (const match of allFiles) if (isApiTemplatePath(match)) allFiles.delete(match);
428
+ }
429
+ if (!options.overrides.includes("api") && !options.overrides.includes("host")) {
430
+ for (const match of allFiles) if (isComposeTemplatePath(match)) allFiles.delete(match);
431
+ }
310
432
  mkdirSync(destination, { recursive: true });
311
433
  let count = 0;
312
434
  for (const filePath of allFiles) {
313
435
  const src = join(sourceDir, filePath);
314
436
  if (!lstatSync(src).isFile()) continue;
315
- const dest = join(destination, sourcePathToDestinationPath(filePath));
437
+ const destPath = sourcePathToDestinationPath(filePath);
438
+ const dest = join(destination, destPath);
316
439
  mkdirSync(dirname(dest), { recursive: true });
317
- writeFileSync(dest, readFileSync(src));
440
+ const content = readFileSync(src);
441
+ writeFileSync(dest, content);
318
442
  count++;
319
443
  }
320
444
  return count;
@@ -324,13 +448,52 @@ function stripProductionFields(entry) {
324
448
  delete entry.integrity;
325
449
  delete entry.ssr;
326
450
  delete entry.ssrIntegrity;
451
+ delete entry.pin;
452
+ }
453
+ /**
454
+ * Scaffold the authored config as the TS form: the personalized
455
+ * bos.config.json materializes into an authored `bos.app.ts` descriptor and
456
+ * the JSON copy is removed — publish/sync still canonicalize to JSON for
457
+ * FastKV from the resolved config. Returns the config that was converted, so
458
+ * callers that need it (before the child has node_modules to import the
459
+ * descriptor) can pass it onward.
460
+ */
461
+ async function convertChildConfigToAppForm(destination) {
462
+ const configPath = join(destination, "bos.config.json");
463
+ if (!existsSync(configPath)) return null;
464
+ const config = JSON.parse(readFileSync(configPath, "utf-8"));
465
+ writeFileSync(join(destination, "bos.app.ts"), serializeAppDescriptorSource(config));
466
+ rmSync(configPath);
467
+ return config;
468
+ }
469
+ /**
470
+ * Scaffold the root dev-overlay starter (`bos.dev.ts`). Idempotent — never
471
+ * overwrites an existing overlay. Dev overlays are merged child-wins over
472
+ * the resolved config in development and are never published.
473
+ */
474
+ function writeDevOverlayTemplate(destination, opts = {}) {
475
+ const overlayPath = join(destination, "bos.dev.ts");
476
+ if (existsSync(overlayPath)) return;
477
+ const extendsLine = opts.extendsRef ? `\n// Inherited base: ${opts.extendsRef}\n` : "";
478
+ writeFileSync(overlayPath, `import type { AppDescriptor } from "everything-dev/descriptor";
479
+ ${extendsLine}
480
+ /**
481
+ * Development-only overlay for bos.app.ts — merged child-wins over the
482
+ * resolved config when the environment is development. Never published.
483
+ * Example: pin the auth attachment to a running dev server instead of
484
+ * letting the dev harness spawn it.
485
+ */
486
+ export default {
487
+ // auth: { development: "http://localhost:3006" },
488
+ } satisfies Partial<AppDescriptor>;
489
+ `);
327
490
  }
328
491
  function buildRootTypecheckScript(sections) {
329
- const commands = ["bun run types:gen"];
330
- if (sections.ui) commands.push("if [ -d ui ]; then bun run --cwd ui typecheck; fi");
331
- if (sections.api) commands.push("if [ -d api ]; then bun run --cwd api typecheck; fi");
332
- if (sections.host) commands.push("if [ -d host ]; then bun run --cwd host typecheck; fi");
333
- if (sections.plugins) commands.push("if [ -d plugins ]; then for dir in plugins/*; do if [ -f \"$dir/package.json\" ]; then bun run --cwd \"$dir\" typecheck; fi; done; fi");
492
+ const commands = ["pnpm run types:gen"];
493
+ if (sections.ui) commands.push("if [ -d ui ]; then pnpm --dir ui run typecheck; fi");
494
+ if (sections.api) commands.push("if [ -d api ]; then pnpm --dir api run typecheck; fi");
495
+ if (sections.host) commands.push("if [ -d host ]; then pnpm --dir host run typecheck; fi");
496
+ if (sections.plugins) commands.push("if [ -d plugins ]; then for dir in plugins/*; do if [ -f \"$dir/package.json\" ]; then pnpm --dir \"$dir\" run typecheck; fi; done; fi");
334
497
  return commands.join(" && ");
335
498
  }
336
499
  function getParentOnlyScriptKeys(projectDir) {
@@ -355,7 +518,7 @@ function buildChildRootScripts(sections) {
355
518
  dev: "bos dev",
356
519
  "dev:proxy": "bos dev --proxy",
357
520
  build: "bos build",
358
- deploy: "bos build --deploy",
521
+ deploy: "bos deploy",
359
522
  publish: "bos publish",
360
523
  start: "bos start",
361
524
  typecheck: buildRootTypecheckScript(sections),
@@ -366,29 +529,28 @@ function buildChildRootScripts(sections) {
366
529
  changeset: "changeset",
367
530
  version: "changeset version",
368
531
  release: "echo 'Packages versioned - app release handled by workflow'",
369
- postinstall: "node node_modules/.bin/bos types gen || true",
370
- "types:gen": "node node_modules/.bin/bos types gen",
532
+ "types:gen": "bos types gen",
371
533
  bos: "bos"
372
534
  };
373
535
  if (sections.api) {
374
- scripts["db:push"] = "bun run --cwd api drizzle-kit push";
536
+ scripts["db:push"] = "pnpm --dir api exec drizzle-kit push";
375
537
  scripts["db:studio"] = "bos db:studio";
376
538
  scripts["db:doctor"] = "bos db:doctor";
377
539
  scripts["db:repair"] = "bos db:repair";
378
- scripts["db:generate"] = "bun run --cwd api drizzle-kit generate";
379
- scripts["db:migrate"] = "bun run --cwd api drizzle-kit migrate";
380
- scripts["test:api"] = "bun run --cwd api test --if-present";
381
- scripts["test:integration"] = "bun run --cwd api test tests/integration/ --if-present";
540
+ scripts["db:generate"] = "pnpm --dir api exec drizzle-kit generate";
541
+ scripts["db:migrate"] = "pnpm --dir api exec drizzle-kit migrate";
542
+ scripts["test:api"] = "pnpm --dir api run test --if-present";
543
+ scripts["test:integration"] = "pnpm --dir api run test tests/integration/ --if-present";
382
544
  }
383
- if (sections.host) scripts["test:e2e"] = "bun run --cwd host test --if-present";
545
+ if (sections.host) scripts["test:e2e"] = "pnpm --dir host run test --if-present";
384
546
  const testTargets = [];
385
- if (sections.api) testTargets.push("bun run --cwd api test --if-present");
386
- if (sections.host) testTargets.push("bun run --cwd host test --if-present");
387
- if (sections.ui) testTargets.push("bun run --cwd ui test --if-present");
388
- if (sections.plugins) testTargets.push("for d in plugins/*; do [ -f \"$d/package.json\" ] && bun run --cwd \"$d\" test --if-present; done");
547
+ if (sections.api) testTargets.push("pnpm --dir api run test --if-present");
548
+ if (sections.host) testTargets.push("pnpm --dir host run test --if-present");
549
+ if (sections.ui) testTargets.push("pnpm --dir ui run test --if-present");
550
+ if (sections.plugins) testTargets.push("for d in plugins/*; do [ -f \"$d/package.json\" ] && pnpm --dir \"$d\" run test --if-present; done");
389
551
  scripts.test = testTargets.length > 0 ? testTargets.join(" && ") : "echo \"No workspace directories configured\"";
390
552
  if (sections.api || sections.host) {
391
- scripts["dev:postgres"] = "docker compose up -d --wait && bun run dev";
553
+ scripts["dev:postgres"] = "docker compose up -d --wait && pnpm run dev";
392
554
  scripts["dev:postgres:down"] = "docker compose down";
393
555
  scripts["dev:postgres:reset"] = "docker compose down -v && docker compose up -d --wait";
394
556
  }
@@ -399,6 +561,10 @@ function buildChildRootScripts(sections) {
399
561
  async function personalizeConfig(destination, opts) {
400
562
  const has = (section) => opts.overrides.includes(section);
401
563
  const preservedAuth = (opts.mode === "sync" && opts.existingConfig?.app && typeof opts.existingConfig.app === "object" ? opts.existingConfig.app : void 0)?.auth;
564
+ const applyStarter = (config) => {
565
+ if (opts.starter) config.starter = opts.starter;
566
+ else if (opts.mode !== "sync") delete config.starter;
567
+ };
402
568
  const explicitRootKeys = new Set(Object.entries(opts).filter(([key, value]) => value !== void 0 && ![
403
569
  "extendsAccount",
404
570
  "extendsGateway",
@@ -409,6 +575,63 @@ async function personalizeConfig(destination, opts) {
409
575
  "mode",
410
576
  "existingConfig"
411
577
  ].includes(key)).map(([key]) => key));
578
+ const jsonConfigPath = join(destination, "bos.config.json");
579
+ const appConfigPath = join(destination, "bos.app.ts");
580
+ if (!existsSync(jsonConfigPath) && existsSync(appConfigPath)) {
581
+ const config = await loadAppDescriptorConfig(appConfigPath);
582
+ config.extends = `bos://${opts.extendsAccount}/${opts.extendsGateway}`;
583
+ if (opts.account) config.account = opts.account;
584
+ if (opts.domain) config.domain = opts.domain;
585
+ if (opts.repository) config.repository = opts.repository;
586
+ else delete config.repository;
587
+ for (const field of [
588
+ "title",
589
+ "description",
590
+ "testnet",
591
+ "staging"
592
+ ]) if (!(field in opts)) delete config[field];
593
+ applyStarter(config);
594
+ if (config.app && typeof config.app === "object") {
595
+ const app = config.app;
596
+ for (const entryKey of Object.keys(app)) {
597
+ if (!has(entryKey) && (entryKey === "host" || entryKey === "ui" || entryKey === "api")) {
598
+ delete app[entryKey];
599
+ continue;
600
+ }
601
+ if (entryKey === "auth") {
602
+ delete app[entryKey];
603
+ continue;
604
+ }
605
+ const entry = app[entryKey];
606
+ if (entry && typeof entry === "object") stripProductionFields(entry);
607
+ }
608
+ if (preservedAuth !== void 0) app.auth = preservedAuth;
609
+ if (Object.keys(app).length === 0) delete config.app;
610
+ }
611
+ if (has("plugins")) {
612
+ if (config.plugins && typeof config.plugins === "object") {
613
+ const plugins = config.plugins;
614
+ if (opts.plugins !== void 0) {
615
+ for (const pluginKey of Object.keys(plugins)) if (!opts.plugins.includes(pluginKey)) delete plugins[pluginKey];
616
+ }
617
+ for (const pluginKey of Object.keys(plugins)) {
618
+ const plugin = plugins[pluginKey];
619
+ let pluginObj;
620
+ if (typeof plugin === "string") {
621
+ pluginObj = { extends: plugin };
622
+ plugins[pluginKey] = pluginObj;
623
+ } else if (plugin && typeof plugin === "object") {
624
+ pluginObj = { ...plugin };
625
+ plugins[pluginKey] = pluginObj;
626
+ } else continue;
627
+ stripProductionFields(pluginObj);
628
+ }
629
+ if (Object.keys(plugins).length === 0) config.plugins = {};
630
+ }
631
+ } else config.plugins = {};
632
+ writeFileSync(appConfigPath, serializeAppDescriptorSource(config));
633
+ return;
634
+ }
412
635
  const configPath = join(destination, "bos.config.json");
413
636
  if (existsSync(configPath)) {
414
637
  const config = JSON.parse(readFileSync(configPath, "utf-8"));
@@ -423,6 +646,7 @@ async function personalizeConfig(destination, opts) {
423
646
  "testnet",
424
647
  "staging"
425
648
  ]) if (!(field in opts)) delete config[field];
649
+ applyStarter(config);
426
650
  if (config.app && typeof config.app === "object") {
427
651
  const app = config.app;
428
652
  for (const entryKey of Object.keys(app)) {
@@ -497,30 +721,24 @@ async function personalizeConfig(destination, opts) {
497
721
  if (typeof pkg.name !== "string" || pkg.name.length === 0) pkg.name = "monorepo";
498
722
  pkg.private = true;
499
723
  pkg.type = "module";
724
+ pkg.packageManager = PNPM_PACKAGE_MANAGER;
500
725
  delete pkg.module;
501
726
  delete pkg.peerDependencies;
502
- if (pkg.workspaces && typeof pkg.workspaces === "object") {
503
- const ws = pkg.workspaces;
504
- if (Array.isArray(ws.packages)) {
505
- ws.packages = ws.packages.filter((p) => {
506
- if (p.startsWith("packages/")) return false;
507
- if (p === "ui") return has("ui");
508
- if (p === "api") return has("api");
509
- if (p === "host") return has("host");
510
- if (p.startsWith("plugins/")) return false;
511
- return true;
512
- });
513
- if (has("plugins")) {
514
- if (!ws.packages.includes("plugins/*")) ws.packages.push("plugins/*");
515
- }
516
- }
517
- }
727
+ delete pkg.patchedDependencies;
728
+ const childWorkspaces = [];
729
+ if (has("host")) childWorkspaces.push("host");
730
+ if (has("ui")) childWorkspaces.push("ui");
731
+ if (has("api")) childWorkspaces.push("api");
732
+ if (has("plugins")) childWorkspaces.push("plugins/*");
733
+ const localCatalog = pkg.workspaces && typeof pkg.workspaces === "object" ? pkg.workspaces.catalog ?? {} : {};
734
+ delete pkg.workspaces;
518
735
  if (!pkg.scripts || typeof pkg.scripts !== "object") pkg.scripts = {};
519
736
  const scripts = pkg.scripts;
520
737
  for (const [key, value] of Object.entries(childScripts)) scripts[key] = value;
521
738
  for (const obsoleteScript of [
522
739
  ...getParentOnlyScriptKeys(destination),
523
740
  "init",
741
+ "prepare",
524
742
  "sync-catalog",
525
743
  "db:push",
526
744
  "db:studio",
@@ -543,28 +761,32 @@ async function personalizeConfig(destination, opts) {
543
761
  delete deps["every-plugin"];
544
762
  delete deps["everything-dev"];
545
763
  }
546
- if (!pkg.workspaces || typeof pkg.workspaces !== "object") pkg.workspaces = {
547
- packages: [],
548
- catalog: {}
764
+ const catalog = { ...localCatalog };
765
+ pkg.dependencies = {
766
+ "everything-dev": "catalog:",
767
+ "every-plugin": "catalog:"
549
768
  };
550
- const workspaces = pkg.workspaces;
551
- if (!workspaces.catalog || typeof workspaces.catalog !== "object") workspaces.catalog = {};
552
- if (!pkg.dependencies) pkg.dependencies = {};
553
769
  const deps = pkg.dependencies;
554
770
  const spec = opts.workspaceOpts?.sourceDir ? loadManifestNormalizationSpec(opts.workspaceOpts.sourceDir) : null;
555
771
  if (spec) {
556
- workspaces.catalog["everything-dev"] = spec.rootCatalog["everything-dev"];
557
- workspaces.catalog["every-plugin"] = spec.rootCatalog["every-plugin"];
772
+ const rootCatalogEverythingDev = spec.rootCatalog["everything-dev"];
773
+ const rootCatalogEveryPlugin = spec.rootCatalog["every-plugin"];
774
+ if (rootCatalogEverythingDev) catalog["everything-dev"] = rootCatalogEverythingDev;
775
+ if (rootCatalogEveryPlugin) catalog["every-plugin"] = rootCatalogEveryPlugin;
558
776
  }
559
777
  const frameworkCatalog = (await resolveCatalogChainSource({
560
778
  extendsAccount: opts.extendsAccount,
561
779
  extendsGateway: opts.extendsGateway,
562
780
  sourceDir: opts.workspaceOpts?.sourceDir
563
781
  })).catalog;
564
- for (const [name, version] of Object.entries(frameworkCatalog)) workspaces.catalog[name] = version;
782
+ for (const [name, version] of Object.entries(frameworkCatalog)) catalog[name] = version;
565
783
  if (!deps["everything-dev"]) deps["everything-dev"] = "catalog:";
566
784
  if (!deps["every-plugin"]) deps["every-plugin"] = "catalog:";
567
785
  writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
786
+ writeChildWorkspaceYaml(destination, {
787
+ packages: childWorkspaces,
788
+ catalog
789
+ });
568
790
  }
569
791
  const apiTsConfigPath = join(destination, "api", "tsconfig.json");
570
792
  if (existsSync(apiTsConfigPath)) {
@@ -585,12 +807,30 @@ async function personalizeConfig(destination, opts) {
585
807
  mkdirSync(dirname(genContractPath), { recursive: true });
586
808
  writeFileSync(genContractPath, `export type ApiContract = Record<string, never>;\n`);
587
809
  }
810
+ const publicDir = join(destination, "ui", "public");
811
+ if (!existsSync(publicDir)) mkdirSync(publicDir, { recursive: true });
812
+ const llmsTxtPath = join(publicDir, "llms.txt");
813
+ if (!existsSync(llmsTxtPath)) {
814
+ const title = opts.title ?? opts.account ?? "app";
815
+ writeFileSync(llmsTxtPath, buildChildLlmsTxt(title));
816
+ }
817
+ const skillMdPath = join(publicDir, "skill.md");
818
+ if (!existsSync(skillMdPath)) {
819
+ const title = opts.title ?? opts.account ?? "app";
820
+ const repository = opts.repository ?? "";
821
+ writeFileSync(skillMdPath, buildChildSkillMd(title, repository));
822
+ }
823
+ for (const agentFilePath of [llmsTxtPath, skillMdPath]) {
824
+ const content = readFileSync(agentFilePath, "utf-8");
825
+ if (content.includes(WORKFLOW_SKILLS_MARKER)) continue;
826
+ writeFileSync(agentFilePath, `${content.replace(/\n*$/, "\n")}${WORKFLOW_SKILLS_NOTE}`);
827
+ }
588
828
  }
589
829
  if (has("api")) {
590
830
  const pluginsClientGenPath = join(destination, "api", "src", "lib", "plugins-types.gen.ts");
591
831
  if (!existsSync(pluginsClientGenPath)) {
592
832
  mkdirSync(dirname(pluginsClientGenPath), { recursive: true });
593
- writeFileSync(pluginsClientGenPath, `import type { ContractRouterClient, AnyContractRouter } from "@orpc/contract";\ntype ClientFactory<C extends AnyContractRouter> = (context?: Record<string, unknown>) => ContractRouterClient<C>;\nexport type PluginsClient = Record<string, never>;\n`);
833
+ writeFileSync(pluginsClientGenPath, `import type { RouterContractClient, RouterContract } from "@orpc/contract";\ntype ClientFactory<C extends RouterContract> = (context?: Record<string, unknown>) => RouterContractClient<C>;\nexport type PluginsClient = Record<string, never>;\n`);
594
834
  }
595
835
  }
596
836
  const authTypesPaths = [];
@@ -599,7 +839,9 @@ async function personalizeConfig(destination, opts) {
599
839
  if (has("host") && existsSync(join(destination, "host", "src"))) authTypesPaths.push(join(destination, "host", "src", "lib", "auth-types.gen.ts"));
600
840
  for (const authTypesGenPath of authTypesPaths) if (!existsSync(authTypesGenPath)) {
601
841
  mkdirSync(dirname(authTypesGenPath), { recursive: true });
602
- writeFileSync(authTypesGenPath, buildAuthTypesGenContent(toRelativeImportPath(join(destination, ".bos", "generated", "auth", "auth-export.d.ts"), authTypesGenPath), toRelativeImportPath(join(destination, ".bos", "generated", "auth", "contract.d.ts"), authTypesGenPath)));
842
+ const authExportRel = toRelativeImportPath(join(destination, ".bos", "generated", "auth", "auth-export.d.ts"), authTypesGenPath);
843
+ const contractRel = toRelativeImportPath(join(destination, ".bos", "generated", "auth", "contract.d.ts"), authTypesGenPath);
844
+ writeFileSync(authTypesGenPath, buildAuthTypesGenContent(authExportRel, contractRel));
603
845
  }
604
846
  if (authTypesPaths.length > 0) {
605
847
  const authDir = join(destination, ".bos", "generated", "auth");
@@ -622,11 +864,11 @@ function toRelativeImportPath(fromPath, toPath) {
622
864
  const rel = relative(dirname(toPath), fromPath);
623
865
  return rel.startsWith(".") ? rel : `./${rel}`;
624
866
  }
625
- async function runBunInstall(destination, opts) {
626
- await runWithProgress("bun", ["install", "--ignore-scripts"], destination, opts?.spinner, "Installing dependencies");
867
+ async function runPnpmInstall(destination, opts) {
868
+ await runWithProgress("pnpm", ["install", "--ignore-scripts"], destination, opts?.spinner, "Installing dependencies");
627
869
  }
628
- async function runBunInstallForUpgrade(destination, opts) {
629
- await runWithProgress("bun", ["install", "--force"], destination, opts?.spinner, "Installing dependencies");
870
+ async function runPnpmInstallForUpgrade(destination, opts) {
871
+ await runWithProgress("pnpm", ["install", "--force"], destination, opts?.spinner, "Installing dependencies");
630
872
  }
631
873
  async function runTypesGen(destination, opts) {
632
874
  const bosModule = join(destination, "node_modules", "everything-dev", "dist", "cli.mjs");
@@ -642,19 +884,12 @@ async function runTypesGen(destination, opts) {
642
884
  }
643
885
  throw new Error("Unable to locate bos CLI for types generation");
644
886
  }
645
- async function runDockerComposeUp(destination) {
646
- await execCommand("docker", [
647
- "compose",
648
- "up",
649
- "-d",
650
- "--wait"
651
- ], destination, { stdio: "inherit" });
652
- }
653
887
  async function runWithProgress(command, args, cwd, spinner, label) {
888
+ const timeout = COMMAND_TIMEOUTS[command] ?? 12e4;
654
889
  const child = execa(command, args, {
655
890
  cwd,
656
891
  stdio: "inherit",
657
- timeout: COMMAND_TIMEOUTS[command] ?? 2 * 6e4,
892
+ timeout,
658
893
  env: {
659
894
  ...process.env,
660
895
  BOS_NO_BANNER: "1"
@@ -673,33 +908,6 @@ async function runWithProgress(command, args, cwd, spinner, label) {
673
908
  }
674
909
  } else await child;
675
910
  }
676
- function stripOrphanedWorkspacesFromLockfile(lockfilePath, allowedWorkspaces) {
677
- if (!existsSync(lockfilePath)) return;
678
- const content = readFileSync(lockfilePath, "utf-8");
679
- let lockfile;
680
- try {
681
- lockfile = JSON.parse(content);
682
- } catch {
683
- return;
684
- }
685
- const workspaces = lockfile.workspaces;
686
- if (!workspaces || typeof workspaces !== "object") return;
687
- const workspaceMap = workspaces;
688
- const allowed = /* @__PURE__ */ new Set(["", ...allowedWorkspaces]);
689
- const keys = Object.keys(workspaceMap);
690
- let changed = false;
691
- for (const key of keys) {
692
- if (allowed.has(key)) continue;
693
- if (allowedWorkspaces.some((pattern) => pattern.endsWith("/*") && key.startsWith(pattern.slice(0, -1)))) continue;
694
- delete workspaceMap[key];
695
- changed = true;
696
- }
697
- if (changed) writeFileSync(lockfilePath, `${JSON.stringify(lockfile, null, 2)}\n`);
698
- }
699
- function removeInitLockfile(lockfilePath) {
700
- if (!existsSync(lockfilePath)) return;
701
- rmSync(lockfilePath, { force: true });
702
- }
703
911
  async function scaffoldMinimalProject(destination, parentConfig, opts) {
704
912
  mkdirSync(destination, { recursive: true });
705
913
  const has = (section) => opts.overrides.includes(section);
@@ -709,7 +917,8 @@ async function scaffoldMinimalProject(destination, parentConfig, opts) {
709
917
  ...opts.domain ? { domain: opts.domain } : {},
710
918
  ...opts.repository ? { repository: opts.repository } : {},
711
919
  ...opts.title ? { title: opts.title } : {},
712
- ...opts.description ? { description: opts.description } : {}
920
+ ...opts.description ? { description: opts.description } : {},
921
+ ...opts.starter ? { starter: opts.starter } : {}
713
922
  };
714
923
  if (parentConfig.app && typeof parentConfig.app === "object") {
715
924
  const app = {};
@@ -732,11 +941,13 @@ async function scaffoldMinimalProject(destination, parentConfig, opts) {
732
941
  const plugins = {};
733
942
  for (const key of opts.plugins) {
734
943
  const parentPlugin = parentConfig.plugins?.[key];
735
- if (parentPlugin) if (typeof parentPlugin === "string") plugins[key] = { extends: parentPlugin };
736
- else {
737
- const pluginCopy = { ...parentPlugin };
738
- stripProductionFields(pluginCopy);
739
- plugins[key] = pluginCopy;
944
+ if (parentPlugin) {
945
+ if (typeof parentPlugin === "string") plugins[key] = { extends: parentPlugin };
946
+ else {
947
+ const pluginCopy = { ...parentPlugin };
948
+ stripProductionFields(pluginCopy);
949
+ plugins[key] = pluginCopy;
950
+ }
740
951
  }
741
952
  }
742
953
  config.plugins = plugins;
@@ -747,12 +958,14 @@ async function scaffoldMinimalProject(destination, parentConfig, opts) {
747
958
  if (has("plugins")) workspacePackages.push("plugins/*");
748
959
  const catalog = (await resolveCatalogChainSource({
749
960
  extendsAccount: opts.extendsAccount,
750
- extendsGateway: opts.extendsGateway
961
+ extendsGateway: opts.extendsGateway,
962
+ sourceDir: opts.catalogSourceDir
751
963
  })).catalog;
752
964
  const pkg = {
753
965
  name: "monorepo",
754
966
  private: true,
755
967
  type: "module",
968
+ packageManager: PNPM_PACKAGE_MANAGER,
756
969
  scripts: buildChildRootScripts({
757
970
  ui: has("ui"),
758
971
  api: has("api"),
@@ -763,13 +976,13 @@ async function scaffoldMinimalProject(destination, parentConfig, opts) {
763
976
  "everything-dev": "catalog:",
764
977
  "every-plugin": "catalog:"
765
978
  },
766
- devDependencies: {},
767
- workspaces: {
768
- packages: workspacePackages,
769
- catalog
770
- }
979
+ devDependencies: {}
771
980
  };
772
981
  writeFileSync(join(destination, "package.json"), `${JSON.stringify(pkg, null, 2)}\n`);
982
+ writeChildWorkspaceYaml(destination, {
983
+ packages: workspacePackages,
984
+ catalog
985
+ });
773
986
  writeFileSync(join(destination, ".gitignore"), generateGitignore());
774
987
  return 4;
775
988
  }
@@ -801,22 +1014,27 @@ async function writeInitSnapshot(destination, extendsAccount, extendsGateway, so
801
1014
  });
802
1015
  for (const match of matches) allFiles.add(match);
803
1016
  }
1017
+ if (!options.overrides.includes("api")) {
1018
+ for (const match of allFiles) if (isApiTemplatePath(match)) allFiles.delete(match);
1019
+ }
1020
+ if (!options.overrides.includes("api") && !options.overrides.includes("host")) {
1021
+ for (const match of allFiles) if (isComposeTemplatePath(match)) allFiles.delete(match);
1022
+ }
804
1023
  const fileHashes = {};
805
1024
  for (const filePath of allFiles) {
806
1025
  const src = join(sourceDir, filePath);
807
1026
  if (!lstatSync(src).isFile()) continue;
808
- const content = readFileSync(src);
809
1027
  const destPath = sourcePathToDestinationPath(filePath);
810
- fileHashes[destPath] = computeHash(content);
1028
+ if (!existsSync(join(destination, destPath))) continue;
1029
+ const content = readFileSync(src);
1030
+ fileHashes[destPath] = computeSnapshotHash(content);
811
1031
  }
812
1032
  await writeSnapshot(destination, {
813
1033
  parentRef: `bos://${extendsAccount}/${extendsGateway}`,
814
- files: fileHashes
1034
+ files: fileHashes,
1035
+ starter: options.starter
815
1036
  });
816
1037
  }
817
- function computeHash(data) {
818
- return createHash("sha256").update(data).digest("hex").substring(0, 16);
819
- }
820
1038
  function mkTmpDir(prefix) {
821
1039
  return mkdtempSync(join(tmpdir(), `${prefix}-`));
822
1040
  }
@@ -833,17 +1051,23 @@ async function generateDatabaseMigrations(destination) {
833
1051
  const pkgPath = join(destination, workspaceDir, "package.json");
834
1052
  if (!existsSync(pkgPath)) continue;
835
1053
  if (!JSON.parse(readFileSync(pkgPath, "utf-8")).scripts?.["db:generate"]) continue;
836
- await execCommand("bun", ["run", "db:generate"], join(destination, workspaceDir));
1054
+ await execCommand("pnpm", [
1055
+ "--dir",
1056
+ "api",
1057
+ "exec",
1058
+ "drizzle-kit",
1059
+ "generate"
1060
+ ], join(destination, workspaceDir));
837
1061
  }
838
1062
  }
839
1063
  const COMMAND_TIMEOUTS = {
840
- bun: 5 * 6e4,
841
- docker: 5 * 6e4,
842
- node_modules: 2 * 6e4,
1064
+ pnpm: 3e5,
1065
+ docker: 3e5,
1066
+ node_modules: 12e4,
843
1067
  tar: 6e4
844
1068
  };
845
1069
  async function execCommand(command, args, cwd, options) {
846
- const timeout = COMMAND_TIMEOUTS[command] ?? 2 * 6e4;
1070
+ const timeout = COMMAND_TIMEOUTS[command] ?? 12e4;
847
1071
  await execa(command, args, {
848
1072
  cwd,
849
1073
  stdio: options?.stdio ?? "pipe",
@@ -865,9 +1089,8 @@ This document provides operational guidance for AI agents working in this everyt
865
1089
 
866
1090
  **Start Development:**
867
1091
  \`\`\`bash
868
- cp .env.example .env # First time only
869
- bun install
870
- bun run dev
1092
+ pnpm install
1093
+ pnpm run dev
871
1094
  \`\`\`
872
1095
 
873
1096
  **Check Status:**
@@ -875,7 +1098,51 @@ bun run dev
875
1098
  bos ps # List running processes
876
1099
  bos status # Project health check
877
1100
  bos info # Show configuration
878
- \`\`\``);
1101
+ \`\`\`
1102
+
1103
+ **Deploy:**
1104
+
1105
+ [![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/everything-dev-template?referralCode=MuB_vg&utm_medium=integration&utm_source=template&utm_campaign=generic)
1106
+
1107
+ The Railway template deploys the everything.dev Docker image. Set these variables:
1108
+
1109
+ | Variable | Description | Example |
1110
+ |----------|-------------|---------|
1111
+ | \`BOS_ACCOUNT\` | The NEAR account that owns this app's published configuration on-chain | \`myapp.near\` |
1112
+ | \`BOS_GATEWAY\` | The core domain where this app is served | \`myapp.com\` |
1113
+ | \`BETTER_AUTH_SECRET\` | Secret for session encryption — generate with \`openssl rand -base64 32\` | (random) |
1114
+
1115
+ **Self-deployed production:**
1116
+
1117
+ You don't need to wait for a PR to merge and run through CI/CD. Publish your own config on-chain under your own NEAR account and run your own host instance, inheriting the base platform via \`extends\`.
1118
+
1119
+ 1. **Install near-cli-rs** (the \`bos\` CLI shells out to it for \`bos publish\` and \`bos key generate\`):
1120
+ \`\`\`bash
1121
+ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.23.5/near-cli-rs-installer.sh | sh
1122
+ \`\`\`
1123
+ 2. **Create a NEAR account** (testnet or mainnet). Named accounts can own subaccounts; implicit hex accounts cannot:
1124
+ \`\`\`bash
1125
+ near account create-account fund-my-account <your-account>.testnet use-faucet network-config testnet
1126
+ \`\`\`
1127
+ 3. **Generate a publish key** — a function-call key scoped to the FastKV registry contract:
1128
+ \`\`\`bash
1129
+ bos key generate
1130
+ # Output: NEAR_PRIVATE_KEY=ed25519:...
1131
+ \`\`\`
1132
+ Add the key to your account via near-cli-rs, then set \`NEAR_PRIVATE_KEY\` in \`.env\` or CI secrets.
1133
+ 4. **Update \`bos.app.ts\`** — set \`account\` to your NEAR account, add \`extends\` to inherit the base platform, keep \`domain\` as the gateway:
1134
+ \`\`\`ts
1135
+ { "extends": "bos://<parent-account>/<parent-gateway>", "account": "<your-account>.near", "domain": "<parent-gateway>" }
1136
+ \`\`\`
1137
+ 5. **Publish and deploy:**
1138
+ \`\`\`bash
1139
+ bos deploy # preflight → build → upload bundles → publish config to FastKV at bos://<your-account>/<gateway> → image/Railway when configured
1140
+ \`\`\`
1141
+ 6. **Deploy to Railway** (one-click template or \`railway up\`), set \`BOS_ACCOUNT\`, \`BOS_GATEWAY\` (same gateway as parent), and \`BETTER_AUTH_SECRET\`. Your Railway host fetches your config from FastKV and serves live.
1142
+
1143
+ \`BOS_GATEWAY\` is the **FastKV lookup key**, not the DNS domain your Railway instance serves on. By keeping the same gateway while using your own \`BOS_ACCOUNT\`, your config lives at a separate FastKV path that \`extends\` the base runtime — you inherit the full platform and override only what you change.
1144
+
1145
+ **Tenant creation** (for the admin wizard) is DAO-owned: connect a sputnik-dao account via the Trezu wallet in the admin wizard; the wizard publishes the tenant runtime config under \`bos://<dao-account>/<gateway>\`. No server-side subaccount keys are needed.`);
879
1146
  const archLines = ["This is an everything.dev child project. Depending on your overrides, it may include:"];
880
1147
  if (has("ui")) archLines.push("- **UI** — React 19 + TanStack Router frontend, loaded via Module Federation");
881
1148
  if (has("api")) archLines.push("- **API** — Hono.js + oRPC backend with Effect services");
@@ -886,9 +1153,9 @@ bos info # Show configuration
886
1153
  parts.push(`## Development Workflow
887
1154
 
888
1155
  ### Starting Development
889
- 1. \`cp .env.example .env\` (first time)
890
- 2. \`bun install\`
891
- 3. \`bun run dev\``);
1156
+ 1. \`pnpm install\`
1157
+ 2. \`pnpm run dev\`
1158
+ 3. \`bos dev\` creates \`.env\` on first run and starts local Postgres via docker compose when it is down`);
892
1159
  parts.push(`### Debugging Issues
893
1160
 
894
1161
  **API not responding:**
@@ -901,7 +1168,7 @@ bos info # Show configuration
901
1168
  - Clear browser cache and retry
902
1169
 
903
1170
  **Type errors:**
904
- - Run \`bun run typecheck\``);
1171
+ - Run \`pnpm run typecheck\``);
905
1172
  const changeLines = ["### Making Changes"];
906
1173
  if (has("ui")) changeLines.push("- **UI Changes**: Edit `ui/src/` files → hot reload automatically");
907
1174
  if (has("api")) changeLines.push("- **API Changes**: Edit `api/src/` files → hot reload automatically");
@@ -934,14 +1201,14 @@ The API plugin receives typed client factories for all other plugins via \`creat
934
1201
 
935
1202
  ### Generated Types
936
1203
 
937
- \`api/src/lib/plugins-types.gen.ts\`, \`api/src/lib/auth-types.gen.ts\`, \`ui/src/lib/api-types.gen.ts\`, and \`ui/src/lib/auth-types.gen.ts\` are generated by \`bos types gen\` from \`bos.config.json\`. These files are gitignored and auto-regenerated on \`bun install\`, \`typecheck\`, \`bos dev\`, \`bos build\`, and bos plugin management commands.
1204
+ \`api/src/lib/plugins-types.gen.ts\`, \`api/src/lib/auth-types.gen.ts\`, \`ui/src/lib/api-types.gen.ts\`, and \`ui/src/lib/auth-types.gen.ts\` are generated by \`bos types gen\` from \`bos.app.ts\`. These files are gitignored and auto-regenerated on \`pnpm install\`, \`typecheck\`, \`bos dev\`, \`bos build\`, and bos plugin management commands.
938
1205
 
939
- If you hand-edit \`bos.config.json\`, run \`bos types gen\` or restart \`bos dev\` to regenerate.`);
1206
+ If you hand-edit \`bos.app.ts\`, run \`bos types gen\` or restart \`bos dev\` to regenerate.`);
940
1207
  const testCommands = [];
941
1208
  if (has("api") || has("host") || has("ui")) {
942
- testCommands.push("bun run test # Run all tests");
943
- testCommands.push("bun typecheck # Type check all packages");
944
- testCommands.push("bun lint # Run linting");
1209
+ testCommands.push("pnpm run test # Run all tests");
1210
+ testCommands.push("pnpm run typecheck # Type check all packages");
1211
+ testCommands.push("pnpm run lint # Run linting");
945
1212
  }
946
1213
  if (testCommands.length > 0) parts.push(`## Testing & Quality
947
1214
 
@@ -973,31 +1240,64 @@ function MyComponent() {
973
1240
  const { data } = await apiClient.ping();
974
1241
  }
975
1242
  \`\`\``);
1243
+ parts.push(`## Workflow Skills
1244
+
1245
+ This repo ships agent workflow skills in \`.agents/skills/\` — the ordered development flow (grill → spec → tickets → implement/tdd → code-review). Start \`/everything-dev-app\` to orient and pick the right next step; \`/ask-matt\` is the router if unsure.
1246
+
1247
+ - \`/grill-with-docs\` — sharpen an idea by interview, leaving a paper trail in \`GLOSSARY.md\` and ADRs
1248
+ - \`/to-spec\` / \`/to-tickets\` — turn a plan into a spec, then tracer-bullet tickets under \`.scratch/<feature>/issues/\`
1249
+ - \`/implement\` + \`/tdd\` — build a ticket test-first at pre-agreed seams
1250
+ - \`/code-review\` — two-axis review (Standards + Spec) of the diff since a fixed point
1251
+ - \`/diagnosing-bugs\` — diagnosis loop for hard bugs and performance regressions
1252
+
1253
+ Run \`/setup-matt-pocock-skills\` once before first use. Tracker and triage conventions live in \`docs/agents/\`.`);
1254
+ parts.push(`## Agent Communication Surface
1255
+
1256
+ The host exposes several surfaces for programmatic agent access:
1257
+
1258
+ | Surface | Endpoint | Auth | Use |
1259
+ |---------|----------|------|-----|
1260
+ | MCP | \`POST /api/mcp\` | \`x-api-key\` header or session cookie | MCP clients — auto-generated tools from OpenAPI spec, stateless Streamable HTTP transport |
1261
+ | REST/OpenAPI | \`GET/POST/... /api/{path}\` | \`x-api-key\` header or session cookie | Standard REST; Scalar docs at \`GET /api\`, spec at \`GET /api/spec.json\` |
1262
+ | oRPC RPC | \`POST /api/rpc/{procedure}\` | \`x-api-key\` header or session cookie | Typed JSON-RPC for all API procedures |
1263
+ | Plugin RPC | \`POST /api/rpc/{plugin}/{procedure}\` | \`x-api-key\` header or session cookie | Per-plugin RPC (e.g. \`/api/rpc/auth/getSession\`) |
1264
+ | MCP discovery | \`GET /.well-known/mcp.json\` | None | JSON descriptor with server name, endpoint, and auth scheme |
1265
+
1266
+ ### Authentication for agents
1267
+
1268
+ 1. Sign in with your NEAR wallet (SIWN) at the website.
1269
+ 2. Navigate to **Settings → API Keys** at \`/settings/api-keys\`.
1270
+ 3. Create a new key — the full secret (\`edk_...\`) is shown once. Copy it immediately.
1271
+ 4. Pass it on every request: \`x-api-key: edk_your_key_here\`
1272
+
1273
+ ### Architecture note: remotes are code bundles
1274
+
1275
+ Remotes in \`bos.app.ts\` are **not hosted APIs** — they are code bundles loaded via Module Federation at runtime. The UI, API, auth, and plugins all run in the same host process. There is no remote server to call; everything is loaded in-process through Module Federation and \`every-plugin\`.`);
976
1276
  parts.push(`## Troubleshooting
977
1277
 
978
1278
  **Process won't start:**
979
1279
  \`\`\`bash
980
1280
  bos kill # Kill all tracked processes
981
- bun install # Ensure dependencies
982
- bun run dev # Restart
1281
+ pnpm install # Ensure dependencies
1282
+ pnpm run dev # Restart
983
1283
  \`\`\`
984
1284
 
985
1285
  **Module Federation errors:**
986
- - Check \`bos.config.json\` URLs are accessible
1286
+ - Check \`bos.app.ts\` URLs are accessible
987
1287
  - Verify shared dependency versions match in package.json
988
1288
  - Clear browser cache
989
1289
 
990
1290
  **Database issues:**
991
1291
  \`\`\`bash
992
- bun run db:push # Push schema changes
993
- bun run db:studio # Open Drizzle Studio
1292
+ pnpm run db:push # Push schema changes
1293
+ pnpm run db:studio # Open Drizzle Studio
994
1294
  \`\`\`
995
1295
 
996
1296
  ## Environment
997
1297
 
998
1298
  **Required files:**
999
1299
  - \`.env\` — Secrets (see \`.env.example\`)
1000
- - \`bos.config.json\` — Runtime configuration (committed)`);
1300
+ - \`bos.app.ts\` — Runtime configuration (committed)`);
1001
1301
  return `${parts.join("\n\n")}\n`;
1002
1302
  }
1003
1303
  function buildChildAgentsMd(skillsBlock, opts) {
@@ -1008,7 +1308,8 @@ async function personalizeAgentsMd(destination, opts) {
1008
1308
  if (!existsSync(agentsMdPath)) return;
1009
1309
  const skillsBlock = extractSkillsBlock(readFileSync(agentsMdPath, "utf-8"));
1010
1310
  if (!skillsBlock) return;
1011
- writeFileSync(agentsMdPath, buildChildAgentsMd(skillsBlock, opts));
1311
+ const childContent = buildChildAgentsMd(skillsBlock, opts);
1312
+ writeFileSync(agentsMdPath, childContent);
1012
1313
  }
1013
1314
  function generateGitignore() {
1014
1315
  return `node_modules/
@@ -1020,7 +1321,125 @@ docker-compose.yml
1020
1321
  *.gen.tsx
1021
1322
  `;
1022
1323
  }
1324
+ const WORKFLOW_SKILLS_MARKER = "everything-dev-app";
1325
+ const WORKFLOW_SKILLS_NOTE = `
1326
+
1327
+ ## Workflow skills
1328
+
1329
+ This repo ships agent workflow skills in \`.agents/skills/\` — the ordered development flow (grill → spec → tickets → implement/tdd → code-review). Start with \`/everything-dev-app\` to orient and pick the right next step. See \`AGENTS.md\` → Workflow Skills.
1330
+ `;
1331
+ function buildChildLlmsTxt(title) {
1332
+ return `# ${title}
1333
+
1334
+ > Application running on the everything.dev runtime.
1335
+
1336
+ ## Skills
1337
+
1338
+ - [Skill](/skill.md): Agent-ready prompt for talking to, running, editing, and publishing this runtime.
1339
+ - Workflow skills (in the repo): \`.agents/skills/\` — start with \`everything-dev-app\` for the ordered development flow.
1340
+
1341
+ ## API
1342
+
1343
+ - [OpenAPI docs](/api): Interactive API reference (Scalar)
1344
+ - [OpenAPI spec](/api/spec.json): Machine-readable OpenAPI JSON
1345
+ - [oRPC RPC](/api/rpc): Typed JSON-RPC endpoint for all API procedures
1346
+ - [Plugin RPC](/api/rpc/auth): Auth plugin RPC (session, NEAR SIWN, relay, API keys, organizations)
1347
+
1348
+ ## MCP
1349
+
1350
+ - [MCP server](/api/mcp): Model Context Protocol server (Streamable HTTP, stateless). Auto-generates tools from the API's OpenAPI spec.
1351
+ - [MCP discovery](/.well-known/mcp.json): JSON descriptor with server name, endpoint URL, and auth scheme.
1352
+
1353
+ ## Auth
1354
+
1355
+ Authenticate to the API using an API key:
1356
+
1357
+ 1. Sign in with your NEAR wallet (SIWN) at the website.
1358
+ 2. Go to **Settings → API Keys** at \`/settings/api-keys\`.
1359
+ 3. Create a key — the full secret (\`edk_...\`) is shown once.
1360
+ 4. Pass it on every request: \`x-api-key: edk_your_key_here\`
1361
+
1362
+ The \`x-api-key\` header works for \`/api/*\` (REST), \`/api/rpc/*\` (oRPC), and \`/api/mcp\` (MCP).
1363
+
1364
+ ## Source
1365
+
1366
+ - [Repository](https://github.com/NEARBuilders/everything-dev): Clone and read \`AGENTS.md\` for full development instructions, TanStack Intent skills, and workflow guidance.
1367
+ `;
1368
+ }
1369
+ function buildChildSkillMd(title, repository) {
1370
+ return `# ${title} skill
1371
+
1372
+ Use this when you want an agent to run, edit, and publish **${title}** — an everything.dev app composed at runtime from \`bos.app.ts\`.
1373
+
1374
+ There are two ways to work with this app:
1375
+
1376
+ 1. **Talk to the app** — use the API via MCP or REST to read/write data without cloning anything.
1377
+ 2. **Clone and modify** — clone the repository, run locally, edit code, and publish.
1378
+
1379
+ ## Mode 1: Talk to the app
1380
+
1381
+ ### MCP endpoint
1382
+
1383
+ \`\`\`
1384
+ POST /api/mcp
1385
+ \`\`\`
1386
+
1387
+ Transport: Streamable HTTP (stateless). Connect your MCP client to \`{origin}/api/mcp\` to discover all available tools automatically.
1388
+
1389
+ ### Authentication
1390
+
1391
+ Use an **API key**:
1392
+
1393
+ 1. Sign in with your NEAR wallet at the website (SIWN).
1394
+ 2. Navigate to **Settings → API Keys** at \`/settings/api-keys\`.
1395
+ 3. Create a key — the full secret (\`edk_...\`) is shown once.
1396
+ 4. Pass it on every request: \`x-api-key: edk_your_key_here\`
1397
+
1398
+ ### REST / OpenAPI
1399
+
1400
+ - **API docs**: \`GET /api\`
1401
+ - **OpenAPI spec**: \`GET /api/spec.json\`
1402
+ - **oRPC RPC**: \`POST /api/rpc/{procedure}\`
1403
+ - **MCP discovery**: \`GET /.well-known/mcp.json\`
1404
+
1405
+ ## Mode 2: Clone and modify
1406
+
1407
+ ### TanStack Intent
1408
+
1409
+ - Registry entry: \`https://tanstack.com/intent/registry/everything-dev\`
1410
+ - Load with TanStack Intent: \`npx @tanstack/intent@latest load everything-dev\`
1411
+
1412
+ ### Read AGENTS.md first
1413
+
1414
+ After cloning, read **\`AGENTS.md\`** at the repo root. It contains operational guidance, TanStack Intent skills, and workflow instructions.
1415
+
1416
+ ### Workflow skills
1417
+
1418
+ The repo ships agent workflow skills in \`.agents/skills/\` — start with \`everything-dev-app\` for the ordered development flow (grill → spec → tickets → implement/tdd → code-review).
1419
+
1420
+ ### Architecture note
1421
+
1422
+ Remotes in \`bos.app.ts\` are **not hosted APIs** — they are code bundles loaded via Module Federation at runtime. Everything runs in the same host process.
1423
+
1424
+ ### Run locally
1425
+
1426
+ \`\`\`bash
1427
+ pnpm install
1428
+ bos dev
1429
+ \`\`\`
1430
+
1431
+ ### Publish
1432
+
1433
+ \`\`\`bash
1434
+ bos deploy
1435
+ \`\`\`
1436
+
1437
+ ## Source
1438
+
1439
+ ${repository ? `- [Repository](${repository}): Clone and read \`AGENTS.md\` for full development instructions.` : `- Clone the repository and read \`AGENTS.md\` for full development instructions.`}
1440
+ `;
1441
+ }
1023
1442
 
1024
1443
  //#endregion
1025
- export { INIT_ROOT_PATTERNS, buildChildAgentsMd, buildChildRootScripts, buildInitPatterns, buildPluginRouteExclusions, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, extractSkillsBlock, fetchParentConfig, generateDatabaseMigrations, getParentOnlyScriptKeys, personalizeAgentsMd, personalizeConfig, removeInitLockfile, resolveCatalogChainSource, resolveRepositoryViaExtendsChain, resolveSourceDir, runBunInstall, runBunInstallForUpgrade, runDockerComposeUp, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot };
1444
+ export { INIT_ROOT_PATTERNS, PNPM_PACKAGE_MANAGER, buildChildAgentsMd, buildChildLlmsTxt, buildChildRootScripts, buildChildSkillMd, buildInitPatterns, buildPluginRouteExclusions, buildStarterRouteExclusions, convertChildConfigToAppForm, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, extractSkillsBlock, fetchParentConfig, generateDatabaseMigrations, getParentOnlyScriptKeys, isApiTemplatePath, isComposeTemplatePath, personalizeAgentsMd, personalizeConfig, readWorkspaceCatalog, removeStrayLockfiles, resolveCatalogChainSource, resolveRepositoryViaExtendsChain, resolveSourceDir, runDockerComposeUp, runPnpmInstall, runPnpmInstallForUpgrade, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, writeChildWorkspaceYaml, writeDevOverlayTemplate, writeInitSnapshot };
1026
1445
  //# sourceMappingURL=init.mjs.map