UI

Builder

Single-card AI agent configuration studio with inline-editable name, portalled model picker, character-counted instructions, tool toggle grid, knowledge file uploads with progress and retry, zero-jump Test chat overlay, and versioned Publish tracking.

import { AgentBuilder } from '@uthereal/ui/agent-builder'

Agent builder playground

Support workspacev12
Agent builder view
ModelAnswers every conversation
353 / 2,000
Tools5 of 6 on
Knowledge
  • Refund policy 2026.pdf248 KBPDF
  • Plans and pricing, October 2026.md36 KBMD
  • Support macros.csv0%
All changes published

Loading interactive preview…

Overview

AgentBuilder combines agent setup and live testing inside a single card. The header pairs an inline-editable agent name (with workspace and version metadata) against a Configure / Test segmented switch. In Configure, teams select a model from a portalled radio menu, edit system instructions against a live character limit, toggle connected tools on or off, and attach knowledge files with animated progress bars, cancellation, and error retry.

Switching to Test overlays a compact chat playground in the exact same box—so the card height never jumps—letting builders test their unsaved setup with suggested prompts, shimmering tool-call chips, and chunked streaming replies. The footer compares the current configuration against publishedConfig, reports missing required fields or unsaved changes, and bumps the published version when Publish succeeds.

Use AgentBuilder for self-serve agent configuration screens, internal ops settings, and interactive product tours. For evaluating prompt or model regressions across a test suite, use Evaluation. For a marketplace of prebuilt agent templates, use Gallery.

Usage

'use client'
import { AgentBuilder, sampleAgentConfig } from '@uthereal/ui/agent-builder'

export function SupportAgentSettings() {
  return (
    <AgentBuilder
      defaultConfig={sampleAgentConfig}
      publishedConfig={sampleAgentConfig}
      onPublish={async (config, version) => {
        const res = await fetch('/api/agents/billing', {
          method: 'PUT',
          headers: { 'content-type': 'application/json' },
          body: JSON.stringify({ config, version }),
        })
        if (!res.ok) throw new Error('Server rejected the configuration')
      }}
      onUpload={async (file) => {
        const res = await fetch('/api/agents/billing/files', {
          method: 'POST',
          body: JSON.stringify({
            id: file.id,
            name: file.name,
            size: file.size,
          }),
        })
        if (!res.ok) return 'Upload rejected by storage service'
      }}
      onSend={async (message, config) => {
        const res = await fetch('/api/agents/billing/test', {
          method: 'POST',
          headers: { 'content-type': 'application/json' },
          body: JSON.stringify({ message, config }),
        })
        return res.json()
      }}
    />
  )
}

Leave onPublish, onUpload, or onSend out to run deterministic local simulations (built-in replies adapt dynamically to whichever tools and ready files are enabled, and files over 20 MB simulate an upload failure with retry).

Examples

Starting in the live Test playground

Set defaultMode="test" with ready knowledge files and all tools enabled to open directly on the interactive test chat with suggested prompts, tool-call chips, and chunked streaming.

Support workspacev14
Agent builder view
Claude Sonnet 5.56 tools2 files

Try Billing assistant

Replies use the model and tools you configured. Nothing is sent.

All changes published

Unsaved draft diff and upload error recovery

Pass both publishedConfig and a modified defaultConfig (plus a failed file entry) to show live Unsaved changes tracking against the published baseline, an active Publish button, and inline retry on failed knowledge uploads.

Support workspacev12
Agent builder view
ModelAnswers every conversation
200 / 2,000
Tools6 of 6 on
Knowledge
  • Refund policy 2026.pdf248 KBPDF
  • Plans and pricing, October 2026.md36 KBMD
  • Enterprise renewal archive.pdfExceeds the 20 MB upload limit — compress or retry.
Unsaved changes

Views and publish lifecycle

Configure and Test overlay

