1
- import {
2
- LATEST_PROTOCOL_VERSION ,
1
+ import {
2
+ LATEST_PROTOCOL_VERSION ,
3
3
SUPPORTED_PROTOCOL_VERSIONS ,
4
4
ResourceLinkSchema ,
5
5
ContentBlockSchema ,
@@ -28,7 +28,7 @@ describe("Types", () => {
28
28
uri : "file:///path/to/file.txt" ,
29
29
name : "file.txt"
30
30
} ;
31
-
31
+
32
32
const result = ResourceLinkSchema . safeParse ( resourceLink ) ;
33
33
expect ( result . success ) . toBe ( true ) ;
34
34
if ( result . success ) {
@@ -48,7 +48,7 @@ describe("Types", () => {
48
48
mimeType : "text/plain" ,
49
49
_meta : { custom : "metadata" }
50
50
} ;
51
-
51
+
52
52
const result = ResourceLinkSchema . safeParse ( resourceLink ) ;
53
53
expect ( result . success ) . toBe ( true ) ;
54
54
if ( result . success ) {
@@ -65,7 +65,7 @@ describe("Types", () => {
65
65
uri : "file:///path/to/file.txt" ,
66
66
name : "file.txt"
67
67
} ;
68
-
68
+
69
69
const result = ResourceLinkSchema . safeParse ( invalidResourceLink ) ;
70
70
expect ( result . success ) . toBe ( false ) ;
71
71
} ) ;
@@ -76,7 +76,7 @@ describe("Types", () => {
76
76
uri : "file:///path/to/file.txt"
77
77
// missing name
78
78
} ;
79
-
79
+
80
80
const result = ResourceLinkSchema . safeParse ( invalidResourceLink ) ;
81
81
expect ( result . success ) . toBe ( false ) ;
82
82
} ) ;
@@ -88,7 +88,7 @@ describe("Types", () => {
88
88
type : "text" ,
89
89
text : "Hello, world!"
90
90
} ;
91
-
91
+
92
92
const result = ContentBlockSchema . safeParse ( textContent ) ;
93
93
expect ( result . success ) . toBe ( true ) ;
94
94
if ( result . success ) {
@@ -102,7 +102,7 @@ describe("Types", () => {
102
102
data : "aGVsbG8=" , // base64 encoded "hello"
103
103
mimeType : "image/png"
104
104
} ;
105
-
105
+
106
106
const result = ContentBlockSchema . safeParse ( imageContent ) ;
107
107
expect ( result . success ) . toBe ( true ) ;
108
108
if ( result . success ) {
@@ -116,7 +116,7 @@ describe("Types", () => {
116
116
data : "aGVsbG8=" , // base64 encoded "hello"
117
117
mimeType : "audio/mp3"
118
118
} ;
119
-
119
+
120
120
const result = ContentBlockSchema . safeParse ( audioContent ) ;
121
121
expect ( result . success ) . toBe ( true ) ;
122
122
if ( result . success ) {
@@ -131,7 +131,7 @@ describe("Types", () => {
131
131
name : "file.txt" ,
132
132
mimeType : "text/plain"
133
133
} ;
134
-
134
+
135
135
const result = ContentBlockSchema . safeParse ( resourceLink ) ;
136
136
expect ( result . success ) . toBe ( true ) ;
137
137
if ( result . success ) {
@@ -148,7 +148,7 @@ describe("Types", () => {
148
148
text : "File contents"
149
149
}
150
150
} ;
151
-
151
+
152
152
const result = ContentBlockSchema . safeParse ( embeddedResource ) ;
153
153
expect ( result . success ) . toBe ( true ) ;
154
154
if ( result . success ) {
@@ -169,7 +169,7 @@ describe("Types", () => {
169
169
mimeType : "text/x-rust"
170
170
}
171
171
} ;
172
-
172
+
173
173
const result = PromptMessageSchema . safeParse ( promptMessage ) ;
174
174
expect ( result . success ) . toBe ( true ) ;
175
175
if ( result . success ) {
@@ -202,7 +202,7 @@ describe("Types", () => {
202
202
}
203
203
]
204
204
} ;
205
-
205
+
206
206
const result = CallToolResultSchema . safeParse ( toolResult ) ;
207
207
expect ( result . success ) . toBe ( true ) ;
208
208
if ( result . success ) {
@@ -215,7 +215,7 @@ describe("Types", () => {
215
215
216
216
test ( "should validate empty content array with default" , ( ) => {
217
217
const toolResult = { } ;
218
-
218
+
219
219
const result = CallToolResultSchema . safeParse ( toolResult ) ;
220
220
expect ( result . success ) . toBe ( true ) ;
221
221
if ( result . success ) {
0 commit comments