/** * ClawLink config schema — Zod-based runtime validation. * * This mirrors the JSON schema in openclaw.plugin.json but provides * type-safe runtime parsing via Zod. * * Uses direct zod dependency (same pattern as openclaw-weixin v2.1.1) * rather than openclaw/plugin-sdk/zod, which is only available in * OpenClaw >= ~2026.3.28 and would break on earlier supported hosts. */ import { z } from 'zod'; // --------------------------------------------------------------------------- // Zod config schema // --------------------------------------------------------------------------- const clawlinkAccountSchema = z.object({ name: z.string().optional(), enabled: z.boolean().optional(), agent_id: z.string(), api_key: z.string(), api_base: z.string().default('https://api.clawlink.club'), }); /** Top-level clawlink config schema. */ export const ClawlinkConfigSchema = clawlinkAccountSchema.extend({ accounts: z.record(z.string(), clawlinkAccountSchema).optional(), });