From f7e09150444dfbedbbad07f84e2f3414ae2b53d8 Mon Sep 17 00:00:00 2001 From: Hermes Date: Thu, 30 Jul 2026 23:56:38 +0000 Subject: [PATCH] fix(build): use zod v3 two-arg form for z.record in agent schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zod 3.25 (the version resolved by ^3.25.0) requires z.record() to take both a key and a value schema. The single-arg form z.record(z.unknown()) is zod v4 syntax, which trips next build's typecheck. Four call sites in packages/shared/src/schemas/agent.ts were written in v4 form (lines 39, 41, 73, 74). This is a pure type-only fix — runtime behavior is identical. --- packages/shared/src/schemas/agent.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/shared/src/schemas/agent.ts b/packages/shared/src/schemas/agent.ts index bcc31f0..6df0ab6 100644 --- a/packages/shared/src/schemas/agent.ts +++ b/packages/shared/src/schemas/agent.ts @@ -36,9 +36,9 @@ export const agentTaskSchema = z.object({ id: z.string(), agent_id: z.string(), task_type: z.string(), - input: z.record(z.unknown()), + input: z.record(z.string(), z.unknown()), status: z.enum(['pending', 'running', 'completed', 'failed']).default('pending'), - output: z.record(z.unknown()).optional(), + output: z.record(z.string(), z.unknown()).optional(), error_message: z.string().optional(), started_at: z.string().datetime().optional(), completed_at: z.string().datetime().optional(), @@ -70,8 +70,8 @@ export const agentSchema = z.object({ last_active_at: z.string().datetime().optional(), domain: z.string(), tags: z.array(z.string()).default([]), - config: z.record(z.unknown()).optional(), - custom_fields: z.record(z.unknown()).optional(), + config: z.record(z.string(), z.unknown()).optional(), + custom_fields: z.record(z.string(), z.unknown()).optional(), created: z.string().datetime(), updated: z.string().datetime(), });