mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
- Refactored the write_todos tool to enhance argument and result schemas using Zod for better validation and type safety. - Updated the WriteTodosToolUI to streamline the rendering logic and improve loading states, ensuring a smoother user experience. - Enhanced the Plan and TodoItem components to better handle streaming states and display progress, providing clearer feedback during task management. - Cleaned up code formatting and structure for improved readability and maintainability.
23 lines
572 B
TypeScript
23 lines
572 B
TypeScript
import { z } from "zod";
|
|
|
|
/**
|
|
* Shared action schema for tool UI components
|
|
*/
|
|
export const ActionSchema = z.object({
|
|
id: z.string(),
|
|
label: z.string(),
|
|
variant: z.enum(["default", "secondary", "destructive", "outline", "ghost", "link"]).optional(),
|
|
disabled: z.boolean().optional(),
|
|
});
|
|
|
|
export type Action = z.infer<typeof ActionSchema>;
|
|
|
|
/**
|
|
* Actions configuration schema
|
|
*/
|
|
export const ActionsConfigSchema = z.object({
|
|
confirm: ActionSchema.optional(),
|
|
cancel: ActionSchema.optional(),
|
|
});
|
|
|
|
export type ActionsConfig = z.infer<typeof ActionsConfigSchema>;
|