File tree Expand file tree Collapse file tree 4 files changed +46
-8
lines changed
Expand file tree Collapse file tree 4 files changed +46
-8
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,9 @@ let server = Server(
5151 name : " MyServer" ,
5252 version : " 1.0.0" ,
5353 capabilities : .init (
54- prompts : .init (),
55- resources : .init (
56- subscribe : true
57- ),
58- tools : .init ()
54+ prompts : true ,
55+ resources : true ,
56+ tools : true
5957 )
6058)
6159
Original file line number Diff line number Diff line change @@ -408,3 +408,17 @@ public actor Client {
408408 return value
409409 }
410410}
411+
412+ // MARK: - ExpressibleByBooleanLiteral
413+
414+ extension Client . Capabilities . Roots : ExpressibleByBooleanLiteral {
415+ public init ( booleanLiteral value: Bool ) {
416+ self . init ( )
417+ }
418+ }
419+
420+ extension Client . Capabilities . Sampling : ExpressibleByBooleanLiteral {
421+ public init ( booleanLiteral value: Bool ) {
422+ self . init ( )
423+ }
424+ }
Original file line number Diff line number Diff line change @@ -408,3 +408,29 @@ public actor Server {
408408 self . isInitialized = true
409409 }
410410}
411+
412+ // MARK: - ExpressibleByBooleanLiteral
413+
414+ extension Server . Capabilities . Logging : ExpressibleByBooleanLiteral {
415+ public init ( booleanLiteral value: Bool ) {
416+ self . init ( )
417+ }
418+ }
419+
420+ extension Server . Capabilities . Prompts : ExpressibleByBooleanLiteral {
421+ public init ( booleanLiteral value: Bool ) {
422+ self . init ( )
423+ }
424+ }
425+
426+ extension Server . Capabilities . Resources : ExpressibleByBooleanLiteral {
427+ public init ( booleanLiteral value: Bool ) {
428+ self . init ( )
429+ }
430+ }
431+
432+ extension Server . Capabilities . Tools : ExpressibleByBooleanLiteral {
433+ public init ( booleanLiteral value: Bool ) {
434+ self . init ( )
435+ }
436+ }
Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ struct RoundtripTests {
3434 name: " TestServer " ,
3535 version: " 1.0.0 " ,
3636 capabilities: . init(
37- prompts: . init ( ) ,
38- resources: . init ( ) ,
39- tools: . init ( )
37+ prompts: true ,
38+ resources: true ,
39+ tools: true
4040 )
4141 )
4242 await server. withMethodHandler ( ListTools . self) { _ in
You can’t perform that action at this time.
0 commit comments