@absolutejs/rag 0.16.0 → 0.17.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 +10 -0
- package/README.md +2 -0
- package/changelog.json +235 -218
- package/dist/src/web/index.d.ts +1 -0
- package/dist/src/web/remote.d.ts +30 -0
- package/dist/web/index.js +116 -79
- package/dist/web/index.js.map +6 -5
- package/dist/web/playwright.js +38 -79
- package/dist/web/playwright.js.map +3 -3
- package/package.json +183 -182
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.17.0 — 2026-09-24
|
|
10
|
+
|
|
11
|
+
### Security
|
|
12
|
+
|
|
13
|
+
- **Reject additional reserved IPv6 ranges through the shared public-address validator** (`isPublicWebAddress`)
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Reuse shared pinned transport and add a typed remote website-reader client with caller cancellation and reserved fallback time**
|
|
18
|
+
|
|
9
19
|
## 0.16.0 — 2026-09-23
|
|
10
20
|
|
|
11
21
|
### Added
|
package/README.md
CHANGED
|
@@ -228,3 +228,5 @@ whole extraction instead of reporting an incomplete document as complete.
|
|
|
228
228
|
`signal` is checked between pages and after OCR; pass the same signal into the
|
|
229
229
|
provider to cancel its in-flight request. `onProgress` reports completed pages.
|
|
230
230
|
Blank pages are skipped; an entirely unreadable document is rejected.
|
|
231
|
+
|
|
232
|
+
`createWebsiteReaderClient` from `@absolutejs/rag/web` connects to a trusted host-managed reader service and validates its status, text, source URLs and limitations. Configure the service endpoint and inject a static fallback. The client reserves fallback time within one total deadline, propagates caller cancellation, and keeps service saturation retryable. RAG's public HTTP/HTTPS reader shares the low-level pinned transport with `@absolutejs/egress/transport`; egress still enforces its own allowlisted HTTPS policy.
|
package/changelog.json
CHANGED
|
@@ -1,220 +1,237 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
2
|
+
"contract": 1,
|
|
3
|
+
"name": "@absolutejs/rag",
|
|
4
|
+
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "added",
|
|
9
|
+
"summary": "Reuse shared pinned transport and add a typed remote website-reader client with caller cancellation and reserved fallback time"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"kind": "security",
|
|
13
|
+
"summary": "Reject additional reserved IPv6 ranges through the shared public-address validator",
|
|
14
|
+
"symbols": [
|
|
15
|
+
"isPublicWebAddress"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"date": "2026-09-24",
|
|
20
|
+
"version": "0.17.0"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"changes": [
|
|
24
|
+
{
|
|
25
|
+
"kind": "added",
|
|
26
|
+
"summary": "Add page-by-page PDF extraction with OCR for image-bearing pages, preserving mixed-document evidence and rejecting incomplete extraction.",
|
|
27
|
+
"symbols": [
|
|
28
|
+
"createRAGPagedPDFExtractor"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"date": "2026-09-23",
|
|
33
|
+
"version": "0.16.0"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"changes": [
|
|
37
|
+
{
|
|
38
|
+
"kind": "fixed",
|
|
39
|
+
"summary": "Decode real PDFs with PDF.js, preserving page evidence across compressed streams and font encodings without application intake caps; retain explicit OCR support.",
|
|
40
|
+
"symbols": [
|
|
41
|
+
"createPDFFileExtractor",
|
|
42
|
+
"createRAGPDFOCRExtractor"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"date": "2026-09-23",
|
|
47
|
+
"version": "0.15.2"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"changes": [
|
|
51
|
+
{
|
|
52
|
+
"kind": "fixed",
|
|
53
|
+
"summary": "Preserve all sections of public websites instead of extracting one article fragment, and retain labeled image evidence in source-bound documents.",
|
|
54
|
+
"symbols": [
|
|
55
|
+
"readRAGWebpage",
|
|
56
|
+
"readRAGWebsite"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"date": "2026-09-20",
|
|
61
|
+
"version": "0.15.1"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"changes": [
|
|
65
|
+
{
|
|
66
|
+
"kind": "added",
|
|
67
|
+
"summary": "Expose bounded website documents bound to source IDs and compact inline citation links for native MCP evidence presentation.",
|
|
68
|
+
"symbols": [
|
|
69
|
+
"readRAGWebsite"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"date": "2026-09-18",
|
|
74
|
+
"version": "0.15.0"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"changes": [
|
|
78
|
+
{
|
|
79
|
+
"kind": "changed",
|
|
80
|
+
"summary": "Require nearby source links for factual answers and distinguish supported customer examples from unsupported exclusions, ownership relationships and rebrand history.",
|
|
81
|
+
"symbols": [
|
|
82
|
+
"readRAGWebsite"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"kind": "added",
|
|
87
|
+
"summary": "Return copy-ready source citations before website evidence and repeat links beside each retrieved page; exclude failed reads and unread links from the source list.",
|
|
88
|
+
"symbols": [
|
|
89
|
+
"readRAGWebsite"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"date": "2026-09-18",
|
|
94
|
+
"version": "0.14.0"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"changes": [
|
|
98
|
+
{
|
|
99
|
+
"kind": "changed",
|
|
100
|
+
"summary": "Balance repeated customer, service and company reads across an eight-page default budget (maximum twelve) with 48000 characters, preventing case-study archives from starving service details.",
|
|
101
|
+
"symbols": [
|
|
102
|
+
"readRAGWebsite"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"kind": "added",
|
|
107
|
+
"summary": "Expose stop reasons and actual incomplete page reads separately from unvisited links; guide targeted continuation and concise nontechnical answers.",
|
|
108
|
+
"symbols": [
|
|
109
|
+
"readRAGWebsite"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"date": "2026-09-18",
|
|
114
|
+
"version": "0.13.0"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"changes": [
|
|
118
|
+
{
|
|
119
|
+
"kind": "added",
|
|
120
|
+
"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."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"kind": "changed",
|
|
124
|
+
"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.",
|
|
125
|
+
"symbols": [
|
|
126
|
+
"WebFetchResult",
|
|
127
|
+
"WebReadResult",
|
|
128
|
+
"WebRenderer",
|
|
129
|
+
"readRAGWebpage",
|
|
130
|
+
"createPlaywrightWebRenderer"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"date": "2026-09-18",
|
|
135
|
+
"version": "0.12.0"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"changes": [
|
|
139
|
+
{
|
|
140
|
+
"kind": "fixed",
|
|
141
|
+
"summary": "Honor HTML response MIME types for extensionless URL ingestion instead of treating website markup as plain text, including XHTML and batch URL loading.",
|
|
142
|
+
"symbols": [
|
|
143
|
+
"loadRAGDocumentFromURL",
|
|
144
|
+
"loadRAGDocumentsFromURLs"
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"kind": "added",
|
|
149
|
+
"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.",
|
|
150
|
+
"symbols": [
|
|
151
|
+
"readRAGWebpage",
|
|
152
|
+
"createPlaywrightWebRenderer",
|
|
153
|
+
"fetchPublicWebResource"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"date": "2026-09-18",
|
|
158
|
+
"version": "0.11.0"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"changes": [
|
|
162
|
+
{
|
|
163
|
+
"kind": "added",
|
|
164
|
+
"summary": "Encode retrieved original-text passages as request-scoped quote references and restore exact quotes without rewriting source text",
|
|
165
|
+
"symbols": [
|
|
166
|
+
"createRAGQuoteReferences"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"kind": "changed",
|
|
171
|
+
"summary": "Accept AI 0.2 alongside existing compatible AI releases; validate retrieval against AI 0.2.0",
|
|
172
|
+
"symbols": [
|
|
173
|
+
"ragChat",
|
|
174
|
+
"createRAGWorkflow"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"date": "2026-09-16",
|
|
179
|
+
"version": "0.10.0"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"changes": [
|
|
183
|
+
{
|
|
184
|
+
"kind": "changed",
|
|
185
|
+
"summary": "Forward AI context policy through RAG WebSocket and SSE chat; accept the next AI 0.1 release while retaining compatibility with the prior AI peer range",
|
|
186
|
+
"symbols": [
|
|
187
|
+
"ragChat",
|
|
188
|
+
"createRAGWorkflow",
|
|
189
|
+
"useRAG",
|
|
190
|
+
"useRAGWorkflow",
|
|
191
|
+
"useRAGStream",
|
|
192
|
+
"createRAG",
|
|
193
|
+
"RAGWorkflowService",
|
|
194
|
+
"RAGStreamService"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"kind": "added",
|
|
199
|
+
"summary": "Allow servers to request a smaller original-source search result set while preserving candidate ranking, authorization, and exact token budgeting",
|
|
200
|
+
"symbols": [
|
|
201
|
+
"createRAGOriginalTextTools"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"kind": "changed",
|
|
206
|
+
"summary": "Count a complete authorized source-result envelope once when it fits, avoiding serial tokenizer round trips while retaining exact budget validation and oversized-result packing",
|
|
207
|
+
"symbols": [
|
|
208
|
+
"createRAGOriginalTextTools"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "added",
|
|
213
|
+
"summary": "Add verbatim versioned text ingestion and authorized hybrid source tools with caller-supplied model token budgets; preserve multilingual keyword matches",
|
|
214
|
+
"symbols": [
|
|
215
|
+
"chunkRAGOriginalText",
|
|
216
|
+
"readRAGOriginalText",
|
|
217
|
+
"createRAGOriginalTextTools"
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"kind": "breaking",
|
|
222
|
+
"migration": {
|
|
223
|
+
"instruction": "Use a store implementing queryLexical for lexical/hybrid retrieval, or explicitly select vector mode on vector-only stores. Scoped heuristic queries now retain the requested channels; update trace consumers from Scoped direct route to Scoped retrieval route.",
|
|
224
|
+
"manual": true
|
|
225
|
+
},
|
|
226
|
+
"summary": "Reject unsupported lexical and hybrid retrieval instead of silently omitting keyword results; preserve requested channels for scoped heuristic queries",
|
|
227
|
+
"symbols": [
|
|
228
|
+
"createRAGCollection",
|
|
229
|
+
"createHeuristicRAGRetrievalStrategy"
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
"date": "2026-09-16",
|
|
234
|
+
"version": "0.9.0"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
220
237
|
}
|
package/dist/src/web/index.d.ts
CHANGED
|
@@ -50,3 +50,4 @@ export type ReadWebpageOptions = {
|
|
|
50
50
|
/** Read prepared evidence, escalating thin HTML shells to a host-supplied browser. */
|
|
51
51
|
export declare const readRAGWebpage: (options: ReadWebpageOptions) => Promise<WebReadResult>;
|
|
52
52
|
export { readRAGWebsite } from "./website";
|
|
53
|
+
export { createWebsiteReaderClient, parseWebsiteServiceResult, type WebsiteServiceResult, } from "./remote";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Typed boundary for a host-managed isolated website reader. The service URL is
|
|
2
|
+
* trusted host configuration; public destination validation stays in the reader. */
|
|
3
|
+
export type WebsiteServiceResult = Record<string, unknown> & {
|
|
4
|
+
status: "ok" | "partial" | "error";
|
|
5
|
+
text: string;
|
|
6
|
+
limitations?: string[];
|
|
7
|
+
sources?: {
|
|
8
|
+
url: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
citation?: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
export declare const parseWebsiteServiceResult: (value: unknown) => WebsiteServiceResult;
|
|
14
|
+
export declare const createWebsiteReaderClient: (options: {
|
|
15
|
+
endpoint: string;
|
|
16
|
+
fetch?: typeof fetch;
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
fallbackReserveMs?: number;
|
|
19
|
+
fallback: (input: {
|
|
20
|
+
url: string;
|
|
21
|
+
maxPages: number;
|
|
22
|
+
mode: "auto" | "browser";
|
|
23
|
+
signal: AbortSignal;
|
|
24
|
+
}) => Promise<WebsiteServiceResult>;
|
|
25
|
+
}) => (input: {
|
|
26
|
+
url: string;
|
|
27
|
+
maxPages?: number;
|
|
28
|
+
mode?: "auto" | "browser";
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
}) => Promise<WebsiteServiceResult>;
|