import type { JsonSchemaObject } from "../shared/json-schema.types.js"; import type { PluginConfigUiHint } from "./manifest-types.js"; type PluginConfigValidation = { ok: true; value?: unknown } | { ok: false; errors: string[] }; /** * Config schema contract accepted by plugin manifests and runtime registration. * * Plugins can provide a Zod-like parser, a lightweight `validate(...)` * function, or both. `uiHints` and `jsonSchema` are optional extras for docs, * forms, and config UIs. */ export type OpenClawPluginConfigSchema = { safeParse?: (value: unknown) => { success: boolean; data?: unknown; error?: { issues?: Array<{ path: Array; message: string }>; }; }; parse?: (value: unknown) => unknown; validate?: (value: unknown) => PluginConfigValidation; uiHints?: Record; jsonSchema?: JsonSchemaObject; };