Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
fix(web): repair audit metadata and public page rendering
Gusc181157e0b4c
diff --git a/src/web/blog/README.md b/src/web/blog/README.mdindex bf0313826..8e8c51c4a 100644--- a/src/web/blog/README.md+++ b/src/web/blog/README.md@@ -65,7 +65,7 @@ From the repository root, run:pnpm --filter @alook/web build:blog```-This includes source validation, image preparation, Next compilation, and rendered article validation before Worker packaging. `build:blog:next` is the internal Next/standalone preparation step used by that command. `validate:blog` alone checks source files; it is not the full publishing gate.+This includes source validation, image preparation, Next compilation, and rendered article validation before Worker packaging. The final packaging step stages the prerendered cache into Workers Static Assets, so the read-only cache works with raw Wrangler deployment as well. `build:blog:next` is the internal Next/standalone preparation step used by that command. `validate:blog` alone checks source files; it is not the full publishing gate.Build errors include missing/invalid required metadata, invalid optional SEO title, duplicate H1 in Markdown, invalid/missing/oversized source images; then, in rendered articles: missing body/title/description, a missing or extra H1, incorrect canonical, noindex, duplicate heading IDs, conflicting/unparseable BlogPosting JSON-LD, missing local article/fragment/image resources, and inconsistent image or OG dimensions. Generated responsive resources must exist. Drafts must not become prerendered public articles. The full published article set must match topics and the discovery manifest (which supplies the main site sitemap). The main index and RSS contain only articles without the `guides` tag; `/guides` contains only articles with that tag. Their two index sets must partition the published articles. Footer navigation may link to the `/guides` directory, but must not link to individual guide articles. Keep exploring / Next Blog recommendations must not include the Guides directory or guide articles.diff --git a/src/web/blog/open-next.config.test.ts b/src/web/blog/open-next.config.test.tsindex 727782ec4..a0e5d40be 100644--- a/src/web/blog/open-next.config.test.ts+++ b/src/web/blog/open-next.config.test.ts@@ -1,19 +1,25 @@import { describe, expect, it } from "vitest";import config from "./open-next.config";+import staticAssetsIncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/static-assets-incremental-cache";describe("Blog OpenNext configuration", () => {- it("builds the nested app without mutable cache bindings", () => {+ it("builds the nested app without mutable cache bindings", async () => {expect(config.appPath).toBe("blog");expect(config.buildOutputPath).toBe("blog");expect(config.packageJsonPath).toBe("blog");expect(config.buildCommand).toBe("pnpm --dir .. build:blog:next");- expect(config.dangerous?.disableIncrementalCache).toBe(true);+ expect(config.dangerous?.disableIncrementalCache).not.toBe(true);+ expect(config.dangerous?.enableCacheInterception).toBe(true);expect(config.dangerous?.disableTagCache).toBe(true);expect(config.cloudflare?.dangerousDisableConfigValidation).not.toBe(true);- expect(config.default.override?.incrementalCache).toBe("dummy");+ const serverCache = config.default.override?.incrementalCache;+ if (typeof serverCache !== "function") throw new Error("Static cache loader is missing");+ expect(await serverCache()).toBe(staticAssetsIncrementalCache);expect(config.default.override?.tagCache).toBe("dummy");expect(config.default.override?.queue).toBe("direct");- expect(config.middleware?.override?.incrementalCache).toBe("dummy");+ const middlewareCache = config.middleware?.override?.incrementalCache;+ if (typeof middlewareCache !== "function") throw new Error("Static middleware cache loader is missing");+ expect(await middlewareCache()).toBe(staticAssetsIncrementalCache);expect(config.middleware?.override?.tagCache).toBe("dummy");expect(config.middleware?.override?.queue).toBe("direct");});diff --git a/src/web/blog/open-next.config.ts b/src/web/blog/open-next.config.tsindex 79621528f..f919b0613 100644--- a/src/web/blog/open-next.config.ts+++ b/src/web/blog/open-next.config.ts@@ -2,9 +2,11 @@ import {defineCloudflareConfig,type OpenNextConfig,} from "@opennextjs/cloudflare";+import staticAssetsIncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/static-assets-incremental-cache";const cloudflare = defineCloudflareConfig({- incrementalCache: "dummy",+ incrementalCache: staticAssetsIncrementalCache,+ enableCacheInterception: true,tagCache: "dummy",queue: "direct",});@@ -17,7 +19,6 @@ export default {buildCommand: "pnpm --dir .. build:blog:next",dangerous: {...cloudflare.dangerous,- disableIncrementalCache: true,disableTagCache: true,},} satisfies OpenNextConfig;diff --git a/src/web/blog/scripts/stage-cache-assets.test.ts b/src/web/blog/scripts/stage-cache-assets.test.tsnew file mode 100644index 000000000..81d8ce091--- /dev/null+++ b/src/web/blog/scripts/stage-cache-assets.test.ts@@ -0,0 +1,36 @@+import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";+import { join } from "node:path";+import { afterEach, describe, expect, it } from "vitest";+import { stageBlogCacheAssets } from "./stage-cache-assets";++const roots: string[] = [];+function fixture() {+ const root = mkdtempSync(join(tmpdir(), "blog-cache-"));+ roots.push(root);+ return root;+}+afterEach(() => {+ for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true });+});++describe("Blog static cache packaging", () => {+ it("copies generated entries byte-for-byte and removes old build entries", () => {+ const root = fixture();+ mkdirSync(join(root, "cache/new-build"), { recursive: true });+ writeFileSync(join(root, "cache/new-build/page.cache"), "cached document\0payload");+ mkdirSync(join(root, "assets/cdn-cgi/_next_cache/old-build"), { recursive: true });+ writeFileSync(join(root, "assets/keep.txt"), "public asset");+ stageBlogCacheAssets(root);+ expect(readFileSync(join(root, "assets/cdn-cgi/_next_cache/new-build/page.cache"), "utf8"))+ .toBe("cached document\0payload");+ expect(existsSync(join(root, "assets/cdn-cgi/_next_cache/old-build"))).toBe(false);+ expect(readFileSync(join(root, "assets/keep.txt"), "utf8")).toBe("public asset");+ });+ it("fails the build if generated cache is missing or empty", () => {+ const root = fixture();+ expect(() => stageBlogCacheAssets(root)).toThrow("no prerendered cache");+ mkdirSync(join(root, "cache"));+ expect(() => stageBlogCacheAssets(root)).toThrow("no prerendered cache");+ });+});diff --git a/src/web/blog/scripts/stage-cache-assets.ts b/src/web/blog/scripts/stage-cache-assets.tsnew file mode 100644index 000000000..df89061b9--- /dev/null+++ b/src/web/blog/scripts/stage-cache-assets.ts@@ -0,0 +1,19 @@+import { cpSync, existsSync, readdirSync, rmSync } from "node:fs";+import { dirname, resolve } from "node:path";+import { fileURLToPath } from "node:url";++export function stageBlogCacheAssets(outputDir: string): void {+ const source = resolve(outputDir, "cache");+ if (!existsSync(source) || readdirSync(source).length === 0) {+ throw new Error("Blog build has no prerendered cache to stage");+ }+ const destination = resolve(outputDir, "assets/cdn-cgi/_next_cache");+ rmSync(destination, { recursive: true, force: true });+ cpSync(source, destination, { recursive: true });+}++const scriptPath = fileURLToPath(import.meta.url);+if (process.argv[1] && resolve(process.argv[1]) === scriptPath) {+ stageBlogCacheAssets(resolve(dirname(scriptPath), "../.open-next"));+ console.log("Staged Blog prerendered cache for Workers Static Assets.");+}diff --git a/src/web/blog/src/content/ai-agent-identity.mdx b/src/web/blog/src/content/ai-agent-identity.mdxindex b419dc085..465c5d06a 100644--- a/src/web/blog/src/content/ai-agent-identity.mdx+++ b/src/web/blog/src/content/ai-agent-identity.mdx@@ -1,4 +1,5 @@export const metadata = {+ seoTitle: "AI Agent Identity Across Rooms and Teams",slug: "ai-agent-identity",title: "What is AI agent identity? Persistent agents across rooms and teams",date: "2026-08-17",diff --git a/src/web/blog/src/content/ai-team-vs-ai-tools.mdx b/src/web/blog/src/content/ai-team-vs-ai-tools.mdxindex ca9cbb5b2..48458bc34 100644--- a/src/web/blog/src/content/ai-team-vs-ai-tools.mdx+++ b/src/web/blog/src/content/ai-team-vs-ai-tools.mdx@@ -1,4 +1,5 @@export const metadata = {+ seoTitle: "AI Team vs AI Tools: Coordinate Your Coding Agents",slug: 'ai-team-vs-ai-tools',title: 'AI Team vs AI Tools: Stop Being the Human Copy-Paste Between Your Coding Agents',date: '2026-06-15',diff --git a/src/web/blog/src/content/no-code-automation-ai-agents.mdx b/src/web/blog/src/content/no-code-automation-ai-agents.mdxindex 50ed3c4b6..8c54f8a1d 100644--- a/src/web/blog/src/content/no-code-automation-ai-agents.mdx+++ b/src/web/blog/src/content/no-code-automation-ai-agents.mdx@@ -1,4 +1,5 @@export const metadata = {+ seoTitle: "No-Code Automation With AI Agents",slug: "no-code-automation-ai-agents",title: "No-Code Automation With AI Agents: Beyond Trigger-and-Action Workflows",date: "2026-07-14",diff --git a/src/web/discord/wrangler.toml b/src/web/discord/wrangler.tomlnew file mode 100644index 000000000..928441f23--- /dev/null+++ b/src/web/discord/wrangler.toml@@ -0,0 +1,20 @@+name = "alook-discord"+main = "../src/lib/discord-redirect.ts"+compatibility_date = "2026-05-13"++[[routes]]+pattern = "discord.alook.ai"+custom_domain = true++[observability]+enabled = true+head_sampling_rate = 1++[observability.logs]+enabled = true+invocation_logs = true+head_sampling_rate = 1++[observability.traces]+enabled = false+head_sampling_rate = 1diff --git a/src/web/package.json b/src/web/package.jsonindex 4b0367cca..f902f6745 100644--- a/src/web/package.json+++ b/src/web/package.json@@ -10,7 +10,7 @@"dev:zones:worker": "node scripts/dev-zones.mjs --worker","build": "next build && tsx scripts/stage-service-worker.ts","build:blog:next": "pnpm validate:blog && tsx blog/scripts/stage-shared-assets.ts && next build blog && tsx blog/scripts/validate-rendered.ts && tsx blog/scripts/prepare-open-next-standalone.ts",- "build:blog": "tsx blog/scripts/stage-shared-assets.ts && opennextjs-cloudflare build --config blog/wrangler.toml --openNextConfigPath blog/open-next.config.ts",+ "build:blog": "tsx blog/scripts/stage-shared-assets.ts && opennextjs-cloudflare build --config blog/wrangler.toml --openNextConfigPath blog/open-next.config.ts && tsx blog/scripts/stage-cache-assets.ts","build:auth": "wrangler deploy --dry-run --config auth/wrangler.toml --outdir dist","validate:blog": "tsx blog/scripts/validate-blog-assets.ts","verify:blog-dry-run": "tsx scripts/verify-blog-dry-run.ts",diff --git a/src/web/src/app/contact/page.tsx b/src/web/src/app/contact/page.tsxindex 710585a9c..9e0377d04 100644--- a/src/web/src/app/contact/page.tsx+++ b/src/web/src/app/contact/page.tsx@@ -1,4 +1,4 @@-import type { Metadata } from "next"+import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata"import Image from "next/image"import Link from "next/link"import { ArrowUpRight, CalendarDays, Mail } from "lucide-react"@@ -7,11 +7,11 @@ import { LandingFooter } from "@/components/home/landing-footer"import landing from "@/components/home/landing-page.module.css"import styles from "./contact.module.css"-export const metadata: Metadata = {- title: { absolute: "Contact — Alook" },- description: "Get in touch with Gus, book a conversation, or reach Alook Support.",- alternates: { canonical: "/contact" },-}+export const metadata = buildPublicPageMetadata({+ title: "Contact — Alook",+ description: "Contact Gus, the builder of Alook, by email or book a 15-minute conversation. Find the Alook Support community and Discord for questions and feedback.",+ path: "/contact",+})const contacts = [{ icon: Mail, label: "Email", text: "[email protected]", href: "mailto:[email protected]" },diff --git a/src/web/src/app/pricing/page.tsx b/src/web/src/app/pricing/page.tsxindex bed687007..34db4fd13 100644--- a/src/web/src/app/pricing/page.tsx+++ b/src/web/src/app/pricing/page.tsx@@ -1,5 +1,4 @@import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata"-import { Suspense } from "react"import PricingClient from "./pricing-client"export const metadata = buildPublicPageMetadata({@@ -10,5 +9,5 @@ export const metadata = buildPublicPageMetadata({});export default function PricingPage() {- return <Suspense fallback={<p role="status" className="p-8">Loading plans…</p>}><PricingClient /></Suspense>+ return <PricingClient />}diff --git a/src/web/src/app/pricing/pricing-client.dom.test.tsx b/src/web/src/app/pricing/pricing-client.dom.test.tsxindex 4303dd527..0f8f82ba4 100644--- a/src/web/src/app/pricing/pricing-client.dom.test.tsx+++ b/src/web/src/app/pricing/pricing-client.dom.test.tsx@@ -1,18 +1,20 @@import { afterEach, beforeEach, expect, it, vi } from "vitest"import { render, setupUser, waitFor } from "@/test/react-dom-harness"import PricingClient from "./pricing-client"+import { renderToString } from "react-dom/server"vi.mock("./pricing.module.css", () => ({ default: new Proxy({}, { get: (_target, key) => String(key) }) }))const state = vi.hoisted(() => ({session: { data: null as null | { user: { id: string } }, isPending: false, error: null },search: new URLSearchParams(),+ suspendSearch: false,assign: vi.fn(), api: vi.fn(), checkout: vi.fn(), portal: vi.fn(), refresh: vi.fn(),billing: {} as Record<string, unknown>,landing: vi.fn(), pricingView: vi.fn(), pricingCta: vi.fn(),}))vi.mock("@/lib/auth-client", () => { const sessionSDK = { useSession: () => state.session }; return { ...sessionSDK, currentSessionViewer: () => { const value = sessionSDK.useSession(); return !value || value.isPending || value.error ? undefined : value.data?.user.id ?? null } } })-vi.mock("next/navigation", () => ({ useSearchParams: () => state.search }))+vi.mock("next/navigation", () => ({ useSearchParams: () => { if (state.suspendSearch) throw new Promise(() => {}); return state.search } }))vi.mock("@/lib/api/client", () => ({ apiFetch: state.api }))vi.mock("@/hooks/community/use-billing", () => ({ useBilling: () => ({ ...state.billing, checkout: state.checkout, portal: state.portal, refresh: state.refresh }) }))vi.mock("@/lib/analytics", async (importOriginal) => {@@ -39,6 +41,7 @@ beforeEach(() => {}))vi.clearAllMocks()state.session = { data: null, isPending: false, error: null }+ state.suspendSearch = falsestate.search = new URLSearchParams()state.api.mockResolvedValue(catalog)state.billing = { data: undefined, isPending: false, isBusy: false, isError: false, actionError: null }@@ -191,3 +194,16 @@ it("shows machine allowances supplied by the catalog", async () => {expect(await ui.findByText((_text, el) => el?.tagName === "P" && el.textContent === "Up to 7 online machines")).toBeInTheDocument()expect(ui.getByText((_text, el) => el?.tagName === "P" && el.textContent === "Up to 1 online machine")).toBeInTheDocument()})+++it("renders the pricing document even while search parameters suspend", () => {+ state.suspendSearch = true+ const html = renderToString(<PricingClient />)+ const document = new DOMParser().parseFromString(html, "text/html")+ expect(document.querySelectorAll("h1")).toHaveLength(1)+ expect(document.querySelector("h1")?.textContent).toBe("Choose the right space for your bots.")+ expect(document.body.textContent).toContain("Does Alook include AI model or runtime costs?")+ expect(document.querySelectorAll("article")).toHaveLength(3)+ expect(document.querySelectorAll("button:disabled")).toHaveLength(3)+ expect(state.checkout).not.toHaveBeenCalled()+})diff --git a/src/web/src/app/pricing/pricing-client.tsx b/src/web/src/app/pricing/pricing-client.tsxindex 342b8a3d5..7f38a4149 100644--- a/src/web/src/app/pricing/pricing-client.tsx+++ b/src/web/src/app/pricing/pricing-client.tsx@@ -4,7 +4,7 @@import { useObservedRegion } from "@/lib/observability/regions"-import { useEffect, useRef, type RefObject } from "react"+import { Suspense, useEffect, useRef, type ReactNode, type RefObject } from "react"import { useSearchParams } from "next/navigation"import { useQuery } from "@tanstack/react-query"import { PublicPricingSchema, type PublicPricing, type BillingOffer } from "@alook/shared"@@ -17,13 +17,21 @@ import { FounderPlanChangeDialog } from "@/components/community/billing/founder-import { trackLandingCtaClicked, toAnalyticsCurrentPlan, toAnalyticsPlanId, trackPricingCtaClick, trackPricingView, type PricingCtaAction } from "@/lib/analytics"import { PricingView } from "./pricing-view"+function SelectedPlanMessage({ offer, fallback }: {+ offer: (plan: string) => BillingOffer | undefined+ fallback: string+}) {+ const search = useSearchParams()+ const selected = offer(search.get("plan") ?? "")+ return selected ? `${selected.plan.displayName} selected. Choose it below to continue.` : fallback+}+function PricingContent({ signedIn, sessionPending, sessionError, viewTrackedRef }: {signedIn: booleansessionPending: booleansessionError: booleanviewTrackedRef: RefObject<boolean>}) {- const search = useSearchParams()const catalog = useQuery({queryKey: ["public-pricing"],queryFn: async ({ signal }) => PublicPricingSchema.parse(await apiFetch<unknown>("/api/pricing", { signal })),@@ -38,7 +46,6 @@ function PricingContent({ signedIn, sessionPending, sessionError, viewTrackedRefconst setFounderOffer = (offer: BillingOffer | null) => setFounderOfferId(offer?.priceId ?? null)const paymentOffer = (plan: string) => summary?.offers.find((item) => item.plan.id === plan)const offer = (plan: string) => paymentOffer(plan) ?? catalog.data?.offers.find((item) => item.plan.id === plan)- const selected = offer(search.get("plan") ?? "")const busy = sessionPending || billing.isBusy || catalog.isPending || (signedIn && billing.isPending)useObservedRegion("billing", !busy && !catalog.isError && !sessionError, 1)const unavailable = sessionError || catalog.isError || (signedIn && billing.isError)@@ -90,10 +97,10 @@ function PricingContent({ signedIn, sessionPending, sessionError, viewTrackedRefif (summary?.isFounder) { setFounderOffer(item); return }void (summary?.subscription ? billing.portal(item.priceId) : billing.checkout(item.priceId, false, "pricing_page"))}+ const fallbackMessage = summary ? `Your current plan: ${summary.plan.displayName}.` : ""const message = summary?.isFounder? `Your Founder plan includes permanent ${summary.plan.displayName} access.`- : selected ? `${selected.plan.displayName} selected. Choose it below to continue.`- : summary ? `Your current plan: ${summary.plan.displayName}.` : ""+ : <Suspense fallback={fallbackMessage}><SelectedPlanMessage offer={offer} fallback={fallbackMessage} /></Suspense>const error = sessionError ? "Couldn't check your sign-in status. Reload this page to try again.": unavailable ? "Couldn't load plans. Try again before choosing a plan.": billing.actionError@@ -120,7 +127,7 @@ export type PricingController = {disabled: (plan: string) => booleanlabel: (plan: string) => stringchoose: (plan: string) => void- message: string+ message: ReactNodeerror: string | nullretry: () => void}diff --git a/src/web/src/app/privacy/page.tsx b/src/web/src/app/privacy/page.tsxindex e7f486e80..8329f4603 100644--- a/src/web/src/app/privacy/page.tsx+++ b/src/web/src/app/privacy/page.tsx@@ -1,25 +1,15 @@import { ObservedStaticContent } from "@/lib/observability/regions";-import type { Metadata } from "next"+import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata"import {PRIVACY_POLICY,PrivacyPolicyContent,} from "@/components/privacy/privacy-policy-content"-export const metadata: Metadata = {- title: PRIVACY_POLICY.title,- description: PRIVACY_POLICY.description,- alternates: { canonical: "https://alook.ai/privacy" },- openGraph: {- title: `${PRIVACY_POLICY.title} — Alook`,- description: PRIVACY_POLICY.description,- url: "https://alook.ai/privacy",- },- twitter: {- card: "summary",- title: `${PRIVACY_POLICY.title} — Alook`,- description: PRIVACY_POLICY.description,- },-}+export const metadata = buildPublicPageMetadata({+ title: `${PRIVACY_POLICY.title} — Alook`,+ description: "Read how Alook collects, uses, stores, and protects personal information, including account data, cookies, analytics choices, and your privacy rights.",+ path: "/privacy",+})export default function PrivacyPage() {return (diff --git a/src/web/src/app/templates/[id]/client.tsx b/src/web/src/app/templates/[id]/client.tsxindex 1443590dd..e6383e15e 100644--- a/src/web/src/app/templates/[id]/client.tsx+++ b/src/web/src/app/templates/[id]/client.tsx@@ -1,9 +1,7 @@"use client";-/* eslint-disable @next/next/no-html-link-for-pages -- Product entrances require a new document to unload public tracking. */-import Link from "next/link";-import { trackLandingCtaClicked } from "@/lib/analytics"+import { TemplateAccountLink } from "../_components/template-account-link"import { Check } from "lucide-react";import { PublicLayout } from "@/components/public-layout";@@ -19,10 +17,8 @@ const ROLE_LABELS: Record<string, string> = {export function TemplateDetailClient({template,- isLoggedIn,}: {template: TemplatePreset;- isLoggedIn: boolean;}) {return (<PublicLayout@@ -41,23 +37,7 @@ export function TemplateDetailClient({>Blog</a>- {isLoggedIn ? (- <a- href="/c/me"- onClick={() => trackLandingCtaClicked({ cta_name: "templates_open_app" })}- className="inline-flex items-center gap-2 px-4 py-2 text-xs uppercase tracking-widest font-mono border border-current transition-opacity hover:opacity-70"- >- App- </a>- ) : (- <a- href="/sign-in"- onClick={() => trackLandingCtaClicked({ cta_name: "templates_get_started" })}- className="inline-flex items-center gap-2 px-4 py-2 text-xs uppercase tracking-widest font-mono bg-foreground text-background transition-opacity hover:opacity-70"- >- Get Started- </a>- )}+ <TemplateAccountLink /></>}>diff --git a/src/web/src/app/templates/[id]/page.tsx b/src/web/src/app/templates/[id]/page.tsxindex d22e5bd78..e4c42fb16 100644--- a/src/web/src/app/templates/[id]/page.tsx+++ b/src/web/src/app/templates/[id]/page.tsx@@ -1,7 +1,6 @@import { ObservedStaticContent } from "@/lib/observability/regions";import type { Metadata } from "next";import { notFound } from "next/navigation";-import { getSession } from "@/lib/session";import { TEMPLATES, getTemplateById } from "@/lib/templates";import { TemplateDetailClient } from "./client";@@ -30,6 +29,7 @@ export async function generateMetadata({keywords: template.tags,alternates: { canonical: url },openGraph: {+ type: "website",title,description: template.description,url,@@ -51,17 +51,15 @@ export default async function TemplateDetailPage({const template = getTemplateById(id);if (!template) notFound();- const session = await getSession();-const jsonLd = [{"@context": "https://schema.org",- "@type": "SoftwareApplication",+ "@type": "CreativeWork",+ url: `${SITE_URL}/templates/${id}`,name: template.name,description: template.longDescription,- applicationCategory: "BusinessApplication",- operatingSystem: "All",- offers: { "@type": "Offer", price: "0", priceCurrency: "USD" },+ genre: "AI agent team template",+ inLanguage: "en",keywords: template.tags.join(", "),},{@@ -83,7 +81,6 @@ export default async function TemplateDetailPage({/><TemplateDetailClienttemplate={template}- isLoggedIn={!!session}/></></>);diff --git a/src/web/src/app/templates/_components/template-account-link.dom.test.tsx b/src/web/src/app/templates/_components/template-account-link.dom.test.tsxnew file mode 100644index 000000000..f961dc0e2--- /dev/null+++ b/src/web/src/app/templates/_components/template-account-link.dom.test.tsx@@ -0,0 +1,28 @@+import { beforeEach, expect, it, vi } from "vitest"+import { render, setupUser } from "@/test/react-dom-harness"+import { TemplateAccountLink } from "./template-account-link"++const state = vi.hoisted(() => ({ session: { data: null as null | { user: { id: string } }, isPending: false }, track: vi.fn() }))+vi.mock("@/lib/auth-client", () => ({ useSession: () => state.session }))+vi.mock("@/lib/analytics", () => ({ trackLandingCtaClicked: state.track }))++beforeEach(() => { state.session = { data: null, isPending: false }; vi.clearAllMocks() })++it.each([false, true])("keeps the public entry available while pending=%s", async isPending => {+ state.session.isPending = isPending+ const view = render(<TemplateAccountLink />)+ const link = view.getByRole("link", { name: "Get Started" })+ expect(link).toHaveAttribute("href", "/sign-in")+ await setupUser().click(link)+ expect(state.track).toHaveBeenCalledWith({ cta_name: "templates_get_started" })+})++it("updates to the account entry after the session resolves", async () => {+ const view = render(<TemplateAccountLink />)+ state.session = { data: { user: { id: "viewer" } }, isPending: false }+ view.rerender(<TemplateAccountLink />)+ const link = view.getByRole("link", { name: "App" })+ expect(link).toHaveAttribute("href", "/c/me")+ await setupUser().click(link)+ expect(state.track).toHaveBeenCalledWith({ cta_name: "templates_open_app" })+})diff --git a/src/web/src/app/templates/_components/template-account-link.tsx b/src/web/src/app/templates/_components/template-account-link.tsxnew file mode 100644index 000000000..9fee441bd--- /dev/null+++ b/src/web/src/app/templates/_components/template-account-link.tsx@@ -0,0 +1,18 @@+"use client"++import { useSession } from "@/lib/auth-client"+import { trackLandingCtaClicked } from "@/lib/analytics"++export function TemplateAccountLink() {+ const session = useSession()+ const signedIn = Boolean(session.data?.user)+ return <a+ href={signedIn ? "/c/me" : "/sign-in"}+ onClick={() => trackLandingCtaClicked({ cta_name: signedIn ? "templates_open_app" : "templates_get_started" })}+ className={signedIn+ ? "inline-flex items-center gap-2 px-4 py-2 text-xs uppercase tracking-widest font-mono border border-current transition-opacity hover:opacity-70"+ : "inline-flex items-center gap-2 px-4 py-2 text-xs uppercase tracking-widest font-mono bg-foreground text-background transition-opacity hover:opacity-70"}+ >+ {signedIn ? "App" : "Get Started"}+ </a>+}diff --git a/src/web/src/app/templates/client.dom.test.ts b/src/web/src/app/templates/client.dom.test.tsindex 02f06f93a..f94463f0c 100644--- a/src/web/src/app/templates/client.dom.test.ts+++ b/src/web/src/app/templates/client.dom.test.ts@@ -27,7 +27,6 @@ describe("TemplatesClient heading outline", () => {const rendered = render(createElement(TemplatesClient, {templates: [devopsMonitor],categories: ["Developer"],- isLoggedIn: false,}))const levels = Array.from(diff --git a/src/web/src/app/templates/client.tsx b/src/web/src/app/templates/client.tsxindex b8ed6ea1d..0edd1ee8e 100644--- a/src/web/src/app/templates/client.tsx+++ b/src/web/src/app/templates/client.tsx@@ -1,8 +1,6 @@"use client";-/* eslint-disable @next/next/no-html-link-for-pages -- Product entrances require a new document to unload public tracking. */--import { trackLandingCtaClicked } from "@/lib/analytics"+import { TemplateAccountLink } from "./_components/template-account-link"import { useAtom, useCreateAtom } from "@tanstack/react-store";import { useEffect, useRef } from "react";@@ -15,11 +13,9 @@ import { trackTemplatesBrowsed } from "@/lib/analytics";export function TemplatesClient({templates,categories,- isLoggedIn,}: {templates: TemplatePreset[];categories: TemplateCategory[];- isLoggedIn: boolean;}) {const [activeCategory, setActiveCategory] = useAtom(useCreateAtom<"All" | TemplateCategory>("All"));const tracked = useRef(false);@@ -58,23 +54,7 @@ export function TemplatesClient({>Blog</a>- {isLoggedIn ? (- <a- href="/c/me"- onClick={() => trackLandingCtaClicked({ cta_name: "templates_open_app" })}- className="inline-flex items-center gap-2 px-4 py-2 text-xs uppercase tracking-widest font-mono border border-current transition-opacity hover:opacity-70"- >- App- </a>- ) : (- <a- href="/sign-in"- onClick={() => trackLandingCtaClicked({ cta_name: "templates_get_started" })}- className="inline-flex items-center gap-2 px-4 py-2 text-xs uppercase tracking-widest font-mono bg-foreground text-background transition-opacity hover:opacity-70"- >- Get Started- </a>- )}+ <TemplateAccountLink /></>}>diff --git a/src/web/src/app/templates/page.tsx b/src/web/src/app/templates/page.tsxindex 3c4c298d6..7eb5b0f3f 100644--- a/src/web/src/app/templates/page.tsx+++ b/src/web/src/app/templates/page.tsx@@ -1,6 +1,5 @@import { ObservedStaticContent } from "@/lib/observability/regions";import type { Metadata } from "next";-import { getSession } from "@/lib/session";import { TEMPLATES, TEMPLATE_CATEGORIES } from "@/lib/templates";import { TemplatesClient } from "./client";@@ -12,6 +11,7 @@ export const metadata: Metadata = {description,alternates: { canonical: "https://alook.ai/templates" },openGraph: {+ type: "website",title: "AI Company Templates — Alook",description,url: "https://alook.ai/templates",@@ -39,7 +39,6 @@ const itemListJsonLd = {};export default async function TemplatesPage() {- const session = await getSession();return (<><ObservedStaticContent /><><script@@ -49,7 +48,6 @@ export default async function TemplatesPage() {<TemplatesClienttemplates={TEMPLATES}categories={TEMPLATE_CATEGORIES}- isLoggedIn={!!session}/></></>);diff --git a/src/web/src/app/templates/retirement.dom.test.tsx b/src/web/src/app/templates/retirement.dom.test.tsxindex 3da97100a..308c7d5a6 100644--- a/src/web/src/app/templates/retirement.dom.test.tsx+++ b/src/web/src/app/templates/retirement.dom.test.tsx@@ -4,6 +4,8 @@ import { TEMPLATES } from "@/lib/templates"import { TemplateCard } from "./_components/template-card"import { TemplateDetailClient } from "./[id]/client"+vi.mock("./_components/template-account-link", () => ({ TemplateAccountLink: () => <a href="/sign-in">Get Started</a> }))+vi.mock("@/components/public-layout", () => ({ PublicLayout: ({ children, rightSlot }: { children: React.ReactNode; rightSlot: React.ReactNode }) => <main>{rightSlot}{children}</main> }))vi.mock("next/link", () => ({ default: ({ children, href, ...props }: React.ComponentProps<"a">) => <a href={href} {...props}>{children}</a> }))@@ -14,9 +16,9 @@ it("keeps public template content and canonical detail navigation", () => {expect(view.getByRole("link")).toHaveAttribute("href", `/templates/${template.id}`)expect(view.queryByRole("button", { name: "Use" })).toBeNull()})-it.each([true, false])("retains readable details and public entry links for logged-in=%s without a Studio CTA", isLoggedIn => {+it("retains readable details and public entry links without a Studio CTA", () => {const template = TEMPLATES[0]!- const view = render(<TemplateDetailClient template={template} isLoggedIn={isLoggedIn} />)+ const view = render(<TemplateDetailClient template={template} />)expect(view.getByRole("heading", { name: template.name })).toBeVisible()expect(view.getByText(template.longDescription)).toBeVisible()expect(view.getAllByRole("link").map(link => link.getAttribute("href"))).not.toEqual(expect.arrayContaining([expect.stringContaining("/studio/new")]))diff --git a/src/web/src/components/privacy/privacy-policy-content.test.ts b/src/web/src/components/privacy/privacy-policy-content.test.tsindex 61f50f9b3..d057129c8 100644--- a/src/web/src/components/privacy/privacy-policy-content.test.ts+++ b/src/web/src/components/privacy/privacy-policy-content.test.ts@@ -1,7 +1,10 @@import { readFileSync } from "node:fs"import { createElement } from "react"import { renderToStaticMarkup } from "react-dom/server"-import { describe, expect, it } from "vitest"+import { describe, expect, it, vi } from "vitest"+import { metadata } from "@/app/privacy/page"++vi.mock("@/lib/observability/regions", () => ({ ObservedStaticContent: () => null }))import {PRIVACY_POLICY,PrivacyPolicyContent,@@ -51,6 +54,11 @@ describe("shared Privacy policy", () => {expect(source).not.toContain("iframe")}expect(publicPage).toContain("PRIVACY_POLICY.title")- expect(publicPage).toContain("openGraph")+ expect(metadata.openGraph).toMatchObject({+ type: "website",+ url: "https://alook.ai/privacy",+ title: `${PRIVACY_POLICY.title} — Alook`,+ images: expect.any(Array),+ })})})diff --git a/src/web/src/lib/discord-redirect.test.ts b/src/web/src/lib/discord-redirect.test.tsnew file mode 100644index 000000000..c4366bd89--- /dev/null+++ b/src/web/src/lib/discord-redirect.test.ts@@ -0,0 +1,10 @@+import { expect, it } from "vitest"+import worker from "./discord-redirect"++it("redirects to the existing Discord community without requiring JavaScript", async () => {+ const response = worker.fetch()+ expect(response.status).toBe(302)+ expect(response.headers.get("Location")).toBe("https://discord.gg/24PHyEHU3M")+ expect(response.headers.get("Cache-Control")).toBe("no-store")+ expect(await response.text()).toBe("")+})diff --git a/src/web/src/lib/discord-redirect.ts b/src/web/src/lib/discord-redirect.tsnew file mode 100644index 000000000..1ad8d646c--- /dev/null+++ b/src/web/src/lib/discord-redirect.ts@@ -0,0 +1,15 @@+const DISCORD_INVITE_URL = "https://discord.gg/24PHyEHU3M"++const discordRedirect = {+ fetch(): Response {+ return new Response(null, {+ status: 302,+ headers: {+ Location: DISCORD_INVITE_URL,+ "Cache-Control": "no-store",+ },+ })+ },+}++export default discordRedirectdiff --git a/src/web/src/lib/seo/audit-warnings.test.ts b/src/web/src/lib/seo/audit-warnings.test.tsnew file mode 100644index 000000000..babbf6b92--- /dev/null+++ b/src/web/src/lib/seo/audit-warnings.test.ts@@ -0,0 +1,50 @@+import { describe, expect, it, vi } from "vitest"+import { TEMPLATES } from "@/lib/templates"++vi.mock("@/lib/session", () => ({ getSession: () => { throw new Error("Public documents must not wait for an account session") } }))+vi.mock("@/lib/observability/regions", () => ({ ObservedStaticContent: () => null }))+vi.mock("@/app/templates/client", () => ({ TemplatesClient: () => null }))+vi.mock("@/app/templates/[id]/client", () => ({ TemplateDetailClient: () => null }))+vi.mock("@/components/privacy/privacy-policy-content", () => ({ PRIVACY_POLICY: { title: "Privacy Policy" }, PrivacyPolicyContent: () => null }))++import { metadata as contact } from "@/app/contact/page"+import { metadata as privacy } from "@/app/privacy/page"+import TemplatesPage, { metadata as templates } from "@/app/templates/page"+import TemplatePage, { generateMetadata, generateStaticParams } from "@/app/templates/[id]/page"++const SITE = "https://alook.ai"++describe("audit warning repairs", () => {+ it.each([[contact, "/contact"], [privacy, "/privacy"]] as const)("aligns a public page's complete sharing data with its canonical", (metadata, path) => {+ expect(metadata.alternates?.canonical).toBe(SITE + path)+ expect(metadata.openGraph).toMatchObject({ type: "website", url: SITE + path, description: metadata.description, images: expect.any(Array) })+ expect(metadata.twitter).toMatchObject({ card: "summary_large_image", description: metadata.description, images: expect.any(Array) })+ expect(metadata.description!.length).toBeGreaterThanOrEqual(100)+ })++ it("declares the template directory's OG type", () => {+ expect(templates.openGraph).toMatchObject({ type: "website", url: SITE + "/templates" })+ })++ it("renders public templates without reading a server account session", async () => {+ expect(await TemplatesPage()).toBeTruthy()+ expect(generateStaticParams()).toEqual(TEMPLATES.map(t => ({ id: t.id })))+ for (const template of TEMPLATES) {+ const params = Promise.resolve({ id: template.id })+ const metadata = await generateMetadata({ params })+ expect(metadata.openGraph).toMatchObject({ type: "website", url: `${SITE}/templates/${template.id}` })+ expect(metadata.description!.length).toBeGreaterThanOrEqual(100)+ const page = await TemplatePage({ params })+ const json = JSON.parse(page.props.children[1].props.children[0].props.dangerouslySetInnerHTML.__html)+ expect(json[0]).toMatchObject({ "@type": "CreativeWork", url: `${SITE}/templates/${template.id}`, description: template.longDescription })+ expect(json[0]).not.toHaveProperty("offers")+ expect(json[1]["@type"]).toBe("BreadcrumbList")+ }+ })++ it("preserves not-found handling for unknown templates", async () => {+ const params = Promise.resolve({ id: "missing-template" })+ expect(await generateMetadata({ params })).toEqual({ title: "Not Found" })+ await expect(TemplatePage({ params })).rejects.toThrow()+ })+})diff --git a/src/web/src/lib/templates/presets/daily-newsletter-operator.ts b/src/web/src/lib/templates/presets/daily-newsletter-operator.tsindex 20b351f91..2003923ab 100644--- a/src/web/src/lib/templates/presets/daily-newsletter-operator.ts+++ b/src/web/src/lib/templates/presets/daily-newsletter-operator.ts@@ -5,7 +5,7 @@ export const dailyNewsletterOperator: TemplatePreset = {name: "Daily Newsletter Operator",category: "Content Creator",icon: "📰",- description: "Curate trending topics, write newsletter issues, and send daily emails to your subscribers.",+ description: "Use the Alook Daily Newsletter Operator template to research topics, curate stories, draft issues, and prepare daily emails for your subscribers.",longDescription:"Run a daily newsletter on autopilot. Your researcher scans sources for trending topics and curates the best stories, your assistant formats and prepares the email, and your leader shapes the editorial voice and coordinates the daily publishing cycle. From topic selection to subscriber delivery — all handled by your AI team.",tags: ["newsletter", "email", "content", "curation"],diff --git a/src/web/src/lib/templates/presets/devops-monitor.ts b/src/web/src/lib/templates/presets/devops-monitor.tsindex ac5ac30bd..570fac1b2 100644--- a/src/web/src/lib/templates/presets/devops-monitor.ts+++ b/src/web/src/lib/templates/presets/devops-monitor.ts@@ -5,7 +5,7 @@ export const devopsMonitor: TemplatePreset = {name: "DevOps Monitor",category: "Developer",icon: "📡",- description: "Monitor services, handle alert emails, coordinate incident response, and automate deployments.",+ description: "Use the Alook DevOps Monitor template to triage service alerts, investigate incidents, run diagnostics, and coordinate fixes with your AI team.",longDescription:"Keep your infrastructure healthy around the clock. Your leader processes incoming alert emails and decides how to respond, while your engineer investigates issues, runs diagnostics, and executes fixes. Together they handle the on-call burden — triaging alerts, investigating incidents, and coordinating deployments so you can sleep.",tags: ["DevOps", "monitoring", "incidents", "deployment"],diff --git a/src/web/src/lib/templates/presets/executive-assistant.ts b/src/web/src/lib/templates/presets/executive-assistant.tsindex 9f606c482..266d3880b 100644--- a/src/web/src/lib/templates/presets/executive-assistant.ts+++ b/src/web/src/lib/templates/presets/executive-assistant.ts@@ -5,7 +5,7 @@ export const executiveAssistant: TemplatePreset = {name: "Executive Assistant",category: "Knowledge Worker",icon: "💼",- description: "Filter and prioritize emails, manage calendar reminders, and prepare meeting briefs.",+ description: "Use the Alook Executive Assistant template to prioritize email, draft replies, track follow-ups, manage calendar reminders, and prepare meeting briefs.",longDescription:"Reclaim your time with an AI executive assistant team. Your leader triages incoming emails by priority and urgency, while your assistant handles responses, sets calendar reminders, and prepares briefing documents before meetings. Think of it as a chief of staff that keeps your information flow organized and your schedule on track.",tags: ["email", "calendar", "meetings", "productivity"],diff --git a/src/web/src/lib/templates/presets/open-source-maintainer.ts b/src/web/src/lib/templates/presets/open-source-maintainer.tsindex be048fe21..12d3e6654 100644--- a/src/web/src/lib/templates/presets/open-source-maintainer.ts+++ b/src/web/src/lib/templates/presets/open-source-maintainer.ts@@ -5,7 +5,7 @@ export const openSourceMaintainer: TemplatePreset = {name: "Open Source Maintainer",category: "Developer",icon: "🛠",- description: "Triage issues, review PRs, write changelogs, and manage releases for your open source projects.",+ description: "Use the Alook Open Source Maintainer template to triage issues, review pull requests, investigate bugs, write changelogs, and coordinate releases.",longDescription:"Run your open source project like a well-oiled machine. Your leader coordinates incoming issues and PRs, your engineer reviews code and verifies implementations, and your researcher investigates bugs and gathers context from docs and discussions. Together they triage, review, document, and ship — so you can focus on architecture decisions.",tags: ["GitHub", "open source", "code review", "releases"],diff --git a/src/web/src/lib/templates/presets/research-analyst.ts b/src/web/src/lib/templates/presets/research-analyst.tsindex b861b5069..25a34c538 100644--- a/src/web/src/lib/templates/presets/research-analyst.ts+++ b/src/web/src/lib/templates/presets/research-analyst.ts@@ -5,7 +5,7 @@ export const researchAnalyst: TemplatePreset = {name: "Research Analyst",category: "Knowledge Worker",icon: "🔬",- description: "Monitor competitors, analyze industry trends, and deliver weekly research digests via email.",+ description: "Use the Alook Research Analyst template to monitor competitors, investigate industry trends, and turn findings into weekly research digests by email.",longDescription:"Stay ahead of your market with an AI research team. Your researcher continuously monitors competitors, tracks industry trends, and gathers intelligence from public sources. Your leader synthesizes findings into actionable insights and delivers structured reports via email. From daily monitoring to weekly deep-dives — systematic intelligence gathering on autopilot.",tags: ["research", "competitive intelligence", "analysis", "reports"],diff --git a/src/web/src/lib/templates/presets/social-media-manager.ts b/src/web/src/lib/templates/presets/social-media-manager.tsindex b9b3102d7..30efcae3c 100644--- a/src/web/src/lib/templates/presets/social-media-manager.ts+++ b/src/web/src/lib/templates/presets/social-media-manager.ts@@ -5,7 +5,7 @@ export const socialMediaManager: TemplatePreset = {name: "Social Media Manager",category: "Content Creator",icon: "📱",- description: "Write posts, track trends, schedule publishing reminders, and maintain your social presence.",+ description: "Use the Alook Social Media Manager template to plan content, write posts, track trends, and schedule publishing reminders for your social channels.",longDescription:"Keep your social media presence active and engaging without spending hours on it. Your leader develops content strategy and shapes your voice, while your assistant writes posts, tracks trending topics, and sets up calendar reminders for optimal publishing times. Consistent social presence — handled by your AI team.",tags: ["social media", "Twitter", "LinkedIn", "content"],