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
@@ -72,35 +72,6 @@
72
72
  "heading": "My Site",
73
73
  "emptyState": "Home page content coming soon."
74
74
  },
75
- "about": {
76
- "heading": "About",
77
- "emptyState": "About page content coming soon.",
78
- "viewProfile": "View profile"
79
- },
80
- "careers": {
81
- "heading": "Careers",
82
- "emptyState": "Career listings coming soon.",
83
- "applicationSuccess": "Thank you for applying! We have your application and will be in touch.",
84
- "apply": "Apply for this role",
85
- "openPositions": "Open positions",
86
- "viewRole": "View role",
87
- "employmentTypeFullTime": "Full-time",
88
- "employmentTypePartTime": "Part-time",
89
- "employmentTypeContractor": "Contract",
90
- "employmentTypeTemporary": "Temporary",
91
- "employmentTypeIntern": "Internship",
92
- "employmentTypeVolunteer": "Volunteer",
93
- "employmentTypePerDiem": "Per diem",
94
- "employmentTypeOther": "Other",
95
- "filterSearch": "Search roles",
96
- "filterType": "Type",
97
- "filterAllTypes": "All types",
98
- "filterLocation": "Location",
99
- "filterAllLocations": "All locations",
100
- "filterEmpty": "No open positions match your search.",
101
- "filterCountOne": "1 open position",
102
- "filterCountOther": "{count} open positions"
103
- },
104
75
  "case-studies": {
105
76
  "heading": "Case Studies",
106
77
  "emptyState": "Case studies listing coming soon."
@@ -121,43 +92,6 @@
121
92
  "heading": "Clients",
122
93
  "emptyState": "Clients listing coming soon."
123
94
  },
124
- "contact": {
125
- "heading": "Contact",
126
- "emptyState": "Contact page content coming soon.",
127
- "nameLabel": "Name",
128
- "emailLabel": "Email",
129
- "messageLabel": "Message",
130
- "sending": "Sending\u2026",
131
- "sendMessage": "Send message",
132
- "successMessage": "Thank you for reaching out! We will be in touch shortly.",
133
- "trackInAccount": "Track this in your account",
134
- "consentStatement": "I accept the [Terms](terms) and [Privacy Policy](privacy).",
135
- "preferEmail": "Prefer email?",
136
- "consentRequired": "Please accept the terms to send your message.",
137
- "genericError": "Something went wrong, please try again.",
138
- "unavailableHeading": "Get in touch",
139
- "unavailableBody": "Email us at {email} and we'll reply.",
140
- "unavailableNoEmail": "Contact details for this site haven't been published yet.",
141
- "intake": {
142
- "guidedBadge": "Guided",
143
- "skip": "Skip",
144
- "send": "Send",
145
- "freeTextPlaceholder": "Type your answer…",
146
- "nameAck": "Thanks for stopping by!",
147
- "namePrompt": "What's your name?",
148
- "messageAck": "Good to meet you.",
149
- "messagePrompt": "What are you hoping to get done?",
150
- "emailAck": "Got it.",
151
- "emailPrompt": "What's the best email to reach you at?",
152
- "consentAck": "Thanks — one last thing.",
153
- "consentPrompt": "Do you accept our Terms and Privacy Policy? They're linked at the foot of every page.",
154
- "consentAccept": "Yes, I accept",
155
- "consentDecline": "Not yet",
156
- "skipMessage": "No worries — here's our form instead.",
157
- "completionMessage": "Thanks! We'll be in touch shortly.",
158
- "submitError": "We couldn't send that automatically — please review and send below."
159
- }
160
- },
161
95
  "downloads": {
162
96
  "heading": "Downloads",
163
97
  "emptyState": "Downloads listing coming soon."
@@ -190,23 +124,6 @@
190
124
  "heading": "Launch Service",
191
125
  "emptyState": "Launch Service page content coming soon."
192
126
  },
