@retrivora-ai/rag-engine 1.9.8 → 2.0.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/README.md +36 -28
- package/dist/{ILLMProvider-B8ROITYK.d.mts → ILLMProvider-DMxLyTdq.d.mts} +2 -2
- package/dist/{ILLMProvider-B8ROITYK.d.ts → ILLMProvider-DMxLyTdq.d.ts} +2 -2
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +248 -74
- package/dist/handlers/index.mjs +254 -74
- package/dist/{index-DNvoi-sV.d.ts → index-CfkqZd2Y.d.ts} +1 -1
- package/dist/{index-BCPKUAVL.d.ts → index-DHsFLJXQ.d.mts} +2 -31
- package/dist/{index-CrxCy36A.d.mts → index-tzwc7UhY.d.ts} +2 -31
- package/dist/{index-B8PbEFSY.d.mts → index-xygonxpW.d.mts} +1 -1
- package/dist/index.css +485 -557
- package/dist/index.d.mts +16 -10
- package/dist/index.d.ts +16 -10
- package/dist/index.js +36 -768
- package/dist/index.mjs +32 -782
- package/dist/server.d.mts +8 -5
- package/dist/server.d.ts +8 -5
- package/dist/server.js +249 -74
- package/dist/server.mjs +255 -74
- package/package.json +3 -2
- package/src/app/page.tsx +2 -0
- package/src/components/ChatWindow.tsx +14 -3
- package/src/components/constants.tsx +224 -0
- package/src/config/RagConfig.ts +2 -2
- package/src/config/serverConfig.ts +14 -1
- package/src/core/ConfigResolver.ts +32 -6
- package/src/core/LicenseVerifier.ts +106 -0
- package/src/core/Pipeline.ts +11 -8
- package/src/core/Retrivora.ts +1 -0
- package/src/handlers/index.ts +84 -48
- package/src/index.ts +3 -5
- package/src/components/AmbientBackground.tsx +0 -29
- package/src/components/ArchitectureCard.tsx +0 -53
- package/src/components/ArchitectureCardsSection.tsx +0 -48
- package/src/components/DocViewer.tsx +0 -97
- package/src/components/Documentation.tsx +0 -141
- package/src/components/Hero.tsx +0 -142
- package/src/components/Lifecycle.tsx +0 -77
- package/src/components/Navbar.tsx +0 -55
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-DMxLyTdq.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* DocumentChunker — splits long text into overlapping chunks
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
-
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-
|
|
2
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-DMxLyTdq.mjs';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
5
5
|
field: string;
|
|
@@ -144,40 +144,10 @@ declare function sseObservabilityFrame(trace: unknown): string;
|
|
|
144
144
|
declare function sseErrorFrame(message: string): string;
|
|
145
145
|
/**
|
|
146
146
|
* createChatHandler — factory that returns a Next.js App Router POST handler.
|
|
147
|
-
*
|
|
148
|
-
* Accepts either a full/partial `RagConfig` **or** a pre-built `VectorPlugin`
|
|
149
|
-
* instance (preferred for singleton/multi-tenant setups).
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* // Option A — pass config (plugin created once at module load time)
|
|
153
|
-
* export const POST = createChatHandler(getRagConfig());
|
|
154
|
-
*
|
|
155
|
-
* // Option B — pass a pre-built plugin (most flexible)
|
|
156
|
-
* const plugin = new VectorPlugin(getRagConfig());
|
|
157
|
-
* export const POST = createChatHandler(plugin);
|
|
158
147
|
*/
|
|
159
148
|
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
160
149
|
/**
|
|
161
150
|
* createStreamHandler — factory for a streaming SSE Next.js App Router POST handler.
|
|
162
|
-
*
|
|
163
|
-
* Streams the assistant response as Server-Sent Events (SSE). Each frame is a
|
|
164
|
-
* JSON object with a `type` discriminant:
|
|
165
|
-
* - `{ type: "text", text: "..." }` — incremental text chunk
|
|
166
|
-
* - `{ type: "metadata", sources: [...] }` — retrieval metadata (last frame)
|
|
167
|
-
* - `{ type: "error", error: "..." }` — stream-level error
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* // src/app/api/chat/route.ts
|
|
171
|
-
* export const POST = createStreamHandler(getRagConfig());
|
|
172
|
-
*
|
|
173
|
-
* // Client-side parsing in useRagChat.ts:
|
|
174
|
-
* // const lines = chunk.split('\n');
|
|
175
|
-
* // for (const line of lines) {
|
|
176
|
-
* // if (line.startsWith('data: ')) {
|
|
177
|
-
* // const frame = JSON.parse(line.slice(6));
|
|
178
|
-
* // if (frame.type === 'text') { ... }
|
|
179
|
-
* // }
|
|
180
|
-
* // }
|
|
181
151
|
*/
|
|
182
152
|
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
183
153
|
/**
|
|
@@ -194,6 +164,7 @@ declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | Vecto
|
|
|
194
164
|
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
195
165
|
/**
|
|
196
166
|
* createSuggestionsHandler — factory for the auto-suggestions endpoint.
|
|
167
|
+
* Supports both POST (JSON body) and GET (URL search parameters).
|
|
197
168
|
*/
|
|
198
169
|
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
199
170
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
-
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-
|
|
2
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-DMxLyTdq.js';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
5
5
|
field: string;
|
|
@@ -144,40 +144,10 @@ declare function sseObservabilityFrame(trace: unknown): string;
|
|
|
144
144
|
declare function sseErrorFrame(message: string): string;
|
|
145
145
|
/**
|
|
146
146
|
* createChatHandler — factory that returns a Next.js App Router POST handler.
|
|
147
|
-
*
|
|
148
|
-
* Accepts either a full/partial `RagConfig` **or** a pre-built `VectorPlugin`
|
|
149
|
-
* instance (preferred for singleton/multi-tenant setups).
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* // Option A — pass config (plugin created once at module load time)
|
|
153
|
-
* export const POST = createChatHandler(getRagConfig());
|
|
154
|
-
*
|
|
155
|
-
* // Option B — pass a pre-built plugin (most flexible)
|
|
156
|
-
* const plugin = new VectorPlugin(getRagConfig());
|
|
157
|
-
* export const POST = createChatHandler(plugin);
|
|
158
147
|
*/
|
|
159
148
|
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
160
149
|
/**
|
|
161
150
|
* createStreamHandler — factory for a streaming SSE Next.js App Router POST handler.
|
|
162
|
-
*
|
|
163
|
-
* Streams the assistant response as Server-Sent Events (SSE). Each frame is a
|
|
164
|
-
* JSON object with a `type` discriminant:
|
|
165
|
-
* - `{ type: "text", text: "..." }` — incremental text chunk
|
|
166
|
-
* - `{ type: "metadata", sources: [...] }` — retrieval metadata (last frame)
|
|
167
|
-
* - `{ type: "error", error: "..." }` — stream-level error
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* // src/app/api/chat/route.ts
|
|
171
|
-
* export const POST = createStreamHandler(getRagConfig());
|
|
172
|
-
*
|
|
173
|
-
* // Client-side parsing in useRagChat.ts:
|
|
174
|
-
* // const lines = chunk.split('\n');
|
|
175
|
-
* // for (const line of lines) {
|
|
176
|
-
* // if (line.startsWith('data: ')) {
|
|
177
|
-
* // const frame = JSON.parse(line.slice(6));
|
|
178
|
-
* // if (frame.type === 'text') { ... }
|
|
179
|
-
* // }
|
|
180
|
-
* // }
|
|
181
151
|
*/
|
|
182
152
|
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
183
153
|
/**
|
|
@@ -194,6 +164,7 @@ declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | Vecto
|
|
|
194
164
|
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
195
165
|
/**
|
|
196
166
|
* createSuggestionsHandler — factory for the auto-suggestions endpoint.
|
|
167
|
+
* Supports both POST (JSON body) and GET (URL search parameters).
|
|
197
168
|
*/
|
|
198
169
|
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
199
170
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-DMxLyTdq.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* DocumentChunker — splits long text into overlapping chunks
|