ViewControls and behavior
ConfigureSets the card height. Contains the model picker popover, character-counted instructions, two-column tool toggle grid, and animated knowledge list.
TestOverlays the Configure box (position: absolute; inset: 0). Streams replies using the current unsaved config; leaving Test stops any reply in flight.
StateConditionPublish button
All changes publishedconfigSignature(config) matches publishedConfig (uploading/failed files ignored).Disabled
Unsaved changesName, tint, model, instructions, enabled tools, or ready files differ from live.Enabled
Missing fieldName, instructions, or model is blank while dirty.Disabled
PublishingonPublish (or simulated 900ms wait) is in flight.Loading
ErroronPublish threw or resolved false; clears automatically on the next edit.Enabled

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
defaultConfigAgentBuilderConfig—Starting agent configuration when uncontrolled: name, tint, modelId, instructions, tools and files. Defaults to the billing assistant sample.
publishedConfigAgentBuilderConfig—The configuration that is live now. Unsaved changes are measured against it, so reverting an edit clears the unsaved state. Defaults to the starting configuration.
modelsAgentBuilderModel[]Default: [{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","note":"Balanced","mark":"claude"},{"id":"claude-opus-5-5","name":"Claude Opus 5.5","note":"Most capable","mark":"claude"},{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","note":"Fastest","mark":"claude"},{"id":"gpt-6-1-sol","name":"GPT-6.1 Sol","note":"OpenAI","mark":"openai"},{"id":"gemini-4-argon","name":"Gemini 4 Argon","note":"Google","mark":"gemini"}]Models in the picker as radio items with brand marks. Defaults to five October 2026 samples.
toolsAgentBuilderTool[]Default: [{"id":"gmail","name":"Gmail","description":"Read threads and draft replies","mark":"gmail"},{"id":"slack","name":"Slack","description":"Post in #support-escalations","mark":"slack"},{"id":"linear","name":"Linear","description":"Create and update issues","mark":"linear"},{"id":"notion","name":"Notion","description":"Search the help center","mark":"notion"},{"id":"calendar","name":"Google Calendar","description":"Book calls with the sales team","mark":"calendar"},{"id":"stripe","name":"Stripe","description":"Look up customers and charges","mark":"stripe"}]Tools the agent can be given, one toggle row each with an app mark. Defaults to Gmail, Slack, Linear, Notion, Google Calendar and Stripe.
versionintegerDefault: 12Published version shown under the name. Counts up after each successful publish.
workspacestringDefault: "Support workspace"Short line under the name, such as the workspace or team. Defaults to Support workspace.
maxInstructionsintegerDefault: 2000Instruction length limit. The count turns to the warning color past 90 percent.
acceptstringDefault: ".pdf,.md,.txt,.csv,.docx,.html"Accepted knowledge file types for the file picker, as an accept attribute.
defaultModeconfigure | testDefault: "configure"Starting view when the mode is uncontrolled: Configure or Test.
publishActionstring—Registered host action requested when the configuration is published.
sendActionstring—Registered host action requested when a Test message is sent.
recipestudio | softDefault: "studio"Visual treatment. Both recipes preserve interaction behavior.
themeAgentBuilderThemeDefault: {}Color mode, accent, and typed semantic token overrides.
motionnone | subtle | expressiveDefault: "subtle"Animation preset. System reduced-motion preferences take precedence.
motionOptionsAgentBuilderMotionOptionsDefault: {}File row reflow and text swap timing overrides in milliseconds.
dirltr | rtl—Reading direction; inherited from the page when omitted.
  • AgentBuilderConfig accepts { name, tint: 1 | 2 | 3 | 4, modelId, instructions, tools: string[], files: AgentBuilderFile[] }.
  • AgentBuilderModel accepts { id, name, note?, mark?: 'claude' | 'openai' | 'gemini' }.
  • AgentBuilderTool accepts { id, name, description, mark?: 'gmail' | 'slack' | 'linear' | 'notion' | 'calendar' | 'stripe' }.
  • AgentBuilderFile accepts { id, name, size, status: 'uploading' | 'ready' | 'error', progress?, error? }.

React integration

