mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
refactor(plugins): consolidate record guards (#99361)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* Runtime validators for Codex app-server protocol payloads, including schema
|
||||
* normalization for generated JSON Schema before TypeBox compilation.
|
||||
*/
|
||||
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import { Compile, type Validator as TypeBoxValidator } from "typebox/compile";
|
||||
import dynamicToolCallParamsSchema from "./protocol-generated/json/DynamicToolCallParams.json" with { type: "json" };
|
||||
import errorNotificationSchema from "./protocol-generated/json/v2/ErrorNotification.json" with { type: "json" };
|
||||
@@ -40,10 +41,6 @@ function compileCodexSchema<T>(schema: unknown): CodexValidator<T> {
|
||||
};
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
||||
}
|
||||
|
||||
const schemaMapKeywords = new Set([
|
||||
"$defs",
|
||||
"definitions",
|
||||
|
||||
Reference in New Issue
Block a user