@absolutejs/rag 0.18.1 → 0.20.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.
@@ -5,10 +5,15 @@ export declare const ReviewSchema: import("@sinclair/typebox").TObject<{
5
5
  path: import("@sinclair/typebox").TString;
6
6
  verdict: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"unknown" | "supported" | "unsupported" | "conflicting">[]>;
7
7
  citations: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
8
- sourceId: import("@sinclair/typebox").TString;
9
- quote: import("@sinclair/typebox").TString;
8
+ passageId: import("@sinclair/typebox").TString;
10
9
  }>>;
11
10
  reason: import("@sinclair/typebox").TString;
11
+ checks: import("@sinclair/typebox").TObject<{
12
+ answersQuestion: import("@sinclair/typebox").TBoolean;
13
+ correctEntity: import("@sinclair/typebox").TBoolean;
14
+ correctTime: import("@sinclair/typebox").TBoolean;
15
+ preservesScope: import("@sinclair/typebox").TBoolean;
16
+ }>;
12
17
  }>>;
13
18
  }>;
14
19
  export declare const researchLeaves: (value: unknown, maxFields?: number) => Pick<ResearchField, "value" | "path">[];
@@ -18,4 +23,25 @@ export declare const bindResearchReview: (leaves: ReturnType<typeof researchLeav
18
23
  verdict: ResearchField["verdict"];
19
24
  citations: ResearchField["citations"];
20
25
  reason: string;
26
+ checks?: ResearchField["checks"];
21
27
  }[], sources: SearchSource[]) => ResearchField[];
28
+ /** Stable references let the runtime copy evidence instead of asking a model to transcribe it. */
29
+ export declare const researchPassages: (sources: SearchSource[]) => {
30
+ passages: {
31
+ id: string;
32
+ text: string;
33
+ }[];
34
+ id: string;
35
+ url: string;
36
+ title: string;
37
+ retrievedAt: string;
38
+ publishedAt?: string;
39
+ contentFetchedAt?: string;
40
+ metadata?: Record<string, unknown>;
41
+ }[];
42
+ export declare const resolveResearchPassages: (citations: {
43
+ passageId: string;
44
+ }[], sources: ReturnType<typeof researchPassages>) => {
45
+ sourceId: string;
46
+ quote: string;
47
+ }[];
@@ -19,6 +19,13 @@ export type ResearchField = {
19
19
  quote: string;
20
20
  }[];
21
21
  reason: string;
22
+ /** Model judgments, not independent verification; all must pass for support. */
23
+ checks?: {
24
+ answersQuestion: boolean;
25
+ correctEntity: boolean;
26
+ correctTime: boolean;
27
+ preservesScope: boolean;
28
+ };
22
29
  };
23
30
  export type ResearchResult<T = unknown> = {
24
31
  id: string;
@@ -66,6 +73,11 @@ export type ResearchConfig = {
66
73
  search: SearchProvider;
67
74
  provider: AIProviderConfig;
68
75
  model: string;
76
+ /** Optional separate reviewer. Host reservations must price this model too. */
77
+ reviewer?: {
78
+ provider: AIProviderConfig;
79
+ model: string;
80
+ };
69
81
  tasks?: Record<string, ResearchTask>;
70
82
  limits?: Partial<ResearchLimits>;
71
83
  /** Explicit shared-public or tenant scope. Omit to disable search caching. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/rag",
3
- "version": "0.18.1",
3
+ "version": "0.20.0",
4
4
  "homepage": "https://github.com/absolutejs/rag",
5
5
  "bugs": {
6
6
  "url": "https://github.com/absolutejs/rag/issues"
@@ -84,13 +84,13 @@
84
84
  "manifestContract": 2
85
85
  },
86
86
  "dependencies": {
87
+ "@absolutejs/egress": "^0.3.1",
87
88
  "@absolutejs/manifest": "^0.9.0",
89
+ "@absolutejs/search": "^0.2.0",
88
90
  "@sinclair/typebox": "^0.34.0",
89
91
  "linkedom": "0.18.13",
90
- "pdfjs-dist": "6.3.289",
91
92
  "pdf-lib": "1.17.1",
92
- "@absolutejs/egress": "^0.3.0",
93
- "@absolutejs/search": "^0.2.0",
93
+ "pdfjs-dist": "6.3.289",
94
94
  "typebox": "^1.3.16"
95
95
  },
96
96
  "peerDependencies": {