@gscdump/analysis 0.17.5 → 0.18.1

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.
@@ -1,4 +1,3 @@
1
- import * as _$_gscdump_engine_analyzer0 from "@gscdump/engine/analyzer";
2
1
  import { AnalysisPeriod } from "@gscdump/engine/period";
3
2
  import { BuilderState } from "gscdump/query";
4
3
  import { Row } from "@gscdump/engine/contracts";
@@ -27,7 +26,7 @@ interface BayesianCtrResult {
27
26
  significance: number;
28
27
  classification: 'overperforming' | 'underperforming' | 'expected';
29
28
  }
30
- declare const bayesianCtrAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
29
+ declare const bayesianCtrAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
31
30
  /**
32
31
  * bipartite-pagerank
33
32
  *
@@ -53,7 +52,7 @@ interface BipartitePagerankNode {
53
52
  impressions: number;
54
53
  }
55
54
  type BipartitePagerankResult = BipartitePagerankNode;
56
- declare const bipartitePagerankAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
55
+ declare const bipartitePagerankAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
57
56
  /**
58
57
  * Domain row shapes + analysis utilities. Analyzer-call contracts
59
58
  * (`AnalysisParams`, `AnalysisResult`, `AnalysisTool`, `num`) live in
@@ -103,7 +102,7 @@ interface BrandResultRow {
103
102
  position: number;
104
103
  segment: 'brand' | 'non-brand';
105
104
  }
106
- declare const brandAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
105
+ declare const brandAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
107
106
  type CannibalizationSortMetric = 'clicks' | 'impressions' | 'positionSpread' | 'pageCount';
108
107
  interface CannibalizationOptions {
109
108
  /** Minimum impressions for a query to be considered. Default: 10 */
@@ -154,7 +153,7 @@ interface CannibalizationEvent {
154
153
  severity: number;
155
154
  competitors: CannibalizationCompetitor[];
156
155
  }
157
- declare const cannibalizationAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
156
+ declare const cannibalizationAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
158
157
  /**
159
158
  * `change-point` — per-(query, url) timeseries change-point detection. SQL-only.
160
159
  *
@@ -179,7 +178,7 @@ interface ChangePointResult {
179
178
  direction: 'improved' | 'worsened';
180
179
  series: ChangePointSeriesPoint[];
181
180
  }
182
- declare const changePointAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
181
+ declare const changePointAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
183
182
  type ClusterType = 'prefix' | 'intent' | 'both';
184
183
  interface ClusteringOptions {
185
184
  /** Minimum keywords for a cluster to be reported. Default: 2 */
@@ -202,7 +201,7 @@ interface ClusteringResult {
202
201
  clusters: KeywordCluster[];
203
202
  unclustered: KeywordRow[];
204
203
  }
205
- declare const clusteringAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
204
+ declare const clusteringAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
206
205
  type ConcentrationRiskLevel = 'low' | 'medium' | 'high';
207
206
  interface ConcentrationOptions {
208
207
  /** Number of top items to report. Default: 10 */
@@ -230,7 +229,7 @@ interface ConcentrationResult {
230
229
  /** Risk level derived from HHI: <1500 low, 1500-2500 medium, >2500 high */
231
230
  riskLevel: ConcentrationRiskLevel;
232
231
  }
233
- declare const concentrationAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
232
+ declare const concentrationAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
234
233
  /**
235
234
  * `content-velocity` — weekly new-keyword cadence. SQL-only colocation.
236
235
  *
@@ -241,7 +240,7 @@ interface ContentVelocityWeek {
241
240
  newKeywords: number;
242
241
  totalKeywords: number;
243
242
  }
244
- declare const contentVelocityAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
243
+ declare const contentVelocityAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
245
244
  /**
246
245
  * `ctr-anomaly` — rolling CTR envelope per (query, page). SQL-only colocation.
247
246
  *
@@ -271,7 +270,7 @@ interface CtrAnomalyResult {
271
270
  totalClicks: number;
272
271
  series: CtrAnomalySeriesPoint[];
273
272
  }
274
- declare const ctrAnomalyAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
273
+ declare const ctrAnomalyAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
275
274
  /**
276
275
  * `ctr-curve` — CTR by position bucket plus over/under-performing outliers.
277
276
  * SQL-only colocation.
@@ -295,7 +294,7 @@ interface CtrCurveOutlier {
295
294
  expectedCtr: number;
296
295
  ctrDiff: number;
297
296
  }
298
- declare const ctrCurveAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
297
+ declare const ctrCurveAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
299
298
  /**
300
299
  * dark-traffic — gap between page-level clicks and sum-of-keyword clicks.
301
300
  *
@@ -310,11 +309,11 @@ interface DarkTrafficResult {
310
309
  darkPercent: number;
311
310
  keywordCount: number;
312
311
  }
313
- declare const darkTrafficAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
312
+ declare const darkTrafficAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
314
313
  type DataDetailResult = Row;
315
- declare const dataDetailAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
314
+ declare const dataDetailAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
316
315
  type DataQueryResult = Row;
317
- declare const dataQueryAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
316
+ declare const dataQueryAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
318
317
  type DecaySortMetric = 'lostClicks' | 'declinePercent' | 'currentClicks';
319
318
  interface DecayOptions {
320
319
  /** Minimum clicks in previous period to consider. Default: 50 */
@@ -344,7 +343,7 @@ interface DecayResult {
344
343
  positionDrop: number;
345
344
  series?: DecaySeriesPoint[];
346
345
  }
347
- declare const decayAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
346
+ declare const decayAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
348
347
  /**
349
348
  * device-gap — desktop vs mobile CTR/position delta over time.
350
349
  */
@@ -363,7 +362,7 @@ interface DeviceGapResult {
363
362
  positionGap: number;
364
363
  };
365
364
  }
