File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,7 @@ public actor Client {
220220 }
221221
222222 // Automatically initialize after connecting
223- let result = try await initialize ( )
224- return result
223+ return try await _initialize ( )
225224 }
226225
227226 /// Disconnect the client and cancel all pending requests
@@ -485,7 +484,23 @@ public actor Client {
485484
486485 // MARK: - Lifecycle
487486
487+ /// Initialize the connection with the server.
488+ ///
489+ /// - Important: This method is deprecated. Initialization now happens automatically
490+ /// when calling `connect(transport:)`. You should use that method instead.
491+ ///
492+ /// - Returns: The server's initialization response containing capabilities and server info
493+ @available (
494+ * , deprecated,
495+ message:
496+ " Initialization now happens automatically during connect. Use connect(transport:) instead. "
497+ )
488498 public func initialize( ) async throws -> Initialize . Result {
499+ return try await _initialize ( )
500+ }
501+
502+ /// Internal initialization implementation
503+ private func _initialize( ) async throws -> Initialize . Result {
489504 let request = Initialize . request (
490505 . init(
491506 protocolVersion: Version . latest,
You can’t perform that action at this time.
0 commit comments