@gscdump/analysis 0.8.2 → 0.9.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.
@@ -0,0 +1,71 @@
1
+ import * as _$_gscdump_engine_report0 from "@gscdump/engine/report";
2
+ import { DefinedReport, ReportContext, ReportParams, ReportResult } from "@gscdump/engine/report";
3
+ import { AnalyzerRegistry } from "@gscdump/engine/analyzer";
4
+ import { AnalysisQuerySource } from "@gscdump/engine/resolver";
5
+ interface FormatReportOptions {
6
+ /** Cap findings rendered per section. Defaults to all (already bounded by report). */
7
+ maxFindingsPerSection?: number;
8
+ }
9
+ declare function formatReport(report: ReportResult, opts?: FormatReportOptions): string;
10
+ declare const REPORTS: readonly DefinedReport<ReportParams>[];
11
+ declare const defaultReportRegistry: _$_gscdump_engine_report0.ReportRegistry;
12
+ /**
13
+ * `resolveTarget()` — stub day-one resolver. Future versions can wire in
14
+ * fuzzy matching / embedding similarity / a manifest cache without
15
+ * changing the contract.
16
+ *
17
+ * Today: case-insensitive exact match, falling back to substring (LIKE %x%)
18
+ * over a caller-supplied candidate list.
19
+ */
20
+ type ResolveTargetKind = 'page' | 'query';
21
+ interface ResolveTargetInput {
22
+ kind: ResolveTargetKind;
23
+ input: string;
24
+ /**
25
+ * Pool to resolve against. Empty pool ⇒ caller trusts the input verbatim
26
+ * (resolver returns it as `exact`). Useful when the caller doesn't have
27
+ * a candidate list yet but knows the value is correct.
28
+ */
29
+ candidates?: readonly string[];
30
+ }
31
+ interface ResolveTargetResult {
32
+ /** Best exact match from `candidates` (case-insensitive), or trusted input when no candidates were supplied. */
33
+ exact: string | null;
34
+ /** All candidates that include the input as a substring (case-insensitive). Includes `exact` if matched. */
35
+ matches: string[];
36
+ /** True when no candidates matched at all. */
37
+ unresolved: boolean;
38
+ }
39
+ declare function resolveTarget(opts: ResolveTargetInput): ResolveTargetResult;
40
+ interface RunReportOptions<P extends ReportParams = ReportParams> {
41
+ source: AnalysisQuerySource;
42
+ analyzers: AnalyzerRegistry;
43
+ ctx: ReportContext<P>;
44
+ }
45
+ /**
46
+ * Run a defined report against a source. Steps execute in parallel via
47
+ * `Promise.all`. The report's `reduce` is invoked with a results bag that
48
+ * only contains successful steps — sections that depended on a failed step
49
+ * should set their own `coverage: 'partial'` (the runtime additionally
50
+ * marks `meta.degraded` when any step errored).
51
+ */
52
+ declare function runReport<P extends ReportParams = ReportParams>(report: DefinedReport<P>, opts: RunReportOptions<P>): Promise<ReportResult>;
53
+ interface DryRunReportResult {
54
+ steps: {
55
+ key: string;
56
+ type: string;
57
+ estRowsScanned?: number;
58
+ }[];
59
+ windowResolved: {
60
+ start: string;
61
+ end: string;
62
+ days: number;
63
+ };
64
+ }
65
+ /**
66
+ * Plan-only preview. v1 doesn't compute row estimates — analyzer-level
67
+ * cost models don't exist yet — so `estRowsScanned` is left undefined.
68
+ * Useful right now only as an "is this report wired up correctly?" check.
69
+ */
70
+ declare function dryRunReport<P extends ReportParams = ReportParams>(report: DefinedReport<P>, ctx: ReportContext<P>): Promise<DryRunReportResult>;
71
+ export { type DryRunReportResult, type FormatReportOptions, REPORTS, type ResolveTargetInput, type ResolveTargetKind, type ResolveTargetResult, type RunReportOptions, defaultReportRegistry, dryRunReport, formatReport, resolveTarget, runReport };