193
- "leadsInbox": {
194
- "title": "Leads",
195
- "description": "Every lead your site has captured, newest first.",
196
- "forbiddenHeadline": "You don't have access",
197
- "forbiddenDescription": "Sign in with the account that owns this site to see the leads it captured.",
198
- "table": {
199
- "caption": "Leads captured by your site",
200
- "columnName": "Name",
201
- "columnEmail": "Email",
202
- "columnSource": "Source",
203
- "columnCreated": "Captured",
204
- "unavailable": "—",
205
- "next": "Next page",
206
- "emptyHeadline": "No leads yet",
207
- "emptyDescription": "Leads captured by your site's forms will appear here."
208
- }
209
- },
210
127
  "partners": {
211
128
  "heading": "Partners",
212
129
  "emptyState": "Partners listing coming soon."
@@ -226,10 +143,6 @@
226
143
  "withRequired": "{plan} + {required}",
227
144
  "depositNote": "{deposit} deposit due today; the balance is invoiced."
228
145
  },
229
- "pricingPages": {
230
- "heading": "Pricing by offering",
231
- "viewPricing": "See pricing"
232
- },
233
146
  "purchasePolicy": {
234
147
  "heading": "Purchase Policy",
235
148
  "emptyState": "Purchase policy content coming soon."
@@ -263,17 +176,6 @@
263
176
  "schedule": {
264
177
  "bookLength": "Book {minutes} min"
265
178
  },
266
- "services": {
267
- "heading": "Services",
268
- "emptyState": "Services listing coming soon.",
269
- "childrenHeading": "Services in this area",
270
- "viewService": "View service"
271
- },
272
- "software": {
273
- "heading": "Software",
274
- "description": "The @working-theory/* packages — typed tools for building AX-first products.",
275
- "emptyState": "Software listings coming soon."
276
- },
277
179
  "tech-articles": {
278
180
  "heading": "Technical Articles",
279
181
  "description": "Deep dives into the architecture and internals of this site.",
@@ -299,17 +201,6 @@
299
201
  "heading": "Alternatives",
300
202
  "emptyState": "Comparisons coming soon."
301
203
  },
302
- "templates": {
303
- "heading": "Templates",
304
- "emptyState": "Templates coming soon.",
305
- "getIt": "Get it",
306
- "startFree": "Start free",
307
- "viewDemo": "View demo",
308
- "viewTemplate": "View template",
309
- "included": "What's included",
310
- "demoBadge": "Live demo",
311
- "moreCategories": "+{count} more"
312
- },
313
204
  "reports": {
314
205
  "heading": "Reports",
315
206
  "emptyState": "Reports coming soon.",
@@ -431,118 +322,6 @@
431
322
  "genericTitle": "Waitlist signup"
432
323
  }
433
324
  },
