feat(types): add UpdateAgentResponse type and schema

Update agent service to use new response type for consistency
This commit is contained in:
icarus 2025-09-18 13:21:37 +08:00
parent f9fb0f9125
commit 230205d210
2 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,8 @@ import type {
GetAgentResponse,
ListAgentsResponse,
ListOptions,
UpdateAgentRequest
UpdateAgentRequest,
UpdateAgentResponse
} from '@types'
import { count, eq } from 'drizzle-orm'
@ -111,7 +112,7 @@ export class AgentService extends BaseService {
return { agents, total: totalResult[0].count }
}
async updateAgent(id: string, updates: UpdateAgentRequest): Promise<GetAgentResponse | null> {
async updateAgent(id: string, updates: UpdateAgentRequest): Promise<UpdateAgentResponse | null> {
this.ensureInitialized()
// Check if agent exists

View File

@ -138,6 +138,10 @@ export const ListAgentsResponseSchema = z.object({
export type ListAgentsResponse = z.infer<typeof ListAgentsResponseSchema>
export const UpdateAgentResponseSchema = GetAgentResponseSchema
export type UpdateAgentResponse = GetAgentResponse
export type CreateSessionRequest = AgentBase
export interface UpdateSessionRequest extends Partial<AgentBase> {}