create-ailk 0.23.0 → 0.25.1

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 (604) hide show
  1. package/README.md +68 -33
  2. package/component-catalog.json +3 -3
  3. package/component-catalog.md +3 -3
  4. package/dist/add-module.js +10 -3
  5. package/dist/add-route.d.ts +12 -1
  6. package/dist/add-route.js +38 -4
  7. package/dist/cli.js +12 -7
  8. package/dist/derive-architecture.d.ts +3 -4
  9. package/dist/derive-architecture.js +75 -22
  10. package/dist/lib/design-checks.d.ts +9 -4
  11. package/dist/lib/design-checks.js +13 -7
  12. package/dist/lib/extract-module-bundle.js +29 -2
  13. package/dist/lib/fetch-template-snapshot.d.ts +1 -1
  14. package/dist/lib/fetch-template-snapshot.js +7 -3
  15. package/dist/lib/import-graph.d.ts +1 -1
  16. package/dist/lib/import-graph.js +4 -4
  17. package/dist/lib/module-license-gate.d.ts +12 -1
  18. package/dist/lib/module-license-gate.js +34 -12
  19. package/dist/lib/scaffold-render-sweep.d.ts +33 -0
  20. package/dist/lib/scaffold-render-sweep.js +45 -0
  21. package/dist/module-architecture.d.ts +20 -3
  22. package/dist/module-architecture.js +122 -538
  23. package/dist/paid-sections.d.ts +25 -1
  24. package/dist/paid-sections.js +88 -3
  25. package/dist/surfaces.js +10 -2
  26. package/dist/sync-routes.d.ts +30 -4
  27. package/dist/sync-routes.js +271 -18
  28. package/dist/template-record.d.ts +14 -4
  29. package/dist/template-record.js +23 -5
  30. package/dist/topology.d.ts +16 -3
  31. package/dist/topology.js +31 -19
  32. package/dist/update.d.ts +10 -1
  33. package/dist/update.js +540 -16
  34. package/package.json +3 -3
  35. package/release-scope.json +1 -1
  36. package/templates/.claude/cloudparity-repo-hooks.json +5 -0
  37. package/templates/.claude/hooks/template-guard.sh +137 -0
  38. package/templates/.claude/rules/extending.md +106 -0
  39. package/templates/.claude/rules/loop-contract.md +2 -2
  40. package/templates/.claude/settings.json +11 -0
  41. package/templates/.env.example +9 -5
  42. package/templates/.github/workflows/ci.yml +7 -4
  43. package/templates/CLAUDE.md +15 -3
  44. package/templates/CONVENTIONS.md +8 -10
  45. package/templates/README.md +14 -13
  46. package/templates/apps/api/.env.example +9 -2
  47. package/templates/apps/api/CLAUDE.md +122 -82
  48. package/templates/apps/api/jest.config.cjs +15 -5
  49. package/templates/apps/api/package.json +16 -20
  50. package/templates/apps/api/src/__tests__/trusted-origins.server.test.ts +2 -2
  51. package/templates/apps/api/src/__tests__/vercel-handler.test.ts +4 -4
  52. package/templates/apps/api/src/index.ts +1 -1
  53. package/templates/apps/api/src/lib/__mocks__/prisma.ts +7 -4
  54. package/templates/apps/api/src/modules/commerce.ts +10 -0
  55. package/templates/apps/api/src/modules/content-write.ts +10 -0
  56. package/templates/apps/api/src/modules/multi-tenant.ts +10 -0
  57. package/templates/apps/api/src/modules/scheduling.ts +10 -0
  58. package/templates/apps/api/src/modules/signal-collectors.ts +10 -0
  59. package/templates/apps/api/src/modules/workspace.ts +10 -0
  60. package/templates/apps/api/src/server.ts +117 -1857
  61. package/templates/apps/api/vercel.json +2 -2
  62. package/templates/apps/mcp/CLAUDE.md +77 -24
  63. package/templates/apps/mcp/__tests__/app-entry.test.ts +4 -254
  64. package/templates/apps/mcp/__tests__/boot-file.test.ts +92 -0
  65. package/templates/apps/mcp/jest.config.cjs +6 -1
  66. package/templates/apps/mcp/package.json +5 -12
  67. package/templates/apps/mcp/src/app.ts +8 -7
  68. package/templates/apps/mcp/src/index.ts +6 -34
  69. package/templates/apps/mcp/src/lib/paid-tools.generated.ts +10 -0
  70. package/templates/apps/mcp/src/lib/topology.generated.ts +2 -2
  71. package/templates/apps/mcp/src/site.ts +12 -0
  72. package/templates/apps/web/.env.example +1 -1
  73. package/templates/apps/web/CLAUDE.md +21 -5
  74. package/templates/apps/web/app/.well-known/mcp.json/route.ts +9 -3
  75. package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +1 -1
  76. package/templates/apps/web/app/[locale]/contact/contact.actions.ts +14 -4
  77. package/templates/apps/web/app/[locale]/contact/intake-analytics.ts +1 -1
  78. package/templates/apps/web/app/[locale]/contact/intake-script.ts +1 -1
  79. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +22 -1
  80. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +28 -7
  81. package/templates/apps/web/app/[locale]/pricing/__tests__/unconnected.test.tsx +43 -0
  82. package/templates/apps/web/app/[locale]/pricing/page.tsx +7 -3
  83. package/templates/apps/web/app/api/offerings/checkout/[lookupKey]/__tests__/route.test.ts +222 -0
  84. package/templates/apps/web/app/api/offerings/checkout/[lookupKey]/route.ts +10 -3
  85. package/templates/apps/web/app/api/revalidate/route.ts +3 -3
  86. package/templates/apps/web/auth.ts +2 -2
  87. package/templates/apps/web/jest.config.cjs +1 -0
  88. package/templates/apps/web/lib/__tests__/magnet-routes.test.ts +7 -0
  89. package/templates/apps/web/lib/auth-email.ts +1 -1
  90. package/templates/apps/web/lib/magnet-routes.ts +3 -1
  91. package/templates/apps/web/lib/newsletter.actions.ts +9 -6
  92. package/templates/apps/web/lib/relay.ts +2 -2
  93. package/templates/apps/web/lib/release-scope.ts +47 -0
  94. package/templates/apps/web/lib/server-api.ts +1 -1
  95. package/templates/apps/web/src/lib/commerce-claim.ts +1 -1
  96. package/templates/customizations.yaml +37 -0
  97. package/templates/database/prisma.config.ts +10 -14
  98. package/templates/database/seed-test.ts +2 -2
  99. package/templates/database/seed.ts +32 -5
  100. package/templates/package.json +12 -6
  101. package/templates/pnpm-workspace.yaml +0 -1
  102. package/templates/project.yaml +16 -8
  103. package/templates/tools/jest/reporters.cjs +65 -0
  104. package/templates/tools/lint-architecture.ts +757 -7
  105. package/templates/tsconfig.json +1 -2
  106. package/versions.json +48 -35
  107. package/templates/apps/api/src/__tests__/commerce-claim-registration.test.ts +0 -409
  108. package/templates/apps/api/src/__tests__/factories/agent-caller.ts +0 -102
  109. package/templates/apps/api/src/__tests__/factories/content-fixture.ts +0 -138
  110. package/templates/apps/api/src/__tests__/factories/in-memory-prisma.ts +0 -441
  111. package/templates/apps/api/src/__tests__/factories/index.ts +0 -70
  112. package/templates/apps/api/src/__tests__/factories/lead-fixture.ts +0 -82
  113. package/templates/apps/api/src/__tests__/leads-forwarded-rate-limit.test.ts +0 -135
  114. package/templates/apps/api/src/__tests__/services/enrichment-shim.test.ts +0 -126
  115. package/templates/apps/api/src/__tests__/stripe-boot.test.ts +0 -132
  116. package/templates/apps/api/src/__tests__/support/hub-sign-in-fake-db.ts +0 -362
  117. package/templates/apps/api/src/bin/__tests__/rate-limit-probe.test.ts +0 -184
  118. package/templates/apps/api/src/bin/abandon-sweep.ts +0 -42
  119. package/templates/apps/api/src/bin/rate-limit-probe.ts +0 -53
  120. package/templates/apps/api/src/bin/spokes.ts +0 -198
  121. package/templates/apps/api/src/bin/stripe-connections-rekey.ts +0 -45
  122. package/templates/apps/api/src/config/__tests__/hub-require-spoke-key.test.ts +0 -196
  123. package/templates/apps/api/src/config/__tests__/index.test.ts +0 -233
  124. package/templates/apps/api/src/config/__tests__/modules.test.ts +0 -76
  125. package/templates/apps/api/src/config/__tests__/stripe-connection-key.test.ts +0 -185
  126. package/templates/apps/api/src/config/__tests__/trusted-origins.test.ts +0 -238
  127. package/templates/apps/api/src/config/index.ts +0 -596
  128. package/templates/apps/api/src/config/modules.ts +0 -83
  129. package/templates/apps/api/src/lib/__tests__/agent-store.test.ts +0 -581
  130. package/templates/apps/api/src/lib/__tests__/auth-email-budget.test.ts +0 -143
  131. package/templates/apps/api/src/lib/__tests__/consent-ledger-double.ts +0 -237
  132. package/templates/apps/api/src/lib/__tests__/consent-store.test.ts +0 -353
  133. package/templates/apps/api/src/lib/__tests__/content-adapter.test.ts +0 -201
  134. package/templates/apps/api/src/lib/__tests__/deliverable-asset-store.test.ts +0 -224
  135. package/templates/apps/api/src/lib/__tests__/error-serializer.test.ts +0 -120
  136. package/templates/apps/api/src/lib/__tests__/errors.test.ts +0 -94
  137. package/templates/apps/api/src/lib/__tests__/file-fallback.test.ts +0 -144
  138. package/templates/apps/api/src/lib/__tests__/fixtures/HomePage/home.mdx +0 -8
  139. package/templates/apps/api/src/lib/__tests__/flow-completion-store.test.ts +0 -149
  140. package/templates/apps/api/src/lib/__tests__/flow-rename-race.db.test.ts +0 -116
  141. package/templates/apps/api/src/lib/__tests__/hub-sign-in-store.test.ts +0 -209
  142. package/templates/apps/api/src/lib/__tests__/lead-capture-store.test.ts +0 -257
  143. package/templates/apps/api/src/lib/__tests__/lead-delivery.test.ts +0 -96
  144. package/templates/apps/api/src/lib/__tests__/outbound-http.test.ts +0 -125
  145. package/templates/apps/api/src/lib/__tests__/prisma.test.ts +0 -165
  146. package/templates/apps/api/src/lib/__tests__/require-commerce-claim.test.ts +0 -317
  147. package/templates/apps/api/src/lib/__tests__/require-paid-tier.test.ts +0 -129
  148. package/templates/apps/api/src/lib/__tests__/site.test.ts +0 -292
  149. package/templates/apps/api/src/lib/__tests__/slice-load.test.ts +0 -89
  150. package/templates/apps/api/src/lib/__tests__/spoke-store.test.ts +0 -202
  151. package/templates/apps/api/src/lib/__tests__/stripe-admission.test.ts +0 -217
  152. package/templates/apps/api/src/lib/__tests__/stripe.test.ts +0 -82
  153. package/templates/apps/api/src/lib/agent-store.ts +0 -613
  154. package/templates/apps/api/src/lib/auth-email-budget.ts +0 -161
  155. package/templates/apps/api/src/lib/consent-store.ts +0 -363
  156. package/templates/apps/api/src/lib/content-adapter.ts +0 -112
  157. package/templates/apps/api/src/lib/deliverable-asset-store.ts +0 -96
  158. package/templates/apps/api/src/lib/error-serializer.ts +0 -164
  159. package/templates/apps/api/src/lib/errors.ts +0 -95
  160. package/templates/apps/api/src/lib/file-fallback.ts +0 -87
  161. package/templates/apps/api/src/lib/flow-completion-store.ts +0 -136
  162. package/templates/apps/api/src/lib/hub-sign-in-store.ts +0 -455
  163. package/templates/apps/api/src/lib/lead-capture-store.ts +0 -122
  164. package/templates/apps/api/src/lib/lead-delivery.ts +0 -52
  165. package/templates/apps/api/src/lib/license-key-store.ts +0 -45
  166. package/templates/apps/api/src/lib/locales.ts +0 -201
  167. package/templates/apps/api/src/lib/outbound-http.ts +0 -127
  168. package/templates/apps/api/src/lib/prisma.ts +0 -21
  169. package/templates/apps/api/src/lib/proposal-paid-store.ts +0 -66
  170. package/templates/apps/api/src/lib/rate-limit-probe.ts +0 -165
  171. package/templates/apps/api/src/lib/rate-limit-store.ts +0 -142
  172. package/templates/apps/api/src/lib/require-commerce-claim.ts +0 -250
  173. package/templates/apps/api/src/lib/require-paid-tier.ts +0 -53
  174. package/templates/apps/api/src/lib/site.ts +0 -254
  175. package/templates/apps/api/src/lib/slice-load.ts +0 -90
  176. package/templates/apps/api/src/lib/spoke-store.ts +0 -180
  177. package/templates/apps/api/src/lib/stripe.ts +0 -318
  178. package/templates/apps/api/src/lib/webhook-idempotency.ts +0 -156
  179. package/templates/apps/api/src/middleware/__tests__/adversarial/bearer-token-format.test.ts +0 -111
  180. package/templates/apps/api/src/middleware/__tests__/adversarial/cookie-or-bearer-precedence.test.ts +0 -172
  181. package/templates/apps/api/src/middleware/__tests__/adversarial/csrf-bearer-skip.test.ts +0 -119
  182. package/templates/apps/api/src/middleware/__tests__/adversarial/csrf-cookie-path.test.ts +0 -138
  183. package/templates/apps/api/src/middleware/__tests__/adversarial/csrf-trusted-origins.test.ts +0 -142
  184. package/templates/apps/api/src/middleware/__tests__/adversarial/session-fixation.test.ts +0 -155
  185. package/templates/apps/api/src/middleware/__tests__/adversarial/session-timeout.test.ts +0 -139
  186. package/templates/apps/api/src/middleware/__tests__/auth.bearer-path.test.ts +0 -562
  187. package/templates/apps/api/src/middleware/__tests__/auth.both-present-precedence.test.ts +0 -76
  188. package/templates/apps/api/src/middleware/__tests__/auth.cookie-path.test.ts +0 -220
  189. package/templates/apps/api/src/middleware/__tests__/auth.database-not-configured.test.ts +0 -97
  190. package/templates/apps/api/src/middleware/__tests__/auth.hub-session-path.test.ts +0 -557
  191. package/templates/apps/api/src/middleware/__tests__/auth.neither-present.test.ts +0 -72
  192. package/templates/apps/api/src/middleware/__tests__/auth.optional-cookie.test.ts +0 -140
  193. package/templates/apps/api/src/middleware/__tests__/default-tenant.test.ts +0 -721
  194. package/templates/apps/api/src/middleware/__tests__/rate-limit-cross-isolate.db.test.ts +0 -220
  195. package/templates/apps/api/src/middleware/__tests__/rate-limit-store.test.ts +0 -430
  196. package/templates/apps/api/src/middleware/__tests__/rate-limit.test.ts +0 -1409
  197. package/templates/apps/api/src/middleware/__tests__/write-budget.test.ts +0 -174
  198. package/templates/apps/api/src/middleware/auth.ts +0 -864
  199. package/templates/apps/api/src/middleware/default-tenant.ts +0 -166
  200. package/templates/apps/api/src/middleware/rate-limit.ts +0 -983
  201. package/templates/apps/api/src/openapi/__tests__/openapi.test.ts +0 -264
  202. package/templates/apps/api/src/openapi/__tests__/spec-identity.test.ts +0 -182
  203. package/templates/apps/api/src/openapi/index.ts +0 -18
  204. package/templates/apps/api/src/openapi/spec.ts +0 -1815
  205. package/templates/apps/api/src/openapi/surface-drift.ts +0 -195
  206. package/templates/apps/api/src/routes/aeo/__tests__/index.test.ts +0 -175
  207. package/templates/apps/api/src/routes/aeo/index.ts +0 -107
  208. package/templates/apps/api/src/routes/auth/__tests__/auth-tokens.functional.test.ts +0 -196
  209. package/templates/apps/api/src/routes/auth/__tests__/auth-user.functional.test.ts +0 -249
  210. package/templates/apps/api/src/routes/auth/__tests__/hub-sign-in.test.ts +0 -532
  211. package/templates/apps/api/src/routes/auth/__tests__/tokens.test.ts +0 -313
  212. package/templates/apps/api/src/routes/auth/__tests__/transactional-email.test.ts +0 -413
  213. package/templates/apps/api/src/routes/auth/__tests__/user.test.ts +0 -609
  214. package/templates/apps/api/src/routes/auth/hub-sign-in.ts +0 -242
  215. package/templates/apps/api/src/routes/auth/tokens.ts +0 -211
  216. package/templates/apps/api/src/routes/auth/transactional-email.ts +0 -301
  217. package/templates/apps/api/src/routes/auth/user.ts +0 -305
  218. package/templates/apps/api/src/routes/billing/plan-checkout.ts +0 -325
  219. package/templates/apps/api/src/routes/checkout/__tests__/live-key.test.ts +0 -178
  220. package/templates/apps/api/src/routes/checkout/__tests__/offerings-authorization.test.ts +0 -1300
  221. package/templates/apps/api/src/routes/checkout/__tests__/session.test.ts +0 -448
  222. package/templates/apps/api/src/routes/checkout/__tests__/sessions.test.ts +0 -1742
  223. package/templates/apps/api/src/routes/checkout/index.ts +0 -34
  224. package/templates/apps/api/src/routes/checkout/session.ts +0 -171
  225. package/templates/apps/api/src/routes/checkout/sessions.ts +0 -540
  226. package/templates/apps/api/src/routes/consent/__tests__/account.test.ts +0 -386
  227. package/templates/apps/api/src/routes/consent/__tests__/sign-up-rate-limit.test.ts +0 -160
  228. package/templates/apps/api/src/routes/consent/account.ts +0 -268
  229. package/templates/apps/api/src/routes/consent/cookie.ts +0 -90
  230. package/templates/apps/api/src/routes/consent/index.ts +0 -26
  231. package/templates/apps/api/src/routes/consent/unsubscribe.ts +0 -127
  232. package/templates/apps/api/src/routes/content/__tests__/get-page.test.ts +0 -853
  233. package/templates/apps/api/src/routes/content/__tests__/list-pages.test.ts +0 -230
  234. package/templates/apps/api/src/routes/content/__tests__/list-types.test.ts +0 -44
  235. package/templates/apps/api/src/routes/content/__tests__/locale.test.ts +0 -118
  236. package/templates/apps/api/src/routes/content/__tests__/offerings.test.ts +0 -731
  237. package/templates/apps/api/src/routes/content/__tests__/pricing.test.ts +0 -753
  238. package/templates/apps/api/src/routes/content/__tests__/rate-limit.test.ts +0 -51
  239. package/templates/apps/api/src/routes/content/__tests__/search.test.ts +0 -450
  240. package/templates/apps/api/src/routes/content/__tests__/shown-offerings.test.ts +0 -762
  241. package/templates/apps/api/src/routes/content/get-page.ts +0 -268
  242. package/templates/apps/api/src/routes/content/index.ts +0 -49
  243. package/templates/apps/api/src/routes/content/list-pages.ts +0 -95
  244. package/templates/apps/api/src/routes/content/list-types.ts +0 -19
  245. package/templates/apps/api/src/routes/content/offerings.ts +0 -184
  246. package/templates/apps/api/src/routes/content/pricing.ts +0 -176
  247. package/templates/apps/api/src/routes/content/rate-limit.ts +0 -22
  248. package/templates/apps/api/src/routes/content/search.ts +0 -129
  249. package/templates/apps/api/src/routes/content/shown-offerings.ts +0 -229
  250. package/templates/apps/api/src/routes/content/slug.ts +0 -9
  251. package/templates/apps/api/src/routes/leads/__tests__/capture.test.ts +0 -88
  252. package/templates/apps/api/src/routes/leads/__tests__/list.test.ts +0 -171
  253. package/templates/apps/api/src/routes/leads/__tests__/magnet-completion.test.ts +0 -515
  254. package/templates/apps/api/src/routes/leads/__tests__/spoke.test.ts +0 -392
  255. package/templates/apps/api/src/routes/leads/__tests__/track.test.ts +0 -165
  256. package/templates/apps/api/src/routes/leads/index.ts +0 -573
  257. package/templates/apps/api/src/routes/leads/list.ts +0 -104
  258. package/templates/apps/api/src/routes/project-listings/__tests__/configured-application.test.ts +0 -626
  259. package/templates/apps/api/src/routes/project-listings/__tests__/drafts.test.ts +0 -1268
  260. package/templates/apps/api/src/routes/project-listings/__tests__/founder-identity.test.ts +0 -847
  261. package/templates/apps/api/src/routes/project-listings/__tests__/me.test.ts +0 -480
  262. package/templates/apps/api/src/routes/project-listings/__tests__/public.test.ts +0 -465
  263. package/templates/apps/api/src/routes/project-listings/__tests__/resume-email.test.ts +0 -872
  264. package/templates/apps/api/src/routes/project-listings/__tests__/site-answers.test.ts +0 -1022
  265. package/templates/apps/api/src/routes/project-listings/__tests__/site-key.test.ts +0 -484
  266. package/templates/apps/api/src/routes/project-listings/__tests__/structured-address.test.ts +0 -535
  267. package/templates/apps/api/src/routes/project-listings/index.ts +0 -164
  268. package/templates/apps/api/src/routes/project-listings/me.ts +0 -87
  269. package/templates/apps/api/src/routes/project-listings/patch-copy.ts +0 -224
  270. package/templates/apps/api/src/routes/project-listings/patch-draft.ts +0 -102
  271. package/templates/apps/api/src/routes/project-listings/public.ts +0 -98
  272. package/templates/apps/api/src/routes/project-listings/respond.ts +0 -48
  273. package/templates/apps/api/src/routes/project-listings/resume-token.ts +0 -27
  274. package/templates/apps/api/src/routes/project-listings/start.ts +0 -140
  275. package/templates/apps/api/src/routes/project-listings/submit.ts +0 -130
  276. package/templates/apps/api/src/routes/project-listings/verify-email.ts +0 -150
  277. package/templates/apps/api/src/routes/requests/__tests__/confirm.test.ts +0 -686
  278. package/templates/apps/api/src/routes/requests/confirm.ts +0 -601
  279. package/templates/apps/api/src/routes/requests/index.ts +0 -54
  280. package/templates/apps/api/src/routes/test/auth/__tests__/session.test.ts +0 -306
  281. package/templates/apps/api/src/routes/test/auth/session.ts +0 -143
  282. package/templates/apps/api/src/routes/webhooks/README.md +0 -398
  283. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-checkout-consent.test.ts +0 -649
  284. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-dunning.test.ts +0 -749
  285. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-flow-checkout.test.ts +0 -448
  286. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-idempotency.test.ts +0 -264
  287. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-livemode-live.test.ts +0 -159
  288. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-livemode.test.ts +0 -158
  289. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-offerings.test.ts +0 -814
  290. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-org-billing.test.ts +0 -301
  291. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-proposal-paid.test.ts +0 -369
  292. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-rate-limit.test.ts +0 -215
  293. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-request-paid.test.ts +0 -301
  294. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-site-filter.test.ts +0 -808
  295. package/templates/apps/api/src/routes/webhooks/__tests__/stripe.test.ts +0 -1155
  296. package/templates/apps/api/src/routes/webhooks/index.ts +0 -141
  297. package/templates/apps/api/src/routes/webhooks/stripe-offerings.ts +0 -384
  298. package/templates/apps/api/src/routes/webhooks/stripe.ts +0 -2026
  299. package/templates/apps/api/src/services/__tests__/abandon-email.test.ts +0 -528
  300. package/templates/apps/api/src/services/__tests__/answer-distributions.test.ts +0 -132
  301. package/templates/apps/api/src/services/__tests__/audit-log.test.ts +0 -1028
  302. package/templates/apps/api/src/services/__tests__/checkout-plan.test.ts +0 -313
  303. package/templates/apps/api/src/services/__tests__/consent-ledger.test.ts +0 -503
  304. package/templates/apps/api/src/services/__tests__/consent-migration.test.ts +0 -65
  305. package/templates/apps/api/src/services/__tests__/consent.test.ts +0 -299
  306. package/templates/apps/api/src/services/__tests__/default-tenant.test.ts +0 -147
  307. package/templates/apps/api/src/services/__tests__/deliverable-fulfillment.test.ts +0 -867
  308. package/templates/apps/api/src/services/__tests__/deliverable-resend.test.ts +0 -379
  309. package/templates/apps/api/src/services/__tests__/dunning-policy.test.ts +0 -368
  310. package/templates/apps/api/src/services/__tests__/entitlements.test.ts +0 -142
  311. package/templates/apps/api/src/services/__tests__/hub-sign-in.test.ts +0 -854
  312. package/templates/apps/api/src/services/__tests__/keyless-workspace-predicate.test.ts +0 -234
  313. package/templates/apps/api/src/services/__tests__/lead-accept-user.test.ts +0 -251
  314. package/templates/apps/api/src/services/__tests__/lead-routing.test.ts +0 -2660
  315. package/templates/apps/api/src/services/__tests__/listing-config.test.ts +0 -166
  316. package/templates/apps/api/src/services/__tests__/magnet-completion.test.ts +0 -389
  317. package/templates/apps/api/src/services/__tests__/person.test.ts +0 -1176
  318. package/templates/apps/api/src/services/__tests__/plan-offerings.test.ts +0 -444
  319. package/templates/apps/api/src/services/__tests__/project-listings.fence.test.ts +0 -154
  320. package/templates/apps/api/src/services/__tests__/public-site-resolver.test.ts +0 -137
  321. package/templates/apps/api/src/services/__tests__/request-confirm.test.ts +0 -531
  322. package/templates/apps/api/src/services/__tests__/revalidation.test.ts +0 -372
  323. package/templates/apps/api/src/services/__tests__/slack-notify.test.ts +0 -348
  324. package/templates/apps/api/src/services/__tests__/spoke-resolution.test.ts +0 -660
  325. package/templates/apps/api/src/services/__tests__/usage-aggregation.test.ts +0 -941
  326. package/templates/apps/api/src/services/__tests__/usage-credits.test.ts +0 -588
  327. package/templates/apps/api/src/services/__tests__/verified-email.test.ts +0 -78
  328. package/templates/apps/api/src/services/abandon-email.ts +0 -313
  329. package/templates/apps/api/src/services/aeo-score.ts +0 -325
  330. package/templates/apps/api/src/services/answer-distributions.ts +0 -138
  331. package/templates/apps/api/src/services/audit-log.ts +0 -961
  332. package/templates/apps/api/src/services/checkout-buyer.ts +0 -168
  333. package/templates/apps/api/src/services/consent.ts +0 -834
  334. package/templates/apps/api/src/services/default-tenant.ts +0 -416
  335. package/templates/apps/api/src/services/deliverable-fulfillment.ts +0 -755
  336. package/templates/apps/api/src/services/dunning-policy.ts +0 -294
  337. package/templates/apps/api/src/services/enrichment-shim.ts +0 -53
  338. package/templates/apps/api/src/services/entitlements.ts +0 -338
  339. package/templates/apps/api/src/services/hub-sign-in.ts +0 -472
  340. package/templates/apps/api/src/services/lead-accept-user.ts +0 -126
  341. package/templates/apps/api/src/services/lead-promotion.ts +0 -160
  342. package/templates/apps/api/src/services/lead-routing.ts +0 -1372
  343. package/templates/apps/api/src/services/leads-inbox.ts +0 -312
  344. package/templates/apps/api/src/services/listing-config.ts +0 -178
  345. package/templates/apps/api/src/services/magnet-completion.ts +0 -242
  346. package/templates/apps/api/src/services/offerings/__tests__/catalog.test.ts +0 -295
  347. package/templates/apps/api/src/services/offerings/__tests__/checkout-session-record.test.ts +0 -268
  348. package/templates/apps/api/src/services/offerings/__tests__/connection.test.ts +0 -868
  349. package/templates/apps/api/src/services/offerings/__tests__/fixtures.ts +0 -416
  350. package/templates/apps/api/src/services/offerings/__tests__/org-products.test.ts +0 -396
  351. package/templates/apps/api/src/services/offerings/__tests__/readers.test.ts +0 -681
  352. package/templates/apps/api/src/services/offerings/__tests__/source.test.ts +0 -231
  353. package/templates/apps/api/src/services/offerings/catalog.ts +0 -308
  354. package/templates/apps/api/src/services/offerings/checkout-authorization.ts +0 -385
  355. package/templates/apps/api/src/services/offerings/checkout-session-record.ts +0 -192
  356. package/templates/apps/api/src/services/offerings/connection.ts +0 -1003
  357. package/templates/apps/api/src/services/offerings/index.ts +0 -614
  358. package/templates/apps/api/src/services/offerings/source.ts +0 -140
  359. package/templates/apps/api/src/services/offerings/store.ts +0 -150
  360. package/templates/apps/api/src/services/owner-workspaces.ts +0 -132
  361. package/templates/apps/api/src/services/person.ts +0 -1188
  362. package/templates/apps/api/src/services/plan-offerings.ts +0 -125
  363. package/templates/apps/api/src/services/project-listing-resume-email.ts +0 -326
  364. package/templates/apps/api/src/services/project-listings.ts +0 -2073
  365. package/templates/apps/api/src/services/public-site-resolver.ts +0 -396
  366. package/templates/apps/api/src/services/request-confirm.ts +0 -698
  367. package/templates/apps/api/src/services/revalidation.ts +0 -235
  368. package/templates/apps/api/src/services/slack-notify.ts +0 -291
  369. package/templates/apps/api/src/services/usage-aggregation.ts +0 -516
  370. package/templates/apps/api/src/services/usage-credits.ts +0 -340
  371. package/templates/apps/api/src/services/verified-email.ts +0 -71
  372. package/templates/apps/mcp/__tests__/abuse/daily-cap.test.ts +0 -52
  373. package/templates/apps/mcp/__tests__/abuse/email-validator.test.ts +0 -46
  374. package/templates/apps/mcp/__tests__/abuse/guard.test.ts +0 -198
  375. package/templates/apps/mcp/__tests__/abuse/honeypot.test.ts +0 -36
  376. package/templates/apps/mcp/__tests__/abuse/user-agent-deny.test.ts +0 -54
  377. package/templates/apps/mcp/__tests__/aeo-cli-parity.test.ts +0 -116
  378. package/templates/apps/mcp/__tests__/audit-single-page.test.ts +0 -299
  379. package/templates/apps/mcp/__tests__/boot.test.ts +0 -280
  380. package/templates/apps/mcp/__tests__/catalog-drift.test.ts +0 -359
  381. package/templates/apps/mcp/__tests__/config/modules.test.ts +0 -78
  382. package/templates/apps/mcp/__tests__/get_business_hours.test.ts +0 -82
  383. package/templates/apps/mcp/__tests__/get_faq.test.ts +0 -80
  384. package/templates/apps/mcp/__tests__/get_locations.test.ts +0 -65
  385. package/templates/apps/mcp/__tests__/get_offerings.test.ts +0 -557
  386. package/templates/apps/mcp/__tests__/get_pricing.test.ts +0 -524
  387. package/templates/apps/mcp/__tests__/get_site_info.test.ts +0 -81
  388. package/templates/apps/mcp/__tests__/http-transport.test.ts +0 -1151
  389. package/templates/apps/mcp/__tests__/index.test.ts +0 -195
  390. package/templates/apps/mcp/__tests__/lib/audit-single-page-readiness-scan.test.ts +0 -191
  391. package/templates/apps/mcp/__tests__/lib/commerce-claim.test.ts +0 -531
  392. package/templates/apps/mcp/__tests__/lib/content-adapter-parity.test.ts +0 -65
  393. package/templates/apps/mcp/__tests__/lib/content-adapter.test.ts +0 -187
  394. package/templates/apps/mcp/__tests__/lib/content-root.test.ts +0 -93
  395. package/templates/apps/mcp/__tests__/lib/errors.test.ts +0 -75
  396. package/templates/apps/mcp/__tests__/lib/fail-closed-tools.test.ts +0 -165
  397. package/templates/apps/mcp/__tests__/lib/public-workspace.test.ts +0 -124
  398. package/templates/apps/mcp/__tests__/list_pages.test.ts +0 -228
  399. package/templates/apps/mcp/__tests__/locale.test.ts +0 -135
  400. package/templates/apps/mcp/__tests__/module-exclusion.test.ts +0 -175
  401. package/templates/apps/mcp/__tests__/purchase-disabled.test.ts +0 -101
  402. package/templates/apps/mcp/__tests__/read_content.test.ts +0 -474
  403. package/templates/apps/mcp/__tests__/request_callback.test.ts +0 -225
  404. package/templates/apps/mcp/__tests__/search_content.test.ts +0 -256
  405. package/templates/apps/mcp/__tests__/server.test.ts +0 -388
  406. package/templates/apps/mcp/__tests__/start_purchase.test.ts +0 -448
  407. package/templates/apps/mcp/__tests__/submit_lead.test.ts +0 -307
  408. package/templates/apps/mcp/__tests__/subscribe_newsletter.test.ts +0 -223
  409. package/templates/apps/mcp/__tests__/tools/create_project.test.ts +0 -243
  410. package/templates/apps/mcp/__tests__/tools/purchase.test.ts +0 -451
  411. package/templates/apps/mcp/src/abuse/daily-cap.ts +0 -47
  412. package/templates/apps/mcp/src/abuse/email-validator.ts +0 -25
  413. package/templates/apps/mcp/src/abuse/honeypot.ts +0 -21
  414. package/templates/apps/mcp/src/abuse/index.ts +0 -342
  415. package/templates/apps/mcp/src/abuse/user-agent-deny.ts +0 -58
  416. package/templates/apps/mcp/src/boot.ts +0 -167
  417. package/templates/apps/mcp/src/config/modules.ts +0 -43
  418. package/templates/apps/mcp/src/http-transport.ts +0 -526
  419. package/templates/apps/mcp/src/lib/audit-single-page.ts +0 -308
  420. package/templates/apps/mcp/src/lib/commerce-claim.ts +0 -263
  421. package/templates/apps/mcp/src/lib/content-adapter.ts +0 -142
  422. package/templates/apps/mcp/src/lib/empty-content-adapter.ts +0 -139
  423. package/templates/apps/mcp/src/lib/errors.ts +0 -61
  424. package/templates/apps/mcp/src/lib/license-key-store.ts +0 -45
  425. package/templates/apps/mcp/src/lib/locales.ts +0 -171
  426. package/templates/apps/mcp/src/lib/prisma.ts +0 -39
  427. package/templates/apps/mcp/src/lib/public-workspace.ts +0 -133
  428. package/templates/apps/mcp/src/lib/resolve-locale.ts +0 -30
  429. package/templates/apps/mcp/src/lib/shown-offerings.ts +0 -105
  430. package/templates/apps/mcp/src/lib/stripe-tax-signal.ts +0 -59
  431. package/templates/apps/mcp/src/request-context.ts +0 -52
  432. package/templates/apps/mcp/src/server.ts +0 -343
  433. package/templates/apps/mcp/src/serverless-app.ts +0 -88
  434. package/templates/apps/mcp/src/tools/audit.ts +0 -127
  435. package/templates/apps/mcp/src/tools/capture_lead.ts +0 -64
  436. package/templates/apps/mcp/src/tools/create_project.ts +0 -134
  437. package/templates/apps/mcp/src/tools/get_business_hours.ts +0 -68
  438. package/templates/apps/mcp/src/tools/get_faq.ts +0 -71
  439. package/templates/apps/mcp/src/tools/get_locations.ts +0 -88
  440. package/templates/apps/mcp/src/tools/get_offerings.ts +0 -96
  441. package/templates/apps/mcp/src/tools/get_pricing.ts +0 -94
  442. package/templates/apps/mcp/src/tools/get_site_info.ts +0 -86
  443. package/templates/apps/mcp/src/tools/index.ts +0 -137
  444. package/templates/apps/mcp/src/tools/list_pages.ts +0 -74
  445. package/templates/apps/mcp/src/tools/person_notes.ts +0 -25
  446. package/templates/apps/mcp/src/tools/proposals.ts +0 -27
  447. package/templates/apps/mcp/src/tools/purchase.ts +0 -205
  448. package/templates/apps/mcp/src/tools/read_content.ts +0 -75
  449. package/templates/apps/mcp/src/tools/request_callback.ts +0 -59
  450. package/templates/apps/mcp/src/tools/search_content.ts +0 -67
  451. package/templates/apps/mcp/src/tools/subscribe_newsletter.ts +0 -57
  452. package/templates/apps/mcp/src/workspace-server.ts +0 -224
  453. package/templates/database/CHANGELOG.md +0 -961
  454. package/templates/database/LICENSE +0 -202
  455. package/templates/database/NOTICE +0 -2
  456. package/templates/database/README.md +0 -243
  457. package/templates/database/__tests__/agents.db.test.ts +0 -320
  458. package/templates/database/__tests__/appointment.db.test.ts +0 -106
  459. package/templates/database/__tests__/artifact-content-store.db.test.ts +0 -316
  460. package/templates/database/__tests__/composite-fence.db.test.ts +0 -206
  461. package/templates/database/__tests__/consent-ledger.db.test.ts +0 -345
  462. package/templates/database/__tests__/consent-source-checkout-migration.test.ts +0 -79
  463. package/templates/database/__tests__/fence-fan-out.db.test.ts +0 -715
  464. package/templates/database/__tests__/fixtures/appointment-create-probe.ts +0 -79
  465. package/templates/database/__tests__/fixtures/person-backfill.json +0 -264
  466. package/templates/database/__tests__/fixtures/person-contact-backfill.json +0 -182
  467. package/templates/database/__tests__/fixtures/project-listing-consent-probe.ts +0 -100
  468. package/templates/database/__tests__/flow-completion-migration.test.ts +0 -115
  469. package/templates/database/__tests__/flow-completion.db.test.ts +0 -136
  470. package/templates/database/__tests__/flow-workspace-key.db.test.ts +0 -263
  471. package/templates/database/__tests__/flows-listing-diagnostic.test.ts +0 -392
  472. package/templates/database/__tests__/flows-presets.test.ts +0 -173
  473. package/templates/database/__tests__/in-page-magnets-migration.test.ts +0 -161
  474. package/templates/database/__tests__/lead-idempotency-key.db.test.ts +0 -92
  475. package/templates/database/__tests__/member-area.db.test.ts +0 -257
  476. package/templates/database/__tests__/member-contract-migration.test.ts +0 -85
  477. package/templates/database/__tests__/member-contract.db.test.ts +0 -413
  478. package/templates/database/__tests__/offerings-checkout-session.db.test.ts +0 -270
  479. package/templates/database/__tests__/offerings-migration.test.ts +0 -197
  480. package/templates/database/__tests__/offerings-shown-price-ids-migration.test.ts +0 -86
  481. package/templates/database/__tests__/offerings.db.test.ts +0 -303
  482. package/templates/database/__tests__/outbound-message-action.db.test.ts +0 -80
  483. package/templates/database/__tests__/person-contact.db.test.ts +0 -563
  484. package/templates/database/__tests__/person-notes.db.test.ts +0 -249
  485. package/templates/database/__tests__/person.db.test.ts +0 -586
  486. package/templates/database/__tests__/piece-kind-migration.test.ts +0 -67
  487. package/templates/database/__tests__/piece-kind.db.test.ts +0 -208
  488. package/templates/database/__tests__/prefixed-ids.db.test.ts +0 -222
  489. package/templates/database/__tests__/project-listing-consent-at.db.test.ts +0 -111
  490. package/templates/database/__tests__/seed.test.ts +0 -240
  491. package/templates/database/__tests__/spoke-registry.db.test.ts +0 -191
  492. package/templates/database/__tests__/tenancy.test.ts +0 -141
  493. package/templates/database/__tests__/user-cascade.test.ts +0 -140
  494. package/templates/database/_gitignore +0 -8
  495. package/templates/database/auth/.gitkeep +0 -0
  496. package/templates/database/auth/schema.prisma +0 -641
  497. package/templates/database/config/.gitkeep +0 -0
  498. package/templates/database/config/schema.prisma +0 -441
  499. package/templates/database/content/.gitkeep +0 -0
  500. package/templates/database/content/schema.prisma +0 -339
  501. package/templates/database/eslint.config.mjs +0 -69
  502. package/templates/database/flows/listing-diagnostic.ts +0 -182
  503. package/templates/database/flows/presets.ts +0 -315
  504. package/templates/database/inbox/.gitkeep +0 -0
  505. package/templates/database/inbox/README.md +0 -3
  506. package/templates/database/inbox/__tests__/schema.test.ts +0 -44
  507. package/templates/database/inbox/schema.prisma +0 -1447
  508. package/templates/database/jest.config.cjs +0 -36
  509. package/templates/database/migrations/20260508000000_add_inbox_namespace/migration.sql +0 -328
  510. package/templates/database/migrations/20260513000000_better_auth_migration/migration.sql +0 -100
  511. package/templates/database/migrations/20260515000000_add_user_billing_fields/migration.sql +0 -28
  512. package/templates/database/migrations/20260516000000_add_user_tier_care_plan_seat/migration.sql +0 -25
  513. package/templates/database/migrations/20260518000000_add_telemetry_records/migration.sql +0 -42
  514. package/templates/database/migrations/20260525000000_theme_wiring/migration.sql +0 -67
  515. package/templates/database/migrations/20260710000000_retire_commercial_tier/migration.sql +0 -21
  516. package/templates/database/migrations/20260712215647_add_multi_tenant_tenancy/migration.sql +0 -201
  517. package/templates/database/migrations/20260713143320_reanchor_site_config_to_workspace/migration.sql +0 -67
  518. package/templates/database/migrations/20260713174000_add_audit_logs/migration.sql +0 -46
  519. package/templates/database/migrations/20260713190000_drop_telemetry_records/migration.sql +0 -25
  520. package/templates/database/migrations/20260713192000_add_uuidv7_function/migration.sql +0 -49
  521. package/templates/database/migrations/20260713192429_prefixed_uuid_entity_ids/migration.sql +0 -197
  522. package/templates/database/migrations/20260713200000_add_org_billing/migration.sql +0 -32
  523. package/templates/database/migrations/20260714000000_add_lead_promotion_fields/migration.sql +0 -22
  524. package/templates/database/migrations/20260714010000_add_usage_billing_content_models/migration.sql +0 -151
  525. package/templates/database/migrations/20260714020000_add_usage_billing_auth_config_models/migration.sql +0 -223
  526. package/templates/database/migrations/20260714030000_credit_balance_non_negative/migration.sql +0 -22
  527. package/templates/database/migrations/20260714030000_widen_usage_billing_report_aggregates/migration.sql +0 -32
  528. package/templates/database/migrations/20260810233516_add_flow_engine_models/migration.sql +0 -40
  529. package/templates/database/migrations/20260811020000_add_flow_session_abandon_email_columns/migration.sql +0 -4
  530. package/templates/database/migrations/20260811030000_add_flow_session_abandon_email_index/migration.sql +0 -2
  531. package/templates/database/migrations/20260811040000_add_flow_session_segment/migration.sql +0 -2
  532. package/templates/database/migrations/20260811050000_add_deliverable_models/migration.sql +0 -29
  533. package/templates/database/migrations/20260812000000_add_deliverable_grant_send_columns/migration.sql +0 -6
  534. package/templates/database/migrations/20260902222948_add_waitlist_experiment_models/migration.sql +0 -39
  535. package/templates/database/migrations/20260902224500_add_waitlist_id_format_checks/migration.sql +0 -24
  536. package/templates/database/migrations/20260903004112_add_flow_session_flags_aeo_score/migration.sql +0 -3
  537. package/templates/database/migrations/20260903010000_add_playbook_instance/migration.sql +0 -33
  538. package/templates/database/migrations/20260904000000_add_waitlist_followup_send/migration.sql +0 -30
  539. package/templates/database/migrations/20260905230000_add_flow_checkout/migration.sql +0 -47
  540. package/templates/database/migrations/20260906000000_add_flow_checkout_idempotency/migration.sql +0 -16
  541. package/templates/database/migrations/20260907120000_add_project_listing/migration.sql +0 -47
  542. package/templates/database/migrations/20260907130000_add_project_listing_slack_columns/migration.sql +0 -10
  543. package/templates/database/migrations/20260907180000_add_listing_csv_send/migration.sql +0 -26
  544. package/templates/database/migrations/20260909120000_project_listings_platform/migration.sql +0 -90
  545. package/templates/database/migrations/20260909180000_listing_draft_and_fields/migration.sql +0 -174
  546. package/templates/database/migrations/20260910120000_listing_public_site_key/migration.sql +0 -14
  547. package/templates/database/migrations/20260911120000_listing_copy_edit_audit/migration.sql +0 -25
  548. package/templates/database/migrations/20260911140000_listing_structured_address/migration.sql +0 -32
  549. package/templates/database/migrations/20260911180000_consent_grants/migration.sql +0 -71
  550. package/templates/database/migrations/20260911200000_listing_site_answers/migration.sql +0 -30
  551. package/templates/database/migrations/20260912120000_listing_owner_link/migration.sql +0 -49
  552. package/templates/database/migrations/20260914120000_listing_founder_identity/migration.sql +0 -123
  553. package/templates/database/migrations/20260915120000_project_listing_solution/migration.sql +0 -15
  554. package/templates/database/migrations/20260916120000_artifact_content_store/migration.sql +0 -158
  555. package/templates/database/migrations/20260917120000_callback_request_confirm/migration.sql +0 -40
  556. package/templates/database/migrations/20260918120000_add_appointment/migration.sql +0 -67
  557. package/templates/database/migrations/20260918120000_asset_metadata_columns/migration.sql +0 -70
  558. package/templates/database/migrations/20260919120000_flow_workspace_key/migration.sql +0 -181
  559. package/templates/database/migrations/20260919130000_flow_definition_admin_columns/migration.sql +0 -172
  560. package/templates/database/migrations/20260919130000_workspace_meetings/migration.sql +0 -41
  561. package/templates/database/migrations/20260919140000_inbox_workspace_key/migration.sql +0 -185
  562. package/templates/database/migrations/20260920120000_lead_handled_at/migration.sql +0 -70
  563. package/templates/database/migrations/20260920130000_lead_workspace_source_index/migration.sql +0 -57
  564. package/templates/database/migrations/20260921120000_deliverable_grant_workspace_key/migration.sql +0 -68
  565. package/templates/database/migrations/20260922120000_tenancy_fence/migration.sql +0 -1067
  566. package/templates/database/migrations/20260923120000_listing_capturing_magnet/migration.sql +0 -210
  567. package/templates/database/migrations/20261003120000_spoke_registry/migration.sql +0 -80
  568. package/templates/database/migrations/20261003130000_scheduling_connection/migration.sql +0 -49
  569. package/templates/database/migrations/20261005120000_agents/migration.sql +0 -84
  570. package/templates/database/migrations/20261008120000_user_last_workspace/migration.sql +0 -35
  571. package/templates/database/migrations/20261008130000_lead_idempotency_key/migration.sql +0 -20
  572. package/templates/database/migrations/20261009120000_agent_grants/migration.sql +0 -33
  573. package/templates/database/migrations/20261010120000_person/migration.sql +0 -106
  574. package/templates/database/migrations/20261010121000_person_backfill/migration.sql +0 -132
  575. package/templates/database/migrations/20261010130000_agent_grants_people_read/migration.sql +0 -20
  576. package/templates/database/migrations/20261011120000_member_area/migration.sql +0 -158
  577. package/templates/database/migrations/20261011130000_agent_grants_member_pieces_manage/migration.sql +0 -21
  578. package/templates/database/migrations/20261012120000_member_contract/migration.sql +0 -192
  579. package/templates/database/migrations/20261013120000_lead_spoke_checkout/migration.sql +0 -20
  580. package/templates/database/migrations/20261014120000_consent_ledger/migration.sql +0 -122
  581. package/templates/database/migrations/20261014120000_person_contact/migration.sql +0 -231
  582. package/templates/database/migrations/20261015120000_person_notes/migration.sql +0 -77
  583. package/templates/database/migrations/20261015120000_rate_limit_counters/migration.sql +0 -43
  584. package/templates/database/migrations/20261016120000_piece_kind/migration.sql +0 -95
  585. package/templates/database/migrations/20261017120000_outbound_message_action/migration.sql +0 -30
  586. package/templates/database/migrations/20261018120000_flow_completion/migration.sql +0 -52
  587. package/templates/database/migrations/20261019120000_consent_source_checkout/migration.sql +0 -27
  588. package/templates/database/migrations/20261020120000_offerings_data_model/migration.sql +0 -146
  589. package/templates/database/migrations/20261021120000_offerings_checkout_session/migration.sql +0 -77
  590. package/templates/database/migrations/20261022120000_in_page_magnets/migration.sql +0 -45
  591. package/templates/database/migrations/20261023120000_offerings_shown_price_ids/migration.sql +0 -47
  592. package/templates/database/migrations/20261024120000_organization_plan_checkout_session/migration.sql +0 -16
  593. package/templates/database/migrations/migration_lock.toml +0 -3
  594. package/templates/database/ops/.gitkeep +0 -0
  595. package/templates/database/ops/schema.prisma +0 -43
  596. package/templates/database/package.json +0 -89
  597. package/templates/database/schema.prisma +0 -71
  598. package/templates/database/scripts/db-generate-locked.sh +0 -80
  599. package/templates/database/scripts/person-backfill.sql +0 -132
  600. package/templates/database/tenancy.ts +0 -183
  601. package/templates/database/tsconfig.build.json +0 -16
  602. package/templates/database/tsconfig.flows.json +0 -15
  603. package/templates/database/tsconfig.json +0 -16
  604. package/templates/database/tsconfig.tenancy.json +0 -14
