refactor(types): convert AgentSessionEntity interface to zod schema

Use zod schema for better type safety and validation capabilities
This commit is contained in:
icarus 2025-09-18 13:01:57 +08:00
parent 71a1daddef
commit 7a4952f773

View File

@ -78,15 +78,17 @@ export interface ListOptions {
}
// AgentSession entity representing a conversation session with one or more agents
export interface AgentSessionEntity extends AgentBase {
id: string
agent_id: string // Primary agent ID for the session
agent_type: AgentType
export const AgentSessionEntitySchema = AgentBaseSchema.extend({
id: z.string(),
agent_id: z.string(), // Primary agent ID for the session
agent_type: AgentTypeSchema,
// sub_agent_ids?: string[] // Array of sub-agent IDs involved in the session
created_at: string
updated_at: string
}
created_at: z.iso.datetime(),
updated_at: z.iso.datetime()
})
export type AgentSessionEntity = z.infer<typeof AgentSessionEntitySchema>
// AgentSessionMessageEntity representing a message within a session
export interface AgentSessionMessageEntity {