create-ailk 0.34.1 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +1 -1
  2. package/component-catalog.json +37 -4
  3. package/component-catalog.md +11 -9
  4. package/dist/add-module.js +7 -2
  5. package/dist/derive-architecture.js +2 -0
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/lib/env-catalog.js +8 -0
  9. package/dist/module-architecture.js +9 -0
  10. package/dist/programmatic.js +5 -2
  11. package/dist/site-listing-path.d.ts +8 -0
  12. package/dist/site-listing-path.js +8 -0
  13. package/dist/surfaces.d.ts +20 -0
  14. package/dist/surfaces.js +32 -3
  15. package/dist/template-record.js +2 -0
  16. package/dist/topology.d.ts +4 -4
  17. package/dist/topology.js +104 -60
  18. package/dist/update.js +11 -0
  19. package/package.json +3 -3
  20. package/templates/.env.example +21 -0
  21. package/templates/apps/api/.env.example +7 -0
  22. package/templates/apps/api/CLAUDE.md +14 -9
  23. package/templates/apps/mcp/CLAUDE.md +18 -7
  24. package/templates/apps/web/.env.example +16 -0
  25. package/templates/apps/web/CLAUDE.md +46 -5
  26. package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +2 -0
  27. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +52 -1
  28. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +43 -0
  29. package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +108 -1
  30. package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +36 -3
  31. package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +37 -0
  32. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +90 -33
  33. package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +9 -4
  34. package/templates/apps/web/app/[locale]/(authed)/__tests__/gate.test.tsx +79 -348
  35. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +12 -1
  36. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +55 -2
  37. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +43 -0
  38. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +10 -5
  39. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +6 -5
  40. package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +1 -1
  41. package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +60 -6
  42. package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +32 -3
  43. package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +8 -1
  44. package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +7 -3
  45. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +215 -0
  46. package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +65 -0
  47. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +47 -0
  48. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +122 -0
  49. package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +214 -0
  50. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +6 -1
  51. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +35 -0
  52. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +266 -0
  53. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +116 -0
  54. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +12 -0
  55. package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +154 -0
  56. package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +6 -4
  57. package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -1
  58. package/templates/apps/web/app/[locale]/(authed)/layout.tsx +15 -13
  59. package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +20 -52
  60. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +43 -4
  61. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +23 -9
  62. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +15 -0
  63. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +74 -0
  64. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +34 -1
  65. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +257 -4
  66. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +72 -92
  67. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +2 -2
  68. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +164 -65
  69. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +100 -0
  70. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +99 -0
  71. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +415 -253
  72. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +113 -32
  73. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +16 -17
  74. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +284 -0
  75. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +52 -19
  76. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +402 -0
  77. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +100 -12
  78. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +153 -101
  79. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +36 -0
  80. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +121 -33
  81. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +27 -17
  82. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +91 -0
  83. package/templates/apps/web/app/[locale]/layout.tsx +42 -76
  84. package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +50 -0
  85. package/templates/apps/web/app/[locale]/purchase/success/page.tsx +48 -7
  86. package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +749 -0
  87. package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +189 -6
  88. package/templates/apps/web/app/api/auth/hub/authorize/route.ts +101 -31
  89. package/templates/apps/web/app/api/auth/hub/continuation.ts +51 -2
  90. package/templates/apps/web/app/api/auth/hub/email/route.ts +111 -0
  91. package/templates/apps/web/app/api/auth/hub/entry-shared.ts +163 -0
  92. package/templates/apps/web/app/api/auth/hub/purchase/route.ts +230 -0
  93. package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +174 -0
  94. package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +60 -0
  95. package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +97 -0
  96. package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +475 -7
  97. package/templates/apps/web/app/api/hub-session/callback/route.ts +13 -47
  98. package/templates/apps/web/app/api/hub-session/email/route.ts +125 -0
  99. package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +49 -0
  100. package/templates/apps/web/app/api/hub-session/one-tap/route.ts +106 -0
  101. package/templates/apps/web/app/api/hub-session/open/route.ts +111 -0
  102. package/templates/apps/web/app/api/hub-session/sign-in/route.ts +23 -40
  103. package/templates/apps/web/app/api/hub-session/sign-out/route.ts +1 -10
  104. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +122 -0
  105. package/templates/apps/web/app/llms.txt/route.ts +14 -2
  106. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +98 -0
  107. package/templates/apps/web/app/sitemap.xml/route.ts +13 -2
  108. package/templates/apps/web/auth.ts +133 -6
  109. package/templates/apps/web/components/sign-out-trigger.tsx +1 -1
  110. package/templates/apps/web/lib/__tests__/auth-email.test.ts +141 -0
  111. package/templates/apps/web/lib/__tests__/auth-phone.test.ts +445 -0
  112. package/templates/apps/web/lib/__tests__/auth-sms.test.ts +140 -0
  113. package/templates/apps/web/lib/__tests__/fixtures/tsconfig.flow.json +18 -0
  114. package/templates/apps/web/lib/__tests__/site-header.test.ts +13 -0
  115. package/templates/apps/web/lib/__tests__/telemetry-scrub.test.ts +19 -1
  116. package/templates/apps/web/lib/account-config.ts +24 -9
  117. package/templates/apps/web/lib/auth-email.ts +62 -6
  118. package/templates/apps/web/lib/auth-env.ts +13 -0
  119. package/templates/apps/web/lib/auth-sms.ts +180 -0
  120. package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +28 -0
  121. package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +332 -0
  122. package/templates/apps/web/lib/hub-session/config.ts +7 -1
  123. package/templates/apps/web/lib/hub-session/entry.ts +238 -0
  124. package/templates/apps/web/lib/hub-session/index.ts +1 -4
  125. package/templates/apps/web/lib/hub-session/one-tap.tsx +148 -0
  126. package/templates/apps/web/lib/hub-session/session.ts +120 -2
  127. package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +277 -0
  128. package/templates/apps/web/lib/site-header.ts +14 -1
  129. package/templates/apps/web/lib/site-listing.ts +7 -0
  130. package/templates/apps/web/lib/telemetry-scrub.ts +11 -0
  131. package/templates/apps/web/lib/topology.generated.ts +39 -0
  132. package/templates/apps/web/messages/en.json +125 -21
  133. package/templates/apps/web/middleware.ts +34 -2
  134. package/templates/apps/web/security-headers.config.ts +21 -0
  135. package/versions.json +47 -47
  136. package/templates/apps/web/app/[locale]/(authed)/sign-in-gate.tsx +0 -162
  137. package/templates/apps/web/components/signed-in-nav.tsx +0 -79
  138. package/templates/apps/web/lib/hub-session/__tests__/sign-in-gate.test.tsx +0 -180
  139. package/templates/apps/web/lib/hub-session/sign-in-gate.tsx +0 -162
