@absolutejs/rag 0.10.0 → 0.11.0

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,16 @@ 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.11.0 — 2026-09-18
10
+
11
+ ### Added
12
+
13
+ - **Add a bounded public website reader with prepared evidence, per-attempt diagnostics, automatic JavaScript rendering through an optional Playwright adapter, isolated browser contexts and DNS-pinned public-only resource fetching.** (`readRAGWebpage`, `createPlaywrightWebRenderer`, `fetchPublicWebResource`)
14
+
15
+ ### Fixed
16
+
17
+ - **Honor HTML response MIME types for extensionless URL ingestion instead of treating website markup as plain text, including XHTML and batch URL loading.** (`loadRAGDocumentFromURL`, `loadRAGDocumentsFromURLs`)
18
+
9
19
  ## 0.10.0 — 2026-09-16
10
20
 
11
21
  ### Added
package/README.md CHANGED
@@ -125,3 +125,40 @@ it. Only encode server-owned original-text tool results. References are not
125
125
  access controls or durable source IDs: reauthorize and validate restored quotes
126
126
  against the originals before saving a result. This is opt-in; it does not change
127
127
  the original-text tools, stored originals or their existing result format.
128
+
129
+ ### Public websites and JavaScript rendering
130
+
131
+ `loadRAGDocumentFromURL` loads a document; use `prepareRAGDocument(doc).normalizedText`
132
+ for readable text. URL loading now honors response MIME types on extensionless URLs.
133
+ For public websites, `@absolutejs/rag/web` provides `readRAGWebpage` with bounded
134
+ responses, timeouts, prepared text, final URL, title, truncation and per-attempt
135
+ retrieval diagnostics. It tries static HTML first and requests a browser for thin
136
+ or empty application shells. A missing renderer returns `rendering_required`,
137
+ not a claim that the website contains no information.
138
+
139
+ ```ts
140
+ import { readRAGWebpage } from '@absolutejs/rag/web';
141
+ import { createPlaywrightWebRenderer } from '@absolutejs/rag/web/playwright';
142
+
143
+ const browser = createPlaywrightWebRenderer();
144
+ try {
145
+ const page = await readRAGWebpage({
146
+ url: 'https://example.com',
147
+ render: browser.render,
148
+ });
149
+ // Check page.status and page.error before treating page.text as complete evidence.
150
+ } finally {
151
+ await browser.close();
152
+ }
153
+ ```
154
+
155
+ The browser adapter requires the optional `playwright-core` peer and an installed
156
+ Chromium browser (`playwright-core install --with-deps chromium`). Hosts should
157
+ run it in a separate unprivileged process, limit concurrency, and apply memory
158
+ limits. Contexts do not share cookies; service workers and WebSockets are blocked.
159
+ HTTP resources and redirect hops use validated public destinations with the DNS
160
+ answer pinned to each connection. Browser resource counts and response sizes are
161
+ bounded. The reader does not bypass login, CAPTCHA or access restrictions, and
162
+ reports these failures separately from incomplete rendering. A page read is not
163
+ a crawl of every page on a domain. Host-supplied renderers/fetch implementations
164
+ must enforce equivalent network controls.
package/changelog.json CHANGED
@@ -2,6 +2,29 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/rag",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "fixed",
9
+ "summary": "Honor HTML response MIME types for extensionless URL ingestion instead of treating website markup as plain text, including XHTML and batch URL loading.",
10
+ "symbols": [
11
+ "loadRAGDocumentFromURL",
12
+ "loadRAGDocumentsFromURLs"
13
+ ]
14
+ },
15
+ {
16
+ "kind": "added",
17
+ "summary": "Add a bounded public website reader with prepared evidence, per-attempt diagnostics, automatic JavaScript rendering through an optional Playwright adapter, isolated browser contexts and DNS-pinned public-only resource fetching.",
18
+ "symbols": [
19
+ "readRAGWebpage",
20
+ "createPlaywrightWebRenderer",
21
+ "fetchPublicWebResource"
22
+ ]
23
+ }
24
+ ],
25
+ "date": "2026-09-18",
26
+ "version": "0.11.0"
27
+ },
5
28
  {
6
29
  "changes": [
7
30
  {
@@ -14971,6 +14971,9 @@ var inferFormatFromName = (value) => {
14971
14971
  };
14972
14972
  var inferFormatFromContentType = (contentType) => {
14973
14973
  const normalizedType = (contentType || "").toLowerCase();
14974
+ if (normalizedType.includes("html")) {
14975
+ return "html";
14976
+ }
14974
14977
  if (normalizedType.includes("xml")) {
14975
14978
  return "xml";
14976
14979
  }
@@ -19683,7 +19686,7 @@ var loadRAGDocumentFromURL = async (input) => {
19683
19686
  contentType: input.contentType ?? response.headers.get("content-type") ?? undefined,
19684
19687
  data,
19685
19688
  extractorRegistry: input.extractorRegistry,
19686
- format: input.format ?? inferFormatFromUrl(url),
19689
+ format: input.format ?? inferFormatFromContentType(input.contentType ?? response.headers.get("content-type")) ?? inferFormatFromUrl(url),
19687
19690
  metadata: input.metadata,
19688
19691
  name: basename(new URL(url).pathname),
19689
19692
  source: input.source ?? url,
@@ -19731,7 +19734,7 @@ var loadRAGDocumentsFromURLs = async (input) => {
19731
19734
  contentType: urlInput.contentType ?? response.headers.get("content-type") ?? undefined,
19732
19735
  data,
19733
19736
  extractorRegistry: urlInput.extractorRegistry ?? input.extractorRegistry,
19734
- format: urlInput.format ?? inferFormatFromUrl(url),
19737
+ format: urlInput.format ?? inferFormatFromContentType(urlInput.contentType ?? response.headers.get("content-type")) ?? inferFormatFromUrl(url),
19735
19738
  metadata: urlInput.metadata,
19736
19739
  name: basename(new URL(url).pathname),
19737
19740
  source: urlInput.source ?? url,
@@ -31414,5 +31417,5 @@ export {
31414
31417
  summarizeSQLiteCandidateCoverage
31415
31418
  };
31416
31419
 
31417
- //# debugId=5D1CC4781115DD5864756E2164756E21
31420
+ //# debugId=9FE93518A40B2B4664756E2164756E21
31418
31421
  //# sourceMappingURL=index.js.map