@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.
@@ -34,3 +34,4 @@ export { corpusTextHash, planRAGCorpus, reconcileRAGCorpus, } from "./retrieval/
34
34
  export type { RAGCorpusApply, RAGCorpusDocument, RAGCorpusPlan, RAGCorpusRecord, RAGCorpusResult, RAGCorpusStore, } from "./retrieval/corpus";
35
35
  export { chunkRAGOriginalText, readRAGOriginalText, type RAGOriginalText, type RAGOriginalTextLocator, } from "./ingestion/originalText";
36
36
  export { createRAGOriginalTextTools, type RAGOriginalTextToolsOptions } from "./retrieval/originalTextTools";
37
+ export { createRAGQuoteReferences } from "./retrieval/quoteReferences";
@@ -0,0 +1,13 @@
1
+ /** A request-scoped, reversible encoding of already-retrieved verbatim quotes.
2
+ * This is not an authorization mechanism: encode only server-owned tool results,
3
+ * and reauthorize/revalidate resolved quotes against originals before committing.
4
+ * Keep one registry across prefetch, subsequent lookups and completion. */
5
+ export declare const createRAGQuoteReferences: () => {
6
+ /** Accepts the JSON envelopes returned by original-text search/read tools.
7
+ * Unrecognized results and tool errors pass through unchanged. Source text
8
+ * is not interpreted as JSON or instructions. Caller retains the originals. */
9
+ encodeToolResult: (serialized: string) => string;
10
+ /** Resolve only a reference issued by this registry. A reference from another
11
+ * request is never loaded from a global cache or used to fetch a source. */
12
+ resolve: (reference: string) => string;
13
+ };
@@ -0,0 +1,42 @@
1
+ import { fetchPublicWebResource } from "./transport";
2
+ export { fetchPublicWebResource, validatePublicWebUrl, isPublicWebAddress, WebReadError, } from "./transport";
3
+ export type { WebFetchResult, WebFetchOptions } from "./transport";
4
+ export type WebReadAttempt = {
5
+ method: "http" | "browser";
6
+ status: string;
7
+ httpStatus?: number;
8
+ extractedChars?: number;
9
+ };
10
+ export type WebReadResult = {
11
+ status: "ok" | "partial" | "error";
12
+ url: string;
13
+ finalUrl: string;
14
+ title: string | null;
15
+ text: string;
16
+ method: "http" | "browser";
17
+ truncated: boolean;
18
+ attempts: WebReadAttempt[];
19
+ error?: {
20
+ code: string;
21
+ message: string;
22
+ };
23
+ fetchedAt: string;
24
+ };
25
+ export type WebRenderer = (url: string, options: {
26
+ signal: AbortSignal;
27
+ }) => Promise<{
28
+ html: string;
29
+ text?: string;
30
+ url: string;
31
+ status: number;
32
+ }>;
33
+ export type ReadWebpageOptions = {
34
+ url: string;
35
+ render?: WebRenderer;
36
+ signal?: AbortSignal;
37
+ maxChars?: number;
38
+ mode?: "auto" | "browser";
39
+ fetchResource?: typeof fetchPublicWebResource;
40
+ };
41
+ /** Read prepared evidence, escalating thin HTML shells to a host-supplied browser. */
42
+ export declare const readRAGWebpage: (options: ReadWebpageOptions) => Promise<WebReadResult>;
@@ -0,0 +1,9 @@
1
+ import type { WebRenderer } from "./index";
2
+ /** Fresh contexts share a browser, never cookies; all HTTP traffic uses pinned public DNS. */
3
+ export declare const createPlaywrightWebRenderer: (options?: {
4
+ executablePath?: string;
5
+ }) => {
6
+ render: WebRenderer;
7
+ ready: () => Promise<void>;
8
+ close: () => Promise<void>;
9
+ };
@@ -0,0 +1,22 @@
1
+ export declare class WebReadError extends Error {
2
+ code: string;
3
+ constructor(code: string, message: string);
4
+ }
5
+ export declare const isPublicWebAddress: (address: string) => boolean;
6
+ export type WebFetchResult = {
7
+ url: string;
8
+ status: number;
9
+ headers: Record<string, string>;
10
+ body: Uint8Array;
11
+ };
12
+ export type WebFetchOptions = {
13
+ signal?: AbortSignal;
14
+ redirect?: "follow" | "manual";
15
+ maxBytes?: number;
16
+ method?: string;
17
+ body?: string;
18
+ headers?: Record<string, string>;
19
+ };
20
+ export declare const validatePublicWebUrl: (raw: string) => URL;
21
+ /** Pin the validated DNS answer into the connection, including every redirect. */
22
+ export declare const fetchPublicWebResource: (raw: string, options?: WebFetchOptions) => Promise<WebFetchResult>;