create-ailk 0.38.0 → 0.40.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 (304) hide show
  1. package/dist/add-route.js +16 -1
  2. package/dist/body-heading.d.ts +2 -1
  3. package/dist/body-heading.js +31 -3
  4. package/dist/derive-architecture.js +3 -1
  5. package/dist/module-architecture.js +0 -3
  6. package/dist/remove-module.js +27 -14
  7. package/dist/routes.d.ts +36 -2
  8. package/dist/routes.js +269 -23
  9. package/dist/site-manifest.js +6 -4
  10. package/dist/site-roster.d.ts +11 -3
  11. package/dist/site-roster.js +48 -22
  12. package/dist/surfaces.d.ts +13 -3
  13. package/dist/surfaces.js +128 -194
  14. package/dist/sync-routes.js +22 -5
  15. package/dist/template-record.js +3 -1
  16. package/dist/topology.d.ts +11 -0
  17. package/dist/topology.js +253 -3
  18. package/package.json +3 -3
  19. package/templates/apps/web/CLAUDE.md +32 -4
  20. package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +6 -1
  21. package/templates/apps/web/__tests__/__mocks__/next-intl.ts +6 -1
  22. package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
  23. package/templates/apps/web/account.config.tsx +2 -3
  24. package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +1 -1
  25. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
  26. package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
  27. package/templates/apps/web/app/[locale]/layout.tsx +2 -2
  28. package/templates/apps/web/auth.config.tsx +107 -0
  29. package/templates/apps/web/auth.ts +2 -1
  30. package/templates/apps/web/i18n/request.ts +13 -2
  31. package/templates/apps/web/jest.config.cjs +10 -0
  32. package/templates/apps/web/lib/__tests__/deck-page.test.ts +9 -0
  33. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +3 -0
  34. package/templates/apps/web/lib/__tests__/in-page-magnet-self-request.test.ts +1 -1
  35. package/templates/apps/web/lib/__tests__/in-page-magnet.test.ts +2 -2
  36. package/templates/apps/web/lib/__tests__/pricing-page.test.ts +1 -1
  37. package/templates/apps/web/lib/__tests__/server-api.test.ts +1 -1
  38. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +17 -4
  39. package/templates/apps/web/lib/in-page-magnet.ts +2 -2
  40. package/templates/apps/web/lib/pricing-page.ts +3 -3
  41. package/templates/apps/web/lib/server-api.ts +1 -1
  42. package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-email.ts +1 -1
  43. package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-lines.ts +1 -1
  44. package/templates/apps/web/lib/site-header.ts +1 -1
  45. package/templates/apps/web/lib/topology.generated.ts +5 -0
  46. package/templates/apps/web/messages/en.json +0 -271
  47. package/templates/apps/web/middleware.ts +12 -25
  48. package/templates/apps/web/next.config.mjs +15 -0
  49. package/templates/apps/web/package.json +2 -0
  50. package/templates/apps/web/site-pages.config.tsx +85 -0
  51. package/templates/apps/web/types/messages.d.ts +6 -1
  52. package/templates/tools/body-heading.ts +30 -3
  53. package/versions.json +50 -48
  54. package/templates/apps/web/app/[locale]/(auth)/__tests__/auth-pages.test.tsx +0 -322
  55. package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +0 -554
  56. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +0 -56
  57. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +0 -164
  58. package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +0 -132
  59. package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +0 -51
  60. package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +0 -144
  61. package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +0 -101
  62. package/templates/apps/web/app/[locale]/(auth)/forgot-password/page.tsx +0 -111
  63. package/templates/apps/web/app/[locale]/(auth)/layout.tsx +0 -81
  64. package/templates/apps/web/app/[locale]/(auth)/legal-footnote.tsx +0 -35
  65. package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +0 -179
  66. package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +0 -157
  67. package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +0 -126
  68. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/next-path.test.ts +0 -54
  69. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +0 -628
  70. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +0 -43
  71. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +0 -266
  72. package/templates/apps/web/app/[locale]/(auth)/sign-in/next-path.ts +0 -20
  73. package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +0 -234
  74. package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +0 -37
  75. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +0 -323
  76. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +0 -93
  77. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/page.test.tsx +0 -301
  78. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +0 -309
  79. package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +0 -201
  80. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +0 -366
  81. package/templates/apps/web/app/[locale]/(auth)/use-auth-card-flow.ts +0 -116
  82. package/templates/apps/web/app/[locale]/(auth)/verify-email/__tests__/actions.test.ts +0 -94
  83. package/templates/apps/web/app/[locale]/(auth)/verify-email/actions.ts +0 -77
  84. package/templates/apps/web/app/[locale]/(auth)/verify-email/page.tsx +0 -154
  85. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -3
  86. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -3
  87. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -3
  88. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -2
  89. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -3
  90. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -12
  91. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -12
  92. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -12
  93. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -2
  94. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -12
  95. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -3
  96. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -10
  97. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -3
  98. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -3
  99. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -12
  100. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -2
  101. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -3
  102. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -3
  103. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -2
  104. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -3
  105. package/templates/apps/web/app/[locale]/(authed)/leads/__tests__/page.test.tsx +0 -205
  106. package/templates/apps/web/app/[locale]/(authed)/leads/components/LeadsTable.tsx +0 -137
  107. package/templates/apps/web/app/[locale]/(authed)/leads/page.tsx +0 -122
  108. package/templates/apps/web/app/[locale]/(authed)/waitlist/components/ForbiddenState.tsx +0 -24
  109. package/templates/apps/web/app/[locale]/(authed)/waitlist/format.ts +0 -111
  110. package/templates/apps/web/app/[locale]/[slug]/[detail]/__tests__/page.test.tsx +0 -402
  111. package/templates/apps/web/app/[locale]/[slug]/[detail]/page.tsx +0 -143
  112. package/templates/apps/web/app/[locale]/[slug]/__tests__/page.test.tsx +0 -148
  113. package/templates/apps/web/app/[locale]/[slug]/page.tsx +0 -109
  114. package/templates/apps/web/app/[locale]/about/[slug]/page.tsx +0 -46
  115. package/templates/apps/web/app/[locale]/about/__tests__/about-routes.test.tsx +0 -353
  116. package/templates/apps/web/app/[locale]/about/page.tsx +0 -122
  117. package/templates/apps/web/app/[locale]/alternatives/__tests__/page.test.tsx +0 -161
  118. package/templates/apps/web/app/[locale]/alternatives/page.tsx +0 -112
  119. package/templates/apps/web/app/[locale]/careers/[slug]/[action]/page.tsx +0 -244
  120. package/templates/apps/web/app/[locale]/careers/[slug]/apply.actions.ts +0 -325
  121. package/templates/apps/web/app/[locale]/careers/[slug]/job-application-form.ts +0 -120
  122. package/templates/apps/web/app/[locale]/careers/[slug]/page.tsx +0 -73
  123. package/templates/apps/web/app/[locale]/careers/__tests__/apply.actions.test.ts +0 -497
  124. package/templates/apps/web/app/[locale]/careers/__tests__/careers-hub.test.tsx +0 -172
  125. package/templates/apps/web/app/[locale]/careers/__tests__/careers-set.test.tsx +0 -153
  126. package/templates/apps/web/app/[locale]/careers/__tests__/job-application-form.test.ts +0 -141
  127. package/templates/apps/web/app/[locale]/careers/__tests__/job-apply-page.test.tsx +0 -546
  128. package/templates/apps/web/app/[locale]/careers/__tests__/page-renderer-migration.test.tsx +0 -189
  129. package/templates/apps/web/app/[locale]/careers/page.tsx +0 -165
  130. package/templates/apps/web/app/[locale]/case-studies/[slug]/page.tsx +0 -49
  131. package/templates/apps/web/app/[locale]/case-studies/__tests__/hub-children.test.tsx +0 -65
  132. package/templates/apps/web/app/[locale]/case-studies/__tests__/page-renderer-migration.test.tsx +0 -125
  133. package/templates/apps/web/app/[locale]/case-studies/page.tsx +0 -49
  134. package/templates/apps/web/app/[locale]/clients/__tests__/page-renderer-migration.test.tsx +0 -85
  135. package/templates/apps/web/app/[locale]/clients/page.tsx +0 -47
  136. package/templates/apps/web/app/[locale]/contact/ConversationalIntakeWrapper.tsx +0 -249
  137. package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +0 -400
  138. package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-magnet.test.ts +0 -138
  139. package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-text.test.ts +0 -49
  140. package/templates/apps/web/app/[locale]/contact/__tests__/contact-magnet-page.test.tsx +0 -494
  141. package/templates/apps/web/app/[locale]/contact/__tests__/contact.actions.test.ts +0 -1122
  142. package/templates/apps/web/app/[locale]/contact/__tests__/intake-analytics.test.ts +0 -51
  143. package/templates/apps/web/app/[locale]/contact/__tests__/page-renderer-migration.test.tsx +0 -319
  144. package/templates/apps/web/app/[locale]/contact/contact-form-magnet.ts +0 -77
  145. package/templates/apps/web/app/[locale]/contact/contact-form-text.ts +0 -52
  146. package/templates/apps/web/app/[locale]/contact/contact.actions.ts +0 -403
  147. package/templates/apps/web/app/[locale]/contact/intake-analytics.ts +0 -49
  148. package/templates/apps/web/app/[locale]/contact/intake-script.ts +0 -92
  149. package/templates/apps/web/app/[locale]/contact/page.tsx +0 -267
  150. package/templates/apps/web/app/[locale]/courses/[slug]/page.tsx +0 -50
  151. package/templates/apps/web/app/[locale]/courses/__tests__/hub-children.test.tsx +0 -32
  152. package/templates/apps/web/app/[locale]/courses/__tests__/page-renderer-migration.test.tsx +0 -123
  153. package/templates/apps/web/app/[locale]/courses/page.tsx +0 -49
  154. package/templates/apps/web/app/[locale]/events/[slug]/page.tsx +0 -57
  155. package/templates/apps/web/app/[locale]/events/__tests__/hub-children.test.tsx +0 -32
  156. package/templates/apps/web/app/[locale]/events/__tests__/page-renderer-migration.test.tsx +0 -164
  157. package/templates/apps/web/app/[locale]/events/__tests__/program-event.test.tsx +0 -120
  158. package/templates/apps/web/app/[locale]/events/page.tsx +0 -60
  159. package/templates/apps/web/app/[locale]/faq/page.tsx +0 -54
  160. package/templates/apps/web/app/[locale]/features/[slug]/page.tsx +0 -54
  161. package/templates/apps/web/app/[locale]/features/__tests__/hub-children.test.tsx +0 -32
  162. package/templates/apps/web/app/[locale]/features/page.tsx +0 -50
  163. package/templates/apps/web/app/[locale]/for/[slug]/page.tsx +0 -54
  164. package/templates/apps/web/app/[locale]/for/__tests__/hub-children.test.tsx +0 -32
  165. package/templates/apps/web/app/[locale]/for/__tests__/page-renderer-migration.test.tsx +0 -90
  166. package/templates/apps/web/app/[locale]/for/page.tsx +0 -51
  167. package/templates/apps/web/app/[locale]/glossary/page.tsx +0 -53
  168. package/templates/apps/web/app/[locale]/how-to/[slug]/page.tsx +0 -50
  169. package/templates/apps/web/app/[locale]/how-to/__tests__/page-renderer-migration.test.tsx +0 -78
  170. package/templates/apps/web/app/[locale]/how-to/page.tsx +0 -50
  171. package/templates/apps/web/app/[locale]/integrations/[slug]/page.tsx +0 -54
  172. package/templates/apps/web/app/[locale]/integrations/__tests__/hub-children.test.tsx +0 -38
  173. package/templates/apps/web/app/[locale]/integrations/__tests__/page-renderer-migration.test.tsx +0 -141
  174. package/templates/apps/web/app/[locale]/integrations/page.tsx +0 -49
  175. package/templates/apps/web/app/[locale]/launch-service/page.tsx +0 -44
  176. package/templates/apps/web/app/[locale]/newsletter/__tests__/page.test.tsx +0 -236
  177. package/templates/apps/web/app/[locale]/newsletter/page.tsx +0 -179
  178. package/templates/apps/web/app/[locale]/page.tsx +0 -147
  179. package/templates/apps/web/app/[locale]/partners/[slug]/page.tsx +0 -45
  180. package/templates/apps/web/app/[locale]/partners/__tests__/hub-children.test.tsx +0 -32
  181. package/templates/apps/web/app/[locale]/partners/__tests__/page-renderer-migration.test.tsx +0 -125
  182. package/templates/apps/web/app/[locale]/partners/page.tsx +0 -49
  183. package/templates/apps/web/app/[locale]/portfolio/[slug]/page.tsx +0 -46
  184. package/templates/apps/web/app/[locale]/portfolio/__tests__/hub-children.test.tsx +0 -38
  185. package/templates/apps/web/app/[locale]/portfolio/page.tsx +0 -50
  186. package/templates/apps/web/app/[locale]/pricing/[slug]/__tests__/page.test.tsx +0 -324
  187. package/templates/apps/web/app/[locale]/pricing/[slug]/page.tsx +0 -87
  188. package/templates/apps/web/app/[locale]/pricing/__tests__/__snapshots__/unconnected.test.tsx.snap +0 -7
  189. package/templates/apps/web/app/[locale]/pricing/__tests__/offerings.test.tsx +0 -605
  190. package/templates/apps/web/app/[locale]/pricing/__tests__/page.test.tsx +0 -219
  191. package/templates/apps/web/app/[locale]/pricing/__tests__/pricing-pages.test.tsx +0 -215
  192. package/templates/apps/web/app/[locale]/pricing/__tests__/unconnected.test.tsx +0 -282
  193. package/templates/apps/web/app/[locale]/pricing/page.tsx +0 -120
  194. package/templates/apps/web/app/[locale]/privacy/page.tsx +0 -40
  195. package/templates/apps/web/app/[locale]/products/[slug]/page.tsx +0 -50
  196. package/templates/apps/web/app/[locale]/products/__tests__/hub-children.test.tsx +0 -32
  197. package/templates/apps/web/app/[locale]/products/__tests__/page-renderer-migration.test.tsx +0 -141
  198. package/templates/apps/web/app/[locale]/products/page.tsx +0 -49
  199. package/templates/apps/web/app/[locale]/projects/[slug]/page.tsx +0 -37
  200. package/templates/apps/web/app/[locale]/projects/__tests__/hub-children.test.tsx +0 -32
  201. package/templates/apps/web/app/[locale]/projects/__tests__/page-renderer-migration.test.tsx +0 -157
  202. package/templates/apps/web/app/[locale]/projects/page.tsx +0 -49
  203. package/templates/apps/web/app/[locale]/purchase-policy/page.tsx +0 -49
  204. package/templates/apps/web/app/[locale]/resources/[slug]/page.tsx +0 -54
  205. package/templates/apps/web/app/[locale]/resources/__tests__/hub-children.test.tsx +0 -38
  206. package/templates/apps/web/app/[locale]/resources/__tests__/page-renderer-migration.test.tsx +0 -151
  207. package/templates/apps/web/app/[locale]/resources/page.tsx +0 -49
  208. package/templates/apps/web/app/[locale]/services/[slug]/[child]/page.tsx +0 -68
  209. package/templates/apps/web/app/[locale]/services/[slug]/page.tsx +0 -88
  210. package/templates/apps/web/app/[locale]/services/__tests__/hub-children.test.tsx +0 -158
  211. package/templates/apps/web/app/[locale]/services/__tests__/page-renderer-migration.test.tsx +0 -187
  212. package/templates/apps/web/app/[locale]/services/__tests__/service-detail-sections.test.tsx +0 -224
  213. package/templates/apps/web/app/[locale]/services/__tests__/service-families.test.tsx +0 -368
  214. package/templates/apps/web/app/[locale]/services/page.tsx +0 -71
  215. package/templates/apps/web/app/[locale]/software/[slug]/page.tsx +0 -49
  216. package/templates/apps/web/app/[locale]/software/__tests__/page-renderer-migration.test.tsx +0 -81
  217. package/templates/apps/web/app/[locale]/software/page.tsx +0 -49
  218. package/templates/apps/web/app/[locale]/team/[slug]/page.tsx +0 -45
  219. package/templates/apps/web/app/[locale]/team/__tests__/hub-children.test.tsx +0 -32
  220. package/templates/apps/web/app/[locale]/team/__tests__/team-routes.test.tsx +0 -161
  221. package/templates/apps/web/app/[locale]/team/page.tsx +0 -50
  222. package/templates/apps/web/app/[locale]/tech-articles/[slug]/page.tsx +0 -54
  223. package/templates/apps/web/app/[locale]/tech-articles/__tests__/page-renderer-migration.test.tsx +0 -82
  224. package/templates/apps/web/app/[locale]/tech-articles/page.tsx +0 -49
  225. package/templates/apps/web/app/[locale]/templates/[slug]/__tests__/page.test.tsx +0 -203
  226. package/templates/apps/web/app/[locale]/templates/[slug]/page.tsx +0 -81
  227. package/templates/apps/web/app/[locale]/templates/__tests__/page.test.tsx +0 -237
  228. package/templates/apps/web/app/[locale]/templates/page.tsx +0 -114
  229. package/templates/apps/web/app/[locale]/terms/page.tsx +0 -40
  230. package/templates/apps/web/app/[locale]/testimonials/__tests__/page-renderer-migration.test.tsx +0 -85
  231. package/templates/apps/web/app/[locale]/testimonials/page.tsx +0 -51
  232. package/templates/apps/web/app/[locale]/thanks/[slug]/__tests__/page.test.tsx +0 -136
  233. package/templates/apps/web/app/[locale]/thanks/[slug]/page.tsx +0 -39
  234. package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe-rsc-boundary.test.tsx +0 -226
  235. package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe.test.tsx +0 -217
  236. package/templates/apps/web/app/[locale]/unsubscribe/page.tsx +0 -106
  237. package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe-button.tsx +0 -94
  238. package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe.actions.ts +0 -55
  239. package/templates/apps/web/app/[locale]/vs/[slug]/__tests__/page.test.tsx +0 -100
  240. package/templates/apps/web/app/[locale]/vs/[slug]/page.tsx +0 -60
  241. package/templates/apps/web/app/[locale]/whitepapers/[slug]/page.tsx +0 -54
  242. package/templates/apps/web/app/[locale]/whitepapers/__tests__/page-renderer-migration.test.tsx +0 -82
  243. package/templates/apps/web/app/[locale]/whitepapers/page.tsx +0 -49
  244. package/templates/apps/web/app/[locale]/working-agreement/__tests__/page.test.tsx +0 -63
  245. package/templates/apps/web/app/[locale]/working-agreement/page.tsx +0 -41
  246. package/templates/apps/web/app/api/auth/[...all]/route.ts +0 -16
  247. package/templates/apps/web/app/api/auth/hub/__tests__/continuation.test.ts +0 -143
  248. package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +0 -749
  249. package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +0 -964
  250. package/templates/apps/web/app/api/auth/hub/authorize/route.ts +0 -390
  251. package/templates/apps/web/app/api/auth/hub/continuation.ts +0 -127
  252. package/templates/apps/web/app/api/auth/hub/continue/[ref]/__tests__/route.test.ts +0 -188
  253. package/templates/apps/web/app/api/auth/hub/continue/[ref]/route.ts +0 -53
  254. package/templates/apps/web/app/api/auth/hub/email/route.ts +0 -111
  255. package/templates/apps/web/app/api/auth/hub/entry-shared.ts +0 -163
  256. package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +0 -86
  257. package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +0 -368
  258. package/templates/apps/web/app/api/auth/hub/password/return.ts +0 -86
  259. package/templates/apps/web/app/api/auth/hub/password/route.ts +0 -171
  260. package/templates/apps/web/app/api/auth/hub/purchase/route.ts +0 -230
  261. package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +0 -174
  262. package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +0 -60
  263. package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +0 -97
  264. package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +0 -92
  265. package/templates/apps/web/app/api/auth/mcp/continuation.ts +0 -89
  266. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +0 -59
  267. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +0 -41
  268. package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +0 -1166
  269. package/templates/apps/web/app/api/hub-session/callback/route.ts +0 -134
  270. package/templates/apps/web/app/api/hub-session/email/route.ts +0 -125
  271. package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +0 -49
  272. package/templates/apps/web/app/api/hub-session/one-tap/route.ts +0 -106
  273. package/templates/apps/web/app/api/hub-session/open/route.ts +0 -111
  274. package/templates/apps/web/app/api/hub-session/password/return/route.ts +0 -69
  275. package/templates/apps/web/app/api/hub-session/password/route.ts +0 -106
  276. package/templates/apps/web/app/api/hub-session/sign-in/route.ts +0 -91
  277. package/templates/apps/web/app/api/hub-session/sign-out/route.ts +0 -54
  278. package/templates/apps/web/components/sign-out-trigger.tsx +0 -62
  279. package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
  280. package/templates/apps/web/lib/__tests__/hub-children.fixtures.ts +0 -279
  281. package/templates/apps/web/lib/__tests__/route-family.test.ts +0 -57
  282. package/templates/apps/web/lib/__tests__/service-listing.test.ts +0 -111
  283. package/templates/apps/web/lib/__tests__/template-listing.test.ts +0 -158
  284. package/templates/apps/web/lib/auth-routes.ts +0 -125
  285. package/templates/apps/web/lib/hub-children.tsx +0 -351
  286. package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +0 -433
  287. package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +0 -332
  288. package/templates/apps/web/lib/hub-session/config.ts +0 -110
  289. package/templates/apps/web/lib/hub-session/entry.ts +0 -238
  290. package/templates/apps/web/lib/hub-session/index.ts +0 -21
  291. package/templates/apps/web/lib/hub-session/one-tap.tsx +0 -148
  292. package/templates/apps/web/lib/hub-session/reseal.ts +0 -90
  293. package/templates/apps/web/lib/hub-session/seal.ts +0 -86
  294. package/templates/apps/web/lib/hub-session/session.ts +0 -298
  295. package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +0 -277
  296. package/templates/apps/web/lib/meet-placeholder.ts +0 -5
  297. package/templates/apps/web/lib/next-path.ts +0 -35
  298. package/templates/apps/web/lib/posting-title.ts +0 -39
  299. package/templates/apps/web/lib/route-family.ts +0 -69
  300. package/templates/apps/web/lib/service-listing.ts +0 -89
  301. package/templates/apps/web/lib/template-listing.ts +0 -169
  302. package/templates/apps/web/src/lib/__tests__/lead-write.test.ts +0 -187
  303. package/templates/apps/web/src/lib/lead-write.ts +0 -90
  304. /package/templates/apps/web/{app/[locale]/contact → lib}/__tests__/site-contact-lines.test.ts +0 -0
