Repository: WebKit/WebKit
Pull request #44293: [Writing Tools] Support compiling ENABLE_WRITING_TOOLS on the public SDK (Part 1)
Author: login: rr-codes
Labels: name: New Bugs
description: Unclassified bugs are placed in this component until the correct component can be determined.
Created: 2025-04-19T17:13:15Z | Merged: 2025-04-19T21:39:09Z

#### b504fc6a69adc63580f2c647dd2cff39a6a448fb
<pre>
[Writing Tools] Support compiling ENABLE_WRITING_TOOLS on the public SDK (Part 1)
<a href="https://bugs.webkit.org/show_bug.cgi?id=291790">https://bugs.webkit.org/show_bug.cgi?id=291790</a>
<a href="https://rdar.apple.com/149610431">rdar://149610431</a>

Reviewed by Abrar Rahman Protyasha.

Work towards making it possible to compile ENABLE_WRITING_TOOLS on the public SDK. This is the first
part of a series of commits.

In this PR, declare all the symbols of WritingTools and WritingToolsUI that WebKit uses when building
using the public SDK.

* Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h:

Add the symbols from WritingTools that WebKit uses. Also adds missing includes.

* Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h:

Add the symbols from WritingToolsUI that WebKit uses. Also adds missing includes.

Canonical link: <a href="https://commits.webkit.org/293897@main">https://commits.webkit.org/293897@main</a>
</pre>
<!--EWS-Status-Bubble-Start-->
https://github.com/WebKit/WebKit/commit/887344fe973e4b15f12418d43c11c260feb92f13

