fix(config): validate parsed TOML against ConfigSchema at runtime
Amolith
and
Shelley
created
Export ConfigSchema and PartialConfigSchema from schema.ts.
Use TypeBox Value.Check/Value.Errors in loader.ts to validate
parsed TOML before merging with defaults, and validate the
merged result against the full schema. Invalid config now throws
ConfigError with path, expected type, and actual value for each
violation.
Closes review issue #3.
Co-authored-by: Shelley <shelley@exe.dev>
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later
-import { Type, Kind, type Static, type TObject, type TProperties } from "@sinclair/typebox";
+import { Kind, Type, type Static, type TObject, type TProperties } from "@sinclair/typebox";
const CustomModelSchema = Type.Object({
provider: Type.String(),