package/dist/topology.js CHANGED
@@ -484,6 +484,23 @@ export async function loadSpokeBilling(): Promise<SpokeBilling | null> {
484
484
  return { read: readSpokeBilling, portalUrl: spokeBillingPortalUrl };
485
485
  }`;
486
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
+ }
487
504
  /**
488
505
  * `apps/web/lib/topology.generated.ts` for `topology` (D5) and, on a spoke,
489
506
  * its sign-in mode (#7894 D8). The hub render loads `auth.ts` only when a
@@ -500,6 +517,7 @@ export function renderWebSeam(topology, signIn = "off", opts = {}) {
500
517
  }
501
518
  if (topology === "hub") {
502
519
  return `${WEB_SEAM_HEADER}
520
+ import type { AuthInstance } from "${AUTH_PACKAGE}/site";
503
521
 
504
522
  export const TOPOLOGY: "hub" | "spoke" = "hub";
505
523
  ${unservedToolsExport("hub")}
@@ -512,6 +530,8 @@ export async function readSession(headers: Headers): Promise<SiteSession> {
512
530
  return auth.api.getSession({ headers });
513
531
  }
514
532
 
533
+ ${authLoader("hub")}
534
+
515
535
  ${ownAccountsReader("hub")}
516
536
 
517
537
  ${phoneStep("hub")}
