import { type CliName } from "../cli/commands/cliCommandNames.js"; import { type Config } from "../cli/config.js"; /** * Set the tilework source identifier for analytics events. * Call this early in your entry point before any analytics calls. * @param args - Arguments * @param args.source - The source identifier ("nori-ai" or "nori-skillsets") */ export declare const setTileworkSource: (args: { source: CliName; }) => void; /** * Get the current tilework source identifier. * @returns The current source identifier */ export declare const getTileworkSource: () => CliName; /** * Type definitions matching the PLAN_ANALYTICS_PROXY.md API spec */ export type EventParams = { tilework_source: string; tilework_session_id: string; tilework_timestamp: string; [key: string]: unknown; }; /** * CLI-specific event params extending base EventParams */ export type CLIEventParams = EventParams & { tilework_cli_executable_name: string; tilework_cli_installed_version: string; tilework_cli_install_source: string; tilework_cli_days_since_install: number; tilework_cli_node_version: string; tilework_cli_profile: string | null; tilework_cli_install_type: "paid" | "free"; }; type InstallState = { schema_version: number; client_id: string; opt_out: boolean; first_installed_at: string; last_updated_at: string; last_launched_at: string; installed_version: string; install_source: string; }; export declare const getDeterministicClientId: () => string; /** * Build the base event params required for ALL events. * Note: tilework_session_id is constant for the process lifetime, * while tilework_timestamp captures when each event is sent. * @returns Base event params with tilework_source, tilework_session_id, and tilework_timestamp */ export declare const buildBaseEventParams: () => EventParams; /** * Send analytics event with proper structure matching PLAN_ANALYTICS_PROXY.md * @param args - Event arguments * @param args.eventName - Name of the event (e.g., "claude_session_started") * @param args.eventParams - Event parameters including tilework_* fields * @param args.clientId - Optional client ID (defaults to deterministic ID) * @param args.userId - Optional user ID for cross-device tracking */ export declare const sendAnalyticsEvent: (args: { eventName: string; eventParams: EventParams; clientId?: string | null; userId?: string | null; }) => void; /** * Get user ID (email) from config for cross-device tracking. * @param args - Optional arguments * @param args.config - Pre-loaded config (optional, will load if not provided). * Pass `null` explicitly to skip loading config and return null. * * @returns User email or null if not authenticated */ export declare const getUserId: (args?: { config?: Config | null; }) => Promise; /** * Build CLI-specific event params with all standard tilework_cli_* fields. * Loads config and install state to populate fields automatically. * @param args - Optional arguments * @param args.config - Pre-loaded config (optional, will load if not provided) * @param args.agentName - Agent name for profile lookup (default: "claude-code") * @param args.currentVersion - Current CLI version (optional, reads from package if not provided) * * @returns CLI event params including base params and all tilework_cli_* fields */ export declare const buildCLIEventParams: (args?: { config?: Config | null; agentName?: string | null; currentVersion?: string | null; }) => Promise; /** * Read install state from disk. * @returns Install state or null if not found */ export declare const readInstallState: () => Promise; export declare const trackInstallLifecycle: (args: { currentVersion: string; }) => Promise; export {}; //# sourceMappingURL=installTracking.d.ts.map