create-ailk 0.37.1 → 0.38.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 (230) 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 +18 -11
  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 +9 -15
  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 +67 -0
  26. package/dist/routes.d.ts +103 -0
  27. package/dist/routes.js +708 -0
  28. package/dist/site-manifest.js +1 -1
  29. package/dist/site-roster.d.ts +2 -1
  30. package/dist/site-roster.js +30 -8
  31. package/dist/spoke-checkout.d.ts +28 -27
  32. package/dist/spoke-checkout.js +71 -102
  33. package/dist/surfaces.d.ts +18 -0
  34. package/dist/surfaces.js +47 -282
  35. package/dist/sync-routes.d.ts +14 -1
  36. package/dist/sync-routes.js +86 -5
  37. package/dist/topology.d.ts +15 -1
  38. package/dist/topology.js +20 -4
  39. package/dist/update.d.ts +17 -2
  40. package/dist/update.js +480 -77
  41. package/package.json +3 -3
  42. package/templates/README.md +1 -1
  43. package/templates/apps/mcp/CLAUDE.md +5 -3
  44. package/templates/apps/web/CLAUDE.md +62 -20
  45. package/templates/apps/web/account.config.tsx +101 -0
  46. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +3 -161
  47. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +3 -139
  48. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +3 -406
  49. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +2 -190
  50. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +3 -182
  51. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +8 -420
  52. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
  53. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +8 -214
  54. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +8 -115
  55. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +2 -80
  56. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +8 -121
  57. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +3 -154
  58. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +7 -149
  59. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +3 -143
  60. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +3 -126
  61. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +8 -302
  62. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +2 -102
  63. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +3 -240
  64. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -131
  65. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +2 -24
  66. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +3 -60
  67. package/templates/apps/web/app/[locale]/layout.tsx +45 -28
  68. package/templates/apps/web/app/apple-icon.tsx +72 -0
  69. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
  70. package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
  71. package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
  72. package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
  73. package/templates/apps/web/app/og/route.tsx +155 -72
  74. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
  75. package/templates/apps/web/i18n/request.ts +44 -1
  76. package/templates/apps/web/jest.config.cjs +13 -1
  77. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
  78. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +70 -0
  79. package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
  80. package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
  81. package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
  82. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
  83. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
  84. package/templates/apps/web/lib/listings.tsx +2 -2
  85. package/templates/apps/web/lib/nav-label-keys.ts +16 -2
  86. package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
  87. package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
  88. package/templates/apps/web/lib/profile-back-link.ts +105 -32
  89. package/templates/apps/web/lib/served-pages.ts +95 -0
  90. package/templates/apps/web/lib/site-brand.tsx +3 -5
  91. package/templates/apps/web/messages/en.json +8 -684
  92. package/templates/apps/web/middleware.ts +3 -1
  93. package/templates/apps/web/next.config.mjs +27 -0
  94. package/templates/apps/web/package.json +1 -0
  95. package/templates/customizations.yaml +9 -0
  96. package/templates/package.json +3 -1
  97. package/templates/tools/lint-architecture.ts +164 -11
  98. package/versions.json +48 -47
  99. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
  100. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
  101. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
  102. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
  103. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
  104. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
  105. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
  106. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
  107. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
  108. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
  109. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
  110. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
  111. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
  112. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
  113. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
  114. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
  115. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
  116. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
  117. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
  118. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
  119. package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
  120. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
  121. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
  122. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
  123. package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
  124. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
  125. package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
  126. package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
  127. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
  128. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
  129. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
  130. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
  131. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
  132. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
  133. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
  134. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
  135. package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
  136. package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
  137. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
  138. package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
  139. package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
  140. package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
  141. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
  142. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
  143. package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
  144. package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
  145. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
  146. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
  147. package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
  148. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
  149. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
  150. package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
  151. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
  152. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
  153. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
  154. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
  155. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
  156. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
  157. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
  158. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
  159. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
  160. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
  161. package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
  162. package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
  163. package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
  164. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
  165. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
  166. package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
  167. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
  168. package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
  169. package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
  170. package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
  171. package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
  172. package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
  173. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
  174. package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
  175. package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
  176. package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
  177. package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
  178. package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
  179. package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
  180. package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
  181. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
  182. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
  183. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
  184. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
  185. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
  186. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
  187. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
  188. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
  189. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
  190. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
  191. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
  192. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
  193. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
  194. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
  195. package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
  196. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
  197. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
  198. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
  199. package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
  200. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
  201. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
  202. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
  203. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
  204. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
  205. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
  206. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
  207. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
  208. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
  209. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
  210. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
  211. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
  212. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
  213. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
  214. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
  215. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
  216. package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
  217. package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
  218. package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
  219. package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
  220. package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
  221. package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
  222. package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
  223. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
  224. package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
  225. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
  226. package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
  227. package/templates/apps/web/lib/account-config.ts +0 -678
  228. package/templates/apps/web/lib/checkout-config.ts +0 -16
  229. package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
  230. package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ailk",