@@ -11,6 +11,9 @@
11
11
  // signs in through its hub and carries commerce (#8217); elsewhere, null.
12
12
  // readOwnAccounts lists the signed-in person's own sign-in accounts through
13
13
  // Better Auth on a hub (#8431); a spoke has none here, so it answers null.
14
+ // readPhoneStep and loadPhoneApi read and write the account's phone step
15
+ // through Better Auth on a hub (#11138); a spoke's hub holds the person, so
16
+ // both answer null.
14
17
 
15
18
  export const TOPOLOGY: "hub" | "spoke" = "hub";
16
19
  export const UNSERVED_MCP_TOOLS: readonly string[] = [];
@@ -41,6 +44,42 @@ export async function readOwnAccounts(
41
44
  return auth.api.listUserAccounts({ headers });
42
45
  }
43
46
 
47
+ export type PhoneStep = {
48
+ available: boolean;
49
+ phone: { number: string; verified: boolean } | null;
50
+ };
51
+
52
+ export type PhoneApi = {
53
+ sendPhoneNumberOTP: (input: { body: { phoneNumber: string }; headers: Headers }) => Promise<unknown>;
54
+ verifyPhoneNumber: (input: {
55
+ body: { phoneNumber: string; code: string; updatePhoneNumber: boolean };
56
+ headers: Headers;
57
+ }) => Promise<unknown>;
58
+ updateUser: (input: { body: { phoneNumber: null }; headers: Headers }) => Promise<unknown>;
59
+ };
60
+
61
+ export async function readPhoneStep(headers: Headers): Promise<PhoneStep | null> {
62
+ const { auth } = await import("../auth");
63
+ // Whether the phone plugin is installed on this instance (#11106 D9).
64
+ const api: object = auth.api;
65
+ const available = "sendPhoneNumberOTP" in api;
66
+ if (!available) return { available, phone: null };
67
+ const session = await auth.api.getSession({ headers });
68
+ // The plugin's two user fields, which the conditional install leaves out
69
+ // of the inferred session type.
70
+ const user = (session?.user ?? {}) as { phoneNumber?: unknown; phoneNumberVerified?: unknown };
71
+ const phone =
72
+ typeof user.phoneNumber === "string" && user.phoneNumber !== ""
73
+ ? { number: user.phoneNumber, verified: user.phoneNumberVerified === true }
74
+ : null;
75
+ return { available, phone };
76
+ }
77
+
78
+ export async function loadPhoneApi(): Promise<PhoneApi | null> {
79
+ const { auth, phoneStepActive } = await import("../auth");
80
+ return phoneStepActive() ? auth.api : null;
81
+ }
82
+
44
83
  export async function registerSiteStores(): Promise<void> {
45
84
  const { registerLicenseKeyStore } = await import("./license-key-store");
46
85
  await registerLicenseKeyStore();
@@ -226,6 +226,18 @@
226
226
  "savedTitle": "Plan sent",
227
227
  "savedBody": "Check your inbox — your recommendation is on its way.",
228
228
  "checkoutError": "We couldn't start checkout — please try again.",
229
+ "exitLabel": "Exit",
230
+ "landingTime": "~ {minutes} min",
231
+ "scoreOutOf": "of {max}",
232
+ "levelShort": "L{n}",
233
+ "levelChartLabel": "Level {level} of 5: {pct}% of all points",
234
+ "reportCompiled": "Report Compiled",
235
+ "resultsFormHeadingReport": "Get your full report",
236
+ "resultsFormHeadingResults": "Email me my results",
237
+ "resultsFormButton": "Send it",
238
+ "resultsConsent": "We use your email address and assessment answers to generate and deliver your personalized report.",
239
+ "resultsSent": "Sent to {email}.",
240
+ "whatsIncluded": "What's included",
229
241
  "sidePanel": {
230
242
  "anchorTitle": "Not sure where to start?"
231
243
  },
@@ -362,7 +374,8 @@
362
374
  "unknownBody": "Check your email for the receipt from checkout — it has everything about your order.",
363
375
  "ctaHeadline": "Keep going",
364
376
  "ctaDescription": "Have a look at what else we offer.",
365
- "ctaLabel": "Browse services"
377
+ "ctaLabel": "Browse services",
378
+ "openAccount": "Open your account"
366
379
  },