366
- declare const deviceGapAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
365
+ declare const deviceGapAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
367
366
  /**
368
367
  * intent-atlas
369
368
  *
@@ -386,7 +385,7 @@ interface IntentAtlasResult {
386
385
  position: number;
387
386
  }>;
388
387
  }
389
- declare const intentAtlasAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
388
+ declare const intentAtlasAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
390
389
  /**
391
390
  * keyword-breadth — keyword-count histogram across pages + fragile/authority
392
391
  * classification.
@@ -395,7 +394,7 @@ interface KeywordBreadthResult {
395
394
  bucket: string;
396
395
  pageCount: number;
397
396
  }
398
- declare const keywordBreadthAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
397
+ declare const keywordBreadthAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
399
398
  /**
400
399
  * long-tail
401
400
  *
@@ -420,7 +419,7 @@ interface LongTailResult {
420
419
  query: string;
421
420
  }>;
422
421
  }
423
- declare const longTailAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
422
+ declare const longTailAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
424
423
  type MoversSortMetric = 'clicks' | 'impressions' | 'clicksChange' | 'impressionsChange' | 'positionChange';
425
424
  interface MoversOptions {
426
425
  /** Minimum change threshold to flag. Default: 0.2 (20%) */
@@ -464,7 +463,7 @@ interface MoversResultRow extends MoverData {
464
463
  direction: 'rising' | 'declining' | 'stable';
465
464
  series?: MoversSeriesPoint[];
466
465
  }
467
- declare const moversAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
466
+ declare const moversAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
468
467
  interface OpportunityFactors {
469
468
  positionScore: number;
470
469
  impressionScore: number;
@@ -481,7 +480,7 @@ interface OpportunityResult {
481
480
  potentialClicks: number;
482
481
  factors: OpportunityFactors;
483
482
  }
484
- declare const opportunityAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
483
+ declare const opportunityAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
485
484
  /**
486
485
  * position-distribution — daily count of keywords per position bucket.
487
486
  * Matches `/api/sites/[siteId]/position-distribution.get.ts`.
@@ -494,7 +493,7 @@ interface PositionDistributionResult {
494
493
  pos_20_plus: number;
495
494
  total: number;
496
495
  }
497
- declare const positionDistributionAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
496
+ declare const positionDistributionAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
498
497
  /**
499
498
  * position-volatility
500
499
  *
@@ -522,7 +521,7 @@ interface PositionVolatilityResult {
522
521
  totalImpressions: number;
523
522
  days: PositionVolatilityDay[];
524
523
  }
525
- declare const positionVolatilityAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
524
+ declare const positionVolatilityAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
526
525
  /**
527
526
  * query-migration
528
527
  *
@@ -550,7 +549,7 @@ interface QueryMigrationResult {
550
549
  fuzzyCount: number;
551
550
  examples: QueryMigrationExample[];
552
551
  }
553
- declare const queryMigrationAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
552
+ declare const queryMigrationAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
554
553
  type SeasonalityMetric = 'clicks' | 'impressions';
555
554
  interface SeasonalityOptions {
556
555
  /** Metric to analyze for seasonality. Default: clicks */
@@ -572,7 +571,7 @@ interface SeasonalityResult {
572
571
  monthlyBreakdown: MonthlyData[];
573
572
  insufficientData: boolean;
574
573
  }
575
- declare const seasonalityAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
574
+ declare const seasonalityAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
576
575
  /**
577
576
  * stl-decompose
578
577
  *
@@ -602,7 +601,7 @@ interface StlDecomposeResult {
602
601
  trendSlope: number;
603
602
  series: StlDecomposeSeriesPoint[];
604
603
  }
605
- declare const stlDecomposeAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
604
+ declare const stlDecomposeAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
606
605
  /**
607
606
  * Unified `striking-distance` analyzer. Spike for the `defineAnalyzer`
608
607
  * pattern: one file owns the SQL plan, the row plan, the typed `InputRow`
@@ -637,7 +636,7 @@ interface StrikingDistanceResult {
637
636
  /** Estimated clicks at ~15% CTR (the average for positions 1–3). */
638
637
  potentialClicks: number;
639
638
  }
