UNPKG

@artinet/sdk

Version:

A TypeScript SDK for building collaborative AI agents.

13 lines (12 loc) 393 B
/** * Copyright 2025 The Artinet Project * SPDX-License-Identifier: Apache-2.0 */ import { INVALID_PARAMS } from "./errors.js"; import { logger } from "../config/index.js"; export async function validateSchema(schema, data) { return await schema.parseAsync(data).catch((error) => { logger.error("Schema validation failed", error); throw INVALID_PARAMS(error); }); }