@absolutejs/rag 0.22.0 → 0.22.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/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.22.2 — 2026-09-24
10
+
11
+ ### Fixed
12
+
13
+ - **Replace backtracking HTML app-shell detection with DOM inspection and allow isolated reader clients to fail without in-process parsing** (`readRAGWebpage`, `createWebsiteReaderClient`, `createWebpageReaderClient`)
14
+
15
+ ## 0.22.1 — 2026-09-24
16
+
17
+ ### Fixed
18
+
19
+ - **Retry owned-index initialization after a transient database outage instead of retaining a rejected initialization promise** (`createWebIndex`)
20
+
9
21
  ## 0.22.0 — 2026-09-24
10
22
 
11
23
  ### Added
package/WEB_INDEX.md CHANGED
@@ -104,3 +104,5 @@ Schedule retention of obsolete generations in the host database/storage lifecycl
104
104
  `WEB_INDEX_TEST_DATABASE_URL=... bun test tests/webIndex.test.ts tests/webIndexFlows.test.ts` uses an explicit disposable PostgreSQL database with pgvector. Tests clear the owned-index tables in that database. They cover restart, native retrieval filters, worker fencing, tenant isolation, bounded admission, robots failure, conditional requests, deletion, model-generation isolation, authorization and evidence attribution.
105
105
 
106
106
  `benchmarks/web-index/live.ts --live --output=NEW_PATH` declares four public pages and compares native lexical retrieval with Brave using identical extraction/review settings. It caps the run at eight research searches and sixteen model calls, preserves raw journals and reports cold/first and warm latency samples separately. It requires its own disposable database. Those pages were selected in advance; results are not web-wide or held-out discovery claims. No Exa parity is implied.
107
+
108
+ The final controlled 100-page lifecycle run measured 11.31 ms warm query p50 / 13.36 ms p95, 88.50 ms update-to-query visibility and 37.94 ms takedown-to-confirmation. It uses PostgreSQL 15, simulated public-page responses and deterministic vectors, not external embedding APIs. Run `benchmarks/web-index/lifecycle.ts` with a disposable database and `--output=NEW_PATH` to reproduce; do not generalize those numbers to public network/model latency.
package/changelog.json CHANGED
@@ -2,6 +2,34 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/rag",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "fixed",
9
+ "summary": "Replace backtracking HTML app-shell detection with DOM inspection and allow isolated reader clients to fail without in-process parsing",
10
+ "symbols": [
11
+ "readRAGWebpage",
12
+ "createWebsiteReaderClient",
13
+ "createWebpageReaderClient"
14
+ ]
15
+ }
16
+ ],
17
+ "date": "2026-09-24",
18
+ "version": "0.22.2"
19
+ },
20
+ {
21
+ "changes": [
22
+ {
23
+ "kind": "fixed",
24
+ "summary": "Retry owned-index initialization after a transient database outage instead of retaining a rejected initialization promise",
25
+ "symbols": [
26
+ "createWebIndex"
27
+ ]
28
+ }
29
+ ],
30
+ "date": "2026-09-24",
31
+ "version": "0.22.1"
32
+ },
5
33
  {
6
34
  "changes": [
7
35
  {
@@ -111227,6 +111227,15 @@ var hasIncompleteAppContent = (html) => {
111227
111227
  const text = compact(main.textContent);
111228
111228
  return text.length < 100 || /^(?:loading|please wait)(?:[.\s]|$)/iu.test(text);
111229
111229
  };
111230
+ var hasEmptyAppRoot = (html) => {
111231
+ const { document: document2 } = parseHTML(html);
111232
+ return Array.from(document2.querySelectorAll("div,main,section")).some((element) => {
111233
+ const attributes = Array.from(element.attributes);
111234
+ const id = attributes.find((attribute2) => attribute2.name.toLowerCase() === "id")?.value.toLowerCase();
111235
+ const classes = attributes.find((attribute2) => attribute2.name.toLowerCase() === "class")?.value.toLowerCase().split(/\s+/u) ?? [];
111236
+ return (id !== undefined && ["root", "app", "__next"].includes(id) || classes.includes("todoapp")) && element.children.length === 0 && !element.textContent?.trim();
111237
+ });
111238
+ };
111230
111239
 
111231
111240
  // src/web/text.ts
111232
111241
  var websiteHtmlText = (html) => {
@@ -117855,8 +117864,8 @@ var parseWebsiteServiceResult = (value) => {
117855
117864
  return row;
117856
117865
  };
117857
117866
  var createWebsiteReaderClient = (options) => async (input) => {
117858
- const timeoutMs = options.timeoutMs ?? 85000, reserveMs = options.fallbackReserveMs ?? 15000;
117859
- if (!(reserveMs > 0 && timeoutMs > reserveMs))
117867
+ const timeoutMs = options.timeoutMs ?? 85000, reserveMs = options.fallback ? options.fallbackReserveMs ?? 15000 : 0;
117868
+ if (!(reserveMs >= 0 && timeoutMs > reserveMs))
117860
117869
  throw new Error("Reader deadline must reserve fallback time");
117861
117870
  const signal = AbortSignal.any([
117862
117871
  ...input.signal ? [input.signal] : [],
@@ -117897,6 +117906,15 @@ var createWebsiteReaderClient = (options) => async (input) => {
117897
117906
  return result;
117898
117907
  } catch (error) {
117899
117908
  signal.throwIfAborted();
117909
+ if (!options.fallback)
117910
+ return {
117911
+ status: "error",
117912
+ text: "",
117913
+ error: {
117914
+ code: "reader_unavailable",
117915
+ message: "Website reader unavailable. Retry shortly; no website evidence was retrieved."
117916
+ }
117917
+ };
117900
117918
  const result = parseWebsiteServiceResult(await options.fallback({ ...request, signal }));
117901
117919
  signal.throwIfAborted();
117902
117920
  return {
@@ -117956,7 +117974,7 @@ var titleOf = (html) => {
117956
117974
  const title = /<title\b[^>]*>([\s\S]*?)<\/title>/iu.exec(html)?.[1];
117957
117975
  return title ? prepareRAGDocument({ text: title, format: "html" }).normalizedText : null;
117958
117976
  };
117959
- var isShell = (html, text) => text.length < 300 || hasIncompleteAppContent(html) || /(?:enable|requires?|turn on)\s+javascript|javascript\s+(?:is\s+)?(?:disabled|required)/iu.test(text) || /<(?:div|main|section)[^>]*(?:id=["'](?:root|app|__next)["']|class=["']todoapp["'])[^>]*>\s*<\//iu.test(html);
117977
+ var isShell = (html, text) => text.length < 300 || hasIncompleteAppContent(html) || /(?:enable|requires?|turn on)\s+javascript|javascript\s+(?:is\s+)?(?:disabled|required)/iu.test(text) || hasEmptyAppRoot(html);
117960
117978
  var isChallenge = (text) => /verify (?:that )?you are human|checking your browser|just a moment|enable javascript and cookies to continue|access denied/iu.test(text.slice(0, 1000));
117961
117979
  var readRAGWebpage = async (options) => {
117962
117980
  const attempts = [];
@@ -125413,5 +125431,5 @@ export {
125413
125431
  selectResearchMonitorEvents
125414
125432
  };
125415
125433
 
125416
- //# debugId=9DCC894B3A3B129664756E2164756E21
125434
+ //# debugId=9B57E533D9808F8964756E2164756E21
125417
125435
  //# sourceMappingURL=index.js.map