Bin29's picture
Sync from main: e764154 feat(plot-skill): add math-exam-diagram SKILL.md for exam-style math figures
abcf568
export function buildAnnotatedFilename(filename?: string) {
const basename = filename?.trim().split(/[\\/]/).pop() || 'plot-preview.png';
const normalized = basename.replace(/\.[a-z0-9]+$/i, '');
return `${normalized}-annotated.png`;
}
export function summarizeImageSource(source: string) {
if (source.startsWith('data:')) {
const commaIndex = source.indexOf(',')
return {
kind: 'data-url',
mediaType: commaIndex > 0 ? source.slice(5, commaIndex).split(';')[0] : 'unknown',
length: source.length,
}
}
return source.length > 180 ? `${source.slice(0, 177)}...` : source
}