367
380
  "cancel": {
368
381
  "title": "Checkout canceled",
@@ -609,6 +622,8 @@
609
622
  "emailLinkSentHeading": "Check your email",
610
623
  "emailLinkSentSubhead": "Look for a message from this site.",
611
624
  "emailLinkBack": "Back to sign in",
625
+ "continueWith": "Continue with",
626
+ "useAnotherWay": "Use another way",
612
627
  "emailLinkSentBody": "If an account uses that address, a sign-in link is on its way. It works once and expires in 5 minutes.",
613
628
  "emailLinkFailed": "We couldn't send a sign-in link. Try again.",
614
629
  "emailLinkRateLimited": "Too many requests. Wait a minute, then try again.",
@@ -696,6 +711,7 @@
696
711
  },
697
712
  "account": {
698
713
  "title": "Your account",
714
+ "yourAccount": "Your account",
699
715
  "description": "What changed, what's coming, and what needs you.",
700
716
  "artifacts": {
701
717
  "title": "Artifacts",
@@ -973,16 +989,59 @@
973
989
  "gate": {
974
990
  "emptyHeadline": "Sign-in isn't available yet",
975
991
  "emptyDescription": "This site hasn't turned on sign-in for members yet. Check back soon, or contact the site owner.",
976
- "signInLink": "Go to the sign-in page",
977
992
  "homeLink": "Back to the site",
978
- "hubHeadline": "Sign in to {site}",
979
- "hubDescription": "You sign in on our main site, then come straight back here.",
980
- "hubSignIn": "Sign in",
981
993
  "title": "Sign in"
982
994
  },
995
+ "spokeSignIn": {
996
+ "heading": "Sign in to {site}",
997
+ "subhead": "Enter your email and we'll send you a link to sign in.",
998
+ "emailLabel": "Email",
999
+ "submit": "Email me a sign-in link",
1000
+ "newHere": "New here? Accept to create your account with the same link.",
1001
+ "agreementsError": "To create an account, accept every agreement.",
1002
+ "google": "Continue with Google",
1003
+ "sent": "Check your email",
1004
+ "sentBody": "If that address can sign in here, a sign-in link is on its way. It works for 5 minutes.",
1005
+ "back": "Use another email",
1006
+ "unavailable": "Sign-in isn't available right now. Try again in a few minutes.",
1007
+ "exists": "You already have an account. Enter your email to sign in.",
1008
+ "claimInvalid": "That link has expired or was already used. Enter your email to sign in.",
1009
+ "openHeading": "Open your account",
1010
+ "openLead": "By opening your account you accept:",
1011
+ "open": "Open my account"
1012
+ },
1013
+ "billing": {
1014
+ "purchases": "Purchases",
1015
+ "purchasesUnavailable": "We couldn't load your purchases."
1016
+ },
983
1017
  "profile": {
984
1018
  "email": "Email",
985
- "unverified": "Email not verified"
1019
+ "unverified": "Email not verified",
1020
+ "phoneTitle": "Phone",
1021
+ "phoneLead": "A verified number your workspaces can reach you on. Only you can set it.",
1022
+ "phoneNumber": "Mobile number",
1023
+ "phoneNumberHint": "Include the country code, for example +1 555 555 0123.",
1024
+ "phoneSendCode": "Send code",
1025
+ "phoneSending": "Sending…",
1026
+ "phoneCode": "Code",
1027
+ "phoneCodeHint": "The six-digit code we texted you. It expires in 5 minutes.",
1028
+ "phoneVerify": "Verify",
1029
+ "phoneVerifying": "Verifying…",
1030
+ "phoneVerified": "Verified",
1031
+ "phoneRemove": "Remove",
1032
+ "phoneSent": "We texted you a code.",
1033
+ "phoneUnavailable": "Phone verification isn't available on this site.",
1034
+ "phoneUnverifiedEmail": "Confirm your email address first, then you can add a phone.",
1035
+ "phoneErrors": {
1036
+ "invalid_number": "Enter a mobile number with its country code, such as +1 555 555 0123. Only some countries are supported.",
1037
+ "invalid_code": "That code didn't match or has expired. Send a new one.",
1038
+ "taken": "That number is already on another account.",
1039
+ "too_many": "Too many tries. Send a new code.",
1040
+ "unverified": "Confirm your email address first.",
1041
+ "signed_out": "Your session ended. Sign in again.",
1042
+ "unavailable": "Phone verification isn't available on this site.",
1043
+ "failed": "Something went wrong. Try again."
1044
+ }
986
1045
  },
987
1046
  "results": {
988
1047
  "heading": "My results",
@@ -1095,6 +1154,27 @@
1095
1154
  "invalidInput": "Check what you entered and try again.",
1096
1155
  "failed": "This could not be sent. Try again."
1097
1156
  }
1157
+ },
1158
+ "invitation": {
1159
+ "title": "Join {organization}",
1160
+ "lead": "{inviter} invited you to join {organization} as {role}.",
1161
+ "leadNoInviter": "You've been invited to join {organization} as {role}.",
1162
+ "accept": "Accept invitation",
1163
+ "joined": "You've joined {organization}.",
1164
+ "joinedLead": "Sign in to the Admin to start working there.",
1165
+ "otherAddress": "This invitation is for a different email address. Sign out and sign in with the invited address.",
1166
+ "expired": "This invitation has expired. Ask the person who invited you to send it again.",
1167
+ "notPending": "This invitation is no longer open.",
1168
+ "alreadyMember": "You're already a member of this organization.",
1169
+ "void": "This invitation can no longer be accepted. Ask an owner or admin to invite you again.",
1170
+ "failed": "We couldn't accept the invitation. Try again.",
1171
+ "roles": {
1172
+ "owner": "an owner",
1173
+ "admin": "an admin",
1174
+ "member": "a member",
1175
+ "editor": "an editor",
1176
+ "viewer": "a viewer"
1177
+ }
1098
1178
  }
1099
1179
  },
