@@ -1084,6 +1084,119 @@ export interface AutoresearchRunStartedProperties {
10841084 workspace_mode ?: "local" | "worktree" | "cloud" ;
10851085}
10861086
1087+ // Loops events
1088+ type LoopReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max" ;
1089+ type LoopOverlapPolicy = "skip" | "allow" | "cancel_previous" ;
1090+ type LoopRunBlockedReason =
1091+ | "deduped"
1092+ | "overlap_skipped"
1093+ | "rate_capped"
1094+ | "team_rate_capped"
1095+ | "disabled"
1096+ | "gate_blocked"
1097+ | "owner_inactive"
1098+ | "owner_changed" ;
1099+ type LoopRunStatus =
1100+ | "not_started"
1101+ | "queued"
1102+ | "in_progress"
1103+ | "completed"
1104+ | "failed"
1105+ | "cancelled" ;
1106+
1107+ export interface LoopListViewedProperties {
1108+ loop_count : number ;
1109+ personal_loop_count : number ;
1110+ team_loop_count : number ;
1111+ is_at_limit : boolean ;
1112+ /** Backend-enforced per-project cap; omitted while the limit is still loading. */
1113+ loop_limit ?: number ;
1114+ builder_session_count : number ;
1115+ }
1116+
1117+ export interface LoopViewedProperties {
1118+ loop_id : string ;
1119+ visibility : "personal" | "team" ;
1120+ enabled : boolean ;
1121+ /** Backend-open string; null when enabled or manually paused with no reason given. */
1122+ disabled_reason : string | null ;
1123+ runtime_adapter : "claude" | "codex" ;
1124+ model ?: string ;
1125+ reasoning_effort : LoopReasoningEffort | null ;
1126+ repository_count : number ;
1127+ trigger_count : number ;
1128+ has_schedule_trigger : boolean ;
1129+ has_github_trigger : boolean ;
1130+ has_api_trigger : boolean ;
1131+ /** Backend-open string, not a closed enum. */
1132+ last_run_status : string | null ;
1133+ consecutive_failures : number ;
1134+ recent_run_count : number ;
1135+ }
1136+
1137+ export interface LoopSavedProperties {
1138+ loop_id : string ;
1139+ visibility : "personal" | "team" ;
1140+ runtime_adapter : "claude" | "codex" ;
1141+ model ?: string ;
1142+ reasoning_effort : LoopReasoningEffort | null ;
1143+ repository_count : number ;
1144+ trigger_count : number ;
1145+ has_schedule_trigger : boolean ;
1146+ has_github_trigger : boolean ;
1147+ has_api_trigger : boolean ;
1148+ is_pr_creation_enabled : boolean ;
1149+ is_auto_fix_enabled : boolean ;
1150+ /** Count of notifications.{push,email,slack} that are enabled. */
1151+ notification_channel_count : number ;
1152+ has_context_target : boolean ;
1153+ }
1154+
1155+ export interface LoopDeletedProperties {
1156+ loop_id : string ;
1157+ visibility : "personal" | "team" ;
1158+ enabled : boolean ;
1159+ trigger_count : number ;
1160+ /** State at time of deletion, distinguishes deleting a healthy loop from abandoning a failing one. */
1161+ consecutive_failures : number ;
1162+ }
1163+
1164+ export interface LoopEnabledToggledProperties {
1165+ loop_id : string ;
1166+ /** The new value the loop is being switched to. */
1167+ enabled : boolean ;
1168+ visibility : "personal" | "team" ;
1169+ /** True when this toggle clears or reinstates a backend auto-pause rather than a routine manual pause/resume. */
1170+ was_auto_paused : boolean ;
1171+ success : boolean ;
1172+ }
1173+
1174+ export interface LoopRunStartedProperties {
1175+ loop_id : string ;
1176+ task_id : string | null ;
1177+ task_run_id : string | null ;
1178+ runtime_adapter : "claude" | "codex" ;
1179+ model ?: string ;
1180+ trigger_count : number ;
1181+ }
1182+
1183+ export interface LoopRunBlockedProperties {
1184+ loop_id : string ;
1185+ reason : LoopRunBlockedReason ;
1186+ overlap_policy : LoopOverlapPolicy ;
1187+ trigger_count : number ;
1188+ }
1189+
1190+ export interface LoopRunViewedProperties {
1191+ loop_id : string ;
1192+ run_id : string ;
1193+ task_id : string ;
1194+ status : LoopRunStatus ;
1195+ environment : "local" | "cloud" ;
1196+ /** True when the run wasn't triggered by a schedule/github/api trigger. */
1197+ is_manual_run : boolean ;
1198+ }
1199+
10871200// Event names as constants
10881201export const ANALYTICS_EVENTS = {
10891202 // App lifecycle
@@ -1255,6 +1368,17 @@ export const ANALYTICS_EVENTS = {
12551368 LOOPS_PROMO_OPENED : "Loops promo opened" ,
12561369 LOOPS_PROMO_DISMISSED : "Loops promo dismissed" ,
12571370 LOOPS_PROMO_LEARN_MORE_CLICKED : "Loops promo learn more clicked" ,
1371+
1372+ // Loops events
1373+ LOOP_LIST_VIEWED : "Loop list viewed" ,
1374+ LOOP_VIEWED : "Loop viewed" ,
1375+ LOOP_CREATED : "Loop created" ,
1376+ LOOP_UPDATED : "Loop updated" ,
1377+ LOOP_DELETED : "Loop deleted" ,
1378+ LOOP_ENABLED_TOGGLED : "Loop enabled toggled" ,
1379+ LOOP_RUN_STARTED : "Loop run started" ,
1380+ LOOP_RUN_BLOCKED : "Loop run blocked" ,
1381+ LOOP_RUN_VIEWED : "Loop run viewed" ,
12581382} as const ;
12591383
12601384// Event property mapping
@@ -1420,6 +1544,17 @@ export type EventPropertyMap = {
14201544 [ ANALYTICS_EVENTS . LOOPS_PROMO_OPENED ] : never ;
14211545 [ ANALYTICS_EVENTS . LOOPS_PROMO_DISMISSED ] : never ;
14221546 [ ANALYTICS_EVENTS . LOOPS_PROMO_LEARN_MORE_CLICKED ] : never ;
1547+
1548+ // Loops events
1549+ [ ANALYTICS_EVENTS . LOOP_LIST_VIEWED ] : LoopListViewedProperties ;
1550+ [ ANALYTICS_EVENTS . LOOP_VIEWED ] : LoopViewedProperties ;
1551+ [ ANALYTICS_EVENTS . LOOP_CREATED ] : LoopSavedProperties ;
1552+ [ ANALYTICS_EVENTS . LOOP_UPDATED ] : LoopSavedProperties ;
1553+ [ ANALYTICS_EVENTS . LOOP_DELETED ] : LoopDeletedProperties ;
1554+ [ ANALYTICS_EVENTS . LOOP_ENABLED_TOGGLED ] : LoopEnabledToggledProperties ;
1555+ [ ANALYTICS_EVENTS . LOOP_RUN_STARTED ] : LoopRunStartedProperties ;
1556+ [ ANALYTICS_EVENTS . LOOP_RUN_BLOCKED ] : LoopRunBlockedProperties ;
1557+ [ ANALYTICS_EVENTS . LOOP_RUN_VIEWED ] : LoopRunViewedProperties ;
14231558} ;
14241559
14251560/**
0 commit comments