@versini/sassysaint-common 4.2.1 → 4.3.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/dist/index.d.ts +1 -0
- package/dist/index.js +51 -50
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
const w = "system", s = "user", c = "assistant",
|
1
|
+
const w = "system", s = "user", c = "assistant", re = "hidden", ne = "data", a = "OpenAI", i = "Anthropic", E = "Google", M = "Summary", g = "Memory", d = "Perplexity", oe = a, se = [
|
2
2
|
a,
|
3
3
|
i,
|
4
4
|
E
|
5
|
-
],
|
6
|
-
|
5
|
+
], A = "gpt-5", _ = "gpt-4.1-nano", m = "o4-mini", l = "claude-3-5-haiku-20241022", u = "claude-sonnet-4-20250514", R = "gemini-2.5-flash", p = "gemini-2.5-pro", f = "sonar", P = "sonar-pro", ce = [
|
6
|
+
A,
|
7
7
|
_,
|
8
8
|
m,
|
9
9
|
l,
|
10
|
-
|
11
|
-
f,
|
12
|
-
p,
|
10
|
+
u,
|
13
11
|
R,
|
12
|
+
p,
|
13
|
+
f,
|
14
14
|
P
|
15
|
-
],
|
16
|
-
u,
|
15
|
+
], ae = [
|
17
16
|
A,
|
17
|
+
u,
|
18
18
|
p
|
19
|
-
], b = "claude-sonnet-4", h = "claude-3", T = "gpt-", N = "o3", v = "o4",
|
19
|
+
], b = "claude-sonnet-4", h = "claude-3", T = "gpt-", N = "o3", v = "o4", C = "gemini", K = "sonar", U = {
|
20
20
|
[i]: [
|
21
21
|
b,
|
22
22
|
h
|
@@ -26,33 +26,34 @@ const w = "system", s = "user", c = "assistant", te = "hidden", re = "data", a =
|
|
26
26
|
N,
|
27
27
|
v
|
28
28
|
],
|
29
|
-
[E]: [
|
30
|
-
[d]: [
|
31
|
-
}, ae = {
|
32
|
-
[a]: [_, u],
|
33
|
-
[i]: [l, A],
|
34
|
-
[E]: [f, p],
|
35
|
-
[d]: [R, P]
|
29
|
+
[E]: [C],
|
30
|
+
[d]: [K]
|
36
31
|
}, ie = {
|
32
|
+
[a]: [_, A],
|
33
|
+
[i]: [l, u],
|
34
|
+
[E]: [R, p],
|
35
|
+
[d]: [f, P]
|
36
|
+
}, Ee = {
|
37
37
|
[a]: [w, s, c],
|
38
38
|
[i]: [s, c],
|
39
39
|
[M]: [s, c],
|
40
40
|
[g]: [s, c],
|
41
41
|
[E]: [s, c],
|
42
42
|
[d]: [s, c]
|
43
|
-
}, k = "sassy:free", F = "sassy:plus", G = "sassy:advanced", V = "sassy:advanced:reasoning",
|
43
|
+
}, k = "sassy:free", F = "sassy:plus", G = "sassy:advanced", V = "sassy:advanced:reasoning", Y = "sassy:advanced:websearch", ye = {
|
44
44
|
PLAN_FREE: k,
|
45
45
|
PLAN_PLUS: F,
|
46
46
|
PLAN_PREMIUM: G,
|
47
|
-
REASONING: V
|
48
|
-
|
47
|
+
REASONING: V,
|
48
|
+
WEBSEARCH: Y
|
49
|
+
}, de = "x-callisto-chat-id", Ae = (r) => {
|
49
50
|
for (const [e, n] of Object.entries(
|
50
51
|
U
|
51
52
|
))
|
52
53
|
if (n.some((t) => r.startsWith(t)))
|
53
54
|
return e;
|
54
55
|
return null;
|
55
|
-
}, ue = "timestamp",
|
56
|
+
}, ue = "timestamp", pe = "tokenUsage", Oe = "Callisto";
|
56
57
|
class o extends Error {
|
57
58
|
constructor(e, n, t) {
|
58
59
|
super(e), this.code = n, this.originalError = t, this.name = "CryptoError";
|
@@ -62,7 +63,7 @@ const S = {
|
|
62
63
|
keySize: 4096,
|
63
64
|
debug: !1
|
64
65
|
};
|
65
|
-
async function
|
66
|
+
async function x(r = {}) {
|
66
67
|
const e = { ...S, ...r };
|
67
68
|
try {
|
68
69
|
const n = {
|
@@ -99,7 +100,7 @@ async function Y(r = {}) {
|
|
99
100
|
);
|
100
101
|
}
|
101
102
|
}
|
102
|
-
async function
|
103
|
+
async function H(r) {
|
103
104
|
try {
|
104
105
|
return {
|
105
106
|
jwk: await crypto.subtle.exportKey("jwk", r),
|
@@ -160,7 +161,7 @@ async function X(r, e, n) {
|
|
160
161
|
);
|
161
162
|
}
|
162
163
|
}
|
163
|
-
async function
|
164
|
+
async function $(r, e) {
|
164
165
|
try {
|
165
166
|
const n = Uint8Array.from(
|
166
167
|
atob(r.data),
|
@@ -181,7 +182,7 @@ async function H(r, e) {
|
|
181
182
|
);
|
182
183
|
}
|
183
184
|
}
|
184
|
-
async function
|
185
|
+
async function j(r, e, n) {
|
185
186
|
try {
|
186
187
|
const t = await I(
|
187
188
|
r.serverPublicKey
|
@@ -201,10 +202,10 @@ async function $(r, e, n) {
|
|
201
202
|
);
|
202
203
|
}
|
203
204
|
}
|
204
|
-
function
|
205
|
+
function B(r) {
|
205
206
|
return !(!r || !r.clientKeyPair || !r.serverPublicKey);
|
206
207
|
}
|
207
|
-
function
|
208
|
+
function z() {
|
208
209
|
const r = Date.now().toString(36), e = new Uint8Array(8);
|
209
210
|
if (typeof window < "u" && window.crypto?.getRandomValues)
|
210
211
|
window.crypto.getRandomValues(e);
|
@@ -220,7 +221,7 @@ function L() {
|
|
220
221
|
function D() {
|
221
222
|
return typeof window < "u" && (window.isSecureContext || window.location.protocol === "https:");
|
222
223
|
}
|
223
|
-
function
|
224
|
+
function W() {
|
224
225
|
return L() && D();
|
225
226
|
}
|
226
227
|
function J(r) {
|
@@ -230,65 +231,65 @@ function J(r) {
|
|
230
231
|
n += String.fromCharCode(e[t]);
|
231
232
|
return btoa(n);
|
232
233
|
}
|
233
|
-
function
|
234
|
+
function q(r) {
|
234
235
|
const e = atob(r), n = new Uint8Array(e.length);
|
235
236
|
for (let t = 0; t < e.length; t++)
|
236
237
|
n[t] = e.charCodeAt(t);
|
237
238
|
return n.buffer;
|
238
239
|
}
|
239
|
-
function
|
240
|
+
function Q(r) {
|
240
241
|
try {
|
241
242
|
return JSON.stringify(r);
|
242
243
|
} catch {
|
243
244
|
return String(r);
|
244
245
|
}
|
245
246
|
}
|
246
|
-
function
|
247
|
+
function Z(r) {
|
247
248
|
try {
|
248
249
|
return JSON.parse(r);
|
249
250
|
} catch {
|
250
251
|
return null;
|
251
252
|
}
|
252
253
|
}
|
253
|
-
function
|
254
|
+
function ee(r, ...e) {
|
254
255
|
typeof process < "u" && process.env && process.env.NODE_ENV === "development" && console.info(`🔐 [Crypto] ${r}`, ...e);
|
255
256
|
}
|
256
|
-
const
|
257
|
+
const _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: o, DEFAULT_CRYPTO_CONFIG: S, arrayBufferToBase64: J, base64ToArrayBuffer: q, canUseEncryption: W, debugLog: ee, decryptFromServer: $, encryptForServer: X, establishCryptoSession: j, exportPublicKey: H, generateClientKeyPair: x, generateDeviceId: z, importServerPublicKey: I, isCryptoSessionValid: B, isSecureContext: D, isWebCryptoSupported: L, safeParse: Z, safeStringify: Q }, Symbol.toStringTag, { value: "Module" }));
|
257
258
|
export {
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
259
|
+
ce as ALL_MODELS,
|
260
|
+
se as ALL_PROVIDERS,
|
261
|
+
ae as ALL_REASONING_MODELS,
|
262
|
+
Oe as APPLICATION_NAME,
|
263
|
+
de as CALLISTO_CHAT_ID_HEADER,
|
264
|
+
oe as DEFAULT_PROVIDER,
|
265
|
+
ie as MODELS_PER_PROVIDER,
|
265
266
|
l as MODEL_CLAUDE_HAIKU,
|
266
|
-
|
267
|
-
|
267
|
+
u as MODEL_CLAUDE_SONNET,
|
268
|
+
R as MODEL_GEMINI_FLASH,
|
268
269
|
p as MODEL_GEMINI_PRO,
|
269
|
-
|
270
|
+
A as MODEL_GPT,
|
270
271
|
_ as MODEL_GPT4_MINI,
|
271
272
|
m as MODEL_O4_MINI,
|
272
|
-
|
273
|
+
f as MODEL_SONAR,
|
273
274
|
P as MODEL_SONAR_PRO,
|
274
275
|
k as PLAN_FREE,
|
275
276
|
F as PLAN_PLUS,
|
276
277
|
G as PLAN_PREMIUM,
|
277
|
-
|
278
|
+
ye as POLICY_GRANTS,
|
278
279
|
i as PROVIDER_ANTHROPIC,
|
279
280
|
E as PROVIDER_GOOGLE,
|
280
281
|
g as PROVIDER_MEMORY,
|
281
282
|
a as PROVIDER_OPENAI,
|
282
283
|
d as PROVIDER_PERPLEXITY,
|
283
|
-
|
284
|
+
Ee as PROVIDER_ROLE_MAP,
|
284
285
|
M as PROVIDER_SUMMARY,
|
285
286
|
c as ROLE_ASSISTANT,
|
286
|
-
|
287
|
-
|
287
|
+
re as ROLE_HIDDEN,
|
288
|
+
ne as ROLE_INTERNAL,
|
288
289
|
w as ROLE_SYSTEM,
|
289
290
|
s as ROLE_USER,
|
290
291
|
ue as SORT_BY_TIMESTAMP,
|
291
|
-
|
292
|
-
|
293
|
-
|
292
|
+
pe as SORT_BY_TOKEN_USAGE,
|
293
|
+
_e as crypto,
|
294
|
+
Ae as findProvider
|
294
295
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.3.0",
|
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": "639ee1b0e2f051da5a348b43c6ebeec211399986"
|
36
36
|
}
|