@@ -11,7 +11,8 @@ export type SignalRecordKind =
1111 | "ticket"
1212 | "scanner_finding"
1313 | "feedback"
14- | "review" ;
14+ | "review"
15+ | "search_opportunity" ;
1516
1617/**
1718 * A warehouse data source the Self-driving inbox can watch. This is the single source of
@@ -48,6 +49,7 @@ const ERROR = "Surface new and reopened errors";
4849const FINDING = "Surface new security and code-quality findings" ;
4950const FEEDBACK = "Turn product feedback and feature requests into inputs" ;
5051const REVIEW = "Monitor new app and product reviews" ;
52+ const SEARCH = "Fix pages that rank in Google but lose clicks" ;
5153
5254/** Registry of warehouse-backed inbox sources, alphabetical within each category. */
5355export const EXTERNAL_INBOX_SOURCES = [
@@ -392,6 +394,16 @@ export const EXTERNAL_INBOX_SOURCES = [
392394 recordKind : "review" ,
393395 setup : "dynamic" ,
394396 } ,
397+ // Search analytics
398+ {
399+ product : "google_search_console" ,
400+ label : "Google Search Console" ,
401+ description : SEARCH ,
402+ dwSourceType : "GoogleSearchConsole" ,
403+ requiredTables : [ "search_analytics_by_query_page" ] ,
404+ recordKind : "search_opportunity" ,
405+ setup : "dynamic" ,
406+ } ,
395407] as const satisfies readonly ExternalInboxSource [ ] ;
396408
397409/** Warehouse-backed source products, derived from the registry above. */
@@ -434,9 +446,13 @@ export type SourceType =
434446 | "session_analysis_cluster"
435447 | SignalRecordKind ;
436448
437- /** Issue-like records mutate (status/votes change), so their table needs full-refresh sync. */
449+ /**
450+ * Issue-like records mutate (status/votes change), so their table needs full-refresh sync.
451+ * Tickets and search-analytics rows are append-only — existing rows never change once written —
452+ * so they sync incrementally.
453+ */
438454export function sourceNeedsFullRefresh ( recordKind : SignalRecordKind ) : boolean {
439- return recordKind !== "ticket" ;
455+ return recordKind !== "ticket" && recordKind !== "search_opportunity" ;
440456}
441457
442458export const EXTERNAL_INBOX_SOURCE_BY_PRODUCT : Partial <
0 commit comments