feat(jlcpcb): warn when downloaded catalog is stale (#199)
Per review feedback: CDFER's upstream scraper pipeline has stalled for weeks (broken cart API + a bug in their scraper), so a "fresh download" can still be old data. Compute the catalog age from the source Last-Modified header, expose catalog_age_days, and emit a stale=True + warning when older than 14 days that points users to source='yaqwsx' (fresh, needs 7z) or source='official'. Surface the warning in the MCP tool output. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,13 +41,18 @@ provider. Re-run with force=true to refresh.`,
|
||||
`✓ Successfully downloaded JLCPCB parts database\n\n` +
|
||||
`Source: ${result.source}\n` +
|
||||
(result.catalog_last_modified
|
||||
? `Catalog dated: ${result.catalog_last_modified}\n`
|
||||
? `Catalog dated: ${result.catalog_last_modified}` +
|
||||
(typeof result.catalog_age_days === "number"
|
||||
? ` (~${result.catalog_age_days} days old)`
|
||||
: "") +
|
||||
`\n`
|
||||
: "") +
|
||||
`Total parts: ${result.total_parts}\n` +
|
||||
`Basic parts: ${result.basic_parts}\n` +
|
||||
`Extended parts: ${result.extended_parts}\n` +
|
||||
`Database size: ${result.db_size_mb} MB\n` +
|
||||
`Database path: ${result.db_path}`,
|
||||
`Database path: ${result.db_path}` +
|
||||
(result.warning ? `\n\n⚠ ${result.warning}` : ""),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user