Commit db49955
committed
fix(core): typed-S overload types handler from passed schema; Client/Server use default S
Fix type/runtime disagreement: when calling 3-arg setRequestHandler with a
method in S, overload 1 typed handler params from S[K]['params'] but runtime
parses with the passed paramsSchema. Now constrains paramsSchema to
StandardSchemaV1<S[K]['params']> and types handler from SchemaOutput<P>.
Client/Server now extend Protocol<ProtocolSpec, ...> (default S) instead of
Protocol<McpSpec, ...>, so the typed-S overload doesn't fire on them — spec
methods use the 2-arg form, custom methods use the 3-arg string fallback.
McpSpec stays exported for users who want to compose it.1 parent 92a859d commit db49955
4 files changed
+30
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | | - | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
831 | 833 | | |
832 | 834 | | |
833 | 835 | | |
834 | | - | |
| 836 | + | |
835 | 837 | | |
836 | 838 | | |
837 | | - | |
| 839 | + | |
838 | 840 | | |
839 | | - | |
| 841 | + | |
840 | 842 | | |
841 | 843 | | |
842 | 844 | | |
| |||
1118 | 1120 | | |
1119 | 1121 | | |
1120 | 1122 | | |
1121 | | - | |
| 1123 | + | |
1122 | 1124 | | |
1123 | | - | |
1124 | | - | |
| 1125 | + | |
| 1126 | + | |
1125 | 1127 | | |
1126 | 1128 | | |
1127 | 1129 | | |
| |||
1186 | 1188 | | |
1187 | 1189 | | |
1188 | 1190 | | |
1189 | | - | |
| 1191 | + | |
1190 | 1192 | | |
1191 | | - | |
1192 | | - | |
| 1193 | + | |
| 1194 | + | |
1193 | 1195 | | |
1194 | 1196 | | |
1195 | 1197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
228 | 242 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
0 commit comments