export const INTEGRATION_KINDS = ["slack", "google_chat", "linear", "github", "webhook"] as const; export type IntegrationKind = (typeof INTEGRATION_KINDS)[number]; export const INTEGRATION_KIND_LABELS: Record = { slack: "Slack", google_chat: "Google Chat", linear: "Linear", github: "GitHub", webhook: "Webhook", }; /** Event categories an integration can subscribe to. Chat integrations start quiet: only PRs and releases. */ export const INTEGRATION_EVENTS = ["push", "pull_request", "review", "ci", "release", "issues", "github"] as const; export type IntegrationEvent = (typeof INTEGRATION_EVENTS)[number]; export const INTEGRATION_EVENT_LABELS: Record = { push: "Pushes", pull_request: "Pull requests (opened, merged, closed)", review: "Reviews", ci: "CI runs", release: "Releases", issues: "Issues", github: "Relayed GitHub webhooks", }; export const DEFAULT_INTEGRATION_EVENTS: IntegrationEvent[] = ["pull_request", "release"]; /** Non-secret, per-integration routing and noise controls. */ export type IntegrationFilters = { /** Glob-ish branch filter for pushes and CI (`main`, `release/*`); empty means the default branch only. */ branches: string[]; /** Only report failed CI runs (and the first green run after a failure is not tracked). */ ciFailuresOnly: boolean; /** Skip draft pull requests. */ skipDrafts: boolean; /** Skip events from bot-like actors (names ending in `[bot]` or `-bot`). */ skipBots: boolean; }; export const DEFAULT_FILTERS: IntegrationFilters = { branches: [], ciFailuresOnly: true, skipDrafts: true, skipBots: true, }; export type SlackChannelRoute = { channel: string; events: IntegrationEvent[] }; export type LinearStateMapping = { opened: string; merged: string; closed: string }; export const DEFAULT_LINEAR_MAPPING: LinearStateMapping = { opened: "In Progress", merged: "Done", closed: "" }; export type GithubMirrorDirection = "none" | "push" | "pull";