fix(build): use zod v3 two-arg form for z.record in agent schema
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.
This commit is contained in:
@@ -36,9 +36,9 @@ export const agentTaskSchema = z.object({
|
|||||||
id: z.string(),
|
id: z.string(),
|
||||||
agent_id: z.string(),
|
agent_id: z.string(),
|
||||||
task_type: 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'),
|
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(),
|
error_message: z.string().optional(),
|
||||||
started_at: z.string().datetime().optional(),
|
started_at: z.string().datetime().optional(),
|
||||||
completed_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(),
|
last_active_at: z.string().datetime().optional(),
|
||||||
domain: z.string(),
|
domain: z.string(),
|
||||||
tags: z.array(z.string()).default([]),
|
tags: z.array(z.string()).default([]),
|
||||||
config: z.record(z.unknown()).optional(),
|
config: z.record(z.string(), z.unknown()).optional(),
|
||||||
custom_fields: z.record(z.unknown()).optional(),
|
custom_fields: z.record(z.string(), z.unknown()).optional(),
|
||||||
created: z.string().datetime(),
|
created: z.string().datetime(),
|
||||||
updated: z.string().datetime(),
|
updated: z.string().datetime(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user