1100
1180
  "admin": {
@@ -1277,26 +1357,50 @@
1277
1357
  "liveError": "Couldn't update. Try again.",
1278
1358
  "detail": {
1279
1359
  "backLabel": "Meetings",
1280
- "captionUnit": "Meeting",
1281
1360
  "statusLive": "Live",
1282
1361
  "statusOff": "Off",
1283
- "customersSwitchLabel": "Members only",
1284
- "customersAriaLabel": "{title}: members only",
1285
- "membersOnlyHint": "Signed-in members can use this. A live item stays public.",
1286
- "privateSwitchLabel": "Private",
1287
- "privateAriaLabel": "{title}: private",
1288
- "privateHint": "Listed on /private instead of /meet. Anyone with the link can still book.",
1362
+ "liveLabel": "Live",
1289
1363
  "roleNote": "Only an owner or admin can manage meeting types.",
1290
- "fromProviderHeading": "From Cal.com",
1364
+ "editInProvider": "Edit in Cal.com",
1365
+ "openOnSite": "Open on site",
1366
+ "address": {
1367
+ "heading": "This appointment",
1368
+ "linkLabel": "Link",
1369
+ "linkHint": "The address visitors book at.",
1370
+ "linkPrefixHint": "Set by the site.",
1371
+ "linkFixedHint": "Booked from the account, not a page of its own.",
1372
+ "viewportDesktop": "Desktop view"
1373
+ },
1374
+ "whoCanBook": "Who can book",
1375
+ "visibility": {
1376
+ "public": "Public",
1377
+ "private": "Private",
1378
+ "authenticated": "Authenticated"
1379
+ },
1380
+ "whoHints": {
1381
+ "public": "Listed on /meet. Anyone can book.",
1382
+ "publicOff": "Listed on /meet once it is live.",
1383
+ "private": "Listed on /private, not /meet. Anyone with the link can book.",
1384
+ "authenticated": "Members only, from their account. Not listed on the site."
1385
+ },
1386
+ "createdLabel": "Created",
1387
+ "sourceLabel": "Source",
1388
+ "sourceValue": "Cal.com",
1389
+ "tabDetails": "Details",
1390
+ "tabBookings": "Bookings",
1391
+ "detailsHeading": "Details",
1392
+ "detailsCaption": "Synced from Cal.com",
1291
1393
  "durationLabel": "Duration",
1292
1394
  "priceLabel": "Price",
1293
- "linkLabel": "Link",
1294
1395
  "timeZoneLabel": "Time zone",
1396
+ "descriptionLabel": "Description",
1397
+ "locationLabel": "Location",
1398
+ "nextUpHeading": "Next up",
1399
+ "noBookings": "No upcoming bookings.",
1295
1400
  "priceFree": "Free",
1296
- "customersOnToast": "Members only: on for {title}",
1297
- "customersOffToast": "Members only: off for {title}",
1298
- "privateOnToast": "Private: on for {title}",
1299
- "privateOffToast": "Private: off for {title}",
1401
+ "liveOnToast": "{title} is on",
1402
+ "liveOffToast": "{title} is off",
1403
+ "visibilityToast": "Who can book {title}: {state}",
1300
1404
  "errorToast": "Couldn't update"
1301
1405
  }
1302
1406
  },
@@ -1560,7 +1664,7 @@
1560
1664
  "unavailable": {
1561
1665
  "title": "This sign-in can't continue",
1562
1666
  "body": "The link may have expired. Go back to the site you came from and sign in again.",
1563
- "back": "Back to your account"
1667
+ "back": "Back to the site"
1564
1668
  }
