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
@@ -1,61 +0,0 @@
1
- /**
2
- * The account area's sign-up agreement gate (#8765 D7, spec
3
- * docs/specs/8765-sign-up-refuses-without-the-spec.md).
4
- *
5
- * `outstandingAgreements(ctx)` is the one read the layout and the Inbox
6
- * page share: `GET /v1/consent/account` for the caller, `cache()`d per
7
- * request (keyed on the context `accountSession`, itself cached, hands
8
- * both). The layout shows the interstitial in place of the account while
9
- * it answers anything; the Inbox page awaits it before any loader and
10
- * renders nothing meanwhile, because the App Router renders a page beside
11
- * its layout even when the layout never renders it — and the Inbox's
12
- * `member.messages` read stamps `readAt`.
13
- *
14
- * `[]` when none is outstanding (the read answered `complete: true`, or an
15
- * older hub answered 404). It fails closed (SEC-8765-C): any other answer —
16
- * a thrown read, a 401, 403, 429 or 5xx — is the registry's own agreements
17
- * from the same constant the API reads (#8438 C1), logged `read_failed`.
18
- */
19
-
20
- import { consent } from "@working-theory/api-client";
21
- import type { AccountContext } from "@working-theory/templates/account";
22
- import {
23
- resolveConsentStatement,
24
- SITE_CONSENT_CONFIG_DEFAULTS,
25
- signUpAgreements,
26
- } from "@working-theory/validation";
27
- import { cache } from "react";
28
-
29
- import type { AgreementsInterstitialAgreement } from "./agreements-prompt";
30
-
31
- export const outstandingAgreements = cache(
32
- async (ctx: AccountContext): Promise<AgreementsInterstitialAgreement[]> => {
33
- try {
34
- const res = await consent.accountAgreements(ctx.init, {
35
- locale: ctx.locale,
36
- });
37
- if (res.ok) {
38
- if (res.body.complete) return [];
39
- return res.body.agreements
40
- .filter((agreement) => !agreement.current)
41
- .map(({ id, statement, acceptedVersion }) => ({
42
- id,
43
- statement,
44
- acceptedVersion,
45
- }));
46
- }
47
- if (res.status === 404) return [];
48
- } catch {
49
- // Falls through to the registry's own agreements below.
50
- }
51
- console.error("[account]", {
52
- event: "account-agreements",
53
- outcome: "read_failed",
54
- });
55
- return signUpAgreements(SITE_CONSENT_CONFIG_DEFAULTS).map((purpose) => ({
56
- id: purpose.id,
57
- statement: resolveConsentStatement(purpose, ctx.locale).statement,
58
- acceptedVersion: null,
59
- }));
60
- },
61
- );
@@ -1,184 +0,0 @@
1
- "use client"; // Accept calls a Server Action then refreshes the router; Sign out is the frame's client hook
2
-
3
- /**
4
- * AgreementsInterstitial — the full-page sign-up-agreement ask (#8765 D7,
5
- * spec docs/specs/8765-sign-up-refuses-without-the-spec.md; replaces the
6
- * Inbox's `AgreementsPrompt` card, D8).
7
- *
8
- * The account layout renders this IN PLACE of `AccountFrame` and its
9
- * children whenever `GET /v1/consent/account` answers `complete: false`, or
10
- * fails closed on any read but a 2xx or an older hub's 404 (SEC-8765-C), so no
11
- * account page, rail, Inbox or For-you panel loads behind it. The file keeps
12
- * its name because `create-ailk`'s `surfaces.ts` syncs it by path.
13
- *
14
- * - One `h1`: the "updated" title when any agreement shown has an accepted
15
- * (older) version, else the "new" one — then the lead line.
16
- * - Each statement through `ConsentStatement`, its `[Label](key)` tokens
17
- * linked by `consentPoliciesFor(locale)` (D9) — the three destinations
18
- * `/contact` links (#8761).
19
- * - Accept posts every id through `acceptAccountAgreementsAction`, then
20
- * refreshes, so the layout's next read loads the account; a failed write
21
- * shows the error line and leaves the page as it is.
22
- * - Sign out is always there (D1's "never blocked"): `useAccountSignOut`,
23
- * the frame's own Log out.
24
- *
25
- * The wrapper carries the account area's `data-ailk-shell` marker, so the
26
- * page draws in the same app tokens as the account it stands in for.
27
- */
28
-
29
- import { ConsentStatement } from "@working-theory/ui/blocks";
30
- import {
31
- Button,
32
- Heading,
33
- InlineMessage,
34
- Text,
35
- } from "@working-theory/ui/primitives";
36
- import { useRouter } from "next/navigation";
37
- import { useState, type ReactElement } from "react";
38
-
39
- import { consentPoliciesFor } from "../../../../lib/consent-policies";
40
-
41
- import { useAccountSignOut } from "./account-frame";
42
- import { acceptAccountAgreementsAction } from "./agreements-actions";
43
-
44
- /** One sign-up agreement the person has not accepted at its current version. */
45
- export interface AgreementsInterstitialAgreement {
46
- id: string;
47
- /** The resolved statement, `[Label](key)` tokens included. */
48
- statement: string;
49
- /** The version last accepted, or `null` when never accepted. */
50
- acceptedVersion: number | null;
51
- }
52
-
53
- export interface AgreementsInterstitialLabels {
54
- titleNew: string;
55
- titleUpdated: string;
56
- lead: string;
57
- accept: string;
58
- signOut: string;
59
- error: string;
60
- /** Shown when a hub sign-out is refused or fails (#8465). */
61
- signOutFailed: string;
62
- }
63
-
64
- export interface AgreementsInterstitialProps {
65
- locale: string;
66
- agreements: AgreementsInterstitialAgreement[];
67
- labels: AgreementsInterstitialLabels;
68
- /** The seam's `SIGN_OUT_ENDPOINT`, as the frame takes it (#8465). */
69
- signOutEndpoint?: string | null;
70
- /** Where a hub sign-out lands; defaults to the site home. */
71
- signInHref?: string;
72
- }
73
-
74
- export function AgreementsInterstitial({
75
- locale,
76
- agreements,
77
- labels,
78
- signOutEndpoint,
79
- signInHref,
80
- }: AgreementsInterstitialProps): ReactElement {
81
- const router = useRouter();
82
- const { onSignOut, signOutFailed } = useAccountSignOut({
83
- locale,
84
- signOutEndpoint,
85
- signInHref,
86
- });
87
- const [pending, setPending] = useState(false);
88
- const [error, setError] = useState(false);
89
- const policies = consentPoliciesFor(locale);
90
-
91
- const title = agreements.some(
92
- (agreement) => agreement.acceptedVersion !== null,
93
- )
94
- ? labels.titleUpdated
95
- : labels.titleNew;
96
-
97
- async function accept(): Promise<void> {
98
- setPending(true);
99
- setError(false);
100
- try {
101
- const result = await acceptAccountAgreementsAction(
102
- agreements.map((agreement) => agreement.id),
103
- );
104
- if (result.ok) {
105
- router.refresh();
106
- return;
107
- }
108
- } catch {
109
- // Falls through to the error line below.
110
- }
111
- setError(true);
112
- setPending(false);
113
- }
114
-
115
- return (
116
- <div className="contents" data-ailk-shell="account">
117
- <main
118
- id="main"
119
- className="flex min-h-screen items-center justify-center bg-bg px-4 py-section text-fg"
120
- data-testid="account-agreements-interstitial"
121
- >
122
- <div className="flex w-full max-w-measure flex-col gap-6">
123
- <div className="flex flex-col gap-2">
124
- <Heading level={1} visual={2}>
125
- {title}
126
- </Heading>
127
- <Text as="p" tone="muted">
128
- {labels.lead}
129
- </Text>
130
- </div>
131
-
132
- <div className="flex flex-col gap-3">
133
- {agreements.map((agreement) => (
134
- <span
135
- key={agreement.id}
136
- data-testid={`account-agreements-statement-${agreement.id}`}
137
- >
138
- <ConsentStatement
139
- statement={agreement.statement}
140
- policies={policies}
141
- />
142
- </span>
143
- ))}
144
- </div>
145
-
146
- {error ? (
147
- <InlineMessage
148
- variant="error"
149
- data-testid="account-agreements-error"
150
- >
151
- {labels.error}
152
- </InlineMessage>
153
- ) : null}
154
- {signOutFailed ? (
155
- <InlineMessage variant="error" data-testid="account-sign-out-error">
156
- {labels.signOutFailed}
157
- </InlineMessage>
158
- ) : null}
159
-
160
- <div className="flex flex-col gap-3 md:flex-row">
161
- <Button
162
- type="button"
163
- size="big"
164
- disabled={pending}
165
- onClick={() => void accept()}
166
- data-testid="account-agreements-accept"
167
- >
168
- {labels.accept}
169
- </Button>
170
- <Button
171
- type="button"
172
- variant="ghost"
173
- size="big"
174
- onClick={onSignOut}
175
- data-testid="account-agreements-sign-out"
176
- >
177
- {labels.signOut}
178
- </Button>
179
- </div>
180
- </div>
181
- </main>
182
- </div>
183
- );
184
- }
@@ -1,161 +0,0 @@
1
- /**
2
- * /[locale]/account/appointments/[slug] — one type's booking page for the
3
- * signed-in member (#11154).
4
- *
5
- * RSC, inside the account layout's SignedInShell. Built the way
6
- * `/meet/[slug]` is: one centred H1 ("Schedule a <title> meeting"), Cal.com's
7
- * inline booker (the `scheduler-embed` section, provider `cal`, month view,
8
- * the tight gap) and "← All appointments" under it — but for the member: the
9
- * verified email and the name from the session ride into the booker as the
10
- * section's `prefill` (`CalSchedulerEmbed`'s prefill prop, which Cal.com's
11
- * booking form opens with already filled), so the member retypes neither,
12
- * and the booking lands on the member's Person by that email — the Inbox's
13
- * Scheduled tab and the Admin's Bookings.
14
- *
15
- * Who may book what is the member read's call (`loadMeetingTypes`): a slug
16
- * it does not serve — a type switched Off, taken off the clients list, or
17
- * never offered — answers "This appointment type is no longer offered.",
18
- * never a public booking and never a redirect to `/meet`. The member read's
19
- * `calLink` is the type's Cal.com link (#11154); a type without one says
20
- * the page could not load, with Retry.
21
- *
22
- * A segment outside the slug grammar, or carrying a `.`, is `notFound()`
23
- * before any read (`isTypePath`). No session is a not-found, as the artifact
24
- * page's is. The embed's own strings are Cal.com's; every other string is an
25
- * `account.appointments` message.
26
- */
27
-
28
- import { localeHref } from "@working-theory/ui";
29
- import { Container, Heading, Link, Text } from "@working-theory/ui/primitives";
30
- import { SectionRenderer } from "@working-theory/ui/sections";
31
- import type {
32
- MemberMeetingType,
33
- PageSection,
34
- } from "@working-theory/validation";
35
- import type { Metadata } from "next";
36
- import { notFound } from "next/navigation";
37
- import { getTranslations } from "next-intl/server";
38
- import type { ReactElement, ReactNode } from "react";
39
-
40
- import { accountSession, logReadFailure } from "../../account-data";
41
- import { ErrorRow } from "../../error-row";
42
- import {
43
- isTypePath,
44
- loadMeetingTypes,
45
- } from "../appointments-data";
46
-
47
- interface Props {
48
- params: Promise<{ locale: string; slug: string }>;
49
- }
50
-
51
- /**
52
- * The booker, pre-bound to the member: the type's Cal.com link with the
53
- * session's verified email and name as the section's `prefill`. The section
54
- * shape is `lib/meetings.tsx`'s `meetingPageSections` (provider `cal`, month
55
- * view, the tight gap), which this base file does not import (the module's own).
56
- */
57
- export function memberBookerSection(
58
- slug: string,
59
- calLink: string,
60
- user: { name: string | null; email: string },
61
- ): PageSection {
62
- return {
63
- id: `appointment-${slug}`,
64
- type: "scheduler-embed",
65
- data: {
66
- provider: "cal",
67
- calLink,
68
- prefill: { email: user.email, ...(user.name ? { name: user.name } : {}) },
69
- layout: "month_view",
70
- gapAbove: "tight",
71
- },
72
- };
73
- }
74
-
75
- export async function generateMetadata({ params }: Props): Promise<Metadata> {
76
- const { locale } = await params;
77
- const t = await getTranslations({ locale, namespace: "account" });
78
- return { title: t("appointments.title") };
79
- }
80
-
81
- export default async function AccountAppointmentPage({
82
- params,
83
- }: Props): Promise<ReactElement> {
84
- const { locale, slug } = await params;
85
- if (!isTypePath(slug)) notFound();
86
- const t = await getTranslations({ locale, namespace: "account" });
87
- const session = await accountSession(locale);
88
- if (!session) notFound();
89
-
90
- const frame = (heading: string, body: ReactNode): ReactElement => (
91
- <div className="py-8" data-testid="appointment">
92
- <Container className="text-center">
93
- <Heading level={1} visual={2}>
94
- {heading}
95
- </Heading>
96
- </Container>
97
- {body}
98
- <Container className="pb-section pt-block-tight text-center">
99
- <Link
100
- href={localeHref(locale, "/account/appointments")}
101
- variant="nav"
102
- data-testid="appointment-back"
103
- >
104
- {t("appointments.back")}
105
- </Link>
106
- </Container>
107
- </div>
108
- );
109
-
110
- let types: MemberMeetingType[];
111
- try {
112
- types = await loadMeetingTypes(session.ctx);
113
- } catch (err) {
114
- logReadFailure("appointments", err);
115
- return frame(
116
- t("appointments.title"),
117
- <Container size="sm" className="mt-block-loose">
118
- <ErrorRow
119
- message={t("appointments.typeError")}
120
- retryLabel={t("appointments.retry")}
121
- />
122
- </Container>,
123
- );
124
- }
125
-
126
- const type = types.find((candidate) => candidate.slug === slug);
127
- if (!type) {
128
- return frame(
129
- t("appointments.title"),
130
- <Container size="sm" className="mt-block-tight text-center">
131
- <Text as="p" data-testid="appointment-not-offered">
132
- {t("appointments.notOffered")}
133
- </Text>
134
- </Container>,
135
- );
136
- }
137
-
138
- const heading = t("appointments.bookHeading", {
139
- title: type.title.toLocaleLowerCase(locale),
140
- });
141
- const calLink = type.calLink ?? null;
142
- if (calLink === null) {
143
- return frame(
144
- heading,
145
- <Container size="sm" className="mt-block-loose">
146
- <ErrorRow
147
- message={t("appointments.typeError")}
148
- retryLabel={t("appointments.retry")}
149
- />
150
- </Container>,
151
- );
152
- }
153
-
154
- return frame(
155
- heading,
156
- <SectionRenderer
157
- sections={[memberBookerSection(slug, calLink, session.ctx.user)]}
158
- locale={locale}
159
- />,
160
- );
161
- }