@@ -526,7 +546,8 @@ ${spokeBillingLoader(false)}
526
546
  }
527
547
  if (signIn === "hub") {
528
548
  return `${WEB_SEAM_HEADER}
529
- import { readHubSession } from "./hub-session/session";
549
+ import type { AuthInstance } from "${AUTH_PACKAGE}/site";
550
+ import { readHubSession } from "${AUTH_PACKAGE}/hub-session";
530
551
 
531
552
  export const TOPOLOGY: "hub" | "spoke" = "spoke";
532
553
  ${unservedToolsExport("spoke")}
@@ -538,6 +559,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
538
559
  return readHubSession(headers);
539
560
  }
540
561
 
562
+ ${authLoader("spoke")}
563
+
541
564
  ${ownAccountsReader("spoke")}
542
565
 
543
566
  ${phoneStep("spoke")}
@@ -550,6 +573,7 @@ ${spokeBillingLoader(spokeBilling)}
550
573
  `;
551
574
  }
552
575
  return `${WEB_SEAM_HEADER}
576
+ import type { AuthInstance } from "${AUTH_PACKAGE}/site";
553
577
 
554
578
  export const TOPOLOGY: "hub" | "spoke" = "spoke";
555
579
  ${unservedToolsExport("spoke")}
@@ -562,6 +586,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
562
586
  return Promise.resolve(null);
563
587
  }
564
588
 
589
+ ${authLoader("spoke")}
590
+
565
591
  ${ownAccountsReader("spoke")}
566
592
 
567
593
  ${phoneStep("spoke")}
@@ -585,6 +611,8 @@ const AUTHED_GATE_SEAM_HEADER = `// signed-out-gate.generated.tsx — what the (
585
611
  * the reason `CONTENT_ADAPTERS_PACKAGE` below is.
