export declare const AGENT_NATIVE_LIFECYCLE_EVENTS: { readonly appEntered: "app_entered"; readonly coreActionStarted: "core_action_started"; readonly coreActionCompleted: "core_action_completed"; readonly outputViewed: "output_viewed"; readonly outputShared: "output_shared"; readonly returnUsage: "return_usage"; readonly crossAppUsed: "cross_app_used"; readonly coreActionFailed: "core_action_failed"; readonly ctaClicked: "cta_clicked"; }; export declare const AGENT_NATIVE_ACTION_EVENTS: { readonly started: "action_started"; readonly completed: "action_completed"; readonly failed: "action_failed"; }; /** Ephemeral join key shared by legacy and canonical records for one event. */ export declare const TRACKING_EVENT_ALIAS_ID_PROPERTY = "event_alias_id"; export type AgentNativeLifecycleEventName = (typeof AGENT_NATIVE_LIFECYCLE_EVENTS)[keyof typeof AGENT_NATIVE_LIFECYCLE_EVENTS]; export type AgentNativeActionEventName = (typeof AGENT_NATIVE_ACTION_EVENTS)[keyof typeof AGENT_NATIVE_ACTION_EVENTS]; export declare const LEGACY_TRACKING_EVENT_NAME_ALIASES: { readonly "auth.login_clicked": "auth_login_clicked"; readonly "auth.signup_clicked": "auth_signup_clicked"; readonly "auth.signup_completed": "auth_signup_completed"; readonly "auth.signup_viewed": "auth_signup_viewed"; readonly "build your app": "build_your_app"; readonly "builder branch waitlist joined": "builder_branch_waitlist_joined"; readonly "builder connect clicked": "builder_connect_clicked"; readonly "builder connect failed": "builder_connect_failed"; readonly "builder connect popup blocked": "builder_connect_popup_blocked"; readonly "builder connect started": "builder_connect_started"; readonly "builder connect succeeded": "builder_connect_succeeded"; readonly "builder disconnect failed": "builder_disconnect_failed"; readonly "builder disconnect succeeded": "builder_disconnect_succeeded"; readonly "checkout.completed": "checkout_completed"; readonly "choose get started path": "choose_get_started_path"; readonly "click add to agent": "click_add_to_agent"; readonly "click build online": "click_build_online"; readonly "click community app": "click_community_app"; readonly "click community app action": "click_community_app_action"; readonly "click community app demo": "click_community_app_demo"; readonly "click community app source": "click_community_app_source"; readonly "click customize it": "click_customize_it"; readonly "click customize locally": "click_customize_locally"; readonly "click customize online": "click_customize_online"; readonly "click get started": "click_get_started"; readonly "click template": "click_template"; readonly "click view docs": "click_view_docs"; readonly "copy cli command": "copy_cli_command"; readonly "copy code block": "copy_code_block"; readonly "copy install command": "copy_install_command"; readonly "create form": "create_form"; readonly "desktop download": "desktop_download"; readonly "desktop open": "desktop_open"; readonly "environment switched": "environment_switched"; readonly "generate deck": "generate_deck"; readonly "open assets": "open_assets"; readonly "open hosted demo": "open_hosted_demo"; readonly "session replay upload rejected": "session_replay_upload_rejected"; readonly "session status": "session_status"; readonly "skill read docs": "skill_read_docs"; readonly "skills_cli cancelled": "skills_cli_cancelled"; readonly "skills_cli clients selected": "skills_cli_clients_selected"; readonly "skills_cli completed": "skills_cli_completed"; readonly "skills_cli connect completed": "skills_cli_connect_completed"; readonly "skills_cli connect failed": "skills_cli_connect_failed"; readonly "skills_cli connect started": "skills_cli_connect_started"; readonly "skills_cli failed": "skills_cli_failed"; readonly "skills_cli github action added": "skills_cli_github_action_added"; readonly "skills_cli install completed": "skills_cli_install_completed"; readonly "skills_cli instructions updated": "skills_cli_instructions_updated"; readonly "skills_cli mcp registered": "skills_cli_mcp_registered"; readonly "skills_cli plan mode selected": "skills_cli_plan_mode_selected"; readonly "skills_cli scope selected": "skills_cli_scope_selected"; readonly "skills_cli skills listed": "skills_cli_skills_listed"; readonly "skills_cli skills prompted": "skills_cli_skills_prompted"; readonly "skills_cli skills selected": "skills_cli_skills_selected"; readonly "skills_cli started": "skills_cli_started"; readonly "start from scratch": "start_from_scratch"; readonly "submit community app": "submit_community_app"; readonly "try live demo": "try_live_demo"; readonly "view clip preview": "view_clip_preview"; readonly "view plan video preview": "view_plan_video_preview"; }; export declare function canonicalTrackingEvent(name: string, properties: Record): { name: string; properties: Record; } | null; export declare function normalizeTrackingDimension(value: unknown): string | undefined; export declare function withCanonicalTrackingProperties(properties: Record): Record; export declare function legacyLifecycleEvent(name: string, properties: Record): { name: AgentNativeLifecycleEventName; properties: Record; } | null; /** * The named reasons an agent run fails, recorded as `cause` on the browser's * `agent_run_outcome` event. Analytics groups agent trouble by these and by * error code for everything else, so a new name here is a product decision, * not a refactor. */ export declare const AGENT_TROUBLE_CAUSES: readonly ["no_model_connected", "rate_limit", "context_overflow", "provider_error"]; export type AgentTroubleCause = (typeof AGENT_TROUBLE_CAUSES)[number]; export declare function isAgentTroubleCause(value: unknown): value is AgentTroubleCause; /** * Telemetry's copy of a run error code. A code is whatever its thrower set, * such as a route error's `data.code`, so one could be a sentence naming a * person or a document: only an identifier is sent as itself. */ export declare const UNRECOGNIZED_AGENT_ERROR_CODE = "unrecognized_code"; export declare function agentErrorCodeForTelemetry(code: string | null | undefined): string | null; /** The named cause of a run error code, or null when no name fits it. */ export declare function agentTroubleCauseForCode(code: string | null | undefined): AgentTroubleCause | null; /** * Every pageview carries `agent_signals: AGENT_SIGNALS_VERSION` from a client * that reports each stopped run unsampled and each thumbs rating as * `agent_feedback_submitted`, and a `page_load_id` on every pageview. * Older clients sampled stops, sent no ratings, and sent no page load id, so * Analytics counts a session's cancelled runs, thumbs-down, and quick backs as * measured only once it has seen the marker. */ export declare const AGENT_SIGNALS_PAGEVIEW_PROPERTY = "agent_signals"; export declare const AGENT_SIGNALS_VERSION = 1; /** * Every pageview carries an id that stays the same for one page load. One * analytics session spans every tab, so Analytics follows each page load's * navigation on its own to tell a return to the previous page from a page * another tab opened. */ export declare const PAGE_LOAD_PAGEVIEW_PROPERTY = "page_load_id"; /** * Action telemetry reports every `action.response` at least this slow * unsampled, and marks each one someone waited for on the session replay with * its own timing. */ export declare const SLOW_ACTION_RESPONSE_MS = 1000; /** * Whether an `action.response`'s duration is what a person waited for. * Background tabs throttle timers and cancelled requests never finish. */ export declare function isWaitedActionResponse(properties: { page_hidden?: unknown; outcome?: unknown; }): boolean;