@cosmocoder/mcp-web-docs 2.0.28 → 2.0.29
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/build/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
process.env.CRAWLEE_LOG_LEVEL = 'OFF';
|
|
3
|
-
|
|
3
|
+
// Numeric, not 'OFF': @apify/log looks names up with a truthiness check and LogLevel.OFF
|
|
4
|
+
// is 0, so 'OFF' becomes Number('OFF') = NaN and the Log it builds on import throws.
|
|
5
|
+
// Must stay above the crawlee import — the logger reads this once, when it loads.
|
|
6
|
+
process.env.APIFY_LOG_LEVEL = '0';
|
|
4
7
|
const { log, Configuration } = await import('crawlee');
|
|
5
8
|
log.setLevel(log.LEVELS.OFF);
|
|
6
9
|
Configuration.getGlobalConfig().set('logLevel', 'OFF');
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC;AACtC,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC;AACtC,yFAAyF;AACzF,qFAAqF;AACrF,kFAAkF;AAClF,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC;AAElC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;AACvD,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC7B,aAAa,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CA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EAAE,KAAK,CAAC,CAAC;YACpD,IAAI,CAAC,CAAC,CAAC,CAAC;QACV,CAAC;IACH,CAAC,CAAC,EAAE,CAAC,CAAC;AACR,CAAC;AAED,KAAK,MAAM,MAAM,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAU,EAAE,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
/**
|
|
3
|
+
* Loads the real @apify/log. index.test.ts mocks 'crawlee' wholesale, so it never
|
|
4
|
+
* loads @apify/log and cannot catch a level the logger refuses to parse.
|
|
5
|
+
*
|
|
6
|
+
* The value can't be imported from index.ts — importing it boots the server — so it
|
|
7
|
+
* is read out of the source. That pins what is assigned, not when: scripts/smoke.mjs
|
|
8
|
+
* is what catches the assignment moving below the crawlee import.
|
|
9
|
+
*/
|
|
10
|
+
const source = readFileSync(new URL('./index.ts', import.meta.url), 'utf8');
|
|
11
|
+
const assignments = source.match(/^\s*process\.env\.APIFY_LOG_LEVEL\s*=\s*'[^']*';/gm) ?? [];
|
|
12
|
+
it('sets APIFY_LOG_LEVEL to a level @apify/log accepts', async () => {
|
|
13
|
+
expect(assignments, 'index.ts should assign APIFY_LOG_LEVEL exactly once, as a single-quoted literal').toHaveLength(1);
|
|
14
|
+
// An unparsed match falls back to '', which resolves to INFO and fails the assertion
|
|
15
|
+
process.env.APIFY_LOG_LEVEL = /'([^']*)'/.exec(assignments[0] ?? '')?.[1] ?? '';
|
|
16
|
+
vi.resetModules();
|
|
17
|
+
// Silencing this matters because @apify/log writes INFO through console.log, and
|
|
18
|
+
// stdout carries the MCP JSON-RPC channel
|
|
19
|
+
const { default: log } = await import('@apify/log');
|
|
20
|
+
expect(log.getLevel()).toBe(0);
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.log-level.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.log-level.test.js","sourceRoot":"","sources":["../src/index.log-level.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5E,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,IAAI,EAAE,CAAC;AAE7F,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;IAClE,MAAM,CAAC,WAAW,EAAE,iFAAiF,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAEvH,qFAAqF;IACrF,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChF,EAAE,CAAC,YAAY,EAAE,CAAC;IAElB,iFAAiF;IACjF,0CAA0C;IAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IAEpD,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmocoder/mcp-web-docs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "MCP server for crawling and indexing web documentation - works with any website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsc && chmod +x build/index.js",
|
|
43
43
|
"start": "node build/index.js",
|
|
44
|
+
"smoke": "node scripts/smoke.mjs",
|
|
44
45
|
"dev": "tsc -w",
|
|
45
46
|
"lint": "eslint . --ext .js,.ts",
|
|
46
47
|
"lint:fix": "npm run lint -- --fix",
|