content updates
This commit is contained in:
parent
824d98b3f4
commit
987f737122
File diff suppressed because one or more lines are too long
228590
data/embeddings.json
228590
data/embeddings.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user