// @bun
// src/components/docs/libraries/LibrariesSLOPage.tsx
import { CodeBlock, InstallCommand } from "@contractspec/lib.design-system";
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function LibrariesSLOPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "SLO Library"
          }),
          /* @__PURE__ */ jsxs("p", {
            className: "text-muted-foreground text-lg",
            children: [
              /* @__PURE__ */ jsx("code", {
                children: "@contractspec/lib.slo"
              }),
              " keeps service level objectives front and center\u2014declarative definitions, rolling snapshots, burn-rate math, and automated incidents."
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Installation"
          }),
          /* @__PURE__ */ jsx(InstallCommand, {
            package: "@contractspec/lib.slo"
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Define Targets"
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            language: "typescript",
            code: `const definition: SLODefinition = {
  id: 'billing.createInvoice.availability',
  targetAvailability: 0.999,
  latencyP99TargetMs: 500,
  rollingWindowMs: 7 * 24 * 60 * 60 * 1000,
  alerts: { fastBurnThreshold: 14, slowBurnThreshold: 6 },
};`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Monitor Burn Rate"
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            language: "typescript",
            code: `const monitor = new SLOMonitor({ definition, incidentManager });
const { snapshot, burnRate } = monitor.recordWindow({
  good: 12500,
  bad: 3,
  latencyP99: 420,
  latencyP95: 210,
});`
          }),
          /* @__PURE__ */ jsxs("p", {
            className: "text-muted-foreground text-sm",
            children: [
              "When burn rate exceeds the configured thresholds the monitor calls your",
              /* @__PURE__ */ jsx("code", {
                children: "IncidentManager"
              }),
              ", providing the snapshot that triggered the alert."
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "History & Reporting"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground text-sm",
            children: "`SLOTracker.getHistory()` returns the latest snapshots so dashboards can show trends without hitting a warehouse. Prisma models persist everything for long-term audits."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/libraries",
            className: "btn-ghost",
            children: "Back to Libraries"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/libraries/cost-tracking",
            className: "btn-primary",
            children: [
              "Next: Cost Tracking ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  LibrariesSLOPage
};
