import { Either } from "functype"; //#region src/config.d.ts /** * How the server authenticates to Oura. * * - `pat` -> a personal access token sent verbatim as the Bearer token. Oura stopped issuing * new PATs (Dec 2025), but tokens minted before then still work, so this stays as a * fallback for existing installs. * - `oauth` -> an OAuth2 confidential client. Only the stable app credentials (`clientId`, * `clientSecret`) come from the env. The access + refresh tokens are obtained once via * the `login` authorization-code flow and then owned and rotated entirely inside the * token store at `tokenStorePath` (see {@link ./oura/auth}); the env never holds a * refresh token, because Oura rotates them on every use. */ type PatAuth = { readonly mode: "pat"; readonly apiKey: string; }; type OAuthAuth = { readonly mode: "oauth"; readonly clientId: string; readonly clientSecret: string; readonly tokenUrl: string; readonly authorizeUrl: string; readonly redirectUri: string; readonly scopes: string; readonly tokenStorePath: string; }; type AuthConfig = PatAuth | OAuthAuth; /** * Resolved runtime configuration for the Oura MCP server. * * `apiBase` already includes the `usercollection` segment and switches to Oura's `/sandbox/` * demo data when `OURA_SANDBOX` is truthy. */ type OuraConfig = { readonly auth: AuthConfig; readonly apiBase: string; readonly sandbox: boolean; readonly transportType: "stdio" | "httpStream"; readonly port: number; readonly host: string; }; /** * Parse process env into an {@link OuraConfig}, or an error message describing the first problem. * Pure over its `env` argument so it is trivially testable. */ declare const parseConfig: (env: NodeJS.ProcessEnv) => Either; //#endregion export { AuthConfig, OAuthAuth, OuraConfig, PatAuth, parseConfig }; //# sourceMappingURL=config.d.ts.map