Initial commit for fumadocs

This commit is contained in:
Morgan Dean
2025-06-10 18:13:28 -04:00
parent 5ce6b2636e
commit 56527f7752
29 changed files with 6665 additions and 0 deletions

16
.vscode/docs.code-workspace vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"folders": [
{
"path": "../docs"
}
],
"settings": {
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
}
}
}

28
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# deps
/node_modules
# generated content
.contentlayer
.content-collections
.source
# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo
# misc
.DS_Store
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# others
.env*.local
.vercel
next-env.d.ts

45
docs/README.md Normal file
View File

@@ -0,0 +1,45 @@
# docs
This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
Run development server:
```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```
Open http://localhost:3000 with your browser to see the result.
## Explore
In the project, you can see:
- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.
- `app/layout.config.tsx`: Shared options for layouts, optional but preferred to keep.
| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |
### Fumadocs MDX
A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.
Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.
## Learn More
To learn more about Next.js and Fumadocs, take a look at the following
resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs

86
docs/biome.json Normal file
View File

@@ -0,0 +1,86 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": [
".next",
"build"
]
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto",
"bracketSpacing": true
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useSelfClosingElements": "warn",
"noUnusedTemplateLiteral": "warn",
"noNonNullAssertion": "off"
},
"a11y": {
"useMediaCaption": "off",
"useKeyWithClickEvents": "warn",
"useKeyWithMouseEvents": "warn",
"noSvgWithoutTitle": "off",
"useButtonType": "warn",
"noAutofocus": "off"
},
"suspicious": {
"noArrayIndexKey": "off"
},
"correctness": {
"noUnusedVariables": "warn",
"noUnusedFunctionParameters": "warn",
"noUnusedImports": "warn"
},
"complexity": {
"useOptionalChain": "info"
},
"nursery": {
"useSortedClasses": {
"level": "warn",
"fix": "safe",
"options": {
"attributes": [
"className"
],
"functions": [
"cn"
]
}
}
}
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
}
}

View File

@@ -0,0 +1,4 @@
---
title: Cloud Service
description: Cloud Service
---

View File

@@ -0,0 +1,5 @@
{
"title": "Cloud Service",
"description": "Cloud Service",
"root": true
}

View File

@@ -1,3 +1,7 @@
---
title: Developer Guide
description: Cua Monorepo Developer Guide
---
# Getting Started
## Project Structure

View File

@@ -1,3 +1,7 @@
---
title: FAQs
description: Frequenty Asked Questions
---
# FAQs
### Why a local sandbox?

View File

@@ -1,3 +1,7 @@
---
title: Telemetry in CUA
description: This document explains how telemetry works in CUA libraries and how you can control it.
---
# Telemetry in CUA
This document explains how telemetry works in CUA libraries and how you can control it.

View File

@@ -0,0 +1,13 @@
---
title: CUA Documentation
description: CUA Documentation
---
## What is CUA?
Cua is a collection of libraries and tools for building Computer-Use AI agents.
<Cards>
<Card title="Libraries" href="/libraries" />
<Card title="Cloud Service" href="/cloud"/>
</Cards>

View File

@@ -0,0 +1,6 @@
{
"title": "Home",
"description": "Documentation Home",
"root": true,
"defaultOpen": true
}

View File

@@ -0,0 +1,8 @@
---
title: Libraries
description: Libraries
---
## Libraries
The CUA project provides several libraries for building Computer-Use AI agents.

View File

@@ -0,0 +1,5 @@
{
"title": "Libraries",
"description": "Libraries",
"root": true
}

10
docs/next.config.mjs Normal file
View File

@@ -0,0 +1,10 @@
import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
};
export default withMDX(config);

6038
docs/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

31
docs/package.json Normal file
View File

@@ -0,0 +1,31 @@
{
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev --turbo -p 8090",
"start": "next start -p 8090",
"postinstall": "fumadocs-mdx"
},
"dependencies": {
"fumadocs-core": "15.5.1",
"fumadocs-mdx": "11.6.7",
"fumadocs-ui": "15.5.1",
"lucide-react": "^0.514.0",
"next": "15.3.3",
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@tailwindcss/postcss": "^4.1.8",
"@types/mdx": "^2.0.13",
"@types/node": "22.15.28",
"@types/react": "^19.1.6",
"@types/react-dom": "^19.1.5",
"postcss": "^8.5.4",
"tailwindcss": "^4.1.8",
"typescript": "^5.8.3"
}
}

5
docs/postcss.config.mjs Normal file
View File

@@ -0,0 +1,5 @@
export default {
plugins: {
'@tailwindcss/postcss': {},
},
};

23
docs/source.config.ts Normal file
View File

@@ -0,0 +1,23 @@
import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
} from 'fumadocs-mdx/config';
// You can customise Zod schemas for frontmatter and `meta.json` here
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
export const docs = defineDocs({
docs: {
schema: frontmatterSchema,
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
// MDX options
},
});

