# Distribution

`agent-ui` has one source of truth and three ways to consume it.

## 1. Copy the source

This is the primary path. Copy the component HTML, CSS, and optional runtime into your application. You own the files, can edit them directly, and do not inherit a runtime network dependency.

Use the [machine-readable catalog](../catalog.json) or the [component pages](../components/index.html), then start from the [three recipes](../patterns/index.html) or the [canonical showcase run](../../showcase/chat-run.html). Each catalog recipe includes a resolved `stylesheets[]` list. Optional helpers: `host-chrome.css`, `recipes/chat-tools.css`, and `node scripts/copy-recipe.js <recipe> <dir>`. AI coding agents should read the repository [`AGENTS.md`](../../AGENTS.md) and [`AI setup guide`](ai-setup.md) first.

## 2. Open the hosted docs

The repository root is a static site. GitHub Pages publishes the checked-out source and docs without a build step. The source remains visible at the same paths used by the local server.

```bash
python3 -m http.server
```

Then open `http://localhost:8000/`.

The Pages workflow is `.github/workflows/pages.yml`. A custom domain can be attached in repository settings without changing the source tree.

## 3. Use the pinned CDN path

The CDN is an opt-in convenience for prototypes. It is not the source of truth and it is not required by the library. Use a release tag, never `main` or `latest`:

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/itsbrennanm/agent-ui@v0.5.0/tokens.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/itsbrennanm/agent-ui@v0.5.0/components/chat-message/chat-message.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/itsbrennanm/agent-ui@v0.5.0/components/tool-call/tool-call.css">
<script src="https://cdn.jsdelivr.net/gh/itsbrennanm/agent-ui@v0.5.0/agent-ui.js" defer></script>
```

The runtime remains optional. The core components do not fetch content, execute approved actions, load fonts, or load icons from the network.

## Release discipline

- Tag a release only after the static and browser checks pass.
- Keep CDN examples pinned to that tag.
- Keep copy-paste source and hosted docs working if the CDN is unavailable.
- Change the tag only when the component contract or runtime changes intentionally.

For a package manager, CLI, or MCP distribution, wait until real usage shows that source copy, the catalog, and pinned CDN links are insufficient. That keeps the first release small and reversible.
