Have apps request display mode instead

This commit is contained in:
martinalong 2025-12-14 18:52:55 -08:00
commit 83860d7c31
No known key found for this signature in database

View file

@ -307,6 +307,31 @@ export const McpUiResourceMetaSchema = z.object({
),
});
/**
* @description Request to change the display mode of the UI.
* The host will respond with the actual display mode that was set,
* which may differ from the requested mode if not supported.
* @see {@link app.App.requestDisplayMode} for the method that sends this request
*/
export const McpUiRequestDisplayModeRequestSchema = z.object({
method: z.literal("ui/request-display-mode"),
params: z.object({
/** @description The display mode being requested. */
mode: McpUiDisplayModeSchema.describe("The display mode being requested."),
}),
});
/**
* @description Result from requesting a display mode change.
* @see {@link McpUiRequestDisplayModeRequest}
*/
export const McpUiRequestDisplayModeResultSchema = z.looseObject({
/** @description The display mode that was actually set. May differ from requested if not supported. */
mode: McpUiDisplayModeSchema.describe(
"The display mode that was actually set. May differ from requested if not supported.",
),
});
/**
* @description Request to send a message to the host's chat interface.
* @see {@link app.App.sendMessage} for the method that sends this request