Add DisclawConfigSchema and AgentYamlSchema with Zod validation. loader.ts and identity.ts validate external data at parse time. Clear error messages with field name and expected type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
478 B
TypeScript
12 lines
478 B
TypeScript
import { z } from "zod";
|
|
|
|
export const DisclawConfigSchema = z.object({
|
|
workspaces_root: z.string().min(1),
|
|
management_channel: z.string().min(1).default("disclaw"),
|
|
claude_command: z.string().min(1).default("claude"),
|
|
claude_timeout_seconds: z.number().int().positive().default(120),
|
|
max_concurrent_agents: z.number().int().positive().default(4),
|
|
env_blocklist: z.array(z.string()).default([]),
|
|
});
|
|
|
|
export type DisclawConfig = z.infer<typeof DisclawConfigSchema>;
|