| Misc | iOS, visionOS, tvOS & watchOS  | macOS  | Linux |  Windows |
| ----- | ---------------------- | ------- |  ----- |  --------- |
| [✅ 🧪 style](https://ews-build.webkit.org/#/builders/38/builds/100223 "Passed style check") | [✅ 🛠 ios](https://ews-build.webkit.org/#/builders/131/builds/19872 "Built successfully") | [✅ 🛠 mac](https://ews-build.webkit.org/#/builders/138/builds/10170 "Built successfully") | [✅ 🛠 wpe](https://ews-build.webkit.org/#/builders/5/builds/105353 "Built successfully") | [✅ 🛠 win](https://ews-build.webkit.org/#/builders/59/builds/50806 "Built successfully") 
| [✅ 🧪 bindings](https://ews-build.webkit.org/#/builders/9/builds/102264 "Passed tests") | [✅ 🛠 ios-sim](https://ews-build.webkit.org/#/builders/130/builds/20177 "Built successfully") | [✅ 🛠 mac-AS-debug](https://ews-build.webkit.org/#/builders/123/builds/28346 "Built successfully") | [✅ 🧪 wpe-wk2](https://ews-build.webkit.org/#/builders/34/builds/76301 "Passed tests") | [✅ 🧪 win-tests](https://ews-build.webkit.org/#/builders/60/builds/33360 "Passed tests") 
| [✅ 🧪 webkitperl](https://ews-build.webkit.org/#/builders/11/builds/103230 "Passed tests") | [✅ 🧪 ios-wk2](https://ews-build.webkit.org/#/builders/132/builds/15429 "Passed tests") | [✅ 🧪 api-mac](https://ews-build.webkit.org/#/builders/18/builds/90524 "Passed tests") | [✅ 🧪 api-wpe](https://ews-build.webkit.org/#/builders/41/builds/56661 "Passed tests") | 
| | [✅ 🧪 ios-wk2-wpt](https://ews-build.webkit.org/#/builders/133/builds/15249 "Passed tests") | [✅ 🧪 mac-wk1](https://ews-build.webkit.org/#/builders/135/builds/8523 "Passed tests") | [✅ 🛠 wpe-cairo](https://ews-build.webkit.org/#/builders/65/builds/50174 "Built successfully") | 
| | [✅ 🧪 api-ios](https://ews-build.webkit.org/#/builders/13/builds/85156 "Passed tests") | [✅ 🧪 mac-wk2](https://ews-build.webkit.org/#/builders/136/builds/8605 "Passed tests") | [✅ 🛠 gtk](https://ews-build.webkit.org/#/builders/2/builds/107712 "Built successfully") | 
| | [✅ 🛠 vision](https://ews-build.webkit.org/#/builders/128/builds/27336 "Built successfully") | [✅ 🧪 mac-AS-debug-wk2](https://ews-build.webkit.org/#/builders/122/builds/20031 "Passed tests") | [✅ 🧪 gtk-wk2](https://ews-build.webkit.org/#/builders/1/builds/85254 "Passed tests") | 
| | [✅ 🛠 vision-sim](https://ews-build.webkit.org/#/builders/121/builds/27699 "Built successfully") | [✅ 🧪 mac-wk2-stress](https://ews-build.webkit.org/#/builders/8/builds/86731 "Passed tests") | [✅ 🧪 api-gtk](https://ews-build.webkit.org/#/builders/21/builds/84793 "Passed tests") | 
| [✅ 🛠 🧪 merge](https://ews-build.webkit.org/#/builders/19/builds/21547 "Built successfully and passed tests") | [✅ 🧪 vision-wk2](https://ews-build.webkit.org/#/builders/126/builds/29472 "Passed tests") | [✅ 🧪 mac-intel-wk2](https://ews-build.webkit.org/#/builders/137/builds/7207 "Passed tests") | [✅ 🛠 playstation](https://ews-build.webkit.org/#/builders/134/builds/21205 "Built successfully") | 
| | [✅ 🛠 tv](https://ews-build.webkit.org/#/builders/127/builds/27273 "Built successfully") | [✅ 🛠 mac-safer-cpp](https://ews-build.webkit.org/#/builders/120/builds/32506 "Built successfully") | | 
| | [✅ 🛠 tv-sim](https://ews-build.webkit.org/#/builders/125/builds/27084 "Built successfully") | | | 
| | [✅ 🛠 watch](https://ews-build.webkit.org/#/builders/129/builds/30400 "Built successfully") | | | 
| | [✅ 🛠 watch-sim](https://ews-build.webkit.org/#/builders/124/builds/28643 "Built successfully") | | | 
<!--EWS-Status-Bubble-End-->


Diff:
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
index 5cb469108a07..35fb9b573f0d 100644
--- a/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
+++ b/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
@@ -25,6 +25,9 @@
 
 #pragma once
 
+#import <wtf/Compiler.h>
+#import <wtf/Platform.h>
+
 DECLARE_SYSTEM_HEADER
 
 #if ENABLE(WRITING_TOOLS)
@@ -34,25 +37,156 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
+
+typedef NS_ENUM(NSInteger, WTSessionType) {
+    WTSessionTypeProofreading = 1,
+    WTSessionTypeComposition,
+};
+
+@interface WTSession : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+@property (nonatomic, readonly) WTSessionType type;
+
+@property (nonatomic, weak) id<WTTextViewDelegate> textViewDelegate;
+
+@property (nonatomic) WTCompositionSessionType compositionSessionType;
+@property (nonatomic, readonly) WTRequestedTool requestedTool;
+
+- (instancetype)initWithType:(WTSessionType)type textViewDelegate:(id<WTTextViewDelegate>)textViewDelegate;
+
+@end
+
+// MARK: WTTextSuggestion
+
+typedef NS_ENUM(NSInteger, WTTextSuggestionState) {
+    WTTextSuggestionStatePending = 0,
+    WTTextSuggestionStateReviewing = 1,
+    WTTextSuggestionStateRejected = 3,
+    WTTextSuggestionStateInvalid = 4,
+};
+
+@interface WTTextSuggestion : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSRange originalRange;
+
+@property (nonatomic, readonly) NSString *replacement;
 
+@property (nonatomic) WTTextSuggestionState state;
+
+- (instancetype)initWithOriginalRange:(NSRange)originalRange replacement:(NSString *)replacement;
+
+@end
+
+// MARK: WTTextViewDelegate
+
+@protocol WTTextViewDelegate
+
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID updateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)suggestionUUID;
+
+#if PLATFORM(IOS_FAMILY)
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(CGRect)rect inView:(UIView *)sourceView;
 #else
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(NSRect)rect inView:(NSView *)sourceView;
+#endif
+
+@end
+
+// MARK: WTWritingToolsDelegate
+
+@protocol WTWritingToolsDelegate
+
+- (void)willBeginWritingToolsSession:(WTSession *)session requestContexts:(void (^)(NSArray<WTContext *> *contexts))completion;
+
+- (void)didBeginWritingToolsSession:(WTSession *)session contexts:(NSArray<WTContext *> *)contexts;
+
+typedef NS_ENUM(NSInteger, WTAction) {
+    WTActionShowOriginal = 1,
+    WTActionShowRewritten,
+    WTActionCompositionRestart,
+    WTActionCompositionRefine,
+};
+
+- (void)writingToolsSession:(WTSession *)session didReceiveAction:(WTAction)action;
+
+- (void)didEndWritingToolsSession:(WTSession *)session accepted:(BOOL)accepted;
+
+- (void)proofreadingSession:(WTSession *)session didReceiveSuggestions:(NSArray<WTTextSuggestion *> *)suggestions processedRange:(NSRange)range inContext:(WTContext *)context finished:(BOOL)finished;
+
+- (void)proofreadingSession:(WTSession *)session didUpdateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)uuid inContext:(WTContext *)context;
+
+- (void)compositionSession:(WTSession *)session didReceiveText:(NSAttributedString *)attributedText replacementRange:(NSRange)range inContext:(WTContext *)context finished:(BOOL)finished;
+
+@end
 
-#import <UIKit/UIKit.h>
+#endif // USE(APPLE_INTERNAL_SDK)
+
+// MARK: Platform-agnostic types.
+
+#if PLATFORM(IOS_FAMILY)
 
 using PlatformWritingToolsBehavior = UIWritingToolsBehavior;
 
@@ -68,12 +202,22 @@ constexpr auto PlatformWritingToolsResultRichText = UIWritingToolsResultRichText
 constexpr auto PlatformWritingToolsResultList = UIWritingToolsResultList;
 constexpr auto PlatformWritingToolsResultTable = UIWritingToolsResultTable;
 
-#endif
-
 #else
 
-#error Symbols must be forward declared once used with non-internal SDKS.
+using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
 
-#endif // USE(APPLE_INTERNAL_SDK)
+constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
+constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
+constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
+constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+
+using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+
+constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
+constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
+constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
+constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+
+#endif // PLATFORM(IOS_FAMILY)
 
 #endif // ENABLE(WRITING_TOOLS)
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h b/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h
index 06f39e158bef..f4fd67e69be6 100644
--- a/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h
+++ b/Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h
@@ -25,6 +25,9 @@
 
 #pragma once
 
+#import <wtf/Compiler.h>
+#import <wtf/Platform.h>
+
 DECLARE_SYSTEM_HEADER
 
 #if ENABLE(WRITING_TOOLS) && PLATFORM(MAC)
@@ -36,8 +39,178 @@ DECLARE_SYSTEM_HEADER
 
 #else
 
-#error Symbols must be forward declared once used with non-internal SDKS.
+#import <CoreGraphics/CoreGraphics.h>
+
+// MARK: Forward-declared Writing Tools types
+
+typedef NS_ENUM(NSInteger, WTRequestedTool);
+
+@protocol WTWritingToolsDelegate;
+
+// MARK: _WTTextChunk
+
+@interface _WTTextChunk : NSObject
+
+@property (readonly) NSString *identifier;
+
+- (instancetype)initChunkWithIdentifier:(NSString *)identifier;
+
+@end
+
+// MARK: _WTTextPreview
+
+@interface _WTTextPreview : NSObject
+
+@property (readonly) CGImageRef previewImage;
+
+@property (readonly) CGPathRef contentPath;
+
+@property (readonly) CGRect presentationFrame;
+
+@property (readonly) CGColorRef backgroundColor;
+
+@property (readonly) CGPathRef clippingPath;
+
+@property (readonly) CGFloat scale;
+
+@property (readonly) NSArray <NSValue *> *candidateRects;
+
+- (instancetype)initWithSnapshotImage:(CGImageRef)snapshotImage presentationFrame:(CGRect)presentationFrame;
+
+- (instancetype)initWithSnapshotImage:(CGImageRef)snapshotImage presentationFrame:(CGRect)presentationFrame backgroundColor:(CGColorRef)backgroundColor clippingPath:(CGPathRef)clippingPath scale:(CGFloat)scale;
+
+- (instancetype)initWithSnapshotImage:(CGImageRef)snapshotImage presentationFrame:(CGRect)presentationFrame backgroundColor:(CGColorRef)backgroundColor clippingPath:(CGPathRef)clippingPath scale:(CGFloat)scale candidateRects:(NSArray <NSValue *> *)candidateRects;
+
+@end
+
+// MARK: _WTTextPreviewAsyncSource
+
+@protocol _WTTextPreviewAsyncSource <NSObject>
+
+- (void)textPreviewsForChunk:(nonnull _WTTextChunk *)chunk completion:(void (^_Nullable)(NSArray <_WTTextPreview *> * _Nullable previews))completion;
+
+- (void)textPreviewForRect:(CGRect)rect completion:(void (^_Nullable)(_WTTextPreview * _Nullable preview))completion;
+
+- (void)updateIsTextVisible:(BOOL)isTextVisible forChunk:(nonnull _WTTextChunk *)chunk completion:(void (^_Nullable)(void))completion;
+
+@end
+
+// MARK: _WTTextEffect and subclasses
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class _WTTextEffectView;
+
+@protocol _WTTextEffect <NSObject>
+
+@property (strong) _WTTextChunk *chunk;
+
+@property (strong) _WTTextEffectView *effectView;
+
+@property (strong) NSUUID *identifier;
+
+- (void)invalidate:(BOOL)animated;
+
+@optional
+
+- (BOOL)hidesOriginal;
+
+@property (copy, nullable) void (^completion)(void);
+
+@property (copy, nullable) void (^preCompletion)(void);
+
+@end
+
+@interface _WTTextEffect : NSObject <_WTTextEffect>
+
+@property (strong) _WTTextChunk  *chunk;
+
+@property (strong) _WTTextEffectView *effectView;
+
+@property (strong) NSUUID *identifier;
+
+@property BOOL hidesOriginal;
+
+@property (copy, nullable) void (^completion)(void);
+
+@property (copy, nullable) void (^preCompletion)(void);
+
+- (instancetype)initWithChunk:(_WTTextChunk *)chunk effectView:(_WTTextEffectView *)effectView;
+
+- (void)invalidate:(BOOL)animated;
+
+@end
+
+@interface _WTSweepTextEffect : _WTTextEffect
+
+@end
+
+@interface _WTReplaceTextEffect : _WTTextEffect
+
+@property (assign) BOOL animateRemovalWhenDone;
+
+@property BOOL isDestination;
+
+@property BOOL highlightsCandidateRects;
+
+@end
+
+@interface _WTReplaceSourceTextEffect : _WTReplaceTextEffect
+@end
+
+@interface _WTReplaceDestinationTextEffect : _WTReplaceSourceTextEffect
+@end
+
+NS_ASSUME_NONNULL_END
+
+// MARK: WTWritingToolsViewController
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface WTWritingToolsViewController
+
+@property (class, assign, readonly, getter=isAvailable) BOOL available;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+// MARK: WTWritingTools
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface WTWritingTools : NSObject
+
++ (instancetype)sharedInstance;
+
+- (void)showTool:(WTRequestedTool)requestedTool forSelectionRect:(NSRect)selectionRect ofView:(NSView *)positioningView forDelegate:(NSObject<WTWritingToolsDelegate> *)writingToolsDelegate;
+
+- (void)scheduleShowAffordanceForSelectionRect:(NSRect)selectionRect ofView:(NSView *)positioningView forDelegate:(NSObject<WTWritingToolsDelegate> *)writingToolsDelegate;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+// MARK: _WTTextEffectView
+
+@interface _WTTextEffectView : NSView
+
+@property (weak) id <_WTTextPreviewAsyncSource> asyncSource;
+
+- (instancetype)initWithAsyncSource:(id <_WTTextPreviewAsyncSource>)asyncSource;
+
+- (NSUUID *)addEffect:(_WTTextEffect *)effect;
+
+- (_WTTextChunk *)removeEffect:(NSUUID *)effectID;
+- (_WTTextChunk *)removeEffect:(NSUUID *)effectID animated:(BOOL)animated;
+
+- (void)removeAllEffects;
+
+- (BOOL)hasActiveEffects;
+- (BOOL)hasActiveEffect:(NSUUID *)effectID;
+
+@end
 
-#endif
+#endif // USE(APPLE_INTERNAL_SDK)
 
 #endif // ENABLE(WRITING_TOOLS) && PLATFORM(MAC)


Reviews:
user: login: aprotyas
body: Looked at WritingToolsSPI.h so far. It looks like we can omit some enum cases and interface properties since we're not referring to them.
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-19T18:39:23Z
user: login: rr-codes
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-19T19:21:33Z
user: login: rr-codes
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-19T19:22:40Z
user: login: rr-codes
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-19T19:23:04Z
user: login: aprotyas
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-19T20:43:11Z

Review comments:
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: aprotyas
body: I think we're not referring to most of these symbols directly, right? Do you want to pare down the list? And a couple are only used in API tests, so maybe those can just be bespoke forward declared in `Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm`?
created_at: 2025-04-19T18:34:16Z
author_association: MEMBER
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: aprotyas
body: Same with these cases, many are not referred to directly in our project
created_at: 2025-04-19T18:35:38Z
author_association: MEMBER
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
+
+typedef NS_ENUM(NSInteger, WTSessionType) {
+    WTSessionTypeProofreading = 1,
+    WTSessionTypeComposition,
+};
+
+@interface WTSession : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+@property (nonatomic, readonly) WTSessionType type;
+
+@property (nonatomic, weak) id<WTTextViewDelegate> textViewDelegate;
+
+@property (nonatomic) WTCompositionSessionType compositionSessionType;
+@property (nonatomic, readonly) WTRequestedTool requestedTool;
+
+- (instancetype)initWithType:(WTSessionType)type textViewDelegate:(id<WTTextViewDelegate>)textViewDelegate;
+
+@end
+
+// MARK: WTTextSuggestion
+
+typedef NS_ENUM(NSInteger, WTTextSuggestionState) {
+    WTTextSuggestionStatePending = 0,
+    WTTextSuggestionStateReviewing = 1,
+    WTTextSuggestionStateRejected = 3,
+    WTTextSuggestionStateInvalid = 4,
+};
+
+@interface WTTextSuggestion : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSRange originalRange;
+
+@property (nonatomic, readonly) NSString *replacement;
+
+@property (nonatomic) WTTextSuggestionState state;
+
+- (instancetype)initWithOriginalRange:(NSRange)originalRange replacement:(NSString *)replacement;
+
+@end
 
+// MARK: WTTextViewDelegate
+
+@protocol WTTextViewDelegate_Proposed_v1
+
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID updateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)suggestionUUID;
+
+#if PLATFORM(IOS_FAMILY)
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(CGRect)rect inView:(UIView *)sourceView;
 #else
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(NSRect)rect inView:(NSView *)sourceView;
+#endif
+
+@end
+
+@protocol WTTextViewDelegate <WTTextViewDelegate_Proposed_v1>
+
+@end
+
+// MARK: WTWritingToolsDelegate
+
+@protocol WTWritingToolsDelegate_Proposed_v3
+
+- (void)willBeginWritingToolsSession:(WTSession *)session requestContexts:(void (^)(NSArray<WTContext *> *contexts))completion;
+
+- (void)didBeginWritingToolsSession:(WTSession *)session contexts:(NSArray<WTContext *> *)contexts;
+
+typedef NS_ENUM(NSInteger, WTAction) {
+    WTActionShowOriginal = 1,
+    WTActionShowRewritten,
+    WTActionCompositionRestart,
+    WTActionCompositionRefine,
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: aprotyas
body: Unused, so we can skip
created_at: 2025-04-19T18:37:29Z
author_association: MEMBER
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
+
+typedef NS_ENUM(NSInteger, WTSessionType) {
+    WTSessionTypeProofreading = 1,
+    WTSessionTypeComposition,
+};
+
+@interface WTSession : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+@property (nonatomic, readonly) WTSessionType type;
+
+@property (nonatomic, weak) id<WTTextViewDelegate> textViewDelegate;
+
+@property (nonatomic) WTCompositionSessionType compositionSessionType;
+@property (nonatomic, readonly) WTRequestedTool requestedTool;
+
+- (instancetype)initWithType:(WTSessionType)type textViewDelegate:(id<WTTextViewDelegate>)textViewDelegate;
+
+@end
+
+// MARK: WTTextSuggestion
+
+typedef NS_ENUM(NSInteger, WTTextSuggestionState) {
+    WTTextSuggestionStatePending = 0,
+    WTTextSuggestionStateReviewing = 1,
+    WTTextSuggestionStateRejected = 3,
+    WTTextSuggestionStateInvalid = 4,
+};
+
+@interface WTTextSuggestion : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSRange originalRange;
+
+@property (nonatomic, readonly) NSString *replacement;
+
+@property (nonatomic) WTTextSuggestionState state;
+
+- (instancetype)initWithOriginalRange:(NSRange)originalRange replacement:(NSString *)replacement;
+
+@end
 
+// MARK: WTTextViewDelegate
+
+@protocol WTTextViewDelegate_Proposed_v1
+
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID updateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)suggestionUUID;
+
+#if PLATFORM(IOS_FAMILY)
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(CGRect)rect inView:(UIView *)sourceView;
 #else
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(NSRect)rect inView:(NSView *)sourceView;
+#endif
+
+@end
+
+@protocol WTTextViewDelegate <WTTextViewDelegate_Proposed_v1>
+
+@end
+
+// MARK: WTWritingToolsDelegate
+
+@protocol WTWritingToolsDelegate_Proposed_v3
+
+- (void)willBeginWritingToolsSession:(WTSession *)session requestContexts:(void (^)(NSArray<WTContext *> *contexts))completion;
+
+- (void)didBeginWritingToolsSession:(WTSession *)session contexts:(NSArray<WTContext *> *)contexts;
+
+typedef NS_ENUM(NSInteger, WTAction) {
+    WTActionShowOriginal = 1,
+    WTActionShowRewritten,
+    WTActionCompositionRestart,
+    WTActionCompositionRefine,
+};
+
+- (void)writingToolsSession:(WTSession *)session didReceiveAction:(WTAction)action;
+
+- (void)didEndWritingToolsSession:(WTSession *)session accepted:(BOOL)accepted;
+
+- (void)proofreadingSession:(WTSession *)session didReceiveSuggestions:(NSArray<WTTextSuggestion *> *)suggestions processedRange:(NSRange)range inContext:(WTContext *)context finished:(BOOL)finished;
+
+- (void)proofreadingSession:(WTSession *)session didUpdateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)uuid inContext:(WTContext *)context;
+
+- (void)compositionSession:(WTSession *)session didReceiveText:(NSAttributedString *)attributedText replacementRange:(NSRange)range inContext:(WTContext *)context finished:(BOOL)finished;
+
+@optional
+
+@property (nonatomic) BOOL wantsWritingToolsInlineEditing;
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: aprotyas
body: Unused
created_at: 2025-04-19T18:37:52Z
author_association: MEMBER
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
+
+typedef NS_ENUM(NSInteger, WTSessionType) {
+    WTSessionTypeProofreading = 1,
+    WTSessionTypeComposition,
+};
+
+@interface WTSession : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+@property (nonatomic, readonly) WTSessionType type;
+
+@property (nonatomic, weak) id<WTTextViewDelegate> textViewDelegate;
+
+@property (nonatomic) WTCompositionSessionType compositionSessionType;
+@property (nonatomic, readonly) WTRequestedTool requestedTool;
+
+- (instancetype)initWithType:(WTSessionType)type textViewDelegate:(id<WTTextViewDelegate>)textViewDelegate;
+
+@end
+
+// MARK: WTTextSuggestion
+
+typedef NS_ENUM(NSInteger, WTTextSuggestionState) {
+    WTTextSuggestionStatePending = 0,
+    WTTextSuggestionStateReviewing = 1,
+    WTTextSuggestionStateRejected = 3,
+    WTTextSuggestionStateInvalid = 4,
+};
+
+@interface WTTextSuggestion : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSRange originalRange;
+
+@property (nonatomic, readonly) NSString *replacement;
+
+@property (nonatomic) WTTextSuggestionState state;
+
+- (instancetype)initWithOriginalRange:(NSRange)originalRange replacement:(NSString *)replacement;
+
+@end
 
+// MARK: WTTextViewDelegate
+
+@protocol WTTextViewDelegate_Proposed_v1
+
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID updateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)suggestionUUID;
+
+#if PLATFORM(IOS_FAMILY)
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(CGRect)rect inView:(UIView *)sourceView;
 #else
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(NSRect)rect inView:(NSView *)sourceView;
+#endif
+
+@end
+
+@protocol WTTextViewDelegate <WTTextViewDelegate_Proposed_v1>
+
+@end
+
+// MARK: WTWritingToolsDelegate
+
+@protocol WTWritingToolsDelegate_Proposed_v3
+
+- (void)willBeginWritingToolsSession:(WTSession *)session requestContexts:(void (^)(NSArray<WTContext *> *contexts))completion;
+
+- (void)didBeginWritingToolsSession:(WTSession *)session contexts:(NSArray<WTContext *> *)contexts;
+
+typedef NS_ENUM(NSInteger, WTAction) {
+    WTActionShowOriginal = 1,
+    WTActionShowRewritten,
+    WTActionCompositionRestart,
+    WTActionCompositionRefine,
+};
+
+- (void)writingToolsSession:(WTSession *)session didReceiveAction:(WTAction)action;
+
+- (void)didEndWritingToolsSession:(WTSession *)session accepted:(BOOL)accepted;
+
+- (void)proofreadingSession:(WTSession *)session didReceiveSuggestions:(NSArray<WTTextSuggestion *> *)suggestions processedRange:(NSRange)range inContext:(WTContext *)context finished:(BOOL)finished;
+
+- (void)proofreadingSession:(WTSession *)session didUpdateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)uuid inContext:(WTContext *)context;
+
+- (void)compositionSession:(WTSession *)session didReceiveText:(NSAttributedString *)attributedText replacementRange:(NSRange)range inContext:(WTContext *)context finished:(BOOL)finished;
+
+@optional
+
+@property (nonatomic) BOOL wantsWritingToolsInlineEditing;
+
+- (BOOL)supportsWritingToolsAction:(WTAction)action;
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: aprotyas
body: Unused
created_at: 2025-04-19T18:38:03Z
author_association: MEMBER
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: rr-codes
body: in a subsequent PR, I will actually be using all these (since rn I'm doing things in a not type safe way); I just haven't gotten around to it yet
created_at: 2025-04-19T19:21:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: rr-codes
body: for this, I realize we're not using many, but I was hesitant about changing them since that would affect their ordinal number, so I didn't want to risk accidentally changing one of their numeric values
created_at: 2025-04-19T19:22:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -34,25 +37,170 @@ DECLARE_SYSTEM_HEADER
 #import <WritingTools/WTSession_Private.h>
 #import <WritingTools/WritingTools.h>
 
-#if PLATFORM(MAC)
+#else
 
-using PlatformWritingToolsBehavior = NSWritingToolsBehavior;
+#import <Foundation/Foundation.h>
 
-constexpr auto PlatformWritingToolsBehaviorNone = NSWritingToolsBehaviorNone;
-constexpr auto PlatformWritingToolsBehaviorDefault = NSWritingToolsBehaviorDefault;
-constexpr auto PlatformWritingToolsBehaviorLimited = NSWritingToolsBehaviorLimited;
-constexpr auto PlatformWritingToolsBehaviorComplete = NSWritingToolsBehaviorComplete;
+extern NSAttributedStringKey const WTWritingToolsPreservedAttributeName;
 
-using PlatformWritingToolsResultOptions = NSWritingToolsResultOptions;
+typedef NS_ENUM(NSInteger, WTRequestedTool) {
+    WTRequestedToolIndex = 0,
 
-constexpr auto PlatformWritingToolsResultPlainText = NSWritingToolsResultPlainText;
-constexpr auto PlatformWritingToolsResultRichText = NSWritingToolsResultRichText;
-constexpr auto PlatformWritingToolsResultList = NSWritingToolsResultList;
-constexpr auto PlatformWritingToolsResultTable = NSWritingToolsResultTable;
+    WTRequestedToolProofread = 1,
+    WTRequestedToolRewrite = 2,
+    WTRequestedToolRewriteProofread = 3,
+
+    WTRequestedToolRewriteFriendly = 11,
+    WTRequestedToolRewriteProfessional = 12,
+    WTRequestedToolRewriteConcise = 13,
+    WTRequestedToolRewriteOpenEnded = 19,
+
+    WTRequestedToolTransformSummary = 21,
+    WTRequestedToolTransformKeyPoints = 22,
+    WTRequestedToolTransformList = 23,
+    WTRequestedToolTransformTable = 24,
+
+    WTRequestedToolSmartReply = 101,
+
+    WTRequestedToolCompose = 201,
+};
+
+// MARK: WTContext
+
+@protocol WTTextViewDelegate;
+
+@interface WTContext : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSAttributedString *attributedText;
+
+@property (nonatomic) NSRange range;
+
+- (instancetype)initWithAttributedText:(NSAttributedString *)attributedText range:(NSRange)range;
+
+@end
+
+// MARK: WTSession
+
+typedef NS_ENUM(NSInteger, WTCompositionSessionType) {
+    WTCompositionSessionTypeNone,
+    WTCompositionSessionTypeMagic,
+    WTCompositionSessionTypeFriendly,
+    WTCompositionSessionTypeProfessional,
+    WTCompositionSessionTypeConcise,
+    WTCompositionSessionTypeOpenEnded,
+    WTCompositionSessionTypeSummary,
+    WTCompositionSessionTypeKeyPoints,
+    WTCompositionSessionTypeList,
+    WTCompositionSessionTypeTable,
+    WTCompositionSessionTypeCompose,
+    WTCompositionSessionTypeSmartReply,
+    WTCompositionSessionTypeProofread,
+};
+
+typedef NS_ENUM(NSInteger, WTSessionType) {
+    WTSessionTypeProofreading = 1,
+    WTSessionTypeComposition,
+};
+
+@interface WTSession : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+@property (nonatomic, readonly) WTSessionType type;
+
+@property (nonatomic, weak) id<WTTextViewDelegate> textViewDelegate;
+
+@property (nonatomic) WTCompositionSessionType compositionSessionType;
+@property (nonatomic, readonly) WTRequestedTool requestedTool;
+
+- (instancetype)initWithType:(WTSessionType)type textViewDelegate:(id<WTTextViewDelegate>)textViewDelegate;
+
+@end
+
+// MARK: WTTextSuggestion
+
+typedef NS_ENUM(NSInteger, WTTextSuggestionState) {
+    WTTextSuggestionStatePending = 0,
+    WTTextSuggestionStateReviewing = 1,
+    WTTextSuggestionStateRejected = 3,
+    WTTextSuggestionStateInvalid = 4,
+};
+
+@interface WTTextSuggestion : NSObject
+
+@property (nonatomic, readonly) NSUUID *uuid;
+
+@property (nonatomic, readonly) NSRange originalRange;
+
+@property (nonatomic, readonly) NSString *replacement;
+
+@property (nonatomic) WTTextSuggestionState state;
+
+- (instancetype)initWithOriginalRange:(NSRange)originalRange replacement:(NSString *)replacement;
+
+@end
 
+// MARK: WTTextViewDelegate
+
+@protocol WTTextViewDelegate_Proposed_v1
+
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID updateState:(WTTextSuggestionState)state forSuggestionWithUUID:(NSUUID *)suggestionUUID;
+
+#if PLATFORM(IOS_FAMILY)
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(CGRect)rect inView:(UIView *)sourceView;
 #else
+- (void)proofreadingSessionWithUUID:(NSUUID *)sessionUUID showDetailsForSuggestionWithUUID:(NSUUID *)suggestionUUID relativeToRect:(NSRect)rect inView:(NSView *)sourceView;
+#endif
+
+@end
+
+@protocol WTTextViewDelegate <WTTextViewDelegate_Proposed_v1>
+
+@end
+
+// MARK: WTWritingToolsDelegate
+
+@protocol WTWritingToolsDelegate_Proposed_v3
+
+- (void)willBeginWritingToolsSession:(WTSession *)session requestContexts:(void (^)(NSArray<WTContext *> *contexts))completion;
+
+- (void)didBeginWritingToolsSession:(WTSession *)session contexts:(NSArray<WTContext *> *)contexts;
+
+typedef NS_ENUM(NSInteger, WTAction) {
+    WTActionShowOriginal = 1,
+    WTActionShowRewritten,
+    WTActionCompositionRestart,
+    WTActionCompositionRefine,
path: Source/WebCore/PAL/pal/spi/cocoa/WritingToolsSPI.h
user: login: rr-codes
body: this will be used eventually also 😅 
created_at: 2025-04-19T19:23:04Z
author_association: CONTRIBUTOR

PR comments:
user: login: webkit-early-warning-system
created_at: 2025-04-19T17:13:21Z
body: EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/24b9248ed1826b373eaaa85b76888c6a16f38e64)<details>

| Misc | iOS, visionOS, tvOS & watchOS  | macOS  | Linux |  Windows |
| ----- | ---------------------- | ------- |  ----- |  --------- |
| [✅ 🧪 style](https://ews-build.webkit.org/#/builders/38/builds/100217 "Passed style check") | [✅ 🛠 ios](https://ews-build.webkit.org/#/builders/131/builds/19866 "Built successfully") | [✅ 🛠 mac](https://ews-build.webkit.org/#/builders/138/builds/10164 "Built successfully") | [✅ 🛠 wpe](https://ews-build.webkit.org/#/builders/5/builds/105347 "Built successfully") | [  ~~🛠 win~~](https://ews-build.webkit.org/#/builders/59/builds/50800 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") 
| [✅ 🧪 bindings](https://ews-build.webkit.org/#/builders/9/builds/102258 "Passed tests") | [✅ 🛠 ios-sim](https://ews-build.webkit.org/#/builders/130/builds/20171 "Built successfully") | [✅ 🛠 mac-AS-debug](https://ews-build.webkit.org/#/builders/123/builds/28340 "Built successfully") | [  ~~🧪 wpe-wk2~~](https://ews-build.webkit.org/#/builders/34/builds/76296 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 win-tests~~](https://ews-build.webkit.org/#/builders/59/builds/50800 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") 
| [✅ 🧪 webkitperl](https://ews-build.webkit.org/#/builders/11/builds/103224 "Passed tests") | [  ~~🧪 ios-wk2~~](https://ews-build.webkit.org/#/builders/132/builds/15424 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-mac~~](https://ews-build.webkit.org/#/builders/18/builds/90518 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-wpe~~](https://ews-build.webkit.org/#/builders/41/builds/56656 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [  ~~🧪 ios-wk2-wpt~~](https://ews-build.webkit.org/#/builders/133/builds/15244 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-wk1~~](https://ews-build.webkit.org/#/builders/135/builds/8516 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 wpe-cairo](https://ews-build.webkit.org/#/builders/65/builds/50168 "Built successfully") | 
| | [  ~~🧪 api-ios~~](https://ews-build.webkit.org/#/builders/13/builds/85150 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-wk2~~](https://ews-build.webkit.org/#/builders/136/builds/8599 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 gtk](https://ews-build.webkit.org/#/builders/2/builds/107706 "Built successfully") | 
| | [✅ 🛠 vision](https://ews-build.webkit.org/#/builders/128/builds/27330 "Built successfully") | [  ~~🧪 mac-AS-debug-wk2~~](https://ews-build.webkit.org/#/builders/122/builds/20027 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 gtk-wk2~~](https://ews-build.webkit.org/#/builders/1/builds/85249 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [✅ 🛠 vision-sim](https://ews-build.webkit.org/#/builders/121/builds/27693 "Built successfully") | [  ~~🧪 mac-wk2-stress~~](https://ews-build.webkit.org/#/builders/8/builds/86725 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-gtk~~](https://ews-build.webkit.org/#/builders/21/builds/84788 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [  ~~🧪 vision-wk2~~](https://ews-build.webkit.org/#/builders/126/builds/29467 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-intel-wk2~~](https://ews-build.webkit.org/#/builders/137/builds/7201 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🛠 playstation~~](https://ews-build.webkit.org/#/builders/134/builds/21197 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [✅ 🛠 tv](https://ews-build.webkit.org/#/builders/127/builds/27267 "Built successfully") | [✅ 🛠 mac-safer-cpp](https://ews-build.webkit.org/#/builders/120/builds/32500 "Built successfully") | | 
| | [✅ 🛠 tv-sim](https://ews-build.webkit.org/#/builders/125/builds/27078 "Built successfully") | | | 
| | [✅ 🛠 watch](https://ews-build.webkit.org/#/builders/129/builds/30394 "Built successfully") | | | 
| | [✅ 🛠 watch-sim](https://ews-build.webkit.org/#/builders/124/builds/28637 "Built successfully") | | | </details>
author_association: COLLABORATOR
user: login: webkit-early-warning-system
created_at: 2025-04-19T17:17:07Z
body: EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/f8adb6de4d76d6b610893033d171299a6552e2de)<details>

| Misc | iOS, visionOS, tvOS & watchOS  | macOS  | Linux |  Windows |
| ----- | ---------------------- | ------- |  ----- |  --------- |
| [✅ 🧪 style](https://ews-build.webkit.org/#/builders/38/builds/100218 "Passed style check") | [✅ 🛠 ios](https://ews-build.webkit.org/#/builders/131/builds/19867 "Built successfully") | [✅ 🛠 mac](https://ews-build.webkit.org/#/builders/138/builds/10165 "Built successfully") | [✅ 🛠 wpe](https://ews-build.webkit.org/#/builders/5/builds/105348 "Built successfully") | [✅ 🛠 win](https://ews-build.webkit.org/#/builders/59/builds/50801 "Built successfully") 
| [✅ 🧪 bindings](https://ews-build.webkit.org/#/builders/9/builds/102259 "Passed tests") | [✅ 🛠 ios-sim](https://ews-build.webkit.org/#/builders/130/builds/20172 "Built successfully") | [✅ 🛠 mac-AS-debug](https://ews-build.webkit.org/#/builders/123/builds/28341 "Built successfully") | [  ~~🧪 wpe-wk2~~](https://ews-build.webkit.org/#/builders/34/builds/76297 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 win-tests~~](https://ews-build.webkit.org/#/builders/60/builds/33354 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") 
| [✅ 🧪 webkitperl](https://ews-build.webkit.org/#/builders/11/builds/103225 "Passed tests") | [  ~~🧪 ios-wk2~~](https://ews-build.webkit.org/#/builders/132/builds/15425 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-mac~~](https://ews-build.webkit.org/#/builders/18/builds/90519 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-wpe~~](https://ews-build.webkit.org/#/builders/41/builds/56657 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [  ~~🧪 ios-wk2-wpt~~](https://ews-build.webkit.org/#/builders/133/builds/15245 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-wk1~~](https://ews-build.webkit.org/#/builders/135/builds/8517 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 wpe-cairo](https://ews-build.webkit.org/#/builders/65/builds/50169 "Built successfully") | 
| | [  ~~🧪 api-ios~~](https://ews-build.webkit.org/#/builders/13/builds/85152 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-wk2~~](https://ews-build.webkit.org/#/builders/136/builds/8600 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 gtk](https://ews-build.webkit.org/#/builders/2/builds/107707 "Built successfully") | 
| | [✅ 🛠 vision](https://ews-build.webkit.org/#/builders/128/builds/27331 "Built successfully") | [  ~~🧪 mac-AS-debug-wk2~~](https://ews-build.webkit.org/#/builders/122/builds/20028 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 gtk-wk2~~](https://ews-build.webkit.org/#/builders/1/builds/85250 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [✅ 🛠 vision-sim](https://ews-build.webkit.org/#/builders/121/builds/27694 "Built successfully") | [  ~~🧪 mac-wk2-stress~~](https://ews-build.webkit.org/#/builders/8/builds/86726 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-gtk~~](https://ews-build.webkit.org/#/builders/21/builds/84789 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [  ~~🧪 vision-wk2~~](https://ews-build.webkit.org/#/builders/126/builds/29468 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-intel-wk2~~](https://ews-build.webkit.org/#/builders/137/builds/7202 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 playstation](https://ews-build.webkit.org/#/builders/134/builds/21198 "Built successfully") | 
| | [✅ 🛠 tv](https://ews-build.webkit.org/#/builders/127/builds/27268 "Built successfully") | [✅ 🛠 mac-safer-cpp](https://ews-build.webkit.org/#/builders/120/builds/32501 "Built successfully") | | 
| | [✅ 🛠 tv-sim](https://ews-build.webkit.org/#/builders/125/builds/27079 "Built successfully") | | | 
| | [✅ 🛠 watch](https://ews-build.webkit.org/#/builders/129/builds/30395 "Built successfully") | | | 
| | [✅ 🛠 watch-sim](https://ews-build.webkit.org/#/builders/124/builds/28638 "Built successfully") | | | </details>
author_association: COLLABORATOR
user: login: webkit-early-warning-system
created_at: 2025-04-19T17:22:42Z
body: EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/f7f356de8b81e8c591ffda4e6c3ec6b8c157f6ef)<details>

| Misc | iOS, visionOS, tvOS & watchOS  | macOS  | Linux |  Windows |
| ----- | ---------------------- | ------- |  ----- |  --------- |
| [✅ 🧪 style](https://ews-build.webkit.org/#/builders/38/builds/100219 "Passed style check") | [✅ 🛠 ios](https://ews-build.webkit.org/#/builders/131/builds/19868 "Built successfully") | [✅ 🛠 mac](https://ews-build.webkit.org/#/builders/138/builds/10166 "Built successfully") | [✅ 🛠 wpe](https://ews-build.webkit.org/#/builders/5/builds/105349 "Built successfully") | [✅ 🛠 win](https://ews-build.webkit.org/#/builders/59/builds/50802 "Built successfully") 
| [✅ 🧪 bindings](https://ews-build.webkit.org/#/builders/9/builds/102260 "Passed tests") | [✅ 🛠 ios-sim](https://ews-build.webkit.org/#/builders/130/builds/20173 "Built successfully") | [✅ 🛠 mac-AS-debug](https://ews-build.webkit.org/#/builders/123/builds/28342 "Built successfully") | [✅ 🧪 wpe-wk2](https://ews-build.webkit.org/#/builders/34/builds/76298 "Passed tests") | [✅ 🧪 win-tests](https://ews-build.webkit.org/#/builders/60/builds/33356 "Passed tests") 
| [✅ 🧪 webkitperl](https://ews-build.webkit.org/#/builders/11/builds/103226 "Passed tests") | [❌ 🧪 ios-wk2](https://ews-build.webkit.org/#/builders/132/builds/15423 "Found 2 new test failures: fast/forms/ios/file-upload-panel-dismiss-when-view-removed-from-window.html http/wpt/webcodecs/hevc-encoder-config.https.any.html (failure)") | [✅ 🧪 api-mac](https://ews-build.webkit.org/#/builders/18/builds/90520 "Passed tests") | [✅ 🧪 api-wpe](https://ews-build.webkit.org/#/builders/41/builds/56658 "Passed tests") | 
| | [✅ 🧪 ios-wk2-wpt](https://ews-build.webkit.org/#/builders/133/builds/15243 "Passed tests") | [✅ 🧪 mac-wk1](https://ews-build.webkit.org/#/builders/135/builds/8518 "Passed tests") | [✅ 🛠 wpe-cairo](https://ews-build.webkit.org/#/builders/65/builds/50170 "Built successfully") | 
| | [✅ 🧪 api-ios](https://ews-build.webkit.org/#/builders/13/builds/85149 "Passed tests") | [✅ 🧪 mac-wk2](https://ews-build.webkit.org/#/builders/136/builds/8601 "Passed tests") | [✅ 🛠 gtk](https://ews-build.webkit.org/#/builders/2/builds/107708 "Built successfully") | 
| | [✅ 🛠 vision](https://ews-build.webkit.org/#/builders/128/builds/27332 "Built successfully") | [✅ 🧪 mac-AS-debug-wk2](https://ews-build.webkit.org/#/builders/122/builds/20026 "Passed tests") | [✅ 🧪 gtk-wk2](https://ews-build.webkit.org/#/builders/1/builds/85251 "Passed tests") | 
| | [✅ 🛠 vision-sim](https://ews-build.webkit.org/#/builders/121/builds/27695 "Built successfully") | [✅ 🧪 mac-wk2-stress](https://ews-build.webkit.org/#/builders/8/builds/86727 "Passed tests") | [✅ 🧪 api-gtk](https://ews-build.webkit.org/#/builders/21/builds/84790 "Passed tests") | 
| | [✅ 🧪 vision-wk2](https://ews-build.webkit.org/#/builders/126/builds/29465 "Passed tests") | [✅ 🧪 mac-intel-wk2](https://ews-build.webkit.org/#/builders/137/builds/7203 "Passed tests") | [✅ 🛠 playstation](https://ews-build.webkit.org/#/builders/134/builds/21200 "Built successfully") | 
| | [✅ 🛠 tv](https://ews-build.webkit.org/#/builders/127/builds/27269 "Built successfully") | [✅ 🛠 mac-safer-cpp](https://ews-build.webkit.org/#/builders/120/builds/32502 "Built successfully") | | 
| | [✅ 🛠 tv-sim](https://ews-build.webkit.org/#/builders/125/builds/27080 "Built successfully") | | | 
| | [✅ 🛠 watch](https://ews-build.webkit.org/#/builders/129/builds/30396 "Built successfully") | | | 
| | [✅ 🛠 watch-sim](https://ews-build.webkit.org/#/builders/124/builds/28639 "Built successfully") | | | </details>
author_association: COLLABORATOR
user: login: webkit-early-warning-system
created_at: 2025-04-19T19:24:53Z
body: EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/d647b0be193de8d983d026635b4faf309651791e)<details>

| Misc | iOS, visionOS, tvOS & watchOS  | macOS  | Linux |  Windows |
| ----- | ---------------------- | ------- |  ----- |  --------- |
| [✅ 🧪 style](https://ews-build.webkit.org/#/builders/38/builds/100222 "Passed style check") | [✅ 🛠 ios](https://ews-build.webkit.org/#/builders/131/builds/19871 "Built successfully") | [✅ 🛠 mac](https://ews-build.webkit.org/#/builders/138/builds/10169 "Built successfully") | [✅ 🛠 wpe](https://ews-build.webkit.org/#/builders/5/builds/105352 "Built successfully") | [✅ 🛠 win](https://ews-build.webkit.org/#/builders/59/builds/50805 "Built successfully") 
| [✅ 🧪 bindings](https://ews-build.webkit.org/#/builders/9/builds/102263 "Passed tests") | [✅ 🛠 ios-sim](https://ews-build.webkit.org/#/builders/130/builds/20176 "Built successfully") | [✅ 🛠 mac-AS-debug](https://ews-build.webkit.org/#/builders/123/builds/28345 "Built successfully") | [  ~~🧪 wpe-wk2~~](https://ews-build.webkit.org/#/builders/34/builds/76302 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 win-tests~~](https://ews-build.webkit.org/#/builders/60/builds/33359 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") 
| [✅ 🧪 webkitperl](https://ews-build.webkit.org/#/builders/11/builds/103229 "Passed tests") | [  ~~🧪 ios-wk2~~](https://ews-build.webkit.org/#/builders/132/builds/15428 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-mac~~](https://ews-build.webkit.org/#/builders/18/builds/90523 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-wpe~~](https://ews-build.webkit.org/#/builders/41/builds/56662 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [  ~~🧪 ios-wk2-wpt~~](https://ews-build.webkit.org/#/builders/133/builds/15248 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-wk1~~](https://ews-build.webkit.org/#/builders/135/builds/8522 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 wpe-cairo](https://ews-build.webkit.org/#/builders/65/builds/50173 "Built successfully") | 
| | [  ~~🧪 api-ios~~](https://ews-build.webkit.org/#/builders/13/builds/85155 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-wk2~~](https://ews-build.webkit.org/#/builders/136/builds/8604 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 gtk](https://ews-build.webkit.org/#/builders/2/builds/107711 "Built successfully") | 
| | [✅ 🛠 vision](https://ews-build.webkit.org/#/builders/128/builds/27335 "Built successfully") | [  ~~🧪 mac-AS-debug-wk2~~](https://ews-build.webkit.org/#/builders/122/builds/20032 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 gtk-wk2~~](https://ews-build.webkit.org/#/builders/1/builds/85253 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [✅ 🛠 vision-sim](https://ews-build.webkit.org/#/builders/121/builds/27698 "Built successfully") | [  ~~🧪 mac-wk2-stress~~](https://ews-build.webkit.org/#/builders/8/builds/86730 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 api-gtk~~](https://ews-build.webkit.org/#/builders/21/builds/84792 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | 
| | [  ~~🧪 vision-wk2~~](https://ews-build.webkit.org/#/builders/126/builds/29471 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [  ~~🧪 mac-intel-wk2~~](https://ews-build.webkit.org/#/builders/137/builds/7206 "The change is no longer eligible for processing. Commit was outdated when EWS attempted to process it.") | [✅ 🛠 playstation](https://ews-build.webkit.org/#/builders/134/builds/21204 "Built successfully") | 
| | [✅ 🛠 tv](https://ews-build.webkit.org/#/builders/127/builds/27272 "Built successfully") | [✅ 🛠 mac-safer-cpp](https://ews-build.webkit.org/#/builders/120/builds/32505 "Built successfully") | | 
| | [✅ 🛠 tv-sim](https://ews-build.webkit.org/#/builders/125/builds/27083 "Built successfully") | | | 
| | [✅ 🛠 watch](https://ews-build.webkit.org/#/builders/129/builds/30399 "Built successfully") | | | 
| | [✅ 🛠 watch-sim](https://ews-build.webkit.org/#/builders/124/builds/28642 "Built successfully") | | | </details>
author_association: COLLABORATOR
user: login: webkit-early-warning-system
created_at: 2025-04-19T19:27:47Z
body: EWS run on current version of this PR (hash https://github.com/WebKit/WebKit/commit/887344fe973e4b15f12418d43c11c260feb92f13)<details>

| Misc | iOS, visionOS, tvOS & watchOS  | macOS  | Linux |  Windows |
| ----- | ---------------------- | ------- |  ----- |  --------- |
| [✅ 🧪 style](https://ews-build.webkit.org/#/builders/38/builds/100223 "Passed style check") | [✅ 🛠 ios](https://ews-build.webkit.org/#/builders/131/builds/19872 "Built successfully") | [✅ 🛠 mac](https://ews-build.webkit.org/#/builders/138/builds/10170 "Built successfully") | [✅ 🛠 wpe](https://ews-build.webkit.org/#/builders/5/builds/105353 "Built successfully") | [✅ 🛠 win](https://ews-build.webkit.org/#/builders/59/builds/50806 "Built successfully") 
| [✅ 🧪 bindings](https://ews-build.webkit.org/#/builders/9/builds/102264 "Passed tests") | [✅ 🛠 ios-sim](https://ews-build.webkit.org/#/builders/130/builds/20177 "Built successfully") | [✅ 🛠 mac-AS-debug](https://ews-build.webkit.org/#/builders/123/builds/28346 "Built successfully") | [✅ 🧪 wpe-wk2](https://ews-build.webkit.org/#/builders/34/builds/76301 "Passed tests") | [✅ 🧪 win-tests](https://ews-build.webkit.org/#/builders/60/builds/33360 "Passed tests") 
| [✅ 🧪 webkitperl](https://ews-build.webkit.org/#/builders/11/builds/103230 "Passed tests") | [✅ 🧪 ios-wk2](https://ews-build.webkit.org/#/builders/132/builds/15429 "Passed tests") | [✅ 🧪 api-mac](https://ews-build.webkit.org/#/builders/18/builds/90524 "Passed tests") | [✅ 🧪 api-wpe](https://ews-build.webkit.org/#/builders/41/builds/56661 "Passed tests") | 
| | [✅ 🧪 ios-wk2-wpt](https://ews-build.webkit.org/#/builders/133/builds/15249 "Passed tests") | [✅ 🧪 mac-wk1](https://ews-build.webkit.org/#/builders/135/builds/8523 "Passed tests") | [✅ 🛠 wpe-cairo](https://ews-build.webkit.org/#/builders/65/builds/50174 "Built successfully") | 
| | [✅ 🧪 api-ios](https://ews-build.webkit.org/#/builders/13/builds/85156 "Passed tests") | [✅ 🧪 mac-wk2](https://ews-build.webkit.org/#/builders/136/builds/8605 "Passed tests") | [✅ 🛠 gtk](https://ews-build.webkit.org/#/builders/2/builds/107712 "Built successfully") | 
| | [✅ 🛠 vision](https://ews-build.webkit.org/#/builders/128/builds/27336 "Built successfully") | [✅ 🧪 mac-AS-debug-wk2](https://ews-build.webkit.org/#/builders/122/builds/20031 "Passed tests") | [✅ 🧪 gtk-wk2](https://ews-build.webkit.org/#/builders/1/builds/85254 "Passed tests") | 
| | [✅ 🛠 vision-sim](https://ews-build.webkit.org/#/builders/121/builds/27699 "Built successfully") | [✅ 🧪 mac-wk2-stress](https://ews-build.webkit.org/#/builders/8/builds/86731 "Passed tests") | [✅ 🧪 api-gtk](https://ews-build.webkit.org/#/builders/21/builds/84793 "Passed tests") | 
| [✅ 🛠 🧪 merge](https://ews-build.webkit.org/#/builders/19/builds/21547 "Built successfully and passed tests") | [✅ 🧪 vision-wk2](https://ews-build.webkit.org/#/builders/126/builds/29472 "Passed tests") | [✅ 🧪 mac-intel-wk2](https://ews-build.webkit.org/#/builders/137/builds/7207 "Passed tests") | [✅ 🛠 playstation](https://ews-build.webkit.org/#/builders/134/builds/21205 "Built successfully") | 
| | [✅ 🛠 tv](https://ews-build.webkit.org/#/builders/127/builds/27273 "Built successfully") | [✅ 🛠 mac-safer-cpp](https://ews-build.webkit.org/#/builders/120/builds/32506 "Built successfully") | | 
| | [✅ 🛠 tv-sim](https://ews-build.webkit.org/#/builders/125/builds/27084 "Built successfully") | | | 
| | [✅ 🛠 watch](https://ews-build.webkit.org/#/builders/129/builds/30400 "Built successfully") | | | 
| | [✅ 🛠 watch-sim](https://ews-build.webkit.org/#/builders/124/builds/28643 "Built successfully") | | | </details>
author_association: COLLABORATOR
user: login: webkit-commit-queue
created_at: 2025-04-19T21:39:09Z
body: Committed 293897@main (b504fc6a69ad): <https://commits.webkit.org/293897@main>

Reviewed commits have been landed. Closing PR #44293 and removing active labels.
author_association: COLLABORATOR