Skip to content

API Reference parrot_tools.ui_surfaces

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

parrot_tools.ui_surfaces

View source

PublishSurfaceTool — LLM-invocable wrapper over InfographicAuthoringMixin.publish_surface() (FEAT-492, TASK-2704).

A thin tool: when bound to a mixin-composed bot (via the bot= constructor kwarg), delegates straight to bot.publish_surface(...) — the SAME injection seam (explicit surface_store > bound attribute > lazy-import PgUISurfaceStore) the mixin itself resolves. When no such bot is bound (headless/standalone use), falls back to persisting directly against a store using the identical row shape, so both lanes stay in lockstep.

Reachable via the legacy import path too — parrot.tools redirects any non-core submodule name to parrot_tools (see parrot/tools/__init__.py meta_path finder): from parrot.tools.ui_surfaces import PublishSurfaceTool resolves to this module.

Class PublishSurfaceArgs

Arguments for persisting a rehydratable A2UI surface.

Attributes:

Attribute Type Description
kind str
title str
envelope dict[str, Any]
recipe_name str | None
recipe_owner str | None
recipe_params dict[str, Any] | None
overwrite bool

Class PublishSurfaceTool

Persist a rehydratable A2UI surface so it can be fetched later at a bookmarkable URL (GET /api/v1/ui/surfaces/{surface_id}), outside the conversation that produced it.

Pass kind, title, and the envelope to save. Optionally pass recipe_name/recipe_owner/recipe_params to make the surface refreshable — a later POST .../refresh re-runs that recipe and updates this same row in place, rather than replaying nothing at all.

Parameter Type Default Description
bot Any None The mixin-composed bot to delegate to (preferred lane). When it exposes publish_surface (i.e., composed with InfographicAuthoringMixin), every call is forwarded there.
surface_store Any None Injection seam forwarded to the bot's publish_surface(surface_store=...) — or used directly by the standalone fallback lane when no bot is bound.
agent_id str | None None Attribution for the standalone fallback lane only (the bot lane derives this from bot.name itself).
user_id str | None None Attribution for the standalone fallback lane only.
session_id str | None None Attribution for the standalone fallback lane only.
linked_service Any None LinkedSurfaceService used by the standalone lane for linked envelopes (FEAT-598). Takes precedence over guard and the bot's _dataplane_guard.
guard Any None Data-plane guard used to build a LinkedSurfaceService for the standalone lane when no linked_service is given (FEAT-611 M7). Falls back to bot._dataplane_guard, then to guard=None — fail-closed (LinkedGuardRequired → 403).
**kwargs Any {}

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