content updates

This commit is contained in:
overcuriousity 2025-08-07 23:10:14 +02:00
parent 824d98b3f4
commit 987f737122
4 changed files with 116780 additions and 112663 deletions

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); const rawData = load(yamlContent);
try { try {
console.log('Attempting to validate YAML structure...');
cachedData = ToolsDataSchema.parse(rawData); cachedData = ToolsDataSchema.parse(rawData);
console.log('Validation successful!');
if (!cachedData.skill_levels || Object.keys(cachedData.skill_levels).length === 0) { if (!cachedData.skill_levels || Object.keys(cachedData.skill_levels).length === 0) {
cachedData.skill_levels = { cachedData.skill_levels = {
@ -144,8 +146,18 @@ async function loadRawData(): Promise<ToolsData> {
console.log(`[DATA SERVICE] Loaded enhanced data version: ${dataVersion}`); console.log(`[DATA SERVICE] Loaded enhanced data version: ${dataVersion}`);
} catch (error) { } catch (error) {
console.error('YAML validation failed:', error); if (error instanceof z.ZodError) {
throw new Error('Invalid tools.yaml structure'); 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; return cachedData;