// SPEC-094: Shared Zod refinements for input safety
import { z } from 'zod';
/** Safe string with max length (default 4096) */
export function safeString(max = 4096) {
    return z.string().max(max);
}
/** Safe path string — max 4096 chars, no null bytes */
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- Zod v4 refinement return type is a complex generic that cannot be written explicitly without duplicating internals
export function safePath() {
    return z
        .string()
        .max(4096)
        .refine((s) => !s.includes('\0'), { message: 'Path must not contain null bytes' });
}
/** Safe array with max length (default 1000) */
export function safeArray(schema, max = 1000) {
    return z.array(schema).max(max);
}
/** Safe content string — for large text fields (default 1MB) */
export function safeContent(max = 1_000_000) {
    return z.string().max(max);
}
/** Safe integer — bounded to prevent overflow */
export function safeInt(min = 0, max = 1_000_000) {
    return z.number().int().min(min).max(max);
}
//# sourceMappingURL=safe-schemas.js.map