create-ailk 0.37.1 → 0.39.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 (318) hide show
  1. package/README.md +129 -0
  2. package/component-catalog.json +44 -6
  3. package/component-catalog.md +6 -5
  4. package/dist/add-module.js +16 -1
  5. package/dist/add-route.d.ts +2 -2
  6. package/dist/add-route.js +19 -12
  7. package/dist/cli.js +52 -0
  8. package/dist/declined-routes.d.ts +13 -0
  9. package/dist/declined-routes.js +74 -0
  10. package/dist/derive-architecture.d.ts +0 -6
  11. package/dist/derive-architecture.js +12 -16
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +3 -0
  14. package/dist/language-import.d.ts +93 -0
  15. package/dist/language-import.js +270 -43
  16. package/dist/lib/import-mdx.js +1 -1
  17. package/dist/lib/scaffold-render-sweep.d.ts +6 -3
  18. package/dist/lib/scaffold-render-sweep.js +8 -4
  19. package/dist/migrate-content.d.ts +6 -2
  20. package/dist/migrate-content.js +62 -5
  21. package/dist/module-architecture.js +139 -103
  22. package/dist/paid-sections.d.ts +13 -0
  23. package/dist/paid-sections.js +35 -5
  24. package/dist/programmatic.js +6 -16
  25. package/dist/remove-module.js +73 -2
  26. package/dist/routes.d.ts +130 -0
  27. package/dist/routes.js +954 -0
  28. package/dist/site-manifest.js +6 -4
  29. package/dist/site-roster.d.ts +11 -2
  30. package/dist/site-roster.js +63 -21
  31. package/dist/spoke-checkout.d.ts +28 -27
  32. package/dist/spoke-checkout.js +71 -102
  33. package/dist/surfaces.d.ts +26 -0
  34. package/dist/surfaces.js +105 -293
  35. package/dist/sync-routes.d.ts +14 -1
  36. package/dist/sync-routes.js +108 -10
  37. package/dist/template-record.js +3 -1
  38. package/dist/topology.d.ts +26 -1
  39. package/dist/topology.js +273 -7
  40. package/dist/update.d.ts +17 -2
  41. package/dist/update.js +480 -77
  42. package/package.json +3 -3
  43. package/templates/README.md +1 -1
  44. package/templates/apps/mcp/CLAUDE.md +5 -3
  45. package/templates/apps/web/CLAUDE.md +87 -23
  46. package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +5 -1
  47. package/templates/apps/web/__tests__/__mocks__/next-intl.ts +5 -1
  48. package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
  49. package/templates/apps/web/account.config.tsx +100 -0
  50. package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +1 -1
  51. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +2 -2
  52. package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
  53. package/templates/apps/web/app/[locale]/layout.tsx +46 -29
  54. package/templates/apps/web/app/apple-icon.tsx +72 -0
  55. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
  56. package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
  57. package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
  58. package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
  59. package/templates/apps/web/app/og/route.tsx +155 -72
  60. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
  61. package/templates/apps/web/auth.config.tsx +107 -0
  62. package/templates/apps/web/auth.ts +2 -1
  63. package/templates/apps/web/i18n/request.ts +51 -1
  64. package/templates/apps/web/jest.config.cjs +17 -1
  65. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
  66. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +73 -0
  67. package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
  68. package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
  69. package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
  70. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
  71. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
  72. package/templates/apps/web/lib/listings.tsx +2 -2
  73. package/templates/apps/web/lib/nav-label-keys.ts +16 -2
  74. package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
  75. package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
  76. package/templates/apps/web/lib/profile-back-link.ts +105 -32
  77. package/templates/apps/web/lib/served-pages.ts +95 -0
  78. package/templates/apps/web/lib/server-api.ts +1 -1
  79. package/templates/apps/web/lib/site-brand.tsx +3 -5
  80. package/templates/apps/web/lib/topology.generated.ts +5 -0
  81. package/templates/apps/web/messages/en.json +8 -836
  82. package/templates/apps/web/middleware.ts +15 -26
  83. package/templates/apps/web/next.config.mjs +35 -0
  84. package/templates/apps/web/package.json +2 -0
  85. package/templates/apps/web/types/messages.d.ts +6 -1
  86. package/templates/customizations.yaml +9 -0
  87. package/templates/package.json +3 -1
  88. package/templates/tools/lint-architecture.ts +164 -11
  89. package/versions.json +49 -47
  90. package/templates/apps/web/app/[locale]/(auth)/__tests__/auth-pages.test.tsx +0 -322
  91. package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +0 -554
  92. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +0 -56
  93. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +0 -164
  94. package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +0 -132
  95. package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +0 -51
  96. package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +0 -144
  97. package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +0 -101
  98. package/templates/apps/web/app/[locale]/(auth)/forgot-password/page.tsx +0 -111
  99. package/templates/apps/web/app/[locale]/(auth)/layout.tsx +0 -81
  100. package/templates/apps/web/app/[locale]/(auth)/legal-footnote.tsx +0 -35
  101. package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +0 -179
  102. package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +0 -157
  103. package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +0 -126
  104. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/next-path.test.ts +0 -54
  105. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +0 -628
  106. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +0 -43
  107. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +0 -266
  108. package/templates/apps/web/app/[locale]/(auth)/sign-in/next-path.ts +0 -20
  109. package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +0 -234
  110. package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +0 -37
  111. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +0 -323
  112. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +0 -93
  113. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/page.test.tsx +0 -301
  114. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +0 -309
  115. package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +0 -201
  116. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +0 -366
  117. package/templates/apps/web/app/[locale]/(auth)/use-auth-card-flow.ts +0 -116
  118. package/templates/apps/web/app/[locale]/(auth)/verify-email/__tests__/actions.test.ts +0 -94
  119. package/templates/apps/web/app/[locale]/(auth)/verify-email/actions.ts +0 -77
  120. package/templates/apps/web/app/[locale]/(auth)/verify-email/page.tsx +0 -154
  121. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
  122. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
  123. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
  124. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
  125. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
  126. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
  127. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
  128. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
  129. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
  130. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
  131. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
  132. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
  133. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
  134. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
  135. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
  136. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
  137. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
  138. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
  139. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
  140. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
  141. package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
  142. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
  143. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
  144. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
  145. package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
  146. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
  147. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -161
  148. package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
  149. package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
  150. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -139
  151. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -406
  152. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
  153. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
  154. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -190
  155. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
  156. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
  157. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
  158. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
  159. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
  160. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
  161. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -182
  162. package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
  163. package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
  164. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -424
  165. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
  166. package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
  167. package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
  168. package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
  169. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
  170. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
  171. package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
  172. package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
  173. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
  174. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
  175. package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
  176. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -218
  177. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
  178. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
  179. package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
  180. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
  181. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
  182. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -119
  183. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
  184. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -80
  185. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
  186. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -125
  187. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
  188. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
  189. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
  190. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
  191. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
  192. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
  193. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -154
  194. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -152
  195. package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
  196. package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
  197. package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
  198. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -143
  199. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
  200. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
  201. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -126
  202. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -306
  203. package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
  204. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
  205. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -102
  206. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -240
  207. package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
  208. package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
  209. package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
  210. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -131
  211. package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
  212. package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
  213. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -24
  214. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
  215. package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
  216. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -60
  217. package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
  218. package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
  219. package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
  220. package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
  221. package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
  222. package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
  223. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
  224. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
  225. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
  226. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
  227. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
  228. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
  229. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
  230. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
  231. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
  232. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
  233. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
  234. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
  235. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
  236. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
  237. package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
  238. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
  239. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
  240. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
  241. package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
  242. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
  243. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
  244. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
  245. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
  246. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
  247. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
  248. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
  249. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
  250. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
  251. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
  252. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
  253. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
  254. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
  255. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
  256. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
  257. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
  258. package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
  259. package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
  260. package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
  261. package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
  262. package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
  263. package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
  264. package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
  265. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
  266. package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
  267. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
  268. package/templates/apps/web/app/api/auth/[...all]/route.ts +0 -16
  269. package/templates/apps/web/app/api/auth/hub/__tests__/continuation.test.ts +0 -143
  270. package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +0 -749
  271. package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +0 -964
  272. package/templates/apps/web/app/api/auth/hub/authorize/route.ts +0 -390
  273. package/templates/apps/web/app/api/auth/hub/continuation.ts +0 -127
  274. package/templates/apps/web/app/api/auth/hub/continue/[ref]/__tests__/route.test.ts +0 -188
  275. package/templates/apps/web/app/api/auth/hub/continue/[ref]/route.ts +0 -53
  276. package/templates/apps/web/app/api/auth/hub/email/route.ts +0 -111
  277. package/templates/apps/web/app/api/auth/hub/entry-shared.ts +0 -163
  278. package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +0 -86
  279. package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +0 -368
  280. package/templates/apps/web/app/api/auth/hub/password/return.ts +0 -86
  281. package/templates/apps/web/app/api/auth/hub/password/route.ts +0 -171
  282. package/templates/apps/web/app/api/auth/hub/purchase/route.ts +0 -230
  283. package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +0 -174
  284. package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +0 -60
  285. package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +0 -97
  286. package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +0 -92
  287. package/templates/apps/web/app/api/auth/mcp/continuation.ts +0 -89
  288. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +0 -59
  289. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +0 -41
  290. package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +0 -1166
  291. package/templates/apps/web/app/api/hub-session/callback/route.ts +0 -134
  292. package/templates/apps/web/app/api/hub-session/email/route.ts +0 -125
  293. package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +0 -49
  294. package/templates/apps/web/app/api/hub-session/one-tap/route.ts +0 -106
  295. package/templates/apps/web/app/api/hub-session/open/route.ts +0 -111
  296. package/templates/apps/web/app/api/hub-session/password/return/route.ts +0 -69
  297. package/templates/apps/web/app/api/hub-session/password/route.ts +0 -106
  298. package/templates/apps/web/app/api/hub-session/sign-in/route.ts +0 -91
  299. package/templates/apps/web/app/api/hub-session/sign-out/route.ts +0 -54
  300. package/templates/apps/web/components/sign-out-trigger.tsx +0 -62
  301. package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
  302. package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
  303. package/templates/apps/web/lib/account-config.ts +0 -678
  304. package/templates/apps/web/lib/auth-routes.ts +0 -125
  305. package/templates/apps/web/lib/checkout-config.ts +0 -16
  306. package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +0 -433
  307. package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +0 -332
  308. package/templates/apps/web/lib/hub-session/config.ts +0 -110
  309. package/templates/apps/web/lib/hub-session/entry.ts +0 -238
  310. package/templates/apps/web/lib/hub-session/index.ts +0 -21
  311. package/templates/apps/web/lib/hub-session/one-tap.tsx +0 -148
  312. package/templates/apps/web/lib/hub-session/reseal.ts +0 -90
  313. package/templates/apps/web/lib/hub-session/seal.ts +0 -86
  314. package/templates/apps/web/lib/hub-session/session.ts +0 -298
  315. package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +0 -277
  316. package/templates/apps/web/lib/next-path.ts +0 -35
  317. package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
  318. package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
