-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
134 lines (122 loc) · 2.75 KB
/
Copy pathtypes.ts
File metadata and controls
134 lines (122 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
export interface RunConfig {
url: string;
name?: string;
outputDir: string;
lang: string;
excludePaths: string[];
forceMap: boolean;
maxPages?: number;
smart?: string;
filter?: string;
condense: boolean;
condenseModel: string;
condenseConcurrency: number;
fabricPattern?: string;
topN: number;
jinaApiKey?: string;
firecrawlApiKey?: string;
llmApiKey?: string;
llmBaseUrl?: string;
}
export interface DiscoveryResult {
urls: string[];
method: DiscoveryMethod;
fullContent?: string;
sitemapUrls?: string[];
partial?: boolean;
metadata: Record<string, string>;
}
export type DiscoveryMethod =
| "llms-full-txt"
| "llms-txt"
| "content-negotiation"
| "md-suffix"
| "rtd-sources"
| "sitemap"
| "link-crawl"
| "firecrawl-map";
export interface PageResult {
url: string;
status: "ok" | "error" | "skipped";
fetchMethod?: FetchMethod;
rawPath?: string;
cleanPath?: string;
error?: string;
wordsBefore?: number;
wordsAfter?: number;
platform?: string;
fetchDurationMs?: number;
flags?: string[];
}
export type FetchMethod =
| "llms-full-txt"
| "content-negotiation"
| "md-suffix"
| "rtd-sources"
| "local-html"
| "jina";
export interface PlatformDetection {
platform: string;
confidence: number;
evidence: string[];
}
export interface CleanResult {
content: string;
removed: string[];
qualityGateFailed: boolean;
}
export interface ValidationReport {
cleanliness: CleanlinessReport;
fidelity: FidelityReport;
coverage: CoverageReport;
}
export interface CleanlinessReport {
totalPages: number;
flaggedPages: number;
flaggedPercent: number;
pages: Array<{
url: string;
noiseHits: number;
fingerprints: string[];
}>;
}
export interface FidelityReport {
totalPages: number;
overStripped: number;
pages: Array<{
url: string;
wordsBefore: number;
wordsAfter: number;
retentionPercent: number;
missingHeadings: string[];
}>;
}
export interface CoverageReport {
discoveredUrls: number;
fetchedPages: number;
fetchPercent: number;
sitemapUrls?: number;
sitemapCoverage?: number;
gaps: string[];
}
export interface RunManifest {
version: string;
url: string;
name: string;
startedAt: string;
completedAt?: string;
discoveryMethod: DiscoveryMethod;
platform: PlatformDetection;
pages: PageResult[];
validation?: ValidationReport;
condenseStats?: { total: number; condensed: number; fallback: number; errors: number; avgReductionPct: number };
tokenEstimate?: number;
qualitySummary?: QualitySummary;
config: Omit<RunConfig, "jinaApiKey" | "firecrawlApiKey" | "llmApiKey" | "llmBaseUrl">;
}
export interface QualitySummary {
total: number;
clean: number;
cleanPct: number;
flagCounts: Record<string, number>;
}