refactor: type config schemas as typebox-compatible

This commit is contained in:
Peter Steinberger
2026-04-23 05:22:01 +01:00
parent cf1e48672b
commit 4ad8ed2cbe
16 changed files with 39 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
import fs from "node:fs";
import AjvPkg from "ajv";
import { describe, expect, it } from "vitest";
import type { JsonSchemaObject } from "../../../src/shared/json-schema.types.js";
import {
DEFAULT_WIKI_RENDER_MODE,
DEFAULT_WIKI_SEARCH_BACKEND,
@@ -13,7 +14,7 @@ import {
function compileManifestConfigSchema() {
const manifest = JSON.parse(
fs.readFileSync(new URL("../openclaw.plugin.json", import.meta.url), "utf8"),
) as { configSchema: Record<string, unknown> };
) as { configSchema: JsonSchemaObject };
const Ajv = AjvPkg as unknown as new (opts?: object) => import("ajv").default;
const ajv = new Ajv({ allErrors: true, strict: false, useDefaults: true });
return ajv.compile(manifest.configSchema);