1565
1669
  },
1566
1670
  "mcpConsent": {
@@ -1580,7 +1684,7 @@
1580
1684
  "noWorkspace": "You have no workspace to connect this app to.",
1581
1685
  "scopes": {
1582
1686
  "content-edit": "Edit pages and docs",
1583
- "content-publish": "Publish pages and docs",
1687
+ "content-publish": "Publish pages and docs, and delete glossary terms, FAQs and topics",
1584
1688
  "assets-write": "Upload and replace files",
1585
1689
  "magnets-manage": "Manage forms and magnets",
1586
1690
  "meeting-types-manage": "Manage meeting types",
@@ -49,7 +49,7 @@
49
49
  import { NextRequest, NextResponse } from "next/server";
50
50
  import createMiddleware from "next-intl/middleware";
51
51
 
52
- import { isBookingPath } from "./lib/auth-routes";
52
+ import { isAccountPath, isBookingPath } from "./lib/auth-routes";
53
53
  import {
54
54
  DOCS_PATH,
55
55
  DOCS_ROUTE,
@@ -65,6 +65,7 @@ import {
65
65
  } from "./lib/services-path";
66
66
  import {
67
67
  DEFAULT_SECURITY_HEADERS,
68
+ ONE_TAP_SECURITY_HEADERS,
68
69
  SCHEDULING_SECURITY_HEADERS,
69
70
  applyHeaders,
70
71
  } from "./security-headers.config";
@@ -175,6 +176,16 @@ const FILE_ROUTE_SECURITY_HEADERS: Readonly<Record<string, string>> =
175
176
  ),
176
177
  );
177
178
 
179
+ /**
180
+ * Whether this site signs in through its hub (#11096): the hub's sign-in
181
+ * origin, which only a hub-sign-in spoke sets (`lib/hub-session/config.ts`).
182
+ * Read from the environment, not `lib/topology.generated`, whose spoke render
183
+ * imports the Node-only session module this Edge bundle must not carry.
184
+ */
185
+ function signsInThroughHub(): boolean {
186
+ return (process.env.AILK_HUB_SIGN_IN_URL?.trim() ?? "") !== "";
187
+ }
188
+
178
189
  export function middleware(request: NextRequest): NextResponse {
179
190
  // Step 1: Forward x-pathname to server components so generateMetadata can
180
191
  // build path-aware hreflang alternates (P2 S1). Clone the request headers
@@ -182,6 +193,18 @@ export function middleware(request: NextRequest): NextResponse {
182
193
  // doesn't clobber the original user-facing path.
183
194
  const requestHeaders = new Headers(request.headers);
184
195
  requestHeaders.set("x-pathname", request.nextUrl.pathname);
196
+ // #11096 D1 — the (authed) gate renders from a layout, which gets no
197
+ // searchParams, so on a hub-sign-in spoke an account path's query rides
198
+ // beside the path. Always this request's own value: a client-sent
199
+ // `x-search` is dropped everywhere. It can hold a purchase claim, so no
200
+ // other path or topology carries it, and nothing logs or reports it.
201
+ requestHeaders.delete("x-search");
202
+ if (
203
+ signsInThroughHub() &&
204
+ isAccountPath(request.nextUrl.pathname, enabledLocales)
205
+ ) {
206
+ requestHeaders.set("x-search", request.nextUrl.search);
207
+ }
185
208
 
186
209
  // Non-locale routes are served as requested — no rewrite, no redirect.
187
210
  if (isNonLocaleRoute(request.nextUrl.pathname)) {
@@ -251,6 +274,8 @@ export function middleware(request: NextRequest): NextResponse {
251
274
  // pages of a site that carries the scheduling module get the same map with
252
275
  // Cal.com's origin added to the CSP (#8843 D12); no other page does. The
253
276
  // file routes get the six others and keep their own sandbox CSP (#9162).
277
+ // A hub-sign-in spoke that turned Google One Tap on (`AILK_HUB_ONE_TAP=on`)
278
+ // gets Google's origins on its other pages (#11096 D10, SEC-11096-10).
254
279
  applyHeaders(
255
280
  intlResponse.headers,
256
281
  isFileRoutePath(request.nextUrl.pathname)
@@ -258,8 +283,15 @@ export function middleware(request: NextRequest): NextResponse {
258
283
  : SCHEDULING_PAGES &&
259
284
  isBookingPath(request.nextUrl.pathname, enabledLocales)
260
285
  ? SCHEDULING_SECURITY_HEADERS
261
- : DEFAULT_SECURITY_HEADERS,
286
+ : signsInThroughHub() && process.env.AILK_HUB_ONE_TAP === "on"
287
+ ? ONE_TAP_SECURITY_HEADERS
288
+ : DEFAULT_SECURITY_HEADERS,
262
289
  );
290
+ // SEC-11096-4 — a page that carries a purchase claim in its query sends no
291
+ // referrer, so no request it makes carries the claim in `Referer`.
292
+ if (request.nextUrl.searchParams.has("claim")) {
293
+ intlResponse.headers.set("Referrer-Policy", "no-referrer");
294
+ }
263
295
  // #10040 decision 7 — a site with neither marketing nor docs-blog (a hub)
264
296
  // asks every crawler to keep out of every page, read from the module list.
265
297
  if (!PUBLIC_PAGES) intlResponse.headers.set("X-Robots-Tag", "noindex");
@@ -142,6 +142,27 @@ export const SCHEDULING_CSP: CspDirectiveMap = Object.freeze({
142
142
  export const SCHEDULING_SECURITY_HEADERS: Readonly<Record<string, string>> =
143
143
  Object.freeze(buildHeaders({ csp: SCHEDULING_CSP }));
144
144
 
145
+ /**
146
+ * Google One Tap's CSP additions (#11096 D10, SEC-11096-10). A spoke that
147
+ * signs in through its hub and sets `AILK_HUB_ONE_TAP=on` loads Google's
148
+ * Identity Services script on its signed-out account page, which fetches,
149
+ * styles and frames from Google. Only such a spoke names Google:
150
+ * `middleware.ts` applies this map while the setting is on, as it applies
151
+ * `SCHEDULING_CSP` on booking paths. `'self'` in `frame-src` keeps
152
+ * same-origin frames working, which `default-src 'self'` allowed until the
153
+ * directive existed.
154
+ */
155
+ export const ONE_TAP_CSP: CspDirectiveMap = Object.freeze({
156
+ "script-src": Object.freeze(["https://accounts.google.com/gsi/client"]),
157
+ "connect-src": Object.freeze(["https://accounts.google.com/gsi/"]),
158
+ "style-src": Object.freeze(["https://accounts.google.com/gsi/"]),
159
+ "frame-src": Object.freeze(["'self'", "https://accounts.google.com"]),
160
+ });
161
+
162
+ /** The header map for a One Tap spoke's pages: the default plus `ONE_TAP_CSP`. */
163
+ export const ONE_TAP_SECURITY_HEADERS: Readonly<Record<string, string>> =
164
+ Object.freeze(buildHeaders({ csp: ONE_TAP_CSP }));
165
+
145
166
  /** Write every entry from a header map onto a Headers object. */
146
167
  export function applyHeaders(
147
168
  target: Headers,
package/versions.json CHANGED
@@ -1,66 +1,66 @@
1
1
  {
2
- "@working-theory/admin-ui": "0.58.0",
3
- "@working-theory/aeo": "0.58.0",
4
- "@working-theory/agent-context": "0.58.0",
2
+ "@working-theory/admin-ui": "0.60.0",
3
+ "@working-theory/aeo": "0.60.0",
4
+ "@working-theory/agent-context": "0.60.0",
5
5
  "@working-theory/agent-contract": "0.1.0",
6
6
  "@working-theory/agent-memory": "0.0.0",
7
7
  "@working-theory/ai": "0.1.0",
8
- "@working-theory/analytics": "0.58.0",
9
- "@working-theory/api": "0.58.0",
10
- "@working-theory/api-client": "0.58.0",
8
+ "@working-theory/analytics": "0.60.0",
9
+ "@working-theory/api": "0.60.0",
10
+ "@working-theory/api-client": "0.60.0",
11
11
  "@working-theory/cda-filesystem": "0.0.0",
12
- "@working-theory/cli": "0.58.0",
13
- "@working-theory/common": "0.58.0",
12
+ "@working-theory/cli": "0.60.0",
13
+ "@working-theory/common": "0.60.0",
14
14
  "@working-theory/consent": "0.1.0",
15
- "@working-theory/content-adapters": "0.58.0",
16
- "@working-theory/content-projection": "0.58.0",
17
- "@working-theory/email": "0.58.0",
15
+ "@working-theory/content-adapters": "0.60.0",
16
+ "@working-theory/content-projection": "0.60.0",
17
+ "@working-theory/email": "0.60.0",
18
18
  "@working-theory/env": "0.0.0",
19
- "@working-theory/eslint-config": "0.58.0",
20
- "@working-theory/fumadocs-schema": "0.58.0",
19
+ "@working-theory/eslint-config": "0.60.0",
20
+ "@working-theory/fumadocs-schema": "0.60.0",
21
21
  "@working-theory/ids": "0.20.0",
22
- "@working-theory/jsonld": "0.58.0",
23
- "@working-theory/license": "0.58.0",
24
- "@working-theory/mcp-server": "0.58.0",
25
- "@working-theory/metadata": "0.58.0",
26
- "@working-theory/observability": "0.58.0",
27
- "@working-theory/page-renderer": "0.58.0",
22
+ "@working-theory/jsonld": "0.60.0",
23
+ "@working-theory/license": "0.60.0",
24
+ "@working-theory/mcp-server": "0.60.0",
25
+ "@working-theory/metadata": "0.60.0",
26
+ "@working-theory/observability": "0.60.0",
27
+ "@working-theory/page-renderer": "0.60.0",
28
28
  "@working-theory/plugin-mcp": "0.1.3",
29
- "@working-theory/schema": "0.58.0",
30
- "@working-theory/schema-pack-registry": "0.58.0",
31
- "@working-theory/schema-validator": "0.58.0",
32
- "@working-theory/sections-registry": "0.58.0",
33
- "@working-theory/site-config": "0.58.0",
34
- "@working-theory/spoke-checkout": "0.7.14",
35
- "@working-theory/stripe-client": "0.58.0",
36
- "@working-theory/templates": "0.58.0",
37
- "@working-theory/theme": "0.58.0",
38
- "@working-theory/ui": "0.58.0",
39
- "@working-theory/validation": "0.58.0",
40
- "@working-theory/web-i18n": "0.58.0",
41
- "@working-theory/admin": "0.12.1",
42
- "@working-theory/api-commerce": "0.1.12",
43
- "@working-theory/api-content-write": "0.7.1",
44
- "@working-theory/api-hub": "0.4.4",
45
- "@working-theory/api-multi-tenant": "0.2.7",
46
- "@working-theory/api-scheduling": "0.4.9",
47
- "@working-theory/api-signal-collectors": "0.4.2",
48
- "@working-theory/api-workspace": "0.7.1",
29
+ "@working-theory/schema": "0.60.0",
30
+ "@working-theory/schema-pack-registry": "0.60.0",
31
+ "@working-theory/schema-validator": "0.60.0",
32
+ "@working-theory/sections-registry": "0.60.0",
33
+ "@working-theory/site-config": "0.60.0",
34
+ "@working-theory/spoke-checkout": "0.7.16",
35
+ "@working-theory/stripe-client": "0.60.0",
36
+ "@working-theory/templates": "0.60.0",
37
+ "@working-theory/theme": "0.60.0",
38
+ "@working-theory/ui": "0.60.0",
39
+ "@working-theory/validation": "0.60.0",
40
+ "@working-theory/web-i18n": "0.60.0",
41
+ "@working-theory/admin": "0.14.0",
42
+ "@working-theory/api-commerce": "0.1.14",
43
+ "@working-theory/api-content-write": "0.8.0",
44
+ "@working-theory/api-hub": "0.5.0",
45
+ "@working-theory/api-multi-tenant": "0.3.0",
46
+ "@working-theory/api-scheduling": "0.5.0",
47
+ "@working-theory/api-signal-collectors": "0.6.0",
48
+ "@working-theory/api-workspace": "0.8.0",
49
49
  "@working-theory/billing-client": "0.0.0",
50
50
  "@working-theory/branding": "0.0.0",
51
51
  "@working-theory/license-client": "0.0.0",
52
52
  "@working-theory/license-manifest": "0.0.0",
53
- "@working-theory/mcp-scheduling": "0.3.11",
54
- "@working-theory/mcp-signal-collectors": "0.2.12",
55
- "@working-theory/mcp-workspace": "0.7.1",
53
+ "@working-theory/mcp-scheduling": "0.4.1",
54
+ "@working-theory/mcp-signal-collectors": "0.2.14",
55
+ "@working-theory/mcp-workspace": "0.8.1",
56
56
  "@working-theory/partner-session": "0.0.0",
57
57
  "@working-theory/preview-protocol": "0.0.0",
58
- "@working-theory/ui-commerce": "0.23.36",
59
- "@working-theory/ui-docs-blog": "0.23.36",
60
- "@working-theory/ui-scheduling": "0.25.10",
61
- "@working-theory/ui-signal-collectors": "0.28.2",
58
+ "@working-theory/ui-commerce": "0.23.38",
59
+ "@working-theory/ui-docs-blog": "0.23.38",
60
+ "@working-theory/ui-scheduling": "0.25.12",
61
+ "@working-theory/ui-signal-collectors": "0.29.1",
62
62
  "@working-theory/web": "0.0.0",
63
63
  "@working-theory/app-api": "1.0.0",
64
64
  "@working-theory/mcp": "0.0.0",
65
- "@working-theory/database": "0.58.0"
65
+ "@working-theory/database": "0.60.0"
66
66
  }
@@ -1,162 +0,0 @@
1
- "use client"; // social sign-in requires a client-side Better Auth call
2
-
3
- /**
4
- * SignInGate — the `(authed)` group's own front door (#4665 D9).
5
- *
6
- * This gate composes the shipped `AuthPanel` section directly (so the
7
- * dashboard is reachable in place, unlike `apps-paid/admin`, which redirects
8
- * to "/" on no session) and ALSO links to `apps/web`'s own `/sign-in` page
9
- * (#4984) carrying `?next=<pathname>`, so a visitor who prefers the full
10
- * sign-in surface lands back on the exact page they requested.
11
- *
12
- * `providers` arrives as a prop, resolved by the `(authed)` layout (an RSC)
13
- * from the server's provider env (#7419). This module must never read that
14
- * env itself: it is bundled for the browser, where `GOOGLE_CLIENT_ID` and the
15
- * like are always unset, so a client-side read always came back empty.
16
- *
17
- * Zero active providers → an `EmptyState` naming the missing configuration
18
- * (the `AuthPanel` UI-contract forbids fabricating a session — spec
19
- * Clarifications), still followed by the sign-in link. `callbackURL` is the
20
- * current pathname (via `usePathname()`) so a successful social sign-in
21
- * lands back on the exact dashboard page the visitor requested.
22
- *
23
- * Email sign-in link (#7435 § D9): when the layout passes `card` with
24
- * `emailLink`, the gate renders `/sign-in`'s own `SignInCard` — the same
25
- * providers plus "Send me a magic link" — in place of `AuthPanel`, whose
26
- * email + password form has no submit wiring and would otherwise sit inert
27
- * beside the new field. Without the prop every render is what it was before.
28
- *
29
- * The one card (#9662): on the member `/account` gate the layout passes
30
- * `card` whenever a method is on, with the site's mark, the "Don't have an
31
- * account? Sign up" line and the Terms + Privacy acknowledgement, so the gate
32
- * renders the same card `/sign-in` does.
33
- */
34
-
35
- import { EmptyState, Link } from "@working-theory/ui/primitives";
36
- import { AuthPanel, type AuthPanelProvider } from "@working-theory/ui/sections";
37
- import { createAuthClient } from "better-auth/react";
38
- import { usePathname } from "next/navigation";
39
- import type { ReactElement, ReactNode } from "react";
40
-
41
- import { SignInCard } from "../(auth)/sign-in/sign-in-card";
42
- import type { SignInCardText } from "../(auth)/sign-in/sign-in-text";
43
-
44
- const authClient = createAuthClient();
45
-
46
- export interface SignInGateLabels {
47
- emptyHeadline: string;
48
- emptyDescription: string;
49
- /** Visible text of the link to the full sign-in page (#4984). */
50
- signInLinkLabel: string;
51
- }
52
-
53
- export interface SignInGateProps {
54
- labels: SignInGateLabels;
55
- /** Locale-prefixed sign-in page path — `localeHref(locale, "/sign-in")`. */
56
- signInPath: string;
57
- /** The active social providers, resolved server-side by the layout (#7419). */
58
- providers: AuthPanelProvider[];
59
- /**
60
- * Renders `SignInCard` in place of `AuthPanel` — present when the email
61
- * sign-in link is on (#7435) or on the member gate (#9662). The card's copy,
62
- * mark, prospect line and footnote are resolved server-side by the layout.
63
- */
64
- card?: {
65
- text: SignInCardText;
66
- /** Offer "Send me a magic link" — the email sign-in link is on. */
67
- emailLink: boolean;
68
- logo?: ReactNode;
69
- prospect?: { prompt: string; linkLabel: string; href: string };
70
- footnote?: ReactNode;
71
- };
72
- }
73
-
74
- export function SignInGate({
75
- labels,
76
- signInPath,
77
- providers,
78
- card,
79
- }: SignInGateProps): ReactElement {
80
- const pathname = usePathname();
81
- const signInHref = `${signInPath}?next=${encodeURIComponent(pathname)}`;
82
-
83
- const signInLink = (
84
- <Link
85
- href={signInHref}
86
- data-testid="sign-in-gate-link"
87
- // 24px hit-area floor (Rule 14) — a bare inline link's line-height box
88
- // falls short on its own.
89
- className="inline-flex min-h-6 items-center px-2"
90
- >
91
- {labels.signInLinkLabel}
92
- </Link>
93
- );
94
-
95
- if (card) {
96
- const { text } = card;
97
- return (
98
- <div
99
- className="flex min-h-screen flex-col items-center justify-center gap-4 py-section"
100
- data-testid="sign-in-gate"
101
- >
102
- {/* AuthShell's 400px column: the cap sits on the wrapper, never on the card (AuthShell.tsx). */}
103
- <div className="w-full max-w-100">
104
- <SignInCard
105
- providers={providers}
106
- method="sso"
107
- next={pathname}
108
- labels={text.labels}
109
- notConfiguredSubhead={text.notConfiguredSubhead}
110
- errorLabels={text.errorLabels}
111
- emailLink={card.emailLink}
112
- errorCallbackURL={signInHref}
113
- signInHref={signInHref}
114
- emailLinkLabels={text.emailLinkLabels}
115
- {...(card.logo !== undefined ? { logo: card.logo } : {})}
116
- {...(card.prospect !== undefined
117
- ? { prospect: card.prospect }
118
- : {})}
119
- {...(card.footnote !== undefined
120
- ? { footnote: card.footnote }
121
- : {})}
122
- />
123
- </div>
124
- {signInLink}
125
- </div>
126
- );
127
- }
128
-
129
- if (providers.length === 0) {
130
- return (
131
- <div
132
- className="flex min-h-screen flex-col items-center justify-center gap-4"
133
- data-testid="sign-in-gate-empty"
134
- >
135
- <EmptyState
136
- headline={labels.emptyHeadline}
137
- description={labels.emptyDescription}
138
- />
139
- {signInLink}
140
- </div>
141
- );
142
- }
143
-
144
- return (
145
- <div
146
- className="flex min-h-screen flex-col items-center justify-center gap-4 py-section"
147
- data-testid="sign-in-gate"
148
- >
149
- <AuthPanel
150
- sectionName="auth-panel"
151
- data={{ mode: "signin", providers }}
152
- onProviderClick={(provider) => {
153
- void authClient.signIn.social({
154
- provider,
155
- callbackURL: pathname,
156
- });
157
- }}
158
- />
159
- {signInLink}
160
- </div>
161
- );
162
- }