// @bun
// src/components/docs/integrations/IntegrationsGithubPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function IntegrationsGithubPage() {
  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: "GitHub Messaging"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Use GitHub issue and pull request comments as an AI-native messaging channel with webhook verification, policy checks, and reliable outbound dispatch."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Required secrets and config"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `// secret payload
{
  "token": "ghp_...",
  "webhookSecret": "..."
}

// optional connection config
{
  "defaultOwner": "lssm-tech",
  "defaultRepo": "contractspec",
  "apiBaseUrl": "https://api.github.com"
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Webhook ingress"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Inbound GitHub events are accepted on",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "/webhooks/github/events"
                  }),
                  "."
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Signatures are checked using",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "x-hub-signature-256"
                  }),
                  " ",
                  "and the configured webhook secret."
                ]
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Current normalization focuses on issue comment workflows and durable comment dispatch."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Workspace mapping"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `CHANNEL_WORKSPACE_MAP_GITHUB={"lssm-tech/contractspec":"workspace-acme"}

# Optional dev fallback (off by default)
CHANNEL_ALLOW_UNMAPPED_WORKSPACE=0`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Use a least-privileged token scoped for comment operations."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Route repositories explicitly with workspace maps in multi-tenant environments."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Keep dispatch endpoints protected with token or bearer auth."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/integrations/slack",
            className: "btn-ghost",
            children: "Previous: Slack Messaging"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/integrations/whatsapp-meta",
            className: "btn-primary",
            children: [
              "Next: WhatsApp Meta ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  IntegrationsGithubPage
};
