/**
 * Analytics provider detected or configured in the project.
 */
export type AnalyticsProvider = 'ga4' | 'firebase' | 'mixpanel' | 'amplitude' | 'segment' | 'posthog' | 'heap' | 'hotjar' | 'plausible' | 'umami' | 'unknown';
/**
 * A/B testing and feature flag provider.
 */
export type ABTestingProvider = 'optimizely' | 'launchdarkly' | 'split' | 'statsig' | 'growthbook' | 'none';
/**
 * How the analytics provider is integrated into the project.
 */
export type IntegrationMethod = 'sdk' | 'pixel' | 'gtm';
/**
 * Naming convention used for analytics events.
 */
export type NamingConvention = 'object_action' | 'camelCase' | 'module_prefixed' | 'custom';
/**
 * Data type for an event property.
 */
export type PropertyType = 'string' | 'number' | 'boolean' | 'array';
/**
 * A single property attached to an analytics event.
 */
export interface EventProperty {
    /** Property name in snake_case */
    name: string;
    /** Data type of the property */
    type: PropertyType;
    /** Description of the data it represents and why it is needed */
    description: string;
    /** Example value for documentation and tests */
    example?: string;
    /** Whether this property contains or derives from personally identifiable information */
    pii?: boolean;
    /** Whether the property is required or may be omitted in some contexts */
    required: boolean;
}
/**
 * An analytics event defined in a spec.
 * Minimum required fields: name, trigger, properties (at least one), businessGoal.
 */
export interface AnalyticsEvent {
    /** Event name in snake_case following the project convention: [object]_[action] */
    name: string;
    /** Natural language description of when the event is fired */
    trigger: string;
    /** Properties accompanying the event */
    properties: EventProperty[];
    /** Business question this event helps answer */
    businessGoal: string;
    /** Whether any property of the event includes or derives from PII */
    includesPII: boolean;
    /** Whether the event must be conditioned on user consent (GDPR/CCPA) */
    consentRequired: boolean;
    /** ID of the spec that introduced this event for the first time */
    introducedBySpec?: string;
}
/**
 * A user funnel defined in a spec (ordered sequence of steps).
 */
export interface AnalyticsFunnel {
    /** Descriptive name of the funnel: "Checkout Funnel", "Onboarding Flow" */
    name: string;
    /** Description of the funnel's final conversion goal */
    conversionGoal: string;
    /** Events in order that compose the funnel, each representing a step */
    steps: AnalyticsEvent[];
    /** Target conversion rate for the full funnel (0–1) */
    targetConversionRate?: number;
    /** Current conversion rate as baseline, if available */
    baselineConversionRate?: number;
}
/**
 * An A/B experiment defined in a spec.
 */
export interface ABTest {
    /** Identifier name of the experiment: "checkout-cta-color-test" */
    name: string;
    /** Hypothesis in format: "If [change], then [result] because [reason]" */
    hypothesis: string;
    /** List of variants including the control: ["control", "variant_a", "variant_b"] */
    variants: string[];
    /** Primary metric that determines the experiment winner */
    primaryMetric: string;
    /** Guard metrics that MUST NOT degrade during the experiment */
    guardMetrics: string[];
    /** Estimated sample size per variant for 80% statistical power and alpha 0.05 */
    estimatedSampleSize: number;
    /** Estimated experiment duration given expected traffic */
    estimatedDuration: string;
    /** Guard metric degradation threshold that triggers automatic stop (default: 0.05 = 5%) */
    guardThreshold: number;
    /** A/B testing provider that will run the experiment */
    provider?: ABTestingProvider;
}
/**
 * Complete analytics spec artifact for a feature.
 */
export interface AnalyticsSpec {
    /** Analytics provider detected or configured for the project */
    provider: AnalyticsProvider;
    /** Integration method of the provider */
    integrationMethod: IntegrationMethod;
    /** Event naming convention of the project */
    namingConvention: NamingConvention;
    /** Events to track in the feature */
    events: AnalyticsEvent[];
    /** Funnels defined by the feature, if applicable */
    funnels: AnalyticsFunnel[];
    /** Planned A/B experiments, if applicable */
    experiments: ABTest[];
    /** ID of the spec that owns this analytics artifact */
    specId: string;
}
/**
 * Project-level analytics stack stored in knowledge.json under "analyticsStack".
 */
export interface AnalyticsStack {
    /** Analytics provider detected in the project */
    provider: AnalyticsProvider;
    /** Detected integration method */
    integrationMethod: IntegrationMethod;
    /** Whether the project already has custom events configured */
    hasCustomEvents: boolean;
    /** Whether a dashboard configuration file exists in the project */
    hasDashboards: boolean;
    /** A/B testing provider detected */
    abTestingProvider: ABTestingProvider;
    /** Naming convention detected in existing events */
    namingConvention: NamingConvention;
    /** Custom naming pattern, if namingConvention is "custom" */
    customNamingPattern?: string;
}
/**
 * Project-level event taxonomy stored in .planu/event-taxonomy.json.
 */
export interface AnalyticsTaxonomy {
    /** Version of the taxonomy, increments with each new event added */
    version: string;
    /** Last update date (ISO 8601) */
    updatedAt: string;
    /** All events defined in the project, indexed by name */
    events: Record<string, AnalyticsEvent>;
    /** Active naming convention of the project */
    namingConvention: NamingConvention;
}
/**
 * Gap in event properties relative to business goals.
 */
export interface AnalyticsPropertyGap {
    /** Name of the event with insufficient properties */
    eventName: string;
    /** Business question from the spec that cannot be answered with current properties */
    businessQuestion: string;
    /** Specific properties missing to answer the question */
    missingProperties: string[];
}
/**
 * Gap in analytics coverage for a production spec.
 */
export interface AnalyticsCoverageGap {
    /** ID of the spec without analytics coverage */
    specId: string;
    /** Title of the feature */
    featureTitle: string;
    /** Status of the spec (should be "produccion" to be a reportable gap) */
    specStatus: string;
}
/**
 * Single analytics provider configuration entry.
 */
export interface AnalyticsProviderConfig {
    id: AnalyticsProvider;
    displayName: string;
    trackingFunctionSignatures: string[];
    detectionPatterns: string[];
    integrationMethods: IntegrationMethod[];
    sdkPackages: string[];
    supportsCustomEvents: boolean;
}
/**
 * Single A/B testing provider configuration entry.
 */
export interface ABTestingProviderConfig {
    id: ABTestingProvider;
    displayName: string;
    detectionPatterns: string[];
}
/**
 * Full structure of analytics-providers.json.
 */
export interface AnalyticsProvidersFile {
    providers: AnalyticsProviderConfig[];
    abTestingProviders: ABTestingProviderConfig[];
    funnelVocabulary: string[];
    abTestVocabulary: string[];
    userInteractionVocabulary: string[];
}
export interface ForceTransitionEntry {
    specId: string;
    type: 'forceStatus' | 'forceApprove';
    timestamp: string;
    reason: string;
    agentId: string;
}
export interface ForceAnalytics {
    forcedTransitions: ForceTransitionEntry[];
    stats: {
        totalSpecs: number;
        forcedSpecs: number;
        ratio: number;
    };
}
//# sourceMappingURL=analytics.d.ts.map