mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-05 12:29:44 +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>
|
export type AgentBase = z.infer<typeof AgentBaseSchema>
|
||||||
|
|
||||||
// Agent entity representing an autonomous agent configuration
|
// Agent entity representing an autonomous agent configuration
|
||||||
export interface AgentEntity extends AgentBase {
|
export const AgentEntitySchema = AgentBaseSchema.extend({
|
||||||
id: string
|
id: z.string(),
|
||||||
type: AgentType
|
type: AgentTypeSchema,
|
||||||
created_at: string
|
created_at: z.iso.datetime(),
|
||||||
updated_at: string
|
updated_at: z.iso.datetime()
|
||||||
}
|
})
|
||||||
|
|
||||||
|
export type AgentEntity = z.infer<typeof AgentEntitySchema>
|
||||||
|
|
||||||
export interface ListOptions {
|
export interface ListOptions {
|
||||||
limit?: number
|
limit?: number
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user