polite-crawler 0.7.0 → 0.7.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.
Files changed (33) hide show
  1. package/README.md +2 -1
  2. package/build/{cli-daemon-Bke7kU1e.mjs → cli-daemon-KjIlGd_Q.mjs} +2 -2
  3. package/build/{cli-daemon-Bke7kU1e.mjs.map → cli-daemon-KjIlGd_Q.mjs.map} +1 -1
  4. package/build/{cli-recipes-CUFd9ORK.mjs → cli-recipes-BVz-P6q0.mjs} +2 -2
  5. package/build/{cli-recipes-CUFd9ORK.mjs.map → cli-recipes-BVz-P6q0.mjs.map} +1 -1
  6. package/build/cli.mjs +7 -7
  7. package/build/{daemon-Dh32XlZq.mjs → daemon-CF2st2kh.mjs} +56 -14
  8. package/build/daemon-CF2st2kh.mjs.map +1 -0
  9. package/build/{diff-ZEIt8xv3.mjs → diff-BsYl-M4P.mjs} +2 -2
  10. package/build/{diff-ZEIt8xv3.mjs.map → diff-BsYl-M4P.mjs.map} +1 -1
  11. package/build/{extract-B_Tsv1UC.mjs → extract-CP3VLyJh.mjs} +2 -2
  12. package/build/{extract-B_Tsv1UC.mjs.map → extract-CP3VLyJh.mjs.map} +1 -1
  13. package/build/index.d.mts +11 -5
  14. package/build/index.mjs +10 -10
  15. package/build/{open-Dx1gCR6l.mjs → open-DE3mCat8.mjs} +86 -900
  16. package/build/open-DE3mCat8.mjs.map +1 -0
  17. package/build/{recipe-BO3V_1Kr.mjs → recipe-D2758Xqp.mjs} +3 -3
  18. package/build/{recipe-BO3V_1Kr.mjs.map → recipe-D2758Xqp.mjs.map} +1 -1
  19. package/build/{recipe-product-BOQMCTGh.mjs → recipe-product-DZsncwAl.mjs} +35 -8
  20. package/build/recipe-product-DZsncwAl.mjs.map +1 -0
  21. package/build/{runtime-BVC7iOG4.mjs → runtime-DMem_UuO.mjs} +803 -16
  22. package/build/runtime-DMem_UuO.mjs.map +1 -0
  23. package/build/{version-DxUGcHQr.mjs → version-J_JYtS-2.mjs} +2 -2
  24. package/build/{version-DxUGcHQr.mjs.map → version-J_JYtS-2.mjs.map} +1 -1
  25. package/build/{wacz-DjgklRod.mjs → wacz-DoeRTqqi.mjs} +3 -3
  26. package/build/{wacz-DjgklRod.mjs.map → wacz-DoeRTqqi.mjs.map} +1 -1
  27. package/build/{warc-CgkNdXyG.mjs → warc-5f582tZO.mjs} +2 -2
  28. package/build/{warc-CgkNdXyG.mjs.map → warc-5f582tZO.mjs.map} +1 -1
  29. package/package.json +4 -3
  30. package/build/daemon-Dh32XlZq.mjs.map +0 -1
  31. package/build/open-Dx1gCR6l.mjs.map +0 -1
  32. package/build/recipe-product-BOQMCTGh.mjs.map +0 -1
  33. package/build/runtime-BVC7iOG4.mjs.map +0 -1
