// Copyright (c) 2026 Hellmai Ltd
// SPDX-License-Identifier: AGPL-3.0-only
/**
 * @file shared-validators.ts
 * @description CLI integration for shared schema validators (WU-1454)
 *
 * This module re-exports the shared validators from @lumenflow/core so CLI
 * commands can validate arguments using the same schemas as MCP tools.
 *
 * Usage in CLI commands:
 *   import { validateWuBlockArgs } from './shared-validators.js';
 *
 *   const result = validateWuBlockArgs({ id, reason });
 *   if (!result.valid) {
 *     die(result.errors.join(', '));
 *   }
 *   // Use result.normalized for validated + typed data
 *
 * These validators ensure CLI and MCP validate inputs identically.
 * The schemas are the single source of truth in @lumenflow/core.
 */
import { validateInitiativeEditArgs as validateInitiativeEditSchemaArgs, validateWuValidateArgs as validateWuValidateSchemaArgs, } from '@lumenflow/core';
// WU-1431: Original 5 command validators
export { validateWuCreateArgs, validateWuClaimArgs, validateWuStatusArgs, validateWuDoneArgs, validateGatesArgs, } from '@lumenflow/core';
// WU-1454: 16 lifecycle command validators
export { validateWuBlockArgs, validateWuUnblockArgs, validateWuEditArgs, validateWuReleaseArgs, validateWuRecoverArgs, validateWuRepairArgs, validateWuDepsArgs, validateWuPrepArgs, validateWuPreflightArgs, validateWuPruneArgs, validateWuDeleteArgs, validateWuCleanupArgs, validateWuSpawnArgs, validateWuValidateArgs, validateWuInferLaneArgs, validateWuUnlockLaneArgs, } from '@lumenflow/core';
// WU-1455: 8 initiative command validators
export { validateInitiativeCreateArgs, validateInitiativeEditArgs, validateInitiativeListArgs, validateInitiativeStatusArgs, validateInitiativeAddWuArgs, validateInitiativeRemoveWuArgs, validateInitiativeBulkAssignArgs, validateInitiativePlanArgs, } from '@lumenflow/core';
export function normalizeInitiativeEditCliArgs(args) {
    return {
        id: args.id,
        status: args.status,
        blocked_by: args.blockedBy,
        blocked_reason: args.blockedReason,
        unblock: args.unblock,
        add_lane: args.addLane,
        remove_lane: args.removeLane,
        notes: args.notes,
        description: args.description,
        add_phase: args.addPhase,
        add_success_metric: args.addSuccessMetric,
        remove_success_metric: args.removeSuccessMetric,
        phase_id: args.phaseId,
        phase_status: args.phaseStatus,
        phase_title: args.phaseTitle,
        created: args.created,
        // WU-2354: Phase execution order and dependency model
        phase_execution_order: args.phaseExecutionOrder,
        dependency_model: args.dependencyModel,
    };
}
export function validateInitiativeEditCliArgs(args) {
    return validateInitiativeEditSchemaArgs(normalizeInitiativeEditCliArgs(args));
}
export function validateWuValidateCliArgs(args) {
    return validateWuValidateSchemaArgs({
        id: args.id,
        no_strict: args.noStrict,
    });
}
export function validateWuProtoCliArgs(args) {
    const normalized = {
        lane: args.lane,
        title: args.title,
        description: args.description,
        code_paths: args.codePaths,
        labels: args.labels,
        assigned_to: args.assignedTo,
    };
    const errors = [];
    if (!normalized.lane || normalized.lane.trim() === '') {
        errors.push('lane is required');
    }
    if (!normalized.title || normalized.title.trim() === '') {
        errors.push('title is required');
    }
    return {
        valid: errors.length === 0,
        errors,
        warnings: [],
        normalized,
    };
}
//# sourceMappingURL=shared-validators.js.map