package/dist/topology.js CHANGED
@@ -48,9 +48,12 @@ export class TopologyError extends Error {
48
48
  export const SPOKE_REMOVED_ROOTS = ["apps/api", "database"];
49
49
  /** The root `--without-mcp` removes. */
50
50
  export const SPOKE_MCP_ROOT = "apps/mcp";
51
- /** Commerce's apps/web files that reach the hub's own checkout (spoke-intake Rule 3, #7838). */
51
+ /**
52
+ * Commerce's apps/web files that reach the hub's own checkout (spoke-intake
53
+ * Rule 3, #7838). The flows `results` routes are generated (#11251): the
54
+ * route generator reads this entry and reports them not carried on a spoke.
55
+ */
52
56
  export const SPOKE_HUB_CHECKOUT_SEEDS = [
53
- "apps/web/app/[locale]/flows/[slug]/checkout.actions.ts",
54
57
  "apps/web/app/[locale]/flows/[slug]/results",
55
58
  "apps/web/app/[locale]/dev/purchase",
56
59
  ];
@@ -130,18 +133,31 @@ export const SPOKE_ONLY_FILES = [
130
133
  "tools/declared-env.ts",
131
134
  "tools/check-declared-env.ts",
132
135
  ];
136
+ /**
137
+ * A page package's site config (#11219, ADR 0040 rule 4): the one typed file
138
+ * through which the site customizes the pages the package ships, and the
139
+ * host's runtime-services seam its actions read. Since #11227 it imports
140
+ * only `lib/` files every topology carries, never the account area, so a
141
+ * spoke that drops that area (the default mode's `(authed)` seed) drops the
142
+ * config by a seed of that mode, not by the closure. A hub-sign-in spoke
143
+ * keeps both.
144
+ */
145
+ export const PAGE_PACKAGE_CONFIG_FILES = ["apps/web/account.config.tsx"];
133
146
  /**
134
147
  * The closure's allow-list: a file `spokeExclusions` removes must sit under
135
148
  * one of these prefixes, or under a `__tests__/` directory. A member outside
136
149
  * both is a defect — a shared file started importing a sign-in or database
137
150
  * file — and `spokeExclusions` throws naming it rather than cut it silently.
138
151
  */
139
- export const SPOKE_REMOVABLE_PREFIXES = SPOKE_REMOVAL_SEEDS;
152
+ export const SPOKE_REMOVABLE_PREFIXES = [
153
+ ...SPOKE_REMOVAL_SEEDS,
154
+ ...PAGE_PACKAGE_CONFIG_FILES,
155
+ ];
140
156
  /** The seeds for a sign-in mode, before the mcp filter. */
141
157
  function modeSeeds(signIn) {
142
158
  return signIn === "hub"
143
159
  ? SPOKE_REMOVAL_SEEDS.flatMap((seed) => seed === AUTHED_SEED ? [...HUB_MODE_AUTHED_SEEDS] : [seed])
144
- : [...SPOKE_REMOVAL_SEEDS];
160
+ : [...SPOKE_REMOVAL_SEEDS, ...PAGE_PACKAGE_CONFIG_FILES];
145
161
  }
146
162
  function toPosix(path) {
147
163
  return path.split("\\").join("/").replace(/^\.\//, "");
@@ -468,6 +484,23 @@ export async function loadSpokeBilling(): Promise<SpokeBilling | null> {
468
484
  return { read: readSpokeBilling, portalUrl: spokeBillingPortalUrl };
469
485
  }`;
470
486
  }
487
+ /**
488
+ * `loadAuth` (#11257 D5): the one way `@working-theory/auth` reaches the
489
+ * site's Better Auth instance, through `auth.config.tsx`. The hub render
490
+ * loads `auth.ts` only when it is called, and the assignment to
491
+ * `AuthInstance` is where `typeof auth` is checked against what the package
492
+ * calls; a spoke has no `auth.ts`, so its renders resolve `null`.
493
+ */
494
+ function authLoader(topology) {
495
+ if (topology === "hub") {
496
+ return `export function loadAuth(): Promise<AuthInstance | null> {
497
+ return import("../auth").then((m) => m.auth);
498
+ }`;
499
+ }
500
+ return `export function loadAuth(): Promise<AuthInstance | null> {
501
+ return Promise.resolve(null);
502
+ }`;
503
+ }
471
504
  /**
472
505
  * `apps/web/lib/topology.generated.ts` for `topology` (D5) and, on a spoke,
473
506
  * its sign-in mode (#7894 D8). The hub render loads `auth.ts` only when a
@@ -484,6 +517,7 @@ export function renderWebSeam(topology, signIn = "off", opts = {}) {
484
517
  }
485
518
  if (topology === "hub") {
486
519
  return `${WEB_SEAM_HEADER}
520
+ import type { AuthInstance } from "${AUTH_PACKAGE}/site";
487
521
 
488
522
  export const TOPOLOGY: "hub" | "spoke" = "hub";
489
523
  ${unservedToolsExport("hub")}
@@ -496,6 +530,8 @@ export async function readSession(headers: Headers): Promise<SiteSession> {
496
530
  return auth.api.getSession({ headers });
497
531
  }
498
532
 
533
+ ${authLoader("hub")}
534
+
499
535
  ${ownAccountsReader("hub")}
500
536
 
501
537
  ${phoneStep("hub")}
@@ -510,7 +546,8 @@ ${spokeBillingLoader(false)}
510
546
  }
511
547
  if (signIn === "hub") {
512
548
  return `${WEB_SEAM_HEADER}
513
- import { readHubSession } from "./hub-session/session";
549
+ import type { AuthInstance } from "${AUTH_PACKAGE}/site";
550
+ import { readHubSession } from "${AUTH_PACKAGE}/hub-session";
514
551
 
515
552
  export const TOPOLOGY: "hub" | "spoke" = "spoke";
516
553
  ${unservedToolsExport("spoke")}
@@ -522,6 +559,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
522
559
  return readHubSession(headers);
523
560
  }
524
561
 
562
+ ${authLoader("spoke")}
563
+
525
564
  ${ownAccountsReader("spoke")}
526
565
 
527
566
  ${phoneStep("spoke")}
@@ -534,6 +573,7 @@ ${spokeBillingLoader(spokeBilling)}
534
573
  `;
535
574
  }
536
575
  return `${WEB_SEAM_HEADER}
576
+ import type { AuthInstance } from "${AUTH_PACKAGE}/site";
537
577
 
538
578
  export const TOPOLOGY: "hub" | "spoke" = "spoke";
539
579
  ${unservedToolsExport("spoke")}
@@ -546,6 +586,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
546
586
  return Promise.resolve(null);
547
587
  }
548
588
 
589
+ ${authLoader("spoke")}
590
+
549
591
  ${ownAccountsReader("spoke")}
550
592
 
551
593
  ${phoneStep("spoke")}
@@ -569,6 +611,8 @@ const AUTHED_GATE_SEAM_HEADER = `// signed-out-gate.generated.tsx — what the (
569
611
  * the reason `CONTENT_ADAPTERS_PACKAGE` below is.
570
612
  */
571
613
  const UI_PACKAGE = "@working-theory/ui";
614
+ /** The sign-in page package the seams read (#11257 D5, D9). */
615
+ const AUTH_PACKAGE = "@working-theory/auth";
572
616
  const WEB_I18N_PACKAGE = "@working-theory/web-i18n";
573
617
  const NEXT_INTL_SERVER = "next-intl/server";
574
618
  const NEXT_NAVIGATION = "next/navigation";
@@ -588,6 +632,7 @@ const AUTHED_GATE_PROPS = `export interface SignedOutGateProps {
588
632
  export function renderAuthedGateSeam(topology, signIn = "off") {
589
633
  if (topology === "hub") {
590
634
  return `${AUTHED_GATE_SEAM_HEADER}
635
+ import { isAccountPath } from "${AUTH_PACKAGE}/edge";
591
636
  import { localeHref } from "${UI_PACKAGE}";
592
637
  import { Button, Heading, Link, Text } from "${UI_PACKAGE}/primitives";
593
638
  import { readLocales } from "${WEB_I18N_PACKAGE}";
@@ -596,7 +641,6 @@ import { getTranslations } from "${NEXT_INTL_SERVER}";
596
641
  import type { ReactElement } from "${REACT_PACKAGE}";
597
642
 
598
643
  import { getActiveProviderIds } from "../../../lib/auth-env";
599
- import { isAccountPath } from "../../../lib/auth-routes";
600
644
 
601
645
  /** The methods a member signs in with on /sign-in's card. */
602
646
  const MEMBER_METHODS: readonly string[] = ["google", "github", "magic-link"];
@@ -662,7 +706,7 @@ export async function SignedOutGate({
662
706
  return `${AUTHED_GATE_SEAM_HEADER}
663
707
  import type { ReactElement } from "${REACT_PACKAGE}";
664
708
 
665
- import { SpokeSignIn } from "../../../lib/hub-session";
709
+ import { SpokeSignIn } from "${AUTH_PACKAGE}/hub-session";
666
710
 
667
711
  ${AUTHED_GATE_PROPS}
668
712
 
@@ -923,10 +967,231 @@ export function applySpokeTransforms(targetDir, opts) {
923
967
  writeFileSync(join(targetDir, AUTHED_GATE_SEAM_PATH), renderAuthedGateSeam("spoke", "hub"));
924
968
  }
925
969
  writeFileSync(join(targetDir, API_ORIGIN_SEAM_PATH), renderApiOriginSeam("spoke"));
970
+ // #11257 D4 — the sign-in package's seam, in its spoke shape (`hub: null`).
971
+ writeFileSync(join(targetDir, AUTH_CONFIG_PATH), renderAuthConfig("spoke"));
926
972
  if (opts.mcp) {
927
973
  writeFileSync(join(targetDir, MCP_SEAM_PATH), renderMcpSeam("spoke"));
928
974
  }
929
975
  }
976
+ /** The page-package config the sign-in package reads its services from (#11257 D4). */
977
+ export const AUTH_CONFIG_PATH = "apps/web/auth.config.tsx";
978
+ /**
979
+ * `apps/web/auth.config.tsx` for `topology` (#11257 D4): the hub render is
980
+ * this monorepo's file, byte for byte (`spoke-topology.test.ts` pins the
981
+ * two); the spoke render passes `hub: null` and imports none of the hub-only
982
+ * libs (`lib/auth-email.ts`, `lib/auth-secret.ts`, `lib/consent-policies.ts`).
983
+ * Neither imports `auth.ts`: Better Auth arrives through the topology seam's
984
+ * `loadAuth()`, so a spoke keeps the file and no closure removes it.
985
+ */
986
+ export function renderAuthConfig(topology) {
987
+ return (topology === "hub" ? AUTH_CONFIG_HUB : AUTH_CONFIG_SPOKE).join("\n");
988
+ }
989
+ const AUTH_CONFIG_HUB = [
990
+ "/**",
991
+ " * The site's sign-in configuration (#11257; ADR 0040 rule 4) — the one typed",
992
+ " * file through which this site customizes and serves `@working-theory/auth`.",
993
+ " *",
994
+ " * The default export is `defineAuthConfig({ … })`, which the generated",
995
+ " * `(auth)` layout file passes to the layout as `config`; it carries no",
996
+ " * extension point yet (rule 8), and a misspelled key fails `tsc`.",
997
+ " *",
998
+ " * The named export `site` is the runtime-services seam (`AuthSite`) the",
999
+ " * package's pages, actions and handlers read through",
1000
+ " * `@working-theory/auth/site` (aliased here by `next.config.mjs` and",
1001
+ " * `jest.config.cjs`). It never imports `./auth`: Better Auth arrives through",
1002
+ " * the generated topology seam's `loadAuth()` — a dynamic import on a hub,",
1003
+ " * `null` on a spoke — so a spoke keeps this file. A spoke's copy passes",
1004
+ " * `hub: null` and imports none of the hub-only libs.",
1005
+ " *",
1006
+ " * Every value the generated topology seam owns is read through on access,",
1007
+ " * never copied at load: a spoke's topology seam imports the package's",
1008
+ " * hub-session entry, which can load before this file finishes.",
1009
+ " */",
1010
+ "import { type AuthSite, defineAuthConfig } from \"@working-theory/auth\";",
1011
+ "",
1012
+ "import { browserApiOrigin } from \"./lib/api-origin.generated\";",
1013
+ "import {",
1014
+ " buildAuthEmailRequest,",
1015
+ " confirmSignUpEmail,",
1016
+ " makeSendAccountOpen,",
1017
+ " purchaseCapture,",
1018
+ "} from \"./lib/auth-email\";",
1019
+ "import {",
1020
+ " getActiveProviderIds,",
1021
+ " hasAnyProvider,",
1022
+ " isAuthRequired,",
1023
+ " isResetAvailable,",
1024
+ " isSignUpOpen,",
1025
+ " magicLinkSendConfigured,",
1026
+ " phoneVerificationConfigured,",
1027
+ " resetSendConfigured,",
1028
+ "} from \"./lib/auth-env\";",
1029
+ "import { resolveSecret } from \"./lib/auth-secret\";",
1030
+ "import { runBotCheck } from \"./lib/bot-check\";",
1031
+ "import { consentPoliciesFor } from \"./lib/consent-policies\";",
1032
+ "import { SITE_NAME } from \"./lib/site-brand\";",
1033
+ "import { siteLogo } from \"./lib/site-logo\";",
1034
+ "import {",
1035
+ " loadAuth,",
1036
+ " readSession,",
1037
+ " SIGN_IN_PROVIDER,",
1038
+ " SIGN_OUT_ENDPOINT,",
1039
+ " TOPOLOGY,",
1040
+ "} from \"./lib/topology.generated\";",
1041
+ "import {",
1042
+ " clientIpFromHeaders,",
1043
+ " takeVisitorLimit,",
1044
+ " UNKNOWN_VISITOR_FACTOR,",
1045
+ "} from \"./src/lib/rate-limit\";",
1046
+ "import { resolveBaseUrl } from \"./src/lib/routes\";",
1047
+ "",
1048
+ "export default defineAuthConfig({});",
1049
+ "",
1050
+ "export const site = {",
1051
+ " loadAuth: () => loadAuth(),",
1052
+ " env: {",
1053
+ " isAuthRequired: () => isAuthRequired(),",
1054
+ " isSignUpOpen: () => isSignUpOpen(),",
1055
+ " isResetAvailable: () => isResetAvailable(),",
1056
+ " getActiveProviderIds: () => getActiveProviderIds(),",
1057
+ " magicLinkSendConfigured: () => magicLinkSendConfigured(),",
1058
+ " hasAnyProvider: () => hasAnyProvider(),",
1059
+ " resetSendConfigured: () => resetSendConfigured(),",
1060
+ " phoneVerificationConfigured: () => phoneVerificationConfigured(),",
1061
+ " },",
1062
+ " siteLogo: () => siteLogo(),",
1063
+ " get siteName() {",
1064
+ " return SITE_NAME;",
1065
+ " },",
1066
+ " resolveBaseUrl: () => resolveBaseUrl(),",
1067
+ " browserApiOrigin: () => browserApiOrigin(),",
1068
+ " runBotCheck: (input) => runBotCheck(input),",
1069
+ " takeVisitorLimit: (scope, headers, limit, windowMs) =>",
1070
+ " takeVisitorLimit(scope, headers, limit, windowMs),",
1071
+ " clientIpFromHeaders: (headers) => clientIpFromHeaders(headers),",
1072
+ " get unknownVisitorFactor() {",
1073
+ " return UNKNOWN_VISITOR_FACTOR;",
1074
+ " },",
1075
+ " get topology() {",
1076
+ " return TOPOLOGY;",
1077
+ " },",
1078
+ " get signInProvider() {",
1079
+ " return SIGN_IN_PROVIDER;",
1080
+ " },",
1081
+ " get signOutEndpoint() {",
1082
+ " return SIGN_OUT_ENDPOINT;",
1083
+ " },",
1084
+ " readSession: (headers) => readSession(headers),",
1085
+ " hub: {",
1086
+ " resolveSecret: () => resolveSecret(),",
1087
+ " consentPoliciesFor: (locale) => consentPoliciesFor(locale),",
1088
+ " email: {",
1089
+ " confirmSignUpEmail: (nonce) => confirmSignUpEmail(nonce),",
1090
+ " makeSendAccountOpen: (deps) => makeSendAccountOpen(deps),",
1091
+ " buildAuthEmailRequest: (payload, secret) =>",
1092
+ " buildAuthEmailRequest(",
1093
+ " payload as Parameters<typeof buildAuthEmailRequest>[0],",
1094
+ " secret,",
1095
+ " ),",
1096
+ " purchaseCapture,",
1097
+ " },",
1098
+ " },",
1099
+ "} satisfies AuthSite;",
1100
+ "",
1101
+ ];
1102
+ const AUTH_CONFIG_SPOKE = [
1103
+ "/**",
1104
+ " * The site's sign-in configuration (#11257; ADR 0040 rule 4) — the one typed",
1105
+ " * file through which this site customizes and serves `@working-theory/auth`.",
1106
+ " *",
1107
+ " * The default export is `defineAuthConfig({ … })`, which the generated",
1108
+ " * `(auth)` layout file passes to the layout as `config`; it carries no",
1109
+ " * extension point yet (rule 8), and a misspelled key fails `tsc`.",
1110
+ " *",
1111
+ " * The named export `site` is the runtime-services seam (`AuthSite`) the",
1112
+ " * package's pages, actions and handlers read through",
1113
+ " * `@working-theory/auth/site` (aliased here by `next.config.mjs` and",
1114
+ " * `jest.config.cjs`). It never imports `./auth`: Better Auth arrives through",
1115
+ " * the generated topology seam's `loadAuth()` — a dynamic import on a hub,",
1116
+ " * `null` on a spoke — so a spoke keeps this file. A spoke's copy passes",
1117
+ " * `hub: null` and imports none of the hub-only libs.",
1118
+ " *",
1119
+ " * Every value the generated topology seam owns is read through on access,",
1120
+ " * never copied at load: a spoke's topology seam imports the package's",
1121
+ " * hub-session entry, which can load before this file finishes.",
1122
+ " */",
1123
+ "import { type AuthSite, defineAuthConfig } from \"@working-theory/auth\";",
1124
+ "",
1125
+ "import { browserApiOrigin } from \"./lib/api-origin.generated\";",
1126
+ "import {",
1127
+ " getActiveProviderIds,",
1128
+ " hasAnyProvider,",
1129
+ " isAuthRequired,",
1130
+ " isResetAvailable,",
1131
+ " isSignUpOpen,",
1132
+ " magicLinkSendConfigured,",
1133
+ " phoneVerificationConfigured,",
1134
+ " resetSendConfigured,",
1135
+ "} from \"./lib/auth-env\";",
1136
+ "import { runBotCheck } from \"./lib/bot-check\";",
1137
+ "import { SITE_NAME } from \"./lib/site-brand\";",
1138
+ "import { siteLogo } from \"./lib/site-logo\";",
1139
+ "import {",
1140
+ " loadAuth,",
1141
+ " readSession,",
1142
+ " SIGN_IN_PROVIDER,",
1143
+ " SIGN_OUT_ENDPOINT,",
1144
+ " TOPOLOGY,",
1145
+ "} from \"./lib/topology.generated\";",
1146
+ "import {",
1147
+ " clientIpFromHeaders,",
1148
+ " takeVisitorLimit,",
1149
+ " UNKNOWN_VISITOR_FACTOR,",
1150
+ "} from \"./src/lib/rate-limit\";",
1151
+ "import { resolveBaseUrl } from \"./src/lib/routes\";",
1152
+ "",
1153
+ "export default defineAuthConfig({});",
1154
+ "",
1155
+ "export const site = {",
1156
+ " loadAuth: () => loadAuth(),",
1157
+ " env: {",
1158
+ " isAuthRequired: () => isAuthRequired(),",
1159
+ " isSignUpOpen: () => isSignUpOpen(),",
1160
+ " isResetAvailable: () => isResetAvailable(),",
1161
+ " getActiveProviderIds: () => getActiveProviderIds(),",
1162
+ " magicLinkSendConfigured: () => magicLinkSendConfigured(),",
1163
+ " hasAnyProvider: () => hasAnyProvider(),",
1164
+ " resetSendConfigured: () => resetSendConfigured(),",
1165
+ " phoneVerificationConfigured: () => phoneVerificationConfigured(),",
1166
+ " },",
1167
+ " siteLogo: () => siteLogo(),",
1168
+ " get siteName() {",
1169
+ " return SITE_NAME;",
1170
+ " },",
1171
+ " resolveBaseUrl: () => resolveBaseUrl(),",
1172
+ " browserApiOrigin: () => browserApiOrigin(),",
1173
+ " runBotCheck: (input) => runBotCheck(input),",
1174
+ " takeVisitorLimit: (scope, headers, limit, windowMs) =>",
1175
+ " takeVisitorLimit(scope, headers, limit, windowMs),",
1176
+ " clientIpFromHeaders: (headers) => clientIpFromHeaders(headers),",
1177
+ " get unknownVisitorFactor() {",
1178
+ " return UNKNOWN_VISITOR_FACTOR;",
1179
+ " },",
1180
+ " get topology() {",
1181
+ " return TOPOLOGY;",
1182
+ " },",
1183
+ " get signInProvider() {",
1184
+ " return SIGN_IN_PROVIDER;",
1185
+ " },",
1186
+ " get signOutEndpoint() {",
1187
+ " return SIGN_OUT_ENDPOINT;",
1188
+ " },",
1189
+ " readSession: (headers) => readSession(headers),",
1190
+ " // A spoke mounts none of the hub's routes or (auth) pages (#11257 D4).",
1191
+ " hub: null,",
1192
+ "} satisfies AuthSite;",
1193
+ "",
1194
+ ];
930
1195
  /** The env var a spoke reaches its hub through. */
931
1196
  export const HUB_ORIGIN_ENV_VAR = "AILK_API_URL";
932
1197
  /** Env files `next start` loads for an app, highest precedence first. */
@@ -1036,6 +1301,7 @@ export function renderSpokeHardFloors(opts) {
1036
1301
  ' - "apps/web/app/[locale]/(authed)/**"',
1037
1302
  ' - "apps/web/lib/hub-session/**"',
1038
1303
  ' - "apps/web/app/api/hub-session/**"',
1304
+ ' - "apps/web/auth.config.tsx"',
1039
1305
  opts.signIn === "hub"
1040
1306
  ? " reason: sign-in paths — this spoke signs in through its hub; every change requires human review"
1041
1307
  : " reason: sign-in paths — absent on a spoke; their return requires human review",
package/dist/update.d.ts CHANGED
@@ -21,7 +21,10 @@ export interface UpdateSiteOptions {
21
21
  * of a copied `apps/mcp` declares `@working-theory/mcp-server` and each
22
22
  * carried module's paid MCP pack at, and (#9566) the move of a copied
23
23
  * `apps/api` declares `@working-theory/api` and the six module packages
24
- * at. A site already on both boot sets, or a spoke, never reads it.
24
+ * at. A site already on both boot sets, or a spoke, never reads it for
25
+ * those. #11392 — the version each `@working-theory/*` package a written
26
+ * `apps/web` file imports, and the site does not declare, is added at; a
27
+ * package it lacks refuses the run before any write.
25
28
  */
26
29
  versions?: WorkspaceVersionMap;
27
30
  /**
@@ -80,6 +83,11 @@ export interface UpdateResult {
80
83
  file: string;
81
84
  importers: string[];
82
85
  }>;
86
+ /** Per lib file written because a moving test's import chain reaches it (#11234): the tests. */
87
+ testLibs?: Array<{
88
+ file: string;
89
+ tests: string[];
90
+ }>;
83
91
  /** The recorded files whose bytes were another published template version's copy, moved as untouched (#11147). */
84
92
  staleCopies?: Array<{
85
93
  path: string;
@@ -104,6 +112,13 @@ export interface UpdateResult {
104
112
  headingsAdded: string[];
105
113
  /** The mdx-body pages under `content/` whose bare `{` were escaped this run (#10773). */
106
114
  bracesEscaped: string[];
115
+ /** The generated route files written from the installed page packages' manifests after the pins moved (#11219). */
116
+ routesWritten?: string[];
117
+ /** The root `devDependencies["create-ailk"]` pin, moved to the running version so the scaffold's `routes:check` renders with the generator that wrote the files (#11219). */
118
+ cliPin?: {
119
+ from: string;
120
+ to: string;
121
+ };
107
122
  backfilled?: {
108
123
  version: string;
109
124
  files: number;
@@ -141,6 +156,6 @@ export interface UpdateArgs {
141
156
  target: string | undefined;
142
157
  help: boolean;
143
158
  }
144
- export declare const UPDATE_HELP = "create-ailk update \u2014 bring template fixes into a site's copied app code.\n\nUsage:\n create-ailk update [<target-dir>]\n\nArguments:\n <target-dir> The existing site. Defaults to the current dir.\n\nOptions:\n --help, -h Print this message.\n\nReads .ailk-template-files.json (written beside .ailk-site-manifest.json by\nevery template scaffold) to tell an untouched copy from an edit. An\nuntouched apps/web, apps/api or apps/mcp file, or a root tools/jest file the\napp jest configs require, whose template copy changed is overwritten. An\nedited file whose template copy also changed is three-way merged with\n`git` (git must be on PATH); a conflict leaves the file alone and is\nlisted under \"Needs review\"; an apps/web/messages catalog instead gains the\ntemplate's new keys and keeps every value it has, and is reviewed only when a\nkey is an object on one side and a value on the other. An edited file whose\nbytes are another published create-ailk version's copy is a stale copy, not\nan edit: it is overwritten or removed as an untouched file is, listed with\nthe version it matched. An edit that touches only comment lines is listed as\n\"comment-only edit\"; on a conflict the template's copy lands. A file at a\ntemplate path that is not in the record (one an earlier sync-routes --apply\nor add-route copied without recording it) whose bytes are a published\ncreate-ailk version's copy \u2014 from the version the site was scaffolded at to\nthis one \u2014 is adopted: recorded and moved forward as an untouched file is,\nlisted under \"Adopted\" with the version it matched. One whose bytes match no\npublished copy is a site edit: skipped, never overwritten, and counted under\n\"Held as site edits, not in the record\". Every template\ntest, and every site-edited template file, that imports a file left under\n\"Needs review\" (by a relative or @/ import, transitively) is held\nat the site's version with it, its record entry is not advanced, and it is\nlisted under \"Held back with <file>\" \u2014 reconcile the file, then run update\nagain to bring it forward. A skipped file never holds another. A file whose\nown bytes are the record's is not held by what it imports: it moves, unless\nit names an export the held copy lacks, and the held file is listed as\n\"Held back: <file> \u2014 imported by N moved files; the site edit is <hunk\nsummary>\". A written file whose import names a file the site lacks gets it\nadded when this template supplies it; otherwise it is held the same way,\nunder \"Held back with <file> (not in this site)\", unless its own copy\nalready named the file \u2014 then it moves and the path is listed under \"Not in\nthis site or the template: <file>\". A file the template removed is kept\nwhile any file still in the site imports it. Every other file in the run\nstill updates. When project.yaml has an env_contract block, each\nenv var the written files read that has no row gains one; no row is edited.\nA record row at a path create-ailk no longer records is dropped and listed.\nA surface the site's .ailk-site-manifest.json names a page on but\narchitecture.yaml does not declare (one no module owns, such as projects)\ngets its route files added and is declared, listed under \"Surfaces declared\nfrom the roster\". A code-route row of that roster no page file serves is\ndropped, listed under \"Roster rows dropped, no route serves them\".\nA site with no record gets one on its first run, from the version its\n.ailk-site-manifest.json already records. A site scaffolded before\n@working-theory/mcp-server has its copied apps/mcp moved to the boot set:\nthe server and each module's paid MCP pack join apps/mcp/package.json, the\ncopied server files go, and apps/mcp/src/lib/paid-tools.generated.ts is\nrewritten on every run. A site scaffolded before @working-theory/api has its\ncopied apps/api moved to the boot file: the app becomes @working-theory/app-api,\nthe package and the six @working-theory/api-<module> packages join\napps/api/package.json, its bins and build:vercel delegate to the package, and\nthe copied server files go. Run `pnpm install` after either move, since the\napp's package.json gained dependencies. Each mdx-body page in content/ with no\n'# ' heading gets its title and description written into its body as its\nheading and intro, listed under \"Page heading added\"; a page with one heading\nis left as it is, and one with several, or one whose frontmatter it cannot\nread, is listed under \"Needs review\". Each bare { on an mdx-body page is\nescaped as \\{ when the site's own MDX parser then reads the page clean, listed\nunder \"Placeholder brace escaped\"; a page it cannot escape safely, or any page\nwith one while the site's dependencies are not installed, is listed under\n\"Needs review\". Commit before running, and review the diff after.\n";
159
+ export declare const UPDATE_HELP = "create-ailk update \u2014 bring template fixes into a site's copied app code.\n\nUsage:\n create-ailk update [<target-dir>]\n\nArguments:\n <target-dir> The existing site. Defaults to the current dir.\n\nOptions:\n --help, -h Print this message.\n\nReads .ailk-template-files.json (written beside .ailk-site-manifest.json by\nevery template scaffold) to tell an untouched copy from an edit. An\nuntouched apps/web, apps/api or apps/mcp file, or a root tools/jest file the\napp jest configs require, whose template copy changed is overwritten. An\nedited file whose template copy also changed is three-way merged with\n`git` (git must be on PATH); a conflict leaves the file alone and is\nlisted under \"Needs review\"; an apps/web/messages catalog instead gains the\ntemplate's new keys and keeps every value it has \u2014 also when its recorded\nversion's copy cannot be read \u2014 and is reviewed only when a key is an object\non one side and a value on the other; a written apps/web file that uses\nthrough t(...) a key the catalog then lacks is held with it, listed under\n\"Held back with <catalog>\". Each @working-theory/* package a written apps/web\nfile imports that apps/web/package.json does not declare is added to its\ndependencies at this release's version. An edited file whose\nbytes are another published create-ailk version's copy is a stale copy, not\nan edit: it is overwritten or removed as an untouched file is, listed with\nthe version it matched. An edit that touches only comment lines is listed as\n\"comment-only edit\"; on a conflict the template's copy lands. A file at a\ntemplate path that is not in the record (one an earlier sync-routes --apply\nor add-route copied without recording it) whose bytes are a published\ncreate-ailk version's copy \u2014 from the version the site was scaffolded at to\nthis one \u2014 is adopted: recorded and moved forward as an untouched file is,\nlisted under \"Adopted\" with the version it matched. One whose bytes match no\npublished copy is a site edit: skipped, never overwritten, and counted under\n\"Held as site edits, not in the record\". No file under a route the site\nlists in customizations.yaml declined_routes is written: each is listed under\n\"Skipped\" naming the declined route. Every template\ntest, and every site-edited template file, that imports a file left under\n\"Needs review\" (by a relative or @/ import, transitively) is held\nat the site's version with it, its record entry is not advanced, and it is\nlisted under \"Held back with <file>\" \u2014 reconcile the file, then run update\nagain to bring it forward. A skipped file never holds another. A file whose\nown bytes are the record's is not held by what it imports: it moves, unless\nit names an export the held copy lacks, and the held file is listed as\n\"Held back: <file> \u2014 imported by N moved files; the site edit is <hunk\nsummary>\". A written file whose import names a file the site lacks gets it\nadded when this template supplies it; otherwise it is held the same way,\nunder \"Held back with <file> (not in this site)\", unless its own copy\nalready named the file \u2014 then it moves and the path is listed under \"Not in\nthis site or the template: <file>\". A file the template removed is kept\nwhile any file still in the site imports it. Every other file in the run\nstill updates. When project.yaml has an env_contract block, each\nenv var the written files read that has no row gains one; no row is edited.\nA record row at a path create-ailk no longer records is dropped and listed.\nA surface the site's .ailk-site-manifest.json names a page on but\narchitecture.yaml does not declare (one no module owns, such as projects)\ngets its route files added and is declared, listed under \"Surfaces declared\nfrom the roster\". A code-route row of that roster no page file serves is\ndropped, listed under \"Roster rows dropped, no route serves them\".\nA site with no record gets one on its first run, from the version its\n.ailk-site-manifest.json already records. A site scaffolded before\n@working-theory/mcp-server has its copied apps/mcp moved to the boot set:\nthe server and each module's paid MCP pack join apps/mcp/package.json, the\ncopied server files go, and apps/mcp/src/lib/paid-tools.generated.ts is\nrewritten on every run. A site scaffolded before @working-theory/api has its\ncopied apps/api moved to the boot file: the app becomes @working-theory/app-api,\nthe package and the six @working-theory/api-<module> packages join\napps/api/package.json, its bins and build:vercel delegate to the package, and\nthe copied server files go. Run `pnpm install` after either move, since the\napp's package.json gained dependencies. Each mdx-body page in content/ with no\n'# ' heading gets its title and description written into its body as its\nheading and intro, listed under \"Page heading added\"; a page with one heading\nis left as it is, and one with several, or one whose frontmatter it cannot\nread, is listed under \"Needs review\". Each bare { on an mdx-body page is\nescaped as \\{ when the site's own MDX parser then reads the page clean, listed\nunder \"Placeholder brace escaped\"; a page it cannot escape safely, or any page\nwith one while the site's dependencies are not installed, is listed under\n\"Needs review\". Last, the generated route files of every installed page\npackage (one whose package.json declares \"ailk\": { \"routes\" }) are rewritten\nfrom its manifest, listed under \"Route files regenerated\"; run\n`create-ailk routes --write` after the install when the packages were not\ninstalled yet. Commit before running, and review the diff after.\n";
145
160
  /** Parse the argv AFTER the `update` word. Strict `node:util` parseArgs, like `parseAdoptArgs`. */
146
161
  export declare function parseUpdateArgs(argv: string[]): UpdateArgs;