export function buildPerSlugManifest(input) {
    const m = {
        slug: input.slug,
        origin: input.origin,
        schedule: input.schedule,
        priority: input.priority,
        expectedDurationMinutes: input.expectedDurationMinutes,
        enabled: input.enabled,
        execute: input.execute,
        manifestVersion: 1,
    };
    if (input.model !== undefined)
        m.model = input.model;
    if (input.tags !== undefined)
        m.tags = input.tags;
    if (input.unrestrictedTools !== undefined)
        m.unrestrictedTools = input.unrestrictedTools;
    if (input.gate !== undefined)
        m.gate = input.gate;
    if (input.telegramNotify !== undefined)
        m.telegramNotify = input.telegramNotify;
    if (input.topicId !== undefined)
        m.topicId = input.topicId;
    if (input.machines !== undefined)
        m.machines = input.machines;
    if (input.mcpAccess !== undefined)
        m.mcpAccess = input.mcpAccess;
    if (input.disabledAtBodyHash !== undefined)
        m.disabledAtBodyHash = input.disabledAtBodyHash;
    return m;
}
/**
 * Coerce a frontmatter/entry value (which may be a string under YAML FAILSAFE_SCHEMA,
 * or already a number) to a positive finite minutes count. Returns null when the value
 * is absent, non-numeric, or non-positive — the caller then fails loud (records an
 * error + skips), never writing a `NaN`/`null` into the manifest.
 */
export function coerceDurationMinutes(raw) {
    if (raw === undefined || raw === null || raw === '')
        return null;
    const n = Number(raw);
    return Number.isFinite(n) && n > 0 ? n : null;
}
/** Coerce a frontmatter unrestrictedTools value (boolean, or "true"/"false" string). */
export function coerceBool(raw) {
    if (typeof raw === 'boolean')
        return raw;
    if (raw === 'true')
        return true;
    if (raw === 'false')
        return false;
    return undefined;
}
//# sourceMappingURL=buildPerSlugManifest.js.map