"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const realtime_guardian_1 = require("../../../03-knowledge/decisions/realtime-guardian");
const identity_resolver_1 = require("../../../05-community/share/identity-resolver");
const router = (0, express_1.Router)();
// Health check
router.get('/health', (_req, res) => {
    res.json({
        status: 'ok',
        version: '0.2.0',
        uptime: process.uptime(),
        engines: { taste_learning: 'active', predictive: 'active', multi_project: 'active', team: 'active', code_health: 'active' },
        memory: process.memoryUsage().rss,
    });
});
// Daemon health
router.get('/daemon/health', (_req, res) => {
    const mem = process.memoryUsage();
    res.json({
        status: 'ok',
        uptime: process.uptime(),
        memory: {
            rss: Math.round(mem.rss / 1024 / 1024) + 'MB',
            heapUsed: Math.round(mem.heapUsed / 1024 / 1024) + 'MB',
        },
        watchdog: 'active',
    });
});
// Guardian stats
router.get('/guardian/stats', (_req, res) => {
    res.json((0, realtime_guardian_1.getStats)());
});
// Identity status
router.get('/identity/status', (_req, res) => {
    const identity = (0, identity_resolver_1.createIdentityPayload)('daemon');
    res.json({ fingerprint: identity.fingerprint, tool: identity.tool });
});
exports.default = router;
//# sourceMappingURL=health.js.map