create-ailk 0.37.0 → 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 (232) hide show
  1. package/README.md +149 -2
  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 +7 -2
  6. package/dist/add-route.js +28 -13
  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 +28 -1
  36. package/dist/sync-routes.js +144 -11
  37. package/dist/template-record.d.ts +11 -0
  38. package/dist/template-record.js +18 -0
  39. package/dist/topology.d.ts +15 -1
  40. package/dist/topology.js +20 -4
  41. package/dist/update.d.ts +31 -2
  42. package/dist/update.js +627 -99
  43. package/package.json +3 -3
  44. package/templates/README.md +1 -1
  45. package/templates/apps/mcp/CLAUDE.md +5 -3
  46. package/templates/apps/web/CLAUDE.md +62 -20
  47. package/templates/apps/web/account.config.tsx +101 -0
  48. package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +3 -161
  49. package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +3 -139
  50. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +3 -406
  51. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +2 -190
  52. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +3 -182
  53. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +8 -420
  54. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
  55. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +8 -214
  56. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +8 -115
  57. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +2 -80
  58. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +8 -121
  59. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +3 -154
  60. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +7 -149
  61. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +3 -143
  62. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +3 -126
  63. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +8 -302
  64. package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +2 -102
  65. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +3 -240
  66. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -131
  67. package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +2 -24
  68. package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +3 -60
  69. package/templates/apps/web/app/[locale]/layout.tsx +45 -28
  70. package/templates/apps/web/app/apple-icon.tsx +72 -0
  71. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
  72. package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
  73. package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
  74. package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
  75. package/templates/apps/web/app/og/route.tsx +155 -72
  76. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
  77. package/templates/apps/web/i18n/request.ts +44 -1
  78. package/templates/apps/web/jest.config.cjs +13 -1
  79. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
  80. package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +70 -0
  81. package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
  82. package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
  83. package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
  84. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
  85. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
  86. package/templates/apps/web/lib/listings.tsx +2 -2
  87. package/templates/apps/web/lib/nav-label-keys.ts +16 -2
  88. package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
  89. package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
  90. package/templates/apps/web/lib/profile-back-link.ts +105 -32
  91. package/templates/apps/web/lib/served-pages.ts +95 -0
  92. package/templates/apps/web/lib/site-brand.tsx +3 -5
  93. package/templates/apps/web/messages/en.json +8 -684
  94. package/templates/apps/web/middleware.ts +3 -1
  95. package/templates/apps/web/next.config.mjs +27 -0
  96. package/templates/apps/web/package.json +1 -0
  97. package/templates/customizations.yaml +9 -0
  98. package/templates/package.json +3 -1
  99. package/templates/tools/lint-architecture.ts +164 -11
  100. package/versions.json +48 -47
  101. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
  102. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
  103. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
  104. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
  105. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
  106. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
  107. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
  108. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
  109. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
  110. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
  111. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
  112. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
  113. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
  114. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
  115. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
  116. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
  117. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
  118. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
  119. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
  120. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
  121. package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
  122. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
  123. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
  124. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
  125. package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
  126. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
  127. package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
  128. package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
  129. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
  130. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
  131. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
  132. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
  133. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
  134. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
  135. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
  136. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
  137. package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
  138. package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
  139. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
  140. package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
  141. package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
  142. package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
  143. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
  144. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
  145. package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
  146. package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
  147. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
  148. package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
  149. package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
  150. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
  151. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
  152. package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
  153. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
  154. package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
  155. package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
  156. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
  157. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
  158. package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
  159. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
  160. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
  161. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
  162. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
  163. package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
  164. package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
  165. package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
  166. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
  167. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
  168. package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
  169. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
  170. package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
  171. package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
  172. package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
  173. package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
  174. package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
  175. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
  176. package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
  177. package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
  178. package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
  179. package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
  180. package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
  181. package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
  182. package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
  183. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
  184. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
  185. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
  186. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
  187. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
  188. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
  189. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
  190. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
  191. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
  192. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
  193. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
  194. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
  195. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
  196. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
  197. package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
  198. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
  199. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
  200. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
  201. package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
  202. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
  203. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
  204. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
  205. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
  206. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
  207. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
  208. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
  209. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
  210. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
  211. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
  212. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
  213. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
  214. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
  215. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
  216. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
  217. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
  218. package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
  219. package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
  220. package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
  221. package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
  222. package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
  223. package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
  224. package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
  225. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
  226. package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
  227. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
  228. package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
  229. package/templates/apps/web/lib/account-config.ts +0 -678
  230. package/templates/apps/web/lib/checkout-config.ts +0 -16
  231. package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
  232. package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
@@ -49,7 +49,7 @@ export const HUB_GATED_ROUTES = {
49
49
  };
50
50
  /**
51
51
  * The API origin names `apps/web` reads, in step with `apiOriginConfigured()`
52
- * in `apps/web/app/[locale]/flows/[slug]/magnet-page.tsx`.
52
+ * in `packages-paid/ui-signal-collectors/src/pages/flows/[slug]/served-flow.ts`.
53
53
  */
54
54
  export const HUB_ORIGIN_ENV_NAMES = ["AILK_API_URL", "NEXT_PUBLIC_AILK_API_URL", "NEXT_PUBLIC_API_URL"];
55
55
  /**
@@ -134,13 +134,17 @@ export function assessRouteStatus(input) {
134
134
  return assessReachable(input.route, input.hops, input.status);
135
135
  }
136
136
  /**
137
- * A `CLAIM_GATED_ROUTES` entry: it must be in the route table (a missing one
138
- * is stale) and answer exactly 404.
137
+ * A `CLAIM_GATED_ROUTES` entry: it must answer exactly 404. Its page ships in
138
+ * a page package (`@working-theory/ui-commerce`, #11253), so a leg that does
139
+ * not carry that package (`carried: false`) has no such route and passes;
140
+ * one that does must list it in the route table (a missing one is stale).
139
141
  */
