// schemas/output-schemas.ts — Zod output schemas for MCP tools with structured output.
// Used with registerTool({ outputSchema }) to declare tool output structure.
// See: https://spec.modelcontextprotocol.io/specification/draft/server/tools/#structured-content
import { z } from 'zod';
// ── list_specs ──────────────────────────────────────────────────────────────
export const ListSpecsOutputSchema = {
    projectId: z.string(),
    filters: z.object({
        status: z.string(),
        type: z.string(),
    }),
    count: z.number(),
    totalCount: z.number(),
    specs: z.array(z.object({
        id: z.string(),
        title: z.string(),
        type: z.string(),
        scope: z.string(),
        status: z.string(),
        difficulty: z.string(),
        risk: z.string(),
        target: z.string(),
        tags: z.array(z.string()),
        gitBranch: z.string().optional(),
        estimation: z.object({
            devHours: z.number(),
            totalCostUsd: z.number(),
        }),
        createdAt: z.string(),
        updatedAt: z.string(),
        lastModified: z.string(),
    })),
    summary: z.object({
        byStatus: z.record(z.string(), z.number()),
        byType: z.record(z.string(), z.number()),
        totalDevHours: z.number(),
        totalReviewHours: z.number(),
        totalCostUsd: z.number(),
    }),
    teamSuggestion: z
        .object({
        recommended: z.boolean(),
        reason: z.string(),
        templateId: z.string(),
        teamSize: z.number(),
        specs: z.array(z.string()),
        toolCalls: z.array(z.string()),
    })
        .nullable(),
    message: z.string(),
};
// ── estimate ────────────────────────────────────────────────────────────────
export const EstimateOutputSchema = {
    specId: z.string(),
    difficulty: z.string(),
    confidence: z.string(),
    estimation: z.object({
        devHours: z.number(),
        reviewHours: z.number(),
        totalHours: z.number(),
        recommendedModel: z.string(),
        tokensOpus: z.number(),
        tokensSonnet: z.number(),
        apiCostUsd: z.number(),
        humanCostUsd: z.number(),
        totalCostUsd: z.number(),
        tokenOptimization: z.object({
            estimatedSavings: z.number(),
            suggestions: z.array(z.string()),
        }),
    }),
    tokenStrategy: z.object({
        operationMode: z.string(),
        suggestedAiModel: z.string(),
        modelRationale: z.string(),
    }),
    reasoning: z.array(z.string()),
    similarSpecs: z.array(z.object({
        specId: z.string(),
        similarity: z.number(),
    })),
    historyUsed: z.boolean(),
};
// ── validate ────────────────────────────────────────────────────────────────
export const ValidateOutputSchema = {
    specId: z.string(),
    title: z.string(),
    score: z.number(),
    fieldsImplemented: z.number(),
    fieldsTotal: z.number(),
    matches: z.array(z.string()),
    missing: z.array(z.string()),
    extra: z.array(z.string()),
    qualityIssues: z.array(z.object({
        file: z.string(),
        line: z.number().optional(),
        severity: z.string(),
        rule: z.string(),
        message: z.string(),
        suggestion: z.string().optional(),
    })),
    implementationQualityScore: z.object({
        overall: z.number(),
        gradeLetter: z.string(),
        filesAudited: z.number(),
        categories: z.array(z.object({
            category: z.string(),
            score: z.number(),
            weight: z.number(),
            issueCount: z.number(),
            worstSeverity: z.string(),
        })),
    }),
    definitionOfReady: z.object({
        isReady: z.boolean(),
        passed: z.number(),
        required: z.number(),
        items: z.array(z.object({
            id: z.string(),
            description: z.string(),
            status: z.string(),
        })),
    }),
    definitionOfDone: z.object({
        isDone: z.boolean(),
        passed: z.number(),
        required: z.number(),
        items: z.array(z.object({
            id: z.string(),
            description: z.string(),
            status: z.string(),
        })),
    }),
    suggestions: z.array(z.string()).optional(),
};
// ── check_readiness ─────────────────────────────────────────────────────────
export const CheckReadinessOutputSchema = {
    specId: z.string(),
    score: z.number(),
    ready: z.boolean(),
    mode: z.string(),
    issues: z.object({
        blockers: z.array(z.string()),
        warnings: z.array(z.string()),
        breakdown: z.object({
            hu: z.number().optional(),
            criteria: z.number().optional(),
            files: z.number().optional(),
            dependencies: z.number().optional(),
        }),
    }),
    recommendations: z.array(z.string()),
};
// ── license_status ──────────────────────────────────────────────────────────
export const LicenseStatusOutputSchema = {
    version: z.string(),
    plan: z.string(),
    toolsAvailable: z.number(),
    toolsTotal: z.number(),
    limits: z.object({
        maxProjects: z.number(),
        currentProjects: z.number(),
        maxActiveSpecs: z.number(),
    }),
    customer: z
        .object({
        name: z.string(),
        email: z.string(),
        variant: z.string(),
        activatedAt: z.string(),
        lastValidatedAt: z.string(),
    })
        .optional(),
    activationSlots: z
        .object({
        used: z.number(),
        total: z.number(),
    })
        .optional(),
    upgradeUrl: z.string().optional(),
};
//# sourceMappingURL=output-schemas.js.map