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
package/dist/topology.js CHANGED
@@ -90,8 +90,8 @@ export const SPOKE_EXCLUDED_MODULE_PATHS = [
90
90
  * The `(authed)` seeds of the sign-in-through-the-hub mode (#7894 D9): the
91
91
  * whole `(authed)` group goes in the default mode; in the hub mode its account
92
92
  * area, layout and gate seam stay, and only these go — the operator surfaces,
93
- * the Better Auth gate, the hub's own consent page (#9966 D2, a 404 on a
94
- * spoke) and the suites that mock `auth.ts` by path.
93
+ * the hub's own consent page (#9966 D2, a 404 on a spoke) and the suites that
94
+ * mock `auth.ts` by path.
95
95
  */
96
96
  export const HUB_MODE_AUTHED_SEEDS = [
97
97
  "apps/web/app/[locale]/(authed)/__tests__",
@@ -102,7 +102,6 @@ export const HUB_MODE_AUTHED_SEEDS = [
102
102
  "apps/web/app/[locale]/(authed)/edit",
103
103
  "apps/web/app/[locale]/(authed)/leads",
104
104
  "apps/web/app/[locale]/(authed)/waitlist",
105
- "apps/web/app/[locale]/(authed)/sign-in-gate.tsx",
106
105
  ];
107
106
  /** The default mode's one `(authed)` seed, which the hub mode replaces. */
108
107
  const AUTHED_SEED = "apps/web/app/[locale]/(authed)";
@@ -301,7 +300,10 @@ const WEB_SEAM_HEADER = `// topology.generated.ts — how this site reads a sess
301
300
  // loadSpokeBilling reaches the spoke billing action only on a spoke that
302
301
  // signs in through its hub and carries commerce (#8217); elsewhere, null.
303
302
  // readOwnAccounts lists the signed-in person's own sign-in accounts through
304
- // Better Auth on a hub (#8431); a spoke has none here, so it answers null.`;
303
+ // Better Auth on a hub (#8431); a spoke has none here, so it answers null.
304
+ // readPhoneStep and loadPhoneApi read and write the account's phone step
305
+ // through Better Auth on a hub (#11138); a spoke's hub holds the person, so
306
+ // both answer null.`;
305
307
  const MCP_SEAM_HEADER = `// topology.generated.ts — how this MCP server resolves its workspace store.
306
308
  //
307
309
  // GENERATED by create-ailk for this site's topology (#7426). Do not edit:
@@ -351,6 +353,70 @@ function ownAccountsReader(topology) {
351
353
  return Promise.resolve(null);
352
354
  }`;
353
355
  }
356
+ /**
357
+ * The phone step's types (#11106 D9): its state, and the plugin's three calls.
358
+ * Function-typed properties, not methods, so the hub's `auth.api` assignment
359
+ * is checked strictly: a Better Auth change to these endpoints fails `tsc`.
360
+ */
361
+ const PHONE_STEP_TYPES = `export type PhoneStep = {
362
+ available: boolean;
363
+ phone: { number: string; verified: boolean } | null;
364
+ };
365
+
366
+ export type PhoneApi = {
367
+ sendPhoneNumberOTP: (input: { body: { phoneNumber: string }; headers: Headers }) => Promise<unknown>;
368
+ verifyPhoneNumber: (input: {
369
+ body: { phoneNumber: string; code: string; updatePhoneNumber: boolean };
370
+ headers: Headers;
371
+ }) => Promise<unknown>;
372
+ updateUser: (input: { body: { phoneNumber: null }; headers: Headers }) => Promise<unknown>;
373
+ };`;
374
+ /**
375
+ * The account General page's phone step (#11138): `readPhoneStep` is the
376
+ * page's read — whether the phone plugin is installed, and the person's
377
+ * number — and `loadPhoneApi` the actions' writes, Better Auth's phone
378
+ * endpoints when the build turns the step on. The hub render loads `auth.ts`
379
+ * only when one is called; a spoke's hub holds the person, so its renders
380
+ * answer `null` — no phone step, and every action `unavailable` — and import
381
+ * nothing.
382
+ */
383
+ function phoneStep(topology) {
384
+ if (topology === "hub") {
385
+ return `${PHONE_STEP_TYPES}
386
+
387
+ export async function readPhoneStep(headers: Headers): Promise<PhoneStep | null> {
388
+ const { auth } = await import("../auth");
389
+ // Whether the phone plugin is installed on this instance (#11106 D9).
390
+ const api: object = auth.api;
391
+ const available = "sendPhoneNumberOTP" in api;
392
+ if (!available) return { available, phone: null };
393
+ const session = await auth.api.getSession({ headers });
394
+ // The plugin's two user fields, which the conditional install leaves out
395
+ // of the inferred session type.
396
+ const user = (session?.user ?? {}) as { phoneNumber?: unknown; phoneNumberVerified?: unknown };
397
+ const phone =
398
+ typeof user.phoneNumber === "string" && user.phoneNumber !== ""
399
+ ? { number: user.phoneNumber, verified: user.phoneNumberVerified === true }
400
+ : null;
401
+ return { available, phone };
402
+ }
403
+
404
+ export async function loadPhoneApi(): Promise<PhoneApi | null> {
405
+ const { auth, phoneStepActive } = await import("../auth");
406
+ return phoneStepActive() ? auth.api : null;
407
+ }`;
408
+ }
409
+ return `${PHONE_STEP_TYPES}
410
+
411
+ export function readPhoneStep(headers: Headers): Promise<PhoneStep | null> {
412
+ void headers;
413
+ return Promise.resolve(null);
414
+ }
415
+
416
+ export function loadPhoneApi(): Promise<PhoneApi | null> {
417
+ return Promise.resolve(null);
418
+ }`;
419
+ }
354
420
  /** The sign-in exports every web seam render carries (#7894 D8). */
355
421
  function signInExports(values) {
356
422
  const literal = (value) => value === null ? "null" : JSON.stringify(value);
@@ -432,6 +498,8 @@ export async function readSession(headers: Headers): Promise<SiteSession> {
432
498
 
433
499
  ${ownAccountsReader("hub")}
434
500
 
501
+ ${phoneStep("hub")}
502
+
435
503
  export async function registerSiteStores(): Promise<void> {
436
504
  const { registerLicenseKeyStore } = await import("./license-key-store");
437
505
  await registerLicenseKeyStore();
@@ -456,6 +524,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
456
524
 
457
525
  ${ownAccountsReader("spoke")}
458
526
 
527
+ ${phoneStep("spoke")}
528
+
459
529
  export function registerSiteStores(): Promise<void> {
460
530
  return Promise.resolve();
461
531
  }
@@ -478,6 +548,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
478
548
 
479
549
  ${ownAccountsReader("spoke")}
480
550
 
551
+ ${phoneStep("spoke")}
552
+
481
553
  export function registerSiteStores(): Promise<void> {
482
554
  return Promise.resolve();
483
555
  }
@@ -488,9 +560,10 @@ ${spokeBillingLoader(false)}
488
560
  const AUTHED_GATE_SEAM_HEADER = `// signed-out-gate.generated.tsx — what the (authed) group shows a signed-out visitor.
489
561
  //
490
562
  // GENERATED by create-ailk for this site's topology and sign-in mode (#7894).
491
- // Do not edit: every scaffold rewrites it. A hub renders its own sign-in —
492
- // the operator gate, or the account area's member gate; a spoke that signs in
493
- // through its hub (\`--hub-sign-in\`) renders the hub-session gate.`;
563
+ // Do not edit: every scaffold rewrites it. A hub redirects to its own
564
+ // /sign-in (an account path with no sign-in method on says so in place); a
565
+ // spoke that signs in through its hub (\`--hub-sign-in\`) redirects to its
566
+ // hub-session sign-in route.`;
494
567
  /**
495
568
  * The packages the gate seam imports. Interpolated, not written inline, for
496
569
  * the reason `CONTENT_ADAPTERS_PACKAGE` below is.
@@ -498,6 +571,7 @@ const AUTHED_GATE_SEAM_HEADER = `// signed-out-gate.generated.tsx — what the (
498
571
  const UI_PACKAGE = "@working-theory/ui";
499
572
  const WEB_I18N_PACKAGE = "@working-theory/web-i18n";
500
573
  const NEXT_INTL_SERVER = "next-intl/server";
574
+ const NEXT_NAVIGATION = "next/navigation";
501
575
  const REACT_PACKAGE = "react";
502
576
  const AUTHED_GATE_PROPS = `export interface SignedOutGateProps {
503
577
  locale: string;
@@ -506,8 +580,8 @@ const AUTHED_GATE_PROPS = `export interface SignedOutGateProps {
506
580
  }`;
507
581
  /**
508
582
  * `apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx` (#7894 D8).
509
- * The hub render is the `(authed)` layout's no-session branch, moved; the
510
- * `signIn: "hub"` render imports only the hub-session gate. A default-mode
583
+ * The hub render redirects to `/sign-in` (#11095 D3); the `signIn: "hub"`
584
+ * render is the spoke's own sign-in form, `SpokeSignIn` (#11096 D1). A default-mode
511
585
  * spoke carries no `(authed)` group, so it has no render.
512
586
  * @throws TopologyError for a spoke in the default mode.
513
587
  */
@@ -516,20 +590,16 @@ export function renderAuthedGateSeam(topology, signIn = "off") {
516
590
  return `${AUTHED_GATE_SEAM_HEADER}
517
591
  import { localeHref } from "${UI_PACKAGE}";
518
592
  import { Button, Heading, Link, Text } from "${UI_PACKAGE}/primitives";
519
- import type { AuthPanelProvider } from "${UI_PACKAGE}/sections";
520
593
  import { readLocales } from "${WEB_I18N_PACKAGE}";
594
+ import { redirect } from "${NEXT_NAVIGATION}";
521
595
  import { getTranslations } from "${NEXT_INTL_SERVER}";
522
596
  import type { ReactElement } from "${REACT_PACKAGE}";
523
597
 
524
- import { legalFootnote } from "../(auth)/legal-footnote";
525
- import { resolveSignInCardText } from "../(auth)/sign-in/sign-in-text";
526
598
  import { getActiveProviderIds } from "../../../lib/auth-env";
527
599
  import { isAccountPath } from "../../../lib/auth-routes";
528
- import { siteLogo } from "../../../lib/site-logo";
529
600
 
530
- import { SignInGate } from "./sign-in-gate";
531
-
532
- const SUPPORTED_PROVIDERS: readonly AuthPanelProvider[] = ["google", "github"];
601
+ /** The methods a member signs in with on /sign-in's card. */
602
+ const MEMBER_METHODS: readonly string[] = ["google", "github", "magic-link"];
533
603
 
534
604
  ${AUTHED_GATE_PROPS}
535
605
 
@@ -537,23 +607,17 @@ export async function SignedOutGate({
537
607
  locale,
538
608
  requestHeaders,
539
609
  }: SignedOutGateProps): Promise<ReactElement> {
540
- // No \`x-pathname\`, no locale read: a render outside the middleware keeps
541
- // the operator gate without touching the locale config.
610
+ // No \`x-pathname\`, no locale read: a render outside the middleware
611
+ // redirects to the bare /sign-in without touching the locale config.
542
612
  const pathname = requestHeaders.get("x-pathname");
543
613
  const isAccount =
544
614
  pathname !== null && isAccountPath(pathname, readLocales());
545
- const t = await getTranslations({
546
- locale,
547
- namespace: isAccount ? "account.gate" : "waitlistDashboard.gate",
548
- });
549
- const active = getActiveProviderIds();
550
- const emailLink = active.includes("magic-link");
551
- const providers = active.filter((id): id is AuthPanelProvider =>
552
- (SUPPORTED_PROVIDERS as readonly string[]).includes(id),
615
+ const hasMemberMethod = getActiveProviderIds().some((id) =>
616
+ MEMBER_METHODS.includes(id),
553
617
  );
554
- const signInPath = localeHref(locale, "/sign-in");
555
618
 
556
- if (isAccount && providers.length === 0 && !emailLink) {
619
+ if (isAccount && !hasMemberMethod) {
620
+ const t = await getTranslations({ locale, namespace: "account.gate" });
557
621
  return (
558
622
  <div
559
623
  className="flex min-h-screen flex-col items-center justify-center gap-4 py-section text-center"
@@ -581,36 +645,13 @@ export async function SignedOutGate({
581
645
  );
582
646
  }
583
647
 
584
- // The sign-in card: with the email link on, and on the member gate, which
585
- // also wears the one card's frame — the mark, the toggle line to /sign-up
586
- // and the Terms + Privacy acknowledgement (#9662).
587
- const text =
588
- emailLink || isAccount ? await resolveSignInCardText(locale) : undefined;
589
- const card = text
590
- ? {
591
- text,
592
- emailLink,
593
- ...(isAccount
594
- ? {
595
- logo: siteLogo(),
596
- prospect: { ...text.prospect, href: localeHref(locale, "/sign-up") },
597
- footnote: legalFootnote(locale, text.acknowledgement),
598
- }
599
- : {}),
600
- }
601
- : undefined;
602
-
603
- return (
604
- <SignInGate
605
- labels={{
606
- emptyHeadline: t("emptyHeadline"),
607
- emptyDescription: t("emptyDescription"),
608
- signInLinkLabel: t("signInLink"),
609
- }}
610
- signInPath={signInPath}
611
- providers={providers}
612
- {...(card ? { card } : {})}
613
- />
648
+ // Every other signed-out render is a redirect to the sign-in card, with the
649
+ // requested path as \`next\` (#11095 D3): \`/sign-in\` sanitizes it.
650
+ const signInPath = localeHref(locale, "/sign-in");
651
+ redirect(
652
+ pathname === null
653
+ ? signInPath
654
+ : \`\${signInPath}?next=\${encodeURIComponent(pathname)}\`,
614
655
  );
615
656
  }
616
657
  `;
@@ -621,15 +662,18 @@ export async function SignedOutGate({
621
662
  return `${AUTHED_GATE_SEAM_HEADER}
622
663
  import type { ReactElement } from "${REACT_PACKAGE}";
623
664
 
624
- import { HubSignInGate } from "../../../lib/hub-session/sign-in-gate";
665
+ import { SpokeSignIn } from "../../../lib/hub-session";
625
666
 
626
667
  ${AUTHED_GATE_PROPS}
627
668
 
669
+ // The spoke's own sign-in form (#11096 D1): email, the hub's agreements and
670
+ // Google, posted to this site's own routes. The person never sees the hub's
671
+ // brand; every hub hop after it is a redirect.
628
672
  export function SignedOutGate({
629
673
  locale,
630
674
  requestHeaders,
631
675
  }: SignedOutGateProps): Promise<ReactElement> {
632
- return HubSignInGate({ locale, requestHeaders });
676
+ return SpokeSignIn({ locale, requestHeaders });
633
677
  }
634
678
  `;
635
679
  }
package/dist/update.js CHANGED
@@ -62,6 +62,7 @@ import { escapeBareBraces, findBareBraces } from "./mdx-braces.js";
62
62
  import { MODULE_SLICES } from "./module-architecture.js";
63
63
  import { MODULE_FLAGS_PATH, PAID_MCP_TOOLS_PATH, writeModuleFlags, writePaidMcpTools, } from "./paid-sections.js";
64
64
  import { ParseError } from "./parse-args.js";
65
+ import { SITE_LISTING_PATH } from "./site-listing-path.js";
65
66
  import { SITE_ROSTER_PATH, planServedRoster, readRosterPageRoutes } from "./site-roster.js";
66
67
  import { SPOKE_CHECKOUT_TEMPLATE_PATHS } from "./spoke-checkout.js";
67
68
  import { GATEABLE_SURFACES, excludedRoutePaths, isRemovedPublicRoutePath, resolveSurfaces, surfacesNamedByRoutes, } from "./surfaces.js";
@@ -1539,6 +1540,16 @@ export async function updateSite(opts) {
1539
1540
  moved.added.push(MODULE_FLAGS_PATH);
1540
1541
  else if (flags === "updated")
1541
1542
  moved.updated.push(MODULE_FLAGS_PATH);
1543
+ // #10940 D5 — the site's listing is site-owned (REGENERATED_APP_PATHS):
1544
+ // written only when absent, so a site updated onto routes that import it
1545
+ // builds; a present one is never read or written.
1546
+ const listingAbs = join(targetDir, ...SITE_LISTING_PATH.split("/"));
1547
+ const listingBytes = runningRaw.get(SITE_LISTING_PATH);
1548
+ if (!existsSync(listingAbs) && listingBytes !== undefined) {
1549
+ mkdirSync(dirname(listingAbs), { recursive: true });
1550
+ writeFileSync(listingAbs, renderTemplateFile(listingBytes, SITE_LISTING_PATH, {}, markersForVersion(record.projectName, version)));
1551
+ moved.added.push(SITE_LISTING_PATH);
1552
+ }
1542
1553
  // #9567 — the MCP move's writes, then the paid MCP tool registry from the
1543
1554
  // site's own apps/mcp/package.json on every run (REGENERATED_APP_PATHS,
1544
1555
  // #9460 DD6) — after the move, so a pack the move declared is a row.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ailk",
3
- "version": "0.34.1",
3
+ "version": "0.36.0",
4
4
  "description": "Scaffolder for AI Launch Kit — `pnpm create ailk@latest <dir>` produces a starter repo consuming @working-theory/* from npm (per ADR 0007).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "tar": "^7.5.21"
29
29
  },
30
30
  "devDependencies": {
31
- "@working-theory/schema": "0.58.0",
32
- "@working-theory/templates": "0.58.0"
31
+ "@working-theory/schema": "0.60.0",
32
+ "@working-theory/templates": "0.60.0"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",
@@ -202,6 +202,27 @@ CONTENT_ADAPTER=mdx
202
202
  # default.
203
203
  # RESEND_AUDIENCE_ID=
204
204
  #
205
+ # ── Text messages (Twilio, apps/api) ─────────────────────────────────────────
206
+ # Phone verification (#11106 D9): a signed-in person sets and verifies a phone
207
+ # on the hub's Account page. apps/web's phone plugin signs one body with
208
+ # AUTH_EMAIL_WEBHOOK_SECRET and POSTs it to apps/api's
209
+ # /v1/auth/transactional-sms, which texts one fixed message ("Your
210
+ # verification code is …") through Twilio's Messages API. With any of the
211
+ # three unset the relay answers 503 sms_not_configured and no text is sent.
212
+ # Budgets (fail closed): 3 per number per hour, 5 per user per day, 200 per
213
+ # deployment per hour.
214
+ # TWILIO_ACCOUNT_SID=
215
+ # TWILIO_AUTH_TOKEN=
216
+ # TWILIO_FROM_NUMBER=
217
+ #
218
+ # The calling codes a code may be texted to, comma-separated (default "1").
219
+ # Read by BOTH apps: apps/web refuses any other number before a code exists,
220
+ # and the apps/api relay re-checks it — set the same value on both.
221
+ # Calling code 1 covers the whole North American Numbering Plan, Caribbean
222
+ # premium-rate destinations included: turn on Twilio's Geo Permissions (US and
223
+ # Canada only) and its SMS pumping protection for the sending account.
224
+ # AILK_SMS_COUNTRY_CODES=1
225
+ #
205
226
  # Request-and-confirm (#5970) — the callback request a site owner confirms by
206
227
  # an emailed link, which mints a Stripe Payment Link for the customer to pay
207
228
  # on. Off by default: with the flag unset the callback route behaves exactly as
@@ -21,6 +21,13 @@ FRONTEND_URL=http://localhost:3000
21
21
  # trust — list only origins the deployment owner operates.
22
22
  # AILK_TRUSTED_ORIGINS=https://admin.your-domain.com,https://spoke.example
23
23
 
24
+ # Google One Tap on a hub's spokes (#11096 D10), off by default: the hub's own
25
+ # Google OAuth client id. Set, POST /v1/hub-sign-in/google verifies a spoke's
26
+ # One Tap ID token against Google's keys with this as its audience, and client
27
+ # info names it to the spoke. List each One Tap spoke's origin on that Google
28
+ # client's authorized JavaScript origins. Unset: the route answers 404.
29
+ # AILK_GOOGLE_ONE_TAP_CLIENT_ID=
30
+
24
31
  # =============================================================================
25
32
  # MCP OAuth issuer (#10912)
26
33
  # =============================================================================