640
- declare const strikingDistanceAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
639
+ declare const strikingDistanceAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
641
640
  /**
642
641
  * survival (Kaplan-Meier)
643
642
  *
@@ -665,7 +664,7 @@ interface SurvivalResult {
665
664
  medianTenure: number;
666
665
  curve: SurvivalCurvePoint[];
667
666
  }
668
- declare const survivalAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
667
+ declare const survivalAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
669
668
  /**
670
669
  * trends — weekly trajectory over a rolling window (default 28 weeks)
671
670
  */
@@ -687,7 +686,7 @@ interface TrendsResult {
687
686
  trend: TrendCategory;
688
687
  series: TrendSeriesPoint[];
689
688
  }
690
- declare const trendsAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
689
+ declare const trendsAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
691
690
  /**
692
691
  * `zero-click` — high impressions, low CTR, good ranking. SQL groups by
693
692
  * (query, url) and applies HAVING/WHERE pushdown; row reducer dedupes to the
@@ -702,7 +701,7 @@ interface ZeroClickResult {
702
701
  ctr: number;
703
702
  position: number;
704
703
  }
705
- declare const zeroClickAnalyzer: _$_gscdump_engine_analyzer0.DefinedAnalyzer;
704
+ declare const zeroClickAnalyzer: import("@gscdump/engine/analyzer").DefinedAnalyzer;
706
705
  declare function keywordsQueryState(period: AnalysisPeriod, limit?: number): BuilderState;
707
706
  declare function pagesQueryState(period: AnalysisPeriod, limit?: number): BuilderState;
708
707
  declare function datesQueryState(period: AnalysisPeriod, limit?: number): BuilderState;
@@ -1,9 +1,8 @@
1
- import * as _$_gscdump_engine_analyzer0 from "@gscdump/engine/analyzer";
2
1
  /**
3
2
  * Default analyzer registry built from every in-tree analyzer. Convenience
4
3
  * for callers who don't care about bundle size; edge / browser consumers
5
4
  * should compose their own narrower registry via `createAnalyzerRegistry`
6
5
  * with the flat `ROW_ANALYZERS` / `SQL_ANALYZERS` arrays.
7
6
  */
8
- declare const defaultAnalyzerRegistry: _$_gscdump_engine_analyzer0.AnalyzerRegistry;
7
+ declare const defaultAnalyzerRegistry: import("@gscdump/engine/analyzer").AnalyzerRegistry;
9
8
  export { defaultAnalyzerRegistry };
package/dist/index.d.mts CHANGED
@@ -1,10 +1,8 @@
1
- import * as _$_gscdump_engine_analyzer0 from "@gscdump/engine/analyzer";
2
1
  import { Analyzer, Analyzer as Analyzer$1, AnalyzerCapabilityError, AnalyzerRegistry, AnalyzerRegistry as AnalyzerRegistry$1, AnalyzerRegistryInit, AnalyzerVariants, DefineAnalyzerOptions, DefinedAnalyzer, Plan, ReduceContext, ReduceCtx, Reducer, RequiredCapability, RowQueriesPlan, SqlExtraQuery, SqlPlan, SqlPlanSpec, TypedRowQuery, createAnalyzerRegistry, defineAnalyzer, runAnalyzerFromSource } from "@gscdump/engine/analyzer";
3
2
  import { AnalysisPeriod, ComparisonMode, ComparisonPeriod, PadTimeseriesOptions, ResolveWindowOptions, ResolvedWindow, WindowPreset, comparisonOf, padTimeseries, periodOf, resolveWindow, windowToComparisonPeriod, windowToPeriod } from "@gscdump/engine/period";
4
3
  import { AnalysisParams, AnalysisParams as AnalysisParams$1, AnalysisResult, AnalysisResult as AnalysisResult$1, AnalysisTool, num } from "@gscdump/engine/analysis-types";
5
4
  import { BuilderState } from "gscdump/query";
