From 0a82955e91f842706024b56388363b5be611b8ad Mon Sep 17 00:00:00 2001 From: icarus Date: Thu, 18 Sep 2025 12:59:49 +0800 Subject: [PATCH] refactor(types): replace GetAgentResponse interface with zod schema Use zod schema for better type safety and validation --- src/renderer/src/types/agent.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/types/agent.ts b/src/renderer/src/types/agent.ts index 338856ffcd..de3fd9815f 100644 --- a/src/renderer/src/types/agent.ts +++ b/src/renderer/src/types/agent.ts @@ -120,9 +120,11 @@ export const CreateAgentResponseSchema = AgentEntitySchema export interface UpdateAgentRequest extends Partial {} -export interface GetAgentResponse extends AgentEntity { - built_in_tools?: Tool[] // Built-in tools available to the agent -} +export const GetAgentResponseSchema = AgentEntitySchema.extend({ + built_in_tools: z.array(ToolSchema).optional() // Built-in tools available to the agent +}) + +export type GetAgentResponse = z.infer export type CreateSessionRequest = AgentBase