3
- "version": "0.37.1",
3
+ "version": "0.38.0",
4
4
  "description": "Scaffolder for AI Launch Kit — `pnpm create ailk@latest <dir>` produces a starter repo consuming @working-theory/* from npm (per ADR 0007).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "tar": "^7.5.21"
29
29
  },
30
30
  "devDependencies": {
31
- "@working-theory/templates": "0.61.0",
32
- "@working-theory/schema": "0.61.0"
31
+ "@working-theory/schema": "0.62.0",
32
+ "@working-theory/templates": "0.62.0"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",
@@ -139,7 +139,7 @@ You need Postgres once you turn on one of these:
139
139
  | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140
140
  | **Auth** — `/sign-in`, `/sign-up`, `/account` | users, sessions, accounts |
141
141
  | **Lead inbox** — `/leads` | submitted leads, for you to review signed in, and newsletter signups. Without a database, lead capture emails each contact-form message to you instead (`RESEND_API_KEY` + `AILK_LEAD_NOTIFICATION_TO` + `AILK_LEAD_NOTIFICATION_FROM` on the API); with neither in production, `/contact` shows your `_site.mdx` `contactEmail` instead of the form. `/ailk:growth-ops database` walks you from no database to a working inbox. |
142
- | **Checkout returns** — `/purchase/success`, `/purchase/cancel` | the paid checkouts the Stripe webhook records. These pages serve only on a site licensed for commerce. |
142
+ | **Checkout returns** — `/purchase/success`, `/purchase/cancel` | the paid checkouts the Stripe webhook records. These pages serve only on a site carrying the commerce module and licensed for it. |
143
143
  | **`CONTENT_ADAPTER=database`** | pages authored in the Artifact store rather than in `content/*.mdx` |
144
144
 
145
145
  ### One command to get one
@@ -137,7 +137,7 @@ Every tool maps 1:1 to an `apps/api` endpoint. When you change a tool, change th
137
137
 
138
138
  - **22 in the `TOOLS` array / parity test**: the `TOOLS` array in
139
139
  `packages/metadata/src/mcp-tool-catalog.ts` defines 22 anonymous tools; the
140
- parity test counts that full array. It also holds the fifty-eight signed-in
140
+ parity test counts that full array. It also holds the sixty signed-in
141
141
  workspace tools (#3591; the content-suggestion pair `draft_page_suggestions`
142
142
  and `decide_page_suggestion` since #10218; the draft pair `save_draft` and
143
143
  `read_report` since #10336; the knowledge-base pair `read_knowledge` and
@@ -187,7 +187,7 @@ here. Spec: `docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md` D13–D16.
187
187
  - **apps/mcp checks only the key's shape.** The key is attached as the SDK's `req.auth` for that
188
188
  request alone and reaches a tool as `extra.authInfo.token`. apps/api is the one place it is
189
189
  checked, and its tenant guard and the caller's clamped role decide every answer.
190
- - **Fifty-eight tools (fifty-five plus three deprecated aliases), each a `twin`.** The catalog rows carry `surface: "workspace"`, `tier: "pro"`
190
+ - **Sixty tools (fifty-seven plus three deprecated aliases), each a `twin`.** The catalog rows carry `surface: "workspace"`, `tier: "pro"`
191
191
  and `modulesAnyOf` (the modules any one of which registers the tool — its twin route's gate):
192
192
  `get_agent_context`, (#9683) `get_workspace_knowledge` — twin of `GET
193
193
  /v1/workspaces/:workspaceId/knowledge`: the business's shown offerings, live magnets, listed
@@ -314,7 +314,9 @@ Example (lead routing):
314
314
  - Don't add a tool without the matching `apps/api` endpoint.
315
315
  - Don't put business logic in tool handlers — they're adapters.
316
316
 
317
- Last updated: 2026-11-08 — #11122 (D4, D5, D12): `list_meeting_types` loses `include` and its rows carry `visibility`, `providerEventTypeId`, `createdAt` and (manage view) `providerEditUrl`; `save_meeting_types`' two lists are exclusive; `list_appointments` takes `eventTypeId` — verified against `packages/metadata/src/mcp-tool-catalog.ts` and `tests/parity/api-parity/fixtures/site-wire.ts`.
317
+ Last updated: 2026-11-09 — #11275 unit E: `set_doc_class` and `write_memory` (`mcp-workspace`'s `knowledge_base.ts`, `content-edit` grant) twin `PUT …/knowledge-base/class` and `POST …/knowledge-base/memory` — set a doc's or a File's context class, and write a dated Memory entry or mark one stale; each takes its route's params and one flat `@working-theory/validation` body — the signed-in workspace surface is sixty tools — verified against `packages/metadata/src/mcp-tool-catalog.ts`, `packages-paid/mcp-workspace/src/index.ts` and `tests/parity/api-parity/kinds/site.ts`.
318
+
319
+ Prior: 2026-11-08 — #11122 (D4, D5, D12): `list_meeting_types` loses `include` and its rows carry `visibility`, `providerEventTypeId`, `createdAt` and (manage view) `providerEditUrl`; `save_meeting_types`' two lists are exclusive; `list_appointments` takes `eventTypeId` — verified against `packages/metadata/src/mcp-tool-catalog.ts` and `tests/parity/api-parity/fixtures/site-wire.ts`.
318
320
 
319
321
  Prior: 2026-11-06 — #10952 (D1–D6): `delete_language_item` (`mcp-workspace`'s `language.ts`) twins `DELETE …/language/:kind/:slug`, whose blanket agent refusal becomes the Live switch's `content-publish` gate — the signed-in workspace surface gains one tool — verified against `packages/metadata/src/mcp-tool-catalog.ts`, `packages-paid/mcp-workspace/src/index.ts`, `packages-paid/api-workspace/src/routes/workspaces/language.ts` and `tests/parity/api-parity/kinds/site.ts`.
320
322
 
@@ -412,7 +412,23 @@ The scheduling module's booking pages (#8843) read every meeting fact from
412
412
  the workspace — no content file, env var or deploy sits between a Meetings or
413
413
  Cal.com edit and the page.
414
414
 
415
- - **One builder.** `lib/meetings.tsx` reads `GET /v1/schedule/meetings`
415
+ - **Where they live (#11252, ADR 0040).** The pages, their index frame and
416
+ their builder ship in `@working-theory/ui-scheduling`
417
+ (`packages-paid/ui-scheduling/src/pages/`, `src/meetings.tsx`), with their
418
+ tests. This app's `app/[locale]/meet/` and `app/[locale]/private/` hold
419
+ only the four route files `create-ailk routes --write` generates from the
420
+ package's `routes.json` — each `// oss: false`, never hand-edited, pinned by
421
+ `routes --check` (the private index's `sitemap.test.ts` is this app's own
422
+ suite). The pages read the site through one typed file,
423
+ `scheduling.config.tsx` (`defineSchedulingConfig({ site })`: the locale
424
+ guard, the contact email, the site identity and the brand — the host seam,
425
+ no extension point), which the generated `/meet`, `/meet/<slug>` and
426
+ `/private` files pass in as `config`. The `schedule` strings ship in the
427
+ package (`schedulingMessages`), merged under this app's catalog by
428
+ `i18n/request.ts` through `lib/paid-sections.generated.ts`'s
429
+ `loadUiScheduling()`; `messages/en.json` keeps `schedule.bookLength` (the
430
+ flows results layout's key) and a site key there is an override.
431
+ - **One builder.** `meetings.tsx` reads `GET /v1/schedule/meetings`
416
432
  through `schedule.meetings()`, re-parses the body with `MeetingListSchema`
417
433
  and shares the result per server instance for 15 seconds (concurrent and
418
434
  failed reads too, the contact page's #8731 shape). Any failure is
@@ -422,9 +438,7 @@ Cal.com edit and the page.
422
438
  meeting page's booker (`meetingPageSections`: `scheduler-embed`, provider
423
439
  `cal`, month view). Every visible string is a `schedule` message.
424
440
  - **`/meet` and `/private`** both return `MeetingIndex`
425
- (`app/[locale]/meet/meeting-index.tsx` — beside the route, because it
426
- renders the paid `BookingProfileHeader`, which `architecture.yaml` admits
427
- only there): the back link alone (`Nav` `bar="bare"` `bareMark={false}`),
441
+ (`pages/meet/meeting-index.tsx` in the package): the back link alone (`Nav` `bar="bare"` `bareMark={false}`),
428
442
  the header's avatar and one H1, then the cards of that visibility. One
429
443
  meeting redirects to `/meet/<slug>`; none, or a failed read, shows the
430
444
  site's contact email — never a 404 or a 500. `/private` is
@@ -617,25 +631,47 @@ the generated checkout e2e workflow — is retired (#9142). `create-ailk
617
631
  sync-routes --apply` removes them from an existing spoke when they are still
618
632
  the copies create-ailk wrote, and names any it leaves.
619
633
 
620
- What a spoke that carries `commerce` still gets (#8748), kept current by
621
- `create-ailk update`; a hub, or a spoke without `commerce`, never gets them:
622
-
623
- - **The two return pages.** `app/[locale]/checkout/thank-you/page.tsx` and
624
- `app/[locale]/checkout/unavailable/page.tsx`. Both call `notFound()` unless
625
- `lib/topology.generated.ts`'s `TOPOLOGY` is `"spoke"`, so this monorepo's
626
- hub-shaped `apps/web` serves neither.
634
+ What a site that carries `commerce` gets (#8748, #11253); a site without
635
+ `commerce` gets none of it:
636
+
637
+ - **The four return pages, from the package.** `/checkout/thank-you`,
638
+ `/checkout/unavailable`, `/purchase/success` and `/purchase/cancel` ship in
639
+ `@working-theory/ui-commerce` (`packages-paid/ui-commerce/src/pages/`, with
640
+ their tests, ADR 0040). This app's `app/[locale]/checkout/` and
641
+ `app/[locale]/purchase/` hold only the four route files `create-ailk routes
642
+ --write` generates from the package's `routes.json` — each `// oss: false`,
643
+ never hand-edited, pinned by `routes --check`. The two checkout pages call
644
+ `notFound()` — in the page and in `generateMetadata` — unless the site's
645
+ topology is `"spoke"`, so this monorepo's hub-shaped `apps/web` serves
646
+ neither; the two purchase pages serve only while the licence holds the
647
+ `commerce` claim, read per request and fail-closed. A site holding the claim
648
+ without the module has no purchase pages (reversing #6084 D12): it adds them
649
+ with `create-ailk add-module commerce`, then the install and `routes --write`.
650
+ - **One typed config.** The pages read this site through
651
+ `commerce.config.tsx` (`defineCommerceConfig({ site })`: the topology, the
652
+ checkout stamp, `accountInviteHref`, `resolveCommerceClaim` and the
653
+ per-visitor limiter — the host seam, no extension point), which every
654
+ generated route passes in as `config` (the checkout pair's
655
+ `generateMetadata` too). The `checkoutThankYou`, `checkoutUnavailable` and
656
+ `purchase` strings ship in the package (`commerceMessages`), merged under
657
+ this app's catalog by `i18n/request.ts` through `loadUiCommerce()`; a key in
658
+ `messages/en.json` is an override.
627
659
  - **One data file.** `lib/checkout-config.ts` is the site's stamp,
628
- `checkoutConfig.site`, and nothing else: no import and no code.
629
- `create-ailk update` never rewrites it.
630
- - **One package reader.** The thank-you page may import
660
+ `checkoutConfig.site`, and nothing else: no import and no code. The commerce
661
+ bundle delivers it with the placeholder `example-site`, and on a spoke
662
+ create-ailk stamps that one line in place (a valid site value is kept, an
663
+ invalid one refused); `create-ailk update` never rewrites it. A hub carries
664
+ it unread.
665
+ - **One package reader.** The package's thank-you page may import
631
666
  `@working-theory/spoke-checkout` for `readPaidCheckoutEmail` alone
632
- (`architecture.yaml`, #8757 D13): it reads `session_id`, and for a paid
667
+ (`architecture.yaml` names `packages-paid/ui-commerce/src/pages/checkout/thank-you/page.tsx`,
668
+ #8757 D13); no file in this app may. It reads `session_id`, and for a paid
633
669
  session of this site under 24 hours old shows "Open your account" with the
634
670
  buyer's email (`accountInviteHref`), else the same link with no email. Each
635
- visitor gets 10 reads per 10 minutes (`src/lib/rate-limit.ts`); the page
636
- sends no referrer, renders dynamically and never touches a cookie. The read
637
- admits the spoke's `STRIPE_SECRET_KEY` from `process.env`; that key never
638
- sells.
671
+ visitor gets 10 reads per 10 minutes (`src/lib/rate-limit.ts`, through the
672
+ config); the page sends no referrer, renders dynamically and never touches a
673
+ cookie. The read admits the spoke's `STRIPE_SECRET_KEY` from `process.env`;
674
+ that key never sells.
639
675
  - **The billing action (a spoke that signs in through its hub).** create-ailk
640
676
  renders `app/[locale]/(authed)/account/billing/spoke-billing.action.ts`,
641
677
  which builds the package's billing reads from `checkoutConfig.site` and
@@ -660,6 +696,8 @@ A visitor's browser never calls the hub. Lead capture, newsletter signup, callba
660
696
 
661
697
  A site serves its docs at `/docs` unless `content/_site.mdx` sets a top-level `docsPath` (one to four lowercase kebab segments, leading slash, no trailing slash — e.g. `docsPath: /working-theory/docs`, #10041). The route never moves: it stays at `app/[locale]/docs/`, and every surface reads the one value through `lib/docs-path.ts` (`DOCS_PATH`, `toPublicDocsHref`).
662
698
 
699
+ - **Where the pages live (#11254, ADR 0040).** The `/docs` and `/blog` catch-alls ship in `@working-theory/ui-docs-blog` (`packages-paid/ui-docs-blog/src/pages/`), with their loaders — the runtime source and the two blog route adapters — and their tests. This app's `app/[locale]/docs/` and `app/[locale]/blog/` hold only the two route files `create-ailk routes --write` generates from the package's `routes.json` — each `// oss: false`, never hand-edited, pinned by `routes --check`. The site keeps what is built from its own content — `source.config.ts`, `lib/source.ts` (which hands the package's runtime source `DOCS_PATH`) and the codegen stub — and passes it in through one typed file, `docs-blog.config.tsx` (`defineDocsBlogConfig({ site })`: the two source resolvers, `DOCS_PATH`, `toPublicDocsHref` and `getOgImageUrl` — the host seam, no extension point), which both generated files pass to the page and to `generateMetadata` as `config`. The `docs` and `blog` strings ship in the package (`docsBlogMessages`), merged under this app's catalog by `i18n/request.ts` through `loadUiDocsBlog()`; a key in `messages/en.json` is an override.
700
+
663
701
  - **Build.** `next.config.mjs` reads `docsPath`, bakes it into `NEXT_PUBLIC_AILK_DOCS_PATH`, and fails the build naming the value when it breaks the pattern, starts with `api`, `og`, `v1` or an enabled locale, sits under `/docs`, shadows a `ROUTES` page (a `:param` segment matches any segment, so `/products/docs` is refused) or sits under a catch-all (`/blog/...`), or when this site's `lib/source.ts` does not set `baseUrl: DOCS_PATH` — a site with no docs-blog module, or one whose docs-blog files predate the setting. Links inside a doc's body are re-pointed only on a site that sets `docsPath`; there they render through `Link`, which forwards a fixed prop set, so a body anchor's `title` / `target` / `rel` are not kept.
664
702
  - **Request.** `middleware.ts` hands next-intl the internal `/docs/...` path for a request at or under `docsPath` (bare or locale-prefixed), so the browser keeps the public URL, and maps a redirect's `Location` and each hreflang `Link` entry back onto it. `/docs` and `/docs/...` answer with the site's 404 — rewritten to `/_ailk-docs-unmounted`, whose first segment is no locale, so the locale layout calls `notFound()`.
665
703
  - **Surfaces.** The docs sidebar, index and search index (both sources' `baseUrl`), the doc's breadcrumb, links inside a doc's body, every nav and footer entry at `/docs` (mapped at render in the locale layout; `nav-config.ts` is never edited), and the docs entries in `/sitemap.xml` and `/llms.txt` (`lib/docs-index.ts`, default locale only) all follow it. A site with no `docsPath` serves every URL exactly as before.
@@ -709,7 +747,11 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
709
747
  - Don't reach into `apps/api` or `apps/mcp` from `apps/web`. They're peer apps — talk via HTTP/MCP.
710
748
  - Don't commit images to `screenshots/` — only the `.gitkeep` is tracked.
711
749
 
712
- Last updated: 2026-11-08 — § The `(auth)` route group: a spoke's Security tab hosts the Password row and the hub does the sending — the spoke's `POST /api/hub-session/password` and `GET /api/hub-session/password/return`, the hub's `POST /api/auth/hub/password` and its sealed return ref (#11162, #11190) — verified against `app/api/hub-session/password/{route.ts,return/route.ts}`, `app/api/auth/hub/password/{route.ts,return.ts}` and `app/[locale]/(authed)/account/security/{page.tsx,security-source.ts}`.
750
+ Last updated: 2026-11-10 — § Where the docs live: the docs and blog pages and their loaders ship in `@working-theory/ui-docs-blog`, this app holds their two generated route files and `docs-blog.config.tsx`, and the `docs` and `blog` strings ship in the package (#11254) — verified against `packages-paid/ui-docs-blog/{routes.json,src/config.ts,src/pages/}`, `docs-blog.config.tsx`, `lib/source.ts` and `i18n/request.ts`.
751
+
752
+ Prior: 2026-11-10 — § Spoke checkout: the checkout and purchase return pages ship in `@working-theory/ui-commerce`, this app holds their generated route files and `commerce.config.tsx`, the strings ship in the package, the stamp is bundle-delivered and stamped in place on a spoke, and the purchase pair is module-carried (#11253) — verified against `packages-paid/ui-commerce/{routes.json,src/config.ts,src/pages/}`, `commerce.config.tsx`, `i18n/request.ts` and create-ailk's `spoke-checkout.ts`.
753
+
754
+ Prior: 2026-11-08 — § The `(auth)` route group: a spoke's Security tab hosts the Password row and the hub does the sending — the spoke's `POST /api/hub-session/password` and `GET /api/hub-session/password/return`, the hub's `POST /api/auth/hub/password` and its sealed return ref (#11162, #11190) — verified against `app/api/hub-session/password/{route.ts,return/route.ts}`, `app/api/auth/hub/password/{route.ts,return.ts}` and `app/[locale]/(authed)/account/security/{page.tsx,security-source.ts}`.
713
755
 
714
756
  Prior: 2026-11-07 — § The `(auth)` route group: a spoke's sign-in entry is the spoke's own form — the email route, Google's `provider_hint`, the purchase link's "Open my account", the billing Purchases list and One Tap with its CSP (#11096) — verified against `lib/hub-session/{spoke-sign-in.tsx,entry.ts,one-tap.tsx,session.ts}`, `app/api/hub-session/{email,open,one-tap}/` and `middleware.ts`.
715
757
 
@@ -0,0 +1,101 @@
1
+ /**
2
+ * account.config.tsx — this site's account configuration (ADR 0040 rule 4;
3
+ * #11219, #11227), the ONE typed file through which the site customizes the
4
+ * pages `@working-theory/account` ships. The route files `create-ailk routes`
5
+ * generates under `app/[locale]/(authed)/account/` import this default export
6
+ * and pass it to each page and layout that takes it as its `config` prop.
7
+ *
8
+ * The default export carries exactly the six extension points (rule 8). The
9
+ * base area's own contributions come from the package; a module appends its
10
+ * entries to the lists below, and this site appends its own Billing sections
11
+ * from `lib/site-contributions.ts` (#9401 D7). A misspelled key here fails
12
+ * `tsc` — `defineAccountConfig` is typed to its argument.
13
+ *
14
+ * `experimentKeys` lists the `experimentKey`s of the diagnostics this site
15
+ * runs (none in the template); the base `result` Inbox kind reads the same
16
+ * list, so it is declared once and passed to both.
17
+ *
18
+ * The named export `site` is the host's runtime-services seam (conductor
19
+ * ruling on #11219, option (a)): `next.config.mjs` aliases
20
+ * `@working-theory/account/site` to this file (and `jest.config.cjs` maps
21
+ * it), so the package's pages AND its `"use server"` actions — which no prop
22
+ * can reach — read the session, the request init, the sign-in setup, the
23
+ * brand and the Offerings reads from here. It is not a customization slot:
24
+ * its shape is `AccountSite`, fixed by the package, and a missing member
25
+ * fails `tsc`. It imports only `lib/` files every topology carries; the
26
+ * hub-only services reach `auth.ts` through the generated topology seam.
27
+ */
28
+ import { type AccountSite, defineAccountConfig } from "@working-theory/account";
29
+ import { baseForYouSources, baseInboxKinds, baseNewActions } from "@working-theory/account/contributions";
30
+ import { cookies } from "next/headers";
31
+
32
+ import { getActiveProviderIds, resetSendConfigured } from "./lib/auth-env";
33
+ import { consentPoliciesFor } from "./lib/consent-policies";
34
+ import { consentVisitorHeader, readConsentVisitor } from "./lib/consent-visitor";
35
+ import { hubSessionConfig } from "./lib/hub-session/config";
36
+ import { resealHubSession } from "./lib/hub-session/reseal";
37
+ import { formatMinorUnits, offeringsCheckoutHref } from "./lib/offerings-pricing";
38
+ import { readShownOfferings } from "./lib/pricing-page";
39
+ import { forwardedCookieInit } from "./lib/server-api";
40
+ import { SITE_NAME } from "./lib/site-brand";
41
+ import { siteBillingSections } from "./lib/site-contributions";
42
+ import { siteLogo } from "./lib/site-logo";
43
+ import {
44
+ loadPhoneApi,
45
+ loadSpokeBilling,
46
+ readOwnAccounts,
47
+ readPhoneStep,
48
+ readSession,
49
+ SIGN_IN_PATH,
50
+ SIGN_IN_PROVIDER,
51
+ SIGN_OUT_ENDPOINT,
52
+ TOPOLOGY,
53
+ } from "./lib/topology.generated";
54
+
55
+ const experimentKeys: readonly string[] = [];
56
+
57
+ export default defineAccountConfig({
58
+ experimentKeys,
59
+ inboxKinds: baseInboxKinds(experimentKeys),
60
+ settingsSections: [],
61
+ newActions: baseNewActions,
62
+ billingSections: siteBillingSections,
63
+ forYouSources: baseForYouSources,
64
+ });
65
+
66
+ // The topology constants are read through on every access, never copied at
67
+ // load, so the seam always answers what the generated file answers.
68
+ export const site = {
69
+ get topology() {
70
+ return TOPOLOGY;
71
+ },
72
+ get signInProvider() {
73
+ return SIGN_IN_PROVIDER;
74
+ },
75
+ get signInPath() {
76
+ return SIGN_IN_PATH;
77
+ },
78
+ get signOutEndpoint() {
79
+ return SIGN_OUT_ENDPOINT;
80
+ },
81
+ siteName: SITE_NAME,
82
+ siteLogo,
83
+ readSession,
84
+ readOwnAccounts,
85
+ readPhoneStep,
86
+ loadPhoneApi,
87
+ loadSpokeBilling,
88
+ forwardedCookieInit,
89
+ resealHubSession,
90
+ activeProviderIds: getActiveProviderIds,
91
+ hubOrigin: () => hubSessionConfig()?.hubOrigin ?? null,
92
+ resetSendConfigured,
93
+ consentPoliciesFor,
94
+ async consentVisitorHeaders() {
95
+ const visitorId = readConsentVisitor(await cookies());
96
+ return visitorId ? consentVisitorHeader(visitorId) : {};
97
+ },
98
+ readShownOfferings,
99
+ formatMinorUnits,
100
+ offeringsCheckoutHref,
101
+ } satisfies AccountSite;
@@ -1,161 +1,3 @@
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
- }
1
+ // Generated by create-ailk routes from @working-theory/account 0.61.0 — do not edit.
2
+ export { default } from "@working-theory/account/appointments/[slug]/page";
3
+ export { generateMetadata } from "@working-theory/account/appointments/[slug]/page";
@@ -1,139 +1,3 @@
1
- /**
2
- * /[locale]/account/appointments — Library › Appointments (#11154).
3
- *
4
- * RSC, inside the account layout's SignedInShell (the rail's Appointments
5
- * row is selected here). Lists exactly the types the member read serves
6
- * (`loadMeetingTypes`) in the Admin Appointments list's layout
7
- * (`AccountListFrame`, the member twin of `MeetingsListPage`): a table of
8
- * Title · Duration · Price with a chevron per row, each row opening the
9
- * type's booking page, `/account/appointments/<slug>`. No facet group: a
10
- * member has nothing to narrow by, so the second column reads the All count
11
- * alone. Below `md` the table becomes the phone row list, each row's caption
12
- * "<duration> · <price>".
13
- *
14
- * A 404 read (no scheduling module, or a spoke route the hub does not admit)
15
- * and an empty offer both show the frame's empty line; any other failed read
16
- * renders the error row with Retry and no frame (spec 7423 D12). Nothing
17
- * here tests the topology: the same file serves a single site and a
18
- * hub-mode spoke.
19
- */
20
-
21
- import {
22
- AccountListFrame,
23
- type AccountListFrameRow,
24
- } from "@working-theory/templates/account";
25
- import { Heading, Text } from "@working-theory/ui/primitives";
26
- import type { MemberMeetingType } from "@working-theory/validation";
27
- import type { Metadata } from "next";
28
- import { getTranslations } from "next-intl/server";
29
- import type { ReactElement } from "react";
30
-
31
- import { accountSession, logReadFailure } from "../account-data";
32
- import { ErrorRow } from "../error-row";
33
-
34
- import {
35
- appointmentHref,
36
- formatTypePrice,
37
- loadMeetingTypes,
38
- } from "./appointments-data";
39
-
40
- interface Props {
41
- params: Promise<{ locale: string }>;
42
- }
43
-
44
- export async function generateMetadata({ params }: Props): Promise<Metadata> {
45
- const { locale } = await params;
46
- const t = await getTranslations({ locale, namespace: "account" });
47
- return { title: t("appointments.title") };
48
- }
49
-
50
- export default async function AccountAppointmentsPage({
51
- params,
52
- }: Props): Promise<ReactElement> {
53
- const { locale } = await params;
54
- const t = await getTranslations({ locale, namespace: "account" });
55
- const session = await accountSession(locale);
56
-
57
- const heading = (
58
- <>
59
- <Heading level={1} visual={2}>
60
- {t("appointments.title")}
61
- </Heading>
62
- <Text as="p" variant="body-sm" tone="muted" className="mt-block-tight">
63
- {t("appointments.lead")}
64
- </Text>
65
- </>
66
- );
67
-
68
- // Unreachable behind the (authed) gate, which renders the sign-in gate in
69
- // this page's place — but the page still renders in parallel with it, so
70
- // no `notFound()` here (the Artifacts page's rule): the heading alone.
71
- if (!session) {
72
- return (
73
- <div className="max-w-3xl py-8" data-testid="appointments">
74
- {heading}
75
- </div>
76
- );
77
- }
78
-
79
- let types: MemberMeetingType[] | null;
80
- try {
81
- types = await loadMeetingTypes(session.ctx);
82
- } catch (err) {
83
- logReadFailure("appointments", err);
84
- types = null;
85
- }
86
-
87
- if (types === null) {
88
- return (
89
- <div className="max-w-3xl py-8" data-testid="appointments">
90
- {heading}
91
- <ErrorRow
92
- className="mt-block-loose"
93
- message={t("appointments.error")}
94
- retryLabel={t("appointments.retry")}
95
- />
96
- </div>
97
- );
98
- }
99
-
100
- const row = (type: MemberMeetingType): AccountListFrameRow => {
101
- const duration = t("appointments.duration", {
102
- minutes: type.durationMinutes,
103
- });
104
- const price = formatTypePrice(type.price, locale, t("appointments.free"));
105
- return {
106
- id: type.slug,
107
- title: type.title,
108
- href: appointmentHref(locale, type.slug),
109
- caption: `${duration} · ${price}`,
110
- cells: { duration, price },
111
- };
112
- };
113
-
114
- return (
115
- <AccountListFrame
116
- title={t("appointments.title")}
117
- lead={t("appointments.lead")}
118
- glyph="calendar-clock"
119
- all={{ label: t("appointments.all") }}
120
- columns={[
121
- { key: "title", header: t("appointments.columns.title") },
122
- {
123
- key: "duration",
124
- header: t("appointments.columns.duration"),
125
- width: "1/6",
126
- },
127
- { key: "price", header: t("appointments.columns.price"), width: "1/6" },
128
- ]}
129
- rows={types.map(row)}
130
- chevron
131
- labels={{
132
- nav: t("appointments.facets"),
133
- table: t("appointments.title"),
134
- empty: t("appointments.empty"),
135
- }}
136
- testIdPrefix="appointments"
137
- />
138
- );
139
- }
1
+ // Generated by create-ailk routes from @working-theory/account 0.61.0 — do not edit.
2
+ export { default } from "@working-theory/account/appointments/page";
3
+ export { generateMetadata } from "@working-theory/account/appointments/page";