mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 03:15:46 -06:00
refactor(plugins): make manifests own config ui hints (#121329)
This commit is contained in:
committed by
GitHub
parent
a6c410ef51
commit
620fcd0e27
@@ -28,7 +28,8 @@ describe("linux-node config", () => {
|
||||
});
|
||||
|
||||
it("exports the same strict shape through the plugin schema", () => {
|
||||
const safeParse = createLinuxNodePluginConfigSchema().safeParse;
|
||||
const schema = createLinuxNodePluginConfigSchema();
|
||||
const safeParse = schema.safeParse;
|
||||
if (!safeParse) {
|
||||
throw new Error("missing config schema validator");
|
||||
}
|
||||
@@ -37,5 +38,6 @@ describe("linux-node config", () => {
|
||||
unexpected: true,
|
||||
});
|
||||
expect(result.success).toBe(false);
|
||||
expect(schema).not.toHaveProperty("uiHints");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,22 +19,7 @@ export type ResolvedLinuxNodePluginConfig = {
|
||||
};
|
||||
|
||||
export function createLinuxNodePluginConfigSchema() {
|
||||
return buildPluginConfigSchema(LinuxNodePluginConfigSchema, {
|
||||
uiHints: {
|
||||
"notify.enabled": {
|
||||
label: "Desktop Notifications",
|
||||
help: "Expose system.notify when notify-send is installed. Enabled by default.",
|
||||
},
|
||||
"camera.enabled": {
|
||||
label: "Camera",
|
||||
help: "Expose camera commands when FFmpeg is installed. Requires a node service restart.",
|
||||
},
|
||||
"location.enabled": {
|
||||
label: "Location",
|
||||
help: "Expose location.get when the GeoClue where-am-i demo is installed. Requires a node service restart.",
|
||||
},
|
||||
},
|
||||
});
|
||||
return buildPluginConfigSchema(LinuxNodePluginConfigSchema);
|
||||
}
|
||||
|
||||
export function resolveLinuxNodePluginConfig(value: unknown): ResolvedLinuxNodePluginConfig {
|
||||
|
||||
Reference in New Issue
Block a user