mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
refactor(plugins): make manifests own config ui hints (#121329)
This commit is contained in:
committed by
GitHub
parent
a6c410ef51
commit
620fcd0e27
@@ -17,12 +17,14 @@ type ZodSchemaWithToJsonSchema = ZodTypeAny & {
|
||||
};
|
||||
|
||||
type BuildPluginConfigSchemaOptions = {
|
||||
/** @deprecated Declare top-level `uiHints` in `openclaw.plugin.json`. */
|
||||
uiHints?: Record<string, PluginConfigUiHint>;
|
||||
safeParse?: OpenClawPluginConfigSchema["safeParse"];
|
||||
};
|
||||
|
||||
type BuildJsonPluginConfigSchemaOptions = {
|
||||
cacheKey?: string;
|
||||
/** @deprecated Declare top-level `uiHints` in `openclaw.plugin.json`. */
|
||||
uiHints?: Record<string, PluginConfigUiHint>;
|
||||
safeParse?: OpenClawPluginConfigSchema["safeParse"];
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ type PluginConfigValidation = { ok: true; value?: unknown } | { ok: false; error
|
||||
* 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.
|
||||
* function, or both. `jsonSchema` is optional runtime schema metadata.
|
||||
*/
|
||||
export type OpenClawPluginConfigSchema = {
|
||||
safeParse?: (value: unknown) => {
|
||||
@@ -20,6 +19,11 @@ export type OpenClawPluginConfigSchema = {
|
||||
};
|
||||
parse?: (value: unknown) => unknown;
|
||||
validate?: (value: unknown) => PluginConfigValidation;
|
||||
/**
|
||||
* @deprecated Declare config presentation metadata in the plugin's
|
||||
* `openclaw.plugin.json` manifest via top-level `uiHints`. The host reads
|
||||
* manifest hints and does not consume runtime config-schema hints.
|
||||
*/
|
||||
uiHints?: Record<string, PluginConfigUiHint>;
|
||||
jsonSchema?: JsonSchemaObject;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user