import { type FastifyInstance } from "fastify"; import type { EmbeddingProvider, EvidenceLedger, OrgGraphStore, ReconciliationGatePolicy } from "@jgalego/teamapi-core"; import { type ProposalRouteOptions } from "./routes/proposals"; import { type McpRequestHandler } from "./routes/mcp"; export interface BuildServerOptions { logger?: boolean; /** Slack app signing secret. The `/slack/whoowns` route exists only when this is set, so an * unauthenticated command endpoint can never be mounted by accident. */ slackSigningSecret?: string; /** When set, every route except `/health` and `/slack/*` requires `Authorization: Bearer`. */ apiToken?: string; /** Origins allowed to make cross-origin browser requests. Omitted (or empty) sends no CORS * headers at all, which is the safe default: a read-only API is still an information * disclosure, and `*` would let any page a viewer visits read the whole org chart. */ corsOrigins?: string[]; /** Requests allowed per minute, per client IP. Omitted means no limit. */ rateLimitPerMinute?: number; /** Enables `GET /search?mode=hybrid|semantic` and `POST /context {semantic:true}`. Omitted, both * answer 400 rather than quietly falling back to substring matching. */ embeddings?: EmbeddingProvider; /** Mounts `POST /teams/:id/proposals`, which opens a pull request against the repository the * documents came from. Omitted, there is no write path at all. */ proposals?: ProposalRouteOptions; /** Mounts `GET /metrics` in the Prometheus exposition format. Off by default: it is one more * surface, and a server nobody scrapes should not have one. */ metrics?: boolean; /** When supplied, mounts `POST /reload` and calls this to re-resolve the graph. */ reload?: () => Promise; /** When supplied, mounts `POST /mcp` and routes it to this handler. Injected so this package * stays free of an MCP dependency; the CLI, which depends on both, supplies it. */ mcpHandler?: McpRequestHandler; /** Mounts evidence ingestion and remediation-chain routes against the supplied ledger. */ evidence?: EvidenceLedger; /** Mounts dry-run reconciliation decisions. No external action is executed by this API. */ reconciliation?: { ledger: EvidenceLedger; policy: ReconciliationGatePolicy; }; } /** * Builds a Fastify app over an already-`load()`ed `OrgGraphStore`. * * Read-only by default, since the Team API documents are the git-managed source of truth. The one * exception is opt-in and does not break that model: with `proposals` configured, a team can be * edited into a *pull request* against the repository the documents came from — reviewed, * attributable and declinable, rather than written straight into the served graph. * * Interactive docs (OpenAPI + Swagger UI "Try it out") are served at `/docs`. Routes declare * `summary`/`description`/`tags`/`querystring`/`params` schemas for documentation; response bodies * are deliberately left unschema'd so Fastify never silently strips fields that don't happen to * be enumerated in a hand-written response schema — "Try it out" always shows the real payload. */ export declare function buildServer(store: OrgGraphStore, options?: BuildServerOptions): Promise; //# sourceMappingURL=server.d.ts.map