Skip to content

Commit 60ebd53

Browse files
ochafikclaude
andcommitted
chore: remove type compatibility verification section
Remove the unused type check assertions at the end of types.ts. These were compile-time only checks that didn't provide runtime value and added maintenance burden. The Infer<typeof> type exports remain as they're tied to local schemas which have SDK-specific enhancements (AssertObjectSchema, z.preprocess, etc). Types.ts: 1166 lines (down from 1209) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c10396c commit 60ebd53

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

src/types.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,46 +1164,3 @@ export type ServerRequest = Infer<typeof ServerRequestSchema>;
11641164
export type ServerNotification = Infer<typeof ServerNotificationSchema>;
11651165
export type ServerResult = Infer<typeof ServerResultSchema>;
11661166

1167-
// =============================================================================
1168-
// Type Compatibility Verification with Generated Types
1169-
// =============================================================================
1170-
// This section verifies that manually-defined types match generated types.
1171-
// If there's a mismatch, TypeScript will error here, catching drift early.
1172-
// Once verified, these can be progressively replaced with re-exports.
1173-
1174-
import type * as Generated from './generated/sdk.types.js';
1175-
1176-
// Helper types for bidirectional assignability checks
1177-
type AssertAssignable<T, U> = T extends U ? true : false;
1178-
type AssertEqual<T, U> = [T] extends [U] ? ([U] extends [T] ? true : false) : false;
1179-
1180-
// Verify primitive types
1181-
type _CheckProgressToken = AssertEqual<ProgressToken, Generated.ProgressToken>;
1182-
type _CheckCursor = AssertEqual<Cursor, Generated.Cursor>;
1183-
type _CheckRequestId = AssertEqual<RequestId, Generated.RequestId>;
1184-
1185-
// Verify core message types
1186-
type _CheckRequest = AssertAssignable<Request, Generated.Request>;
1187-
type _CheckNotification = AssertAssignable<Notification, Generated.Notification>;
1188-
type _CheckResult = AssertAssignable<Result, Generated.Result>;
1189-
1190-
// Verify JSON-RPC types
1191-
type _CheckJSONRPCRequest = AssertEqual<JSONRPCRequest, Generated.JSONRPCRequest>;
1192-
type _CheckJSONRPCNotification = AssertEqual<JSONRPCNotification, Generated.JSONRPCNotification>;
1193-
type _CheckJSONRPCResponse = AssertEqual<JSONRPCResponse, Generated.JSONRPCResponse>;
1194-
1195-
// Verify commonly used types
1196-
type _CheckTool = AssertAssignable<Tool, Generated.Tool>;
1197-
type _CheckResource = AssertAssignable<Resource, Generated.Resource>;
1198-
type _CheckPrompt = AssertAssignable<Prompt, Generated.Prompt>;
1199-
type _CheckImplementation = AssertEqual<Implementation, Generated.Implementation>;
1200-
1201-
// Verify content types
1202-
type _CheckTextContent = AssertEqual<TextContent, Generated.TextContent>;
1203-
type _CheckImageContent = AssertEqual<ImageContent, Generated.ImageContent>;
1204-
type _CheckAudioContent = AssertEqual<AudioContent, Generated.AudioContent>;
1205-
1206-
// Verify request/notification types (these should extend Request/Notification, not JSONRPC*)
1207-
type _CheckInitializeRequest = AssertAssignable<InitializeRequest, Generated.InitializeRequest>;
1208-
type _CheckCallToolRequest = AssertAssignable<CallToolRequest, Generated.CallToolRequest>;
1209-
type _CheckCancelledNotification = AssertAssignable<CancelledNotification, Generated.CancelledNotification>;

0 commit comments

Comments
 (0)