586
612
  */
587
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";
588
616
  const WEB_I18N_PACKAGE = "@working-theory/web-i18n";
589
617
  const NEXT_INTL_SERVER = "next-intl/server";
590
618
  const NEXT_NAVIGATION = "next/navigation";
@@ -604,6 +632,7 @@ const AUTHED_GATE_PROPS = `export interface SignedOutGateProps {
604
632
  export function renderAuthedGateSeam(topology, signIn = "off") {
605
633
  if (topology === "hub") {
606
634
  return `${AUTHED_GATE_SEAM_HEADER}
635
+ import { isAccountPath } from "${AUTH_PACKAGE}/edge";
607
636
  import { localeHref } from "${UI_PACKAGE}";
608
637
  import { Button, Heading, Link, Text } from "${UI_PACKAGE}/primitives";
609
638
  import { readLocales } from "${WEB_I18N_PACKAGE}";
@@ -612,7 +641,6 @@ import { getTranslations } from "${NEXT_INTL_SERVER}";
612
641
  import type { ReactElement } from "${REACT_PACKAGE}";
613
642
 
614
643
  import { getActiveProviderIds } from "../../../lib/auth-env";
615
- import { isAccountPath } from "../../../lib/auth-routes";
616
644
 
617
645
  /** The methods a member signs in with on /sign-in's card. */