140
142
  export function assessClaimGatedRoute(input) {
141
- const { route, routeTable, hops, status } = input;
143
+ const { route, routeTable, carried, hops, status } = input;
142
144
  const claim = CLAIM_GATED_ROUTES[route];
143
145
  if (!routeTable.some((r) => (r.replace("/[locale]", "") || "/") === route)) {
146
+ if (!carried)
147
+ return { ok: true, reason: "not served: the module is not carried" };
144
148
  return { ok: false, reason: `${route} -> stale CLAIM_GATED_ROUTES entry: not in the route table` };
145
149
  }
146
150
  if (hops.length > 0 || status !== 404) {
@@ -1,4 +1,4 @@
1
- import { type LanguageImportResult } from "./language-import.js";
1
+ import { type LanguageImportResult, type TopicSeedReport } from "./language-import.js";
2
2
  import { type ImportMdxResult, type MdxAdapterModule } from "./lib/import-mdx.js";
3
3
  /** A refusal the CLI exits 2 on, thrown before any request is sent. */
4
4
  export declare class MigrateContentRefusedError extends Error {
@@ -14,6 +14,8 @@ export interface MigrateContentOptions {
14
14
  apiUrl?: string | undefined;
15
15
  /** `--workspace`. */
16
16
  workspaceId?: string | undefined;
17
+ /** `--language-seed`: a Language seed file whose `topics[]` become Topics (lang-topic-fields). */
18
+ languageSeed?: string | undefined;
17
19
  /** Injectable for tests; defaults to `process.env`. */
18
20
  env?: NodeJS.ProcessEnv;
19
21
  /** Injectable for tests; defaults to the site's installed adapter. */
@@ -39,13 +41,15 @@ export declare function migrateContent(opts: MigrateContentOptions): Promise<{
39
41
  result: ImportMdxResult;
40
42
  exitCode: 0 | 1;
41
43
  language?: LanguageImportResult;
44
+ topics?: TopicSeedReport;
42
45
  }>;
43
46
  export interface MigrateContentArgs {
44
47
  target: string | undefined;
45
48
  apply: boolean;
46
49
  apiUrl: string | undefined;
47
50
  workspaceId: string | undefined;
51
+ languageSeed: string | undefined;
48
52
  help: boolean;
49
53
  }
50
- export declare const MIGRATE_CONTENT_HELP = "create-ailk migrate-content \u2014 import an existing site's pages into its workspace.\n\nUsage:\n AILK_AGENT_KEY=<key> create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>]\n\nArguments:\n <dir> The site. Defaults to the current dir.\n\nOptions:\n --apply Write the pages. Without it the command reads the\n workspace, prints what it would do, and writes\n nothing.\n --api-url <origin> The API origin that holds the workspace \u2014 on a\n spoke, its hub's. Else AILK_API_URL. https: only\n (http: on localhost or 127.0.0.1).\n --workspace <wksp_id> The workspace the pages are written to. Else\n AILK_WORKSPACE_ID.\n -h, --help Show this help.\n\nEach content/en/<Type>/<slug>.mdx page (and each legacy\ncontent/<Type>/<slug>.mdx) is written to the workspace as a draft through\nthe API's content routes, with the agent key, which is read from\nAILK_AGENT_KEY only and needs the content-edit grant. Nothing is published,\nso the live site does not change. The site needs no .ailk-site-manifest.json\nand may be a spoke; its dependencies must be installed. A page whose\nfrontmatter carries sections is converted: its words are written to the\npage's Markdown and its sections to its layout.\n\nEach FAQ item and glossary-index term becomes one Language item of its kind,\nset Live when the run creates it, and its section pins the items in the\norder the file lists them. A question on several pages is one item, with\nthe FAQ page's words (the glossary page's, for a term). Lines prefixed\nlanguage: report each item, and each page the database read will not show\nas its file does. An API with no Language collection leaves them inline.\n\nWhen the site has apps/web/content, each blog post and docs page in it is\nwritten too: apps/web/content/en/blog/<slug>.mdx (or <slug>/index.mdx) as a\nBlogPosting, or one series down, blog/<series>/<post>.mdx, as a BlogPosting\nwhose parent is the series; the same under docs as a DocsDetail, and each\ndirectory's own index.mdx as its BlogList or DocsList index. A file the walk\nskips is listed with the rule it failed. Their lines are prefixed\neditorial: \u2014 each outcome's root is content or editorial.\n\nA dry run prints create, update, unchanged, skipped or failed per page. It\ncannot see a write the API would refuse at --apply (a conflict or a server\nerror), nor a layout change on a page whose words did not change, and a\npage whose content fails its page type is planned and saved\nwith errors the editor shows, not failed. --apply prints created, updated,\nunchanged, skipped or failed per page, so a re-run is safe. Exit 0 when no\npage failed, 1 when any did, 2 on a refusal (nothing is sent).\n\nEvery page is written with a live-source mark: its words already ship on the\nlive site, so the hub lists a heading the page type's template asks for and\nthe page lacks as advisory, and publish takes the page. Editing the page's\nwords in the hub drops the mark. A dry run prints a publish line after each\npage: publishable, the advisory headings the hub will list, or the status and\nfindings that will stop the publish. The verdict is the site's installed\n@working-theory/validation's, not the hub's; it sees no library-file finding\nand no layout the hub repairs differently. A site whose validation predates\nthe live-source report prints one \"publish: not checked\" line instead.\n";
54
+ export declare const MIGRATE_CONTENT_HELP = "create-ailk migrate-content \u2014 import an existing site's pages into its workspace.\n\nUsage:\n AILK_AGENT_KEY=<key> create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>] [--language-seed <file>]\n\nArguments:\n <dir> The site. Defaults to the current dir.\n\nOptions:\n --apply Write the pages. Without it the command reads the\n workspace, prints what it would do, and writes\n nothing.\n --api-url <origin> The API origin that holds the workspace \u2014 on a\n spoke, its hub's. Else AILK_API_URL. https: only\n (http: on localhost or 127.0.0.1).\n --workspace <wksp_id> The workspace the pages are written to. Else\n AILK_WORKSPACE_ID.\n --language-seed <file> A Language seed file (language/<entity>.json).\n Each of its topics becomes one Topic holding all\n its keywords. Its items are not read.\n -h, --help Show this help.\n\nEach content/en/<Type>/<slug>.mdx page (and each legacy\ncontent/<Type>/<slug>.mdx) is written to the workspace as a draft through\nthe API's content routes, with the agent key, which is read from\nAILK_AGENT_KEY only and needs the content-edit grant. Nothing is published,\nso the live site does not change. The site needs no .ailk-site-manifest.json\nand may be a spoke; its dependencies must be installed. A page whose\nfrontmatter carries sections is converted: its words are written to the\npage's Markdown and its sections to its layout.\n\nEach FAQ item and glossary-index term becomes one Language item of its kind,\nset Live when the run creates it, and its section pins the items in the\norder the file lists them. A question on several pages is one item, with\nthe FAQ page's words (the glossary page's, for a term). Lines prefixed\nlanguage: report each item, and each page the database read will not show\nas its file does. An API with no Language collection leaves them inline.\n\nWith --language-seed, each topic in the seed file is written after the\npages as one Topic: its name, its pillar page, and every keyword with its\nmonthly searches and as-of date, its primary marked. A Topic the workspace\nalready holds keeps its spelling, notes and newer numbers, and gains what it\nlacks. Lines prefixed language: topic/ report each one; a second --apply\nreports every topic unchanged. A seed file that is not readable, or whose\ntopics the hub would refuse, is refused before anything is sent.\n\nWhen the site has apps/web/content, each blog post and docs page in it is\nwritten too: apps/web/content/en/blog/<slug>.mdx (or <slug>/index.mdx) as a\nBlogPosting, or one series down, blog/<series>/<post>.mdx, as a BlogPosting\nwhose parent is the series; the same under docs as a DocsDetail, and each\ndirectory's own index.mdx as its BlogList or DocsList index. A file the walk\nskips is listed with the rule it failed. Their lines are prefixed\neditorial: \u2014 each outcome's root is content or editorial.\n\nA dry run prints create, update, unchanged, skipped or failed per page. It\ncannot see a write the API would refuse at --apply (a conflict or a server\nerror), nor a layout change on a page whose words did not change, and a\npage whose content fails its page type is planned and saved\nwith errors the editor shows, not failed. --apply prints created, updated,\nunchanged, skipped or failed per page, so a re-run is safe. Exit 0 when no\npage failed, 1 when any did, 2 on a refusal (nothing is sent).\n\nEvery page is written with a live-source mark: its words already ship on the\nlive site, so the hub lists a heading the page type's template asks for and\nthe page lacks as advisory, and publish takes the page. Editing the page's\nwords in the hub drops the mark. A dry run prints a publish line after each\npage: publishable, the advisory headings the hub will list, or the status and\nfindings that will stop the publish. The verdict is the site's installed\n@working-theory/validation's, not the hub's; it sees no library-file finding\nand no layout the hub repairs differently. A site whose validation predates\nthe live-source report prints one \"publish: not checked\" line instead.\n";
51
55
  export declare function parseMigrateContentArgs(argv: string[]): MigrateContentArgs;
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * `create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>]
3
- * [--workspace <id>]` — import an existing site's MDX pages into its
4
- * workspace (#10207).
3
+ * [--workspace <id>] [--language-seed <file>]` — import an existing site's
4
+ * MDX pages into its workspace (#10207), and with `--language-seed` a Language
5
+ * seed file's topics (lang-topic-fields).
5
6
  *
6
7
  * The same import as `seed-workspace` — `importMdx` over `<dir>/content`, and
7
8
  * the docs-blog tree `<dir>/apps/web/content` when it exists (#10701), with
@@ -31,9 +32,10 @@
31
32
  * Pure module: no `import.meta.url`, so jest can import it directly. Spec:
32
33
  * docs/specs/10207-create-ailk-migrate-content-import-spec.md.
33
34
  */
35
+ import { readFileSync } from "node:fs";
34
36
  import { join, resolve } from "node:path";
35
37
  import { parseArgs } from "node:util";
36
- import { languageLines, languageOffLine, withLanguage, } from "./language-import.js";
38
+ import { languageLines, languageOffLine, seedTopics, seedTopicsOf, topicSeedLines, withLanguage, } from "./language-import.js";
37
39
  import { formatImportMdxReport, importMdx, isDirectory, loadSiteMdxAdapter, outcomePath, } from "./lib/import-mdx.js";
38
40
  import { ParseError } from "./parse-args.js";
39
41
  import { AGENT_KEY_ENV_VAR, WORKSPACE_ID_ENV_VAR } from "./seed-workspace.js";
@@ -143,6 +145,7 @@ export async function migrateContent(opts) {
143
145
  throw err;
144
146
  refuse(`the API origin must be an https: origin (http: only on a loopback host) with no path, query, fragment or credentials (from ${source}).`);
145
147
  }
148
+ const topics = opts.languageSeed === undefined ? undefined : readSeedTopics(opts.languageSeed);
146
149
  const at = `workspace ${workspaceId} at ${origin} (from ${source}).`;
147
150
  onLine(apply
148
151
  ? `Migrating ${opts.targetDir} into ${at}`
@@ -215,16 +218,57 @@ export async function migrateContent(opts) {
215
218
  onLine(languageOffLine(off));
216
219
  if (language !== undefined)
217
220
  languageLines(language, apply).forEach(onLine);
221
+ // lang-topic-fields — a seed file's topics, each one Topic, after the pages.
222
+ let seeded;
223
+ if (topics !== undefined) {
224
+ if (topics.length === 0) {
225
+ onLine("language: the seed file has no topics");
226
+ }
227
+ else {
228
+ seeded = await seedTopics(topics, {
229
+ apiOrigin: origin,
230
+ workspaceId,
231
+ apiKey,
232
+ locale: LOCALE,
233
+ fetch: transport,
234
+ apply,
235
+ ...(opts.sleep !== undefined && { sleep: opts.sleep }),
236
+ onLine,
237
+ });
238
+ topicSeedLines(seeded, apply).forEach(onLine);
239
+ }
240
+ }
218
241
  return {
219
242
  result,
220
- exitCode: failed > 0 ? 1 : 0,
243
+ exitCode: failed > 0 || (seeded?.counts.failed ?? 0) > 0 ? 1 : 0,
221
244
  ...(language !== undefined && { language }),
245
+ ...(seeded !== undefined && { topics: seeded }),
222
246
  };
223
247
  }
248
+ /** A seed file's checked `topics[]`; any unreadable or refused file is refused before a request. */
249
+ function readSeedTopics(path) {
250
+ let seed;
251
+ try {
252
+ seed = JSON.parse(readFileSync(resolve(path), "utf8"));
253
+ }
254
+ catch {
255
+ refuse(`--language-seed ${path} is not a readable JSON file.`);
256
+ }
257
+ const locale = seed?.locale;
258
+ if (locale !== undefined && locale !== LOCALE) {
259
+ refuse(`--language-seed ${path} is for another locale; this import writes ${LOCALE}.`);
260
+ }
261
+ try {
262
+ return seedTopicsOf(seed);
263
+ }
264
+ catch (err) {
265
+ refuse(`${err.message}.`);
266
+ }
267
+ }
224
268
  export const MIGRATE_CONTENT_HELP = `create-ailk migrate-content — import an existing site's pages into its workspace.
225
269
 
226
270
  Usage:
227
- AILK_AGENT_KEY=<key> create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>]
271
+ AILK_AGENT_KEY=<key> create-ailk migrate-content [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>] [--language-seed <file>]
228
272
 
229
273
  Arguments:
230
274
  <dir> The site. Defaults to the current dir.
@@ -238,6 +282,9 @@ Options:
238
282
  (http: on localhost or 127.0.0.1).
239
283
  --workspace <wksp_id> The workspace the pages are written to. Else
240
284
  AILK_WORKSPACE_ID.
285
+ --language-seed <file> A Language seed file (language/<entity>.json).
286
+ Each of its topics becomes one Topic holding all
287
+ its keywords. Its items are not read.
241
288
  -h, --help Show this help.
242
289
 
243
290
  Each content/en/<Type>/<slug>.mdx page (and each legacy
@@ -256,6 +303,14 @@ the FAQ page's words (the glossary page's, for a term). Lines prefixed
256
303
  language: report each item, and each page the database read will not show
257
304
  as its file does. An API with no Language collection leaves them inline.
258
305
 
306
+ With --language-seed, each topic in the seed file is written after the
307
+ pages as one Topic: its name, its pillar page, and every keyword with its
308
+ monthly searches and as-of date, its primary marked. A Topic the workspace
309
+ already holds keeps its spelling, notes and newer numbers, and gains what it
310
+ lacks. Lines prefixed language: topic/ report each one; a second --apply
311
+ reports every topic unchanged. A seed file that is not readable, or whose
312
+ topics the hub would refuse, is refused before anything is sent.
313
+
259
314
  When the site has apps/web/content, each blog post and docs page in it is
260
315
  written too: apps/web/content/en/blog/<slug>.mdx (or <slug>/index.mdx) as a
261
316
  BlogPosting, or one series down, blog/<series>/<post>.mdx, as a BlogPosting
@@ -293,6 +348,7 @@ export function parseMigrateContentArgs(argv) {
293
348
  apply: { type: "boolean", default: false },
294
349
  "api-url": { type: "string" },
295
350
  workspace: { type: "string" },
351
+ "language-seed": { type: "string" },
296
352
  help: { type: "boolean", default: false, short: "h" },
297
353
  },
298
354
  });
@@ -309,6 +365,7 @@ export function parseMigrateContentArgs(argv) {
309
365
  apply: parsed.values.apply === true,
310
366
  apiUrl: parsed.values["api-url"],
311
367
  workspaceId: parsed.values.workspace,
368
+ languageSeed: parsed.values["language-seed"],
312
369
  help: parsed.values.help === true,
313
370
  };
314
371
  }
@@ -264,6 +264,7 @@ export const MODULE_SLICES = {
264
264
  // ── docs-blog — Pro module: both fumadocs surfaces (D-46) ────────────────
265
265
  "docs-blog": {
266
266
  spoke: true,
267
+ paidSectionsPackage: "@working-theory/ui-docs-blog",
267
268
  webImports: [WEB_AUTH_ADAPTER_IMPORT, "packages/fumadocs-schema"],
268
269
  packages: {
269
270
  "fumadocs-schema": {
@@ -292,22 +293,23 @@ export const MODULE_SLICES = {
292
293
  // SOURCE files only (the rule above): the three `content/en/**` MDX files
293
294
  // and every test/story companion carry the `oss: false` marker but are not
294
295
  // listed here.
296
+ //
297
+ // #11254 (ADR 0040) — the `/docs` and `/blog` pages and their loaders
298
+ // (the runtime source and the two route adapters) ship in
299
+ // @working-theory/ui-docs-blog, whose routes.json names them;
300
+ // `create-ailk routes --write` mounts them once it is installed. What the
301
+ // site keeps is built from its own content: the Fumadocs source pair and
302
+ // the codegen stub below, which reach the pages through the typed
303
+ // `docs-blog.config.tsx`, delivered by this bundle.
295
304
  ownedFiles: [
296
- // The two route surfaces the module mounts.
297
- "apps/web/app/[locale]/blog/[[...slug]]/page.tsx",
298
- "apps/web/app/[locale]/docs/[[...slug]]/page.tsx",
299
305
  // The Fumadocs source pair — both whole, both loaders (D3).
300
306
  "apps/web/source.config.ts",
301
307
  "apps/web/lib/source.ts",
302
- // The runtime source `lib/source.ts` resolves to under
303
- // CONTENT_ADAPTER=database (#5878). Listed explicitly: the exclusion
304
- // closure grows over DEPENDENTS, not dependencies, so being imported by
305
- // `lib/source.ts` does not pull this file into the bundle by itself.
306
- "apps/web/lib/runtime-source.ts",
307
- // The route adapters and the jest stub for the codegen output.
308
- "apps/web/lib/blog-list-data.ts",
309
- "apps/web/lib/blog-post-data.ts",
308
+ // The jest stub for the codegen output.
310
309
  "apps/web/lib/__mocks__/source-server.js",
310
+ // #11254 D3 — the docs and blog pages' typed config
311
+ // (`defineDocsBlogConfig`), the host seam the generated route files pass in.
312
+ "apps/web/docs-blog.config.tsx",
311
313
  // The module's own /llms.txt variant; the bundle installs it onto
312
314
  // app/llms.txt/route.ts (#5365 D9, install-path mapping owned by #5373).
313
315
  "apps/web/lib/slices/docs-blog/llms-route.ts",
@@ -920,9 +922,10 @@ export const MODULE_SLICES = {
920
922
  // apps/api or database — the routes, services/scheduling (the provider
921
923
  // client and the only reader of the credential), the Cal.com webhook —
922
924
  // and the (authed)/appointments page. What lands is the web tier: the
923
- // three apps/web/app/[locale]/meet pages and the @working-theory/ui-scheduling
924
- // dependency (`patches` below), plus the three MCP tools when apps/mcp is
925
- // kept. Every booking call then reaches the hub with the spoke key.
925
+ // @working-theory/ui-scheduling dependency (`patches` below), whose
926
+ // booking pages `create-ailk routes --write` mounts (#11252), the site's
927
+ // scheduling.config.tsx, plus the three MCP tools when apps/mcp is kept.
928
+ // Every booking call then reaches the hub with the spoke key.
926
929
  spoke: true,
927
930
  apps: {
928
931
  api: {
@@ -1002,19 +1005,16 @@ export const MODULE_SLICES = {
1002
1005
  // consumer — unlike packages/validation below, a strip tool CAN delete
1003
1006
  // exactly these files without touching anything another module needs.
1004
1007
  //
1005
- // ALL THREE apps/web/app/[locale]/meet pages are listed (#5182 Q9, disposed
1006
- // 2026-09-11; directory renamed from schedule/ to meet/ by #5563).
1007
- // confirmed/page.tsx says outright in its own doc comment that "The module
1008
- // OWNS this page... a scaffold without the module has no such route", and
1009
- // its sibling page.tsx is the SOLE production constructor of a `booker`
1010
- // section: it builds the section literally in TypeScript (page.tsx:60,
1011
- // `type: "booker"`) rather than reading it from content, and its own
1012
- // header calls the route API-backed with "no content file that could
1013
- // disagree with the calendar". [slug]/page.tsx is the third — the
1014
- // per-booking-type page #5563 added, composing its calLink from the same
1015
- // configured owner rather than reading one of its own. The create-ailk
1016
- // scaffolder already gates the whole `meet` route surface (src/surfaces.ts),
1017
- // so all three pages arrive and depart together.
1008
+ // The booking pages — /meet, /meet/[slug], /meet/confirmed and /private,
1009
+ // their index frame and their meetings builder — are NOT listed: they
1010
+ // ship in @working-theory/ui-scheduling (#11252, ADR 0040), whose
1011
+ // routes.json names them, and a site's app/[locale]/meet/ and
1012
+ // app/[locale]/private/ hold only the route files `create-ailk routes
1013
+ // --write` generates once the package is installed. Those two
1014
+ // directories are EXCLUDE_TEMPLATE_DIRS entries, so no template copies
1015
+ // them; the site's scheduling.config.tsx, which the generated files
1016
+ // import, is listed below so the bundle delivers it and the Free template
1017
+ // never carries it.
1018
1018
  //
1019
1019
  // packages/sections-registry/src/registry.ts (the `booker:` entry) and
1020
1020
  // packages/validation/src/schemas/page-sections.ts (BookerSectionDataSchema,
@@ -1052,28 +1052,13 @@ export const MODULE_SLICES = {
1052
1052
  // deliberately NOT listed here: they ship, and listing one would take the
1053
1053
  // whole dispatch table with it.
1054
1054
  ownedFiles: [
1055
- "apps/web/app/[locale]/meet/page.tsx",
1056
- "apps/web/app/[locale]/meet/[slug]/page.tsx",
1057
- "apps/web/app/[locale]/meet/confirmed/page.tsx",
1058
- // #8843 D6–D8 — the booking pages' one builder, the index frame
1059
- // `/meet` and `/private` share, the private index, and their suites,
1060
- // individually (§ D12, property 1: a glob ships no test).
1061
- "apps/web/lib/meetings.tsx",
1062
- "apps/web/lib/__tests__/meetings.test.tsx",
1063
- "apps/web/lib/__tests__/meetings.fixtures.ts",
1064
- "apps/web/app/[locale]/meet/meeting-index.tsx",
1065
- "apps/web/app/[locale]/private/page.tsx",
1066
- "apps/web/app/[locale]/private/__tests__/page.test.tsx",
1067
- "apps/web/app/[locale]/private/__tests__/sitemap.test.ts",
1068
- // #11013 D-K — the results page's Meeting-card half: the scheduling
1069
- // layout one segment above commerce's `results/[payload]/layout.tsx`,
1070
- // its client provider and the layout's own suite, listed individually
1071
- // (a co-located suite is not swept by `EXCLUDE_TEMPLATE_DIRS`). The
1072
- // page reads the meeting through `results/[payload]/meeting-seam.ts`,
1073
- // the base half, so no signal-collectors file imports `lib/meetings`.
1074
- "apps/web/app/[locale]/flows/[slug]/results/layout.tsx",
1075
- "apps/web/app/[locale]/flows/[slug]/results/ResultsMeetingsProvider.tsx",
1076
- "apps/web/app/[locale]/flows/[slug]/results/__tests__/layout.test.tsx",
1055
+ // #11252 D3 — the booking pages' typed config (`defineSchedulingConfig`),
1056
+ // the host seam the generated meet and private route files pass in.
1057
+ "apps/web/scheduling.config.tsx",
1058
+ // #11251 D3, D5 — the results page's Meeting-card half (#11013 D-K)
1059
+ // ships in `@working-theory/ui-signal-collectors`, gated by the site
1060
+ // config's `meetings` slot (`SCHEDULING_PAGES`), so this module owns no
1061
+ // flows file.
1077
1062
  // #6086 (brief H7) — the SITE's appointments page, the visible half of
1078
1063
  // the read above. The co-located suite is listed EXPLICITLY alongside
1079
1064
  // its page: `EXCLUDE_TEMPLATE_DIRS` below drops only the three
@@ -1087,7 +1072,7 @@ export const MODULE_SLICES = {
1087
1072
  ],
1088
1073
  // pageContributions (spec 5478; parent § D6 shape 1) — the meeting
1089
1074
  // index, the meeting page, the confirmation page and the private index
1090
- // (#8843 D8), whose route files `ownedFiles` above already carries. No
1075
+ // (#8843 D8), whose route files the package's manifest names (#11252). No
1091
1076
  // row names seed content: all four render from the /v1/schedule/*
1092
1077
  // routes, not from an MDX file.
1093
1078
  pageContributions: [
@@ -1100,9 +1085,14 @@ export const MODULE_SLICES = {
1100
1085
  // it renders from `/v1/schedule/appointments`, not from an MDX file.
1101
1086
  { route: "/appointments" },
1102
1087
  ],
1088
+ // #11252 D4 — the paid-sections registry's `loadUiScheduling()` row: the
1089
+ // `schedule` catalog `apps/web/i18n/request.ts` merges under the site's,
1090
+ // a stub answering null where the site does not carry the package.
1091
+ paidSectionsPackage: "@working-theory/ui-scheduling",
1103
1092
  // patches (#5581 U3, D5) — delivers the extracted component package to a
1104
1093
  // keyed scaffold's apps/web, mirroring the signal-collectors slice's
1105
- // identical merge-keys op below.
1094
+ // identical merge-keys op below. It is also what lets `routes --write`
1095
+ // find the package's manifest once installed (#11252).
1106
1096
  patches: [
1107
1097
  {
1108
1098
  target: "apps/web/package.json",
@@ -1239,7 +1229,8 @@ export const MODULE_SLICES = {
1239
1229
  // installs through the spoke filter (`isSpokeExcluded`) and the D10
1240
1230
  // remap (`spokeDestination`); every part of the slice lands as follows:
1241
1231
  //
1242
- // apps/web/app/[locale]/flows/** (its `flows` surface) lands
1232
+ // the flows route files (generated, #11251) written by `routes --write`;
1233
+ // the spoke's `results` entries not carried
1243
1234
  // apps/web/app/[locale]/reports/**, the ReportPage + ReportsList seeds
1244
1235
  // dropped (`SPOKE_EXCLUDED_MODULE_PATHS`,
1245
1236
  // 2026-10-09): the reader links a report's
@@ -1288,40 +1279,29 @@ export const MODULE_SLICES = {
1288
1279
  "apps/web/app/[locale]/(authed)/waitlist/components/SignupsTable.tsx",
1289
1280
  "apps/web/app/[locale]/(authed)/waitlist/components/WaitlistComparisonTabs.tsx",
1290
1281
  "apps/web/app/[locale]/(authed)/waitlist/components/status-badges.tsx",
1291
- // apps/web/app/[locale]/flows/** deliberately NOT listed here (unlike
1292
- // the docs-blog precedent's own `blog`/`docs` page.tsx entries above),
1293
- // even though every file under it is signal-collectors territory and
1294
- // still carries its own `oss: false` marker for the OSS-strip. Every
1295
- // one of these files is ALREADY excluded from a keyless scaffold by the
1296
- // pre-existing, independent `MODULE_SURFACES["signal-collectors"] =
1297
- // ["flows"]` → `excludedRoutePaths()` mechanism (#4154), which removes
1298
- // the WHOLE `apps/web/app/[locale]/flows` directory at copy time
1299
- // whenever the "flows" surface isn't selected — and `resolveSurfaces`
1300
- // refuses `--surfaces flows` without the module (#5365 FR5/D12), so
1301
- // there is no way to reach "flows carried, signal-collectors absent".
1302
- // Adding them to `ownedFiles` ALSO excludes them from `templates/`
1303
- // itself (build-templates.mjs), which broke `sync-routes`'s pre-#5366
1304
- // upgrade-path fixture (`flows/[slug]/results/[payload]`, #4891/#4986)
1305
- // and — more importantly — would silently strip a REAL consumer's
1306
- // `sync-routes` tool of the ability to ever restore these files after
1307
- // scaffolding, since that tool diffs against `templates/` alone and has
1308
- // no module/licence concept of its own (empirically found, #5366 resume
1309
- // pass). `projects/apply/ListingApplicationClient.tsx` below is
1310
- // different in kind: it sits under the UNRELATED "projects" content
1311
- // surface's URL segment, which `excludedRoutePaths` does not gate on
1312
- // signal-collectors at all, so it genuinely needs `ownedFiles` to be
1313
- // excluded from a keyless scaffold — see `sync-routes.ts`'s
1314
- // `NESTED_FOREIGN_MODULE_ENTRIES` for the companion fix that keeps its
1315
- // presence from falsely reading as "projects carried".
1282
+ // #11251 (ADR 0040 phase 3) — the flows pages ship in
1283
+ // `@working-theory/ui-signal-collectors`: a site's
1284
+ // `apps/web/app/[locale]/flows/` holds only the six route files
1285
+ // `create-ailk routes --write` generates from the package's
1286
+ // `routes.json` (after the install; `EXCLUDE_TEMPLATE_DIRS` keeps the
1287
+ // tree out of the snapshot), so this module owns no flows file. It owns
1288
+ // the site's one typed config the generated files import.
1289
+ "apps/web/signal-collectors.config.tsx",
1290
+ // `projects/apply/ListingApplicationClient.tsx` sits under the
1291
+ // UNRELATED "projects" content surface's URL segment, which
1292
+ // `excludedRoutePaths` does not gate on signal-collectors at all, so it
1293
+ // needs `ownedFiles` to be excluded from a keyless scaffold — see
1294
+ // `sync-routes.ts`'s `NESTED_FOREIGN_MODULE_ENTRIES` for the companion
1295
+ // fix that keeps its presence from falsely reading as "projects carried".
1316
1296
  "apps/web/app/[locale]/projects/apply/ListingApplicationClient.tsx",
1317
1297
  // #8840 D11/D13 — the Job application magnet's two walks. Same kind as
1318
1298
  // `projects/apply` above: they sit under the UNRELATED "careers"
1319
1299
  // surface's URL segment, which `excludedRoutePaths` does not gate on
1320
1300
  // signal-collectors, so `ownedFiles` keeps them out of a keyless
1321
1301
  // scaffold, and `NESTED_FOREIGN_MODULE_ENTRIES` keeps their presence
1322
- // from reading as "careers carried". `flows/[slug]/magnet-page.tsx`,
1323
- // the renderer they mount, rides the `flows` surface's directory with
1324
- // its siblings (the note above).
1302
+ // from reading as "careers carried". The renderer they mount is the
1303
+ // package's `@working-theory/ui-signal-collectors/pages/flows/[slug]/magnet-page`
1304
+ // (#11251 D7).
1325
1305
  "apps/web/app/[locale]/careers/apply/page.tsx",
1326
1306
  "apps/web/app/[locale]/careers/[slug]/apply/page.tsx",
1327
1307
  // #9287 DD10 — the trial magnet pair. Its own `trial` route segment,
@@ -1368,18 +1348,12 @@ export const MODULE_SLICES = {
1368
1348
  // `packages/ui`. A section is vocabulary; the ROUTE is the module.
1369
1349
  ],
1370
1350
  // pageContributions (spec 5478; parent § D6 shape 2) — the three flow
1371
- // routes, named exactly as `surfaces.ts`'s ROUTE_SINCE keys name them.
1372
- // ROWS AND SEED ONLY: unlike docs-blog and scheduling above, this module's
1373
- // route code is deliberately NOT in `ownedFiles` (see the comment inside
1374
- // that array). All three rows' code reaches a scaffold from the
1375
- // `templates/` snapshot, retained because the `flows` surface is enabled.
1376
- // The results row's code was `commerce`'s until #6786, so a Pro scaffold
1377
- // without commerce 404'd a finished recommending flow; it now ships here,
1378
- // and commerce's bundle adds only the checkout half
1379
- // (`commerce.ownedFiles`: `results/[payload]/layout.tsx` and
1380
- // `checkout.actions.ts`). Declaring the rows here changes none of it: a
1381
- // contribution is data, and which delivery shape carries the code is a
1382
- // property of the module, not of the contribution.
1351
+ // routes. ROWS AND SEED ONLY: this module's route code is not in
1352
+ // `ownedFiles` — it ships in `@working-theory/ui-signal-collectors`, and
1353
+ // a scaffold's route files are generated from the package's manifest
1354
+ // (#11251). Declaring the rows here changes none of it: a contribution is
1355
+ // data, and which delivery shape carries the code is a property of the
1356
+ // module, not of the contribution.
1383
1357
  pageContributions: [
1384
1358
  { route: "/flows/[slug]" },
1385
1359
  { route: "/flows/[slug]/start" },
@@ -1468,6 +1442,23 @@ export const MODULE_SLICES = {
1468
1442
  },
1469
1443
  ],
1470
1444
  },
1445
+ // #11251 D8 — the flows pages read the site through the package's
1446
+ // `/site` seam, answered by the site's signal-collectors.config.tsx.
1447
+ // next.config.mjs aliases it unconditionally; the keyless template's
1448
+ // jest.config.cjs carries no signal-collectors mapper
1449
+ // (transformPaidUiPackages), so a keyed scaffold's jest gets it here —
1450
+ // without it every suite that reaches a flow read hits the throwing stub.
1451
+ {
1452
+ target: "apps/web/jest.config.cjs",
1453
+ kind: "jest-config",
1454
+ ops: [
1455
+ {
1456
+ op: "add-module-name-mapper",
1457
+ pattern: "^@working-theory/ui-signal-collectors/site$",
1458
+ value: "<rootDir>/signal-collectors.config.tsx",
1459
+ },
1460
+ ],
1461
+ },
1471
1462
  // #9460 DD6 — the two MCP packs above, as apps/mcp dependencies.
1472
1463
  {
1473
1464
  target: "apps/mcp/package.json",
@@ -1512,10 +1503,13 @@ export const MODULE_SLICES = {
1512
1503
  // dev/purchase, spoke-intake Rule 3). What lands
1513
1504
  // is the scaffold-commerce skill, the commerce-boundary rule and the
1514
1505
  // @working-theory/ui-commerce dependency (`patches` below). A spoke sells
1515
- // through its hub's Offerings buy route (#9142); its remaining checkout
1516
- // files — `apps/web` template source (checkout-config.ts, two return
1517
- // pages and their tests) — are copied by `writeSpokeCheckoutSlice`
1518
- // (`spoke-checkout.ts`, #8748), not carried here.
1506
+ // through its hub's Offerings buy route (#9142). The checkout and
1507
+ // purchase return pages ship in that package (#11253, ADR 0040), whose
1508
+ // routes.json names them; `create-ailk routes --write` mounts them once
1509
+ // it is installed. The site's commerce.config.tsx and its stamp
1510
+ // lib/checkout-config.ts are `ownedFiles` below, so the bundle delivers
1511
+ // both to every commerce site and `writeSpokeCheckoutSlice`
1512
+ // (`spoke-checkout.ts`, #8748) stamps the latter in place on a spoke.
1519
1513
  spoke: true,
1520
1514
  paidSectionsPackage: "@working-theory/ui-commerce",
1521
1515
  apps: {
@@ -1592,16 +1586,21 @@ export const MODULE_SLICES = {
1592
1586
  // + the slice's own re-export entry point) moved to
1593
1587
  // packages-paid/ui-commerce; the package is delivered to a keyed
1594
1588
  // scaffold via `patches` below, not via `ownedFiles`/`installMap` (D5).
1595
- // #6786 — the flow results page is signal-collectors' (it rides the
1596
- // `flows` surface's directory, see that slice); commerce owns only its
1597
- // checkout half: Pay's action and the results layout that provides the
1598
- // price card + Pay through the base tree's `checkout-seam.ts`. Without
1599
- // them the page renders, offering Book a Call for every fit.
1600
- "apps/web/app/[locale]/flows/[slug]/checkout.actions.ts",
1601
- "apps/web/app/[locale]/flows/[slug]/results/[payload]/layout.tsx",
1589
+ // #11251 D3, D4 — the flow results page's checkout half (#6786) ships
1590
+ // in `@working-theory/ui-signal-collectors`, gated by the site config's
1591
+ // `checkout` slot; commerce's part of it is the price card,
1592
+ // `FlowResultsPriceCard` in `@working-theory/ui-commerce`, which the
1593
+ // slot loads through the paid-sections registry. Without commerce the
1594
+ // page renders, offering Book a Call for every fit.
1602
1595
  "apps/web/app/[locale]/dev/purchase/page.tsx",
1603
1596
  "apps/web/app/[locale]/dev/purchase/error.tsx",
1604
1597
  "apps/web/app/[locale]/dev/purchase/purchase.actions.ts",
1598
+ // #11253 D3, D6 — the checkout and purchase pages' typed config
1599
+ // (`defineCommerceConfig`), the host seam the generated route files pass
1600
+ // in, and the checkout stamp it reads, which every commerce site now
1601
+ // carries (read on a spoke only; a hub's checkout pages 404 first).
1602
+ "apps/web/commerce.config.tsx",
1603
+ "apps/web/lib/checkout-config.ts",
1605
1604
  ],
1606
1605
  // The scaffold-commerce authoring skill (D-47, #5449): moved by `git mv`
1607
1606
  // out of the Free starter's `templates/.claude/skills/` (never stripped —
@@ -1870,6 +1869,43 @@ export const EXCLUDE_TEMPLATE_DIRS = [
1870
1869
  "apps/web/app/[locale]/pricing/__tests__/monorepo-only.test.tsx",
1871
1870
  "apps/web/app/[locale]/pricing/__tests__/__snapshots__/monorepo-only.test.tsx.snap",
1872
1871
  "apps/web/lib/__tests__/hub-children.test.tsx",
1872
+ // #11227 (ADR 0040 phase 1) — the member account area ships in
1873
+ // `@working-theory/account`, its own suites with it. These are THIS
1874
+ // monorepo's integration suites: each mounts the package's pages through
1875
+ // the generated route files and the site's own account.config.tsx and
1876
+ // auth seam, so the account tests live once, here, never in a scaffold.
1877
+ // The parked `account/connect` page is the site's own and keeps its suite.
1878
+ "apps/web/app/[locale]/(authed)/account/__tests__",
1879
+ "apps/web/app/[locale]/(authed)/account/appointments/__tests__",
1880
+ "apps/web/app/[locale]/(authed)/account/artifacts/__tests__",
1881
+ "apps/web/app/[locale]/(authed)/account/billing/__tests__",
1882
+ "apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__",
1883
+ "apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__",
1884
+ "apps/web/app/[locale]/(authed)/account/privacy/__tests__",
1885
+ "apps/web/app/[locale]/(authed)/account/security/__tests__",
1886
+ // #11251 (ADR 0040 phase 3) — the flows pages ship in
1887
+ // `@working-theory/ui-signal-collectors`; a scaffold's flows route files
1888
+ // are generated from its `routes.json` after the install, never copied.
1889
+ "apps/web/app/[locale]/flows",
1890
+ // #11252 (ADR 0040 rule 3) — the booking pages ship in
1891
+ // `@working-theory/ui-scheduling`; these directories hold the route files
1892
+ // of that optional package, written by `routes --write` at scaffold time
1893
+ // (after `--install`) and in `update`, never snapshotted. The private
1894
+ // index's `sitemap.test.ts` is this monorepo's integration suite.
1895
+ "apps/web/app/[locale]/meet",
1896
+ "apps/web/app/[locale]/private",
1897
+ // #11253 (ADR 0040 rule 3) — the checkout and purchase return pages ship in
1898
+ // `@working-theory/ui-commerce`; these directories hold the route files of
1899
+ // that optional package, written by `routes --write` at scaffold time
1900
+ // (after `--install`), in `update` and by `add-module`, never snapshotted.
1901
+ "apps/web/app/[locale]/checkout",
1902
+ "apps/web/app/[locale]/purchase",
1903
+ // #11254 (ADR 0040 rule 3) — the docs and blog pages ship in
1904
+ // `@working-theory/ui-docs-blog`; these directories hold the route files of
1905
+ // that optional package, written by `routes --write` at scaffold time
1906
+ // (after `--install`), in `update` and by `add-module`, never snapshotted.
1907
+ "apps/web/app/[locale]/docs",
1908
+ "apps/web/app/[locale]/blog",
1873
1909
  ];
1874
1910
  export function paidModuleTemplateExclusions(snapshotRoots, repoRoot) {
1875
1911
  const roots = new Set(snapshotRoots);
@@ -81,3 +81,16 @@ export declare function writePaidMcpTools(targetDir: string): "added" | "updated
81
81
  * absent — a scaffold with no web app.
82
82
  */
83
83
  export declare function writePaidSections(targetDir: string): boolean;
84
+ /**
85
+ * The registry rendered from `targetDir`'s own `apps/web/package.json`, or
86
+ * `undefined` for a scaffold with no web app. `create-ailk update` resolves a
87
+ * written file's imports of it against this render, never the site's copy
88
+ * on disk, which a release that added a loader has not yet rewritten (#11394).
89
+ */
90
+ export declare function renderSitePaidSections(targetDir: string): string | undefined;
91
+ /**
92
+ * Write the registry alone, from `targetDir`'s own `apps/web/package.json` —
93
+ * `create-ailk update` rewrites it every run (#11394). Answers the
94
+ * `writeModuleFlags` shape.
95
+ */
96
+ export declare function writePaidSectionsRegistry(targetDir: string): "added" | "updated" | "unchanged" | undefined;