## Websites (Static Site Hosting)

### Deploy flow (recommended — single call)
1. Create a website: `POST /websites` → get `websiteId`
2. Deploy files: MCP `deploy_website_file({ websiteId, fileName: "index.html", content: "<html>..." })`
3. Site is live at `https://www.easybits.cloud/s/<slug>/`

`deploy_website_file` uploads content directly (max 1MB, text or base64). No presigned URL or status update needed.
For large binary files (>1MB), use `upload_website_file` → PUT to presigned URL → `update_file(status: "DONE")`.

### A site is a folder, not a single page
`fileName` accepts a **path**, so deploy every file at its real path and the site keeps its structure:

```ts
await eb.deployWebsiteFile(websiteId, { fileName: "index.html",      content: html });
await eb.deployWebsiteFile(websiteId, { fileName: "producto.html",   content: producto });
await eb.deployWebsiteFile(websiteId, { fileName: "css/estilos.css", content: css, contentType: "text/css" });
await eb.deployWebsiteFile(websiteId, { fileName: "js/main.js",      content: js,  contentType: "application/javascript" });
```

`/s/<slug>/` resolves **relative links between the site's own files**, so the HTML goes as-is:

```html
<link rel="stylesheet" href="css/estilos.css">
<script src="js/main.js"></script>
<a href="producto.html">Ver producto</a>
```

Do **not** rewrite a site's own pages/CSS/JS to absolute storage URLs — the deployed copies end up orphaned while the page loads a duplicate from a random key. Absolute public URLs are only for **binary assets** you uploaded (`upload_website_file`), and for those you must embed the `url` returned verbatim.

Routing details: `/s/<slug>/` serves `index.html`; a path with no extension falls back to `<path>/index.html`.

Images: download third-party images and upload them (`upload_website_file`, or `deploy_website_file` with `encoding: "base64"` if <1MB). Never hotlink Flickr/Unsplash from a published site.

### List websites
`GET /websites`
Returns: `{ items: Website[] }`
SDK: `eb.listWebsites()`

### Create website
`POST /websites`
Body: `{ name: string }`
Returns: `{ website }` with id, slug, url.
SDK: `eb.createWebsite(name)`

### Get website
`GET /websites/:websiteId`
Returns: Website with stats (fileCount, totalSize).
SDK: `eb.getWebsite(websiteId)`

### Update website
`PATCH /websites/:websiteId`
Body: `{ name?, status? }`
SDK: `eb.updateWebsite(websiteId, { name?, status? })`

### List website files
`GET /websites/:websiteId/files?limit=&cursor=`
Returns: `{ items: File[], nextCursor? }`
SDK: `eb.listWebsiteFiles(websiteId, { limit?, cursor? })`
MCP: `list_website_files({ websiteId, limit?, cursor? })`

### Delete website
`DELETE /websites/:websiteId`
Soft-deletes all associated files (recoverable 7 days).
SDK: `eb.deleteWebsite(websiteId)`

### Website object
```json
{
  "id": "web123",
  "name": "My Site",
  "slug": "my-site",
  "status": "ACTIVE",
  "url": "https://www.easybits.cloud/s/my-site/",
  "fileCount": 3,
  "totalSize": 51200,
  "createdAt": "2026-01-15T..."
}
```
