main #11

Merged
mstoeck3 merged 66 commits from main into forensic-ai 2025-08-11 12:02:56 +00:00
4 changed files with 116780 additions and 112663 deletions
Showing only changes of commit 987f737122 - Show all commits

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -128,7 +128,9 @@ async function loadRawData(): Promise<ToolsData> {
const rawData = load(yamlContent);
try {
console.log('Attempting to validate YAML structure...');
cachedData = ToolsDataSchema.parse(rawData);
console.log('Validation successful!');
if (!cachedData.skill_levels || Object.keys(cachedData.skill_levels).length === 0) {
cachedData.skill_levels = {
@ -144,8 +146,18 @@ async function loadRawData(): Promise<ToolsData> {
console.log(`[DATA SERVICE] Loaded enhanced data version: ${dataVersion}`);
} catch (error) {
console.error('YAML validation failed:', error);
throw new Error('Invalid tools.yaml structure');
if (error instanceof z.ZodError) {
console.error('ToolsDataSchema validation errors:');
error.errors.forEach((err, index) => {
console.error(`${index + 1}. Path: ${err.path.join('.')}, Error: ${err.message}`);
if (err.input !== undefined) {
console.error(` Received:`, typeof err.input === 'object' ? JSON.stringify(err.input, null, 2) : err.input);
}
});
} else {
console.error('Non-Zod validation error:', error);
}
throw new Error(`Invalid tools.yaml structure: ${error}`);
}
}
return cachedData;