package/build/index.d.mts CHANGED
@@ -1150,7 +1150,8 @@ export declare class DocIndex implements ReadingIndex {
1150
1150
  private stmt;
1151
1151
  /**
1152
1152
  * This method does a write in one transaction. A transaction in progress takes the write in,
1153
- * also a transaction that the caller opened on the connection.
1153
+ * also a transaction that the caller opened on the connection. The write is then a savepoint of
1154
+ * that transaction.
1154
1155
  */
1155
1156
  private write;
1156
1157
  private generation;
@@ -3229,7 +3230,10 @@ export declare const runRecipe: <Input>(target: RecipeTarget, recipe: Recipe<Inp
3229
3230
  *
3230
3231
  * A scheduler of the operator starts `watch.run`, or the daemon (`startDaemon`) starts it on a schedule.
3231
3232
  */
3232
- /** This value is the version of the schema of `watch.sqlite`. */
3233
+ /**
3234
+ * This value is the version of the schema of `watch.sqlite` (`PRAGMA user_version`): the count of the
3235
+ * steps of the schema. A file of a later version keeps its number, and the store works on it.
3236
+ */
3233
3237
  export declare const WATCH_SCHEMA = 1;
3234
3238
  /** These are the defaults and the limits of the watch list. */
3235
3239
  export declare const WATCH_LIMITS: {
@@ -3573,7 +3577,7 @@ export declare class WatchStore {
3573
3577
  */
3574
3578
  export declare const runWatch: (runtime: CrawlRuntime, source: WatchStore | (() => Promise<WatchStore>), options?: WatchRunnerOptions) => WatchRun;
3575
3579
  /** This is the version of the package. A test makes sure that it agrees with `package.json`. */
3576
- export declare const VERSION = "0.7.0";
3580
+ export declare const VERSION = "0.7.2";
3577
3581
  /** This is the product token that robots.txt rules match when an application gives no token. */
3578
3582
  export declare const DEFAULT_TOKEN = "PoliteCrawler";
3579
3583
  /** This page tells a site owner what the crawler is and how to control it. */
@@ -4180,8 +4184,10 @@ interface Daemon {
4180
4184
  * and checks the watch list on a schedule (`scheduleWatches`). It writes each change event as one
4181
4185
  * JSON line, and it gives each change to `onChange`. The state file tells `daemon status` what runs.
4182
4186
  *
4183
- * Only one daemon operates on a store: a second start rejects. At `SIGINT` or `SIGTERM`, the daemon
4184
- * stops cleanly (`stop`). A second signal aborts the checks at once.
4187
+ * Only one daemon operates on a store. The daemon holds the lock file `<store>/daemon/lock` until it
4188
+ * stops. A second start rejects, also a start at the same moment in a different process. A lock
4189
+ * of a process that stopped is stale, and the next start removes it. At `SIGINT` or `SIGTERM`, the
4190
+ * daemon stops cleanly (`stop`). A second signal aborts the checks at once.
4185
4191
  */
4186
4192
  export declare const startDaemon: (options: DaemonOptions) => Promise<Daemon>;
4187
4193
  /**
package/build/index.mjs CHANGED
@@ -1,23 +1,23 @@
1
1
  import { n as FileBlobStore, t as CaptureLog } from "./log-CB5bADmd.mjs";
2
2
  import { t as browserMissing } from "./browser-C_dFMvO3.mjs";
3
- import { c as startDaemon, i as daemonStateFile, n as DAEMON_STATE_SCHEMA, o as readDaemonState, r as changeCommand, s as scheduleWatches, t as DAEMON_DEFAULTS } from "./daemon-Dh32XlZq.mjs";
4
- import { A as DEADLINE_NOTE, F as EgressRefused, I as egressLookup, M as makeRecord, O as CAPTURE_SCHEMA, S as readPdf, T as locate, _ as archivedDocId, a as fetchPage, c as isHeldBack, d as recordOverride, f as reindex, h as archiveExtractor, i as fetchAndIndex, j as DEFAULT_SECRET_PARAMS, k as Crawler, l as isoTime, m as versionAtTime, n as HELD_BACK, o as findDocuments, p as verifyQuote, r as catchUpIndex, s as heldBackMeta, t as Extractors, u as readDocument, x as isPdf } from "./runtime-BVC7iOG4.mjs";
5
- import { a as formatDiff, n as diffDocument, r as diffTexts, t as DIFF_LIMITS } from "./diff-ZEIt8xv3.mjs";
6
- import { A as NO_EMBEDDER, C as DISCOVER_LIMITS, D as readSitemap, E as feedDate, O as DocIndex, S as crawlSite, T as SITEMAP_LIMITS, _ as estimateTokens, b as SqliteHostStateStore, c as WatchStore, d as VectorStore, f as createHybridSearch, g as chunkTokensOf, h as chunkText, i as openCrawler, k as FAST_RANK_SHARE, l as runWatch, m as HYBRID_DEFAULTS, n as defaultUserAgent, o as WATCH_LIMITS, p as CHUNK_LIMITS, r as isMailbox, s as WATCH_SCHEMA, t as createRuntime, u as VECTORS_SCHEMA, v as fuseRanks, w as discoverSite, x as CRAWL_LIMITS, y as unitVector } from "./open-Dx1gCR6l.mjs";
3
+ import { c as startDaemon, i as daemonStateFile, n as DAEMON_STATE_SCHEMA, o as readDaemonState, r as changeCommand, s as scheduleWatches, t as DAEMON_DEFAULTS } from "./daemon-CF2st2kh.mjs";
4
+ import { C as DocIndex, F as makeRecord, M as Crawler, N as DEADLINE_NOTE, O as locate, P as DEFAULT_SECRET_PARAMS, R as EgressRefused, S as readPdf, T as NO_EMBEDDER, _ as archivedDocId, a as fetchPage, c as isHeldBack, d as recordOverride, f as reindex, h as archiveExtractor, i as fetchAndIndex, j as CAPTURE_SCHEMA, l as isoTime, m as versionAtTime, n as HELD_BACK, o as findDocuments, p as verifyQuote, r as catchUpIndex, s as heldBackMeta, t as Extractors, u as readDocument, w as FAST_RANK_SHARE, x as isPdf, z as egressLookup } from "./runtime-DMem_UuO.mjs";
5
+ import { a as formatDiff, n as diffDocument, r as diffTexts, t as DIFF_LIMITS } from "./diff-BsYl-M4P.mjs";
6
+ import { C as DISCOVER_LIMITS, D as readSitemap, E as feedDate, S as crawlSite, T as SITEMAP_LIMITS, _ as estimateTokens, b as SqliteHostStateStore, c as WatchStore, d as VectorStore, f as createHybridSearch, g as chunkTokensOf, h as chunkText, i as openCrawler, l as runWatch, m as HYBRID_DEFAULTS, n as defaultUserAgent, o as WATCH_LIMITS, p as CHUNK_LIMITS, r as isMailbox, s as WATCH_SCHEMA, t as createRuntime, u as VECTORS_SCHEMA, v as fuseRanks, w as discoverSite, x as CRAWL_LIMITS, y as unitVector } from "./open-DE3mCat8.mjs";
7
7
  import { i as ollamaEmbedder, n as OLLAMA_MODELS, r as isLoopback, t as NO_OLLAMA } from "./ollama-B7eNmGhl.mjs";
8
8
  import { n as TRANSFORMERS_MODELS, r as transformersEmbedder, t as NO_TRANSFORMERS } from "./transformers-Cb-KaPge.mjs";
9
- import { n as checkFields, r as extractDocument, t as FIELD_KINDS } from "./extract-B_Tsv1UC.mjs";
9
+ import { n as checkFields, r as extractDocument, t as FIELD_KINDS } from "./extract-CP3VLyJh.mjs";
10
10
  import { DAYS, compareHours, describeWeek, disagreements, fromCompact, fromSchemaOrg, fromText, toHoursWeek } from "./hours.mjs";
11
11
  import { extractPage, typesOf } from "./html.mjs";
12
12
  import { DEFAULT_POLICY, MemoryHostStateStore, VALIDATOR_MEMO, nextValidatorMemo, realClock } from "./politeness.mjs";
13
- import { a as readJson, i as defineRecipe, n as RESERVED_RECIPES, o as registerRecipe, s as runRecipe, t as RECIPE_LIMITS } from "./recipe-BO3V_1Kr.mjs";
14
- import { a as readAmount, c as locationMatches, d as readVenue, f as venueReadingsOf, i as productOf, l as namesVenue, n as pickProduct, o as readProduct, r as pickVariant, s as VENUE_LIMITS, t as PRODUCT_LIMITS, u as rankHoursLinks } from "./recipe-product-BOQMCTGh.mjs";
13
+ import { a as readJson, i as defineRecipe, n as RESERVED_RECIPES, o as registerRecipe, s as runRecipe, t as RECIPE_LIMITS } from "./recipe-D2758Xqp.mjs";
14
+ import { a as readAmount, c as locationMatches, d as readVenue, f as venueReadingsOf, i as productOf, l as namesVenue, n as pickProduct, o as readProduct, r as pickVariant, s as VENUE_LIMITS, t as PRODUCT_LIMITS, u as rankHoursLinks } from "./recipe-product-DZsncwAl.mjs";
15
15
  import { n as RenderRefused, r as playwrightRenderer, t as NO_PLAYWRIGHT } from "./render-B0NrFDkJ.mjs";
16
16
  import { ALLOW_ALL, decide, parseRobots } from "./robots.mjs";
17
17
  import { bodyEncoding, decodeBody } from "./text.mjs";
18
18
  import { cacheKeyOf, canonicalUrl, siteOf } from "./urls.mjs";
19
- import { i as durationMs, n as DEFAULT_TOKEN, r as VERSION, t as BOT_PAGE } from "./version-DxUGcHQr.mjs";
19
+ import { i as durationMs, n as DEFAULT_TOKEN, r as VERSION, t as BOT_PAGE } from "./version-J_JYtS-2.mjs";
20
20
  import { i as keyDirectory, n as KEY_DIRECTORY_TYPE, o as verifySignature, r as createWebBotAuthSigner, t as KEY_DIRECTORY_PATH } from "./webbotauth-DbiWmibz.mjs";
21
- import { t as exportWacz } from "./wacz-DjgklRod.mjs";
22
- import { n as exportWarc } from "./warc-CgkNdXyG.mjs";
21
+ import { t as exportWacz } from "./wacz-DoeRTqqi.mjs";
22
+ import { n as exportWarc } from "./warc-5f582tZO.mjs";
23
23
  export { ALLOW_ALL, BOT_PAGE, CAPTURE_SCHEMA, CHUNK_LIMITS, CRAWL_LIMITS, CaptureLog, Crawler, DAEMON_DEFAULTS, DAEMON_STATE_SCHEMA, DAYS, DEADLINE_NOTE, DEFAULT_POLICY, DEFAULT_SECRET_PARAMS, DEFAULT_TOKEN, DIFF_LIMITS, DISCOVER_LIMITS, DocIndex, EgressRefused, Extractors, FAST_RANK_SHARE, FIELD_KINDS, FileBlobStore, HELD_BACK, HYBRID_DEFAULTS, KEY_DIRECTORY_PATH, KEY_DIRECTORY_TYPE, MemoryHostStateStore, NO_EMBEDDER, NO_OLLAMA, NO_PLAYWRIGHT, NO_TRANSFORMERS, OLLAMA_MODELS, PRODUCT_LIMITS, RECIPE_LIMITS, RESERVED_RECIPES, RenderRefused, SITEMAP_LIMITS, SqliteHostStateStore, TRANSFORMERS_MODELS, VALIDATOR_MEMO, VECTORS_SCHEMA, VENUE_LIMITS, VERSION, VectorStore, WATCH_LIMITS, WATCH_SCHEMA, WatchStore, archiveExtractor, archivedDocId, bodyEncoding, browserMissing, cacheKeyOf, canonicalUrl, catchUpIndex, changeCommand, checkFields, chunkText, chunkTokensOf, compareHours, crawlSite, createHybridSearch, createRuntime, createWebBotAuthSigner, daemonStateFile, decide, decodeBody, defaultUserAgent, defineRecipe, describeWeek, diffDocument, diffTexts, disagreements, discoverSite, durationMs, egressLookup, estimateTokens, exportWacz, exportWarc, extractDocument, extractPage, feedDate, fetchAndIndex, fetchPage, findDocuments, formatDiff, fromCompact, fromSchemaOrg, fromText, fuseRanks, heldBackMeta, isHeldBack, isLoopback, isMailbox, isPdf, isoTime, keyDirectory, locate, locationMatches, makeRecord, namesVenue, nextValidatorMemo, ollamaEmbedder, openCrawler, parseRobots, pickProduct, pickVariant, playwrightRenderer, productOf, rankHoursLinks, readAmount, readDaemonState, readDocument, readJson, readPdf, readProduct, readSitemap, readVenue, realClock, recordOverride, registerRecipe, reindex, runRecipe, runWatch, scheduleWatches, siteOf, startDaemon, toHoursWeek, transformersEmbedder, typesOf, unitVector, venueReadingsOf, verifyQuote, verifySignature, versionAtTime };