import { readSyncManifest, type SyncManifest } from './localSync.js'; export declare const EXPERIMENT_GENERATED_PATHS: readonly ["src/config/experiments.generated.ts", "src/config/experiments.ts"]; declare const EXPERIMENT_GENERATED_CONTENT_TYPE = "text/typescript"; declare const EXPERIMENT_METRICS: readonly ["step_completion", "next_step_reached", "checkout_opened", "funnel_completed", "paying_customer"]; export type ExperimentMetric = (typeof EXPERIMENT_METRICS)[number]; export type AgentExperimentVariant = { variantKey: string; label: string; routeToStepId: string; trafficPercent: number; isControl: boolean; }; export type AgentPricingExperimentVariant = AgentExperimentVariant & { offerSetId: string; }; type SharedAgentExperimentSpec = { id: string; name: string; stepId: string; primaryMetric: ExperimentMetric; trackedMetrics: ExperimentMetric[]; }; export type AgentExperimentSpec = SharedAgentExperimentSpec & ({ type: 'step' | 'paywall'; variants: AgentExperimentVariant[]; } | { type: 'pricing'; variants: AgentPricingExperimentVariant[]; }); export type GeneratedExperimentFile = { path: (typeof EXPERIMENT_GENERATED_PATHS)[number]; content: string; contentType: typeof EXPERIMENT_GENERATED_CONTENT_TYPE; }; export type ExperimentCreateResponse = { experiment: Record & { id: string; posthog_flag_key: string; }; variants: Array & { id: string; experiment_id: string; variant_key: string; label: string; route_to_step_id: string; traffic_percent: number; is_control: boolean; }>; draftVersionId: string; generatedFiles: []; githubConnected: boolean; }; export declare class ExperimentCreateContractError extends Error { constructor(fieldPath: string, reason: string); } export declare function parseAgentExperimentSpec(value: unknown): AgentExperimentSpec; export declare function readAgentExperimentSpec(filePath: string): Promise; export declare function parseExperimentCreateResponse(value: unknown, requestedSpec: AgentExperimentSpec, expectedFunnelIdValue: string): ExperimentCreateResponse; export declare function assertGeneratedExperimentFilesUnchanged(root: string, manifestValue: SyncManifest): Promise; export declare function buildExperimentCreateManifest(manifestValue: SyncManifest, draftVersionIdValue: string, filesValue: unknown): SyncManifest; export type ExperimentCreateInstallPhase = 'prepared' | 'ready' | `generated:${GeneratedExperimentFile['path']}` | 'before-manifest' | 'manifest'; type ExperimentCreateInstallHooks = { afterPhase?: (phase: ExperimentCreateInstallPhase) => void | Promise; }; export declare function recoverExperimentCreateTransaction(root: string): Promise; export declare function installExperimentCreateTransaction(root: string, input: { generatedFiles: unknown; manifest: SyncManifest; }, hooks?: ExperimentCreateInstallHooks): Promise; export type ExecuteExperimentCreateInput = { sourceDir: string; specPath: string; createFromSpec: (input: { workspaceId: string; funnelId: string; expectedDraftVersionId: string; spec: AgentExperimentSpec; }) => Promise; }; export type ExperimentCreateSuccess = { experimentId: string; experimentKey: string; draftVersionId: string; writtenPaths: []; githubConnected: boolean; }; type ExecuteExperimentCreateDependencies = { recover: typeof recoverExperimentCreateTransaction; readManifest: typeof readSyncManifest; readSpec: typeof readAgentExperimentSpec; parseResponse: typeof parseExperimentCreateResponse; }; export declare function executeExperimentCreate(input: ExecuteExperimentCreateInput, dependencyOverrides?: Partial): Promise; export declare function formatExperimentCreateSuccess(result: ExperimentCreateSuccess, json: boolean): string; export {};