Update and use /docs endpoint without /home

This commit is contained in:
Morgan Dean
2025-07-30 18:58:52 +01:00
parent c5ce1a9765
commit 0b90ab907d
42 changed files with 73 additions and 34 deletions

View File

@@ -106,14 +106,24 @@ Mouse wheel and scrolling control:
<Tabs items={['Python', 'TypeScript']}>
<Tab value="Python">
```python # Scrolling await computer.interface.scroll(x, y) # Scroll the
mouse wheel await computer.interface.scroll_down(clicks) # Scroll down await
computer.interface.scroll_up(clicks) # Scroll up ```
```python
# Scrolling
await computer.interface.scroll(x, y) # Scroll the mouse wheel
await computer.interface.scroll_down(clicks) # Scroll down await
computer.interface.scroll_up(clicks) # Scroll up
```
</Tab>
<Tab value="TypeScript">
```typescript // Scrolling await computer.interface.scroll(x, y); // Scroll
the mouse wheel await computer.interface.scrollDown(clicks); // Scroll down
await computer.interface.scrollUp(clicks); // Scroll up ```
```typescript
// Scrolling
await computer.interface.scroll(x, y); // Scroll the mouse wheel
await computer.interface.scrollDown(clicks); // Scroll down
await computer.interface.scrollUp(clicks); // Scroll up
```
</Tab>
</Tabs>
@@ -123,14 +133,21 @@ Screen capture and display information:
<Tabs items={['Python', 'TypeScript']}>
<Tab value="Python">
```python # Screen operations await computer.interface.screenshot() # Take a
screenshot await computer.interface.get_screen_size() # Get screen
dimensions ```
```python
# Screen operations
await computer.interface.screenshot() # Take a screenshot
await computer.interface.get_screen_size() # Get screen dimensions
```
</Tab>
<Tab value="TypeScript">
```typescript // Screen operations await computer.interface.screenshot(); //
Take a screenshot await computer.interface.getScreenSize(); // Get screen
dimensions ```
```typescript
// Screen operations
await computer.interface.screenshot(); // Take a screenshot
await computer.interface.getScreenSize(); // Get screen dimensions
```
</Tab>
</Tabs>
@@ -140,14 +157,22 @@ System clipboard management:
<Tabs items={['Python', 'TypeScript']}>
<Tab value="Python">
```python # Clipboard operations await
```python
# Clipboard operations await
computer.interface.set_clipboard(text) # Set clipboard content await
computer.interface.copy_to_clipboard() # Get clipboard content ```
computer.interface.copy_to_clipboard() # Get clipboard content
```
</Tab>
<Tab value="TypeScript">
```typescript // Clipboard operations await
computer.interface.setClipboard(text); // Set clipboard content await
computer.interface.copyToClipboard(); // Get clipboard content ```
```typescript
// Clipboard operations
await computer.interface.setClipboard(text); // Set clipboard content
await computer.interface.copyToClipboard(); // Get clipboard content
```
</Tab>
</Tabs>
@@ -157,6 +182,7 @@ Direct file and directory manipulation:
<Tabs items={['Python', 'TypeScript']}>
<Tab value="Python">
```python
# File existence checks
await computer.interface.file_exists(path) # Check if file exists
@@ -204,11 +230,19 @@ Access system accessibility information:
<Tabs items={['Python', 'TypeScript']}>
<Tab value="Python">
```python # Accessibility await computer.interface.get_accessibility_tree()
# Get accessibility tree ```
```python
# Get accessibility tree
await computer.interface.get_accessibility_tree()
```
</Tab>
<Tab value="TypeScript">
```typescript // Accessibility await
computer.interface.getAccessibilityTree(); // Get accessibility tree ```
</Tab>
```typescript
// Get accessibility tree
await computer.interface.getAccessibilityTree();
```
</Tab>
</Tabs>
```

View File

@@ -63,7 +63,7 @@ lume run macos-sequoia-cua:latest
3. Connect with Computer
<Tabs items={['Python']}>
<Tabs items={['Python']}>
<Tab value="Python">
```python
computer = Computer(
@@ -73,9 +73,9 @@ lume run macos-sequoia-cua:latest
)
await computer.run() # Connect to the container
```
```
</Tab>
</Tab>
</Tabs>
## Your host desktop
@@ -91,7 +91,12 @@ Connect with:
<Tabs items={['Python']}>
<Tab value="Python">
```python computer = Computer(use_host_computer_server=True) await
computer.run() # Connect to the host desktop ```
```python
computer = Computer(use_host_computer_server=True) await
computer.run() # Connect to the host desktop
```
</Tab>
</Tabs>

View File

@@ -16,18 +16,18 @@ cua makes every stage of computer-using agent development simple:
- **Deployment**: cua cloud gives you a production-ready cloud environment for your assistants
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-8">
<Card icon={<Monitor />} href="/home/quickstart-ui" title="Quickstart (UI)">
<Card icon={<Monitor />} href="/docs/quickstart-ui" title="Quickstart (UI)">
Try the cua Agent UI in your browser—no coding required.
</Card>
<Card
icon={<Code />}
href="/home/quickstart-devs"
href="/docs/quickstart-devs"
title="Quickstart (Developers)">
Build with Python—full SDK and agent code examples.
</Card>
</div>
<div className="grid grid-cols-1 gap-6 mt-6">
<Card icon={<BookOpen />} href="/home/libraries/agent" title="API Reference">
<Card icon={<BookOpen />} href="/docs/libraries/agent" title="API Reference">
Explore the agent SDK and APIs
</Card>
</div>

View File

@@ -8,7 +8,7 @@ const config = {
async rewrites() {
return [
{
source: '/home/:path*.mdx',
source: '/docs/:path*.mdx',
destination: '/llms.mdx/:path*',
},
];

View File

@@ -25,7 +25,7 @@ export default async function Page(props: {
const params = await props.params;
const slug = params.slug || [];
const page = source.getPage(slug);
if (!page) redirect('/home');
if (!page) notFound(); //redirect('/docs');
// Detect if this is an API reference page: /api/[section] or /api/[section]/[version]
let apiSection: string | null = null;

View File

@@ -10,7 +10,7 @@ export async function GET(
{ params }: { params: Promise<{ slug?: string[] }> }
) {
const { slug } = await params;
const page = source.getPage(['home', ...slug!]);
const page = source.getPage(['docs', ...slug!]);
if (!page) notFound();
return new NextResponse(await getLLMText(page));

View File

@@ -43,7 +43,7 @@ export async function getApiVersions(
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
// it assigns a URL to your pages
baseUrl: '/',
baseUrl: '/docs',
source: docs.toFumadocsSource(),
icon(icon) {
if (!icon) return;