View File

@@ -0,0 +1,52 @@
import { source } from '@/lib/source';
import {
DocsPage,
DocsBody,
DocsDescription,
DocsTitle,
} from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { getMDXComponents } from '@/mdx-components';
export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
const MDXContent = page.data.body;
return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDXContent
components={getMDXComponents({
// this allows you to link to other pages with relative file paths
a: createRelativeLink(source, page),
})}
/>
</DocsBody>
</DocsPage>
);
}
export async function generateStaticParams() {
return source.generateParams();
}
export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
return {
title: page.data.title,
description: page.data.description,
};
}

View File

@@ -0,0 +1,38 @@
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import type { ReactNode } from 'react';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import { Home, Library, Cloud } from 'lucide-react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout
tree={source.pageTree}
sidebar={{
tabs: [
{
url: '/home',
title: 'Home',
description: 'Welcome to Cua Documentation',
icon: <Home />,
},
{
url: '/libraries',
title: 'Libraries',
description: 'Library Documentation',
icon: <Library />,
},
{
url: '/cloud',
title: 'Cloud',
description: 'Cua Cloud Documentation',
icon: <Cloud />,
},
],
}}
{...baseOptions}
>
{children}
</DocsLayout>
);
}

View File

@@ -0,0 +1,4 @@
import { source } from '@/lib/source';
import { createFromSource } from 'fumadocs-core/search/server';
export const { GET } = createFromSource(source);

3
docs/src/app/global.css Normal file
View File

@@ -0,0 +1,3 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';

View File

@@ -0,0 +1,53 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import Image from 'next/image';
import logoBlack from '@/assets/logo-black.svg';
import logoWhite from '@/assets/logo-white.svg';
import { HomeIcon } from 'lucide-react';
/**
* Shared layout configurations
*
* you can customise layouts individually from:
* Home Layout: app/(home)/layout.tsx
* Docs Layout: app/docs/layout.tsx
*/
export const baseOptions: BaseLayoutProps = {
nav: {
title: (
<>
<Image
width={30}
height={30}
src={logoBlack}
aria-label="Logo"
className="block dark:hidden"
alt="Logo"
/>
<Image
width={30}
height={30}
src={logoWhite}
aria-label="Logo"
className="hidden dark:block"
alt="Logo"
/>
Cua Documentation
</>
),
},
githubUrl: 'https://github.com/trycua/cua',
links: [
{
url: '/home',
text: 'Documentation Home',
icon: <HomeIcon />,
},
{
url: 'https://trycua.com',
text: 'cua home',
type: 'icon',
icon: <HomeIcon />,
},
],
};

18
docs/src/app/layout.tsx Normal file
View File

@@ -0,0 +1,18 @@
import './global.css';
import { RootProvider } from 'fumadocs-ui/provider';
import { Inter } from 'next/font/google';
import type { ReactNode } from 'react';
const inter = Inter({
subsets: ['latin'],
});
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<body className="flex min-h-screen flex-col">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}

View File

