Skip to content

docs: add standalone Relayfile and Relayloop documentation sections - #5

Merged
khaliqgant merged 3 commits into
mainfrom
docs/relayfile-relayloop-sections
Jun 24, 2026
Merged

khaliqgant merged 3 commits into
mainfrom
docs/relayfile-relayloop-sections

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds two standalone documentation sections alongside the existing Agent Relay docs — each with its own sidebar, multi-group navigation, scoped search, and markdown mirrors. They are separate doc sites, not entries in the Agent Relay nav.

  • /docs/file → Relayfile (17 pages) — the event layer for AI agents
  • /docs/loop → Relayloop (13 pages) — the system of record for how a team works with AI agents

Infrastructure

  • lib/product-docs-nav.ts — pure, client-safe section + nav definitions (kept free of node:fs so the client sidebar can import it)
  • lib/product-docs.ts — server-only content loaders, markdown mirrors, and per-section search index
  • DocsNav renders a distinct product sidebar (product name, tagline, "← Agent Relay docs" back-link, own nav groups/icons) when under a product path; version selector hidden there
  • DocsSearch switches to the active product's index and routes results within that section
  • Routes under app/docs/{file,loop}/*: index redirect, [slug] page via a shared ProductDocPage, and a markdown/[slug] endpoint per page
  • Extracted the shared MDX component map to components/docs/mdx-components

Content

Grounded in the relayfile/relayfile-cloud and relayhistory/relayhistory-cloud repos:

  • Relayfile: introduction, quickstart, why-files, mount-layout, reads-and-writes, acls, realtime-sync, run-locally, local-development, mounting, sdk, agents, adapters-and-providers, comparison, cloud, api-reference, cli
  • Relayloop: introduction, install, quickstart, sync, search, sessions, sources, stats, cloud, cloud-architecture, privacy, teams, cli

Verification

  • npm run build green — all 17 + 13 pages prerendered as SSG, plus .md mirrors and index redirects
  • npx vitest run — 21/21 pass
  • No broken internal or cross-section links

Notes for review

  • Naming: uses Relayfile / Relayloop as product names (CLI commands kept real: relayfile, ai-hist). The relayhistory-cloud brand plan calls that product "Relay Trail" — easy to rename via the label in lib/product-docs-nav.ts + content if preferred.
  • Privacy page: per relayhistory-cloud/docs/encryption.md, E2E is the Enterprise/Private tier while the default Team tier is vendor-readable; loop/privacy.mdx describes both honestly rather than claiming blanket E2E. Worth confirming it matches current positioning.

🤖 Generated with Claude Code


Summary by cubic

Add two standalone docs sections for Relayfile (/docs/file, 19 pages) and Relayloop (/docs/loop, 13 pages), each with its own sidebar and scoped search. They live alongside the Agent Relay docs and include markdown mirrors.

  • New Features

    • Separate doc sites with their own sidebars (product name, tagline, back-link) and nav icons.
    • Scoped search that switches index per product and routes results within the active section.
    • Routes per product: index redirect, [slug] pages via a shared ProductDocPage, and markdown/[slug] endpoints.
    • Content updates: Relayfile intro rewritten; added Events and Self-hosting; Quickstart focuses on hosted path. Relayloop CLI docs corrected to the real ai-hist flow (login + push), cloud architecture updated (Workers + Neon/pgvector), Grok source added, and privacy clarified (default vendor-readable; E2E is Enterprise). All pages prerendered as SSG.
  • Refactors

    • Introduced lib/product-docs-nav.ts (client-safe section + nav) and lib/product-docs.ts (server loaders, markdown mirrors, per-section search index).
    • Extracted shared MDX component map to components/docs/mdx-components; added ProductDocPage.
    • Updated DocsNav and DocsSearch to support product sections; version selector hidden on product pages.
    • Updated docs layout to pass product search scopes; exported renderMarkdownBody for markdown mirrors.

Written for commit cd571f2. Summary will update on new commits.

Review in cubic

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 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 6 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f89b38a-18ef-45bc-846b-e737562e08e6

📥 Commits

Reviewing files that changed from the base of the PR and between d8afa6b and cd571f2.

📒 Files selected for processing (48)
  • web/app/docs/[slug]/page.tsx
  • web/app/docs/file/[slug]/page.tsx
  • web/app/docs/file/markdown/[slug]/route.ts
  • web/app/docs/file/page.tsx
  • web/app/docs/layout.tsx
  • web/app/docs/loop/[slug]/page.tsx
  • web/app/docs/loop/markdown/[slug]/route.ts
  • web/app/docs/loop/page.tsx
  • web/components/docs/DocsNav.tsx
  • web/components/docs/DocsSearch.tsx
  • web/components/docs/ProductDocPage.tsx
  • web/components/docs/docs.module.css
  • web/components/docs/mdx-components.tsx
  • web/content/docs/file/acls.mdx
  • web/content/docs/file/adapters-and-providers.mdx
  • web/content/docs/file/agents.mdx
  • web/content/docs/file/api-reference.mdx
  • web/content/docs/file/cli.mdx
  • web/content/docs/file/cloud.mdx
  • web/content/docs/file/comparison.mdx
  • web/content/docs/file/events.mdx
  • web/content/docs/file/introduction.mdx
  • web/content/docs/file/local-development.mdx
  • web/content/docs/file/mount-layout.mdx
  • web/content/docs/file/mounting.mdx
  • web/content/docs/file/quickstart.mdx
  • web/content/docs/file/reads-and-writes.mdx
  • web/content/docs/file/realtime-sync.mdx
  • web/content/docs/file/run-locally.mdx
  • web/content/docs/file/sdk.mdx
  • web/content/docs/file/self-hosting.mdx
  • web/content/docs/file/why-files.mdx
  • web/content/docs/loop/cli.mdx
  • web/content/docs/loop/cloud-architecture.mdx
  • web/content/docs/loop/cloud.mdx
  • web/content/docs/loop/install.mdx
  • web/content/docs/loop/introduction.mdx
  • web/content/docs/loop/privacy.mdx
  • web/content/docs/loop/quickstart.mdx
  • web/content/docs/loop/search.mdx
  • web/content/docs/loop/sessions.mdx
  • web/content/docs/loop/sources.mdx
  • web/content/docs/loop/stats.mdx
  • web/content/docs/loop/sync.mdx
  • web/content/docs/loop/teams.mdx
  • web/lib/docs-markdown.ts
  • web/lib/product-docs-nav.ts
  • web/lib/product-docs.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/relayfile-relayloop-sections

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployed!

Environment URL
Web https://a1f51b7a-agentrelay-web.agent-workforce.workers.dev

This is a Cloudflare Workers preview version of this PR's build.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0d9f4ab1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

</div>
</article>
<aside className={styles.tocSidebar}>
<TableOfContents items={doc.toc} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Suppress Agent Relay version controls on product docs

When rendering /docs/file/* or /docs/loop/* at desktop widths, this still uses TableOfContents, which always renders the Agent Relay DocsVersionSelect. That selector is wired to the main docs paths; for example, changing versions on /docs/file/quickstart treats file as the docs slug and navigates to /docs/7.1.1/introduction, so the standalone product docs still expose a broken version switch even though the product sidebar hides it. Use a product-specific TOC or add an option to omit the version/language controls here.

Useful? React with 👍 / 👎.


function HeadingWithId(level: 2 | 3) {
return function Heading({ children, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {
const text = typeof children === 'string' ? children : String(children);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive heading IDs from MDX text nodes

For headings that contain inline MDX nodes, such as the new ## \sync`sections inweb/content/docs/loop/cli.mdx, childrenis a React element/array rather than a plain string.String(children)becomes[object Object], so the rendered heading id becomes object-objectwhilegetDoc() generated TOC ids from the markdown text (sync`, etc.); the On this page links for those product CLI/API pages won't target their headings. Extract the text recursively before slugifying.

Useful? React with 👍 / 👎.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

PR #5 Review — docs/relayfile-relayloop-sections

Summary

This PR adds two standalone documentation sections (Relayfile under /docs/file/*, Relayloop under /docs/loop/*): new MDX content, route handlers, a shared ProductDocPage, a per-section search index, sidebar product header, and an extracted mdx-components map. The bulk is MDX prose; the code changes are additive and well-scoped.

I traced the diff across callers, types, tests, and routing. No semantic or safety-critical logic is touched (this PR is entirely docs/presentation). I made no code edits — there were no mechanical defects worth fixing, and everything that compiles/tests does so cleanly.

Verification

  • npm ci — installed (979 packages).
  • npm run test (vitest) — 21/21 passed. The existing markdown/llms tests don't exercise the new code; renderMarkdownBody only gained an export (no behavior change).
  • npx tsc --noEmit — passes (exit 0). This is the type-check portion of CI's cf:build/next build and is what would catch breakage from this diff.
  • next build (full webpack production build) — could not complete in this sandbox: the process is killed with code 137 by a sandbox process limit (host has 228Gi free, and --max-old-space-size does not help), with no type or compile error emitted before the kill. This is an environment constraint, not a code defect. CI runs this on a normal runner and should be unaffected.

Correctness checks traced

  • getProductDoc(sectionId, slug) → getDoc('file/introduction') → reads content/docs/file/introduction.mdx; paths align with the new content tree. Default version v8 is correct (no legacy link rewriting needed for new docs).
  • getProductSectionForPath only resolves file/loop; confirmed no existing docs slug/page named file or loop, so it cannot hijack the main /docs/* routes or the version selector.
  • ProductDocPage markdownPath (/docs/<id>/markdown/<slug>.md, relative — used for client fetch) and markdownUrl (absolute — used for copy-link) are consistent with DocsPageActions usage and the new route handlers.
  • product-docs-nav.ts is correctly kept fs-free so the client DocsNav/DocsSearch don't pull server-only code into the bundle; product-docs.ts re-exports the pure surface and adds the server loaders.

Addressed comments

  • No bot or human review comments were present. .workforce/context.json contains only PR metadata (no reviewComments/threads), and there is no prior human review/approval recorded. Nothing to address or reconcile.

Advisory Notes

  • web/components/docs/DocsNav.tsx imports FolderOpen from lucide-react at line 14 and then a second lucide-react statement at line 40 (FolderOpen as FolderOpenIcon, Repeat). It compiles and behaves correctly, but it's a split duplicate import from the same module that an import/no-duplicates lint rule would flag. The repo has no eslint step in CI (only build + vitest), so this is purely stylistic — left unchanged to avoid an unrequested edit. A human may want to consolidate these into the existing import block.
  • No tests were added for the new product-docs loaders/routes. Adding tests is a human decision; if desired, a product-docs test mirroring docs-markdown-components.test.ts (asserting getProductDoc/getProductDocMarkdown resolve and strip JSX) would cover the new surface. Left to the author.

Status

The code is sound: type check and tests pass, changes are docs-only and additive, no safety-critical areas touched. I could not run the full next build to completion due to a sandbox process kill (code 137), so the build CI check cannot be confirmed green from here — that gate must be observed on the actual CI runner before merge. Because a required check (the Cloudflare build) is not verified-green in this environment, I am not printing READY.

khaliqgant and others added 2 commits June 24, 2026 13:20
Relayfile:
- Rewrite introduction around event materialization; CLI/SDK CodeGroup
- Add events (webhook normalization) and self-hosting concept pages
- why-files mirrors the "Just Give the Agent Files" blog, trimmed
- quickstart shows hosted path only, links self-host + GitHub

Relayloop: ground the docs in relayhistory/relayhistory-cloud
- Remove the fabricated `ai-hist cloud` command group; real flow is
  `ai-hist login` + `ai-hist push`, plus pair check and learn distill
- Rebuild CLI reference (pack/resume/export/import/tags, real env vars)
- Add Grok source; correct cloud architecture to Workers + Neon/pgvector
- Default tier is vendor-readable (scrubbed); E2E is Enterprise tier
- Mark unbuilt cloud/team features (cross-device pull, web UI, hosted
  MCP, Insights, teams, pricing) as coming soon

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@khaliqgant

Copy link
Copy Markdown
Member Author

loop still needs work, relayfile passable for now

@khaliqgant
khaliqgant merged commit 5b7cfd3 into main Jun 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant