@arabold/docs-mcp-server 1.31.0 → 1.31.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.
- package/dist/index.js +87 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5269,11 +5269,28 @@ class HtmlPlaywrightMiddleware {
|
|
|
5269
5269
|
logger.debug(`Could not access content frame for iframe ${index + 1}`);
|
|
5270
5270
|
return;
|
|
5271
5271
|
}
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
}
|
|
5275
|
-
|
|
5276
|
-
|
|
5272
|
+
try {
|
|
5273
|
+
await frame.waitForSelector("body", { timeout: DEFAULT_PAGE_TIMEOUT });
|
|
5274
|
+
} catch {
|
|
5275
|
+
logger.debug(
|
|
5276
|
+
`Timeout waiting for body in iframe ${index + 1} - skipping content extraction`
|
|
5277
|
+
);
|
|
5278
|
+
return;
|
|
5279
|
+
}
|
|
5280
|
+
try {
|
|
5281
|
+
await this.waitForLoadingToComplete(frame);
|
|
5282
|
+
} catch {
|
|
5283
|
+
logger.debug(
|
|
5284
|
+
`Timeout waiting for loading indicators in iframe ${index + 1} - proceeding anyway`
|
|
5285
|
+
);
|
|
5286
|
+
}
|
|
5287
|
+
let content = null;
|
|
5288
|
+
try {
|
|
5289
|
+
content = await this.extractIframeContent(frame);
|
|
5290
|
+
} catch (error) {
|
|
5291
|
+
logger.debug(`Error extracting content from iframe ${index + 1}: ${error}`);
|
|
5292
|
+
return;
|
|
5293
|
+
}
|
|
5277
5294
|
if (content && content.trim().length > 0) {
|
|
5278
5295
|
await this.replaceIframeWithContent(page, index, content);
|
|
5279
5296
|
logger.debug(
|
|
@@ -5284,7 +5301,7 @@ class HtmlPlaywrightMiddleware {
|
|
|
5284
5301
|
}
|
|
5285
5302
|
logger.debug(`Successfully loaded iframe ${index + 1}: ${src}`);
|
|
5286
5303
|
} catch (error) {
|
|
5287
|
-
logger.debug(`Error
|
|
5304
|
+
logger.debug(`Error processing iframe ${index + 1}: ${error}`);
|
|
5288
5305
|
}
|
|
5289
5306
|
}
|
|
5290
5307
|
/**
|
|
@@ -5447,23 +5464,31 @@ class HtmlPlaywrightMiddleware {
|
|
|
5447
5464
|
origin,
|
|
5448
5465
|
reqOrigin ?? void 0
|
|
5449
5466
|
);
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5467
|
+
try {
|
|
5468
|
+
const response = await route.fetch({ headers: headers2 });
|
|
5469
|
+
const body = await response.text();
|
|
5470
|
+
if (response.status() >= 200 && response.status() < 300 && body.length > 0) {
|
|
5471
|
+
const contentSizeBytes = Buffer.byteLength(body, "utf8");
|
|
5472
|
+
if (contentSizeBytes <= FETCHER_MAX_CACHE_ITEM_SIZE_BYTES) {
|
|
5473
|
+
const contentType = response.headers()["content-type"] || "application/octet-stream";
|
|
5474
|
+
HtmlPlaywrightMiddleware.resourceCache.set(reqUrl, { body, contentType });
|
|
5475
|
+
logger.debug(
|
|
5476
|
+
`Cached ${resourceType}: ${reqUrl} (${contentSizeBytes} bytes, cache size: ${HtmlPlaywrightMiddleware.resourceCache.size})`
|
|
5477
|
+
);
|
|
5478
|
+
} else {
|
|
5479
|
+
logger.debug(
|
|
5480
|
+
`Resource too large to cache: ${reqUrl} (${contentSizeBytes} bytes > ${FETCHER_MAX_CACHE_ITEM_SIZE_BYTES} bytes limit)`
|
|
5481
|
+
);
|
|
5482
|
+
}
|
|
5464
5483
|
}
|
|
5484
|
+
return route.fulfill({ response });
|
|
5485
|
+
} catch (error) {
|
|
5486
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5487
|
+
logger.debug(
|
|
5488
|
+
`Network error fetching ${resourceType} ${reqUrl}: ${errorMessage}`
|
|
5489
|
+
);
|
|
5490
|
+
return route.abort("failed");
|
|
5465
5491
|
}
|
|
5466
|
-
return route.fulfill({ response });
|
|
5467
5492
|
}
|
|
5468
5493
|
const headers = mergePlaywrightHeaders(
|
|
5469
5494
|
route.request().headers(),
|
|
@@ -5472,7 +5497,13 @@ class HtmlPlaywrightMiddleware {
|
|
|
5472
5497
|
origin,
|
|
5473
5498
|
reqOrigin ?? void 0
|
|
5474
5499
|
);
|
|
5475
|
-
|
|
5500
|
+
try {
|
|
5501
|
+
return await route.continue({ headers });
|
|
5502
|
+
} catch (error) {
|
|
5503
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5504
|
+
logger.debug(`Network error for ${resourceType} ${reqUrl}: ${errorMessage}`);
|
|
5505
|
+
return route.abort("failed");
|
|
5506
|
+
}
|
|
5476
5507
|
});
|
|
5477
5508
|
}
|
|
5478
5509
|
/**
|
|
@@ -5656,23 +5687,31 @@ ${frame.content}
|
|
|
5656
5687
|
origin ?? void 0,
|
|
5657
5688
|
reqOrigin ?? void 0
|
|
5658
5689
|
);
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5690
|
+
try {
|
|
5691
|
+
const response = await route.fetch({ headers: headers2 });
|
|
5692
|
+
const body = await response.text();
|
|
5693
|
+
if (response.status() >= 200 && response.status() < 300 && body.length > 0) {
|
|
5694
|
+
const contentSizeBytes = Buffer.byteLength(body, "utf8");
|
|
5695
|
+
if (contentSizeBytes <= FETCHER_MAX_CACHE_ITEM_SIZE_BYTES) {
|
|
5696
|
+
const contentType2 = response.headers()["content-type"] || "application/octet-stream";
|
|
5697
|
+
HtmlPlaywrightMiddleware.resourceCache.set(reqUrl, { body, contentType: contentType2 });
|
|
5698
|
+
logger.debug(
|
|
5699
|
+
`Cached ${resourceType}: ${reqUrl} (${contentSizeBytes} bytes, cache size: ${HtmlPlaywrightMiddleware.resourceCache.size})`
|
|
5700
|
+
);
|
|
5701
|
+
} else {
|
|
5702
|
+
logger.debug(
|
|
5703
|
+
`Resource too large to cache: ${reqUrl} (${contentSizeBytes} bytes > ${FETCHER_MAX_CACHE_ITEM_SIZE_BYTES} bytes limit)`
|
|
5704
|
+
);
|
|
5705
|
+
}
|
|
5673
5706
|
}
|
|
5707
|
+
return route.fulfill({ response });
|
|
5708
|
+
} catch (error) {
|
|
5709
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5710
|
+
logger.debug(
|
|
5711
|
+
`Network error fetching ${resourceType} ${reqUrl}: ${errorMessage}`
|
|
5712
|
+
);
|
|
5713
|
+
return route.abort("failed");
|
|
5674
5714
|
}
|
|
5675
|
-
return route.fulfill({ response });
|
|
5676
5715
|
}
|
|
5677
5716
|
const headers = mergePlaywrightHeaders(
|
|
5678
5717
|
route.request().headers(),
|
|
@@ -5681,7 +5720,13 @@ ${frame.content}
|
|
|
5681
5720
|
origin ?? void 0,
|
|
5682
5721
|
reqOrigin ?? void 0
|
|
5683
5722
|
);
|
|
5684
|
-
|
|
5723
|
+
try {
|
|
5724
|
+
return await route.continue({ headers });
|
|
5725
|
+
} catch (error) {
|
|
5726
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5727
|
+
logger.debug(`Network error for ${resourceType} ${reqUrl}: ${errorMessage}`);
|
|
5728
|
+
return route.abort("failed");
|
|
5729
|
+
}
|
|
5685
5730
|
});
|
|
5686
5731
|
await page.goto(context.source, { waitUntil: "load" });
|
|
5687
5732
|
await page.waitForSelector("body, frameset", { timeout: DEFAULT_PAGE_TIMEOUT });
|
|
@@ -10692,7 +10737,7 @@ const Layout = ({
|
|
|
10692
10737
|
children,
|
|
10693
10738
|
eventClientConfig
|
|
10694
10739
|
}) => {
|
|
10695
|
-
const versionString = version || "1.31.
|
|
10740
|
+
const versionString = version || "1.31.1";
|
|
10696
10741
|
const versionInitializer = `versionUpdate({ currentVersion: ${`'${versionString}'`} })`;
|
|
10697
10742
|
return /* @__PURE__ */ jsxs("html", { lang: "en", children: [
|
|
10698
10743
|
/* @__PURE__ */ jsxs("head", { children: [
|
|
@@ -13004,7 +13049,7 @@ class AppServer {
|
|
|
13004
13049
|
try {
|
|
13005
13050
|
if (telemetry.isEnabled()) {
|
|
13006
13051
|
telemetry.setGlobalContext({
|
|
13007
|
-
appVersion: "1.31.
|
|
13052
|
+
appVersion: "1.31.1",
|
|
13008
13053
|
appPlatform: process.platform,
|
|
13009
13054
|
appNodeVersion: process.version,
|
|
13010
13055
|
appServicesEnabled: this.getActiveServicesList(),
|
|
@@ -16491,7 +16536,7 @@ function createCliProgram() {
|
|
|
16491
16536
|
const commandStartTimes = /* @__PURE__ */ new Map();
|
|
16492
16537
|
let globalEventBus = null;
|
|
16493
16538
|
let globalTelemetryService = null;
|
|
16494
|
-
program.name("docs-mcp-server").description("Unified CLI, MCP Server, and Web Interface for Docs MCP Server.").version("1.31.
|
|
16539
|
+
program.name("docs-mcp-server").description("Unified CLI, MCP Server, and Web Interface for Docs MCP Server.").version("1.31.1").addOption(
|
|
16495
16540
|
new Option("--verbose", "Enable verbose (debug) logging").conflicts("silent")
|
|
16496
16541
|
).addOption(new Option("--silent", "Disable all logging except errors")).addOption(
|
|
16497
16542
|
new Option("--telemetry", "Enable telemetry collection").env("DOCS_MCP_TELEMETRY").argParser((value) => {
|
|
@@ -16525,7 +16570,7 @@ function createCliProgram() {
|
|
|
16525
16570
|
if (shouldEnableTelemetry()) {
|
|
16526
16571
|
if (telemetry.isEnabled()) {
|
|
16527
16572
|
telemetry.setGlobalContext({
|
|
16528
|
-
appVersion: "1.31.
|
|
16573
|
+
appVersion: "1.31.1",
|
|
16529
16574
|
appPlatform: process.platform,
|
|
16530
16575
|
appNodeVersion: process.version,
|
|
16531
16576
|
appInterface: "cli",
|