Optimizes ToolOutputMaskingService by skipping redundant serialization for already-masked items.
- Introduced a fast structural check early in the scan loop to detect and skip previously masked tool outputs using the isRecord type guard.
- Maintains canonical estimateTokenCountSync logic for unmasked items, ensuring consistency with project-wide token limits.
- Resolves the O(N^2) overhead identified in the issue with minimal risk of regression or logic drift.
- Explicitly supports array responses for masking.