@@ -257,7 +257,7 @@ const MAX_CONTENT_EXTRACTION_DEPTH = 10;
257257 *
258258 * @param value Arbitrary content value (string, array, or object) to inspect.
259259 * @param depth Current recursion depth, used to guard against circular structures.
260- * @param filterByType When true, only content parts with recognised text types are returned.
260+ * @param filterByType When true, only content parts with recognized text types are returned.
261261 * @returns The extracted text, or an empty string when no text is found.
262262 */
263263function extractTextFromValue ( value : unknown , depth : number , filterByType : boolean ) : string {
@@ -283,10 +283,10 @@ function extractTextFromValue(value: unknown, depth: number, filterByType: boole
283283 if ( value && typeof value === 'object' ) {
284284 const record = value as Record < string , unknown > ;
285285 const typeValue = typeof record . type === 'string' ? record . type : null ;
286- const isRecognisedTextType = typeValue ? TEXTUAL_CONTENT_TYPES . has ( typeValue ) : false ;
286+ const isRecognizedTextType = typeValue ? TEXTUAL_CONTENT_TYPES . has ( typeValue ) : false ;
287287
288288 if ( typeof record . text === 'string' ) {
289- if ( ! filterByType || isRecognisedTextType ) {
289+ if ( ! filterByType || isRecognizedTextType ) {
290290 return record . text . trim ( ) ;
291291 }
292292 }
@@ -305,8 +305,8 @@ function extractTextFromValue(value: unknown, depth: number, filterByType: boole
305305/**
306306 * Extract text from structured content parts (e.g., the `content` field on a message).
307307 *
308- * Only recognised textual content-part types are considered to match the behaviour of
309- * `ContentUtils.filterToTextOnly`, ensuring non-text modalities are ignored.
308+ * Only textual content-part types enumerated in TEXTUAL_CONTENT_TYPES are considered so
309+ * that non-text modalities (images, tools, etc.) remain ignored.
310310 */
311311function extractTextFromContentParts ( content : unknown , depth = 0 ) : string {
312312 return extractTextFromValue ( content , depth , true ) ;
0 commit comments