Files
iios/packages/iios-service/src/health.controller.ts
T
maaz519 f7519d36f0 feat(p9): real-egress proof (env-gated HttpProvider) + /health bindings + smoke
Task 9.5: /health now reports the egress provider backing each channel (sandbox
vs http). scripts/smoke-capability.mjs proves the slice end to end: sandbox egress
SENT through the broker; EMAIL routed to the env-gated HttpProvider and actually
delivered to a LOCAL echo server (real egress, no external network, no credentials);
idempotent replay; /health bindings. App wires CapabilityModule.

P9 slice-1 verification: 103 tests green, pnpm -r build all packages+demos,
boundary clean, capability smoke PASS, all prior smokes (realtime/inbox/support/
adapter/route/ai/calendar) still PASS through the broker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 20:38:47 +05:30

25 lines
768 B
TypeScript

import { Controller, Get } from '@nestjs/common';
import { PrismaService } from './prisma/prisma.service';
import { CapabilityProviderRegistry } from './capability/capability.registry';
@Controller('health')
export class HealthController {
constructor(
private readonly prisma: PrismaService,
private readonly providers: CapabilityProviderRegistry,
) {}
@Get()
async check(): Promise<{ status: string; db: boolean; egressProviders: Record<string, string> }> {
let db = false;
try {
await this.prisma.$queryRaw`SELECT 1`;
db = true;
} catch {
db = false;
}
// Ops view: which provider (sandbox vs http) backs each egress channel.
return { status: 'ok', db, egressProviders: this.providers.bindings() };
}
}