create-ailk 0.37.1 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/README.md +129 -0
  2. package/component-catalog.json +44 -6
  3. package/component-catalog.md +6 -5
  4. package/dist/add-module.js +16 -1
  5. package/dist/add-route.d.ts +2 -2
  6. package/dist/add-route.js +19 -12
  7. package/dist/cli.js +52 -0
  8. package/dist/declined-routes.d.ts +13 -0
  9. package/dist/declined-routes.js +74 -0
  10. package/dist/derive-architecture.d.ts +0 -6
  11. package/dist/derive-architecture.js +12 -16
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +3 -0
  14. package/dist/language-import.d.ts +93 -0
  15. package/dist/language-import.js +270 -43
  16. package/dist/lib/import-mdx.js +1 -1
  17. package/dist/lib/scaffold-render-sweep.d.ts +6 -3
  18. package/dist/lib/scaffold-render-sweep.js +8 -4
  19. package/dist/migrate-content.d.ts +6 -2
  20. package/dist/migrate-content.js +62 -5
  21. package/dist/module-architecture.js +139 -103
  22. package/dist/paid-sections.d.ts +13 -0
  23. package/dist/paid-sections.js +35 -5
  24. package/dist/programmatic.js +6 -16
  25. package/dist/remove-module.js +73 -2
  26. package/dist/routes.d.ts +130 -0
  27. package/dist/routes.js +954 -0
  28. package/dist/site-manifest.js +6 -4
  29. package/dist/site-roster.d.ts +11 -2
  30. package/dist/site-roster.js +63 -21
  31. package/dist/spoke-checkout.d.ts +28 -27
  32. package/dist/spoke-checkout.js +71 -102
  33. package/dist/surfaces.d.ts +26 -0
  34. package/dist/surfaces.js +105 -293
  35. package/dist/sync-routes.d.ts +14 -1
  36. package/dist/sync-routes.js +108 -10
  37. package/dist/template-record.js +3 -1
  38. package/dist/topology.d.ts +26 -1
  39. package/dist/topology.js +273 -7
  40. package/dist/update.d.ts +17 -2
  41. package/dist/update.js +480 -77
  42. package/package.json +3 -3
  43. package/templates/README.md +1 -1
  44. package/templates/apps/mcp/CLAUDE.md +5 -3
  45. package/templates/apps/web/CLAUDE.md +87 -23
  46. package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +5 -1
  47. package/templates/apps/web/__tests__/__mocks__/next-intl.ts +5 -1
  48. package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
  49. package/templates/apps/web/account.config.tsx +100 -0
  50. package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +1 -1
  51. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +2 -2
  52. package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
  53. package/templates/apps/web/app/[locale]/layout.tsx +46 -29
  54. package/templates/apps/web/app/apple-icon.tsx +72 -0
  55. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
  56. package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
  57. package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
  58. package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
  59. package/templates/apps/web/app/og/route.tsx +155 -72
  60. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
  61. package/templates/apps/web/auth.config.tsx +107 -0
  62. package/templates/apps/web/auth.ts +2 -1
  63. package/templates/apps/web/i18n/request.ts +51 -1
  64. package/templates/apps/web/jest.config.cjs +17 -1
  65. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
  66. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +73 -0
  67. package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
  68. package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
  69. package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
  70. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
  71. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
  72. package/templates/apps/web/lib/listings.tsx +2 -2
  73. package/templates/apps/web/lib/nav-label-keys.ts +16 -2
  74. package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
  75. package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
  76. package/templates/apps/web/lib/profile-back-link.ts +105 -32
  77. package/templates/apps/web/lib/served-pages.ts +95 -0
  78. package/templates/apps/web/lib/server-api.ts +1 -1
  79. package/templates/apps/web/lib/site-brand.tsx +3 -5
  80. package/templates/apps/web/lib/topology.generated.ts +5 -0
  81. package/templates/apps/web/messages/en.json +8 -836
  82. package/templates/apps/web/middleware.ts +15 -26
  83. package/templates/apps/web/next.config.mjs +35 -0
  84. package/templates/apps/web/package.json +2 -0
  85. package/templates/apps/web/types/messages.d.ts +6 -1
  86. package/templates/customizations.yaml +9 -0
  87. package/templates/package.json +3 -1
  88. package/templates/tools/lint-architecture.ts +164 -11
  89. package/versions.json +49 -47
  90. package/templates/apps/web/app/[locale]/(auth)/__tests__/auth-pages.test.tsx +0 -322
  91. package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +0 -554
  92. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +0 -56
  93. package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +0 -164
  94. package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +0 -132
  95. package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +0 -51
  96. package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +0 -144
  97. package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +0 -101
  98. package/templates/apps/web/app/[locale]/(auth)/forgot-password/page.tsx +0 -111
  99. package/templates/apps/web/app/[locale]/(auth)/layout.tsx +0 -81
  100. package/templates/apps/web/app/[locale]/(auth)/legal-footnote.tsx +0 -35
  101. package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +0 -179
  102. package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +0 -157
  103. package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +0 -126
  104. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/next-path.test.ts +0 -54
  105. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +0 -628
  106. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +0 -43
  107. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +0 -266
  108. package/templates/apps/web/app/[locale]/(auth)/sign-in/next-path.ts +0 -20
  109. package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +0 -234
  110. package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +0 -37
  111. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +0 -323
  112. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +0 -93
  113. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/page.test.tsx +0 -301
  114. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +0 -309
  115. package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +0 -201
  116. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +0 -366
  117. package/templates/apps/web/app/[locale]/(auth)/use-auth-card-flow.ts +0 -116
  118. package/templates/apps/web/app/[locale]/(auth)/verify-email/__tests__/actions.test.ts +0 -94
  119. package/templates/apps/web/app/[locale]/(auth)/verify-email/actions.ts +0 -77
  120. package/templates/apps/web/app/[locale]/(auth)/verify-email/page.tsx +0 -154
  121. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
  122. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
  123. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
  124. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
  125. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
  126. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
  127. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
  128. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
  129. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
  130. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
  131. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
  132. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
  133. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
  134. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
  135. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
  136. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
  137. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
  138. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
  139. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
  140. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
  141. package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
  142. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
  143. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
  144. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
  145. package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
  146. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
  147. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -161
  148. package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
  149. package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
  150. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -139
  151. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -406
  152. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
  153. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
  154. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -190
  155. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
  156. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
  157. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
  158. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
  159. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
  160. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
  161. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -182
  162. package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
  163. package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
  164. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -424
  165. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
  166. package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
  167. package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
  168. package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
  169. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
  170. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
  171. package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
  172. package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
  173. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
  174. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
  175. package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
  176. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -218
  177. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
  178. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
  179. package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
  180. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
  181. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
  182. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -119
  183. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
  184. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -80
  185. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
  186. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -125
  187. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
  188. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
  189. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
  190. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
  191. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
  192. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
  193. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -154
  194. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -152
  195. package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
  196. package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
  197. package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
  198. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -143
  199. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
  200. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
  201. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -126
  202. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -306
  203. package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
  204. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
  205. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -102
  206. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -240
  207. package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
  208. package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
  209. package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
  210. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -131
  211. package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
  212. package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
  213. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -24
  214. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
  215. package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
  216. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -60
  217. package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
  218. package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
  219. package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
  220. package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
  221. package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
  222. package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
  223. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
  224. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
  225. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
  226. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
  227. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
  228. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
  229. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
  230. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
  231. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
  232. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
  233. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
  234. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
  235. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
  236. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
  237. package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
  238. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
  239. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
  240. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
  241. package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
  242. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
  243. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
  244. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
  245. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
  246. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
  247. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
  248. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
  249. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
  250. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
  251. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
  252. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
  253. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
  254. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
  255. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
  256. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
  257. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
  258. package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
  259. package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
  260. package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
  261. package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
  262. package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
  263. package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
  264. package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
  265. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
  266. package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
  267. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
  268. package/templates/apps/web/app/api/auth/[...all]/route.ts +0 -16
  269. package/templates/apps/web/app/api/auth/hub/__tests__/continuation.test.ts +0 -143
  270. package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +0 -749
  271. package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +0 -964
  272. package/templates/apps/web/app/api/auth/hub/authorize/route.ts +0 -390
  273. package/templates/apps/web/app/api/auth/hub/continuation.ts +0 -127
  274. package/templates/apps/web/app/api/auth/hub/continue/[ref]/__tests__/route.test.ts +0 -188
  275. package/templates/apps/web/app/api/auth/hub/continue/[ref]/route.ts +0 -53
  276. package/templates/apps/web/app/api/auth/hub/email/route.ts +0 -111
  277. package/templates/apps/web/app/api/auth/hub/entry-shared.ts +0 -163
  278. package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +0 -86
  279. package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +0 -368
  280. package/templates/apps/web/app/api/auth/hub/password/return.ts +0 -86
  281. package/templates/apps/web/app/api/auth/hub/password/route.ts +0 -171
  282. package/templates/apps/web/app/api/auth/hub/purchase/route.ts +0 -230
  283. package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +0 -174
  284. package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +0 -60
  285. package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +0 -97
  286. package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +0 -92
  287. package/templates/apps/web/app/api/auth/mcp/continuation.ts +0 -89
  288. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +0 -59
  289. package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +0 -41
  290. package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +0 -1166
  291. package/templates/apps/web/app/api/hub-session/callback/route.ts +0 -134
  292. package/templates/apps/web/app/api/hub-session/email/route.ts +0 -125
  293. package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +0 -49
  294. package/templates/apps/web/app/api/hub-session/one-tap/route.ts +0 -106
  295. package/templates/apps/web/app/api/hub-session/open/route.ts +0 -111
  296. package/templates/apps/web/app/api/hub-session/password/return/route.ts +0 -69
  297. package/templates/apps/web/app/api/hub-session/password/route.ts +0 -106
  298. package/templates/apps/web/app/api/hub-session/sign-in/route.ts +0 -91
  299. package/templates/apps/web/app/api/hub-session/sign-out/route.ts +0 -54
  300. package/templates/apps/web/components/sign-out-trigger.tsx +0 -62
  301. package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
  302. package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
  303. package/templates/apps/web/lib/account-config.ts +0 -678
  304. package/templates/apps/web/lib/auth-routes.ts +0 -125
  305. package/templates/apps/web/lib/checkout-config.ts +0 -16
  306. package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +0 -433
  307. package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +0 -332
  308. package/templates/apps/web/lib/hub-session/config.ts +0 -110
  309. package/templates/apps/web/lib/hub-session/entry.ts +0 -238
  310. package/templates/apps/web/lib/hub-session/index.ts +0 -21
  311. package/templates/apps/web/lib/hub-session/one-tap.tsx +0 -148
  312. package/templates/apps/web/lib/hub-session/reseal.ts +0 -90
  313. package/templates/apps/web/lib/hub-session/seal.ts +0 -86
  314. package/templates/apps/web/lib/hub-session/session.ts +0 -298
  315. package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +0 -277
  316. package/templates/apps/web/lib/next-path.ts +0 -35
  317. package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
  318. package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
