/** * Composite feature gate + diagnostics for the GitHub App project feature. * * The GitHub feature is enabled only when *all three* hold: * - a `GithubIntegration` instance is registered with the factory * (constructed by the deploy entry from the `GITHUB_APP_*` env vars), * - web auth is enabled (a per-user installation requires a logged-in user), * - the application database is configured. * * OAuth/install `state` signing lives in `../../state-signing.ts` — the factory * creates one shared signer at boot and hands it to every integration. * * Everything here is pure: callers pass the handles they already own (the * integration, auth seam, state signer, sandbox surface) — there is no global * registry lookup. */ import type { RouteAuth } from '../../routes/route.js'; import type { MastraFactorySandboxConfig } from '../../sandbox/session-sandbox.js'; import type { StateSigner } from '../../state-signing.js'; import type { GithubIntegration } from './integration.js'; /** Handles the GitHub feature gate + diagnostics are computed from. */ export interface GithubFeatureGateOptions { /** The registered GitHub integration, when configured. */ github: GithubIntegration | undefined; /** Web auth seam — the feature requires a logged-in user. */ auth: RouteAuth; /** True when the application database is configured. */ appDbConfigured: boolean; /** Shared OAuth/install `state` signer, when configured. */ stateSigner?: StateSigner; /** The deploy's sandbox callback, when sandboxes are configured. */ sandbox?: MastraFactorySandboxConfig; } /** * True when the GitHub App project feature should be active. */ export declare function isGithubFeatureEnabled(options: Pick): boolean; /** * Non-secret diagnostic snapshot of every GitHub feature gate. Used by startup * logs, `/web/github/status`, and the SPA so all three explain the same state. * * Only env var *names* and booleans are exposed — never secret values. */ export interface GithubFeatureDiagnostics { githubAppConfigured: boolean; factoryAuthEnabled: boolean; appDbConfigured: boolean; stateSecretConfigured: boolean; sandboxEnabled: boolean; sandboxProvider: string; /** Names of the GitHub App env vars still needed (empty when configured). */ missingGithubAppEnvVars: string[]; } /** * Collect a non-secret diagnostic snapshot of every GitHub feature gate. Centralizes * the feature-gate reasoning so startup logs, the status API, and the SPA explain * the same state. Does not change `isGithubFeatureEnabled()` behavior. */ export declare function getGithubFeatureDiagnostics(options: GithubFeatureGateOptions): GithubFeatureDiagnostics; //# sourceMappingURL=config.d.ts.map