@versini/sassysaint-common 4.0.1 → 4.0.3
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 +1 -0
- package/dist/index.js +39 -39
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -76,6 +76,7 @@ declare const POLICY_GRANTS: {
|
|
76
76
|
declare const CALLISTO_CHAT_ID_HEADER = "x-callisto-chat-id";
|
77
77
|
/**
|
78
78
|
* This function finds the provider associated with a given model name.
|
79
|
+
* It checks the model name against a list of approximate models for each provider.
|
79
80
|
*
|
80
81
|
* @param modelName - The model name to check.
|
81
82
|
* @returns The provider associated with the model name or null if not found.
|
package/dist/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
const g = "system", s = "user", c = "assistant",
|
1
|
+
const g = "system", s = "user", c = "assistant", te = "hidden", re = "data", a = "OpenAI", i = "Anthropic", y = "Google", M = "Summary", m = "Memory", d = "Perplexity", ne = a, oe = [
|
2
2
|
a,
|
3
3
|
i,
|
4
4
|
y
|
5
|
-
], _ = "gpt-4.1", l = "gpt-4.1-nano", u = "o4-mini", f = "claude-3-5-haiku-20241022", p = "claude-sonnet-4-20250514", R = "gemini-2.5-flash", A = "gemini-2.5-pro", P = "sonar", I = "sonar-pro",
|
5
|
+
], _ = "gpt-4.1", l = "gpt-4.1-nano", u = "o4-mini", f = "claude-3-5-haiku-20241022", p = "claude-sonnet-4-20250514", R = "gemini-2.5-flash", A = "gemini-2.5-pro", P = "sonar", I = "sonar-pro", se = [
|
6
6
|
_,
|
7
7
|
l,
|
8
8
|
u,
|
@@ -12,40 +12,40 @@ const g = "system", s = "user", c = "assistant", ee = "hidden", te = "data", a =
|
|
12
12
|
A,
|
13
13
|
P,
|
14
14
|
I
|
15
|
-
],
|
15
|
+
], ce = [
|
16
16
|
u,
|
17
17
|
p,
|
18
18
|
A
|
19
|
-
], b = "claude-sonnet-4", h = "claude-3",
|
19
|
+
], b = "claude-sonnet-4", h = "claude-3", N = "gpt-4", T = "o3", v = "o4", K = "gemini", C = "sonar", U = {
|
20
20
|
[i]: [
|
21
21
|
b,
|
22
22
|
h
|
23
23
|
],
|
24
24
|
[a]: [
|
25
|
-
T,
|
26
25
|
N,
|
26
|
+
T,
|
27
27
|
v
|
28
28
|
],
|
29
29
|
[y]: [K],
|
30
30
|
[d]: [C]
|
31
|
-
},
|
31
|
+
}, ae = {
|
32
32
|
[a]: [l, _, u],
|
33
33
|
[i]: [f, p],
|
34
34
|
[y]: [R, A],
|
35
35
|
[d]: [P, I]
|
36
|
-
},
|
36
|
+
}, ie = {
|
37
37
|
[a]: [g, s, c],
|
38
38
|
[i]: [s, c],
|
39
39
|
[M]: [s, c],
|
40
40
|
[m]: [s, c],
|
41
41
|
[y]: [s, c],
|
42
42
|
[d]: [s, c]
|
43
|
-
}, k = "sassy:free", F = "sassy:plus", G = "sassy:advanced",
|
43
|
+
}, k = "sassy:free", F = "sassy:plus", G = "sassy:advanced", V = "sassy:advanced:reasoning", ye = {
|
44
44
|
PLAN_FREE: k,
|
45
45
|
PLAN_PLUS: F,
|
46
46
|
PLAN_PREMIUM: G,
|
47
|
-
REASONING:
|
48
|
-
},
|
47
|
+
REASONING: V
|
48
|
+
}, Ee = "x-callisto-chat-id", de = (r) => {
|
49
49
|
for (const [e, n] of Object.entries(
|
50
50
|
U
|
51
51
|
))
|
@@ -62,7 +62,7 @@ const S = {
|
|
62
62
|
keySize: 4096,
|
63
63
|
debug: !1
|
64
64
|
};
|
65
|
-
async function
|
65
|
+
async function x(r = {}) {
|
66
66
|
const e = { ...S, ...r };
|
67
67
|
try {
|
68
68
|
const n = {
|
@@ -99,7 +99,7 @@ async function V(r = {}) {
|
|
99
99
|
);
|
100
100
|
}
|
101
101
|
}
|
102
|
-
async function
|
102
|
+
async function Y(r) {
|
103
103
|
try {
|
104
104
|
return {
|
105
105
|
jwk: await crypto.subtle.exportKey("jwk", r),
|
@@ -114,7 +114,7 @@ async function x(r) {
|
|
114
114
|
);
|
115
115
|
}
|
116
116
|
}
|
117
|
-
async function
|
117
|
+
async function L(r) {
|
118
118
|
try {
|
119
119
|
const e = JSON.parse(r);
|
120
120
|
return await crypto.subtle.importKey(
|
@@ -136,7 +136,7 @@ async function D(r) {
|
|
136
136
|
);
|
137
137
|
}
|
138
138
|
}
|
139
|
-
async function
|
139
|
+
async function X(r, e, n) {
|
140
140
|
try {
|
141
141
|
const O = new TextEncoder().encode(r), E = await crypto.subtle.encrypt(
|
142
142
|
{
|
@@ -181,9 +181,9 @@ async function H(r, e) {
|
|
181
181
|
);
|
182
182
|
}
|
183
183
|
}
|
184
|
-
async function
|
184
|
+
async function $(r, e, n) {
|
185
185
|
try {
|
186
|
-
const t = await
|
186
|
+
const t = await L(
|
187
187
|
r.serverPublicKey
|
188
188
|
);
|
189
189
|
return {
|
@@ -201,10 +201,10 @@ async function X(r, e, n) {
|
|
201
201
|
);
|
202
202
|
}
|
203
203
|
}
|
204
|
-
function
|
204
|
+
function j(r) {
|
205
205
|
return !(!r || !r.clientKeyPair || !r.serverPublicKey);
|
206
206
|
}
|
207
|
-
function
|
207
|
+
function z() {
|
208
208
|
const r = Date.now().toString(36), e = new Uint8Array(8);
|
209
209
|
if (typeof window < "u" && window.crypto?.getRandomValues)
|
210
210
|
window.crypto.getRandomValues(e);
|
@@ -214,53 +214,53 @@ function j() {
|
|
214
214
|
const n = Array.from(e).map((t) => t.toString(36)).join("");
|
215
215
|
return `device_${r}_${n}`;
|
216
216
|
}
|
217
|
-
function
|
217
|
+
function D() {
|
218
218
|
return typeof window < "u" && typeof window.crypto < "u" && typeof window.crypto.subtle < "u";
|
219
219
|
}
|
220
220
|
function w() {
|
221
221
|
return typeof window < "u" && (window.isSecureContext || window.location.protocol === "https:");
|
222
222
|
}
|
223
|
-
function
|
224
|
-
return
|
223
|
+
function B() {
|
224
|
+
return D() && w();
|
225
225
|
}
|
226
|
-
function
|
226
|
+
function J(r) {
|
227
227
|
const e = new Uint8Array(r);
|
228
228
|
let n = "";
|
229
229
|
for (let t = 0; t < e.byteLength; t++)
|
230
230
|
n += String.fromCharCode(e[t]);
|
231
231
|
return btoa(n);
|
232
232
|
}
|
233
|
-
function
|
233
|
+
function W(r) {
|
234
234
|
const e = atob(r), n = new Uint8Array(e.length);
|
235
235
|
for (let t = 0; t < e.length; t++)
|
236
236
|
n[t] = e.charCodeAt(t);
|
237
237
|
return n.buffer;
|
238
238
|
}
|
239
|
-
function
|
239
|
+
function q(r) {
|
240
240
|
try {
|
241
241
|
return JSON.stringify(r);
|
242
242
|
} catch {
|
243
243
|
return String(r);
|
244
244
|
}
|
245
245
|
}
|
246
|
-
function
|
246
|
+
function Q(r) {
|
247
247
|
try {
|
248
248
|
return JSON.parse(r);
|
249
249
|
} catch {
|
250
250
|
return null;
|
251
251
|
}
|
252
252
|
}
|
253
|
-
function
|
253
|
+
function Z(r, ...e) {
|
254
254
|
typeof process < "u" && process.env && process.env.NODE_ENV === "development" && console.info(`🔐 [Crypto] ${r}`, ...e);
|
255
255
|
}
|
256
|
-
const
|
256
|
+
const ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: o, DEFAULT_CRYPTO_CONFIG: S, arrayBufferToBase64: J, base64ToArrayBuffer: W, canUseEncryption: B, debugLog: Z, decryptFromServer: H, encryptForServer: X, establishCryptoSession: $, exportPublicKey: Y, generateClientKeyPair: x, generateDeviceId: z, importServerPublicKey: L, isCryptoSessionValid: j, isSecureContext: w, isWebCryptoSupported: D, safeParse: Q, safeStringify: q }, Symbol.toStringTag, { value: "Module" }));
|
257
257
|
export {
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
258
|
+
se as ALL_MODELS,
|
259
|
+
oe as ALL_PROVIDERS,
|
260
|
+
ce as ALL_REASONING_MODELS,
|
261
|
+
Ee as CALLISTO_CHAT_ID_HEADER,
|
262
|
+
ne as DEFAULT_PROVIDER,
|
263
|
+
ae as MODELS_PER_PROVIDER,
|
264
264
|
f as MODEL_CLAUDE_HAIKU,
|
265
265
|
p as MODEL_CLAUDE_SONNET,
|
266
266
|
R as MODEL_GEMINI_FLASH,
|
@@ -273,19 +273,19 @@ export {
|
|
273
273
|
k as PLAN_FREE,
|
274
274
|
F as PLAN_PLUS,
|
275
275
|
G as PLAN_PREMIUM,
|
276
|
-
|
276
|
+
ye as POLICY_GRANTS,
|
277
277
|
i as PROVIDER_ANTHROPIC,
|
278
278
|
y as PROVIDER_GOOGLE,
|
279
279
|
m as PROVIDER_MEMORY,
|
280
280
|
a as PROVIDER_OPENAI,
|
281
281
|
d as PROVIDER_PERPLEXITY,
|
282
|
-
|
282
|
+
ie as PROVIDER_ROLE_MAP,
|
283
283
|
M as PROVIDER_SUMMARY,
|
284
284
|
c as ROLE_ASSISTANT,
|
285
|
-
|
286
|
-
|
285
|
+
te as ROLE_HIDDEN,
|
286
|
+
re as ROLE_INTERNAL,
|
287
287
|
g as ROLE_SYSTEM,
|
288
288
|
s as ROLE_USER,
|
289
|
-
|
290
|
-
|
289
|
+
ue as crypto,
|
290
|
+
de as findProvider
|
291
291
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.3",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "Arno Versini",
|
6
6
|
"publishConfig": {
|
@@ -30,5 +30,5 @@
|
|
30
30
|
"test:watch": "vitest",
|
31
31
|
"watch": "npm-run-all dev"
|
32
32
|
},
|
33
|
-
"gitHead": "
|
33
|
+
"gitHead": "a5b3af998781c2253b3bb7b7fa14ad0d2ed4b022"
|
34
34
|
}
|