@versini/sassysaint-common 4.6.0 → 4.7.1
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/dist/index.d.ts +5 -4
- package/dist/index.js +24 -26
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -31,8 +31,9 @@ declare const MODEL_SONAR = "sonar";
|
|
31
31
|
declare const MODEL_SONAR_PRO = "sonar-pro";
|
32
32
|
/**
|
33
33
|
* List of all models available TODAY.
|
34
|
+
* This is used by the client to display the list of models.
|
34
35
|
*/
|
35
|
-
declare const ALL_MODELS: readonly ["gpt-5", "gpt-4.1-nano", "o4-mini", "claude-3-5-haiku-20241022", "claude-sonnet-4-20250514", "gemini-2.5-flash", "gemini-2.5-pro"
|
36
|
+
declare const ALL_MODELS: readonly ["gpt-5", "gpt-4.1-nano", "o4-mini", "claude-3-5-haiku-20241022", "claude-sonnet-4-20250514", "gemini-2.5-flash", "gemini-2.5-pro"];
|
36
37
|
declare const ALL_REASONING_MODELS: string[];
|
37
38
|
/**
|
38
39
|
* List of models available according to the providers.
|
@@ -55,10 +56,10 @@ declare const PROVIDER_ROLE_MAP: {
|
|
55
56
|
Perplexity: string[];
|
56
57
|
};
|
57
58
|
/**
|
58
|
-
* Header string for
|
59
|
+
* Header string for Diggidy Chat Id. Used to identify the chat in the server
|
59
60
|
* when there is a client abort.
|
60
61
|
*/
|
61
|
-
declare const DIGGITY_CHAT_ID_HEADER = "x-
|
62
|
+
declare const DIGGITY_CHAT_ID_HEADER = "x-diggidy-chat-id";
|
62
63
|
/**
|
63
64
|
* This function finds the provider associated with a given model name. It
|
64
65
|
* checks the model name against a list of approximate models for each provider.
|
@@ -76,7 +77,7 @@ declare const SORT_BY_TOKEN_USAGE = "tokenUsage";
|
|
76
77
|
/**
|
77
78
|
* Name of the application.
|
78
79
|
*/
|
79
|
-
declare const APPLICATION_NAME = "
|
80
|
+
declare const APPLICATION_NAME = "Diggidy";
|
80
81
|
|
81
82
|
/**
|
82
83
|
* TypeScript interfaces for Server-Mediated Encryption.
|
package/dist/index.js
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
const
|
1
|
+
const g = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i = "OpenAI", E = "Anthropic", y = "Google", D = "Summary", L = "Memory", u = "Perplexity", re = i, oe = [
|
2
2
|
i,
|
3
3
|
E,
|
4
4
|
y
|
5
|
-
], d = "gpt-5", l = "gpt-4.1-nano",
|
5
|
+
], d = "gpt-5", l = "gpt-4.1-nano", T = "o4-mini", f = "claude-3-5-haiku-20241022", O = "claude-sonnet-4-20250514", R = "gemini-2.5-flash", p = "gemini-2.5-pro", M = "sonar", w = "sonar-pro", se = [
|
6
6
|
d,
|
7
7
|
l,
|
8
|
-
|
8
|
+
T,
|
9
9
|
f,
|
10
10
|
O,
|
11
11
|
R,
|
12
|
-
p
|
13
|
-
_,
|
14
|
-
P
|
12
|
+
p
|
15
13
|
], ae = [
|
16
14
|
d,
|
17
15
|
O,
|
@@ -32,33 +30,33 @@ const L = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i =
|
|
32
30
|
[i]: [l, d],
|
33
31
|
[E]: [f, O],
|
34
32
|
[y]: [R, p],
|
35
|
-
[u]: [
|
33
|
+
[u]: [M, w]
|
36
34
|
}, ie = {
|
37
|
-
[i]: [
|
35
|
+
[i]: [g, a, c],
|
38
36
|
[E]: [a, c],
|
39
|
-
[
|
40
|
-
[
|
37
|
+
[D]: [a, c],
|
38
|
+
[L]: [a, c],
|
41
39
|
[y]: [a, c],
|
42
40
|
[u]: [a, c]
|
43
|
-
}, Ee = "x-
|
41
|
+
}, Ee = "x-diggidy-chat-id", ye = (n) => {
|
44
42
|
for (const [e, r] of Object.entries(
|
45
43
|
K
|
46
44
|
))
|
47
45
|
if (r.some((t) => n.startsWith(t)))
|
48
46
|
return e;
|
49
47
|
return null;
|
50
|
-
}, Ae = "timestamp", ue = "tokenUsage", de = "
|
48
|
+
}, Ae = "timestamp", ue = "tokenUsage", de = "Diggidy";
|
51
49
|
class s extends Error {
|
52
50
|
constructor(e, r, t) {
|
53
51
|
super(e), this.code = r, this.originalError = t, this.name = "CryptoError";
|
54
52
|
}
|
55
53
|
}
|
56
|
-
const
|
54
|
+
const _ = {
|
57
55
|
keySize: 4096,
|
58
56
|
debug: !1
|
59
57
|
};
|
60
58
|
async function k(n = {}) {
|
61
|
-
const e = { ...
|
59
|
+
const e = { ..._, ...n };
|
62
60
|
try {
|
63
61
|
const r = {
|
64
62
|
modulusLength: e.keySize,
|
@@ -109,7 +107,7 @@ async function G(n) {
|
|
109
107
|
);
|
110
108
|
}
|
111
109
|
}
|
112
|
-
async function
|
110
|
+
async function P(n) {
|
113
111
|
try {
|
114
112
|
const e = JSON.parse(n);
|
115
113
|
return await crypto.subtle.importKey(
|
@@ -178,7 +176,7 @@ async function Y(n, e) {
|
|
178
176
|
}
|
179
177
|
async function H(n, e, r) {
|
180
178
|
try {
|
181
|
-
const t = await
|
179
|
+
const t = await P(
|
182
180
|
n.serverPublicKey
|
183
181
|
);
|
184
182
|
return {
|
@@ -209,14 +207,14 @@ function x() {
|
|
209
207
|
const r = Array.from(e).map((t) => t.toString(36)).join("");
|
210
208
|
return `device_${n}_${r}`;
|
211
209
|
}
|
212
|
-
function
|
210
|
+
function I() {
|
213
211
|
return typeof window < "u" && typeof window.crypto < "u" && typeof window.crypto.subtle < "u";
|
214
212
|
}
|
215
|
-
function
|
213
|
+
function S() {
|
216
214
|
return typeof window < "u" && (window.isSecureContext || window.location.protocol === "https:");
|
217
215
|
}
|
218
216
|
function X() {
|
219
|
-
return
|
217
|
+
return I() && S();
|
220
218
|
}
|
221
219
|
function $(n) {
|
222
220
|
const e = new Uint8Array(n);
|
@@ -248,7 +246,7 @@ function z(n) {
|
|
248
246
|
function W(n, ...e) {
|
249
247
|
typeof process < "u" && process.env && process.env.NODE_ENV === "development" && console.info(`🔐 [Crypto] ${n}`, ...e);
|
250
248
|
}
|
251
|
-
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG:
|
249
|
+
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: _, arrayBufferToBase64: $, base64ToArrayBuffer: j, canUseEncryption: X, debugLog: W, decryptFromServer: Y, encryptForServer: F, establishCryptoSession: H, exportPublicKey: G, generateClientKeyPair: k, generateDeviceId: x, importServerPublicKey: P, isCryptoSessionValid: V, isSecureContext: S, isWebCryptoSupported: I, safeParse: z, safeStringify: B }, Symbol.toStringTag, { value: "Module" })), J = "sassy:free", Z = "sassy:plus", Q = "sassy:advanced", pe = {
|
252
250
|
PLAN_FREE: J,
|
253
251
|
PLAN_PLUS: Z,
|
254
252
|
PLAN_PREMIUM: Q
|
@@ -298,24 +296,24 @@ export {
|
|
298
296
|
p as MODEL_GEMINI_PRO,
|
299
297
|
l as MODEL_GPT4_MINI,
|
300
298
|
d as MODEL_GPT5,
|
301
|
-
|
302
|
-
|
303
|
-
|
299
|
+
T as MODEL_O4_MINI,
|
300
|
+
M as MODEL_SONAR,
|
301
|
+
w as MODEL_SONAR_PRO,
|
304
302
|
J as PLAN_FREE,
|
305
303
|
Z as PLAN_PLUS,
|
306
304
|
Q as PLAN_PREMIUM,
|
307
305
|
pe as POLICY_GRANTS,
|
308
306
|
E as PROVIDER_ANTHROPIC,
|
309
307
|
y as PROVIDER_GOOGLE,
|
310
|
-
|
308
|
+
L as PROVIDER_MEMORY,
|
311
309
|
i as PROVIDER_OPENAI,
|
312
310
|
u as PROVIDER_PERPLEXITY,
|
313
311
|
ie as PROVIDER_ROLE_MAP,
|
314
|
-
|
312
|
+
D as PROVIDER_SUMMARY,
|
315
313
|
c as ROLE_ASSISTANT,
|
316
314
|
te as ROLE_HIDDEN,
|
317
315
|
ne as ROLE_INTERNAL,
|
318
|
-
|
316
|
+
g as ROLE_SYSTEM,
|
319
317
|
a as ROLE_USER,
|
320
318
|
Ae as SORT_BY_TIMESTAMP,
|
321
319
|
ue as SORT_BY_TOKEN_USAGE,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.7.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "Arno Versini",
|
6
6
|
"publishConfig": {
|
@@ -32,5 +32,5 @@
|
|
32
32
|
"test:watch": "vitest",
|
33
33
|
"watch": "npm-run-all dev"
|
34
34
|
},
|
35
|
-
"gitHead": "
|
35
|
+
"gitHead": "f723c011e9eb00ed5039f7828874d4b31d1630bf"
|
36
36
|
}
|