@absolutejs/rag 0.9.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 +20 -0
- package/README.md +52 -0
- package/changelog.json +44 -0
- package/dist/adapter-kit/index.js +6 -3
- package/dist/adapter-kit/index.js.map +3 -3
- package/dist/index.js +57 -3
- package/dist/index.js.map +6 -5
- package/dist/src/index.d.ts +1 -0
- package/dist/src/retrieval/quoteReferences.d.ts +13 -0
- package/dist/src/web/index.d.ts +42 -0
- package/dist/src/web/playwright.d.ts +9 -0
- package/dist/src/web/transport.d.ts +22 -0
- package/dist/web/index.js +6741 -0
- package/dist/web/index.js.map +13 -0
- package/dist/web/playwright.js +270 -0
- package/dist/web/playwright.js.map +11 -0
- package/package.json +18 -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.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
|
+
|
|
19
|
+
## 0.10.0 — 2026-09-16
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **Encode retrieved original-text passages as request-scoped quote references and restore exact quotes without rewriting source text** (`createRAGQuoteReferences`)
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **Accept AI 0.2 alongside existing compatible AI releases; validate retrieval against AI 0.2.0** (`ragChat`, `createRAGWorkflow`)
|
|
28
|
+
|
|
9
29
|
## 0.9.0 — 2026-09-16
|
|
10
30
|
|
|
11
31
|
### Breaking
|
package/README.md
CHANGED
|
@@ -110,3 +110,55 @@ saved-source recovery callback when appropriate. Providers without capacity
|
|
|
110
110
|
support require an explicit `contextPolicy: false` raw opt-out. Older supported
|
|
111
111
|
AI peers retain their previous behavior; upgrading RAG alone does not add the AI
|
|
112
112
|
0.1 capacity policy. No model-capacity numbers are defined in RAG.
|
|
113
|
+
|
|
114
|
+
### Reversible quote references
|
|
115
|
+
|
|
116
|
+
`createRAGQuoteReferences()` creates a request-scoped registry for compressing
|
|
117
|
+
already-verified original-text tool results. `encodeToolResult(json)` replaces
|
|
118
|
+
passage text with sentence entries `{ citation, text }`; `resolve(citation)`
|
|
119
|
+
restores the exact registered sentence. Repeated sentences reuse a reference,
|
|
120
|
+
and unknown references throw. Search and single-range read envelopes are
|
|
121
|
+
supported; unrecognized tool results pass through unchanged.
|
|
122
|
+
|
|
123
|
+
Keep the registry alive across prefetch, lookups and completion, then discard
|
|
124
|
+
it. Only encode server-owned original-text tool results. References are not
|
|
125
|
+
access controls or durable source IDs: reauthorize and validate restored quotes
|
|
126
|
+
against the originals before saving a result. This is opt-in; it does not change
|
|
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,50 @@
|
|
|
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
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"changes": [
|
|
30
|
+
{
|
|
31
|
+
"kind": "added",
|
|
32
|
+
"summary": "Encode retrieved original-text passages as request-scoped quote references and restore exact quotes without rewriting source text",
|
|
33
|
+
"symbols": [
|
|
34
|
+
"createRAGQuoteReferences"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"kind": "changed",
|
|
39
|
+
"summary": "Accept AI 0.2 alongside existing compatible AI releases; validate retrieval against AI 0.2.0",
|
|
40
|
+
"symbols": [
|
|
41
|
+
"ragChat",
|
|
42
|
+
"createRAGWorkflow"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"date": "2026-09-16",
|
|
47
|
+
"version": "0.10.0"
|
|
48
|
+
},
|
|
5
49
|
{
|
|
6
50
|
"changes": [
|
|
7
51
|
{
|
|
@@ -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=
|
|
31420
|
+
//# debugId=9FE93518A40B2B4664756E2164756E21
|
|
31418
31421
|
//# sourceMappingURL=index.js.map
|