@@ -110,7 +110,7 @@ export const ARCHITECTURE_BASE = {
110
110
  version: 1,
111
111
  composition_model: {
112
112
  tiers: {
113
- data: "database/ — Prisma schema + migrations",
113
+ data: "database/ — Prisma config + seed; schema and migrations ship in @working-theory/database",
114
114
  api: "apps/api (public HTTP API) + apps/mcp (agent tools)",
115
115
  presentation: "apps/web — frontend surfaces",
116
116
  },
@@ -150,82 +150,6 @@ export const ARCHITECTURE_BASE = {
150
150
  },
151
151
  ],
152
152
  };
153
- /**
154
- * The member area's apps/api files (#7877 D9, D11), co-owned by `workspace`
155
- * and `multi-tenant`: server.ts registers all five routes under the
156
- * `workspace || multi-tenant` disjunction, so both bundles must deliver every
157
- * file behind it — the three operator route files, the two member route
158
- * files, the member resolution (`services/member-area.ts`) and the member
159
- * data boundary (`lib/member-store.ts`).
160
- *
161
- * #8169 D9 adds the five Phase 1 member reads registered under that same
162
- * disjunction. Its two other reads — `routes/member/meeting-types.ts` and
163
- * `availability.ts` — reach `services/scheduling/`, so they are the
164
- * `scheduling` slice's, not listed here.
165
- *
166
- * #8170 D11 adds the four member writes registered under that same
167
- * disjunction (the message POST rides `messages.ts`). The fifth —
168
- * `routes/member/bookings.ts` — reaches `services/scheduling/`, so it is the
169
- * `scheduling` slice's.
170
- */
171
- const MEMBER_AREA_FILES = [
172
- "apps/api/src/routes/workspaces/pieces.ts",
173
- "apps/api/src/routes/workspaces/plan.ts",
174
- "apps/api/src/routes/workspaces/messages-out.ts",
175
- // #8171 D8 — the workspace Requests read; imports only pieces.ts,
176
- // lib/tenant-db.ts and @working-theory/validation.
177
- "apps/api/src/routes/workspaces/requests.ts",
178
- "apps/api/src/routes/member/pieces.ts",
179
- "apps/api/src/routes/member/messages.ts",
180
- "apps/api/src/routes/member/purchases.ts",
181
- "apps/api/src/routes/member/appointments.ts",
182
- "apps/api/src/routes/member/artifacts.ts",
183
- "apps/api/src/routes/member/request-form.ts",
184
- "apps/api/src/routes/member/billing.ts",
185
- "apps/api/src/routes/member/requests.ts",
186
- // #8515 D13 — the client's onboarding read and write.
187
- "apps/api/src/routes/member/onboarding.ts",
188
- "apps/api/src/routes/member/artifact-review.ts",
189
- "apps/api/src/routes/member/profile.ts",
190
- "apps/api/src/routes/member/deletion-request.ts",
191
- // #8438 D6 — the member's own consents; the same gate as the writes above.
192
- "apps/api/src/routes/member/consents.ts",
193
- "apps/api/src/services/member-area.ts",
194
- // #8516 D8 — whether proposal payment runs, and the Checkout Session;
195
- // imported only by member-area files (pieces.ts and the two member
196
- // artifact routes), and itself imports only base files.
197
- "apps/api/src/services/proposal-payments.ts",
198
- "apps/api/src/lib/member-store.ts",
199
- // #8226 D12 — the member-request match CLI; both import member-store.ts,
200
- // which a build without the member slice does not carry.
201
- "apps/api/src/lib/member-request-match.ts",
202
- "apps/api/src/bin/member-request-match.ts",
203
- ];
204
- /**
205
- * The workspace asset store (#5854), CO-OWNED by the `workspace` and
206
- * `multi-tenant` slices.
207
- *
208
- * `server.ts` registers both of its routes under
209
- * `isModuleEnabled("workspace") || isModuleEnabled("multi-tenant")`, and a file
210
- * behind a two-module disjunction must be deliverable by BOTH bundles — or
211
- * whichever module lacks it throws ERR_MODULE_NOT_FOUND during `build()`. One
212
- * array spread into both `ownedFiles` lists makes the two copies incapable of
213
- * drifting, which matters because a drift only surfaces in a scaffolded
214
- * customer repo rather than here.
215
- *
216
- * `routes/assets/index.ts` is listed although it registers nothing: the
217
- * template-exclusion closure runs over IMPORTERS, so a shared-constants module
218
- * that is imported BY the routes and imports neither of them is never reached
219
- * from them, and an unlisted one would ship into the keyless Free starter.
220
- */
221
- const ASSET_STORE_FILES = [
222
- "apps/api/src/routes/assets/index.ts",
223
- "apps/api/src/routes/assets/upload.ts",
224
- "apps/api/src/routes/assets/read.ts",
225
- // The manage routes — list, PATCH, DELETE (#6093 D16).
226
- "apps/api/src/routes/assets/manage.ts",
227
- "apps/api/src/lib/asset-store.ts",
228
- ];
229
153
  /**
230
154
  * The auth-adapter exception (#587 in the AILK repo's own architecture.yaml):
231
155
  * the base apps/web hands Better Auth its Prisma client from
@@ -548,7 +472,7 @@ export const MODULE_SLICES = {
548
472
  apps: {
549
473
  admin: {
550
474
  path: "apps/admin",
551
- description: "Next.js — authed Admin app (Organization → Workspace → Membership). Hosts the organization-plugin Better Auth handlers; imports the database only via lib/prisma-for-auth.ts (auth-adapter exception); all domain data via apps/api's workspace-scoped routes over HTTP.",
475
+ description: "Next.js — the Admin shell (Organization → Workspace → Membership): boots @working-theory/admin, which carries the pages, components, lib and auth, through generated route re-exports (#9570). Hosts the organization-plugin Better Auth route; the database read sits in that package (its lib/prisma-for-auth.ts, the auth-adapter exception); all domain data via apps/api's workspace-scoped routes over HTTP.",
552
476
  may_import_from: [
553
477
  "database",
554
478
  "packages/templates",
@@ -699,12 +623,17 @@ export const MODULE_SLICES = {
699
623
  // ownedFiles (S1, #5088). Verified against the current filesystem and
700
624
  // server.ts's module-conditional registration (isModuleEnabled('multi-tenant')).
701
625
  //
702
- // apps-paid/admin/** is a single glob — the whole app (43 files as of
703
- // this pass, excluding __tests__/node_modules), just moved here from
704
- // apps/workspace by a parallel workstream on this same branch. Later
705
- // renamed in place from its former Workspace-prefixed directory name by
706
- // #5637, the Admin-vocabulary rename. Unlike every other entry below,
707
- // this one is intentionally a glob, not an enumeration.
626
+ // apps-paid/admin/** is a single glob — the whole app, originally moved
627
+ // here from apps/workspace by a parallel workstream on this same branch,
628
+ // later renamed in place from its former Workspace-prefixed directory
629
+ // name by #5637, the Admin-vocabulary rename. Since #9570 the app under
630
+ // the glob is the Next SHELL (@working-theory/admin-shell): its configs,
631
+ // root layout, stylesheet, icons, Better Auth route, a re-exporting
632
+ // auth.ts and the generated re-exports of the package's routes — the
633
+ // pages, components, lib and auth implementation live in
634
+ // @working-theory/admin (packages-paid/admin), which the staged shell
635
+ // depends on, so the bundle carries no Admin source. Unlike every other
636
+ // entry below, this one is intentionally a glob, not an enumeration.
708
637
  //
709
638
  // apps/api/src/routes/project-listings/ is MIXED (free anonymous surface
710
639
  // + tenant dashboard sharing one directory) — only the tenant-guarded
@@ -723,20 +652,20 @@ export const MODULE_SLICES = {
723
652
  // patch.ts (tenant) AND ALSO by patch-draft.ts/public.ts (free) —
724
653
  // shared within the directory across the free/paid split, so it stays.
725
654
  //
726
- // apps/api/src/routes/waitlist-experiments/respond.ts, by contrast, IS
655
+ // routes/waitlist-experiments/respond.ts (now api-signal-collectors'), by contrast, IS
727
656
  // listed: grepped every `from "./respond.js"` importer in the repo and
728
657
  // it is used ONLY by this directory's own comparison.ts/list.ts/signup.ts/
729
658
  // signups.ts — all four tenant-scoped — so unlike its project-listings
730
659
  // namesake it is NOT shared with a free route.
731
660
  //
732
- // apps/api/src/middleware/tenant.ts, services/tenant-context.ts,
661
+ // packages/api/src/middleware/tenant.ts, services/tenant-context.ts,
733
662
  // services/waitlist-dashboard.ts: each grepped for every importer
734
663
  // repo-wide. tenant.ts is registered only in server.ts's tenantScope;
735
664
  // tenant-context.ts backs only workspaces/tenant-guarded routes;
736
665
  // waitlist-dashboard.ts backs only the four waitlist-experiments handlers
737
666
  // above. None is reachable from a free route.
738
667
  //
739
- // apps/api/src/lib/tenant-db.ts and lib/ws-token.ts are an ADDITION beyond
668
+ // packages/api/src/lib/tenant-db.ts and lib/ws-token.ts are an ADDITION beyond
740
669
  // this card's literal checklist, found by tracing workspaces/*.ts's own
741
670
  // imports: tenant-db.ts (the per-tenant Prisma-scoped client) is used only
742
671
  // by services/tenant-context.ts and the three workspaces/*.ts route files
@@ -790,117 +719,6 @@ export const MODULE_SLICES = {
790
719
  // not file grain, so it stays out of this literal list rather than
791
720
  // asserting a split the evidence doesn't cleanly support.
792
721
  ownedFiles: [
793
- "apps/api/src/routes/workspaces/index.ts",
794
- "apps/api/src/routes/workspaces/sessions.ts",
795
- "apps/api/src/routes/workspaces/config.ts",
796
- // #8926 D1 — the workspace Offerings routes, registered in the
797
- // multi-tenant tenant scope beside the billing routes.
798
- "apps/api/src/routes/workspaces/offerings.ts",
799
- // #8438 D8 — the Admin owner's consents to Working Theory: registered
800
- // under `isModuleEnabled("multi-tenant")` alone, the module that
801
- // contributes the Admin app.
802
- "apps/api/src/routes/consent/platform.ts",
803
- // Co-owned with `workspace` (#5853): the content-write scope is gated on
804
- // content-write AND (workspace || multi-tenant) and this file imports
805
- // lib/tenant-db.ts, so each tenancy slice must deliver it.
806
- "apps/api/src/routes/workspaces/content.ts",
807
- ...ASSET_STORE_FILES,
808
- "apps/api/src/routes/billing/index.ts",
809
- "apps/api/src/routes/billing/portal.ts",
810
- "apps/api/src/routes/billing/read.ts",
811
- "apps/api/src/routes/billing/stripe-connection.ts",
812
- "apps/api/src/routes/billing/stripe-products.ts",
813
- "apps/api/src/routes/billing/usage.ts",
814
- "apps/api/src/routes/waitlist-experiments/index.ts",
815
- "apps/api/src/routes/waitlist-experiments/list.ts",
816
- "apps/api/src/routes/waitlist-experiments/comparison.ts",
817
- "apps/api/src/routes/waitlist-experiments/signup.ts",
818
- "apps/api/src/routes/waitlist-experiments/signups.ts",
819
- "apps/api/src/routes/waitlist-experiments/respond.ts",
820
- "apps/api/src/routes/project-listings/get.ts",
821
- "apps/api/src/routes/project-listings/list.ts",
822
- "apps/api/src/routes/project-listings/patch.ts",
823
- "apps/api/src/middleware/tenant.ts",
824
- "apps/api/src/services/tenant-context.ts",
825
- "apps/api/src/services/waitlist-dashboard.ts",
826
- // #6258 — the file waitlist-dashboard.ts imports for the pinned
827
- // platform-operator read scope. It rides BOTH slices for the same
828
- // reason its importer does: an unlisted import target breaks a
829
- // signal-collectors-without-multi-tenant scaffold at build() time.
830
- "apps/api/src/services/waitlist-operator-reads.ts",
831
- // #6204/#6280 CI fix — `listUnhandledMessages`/`markMessageHandled`
832
- // (the "Needs-you" message read/write over `tenantDb(tenant).leads`)
833
- // moved here off `services/leads-inbox.ts`, a BASE-tier file every
834
- // scaffold ships. Importing `lib/tenant-db.ts` from that base file
835
- // walked `paidModuleTemplateExclusions()`'s companion closure
836
- // (`lib/import-graph.ts`) BACKWARD into `leads-inbox.ts` itself and
837
- // then into every one of `apps/api/src/{server,cli,index,
838
- // vercel-handler}.ts` — all of which reach it through
839
- // `routes/leads/list.ts` — dropping them from a keyless scaffold
840
- // (`__tests__/paid-module-exclusions.test.ts`'s `MUST_SHIP` guard,
841
- // #5678's cascade shape recurring a third time).
842
- //
843
- // #6216 — now reached: `routes/workspaces/messages.ts` (below)
844
- // consumes `getMessage` alongside the two functions above. That route
845
- // registers under `isModuleEnabled("workspace") ||
846
- // isModuleEnabled("multi-tenant")` — the SAME gate
847
- // `workspaces/general.ts`/`members.ts` register under, NOT the
848
- // multi-tenant-only family `workspaces/meetings.ts`/`config.ts` sit
849
- // in — so this file and `routes/workspaces/messages.ts` are now
850
- // CO-OWNED with `workspace` too (see that slice's entry below), the
851
- // asset-store precedent: a file behind an OR gate must be
852
- // deliverable by BOTH bundles.
853
- "apps/api/src/services/inbox-messages.ts",
854
- "apps/api/src/routes/workspaces/messages.ts",
855
- // #7535 — the Inbox submissions and subscribers reads: the same
856
- // workspace||multi-tenant gate and the same tenant-db.ts import as
857
- // the two lines above, so co-owned with `workspace` for the same
858
- // reason (see that slice's entry below).
859
- "apps/api/src/routes/workspaces/submissions.ts",
860
- "apps/api/src/routes/workspaces/subscribers.ts",
861
- "apps/api/src/services/inbox-submissions.ts",
862
- // #9170 — the Inbox orders read: the same gate and the same
863
- // tenant-db.ts import, co-owned with `workspace` for the same reason.
864
- "apps/api/src/routes/workspaces/orders.ts",
865
- "apps/api/src/services/inbox-orders.ts",
866
- // #852 D8 — the People reads: the same workspace||multi-tenant gate and
867
- // the same tenant-db.ts import, co-owned with `workspace` for the same
868
- // reason.
869
- "apps/api/src/routes/workspaces/people.ts",
870
- // #7877 D9, D11 — the member area: the operator's routes and the member
871
- // reads register under the same workspace||multi-tenant gate, so each
872
- // file behind it — the routes, the member resolution and the member
873
- // data boundary — is co-owned with `workspace`, as people.ts is.
874
- ...MEMBER_AREA_FILES,
875
- // #7399 — the two siblings #6216 left `workspace`-only. They register
876
- // under that same `workspace || multi-tenant` gate, so a scaffold with
877
- // `multi-tenant` and without `workspace` loaded them with no file behind
878
- // the specifier and 500'd every request at server construction. Co-owned
879
- // with `workspace` (see that slice's entry below); both import only
880
- // `lib/tenant-db.ts` (owned here) and base files.
881
- // `__tests__/tenancy-slice-resolution.test.ts` holds the whole gate set.
882
- "apps/api/src/routes/workspaces/general.ts",
883
- "apps/api/src/routes/workspaces/members.ts",
884
- // #3591 PR-B — the agent seat's routes, a sibling of `members.ts` under
885
- // the same `workspace || multi-tenant` gate, so co-owned with
886
- // `workspace` for the #7399 reason above.
887
- "apps/api/src/routes/workspaces/agents.ts",
888
- // #3591 PR-E — the signed-in workspace MCP tools that twin the agent
889
- // context, message and submission routes above. Each registers when
890
- // its twin route does (`workspace || multi-tenant`), so co-owned with
891
- // `workspace` for the same reason; the application tools' file is
892
- // co-owned with `signal-collectors` instead, its routes' gate.
893
- "apps/mcp/src/tools/agent_context.ts",
894
- "apps/mcp/src/tools/inbox_messages.ts",
895
- "apps/mcp/src/tools/inbox_submissions.ts",
896
- "apps/mcp/src/tools/inbox_applications.ts",
897
- "apps/api/src/lib/tenant-db.ts",
898
- "apps/api/src/lib/ws-token.ts",
899
- // #6157 D16 — the magnet Admin authoring surface, co-owned with
900
- // `signal-collectors` below for the SAME reason #5677 co-owns the
901
- // review surface under both: its scope is registered under the
902
- // widened `multi-tenant || signal-collectors` gate.
903
- "apps/api/src/routes/magnets/index.ts",
904
722
  "apps/web/app/[locale]/(authed)/waitlist/page.tsx",
905
723
  "apps/web/app/[locale]/(authed)/waitlist/[experimentId]/page.tsx",
906
724
  "apps/web/app/[locale]/(authed)/waitlist/[experimentId]/signups/[leadId]/page.tsx",
@@ -911,25 +729,13 @@ export const MODULE_SLICES = {
911
729
  "apps/web/app/[locale]/(authed)/waitlist/components/SignupsTable.tsx",
912
730
  "apps/web/app/[locale]/(authed)/waitlist/components/WaitlistComparisonTabs.tsx",
913
731
  "apps/web/app/[locale]/(authed)/waitlist/components/status-badges.tsx",
914
- // #7389 — the three api suites that enable `multi-tenant` ALONE and so
915
- // reach files this slice delivers (`services/tenant-context.ts` and the
916
- // `routes/workspaces/` index). Each is listed individually, never as a
917
- // glob (the `scheduling` slice's § D12 property 1: a glob entry is a
918
- // silent no-op), so it ships to a keyed scaffold with the slice and is
919
- // stripped from a keyless one with it — instead of a keyless scaffold
920
- // carrying a test that raises `createNoMappedModuleFoundError`. A suite
921
- // that enables SEVERAL paid modules cannot be owned by any one of
922
- // them; those are `EXCLUDE_TEMPLATE_DIRS` entries below.
923
- "apps/api/src/services/__tests__/lead-promotion.test.ts",
924
- "apps/api/src/services/__tests__/leads-inbox.test.ts",
925
- "apps/api/src/__tests__/content-write-production-boot.test.ts",
926
732
  "apps-paid/admin/**",
927
733
  ],
928
734
  // The whole-app glob above lands its files at their REPO-relative path
929
735
  // unless something re-roots them (`installBundleTree`'s `copyTree`
930
736
  // excludes only `installMap` KEYS from its verbatim copy), so without a
931
737
  // rename rule a keyed install left a stray source-tree-relative
932
- // directory in the scaffold instead of the working `apps/admin` app
738
+ // directory in the scaffold instead of the working `apps/admin` shell
933
739
  // this slice's own `apps.admin.path` (and `paid-paths.ts`'s
934
740
  // `introducedAppPaths()`) already declares (#5626 D3/D4). The fix lives
935
741
  // here, on the module, so `--modules multi-tenant` alone is fixed too —
@@ -946,6 +752,26 @@ export const MODULE_SLICES = {
946
752
  // fixture calls the same derivation so it cannot drift from the
947
753
  // producer's. See `installRoot`'s own doc on `ModuleSlice` above.
948
754
  installRoot: "apps/admin/",
755
+ // #9460 DD5/DD6 — the signed-in workspace MCP tools (#3591 PR-E) ride
756
+ // `@working-theory/mcp-workspace`, delivered as a dependency of the
757
+ // buyer's apps/mcp and reached through the generated registry; the
758
+ // merge-keys op is the same shape every other paid package uses.
759
+ paidMcpToolPackages: ["@working-theory/mcp-workspace"],
760
+ patches: [
761
+ {
762
+ target: "apps/mcp/package.json",
763
+ kind: "json",
764
+ ops: [
765
+ {
766
+ op: "merge-keys",
767
+ path: ["dependencies"],
768
+ entries: {
769
+ "@working-theory/mcp-workspace": "workspace:*",
770
+ },
771
+ },
772
+ ],
773
+ },
774
+ ],
949
775
  },
950
776
  // ── workspace — Pro module: the single-workspace settings shell (D-27/D-49)
951
777
  //
@@ -1006,42 +832,6 @@ export const MODULE_SLICES = {
1006
832
  "apps/web/app/[locale]/(authed)/admin/page.tsx",
1007
833
  "apps/web/app/[locale]/(authed)/admin/site/page.tsx",
1008
834
  "apps/web/app/[locale]/(authed)/admin/team/page.tsx",
1009
- // Co-owned with `multi-tenant` (#7399) — see that slice's entry: both
1010
- // register under the workspace||multi-tenant gate.
1011
- "apps/api/src/routes/workspaces/general.ts",
1012
- "apps/api/src/routes/workspaces/members.ts",
1013
- // Co-owned with `multi-tenant` (#3591 PR-B), for the reason the two
1014
- // lines above carry.
1015
- "apps/api/src/routes/workspaces/agents.ts",
1016
- // Co-owned with `multi-tenant` (#3591 PR-E): the signed-in MCP tools
1017
- // that twin the agent context, message and submission routes register
1018
- // under the same `workspace || multi-tenant` disjunction as those
1019
- // routes.
1020
- "apps/mcp/src/tools/agent_context.ts",
1021
- "apps/mcp/src/tools/inbox_messages.ts",
1022
- "apps/mcp/src/tools/inbox_submissions.ts",
1023
- // Co-owned with `multi-tenant` (#6216) — see that slice's entry: the
1024
- // route registers under the SAME workspace||multi-tenant gate as the
1025
- // two lines above, and its service function imports `lib/tenant-db.ts`
1026
- // (a multi-tenant-owned file), so both must be deliverable by either
1027
- // bundle alone.
1028
- "apps/api/src/routes/workspaces/messages.ts",
1029
- "apps/api/src/services/inbox-messages.ts",
1030
- // Co-owned with `multi-tenant` (#7535), for the reason the two
1031
- // message lines above carry.
1032
- "apps/api/src/routes/workspaces/submissions.ts",
1033
- "apps/api/src/routes/workspaces/subscribers.ts",
1034
- "apps/api/src/services/inbox-submissions.ts",
1035
- // Co-owned with `multi-tenant` (#9170), as the reads above.
1036
- "apps/api/src/routes/workspaces/orders.ts",
1037
- "apps/api/src/services/inbox-orders.ts",
1038
- // Co-owned with `multi-tenant` (#852 D8), as the reads above.
1039
- "apps/api/src/routes/workspaces/people.ts",
1040
- // Co-owned with `multi-tenant` (#7877 D9, D11) — see that slice's entry.
1041
- ...MEMBER_AREA_FILES,
1042
- // Co-owned with `multi-tenant` (#5853) — see that slice's entry.
1043
- "apps/api/src/routes/workspaces/content.ts",
1044
- ...ASSET_STORE_FILES,
1045
835
  ],
1046
836
  // patches — the dependency add that delivers the shared package to the
1047
837
  // buyer's apps/web, mirroring docs-blog's own fumadocs-schema merge-keys
@@ -1063,7 +853,23 @@ export const MODULE_SLICES = {
1063
853
  },
1064
854
  ],
1065
855
  },
856
+ // #9460 DD5/DD6 — the signed-in workspace MCP tools (#3591 PR-E),
857
+ // co-owned with `multi-tenant`, ride `@working-theory/mcp-workspace`.
858
+ {
859
+ target: "apps/mcp/package.json",
860
+ kind: "json",
861
+ ops: [
862
+ {
863
+ op: "merge-keys",
864
+ path: ["dependencies"],
865
+ entries: {
866
+ "@working-theory/mcp-workspace": "workspace:*",
867
+ },
868
+ },
869
+ ],
870
+ },
1066
871
  ],
872
+ paidMcpToolPackages: ["@working-theory/mcp-workspace"],
1067
873
  },
1068
874
  // ── scheduling — full-stack module (provider + routes + booker pages) ────
1069
875
  //
@@ -1171,7 +977,7 @@ export const MODULE_SLICES = {
1171
977
  // server.ts's module-conditional registration (isModuleEnabled('scheduling')),
1172
978
  // and a repo-wide grep of every importer of each candidate file.
1173
979
  //
1174
- // apps/api/src/services/scheduling/index.ts, cal-provider.ts, types.ts —
980
+ // services/scheduling/index.ts, cal-provider.ts, types.ts (now api-scheduling's) —
1175
981
  // the whole directory; grepped `services/scheduling` repo-wide and the
1176
982
  // ONLY importer outside its own __tests__/ is routes/schedule/index.ts,
1177
983
  // so no sibling error-type file exists elsewhere to add.
@@ -1234,19 +1040,6 @@ export const MODULE_SLICES = {
1234
1040
  // deliberately NOT listed here: they ship, and listing one would take the
1235
1041
  // whole dispatch table with it.
1236
1042
  ownedFiles: [
1237
- "apps/api/src/routes/schedule/index.ts",
1238
- "apps/api/src/services/scheduling/index.ts",
1239
- "apps/api/src/services/scheduling/cal-provider.ts",
1240
- "apps/api/src/services/scheduling/types.ts",
1241
- // #6182 (S9a) — the Cal adapter's own suite. Individually, never as a
1242
- // glob (§ D12 above, property 1: a glob entry is a silent no-op, so
1243
- // `__tests__/**` would ship no test at all to a keyed scaffold).
1244
- "apps/api/src/services/scheduling/__tests__/cal-provider.test.ts",
1245
- "apps/mcp/src/tools/list_availability.ts",
1246
- "apps/mcp/src/tools/get_event_meta.ts",
1247
- // #8843 D5 — the twin of GET /v1/schedule/meetings.
1248
- "apps/mcp/src/tools/list_meetings.ts",
1249
- "apps/mcp/src/tools/create_booking.ts",
1250
1043
  "apps/web/app/[locale]/meet/page.tsx",
1251
1044
  "apps/web/app/[locale]/meet/[slug]/page.tsx",
1252
1045
  "apps/web/app/[locale]/meet/confirmed/page.tsx",
@@ -1260,23 +1053,6 @@ export const MODULE_SLICES = {
1260
1053
  "apps/web/app/[locale]/private/page.tsx",
1261
1054
  "apps/web/app/[locale]/private/__tests__/page.test.tsx",
1262
1055
  "apps/web/app/[locale]/private/__tests__/sitemap.test.ts",
1263
- // #6085 (brief H7) — the six files the webhook receiver + the
1264
- // tenant-guarded appointments read add. Individually, never as a
1265
- // glob (§ D12 / this card's own comment above, property 1: a glob
1266
- // entry is a silent no-op, so __tests__/** would ship no test at all
1267
- // to a keyed scaffold). `apps/api/src/routes/webhooks/index.ts` is
1268
- // NOT added — it is the mixed barrel that also registers the Stripe
1269
- // receiver, the same "mixed barrel is never listed" precedent this
1270
- // slice already records for `routes/project-listings/index.ts`.
1271
- // `apps/api/src/routes/schedule/index.ts` is already listed above and
1272
- // stays (it re-exports `listAppointmentsRoute` alongside the three
1273
- // anonymous routes it already re-exports).
1274
- "apps/api/src/routes/webhooks/calcom.ts",
1275
- "apps/api/src/routes/webhooks/__tests__/calcom.test.ts",
1276
- "apps/api/src/services/scheduling/appointments.ts",
1277
- "apps/api/src/services/scheduling/__tests__/appointments.test.ts",
1278
- "apps/api/src/routes/schedule/appointments.ts",
1279
- "apps/api/src/routes/schedule/__tests__/appointments.test.ts",
1280
1056
  // #6086 (brief H7) — the SITE's appointments page, the visible half of
1281
1057
  // the read above. The co-located suite is listed EXPLICITLY alongside
1282
1058
  // its page: `EXCLUDE_TEMPLATE_DIRS` below drops only the three
@@ -1287,80 +1063,6 @@ export const MODULE_SLICES = {
1287
1063
  // test for a page it does not have.
1288
1064
  "apps/web/app/[locale]/(authed)/appointments/page.tsx",
1289
1065
  "apps/web/app/[locale]/(authed)/appointments/__tests__/page.test.tsx",
1290
- // #6183 S9b — the enabled-meeting-slugs gate. `meetings.ts` is its own
1291
- // file (not folded into `routes/workspaces/config.ts`, which is
1292
- // `workspace`/`multi-tenant`-owned) precisely because its GET reaches
1293
- // `services/scheduling/` — the SAME reason `routes/schedule/
1294
- // appointments.ts` above is its own file rather than a row on an
1295
- // existing route. `lib/public-meetings-config.ts` is the public-read
1296
- // boundary `routes/schedule/meeting-types.ts` (the anonymous read,
1297
- // already reached via the already-listed `routes/schedule/index.ts`)
1298
- // calls into.
1299
- "apps/api/src/routes/workspaces/meetings.ts",
1300
- "apps/api/src/routes/workspaces/__tests__/meetings.test.ts",
1301
- "apps/api/src/lib/public-meetings-config.ts",
1302
- "apps/api/src/routes/schedule/meeting-types.ts",
1303
- "apps/api/src/routes/schedule/__tests__/meeting-types.test.ts",
1304
- // #8843 D1 — the meetings read's own suite; the route is in
1305
- // `routes/schedule/index.ts`, listed above.
1306
- "apps/api/src/routes/schedule/__tests__/meetings.test.ts",
1307
- // #7532 — a hub spoke's meeting types and booking, through the real
1308
- // scheduling routes; it ships and strips with them.
1309
- "apps/api/src/routes/schedule/__tests__/spoke.test.ts",
1310
- // meetings.ts is the FIRST scheduling-gated route to use the generic
1311
- // tenantDb() scope layer directly (its sibling, appointments.ts, does
1312
- // its own scoped read in services/scheduling/appointments.ts instead)
1313
- // — and `workspaceMeetings` is now in architecture.yaml's tenant-scope
1314
- // forbidden_pattern (#6183), so meetings.ts cannot bypass tenantDb()
1315
- // with a raw prisma call. Co-owned with `multi-tenant` below (the
1316
- // SAME two files, same reason `content.ts`'s own comment there
1317
- // records: "each tenancy slice must deliver it").
1318
- "apps/api/src/lib/tenant-db.ts",
1319
- "apps/api/src/services/tenant-context.ts",
1320
- // #7389 — `routes/workspaces/__tests__/meetings.test.ts` and
1321
- // `meetings-connection.test.ts` (listed below) register the real
1322
- // `tenantPreHandlerPlugin` in front of `meetings.ts`, so a scheduling
1323
- // scaffold without `multi-tenant` could not load them. It imports only
1324
- // `services/tenant-context.ts` (owned above) and the base
1325
- // `default-tenant.ts`, so co-owning it keeps the closure tight.
1326
- "apps/api/src/middleware/tenant.ts",
1327
- // #7533 — a scheduling connection per workspace. `connections.ts` (the
1328
- // cipher + the one SchedulingConnection data-access boundary) and
1329
- // `resolve.ts` (the workspace-aware provider resolution the meetings,
1330
- // schedule and webhook routes above now call), plus each new suite,
1331
- // individually (§ D12, property 1: a glob ships no test). The config
1332
- // suite is listed here although `config/index.ts` itself stays base:
1333
- // it tests a scheduling-only variable, so a keyless scaffold carries
1334
- // neither the variable's purpose nor its test.
1335
- "apps/api/src/services/scheduling/connections.ts",
1336
- "apps/api/src/services/scheduling/resolve.ts",
1337
- "apps/api/src/services/scheduling/__tests__/connections.test.ts",
1338
- "apps/api/src/services/scheduling/__tests__/provider-resolution.test.ts",
1339
- // #9129 — the meetings-list assembly the meetings route and the member
1340
- // meeting types share, plus its suite.
1341
- "apps/api/src/services/scheduling/meetings.ts",
1342
- "apps/api/src/services/scheduling/__tests__/meetings.test.ts",
1343
- "apps/api/src/routes/workspaces/__tests__/meetings-connection.test.ts",
1344
- "apps/api/src/routes/schedule/__tests__/public-connection.test.ts",
1345
- "apps/api/src/routes/webhooks/__tests__/calcom-connection.test.ts",
1346
- "apps/api/src/config/__tests__/scheduling-credential-key.test.ts",
1347
- // #8169 D9 — the two member reads that reach `services/scheduling/`,
1348
- // registered under `scheduling && (workspace || multi-tenant)`, plus
1349
- // the three member files they import, which this slice then CO-OWNS
1350
- // with the two tenancy slices (`MEMBER_AREA_FILES`) — exactly as it
1351
- // co-owns `lib/tenant-db.ts` for `routes/workspaces/meetings.ts` above.
1352
- "apps/api/src/routes/member/meeting-types.ts",
1353
- "apps/api/src/routes/member/availability.ts",
1354
- // #8170 D11 — the member booking, the same shape.
1355
- "apps/api/src/routes/member/bookings.ts",
1356
- "apps/api/src/routes/member/pieces.ts",
1357
- "apps/api/src/services/member-area.ts",
1358
- "apps/api/src/lib/member-store.ts",
1359
- // #7389 — the two api suites that enable `scheduling` alone, so they
1360
- // strip with `routes/schedule/index.ts`, which they load by a computed
1361
- // specifier the import-graph closure cannot follow.
1362
- "apps/api/src/__tests__/schedule-forwarded-rate-limit.test.ts",
1363
- "apps/api/src/__tests__/openapi-keyless-hub.test.ts",
1364
1066
  ],
1365
1067
  // pageContributions (spec 5478; parent § D6 shape 1) — the meeting
1366
1068
  // index, the meeting page, the confirmation page and the private index
@@ -1394,7 +1096,23 @@ export const MODULE_SLICES = {
1394
1096
  },
1395
1097
  ],
1396
1098
  },
1099
+ // #9460 DD5/DD6 — the four scheduling MCP tools (#4416, #4633, #8843
1100
+ // D5) ride `@working-theory/mcp-scheduling`.
1101
+ {
1102
+ target: "apps/mcp/package.json",
1103
+ kind: "json",
1104
+ ops: [
1105
+ {
1106
+ op: "merge-keys",
1107
+ path: ["dependencies"],
1108
+ entries: {
1109
+ "@working-theory/mcp-scheduling": "workspace:*",
1110
+ },
1111
+ },
1112
+ ],
1113
+ },
1397
1114
  ],
1115
+ paidMcpToolPackages: ["@working-theory/mcp-scheduling"],
1398
1116
  },
1399
1117
  // ── signal-collectors — flows, deliverables, project listings, waitlist
1400
1118
  // signups (D-48, #5366) ───────────────────────────────────────────────
@@ -1404,14 +1122,14 @@ export const MODULE_SLICES = {
1404
1122
  // and a repo-wide grep of every importer of each candidate file (an
1405
1123
  // independent re-grep, not carried over from the spec's own table).
1406
1124
  //
1407
- // apps/api/src/routes/project-listings/index.ts is MIXED (D4): it holds
1125
+ // routes/project-listings/index.ts (now api-signal-collectors') is MIXED (D4): it holds
1408
1126
  // this module's five anonymous/founder-read re-exports (lines 1-55) AND
1409
1127
  // multi-tenant's TENANT_HANDLERS table + projectListingTenantRoutes
1410
1128
  // (lines 57-139) in one file. NOT listed here — never deleted/edited on
1411
1129
  // its own, exactly like the scheduling/multi-tenant precedent for a mixed
1412
1130
  // barrel above.
1413
1131
  //
1414
- // apps/api/src/routes/project-listings/respond.ts (`sendValidated`) IS
1132
+ // routes/project-listings/respond.ts (`sendValidated`, now api-signal-collectors') IS
1415
1133
  // listed, even though it is ALSO imported directly by the tenant routes
1416
1134
  // get.ts/list.ts/patch.ts/patch-copy.ts (multi-tenant, Pro Plus territory
1417
1135
  // — grep-verified, four direct importers outside this module). Same D6
@@ -1458,13 +1176,13 @@ export const MODULE_SLICES = {
1458
1176
  // selection, exactly as it did before this card (a narrower, temporary
1459
1177
  // miss than the one D6 accepts on purpose for the other nine).
1460
1178
  //
1461
- // apps/api/src/services/listing-promotion.ts has ZERO production
1179
+ // services/listing-promotion.ts (now api-signal-collectors') has ZERO production
1462
1180
  // importers anywhere in the repo (only its own test) — confirmed dead code
1463
1181
  // (spec §7 Q5). Listed anyway: it is listing code by subject, D-48 places
1464
1182
  // the instrument here, and a reachability grep cannot place an unreached
1465
1183
  // file — this is a recorded pre-existing defect, not fixed by this card.
1466
1184
  //
1467
- // apps/api/src/bin/deliverable-upload.ts imports only `prisma` (no moved
1185
+ // bin/deliverable-upload.ts (now api-signal-collectors') imports only `prisma` (no moved
1468
1186
  // service) but is a deliverables CLI a Free starter should not ship —
1469
1187
  // listed by subject, not by the import-criterion the other six bins meet.
1470
1188
  //
@@ -1510,7 +1228,7 @@ export const MODULE_SLICES = {
1510
1228
  // ownedFiles under apps/api/** dropped (removed root)
1511
1229
  // ownedFiles under (authed)/waitlist/** dropped (removal seed)
1512
1230
  // ownedFiles projects/apply/ListingApplicationClient lands; no route mounts it
1513
- // ownedFiles under apps/mcp/src/tools/** lands when apps/mcp is kept
1231
+ // paidMcpToolPackages (apps/mcp/package.json) lands when apps/mcp is kept
1514
1232
  // installMap content/en/** (12 seeds) lands, but for the five report seeds
1515
1233
  // installMap database/flows/{referral,fit-check}.flow.json
1516
1234
  // remapped to flows/<name>.json — declared
@@ -1523,148 +1241,14 @@ export const MODULE_SLICES = {
1523
1241
  // It stays a Pro module: a keyless spoke carries no flows.
1524
1242
  spoke: true,
1525
1243
  paidSectionsPackage: "@working-theory/ui-signal-collectors",
1244
+ // #9460 DD5/DD6 — the flow tools ride `@working-theory/mcp-signal-collectors`;
1245
+ // the listing-application tools (#3591 PR-E, co-owned with multi-tenant)
1246
+ // ride `@working-theory/mcp-workspace`, whose one file holds them.
1247
+ paidMcpToolPackages: [
1248
+ "@working-theory/mcp-signal-collectors",
1249
+ "@working-theory/mcp-workspace",
1250
+ ],
1526
1251
  ownedFiles: [
1527
- "apps/api/src/routes/flows/index.ts",
1528
- // README.md documents the flows rate-limit rationale (#4730) — not a
1529
- // test/generated file, and its absence is exactly what left a stray
1530
- // apps/api/src/routes/flows/ directory in a keyless templates/ snapshot
1531
- // (empirically found, #5366) since the import-graph closure below only
1532
- // scans source extensions, never markdown.
1533
- "apps/api/src/routes/flows/README.md",
1534
- "apps/api/src/routes/deliverables/index.ts",
1535
- "apps/api/src/routes/slack/index.ts",
1536
- "apps/api/src/routes/slack/actions.ts",
1537
- "apps/api/src/routes/waitlist-signups/index.ts",
1538
- // #7479 — the listing-draft forwarded-visitor suite exercises the three
1539
- // project-listings draft routes through the real build(), and those
1540
- // routes register only under isModuleEnabled("signal-collectors"), so
1541
- // the suite strips with this slice (the #7389 shape for
1542
- // schedule-forwarded-rate-limit.test.ts under scheduling) instead of
1543
- // failing every keyless scaffold's apps/api jest gate.
1544
- "apps/api/src/__tests__/listings-forwarded-rate-limit.test.ts",
1545
- // apps/api/src/routes/project-listings/{start,patch-draft,submit,public,
1546
- // me,respond,resume-token}.ts and services/{project-listings,
1547
- // listing-config}.ts deliberately NOT listed — see the comment above
1548
- // this array (D-48/#5366 escalation: the mixed-barrel `index.ts` in
1549
- // that directory is reached from server.ts by a plain, literal
1550
- // `import()` for multi-tenant's tenant routes, and statically imports
1551
- // all nine of these files itself, so `paidModuleTemplateExclusions()`'s
1552
- // import-graph closure excluded `index.ts`, then `server.ts` itself,
1553
- // from every keyless scaffold (empirically found, #5366 resume pass,
1554
- // same failure mode as the deliverable-fulfillment.ts case below but a
1555
- // permanent structural one rather than a temporal gap pending another
1556
- // PR). This is also the ORIGINAL multi-tenant/#5088 card's own
1557
- // conclusion about these same nine files (lines 556-571 above) —
1558
- // D-48 moves their tier ownership to signal-collectors but not their
1559
- // must-ship-unconditionally constraint. Registration of every route
1560
- // that reaches them stays gated by `isModuleEnabled("signal-collectors")`
1561
- // in server.ts; only the source files themselves ship regardless.
1562
- "apps/api/src/services/flow-engine.ts",
1563
- "apps/api/src/services/flow-aggregate.ts",
1564
- "apps/api/src/services/waitlist-signups.ts",
1565
- "apps/api/src/services/waitlist-scoring.ts",
1566
- "apps/api/src/services/playbook-compile.ts",
1567
- "apps/api/src/services/playbook-render.ts",
1568
- "apps/api/src/services/listing-csv-sweep.ts",
1569
- "apps/api/src/services/waitlist-followup.ts",
1570
- "apps/api/src/services/listing-promotion.ts",
1571
- "apps/api/src/services/project-listing-decision.ts",
1572
- "apps/api/src/services/project-listing-flow.ts",
1573
- "apps/api/src/services/project-listing-issue.ts",
1574
- "apps/api/src/services/waitlist-experiments.ts",
1575
- // deliverable-fulfillment.ts deliberately NOT listed — see the comment
1576
- // above this array (spec §5.4 escalation boundary, temporary pending #5364).
1577
- "apps/api/src/bin/deliverable-resend.ts",
1578
- "apps/api/src/bin/deliverable-upload.ts",
1579
- "apps/api/src/bin/session-retention-sweep.ts",
1580
- "apps/api/src/bin/seed-presets.ts",
1581
- // #7844 D7 — the operator flow-copy CLI and its service: flows code by
1582
- // subject, and a Free scaffold carries no flows.
1583
- "apps/api/src/bin/flows-copy.ts",
1584
- "apps/api/src/services/flow-copy.ts",
1585
- "apps/api/src/bin/listing-csv-sweep.ts",
1586
- "apps/api/src/bin/followup-sweep.ts",
1587
- "apps/api/src/bin/seed-waitlist-experiments.ts",
1588
- // #7389 — the listing-directory suite enables `signal-collectors` alone
1589
- // and loads `routes/waitlist-signups/index.ts` through the server it
1590
- // builds, so it strips with that route. Individually, never as a glob.
1591
- "apps/api/src/routes/project-listings/__tests__/directory.test.ts",
1592
- "apps/mcp/src/tools/get_flow.ts",
1593
- "apps/mcp/src/tools/submit_flow_step.ts",
1594
- // #3591 PR-E — the signed-in MCP tools that twin the tenant-scoped
1595
- // project-listing routes, CO-OWNED with multi-tenant: they register
1596
- // under the routes' own `multi-tenant || signal-collectors` gate.
1597
- "apps/mcp/src/tools/inbox_applications.ts",
1598
- // ── The review surface (#5677) — CO-OWNED with multi-tenant ──────────
1599
- //
1600
- // Every path below is ALSO a multi-tenant `ownedFiles` entry and stays
1601
- // one. Listing a file under two modules is additive, not a transfer:
1602
- // `paidModuleTemplateExclusions()` unions every paid module's entries,
1603
- // so the `templates/` snapshot is unchanged, and a multi-tenant scaffold
1604
- // keeps receiving these from the multi-tenant bundle exactly as before.
1605
- // What changes is that a signal-collectors bundle now carries them too.
1606
- //
1607
- // WHY THEY MUST BE HERE. #5677 widened `server.ts`'s review-surface
1608
- // registration from `multi-tenant` to `multi-tenant || signal-collectors`,
1609
- // because signal-collectors is the module that SELLS the instruments
1610
- // these routes read back. Registration and DELIVERY are separate layers:
1611
- // the widened gate calls `sliceRoutePlugin("waitlistExperimentRoutes")`
1612
- // and imports `projectListingTenantRoutes`, so on a scaffold whose
1613
- // `AILK_ENABLED_MODULES` names signal-collectors but whose tree lacks
1614
- // these files, `loadSlice` throws ERR_MODULE_NOT_FOUND during `build()`
1615
- // — construction, so EVERY route 500s rather than one. That is not a
1616
- // feature gap; it is the outage shape `lib/slice-load.ts` exists to
1617
- // diagnose.
1618
- //
1619
- // It is not hypothetical: `marketing-site` — the Pro flagship in
1620
- // `template-manifest.ts` — declares
1621
- // `requires: ["marketing", "docs-blog", "scheduling", "signal-collectors"]`,
1622
- // i.e. signal-collectors WITHOUT multi-tenant. That is exactly the
1623
- // configuration that would crash, which is why the gate and the delivery
1624
- // land together rather than the delivery being deferred.
1625
- //
1626
- // The closure is tight, verified by grep rather than assumed: none of
1627
- // these files imports `lib/tenant-db.ts` or `services/tenant-context.ts`
1628
- // (both multi-tenant-only). #5677 retargeted `waitlist-dashboard.ts`'s
1629
- // type import of `tenant-context.js` to the base `services/default-tenant.ts`,
1630
- // which severed the one cross-slice edge that existed.
1631
- //
1632
- // `routes/project-listings/{start,patch-draft,submit,public,me,respond,
1633
- // resume-token,patch-copy}.ts` are NOT listed — they are the free
1634
- // anonymous surface and the mixed barrel, covered by the note above this
1635
- // array, and they already ship unconditionally.
1636
- "apps/api/src/routes/waitlist-experiments/index.ts",
1637
- "apps/api/src/routes/waitlist-experiments/list.ts",
1638
- "apps/api/src/routes/waitlist-experiments/comparison.ts",
1639
- "apps/api/src/routes/waitlist-experiments/signup.ts",
1640
- "apps/api/src/routes/waitlist-experiments/signups.ts",
1641
- "apps/api/src/routes/waitlist-experiments/respond.ts",
1642
- "apps/api/src/services/waitlist-dashboard.ts",
1643
- // #6258 — the file waitlist-dashboard.ts imports for the pinned
1644
- // platform-operator read scope. It rides BOTH slices for the same
1645
- // reason its importer does: an unlisted import target breaks a
1646
- // signal-collectors-without-multi-tenant scaffold at build() time.
1647
- "apps/api/src/services/waitlist-operator-reads.ts",
1648
- // #6157 D14/D16 — the magnet Admin authoring surface's own sibling
1649
- // tenant scope is gated `multi-tenant || signal-collectors` (D4,
1650
- // the SAME expression this review-surface block co-owns files
1651
- // under), so both its route file AND `lib/tenant-db.ts` (the ONE
1652
- // data path it reads/writes through, FR3) must be delivered here
1653
- // too. `lib/tenant-db.ts` is ALSO listed under `multi-tenant` above
1654
- // — additive, not a transfer (the same reasoning this array's own
1655
- // header comment already states for every other file in it).
1656
- //
1657
- // The closure stays tight WITHOUT dragging in `tenant-context.ts` or
1658
- // the multi-tenant guard assembly behind it, because `tenant-db.ts`'s
1659
- // own type import was retargeted from `tenant-context.js` to the
1660
- // BASE-tree `services/default-tenant.js` in this same unit (D15) —
1661
- // the identical one-line class of move #5677 made for
1662
- // `waitlist-dashboard.ts` two paragraphs above this one.
1663
- "apps/api/src/routes/magnets/index.ts",
1664
- "apps/api/src/lib/tenant-db.ts",
1665
- "apps/api/src/routes/project-listings/get.ts",
1666
- "apps/api/src/routes/project-listings/list.ts",
1667
- "apps/api/src/routes/project-listings/patch.ts",
1668
1252
  // The dashboard itself. Without these the Pro scaffold would boot with
1669
1253
  // reachable review routes and no UI to read them through, and the two
1670
1254
  // files that DO already ship into every scaffold
@@ -1719,6 +1303,11 @@ export const MODULE_SLICES = {
1719
1303
  // its siblings (the note above).
1720
1304
  "apps/web/app/[locale]/careers/apply/page.tsx",
1721
1305
  "apps/web/app/[locale]/careers/[slug]/apply/page.tsx",
1306
+ // #9287 DD10 — the trial magnet pair. Its own `trial` route segment,
1307
+ // which no surface gates, so `ownedFiles` keeps both pages out of a
1308
+ // keyless scaffold, beside the careers walks.
1309
+ "apps/web/app/[locale]/trial/page.tsx",
1310
+ "apps/web/app/[locale]/trial/request/page.tsx",
1722
1311
  // #5581 U4 — the eleven signal-collectors components + the slice's own
1723
1312
  // re-export entry point moved to packages-paid/ui-signal-collectors;
1724
1313
  // the package is delivered to a keyed scaffold via `patches` below,
@@ -1859,14 +1448,30 @@ export const MODULE_SLICES = {
1859
1448
  },
1860
1449
  ],
1861
1450
  },
1451
+ // #9460 DD6 — the two MCP packs above, as apps/mcp dependencies.
1452
+ {
1453
+ target: "apps/mcp/package.json",
1454
+ kind: "json",
1455
+ ops: [
1456
+ {
1457
+ op: "merge-keys",
1458
+ path: ["dependencies"],
1459
+ entries: {
1460
+ "@working-theory/mcp-signal-collectors": "workspace:*",
1461
+ "@working-theory/mcp-workspace": "workspace:*",
1462
+ },
1463
+ },
1464
+ ],
1465
+ },
1862
1466
  ],
1863
1467
  },
1864
1468
  // ── commerce — per-site paid add-on (D-47, amending D-26) ─────────────────
1865
1469
  //
1866
1470
  // Checkout, the Stripe webhook receiver, flow checkouts and the recommender
1867
1471
  // (D-47's disposition sentence, verbatim). The base API keeps only
1868
- // `isModuleEnabled("commerce")`; every registration loads through
1869
- // `SLICE_PLUGINS` (server.ts). `apps.api.may_import_from` names
1472
+ // `isModuleEnabled("commerce")`; every registration is a row of
1473
+ // `API_MODULE_TABLE` carried by the commerce module object (#9565).
1474
+ // `apps.api.may_import_from` names
1870
1475
  // `packages/stripe-client` — the module's own package (D5) — mirroring the
1871
1476
  // `multi-tenant`/`scheduling` slices' identical entry, which already
1872
1477
  // document "checkout moved to the commerce module (D-47)" for the same
@@ -1949,30 +1554,19 @@ export const MODULE_SLICES = {
1949
1554
  //
1950
1555
  // THE PRIMITIVES LEFT THIS SLICE (D-64, epic #5770, #5796). The checkout
1951
1556
  // launcher, the Stripe webhook receiver, customer mapping and the
1952
- // `lib/stripe.ts` shim are BASE TREE now: `apps/api/src/server.ts`
1557
+ // `lib/stripe.ts` shim are BASE TREE now: `packages/api/src/server.ts`
1953
1558
  // registers them unconditionally and gates them at CALL time on the JWT
1954
- // `commerce` claim (`apps/api/src/lib/require-commerce-claim.ts`), so a
1559
+ // `commerce` claim (`packages/api/src/lib/require-commerce-claim.ts`), so a
1955
1560
  // keyless scaffold must CARRY them. Claiming them here is what deleted
1956
1561
  // them from that scaffold while the server still loaded them —
1957
1562
  // ERR_MODULE_NOT_FOUND inside build(), every route 500ing, which is the
1958
- // exact defect `tools/lint-slice-registration.ts` (#5701) exists to
1959
- // catch. The six that left: lib/stripe.ts,
1563
+ // exact defect the slice-registration lint (#5701; retired by #9565 D8)
1564
+ // existed to catch. The six that left: lib/stripe.ts,
1960
1565
  // routes/checkout/{index,sessions}.ts, routes/webhooks/{index,stripe}.ts
1961
1566
  // and routes/webhooks/README.md. The four below STAY — they are commerce
1962
1567
  // OVERLAY, still registered behind `isModuleEnabled("commerce")` and
1963
1568
  // still carrying their `// oss: false` markers.
1964
1569
  ownedFiles: [
1965
- "apps/api/src/routes/flow-checkouts/index.ts",
1966
- "apps/api/src/routes/flows/recommender.ts",
1967
- "apps/api/src/services/recommender-capture.ts",
1968
- "apps/api/src/services/flow-checkouts.ts",
1969
- // #6038 — the buyer-scoped subscription-status route pair (the
1970
- // update-your-card banner's read + portal handoff). Commerce OVERLAY,
1971
- // same posture as the four flow-checkouts/recommender entries above.
1972
- "apps/api/src/routes/subscription/index.ts",
1973
- "apps/api/src/routes/subscription/me.ts",
1974
- "apps/api/src/routes/subscription/portal.ts",
1975
- "apps/api/src/services/subscription.ts",
1976
1570
  // #5581 U5 — the fifteen commerce components (+ ten .text.ts extractors
1977
1571
  // + the slice's own re-export entry point) moved to
1978
1572
  // packages-paid/ui-commerce; the package is delivered to a keyed
@@ -2205,12 +1799,6 @@ export function coOwnedModuleDestinations() {
2205
1799
  // The exclusion is per file, not a `testPathIgnorePatterns` entry in the
2206
1800
  // scaffold's jest config: that would hide these suites from a keyed
2207
1801
  // scaffold too, and from the suites a slice owns.
2208
- // - database/__tests__/build.test.ts (#7959) — the monorepo build probe
2209
- // (#7565). Its `beforeAll` symlinks `REPO_ROOT/packages` and copies
2210
- // `REPO_ROOT/tsconfig.base.json`, neither of which a scaffold has, so it
2211
- // red the scaffold's database jest run. Matched exactly, not by basename
2212
- // in `EXCLUDE_FILES`, which would drop a `build.test.ts` anywhere in the
2213
- // snapshot; every other database suite still ships.
2214
1802
  // - the /pricing suite `monorepo-only.test.tsx` and its snapshot (#9179) —
2215
1803
  // it snapshots the monorepo's own `content/en/Pricing/pricing.mdx`, which
2216
1804
  // a scaffold replaces with its seed, and reads
@@ -2229,28 +1817,24 @@ export const EXCLUDE_TEMPLATE_DIRS = [
2229
1817
  "apps/web/app/[locale]/__tests__",
2230
1818
  "apps/web/app/[locale]/(authed)/edit",
2231
1819
  "apps/web/content",
2232
- "apps/api/src/__tests__/api-parity.test.ts",
2233
- "apps/api/src/__tests__/api-parity-paid.test.ts",
2234
1820
  "apps/mcp/__tests__/api-parity.test.ts",
2235
1821
  "apps/mcp/__tests__/pro-tool-call-gate.test.ts",
2236
1822
  "apps/mcp/__tests__/write-tool-guard.test.ts",
2237
- "apps/api/src/services/__tests__/aeo-score.test.ts",
2238
- "apps/api/src/routes/leads/__tests__/index.test.ts",
2239
- "apps/api/src/routes/workspaces/__tests__/inbox-wire-schemas.test.ts",
2240
- "apps/api/src/__tests__/server.test.ts",
2241
- "apps/api/src/__tests__/cors.test.ts",
2242
- "apps/api/src/__tests__/root-modules.test.ts",
2243
- "apps/api/src/__tests__/module-exclusion.test.ts",
2244
- "apps/api/src/openapi/__tests__/surface-drift.test.ts",
2245
- "apps/api/src/__tests__/review-surface-registration.test.ts",
2246
- "apps/api/src/__tests__/workspace-module-registration.test.ts",
1823
+ "apps/mcp/__tests__/create-booking-guard.test.ts",
1824
+ // #9564 AC-1 — pins THIS monorepo's route table and imports the six module
1825
+ // objects; a scaffold has neither.
1826
+ "apps/api/src/__tests__/registration-table.test.ts",
1827
+ "apps/api/src/__tests__/fixtures",
1828
+ // #9571 — exercises the composition's `loadInstalledHub` by `jest.doMock`-ing
1829
+ // `@working-theory/api-hub/package.json`, a specifier a Free scaffold cannot
1830
+ // resolve (no `virtual` mock), and it depends on the monorepo
1831
+ // `apps/api/jest.config.cjs` mapper that `build-templates` drops; the
1832
+ // scaffold's own boot behaviour is covered by `verify-scaffold`'s boot leg.
1833
+ "apps/api/src/__tests__/hub-install.test.ts",
2247
1834
  "apps/mcp/__tests__/workspace-surface.test.ts",
2248
1835
  "apps/mcp/__tests__/parity.test.ts",
2249
- "apps/mcp/__tests__/audit.test.ts",
2250
- "database/__tests__/build.test.ts",
2251
1836
  "apps/web/app/[locale]/pricing/__tests__/monorepo-only.test.tsx",
2252
1837
  "apps/web/app/[locale]/pricing/__tests__/__snapshots__/monorepo-only.test.tsx.snap",
2253
- "apps/api/src/services/offerings/__tests__/delegate-confinement.test.ts",
2254
1838
  ];
2255
1839
  export function paidModuleTemplateExclusions(snapshotRoots, repoRoot) {
2256
1840
  const roots = new Set(snapshotRoots);
@@ -2266,8 +1850,8 @@ export function paidModuleTemplateExclusions(snapshotRoots, repoRoot) {
2266
1850
  }
2267
1851
  }
2268
1852
  // Companion closure by import graph, to a fixed point — the shared walker
2269
- // (`lib/import-graph.ts`), so `tools/lint-slice-registration.ts` asks the
2270
- // question with the same resolution this answer was computed with (#5701).
1853
+ // (`lib/import-graph.ts`), the resolution the retired slice-registration
1854
+ // lint (#5701, #9565 D8) asked its question with.
2271
1855
  return [...importClosure(repoRoot, [...roots], seeds)].sort();
2272
1856
  }
2273
1857
  /** The scaffold's architecture linter, relative to the site root (#6649). */