/** * Derive the public semantic accessor name from a declared list path. * * Keep this independent from path normalization: `result.data` may resolve to * `toolResponse.raw`, but its public getter remains `extractedLists.data`. */ export function listNameFromDeclaredPath(path: string): string | null { return ( String(path || '') .split('.') .filter(Boolean) .at(-1) ?.replace(/[^A-Za-z0-9_$]/g, '') || null ); }