import { connection } from "next/server"; import type { Metadata } from "next"; import localFont from "next/font/local"; import { NuqsAdapter } from "nuqs/adapters/next/app"; import { RegisterServiceWorker } from "@/components/shell/RegisterServiceWorker"; import { authMode, clerkPublishableKey } from "@/lib/auth/mode"; /** Wraps the tree in Clerk's provider only when the deployment uses * Clerk; the air-gapped/local build never loads the SDK. The AUTH_MODE * switch is a runtime env var (same image, per-deployment toggle), so we * call connection() to opt this out of build-time prerendering — otherwise * next build bakes in the build host's mode and the toggle never flips * (see docs/clerk.md). */ async function IdentityProvider({ children }: { children: React.ReactNode }) { await connection(); if (authMode() !== "clerk") { return <>{children}; } const { ClerkProvider } = await import("@clerk/nextjs"); return ( {children} ); } import "./globals.css"; // Vendored variable fonts (src/fonts) — zero external requests, so the same // build serves air-gapped installs. const geist = localFont({ src: "../fonts/Geist-Variable.woff2", variable: "--font-geist", display: "swap", }); const geistMono = localFont({ src: "../fonts/GeistMono-Variable.woff2", variable: "--font-geist-mono", display: "swap", }); export const metadata: Metadata = { title: "Clawmates", description: "Deploy agents at any scale — a single agent to a whole org.", }; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { return ( {/* No `antialiased` (-webkit-font-smoothing: antialiased) — it inherits everywhere and renders text thinner/lighter than the reference. The browser default (`auto`) gives the crisper/heavier weight WorkClaw uses. */} {children} ); }