fix(types): resolve zod v3 type inference differences in task tools

zod v3 infers .default([]) fields as string[] | undefined in z.infer
output type (unlike v4 which marks them as string[]). Add nullish
coalescing guards and use any[] for the readJsonSafe result array
to avoid the type mismatch in task-list and task-update.
This commit is contained in:
YeonGyu-Kim
2026-04-06 14:20:30 +09:00
parent 205269421d
commit 213cee27cc
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -114,12 +114,12 @@ async function handleUpdate(
const addBlocks = args.addBlocks as string[] | undefined;
if (addBlocks) {
task.blocks = [...new Set([...task.blocks, ...addBlocks])];
task.blocks = [...new Set([...(task.blocks ?? []), ...addBlocks])];
}
const addBlockedBy = args.addBlockedBy as string[] | undefined;
if (addBlockedBy) {
task.blockedBy = [...new Set([...task.blockedBy, ...addBlockedBy])];
task.blockedBy = [...new Set([...(task.blockedBy ?? []), ...addBlockedBy])];
}
if (validatedArgs.metadata !== undefined) {