@j0hanz/superfetch 2.1.0 → 2.1.2
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/README.md +11 -10
- package/dist/cache.js +125 -16
- package/dist/config.d.ts +6 -1
- package/dist/config.js +14 -1
- package/dist/fetch.js +91 -71
- package/dist/http.d.ts +9 -1
- package/dist/http.js +126 -56
- package/dist/instructions.md +66 -0
- package/dist/mcp.js +11 -1
- package/dist/observability.js +1 -1
- package/dist/tools.d.ts +7 -2
- package/dist/tools.js +29 -16
- package/dist/transform.js +714 -409
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +3 -0
- package/dist/workers/transform-worker.js +1 -3
- package/package.json +3 -3
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
package/dist/utils.js
ADDED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { parentPort } from 'node:worker_threads';
|
|
2
2
|
import { FetchError, getErrorMessage } from '../errors.js';
|
|
3
3
|
import { transformHtmlToMarkdownInProcess } from '../transform.js';
|
|
4
|
+
import { isRecord } from '../utils.js';
|
|
4
5
|
const controllers = new Map();
|
|
5
|
-
function isRecord(value) {
|
|
6
|
-
return typeof value === 'object' && value !== null;
|
|
7
|
-
}
|
|
8
6
|
function post(message) {
|
|
9
7
|
parentPort?.postMessage(message);
|
|
10
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@j0hanz/superfetch",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"mcpName": "io.github.j0hanz/superfetch",
|
|
5
5
|
"description": "Intelligent web content fetcher MCP server that converts HTML to clean, AI-readable Markdown",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"superfetch"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "tsc -p tsconfig.build.json && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
|
|
37
|
+
"build": "tsc -p tsconfig.build.json && node -e \"require('fs').copyFileSync('src/instructions.md','dist/instructions.md')\" && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
|
|
38
38
|
"prepare": "npm run build",
|
|
39
39
|
"dev": "tsx watch src/index.ts",
|
|
40
40
|
"start": "node dist/index.js",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"prettier": "^3.7.4",
|
|
76
76
|
"tsx": "^4.21.0",
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
|
-
"typescript-eslint": "^8.
|
|
78
|
+
"typescript-eslint": "^8.53.0"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">=20.18.1"
|