fix(web,hub): let the team settings dialog set a lead session

Teams created without a lead previously dead-ended: members cannot be
spawned until a lead exists. PATCH /api/teams/:id now accepts
leadSessionId; the settings dialog exposes a lead picker and delivers the
lead brief on save.
This commit is contained in:
2026-09-15 09:56:12 +08:00
parent 11a33991ea
commit a37479a92c
8 changed files with 101 additions and 13 deletions
+7 -4
View File
@@ -501,10 +501,13 @@ export type CreateTeamTaskRequest = z.infer<typeof CreateTeamTaskRequestSchema>
export const UpdateTeamRequestSchema = z.object({
name: z.string().min(1).max(200).optional(),
status: z.enum(['active', 'archived']).optional()
}).refine((value) => value.name !== undefined || value.status !== undefined, {
message: 'name or status is required'
})
status: z.enum(['active', 'archived']).optional(),
/** Set (or clear) the lead session. */
leadSessionId: z.string().min(1).nullable().optional()
}).refine(
(value) => value.name !== undefined || value.status !== undefined || value.leadSessionId !== undefined,
{ message: 'name, status or leadSessionId is required' }
)
export type UpdateTeamRequest = z.infer<typeof UpdateTeamRequestSchema>