export interface EnsureConsentOptions { /** The `--no-telemetry` flag — forces telemetry off without prompting. */ noTelemetry: boolean; } /** * How the telemetry consent state was determined for this boot. * Exposed to the server so the UI can show a first-run notice when * consent was implicitly set by the non-TTY default rather than explicitly * answered by the user. */ export type ConsentSource = /** `--no-telemetry` flag or SAPIOM_TELEMETRY_DISABLED/DO_NOT_TRACK env var. */ "env-forced-off" /** Stored consent from a previous first-run prompt — user answered explicitly. */ | "stored-explicit" /** User answered the Y/n prompt just now (interactive TTY). */ | "prompted" /** Non-TTY first run: the silent default was applied and persisted. */ | "default-silent"; export interface ConsentResult { telemetryOptIn: boolean; /** * Which env var (if any) is forcing telemetry off this run. * Only set when source === "env-forced-off". */ envReason: string | null; source: ConsentSource; } /** * Environment opt-out, same precedence and value-parsing as * `@sapiom/analytics-core`'s `resolveConsent()`: `SAPIOM_TELEMETRY_DISABLED` * (Sapiom-specific) before `DO_NOT_TRACK` (the ecosystem-wide convention), * both accepting `1`/`true` case-insensitively. Exported because every opt-out * flag in this package must accept the same spellings — a flag that silently * ignores `=true` is not an opt-out (profiles/system-prompt-fetch.ts). Checked ahead of any stored * settings — an operator setting either at the OS/shell level always wins * for that run, regardless of a previously persisted opt-in. */ export declare function isEnvFlagSet(value: string | undefined): boolean; /** * Resolves the telemetry opt-in state. Prompts once on first run and persists * the answer; subsequent runs reuse the stored value silently. `--no-telemetry` * always wins and never prompts. `SAPIOM_TELEMETRY_DISABLED`/`DO_NOT_TRACK` * force telemetry off for this run — overriding a persisted opt-in and * skipping the prompt entirely — without touching what's actually stored, so * a later run without the env var set sees whatever the user answered (or * will still be asked, if this env-vetoed run was their first). * * Returns a ConsentResult that includes the source of the decision — the UI * uses this to show a first-run notice when the user never explicitly answered * (source === "default-silent"), skipping it when they did. */ export declare function ensureConsent(options: EnsureConsentOptions): Promise; //# sourceMappingURL=consent.d.ts.map