@absolutejs/rag 0.13.0 → 0.15.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 +16 -0
- package/README.md +13 -0
- package/changelog.json +33 -0
- package/dist/src/web/website.d.ts +14 -0
- package/dist/web/index.js +33 -1
- package/dist/web/index.js.map +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ 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.15.0 — 2026-09-18
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Expose bounded website documents bound to source IDs and compact inline citation links for native MCP evidence presentation.** (`readRAGWebsite`)
|
|
14
|
+
|
|
15
|
+
## 0.14.0 — 2026-09-18
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **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.** (`readRAGWebsite`)
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Require nearby source links for factual answers and distinguish supported customer examples from unsupported exclusions, ownership relationships and rebrand history.** (`readRAGWebsite`)
|
|
24
|
+
|
|
9
25
|
## 0.13.0 — 2026-09-18
|
|
10
26
|
|
|
11
27
|
### Added
|
package/README.md
CHANGED
|
@@ -184,3 +184,16 @@ separately. Empty image labels are not proof of an absent client list, and media
|
|
|
184
184
|
URLs are not proof that a video was watched. Consumers must cite source URLs,
|
|
185
185
|
distinguish extracted evidence from inference, and finish the requested research
|
|
186
186
|
without treating a successful page fetch as complete company coverage.
|
|
187
|
+
|
|
188
|
+
Website results also lead with a `sources` array containing each readable page's
|
|
189
|
+
`title`, `url` and ready-to-use Markdown `citation`, repeated next to that page's
|
|
190
|
+
evidence text. Failed pages and unvisited links are not citable source entries.
|
|
191
|
+
`citationRequirements` asks consumers to place links beside supported claims,
|
|
192
|
+
avoid unsupported exclusions or ownership relationships, and keep verified brand
|
|
193
|
+
changes brief. Host applications still control their generated final answers.
|
|
194
|
+
|
|
195
|
+
`kind: "website_evidence"` identifies a website research result. `documents`
|
|
196
|
+
binds each bounded text excerpt to a source ID, while source entries provide
|
|
197
|
+
compact numbered `inlineCitation` links. This lets adapters present source-local
|
|
198
|
+
evidence without dumping raw retrieval metadata into a model's response context.
|
|
199
|
+
The combined document text respects `maxChars`; truncated excerpts are marked.
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/rag",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "added",
|
|
9
|
+
"summary": "Expose bounded website documents bound to source IDs and compact inline citation links for native MCP evidence presentation.",
|
|
10
|
+
"symbols": [
|
|
11
|
+
"readRAGWebsite"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"date": "2026-09-18",
|
|
16
|
+
"version": "0.15.0"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"changes": [
|
|
20
|
+
{
|
|
21
|
+
"kind": "changed",
|
|
22
|
+
"summary": "Require nearby source links for factual answers and distinguish supported customer examples from unsupported exclusions, ownership relationships and rebrand history.",
|
|
23
|
+
"symbols": [
|
|
24
|
+
"readRAGWebsite"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"kind": "added",
|
|
29
|
+
"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.",
|
|
30
|
+
"symbols": [
|
|
31
|
+
"readRAGWebsite"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"date": "2026-09-18",
|
|
36
|
+
"version": "0.14.0"
|
|
37
|
+
},
|
|
5
38
|
{
|
|
6
39
|
"changes": [
|
|
7
40
|
{
|
|
@@ -59,4 +59,18 @@ export declare const readRAGWebsite: (options: ReadWebpageOptions & {
|
|
|
59
59
|
redirects: import("./transport").WebRedirect[];
|
|
60
60
|
evidence: import("./evidence").WebEvidence;
|
|
61
61
|
limitations: string[];
|
|
62
|
+
kind: "website_evidence";
|
|
63
|
+
documents: {
|
|
64
|
+
sourceId: string;
|
|
65
|
+
text: string;
|
|
66
|
+
truncated: boolean;
|
|
67
|
+
}[];
|
|
68
|
+
sources: {
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
url: string;
|
|
72
|
+
citation: string;
|
|
73
|
+
inlineCitation: string;
|
|
74
|
+
}[];
|
|
75
|
+
citationRequirements: string;
|
|
62
76
|
}>;
|
package/dist/web/index.js
CHANGED
|
@@ -17786,7 +17786,35 @@ var readRAGWebsite = async (options) => {
|
|
|
17786
17786
|
});
|
|
17787
17787
|
}
|
|
17788
17788
|
}
|
|
17789
|
+
const sources = pages.filter((page) => page.status !== "error" && page.text).map((page, index) => {
|
|
17790
|
+
const title = (page.title || new URL(page.finalUrl).hostname).replace(/\s+/gu, " ").trim();
|
|
17791
|
+
const label = title.replace(/[\\[\]]/gu, "\\$&");
|
|
17792
|
+
const href = page.finalUrl.replace(/[<>]/gu, encodeURIComponent);
|
|
17793
|
+
return {
|
|
17794
|
+
id: `source-${index + 1}`,
|
|
17795
|
+
title,
|
|
17796
|
+
url: page.finalUrl,
|
|
17797
|
+
citation: `[${label}](<${href}>)`,
|
|
17798
|
+
inlineCitation: `[${index + 1}](<${href}>)`
|
|
17799
|
+
};
|
|
17800
|
+
});
|
|
17801
|
+
let remainingDocumentChars = maxChars;
|
|
17802
|
+
const documents = sources.flatMap((source) => {
|
|
17803
|
+
const page = pages.find((item) => item.finalUrl === source.url && item.text);
|
|
17804
|
+
if (!page || remainingDocumentChars <= 0)
|
|
17805
|
+
return [];
|
|
17806
|
+
const text = page.text.slice(0, remainingDocumentChars);
|
|
17807
|
+
remainingDocumentChars -= text.length;
|
|
17808
|
+
return [
|
|
17809
|
+
{
|
|
17810
|
+
sourceId: source.id,
|
|
17811
|
+
text,
|
|
17812
|
+
truncated: page.truncated || text.length < page.text.length
|
|
17813
|
+
}
|
|
17814
|
+
];
|
|
17815
|
+
});
|
|
17789
17816
|
const evidenceText = pages.filter((page) => page.status !== "error").map((page) => `SOURCE: ${page.finalUrl}
|
|
17817
|
+
CITATION: ${sources.find((source) => source.url === page.finalUrl)?.citation ?? page.finalUrl}
|
|
17790
17818
|
TITLE: ${page.title ?? "Untitled"}
|
|
17791
17819
|
${page.text}`).join(`
|
|
17792
17820
|
|
|
@@ -17795,6 +17823,10 @@ ${page.text}`).join(`
|
|
|
17795
17823
|
const incomplete = pages.some((page) => page.status !== "ok") || signal.aborted;
|
|
17796
17824
|
const unvisited = queue.filter((link) => !visited.has(link.url.split("#")[0]));
|
|
17797
17825
|
return {
|
|
17826
|
+
kind: "website_evidence",
|
|
17827
|
+
documents,
|
|
17828
|
+
sources,
|
|
17829
|
+
citationRequirements: "The final answer must contain clickable Markdown source links, not just source names or bare domain mentions. Reuse sources[].citation beside the factual paragraph, list or table row it supports. Cite the actual supporting page, not the homepage for everything. Every factual section needs its supporting links. Do not invent sources or use unread links as evidence. Before responding, check that company facts, service descriptions, customer examples and numerical claims have supporting links; retrieve or omit unsupported claims. A list of large customers does not prove smaller customers are excluded. Preserve the brands actually named in the evidence; do not append parent companies, ownership relationships, current-account status, market rankings or rebrand history from memory. Label reasoned inferences as such. A verified brand change needs at most one short, cited sentence unless the user asks for its history.",
|
|
17798
17830
|
...first,
|
|
17799
17831
|
status: readable.length ? incomplete ? "partial" : "ok" : "error",
|
|
17800
17832
|
text: evidenceText.slice(0, maxChars),
|
|
@@ -17993,5 +18025,5 @@ export {
|
|
|
17993
18025
|
validatePublicWebUrl
|
|
17994
18026
|
};
|
|
17995
18027
|
|
|
17996
|
-
//# debugId=
|
|
18028
|
+
//# debugId=3F4B779525714ED064756E2164756E21
|
|
17997
18029
|
//# sourceMappingURL=index.js.map
|