Agent config editorPro
System prompt, model, tools and parameters with versions, a word diff against production, and publish.
On this page
ProChanges against production in words and as a prompt diff, then publish.
Installation
Usage
import { AgentConfigEditor } from "@/components/ui/chatcn/pro/agent-config-editor"
<AgentConfigEditor value={draft} onValueChange={setDraft} versions={versions} models={models} tools={tools} onPublish={publish} />The footer says what changed against the version tagged Production, field by field, and the prompt diff shows the words added and removed. Publish says what it did; a failure says how to fix it. Load any version into the draft from the list.
Examples
States
ProMatches production, and a publish that fails with how to fix it.
Props
| Prop | Type | Notes |
|---|---|---|
value, onValueChange | AgentConfig | The controlled draft |
versions | AgentConfigVersion[] | Newest first, one tagged Production |
models, tools | Option lists | What the draft can choose from |
onPublish | (draft) => Promise<void> | Reject with a message to show it |
onRestore | (version) => void | Loads a version |
Accessibility
- Every field has a visible label. Tool chips are real checkboxes.
- Added and removed words carry hidden "added" and "removed" words, not only color.
- The publish result is a polite live region.