@absolutejs/rag 0.10.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 +10 -0
- package/README.md +37 -0
- package/changelog.json +23 -0
- package/dist/adapter-kit/index.js +6 -3
- package/dist/adapter-kit/index.js.map +3 -3
- package/dist/index.js +6 -3
- package/dist/index.js.map +3 -3
- 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 +17 -4
|
@@ -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>;
|