6
5
  import { AnalysisQuerySource, AnalysisQuerySource as AnalysisQuerySource$1, AnalysisSourceKind, AttachedTableRunner, AttachedTableRunner as AnalyzerRunner, AttachedTableSourceOptions, AttachedTableSourceOptions as BrowserAnalyzeOptions, ENGINE_QUERY_CAPABILITIES, EngineQuerySourceOptions, ExecuteSqlOptions, FileSet, QueryRow, QueryRow as QueryRow$1, SourceCapabilities, TypedQuery, createEngineQuerySource, queryComparisonRows, queryRows, rewriteForTableSource, runAnalyzerWithEngine, typedQuery } from "@gscdump/engine/source";
7
- import * as _$_gscdump_engine_report0 from "@gscdump/engine/report";
8
6
  import { DefineReportOptions, DefinedReport, DefinedReport as DefinedReport$1, ReportAction, ReportContext, ReportContext as ReportContext$1, ReportFinding, ReportParams, ReportPlanStep, ReportResult, ReportResult as ReportResult$1, ReportSection } from "@gscdump/engine/report";
9
7
  import { PlannerCapabilities } from "gscdump/query/plan";
10
8
  type ActionSource = 'cannibalization' | 'striking-distance' | 'ctr-anomaly' | 'change-point' | 'opportunity';
@@ -389,7 +387,7 @@ declare function analyzeInBrowser(runner: AttachedTableRunner, opts: AttachedTab
389
387
  * should compose their own narrower registry via `createAnalyzerRegistry`
390
388
  * with the flat `ROW_ANALYZERS` / `SQL_ANALYZERS` arrays.
391
389
  */
392
- declare const defaultAnalyzerRegistry: _$_gscdump_engine_analyzer0.AnalyzerRegistry;
390
+ declare const defaultAnalyzerRegistry: import("@gscdump/engine/analyzer").AnalyzerRegistry;
393
391
  /**
394
392
  * Produce a canonical form of a search query for grouping near-duplicates.
395
393
  * Idempotent: `normalizeQuery(normalizeQuery(q)) === normalizeQuery(q)`.
@@ -401,7 +399,7 @@ interface FormatReportOptions {
401
399
  }
402
400
  declare function formatReport(report: ReportResult$1, opts?: FormatReportOptions): string;
403
401
  declare const REPORTS: readonly DefinedReport$1<ReportParams>[];
404
- declare const defaultReportRegistry: _$_gscdump_engine_report0.ReportRegistry;
402
+ declare const defaultReportRegistry: import("@gscdump/engine/report").ReportRegistry;
405
403
  interface RunReportOptions<P extends ReportParams = ReportParams> {
406
404
  source: AnalysisQuerySource$1;
407
405
  analyzers: AnalyzerRegistry$1;
@@ -1,4 +1,3 @@
1
- import * as _$_gscdump_engine_report0 from "@gscdump/engine/report";
2
1
  import { DefinedReport, ReportContext, ReportParams, ReportResult } from "@gscdump/engine/report";
3
2
  import { AnalyzerRegistry } from "@gscdump/engine/analyzer";
4
3
  import { AnalysisQuerySource } from "@gscdump/engine/source";
@@ -8,7 +7,7 @@ interface FormatReportOptions {
8
7
  }
9
8
  declare function formatReport(report: ReportResult, opts?: FormatReportOptions): string;
10
9
  declare const REPORTS: readonly DefinedReport<ReportParams>[];
11
- declare const defaultReportRegistry: _$_gscdump_engine_report0.ReportRegistry;
10
+ declare const defaultReportRegistry: import("@gscdump/engine/report").ReportRegistry;
12
11
  /**
13
12
  * `resolveTarget()` — stub day-one resolver. Future versions can wire in
14
13
  * fuzzy matching / embedding similarity / a manifest cache without
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/analysis",
3
3
  "type": "module",
4
- "version": "0.17.5",
4
+ "version": "0.18.1",
5
5
  "description": "GSC analyzers — striking-distance, opportunity, movers, decay, brand, clustering, concentration, seasonality. Pure row-based + DuckDB-native.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -75,9 +75,9 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "drizzle-orm": "^0.45.2",
78
- "@gscdump/engine": "0.17.5",
79
- "@gscdump/engine-gsc-api": "0.17.5",
80
- "gscdump": "0.17.5"
78
+ "@gscdump/engine": "0.18.1",
79
+ "@gscdump/engine-gsc-api": "0.18.1",
80
+ "gscdump": "0.18.1"
81
81
  },
82
82
  "devDependencies": {
83
83
  "vitest": "^4.1.6"