Files
paperclip/ui/src/adapters/openclaw/config-fields.tsx
Forgotten b0f3f04ac6 feat: add OpenClaw adapter type
Introduce openclaw adapter package with server execution, CLI stream
formatting, and UI config fields. Register the adapter across CLI,
server, and UI registries. Add adapter label in all relevant pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:32:59 -06:00

54 lines
1.4 KiB
TypeScript

import type { AdapterConfigFieldsProps } from "../types";
import {
Field,
DraftInput,
help,
} from "../../components/agent-config-primitives";
const inputClass =
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
export function OpenClawConfigFields({
isCreate,
values,
set,
config,
eff,
mark,
}: AdapterConfigFieldsProps) {
return (
<>
<Field label="Webhook URL" hint={help.webhookUrl}>
<DraftInput
value={
isCreate
? values!.url
: eff("adapterConfig", "url", String(config.url ?? ""))
}
onCommit={(v) =>
isCreate
? set!({ url: v })
: mark("adapterConfig", "url", v || undefined)
}
immediate
className={inputClass}
placeholder="https://..."
/>
</Field>
{!isCreate && (
<Field label="Webhook auth header (optional)">
<DraftInput
value={
eff("adapterConfig", "webhookAuthHeader", String(config.webhookAuthHeader ?? ""))
}
onCommit={(v) => mark("adapterConfig", "webhookAuthHeader", v || undefined)}
immediate
className={inputClass}
placeholder="Bearer <token>"
/>
</Field>
)}
</>
);
}