"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpsDashboardController = void 0;
const uuid_1 = require("uuid");
exports.OpsDashboardController = {
    getOpsDashboardConfig: async (req, res) => {
        // System Health - leftmost, 3 columns wide
        const systemHealthId = (0, uuid_1.v4)();
        const systemHealth = {
            id: systemHealthId,
            name: 'System Health',
            type: 'system-health',
            chartType: 'donut',
            title: 'System Health',
            description: '',
            group: null,
            position: {
                w: 3, h: 1, x: 0, y: 0,
            },
            parameters: {},
        };
        // Total Traces / Total Sessions - 2 columns, stacked
        const tracesSessionsId = (0, uuid_1.v4)();
        const tracesSessions = {
            id: tracesSessionsId,
            name: 'Traces and Sessions',
            type: 'group1-metrics',
            chartType: null,
            title: null,
            description: '',
            group: null,
            position: {
                w: 2, h: 1, x: 3, y: 0,
            },
            parameters: {},
            items: [
                {
                    type: 'total-traces',
                    label: 'Total Traces',
                    title: null,
                },
                {
                    type: 'total-sessions',
                    label: 'Total Sessions',
                    title: null,
                },
            ],
        };
        // Combined Group 2 Metrics (Cost, Duration, Tokens) - single item with all items
        const group2MetricsId = (0, uuid_1.v4)();
        const group2Metrics = {
            id: group2MetricsId,
            name: 'Group 2 Metrics',
            type: 'group2-metrics',
            chartType: null,
            title: null,
            description: '',
            group: null,
            position: {
                w: 7, h: 1, x: 5, y: 0,
            },
            parameters: {},
            items: [
                {
                    type: 'total-cost',
                    label: 'Total Cost',
                    title: null,
                },
                {
                    type: 'avg-cost-request',
                    label: 'Avg Cost/ Request',
                    title: null,
                },
                {
                    type: 'total-request-duration',
                    label: 'Total Request Duration',
                    title: null,
                },
                {
                    type: 'avg-duration-request',
                    label: 'Avg Duration/ Request',
                    title: null,
                },
                {
                    type: 'total-tokens',
                    label: 'Total Tokens',
                    title: null,
                },
                {
                    type: 'avg-tokens-request',
                    label: 'Avg Tokens/ Request',
                    title: null,
                },
            ],
        };
        // Cache Read Tokens - line graph
        const cacheReadTokensId = (0, uuid_1.v4)();
        const cacheReadTokens = {
            id: cacheReadTokensId,
            name: 'Cache Read Tokens',
            type: 'cache-read-tokens',
            chartType: 'line',
            title: 'Cache Read Tokens',
            description: '',
            group: null,
            position: {
                w: 6, h: 2, x: 0, y: 1,
            },
            parameters: {},
        };
        // Cache Summary Metrics - 4 boxes
        const cacheSummaryId = (0, uuid_1.v4)();
        const cacheSummary = {
            id: cacheSummaryId,
            name: 'Cache Summary',
            type: 'cache-summary-metrics',
            chartType: null,
            title: null,
            description: '',
            group: null,
            position: {
                w: 6, h: 1, x: 6, y: 1,
            },
            parameters: {},
            items: [
                {
                    type: 'total-cost',
                    label: 'Total Cost',
                    title: null,
                },
                {
                    type: 'cache-hit',
                    label: 'Cache Hit',
                    title: null,
                },
                {
                    type: 'avg-time-saved',
                    label: 'Avg Time Saved',
                    title: null,
                },
                {
                    type: 'cost-saved',
                    label: 'Cost Saved',
                    title: null,
                },
            ],
        };
        // Agent Analysis Group
        const agentAnalysisGroupId = 'agent-analysis-group';
        // Agent Run Analysis - multi-line graph
        const agentRunAnalysisId = (0, uuid_1.v4)();
        const agentRunAnalysis = {
            id: agentRunAnalysisId,
            name: 'Agent Run Analysis',
            type: 'multi-line-chart',
            chartType: 'line',
            title: 'Agent Run Analysis',
            description: '',
            group: agentAnalysisGroupId,
            groupTitle: 'AGENT ANALYSIS',
            position: {
                w: 6, h: 2, x: 0, y: 3,
            },
            parameters: {
                lines: [
                    { name: 'Agent Runs', color: '#f97316', dataKey: 'agentRuns' },
                    { name: 'Total Tools Calls', color: '#3b82f6', dataKey: 'toolCalls' },
                    { name: 'Total Tokens Used', color: '#22c55e', dataKey: 'tokens' },
                ],
            },
        };
        // Agent Analysis Summary - 3 boxes
        const agentAnalysisSummaryId = (0, uuid_1.v4)();
        const agentAnalysisSummary = {
            id: agentAnalysisSummaryId,
            name: 'Agent Analysis Summary',
            type: 'agent-analysis-summary',
            chartType: null,
            title: null,
            description: '',
            group: agentAnalysisGroupId,
            groupTitle: 'AGENT ANALYSIS',
            position: {
                w: 6, h: 1, x: 6, y: 3,
            },
            parameters: {},
            items: [
                {
                    type: 'agent-runs',
                    label: 'Agent Runs',
                    title: null,
                    color: '#f97316',
                },
                {
                    type: 'total-tools-calls',
                    label: 'Total Tools Calls',
                    title: null,
                    color: '#3b82f6',
                },
                {
                    type: 'total-tokens-used',
                    label: 'Total Tokens Used',
                    title: null,
                    color: '#22c55e',
                },
            ],
        };
        // Agent Run Breakdown - multi-line graph
        const agentRunBreakdownId = (0, uuid_1.v4)();
        const agentRunBreakdown = {
            id: agentRunBreakdownId,
            name: 'Agent Run Breakdown',
            type: 'multi-line-chart',
            chartType: 'line',
            title: 'Agent Run Breakdown',
            description: '',
            group: agentAnalysisGroupId,
            groupTitle: 'AGENT ANALYSIS',
            position: {
                w: 6, h: 2, x: 0, y: 4,
            },
            parameters: {
                lines: [
                    { name: 'Agent 1', color: '#f97316', dataKey: 'agent1' },
                    { name: 'Agent 2', color: '#22c55e', dataKey: 'agent2' },
                    { name: 'Agent 3', color: '#3b82f6', dataKey: 'agent3' },
                ],
            },
        };
        // Tool Call Breakdown - multi-line graph
        const toolCallBreakdownId = (0, uuid_1.v4)();
        const toolCallBreakdown = {
            id: toolCallBreakdownId,
            name: 'Tool Call Breakdown',
            type: 'multi-line-chart',
            chartType: 'line',
            title: 'Tool Call Breakdown',
            description: '',
            group: agentAnalysisGroupId,
            groupTitle: 'AGENT ANALYSIS',
            position: {
                w: 6, h: 2, x: 6, y: 4,
            },
            parameters: {
                lines: [
                    { name: 'Tool 1', color: '#f97316', dataKey: 'tool1' },
                    { name: 'Tool 2', color: '#22c55e', dataKey: 'tool2' },
                    { name: 'Tool 3', color: '#3b82f6', dataKey: 'tool3' },
                ],
            },
        };
        // Traces per time - full width at bottom
        const tracesPerTimeId = (0, uuid_1.v4)();
        const tracesPerTime = {
            id: tracesPerTimeId,
            name: 'Traces per time',
            type: 'time-series',
            chartType: 'line',
            title: 'Traces per time',
            description: '',
            group: null,
            position: {
                w: 12, h: 2, x: 0, y: 5,
            },
            parameters: {},
        };
        return res.status(200).json({ data: {
                [systemHealth.id]: systemHealth,
                [tracesSessions.id]: tracesSessions,
                [group2Metrics.id]: group2Metrics,
                [tracesPerTime.id]: tracesPerTime,
                [cacheReadTokens.id]: cacheReadTokens,
                [cacheSummary.id]: cacheSummary,
                [agentRunAnalysis.id]: agentRunAnalysis,
                [agentAnalysisSummary.id]: agentAnalysisSummary,
                [agentRunBreakdown.id]: agentRunBreakdown,
                [toolCallBreakdown.id]: toolCallBreakdown,
            }, });
    },
};
//# sourceMappingURL=ops-dashboard-controller.js.map