// AUTO-GENERATED — do not edit by hand.
//
// Generated by products/catalyst/bootstrap/ui/scripts/build-catalog.mjs from
// every platform/<name>/blueprint.yaml + products/<name>/blueprint.yaml in
// the monorepo. Re-run `npm run build` (or `npm run dev`) in this package
// after adding or modifying a blueprint.yaml; the prebuild script wires this.
//
// Per docs/INVIOLABLE-PRINCIPLES.md #4 ("never hardcode") this is the ONLY
// place the Catalyst component catalog lives. Both StepComponents (wizard
// app selection) and StepProvisioning (progress timeline) read from here.
//
// Source-of-truth files: see PLATFORM_BLUEPRINT_FILES in this file.

export type BlueprintVisibility = 'listed' | 'unlisted' | 'private'

export interface BlueprintCardEntry {
  /** Full Blueprint id, e.g. "bp-cilium". */
  id: string
  /** Slug = id without the "bp-" prefix. */
  slug: string
  /** Display title (card.title). Falls back to slug. */
  title: string
  /** One-paragraph summary (card.summary). */
  summary: string
  /** Optional icon path (card.icon). Relative to the Blueprint folder. */
  icon: string | null
  /** Optional marketplace category (card.category). */
  category: string | null
  /** Optional one-line tagline (card.tagline). */
  tagline: string | null
  /** Tags (card.tags). */
  tags: string[]
  /** listed = appears in marketplace, unlisted = mandatory infra, private = org-only. */
  visibility: BlueprintVisibility
  /** Blueprint semver. */
  version: string | null
  /** PTS section label (catalyst.openova.io/section), e.g. "pts-3-3-security-and-policy". */
  section: string | null
  /** Other Blueprint ids this Blueprint depends on. */
  depends: string[]
}

/**
 * Every Blueprint discovered at build time. Order is stable (sorted by id).
 *
 * StepComponents filters this with `visibility === 'listed'` to render the
 * marketplace card grid; StepProvisioning uses the same source to label
 * bootstrap-kit phases when the SSE backend emits Flux Kustomization events.
 */
export const ALL_BLUEPRINTS: readonly BlueprintCardEntry[] = [
  {
    "id": "bp-cert-manager",
    "slug": "cert-manager",
    "title": "cert-manager",
    "summary": "TLS certificate automation. Lets Encrypt issuer with Dynadot DNS-01 for omani.works pool, HTTP-01 for BYO domains.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-3-3-security-and-policy",
    "depends": []
  },
  {
    "id": "bp-cilium",
    "slug": "cilium",
    "title": "Cilium",
    "summary": "Unified CNI + Service Mesh (eBPF). mTLS via WireGuard, Hubble observability, Gateway API.",
    "icon": "cilium.svg",
    "category": "infrastructure",
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-3-1-networking-and-service-mesh",
    "depends": []
  },
  {
    "id": "bp-crossplane",
    "slug": "crossplane",
    "title": "crossplane",
    "summary": "Crossplane core + provider-hcloud. Catalyst Compositions live at compose.openova.io/v1alpha1 XRD group.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-3-2-gitops-and-iac",
    "depends": []
  },
  {
    "id": "bp-flux",
    "slug": "flux",
    "title": "flux",
    "summary": "GitOps reconciler. One per vcluster (source + kustomize + helm controllers); host-level Flux per host cluster watches its bp-* OCI sources.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-3-2-gitops-and-iac",
    "depends": []
  },
  {
    "id": "bp-gitea",
    "slug": "gitea",
    "title": "gitea",
    "summary": "Gitea — per-Sovereign Git server. Catalyst control plane. Hosts catalog (public Blueprint mirror), catalog-sovereign (Sovereign-curated private Blueprints), one Gitea Org per Catalyst Organization, and system (sovereign-admin scope).",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-2-3-per-sovereign-supporting-services",
    "depends": []
  },
  {
    "id": "bp-keycloak",
    "slug": "keycloak",
    "title": "keycloak",
    "summary": "Keycloak — user identity. Topology decided by Sovereign CRD spec.keycloakTopology (per-organization for SME, shared-sovereign for corporate).",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-2-3-per-sovereign-supporting-services",
    "depends": []
  },
  {
    "id": "bp-nats-jetstream",
    "slug": "nats-jetstream",
    "title": "nats-jetstream",
    "summary": "Event spine for the Catalyst control plane. JetStream Streams + KV. Per-Organization Accounts. Replaces what was previously specified as Redpanda + Valkey for the control plane.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-2-3-per-sovereign-supporting-services",
    "depends": []
  },
  {
    "id": "bp-openbao",
    "slug": "openbao",
    "title": "openbao",
    "summary": "OpenBao secret backend. 3-node Raft per region (independent quorum, async perf-replication across regions). MPL 2.0 — drop-in Vault replacement.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-2-3-per-sovereign-supporting-services",
    "depends": []
  },
  {
    "id": "bp-sealed-secrets",
    "slug": "sealed-secrets",
    "title": "sealed-secrets",
    "summary": "Sealed Secrets — used during Phase 0 bootstrap to transport bootstrap-only secrets, then archived after OpenBao + ESO replace it.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-3-3-security-and-policy",
    "depends": []
  },
  {
    "id": "bp-spire",
    "slug": "spire",
    "title": "spire",
    "summary": "SPIFFE/SPIRE workload identity. 5-min rotating SVIDs. Server on mgt cluster + agent per host cluster.",
    "icon": null,
    "category": null,
    "tagline": null,
    "tags": [],
    "visibility": "unlisted",
    "version": "1.0.0",
    "section": "pts-2-3-per-sovereign-supporting-services",
    "depends": []
  }
] as const

/** Subset of ALL_BLUEPRINTS whose visibility is 'listed' — what shows in the wizard's StepComponents card grid. */
export const LISTED_BLUEPRINTS: readonly BlueprintCardEntry[] = ALL_BLUEPRINTS.filter(b => b.visibility === 'listed')

/** Distinct categories present on listed blueprints (for category chip filter). */
export const LISTED_CATEGORIES: readonly string[] = Array.from(
  new Set(LISTED_BLUEPRINTS.map(b => b.category).filter((c): c is string => !!c))
).sort()

/** Lookup: id → entry. */
export const BLUEPRINT_BY_ID: Readonly<Record<string, BlueprintCardEntry>> = Object.fromEntries(
  ALL_BLUEPRINTS.map(b => [b.id, b])
)

/** Source files this catalog was built from (for diagnostics / CI logs). */
export const PLATFORM_BLUEPRINT_FILES: readonly string[] = [
  "platform/cert-manager/blueprint.yaml",
  "platform/cilium/blueprint.yaml",
  "platform/crossplane/blueprint.yaml",
  "platform/flux/blueprint.yaml",
  "platform/gitea/blueprint.yaml",
  "platform/keycloak/blueprint.yaml",
  "platform/nats-jetstream/blueprint.yaml",
  "platform/openbao/blueprint.yaml",
  "platform/sealed-secrets/blueprint.yaml",
  "platform/spire/blueprint.yaml"
] as const
