Dollie Editor SDK guide

Give the Copilot Editor Tools

Let the Copilot read your available components and return page changes for review

A Copilot needs tools to learn which components exist and to return changes in a format the editor understands.

These tools do not give the Copilot direct control of the page. They return information or suggestions.

The tools

Tool What the Copilot uses it for
editor_catalog See which components are available and which fields they contain
editor_validate_page Check whether page data is valid
propose_page Suggest a complete page
propose_section_edit Suggest a change to one section
propose_fill Draft one page, section, illustration, or field

You can also enable:

Tool What it does
editor_get_page Loads a saved page
editor_save_draft Saves a draft after validation

Saving tools are optional. Publishing is not included.

Add the tools to a Laravel AI agent

The Laravel adapter provides ready-made tools:

use Dollie\Editor\Ai\EditorTools;
use Dollie\Editor\Ai\ProposalTools;
use Dollie\Editor\Ai\ProposeFillTool;

public function tools(): iterable
{
    return [
        ...app(EditorTools::class)->all(),
        ...app(ProposalTools::class)->all($this->context->sectionIds),
        app(ProposeFillTool::class),
    ];
}

EditorTools provides Catalog and validation tools.

ProposalTools creates suggestions for the page the person is currently editing. Pass the current section ids so a section suggestion cannot accidentally target a different component.

ProposeFillTool handles focused requests such as rewriting one field.

Enable loading and saving only when needed

To let the Copilot load or save drafts, connect your own PageStore and enable page tools:

'store' => App\Editor\YourPageStore::class,
'tools' => [
    'page_operations_enabled' => true,
],

Your PageStore decides where pages live and which page belongs to the current request. The adapter does not choose a customer or tenant for you.

The first call to editor_save_draft creates a draft. Later saves must include the latest revision. Saving a draft does not publish it.

A good tool flow

For a new page, the Copilot should:

  1. ask editor_catalog for the available sections;
  2. ask for the field details of the sections it wants to use;
  3. build a page suggestion;
  4. return that suggestion with propose_page;
  5. wait for the person to review and apply it.

For a small change, it should use propose_section_edit instead of rebuilding the whole page.

Keep access tied to the current request

Before running a tool, your server should already know:

  • which user is making the request;
  • which customer or team they belong to;
  • which page they may edit;
  • which Catalog is enabled;
  • which actions they may perform.

Do not let values written by the model replace those checks.

Next steps