@@ -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,
@@ -97,7 +101,9 @@ const intlMiddleware = createMiddleware({
97
101
 
98
102
  // Top-level app/ route directories that live outside [locale]. Kept in step
99
103
  // with app/ by the drift test in __tests__/i18n/middleware.test.ts.
100
- export const NON_LOCALE_ROUTE_PREFIXES = ["/api", "/og", "/v1"] as const;
104
+ // /apple-icon is the touch-icon metadata route app/apple-icon.tsx emits
105
+ // (`/apple-icon?<hash>`); without it next-intl rewrites it to a 404 (#11244).
106
+ export const NON_LOCALE_ROUTE_PREFIXES = ["/api", "/apple-icon", "/og", "/v1"] as const;
101
107
 
102
108
  // Segment-bound: /og and /og/x are exempt; /ogden and /og-image are not.
103
109
  export function isNonLocaleRoute(pathname: string): boolean {
@@ -176,16 +182,6 @@ const FILE_ROUTE_SECURITY_HEADERS: Readonly<Record<string, string>> =
176
182
  ),
177
183
  );
178
184
 
179
- /**
180
- * Whether this site signs in through its hub (#11096): the hub's sign-in
181
- * origin, which only a hub-sign-in spoke sets (`lib/hub-session/config.ts`).
182
- * Read from the environment, not `lib/topology.generated`, whose spoke render
183
- * imports the Node-only session module this Edge bundle must not carry.
184
- */
185
- function signsInThroughHub(): boolean {
186
- return (process.env.AILK_HUB_SIGN_IN_URL?.trim() ?? "") !== "";
187
- }
188
-
189
185
  export function middleware(request: NextRequest): NextResponse {
190
186
  // Step 1: Forward x-pathname to server components so generateMetadata can
191
187
  // build path-aware hreflang alternates (P2 S1). Clone the request headers
@@ -193,18 +189,10 @@ export function middleware(request: NextRequest): NextResponse {
193
189
  // doesn't clobber the original user-facing path.
194
190
  const requestHeaders = new Headers(request.headers);
195
191
  requestHeaders.set("x-pathname", request.nextUrl.pathname);
196
- // #11096 D1 — the (authed) gate renders from a layout, which gets no
197
- // searchParams, so on a hub-sign-in spoke an account path's query rides
198
- // beside the path. Always this request's own value: a client-sent
199
- // `x-search` is dropped everywhere. It can hold a purchase claim, so no
200
- // other path or topology carries it, and nothing logs or reports it.
201
- requestHeaders.delete("x-search");
202
- if (
203
- signsInThroughHub() &&
204
- isAccountPath(request.nextUrl.pathname, enabledLocales)
205
- ) {
206
- requestHeaders.set("x-search", request.nextUrl.search);
207
- }
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);
208
196
 
209
197
  // Non-locale routes are served as requested — no rewrite, no redirect.
210
198
  if (isNonLocaleRoute(request.nextUrl.pathname)) {
@@ -276,6 +264,7 @@ export function middleware(request: NextRequest): NextResponse {
276
264
  // file routes get the six others and keep their own sandbox CSP (#9162).
277
265
  // A hub-sign-in spoke that turned Google One Tap on (`AILK_HUB_ONE_TAP=on`)
278
266
  // gets Google's origins on its other pages (#11096 D10, SEC-11096-10).
267
+ const auth = authResponseHeaders(request);
279
268
  applyHeaders(
280
269
  intlResponse.headers,
281
270
  isFileRoutePath(request.nextUrl.pathname)
@@ -283,13 +272,13 @@ export function middleware(request: NextRequest): NextResponse {
283
272
  : SCHEDULING_PAGES &&
284
273
  isBookingPath(request.nextUrl.pathname, enabledLocales)
285
274
  ? SCHEDULING_SECURITY_HEADERS
286
- : signsInThroughHub() && process.env.AILK_HUB_ONE_TAP === "on"
275
+ : auth.oneTap
287
276
  ? ONE_TAP_SECURITY_HEADERS
288
277
  : DEFAULT_SECURITY_HEADERS,
289
278
  );
290
279
  // SEC-11096-4 — a page that carries a purchase claim in its query sends no
291
280
  // referrer, so no request it makes carries the claim in `Referer`.
292
- if (request.nextUrl.searchParams.has("claim")) {
281
+ if (auth.noReferrer) {
293
282
  intlResponse.headers.set("Referrer-Policy", "no-referrer");
294
283
  }
295
284
  // #10040 decision 7 — a site with neither marketing nor docs-blog (a hub)
@@ -327,7 +327,14 @@ const nextConfig = {
327
327
  // Keep this list in sync with package.json workspace:* dependencies.
328
328
  // Mirror of the transpilePackages list in apps-paid/marketing-web/next.config.ts.
329
329
  transpilePackages: [
330
+ // #11219 (ADR 0040): the account page package ships TypeScript source,
331
+ // like @working-theory/admin does for the Admin shell; the generated
332
+ // route files under app/[locale]/(authed)/account/ re-export it.
333
+ "@working-theory/account",
330
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",
331
338
  "@working-theory/api-client",
332
339
  "@working-theory/content-adapters",
333
340
  "@working-theory/jsonld",
@@ -352,6 +359,34 @@ const nextConfig = {
352
359
  // Marking better-auth as a server external prevents webpack from statically
353
360
  // bundling it (and the unused kysely adapter) into the server chunk.
354
361
  serverExternalPackages: ["better-auth"],
362
+ // #11219 (ADR 0040) — the account page package's site seam. Its pages and
363
+ // its "use server" actions import the fixed specifier
364
+ // `@working-theory/account/site`; this site answers it with
365
+ // account.config.tsx, whose `site` export carries the runtime services the
366
+ // package types (`AccountSite`). jest.config.cjs maps the same specifier.
367
+ // #11251 — the flows pages' seam, the same way: their pages and actions
368
+ // import `@working-theory/ui-signal-collectors/site`, answered by
369
+ // signal-collectors.config.tsx (`SignalCollectorsSite`). A site without the
370
+ // module has no such file and no importer of the specifier.
371
+ // #11257 — the sign-in package's seam, the same way: its pages, actions and
372
+ // handlers import `@working-theory/auth/site`, answered by auth.config.tsx
373
+ // (`AuthSite`). `create-ailk routes --check` refuses a site whose manifests
374
+ // include the package and whose config lacks this line (SEC-11257-1).
375
+ webpack(config) {
376
+ config.resolve.alias["@working-theory/account/site$"] = join(process.cwd(), "account.config.tsx");
377
+ config.resolve.alias["@working-theory/auth/site$"] = join(process.cwd(), "auth.config.tsx");
378
+ config.resolve.alias["@working-theory/ui-signal-collectors/site$"] = join(
379
+ process.cwd(),
380
+ "signal-collectors.config.tsx",
381
+ );
382
+ // The package ships TypeScript source whose relative imports name `.js`
383
+ // (TypeScript's ESM convention): resolve each to its `.ts`/`.tsx` source.
384
+ config.resolve.extensionAlias = {
385
+ ...config.resolve.extensionAlias,
386
+ ".js": [".ts", ".tsx", ".js"],
387
+ };
388
+ return config;
389
+ },
355
390
  // Disable Next 16's auto-generated AGENTS.md / CLAUDE.md agent-rules
356
391
  // block. Default true: `next dev`, on detecting an AI coding agent in
357
392
  // the environment, upserts a managed `<!-- BEGIN:nextjs-agent-rules -->`
@@ -17,8 +17,10 @@
17
17
  "dependencies": {
18
18
  "@prisma/adapter-pg": "^7.8.0",
19
19
  "@sentry/nextjs": "^10.58.0",
20
+ "@working-theory/account": "workspace:*",
20
21
  "@working-theory/analytics": "workspace:*",
21
22
  "@working-theory/api-client": "workspace:*",
23
+ "@working-theory/auth": "workspace:*",
22
24
  "@working-theory/content-adapters": "workspace:*",
23
25
  "@working-theory/database": "workspace:*",
24
26
  "@working-theory/ids": "workspace:*",
@@ -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.
@@ -24,6 +24,15 @@
24
24
  # the future (strictly after today, UTC):
25
25
  # undecided_ok_until: 2027-01-31
26
26
  #
27
+ # A template route this site deliberately does not carry (optional):
28
+ # declined_routes:
29
+ # - route: "pricing/[slug]" # under apps/web/app/[locale]/
30
+ # reason: "this site sells from /pricing alone"
31
+ # decided: "Site Owner, 2026-11-02" # <decider>, <YYYY-MM-DD>
32
+ # sync-routes reports it declined, never missing, and never copies it back;
33
+ # update never writes under it. `pnpm architecture` refuses an entry with no
34
+ # reason, no decided line, or naming no route the template carries.
35
+ #
27
36
  # Seeding an existing site:
28
37
  # 1. Copy tools/lint-architecture.ts (and this file, if absent) from a fresh
29
38
  # scaffold of this create-ailk version.
@@ -22,7 +22,8 @@
22
22
  "claude-md:check": "tsx tools/check-claude-md.ts",
23
23
  "content-source:check": "tsx tools/check-content-source.ts",
24
24
  "mdx-body:check": "tsx tools/check-mdx-body.ts",
25
- "preflight": "pnpm architecture && pnpm claude-md:check && pnpm content-source:check && pnpm mdx-body:check && pnpm type-check && pnpm lint && pnpm build"
25
+ "routes:check": "create-ailk routes --check",
26
+ "preflight": "pnpm architecture && pnpm routes:check && pnpm claude-md:check && pnpm content-source:check && pnpm mdx-body:check && pnpm type-check && pnpm lint && pnpm build"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@arethetypeswrong/cli": "^0.18.5",
@@ -67,6 +68,7 @@
67
68
  "zod": "^4.2.1",
68
69
  "zod-to-ts": "^2.1.0",
69
70
  "@working-theory/cli": "workspace:*",
71
+ "create-ailk": "{{CREATE_AILK_VERSION}}",
70
72
  "@working-theory/database": "workspace:*",
71
73
  "@working-theory/validation": "workspace:*",
72
74
  "@prisma/adapter-pg": "^7.8.0",
@@ -32,7 +32,13 @@
32
32
  * `undecided_ok_until` is in the future; a `build-in: ailk#N` entry whose
33
33
  * paths still match the site's own test files is refused (tests belong
34
34
  * in AILK); a malformed or missing manifest is refused naming the field.
35
- * With no template record the lint warns and skips the file rules;
35
+ * With no template record the lint warns and skips the file rules.
36
+ * The manifest's optional `declined_routes` list (#11260) records a
37
+ * template route the site deliberately does not carry — create-ailk
38
+ * sync-routes and update never copy it back; each entry names a route
39
+ * the template carries (read from the installed create-ailk's
40
+ * templates, and from the template record) with a non-empty `reason`
41
+ * and a `decided: <decider>, <YYYY-MM-DD>` line, or it is refused;
36
42
  * - the shadow-copy rule (#9201), under the same block and record — a
37
43
  * site-authored file under `apps/` most of whose substantive lines are a
38
44
  * module's that an installed `@working-theory/*` package ships (found
@@ -538,6 +544,19 @@ interface Entry {
538
544
  decision: string;
539
545
  }
540
546
 
547
+ /** A `declined_routes` entry (#11260): a template route the site does not carry. */
548
+ interface DeclinedRoute {
549
+ route: string;
550
+ line: number;
551
+ }
552
+
553
+ /** Site-relative prefix every `apps/web` route directory sits under. */
554
+ const ROUTE_ROOT = "apps/web/app/[locale]";
555
+ /** Directories under a route that are not routes of their own. */
556
+ const NON_ROUTE_DIRS = new Set(["__tests__", "components"]);
557
+ const DECIDED_RE = /^[^,]+, (\d{4}-\d{2}-\d{2})$/;
558
+ const ROUTE_RE = /^[^/\s*\\][^\s*\\]*$/;
559
+
541
560
  /**
542
561
  * A path pattern as a regex: `**` matches zero or more whole segments, `*`
543
562
  * matches within one segment, and every other character is literal — route
@@ -575,12 +594,25 @@ function readRecord(): Set<string> | null {
575
594
  }
576
595
  }
577
596
 
597
+ /**
598
+ * A route file `create-ailk routes --write` wrote: its first line — or its
599
+ * second, behind a page package's `// oss: false` marker — is the generator's
600
+ * header. It is the installed page package's code, never the site's (ADR 0040
601
+ * rule 3), and the template record never lists it: the template snapshot
602
+ * excludes it and the generator writes it after install (#11251, #11252).
603
+ */
604
+ const GENERATED_ROUTE_HEADER = "// Generated by create-ailk routes from ";
605
+ function isGeneratedRoute(p: string): boolean {
606
+ const [first = "", second = ""] = readFileSync(join(ROOT, p), "utf8").split("\n", 2);
607
+ return first.startsWith(GENERATED_ROUTE_HEADER) || (first === "// oss: false" && second.startsWith(GENERATED_ROUTE_HEADER));
608
+ }
609
+
578
610
  /** Every site-authored code file under `apps/`, root-relative, sorted. */
579
611
  function siteAuthoredFiles(record: Set<string>, scaffoldPaths: string[]): string[] {
580
612
  const shipped = scaffoldPaths.map(globToRegExp);
581
613
  return walk(join(ROOT, "apps"), CODE_FILE_RE)
582
614
  .map(rel)
583
- .filter((p) => !record.has(p) && !shipped.some((re) => re.test(p)))
615
+ .filter((p) => !record.has(p) && !shipped.some((re) => re.test(p)) && !isGeneratedRoute(p))
584
616
  .sort();
585
617
  }
586
618
 
@@ -590,9 +622,12 @@ function siteAuthoredFiles(record: Set<string>, scaffoldPaths: string[]): string
590
622
  * and `paths`, so one fault never turns its files into unmatched ones.
591
623
  */
592
624
  /** Null when the manifest is missing — the caller reports only that. */
593
- function readManifest(out: Violation[]): { entries: Entry[]; graceUntil: string | undefined } | null {
625
+ function readManifest(
626
+ out: Violation[],
627
+ ): { entries: Entry[]; graceUntil: string | undefined; declined: DeclinedRoute[] } | null {
594
628
  const file = join(ROOT, MANIFEST_PATH);
595
629
  const entries: Entry[] = [];
630
+ const declined: DeclinedRoute[] = [];
596
631
  let graceUntil: string | undefined;
597
632
  if (!existsSync(file)) {
598
633
  out.push({
@@ -613,12 +648,12 @@ function readManifest(out: Violation[]): { entries: Entry[]; graceUntil: string
613
648
  if (doc.errors.length > 0) {
614
649
  const err = doc.errors[0]!;
615
650
  fault(err.linePos?.[0]?.line ?? 1, `${MANIFEST_PATH} does not parse: ${err.message.split("\n")[0]}`, "make it valid YAML — copy the shape from a fresh scaffold's customizations.yaml.");
616
- return { entries, graceUntil };
651
+ return { entries, graceUntil, declined };
617
652
  }
618
653
  const root = doc.contents;
619
654
  if (!isMap(root)) {
620
- fault(1, `${MANIFEST_PATH} is not a map`, "the file holds `undecided_ok_until` (optional) and `customizations` (a list).");
621
- return { entries, graceUntil };
655
+ fault(1, `${MANIFEST_PATH} is not a map`, "the file holds `undecided_ok_until` (optional), `declined_routes` (optional, a list) and `customizations` (a list).");
656
+ return { entries, graceUntil, declined };
622
657
  }
623
658
  const scalarText = (node: unknown): string | undefined => {
624
659
  if (!isScalar(node)) return undefined;
@@ -627,6 +662,8 @@ function readManifest(out: Violation[]): { entries: Entry[]; graceUntil: string
627
662
  };
628
663
  let list: unknown;
629
664
  let listLine = 1;
665
+ let declinedRoutes: unknown;
666
+ let declinedLine = 1;
630
667
  for (const pair of root.items) {
631
668
  const key = scalarText(pair.key);
632
669
  const keyLine = lineOf(pair.key as Node);
@@ -640,17 +677,69 @@ function readManifest(out: Violation[]): { entries: Entry[]; graceUntil: string
640
677
  } else if (key === "customizations") {
641
678
  list = pair.value;
642
679
  listLine = keyLine;
680
+ } else if (key === "declined_routes") {
681
+ declinedRoutes = pair.value;
682
+ declinedLine = keyLine;
683
+ } else {
684
+ fault(keyLine, `unknown key ${JSON.stringify(key)} — the keys are undecided_ok_until, declined_routes and customizations`, "remove it, or move it under the entry it describes.");
685
+ }
686
+ }
687
+ // #11260 — declined_routes, when present: a list of { route, reason, decided }.
688
+ if (declinedRoutes !== undefined && !(isScalar(declinedRoutes) && declinedRoutes.value === null)) {
689
+ if (!isSeq(declinedRoutes)) {
690
+ fault(lineOf(declinedRoutes as Node, declinedLine), "declined_routes is not a list", "write a sequence of entries (- route: … / reason: … / decided: …), or remove the key.");
691
+ } else if (declinedRoutes.flow && declinedRoutes.items.length > 0) {
692
+ // create-ailk reads this list by line: only the block layout reaches it.
693
+ fault(lineOf(declinedRoutes, declinedLine), "declined_routes is a flow list ([…])", "write one block entry per route (- route: … / reason: … / decided: …) — create-ailk sync-routes and update read only that layout.");
643
694
  } else {
644
- fault(keyLine, `unknown key ${JSON.stringify(key)} — the keys are undecided_ok_until and customizations`, "remove it, or move it under the entry it describes.");
695
+ const seenRoutes = new Set<string>();
696
+ declinedRoutes.items.forEach((item, index) => {
697
+ if (!isMap(item)) {
698
+ fault(lineOf(item as Node, declinedLine), `declined_routes[${index}] is not a map`, "an entry is a map with route, reason and decided.");
699
+ return;
700
+ }
701
+ if (item.flow) {
702
+ fault(lineOf(item, declinedLine), `declined_routes[${index}] is a flow map ({…})`, "write the entry as block lines (route: … / reason: … / decided: …) — create-ailk sync-routes and update read only that layout.");
703
+ return;
704
+ }
705
+ for (const pair of item.items) {
706
+ if (isScalar(pair.value) && (pair.value.type === "BLOCK_LITERAL" || pair.value.type === "BLOCK_FOLDED")) {
707
+ fault(lineOf(pair.value, declinedLine), `declined_routes[${index}].${scalarText(pair.key) ?? "?"} is a block scalar (| or >)`, "write the value on one line, quoted.");
708
+ }
709
+ }
710
+ const line = lineOf(item);
711
+ const fields = new Map<string, unknown>();
712
+ for (const pair of item.items) {
713
+ const key = scalarText(pair.key) ?? "";
714
+ if (["route", "reason", "decided"].includes(key)) fields.set(key, pair.value);
715
+ else fault(lineOf(pair.key as Node, line), `unknown key ${JSON.stringify(key)} — a declined route's keys are route, reason, decided`, "remove it.");
716
+ }
717
+ const route = scalarText(fields.get("route"))?.replace(/^\/+|\/+$/g, "");
718
+ if (!fields.has("route")) fault(line, "route is required on every declined route", `name the template route under ${ROUTE_ROOT}/, e.g. route: "pricing/[slug]".`);
719
+ else if (route === undefined || !ROUTE_RE.test(route) || route.split("/").includes("..")) fault(lineOf(fields.get("route") as Node, line), `declined route ${JSON.stringify(route ?? null)} is not a route path`, `write the route as it sits under ${ROUTE_ROOT}/, with / separators and no glob, e.g. "pricing/[slug]".`);
720
+ else if (seenRoutes.has(route)) fault(lineOf(fields.get("route") as Node, line), `duplicate declined route ${JSON.stringify(route)}`, "list each route once.");
721
+ else {
722
+ seenRoutes.add(route);
723
+ declined.push({ route, line: lineOf(fields.get("route") as Node, line) });
724
+ }
725
+ const reason = scalarText(fields.get("reason"))?.trim();
726
+ if (reason === undefined || reason === "") fault(fields.has("reason") ? lineOf(fields.get("reason") as Node, line) : line, "reason is required on every declined route (a non-empty string)", "say why this site does not carry the route, e.g. reason: \"this site sells from /pricing alone\".");
727
+ const decided = scalarText(fields.get("decided"));
728
+ if (!fields.has("decided")) fault(line, "decided is required on every declined route (<decider>, <YYYY-MM-DD>)", "record who decided and when, e.g. decided: \"Site Owner, 2026-11-02\".");
729
+ else {
730
+ const date = decided === undefined ? undefined : DECIDED_RE.exec(decided)?.[1];
731
+ if (date === undefined || Number.isNaN(Date.parse(date))) fault(lineOf(fields.get("decided") as Node, line), `decided ${JSON.stringify(decided ?? null)} is not <decider>, <YYYY-MM-DD>`, "write who decided and the date, e.g. decided: \"Site Owner, 2026-11-02\".");
732
+ }
733
+ });
645
734
  }
646
735
  }
647
736
  if (list === undefined) {
648
737
  fault(1, "customizations is required (a list; [] when the site has none)", "add `customizations: []`.");
649
- return { entries, graceUntil };
738
+ return { entries, graceUntil, declined };
650
739
  }
651
740
  if (!isSeq(list)) {
652
741
  fault(lineOf(list as Node, listLine), "customizations is not a list", "write `customizations: []` or a sequence of entries (- id: … / paths: … / request: … / decision: …).");
653
- return { entries, graceUntil };
742
+ return { entries, graceUntil, declined };
654
743
  }
655
744
  const seen = new Set<string>();
656
745
  list.items.forEach((item, index) => {
@@ -700,7 +789,50 @@ function readManifest(out: Violation[]): { entries: Entry[]; graceUntil: string
700
789
  entries.push({ id, line, patterns, decision });
701
790
  }
702
791
  });
703
- return { entries, graceUntil };
792
+ return { entries, graceUntil, declined };
793
+ }
794
+
795
+ /**
796
+ * The template routes a site-relative file sits in — its route directory and
797
+ * every ancestor of it, since a declined route covers its sub-routes.
798
+ */
799
+ function templateRoutesOf(path: string): string[] {
800
+ if (!path.startsWith(`${ROUTE_ROOT}/`)) return [];
801
+ const dirs = path.slice(ROUTE_ROOT.length + 1).split("/").slice(0, -1);
802
+ const cut = dirs.findIndex((d) => NON_ROUTE_DIRS.has(d));
803
+ const route = cut === -1 ? dirs : dirs.slice(0, cut);
804
+ return route.map((_, i) => route.slice(0, i + 1).join("/"));
805
+ }
806
+
807
+ /**
808
+ * The template routes this site can know of (#11260): every route directory
809
+ * of the installed create-ailk's `templates/` (the root `devDependencies`
810
+ * pin, resolved the way node resolves it — the nearest `node_modules` at or
811
+ * above the site), plus every route a template record row sits in. Null
812
+ * when neither is there to read.
813
+ */
814
+ function knownTemplateRoutes(record: Set<string> | null): Set<string> | null {
815
+ const out = new Set<string>();
816
+ let readable = record !== null;
817
+ for (let at = ROOT; ; at = dirname(at)) {
818
+ const pkg = join(at, "node_modules", "create-ailk");
819
+ if (existsSync(join(pkg, "package.json"))) {
820
+ const templates = join(pkg, "templates");
821
+ const routes = join(templates, ...ROUTE_ROOT.split("/"));
822
+ if (existsSync(routes)) {
823
+ readable = true;
824
+ for (const file of walk(routes, /./)) {
825
+ for (const route of templateRoutesOf(toPosix(relative(templates, file)))) out.add(route);
826
+ }
827
+ }
828
+ break;
829
+ }
830
+ if (dirname(at) === at) break;
831
+ }
832
+ for (const path of record ?? []) {
833
+ for (const route of templateRoutesOf(path)) out.add(route);
834
+ }
835
+ return readable ? out : null;
704
836
  }
705
837
 
706
838
  function checkCustomizations(cfg: ArchConfig): Violation[] {
@@ -709,7 +841,7 @@ function checkCustomizations(cfg: ArchConfig): Violation[] {
709
841
  const out: Violation[] = [];
710
842
  const parsed = readManifest(out);
711
843
  if (parsed === null) return out;
712
- const { entries, graceUntil } = parsed;
844
+ const { entries, graceUntil, declined } = parsed;
713
845
  const manifest = join(ROOT, MANIFEST_PATH);
714
846
  const today = new Date().toISOString().slice(0, 10);
715
847
 
@@ -727,6 +859,27 @@ function checkCustomizations(cfg: ArchConfig): Violation[] {
727
859
  }
728
860
 
729
861
  const record = readRecord();
862
+
863
+ // #11260 — a declined route names a route the template carries.
864
+ if (declined.length > 0) {
865
+ const known = knownTemplateRoutes(record);
866
+ if (known === null) {
867
+ warnings.push(
868
+ `architecture: warning — no installed create-ailk and no ${RECORD_PATH}: the declined_routes entries cannot be checked against the template's routes`,
869
+ );
870
+ } else {
871
+ for (const d of declined) {
872
+ if (known.has(d.route)) continue;
873
+ out.push({
874
+ file: manifest,
875
+ line: d.line,
876
+ rule: `declined route ${JSON.stringify(d.route)} is not a template route`,
877
+ reason: `Fix: name a route the template carries, as it sits under ${ROUTE_ROOT}/ (e.g. "pricing/[slug]"), or remove the entry.`,
878
+ });
879
+ }
880
+ }
881
+ }
882
+
730
883
  if (record === null) {
731
884
  warnings.push(NO_RECORD_WARNING);
732
885
  return out;
package/versions.json CHANGED
@@ -1,66 +1,68 @@
1
1
  {
2
- "@working-theory/admin-ui": "0.61.0",
3
- "@working-theory/aeo": "0.61.0",
4
- "@working-theory/agent-context": "0.61.0",
2
+ "@working-theory/account": "0.63.0",
3
+ "@working-theory/admin-ui": "0.63.0",
4
+ "@working-theory/aeo": "0.63.0",
5
+ "@working-theory/agent-context": "0.63.0",
5
6
  "@working-theory/agent-contract": "0.1.0",
6
7
  "@working-theory/agent-memory": "0.0.0",
7
8
  "@working-theory/ai": "0.1.0",
8
- "@working-theory/analytics": "0.61.0",
9
- "@working-theory/api": "0.61.0",
10
- "@working-theory/api-client": "0.61.0",
9
+ "@working-theory/analytics": "0.63.0",
10
+ "@working-theory/api": "0.63.0",
11
+ "@working-theory/api-client": "0.63.0",
12
+ "@working-theory/auth": "0.63.0",
11
13
  "@working-theory/cda-filesystem": "0.0.0",
12
- "@working-theory/cli": "0.61.0",
13
- "@working-theory/common": "0.61.0",
14
+ "@working-theory/cli": "0.63.0",
15
+ "@working-theory/common": "0.63.0",
14
16
  "@working-theory/consent": "0.1.0",
15
- "@working-theory/content-adapters": "0.61.0",
16
- "@working-theory/content-projection": "0.61.0",
17
- "@working-theory/email": "0.61.0",
17
+ "@working-theory/content-adapters": "0.63.0",
18
+ "@working-theory/content-projection": "0.63.0",
19
+ "@working-theory/email": "0.63.0",
18
20
  "@working-theory/env": "0.0.0",
19
- "@working-theory/eslint-config": "0.61.0",
20
- "@working-theory/fumadocs-schema": "0.61.0",
21
+ "@working-theory/eslint-config": "0.63.0",
22
+ "@working-theory/fumadocs-schema": "0.63.0",
21
23
  "@working-theory/ids": "0.20.1",
22
- "@working-theory/jsonld": "0.61.0",
23
- "@working-theory/license": "0.61.0",
24
- "@working-theory/mcp-server": "0.61.0",
25
- "@working-theory/metadata": "0.61.0",
26
- "@working-theory/observability": "0.61.0",
27
- "@working-theory/page-renderer": "0.61.0",
24
+ "@working-theory/jsonld": "0.63.0",
25
+ "@working-theory/license": "0.63.0",
26
+ "@working-theory/mcp-server": "0.63.0",
27
+ "@working-theory/metadata": "0.63.0",
28
+ "@working-theory/observability": "0.63.0",
29
+ "@working-theory/page-renderer": "0.63.0",
28
30
  "@working-theory/plugin-mcp": "0.1.3",
29
- "@working-theory/schema": "0.61.0",
30
- "@working-theory/schema-pack-registry": "0.61.0",
31
- "@working-theory/schema-validator": "0.61.0",
32
- "@working-theory/sections-registry": "0.61.0",
33
- "@working-theory/site-config": "0.61.0",
34
- "@working-theory/spoke-checkout": "0.7.17",
35
- "@working-theory/stripe-client": "0.61.0",
36
- "@working-theory/templates": "0.61.0",
37
- "@working-theory/theme": "0.61.0",
38
- "@working-theory/ui": "0.61.0",
39
- "@working-theory/validation": "0.61.0",
40
- "@working-theory/web-i18n": "0.61.0",
41
- "@working-theory/admin": "0.15.0",
42
- "@working-theory/api-commerce": "0.1.15",
43
- "@working-theory/api-content-write": "0.9.0",
44
- "@working-theory/api-hub": "0.6.0",
45
- "@working-theory/api-multi-tenant": "0.3.1",
46
- "@working-theory/api-scheduling": "0.6.0",
47
- "@working-theory/api-signal-collectors": "0.6.1",
48
- "@working-theory/api-workspace": "0.9.0",
31
+ "@working-theory/schema": "0.63.0",
32
+ "@working-theory/schema-pack-registry": "0.63.0",
33
+ "@working-theory/schema-validator": "0.63.0",
34
+ "@working-theory/sections-registry": "0.63.0",
35
+ "@working-theory/site-config": "0.63.0",
36
+ "@working-theory/spoke-checkout": "0.7.19",
37
+ "@working-theory/stripe-client": "0.63.0",
38
+ "@working-theory/templates": "0.63.0",
39
+ "@working-theory/theme": "0.63.0",
40
+ "@working-theory/ui": "0.63.0",
41
+ "@working-theory/validation": "0.63.0",
42
+ "@working-theory/web-i18n": "0.63.0",
43
+ "@working-theory/admin": "0.16.1",
44
+ "@working-theory/api-commerce": "0.1.17",
45
+ "@working-theory/api-content-write": "0.10.1",
46
+ "@working-theory/api-hub": "0.6.2",
47
+ "@working-theory/api-multi-tenant": "0.3.3",
48
+ "@working-theory/api-scheduling": "0.6.2",
49
+ "@working-theory/api-signal-collectors": "0.6.3",
50
+ "@working-theory/api-workspace": "0.10.1",
49
51
  "@working-theory/billing-client": "0.0.0",
50
52
  "@working-theory/branding": "0.0.0",
51
53
  "@working-theory/license-client": "0.0.0",
52
54
  "@working-theory/license-manifest": "0.0.0",
53
- "@working-theory/mcp-scheduling": "0.4.2",
54
- "@working-theory/mcp-signal-collectors": "0.2.15",
55
- "@working-theory/mcp-workspace": "0.8.2",
55
+ "@working-theory/mcp-scheduling": "0.4.4",
56
+ "@working-theory/mcp-signal-collectors": "0.2.17",
57
+ "@working-theory/mcp-workspace": "0.9.1",
56
58
  "@working-theory/partner-session": "0.0.0",
57
59
  "@working-theory/preview-protocol": "0.0.0",
58
- "@working-theory/ui-commerce": "0.23.39",
59
- "@working-theory/ui-docs-blog": "0.23.39",
60
- "@working-theory/ui-scheduling": "0.25.13",
61
- "@working-theory/ui-signal-collectors": "0.29.2",
60
+ "@working-theory/ui-commerce": "0.63.0",
61
+ "@working-theory/ui-docs-blog": "0.63.0",
62
+ "@working-theory/ui-scheduling": "0.63.0",
63
+ "@working-theory/ui-signal-collectors": "0.63.0",
62
64
  "@working-theory/web": "0.0.0",
63
65
  "@working-theory/app-api": "1.0.0",
64
66
  "@working-theory/mcp": "0.0.0",
65
- "@working-theory/database": "0.61.0"
67
+ "@working-theory/database": "0.63.0"
66
68
  }