Skip to content

Commit 7603a44

Browse files
ochafikclaude
andcommitted
docs: add note about ElicitationCapability being kept local
ElicitationCapabilitySchema is kept as a local definition in types.ts because it has z.preprocess for backwards compatibility (handling empty objects as { form: {} }). ClientCapabilitiesSchema and ServerCapabilitiesSchema are also kept local because they use AssertObjectSchema for better type safety. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ea65932 commit 7603a44

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

scripts/generate-schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const DISCRIMINATED_UNIONS: Record<string, string> = {
118118
const DERIVED_CAPABILITY_TYPES: Record<string, { parent: string; property: string }> = {
119119
'ClientTasksCapability': { parent: 'ClientCapabilities', property: 'tasks' },
120120
'ServerTasksCapability': { parent: 'ServerCapabilities', property: 'tasks' },
121+
// Note: ElicitationCapability is kept local in types.ts because it has z.preprocess for backwards compat
121122
};
122123

123124
// =============================================================================

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ export const ClientCapabilitiesSchema = z.object({
540540

541541
/**
542542
* Elicitation capability schema - extracted from ClientCapabilitiesSchema.
543-
* Includes preprocessing to handle empty objects as { form: {} }.
543+
* Has special preprocessing to handle empty objects as { form: {} } for backwards compatibility.
544544
*/
545545
export const ElicitationCapabilitySchema = ClientCapabilitiesSchema.shape.elicitation.unwrap();
546546

0 commit comments

Comments
 (0)