import o from"@contractspec/lib.ui-link";import{ChevronRight as a}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function c(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"GitHub Messaging"}),e("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."})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`// secret payload
{
  "token": "ghp_...",
  "webhookSecret": "..."
}

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

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