/**
 * Shared input-validation primitives for NERF tool handlers.
 */
/** Type guard: value is a string with at least one non-whitespace character. */
export function isNonEmptyString(value) {
    return typeof value === "string" && value.trim().length > 0;
}
/**
 * Validate that `value` is an array of non-empty strings.
 * Throws with a message referencing `field` on failure.
 * Returns the validated array (narrowed to string[]).
 */
export function validateStringArray(value, field) {
    if (!Array.isArray(value)) {
        throw new Error(`${field} must be an array`);
    }
    if (value.some((item) => !isNonEmptyString(item))) {
        throw new Error(`${field} must contain only non-empty strings`);
    }
    return value;
}
