/** * Auth — browser stub. Same API surface as `auth/index.ts`; explicit-`apiKey` * only. * * The Node version supports two implicit resolution paths — `QODO_API_KEY` * env var and a `~/.qodo/auth.key` file. Neither belongs in browser: * - Filesystem (`os`/`fs`/`path`) doesn't exist in browser at all. * - `process.env.QODO_API_KEY` is more dangerous than useful — bundlers * like Vite/Next/webpack-DefinePlugin commonly inline `process.env.*` * at build time, which would embed the secret into the shipped JS * where any user can read it. The safe answer is "browser consumers * pass `apiKey` explicitly." * * So `validate()` throws `QodoAuthError` directing the consumer to wire * `apiKey` through their own server-side handshake (token vending) rather * than letting it leak through the build. * * The Node version of this file is `auth/index.ts`; the swap is wired via the * `browser` field in `package.json` so consumers don't change a single import. */ export type AuthSource = 'env' | 'file' | 'explicit'; export interface AuthConfig { readonly token: string; readonly source: AuthSource; } export declare class QodoAuthError extends Error { readonly name = "QodoAuthError"; constructor(message: string); } export declare class AuthProvider { private key; private keySource; constructor(apiKey?: string); validate(): void; getAuthConfig(): AuthConfig; handle401Error(): never; } //# sourceMappingURL=index.browser.d.ts.map