@absolutejs/rag 0.11.0 → 0.13.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.
@@ -0,0 +1,24 @@
1
+ export type WebLink = {
2
+ url: string;
3
+ label: string;
4
+ };
5
+ export type WebImage = {
6
+ url: string | null;
7
+ label: string;
8
+ context: string;
9
+ };
10
+ export type WebMedia = {
11
+ kind: "video" | "audio" | "embed" | "captions";
12
+ url: string;
13
+ label: string;
14
+ };
15
+ export type WebEvidence = {
16
+ links: WebLink[];
17
+ images: WebImage[];
18
+ media: WebMedia[];
19
+ canonicalUrl: string | null;
20
+ };
21
+ /** Preserve semantic evidence that visible body text omits. Labels are not verified customer relationships. */
22
+ export declare const extractWebEvidence: (html: string, url: string) => WebEvidence;
23
+ /** Navigation/footer text alone must not mask an empty or loading app root. */
24
+ export declare const hasIncompleteAppContent: (html: string) => boolean;
@@ -1,3 +1,7 @@
1
+ import { type WebEvidence } from "./evidence";
2
+ import type { WebRedirect } from "./transport";
3
+ export type { WebEvidence, WebLink, WebImage, WebMedia } from "./evidence";
4
+ export type { WebRedirect } from "./transport";
1
5
  import { fetchPublicWebResource } from "./transport";
2
6
  export { fetchPublicWebResource, validatePublicWebUrl, isPublicWebAddress, WebReadError, } from "./transport";
3
7
  export type { WebFetchResult, WebFetchOptions } from "./transport";
@@ -21,6 +25,9 @@ export type WebReadResult = {
21
25
  message: string;
22
26
  };
23
27
  fetchedAt: string;
28
+ redirects: WebRedirect[];
29
+ evidence: WebEvidence;
30
+ limitations: string[];
24
31
  };
25
32
  export type WebRenderer = (url: string, options: {
26
33
  signal: AbortSignal;
@@ -29,6 +36,8 @@ export type WebRenderer = (url: string, options: {
29
36
  text?: string;
30
37
  url: string;
31
38
  status: number;
39
+ redirects?: WebRedirect[];
40
+ settled?: boolean;
32
41
  }>;
33
42
  export type ReadWebpageOptions = {
34
43
  url: string;
@@ -40,3 +49,4 @@ export type ReadWebpageOptions = {
40
49
  };
41
50
  /** Read prepared evidence, escalating thin HTML shells to a host-supplied browser. */
42
51
  export declare const readRAGWebpage: (options: ReadWebpageOptions) => Promise<WebReadResult>;
52
+ export { readRAGWebsite } from "./website";
@@ -3,7 +3,14 @@ export declare class WebReadError extends Error {
3
3
  constructor(code: string, message: string);
4
4
  }
5
5
  export declare const isPublicWebAddress: (address: string) => boolean;
6
+ export type WebRedirect = {
7
+ from: string;
8
+ to: string;
9
+ kind: "http" | "client";
10
+ status?: number;
11
+ };
6
12
  export type WebFetchResult = {
13
+ redirects?: WebRedirect[];
7
14
  url: string;
8
15
  status: number;
9
16
  headers: Record<string, string>;
@@ -0,0 +1,62 @@
1
+ import { type ReadWebpageOptions, type WebReadResult } from "./index";
2
+ /** Bounded company research: preserve citations and follow relevant same-origin links. */
3
+ export declare const readRAGWebsite: (options: ReadWebpageOptions & {
4
+ maxPages?: number;
5
+ }) => Promise<{
6
+ status: WebReadResult["status"];
7
+ text: string;
8
+ truncated: boolean;
9
+ pages: {
10
+ status: "ok" | "partial" | "error";
11
+ url: string;
12
+ finalUrl: string;
13
+ title: string | null;
14
+ method: "http" | "browser";
15
+ truncated: boolean;
16
+ attempts: import("./index").WebReadAttempt[];
17
+ error?: {
18
+ code: string;
19
+ message: string;
20
+ };
21
+ fetchedAt: string;
22
+ redirects: import("./transport").WebRedirect[];
23
+ evidence: import("./evidence").WebEvidence;
24
+ limitations: string[];
25
+ }[];
26
+ captionEvidence: {
27
+ url: string;
28
+ text: string;
29
+ error?: string;
30
+ }[];
31
+ coverage: {
32
+ pagesRead: number;
33
+ pageLimit: number;
34
+ remainingRelevantLinks: string[];
35
+ deadlineReached: boolean;
36
+ exhaustive: boolean;
37
+ stopReason: string;
38
+ incompleteReads: {
39
+ url: string;
40
+ status: "error" | "partial" | "ok";
41
+ truncated: boolean;
42
+ error: {
43
+ code: string;
44
+ message: string;
45
+ } | undefined;
46
+ }[];
47
+ };
48
+ citationGuidance: string;
49
+ url: string;
50
+ finalUrl: string;
51
+ title: string | null;
52
+ method: "http" | "browser";
53
+ attempts: import("./index").WebReadAttempt[];
54
+ error?: {
55
+ code: string;
56
+ message: string;
57
+ };
58
+ fetchedAt: string;
59
+ redirects: import("./transport").WebRedirect[];
60
+ evidence: import("./evidence").WebEvidence;
61
+ limitations: string[];
62
+ }>;