618
646
  const MEMBER_METHODS: readonly string[] = ["google", "github", "magic-link"];
@@ -678,7 +706,7 @@ export async function SignedOutGate({
678
706
  return `${AUTHED_GATE_SEAM_HEADER}
679
707
  import type { ReactElement } from "${REACT_PACKAGE}";
680
708
 
681
- import { SpokeSignIn } from "../../../lib/hub-session";
709
+ import { SpokeSignIn } from "${AUTH_PACKAGE}/hub-session";
682
710
 
683
711
  ${AUTHED_GATE_PROPS}
684
712
 
@@ -939,10 +967,231 @@ export function applySpokeTransforms(targetDir, opts) {
939
967
  writeFileSync(join(targetDir, AUTHED_GATE_SEAM_PATH), renderAuthedGateSeam("spoke", "hub"));
940
968
  }
941
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"));
942
972
  if (opts.mcp) {
943
973
  writeFileSync(join(targetDir, MCP_SEAM_PATH), renderMcpSeam("spoke"));
944
974
  }
945
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
+ ];
946
1195
  /** The env var a spoke reaches its hub through. */
947
1196
  export const HUB_ORIGIN_ENV_VAR = "AILK_API_URL";
948
1197
  /** Env files `next start` loads for an app, highest precedence first. */
@@ -1052,6 +1301,7 @@ export function renderSpokeHardFloors(opts) {
1052
1301
  ' - "apps/web/app/[locale]/(authed)/**"',
1053
1302
  ' - "apps/web/lib/hub-session/**"',
1054
1303
  ' - "apps/web/app/api/hub-session/**"',
1304
+ ' - "apps/web/auth.config.tsx"',
1055
1305
  opts.signIn === "hub"
1056
1306
  ? " reason: sign-in paths — this spoke signs in through its hub; every change requires human review"
1057
1307
  : " reason: sign-in paths — absent on a spoke; their return requires human review",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ailk",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "description": "Scaffolder for AI Launch Kit — `pnpm create ailk@latest <dir>` produces a starter repo consuming @working-theory/* from npm (per ADR 0007).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "tar": "^7.5.21"
29
29
  },
30
30
  "devDependencies": {
31
- "@working-theory/schema": "0.62.0",
32
- "@working-theory/templates": "0.62.0"
31
+ "@working-theory/schema": "0.64.0",
32
+ "@working-theory/templates": "0.64.0"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",
@@ -66,8 +66,32 @@ Don't ship a page after one render. The expected per-page loop:
66
66
  - Fix mismatches. Be specific in self-review: "heading is 32px, reference shows 24px", not "looks off."
67
67
  - Repeat until no visible differences and no responsive issues at any of the four breakpoints.
68
68
 
69
+ ## Where the base pages live
70
+
71
+ **The base website's pages ship in `@working-theory/site-pages` (#11259, ADR 0040 phase 4).** The home page and the 62 pages under the 38 base directories (`[slug]`, `about`, … `working-agreement`, `(authed)/leads`) — with the actions, loaders and libs only they read (`hub-children`, `route-family`, `service-listing`, `template-listing`, `meet-placeholder`, `posting-title`, `lead-write`) and their tests — live in `packages/site-pages/src/{pages,lib}/`, at the paths they had here. This app's `app/[locale]/` holds only the 63 route files `create-ailk routes --write` generates from the package's `routes.json` — never hand-edited, pinned by `routes --check` — plus the module pages still under those directories (`careers/apply`, `careers/[slug]/apply`, `projects/apply`) and `contact/error.tsx`. The package reads the site through one typed file, `site-pages.config.tsx`, whose `site` export answers the `@working-theory/site-pages/site` seam (`next.config.mjs` and `jest.config.cjs` alias it); no page takes a customization option. The ten namespaces those pages read ship in the package (`sitePagesMessages`), merged under this app's catalog by `i18n/request.ts`; a key in `messages/en.json` is an override. `lib/site-contact-email.ts` and `lib/site-contact-lines.ts` (the `_site.mdx` readers the layout and the module pages share) stay the site's. The sections below name the pages by their old `app/[locale]/` place.
72
+
69
73
  ## The `(auth)` route group — which predicate an affordance keys on
70
74
 
75
+ **Where it lives (#11257, ADR 0040 phase 2).** The `(auth)` pages and their
76
+ actions, the spoke's hub-session client, the hub's `/api/auth` routes and the
77
+ spoke's `/api/hub-session` routes ship in `@working-theory/auth`
78
+ (`packages/auth/src/{pages,hub-session,api}/`), with their tests. This app's
79
+ `app/[locale]/(auth)/`, `app/api/auth/` and `app/api/hub-session/` hold only
80
+ the 25 route files `create-ailk routes --write` generates from the package's
81
+ `routes.json` — never hand-edited, pinned by `routes --check`. The package
82
+ reads the site through one typed file, `auth.config.tsx`: `defineAuthConfig({})`
83
+ (no extension point yet) and its `site` export, which answers the
84
+ `@working-theory/auth/site` seam (`next.config.mjs` and `jest.config.cjs`
85
+ alias it to that file). Better Auth reaches the package only through the
86
+ topology seam's `loadAuth()` — `auth.config.tsx` never imports `auth.ts` —
87
+ and an `/api/auth` route whose load is `null` answers 404 with no body.
88
+ `middleware.ts` keeps its header maps and calls `@working-theory/auth/edge`
89
+ for the auth half and the path predicates; that entry imports nothing. The
90
+ `auth`, `signIn`, `mcpConsent` and `spokeSignIn` strings ship in the package
91
+ (`authMessages`, merged by `i18n/request.ts`); a key in `messages/en.json` is
92
+ an override. The paths below name the package's files by their old
93
+ `lib/`/`app/` place; `lib/auth-env.ts` itself stays the site's.
94
+
71
95
  `lib/auth-env.ts` exports two reset predicates, and they are not
72
96
  interchangeable. Picking the wrong one is how this surface has broken twice
73
97
  (#6018, then #6061 — the follow-up #6068 documents the rule here so there is
@@ -171,7 +195,7 @@ both telemetry scrub lists.
171
195
 
172
196
  **A spoke's sign-in entry is the spoke's own form (#11096).** On a spoke
173
197
  that signs in through its hub, the gate seam renders
174
- `lib/hub-session/spoke-sign-in.tsx` (`SpokeSignIn`) for every signed-out
198
+ `@working-theory/auth/hub-session`'s `SpokeSignIn` for every signed-out
175
199
  `(authed)` path: one email field, the hub's sign-up agreements under "New
176
200
  here?" (read from the hub web's `GET /api/auth/hub/sign-up`, shared 60 s, each
177
201
  policy link the hub's) and Continue with Google — a native form, no password
@@ -219,7 +243,7 @@ server to server as the spoke's client: the hub API's
219
243
  a live grant of THIS client, and the hub web mints Better Auth's own
220
244
  `reset-password:<token>` row and mails the link through the signed relay, its
221
245
  `callbackURL` the hub's `/reset-password` carrying a sealed `?ref=` of the
222
- client's REGISTERED origin plus the Security path (`app/api/auth/hub/password/return.ts`).
246
+ client's REGISTERED origin plus the Security path (the package's `api/auth/hub/password/return.ts`).
223
247
  `resetSendConfigured()` is checked before that API call, which charges the
224
248
  send budgets. A completed reset ends every spoke credential
225
249
  (`onPasswordReset`), so the hub's page returns the person to the spoke's
@@ -452,7 +476,7 @@ Cal.com edit and the page.
452
476
  fallback title — its sections are never rendered here.
453
477
  - **Chrome.** `lib/modules.generated.ts`'s `SCHEDULING_PAGES` (written by
454
478
  create-ailk from `apps/web/package.json`, never copied by `update`) and
455
- `lib/auth-routes.ts`'s `isBookingPath` make the locale layout drop the
479
+ `@working-theory/auth/edge`'s `isBookingPath` make the locale layout drop the
456
480
  marketing shell on `/meet`, `/meet/<slug>` and `/private`; `/meet/confirmed`
457
481
  and a site without the module keep it. The consent banner stays.
458
482
  - **The CSP (D12).** `security-headers.config.ts` exports `SCHEDULING_CSP`
@@ -747,7 +771,11 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
747
771
  - Don't reach into `apps/api` or `apps/mcp` from `apps/web`. They're peer apps — talk via HTTP/MCP.
748
772
  - Don't commit images to `screenshots/` — only the `.gitkeep` is tracked.
749
773
 
750
- Last updated: 2026-11-10 — § Where the docs live: the docs and blog pages and their loaders ship in `@working-theory/ui-docs-blog`, this app holds their two generated route files and `docs-blog.config.tsx`, and the `docs` and `blog` strings ship in the package (#11254) — verified against `packages-paid/ui-docs-blog/{routes.json,src/config.ts,src/pages/}`, `docs-blog.config.tsx`, `lib/source.ts` and `i18n/request.ts`.
774
+ Last updated: 2026-11-11 — § Where the base pages live: the 63 base pages, their actions, loaders and libs ship in `@working-theory/site-pages`, this app holds their generated route files and `site-pages.config.tsx`, and the ten namespaces ship in the package (#11259) — verified against `packages/site-pages/{routes.json,src/site.ts,src/index.ts}`, `site-pages.config.tsx` and `i18n/request.ts`.
775
+
776
+ Prior: 2026-11-10 — § The `(auth)` route group: sign-in, the hub session and the auth routes ship in `@working-theory/auth`, this app holds their 25 generated route files and `auth.config.tsx`, Better Auth reaches the package through `loadAuth()`, and the middleware's auth half is the package's edge entry (#11257) — verified against `packages/auth/{routes.json,src/site.ts,src/edge.ts}`, `auth.config.tsx`, `middleware.ts`, `lib/topology.generated.ts` and `i18n/request.ts`.
777
+
778
+ Prior: 2026-11-10 — § Where the docs live: the docs and blog pages and their loaders ship in `@working-theory/ui-docs-blog`, this app holds their two generated route files and `docs-blog.config.tsx`, and the `docs` and `blog` strings ship in the package (#11254) — verified against `packages-paid/ui-docs-blog/{routes.json,src/config.ts,src/pages/}`, `docs-blog.config.tsx`, `lib/source.ts` and `i18n/request.ts`.
751
779
 
752
780
  Prior: 2026-11-10 — § Spoke checkout: the checkout and purchase return pages ship in `@working-theory/ui-commerce`, this app holds their generated route files and `commerce.config.tsx`, the strings ship in the package, the stamp is bundle-delivered and stamped in place on a spoke, and the purchase pair is module-carried (#11253) — verified against `packages-paid/ui-commerce/{routes.json,src/config.ts,src/pages/}`, `commerce.config.tsx`, `i18n/request.ts` and create-ailk's `spoke-checkout.ts`.
753
781
 
@@ -15,9 +15,14 @@
15
15
  // `next-intl/server`, in any copy, lands here. Per-test `jest.mock(
16
16
  // "next-intl/server", …)` overrides still work — jest resolves the specifier
17
17
  // through the mapper first, so the override and the consumer agree.
18
+ import authMsgs from "@working-theory/auth/messages/en";
19
+ import sitePagesMsgs from "@working-theory/site-pages/messages/en";
20
+
18
21
  import msgs from "../../messages/en.json";
19
22
 
20
- const catalog = msgs as unknown as Record<string, Record<string, string>>;
23
+ // The sign-in package's catalog is merged under this site's, as
24
+ // `i18n/request.ts` merges it (#11257 D12), and the base pages' (#11259 D7).
25
+ const catalog = { ...sitePagesMsgs, ...authMsgs, ...msgs } as unknown as Record<string, Record<string, string>>;
21
26
 
22
27
  // Handles both call forms used in apps/web routes:
23
28
  // getTranslations("namespace") — pre-migration routes
@@ -1,9 +1,14 @@
1
1
  // Canonical `next-intl` stand-in for this workspace's Jest runs.
2
2
  // Mapped rather than only `jest.mock()`d for the same reason as
3
3
  // ./next-intl-server.ts — see that file's header.
4
+ import authMsgs from "@working-theory/auth/messages/en";
5
+ import sitePagesMsgs from "@working-theory/site-pages/messages/en";
6
+
4
7
  import msgs from "../../messages/en.json";
5
8
 
6
- const catalog = msgs as unknown as Record<string, Record<string, string>>;
9
+ // The sign-in package's catalog is merged under this site's, as
10
+ // `i18n/request.ts` merges it (#11257 D12), and the base pages' (#11259 D7).
11
+ const catalog = { ...sitePagesMsgs, ...authMsgs, ...msgs } as unknown as Record<string, Record<string, string>>;
7
12
 
8
13
  export const useTranslations =
9
14
  (namespace: string) =>
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @jest-environment node
3
+ *
4
+ * The sign-in package's seam resolves to this site's `auth.config.tsx`, not
5
+ * to the package's stub (#11257 D4, SEC-11257-1, AC-5). A build or a suite
6
+ * that lost the alias would bind the stub, whose every read throws; this
7
+ * suite is the check that runs before any request, as
8
+ * `create-ailk routes --check` is for `next.config.mjs`. A template file:
9
+ * every site carries it, hub or spoke.
10
+ */
11
+ import { isSeamStub } from "@working-theory/auth";
12
+ import { site } from "@working-theory/auth/site";
13
+
14
+ import authConfig from "../../auth.config";
15
+
16
+ describe("@working-theory/auth/site is this site's auth.config.tsx (#11257 AC-5)", () => {
17
+ it("is not the package's stub", () => {
18
+ expect(isSeamStub(site)).toBe(false);
19
+ });
20
+
21
+ it("carries the site's Better Auth loader and its sign-in configuration", () => {
22
+ expect(typeof site.loadAuth).toBe("function");
23
+ expect(typeof site.env.resetSendConfigured).toBe("function");
24
+ });
25
+
26
+ it("binds the hub-only services exactly on a hub", () => {
27
+ expect(["hub", "spoke"]).toContain(site.topology);
28
+ expect(site.hub === null).toBe(site.topology === "spoke");
29
+ });
30
+
31
+ it("the default export is defineAuthConfig({})", () => {
32
+ expect(authConfig).toEqual({});
33
+ });
34
+ });
@@ -27,13 +27,12 @@
27
27
  */
28
28
  import { type AccountSite, defineAccountConfig } from "@working-theory/account";
29
29
  import { baseForYouSources, baseInboxKinds, baseNewActions } from "@working-theory/account/contributions";
30
+ import { hubSessionHubOrigin, resealHubSession } from "@working-theory/auth/hub-session";
30
31
  import { cookies } from "next/headers";
31
32
 
32
33
  import { getActiveProviderIds, resetSendConfigured } from "./lib/auth-env";
33
34
  import { consentPoliciesFor } from "./lib/consent-policies";
34
35
  import { consentVisitorHeader, readConsentVisitor } from "./lib/consent-visitor";
35
- import { hubSessionConfig } from "./lib/hub-session/config";
36
- import { resealHubSession } from "./lib/hub-session/reseal";
37
36
  import { formatMinorUnits, offeringsCheckoutHref } from "./lib/offerings-pricing";
38
37
  import { readShownOfferings } from "./lib/pricing-page";
39
38
  import { forwardedCookieInit } from "./lib/server-api";
@@ -88,7 +87,7 @@ export const site = {
88
87
  forwardedCookieInit,
89
88
  resealHubSession,
90
89
  activeProviderIds: getActiveProviderIds,
91
- hubOrigin: () => hubSessionConfig()?.hubOrigin ?? null,
90
+ hubOrigin: () => hubSessionHubOrigin(),
92
91
  resetSendConfigured,
93
92
  consentPoliciesFor,
94
93
  async consentVisitorHeaders() {
@@ -82,7 +82,7 @@ jest.mock("../../../../../../lib/topology.generated", () => {
82
82
  };
83
83
  });
84
84
 
85
- import { mintContinuation } from "../../../../../api/auth/hub/continuation";
85
+ import { mintContinuation } from "@working-theory/auth/testing";
86
86
  import Page, { generateMetadata } from "../page";
87
87
 
88
88
  const SPOKE_ORIGIN = "https://spoke.example.com";
@@ -21,6 +21,7 @@
21
21
 
22
22
  import { accountSession } from "@working-theory/account/account-data";
23
23
  import { hubSignIn } from "@working-theory/api-client";
24
+ import { openContinuation } from "@working-theory/auth/hub-continuation";
24
25
  import { localeHref } from "@working-theory/ui";
25
26
  import { Button, Heading, Input, Link, Text } from "@working-theory/ui/primitives";
26
27
  import { hubAuthorizeQuerySchema, type HubAuthorizeQuery } from "@working-theory/validation";
@@ -31,7 +32,6 @@ import type { ReactElement } from "react";
31
32
 
32
33
  import { resolveSecret } from "../../../../../auth";
33
34
  import { TOPOLOGY } from "../../../../../lib/topology.generated";
34
- import { openContinuation } from "../../../../api/auth/hub/continuation";
35
35
 
36
36
  /** The authorize route's POST — the one request that says yes. */
37
37
  const AUTHORIZE_PATH = "/api/auth/hub/authorize";
@@ -5,6 +5,7 @@
5
5
  // /sign-in (an account path with no sign-in method on says so in place); a
6
6
  // spoke that signs in through its hub (`--hub-sign-in`) redirects to its
7
7
  // hub-session sign-in route.
8
+ import { isAccountPath } from "@working-theory/auth/edge";
8
9
  import { localeHref } from "@working-theory/ui";
9
10
  import { Button, Heading, Link, Text } from "@working-theory/ui/primitives";
10
11
  import { readLocales } from "@working-theory/web-i18n";
@@ -13,7 +14,6 @@ import { getTranslations } from "next-intl/server";
13
14
  import type { ReactElement } from "react";
14
15
 
15
16
  import { getActiveProviderIds } from "../../../lib/auth-env";
16
- import { isAccountPath } from "../../../lib/auth-routes";
17
17
 
18
18
  /** The methods a member signs in with on /sign-in's card. */
19
19
  const MEMBER_METHODS: readonly string[] = ["google", "github", "magic-link"];
@@ -29,6 +29,7 @@ import { readFileSync } from "node:fs";
29
29
  import { join } from "node:path";
30
30
 
31
31
  import { Telemetry, VerificationMeta } from "@working-theory/analytics";
32
+ import { isAccountPath, isAuthPath, isBookingPath } from "@working-theory/auth/edge";
32
33
  import { slugFormTarget } from "@working-theory/page-renderer";
33
34
  import {
34
35
  SiteConsentSchema,
@@ -66,7 +67,6 @@ import type { ReactElement, ReactNode } from "react";
66
67
  import { parse as parseYaml } from "yaml";
67
68
 
68
69
  import { GoogleAnalytics } from "../../components/google-analytics";
69
- import { isAccountPath, isAuthPath, isBookingPath } from "../../lib/auth-routes";
70
70
  import { BOT_CLIENT_PROTECT, botCheckOn } from "../../lib/bot-check";
71
71
  import { isClosingFooterPath } from "../../lib/closing-footer-path";
72
72
  import { pageOptsIntoDeck } from "../../lib/deck-page";
@@ -141,7 +141,7 @@ import {
141
141
  import { pagePathFor, resolveBaseUrl } from "../../src/lib/routes";
142
142
 
143
143
  import { ConsentBanner } from "./consent-banner";
144
- import { readSiteContactLines } from "./contact/site-contact-lines";
144
+ import { readSiteContactLines } from "../../lib/site-contact-lines";
145
145
 
146
146
  /**
147
147
  * The generated `siteChrome`, read through a widened type (#7740 D8): a