Skip to content

API Reference parrot.server.ui.serving

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.server.ui.serving

View source

Embedded web UI serving.

Mounts the compiled single-page application (Svelte 5 + Vite) when the dist/ build output is present in the installed package: end-user pages (/login, /agents, /agents/<name>/chat, /account) at the site root and the administration pages under /admin, with hashed assets at /ui/assets/. Gracefully degrades (registers nothing, logs a single warning) when the UI was not built — e.g. an install-from-git without running the Node build pipeline.

Library-owned: :func:setup_admin_ui is called from BotManager.setup() (see parrot.manager.manager), following the same setup_*_routes(app) pattern as parrot.handlers.credentials.setup_credentials_routes.

Attribute ASSETS_PREFIX

Alias AdminCatalogHandler

Re-exported from parrot.server.ui.catalog.AdminCatalogHandler.

Alias AdminStatusHandler

Re-exported from parrot.server.ui.status.AdminStatusHandler.

Attribute DEFAULT_PREFIX

Attribute SPA_SECTIONS

Type: tuple[str, ...]

Attribute logger

Function setup_admin_ui

Mount the embedded web UI if the compiled dist/ is present.

setup_admin_ui(app: web.Application, *, prefix: str = DEFAULT_PREFIX, mount_root: bool | None = None) -> bool

Parameter Type Default Description
app web.Application The aiohttp :class:web.Application to mount routes on.
prefix str DEFAULT_PREFIX URL prefix the administration pages are served under. Defaults to /admin.
mount_root bool | None None Also serve the SPA at / (redirected client-side to the agent list or login). None (default) reads the PARROT_UI_AT_ROOT setting (default true). When GET / is already registered on app (navigator's default home page), it is served by a middleware scoped to exactly / instead.

Returns: bool — True when the SPA routes were registered, False when dist/ is absent (a single WARNING is logged; the SPA mount is skipped but the JSON API below is registered either way — it is UI-agnostic).

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally