From a0d9f4ab1e734f3271d06aeaad137b2d8684af1d Mon Sep 17 00:00:00 2001 From: Khaliq Date: Tue, 23 Jun 2026 22:39:54 +0200 Subject: [PATCH 1/2] docs: add standalone Relayfile and Relayloop documentation sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add two self-contained documentation sections alongside the Agent Relay docs, each with its own sidebar, multi-group nav, scoped search, and markdown mirrors: - /docs/file → Relayfile (17 pages) - /docs/loop → Relayloop (13 pages) Infrastructure: - lib/product-docs-nav.ts: pure, client-safe section + nav definitions - lib/product-docs.ts: server-only content loaders, markdown mirrors, per-section search index - DocsNav renders a distinct product sidebar (header, tagline, back-link, own nav groups/icons) when under a product path - DocsSearch scopes to the active product's index and routes within it - routes under app/docs/{file,loop}/* (index redirect, [slug] page via a shared ProductDocPage, markdown/[slug] endpoint) - extracted the shared MDX component map to components/docs/mdx-components Content is grounded in the relayfile/relayfile-cloud and relayhistory/relayhistory-cloud repos. Co-Authored-By: Claude Opus 4.8 --- web/app/docs/[slug]/page.tsx | 46 +---- web/app/docs/file/[slug]/page.tsx | 43 +++++ web/app/docs/file/markdown/[slug]/route.ts | 30 ++++ web/app/docs/file/page.tsx | 5 + web/app/docs/layout.tsx | 9 +- web/app/docs/loop/[slug]/page.tsx | 43 +++++ web/app/docs/loop/markdown/[slug]/route.ts | 30 ++++ web/app/docs/loop/page.tsx | 5 + web/components/docs/DocsNav.tsx | 77 +++++++- web/components/docs/DocsSearch.tsx | 29 ++- web/components/docs/ProductDocPage.tsx | 58 ++++++ web/components/docs/docs.module.css | 53 ++++++ web/components/docs/mdx-components.tsx | 45 +++++ web/content/docs/file/acls.mdx | 58 ++++++ .../docs/file/adapters-and-providers.mdx | 81 +++++++++ web/content/docs/file/agents.mdx | 103 +++++++++++ web/content/docs/file/api-reference.mdx | 167 ++++++++++++++++++ web/content/docs/file/cli.mdx | 163 +++++++++++++++++ web/content/docs/file/cloud.mdx | 69 ++++++++ web/content/docs/file/comparison.mdx | 53 ++++++ web/content/docs/file/introduction.mdx | 64 +++++++ web/content/docs/file/local-development.mdx | 84 +++++++++ web/content/docs/file/mount-layout.mdx | 85 +++++++++ web/content/docs/file/mounting.mdx | 113 ++++++++++++ web/content/docs/file/quickstart.mdx | 111 ++++++++++++ web/content/docs/file/reads-and-writes.mdx | 89 ++++++++++ web/content/docs/file/realtime-sync.mdx | 68 +++++++ web/content/docs/file/run-locally.mdx | 97 ++++++++++ web/content/docs/file/sdk.mdx | 135 ++++++++++++++ web/content/docs/file/why-files.mdx | 53 ++++++ web/content/docs/loop/cli.mdx | 149 ++++++++++++++++ web/content/docs/loop/cloud-architecture.mdx | 61 +++++++ web/content/docs/loop/cloud.mdx | 80 +++++++++ web/content/docs/loop/install.mdx | 93 ++++++++++ web/content/docs/loop/introduction.mdx | 60 +++++++ web/content/docs/loop/privacy.mdx | 75 ++++++++ web/content/docs/loop/quickstart.mdx | 86 +++++++++ web/content/docs/loop/search.mdx | 69 ++++++++ web/content/docs/loop/sessions.mdx | 63 +++++++ web/content/docs/loop/sources.mdx | 69 ++++++++ web/content/docs/loop/stats.mdx | 67 +++++++ web/content/docs/loop/sync.mdx | 69 ++++++++ web/content/docs/loop/teams.mdx | 62 +++++++ web/lib/docs-markdown.ts | 2 +- web/lib/product-docs-nav.ts | 150 ++++++++++++++++ web/lib/product-docs.ts | 92 ++++++++++ 46 files changed, 3255 insertions(+), 58 deletions(-) create mode 100644 web/app/docs/file/[slug]/page.tsx create mode 100644 web/app/docs/file/markdown/[slug]/route.ts create mode 100644 web/app/docs/file/page.tsx create mode 100644 web/app/docs/loop/[slug]/page.tsx create mode 100644 web/app/docs/loop/markdown/[slug]/route.ts create mode 100644 web/app/docs/loop/page.tsx create mode 100644 web/components/docs/ProductDocPage.tsx create mode 100644 web/components/docs/mdx-components.tsx create mode 100644 web/content/docs/file/acls.mdx create mode 100644 web/content/docs/file/adapters-and-providers.mdx create mode 100644 web/content/docs/file/agents.mdx create mode 100644 web/content/docs/file/api-reference.mdx create mode 100644 web/content/docs/file/cli.mdx create mode 100644 web/content/docs/file/cloud.mdx create mode 100644 web/content/docs/file/comparison.mdx create mode 100644 web/content/docs/file/introduction.mdx create mode 100644 web/content/docs/file/local-development.mdx create mode 100644 web/content/docs/file/mount-layout.mdx create mode 100644 web/content/docs/file/mounting.mdx create mode 100644 web/content/docs/file/quickstart.mdx create mode 100644 web/content/docs/file/reads-and-writes.mdx create mode 100644 web/content/docs/file/realtime-sync.mdx create mode 100644 web/content/docs/file/run-locally.mdx create mode 100644 web/content/docs/file/sdk.mdx create mode 100644 web/content/docs/file/why-files.mdx create mode 100644 web/content/docs/loop/cli.mdx create mode 100644 web/content/docs/loop/cloud-architecture.mdx create mode 100644 web/content/docs/loop/cloud.mdx create mode 100644 web/content/docs/loop/install.mdx create mode 100644 web/content/docs/loop/introduction.mdx create mode 100644 web/content/docs/loop/privacy.mdx create mode 100644 web/content/docs/loop/quickstart.mdx create mode 100644 web/content/docs/loop/search.mdx create mode 100644 web/content/docs/loop/sessions.mdx create mode 100644 web/content/docs/loop/sources.mdx create mode 100644 web/content/docs/loop/stats.mdx create mode 100644 web/content/docs/loop/sync.mdx create mode 100644 web/content/docs/loop/teams.mdx create mode 100644 web/lib/product-docs-nav.ts create mode 100644 web/lib/product-docs.ts diff --git a/web/app/docs/[slug]/page.tsx b/web/app/docs/[slug]/page.tsx index a5ee7fc4..44f2046f 100644 --- a/web/app/docs/[slug]/page.tsx +++ b/web/app/docs/[slug]/page.tsx @@ -1,20 +1,12 @@ import type { Metadata } from 'next'; -import type React from 'react'; import { notFound, redirect } from 'next/navigation'; import { evaluate } from '@mdx-js/mdx'; import { Fragment } from 'react'; import { jsx, jsxs } from 'react/jsx-runtime'; import remarkGfm from 'remark-gfm'; -import { Card } from '../../../components/docs/Card'; -import { CardGroup } from '../../../components/docs/CardGroup'; -import { BannerLink } from '../../../components/docs/BannerLink'; -import { CodeGroup } from '../../../components/docs/CodeGroup'; import { DocsPageActions } from '../../../components/docs/DocsPageActions'; -import { HighlightedPre } from '../../../components/docs/HighlightedCode'; -import { LegacySpawnOptionsTable } from '../../../components/docs/LegacySpawnOptionsTable'; -import { Note } from '../../../components/docs/Note'; -import { Warning } from '../../../components/docs/Warning'; +import { mdxComponents } from '../../../components/docs/mdx-components'; import { TableOfContents } from '../../../components/docs/TableOfContents'; import styles from '../../../components/docs/docs.module.css'; import { getDoc } from '../../../lib/docs'; @@ -24,40 +16,6 @@ import { getDefaultDocsVersionForSlug } from '../../../lib/docs-versions'; import { ogImage } from '../../../lib/og-meta'; import { absoluteUrl } from '../../../lib/site'; -function slugify(text: string): string { - return text - .toLowerCase() - .replace(/`([^`]+)`/g, '$1') - .replace(/[^a-z0-9]+/g, '-') - .replace(/^-|-$/g, ''); -} - -function HeadingWithId(level: 2 | 3) { - return function Heading({ children, ...props }: React.HTMLAttributes) { - const text = typeof children === 'string' ? children : String(children); - const id = slugify(text); - const Tag = `h${level}` as const; - return ( - - {children} - - ); - }; -} - -const components = { - CodeGroup, - Card, - CardGroup, - BannerLink, - Note, - Warning, - SpawnOptionsTable: LegacySpawnOptionsTable, - pre: HighlightedPre, - h2: HeadingWithId(2), - h3: HeadingWithId(3), -}; - type PageProps = { params: Promise<{ slug: string }>; }; @@ -152,7 +110,7 @@ export default async function DocsPage({ params }: PageProps) {

{doc.frontmatter.description}

)}
- +