PropPurpose
config / onConfigChange(config)Controlled configuration pair. onConfigChange fires on every name, model, instruction, tool, and file edit in both controlled and uncontrolled modes.
mode / onModeChange(mode)Controlled 'configure' | 'test' view pair.
onPublish(config, version)Persists the configuration. Resolve true/undefined to bump the version and clear dirty state; resolve false or reject to show the error state.
onUpload(file)Handles a newly added knowledge file. Resolve undefined for ready or return an error string to mark the row failed with retry.
onSend(message, config)Answers a Test prompt with { text, calls?: { tool, label, result? }[] }. Match tool to a tool ID or 'knowledge' for its mark.
onAction(action)Called with publishAction on publish or sendAction when a Test message is sent.
presetApplication defaults overridden by explicit instance arguments.
tokensCSS variables applied after the typed theme on both the card root and the portalled model menu.
ref, className, styleApplied to the root <section> element.
Native attributesid, aria-*, data-*, and remaining <section> props forwarded to the root element.

Keyboard & accessibility

KeyAction
TabMoves through the name field, view switch, active view controls, and Publish; the hidden view is inert.
Enter (in name)Commits the inline agent name edit and blurs the field.
Escape (in name / menu)Restores the previous agent name on blur, or closes the model picker and returns focus to the trigger.
ArrowUp / ArrowDownNavigates radio items in the open model menu; Home and End jump to the first and last model.
ArrowLeft / ArrowRightSwitches between Configure and Test on the view control (respects RTL).
Enter (in Test composer)Sends the prompt, or stops an in-flight reply when the submit button is in its Stop state.
  • The inactive view carries inert, aria-hidden="true", and pointer-events: none, so neither keyboard navigation nor pointer clicks can reach hidden controls.
  • Every tool row wraps its icon, name, and description in a <label> linked to its Switch, making the full 52px row clickable.
  • Knowledge file uploads expose role="progressbar" with live aria-valuenow percentages; errors pair an alert icon with explicit failure text and a labelled Retry button.
  • A pre-mounted polite role="status" live region announces publish outcomes, upload completions or cancellations, cleared conversations, and completed Test replies.
  • Container queries split tools into two columns from 560px, tighten padding and model trigger width below 480px, and wrap the Configure / Test switch below 300px. Logical CSS and @media (forced-colors: active) preserve borders, progress bars, and focus outlines across RTL and high-contrast modes.

Motion & theming

Configure and Test crossfade in place (160ms) while version numbers, model names, and footer statuses swap with a 2px rise. Knowledge file rows animate height on a zero-overshoot smooth spring, while Test replies stream in 3–6 word chunks (34ms cadence) after shimmering tool chips settle.

Under prefers-reduced-motion: reduce, height animations, rises, button press scaling, and chunked streaming turn off (Test replies appear whole) while view and status crossfades keep 120ms opacity fades. Setting motion="none" makes every transition immediate (0ms).

theme accepts mode, accent, and typed tokens across these groups:

Token groupCSS custom properties
core--ui-surface, --ui-surface-raised, --ui-text, --ui-text-secondary, --ui-muted, --ui-border, --ui-highlight, --ui-accent, --ui-accent-foreground, --ui-danger, --ui-focus-ring, --ui-radius, --ui-border-width, --ui-shadow, --ui-disabled-opacity, --ui-font, --ui-font-size, --ui-font-weight
extended--ui-surface-sunken, --ui-border-strong, --ui-border-subtle, --ui-track, --ui-info, --ui-success, --ui-warning, --ui-tone-foreground, --ui-overlay, --ui-tint-strength
shape--ui-radius-sm, --ui-popup-radius, --ui-surface-radius
accentTones--ui-accent-strong, --ui-accent-subtle
popupList--ui-item-radius, --ui-popup-padding, --ui-popup-min-width, --ui-popup-max-width, --ui-item-height, --ui-item-padding-x, --ui-item-padding-y, --ui-item-gap, --ui-shortcut-size
include--ui-shadow-resting, --ui-shadow, --ui-series-1, --ui-series-2, --ui-series-3, --ui-series-4 (Test avatar tints)

An application-wide UtherealProvider supplies defaults.

Composition

In an agent composition, AgentBuilder is a leaf block. Keep model, tool, and file IDs unique, match defaultConfig.modelId to an entry in models, and bind publishAction and sendAction to registered host actions. See Building with agents.

{
  "type": "AgentBuilder",
  "props": {
    "workspace": "Support workspace",
    "version": 12,
    "defaultMode": "configure",
    "publishAction": "publish_agent",
    "sendAction": "test_agent_message"
  },
  "children": []
}

On this page