export function nowIso() {
    return new Date().toISOString();
}
export function normalizeText(value) {
    return String(value || '').trim();
}
export function isJsonObject(value) {
    return Boolean(value) && typeof value === 'object' && (!Array.isArray(value));
}
export function asRecord(value, options) {
    if (!value || typeof value !== 'object') {
        return {};
    }
    if (!options?.allowArray && Array.isArray(value)) {
        return {};
    }
    return value;
}
export function readString(record, keys) {
    for (const key of keys) {
        const value = record[key];
        if (typeof value === 'string' && value.trim()) {
            return value.trim();
        }
    }
    return '';
}
export function resolveStreamUsage(streamedUsage, completedUsage) {
    return streamedUsage ?? completedUsage ?? undefined;
}
//# sourceMappingURL=utils.js.map