@absolutejs/rag 0.10.0 → 0.12.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 +20 -0
- package/README.md +52 -0
- package/changelog.json +44 -0
- package/dist/adapter-kit/index.js +39 -3
- package/dist/adapter-kit/index.js.map +3 -3
- package/dist/client/index.js +34 -1
- package/dist/client/index.js.map +2 -2
- package/dist/client/ui.js +34 -1
- package/dist/client/ui.js.map +2 -2
- package/dist/index.js +39 -3
- package/dist/index.js.map +3 -3
- package/dist/manifest.js +34 -1
- package/dist/manifest.js.map +2 -2
- package/dist/presentation/ui.js +34 -1
- package/dist/presentation/ui.js.map +2 -2
- package/dist/quality/quality.js +34 -1
- package/dist/quality/quality.js.map +2 -2
- package/dist/src/web/evidence.d.ts +24 -0
- package/dist/src/web/index.d.ts +52 -0
- package/dist/src/web/playwright.d.ts +9 -0
- package/dist/src/web/transport.d.ts +29 -0
- package/dist/src/web/website.d.ts +52 -0
- package/dist/web/index.js +17985 -0
- package/dist/web/index.js.map +217 -0
- package/dist/web/playwright.js +341 -0
- package/dist/web/playwright.js.map +11 -0
- package/package.json +19 -5
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,26 @@ 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.12.0 — 2026-09-18
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Add bounded multi-page website research with exact page citations, semantic links and image labels, media and caption evidence, redirect chains and explicit coverage limits.**
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Expand website result and renderer contracts with semantic evidence, redirect hops and explicit readiness/coverage metadata; existing renderers may omit the new optional renderer fields.** (`WebFetchResult`, `WebReadResult`, `WebRenderer`, `readRAGWebpage`, `createPlaywrightWebRenderer`)
|
|
18
|
+
|
|
19
|
+
## 0.11.0 — 2026-09-18
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **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`)
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **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`)
|
|
28
|
+
|
|
9
29
|
## 0.10.0 — 2026-09-16
|
|
10
30
|
|
|
11
31
|
### Added
|
package/README.md
CHANGED
|
@@ -125,3 +125,55 @@ 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.
|
|
165
|
+
|
|
166
|
+
### Research related website pages with attributable evidence
|
|
167
|
+
|
|
168
|
+
`readRAGWebsite` from `@absolutejs/rag/web` reads a supplied URL and up to three
|
|
169
|
+
relevant same-origin customer, services and company pages by default. Pass the
|
|
170
|
+
optional Playwright renderer as for `readRAGWebpage`. `maxPages: 1` retains a
|
|
171
|
+
single-page read; `mode: "browser"` retries content missed by static extraction.
|
|
172
|
+
Results attribute text to exact page URLs and retain per-page redirects,
|
|
173
|
+
retrieval attempts, semantic image labels, link destinations, media URLs and
|
|
174
|
+
available caption text. Coverage includes unvisited relevant links and deadline
|
|
175
|
+
limits. HTTP redirects carry their actual status; client navigation is labeled
|
|
176
|
+
separately. Empty image labels are not proof of an absent client list, and media
|
|
177
|
+
URLs are not proof that a video was watched. Consumers must cite source URLs,
|
|
178
|
+
distinguish extracted evidence from inference, and finish the requested research
|
|
179
|
+
without treating a successful page fetch as complete company coverage.
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/rag",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "added",
|
|
9
|
+
"summary": "Add bounded multi-page website research with exact page citations, semantic links and image labels, media and caption evidence, redirect chains and explicit coverage limits."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"kind": "changed",
|
|
13
|
+
"summary": "Expand website result and renderer contracts with semantic evidence, redirect hops and explicit readiness/coverage metadata; existing renderers may omit the new optional renderer fields.",
|
|
14
|
+
"symbols": [
|
|
15
|
+
"WebFetchResult",
|
|
16
|
+
"WebReadResult",
|
|
17
|
+
"WebRenderer",
|
|
18
|
+
"readRAGWebpage",
|
|
19
|
+
"createPlaywrightWebRenderer"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"date": "2026-09-18",
|
|
24
|
+
"version": "0.12.0"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"changes": [
|
|
28
|
+
{
|
|
29
|
+
"kind": "fixed",
|
|
30
|
+
"summary": "Honor HTML response MIME types for extensionless URL ingestion instead of treating website markup as plain text, including XHTML and batch URL loading.",
|
|
31
|
+
"symbols": [
|
|
32
|
+
"loadRAGDocumentFromURL",
|
|
33
|
+
"loadRAGDocumentsFromURLs"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"kind": "added",
|
|
38
|
+
"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.",
|
|
39
|
+
"symbols": [
|
|
40
|
+
"readRAGWebpage",
|
|
41
|
+
"createPlaywrightWebRenderer",
|
|
42
|
+
"fetchPublicWebResource"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"date": "2026-09-18",
|
|
47
|
+
"version": "0.11.0"
|
|
48
|
+
},
|
|
5
49
|
{
|
|
6
50
|
"changes": [
|
|
7
51
|
{
|
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
12
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
20
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (canCache)
|
|
31
|
+
cache.set(mod, to);
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3
35
|
var __returnValue = (v) => v;
|
|
4
36
|
function __exportSetter(name, newValue) {
|
|
5
37
|
this[name] = __returnValue.bind(null, newValue);
|
|
@@ -13,6 +45,7 @@ var __export = (target, all) => {
|
|
|
13
45
|
set: __exportSetter.bind(all, name)
|
|
14
46
|
});
|
|
15
47
|
};
|
|
48
|
+
var __require = import.meta.require;
|
|
16
49
|
|
|
17
50
|
// src/quality/quality.ts
|
|
18
51
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -14971,6 +15004,9 @@ var inferFormatFromName = (value) => {
|
|
|
14971
15004
|
};
|
|
14972
15005
|
var inferFormatFromContentType = (contentType) => {
|
|
14973
15006
|
const normalizedType = (contentType || "").toLowerCase();
|
|
15007
|
+
if (normalizedType.includes("html")) {
|
|
15008
|
+
return "html";
|
|
15009
|
+
}
|
|
14974
15010
|
if (normalizedType.includes("xml")) {
|
|
14975
15011
|
return "xml";
|
|
14976
15012
|
}
|
|
@@ -19683,7 +19719,7 @@ var loadRAGDocumentFromURL = async (input) => {
|
|
|
19683
19719
|
contentType: input.contentType ?? response.headers.get("content-type") ?? undefined,
|
|
19684
19720
|
data,
|
|
19685
19721
|
extractorRegistry: input.extractorRegistry,
|
|
19686
|
-
format: input.format ?? inferFormatFromUrl(url),
|
|
19722
|
+
format: input.format ?? inferFormatFromContentType(input.contentType ?? response.headers.get("content-type")) ?? inferFormatFromUrl(url),
|
|
19687
19723
|
metadata: input.metadata,
|
|
19688
19724
|
name: basename(new URL(url).pathname),
|
|
19689
19725
|
source: input.source ?? url,
|
|
@@ -19731,7 +19767,7 @@ var loadRAGDocumentsFromURLs = async (input) => {
|
|
|
19731
19767
|
contentType: urlInput.contentType ?? response.headers.get("content-type") ?? undefined,
|
|
19732
19768
|
data,
|
|
19733
19769
|
extractorRegistry: urlInput.extractorRegistry ?? input.extractorRegistry,
|
|
19734
|
-
format: urlInput.format ?? inferFormatFromUrl(url),
|
|
19770
|
+
format: urlInput.format ?? inferFormatFromContentType(urlInput.contentType ?? response.headers.get("content-type")) ?? inferFormatFromUrl(url),
|
|
19735
19771
|
metadata: urlInput.metadata,
|
|
19736
19772
|
name: basename(new URL(url).pathname),
|
|
19737
19773
|
source: urlInput.source ?? url,
|
|
@@ -31414,5 +31450,5 @@ export {
|
|
|
31414
31450
|
summarizeSQLiteCandidateCoverage
|
|
31415
31451
|
};
|
|
31416
31452
|
|
|
31417
|
-
//# debugId=
|
|
31453
|
+
//# debugId=77D38FB1F044066A64756E2164756E21
|
|
31418
31454
|
//# sourceMappingURL=index.js.map
|