@absolutejs/rag 0.0.22 → 0.0.24

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/LICENSE ADDED
@@ -0,0 +1,88 @@
1
+ # Business Source License 1.1
2
+
3
+ **Licensor:** Alex Kahn
4
+
5
+ **Licensed Work:** @absolutejs/rag (https://github.com/absolutejs/rag)
6
+
7
+ **Change Date:** May 29, 2030
8
+
9
+ **Change License:** Apache License, Version 2.0
10
+
11
+ ---
12
+
13
+ ## Terms
14
+
15
+ The Licensor hereby grants you the right to copy, modify, create derivative
16
+ works, redistribute, and make non-production use of the Licensed Work. The
17
+ Licensor may make an Additional Use Grant, permitting limited production use.
18
+
19
+ ### Additional Use Grant
20
+
21
+ You may use the Licensed Work in production, provided your use does not include
22
+ any of the following:
23
+
24
+ 1. **Offering a Competing Service.** You may not offer the Licensed Work, or
25
+ any derivative or substantial portion of it, to third parties as a hosted or
26
+ managed service that competes with a hosted retrieval-augmented generation, vector database, or semantic search service (including, but not limited to, services like Pinecone, Weaviate, Chroma, Qdrant, Vectara, or LlamaCloud). This includes any
27
+ product whose primary value to its users is the functionality the Licensed
28
+ Work provides.
29
+
30
+ 2. **Resale or Redistribution as a Standalone Product.** You may not sell,
31
+ license, or distribute the Licensed Work, or any derivative or fork of it,
32
+ as a standalone commercial product.
33
+
34
+ 3. **Removal of Attribution.** Any derivative work, fork, or redistribution of
35
+ the Licensed Work must prominently credit AbsoluteJS and include a link to
36
+ the original project repository (https://github.com/absolutejs/rag).
37
+
38
+ For clarity, the following uses are expressly permitted:
39
+
40
+ - Using the Licensed Work to build and operate your own applications, websites,
41
+ internal tools, or SaaS products (whether commercial or non-commercial), so
42
+ long as the Licensed Work itself is not the primary product you are selling.
43
+ - Using the Licensed Work as a dependency in commercial software you build and
44
+ sell, as long as the software is not itself a competing managed service of
45
+ the kind described in clause 1.
46
+ - Providing consulting, development, or professional services to clients using
47
+ the Licensed Work.
48
+ - Forking and modifying the Licensed Work for your own internal use, provided
49
+ attribution is maintained.
50
+
51
+ ### Change Date and Change License
52
+
53
+ On the Change Date specified above, or on such other date as the Licensor may
54
+ specify by written notice, the Licensed Work will be made available under the
55
+ Change License (Apache License, Version 2.0). Until the Change Date, the terms
56
+ of this Business Source License 1.1 apply.
57
+
58
+ ### Trademark
59
+
60
+ This license does not grant you any rights to use the "AbsoluteJS" or
61
+ "@absolutejs" name, logo, or any related trademarks. Forks and derivative works
62
+ must not be named or branded in a manner that suggests endorsement by or
63
+ affiliation with AbsoluteJS or the Licensor.
64
+
65
+ ### Notices
66
+
67
+ You must not remove or obscure any licensing, copyright, or other notices
68
+ included in the Licensed Work.
69
+
70
+ ### No Warranty
71
+
72
+ THE LICENSED WORK IS PROVIDED "AS IS". THE LICENSOR HEREBY DISCLAIMS ALL
73
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
74
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO
75
+ EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY,
76
+ WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR
77
+ IN CONNECTION WITH THE LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE
78
+ LICENSED WORK.
79
+
80
+ ---
81
+
82
+ ## Contact
83
+
84
+ For commercial licensing inquiries or additional permissions, contact:
85
+
86
+ - **Alex Kahn**
87
+ - alexkahndev@gmail.com
88
+ - alexkahndev.github.io
package/dist/index.js CHANGED
@@ -31440,6 +31440,10 @@ var limitCandidates = (input) => {
31440
31440
  const cap = input.candidateTopK ?? input.results.length;
31441
31441
  return input.results.slice(0, Math.max(0, cap));
31442
31442
  };
31443
+ var readHttpErrorDetail = async (response) => {
31444
+ const text = await response.clone().text().catch(() => "");
31445
+ return text.trim();
31446
+ };
31443
31447
  var createHttpCrossEncoderReranker = (options) => {
31444
31448
  const fetchImpl = options.config.fetch ?? fetch;
31445
31449
  const defaultModel = options.config.defaultModel ?? options.fallbackModel;
@@ -31463,7 +31467,8 @@ var createHttpCrossEncoderReranker = (options) => {
31463
31467
  method: "POST"
31464
31468
  });
31465
31469
  if (!response.ok) {
31466
- throw new Error(`${options.providerName} rerank failed: HTTP ${response.status}`);
31470
+ const detail = await readHttpErrorDetail(response);
31471
+ throw new Error(`${options.providerName} rerank failed: HTTP ${response.status}${detail ? `: ${detail}` : ""}`);
31467
31472
  }
31468
31473
  const payload = await response.json();
31469
31474
  const rows = payload.results ?? payload.data ?? [];
@@ -32248,6 +32253,19 @@ var createGmailHttpError = async (label, response) => {
32248
32253
  const suffix = [reason, detailMessage].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join(" | ");
32249
32254
  return new Error(`${label}: ${response.status} ${response.statusText}${suffix ? ` (${suffix})` : ""}`);
32250
32255
  };
32256
+ var readGraphErrorDetail = async (response) => {
32257
+ try {
32258
+ const body = await response.clone().json();
32259
+ const parts = [body.error?.code, body.error?.message].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index);
32260
+ if (parts.length > 0) {
32261
+ return parts.join(" | ");
32262
+ }
32263
+ } catch {
32264
+ const text = await response.clone().text().catch(() => "");
32265
+ return text.trim().length > 0 ? text.trim() : undefined;
32266
+ }
32267
+ return;
32268
+ };
32251
32269
  var fetchGmailWithRetry = async (fetchImpl, url, init, label) => {
32252
32270
  for (let attempt = 0;attempt <= GMAIL_MAX_RETRY_ATTEMPTS; attempt += 1) {
32253
32271
  const response = await fetchImpl(url, init);
@@ -32409,7 +32427,8 @@ var createRAGGraphEmailSyncClient = (config) => ({
32409
32427
  }
32410
32428
  });
32411
32429
  if (!listResponse.ok) {
32412
- throw new Error(`Graph message list failed: ${listResponse.status} ${listResponse.statusText}`);
32430
+ const detail = await readGraphErrorDetail(listResponse);
32431
+ throw new Error(`Graph message list failed: ${listResponse.status} ${listResponse.statusText}${detail ? ` (${detail})` : ""}`);
32413
32432
  }
32414
32433
  const listJson = await listResponse.json();
32415
32434
  const messages = await Promise.all((listJson.value ?? []).map(async (message) => {
@@ -36133,5 +36152,5 @@ export {
36133
36152
  addRAGEvaluationSuiteCase
36134
36153
  };
36135
36154
 
36136
- //# debugId=7661BF2D41E88F6A64756E2164756E21
36155
+ //# debugId=97FCF5C3C3EC8FDD64756E2164756E21
36137
36156
  //# sourceMappingURL=index.js.map