everything-dev 1.53.1 → 2.0.0-rc.0

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