Skip to content

Commit 5399ccc

Browse files
authored
Remove macro (#22)
1 parent 4edbe37 commit 5399ccc

File tree

7 files changed

+517
-145
lines changed

7 files changed

+517
-145
lines changed

MCPClient/Sources/MCPClientConnection.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Foundation
22
import JSONRPC
33
import MCPInterface
4-
import MemberwiseInit
54

65
// MARK: - MCPClientConnection
76

MCPClient/Sources/MCPClientInterface.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Foundation
22
import JSONRPC
33
import MCPInterface
4-
import MemberwiseInit
54

65
// MARK: - MCPClientInterface
76

@@ -44,11 +43,18 @@ public protocol MCPClientInterface {
4443
/// Describes the supported capabilities of an MCP client, and how to handle each of the supported ones.
4544
///
4645
/// Note: This is similar to `ClientCapabilities`, with the addition of the handler function.
47-
@MemberwiseInit(.public, _optionalsDefaultNil: true)
4846
public struct ClientCapabilityHandlers {
4947
public let roots: CapabilityHandler<ListChangedCapability, ListRootsRequest.Handler>?
5048
public let sampling: CapabilityHandler<EmptyObject, CreateSamplingMessageRequest.Handler>?
5149
// TODO: add experimental
50+
51+
public init(
52+
roots: CapabilityHandler<ListChangedCapability, ListRootsRequest.Handler>? = nil,
53+
sampling: CapabilityHandler<EmptyObject, CreateSamplingMessageRequest.Handler>? = nil)
54+
{
55+
self.roots = roots
56+
self.sampling = sampling
57+
}
5258
}
5359

5460
// MARK: - MCPClientError

MCPInterface/Sources/Interfaces.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Foundation
22
import JSONRPC
3-
import MemberwiseInit
43

54
public typealias Transport = DataChannel
65

@@ -15,10 +14,14 @@ public typealias AnyJRPCResponse = Swift.Result<Encodable & Sendable, AnyJSONRPC
1514
// MARK: - CapabilityHandler
1615

1716
/// Describes a capability of a client/server (see `ClientCapabilities` and `ServerCapabilities`), as well as how it is handled.
18-
@MemberwiseInit(.public, _optionalsDefaultNil: true)
1917
public struct CapabilityHandler<Info, Handler> {
2018
public let info: Info
2119
public let handler: Handler
20+
21+
public init(info: Info, handler: Handler) {
22+
self.info = info
23+
self.handler = handler
24+
}
2225
}
2326

2427
extension CapabilityHandler where Info == EmptyObject {

0 commit comments

Comments
 (0)