> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browserwire.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Manifest

> The typed state machine that describes a site's pages, views, and actions.

A **manifest** is the core artifact BrowserWire produces from training. It describes a website as a typed state machine — a set of pages (states), each with views you can read and actions you can execute.

Your AI agent or automation script consumes the manifest indirectly through the local execution API served by `bw run`.

## Structure

A manifest is organized around **states**. Each state represents a distinct page or screen on the site.

```json theme={null}
{
  "id": "mf_abc123",
  "domain": "example.com",
  "origin": "https://example.com",
  "slug": "example-com",
  "states": [
    {
      "id": "state_1",
      "name": "HomePage",
      "url_pattern": "https://example.com/",
      "views": [
        {
          "name": "featured_products",
          "code": "async (page) => { ... }"
        }
      ],
      "actions": [
        {
          "name": "click_login",
          "inputs": [],
          "code": "async (page, inputs) => { ... }"
        }
      ]
    },
    {
      "id": "state_2",
      "name": "LoginPage",
      "url_pattern": "https://example.com/login",
      "views": [],
      "actions": [
        {
          "name": "fill_email",
          "inputs": [{ "name": "email", "type": "string" }],
          "code": "async (page, inputs) => { ... }"
        },
        {
          "name": "fill_password",
          "inputs": [{ "name": "password", "type": "string" }],
          "code": "async (page, inputs) => { ... }"
        },
        {
          "name": "submit_login",
          "inputs": [
            { "name": "email", "type": "string" },
            { "name": "password", "type": "string" }
          ],
          "code": "async (page, inputs) => { ... }"
        }
      ]
    }
  ]
}
```

## States

Each state has:

| Field         | Type     | Description                                                          |
| ------------- | -------- | -------------------------------------------------------------------- |
| `id`          | `string` | Unique identifier for the state                                      |
| `name`        | `string` | Semantic name assigned by the AI (e.g., `HomePage`, `SearchResults`) |
| `url_pattern` | `string` | RFC 6570 URI template for navigating to this state                   |
| `views`       | `array`  | Data extraction functions available on this page                     |
| `actions`     | `array`  | Interactions that can be performed on this page                      |

## Views

A view reads structured data from a page. When you call a view endpoint, the execution server navigates to the state's URL, waits for the page to settle, and runs the view's code against the live DOM.

| Field  | Type     | Description                                             |
| ------ | -------- | ------------------------------------------------------- |
| `name` | `string` | View identifier (e.g., `product_list`, `order_summary`) |
| `code` | `string` | Playwright function that extracts and returns data      |

Views are exposed as `GET` endpoints:

```
GET /api/sites/:slug/views/:state/:view
```

## Actions

An action performs an interaction on a page — clicking a button, filling a form field, or submitting data. Actions can accept typed inputs.

| Field    | Type     | Description                                            |
| -------- | -------- | ------------------------------------------------------ |
| `name`   | `string` | Action identifier (e.g., `click_login`, `submit_form`) |
| `inputs` | `array`  | Parameters the action accepts (name, type)             |
| `code`   | `string` | Playwright function that performs the interaction      |

Actions are exposed as `POST` endpoints:

```
POST /api/sites/:slug/actions/:state/:action
```

## How execution works

When you call an endpoint on the local server (`bw run`):

1. The server looks up the manifest for the site slug
2. Finds the target state and view/action
3. Opens a new browser page
4. Navigates to the state's URL (expanding any RFC 6570 template variables with your inputs)
5. Waits for the DOM to settle (using a MutationObserver-based debounce)
6. Executes the view or action code
7. Returns the result as JSON

The browser page is closed after each request. Multiple requests can run concurrently up to the `--max-concurrent` limit (default: 3).

## Dashboard view

The [dashboard](/guides/dashboard) shows each manifest's endpoints with copy-ready curl commands. Navigate to **APIs** and click a domain to see all available views and actions organized by state.
