Commit 5f0a3b0
feat(swift-host): add structuredContent support + JS console logging
- Use client.send() directly to get full CallTool.Result including structuredContent
(the SDK's callTool() helper drops structuredContent)
- Add Value.toAny() extension to convert MCP Value to Any for AnyCodable
- Update ToolResult to include structuredContent field
- Pass structuredContent to AppBridge.sendToolResult() when present
- Add WKScriptMessageHandler to capture JavaScript console.log/error/warn
from WebView and output as [JS LOG/ERROR/WARN] messages
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent ac927cd commit 5f0a3b0
File tree
2 files changed
+70
-9
lines changed- examples/basic-host-swift/Sources/BasicHostApp
2 files changed
+70
-9
lines changedLines changed: 31 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
9 | 25 | | |
10 | 26 | | |
11 | 27 | | |
| |||
282 | 298 | | |
283 | 299 | | |
284 | 300 | | |
| 301 | + | |
285 | 302 | | |
286 | 303 | | |
287 | 304 | | |
| |||
333 | 350 | | |
334 | 351 | | |
335 | 352 | | |
336 | | - | |
337 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
338 | 361 | | |
339 | 362 | | |
340 | 363 | | |
| |||
407 | 430 | | |
408 | 431 | | |
409 | 432 | | |
410 | | - | |
411 | 433 | | |
412 | 434 | | |
413 | 435 | | |
414 | 436 | | |
415 | | - | |
416 | 437 | | |
417 | 438 | | |
418 | 439 | | |
| |||
422 | 443 | | |
423 | 444 | | |
424 | 445 | | |
425 | | - | |
| 446 | + | |
426 | 447 | | |
427 | 448 | | |
428 | 449 | | |
429 | | - | |
430 | 450 | | |
431 | 451 | | |
432 | 452 | | |
| |||
495 | 515 | | |
496 | 516 | | |
497 | 517 | | |
498 | | - | |
| 518 | + | |
499 | 519 | | |
500 | 520 | | |
501 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
502 | 526 | | |
503 | 527 | | |
504 | 528 | | |
| |||
Lines changed: 39 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
23 | 49 | | |
24 | 50 | | |
25 | 51 | | |
| |||
104 | 130 | | |
105 | 131 | | |
106 | 132 | | |
107 | | - | |
108 | | - | |
| 133 | + | |
| 134 | + | |
109 | 135 | | |
110 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
111 | 148 | | |
112 | 149 | | |
113 | 150 | | |
| |||
0 commit comments