aem-live-docs-mcp 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +163 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +45 -0
- package/dist/config.js.map +1 -0
- package/dist/content.d.ts +16 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +239 -0
- package/dist/content.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +606 -0
- package/dist/index.js.map +1 -0
- package/dist/sitemap.d.ts +32 -0
- package/dist/sitemap.d.ts.map +1 -0
- package/dist/sitemap.js +475 -0
- package/dist/sitemap.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface DocEntry {
|
|
2
|
+
url: string;
|
|
3
|
+
path: string;
|
|
4
|
+
pathSegments: string[];
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
section: string;
|
|
8
|
+
lastmod: string;
|
|
9
|
+
deprecation: string;
|
|
10
|
+
labs: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SearchResult {
|
|
13
|
+
entry: DocEntry;
|
|
14
|
+
score: number;
|
|
15
|
+
snippet: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function extractSection(path: string): string;
|
|
18
|
+
export declare function levenshtein(a: string, b: string): number;
|
|
19
|
+
export declare function expandWithSynonyms(terms: string[]): string[];
|
|
20
|
+
export declare function clearCache(): Promise<void>;
|
|
21
|
+
export declare function loadIndex(): Promise<DocEntry[]>;
|
|
22
|
+
/**
|
|
23
|
+
* BM25-scored full-text search with synonym expansion and fuzzy fallback.
|
|
24
|
+
* The description field is included in scoring, so richer matches surface
|
|
25
|
+
* better results than the dev-docs MCP which only had URL paths.
|
|
26
|
+
*/
|
|
27
|
+
export declare function searchEntries(entries: DocEntry[], query: string, limit?: number): SearchResult[];
|
|
28
|
+
export declare function getDocSections(entries: DocEntry[]): Map<string, number>;
|
|
29
|
+
export declare function getSectionSlugs(entries: DocEntry[]): string[];
|
|
30
|
+
export declare function getSectionEntries(entries: DocEntry[], section: string): DocEntry[];
|
|
31
|
+
export declare function getRelatedDocs(entries: DocEntry[], url: string, limit?: number): DocEntry[];
|
|
32
|
+
//# sourceMappingURL=sitemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../src/sitemap.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAgJD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAiHD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBxD;AAiBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAa5D;AAiED,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAMhD;AAID,wBAAsB,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAarD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,QAAQ,EAAE,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,MAAW,GACjB,YAAY,EAAE,CA8FhB;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAOvE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CAE7D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAElF;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,QAAQ,EAAE,EACnB,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAAW,GACjB,QAAQ,EAAE,CAgBZ"}
|
package/dist/sitemap.js
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import { readFile, writeFile, mkdir, stat, unlink } from "node:fs/promises";
|
|
2
|
+
import { config } from "./config.js";
|
|
3
|
+
// --- AEM-audience synonym map for query expansion ---
|
|
4
|
+
//
|
|
5
|
+
// Tuned for the kinds of queries developers, authors, and operators run
|
|
6
|
+
// against the AEM live docs.
|
|
7
|
+
const SYNONYM_MAP = {
|
|
8
|
+
// AEM concepts
|
|
9
|
+
aem: ["adobe", "helix", "franklin", "eds"],
|
|
10
|
+
helix: ["aem", "franklin"],
|
|
11
|
+
franklin: ["aem", "helix"],
|
|
12
|
+
eds: ["edge", "delivery", "aem"],
|
|
13
|
+
"edge-delivery": ["eds", "aem"],
|
|
14
|
+
// authoring
|
|
15
|
+
authoring: ["author", "sidekick", "word", "docs"],
|
|
16
|
+
author: ["authoring", "publish", "preview"],
|
|
17
|
+
sidekick: ["toolbar", "publish", "preview", "authoring"],
|
|
18
|
+
publish: ["author", "sidekick", "preview"],
|
|
19
|
+
preview: ["sidekick", "author", "publish"],
|
|
20
|
+
// blocks
|
|
21
|
+
block: ["blocks", "component", "section"],
|
|
22
|
+
blocks: ["block", "component"],
|
|
23
|
+
component: ["block"],
|
|
24
|
+
section: ["block", "blocks"],
|
|
25
|
+
// performance
|
|
26
|
+
lighthouse: ["performance", "score", "100"],
|
|
27
|
+
performance: ["lighthouse", "score", "speed", "lcp", "cls"],
|
|
28
|
+
score: ["lighthouse", "performance"],
|
|
29
|
+
lcp: ["performance", "lighthouse"],
|
|
30
|
+
cls: ["performance", "lighthouse"],
|
|
31
|
+
// CDN
|
|
32
|
+
cdn: ["cloudflare", "fastly", "akamai", "cloudfront", "delivery"],
|
|
33
|
+
cloudflare: ["cdn"],
|
|
34
|
+
fastly: ["cdn"],
|
|
35
|
+
akamai: ["cdn"],
|
|
36
|
+
cloudfront: ["cdn", "aws"],
|
|
37
|
+
aws: ["cloudfront", "cdn"],
|
|
38
|
+
// content sources
|
|
39
|
+
sharepoint: ["word", "microsoft", "onedrive"],
|
|
40
|
+
"google-drive": ["google", "docs", "googledrive"],
|
|
41
|
+
googledrive: ["google-drive", "google", "docs"],
|
|
42
|
+
word: ["sharepoint", "microsoft"],
|
|
43
|
+
// developer
|
|
44
|
+
tutorial: ["getting-started", "setup", "guide"],
|
|
45
|
+
"getting-started": ["tutorial", "setup"],
|
|
46
|
+
setup: ["tutorial", "getting-started", "install", "configure"],
|
|
47
|
+
// markup
|
|
48
|
+
markup: ["html", "dom", "sections", "blocks"],
|
|
49
|
+
html: ["markup", "dom"],
|
|
50
|
+
dom: ["markup", "html"],
|
|
51
|
+
// redirect
|
|
52
|
+
redirect: ["redirects", "url", "404"],
|
|
53
|
+
redirects: ["redirect"],
|
|
54
|
+
// sitemap
|
|
55
|
+
sitemap: ["robots", "seo", "index"],
|
|
56
|
+
robots: ["sitemap"],
|
|
57
|
+
seo: ["sitemap", "performance", "lighthouse"],
|
|
58
|
+
// localization
|
|
59
|
+
localization: ["i18n", "l10n", "translation", "locale"],
|
|
60
|
+
translation: ["localization", "i18n"],
|
|
61
|
+
i18n: ["localization", "translation"],
|
|
62
|
+
// spreadsheets
|
|
63
|
+
spreadsheet: ["excel", "sheets", "json", "data"],
|
|
64
|
+
excel: ["spreadsheet", "sheets"],
|
|
65
|
+
sheets: ["spreadsheet", "excel", "google"],
|
|
66
|
+
// indexing
|
|
67
|
+
indexing: ["index", "query", "search"],
|
|
68
|
+
index: ["indexing", "query"],
|
|
69
|
+
query: ["indexing", "search"],
|
|
70
|
+
// push invalidation
|
|
71
|
+
invalidation: ["purge", "cache", "cdn"],
|
|
72
|
+
purge: ["invalidation", "cache"],
|
|
73
|
+
cache: ["cdn", "purge", "invalidation"],
|
|
74
|
+
// metadata
|
|
75
|
+
metadata: ["meta", "seo", "frontmatter"],
|
|
76
|
+
meta: ["metadata"],
|
|
77
|
+
frontmatter: ["metadata"],
|
|
78
|
+
// placeholder
|
|
79
|
+
placeholder: ["placeholders", "variable", "string"],
|
|
80
|
+
placeholders: ["placeholder"],
|
|
81
|
+
// security
|
|
82
|
+
security: ["auth", "authentication", "csp"],
|
|
83
|
+
auth: ["security", "authentication"],
|
|
84
|
+
authentication: ["auth", "security", "login"],
|
|
85
|
+
csp: ["security"],
|
|
86
|
+
// github
|
|
87
|
+
github: ["repo", "code", "repository"],
|
|
88
|
+
repo: ["github", "repository"],
|
|
89
|
+
// project
|
|
90
|
+
project: ["boilerplate", "repo", "github", "setup"],
|
|
91
|
+
boilerplate: ["project", "template"],
|
|
92
|
+
// importer
|
|
93
|
+
importer: ["import", "migrate", "migration"],
|
|
94
|
+
import: ["importer", "migrate"],
|
|
95
|
+
migrate: ["importer", "import", "migration"],
|
|
96
|
+
// forms
|
|
97
|
+
forms: ["form", "input", "submit"],
|
|
98
|
+
form: ["forms", "input"],
|
|
99
|
+
// universal editor
|
|
100
|
+
"universal-editor": ["ue", "aem-authoring", "cms"],
|
|
101
|
+
ue: ["universal-editor"],
|
|
102
|
+
// experimentation
|
|
103
|
+
experimentation: ["experiment", "ab-test", "testing"],
|
|
104
|
+
experiment: ["experimentation", "ab-test"],
|
|
105
|
+
// favicon
|
|
106
|
+
favicon: ["icon", "browser"],
|
|
107
|
+
// fragments
|
|
108
|
+
fragment: ["fragments", "reuse", "include"],
|
|
109
|
+
fragments: ["fragment"],
|
|
110
|
+
};
|
|
111
|
+
// --- Index state ---
|
|
112
|
+
let invertedIndex = new Map();
|
|
113
|
+
let indexedEntries = [];
|
|
114
|
+
let docLengths = [];
|
|
115
|
+
let avgDocLength = 1;
|
|
116
|
+
// --- Path / URL helpers ---
|
|
117
|
+
function isDocPath(path) {
|
|
118
|
+
return config.docPathPrefixes.some((p) => path.startsWith(p));
|
|
119
|
+
}
|
|
120
|
+
export function extractSection(path) {
|
|
121
|
+
const parts = path.split("/").filter(Boolean);
|
|
122
|
+
return parts[0] || "root";
|
|
123
|
+
}
|
|
124
|
+
function pathToTitle(item) {
|
|
125
|
+
if (item.title && item.title.trim())
|
|
126
|
+
return item.title.trim();
|
|
127
|
+
// Fall back to humanising the last path segment
|
|
128
|
+
const segs = item.path.split("/").filter(Boolean);
|
|
129
|
+
return segs[segs.length - 1]
|
|
130
|
+
?.replace(/-/g, " ")
|
|
131
|
+
.replace(/\b\w/g, (c) => c.toUpperCase()) ?? item.path;
|
|
132
|
+
}
|
|
133
|
+
// --- Fetch query-index with pagination ---
|
|
134
|
+
async function fetchQueryIndex() {
|
|
135
|
+
const pageSize = 500;
|
|
136
|
+
let offset = 0;
|
|
137
|
+
let total = 0;
|
|
138
|
+
const allItems = [];
|
|
139
|
+
do {
|
|
140
|
+
const url = `${config.queryIndexUrl}?limit=${pageSize}&offset=${offset}`;
|
|
141
|
+
const res = await fetch(url, {
|
|
142
|
+
headers: { "User-Agent": config.userAgent },
|
|
143
|
+
});
|
|
144
|
+
if (!res.ok)
|
|
145
|
+
throw new Error(`HTTP ${res.status} fetching ${url}`);
|
|
146
|
+
const json = await res.json();
|
|
147
|
+
total = json.total;
|
|
148
|
+
allItems.push(...json.data);
|
|
149
|
+
offset += json.data.length;
|
|
150
|
+
} while (offset < total);
|
|
151
|
+
// Filter to only doc paths and convert to DocEntry
|
|
152
|
+
const seen = new Set();
|
|
153
|
+
const entries = [];
|
|
154
|
+
for (const item of allItems) {
|
|
155
|
+
const path = item.path.replace(/\/$/, ""); // strip trailing slash
|
|
156
|
+
if (!isDocPath(path))
|
|
157
|
+
continue;
|
|
158
|
+
if (seen.has(path))
|
|
159
|
+
continue;
|
|
160
|
+
seen.add(path);
|
|
161
|
+
const section = extractSection(path);
|
|
162
|
+
const pathSegments = path
|
|
163
|
+
.split("/")
|
|
164
|
+
.filter(Boolean)
|
|
165
|
+
.map((s) => s.replace(/-/g, " ").toLowerCase());
|
|
166
|
+
const lastmod = item.lastModified
|
|
167
|
+
? new Date(parseInt(item.lastModified, 10) * 1000)
|
|
168
|
+
.toISOString()
|
|
169
|
+
.slice(0, 10)
|
|
170
|
+
: "";
|
|
171
|
+
entries.push({
|
|
172
|
+
url: `${config.baseUrl}${path}`,
|
|
173
|
+
path,
|
|
174
|
+
pathSegments,
|
|
175
|
+
title: pathToTitle(item),
|
|
176
|
+
description: item.description || "",
|
|
177
|
+
section,
|
|
178
|
+
lastmod,
|
|
179
|
+
deprecation: item.deprecation || "",
|
|
180
|
+
labs: item.labs || "",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
return entries;
|
|
184
|
+
}
|
|
185
|
+
// --- Tokenization & index building ---
|
|
186
|
+
function tokenize(text) {
|
|
187
|
+
return text
|
|
188
|
+
.toLowerCase()
|
|
189
|
+
.split(/[\s/\-_>.,]+/)
|
|
190
|
+
.filter((t) => t.length > 1);
|
|
191
|
+
}
|
|
192
|
+
function buildInvertedIndex(entries) {
|
|
193
|
+
const index = new Map();
|
|
194
|
+
const lengths = new Array(entries.length);
|
|
195
|
+
let totalLength = 0;
|
|
196
|
+
for (let i = 0; i < entries.length; i++) {
|
|
197
|
+
const entry = entries[i];
|
|
198
|
+
const tokens = new Set([
|
|
199
|
+
...tokenize(entry.path),
|
|
200
|
+
...entry.pathSegments,
|
|
201
|
+
...tokenize(entry.title),
|
|
202
|
+
...tokenize(entry.description),
|
|
203
|
+
]);
|
|
204
|
+
lengths[i] = tokens.size;
|
|
205
|
+
totalLength += tokens.size;
|
|
206
|
+
for (const token of tokens) {
|
|
207
|
+
let set = index.get(token);
|
|
208
|
+
if (!set) {
|
|
209
|
+
set = new Set();
|
|
210
|
+
index.set(token, set);
|
|
211
|
+
}
|
|
212
|
+
set.add(i);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
docLengths = lengths;
|
|
216
|
+
avgDocLength = entries.length > 0 ? totalLength / entries.length : 1;
|
|
217
|
+
return index;
|
|
218
|
+
}
|
|
219
|
+
// --- Fuzzy matching (Levenshtein) ---
|
|
220
|
+
export function levenshtein(a, b) {
|
|
221
|
+
if (a === b)
|
|
222
|
+
return 0;
|
|
223
|
+
if (a.length === 0)
|
|
224
|
+
return b.length;
|
|
225
|
+
if (b.length === 0)
|
|
226
|
+
return a.length;
|
|
227
|
+
let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
228
|
+
let curr = new Array(b.length + 1);
|
|
229
|
+
for (let i = 1; i <= a.length; i++) {
|
|
230
|
+
curr[0] = i;
|
|
231
|
+
for (let j = 1; j <= b.length; j++) {
|
|
232
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
233
|
+
curr[j] = Math.min(prev[j] + 1, curr[j - 1] + 1, prev[j - 1] + cost);
|
|
234
|
+
}
|
|
235
|
+
[prev, curr] = [curr, prev];
|
|
236
|
+
}
|
|
237
|
+
return prev[b.length];
|
|
238
|
+
}
|
|
239
|
+
function findFuzzyMatches(term, maxDist = 2) {
|
|
240
|
+
const matches = new Set();
|
|
241
|
+
if (term.length < 4)
|
|
242
|
+
return matches;
|
|
243
|
+
for (const [key, indices] of invertedIndex) {
|
|
244
|
+
if (Math.abs(key.length - term.length) > maxDist)
|
|
245
|
+
continue;
|
|
246
|
+
if (levenshtein(term, key) <= maxDist) {
|
|
247
|
+
for (const idx of indices)
|
|
248
|
+
matches.add(idx);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return matches;
|
|
252
|
+
}
|
|
253
|
+
// --- Synonym expansion ---
|
|
254
|
+
export function expandWithSynonyms(terms) {
|
|
255
|
+
const expanded = new Set(terms);
|
|
256
|
+
for (const term of terms) {
|
|
257
|
+
const syns = SYNONYM_MAP[term];
|
|
258
|
+
if (syns) {
|
|
259
|
+
for (const s of syns) {
|
|
260
|
+
for (const t of s.split(/\s+/)) {
|
|
261
|
+
if (t.length > 1)
|
|
262
|
+
expanded.add(t);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return Array.from(expanded);
|
|
268
|
+
}
|
|
269
|
+
// --- BM25 helpers ---
|
|
270
|
+
function getDocFrequency(term) {
|
|
271
|
+
let df = 0;
|
|
272
|
+
for (const [key, indices] of invertedIndex) {
|
|
273
|
+
if (key.includes(term))
|
|
274
|
+
df += indices.size;
|
|
275
|
+
}
|
|
276
|
+
return Math.min(df, indexedEntries.length);
|
|
277
|
+
}
|
|
278
|
+
function computeIDF(term, N) {
|
|
279
|
+
const df = getDocFrequency(term);
|
|
280
|
+
if (df === 0)
|
|
281
|
+
return 0;
|
|
282
|
+
return Math.log((N - df + 0.5) / (df + 0.5) + 1);
|
|
283
|
+
}
|
|
284
|
+
function buildSnippet(entry, terms) {
|
|
285
|
+
// Prefer a description snippet if it contains the search term
|
|
286
|
+
if (entry.description) {
|
|
287
|
+
const lowerDesc = entry.description.toLowerCase();
|
|
288
|
+
if (terms.some((t) => lowerDesc.includes(t))) {
|
|
289
|
+
return entry.description.length > 160
|
|
290
|
+
? entry.description.slice(0, 157) + "..."
|
|
291
|
+
: entry.description;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const segments = entry.path.split("/").filter(Boolean).slice(1);
|
|
295
|
+
const matched = [];
|
|
296
|
+
for (const seg of segments) {
|
|
297
|
+
const low = seg.toLowerCase();
|
|
298
|
+
if (terms.some((t) => low.includes(t))) {
|
|
299
|
+
matched.push(seg.replace(/-/g, " "));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return matched.length > 0
|
|
303
|
+
? `Matched in: ${matched.join(" > ")}`
|
|
304
|
+
: entry.description.slice(0, 120) || `Path: ${entry.path}`;
|
|
305
|
+
}
|
|
306
|
+
// --- Disk cache ---
|
|
307
|
+
async function loadFromCache() {
|
|
308
|
+
try {
|
|
309
|
+
const info = await stat(config.indexCacheFile);
|
|
310
|
+
if (Date.now() - info.mtimeMs > config.indexCacheTtlMs)
|
|
311
|
+
return null;
|
|
312
|
+
const data = await readFile(config.indexCacheFile, "utf-8");
|
|
313
|
+
const entries = JSON.parse(data);
|
|
314
|
+
return entries.length > 0 ? entries : null;
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
async function saveToCache(entries) {
|
|
321
|
+
try {
|
|
322
|
+
await mkdir(config.cacheDir, { recursive: true });
|
|
323
|
+
await writeFile(config.indexCacheFile, JSON.stringify(entries), "utf-8");
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
// non-critical
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
export async function clearCache() {
|
|
330
|
+
try {
|
|
331
|
+
await unlink(config.indexCacheFile);
|
|
332
|
+
}
|
|
333
|
+
catch {
|
|
334
|
+
// file may not exist
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// --- Public API ---
|
|
338
|
+
export async function loadIndex() {
|
|
339
|
+
const cached = await loadFromCache();
|
|
340
|
+
if (cached) {
|
|
341
|
+
indexedEntries = cached;
|
|
342
|
+
invertedIndex = buildInvertedIndex(cached);
|
|
343
|
+
return cached;
|
|
344
|
+
}
|
|
345
|
+
const entries = await fetchQueryIndex();
|
|
346
|
+
await saveToCache(entries);
|
|
347
|
+
indexedEntries = entries;
|
|
348
|
+
invertedIndex = buildInvertedIndex(entries);
|
|
349
|
+
return entries;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* BM25-scored full-text search with synonym expansion and fuzzy fallback.
|
|
353
|
+
* The description field is included in scoring, so richer matches surface
|
|
354
|
+
* better results than the dev-docs MCP which only had URL paths.
|
|
355
|
+
*/
|
|
356
|
+
export function searchEntries(entries, query, limit = 20) {
|
|
357
|
+
const rawTerms = query
|
|
358
|
+
.toLowerCase()
|
|
359
|
+
.split(/\s+/)
|
|
360
|
+
.filter((t) => t.length > 0);
|
|
361
|
+
if (rawTerms.length === 0) {
|
|
362
|
+
return entries.slice(0, limit).map((entry) => ({ entry, score: 0, snippet: "" }));
|
|
363
|
+
}
|
|
364
|
+
const allTerms = expandWithSynonyms(rawTerms);
|
|
365
|
+
const useIndex = entries === indexedEntries && invertedIndex.size > 0;
|
|
366
|
+
const N = entries.length;
|
|
367
|
+
const k1 = 1.5;
|
|
368
|
+
const b = 0.75;
|
|
369
|
+
let candidateIndices = null;
|
|
370
|
+
if (useIndex) {
|
|
371
|
+
candidateIndices = new Set();
|
|
372
|
+
for (const term of allTerms) {
|
|
373
|
+
for (const [key, indices] of invertedIndex) {
|
|
374
|
+
if (key.includes(term)) {
|
|
375
|
+
for (const idx of indices)
|
|
376
|
+
candidateIndices.add(idx);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
for (const term of rawTerms) {
|
|
381
|
+
let hasExact = false;
|
|
382
|
+
for (const [key] of invertedIndex) {
|
|
383
|
+
if (key.includes(term)) {
|
|
384
|
+
hasExact = true;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
if (!hasExact) {
|
|
389
|
+
for (const idx of findFuzzyMatches(term))
|
|
390
|
+
candidateIndices.add(idx);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const pool = useIndex && candidateIndices
|
|
395
|
+
? Array.from(candidateIndices).map((i) => ({ entry: entries[i], idx: i }))
|
|
396
|
+
: entries.map((entry, idx) => ({ entry, idx }));
|
|
397
|
+
const scored = [];
|
|
398
|
+
for (const { entry, idx } of pool) {
|
|
399
|
+
const pathLower = entry.path.toLowerCase();
|
|
400
|
+
const titleLower = entry.title.toLowerCase();
|
|
401
|
+
const descLower = entry.description.toLowerCase();
|
|
402
|
+
const lastSeg = entry.pathSegments[entry.pathSegments.length - 1] || "";
|
|
403
|
+
const dl = useIndex ? (docLengths[idx] || 1) : entry.pathSegments.length;
|
|
404
|
+
let score = 0;
|
|
405
|
+
let matchedOriginal = 0;
|
|
406
|
+
for (const term of allTerms) {
|
|
407
|
+
const inPath = pathLower.includes(term);
|
|
408
|
+
const inTitle = titleLower.includes(term);
|
|
409
|
+
const inSegs = entry.pathSegments.some((s) => s.includes(term));
|
|
410
|
+
const inDesc = descLower.includes(term);
|
|
411
|
+
if (!inPath && !inTitle && !inSegs && !inDesc)
|
|
412
|
+
continue;
|
|
413
|
+
const idf = useIndex ? computeIDF(term, N) : 1;
|
|
414
|
+
let tf = 0;
|
|
415
|
+
if (inTitle)
|
|
416
|
+
tf += 2; // title matches weighted higher
|
|
417
|
+
if (inPath)
|
|
418
|
+
tf++;
|
|
419
|
+
if (inSegs)
|
|
420
|
+
tf++;
|
|
421
|
+
if (inDesc)
|
|
422
|
+
tf++;
|
|
423
|
+
const tfNorm = (tf * (k1 + 1)) / (tf + k1 * (1 - b + (b * dl) / avgDocLength));
|
|
424
|
+
score += idf * tfNorm;
|
|
425
|
+
if (lastSeg.includes(term))
|
|
426
|
+
score += idf * 0.5;
|
|
427
|
+
if (rawTerms.includes(term))
|
|
428
|
+
matchedOriginal++;
|
|
429
|
+
}
|
|
430
|
+
// Boost deprecated pages down slightly
|
|
431
|
+
if (entry.deprecation)
|
|
432
|
+
score *= 0.7;
|
|
433
|
+
if (matchedOriginal >= rawTerms.length && rawTerms.length > 1) {
|
|
434
|
+
score *= 2;
|
|
435
|
+
}
|
|
436
|
+
if (score > 0) {
|
|
437
|
+
scored.push({ entry, score, snippet: buildSnippet(entry, rawTerms) });
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
scored.sort((a, b) => b.score - a.score);
|
|
441
|
+
return scored.slice(0, limit);
|
|
442
|
+
}
|
|
443
|
+
export function getDocSections(entries) {
|
|
444
|
+
const sections = new Map();
|
|
445
|
+
for (const entry of entries) {
|
|
446
|
+
if (!entry.section)
|
|
447
|
+
continue;
|
|
448
|
+
sections.set(entry.section, (sections.get(entry.section) || 0) + 1);
|
|
449
|
+
}
|
|
450
|
+
return sections;
|
|
451
|
+
}
|
|
452
|
+
export function getSectionSlugs(entries) {
|
|
453
|
+
return [...getDocSections(entries).keys()].sort();
|
|
454
|
+
}
|
|
455
|
+
export function getSectionEntries(entries, section) {
|
|
456
|
+
return entries.filter((e) => e.section === section);
|
|
457
|
+
}
|
|
458
|
+
export function getRelatedDocs(entries, url, limit = 10) {
|
|
459
|
+
const target = entries.find((e) => e.url === url);
|
|
460
|
+
if (!target)
|
|
461
|
+
return [];
|
|
462
|
+
const targetParts = target.path.split("/").filter(Boolean);
|
|
463
|
+
if (targetParts.length < 2)
|
|
464
|
+
return [];
|
|
465
|
+
const parentPath = targetParts.slice(0, -1).join("/");
|
|
466
|
+
return entries
|
|
467
|
+
.filter((e) => {
|
|
468
|
+
if (e.url === url)
|
|
469
|
+
return false;
|
|
470
|
+
const parts = e.path.split("/").filter(Boolean);
|
|
471
|
+
return parts.slice(0, -1).join("/") === parentPath;
|
|
472
|
+
})
|
|
473
|
+
.slice(0, limit);
|
|
474
|
+
}
|
|
475
|
+
//# sourceMappingURL=sitemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../src/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAyCrC,uDAAuD;AACvD,EAAE;AACF,wEAAwE;AAC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M,CAAC,CAAC,CAAC,EAAE,EAAE;QACZ,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC;QAChC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,UAAU,CAAC;IACrD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACrB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aem-live-docs-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for searching Adobe Experience Manager (AEM) documentation at aem.live. Provides AI assistants with tools to search, browse, and read official AEM guides — developer tutorials, authoring, CDN setup, blocks, Edge Delivery Services, Sidekick, performance, and more.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"aem-live-docs-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"prepublishOnly": "npm run build",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"start:http": "node dist/index.js --http",
|
|
20
|
+
"dev": "tsx src/index.ts",
|
|
21
|
+
"dev:http": "tsx src/index.ts --http",
|
|
22
|
+
"test": "tsx --test tests/*.test.ts"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"mcp",
|
|
26
|
+
"model-context-protocol",
|
|
27
|
+
"aem",
|
|
28
|
+
"adobe-experience-manager",
|
|
29
|
+
"edge-delivery-services",
|
|
30
|
+
"aem-live",
|
|
31
|
+
"documentation",
|
|
32
|
+
"blocks",
|
|
33
|
+
"sidekick",
|
|
34
|
+
"ai",
|
|
35
|
+
"cursor",
|
|
36
|
+
"claude"
|
|
37
|
+
],
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"author": "Jigar Karangiya",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/jigarkkarangiya/aem-live-docs-mcp"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/jigarkkarangiya/aem-live-docs-mcp#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/jigarkkarangiya/aem-live-docs-mcp/issues"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18.0.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
53
|
+
"fast-xml-parser": "^5.2.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^22.0.0",
|
|
57
|
+
"tsx": "^4.19.0",
|
|
58
|
+
"typescript": "^5.7.0"
|
|
59
|
+
}
|
|
60
|
+
}
|