Skip to main content

Pages, Blocks, and Props

Avocado Studio manages website content as structured data, not raw HTML.
  • Page (PageDoc) — A single page on your website (e.g., /about, /pricing). Contains metadata (title, slug) and an ordered list of blocks.
  • Block (BlockInstance) — A content section on a page. Each block has a type (e.g., Hero, CTA, FAQAccordion) and props — the structured data that controls what it renders.
  • Props — The fields that make up a block’s content. A Hero block has heading, subheading, imageUrl, imageAlt, ctaText, and ctaHref (plus a few optional fields). Every prop is defined by a Zod schema, so the system knows exactly what values are valid.

Operations

An operation is a structured, schema-validated edit action. When a user says “change the hero heading to Welcome”, the AI doesn’t modify HTML — it generates an operation like:
Operations are the unit of change in Avocado Studio. They can be: Every operation is validated against the block’s Zod schema before it’s applied. If the AI generates an invalid edit (e.g., setting a heading to a number), it’s rejected automatically.

Plans and Approval

When a user sends a chat message, the AI generates an edit plan — a list of one or more operations. The plan is presented to the user for review before it’s applied.
Plans can be approved, rejected, or modified. The user always has the final say.

Draft Mode

Draft mode is how the Content Studio shows unpublished changes on your live site. When the Content Studio is active, the site switches into draft mode — it fetches the latest draft content from the orchestrator instead of the published content.
  • Published content — What your visitors see. Stored in your CMS, database, or static files.
  • Draft content — What you see in the Content Studio. Stored in the orchestrator’s session state. Not visible to site visitors.
  • Publishing — Promoting draft content to published. Triggered by the user after reviewing changes.
Draft mode uses Next.js cookies under the hood. The Content Studio iframe sets the cookie automatically — your site just needs to check for it and fetch from the orchestrator when present.

The Three Services

Avocado Studio runs as three services that communicate via HTTP and postMessage: The Content Studio embeds your site in an iframe. When the user clicks a block, the site sends a postMessage to the Content Studio identifying which block was selected. When an operation is applied, the orchestrator notifies the site to re-fetch and re-render.

Block Manifest

When the Content Studio connects to your site, it fetches the block manifest from /api/editor/blocks. This tells the Content Studio what block types are available and what props each one accepts.
The AI planner uses the manifest to understand what blocks exist and what edits are possible. This is why every block needs a complete schema — it’s not just for validation, it’s the AI’s instruction manual.

Multi-Model AI

The orchestrator supports three AI providers:
  • Anthropic — Claude Haiku (fast), Sonnet (balanced), Opus (complex reasoning). Most battle-tested.
  • OpenAI — GPT-4o-mini (fast), GPT-4o (balanced), o1/o3 (reasoning).
  • Google Gemini — Gemini Flash (fast), Gemini Pro (reasoning).
Users select the provider and model tier in the Content Studio’s settings panel. The orchestrator routes the request to the appropriate provider. You can also override model names via environment variables for each tier.