DRYL COMPONENTS
Color mode: System — switch to light
3.19.0
Agents

AI Command Palette

AI-aware

DrylCommandPalette, pre-wired with the command resolver from your DI container: the user types what they want, the agent picks the command and fills its arguments, and the user confirms.

How it works

Register the resolver once and place DrylAiCommandPalette where you would place the core palette. It has every parameter of DrylCommandPalette — Texts, Items, SearchProvider, Fallback and the rest — and supplies Resolver itself. The agent sees your declared DrylCommands as tools; a natural-language query comes back as one suggestion at the top of the list, never run without the user's Enter.

csharp
// Program.cs — the agent is yours; the resolver turns your DrylCommands into its tools.
builder.Services.AddDrylComponents().AddDrylAgents();
builder.Services.AddDrylCommandResolver(sp => sp.GetRequiredService<AIAgent>());
razor
<DrylAiCommandPalette @bind-Open="_open" Texts="@_texts">
    <DrylCommand Title="Set status" OnRun="SetStatus">
        <DrylCommandArgument Name="status" Type="CommandArgType.Choice"
                             Options="@(new[] { "Draft", "Sent", "Paid" })" Required="true" />
    </DrylCommand>
</DrylAiCommandPalette>

Natural language, your words

The palette takes its resolver from DI — no Resolver parameter. Type “mark the invoice as paid” or “archive it”. Texts translates every word of the palette; switch the language to see it. This page runs on a scripted stand-in resolver, not a model.

An unhandled error has occurred. Reload x

Reconnecting to the server…

Attempt /

Next try in s