@od-oneapp/analytics 2026.1.1301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +509 -0
  2. package/dist/ai-YMnynb-t.mjs +3347 -0
  3. package/dist/ai-YMnynb-t.mjs.map +1 -0
  4. package/dist/chunk-DQk6qfdC.mjs +18 -0
  5. package/dist/client-CTzJVFU5.mjs +9 -0
  6. package/dist/client-CTzJVFU5.mjs.map +1 -0
  7. package/dist/client-CcFTauAh.mjs +54 -0
  8. package/dist/client-CcFTauAh.mjs.map +1 -0
  9. package/dist/client-CeOLjbac.mjs +281 -0
  10. package/dist/client-CeOLjbac.mjs.map +1 -0
  11. package/dist/client-D339NFJS.mjs +267 -0
  12. package/dist/client-D339NFJS.mjs.map +1 -0
  13. package/dist/client-next.d.mts +62 -0
  14. package/dist/client-next.d.mts.map +1 -0
  15. package/dist/client-next.mjs +525 -0
  16. package/dist/client-next.mjs.map +1 -0
  17. package/dist/client.d.mts +30 -0
  18. package/dist/client.d.mts.map +1 -0
  19. package/dist/client.mjs +186 -0
  20. package/dist/client.mjs.map +1 -0
  21. package/dist/config-DPS6bSYo.d.mts +34 -0
  22. package/dist/config-DPS6bSYo.d.mts.map +1 -0
  23. package/dist/config-P6P5adJg.mjs +287 -0
  24. package/dist/config-P6P5adJg.mjs.map +1 -0
  25. package/dist/console-8bND3mMU.mjs +128 -0
  26. package/dist/console-8bND3mMU.mjs.map +1 -0
  27. package/dist/ecommerce-Cgu4wlux.mjs +993 -0
  28. package/dist/ecommerce-Cgu4wlux.mjs.map +1 -0
  29. package/dist/emitters-6-nKo8i-.mjs +208 -0
  30. package/dist/emitters-6-nKo8i-.mjs.map +1 -0
  31. package/dist/emitters-DldkVSPp.d.mts +12 -0
  32. package/dist/emitters-DldkVSPp.d.mts.map +1 -0
  33. package/dist/index-BfNWgfa5.d.mts +1494 -0
  34. package/dist/index-BfNWgfa5.d.mts.map +1 -0
  35. package/dist/index-BkIWe--N.d.mts +953 -0
  36. package/dist/index-BkIWe--N.d.mts.map +1 -0
  37. package/dist/index-jPzXRn52.d.mts +184 -0
  38. package/dist/index-jPzXRn52.d.mts.map +1 -0
  39. package/dist/manager-DvRRjza6.d.mts +76 -0
  40. package/dist/manager-DvRRjza6.d.mts.map +1 -0
  41. package/dist/posthog-bootstrap-CYfIy_WS.mjs +1769 -0
  42. package/dist/posthog-bootstrap-CYfIy_WS.mjs.map +1 -0
  43. package/dist/posthog-bootstrap-DWxFrxlt.d.mts +81 -0
  44. package/dist/posthog-bootstrap-DWxFrxlt.d.mts.map +1 -0
  45. package/dist/providers-http-client.d.mts +37 -0
  46. package/dist/providers-http-client.d.mts.map +1 -0
  47. package/dist/providers-http-client.mjs +320 -0
  48. package/dist/providers-http-client.mjs.map +1 -0
  49. package/dist/providers-http-server.d.mts +31 -0
  50. package/dist/providers-http-server.d.mts.map +1 -0
  51. package/dist/providers-http-server.mjs +297 -0
  52. package/dist/providers-http-server.mjs.map +1 -0
  53. package/dist/providers-http.d.mts +46 -0
  54. package/dist/providers-http.d.mts.map +1 -0
  55. package/dist/providers-http.mjs +4 -0
  56. package/dist/server-edge.d.mts +9 -0
  57. package/dist/server-edge.d.mts.map +1 -0
  58. package/dist/server-edge.mjs +373 -0
  59. package/dist/server-edge.mjs.map +1 -0
  60. package/dist/server-next.d.mts +67 -0
  61. package/dist/server-next.d.mts.map +1 -0
  62. package/dist/server-next.mjs +193 -0
  63. package/dist/server-next.mjs.map +1 -0
  64. package/dist/server.d.mts +10 -0
  65. package/dist/server.mjs +7 -0
  66. package/dist/service-cYtBBL8x.mjs +945 -0
  67. package/dist/service-cYtBBL8x.mjs.map +1 -0
  68. package/dist/shared.d.mts +16 -0
  69. package/dist/shared.d.mts.map +1 -0
  70. package/dist/shared.mjs +93 -0
  71. package/dist/shared.mjs.map +1 -0
  72. package/dist/types-BxBnNQ0V.d.mts +354 -0
  73. package/dist/types-BxBnNQ0V.d.mts.map +1 -0
  74. package/dist/types-CBvxUEaF.d.mts +216 -0
  75. package/dist/types-CBvxUEaF.d.mts.map +1 -0
  76. package/dist/types.d.mts +4 -0
  77. package/dist/types.mjs +0 -0
  78. package/dist/vercel-types-lwakUfoI.d.mts +102 -0
  79. package/dist/vercel-types-lwakUfoI.d.mts.map +1 -0
  80. package/package.json +129 -0
  81. package/src/client/index.ts +164 -0
  82. package/src/client/manager.ts +71 -0
  83. package/src/client/next/components.tsx +270 -0
  84. package/src/client/next/hooks.ts +217 -0
  85. package/src/client/next/manager.ts +141 -0
  86. package/src/client/next.ts +144 -0
  87. package/src/client-next.ts +101 -0
  88. package/src/client.ts +89 -0
  89. package/src/examples/ai-sdk-patterns.ts +583 -0
  90. package/src/examples/emitter-patterns.ts +476 -0
  91. package/src/examples/nextjs-emitter-patterns.tsx +403 -0
  92. package/src/next/app-router.tsx +564 -0
  93. package/src/next/client.ts +419 -0
  94. package/src/next/index.ts +84 -0
  95. package/src/next/middleware.ts +429 -0
  96. package/src/next/rsc.tsx +300 -0
  97. package/src/next/server.ts +253 -0
  98. package/src/next/types.d.ts +220 -0
  99. package/src/providers/base-provider.ts +419 -0
  100. package/src/providers/console/client.ts +10 -0
  101. package/src/providers/console/index.ts +152 -0
  102. package/src/providers/console/server.ts +6 -0
  103. package/src/providers/console/types.ts +15 -0
  104. package/src/providers/http/client.ts +464 -0
  105. package/src/providers/http/index.ts +30 -0
  106. package/src/providers/http/server.ts +396 -0
  107. package/src/providers/http/types.ts +135 -0
  108. package/src/providers/posthog/client.ts +518 -0
  109. package/src/providers/posthog/index.ts +11 -0
  110. package/src/providers/posthog/server.ts +329 -0
  111. package/src/providers/posthog/types.ts +104 -0
  112. package/src/providers/segment/client.ts +113 -0
  113. package/src/providers/segment/index.ts +11 -0
  114. package/src/providers/segment/server.ts +115 -0
  115. package/src/providers/segment/types.ts +51 -0
  116. package/src/providers/vercel/client.ts +102 -0
  117. package/src/providers/vercel/index.ts +11 -0
  118. package/src/providers/vercel/server.ts +89 -0
  119. package/src/providers/vercel/types.ts +27 -0
  120. package/src/server/index.ts +103 -0
  121. package/src/server/manager.ts +62 -0
  122. package/src/server/next.ts +210 -0
  123. package/src/server-edge.ts +442 -0
  124. package/src/server-next.ts +39 -0
  125. package/src/server.ts +106 -0
  126. package/src/shared/emitters/ai/README.md +981 -0
  127. package/src/shared/emitters/ai/events/agent.ts +130 -0
  128. package/src/shared/emitters/ai/events/artifacts.ts +167 -0
  129. package/src/shared/emitters/ai/events/chat.ts +126 -0
  130. package/src/shared/emitters/ai/events/chatbot-ecommerce.ts +133 -0
  131. package/src/shared/emitters/ai/events/completion.ts +103 -0
  132. package/src/shared/emitters/ai/events/content-generation.ts +347 -0
  133. package/src/shared/emitters/ai/events/conversation.ts +332 -0
  134. package/src/shared/emitters/ai/events/product-features.ts +1402 -0
  135. package/src/shared/emitters/ai/events/streaming.ts +114 -0
  136. package/src/shared/emitters/ai/events/tool.ts +93 -0
  137. package/src/shared/emitters/ai/index.ts +69 -0
  138. package/src/shared/emitters/ai/track-ai-sdk.ts +74 -0
  139. package/src/shared/emitters/ai/track-ai.ts +50 -0
  140. package/src/shared/emitters/ai/types.ts +1041 -0
  141. package/src/shared/emitters/ai/utils.ts +468 -0
  142. package/src/shared/emitters/ecommerce/events/cart-checkout.ts +106 -0
  143. package/src/shared/emitters/ecommerce/events/coupon.ts +49 -0
  144. package/src/shared/emitters/ecommerce/events/engagement.ts +61 -0
  145. package/src/shared/emitters/ecommerce/events/marketplace.ts +119 -0
  146. package/src/shared/emitters/ecommerce/events/order.ts +199 -0
  147. package/src/shared/emitters/ecommerce/events/product.ts +205 -0
  148. package/src/shared/emitters/ecommerce/events/registry.ts +123 -0
  149. package/src/shared/emitters/ecommerce/events/wishlist-sharing.ts +140 -0
  150. package/src/shared/emitters/ecommerce/index.ts +46 -0
  151. package/src/shared/emitters/ecommerce/track-ecommerce.ts +53 -0
  152. package/src/shared/emitters/ecommerce/types.ts +314 -0
  153. package/src/shared/emitters/ecommerce/utils.ts +216 -0
  154. package/src/shared/emitters/emitter-types.ts +974 -0
  155. package/src/shared/emitters/emitters.ts +292 -0
  156. package/src/shared/emitters/helpers.ts +419 -0
  157. package/src/shared/emitters/index.ts +66 -0
  158. package/src/shared/index.ts +142 -0
  159. package/src/shared/ingestion/index.ts +66 -0
  160. package/src/shared/ingestion/schemas.ts +386 -0
  161. package/src/shared/ingestion/service.ts +628 -0
  162. package/src/shared/node22-features.ts +848 -0
  163. package/src/shared/providers/console-provider.ts +160 -0
  164. package/src/shared/types/base-types.ts +54 -0
  165. package/src/shared/types/console-types.ts +19 -0
  166. package/src/shared/types/posthog-types.ts +131 -0
  167. package/src/shared/types/segment-types.ts +15 -0
  168. package/src/shared/types/types.ts +397 -0
  169. package/src/shared/types/vercel-types.ts +19 -0
  170. package/src/shared/utils/config-client.ts +19 -0
  171. package/src/shared/utils/config.ts +250 -0
  172. package/src/shared/utils/emitter-adapter.ts +212 -0
  173. package/src/shared/utils/manager.test.ts +36 -0
  174. package/src/shared/utils/manager.ts +1322 -0
  175. package/src/shared/utils/posthog-bootstrap.ts +136 -0
  176. package/src/shared/utils/posthog-client-utils.ts +48 -0
  177. package/src/shared/utils/posthog-next-utils.ts +282 -0
  178. package/src/shared/utils/posthog-server-utils.ts +210 -0
  179. package/src/shared/utils/rate-limit.ts +289 -0
  180. package/src/shared/utils/security.ts +545 -0
  181. package/src/shared/utils/validation-client.ts +161 -0
  182. package/src/shared/utils/validation.ts +399 -0
  183. package/src/shared.ts +155 -0
  184. package/src/types/index.ts +62 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-YMnynb-t.mjs","names":[],"sources":["../src/shared/emitters/ai/types.ts","../src/shared/emitters/ai/utils.ts","../src/shared/emitters/ai/track-ai.ts","../src/shared/emitters/ai/track-ai-sdk.ts","../src/shared/emitters/ai/events/conversation.ts","../src/shared/emitters/ai/events/content-generation.ts","../src/shared/emitters/ai/events/artifacts.ts","../src/shared/emitters/ai/events/product-features.ts","../src/shared/emitters/ai/events/agent.ts","../src/shared/emitters/ai/events/chat.ts","../src/shared/emitters/ai/events/chatbot-ecommerce.ts","../src/shared/emitters/ai/events/completion.ts","../src/shared/emitters/ai/events/streaming.ts","../src/shared/emitters/ai/events/tool.ts","../src/shared/emitters/ai/index.ts"],"sourcesContent":["/**\n * @fileoverview Platform-standard AI product event types\n * Platform-standard AI product event types\n *\n * Comprehensive tracking for AI assistant/copilot products like ChatGPT, Claude, Copilot.\n * Tracks product features, user interactions, and system operations - NOT use-case specific.\n *\n * Completely separate from e-commerce tracking.\n */\n\n// =============================================================================\n// BASE PROPERTIES\n// =============================================================================\n\nexport interface BaseAIProperties {\n agent_id?: string | undefined;\n agent_name?: string | undefined;\n conversation_id?: string | undefined;\n message_id?: string | undefined;\n model_id: string;\n model_provider?:\n | 'anthropic'\n | 'openai'\n | 'google'\n | 'perplexity'\n | 'cohere'\n | 'mistral'\n | 'other'\n | undefined;\n operation_id?: string | undefined;\n session_id?: string | undefined;\n user_id?: string | undefined;\n workspace_id?: string | undefined;\n}\n\nexport interface TokenUsageProperties {\n cost?: number;\n cost_currency?: string;\n input_tokens?: number;\n output_tokens?: number;\n total_tokens?: number;\n}\n\nexport interface ModelConfigProperties {\n frequency_penalty?: number;\n max_tokens?: number;\n max_output_tokens?: number;\n presence_penalty?: number;\n seed?: number;\n stop_sequences?: string[];\n temperature?: number;\n top_p?: number;\n}\n\n// =============================================================================\n// CONVERSATION & MESSAGING\n// =============================================================================\n\nexport interface ConversationProperties extends BaseAIProperties {\n conversation_title?: string;\n folder_id?: string;\n is_shared?: boolean;\n parent_conversation_id?: string; // For branching\n total_messages?: number;\n conversation_type?: string;\n last_active_timestamp?: number;\n end_reason?: string;\n [key: string]: any;\n}\n\nexport interface MessageProperties extends BaseAIProperties, TokenUsageProperties {\n content_length?: number;\n has_attachments?: boolean;\n has_code?: boolean;\n has_images?: boolean;\n is_edited?: boolean;\n is_regenerated?: boolean;\n message_index?: number;\n message_role: 'user' | 'assistant' | 'system' | 'tool';\n parent_message_id?: string; // For branching\n response_time_ms?: number;\n finish_reason?: string;\n is_streaming?: boolean;\n message_length?: number;\n edit_type?: string;\n deleted_by?: string;\n [key: string]: any;\n}\n\nexport interface RegenerationProperties extends BaseAIProperties {\n attempt_number?: number;\n original_message_id: string;\n reason?: 'user-requested' | 'error-recovery' | 'quality-improvement';\n temperature_adjusted?: boolean;\n [key: string]: any;\n}\n\nexport interface MessageEditProperties extends BaseAIProperties {\n edit_type: 'user-message' | 'assistant-message';\n edited_message_id: string;\n new_length?: number;\n original_length?: number;\n [key: string]: any;\n}\n\nexport interface BranchProperties extends BaseAIProperties {\n branch_point_message_id: string;\n new_conversation_id: string;\n original_conversation_id: string;\n reason?: 'explore-alternative' | 'correct-error' | 'user-initiated';\n merge_strategy?: string;\n [key: string]: any;\n}\n\nexport interface StopGenerationProperties extends BaseAIProperties {\n partial_length?: number;\n stop_reason?: 'user-interrupted' | 'user-stopped' | 'timeout' | 'error';\n tokens_used_at_stop?: number;\n [key: string]: any;\n}\n\n// =============================================================================\n// CONTENT GENERATION\n// =============================================================================\n\nexport interface TextGenerationProperties extends BaseAIProperties, TokenUsageProperties {\n content_type: 'general' | 'creative' | 'technical' | 'summary' | 'translation';\n finish_reason?: 'stop' | 'length' | 'content_filter';\n generation_time_ms?: number;\n output_length?: number;\n prompt_length?: number;\n}\n\nexport interface CodeGenerationProperties extends BaseAIProperties, TokenUsageProperties {\n code_length?: number;\n has_explanation?: boolean;\n has_tests?: boolean;\n language?: string;\n source?: string;\n task_type?: 'generate' | 'edit' | 'debug' | 'explain' | 'refactor' | 'translate';\n code_type?: string;\n explanation_length?: number;\n explanation_type?: string;\n issues_found?: number;\n refactor_type?: string;\n source_language?: string;\n [key: string]: any;\n}\n\nexport interface ImageGenerationProperties extends BaseAIProperties {\n generation_time_ms?: number;\n height?: number;\n image_format?: 'png' | 'jpg' | 'webp';\n model?: string; // DALL-E, Midjourney, Stable Diffusion\n prompt_length?: number;\n quality?: 'standard' | 'hd';\n revisions?: number;\n style?: string;\n width?: number;\n image_type?: string;\n [key: string]: any;\n}\n\nexport interface SummaryProperties extends BaseAIProperties, TokenUsageProperties {\n input_length?: number;\n output_length?: number;\n source_type?: 'conversation' | 'document' | 'webpage' | 'code';\n summary_type?: 'brief' | 'detailed' | 'key-points' | 'tldr';\n source_length?: number;\n [key: string]: any;\n}\n\nexport interface TranslationProperties extends BaseAIProperties, TokenUsageProperties {\n source_language?: string;\n target_language?: string;\n text_length?: number;\n translation_quality?: 'literal' | 'natural' | 'formal';\n [key: string]: any;\n}\n\nexport interface ContentGenerationProperties extends BaseAIProperties, TokenUsageProperties {\n content_type?: string;\n generation_time_ms?: number;\n output_length?: number;\n prompt_length?: number;\n content_length?: number;\n content_format?: string;\n completion_type?: string;\n rewrite_style?: string;\n email_type?: string;\n document_type?: string;\n section_count?: number;\n source_language?: string;\n [key: string]: any;\n}\n\n// =============================================================================\n// FILES & ATTACHMENTS\n// =============================================================================\n\nexport interface FileUploadProperties extends BaseAIProperties {\n file_size_bytes?: number;\n file_type: string;\n upload_duration_ms?: number;\n [key: string]: any;\n}\n\nexport interface FileAnalysisProperties extends BaseAIProperties, TokenUsageProperties {\n analysis_type: 'read' | 'summarize' | 'extract' | 'question-answer';\n file_id: string;\n file_type: string;\n processing_time_ms?: number;\n [key: string]: any;\n}\n\nexport interface ImageAnalysisProperties extends BaseAIProperties, TokenUsageProperties {\n analysis_type: 'describe' | 'ocr' | 'question-answer' | 'object-detection';\n image_id: string;\n image_size_bytes?: number;\n [key: string]: any;\n}\n\n// =============================================================================\n// SEARCH, BROWSE & CITATIONS\n// =============================================================================\n\nexport interface WebSearchProperties extends BaseAIProperties {\n query: string;\n results_count?: number;\n search_duration_ms?: number;\n search_provider?: string;\n [key: string]: any;\n}\n\nexport interface WebBrowseProperties extends BaseAIProperties {\n duration_ms?: number;\n page_content_length?: number;\n url: string;\n [key: string]: any;\n}\n\nexport interface CitationProperties extends BaseAIProperties {\n citation_count?: number;\n citation_format?: 'inline' | 'footnote' | 'reference-list';\n message_id: string;\n sources?: string[];\n [key: string]: any;\n}\n\n// =============================================================================\n// TOOLS & FUNCTIONS\n// =============================================================================\n\nexport interface ToolCallProperties extends BaseAIProperties {\n error_message?: string;\n execution_time_ms?: number;\n input_params?: Record<string, any>;\n input_size?: number;\n output_size?: number;\n result_status: 'success' | 'error' | 'timeout';\n tool_name: string;\n tool_type: 'built-in' | 'plugin' | 'custom' | 'api';\n [key: string]: any;\n}\n\nexport interface PluginProperties extends BaseAIProperties {\n plugin_id: string;\n plugin_name: string;\n plugin_version?: string;\n [key: string]: any;\n}\n\nexport interface APICallProperties extends BaseAIProperties {\n api_endpoint: string;\n api_method?: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response_time_ms?: number;\n status_code?: number;\n [key: string]: any;\n}\n\n// =============================================================================\n// CONTEXT & MEMORY\n// =============================================================================\n\nexport interface ContextProperties extends BaseAIProperties {\n context_length_tokens?: number;\n context_source?: 'history' | 'memory' | 'custom-instructions' | 'system';\n context_type: 'added' | 'updated' | 'pruned' | 'cleared';\n tokens_saved?: number;\n [key: string]: any;\n}\n\nexport interface MemoryProperties extends BaseAIProperties {\n memory_id?: string;\n memory_recalled?: boolean;\n memory_type: 'stored' | 'retrieved' | 'updated' | 'cleared';\n relevance_score?: number;\n [key: string]: any;\n}\n\nexport interface CustomInstructionsProperties extends BaseAIProperties {\n instructions_length?: number;\n instructions_type: 'created' | 'updated' | 'cleared';\n template_used?: boolean;\n [key: string]: any;\n}\n\n// =============================================================================\n// USER INTERACTIONS & PREFERENCES\n// =============================================================================\n\nexport interface ModelSelectionProperties extends BaseAIProperties {\n previous_model_id?: string;\n reason?: 'user-preference' | 'feature-requirement' | 'cost-optimization';\n selected_model_id: string;\n [key: string]: any;\n}\n\nexport interface ParameterAdjustmentProperties extends BaseAIProperties {\n new_value: number | string;\n parameter_name: 'temperature' | 'max_tokens' | 'top_p' | 'frequency_penalty';\n previous_value?: number | string;\n [key: string]: any;\n}\n\nexport interface VoiceProperties extends BaseAIProperties {\n audio_duration_ms?: number;\n language?: string;\n voice_type: 'input' | 'output';\n [key: string]: any;\n}\n\nexport interface StreamingProperties extends BaseAIProperties {\n chunk_count?: number;\n chunks_per_second?: number;\n first_chunk_latency_ms?: number;\n stream_duration_ms?: number;\n stream_type?: 'text' | 'audio' | 'video' | 'image';\n time_to_first_chunk_ms?: number;\n was_stopped?: boolean;\n chunk_index?: number;\n total_bytes?: number;\n [key: string]: any;\n}\n\nexport interface CopyExportProperties extends BaseAIProperties {\n action: 'copy-message' | 'copy-code' | 'export-conversation' | 'download-file';\n content_length?: number;\n export_format?: 'markdown' | 'json' | 'pdf' | 'txt';\n}\n\n// =============================================================================\n// WORKSPACE & ORGANIZATION\n// =============================================================================\n\nexport interface ConversationManagementProperties extends BaseAIProperties {\n action: 'save' | 'rename' | 'delete' | 'archive' | 'pin' | 'move' | 'duplicate';\n new_folder_id?: string;\n new_title?: string;\n}\n\nexport interface FolderProperties extends BaseAIProperties {\n action: 'create' | 'rename' | 'delete' | 'move';\n conversation_count?: number;\n folder_id: string;\n folder_name?: string;\n parent_folder_id?: string;\n}\n\nexport interface SearchProperties extends BaseAIProperties {\n query: string;\n results_count?: number;\n search_scope: 'conversations' | 'messages' | 'all';\n search_time_ms?: number;\n}\n\nexport interface TemplateProperties extends BaseAIProperties {\n action: 'create' | 'use' | 'edit' | 'delete';\n category?: string;\n template_id?: string;\n template_name?: string;\n}\n\n// =============================================================================\n// COLLABORATION & SHARING\n// =============================================================================\n\nexport interface ShareProperties extends BaseAIProperties {\n expiration_time?: string;\n share_id?: string;\n share_scope: 'public' | 'team' | 'private-link';\n share_type: 'conversation' | 'message' | 'artifact';\n}\n\nexport interface WorkspaceProperties extends BaseAIProperties {\n action: 'create' | 'update' | 'delete' | 'invite';\n member_count?: number;\n workspace_name?: string;\n}\n\nexport interface TeamProperties extends BaseAIProperties {\n action: 'invite' | 'remove' | 'update-role';\n member_email?: string;\n member_role?: 'admin' | 'member' | 'viewer';\n team_id: string;\n}\n\nexport interface CommentProperties extends BaseAIProperties {\n comment_id?: string;\n comment_length?: number;\n message_id: string;\n parent_comment_id?: string;\n}\n\n// =============================================================================\n// ARTIFACTS & CANVAS (Claude-style features)\n// =============================================================================\n\nexport interface ArtifactProperties extends BaseAIProperties {\n action: 'create' | 'edit' | 'publish' | 'delete' | 'fork' | 'execute';\n artifact_id?: string;\n artifact_type: 'code' | 'document' | 'visualization' | 'react-component' | 'svg';\n error_message?: string;\n execution_status?: 'success' | 'failed' | 'pending' | 'error';\n execution_time_ms?: number;\n language?: string;\n version?: number;\n content_length?: number;\n changes_description?: string;\n new_artifact_id?: string;\n [key: string]: any;\n}\n\nexport interface CanvasProperties extends BaseAIProperties {\n action: 'open' | 'edit' | 'close' | 'save' | 'execute';\n canvas_id?: string;\n content_type?: 'code' | 'markdown' | 'mermaid' | 'html';\n execution_result?: 'success' | 'error';\n canvas_type?: string;\n artifact_id?: string;\n preview_enabled?: boolean;\n [key: string]: any;\n}\n\n// =============================================================================\n// FEEDBACK & QUALITY\n// =============================================================================\n\nexport interface FeedbackProperties extends BaseAIProperties {\n feedback_category?: 'accuracy' | 'helpfulness' | 'safety' | 'quality' | 'other';\n feedback_text?: string;\n feedback_type: 'thumbs-up' | 'thumbs-down' | 'rating' | 'detailed';\n message_id: string;\n rating?: number;\n [key: string]: any;\n}\n\nexport interface IssueReportProperties extends BaseAIProperties {\n issue_category: 'bug' | 'incorrect-output' | 'inappropriate-content' | 'other';\n issue_description?: string;\n message_id?: string;\n severity?: 'low' | 'medium' | 'high';\n [key: string]: any;\n}\n\nexport interface SafetyProperties extends BaseAIProperties {\n action_taken?: 'blocked' | 'warned' | 'flagged';\n category?: 'harmful' | 'inappropriate' | 'policy-violation';\n message_id?: string;\n safety_score?: number;\n [key: string]: any;\n}\n\n// =============================================================================\n// SYSTEM & PERFORMANCE\n// =============================================================================\n\nexport interface RateLimitProperties extends BaseAIProperties {\n limit_type: 'requests' | 'tokens' | 'cost';\n reset_time_seconds?: number;\n tier?: string;\n [key: string]: any;\n}\n\nexport interface ErrorProperties extends BaseAIProperties {\n error_code?: string;\n error_message: string;\n error_type:\n | 'api'\n | 'timeout'\n | 'network'\n | 'validation'\n | 'content-filter'\n | 'rate-limit'\n | 'unknown';\n operation: string;\n retry_attempted?: boolean;\n [key: string]: any;\n}\n\nexport interface LatencyProperties extends BaseAIProperties {\n latency_ms: number;\n latency_type: 'first-token' | 'total' | 'network' | 'processing';\n operation: string;\n [key: string]: any;\n}\n\nexport interface CostTrackingProperties extends BaseAIProperties, TokenUsageProperties {\n cost_breakdown?: {\n input_cost?: number;\n output_cost?: number;\n tool_cost?: number;\n };\n cost_per_request?: number;\n pricing_tier?: string;\n [key: string]: any;\n}\n\n// =============================================================================\n// ADDITIONAL PROPERTY GROUPS (for product-features.ts)\n// =============================================================================\n\nexport interface CollaborationProperties extends BaseAIProperties {\n member_id?: string;\n member_role?: string;\n permission_level?: string;\n shared_with_count?: number;\n share_type?: 'public' | 'team' | 'specific-users';\n [key: string]: any;\n}\n\nexport interface FileProperties extends BaseAIProperties {\n batch_size?: number;\n extraction_method?: string;\n file_count?: number;\n file_id?: string;\n file_name?: string;\n file_size?: number;\n file_type?: string;\n processing_time_ms?: number;\n file_size_bytes?: number;\n total_size_bytes?: number;\n extracted_text_length?: number;\n processing_status?: string;\n reference_context?: string;\n [key: string]: any;\n}\n\nexport interface PerformanceProperties extends BaseAIProperties {\n duration_ms?: number;\n latency_ms?: number;\n metric_name?: string;\n metric_value?: number;\n [key: string]: any;\n}\n\nexport interface SystemProperties extends BaseAIProperties {\n error_code?: string;\n error_message?: string;\n setting_name?: string;\n setting_value?: string;\n system_event?: string;\n [key: string]: any;\n}\n\nexport interface ToolProperties extends BaseAIProperties {\n execution_time_ms?: number;\n input_data?: Record<string, any>;\n output_data?: Record<string, any>;\n tool_id?: string;\n tool_name?: string;\n [key: string]: any;\n}\n\nexport interface UserInteractionProperties extends BaseAIProperties {\n action?: string;\n content_length?: number;\n content_type?: string;\n interaction_type?: string;\n target_id?: string;\n content_id?: string;\n suggestion_type?: string;\n [key: string]: any;\n}\n\n// =============================================================================\n// STANDARD AI EVENT NAMES (100+ EVENTS)\n// =============================================================================\n\nexport const AI_EVENTS = {\n // ===== CONVERSATION & MESSAGING =====\n BRANCH_CREATED: 'AI Branch Created',\n BRANCH_MERGED: 'AI Branch Merged',\n CONVERSATION_CONTINUED: 'AI Conversation Continued',\n CONVERSATION_DELETED: 'AI Conversation Deleted',\n CONVERSATION_ENDED: 'AI Conversation Ended',\n CONVERSATION_RESUMED: 'AI Conversation Resumed',\n CONVERSATION_STARTED: 'AI Conversation Started',\n MESSAGE_DELETED: 'AI Message Deleted',\n MESSAGE_EDITED: 'AI Message Edited',\n MESSAGE_RECEIVED: 'AI Message Received',\n MESSAGE_REGENERATED: 'AI Message Regenerated',\n MESSAGE_SENT: 'AI Message Sent',\n STOP_GENERATION: 'AI Stop Generation',\n STREAMING_CHUNK_RECEIVED: 'AI Streaming Chunk Received',\n\n // ===== CONTENT GENERATION =====\n CODE_DEBUGGED: 'AI Code Debugged',\n CODE_EDITED: 'AI Code Edited',\n CODE_EXECUTED: 'AI Code Executed',\n CODE_EXPLAINED: 'AI Code Explained',\n CODE_GENERATED: 'AI Code Generated',\n CODE_REFACTORED: 'AI Code Refactored',\n CODE_TRANSLATED: 'AI Code Translated',\n COMPLETION_GENERATED: 'AI Completion Generated',\n CONTENT_COPIED: 'AI Content Copied',\n CONTENT_DOWNLOADED: 'AI Content Downloaded',\n CONTENT_REWRITTEN: 'AI Content Rewritten',\n CONTENT_SHARED: 'AI Content Shared',\n DIFF_VIEWED: 'AI Diff Viewed',\n DOCUMENT_CREATED: 'AI Document Created',\n EMAIL_DRAFTED: 'AI Email Drafted',\n IMAGE_EDITED: 'AI Image Edited',\n IMAGE_GENERATED: 'AI Image Generated',\n IMAGE_REVISED: 'AI Image Revised',\n INLINE_EDIT_APPLIED: 'AI Inline Edit Applied',\n OUTLINE_CREATED: 'AI Outline Created',\n REWRITE_GENERATED: 'AI Rewrite Generated',\n SUGGESTION_ACCEPTED: 'AI Suggestion Accepted',\n SUGGESTION_REJECTED: 'AI Suggestion Rejected',\n SUMMARY_GENERATED: 'AI Summary Generated',\n TEXT_GENERATED: 'AI Text Generated',\n TEXT_TRANSLATED: 'AI Text Translated',\n TRANSLATION_GENERATED: 'AI Translation Generated',\n\n // ===== FILES & ATTACHMENTS =====\n BATCH_FILES_PROCESSED: 'AI Batch Files Processed',\n FILE_ANALYZED: 'AI File Analyzed',\n FILE_DELETED: 'AI File Deleted',\n FILE_DOWNLOADED: 'AI File Downloaded',\n FILE_PROCESSED: 'AI File Processed',\n FILE_PROCESSING_FAILED: 'AI File Processing Failed',\n FILE_REFERENCED: 'AI File Referenced',\n FILE_UPLOADED: 'AI File Uploaded',\n IMAGE_ANALYZED: 'AI Image Analyzed',\n IMAGE_UPLOADED: 'AI Image Uploaded',\n\n // ===== SEARCH, BROWSE & CITATIONS =====\n BROWSE_SESSION_STARTED: 'AI Browse Session Started',\n CITATION_ADDED: 'AI Citation Added',\n CITATION_PROVIDED: 'AI Citation Provided',\n EXTERNAL_SOURCE_ACCESSED: 'AI External Source Accessed',\n PAGE_CONTENT_FETCHED: 'AI Page Content Fetched',\n SEARCH_RESULTS_RANKED: 'AI Search Results Ranked',\n WEB_BROWSED: 'AI Web Browsed',\n WEB_SEARCH_PERFORMED: 'AI Web Search Performed',\n WEB_SEARCHED: 'AI Web Searched',\n\n // ===== TOOLS & FUNCTIONS =====\n API_CALLED: 'AI API Called',\n API_REQUEST_MADE: 'AI API Request Made',\n EXTENSION_USED: 'AI Extension Used',\n FUNCTION_EXECUTED: 'AI Function Executed',\n PLUGIN_ACTIVATED: 'AI Plugin Activated',\n PLUGIN_DISABLED: 'AI Plugin Disabled',\n PLUGIN_ENABLED: 'AI Plugin Enabled',\n PLUGIN_USED: 'AI Plugin Used',\n TOOL_CALL_COMPLETED: 'AI Tool Call Completed',\n TOOL_CALL_FAILED: 'AI Tool Call Failed',\n TOOL_CALL_STARTED: 'AI Tool Call Started',\n TOOL_CALLED: 'AI Tool Called',\n TOOL_FAILED: 'AI Tool Failed',\n\n // ===== CONTEXT & MEMORY =====\n CONTEXT_CLEARED: 'AI Context Cleared',\n CONTEXT_PRUNED: 'AI Context Pruned',\n CONTEXT_UPDATED: 'AI Context Updated',\n CONTEXT_WINDOW_UPDATED: 'AI Context Window Updated',\n CUSTOM_INSTRUCTIONS_CLEARED: 'AI Custom Instructions Cleared',\n CUSTOM_INSTRUCTIONS_CREATED: 'AI Custom Instructions Created',\n CUSTOM_INSTRUCTIONS_UPDATED: 'AI Custom Instructions Updated',\n EMBEDDING_GENERATED: 'AI Embedding Generated',\n KNOWLEDGE_BASE_QUERIED: 'AI Knowledge Base Queried',\n MEMORY_CLEARED: 'AI Memory Cleared',\n MEMORY_CREATED: 'AI Memory Created',\n MEMORY_DELETED: 'AI Memory Deleted',\n MEMORY_RECALLED: 'AI Memory Recalled',\n MEMORY_RETRIEVED: 'AI Memory Retrieved',\n MEMORY_STORED: 'AI Memory Stored',\n MEMORY_UPDATED: 'AI Memory Updated',\n PROJECT_CONTEXT_LOADED: 'AI Project Context Loaded',\n RAG_QUERY_EXECUTED: 'AI RAG Query Executed',\n\n // ===== USER INTERACTIONS =====\n AUDIO_INPUT_USED: 'AI Audio Input Used',\n AUDIO_OUTPUT_USED: 'AI Audio Output Used',\n CODE_COPIED: 'AI Code Copied',\n CONVERSATION_EXPORTED: 'AI Conversation Exported',\n MESSAGE_COPIED: 'AI Message Copied',\n MODEL_SELECTED: 'AI Model Selected',\n PARAMETER_ADJUSTED: 'AI Parameter Adjusted',\n STREAM_COMPLETED: 'AI Stream Completed',\n STREAM_STARTED: 'AI Stream Started',\n STREAMING_COMPLETED: 'AI Streaming Completed',\n STREAMING_STARTED: 'AI Streaming Started',\n\n // ===== WORKSPACE & ORGANIZATION =====\n CONVERSATION_ARCHIVED: 'AI Conversation Archived',\n CONVERSATION_DUPLICATED: 'AI Conversation Duplicated',\n CONVERSATION_MOVED: 'AI Conversation Moved',\n CONVERSATION_PINNED: 'AI Conversation Pinned',\n CONVERSATION_RENAMED: 'AI Conversation Renamed',\n CONVERSATION_SAVED: 'AI Conversation Saved',\n CONVERSATION_SEARCHED: 'AI Conversation Searched',\n FILTER_APPLIED: 'AI Filter Applied',\n FOLDER_CREATED: 'AI Folder Created',\n FOLDER_DELETED: 'AI Folder Deleted',\n FOLDER_RENAMED: 'AI Folder Renamed',\n SEARCH_PERFORMED: 'AI Search Performed',\n TAG_ADDED: 'AI Tag Added',\n TEMPLATE_CREATED: 'AI Template Created',\n TEMPLATE_DELETED: 'AI Template Deleted',\n TEMPLATE_USED: 'AI Template Used',\n\n // ===== COLLABORATION & SHARING =====\n COMMENT_ADDED: 'AI Comment Added',\n CONVERSATION_FORKED: 'AI Conversation Forked',\n CONVERSATION_SHARED: 'AI Conversation Shared',\n MEMBER_INVITED: 'AI Member Invited',\n PERMISSION_CHANGED: 'AI Permission Changed',\n TEAM_MEMBER_INVITED: 'AI Team Member Invited',\n TEAM_MEMBER_REMOVED: 'AI Team Member Removed',\n WORKSPACE_CREATED: 'AI Workspace Created',\n\n // ===== ARTIFACTS & CANVAS =====\n ARTIFACT_CREATED: 'AI Artifact Created',\n ARTIFACT_EDITED: 'AI Artifact Edited',\n ARTIFACT_EXECUTED: 'AI Artifact Executed',\n ARTIFACT_FORKED: 'AI Artifact Forked',\n ARTIFACT_PUBLISHED: 'AI Artifact Published',\n CANVAS_CLOSED: 'AI Canvas Closed',\n CANVAS_EDITED: 'AI Canvas Edited',\n CANVAS_OPENED: 'AI Canvas Opened',\n CANVAS_SAVED: 'AI Canvas Saved',\n LIVE_PREVIEW_TOGGLED: 'AI Live Preview Toggled',\n\n // ===== FEEDBACK & QUALITY =====\n BUG_REPORTED: 'AI Bug Reported',\n FEATURE_REQUESTED: 'AI Feature Requested',\n FEEDBACK_NEGATIVE: 'AI Feedback Negative',\n FEEDBACK_POSITIVE: 'AI Feedback Positive',\n FEEDBACK_PROVIDED: 'AI Feedback Provided',\n HARMFUL_CONTENT_FLAGGED: 'AI Harmful Content Flagged',\n ISSUE_REPORTED: 'AI Issue Reported',\n QUALITY_ISSUE_REPORTED: 'AI Quality Issue Reported',\n RATING_PROVIDED: 'AI Rating Provided',\n RESPONSE_RATED: 'AI Response Rated',\n SAFETY_VIOLATION: 'AI Safety Violation',\n\n // ===== SYSTEM & PERFORMANCE =====\n COST_TRACKED: 'AI Cost Tracked',\n ERROR_OCCURRED: 'AI Error Occurred',\n LATENCY_MEASURED: 'AI Latency Measured',\n MODEL_SWITCHED: 'AI Model Switched',\n PERFORMANCE_MEASURED: 'AI Performance Measured',\n RATE_LIMIT_HIT: 'AI Rate Limit Hit',\n SETTINGS_UPDATED: 'AI Settings Updated',\n TOKEN_LIMIT_REACHED: 'AI Token Limit Reached',\n TOKEN_USAGE_TRACKED: 'AI Token Usage Tracked',\n} as const;\n\nexport type AIEventName = (typeof AI_EVENTS)[keyof typeof AI_EVENTS];\n\n/**\n * Valid AI event categories\n */\nexport type AIEventCategory =\n | 'ai'\n | 'conversation'\n | 'content'\n | 'artifacts'\n | 'tool'\n | 'feedback'\n | 'system'\n | 'workspace'\n | 'content-generation'\n | 'user-interactions'\n | 'files'\n | 'context'\n | 'collaboration';\n\nexport interface AIEventSpec<T = any> {\n category: AIEventCategory;\n name: AIEventName;\n properties: T;\n requiredProperties: (keyof T)[];\n}\n\nexport type AIEventProperties =\n | BaseAIProperties\n | ConversationProperties\n | MessageProperties\n | RegenerationProperties\n | MessageEditProperties\n | BranchProperties\n | TextGenerationProperties\n | CodeGenerationProperties\n | ImageGenerationProperties\n | SummaryProperties\n | TranslationProperties\n | FileUploadProperties\n | FileAnalysisProperties\n | ImageAnalysisProperties\n | WebSearchProperties\n | WebBrowseProperties\n | CitationProperties\n | ToolCallProperties\n | PluginProperties\n | APICallProperties\n | ContextProperties\n | MemoryProperties\n | CustomInstructionsProperties\n | ModelSelectionProperties\n | ParameterAdjustmentProperties\n | VoiceProperties\n | StreamingProperties\n | CopyExportProperties\n | ConversationManagementProperties\n | FolderProperties\n | SearchProperties\n | TemplateProperties\n | ShareProperties\n | WorkspaceProperties\n | TeamProperties\n | CommentProperties\n | ArtifactProperties\n | CanvasProperties\n | FeedbackProperties\n | IssueReportProperties\n | SafetyProperties\n | RateLimitProperties\n | ErrorProperties\n | LatencyProperties\n | CostTrackingProperties;\n\n// =============================================================================\n// AI SDK V6 EVENTS & TYPES\n// =============================================================================\n\n/**\n * AI SDK v6 event constants\n * For tracking AI SDK operations: agents, completions, tools, streaming, chat\n */\nexport const AI_SDK_EVENTS = {\n // Agent events\n AGENT_CREATED: 'ai_sdk_agent_created',\n AGENT_EXECUTION_STARTED: 'ai_sdk_agent_execution_started',\n AGENT_EXECUTION_COMPLETED: 'ai_sdk_agent_execution_completed',\n AGENT_EXECUTION_FAILED: 'ai_sdk_agent_execution_failed',\n\n // Completion events\n COMPLETION_REQUESTED: 'ai_sdk_completion_requested',\n COMPLETION_GENERATED: 'ai_sdk_completion_generated',\n COMPLETION_FAILED: 'ai_sdk_completion_failed',\n\n // Tool call events\n TOOL_CALL_STARTED: 'ai_sdk_tool_call_started',\n TOOL_CALL_COMPLETED: 'ai_sdk_tool_call_completed',\n TOOL_CALL_FAILED: 'ai_sdk_tool_call_failed',\n\n // Streaming events\n STREAM_STARTED: 'ai_sdk_stream_started',\n STREAM_CHUNK_RECEIVED: 'ai_sdk_stream_chunk_received',\n STREAM_COMPLETED: 'ai_sdk_stream_completed',\n STREAM_FAILED: 'ai_sdk_stream_failed',\n\n // Chat session events\n CHAT_SESSION_STARTED: 'ai_sdk_chat_session_started',\n CHAT_SESSION_ENDED: 'ai_sdk_chat_session_ended',\n CHAT_MESSAGE_SENT: 'ai_sdk_chat_message_sent',\n CHAT_MESSAGE_RECEIVED: 'ai_sdk_chat_message_received',\n\n // E-commerce chatbot events\n CHATBOT_INTENT_DETECTED: 'ai_sdk_chatbot_intent_detected',\n CHATBOT_CART_ASSISTED: 'ai_sdk_chatbot_cart_assisted',\n CHATBOT_ORDER_ASSISTED: 'ai_sdk_chatbot_order_assisted',\n CHATBOT_PRODUCT_RECOMMENDED: 'ai_sdk_chatbot_product_recommended',\n\n // Token usage tracking\n TOKEN_USAGE_TRACKED: 'ai_sdk_token_usage_tracked',\n\n // Multi-step reasoning\n MULTI_STEP_STARTED: 'ai_sdk_multi_step_started',\n MULTI_STEP_PROGRESSED: 'ai_sdk_multi_step_progressed',\n MULTI_STEP_COMPLETED: 'ai_sdk_multi_step_completed',\n} as const;\n\n/**\n * Base properties for AI SDK events\n */\nexport interface BaseAISDKProperties {\n model_id: string;\n model_provider?:\n | 'anthropic'\n | 'openai'\n | 'google'\n | 'cohere'\n | 'mistral'\n | 'other'\n | 'perplexity'\n | undefined;\n session_id?: string | undefined;\n user_id?: string | undefined;\n operation_id?: string | undefined;\n conversation_id?: string | undefined;\n message_id?: string | undefined;\n timestamp?: number | undefined;\n}\n\n/**\n * Agent execution properties\n */\nexport interface AgentProperties extends BaseAISDKProperties, TokenUsageProperties {\n agent_id?: string;\n agent_name?: string;\n agent_type?: string;\n agent_version?: string;\n system_prompt_length?: number;\n tools_available?: string[];\n tools_count?: number;\n execution_time_ms?: number;\n iterations?: number;\n completion_type?: string;\n status?: 'success' | 'failed' | 'pending';\n total_duration_ms?: number;\n step_count?: number;\n retry_count?: number;\n has_tools?: boolean;\n}\n\n/**\n * Completion properties\n */\nexport interface CompletionProperties\n extends BaseAISDKProperties, TokenUsageProperties, ModelConfigProperties {\n prompt_length?: number;\n completion_length?: number;\n finish_reason?: 'stop' | 'length' | 'content_filter' | 'tool_calls';\n generation_time_ms?: number;\n stream?: boolean;\n completion_type?: string;\n status?: 'success' | 'failed' | 'pending' | 'completed';\n total_duration_ms?: number;\n step_count?: number;\n retry_count?: number;\n has_tools?: boolean;\n agent_id?: string;\n conversation_id?: string;\n}\n\n/**\n * Tool call SDK properties (for AI SDK v6 events)\n */\nexport interface ToolCallSDKProperties extends BaseAISDKProperties {\n tool_name: string;\n tool_id?: string;\n tool_call_id?: string;\n tool_type?: string;\n input_schema?: Record<string, any>;\n input_size?: number;\n output_schema?: Record<string, any>;\n output_size?: number;\n execution_time_ms?: number;\n success?: boolean;\n result_status?: 'success' | 'error' | 'partial';\n}\n\n/**\n * Streaming SDK properties (for AI SDK v6 events)\n */\nexport interface StreamingSDKProperties extends BaseAISDKProperties {\n chunk_index?: number | undefined;\n chunks_total?: number | undefined;\n chunk_count?: number | undefined;\n bytes_streamed?: number | undefined;\n stream_duration_ms?: number | undefined;\n first_chunk_time_ms?: number | undefined;\n stream_type?: 'text' | 'audio' | 'video' | 'image' | undefined;\n time_to_first_chunk_ms?: number | undefined;\n chunks_per_second?: number | undefined;\n was_stopped?: boolean | undefined;\n}\n\n/**\n * Chat session properties\n */\nexport interface SessionProperties extends BaseAISDKProperties, TokenUsageProperties {\n session_id: string;\n session_type?: 'chat' | 'completion' | 'streaming';\n duration_ms?: number;\n message_count?: number;\n tool_calls_count?: number;\n session_end_reason?: 'user-ended' | 'timeout' | 'error' | 'completed';\n}\n\n/**\n * Chat message properties\n */\nexport interface ChatMessageProperties extends BaseAISDKProperties, TokenUsageProperties {\n chat_id?: string;\n conversation_id?: string;\n message_id?: string;\n message_role: 'user' | 'assistant' | 'system' | 'tool';\n message_length?: number;\n has_attachments?: boolean;\n response_time_ms?: number;\n message_index?: number;\n has_images?: boolean;\n parent_message_id?: string;\n finish_reason?: string;\n is_streaming?: boolean;\n}\n\n/**\n * E-commerce chatbot properties\n */\nexport interface ChatbotEcommerceProperties extends BaseAISDKProperties {\n conversation_id?: string;\n intent?: string;\n confidence?: number;\n product_ids?: string[];\n product_count?: number;\n cart_value?: number;\n order_id?: string;\n recommendation_type?: string;\n intent_detected?: string;\n cart_id?: string;\n}\n\n// Re-export AISdkEventSpec from track-ai-sdk for convenience\nexport type { AISdkEventSpec } from './track-ai-sdk';\n","/**\n * @fileoverview Utility functions for AI event tracking\n * Utility functions for AI event tracking\n */\n\nimport type { BaseAIProperties, ModelConfigProperties, TokenUsageProperties } from './types';\n\n/**\n * Remove undefined and null values from an object\n */\nexport function cleanProperties<T extends Record<string, any>>(props: T): Partial<T> {\n const cleaned: Partial<T> = {};\n\n for (const key in props) {\n if (!Object.prototype.hasOwnProperty.call(props, key)) continue;\n const value = props[key];\n if (value !== undefined && value !== null) {\n cleaned[key] = value;\n }\n }\n\n return cleaned;\n}\n\n/**\n * Validate that required properties are present\n */\nexport function validateRequiredProperties<T extends Record<string, any>>(\n properties: T,\n required: (keyof T)[],\n): void {\n const missing: string[] = [];\n\n for (const key of required) {\n if (properties[key] === undefined || properties[key] === null) {\n missing.push(String(key));\n }\n }\n\n if (missing.length > 0) {\n throw new Error(`Missing required properties: ${missing.join(', ')}`);\n }\n}\n\n/**\n * Normalize base AI operation properties\n */\nexport function normalizeBaseProperties(props: BaseAIProperties): BaseAIProperties {\n return {\n model_id: props.model_id,\n agent_id: props.agent_id,\n agent_name: props.agent_name,\n conversation_id: props.conversation_id,\n session_id: props.session_id,\n user_id: props.user_id,\n operation_id: props.operation_id,\n model_provider: props.model_provider,\n };\n}\n\n/**\n * Normalize token usage properties\n */\nexport function normalizeTokenUsage(props: TokenUsageProperties): TokenUsageProperties {\n const normalized: TokenUsageProperties = {};\n\n if (props.input_tokens !== undefined) {\n normalized.input_tokens = Math.max(0, props.input_tokens);\n }\n\n if (props.output_tokens !== undefined) {\n normalized.output_tokens = Math.max(0, props.output_tokens);\n }\n\n if (props.total_tokens !== undefined) {\n normalized.total_tokens = Math.max(0, props.total_tokens);\n } else if (normalized.input_tokens !== undefined && normalized.output_tokens !== undefined) {\n // Calculate total from already-normalized values (clamped to 0)\n normalized.total_tokens = normalized.input_tokens + normalized.output_tokens;\n }\n\n if (props.cost !== undefined) {\n normalized.cost = Math.max(0, props.cost);\n normalized.cost_currency = props.cost_currency ?? 'USD';\n }\n\n return normalized;\n}\n\n/**\n * Normalize model configuration properties\n */\nexport function normalizeModelConfig(props: ModelConfigProperties): ModelConfigProperties {\n const normalized: ModelConfigProperties = {};\n\n if (props.temperature !== undefined) {\n normalized.temperature = Math.max(0, Math.min(2, props.temperature));\n }\n\n if (props.max_tokens !== undefined) {\n normalized.max_tokens = Math.max(1, props.max_tokens);\n }\n\n if (props.max_output_tokens !== undefined) {\n normalized.max_output_tokens = Math.max(1, props.max_output_tokens);\n }\n\n if (props.top_p !== undefined) {\n normalized.top_p = Math.max(0, Math.min(1, props.top_p));\n }\n\n if (props.frequency_penalty !== undefined) {\n normalized.frequency_penalty = Math.max(-2, Math.min(2, props.frequency_penalty));\n }\n\n if (props.presence_penalty !== undefined) {\n normalized.presence_penalty = Math.max(-2, Math.min(2, props.presence_penalty));\n }\n\n if (props.seed !== undefined) {\n normalized.seed = props.seed;\n }\n\n if (props.stop_sequences !== undefined) {\n normalized.stop_sequences = props.stop_sequences;\n }\n\n return normalized;\n}\n\n/**\n * Calculate cost based on token usage and model pricing\n */\nexport function calculateCost(\n usage: TokenUsageProperties,\n pricing: {\n input_price_per_1k?: number;\n output_price_per_1k?: number;\n },\n): number {\n let cost = 0;\n\n if (usage.input_tokens && pricing.input_price_per_1k) {\n cost += (usage.input_tokens / 1000) * pricing.input_price_per_1k;\n }\n\n if (usage.output_tokens && pricing.output_price_per_1k) {\n cost += (usage.output_tokens / 1000) * pricing.output_price_per_1k;\n }\n\n return cost;\n}\n\n/**\n * Extract model provider from model ID\n */\nexport function extractModelProvider(\n modelId: string,\n): 'anthropic' | 'openai' | 'google' | 'perplexity' | 'other' {\n const lowercaseId = modelId.toLowerCase();\n\n if (lowercaseId.includes('claude') || lowercaseId.includes('anthropic')) {\n return 'anthropic';\n }\n\n if (lowercaseId.includes('gpt') || lowercaseId.includes('openai')) {\n return 'openai';\n }\n\n if (lowercaseId.includes('gemini') || lowercaseId.includes('google')) {\n return 'google';\n }\n\n if (lowercaseId.includes('pplx') || lowercaseId.includes('perplexity')) {\n return 'perplexity';\n }\n\n return 'other';\n}\n\n/**\n * Generate a unique operation ID\n */\nexport function generateOperationId(prefix = 'ai'): string {\n const timestamp = Date.now();\n const random = Math.random().toString(36).slice(2, 9);\n return `${prefix}_${timestamp}_${random}`;\n}\n\n/**\n * Sanitize error message for tracking\n */\nexport function sanitizeErrorMessage(error: Error | string): string {\n const message = typeof error === 'string' ? error : error.message;\n\n // Remove potentially sensitive information\n // Matches: \"API key sk-xxx\", \"api_key: xxx\", \"api-keys=xxx\", etc.\n return message\n .replaceAll(/api[\\s_\\-]?keys?[\\s:=]+[\\w-]+/gi, 'api_key=***')\n .replaceAll(/tokens?[\\s:=]+[\\w-]+/gi, 'token=***')\n .replaceAll(/passwords?[\\s:=]+[\\w-]+/gi, 'password=***')\n .replaceAll(/secrets?[\\s:=]+[\\w-]+/gi, 'secret=***')\n .slice(0, 500); // Limit length\n}\n\n/**\n * Calculate metrics for completion events\n */\nexport function calculateCompletionMetrics(\n startTime: number,\n endTime: number,\n tokenUsage?: TokenUsageProperties,\n): {\n duration_ms: number;\n tokens_per_second?: number;\n} {\n const duration_ms = endTime - startTime;\n const metrics: { duration_ms: number; tokens_per_second?: number } = {\n duration_ms,\n };\n\n if (tokenUsage?.total_tokens && duration_ms > 0) {\n metrics.tokens_per_second = (tokenUsage.total_tokens / duration_ms) * 1000;\n }\n\n return metrics;\n}\n\n/**\n * Detect intent from chat message\n */\nexport function detectIntent(\n message: string,\n):\n | 'product-search'\n | 'product-inquiry'\n | 'product-comparison'\n | 'cart-management'\n | 'checkout-help'\n | 'order-tracking'\n | 'returns-exchanges'\n | 'support-question'\n | 'general-inquiry'\n | 'complaint'\n | 'feedback' {\n const lowercase = message.toLowerCase();\n\n // Order matters: more specific patterns (like order-tracking, complaint) should come\n // before patterns with broad keywords (like product-comparison with 'or')\n const intentPatterns = {\n // Put order-tracking early since \"order\" contains \"or\" which could match comparison\n 'order-tracking': [\n 'track',\n 'order status',\n 'shipping',\n 'delivery',\n 'where is my',\n 'when will',\n 'my order',\n ],\n // Put complaint before comparison since \"disappointed\" could match patterns in other intents\n complaint: ['disappointed', 'angry', 'frustrated', 'terrible', 'worst', 'complain', 'unhappy'],\n 'returns-exchanges': ['return', 'refund', 'exchange', 'cancel order', 'send back'],\n 'product-search': [\n 'looking for',\n 'search for',\n 'find',\n 'show me',\n 'need',\n 'want to buy',\n 'shopping for',\n ],\n 'product-inquiry': [\n 'tell me about',\n 'details',\n 'specs',\n 'features',\n 'price',\n 'available',\n 'in stock',\n ],\n 'product-comparison': [\n 'compare',\n 'difference between',\n 'which is better',\n 'vs',\n ' or ', // Use space-bounded 'or' to avoid matching 'order', 'for', etc.\n 'better than',\n ],\n 'cart-management': ['add to cart', 'remove from cart', 'cart', 'shopping bag', 'my items'],\n 'checkout-help': ['checkout', 'payment', 'pay', 'purchase', 'buy now', 'complete order'],\n feedback: ['review', 'feedback', 'rate', 'experience', 'satisfied'],\n };\n\n for (const [intent, patterns] of Object.entries(intentPatterns)) {\n if (patterns.some(pattern => lowercase.includes(pattern))) {\n return intent as any;\n }\n }\n\n return 'general-inquiry';\n}\n\n/**\n * Detect sentiment from message\n */\nexport function detectSentiment(message: string): 'positive' | 'negative' | 'neutral' | 'mixed' {\n const lowercase = message.toLowerCase();\n\n const positiveWords = [\n 'great',\n 'love',\n 'excellent',\n 'perfect',\n 'amazing',\n 'wonderful',\n 'awesome',\n 'fantastic',\n 'helpful',\n 'thank',\n ];\n const negativeWords = [\n 'bad',\n 'terrible',\n 'awful',\n 'disappointed',\n 'angry',\n 'frustrated',\n 'annoyed',\n 'useless',\n 'worst',\n 'hate',\n ];\n\n const positiveCount = positiveWords.filter(word => lowercase.includes(word)).length;\n const negativeCount = negativeWords.filter(word => lowercase.includes(word)).length;\n\n if (positiveCount > 0 && negativeCount > 0) {\n return 'mixed';\n }\n\n if (positiveCount > negativeCount) {\n return 'positive';\n }\n\n if (negativeCount > positiveCount) {\n return 'negative';\n }\n\n return 'neutral';\n}\n\n/**\n * Truncate array to max length for tracking\n */\nexport function truncateArray<T>(arr: T[], maxLength = 10): T[] {\n return arr.slice(0, maxLength);\n}\n\n/**\n * Safe JSON stringify for complex objects\n */\nexport function safeStringify(obj?: unknown, maxLength = 1000): string {\n try {\n if (obj === undefined) return '{}';\n const str = JSON.stringify(obj);\n return str.length > maxLength ? `${str.slice(0, Math.max(0, maxLength))}...` : str;\n } catch {\n return '[Unable to stringify]';\n }\n}\n\n/**\n * Calculate conversation quality score\n */\nexport function calculateQualityScore(metrics: {\n message_count: number;\n avg_response_time_ms?: number;\n misunderstanding_count?: number;\n clarification_count?: number;\n satisfaction_score?: number;\n}): number {\n let score = 100;\n\n // Penalize for too few messages (abandoned)\n if (metrics.message_count < 3) {\n score -= 20;\n }\n\n // Penalize for slow responses\n if (metrics.avg_response_time_ms && metrics.avg_response_time_ms > 3000) {\n score -= 10;\n }\n\n // Penalize for misunderstandings\n if (metrics.misunderstanding_count) {\n score -= metrics.misunderstanding_count * 5;\n }\n\n // Penalize for excessive clarifications\n if (metrics.clarification_count && metrics.clarification_count > 2) {\n score -= (metrics.clarification_count - 2) * 3;\n }\n\n // Boost for high satisfaction\n if (metrics.satisfaction_score && metrics.satisfaction_score >= 4) {\n score += 10;\n }\n\n return Math.max(0, Math.min(100, score));\n}\n\n/**\n * Detect if message needs clarification\n */\nexport function needsClarification(message: string): boolean {\n const lowercase = message.toLowerCase();\n\n const ambiguousPatterns = [\n 'it',\n 'that one',\n 'this',\n 'them',\n 'those',\n 'something like',\n 'kind of',\n 'sort of',\n 'maybe',\n 'not sure',\n ];\n\n return ambiguousPatterns.some(pattern => lowercase.includes(pattern));\n}\n\n/**\n * Extract product mentions from message\n */\nexport function extractProductMentions(message: string): string[] {\n const mentions: string[] = [];\n\n // Common product categories\n const categories = [\n 'laptop',\n 'phone',\n 'tablet',\n 'watch',\n 'headphones',\n 'shoes',\n 'shirt',\n 'pants',\n 'dress',\n 'jacket',\n ];\n\n const lowercase = message.toLowerCase();\n for (const category of categories) {\n if (lowercase.includes(category)) {\n mentions.push(category);\n }\n }\n\n return mentions;\n}\n\n/**\n * Alias for detectIntent for chatbot-specific contexts\n */\nexport const detectChatbotIntent = detectIntent;\n","/**\n * @fileoverview AI tracking wrapper that integrates with the core emitter system\n * AI tracking wrapper that integrates with the core emitter system\n */\n\nimport { track } from '../emitters';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../emitter-types';\nimport type { AIEventSpec } from './types';\n\n/**\n * Convert an AI event specification to a track payload\n *\n * @param eventSpec - The AI event specification\n * @param options - Optional emitter options\n * @returns Track payload ready to be sent to analytics providers\n */\nexport function trackAI(eventSpec: AIEventSpec, options?: EmitterOptions): EmitterTrackPayload {\n // Add AI-specific context to options\n const enrichedOptions: EmitterOptions = {\n ...options,\n context: {\n ...options?.context,\n // Add AI-specific context\n ...(eventSpec.category && {\n // Store category as a custom field since EmitterContext doesn't have category\n traits: {\n ...options?.context?.traits,\n event_category: eventSpec.category,\n },\n }),\n },\n };\n\n // Return the track payload with the event name and properties\n return track(eventSpec.name, eventSpec.properties, enrichedOptions);\n}\n\n/**\n * Helper to create a tracking function for a specific AI event\n * This allows for cleaner usage in applications\n */\nexport function createAITracker<T extends Record<string, any>>(\n eventFactory: (properties: T) => AIEventSpec,\n) {\n return (properties: T, options?: EmitterOptions): EmitterTrackPayload => {\n const eventSpec = eventFactory(properties);\n return trackAI(eventSpec, options);\n };\n}\n","/**\n * @fileoverview AI SDK v6 tracking wrapper that integrates with the core emitter system\n * AI SDK v6 tracking wrapper that integrates with the core emitter system\n *\n * Provides tracking for AI SDK v6 operations including:\n * - Agent execution\n * - Completions and text generation\n * - Tool calls and function calling\n * - Streaming responses\n * - Chat sessions\n * - E-commerce chatbot interactions\n */\n\nimport { track } from '../emitters';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../emitter-types';\n\n/**\n * AI SDK event specification\n */\nexport interface AISdkEventSpec {\n /** Event name following AI SDK v6 naming conventions */\n name: string;\n /** Event category (always 'ai-sdk' for AI SDK events) */\n category: 'ai-sdk';\n /** Event properties */\n properties: Record<string, any>;\n /** Required property names for validation */\n requiredProperties?: string[];\n}\n\n/**\n * Convert an AI SDK event specification to a track payload\n *\n * @param eventSpec - The AI SDK event specification\n * @param options - Optional emitter options\n * @returns Track payload ready to be sent to analytics providers\n */\nexport function trackAISDK(\n eventSpec: AISdkEventSpec,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n // Add AI SDK-specific context to options\n const enrichedOptions: EmitterOptions = {\n ...options,\n context: {\n ...options?.context,\n // Add AI SDK-specific context\n traits: {\n ...options?.context?.traits,\n event_category: eventSpec.category,\n },\n },\n };\n\n // Return the track payload with the event name and properties\n return track(eventSpec.name, eventSpec.properties, enrichedOptions);\n}\n\n/**\n * Helper to create a tracking function for a specific AI SDK event\n * This allows for cleaner usage in applications\n *\n * @param eventFactory - Function that creates an event spec from properties\n * @returns Tracking function for the specific event\n */\nexport function createAISDKTracker<T extends Record<string, any>>(\n eventFactory: (properties: T) => AISdkEventSpec,\n) {\n return (properties: T, options?: EmitterOptions): EmitterTrackPayload => {\n const eventSpec = eventFactory(properties);\n return trackAISDK(eventSpec, options);\n };\n}\n","/**\n * @fileoverview Conversation & Messaging Events\n * Conversation & Messaging Events\n *\n * Core conversation lifecycle and message management for ChatGPT-style products.\n * Includes conversation start/end, messaging, regeneration, branching, and streaming.\n */\n\nimport { createAITracker } from '../track-ai';\nimport {\n AI_EVENTS,\n type BranchProperties,\n type ConversationProperties,\n type MessageProperties,\n type RegenerationProperties,\n type StopGenerationProperties,\n type StreamingSDKProperties,\n} from '../types';\n\n/**\n * Track conversation start\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_STARTED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * conversation_type: 'chat',\n * });\n * ```\n */\nexport const CONVERSATION_STARTED = createAITracker<ConversationProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_STARTED,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track conversation resume\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_RESUMED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * last_active_timestamp: '2024-01-15T10:30:00Z',\n * message_count: 15,\n * });\n * ```\n */\nexport const CONVERSATION_RESUMED = createAITracker<ConversationProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_RESUMED,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track conversation end\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_ENDED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * end_reason: 'user-ended',\n * duration_ms: 180000,\n * message_count: 25,\n * });\n * ```\n */\nexport const CONVERSATION_ENDED = createAITracker<ConversationProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_ENDED,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track user message sent\n *\n * @example\n * ```typescript\n * ai.MESSAGE_SENT({\n * conversation_id: 'conv_123',\n * message_id: 'msg_456',\n * model_id: 'gpt-4',\n * message_role: 'user',\n * message_length: 50,\n * });\n * ```\n */\nexport const MESSAGE_SENT = createAITracker<MessageProperties>(properties => ({\n name: AI_EVENTS.MESSAGE_SENT,\n category: 'conversation',\n properties,\n requiredProperties: ['message_role'],\n}));\n\n/**\n * Track AI message received\n *\n * @example\n * ```typescript\n * ai.MESSAGE_RECEIVED({\n * conversation_id: 'conv_123',\n * message_id: 'msg_457',\n * model_id: 'claude-3-5-sonnet',\n * message_role: 'assistant',\n * message_length: 250,\n * response_time_ms: 850,\n * finish_reason: 'stop',\n * input_tokens: 450,\n * output_tokens: 320,\n * });\n * ```\n */\nexport const MESSAGE_RECEIVED = createAITracker<MessageProperties>(properties => ({\n name: AI_EVENTS.MESSAGE_RECEIVED,\n category: 'conversation',\n properties,\n requiredProperties: ['message_role'],\n}));\n\n/**\n * Track message regeneration\n *\n * @example\n * ```typescript\n * ai.MESSAGE_REGENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * original_message_id: 'msg_457',\n * attempt_number: 2,\n * reason: 'user-requested',\n * temperature_adjusted: true,\n * });\n * ```\n */\nexport const MESSAGE_REGENERATED = createAITracker<RegenerationProperties>(properties => ({\n name: AI_EVENTS.MESSAGE_REGENERATED,\n category: 'conversation',\n properties,\n requiredProperties: ['original_message_id'],\n}));\n\n/**\n * Track message edit\n *\n * @example\n * ```typescript\n * ai.MESSAGE_EDITED({\n * conversation_id: 'conv_123',\n * message_id: 'msg_456',\n * model_id: 'claude-3-5-sonnet',\n * edit_type: 'user-edit',\n * original_length: 50,\n * new_length: 75,\n * });\n * ```\n */\nexport const MESSAGE_EDITED = createAITracker<MessageProperties>(properties => ({\n name: AI_EVENTS.MESSAGE_EDITED,\n category: 'conversation',\n properties,\n requiredProperties: ['message_role'],\n}));\n\n/**\n * Track message deletion\n *\n * @example\n * ```typescript\n * ai.MESSAGE_DELETED({\n * conversation_id: 'conv_123',\n * message_id: 'msg_458',\n * model_id: 'gpt-4',\n * message_role: 'assistant',\n * deleted_by: 'user',\n * });\n * ```\n */\nexport const MESSAGE_DELETED = createAITracker<MessageProperties>(properties => ({\n name: AI_EVENTS.MESSAGE_DELETED,\n category: 'conversation',\n properties,\n requiredProperties: ['message_role'],\n}));\n\n/**\n * Track conversation branch creation\n *\n * @example\n * ```typescript\n * ai.BRANCH_CREATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * branch_point_message_id: 'msg_457',\n * original_conversation_id: 'conv_123',\n * new_conversation_id: 'conv_124',\n * reason: 'explore-alternative',\n * });\n * ```\n */\nexport const BRANCH_CREATED = createAITracker<BranchProperties>(properties => ({\n name: AI_EVENTS.BRANCH_CREATED,\n category: 'conversation',\n properties,\n requiredProperties: [\n 'branch_point_message_id',\n 'new_conversation_id',\n 'original_conversation_id',\n ],\n}));\n\n/**\n * Track conversation branch merge\n *\n * @example\n * ```typescript\n * ai.BRANCH_MERGED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * branch_point_message_id: 'msg_457',\n * original_conversation_id: 'conv_123',\n * new_conversation_id: 'conv_124',\n * merge_strategy: 'keep-both',\n * });\n * ```\n */\nexport const BRANCH_MERGED = createAITracker<BranchProperties>(properties => ({\n name: AI_EVENTS.BRANCH_MERGED,\n category: 'conversation',\n properties,\n requiredProperties: [\n 'branch_point_message_id',\n 'new_conversation_id',\n 'original_conversation_id',\n ],\n}));\n\n/**\n * Track stop generation (user interrupts response)\n *\n * @example\n * ```typescript\n * ai.STOP_GENERATION({\n * conversation_id: 'conv_123',\n * message_id: 'msg_458',\n * model_id: 'gpt-4',\n * partial_length: 120,\n * stop_reason: 'user-interrupted',\n * tokens_used_at_stop: 150,\n * });\n * ```\n */\nexport const STOP_GENERATION = createAITracker<StopGenerationProperties>(properties => ({\n name: AI_EVENTS.STOP_GENERATION,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track streaming start\n *\n * @example\n * ```typescript\n * ai.STREAMING_STARTED({\n * conversation_id: 'conv_123',\n * message_id: 'msg_459',\n * model_id: 'claude-3-5-sonnet',\n * stream_type: 'text',\n * });\n * ```\n */\nexport const STREAMING_STARTED = createAITracker<StreamingSDKProperties>(properties => ({\n name: AI_EVENTS.STREAMING_STARTED,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track streaming chunk received (sample, not every chunk)\n *\n * @example\n * ```typescript\n * // Sample every 10th chunk\n * if (chunkCount % 10 === 0) {\n * ai.STREAMING_CHUNK_RECEIVED({\n * conversation_id: 'conv_123',\n * message_id: 'msg_459',\n * model_id: 'gpt-4',\n * stream_type: 'text',\n * chunk_index: chunkCount,\n * chunk_size_bytes: 256,\n * });\n * }\n * ```\n */\nexport const STREAMING_CHUNK_RECEIVED = createAITracker<StreamingSDKProperties>(properties => ({\n name: AI_EVENTS.STREAMING_CHUNK_RECEIVED,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track streaming completion\n *\n * @example\n * ```typescript\n * ai.STREAMING_COMPLETED({\n * conversation_id: 'conv_123',\n * message_id: 'msg_459',\n * model_id: 'claude-3-5-sonnet',\n * stream_type: 'text',\n * chunk_count: 45,\n * total_bytes: 11520,\n * stream_duration_ms: 3200,\n * chunks_per_second: 14.06,\n * });\n * ```\n */\nexport const STREAMING_COMPLETED = createAITracker<StreamingSDKProperties>(properties => ({\n name: AI_EVENTS.STREAMING_COMPLETED,\n category: 'conversation',\n properties,\n requiredProperties: [],\n}));\n","/**\n * @fileoverview Content Generation Events\n * Content Generation Events\n *\n * All types of AI-generated content: code, images, summaries, translations, etc.\n * These track what the AI creates, not what users do with it.\n */\n\nimport { createAITracker } from '../track-ai';\nimport {\n AI_EVENTS,\n type CodeGenerationProperties,\n type ContentGenerationProperties,\n type ImageGenerationProperties,\n type SummaryProperties,\n} from '../types';\n\n/**\n * Track code generation\n *\n * @example\n * ```typescript\n * ai.CODE_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * language: 'typescript',\n * code_length: 450,\n * code_type: 'function',\n * has_explanation: true,\n * has_tests: false,\n * });\n * ```\n */\nexport const CODE_GENERATED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track code explanation\n *\n * @example\n * ```typescript\n * ai.CODE_EXPLAINED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * language: 'python',\n * code_length: 200,\n * explanation_length: 500,\n * explanation_type: 'detailed',\n * });\n * ```\n */\nexport const CODE_EXPLAINED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_EXPLAINED,\n category: 'content-generation',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track code debugging assistance\n *\n * @example\n * ```typescript\n * ai.CODE_DEBUGGED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * language: 'javascript',\n * code_length: 300,\n * issues_found: 3,\n * fixes_suggested: 3,\n * });\n * ```\n */\nexport const CODE_DEBUGGED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_DEBUGGED,\n category: 'content-generation',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track code refactoring suggestions\n *\n * @example\n * ```typescript\n * ai.CODE_REFACTORED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * language: 'typescript',\n * code_length: 500,\n * refactor_type: 'extract-function',\n * improvements_suggested: 5,\n * });\n * ```\n */\nexport const CODE_REFACTORED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_REFACTORED,\n category: 'content-generation',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track code translation between languages\n *\n * @example\n * ```typescript\n * ai.CODE_TRANSLATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * language: 'typescript',\n * code_length: 350,\n * source_language: 'python',\n * target_language: 'typescript',\n * });\n * ```\n */\nexport const CODE_TRANSLATED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_TRANSLATED,\n category: 'content-generation',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track image generation\n *\n * @example\n * ```typescript\n * ai.IMAGE_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'dall-e-3',\n * image_type: 'generated',\n * prompt_length: 80,\n * image_format: 'png',\n * image_size: '1024x1024',\n * generation_time_ms: 5000,\n * });\n * ```\n */\nexport const IMAGE_GENERATED = createAITracker<ImageGenerationProperties>(properties => ({\n name: AI_EVENTS.IMAGE_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track image editing\n *\n * @example\n * ```typescript\n * ai.IMAGE_EDITED({\n * conversation_id: 'conv_123',\n * model_id: 'dall-e-3',\n * image_type: 'edited',\n * edit_type: 'inpaint',\n * prompt_length: 50,\n * image_format: 'png',\n * });\n * ```\n */\nexport const IMAGE_EDITED = createAITracker<ImageGenerationProperties>(properties => ({\n name: AI_EVENTS.IMAGE_EDITED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track general text generation\n *\n * @example\n * ```typescript\n * ai.TEXT_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_type: 'article',\n * content_length: 1500,\n * content_format: 'markdown',\n * });\n * ```\n */\nexport const TEXT_GENERATED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.TEXT_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track summary generation\n *\n * @example\n * ```typescript\n * ai.SUMMARY_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * source_type: 'document',\n * source_length: 5000,\n * summary_length: 300,\n * summary_type: 'bullet-points',\n * compression_ratio: 16.7,\n * });\n * ```\n */\nexport const SUMMARY_GENERATED = createAITracker<SummaryProperties>(properties => ({\n name: AI_EVENTS.SUMMARY_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: ['input_length', 'output_length', 'summary_type'],\n}));\n\n/**\n * Track text translation\n *\n * @example\n * ```typescript\n * ai.TRANSLATION_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_type: 'translation',\n * content_length: 450,\n * source_language: 'english',\n * target_language: 'spanish',\n * });\n * ```\n */\nexport const TRANSLATION_GENERATED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.TRANSLATION_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track text completion\n *\n * @example\n * ```typescript\n * ai.COMPLETION_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * content_type: 'completion',\n * content_length: 200,\n * completion_type: 'sentence',\n * });\n * ```\n */\nexport const COMPLETION_GENERATED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.COMPLETION_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track content rewrite\n *\n * @example\n * ```typescript\n * ai.REWRITE_GENERATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_type: 'rewrite',\n * content_length: 350,\n * original_length: 300,\n * rewrite_style: 'formal',\n * });\n * ```\n */\nexport const REWRITE_GENERATED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.REWRITE_GENERATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track email draft assistance\n *\n * @example\n * ```typescript\n * ai.EMAIL_DRAFTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * content_type: 'email',\n * content_length: 400,\n * email_type: 'professional',\n * has_subject: true,\n * });\n * ```\n */\nexport const EMAIL_DRAFTED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.EMAIL_DRAFTED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track document creation\n *\n * @example\n * ```typescript\n * ai.DOCUMENT_CREATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_type: 'document',\n * content_length: 2500,\n * content_format: 'markdown',\n * document_type: 'report',\n * });\n * ```\n */\nexport const DOCUMENT_CREATED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.DOCUMENT_CREATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track outline creation\n *\n * @example\n * ```typescript\n * ai.OUTLINE_CREATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * content_type: 'outline',\n * content_length: 600,\n * section_count: 8,\n * outline_depth: 3,\n * });\n * ```\n */\nexport const OUTLINE_CREATED = createAITracker<ContentGenerationProperties>(properties => ({\n name: AI_EVENTS.OUTLINE_CREATED,\n category: 'content-generation',\n properties,\n requiredProperties: [],\n}));\n","/**\n * @fileoverview Artifacts & Canvas Events\n * Artifacts & Canvas Events\n *\n * Interactive artifacts and canvas mode features (Claude-style).\n * Track creation, editing, execution, and interaction with artifacts.\n */\n\nimport { createAITracker } from '../track-ai';\nimport { AI_EVENTS, type ArtifactProperties, type CanvasProperties } from '../types';\n\n/**\n * Track artifact creation\n *\n * @example\n * ```typescript\n * ai.ARTIFACT_CREATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * artifact_id: 'art_001',\n * artifact_type: 'react-component',\n * action: 'create',\n * language: 'tsx',\n * content_length: 850,\n * });\n * ```\n */\nexport const ARTIFACT_CREATED = createAITracker<ArtifactProperties>(properties => ({\n name: AI_EVENTS.ARTIFACT_CREATED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action', 'artifact_type'],\n}));\n\n/**\n * Track artifact editing\n *\n * @example\n * ```typescript\n * ai.ARTIFACT_EDITED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * artifact_id: 'art_001',\n * artifact_type: 'react-component',\n * action: 'edit',\n * version: 2,\n * changes_description: 'Updated button styling',\n * });\n * ```\n */\nexport const ARTIFACT_EDITED = createAITracker<ArtifactProperties>(properties => ({\n name: AI_EVENTS.ARTIFACT_EDITED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action', 'artifact_type'],\n}));\n\n/**\n * Track artifact execution\n *\n * @example\n * ```typescript\n * ai.ARTIFACT_EXECUTED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * artifact_id: 'art_001',\n * artifact_type: 'code',\n * action: 'execute',\n * execution_status: 'success',\n * execution_time_ms: 150,\n * });\n * ```\n */\nexport const ARTIFACT_EXECUTED = createAITracker<ArtifactProperties>(properties => ({\n name: AI_EVENTS.ARTIFACT_EXECUTED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action', 'artifact_type'],\n}));\n\n/**\n * Track artifact publishing\n *\n * @example\n * ```typescript\n * ai.ARTIFACT_PUBLISHED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * artifact_id: 'art_001',\n * artifact_type: 'visualization',\n * action: 'publish',\n * visibility: 'public',\n * publish_platform: 'web',\n * });\n * ```\n */\nexport const ARTIFACT_PUBLISHED = createAITracker<ArtifactProperties>(properties => ({\n name: AI_EVENTS.ARTIFACT_PUBLISHED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action', 'artifact_type'],\n}));\n\n/**\n * Track artifact forking\n *\n * @example\n * ```typescript\n * ai.ARTIFACT_FORKED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * artifact_id: 'art_001',\n * artifact_type: 'react-component',\n * action: 'fork',\n * new_artifact_id: 'art_002',\n * fork_reason: 'experiment',\n * });\n * ```\n */\nexport const ARTIFACT_FORKED = createAITracker<ArtifactProperties>(properties => ({\n name: AI_EVENTS.ARTIFACT_FORKED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action', 'artifact_type'],\n}));\n\n/**\n * Track canvas mode opened\n *\n * @example\n * ```typescript\n * ai.CANVAS_OPENED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * canvas_type: 'code',\n * initial_content_length: 500,\n * canvas_size: 'full-screen',\n * });\n * ```\n */\nexport const CANVAS_OPENED = createAITracker<CanvasProperties>(properties => ({\n name: AI_EVENTS.CANVAS_OPENED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track live preview toggle\n *\n * @example\n * ```typescript\n * ai.LIVE_PREVIEW_TOGGLED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-net',\n * artifact_id: 'art_001',\n * preview_enabled: true,\n * preview_type: 'browser',\n * });\n * ```\n */\nexport const LIVE_PREVIEW_TOGGLED = createAITracker<CanvasProperties>(properties => ({\n name: AI_EVENTS.LIVE_PREVIEW_TOGGLED,\n category: 'artifacts',\n properties,\n requiredProperties: ['action'],\n}));\n","/**\n * @fileoverview Additional AI Product Features\n * Additional AI Product Features\n *\n * Comprehensive tracking for all remaining AI product features:\n * - User interactions (copy, execute, download)\n * - Files & attachments\n * - Context & memory management\n * - Collaboration & sharing\n * - Workspace & organization\n * - Feedback & quality\n * - System & performance\n * - Tools & functions\n * - Search & citations\n */\n\nimport { createAITracker } from '../track-ai';\nimport {\n AI_EVENTS,\n type BaseAIProperties,\n type CodeGenerationProperties,\n type CollaborationProperties,\n type ContextProperties,\n type FeedbackProperties,\n type FileProperties,\n type MemoryProperties,\n type PerformanceProperties,\n type SearchProperties,\n type SystemProperties,\n type ToolProperties,\n type UserInteractionProperties,\n type WorkspaceProperties,\n} from '../types';\n\n// ============================================================================\n// USER INTERACTIONS - User actions on generated content\n// ============================================================================\n\n/**\n * Track code copy action\n *\n * @example\n * ```typescript\n * ai.CODE_COPIED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * code_id: 'code_789',\n * language: 'typescript',\n * code_length: 450,\n * });\n * ```\n */\nexport const CODE_COPIED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_COPIED,\n category: 'user-interactions',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track code execution\n *\n * @example\n * ```typescript\n * ai.CODE_EXECUTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * code_id: 'code_789',\n * language: 'typescript',\n * execution_status: 'success',\n * execution_time_ms: 120,\n * });\n * ```\n */\nexport const CODE_EXECUTED = createAITracker<CodeGenerationProperties>(properties => ({\n name: AI_EVENTS.CODE_EXECUTED,\n category: 'user-interactions',\n properties,\n requiredProperties: ['task_type'],\n}));\n\n/**\n * Track general content copy\n *\n * @example\n * ```typescript\n * ai.CONTENT_COPIED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_id: 'content_456',\n * content_type: 'text',\n * content_length: 350,\n * });\n * ```\n */\nexport const CONTENT_COPIED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.CONTENT_COPIED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track content download\n *\n * @example\n * ```typescript\n * ai.CONTENT_DOWNLOADED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * content_id: 'content_456',\n * content_type: 'document',\n * file_format: 'pdf',\n * file_size_bytes: 1024000,\n * });\n * ```\n */\nexport const CONTENT_DOWNLOADED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.CONTENT_DOWNLOADED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track content sharing\n *\n * @example\n * ```typescript\n * ai.CONTENT_SHARED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_id: 'content_456',\n * content_type: 'code',\n * share_platform: 'twitter',\n * });\n * ```\n */\nexport const CONTENT_SHARED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.CONTENT_SHARED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track AI suggestion acceptance\n *\n * @example\n * ```typescript\n * ai.SUGGESTION_ACCEPTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * suggestion_type: 'code-completion',\n * suggestion_id: 'sug_123',\n * });\n * ```\n */\nexport const SUGGESTION_ACCEPTED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.SUGGESTION_ACCEPTED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track AI suggestion rejection\n *\n * @example\n * ```typescript\n * ai.SUGGESTION_REJECTED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * suggestion_type: 'text-completion',\n * suggestion_id: 'sug_124',\n * rejection_reason: 'not-relevant',\n * });\n * ```\n */\nexport const SUGGESTION_REJECTED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.SUGGESTION_REJECTED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track inline edit applied to AI content\n *\n * @example\n * ```typescript\n * ai.INLINE_EDIT_APPLIED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * content_id: 'content_456',\n * edit_type: 'user-refinement',\n * characters_changed: 25,\n * });\n * ```\n */\nexport const INLINE_EDIT_APPLIED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.INLINE_EDIT_APPLIED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track diff/changes viewed\n *\n * @example\n * ```typescript\n * ai.DIFF_VIEWED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * content_id: 'content_456',\n * diff_type: 'side-by-side',\n * lines_added: 15,\n * lines_removed: 8,\n * });\n * ```\n */\nexport const DIFF_VIEWED = createAITracker<UserInteractionProperties>(properties => ({\n name: AI_EVENTS.DIFF_VIEWED,\n category: 'user-interactions',\n properties,\n requiredProperties: [],\n}));\n\n// ============================================================================\n// FILES & ATTACHMENTS - File upload, processing, and usage\n// ============================================================================\n\n/**\n * Track file upload\n *\n * @example\n * ```typescript\n * ai.FILE_UPLOADED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * file_type: 'pdf',\n * file_size_bytes: 1024000,\n * file_count: 1,\n * });\n * ```\n */\nexport const FILE_UPLOADED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.FILE_UPLOADED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track file processing completion\n *\n * @example\n * ```typescript\n * ai.FILE_PROCESSED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * file_id: 'file_123',\n * file_type: 'pdf',\n * processing_time_ms: 2500,\n * extracted_text_length: 5000,\n * processing_status: 'success',\n * });\n * ```\n */\nexport const FILE_PROCESSED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.FILE_PROCESSED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track file processing failure\n *\n * @example\n * ```typescript\n * ai.FILE_PROCESSING_FAILED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * file_id: 'file_124',\n * file_type: 'docx',\n * processing_status: 'failed',\n * error_reason: 'unsupported-format',\n * });\n * ```\n */\nexport const FILE_PROCESSING_FAILED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.FILE_PROCESSING_FAILED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track file download\n *\n * @example\n * ```typescript\n * ai.FILE_DOWNLOADED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * file_id: 'file_125',\n * file_type: 'csv',\n * file_size_bytes: 512000,\n * });\n * ```\n */\nexport const FILE_DOWNLOADED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.FILE_DOWNLOADED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track file reference in conversation\n *\n * @example\n * ```typescript\n * ai.FILE_REFERENCED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * file_id: 'file_123',\n * file_type: 'pdf',\n * reference_context: 'answer-question',\n * });\n * ```\n */\nexport const FILE_REFERENCED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.FILE_REFERENCED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track file deletion\n *\n * @example\n * ```typescript\n * ai.FILE_DELETED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * file_id: 'file_126',\n * file_type: 'image',\n * deleted_by: 'user',\n * });\n * ```\n */\nexport const FILE_DELETED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.FILE_DELETED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track batch file processing\n *\n * @example\n * ```typescript\n * ai.BATCH_FILES_PROCESSED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * file_count: 5,\n * total_size_bytes: 5120000,\n * processing_time_ms: 8500,\n * processing_status: 'success',\n * });\n * ```\n */\nexport const BATCH_FILES_PROCESSED = createAITracker<FileProperties>(properties => ({\n name: AI_EVENTS.BATCH_FILES_PROCESSED,\n category: 'files',\n properties,\n requiredProperties: [],\n}));\n\n// ============================================================================\n// CONTEXT & MEMORY - Context management and long-term memory\n// ============================================================================\n\n/**\n * Track context window update\n *\n * @example\n * ```typescript\n * ai.CONTEXT_WINDOW_UPDATED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * context_size_tokens: 8000,\n * context_type: 'conversation',\n * });\n * ```\n */\nexport const CONTEXT_WINDOW_UPDATED = createAITracker<ContextProperties>(properties => ({\n name: AI_EVENTS.CONTEXT_WINDOW_UPDATED,\n category: 'context',\n properties,\n requiredProperties: ['context_type'],\n}));\n\n/**\n * Track memory creation\n *\n * @example\n * ```typescript\n * ai.MEMORY_CREATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * memory_id: 'mem_123',\n * memory_type: 'user-preference',\n * memory_content_length: 50,\n * memory_source: 'explicit',\n * });\n * ```\n */\nexport const MEMORY_CREATED = createAITracker<MemoryProperties>(properties => ({\n name: AI_EVENTS.MEMORY_CREATED,\n category: 'context',\n properties,\n requiredProperties: ['memory_type'],\n}));\n\n/**\n * Track memory retrieval\n *\n * @example\n * ```typescript\n * ai.MEMORY_RETRIEVED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * memory_id: 'mem_123',\n * memory_type: 'user-preference',\n * retrieval_relevance_score: 0.95,\n * });\n * ```\n */\nexport const MEMORY_RETRIEVED = createAITracker<MemoryProperties>(properties => ({\n name: AI_EVENTS.MEMORY_RETRIEVED,\n category: 'context',\n properties,\n requiredProperties: ['memory_type'],\n}));\n\n/**\n * Track memory update\n *\n * @example\n * ```typescript\n * ai.MEMORY_UPDATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * memory_id: 'mem_123',\n * memory_type: 'fact',\n * update_reason: 'correction',\n * });\n * ```\n */\nexport const MEMORY_UPDATED = createAITracker<MemoryProperties>(properties => ({\n name: AI_EVENTS.MEMORY_UPDATED,\n category: 'context',\n properties,\n requiredProperties: ['memory_type'],\n}));\n\n/**\n * Track memory deletion\n *\n * @example\n * ```typescript\n * ai.MEMORY_DELETED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * memory_id: 'mem_124',\n * memory_type: 'user-preference',\n * deleted_by: 'user',\n * });\n * ```\n */\nexport const MEMORY_DELETED = createAITracker<MemoryProperties>(properties => ({\n name: AI_EVENTS.MEMORY_DELETED,\n category: 'context',\n properties,\n requiredProperties: ['memory_type'],\n}));\n\n/**\n * Track custom instructions update\n *\n * @example\n * ```typescript\n * ai.CUSTOM_INSTRUCTIONS_UPDATED({\n * model_id: 'gpt-4',\n * user_id: 'user_123',\n * instructions_length: 200,\n * has_preferences: true,\n * has_constraints: true,\n * });\n * ```\n */\nexport const CUSTOM_INSTRUCTIONS_UPDATED = createAITracker<ContextProperties>(properties => ({\n name: AI_EVENTS.CUSTOM_INSTRUCTIONS_UPDATED,\n category: 'context',\n properties,\n requiredProperties: ['context_type'],\n}));\n\n/**\n * Track project context loading\n *\n * @example\n * ```typescript\n * ai.PROJECT_CONTEXT_LOADED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * context_type: 'project',\n * context_size_tokens: 5000,\n * project_id: 'proj_456',\n * });\n * ```\n */\nexport const PROJECT_CONTEXT_LOADED = createAITracker<ContextProperties>(properties => ({\n name: AI_EVENTS.PROJECT_CONTEXT_LOADED,\n category: 'context',\n properties,\n requiredProperties: ['context_type'],\n}));\n\n/**\n * Track RAG query execution\n *\n * @example\n * ```typescript\n * ai.RAG_QUERY_EXECUTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * query_text: 'Find documentation about React hooks',\n * query_embedding_dimensions: 1536,\n * chunks_retrieved: 5,\n * retrieval_time_ms: 150,\n * retrieval_status: 'success',\n * });\n * ```\n */\nexport const RAG_QUERY_EXECUTED = createAITracker<ContextProperties>(properties => ({\n name: AI_EVENTS.RAG_QUERY_EXECUTED,\n category: 'context',\n properties,\n requiredProperties: ['context_type'],\n}));\n\n/**\n * Track embedding generation\n *\n * @example\n * ```typescript\n * ai.EMBEDDING_GENERATED({\n * model_id: 'text-embedding-ada-002',\n * text_length: 500,\n * embedding_dimensions: 1536,\n * generation_time_ms: 80,\n * });\n * ```\n */\nexport const EMBEDDING_GENERATED = createAITracker<ContextProperties>(properties => ({\n name: AI_EVENTS.EMBEDDING_GENERATED,\n category: 'context',\n properties,\n requiredProperties: ['context_type'],\n}));\n\n/**\n * Track knowledge base query\n *\n * @example\n * ```typescript\n * ai.KNOWLEDGE_BASE_QUERIED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * query_text: 'What is our refund policy?',\n * results_found: 3,\n * query_time_ms: 120,\n * });\n * ```\n */\nexport const KNOWLEDGE_BASE_QUERIED = createAITracker<ContextProperties>(properties => ({\n name: AI_EVENTS.KNOWLEDGE_BASE_QUERIED,\n category: 'context',\n properties,\n requiredProperties: ['context_type'],\n}));\n\n// ============================================================================\n// COLLABORATION & SHARING - Team features and sharing\n// ============================================================================\n\n/**\n * Track conversation sharing\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_SHARED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * share_type: 'public-link',\n * share_permissions: 'view-only',\n * message_count: 15,\n * });\n * ```\n */\nexport const CONVERSATION_SHARED = createAITracker<CollaborationProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_SHARED,\n category: 'collaboration',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track conversation forking\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_FORKED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * original_conversation_id: 'conv_123',\n * new_conversation_id: 'conv_125',\n * forked_from_message_id: 'msg_460',\n * });\n * ```\n */\nexport const CONVERSATION_FORKED = createAITracker<CollaborationProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_FORKED,\n category: 'collaboration',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track workspace creation\n *\n * @example\n * ```typescript\n * ai.WORKSPACE_CREATED({\n * workspace_id: 'ws_001',\n * model_id: 'claude-3-5-sonnet',\n * workspace_type: 'team',\n * member_count: 5,\n * });\n * ```\n */\nexport const WORKSPACE_CREATED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.WORKSPACE_CREATED,\n category: 'collaboration',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track member invitation\n *\n * @example\n * ```typescript\n * ai.MEMBER_INVITED({\n * workspace_id: 'ws_001',\n * model_id: 'gpt-4',\n * invitee_role: 'member',\n * invitation_method: 'email',\n * });\n * ```\n */\nexport const MEMBER_INVITED = createAITracker<CollaborationProperties>(properties => ({\n name: AI_EVENTS.MEMBER_INVITED,\n category: 'collaboration',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track collaboration comment\n *\n * @example\n * ```typescript\n * ai.COMMENT_ADDED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * comment_target: 'message',\n * comment_length: 150,\n * });\n * ```\n */\nexport const COMMENT_ADDED = createAITracker<CollaborationProperties>(properties => ({\n name: AI_EVENTS.COMMENT_ADDED,\n category: 'collaboration',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track permission change\n *\n * @example\n * ```typescript\n * ai.PERMISSION_CHANGED({\n * workspace_id: 'ws_001',\n * model_id: 'gpt-4',\n * target_user_id: 'user_456',\n * old_permission: 'viewer',\n * new_permission: 'editor',\n * });\n * ```\n */\nexport const PERMISSION_CHANGED = createAITracker<CollaborationProperties>(properties => ({\n name: AI_EVENTS.PERMISSION_CHANGED,\n category: 'collaboration',\n properties,\n requiredProperties: [],\n}));\n\n// ============================================================================\n// WORKSPACE & ORGANIZATION - Organization and workspace management\n// ============================================================================\n\n/**\n * Track conversation rename\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_RENAMED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * old_title: 'Chat',\n * new_title: 'React Project Discussion',\n * });\n * ```\n */\nexport const CONVERSATION_RENAMED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_RENAMED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track conversation archival\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_ARCHIVED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * archive_reason: 'completed',\n * });\n * ```\n */\nexport const CONVERSATION_ARCHIVED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_ARCHIVED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track conversation deletion\n *\n * @example\n * ```typescript\n * ai.CONVERSATION_DELETED({\n * conversation_id: 'conv_124',\n * model_id: 'claude-3-5-sonnet',\n * message_count: 8,\n * deleted_by: 'user',\n * });\n * ```\n */\nexport const CONVERSATION_DELETED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.CONVERSATION_DELETED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track folder creation\n *\n * @example\n * ```typescript\n * ai.FOLDER_CREATED({\n * workspace_id: 'ws_001',\n * model_id: 'gpt-4',\n * folder_name: 'Project Ideas',\n * parent_folder_id: 'folder_root',\n * });\n * ```\n */\nexport const FOLDER_CREATED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.FOLDER_CREATED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track tag addition\n *\n * @example\n * ```typescript\n * ai.TAG_ADDED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * tag_name: 'important',\n * tag_category: 'priority',\n * });\n * ```\n */\nexport const TAG_ADDED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.TAG_ADDED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track conversation search\n *\n * @example\n * ```typescript\n * ai.SEARCH_PERFORMED({\n * model_id: 'gpt-4',\n * search_query: 'React hooks',\n * results_found: 12,\n * search_scope: 'all-conversations',\n * });\n * ```\n */\nexport const SEARCH_PERFORMED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.SEARCH_PERFORMED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n/**\n * Track filter application\n *\n * @example\n * ```typescript\n * ai.FILTER_APPLIED({\n * model_id: 'claude-3-5-sonnet',\n * filter_type: 'date-range',\n * filter_value: 'last-7-days',\n * results_count: 24,\n * });\n * ```\n */\nexport const FILTER_APPLIED = createAITracker<WorkspaceProperties>(properties => ({\n name: AI_EVENTS.FILTER_APPLIED,\n category: 'workspace',\n properties,\n requiredProperties: ['action'],\n}));\n\n// ============================================================================\n// FEEDBACK & QUALITY - User feedback and quality signals\n// ============================================================================\n\n/**\n * Track user feedback\n *\n * @example\n * ```typescript\n * ai.FEEDBACK_PROVIDED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * message_id: 'msg_457',\n * feedback_type: 'thumbs-up',\n * feedback_comment_length: 50,\n * });\n * ```\n */\nexport const FEEDBACK_PROVIDED = createAITracker<FeedbackProperties>(properties => ({\n name: AI_EVENTS.FEEDBACK_PROVIDED,\n category: 'feedback',\n properties,\n requiredProperties: ['feedback_type', 'message_id'],\n}));\n\n/**\n * Track response rating\n *\n * @example\n * ```typescript\n * ai.RESPONSE_RATED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * message_id: 'msg_458',\n * rating_value: 5,\n * rating_scale: '1-5',\n * });\n * ```\n */\nexport const RESPONSE_RATED = createAITracker<FeedbackProperties>(properties => ({\n name: AI_EVENTS.RESPONSE_RATED,\n category: 'feedback',\n properties,\n requiredProperties: ['feedback_type', 'message_id'],\n}));\n\n/**\n * Track bug report\n *\n * @example\n * ```typescript\n * ai.BUG_REPORTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * bug_type: 'incorrect-output',\n * bug_severity: 'medium',\n * });\n * ```\n */\nexport const BUG_REPORTED = createAITracker<FeedbackProperties>(properties => ({\n name: AI_EVENTS.BUG_REPORTED,\n category: 'feedback',\n properties,\n requiredProperties: ['feedback_type', 'message_id'],\n}));\n\n/**\n * Track feature request\n *\n * @example\n * ```typescript\n * ai.FEATURE_REQUESTED({\n * model_id: 'claude-3-5-sonnet',\n * feature_category: 'ui',\n * feature_description_length: 200,\n * });\n * ```\n */\nexport const FEATURE_REQUESTED = createAITracker<FeedbackProperties>(properties => ({\n name: AI_EVENTS.FEATURE_REQUESTED,\n category: 'feedback',\n properties,\n requiredProperties: ['feedback_type', 'message_id'],\n}));\n\n/**\n * Track harmful content flag\n *\n * @example\n * ```typescript\n * ai.HARMFUL_CONTENT_FLAGGED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * message_id: 'msg_459',\n * content_type: 'misinformation',\n * severity: 'high',\n * });\n * ```\n */\nexport const HARMFUL_CONTENT_FLAGGED = createAITracker<FeedbackProperties>(properties => ({\n name: AI_EVENTS.HARMFUL_CONTENT_FLAGGED,\n category: 'feedback',\n properties,\n requiredProperties: ['feedback_type', 'message_id'],\n}));\n\n/**\n * Track quality issue report\n *\n * @example\n * ```typescript\n * ai.QUALITY_ISSUE_REPORTED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * message_id: 'msg_460',\n * issue_type: 'factual-error',\n * issue_severity: 'medium',\n * });\n * ```\n */\nexport const QUALITY_ISSUE_REPORTED = createAITracker<FeedbackProperties>(properties => ({\n name: AI_EVENTS.QUALITY_ISSUE_REPORTED,\n category: 'feedback',\n properties,\n requiredProperties: ['feedback_type', 'message_id'],\n}));\n\n// ============================================================================\n// SYSTEM & PERFORMANCE - Technical operations and model management\n// ============================================================================\n\n/**\n * Track model switch\n *\n * @example\n * ```typescript\n * ai.MODEL_SWITCHED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * previous_model: 'gpt-3.5-turbo',\n * switch_reason: 'user-preference',\n * });\n * ```\n */\nexport const MODEL_SWITCHED = createAITracker<SystemProperties>(properties => ({\n name: AI_EVENTS.MODEL_SWITCHED,\n category: 'system',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track settings update\n *\n * @example\n * ```typescript\n * ai.SETTINGS_UPDATED({\n * model_id: 'claude-3-5-sonnet',\n * user_id: 'user_123',\n * settings_category: 'appearance',\n * settings_changed: ['theme', 'font-size'],\n * });\n * ```\n */\nexport const SETTINGS_UPDATED = createAITracker<SystemProperties>(properties => ({\n name: AI_EVENTS.SETTINGS_UPDATED,\n category: 'system',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track error occurrence\n *\n * @example\n * ```typescript\n * ai.ERROR_OCCURRED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * error_type: 'api-error',\n * error_code: '500',\n * error_message: 'Internal server error',\n * });\n * ```\n */\nexport const ERROR_OCCURRED = createAITracker<SystemProperties>(properties => ({\n name: AI_EVENTS.ERROR_OCCURRED,\n category: 'system',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track rate limit hit\n *\n * @example\n * ```typescript\n * ai.RATE_LIMIT_HIT({\n * model_id: 'claude-3-5-sonnet',\n * user_id: 'user_123',\n * limit_type: 'requests-per-minute',\n * retry_after_seconds: 60,\n * });\n * ```\n */\nexport const RATE_LIMIT_HIT = createAITracker<SystemProperties>(properties => ({\n name: AI_EVENTS.RATE_LIMIT_HIT,\n category: 'system',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track token usage\n *\n * @example\n * ```typescript\n * ai.TOKEN_USAGE_TRACKED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * input_tokens: 1500,\n * output_tokens: 800,\n * total_tokens: 2300,\n * cost: 0.0345,\n * cost_currency: 'USD',\n * });\n * ```\n */\nexport const TOKEN_USAGE_TRACKED = createAITracker<BaseAIProperties>(properties => ({\n name: AI_EVENTS.TOKEN_USAGE_TRACKED,\n category: 'system',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track performance measurement\n *\n * @example\n * ```typescript\n * ai.PERFORMANCE_MEASURED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * operation_type: 'message-generation',\n * duration_ms: 850,\n * performance_tier: 'normal',\n * });\n * ```\n */\nexport const PERFORMANCE_MEASURED = createAITracker<PerformanceProperties>(properties => ({\n name: AI_EVENTS.PERFORMANCE_MEASURED,\n category: 'system',\n properties,\n requiredProperties: [],\n}));\n\n// ============================================================================\n// TOOLS & FUNCTIONS - Tool calls and function execution\n// ============================================================================\n\n/**\n * Track tool call start\n *\n * @example\n * ```typescript\n * ai.TOOL_CALL_STARTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * tool_name: 'web_search',\n * tool_type: 'built-in',\n * });\n * ```\n */\nexport const TOOL_CALL_STARTED = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.TOOL_CALL_STARTED,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track tool call completion\n *\n * @example\n * ```typescript\n * ai.TOOL_CALL_COMPLETED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * tool_name: 'calculator',\n * tool_type: 'custom',\n * result_status: 'success',\n * execution_time_ms: 50,\n * });\n * ```\n */\nexport const TOOL_CALL_COMPLETED = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.TOOL_CALL_COMPLETED,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track tool call failure\n *\n * @example\n * ```typescript\n * ai.TOOL_CALL_FAILED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * tool_name: 'api_caller',\n * tool_type: 'custom',\n * error_message: 'Connection timeout',\n * execution_time_ms: 5000,\n * });\n * ```\n */\nexport const TOOL_CALL_FAILED = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.TOOL_CALL_FAILED,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track function execution\n *\n * @example\n * ```typescript\n * ai.FUNCTION_EXECUTED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * function_name: 'getData',\n * execution_status: 'success',\n * execution_time_ms: 120,\n * });\n * ```\n */\nexport const FUNCTION_EXECUTED = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.FUNCTION_EXECUTED,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track API request\n *\n * @example\n * ```typescript\n * ai.API_REQUEST_MADE({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * api_endpoint: '/v1/data',\n * api_method: 'GET',\n * response_status: 200,\n * response_time_ms: 250,\n * });\n * ```\n */\nexport const API_REQUEST_MADE = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.API_REQUEST_MADE,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track plugin activation\n *\n * @example\n * ```typescript\n * ai.PLUGIN_ACTIVATED({\n * model_id: 'claude-3-5-sonnet',\n * plugin_name: 'web-browser',\n * plugin_version: '1.2.0',\n * });\n * ```\n */\nexport const PLUGIN_ACTIVATED = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.PLUGIN_ACTIVATED,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n/**\n * Track extension usage\n *\n * @example\n * ```typescript\n * ai.EXTENSION_USED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * extension_name: 'code-runner',\n * extension_action: 'execute',\n * });\n * ```\n */\nexport const EXTENSION_USED = createAITracker<ToolProperties>(properties => ({\n name: AI_EVENTS.EXTENSION_USED,\n category: 'tool',\n properties,\n requiredProperties: [],\n}));\n\n// ============================================================================\n// SEARCH & CITATIONS - Web search and source attribution\n// ============================================================================\n\n/**\n * Track web search\n *\n * @example\n * ```typescript\n * ai.WEB_SEARCH_PERFORMED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * search_query: 'latest React 19 features',\n * search_engine: 'google',\n * results_count: 10,\n * search_time_ms: 450,\n * });\n * ```\n */\nexport const WEB_SEARCH_PERFORMED = createAITracker<SearchProperties>(properties => ({\n name: AI_EVENTS.WEB_SEARCH_PERFORMED,\n category: 'context',\n properties,\n requiredProperties: ['query', 'search_scope'],\n}));\n\n/**\n * Track citation addition\n *\n * @example\n * ```typescript\n * ai.CITATION_ADDED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * message_id: 'msg_461',\n * citation_source: 'https://react.dev',\n * citation_type: 'web',\n * });\n * ```\n */\nexport const CITATION_ADDED = createAITracker<SearchProperties>(properties => ({\n name: AI_EVENTS.CITATION_ADDED,\n category: 'context',\n properties,\n requiredProperties: ['query', 'search_scope'],\n}));\n\n/**\n * Track browse session start\n *\n * @example\n * ```typescript\n * ai.BROWSE_SESSION_STARTED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * browse_target_url: 'https://example.com',\n * });\n * ```\n */\nexport const BROWSE_SESSION_STARTED = createAITracker<SearchProperties>(properties => ({\n name: AI_EVENTS.BROWSE_SESSION_STARTED,\n category: 'context',\n properties,\n requiredProperties: ['query', 'search_scope'],\n}));\n\n/**\n * Track page content fetch\n *\n * @example\n * ```typescript\n * ai.PAGE_CONTENT_FETCHED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * page_url: 'https://example.com/article',\n * content_length: 5000,\n * fetch_time_ms: 800,\n * });\n * ```\n */\nexport const PAGE_CONTENT_FETCHED = createAITracker<SearchProperties>(properties => ({\n name: AI_EVENTS.PAGE_CONTENT_FETCHED,\n category: 'context',\n properties,\n requiredProperties: ['query', 'search_scope'],\n}));\n\n/**\n * Track search results ranking\n *\n * @example\n * ```typescript\n * ai.SEARCH_RESULTS_RANKED({\n * conversation_id: 'conv_123',\n * model_id: 'gpt-4',\n * results_count: 20,\n * ranking_algorithm: 'relevance',\n * });\n * ```\n */\nexport const SEARCH_RESULTS_RANKED = createAITracker<SearchProperties>(properties => ({\n name: AI_EVENTS.SEARCH_RESULTS_RANKED,\n category: 'context',\n properties,\n requiredProperties: ['query', 'search_scope'],\n}));\n\n/**\n * Track external source access\n *\n * @example\n * ```typescript\n * ai.EXTERNAL_SOURCE_ACCESSED({\n * conversation_id: 'conv_123',\n * model_id: 'claude-3-5-sonnet',\n * source_type: 'api',\n * source_url: 'https://api.example.com/data',\n * access_time_ms: 350,\n * });\n * ```\n */\nexport const EXTERNAL_SOURCE_ACCESSED = createAITracker<SearchProperties>(properties => ({\n name: AI_EVENTS.EXTERNAL_SOURCE_ACCESSED,\n category: 'context',\n properties,\n requiredProperties: ['query', 'search_scope'],\n}));\n","/**\n * @fileoverview Agent-related AI SDK v6 events\n * Agent-related AI SDK v6 events\n */\n\nimport { trackAISDK } from '../track-ai-sdk';\nimport {\n type AgentProperties,\n AI_SDK_EVENTS,\n type AISdkEventSpec,\n type CompletionProperties,\n} from '../types';\nimport {\n cleanProperties,\n normalizeBaseProperties,\n normalizeTokenUsage,\n validateRequiredProperties,\n} from '../utils';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../../emitter-types';\n\n/**\n * Track when an AI agent is created\n */\nexport function agentCreated(\n properties: AgentProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n agent_type: properties.agent_type,\n system_prompt_length: properties.system_prompt_length,\n tools_available: properties.tools_available,\n tools_count: properties.tools_count,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.AGENT_CREATED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when an AI agent execution starts\n */\nexport function agentExecutionStarted(\n properties: AgentProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'agent_id']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n agent_type: properties.agent_type,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.AGENT_EXECUTION_STARTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'agent_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when an AI agent execution completes successfully\n */\nexport function agentExecutionCompleted(\n properties: CompletionProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'agent_id', 'status']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n ...normalizeTokenUsage(properties),\n completion_type: properties.completion_type,\n status: properties.status,\n total_duration_ms: properties.total_duration_ms,\n step_count: properties.step_count,\n finish_reason: properties.finish_reason,\n has_tools: properties.has_tools,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.AGENT_EXECUTION_COMPLETED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'agent_id', 'status'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when an AI agent execution fails\n */\nexport function agentExecutionFailed(\n properties: CompletionProperties & { error_message: string },\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'agent_id', 'error_message']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n ...normalizeTokenUsage(properties),\n completion_type: properties.completion_type,\n status: 'failed' as const,\n error_message: properties.error_message,\n retry_count: properties.retry_count,\n total_duration_ms: properties.total_duration_ms,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.AGENT_EXECUTION_FAILED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'agent_id', 'error_message'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n","/**\n * @fileoverview Chat-related AI SDK v6 events\n * Chat-related AI SDK v6 events\n */\n\nimport { trackAISDK } from '../track-ai-sdk';\nimport {\n AI_SDK_EVENTS,\n type AISdkEventSpec,\n type ChatMessageProperties,\n type SessionProperties,\n} from '../types';\nimport { cleanProperties, normalizeBaseProperties, validateRequiredProperties } from '../utils';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../../emitter-types';\n\n/**\n * Track when a chat session starts\n */\nexport function chatSessionStarted(\n properties: SessionProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'session_id']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n session_type: properties.session_type,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHAT_SESSION_STARTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'session_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a chat session ends\n */\nexport function chatSessionEnded(\n properties: SessionProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'session_id']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n duration_ms: properties.duration_ms,\n message_count: properties.message_count,\n tool_calls_count: properties.tool_calls_count,\n total_tokens: properties.total_tokens,\n session_end_reason: properties.session_end_reason,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHAT_SESSION_ENDED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'session_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a user sends a chat message\n */\nexport function chatMessageSent(\n properties: ChatMessageProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'message_role']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n message_id: properties.message_id,\n message_role: properties.message_role,\n message_length: properties.message_length,\n message_index: properties.message_index,\n has_images: properties.has_images,\n parent_message_id: properties.parent_message_id,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHAT_MESSAGE_SENT,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'message_role'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when the assistant's chat message is received\n */\nexport function chatMessageReceived(\n properties: ChatMessageProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'message_role']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n message_id: properties.message_id,\n message_role: properties.message_role,\n message_length: properties.message_length,\n message_index: properties.message_index,\n finish_reason: properties.finish_reason,\n response_time_ms: properties.response_time_ms,\n is_streaming: properties.is_streaming,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHAT_MESSAGE_RECEIVED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'message_role'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n","/**\n * @fileoverview E-commerce chatbot-specific AI SDK v6 events\n * E-commerce chatbot-specific AI SDK v6 events\n */\n\nimport { trackAISDK } from '../track-ai-sdk';\nimport { AI_SDK_EVENTS, type AISdkEventSpec, type ChatbotEcommerceProperties } from '../types';\nimport {\n cleanProperties,\n detectChatbotIntent,\n normalizeBaseProperties,\n truncateArray,\n validateRequiredProperties,\n} from '../utils';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../../emitter-types';\n\n/**\n * Maximum number of product IDs to include in chatbot ecommerce events.\n * Limits payload size and prevents excessive data in analytics.\n */\nexport const MAX_PRODUCT_IDS = 20;\n\n/**\n * Track when chatbot detects user intent\n */\nexport function chatbotIntentDetected(\n properties: ChatbotEcommerceProperties & { message: string },\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'message']);\n\n // Auto-detect intent if not provided\n const intent = properties.intent_detected ?? detectChatbotIntent(properties.message);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n intent_detected: intent,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHATBOT_INTENT_DETECTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when chatbot assists with cart operations\n */\nexport function chatbotCartAssisted(\n properties: ChatbotEcommerceProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'cart_id']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n cart_id: properties.cart_id,\n cart_value: properties.cart_value,\n product_count: properties.product_count,\n product_ids: properties.product_ids\n ? truncateArray(properties.product_ids, MAX_PRODUCT_IDS)\n : undefined,\n intent_detected: properties.intent_detected,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHATBOT_CART_ASSISTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'cart_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when chatbot assists with order-related queries\n */\nexport function chatbotOrderAssisted(\n properties: ChatbotEcommerceProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'order_id']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n order_id: properties.order_id,\n intent_detected: properties.intent_detected,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHATBOT_ORDER_ASSISTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'order_id'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when chatbot shows product recommendations\n */\nexport function chatbotProductRecommended(\n properties: ChatbotEcommerceProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'product_ids']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n product_count: properties.product_count ?? properties.product_ids?.length,\n product_ids: properties.product_ids\n ? truncateArray(properties.product_ids, MAX_PRODUCT_IDS)\n : undefined,\n recommendation_shown: true,\n intent_detected: properties.intent_detected,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.CHATBOT_PRODUCT_RECOMMENDED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'product_ids'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n","/**\n * @fileoverview Completion-related AI SDK v6 events\n * Completion-related AI SDK v6 events\n */\n\nimport { trackAISDK } from '../track-ai-sdk';\nimport { AI_SDK_EVENTS, type AISdkEventSpec, type CompletionProperties } from '../types';\nimport {\n cleanProperties,\n normalizeBaseProperties,\n normalizeModelConfig,\n normalizeTokenUsage,\n validateRequiredProperties,\n} from '../utils';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../../emitter-types';\n\n/**\n * Track when a completion is requested\n */\nexport function completionRequested(\n properties: CompletionProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'completion_type']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n ...normalizeModelConfig(properties),\n completion_type: properties.completion_type,\n prompt_length: properties.prompt_length,\n has_tools: properties.has_tools,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.COMPLETION_REQUESTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'completion_type'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a completion is successfully generated\n */\nexport function completionGenerated(\n properties: CompletionProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'completion_type', 'status']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n ...normalizeTokenUsage(properties),\n ...normalizeModelConfig(properties),\n completion_type: properties.completion_type,\n status: properties.status,\n finish_reason: properties.finish_reason,\n total_duration_ms: properties.total_duration_ms,\n step_count: properties.step_count,\n retry_count: properties.retry_count,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.COMPLETION_GENERATED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'completion_type', 'status'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a completion fails\n */\nexport function completionFailed(\n properties: CompletionProperties & { error_message: string },\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'completion_type', 'error_message']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n ...normalizeTokenUsage(properties),\n completion_type: properties.completion_type,\n status: 'failed' as const,\n error_message: properties.error_message,\n retry_count: properties.retry_count,\n total_duration_ms: properties.total_duration_ms,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.COMPLETION_FAILED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'completion_type', 'error_message'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n","/**\n * @fileoverview Streaming-related AI SDK v6 events\n * Streaming-related AI SDK v6 events\n */\n\nimport { trackAISDK } from '../track-ai-sdk';\nimport { AI_SDK_EVENTS, type AISdkEventSpec, type StreamingSDKProperties } from '../types';\nimport { cleanProperties, normalizeBaseProperties, validateRequiredProperties } from '../utils';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../../emitter-types';\n\n/**\n * Track when streaming starts\n */\nexport function streamStarted(\n properties: StreamingSDKProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'stream_type']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n stream_type: properties.stream_type,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.STREAM_STARTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'stream_type'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a stream chunk is received\n */\nexport function streamChunkReceived(\n properties: StreamingSDKProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'stream_type']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n stream_type: properties.stream_type,\n chunk_index: properties.chunk_index,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.STREAM_CHUNK_RECEIVED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'stream_type'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when streaming completes\n */\nexport function streamCompleted(\n properties: StreamingSDKProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'stream_type']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n stream_type: properties.stream_type,\n chunk_count: properties.chunk_count,\n stream_duration_ms: properties.stream_duration_ms,\n time_to_first_chunk_ms: properties.time_to_first_chunk_ms,\n chunks_per_second: properties.chunks_per_second,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.STREAM_COMPLETED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'stream_type'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when streaming fails\n */\nexport function streamFailed(\n properties: StreamingSDKProperties & { error_message: string },\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'stream_type', 'error_message']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n stream_type: properties.stream_type,\n error_message: properties.error_message,\n chunk_count: properties.chunk_count,\n stream_duration_ms: properties.stream_duration_ms,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.STREAM_FAILED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'stream_type', 'error_message'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n","/**\n * @fileoverview Tool-related AI SDK v6 events\n * Tool-related AI SDK v6 events\n */\n\nimport { trackAISDK } from '../track-ai-sdk';\nimport { AI_SDK_EVENTS, type AISdkEventSpec, type ToolCallSDKProperties } from '../types';\nimport { cleanProperties, normalizeBaseProperties, validateRequiredProperties } from '../utils';\n\nimport type { EmitterOptions, EmitterTrackPayload } from '../../emitter-types';\n\n/**\n * Track when a tool call starts\n */\nexport function toolCallStarted(\n properties: ToolCallSDKProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'tool_name']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n tool_name: properties.tool_name,\n tool_type: properties.tool_type,\n input_size: properties.input_size,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.TOOL_CALL_STARTED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'tool_name'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a tool call completes successfully\n */\nexport function toolCallCompleted(\n properties: ToolCallSDKProperties,\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'tool_name', 'result_status']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n tool_name: properties.tool_name,\n tool_type: properties.tool_type,\n result_status: properties.result_status,\n execution_time_ms: properties.execution_time_ms,\n input_size: properties.input_size,\n output_size: properties.output_size,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.TOOL_CALL_COMPLETED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'tool_name', 'result_status'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n\n/**\n * Track when a tool call fails\n */\nexport function toolCallFailed(\n properties: ToolCallSDKProperties & { error_message: string },\n options?: EmitterOptions,\n): EmitterTrackPayload {\n validateRequiredProperties(properties, ['model_id', 'tool_name', 'error_message']);\n\n const normalizedProps = {\n ...normalizeBaseProperties(properties),\n tool_name: properties.tool_name,\n tool_type: properties.tool_type,\n result_status: 'error' as const,\n error_message: properties.error_message,\n execution_time_ms: properties.execution_time_ms,\n };\n\n const eventSpec: AISdkEventSpec = {\n name: AI_SDK_EVENTS.TOOL_CALL_FAILED,\n category: 'ai-sdk',\n properties: cleanProperties(normalizedProps),\n requiredProperties: ['model_id', 'tool_name', 'error_message'],\n };\n\n return trackAISDK(eventSpec, options);\n}\n","/**\n * @fileoverview AI Product Analytics\n *\n * Comprehensive tracking for AI product features like ChatGPT, Claude, and GitHub Copilot.\n * Track how users interact with your AI-powered chat interface, code generation tools,\n * and collaborative AI features.\n *\n * **90+ Events Covering**:\n * - **Conversation & Messaging**: Message regeneration, branching, editing\n * - **Content Generation**: Code, images, summaries, translations\n * - **Artifacts & Canvas**: Interactive artifacts (Claude-style)\n * - **Files & Attachments**: Upload, processing, referencing\n * - **Context & Memory**: Custom instructions, RAG, memory\n * - **Collaboration**: Sharing, forking, team workspaces\n * - **User Interactions**: Copy, execute, download, modify\n * - **Workspace**: Organization, search, tags\n * - **Feedback & Quality**: Ratings, bug reports, quality issues\n * - **System & Performance**: Model selection, errors, performance\n * - **Tools & Functions**: Tool calls, plugins, extensions\n * - **Search & Citations**: Web search, citations, browsing\n *\n * **Usage**: Import event functions and use with `analytics.emit()`:\n * ```typescript\n * import { ai } from '@od-oneapp/analytics/shared';\n * await analytics.emit(ai.messageSent({ messageId: 'msg-123' }));\n * ```\n *\n * @module @od-oneapp/analytics/shared/emitters/ai\n */\n\n// Export all types\nexport * from './types';\n\n// Export utilities\nexport * from './utils';\n\n// Export tracking functionality\nexport * from './track-ai';\nexport * from './track-ai-sdk';\n\n// Re-export event constants for convenience\nexport { AI_EVENTS, AI_SDK_EVENTS } from './types';\n\n// Export AI product feature events\n// Organized by product capability for easy discoverability\n\n// Core conversation features (ChatGPT/Claude-style)\nexport * from './events/conversation';\n\n// Content generation (code, images, text)\nexport * from './events/content-generation';\n\n// Interactive artifacts & canvas (Claude-style)\nexport * from './events/artifacts';\n\n// All additional product features\nexport * from './events/product-features';\n\n// =============================================================================\n// AI SDK V6 EVENTS\n// =============================================================================\n// Export AI SDK v6 event tracking functions\n\nexport * from './events/agent';\nexport * from './events/chat';\nexport * from './events/chatbot-ecommerce';\nexport * from './events/completion';\nexport * from './events/streaming';\nexport * from './events/tool';\n"],"mappings":";;;;AA6kBA,MAAa,YAAY;CAEvB,gBAAgB;CAChB,eAAe;CACf,wBAAwB;CACxB,sBAAsB;CACtB,oBAAoB;CACpB,sBAAsB;CACtB,sBAAsB;CACtB,iBAAiB;CACjB,gBAAgB;CAChB,kBAAkB;CAClB,qBAAqB;CACrB,cAAc;CACd,iBAAiB;CACjB,0BAA0B;CAG1B,eAAe;CACf,aAAa;CACb,eAAe;CACf,gBAAgB;CAChB,gBAAgB;CAChB,iBAAiB;CACjB,iBAAiB;CACjB,sBAAsB;CACtB,gBAAgB;CAChB,oBAAoB;CACpB,mBAAmB;CACnB,gBAAgB;CAChB,aAAa;CACb,kBAAkB;CAClB,eAAe;CACf,cAAc;CACd,iBAAiB;CACjB,eAAe;CACf,qBAAqB;CACrB,iBAAiB;CACjB,mBAAmB;CACnB,qBAAqB;CACrB,qBAAqB;CACrB,mBAAmB;CACnB,gBAAgB;CAChB,iBAAiB;CACjB,uBAAuB;CAGvB,uBAAuB;CACvB,eAAe;CACf,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,wBAAwB;CACxB,iBAAiB;CACjB,eAAe;CACf,gBAAgB;CAChB,gBAAgB;CAGhB,wBAAwB;CACxB,gBAAgB;CAChB,mBAAmB;CACnB,0BAA0B;CAC1B,sBAAsB;CACtB,uBAAuB;CACvB,aAAa;CACb,sBAAsB;CACtB,cAAc;CAGd,YAAY;CACZ,kBAAkB;CAClB,gBAAg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oBAAoB;GAAC;GAAY;GAAa;GAAgB;EAC/D,EAE4B,QAAQ"}
