mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-24 12:41:56 +08:00
refactor(types): convert AgentEntity interface to zod schema
Use zod schema for better runtime validation and type safety
This commit is contained in:
parent
dca6be45b0
commit
2d0d599ac8
@ -61,12 +61,14 @@ export const AgentBaseSchema = z.object({
|
||||
export type AgentBase = z.infer<typeof AgentBaseSchema>
|
||||
|
||||
// Agent entity representing an autonomous agent configuration
|
||||
export interface AgentEntity extends AgentBase {
|
||||
id: string
|
||||
type: AgentType
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
export const AgentEntitySchema = AgentBaseSchema.extend({
|
||||
id: z.string(),
|
||||
type: AgentTypeSchema,
|
||||
created_at: z.iso.datetime(),
|
||||
updated_at: z.iso.datetime()
|
||||
})
|
||||
|
||||
export type AgentEntity = z.infer<typeof AgentEntitySchema>
|
||||
|
||||
export interface ListOptions {
|
||||
limit?: number
|
||||
|
||||
Loading…
Reference in New Issue
Block a user