@@ -0,0 +1,49 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500"
zoomAndPan="magnify" viewBox="0 0 375 374.999991" height="500"
preserveAspectRatio="xMidYMid meet" version="1.0">
<defs>
<clipPath id="d101d478a8">
<path d="M 158 130 L 331 130 L 331 359.59375 L 158 359.59375 Z M 158 130 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="ded1a174b8">
<path d="M 158 15.34375 L 173 15.34375 L 173 88 L 158 88 Z M 158 15.34375 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="b1b552b1fc">
<path d="M 43.964844 130 L 116 130 L 116 145 L 43.964844 145 Z M 43.964844 130 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="c8ecf7f480">
<path d="M 170 154 L 294 154 L 294 318.304688 L 170 318.304688 Z M 170 154 "
clip-rule="nonzero" />
</clipPath>
</defs>
<g clip-path="url(#d101d478a8)">
<path fill="#000000"
d="M 327.777344 260.71875 L 170.246094 131.832031 C 168.097656 130.082031 165.148438 129.714844 162.65625 130.914062 C 160.152344 132.09375 158.5625 134.609375 158.5625 137.375 L 158.5625 352.1875 C 158.5625 355.335938 160.636719 358.128906 163.644531 359.046875 C 164.332031 359.246094 165.03125 359.347656 165.71875 359.347656 C 168.070312 359.347656 170.316406 358.1875 171.679688 356.152344 L 226.839844 273.421875 L 323.25 273.421875 C 326.273438 273.421875 328.964844 271.515625 329.996094 268.667969 C 331.011719 265.816406 330.125 262.636719 327.777344 260.71875 Z M 327.777344 260.71875 "
fill-opacity="1" fill-rule="nonzero" />
</g>
<g clip-path="url(#ded1a174b8)">
<path fill="#000000"
d="M 165.71875 15.644531 C 161.765625 15.644531 158.558594 18.855469 158.558594 22.808594 L 158.558594 80.089844 C 158.558594 84.042969 161.765625 87.25 165.71875 87.25 C 169.671875 87.25 172.882812 84.042969 172.882812 80.089844 L 172.882812 22.808594 C 172.882812 18.855469 169.671875 15.644531 165.71875 15.644531 Z M 165.71875 15.644531 "
fill-opacity="1" fill-rule="nonzero" />
</g>
<g clip-path="url(#b1b552b1fc)">
<path fill="#000000"
d="M 108.4375 130.214844 L 51.152344 130.214844 C 47.203125 130.214844 43.992188 133.421875 43.992188 137.375 C 43.992188 141.328125 47.203125 144.539062 51.152344 144.539062 L 108.4375 144.539062 C 112.390625 144.539062 115.597656 141.328125 115.597656 137.375 C 115.597656 133.421875 112.390625 130.214844 108.4375 130.214844 Z M 108.4375 130.214844 "
fill-opacity="1" fill-rule="nonzero" />
</g>
<path fill="#000000"
d="M 280.289062 130.214844 L 223.003906 130.214844 C 219.054688 130.214844 215.84375 133.421875 215.84375 137.375 C 215.84375 141.328125 219.054688 144.539062 223.003906 144.539062 L 280.289062 144.539062 C 284.238281 144.539062 287.449219 141.328125 287.449219 137.375 C 287.449219 133.421875 284.238281 130.214844 280.289062 130.214844 Z M 280.289062 130.214844 "
fill-opacity="1" fill-rule="nonzero" />
<path fill="#000000"
d="M 130.277344 91.804688 L 89.761719 51.304688 C 86.972656 48.511719 82.429688 48.511719 79.636719 51.304688 C 76.847656 54.097656 76.847656 58.636719 79.636719 61.429688 L 120.152344 101.929688 C 121.554688 103.316406 123.386719 104.019531 125.21875 104.019531 C 127.054688 104.019531 128.886719 103.332031 130.277344 101.929688 C 133.070312 99.136719 133.070312 94.597656 130.277344 91.804688 Z M 130.277344 91.804688 "
fill-opacity="1" fill-rule="nonzero" />
<path fill="#000000"
d="M 130.277344 172.832031 C 127.484375 170.039062 122.945312 170.039062 120.152344 172.832031 L 79.636719 213.332031 C 76.84375 216.125 76.84375 220.664062 79.636719 223.457031 C 81.042969 224.847656 82.875 225.550781 84.707031 225.550781 C 86.539062 225.550781 88.375 224.847656 89.761719 223.441406 L 130.277344 182.957031 C 133.070312 180.164062 133.070312 175.625 130.277344 172.832031 Z M 130.277344 172.832031 "
fill-opacity="1" fill-rule="nonzero" />
<path fill="#000000"
d="M 251.789062 51.304688 C 248.996094 48.511719 244.457031 48.511719 241.664062 51.304688 L 201.148438 91.804688 C 198.355469 94.597656 198.355469 99.136719 201.148438 101.929688 C 202.554688 103.316406 204.386719 104.019531 206.222656 104.019531 C 208.054688 104.019531 209.886719 103.332031 211.273438 101.929688 L 251.789062 61.429688 C 254.582031 58.636719 254.582031 54.097656 251.789062 51.304688 Z M 251.789062 51.304688 "
fill-opacity="1" fill-rule="nonzero" />
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,49 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500"
zoomAndPan="magnify" viewBox="0 0 375 374.999991" height="500"
preserveAspectRatio="xMidYMid meet" version="1.0">
<defs>
<clipPath id="d101d478a8">
<path d="M 158 130 L 331 130 L 331 359.59375 L 158 359.59375 Z M 158 130 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="ded1a174b8">
<path d="M 158 15.34375 L 173 15.34375 L 173 88 L 158 88 Z M 158 15.34375 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="b1b552b1fc">
<path d="M 43.964844 130 L 116 130 L 116 145 L 43.964844 145 Z M 43.964844 130 "
clip-rule="nonzero" />
</clipPath>
<clipPath id="c8ecf7f480">
<path d="M 170 154 L 294 154 L 294 318.304688 L 170 318.304688 Z M 170 154 "
clip-rule="nonzero" />
</clipPath>
</defs>
<g clip-path="url(#d101d478a8)">
<path fill="#ffffff"
d="M 327.777344 260.71875 L 170.246094 131.832031 C 168.097656 130.082031 165.148438 129.714844 162.65625 130.914062 C 160.152344 132.09375 158.5625 134.609375 158.5625 137.375 L 158.5625 352.1875 C 158.5625 355.335938 160.636719 358.128906 163.644531 359.046875 C 164.332031 359.246094 165.03125 359.347656 165.71875 359.347656 C 168.070312 359.347656 170.316406 358.1875 171.679688 356.152344 L 226.839844 273.421875 L 323.25 273.421875 C 326.273438 273.421875 328.964844 271.515625 329.996094 268.667969 C 331.011719 265.816406 330.125 262.636719 327.777344 260.71875 Z M 327.777344 260.71875 "
fill-opacity="1" fill-rule="nonzero" />
</g>
<g clip-path="url(#ded1a174b8)">
<path fill="#ffffff"
d="M 165.71875 15.644531 C 161.765625 15.644531 158.558594 18.855469 158.558594 22.808594 L 158.558594 80.089844 C 158.558594 84.042969 161.765625 87.25 165.71875 87.25 C 169.671875 87.25 172.882812 84.042969 172.882812 80.089844 L 172.882812 22.808594 C 172.882812 18.855469 169.671875 15.644531 165.71875 15.644531 Z M 165.71875 15.644531 "
fill-opacity="1" fill-rule="nonzero" />
</g>
<g clip-path="url(#b1b552b1fc)">
<path fill="#ffffff"
d="M 108.4375 130.214844 L 51.152344 130.214844 C 47.203125 130.214844 43.992188 133.421875 43.992188 137.375 C 43.992188 141.328125 47.203125 144.539062 51.152344 144.539062 L 108.4375 144.539062 C 112.390625 144.539062 115.597656 141.328125 115.597656 137.375 C 115.597656 133.421875 112.390625 130.214844 108.4375 130.214844 Z M 108.4375 130.214844 "
fill-opacity="1" fill-rule="nonzero" />
</g>
<path fill="#ffffff"
d="M 280.289062 130.214844 L 223.003906 130.214844 C 219.054688 130.214844 215.84375 133.421875 215.84375 137.375 C 215.84375 141.328125 219.054688 144.539062 223.003906 144.539062 L 280.289062 144.539062 C 284.238281 144.539062 287.449219 141.328125 287.449219 137.375 C 287.449219 133.421875 284.238281 130.214844 280.289062 130.214844 Z M 280.289062 130.214844 "
fill-opacity="1" fill-rule="nonzero" />
<path fill="#ffffff"
d="M 130.277344 91.804688 L 89.761719 51.304688 C 86.972656 48.511719 82.429688 48.511719 79.636719 51.304688 C 76.847656 54.097656 76.847656 58.636719 79.636719 61.429688 L 120.152344 101.929688 C 121.554688 103.316406 123.386719 104.019531 125.21875 104.019531 C 127.054688 104.019531 128.886719 103.332031 130.277344 101.929688 C 133.070312 99.136719 133.070312 94.597656 130.277344 91.804688 Z M 130.277344 91.804688 "
fill-opacity="1" fill-rule="nonzero" />
<path fill="#ffffff"
d="M 130.277344 172.832031 C 127.484375 170.039062 122.945312 170.039062 120.152344 172.832031 L 79.636719 213.332031 C 76.84375 216.125 76.84375 220.664062 79.636719 223.457031 C 81.042969 224.847656 82.875 225.550781 84.707031 225.550781 C 86.539062 225.550781 88.375 224.847656 89.761719 223.441406 L 130.277344 182.957031 C 133.070312 180.164062 133.070312 175.625 130.277344 172.832031 Z M 130.277344 172.832031 "
fill-opacity="1" fill-rule="nonzero" />
<path fill="#ffffff"
d="M 251.789062 51.304688 C 248.996094 48.511719 244.457031 48.511719 241.664062 51.304688 L 201.148438 91.804688 C 198.355469 94.597656 198.355469 99.136719 201.148438 101.929688 C 202.554688 103.316406 204.386719 104.019531 206.222656 104.019531 C 208.054688 104.019531 209.886719 103.332031 211.273438 101.929688 L 251.789062 61.429688 C 254.582031 58.636719 254.582031 54.097656 251.789062 51.304688 Z M 251.789062 51.304688 "
fill-opacity="1" fill-rule="nonzero" />
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

9
docs/src/lib/source.ts Normal file
View File

@@ -0,0 +1,9 @@
import { docs } from "@/.source";
import { loader } from "fumadocs-core/source";
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
// it assigns a URL to your pages
baseUrl: "/",
source: docs.toFumadocsSource(),
});

View File

@@ -0,0 +1,10 @@
import defaultMdxComponents from 'fumadocs-ui/mdx';
import type { MDXComponents } from 'mdx/types';
// use this function to get MDX components, you will need it for rendering MDX
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
...components,
};
}

45
docs/tsconfig.json Normal file
View File

@@ -0,0 +1,45 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "ESNext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@/.source": [
"./.source/index.ts"
],
"@/*": [
"./src/*"
]
},
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}