@@ -0,0 +1,18 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) {
6
+ __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ }
11
+ if (!no_symbols) {
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ }
14
+ return target;
15
+ };
16
+
17
+ //#endregion
18
+ export { __exportAll as t };
@@ -0,0 +1,9 @@
1
+ import { t as __exportAll } from "./chunk-DQk6qfdC.mjs";
2
+ import { t as ConsoleProvider } from "./console-8bND3mMU.mjs";
3
+
4
+ //#region src/providers/console/client.ts
5
+ var client_exports = /* @__PURE__ */ __exportAll({ ConsoleProvider: () => ConsoleProvider });
6
+
7
+ //#endregion
8
+ export { client_exports as t };
9
+ //# sourceMappingURL=client-CTzJVFU5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-CTzJVFU5.mjs","names":[],"sources":["../src/providers/console/client.ts"],"sourcesContent":["/**\n * @fileoverview Console provider for client/browser environments\n *\n * Provides console-based analytics logging for development and debugging.\n * Useful for testing analytics events without sending data to external services.\n *\n * @module @od-oneapp/analytics/providers/console/client\n */\n\nexport { ConsoleProvider } from '.';\n"],"mappings":""}
@@ -0,0 +1,54 @@
1
+ //#region src/providers/vercel/client.ts
2
+ var VercelClientProvider = class {
3
+ name = "vercel";
4
+ config;
5
+ isInitialized = false;
6
+ constructor(config) {
7
+ this.config = { options: config.options };
8
+ }
9
+ async initialize() {
10
+ if (this.isInitialized) return;
11
+ try {
12
+ const { inject } = await import("@vercel/analytics");
13
+ inject(this.config.options);
14
+ this.isInitialized = true;
15
+ } catch {
16
+ throw new Error("Vercel Analytics not available. Install with: npm install @vercel/analytics");
17
+ }
18
+ }
19
+ async track(event, properties = {}) {
20
+ if (!this.isInitialized) return;
21
+ try {
22
+ const { track } = await import("@vercel/analytics");
23
+ track(event, properties);
24
+ } catch {}
25
+ }
26
+ async identify(userId, traits = {}) {
27
+ await this.track("User Identified", {
28
+ userId,
29
+ ...traits
30
+ });
31
+ }
32
+ async page(name, properties = {}) {
33
+ if (name || Object.keys(properties).length > 0) await this.track("Page View", {
34
+ page: name,
35
+ ...properties
36
+ });
37
+ }
38
+ async group(groupId, traits = {}) {
39
+ await this.track("Group Identified", {
40
+ groupId,
41
+ ...traits
42
+ });
43
+ }
44
+ async alias(userId, previousId) {
45
+ await this.track("User Aliased", {
46
+ previousId,
47
+ userId
48
+ });
49
+ }
50
+ };
51
+
52
+ //#endregion
53
+ export { VercelClientProvider };
54
+ //# sourceMappingURL=client-CcFTauAh.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-CcFTauAh.mjs","names":[],"sources":["../src/providers/vercel/client.ts"],"sourcesContent":["/**\n * @fileoverview Vercel Analytics client-side (browser) provider implementation\n *\n * Provides client-side integration with Vercel Analytics for web analytics tracking.\n * Supports automatic page view tracking and custom event tracking.\n *\n * @remarks\n * This provider:\n * - Uses @vercel/analytics package for client-side tracking\n * - Supports dynamic imports to avoid SSR issues\n * - Handles initialization and event tracking\n * - Integrates with Vercel's analytics dashboard\n *\n * @module @repo/analytics/providers/vercel/client\n */\n\nimport type { VercelConfig } from './types';\nimport type { AnalyticsProvider, ProviderConfig } from '../../shared/types/types';\n\n// Vercel Analytics types are handled by @vercel/analytics package\n\nexport class VercelClientProvider implements AnalyticsProvider {\n readonly name = 'vercel';\n private config: VercelConfig;\n private isInitialized = false;\n\n constructor(config: ProviderConfig) {\n this.config = {\n options: config.options,\n };\n }\n\n async initialize(): Promise<void> {\n if (this.isInitialized) return;\n\n try {\n // Dynamically import Vercel Analytics\n const { inject } = await import('@vercel/analytics');\n\n // Initialize Vercel Analytics\n inject(this.config.options);\n\n this.isInitialized = true;\n } catch {\n throw new Error(\n 'Vercel Analytics not available. Install with: npm install @vercel/analytics',\n );\n }\n }\n\n async track(event: string, properties: any = {}): Promise<void> {\n if (!this.isInitialized) {\n return;\n }\n\n try {\n // Import track function dynamically to avoid SSR issues\n const { track } = await import('@vercel/analytics');\n track(event, properties);\n } catch {\n // Silently fail to avoid disrupting app flow\n }\n }\n\n async identify(userId: string, traits: any = {}): Promise<void> {\n // Vercel Analytics doesn't have a native identify method\n // We can track this as a custom event\n await this.track('User Identified', {\n userId,\n ...traits,\n });\n }\n\n async page(name?: string, properties: any = {}): Promise<void> {\n // Vercel Analytics automatically tracks page views\n // We can track additional page data as custom events if needed\n if (name || Object.keys(properties).length > 0) {\n await this.track('Page View', {\n page: name,\n ...properties,\n });\n }\n }\n\n async group(groupId: string, traits: any = {}): Promise<void> {\n // Vercel Analytics doesn't have a native group method\n // We can track this as a custom event\n await this.track('Group Identified', {\n groupId,\n ...traits,\n });\n }\n\n async alias(userId: string, previousId: string): Promise<void> {\n // Vercel Analytics doesn't have a native alias method\n // We can track this as a custom event\n await this.track('User Aliased', {\n previousId,\n userId,\n });\n }\n}\n"],"mappings":";AAqBA,IAAa,uBAAb,MAA+D;CAC7D,AAAS,OAAO;CAChB,AAAQ;CACR,AAAQ,gBAAgB;CAExB,YAAY,QAAwB;AAClC,OAAK,SAAS,EACZ,SAAS,OAAO,SACjB;;CAGH,MAAM,aAA4B;AAChC,MAAI,KAAK,cAAe;AAExB,MAAI;GAEF,MAAM,EAAE,WAAW,MAAM,OAAO;AAGhC,UAAO,KAAK,OAAO,QAAQ;AAE3B,QAAK,gBAAgB;UACf;AACN,SAAM,IAAI,MACR,8EACD;;;CAIL,MAAM,MAAM,OAAe,aAAkB,EAAE,EAAiB;AAC9D,MAAI,CAAC,KAAK,cACR;AAGF,MAAI;GAEF,MAAM,EAAE,UAAU,MAAM,OAAO;AAC/B,SAAM,OAAO,WAAW;UAClB;;CAKV,MAAM,SAAS,QAAgB,SAAc,EAAE,EAAiB;AAG9D,QAAM,KAAK,MAAM,mBAAmB;GAClC;GACA,GAAG;GACJ,CAAC;;CAGJ,MAAM,KAAK,MAAe,aAAkB,EAAE,EAAiB;AAG7D,MAAI,QAAQ,OAAO,KAAK,WAAW,CAAC,SAAS,EAC3C,OAAM,KAAK,MAAM,aAAa;GAC5B,MAAM;GACN,GAAG;GACJ,CAAC;;CAIN,MAAM,MAAM,SAAiB,SAAc,EAAE,EAAiB;AAG5D,QAAM,KAAK,MAAM,oBAAoB;GACnC;GACA,GAAG;GACJ,CAAC;;CAGJ,MAAM,MAAM,QAAgB,YAAmC;AAG7D,QAAM,KAAK,MAAM,gBAAgB;GAC/B;GACA;GACD,CAAC"}