pi-wsearch 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/CHANGELOG.md +0 -62
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-wsearch",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Pi extension: web.search + web.fetch",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,9 +66,9 @@
66
66
  "src/",
67
67
  "README.md",
68
68
  "LICENSE",
69
- "CHANGELOG.md"
69
+ "!CHANGELOG.md"
70
70
  ],
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  }
74
- }
74
+ }
package/CHANGELOG.md DELETED
@@ -1,62 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented in this file.
4
-
5
- ## [Unreleased]
6
-
7
- ### Added
8
-
9
- - Over-cap sections split into addressable `(cont. N)` outline entries; no section tail is ever unreachable.
10
- - Promo/nag blocks (premium upsells, newsletter signups) filtered from outline and section bodies.
11
- - Adjacent verbatim-duplicate paragraphs dropped.
12
- - Headingless pages get a synthesized `(lead)` outline entry.
13
- - Heading-only stub sections (page chrome like "## Latest commit", "### Stars" with no body) dropped — a real section carries prose under its heading.
14
- - GitHub repo pages serve the raw README under the original URL (repo pages are ~90% UI chrome); filename candidates tried in order, graceful fall-through to the normal page path on failure; non-root paths (blob/tree/issues) unaffected.
15
- - Local extraction parity with paid readers: HTML tables → markdown pipe tables (structure preserved instead of flattened to word soup); MathML formulas → embedded TeX when annotated; KaTeX span soup (client-rendered, no TeX source in HTML) dropped instead of linearizing into scrambled fragments.
16
- - News-page hard-sample cleanup: per-line junk filtering (photo credits like "Chip Somodevilla / Getty Images file", orphan "38d ago" card fragments, IE-browser nags, "Skip to Content" links, "FOR SUBSCRIBERS" nags), ALL-CAPS card kickers, empty `##` heading debris, bullet leader-line collapsing, and `<title>`-echo blocks dropped — NBC/CBS-class hub pages now open directly on their story list.
17
- - Broader hard-sample sweep (forums, docs SPAs, helpdesks, recipes, e-commerce): newsletter signup modules ("#### Email Newsletter" + email-field trust lines) dropped; access-notice pages (People Inc-style HTTP 402 with an HTML notice) treated as bot-walls — UA retry + chain fallback, and their notice text can never pass as content.
18
- - Keyless jina reader tier: runs without a key when jina is explicitly named in `WSEARCH_FETCH_CHAIN` (opt-in, rate-limited ~20 req/min); a configured key also enables it.
19
- - Reader backends for kagi (Universal Summarizer — last in chain: lossy summaries never pre-empt full extraction; covers PDFs/office docs/YouTube), TinyFish (Fetch API, free at any balance), serper (Webpage Scrape) and You.com (Contents API) — key-gated, docs-verified contracts.
20
- - Junk list covers social-syndication mirrors (twiscan, twstalker, unrollnow, threadreaderapp, nitter, upd.dev); any numeric `status|thread/<id>` path on any host is junk (uniform rule, no favored-host allowlist).
21
- - `engines_errored` structured field plus `⚠ engines:` diagnostics line on search output; engines with a stable 401/402/403 error are skipped for the rest of the process (memo cleared on `/websearch login|logout`).
22
- - Reader-chain exhaustion now reports every backend's error, not just the last one.
23
- - Intrinsic BM25-flavored lexical rescoring in the fuse stage (title hits 2x, IDF-lite rarity via token length, bounded 0.25 multiplier): single-engine hits with strong query overlap reorder near-ties; multi-engine agreement still dominates. Deterministic, model-free.
24
- - `/websearch` onboarding lists jina's free tier among the cheapest paths.
25
- - Observe-only fetch-through ledger (`wsearch/fetchtrace.jsonl`): search records each result's rank/engine-agreement; a successful first fetch of a search-surfaced URL appends the tuple (query, rank, engines, url). Pure measurement — zero behavior change — the ground-truth layer for judging future ranking changes (top-3 fetch-decision precision).
26
- - URL canonicalization depth-up: paths case-folded and duplicate slashes collapsed (server-equivalent spellings no longer split RRF agreement across "different" URLs).
27
- - Mojibake detection and repair in the byte-decode path: UTF-8-read-as-CP1252 double-encoding (declared charset lies, upstream proxy mangling) is detected by signature density and re-decoded; clean and declared-latin1 pages pass through untouched.
28
- - Stale-if-error cache reserve: expired entries survive as a reserve instead of being purged; when a previously-readable page's live fetch fails (wall tightened, host down), the expired copy is served with a `[STALE — ~Nh old]` title marker rather than an error. `get()` never serves expired copies; the reserve is replaced on overwrite and capped by the LRU cap.
29
- - FineWeb/Gopher repetition gates on extracted text: >30% duplicate lines or >20% repeated unique 5-grams marks the output low-quality (catches link-farms and menu-soup that survive every pattern filter; published thresholds, not invented ones).
30
- - Conditional revalidation (ETag/If-None-Match, Last-Modified/If-Modified-Since): cached copies store their validators; an expired copy revalidates before re-download — a 304 re-marks it fresh for free (local path only; reader-chain results carry no validators).
31
- - Fetched pages now carry `publishedAt` (JSON-LD datePublished → article:published_time meta → <time datetime>, first match wins) and a `paywalled: true` flag when soft-paywall overlay signatures (fc-ab-root, metering-modal, isAccessibleForFree:false) are present — detection only, never bypass.
32
- - GitHub blob URLs (single source files) serve the raw file content under the original URL, same contract as the README preference — the repo-page path buried files under navigation UI.
33
- - Cookie-consent banner boilerplate ("We use cookies to improve…", "By continuing to browse…", "Accept all", "Manage preferences") filtered.
34
- - Page-wide duplicate-paragraph removal: paragraphs repeated verbatim anywhere on a page are dropped from their later occurrences (adjacent-dedupe caught only back-to-back copies; hub pages re-serve card text across sections — pure token waste).
35
- - Accept header prefers `text/markdown` over HTML: sites with server-side content negotiation (agent-readability ecosystem) now hand over their clean markdown rendition; non-negotiating servers ignore the header entirely.
36
- - Zero-result recovery: when a search returns nothing, one automatic retry runs with operators stripped (`site:`, quotes, `-term`) or the rarest term dropped — the agent no longer burns a round-trip to do it manually; the retry is noted in the output.
37
- - `site:` operator normalization: routed to native domain-filter params where supported (tavily `include_domains`, exa `includeDomains`), passed through verbatim for engines with native operator support (serper, brave, kagi) — no more diluting domain-restricted queries into full-web text search.
38
- - Search result titles strip the site-name suffix ("Page Title | Site Name") — display noise and title-token pollution.
39
- - Search results display a normalized date (ISO, from engine date fields incl. relative forms like "3 days ago") when the engine provides one.
40
- - Archive fallback for dead pages: a 404 (dead host, removed docs) tries archive.org's Wayback availability API and serves the snapshot through the normal local path, title-marked `[ARCHIVED copy <date> — live page is gone]`. Doctrine line: 404/dead-host only, never 403-walls; best-effort (lookup failure → plain error as before).
41
-
42
- ### Changed
43
-
44
- - Fetch cache key bumped to `v3` (extraction pipeline shape changed).
45
- - `OUTLINE_CAP` raised from 14 to 20.
46
- - Reader chain default order: jina (free tier) → tinyfish (free at any balance) → firecrawl → tavily → exa → serper → you → kagi (lossy summarizer last).
47
- - Permanent local-failure guard narrowed to 404/oversized/empty: 403 bot-walls now advance to the chain (renderers exist to read them); `r.jina.ai`/`s.jina.ai` proxy URLs never enter the chain.
48
- - Search engines pin `WSEARCH_ENGINES` and readers pin `WSEARCH_FETCH_CHAIN` at runtime as before; chain status display mirrors the new default order.
49
-
50
- ### Fixed
51
-
52
- - `splitSection` infinite loop on space-free runs (base64 blobs, packed table cells) — cut enforces a hard progress floor.
53
- - Dropped tiny preambles (e.g. leaked `<title>` text) no longer shift heading names off by one.
54
- - Reader chain was spent on permanent local failures (404/oversized/empty URLs) — now returns the real status instantly instead of burning paid backends.
55
- - Jina reader gate contradicted its keyless-capable read implementation (blocked keyless reads despite tolerant code) — gate aligned to the explicit opt-in.
56
- - Dead engines (e.g. firecrawl with exhausted credits) dragged every search fan-out ~7s — skipped after the first stable failure.
57
- - `/websearch off|on` withdrew/restored tools at registration only, leaving them declared to the model until a manual reload — the active tool set is now synced via `pi.setActiveTools()` so the change applies on the next model request.
58
- - Fetching `r.jina.ai/<target>` sent paid renderers at a proxy URL (a renderer cannot render a proxy) — now fails fast with the proxy's own status.
59
-
60
- ### Removed
61
-
62
- - `CAP_BREAK_GRACE` boundary heuristic (subsumed by the progress floor).