Commit a8171e4
fix: define CreateMessageResultSchema locally for backwards compat
The spec's CreateMessageResult includes array content and tool types
(ToolUseContent, ToolResultContent), but the SDK's v1.x API expects
single content without tools for backwards compatibility.
- Import generated CreateMessageResultSchema as CreateMessageResultSpecSchema
- Define local CreateMessageResultSchema with single SamplingContentSchema
(text/image/audio only, no arrays, no tool types)
- Keep CreateMessageResultWithToolsSchema for full spec-compliant responses
This fixes type errors in toolWithSampleServer.ts and spec.types.test.ts
where code expected single content blocks.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 6eef9e6 commit a8171e4
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
595 | 596 | | |
596 | 597 | | |
597 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
598 | 620 | | |
599 | 621 | | |
600 | 622 | | |
| |||
0 commit comments