/** Display labels only; never use these as executable file paths. */ export function conciseToolPath(value: string): string { const path = value.replace(/\\/g, '/'); const name = path.split('/').filter(Boolean).at(-1) ?? value; const archive = path.match(/(?:^|\/)\.minimal-agent\/tool-results\/[a-f0-9]{24}\/([a-f0-9]{8})-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\.txt$/i); if (archive) return `工具结果 · ${archive[1]}`; const chars = Array.from(name); return chars.length > 64 ? `${chars.slice(0, 40).join('')}…${chars.slice(-20).join('')}` : name; }