feat(a2ui): enhance A2UI notification handling and multi-select support

This commit is contained in:
catlog22
2026-02-04 11:11:55 +08:00
parent c6093ef741
commit 1a05551d00
14 changed files with 539 additions and 94 deletions

View File

@@ -175,11 +175,16 @@ export const SurfaceComponentSchema = z.object({
component: ComponentSchema,
});
/** Display mode for A2UI surfaces */
export const DisplayModeSchema = z.enum(['popup', 'panel']);
/** Surface update message */
export const SurfaceUpdateSchema = z.object({
surfaceId: z.string(),
components: z.array(SurfaceComponentSchema),
initialState: z.record(z.unknown()).optional(),
/** Display mode: 'popup' for centered dialog, 'panel' for notification panel */
displayMode: DisplayModeSchema.optional(),
});
// ========== TypeScript Types ==========
@@ -206,6 +211,7 @@ export type DateTimeInputComponent = z.infer<typeof DateTimeInputComponentSchema
export type A2UIComponent = z.infer<typeof ComponentSchema>;
export type SurfaceComponent = z.infer<typeof SurfaceComponentSchema>;
export type SurfaceUpdate = z.infer<typeof SurfaceUpdateSchema>;
export type DisplayMode = z.infer<typeof DisplayModeSchema>;
// ========== Helper Types ==========