package handlers import ( "github.com/go-chi/chi/v5" ) // MountTeam registers /v1/team/* — org-scoped membership admin. func MountTeam(r chi.Router, _ Deps) { r.Route("/team", func(r chi.Router) { r.Get("/", stubHandler("team GET", "list_members")) r.Post("/", stubHandler("team POST", "invite_member")) r.Patch("/{member_id}", stubHandler("team/{id} PATCH", "update_member")) r.Delete("/{member_id}", stubHandler("team/{id} DELETE", "remove_member")) }) } // MountNetworks registers /v1/networks/* — managed network lifecycle. func MountNetworks(r chi.Router, _ Deps) { r.Route("/networks", func(r chi.Router) { r.Post("/", stubHandler("networks POST", "create_network")) r.Get("/", stubHandler("networks GET", "list_networks")) r.Get("/{network_id}", stubHandler("networks/{id}", "get_network")) r.Post("/{network_id}/scale", stubHandler("networks/{id}/scale", "scale_network")) r.Delete("/{network_id}", stubHandler("networks/{id} DELETE", "delete_network")) }) } // MountObservability registers /v1/o11y/*. The actual telemetry pipe // belongs to the O11y subsystem — these endpoints are the // query/control plane Bootnode exposes for its own dashboards. func MountObservability(r chi.Router, _ Deps) { r.Route("/o11y", func(r chi.Router) { r.Get("/health", stubHandler("o11y/health", "platform_health")) r.Get("/metrics", stubHandler("o11y/metrics", "list_metrics")) r.Get("/metrics/{service}", stubHandler("o11y/metrics/{service}", "service_metrics")) r.Get("/alerts", stubHandler("o11y/alerts GET", "list_alerts")) r.Post("/alerts", stubHandler("o11y/alerts POST", "create_alert")) r.Get("/service-map", stubHandler("o11y/service-map", "service_map")) r.Get("/logs", stubHandler("o11y/logs", "query_logs")) r.Get("/events", stubHandler("o11y/events", "query_events")) }) } // MountChat registers /v1/chat/* — AI inference passthrough. Routes // forward to deps.LLMGateway in production; stubbed in skeleton. func MountChat(r chi.Router, _ Deps) { r.Route("/chat", func(r chi.Router) { r.Post("/completions", stubHandler("chat/completions", "completions")) r.Get("/models", stubHandler("chat/models", "list_models")) }) } // MountBilling registers /v1/billing/* — usage, quota, invoices, // checkout. Payment processing belongs to Commerce; Bootnode just // reports usage and reads back per-org tiers. func MountBilling(r chi.Router, _ Deps) { r.Route("/billing", func(r chi.Router) { r.Get("/usage", stubHandler("billing/usage", "get_usage")) r.Get("/usage/summary", stubHandler("billing/usage/summary", "usage_summary")) r.Get("/subscription", stubHandler("billing/subscription", "get_subscription")) r.Post("/subscription/upgrade", stubHandler("billing/subscription/upgrade", "upgrade")) r.Post("/subscription/downgrade", stubHandler("billing/subscription/downgrade", "downgrade")) r.Get("/invoices", stubHandler("billing/invoices", "list_invoices")) r.Get("/tiers", stubHandler("billing/tiers", "list_tiers")) r.Get("/tiers/{tier_name}", stubHandler("billing/tiers/{name}", "get_tier")) r.Get("/limits", stubHandler("billing/limits", "get_limits")) r.Post("/checkout", stubHandler("billing/checkout", "checkout")) r.Post("/checkout/capture/{order_id}", stubHandler("billing/checkout/capture", "capture")) r.Post("/webhooks/commerce", stubHandler("billing/webhooks/commerce", "commerce_webhook")) r.Post("/sync", stubHandler("billing/sync POST", "sync_usage")) r.Get("/sync/status", stubHandler("billing/sync/status", "sync_status")) r.Get("/account", stubHandler("billing/account GET", "get_account")) r.Get("/account/subscriptions", stubHandler("billing/account/subscriptions", "account_subscriptions")) r.Get("/account/invoices", stubHandler("billing/account/invoices", "account_invoices")) r.Get("/account/payment-methods", stubHandler("billing/account/payment-methods", "account_methods")) r.Post("/account/sync", stubHandler("billing/account/sync", "account_sync")) r.Post("/cloud/authorize", stubHandler("billing/cloud/authorize", "cloud_authorize")) r.Get("/cloud/quota", stubHandler("billing/cloud/quota", "cloud_quota")) r.Post("/cloud/usage", stubHandler("billing/cloud/usage", "cloud_record_usage")) r.Get("/cloud/tiers", stubHandler("billing/cloud/tiers", "cloud_tiers")) }) } // MountZAP registers /v1/zap/* — discovery endpoints for the native // ZAP protocol. The wire-level RPC server lives in superbase; these // HTTP endpoints describe the schema + tools list to clients. // // We keep the path names but do NOT serve a .capnp file — public // surface is .zap only (brand policy). func MountZAP(r chi.Router, _ Deps) { r.Route("/zap", func(r chi.Router) { r.Get("/connect", stubHandler("zap/connect", "connect_info")) r.Get("/info", stubHandler("zap/info", "server_info")) r.Get("/tools", stubHandler("zap/tools", "list_tools")) r.Get("/resources", stubHandler("zap/resources", "list_resources")) r.Get("/health", stubHandler("zap/health", "zap_health")) r.Get("/schema", stubHandler("zap/schema", "serve_schema")) // schema.capnp endpoint is deliberately NOT mounted — ZAP-only public surface. }) _ = chi.URLParam }