434
- "whitepapers": {
435
- "heading": "Whitepapers",
436
- "description": "In-depth research and strategy papers from this site's team.",
437
- "emptyState": "Whitepapers coming soon."
438
- },
439
- "signIn": {
440
- "title": "Sign in",
441
- "description": "Sign in to your account.",
442
- "heading": "Sign in to {site}",
443
- "notConfiguredSubhead": "Sign-in is not configured for this site yet. Set a provider's environment variables to enable it.",
444
- "ssoPrefix": "Sign in with",
445
- "google": "Google",
446
- "github": "GitHub",
447
- "email": "Email",
448
- "password": "Password",
449
- "forgot": "Forgot password?",
450
- "submit": "Sign in",
451
- "orContinue": "Or continue with",
452
- "signInFailed": "We couldn't sign you in. Check your details and try again.",
453
- "providerFailed": "We couldn't start sign-in with that provider. Try again.",
454
- "emailLinkSubmit": "Send me a magic link",
455
- "emailLinkDivider": "or",
456
- "emailLinkSentHeading": "Check your email",
457
- "emailLinkSentSubhead": "Look for a message from this site.",
458
- "emailLinkBack": "Back to sign in",
459
- "continueWith": "Continue with",
460
- "useAnotherWay": "Use another way",
461
- "emailLinkSentBody": "If an account uses that address, a sign-in link is on its way. It works once and expires in 5 minutes.",
462
- "emailLinkFailed": "We couldn't send a sign-in link. Try again.",
463
- "emailLinkRateLimited": "Too many requests. Wait a minute, then try again.",
464
- "emailLinkExpired": "That sign-in link has expired or was already used. Request a new one.",
465
- "useEmailLink": "Email me a sign-in link instead",
466
- "emailPlaceholder": "you@example.com",
467
- "backTo": "Back to {site}",
468
- "acknowledgement": "You acknowledge that you read, and agree to our",
469
- "termsLink": "Terms of Service",
470
- "privacyLink": "Privacy Policy",
471
- "acknowledgementAnd": "and our",
472
- "acknowledgementEnd": ".",
473
- "prospectPrompt": "Don't have an account?",
474
- "prospectLink": "Sign up"
475
- },
476
- "auth": {
477
- "signUpTitle": "Create an account",
478
- "signUpDescription": "Create an account on this site.",
479
- "forgotTitle": "Reset your password",
480
- "forgotDescription": "Request a password reset link.",
481
- "resetTitle": "Choose a new password",
482
- "resetDescription": "Set a new password for your account.",
483
- "verifyEmailTitle": "Check your email",
484
- "verifyEmailDescription": "Follow the link we sent to continue.",
485
- "email": "Email",
486
- "password": "Password",
487
- "confirmPassword": "Confirm password",
488
- "newPassword": "New password",
489
- "orContinue": "or",
490
- "ssoPrefix": "Continue with",
491
- "google": "Google",
492
- "github": "GitHub",
493
- "backToSignIn": "Back to sign in",
494
- "signUpHeading": "Sign up",
495
- "signUpSubmit": "Create account",
496
- "signUpFooterPrompt": "Already have an account?",
497
- "signUpFooterLink": "Sign in",
498
- "signUpAgreementsLegend": "Agreements",
499
- "signUpAgreementsRequired": "Accept the agreements to create an account.",
500
- "signUpNotConfiguredSubhead": "Sign-up is not configured for this site yet. Set a provider's environment variables to enable it.",
501
- "signUpFailed": "We couldn't create your account. Check your details and try again.",
502
- "magicLinkSubmit": "Send me a magic link",
503
- "signUpLinkSentBody": "A link to finish signing up is on its way. It works once and expires in 5 minutes.",
504
- "signUpLinkBack": "Back to sign up",
505
- "signUpLinkFailed": "We couldn't send a sign-up link. Try again.",
506
- "signUpLinkRateLimited": "Too many requests. Wait a minute, then try again.",
507
- "signUpLinkExpired": "That sign-up link has expired or was already used. Request a new one.",
508
- "providerFailed": "We couldn't start sign-up with that provider. Try again.",
509
- "invitationBody": "This site does not offer public sign-up. If you were invited, open the link in your invitation email to create your account.",
510
- "forgotHeading": "Reset your password",
511
- "forgotSubhead": "Enter your email and we will send a reset link.",
512
- "forgotSubmit": "Send reset link",
513
- "resetHeading": "Choose a new password",
514
- "resetSubhead": "Choose a new password for your account.",
515
- "resetSubmit": "Set new password",
516
- "forgotUnavailableHeading": "Password reset isn't available",
517
- "forgotUnavailableSubhead": "This site does not offer password reset.",
518
- "forgotUnavailableBody": "Sign in with one of the providers on the sign-in page, or ask the site owner for help getting back in.",
519
- "resetUnavailableHeading": "Password reset isn't available",
520
- "resetUnavailableSubhead": "This reset link cannot be used on this site.",
521
- "resetUnavailableBody": "Password reset is not enabled here. Sign in with one of the providers on the sign-in page instead.",
522
- "sentToPrefix": "We sent it to",
523
- "resetRequestFailed": "We couldn't send a reset link just now. Try again in a few minutes.",
524
- "resetFailed": "We couldn't set that password. The link may have expired — request a new one.",
525
- "passwordMismatch": "Both passwords must match.",
526
- "resetExpiredHeading": "This reset link has expired",
527
- "resetExpiredSubhead": "Reset links are single-use and last one hour.",
528
- "resetExpiredBody": "Request a new link from the sign-in page and follow the most recent email.",
529
- "verifyExpiredHeading": "This confirmation link has expired",
530
- "verifyExpiredSubhead": "Confirmation links last 24 hours.",
531
- "verifyExpiredBody": "Sign in again and we'll send you a fresh confirmation email.",
532
- "confirmHeading": "Confirm your email",
533
- "confirmSubhead": "One click and your address is confirmed.",
534
- "confirmBody": "Select the button below to confirm this email address for your account.",
535
- "confirmButton": "Confirm my email",
536
- "verifiedHeading": "Your email is confirmed",
537
- "verifiedSubhead": "Thanks — your address is verified.",
538
- "verifiedBody": "You can sign in now. You can close this tab once you're done.",
539
- "sentHeading": "Check your email",
540
- "sentSubhead": "Follow the link we just sent to continue.",
541
- "sentBody": "Check your inbox and follow the link to continue. You can close this tab once you're done.",
542
- "footerPrivacy": "Privacy",
543
- "footerTerms": "Terms",
544
- "footerHelp": "Help"
545
- },
546
325
  "account": {
547
326
  "yourAccount": "Your account",
548
327
  "gate": {
@@ -550,24 +329,6 @@
550
329
  "emptyDescription": "This site hasn't turned on sign-in for members yet. Check back soon, or contact the site owner.",
551
330
  "homeLink": "Back to the site"
552
331
  },
553
- "spokeSignIn": {
554
- "heading": "Sign in to {site}",
555
- "subhead": "Enter your email and we'll send you a link to sign in.",
556
- "emailLabel": "Email",
557
- "submit": "Email me a sign-in link",
558
- "newHere": "New here? Accept to create your account with the same link.",
559
- "agreementsError": "To create an account, accept every agreement.",
560
- "google": "Continue with Google",
561
- "sent": "Check your email",
562
- "sentBody": "If that address can sign in here, a sign-in link is on its way. It works for 5 minutes.",
563
- "back": "Use another email",
564
- "unavailable": "Sign-in isn't available right now. Try again in a few minutes.",
565
- "exists": "You already have an account. Enter your email to sign in.",
566
- "claimInvalid": "That link has expired or was already used. Enter your email to sign in.",
567
- "openHeading": "Open your account",
568
- "openLead": "By opening your account you accept:",
569
- "open": "Open my account"
570
- },
571
332
  "settings": {
572
333
  "general": {
573
334
  "title": "General"
@@ -1050,11 +811,6 @@
1050
811
  "heading": "Features",
1051
812
  "emptyState": "Features coming soon."
1052
813
  },
1053
- "unsubscribe": {
1054
- "already": "You were already unsubscribed.",
1055
- "invalid": "This link isn't valid.",
1056
- "unavailable": "Unsubscribing isn't available right now."
1057
- },
1058
814
  "hubConnect": {
1059
815
  "metaTitle": "Sign in to a site",
1060
816
  "title": "Sign in to {name}?",
@@ -1066,32 +822,5 @@
1066
822
  "body": "The link may have expired. Go back to the site you came from and sign in again.",
1067
823
  "back": "Back to the site"
1068
824
  }
1069
- },
1070
- "mcpConsent": {
1071
- "metaTitle": "Connect an app",
1072
- "heading": "Connect an app to a workspace",
1073
- "signedInAs": "Signed in as {email}.",
1074
- "signOut": "Not you? Sign out",
1075
- "clientClaim": "{name} — this app registered itself; the name is its own claim and has not been checked.",
1076
- "returnsTo": "If you allow it, access is sent to {origin}.",
1077
- "workspaceLegend": "Choose the workspace this app may use",
1078
- "scopesLegend": "What it may also do there",
1079
- "memberReads": "Any approval also lets the app read what a member can read in that workspace.",
1080
- "noScopes": "Your role in this workspace offers nothing beyond member reads.",
1081
- "allow": "Allow",
1082
- "deny": "Deny",
1083
- "unavailable": "This request can't continue. Go back to the app and connect again.",
1084
- "noWorkspace": "You have no workspace to connect this app to.",
1085
- "scopes": {
1086
- "content-edit": "Edit pages and docs",
1087
- "content-publish": "Publish pages and docs, and delete glossary terms, FAQs and topics",
1088
- "assets-write": "Upload and replace files",
1089
- "magnets-manage": "Manage forms and magnets",
1090
- "meeting-types-manage": "Manage meeting types",
1091
- "people-read": "See your people",
1092
- "member-pieces-manage": "Manage what members see",
1093
- "people-memory-propose": "Suggest notes about people",
1094
- "inbox-act": "Act on the inbox"
1095
- }
1096
825
  }
1097
826
  }
