polite-crawler 0.1.2 → 0.1.3
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 +533 -8
- package/build/cli-daemon--cTmq0Z5.mjs +38 -0
- package/build/cli-daemon--cTmq0Z5.mjs.map +1 -0
- package/build/cli.mjs +288 -20
- package/build/cli.mjs.map +1 -1
- package/build/{open-Ca1lcWR3.d.mts → daemon-DP4EqjFL.d.mts} +913 -16
- package/build/daemon-fZTE24P5.mjs +515 -0
- package/build/daemon-fZTE24P5.mjs.map +1 -0
- package/build/{diff-Dk2eSvi-.mjs → diff-NQcQqKe9.mjs} +2 -2
- package/build/{diff-Dk2eSvi-.mjs.map → diff-NQcQqKe9.mjs.map} +1 -1
- package/build/{extract-DcwNrTK7.mjs → extract-ByFfc8Zk.mjs} +2 -2
- package/build/{extract-DcwNrTK7.mjs.map → extract-ByFfc8Zk.mjs.map} +1 -1
- package/build/hours.d.mts +26 -0
- package/build/hours.mjs +48 -1
- package/build/hours.mjs.map +1 -1
- package/build/index.d.mts +491 -11
- package/build/index.mjs +898 -9
- package/build/index.mjs.map +1 -0
- package/build/loopback-C_QYowSf.mjs +22 -0
- package/build/loopback-C_QYowSf.mjs.map +1 -0
- package/build/mcp.d.mts +158 -2
- package/build/mcp.mjs +567 -18
- package/build/mcp.mjs.map +1 -1
- package/build/ollama-BJxkjny4.mjs +160 -0
- package/build/ollama-BJxkjny4.mjs.map +1 -0
- package/build/{open-DnrWgkC0.mjs → open-C4fhXJgD.mjs} +1404 -21
- package/build/open-C4fhXJgD.mjs.map +1 -0
- package/build/{runtime-k8mo1_7U.mjs → runtime-JToRO63o.mjs} +3 -3
- package/build/{runtime-k8mo1_7U.mjs.map → runtime-JToRO63o.mjs.map} +1 -1
- package/build/transformers-BQMlaGj4.mjs +133 -0
- package/build/transformers-BQMlaGj4.mjs.map +1 -0
- package/build/{duration-iIuMMofi.mjs → version-ntbY-6wh.mjs} +10 -10
- package/build/version-ntbY-6wh.mjs.map +1 -0
- package/build/{wacz-sfOLT8e9.mjs → wacz-BFNG42Kt.mjs} +3 -3
- package/build/{wacz-sfOLT8e9.mjs.map → wacz-BFNG42Kt.mjs.map} +1 -1
- package/build/{warc-VIPscWxY.mjs → warc-CVS0t1fW.mjs} +2 -2
- package/build/{warc-VIPscWxY.mjs.map → warc-CVS0t1fW.mjs.map} +1 -1
- package/package.json +10 -2
- package/build/duration-iIuMMofi.mjs.map +0 -1
- package/build/open-DnrWgkC0.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "polite-crawler",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"mcpName": "io.github.mark1russell7/polite-crawler",
|
|
6
6
|
"description": "A polite web crawler for research and AI agents. It fetches a source once, keeps it, and reads it many times: robots.txt obeyed, one request per site, full-text search, an MCP server.",
|
|
7
7
|
"keywords": [
|
|
@@ -103,20 +103,28 @@
|
|
|
103
103
|
"zod": "^4.6.6"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
+
"@huggingface/transformers": "^3.0.0 || ^4.0.0",
|
|
106
107
|
"playwright-core": ">=1.40"
|
|
107
108
|
},
|
|
108
109
|
"peerDependenciesMeta": {
|
|
110
|
+
"@huggingface/transformers": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
109
113
|
"playwright-core": {
|
|
110
114
|
"optional": true
|
|
111
115
|
}
|
|
112
116
|
},
|
|
113
117
|
"devDependencies": {
|
|
118
|
+
"@huggingface/transformers": "^4.3.1",
|
|
114
119
|
"@mark1russell7/cue": "github:mark1russell7/cue",
|
|
115
120
|
"@types/node": "^22.19.0",
|
|
121
|
+
"@types/turndown": "^5.0.6",
|
|
116
122
|
"@vitest/coverage-v8": "5.0.3",
|
|
117
123
|
"fast-check": "^4.10.2",
|
|
124
|
+
"gpt-tokenizer": "^4.0.3",
|
|
118
125
|
"playwright-core": "^1.64.0",
|
|
119
126
|
"tsdown": "^0.23.1",
|
|
127
|
+
"turndown": "^7.2.4",
|
|
120
128
|
"typescript": "^7.0.2",
|
|
121
129
|
"vitest": "^5.0.3"
|
|
122
130
|
},
|
|
@@ -128,7 +136,7 @@
|
|
|
128
136
|
"test": "vitest run",
|
|
129
137
|
"test:watch": "vitest",
|
|
130
138
|
"test:coverage": "vitest run --coverage",
|
|
131
|
-
"typecheck": "tsc -p tsconfig.json --noEmit --emitDeclarationOnly false && tsc -p tsconfig.test.json"
|
|
139
|
+
"typecheck": "tsc -p tsconfig.json --noEmit --emitDeclarationOnly false && tsc -p tsconfig.test.json && tsc -p eval/tsconfig.json"
|
|
132
140
|
},
|
|
133
141
|
"types": "./build/index.d.mts"
|
|
134
142
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duration-iIuMMofi.mjs","names":[],"sources":["../src/version.ts","../src/duration.ts"],"sourcesContent":["/** This is the version of the package. A test makes sure that it agrees with `package.json`. */\nexport const VERSION = \"0.1.2\";\n\n/** This is the product token that robots.txt rules match when an application gives no token. */\nexport const DEFAULT_TOKEN = \"PoliteCrawler\";\n\n/** This page tells a site owner what the crawler is and how to control it. */\nexport const BOT_PAGE = \"https://mark1russell7.github.io/crawler/bot/\";\n","/** A duration is a count of milliseconds, or a text, for example `\"30m\"`, `\"24h\"` or `\"7d\"`. */\nexport type Duration = number | string;\n\nconst UNITS: Readonly<Record<string, number>> = {\n ms: 1,\n s: 1000,\n m: 60_000,\n h: 3_600_000,\n d: 86_400_000,\n w: 604_800_000,\n};\n\n/**\n * This function changes a duration into milliseconds. The units are `ms`, `s`, `m` (minutes), `h`,\n * `d` and `w`, in any case. The unit `M` is an error, because a month is not a unit. A bare `0`\n * is zero. The function throws an error for a text that it cannot read.\n */\nexport const durationMs = (duration: Duration): number => {\n if (typeof duration === \"number\") {\n if (!Number.isFinite(duration) || duration < 0)\n throw new Error(`not a duration: ${String(duration)}`);\n return duration;\n }\n if (/^\\s*0+(\\.0+)?\\s*$/.test(duration)) return 0;\n const match = /^\\s*(\\d+(?:\\.\\d+)?)\\s*(ms|s|m|h|d|w)\\s*$/i.exec(duration);\n const unit = match?.[2];\n const factor = unit === undefined || unit === \"M\" ? undefined : UNITS[unit.toLowerCase()];\n if (match === null || factor === undefined) {\n throw new Error(\n `not a duration: \"${duration}\" (write a number and ms, s, m, h, d or w; m is minutes)`,\n );\n }\n return Number(match[1]) * factor;\n};\n"],"mappings":";;AACA,MAAa,UAAU;;AAGvB,MAAa,gBAAgB;;AAG7B,MAAa,WAAW;;;ACJxB,MAAM,QAA0C;CAC9C,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;;;;;;AAOA,MAAa,cAAc,aAA+B;CACxD,IAAI,OAAO,aAAa,UAAU;EAChC,IAAI,CAAC,OAAO,SAAS,QAAQ,KAAK,WAAW,GAC3C,MAAM,IAAI,MAAM,mBAAmB,OAAO,QAAQ,GAAG;EACvD,OAAO;CACT;CACA,IAAI,oBAAoB,KAAK,QAAQ,GAAG,OAAO;CAC/C,MAAM,QAAQ,4CAA4C,KAAK,QAAQ;CACvE,MAAM,OAAO,QAAQ;CACrB,MAAM,SAAS,SAAS,KAAA,KAAa,SAAS,MAAM,KAAA,IAAY,MAAM,KAAK,YAAY;CACvF,IAAI,UAAU,QAAQ,WAAW,KAAA,GAC/B,MAAM,IAAI,MACR,oBAAoB,SAAS,yDAC/B;CAEF,OAAO,OAAO,MAAM,EAAE,IAAI;AAC5B"}
|