Make it styles.variables instead of styles

This commit is contained in:
martinalong 2025-12-14 12:28:42 -08:00
commit 445a5836cf
No known key found for this signature in database
3 changed files with 717 additions and 496 deletions

File diff suppressed because it is too large Load diff

View file

@ -63,6 +63,10 @@ export type McpUiToolCancelledNotificationSchemaInferredType = z.infer<
typeof generated.McpUiToolCancelledNotificationSchema
>;
export type McpUiHostStylesSchemaInferredType = z.infer<
typeof generated.McpUiHostStylesSchema
>;
export type McpUiResourceTeardownRequestSchemaInferredType = z.infer<
typeof generated.McpUiResourceTeardownRequestSchema
>;
@ -177,6 +181,8 @@ expectType<spec.McpUiToolCancelledNotification>(
expectType<McpUiToolCancelledNotificationSchemaInferredType>(
{} as spec.McpUiToolCancelledNotification,
);
expectType<spec.McpUiHostStyles>({} as McpUiHostStylesSchemaInferredType);
expectType<McpUiHostStylesSchemaInferredType>({} as spec.McpUiHostStyles);
expectType<spec.McpUiResourceTeardownRequest>(
{} as McpUiResourceTeardownRequestSchemaInferredType,
);

View file

@ -246,6 +246,16 @@ export const McpUiToolCancelledNotificationSchema = z.object({
}),
});
/**
* @description Style configuration for theming MCP apps.
*/
export const McpUiHostStylesSchema = z.object({
/** @description CSS variables for theming the app. */
variables: McpUiStylesSchema.optional().describe(
"CSS variables for theming the app.",
),
});
/**
* @description Request for graceful shutdown of the Guest UI (Host -> Guest UI).
* @see {@link app-bridge.AppBridge.sendResourceTeardown} for the host method that sends this
@ -422,9 +432,9 @@ export const McpUiHostContextSchema = z.looseObject({
theme: McpUiThemeSchema.optional().describe(
"Current color theme preference.",
),
/** @description CSS variables for theming the app. */
styles: McpUiStylesSchema.optional().describe(
"CSS variables for theming the app.",
/** @description Style configuration for theming the app. */
styles: McpUiHostStylesSchema.optional().describe(
"Style configuration for theming the app.",
),
/** @description How the UI is currently displayed. */
displayMode: McpUiDisplayModeSchema.optional().describe(