Commit 8c1aefc
committed
* In completable.ts
- add `isCompletable` function, a runtime type guard to detect `Completable`-wrapped Zod types
* In mcp.test.ts
- Added tests
- "should not advertise support for completion when a resource template without a complete callback is defined"
- "should not advertise support for completion when a prompt without a completable argument is defined"
* In mcp.ts
- in `handlePromptCompletion` method,
- fix warning "Invalid 'instanceof' check: 'field' has type that is not related to 'Completable<any>'" by using the new `isCompletable` function from `completable.ts`
- in `setResourceRequestHandlers` method
- remove unconditional call to `setCompletionRequestHandler` - supporting resources does not automatically mean that resource template completion is supported
- in `setPromptRequestHandlers` method
- remove unconditional call to `setCompletionRequestHandler` - supporting prompts does not automatically mean that prompt argument completion is supported
- in `_createRegisteredResourceTemplate` method
- check if the resource template being registered has a complete callback,
- if so, call `setCompletionRequestHandler`
- in _`createRegisteredPrompt` method
- check if any argument of the prompt has a `Completable` schema
- if so, call `setCompletionRequestHandler`1 parent c84ef24 commit 8c1aefc
3 files changed
+113
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2285 | 2285 | | |
2286 | 2286 | | |
2287 | 2287 | | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
2288 | 2327 | | |
2289 | 2328 | | |
2290 | 2329 | | |
| |||
3137 | 3176 | | |
3138 | 3177 | | |
3139 | 3178 | | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
3140 | 3223 | | |
3141 | 3224 | | |
3142 | 3225 | | |
| |||
3172 | 3255 | | |
3173 | 3256 | | |
3174 | 3257 | | |
3175 | | - | |
| 3258 | + | |
3176 | 3259 | | |
3177 | 3260 | | |
3178 | 3261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | 354 | | |
357 | 355 | | |
358 | 356 | | |
| |||
416 | 414 | | |
417 | 415 | | |
418 | 416 | | |
419 | | - | |
420 | | - | |
421 | 417 | | |
422 | 418 | | |
423 | 419 | | |
| |||
604 | 600 | | |
605 | 601 | | |
606 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
607 | 611 | | |
608 | 612 | | |
609 | 613 | | |
| |||
637 | 641 | | |
638 | 642 | | |
639 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
640 | 656 | | |
641 | 657 | | |
642 | 658 | | |
| |||
0 commit comments