@@ -46,10 +46,14 @@
46
46
  // S2 spec: docs/internal/specs/i18n-phase1-s2-next-intl-foundation-spec.md
47
47
  // P2 S1 spec: docs/internal/specs/i18n-phase2-s1-hreflang-metadata-spec.md §3
48
48
 
49
+ import {
50
+ authResponseHeaders,
51
+ isBookingPath,
52
+ setAuthRequestHeaders,
53
+ } from "@working-theory/auth/edge";
49
54
  import { NextRequest, NextResponse } from "next/server";
50
55
  import createMiddleware from "next-intl/middleware";
51
56
 
52
- import { isAccountPath, isBookingPath } from "./lib/auth-routes";
53
57
  import {
54
58
  DOCS_PATH,
55
59
  DOCS_ROUTE,
@@ -178,16 +182,6 @@ const FILE_ROUTE_SECURITY_HEADERS: Readonly<Record<string, string>> =
178
182
  ),
179
183
  );
180
184
 
181
- /**
182
- * Whether this site signs in through its hub (#11096): the hub's sign-in
183
- * origin, which only a hub-sign-in spoke sets (`lib/hub-session/config.ts`).
184
- * Read from the environment, not `lib/topology.generated`, whose spoke render
185
- * imports the Node-only session module this Edge bundle must not carry.
186
- */
187
- function signsInThroughHub(): boolean {
188
- return (process.env.AILK_HUB_SIGN_IN_URL?.trim() ?? "") !== "";
189
- }
190
-
191
185
  export function middleware(request: NextRequest): NextResponse {
192
186
  // Step 1: Forward x-pathname to server components so generateMetadata can
193
187
  // build path-aware hreflang alternates (P2 S1). Clone the request headers
@@ -195,18 +189,10 @@ export function middleware(request: NextRequest): NextResponse {
195
189
  // doesn't clobber the original user-facing path.
196
190
  const requestHeaders = new Headers(request.headers);
197
191
  requestHeaders.set("x-pathname", request.nextUrl.pathname);
198
- // #11096 D1 — the (authed) gate renders from a layout, which gets no
199
- // searchParams, so on a hub-sign-in spoke an account path's query rides
200
- // beside the path. Always this request's own value: a client-sent
201
- // `x-search` is dropped everywhere. It can hold a purchase claim, so no
202
- // other path or topology carries it, and nothing logs or reports it.
203
- requestHeaders.delete("x-search");
204
- if (
205
- signsInThroughHub() &&
206
- isAccountPath(request.nextUrl.pathname, enabledLocales)
207
- ) {
208
- requestHeaders.set("x-search", request.nextUrl.search);
209
- }
192
+ // #11096 D1 — on a hub-sign-in spoke an account path's query rides beside
193
+ // the path as `x-search`; a client-sent one is dropped everywhere
194
+ // (`@working-theory/auth/edge`, #11257 D6).
195
+ setAuthRequestHeaders(request, requestHeaders, enabledLocales);
210
196
 
211
197
  // Non-locale routes are served as requested — no rewrite, no redirect.
212
198
  if (isNonLocaleRoute(request.nextUrl.pathname)) {
@@ -278,6 +264,7 @@ export function middleware(request: NextRequest): NextResponse {
278
264
  // file routes get the six others and keep their own sandbox CSP (#9162).
279
265
  // A hub-sign-in spoke that turned Google One Tap on (`AILK_HUB_ONE_TAP=on`)
280
266
  // gets Google's origins on its other pages (#11096 D10, SEC-11096-10).
267
+ const auth = authResponseHeaders(request);
281
268
  applyHeaders(
282
269
  intlResponse.headers,
283
270
  isFileRoutePath(request.nextUrl.pathname)
@@ -285,13 +272,13 @@ export function middleware(request: NextRequest): NextResponse {
285
272
  : SCHEDULING_PAGES &&
286
273
  isBookingPath(request.nextUrl.pathname, enabledLocales)
287
274
  ? SCHEDULING_SECURITY_HEADERS
288
- : signsInThroughHub() && process.env.AILK_HUB_ONE_TAP === "on"
275
+ : auth.oneTap
289
276
  ? ONE_TAP_SECURITY_HEADERS
290
277
  : DEFAULT_SECURITY_HEADERS,
291
278
  );
292
279
  // SEC-11096-4 — a page that carries a purchase claim in its query sends no
293
280
  // referrer, so no request it makes carries the claim in `Referer`.
294
- if (request.nextUrl.searchParams.has("claim")) {
281
+ if (auth.noReferrer) {
295
282
  intlResponse.headers.set("Referrer-Policy", "no-referrer");
296
283
  }
297
284
  // #10040 decision 7 — a site with neither marketing nor docs-blog (a hub)
@@ -332,6 +332,9 @@ const nextConfig = {
332
332
  // route files under app/[locale]/(authed)/account/ re-export it.
333
333
  "@working-theory/account",
334
334
  "@working-theory/analytics",
335
+ // #11257 (ADR 0040 phase 2): the sign-in pages, the hub-session client and
336
+ // the /api/auth and /api/hub-session handlers ship as TypeScript source.
337
+ "@working-theory/auth",
335
338
  "@working-theory/api-client",
336
339
  "@working-theory/content-adapters",
337
340
  "@working-theory/jsonld",
@@ -341,6 +344,9 @@ const nextConfig = {
341
344
  "@working-theory/schema-pack-registry",
342
345
  "@working-theory/sections-registry",
343
346
  "@working-theory/site-config",
347
+ // #11259 (ADR 0040 phase 4): the base website pages ship as TypeScript
348
+ // source; the generated route files under app/[locale]/ re-export them.
349
+ "@working-theory/site-pages",
344
350
  "@working-theory/theme",
345
351
  "@working-theory/ui",
346
352
  "@working-theory/ui-commerce",
@@ -365,8 +371,17 @@ const nextConfig = {
365
371
  // import `@working-theory/ui-signal-collectors/site`, answered by
366
372
  // signal-collectors.config.tsx (`SignalCollectorsSite`). A site without the
367
373
  // module has no such file and no importer of the specifier.
374
+ // #11257 — the sign-in package's seam, the same way: its pages, actions and
375
+ // handlers import `@working-theory/auth/site`, answered by auth.config.tsx
376
+ // (`AuthSite`). `create-ailk routes --check` refuses a site whose manifests
377
+ // include the package and whose config lacks this line (SEC-11257-1).
378
+ // #11259 — the base website pages' seam, the same way: their pages, actions
379
+ // and loaders import `@working-theory/site-pages/site`, answered by
380
+ // site-pages.config.tsx (`SitePagesSite`).
368
381
  webpack(config) {
369
382
  config.resolve.alias["@working-theory/account/site$"] = join(process.cwd(), "account.config.tsx");
383
+ config.resolve.alias["@working-theory/auth/site$"] = join(process.cwd(), "auth.config.tsx");
384
+ config.resolve.alias["@working-theory/site-pages/site$"] = join(process.cwd(), "site-pages.config.tsx");
370
385
  config.resolve.alias["@working-theory/ui-signal-collectors/site$"] = join(
371
386
  process.cwd(),
372
387
  "signal-collectors.config.tsx",
@@ -20,6 +20,7 @@
20
20
  "@working-theory/account": "workspace:*",
21
21
  "@working-theory/analytics": "workspace:*",
22
22
  "@working-theory/api-client": "workspace:*",
23
+ "@working-theory/auth": "workspace:*",
23
24
  "@working-theory/content-adapters": "workspace:*",
24
25
  "@working-theory/database": "workspace:*",
25
26
  "@working-theory/ids": "workspace:*",
@@ -31,6 +32,7 @@
31
32
  "@working-theory/schema-pack-registry": "workspace:*",
32
33
  "@working-theory/schema-validator": "workspace:*",
33
34
  "@working-theory/site-config": "workspace:*",
35
+ "@working-theory/site-pages": "workspace:*",
34
36
  "@working-theory/spoke-checkout": "workspace:*",
35
37
  "@working-theory/templates": "workspace:*",
36
38
  "@working-theory/theme": "workspace:*",
@@ -0,0 +1,85 @@
1
+ /**
2
+ * site-pages.config.tsx — this site's answer to the base website pages'
3
+ * runtime-services seam (ADR 0040 rule 4; #11259 D3).
4
+ *
5
+ * The pages under `app/[locale]/` that `@working-theory/site-pages` ships are
6
+ * generated re-exports (`create-ailk routes`); the package's pages, server
7
+ * actions and loaders read the site's own services through the one fixed
8
+ * specifier `@working-theory/site-pages/site`, which `next.config.mjs`
9
+ * aliases to this file (and `jest.config.cjs` maps). Its named export `site`
10
+ * carries exactly those services; its shape is `SitePagesSite`, fixed by the
11
+ * package, so a missing or misspelled member fails `tsc`.
12
+ *
13
+ * Not a customization slot: no page is site-configurable beyond these
14
+ * services (rule 8), so this file has no default export and no option.
15
+ */
16
+ import type { SitePagesSite } from "@working-theory/site-pages/site";
17
+
18
+ import { accountInviteHref } from "./lib/account-invite";
19
+ import { runBotCheck } from "./lib/bot-check";
20
+ import { consentVisitorHeader, ensureConsentVisitor, readConsentVisitor } from "./lib/consent-visitor";
21
+ import { framedSources, inPageView, newsletterSignup, readCaptureStatus, readServedMagnet } from "./lib/in-page-magnet";
22
+ import { MARKETING_PAGES } from "./lib/modules.generated";
23
+ import { isShownLookupKey, offeringsCheckoutHref } from "./lib/offerings-pricing";
24
+ import {
25
+ offeringPricingPages,
26
+ pagePlans,
27
+ PRICING_HUB_SLUG,
28
+ pricingPageCard,
29
+ pricingSections,
30
+ pricingSectionSlots,
31
+ } from "./lib/pricing-page";
32
+ import { ApiError, forwardedCookieInit, unwrapApiResult } from "./lib/server-api";
33
+ import { SERVICES_PATH, SERVICES_ROUTE, toPublicServicesHref } from "./lib/services-path";
34
+ import { siteChrome } from "./lib/site-chrome";
35
+ import { readSiteContactEmail } from "./lib/site-contact-email";
36
+ import { siteLogomarkAsset, siteWordmarkAsset } from "./lib/site-logo";
37
+ import { readSession } from "./lib/topology.generated";
38
+ import { takeVisitorLimit } from "./src/lib/rate-limit";
39
+ import { pagePathFor } from "./src/lib/routes";
40
+
41
+ // `lib/in-page-magnet` imports two package modules that import this seam (a
42
+ // cycle, as account.config.tsx has with the account actions): its members
43
+ // copied below must stay hoisted function declarations, read at call time.
44
+ export const site = {
45
+ accountInviteHref,
46
+ runBotCheck,
47
+ consentVisitorHeader,
48
+ readConsentVisitor,
49
+ ensureConsentVisitor,
50
+ framedSources,
51
+ inPageView,
52
+ readCaptureStatus,
53
+ readServedMagnet,
54
+ newsletterSignup,
55
+ // Loaded on first call, as the two modules' registrations (the listing
56
+ // extension, the deck pages) already run from the locale layout: a page's
57
+ // module graph stays what it was before the move.
58
+ listingExtension: {
59
+ entryAt: async (...args) => (await import("./lib/listings")).listingExtension.entryAt(...args),
60
+ entryMetadataAt: async (...args) => (await import("./lib/listings")).listingExtension.entryMetadataAt(...args),
61
+ },
62
+ MARKETING_PAGES,
63
+ isShownLookupKey,
64
+ offeringsCheckoutHref,
65
+ resolveHomeChrome: async (...args) => (await import("./lib/page-chrome")).resolveHomeChrome(...args),
66
+ offeringPricingPages,
67
+ pagePlans,
68
+ pricingPageCard,
69
+ pricingSections,
70
+ pricingSectionSlots,
71
+ PRICING_HUB_SLUG,
72
+ ApiError,
73
+ forwardedCookieInit,
74
+ unwrapApiResult,
75
+ SERVICES_PATH,
76
+ SERVICES_ROUTE,
77
+ toPublicServicesHref,
78
+ siteChrome,
79
+ siteLogomarkAsset,
80
+ siteWordmarkAsset,
81
+ takeVisitorLimit,
82
+ pagePathFor,
83
+ readSiteContactEmail,
84
+ getSession: readSession,
85
+ } satisfies SitePagesSite;
@@ -8,9 +8,14 @@
8
8
  // To verify: intentionally misspell a key in a component and run
9
9
  // `pnpm --filter @working-theory/web type-check` — the compiler will error.
10
10
 
11
+ import type authMessages from "@working-theory/auth/messages/en";
12
+
11
13
  import type enMessages from "../messages/en.json";
12
14
 
13
- type Messages = typeof enMessages;
15
+ // #11257 D12 — the sign-in surfaces' keys ship in `@working-theory/auth`'s
16
+ // catalog, which `i18n/request.ts` merges under this site's, so the declared
17
+ // shape is the two together.
18
+ type Messages = typeof enMessages & typeof authMessages;
14
19
 
15
20
  declare global {
16
21
  // next-intl reads this via module augmentation.
@@ -25,7 +25,8 @@
25
25
  * file from source.
26
26
  */
27
27
  import { existsSync, lstatSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
28
- import { join } from "node:path";
28
+ import { createRequire } from "node:module";
29
+ import { join, resolve } from "node:path";
29
30
 
30
31
  /** Per content type: mdx-body always, or only while `sections[]` is empty. */
31
32
  export type MdxBodyRule = Map<string, "always" | "unless-sections">;
@@ -57,19 +58,45 @@ function pageFiles(dir: string, out: string[] = []): string[] {
57
58
  return out;
58
59
  }
59
60
 
61
+ // A route file `create-ailk routes` generated (#11259 D8): its header line
62
+ // (after an optional `// oss: false` marker) and the package page it re-exports.
63
+ const GENERATED_ROUTE_HEADER = "// Generated by create-ailk routes from ";
64
+ const OSS_FALSE_MARKER = "// oss: false";
65
+ const GENERATED_FROM_RE = /\bfrom\s+"(@working-theory\/[^"]+)"/;
66
+
67
+ /**
68
+ * A page file's own source. A generated route file is followed to the package
69
+ * page it re-exports, resolved from the site's `apps/web` as Next resolves it
70
+ * (#11259 D8: the base pages ship in `@working-theory/site-pages`); one whose
71
+ * package is not installed reads as itself.
72
+ */
73
+ function pageSource(file: string, webDir: string): string {
74
+ const text = readFileSync(file, "utf8");
75
+ const [line1 = "", line2 = ""] = text.split("\n", 2);
76
+ if (!(line1 === OSS_FALSE_MARKER ? line2 : line1).startsWith(GENERATED_ROUTE_HEADER)) return text;
77
+ const specifier = GENERATED_FROM_RE.exec(text)?.[1];
78
+ if (specifier === undefined) return text;
79
+ try {
80
+ return readFileSync(createRequire(resolve(webDir, "package.json")).resolve(specifier), "utf8");
81
+ } catch {
82
+ return text;
83
+ }
84
+ }
85
+
60
86
  /**
61
87
  * Scan `<appsRoot>/apps/web/app/**\/page.{ts,tsx}` for `renderPage({…})` calls
62
88
  * naming `bodyMode: "mdx-body"`. A call whose `bodyMode` sits in a conditional
63
89
  * spread is `"unless-sections"`, any other `"always"`; `"always"` wins when two
64
90
  * routes name one type. A content hub's `HubConfig` reads the same way, from
65
- * its `body`. A missing `apps/web/app` gives an empty map.
91
+ * its `body`. A generated route file reads as the package page it re-exports
92
+ * (`pageSource`). A missing `apps/web/app` gives an empty map.
66
93
  */
67
94
  export function mdxBodyRule(appsRoot: string): MdxBodyRule {
68
95
  const rule: MdxBodyRule = new Map();
69
96
  const appDir = join(appsRoot, "apps", "web", "app");
70
97
  if (!existsSync(appDir)) return rule;
71
98
  for (const file of pageFiles(appDir)) {
72
- const source = readFileSync(file, "utf8");
99
+ const source = pageSource(file, join(appsRoot, "apps", "web"));
73
100
  if (HUB_INPUT_RE.test(source)) {
74
101
  const types = [...source.matchAll(HUB_LIST_TYPE_RE)];
75
102
  const bodies = [...source.matchAll(HUB_BODY_RE)];