feat(types): add DeleteAgentResponse type and update AgentService

Update AgentService to use DeleteAgentResponse type instead of boolean for better type safety
This commit is contained in:
icarus
2025-09-18 13:24:00 +08:00
parent 230205d210
commit 219844cb74
2 changed files with 4 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import type {
AgentEntity,
CreateAgentRequest,
CreateAgentResponse,
DeleteAgentResponse,
GetAgentResponse,
ListAgentsResponse,
ListOptions,
@@ -143,7 +144,7 @@ export class AgentService extends BaseService {
return await this.getAgent(id)
}
async deleteAgent(id: string): Promise<boolean> {
async deleteAgent(id: string): Promise<DeleteAgentResponse> {
this.ensureInitialized()
const result = await this.database.delete(agentsTable).where(eq(agentsTable.id, id))

View File

@@ -142,6 +142,8 @@ export const UpdateAgentResponseSchema = GetAgentResponseSchema
export type UpdateAgentResponse = GetAgentResponse
export type DeleteAgentResponse = boolean
export type CreateSessionRequest = AgentBase
export interface UpdateSessionRequest extends Partial<AgentBase> {}